@stakekit/widget 0.0.273 → 0.0.274

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.
Files changed (39) hide show
  1. package/dist/bundle/index.bundle.js +7 -7
  2. package/dist/package/index.package.js +1951 -1746
  3. package/dist/types/domain/types/yields.d.ts +2 -1
  4. package/dist/types/hooks/api/use-dashboard-yield-catalog.d.ts +20 -0
  5. package/dist/types/hooks/api/use-token-list-yields.d.ts +11 -1
  6. package/dist/types/hooks/api/use-yield-summaries.d.ts +50 -0
  7. package/dist/types/pages/details/earn-page/components/select-token-section/select-token-list-item.d.ts +3 -1
  8. package/dist/types/pages/details/earn-page/state/types.d.ts +9 -1
  9. package/dist/website/assets/{basic-Bo7SBwII.js → basic-BVJnMIHl.js} +1 -1
  10. package/dist/website/assets/{basic-ThspdnuL.js → basic-CibIan8y.js} +1 -1
  11. package/dist/website/assets/{browser-DskDvf4V.js → browser--EMMYaan.js} +1 -1
  12. package/dist/website/assets/{build-DN0pJtdR.js → build-BPw0SHWb.js} +1 -1
  13. package/dist/website/assets/{build-BmJ27Vry.js → build-DFEPAT8y.js} +1 -1
  14. package/dist/website/assets/{cardano-connector-B2Ea9uXJ.js → cardano-connector-CbHZBb34.js} +1 -1
  15. package/dist/website/assets/{core-BFFu4TZK.js → core-BSLy_t4A.js} +2 -2
  16. package/dist/website/assets/{dist-BC-yZnz1.js → dist-BRCQU1Li.js} +1 -1
  17. package/dist/website/assets/{dist-DwMZ-Epn.js → dist-DAbkzFAO.js} +1 -1
  18. package/dist/website/assets/en_US-IFPOGBSL-BzV0u3lE.js +1 -0
  19. package/dist/website/assets/{esm-Bvq2M2B2.js → esm-FztE-O2S.js} +1 -1
  20. package/dist/website/assets/{exports-BEqJeoxC.js → exports-DiWzDOxG.js} +1 -1
  21. package/dist/website/assets/index-BIOEiLJw.js +2044 -0
  22. package/dist/website/assets/{index.es-qQnPYJtJ.js → index.es-D3Xa7Qme.js} +2 -2
  23. package/dist/website/assets/{ledger-connector-C520fQQY.js → ledger-connector-6wqonZoy.js} +1 -1
  24. package/dist/website/assets/{receive-Dcx0aHWA.js → receive-BN_rE1dd.js} +1 -1
  25. package/dist/website/assets/{registry-CvkKYDcW.js → registry-DLj0P6dj.js} +1 -1
  26. package/dist/website/assets/{safe-connector-CDGYW3b8.js → safe-connector-NQlNJxmf.js} +1 -1
  27. package/dist/website/assets/{socials-BDwTFvCa.js → socials-C3M2JNCz.js} +1 -1
  28. package/dist/website/assets/{solana-connector-BcHaSaSq.js → solana-connector-hzwYOzto.js} +1 -1
  29. package/dist/website/assets/{substrate-connector-DxYe9s4o.js → substrate-connector-CCxDFYG6.js} +1 -1
  30. package/dist/website/assets/{ton-connector-sD5IEuy2.js → ton-connector-DlVKNF8w.js} +1 -1
  31. package/dist/website/assets/{tron-connector-DgBR_biA.js → tron-connector-C6xS9wMC.js} +3 -3
  32. package/dist/website/assets/tx-CXZ9mGxZ.js +1 -0
  33. package/dist/website/assets/{wallet-manager-4JkYZ_Wn.js → wallet-manager-BxPcB4lR.js} +3 -3
  34. package/dist/website/assets/{wui-qr-code-CadVdoQK.js → wui-qr-code-CNh2d2fT.js} +1 -1
  35. package/dist/website/index.html +1 -1
  36. package/package.json +1 -1
  37. package/dist/website/assets/en_US-IFPOGBSL-DY8aJwVh.js +0 -1
  38. package/dist/website/assets/index-DTVV95ia.js +0 -2044
  39. package/dist/website/assets/tx-Cjn1Xzt5.js +0 -1
@@ -1,8 +1,8 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/utils-14NfwrBn.js","assets/chunk-CzyJ72yW.js","assets/dist-rLdy04_b.js","assets/dist-BNDiu-ID.js","assets/dist-CbYzjs0N.js","assets/build-BmJ27Vry.js","assets/build-DXB-Xkl3.js","assets/sha2-CtXu6r0A.js","assets/legacy-Mhle6HPJ.js","assets/pbkdf2-DnaBsumg.js","assets/has-property-descriptors-eLb-xvm3.js","assets/build-DN0pJtdR.js","assets/name-service-D-oY_Ca5.js","assets/dist-BC-yZnz1.js","assets/index-DTVV95ia.js","assets/preload-helper-DzyYoeor.js","assets/secp256k1-COENLGio.js","assets/utils-Ds5_DcfQ.js","assets/hmac-Ct2FWp2C.js","assets/utils-DBNb3TAV.js","assets/_shortw_utils-CZEAaHmN.js","assets/src-BVVCPwNZ.js","assets/utils-tO6_qHLh.js","assets/index.es-Bk6Eex5v.js","assets/esm-Bwjh0hft.js","assets/sha256-BdXxttE2.js","assets/sha3-CDZ-aOth.js","assets/exports-CHrRDjNC.js","assets/lit-element-CPGuB_v8.js","assets/browser-ponyfill-BtdYAc_i.js","assets/events-Dz20IHRz.js","assets/index.es-Db9uv8UH.js","assets/index.es-GvscGfHE.js","assets/elliptic-29QpX1Dw.js","assets/bn-2we3y6fO.js","assets/big-Do47_XZn.js","assets/lit-CDbVcvTE.js","assets/utils-ihIHVwY-.js","assets/formatUnits-DjLK35gc.js","assets/createConnector-BcHSC56W.js","assets/isAddressEqual-D_XbkOak.js","assets/getAbiItem-BJPwnmQn.js","assets/base-CqFrPqX1.js","assets/toBytes-DiTqRJTE.js","assets/stringify-DoeZ9PaV.js","assets/assertRequest-S6qmRF-X.js","assets/node-BqRbpq2S.js","assets/encodeFunctionData-dy9a9oBR.js","assets/createBatchScheduler-CgjpLR7V.js","assets/bs58-BBhlX9sY.js","assets/Codec-D4K5RIsS.js","assets/http-BVmqTAvl.js","assets/withTimeout-CjYhtdDq.js","assets/fallback-BZWOX_W7.js","assets/networks-CWeJ1anG.js","assets/index-E_6jknHw.css","assets/p256-08O5ugWR.js","assets/blake2-CGlfsXoS.js","assets/esm-SeYA9l8u.js","assets/blakejs-Dk2rjG-7.js","assets/src-Djtn6dts.js"])))=>i.map(i=>d[i]);
2
- import{a as e,n as t,o as n,r,s as i,t as a}from"./chunk-CzyJ72yW.js";import{n as o,t as s}from"./dist-CbYzjs0N.js";import{D as c,H as l,b as u,n as d,q as f,t as p}from"./createConnector-BcHSC56W.js";import{n as m,t as h}from"./dist-BNDiu-ID.js";import{t as g}from"./preload-helper-DzyYoeor.js";import{i as _,r as v,t as y}from"./dist-rLdy04_b.js";import{t as b}from"./networks-CWeJ1anG.js";import{i as x,n as S,t as C}from"./bs58-BBhlX9sY.js";import{t as w}from"./bn-2we3y6fO.js";import{a as T,i as E,n as D,o as O,r as k,s as A,t as j}from"./elliptic-29QpX1Dw.js";import{t as M}from"./events-Dz20IHRz.js";import{c as N,i as P,l as F,o as I,s as L,u as R}from"./index.es-Bk6Eex5v.js";import{_ as ee,a as te,d as ne,f as re,g as ie,h as ae,i as z,l as oe,n as se,o as ce,p as le,r as ue,s as de,t as fe,u as pe,v as me}from"./browser-ponyfill-BtdYAc_i.js";import{n as he,t as ge}from"./esm-Bwjh0hft.js";import{$ as _e,$t as ve,A as B,At as ye,B as be,Bt as xe,C as Se,Ct as Ce,D as we,Dt as Te,E as Ee,Et as De,F as V,Ft as Oe,G as ke,Gt as Ae,H as je,Ht as Me,I as Ne,It as Pe,J as Fe,Jt as Ie,K as Le,Kt as Re,L as ze,Lt as Be,M as Ve,Mt as He,N as Ue,Nt as We,O as Ge,Ot as Ke,P as qe,Pt as Je,Q as Ye,Qt as Xe,R as Ze,Rt as Qe,S as $e,St as et,T as tt,Tt as nt,U as rt,Ut as it,V as at,Vt as ot,W as st,Wt as ct,X as H,Xt as lt,Y as ut,Yt as dt,Z as ft,Zt as pt,_ as mt,_t as ht,a as gt,at as _t,b as vt,bt as yt,c as bt,ct as xt,d as St,en as Ct,et as wt,f as Tt,ft as Et,g as Dt,gt as Ot,h as kt,ht as At,i as jt,it as Mt,j as Nt,jt as Pt,k as Ft,kt as It,l as Lt,lt as Rt,m as zt,mt as Bt,n as Vt,nt as Ht,o as Ut,ot as Wt,p as Gt,pt as Kt,q as qt,qt as Jt,r as Yt,rt as Xt,s as Zt,st as Qt,t as $t,tn as en,tt as tn,u as nn,ut as rn,v as an,vt as on,w as sn,wt as cn,x as ln,xt as un,y as dn,yt as fn,z as pn,zt as mn}from"./dist-BC-yZnz1.js";import{S as hn,it as gn,nt as _n,rt as vn,tt as yn}from"./index-DTVV95ia.js";import{a as bn,o as xn,t as Sn}from"./build-DXB-Xkl3.js";import{a as Cn,c as wn,d as Tn,f as En,i as Dn,l as On,n as kn,o as U,r as An,s as jn,u as Mn}from"./utils-14NfwrBn.js";import{n as Nn,t as Pn}from"./src-C5tae8dD.js";import{n as Fn}from"./bignumber-CoBv9ViP.js";import{t as In}from"./v4-BcCgZyuS.js";import{n as Ln,t as Rn}from"./src-Djtn6dts.js";import{cosmosAssets as zn,registryIdsToSKCosmosNetworks as Bn}from"./chain-registry-CMG34mbw.js";import{t as Vn}from"./cjs-C4xHpwSP.js";var Hn=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.utf8Write=e.utf8Read=e.utf8Length=void 0;function t(e){let t=0,n=0;for(let r=0;r<e.length;++r)n=e.charCodeAt(r),n<128?t+=1:n<2048?t+=2:(n&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320?(++r,t+=4):t+=3;return t}e.utf8Length=t;function n(e,t,n){if(n-t<1)return``;let r=[],i=[],a=0,o;for(;t<n;)o=e[t++],o<128?r[a++]=o:o>191&&o<224?r[a++]=(o&31)<<6|e[t++]&63:o>239&&o<365?(o=((o&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,r[a++]=55296+(o>>10),r[a++]=56320+(o&1023)):r[a++]=(o&15)<<12|(e[t++]&63)<<6|e[t++]&63,a>8191&&((i||=[]).push(String.fromCharCode(...r)),a=0);return i?(a&&i.push(String.fromCharCode(...r.slice(0,a))),i.join(``)):String.fromCharCode(...r.slice(0,a))}e.utf8Read=n;function r(e,t,n){let r=n,i,a;for(let r=0;r<e.length;++r)i=e.charCodeAt(r),i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)==55296&&((a=e.charCodeAt(r+1))&64512)==56320?(i=65536+((i&1023)<<10)+(a&1023),++r,t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128);return n-r}e.utf8Write=r})),Un=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.writeByte=e.writeFixed32=e.int64Length=e.writeVarint64=e.writeVarint32=e.readInt32=e.readUInt32=e.zzDecode=e.zzEncode=e.varint32read=e.varint32write=e.uInt64ToString=e.int64ToString=e.int64FromString=e.varint64write=e.varint64read=void 0;function t(){let e=0,t=0;for(let n=0;n<28;n+=7){let r=this.buf[this.pos++];if(e|=(r&127)<<n,!(r&128))return this.assertBounds(),[e,t]}let n=this.buf[this.pos++];if(e|=(n&15)<<28,t=(n&112)>>4,!(n&128))return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let r=this.buf[this.pos++];if(t|=(r&127)<<n,!(r&128))return this.assertBounds(),[e,t]}throw Error(`invalid varint`)}e.varint64read=t;function n(e,t,n){for(let r=0;r<28;r+=7){let i=e>>>r,a=!(!(i>>>7)&&t==0),o=(a?i|128:i)&255;if(n.push(o),!a)return}let r=e>>>28&15|(t&7)<<4,i=!!(t>>3);if(n.push((i?r|128:r)&255),i){for(let e=3;e<31;e+=7){let r=t>>>e,i=!!(r>>>7),a=(i?r|128:r)&255;if(n.push(a),!i)return}n.push(t>>>31&1)}}e.varint64write=n;var r=4294967296;function i(e){let t=e[0]===`-`;t&&(e=e.slice(1));let n=1e6,i=0,a=0;function o(t,o){let s=Number(e.slice(t,o));a*=n,i=i*n+s,i>=r&&(a+=i/r|0,i%=r)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),t?l(i,a):c(i,a)}e.int64FromString=i;function a(e,t){let n=c(e,t),r=n.hi&2147483648;r&&(n=l(n.lo,n.hi));let i=o(n.lo,n.hi);return r?`-`+i:i}e.int64ToString=a;function o(e,t){if({lo:e,hi:t}=s(e,t),t<=2097151)return String(r*t+e);let n=e&16777215,i=(e>>>24|t<<8)&16777215,a=t>>16&65535,o=n+i*6777216+a*6710656,c=i+a*8147497,l=a*2,d=1e7;return o>=d&&(c+=Math.floor(o/d),o%=d),c>=d&&(l+=Math.floor(c/d),c%=d),l.toString()+u(c)+u(o)}e.uInt64ToString=o;function s(e,t){return{lo:e>>>0,hi:t>>>0}}function c(e,t){return{lo:e|0,hi:t|0}}function l(e,t){return t=~t,e?e=~e+1:t+=1,c(e,t)}var u=e=>{let t=String(e);return`0000000`.slice(t.length)+t};function d(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e>>>=7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e>>=7;t.push(1)}}e.varint32write=d;function f(){let e=this.buf[this.pos++],t=e&127;if(!(e&128)||(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128)))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let t=5;e&128&&t<10;t++)e=this.buf[this.pos++];if(e&128)throw Error(`invalid varint`);return this.assertBounds(),t>>>0}e.varint32read=f;function p(e,t){let n=t>>31;return t=((t<<1|e>>>31)^n)>>>0,e=(e<<1^n)>>>0,[e,t]}e.zzEncode=p;function m(e,t){let n=-(e&1);return e=((e>>>1|t<<31)^n)>>>0,t=(t>>>1^n)>>>0,[e,t]}e.zzDecode=m;function h(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+e[t+3]*16777216}e.readUInt32=h;function g(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}e.readInt32=g;function _(e,t,n){for(;e>127;)t[n++]=e&127|128,e>>>=7;t[n]=e}e.writeVarint32=_;function v(e,t,n){for(;e.hi;)t[n++]=e.lo&127|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=e.lo&127|128,e.lo>>>=7;t[n++]=e.lo}e.writeVarint64=v;function y(e,t){let n=e,r=(e>>>28|t<<4)>>>0,i=t>>>24;return i===0?r===0?n<16384?n<128?1:2:n<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:i<128?9:10}e.int64Length=y;function b(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}e.writeFixed32=b;function x(e,t,n){t[n]=e&255}e.writeByte=x})),Wn=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BinaryWriter=e.BinaryReader=e.WireType=void 0;var t=Hn(),n=Un(),r;(function(e){e[e.Varint=0]=`Varint`,e[e.Fixed64=1]=`Fixed64`,e[e.Bytes=2]=`Bytes`,e[e.Fixed32=5]=`Fixed32`})(r||(e.WireType=r={})),e.BinaryReader=class{assertBounds(){if(this.pos>this.len)throw RangeError(`premature EOF`)}constructor(e){this.buf=e?new Uint8Array(e):new Uint8Array,this.pos=0,this.type=0,this.len=this.buf.length}tag(){let e=this.uint32(),t=e>>>3,n=e&7;if(t<=0||n<0||n>5)throw Error(`illegal tag: field no `+t+` wire type `+n);return[t,n,e]}skip(e){if(typeof e==`number`){if(this.pos+e>this.len)throw c(this,e);this.pos+=e}else do if(this.pos>=this.len)throw c(this);while(this.buf[this.pos++]&128);return this}skipType(e){switch(e){case r.Varint:this.skip();break;case r.Fixed64:this.skip(8);break;case r.Bytes:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!=4;)this.skipType(e);break;case r.Fixed32:this.skip(4);break;default:throw Error(`invalid wire type `+e+` at offset `+this.pos)}return this}uint32(){return n.varint32read.bind(this)()}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e%2==1?(e+1)/-2:e/2}fixed32(){let e=(0,n.readUInt32)(this.buf,this.pos);return this.pos+=4,e}sfixed32(){let e=(0,n.readInt32)(this.buf,this.pos);return this.pos+=4,e}int64(){let[e,t]=n.varint64read.bind(this)();return BigInt((0,n.int64ToString)(e,t))}uint64(){let[e,t]=n.varint64read.bind(this)();return BigInt((0,n.uInt64ToString)(e,t))}sint64(){let[e,t]=n.varint64read.bind(this)();return[e,t]=(0,n.zzDecode)(e,t),BigInt((0,n.int64ToString)(e,t))}fixed64(){let e=this.sfixed32(),t=this.sfixed32();return BigInt((0,n.uInt64ToString)(e,t))}sfixed64(){let e=this.sfixed32(),t=this.sfixed32();return BigInt((0,n.int64ToString)(e,t))}float(){throw Error(`float not supported`)}double(){throw Error(`double not supported`)}bool(){let[e,t]=n.varint64read.bind(this)();return e!==0||t!==0}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){let e=this.bytes();return(0,t.utf8Read)(e,0,e.length)}};var i=class{constructor(e,t,n){this.fn=e,this.len=t,this.val=n}proceed(e,t){this.fn&&this.fn(this.val,e,t)}},a=class{constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}};e.BinaryWriter=class e{constructor(){this.len=0,this.uint64=e.prototype.int64,this.sfixed64=e.prototype.fixed64,this.sfixed32=e.prototype.fixed32,this.head=new i(null,0,0),this.tail=this.head,this.states=null}static create(){return new e}static alloc(e){return typeof Uint8Array<`u`?s(e=>new Uint8Array(e),Uint8Array.prototype.subarray)(e):Array(e)}_push(e,t,n){return this.tail=this.tail.next=new i(e,t,n),this.len+=t,this}finish(){let t=this.head.next,n=0,r=e.alloc(this.len);for(;t;)t.proceed(r,n),n+=t.len,t=t.next;return r}fork(){return this.states=new a(this),this.head=this.tail=new i(null,0,0),this.len=0,this}reset(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new i(null,0,0),this.len=0),this}ldelim(){let e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this}tag(e,t){return this.uint32((e<<3|t)>>>0)}uint32(e){return this.len+=(this.tail=this.tail.next=new i(n.writeVarint32,(e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(n.writeVarint64,10,(0,n.int64FromString)(e.toString())):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}int64(e){let{lo:t,hi:r}=(0,n.int64FromString)(e.toString());return this._push(n.writeVarint64,(0,n.int64Length)(t,r),{lo:t,hi:r})}sint64(e){let{lo:t,hi:r}=(0,n.int64FromString)(e.toString());return[t,r]=(0,n.zzEncode)(t,r),this._push(n.writeVarint64,(0,n.int64Length)(t,r),{lo:t,hi:r})}fixed64(e){let{lo:t,hi:r}=(0,n.int64FromString)(e.toString());return this._push(n.writeFixed32,4,t)._push(n.writeFixed32,4,r)}bool(e){return this._push(n.writeByte,1,+!!e)}fixed32(e){return this._push(n.writeFixed32,4,e>>>0)}float(e){throw Error(`float not supported`+e)}double(e){throw Error(`double not supported`+e)}bytes(e){let t=e.length>>>0;return t?this.uint32(t)._push(o,t,e):this._push(n.writeByte,1,0)}string(e){let r=(0,t.utf8Length)(e);return r?this.uint32(r)._push(t.utf8Write,r,e):this._push(n.writeByte,1,0)}};function o(e,t,n){if(typeof Uint8Array<`u`)t.set(e,n);else for(let r=0;r<e.length;++r)t[n+r]=e[r]}function s(e,t,n){let r=n||8192,i=r>>>1,a=null,o=r;return function(n){if(n<1||n>i)return e(n);o+n>r&&(a=e(r),o=0);let s=t.call(a,o,o+=n);return o&7&&(o=(o|7)+1),s}}function c(e,t){return RangeError(`index out of range: `+e.pos+` + `+(t||1)+` > `+e.len)}})),Gn=a((e=>{_(),m(),Object.defineProperty(e,`__esModule`,{value:!0}),e.fromJsonTimestamp=e.fromTimestamp=e.toTimestamp=e.isRpc=e.setPaginationParams=e.isObject=e.isSet=e.fromDuration=e.toDuration=e.omitDefault=e.base64FromBytes=e.bytesFromBase64=void 0;var t=(()=>{if(t!==void 0)return t;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),n=t.atob||(e=>t.Buffer.from(e,`base64`).toString(`binary`));function r(e){let t=n(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;++e)r[e]=t.charCodeAt(e);return r}e.bytesFromBase64=r;var i=t.btoa||(e=>t.Buffer.from(e,`binary`).toString(`base64`));function a(e){let t=[];return e.forEach(e=>{t.push(String.fromCharCode(e))}),i(t.join(``))}e.base64FromBytes=a;function o(e){if(typeof e==`string`)return e===``?void 0:e;if(typeof e==`number`)return e===0?void 0:e;if(typeof e==`boolean`)return e===!1?void 0:e;if(typeof e==`bigint`)return e===BigInt(0)?void 0:e;throw Error(`Got unsupported type ${typeof e}`)}e.omitDefault=o;function s(e){return{seconds:BigInt(Math.floor(parseInt(e)/1e9)),nanos:parseInt(e)%1e9}}e.toDuration=s;function c(e){return(parseInt(e.seconds.toString())*1e9+e.nanos).toString()}e.fromDuration=c;function l(e){return e!=null}e.isSet=l;function u(e){return typeof e==`object`&&!!e}e.isObject=u,e.setPaginationParams=(e,t)=>t?(t?.countTotal!==void 0&&(e.params[`pagination.count_total`]=t.countTotal),t?.key!==void 0&&(e.params[`pagination.key`]=y.from(t.key).toString(`base64`)),t?.limit!==void 0&&(e.params[`pagination.limit`]=t.limit.toString()),t?.offset!==void 0&&(e.params[`pagination.offset`]=t.offset.toString()),t?.reverse!==void 0&&(e.params[`pagination.reverse`]=t.reverse),e):e;function d(e){return e!=null&&typeof e.request==`function`}e.isRpc=d;function f(e){return{seconds:b(e.getTime()/1e3),nanos:e.getTime()%1e3*1e6}}e.toTimestamp=f;function p(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}e.fromTimestamp=p;var g=e=>({seconds:l(e.seconds)?BigInt(e.seconds.toString()):BigInt(0),nanos:l(e.nanos)?Number(e.nanos):0});function v(e){return e instanceof Date?f(e):typeof e==`string`?f(new Date(e)):g(e)}e.fromJsonTimestamp=v;function b(e){return BigInt(Math.trunc(e))}})),Kn=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Any=e.protobufPackage=void 0;var t=Wn(),n=Gn();e.protobufPackage=`google.protobuf`;function r(){return{typeUrl:``,value:new Uint8Array}}e.Any={typeUrl:`/google.protobuf.Any`,encode(e,n=t.BinaryWriter.create()){return e.typeUrl!==``&&n.uint32(10).string(e.typeUrl),e.value.length!==0&&n.uint32(18).bytes(e.value),n},decode(e,n){let i=e instanceof t.BinaryReader?e:new t.BinaryReader(e),a=n===void 0?i.len:i.pos+n,o=r();for(;i.pos<a;){let e=i.uint32();switch(e>>>3){case 1:o.typeUrl=i.string();break;case 2:o.value=i.bytes();break;default:i.skipType(e&7);break}}return o},fromJSON(e){let t=r();return(0,n.isSet)(e.typeUrl)&&(t.typeUrl=String(e.typeUrl)),(0,n.isSet)(e.value)&&(t.value=(0,n.bytesFromBase64)(e.value)),t},toJSON(e){let t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=(0,n.base64FromBytes)(e.value===void 0?new Uint8Array:e.value)),t},fromPartial(e){let t=r();return t.typeUrl=e.typeUrl??``,t.value=e.value??new Uint8Array,t}}})),qn=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CompactBitArray=e.MultiSignature=e.protobufPackage=void 0;var t=Wn(),n=Gn();e.protobufPackage=`cosmos.crypto.multisig.v1beta1`;function r(){return{signatures:[]}}e.MultiSignature={typeUrl:`/cosmos.crypto.multisig.v1beta1.MultiSignature`,encode(e,n=t.BinaryWriter.create()){for(let t of e.signatures)n.uint32(10).bytes(t);return n},decode(e,n){let i=e instanceof t.BinaryReader?e:new t.BinaryReader(e),a=n===void 0?i.len:i.pos+n,o=r();for(;i.pos<a;){let e=i.uint32();switch(e>>>3){case 1:o.signatures.push(i.bytes());break;default:i.skipType(e&7);break}}return o},fromJSON(e){let t=r();return Array.isArray(e?.signatures)&&(t.signatures=e.signatures.map(e=>(0,n.bytesFromBase64)(e))),t},toJSON(e){let t={};return e.signatures?t.signatures=e.signatures.map(e=>(0,n.base64FromBytes)(e===void 0?new Uint8Array:e)):t.signatures=[],t},fromPartial(e){let t=r();return t.signatures=e.signatures?.map(e=>e)||[],t}};function i(){return{extraBitsStored:0,elems:new Uint8Array}}e.CompactBitArray={typeUrl:`/cosmos.crypto.multisig.v1beta1.CompactBitArray`,encode(e,n=t.BinaryWriter.create()){return e.extraBitsStored!==0&&n.uint32(8).uint32(e.extraBitsStored),e.elems.length!==0&&n.uint32(18).bytes(e.elems),n},decode(e,n){let r=e instanceof t.BinaryReader?e:new t.BinaryReader(e),a=n===void 0?r.len:r.pos+n,o=i();for(;r.pos<a;){let e=r.uint32();switch(e>>>3){case 1:o.extraBitsStored=r.uint32();break;case 2:o.elems=r.bytes();break;default:r.skipType(e&7);break}}return o},fromJSON(e){let t=i();return(0,n.isSet)(e.extraBitsStored)&&(t.extraBitsStored=Number(e.extraBitsStored)),(0,n.isSet)(e.elems)&&(t.elems=(0,n.bytesFromBase64)(e.elems)),t},toJSON(e){let t={};return e.extraBitsStored!==void 0&&(t.extraBitsStored=Math.round(e.extraBitsStored)),e.elems!==void 0&&(t.elems=(0,n.base64FromBytes)(e.elems===void 0?new Uint8Array:e.elems)),t},fromPartial(e){let t=i();return t.extraBitsStored=e.extraBitsStored??0,t.elems=e.elems??new Uint8Array,t}}})),Jn=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SignatureDescriptor_Data_Multi=e.SignatureDescriptor_Data_Single=e.SignatureDescriptor_Data=e.SignatureDescriptor=e.SignatureDescriptors=e.signModeToJSON=e.signModeFromJSON=e.SignMode=e.protobufPackage=void 0;var t=qn(),n=Kn(),r=Wn(),i=Gn();e.protobufPackage=`cosmos.tx.signing.v1beta1`;var a;(function(e){e[e.SIGN_MODE_UNSPECIFIED=0]=`SIGN_MODE_UNSPECIFIED`,e[e.SIGN_MODE_DIRECT=1]=`SIGN_MODE_DIRECT`,e[e.SIGN_MODE_TEXTUAL=2]=`SIGN_MODE_TEXTUAL`,e[e.SIGN_MODE_DIRECT_AUX=3]=`SIGN_MODE_DIRECT_AUX`,e[e.SIGN_MODE_LEGACY_AMINO_JSON=127]=`SIGN_MODE_LEGACY_AMINO_JSON`,e[e.SIGN_MODE_EIP_191=191]=`SIGN_MODE_EIP_191`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(a||(e.SignMode=a={}));function o(e){switch(e){case 0:case`SIGN_MODE_UNSPECIFIED`:return a.SIGN_MODE_UNSPECIFIED;case 1:case`SIGN_MODE_DIRECT`:return a.SIGN_MODE_DIRECT;case 2:case`SIGN_MODE_TEXTUAL`:return a.SIGN_MODE_TEXTUAL;case 3:case`SIGN_MODE_DIRECT_AUX`:return a.SIGN_MODE_DIRECT_AUX;case 127:case`SIGN_MODE_LEGACY_AMINO_JSON`:return a.SIGN_MODE_LEGACY_AMINO_JSON;case 191:case`SIGN_MODE_EIP_191`:return a.SIGN_MODE_EIP_191;default:return a.UNRECOGNIZED}}e.signModeFromJSON=o;function s(e){switch(e){case a.SIGN_MODE_UNSPECIFIED:return`SIGN_MODE_UNSPECIFIED`;case a.SIGN_MODE_DIRECT:return`SIGN_MODE_DIRECT`;case a.SIGN_MODE_TEXTUAL:return`SIGN_MODE_TEXTUAL`;case a.SIGN_MODE_DIRECT_AUX:return`SIGN_MODE_DIRECT_AUX`;case a.SIGN_MODE_LEGACY_AMINO_JSON:return`SIGN_MODE_LEGACY_AMINO_JSON`;case a.SIGN_MODE_EIP_191:return`SIGN_MODE_EIP_191`;case a.UNRECOGNIZED:default:return`UNRECOGNIZED`}}e.signModeToJSON=s;function c(){return{signatures:[]}}e.SignatureDescriptors={typeUrl:`/cosmos.tx.signing.v1beta1.SignatureDescriptors`,encode(t,n=r.BinaryWriter.create()){for(let r of t.signatures)e.SignatureDescriptor.encode(r,n.uint32(10).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.BinaryReader?t:new r.BinaryReader(t),a=n===void 0?i.len:i.pos+n,o=c();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.signatures.push(e.SignatureDescriptor.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){let n=c();return Array.isArray(t?.signatures)&&(n.signatures=t.signatures.map(t=>e.SignatureDescriptor.fromJSON(t))),n},toJSON(t){let n={};return t.signatures?n.signatures=t.signatures.map(t=>t?e.SignatureDescriptor.toJSON(t):void 0):n.signatures=[],n},fromPartial(t){let n=c();return n.signatures=t.signatures?.map(t=>e.SignatureDescriptor.fromPartial(t))||[],n}};function l(){return{publicKey:void 0,data:void 0,sequence:BigInt(0)}}e.SignatureDescriptor={typeUrl:`/cosmos.tx.signing.v1beta1.SignatureDescriptor`,encode(t,i=r.BinaryWriter.create()){return t.publicKey!==void 0&&n.Any.encode(t.publicKey,i.uint32(10).fork()).ldelim(),t.data!==void 0&&e.SignatureDescriptor_Data.encode(t.data,i.uint32(18).fork()).ldelim(),t.sequence!==BigInt(0)&&i.uint32(24).uint64(t.sequence),i},decode(t,i){let a=t instanceof r.BinaryReader?t:new r.BinaryReader(t),o=i===void 0?a.len:a.pos+i,s=l();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.publicKey=n.Any.decode(a,a.uint32());break;case 2:s.data=e.SignatureDescriptor_Data.decode(a,a.uint32());break;case 3:s.sequence=a.uint64();break;default:a.skipType(t&7);break}}return s},fromJSON(t){let r=l();return(0,i.isSet)(t.publicKey)&&(r.publicKey=n.Any.fromJSON(t.publicKey)),(0,i.isSet)(t.data)&&(r.data=e.SignatureDescriptor_Data.fromJSON(t.data)),(0,i.isSet)(t.sequence)&&(r.sequence=BigInt(t.sequence.toString())),r},toJSON(t){let r={};return t.publicKey!==void 0&&(r.publicKey=t.publicKey?n.Any.toJSON(t.publicKey):void 0),t.data!==void 0&&(r.data=t.data?e.SignatureDescriptor_Data.toJSON(t.data):void 0),t.sequence!==void 0&&(r.sequence=(t.sequence||BigInt(0)).toString()),r},fromPartial(t){let r=l();return t.publicKey!==void 0&&t.publicKey!==null&&(r.publicKey=n.Any.fromPartial(t.publicKey)),t.data!==void 0&&t.data!==null&&(r.data=e.SignatureDescriptor_Data.fromPartial(t.data)),t.sequence!==void 0&&t.sequence!==null&&(r.sequence=BigInt(t.sequence.toString())),r}};function u(){return{single:void 0,multi:void 0}}e.SignatureDescriptor_Data={typeUrl:`/cosmos.tx.signing.v1beta1.Data`,encode(t,n=r.BinaryWriter.create()){return t.single!==void 0&&e.SignatureDescriptor_Data_Single.encode(t.single,n.uint32(10).fork()).ldelim(),t.multi!==void 0&&e.SignatureDescriptor_Data_Multi.encode(t.multi,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.BinaryReader?t:new r.BinaryReader(t),a=n===void 0?i.len:i.pos+n,o=u();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.single=e.SignatureDescriptor_Data_Single.decode(i,i.uint32());break;case 2:o.multi=e.SignatureDescriptor_Data_Multi.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){let n=u();return(0,i.isSet)(t.single)&&(n.single=e.SignatureDescriptor_Data_Single.fromJSON(t.single)),(0,i.isSet)(t.multi)&&(n.multi=e.SignatureDescriptor_Data_Multi.fromJSON(t.multi)),n},toJSON(t){let n={};return t.single!==void 0&&(n.single=t.single?e.SignatureDescriptor_Data_Single.toJSON(t.single):void 0),t.multi!==void 0&&(n.multi=t.multi?e.SignatureDescriptor_Data_Multi.toJSON(t.multi):void 0),n},fromPartial(t){let n=u();return t.single!==void 0&&t.single!==null&&(n.single=e.SignatureDescriptor_Data_Single.fromPartial(t.single)),t.multi!==void 0&&t.multi!==null&&(n.multi=e.SignatureDescriptor_Data_Multi.fromPartial(t.multi)),n}};function d(){return{mode:0,signature:new Uint8Array}}e.SignatureDescriptor_Data_Single={typeUrl:`/cosmos.tx.signing.v1beta1.Single`,encode(e,t=r.BinaryWriter.create()){return e.mode!==0&&t.uint32(8).int32(e.mode),e.signature.length!==0&&t.uint32(18).bytes(e.signature),t},decode(e,t){let n=e instanceof r.BinaryReader?e:new r.BinaryReader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.mode=n.int32();break;case 2:a.signature=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){let t=d();return(0,i.isSet)(e.mode)&&(t.mode=o(e.mode)),(0,i.isSet)(e.signature)&&(t.signature=(0,i.bytesFromBase64)(e.signature)),t},toJSON(e){let t={};return e.mode!==void 0&&(t.mode=s(e.mode)),e.signature!==void 0&&(t.signature=(0,i.base64FromBytes)(e.signature===void 0?new Uint8Array:e.signature)),t},fromPartial(e){let t=d();return t.mode=e.mode??0,t.signature=e.signature??new Uint8Array,t}};function f(){return{bitarray:void 0,signatures:[]}}e.SignatureDescriptor_Data_Multi={typeUrl:`/cosmos.tx.signing.v1beta1.Multi`,encode(n,i=r.BinaryWriter.create()){n.bitarray!==void 0&&t.CompactBitArray.encode(n.bitarray,i.uint32(10).fork()).ldelim();for(let t of n.signatures)e.SignatureDescriptor_Data.encode(t,i.uint32(18).fork()).ldelim();return i},decode(n,i){let a=n instanceof r.BinaryReader?n:new r.BinaryReader(n),o=i===void 0?a.len:a.pos+i,s=f();for(;a.pos<o;){let n=a.uint32();switch(n>>>3){case 1:s.bitarray=t.CompactBitArray.decode(a,a.uint32());break;case 2:s.signatures.push(e.SignatureDescriptor_Data.decode(a,a.uint32()));break;default:a.skipType(n&7);break}}return s},fromJSON(n){let r=f();return(0,i.isSet)(n.bitarray)&&(r.bitarray=t.CompactBitArray.fromJSON(n.bitarray)),Array.isArray(n?.signatures)&&(r.signatures=n.signatures.map(t=>e.SignatureDescriptor_Data.fromJSON(t))),r},toJSON(n){let r={};return n.bitarray!==void 0&&(r.bitarray=n.bitarray?t.CompactBitArray.toJSON(n.bitarray):void 0),n.signatures?r.signatures=n.signatures.map(t=>t?e.SignatureDescriptor_Data.toJSON(t):void 0):r.signatures=[],r},fromPartial(n){let r=f();return n.bitarray!==void 0&&n.bitarray!==null&&(r.bitarray=t.CompactBitArray.fromPartial(n.bitarray)),r.signatures=n.signatures?.map(t=>e.SignatureDescriptor_Data.fromPartial(t))||[],r}}})),Yn=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DecProto=e.IntProto=e.DecCoin=e.Coin=e.protobufPackage=void 0;var t=Wn(),n=Gn();e.protobufPackage=`cosmos.base.v1beta1`;function r(){return{denom:``,amount:``}}e.Coin={typeUrl:`/cosmos.base.v1beta1.Coin`,encode(e,n=t.BinaryWriter.create()){return e.denom!==``&&n.uint32(10).string(e.denom),e.amount!==``&&n.uint32(18).string(e.amount),n},decode(e,n){let i=e instanceof t.BinaryReader?e:new t.BinaryReader(e),a=n===void 0?i.len:i.pos+n,o=r();for(;i.pos<a;){let e=i.uint32();switch(e>>>3){case 1:o.denom=i.string();break;case 2:o.amount=i.string();break;default:i.skipType(e&7);break}}return o},fromJSON(e){let t=r();return(0,n.isSet)(e.denom)&&(t.denom=String(e.denom)),(0,n.isSet)(e.amount)&&(t.amount=String(e.amount)),t},toJSON(e){let t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){let t=r();return t.denom=e.denom??``,t.amount=e.amount??``,t}};function i(){return{denom:``,amount:``}}e.DecCoin={typeUrl:`/cosmos.base.v1beta1.DecCoin`,encode(e,n=t.BinaryWriter.create()){return e.denom!==``&&n.uint32(10).string(e.denom),e.amount!==``&&n.uint32(18).string(e.amount),n},decode(e,n){let r=e instanceof t.BinaryReader?e:new t.BinaryReader(e),a=n===void 0?r.len:r.pos+n,o=i();for(;r.pos<a;){let e=r.uint32();switch(e>>>3){case 1:o.denom=r.string();break;case 2:o.amount=r.string();break;default:r.skipType(e&7);break}}return o},fromJSON(e){let t=i();return(0,n.isSet)(e.denom)&&(t.denom=String(e.denom)),(0,n.isSet)(e.amount)&&(t.amount=String(e.amount)),t},toJSON(e){let t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){let t=i();return t.denom=e.denom??``,t.amount=e.amount??``,t}};function a(){return{int:``}}e.IntProto={typeUrl:`/cosmos.base.v1beta1.IntProto`,encode(e,n=t.BinaryWriter.create()){return e.int!==``&&n.uint32(10).string(e.int),n},decode(e,n){let r=e instanceof t.BinaryReader?e:new t.BinaryReader(e),i=n===void 0?r.len:r.pos+n,o=a();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:o.int=r.string();break;default:r.skipType(e&7);break}}return o},fromJSON(e){let t=a();return(0,n.isSet)(e.int)&&(t.int=String(e.int)),t},toJSON(e){let t={};return e.int!==void 0&&(t.int=e.int),t},fromPartial(e){let t=a();return t.int=e.int??``,t}};function o(){return{dec:``}}e.DecProto={typeUrl:`/cosmos.base.v1beta1.DecProto`,encode(e,n=t.BinaryWriter.create()){return e.dec!==``&&n.uint32(10).string(e.dec),n},decode(e,n){let r=e instanceof t.BinaryReader?e:new t.BinaryReader(e),i=n===void 0?r.len:r.pos+n,a=o();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:a.dec=r.string();break;default:r.skipType(e&7);break}}return a},fromJSON(e){let t=o();return(0,n.isSet)(e.dec)&&(t.dec=String(e.dec)),t},toJSON(e){let t={};return e.dec!==void 0&&(t.dec=e.dec),t},fromPartial(e){let t=o();return t.dec=e.dec??``,t}}})),Xn=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AuxSignerData=e.Tip=e.Fee=e.ModeInfo_Multi=e.ModeInfo_Single=e.ModeInfo=e.SignerInfo=e.AuthInfo=e.TxBody=e.SignDocDirectAux=e.SignDoc=e.TxRaw=e.Tx=e.protobufPackage=void 0;var t=Kn(),n=Jn(),r=qn(),i=Yn(),a=Wn(),o=Gn();e.protobufPackage=`cosmos.tx.v1beta1`;function s(){return{body:void 0,authInfo:void 0,signatures:[]}}e.Tx={typeUrl:`/cosmos.tx.v1beta1.Tx`,encode(t,n=a.BinaryWriter.create()){t.body!==void 0&&e.TxBody.encode(t.body,n.uint32(10).fork()).ldelim(),t.authInfo!==void 0&&e.AuthInfo.encode(t.authInfo,n.uint32(18).fork()).ldelim();for(let e of t.signatures)n.uint32(26).bytes(e);return n},decode(t,n){let r=t instanceof a.BinaryReader?t:new a.BinaryReader(t),i=n===void 0?r.len:r.pos+n,o=s();for(;r.pos<i;){let t=r.uint32();switch(t>>>3){case 1:o.body=e.TxBody.decode(r,r.uint32());break;case 2:o.authInfo=e.AuthInfo.decode(r,r.uint32());break;case 3:o.signatures.push(r.bytes());break;default:r.skipType(t&7);break}}return o},fromJSON(t){let n=s();return(0,o.isSet)(t.body)&&(n.body=e.TxBody.fromJSON(t.body)),(0,o.isSet)(t.authInfo)&&(n.authInfo=e.AuthInfo.fromJSON(t.authInfo)),Array.isArray(t?.signatures)&&(n.signatures=t.signatures.map(e=>(0,o.bytesFromBase64)(e))),n},toJSON(t){let n={};return t.body!==void 0&&(n.body=t.body?e.TxBody.toJSON(t.body):void 0),t.authInfo!==void 0&&(n.authInfo=t.authInfo?e.AuthInfo.toJSON(t.authInfo):void 0),t.signatures?n.signatures=t.signatures.map(e=>(0,o.base64FromBytes)(e===void 0?new Uint8Array:e)):n.signatures=[],n},fromPartial(t){let n=s();return t.body!==void 0&&t.body!==null&&(n.body=e.TxBody.fromPartial(t.body)),t.authInfo!==void 0&&t.authInfo!==null&&(n.authInfo=e.AuthInfo.fromPartial(t.authInfo)),n.signatures=t.signatures?.map(e=>e)||[],n}};function c(){return{bodyBytes:new Uint8Array,authInfoBytes:new Uint8Array,signatures:[]}}e.TxRaw={typeUrl:`/cosmos.tx.v1beta1.TxRaw`,encode(e,t=a.BinaryWriter.create()){e.bodyBytes.length!==0&&t.uint32(10).bytes(e.bodyBytes),e.authInfoBytes.length!==0&&t.uint32(18).bytes(e.authInfoBytes);for(let n of e.signatures)t.uint32(26).bytes(n);return t},decode(e,t){let n=e instanceof a.BinaryReader?e:new a.BinaryReader(e),r=t===void 0?n.len:n.pos+t,i=c();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:i.bodyBytes=n.bytes();break;case 2:i.authInfoBytes=n.bytes();break;case 3:i.signatures.push(n.bytes());break;default:n.skipType(e&7);break}}return i},fromJSON(e){let t=c();return(0,o.isSet)(e.bodyBytes)&&(t.bodyBytes=(0,o.bytesFromBase64)(e.bodyBytes)),(0,o.isSet)(e.authInfoBytes)&&(t.authInfoBytes=(0,o.bytesFromBase64)(e.authInfoBytes)),Array.isArray(e?.signatures)&&(t.signatures=e.signatures.map(e=>(0,o.bytesFromBase64)(e))),t},toJSON(e){let t={};return e.bodyBytes!==void 0&&(t.bodyBytes=(0,o.base64FromBytes)(e.bodyBytes===void 0?new Uint8Array:e.bodyBytes)),e.authInfoBytes!==void 0&&(t.authInfoBytes=(0,o.base64FromBytes)(e.authInfoBytes===void 0?new Uint8Array:e.authInfoBytes)),e.signatures?t.signatures=e.signatures.map(e=>(0,o.base64FromBytes)(e===void 0?new Uint8Array:e)):t.signatures=[],t},fromPartial(e){let t=c();return t.bodyBytes=e.bodyBytes??new Uint8Array,t.authInfoBytes=e.authInfoBytes??new Uint8Array,t.signatures=e.signatures?.map(e=>e)||[],t}};function l(){return{bodyBytes:new Uint8Array,authInfoBytes:new Uint8Array,chainId:``,accountNumber:BigInt(0)}}e.SignDoc={typeUrl:`/cosmos.tx.v1beta1.SignDoc`,encode(e,t=a.BinaryWriter.create()){return e.bodyBytes.length!==0&&t.uint32(10).bytes(e.bodyBytes),e.authInfoBytes.length!==0&&t.uint32(18).bytes(e.authInfoBytes),e.chainId!==``&&t.uint32(26).string(e.chainId),e.accountNumber!==BigInt(0)&&t.uint32(32).uint64(e.accountNumber),t},decode(e,t){let n=e instanceof a.BinaryReader?e:new a.BinaryReader(e),r=t===void 0?n.len:n.pos+t,i=l();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:i.bodyBytes=n.bytes();break;case 2:i.authInfoBytes=n.bytes();break;case 3:i.chainId=n.string();break;case 4:i.accountNumber=n.uint64();break;default:n.skipType(e&7);break}}return i},fromJSON(e){let t=l();return(0,o.isSet)(e.bodyBytes)&&(t.bodyBytes=(0,o.bytesFromBase64)(e.bodyBytes)),(0,o.isSet)(e.authInfoBytes)&&(t.authInfoBytes=(0,o.bytesFromBase64)(e.authInfoBytes)),(0,o.isSet)(e.chainId)&&(t.chainId=String(e.chainId)),(0,o.isSet)(e.accountNumber)&&(t.accountNumber=BigInt(e.accountNumber.toString())),t},toJSON(e){let t={};return e.bodyBytes!==void 0&&(t.bodyBytes=(0,o.base64FromBytes)(e.bodyBytes===void 0?new Uint8Array:e.bodyBytes)),e.authInfoBytes!==void 0&&(t.authInfoBytes=(0,o.base64FromBytes)(e.authInfoBytes===void 0?new Uint8Array:e.authInfoBytes)),e.chainId!==void 0&&(t.chainId=e.chainId),e.accountNumber!==void 0&&(t.accountNumber=(e.accountNumber||BigInt(0)).toString()),t},fromPartial(e){let t=l();return t.bodyBytes=e.bodyBytes??new Uint8Array,t.authInfoBytes=e.authInfoBytes??new Uint8Array,t.chainId=e.chainId??``,e.accountNumber!==void 0&&e.accountNumber!==null&&(t.accountNumber=BigInt(e.accountNumber.toString())),t}};function u(){return{bodyBytes:new Uint8Array,publicKey:void 0,chainId:``,accountNumber:BigInt(0),sequence:BigInt(0),tip:void 0}}e.SignDocDirectAux={typeUrl:`/cosmos.tx.v1beta1.SignDocDirectAux`,encode(n,r=a.BinaryWriter.create()){return n.bodyBytes.length!==0&&r.uint32(10).bytes(n.bodyBytes),n.publicKey!==void 0&&t.Any.encode(n.publicKey,r.uint32(18).fork()).ldelim(),n.chainId!==``&&r.uint32(26).string(n.chainId),n.accountNumber!==BigInt(0)&&r.uint32(32).uint64(n.accountNumber),n.sequence!==BigInt(0)&&r.uint32(40).uint64(n.sequence),n.tip!==void 0&&e.Tip.encode(n.tip,r.uint32(50).fork()).ldelim(),r},decode(n,r){let i=n instanceof a.BinaryReader?n:new a.BinaryReader(n),o=r===void 0?i.len:i.pos+r,s=u();for(;i.pos<o;){let n=i.uint32();switch(n>>>3){case 1:s.bodyBytes=i.bytes();break;case 2:s.publicKey=t.Any.decode(i,i.uint32());break;case 3:s.chainId=i.string();break;case 4:s.accountNumber=i.uint64();break;case 5:s.sequence=i.uint64();break;case 6:s.tip=e.Tip.decode(i,i.uint32());break;default:i.skipType(n&7);break}}return s},fromJSON(n){let r=u();return(0,o.isSet)(n.bodyBytes)&&(r.bodyBytes=(0,o.bytesFromBase64)(n.bodyBytes)),(0,o.isSet)(n.publicKey)&&(r.publicKey=t.Any.fromJSON(n.publicKey)),(0,o.isSet)(n.chainId)&&(r.chainId=String(n.chainId)),(0,o.isSet)(n.accountNumber)&&(r.accountNumber=BigInt(n.accountNumber.toString())),(0,o.isSet)(n.sequence)&&(r.sequence=BigInt(n.sequence.toString())),(0,o.isSet)(n.tip)&&(r.tip=e.Tip.fromJSON(n.tip)),r},toJSON(n){let r={};return n.bodyBytes!==void 0&&(r.bodyBytes=(0,o.base64FromBytes)(n.bodyBytes===void 0?new Uint8Array:n.bodyBytes)),n.publicKey!==void 0&&(r.publicKey=n.publicKey?t.Any.toJSON(n.publicKey):void 0),n.chainId!==void 0&&(r.chainId=n.chainId),n.accountNumber!==void 0&&(r.accountNumber=(n.accountNumber||BigInt(0)).toString()),n.sequence!==void 0&&(r.sequence=(n.sequence||BigInt(0)).toString()),n.tip!==void 0&&(r.tip=n.tip?e.Tip.toJSON(n.tip):void 0),r},fromPartial(n){let r=u();return r.bodyBytes=n.bodyBytes??new Uint8Array,n.publicKey!==void 0&&n.publicKey!==null&&(r.publicKey=t.Any.fromPartial(n.publicKey)),r.chainId=n.chainId??``,n.accountNumber!==void 0&&n.accountNumber!==null&&(r.accountNumber=BigInt(n.accountNumber.toString())),n.sequence!==void 0&&n.sequence!==null&&(r.sequence=BigInt(n.sequence.toString())),n.tip!==void 0&&n.tip!==null&&(r.tip=e.Tip.fromPartial(n.tip)),r}};function d(){return{messages:[],memo:``,timeoutHeight:BigInt(0),extensionOptions:[],nonCriticalExtensionOptions:[]}}e.TxBody={typeUrl:`/cosmos.tx.v1beta1.TxBody`,encode(e,n=a.BinaryWriter.create()){for(let r of e.messages)t.Any.encode(r,n.uint32(10).fork()).ldelim();e.memo!==``&&n.uint32(18).string(e.memo),e.timeoutHeight!==BigInt(0)&&n.uint32(24).uint64(e.timeoutHeight);for(let r of e.extensionOptions)t.Any.encode(r,n.uint32(8186).fork()).ldelim();for(let r of e.nonCriticalExtensionOptions)t.Any.encode(r,n.uint32(16378).fork()).ldelim();return n},decode(e,n){let r=e instanceof a.BinaryReader?e:new a.BinaryReader(e),i=n===void 0?r.len:r.pos+n,o=d();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:o.messages.push(t.Any.decode(r,r.uint32()));break;case 2:o.memo=r.string();break;case 3:o.timeoutHeight=r.uint64();break;case 1023:o.extensionOptions.push(t.Any.decode(r,r.uint32()));break;case 2047:o.nonCriticalExtensionOptions.push(t.Any.decode(r,r.uint32()));break;default:r.skipType(e&7);break}}return o},fromJSON(e){let n=d();return Array.isArray(e?.messages)&&(n.messages=e.messages.map(e=>t.Any.fromJSON(e))),(0,o.isSet)(e.memo)&&(n.memo=String(e.memo)),(0,o.isSet)(e.timeoutHeight)&&(n.timeoutHeight=BigInt(e.timeoutHeight.toString())),Array.isArray(e?.extensionOptions)&&(n.extensionOptions=e.extensionOptions.map(e=>t.Any.fromJSON(e))),Array.isArray(e?.nonCriticalExtensionOptions)&&(n.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions.map(e=>t.Any.fromJSON(e))),n},toJSON(e){let n={};return e.messages?n.messages=e.messages.map(e=>e?t.Any.toJSON(e):void 0):n.messages=[],e.memo!==void 0&&(n.memo=e.memo),e.timeoutHeight!==void 0&&(n.timeoutHeight=(e.timeoutHeight||BigInt(0)).toString()),e.extensionOptions?n.extensionOptions=e.extensionOptions.map(e=>e?t.Any.toJSON(e):void 0):n.extensionOptions=[],e.nonCriticalExtensionOptions?n.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions.map(e=>e?t.Any.toJSON(e):void 0):n.nonCriticalExtensionOptions=[],n},fromPartial(e){let n=d();return n.messages=e.messages?.map(e=>t.Any.fromPartial(e))||[],n.memo=e.memo??``,e.timeoutHeight!==void 0&&e.timeoutHeight!==null&&(n.timeoutHeight=BigInt(e.timeoutHeight.toString())),n.extensionOptions=e.extensionOptions?.map(e=>t.Any.fromPartial(e))||[],n.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions?.map(e=>t.Any.fromPartial(e))||[],n}};function f(){return{signerInfos:[],fee:void 0,tip:void 0}}e.AuthInfo={typeUrl:`/cosmos.tx.v1beta1.AuthInfo`,encode(t,n=a.BinaryWriter.create()){for(let r of t.signerInfos)e.SignerInfo.encode(r,n.uint32(10).fork()).ldelim();return t.fee!==void 0&&e.Fee.encode(t.fee,n.uint32(18).fork()).ldelim(),t.tip!==void 0&&e.Tip.encode(t.tip,n.uint32(26).fork()).ldelim(),n},decode(t,n){let r=t instanceof a.BinaryReader?t:new a.BinaryReader(t),i=n===void 0?r.len:r.pos+n,o=f();for(;r.pos<i;){let t=r.uint32();switch(t>>>3){case 1:o.signerInfos.push(e.SignerInfo.decode(r,r.uint32()));break;case 2:o.fee=e.Fee.decode(r,r.uint32());break;case 3:o.tip=e.Tip.decode(r,r.uint32());break;default:r.skipType(t&7);break}}return o},fromJSON(t){let n=f();return Array.isArray(t?.signerInfos)&&(n.signerInfos=t.signerInfos.map(t=>e.SignerInfo.fromJSON(t))),(0,o.isSet)(t.fee)&&(n.fee=e.Fee.fromJSON(t.fee)),(0,o.isSet)(t.tip)&&(n.tip=e.Tip.fromJSON(t.tip)),n},toJSON(t){let n={};return t.signerInfos?n.signerInfos=t.signerInfos.map(t=>t?e.SignerInfo.toJSON(t):void 0):n.signerInfos=[],t.fee!==void 0&&(n.fee=t.fee?e.Fee.toJSON(t.fee):void 0),t.tip!==void 0&&(n.tip=t.tip?e.Tip.toJSON(t.tip):void 0),n},fromPartial(t){let n=f();return n.signerInfos=t.signerInfos?.map(t=>e.SignerInfo.fromPartial(t))||[],t.fee!==void 0&&t.fee!==null&&(n.fee=e.Fee.fromPartial(t.fee)),t.tip!==void 0&&t.tip!==null&&(n.tip=e.Tip.fromPartial(t.tip)),n}};function p(){return{publicKey:void 0,modeInfo:void 0,sequence:BigInt(0)}}e.SignerInfo={typeUrl:`/cosmos.tx.v1beta1.SignerInfo`,encode(n,r=a.BinaryWriter.create()){return n.publicKey!==void 0&&t.Any.encode(n.publicKey,r.uint32(10).fork()).ldelim(),n.modeInfo!==void 0&&e.ModeInfo.encode(n.modeInfo,r.uint32(18).fork()).ldelim(),n.sequence!==BigInt(0)&&r.uint32(24).uint64(n.sequence),r},decode(n,r){let i=n instanceof a.BinaryReader?n:new a.BinaryReader(n),o=r===void 0?i.len:i.pos+r,s=p();for(;i.pos<o;){let n=i.uint32();switch(n>>>3){case 1:s.publicKey=t.Any.decode(i,i.uint32());break;case 2:s.modeInfo=e.ModeInfo.decode(i,i.uint32());break;case 3:s.sequence=i.uint64();break;default:i.skipType(n&7);break}}return s},fromJSON(n){let r=p();return(0,o.isSet)(n.publicKey)&&(r.publicKey=t.Any.fromJSON(n.publicKey)),(0,o.isSet)(n.modeInfo)&&(r.modeInfo=e.ModeInfo.fromJSON(n.modeInfo)),(0,o.isSet)(n.sequence)&&(r.sequence=BigInt(n.sequence.toString())),r},toJSON(n){let r={};return n.publicKey!==void 0&&(r.publicKey=n.publicKey?t.Any.toJSON(n.publicKey):void 0),n.modeInfo!==void 0&&(r.modeInfo=n.modeInfo?e.ModeInfo.toJSON(n.modeInfo):void 0),n.sequence!==void 0&&(r.sequence=(n.sequence||BigInt(0)).toString()),r},fromPartial(n){let r=p();return n.publicKey!==void 0&&n.publicKey!==null&&(r.publicKey=t.Any.fromPartial(n.publicKey)),n.modeInfo!==void 0&&n.modeInfo!==null&&(r.modeInfo=e.ModeInfo.fromPartial(n.modeInfo)),n.sequence!==void 0&&n.sequence!==null&&(r.sequence=BigInt(n.sequence.toString())),r}};function m(){return{single:void 0,multi:void 0}}e.ModeInfo={typeUrl:`/cosmos.tx.v1beta1.ModeInfo`,encode(t,n=a.BinaryWriter.create()){return t.single!==void 0&&e.ModeInfo_Single.encode(t.single,n.uint32(10).fork()).ldelim(),t.multi!==void 0&&e.ModeInfo_Multi.encode(t.multi,n.uint32(18).fork()).ldelim(),n},decode(t,n){let r=t instanceof a.BinaryReader?t:new a.BinaryReader(t),i=n===void 0?r.len:r.pos+n,o=m();for(;r.pos<i;){let t=r.uint32();switch(t>>>3){case 1:o.single=e.ModeInfo_Single.decode(r,r.uint32());break;case 2:o.multi=e.ModeInfo_Multi.decode(r,r.uint32());break;default:r.skipType(t&7);break}}return o},fromJSON(t){let n=m();return(0,o.isSet)(t.single)&&(n.single=e.ModeInfo_Single.fromJSON(t.single)),(0,o.isSet)(t.multi)&&(n.multi=e.ModeInfo_Multi.fromJSON(t.multi)),n},toJSON(t){let n={};return t.single!==void 0&&(n.single=t.single?e.ModeInfo_Single.toJSON(t.single):void 0),t.multi!==void 0&&(n.multi=t.multi?e.ModeInfo_Multi.toJSON(t.multi):void 0),n},fromPartial(t){let n=m();return t.single!==void 0&&t.single!==null&&(n.single=e.ModeInfo_Single.fromPartial(t.single)),t.multi!==void 0&&t.multi!==null&&(n.multi=e.ModeInfo_Multi.fromPartial(t.multi)),n}};function h(){return{mode:0}}e.ModeInfo_Single={typeUrl:`/cosmos.tx.v1beta1.Single`,encode(e,t=a.BinaryWriter.create()){return e.mode!==0&&t.uint32(8).int32(e.mode),t},decode(e,t){let n=e instanceof a.BinaryReader?e:new a.BinaryReader(e),r=t===void 0?n.len:n.pos+t,i=h();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:i.mode=n.int32();break;default:n.skipType(e&7);break}}return i},fromJSON(e){let t=h();return(0,o.isSet)(e.mode)&&(t.mode=(0,n.signModeFromJSON)(e.mode)),t},toJSON(e){let t={};return e.mode!==void 0&&(t.mode=(0,n.signModeToJSON)(e.mode)),t},fromPartial(e){let t=h();return t.mode=e.mode??0,t}};function g(){return{bitarray:void 0,modeInfos:[]}}e.ModeInfo_Multi={typeUrl:`/cosmos.tx.v1beta1.Multi`,encode(t,n=a.BinaryWriter.create()){t.bitarray!==void 0&&r.CompactBitArray.encode(t.bitarray,n.uint32(10).fork()).ldelim();for(let r of t.modeInfos)e.ModeInfo.encode(r,n.uint32(18).fork()).ldelim();return n},decode(t,n){let i=t instanceof a.BinaryReader?t:new a.BinaryReader(t),o=n===void 0?i.len:i.pos+n,s=g();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.bitarray=r.CompactBitArray.decode(i,i.uint32());break;case 2:s.modeInfos.push(e.ModeInfo.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return s},fromJSON(t){let n=g();return(0,o.isSet)(t.bitarray)&&(n.bitarray=r.CompactBitArray.fromJSON(t.bitarray)),Array.isArray(t?.modeInfos)&&(n.modeInfos=t.modeInfos.map(t=>e.ModeInfo.fromJSON(t))),n},toJSON(t){let n={};return t.bitarray!==void 0&&(n.bitarray=t.bitarray?r.CompactBitArray.toJSON(t.bitarray):void 0),t.modeInfos?n.modeInfos=t.modeInfos.map(t=>t?e.ModeInfo.toJSON(t):void 0):n.modeInfos=[],n},fromPartial(t){let n=g();return t.bitarray!==void 0&&t.bitarray!==null&&(n.bitarray=r.CompactBitArray.fromPartial(t.bitarray)),n.modeInfos=t.modeInfos?.map(t=>e.ModeInfo.fromPartial(t))||[],n}};function _(){return{amount:[],gasLimit:BigInt(0),payer:``,granter:``}}e.Fee={typeUrl:`/cosmos.tx.v1beta1.Fee`,encode(e,t=a.BinaryWriter.create()){for(let n of e.amount)i.Coin.encode(n,t.uint32(10).fork()).ldelim();return e.gasLimit!==BigInt(0)&&t.uint32(16).uint64(e.gasLimit),e.payer!==``&&t.uint32(26).string(e.payer),e.granter!==``&&t.uint32(34).string(e.granter),t},decode(e,t){let n=e instanceof a.BinaryReader?e:new a.BinaryReader(e),r=t===void 0?n.len:n.pos+t,o=_();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:o.amount.push(i.Coin.decode(n,n.uint32()));break;case 2:o.gasLimit=n.uint64();break;case 3:o.payer=n.string();break;case 4:o.granter=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){let t=_();return Array.isArray(e?.amount)&&(t.amount=e.amount.map(e=>i.Coin.fromJSON(e))),(0,o.isSet)(e.gasLimit)&&(t.gasLimit=BigInt(e.gasLimit.toString())),(0,o.isSet)(e.payer)&&(t.payer=String(e.payer)),(0,o.isSet)(e.granter)&&(t.granter=String(e.granter)),t},toJSON(e){let t={};return e.amount?t.amount=e.amount.map(e=>e?i.Coin.toJSON(e):void 0):t.amount=[],e.gasLimit!==void 0&&(t.gasLimit=(e.gasLimit||BigInt(0)).toString()),e.payer!==void 0&&(t.payer=e.payer),e.granter!==void 0&&(t.granter=e.granter),t},fromPartial(e){let t=_();return t.amount=e.amount?.map(e=>i.Coin.fromPartial(e))||[],e.gasLimit!==void 0&&e.gasLimit!==null&&(t.gasLimit=BigInt(e.gasLimit.toString())),t.payer=e.payer??``,t.granter=e.granter??``,t}};function v(){return{amount:[],tipper:``}}e.Tip={typeUrl:`/cosmos.tx.v1beta1.Tip`,encode(e,t=a.BinaryWriter.create()){for(let n of e.amount)i.Coin.encode(n,t.uint32(10).fork()).ldelim();return e.tipper!==``&&t.uint32(18).string(e.tipper),t},decode(e,t){let n=e instanceof a.BinaryReader?e:new a.BinaryReader(e),r=t===void 0?n.len:n.pos+t,o=v();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:o.amount.push(i.Coin.decode(n,n.uint32()));break;case 2:o.tipper=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){let t=v();return Array.isArray(e?.amount)&&(t.amount=e.amount.map(e=>i.Coin.fromJSON(e))),(0,o.isSet)(e.tipper)&&(t.tipper=String(e.tipper)),t},toJSON(e){let t={};return e.amount?t.amount=e.amount.map(e=>e?i.Coin.toJSON(e):void 0):t.amount=[],e.tipper!==void 0&&(t.tipper=e.tipper),t},fromPartial(e){let t=v();return t.amount=e.amount?.map(e=>i.Coin.fromPartial(e))||[],t.tipper=e.tipper??``,t}};function y(){return{address:``,signDoc:void 0,mode:0,sig:new Uint8Array}}e.AuxSignerData={typeUrl:`/cosmos.tx.v1beta1.AuxSignerData`,encode(t,n=a.BinaryWriter.create()){return t.address!==``&&n.uint32(10).string(t.address),t.signDoc!==void 0&&e.SignDocDirectAux.encode(t.signDoc,n.uint32(18).fork()).ldelim(),t.mode!==0&&n.uint32(24).int32(t.mode),t.sig.length!==0&&n.uint32(34).bytes(t.sig),n},decode(t,n){let r=t instanceof a.BinaryReader?t:new a.BinaryReader(t),i=n===void 0?r.len:r.pos+n,o=y();for(;r.pos<i;){let t=r.uint32();switch(t>>>3){case 1:o.address=r.string();break;case 2:o.signDoc=e.SignDocDirectAux.decode(r,r.uint32());break;case 3:o.mode=r.int32();break;case 4:o.sig=r.bytes();break;default:r.skipType(t&7);break}}return o},fromJSON(t){let r=y();return(0,o.isSet)(t.address)&&(r.address=String(t.address)),(0,o.isSet)(t.signDoc)&&(r.signDoc=e.SignDocDirectAux.fromJSON(t.signDoc)),(0,o.isSet)(t.mode)&&(r.mode=(0,n.signModeFromJSON)(t.mode)),(0,o.isSet)(t.sig)&&(r.sig=(0,o.bytesFromBase64)(t.sig)),r},toJSON(t){let r={};return t.address!==void 0&&(r.address=t.address),t.signDoc!==void 0&&(r.signDoc=t.signDoc?e.SignDocDirectAux.toJSON(t.signDoc):void 0),t.mode!==void 0&&(r.mode=(0,n.signModeToJSON)(t.mode)),t.sig!==void 0&&(r.sig=(0,o.base64FromBytes)(t.sig===void 0?new Uint8Array:t.sig)),r},fromPartial(t){let n=y();return n.address=t.address??``,t.signDoc!==void 0&&t.signDoc!==null&&(n.signDoc=e.SignDocDirectAux.fromPartial(t.signDoc)),n.mode=t.mode??0,n.sig=t.sig??new Uint8Array,n}}})),Zn=a(((e,t)=>{var n=C(),r=A().Buffer;t.exports=function(e){function t(t){var i=e(t);return n.encode(r.concat([t,i],t.length+4))}function i(t){var n=t.slice(0,-4),r=t.slice(-4),i=e(n);if(!(r[0]^i[0]|r[1]^i[1]|r[2]^i[2]|r[3]^i[3]))return n}function a(e){var t=n.decodeUnsafe(e);if(t)return i(t)}function o(t){var r=i(n.decode(t),e);if(!r)throw Error(`Invalid checksum`);return r}return{encode:t,decode:o,decodeUnsafe:a}}})),Qn=a(((e,t)=>{var n=E(),r=Zn();function i(e){var t=n(`sha256`).update(e).digest();return n(`sha256`).update(t).digest()}t.exports=r(i)})),W=a(((t,n)=>{m(),(function(e,r){typeof t==`object`?n.exports=t=r():typeof define==`function`&&define.amd?define([],r):e.CryptoJS=r()})(t,function(){var t=t||function(t,n){var r;if(typeof window<`u`&&window.crypto&&(r=window.crypto),typeof self<`u`&&self.crypto&&(r=self.crypto),typeof globalThis<`u`&&globalThis.crypto&&(r=globalThis.crypto),!r&&typeof window<`u`&&window.msCrypto&&(r=window.msCrypto),!r&&h!==void 0&&h.crypto&&(r=h.crypto),!r&&typeof e==`function`)try{r=D()}catch{}var i=function(){if(r){if(typeof r.getRandomValues==`function`)try{return r.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof r.randomBytes==`function`)try{return r.randomBytes(4).readInt32LE()}catch{}}throw Error(`Native crypto module could not be used to get secure random number.`)},a=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),o={},s=o.lib={},c=s.Base=function(){return{extend:function(e){var t=a(this);return e&&t.mixIn(e),(!t.hasOwnProperty(`init`)||this.init===t.init)&&(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty(`toString`)&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),l=s.WordArray=c.extend({init:function(e,t){e=this.words=e||[],t==n?this.sigBytes=e.length*4:this.sigBytes=t},toString:function(e){return(e||d).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var a=0;a<i;a++){var o=n[a>>>2]>>>24-a%4*8&255;t[r+a>>>2]|=o<<24-(r+a)%4*8}else for(var s=0;s<i;s+=4)t[r+s>>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,n=this.sigBytes;e[n>>>2]&=4294967295<<32-n%4*8,e.length=t.ceil(n/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(i());return new l.init(t,e)}}),u=o.enc={},d=u.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var a=t[i>>>2]>>>24-i%4*8&255;r.push((a>>>4).toString(16)),r.push((a&15).toString(16))}return r.join(``)},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new l.init(n,t/2)}},f=u.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var a=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(a))}return r.join(``)},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(e.charCodeAt(r)&255)<<24-r%4*8;return new l.init(n,t)}},p=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch{throw Error(`Malformed UTF-8 data`)}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},m=s.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(e){typeof e==`string`&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var n,r=this._data,i=r.words,a=r.sigBytes,o=this.blockSize,s=a/(o*4);s=e?t.ceil(s):t.max((s|0)-this._minBufferSize,0);var c=s*o,u=t.min(c*4,a);if(c){for(var d=0;d<c;d+=o)this._doProcessBlock(i,d);n=i.splice(0,c),r.sigBytes-=u}return new l.init(n,u)},clone:function(){var e=c.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});s.Hasher=m.extend({cfg:c.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){m.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:512/32,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new g.HMAC.init(e,n).finalize(t)}}});var g=o.algo={};return o}(Math);return t})})),$n=a(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(W()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(t){var n=e,r=n.lib,i=r.Base,a=r.WordArray,o=n.x64={};o.Word=i.extend({init:function(e,t){this.high=e,this.low=t}}),o.WordArray=i.extend({init:function(e,n){e=this.words=e||[],n==t?this.sigBytes=e.length*8:this.sigBytes=n},toX32:function(){for(var e=this.words,t=e.length,n=[],r=0;r<t;r++){var i=e[r];n.push(i.high),n.push(i.low)}return a.create(n,this.sigBytes)},clone:function(){for(var e=i.clone.call(this),t=e.words=this.words.slice(0),n=t.length,r=0;r<n;r++)t[r]=t[r].clone();return e}})})(),e})})),er=a(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(W()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(){if(typeof ArrayBuffer==`function`){var t=e.lib.WordArray,n=t.init,r=t.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||typeof Uint8ClampedArray<`u`&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var t=e.byteLength,r=[],i=0;i<t;i++)r[i>>>2]|=e[i]<<24-i%4*8;n.call(this,r,t)}else n.apply(this,arguments)};r.prototype=t}})(),e.lib.WordArray})})),tr=a(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(W()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.WordArray,r=t.enc;r.Utf16=r.Utf16BE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i+=2){var a=t[i>>>2]>>>16-i%4*8&65535;r.push(String.fromCharCode(a))}return r.join(``)},parse:function(e){for(var t=e.length,r=[],i=0;i<t;i++)r[i>>>1]|=e.charCodeAt(i)<<16-i%2*16;return n.create(r,t*2)}},r.Utf16LE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],a=0;a<n;a+=2){var o=i(t[a>>>2]>>>16-a%4*8&65535);r.push(String.fromCharCode(o))}return r.join(``)},parse:function(e){for(var t=e.length,r=[],a=0;a<t;a++)r[a>>>1]|=i(e.charCodeAt(a)<<16-a%2*16);return n.create(r,t*2)}};function i(e){return e<<8&4278255360|e>>>8&16711935}})(),e.enc.Utf16})})),nr=a(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(W()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.WordArray,r=t.enc;r.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var i=[],a=0;a<n;a+=3)for(var o=t[a>>>2]>>>24-a%4*8&255,s=t[a+1>>>2]>>>24-(a+1)%4*8&255,c=t[a+2>>>2]>>>24-(a+2)%4*8&255,l=o<<16|s<<8|c,u=0;u<4&&a+u*.75<n;u++)i.push(r.charAt(l>>>6*(3-u)&63));var d=r.charAt(64);if(d)for(;i.length%4;)i.push(d);return i.join(``)},parse:function(e){var t=e.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var a=0;a<n.length;a++)r[n.charCodeAt(a)]=a}var o=n.charAt(64);if(o){var s=e.indexOf(o);s!==-1&&(t=s)}return i(e,t,r)},_map:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`};function i(e,t,r){for(var i=[],a=0,o=0;o<t;o++)if(o%4){var s=r[e.charCodeAt(o-1)]<<o%4*2|r[e.charCodeAt(o)]>>>6-o%4*2;i[a>>>2]|=s<<24-a%4*8,a++}return n.create(i,a)}})(),e.enc.Base64})})),rr=a(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(W()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.WordArray,r=t.enc;r.Base64url={stringify:function(e,t){t===void 0&&(t=!0);var n=e.words,r=e.sigBytes,i=t?this._safe_map:this._map;e.clamp();for(var a=[],o=0;o<r;o+=3)for(var s=n[o>>>2]>>>24-o%4*8&255,c=n[o+1>>>2]>>>24-(o+1)%4*8&255,l=n[o+2>>>2]>>>24-(o+2)%4*8&255,u=s<<16|c<<8|l,d=0;d<4&&o+d*.75<r;d++)a.push(i.charAt(u>>>6*(3-d)&63));var f=i.charAt(64);if(f)for(;a.length%4;)a.push(f);return a.join(``)},parse:function(e,t){t===void 0&&(t=!0);var n=e.length,r=t?this._safe_map:this._map,a=this._reverseMap;if(!a){a=this._reverseMap=[];for(var o=0;o<r.length;o++)a[r.charCodeAt(o)]=o}var s=r.charAt(64);if(s){var c=e.indexOf(s);c!==-1&&(n=c)}return i(e,n,a)},_map:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`,_safe_map:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`};function i(e,t,r){for(var i=[],a=0,o=0;o<t;o++)if(o%4){var s=r[e.charCodeAt(o-1)]<<o%4*2|r[e.charCodeAt(o)]>>>6-o%4*2;i[a>>>2]|=s<<24-a%4*8,a++}return n.create(i,a)}})(),e.enc.Base64url})})),ir=a(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(W()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.algo,s=[];(function(){for(var e=0;e<64;e++)s[e]=t.abs(t.sin(e+1))*4294967296|0})();var c=o.MD5=a.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360}var a=this._hash.words,o=e[t+0],c=e[t+1],p=e[t+2],m=e[t+3],h=e[t+4],g=e[t+5],_=e[t+6],v=e[t+7],y=e[t+8],b=e[t+9],x=e[t+10],S=e[t+11],C=e[t+12],w=e[t+13],T=e[t+14],E=e[t+15],D=a[0],O=a[1],k=a[2],A=a[3];D=l(D,O,k,A,o,7,s[0]),A=l(A,D,O,k,c,12,s[1]),k=l(k,A,D,O,p,17,s[2]),O=l(O,k,A,D,m,22,s[3]),D=l(D,O,k,A,h,7,s[4]),A=l(A,D,O,k,g,12,s[5]),k=l(k,A,D,O,_,17,s[6]),O=l(O,k,A,D,v,22,s[7]),D=l(D,O,k,A,y,7,s[8]),A=l(A,D,O,k,b,12,s[9]),k=l(k,A,D,O,x,17,s[10]),O=l(O,k,A,D,S,22,s[11]),D=l(D,O,k,A,C,7,s[12]),A=l(A,D,O,k,w,12,s[13]),k=l(k,A,D,O,T,17,s[14]),O=l(O,k,A,D,E,22,s[15]),D=u(D,O,k,A,c,5,s[16]),A=u(A,D,O,k,_,9,s[17]),k=u(k,A,D,O,S,14,s[18]),O=u(O,k,A,D,o,20,s[19]),D=u(D,O,k,A,g,5,s[20]),A=u(A,D,O,k,x,9,s[21]),k=u(k,A,D,O,E,14,s[22]),O=u(O,k,A,D,h,20,s[23]),D=u(D,O,k,A,b,5,s[24]),A=u(A,D,O,k,T,9,s[25]),k=u(k,A,D,O,m,14,s[26]),O=u(O,k,A,D,y,20,s[27]),D=u(D,O,k,A,w,5,s[28]),A=u(A,D,O,k,p,9,s[29]),k=u(k,A,D,O,v,14,s[30]),O=u(O,k,A,D,C,20,s[31]),D=d(D,O,k,A,g,4,s[32]),A=d(A,D,O,k,y,11,s[33]),k=d(k,A,D,O,S,16,s[34]),O=d(O,k,A,D,T,23,s[35]),D=d(D,O,k,A,c,4,s[36]),A=d(A,D,O,k,h,11,s[37]),k=d(k,A,D,O,v,16,s[38]),O=d(O,k,A,D,x,23,s[39]),D=d(D,O,k,A,w,4,s[40]),A=d(A,D,O,k,o,11,s[41]),k=d(k,A,D,O,m,16,s[42]),O=d(O,k,A,D,_,23,s[43]),D=d(D,O,k,A,b,4,s[44]),A=d(A,D,O,k,C,11,s[45]),k=d(k,A,D,O,E,16,s[46]),O=d(O,k,A,D,p,23,s[47]),D=f(D,O,k,A,o,6,s[48]),A=f(A,D,O,k,v,10,s[49]),k=f(k,A,D,O,T,15,s[50]),O=f(O,k,A,D,g,21,s[51]),D=f(D,O,k,A,C,6,s[52]),A=f(A,D,O,k,m,10,s[53]),k=f(k,A,D,O,x,15,s[54]),O=f(O,k,A,D,c,21,s[55]),D=f(D,O,k,A,y,6,s[56]),A=f(A,D,O,k,E,10,s[57]),k=f(k,A,D,O,_,15,s[58]),O=f(O,k,A,D,w,21,s[59]),D=f(D,O,k,A,h,6,s[60]),A=f(A,D,O,k,S,10,s[61]),k=f(k,A,D,O,p,15,s[62]),O=f(O,k,A,D,b,21,s[63]),a[0]=a[0]+D|0,a[1]=a[1]+O|0,a[2]=a[2]+k|0,a[3]=a[3]+A|0},_doFinalize:function(){var e=this._data,n=e.words,r=this._nDataBytes*8,i=e.sigBytes*8;n[i>>>5]|=128<<24-i%32;var a=t.floor(r/4294967296),o=r;n[(i+64>>>9<<4)+15]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360,n[(i+64>>>9<<4)+14]=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,e.sigBytes=(n.length+1)*4,this._process();for(var s=this._hash,c=s.words,l=0;l<4;l++){var u=c[l];c[l]=(u<<8|u>>>24)&16711935|(u<<24|u>>>8)&4278255360}return s},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});function l(e,t,n,r,i,a,o){var s=e+(t&n|~t&r)+i+o;return(s<<a|s>>>32-a)+t}function u(e,t,n,r,i,a,o){var s=e+(t&r|n&~r)+i+o;return(s<<a|s>>>32-a)+t}function d(e,t,n,r,i,a,o){var s=e+(t^n^r)+i+o;return(s<<a|s>>>32-a)+t}function f(e,t,n,r,i,a,o){var s=e+(n^(t|~r))+i+o;return(s<<a|s>>>32-a)+t}n.MD5=a._createHelper(c),n.HmacMD5=a._createHmacHelper(c)})(Math),e.MD5})})),ar=a(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(W()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib,r=n.WordArray,i=n.Hasher,a=t.algo,o=[],s=a.SHA1=i.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],s=n[3],c=n[4],l=0;l<80;l++){if(l<16)o[l]=e[t+l]|0;else{var u=o[l-3]^o[l-8]^o[l-14]^o[l-16];o[l]=u<<1|u>>>31}var d=(r<<5|r>>>27)+c+o[l];l<20?d+=(i&a|~i&s)+1518500249:l<40?d+=(i^a^s)+1859775393:l<60?d+=(i&a|i&s|a&s)-1894007588:d+=(i^a^s)-899497514,c=s,s=a,a=i<<30|i>>>2,i=r,r=d}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=this._nDataBytes*8,r=e.sigBytes*8;return t[r>>>5]|=128<<24-r%32,t[(r+64>>>9<<4)+14]=Math.floor(n/4294967296),t[(r+64>>>9<<4)+15]=n,e.sigBytes=t.length*4,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s)})(),e.SHA1})})),or=a(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(W()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.algo,s=[],c=[];(function(){function e(e){for(var n=t.sqrt(e),r=2;r<=n;r++)if(!(e%r))return!1;return!0}function n(e){return(e-(e|0))*4294967296|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(s[i]=n(t.pow(r,1/2))),c[i]=n(t.pow(r,1/3)),i++),r++})();var l=[],u=o.SHA256=a.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],u=n[5],d=n[6],f=n[7],p=0;p<64;p++){if(p<16)l[p]=e[t+p]|0;else{var m=l[p-15],h=(m<<25|m>>>7)^(m<<14|m>>>18)^m>>>3,g=l[p-2],_=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;l[p]=h+l[p-7]+_+l[p-16]}var v=s&u^~s&d,y=r&i^r&a^i&a,b=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),x=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),S=f+x+v+c[p]+l[p],C=b+y;f=d,d=u,u=s,s=o+S|0,o=a,a=i,i=r,r=S+C|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+o|0,n[4]=n[4]+s|0,n[5]=n[5]+u|0,n[6]=n[6]+d|0,n[7]=n[7]+f|0},_doFinalize:function(){var e=this._data,n=e.words,r=this._nDataBytes*8,i=e.sigBytes*8;return n[i>>>5]|=128<<24-i%32,n[(i+64>>>9<<4)+14]=t.floor(r/4294967296),n[(i+64>>>9<<4)+15]=r,e.sigBytes=n.length*4,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});n.SHA256=a._createHelper(u),n.HmacSHA256=a._createHmacHelper(u)})(Math),e.SHA256})})),sr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),or()):typeof define==`function`&&define.amd?define([`./core`,`./sha256`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.WordArray,r=t.algo,i=r.SHA256,a=r.SHA224=i.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=i._doFinalize.call(this);return e.sigBytes-=4,e}});t.SHA224=i._createHelper(a),t.HmacSHA224=i._createHmacHelper(a)})(),e.SHA224})})),cr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),$n()):typeof define==`function`&&define.amd?define([`./core`,`./x64-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.Hasher,r=t.x64,i=r.Word,a=r.WordArray,o=t.algo;function s(){return i.create.apply(i,arguments)}var c=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],l=[];(function(){for(var e=0;e<80;e++)l[e]=s()})();var u=o.SHA512=n.extend({_doReset:function(){this._hash=new a.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],u=n[5],d=n[6],f=n[7],p=r.high,m=r.low,h=i.high,g=i.low,_=a.high,v=a.low,y=o.high,b=o.low,x=s.high,S=s.low,C=u.high,w=u.low,T=d.high,E=d.low,D=f.high,O=f.low,k=p,A=m,j=h,M=g,N=_,P=v,F=y,I=b,L=x,R=S,ee=C,te=w,ne=T,re=E,ie=D,ae=O,z=0;z<80;z++){var oe,se,ce=l[z];if(z<16)se=ce.high=e[t+z*2]|0,oe=ce.low=e[t+z*2+1]|0;else{var le=l[z-15],ue=le.high,de=le.low,fe=(ue>>>1|de<<31)^(ue>>>8|de<<24)^ue>>>7,pe=(de>>>1|ue<<31)^(de>>>8|ue<<24)^(de>>>7|ue<<25),me=l[z-2],he=me.high,ge=me.low,_e=(he>>>19|ge<<13)^(he<<3|ge>>>29)^he>>>6,ve=(ge>>>19|he<<13)^(ge<<3|he>>>29)^(ge>>>6|he<<26),B=l[z-7],ye=B.high,be=B.low,xe=l[z-16],Se=xe.high,Ce=xe.low;oe=pe+be,se=fe+ye+ +(oe>>>0<pe>>>0),oe+=ve,se=se+_e+ +(oe>>>0<ve>>>0),oe+=Ce,se=se+Se+ +(oe>>>0<Ce>>>0),ce.high=se,ce.low=oe}var we=L&ee^~L&ne,Te=R&te^~R&re,Ee=k&j^k&N^j&N,De=A&M^A&P^M&P,V=(k>>>28|A<<4)^(k<<30|A>>>2)^(k<<25|A>>>7),Oe=(A>>>28|k<<4)^(A<<30|k>>>2)^(A<<25|k>>>7),ke=(L>>>14|R<<18)^(L>>>18|R<<14)^(L<<23|R>>>9),Ae=(R>>>14|L<<18)^(R>>>18|L<<14)^(R<<23|L>>>9),je=c[z],Me=je.high,Ne=je.low,Pe=ae+Ae,Fe=ie+ke+ +(Pe>>>0<ae>>>0),Pe=Pe+Te,Fe=Fe+we+ +(Pe>>>0<Te>>>0),Pe=Pe+Ne,Fe=Fe+Me+ +(Pe>>>0<Ne>>>0),Pe=Pe+oe,Fe=Fe+se+ +(Pe>>>0<oe>>>0),Ie=Oe+De,Le=V+Ee+ +(Ie>>>0<Oe>>>0);ie=ne,ae=re,ne=ee,re=te,ee=L,te=R,R=I+Pe|0,L=F+Fe+ +(R>>>0<I>>>0)|0,F=N,I=P,N=j,P=M,j=k,M=A,A=Pe+Ie|0,k=Fe+Le+ +(A>>>0<Pe>>>0)|0}m=r.low=m+A,r.high=p+k+ +(m>>>0<A>>>0),g=i.low=g+M,i.high=h+j+ +(g>>>0<M>>>0),v=a.low=v+P,a.high=_+N+ +(v>>>0<P>>>0),b=o.low=b+I,o.high=y+F+ +(b>>>0<I>>>0),S=s.low=S+R,s.high=x+L+ +(S>>>0<R>>>0),w=u.low=w+te,u.high=C+ee+ +(w>>>0<te>>>0),E=d.low=E+re,d.high=T+ne+ +(E>>>0<re>>>0),O=f.low=O+ae,f.high=D+ie+ +(O>>>0<ae>>>0)},_doFinalize:function(){var e=this._data,t=e.words,n=this._nDataBytes*8,r=e.sigBytes*8;return t[r>>>5]|=128<<24-r%32,t[(r+128>>>10<<5)+30]=Math.floor(n/4294967296),t[(r+128>>>10<<5)+31]=n,e.sigBytes=t.length*4,this._process(),this._hash.toX32()},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:1024/32});t.SHA512=n._createHelper(u),t.HmacSHA512=n._createHmacHelper(u)})(),e.SHA512})})),lr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),$n(),cr()):typeof define==`function`&&define.amd?define([`./core`,`./x64-core`,`./sha512`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.x64,r=n.Word,i=n.WordArray,a=t.algo,o=a.SHA512,s=a.SHA384=o.extend({_doReset:function(){this._hash=new i.init([new r.init(3418070365,3238371032),new r.init(1654270250,914150663),new r.init(2438529370,812702999),new r.init(355462360,4144912697),new r.init(1731405415,4290775857),new r.init(2394180231,1750603025),new r.init(3675008525,1694076839),new r.init(1203062813,3204075428)])},_doFinalize:function(){var e=o._doFinalize.call(this);return e.sigBytes-=16,e}});t.SHA384=o._createHelper(s),t.HmacSHA384=o._createHmacHelper(s)})(),e.SHA384})})),ur=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),$n()):typeof define==`function`&&define.amd?define([`./core`,`./x64-core`],r):r(n.CryptoJS)})(e,function(e){return(function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.x64.Word,s=n.algo,c=[],l=[],u=[];(function(){for(var e=1,t=0,n=0;n<24;n++){c[e+5*t]=(n+1)*(n+2)/2%64;var r=t%5,i=(2*e+3*t)%5;e=r,t=i}for(var e=0;e<5;e++)for(var t=0;t<5;t++)l[e+5*t]=t+(2*e+3*t)%5*5;for(var a=1,s=0;s<24;s++){for(var d=0,f=0,p=0;p<7;p++){if(a&1){var m=(1<<p)-1;m<32?f^=1<<m:d^=1<<m-32}a&128?a=a<<1^113:a<<=1}u[s]=o.create(d,f)}})();var d=[];(function(){for(var e=0;e<25;e++)d[e]=o.create()})();var f=s.SHA3=a.extend({cfg:a.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new o.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var n=this._state,r=this.blockSize/2,i=0;i<r;i++){var a=e[t+2*i],o=e[t+2*i+1];a=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360,o=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360;var s=n[i];s.high^=o,s.low^=a}for(var f=0;f<24;f++){for(var p=0;p<5;p++){for(var m=0,h=0,g=0;g<5;g++){var s=n[p+5*g];m^=s.high,h^=s.low}var _=d[p];_.high=m,_.low=h}for(var p=0;p<5;p++)for(var v=d[(p+4)%5],y=d[(p+1)%5],b=y.high,x=y.low,m=v.high^(b<<1|x>>>31),h=v.low^(x<<1|b>>>31),g=0;g<5;g++){var s=n[p+5*g];s.high^=m,s.low^=h}for(var S=1;S<25;S++){var m,h,s=n[S],C=s.high,w=s.low,T=c[S];T<32?(m=C<<T|w>>>32-T,h=w<<T|C>>>32-T):(m=w<<T-32|C>>>64-T,h=C<<T-32|w>>>64-T);var E=d[l[S]];E.high=m,E.low=h}var D=d[0],O=n[0];D.high=O.high,D.low=O.low;for(var p=0;p<5;p++)for(var g=0;g<5;g++){var S=p+5*g,s=n[S],k=d[S],A=d[(p+1)%5+5*g],j=d[(p+2)%5+5*g];s.high=k.high^~A.high&j.high,s.low=k.low^~A.low&j.low}var s=n[0],M=u[f];s.high^=M.high,s.low^=M.low}},_doFinalize:function(){var e=this._data,n=e.words;this._nDataBytes*8;var r=e.sigBytes*8,a=this.blockSize*32;n[r>>>5]|=1<<24-r%32,n[(t.ceil((r+1)/a)*a>>>5)-1]|=128,e.sigBytes=n.length*4,this._process();for(var o=this._state,s=this.cfg.outputLength/8,c=s/8,l=[],u=0;u<c;u++){var d=o[u],f=d.high,p=d.low;f=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360,p=(p<<8|p>>>24)&16711935|(p<<24|p>>>8)&4278255360,l.push(p),l.push(f)}return new i.init(l,s)},clone:function(){for(var e=a.clone.call(this),t=e._state=this._state.slice(0),n=0;n<25;n++)t[n]=t[n].clone();return e}});n.SHA3=a._createHelper(f),n.HmacSHA3=a._createHmacHelper(f)})(Math),e.SHA3})})),dr=a(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(W()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.algo,s=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),l=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),d=i.create([0,1518500249,1859775393,2400959708,2840853838]),f=i.create([1352829926,1548603684,1836072691,2053994217,0]),p=o.RIPEMD160=a.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360}for(var a=this._hash.words,o=d.words,p=f.words,b=s.words,x=c.words,S=l.words,C=u.words,w,T,E,D,O,k=w=a[0],A=T=a[1],j=E=a[2],M=D=a[3],N=O=a[4],P,n=0;n<80;n+=1)P=w+e[t+b[n]]|0,n<16?P+=m(T,E,D)+o[0]:n<32?P+=h(T,E,D)+o[1]:n<48?P+=g(T,E,D)+o[2]:n<64?P+=_(T,E,D)+o[3]:P+=v(T,E,D)+o[4],P|=0,P=y(P,S[n]),P=P+O|0,w=O,O=D,D=y(E,10),E=T,T=P,P=k+e[t+x[n]]|0,n<16?P+=v(A,j,M)+p[0]:n<32?P+=_(A,j,M)+p[1]:n<48?P+=g(A,j,M)+p[2]:n<64?P+=h(A,j,M)+p[3]:P+=m(A,j,M)+p[4],P|=0,P=y(P,C[n]),P=P+N|0,k=N,N=M,M=y(j,10),j=A,A=P;P=a[1]+E+M|0,a[1]=a[2]+D+N|0,a[2]=a[3]+O+k|0,a[3]=a[4]+w+A|0,a[4]=a[0]+T+j|0,a[0]=P},_doFinalize:function(){var e=this._data,t=e.words,n=this._nDataBytes*8,r=e.sigBytes*8;t[r>>>5]|=128<<24-r%32,t[(r+64>>>9<<4)+14]=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,e.sigBytes=(t.length+1)*4,this._process();for(var i=this._hash,a=i.words,o=0;o<5;o++){var s=a[o];a[o]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360}return i},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});function m(e,t,n){return e^t^n}function h(e,t,n){return e&t|~e&n}function g(e,t,n){return(e|~t)^n}function _(e,t,n){return e&n|t&~n}function v(e,t,n){return e^(t|~n)}function y(e,t){return e<<t|e>>>32-t}n.RIPEMD160=a._createHelper(p),n.HmacRIPEMD160=a._createHmacHelper(p)})(Math),e.RIPEMD160})})),fr=a(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(W()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){(function(){var t=e,n=t.lib.Base,r=t.enc.Utf8,i=t.algo;i.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,typeof t==`string`&&(t=r.parse(t));var n=e.blockSize,i=n*4;t.sigBytes>i&&(t=e.finalize(t)),t.clamp();for(var a=this._oKey=t.clone(),o=this._iKey=t.clone(),s=a.words,c=o.words,l=0;l<n;l++)s[l]^=1549556828,c[l]^=909522486;a.sigBytes=o.sigBytes=i,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})})()})})),pr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),or(),fr()):typeof define==`function`&&define.amd?define([`./core`,`./sha256`,`./hmac`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib,r=n.Base,i=n.WordArray,a=t.algo,o=a.SHA256,s=a.HMAC,c=a.PBKDF2=r.extend({cfg:r.extend({keySize:128/32,hasher:o,iterations:25e4}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=s.create(n.hasher,e),a=i.create(),o=i.create([1]),c=a.words,l=o.words,u=n.keySize,d=n.iterations;c.length<u;){var f=r.update(t).finalize(o);r.reset();for(var p=f.words,m=p.length,h=f,g=1;g<d;g++){h=r.finalize(h),r.reset();for(var _=h.words,v=0;v<m;v++)p[v]^=_[v]}a.concat(f),l[0]++}return a.sigBytes=u*4,a}});t.PBKDF2=function(e,t,n){return c.create(n).compute(e,t)}})(),e.PBKDF2})})),mr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),ar(),fr()):typeof define==`function`&&define.amd?define([`./core`,`./sha1`,`./hmac`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib,r=n.Base,i=n.WordArray,a=t.algo,o=a.MD5,s=a.EvpKDF=r.extend({cfg:r.extend({keySize:128/32,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n,r=this.cfg,a=r.hasher.create(),o=i.create(),s=o.words,c=r.keySize,l=r.iterations;s.length<c;){n&&a.update(n),n=a.update(e).finalize(t),a.reset();for(var u=1;u<l;u++)n=a.finalize(n),a.reset();o.concat(n)}return o.sigBytes=c*4,o}});t.EvpKDF=function(e,t,n){return s.create(n).compute(e,t)}})(),e.EvpKDF})})),hr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),mr()):typeof define==`function`&&define.amd?define([`./core`,`./evpkdf`],r):r(n.CryptoJS)})(e,function(e){e.lib.Cipher||function(t){var n=e,r=n.lib,i=r.Base,a=r.WordArray,o=r.BufferedBlockAlgorithm,s=n.enc;s.Utf8;var c=s.Base64,l=n.algo.EvpKDF,u=r.Cipher=o.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return typeof e==`string`?S:y}return function(t){return{encrypt:function(n,r,i){return e(r).encrypt(t,n,r,i)},decrypt:function(n,r,i){return e(r).decrypt(t,n,r,i)}}}}()});r.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var d=n.mode={},f=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),p=d.CBC=function(){var e=f.extend();e.Encryptor=e.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize;n.call(this,e,t,i),r.encryptBlock(e,t),this._prevBlock=e.slice(t,t+i)}}),e.Decryptor=e.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,a=e.slice(t,t+i);r.decryptBlock(e,t),n.call(this,e,t,i),this._prevBlock=a}});function n(e,n,r){var i,a=this._iv;a?(i=a,this._iv=t):i=this._prevBlock;for(var o=0;o<r;o++)e[n+o]^=i[o]}return e}(),m=n.pad={},h=m.Pkcs7={pad:function(e,t){for(var n=t*4,r=n-e.sigBytes%n,i=r<<24|r<<16|r<<8|r,o=[],s=0;s<r;s+=4)o.push(i);var c=a.create(o,r);e.concat(c)},unpad:function(e){var t=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=t}};r.BlockCipher=u.extend({cfg:u.cfg.extend({mode:p,padding:h}),reset:function(){var e;u.reset.call(this);var t=this.cfg,n=t.iv,r=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=r.createEncryptor:(e=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(r,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:128/32});var g=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),_=n.format={},v=_.OpenSSL={stringify:function(e){var t,n=e.ciphertext,r=e.salt;return t=r?a.create([1398893684,1701076831]).concat(r).concat(n):n,t.toString(c)},parse:function(e){var t,n=c.parse(e),r=n.words;return r[0]==1398893684&&r[1]==1701076831&&(t=a.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),g.create({ciphertext:n,salt:t})}},y=r.SerializableCipher=i.extend({cfg:i.extend({format:v}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r),a=i.finalize(t),o=i.cfg;return g.create({ciphertext:a,key:n,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return typeof e==`string`?t.parse(e,this):e}}),b=n.kdf={},x=b.OpenSSL={execute:function(e,t,n,r,i){if(r||=a.random(64/8),i)var o=l.create({keySize:t+n,hasher:i}).compute(e,r);else var o=l.create({keySize:t+n}).compute(e,r);var s=a.create(o.words.slice(t),n*4);return o.sigBytes=t*4,g.create({key:o,iv:s,salt:r})}},S=r.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:x}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=r.kdf.execute(n,e.keySize,e.ivSize,r.salt,r.hasher);r.iv=i.iv;var a=y.encrypt.call(this,e,t,i.key,r);return a.mixIn(i),a},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var i=r.kdf.execute(n,e.keySize,e.ivSize,t.salt,r.hasher);return r.iv=i.iv,y.decrypt.call(this,e,t,i.key,r)}})}()})})),gr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.mode.CFB=function(){var t=e.lib.BlockCipherMode.extend();t.Encryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize;n.call(this,e,t,i,r),this._prevBlock=e.slice(t,t+i)}}),t.Decryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,a=e.slice(t,t+i);n.call(this,e,t,i,r),this._prevBlock=a}});function n(e,t,n,r){var i,a=this._iv;a?(i=a.slice(0),this._iv=void 0):i=this._prevBlock,r.encryptBlock(i,0);for(var o=0;o<n;o++)e[t+o]^=i[o]}return t}(),e.mode.CFB})})),_r=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.mode.CTR=function(){var t=e.lib.BlockCipherMode.extend();return t.Decryptor=t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,i=this._iv,a=this._counter;i&&(a=this._counter=i.slice(0),this._iv=void 0);var o=a.slice(0);n.encryptBlock(o,0),a[r-1]=a[r-1]+1|0;for(var s=0;s<r;s++)e[t+s]^=o[s]}}),t}(),e.mode.CTR})})),vr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.mode.CTRGladman=function(){var t=e.lib.BlockCipherMode.extend();function n(e){if((e>>24&255)==255){var t=e>>16&255,n=e>>8&255,r=e&255;t===255?(t=0,n===255?(n=0,r===255?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}else e+=1<<24;return e}function r(e){return(e[0]=n(e[0]))===0&&(e[1]=n(e[1])),e}return t.Decryptor=t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,a=this._iv,o=this._counter;a&&(o=this._counter=a.slice(0),this._iv=void 0),r(o);var s=o.slice(0);n.encryptBlock(s,0);for(var c=0;c<i;c++)e[t+c]^=s[c]}}),t}(),e.mode.CTRGladman})})),yr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.mode.OFB=function(){var t=e.lib.BlockCipherMode.extend();return t.Decryptor=t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,i=this._iv,a=this._keystream;i&&(a=this._keystream=i.slice(0),this._iv=void 0),n.encryptBlock(a,0);for(var o=0;o<r;o++)e[t+o]^=a[o]}}),t}(),e.mode.OFB})})),br=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.mode.ECB=function(){var t=e.lib.BlockCipherMode.extend();return t.Encryptor=t.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),t.Decryptor=t.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),t}(),e.mode.ECB})})),xr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.pad.AnsiX923={pad:function(e,t){var n=e.sigBytes,r=t*4,i=r-n%r,a=n+i-1;e.clamp(),e.words[a>>>2]|=i<<24-a%4*8,e.sigBytes+=i},unpad:function(e){var t=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=t}},e.pad.Ansix923})})),Sr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.pad.Iso10126={pad:function(t,n){var r=n*4,i=r-t.sigBytes%r;t.concat(e.lib.WordArray.random(i-1)).concat(e.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=t}},e.pad.Iso10126})})),Cr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.pad.Iso97971={pad:function(t,n){t.concat(e.lib.WordArray.create([2147483648],1)),e.pad.ZeroPadding.pad(t,n)},unpad:function(t){e.pad.ZeroPadding.unpad(t),t.sigBytes--}},e.pad.Iso97971})})),wr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.pad.ZeroPadding={pad:function(e,t){var n=t*4;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){for(var t=e.words,n=e.sigBytes-1,n=e.sigBytes-1;n>=0;n--)if(t[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}}},e.pad.ZeroPadding})})),Tr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding})})),Er=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(t){var n=e,r=n.lib.CipherParams,i=n.enc.Hex,a=n.format;a.Hex={stringify:function(e){return e.ciphertext.toString(i)},parse:function(e){var t=i.parse(e);return r.create({ciphertext:t})}}})(),e.format.Hex})})),Dr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),nr(),ir(),mr(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./enc-base64`,`./md5`,`./evpkdf`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.BlockCipher,r=t.algo,i=[],a=[],o=[],s=[],c=[],l=[],u=[],d=[],f=[],p=[];(function(){for(var e=[],t=0;t<256;t++)t<128?e[t]=t<<1:e[t]=t<<1^283;for(var n=0,r=0,t=0;t<256;t++){var m=r^r<<1^r<<2^r<<3^r<<4;m=m>>>8^m&255^99,i[n]=m,a[m]=n;var h=e[n],g=e[h],_=e[g],v=e[m]*257^m*16843008;o[n]=v<<24|v>>>8,s[n]=v<<16|v>>>16,c[n]=v<<8|v>>>24,l[n]=v;var v=_*16843009^g*65537^h*257^n*16843008;u[m]=v<<24|v>>>8,d[m]=v<<16|v>>>16,f[m]=v<<8|v>>>24,p[m]=v,n?(n=h^e[e[e[_^h]]],r^=e[e[r]]):n=r=1}})();var m=[0,1,2,4,8,16,32,64,128,27,54],h=r.AES=n.extend({_doReset:function(){var e;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var t=this._keyPriorReset=this._key,n=t.words,r=t.sigBytes/4,a=((this._nRounds=r+6)+1)*4,o=this._keySchedule=[],s=0;s<a;s++)s<r?o[s]=n[s]:(e=o[s-1],s%r?r>6&&s%r==4&&(e=i[e>>>24]<<24|i[e>>>16&255]<<16|i[e>>>8&255]<<8|i[e&255]):(e=e<<8|e>>>24,e=i[e>>>24]<<24|i[e>>>16&255]<<16|i[e>>>8&255]<<8|i[e&255],e^=m[s/r|0]<<24),o[s]=o[s-r]^e);for(var c=this._invKeySchedule=[],l=0;l<a;l++){var s=a-l;if(l%4)var e=o[s];else var e=o[s-4];l<4||s<=4?c[l]=e:c[l]=u[i[e>>>24]]^d[i[e>>>16&255]]^f[i[e>>>8&255]]^p[i[e&255]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,s,c,l,i)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,u,d,f,p,a);var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,a,o,s){for(var c=this._nRounds,l=e[t]^n[0],u=e[t+1]^n[1],d=e[t+2]^n[2],f=e[t+3]^n[3],p=4,m=1;m<c;m++){var h=r[l>>>24]^i[u>>>16&255]^a[d>>>8&255]^o[f&255]^n[p++],g=r[u>>>24]^i[d>>>16&255]^a[f>>>8&255]^o[l&255]^n[p++],_=r[d>>>24]^i[f>>>16&255]^a[l>>>8&255]^o[u&255]^n[p++],v=r[f>>>24]^i[l>>>16&255]^a[u>>>8&255]^o[d&255]^n[p++];l=h,u=g,d=_,f=v}var h=(s[l>>>24]<<24|s[u>>>16&255]<<16|s[d>>>8&255]<<8|s[f&255])^n[p++],g=(s[u>>>24]<<24|s[d>>>16&255]<<16|s[f>>>8&255]<<8|s[l&255])^n[p++],_=(s[d>>>24]<<24|s[f>>>16&255]<<16|s[l>>>8&255]<<8|s[u&255])^n[p++],v=(s[f>>>24]<<24|s[l>>>16&255]<<16|s[u>>>8&255]<<8|s[d&255])^n[p++];e[t]=h,e[t+1]=g,e[t+2]=_,e[t+3]=v},keySize:256/32});t.AES=n._createHelper(h)})(),e.AES})})),Or=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),nr(),ir(),mr(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./enc-base64`,`./md5`,`./evpkdf`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib,r=n.WordArray,i=n.BlockCipher,a=t.algo,o=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],l=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],u=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],d=a.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],n=0;n<56;n++){var r=o[n]-1;t[n]=e[r>>>5]>>>31-r%32&1}for(var i=this._subKeys=[],a=0;a<16;a++){for(var l=i[a]=[],u=c[a],n=0;n<24;n++)l[n/6|0]|=t[(s[n]-1+u)%28]<<31-n%6,l[4+(n/6|0)]|=t[28+(s[n+24]-1+u)%28]<<31-n%6;l[0]=l[0]<<1|l[0]>>>31;for(var n=1;n<7;n++)l[n]=l[n]>>>(n-1)*4+3;l[7]=l[7]<<5|l[7]>>>27}for(var d=this._invSubKeys=[],n=0;n<16;n++)d[n]=i[15-n]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,n){this._lBlock=e[t],this._rBlock=e[t+1],f.call(this,4,252645135),f.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),f.call(this,1,1431655765);for(var r=0;r<16;r++){for(var i=n[r],a=this._lBlock,o=this._rBlock,s=0,c=0;c<8;c++)s|=l[c][((o^i[c])&u[c])>>>0];this._lBlock=o,this._rBlock=a^s}var d=this._lBlock;this._lBlock=this._rBlock,this._rBlock=d,f.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),f.call(this,16,65535),f.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function f(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<<e}function p(e,t){var n=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<<e}t.DES=i._createHelper(d);var m=a.TripleDES=i.extend({_doReset:function(){var e=this._key.words;if(e.length!==2&&e.length!==4&&e.length<6)throw Error(`Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.`);var t=e.slice(0,2),n=e.length<4?e.slice(0,2):e.slice(2,4),i=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=d.createEncryptor(r.create(t)),this._des2=d.createEncryptor(r.create(n)),this._des3=d.createEncryptor(r.create(i))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:192/32,ivSize:64/32,blockSize:64/32});t.TripleDES=i._createHelper(m)})(),e.TripleDES})})),kr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),nr(),ir(),mr(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./enc-base64`,`./md5`,`./evpkdf`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.StreamCipher,r=t.algo,i=r.RC4=n.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes,r=this._S=[],i=0;i<256;i++)r[i]=i;for(var i=0,a=0;i<256;i++){var o=i%n,s=t[o>>>2]>>>24-o%4*8&255;a=(a+r[i]+s)%256;var c=r[i];r[i]=r[a],r[a]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=a.call(this)},keySize:256/32,ivSize:0});function a(){for(var e=this._S,t=this._i,n=this._j,r=0,i=0;i<4;i++){t=(t+1)%256,n=(n+e[t])%256;var a=e[t];e[t]=e[n],e[n]=a,r|=e[(e[t]+e[n])%256]<<24-i*8}return this._i=t,this._j=n,r}t.RC4=n._createHelper(i);var o=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)a.call(this)}});t.RC4Drop=n._createHelper(o)})(),e.RC4})})),Ar=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),nr(),ir(),mr(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./enc-base64`,`./md5`,`./evpkdf`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.StreamCipher,r=t.algo,i=[],a=[],o=[],s=r.Rabbit=n.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,n=0;n<4;n++)e[n]=(e[n]<<8|e[n]>>>24)&16711935|(e[n]<<24|e[n]>>>8)&4278255360;var r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,e[0]&4294901760|e[1]&65535,e[3]<<16|e[3]>>>16,e[1]&4294901760|e[2]&65535,e[0]<<16|e[0]>>>16,e[2]&4294901760|e[3]&65535,e[1]<<16|e[1]>>>16,e[3]&4294901760|e[0]&65535];this._b=0;for(var n=0;n<4;n++)c.call(this);for(var n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var a=t.words,o=a[0],s=a[1],l=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,u=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360,d=l>>>16|u&4294901760,f=u<<16|l&65535;i[0]^=l,i[1]^=d,i[2]^=u,i[3]^=f,i[4]^=l,i[5]^=d,i[6]^=u,i[7]^=f;for(var n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=(i[r]<<8|i[r]>>>24)&16711935|(i[r]<<24|i[r]>>>8)&4278255360,e[t+r]^=i[r]},blockSize:128/32,ivSize:64/32});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)a[n]=t[n];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+ +(t[0]>>>0<a[0]>>>0)|0,t[2]=t[2]+886263092+ +(t[1]>>>0<a[1]>>>0)|0,t[3]=t[3]+1295307597+ +(t[2]>>>0<a[2]>>>0)|0,t[4]=t[4]+3545052371+ +(t[3]>>>0<a[3]>>>0)|0,t[5]=t[5]+886263092+ +(t[4]>>>0<a[4]>>>0)|0,t[6]=t[6]+1295307597+ +(t[5]>>>0<a[5]>>>0)|0,t[7]=t[7]+3545052371+ +(t[6]>>>0<a[6]>>>0)|0,this._b=+(t[7]>>>0<a[7]>>>0);for(var n=0;n<8;n++){var r=e[n]+t[n],i=r&65535,s=r>>>16;o[n]=((i*i>>>17)+i*s>>>15)+s*s^((r&4294901760)*r|0)+((r&65535)*r|0)}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}t.Rabbit=n._createHelper(s)})(),e.Rabbit})})),jr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),nr(),ir(),mr(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./enc-base64`,`./md5`,`./evpkdf`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.StreamCipher,r=t.algo,i=[],a=[],o=[],s=r.RabbitLegacy=n.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],r=this._C=[e[2]<<16|e[2]>>>16,e[0]&4294901760|e[1]&65535,e[3]<<16|e[3]>>>16,e[1]&4294901760|e[2]&65535,e[0]<<16|e[0]>>>16,e[2]&4294901760|e[3]&65535,e[1]<<16|e[1]>>>16,e[3]&4294901760|e[0]&65535];this._b=0;for(var i=0;i<4;i++)c.call(this);for(var i=0;i<8;i++)r[i]^=n[i+4&7];if(t){var a=t.words,o=a[0],s=a[1],l=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,u=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360,d=l>>>16|u&4294901760,f=u<<16|l&65535;r[0]^=l,r[1]^=d,r[2]^=u,r[3]^=f,r[4]^=l,r[5]^=d,r[6]^=u,r[7]^=f;for(var i=0;i<4;i++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=(i[r]<<8|i[r]>>>24)&16711935|(i[r]<<24|i[r]>>>8)&4278255360,e[t+r]^=i[r]},blockSize:128/32,ivSize:64/32});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)a[n]=t[n];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+ +(t[0]>>>0<a[0]>>>0)|0,t[2]=t[2]+886263092+ +(t[1]>>>0<a[1]>>>0)|0,t[3]=t[3]+1295307597+ +(t[2]>>>0<a[2]>>>0)|0,t[4]=t[4]+3545052371+ +(t[3]>>>0<a[3]>>>0)|0,t[5]=t[5]+886263092+ +(t[4]>>>0<a[4]>>>0)|0,t[6]=t[6]+1295307597+ +(t[5]>>>0<a[5]>>>0)|0,t[7]=t[7]+3545052371+ +(t[6]>>>0<a[6]>>>0)|0,this._b=+(t[7]>>>0<a[7]>>>0);for(var n=0;n<8;n++){var r=e[n]+t[n],i=r&65535,s=r>>>16;o[n]=((i*i>>>17)+i*s>>>15)+s*s^((r&4294901760)*r|0)+((r&65535)*r|0)}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}t.RabbitLegacy=n._createHelper(s)})(),e.RabbitLegacy})})),Mr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),nr(),ir(),mr(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./enc-base64`,`./md5`,`./evpkdf`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.BlockCipher,r=t.algo;let i=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],a=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var o={pbox:[],sbox:[]};function s(e,t){let n=t>>24&255,r=t>>16&255,i=t>>8&255,a=t&255,o=e.sbox[0][n]+e.sbox[1][r];return o^=e.sbox[2][i],o+=e.sbox[3][a],o}function c(e,t,n){let r=t,i=n,a;for(let t=0;t<16;++t)r^=e.pbox[t],i=s(e,r)^i,a=r,r=i,i=a;return a=r,r=i,i=a,i^=e.pbox[16],r^=e.pbox[17],{left:r,right:i}}function l(e,t,n){let r=t,i=n,a;for(let t=17;t>1;--t)r^=e.pbox[t],i=s(e,r)^i,a=r,r=i,i=a;return a=r,r=i,i=a,i^=e.pbox[1],r^=e.pbox[0],{left:r,right:i}}function u(e,t,n){for(let t=0;t<4;t++){e.sbox[t]=[];for(let n=0;n<256;n++)e.sbox[t][n]=a[t][n]}let r=0;for(let a=0;a<18;a++)e.pbox[a]=i[a]^t[r],r++,r>=n&&(r=0);let o=0,s=0,l=0;for(let t=0;t<18;t+=2)l=c(e,o,s),o=l.left,s=l.right,e.pbox[t]=o,e.pbox[t+1]=s;for(let t=0;t<4;t++)for(let n=0;n<256;n+=2)l=c(e,o,s),o=l.left,s=l.right,e.sbox[t][n]=o,e.sbox[t][n+1]=s;return!0}var d=r.Blowfish=n.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var e=this._keyPriorReset=this._key,t=e.words;u(o,t,e.sigBytes/4)}},encryptBlock:function(e,t){var n=c(o,e[t],e[t+1]);e[t]=n.left,e[t+1]=n.right},decryptBlock:function(e,t){var n=l(o,e[t],e[t+1]);e[t]=n.left,e[t+1]=n.right},blockSize:64/32,keySize:128/32,ivSize:64/32});t.Blowfish=n._createHelper(d)})(),e.Blowfish})})),Nr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),$n(),er(),tr(),nr(),rr(),ir(),ar(),or(),sr(),cr(),lr(),ur(),dr(),fr(),pr(),mr(),hr(),gr(),_r(),vr(),yr(),br(),xr(),Sr(),Cr(),wr(),Tr(),Er(),Dr(),Or(),kr(),Ar(),jr(),Mr()):typeof define==`function`&&define.amd?define(`./core,./x64-core,./lib-typedarrays,./enc-utf16,./enc-base64,./enc-base64url,./md5,./sha1,./sha256,./sha224,./sha512,./sha384,./sha3,./ripemd160,./hmac,./pbkdf2,./evpkdf,./cipher-core,./mode-cfb,./mode-ctr,./mode-ctr-gladman,./mode-ofb,./mode-ecb,./pad-ansix923,./pad-iso10126,./pad-iso97971,./pad-zeropadding,./pad-nopadding,./format-hex,./aes,./tripledes,./rc4,./rabbit,./rabbit-legacy,./blowfish`.split(`,`),r):n.CryptoJS=r(n.CryptoJS)})(e,function(e){return e})})),Pr=a(((e,t)=>{t.exports=n;function n(e,t){for(var n=Array(arguments.length-1),r=0,i=2,a=!0;i<arguments.length;)n[r++]=arguments[i++];return new Promise(function(i,o){n[r]=function(e){if(a)if(a=!1,e)o(e);else{for(var t=Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];i.apply(null,t)}};try{e.apply(t||null,n)}catch(e){a&&(a=!1,o(e))}})}})),Fr=a((e=>{var t=e;t.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&e.charAt(t)===`=`;)++n;return Math.ceil(e.length*3)/4-n};for(var n=Array(64),r=Array(123),i=0;i<64;)r[n[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;t.encode=function(e,t,r){for(var i=null,a=[],o=0,s=0,c;t<r;){var l=e[t++];switch(s){case 0:a[o++]=n[l>>2],c=(l&3)<<4,s=1;break;case 1:a[o++]=n[c|l>>4],c=(l&15)<<2,s=2;break;case 2:a[o++]=n[c|l>>6],a[o++]=n[l&63],s=0;break}o>8191&&((i||=[]).push(String.fromCharCode.apply(String,a)),o=0)}return s&&(a[o++]=n[c],a[o++]=61,s===1&&(a[o++]=61)),i?(o&&i.push(String.fromCharCode.apply(String,a.slice(0,o))),i.join(``)):String.fromCharCode.apply(String,a.slice(0,o))};var a=`invalid encoding`;t.decode=function(e,t,n){for(var i=n,o=0,s,c=0;c<e.length;){var l=e.charCodeAt(c++);if(l===61&&o>1)break;if((l=r[l])===void 0)throw Error(a);switch(o){case 0:s=l,o=1;break;case 1:t[n++]=s<<2|(l&48)>>4,s=l,o=2;break;case 2:t[n++]=(s&15)<<4|(l&60)>>2,s=l,o=3;break;case 3:t[n++]=(s&3)<<6|l,o=0;break}}if(o===1)throw Error(a);return n-i},t.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}})),Ir=a(((e,t)=>{t.exports=n;function n(){this._listeners={}}n.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},n.prototype.off=function(e,t){if(e===void 0)this._listeners={};else if(t===void 0)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},n.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}})),Lr=a(((e,t)=>{t.exports=n(n);function n(e){return typeof Float32Array<`u`?(function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=n[3]===128;function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3]}function a(e,r,i){t[0]=e,r[i]=n[3],r[i+1]=n[2],r[i+2]=n[1],r[i+3]=n[0]}e.writeFloatLE=r?i:a,e.writeFloatBE=r?a:i;function o(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function s(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.readFloatLE=r?o:s,e.readFloatBE=r?s:o})():(function(){function t(e,t,n,r){var i=+(t<0);if(i&&(t=-t),t===0)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var a=Math.floor(Math.log(t)/Math.LN2),o=Math.round(t*2**-a*8388608)&8388607;e((i<<31|a+127<<23|o)>>>0,n,r)}}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,i);function n(e,t,n){var r=e(t,n),i=(r>>31)*2+1,a=r>>>23&255,o=r&8388607;return a===255?o?NaN:i*(1/0):a===0?i*1401298464324817e-60*o:i*2**(a-150)*(o+8388608)}e.readFloatLE=n.bind(null,a),e.readFloatBE=n.bind(null,o)})(),typeof Float64Array<`u`?(function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=n[7]===128;function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3],r[i+4]=n[4],r[i+5]=n[5],r[i+6]=n[6],r[i+7]=n[7]}function a(e,r,i){t[0]=e,r[i]=n[7],r[i+1]=n[6],r[i+2]=n[5],r[i+3]=n[4],r[i+4]=n[3],r[i+5]=n[2],r[i+6]=n[1],r[i+7]=n[0]}e.writeDoubleLE=r?i:a,e.writeDoubleBE=r?a:i;function o(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function s(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.readDoubleLE=r?o:s,e.readDoubleBE=r?s:o})():(function(){function t(e,t,n,r,i,a){var o=+(r<0);if(o&&(r=-r),r===0)e(0,i,a+t),e(1/r>0?0:2147483648,i,a+n);else if(isNaN(r))e(0,i,a+t),e(2146959360,i,a+n);else if(r>17976931348623157e292)e(0,i,a+t),e((o<<31|2146435072)>>>0,i,a+n);else{var s;if(r<22250738585072014e-324)s=r/5e-324,e(s>>>0,i,a+t),e((o<<31|s/4294967296)>>>0,i,a+n);else{var c=Math.floor(Math.log(r)/Math.LN2);c===1024&&(c=1023),s=r*2**-c,e(s*4503599627370496>>>0,i,a+t),e((o<<31|c+1023<<20|s*1048576&1048575)>>>0,i,a+n)}}}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,i,4,0);function n(e,t,n,r,i){var a=e(r,i+t),o=e(r,i+n),s=(o>>31)*2+1,c=o>>>20&2047,l=4294967296*(o&1048575)+a;return c===2047?l?NaN:s*(1/0):c===0?s*5e-324*l:s*2**(c-1075)*(l+4503599627370496)}e.readDoubleLE=n.bind(null,a,0,4),e.readDoubleBE=n.bind(null,o,4,0)})(),e}function r(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function i(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=e&255}function a(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}})),Rr=a(((t,n)=>{n.exports=r;function r(t){try{if(typeof e!=`function`)return null;var n=e(t);return n&&(n.length||Object.keys(n).length)?n:null}catch{return null}}})),zr=a((e=>{var t=e,n=`�`;t.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)n=e.charCodeAt(r),n<128?t+=1:n<2048?t+=2:(n&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320?(++r,t+=4):t+=3;return t},t.read=function(e,t,r){if(r-t<1)return``;for(var i=``,a=t;a<r;){var o=e[a++];if(o<=127)i+=String.fromCharCode(o);else if(o>=192&&o<224){var s=(o&31)<<6|e[a++]&63;i+=s>=128?String.fromCharCode(s):n}else if(o>=224&&o<240){var c=(o&15)<<12|(e[a++]&63)<<6|e[a++]&63;i+=c>=2048?String.fromCharCode(c):n}else if(o>=240){var l=(o&7)<<18|(e[a++]&63)<<12|(e[a++]&63)<<6|e[a++]&63;l<65536||l>1114111?i+=n:(l-=65536,i+=String.fromCharCode(55296+(l>>10)),i+=String.fromCharCode(56320+(l&1023)))}}return i},t.write=function(e,t,n){for(var r=n,i,a,o=0;o<e.length;++o)i=e.charCodeAt(o),i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)==55296&&((a=e.charCodeAt(o+1))&64512)==56320?(i=65536+((i&1023)<<10)+(a&1023),++o,t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128);return n-r}})),Br=a(((e,t)=>{t.exports=n;function n(e,t,n){var r=n||8192,i=r>>>1,a=null,o=r;return function(n){if(n<1||n>i)return e(n);o+n>r&&(a=e(r),o=0);var s=t.call(a,o,o+=n);return o&7&&(o=(o|7)+1),s}}})),Vr=`cosmiframe`,Hr=`cosmiframe_keystorechange`,Ur=class{_mutable;actions;_env;logger;constructor(){this._mutable={state:U.Init}}get env(){return this._env}setEnv(e){this._env=e}setActions=e=>{this.actions=e};get isMobile(){return this.env?.device===`mobile`}get mutable(){return this._mutable}get state(){return this.mutable.state}get isInit(){return this.state===`Init`}get isDone(){return this.state===`Done`}get isError(){return this.state===`Error`}get isPending(){return this.state===`Pending`}get data(){return this.mutable.data}get message(){return this.mutable.message}setState(e){this.logger?.debug(`[State Change] ${this.state} (${this.walletStatus}) -> ${e} (${this.chainName}/${this.walletName})`),this._mutable.state=e,this.actions?.state?.(e)}setData(e){this._mutable.data=e,this.actions?.data?.(e)}setMessage(e){this.logger?.debug(`[Message Set] ${e} (${this.chainName}/${this.walletName})`),this._mutable.message=e,this.actions?.message?.(e)}reset(){this.setData(void 0),this.setMessage(void 0),this.setState(U.Init)}get walletStatus(){return Dn(this.state,this.message)}get isWalletOnceConnect(){return this.isWalletConnected||this.isWalletError}get isWalletConnecting(){return this.walletStatus===`Connecting`}get isWalletConnected(){return this.walletStatus===`Connected`}get isWalletDisconnected(){return this.walletStatus===`Disconnected`}get isWalletRejected(){return this.walletStatus===`Rejected`}get isWalletNotExist(){return this.walletStatus===`NotExist`}get isWalletError(){return this.walletStatus===`Error`}},Wr=class extends Ur{clientMutable={state:U.Init};emitter;_walletInfo;callbacks;session;walletConnectOptions;isActive=!1;throwErrors=!1;constructor(e){super(),this._walletInfo=e}get appUrl(){return this.client?.appUrl}get qrUrl(){return this.client?.qrUrl}activate(){this.isActive=!0}inactivate(){this.isActive=!1}get client(){return this.clientMutable?.data}initingClient(){this.clientMutable.state=U.Pending,this.clientMutable.message=void 0,this.clientMutable.data=void 0}initClientDone(e){this.clientMutable.data=e,this.clientMutable.state=U.Done,this.clientMutable.message=void 0}initClientError(e){this.logger?.error(`${this.walletPrettyName} initClientError: ${e?.message}`),this.clientMutable.message=e?.message,this.clientMutable.state=U.Error,this.isModeExtension?this.setClientNotExist():this.setError(`InitClientError: ${e.message}`)}get walletInfo(){return this._walletInfo}get isModeExtension(){return this.walletInfo.mode===`extension`}get isModeWalletConnect(){return this.walletInfo.mode===`wallet-connect`}get downloadInfo(){let e=this.walletInfo.downloads||[];return e=e.filter(e=>e.device===this.env?.device||!e.device),e.length===1||(e=e.filter(e=>e.os===this.env?.os||!e.os),e.length===1)||(e=e.filter(e=>e.browser===this.env?.browser||!e.browser)),e[0]}get walletName(){return this.walletInfo.name}get walletPrettyName(){return this.walletInfo.prettyName}get rejectMessageSource(){return typeof this.walletInfo.rejectMessage==`string`?this.walletInfo.rejectMessage:this.walletInfo.rejectMessage?.source}get rejectMessageTarget(){if(typeof this.walletInfo.rejectMessage!=`string`)return this.walletInfo.rejectMessage?.target}get rejectCode(){return this.walletInfo.rejectCode}rejectMatched(e){return this.rejectMessageSource&&e.message===this.rejectMessageSource||this.rejectCode&&e.code===this.rejectCode}updateCallbacks(e){this.callbacks={...this.callbacks,...e}}_disconnect=async(e,t)=>{await this.callbacks?.beforeDisconnect?.(),await this.client?.disconnect?.(t),this.clientMutable.state!==U.Error&&this.reset(),this.walletName!==`cosmiframe`&&window.localStorage.removeItem(`cosmos-kit@2:core//current-wallet`),e&&(this.emitter?.emit(`sync_disconnect`,this.chainName),this.logger?.debug("[WALLET EVENT] Emit `sync_disconnect`")),await this.callbacks?.afterDisconnect?.()};disconnect=async(e,t)=>{await this._disconnect(e,t)};setClientNotExist(e){let t=e===void 0?Error():e;t.message=jn.message,this.setError(t)}setRejected(e){let t=e===void 0?Error():e;t.message=Mn.message,this.setError(t)}setError(e){let t=typeof e==`string`||e===void 0?Error(e):e;if(this.setState(U.Error),this.setMessage(t.message),this.throwErrors===!0||this.throwErrors===`connect_only`&&t.name===`ConnectError`)throw t}connect=async e=>{await this.callbacks?.beforeConnect?.();let t=typeof this.walletInfo.mobileDisabled==`boolean`?this.walletInfo.mobileDisabled:this.walletInfo.mobileDisabled();if(this.isMobile&&t){this.setError(new wn(`This wallet is not supported on mobile, please use desktop browsers.`));return}e&&(this.emitter?.emit(`sync_connect`,this.chainName),this.logger?.debug(`[Event Emit] \`sync_connect\` (${this.chainName}/${this.walletName})`));try{if(!this.client&&(this.setState(U.Pending),this.setMessage(`InitClient`),await this.initClient(this.walletInfo.mode===`wallet-connect`?this.walletConnectOptions:void 0),this.emitter?.emit(`broadcast_client`,this.client),this.logger?.debug("[WALLET EVENT] Emit `broadcast_client`"),!this.client)){this.setClientNotExist(new wn);return}await this.update()}catch(e){this.setError(new wn(e.message))}await this.callbacks?.afterConnect?.()}},Gr=class extends Wr{mainWallet;chainRecord;_rpcEndpoint;_restEndpoint;connectChains;offlineSigner;namespace=`cosmos`;preferredSignType;constructor(e,t){super(e),this.chainRecord=t,this.preferredSignType=t.clientOptions?.preferredSignType||`amino`}get chain(){return this.chainRecord.chain}get assetList(){return this.chainRecord.assetList}get isTestNet(){return this.chainName.includes(`testnet`)}get preferredEndpoints(){return this.chainRecord.preferredEndpoints}get rpcEndpoints(){return this.preferredEndpoints?.rpc||[]}get restEndpoints(){return this.preferredEndpoints?.rest||[]}get isLazy(){return this.preferredEndpoints.isLazy}addEndpoints(e){this.chainRecord.preferredEndpoints={isLazy:e?.isLazy??this.preferredEndpoints?.isLazy,rpc:[...e?.rpc||[],...this.preferredEndpoints?.rpc||[]],rest:[...e?.rest||[],...this.preferredEndpoints?.rest||[]]}}get chainName(){return this.chainRecord.name}get chainLogoUrl(){return this.assetList?.assets[0]?.logo_URIs?.svg||this.assetList?.assets[0]?.logo_URIs?.png||void 0}get stargateOptions(){return this.chainRecord.clientOptions?.stargate}get signingStargateOptions(){return this.chainRecord.clientOptions?.signingStargate||this.chainRecord.clientOptions?.stargate}get signingCosmwasmOptions(){return this.chainRecord.clientOptions?.signingCosmwasm}get assets(){return this.assetList?.assets}get chainId(){return this.chain?.chain_id}get cosmwasmEnabled(){return this.chain?.codebase?.cosmwasm_enabled}get username(){return this.data?.username}get address(){return this.data?.address}setData(e){this.logger?.debug(`[Data Change] ${JSON.stringify(this.data)} -> ${JSON.stringify(e)} (${this.chainName}/${this.walletName})`),this._mutable.data=e,this.actions?.data?.(e);let t=window.localStorage.getItem(`cosmos-kit@2:core//accounts`),n=t?JSON.parse(t):[];e===void 0?n=n.filter(e=>e.chainId!==this.chainId||e.namespace!==this.namespace):(n=n.filter(e=>e.chainId!==this.chainId||e.namespace!==this.namespace),n.push(e)),window?.localStorage.setItem(`cosmos-kit@2:core//accounts`,JSON.stringify(n)),this.session?.update()}initClient(e){throw Error(`initClient not implemented`)}async update(e={connect:!0}){this.setState(U.Pending),this.setMessage(void 0);try{e.connect&&(this.connectChains?await this.connectChains():await this?.client?.connect?.(this.chainId));let t;try{this.logger?.debug(`Fetching ${this.walletName} ${this.chainId} account.`),t=await this?.client?.getSimpleAccount(this.chainId)}catch(e){if(this.rejectMatched(e)){this.logger?.debug(`Fetching rejected.`),this.setRejected(new wn);return}if(this.client&&this?.client?.addChain)this.logger?.debug(`Going to add chain ${this.chainId}`),await this.client.addChain(this.chainRecord),t=await this.client.getSimpleAccount(this.chainId);else throw e}this.setData(t),this.setState(U.Done),this.setMessage(void 0)}catch(e){e&&this.rejectMatched(e)?this.setRejected(new wn):this.setError(new wn(e.message))}!this.isWalletRejected&&this.walletName!==`cosmiframe`&&window?.localStorage.setItem(`cosmos-kit@2:core//current-wallet`,this.walletName)}getRpcEndpoint=async e=>{let{getIsLazy:t}=await g(async()=>{let{getIsLazy:e}=await import(`./utils-14NfwrBn.js`).then(e=>e.t);return{getIsLazy:e}},__vite__mapDeps([0,1,2,3,4])),n=t(void 0,this.isLazy,this._rpcEndpoint?.isLazy,e,this.logger);if(n)return this._rpcEndpoint||this.rpcEndpoints[0]||Promise.reject(`No endpoint available.`);let{isValidEndpoint:r}=await g(async()=>{let{isValidEndpoint:e}=await import(`./utils-14NfwrBn.js`).then(e=>e.t);return{isValidEndpoint:e}},__vite__mapDeps([0,1,2,3,4]));if(this._rpcEndpoint&&await r(this._rpcEndpoint,`rpc`,n,this.logger))return this._rpcEndpoint;let{getFastestEndpoint:i}=await g(async()=>{let{getFastestEndpoint:e}=await import(`./utils-14NfwrBn.js`).then(e=>e.t);return{getFastestEndpoint:e}},__vite__mapDeps([0,1,2,3,4]));return this._rpcEndpoint=await i(this.rpcEndpoints,`rpc`,this.logger),this._rpcEndpoint};getRestEndpoint=async e=>{let{getIsLazy:t}=await g(async()=>{let{getIsLazy:e}=await import(`./utils-14NfwrBn.js`).then(e=>e.t);return{getIsLazy:e}},__vite__mapDeps([0,1,2,3,4])),n=t(void 0,this.isLazy,this._restEndpoint?.isLazy,e,this.logger);if(n)return this._restEndpoint||this.restEndpoints[0]||Promise.reject(`No endpoint available.`);let r=`rest`,{isValidEndpoint:i}=await g(async()=>{let{isValidEndpoint:e}=await import(`./utils-14NfwrBn.js`).then(e=>e.t);return{isValidEndpoint:e}},__vite__mapDeps([0,1,2,3,4]));if(this._restEndpoint&&await i(this._restEndpoint,r,n,this.logger))return this._restEndpoint;let{getFastestEndpoint:a}=await g(async()=>{let{getFastestEndpoint:e}=await import(`./utils-14NfwrBn.js`).then(e=>e.t);return{getFastestEndpoint:e}},__vite__mapDeps([0,1,2,3,4]));return this._restEndpoint=await a(this.restEndpoints,r,this.logger),this._restEndpoint};getStargateClient=async()=>{let e=await this.getRpcEndpoint(),{StargateClient:t}=await g(async()=>{let{StargateClient:e}=await import(`./build-BmJ27Vry.js`).then(e=>i(e.t()));return{StargateClient:e}},__vite__mapDeps([5,1,6,7,8,9,2,3,10,4]));return t.connect(e,this.stargateOptions)};getCosmWasmClient=async()=>{let e=await this.getRpcEndpoint(),{CosmWasmClient:t}=await g(async()=>{let{CosmWasmClient:e}=await import(`./build-DN0pJtdR.js`).then(e=>i(e.default));return{CosmWasmClient:e}},__vite__mapDeps([11,1,6,7,8,9,2,3,5,10,4]));return t.connect(e)};getNameService=async()=>{let e=await this.getCosmWasmClient(),{getNameServiceRegistryFromChainName:t}=await g(async()=>{let{getNameServiceRegistryFromChainName:e}=await import(`./utils-14NfwrBn.js`).then(e=>e.t);return{getNameServiceRegistryFromChainName:e}},__vite__mapDeps([0,1,2,3,4])),n=t(this.chainName),{NameService:r}=await g(async()=>{let{NameService:e}=await import(`./name-service-D-oY_Ca5.js`).then(e=>e.t);return{NameService:e}},__vite__mapDeps([12,1]));return new r(e,n)};async initOfflineSigner(e){if(this.client===void 0)throw Error(`WalletClient is not initialized`);e&&(this.preferredSignType=e),this.offlineSigner=await this.client.getOfflineSigner(this.chainId,this.preferredSignType)}getSigningStargateClient=async()=>{let e=await this.getRpcEndpoint();this.offlineSigner||await this.initOfflineSigner();let{SigningStargateClient:t}=await g(async()=>{let{SigningStargateClient:e}=await import(`./build-BmJ27Vry.js`).then(e=>i(e.t()));return{SigningStargateClient:e}},__vite__mapDeps([5,1,6,7,8,9,2,3,10,4]));return t.connectWithSigner(e,this.offlineSigner,this.signingStargateOptions)};getSigningCosmWasmClient=async()=>{let e=await this.getRpcEndpoint();this.offlineSigner||await this.initOfflineSigner();let{SigningCosmWasmClient:t}=await g(async()=>{let{SigningCosmWasmClient:e}=await import(`./build-DN0pJtdR.js`).then(e=>i(e.default));return{SigningCosmWasmClient:e}},__vite__mapDeps([11,1,6,7,8,9,2,3,5,10,4]));return t.connectWithSigner(e,this.offlineSigner,this.signingCosmwasmOptions)};getSigningClient=async e=>{switch(e){case`stargate`:return await this.getSigningStargateClient();case`cosmwasm`:return await this.getSigningCosmWasmClient();default:return this.getSigningStargateClient()}};estimateFee=async(e,t,n,r)=>{if(!this.address)throw Error(`Address is required to estimate fee. Try connect to fetch address.`);let a;switch(t){case`stargate`:a=this.signingStargateOptions?.gasPrice;break;case`cosmwasm`:a=this.signingCosmwasmOptions?.gasPrice;break;default:a=this.signingStargateOptions?.gasPrice;break}if(!a)throw Error(`Gas price must be set in the client options when auto gas is used.`);let o=await(await this.getSigningClient(t)).simulate(this.address,e,n),{calculateFee:s}=await g(async()=>{let{calculateFee:e}=await import(`./build-BmJ27Vry.js`).then(e=>i(e.t()));return{calculateFee:e}},__vite__mapDeps([5,1,6,7,8,9,2,3,10,4]));return s(Math.round(o*(r||1.4)),a)};sign=async(e,t,n,r)=>{if(!this.address)throw Error(`Address is required to estimate fee. Try connect to fetch address.`);let i=await this.getSigningClient(r),a;return a=t===void 0||typeof t==`number`?await this.estimateFee(e,r,n,t):t,await i.sign(this.address,e,a,n||``)};broadcast=async(e,t)=>{let n=await this.getSigningClient(t),{TxRaw:r}=await g(async()=>{let{TxRaw:e}=await import(`./tx-Cjn1Xzt5.js`).then(e=>i(e.default));return{TxRaw:e}},[]),a=r.encode(e).finish(),o,s;switch(t){case`stargate`:o=this.signingStargateOptions?.broadcastTimeoutMs,s=this.signingStargateOptions?.broadcastPollIntervalMs;break;case`cosmwasm`:o=this.signingCosmwasmOptions?.broadcastTimeoutMs,s=this.signingCosmwasmOptions?.broadcastPollIntervalMs;break;default:o=this.signingStargateOptions?.broadcastTimeoutMs,s=this.signingStargateOptions?.broadcastPollIntervalMs;break}return n.broadcastTx(a,o,s)};signAndBroadcast=async(e,t,n,r)=>{let i=await this.sign(e,t,n,r);return this.broadcast(i,r)}},Kr=i(M()),qr=class extends Wr{_chainWalletMap;preferredEndpoints;ChainWallet;constructor(e,t){super(e),this.ChainWallet=t,this.emitter=new Kr.default,this.emitter.on(`broadcast_client`,e=>{this.logger?.debug(`[Event Fired] \`broadcast_client\` (${this.walletName})`),this.chainWalletMap?.forEach(t=>{t.initClientDone(e)})}),this.emitter.on(`broadcast_env`,e=>{this.logger?.debug(`[Event Fired] \`broadcast_env\` (${this.walletName})`),this.chainWalletMap?.forEach(t=>{t.setEnv(e)})}),this.emitter.on(`sync_connect`,async e=>{this.logger?.debug(`[Event Fired] \`sync_connect\` (${this.walletName})`),await this.connectAll(!0,e),this.update()}),this.emitter.on(`sync_disconnect`,async e=>{this.logger?.debug(`[Event Fired] \`sync_disconnect\` (${this.walletName})`),await this.disconnectAll(!0,e),this.reset()}),this.emitter.on(`reset`,e=>{this.logger?.debug(`[Event Fired] \`reset\` (${this.walletName})`),e.forEach(e=>Array.from(this.chainWalletMap.values()).find(t=>t.chainId===e)?.reset())})}initingClient(){this.clientMutable.state=U.Pending,this.clientMutable.message=void 0,this.clientMutable.data=void 0,this.actions?.clientState?.(U.Pending),this.actions?.clientMessage?.(void 0),this.chainWalletMap?.forEach(e=>{e.initingClient()})}initClientDone(e){this.clientMutable.data=e,this.clientMutable.state=U.Done,this.clientMutable.message=void 0,this.actions?.clientState?.(U.Done),this.actions?.clientMessage?.(void 0),this.chainWalletMap?.forEach(t=>{t.initClientDone(e)})}initClientError(e){if(this.clientMutable.message=e?.message,this.clientMutable.state=U.Error,this.actions?.clientState?.(U.Error),this.actions?.clientMessage?.(e?.message),this.chainWalletMap?.forEach(t=>{t.initClientError(e)}),this.throwErrors===!0)throw Error(this.clientMutable.message)}onSetChainsDone(){}makeFinalEndpoints(e){let t=e.name.includes(`testnet`);return{isLazy:e.preferredEndpoints?.isLazy,rpc:[...e.preferredEndpoints?.rpc||[],...this.preferredEndpoints?.[e.name]?.rpc||[],...e.chain?.apis?.rpc?.map(e=>e.address)||[],t?`https://rpc.testcosmos.directory/${e.name}`:`https://rpc.cosmos.directory/${e.name}`],rest:[...e.preferredEndpoints?.rest||[],...this.preferredEndpoints?.[e.name]?.rest||[],...e.chain?.apis?.rest?.map(e=>e.address)||[],t?`https://rest.testcosmos.directory/${e.name}`:`https://rest.cosmos.directory/${e.name}`]}}addEnpoints(e){this.getChainWalletList(!1).forEach(t=>{t.addEndpoints(e[t.chainName])})}setChains(e,t=!0){(t||!this._chainWalletMap)&&(this._chainWalletMap=new Map),e.forEach(e=>{let t=new this.ChainWallet(this.walletInfo,{...e,preferredEndpoints:this.makeFinalEndpoints(e)});t.mainWallet=this,t.emitter=this.emitter,t.logger=this.logger,t.throwErrors=this.throwErrors,t.session=this.session,t.walletConnectOptions=this.walletConnectOptions,t.initClient=this.initClient,this._chainWalletMap.set(e.name,t)}),this.onSetChainsDone()}get chainWalletMap(){return this._chainWalletMap}getChainWallet=e=>this.chainWalletMap?.get(e);getChainWalletList=(e=!0)=>{let t=Array.from(this.chainWalletMap.values());return e?t.filter(e=>e.isActive):t};getGlobalStatusAndMessage=(e=!0)=>{let t=this.getChainWalletList(e),n=t.find(e=>e.isWalletNotExist);return n?[n.walletStatus,n.message]:(n=t.find(e=>e.isWalletConnecting),n?[Cn.Connecting,void 0]:(n=t.find(e=>e.isWalletDisconnected),n?[Cn.Disconnected,`Exist disconnected wallets`]:(n=t.find(e=>e.isError||e.isWalletRejected),n?[n.walletStatus,n.message]:[Cn.Connected,void 0])))};async update(){if(this.walletStatus===`NotExist`)return window.localStorage.removeItem(`cosmos-kit@2:core//current-wallet`);this.setData(void 0),this.setMessage(void 0),this.setState(U.Done),this.activate(),this.walletName!==`cosmiframe`&&window?.localStorage.setItem(`cosmos-kit@2:core//current-wallet`,this.walletName)}reset(){this.setData(void 0),this.setMessage(void 0),this.setState(U.Init),this.inactivate()}async connectAll(e=!0,t){let n=this.getChainWalletList(e);if(!(n.length>0&&n.every(e=>e.isModeWalletConnect&&e.connectChains)))for(let e of n)e.chainName!==t&&await e.connect()}async disconnectAll(e=!0,t,n){let r=this.getChainWalletList(e);for(let e of r)e.chainName!==t&&await e.disconnect(!1,n)}},Jr=class extends Gr{constructor(e,t){super(e,t)}},Yr=class{cosmiframe;constructor(e){this.cosmiframe=e}async getSimpleAccount(...e){return await this.cosmiframe.p.getSimpleAccount(...e)}async connect(...e){return await this.cosmiframe.p.connect(...e)}async enable(...e){await this.cosmiframe.p.enable(...e)}async suggestToken(...e){await this.cosmiframe.p.suggestToken(...e)}async addChain(...e){let t=e[0];t&&`clientOptions`in t&&(t={...t,clientOptions:{}},e[0]=t),await this.cosmiframe.p.addChain(...e)}async getAccount(...e){return await this.cosmiframe.p.getAccount(...e)}getOfflineSigner(e,t){return t===`direct`?this.getOfflineSignerDirect(e):this.getOfflineSignerAmino(e)}getOfflineSignerAmino(e){return this.cosmiframe.getOfflineSignerAmino(e)}getOfflineSignerDirect(e){return this.cosmiframe.getOfflineSignerDirect(e)}async sign(...e){return await this.cosmiframe.p.sign(...e)}async signAmino(...e){return await this.cosmiframe.p.signAmino(...e)}async signDirect(...e){return await this.cosmiframe.p.signDirect(...e)}async signArbitrary(...e){return await this.cosmiframe.p.signArbitrary(...e)}async getEnigmaPubKey(...e){return await this.cosmiframe.p.getEnigmaPubKey(...e)}async getEnigmaTxEncryptionKey(...e){return await this.cosmiframe.p.getEnigmaTxEncryptionKey(...e)}async enigmaEncrypt(...e){return await this.cosmiframe.p.enigmaEncrypt(...e)}async enigmaDecrypt(...e){return await this.cosmiframe.p.enigmaDecrypt(...e)}async sendTx(...e){return await this.cosmiframe.p.sendTx(...e)}},Xr=Object.defineProperty,Zr=(e,t,n)=>t in e?Xr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qr=(e,t)=>Xr(e,`name`,{value:t,configurable:!0}),$r=(e,t,n)=>(Zr(e,typeof t==`symbol`?t:t+``,n),n),ei=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},ti=(e,t,n)=>(ei(e,t,`read from private field`),n?n.call(e):t.get(e)),ni=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},ri=(e,t,n,r)=>(ei(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),ii=class extends Error{constructor(e){super(e),this.name=`CosmiframeTimeoutError`}};Qr(ii,`CosmiframeTimeoutError`);var ai=ii,oi=Qr((e,t,n)=>new Promise((r,i)=>{let a=null,o=In(),s=Qr(({origin:e,source:n,data:c})=>{!li(t,e)||n!==window.parent||c.id!==o||(window.removeEventListener(`message`,s),a!==null&&clearTimeout(a),c.type===`success`?r({result:c.response,origin:e}):i(Error(c.error)))},`listener`);window.addEventListener(`message`,s);try{let t={...e,id:o};window.parent.postMessage(t,`*`)}catch(e){window.removeEventListener(`message`,s),i(e)}n&&(a=setTimeout(()=>{window.removeEventListener(`message`,s),i(new ai(`Timed out after ${n}ms waiting for parent to respond.`))},n))}),`callParentMethod`),si=Qr(e=>{if(!e||e.type===`error`)return{type:`error`,error:e&&e.type===`error`&&e.error||`Handled by outer wallet.`};if(e.type===`success`)return{type:`success`,response:e.value}},`processOverrideHandler`),ci=Qr(()=>typeof window<`u`&&window.self!==window.parent,`isInIframe`),li=Qr((e,t)=>e.some(e=>e===`*`||typeof e==`string`&&t===e||e instanceof RegExp&&e.test(t)),`isOriginAllowed`),ui,di=class{constructor(e,t){$r(this,`chainId`),ni(this,ui,void 0),this.chainId=e,ri(this,ui,t)}async getAccounts(){return(await oi({method:`getAccounts`,params:[],chainId:this.chainId,signerType:`direct`},ti(this,ui))).result}async signDirect(e,t){return(await oi({method:`signDirect`,params:[e,t],chainId:this.chainId,signerType:`direct`},ti(this,ui))).result}};ui=new WeakMap,Qr(di,`CosmiframeDirectSigner`);var fi=di,pi,mi=class{constructor(e,t){$r(this,`chainId`),ni(this,pi,void 0),this.chainId=e,ri(this,pi,t)}async getAccounts(){return(await oi({method:`getAccounts`,params:[],chainId:this.chainId,signerType:`amino`},ti(this,pi))).result}async signAmino(e,t){return(await oi({method:`signAmino`,params:[e,t],chainId:this.chainId,signerType:`amino`},ti(this,pi))).result}};pi=new WeakMap,Qr(mi,`CosmiframeAminoSigner`);var hi=mi,gi,_i=class{constructor(e,t){$r(this,`chainId`),ni(this,gi,void 0),this.chainId=e,ri(this,gi,t)}async getAccounts(){try{return(await oi({method:`getAccounts`,params:[],chainId:this.chainId,signerType:`amino`},ti(this,gi))).result}catch{return(await oi({method:`getAccounts`,params:[],chainId:this.chainId,signerType:`direct`},ti(this,gi))).result}}async signDirect(e,t){return(await oi({method:`signDirect`,params:[e,t],chainId:this.chainId,signerType:`direct`},ti(this,gi))).result}async signAmino(e,t){return(await oi({method:`signAmino`,params:[e,t],chainId:this.chainId,signerType:`amino`},ti(this,gi))).result}};gi=new WeakMap,Qr(_i,`CosmiframeEitherSigner`);var vi=_i,yi;(function(e){e.IsCosmiframe=`isCosmiframe`,e.GetMetadata=`getMetadata`})(yi||={});var bi,xi=class{constructor(e){if(ni(this,bi,void 0),$r(this,`p`),!e.length)throw Error(`You must explicitly allow parent origins.`);if(e.includes(`*`))throw Error("It is very unsafe to allow all origins because a controlling app has the power to manipulate messages before they are signed. If you really want to do this, pass in `UNSAFE_ALLOW_ANY_ORIGIN`.");ri(this,bi,e.includes(`UNSAFE_ALLOW_ANY_ORIGIN`)?[`*`]:[...e]),this.p=new Proxy({getEnigmaUtils:e=>({getPubkey:()=>this.p.getEnigmaPubKey(e),decrypt:(...t)=>this.p.enigmaDecrypt(e,...t),encrypt:(...t)=>this.p.enigmaEncrypt(e,...t),getTxEncryptionKey:(...t)=>this.p.getEnigmaTxEncryptionKey(e,...t)})},{get:(e,t)=>t in e&&typeof e[t]!=`function`?e[t]:(...n)=>t in e&&typeof e[t]==`function`?e[t](...n):this.callParentMethod({method:t.toString(),params:n}).then(({result:e})=>e)})}callParentMethod(e,t){return oi(e,ti(this,bi),t)}async isReady(){if(!ci())return!1;try{let{origin:e,result:t}=await this.callParentMethod({internal:!0,method:yi.IsCosmiframe,params:[]},500);return e||t}catch(e){if(e instanceof ai)return!1;throw e}}async getMetadata(){return(await this.callParentMethod({internal:!0,method:yi.GetMetadata,params:[]},500)).result}getKeplrClient(){let e=new Proxy({version:`cosmiframe`,mode:`extension`,defaultOptions:{},getOfflineSigner:this.getOfflineSigner.bind(this),getOfflineSignerOnlyAmino:this.getOfflineSignerAmino.bind(this),getOfflineSignerAuto:e=>Promise.resolve(this.getOfflineSigner(e)),getEnigmaUtils:t=>({getPubkey:()=>e.getEnigmaPubKey(t),decrypt:(...n)=>e.enigmaDecrypt(t,...n),encrypt:(...n)=>e.enigmaEncrypt(t,...n),getTxEncryptionKey:(...n)=>e.getEnigmaTxEncryptionKey(t,...n)})},{get:(e,t)=>t in e&&typeof e[t]!=`function`?e[t]:(...n)=>t in e&&typeof e[t]==`function`?e[t](...n):this.callParentMethod({method:t.toString(),params:n}).then(({result:e})=>e)});return e}getOfflineSigner(e){return new vi(e,ti(this,bi))}getOfflineSignerAmino(e){return new hi(e,ti(this,bi))}getOfflineSignerDirect(e){return new fi(e,ti(this,bi))}static listen(e){let{iframe:t,target:n,getOfflineSignerDirect:r,getOfflineSignerAmino:i,nonSignerOverrides:a,signerOverrides:o,origins:s,metadata:c}=e,l=s?.length?s:[`*`],u={[yi.IsCosmiframe]:()=>!0,[yi.GetMetadata]:()=>c||null},d=Qr(async({source:e,origin:s,data:c})=>{if(!t.contentWindow)throw Error(`Iframe contentWindow does not exist.`);if(e!==t.contentWindow||!li(l,s)||!c||typeof c!=`object`||!(`id`in c)||!(`method`in c)||!(`params`in c))return;let{id:d,params:f,chainId:p,signType:m,internal:h}=c,{method:g,signerType:_}=c;_||=m,g=g.replace(/^signer:/,``);let v;try{if(h){if(typeof u[g]!=`function`)throw Error(`Unknown internal method: ${g}`);v={type:`success`,response:await u[g](...f)}}else if(_){if(!p)throw Error(`Missing chainId in signer message request`);let e=typeof o==`function`?await o(p):o;if(e&&g in e){let t=si(await e[g](...f));t&&(v=t)}if(!v){let e=_===`direct`?await r(p):await i(p);if(!(g in e)||typeof e[g]!=`function`)throw Error(`No ${_} signer method '${g}' for chain ID '${p}'.`);v={type:`success`,response:await e[g](...f)}}}else{let e=typeof a==`function`?await a():a;if(e&&g in e){let t=si(await e[g](...f));t&&(v=t)}if(!v){if(!(g in n)||typeof n[g]!=`function`)throw Error(`No method '${g}' on target.`);v={type:`success`,response:await n[g](...f)}}}}catch(e){v={type:`error`,error:e instanceof Error?e.message:`${e}`}}t.contentWindow?.postMessage({...v,id:d},s)},`listener`);return window.addEventListener(`message`,d),()=>window.removeEventListener(`message`,d)}};bi=new WeakMap,Qr(xi,`Cosmiframe`);var Si=xi,Ci=class extends qr{constructor(e){super(e,Jr)}get walletInfo(){return this._walletInfo}async initClient(){this.initingClient();let e=new Si(this.walletInfo.allowedParentOrigins);if(!await e.isReady()){this.initClientError(Error(`Failed to detect Cosmiframe parent of allowed origin wrapping this app in an iframe.`));return}let t=await e.getMetadata();t?.name&&typeof t.name==`string`&&(this.walletInfo.prettyName=t.name),t?.imageUrl&&typeof t.imageUrl==`string`&&(this.walletInfo.logo=t.imageUrl),this.initClientDone(new Yr(e))}},wi={name:Vr,prettyName:`Cosmiframe`,logo:`data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGgKICAgIGZpbGw9IiM5MzkzOTMiCiAgICBkPSJNOC4xNCAxMC45NmMtLjA5LjMzLS4xNC42OC0uMTQgMS4wNCAwIDEuMS40NSAyLjEgMS4xNyAyLjgzbC0xLjQyIDEuNDJDNi42NyAxNS4xNiA2IDEzLjY2IDYgMTJjMC0uOTMuMjEtMS44LjU4LTIuNTlMNS4xMSA3Ljk0QzQuNCA5LjEzIDQgMTAuNTIgNCAxMmMwIDIuMjEuOSA0LjIxIDIuMzUgNS42NWwtMS40MiAxLjQyQzMuMTIgMTcuMjYgMiAxNC43NiAyIDEyYzAtMi4wNC42MS0zLjkzIDEuNjYtNS41MUwxLjM5IDQuMjIgMi44IDIuODFsMTguMzggMTguMzgtMS40MSAxLjQxTDguMTQgMTAuOTZ6bTkuMjggMy42M2MuMzctLjc5LjU4LTEuNjYuNTgtMi41OSAwLTEuNjYtLjY3LTMuMTYtMS43Ni00LjI0bC0xLjQyIDEuNDJDMTUuNTUgOS45IDE2IDEwLjkgMTYgMTJjMCAuMzYtLjA1LjcxLS4xNCAxLjA0bDEuNTYgMS41NXpNMjAgMTJjMCAxLjQ4LS40IDIuODctMS4xMSA0LjA2bDEuNDUgMS40NUMyMS4zOSAxNS45MyAyMiAxNC4wNCAyMiAxMmMwLTIuNzYtMS4xMi01LjI2LTIuOTMtNy4wN2wtMS40MiAxLjQyQzE5LjEgNy43OSAyMCA5Ljc5IDIwIDEyeiI+PC9wYXRoPgo8L3N2Zz4=`,mode:`extension`,mobileDisabled:!1,rejectMessage:{source:`Request rejected`},connectEventNamesOnWindow:[Hr],allowedParentOrigins:[]},Ti=e=>new Ci({...wi,allowedParentOrigins:e}),Ei=i(a(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.bowser=r():n.bowser=r()})(e,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,`__esModule`,{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t||4&t&&typeof e==`object`&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,`default`,{enumerable:!0,value:e}),2&t&&typeof e!=`string`)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=90)}({17:function(e,t,n){t.__esModule=!0,t.default=void 0;var r=n(18);t.default=function(){function e(){}return e.getFirstMatch=function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||``},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||``},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case`NT`:return`NT`;case`XP`:return`XP`;case`NT 5.0`:return`2000`;case`NT 5.1`:return`XP`;case`NT 5.2`:return`2003`;case`NT 6.0`:return`Vista`;case`NT 6.1`:return`7`;case`NT 6.2`:return`8`;case`NT 6.3`:return`8.1`;case`NT 10.0`:return`10`;default:return}},e.getMacOSVersionName=function(e){var t=e.split(`.`).splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),t[0]===10)switch(t[1]){case 5:return`Leopard`;case 6:return`Snow Leopard`;case 7:return`Lion`;case 8:return`Mountain Lion`;case 9:return`Mavericks`;case 10:return`Yosemite`;case 11:return`El Capitan`;case 12:return`Sierra`;case 13:return`High Sierra`;case 14:return`Mojave`;case 15:return`Catalina`;default:return}},e.getAndroidVersionName=function(e){var t=e.split(`.`).splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(t[0]===1&&t[1]<5))return t[0]===1&&t[1]<6?`Cupcake`:t[0]===1&&t[1]>=6?`Donut`:t[0]===2&&t[1]<2?`Eclair`:t[0]===2&&t[1]===2?`Froyo`:t[0]===2&&t[1]>2?`Gingerbread`:t[0]===3?`Honeycomb`:t[0]===4&&t[1]<1?`Ice Cream Sandwich`:t[0]===4&&t[1]<4?`Jelly Bean`:t[0]===4&&t[1]>=4?`KitKat`:t[0]===5?`Lollipop`:t[0]===6?`Marshmallow`:t[0]===7?`Nougat`:t[0]===8?`Oreo`:t[0]===9?`Pie`:void 0},e.getVersionPrecision=function(e){return e.split(`.`).length},e.compareVersions=function(t,n,r){r===void 0&&(r=!1);var i=e.getVersionPrecision(t),a=e.getVersionPrecision(n),o=Math.max(i,a),s=0,c=e.map([t,n],(function(t){var n=o-e.getVersionPrecision(t),r=t+Array(n+1).join(`.0`);return e.map(r.split(`.`),(function(e){return Array(20-e.length).join(`0`)+e})).reverse()}));for(r&&(s=o-Math.min(i,a)),--o;o>=s;){if(c[0][o]>c[1][o])return 1;if(c[0][o]===c[1][o]){if(o===s)return 0;--o}else if(c[0][o]<c[1][o])return-1}},e.map=function(e,t){var n,r=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)r.push(t(e[n]));return r},e.find=function(e,t){var n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){var i=e[n];if(t(i,n))return i}},e.assign=function(e){for(var t,n,r=e,i=arguments.length,a=Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];if(Object.assign)return Object.assign.apply(Object,[e].concat(a));var s=function(){var e=a[t];typeof e==`object`&&e&&Object.keys(e).forEach((function(t){r[t]=e[t]}))};for(t=0,n=a.length;t<n;t+=1)s();return e},e.getBrowserAlias=function(e){return r.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return r.BROWSER_MAP[e]||``},e}(),e.exports=t.default},18:function(e,t,n){t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":`amazon_silk`,"Android Browser":`android`,Bada:`bada`,BlackBerry:`blackberry`,Chrome:`chrome`,Chromium:`chromium`,Electron:`electron`,Epiphany:`epiphany`,Firefox:`firefox`,Focus:`focus`,Generic:`generic`,"Google Search":`google_search`,Googlebot:`googlebot`,"Internet Explorer":`ie`,"K-Meleon":`k_meleon`,Maxthon:`maxthon`,"Microsoft Edge":`edge`,"MZ Browser":`mz`,"NAVER Whale Browser":`naver`,Opera:`opera`,"Opera Coast":`opera_coast`,PhantomJS:`phantomjs`,Puffin:`puffin`,QupZilla:`qupzilla`,QQ:`qq`,QQLite:`qqlite`,Safari:`safari`,Sailfish:`sailfish`,"Samsung Internet for Android":`samsung_internet`,SeaMonkey:`seamonkey`,Sleipnir:`sleipnir`,Swing:`swing`,Tizen:`tizen`,"UC Browser":`uc`,Vivaldi:`vivaldi`,"WebOS Browser":`webos`,WeChat:`wechat`,"Yandex Browser":`yandex`,Roku:`roku`},t.BROWSER_MAP={amazon_silk:`Amazon Silk`,android:`Android Browser`,bada:`Bada`,blackberry:`BlackBerry`,chrome:`Chrome`,chromium:`Chromium`,electron:`Electron`,epiphany:`Epiphany`,firefox:`Firefox`,focus:`Focus`,generic:`Generic`,googlebot:`Googlebot`,google_search:`Google Search`,ie:`Internet Explorer`,k_meleon:`K-Meleon`,maxthon:`Maxthon`,edge:`Microsoft Edge`,mz:`MZ Browser`,naver:`NAVER Whale Browser`,opera:`Opera`,opera_coast:`Opera Coast`,phantomjs:`PhantomJS`,puffin:`Puffin`,qupzilla:`QupZilla`,qq:`QQ Browser`,qqlite:`QQ Browser Lite`,safari:`Safari`,sailfish:`Sailfish`,samsung_internet:`Samsung Internet for Android`,seamonkey:`SeaMonkey`,sleipnir:`Sleipnir`,swing:`Swing`,tizen:`Tizen`,uc:`UC Browser`,vivaldi:`Vivaldi`,webos:`WebOS Browser`,wechat:`WeChat`,yandex:`Yandex Browser`},t.PLATFORMS_MAP={tablet:`tablet`,mobile:`mobile`,desktop:`desktop`,tv:`tv`},t.OS_MAP={WindowsPhone:`Windows Phone`,Windows:`Windows`,MacOS:`macOS`,iOS:`iOS`,Android:`Android`,WebOS:`WebOS`,BlackBerry:`BlackBerry`,Bada:`Bada`,Tizen:`Tizen`,Linux:`Linux`,ChromeOS:`Chrome OS`,PlayStation4:`PlayStation 4`,Roku:`Roku`},t.ENGINE_MAP={EdgeHTML:`EdgeHTML`,Blink:`Blink`,Trident:`Trident`,Presto:`Presto`,Gecko:`Gecko`,WebKit:`WebKit`}},90:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(91))&&r.__esModule?r:{default:r},a=n(18);function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}t.default=function(){function e(){}var t,n,r;return e.getParser=function(e,t){if(t===void 0&&(t=!1),typeof e!=`string`)throw Error(`UserAgent should be a string`);return new i.default(e,t)},e.parse=function(e){return new i.default(e).getResult()},t=e,r=[{key:`BROWSER_MAP`,get:function(){return a.BROWSER_MAP}},{key:`ENGINE_MAP`,get:function(){return a.ENGINE_MAP}},{key:`OS_MAP`,get:function(){return a.OS_MAP}},{key:`PLATFORMS_MAP`,get:function(){return a.PLATFORMS_MAP}}],(n=null)&&o(t.prototype,n),r&&o(t,r),e}(),e.exports=t.default},91:function(e,t,n){t.__esModule=!0,t.default=void 0;var r=c(n(92)),i=c(n(93)),a=c(n(94)),o=c(n(95)),s=c(n(17));function c(e){return e&&e.__esModule?e:{default:e}}t.default=function(){function e(e,t){if(t===void 0&&(t=!1),e==null||e===``)throw Error(`UserAgent parameter can't be empty`);this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=s.default.find(r.default,(function(t){if(typeof t.test==`function`)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw Error(`Browser's test function is not valid`)}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||``:this.getBrowser().name||``},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=s.default.find(i.default,(function(t){if(typeof t.test==`function`)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw Error(`Browser's test function is not valid`)}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||``:t||``},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){e===void 0&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||``:t||``},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=s.default.find(a.default,(function(t){if(typeof t.test==`function`)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw Error(`Browser's test function is not valid`)}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||``:this.getEngine().name||``},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=s.default.find(o.default,(function(t){if(typeof t.test==`function`)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw Error(`Browser's test function is not valid`)}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return s.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,n={},r=0,i={},a=0;if(Object.keys(e).forEach((function(t){var o=e[t];typeof o==`string`?(i[t]=o,a+=1):typeof o==`object`&&(n[t]=o,r+=1)})),r>0){var o=Object.keys(n),c=s.default.find(o,(function(e){return t.isOS(e)}));if(c){var l=this.satisfies(n[c]);if(l!==void 0)return l}var u=s.default.find(o,(function(e){return t.isPlatform(e)}));if(u){var d=this.satisfies(n[u]);if(d!==void 0)return d}}if(a>0){var f=Object.keys(i),p=s.default.find(f,(function(e){return t.isBrowser(e,!0)}));if(p!==void 0)return this.compareVersion(i[p])}},t.isBrowser=function(e,t){t===void 0&&(t=!1);var n=this.getBrowserName().toLowerCase(),r=e.toLowerCase(),i=s.default.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n},t.compareVersion=function(e){var t=[0],n=e,r=!1,i=this.getBrowserVersion();if(typeof i==`string`)return e[0]===`>`||e[0]===`<`?(n=e.substr(1),e[1]===`=`?(r=!0,n=e.substr(2)):t=[],e[0]===`>`?t.push(1):t.push(-1)):e[0]===`=`?n=e.substr(1):e[0]===`~`&&(r=!0,n=e.substr(1)),t.indexOf(s.default.compareVersions(i,n,r))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return t===void 0&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return e===void 0&&(e=[]),e.some((function(e){return t.is(e)}))},e}(),e.exports=t.default},92:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=/version\/(\d+(\.?_?\d+)+)/i;t.default=[{test:[/googlebot/i],describe:function(e){var t={name:`Googlebot`},n=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:`Opera`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:`Opera`},n=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:`Samsung Internet for Android`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:`NAVER Whale Browser`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:`MZ Browser`},n=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:`Focus`},n=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:`Swing`},n=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:`Opera Coast`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:`Opera Touch`},n=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:`Yandex Browser`},n=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:`UC Browser`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:`Maxthon`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:`Epiphany`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:`Puffin`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:`Sleipnir`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:`K-Meleon`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:`WeChat`},n=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?`QQ Browser Lite`:`QQ Browser`},n=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:`Internet Explorer`},n=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:`Microsoft Edge`},n=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:`Microsoft Edge`},n=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:`Vivaldi`},n=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:`SeaMonkey`},n=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:`Sailfish`},n=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:`Amazon Silk`},n=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:`PhantomJS`},n=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:`SlimerJS`},n=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:`BlackBerry`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:`WebOS Browser`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:`Bada`},n=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:`Tizen`},n=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:`QupZilla`},n=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:`Firefox`},n=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:`Electron`},n=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:`Miui`},n=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:`Chromium`},n=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:`Chrome`},n=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:`Google Search`},n=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:`Android Browser`},n=i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:`PlayStation 4`},n=i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:`Safari`},n=i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=e.search(`\\(`)===-1?/^(.*)\/(.*) /:/^(.*)\/(.*)[ \t]\((.*)/;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}],e.exports=t.default},93:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=n(18);t.default=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:a.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=i.default.getWindowsVersionName(t);return{name:a.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:a.OS_MAP.iOS},n=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,`.`),n=i.default.getMacOSVersionName(t),r={name:a.OS_MAP.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,`.`);return{name:a.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=i.default.getAndroidVersionName(t),r={name:a.OS_MAP.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:a.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:a.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:a.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:a.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.PlayStation4,version:t}}}],e.exports=t.default},94:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=n(18);t.default=[{test:[/googlebot/i],describe:function(){return{type:`bot`,vendor:`Google`}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&`Nova`,n={type:a.PLATFORMS_MAP.mobile,vendor:`Huawei`};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:`Nexus`}}},{test:[/ipad/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:`Apple`,model:`iPad`}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:`Apple`,model:`iPad`}}},{test:[/kftt build/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:`Amazon`,model:`Kindle Fire HD 7`}}},{test:[/silk/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:`Amazon`}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:a.PLATFORMS_MAP.mobile,vendor:`Apple`,model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:`Nexus`}}},{test:[/[^-]mobi/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return e.getBrowserName(!0)===`blackberry`},describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:`BlackBerry`}}},{test:function(e){return e.getBrowserName(!0)===`bada`},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return e.getBrowserName()===`windows phone`},describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:`Microsoft`}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(`.`)[0]);return e.getOSName(!0)===`android`&&t>=3},describe:function(){return{type:a.PLATFORMS_MAP.tablet}}},{test:function(e){return e.getOSName(!0)===`android`},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return e.getOSName(!0)===`macos`},describe:function(){return{type:a.PLATFORMS_MAP.desktop,vendor:`Apple`}}},{test:function(e){return e.getOSName(!0)===`windows`},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return e.getOSName(!0)===`linux`},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return e.getOSName(!0)===`playstation 4`},describe:function(){return{type:a.PLATFORMS_MAP.tv}}},{test:function(e){return e.getOSName(!0)===`roku`},describe:function(){return{type:a.PLATFORMS_MAP.tv}}}],e.exports=t.default},95:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=n(18);t.default=[{test:function(e){return e.getBrowserName(!0)===`microsoft edge`},describe:function(e){if(/\sedg\//i.test(e))return{name:a.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:a.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:a.ENGINE_MAP.Trident},n=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:a.ENGINE_MAP.Presto},n=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:a.ENGINE_MAP.Gecko},n=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:a.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:a.ENGINE_MAP.WebKit},n=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}],e.exports=t.default}})}))}))());_();var Di=T(),Oi=(e,t)=>{let n=[];for(let t of e)n.push(`${t.port_id}/${t.channel_id}`);let r=`${n.join(`/`)}/${t}`;return`ibc/`+y.from(new Uint8Array(new Di.sha256().update(y.from(r)).digest())).toString(`hex`).toUpperCase()},ki=(e,t,n)=>e.find(e=>e.chain_1.chain_name===n&&e.chain_2.chain_name===t),Ai=(e,t,n)=>ki(e,t,n)||ki(e,n,t),ji=e=>e.channels.find(e=>e.chain_1.port_id===`transfer`&&e.chain_2.port_id===`transfer`),Mi=e=>e.channels.find(e=>e.chain_1.port_id.startsWith(`wasm.`)&&e.chain_2.port_id===`transfer`||e.chain_1.port_id===`transfer`&&e.chain_2.port_id.startsWith(`wasm`)),Ni=(e,t,n,r,i)=>{let a=Ai(e,t,n);if(!a)return[];let o=i.startsWith(`cw20:`)?Mi(a):ji(a);if(!o)return[];let s;s=a.chain_1.chain_name===t?o.chain_1:o.chain_2;let c=[s],l=r.find(({chain_name:e})=>e===n);if(!l)return c;let u=l.assets.find(e=>e.base===i);if(!u)return c;let d=u.traces?.filter?.(e=>e.type===`ibc`||e.type===`ibc-cw20`)??[];if(!d.length)return c;d.length;let[f]=d;return[...c,...Ni(e,n,f.counterparty.chain_name,r,f.counterparty.base_denom)]},Pi=(e,t,n,r,i)=>{let a=Ai(e,t,n);if(a){if(!(i.startsWith(`cw20:`)?Mi(a):ji(a)))return;let o=Ni(e,t,n,r,i),s=r.find(({chain_name:e})=>e===n);if(!s)return Oi(o,i);let c=s.assets.find(e=>e.base===i);return c?Oi(o,(c.traces?.find?.(e=>e.type===`ibc`))?.counterparty?.base_denom??c.base):Oi(o,i)}},Fi=(e,t,n)=>{let r=t.filter(t=>t.chain_1.chain_name===e||t.chain_2.chain_name===e).map(r=>{let i=r.chain_1.chain_name===e?`chain_2`:`chain_1`,a=r.chain_1.chain_name===e?`chain_1`:`chain_2`,o=r[i].chain_name,s=r[i],c=r[a],l=n.find(e=>e.chain_name===o);if(!l)return;let u={...l,assets:l.assets.filter(e=>!(l.chain_name===`carbon`&&e.base.startsWith(`ibc/`)))}.assets.filter(e=>!e.base.startsWith(`cw20:`)).map(r=>{let i=Pi(t,e,o,n,r.base),a={...r};return a.base=i,a.denom_units=a.denom_units.map(e=>{if(e.denom===r.base){let t={...e};return t.denom=i,t.aliases=[e.denom],t}return e}),a}),d=ji(r);if(d)return{chain:{...c,...d[a]},counterparty:{...s,...d[i]},assets:u}}).filter(Boolean).reduce((e,t)=>{e[t.chain.chain_name]=e[t.chain.chain_name]||[];let n=t.assets.map(e=>{try{return{...e,traces:[{type:`ibc`,counterparty:{channel_id:t.counterparty.channel_id,base_denom:e.denom_units[0]?.aliases?.[0]??e.denom_units[0].denom,chain_name:t.counterparty.chain_name},chain:{channel_id:t.chain.channel_id}}]}}catch{}}).filter(Boolean),r={...t,assets:n};return e[t.chain.chain_name].push(r),e},{});return Object.keys(r).map(e=>({chain_name:e,assets:r[e].reduce((e,t)=>[...e,...t.assets],[])}))},Ii=(e,t,n)=>{let r=t.filter(t=>t.chain_1.chain_name===e||t.chain_2.chain_name===e).map(r=>{let i=r.chain_1.chain_name===e?`chain_2`:`chain_1`,a=r.chain_1.chain_name===e?`chain_1`:`chain_2`,o=r[i].chain_name,s=r[i],c=r[a],l=n.find(e=>e.chain_name===o);if(!l)return;let u=l.assets.filter(e=>e.base.startsWith(`cw20:`)).map(r=>{let i=Pi(t,e,o,n,r.base),a={...r};return a.base=i,a.denom_units=a.denom_units.map(e=>{if(e.denom===r.base){let t={...e};return t.denom=i,t.aliases=[e.denom],t}return e}),a});if(!u.length)return;let d=Mi(r);if(d)return{chain:{...c,...d[a]},counterparty:{...s,...d[i]},assets:u}}).filter(Boolean).reduce((e,t)=>{let n=t;e[n.chain.chain_name]=e[n.chain.chain_name]||[];let r=n.assets.map(e=>{try{return{...e,traces:[{type:`ibc-cw20`,counterparty:{port:t.counterparty.port_id,channel_id:t.counterparty.channel_id,base_denom:e.denom_units[0]?.aliases?.[0]??e.denom_units[0].denom,chain_name:t.counterparty.chain_name},chain:{port:t.chain.port_id,channel_id:t.chain.channel_id}}]}}catch{}}).filter(Boolean),i={...t,assets:r};return e[t.chain.chain_name].push(i),e},{});return Object.keys(r).map(e=>({chain_name:e,assets:r[e].reduce((e,t)=>[...e,...t.assets],[])}))},Li=(e,t,n)=>{let r=Fi(e,t,n),i=Ii(e,t,n);return r.reduce((e,t)=>{let n=t.chain_name,r=[...t.assets],a=i.find(e=>e.chain_name===n);return a&&[].push.apply(r,a.assets),[{chain_name:n,assets:r},...e]},[])},Ri=class{chainName;fetcher;_chain;_assetList;_assetLists;_ibcData=[];constructor(e){this.chainName=e.chainName,this.fetcher=e.fetcher,this.refresh()}refresh(){this._assetList=this.fetcher.getChainAssetList(this.chainName),this._ibcData=this.fetcher.getChainIbcData(this.chainName),this._chain=this.fetcher.getChain(this.chainName);let e=this._ibcData.reduce((e,t)=>(e.includes(t.chain_1.chain_name)||e.push(t.chain_1.chain_name),e.includes(t.chain_2.chain_name)||e.push(t.chain_2.chain_name),e),[]);this._assetLists=this.fetcher.assetLists.filter(t=>e.includes(t.chain_name))}get chain(){return this._chain}get nativeAssetList(){return this._assetList}get assetLists(){return Li(this.chainName,this._ibcData,this._assetLists)}};s();function zi(e){e===``&&(e=`.`);var t=e.charAt(0)===`/`;e=Hi(e);for(var n=e.split(`/`),r=[],i=0;i<n.length;i++){var a=n[i];a!==`.`&&(a===`..`&&(t||!t&&r.length>0&&r[0]!==`..`)?r.pop():r.push(a))}if(!t&&r.length<2)switch(r.length){case 1:r[0]===``&&r.unshift(`.`);break;default:r.push(`.`)}return e=r.join(`/`),t&&e.charAt(0)!==`/`&&(e=`/`+e),e}function Bi(e,t=``){if(e===``)return e;e=zi(e);var n=e.split(`/`),r=n[n.length-1];return r===``&&n.length>1?n[n.length-2]:t.length>0&&r.substr(r.length-t.length)===t?r.substr(0,r.length-t.length):r}var Vi=RegExp(`//+`,`g`);function Hi(e){return e=e.replace(Vi,`/`),e}var Ui=i(fe()),Wi=e=>(0,Ui.default)(e).then(e=>{if(e.status>=400)throw Error(`Bad response`);return e.json()}),Gi=class{urls=[];_assetLists=[];_chains=[];_ibcData=[];chainInfoList=[];constructor(e={}){e.chains&&(this._chains=e.chains),e.assetLists&&(this._assetLists=e.assetLists),e.ibcData&&(this._ibcData=e.ibcData),e.urls&&(this.urls=e.urls)}get chains(){return this._chains}get assetLists(){return this._assetLists}get ibcData(){return this._ibcData}getChain(e){return this._chains.find(t=>t.chain_name===e)}getChainAssetList(e){return this._assetLists.find(t=>t.chain_name===e)}getGeneratedAssetLists(e){return Li(e,this._ibcData,this._assetLists)}getChainIbcData(e){return this._ibcData.filter(t=>t.chain_1.chain_name===e||t.chain_2.chain_name===e)}getChainInfo(e){let t=this.chainInfoList.find(t=>t.chainName===e);return t||(t=new Ri({chainName:e,fetcher:this}),this.chainInfoList.push(t)),t}upsertChain(e){if(!this._chains.find(t=>t.chain_name===e.chain_name&&t.network_type===e.network_type)){this._chains.push(e);return}this._chains=this._chains.map(t=>t.chain_name===e.chain_name&&t.network_type===e.network_type?e:t)}updateAssetList(e){if(!this._assetLists.find(t=>t.chain_name===e.chain_name)){this._assetLists.push(e);return}this._assetLists=this._assetLists.map(t=>t.chain_name===e.chain_name?e:t)}upsertIbcData(e){if(!this._ibcData.find(t=>t.chain_1.chain_name===e.chain_1.chain_name&&t.chain_2.chain_name===e.chain_2.chain_name)){this._ibcData.push(e);return}this._ibcData=this._ibcData.map(t=>t.chain_1.chain_name===e.chain_1.chain_name&&t.chain_2.chain_name===e.chain_2.chain_name?e:t)}update(e){if(!e.$schema)throw Error(`not a registered JSON schema type`);switch(Bi(e.$schema,`.schema.json`)){case`chain`:this.upsertChain(e);break;case`assetlist`:this.updateAssetList(e);break;case`ibc_data`:this.upsertIbcData(e);break;default:throw Error(`unknown schema type`)}this.chainInfoList.forEach(e=>{e.refresh()})}async fetch(e){let t=await Wi(e);this.update(t)}async fetchUrls(){return Promise.all(this.urls.map(e=>this.fetch(e)))}},Ki=class extends Ur{isActive=!1;chainRecord;_wallets;namespace=`cosmos`;session;repelWallet=!0;callbackOptions;fetchInfo=!1;constructor(e,t=[]){if(super(),this.chainRecord=e,this._wallets=t,this.repelWallet&&this.wallets.forEach(e=>{e.updateCallbacks({...e.callbacks,beforeConnect:async()=>{this.wallets.forEach(async t=>{!t.isWalletDisconnected&&t!==e&&await t.disconnect(!1,this.callbackOptions?.beforeConnect?.disconnect)})}})}),!this.chainRecord.chain){this.fetchInfo=!0;let t=new Gi({urls:[`https://raw.githubusercontent.com/cosmos/chain-registry/master/${e.name}/chain.json`]});t.fetchUrls().then(()=>{this.chainRecord.chain=t.getChain(e.name),this.actions?.render?.(e=>e+1)}).catch(t=>{this.chainRecord.chain=null,this.logger?.warn(`Failed to fetch chain info for chain ${e.name}: [${t.name}] ${t.message}`)})}if(!this.chainRecord.assetList){this.fetchInfo=!0;let t=new Gi({urls:[`https://raw.githubusercontent.com/cosmos/chain-registry/master/${e.name}/assetlist.json`]});t.fetchUrls().then(()=>{this.chainRecord.assetList=t.getChainAssetList(e.name)}).catch(t=>{this.chainRecord.assetList=null,this.logger?.warn(`Failed to fetch assetList info for chain ${e.name}: [${t.name}] ${t.message}`)})}this.fetchInfo&&this._wallets.forEach(e=>e.chainRecord=this.chainRecord)}setCallbackOptions(e){this.callbackOptions=e}setEnv(e){this._env=e,this.wallets.forEach(t=>t.setEnv(e))}activate(){this.isActive=!0,this.wallets.forEach(e=>e.activate())}get chainName(){return this.chainRecord.name}get chainLogo(){return this.chainRecord.assetList?.assets[0]?.logo_URIs?.svg||this.chainRecord.assetList?.assets[0]?.logo_URIs?.png||void 0}get wallets(){return this._wallets}get platformEnabledWallets(){return this.isMobile?this._wallets.filter(e=>typeof e.walletInfo.mobileDisabled==`boolean`?!e.walletInfo.mobileDisabled:!e.walletInfo.mobileDisabled()):this._wallets}get isSingleWallet(){return this.wallets.length===1}get current(){if(!this.repelWallet){this.logger.warn("when `repelWallet` is set false, `current` is always undefined.");return}return this.wallets.find(e=>!e.isWalletNotExist&&!e.isWalletDisconnected)}getWallet=e=>this.wallets.find(t=>t.walletName===e);openView=()=>{this.actions?.viewWalletRepo?.(this),this.actions?.viewOpen?.(!0)};closeView=()=>{this.actions?.viewOpen?.(!1)};connect=async(e,t=!0)=>{e?await this.getWallet(e)?.connect(t):this.openView()};disconnect=async(e,t=!0,n)=>{e?await this.getWallet(e)?.disconnect(t,n):await this.current.disconnect(t,n)};getRpcEndpoint=async e=>{for(let t of this.wallets)try{return await t.getRpcEndpoint(e)}catch(e){this.logger?.debug(`${e.name}: ${e.message}`)}return Promise.reject(`No valid RPC endpoint for chain ${this.chainName}!`)};getRestEndpoint=async e=>{for(let t of this.wallets)try{return await t.getRestEndpoint(e)}catch(e){this.logger?.debug(`${e.name}: ${e.message}`)}return Promise.reject(`No valid REST endpoint for chain ${this.chainName}!`)};getStargateClient=async()=>{for(let e of this.wallets)try{return await e.getStargateClient()}catch(e){this.logger?.debug(`${e.name}: ${e.message}`)}return Promise.reject(`Something wrong! Probably no valid RPC endpoint for chain ${this.chainName}.`)};getCosmWasmClient=async()=>{for(let e of this.wallets)try{return await e.getCosmWasmClient()}catch(e){this.logger?.debug(`${e.name}: ${e.message}`)}return Promise.reject(`Something wrong! Probably no valid RPC endpoint for chain ${this.chainName}.`)};getNameService=async()=>{for(let e of this.wallets)try{return await e.getNameService()}catch(e){this.logger?.debug(`${e.name}: ${e.message}`)}return Promise.reject(`Something wrong! Probably no valid RPC endpoint or name service is not registered for chain ${this.chainName}.`)}},qi=class extends Ur{chainRecords=[];walletRepos=[];defaultNameService=`icns`;mainWallets=[];coreEmitter;walletConnectOptions;session;repelWallet=!0;isLazy;throwErrors;subscribeConnectEvents;cosmiframeEnabled;_reconnectMap={};constructor(e,t,n,r,i=!0,a=[/^https?:\/\/localhost(:\d+)?/,/^https:\/\/(.+\.)?osmosis\.zone/,/^https:\/\/(.+\.)?daodao\.zone/,/^https:\/\/.+-da0da0\.vercel\.app/,/^https:\/\/(.+\.)?abstract\.money/],o,s,c,l,u,d){super(),this.throwErrors=r,this.subscribeConnectEvents=i,this.coreEmitter=new Kr.default,this.logger=n,s&&(this.defaultNameService=s),this.session=new kn({duration:18e5,callback:()=>{this.mainWallets.forEach(e=>e.disconnectAll(!1)),window?.localStorage.removeItem(`cosmos-kit@2:core//accounts`),window?.localStorage.removeItem(`cosmos-kit@2:core//current-wallet`)},...d}),this.walletConnectOptions=c,this.cosmiframeEnabled=ci()&&!!a?.length,t=[...this.cosmiframeEnabled?[Ti(a)]:[],...t],t.forEach(({walletName:e})=>this._reconnectMap[e]=()=>this._reconnect(e,!0)),this.init(e,o,t,c,l,u)}init(e,t,n,r,i,a){this.logger.info(`${e.length} chains and ${n.length} wallets are provided!`),this.isLazy=a?.isLazy,this.chainRecords=e.map(e=>{let n=typeof e==`string`?e:e.chain_name;return En(e,t,i,a?.endpoints?.[n],this.isLazy,this.logger)}),this.mainWallets=n.map(e=>(e.logger=this.logger,e.throwErrors=this.throwErrors,e.session=this.session,e.walletConnectOptions=this.walletConnectOptions,e?.setChains(this.chainRecords),e)),this.chainRecords.forEach((e,t)=>{let r=new Ki(e,n.map(({getChainWallet:t})=>t(e.name)));r.logger=this.logger,r.repelWallet=this.repelWallet,r.session=this.session,this.walletRepos.push(r),r.fetchInfo&&(this.chainRecords[t]=r.chainRecord)}),this.checkEndpoints(a?.endpoints)}checkEndpoints(e){Object.keys(e||{}).map(e=>{this.chainRecords.findIndex(t=>t.name===e)===-1&&this.logger?.warn(`You are providing endpointOptions with unrecognized chain NAME ${e} (NOT found such chain in ChainProvider property "chains")`)})}setWalletRepel(e){this.repelWallet=e,this.walletRepos.forEach(t=>t.repelWallet=e),window?.localStorage.setItem(`cosmos-kit@2:core//repel-wallet`,e.toString())}addEndpoints=e=>{this.mainWallets.forEach(t=>{t.addEnpoints(e)})};addChains=(e,t,n,r)=>{let i=e.map(e=>{let i=typeof e==`string`?e:e.chain_name;return En(e,t,n,r?.[i],this.isLazy,this.logger)});i.forEach(e=>{let t=this.chainRecords.findIndex(t=>t.name===e.name);t==-1?this.chainRecords.push(e):this.chainRecords[t]=e}),this.checkEndpoints(r),this.mainWallets.forEach(e=>{e.setChains(i,!1)}),i.forEach((e,t)=>{let n=new Ki(e,this.mainWallets.map(({getChainWallet:t})=>t(e.name)));n.setActions({viewOpen:this.actions?.viewOpen,viewWalletRepo:this.actions?.viewWalletRepo}),n.wallets.forEach(e=>{e.setActions({data:this.actions?.data,state:this.actions?.state,message:this.actions?.message})}),n.logger=this.logger,n.repelWallet=this.repelWallet,n.session=this.session,n.fetchInfo&&(this.chainRecords[t]=n.chainRecord);let r=this.walletRepos.findIndex(e=>e.chainName===n.chainName);r==-1?this.walletRepos.push(n):this.walletRepos[r]=n})};on=(e,t)=>{this.coreEmitter.on(e,t)};off=(e,t)=>{this.coreEmitter.off(e,t)};get activeRepos(){return this.walletRepos.filter(e=>e.isActive===!0)}getMainWallet=e=>{let t=this.mainWallets.find(t=>t.walletName===e);if(!t)throw new Tn(e);return t};getWalletRepo=e=>{let t=this.walletRepos.find(t=>t.chainName===e);if(!t)throw Error(`Chain ${e} is not provided.`);return t};getChainWallet=(e,t)=>{let n=this.getMainWallet(t).getChainWallet(e);if(!n)throw Error(`${e} is not provided!`);return n};getChainRecord=e=>{let t=this.chainRecords.find(t=>t.name===e);if(!t)throw Error(`${e} is not provided!`);return t};getChainLogo=e=>{let t=this.getChainRecord(e);return t?.assetList?.assets[0]?.logo_URIs?.svg||t?.assetList?.assets[0]?.logo_URIs?.png||void 0};getNameService=async e=>{let t;if(e)t=e;else{if(!this.defaultNameService)throw Error(`defaultNameService is undefined`);let{getNameServiceRegistryFromName:e}=await g(async()=>{let{getNameServiceRegistryFromName:e}=await import(`./utils-14NfwrBn.js`).then(e=>e.t);return{getNameServiceRegistryFromName:e}},__vite__mapDeps([0,1,2,3,4])),n=e(this.defaultNameService);if(!n)throw Error(`Unknown defaultNameService `+this.defaultNameService);t=n.chainName}return await this.getWalletRepo(t).getNameService()};_reconnect=async(e,t=!1,n)=>{t&&this.getMainWallet(e)?.isWalletDisconnected||(this.logger?.debug("[Event Emit] `refresh_connection` (manager)"),this.coreEmitter.emit(`refresh_connection`),await this.getMainWallet(e).connect(),await Promise.all(this.getMainWallet(e).getChainWalletList(!0).map((e,t)=>n?n.includes(e.chainName)?e.connect(!1):void 0:t===0?e.connect(!0):void 0)))};_restoreAccounts=async()=>{let e=this.cosmiframeEnabled?Vr:window.localStorage.getItem(`cosmos-kit@2:core//current-wallet`);if(e)try{let t=this.getMainWallet(e);t.activate();let n;if(t.clientMutable.state===U.Done){let e=window.localStorage.getItem(`cosmos-kit@2:core//accounts`);if(e&&e!==`[]`){let r=JSON.parse(e).flatMap(e=>{let n=t.getChainWalletList(!1).find(t=>t.chainRecord.chain?.chain_id===e.chainId&&t.namespace===e.namespace);return n?.activate(),t.walletInfo.mode===`wallet-connect`&&(n?.setData(e),n?.setState(U.Done)),n||[]});t.setState(U.Done);let i=r.flatMap(e=>{try{let t=this.getWalletRepo(e.chainName);return t.activate(),t.chainRecord}catch{return[]}}),a=async()=>{try{return await t.client?.enable?.(i.map(e=>e.chain.chain_id)),!0}catch(e){if(e instanceof Error&&t.rejectMatched(e))return this.logger?.error(`Failed to connect to stored chains: ${e.message}`),!1;throw e}};try{if(!await a())return}catch{for(let e of i)await t.client?.addChain?.(e);if(!await a())return}n=i.map(e=>e.name)}}t.walletInfo.mode!==`wallet-connect`&&await this._reconnect(e,void 0,n)}catch(e){if(e instanceof Tn)this.logger?.warn(e.message);else throw e}};_handleCosmiframeKeystoreChangeEvent=e=>{typeof e.data==`object`&&`event`in e.data&&e.data.event===`cosmiframe_keystorechange`&&(window.dispatchEvent(new Event(Hr)),this._reconnect(Vr))};onMounted=async()=>{if(typeof window>`u`)return;this.cosmiframeEnabled&&window.addEventListener(`message`,this._handleCosmiframeKeystoreChangeEvent);let e=Ei.default.getParser(window.navigator.userAgent),t={browser:e.getBrowserName(!0),device:e.getPlatform().type||`desktop`,os:e.getOSName(!0)};this.setEnv(t),this.walletRepos.forEach(e=>e.setEnv(t)),await Promise.all(this.mainWallets.map(async e=>{e.setEnv(t),e.emitter?.emit(`broadcast_env`,t),this.subscribeConnectEvents&&(e.walletInfo.connectEventNamesOnWindow?.forEach(t=>{window.addEventListener(t,this._reconnectMap[e.walletName]),this.logger?.debug(`Add "${t}" event listener to window`)}),e.walletInfo.connectEventNamesOnClient?.forEach(async t=>{e.client?.on?.(t,this._reconnectMap[e.walletName]),this.logger?.debug(`Add "${t}" event listener to wallet client ${e.walletPrettyName}`)})),e.walletInfo.mode===`wallet-connect`?await e.initClient(this.walletConnectOptions):await e.initClient()})),await this._restoreAccounts()};onUnmounted=()=>{typeof window>`u`||(this.cosmiframeEnabled&&window.removeEventListener(`message`,this._handleCosmiframeKeystoreChangeEvent),this.mainWallets.forEach(e=>{e.walletInfo.connectEventNamesOnWindow?.forEach(t=>{window.removeEventListener(t,this._reconnectMap[e.walletName])}),e.walletInfo.connectEventNamesOnClient?.forEach(async t=>{e.client?.off?.(t,this._reconnectMap[e.walletName])})}))}},Ji={osmosis:{rpc:[`https://rpc-osmosis.keplr.app/`],rest:[`https://lcd-osmosis.keplr.app/`]},osmosistestnet:{rpc:[`https://rpc-test.osmosis.zone/`],rest:[`https://lcd-test.osmosis.zone/`]},cosmoshub:{rpc:[`https://rpc-cosmoshub.keplr.app`],rest:[`https://lcd-cosmoshub.keplr.app`]},terra:{rpc:[`https://rpc-columbus.keplr.app`],rest:[`https://lcd-columbus.keplr.app`]},secretnetwork:{rpc:[`https://rpc-secret.keplr.app`],rest:[`https://lcd-secret.keplr.app`]},akash:{rpc:[`https://rpc-akash.keplr.app`],rest:[`https://lcd-akash.keplr.app`]},regen:{rpc:[`https://rpc-regen.keplr.app`],rest:[`https://lcd-regen.keplr.app`]},sentinel:{rpc:[`https://rpc-sentinel.keplr.app`],rest:[`https://lcd-sentinel.keplr.app`]},persistence:{rpc:[`https://rpc-persistence.keplr.app`],rest:[`https://lcd-persistence.keplr.app`]},irisnet:{rpc:[`https://rpc-iris.keplr.app`],rest:[`https://lcd-iris.keplr.app`]},cryptoorgchain:{rpc:[`https://rpc-crypto-org.keplr.app/`],rest:[`https://lcd-crypto-org.keplr.app/`]},starname:{rpc:[`https://rpc-iov.keplr.app`],rest:[`https://lcd-iov.keplr.app`]},emoney:{rpc:[`https://rpc-emoney.keplr.app`],rest:[`https://lcd-emoney.keplr.app`]},juno:{rpc:[`https://rpc-juno.itastakers.com`],rest:[`https://lcd-juno.itastakers.com`]},microtick:{rpc:[`https://rpc-microtick.keplr.app`],rest:[`https://lcd-microtick.keplr.app`]},likecoin:{rpc:[`https://mainnet-node.like.co/rpc`],rest:[`https://mainnet-node.like.co`]},impacthub:{rpc:[`https://rpc-impacthub.keplr.app`],rest:[`https://lcd-impacthub.keplr.app`]},bitcanna:{rpc:[`https://rpc.bitcanna.io`],rest:[`https://lcd.bitcanna.io`]},bitsong:{rpc:[`https://rpc.explorebitsong.com`],rest:[`https://lcd.explorebitsong.com`]},kichain:{rpc:[`https://rpc-mainnet.blockchain.ki`],rest:[`https://api-mainnet.blockchain.ki`]},panacea:{rpc:[`https://rpc.gopanacea.org`],rest:[`https://api.gopanacea.org`]},bostrom:{rpc:[`https://rpc.bostrom.cybernode.ai`],rest:[`https://lcd.bostrom.cybernode.ai`]},comdex:{rpc:[`https://rpc.comdex.one`],rest:[`https://rest.comdex.one`]},cheqd:{rpc:[`https://rpc.cheqd.net`],rest:[`https://api.cheqd.net`]},stargaze:{rpc:[`https://rpc.stargaze-apis.com`],rest:[`https://rest.stargaze-apis.com`]},chihuahua:{rpc:[`https://rpc.chihuahua.wtf`],rest:[`https://api.chihuahua.wtf`]},lumnetwork:{rpc:[`https://node0.mainnet.lum.network/rpc`],rest:[`https://node0.mainnet.lum.network/rest`]},vidulum:{rpc:[`https://mainnet-rpc.vidulum.app`],rest:[`https://mainnet-lcd.vidulum.app`]},desmos:{rpc:[`https://rpc.mainnet.desmos.network`],rest:[`https://api.mainnet.desmos.network`]},dig:{rpc:[`https://rpc-1-dig.notional.ventures`],rest:[`https://api-1-dig.notional.ventures`]},sommelier:{rpc:[`https://rpc-sommelier.keplr.app`],rest:[`https://lcd-sommelier.keplr.app`]},sifchain:{rpc:[`https://rpc.sifchain.finance`],rest:[`https://api-int.sifchain.finance`]},bandchain:{rpc:[`https://rpc.laozi3.bandchain.org`],rest:[`https://laozi1.bandchain.org/api`]},konstellation:{rpc:[`https://node1.konstellation.tech:26657`],rest:[`https://node1.konstellation.tech:1318`]},umee:{rpc:[`https://rpc.aphrodite.main.network.umee.cc`],rest:[`https://api.aphrodite.main.network.umee.cc`]},gravitybridge:{rpc:[`https://gravitychain.io:26657`],rest:[`https://gravitychain.io:1317`]},decentr:{rpc:[`https://poseidon.mainnet.decentr.xyz`],rest:[`https://rest.mainnet.decentr.xyz`]},shentu:{rpc:[`https://shenturpc.certikpowered.info`],rest:[`https://azuredragon.noopsbycertik.com`]},carbon:{rpc:[`https://tm-api.carbon.network`],rest:[`https://api.carbon.network`]},injective:{rpc:[`https://public.api.injective.network`],rest:[`https://public.lcd.injective.network`]},cerberus:{rpc:[`https://rpc.cerberus.zone:26657`],rest:[`https://api.cerberus.zone:1317`]},fetchhub:{rpc:[`https://rpc-fetchhub.fetch.ai:443`],rest:[`https://rest-fetchhub.fetch.ai`]},assetmantle:{rpc:[`https://rpc.assetmantle.one/`],rest:[`https://rest.assetmantle.one/`]},provenance:{rpc:[`https://rpc.provenance.io/`],rest:[`https://api.provenance.io`]},galaxy:{rpc:[`https://rpc.galaxychain.zone`],rest:[`https://rest.galaxychain.zone`]},meme:{rpc:[`https://rpc-meme-1.meme.sx:443`],rest:[`https://api-meme-1.meme.sx:443`]},evmos:{rpc:[`https://rpc-evmos.keplr.app/`],rest:[`https://lcd-evmos.keplr.app/`]},terra2:{rpc:[`https://rpc.terrav2.ccvalidators.com/`],rest:[`https://phoenix-lcd.terra.dev/`]},rizon:{rpc:[`https://rpcapi.rizon.world/`],rest:[`https://restapi.rizon.world/`]},kava:{rpc:[`https://rpc-kava.keplr.app`],rest:[`https://lcd-kava.keplr.app`]},genesisl1:{rpc:[`https://26657.genesisl1.org`],rest:[`https://api.genesisl1.org`]}},Yi=class extends Gr{constructor(e,t){super(e,t)}},Xi=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),Zi=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),Qi=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),$i=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),ea=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),ta=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.EIP6963EventNames=void 0,(function(e){e.Announce=`eip6963:announceProvider`,e.Request=`eip6963:requestProvider`})(e.EIP6963EventNames||={})})),na=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),ra=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),ia=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CHAIN_TYPE_TO_GENESIS_HASH=e.GENESIS_HASH_TO_CHAIN_TYPE=e.NETWORK_TO_GENESIS_HASH=e.GENESIS_HASH_TO_NETWORK=e.ChainType=e.Network=e.GenesisHash=e.BitcoinSignMessageType=void 0,(function(e){e.ECDSA=`ecdsa`,e.BIP322_SIMPLE=`bip322-simple`})(e.BitcoinSignMessageType||={});var t;(function(e){e.MAINNET=`000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f`,e.TESTNET=`000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943`,e.SIGNET=`00000008819873e925422c1ff0f99f7cc9bbb232af63a077a480a3633bee1ef6`})(t=e.GenesisHash||={});var n;(function(e){e.MAINNET=`mainnet`,e.LIVENET=`livenet`,e.TESTNET=`testnet`,e.SIGNET=`signet`})(n=e.Network||={});var r;(function(e){e.BITCOIN_MAINNET=`BITCOIN_MAINNET`,e.BITCOIN_TESTNET=`BITCOIN_TESTNET`,e.BITCOIN_SIGNET=`BITCOIN_SIGNET`})(r=e.ChainType||={}),e.GENESIS_HASH_TO_NETWORK={[t.MAINNET]:n.MAINNET,[t.TESTNET]:n.TESTNET,[t.SIGNET]:n.SIGNET},e.NETWORK_TO_GENESIS_HASH={[n.MAINNET]:t.MAINNET,[n.LIVENET]:t.MAINNET,[n.TESTNET]:t.TESTNET,[n.SIGNET]:t.SIGNET},e.GENESIS_HASH_TO_CHAIN_TYPE={[t.MAINNET]:r.BITCOIN_MAINNET,[t.TESTNET]:r.BITCOIN_TESTNET,[t.SIGNET]:r.BITCOIN_SIGNET},e.CHAIN_TYPE_TO_GENESIS_HASH={[r.BITCOIN_MAINNET]:t.MAINNET,[r.BITCOIN_TESTNET]:t.TESTNET,[r.BITCOIN_SIGNET]:t.SIGNET}})),aa=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(ea(),e),n(ta(),e),n(na(),e),n(ra(),e),n(ia(),e)})),oa=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),sa=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.EthTxStatus=e.EthSignType=void 0,(function(e){e.MESSAGE=`message`,e.TRANSACTION=`transaction`,e.EIP712=`eip-712`})(e.EthSignType||={}),(function(e){e.Success=`0x1`,e.Failure=`0x0`})(e.EthTxStatus||={})})),ca=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),la=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),ua=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),da=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),fa=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(Xi(),e),n(Zi(),e),n(Qi(),e),n($i(),e),n(aa(),e),n(oa(),e),n(sa(),e),n(ca(),e),n(la(),e),n(ua(),e),n(da(),e)})),pa=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromHex=e.toHex=void 0;function t(e){let t=``;for(let n of e)t+=(`0`+n.toString(16)).slice(-2);return t}e.toHex=t;function n(e){if(e.length%2!=0)throw Error(`hex string length must be a multiple of 2`);let t=[];for(let n=0;n<e.length;n+=2){let r=e.substr(n,2);if(!r.match(/[0-9a-f]{2}/i))throw Error(`hex string contains invalid characters`);t.push(parseInt(r,16))}return new Uint8Array(t)}e.fromHex=n})),ma=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.JSONUint8Array=void 0;var t=pa();e.JSONUint8Array=class e{static parse(e){return JSON.parse(e,(e,n)=>{if(e===`__proto__`)throw Error(`__proto__ is disallowed`);return n&&typeof n==`string`&&n.startsWith(`__uint8array__`)?(0,t.fromHex)(n.replace(`__uint8array__`,``)):typeof BigInt<`u`&&n&&typeof n==`string`&&n.startsWith(`__bigint__`)?BigInt(n.replace(`__bigint__`,``)):n})}static stringify(e){return JSON.stringify(e,(e,n)=>{if(e===`__proto__`)throw Error(`__proto__ is disallowed`);if(n&&(n instanceof Uint8Array||typeof n==`object`&&`type`in n&&`data`in n&&n.type===`Buffer`&&Array.isArray(n.data))){let e=n instanceof Uint8Array?n:new Uint8Array(n.data);return`__uint8array__${(0,t.toHex)(e)}`}return typeof n==`bigint`?`__bigint__${n.toString()}`:n})}static wrap(t){if(t!==void 0)return JSON.parse(e.stringify(t))}static unwrap(t){if(t!==void 0)return e.parse(e.stringify(t))}}})),G=a(((e,t)=>{t.exports=r;var n=null;try{n=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function r(e,t,n){this.low=e|0,this.high=t|0,this.unsigned=!!n}r.prototype.__isLong__,Object.defineProperty(r.prototype,`__isLong__`,{value:!0});function i(e){return(e&&e.__isLong__)===!0}r.isLong=i;var a={},o={};function s(e,t){var n,r,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(r=o[e],r)?r:(n=l(e,(e|0)<0?-1:0,!0),i&&(o[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(r=a[e],r)?r:(n=l(e,e<0?-1:0,!1),i&&(a[e]=n),n))}r.fromInt=s;function c(e,t){if(isNaN(e))return t?b:y;if(t){if(e<0)return b;if(e>=g)return T}else{if(e<=-_)return E;if(e+1>=_)return w}return e<0?c(-e,t).neg():l(e%h|0,e/h|0,t)}r.fromNumber=c;function l(e,t,n){return new r(e,t,n)}r.fromBits=l;var u=Math.pow;function d(e,t,n){if(e.length===0)throw Error(`empty string`);if(e===`NaN`||e===`Infinity`||e===`+Infinity`||e===`-Infinity`)return y;if(typeof t==`number`?(n=t,t=!1):t=!!t,n||=10,n<2||36<n)throw RangeError(`radix`);var r;if((r=e.indexOf(`-`))>0)throw Error(`interior hyphen`);if(r===0)return d(e.substring(1),t,n).neg();for(var i=c(u(n,8)),a=y,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),l=parseInt(e.substring(o,o+s),n);if(s<8){var f=c(u(n,s));a=a.mul(f).add(c(l))}else a=a.mul(i),a=a.add(c(l))}return a.unsigned=t,a}r.fromString=d;function f(e,t){return typeof e==`number`?c(e,t):typeof e==`string`?d(e,t):l(e.low,e.high,typeof t==`boolean`?t:e.unsigned)}r.fromValue=f;var p=65536,m=1<<24,h=p*p,g=h*h,_=g/2,v=s(m),y=s(0);r.ZERO=y;var b=s(0,!0);r.UZERO=b;var x=s(1);r.ONE=x;var S=s(1,!0);r.UONE=S;var C=s(-1);r.NEG_ONE=C;var w=l(-1,2147483647,!1);r.MAX_VALUE=w;var T=l(-1,-1,!0);r.MAX_UNSIGNED_VALUE=T;var E=l(0,-2147483648,!1);r.MIN_VALUE=E;var D=r.prototype;D.toInt=function(){return this.unsigned?this.low>>>0:this.low},D.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},D.toString=function(e){if(e||=10,e<2||36<e)throw RangeError(`radix`);if(this.isZero())return`0`;if(this.isNegative())if(this.eq(E)){var t=c(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}else return`-`+this.neg().toString(e);for(var i=c(u(e,6),this.unsigned),a=this,o=``;;){var s=a.div(i),l=(a.sub(s.mul(i)).toInt()>>>0).toString(e);if(a=s,a.isZero())return l+o;for(;l.length<6;)l=`0`+l;o=``+l+o}},D.getHighBits=function(){return this.high},D.getHighBitsUnsigned=function(){return this.high>>>0},D.getLowBits=function(){return this.low},D.getLowBitsUnsigned=function(){return this.low>>>0},D.getNumBitsAbs=function(){if(this.isNegative())return this.eq(E)?64:this.neg().getNumBitsAbs();for(var e=this.high==0?this.low:this.high,t=31;t>0&&!(e&1<<t);t--);return this.high==0?t+1:t+33},D.isZero=function(){return this.high===0&&this.low===0},D.eqz=D.isZero,D.isNegative=function(){return!this.unsigned&&this.high<0},D.isPositive=function(){return this.unsigned||this.high>=0},D.isOdd=function(){return(this.low&1)==1},D.isEven=function(){return(this.low&1)==0},D.equals=function(e){return i(e)||(e=f(e)),this.unsigned!==e.unsigned&&this.high>>>31==1&&e.high>>>31==1?!1:this.high===e.high&&this.low===e.low},D.eq=D.equals,D.notEquals=function(e){return!this.eq(e)},D.neq=D.notEquals,D.ne=D.notEquals,D.lessThan=function(e){return this.comp(e)<0},D.lt=D.lessThan,D.lessThanOrEqual=function(e){return this.comp(e)<=0},D.lte=D.lessThanOrEqual,D.le=D.lessThanOrEqual,D.greaterThan=function(e){return this.comp(e)>0},D.gt=D.greaterThan,D.greaterThanOrEqual=function(e){return this.comp(e)>=0},D.gte=D.greaterThanOrEqual,D.ge=D.greaterThanOrEqual,D.compare=function(e){if(i(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},D.comp=D.compare,D.negate=function(){return!this.unsigned&&this.eq(E)?E:this.not().add(x)},D.neg=D.negate,D.add=function(e){i(e)||(e=f(e));var t=this.high>>>16,n=this.high&65535,r=this.low>>>16,a=this.low&65535,o=e.high>>>16,s=e.high&65535,c=e.low>>>16,u=e.low&65535,d=0,p=0,m=0,h=0;return h+=a+u,m+=h>>>16,h&=65535,m+=r+c,p+=m>>>16,m&=65535,p+=n+s,d+=p>>>16,p&=65535,d+=t+o,d&=65535,l(m<<16|h,d<<16|p,this.unsigned)},D.subtract=function(e){return i(e)||(e=f(e)),this.add(e.neg())},D.sub=D.subtract,D.multiply=function(e){if(this.isZero())return y;if(i(e)||(e=f(e)),n)return l(n.mul(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned);if(e.isZero())return y;if(this.eq(E))return e.isOdd()?E:y;if(e.eq(E))return this.isOdd()?E:y;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(v)&&e.lt(v))return c(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,r=this.high&65535,a=this.low>>>16,o=this.low&65535,s=e.high>>>16,u=e.high&65535,d=e.low>>>16,p=e.low&65535,m=0,h=0,g=0,_=0;return _+=o*p,g+=_>>>16,_&=65535,g+=a*p,h+=g>>>16,g&=65535,g+=o*d,h+=g>>>16,g&=65535,h+=r*p,m+=h>>>16,h&=65535,h+=a*d,m+=h>>>16,h&=65535,h+=o*u,m+=h>>>16,h&=65535,m+=t*p+r*d+a*u+o*s,m&=65535,l(g<<16|_,m<<16|h,this.unsigned)},D.mul=D.multiply,D.divide=function(e){if(i(e)||(e=f(e)),e.isZero())throw Error(`division by zero`);if(n)return!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1?this:l((this.unsigned?n.div_u:n.div_s)(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned);if(this.isZero())return this.unsigned?b:y;var t,r,a;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return b;if(e.gt(this.shru(1)))return S;a=b}else{if(this.eq(E))return e.eq(x)||e.eq(C)?E:e.eq(E)?x:(t=this.shr(1).div(e).shl(1),t.eq(y)?e.isNegative()?x:C:(r=this.sub(e.mul(t)),a=t.add(r.div(e)),a));if(e.eq(E))return this.unsigned?b:y;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=y}for(r=this;r.gte(e);){t=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(t)/Math.LN2),s=o<=48?1:u(2,o-48),d=c(t),p=d.mul(e);p.isNegative()||p.gt(r);)t-=s,d=c(t,this.unsigned),p=d.mul(e);d.isZero()&&(d=x),a=a.add(d),r=r.sub(p)}return a},D.div=D.divide,D.modulo=function(e){return i(e)||(e=f(e)),n?l((this.unsigned?n.rem_u:n.rem_s)(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},D.mod=D.modulo,D.rem=D.modulo,D.not=function(){return l(~this.low,~this.high,this.unsigned)},D.and=function(e){return i(e)||(e=f(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},D.or=function(e){return i(e)||(e=f(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},D.xor=function(e){return i(e)||(e=f(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},D.shiftLeft=function(e){return i(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):l(0,this.low<<e-32,this.unsigned)},D.shl=D.shiftLeft,D.shiftRight=function(e){return i(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},D.shr=D.shiftRight,D.shiftRightUnsigned=function(e){if(i(e)&&(e=e.toInt()),e&=63,e===0)return this;var t=this.high;if(e<32){var n=this.low;return l(n>>>e|t<<32-e,t>>>e,this.unsigned)}else if(e===32)return l(t,0,this.unsigned);else return l(t>>>e-32,0,this.unsigned)},D.shru=D.shiftRightUnsigned,D.shr_u=D.shiftRightUnsigned,D.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},D.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},D.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},D.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},D.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]},r.fromBytes=function(e,t,n){return n?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}})),ha=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.CosmJSOfflineSigner=e.CosmJSOfflineSignerOnlyAmino=void 0;var n=class{constructor(e,t,n){this.chainId=e,this.keplr=t,this.signOptions=n}getAccounts(){return t(this,void 0,void 0,function*(){let e=yield this.keplr.getKey(this.chainId);return[{address:e.bech32Address,algo:`secp256k1`,pubkey:e.pubKey}]})}signAmino(e,n){return t(this,void 0,void 0,function*(){if(this.chainId!==n.chain_id)throw Error(`Unmatched chain id with the offline signer`);if((yield this.keplr.getKey(n.chain_id)).bech32Address!==e)throw Error(`Unknown signer address`);return yield this.keplr.signAmino(this.chainId,e,n,this.signOptions)})}sign(e,n){return t(this,void 0,void 0,function*(){return yield this.signAmino(e,n)})}};e.CosmJSOfflineSignerOnlyAmino=n,e.CosmJSOfflineSigner=class extends n{constructor(e,t,n){super(e,t,n)}signDirect(e,n){return t(this,void 0,void 0,function*(){if(this.chainId!==n.chainId)throw Error(`Unmatched chain id with the offline signer`);if((yield this.keplr.getKey(n.chainId)).bech32Address!==e)throw Error(`Unknown signer address`);return yield this.keplr.signDirect(this.chainId,e,n,this.signOptions)})}}})),ga=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.KeplrEnigmaUtils=void 0,e.KeplrEnigmaUtils=class{constructor(e,t){this.chainId=e,this.keplr=t}getPubkey(){return t(this,void 0,void 0,function*(){return yield this.keplr.getEnigmaPubKey(this.chainId)})}getTxEncryptionKey(e){return t(this,void 0,void 0,function*(){return yield this.keplr.getEnigmaTxEncryptionKey(this.chainId,e)})}encrypt(e,n){return t(this,void 0,void 0,function*(){return yield this.keplr.enigmaEncrypt(this.chainId,e,n)})}decrypt(e,n){return t(this,void 0,void 0,function*(){return yield this.keplr.enigmaDecrypt(this.chainId,e,n)})}}})),_a=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BUILD_VERSION=void 0,e.BUILD_VERSION=`0.12.313`})),va=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.metaId=e.KeplrLogoBase64=void 0,e.KeplrLogoBase64=`iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAACPfSURBVHgBzV0L0B9VdT9nvy/vB6nVOg4GEx/VER3A1iqo9aMzFgWtoOhgsYaHYNV2lNEqxAdfmKHTakuDTge1FJK2tqOtGqoWFWti8TFSxGDriFSbIK+qgB95h+Tb09397+49r3t3/99/LT0zm//e9917fud3zr27SRB+EbKd1gAcOhFg/kSYmjoBiJ4JhMsB6LHFJetS+wfoAowOQOKnumGVUfSX+23Ba0uRfFaGsh6pNKDqP2PzQN5TbNxqjAeqi2CuWLuvAuU74eT1O+AXIAhDSaX0g+fBFL6ymHShfFhT5RvdknNLzsTIb+cChmzb2OJqJY8aQG9gaAUXaXLbOH0gL4mXmXHC/HYUv1thEWyDk9bPwQAyOQC2H1wHGb29uNtQdLcmFJBv2AsFAPVQJDQPlFBYFACpso7+kFm17g/9sUgr3QFWNI3VtQWO0KaCGXbDBLJwAFSKz2cLjtvglhNFGmr6NomgxEQdT1kYK8N0uzBwH3bosHJo3EKkD1ZG0X6ctAFEW6cAAiwYCAsDwM2HL4e8tHpa45a7NN2UUaxBmFAPmpdt+rGDq0zdrpP2I6yRig06ANHNHuAwjxlzFp67fhOMKeMBoLT6Kby+GHMGmklySVosJAO+ajK9LX6Uxl51eyqZp/tYvVcPbRklynQ7au913aaeBwLRz+6CDU4dhw2yvhVh++EzIcPvBOXXc+SXJz3LMVYeEblOYxKZMx/kF4V70aZPv+q+7ceUmaivHTu0hDSWqzwRWa4rAsTtcOuuM6Gn9APAzYfeVszsM8UAazoVCgDj1DELneqrBgrq/ilyKUFwFE2R8cX8UABD1OmaOx87pkw137gxoP9ssq91xfUZ+Pddl0MP6QbAVwt/Pw+boY+MCQzsquNY6VhCHUoGNeY4fUKjVLR9JdIC8IkxkTrqkerVPsNsHxCk17RUPtFstJw6tE2RfNAPl35Cs7XrSHcGhWPHADBWIJj25XJ8ipbJcUmlZR01Fs+bh0vg+eujBhwHQOnzoaD9pFAi25ZhD2XzPKmHNAAQyC/zHbCelFNGicBPpxP8jZFA0El37xyaHA8oqm8uBGfB89Zv84p8AJTRPuD24m4dpKSLAdhPPGKv8wx4+1l8dO/vtVWL1PvQKMIIxOtFo3VKKy9y4JNmkboflef2N5K5gglO8nYHfgxAhfJHwQQkL9EmXgfHqNcnLkBSwWAPEUFfrG3Xs6k8b+dg66N6RpS7DNMvAp+vwTXrB2Lt7dqugWm4HhyxANhe+P2U5fcBQy0mYh+nntOmL0BcoMREK8vNr8uiCgnKkAEixIO5Zo41IOKKrgPNWFvw1liuVDWHvNi+f/NHs6BErmdJ/Tnugt5Clhl5mVPdUnCkLnMhfVwC8hUz5c69qifm4vYBLrWT285Jq7aUdAOM4ut02ycAkLECilgGb1+1naNcugLJAPPF1iFlid7FxmjH6VO3R99d2zdOwa2k+gNpNVGGcObc5vPRExZvKFwxjahLil1olGf7qd0DgWIXjM+5Hbusg2syxMvVU9RSWv/R/tbvWyUflMZoQ9YwE6vfhxHK1ensy3HC6FlypG56ixZnBDJ1bf/2OwPeU8Qyeh6n5kDrGxZoGSA7CrMiqPEubjFdF5tTnzbGkrkoy+L5HgslGSbyPG4QR85YTp7PABi10sbqTTBIym8T2jnpvsV8EEwQ6EhG8Ha+ZtXHHHjk8M+hr1D7R1TQK1ftumIAtI1Nuo+Vpw+GAHod8rR5qXSqX5mOWzixcpanrIM8RhL9yP6UzM0fLljg1PVzIwY4cujMTovuQBVQD2tnc+zy2ynG6NoGdjJBbO5QWxdoa4aoj9fHwl46jIMBX6Tqt8+j/DwEixcswNsTJNYSwxVkzaIlcF55UwEAc9wwFgA8ZUQnYOt2AcN1b4mybvCh7IN6UH8zLx2ggVcnnY66BqpnxdcILDCaZ3Dn3/RK/nNJAGN7EUy9slkTwBsPeXZhJE3JuoicNn47jJhllwvoVe5RuaJ5Mz7avgCHTZutnBqzy0U0eXblKGIlRuaOHMnXT8ONB2d6Bo+9JeaeTJ2By9pyXslbQ8RRAUU6oI68sdOlpkikkSQIRxoPL4dadmgUSqHzURH5ukaOiqQS1kxPw4nTWfkFL/WDTEr6xR5xBY6v9NGqoFeJEu08BdcrHoDLFr7KQ9np2Glv/EKRSAYoCJQED0GDX2Q5wOYKajAuoW55N5UXAKA8m1mI+jvbUL+6CwGEKFdKQlHDmYRrNWBAgYMzAbZWG5IIZIASGpGTZ+eFdXEPGsf6yZs1wEUnTBeJYzrbmZyOwWgMBRZy7YlL4A1rp2Eh8m8PzsNp39yfrOMqE5i76FK0l1d0+tHjV8Hrj10KQ8h39x2Bk2/5WRisZCQ2HrXKU7GCmKDM6SpCmC9cQA7rus25n3TFEgMNY8U8mErEXIK2UOZvEdK0vvEpKwZT/l2H5uGc2x8S7KDHQzFPaDOC21LlvDCqF1xTmt06sX1JAMk0h8nqDAaICOOgp2BWiB20GZvfZU9bARufuhyGkFL5p9/6INx9KHdezTb7EwfhdQxAKV9LXqaQddOdf3Uu0ndKMIEet58eYIsKBeuIWT7P8sow0UazxGW/unw45R8slP/tB+HHxW87mAoMUbOBmZ4T/Y4h0ykAjSPj+Pxx23aOrQOvUmKgAMdVeaxXBwicJc5duwQ2Pm0Y5T98lODlheXfUyi/sXxyqF9s/2KULgJhgLRPlDKNOSxIJqJ/VGUTMIDxgaQsGsaZq7Q03u7Zx0zDNSesgiGkVP4ZtxSWfyAHHnsYP68WBhNl4NQEVZMzc3M3PZSv71O3nYAecxIXULdHM5Zfry1DVpHS8z5u+RR8/uTOzVJvOffbP4fv7Tka37K2WU5+m9Of+jFxNz3pKeBCqX9S2hd9eXSfGqu1NpTbKrS3xy2fhs+dshqOWTTMjN/63T3w9QcfsSwIvrI9RWOPOn3FBoEdgj0QM57SaTIwELjbz9Y1CDfgLzKKotFN2efaFVPwuResLkDQ/2/QpWTj9/bCP9x9UG4x7UwgrsT+9E88Va0DgbfJmx4jXpAt3WETZThem7HEYYCkwgnc7TLPO2YxwudeOJzy//TO/fDRXQeqIcLcmoHNDE0ZueWx9s7alm8BHYabyAXELDpeFmk3qRsa0wWkqLdRzmdfdMxgyv/AD/bDBwsA8LDDzmYhjFDXEeBN1FUgL2V6nMVfqL+vymI0HWPDvlK6gJx3qG4JBPLdOSj5y+euLKL+KRhCKuXfsb+eQ+phVZlQFgoqT0vsYcnNMjFAWslxIupL8UNbP+/DuoDE+CY+GMm7j18Gr3vSYhhCPvajg/Bn39+/YIvXRI9Obuvr2fOknILGz1guIAkOitdDb2ToZpQ+gqxrFJEPq2OsyVJ++QDvKpT/rmcugyHkE3cdgvfdvq+w/BBUsgFHWzyMW7ws8IHbMoMoGy+oFgzQ2/r1AkdamMlBhDUmdQEx9xJJe2UXP31pBYAh5BsPHIG33bqX+fwI9VcgAIguQKVQC4aktH0mK7V3CwsCo0EXQ2sPl4A0iebNsGYMce9F/rWc8+QlcOVJwxzxfm9uHs7/+sMOKBNb0Ja71cKaJrVyqWMr1rms4el7BoHUL6p3wJqyxDZvoF2ATuvAS4OgzH72L0/Blc8ZxvLv3p/Dq3fMwd4jsfUKGvLjIzU5cpuCH9WS2vz3k+4gMNKZmx1jBow9sGy3YMnB3eM2/jIGwrUrM9j6opWweoBTvlL5Z29/GPYeptbvV2M5oAuTJVtu6tQZ3ikOF17f61MUBul2AWQjUlccJccUjBEqXpDUMYAOsqIgqBf3uJUIn3nJquK0b/K9fqn813zlYbh3/zx7nsaeO/bwVRWKzlvWg3jMYILM2GgouhrvbWDKr8diRHTyqudldDEBA3Dl60+/YiA4rrD8T79k5WDKf+2/KuXrSL2OzsEtr6HClIuReiEvZjYUtf5Yi44YgEwSI/Vic9KBHjpbtElZoF1bh/Kb8Zo6q4sj3utnVlT0P6nsKXz9a7/8MNyzb/RaF1Nb3fYolsRcRb0u6mfZsnM1mhc7RCTxMigR+EWsWhUn66EpmEB4n6RcDFusMvtDL1wOz3rM5Kd8lfJvKix/b171G+iVfV6uwc7+hORxjZ/y2k26hNYFJIIC36ezQxVj3Y5FMCsQljuBYP1dBbbjgutTr3j+MnjpcYtgCLlo+174/oPz7nd8Md9vlOvRvicC1F3BHiWTuotpo8y+lBz17baOuCWHIYaIATzLZ+l3PGcpXHT8EhhC3vn1/fCt+4+MLF8xdgAitidzdcpnBU37VP+BDnNG1lNm9tAea1MwQI/V96iM2j9kFTYzTET/VXpCy9f9mMOeOv8dv7a0AsAQcsUtB+BT/3UYmtM9d0wBCt/3G8OJWQ7PoQ7r9PrukM6DID53t8wJUPSzSLTKv7SZ6r+XlG35OQDJeV307MUVAIaQq79zELb85yFBx9jhkxF4XT5pv36b79I7hngnsRGId2wXeox3AayOg2jZ3qe9NOoXLsiBxeZ52vpFsOmUYU75rr7tYAWACtA84FV/d6/ZiiaftfmXP7hleOuRUmaXtWtdu9ba4xzAt/IIgiMTEqDRwdoA4sUAzyqOeDfPDKf8D912cOTzXcrn/5SL3RLz8wkNDLHArnVTXNkOQHoDopZ+L4NUoOi5q0AK4UmNFXj5zQNOIDoGWLsqg2tftgJWL5mcYq7/j8Pw4VsPyrknAk7sEfwhv0kCo+4PIK3sCbbWvT8KxWYkPQEFDr5Ioh6SzUfmRhYq5ZB5mFep/E+eWZzyrZpc+Z/6wSNw5TcOmICPK5UrQdO8LjfH5R7tq/VzrR57Wjp248EFAEZHBp+2sQuNZA5kmroY67OntBZZXE88plD+WYXyV0+u/HKPf+lX9tf/hg60IBBKM0qH5FYU2bt6Ga+Q7ENXaOqxcUU+RMSNA6TEXYBAIEVHCdbAKK8pY/my7uhmcjXV/RYgXr0U4dozVgym/Ndv2xuOqVvF1kzAx3Zjgjgz+FtVBxie23DcgJOMZzq69oNAdFpRpLhRpqH80BxVQ5zAZxmprf+q314Gxz9u8vP98mj39z69F/YVr3UzV3HsX/5Cct2BOYl0QCHSAO62D2MKj+QDqDFNphX/HIBsD+gkRgMpCxeKl44sgITES5pJdwOXzyyF054y+RHvvXtq5R+i4JoSikT2Sdc4ls/7AkgDw+tL5IsOrIi+HVExgKVx25NUZJXWflDeKP9PJg8mAMDJa6eqa1Iplf+GT+2F+/bkYlGxy7qhiQ9AKCpm+e5a6TYAFgiNLaWAwCcVEV083ee7PI9SxL+pKw291a4J/PjHJej3+2hIpfx/rJWP2u+Dq1hUAPHKYuWectHz95ohmnyAxOt3nQFJSW4DvUFa6zZ5jdhPoMVJnWEFGuxAaCGyp/D1Gz7JLF9t9bjiW4tnrBVYQIqXj2OUJ9Ns/FT9UC+OgvRBkLZstRuwL3sUMJyI37iDR1v5nyiUP1e/0/don8Ac77b1HIYw7Vm5Trf16zw3Jqg7cllAVJaCrJ5fOJL4OUCkN49iWlZwJsb/QUSJ9kS88X8k77nxAPzgJ/PGvyOApG6eX2Y0ZcyHx2IFnQaQykHzKhj6uwMAP45ICgpg9NoGJg9/qP3D+RKHVD0Ir0b5xB8FFii/3r3jf45WZwiefxfWD5D09a2ylQFYJkD/lbhj+bFX596HIcbae4Oh/MeiSwCoC+ehOl4dXaq83raN8qm6qkWkum19VS9F2nqhHa/flj8KAFhVvCfY8rpVcOzqrJpDVs8nq+fE58fvm3q6LMtZ+ypd/8PMObtYm0zUleNnTV7RJiN5NX1lug/TNugCKX6FD0I0XLR/Nwl1IoaqTPh6aJnC97OPAgIKObY4Ov7wq1bCBX8/2vsLyua/nrU7ZdzCOXUbt8AeV7AF4Ni7gSrfNXXGEInlzaqOaut1Lb2x3PaqmYFknbYNYw3OAMgYAdu6MGIEePTk6Y+fgut+d1X15jBlKfwKLIDqitfNTFsYWXRj2YRifQwLGUu2rICCLSRDGJZoruiDardQKT0ovqH7AJYRMCTdw0jBRKG+6P/R3QI2UoLg2nNXVZ+Me/Ru6D8HV+GZqhdLY94oXbqczOmrAUqj6Ky9wKX+Biyesl2AejGAVToJpQsrdhTfx+pFjPD/BARXnb0y6ddDmVQAt9A4CLiF2jqZUlxbt7LuiDUbhTuxQtclqZ7EFVN6UHRQPHDFp6zeAwUsXO64fx6+f/88DCG//qRpmH3FingQSMFydVnMelv3kPt1Mt13zkDCrTfX1uwFh77VZ6kL60geGmW2SrRKh1ZxdX2+EMzqgS2Asfq2HiubgAH2FMHbH358P9z78xyGkFecsBhmf2eFQ//oAEJZsirLcnQZRLKDVbi2+Ma6W4t2ACKAwi8OQkIDnGgMwJXeBnQ0UiJnAREcEsn8PFg9VzaqsknjgPsemofzrt07GAheXoDg8lesgNjauL7U/MYBwxnFA4Z2N0gWSJnDKC1QuILreIFfgrmiMYB4QMkQyJQIudoViLYUKJ9NPjBFzQiTSN3vfQ/lcP6AIDjjxMXwxt9c5isuB0PPoUzuCDKKW73IF+5EKY8snTcMk+UIOr7IHHCaqwEEKL/fXto1kKN4kooP9yRcBOigESQoJpEqfqjHvv/BHC74WHG2PxAI3jizFN744hoE4ARtpC8UytTKDb4bbKDYKLTD/4vtn1Kmr/AI9bcuIMEAMuADq/hcKr5hA7sbgPb8AEw+THwQxK3y/oIJLhwQBBcWILhwZpmlaQDDbD6FB+WiVm4uleqCh7T/t0wQ+mt2DfJswmOFpAuoJj8PMuBzjoa14jkbiLgh4iJaMMEE4ix6yQSX/M0+2Nvvf8PrlAsKEJRXbHdQLS4gWKrnQZhVbuMyLBMEV4COq8hUfCAOkhQr6CNhuwtw6B+aq6Z/swVkwDCgYFRv3EDbnkLw1/Q7gQj3U4995z1H4eKP7B0MBOefurS6hPVQ3OJH1tVY97juAMUOQlpveMfgsgCrZ+g+V+8mmnMA7xI+us3jAJFlwbrDwZBemPZUkEAywaQAaINNuRO5896j8KZr9gwGgvMKAJw3sxQs7aNRBDr5zfsDz2K5xWdkAWb8PmmLtkfBaOo4l97zy32+WlhB7aBiAgpRPXGrp+BCCMwZwKT/VFz7QiaXTNMo6M575+GqGw7AULLht5bC2ScvERQe/LwCgYkDwFV8AIV1IXrHIGMIeXCURRSOFGeF6DeB3jvm8L6awLwbbxO1IpDi79Rrv88/rVqwKOtqxuFf4Hz+lsNV3vvPWQFDyFtOXwb7DxLcdNsjclwIz1jFBM380CsPec1bRPkmEsX3EqFMfQdQj1Gl1bcCqdiqKRt9ENIRhYlPt7gy63RYeFIgYACpG9h8GMAFKCWwqxnjXwoQlD75vQOB4I9evbwa98u3HbEgYArwlOoqGqSSuUq08k1Z8wdZVXaotvx7ARRVgPtRaGPFlYRTPPcLWoKAFNbOWsGEboDCLyI4ChldJRM84ZcyuPC0Yf7W8DvPXl6A6iB8+duP+B+PAgchGoYSytfMIfItSMI9CmPUdUDUtyVj/YcRozIydc1XsvyvSCtAhIVijDCJ/gmES0GS8x39/f2Qvu4Lo7/pe8FAIHjTy5fCrvvmYdf981bxag58vaq/VAJ6DR2GwKBgzRyhTp0v1hE7rb8sN+8C+Nl+CN5U9C+2exBe9DSBIIA5OWy2Z+L7AD7egoVE0Kd3MPyVdpN3/Y0H4fovHoQhZMVShD+5eAU85QlTIZKv14ef3aMO3kgHfF4gh87BUNgpiLMBE+SpMckPDjPgR778DEAp0L4QIrGft9E/2F0EA5moN4FUFuPswVGN1cydg2DLF4YDwR9ftAKe3IIAROQtlQRW+Y1CnQMgpLB70DsFAYhcbTnNhe6VgTr4QXbxMv5CSCyuOCCSdTWrCOXzwyeYQJwxtNXJvADaLQUItt44EAiWIVx5cQCBVnQzPn9LGBSrLdwHiGYC8W0Ce2bzIanaRsqTQHVUKA6EnPyWEbhbiB3wcErWboIrblIhClSfx6xf543qlwD44i2PwBBSguDSDcvgV4pAs6F1CQKb1m8BAzBip4XOsS8HRf1hiKdwvRajgyClcO9wJ5z1M0bglt+Ape2HjJsQ4NBtJwSBfDAC8ckZgXNULK8P/N0++NJAICiVf8XvL69+o0xAMYrW1oxuHXtSKNmAuxOPETgzRF4Hg/kuwGUEQanE3AUYyvfoH5irmESQHMYhAP1No11gaOf7wb/dBzd9azgQbHrzcni8AAE6vtuCI+4KGDu0v5HXx8S/J9Ag0i6gUaa6+CLqKF+k2Y7A+9QLybbnjDGY8sm3LB6feGXBHQB85J/2w3/fM8z3hY8rlH/5m2NM4LgCBxwyKPR3ArZfZweQg/92MHd2AeaNoFIoGAVDS/tim9fSv1YEmLyJ4wBHuT4o1GtrVbb/AMG7rt4zHAgeg/D+N6fdgWUCT9mJdC4BYdmAMYL7QQhJWnQ/BqnuLUBQvDACNx7gfr/px7y9m1AaBRrQUowVKFJGcKAAwaWbhwXBe9/CQeBTsssE0AUGSCievx2044W3gWLhyFI8W9SUu/B//X5MX0NI2SfUDwksluFj1L8tG2hg1HXKFz1Xfmwv/OShHIaQEgTveesyWLlMWXvzbsADI3QEgDCqk0HcDRhXQDYYzbQC2rNzT8kqyPKULH99cBhWmEQobukcCLbMAUEe8n76QA7v+Ys98NMHhwHBYwsQXFaAoDw0atY46grAugV7VuDFDd5BkWQY831g6xdzbalkYwLQ0T65jBC7tCsRY00g2DGmPgrWtN+CEzgQAH5WgOC9m4cDwXHHZnDpHywdgUAoawSKkVVbKpdWa1nD21FkAhTy7IAbo38OIBTmpzllBn9PCTYg8W2gYJIJpH351GHt0IJPPhN/Bg2KBgTvK5jgZwOC4N0tCOxcpc9mbAGS8vl2L27pum/rCvxPwtj+3rNYewIYgjmP8mOAGWQXQBHaB3DB5oOEDGB4+oECBO+/au9gIFhbgOCcVy1ulZUBRIErlaqVz+YLUMcUGJgEAngyVSfUjVI+WMv3joUTlwSBBdEg7wIgNhc+jlIsOCAweSSA8ECh/A9cs6/aJQwhp/zGFJx/7hJB+RiNA/wj5fBMXf4fAWPvBLQFxZSoF9ZjBzfqhyYPJO3za0JxT/rEAkllgqNgrvSYm7jr7nnYVDDBUCA4+XlTsOHcxc6cOX2jejaUVk/xj0hjShduwQv8YoEaZwYc81fcK2VMJFx5RBBnJRJj6zwNertLGN2XILjiz/fCUFKC4DWvXhQUCRbEbkxAUvkcIPotoa3DyooH3u1ZPTp5niLdxQa58CiYILKrmFTacSnQOTgWLhSsqB+00lUf9f2PCxB8dMtwXxqfOjMNp58+zeicWzFjBYi4AbIuhFt9iAVQX7vLfyZubqTRkbDP/UIe+xYJeT7VeaoMdV/8vv58zC1boAhKbC8KH03Vcxt9ikWj7/NI1eV56PTJ84o/bv7GI1X64vOH+V/HGwB88fPzzazDuoJe28AEIVXfI69X35G/xsVT7y6Cw/nbMWL1bcPmXm8RAaJM4ZWjYgnk/S9YSLKO+vXdQqQNYxFxD4xB2P3XChB8/JPDfFBSyssKELz0jGlh8dbaI+cCAGaL6AWGgiHy/OGseKW406VwABsQ6bRSZnpRWT1w6i5QAm0z5bDf0RheGdk0gOMinGdjc/7STYdh22cPw1Dy0tOnAgj0BZHL1LUHQ55rAMId0zngzoyU1slShvnyl6Vj4rkCYBNvZM/+HO776Xy0fUr27a8nQe0foAiwnjuNbuqfoHRFp8hA1bqFhIso/rjhnw9V9y84ZbEaPS6YSD/1aRncRPVXxsjmRz71hzz2J/rz4HmLpvKduG5m15psesmuIr3Gq9Tmad+CctHMwOoX0VlkZGlWnqGth6pepTjeDmsKFG0w5LM8Xcek2X1m8oMSwj3KOl66XYtYHQBQ9SUArLLl3yaSoOe/tsZINl2TYbZ7x/q5Auw7Y9G/jgOi9B6heoz1BX7fyPLRqR/GIvC3dqB2IHo8SrsCfWYAcm7YsQayL5AuVdM58XroUH1sO4c9KV+eBag2O8o5jf5PJMpvcM8DYLSlEucAwO75r8oX5wcQ+gvbNCetFRgBA0/LQyevPjlgIqU4smNqcLC2QnnqXgNDKpqxB0HEv7vKkuWij0h9J1+u7fzWFgB5fmRLkTmnAxyMKMSz+CgLEFtQ3Z/pvwnmNIiYYsAfpwGDzzAeOLwzgcAC4OQZxUMcCEbJntJArrWsLykf1TomlQ8g3IB3wdKpbdAAYOQG8q3tbBxlcaoW9M7y3bYAUQWio0itqFGaAiM5fcrfUE8zhQUPBwaFcfXYoMbQz9z2EQGCkzdqg37dpr+YwgEiSsZ2HVNXcQC0ZXYzzpV12/9mK4fpzRA5yxcW2Ty5dgcgT/hSCtMg8KzaWnejFP4iSS2+AA654IjRLweB159v5WT6cEHi5MVo35ajVTQHQ9sO3efyrnmETc10WgDs3vGE3QUMtoIW9RDIHyhxL3wmB4UBiV3wuHWrcYAilg2tQtH0TfLZmOW3z8jrseqBtkkCBdSCewpI5ZEcW5eDUqqpp0ACrL1mkuJ4ecvsR3B380ziP9qbh/lZ5LEAG7BdDAUE9PIBXEsWymFWaRgF4sxh5iP6CGNxANq5BK0KyoUwL48BWrCQbMfn4wJB5RlWaMvQdRVCycz6gXwlx/sAODIVrL8UAYAiFthdLObVYmYeGNRDg14MDwzk1ImAJSjOWSmlKM/ivb5QK1gwB5m6fLymHJ3n5n256+PVB3BZIZRhWDOSoNd169rmAgDDMDnRJm79AMqgGnnqi+/eXjSYMf9tCWvRDtKkEUUdrMsWknYPfrC2glRdVi+L5MfSmXfAg/WHGTwPMHIwNHrDljoQAq8viNeXOwFO8+weffp39LZ7419l61URuP/X6jQePb/4Ea6glZYOQ3r0GywWDa3ruvIXY1Zt6vboUyccJmiExwg8NhCflEFiTvwZmoS2fgLr35Xlo1fGWFNavQoKHRfguITdeARPBUdcANxRuALK6Hyehx4Q2H0zIVB5DTVDT1Dwh5V9gPXtjrjBHuhFjIHYWg9XgrwnoTTpEqxitSEZZXvP0tZBoVT3eVQ7nl/M9JLLtkjqbyT6vy3/aMdx24jwEr3OGEO/p8iExQswgO3Tt2w2XlUWwKTHG6XJmQdZVmjmq8qE8kDuNjQQBUCbbK1wXYc/k2KF6DMDuFs/DyB15U0b/xq3QUSS/932D29+4uZiDTeBY/3Jew8kGkg8EWMHSPQtWIHMYsu+nc7IB2mUaUi2bccin/lilg9OHjplmkUA4pauJew0aNNl107NQkI6/7/1H35t7SyWINCKid0n8jymAFL5dabew7t9eQN6IHRcDjptkfz+uFW7lqyUjo5yXZ9f5aFsCw6LJIwHI78EdMll16WVX0onAEq5swBBcUpwVtHtbnM6qBYee1ovn2y8rnr6SD+h3BschOLCHC3di04pbX1cXJB6Fh5bm4iSfdqHliF0//XvHOV41sbrpjZDD+kFgFLuvHn9tmxq/tQRCEA+gHgKiitIC7N+jNVXykqCBqQ7kP6QlKJ5G9uXl5e8F2mPUfw2xuJTcwMHyBwQ5SveHE/auCXu87v67yXPeOFds8XG+fK2E2STQp7HPoRo6tS/sX08r8t/Rx9moO3D1BmN2/ccoK0H3pkAqnbe3r9Jh7Lmr3G19I7+fj9jtXg5APoflMTv54qA9+rLtnRTvpbeDMDljq89qQDA/PoCclurjJTlQsQ3R9jBixMMPZtxpBWhx0LuL7kW6QpnmQgbua5Al3fWw7Y8ZZ2BBXDLI4QnLUT5vJ8FyzNmdq3DPJstrOaVxZzX8M/DpNWjYgeInvjpOpmyWvAYAsPiZq61g3P6J63bsoG1/Axi+d5p3uhhsohFC+aA0IanQbSDJrf8imvrPGSbZyP7+74yMQAaKb8tXA5TZxYdbiiumapzAQAIx8WuYiDqBlpqb8vRAoClFwYApSg256BYHwCZUOSkAJC/DAAFzcPO4u6Go5BtKRQ/BwPIYADQ8qyZXTMZZCcW+4UXF6OsyZDWFQ+8DqKKWTgAMhcI4wHAKLatE+wuCoC6LK5cDwCoACbKdxd9FgrGncUrnNtHv9M7h1I6l/8FAVO2ym5DPSIAAAAASUVORK5CYII=`,e.metaId=`d_2hxd99brRo`})),ya=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=`ffffffff-ffff-ffff-ffff-ffffffffffff`})),ba=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=`00000000-0000-0000-0000-000000000000`})),xa=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i})),Sa=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=xa();function n(e){return typeof e==`string`&&t.default.test(e)}e.default=n})),Ca=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Sa();function n(e){if(!(0,t.default)(e))throw TypeError(`Invalid UUID`);let n;return Uint8Array.of((n=parseInt(e.slice(0,8),16))>>>24,n>>>16&255,n>>>8&255,n&255,(n=parseInt(e.slice(9,13),16))>>>8,n&255,(n=parseInt(e.slice(14,18),16))>>>8,n&255,(n=parseInt(e.slice(19,23),16))>>>8,n&255,(n=parseInt(e.slice(24,36),16))/1099511627776&255,n/4294967296&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255)}e.default=n})),wa=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.unsafeStringify=void 0;var t=Sa(),n=[];for(let e=0;e<256;++e)n.push((e+256).toString(16).slice(1));function r(e,t=0){return(n[e[t+0]]+n[e[t+1]]+n[e[t+2]]+n[e[t+3]]+`-`+n[e[t+4]]+n[e[t+5]]+`-`+n[e[t+6]]+n[e[t+7]]+`-`+n[e[t+8]]+n[e[t+9]]+`-`+n[e[t+10]]+n[e[t+11]]+n[e[t+12]]+n[e[t+13]]+n[e[t+14]]+n[e[t+15]]).toLowerCase()}e.unsafeStringify=r;function i(e,n=0){let i=r(e,n);if(!(0,t.default)(i))throw TypeError(`Stringified UUID is invalid`);return i}e.default=i})),Ta=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t,n=new Uint8Array(16);function r(){if(!t){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);t=crypto.getRandomValues.bind(crypto)}return t(n)}e.default=r})),Ea=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.updateV1State=void 0;var t=Ta(),n=wa(),r={};function i(e,i,s){let c,l=e?._v6??!1;if(e){let t=Object.keys(e);t.length===1&&t[0]===`_v6`&&(e=void 0)}if(e)c=o(e.random??e.rng?.()??(0,t.default)(),e.msecs,e.nsecs,e.clockseq,e.node,i,s);else{let e=Date.now(),n=(0,t.default)();a(r,e,n),c=o(n,r.msecs,r.nsecs,l?void 0:r.clockseq,l?void 0:r.node,i,s)}return i??(0,n.unsafeStringify)(c)}function a(e,t,n){return e.msecs??=-1/0,e.nsecs??=0,t===e.msecs?(e.nsecs++,e.nsecs>=1e4&&(e.node=void 0,e.nsecs=0)):t>e.msecs?e.nsecs=0:t<e.msecs&&(e.node=void 0),e.node||(e.node=n.slice(10,16),e.node[0]|=1,e.clockseq=(n[8]<<8|n[9])&16383),e.msecs=t,e}e.updateV1State=a;function o(e,t,n,r,i,a,o=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!a)a=new Uint8Array(16),o=0;else if(o<0||o+16>a.length)throw RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);t??=Date.now(),n??=0,r??=(e[8]<<8|e[9])&16383,i??=e.slice(10,16),t+=0xb1d069b5400;let s=((t&268435455)*1e4+n)%4294967296;a[o++]=s>>>24&255,a[o++]=s>>>16&255,a[o++]=s>>>8&255,a[o++]=s&255;let c=t/4294967296*1e4&268435455;a[o++]=c>>>8&255,a[o++]=c&255,a[o++]=c>>>24&15|16,a[o++]=c>>>16&255,a[o++]=r>>>8|128,a[o++]=r&255;for(let e=0;e<6;++e)a[o++]=i[e];return a}e.default=i})),Da=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Ca(),n=wa();function r(e){let r=i(typeof e==`string`?(0,t.default)(e):e);return typeof e==`string`?(0,n.unsafeStringify)(r):r}e.default=r;function i(e){return Uint8Array.of((e[6]&15)<<4|e[7]>>4&15,(e[7]&15)<<4|(e[4]&240)>>4,(e[4]&15)<<4|(e[5]&240)>>4,(e[5]&15)<<4|(e[0]&240)>>4,(e[0]&15)<<4|(e[1]&240)>>4,(e[1]&15)<<4|(e[2]&240)>>4,96|e[2]&15,e[3],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}})),Oa=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});function t(e){return n(i(a(e),e.length*8))}function n(e){let t=new Uint8Array(e.length*4);for(let n=0;n<e.length*4;n++)t[n]=e[n>>2]>>>n%4*8&255;return t}function r(e){return(e+64>>>9<<4)+14+1}function i(e,t){let n=new Uint32Array(r(t)).fill(0);n.set(e),n[t>>5]|=128<<t%32,n[n.length-1]=t,e=n;let i=1732584193,a=-271733879,s=-1732584194,c=271733878;for(let t=0;t<e.length;t+=16){let n=i,r=a,p=s,m=c;i=l(i,a,s,c,e[t],7,-680876936),c=l(c,i,a,s,e[t+1],12,-389564586),s=l(s,c,i,a,e[t+2],17,606105819),a=l(a,s,c,i,e[t+3],22,-1044525330),i=l(i,a,s,c,e[t+4],7,-176418897),c=l(c,i,a,s,e[t+5],12,1200080426),s=l(s,c,i,a,e[t+6],17,-1473231341),a=l(a,s,c,i,e[t+7],22,-45705983),i=l(i,a,s,c,e[t+8],7,1770035416),c=l(c,i,a,s,e[t+9],12,-1958414417),s=l(s,c,i,a,e[t+10],17,-42063),a=l(a,s,c,i,e[t+11],22,-1990404162),i=l(i,a,s,c,e[t+12],7,1804603682),c=l(c,i,a,s,e[t+13],12,-40341101),s=l(s,c,i,a,e[t+14],17,-1502002290),a=l(a,s,c,i,e[t+15],22,1236535329),i=u(i,a,s,c,e[t+1],5,-165796510),c=u(c,i,a,s,e[t+6],9,-1069501632),s=u(s,c,i,a,e[t+11],14,643717713),a=u(a,s,c,i,e[t],20,-373897302),i=u(i,a,s,c,e[t+5],5,-701558691),c=u(c,i,a,s,e[t+10],9,38016083),s=u(s,c,i,a,e[t+15],14,-660478335),a=u(a,s,c,i,e[t+4],20,-405537848),i=u(i,a,s,c,e[t+9],5,568446438),c=u(c,i,a,s,e[t+14],9,-1019803690),s=u(s,c,i,a,e[t+3],14,-187363961),a=u(a,s,c,i,e[t+8],20,1163531501),i=u(i,a,s,c,e[t+13],5,-1444681467),c=u(c,i,a,s,e[t+2],9,-51403784),s=u(s,c,i,a,e[t+7],14,1735328473),a=u(a,s,c,i,e[t+12],20,-1926607734),i=d(i,a,s,c,e[t+5],4,-378558),c=d(c,i,a,s,e[t+8],11,-2022574463),s=d(s,c,i,a,e[t+11],16,1839030562),a=d(a,s,c,i,e[t+14],23,-35309556),i=d(i,a,s,c,e[t+1],4,-1530992060),c=d(c,i,a,s,e[t+4],11,1272893353),s=d(s,c,i,a,e[t+7],16,-155497632),a=d(a,s,c,i,e[t+10],23,-1094730640),i=d(i,a,s,c,e[t+13],4,681279174),c=d(c,i,a,s,e[t],11,-358537222),s=d(s,c,i,a,e[t+3],16,-722521979),a=d(a,s,c,i,e[t+6],23,76029189),i=d(i,a,s,c,e[t+9],4,-640364487),c=d(c,i,a,s,e[t+12],11,-421815835),s=d(s,c,i,a,e[t+15],16,530742520),a=d(a,s,c,i,e[t+2],23,-995338651),i=f(i,a,s,c,e[t],6,-198630844),c=f(c,i,a,s,e[t+7],10,1126891415),s=f(s,c,i,a,e[t+14],15,-1416354905),a=f(a,s,c,i,e[t+5],21,-57434055),i=f(i,a,s,c,e[t+12],6,1700485571),c=f(c,i,a,s,e[t+3],10,-1894986606),s=f(s,c,i,a,e[t+10],15,-1051523),a=f(a,s,c,i,e[t+1],21,-2054922799),i=f(i,a,s,c,e[t+8],6,1873313359),c=f(c,i,a,s,e[t+15],10,-30611744),s=f(s,c,i,a,e[t+6],15,-1560198380),a=f(a,s,c,i,e[t+13],21,1309151649),i=f(i,a,s,c,e[t+4],6,-145523070),c=f(c,i,a,s,e[t+11],10,-1120210379),s=f(s,c,i,a,e[t+2],15,718787259),a=f(a,s,c,i,e[t+9],21,-343485551),i=o(i,n),a=o(a,r),s=o(s,p),c=o(c,m)}return Uint32Array.of(i,a,s,c)}function a(e){if(e.length===0)return new Uint32Array;let t=new Uint32Array(r(e.length*8)).fill(0);for(let n=0;n<e.length;n++)t[n>>2]|=(e[n]&255)<<n%4*8;return t}function o(e,t){let n=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(n>>16)<<16|n&65535}function s(e,t){return e<<t|e>>>32-t}function c(e,t,n,r,i,a){return o(s(o(o(t,e),o(r,a)),i),n)}function l(e,t,n,r,i,a,o){return c(t&n|~t&r,e,t,i,a,o)}function u(e,t,n,r,i,a,o){return c(t&r|n&~r,e,t,i,a,o)}function d(e,t,n,r,i,a,o){return c(t^n^r,e,t,i,a,o)}function f(e,t,n,r,i,a,o){return c(n^(t|~r),e,t,i,a,o)}e.default=t})),ka=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.URL=e.DNS=e.stringToBytes=void 0;var t=Ca(),n=wa();function r(e){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t}e.stringToBytes=r,e.DNS=`6ba7b810-9dad-11d1-80b4-00c04fd430c8`,e.URL=`6ba7b811-9dad-11d1-80b4-00c04fd430c8`;function i(e,i,a,o,s,c){let l=typeof a==`string`?r(a):a,u=typeof o==`string`?(0,t.default)(o):o;if(typeof o==`string`&&(o=(0,t.default)(o)),o?.length!==16)throw TypeError(`Namespace must be array-like (16 iterable integer values, 0-255)`);let d=new Uint8Array(16+l.length);if(d.set(u),d.set(l,u.length),d=i(d),d[6]=d[6]&15|e,d[8]=d[8]&63|128,s){if(c||=0,c<0||c+16>s.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let e=0;e<16;++e)s[c+e]=d[e];return s}return(0,n.unsafeStringify)(d)}e.default=i})),Aa=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.URL=e.DNS=void 0;var t=Oa(),n=ka(),r=ka();Object.defineProperty(e,`DNS`,{enumerable:!0,get:function(){return r.DNS}}),Object.defineProperty(e,`URL`,{enumerable:!0,get:function(){return r.URL}});function i(e,r,i,a){return(0,n.default)(48,t.default,e,r,i,a)}i.DNS=n.DNS,i.URL=n.URL,e.default=i})),ja=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)}})),Ma=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=ja(),n=Ta(),r=wa();function i(e,i,a){if(t.default.randomUUID&&!i&&!e)return t.default.randomUUID();e||={};let o=e.random??e.rng?.()??(0,n.default)();if(o.length<16)throw Error(`Random bytes length must be >= 16`);if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,i){if(a||=0,a<0||a+16>i.length)throw RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`);for(let e=0;e<16;++e)i[a+e]=o[e];return i}return(0,r.unsafeStringify)(o)}e.default=i})),Na=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});function t(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:return t^n^r;case 2:return t&n^t&r^n&r;case 3:return t^n^r}}function n(e,t){return e<<t|e>>>32-t}function r(e){let r=[1518500249,1859775393,2400959708,3395469782],i=[1732584193,4023233417,2562383102,271733878,3285377520],a=new Uint8Array(e.length+1);a.set(e),a[e.length]=128,e=a;let o=e.length/4+2,s=Math.ceil(o/16),c=Array(s);for(let t=0;t<s;++t){let n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=e[t*64+r*4]<<24|e[t*64+r*4+1]<<16|e[t*64+r*4+2]<<8|e[t*64+r*4+3];c[t]=n}c[s-1][14]=(e.length-1)*8/2**32,c[s-1][14]=Math.floor(c[s-1][14]),c[s-1][15]=(e.length-1)*8&4294967295;for(let e=0;e<s;++e){let a=new Uint32Array(80);for(let t=0;t<16;++t)a[t]=c[e][t];for(let e=16;e<80;++e)a[e]=n(a[e-3]^a[e-8]^a[e-14]^a[e-16],1);let o=i[0],s=i[1],l=i[2],u=i[3],d=i[4];for(let e=0;e<80;++e){let i=Math.floor(e/20),c=n(o,5)+t(i,s,l,u)+d+r[i]+a[e]>>>0;d=u,u=l,l=n(s,30)>>>0,s=o,o=c}i[0]=i[0]+o>>>0,i[1]=i[1]+s>>>0,i[2]=i[2]+l>>>0,i[3]=i[3]+u>>>0,i[4]=i[4]+d>>>0}return Uint8Array.of(i[0]>>24,i[0]>>16,i[0]>>8,i[0],i[1]>>24,i[1]>>16,i[1]>>8,i[1],i[2]>>24,i[2]>>16,i[2]>>8,i[2],i[3]>>24,i[3]>>16,i[3]>>8,i[3],i[4]>>24,i[4]>>16,i[4]>>8,i[4])}e.default=r})),Pa=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.URL=e.DNS=void 0;var t=Na(),n=ka(),r=ka();Object.defineProperty(e,`DNS`,{enumerable:!0,get:function(){return r.DNS}}),Object.defineProperty(e,`URL`,{enumerable:!0,get:function(){return r.URL}});function i(e,r,i,a){return(0,n.default)(80,t.default,e,r,i,a)}i.DNS=n.DNS,i.URL=n.URL,e.default=i})),Fa=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=wa(),n=Ea(),r=Da();function i(e,i,a){e??={},a??=0;let o=(0,n.default)({...e,_v6:!0},new Uint8Array(16));if(o=(0,r.default)(o),i){if(a<0||a+16>i.length)throw RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`);for(let e=0;e<16;e++)i[a+e]=o[e];return i}return(0,t.unsafeStringify)(o)}e.default=i})),Ia=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Ca(),n=wa();function r(e){let r=i(typeof e==`string`?(0,t.default)(e):e);return typeof e==`string`?(0,n.unsafeStringify)(r):r}e.default=r;function i(e){return Uint8Array.of((e[3]&15)<<4|e[4]>>4&15,(e[4]&15)<<4|(e[5]&240)>>4,(e[5]&15)<<4|e[6]&15,e[7],(e[1]&15)<<4|(e[2]&240)>>4,(e[2]&15)<<4|(e[3]&240)>>4,16|(e[0]&240)>>4,(e[0]&15)<<4|(e[1]&240)>>4,e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}})),La=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.updateV7State=void 0;var t=Ta(),n=wa(),r={};function i(e,i,s){let c;if(e)c=o(e.random??e.rng?.()??(0,t.default)(),e.msecs,e.seq,i,s);else{let e=Date.now(),n=(0,t.default)();a(r,e,n),c=o(n,r.msecs,r.seq,i,s)}return i??(0,n.unsafeStringify)(c)}function a(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=n[6]<<23|n[7]<<16|n[8]<<8|n[9],e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}e.updateV7State=a;function o(e,t,n,r,i=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),n??=e[6]*127<<24|e[7]<<16|e[8]<<8|e[9],r[i++]=t/1099511627776&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=t&255,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|e[10]&3,r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}e.default=i})),Ra=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Sa();function n(e){if(!(0,t.default)(e))throw TypeError(`Invalid UUID`);return parseInt(e.slice(14,15),16)}e.default=n})),za=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.version=e.validate=e.v7=e.v6ToV1=e.v6=e.v5=e.v4=e.v3=e.v1ToV6=e.v1=e.stringify=e.parse=e.NIL=e.MAX=void 0;var t=ya();Object.defineProperty(e,`MAX`,{enumerable:!0,get:function(){return t.default}});var n=ba();Object.defineProperty(e,`NIL`,{enumerable:!0,get:function(){return n.default}});var r=Ca();Object.defineProperty(e,`parse`,{enumerable:!0,get:function(){return r.default}});var i=wa();Object.defineProperty(e,`stringify`,{enumerable:!0,get:function(){return i.default}});var a=Ea();Object.defineProperty(e,`v1`,{enumerable:!0,get:function(){return a.default}});var o=Da();Object.defineProperty(e,`v1ToV6`,{enumerable:!0,get:function(){return o.default}});var s=Aa();Object.defineProperty(e,`v3`,{enumerable:!0,get:function(){return s.default}});var c=Ma();Object.defineProperty(e,`v4`,{enumerable:!0,get:function(){return c.default}});var l=Pa();Object.defineProperty(e,`v5`,{enumerable:!0,get:function(){return l.default}});var u=Fa();Object.defineProperty(e,`v6`,{enumerable:!0,get:function(){return u.default}});var d=Ia();Object.defineProperty(e,`v6ToV1`,{enumerable:!0,get:function(){return d.default}});var f=La();Object.defineProperty(e,`v7`,{enumerable:!0,get:function(){return f.default}});var p=Sa();Object.defineProperty(e,`validate`,{enumerable:!0,get:function(){return p.default}});var m=Ra();Object.defineProperty(e,`version`,{enumerable:!0,get:function(){return m.default}})})),Ba=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},n=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.BitcoinProvider=e.Keplr=e.EthereumProviderRpcError=void 0;var r=fa(),i=ma(),a=n(Vn()),o=n(G()),s=ha(),c=ga(),l=_a(),u=n(M()),d=va(),f=za(),p=class e extends Error{constructor(t,n,r){super(n),this.code=t,this.data=r,Object.setPrototypeOf(this,e.prototype)}};e.EthereumProviderRpcError=p,e.Keplr=class e{constructor(){this.enigmaUtils=new Map,this.version=l.BUILD_VERSION,this.mode=`extension`,this.defaultOptions={},this.ethereum=new h(this),this.starknet=void 0,this.bitcoin=new g(this)}static staticRequestMethod(e,t){let n=`ReactNativeWebView`in window,r=n?e=>{window.ReactNativeWebView.postMessage(JSON.stringify(e))}:e=>{window.postMessage(e,window.location.origin)},a=n?e=>{if(e&&typeof e==`string`)try{return JSON.parse(e)}catch{}return e}:e=>e,o=new Uint8Array(8),s=Array.from(crypto.getRandomValues(o)).map(e=>e.toString(16)).join(``),c={type:window.keplrRequestMetaIdSupport?`proxy-request${d.metaId?`-${d.metaId}`:``}`:`proxy-request`,id:s,method:e,args:i.JSONUint8Array.wrap(t)};return new Promise((e,t)=>{let n=r=>{let o=a(r.data);if(!o||o.type!==`proxy-request-response`||o.id!==s)return;window.removeEventListener(`message`,n);let c=i.JSONUint8Array.unwrap(o.result);if(!c){t(Error(`Result is null`));return}if(c.error){t(Error(c.error));return}e(c.return)};window.addEventListener(`message`,n),r(c)})}requestMethod(t,n){return e.staticRequestMethod(t,n)}static getKeplr(n=1500){return t(this,void 0,void 0,function*(){yield m();let t=`ReactNativeWebView`in window,r=typeof navigator<`u`&&`userAgent`in navigator?navigator.userAgent.includes(`Firefox`):!1;if(!(!t&&!r&&window.keplrRequestMetaIdSupport==null))return new Promise((t,r)=>{let i=setTimeout(()=>{t(void 0)},n);e.staticRequestMethod(`ping`,[]).then(()=>{clearTimeout(i),t(new e)}).catch(n=>{(n?.message)?.includes(`Invalid method: ping`)?(clearTimeout(i),t(new e)):r(n)})})})}ping(){return t(this,void 0,void 0,function*(){yield this.requestMethod(`ping`,[])})}enable(e){return t(this,void 0,void 0,function*(){yield this.requestMethod(`enable`,[e])})}disable(e){return t(this,void 0,void 0,function*(){yield this.requestMethod(`disable`,[e])})}experimentalSuggestChain(e){return t(this,void 0,void 0,function*(){if(e.hideInUI)throw Error(`hideInUI is not allowed`);e.features?.includes(`stargate`)||e.features?.includes(`no-legacy-stdTx`),yield this.requestMethod(`experimentalSuggestChain`,[e])})}getKey(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getKey`,[e])})}getKeysSettled(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getKeysSettled`,[e])})}sendTx(e,n,r){return t(this,void 0,void 0,function*(){return`length`in n,yield this.requestMethod(`sendTx`,[e,n,r])})}signAmino(e,n,r,i={}){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signAmino`,[e,n,r,(0,a.default)(this.defaultOptions.sign??{},i)])})}signDirect(e,n,r,i={}){return t(this,void 0,void 0,function*(){let t=yield this.requestMethod(`signDirect`,[e,n,{bodyBytes:r.bodyBytes,authInfoBytes:r.authInfoBytes,chainId:r.chainId,accountNumber:r.accountNumber?r.accountNumber.toString():null},(0,a.default)(this.defaultOptions.sign??{},i)]),s=t.signed;return{signed:{bodyBytes:s.bodyBytes,authInfoBytes:s.authInfoBytes,chainId:s.chainId,accountNumber:o.default.fromString(s.accountNumber)},signature:t.signature}})}signDirectAux(e,n,r,i={}){return t(this,void 0,void 0,function*(){let t=yield this.requestMethod(`signDirectAux`,[e,n,{bodyBytes:r.bodyBytes,publicKey:r.publicKey,chainId:r.chainId,accountNumber:r.accountNumber?r.accountNumber.toString():null,sequence:r.sequence?r.sequence.toString():null},(0,a.default)({preferNoSetMemo:this.defaultOptions.sign?.preferNoSetMemo},i)]),s=t.signed;return{signed:{bodyBytes:s.bodyBytes,publicKey:s.publicKey||void 0,chainId:s.chainId,accountNumber:o.default.fromString(s.accountNumber),sequence:o.default.fromString(s.sequence)},signature:t.signature}})}signArbitrary(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signArbitrary`,[e,n,r])})}signICNSAdr36(e,t,n,r,i){return this.requestMethod(`signICNSAdr36`,[e,t,n,r,i])}verifyArbitrary(e,n,r,i){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`verifyArbitrary`,[e,n,r,i])})}signEthereum(e,n,r,i){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signEthereum`,[e,n,r,i])})}getOfflineSigner(e,t){return new s.CosmJSOfflineSigner(e,this,t)}getOfflineSignerOnlyAmino(e,t){return new s.CosmJSOfflineSignerOnlyAmino(e,this,t)}getOfflineSignerAuto(e,n){return t(this,void 0,void 0,function*(){return(yield this.getKey(e)).isNanoLedger?new s.CosmJSOfflineSignerOnlyAmino(e,this,n):new s.CosmJSOfflineSigner(e,this,n)})}suggestToken(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`suggestToken`,[e,n,r])})}getSecret20ViewingKey(e,n){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getSecret20ViewingKey`,[e,n])})}getEnigmaPubKey(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getEnigmaPubKey`,[e])})}getEnigmaTxEncryptionKey(e,n){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getEnigmaTxEncryptionKey`,[e,n])})}enigmaEncrypt(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`enigmaEncrypt`,[e,n,r])})}enigmaDecrypt(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`enigmaDecrypt`,[e,n,r])})}getEnigmaUtils(e){if(this.enigmaUtils.has(e))return this.enigmaUtils.get(e);let t=new c.KeplrEnigmaUtils(e,this);return this.enigmaUtils.set(e,t),t}experimentalSignEIP712CosmosTx_v0(e,n,r,i,o={}){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`experimentalSignEIP712CosmosTx_v0`,[e,n,r,i,(0,a.default)(this.defaultOptions.sign??{},o)])})}getChainInfosWithoutEndpoints(){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getChainInfosWithoutEndpoints`,[])})}changeKeyRingName({defaultName:e,editable:n=!0}){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`changeKeyRingName`,[{defaultName:e,editable:n}])})}sendEthereumTx(e,n){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`sendEthereumTx`,[e,n])})}suggestERC20(e,n){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`suggestERC20`,[e,n])})}getChainInfoWithoutEndpoints(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getChainInfoWithoutEndpoints`,[e])})}getStarknetKey(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getStarknetKey`,[e])})}getStarknetKeysSettled(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getStarknetKeysSettled`,[e])})}signStarknetTx(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signStarknetTx`,[e,n,r])})}signStarknetDeployAccountTransaction(e,n){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signStarknetDeployAccountTransaction`,[e,n])})}getBitcoinKey(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getBitcoinKey`,[e])})}getBitcoinKeysSettled(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getBitcoinKeysSettled`,[e])})}signPsbt(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signPsbt`,[e,n,r])})}signPsbts(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signPsbts`,[e,n,r])})}__core__getAnalyticsId(){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`__core__getAnalyticsId`,[])})}__core__privilageSignAminoWithdrawRewards(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`__core__privilageSignAminoWithdrawRewards`,[e,n,r])})}__core__privilageSignAminoDelegate(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`__core__privilageSignAminoDelegate`,[e,n,r])})}__core__privilageSignAminoExecuteCosmWasm(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`__core__privilageSignAminoExecuteCosmWasm`,[e,n,r])})}__core__webpageClosed(){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`__core__webpageClosed`,[])})}};var m=()=>document.readyState===`complete`?Promise.resolve():new Promise(e=>{let t=n=>{n.target&&n.target.readyState===`complete`&&(e(),document.removeEventListener(`readystatechange`,t))};document.addEventListener(`readystatechange`,t)}),h=class e extends u.default{constructor(n){if(super(),this.keplr=n,this.eip6963ProviderInfo={uuid:(0,f.v4)(),name:`Keplr`,rdns:`app.keplr`,icon:`data:image/png;base64,${d.KeplrLogoBase64}`},this.chainId=null,this.networkVersion=null,this.selectedAddress=null,this.isKeplr=!0,this.isMetaMask=!0,this._isConnected=!1,this._currentChainId=null,this._initProviderState=()=>t(this,void 0,void 0,function*(){let t=yield e.requestMethod(`request`,{method:`keplr_initProviderState`});if(t){let{currentEvmChainId:e,currentChainId:n,selectedAddress:r}=t;n!=null&&e!=null&&r!=null&&(this._handleConnect(e),this._handleChainChanged(e),this._currentChainId=n,this._handleAccountsChanged(r))}}),this._initProviderState(),window.addEventListener(`keplr_keystorechange`,()=>t(this,void 0,void 0,function*(){if(this._currentChainId&&(yield n.getChainInfoWithoutEndpoints(this._currentChainId))){let e=null;try{e=(yield n.getKey(this._currentChainId)).ethereumHexAddress}catch(e){e?.message.includes(`on Ledger by selecting the chain in the extension`)}this._handleAccountsChanged(e)}})),window.addEventListener(`keplr_chainChanged`,e=>{if(e.detail.origin===window.location.origin){let t=e.detail.evmChainId;this._handleChainChanged(t)}}),window.addEventListener(`keplr_ethSubscription`,e=>{let t=e.detail.origin,n=e.detail.providerId;if(t===window.location.origin&&n===this.eip6963ProviderInfo?.uuid){let t=e.detail.data;this.emit(`message`,{type:`eth_subscription`,data:t})}}),this.eip6963ProviderInfo){let e=new CustomEvent(r.EIP6963EventNames.Announce,{detail:Object.freeze({info:this.eip6963ProviderInfo,provider:this})});window.addEventListener(r.EIP6963EventNames.Request,()=>window.dispatchEvent(e)),window.dispatchEvent(e)}}static requestMethod(e,n){return t(this,void 0,void 0,function*(){let t=`ReactNativeWebView`in window,r=t?e=>{window.ReactNativeWebView.postMessage(JSON.stringify(e))}:e=>{window.postMessage(e,window.location.origin)},a=t?e=>{if(e&&typeof e==`string`)try{return JSON.parse(e)}catch{}return e}:e=>e,o=new Uint8Array(8),s=Array.from(crypto.getRandomValues(o)).map(e=>e.toString(16)).join(``),c={type:window.keplrRequestMetaIdSupport?`proxy-request${d.metaId?`-${d.metaId}`:``}`:`proxy-request`,id:s,method:`ethereum`,args:i.JSONUint8Array.wrap(n),ethereumProviderMethod:e};return new Promise((e,t)=>{let n=r=>{let o=a(r.data);if(!o||o.type!==`proxy-request-response`||o.id!==s)return;window.removeEventListener(`message`,n);let c=i.JSONUint8Array.unwrap(o.result);if(!c){t(Error(`Result is null`));return}if(c.error){let e=c.error;t(e.code&&!e.module?new p(e.code,e.message,e.data):Error(e));return}e(c.return)};window.addEventListener(`message`,n),r(c)})})}_handleConnect(e){return t(this,void 0,void 0,function*(){if(!this._isConnected){this._isConnected=!0;let t=`0x${e.toString(16)}`;this.emit(`connect`,{chainId:t})}})}_handleDisconnect(){return t(this,void 0,void 0,function*(){this._isConnected&&(yield e.requestMethod(`request`,{method:`keplr_disconnect`}),this._isConnected=!1,this.chainId=null,this.selectedAddress=null,this.networkVersion=null,this.emit(`disconnect`))})}_handleChainChanged(e){return t(this,void 0,void 0,function*(){let t=`0x${e.toString(16)}`;t!==this.chainId&&(this.chainId=t,this.networkVersion=e.toString(10),this.emit(`chainChanged`,t))})}_handleAccountsChanged(e){return t(this,void 0,void 0,function*(){this.selectedAddress!==e&&(this.selectedAddress=e,e?this.emit(`accountsChanged`,[e]):this.emit(`accountsChanged`,[]))})}isConnected(){return this._isConnected}request({method:n,params:r,chainId:i}){return t(this,void 0,void 0,function*(){if(typeof n!=`string`)throw Error("Invalid paramater: `method` must be a string");return this._isConnected||(yield this._initProviderState()),yield e.requestMethod(`request`,{method:n,params:r,providerId:this.eip6963ProviderInfo?.uuid,chainId:i})})}enable(){return t(this,void 0,void 0,function*(){return yield e.requestMethod(`request`,{method:`eth_requestAccounts`})})}net_version(){return t(this,void 0,void 0,function*(){return yield e.requestMethod(`request`,{method:`net_version`})})}},g=class e extends u.default{constructor(e){super(),this.keplr=e,this._handleNetworkChanged=e=>t(this,void 0,void 0,function*(){this.emit(`networkChanged`,e)}),this._handleAccountsChanged=e=>t(this,void 0,void 0,function*(){e&&e.length>0?(this.emit(`accountChanged`,e),this.emit(`accountsChanged`,e)):(this.emit(`accountChanged`,[``]),this.emit(`accountsChanged`,[``]))}),window.addEventListener(`keplr_keystorechange`,()=>t(this,void 0,void 0,function*(){let e=null;try{e=yield this.getAccounts()}catch(e){e?.message.includes(`on Ledger by selecting the chain in the extension`)}this._handleAccountsChanged(e)})),window.addEventListener(`keplr_bitcoinChainChanged`,e=>t(this,void 0,void 0,function*(){if(e.detail.origin===window.location.origin){let t=e.detail.network,n=null;try{n=yield this.getAccounts()}catch(e){e?.message.includes(`on Ledger by selecting the chain in the extension`)}this._handleNetworkChanged(t),this._handleAccountsChanged(n)}})),window.addEventListener(`keplr_bitcoinAccountsChanged`,()=>t(this,void 0,void 0,function*(){let e=null;try{e=yield this.getAccounts()}catch(e){e?.message.includes(`on Ledger by selecting the chain in the extension`)}this._handleAccountsChanged(e)}))}static _requestMethod(e,n){return t(this,void 0,void 0,function*(){let t=`ReactNativeWebView`in window,r=t?e=>{window.ReactNativeWebView.postMessage(JSON.stringify(e))}:e=>{window.postMessage(e,window.location.origin)},a=t?e=>{if(e&&typeof e==`string`)try{return JSON.parse(e)}catch{}return e}:e=>e,o=new Uint8Array(8),s=Array.from(crypto.getRandomValues(o)).map(e=>e.toString(16)).join(``),c={type:window.keplrRequestMetaIdSupport?`proxy-request${d.metaId?`-${d.metaId}`:``}`:`proxy-request`,id:s,method:`bitcoin`,args:i.JSONUint8Array.wrap(n),bitcoinProviderMethod:e};return new Promise((e,t)=>{let n=r=>{let o=a(r.data);if(!o||o.type!==`proxy-request-response`||o.id!==s)return;window.removeEventListener(`message`,n);let c=i.JSONUint8Array.unwrap(o.result);if(!c){t(Error(`Result is null`));return}if(c.error){t(Error(c.error));return}e(c.return)};window.addEventListener(`message`,n),r(c)})})}getAccounts(){return e._requestMethod(`getAccounts`,[])}requestAccounts(){return t(this,void 0,void 0,function*(){return e._requestMethod(`requestAccounts`,[])})}disconnect(){return t(this,void 0,void 0,function*(){return e._requestMethod(`disconnect`,[])})}getNetwork(){return t(this,void 0,void 0,function*(){return e._requestMethod(`getNetwork`,[])})}switchNetwork(n){return t(this,void 0,void 0,function*(){return e._requestMethod(`switchNetwork`,[n])})}getChain(){return t(this,void 0,void 0,function*(){return e._requestMethod(`getChain`,[])})}switchChain(n){return t(this,void 0,void 0,function*(){return e._requestMethod(`switchChain`,[n])})}getPublicKey(){return t(this,void 0,void 0,function*(){return e._requestMethod(`getPublicKey`,[])})}getBalance(){return t(this,void 0,void 0,function*(){return e._requestMethod(`getBalance`,[])})}getInscriptions(n,r){return t(this,void 0,void 0,function*(){return e._requestMethod(`getInscriptions`,[n,r])})}signMessage(n,r){return t(this,void 0,void 0,function*(){return e._requestMethod(`signMessage`,[n,r])})}sendBitcoin(n,r){return t(this,void 0,void 0,function*(){return e._requestMethod(`sendBitcoin`,[n,r])})}pushTx(n){return t(this,void 0,void 0,function*(){return e._requestMethod(`pushTx`,[n])})}pushPsbt(n){return t(this,void 0,void 0,function*(){return e._requestMethod(`pushPsbt`,[n])})}signPsbt(n,r){return t(this,void 0,void 0,function*(){return e._requestMethod(`signPsbt`,[n,r])})}signPsbts(n,r){return t(this,void 0,void 0,function*(){return e._requestMethod(`signPsbts`,[n,r])})}getAddress(){return t(this,void 0,void 0,function*(){return(yield this.getAccounts())[0]})}connectWallet(){return t(this,void 0,void 0,function*(){return this.requestAccounts()})}};e.BitcoinProvider=g})),Va=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.KeplrFallback=void 0;var n=Ba();e.KeplrFallback=class extends n.Keplr{constructor(e){super(),this.onKeplrNotDetected=e,this.isKeplrDetected=null,this.onKeplrNotDetected&&n.Keplr.getKeplr(500).then(e=>{var t;e||(t=this.onKeplrNotDetected)==null||t.call(this)})}requestMethod(e,r){return t(this,void 0,void 0,function*(){if(this.isKeplrDetected??((yield n.Keplr.getKeplr(500))?this.isKeplrDetected=!0:this.isKeplrDetected=!1),this.isKeplrDetected)return n.Keplr.staticRequestMethod(e,r);{let t=window.keplr;if(t)return t[e](...r);throw Error(`Can't detect keplr fallback`)}})}}})),Ha=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(Ba(),e),n(Va(),e)})),Ua=a(((e,t)=>{var n=(function(e){var t=1e7,r=7,i=9007199254740992,a=p(i),o=`0123456789abcdefghijklmnopqrstuvwxyz`,s=typeof BigInt==`function`;function c(e,t,n,r){return e===void 0?c[0]:t===void 0||+t==10&&!n?B(e):fe(e,t,n,r)}function l(e,t){this.value=e,this.sign=t,this.isSmall=!1}l.prototype=Object.create(c.prototype);function u(e){this.value=e,this.sign=e<0,this.isSmall=!0}u.prototype=Object.create(c.prototype);function d(e){this.value=e}d.prototype=Object.create(c.prototype);function f(e){return-i<e&&e<i}function p(e){return e<1e7?[e]:e<0x5af3107a4000?[e%1e7,Math.floor(e/1e7)]:[e%1e7,Math.floor(e/1e7)%1e7,Math.floor(e/0x5af3107a4000)]}function m(e){h(e);var n=e.length;if(n<4&&F(e,a)<0)switch(n){case 0:return 0;case 1:return e[0];case 2:return e[0]+e[1]*t;default:return e[0]+(e[1]+e[2]*t)*t}return e}function h(e){for(var t=e.length;e[--t]===0;);e.length=t+1}function g(e){for(var t=Array(e),n=-1;++n<e;)t[n]=0;return t}function _(e){return e>0?Math.floor(e):Math.ceil(e)}function v(e,n){var r=e.length,i=n.length,a=Array(r),o=0,s=t,c,l;for(l=0;l<i;l++)c=e[l]+n[l]+o,o=+(c>=s),a[l]=c-o*s;for(;l<r;)c=e[l]+o,o=+(c===s),a[l++]=c-o*s;return o>0&&a.push(o),a}function y(e,t){return e.length>=t.length?v(e,t):v(t,e)}function b(e,n){var r=e.length,i=Array(r),a=t,o,s;for(s=0;s<r;s++)o=e[s]-a+n,n=Math.floor(o/a),i[s]=o-n*a,n+=1;for(;n>0;)i[s++]=n%a,n=Math.floor(n/a);return i}l.prototype.add=function(e){var t=B(e);if(this.sign!==t.sign)return this.subtract(t.negate());var n=this.value,r=t.value;return t.isSmall?new l(b(n,Math.abs(r)),this.sign):new l(y(n,r),this.sign)},l.prototype.plus=l.prototype.add,u.prototype.add=function(e){var t=B(e),n=this.value;if(n<0!==t.sign)return this.subtract(t.negate());var r=t.value;if(t.isSmall){if(f(n+r))return new u(n+r);r=p(Math.abs(r))}return new l(b(r,Math.abs(n)),n<0)},u.prototype.plus=u.prototype.add,d.prototype.add=function(e){return new d(this.value+B(e).value)},d.prototype.plus=d.prototype.add;function x(e,n){var r=e.length,i=n.length,a=Array(r),o=0,s=t,c,l;for(c=0;c<i;c++)l=e[c]-o-n[c],l<0?(l+=s,o=1):o=0,a[c]=l;for(c=i;c<r;c++){if(l=e[c]-o,l<0)l+=s;else{a[c++]=l;break}a[c]=l}for(;c<r;c++)a[c]=e[c];return h(a),a}function S(e,t,n){var r;return F(e,t)>=0?r=x(e,t):(r=x(t,e),n=!n),r=m(r),typeof r==`number`?(n&&(r=-r),new u(r)):new l(r,n)}function C(e,n,r){var i=e.length,a=Array(i),o=-n,s=t,c,d;for(c=0;c<i;c++)d=e[c]+o,o=Math.floor(d/s),d%=s,a[c]=d<0?d+s:d;return a=m(a),typeof a==`number`?(r&&(a=-a),new u(a)):new l(a,r)}l.prototype.subtract=function(e){var t=B(e);if(this.sign!==t.sign)return this.add(t.negate());var n=this.value,r=t.value;return t.isSmall?C(n,Math.abs(r),this.sign):S(n,r,this.sign)},l.prototype.minus=l.prototype.subtract,u.prototype.subtract=function(e){var t=B(e),n=this.value;if(n<0!==t.sign)return this.add(t.negate());var r=t.value;return t.isSmall?new u(n-r):C(r,Math.abs(n),n>=0)},u.prototype.minus=u.prototype.subtract,d.prototype.subtract=function(e){return new d(this.value-B(e).value)},d.prototype.minus=d.prototype.subtract,l.prototype.negate=function(){return new l(this.value,!this.sign)},u.prototype.negate=function(){var e=this.sign,t=new u(-this.value);return t.sign=!e,t},d.prototype.negate=function(){return new d(-this.value)},l.prototype.abs=function(){return new l(this.value,!1)},u.prototype.abs=function(){return new u(Math.abs(this.value))},d.prototype.abs=function(){return new d(this.value>=0?this.value:-this.value)};function w(e,n){var r=e.length,i=n.length,a=g(r+i),o=t,s,c,l,u,d;for(l=0;l<r;++l){u=e[l];for(var f=0;f<i;++f)d=n[f],s=u*d+a[l+f],c=Math.floor(s/o),a[l+f]=s-c*o,a[l+f+1]+=c}return h(a),a}function T(e,n){var r=e.length,i=Array(r),a=t,o=0,s,c;for(c=0;c<r;c++)s=e[c]*n+o,o=Math.floor(s/a),i[c]=s-o*a;for(;o>0;)i[c++]=o%a,o=Math.floor(o/a);return i}function E(e,t){for(var n=[];t-- >0;)n.push(0);return n.concat(e)}function D(e,t){var n=Math.max(e.length,t.length);if(n<=30)return w(e,t);n=Math.ceil(n/2);var r=e.slice(n),i=e.slice(0,n),a=t.slice(n),o=t.slice(0,n),s=D(i,o),c=D(r,a),l=y(y(s,E(x(x(D(y(i,r),y(o,a)),s),c),n)),E(c,2*n));return h(l),l}function O(e,t){return-.012*e-.012*t+15e-6*e*t>0}l.prototype.multiply=function(e){var n=B(e),r=this.value,i=n.value,a=this.sign!==n.sign,o;if(n.isSmall){if(i===0)return c[0];if(i===1)return this;if(i===-1)return this.negate();if(o=Math.abs(i),o<t)return new l(T(r,o),a);i=p(o)}return O(r.length,i.length)?new l(D(r,i),a):new l(w(r,i),a)},l.prototype.times=l.prototype.multiply;function k(e,n,r){return e<t?new l(T(n,e),r):new l(w(n,p(e)),r)}u.prototype._multiplyBySmall=function(e){return f(e.value*this.value)?new u(e.value*this.value):k(Math.abs(e.value),p(Math.abs(this.value)),this.sign!==e.sign)},l.prototype._multiplyBySmall=function(e){return e.value===0?c[0]:e.value===1?this:e.value===-1?this.negate():k(Math.abs(e.value),this.value,this.sign!==e.sign)},u.prototype.multiply=function(e){return B(e)._multiplyBySmall(this)},u.prototype.times=u.prototype.multiply,d.prototype.multiply=function(e){return new d(this.value*B(e).value)},d.prototype.times=d.prototype.multiply;function A(e){var n=e.length,r=g(n+n),i=t,a,o,s,c,l;for(s=0;s<n;s++){c=e[s],o=0-c*c;for(var u=s;u<n;u++)l=e[u],a=c*l*2+r[s+u]+o,o=Math.floor(a/i),r[s+u]=a-o*i;r[s+n]=o}return h(r),r}l.prototype.square=function(){return new l(A(this.value),!1)},u.prototype.square=function(){var e=this.value*this.value;return f(e)?new u(e):new l(A(p(Math.abs(this.value))),!1)},d.prototype.square=function(e){return new d(this.value*this.value)};function j(e,n){var r=e.length,i=n.length,a=t,o=g(n.length),s=n[i-1],c=Math.ceil(a/(2*s)),l=T(e,c),u=T(n,c),d,f,p,h,_,v,y;for(l.length<=r&&l.push(0),u.push(0),s=u[i-1],f=r-i;f>=0;f--){for(d=a-1,l[f+i]!==s&&(d=Math.floor((l[f+i]*a+l[f+i-1])/s)),p=0,h=0,v=u.length,_=0;_<v;_++)p+=d*u[_],y=Math.floor(p/a),h+=l[f+_]-(p-y*a),p=y,h<0?(l[f+_]=h+a,h=-1):(l[f+_]=h,h=0);for(;h!==0;){for(--d,p=0,_=0;_<v;_++)p+=l[f+_]-a+u[_],p<0?(l[f+_]=p+a,p=0):(l[f+_]=p,p=1);h+=p}o[f]=d}return l=N(l,c)[0],[m(o),m(l)]}function M(e,n){for(var r=e.length,i=n.length,a=[],o=[],s=t,c,l,u,d,f;r;){if(o.unshift(e[--r]),h(o),F(o,n)<0){a.push(0);continue}l=o.length,u=o[l-1]*s+o[l-2],d=n[i-1]*s+n[i-2],l>i&&(u=(u+1)*s),c=Math.ceil(u/d);do{if(f=T(n,c),F(f,o)<=0)break;c--}while(c);a.push(c),o=x(o,f)}return a.reverse(),[m(a),m(o)]}function N(e,n){var r=e.length,i=g(r),a=t,o,s,c=0,l;for(o=r-1;o>=0;--o)l=c*a+e[o],s=_(l/n),c=l-s*n,i[o]=s|0;return[i,c|0]}function P(e,n){var r,i=B(n);if(s)return[new d(e.value/i.value),new d(e.value%i.value)];var a=e.value,o=i.value,f;if(o===0)throw Error(`Cannot divide by zero`);if(e.isSmall)return i.isSmall?[new u(_(a/o)),new u(a%o)]:[c[0],e];if(i.isSmall){if(o===1)return[e,c[0]];if(o==-1)return[e.negate(),c[0]];var h=Math.abs(o);if(h<t){r=N(a,h),f=m(r[0]);var g=r[1];return e.sign&&(g=-g),typeof f==`number`?(e.sign!==i.sign&&(f=-f),[new u(f),new u(g)]):[new l(f,e.sign!==i.sign),new u(g)]}o=p(h)}var v=F(a,o);if(v===-1)return[c[0],e];if(v===0)return[c[e.sign===i.sign?1:-1],c[0]];r=a.length+o.length<=200?j(a,o):M(a,o),f=r[0];var y=e.sign!==i.sign,b=r[1],x=e.sign;return typeof f==`number`?(y&&(f=-f),f=new u(f)):f=new l(f,y),typeof b==`number`?(x&&(b=-b),b=new u(b)):b=new l(b,x),[f,b]}l.prototype.divmod=function(e){var t=P(this,e);return{quotient:t[0],remainder:t[1]}},d.prototype.divmod=u.prototype.divmod=l.prototype.divmod,l.prototype.divide=function(e){return P(this,e)[0]},d.prototype.over=d.prototype.divide=function(e){return new d(this.value/B(e).value)},u.prototype.over=u.prototype.divide=l.prototype.over=l.prototype.divide,l.prototype.mod=function(e){return P(this,e)[1]},d.prototype.mod=d.prototype.remainder=function(e){return new d(this.value%B(e).value)},u.prototype.remainder=u.prototype.mod=l.prototype.remainder=l.prototype.mod,l.prototype.pow=function(e){var t=B(e),n=this.value,r=t.value,i,a,o;if(r===0)return c[1];if(n===0)return c[0];if(n===1)return c[1];if(n===-1)return t.isEven()?c[1]:c[-1];if(t.sign)return c[0];if(!t.isSmall)throw Error(`The exponent `+t.toString()+` is too large.`);if(this.isSmall&&f(i=n**+r))return new u(_(i));for(a=this,o=c[1];r&!0&&(o=o.times(a),--r),r!==0;)r/=2,a=a.square();return o},u.prototype.pow=l.prototype.pow,d.prototype.pow=function(e){var t=B(e),n=this.value,r=t.value,i=BigInt(0),a=BigInt(1),o=BigInt(2);if(r===i)return c[1];if(n===i)return c[0];if(n===a)return c[1];if(n===BigInt(-1))return t.isEven()?c[1]:c[-1];if(t.isNegative())return new d(i);for(var s=this,l=c[1];(r&a)===a&&(l=l.times(s),--r),r!==i;)r/=o,s=s.square();return l},l.prototype.modPow=function(e,t){if(e=B(e),t=B(t),t.isZero())throw Error(`Cannot take modPow with modulus 0`);var n=c[1],r=this.mod(t);for(e.isNegative()&&(e=e.multiply(c[-1]),r=r.modInv(t));e.isPositive();){if(r.isZero())return c[0];e.isOdd()&&(n=n.multiply(r).mod(t)),e=e.divide(2),r=r.square().mod(t)}return n},d.prototype.modPow=u.prototype.modPow=l.prototype.modPow;function F(e,t){if(e.length!==t.length)return e.length>t.length?1:-1;for(var n=e.length-1;n>=0;n--)if(e[n]!==t[n])return e[n]>t[n]?1:-1;return 0}l.prototype.compareAbs=function(e){var t=B(e),n=this.value,r=t.value;return t.isSmall?1:F(n,r)},u.prototype.compareAbs=function(e){var t=B(e),n=Math.abs(this.value),r=t.value;return t.isSmall?(r=Math.abs(r),n===r?0:n>r?1:-1):-1},d.prototype.compareAbs=function(e){var t=this.value,n=B(e).value;return t=t>=0?t:-t,n=n>=0?n:-n,t===n?0:t>n?1:-1},l.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=B(e),n=this.value,r=t.value;return this.sign===t.sign?t.isSmall?this.sign?-1:1:F(n,r)*(this.sign?-1:1):t.sign?1:-1},l.prototype.compareTo=l.prototype.compare,u.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=B(e),n=this.value,r=t.value;return t.isSmall?n==r?0:n>r?1:-1:n<0===t.sign?n<0?1:-1:n<0?-1:1},u.prototype.compareTo=u.prototype.compare,d.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=this.value,n=B(e).value;return t===n?0:t>n?1:-1},d.prototype.compareTo=d.prototype.compare,l.prototype.equals=function(e){return this.compare(e)===0},d.prototype.eq=d.prototype.equals=u.prototype.eq=u.prototype.equals=l.prototype.eq=l.prototype.equals,l.prototype.notEquals=function(e){return this.compare(e)!==0},d.prototype.neq=d.prototype.notEquals=u.prototype.neq=u.prototype.notEquals=l.prototype.neq=l.prototype.notEquals,l.prototype.greater=function(e){return this.compare(e)>0},d.prototype.gt=d.prototype.greater=u.prototype.gt=u.prototype.greater=l.prototype.gt=l.prototype.greater,l.prototype.lesser=function(e){return this.compare(e)<0},d.prototype.lt=d.prototype.lesser=u.prototype.lt=u.prototype.lesser=l.prototype.lt=l.prototype.lesser,l.prototype.greaterOrEquals=function(e){return this.compare(e)>=0},d.prototype.geq=d.prototype.greaterOrEquals=u.prototype.geq=u.prototype.greaterOrEquals=l.prototype.geq=l.prototype.greaterOrEquals,l.prototype.lesserOrEquals=function(e){return this.compare(e)<=0},d.prototype.leq=d.prototype.lesserOrEquals=u.prototype.leq=u.prototype.lesserOrEquals=l.prototype.leq=l.prototype.lesserOrEquals,l.prototype.isEven=function(){return(this.value[0]&1)==0},u.prototype.isEven=function(){return(this.value&1)==0},d.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},l.prototype.isOdd=function(){return(this.value[0]&1)==1},u.prototype.isOdd=function(){return(this.value&1)==1},d.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},l.prototype.isPositive=function(){return!this.sign},u.prototype.isPositive=function(){return this.value>0},d.prototype.isPositive=u.prototype.isPositive,l.prototype.isNegative=function(){return this.sign},u.prototype.isNegative=function(){return this.value<0},d.prototype.isNegative=u.prototype.isNegative,l.prototype.isUnit=function(){return!1},u.prototype.isUnit=function(){return Math.abs(this.value)===1},d.prototype.isUnit=function(){return this.abs().value===BigInt(1)},l.prototype.isZero=function(){return!1},u.prototype.isZero=function(){return this.value===0},d.prototype.isZero=function(){return this.value===BigInt(0)},l.prototype.isDivisibleBy=function(e){var t=B(e);return t.isZero()?!1:t.isUnit()?!0:t.compareAbs(2)===0?this.isEven():this.mod(t).isZero()},d.prototype.isDivisibleBy=u.prototype.isDivisibleBy=l.prototype.isDivisibleBy;function I(e){var t=e.abs();if(t.isUnit())return!1;if(t.equals(2)||t.equals(3)||t.equals(5))return!0;if(t.isEven()||t.isDivisibleBy(3)||t.isDivisibleBy(5))return!1;if(t.lesser(49))return!0}function L(e,t){for(var r=e.prev(),i=r,a=0,o,s,c;i.isEven();)i=i.divide(2),a++;next:for(s=0;s<t.length;s++)if(!e.lesser(t[s])&&(c=n(t[s]).modPow(i,e),!(c.isUnit()||c.equals(r)))){for(o=a-1;o!=0;o--){if(c=c.square().mod(e),c.isUnit())return!1;if(c.equals(r))continue next}return!1}return!0}l.prototype.isPrime=function(t){var r=I(this);if(r!==e)return r;var i=this.abs(),a=i.bitLength();if(a<=64)return L(i,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var o=Math.log(2)*a.toJSNumber(),s=Math.ceil(t===!0?2*o**2:o),c=[],l=0;l<s;l++)c.push(n(l+2));return L(i,c)},d.prototype.isPrime=u.prototype.isPrime=l.prototype.isPrime,l.prototype.isProbablePrime=function(t,r){var i=I(this);if(i!==e)return i;for(var a=this.abs(),o=t===e?5:t,s=[],c=0;c<o;c++)s.push(n.randBetween(2,a.minus(2),r));return L(a,s)},d.prototype.isProbablePrime=u.prototype.isProbablePrime=l.prototype.isProbablePrime,l.prototype.modInv=function(e){for(var t=n.zero,r=n.one,i=B(e),a=this.abs(),o,s,c;!a.isZero();)o=i.divide(a),s=t,c=i,t=r,i=a,r=s.subtract(o.multiply(r)),a=c.subtract(o.multiply(a));if(!i.isUnit())throw Error(this.toString()+` and `+e.toString()+` are not co-prime`);return t.compare(0)===-1&&(t=t.add(e)),this.isNegative()?t.negate():t},d.prototype.modInv=u.prototype.modInv=l.prototype.modInv,l.prototype.next=function(){var e=this.value;return this.sign?C(e,1,this.sign):new l(b(e,1),this.sign)},u.prototype.next=function(){var e=this.value;return e+1<i?new u(e+1):new l(a,!1)},d.prototype.next=function(){return new d(this.value+BigInt(1))},l.prototype.prev=function(){var e=this.value;return this.sign?new l(b(e,1),!0):C(e,1,this.sign)},u.prototype.prev=function(){var e=this.value;return e-1>-i?new u(e-1):new l(a,!0)},d.prototype.prev=function(){return new d(this.value-BigInt(1))};for(var R=[1];2*R[R.length-1]<=t;)R.push(2*R[R.length-1]);var ee=R.length,te=R[ee-1];function ne(e){return Math.abs(e)<=t}l.prototype.shiftLeft=function(e){var t=B(e).toJSNumber();if(!ne(t))throw Error(String(t)+` is too large for shifting.`);if(t<0)return this.shiftRight(-t);var n=this;if(n.isZero())return n;for(;t>=ee;)n=n.multiply(te),t-=ee-1;return n.multiply(R[t])},d.prototype.shiftLeft=u.prototype.shiftLeft=l.prototype.shiftLeft,l.prototype.shiftRight=function(e){var t,n=B(e).toJSNumber();if(!ne(n))throw Error(String(n)+` is too large for shifting.`);if(n<0)return this.shiftLeft(-n);for(var r=this;n>=ee;){if(r.isZero()||r.isNegative()&&r.isUnit())return r;t=P(r,te),r=t[1].isNegative()?t[0].prev():t[0],n-=ee-1}return t=P(r,R[n]),t[1].isNegative()?t[0].prev():t[0]},d.prototype.shiftRight=u.prototype.shiftRight=l.prototype.shiftRight;function re(e,t,r){t=B(t);for(var i=e.isNegative(),a=t.isNegative(),o=i?e.not():e,s=a?t.not():t,c=0,l=0,u=null,d=null,f=[];!o.isZero()||!s.isZero();)u=P(o,te),c=u[1].toJSNumber(),i&&(c=te-1-c),d=P(s,te),l=d[1].toJSNumber(),a&&(l=te-1-l),o=u[0],s=d[0],f.push(r(c,l));for(var p=r(+!!i,+!!a)===0?n(0):n(-1),m=f.length-1;m>=0;--m)p=p.multiply(te).add(n(f[m]));return p}l.prototype.not=function(){return this.negate().prev()},d.prototype.not=u.prototype.not=l.prototype.not,l.prototype.and=function(e){return re(this,e,function(e,t){return e&t})},d.prototype.and=u.prototype.and=l.prototype.and,l.prototype.or=function(e){return re(this,e,function(e,t){return e|t})},d.prototype.or=u.prototype.or=l.prototype.or,l.prototype.xor=function(e){return re(this,e,function(e,t){return e^t})},d.prototype.xor=u.prototype.xor=l.prototype.xor;var ie=1<<30,ae=(t&-t)*(t&-t)|ie;function z(e){var n=e.value,r=typeof n==`number`?n|ie:typeof n==`bigint`?n|BigInt(ie):n[0]+n[1]*t|ae;return r&-r}function oe(e,t){if(t.compareTo(e)<=0){var r=oe(e,t.square(t)),i=r.p,a=r.e,o=i.multiply(t);return o.compareTo(e)<=0?{p:o,e:a*2+1}:{p:i,e:a*2}}return{p:n(1),e:0}}l.prototype.bitLength=function(){var e=this;return e.compareTo(n(0))<0&&(e=e.negate().subtract(n(1))),e.compareTo(n(0))===0?n(0):n(oe(e,n(2)).e).add(n(1))},d.prototype.bitLength=u.prototype.bitLength=l.prototype.bitLength;function se(e,t){return e=B(e),t=B(t),e.greater(t)?e:t}function ce(e,t){return e=B(e),t=B(t),e.lesser(t)?e:t}function le(e,t){if(e=B(e).abs(),t=B(t).abs(),e.equals(t))return e;if(e.isZero())return t;if(t.isZero())return e;for(var n=c[1],r,i;e.isEven()&&t.isEven();)r=ce(z(e),z(t)),e=e.divide(r),t=t.divide(r),n=n.multiply(r);for(;e.isEven();)e=e.divide(z(e));do{for(;t.isEven();)t=t.divide(z(t));e.greater(t)&&(i=t,t=e,e=i),t=t.subtract(e)}while(!t.isZero());return n.isUnit()?e:e.multiply(n)}function ue(e,t){return e=B(e).abs(),t=B(t).abs(),e.divide(le(e,t)).multiply(t)}function de(e,n,r){e=B(e),n=B(n);var i=r||Math.random,a=ce(e,n),o=se(e,n).subtract(a).add(1);if(o.isSmall)return a.add(Math.floor(i()*o));for(var s=he(o,t).value,l=[],u=!0,d=0;d<s.length;d++){var f=u?s[d]+(d+1<s.length?s[d+1]/t:0):t,p=_(i()*f);l.push(p),p<s[d]&&(u=!1)}return a.add(c.fromArray(l,t,!1))}var fe=function(e,t,n,r){n||=o,e=String(e),r||(e=e.toLowerCase(),n=n.toLowerCase());var i=e.length,a,s=Math.abs(t),c={};for(a=0;a<n.length;a++)c[n[a]]=a;for(a=0;a<i;a++){var l=e[a];if(l!==`-`&&l in c&&c[l]>=s){if(l===`1`&&s===1)continue;throw Error(l+` is not a valid digit in base `+t+`.`)}}t=B(t);var u=[],d=e[0]===`-`;for(a=+!!d;a<e.length;a++){var l=e[a];if(l in c)u.push(B(c[l]));else if(l===`<`){var f=a;do a++;while(e[a]!==`>`&&a<e.length);u.push(B(e.slice(f+1,a)))}else throw Error(l+` is not a valid character`)}return pe(u,t,d)};function pe(e,t,n){var r=c[0],i=c[1],a;for(a=e.length-1;a>=0;a--)r=r.add(e[a].times(i)),i=i.times(t);return n?r.negate():r}function me(e,t){return t||=o,e<t.length?t[e]:`<`+e+`>`}function he(e,t){if(t=n(t),t.isZero()){if(e.isZero())return{value:[0],isNegative:!1};throw Error(`Cannot convert nonzero numbers to base 0.`)}if(t.equals(-1)){if(e.isZero())return{value:[0],isNegative:!1};if(e.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-e.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var r=Array.apply(null,Array(e.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return r.unshift([1]),{value:[].concat.apply([],r),isNegative:!1}}var i=!1;if(e.isNegative()&&t.isPositive()&&(i=!0,e=e.abs()),t.isUnit())return e.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(e.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:i};for(var a=[],o=e,s;o.isNegative()||o.compareAbs(t)>=0;){s=o.divmod(t),o=s.quotient;var c=s.remainder;c.isNegative()&&(c=t.minus(c).abs(),o=o.next()),a.push(c.toJSNumber())}return a.push(o.toJSNumber()),{value:a.reverse(),isNegative:i}}function ge(e,t,n){var r=he(e,t);return(r.isNegative?`-`:``)+r.value.map(function(e){return me(e,n)}).join(``)}l.prototype.toArray=function(e){return he(this,e)},u.prototype.toArray=function(e){return he(this,e)},d.prototype.toArray=function(e){return he(this,e)},l.prototype.toString=function(t,n){if(t===e&&(t=10),t!==10||n)return ge(this,t,n);for(var r=this.value,i=r.length,a=String(r[--i]),o=`0000000`,s;--i>=0;)s=String(r[i]),a+=o.slice(s.length)+s;return(this.sign?`-`:``)+a},u.prototype.toString=function(t,n){return t===e&&(t=10),t!=10||n?ge(this,t,n):String(this.value)},d.prototype.toString=u.prototype.toString,d.prototype.toJSON=l.prototype.toJSON=u.prototype.toJSON=function(){return this.toString()},l.prototype.valueOf=function(){return parseInt(this.toString(),10)},l.prototype.toJSNumber=l.prototype.valueOf,u.prototype.valueOf=function(){return this.value},u.prototype.toJSNumber=u.prototype.valueOf,d.prototype.valueOf=d.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};function _e(e){if(f(+e)){var t=+e;if(t===_(t))return s?new d(BigInt(t)):new u(t);throw Error(`Invalid integer: `+e)}var n=e[0]===`-`;n&&(e=e.slice(1));var i=e.split(/e/i);if(i.length>2)throw Error(`Invalid integer: `+i.join(`e`));if(i.length===2){var a=i[1];if(a[0]===`+`&&(a=a.slice(1)),a=+a,a!==_(a)||!f(a))throw Error(`Invalid integer: `+a+` is not a valid exponent.`);var o=i[0],c=o.indexOf(`.`);if(c>=0&&(a-=o.length-c-1,o=o.slice(0,c)+o.slice(c+1)),a<0)throw Error(`Cannot include negative exponent part for integers`);o+=Array(a+1).join(`0`),e=o}if(!/^([0-9][0-9]*)$/.test(e))throw Error(`Invalid integer: `+e);if(s)return new d(BigInt(n?`-`+e:e));for(var p=[],m=e.length,g=r,v=m-g;m>0;)p.push(+e.slice(v,m)),v-=g,v<0&&(v=0),m-=g;return h(p),new l(p,n)}function ve(e){if(s)return new d(BigInt(e));if(f(e)){if(e!==_(e))throw Error(e+` is not an integer.`);return new u(e)}return _e(e.toString())}function B(e){return typeof e==`number`?ve(e):typeof e==`string`?_e(e):typeof e==`bigint`?new d(e):e}for(var ye=0;ye<1e3;ye++)c[ye]=B(ye),ye>0&&(c[-ye]=B(-ye));return c.one=c[1],c.zero=c[0],c.minusOne=c[-1],c.max=se,c.min=ce,c.gcd=le,c.lcm=ue,c.isInstance=function(e){return e instanceof l||e instanceof u||e instanceof d},c.randBetween=de,c.fromArray=function(e,t,n){return pe(e.map(B),B(t||10),n)},c})();t!==void 0&&t.hasOwnProperty(`exports`)&&(t.exports=n),typeof define==`function`&&define.amd&&define(function(){return n})})),Wa=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.exponentDecStringToDecString=e.isExponentDecString=e.isValidDecimalString=e.isValidIntegerString=void 0;var t=/^-?\d+$/,n=/^-?\d+.?\d*$/,r=/^(-?)([\d.]+)e([-+])([\d]+)$/;function i(e){return t.test(e)}e.isValidIntegerString=i;function a(e){return n.test(e)}e.isValidDecimalString=a;function o(e){return r.test(e)}e.isExponentDecString=o;function s(e){let t=``;for(let n=0;n<e;n++)t+=`0`;return t}function c(e){for(;e.length>0&&e[0]===`0`;)e=e.slice(1);return e.length===0||e[0]===`.`?`0`+e:e}function l(e){let t=e.split(r);if(t.length!==6)return e;let n=t[1]===`-`,i=t[2],a=i.indexOf(`.`),o=t[4],l=parseInt(o)*(t[3]===`-`?-1:1);if(a>=0){let e=i.length-a-1;l-=e,i=c(i.replace(`.`,``))}let u=n?`-`:``;if(l<0){if(i.length>-l){let e=i.length+l;return u+(i.slice(0,e)+`.`+i.slice(e))}return u+`0.`+s(-(i.length+l))+i}else return u+i+s(l)}e.exponentDecStringToDecString=l})),Ga=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Uint=e.Int=void 0;var n=t(Ua()),r=Wa(),i=class e{constructor(e){if(typeof e==`number`&&(e=e.toString()),typeof e==`string`){if(!(0,r.isValidIntegerString)(e))if((0,r.isExponentDecString)(e))e=(0,r.exponentDecStringToDecString)(e);else throw Error(`invalid integer: ${e}`);this.int=(0,n.default)(e)}else this.int=(0,n.default)(e);this.checkBitLen()}checkBitLen(){if(this.int.abs().gt(e.maxInt))throw Error(`Integer out of range ${this.int.toString()}`)}toString(){return this.int.toString(10)}isNegative(){return this.int.isNegative()}isPositive(){return this.int.isPositive()}isZero(){return this.int.eq((0,n.default)(0))}equals(e){return this.int.equals(e.int)}gt(e){return this.int.gt(e.int)}gte(e){return this.int.greaterOrEquals(e.int)}lt(e){return this.int.lt(e.int)}lte(e){return this.int.lesserOrEquals(e.int)}abs(){return new e(this.int.abs())}absUInt(){return new a(this.int.abs())}add(t){return new e(this.int.add(t.int))}sub(t){return new e(this.int.subtract(t.int))}mul(t){return new e(this.int.multiply(t.int))}div(t){return new e(this.int.divide(t.int))}mod(t){return new e(this.int.mod(t.int))}neg(){return new e(this.int.negate())}pow(t){return new e(this.int.pow(t.toBigNumber()))}toBigNumber(){return this.int}};e.Int=i,i.maxInt=(0,n.default)(`115792089237316195423570985008687907853269984665640564039457584007913129639935`);var a=class e{constructor(e){if(typeof e==`number`&&(e=e.toString()),typeof e==`string`){if(!(0,r.isValidIntegerString)(e))if((0,r.isExponentDecString)(e))e=(0,r.exponentDecStringToDecString)(e);else throw Error(`invalid integer: ${e}`);this.uint=(0,n.default)(e)}else this.uint=(0,n.default)(e);if(this.uint.isNegative())throw TypeError(`Uint should not be negative`);this.checkBitLen()}checkBitLen(){if(this.uint.abs().bitLength().gt(256))throw Error(`Integer out of range ${this.uint.toString()}`)}toString(){return this.uint.toString(10)}isZero(){return this.uint.eq((0,n.default)(0))}equals(e){return this.uint.equals(e.uint)}gt(e){return this.uint.gt(e.uint)}gte(e){return this.uint.greaterOrEquals(e.uint)}lt(e){return this.uint.lt(e.uint)}lte(e){return this.uint.lesserOrEquals(e.uint)}add(t){return new e(this.uint.add(t.uint))}sub(t){return new e(this.uint.subtract(t.uint))}mul(t){return new e(this.uint.multiply(t.uint))}div(t){return new e(this.uint.divide(t.uint))}mod(t){return new e(this.uint.mod(t.uint))}pow(t){return new e(this.uint.pow(t.toBigNumber()))}toBigNumber(){return this.uint}};e.Uint=a})),Ka=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.integerStringToUSLocaleString=void 0;function t(e){if(e.indexOf(`.`)>=0)throw Error(`${e} is not integer`);if(typeof BigInt<`u`)return BigInt(e).toLocaleString(`en-US`);let t=e,n=[];for(let e=t.length;e>0;e-=3)n.push(t.slice(Math.max(0,e-3),e));return n.reverse().join(`,`)}e.integerStringToUSLocaleString=t})),qa=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Dec=void 0;var n=t(Ua()),r=Ga(),i=Wa(),a=Ka(),o=class e{static calcPrecisionMultiplier(t){if(t<0)throw Error(`Invalid prec`);if(t>e.precision)throw Error(`Too much precision`);let r=t.toString(),i=e.precisionMultipliers.get(r);if(i)return i;let a=e.precision-t,o=(0,n.default)(10).pow(a);return e.precisionMultipliers.set(r,o),o}static reduceDecimalsFromString(t){let n=t.indexOf(`.`);if(n<0)return{res:t,isDownToZero:!1};let r=t.length-1-n-e.precision;if(r<=0)return{res:t,isDownToZero:!1};let i=t.slice(0,t.length-r);return{res:i,isDownToZero:/^[0.]*$/.test(i)}}constructor(t,a=0){if(typeof t==`number`&&(t=t.toString()),typeof t==`string`){if(t.length===0)throw Error(`empty string`);if(!(0,i.isValidDecimalString)(t))if((0,i.isExponentDecString)(t))t=(0,i.exponentDecStringToDecString)(t);else throw Error(`invalid decimal: ${t}`);let r=e.reduceDecimalsFromString(t);r.isDownToZero,t=r.res,t.indexOf(`.`)>=0&&(a=t.length-t.indexOf(`.`)-1,t=t.replace(`.`,``)),this.int=(0,n.default)(t)}else t instanceof r.Int||t instanceof r.Uint?this.int=(0,n.default)(t.toString()):this.int=(0,n.default)(t);this.int=this.int.multiply(e.calcPrecisionMultiplier(a)),this.checkBitLen()}checkBitLen(){if(this.int.abs().gt(e.maxDec))throw Error(`Integer out of range ${this.int.toString()}`)}isZero(){return this.int.eq((0,n.default)(0))}isNegative(){return this.int.isNegative()}isPositive(){return this.int.isPositive()}equals(e){return this.int.eq(e.int)}gt(e){return this.int.gt(e.int)}gte(e){return this.int.geq(e.int)}lt(e){return this.int.lt(e.int)}lte(e){return this.int.leq(e.int)}neg(){return new e(this.int.negate(),e.precision)}abs(){return new e(this.int.abs(),e.precision)}add(t){return new e(this.int.add(t.int),e.precision)}sub(t){return new e(this.int.subtract(t.int),e.precision)}pow(t){if(t.isZero())return new e(1);if(t.isNegative())return new e(1).quo(this.pow(t.abs()));let n=new e(this.int,e.precision),i=new e(1);for(let e=t;e.gt(new r.Int(1));e=e.div(new r.Int(2)))e.mod(new r.Int(2)).isZero()||(i=i.mul(n)),n=n.mul(n);return n.mul(i)}approxSqrt(){return this.approxRoot(2)}approxRoot(t,n=300){if(this.isNegative())return this.neg().approxRoot(t).neg();if(t===1||this.isZero()||this.equals(e.one))return this;if(t===0)return e.one;let[i,a]=[e.one,e.one];for(let o=0;a.abs().gt(e.smallestDec)&&o<n;o++){let n=i.pow(new r.Int(t-1));n.isZero()&&(n=e.smallestDec),a=this.quo(n),a=a.sub(i),a=a.quoTruncate(new e(t)),i=i.add(a)}return i}mul(t){return new e(this.mulRaw(t).chopPrecisionAndRound(),e.precision)}mulTruncate(t){return new e(this.mulRaw(t).chopPrecisionAndTruncate(),e.precision)}mulRoundUp(t){return new e(this.mulRaw(t).chopPrecisionAndRoundUp(),e.precision)}mulRaw(t){return new e(this.int.multiply(t.int),e.precision)}quo(t){return new e(this.quoRaw(t).chopPrecisionAndRound(),e.precision)}quoTruncate(t){return new e(this.quoRaw(t).chopPrecisionAndTruncate(),e.precision)}quoRoundUp(t){return new e(this.quoRaw(t).chopPrecisionAndRoundUp(),e.precision)}quoRaw(t){let n=e.calcPrecisionMultiplier(0);return new e(this.int.multiply(n).multiply(n).divide(t.int),e.precision)}isInteger(){let t=e.calcPrecisionMultiplier(0);return this.int.remainder(t).equals((0,n.default)(0))}chopPrecisionAndRound(){if(this.isNegative())return this.abs().chopPrecisionAndRound().negate();let t=e.calcPrecisionMultiplier(0),r=t.divide((0,n.default)(2)),{quotient:i,remainder:a}=this.int.divmod(t);return a.equals((0,n.default)(0))||a.lt(r)?i:a.gt(r)?i.add((0,n.default)(1)):i.divide((0,n.default)(2)).equals((0,n.default)(0))?i:i.add((0,n.default)(1))}chopPrecisionAndRoundUp(){if(this.isNegative())return this.abs().chopPrecisionAndTruncate().negate();let t=e.calcPrecisionMultiplier(0),{quotient:r,remainder:i}=this.int.divmod(t);return i.equals((0,n.default)(0))?r:r.add((0,n.default)(1))}chopPrecisionAndTruncate(){let t=e.calcPrecisionMultiplier(0);return this.int.divide(t)}toString(t=e.precision,r=!1){let i=e.calcPrecisionMultiplier(0),{quotient:o,remainder:s}=this.int.abs().divmod(i),c=s.toString(10);for(let t=0,n=c.length;t<e.precision-n;t++)c=`0`+c;c=c.substring(0,t);let l=this.isNegative()&&!(o.eq((0,n.default)(0))&&c.length===0),u=r?(0,a.integerStringToUSLocaleString)(o.toString()):o.toString();return`${l?`-`:``}${u}${c.length>0?`.`+c:``}`}round(){return new r.Int(this.chopPrecisionAndRound())}roundUp(){return new r.Int(this.chopPrecisionAndRoundUp())}truncate(){return new r.Int(this.chopPrecisionAndTruncate())}roundDec(){return new e(this.chopPrecisionAndRound(),0)}roundUpDec(){return new e(this.chopPrecisionAndRoundUp(),0)}truncateDec(){return new e(this.chopPrecisionAndTruncate(),0)}};e.Dec=o,o.precision=18,o.decimalPrecisionBits=60,o.maxDec=(0,n.default)(`133499189745056880149688856635597007162669032647290798121690100488888732861290034376435130433535`),o.precisionMultipliers=new Map,o.zero=new o(0),o.smallestDec=new o(`1`,o.precision),o.one=new o(1),r.Int.prototype.toDec=function(){return new o(this)},r.Uint.prototype.toDec=function(){return new o(this)}})),Ja=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DecUtils=void 0;var t=qa(),n=Ga(),r=class e{static trim(e){let t=typeof e==`string`?e:e.toString();if(t.indexOf(`.`)<0)return t;for(let e=t.length-1;e>=0&&t[e]===`0`;e--)t=t.slice(0,e);return t.length>0&&t[t.length-1]===`.`&&(t=t.slice(0,t.length-1)),t}static getTenExponentN(r){if(r<-t.Dec.precision)throw Error(`Too little precision`);if(e.tenExponentNs[r.toString()])return e.tenExponentNs[r.toString()];let i=new t.Dec(10).pow(new n.Int(r));return e.tenExponentNs[r.toString()]=i,i}static getTenExponentNInPrecisionRange(n){if(n>t.Dec.precision)throw Error(`Too much precision`);return e.getTenExponentN(n)}static getPrecisionDec(t){return e.getTenExponentNInPrecisionRange(t)}};e.DecUtils=r,r.tenExponentNs={}})),Ya=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Coin=void 0;var t=Ga();e.Coin=class e{static parse(t){let n=RegExp(`([0-9]+)[ ]*([a-zA-Z]+)$`).exec(t);if(!n||n.length!==3)throw Error(`Invalid coin str`);let r=n[2],i=n[1];return new e(r,i)}constructor(e,n){this.denom=e,this.amount=n instanceof t.Int?n:new t.Int(n)}toString(){return`${this.amount.toString()}${this.denom}`}}})),Xa=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CoinUtils=void 0;var t=Ya(),n=Ga(),r=qa(),i=Ja(),a=Ka(),o=class e{static createCoinsFromPrimitives(e){return e.map(e=>new t.Coin(e.denom,e.amount))}static amountOf(e,t){let r=e.find(e=>e.denom===t);return r?r.amount:new n.Int(0)}static exclude(e,t){return e.filter(e=>t.indexOf(e.denom)===0)}static concat(...e){return e.length===0?[]:e.slice().reduce((e,n)=>{let r=e.find(e=>e.denom===n.denom);if(r){let i=new t.Coin(r.denom,r.amount.add(n.amount));e.push(i)}else{let r=new t.Coin(n.denom,n.amount);e.push(r)}return e},[])}static getCoinFromDecimals(e,n,i){let a=e.find(e=>e.coinDenom===i);if(!a)throw Error(`Invalid currency`);let o=new r.Dec(1);for(let e=0;e<a.coinDecimals;e++)o=o.mul(new r.Dec(10));let s=new r.Dec(n);if(s=s.mul(o),!new r.Dec(s.truncate()).equals(s))throw Error(`Can't divide anymore`);return new t.Coin(a.coinMinimalDenom,s.truncate())}static parseDecAndDenomFromCoin(e,t){let n=e.find(e=>e.coinMinimalDenom===t.denom);n||={coinDecimals:0,coinDenom:t.denom,coinMinimalDenom:t.denom};let i=new r.Dec(1);for(let e=0;e<n.coinDecimals;e++)i=i.mul(new r.Dec(10));return{amount:new r.Dec(t.amount).quoTruncate(i).toString(n.coinDecimals),denom:n.coinDenom}}static shrinkDecimals(t,n,i,a=!1){if(t.equals(new r.Dec(0)))return`0`;let o=t.isNegative(),s=t.abs().truncate(),c=t.abs().sub(new r.Dec(s)),l=Math.max(i-s.toString().length+1,n),u=l===0?``:c.toString(l).replace(`0.`,``),d=a?e.integerStringToUSLocaleString(s.toString()):s.toString();return(o?`-`:``)+d+(u.length>0?`.`:``)+u}static coinToTrimmedString(e,t,n=` `){let a=new r.Dec(e.amount).quoTruncate(i.DecUtils.getPrecisionDec(t.coinDecimals));return`${i.DecUtils.trim(a)}${n}${t.coinDenom}`}};e.CoinUtils=o,o.integerStringToUSLocaleString=a.integerStringToUSLocaleString})),Za=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.IntPretty=void 0;var t=Ga(),n=qa(),r=Ja(),i=Xa();e.IntPretty=class e{constructor(e){if(this.floatingDecimalPointRight=0,this._options={maxDecimals:0,trim:!1,shrink:!1,ready:!0,locale:!0,inequalitySymbol:!1,inequalitySymbolSeparator:` `},typeof e==`object`&&`toDec`in e?e=e.toDec():e instanceof n.Dec||(e=new n.Dec(e)),e.isZero()){this.dec=e;return}let r=e,i=0;for(let e=0;e<18&&!(!r.truncate().equals(new t.Int(0))&&r.equals(new n.Dec(r.truncate())));e++)r=r.mul(new n.Dec(10)),i++;this.dec=e,this._options.maxDecimals=i}get options(){return this._options}moveDecimalPointLeft(e){let t=this.clone();return t.floatingDecimalPointRight+=-e,t}moveDecimalPointRight(e){let t=this.clone();return t.floatingDecimalPointRight+=e,t}increasePrecision(e){return this.moveDecimalPointLeft(e)}decreasePrecision(e){return this.moveDecimalPointRight(e)}maxDecimals(e){let t=this.clone();return t._options.maxDecimals=e,t}inequalitySymbol(e){let t=this.clone();return t._options.inequalitySymbol=e,t}inequalitySymbolSeparator(e){let t=this.clone();return t._options.inequalitySymbolSeparator=e,t}trim(e){let t=this.clone();return t._options.trim=e,t}shrink(e){let t=this.clone();return t._options.shrink=e,t}locale(e){let t=this.clone();return t._options.locale=e,t}ready(e){let t=this.clone();return t._options.ready=e,t}get isReady(){return this._options.ready}add(t){t instanceof n.Dec||(t=t.toDec());let r=new e(this.toDec().add(t));return r._options=Object.assign({},this._options),r}sub(t){t instanceof n.Dec||(t=t.toDec());let r=new e(this.toDec().sub(t));return r._options=Object.assign({},this._options),r}mul(t){t instanceof n.Dec||(t=t.toDec());let r=new e(this.toDec().mul(t));return r._options=Object.assign({},this._options),r}quo(t){t instanceof n.Dec||(t=t.toDec());let r=new e(this.toDec().quo(t));return r._options=Object.assign({},this._options),r}toDec(){if(this.floatingDecimalPointRight===0)return this.dec;if(this.floatingDecimalPointRight>0)return this.dec.mulTruncate(r.DecUtils.getTenExponentN(this.floatingDecimalPointRight));{let e=-this.floatingDecimalPointRight,t=this.dec;for(;e>0;)if(e>=n.Dec.precision)t=t.mulTruncate(r.DecUtils.getTenExponentN(-n.Dec.precision)),e-=n.Dec.precision;else{t=t.mulTruncate(r.DecUtils.getTenExponentN(-(e%n.Dec.precision)));break}return t}}toString(){return this.toStringWithSymbols(``,``)}toStringWithSymbols(e,t){let n=this.toDec();if(this._options.inequalitySymbol&&!n.isZero()&&n.abs().lt(r.DecUtils.getTenExponentN(-this._options.maxDecimals))){let i=n.isNegative();return`${i?`>`:`<`}${this._options.inequalitySymbolSeparator}${i?`-`:``}${e}${r.DecUtils.getTenExponentN(-this._options.maxDecimals).toString(this._options.maxDecimals,this._options.locale)}${t}`}let a;a=this._options.shrink?i.CoinUtils.shrinkDecimals(n,0,this._options.maxDecimals,this._options.locale):n.toString(this._options.maxDecimals,this._options.locale),this._options.trim&&(a=r.DecUtils.trim(a));let o=a.charAt(0)===`-`;return o&&(a=a.slice(1)),`${o?`-`:``}${e}${a}${t}`}clone(){let t=new e(this.dec);return t.dec=this.dec,t.floatingDecimalPointRight=this.floatingDecimalPointRight,t._options=Object.assign({},this._options),t}}})),Qa=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CoinPretty=void 0;var t=Za(),n=qa(),r=Ja();e.CoinPretty=class e{constructor(e,i){this._currency=e,this._options={separator:` `,upperCase:!1,lowerCase:!1,hideDenom:!1,hideIBCMetadata:!1},typeof i==`object`&&`toDec`in i?i=i.toDec():i instanceof n.Dec||(i=new n.Dec(i)),this.intPretty=new t.IntPretty(i.quoTruncate(r.DecUtils.getTenExponentNInPrecisionRange(e.coinDecimals))).maxDecimals(e.coinDecimals)}get options(){return Object.assign(Object.assign({},this._options),this.intPretty.options)}get denom(){return this.currency.coinDenom}get currency(){return this._currency}setCurrency(e){let t=this.clone();return t.intPretty=this.intPretty.moveDecimalPointRight(this._currency.coinDecimals-e.coinDecimals),t._currency=e,t}separator(e){let t=this.clone();return t._options.separator=e,t}upperCase(e){let t=this.clone();return t._options.upperCase=e,t._options.lowerCase=!e,t}lowerCase(e){let t=this.clone();return t._options.lowerCase=e,t._options.upperCase=!e,t}hideDenom(e){let t=this.clone();return t._options.hideDenom=e,t}hideIBCMetadata(e){let t=this.clone();return t._options.hideIBCMetadata=e,t}moveDecimalPointLeft(e){let t=this.clone();return t.intPretty=t.intPretty.moveDecimalPointLeft(e),t}moveDecimalPointRight(e){let t=this.clone();return t.intPretty=t.intPretty.moveDecimalPointRight(e),t}increasePrecision(e){return this.moveDecimalPointLeft(e)}decreasePrecision(e){return this.moveDecimalPointRight(e)}maxDecimals(e){let t=this.clone();return t.intPretty=t.intPretty.maxDecimals(e),t}inequalitySymbol(e){let t=this.clone();return t.intPretty=t.intPretty.inequalitySymbol(e),t}inequalitySymbolSeparator(e){let t=this.clone();return t.intPretty=t.intPretty.inequalitySymbolSeparator(e),t}trim(e){let t=this.clone();return t.intPretty=t.intPretty.trim(e),t}shrink(e){let t=this.clone();return t.intPretty=t.intPretty.shrink(e),t}locale(e){let t=this.clone();return t.intPretty=t.intPretty.locale(e),t}ready(e){let t=this.clone();return t.intPretty=t.intPretty.ready(e),t}get isReady(){return this.intPretty.isReady}add(t){let n=t instanceof e;if(n&&`currency`in t&&this.currency.coinMinimalDenom!==t.currency.coinMinimalDenom)return this.clone();`toDec`in t&&(t=t.toDec());let i=this.clone();return i.intPretty=i.intPretty.add(n?t:t.mul(r.DecUtils.getTenExponentNInPrecisionRange(-this._currency.coinDecimals))),i}sub(t){let n=t instanceof e;if(n&&`currency`in t&&this.currency.coinMinimalDenom!==t.currency.coinMinimalDenom)return this.clone();`toDec`in t&&(t=t.toDec());let i=this.clone();return i.intPretty=i.intPretty.sub(n?t:t.mul(r.DecUtils.getTenExponentNInPrecisionRange(-this._currency.coinDecimals))),i}mul(e){let t=this.clone();return t.intPretty=t.intPretty.mul(e),t}quo(e){let t=this.clone();return t.intPretty=t.intPretty.quo(e),t}toDec(){return this.intPretty.toDec()}toCoin(){let e=this.toDec().mulTruncate(r.DecUtils.getTenExponentNInPrecisionRange(this.currency.coinDecimals)).truncate();return{denom:this.currency.coinMinimalDenom,amount:e.toString()}}toString(){let e=this.denom;this._options.hideIBCMetadata&&`originCurrency`in this.currency&&this.currency.originCurrency&&(e=this.currency.originCurrency.coinDenom),this._options.upperCase&&(e=e.toUpperCase()),this._options.lowerCase&&(e=e.toLowerCase());let t=this._options.separator;return this._options.hideDenom&&(e=``,t=``),this.intPretty.toStringWithSymbols(``,`${t}${e}`)}clone(){let t=new e(this._currency,0);return t._options=Object.assign({},this._options),t.intPretty=this.intPretty.clone(),t}}})),$a=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.PricePretty=void 0;var t=Za(),n=Ja();e.PricePretty=class e{constructor(e,n){this._fiatCurrency=e,this._options={separator:``,upperCase:!1,lowerCase:!1,locale:`en-US`},this.intPretty=new t.IntPretty(n).maxDecimals(e.maxDecimals).shrink(!0).trim(!0).locale(!1).inequalitySymbol(!0),this._options.locale=e.locale}get options(){return Object.assign(Object.assign({},this.intPretty.options),this._options)}get symbol(){return this._fiatCurrency.symbol}get fiatCurrency(){return this._fiatCurrency}separator(e){let t=this.clone();return t._options.separator=e,t}upperCase(e){let t=this.clone();return t._options.upperCase=e,t._options.lowerCase=!e,t}lowerCase(e){let t=this.clone();return t._options.lowerCase=e,t._options.upperCase=!e,t}moveDecimalPointLeft(e){let t=this.clone();return t.intPretty=t.intPretty.moveDecimalPointLeft(e),t}moveDecimalPointRight(e){let t=this.clone();return t.intPretty=t.intPretty.moveDecimalPointRight(e),t}increasePrecision(e){return this.moveDecimalPointLeft(e)}decreasePrecision(e){return this.moveDecimalPointRight(e)}maxDecimals(e){let t=this.clone();return t.intPretty=t.intPretty.maxDecimals(e),t}inequalitySymbol(e){let t=this.clone();return t.intPretty=t.intPretty.inequalitySymbol(e),t}inequalitySymbolSeparator(e){let t=this.clone();return t.intPretty=t.intPretty.inequalitySymbolSeparator(e),t}trim(e){let t=this.clone();return t.intPretty=t.intPretty.trim(e),t}shrink(e){let t=this.clone();return t.intPretty=t.intPretty.shrink(e),t}locale(e){let t=this.clone();return t._options.locale=e,t}ready(e){let t=this.clone();return t.intPretty=t.intPretty.ready(e),t}get isReady(){return this.intPretty.isReady}add(e){let t=this.clone();return t.intPretty=t.intPretty.add(e),t}sub(e){let t=this.clone();return t.intPretty=t.intPretty.sub(e),t}mul(e){let t=this.clone();return t.intPretty=t.intPretty.mul(e),t}quo(e){let t=this.clone();return t.intPretty=t.intPretty.quo(e),t}toDec(){return this.intPretty.toDec()}toString(){let e=this.symbol;this._options.upperCase&&(e=e.toUpperCase()),this._options.lowerCase&&(e=e.toLowerCase());let t=this.toDec(),r=this.options;if(r.inequalitySymbol&&!t.isZero()&&t.abs().lt(n.DecUtils.getTenExponentN(-r.maxDecimals)))return this.intPretty.toStringWithSymbols(`${e}${this._options.separator}`,``);let i=parseFloat(this.intPretty.toString()).toLocaleString(r.locale,{maximumFractionDigits:r.maxDecimals}),a=i.charAt(0)===`-`;return a&&(i=i.slice(1)),`${a?`-`:``}${e}${this._options.separator}${i}`}clone(){let t=new e(this._fiatCurrency,0);return t._options=Object.assign({},this._options),t.intPretty=this.intPretty.clone(),t}}})),eo=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.RatePretty=void 0;var t=Za();e.RatePretty=class e{constructor(e){this._options={separator:``,symbol:`%`},this.intPretty=new t.IntPretty(e),this.intPretty=this.intPretty.maxDecimals(3).shrink(!1).trim(!0).locale(!0).inequalitySymbol(!0)}get options(){return Object.assign(Object.assign({},this.intPretty.options),this._options)}separator(e){let t=this.clone();return t._options.separator=e,t}symbol(e){let t=this.clone();return t._options.symbol=e,t}moveDecimalPointLeft(e){let t=this.clone();return t.intPretty=t.intPretty.moveDecimalPointLeft(e),t}moveDecimalPointRight(e){let t=this.clone();return t.intPretty=t.intPretty.moveDecimalPointRight(e),t}maxDecimals(e){let t=this.clone();return t.intPretty=t.intPretty.maxDecimals(e),t}inequalitySymbol(e){let t=this.clone();return t.intPretty=t.intPretty.inequalitySymbol(e),t}inequalitySymbolSeparator(e){let t=this.clone();return t.intPretty=t.intPretty.inequalitySymbolSeparator(e),t}trim(e){let t=this.clone();return t.intPretty=t.intPretty.trim(e),t}shrink(e){let t=this.clone();return t.intPretty=t.intPretty.shrink(e),t}locale(e){let t=this.clone();return t.intPretty=t.intPretty.locale(e),t}ready(e){let t=this.clone();return t.intPretty=t.intPretty.ready(e),t}get isReady(){return this.intPretty.isReady}add(e){let t=this.clone();return t.intPretty=t.intPretty.add(e),t}sub(e){let t=this.clone();return t.intPretty=t.intPretty.sub(e),t}mul(e){let t=this.clone();return t.intPretty=t.intPretty.mul(e),t}quo(e){let t=this.clone();return t.intPretty=t.intPretty.quo(e),t}toDec(){return this.intPretty.toDec()}toString(){return this.intPretty.moveDecimalPointRight(2).toStringWithSymbols(``,`${this._options.separator}${this._options.symbol}`)}clone(){let t=new e(0);return t._options=Object.assign({},this._options),t.intPretty=this.intPretty.clone(),t}}})),to=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(Za(),e),n(Qa(),e),n(Ya(),e),n(Ga(),e),n(qa(),e),n(Xa(),e),n(Ja(),e),n($a(),e),n(eo(),e)})),no=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isSimpleFetchError=e.SimpleFetchError=void 0;var t=class e extends Error{constructor(t,n,r){super(`Failed to get response from ${new URL(n,t).toString()}`),this.baseURL=t,this.url=n,this.response=r,Object.setPrototypeOf(this,e.prototype)}};e.SimpleFetchError=t;function n(e){return e instanceof t}e.isSimpleFetchError=n})),ro=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},n=e&&e.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};Object.defineProperty(e,`__esModule`,{value:!0}),e.simpleFetch=e.makeURL=void 0;var r=no();function i(e,t){let n=new URL(e);return e=o(n.origin),t=o(n.pathname)+`/`+a(t),o(e+`/`+a(t))}e.makeURL=i;function a(e){return e.length>0&&e[0]===`/`?e.slice(1):e}function o(e){return e.length>0&&e[e.length-1]===`/`?e.slice(0,e.length-1):e}function s(e,a,o){return t(this,void 0,void 0,function*(){typeof a!=`string`&&(a&&(o=a),a=``),a===`/`&&(a=``);let t=i(e,a),s=o||{},{headers:l}=s,u=n(s,[`headers`]),d=yield fetch(t,Object.assign({headers:Object.assign({accept:`application/json, text/plain, */*`},l)},u)),f;if((d.headers.get(`content-type`)||``).startsWith(`application/json`))f=yield d.json();else{let e=yield d.text(),t=e.trim();f=t.startsWith(`{`)&&t.endsWith(`}`)?JSON.parse(t):e}let p={url:t,data:f,headers:d.headers,status:d.status,statusText:d.statusText};if(!(o?.validateStatus||c)(d.status))throw new r.SimpleFetchError(e,a,p);return p})}e.simpleFetch=s;function c(e){return e===200}})),io=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),ao=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(ro(),e),n(no(),e),n(io(),e)})),oo=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.BaseAccount=void 0;var n=to(),r=ao();e.BaseAccount=class e{static fetchFromRest(n,i,a=!1){return t(this,void 0,void 0,function*(){let t=yield(0,r.simpleFetch)(n,`/cosmos/auth/v1beta1/accounts/${i}`,{validateStatus:function(e){return e>=200&&e<300||e===404}});return e.fromProtoJSON(t.data,a?i:``)})}static fromProtoJSON(t,r=``){if(!t.account){if(!r)throw Error(`Account's address is unknown: ${JSON.stringify(t)}`);return new e(``,r,new n.Int(0),new n.Int(0))}let i=t.account,a=i[`@type`]||``,o=i.BaseAccount||i.baseAccount||i.base_account;o&&(i=o);let s=i.account;s&&(i=s);let c=i.BaseVestingAccount||i.baseVestingAccount||i.base_vesting_account;if(c){i=c;let e=i.BaseAccount||i.baseAccount||i.base_account;e&&(i=e)}let l=i.address;if(!l){if(!r)throw Error(`Account's address is unknown: ${JSON.stringify(t)}`);l=r}let u=i.account_number,d=i.sequence;return new e(a,l,new n.Int(u||`0`),new n.Int(d||`0`))}constructor(e,t,n,r){this.type=e,this.address=t,this.accountNumber=n,this.sequence=r}getType(){return this.type}getAddress(){return this.address}getAccountNumber(){return this.accountNumber}getSequence(){return this.sequence}}})),so,co=t((()=>{so=`logger/5.8.0`}));function lo(){try{let e=[];if([`NFD`,`NFC`,`NFKD`,`NFKC`].forEach(t=>{try{if(`test`.normalize(t)!==`test`)throw Error(`bad normalize`)}catch{e.push(t)}}),e.length)throw Error(`missing `+e.join(`, `));if(`é`.normalize(`NFD`)!==`é`)throw Error(`broken implementation`)}catch(e){return e.message}return null}var uo,fo,po,mo,ho,go,_o,vo,yo,bo,xo=t((()=>{co(),uo=!1,fo=!1,po={debug:1,default:2,info:2,warning:3,error:4,off:5},mo=po.default,ho=null,go=lo(),(function(e){e.DEBUG=`DEBUG`,e.INFO=`INFO`,e.WARNING=`WARNING`,e.ERROR=`ERROR`,e.OFF=`OFF`})(_o||={}),(function(e){e.UNKNOWN_ERROR=`UNKNOWN_ERROR`,e.NOT_IMPLEMENTED=`NOT_IMPLEMENTED`,e.UNSUPPORTED_OPERATION=`UNSUPPORTED_OPERATION`,e.NETWORK_ERROR=`NETWORK_ERROR`,e.SERVER_ERROR=`SERVER_ERROR`,e.TIMEOUT=`TIMEOUT`,e.BUFFER_OVERRUN=`BUFFER_OVERRUN`,e.NUMERIC_FAULT=`NUMERIC_FAULT`,e.MISSING_NEW=`MISSING_NEW`,e.INVALID_ARGUMENT=`INVALID_ARGUMENT`,e.MISSING_ARGUMENT=`MISSING_ARGUMENT`,e.UNEXPECTED_ARGUMENT=`UNEXPECTED_ARGUMENT`,e.CALL_EXCEPTION=`CALL_EXCEPTION`,e.INSUFFICIENT_FUNDS=`INSUFFICIENT_FUNDS`,e.NONCE_EXPIRED=`NONCE_EXPIRED`,e.REPLACEMENT_UNDERPRICED=`REPLACEMENT_UNDERPRICED`,e.UNPREDICTABLE_GAS_LIMIT=`UNPREDICTABLE_GAS_LIMIT`,e.TRANSACTION_REPLACED=`TRANSACTION_REPLACED`,e.ACTION_REJECTED=`ACTION_REJECTED`})(vo||={}),yo=`0123456789abcdef`,bo=class e{constructor(e){Object.defineProperty(this,`version`,{enumerable:!0,value:e,writable:!1})}_log(e,t){let n=e.toLowerCase();po[n]??this.throwArgumentError(`invalid log level name`,`logLevel`,e),!(mo>po[n])&&console.log.apply(console,t)}debug(...t){this._log(e.levels.DEBUG,t)}info(...t){this._log(e.levels.INFO,t)}warn(...t){this._log(e.levels.WARNING,t)}makeError(t,n,r){if(fo)return this.makeError(`censored error`,n,{});n||=e.errors.UNKNOWN_ERROR,r||={};let i=[];Object.keys(r).forEach(e=>{let t=r[e];try{if(t instanceof Uint8Array){let n=``;for(let e=0;e<t.length;e++)n+=yo[t[e]>>4],n+=yo[t[e]&15];i.push(e+`=Uint8Array(0x`+n+`)`)}else i.push(e+`=`+JSON.stringify(t))}catch{i.push(e+`=`+JSON.stringify(r[e].toString()))}}),i.push(`code=${n}`),i.push(`version=${this.version}`);let a=t,o=``;switch(n){case vo.NUMERIC_FAULT:{o=`NUMERIC_FAULT`;let e=t;switch(e){case`overflow`:case`underflow`:case`division-by-zero`:o+=`-`+e;break;case`negative-power`:case`negative-width`:o+=`-unsupported`;break;case`unbound-bitwise-result`:o+=`-unbound-result`;break}break}case vo.CALL_EXCEPTION:case vo.INSUFFICIENT_FUNDS:case vo.MISSING_NEW:case vo.NONCE_EXPIRED:case vo.REPLACEMENT_UNDERPRICED:case vo.TRANSACTION_REPLACED:case vo.UNPREDICTABLE_GAS_LIMIT:o=n;break}o&&(t+=` [ See: https://links.ethers.org/v5-errors-`+o+` ]`),i.length&&(t+=` (`+i.join(`, `)+`)`);let s=Error(t);return s.reason=a,s.code=n,Object.keys(r).forEach(function(e){s[e]=r[e]}),s}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(t,n,r){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:n,value:r})}assert(e,t,n,r){e||this.throwError(t,n,r)}assertArgument(e,t,n,r){e||this.throwArgumentError(t,n,r)}checkNormalize(t){t??=`platform missing String.prototype.normalize`,go&&this.throwError(`platform missing String.prototype.normalize`,e.errors.UNSUPPORTED_OPERATION,{operation:`String.prototype.normalize`,form:go})}checkSafeUint53(t,n){typeof t==`number`&&(n??=`value not safe`,(t<0||t>=9007199254740991)&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:`checkSafeInteger`,fault:`out-of-safe-range`,value:t}),t%1&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:`checkSafeInteger`,fault:`non-integer`,value:t}))}checkArgumentCount(t,n,r){r=r?`: `+r:``,t<n&&this.throwError(`missing argument`+r,e.errors.MISSING_ARGUMENT,{count:t,expectedCount:n}),t>n&&this.throwError(`too many arguments`+r,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:n})}checkNew(t,n){(t===Object||t==null)&&this.throwError(`missing new`,e.errors.MISSING_NEW,{name:n.name})}checkAbstract(t,n){t===n?this.throwError(`cannot instantiate abstract class `+JSON.stringify(n.name)+` directly; use a sub-class`,e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:`new`}):(t===Object||t==null)&&this.throwError(`missing new`,e.errors.MISSING_NEW,{name:n.name})}static globalLogger(){return ho||=new e(so),ho}static setCensorship(t,n){if(!t&&n&&this.globalLogger().throwError(`cannot permanently disable censorship`,e.errors.UNSUPPORTED_OPERATION,{operation:`setCensorship`}),uo){if(!t)return;this.globalLogger().throwError(`error censorship permanent`,e.errors.UNSUPPORTED_OPERATION,{operation:`setCensorship`})}fo=!!t,uo=!!n}static setLogLevel(t){let n=po[t.toLowerCase()];if(n==null){e.globalLogger().warn(`invalid log level - `+t);return}mo=n}static from(t){return new e(t)}},bo.errors=vo,bo.levels=_o})),So,Co=t((()=>{So=`bytes/5.8.0`}));function wo(e){return!!e.toHexString}function To(e){return e.slice||=function(){let t=Array.prototype.slice.call(arguments);return To(new Uint8Array(Array.prototype.slice.apply(e,t)))},e}function Eo(e){return Mo(e)&&!(e.length%2)||Oo(e)}function Do(e){return typeof e==`number`&&e==e&&e%1==0}function Oo(e){if(e==null)return!1;if(e.constructor===Uint8Array)return!0;if(typeof e==`string`||!Do(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){let n=e[t];if(!Do(n)||n<0||n>=256)return!1}return!0}function ko(e,t){if(t||={},typeof e==`number`){Io.checkSafeUint53(e,`invalid arrayify value`);let t=[];for(;e;)t.unshift(e&255),e=parseInt(String(e/256));return t.length===0&&t.push(0),To(new Uint8Array(t))}if(t.allowMissingPrefix&&typeof e==`string`&&e.substring(0,2)!==`0x`&&(e=`0x`+e),wo(e)&&(e=e.toHexString()),Mo(e)){let n=e.substring(2);n.length%2&&(t.hexPad===`left`?n=`0`+n:t.hexPad===`right`?n+=`0`:Io.throwArgumentError(`hex data is odd-length`,`value`,e));let r=[];for(let e=0;e<n.length;e+=2)r.push(parseInt(n.substring(e,e+2),16));return To(new Uint8Array(r))}return Oo(e)?To(new Uint8Array(e)):Io.throwArgumentError(`invalid arrayify value`,`value`,e)}function Ao(e){let t=e.map(e=>ko(e)),n=t.reduce((e,t)=>e+t.length,0),r=new Uint8Array(n);return t.reduce((e,t)=>(r.set(t,e),e+t.length),0),To(r)}function jo(e){let t=ko(e);if(t.length===0)return t;let n=0;for(;n<t.length&&t[n]===0;)n++;return n&&(t=t.slice(n)),t}function Mo(e,t){return!(typeof e!=`string`||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}function No(e,t){if(t||={},typeof e==`number`){Io.checkSafeUint53(e,`invalid hexlify value`);let t=``;for(;e;)t=Lo[e&15]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t=`0`+t),`0x`+t):`0x00`}if(typeof e==`bigint`)return e=e.toString(16),e.length%2?`0x0`+e:`0x`+e;if(t.allowMissingPrefix&&typeof e==`string`&&e.substring(0,2)!==`0x`&&(e=`0x`+e),wo(e))return e.toHexString();if(Mo(e))return e.length%2&&(t.hexPad===`left`?e=`0x0`+e.substring(2):t.hexPad===`right`?e+=`0`:Io.throwArgumentError(`hex data is odd-length`,`value`,e)),e.toLowerCase();if(Oo(e)){let t=`0x`;for(let n=0;n<e.length;n++){let r=e[n];t+=Lo[(r&240)>>4]+Lo[r&15]}return t}return Io.throwArgumentError(`invalid hexlify value`,`value`,e)}function Po(e){if(typeof e!=`string`)e=No(e);else if(!Mo(e)||e.length%2)return null;return(e.length-2)/2}function Fo(e,t,n){return typeof e==`string`?(!Mo(e)||e.length%2)&&Io.throwArgumentError(`invalid hexData`,`value`,e):e=No(e),t=2+2*t,n==null?`0x`+e.substring(t):`0x`+e.substring(t,2+2*n)}var Io,Lo,Ro=t((()=>{xo(),Co(),Io=new bo(So),Lo=`0123456789abcdef`})),zo,Bo=t((()=>{zo=`bignumber/5.8.0`}));function Vo(e){if(typeof e!=`string`)return Vo(e.toString(16));if(e[0]===`-`)return e=e.substring(1),e[0]===`-`&&Jo.throwArgumentError(`invalid hex`,`value`,e),e=Vo(e),e===`0x00`?e:`-`+e;if(e.substring(0,2)!==`0x`&&(e=`0x`+e),e===`0x`)return`0x00`;for(e.length%2&&(e=`0x0`+e.substring(2));e.length>4&&e.substring(0,4)===`0x00`;)e=`0x`+e.substring(4);return e}function Ho(e){return Qo.from(Vo(e))}function K(e){let t=Qo.from(e).toHexString();return t[0]===`-`?new qo(`-`+t.substring(3),16):new qo(t.substring(2),16)}function Uo(e,t,n){let r={fault:e,operation:t};return n!=null&&(r.value=n),Jo.throwError(e,bo.errors.NUMERIC_FAULT,r)}function Wo(e){return new qo(e,36).toString(16)}function Go(e){return new qo(e,16).toString(36)}var Ko,qo,Jo,Yo,Xo,Zo,Qo,$o=t((()=>{Ko=i(w()),Ro(),xo(),Bo(),qo=Ko.default.BN,Jo=new bo(zo),Yo={},Xo=9007199254740991,Zo=!1,Qo=class e{constructor(e,t){e!==Yo&&Jo.throwError(`cannot call constructor directly; use BigNumber.from`,bo.errors.UNSUPPORTED_OPERATION,{operation:`new (BigNumber)`}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Ho(K(this).fromTwos(e))}toTwos(e){return Ho(K(this).toTwos(e))}abs(){return this._hex[0]===`-`?e.from(this._hex.substring(1)):this}add(e){return Ho(K(this).add(K(e)))}sub(e){return Ho(K(this).sub(K(e)))}div(t){return e.from(t).isZero()&&Uo(`division-by-zero`,`div`),Ho(K(this).div(K(t)))}mul(e){return Ho(K(this).mul(K(e)))}mod(e){let t=K(e);return t.isNeg()&&Uo(`division-by-zero`,`mod`),Ho(K(this).umod(t))}pow(e){let t=K(e);return t.isNeg()&&Uo(`negative-power`,`pow`),Ho(K(this).pow(t))}and(e){let t=K(e);return(this.isNegative()||t.isNeg())&&Uo(`unbound-bitwise-result`,`and`),Ho(K(this).and(t))}or(e){let t=K(e);return(this.isNegative()||t.isNeg())&&Uo(`unbound-bitwise-result`,`or`),Ho(K(this).or(t))}xor(e){let t=K(e);return(this.isNegative()||t.isNeg())&&Uo(`unbound-bitwise-result`,`xor`),Ho(K(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&Uo(`negative-width`,`mask`),Ho(K(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Uo(`negative-width`,`shl`),Ho(K(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Uo(`negative-width`,`shr`),Ho(K(this).shrn(e))}eq(e){return K(this).eq(K(e))}lt(e){return K(this).lt(K(e))}lte(e){return K(this).lte(K(e))}gt(e){return K(this).gt(K(e))}gte(e){return K(this).gte(K(e))}isNegative(){return this._hex[0]===`-`}isZero(){return K(this).isZero()}toNumber(){try{return K(this).toNumber()}catch{Uo(`overflow`,`toNumber`,this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Jo.throwError(`this platform does not support BigInt`,bo.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?Zo||(Zo=!0,Jo.warn(`BigNumber.toString does not accept any parameters; base-10 is assumed`)):arguments[0]===16?Jo.throwError(`BigNumber.toString does not accept any parameters; use bigNumber.toHexString()`,bo.errors.UNEXPECTED_ARGUMENT,{}):Jo.throwError(`BigNumber.toString does not accept parameters`,bo.errors.UNEXPECTED_ARGUMENT,{})),K(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:`BigNumber`,hex:this.toHexString()}}static from(t){if(t instanceof e)return t;if(typeof t==`string`)return t.match(/^-?0x[0-9a-f]+$/i)?new e(Yo,Vo(t)):t.match(/^-?[0-9]+$/)?new e(Yo,Vo(new qo(t))):Jo.throwArgumentError(`invalid BigNumber string`,`value`,t);if(typeof t==`number`)return t%1&&Uo(`underflow`,`BigNumber.from`,t),(t>=Xo||t<=-Xo)&&Uo(`overflow`,`BigNumber.from`,t),e.from(String(t));let n=t;if(typeof n==`bigint`)return e.from(n.toString());if(Oo(n))return e.from(No(n));if(n)if(n.toHexString){let t=n.toHexString();if(typeof t==`string`)return e.from(t)}else{let t=n._hex;if(t==null&&n.type===`BigNumber`&&(t=n.hex),typeof t==`string`&&(Mo(t)||t[0]===`-`&&Mo(t.substring(1))))return e.from(t)}return Jo.throwArgumentError(`invalid BigNumber value`,`value`,t)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}})),es=t((()=>{$o(),Ro(),xo(),Bo()})),ts=a(((e,t)=>{m(),s(),(function(){var e=`input is invalid type`,n=`finalize already called`,r=typeof window==`object`,i=r?window:{};i.JS_SHA3_NO_WINDOW&&(r=!1);var a=!r&&typeof self==`object`;!i.JS_SHA3_NO_NODE_JS&&typeof o==`object`&&o.versions&&o.versions.node?i=h:a&&(i=self);var s=!i.JS_SHA3_NO_COMMON_JS&&typeof t==`object`&&t.exports,c=typeof define==`function`&&define.amd,l=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<`u`,u=`0123456789abcdef`.split(``),d=[31,7936,2031616,520093696],f=[4,1024,262144,67108864],p=[1,256,65536,16777216],m=[6,1536,393216,100663296],g=[0,8,16,24],_=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],v=[224,256,384,512],y=[128,256],b=[`hex`,`buffer`,`arrayBuffer`,`array`,`digest`],x={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(e){return Object.prototype.toString.call(e)===`[object Array]`}),l&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(e){return typeof e==`object`&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var S=function(e,t,n){return function(r){return new L(e,t,e).update(r)[n]()}},C=function(e,t,n){return function(r,i){return new L(e,t,i).update(r)[n]()}},w=function(e,t,n){return function(t,r,i,a){return k[`cshake`+e].update(t,r,i,a)[n]()}},T=function(e,t,n){return function(t,r,i,a){return k[`kmac`+e].update(t,r,i,a)[n]()}},E=function(e,t,n,r){for(var i=0;i<b.length;++i){var a=b[i];e[a]=t(n,r,a)}return e},D=function(e,t){var n=S(e,t,`hex`);return n.create=function(){return new L(e,t,e)},n.update=function(e){return n.create().update(e)},E(n,S,e,t)},O=[{name:`keccak`,padding:p,bits:v,createMethod:D},{name:`sha3`,padding:m,bits:v,createMethod:D},{name:`shake`,padding:d,bits:y,createMethod:function(e,t){var n=C(e,t,`hex`);return n.create=function(n){return new L(e,t,n)},n.update=function(e,t){return n.create(t).update(e)},E(n,C,e,t)}},{name:`cshake`,padding:f,bits:y,createMethod:function(e,t){var n=x[e],r=w(e,t,`hex`);return r.create=function(r,i,a){return!i&&!a?k[`shake`+e].create(r):new L(e,t,r).bytepad([i,a],n)},r.update=function(e,t,n,i){return r.create(t,n,i).update(e)},E(r,w,e,t)}},{name:`kmac`,padding:f,bits:y,createMethod:function(e,t){var n=x[e],r=T(e,t,`hex`);return r.create=function(r,i,a){return new R(e,t,i).bytepad([`KMAC`,a],n).bytepad([r],n)},r.update=function(e,t,n,i){return r.create(e,n,i).update(t)},E(r,T,e,t)}}],k={},A=[],j=0;j<O.length;++j)for(var M=O[j],N=M.bits,P=0;P<N.length;++P){var F=M.name+`_`+N[P];if(A.push(F),k[F]=M.createMethod(N[P],M.padding),M.name!==`sha3`){var I=M.name+N[P];A.push(I),k[I]=k[F]}}function L(e,t,n){this.blocks=[],this.s=[],this.padding=t,this.outputBits=n,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(n&31)>>3;for(var r=0;r<50;++r)this.s[r]=0}L.prototype.update=function(t){if(this.finalized)throw Error(n);var r,i=typeof t;if(i!==`string`){if(i===`object`){if(t===null)throw Error(e);if(l&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!l||!ArrayBuffer.isView(t)))throw Error(e)}else throw Error(e);r=!0}for(var a=this.blocks,o=this.byteCount,s=t.length,c=this.blockCount,u=0,d=this.s,f,p;u<s;){if(this.reset)for(this.reset=!1,a[0]=this.block,f=1;f<c+1;++f)a[f]=0;if(r)for(f=this.start;u<s&&f<o;++u)a[f>>2]|=t[u]<<g[f++&3];else for(f=this.start;u<s&&f<o;++u)p=t.charCodeAt(u),p<128?a[f>>2]|=p<<g[f++&3]:p<2048?(a[f>>2]|=(192|p>>6)<<g[f++&3],a[f>>2]|=(128|p&63)<<g[f++&3]):p<55296||p>=57344?(a[f>>2]|=(224|p>>12)<<g[f++&3],a[f>>2]|=(128|p>>6&63)<<g[f++&3],a[f>>2]|=(128|p&63)<<g[f++&3]):(p=65536+((p&1023)<<10|t.charCodeAt(++u)&1023),a[f>>2]|=(240|p>>18)<<g[f++&3],a[f>>2]|=(128|p>>12&63)<<g[f++&3],a[f>>2]|=(128|p>>6&63)<<g[f++&3],a[f>>2]|=(128|p&63)<<g[f++&3]);if(this.lastByteIndex=f,f>=o){for(this.start=f-o,this.block=a[c],f=0;f<c;++f)d[f]^=a[f];ee(d),this.reset=!0}else this.start=f}return this},L.prototype.encode=function(e,t){var n=e&255,r=1,i=[n];for(e>>=8,n=e&255;n>0;)i.unshift(n),e>>=8,n=e&255,++r;return t?i.push(r):i.unshift(r),this.update(i),i.length},L.prototype.encodeString=function(t){var n,r=typeof t;if(r!==`string`){if(r===`object`){if(t===null)throw Error(e);if(l&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!l||!ArrayBuffer.isView(t)))throw Error(e)}else throw Error(e);n=!0}var i=0,a=t.length;if(n)i=a;else for(var o=0;o<t.length;++o){var s=t.charCodeAt(o);s<128?i+=1:s<2048?i+=2:s<55296||s>=57344?i+=3:(s=65536+((s&1023)<<10|t.charCodeAt(++o)&1023),i+=4)}return i+=this.encode(i*8),this.update(t),i},L.prototype.bytepad=function(e,t){for(var n=this.encode(t),r=0;r<e.length;++r)n+=this.encodeString(e[r]);var i=t-n%t,a=[];return a.length=i,this.update(a),this},L.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,n=this.blockCount,r=this.s;if(e[t>>2]|=this.padding[t&3],this.lastByteIndex===this.byteCount)for(e[0]=e[n],t=1;t<n+1;++t)e[t]=0;for(e[n-1]|=2147483648,t=0;t<n;++t)r[t]^=e[t];ee(r)}},L.prototype.toString=L.prototype.hex=function(){this.finalize();for(var e=this.blockCount,t=this.s,n=this.outputBlocks,r=this.extraBytes,i=0,a=0,o=``,s;a<n;){for(i=0;i<e&&a<n;++i,++a)s=t[i],o+=u[s>>4&15]+u[s&15]+u[s>>12&15]+u[s>>8&15]+u[s>>20&15]+u[s>>16&15]+u[s>>28&15]+u[s>>24&15];a%e===0&&(ee(t),i=0)}return r&&(s=t[i],o+=u[s>>4&15]+u[s&15],r>1&&(o+=u[s>>12&15]+u[s>>8&15]),r>2&&(o+=u[s>>20&15]+u[s>>16&15])),o},L.prototype.arrayBuffer=function(){this.finalize();for(var e=this.blockCount,t=this.s,n=this.outputBlocks,r=this.extraBytes,i=0,a=0,o=this.outputBits>>3,s=r?new ArrayBuffer(n+1<<2):new ArrayBuffer(o),c=new Uint32Array(s);a<n;){for(i=0;i<e&&a<n;++i,++a)c[a]=t[i];a%e===0&&ee(t)}return r&&(c[i]=t[i],s=s.slice(0,o)),s},L.prototype.buffer=L.prototype.arrayBuffer,L.prototype.digest=L.prototype.array=function(){this.finalize();for(var e=this.blockCount,t=this.s,n=this.outputBlocks,r=this.extraBytes,i=0,a=0,o=[],s,c;a<n;){for(i=0;i<e&&a<n;++i,++a)s=a<<2,c=t[i],o[s]=c&255,o[s+1]=c>>8&255,o[s+2]=c>>16&255,o[s+3]=c>>24&255;a%e===0&&ee(t)}return r&&(s=a<<2,c=t[i],o[s]=c&255,r>1&&(o[s+1]=c>>8&255),r>2&&(o[s+2]=c>>16&255)),o};function R(e,t,n){L.call(this,e,t,n)}R.prototype=new L,R.prototype.finalize=function(){return this.encode(this.outputBits,!0),L.prototype.finalize.call(this)};var ee=function(e){var t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,N,P,F,I,L,R,ee,te,ne,re,ie,ae,z,oe,se,ce,le,ue,de,fe,pe,me,he,ge,_e,ve,B,ye,be,xe,Se,Ce;for(r=0;r<48;r+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],a=e[1]^e[11]^e[21]^e[31]^e[41],o=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],u=e[6]^e[16]^e[26]^e[36]^e[46],d=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],p=e[9]^e[19]^e[29]^e[39]^e[49],t=f^(o<<1|s>>>31),n=p^(s<<1|o>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=i^(c<<1|l>>>31),n=a^(l<<1|c>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=o^(u<<1|d>>>31),n=s^(d<<1|u>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=c^(f<<1|p>>>31),n=l^(p<<1|f>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=u^(i<<1|a>>>31),n=d^(a<<1|i>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,m=e[0],h=e[1],se=e[11]<<4|e[10]>>>28,ce=e[10]<<4|e[11]>>>28,k=e[20]<<3|e[21]>>>29,A=e[21]<<3|e[20]>>>29,be=e[31]<<9|e[30]>>>23,xe=e[30]<<9|e[31]>>>23,ie=e[40]<<18|e[41]>>>14,ae=e[41]<<18|e[40]>>>14,F=e[2]<<1|e[3]>>>31,I=e[3]<<1|e[2]>>>31,g=e[13]<<12|e[12]>>>20,v=e[12]<<12|e[13]>>>20,le=e[22]<<10|e[23]>>>22,ue=e[23]<<10|e[22]>>>22,j=e[33]<<13|e[32]>>>19,M=e[32]<<13|e[33]>>>19,Se=e[42]<<2|e[43]>>>30,Ce=e[43]<<2|e[42]>>>30,he=e[5]<<30|e[4]>>>2,ge=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,R=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,b=e[24]<<11|e[25]>>>21,de=e[34]<<15|e[35]>>>17,fe=e[35]<<15|e[34]>>>17,N=e[45]<<29|e[44]>>>3,P=e[44]<<29|e[45]>>>3,T=e[6]<<28|e[7]>>>4,E=e[7]<<28|e[6]>>>4,_e=e[17]<<23|e[16]>>>9,ve=e[16]<<23|e[17]>>>9,ee=e[26]<<25|e[27]>>>7,te=e[27]<<25|e[26]>>>7,x=e[36]<<21|e[37]>>>11,S=e[37]<<21|e[36]>>>11,pe=e[47]<<24|e[46]>>>8,me=e[46]<<24|e[47]>>>8,z=e[8]<<27|e[9]>>>5,oe=e[9]<<27|e[8]>>>5,D=e[18]<<20|e[19]>>>12,O=e[19]<<20|e[18]>>>12,B=e[29]<<7|e[28]>>>25,ye=e[28]<<7|e[29]>>>25,ne=e[38]<<8|e[39]>>>24,re=e[39]<<8|e[38]>>>24,C=e[48]<<14|e[49]>>>18,w=e[49]<<14|e[48]>>>18,e[0]=m^~g&y,e[1]=h^~v&b,e[10]=T^~D&k,e[11]=E^~O&A,e[20]=F^~L&ee,e[21]=I^~R&te,e[30]=z^~se&le,e[31]=oe^~ce&ue,e[40]=he^~_e&B,e[41]=ge^~ve&ye,e[2]=g^~y&x,e[3]=v^~b&S,e[12]=D^~k&j,e[13]=O^~A&M,e[22]=L^~ee&ne,e[23]=R^~te&re,e[32]=se^~le&de,e[33]=ce^~ue&fe,e[42]=_e^~B&be,e[43]=ve^~ye&xe,e[4]=y^~x&C,e[5]=b^~S&w,e[14]=k^~j&N,e[15]=A^~M&P,e[24]=ee^~ne&ie,e[25]=te^~re&ae,e[34]=le^~de&pe,e[35]=ue^~fe&me,e[44]=B^~be&Se,e[45]=ye^~xe&Ce,e[6]=x^~C&m,e[7]=S^~w&h,e[16]=j^~N&T,e[17]=M^~P&E,e[26]=ne^~ie&F,e[27]=re^~ae&I,e[36]=de^~pe&z,e[37]=fe^~me&oe,e[46]=be^~Se&he,e[47]=xe^~Ce&ge,e[8]=C^~m&g,e[9]=w^~h&v,e[18]=N^~T&D,e[19]=P^~E&O,e[28]=ie^~F&L,e[29]=ae^~I&R,e[38]=pe^~z&se,e[39]=me^~oe&ce,e[48]=Se^~he&_e,e[49]=Ce^~ge&ve,e[0]^=_[r],e[1]^=_[r+1]};if(s)t.exports=k;else{for(j=0;j<A.length;++j)i[A[j]]=k[A[j]];c&&define(function(){return k})}})()})),ns=r({keccak256:()=>rs});function rs(e){return`0x`+is.default.keccak_256(ko(e))}var is,as=t((()=>{is=i(ts()),Ro()})),os,ss=t((()=>{os=`rlp/5.8.0`}));function cs(e){let t=[];for(;e;)t.unshift(e&255),e>>=8;return t}function ls(e){if(Array.isArray(e)){let t=[];if(e.forEach(function(e){t=t.concat(ls(e))}),t.length<=55)return t.unshift(192+t.length),t;let n=cs(t.length);return n.unshift(247+n.length),n.concat(t)}Eo(e)||ds.throwArgumentError(`RLP object must be BytesLike`,`object`,e);let t=Array.prototype.slice.call(ko(e));if(t.length===1&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;let n=cs(t.length);return n.unshift(183+n.length),n.concat(t)}function us(e){return No(ls(e))}var ds,fs=t((()=>{Ro(),xo(),ss(),ds=new bo(os)})),ps,ms=t((()=>{ps=`address/5.8.0`})),hs=r({getAddress:()=>ys,getContractAddress:()=>Ss,getCreate2Address:()=>Cs,getIcapAddress:()=>xs,isAddress:()=>bs});function gs(e){Mo(e,20)||ws.throwArgumentError(`invalid address`,`address`,e),e=e.toLowerCase();let t=e.substring(2).split(``),n=new Uint8Array(40);for(let e=0;e<40;e++)n[e]=t[e].charCodeAt(0);let r=ko(rs(n));for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(r[e>>1]&15)>=8&&(t[e+1]=t[e+1].toUpperCase());return`0x`+t.join(``)}function _s(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}function vs(e){e=e.toUpperCase(),e=e.substring(4)+e.substring(0,2)+`00`;let t=e.split(``).map(e=>Es[e]).join(``);for(;t.length>=Ds;){let e=t.substring(0,Ds);t=parseInt(e,10)%97+t.substring(e.length)}let n=String(98-parseInt(t,10)%97);for(;n.length<2;)n=`0`+n;return n}function ys(e){let t=null;if(typeof e!=`string`&&ws.throwArgumentError(`invalid address`,`address`,e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))e.substring(0,2)!==`0x`&&(e=`0x`+e),t=gs(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&ws.throwArgumentError(`bad address checksum`,`address`,e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==vs(e)&&ws.throwArgumentError(`bad icap checksum`,`address`,e),t=Wo(e.substring(4));t.length<40;)t=`0`+t;t=gs(`0x`+t)}else ws.throwArgumentError(`invalid address`,`address`,e);return t}function bs(e){try{return ys(e),!0}catch{}return!1}function xs(e){let t=Go(ys(e).substring(2)).toUpperCase();for(;t.length<30;)t=`0`+t;return`XE`+vs(`XE00`+t)+t}function Ss(e){let t=null;try{t=ys(e.from)}catch{ws.throwArgumentError(`missing from address`,`transaction`,e)}let n=jo(ko(Qo.from(e.nonce).toHexString()));return ys(Fo(rs(us([t,n])),12))}function Cs(e,t,n){return Po(t)!==32&&ws.throwArgumentError(`salt must be 32 bytes`,`salt`,t),Po(n)!==32&&ws.throwArgumentError(`initCodeHash must be 32 bytes`,`initCodeHash`,n),ys(Fo(rs(Ao([`0xff`,ys(e),t,n])),12))}var ws,Ts,Es,Ds,Os=t((()=>{Ro(),es(),as(),fs(),xo(),ms(),ws=new bo(ps),Ts=9007199254740991,Es={};for(let e=0;e<10;e++)Es[String(e)]=String(e);for(let e=0;e<26;e++)Es[String.fromCharCode(65+e)]=String(10+e);Ds=Math.floor(_s(Ts))})),ks=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),r=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),i=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n};Object.defineProperty(e,`__esModule`,{value:!0}),e.Bech32Address=void 0;var a=i(xn()),o=(_(),n(v)),s=(Os(),n(hs));e.Bech32Address=class e{static shortenAddress(e,t){if(t>=e.length)return e;let n=e.indexOf(`1`),r=e.slice(0,n),i=e.slice(n+1);if(t-=r.length,t-=3,--t,t<=0)return``;let a=Math.floor(i.length/2),o=i.slice(0,a),s=i.slice(a);for(;t<o.length+s.length;)(o.length+s.length)%2==1&&o.length>0?o=o.slice(0,o.length-1):s=s.slice(1);return r+`1`+o+`...`+s}static fromBech32(t,n){let r=a.default.decode(t);if(n&&r.prefix!==n)throw Error(`Unmatched prefix`);return new e(new Uint8Array((0,a.fromWords)(r.words)))}static validate(e,t){let{prefix:n}=a.default.decode(e);if(t&&t!==n)throw Error(`Unexpected prefix (expected: ${t}, actual: ${n})`)}static defaultBech32Config(e,t=`val`,n=`cons`,r=`pub`,i=`oper`){return{bech32PrefixAccAddr:e,bech32PrefixAccPub:e+r,bech32PrefixValAddr:e+t+i,bech32PrefixValPub:e+t+i+r,bech32PrefixConsAddr:e+t+n,bech32PrefixConsPub:e+t+n+r}}constructor(e){this.address=e}toBech32(e){let t=a.default.toWords(this.address);return a.default.encode(e,t)}toHex(e=!0){let t=o.Buffer.from(this.address).toString(`hex`);if(t.length===0)throw Error(`Empty address`);return e?(0,s.getAddress)(`0x`+t):`0x`+t}}})),As=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ChainIdHelper=void 0;var t=class e{static parse(t){if(t===`injective-777`||t===`injective-888`)return{identifier:t,version:0};let n=t.split(e.VersionFormatRegExp).filter(Boolean);return n.length===2?{identifier:n[0],version:parseInt(n[1])}:{identifier:t,version:0}}static hasChainVersion(t){return e.parse(t).identifier!==t}};e.ChainIdHelper=t,t.VersionFormatRegExp=/(.+)-([\d]+)/})),js=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.EthermintChainIdHelper=void 0;var t=As();e.EthermintChainIdHelper=class{static parse(e){let n=t.ChainIdHelper.parse(e);if(e.startsWith(`injective`))return[`injective-777`,`injective-888`].includes(e)?Object.assign({ethChainId:5},n):Object.assign({ethChainId:1},n);let r=e.match(`^([a-z]{1,})_{1}([1-9][0-9]*)-{1}([1-9][0-9]*)$`);if(!r||r.length!==4||r[1]===``||Number.isNaN(parseFloat(r[2]))||!Number.isInteger(parseFloat(r[2])))throw Error(`Invalid chainId for ethermint: ${e}`);return Object.assign(Object.assign({},n),{ethChainId:parseFloat(r[2])})}}})),Ms=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(As(),e),n(js(),e)})),Ns=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.WsReadyState=void 0,(function(e){e[e.CONNECTING=0]=`CONNECTING`,e[e.OPEN=1]=`OPEN`,e[e.CLOSING=2]=`CLOSING`,e[e.CLOSED=3]=`CLOSED`,e[e.NONE=4]=`NONE`})(e.WsReadyState||={})})),Ps=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.TendermintTxTracer=void 0;var t=Ns(),r=(_(),n(v));e.TendermintTxTracer=class{constructor(e,t,n={}){this.url=e,this.wsEndpoint=t,this.options=n,this.newBlockSubscribes=[],this.txSubscribes=new Map,this.pendingQueries=new Map,this.listeners={},this.onOpen=e=>{this.newBlockSubscribes.length>0&&this.sendSubscribeBlockRpc();for(let[e,t]of this.txSubscribes)this.sendSubscribeTxRpc(e,t.params);for(let[e,t]of this.pendingQueries)this.sendQueryRpc(e,t.method,t.params);for(let t of this.listeners.open??[])t(e)},this.onMessage=e=>{for(let t of this.listeners.message??[])t(e);if(e.data)try{let t=JSON.parse(e.data);if(t?.id&&this.pendingQueries.has(t.id)&&(t.error?this.pendingQueries.get(t.id).rejector(Error(t.error.data||t.error.message)):t.result?.tx_result?this.pendingQueries.get(t.id).resolver(t.result.tx_result):this.pendingQueries.get(t.id).resolver(t.result),this.pendingQueries.delete(t.id)),t?.result?.data?.type===`tendermint/event/NewBlock`)for(let e of this.newBlockSubscribes)e.handler(t.result.data.value);t?.result?.data?.type===`tendermint/event/Tx`&&t?.id&&this.txSubscribes.has(t.id)&&(t.error?this.txSubscribes.get(t.id).rejector(Error(t.error.data||t.error.message)):this.txSubscribes.get(t.id).resolver(t.result.data.value.TxResult.result),this.txSubscribes.delete(t.id))}catch{}},this.onClose=e=>{for(let t of this.listeners.close??[])t(e)},this.ws=this.options.wsObject?new this.options.wsObject(this.getWsEndpoint()):new WebSocket(this.getWsEndpoint()),this.ws.onopen=this.onOpen,this.ws.onmessage=this.onMessage,this.ws.onclose=this.onClose}getWsEndpoint(){let e=this.url;if(e.startsWith(`http`)&&(e=e.replace(`http`,`ws`)),!e.endsWith(this.wsEndpoint)){let t=this.wsEndpoint.startsWith(`/`)?this.wsEndpoint:`/`+this.wsEndpoint;e=e.endsWith(`/`)?e+t.slice(1):e+t}return e}close(){this.ws.close()}get readyState(){switch(this.ws.readyState){case 0:return t.WsReadyState.CONNECTING;case 1:return t.WsReadyState.OPEN;case 2:return t.WsReadyState.CLOSING;case 3:return t.WsReadyState.CLOSED;default:return t.WsReadyState.NONE}}addEventListener(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)}subscribeBlock(e){return this.newBlockSubscribes.push({handler:e}),this.newBlockSubscribes.length===1&&this.sendSubscribeBlockRpc(),()=>{this.newBlockSubscribes=this.newBlockSubscribes.filter(t=>t.handler!==e)}}sendSubscribeBlockRpc(){this.readyState===t.WsReadyState.OPEN&&this.ws.send(JSON.stringify({jsonrpc:`2.0`,method:`subscribe`,params:[`tm.event='NewBlock'`],id:1}))}traceTx(e){return new Promise(t=>{this.queryTx(e).then(n=>{if(e instanceof Uint8Array){t(n);return}if(n?.total_count!==`0`){t(n);return}}).catch(()=>{}),this.subscribeTx(e).then(t)}).then(e=>new Promise(t=>{setTimeout(()=>t(e),100)}))}subscribeTx(e){if(e instanceof Uint8Array){let t=this.createRandomId(),n={query:`tm.event='Tx' AND tx.hash='${r.Buffer.from(e).toString(`hex`).toUpperCase()}'`};return new Promise((e,r)=>{this.txSubscribes.set(t,{params:n,resolver:e,rejector:r}),this.sendSubscribeTxRpc(t,n)})}else{let t=this.createRandomId(),n={query:`tm.event='Tx' and `+Object.keys(e).map(t=>({key:t,value:e[t]})).map(e=>`${e.key}=${typeof e.value==`string`?`'${e.value}'`:e.value}`).join(` and `),page:`1`,per_page:`1`,order_by:`desc`};return new Promise((e,r)=>{this.txSubscribes.set(t,{params:n,resolver:e,rejector:r}),this.sendSubscribeTxRpc(t,n)})}}sendSubscribeTxRpc(e,n){this.readyState===t.WsReadyState.OPEN&&this.ws.send(JSON.stringify({jsonrpc:`2.0`,method:`subscribe`,params:n,id:e}))}queryTx(e){if(e instanceof Uint8Array)return this.query(`tx`,{hash:r.Buffer.from(e).toString(`base64`),prove:!1});{let t={query:Object.keys(e).map(t=>({key:t,value:e[t]})).map(e=>`${e.key}=${typeof e.value==`string`?`'${e.value}'`:e.value}`).join(` and `),page:`1`,per_page:`1`,order_by:`desc`};return this.query(`tx_search`,t)}}query(e,t){let n=this.createRandomId();return new Promise((r,i)=>{this.pendingQueries.set(n,{method:e,params:t,resolver:r,rejector:i}),this.sendQueryRpc(n,e,t)})}sendQueryRpc(e,n,r){this.readyState===t.WsReadyState.OPEN&&this.ws.send(JSON.stringify({jsonrpc:`2.0`,method:n,params:r,id:e}))}createRandomId(){return parseInt(Array.from({length:6}).map(()=>Math.floor(Math.random()*100)).join(``))}}})),Fs=a(((e,t)=>{t.exports=r;var n=Is();function r(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=r.zero=new r(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var a=r.zeroHash=`\0\0\0\0\0\0\0\0`;r.fromNumber=function(e){if(e===0)return i;var t=e<0;t&&(e=-e);var n=e>>>0,a=(e-n)/4294967296>>>0;return t&&(a=~a>>>0,n=~n>>>0,++n>4294967295&&(n=0,++a>4294967295&&(a=0))),new r(n,a)},r.from=function(e){if(typeof e==`number`)return r.fromNumber(e);if(n.isString(e))if(n.Long)e=n.Long.fromString(e);else return r.fromNumber(parseInt(e,10));return e.low||e.high?new r(e.low>>>0,e.high>>>0):i},r.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+n*4294967296)}return this.lo+this.hi*4294967296},r.prototype.toLong=function(e){return n.Long?new n.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var o=String.prototype.charCodeAt;r.fromHash=function(e){return e===a?i:new r((o.call(e,0)|o.call(e,1)<<8|o.call(e,2)<<16|o.call(e,3)<<24)>>>0,(o.call(e,4)|o.call(e,5)<<8|o.call(e,6)<<16|o.call(e,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},r.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},r.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}})),Is=a((e=>{m();var t=e;t.asPromise=Pr(),t.base64=Fr(),t.EventEmitter=Ir(),t.float=Lr(),t.inquire=Rr(),t.utf8=zr(),t.pool=Br(),t.LongBits=Fs(),t.isNode=!!(h!==void 0&&h&&h.process&&h.process.versions&&h.process.versions.node),t.global=t.isNode&&h||typeof window<`u`&&window||typeof self<`u`&&self||e,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e},t.isString=function(e){return typeof e==`string`||e instanceof String},t.isObject=function(e){return e&&typeof e==`object`},t.isset=t.isSet=function(e,t){var n=e[t];return n!=null&&e.hasOwnProperty(t)?typeof n!=`object`||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1},t.Buffer=(function(){try{var e=t.inquire(`buffer`).Buffer;return e.prototype.utf8Write?e:null}catch{return null}})(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(e){return typeof e==`number`?t.Buffer?t._Buffer_allocUnsafe(e):new t.Array(e):t.Buffer?t._Buffer_from(e):typeof Uint8Array>`u`?e:new Uint8Array(e)},t.Array=typeof Uint8Array<`u`?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||t.inquire(`long`),t.key2Re=/^true|false|0|1$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(e){return e?t.LongBits.from(e).toHash():t.LongBits.zeroHash},t.longFromHash=function(e,n){var r=t.LongBits.fromHash(e);return t.Long?t.Long.fromBits(r.lo,r.hi,n):r.toNumber(!!n)};function n(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;++i)(e[r[i]]===void 0||!n)&&(e[r[i]]=t[r[i]]);return e}t.merge=n,t.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function r(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,`message`,{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,`stack`,{value:Error().stack||``}),r&&n(this,r)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,`name`,{get:function(){return e}}),t.prototype.toString=function(){return this.name+`: `+this.message},t}t.newError=r,t.ProtocolError=r(`ProtocolError`),t.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(t[e[n]]===1&&this[e[n]]!==void 0&&this[e[n]]!==null)return e[n]}},t.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var e=t.Buffer;if(!e){t._Buffer_from=t._Buffer_allocUnsafe=null;return}t._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},t._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}}})),Ls=a(((e,t)=>{t.exports=u;var n=Is(),r,i=n.LongBits,a=n.base64,o=n.utf8;function s(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function c(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function u(){this.len=0,this.head=new s(c,0,0),this.tail=this.head,this.states=null}var d=function(){return n.Buffer?function(){return(u.create=function(){return new r})()}:function(){return new u}};u.create=d(),u.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(u.alloc=n.pool(u.alloc,n.Array.prototype.subarray)),u.prototype._push=function(e,t,n){return this.tail=this.tail.next=new s(e,t,n),this.len+=t,this};function f(e,t,n){t[n]=e&255}function p(e,t,n){for(;e>127;)t[n++]=e&127|128,e>>>=7;t[n]=e}function m(e,t){this.len=e,this.next=void 0,this.val=t}m.prototype=Object.create(s.prototype),m.prototype.fn=p,u.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new m((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},u.prototype.int32=function(e){return e<0?this._push(h,10,i.fromNumber(e)):this.uint32(e)},u.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function h(e,t,n){for(;e.hi;)t[n++]=e.lo&127|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=e.lo&127|128,e.lo>>>=7;t[n++]=e.lo}u.prototype.uint64=function(e){var t=i.from(e);return this._push(h,t.length(),t)},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(h,t.length(),t)},u.prototype.bool=function(e){return this._push(f,1,+!!e)};function g(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}u.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(e){var t=i.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},u.prototype.double=function(e){return this._push(n.float.writeDoubleLE,8,e)};var _=n.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};u.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(f,1,0);if(n.isString(e)){var r=u.alloc(t=a.length(e));a.decode(e,r,0),e=r}return this.uint32(t)._push(_,t,e)},u.prototype.string=function(e){var t=o.length(e);return t?this.uint32(t)._push(o.write,t,e):this._push(f,1,0)},u.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new s(c,0,0),this.len=0,this},u.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new s(c,0,0),this.len=0),this},u.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},u.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},u._configure=function(e){r=e,u.create=d(),r._configure()}})),Rs=a(((e,t)=>{t.exports=i;var n=Ls();(i.prototype=Object.create(n.prototype)).constructor=i;var r=Is();function i(){n.call(this)}i._configure=function(){i.alloc=r._Buffer_allocUnsafe,i.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&r.Buffer.prototype.set.name===`set`?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},i.prototype.bytes=function(e){r.isString(e)&&(e=r._Buffer_from(e,`base64`));var t=e.length>>>0;return this.uint32(t),t&&this._push(i.writeBytesBuffer,t,e),this};function a(e,t,n){e.length<40?r.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}i.prototype.string=function(e){var t=r.Buffer.byteLength(e);return this.uint32(t),t&&this._push(a,t,e),this},i._configure()})),zs=a(((e,t)=>{t.exports=s;var n=Is(),r,i=n.LongBits,a=n.utf8;function o(e,t){return RangeError(`index out of range: `+e.pos+` + `+(t||1)+` > `+e.len)}function s(e){this.buf=e,this.pos=0,this.len=e.length}var c=typeof Uint8Array<`u`?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new s(e);throw Error(`illegal buffer`)}:function(e){if(Array.isArray(e))return new s(e);throw Error(`illegal buffer`)},l=function(){return n.Buffer?function(e){return(s.create=function(e){return n.Buffer.isBuffer(e)?new r(e):c(e)})(e)}:c};s.create=l(),s.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,s.prototype.uint32=(function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,o(this,10);return e}})(),s.prototype.int32=function(){return this.uint32()|0},s.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function u(){var e=new i(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw o(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,e}if(this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw o(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error(`invalid varint encoding`)}s.prototype.bool=function(){return this.uint32()!==0};function d(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}s.prototype.fixed32=function(){if(this.pos+4>this.len)throw o(this,4);return d(this.buf,this.pos+=4)},s.prototype.sfixed32=function(){if(this.pos+4>this.len)throw o(this,4);return d(this.buf,this.pos+=4)|0};function f(){if(this.pos+8>this.len)throw o(this,8);return new i(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}s.prototype.float=function(){if(this.pos+4>this.len)throw o(this,4);var e=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},s.prototype.double=function(){if(this.pos+8>this.len)throw o(this,4);var e=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},s.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw o(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},s.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},s.prototype.skip=function(e){if(typeof e==`number`){if(this.pos+e>this.len)throw o(this,e);this.pos+=e}else do if(this.pos>=this.len)throw o(this);while(this.buf[this.pos++]&128);return this},s.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!=4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type `+e+` at offset `+this.pos)}return this},s._configure=function(e){r=e,s.create=l(),r._configure();var t=n.Long?`toLong`:`toNumber`;n.merge(s.prototype,{int64:function(){return u.call(this)[t](!1)},uint64:function(){return u.call(this)[t](!0)},sint64:function(){return u.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}})),Bs=a(((e,t)=>{t.exports=i;var n=zs();(i.prototype=Object.create(n.prototype)).constructor=i;var r=Is();function i(e){n.call(this,e)}i._configure=function(){r.Buffer&&(i.prototype._slice=r.Buffer.prototype.slice)},i.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString(`utf-8`,this.pos,this.pos=Math.min(this.pos+e,this.len))},i._configure()})),Vs=a(((e,t)=>{t.exports=r;var n=Is();(r.prototype=Object.create(n.EventEmitter.prototype)).constructor=r;function r(e,t,r){if(typeof e!=`function`)throw TypeError(`rpcImpl must be a function`);n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!t,this.responseDelimited=!!r}r.prototype.rpcCall=function e(t,r,i,a,o){if(!a)throw TypeError(`request must be specified`);var s=this;if(!o)return n.asPromise(e,s,t,r,i,a);if(!s.rpcImpl){setTimeout(function(){o(Error(`already ended`))},0);return}try{return s.rpcImpl(t,r[s.requestDelimited?`encodeDelimited`:`encode`](a).finish(),function(e,n){if(e)return s.emit(`error`,e,t),o(e);if(n===null){s.end(!0);return}if(!(n instanceof i))try{n=i[s.responseDelimited?`decodeDelimited`:`decode`](n)}catch(e){return s.emit(`error`,e,t),o(e)}return s.emit(`data`,n,t),o(null,n)})}catch(e){s.emit(`error`,e,t),setTimeout(function(){o(e)},0);return}},r.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit(`end`).off()),this}})),Hs=a((e=>{var t=e;t.Service=Vs()})),Us=a(((e,t)=>{t.exports={}})),Ws=a((e=>{var t=e;t.build=`minimal`,t.Writer=Ls(),t.BufferWriter=Rs(),t.Reader=zs(),t.BufferReader=Bs(),t.util=Is(),t.rpc=Hs(),t.roots=Us(),t.configure=n;function n(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}n()})),q=a(((e,t)=>{t.exports=Ws()})),Gs=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.MsgInstallBundleResponse=e.MsgInstallBundle=e.MsgProvisionResponse=e.MsgProvision=e.MsgWalletSpendActionResponse=e.MsgWalletSpendAction=e.MsgWalletActionResponse=e.MsgWalletAction=e.MsgDeliverInboundResponse=e.MsgDeliverInbound=e.protobufPackage=void 0;var n=t(G()),r=t(q());e.protobufPackage=`agoric.swingset`;function i(){return{messages:[],nums:[],ack:`0`,submitter:new Uint8Array}}e.MsgDeliverInbound={encode(e,t=r.default.Writer.create()){for(let n of e.messages)t.uint32(10).string(n);t.uint32(18).fork();for(let n of e.nums)t.uint64(n);return t.ldelim(),e.ack!==`0`&&t.uint32(24).uint64(e.ack),e.submitter.length!==0&&t.uint32(34).bytes(e.submitter),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.messages.push(n.string());break;case 2:if((e&7)==2){let e=n.uint32()+n.pos;for(;n.pos<e;)o.nums.push(x(n.uint64()))}else o.nums.push(x(n.uint64()));break;case 3:o.ack=x(n.uint64());break;case 4:o.submitter=n.bytes();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{messages:Array.isArray(e?.messages)?e.messages.map(e=>String(e)):[],nums:Array.isArray(e?.nums)?e.nums.map(e=>String(e)):[],ack:S(e.ack)?String(e.ack):`0`,submitter:S(e.submitter)?v(e.submitter):new Uint8Array}},toJSON(e){let t={};return e.messages?t.messages=e.messages.map(e=>e):t.messages=[],e.nums?t.nums=e.nums.map(e=>e):t.nums=[],e.ack!==void 0&&(t.ack=e.ack),e.submitter!==void 0&&(t.submitter=b(e.submitter===void 0?new Uint8Array:e.submitter)),t},fromPartial(e){let t=i();return t.messages=e.messages?.map(e=>e)||[],t.nums=e.nums?.map(e=>e)||[],t.ack=e.ack??`0`,t.submitter=e.submitter??new Uint8Array,t}};function a(){return{}}e.MsgDeliverInboundResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=a();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return o},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return a()}};function o(){return{owner:new Uint8Array,action:``}}e.MsgWalletAction={encode(e,t=r.default.Writer.create()){return e.owner.length!==0&&t.uint32(10).bytes(e.owner),e.action!==``&&t.uint32(18).string(e.action),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=o();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.owner=n.bytes();break;case 2:a.action=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{owner:S(e.owner)?v(e.owner):new Uint8Array,action:S(e.action)?String(e.action):``}},toJSON(e){let t={};return e.owner!==void 0&&(t.owner=b(e.owner===void 0?new Uint8Array:e.owner)),e.action!==void 0&&(t.action=e.action),t},fromPartial(e){let t=o();return t.owner=e.owner??new Uint8Array,t.action=e.action??``,t}};function s(){return{}}e.MsgWalletActionResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return s()}};function c(){return{owner:new Uint8Array,spendAction:``}}e.MsgWalletSpendAction={encode(e,t=r.default.Writer.create()){return e.owner.length!==0&&t.uint32(10).bytes(e.owner),e.spendAction!==``&&t.uint32(18).string(e.spendAction),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.owner=n.bytes();break;case 2:a.spendAction=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{owner:S(e.owner)?v(e.owner):new Uint8Array,spendAction:S(e.spendAction)?String(e.spendAction):``}},toJSON(e){let t={};return e.owner!==void 0&&(t.owner=b(e.owner===void 0?new Uint8Array:e.owner)),e.spendAction!==void 0&&(t.spendAction=e.spendAction),t},fromPartial(e){let t=c();return t.owner=e.owner??new Uint8Array,t.spendAction=e.spendAction??``,t}};function l(){return{}}e.MsgWalletSpendActionResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return l()}};function u(){return{nickname:``,address:new Uint8Array,powerFlags:[],submitter:new Uint8Array}}e.MsgProvision={encode(e,t=r.default.Writer.create()){e.nickname!==``&&t.uint32(10).string(e.nickname),e.address.length!==0&&t.uint32(18).bytes(e.address);for(let n of e.powerFlags)t.uint32(26).string(n);return e.submitter.length!==0&&t.uint32(34).bytes(e.submitter),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.nickname=n.string();break;case 2:a.address=n.bytes();break;case 3:a.powerFlags.push(n.string());break;case 4:a.submitter=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{nickname:S(e.nickname)?String(e.nickname):``,address:S(e.address)?v(e.address):new Uint8Array,powerFlags:Array.isArray(e?.powerFlags)?e.powerFlags.map(e=>String(e)):[],submitter:S(e.submitter)?v(e.submitter):new Uint8Array}},toJSON(e){let t={};return e.nickname!==void 0&&(t.nickname=e.nickname),e.address!==void 0&&(t.address=b(e.address===void 0?new Uint8Array:e.address)),e.powerFlags?t.powerFlags=e.powerFlags.map(e=>e):t.powerFlags=[],e.submitter!==void 0&&(t.submitter=b(e.submitter===void 0?new Uint8Array:e.submitter)),t},fromPartial(e){let t=u();return t.nickname=e.nickname??``,t.address=e.address??new Uint8Array,t.powerFlags=e.powerFlags?.map(e=>e)||[],t.submitter=e.submitter??new Uint8Array,t}};function d(){return{}}e.MsgProvisionResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return d()}};function f(){return{bundle:``,submitter:new Uint8Array,compressedBundle:new Uint8Array,uncompressedSize:`0`}}e.MsgInstallBundle={encode(e,t=r.default.Writer.create()){return e.bundle!==``&&t.uint32(10).string(e.bundle),e.submitter.length!==0&&t.uint32(18).bytes(e.submitter),e.compressedBundle.length!==0&&t.uint32(26).bytes(e.compressedBundle),e.uncompressedSize!==`0`&&t.uint32(32).int64(e.uncompressedSize),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.bundle=n.string();break;case 2:a.submitter=n.bytes();break;case 3:a.compressedBundle=n.bytes();break;case 4:a.uncompressedSize=x(n.int64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{bundle:S(e.bundle)?String(e.bundle):``,submitter:S(e.submitter)?v(e.submitter):new Uint8Array,compressedBundle:S(e.compressedBundle)?v(e.compressedBundle):new Uint8Array,uncompressedSize:S(e.uncompressedSize)?String(e.uncompressedSize):`0`}},toJSON(e){let t={};return e.bundle!==void 0&&(t.bundle=e.bundle),e.submitter!==void 0&&(t.submitter=b(e.submitter===void 0?new Uint8Array:e.submitter)),e.compressedBundle!==void 0&&(t.compressedBundle=b(e.compressedBundle===void 0?new Uint8Array:e.compressedBundle)),e.uncompressedSize!==void 0&&(t.uncompressedSize=e.uncompressedSize),t},fromPartial(e){let t=f();return t.bundle=e.bundle??``,t.submitter=e.submitter??new Uint8Array,t.compressedBundle=e.compressedBundle??new Uint8Array,t.uncompressedSize=e.uncompressedSize??`0`,t}};function p(){return{}}e.MsgInstallBundleResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=p();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return p()}};var g=(()=>{if(g!==void 0)return g;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),_=g.atob||(e=>g.Buffer.from(e,`base64`).toString(`binary`));function v(e){let t=_(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var y=g.btoa||(e=>g.Buffer.from(e,`binary`).toString(`base64`));function b(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return y(t.join(``))}function x(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function S(e){return e!=null}})),Ks=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.DecProto=e.IntProto=e.DecCoin=e.Coin=e.protobufPackage=void 0;var n=t(G()),r=t(q());e.protobufPackage=`cosmos.base.v1beta1`;function i(){return{denom:``,amount:``}}e.Coin={encode(e,t=r.default.Writer.create()){return e.denom!==``&&t.uint32(10).string(e.denom),e.amount!==``&&t.uint32(18).string(e.amount),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.denom=n.string();break;case 2:o.amount=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{denom:c(e.denom)?String(e.denom):``,amount:c(e.amount)?String(e.amount):``}},toJSON(e){let t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){let t=i();return t.denom=e.denom??``,t.amount=e.amount??``,t}};function a(){return{denom:``,amount:``}}e.DecCoin={encode(e,t=r.default.Writer.create()){return e.denom!==``&&t.uint32(10).string(e.denom),e.amount!==``&&t.uint32(18).string(e.amount),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=a();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.denom=n.string();break;case 2:o.amount=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{denom:c(e.denom)?String(e.denom):``,amount:c(e.amount)?String(e.amount):``}},toJSON(e){let t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){let t=a();return t.denom=e.denom??``,t.amount=e.amount??``,t}};function o(){return{int:``}}e.IntProto={encode(e,t=r.default.Writer.create()){return e.int!==``&&t.uint32(10).string(e.int),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=o();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.int=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{int:c(e.int)?String(e.int):``}},toJSON(e){let t={};return e.int!==void 0&&(t.int=e.int),t},fromPartial(e){let t=o();return t.int=e.int??``,t}};function s(){return{dec:``}}e.DecProto={encode(e,t=r.default.Writer.create()){return e.dec!==``&&t.uint32(10).string(e.dec),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.dec=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{dec:c(e.dec)?String(e.dec):``}},toJSON(e){let t={};return e.dec!==void 0&&(t.dec=e.dec),t},fromPartial(e){let t=s();return t.dec=e.dec??``,t}},r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function c(e){return e!=null}})),qs=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Metadata=e.DenomUnit=e.Supply=e.Output=e.Input=e.SendEnabled=e.Params=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=Ks();e.protobufPackage=`cosmos.bank.v1beta1`;function a(){return{sendEnabled:[],defaultSendEnabled:!1}}e.Params={encode(t,n=r.default.Writer.create()){for(let r of t.sendEnabled)e.SendEnabled.encode(r,n.uint32(10).fork()).ldelim();return t.defaultSendEnabled===!0&&n.uint32(16).bool(t.defaultSendEnabled),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?i.len:i.pos+n,s=a();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.sendEnabled.push(e.SendEnabled.decode(i,i.uint32()));break;case 2:s.defaultSendEnabled=i.bool();break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{sendEnabled:Array.isArray(t?.sendEnabled)?t.sendEnabled.map(t=>e.SendEnabled.fromJSON(t)):[],defaultSendEnabled:f(t.defaultSendEnabled)?!!t.defaultSendEnabled:!1}},toJSON(t){let n={};return t.sendEnabled?n.sendEnabled=t.sendEnabled.map(t=>t?e.SendEnabled.toJSON(t):void 0):n.sendEnabled=[],t.defaultSendEnabled!==void 0&&(n.defaultSendEnabled=t.defaultSendEnabled),n},fromPartial(t){let n=a();return n.sendEnabled=t.sendEnabled?.map(t=>e.SendEnabled.fromPartial(t))||[],n.defaultSendEnabled=t.defaultSendEnabled??!1,n}};function o(){return{denom:``,enabled:!1}}e.SendEnabled={encode(e,t=r.default.Writer.create()){return e.denom!==``&&t.uint32(10).string(e.denom),e.enabled===!0&&t.uint32(16).bool(e.enabled),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=o();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.denom=n.string();break;case 2:a.enabled=n.bool();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{denom:f(e.denom)?String(e.denom):``,enabled:f(e.enabled)?!!e.enabled:!1}},toJSON(e){let t={};return e.denom!==void 0&&(t.denom=e.denom),e.enabled!==void 0&&(t.enabled=e.enabled),t},fromPartial(e){let t=o();return t.denom=e.denom??``,t.enabled=e.enabled??!1,t}};function s(){return{address:``,coins:[]}}e.Input={encode(e,t=r.default.Writer.create()){e.address!==``&&t.uint32(10).string(e.address);for(let n of e.coins)i.Coin.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=s();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.address=n.string();break;case 2:o.coins.push(i.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{address:f(e.address)?String(e.address):``,coins:Array.isArray(e?.coins)?e.coins.map(e=>i.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.address!==void 0&&(t.address=e.address),e.coins?t.coins=e.coins.map(e=>e?i.Coin.toJSON(e):void 0):t.coins=[],t},fromPartial(e){let t=s();return t.address=e.address??``,t.coins=e.coins?.map(e=>i.Coin.fromPartial(e))||[],t}};function c(){return{address:``,coins:[]}}e.Output={encode(e,t=r.default.Writer.create()){e.address!==``&&t.uint32(10).string(e.address);for(let n of e.coins)i.Coin.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=c();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.address=n.string();break;case 2:o.coins.push(i.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{address:f(e.address)?String(e.address):``,coins:Array.isArray(e?.coins)?e.coins.map(e=>i.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.address!==void 0&&(t.address=e.address),e.coins?t.coins=e.coins.map(e=>e?i.Coin.toJSON(e):void 0):t.coins=[],t},fromPartial(e){let t=c();return t.address=e.address??``,t.coins=e.coins?.map(e=>i.Coin.fromPartial(e))||[],t}};function l(){return{total:[]}}e.Supply={encode(e,t=r.default.Writer.create()){for(let n of e.total)i.Coin.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=l();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.total.push(i.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{total:Array.isArray(e?.total)?e.total.map(e=>i.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.total?t.total=e.total.map(e=>e?i.Coin.toJSON(e):void 0):t.total=[],t},fromPartial(e){let t=l();return t.total=e.total?.map(e=>i.Coin.fromPartial(e))||[],t}};function u(){return{denom:``,exponent:0,aliases:[]}}e.DenomUnit={encode(e,t=r.default.Writer.create()){e.denom!==``&&t.uint32(10).string(e.denom),e.exponent!==0&&t.uint32(16).uint32(e.exponent);for(let n of e.aliases)t.uint32(26).string(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.denom=n.string();break;case 2:a.exponent=n.uint32();break;case 3:a.aliases.push(n.string());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{denom:f(e.denom)?String(e.denom):``,exponent:f(e.exponent)?Number(e.exponent):0,aliases:Array.isArray(e?.aliases)?e.aliases.map(e=>String(e)):[]}},toJSON(e){let t={};return e.denom!==void 0&&(t.denom=e.denom),e.exponent!==void 0&&(t.exponent=Math.round(e.exponent)),e.aliases?t.aliases=e.aliases.map(e=>e):t.aliases=[],t},fromPartial(e){let t=u();return t.denom=e.denom??``,t.exponent=e.exponent??0,t.aliases=e.aliases?.map(e=>e)||[],t}};function d(){return{description:``,denomUnits:[],base:``,display:``,name:``,symbol:``}}e.Metadata={encode(t,n=r.default.Writer.create()){t.description!==``&&n.uint32(10).string(t.description);for(let r of t.denomUnits)e.DenomUnit.encode(r,n.uint32(18).fork()).ldelim();return t.base!==``&&n.uint32(26).string(t.base),t.display!==``&&n.uint32(34).string(t.display),t.name!==``&&n.uint32(42).string(t.name),t.symbol!==``&&n.uint32(50).string(t.symbol),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=d();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.description=i.string();break;case 2:o.denomUnits.push(e.DenomUnit.decode(i,i.uint32()));break;case 3:o.base=i.string();break;case 4:o.display=i.string();break;case 5:o.name=i.string();break;case 6:o.symbol=i.string();break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{description:f(t.description)?String(t.description):``,denomUnits:Array.isArray(t?.denomUnits)?t.denomUnits.map(t=>e.DenomUnit.fromJSON(t)):[],base:f(t.base)?String(t.base):``,display:f(t.display)?String(t.display):``,name:f(t.name)?String(t.name):``,symbol:f(t.symbol)?String(t.symbol):``}},toJSON(t){let n={};return t.description!==void 0&&(n.description=t.description),t.denomUnits?n.denomUnits=t.denomUnits.map(t=>t?e.DenomUnit.toJSON(t):void 0):n.denomUnits=[],t.base!==void 0&&(n.base=t.base),t.display!==void 0&&(n.display=t.display),t.name!==void 0&&(n.name=t.name),t.symbol!==void 0&&(n.symbol=t.symbol),n},fromPartial(t){let n=d();return n.description=t.description??``,n.denomUnits=t.denomUnits?.map(t=>e.DenomUnit.fromPartial(t))||[],n.base=t.base??``,n.display=t.display??``,n.name=t.name??``,n.symbol=t.symbol??``,n}},r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function f(e){return e!=null}})),Js=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.MsgMultiSendResponse=e.MsgMultiSend=e.MsgSendResponse=e.MsgSend=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=Ks(),a=qs();e.protobufPackage=`cosmos.bank.v1beta1`;function o(){return{fromAddress:``,toAddress:``,amount:[]}}e.MsgSend={encode(e,t=r.default.Writer.create()){e.fromAddress!==``&&t.uint32(10).string(e.fromAddress),e.toAddress!==``&&t.uint32(18).string(e.toAddress);for(let n of e.amount)i.Coin.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,s=o();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:s.fromAddress=n.string();break;case 2:s.toAddress=n.string();break;case 3:s.amount.push(i.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{fromAddress:u(e.fromAddress)?String(e.fromAddress):``,toAddress:u(e.toAddress)?String(e.toAddress):``,amount:Array.isArray(e?.amount)?e.amount.map(e=>i.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.fromAddress!==void 0&&(t.fromAddress=e.fromAddress),e.toAddress!==void 0&&(t.toAddress=e.toAddress),e.amount?t.amount=e.amount.map(e=>e?i.Coin.toJSON(e):void 0):t.amount=[],t},fromPartial(e){let t=o();return t.fromAddress=e.fromAddress??``,t.toAddress=e.toAddress??``,t.amount=e.amount?.map(e=>i.Coin.fromPartial(e))||[],t}};function s(){return{}}e.MsgSendResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return s()}};function c(){return{inputs:[],outputs:[]}}e.MsgMultiSend={encode(e,t=r.default.Writer.create()){for(let n of e.inputs)a.Input.encode(n,t.uint32(10).fork()).ldelim();for(let n of e.outputs)a.Output.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.inputs.push(a.Input.decode(n,n.uint32()));break;case 2:o.outputs.push(a.Output.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{inputs:Array.isArray(e?.inputs)?e.inputs.map(e=>a.Input.fromJSON(e)):[],outputs:Array.isArray(e?.outputs)?e.outputs.map(e=>a.Output.fromJSON(e)):[]}},toJSON(e){let t={};return e.inputs?t.inputs=e.inputs.map(e=>e?a.Input.toJSON(e):void 0):t.inputs=[],e.outputs?t.outputs=e.outputs.map(e=>e?a.Output.toJSON(e):void 0):t.outputs=[],t},fromPartial(e){let t=c();return t.inputs=e.inputs?.map(e=>a.Input.fromPartial(e))||[],t.outputs=e.outputs?.map(e=>a.Output.fromPartial(e))||[],t}};function l(){return{}}e.MsgMultiSendResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return l()}},r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function u(e){return e!=null}})),Ys=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Timestamp=e.protobufPackage=void 0;var n=t(G()),r=t(q());e.protobufPackage=`google.protobuf`;function i(){return{seconds:`0`,nanos:0}}e.Timestamp={encode(e,t=r.default.Writer.create()){return e.seconds!==`0`&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),o=t===void 0?n.len:n.pos+t,s=i();for(;n.pos<o;){let e=n.uint32();switch(e>>>3){case 1:s.seconds=a(n.int64());break;case 2:s.nanos=n.int32();break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{seconds:o(e.seconds)?String(e.seconds):`0`,nanos:o(e.nanos)?Number(e.nanos):0}},toJSON(e){let t={};return e.seconds!==void 0&&(t.seconds=e.seconds),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){let t=i();return t.seconds=e.seconds??`0`,t.nanos=e.nanos??0,t}};function a(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function o(e){return e!=null}})),Xs=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.ProofOps=e.ProofOp=e.DominoOp=e.ValueOp=e.Proof=e.protobufPackage=void 0;var n=t(G()),r=t(q());e.protobufPackage=`tendermint.crypto`;function i(){return{total:`0`,index:`0`,leafHash:new Uint8Array,aunts:[]}}e.Proof={encode(e,t=r.default.Writer.create()){e.total!==`0`&&t.uint32(8).int64(e.total),e.index!==`0`&&t.uint32(16).int64(e.index),e.leafHash.length!==0&&t.uint32(26).bytes(e.leafHash);for(let n of e.aunts)t.uint32(34).bytes(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.total=g(n.int64());break;case 2:o.index=g(n.int64());break;case 3:o.leafHash=n.bytes();break;case 4:o.aunts.push(n.bytes());break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{total:_(e.total)?String(e.total):`0`,index:_(e.index)?String(e.index):`0`,leafHash:_(e.leafHash)?d(e.leafHash):new Uint8Array,aunts:Array.isArray(e?.aunts)?e.aunts.map(e=>d(e)):[]}},toJSON(e){let t={};return e.total!==void 0&&(t.total=e.total),e.index!==void 0&&(t.index=e.index),e.leafHash!==void 0&&(t.leafHash=p(e.leafHash===void 0?new Uint8Array:e.leafHash)),e.aunts?t.aunts=e.aunts.map(e=>p(e===void 0?new Uint8Array:e)):t.aunts=[],t},fromPartial(e){let t=i();return t.total=e.total??`0`,t.index=e.index??`0`,t.leafHash=e.leafHash??new Uint8Array,t.aunts=e.aunts?.map(e=>e)||[],t}};function a(){return{key:new Uint8Array,proof:void 0}}e.ValueOp={encode(t,n=r.default.Writer.create()){return t.key.length!==0&&n.uint32(10).bytes(t.key),t.proof!==void 0&&e.Proof.encode(t.proof,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?i.len:i.pos+n,s=a();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.key=i.bytes();break;case 2:s.proof=e.Proof.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{key:_(t.key)?d(t.key):new Uint8Array,proof:_(t.proof)?e.Proof.fromJSON(t.proof):void 0}},toJSON(t){let n={};return t.key!==void 0&&(n.key=p(t.key===void 0?new Uint8Array:t.key)),t.proof!==void 0&&(n.proof=t.proof?e.Proof.toJSON(t.proof):void 0),n},fromPartial(t){let n=a();return n.key=t.key??new Uint8Array,n.proof=t.proof!==void 0&&t.proof!==null?e.Proof.fromPartial(t.proof):void 0,n}};function o(){return{key:``,input:``,output:``}}e.DominoOp={encode(e,t=r.default.Writer.create()){return e.key!==``&&t.uint32(10).string(e.key),e.input!==``&&t.uint32(18).string(e.input),e.output!==``&&t.uint32(26).string(e.output),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=o();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.key=n.string();break;case 2:a.input=n.string();break;case 3:a.output=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{key:_(e.key)?String(e.key):``,input:_(e.input)?String(e.input):``,output:_(e.output)?String(e.output):``}},toJSON(e){let t={};return e.key!==void 0&&(t.key=e.key),e.input!==void 0&&(t.input=e.input),e.output!==void 0&&(t.output=e.output),t},fromPartial(e){let t=o();return t.key=e.key??``,t.input=e.input??``,t.output=e.output??``,t}};function s(){return{type:``,key:new Uint8Array,data:new Uint8Array}}e.ProofOp={encode(e,t=r.default.Writer.create()){return e.type!==``&&t.uint32(10).string(e.type),e.key.length!==0&&t.uint32(18).bytes(e.key),e.data.length!==0&&t.uint32(26).bytes(e.data),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.type=n.string();break;case 2:a.key=n.bytes();break;case 3:a.data=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{type:_(e.type)?String(e.type):``,key:_(e.key)?d(e.key):new Uint8Array,data:_(e.data)?d(e.data):new Uint8Array}},toJSON(e){let t={};return e.type!==void 0&&(t.type=e.type),e.key!==void 0&&(t.key=p(e.key===void 0?new Uint8Array:e.key)),e.data!==void 0&&(t.data=p(e.data===void 0?new Uint8Array:e.data)),t},fromPartial(e){let t=s();return t.type=e.type??``,t.key=e.key??new Uint8Array,t.data=e.data??new Uint8Array,t}};function c(){return{ops:[]}}e.ProofOps={encode(t,n=r.default.Writer.create()){for(let r of t.ops)e.ProofOp.encode(r,n.uint32(10).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=c();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.ops.push(e.ProofOp.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{ops:Array.isArray(t?.ops)?t.ops.map(t=>e.ProofOp.fromJSON(t)):[]}},toJSON(t){let n={};return t.ops?n.ops=t.ops.map(t=>t?e.ProofOp.toJSON(t):void 0):n.ops=[],n},fromPartial(t){let n=c();return n.ops=t.ops?.map(t=>e.ProofOp.fromPartial(t))||[],n}};var l=(()=>{if(l!==void 0)return l;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),u=l.atob||(e=>l.Buffer.from(e,`base64`).toString(`binary`));function d(e){let t=u(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var f=l.btoa||(e=>l.Buffer.from(e,`binary`).toString(`base64`));function p(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return f(t.join(``))}function g(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function _(e){return e!=null}})),Zs=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Consensus=e.App=e.protobufPackage=void 0;var n=t(G()),r=t(q());e.protobufPackage=`tendermint.version`;function i(){return{protocol:`0`,software:``}}e.App={encode(e,t=r.default.Writer.create()){return e.protocol!==`0`&&t.uint32(8).uint64(e.protocol),e.software!==``&&t.uint32(18).string(e.software),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,s=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:s.protocol=o(n.uint64());break;case 2:s.software=n.string();break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{protocol:s(e.protocol)?String(e.protocol):`0`,software:s(e.software)?String(e.software):``}},toJSON(e){let t={};return e.protocol!==void 0&&(t.protocol=e.protocol),e.software!==void 0&&(t.software=e.software),t},fromPartial(e){let t=i();return t.protocol=e.protocol??`0`,t.software=e.software??``,t}};function a(){return{block:`0`,app:`0`}}e.Consensus={encode(e,t=r.default.Writer.create()){return e.block!==`0`&&t.uint32(8).uint64(e.block),e.app!==`0`&&t.uint32(16).uint64(e.app),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,s=a();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:s.block=o(n.uint64());break;case 2:s.app=o(n.uint64());break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{block:s(e.block)?String(e.block):`0`,app:s(e.app)?String(e.app):`0`}},toJSON(e){let t={};return e.block!==void 0&&(t.block=e.block),e.app!==void 0&&(t.app=e.app),t},fromPartial(e){let t=a();return t.block=e.block??`0`,t.app=e.app??`0`,t}};function o(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function s(e){return e!=null}})),Qs=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.PublicKey=e.protobufPackage=void 0;var n=t(G()),r=t(q());e.protobufPackage=`tendermint.crypto`;function i(){return{ed25519:void 0,secp256k1:void 0}}e.PublicKey={encode(e,t=r.default.Writer.create()){return e.ed25519!==void 0&&t.uint32(10).bytes(e.ed25519),e.secp256k1!==void 0&&t.uint32(18).bytes(e.secp256k1),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.ed25519=n.bytes();break;case 2:o.secp256k1=n.bytes();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{ed25519:u(e.ed25519)?s(e.ed25519):void 0,secp256k1:u(e.secp256k1)?s(e.secp256k1):void 0}},toJSON(e){let t={};return e.ed25519!==void 0&&(t.ed25519=e.ed25519===void 0?void 0:l(e.ed25519)),e.secp256k1!==void 0&&(t.secp256k1=e.secp256k1===void 0?void 0:l(e.secp256k1)),t},fromPartial(e){let t=i();return t.ed25519=e.ed25519??void 0,t.secp256k1=e.secp256k1??void 0,t}};var a=(()=>{if(a!==void 0)return a;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),o=a.atob||(e=>a.Buffer.from(e,`base64`).toString(`binary`));function s(e){let t=o(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var c=a.btoa||(e=>a.Buffer.from(e,`binary`).toString(`base64`));function l(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return c(t.join(``))}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function u(e){return e!=null}})),$s=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.SimpleValidator=e.Validator=e.ValidatorSet=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=Qs();e.protobufPackage=`tendermint.types`;function a(){return{validators:[],proposer:void 0,totalVotingPower:`0`}}e.ValidatorSet={encode(t,n=r.default.Writer.create()){for(let r of t.validators)e.Validator.encode(r,n.uint32(10).fork()).ldelim();return t.proposer!==void 0&&e.Validator.encode(t.proposer,n.uint32(18).fork()).ldelim(),t.totalVotingPower!==`0`&&n.uint32(24).int64(t.totalVotingPower),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?i.len:i.pos+n,s=a();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.validators.push(e.Validator.decode(i,i.uint32()));break;case 2:s.proposer=e.Validator.decode(i,i.uint32());break;case 3:s.totalVotingPower=p(i.int64());break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{validators:Array.isArray(t?.validators)?t.validators.map(t=>e.Validator.fromJSON(t)):[],proposer:g(t.proposer)?e.Validator.fromJSON(t.proposer):void 0,totalVotingPower:g(t.totalVotingPower)?String(t.totalVotingPower):`0`}},toJSON(t){let n={};return t.validators?n.validators=t.validators.map(t=>t?e.Validator.toJSON(t):void 0):n.validators=[],t.proposer!==void 0&&(n.proposer=t.proposer?e.Validator.toJSON(t.proposer):void 0),t.totalVotingPower!==void 0&&(n.totalVotingPower=t.totalVotingPower),n},fromPartial(t){let n=a();return n.validators=t.validators?.map(t=>e.Validator.fromPartial(t))||[],n.proposer=t.proposer!==void 0&&t.proposer!==null?e.Validator.fromPartial(t.proposer):void 0,n.totalVotingPower=t.totalVotingPower??`0`,n}};function o(){return{address:new Uint8Array,pubKey:void 0,votingPower:`0`,proposerPriority:`0`}}e.Validator={encode(e,t=r.default.Writer.create()){return e.address.length!==0&&t.uint32(10).bytes(e.address),e.pubKey!==void 0&&i.PublicKey.encode(e.pubKey,t.uint32(18).fork()).ldelim(),e.votingPower!==`0`&&t.uint32(24).int64(e.votingPower),e.proposerPriority!==`0`&&t.uint32(32).int64(e.proposerPriority),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,s=o();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:s.address=n.bytes();break;case 2:s.pubKey=i.PublicKey.decode(n,n.uint32());break;case 3:s.votingPower=p(n.int64());break;case 4:s.proposerPriority=p(n.int64());break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{address:g(e.address)?u(e.address):new Uint8Array,pubKey:g(e.pubKey)?i.PublicKey.fromJSON(e.pubKey):void 0,votingPower:g(e.votingPower)?String(e.votingPower):`0`,proposerPriority:g(e.proposerPriority)?String(e.proposerPriority):`0`}},toJSON(e){let t={};return e.address!==void 0&&(t.address=f(e.address===void 0?new Uint8Array:e.address)),e.pubKey!==void 0&&(t.pubKey=e.pubKey?i.PublicKey.toJSON(e.pubKey):void 0),e.votingPower!==void 0&&(t.votingPower=e.votingPower),e.proposerPriority!==void 0&&(t.proposerPriority=e.proposerPriority),t},fromPartial(e){let t=o();return t.address=e.address??new Uint8Array,t.pubKey=e.pubKey!==void 0&&e.pubKey!==null?i.PublicKey.fromPartial(e.pubKey):void 0,t.votingPower=e.votingPower??`0`,t.proposerPriority=e.proposerPriority??`0`,t}};function s(){return{pubKey:void 0,votingPower:`0`}}e.SimpleValidator={encode(e,t=r.default.Writer.create()){return e.pubKey!==void 0&&i.PublicKey.encode(e.pubKey,t.uint32(10).fork()).ldelim(),e.votingPower!==`0`&&t.uint32(16).int64(e.votingPower),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=s();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.pubKey=i.PublicKey.decode(n,n.uint32());break;case 2:o.votingPower=p(n.int64());break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{pubKey:g(e.pubKey)?i.PublicKey.fromJSON(e.pubKey):void 0,votingPower:g(e.votingPower)?String(e.votingPower):`0`}},toJSON(e){let t={};return e.pubKey!==void 0&&(t.pubKey=e.pubKey?i.PublicKey.toJSON(e.pubKey):void 0),e.votingPower!==void 0&&(t.votingPower=e.votingPower),t},fromPartial(e){let t=s();return t.pubKey=e.pubKey!==void 0&&e.pubKey!==null?i.PublicKey.fromPartial(e.pubKey):void 0,t.votingPower=e.votingPower??`0`,t}};var c=(()=>{if(c!==void 0)return c;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),l=c.atob||(e=>c.Buffer.from(e,`base64`).toString(`binary`));function u(e){let t=l(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var d=c.btoa||(e=>c.Buffer.from(e,`binary`).toString(`base64`));function f(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return d(t.join(``))}function p(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function g(e){return e!=null}})),ec=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.TxProof=e.BlockMeta=e.LightBlock=e.SignedHeader=e.Proposal=e.CommitSig=e.Commit=e.Vote=e.Data=e.Header=e.BlockID=e.Part=e.PartSetHeader=e.signedMsgTypeToJSON=e.signedMsgTypeFromJSON=e.SignedMsgType=e.blockIDFlagToJSON=e.blockIDFlagFromJSON=e.BlockIDFlag=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=Ys(),a=Xs(),o=Zs(),s=$s();e.protobufPackage=`tendermint.types`;var c;(function(e){e[e.BLOCK_ID_FLAG_UNKNOWN=0]=`BLOCK_ID_FLAG_UNKNOWN`,e[e.BLOCK_ID_FLAG_ABSENT=1]=`BLOCK_ID_FLAG_ABSENT`,e[e.BLOCK_ID_FLAG_COMMIT=2]=`BLOCK_ID_FLAG_COMMIT`,e[e.BLOCK_ID_FLAG_NIL=3]=`BLOCK_ID_FLAG_NIL`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(c=e.BlockIDFlag||={});function l(e){switch(e){case 0:case`BLOCK_ID_FLAG_UNKNOWN`:return c.BLOCK_ID_FLAG_UNKNOWN;case 1:case`BLOCK_ID_FLAG_ABSENT`:return c.BLOCK_ID_FLAG_ABSENT;case 2:case`BLOCK_ID_FLAG_COMMIT`:return c.BLOCK_ID_FLAG_COMMIT;case 3:case`BLOCK_ID_FLAG_NIL`:return c.BLOCK_ID_FLAG_NIL;default:return c.UNRECOGNIZED}}e.blockIDFlagFromJSON=l;function u(e){switch(e){case c.BLOCK_ID_FLAG_UNKNOWN:return`BLOCK_ID_FLAG_UNKNOWN`;case c.BLOCK_ID_FLAG_ABSENT:return`BLOCK_ID_FLAG_ABSENT`;case c.BLOCK_ID_FLAG_COMMIT:return`BLOCK_ID_FLAG_COMMIT`;case c.BLOCK_ID_FLAG_NIL:return`BLOCK_ID_FLAG_NIL`;default:return`UNKNOWN`}}e.blockIDFlagToJSON=u;var d;(function(e){e[e.SIGNED_MSG_TYPE_UNKNOWN=0]=`SIGNED_MSG_TYPE_UNKNOWN`,e[e.SIGNED_MSG_TYPE_PREVOTE=1]=`SIGNED_MSG_TYPE_PREVOTE`,e[e.SIGNED_MSG_TYPE_PRECOMMIT=2]=`SIGNED_MSG_TYPE_PRECOMMIT`,e[e.SIGNED_MSG_TYPE_PROPOSAL=32]=`SIGNED_MSG_TYPE_PROPOSAL`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(d=e.SignedMsgType||={});function f(e){switch(e){case 0:case`SIGNED_MSG_TYPE_UNKNOWN`:return d.SIGNED_MSG_TYPE_UNKNOWN;case 1:case`SIGNED_MSG_TYPE_PREVOTE`:return d.SIGNED_MSG_TYPE_PREVOTE;case 2:case`SIGNED_MSG_TYPE_PRECOMMIT`:return d.SIGNED_MSG_TYPE_PRECOMMIT;case 32:case`SIGNED_MSG_TYPE_PROPOSAL`:return d.SIGNED_MSG_TYPE_PROPOSAL;default:return d.UNRECOGNIZED}}e.signedMsgTypeFromJSON=f;function p(e){switch(e){case d.SIGNED_MSG_TYPE_UNKNOWN:return`SIGNED_MSG_TYPE_UNKNOWN`;case d.SIGNED_MSG_TYPE_PREVOTE:return`SIGNED_MSG_TYPE_PREVOTE`;case d.SIGNED_MSG_TYPE_PRECOMMIT:return`SIGNED_MSG_TYPE_PRECOMMIT`;case d.SIGNED_MSG_TYPE_PROPOSAL:return`SIGNED_MSG_TYPE_PROPOSAL`;default:return`UNKNOWN`}}e.signedMsgTypeToJSON=p;function g(){return{total:0,hash:new Uint8Array}}e.PartSetHeader={encode(e,t=r.default.Writer.create()){return e.total!==0&&t.uint32(8).uint32(e.total),e.hash.length!==0&&t.uint32(18).bytes(e.hash),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=g();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.total=n.uint32();break;case 2:a.hash=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{total:R(e.total)?Number(e.total):0,hash:R(e.hash)?j(e.hash):new Uint8Array}},toJSON(e){let t={};return e.total!==void 0&&(t.total=Math.round(e.total)),e.hash!==void 0&&(t.hash=N(e.hash===void 0?new Uint8Array:e.hash)),t},fromPartial(e){let t=g();return t.total=e.total??0,t.hash=e.hash??new Uint8Array,t}};function _(){return{index:0,bytes:new Uint8Array,proof:void 0}}e.Part={encode(e,t=r.default.Writer.create()){return e.index!==0&&t.uint32(8).uint32(e.index),e.bytes.length!==0&&t.uint32(18).bytes(e.bytes),e.proof!==void 0&&a.Proof.encode(e.proof,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=_();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.index=n.uint32();break;case 2:o.bytes=n.bytes();break;case 3:o.proof=a.Proof.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{index:R(e.index)?Number(e.index):0,bytes:R(e.bytes)?j(e.bytes):new Uint8Array,proof:R(e.proof)?a.Proof.fromJSON(e.proof):void 0}},toJSON(e){let t={};return e.index!==void 0&&(t.index=Math.round(e.index)),e.bytes!==void 0&&(t.bytes=N(e.bytes===void 0?new Uint8Array:e.bytes)),e.proof!==void 0&&(t.proof=e.proof?a.Proof.toJSON(e.proof):void 0),t},fromPartial(e){let t=_();return t.index=e.index??0,t.bytes=e.bytes??new Uint8Array,t.proof=e.proof!==void 0&&e.proof!==null?a.Proof.fromPartial(e.proof):void 0,t}};function v(){return{hash:new Uint8Array,partSetHeader:void 0}}e.BlockID={encode(t,n=r.default.Writer.create()){return t.hash.length!==0&&n.uint32(10).bytes(t.hash),t.partSetHeader!==void 0&&e.PartSetHeader.encode(t.partSetHeader,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=v();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.hash=i.bytes();break;case 2:o.partSetHeader=e.PartSetHeader.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{hash:R(t.hash)?j(t.hash):new Uint8Array,partSetHeader:R(t.partSetHeader)?e.PartSetHeader.fromJSON(t.partSetHeader):void 0}},toJSON(t){let n={};return t.hash!==void 0&&(n.hash=N(t.hash===void 0?new Uint8Array:t.hash)),t.partSetHeader!==void 0&&(n.partSetHeader=t.partSetHeader?e.PartSetHeader.toJSON(t.partSetHeader):void 0),n},fromPartial(t){let n=v();return n.hash=t.hash??new Uint8Array,n.partSetHeader=t.partSetHeader!==void 0&&t.partSetHeader!==null?e.PartSetHeader.fromPartial(t.partSetHeader):void 0,n}};function y(){return{version:void 0,chainId:``,height:`0`,time:void 0,lastBlockId:void 0,lastCommitHash:new Uint8Array,dataHash:new Uint8Array,validatorsHash:new Uint8Array,nextValidatorsHash:new Uint8Array,consensusHash:new Uint8Array,appHash:new Uint8Array,lastResultsHash:new Uint8Array,evidenceHash:new Uint8Array,proposerAddress:new Uint8Array}}e.Header={encode(t,n=r.default.Writer.create()){return t.version!==void 0&&o.Consensus.encode(t.version,n.uint32(10).fork()).ldelim(),t.chainId!==``&&n.uint32(18).string(t.chainId),t.height!==`0`&&n.uint32(24).int64(t.height),t.time!==void 0&&i.Timestamp.encode(P(t.time),n.uint32(34).fork()).ldelim(),t.lastBlockId!==void 0&&e.BlockID.encode(t.lastBlockId,n.uint32(42).fork()).ldelim(),t.lastCommitHash.length!==0&&n.uint32(50).bytes(t.lastCommitHash),t.dataHash.length!==0&&n.uint32(58).bytes(t.dataHash),t.validatorsHash.length!==0&&n.uint32(66).bytes(t.validatorsHash),t.nextValidatorsHash.length!==0&&n.uint32(74).bytes(t.nextValidatorsHash),t.consensusHash.length!==0&&n.uint32(82).bytes(t.consensusHash),t.appHash.length!==0&&n.uint32(90).bytes(t.appHash),t.lastResultsHash.length!==0&&n.uint32(98).bytes(t.lastResultsHash),t.evidenceHash.length!==0&&n.uint32(106).bytes(t.evidenceHash),t.proposerAddress.length!==0&&n.uint32(114).bytes(t.proposerAddress),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),s=n===void 0?a.len:a.pos+n,c=y();for(;a.pos<s;){let t=a.uint32();switch(t>>>3){case 1:c.version=o.Consensus.decode(a,a.uint32());break;case 2:c.chainId=a.string();break;case 3:c.height=L(a.int64());break;case 4:c.time=F(i.Timestamp.decode(a,a.uint32()));break;case 5:c.lastBlockId=e.BlockID.decode(a,a.uint32());break;case 6:c.lastCommitHash=a.bytes();break;case 7:c.dataHash=a.bytes();break;case 8:c.validatorsHash=a.bytes();break;case 9:c.nextValidatorsHash=a.bytes();break;case 10:c.consensusHash=a.bytes();break;case 11:c.appHash=a.bytes();break;case 12:c.lastResultsHash=a.bytes();break;case 13:c.evidenceHash=a.bytes();break;case 14:c.proposerAddress=a.bytes();break;default:a.skipType(t&7);break}}return c},fromJSON(t){return{version:R(t.version)?o.Consensus.fromJSON(t.version):void 0,chainId:R(t.chainId)?String(t.chainId):``,height:R(t.height)?String(t.height):`0`,time:R(t.time)?I(t.time):void 0,lastBlockId:R(t.lastBlockId)?e.BlockID.fromJSON(t.lastBlockId):void 0,lastCommitHash:R(t.lastCommitHash)?j(t.lastCommitHash):new Uint8Array,dataHash:R(t.dataHash)?j(t.dataHash):new Uint8Array,validatorsHash:R(t.validatorsHash)?j(t.validatorsHash):new Uint8Array,nextValidatorsHash:R(t.nextValidatorsHash)?j(t.nextValidatorsHash):new Uint8Array,consensusHash:R(t.consensusHash)?j(t.consensusHash):new Uint8Array,appHash:R(t.appHash)?j(t.appHash):new Uint8Array,lastResultsHash:R(t.lastResultsHash)?j(t.lastResultsHash):new Uint8Array,evidenceHash:R(t.evidenceHash)?j(t.evidenceHash):new Uint8Array,proposerAddress:R(t.proposerAddress)?j(t.proposerAddress):new Uint8Array}},toJSON(t){let n={};return t.version!==void 0&&(n.version=t.version?o.Consensus.toJSON(t.version):void 0),t.chainId!==void 0&&(n.chainId=t.chainId),t.height!==void 0&&(n.height=t.height),t.time!==void 0&&(n.time=t.time.toISOString()),t.lastBlockId!==void 0&&(n.lastBlockId=t.lastBlockId?e.BlockID.toJSON(t.lastBlockId):void 0),t.lastCommitHash!==void 0&&(n.lastCommitHash=N(t.lastCommitHash===void 0?new Uint8Array:t.lastCommitHash)),t.dataHash!==void 0&&(n.dataHash=N(t.dataHash===void 0?new Uint8Array:t.dataHash)),t.validatorsHash!==void 0&&(n.validatorsHash=N(t.validatorsHash===void 0?new Uint8Array:t.validatorsHash)),t.nextValidatorsHash!==void 0&&(n.nextValidatorsHash=N(t.nextValidatorsHash===void 0?new Uint8Array:t.nextValidatorsHash)),t.consensusHash!==void 0&&(n.consensusHash=N(t.consensusHash===void 0?new Uint8Array:t.consensusHash)),t.appHash!==void 0&&(n.appHash=N(t.appHash===void 0?new Uint8Array:t.appHash)),t.lastResultsHash!==void 0&&(n.lastResultsHash=N(t.lastResultsHash===void 0?new Uint8Array:t.lastResultsHash)),t.evidenceHash!==void 0&&(n.evidenceHash=N(t.evidenceHash===void 0?new Uint8Array:t.evidenceHash)),t.proposerAddress!==void 0&&(n.proposerAddress=N(t.proposerAddress===void 0?new Uint8Array:t.proposerAddress)),n},fromPartial(t){let n=y();return n.version=t.version!==void 0&&t.version!==null?o.Consensus.fromPartial(t.version):void 0,n.chainId=t.chainId??``,n.height=t.height??`0`,n.time=t.time??void 0,n.lastBlockId=t.lastBlockId!==void 0&&t.lastBlockId!==null?e.BlockID.fromPartial(t.lastBlockId):void 0,n.lastCommitHash=t.lastCommitHash??new Uint8Array,n.dataHash=t.dataHash??new Uint8Array,n.validatorsHash=t.validatorsHash??new Uint8Array,n.nextValidatorsHash=t.nextValidatorsHash??new Uint8Array,n.consensusHash=t.consensusHash??new Uint8Array,n.appHash=t.appHash??new Uint8Array,n.lastResultsHash=t.lastResultsHash??new Uint8Array,n.evidenceHash=t.evidenceHash??new Uint8Array,n.proposerAddress=t.proposerAddress??new Uint8Array,n}};function b(){return{txs:[]}}e.Data={encode(e,t=r.default.Writer.create()){for(let n of e.txs)t.uint32(10).bytes(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=b();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.txs.push(n.bytes());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{txs:Array.isArray(e?.txs)?e.txs.map(e=>j(e)):[]}},toJSON(e){let t={};return e.txs?t.txs=e.txs.map(e=>N(e===void 0?new Uint8Array:e)):t.txs=[],t},fromPartial(e){let t=b();return t.txs=e.txs?.map(e=>e)||[],t}};function x(){return{type:0,height:`0`,round:0,blockId:void 0,timestamp:void 0,validatorAddress:new Uint8Array,validatorIndex:0,signature:new Uint8Array}}e.Vote={encode(t,n=r.default.Writer.create()){return t.type!==0&&n.uint32(8).int32(t.type),t.height!==`0`&&n.uint32(16).int64(t.height),t.round!==0&&n.uint32(24).int32(t.round),t.blockId!==void 0&&e.BlockID.encode(t.blockId,n.uint32(34).fork()).ldelim(),t.timestamp!==void 0&&i.Timestamp.encode(P(t.timestamp),n.uint32(42).fork()).ldelim(),t.validatorAddress.length!==0&&n.uint32(50).bytes(t.validatorAddress),t.validatorIndex!==0&&n.uint32(56).int32(t.validatorIndex),t.signature.length!==0&&n.uint32(66).bytes(t.signature),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,s=x();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.type=a.int32();break;case 2:s.height=L(a.int64());break;case 3:s.round=a.int32();break;case 4:s.blockId=e.BlockID.decode(a,a.uint32());break;case 5:s.timestamp=F(i.Timestamp.decode(a,a.uint32()));break;case 6:s.validatorAddress=a.bytes();break;case 7:s.validatorIndex=a.int32();break;case 8:s.signature=a.bytes();break;default:a.skipType(t&7);break}}return s},fromJSON(t){return{type:R(t.type)?f(t.type):0,height:R(t.height)?String(t.height):`0`,round:R(t.round)?Number(t.round):0,blockId:R(t.blockId)?e.BlockID.fromJSON(t.blockId):void 0,timestamp:R(t.timestamp)?I(t.timestamp):void 0,validatorAddress:R(t.validatorAddress)?j(t.validatorAddress):new Uint8Array,validatorIndex:R(t.validatorIndex)?Number(t.validatorIndex):0,signature:R(t.signature)?j(t.signature):new Uint8Array}},toJSON(t){let n={};return t.type!==void 0&&(n.type=p(t.type)),t.height!==void 0&&(n.height=t.height),t.round!==void 0&&(n.round=Math.round(t.round)),t.blockId!==void 0&&(n.blockId=t.blockId?e.BlockID.toJSON(t.blockId):void 0),t.timestamp!==void 0&&(n.timestamp=t.timestamp.toISOString()),t.validatorAddress!==void 0&&(n.validatorAddress=N(t.validatorAddress===void 0?new Uint8Array:t.validatorAddress)),t.validatorIndex!==void 0&&(n.validatorIndex=Math.round(t.validatorIndex)),t.signature!==void 0&&(n.signature=N(t.signature===void 0?new Uint8Array:t.signature)),n},fromPartial(t){let n=x();return n.type=t.type??0,n.height=t.height??`0`,n.round=t.round??0,n.blockId=t.blockId!==void 0&&t.blockId!==null?e.BlockID.fromPartial(t.blockId):void 0,n.timestamp=t.timestamp??void 0,n.validatorAddress=t.validatorAddress??new Uint8Array,n.validatorIndex=t.validatorIndex??0,n.signature=t.signature??new Uint8Array,n}};function S(){return{height:`0`,round:0,blockId:void 0,signatures:[]}}e.Commit={encode(t,n=r.default.Writer.create()){t.height!==`0`&&n.uint32(8).int64(t.height),t.round!==0&&n.uint32(16).int32(t.round),t.blockId!==void 0&&e.BlockID.encode(t.blockId,n.uint32(26).fork()).ldelim();for(let r of t.signatures)e.CommitSig.encode(r,n.uint32(34).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=S();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.height=L(i.int64());break;case 2:o.round=i.int32();break;case 3:o.blockId=e.BlockID.decode(i,i.uint32());break;case 4:o.signatures.push(e.CommitSig.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{height:R(t.height)?String(t.height):`0`,round:R(t.round)?Number(t.round):0,blockId:R(t.blockId)?e.BlockID.fromJSON(t.blockId):void 0,signatures:Array.isArray(t?.signatures)?t.signatures.map(t=>e.CommitSig.fromJSON(t)):[]}},toJSON(t){let n={};return t.height!==void 0&&(n.height=t.height),t.round!==void 0&&(n.round=Math.round(t.round)),t.blockId!==void 0&&(n.blockId=t.blockId?e.BlockID.toJSON(t.blockId):void 0),t.signatures?n.signatures=t.signatures.map(t=>t?e.CommitSig.toJSON(t):void 0):n.signatures=[],n},fromPartial(t){let n=S();return n.height=t.height??`0`,n.round=t.round??0,n.blockId=t.blockId!==void 0&&t.blockId!==null?e.BlockID.fromPartial(t.blockId):void 0,n.signatures=t.signatures?.map(t=>e.CommitSig.fromPartial(t))||[],n}};function C(){return{blockIdFlag:0,validatorAddress:new Uint8Array,timestamp:void 0,signature:new Uint8Array}}e.CommitSig={encode(e,t=r.default.Writer.create()){return e.blockIdFlag!==0&&t.uint32(8).int32(e.blockIdFlag),e.validatorAddress.length!==0&&t.uint32(18).bytes(e.validatorAddress),e.timestamp!==void 0&&i.Timestamp.encode(P(e.timestamp),t.uint32(26).fork()).ldelim(),e.signature.length!==0&&t.uint32(34).bytes(e.signature),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=C();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.blockIdFlag=n.int32();break;case 2:o.validatorAddress=n.bytes();break;case 3:o.timestamp=F(i.Timestamp.decode(n,n.uint32()));break;case 4:o.signature=n.bytes();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{blockIdFlag:R(e.blockIdFlag)?l(e.blockIdFlag):0,validatorAddress:R(e.validatorAddress)?j(e.validatorAddress):new Uint8Array,timestamp:R(e.timestamp)?I(e.timestamp):void 0,signature:R(e.signature)?j(e.signature):new Uint8Array}},toJSON(e){let t={};return e.blockIdFlag!==void 0&&(t.blockIdFlag=u(e.blockIdFlag)),e.validatorAddress!==void 0&&(t.validatorAddress=N(e.validatorAddress===void 0?new Uint8Array:e.validatorAddress)),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.signature!==void 0&&(t.signature=N(e.signature===void 0?new Uint8Array:e.signature)),t},fromPartial(e){let t=C();return t.blockIdFlag=e.blockIdFlag??0,t.validatorAddress=e.validatorAddress??new Uint8Array,t.timestamp=e.timestamp??void 0,t.signature=e.signature??new Uint8Array,t}};function w(){return{type:0,height:`0`,round:0,polRound:0,blockId:void 0,timestamp:void 0,signature:new Uint8Array}}e.Proposal={encode(t,n=r.default.Writer.create()){return t.type!==0&&n.uint32(8).int32(t.type),t.height!==`0`&&n.uint32(16).int64(t.height),t.round!==0&&n.uint32(24).int32(t.round),t.polRound!==0&&n.uint32(32).int32(t.polRound),t.blockId!==void 0&&e.BlockID.encode(t.blockId,n.uint32(42).fork()).ldelim(),t.timestamp!==void 0&&i.Timestamp.encode(P(t.timestamp),n.uint32(50).fork()).ldelim(),t.signature.length!==0&&n.uint32(58).bytes(t.signature),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,s=w();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.type=a.int32();break;case 2:s.height=L(a.int64());break;case 3:s.round=a.int32();break;case 4:s.polRound=a.int32();break;case 5:s.blockId=e.BlockID.decode(a,a.uint32());break;case 6:s.timestamp=F(i.Timestamp.decode(a,a.uint32()));break;case 7:s.signature=a.bytes();break;default:a.skipType(t&7);break}}return s},fromJSON(t){return{type:R(t.type)?f(t.type):0,height:R(t.height)?String(t.height):`0`,round:R(t.round)?Number(t.round):0,polRound:R(t.polRound)?Number(t.polRound):0,blockId:R(t.blockId)?e.BlockID.fromJSON(t.blockId):void 0,timestamp:R(t.timestamp)?I(t.timestamp):void 0,signature:R(t.signature)?j(t.signature):new Uint8Array}},toJSON(t){let n={};return t.type!==void 0&&(n.type=p(t.type)),t.height!==void 0&&(n.height=t.height),t.round!==void 0&&(n.round=Math.round(t.round)),t.polRound!==void 0&&(n.polRound=Math.round(t.polRound)),t.blockId!==void 0&&(n.blockId=t.blockId?e.BlockID.toJSON(t.blockId):void 0),t.timestamp!==void 0&&(n.timestamp=t.timestamp.toISOString()),t.signature!==void 0&&(n.signature=N(t.signature===void 0?new Uint8Array:t.signature)),n},fromPartial(t){let n=w();return n.type=t.type??0,n.height=t.height??`0`,n.round=t.round??0,n.polRound=t.polRound??0,n.blockId=t.blockId!==void 0&&t.blockId!==null?e.BlockID.fromPartial(t.blockId):void 0,n.timestamp=t.timestamp??void 0,n.signature=t.signature??new Uint8Array,n}};function T(){return{header:void 0,commit:void 0}}e.SignedHeader={encode(t,n=r.default.Writer.create()){return t.header!==void 0&&e.Header.encode(t.header,n.uint32(10).fork()).ldelim(),t.commit!==void 0&&e.Commit.encode(t.commit,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=T();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.header=e.Header.decode(i,i.uint32());break;case 2:o.commit=e.Commit.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{header:R(t.header)?e.Header.fromJSON(t.header):void 0,commit:R(t.commit)?e.Commit.fromJSON(t.commit):void 0}},toJSON(t){let n={};return t.header!==void 0&&(n.header=t.header?e.Header.toJSON(t.header):void 0),t.commit!==void 0&&(n.commit=t.commit?e.Commit.toJSON(t.commit):void 0),n},fromPartial(t){let n=T();return n.header=t.header!==void 0&&t.header!==null?e.Header.fromPartial(t.header):void 0,n.commit=t.commit!==void 0&&t.commit!==null?e.Commit.fromPartial(t.commit):void 0,n}};function E(){return{signedHeader:void 0,validatorSet:void 0}}e.LightBlock={encode(t,n=r.default.Writer.create()){return t.signedHeader!==void 0&&e.SignedHeader.encode(t.signedHeader,n.uint32(10).fork()).ldelim(),t.validatorSet!==void 0&&s.ValidatorSet.encode(t.validatorSet,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=E();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.signedHeader=e.SignedHeader.decode(i,i.uint32());break;case 2:o.validatorSet=s.ValidatorSet.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{signedHeader:R(t.signedHeader)?e.SignedHeader.fromJSON(t.signedHeader):void 0,validatorSet:R(t.validatorSet)?s.ValidatorSet.fromJSON(t.validatorSet):void 0}},toJSON(t){let n={};return t.signedHeader!==void 0&&(n.signedHeader=t.signedHeader?e.SignedHeader.toJSON(t.signedHeader):void 0),t.validatorSet!==void 0&&(n.validatorSet=t.validatorSet?s.ValidatorSet.toJSON(t.validatorSet):void 0),n},fromPartial(t){let n=E();return n.signedHeader=t.signedHeader!==void 0&&t.signedHeader!==null?e.SignedHeader.fromPartial(t.signedHeader):void 0,n.validatorSet=t.validatorSet!==void 0&&t.validatorSet!==null?s.ValidatorSet.fromPartial(t.validatorSet):void 0,n}};function D(){return{blockId:void 0,blockSize:`0`,header:void 0,numTxs:`0`}}e.BlockMeta={encode(t,n=r.default.Writer.create()){return t.blockId!==void 0&&e.BlockID.encode(t.blockId,n.uint32(10).fork()).ldelim(),t.blockSize!==`0`&&n.uint32(16).int64(t.blockSize),t.header!==void 0&&e.Header.encode(t.header,n.uint32(26).fork()).ldelim(),t.numTxs!==`0`&&n.uint32(32).int64(t.numTxs),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=D();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.blockId=e.BlockID.decode(i,i.uint32());break;case 2:o.blockSize=L(i.int64());break;case 3:o.header=e.Header.decode(i,i.uint32());break;case 4:o.numTxs=L(i.int64());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{blockId:R(t.blockId)?e.BlockID.fromJSON(t.blockId):void 0,blockSize:R(t.blockSize)?String(t.blockSize):`0`,header:R(t.header)?e.Header.fromJSON(t.header):void 0,numTxs:R(t.numTxs)?String(t.numTxs):`0`}},toJSON(t){let n={};return t.blockId!==void 0&&(n.blockId=t.blockId?e.BlockID.toJSON(t.blockId):void 0),t.blockSize!==void 0&&(n.blockSize=t.blockSize),t.header!==void 0&&(n.header=t.header?e.Header.toJSON(t.header):void 0),t.numTxs!==void 0&&(n.numTxs=t.numTxs),n},fromPartial(t){let n=D();return n.blockId=t.blockId!==void 0&&t.blockId!==null?e.BlockID.fromPartial(t.blockId):void 0,n.blockSize=t.blockSize??`0`,n.header=t.header!==void 0&&t.header!==null?e.Header.fromPartial(t.header):void 0,n.numTxs=t.numTxs??`0`,n}};function O(){return{rootHash:new Uint8Array,data:new Uint8Array,proof:void 0}}e.TxProof={encode(e,t=r.default.Writer.create()){return e.rootHash.length!==0&&t.uint32(10).bytes(e.rootHash),e.data.length!==0&&t.uint32(18).bytes(e.data),e.proof!==void 0&&a.Proof.encode(e.proof,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=O();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.rootHash=n.bytes();break;case 2:o.data=n.bytes();break;case 3:o.proof=a.Proof.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{rootHash:R(e.rootHash)?j(e.rootHash):new Uint8Array,data:R(e.data)?j(e.data):new Uint8Array,proof:R(e.proof)?a.Proof.fromJSON(e.proof):void 0}},toJSON(e){let t={};return e.rootHash!==void 0&&(t.rootHash=N(e.rootHash===void 0?new Uint8Array:e.rootHash)),e.data!==void 0&&(t.data=N(e.data===void 0?new Uint8Array:e.data)),e.proof!==void 0&&(t.proof=e.proof?a.Proof.toJSON(e.proof):void 0),t},fromPartial(e){let t=O();return t.rootHash=e.rootHash??new Uint8Array,t.data=e.data??new Uint8Array,t.proof=e.proof!==void 0&&e.proof!==null?a.Proof.fromPartial(e.proof):void 0,t}};var k=(()=>{if(k!==void 0)return k;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),A=k.atob||(e=>k.Buffer.from(e,`base64`).toString(`binary`));function j(e){let t=A(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var M=k.btoa||(e=>k.Buffer.from(e,`binary`).toString(`base64`));function N(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return M(t.join(``))}function P(e){return{seconds:Math.trunc(e.getTime()/1e3).toString(),nanos:e.getTime()%1e3*1e6}}function F(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}function I(e){return e instanceof Date?e:typeof e==`string`?new Date(e):F(i.Timestamp.fromJSON(e))}function L(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function R(e){return e!=null}})),tc=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Any=e.protobufPackage=void 0;var n=t(G()),r=t(q());e.protobufPackage=`google.protobuf`;function i(){return{typeUrl:``,value:new Uint8Array}}e.Any={encode(e,t=r.default.Writer.create()){return e.typeUrl!==``&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.typeUrl=n.string();break;case 2:o.value=n.bytes();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{typeUrl:u(e.typeUrl)?String(e.typeUrl):``,value:u(e.value)?s(e.value):new Uint8Array}},toJSON(e){let t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=l(e.value===void 0?new Uint8Array:e.value)),t},fromPartial(e){let t=i();return t.typeUrl=e.typeUrl??``,t.value=e.value??new Uint8Array,t}};var a=(()=>{if(a!==void 0)return a;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),o=a.atob||(e=>a.Buffer.from(e,`base64`).toString(`binary`));function s(e){let t=o(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var c=a.btoa||(e=>a.Buffer.from(e,`binary`).toString(`base64`));function l(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return c(t.join(``))}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function u(e){return e!=null}})),nc=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Duration=e.protobufPackage=void 0;var n=t(G()),r=t(q());e.protobufPackage=`google.protobuf`;function i(){return{seconds:`0`,nanos:0}}e.Duration={encode(e,t=r.default.Writer.create()){return e.seconds!==`0`&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),o=t===void 0?n.len:n.pos+t,s=i();for(;n.pos<o;){let e=n.uint32();switch(e>>>3){case 1:s.seconds=a(n.int64());break;case 2:s.nanos=n.int32();break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{seconds:o(e.seconds)?String(e.seconds):`0`,nanos:o(e.nanos)?Number(e.nanos):0}},toJSON(e){let t={};return e.seconds!==void 0&&(t.seconds=e.seconds),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){let t=i();return t.seconds=e.seconds??`0`,t.nanos=e.nanos??0,t}};function a(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function o(e){return e!=null}})),rc=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Pool=e.RedelegationResponse=e.RedelegationEntryResponse=e.DelegationResponse=e.Params=e.Redelegation=e.RedelegationEntry=e.UnbondingDelegationEntry=e.UnbondingDelegation=e.Delegation=e.DVVTriplets=e.DVVTriplet=e.DVPairs=e.DVPair=e.ValAddresses=e.Validator=e.Description=e.Commission=e.CommissionRates=e.HistoricalInfo=e.bondStatusToJSON=e.bondStatusFromJSON=e.BondStatus=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=Ys(),a=ec(),o=tc(),s=nc(),c=Ks();e.protobufPackage=`cosmos.staking.v1beta1`;var l;(function(e){e[e.BOND_STATUS_UNSPECIFIED=0]=`BOND_STATUS_UNSPECIFIED`,e[e.BOND_STATUS_UNBONDED=1]=`BOND_STATUS_UNBONDED`,e[e.BOND_STATUS_UNBONDING=2]=`BOND_STATUS_UNBONDING`,e[e.BOND_STATUS_BONDED=3]=`BOND_STATUS_BONDED`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(l=e.BondStatus||={});function u(e){switch(e){case 0:case`BOND_STATUS_UNSPECIFIED`:return l.BOND_STATUS_UNSPECIFIED;case 1:case`BOND_STATUS_UNBONDED`:return l.BOND_STATUS_UNBONDED;case 2:case`BOND_STATUS_UNBONDING`:return l.BOND_STATUS_UNBONDING;case 3:case`BOND_STATUS_BONDED`:return l.BOND_STATUS_BONDED;default:return l.UNRECOGNIZED}}e.bondStatusFromJSON=u;function d(e){switch(e){case l.BOND_STATUS_UNSPECIFIED:return`BOND_STATUS_UNSPECIFIED`;case l.BOND_STATUS_UNBONDED:return`BOND_STATUS_UNBONDED`;case l.BOND_STATUS_UNBONDING:return`BOND_STATUS_UNBONDING`;case l.BOND_STATUS_BONDED:return`BOND_STATUS_BONDED`;default:return`UNKNOWN`}}e.bondStatusToJSON=d;function f(){return{header:void 0,valset:[]}}e.HistoricalInfo={encode(t,n=r.default.Writer.create()){t.header!==void 0&&a.Header.encode(t.header,n.uint32(10).fork()).ldelim();for(let r of t.valset)e.Validator.encode(r,n.uint32(18).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?i.len:i.pos+n,s=f();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.header=a.Header.decode(i,i.uint32());break;case 2:s.valset.push(e.Validator.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{header:I(t.header)?a.Header.fromJSON(t.header):void 0,valset:Array.isArray(t?.valset)?t.valset.map(t=>e.Validator.fromJSON(t)):[]}},toJSON(t){let n={};return t.header!==void 0&&(n.header=t.header?a.Header.toJSON(t.header):void 0),t.valset?n.valset=t.valset.map(t=>t?e.Validator.toJSON(t):void 0):n.valset=[],n},fromPartial(t){let n=f();return n.header=t.header!==void 0&&t.header!==null?a.Header.fromPartial(t.header):void 0,n.valset=t.valset?.map(t=>e.Validator.fromPartial(t))||[],n}};function p(){return{rate:``,maxRate:``,maxChangeRate:``}}e.CommissionRates={encode(e,t=r.default.Writer.create()){return e.rate!==``&&t.uint32(10).string(e.rate),e.maxRate!==``&&t.uint32(18).string(e.maxRate),e.maxChangeRate!==``&&t.uint32(26).string(e.maxChangeRate),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=p();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.rate=n.string();break;case 2:a.maxRate=n.string();break;case 3:a.maxChangeRate=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{rate:I(e.rate)?String(e.rate):``,maxRate:I(e.maxRate)?String(e.maxRate):``,maxChangeRate:I(e.maxChangeRate)?String(e.maxChangeRate):``}},toJSON(e){let t={};return e.rate!==void 0&&(t.rate=e.rate),e.maxRate!==void 0&&(t.maxRate=e.maxRate),e.maxChangeRate!==void 0&&(t.maxChangeRate=e.maxChangeRate),t},fromPartial(e){let t=p();return t.rate=e.rate??``,t.maxRate=e.maxRate??``,t.maxChangeRate=e.maxChangeRate??``,t}};function m(){return{commissionRates:void 0,updateTime:void 0}}e.Commission={encode(t,n=r.default.Writer.create()){return t.commissionRates!==void 0&&e.CommissionRates.encode(t.commissionRates,n.uint32(10).fork()).ldelim(),t.updateTime!==void 0&&i.Timestamp.encode(M(t.updateTime),n.uint32(18).fork()).ldelim(),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,s=m();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.commissionRates=e.CommissionRates.decode(a,a.uint32());break;case 2:s.updateTime=N(i.Timestamp.decode(a,a.uint32()));break;default:a.skipType(t&7);break}}return s},fromJSON(t){return{commissionRates:I(t.commissionRates)?e.CommissionRates.fromJSON(t.commissionRates):void 0,updateTime:I(t.updateTime)?P(t.updateTime):void 0}},toJSON(t){let n={};return t.commissionRates!==void 0&&(n.commissionRates=t.commissionRates?e.CommissionRates.toJSON(t.commissionRates):void 0),t.updateTime!==void 0&&(n.updateTime=t.updateTime.toISOString()),n},fromPartial(t){let n=m();return n.commissionRates=t.commissionRates!==void 0&&t.commissionRates!==null?e.CommissionRates.fromPartial(t.commissionRates):void 0,n.updateTime=t.updateTime??void 0,n}};function h(){return{moniker:``,identity:``,website:``,securityContact:``,details:``}}e.Description={encode(e,t=r.default.Writer.create()){return e.moniker!==``&&t.uint32(10).string(e.moniker),e.identity!==``&&t.uint32(18).string(e.identity),e.website!==``&&t.uint32(26).string(e.website),e.securityContact!==``&&t.uint32(34).string(e.securityContact),e.details!==``&&t.uint32(42).string(e.details),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=h();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.moniker=n.string();break;case 2:a.identity=n.string();break;case 3:a.website=n.string();break;case 4:a.securityContact=n.string();break;case 5:a.details=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{moniker:I(e.moniker)?String(e.moniker):``,identity:I(e.identity)?String(e.identity):``,website:I(e.website)?String(e.website):``,securityContact:I(e.securityContact)?String(e.securityContact):``,details:I(e.details)?String(e.details):``}},toJSON(e){let t={};return e.moniker!==void 0&&(t.moniker=e.moniker),e.identity!==void 0&&(t.identity=e.identity),e.website!==void 0&&(t.website=e.website),e.securityContact!==void 0&&(t.securityContact=e.securityContact),e.details!==void 0&&(t.details=e.details),t},fromPartial(e){let t=h();return t.moniker=e.moniker??``,t.identity=e.identity??``,t.website=e.website??``,t.securityContact=e.securityContact??``,t.details=e.details??``,t}};function g(){return{operatorAddress:``,consensusPubkey:void 0,jailed:!1,status:0,tokens:``,delegatorShares:``,description:void 0,unbondingHeight:`0`,unbondingTime:void 0,commission:void 0,minSelfDelegation:``}}e.Validator={encode(t,n=r.default.Writer.create()){return t.operatorAddress!==``&&n.uint32(10).string(t.operatorAddress),t.consensusPubkey!==void 0&&o.Any.encode(t.consensusPubkey,n.uint32(18).fork()).ldelim(),t.jailed===!0&&n.uint32(24).bool(t.jailed),t.status!==0&&n.uint32(32).int32(t.status),t.tokens!==``&&n.uint32(42).string(t.tokens),t.delegatorShares!==``&&n.uint32(50).string(t.delegatorShares),t.description!==void 0&&e.Description.encode(t.description,n.uint32(58).fork()).ldelim(),t.unbondingHeight!==`0`&&n.uint32(64).int64(t.unbondingHeight),t.unbondingTime!==void 0&&i.Timestamp.encode(M(t.unbondingTime),n.uint32(74).fork()).ldelim(),t.commission!==void 0&&e.Commission.encode(t.commission,n.uint32(82).fork()).ldelim(),t.minSelfDelegation!==``&&n.uint32(90).string(t.minSelfDelegation),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),s=n===void 0?a.len:a.pos+n,c=g();for(;a.pos<s;){let t=a.uint32();switch(t>>>3){case 1:c.operatorAddress=a.string();break;case 2:c.consensusPubkey=o.Any.decode(a,a.uint32());break;case 3:c.jailed=a.bool();break;case 4:c.status=a.int32();break;case 5:c.tokens=a.string();break;case 6:c.delegatorShares=a.string();break;case 7:c.description=e.Description.decode(a,a.uint32());break;case 8:c.unbondingHeight=F(a.int64());break;case 9:c.unbondingTime=N(i.Timestamp.decode(a,a.uint32()));break;case 10:c.commission=e.Commission.decode(a,a.uint32());break;case 11:c.minSelfDelegation=a.string();break;default:a.skipType(t&7);break}}return c},fromJSON(t){return{operatorAddress:I(t.operatorAddress)?String(t.operatorAddress):``,consensusPubkey:I(t.consensusPubkey)?o.Any.fromJSON(t.consensusPubkey):void 0,jailed:I(t.jailed)?!!t.jailed:!1,status:I(t.status)?u(t.status):0,tokens:I(t.tokens)?String(t.tokens):``,delegatorShares:I(t.delegatorShares)?String(t.delegatorShares):``,description:I(t.description)?e.Description.fromJSON(t.description):void 0,unbondingHeight:I(t.unbondingHeight)?String(t.unbondingHeight):`0`,unbondingTime:I(t.unbondingTime)?P(t.unbondingTime):void 0,commission:I(t.commission)?e.Commission.fromJSON(t.commission):void 0,minSelfDelegation:I(t.minSelfDelegation)?String(t.minSelfDelegation):``}},toJSON(t){let n={};return t.operatorAddress!==void 0&&(n.operatorAddress=t.operatorAddress),t.consensusPubkey!==void 0&&(n.consensusPubkey=t.consensusPubkey?o.Any.toJSON(t.consensusPubkey):void 0),t.jailed!==void 0&&(n.jailed=t.jailed),t.status!==void 0&&(n.status=d(t.status)),t.tokens!==void 0&&(n.tokens=t.tokens),t.delegatorShares!==void 0&&(n.delegatorShares=t.delegatorShares),t.description!==void 0&&(n.description=t.description?e.Description.toJSON(t.description):void 0),t.unbondingHeight!==void 0&&(n.unbondingHeight=t.unbondingHeight),t.unbondingTime!==void 0&&(n.unbondingTime=t.unbondingTime.toISOString()),t.commission!==void 0&&(n.commission=t.commission?e.Commission.toJSON(t.commission):void 0),t.minSelfDelegation!==void 0&&(n.minSelfDelegation=t.minSelfDelegation),n},fromPartial(t){let n=g();return n.operatorAddress=t.operatorAddress??``,n.consensusPubkey=t.consensusPubkey!==void 0&&t.consensusPubkey!==null?o.Any.fromPartial(t.consensusPubkey):void 0,n.jailed=t.jailed??!1,n.status=t.status??0,n.tokens=t.tokens??``,n.delegatorShares=t.delegatorShares??``,n.description=t.description!==void 0&&t.description!==null?e.Description.fromPartial(t.description):void 0,n.unbondingHeight=t.unbondingHeight??`0`,n.unbondingTime=t.unbondingTime??void 0,n.commission=t.commission!==void 0&&t.commission!==null?e.Commission.fromPartial(t.commission):void 0,n.minSelfDelegation=t.minSelfDelegation??``,n}};function _(){return{addresses:[]}}e.ValAddresses={encode(e,t=r.default.Writer.create()){for(let n of e.addresses)t.uint32(10).string(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=_();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.addresses.push(n.string());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{addresses:Array.isArray(e?.addresses)?e.addresses.map(e=>String(e)):[]}},toJSON(e){let t={};return e.addresses?t.addresses=e.addresses.map(e=>e):t.addresses=[],t},fromPartial(e){let t=_();return t.addresses=e.addresses?.map(e=>e)||[],t}};function v(){return{delegatorAddress:``,validatorAddress:``}}e.DVPair={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==``&&t.uint32(18).string(e.validatorAddress),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=v();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorAddress=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:I(e.delegatorAddress)?String(e.delegatorAddress):``,validatorAddress:I(e.validatorAddress)?String(e.validatorAddress):``}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),t},fromPartial(e){let t=v();return t.delegatorAddress=e.delegatorAddress??``,t.validatorAddress=e.validatorAddress??``,t}};function y(){return{pairs:[]}}e.DVPairs={encode(t,n=r.default.Writer.create()){for(let r of t.pairs)e.DVPair.encode(r,n.uint32(10).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=y();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.pairs.push(e.DVPair.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{pairs:Array.isArray(t?.pairs)?t.pairs.map(t=>e.DVPair.fromJSON(t)):[]}},toJSON(t){let n={};return t.pairs?n.pairs=t.pairs.map(t=>t?e.DVPair.toJSON(t):void 0):n.pairs=[],n},fromPartial(t){let n=y();return n.pairs=t.pairs?.map(t=>e.DVPair.fromPartial(t))||[],n}};function b(){return{delegatorAddress:``,validatorSrcAddress:``,validatorDstAddress:``}}e.DVVTriplet={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorSrcAddress!==``&&t.uint32(18).string(e.validatorSrcAddress),e.validatorDstAddress!==``&&t.uint32(26).string(e.validatorDstAddress),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=b();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorSrcAddress=n.string();break;case 3:a.validatorDstAddress=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:I(e.delegatorAddress)?String(e.delegatorAddress):``,validatorSrcAddress:I(e.validatorSrcAddress)?String(e.validatorSrcAddress):``,validatorDstAddress:I(e.validatorDstAddress)?String(e.validatorDstAddress):``}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorSrcAddress!==void 0&&(t.validatorSrcAddress=e.validatorSrcAddress),e.validatorDstAddress!==void 0&&(t.validatorDstAddress=e.validatorDstAddress),t},fromPartial(e){let t=b();return t.delegatorAddress=e.delegatorAddress??``,t.validatorSrcAddress=e.validatorSrcAddress??``,t.validatorDstAddress=e.validatorDstAddress??``,t}};function x(){return{triplets:[]}}e.DVVTriplets={encode(t,n=r.default.Writer.create()){for(let r of t.triplets)e.DVVTriplet.encode(r,n.uint32(10).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=x();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.triplets.push(e.DVVTriplet.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{triplets:Array.isArray(t?.triplets)?t.triplets.map(t=>e.DVVTriplet.fromJSON(t)):[]}},toJSON(t){let n={};return t.triplets?n.triplets=t.triplets.map(t=>t?e.DVVTriplet.toJSON(t):void 0):n.triplets=[],n},fromPartial(t){let n=x();return n.triplets=t.triplets?.map(t=>e.DVVTriplet.fromPartial(t))||[],n}};function S(){return{delegatorAddress:``,validatorAddress:``,shares:``}}e.Delegation={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==``&&t.uint32(18).string(e.validatorAddress),e.shares!==``&&t.uint32(26).string(e.shares),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=S();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorAddress=n.string();break;case 3:a.shares=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:I(e.delegatorAddress)?String(e.delegatorAddress):``,validatorAddress:I(e.validatorAddress)?String(e.validatorAddress):``,shares:I(e.shares)?String(e.shares):``}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.shares!==void 0&&(t.shares=e.shares),t},fromPartial(e){let t=S();return t.delegatorAddress=e.delegatorAddress??``,t.validatorAddress=e.validatorAddress??``,t.shares=e.shares??``,t}};function C(){return{delegatorAddress:``,validatorAddress:``,entries:[]}}e.UnbondingDelegation={encode(t,n=r.default.Writer.create()){t.delegatorAddress!==``&&n.uint32(10).string(t.delegatorAddress),t.validatorAddress!==``&&n.uint32(18).string(t.validatorAddress);for(let r of t.entries)e.UnbondingDelegationEntry.encode(r,n.uint32(26).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=C();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.delegatorAddress=i.string();break;case 2:o.validatorAddress=i.string();break;case 3:o.entries.push(e.UnbondingDelegationEntry.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{delegatorAddress:I(t.delegatorAddress)?String(t.delegatorAddress):``,validatorAddress:I(t.validatorAddress)?String(t.validatorAddress):``,entries:Array.isArray(t?.entries)?t.entries.map(t=>e.UnbondingDelegationEntry.fromJSON(t)):[]}},toJSON(t){let n={};return t.delegatorAddress!==void 0&&(n.delegatorAddress=t.delegatorAddress),t.validatorAddress!==void 0&&(n.validatorAddress=t.validatorAddress),t.entries?n.entries=t.entries.map(t=>t?e.UnbondingDelegationEntry.toJSON(t):void 0):n.entries=[],n},fromPartial(t){let n=C();return n.delegatorAddress=t.delegatorAddress??``,n.validatorAddress=t.validatorAddress??``,n.entries=t.entries?.map(t=>e.UnbondingDelegationEntry.fromPartial(t))||[],n}};function w(){return{creationHeight:`0`,completionTime:void 0,initialBalance:``,balance:``}}e.UnbondingDelegationEntry={encode(e,t=r.default.Writer.create()){return e.creationHeight!==`0`&&t.uint32(8).int64(e.creationHeight),e.completionTime!==void 0&&i.Timestamp.encode(M(e.completionTime),t.uint32(18).fork()).ldelim(),e.initialBalance!==``&&t.uint32(26).string(e.initialBalance),e.balance!==``&&t.uint32(34).string(e.balance),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=w();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.creationHeight=F(n.int64());break;case 2:o.completionTime=N(i.Timestamp.decode(n,n.uint32()));break;case 3:o.initialBalance=n.string();break;case 4:o.balance=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{creationHeight:I(e.creationHeight)?String(e.creationHeight):`0`,completionTime:I(e.completionTime)?P(e.completionTime):void 0,initialBalance:I(e.initialBalance)?String(e.initialBalance):``,balance:I(e.balance)?String(e.balance):``}},toJSON(e){let t={};return e.creationHeight!==void 0&&(t.creationHeight=e.creationHeight),e.completionTime!==void 0&&(t.completionTime=e.completionTime.toISOString()),e.initialBalance!==void 0&&(t.initialBalance=e.initialBalance),e.balance!==void 0&&(t.balance=e.balance),t},fromPartial(e){let t=w();return t.creationHeight=e.creationHeight??`0`,t.completionTime=e.completionTime??void 0,t.initialBalance=e.initialBalance??``,t.balance=e.balance??``,t}};function T(){return{creationHeight:`0`,completionTime:void 0,initialBalance:``,sharesDst:``}}e.RedelegationEntry={encode(e,t=r.default.Writer.create()){return e.creationHeight!==`0`&&t.uint32(8).int64(e.creationHeight),e.completionTime!==void 0&&i.Timestamp.encode(M(e.completionTime),t.uint32(18).fork()).ldelim(),e.initialBalance!==``&&t.uint32(26).string(e.initialBalance),e.sharesDst!==``&&t.uint32(34).string(e.sharesDst),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=T();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.creationHeight=F(n.int64());break;case 2:o.completionTime=N(i.Timestamp.decode(n,n.uint32()));break;case 3:o.initialBalance=n.string();break;case 4:o.sharesDst=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{creationHeight:I(e.creationHeight)?String(e.creationHeight):`0`,completionTime:I(e.completionTime)?P(e.completionTime):void 0,initialBalance:I(e.initialBalance)?String(e.initialBalance):``,sharesDst:I(e.sharesDst)?String(e.sharesDst):``}},toJSON(e){let t={};return e.creationHeight!==void 0&&(t.creationHeight=e.creationHeight),e.completionTime!==void 0&&(t.completionTime=e.completionTime.toISOString()),e.initialBalance!==void 0&&(t.initialBalance=e.initialBalance),e.sharesDst!==void 0&&(t.sharesDst=e.sharesDst),t},fromPartial(e){let t=T();return t.creationHeight=e.creationHeight??`0`,t.completionTime=e.completionTime??void 0,t.initialBalance=e.initialBalance??``,t.sharesDst=e.sharesDst??``,t}};function E(){return{delegatorAddress:``,validatorSrcAddress:``,validatorDstAddress:``,entries:[]}}e.Redelegation={encode(t,n=r.default.Writer.create()){t.delegatorAddress!==``&&n.uint32(10).string(t.delegatorAddress),t.validatorSrcAddress!==``&&n.uint32(18).string(t.validatorSrcAddress),t.validatorDstAddress!==``&&n.uint32(26).string(t.validatorDstAddress);for(let r of t.entries)e.RedelegationEntry.encode(r,n.uint32(34).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=E();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.delegatorAddress=i.string();break;case 2:o.validatorSrcAddress=i.string();break;case 3:o.validatorDstAddress=i.string();break;case 4:o.entries.push(e.RedelegationEntry.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{delegatorAddress:I(t.delegatorAddress)?String(t.delegatorAddress):``,validatorSrcAddress:I(t.validatorSrcAddress)?String(t.validatorSrcAddress):``,validatorDstAddress:I(t.validatorDstAddress)?String(t.validatorDstAddress):``,entries:Array.isArray(t?.entries)?t.entries.map(t=>e.RedelegationEntry.fromJSON(t)):[]}},toJSON(t){let n={};return t.delegatorAddress!==void 0&&(n.delegatorAddress=t.delegatorAddress),t.validatorSrcAddress!==void 0&&(n.validatorSrcAddress=t.validatorSrcAddress),t.validatorDstAddress!==void 0&&(n.validatorDstAddress=t.validatorDstAddress),t.entries?n.entries=t.entries.map(t=>t?e.RedelegationEntry.toJSON(t):void 0):n.entries=[],n},fromPartial(t){let n=E();return n.delegatorAddress=t.delegatorAddress??``,n.validatorSrcAddress=t.validatorSrcAddress??``,n.validatorDstAddress=t.validatorDstAddress??``,n.entries=t.entries?.map(t=>e.RedelegationEntry.fromPartial(t))||[],n}};function D(){return{unbondingTime:void 0,maxValidators:0,maxEntries:0,historicalEntries:0,bondDenom:``}}e.Params={encode(e,t=r.default.Writer.create()){return e.unbondingTime!==void 0&&s.Duration.encode(e.unbondingTime,t.uint32(10).fork()).ldelim(),e.maxValidators!==0&&t.uint32(16).uint32(e.maxValidators),e.maxEntries!==0&&t.uint32(24).uint32(e.maxEntries),e.historicalEntries!==0&&t.uint32(32).uint32(e.historicalEntries),e.bondDenom!==``&&t.uint32(42).string(e.bondDenom),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=D();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.unbondingTime=s.Duration.decode(n,n.uint32());break;case 2:a.maxValidators=n.uint32();break;case 3:a.maxEntries=n.uint32();break;case 4:a.historicalEntries=n.uint32();break;case 5:a.bondDenom=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{unbondingTime:I(e.unbondingTime)?s.Duration.fromJSON(e.unbondingTime):void 0,maxValidators:I(e.maxValidators)?Number(e.maxValidators):0,maxEntries:I(e.maxEntries)?Number(e.maxEntries):0,historicalEntries:I(e.historicalEntries)?Number(e.historicalEntries):0,bondDenom:I(e.bondDenom)?String(e.bondDenom):``}},toJSON(e){let t={};return e.unbondingTime!==void 0&&(t.unbondingTime=e.unbondingTime?s.Duration.toJSON(e.unbondingTime):void 0),e.maxValidators!==void 0&&(t.maxValidators=Math.round(e.maxValidators)),e.maxEntries!==void 0&&(t.maxEntries=Math.round(e.maxEntries)),e.historicalEntries!==void 0&&(t.historicalEntries=Math.round(e.historicalEntries)),e.bondDenom!==void 0&&(t.bondDenom=e.bondDenom),t},fromPartial(e){let t=D();return t.unbondingTime=e.unbondingTime!==void 0&&e.unbondingTime!==null?s.Duration.fromPartial(e.unbondingTime):void 0,t.maxValidators=e.maxValidators??0,t.maxEntries=e.maxEntries??0,t.historicalEntries=e.historicalEntries??0,t.bondDenom=e.bondDenom??``,t}};function O(){return{delegation:void 0,balance:void 0}}e.DelegationResponse={encode(t,n=r.default.Writer.create()){return t.delegation!==void 0&&e.Delegation.encode(t.delegation,n.uint32(10).fork()).ldelim(),t.balance!==void 0&&c.Coin.encode(t.balance,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=O();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.delegation=e.Delegation.decode(i,i.uint32());break;case 2:o.balance=c.Coin.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{delegation:I(t.delegation)?e.Delegation.fromJSON(t.delegation):void 0,balance:I(t.balance)?c.Coin.fromJSON(t.balance):void 0}},toJSON(t){let n={};return t.delegation!==void 0&&(n.delegation=t.delegation?e.Delegation.toJSON(t.delegation):void 0),t.balance!==void 0&&(n.balance=t.balance?c.Coin.toJSON(t.balance):void 0),n},fromPartial(t){let n=O();return n.delegation=t.delegation!==void 0&&t.delegation!==null?e.Delegation.fromPartial(t.delegation):void 0,n.balance=t.balance!==void 0&&t.balance!==null?c.Coin.fromPartial(t.balance):void 0,n}};function k(){return{redelegationEntry:void 0,balance:``}}e.RedelegationEntryResponse={encode(t,n=r.default.Writer.create()){return t.redelegationEntry!==void 0&&e.RedelegationEntry.encode(t.redelegationEntry,n.uint32(10).fork()).ldelim(),t.balance!==``&&n.uint32(34).string(t.balance),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=k();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.redelegationEntry=e.RedelegationEntry.decode(i,i.uint32());break;case 4:o.balance=i.string();break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{redelegationEntry:I(t.redelegationEntry)?e.RedelegationEntry.fromJSON(t.redelegationEntry):void 0,balance:I(t.balance)?String(t.balance):``}},toJSON(t){let n={};return t.redelegationEntry!==void 0&&(n.redelegationEntry=t.redelegationEntry?e.RedelegationEntry.toJSON(t.redelegationEntry):void 0),t.balance!==void 0&&(n.balance=t.balance),n},fromPartial(t){let n=k();return n.redelegationEntry=t.redelegationEntry!==void 0&&t.redelegationEntry!==null?e.RedelegationEntry.fromPartial(t.redelegationEntry):void 0,n.balance=t.balance??``,n}};function A(){return{redelegation:void 0,entries:[]}}e.RedelegationResponse={encode(t,n=r.default.Writer.create()){t.redelegation!==void 0&&e.Redelegation.encode(t.redelegation,n.uint32(10).fork()).ldelim();for(let r of t.entries)e.RedelegationEntryResponse.encode(r,n.uint32(18).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=A();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.redelegation=e.Redelegation.decode(i,i.uint32());break;case 2:o.entries.push(e.RedelegationEntryResponse.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{redelegation:I(t.redelegation)?e.Redelegation.fromJSON(t.redelegation):void 0,entries:Array.isArray(t?.entries)?t.entries.map(t=>e.RedelegationEntryResponse.fromJSON(t)):[]}},toJSON(t){let n={};return t.redelegation!==void 0&&(n.redelegation=t.redelegation?e.Redelegation.toJSON(t.redelegation):void 0),t.entries?n.entries=t.entries.map(t=>t?e.RedelegationEntryResponse.toJSON(t):void 0):n.entries=[],n},fromPartial(t){let n=A();return n.redelegation=t.redelegation!==void 0&&t.redelegation!==null?e.Redelegation.fromPartial(t.redelegation):void 0,n.entries=t.entries?.map(t=>e.RedelegationEntryResponse.fromPartial(t))||[],n}};function j(){return{notBondedTokens:``,bondedTokens:``}}e.Pool={encode(e,t=r.default.Writer.create()){return e.notBondedTokens!==``&&t.uint32(10).string(e.notBondedTokens),e.bondedTokens!==``&&t.uint32(18).string(e.bondedTokens),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=j();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.notBondedTokens=n.string();break;case 2:a.bondedTokens=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{notBondedTokens:I(e.notBondedTokens)?String(e.notBondedTokens):``,bondedTokens:I(e.bondedTokens)?String(e.bondedTokens):``}},toJSON(e){let t={};return e.notBondedTokens!==void 0&&(t.notBondedTokens=e.notBondedTokens),e.bondedTokens!==void 0&&(t.bondedTokens=e.bondedTokens),t},fromPartial(e){let t=j();return t.notBondedTokens=e.notBondedTokens??``,t.bondedTokens=e.bondedTokens??``,t}};function M(e){return{seconds:Math.trunc(e.getTime()/1e3).toString(),nanos:e.getTime()%1e3*1e6}}function N(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}function P(e){return e instanceof Date?e:typeof e==`string`?new Date(e):N(i.Timestamp.fromJSON(e))}function F(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function I(e){return e!=null}})),ic=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.MsgUndelegateResponse=e.MsgUndelegate=e.MsgBeginRedelegateResponse=e.MsgBeginRedelegate=e.MsgDelegateResponse=e.MsgDelegate=e.MsgEditValidatorResponse=e.MsgEditValidator=e.MsgCreateValidatorResponse=e.MsgCreateValidator=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=Ys(),a=rc(),o=tc(),s=Ks();e.protobufPackage=`cosmos.staking.v1beta1`;function c(){return{description:void 0,commission:void 0,minSelfDelegation:``,delegatorAddress:``,validatorAddress:``,pubkey:void 0,value:void 0}}e.MsgCreateValidator={encode(e,t=r.default.Writer.create()){return e.description!==void 0&&a.Description.encode(e.description,t.uint32(10).fork()).ldelim(),e.commission!==void 0&&a.CommissionRates.encode(e.commission,t.uint32(18).fork()).ldelim(),e.minSelfDelegation!==``&&t.uint32(26).string(e.minSelfDelegation),e.delegatorAddress!==``&&t.uint32(34).string(e.delegatorAddress),e.validatorAddress!==``&&t.uint32(42).string(e.validatorAddress),e.pubkey!==void 0&&o.Any.encode(e.pubkey,t.uint32(50).fork()).ldelim(),e.value!==void 0&&s.Coin.encode(e.value,t.uint32(58).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,l=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:l.description=a.Description.decode(n,n.uint32());break;case 2:l.commission=a.CommissionRates.decode(n,n.uint32());break;case 3:l.minSelfDelegation=n.string();break;case 4:l.delegatorAddress=n.string();break;case 5:l.validatorAddress=n.string();break;case 6:l.pubkey=o.Any.decode(n,n.uint32());break;case 7:l.value=s.Coin.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return l},fromJSON(e){return{description:x(e.description)?a.Description.fromJSON(e.description):void 0,commission:x(e.commission)?a.CommissionRates.fromJSON(e.commission):void 0,minSelfDelegation:x(e.minSelfDelegation)?String(e.minSelfDelegation):``,delegatorAddress:x(e.delegatorAddress)?String(e.delegatorAddress):``,validatorAddress:x(e.validatorAddress)?String(e.validatorAddress):``,pubkey:x(e.pubkey)?o.Any.fromJSON(e.pubkey):void 0,value:x(e.value)?s.Coin.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.description!==void 0&&(t.description=e.description?a.Description.toJSON(e.description):void 0),e.commission!==void 0&&(t.commission=e.commission?a.CommissionRates.toJSON(e.commission):void 0),e.minSelfDelegation!==void 0&&(t.minSelfDelegation=e.minSelfDelegation),e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.pubkey!==void 0&&(t.pubkey=e.pubkey?o.Any.toJSON(e.pubkey):void 0),e.value!==void 0&&(t.value=e.value?s.Coin.toJSON(e.value):void 0),t},fromPartial(e){let t=c();return t.description=e.description!==void 0&&e.description!==null?a.Description.fromPartial(e.description):void 0,t.commission=e.commission!==void 0&&e.commission!==null?a.CommissionRates.fromPartial(e.commission):void 0,t.minSelfDelegation=e.minSelfDelegation??``,t.delegatorAddress=e.delegatorAddress??``,t.validatorAddress=e.validatorAddress??``,t.pubkey=e.pubkey!==void 0&&e.pubkey!==null?o.Any.fromPartial(e.pubkey):void 0,t.value=e.value!==void 0&&e.value!==null?s.Coin.fromPartial(e.value):void 0,t}};function l(){return{}}e.MsgCreateValidatorResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return l()}};function u(){return{description:void 0,validatorAddress:``,commissionRate:``,minSelfDelegation:``}}e.MsgEditValidator={encode(e,t=r.default.Writer.create()){return e.description!==void 0&&a.Description.encode(e.description,t.uint32(10).fork()).ldelim(),e.validatorAddress!==``&&t.uint32(18).string(e.validatorAddress),e.commissionRate!==``&&t.uint32(26).string(e.commissionRate),e.minSelfDelegation!==``&&t.uint32(34).string(e.minSelfDelegation),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.description=a.Description.decode(n,n.uint32());break;case 2:o.validatorAddress=n.string();break;case 3:o.commissionRate=n.string();break;case 4:o.minSelfDelegation=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{description:x(e.description)?a.Description.fromJSON(e.description):void 0,validatorAddress:x(e.validatorAddress)?String(e.validatorAddress):``,commissionRate:x(e.commissionRate)?String(e.commissionRate):``,minSelfDelegation:x(e.minSelfDelegation)?String(e.minSelfDelegation):``}},toJSON(e){let t={};return e.description!==void 0&&(t.description=e.description?a.Description.toJSON(e.description):void 0),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.commissionRate!==void 0&&(t.commissionRate=e.commissionRate),e.minSelfDelegation!==void 0&&(t.minSelfDelegation=e.minSelfDelegation),t},fromPartial(e){let t=u();return t.description=e.description!==void 0&&e.description!==null?a.Description.fromPartial(e.description):void 0,t.validatorAddress=e.validatorAddress??``,t.commissionRate=e.commissionRate??``,t.minSelfDelegation=e.minSelfDelegation??``,t}};function d(){return{}}e.MsgEditValidatorResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return d()}};function f(){return{delegatorAddress:``,validatorAddress:``,amount:void 0}}e.MsgDelegate={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==``&&t.uint32(18).string(e.validatorAddress),e.amount!==void 0&&s.Coin.encode(e.amount,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorAddress=n.string();break;case 3:a.amount=s.Coin.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:x(e.delegatorAddress)?String(e.delegatorAddress):``,validatorAddress:x(e.validatorAddress)?String(e.validatorAddress):``,amount:x(e.amount)?s.Coin.fromJSON(e.amount):void 0}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.amount!==void 0&&(t.amount=e.amount?s.Coin.toJSON(e.amount):void 0),t},fromPartial(e){let t=f();return t.delegatorAddress=e.delegatorAddress??``,t.validatorAddress=e.validatorAddress??``,t.amount=e.amount!==void 0&&e.amount!==null?s.Coin.fromPartial(e.amount):void 0,t}};function p(){return{}}e.MsgDelegateResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=p();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return p()}};function m(){return{delegatorAddress:``,validatorSrcAddress:``,validatorDstAddress:``,amount:void 0}}e.MsgBeginRedelegate={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorSrcAddress!==``&&t.uint32(18).string(e.validatorSrcAddress),e.validatorDstAddress!==``&&t.uint32(26).string(e.validatorDstAddress),e.amount!==void 0&&s.Coin.encode(e.amount,t.uint32(34).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=m();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorSrcAddress=n.string();break;case 3:a.validatorDstAddress=n.string();break;case 4:a.amount=s.Coin.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:x(e.delegatorAddress)?String(e.delegatorAddress):``,validatorSrcAddress:x(e.validatorSrcAddress)?String(e.validatorSrcAddress):``,validatorDstAddress:x(e.validatorDstAddress)?String(e.validatorDstAddress):``,amount:x(e.amount)?s.Coin.fromJSON(e.amount):void 0}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorSrcAddress!==void 0&&(t.validatorSrcAddress=e.validatorSrcAddress),e.validatorDstAddress!==void 0&&(t.validatorDstAddress=e.validatorDstAddress),e.amount!==void 0&&(t.amount=e.amount?s.Coin.toJSON(e.amount):void 0),t},fromPartial(e){let t=m();return t.delegatorAddress=e.delegatorAddress??``,t.validatorSrcAddress=e.validatorSrcAddress??``,t.validatorDstAddress=e.validatorDstAddress??``,t.amount=e.amount!==void 0&&e.amount!==null?s.Coin.fromPartial(e.amount):void 0,t}};function h(){return{completionTime:void 0}}e.MsgBeginRedelegateResponse={encode(e,t=r.default.Writer.create()){return e.completionTime!==void 0&&i.Timestamp.encode(v(e.completionTime),t.uint32(10).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=h();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.completionTime=y(i.Timestamp.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{completionTime:x(e.completionTime)?b(e.completionTime):void 0}},toJSON(e){let t={};return e.completionTime!==void 0&&(t.completionTime=e.completionTime.toISOString()),t},fromPartial(e){let t=h();return t.completionTime=e.completionTime??void 0,t}};function g(){return{delegatorAddress:``,validatorAddress:``,amount:void 0}}e.MsgUndelegate={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==``&&t.uint32(18).string(e.validatorAddress),e.amount!==void 0&&s.Coin.encode(e.amount,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=g();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorAddress=n.string();break;case 3:a.amount=s.Coin.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:x(e.delegatorAddress)?String(e.delegatorAddress):``,validatorAddress:x(e.validatorAddress)?String(e.validatorAddress):``,amount:x(e.amount)?s.Coin.fromJSON(e.amount):void 0}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.amount!==void 0&&(t.amount=e.amount?s.Coin.toJSON(e.amount):void 0),t},fromPartial(e){let t=g();return t.delegatorAddress=e.delegatorAddress??``,t.validatorAddress=e.validatorAddress??``,t.amount=e.amount!==void 0&&e.amount!==null?s.Coin.fromPartial(e.amount):void 0,t}};function _(){return{completionTime:void 0}}e.MsgUndelegateResponse={encode(e,t=r.default.Writer.create()){return e.completionTime!==void 0&&i.Timestamp.encode(v(e.completionTime),t.uint32(10).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=_();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.completionTime=y(i.Timestamp.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{completionTime:x(e.completionTime)?b(e.completionTime):void 0}},toJSON(e){let t={};return e.completionTime!==void 0&&(t.completionTime=e.completionTime.toISOString()),t},fromPartial(e){let t=_();return t.completionTime=e.completionTime??void 0,t}};function v(e){return{seconds:Math.trunc(e.getTime()/1e3).toString(),nanos:e.getTime()%1e3*1e6}}function y(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}function b(e){return e instanceof Date?e:typeof e==`string`?new Date(e):y(i.Timestamp.fromJSON(e))}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function x(e){return e!=null}})),ac=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Grant=e.GenericAuthorization=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=Ys(),a=tc();e.protobufPackage=`cosmos.authz.v1beta1`;function o(){return{msg:``}}e.GenericAuthorization={encode(e,t=r.default.Writer.create()){return e.msg!==``&&t.uint32(10).string(e.msg),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=o();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.msg=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{msg:d(e.msg)?String(e.msg):``}},toJSON(e){let t={};return e.msg!==void 0&&(t.msg=e.msg),t},fromPartial(e){let t=o();return t.msg=e.msg??``,t}};function s(){return{authorization:void 0,expiration:void 0}}e.Grant={encode(e,t=r.default.Writer.create()){return e.authorization!==void 0&&a.Any.encode(e.authorization,t.uint32(10).fork()).ldelim(),e.expiration!==void 0&&i.Timestamp.encode(c(e.expiration),t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),o=t===void 0?n.len:n.pos+t,c=s();for(;n.pos<o;){let e=n.uint32();switch(e>>>3){case 1:c.authorization=a.Any.decode(n,n.uint32());break;case 2:c.expiration=l(i.Timestamp.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return c},fromJSON(e){return{authorization:d(e.authorization)?a.Any.fromJSON(e.authorization):void 0,expiration:d(e.expiration)?u(e.expiration):void 0}},toJSON(e){let t={};return e.authorization!==void 0&&(t.authorization=e.authorization?a.Any.toJSON(e.authorization):void 0),e.expiration!==void 0&&(t.expiration=e.expiration.toISOString()),t},fromPartial(e){let t=s();return t.authorization=e.authorization!==void 0&&e.authorization!==null?a.Any.fromPartial(e.authorization):void 0,t.expiration=e.expiration??void 0,t}};function c(e){return{seconds:Math.trunc(e.getTime()/1e3).toString(),nanos:e.getTime()%1e3*1e6}}function l(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}function u(e){return e instanceof Date?e:typeof e==`string`?new Date(e):l(i.Timestamp.fromJSON(e))}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function d(e){return e!=null}})),oc=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.MsgRevokeResponse=e.MsgRevoke=e.MsgGrantResponse=e.MsgExec=e.MsgExecResponse=e.MsgGrant=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=ac(),a=tc();e.protobufPackage=`cosmos.authz.v1beta1`;function o(){return{granter:``,grantee:``,grant:void 0}}e.MsgGrant={encode(e,t=r.default.Writer.create()){return e.granter!==``&&t.uint32(10).string(e.granter),e.grantee!==``&&t.uint32(18).string(e.grantee),e.grant!==void 0&&i.Grant.encode(e.grant,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,s=o();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:s.granter=n.string();break;case 2:s.grantee=n.string();break;case 3:s.grant=i.Grant.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{granter:y(e.granter)?String(e.granter):``,grantee:y(e.grantee)?String(e.grantee):``,grant:y(e.grant)?i.Grant.fromJSON(e.grant):void 0}},toJSON(e){let t={};return e.granter!==void 0&&(t.granter=e.granter),e.grantee!==void 0&&(t.grantee=e.grantee),e.grant!==void 0&&(t.grant=e.grant?i.Grant.toJSON(e.grant):void 0),t},fromPartial(e){let t=o();return t.granter=e.granter??``,t.grantee=e.grantee??``,t.grant=e.grant!==void 0&&e.grant!==null?i.Grant.fromPartial(e.grant):void 0,t}};function s(){return{results:[]}}e.MsgExecResponse={encode(e,t=r.default.Writer.create()){for(let n of e.results)t.uint32(10).bytes(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.results.push(n.bytes());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{results:Array.isArray(e?.results)?e.results.map(e=>g(e)):[]}},toJSON(e){let t={};return e.results?t.results=e.results.map(e=>v(e===void 0?new Uint8Array:e)):t.results=[],t},fromPartial(e){let t=s();return t.results=e.results?.map(e=>e)||[],t}};function c(){return{grantee:``,msgs:[]}}e.MsgExec={encode(e,t=r.default.Writer.create()){e.grantee!==``&&t.uint32(10).string(e.grantee);for(let n of e.msgs)a.Any.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.grantee=n.string();break;case 2:o.msgs.push(a.Any.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{grantee:y(e.grantee)?String(e.grantee):``,msgs:Array.isArray(e?.msgs)?e.msgs.map(e=>a.Any.fromJSON(e)):[]}},toJSON(e){let t={};return e.grantee!==void 0&&(t.grantee=e.grantee),e.msgs?t.msgs=e.msgs.map(e=>e?a.Any.toJSON(e):void 0):t.msgs=[],t},fromPartial(e){let t=c();return t.grantee=e.grantee??``,t.msgs=e.msgs?.map(e=>a.Any.fromPartial(e))||[],t}};function l(){return{}}e.MsgGrantResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return l()}};function u(){return{granter:``,grantee:``,msgTypeUrl:``}}e.MsgRevoke={encode(e,t=r.default.Writer.create()){return e.granter!==``&&t.uint32(10).string(e.granter),e.grantee!==``&&t.uint32(18).string(e.grantee),e.msgTypeUrl!==``&&t.uint32(26).string(e.msgTypeUrl),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.granter=n.string();break;case 2:a.grantee=n.string();break;case 3:a.msgTypeUrl=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{granter:y(e.granter)?String(e.granter):``,grantee:y(e.grantee)?String(e.grantee):``,msgTypeUrl:y(e.msgTypeUrl)?String(e.msgTypeUrl):``}},toJSON(e){let t={};return e.granter!==void 0&&(t.granter=e.granter),e.grantee!==void 0&&(t.grantee=e.grantee),e.msgTypeUrl!==void 0&&(t.msgTypeUrl=e.msgTypeUrl),t},fromPartial(e){let t=u();return t.granter=e.granter??``,t.grantee=e.grantee??``,t.msgTypeUrl=e.msgTypeUrl??``,t}};function d(){return{}}e.MsgRevokeResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return d()}};var f=(()=>{if(f!==void 0)return f;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),p=f.atob||(e=>f.Buffer.from(e,`base64`).toString(`binary`));function g(e){let t=p(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var _=f.btoa||(e=>f.Buffer.from(e,`binary`).toString(`base64`));function v(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return _(t.join(``))}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function y(e){return e!=null}})),sc=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.TallyParams=e.VotingParams=e.DepositParams=e.Vote=e.TallyResult=e.Proposal=e.Deposit=e.TextProposal=e.WeightedVoteOption=e.proposalStatusToJSON=e.proposalStatusFromJSON=e.ProposalStatus=e.voteOptionToJSON=e.voteOptionFromJSON=e.VoteOption=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=Ys(),a=Ks(),o=tc(),s=nc();e.protobufPackage=`cosmos.gov.v1beta1`;var c;(function(e){e[e.VOTE_OPTION_UNSPECIFIED=0]=`VOTE_OPTION_UNSPECIFIED`,e[e.VOTE_OPTION_YES=1]=`VOTE_OPTION_YES`,e[e.VOTE_OPTION_ABSTAIN=2]=`VOTE_OPTION_ABSTAIN`,e[e.VOTE_OPTION_NO=3]=`VOTE_OPTION_NO`,e[e.VOTE_OPTION_NO_WITH_VETO=4]=`VOTE_OPTION_NO_WITH_VETO`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(c=e.VoteOption||={});function l(e){switch(e){case 0:case`VOTE_OPTION_UNSPECIFIED`:return c.VOTE_OPTION_UNSPECIFIED;case 1:case`VOTE_OPTION_YES`:return c.VOTE_OPTION_YES;case 2:case`VOTE_OPTION_ABSTAIN`:return c.VOTE_OPTION_ABSTAIN;case 3:case`VOTE_OPTION_NO`:return c.VOTE_OPTION_NO;case 4:case`VOTE_OPTION_NO_WITH_VETO`:return c.VOTE_OPTION_NO_WITH_VETO;default:return c.UNRECOGNIZED}}e.voteOptionFromJSON=l;function u(e){switch(e){case c.VOTE_OPTION_UNSPECIFIED:return`VOTE_OPTION_UNSPECIFIED`;case c.VOTE_OPTION_YES:return`VOTE_OPTION_YES`;case c.VOTE_OPTION_ABSTAIN:return`VOTE_OPTION_ABSTAIN`;case c.VOTE_OPTION_NO:return`VOTE_OPTION_NO`;case c.VOTE_OPTION_NO_WITH_VETO:return`VOTE_OPTION_NO_WITH_VETO`;default:return`UNKNOWN`}}e.voteOptionToJSON=u;var d;(function(e){e[e.PROPOSAL_STATUS_UNSPECIFIED=0]=`PROPOSAL_STATUS_UNSPECIFIED`,e[e.PROPOSAL_STATUS_DEPOSIT_PERIOD=1]=`PROPOSAL_STATUS_DEPOSIT_PERIOD`,e[e.PROPOSAL_STATUS_VOTING_PERIOD=2]=`PROPOSAL_STATUS_VOTING_PERIOD`,e[e.PROPOSAL_STATUS_PASSED=3]=`PROPOSAL_STATUS_PASSED`,e[e.PROPOSAL_STATUS_REJECTED=4]=`PROPOSAL_STATUS_REJECTED`,e[e.PROPOSAL_STATUS_FAILED=5]=`PROPOSAL_STATUS_FAILED`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(d=e.ProposalStatus||={});function f(e){switch(e){case 0:case`PROPOSAL_STATUS_UNSPECIFIED`:return d.PROPOSAL_STATUS_UNSPECIFIED;case 1:case`PROPOSAL_STATUS_DEPOSIT_PERIOD`:return d.PROPOSAL_STATUS_DEPOSIT_PERIOD;case 2:case`PROPOSAL_STATUS_VOTING_PERIOD`:return d.PROPOSAL_STATUS_VOTING_PERIOD;case 3:case`PROPOSAL_STATUS_PASSED`:return d.PROPOSAL_STATUS_PASSED;case 4:case`PROPOSAL_STATUS_REJECTED`:return d.PROPOSAL_STATUS_REJECTED;case 5:case`PROPOSAL_STATUS_FAILED`:return d.PROPOSAL_STATUS_FAILED;default:return d.UNRECOGNIZED}}e.proposalStatusFromJSON=f;function p(e){switch(e){case d.PROPOSAL_STATUS_UNSPECIFIED:return`PROPOSAL_STATUS_UNSPECIFIED`;case d.PROPOSAL_STATUS_DEPOSIT_PERIOD:return`PROPOSAL_STATUS_DEPOSIT_PERIOD`;case d.PROPOSAL_STATUS_VOTING_PERIOD:return`PROPOSAL_STATUS_VOTING_PERIOD`;case d.PROPOSAL_STATUS_PASSED:return`PROPOSAL_STATUS_PASSED`;case d.PROPOSAL_STATUS_REJECTED:return`PROPOSAL_STATUS_REJECTED`;case d.PROPOSAL_STATUS_FAILED:return`PROPOSAL_STATUS_FAILED`;default:return`UNKNOWN`}}e.proposalStatusToJSON=p;function g(){return{option:0,weight:``}}e.WeightedVoteOption={encode(e,t=r.default.Writer.create()){return e.option!==0&&t.uint32(8).int32(e.option),e.weight!==``&&t.uint32(18).string(e.weight),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=g();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.option=n.int32();break;case 2:a.weight=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{option:P(e.option)?l(e.option):0,weight:P(e.weight)?String(e.weight):``}},toJSON(e){let t={};return e.option!==void 0&&(t.option=u(e.option)),e.weight!==void 0&&(t.weight=e.weight),t},fromPartial(e){let t=g();return t.option=e.option??0,t.weight=e.weight??``,t}};function _(){return{title:``,description:``}}e.TextProposal={encode(e,t=r.default.Writer.create()){return e.title!==``&&t.uint32(10).string(e.title),e.description!==``&&t.uint32(18).string(e.description),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=_();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.title=n.string();break;case 2:a.description=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{title:P(e.title)?String(e.title):``,description:P(e.description)?String(e.description):``}},toJSON(e){let t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),t},fromPartial(e){let t=_();return t.title=e.title??``,t.description=e.description??``,t}};function v(){return{proposalId:`0`,depositor:``,amount:[]}}e.Deposit={encode(e,t=r.default.Writer.create()){e.proposalId!==`0`&&t.uint32(8).uint64(e.proposalId),e.depositor!==``&&t.uint32(18).string(e.depositor);for(let n of e.amount)a.Coin.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=v();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.proposalId=N(n.uint64());break;case 2:o.depositor=n.string();break;case 3:o.amount.push(a.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{proposalId:P(e.proposalId)?String(e.proposalId):`0`,depositor:P(e.depositor)?String(e.depositor):``,amount:Array.isArray(e?.amount)?e.amount.map(e=>a.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.proposalId!==void 0&&(t.proposalId=e.proposalId),e.depositor!==void 0&&(t.depositor=e.depositor),e.amount?t.amount=e.amount.map(e=>e?a.Coin.toJSON(e):void 0):t.amount=[],t},fromPartial(e){let t=v();return t.proposalId=e.proposalId??`0`,t.depositor=e.depositor??``,t.amount=e.amount?.map(e=>a.Coin.fromPartial(e))||[],t}};function y(){return{proposalId:`0`,content:void 0,status:0,finalTallyResult:void 0,submitTime:void 0,depositEndTime:void 0,totalDeposit:[],votingStartTime:void 0,votingEndTime:void 0}}e.Proposal={encode(t,n=r.default.Writer.create()){t.proposalId!==`0`&&n.uint32(8).uint64(t.proposalId),t.content!==void 0&&o.Any.encode(t.content,n.uint32(18).fork()).ldelim(),t.status!==0&&n.uint32(24).int32(t.status),t.finalTallyResult!==void 0&&e.TallyResult.encode(t.finalTallyResult,n.uint32(34).fork()).ldelim(),t.submitTime!==void 0&&i.Timestamp.encode(A(t.submitTime),n.uint32(42).fork()).ldelim(),t.depositEndTime!==void 0&&i.Timestamp.encode(A(t.depositEndTime),n.uint32(50).fork()).ldelim();for(let e of t.totalDeposit)a.Coin.encode(e,n.uint32(58).fork()).ldelim();return t.votingStartTime!==void 0&&i.Timestamp.encode(A(t.votingStartTime),n.uint32(66).fork()).ldelim(),t.votingEndTime!==void 0&&i.Timestamp.encode(A(t.votingEndTime),n.uint32(74).fork()).ldelim(),n},decode(t,n){let s=t instanceof r.default.Reader?t:new r.default.Reader(t),c=n===void 0?s.len:s.pos+n,l=y();for(;s.pos<c;){let t=s.uint32();switch(t>>>3){case 1:l.proposalId=N(s.uint64());break;case 2:l.content=o.Any.decode(s,s.uint32());break;case 3:l.status=s.int32();break;case 4:l.finalTallyResult=e.TallyResult.decode(s,s.uint32());break;case 5:l.submitTime=j(i.Timestamp.decode(s,s.uint32()));break;case 6:l.depositEndTime=j(i.Timestamp.decode(s,s.uint32()));break;case 7:l.totalDeposit.push(a.Coin.decode(s,s.uint32()));break;case 8:l.votingStartTime=j(i.Timestamp.decode(s,s.uint32()));break;case 9:l.votingEndTime=j(i.Timestamp.decode(s,s.uint32()));break;default:s.skipType(t&7);break}}return l},fromJSON(t){return{proposalId:P(t.proposalId)?String(t.proposalId):`0`,content:P(t.content)?o.Any.fromJSON(t.content):void 0,status:P(t.status)?f(t.status):0,finalTallyResult:P(t.finalTallyResult)?e.TallyResult.fromJSON(t.finalTallyResult):void 0,submitTime:P(t.submitTime)?M(t.submitTime):void 0,depositEndTime:P(t.depositEndTime)?M(t.depositEndTime):void 0,totalDeposit:Array.isArray(t?.totalDeposit)?t.totalDeposit.map(e=>a.Coin.fromJSON(e)):[],votingStartTime:P(t.votingStartTime)?M(t.votingStartTime):void 0,votingEndTime:P(t.votingEndTime)?M(t.votingEndTime):void 0}},toJSON(t){let n={};return t.proposalId!==void 0&&(n.proposalId=t.proposalId),t.content!==void 0&&(n.content=t.content?o.Any.toJSON(t.content):void 0),t.status!==void 0&&(n.status=p(t.status)),t.finalTallyResult!==void 0&&(n.finalTallyResult=t.finalTallyResult?e.TallyResult.toJSON(t.finalTallyResult):void 0),t.submitTime!==void 0&&(n.submitTime=t.submitTime.toISOString()),t.depositEndTime!==void 0&&(n.depositEndTime=t.depositEndTime.toISOString()),t.totalDeposit?n.totalDeposit=t.totalDeposit.map(e=>e?a.Coin.toJSON(e):void 0):n.totalDeposit=[],t.votingStartTime!==void 0&&(n.votingStartTime=t.votingStartTime.toISOString()),t.votingEndTime!==void 0&&(n.votingEndTime=t.votingEndTime.toISOString()),n},fromPartial(t){let n=y();return n.proposalId=t.proposalId??`0`,n.content=t.content!==void 0&&t.content!==null?o.Any.fromPartial(t.content):void 0,n.status=t.status??0,n.finalTallyResult=t.finalTallyResult!==void 0&&t.finalTallyResult!==null?e.TallyResult.fromPartial(t.finalTallyResult):void 0,n.submitTime=t.submitTime??void 0,n.depositEndTime=t.depositEndTime??void 0,n.totalDeposit=t.totalDeposit?.map(e=>a.Coin.fromPartial(e))||[],n.votingStartTime=t.votingStartTime??void 0,n.votingEndTime=t.votingEndTime??void 0,n}};function b(){return{yes:``,abstain:``,no:``,noWithVeto:``}}e.TallyResult={encode(e,t=r.default.Writer.create()){return e.yes!==``&&t.uint32(10).string(e.yes),e.abstain!==``&&t.uint32(18).string(e.abstain),e.no!==``&&t.uint32(26).string(e.no),e.noWithVeto!==``&&t.uint32(34).string(e.noWithVeto),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=b();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.yes=n.string();break;case 2:a.abstain=n.string();break;case 3:a.no=n.string();break;case 4:a.noWithVeto=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{yes:P(e.yes)?String(e.yes):``,abstain:P(e.abstain)?String(e.abstain):``,no:P(e.no)?String(e.no):``,noWithVeto:P(e.noWithVeto)?String(e.noWithVeto):``}},toJSON(e){let t={};return e.yes!==void 0&&(t.yes=e.yes),e.abstain!==void 0&&(t.abstain=e.abstain),e.no!==void 0&&(t.no=e.no),e.noWithVeto!==void 0&&(t.noWithVeto=e.noWithVeto),t},fromPartial(e){let t=b();return t.yes=e.yes??``,t.abstain=e.abstain??``,t.no=e.no??``,t.noWithVeto=e.noWithVeto??``,t}};function x(){return{proposalId:`0`,voter:``,option:0,options:[]}}e.Vote={encode(t,n=r.default.Writer.create()){t.proposalId!==`0`&&n.uint32(8).uint64(t.proposalId),t.voter!==``&&n.uint32(18).string(t.voter),t.option!==0&&n.uint32(24).int32(t.option);for(let r of t.options)e.WeightedVoteOption.encode(r,n.uint32(34).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=x();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.proposalId=N(i.uint64());break;case 2:o.voter=i.string();break;case 3:o.option=i.int32();break;case 4:o.options.push(e.WeightedVoteOption.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{proposalId:P(t.proposalId)?String(t.proposalId):`0`,voter:P(t.voter)?String(t.voter):``,option:P(t.option)?l(t.option):0,options:Array.isArray(t?.options)?t.options.map(t=>e.WeightedVoteOption.fromJSON(t)):[]}},toJSON(t){let n={};return t.proposalId!==void 0&&(n.proposalId=t.proposalId),t.voter!==void 0&&(n.voter=t.voter),t.option!==void 0&&(n.option=u(t.option)),t.options?n.options=t.options.map(t=>t?e.WeightedVoteOption.toJSON(t):void 0):n.options=[],n},fromPartial(t){let n=x();return n.proposalId=t.proposalId??`0`,n.voter=t.voter??``,n.option=t.option??0,n.options=t.options?.map(t=>e.WeightedVoteOption.fromPartial(t))||[],n}};function S(){return{minDeposit:[],maxDepositPeriod:void 0}}e.DepositParams={encode(e,t=r.default.Writer.create()){for(let n of e.minDeposit)a.Coin.encode(n,t.uint32(10).fork()).ldelim();return e.maxDepositPeriod!==void 0&&s.Duration.encode(e.maxDepositPeriod,t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=S();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.minDeposit.push(a.Coin.decode(n,n.uint32()));break;case 2:o.maxDepositPeriod=s.Duration.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{minDeposit:Array.isArray(e?.minDeposit)?e.minDeposit.map(e=>a.Coin.fromJSON(e)):[],maxDepositPeriod:P(e.maxDepositPeriod)?s.Duration.fromJSON(e.maxDepositPeriod):void 0}},toJSON(e){let t={};return e.minDeposit?t.minDeposit=e.minDeposit.map(e=>e?a.Coin.toJSON(e):void 0):t.minDeposit=[],e.maxDepositPeriod!==void 0&&(t.maxDepositPeriod=e.maxDepositPeriod?s.Duration.toJSON(e.maxDepositPeriod):void 0),t},fromPartial(e){let t=S();return t.minDeposit=e.minDeposit?.map(e=>a.Coin.fromPartial(e))||[],t.maxDepositPeriod=e.maxDepositPeriod!==void 0&&e.maxDepositPeriod!==null?s.Duration.fromPartial(e.maxDepositPeriod):void 0,t}};function C(){return{votingPeriod:void 0}}e.VotingParams={encode(e,t=r.default.Writer.create()){return e.votingPeriod!==void 0&&s.Duration.encode(e.votingPeriod,t.uint32(10).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=C();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.votingPeriod=s.Duration.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{votingPeriod:P(e.votingPeriod)?s.Duration.fromJSON(e.votingPeriod):void 0}},toJSON(e){let t={};return e.votingPeriod!==void 0&&(t.votingPeriod=e.votingPeriod?s.Duration.toJSON(e.votingPeriod):void 0),t},fromPartial(e){let t=C();return t.votingPeriod=e.votingPeriod!==void 0&&e.votingPeriod!==null?s.Duration.fromPartial(e.votingPeriod):void 0,t}};function w(){return{quorum:new Uint8Array,threshold:new Uint8Array,vetoThreshold:new Uint8Array}}e.TallyParams={encode(e,t=r.default.Writer.create()){return e.quorum.length!==0&&t.uint32(10).bytes(e.quorum),e.threshold.length!==0&&t.uint32(18).bytes(e.threshold),e.vetoThreshold.length!==0&&t.uint32(26).bytes(e.vetoThreshold),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=w();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.quorum=n.bytes();break;case 2:a.threshold=n.bytes();break;case 3:a.vetoThreshold=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{quorum:P(e.quorum)?D(e.quorum):new Uint8Array,threshold:P(e.threshold)?D(e.threshold):new Uint8Array,vetoThreshold:P(e.vetoThreshold)?D(e.vetoThreshold):new Uint8Array}},toJSON(e){let t={};return e.quorum!==void 0&&(t.quorum=k(e.quorum===void 0?new Uint8Array:e.quorum)),e.threshold!==void 0&&(t.threshold=k(e.threshold===void 0?new Uint8Array:e.threshold)),e.vetoThreshold!==void 0&&(t.vetoThreshold=k(e.vetoThreshold===void 0?new Uint8Array:e.vetoThreshold)),t},fromPartial(e){let t=w();return t.quorum=e.quorum??new Uint8Array,t.threshold=e.threshold??new Uint8Array,t.vetoThreshold=e.vetoThreshold??new Uint8Array,t}};var T=(()=>{if(T!==void 0)return T;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),E=T.atob||(e=>T.Buffer.from(e,`base64`).toString(`binary`));function D(e){let t=E(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var O=T.btoa||(e=>T.Buffer.from(e,`binary`).toString(`base64`));function k(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return O(t.join(``))}function A(e){return{seconds:Math.trunc(e.getTime()/1e3).toString(),nanos:e.getTime()%1e3*1e6}}function j(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}function M(e){return e instanceof Date?e:typeof e==`string`?new Date(e):j(i.Timestamp.fromJSON(e))}function N(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function P(e){return e!=null}})),cc=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.MsgDepositResponse=e.MsgDeposit=e.MsgVoteWeightedResponse=e.MsgVoteWeighted=e.MsgVoteResponse=e.MsgVote=e.MsgSubmitProposalResponse=e.MsgSubmitProposal=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=sc(),a=tc(),o=Ks();e.protobufPackage=`cosmos.gov.v1beta1`;function s(){return{content:void 0,initialDeposit:[],proposer:``}}e.MsgSubmitProposal={encode(e,t=r.default.Writer.create()){e.content!==void 0&&a.Any.encode(e.content,t.uint32(10).fork()).ldelim();for(let n of e.initialDeposit)o.Coin.encode(n,t.uint32(18).fork()).ldelim();return e.proposer!==``&&t.uint32(26).string(e.proposer),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,c=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:c.content=a.Any.decode(n,n.uint32());break;case 2:c.initialDeposit.push(o.Coin.decode(n,n.uint32()));break;case 3:c.proposer=n.string();break;default:n.skipType(e&7);break}}return c},fromJSON(e){return{content:g(e.content)?a.Any.fromJSON(e.content):void 0,initialDeposit:Array.isArray(e?.initialDeposit)?e.initialDeposit.map(e=>o.Coin.fromJSON(e)):[],proposer:g(e.proposer)?String(e.proposer):``}},toJSON(e){let t={};return e.content!==void 0&&(t.content=e.content?a.Any.toJSON(e.content):void 0),e.initialDeposit?t.initialDeposit=e.initialDeposit.map(e=>e?o.Coin.toJSON(e):void 0):t.initialDeposit=[],e.proposer!==void 0&&(t.proposer=e.proposer),t},fromPartial(e){let t=s();return t.content=e.content!==void 0&&e.content!==null?a.Any.fromPartial(e.content):void 0,t.initialDeposit=e.initialDeposit?.map(e=>o.Coin.fromPartial(e))||[],t.proposer=e.proposer??``,t}};function c(){return{proposalId:`0`}}e.MsgSubmitProposalResponse={encode(e,t=r.default.Writer.create()){return e.proposalId!==`0`&&t.uint32(8).uint64(e.proposalId),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.proposalId=h(n.uint64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{proposalId:g(e.proposalId)?String(e.proposalId):`0`}},toJSON(e){let t={};return e.proposalId!==void 0&&(t.proposalId=e.proposalId),t},fromPartial(e){let t=c();return t.proposalId=e.proposalId??`0`,t}};function l(){return{proposalId:`0`,voter:``,option:0}}e.MsgVote={encode(e,t=r.default.Writer.create()){return e.proposalId!==`0`&&t.uint32(8).uint64(e.proposalId),e.voter!==``&&t.uint32(18).string(e.voter),e.option!==0&&t.uint32(24).int32(e.option),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.proposalId=h(n.uint64());break;case 2:a.voter=n.string();break;case 3:a.option=n.int32();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{proposalId:g(e.proposalId)?String(e.proposalId):`0`,voter:g(e.voter)?String(e.voter):``,option:g(e.option)?(0,i.voteOptionFromJSON)(e.option):0}},toJSON(e){let t={};return e.proposalId!==void 0&&(t.proposalId=e.proposalId),e.voter!==void 0&&(t.voter=e.voter),e.option!==void 0&&(t.option=(0,i.voteOptionToJSON)(e.option)),t},fromPartial(e){let t=l();return t.proposalId=e.proposalId??`0`,t.voter=e.voter??``,t.option=e.option??0,t}};function u(){return{}}e.MsgVoteResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return u()}};function d(){return{proposalId:`0`,voter:``,options:[]}}e.MsgVoteWeighted={encode(e,t=r.default.Writer.create()){e.proposalId!==`0`&&t.uint32(8).uint64(e.proposalId),e.voter!==``&&t.uint32(18).string(e.voter);for(let n of e.options)i.WeightedVoteOption.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=d();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.proposalId=h(n.uint64());break;case 2:o.voter=n.string();break;case 3:o.options.push(i.WeightedVoteOption.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{proposalId:g(e.proposalId)?String(e.proposalId):`0`,voter:g(e.voter)?String(e.voter):``,options:Array.isArray(e?.options)?e.options.map(e=>i.WeightedVoteOption.fromJSON(e)):[]}},toJSON(e){let t={};return e.proposalId!==void 0&&(t.proposalId=e.proposalId),e.voter!==void 0&&(t.voter=e.voter),e.options?t.options=e.options.map(e=>e?i.WeightedVoteOption.toJSON(e):void 0):t.options=[],t},fromPartial(e){let t=d();return t.proposalId=e.proposalId??`0`,t.voter=e.voter??``,t.options=e.options?.map(e=>i.WeightedVoteOption.fromPartial(e))||[],t}};function f(){return{}}e.MsgVoteWeightedResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return f()}};function p(){return{proposalId:`0`,depositor:``,amount:[]}}e.MsgDeposit={encode(e,t=r.default.Writer.create()){e.proposalId!==`0`&&t.uint32(8).uint64(e.proposalId),e.depositor!==``&&t.uint32(18).string(e.depositor);for(let n of e.amount)o.Coin.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=p();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.proposalId=h(n.uint64());break;case 2:a.depositor=n.string();break;case 3:a.amount.push(o.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{proposalId:g(e.proposalId)?String(e.proposalId):`0`,depositor:g(e.depositor)?String(e.depositor):``,amount:Array.isArray(e?.amount)?e.amount.map(e=>o.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.proposalId!==void 0&&(t.proposalId=e.proposalId),e.depositor!==void 0&&(t.depositor=e.depositor),e.amount?t.amount=e.amount.map(e=>e?o.Coin.toJSON(e):void 0):t.amount=[],t},fromPartial(e){let t=p();return t.proposalId=e.proposalId??`0`,t.depositor=e.depositor??``,t.amount=e.amount?.map(e=>o.Coin.fromPartial(e))||[],t}};function m(){return{}}e.MsgDepositResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=m();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return m()}};function h(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function g(e){return e!=null}})),lc=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.MsgFundCommunityPoolResponse=e.MsgFundCommunityPool=e.MsgWithdrawValidatorCommissionResponse=e.MsgWithdrawValidatorCommission=e.MsgWithdrawDelegatorRewardResponse=e.MsgWithdrawDelegatorReward=e.MsgSetWithdrawAddressResponse=e.MsgSetWithdrawAddress=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=Ks();e.protobufPackage=`cosmos.distribution.v1beta1`;function a(){return{delegatorAddress:``,withdrawAddress:``}}e.MsgSetWithdrawAddress={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.withdrawAddress!==``&&t.uint32(18).string(e.withdrawAddress),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=a();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.delegatorAddress=n.string();break;case 2:o.withdrawAddress=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{delegatorAddress:p(e.delegatorAddress)?String(e.delegatorAddress):``,withdrawAddress:p(e.withdrawAddress)?String(e.withdrawAddress):``}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.withdrawAddress!==void 0&&(t.withdrawAddress=e.withdrawAddress),t},fromPartial(e){let t=a();return t.delegatorAddress=e.delegatorAddress??``,t.withdrawAddress=e.withdrawAddress??``,t}};function o(){return{}}e.MsgSetWithdrawAddressResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=o();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return o()}};function s(){return{delegatorAddress:``,validatorAddress:``}}e.MsgWithdrawDelegatorReward={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==``&&t.uint32(18).string(e.validatorAddress),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorAddress=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:p(e.delegatorAddress)?String(e.delegatorAddress):``,validatorAddress:p(e.validatorAddress)?String(e.validatorAddress):``}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),t},fromPartial(e){let t=s();return t.delegatorAddress=e.delegatorAddress??``,t.validatorAddress=e.validatorAddress??``,t}};function c(){return{}}e.MsgWithdrawDelegatorRewardResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return c()}};function l(){return{validatorAddress:``}}e.MsgWithdrawValidatorCommission={encode(e,t=r.default.Writer.create()){return e.validatorAddress!==``&&t.uint32(10).string(e.validatorAddress),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.validatorAddress=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{validatorAddress:p(e.validatorAddress)?String(e.validatorAddress):``}},toJSON(e){let t={};return e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),t},fromPartial(e){let t=l();return t.validatorAddress=e.validatorAddress??``,t}};function u(){return{}}e.MsgWithdrawValidatorCommissionResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return u()}};function d(){return{amount:[],depositor:``}}e.MsgFundCommunityPool={encode(e,t=r.default.Writer.create()){for(let n of e.amount)i.Coin.encode(n,t.uint32(10).fork()).ldelim();return e.depositor!==``&&t.uint32(18).string(e.depositor),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=d();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.amount.push(i.Coin.decode(n,n.uint32()));break;case 2:o.depositor=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{amount:Array.isArray(e?.amount)?e.amount.map(e=>i.Coin.fromJSON(e)):[],depositor:p(e.depositor)?String(e.depositor):``}},toJSON(e){let t={};return e.amount?t.amount=e.amount.map(e=>e?i.Coin.toJSON(e):void 0):t.amount=[],e.depositor!==void 0&&(t.depositor=e.depositor),t},fromPartial(e){let t=d();return t.amount=e.amount?.map(e=>i.Coin.fromPartial(e))||[],t.depositor=e.depositor??``,t}};function f(){return{}}e.MsgFundCommunityPoolResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return f()}},r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function p(e){return e!=null}})),uc=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Model=e.AbsoluteTxPosition=e.ContractCodeHistoryEntry=e.ContractInfo=e.CodeInfo=e.Params=e.AccessConfig=e.AccessTypeParam=e.contractCodeHistoryOperationTypeToJSON=e.contractCodeHistoryOperationTypeFromJSON=e.ContractCodeHistoryOperationType=e.accessTypeToJSON=e.accessTypeFromJSON=e.AccessType=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=tc();e.protobufPackage=`cosmwasm.wasm.v1`;var a;(function(e){e[e.ACCESS_TYPE_UNSPECIFIED=0]=`ACCESS_TYPE_UNSPECIFIED`,e[e.ACCESS_TYPE_NOBODY=1]=`ACCESS_TYPE_NOBODY`,e[e.ACCESS_TYPE_ONLY_ADDRESS=2]=`ACCESS_TYPE_ONLY_ADDRESS`,e[e.ACCESS_TYPE_EVERYBODY=3]=`ACCESS_TYPE_EVERYBODY`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(a=e.AccessType||={});function o(e){switch(e){case 0:case`ACCESS_TYPE_UNSPECIFIED`:return a.ACCESS_TYPE_UNSPECIFIED;case 1:case`ACCESS_TYPE_NOBODY`:return a.ACCESS_TYPE_NOBODY;case 2:case`ACCESS_TYPE_ONLY_ADDRESS`:return a.ACCESS_TYPE_ONLY_ADDRESS;case 3:case`ACCESS_TYPE_EVERYBODY`:return a.ACCESS_TYPE_EVERYBODY;default:return a.UNRECOGNIZED}}e.accessTypeFromJSON=o;function s(e){switch(e){case a.ACCESS_TYPE_UNSPECIFIED:return`ACCESS_TYPE_UNSPECIFIED`;case a.ACCESS_TYPE_NOBODY:return`ACCESS_TYPE_NOBODY`;case a.ACCESS_TYPE_ONLY_ADDRESS:return`ACCESS_TYPE_ONLY_ADDRESS`;case a.ACCESS_TYPE_EVERYBODY:return`ACCESS_TYPE_EVERYBODY`;default:return`UNKNOWN`}}e.accessTypeToJSON=s;var c;(function(e){e[e.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED=0]=`CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED`,e[e.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT=1]=`CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT`,e[e.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE=2]=`CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE`,e[e.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS=3]=`CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(c=e.ContractCodeHistoryOperationType||={});function l(e){switch(e){case 0:case`CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED`:return c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED;case 1:case`CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT`:return c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT;case 2:case`CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE`:return c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE;case 3:case`CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS`:return c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS;default:return c.UNRECOGNIZED}}e.contractCodeHistoryOperationTypeFromJSON=l;function u(e){switch(e){case c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED:return`CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED`;case c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT:return`CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT`;case c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE:return`CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE`;case c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS:return`CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS`;default:return`UNKNOWN`}}e.contractCodeHistoryOperationTypeToJSON=u;function d(){return{value:0}}e.AccessTypeParam={encode(e,t=r.default.Writer.create()){return e.value!==0&&t.uint32(8).int32(e.value),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.value=n.int32();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{value:D(e.value)?o(e.value):0}},toJSON(e){let t={};return e.value!==void 0&&(t.value=s(e.value)),t},fromPartial(e){let t=d();return t.value=e.value??0,t}};function f(){return{permission:0,address:``}}e.AccessConfig={encode(e,t=r.default.Writer.create()){return e.permission!==0&&t.uint32(8).int32(e.permission),e.address!==``&&t.uint32(18).string(e.address),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.permission=n.int32();break;case 2:a.address=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{permission:D(e.permission)?o(e.permission):0,address:D(e.address)?String(e.address):``}},toJSON(e){let t={};return e.permission!==void 0&&(t.permission=s(e.permission)),e.address!==void 0&&(t.address=e.address),t},fromPartial(e){let t=f();return t.permission=e.permission??0,t.address=e.address??``,t}};function p(){return{codeUploadAccess:void 0,instantiateDefaultPermission:0,maxWasmCodeSize:`0`}}e.Params={encode(t,n=r.default.Writer.create()){return t.codeUploadAccess!==void 0&&e.AccessConfig.encode(t.codeUploadAccess,n.uint32(10).fork()).ldelim(),t.instantiateDefaultPermission!==0&&n.uint32(16).int32(t.instantiateDefaultPermission),t.maxWasmCodeSize!==`0`&&n.uint32(24).uint64(t.maxWasmCodeSize),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=p();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.codeUploadAccess=e.AccessConfig.decode(i,i.uint32());break;case 2:o.instantiateDefaultPermission=i.int32();break;case 3:o.maxWasmCodeSize=E(i.uint64());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{codeUploadAccess:D(t.codeUploadAccess)?e.AccessConfig.fromJSON(t.codeUploadAccess):void 0,instantiateDefaultPermission:D(t.instantiateDefaultPermission)?o(t.instantiateDefaultPermission):0,maxWasmCodeSize:D(t.maxWasmCodeSize)?String(t.maxWasmCodeSize):`0`}},toJSON(t){let n={};return t.codeUploadAccess!==void 0&&(n.codeUploadAccess=t.codeUploadAccess?e.AccessConfig.toJSON(t.codeUploadAccess):void 0),t.instantiateDefaultPermission!==void 0&&(n.instantiateDefaultPermission=s(t.instantiateDefaultPermission)),t.maxWasmCodeSize!==void 0&&(n.maxWasmCodeSize=t.maxWasmCodeSize),n},fromPartial(t){let n=p();return n.codeUploadAccess=t.codeUploadAccess!==void 0&&t.codeUploadAccess!==null?e.AccessConfig.fromPartial(t.codeUploadAccess):void 0,n.instantiateDefaultPermission=t.instantiateDefaultPermission??0,n.maxWasmCodeSize=t.maxWasmCodeSize??`0`,n}};function g(){return{codeHash:new Uint8Array,creator:``,instantiateConfig:void 0}}e.CodeInfo={encode(t,n=r.default.Writer.create()){return t.codeHash.length!==0&&n.uint32(10).bytes(t.codeHash),t.creator!==``&&n.uint32(18).string(t.creator),t.instantiateConfig!==void 0&&e.AccessConfig.encode(t.instantiateConfig,n.uint32(42).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=g();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.codeHash=i.bytes();break;case 2:o.creator=i.string();break;case 5:o.instantiateConfig=e.AccessConfig.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{codeHash:D(t.codeHash)?C(t.codeHash):new Uint8Array,creator:D(t.creator)?String(t.creator):``,instantiateConfig:D(t.instantiateConfig)?e.AccessConfig.fromJSON(t.instantiateConfig):void 0}},toJSON(t){let n={};return t.codeHash!==void 0&&(n.codeHash=T(t.codeHash===void 0?new Uint8Array:t.codeHash)),t.creator!==void 0&&(n.creator=t.creator),t.instantiateConfig!==void 0&&(n.instantiateConfig=t.instantiateConfig?e.AccessConfig.toJSON(t.instantiateConfig):void 0),n},fromPartial(t){let n=g();return n.codeHash=t.codeHash??new Uint8Array,n.creator=t.creator??``,n.instantiateConfig=t.instantiateConfig!==void 0&&t.instantiateConfig!==null?e.AccessConfig.fromPartial(t.instantiateConfig):void 0,n}};function _(){return{codeId:`0`,creator:``,admin:``,label:``,created:void 0,ibcPortId:``,extension:void 0}}e.ContractInfo={encode(t,n=r.default.Writer.create()){return t.codeId!==`0`&&n.uint32(8).uint64(t.codeId),t.creator!==``&&n.uint32(18).string(t.creator),t.admin!==``&&n.uint32(26).string(t.admin),t.label!==``&&n.uint32(34).string(t.label),t.created!==void 0&&e.AbsoluteTxPosition.encode(t.created,n.uint32(42).fork()).ldelim(),t.ibcPortId!==``&&n.uint32(50).string(t.ibcPortId),t.extension!==void 0&&i.Any.encode(t.extension,n.uint32(58).fork()).ldelim(),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,s=_();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.codeId=E(a.uint64());break;case 2:s.creator=a.string();break;case 3:s.admin=a.string();break;case 4:s.label=a.string();break;case 5:s.created=e.AbsoluteTxPosition.decode(a,a.uint32());break;case 6:s.ibcPortId=a.string();break;case 7:s.extension=i.Any.decode(a,a.uint32());break;default:a.skipType(t&7);break}}return s},fromJSON(t){return{codeId:D(t.codeId)?String(t.codeId):`0`,creator:D(t.creator)?String(t.creator):``,admin:D(t.admin)?String(t.admin):``,label:D(t.label)?String(t.label):``,created:D(t.created)?e.AbsoluteTxPosition.fromJSON(t.created):void 0,ibcPortId:D(t.ibcPortId)?String(t.ibcPortId):``,extension:D(t.extension)?i.Any.fromJSON(t.extension):void 0}},toJSON(t){let n={};return t.codeId!==void 0&&(n.codeId=t.codeId),t.creator!==void 0&&(n.creator=t.creator),t.admin!==void 0&&(n.admin=t.admin),t.label!==void 0&&(n.label=t.label),t.created!==void 0&&(n.created=t.created?e.AbsoluteTxPosition.toJSON(t.created):void 0),t.ibcPortId!==void 0&&(n.ibcPortId=t.ibcPortId),t.extension!==void 0&&(n.extension=t.extension?i.Any.toJSON(t.extension):void 0),n},fromPartial(t){let n=_();return n.codeId=t.codeId??`0`,n.creator=t.creator??``,n.admin=t.admin??``,n.label=t.label??``,n.created=t.created!==void 0&&t.created!==null?e.AbsoluteTxPosition.fromPartial(t.created):void 0,n.ibcPortId=t.ibcPortId??``,n.extension=t.extension!==void 0&&t.extension!==null?i.Any.fromPartial(t.extension):void 0,n}};function v(){return{operation:0,codeId:`0`,updated:void 0,msg:new Uint8Array}}e.ContractCodeHistoryEntry={encode(t,n=r.default.Writer.create()){return t.operation!==0&&n.uint32(8).int32(t.operation),t.codeId!==`0`&&n.uint32(16).uint64(t.codeId),t.updated!==void 0&&e.AbsoluteTxPosition.encode(t.updated,n.uint32(26).fork()).ldelim(),t.msg.length!==0&&n.uint32(34).bytes(t.msg),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=v();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.operation=i.int32();break;case 2:o.codeId=E(i.uint64());break;case 3:o.updated=e.AbsoluteTxPosition.decode(i,i.uint32());break;case 4:o.msg=i.bytes();break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{operation:D(t.operation)?l(t.operation):0,codeId:D(t.codeId)?String(t.codeId):`0`,updated:D(t.updated)?e.AbsoluteTxPosition.fromJSON(t.updated):void 0,msg:D(t.msg)?C(t.msg):new Uint8Array}},toJSON(t){let n={};return t.operation!==void 0&&(n.operation=u(t.operation)),t.codeId!==void 0&&(n.codeId=t.codeId),t.updated!==void 0&&(n.updated=t.updated?e.AbsoluteTxPosition.toJSON(t.updated):void 0),t.msg!==void 0&&(n.msg=T(t.msg===void 0?new Uint8Array:t.msg)),n},fromPartial(t){let n=v();return n.operation=t.operation??0,n.codeId=t.codeId??`0`,n.updated=t.updated!==void 0&&t.updated!==null?e.AbsoluteTxPosition.fromPartial(t.updated):void 0,n.msg=t.msg??new Uint8Array,n}};function y(){return{blockHeight:`0`,txIndex:`0`}}e.AbsoluteTxPosition={encode(e,t=r.default.Writer.create()){return e.blockHeight!==`0`&&t.uint32(8).uint64(e.blockHeight),e.txIndex!==`0`&&t.uint32(16).uint64(e.txIndex),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=y();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.blockHeight=E(n.uint64());break;case 2:a.txIndex=E(n.uint64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{blockHeight:D(e.blockHeight)?String(e.blockHeight):`0`,txIndex:D(e.txIndex)?String(e.txIndex):`0`}},toJSON(e){let t={};return e.blockHeight!==void 0&&(t.blockHeight=e.blockHeight),e.txIndex!==void 0&&(t.txIndex=e.txIndex),t},fromPartial(e){let t=y();return t.blockHeight=e.blockHeight??`0`,t.txIndex=e.txIndex??`0`,t}};function b(){return{key:new Uint8Array,value:new Uint8Array}}e.Model={encode(e,t=r.default.Writer.create()){return e.key.length!==0&&t.uint32(10).bytes(e.key),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=b();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.key=n.bytes();break;case 2:a.value=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{key:D(e.key)?C(e.key):new Uint8Array,value:D(e.value)?C(e.value):new Uint8Array}},toJSON(e){let t={};return e.key!==void 0&&(t.key=T(e.key===void 0?new Uint8Array:e.key)),e.value!==void 0&&(t.value=T(e.value===void 0?new Uint8Array:e.value)),t},fromPartial(e){let t=b();return t.key=e.key??new Uint8Array,t.value=e.value??new Uint8Array,t}};var x=(()=>{if(x!==void 0)return x;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),S=x.atob||(e=>x.Buffer.from(e,`base64`).toString(`binary`));function C(e){let t=S(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var w=x.btoa||(e=>x.Buffer.from(e,`binary`).toString(`base64`));function T(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return w(t.join(``))}function E(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function D(e){return e!=null}})),dc=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.MsgClearAdminResponse=e.MsgClearAdmin=e.MsgUpdateAdminResponse=e.MsgUpdateAdmin=e.MsgMigrateContractResponse=e.MsgMigrateContract=e.MsgExecuteContractResponse=e.MsgExecuteContract=e.MsgInstantiateContractResponse=e.MsgInstantiateContract=e.MsgStoreCodeResponse=e.MsgStoreCode=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=uc(),a=Ks();e.protobufPackage=`cosmwasm.wasm.v1`;function o(){return{sender:``,wasmByteCode:new Uint8Array,instantiatePermission:void 0}}e.MsgStoreCode={encode(e,t=r.default.Writer.create()){return e.sender!==``&&t.uint32(10).string(e.sender),e.wasmByteCode.length!==0&&t.uint32(18).bytes(e.wasmByteCode),e.instantiatePermission!==void 0&&i.AccessConfig.encode(e.instantiatePermission,t.uint32(42).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,s=o();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:s.sender=n.string();break;case 2:s.wasmByteCode=n.bytes();break;case 5:s.instantiatePermission=i.AccessConfig.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{sender:E(e.sender)?String(e.sender):``,wasmByteCode:E(e.wasmByteCode)?S(e.wasmByteCode):new Uint8Array,instantiatePermission:E(e.instantiatePermission)?i.AccessConfig.fromJSON(e.instantiatePermission):void 0}},toJSON(e){let t={};return e.sender!==void 0&&(t.sender=e.sender),e.wasmByteCode!==void 0&&(t.wasmByteCode=w(e.wasmByteCode===void 0?new Uint8Array:e.wasmByteCode)),e.instantiatePermission!==void 0&&(t.instantiatePermission=e.instantiatePermission?i.AccessConfig.toJSON(e.instantiatePermission):void 0),t},fromPartial(e){let t=o();return t.sender=e.sender??``,t.wasmByteCode=e.wasmByteCode??new Uint8Array,t.instantiatePermission=e.instantiatePermission!==void 0&&e.instantiatePermission!==null?i.AccessConfig.fromPartial(e.instantiatePermission):void 0,t}};function s(){return{codeId:`0`}}e.MsgStoreCodeResponse={encode(e,t=r.default.Writer.create()){return e.codeId!==`0`&&t.uint32(8).uint64(e.codeId),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.codeId=T(n.uint64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{codeId:E(e.codeId)?String(e.codeId):`0`}},toJSON(e){let t={};return e.codeId!==void 0&&(t.codeId=e.codeId),t},fromPartial(e){let t=s();return t.codeId=e.codeId??`0`,t}};function c(){return{sender:``,admin:``,codeId:`0`,label:``,msg:new Uint8Array,funds:[]}}e.MsgInstantiateContract={encode(e,t=r.default.Writer.create()){e.sender!==``&&t.uint32(10).string(e.sender),e.admin!==``&&t.uint32(18).string(e.admin),e.codeId!==`0`&&t.uint32(24).uint64(e.codeId),e.label!==``&&t.uint32(34).string(e.label),e.msg.length!==0&&t.uint32(42).bytes(e.msg);for(let n of e.funds)a.Coin.encode(n,t.uint32(50).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.sender=n.string();break;case 2:o.admin=n.string();break;case 3:o.codeId=T(n.uint64());break;case 4:o.label=n.string();break;case 5:o.msg=n.bytes();break;case 6:o.funds.push(a.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{sender:E(e.sender)?String(e.sender):``,admin:E(e.admin)?String(e.admin):``,codeId:E(e.codeId)?String(e.codeId):`0`,label:E(e.label)?String(e.label):``,msg:E(e.msg)?S(e.msg):new Uint8Array,funds:Array.isArray(e?.funds)?e.funds.map(e=>a.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.sender!==void 0&&(t.sender=e.sender),e.admin!==void 0&&(t.admin=e.admin),e.codeId!==void 0&&(t.codeId=e.codeId),e.label!==void 0&&(t.label=e.label),e.msg!==void 0&&(t.msg=w(e.msg===void 0?new Uint8Array:e.msg)),e.funds?t.funds=e.funds.map(e=>e?a.Coin.toJSON(e):void 0):t.funds=[],t},fromPartial(e){let t=c();return t.sender=e.sender??``,t.admin=e.admin??``,t.codeId=e.codeId??`0`,t.label=e.label??``,t.msg=e.msg??new Uint8Array,t.funds=e.funds?.map(e=>a.Coin.fromPartial(e))||[],t}};function l(){return{address:``,data:new Uint8Array}}e.MsgInstantiateContractResponse={encode(e,t=r.default.Writer.create()){return e.address!==``&&t.uint32(10).string(e.address),e.data.length!==0&&t.uint32(18).bytes(e.data),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.address=n.string();break;case 2:a.data=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{address:E(e.address)?String(e.address):``,data:E(e.data)?S(e.data):new Uint8Array}},toJSON(e){let t={};return e.address!==void 0&&(t.address=e.address),e.data!==void 0&&(t.data=w(e.data===void 0?new Uint8Array:e.data)),t},fromPartial(e){let t=l();return t.address=e.address??``,t.data=e.data??new Uint8Array,t}};function u(){return{sender:``,contract:``,msg:new Uint8Array,funds:[]}}e.MsgExecuteContract={encode(e,t=r.default.Writer.create()){e.sender!==``&&t.uint32(10).string(e.sender),e.contract!==``&&t.uint32(18).string(e.contract),e.msg.length!==0&&t.uint32(26).bytes(e.msg);for(let n of e.funds)a.Coin.encode(n,t.uint32(42).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.sender=n.string();break;case 2:o.contract=n.string();break;case 3:o.msg=n.bytes();break;case 5:o.funds.push(a.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{sender:E(e.sender)?String(e.sender):``,contract:E(e.contract)?String(e.contract):``,msg:E(e.msg)?S(e.msg):new Uint8Array,funds:Array.isArray(e?.funds)?e.funds.map(e=>a.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.sender!==void 0&&(t.sender=e.sender),e.contract!==void 0&&(t.contract=e.contract),e.msg!==void 0&&(t.msg=w(e.msg===void 0?new Uint8Array:e.msg)),e.funds?t.funds=e.funds.map(e=>e?a.Coin.toJSON(e):void 0):t.funds=[],t},fromPartial(e){let t=u();return t.sender=e.sender??``,t.contract=e.contract??``,t.msg=e.msg??new Uint8Array,t.funds=e.funds?.map(e=>a.Coin.fromPartial(e))||[],t}};function d(){return{data:new Uint8Array}}e.MsgExecuteContractResponse={encode(e,t=r.default.Writer.create()){return e.data.length!==0&&t.uint32(10).bytes(e.data),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.data=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{data:E(e.data)?S(e.data):new Uint8Array}},toJSON(e){let t={};return e.data!==void 0&&(t.data=w(e.data===void 0?new Uint8Array:e.data)),t},fromPartial(e){let t=d();return t.data=e.data??new Uint8Array,t}};function f(){return{sender:``,contract:``,codeId:`0`,msg:new Uint8Array}}e.MsgMigrateContract={encode(e,t=r.default.Writer.create()){return e.sender!==``&&t.uint32(10).string(e.sender),e.contract!==``&&t.uint32(18).string(e.contract),e.codeId!==`0`&&t.uint32(24).uint64(e.codeId),e.msg.length!==0&&t.uint32(34).bytes(e.msg),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.sender=n.string();break;case 2:a.contract=n.string();break;case 3:a.codeId=T(n.uint64());break;case 4:a.msg=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{sender:E(e.sender)?String(e.sender):``,contract:E(e.contract)?String(e.contract):``,codeId:E(e.codeId)?String(e.codeId):`0`,msg:E(e.msg)?S(e.msg):new Uint8Array}},toJSON(e){let t={};return e.sender!==void 0&&(t.sender=e.sender),e.contract!==void 0&&(t.contract=e.contract),e.codeId!==void 0&&(t.codeId=e.codeId),e.msg!==void 0&&(t.msg=w(e.msg===void 0?new Uint8Array:e.msg)),t},fromPartial(e){let t=f();return t.sender=e.sender??``,t.contract=e.contract??``,t.codeId=e.codeId??`0`,t.msg=e.msg??new Uint8Array,t}};function p(){return{data:new Uint8Array}}e.MsgMigrateContractResponse={encode(e,t=r.default.Writer.create()){return e.data.length!==0&&t.uint32(10).bytes(e.data),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=p();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.data=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{data:E(e.data)?S(e.data):new Uint8Array}},toJSON(e){let t={};return e.data!==void 0&&(t.data=w(e.data===void 0?new Uint8Array:e.data)),t},fromPartial(e){let t=p();return t.data=e.data??new Uint8Array,t}};function g(){return{sender:``,newAdmin:``,contract:``}}e.MsgUpdateAdmin={encode(e,t=r.default.Writer.create()){return e.sender!==``&&t.uint32(10).string(e.sender),e.newAdmin!==``&&t.uint32(18).string(e.newAdmin),e.contract!==``&&t.uint32(26).string(e.contract),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=g();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.sender=n.string();break;case 2:a.newAdmin=n.string();break;case 3:a.contract=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{sender:E(e.sender)?String(e.sender):``,newAdmin:E(e.newAdmin)?String(e.newAdmin):``,contract:E(e.contract)?String(e.contract):``}},toJSON(e){let t={};return e.sender!==void 0&&(t.sender=e.sender),e.newAdmin!==void 0&&(t.newAdmin=e.newAdmin),e.contract!==void 0&&(t.contract=e.contract),t},fromPartial(e){let t=g();return t.sender=e.sender??``,t.newAdmin=e.newAdmin??``,t.contract=e.contract??``,t}};function _(){return{}}e.MsgUpdateAdminResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=_();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return _()}};function v(){return{sender:``,contract:``}}e.MsgClearAdmin={encode(e,t=r.default.Writer.create()){return e.sender!==``&&t.uint32(10).string(e.sender),e.contract!==``&&t.uint32(26).string(e.contract),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=v();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.sender=n.string();break;case 3:a.contract=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{sender:E(e.sender)?String(e.sender):``,contract:E(e.contract)?String(e.contract):``}},toJSON(e){let t={};return e.sender!==void 0&&(t.sender=e.sender),e.contract!==void 0&&(t.contract=e.contract),t},fromPartial(e){let t=v();return t.sender=e.sender??``,t.contract=e.contract??``,t}};function y(){return{}}e.MsgClearAdminResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=y();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return y()}};var b=(()=>{if(b!==void 0)return b;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),x=b.atob||(e=>b.Buffer.from(e,`base64`).toString(`binary`));function S(e){let t=x(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var C=b.btoa||(e=>b.Buffer.from(e,`binary`).toString(`base64`));function w(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return C(t.join(``))}function T(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function E(e){return e!=null}})),fc=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.ModuleVersion=e.CancelSoftwareUpgradeProposal=e.SoftwareUpgradeProposal=e.Plan=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=Ys(),a=tc();e.protobufPackage=`cosmos.upgrade.v1beta1`;function o(){return{name:``,time:void 0,height:`0`,info:``,upgradedClientState:void 0}}e.Plan={encode(e,t=r.default.Writer.create()){return e.name!==``&&t.uint32(10).string(e.name),e.time!==void 0&&i.Timestamp.encode(u(e.time),t.uint32(18).fork()).ldelim(),e.height!==`0`&&t.uint32(24).int64(e.height),e.info!==``&&t.uint32(34).string(e.info),e.upgradedClientState!==void 0&&a.Any.encode(e.upgradedClientState,t.uint32(42).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),s=t===void 0?n.len:n.pos+t,c=o();for(;n.pos<s;){let e=n.uint32();switch(e>>>3){case 1:c.name=n.string();break;case 2:c.time=d(i.Timestamp.decode(n,n.uint32()));break;case 3:c.height=p(n.int64());break;case 4:c.info=n.string();break;case 5:c.upgradedClientState=a.Any.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return c},fromJSON(e){return{name:m(e.name)?String(e.name):``,time:m(e.time)?f(e.time):void 0,height:m(e.height)?String(e.height):`0`,info:m(e.info)?String(e.info):``,upgradedClientState:m(e.upgradedClientState)?a.Any.fromJSON(e.upgradedClientState):void 0}},toJSON(e){let t={};return e.name!==void 0&&(t.name=e.name),e.time!==void 0&&(t.time=e.time.toISOString()),e.height!==void 0&&(t.height=e.height),e.info!==void 0&&(t.info=e.info),e.upgradedClientState!==void 0&&(t.upgradedClientState=e.upgradedClientState?a.Any.toJSON(e.upgradedClientState):void 0),t},fromPartial(e){let t=o();return t.name=e.name??``,t.time=e.time??void 0,t.height=e.height??`0`,t.info=e.info??``,t.upgradedClientState=e.upgradedClientState!==void 0&&e.upgradedClientState!==null?a.Any.fromPartial(e.upgradedClientState):void 0,t}};function s(){return{title:``,description:``,plan:void 0}}e.SoftwareUpgradeProposal={encode(t,n=r.default.Writer.create()){return t.title!==``&&n.uint32(10).string(t.title),t.description!==``&&n.uint32(18).string(t.description),t.plan!==void 0&&e.Plan.encode(t.plan,n.uint32(26).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=s();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.title=i.string();break;case 2:o.description=i.string();break;case 3:o.plan=e.Plan.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{title:m(t.title)?String(t.title):``,description:m(t.description)?String(t.description):``,plan:m(t.plan)?e.Plan.fromJSON(t.plan):void 0}},toJSON(t){let n={};return t.title!==void 0&&(n.title=t.title),t.description!==void 0&&(n.description=t.description),t.plan!==void 0&&(n.plan=t.plan?e.Plan.toJSON(t.plan):void 0),n},fromPartial(t){let n=s();return n.title=t.title??``,n.description=t.description??``,n.plan=t.plan!==void 0&&t.plan!==null?e.Plan.fromPartial(t.plan):void 0,n}};function c(){return{title:``,description:``}}e.CancelSoftwareUpgradeProposal={encode(e,t=r.default.Writer.create()){return e.title!==``&&t.uint32(10).string(e.title),e.description!==``&&t.uint32(18).string(e.description),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.title=n.string();break;case 2:a.description=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{title:m(e.title)?String(e.title):``,description:m(e.description)?String(e.description):``}},toJSON(e){let t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),t},fromPartial(e){let t=c();return t.title=e.title??``,t.description=e.description??``,t}};function l(){return{name:``,version:`0`}}e.ModuleVersion={encode(e,t=r.default.Writer.create()){return e.name!==``&&t.uint32(10).string(e.name),e.version!==`0`&&t.uint32(16).uint64(e.version),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.name=n.string();break;case 2:a.version=p(n.uint64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{name:m(e.name)?String(e.name):``,version:m(e.version)?String(e.version):`0`}},toJSON(e){let t={};return e.name!==void 0&&(t.name=e.name),e.version!==void 0&&(t.version=e.version),t},fromPartial(e){let t=l();return t.name=e.name??``,t.version=e.version??`0`,t}};function u(e){return{seconds:Math.trunc(e.getTime()/1e3).toString(),nanos:e.getTime()%1e3*1e6}}function d(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}function f(e){return e instanceof Date?e:typeof e==`string`?new Date(e):d(i.Timestamp.fromJSON(e))}function p(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function m(e){return e!=null}})),pc=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Params=e.Height=e.UpgradeProposal=e.ClientUpdateProposal=e.ClientConsensusStates=e.ConsensusStateWithHeight=e.IdentifiedClientState=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=tc(),a=fc();e.protobufPackage=`ibc.core.client.v1`;function o(){return{clientId:``,clientState:void 0}}e.IdentifiedClientState={encode(e,t=r.default.Writer.create()){return e.clientId!==``&&t.uint32(10).string(e.clientId),e.clientState!==void 0&&i.Any.encode(e.clientState,t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,s=o();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:s.clientId=n.string();break;case 2:s.clientState=i.Any.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{clientId:m(e.clientId)?String(e.clientId):``,clientState:m(e.clientState)?i.Any.fromJSON(e.clientState):void 0}},toJSON(e){let t={};return e.clientId!==void 0&&(t.clientId=e.clientId),e.clientState!==void 0&&(t.clientState=e.clientState?i.Any.toJSON(e.clientState):void 0),t},fromPartial(e){let t=o();return t.clientId=e.clientId??``,t.clientState=e.clientState!==void 0&&e.clientState!==null?i.Any.fromPartial(e.clientState):void 0,t}};function s(){return{height:void 0,consensusState:void 0}}e.ConsensusStateWithHeight={encode(t,n=r.default.Writer.create()){return t.height!==void 0&&e.Height.encode(t.height,n.uint32(10).fork()).ldelim(),t.consensusState!==void 0&&i.Any.encode(t.consensusState,n.uint32(18).fork()).ldelim(),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,c=s();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:c.height=e.Height.decode(a,a.uint32());break;case 2:c.consensusState=i.Any.decode(a,a.uint32());break;default:a.skipType(t&7);break}}return c},fromJSON(t){return{height:m(t.height)?e.Height.fromJSON(t.height):void 0,consensusState:m(t.consensusState)?i.Any.fromJSON(t.consensusState):void 0}},toJSON(t){let n={};return t.height!==void 0&&(n.height=t.height?e.Height.toJSON(t.height):void 0),t.consensusState!==void 0&&(n.consensusState=t.consensusState?i.Any.toJSON(t.consensusState):void 0),n},fromPartial(t){let n=s();return n.height=t.height!==void 0&&t.height!==null?e.Height.fromPartial(t.height):void 0,n.consensusState=t.consensusState!==void 0&&t.consensusState!==null?i.Any.fromPartial(t.consensusState):void 0,n}};function c(){return{clientId:``,consensusStates:[]}}e.ClientConsensusStates={encode(t,n=r.default.Writer.create()){t.clientId!==``&&n.uint32(10).string(t.clientId);for(let r of t.consensusStates)e.ConsensusStateWithHeight.encode(r,n.uint32(18).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=c();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.clientId=i.string();break;case 2:o.consensusStates.push(e.ConsensusStateWithHeight.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{clientId:m(t.clientId)?String(t.clientId):``,consensusStates:Array.isArray(t?.consensusStates)?t.consensusStates.map(t=>e.ConsensusStateWithHeight.fromJSON(t)):[]}},toJSON(t){let n={};return t.clientId!==void 0&&(n.clientId=t.clientId),t.consensusStates?n.consensusStates=t.consensusStates.map(t=>t?e.ConsensusStateWithHeight.toJSON(t):void 0):n.consensusStates=[],n},fromPartial(t){let n=c();return n.clientId=t.clientId??``,n.consensusStates=t.consensusStates?.map(t=>e.ConsensusStateWithHeight.fromPartial(t))||[],n}};function l(){return{title:``,description:``,subjectClientId:``,substituteClientId:``}}e.ClientUpdateProposal={encode(e,t=r.default.Writer.create()){return e.title!==``&&t.uint32(10).string(e.title),e.description!==``&&t.uint32(18).string(e.description),e.subjectClientId!==``&&t.uint32(26).string(e.subjectClientId),e.substituteClientId!==``&&t.uint32(34).string(e.substituteClientId),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.title=n.string();break;case 2:a.description=n.string();break;case 3:a.subjectClientId=n.string();break;case 4:a.substituteClientId=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{title:m(e.title)?String(e.title):``,description:m(e.description)?String(e.description):``,subjectClientId:m(e.subjectClientId)?String(e.subjectClientId):``,substituteClientId:m(e.substituteClientId)?String(e.substituteClientId):``}},toJSON(e){let t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),e.subjectClientId!==void 0&&(t.subjectClientId=e.subjectClientId),e.substituteClientId!==void 0&&(t.substituteClientId=e.substituteClientId),t},fromPartial(e){let t=l();return t.title=e.title??``,t.description=e.description??``,t.subjectClientId=e.subjectClientId??``,t.substituteClientId=e.substituteClientId??``,t}};function u(){return{title:``,description:``,plan:void 0,upgradedClientState:void 0}}e.UpgradeProposal={encode(e,t=r.default.Writer.create()){return e.title!==``&&t.uint32(10).string(e.title),e.description!==``&&t.uint32(18).string(e.description),e.plan!==void 0&&a.Plan.encode(e.plan,t.uint32(26).fork()).ldelim(),e.upgradedClientState!==void 0&&i.Any.encode(e.upgradedClientState,t.uint32(34).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),o=t===void 0?n.len:n.pos+t,s=u();for(;n.pos<o;){let e=n.uint32();switch(e>>>3){case 1:s.title=n.string();break;case 2:s.description=n.string();break;case 3:s.plan=a.Plan.decode(n,n.uint32());break;case 4:s.upgradedClientState=i.Any.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{title:m(e.title)?String(e.title):``,description:m(e.description)?String(e.description):``,plan:m(e.plan)?a.Plan.fromJSON(e.plan):void 0,upgradedClientState:m(e.upgradedClientState)?i.Any.fromJSON(e.upgradedClientState):void 0}},toJSON(e){let t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),e.plan!==void 0&&(t.plan=e.plan?a.Plan.toJSON(e.plan):void 0),e.upgradedClientState!==void 0&&(t.upgradedClientState=e.upgradedClientState?i.Any.toJSON(e.upgradedClientState):void 0),t},fromPartial(e){let t=u();return t.title=e.title??``,t.description=e.description??``,t.plan=e.plan!==void 0&&e.plan!==null?a.Plan.fromPartial(e.plan):void 0,t.upgradedClientState=e.upgradedClientState!==void 0&&e.upgradedClientState!==null?i.Any.fromPartial(e.upgradedClientState):void 0,t}};function d(){return{revisionNumber:`0`,revisionHeight:`0`}}e.Height={encode(e,t=r.default.Writer.create()){return e.revisionNumber!==`0`&&t.uint32(8).uint64(e.revisionNumber),e.revisionHeight!==`0`&&t.uint32(16).uint64(e.revisionHeight),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.revisionNumber=p(n.uint64());break;case 2:a.revisionHeight=p(n.uint64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{revisionNumber:m(e.revisionNumber)?String(e.revisionNumber):`0`,revisionHeight:m(e.revisionHeight)?String(e.revisionHeight):`0`}},toJSON(e){let t={};return e.revisionNumber!==void 0&&(t.revisionNumber=e.revisionNumber),e.revisionHeight!==void 0&&(t.revisionHeight=e.revisionHeight),t},fromPartial(e){let t=d();return t.revisionNumber=e.revisionNumber??`0`,t.revisionHeight=e.revisionHeight??`0`,t}};function f(){return{allowedClients:[]}}e.Params={encode(e,t=r.default.Writer.create()){for(let n of e.allowedClients)t.uint32(10).string(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.allowedClients.push(n.string());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{allowedClients:Array.isArray(e?.allowedClients)?e.allowedClients.map(e=>String(e)):[]}},toJSON(e){let t={};return e.allowedClients?t.allowedClients=e.allowedClients.map(e=>e):t.allowedClients=[],t},fromPartial(e){let t=f();return t.allowedClients=e.allowedClients?.map(e=>e)||[],t}};function p(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function m(e){return e!=null}})),mc=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.MsgTransferResponse=e.MsgTransfer=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=Ks(),a=pc();e.protobufPackage=`ibc.applications.transfer.v1`;function o(){return{sourcePort:``,sourceChannel:``,token:void 0,sender:``,receiver:``,timeoutHeight:void 0,timeoutTimestamp:`0`,memo:``}}e.MsgTransfer={encode(e,t=r.default.Writer.create()){return e.sourcePort!==``&&t.uint32(10).string(e.sourcePort),e.sourceChannel!==``&&t.uint32(18).string(e.sourceChannel),e.token!==void 0&&i.Coin.encode(e.token,t.uint32(26).fork()).ldelim(),e.sender!==``&&t.uint32(34).string(e.sender),e.receiver!==``&&t.uint32(42).string(e.receiver),e.timeoutHeight!==void 0&&a.Height.encode(e.timeoutHeight,t.uint32(50).fork()).ldelim(),e.timeoutTimestamp!==`0`&&t.uint32(56).uint64(e.timeoutTimestamp),e.memo!==``&&t.uint32(66).string(e.memo),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),s=t===void 0?n.len:n.pos+t,l=o();for(;n.pos<s;){let e=n.uint32();switch(e>>>3){case 1:l.sourcePort=n.string();break;case 2:l.sourceChannel=n.string();break;case 3:l.token=i.Coin.decode(n,n.uint32());break;case 4:l.sender=n.string();break;case 5:l.receiver=n.string();break;case 6:l.timeoutHeight=a.Height.decode(n,n.uint32());break;case 7:l.timeoutTimestamp=c(n.uint64());break;case 8:l.memo=n.string();break;default:n.skipType(e&7);break}}return l},fromJSON(e){return{sourcePort:l(e.sourcePort)?String(e.sourcePort):``,sourceChannel:l(e.sourceChannel)?String(e.sourceChannel):``,token:l(e.token)?i.Coin.fromJSON(e.token):void 0,sender:l(e.sender)?String(e.sender):``,receiver:l(e.receiver)?String(e.receiver):``,timeoutHeight:l(e.timeoutHeight)?a.Height.fromJSON(e.timeoutHeight):void 0,timeoutTimestamp:l(e.timeoutTimestamp)?String(e.timeoutTimestamp):`0`,memo:l(e.memo)?String(e.memo):``}},toJSON(e){let t={};return e.sourcePort!==void 0&&(t.sourcePort=e.sourcePort),e.sourceChannel!==void 0&&(t.sourceChannel=e.sourceChannel),e.token!==void 0&&(t.token=e.token?i.Coin.toJSON(e.token):void 0),e.sender!==void 0&&(t.sender=e.sender),e.receiver!==void 0&&(t.receiver=e.receiver),e.timeoutHeight!==void 0&&(t.timeoutHeight=e.timeoutHeight?a.Height.toJSON(e.timeoutHeight):void 0),e.timeoutTimestamp!==void 0&&(t.timeoutTimestamp=e.timeoutTimestamp),e.memo!==void 0&&(t.memo=e.memo),t},fromPartial(e){let t=o();return t.sourcePort=e.sourcePort??``,t.sourceChannel=e.sourceChannel??``,t.token=e.token!==void 0&&e.token!==null?i.Coin.fromPartial(e.token):void 0,t.sender=e.sender??``,t.receiver=e.receiver??``,t.timeoutHeight=e.timeoutHeight!==void 0&&e.timeoutHeight!==null?a.Height.fromPartial(e.timeoutHeight):void 0,t.timeoutTimestamp=e.timeoutTimestamp??`0`,t.memo=e.memo??``,t}};function s(){return{}}e.MsgTransferResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return s()}};function c(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function l(e){return e!=null}})),hc=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.UnknownMessage=void 0;var t=(_(),n(v));e.UnknownMessage=class{constructor(e,t){this._typeUrl=e,this._value=t}get typeUrl(){return this._typeUrl}get value(){return this._value}toJSON(){return{typeUrl:this._typeUrl,value:t.Buffer.from(this._value).toString(`base64`)}}}})),gc=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.StakeAuthorization_Validators=e.StakeAuthorization=e.authorizationTypeToJSON=e.authorizationTypeFromJSON=e.AuthorizationType=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=Ks();e.protobufPackage=`cosmos.staking.v1beta1`;var a;(function(e){e[e.AUTHORIZATION_TYPE_UNSPECIFIED=0]=`AUTHORIZATION_TYPE_UNSPECIFIED`,e[e.AUTHORIZATION_TYPE_DELEGATE=1]=`AUTHORIZATION_TYPE_DELEGATE`,e[e.AUTHORIZATION_TYPE_UNDELEGATE=2]=`AUTHORIZATION_TYPE_UNDELEGATE`,e[e.AUTHORIZATION_TYPE_REDELEGATE=3]=`AUTHORIZATION_TYPE_REDELEGATE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(a=e.AuthorizationType||={});function o(e){switch(e){case 0:case`AUTHORIZATION_TYPE_UNSPECIFIED`:return a.AUTHORIZATION_TYPE_UNSPECIFIED;case 1:case`AUTHORIZATION_TYPE_DELEGATE`:return a.AUTHORIZATION_TYPE_DELEGATE;case 2:case`AUTHORIZATION_TYPE_UNDELEGATE`:return a.AUTHORIZATION_TYPE_UNDELEGATE;case 3:case`AUTHORIZATION_TYPE_REDELEGATE`:return a.AUTHORIZATION_TYPE_REDELEGATE;default:return a.UNRECOGNIZED}}e.authorizationTypeFromJSON=o;function s(e){switch(e){case a.AUTHORIZATION_TYPE_UNSPECIFIED:return`AUTHORIZATION_TYPE_UNSPECIFIED`;case a.AUTHORIZATION_TYPE_DELEGATE:return`AUTHORIZATION_TYPE_DELEGATE`;case a.AUTHORIZATION_TYPE_UNDELEGATE:return`AUTHORIZATION_TYPE_UNDELEGATE`;case a.AUTHORIZATION_TYPE_REDELEGATE:return`AUTHORIZATION_TYPE_REDELEGATE`;default:return`UNKNOWN`}}e.authorizationTypeToJSON=s;function c(){return{maxTokens:void 0,allowList:void 0,denyList:void 0,authorizationType:0}}e.StakeAuthorization={encode(t,n=r.default.Writer.create()){return t.maxTokens!==void 0&&i.Coin.encode(t.maxTokens,n.uint32(10).fork()).ldelim(),t.allowList!==void 0&&e.StakeAuthorization_Validators.encode(t.allowList,n.uint32(18).fork()).ldelim(),t.denyList!==void 0&&e.StakeAuthorization_Validators.encode(t.denyList,n.uint32(26).fork()).ldelim(),t.authorizationType!==0&&n.uint32(32).int32(t.authorizationType),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,s=c();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.maxTokens=i.Coin.decode(a,a.uint32());break;case 2:s.allowList=e.StakeAuthorization_Validators.decode(a,a.uint32());break;case 3:s.denyList=e.StakeAuthorization_Validators.decode(a,a.uint32());break;case 4:s.authorizationType=a.int32();break;default:a.skipType(t&7);break}}return s},fromJSON(t){return{maxTokens:u(t.maxTokens)?i.Coin.fromJSON(t.maxTokens):void 0,allowList:u(t.allowList)?e.StakeAuthorization_Validators.fromJSON(t.allowList):void 0,denyList:u(t.denyList)?e.StakeAuthorization_Validators.fromJSON(t.denyList):void 0,authorizationType:u(t.authorizationType)?o(t.authorizationType):0}},toJSON(t){let n={};return t.maxTokens!==void 0&&(n.maxTokens=t.maxTokens?i.Coin.toJSON(t.maxTokens):void 0),t.allowList!==void 0&&(n.allowList=t.allowList?e.StakeAuthorization_Validators.toJSON(t.allowList):void 0),t.denyList!==void 0&&(n.denyList=t.denyList?e.StakeAuthorization_Validators.toJSON(t.denyList):void 0),t.authorizationType!==void 0&&(n.authorizationType=s(t.authorizationType)),n},fromPartial(t){let n=c();return n.maxTokens=t.maxTokens!==void 0&&t.maxTokens!==null?i.Coin.fromPartial(t.maxTokens):void 0,n.allowList=t.allowList!==void 0&&t.allowList!==null?e.StakeAuthorization_Validators.fromPartial(t.allowList):void 0,n.denyList=t.denyList!==void 0&&t.denyList!==null?e.StakeAuthorization_Validators.fromPartial(t.denyList):void 0,n.authorizationType=t.authorizationType??0,n}};function l(){return{address:[]}}e.StakeAuthorization_Validators={encode(e,t=r.default.Writer.create()){for(let n of e.address)t.uint32(10).string(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.address.push(n.string());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{address:Array.isArray(e?.address)?e.address.map(e=>String(e)):[]}},toJSON(e){let t={};return e.address?t.address=e.address.map(e=>e):t.address=[],t},fromPartial(e){let t=l();return t.address=e.address?.map(e=>e)||[],t}},r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function u(e){return e!=null}})),_c=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.SendAuthorization=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=Ks();e.protobufPackage=`cosmos.bank.v1beta1`;function a(){return{spendLimit:[]}}e.SendAuthorization={encode(e,t=r.default.Writer.create()){for(let n of e.spendLimit)i.Coin.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),o=t===void 0?n.len:n.pos+t,s=a();for(;n.pos<o;){let e=n.uint32();switch(e>>>3){case 1:s.spendLimit.push(i.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{spendLimit:Array.isArray(e?.spendLimit)?e.spendLimit.map(e=>i.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.spendLimit?t.spendLimit=e.spendLimit.map(e=>e?i.Coin.toJSON(e):void 0):t.spendLimit=[],t},fromPartial(e){let t=a();return t.spendLimit=e.spendLimit?.map(e=>i.Coin.fromPartial(e))||[],t}},r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure())})),vc=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),r=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.defaultProtoCodec=e.ProtoCodec=void 0;var i=Gs(),a=Js(),o=ic(),s=oc(),c=cc(),l=lc(),u=dc(),d=mc(),f=hc(),p=ac(),m=gc(),h=_c(),g=(_(),n(v));r(hc(),e);var y=class{constructor(){this.typeUrlMap=new Map}unpackAnyFactory(e){if(this.typeUrlMap.has(e))return this.typeUrlMap.get(e)}unpackAny(e){let t=this.unpackAnyFactory(e.typeUrl);if(!t)return new f.UnknownMessage(e.typeUrl,e.value);let n=t.decode(e.value);return Object.assign(Object.assign({},e),{unpacked:n})}unpackedAnyToJSONRecursive(e){if(e instanceof f.UnknownMessage)return e.toJSON();let t=this.unpackAnyFactory(e.typeUrl);if(t&&`unpacked`in e&&e.unpacked){let n=e=>{let t=typeof e==`object`&&!(e instanceof f.UnknownMessage)&&`typeUrl`in e&&e.typeUrl&&typeof e.typeUrl==`string`&&`value`in e&&e.value&&typeof e.value==`string`;if(t)try{g.Buffer.from(e.value,`base64`)}catch{return!1}return t},r=e=>{let t=this.unpackAnyFactory(e.typeUrl),n=g.Buffer.from(e.value,`base64`);if(!t)return new f.UnknownMessage(e.typeUrl,n).toJSON();let r=t.decode(n);return{typeUrl:e.typeUrl,value:t.toJSON(r)}},i=e=>{if(Array.isArray(e))for(let t=0;t<e.length;t++){let a=e[t];n(a)?e[t]=r(a):typeof a==`object`&&(e[t]=i(a))}else for(let t in e){let a=e[t];n(a)?e[t]=r(a):typeof a==`object`&&(e[t]=i(a))}return e},a=t.toJSON(e.unpacked);if(a&&typeof a==`object`)return a=i(a),{typeUrl:e.typeUrl,value:a}}return new f.UnknownMessage(e.typeUrl,e.value).toJSON()}registerAny(e,t){this.typeUrlMap.set(e,t)}};e.ProtoCodec=y,e.defaultProtoCodec=new y,e.defaultProtoCodec.registerAny(`/agoric.swingset.MsgWalletSpendAction`,i.MsgWalletSpendAction),e.defaultProtoCodec.registerAny(`/agoric.swingset.MsgProvision`,i.MsgProvision),e.defaultProtoCodec.registerAny(`/cosmos.bank.v1beta1.MsgSend`,a.MsgSend),e.defaultProtoCodec.registerAny(`/cosmos.bank.v1beta1.MsgMultiSend`,a.MsgMultiSend),e.defaultProtoCodec.registerAny(`/cosmos.staking.v1beta1.MsgDelegate`,o.MsgDelegate),e.defaultProtoCodec.registerAny(`/cosmos.staking.v1beta1.MsgUndelegate`,o.MsgUndelegate),e.defaultProtoCodec.registerAny(`/cosmos.staking.v1beta1.MsgBeginRedelegate`,o.MsgBeginRedelegate),e.defaultProtoCodec.registerAny(`/cosmwasm.wasm.v1.MsgExecuteContract`,u.MsgExecuteContract),e.defaultProtoCodec.registerAny(`/cosmwasm.wasm.v1.MsgInstantiateContract`,u.MsgInstantiateContract),e.defaultProtoCodec.registerAny(`/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward`,l.MsgWithdrawDelegatorReward),e.defaultProtoCodec.registerAny(`/cosmos.distribution.v1beta1.MsgSetWithdrawAddress`,l.MsgSetWithdrawAddress),e.defaultProtoCodec.registerAny(`/ibc.applications.transfer.v1.MsgTransfer`,d.MsgTransfer),e.defaultProtoCodec.registerAny(`/cosmos.gov.v1beta1.MsgVote`,c.MsgVote),e.defaultProtoCodec.registerAny(`/cosmos.authz.v1beta1.MsgGrant`,s.MsgGrant),e.defaultProtoCodec.registerAny(`/cosmos.authz.v1beta1.GenericAuthorization`,p.GenericAuthorization),e.defaultProtoCodec.registerAny(`/cosmos.staking.v1beta1.StakeAuthorization`,m.StakeAuthorization),e.defaultProtoCodec.registerAny(`/cosmos.bank.v1beta1.SendAuthorization`,h.SendAuthorization),e.defaultProtoCodec.registerAny(`/cosmos.authz.v1beta1.MsgRevoke`,s.MsgRevoke),e.defaultProtoCodec.registerAny(`/cosmos.authz.v1beta1.MsgExec`,s.MsgExec)})),yc=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.CompactBitArray=e.MultiSignature=e.protobufPackage=void 0;var n=t(G()),r=t(q());e.protobufPackage=`cosmos.crypto.multisig.v1beta1`;function i(){return{signatures:[]}}e.MultiSignature={encode(e,t=r.default.Writer.create()){for(let n of e.signatures)t.uint32(10).bytes(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.signatures.push(n.bytes());break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{signatures:Array.isArray(e?.signatures)?e.signatures.map(e=>c(e)):[]}},toJSON(e){let t={};return e.signatures?t.signatures=e.signatures.map(e=>u(e===void 0?new Uint8Array:e)):t.signatures=[],t},fromPartial(e){let t=i();return t.signatures=e.signatures?.map(e=>e)||[],t}};function a(){return{extraBitsStored:0,elems:new Uint8Array}}e.CompactBitArray={encode(e,t=r.default.Writer.create()){return e.extraBitsStored!==0&&t.uint32(8).uint32(e.extraBitsStored),e.elems.length!==0&&t.uint32(18).bytes(e.elems),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=a();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.extraBitsStored=n.uint32();break;case 2:o.elems=n.bytes();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{extraBitsStored:d(e.extraBitsStored)?Number(e.extraBitsStored):0,elems:d(e.elems)?c(e.elems):new Uint8Array}},toJSON(e){let t={};return e.extraBitsStored!==void 0&&(t.extraBitsStored=Math.round(e.extraBitsStored)),e.elems!==void 0&&(t.elems=u(e.elems===void 0?new Uint8Array:e.elems)),t},fromPartial(e){let t=a();return t.extraBitsStored=e.extraBitsStored??0,t.elems=e.elems??new Uint8Array,t}};var o=(()=>{if(o!==void 0)return o;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),s=o.atob||(e=>o.Buffer.from(e,`base64`).toString(`binary`));function c(e){let t=s(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var l=o.btoa||(e=>o.Buffer.from(e,`binary`).toString(`base64`));function u(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return l(t.join(``))}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function d(e){return e!=null}})),bc=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.SignatureDescriptor_Data_Multi=e.SignatureDescriptor_Data_Single=e.SignatureDescriptor_Data=e.SignatureDescriptor=e.SignatureDescriptors=e.signModeToJSON=e.signModeFromJSON=e.SignMode=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=tc(),a=yc();e.protobufPackage=`cosmos.tx.signing.v1beta1`;var o;(function(e){e[e.SIGN_MODE_UNSPECIFIED=0]=`SIGN_MODE_UNSPECIFIED`,e[e.SIGN_MODE_DIRECT=1]=`SIGN_MODE_DIRECT`,e[e.SIGN_MODE_TEXTUAL=2]=`SIGN_MODE_TEXTUAL`,e[e.SIGN_MODE_LEGACY_AMINO_JSON=127]=`SIGN_MODE_LEGACY_AMINO_JSON`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(o=e.SignMode||={});function s(e){switch(e){case 0:case`SIGN_MODE_UNSPECIFIED`:return o.SIGN_MODE_UNSPECIFIED;case 1:case`SIGN_MODE_DIRECT`:return o.SIGN_MODE_DIRECT;case 2:case`SIGN_MODE_TEXTUAL`:return o.SIGN_MODE_TEXTUAL;case 127:case`SIGN_MODE_LEGACY_AMINO_JSON`:return o.SIGN_MODE_LEGACY_AMINO_JSON;default:return o.UNRECOGNIZED}}e.signModeFromJSON=s;function c(e){switch(e){case o.SIGN_MODE_UNSPECIFIED:return`SIGN_MODE_UNSPECIFIED`;case o.SIGN_MODE_DIRECT:return`SIGN_MODE_DIRECT`;case o.SIGN_MODE_TEXTUAL:return`SIGN_MODE_TEXTUAL`;case o.SIGN_MODE_LEGACY_AMINO_JSON:return`SIGN_MODE_LEGACY_AMINO_JSON`;default:return`UNKNOWN`}}e.signModeToJSON=c;function l(){return{signatures:[]}}e.SignatureDescriptors={encode(t,n=r.default.Writer.create()){for(let r of t.signatures)e.SignatureDescriptor.encode(r,n.uint32(10).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=l();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.signatures.push(e.SignatureDescriptor.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{signatures:Array.isArray(t?.signatures)?t.signatures.map(t=>e.SignatureDescriptor.fromJSON(t)):[]}},toJSON(t){let n={};return t.signatures?n.signatures=t.signatures.map(t=>t?e.SignatureDescriptor.toJSON(t):void 0):n.signatures=[],n},fromPartial(t){let n=l();return n.signatures=t.signatures?.map(t=>e.SignatureDescriptor.fromPartial(t))||[],n}};function u(){return{publicKey:void 0,data:void 0,sequence:`0`}}e.SignatureDescriptor={encode(t,n=r.default.Writer.create()){return t.publicKey!==void 0&&i.Any.encode(t.publicKey,n.uint32(10).fork()).ldelim(),t.data!==void 0&&e.SignatureDescriptor_Data.encode(t.data,n.uint32(18).fork()).ldelim(),t.sequence!==`0`&&n.uint32(24).uint64(t.sequence),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,s=u();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.publicKey=i.Any.decode(a,a.uint32());break;case 2:s.data=e.SignatureDescriptor_Data.decode(a,a.uint32());break;case 3:s.sequence=x(a.uint64());break;default:a.skipType(t&7);break}}return s},fromJSON(t){return{publicKey:S(t.publicKey)?i.Any.fromJSON(t.publicKey):void 0,data:S(t.data)?e.SignatureDescriptor_Data.fromJSON(t.data):void 0,sequence:S(t.sequence)?String(t.sequence):`0`}},toJSON(t){let n={};return t.publicKey!==void 0&&(n.publicKey=t.publicKey?i.Any.toJSON(t.publicKey):void 0),t.data!==void 0&&(n.data=t.data?e.SignatureDescriptor_Data.toJSON(t.data):void 0),t.sequence!==void 0&&(n.sequence=t.sequence),n},fromPartial(t){let n=u();return n.publicKey=t.publicKey!==void 0&&t.publicKey!==null?i.Any.fromPartial(t.publicKey):void 0,n.data=t.data!==void 0&&t.data!==null?e.SignatureDescriptor_Data.fromPartial(t.data):void 0,n.sequence=t.sequence??`0`,n}};function d(){return{single:void 0,multi:void 0}}e.SignatureDescriptor_Data={encode(t,n=r.default.Writer.create()){return t.single!==void 0&&e.SignatureDescriptor_Data_Single.encode(t.single,n.uint32(10).fork()).ldelim(),t.multi!==void 0&&e.SignatureDescriptor_Data_Multi.encode(t.multi,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=d();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.single=e.SignatureDescriptor_Data_Single.decode(i,i.uint32());break;case 2:o.multi=e.SignatureDescriptor_Data_Multi.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{single:S(t.single)?e.SignatureDescriptor_Data_Single.fromJSON(t.single):void 0,multi:S(t.multi)?e.SignatureDescriptor_Data_Multi.fromJSON(t.multi):void 0}},toJSON(t){let n={};return t.single!==void 0&&(n.single=t.single?e.SignatureDescriptor_Data_Single.toJSON(t.single):void 0),t.multi!==void 0&&(n.multi=t.multi?e.SignatureDescriptor_Data_Multi.toJSON(t.multi):void 0),n},fromPartial(t){let n=d();return n.single=t.single!==void 0&&t.single!==null?e.SignatureDescriptor_Data_Single.fromPartial(t.single):void 0,n.multi=t.multi!==void 0&&t.multi!==null?e.SignatureDescriptor_Data_Multi.fromPartial(t.multi):void 0,n}};function f(){return{mode:0,signature:new Uint8Array}}e.SignatureDescriptor_Data_Single={encode(e,t=r.default.Writer.create()){return e.mode!==0&&t.uint32(8).int32(e.mode),e.signature.length!==0&&t.uint32(18).bytes(e.signature),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.mode=n.int32();break;case 2:a.signature=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{mode:S(e.mode)?s(e.mode):0,signature:S(e.signature)?v(e.signature):new Uint8Array}},toJSON(e){let t={};return e.mode!==void 0&&(t.mode=c(e.mode)),e.signature!==void 0&&(t.signature=b(e.signature===void 0?new Uint8Array:e.signature)),t},fromPartial(e){let t=f();return t.mode=e.mode??0,t.signature=e.signature??new Uint8Array,t}};function p(){return{bitarray:void 0,signatures:[]}}e.SignatureDescriptor_Data_Multi={encode(t,n=r.default.Writer.create()){t.bitarray!==void 0&&a.CompactBitArray.encode(t.bitarray,n.uint32(10).fork()).ldelim();for(let r of t.signatures)e.SignatureDescriptor_Data.encode(r,n.uint32(18).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?i.len:i.pos+n,s=p();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.bitarray=a.CompactBitArray.decode(i,i.uint32());break;case 2:s.signatures.push(e.SignatureDescriptor_Data.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{bitarray:S(t.bitarray)?a.CompactBitArray.fromJSON(t.bitarray):void 0,signatures:Array.isArray(t?.signatures)?t.signatures.map(t=>e.SignatureDescriptor_Data.fromJSON(t)):[]}},toJSON(t){let n={};return t.bitarray!==void 0&&(n.bitarray=t.bitarray?a.CompactBitArray.toJSON(t.bitarray):void 0),t.signatures?n.signatures=t.signatures.map(t=>t?e.SignatureDescriptor_Data.toJSON(t):void 0):n.signatures=[],n},fromPartial(t){let n=p();return n.bitarray=t.bitarray!==void 0&&t.bitarray!==null?a.CompactBitArray.fromPartial(t.bitarray):void 0,n.signatures=t.signatures?.map(t=>e.SignatureDescriptor_Data.fromPartial(t))||[],n}};var g=(()=>{if(g!==void 0)return g;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),_=g.atob||(e=>g.Buffer.from(e,`base64`).toString(`binary`));function v(e){let t=_(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var y=g.btoa||(e=>g.Buffer.from(e,`binary`).toString(`base64`));function b(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return y(t.join(``))}function x(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function S(e){return e!=null}})),xc=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Fee=e.ModeInfo_Multi=e.ModeInfo_Single=e.ModeInfo=e.SignerInfo=e.AuthInfo=e.TxBody=e.SignDoc=e.TxRaw=e.Tx=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=bc(),a=tc(),o=yc(),s=Ks();e.protobufPackage=`cosmos.tx.v1beta1`;function c(){return{body:void 0,authInfo:void 0,signatures:[]}}e.Tx={encode(t,n=r.default.Writer.create()){t.body!==void 0&&e.TxBody.encode(t.body,n.uint32(10).fork()).ldelim(),t.authInfo!==void 0&&e.AuthInfo.encode(t.authInfo,n.uint32(18).fork()).ldelim();for(let e of t.signatures)n.uint32(26).bytes(e);return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=c();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.body=e.TxBody.decode(i,i.uint32());break;case 2:o.authInfo=e.AuthInfo.decode(i,i.uint32());break;case 3:o.signatures.push(i.bytes());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{body:E(t.body)?e.TxBody.fromJSON(t.body):void 0,authInfo:E(t.authInfo)?e.AuthInfo.fromJSON(t.authInfo):void 0,signatures:Array.isArray(t?.signatures)?t.signatures.map(e=>S(e)):[]}},toJSON(t){let n={};return t.body!==void 0&&(n.body=t.body?e.TxBody.toJSON(t.body):void 0),t.authInfo!==void 0&&(n.authInfo=t.authInfo?e.AuthInfo.toJSON(t.authInfo):void 0),t.signatures?n.signatures=t.signatures.map(e=>w(e===void 0?new Uint8Array:e)):n.signatures=[],n},fromPartial(t){let n=c();return n.body=t.body!==void 0&&t.body!==null?e.TxBody.fromPartial(t.body):void 0,n.authInfo=t.authInfo!==void 0&&t.authInfo!==null?e.AuthInfo.fromPartial(t.authInfo):void 0,n.signatures=t.signatures?.map(e=>e)||[],n}};function l(){return{bodyBytes:new Uint8Array,authInfoBytes:new Uint8Array,signatures:[]}}e.TxRaw={encode(e,t=r.default.Writer.create()){e.bodyBytes.length!==0&&t.uint32(10).bytes(e.bodyBytes),e.authInfoBytes.length!==0&&t.uint32(18).bytes(e.authInfoBytes);for(let n of e.signatures)t.uint32(26).bytes(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.bodyBytes=n.bytes();break;case 2:a.authInfoBytes=n.bytes();break;case 3:a.signatures.push(n.bytes());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{bodyBytes:E(e.bodyBytes)?S(e.bodyBytes):new Uint8Array,authInfoBytes:E(e.authInfoBytes)?S(e.authInfoBytes):new Uint8Array,signatures:Array.isArray(e?.signatures)?e.signatures.map(e=>S(e)):[]}},toJSON(e){let t={};return e.bodyBytes!==void 0&&(t.bodyBytes=w(e.bodyBytes===void 0?new Uint8Array:e.bodyBytes)),e.authInfoBytes!==void 0&&(t.authInfoBytes=w(e.authInfoBytes===void 0?new Uint8Array:e.authInfoBytes)),e.signatures?t.signatures=e.signatures.map(e=>w(e===void 0?new Uint8Array:e)):t.signatures=[],t},fromPartial(e){let t=l();return t.bodyBytes=e.bodyBytes??new Uint8Array,t.authInfoBytes=e.authInfoBytes??new Uint8Array,t.signatures=e.signatures?.map(e=>e)||[],t}};function u(){return{bodyBytes:new Uint8Array,authInfoBytes:new Uint8Array,chainId:``,accountNumber:`0`}}e.SignDoc={encode(e,t=r.default.Writer.create()){return e.bodyBytes.length!==0&&t.uint32(10).bytes(e.bodyBytes),e.authInfoBytes.length!==0&&t.uint32(18).bytes(e.authInfoBytes),e.chainId!==``&&t.uint32(26).string(e.chainId),e.accountNumber!==`0`&&t.uint32(32).uint64(e.accountNumber),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.bodyBytes=n.bytes();break;case 2:a.authInfoBytes=n.bytes();break;case 3:a.chainId=n.string();break;case 4:a.accountNumber=T(n.uint64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{bodyBytes:E(e.bodyBytes)?S(e.bodyBytes):new Uint8Array,authInfoBytes:E(e.authInfoBytes)?S(e.authInfoBytes):new Uint8Array,chainId:E(e.chainId)?String(e.chainId):``,accountNumber:E(e.accountNumber)?String(e.accountNumber):`0`}},toJSON(e){let t={};return e.bodyBytes!==void 0&&(t.bodyBytes=w(e.bodyBytes===void 0?new Uint8Array:e.bodyBytes)),e.authInfoBytes!==void 0&&(t.authInfoBytes=w(e.authInfoBytes===void 0?new Uint8Array:e.authInfoBytes)),e.chainId!==void 0&&(t.chainId=e.chainId),e.accountNumber!==void 0&&(t.accountNumber=e.accountNumber),t},fromPartial(e){let t=u();return t.bodyBytes=e.bodyBytes??new Uint8Array,t.authInfoBytes=e.authInfoBytes??new Uint8Array,t.chainId=e.chainId??``,t.accountNumber=e.accountNumber??`0`,t}};function d(){return{messages:[],memo:``,timeoutHeight:`0`,extensionOptions:[],nonCriticalExtensionOptions:[]}}e.TxBody={encode(e,t=r.default.Writer.create()){for(let n of e.messages)a.Any.encode(n,t.uint32(10).fork()).ldelim();e.memo!==``&&t.uint32(18).string(e.memo),e.timeoutHeight!==`0`&&t.uint32(24).uint64(e.timeoutHeight);for(let n of e.extensionOptions)a.Any.encode(n,t.uint32(8186).fork()).ldelim();for(let n of e.nonCriticalExtensionOptions)a.Any.encode(n,t.uint32(16378).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.messages.push(a.Any.decode(n,n.uint32()));break;case 2:o.memo=n.string();break;case 3:o.timeoutHeight=T(n.uint64());break;case 1023:o.extensionOptions.push(a.Any.decode(n,n.uint32()));break;case 2047:o.nonCriticalExtensionOptions.push(a.Any.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{messages:Array.isArray(e?.messages)?e.messages.map(e=>a.Any.fromJSON(e)):[],memo:E(e.memo)?String(e.memo):``,timeoutHeight:E(e.timeoutHeight)?String(e.timeoutHeight):`0`,extensionOptions:Array.isArray(e?.extensionOptions)?e.extensionOptions.map(e=>a.Any.fromJSON(e)):[],nonCriticalExtensionOptions:Array.isArray(e?.nonCriticalExtensionOptions)?e.nonCriticalExtensionOptions.map(e=>a.Any.fromJSON(e)):[]}},toJSON(e){let t={};return e.messages?t.messages=e.messages.map(e=>e?a.Any.toJSON(e):void 0):t.messages=[],e.memo!==void 0&&(t.memo=e.memo),e.timeoutHeight!==void 0&&(t.timeoutHeight=e.timeoutHeight),e.extensionOptions?t.extensionOptions=e.extensionOptions.map(e=>e?a.Any.toJSON(e):void 0):t.extensionOptions=[],e.nonCriticalExtensionOptions?t.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions.map(e=>e?a.Any.toJSON(e):void 0):t.nonCriticalExtensionOptions=[],t},fromPartial(e){let t=d();return t.messages=e.messages?.map(e=>a.Any.fromPartial(e))||[],t.memo=e.memo??``,t.timeoutHeight=e.timeoutHeight??`0`,t.extensionOptions=e.extensionOptions?.map(e=>a.Any.fromPartial(e))||[],t.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions?.map(e=>a.Any.fromPartial(e))||[],t}};function f(){return{signerInfos:[],fee:void 0}}e.AuthInfo={encode(t,n=r.default.Writer.create()){for(let r of t.signerInfos)e.SignerInfo.encode(r,n.uint32(10).fork()).ldelim();return t.fee!==void 0&&e.Fee.encode(t.fee,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=f();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.signerInfos.push(e.SignerInfo.decode(i,i.uint32()));break;case 2:o.fee=e.Fee.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{signerInfos:Array.isArray(t?.signerInfos)?t.signerInfos.map(t=>e.SignerInfo.fromJSON(t)):[],fee:E(t.fee)?e.Fee.fromJSON(t.fee):void 0}},toJSON(t){let n={};return t.signerInfos?n.signerInfos=t.signerInfos.map(t=>t?e.SignerInfo.toJSON(t):void 0):n.signerInfos=[],t.fee!==void 0&&(n.fee=t.fee?e.Fee.toJSON(t.fee):void 0),n},fromPartial(t){let n=f();return n.signerInfos=t.signerInfos?.map(t=>e.SignerInfo.fromPartial(t))||[],n.fee=t.fee!==void 0&&t.fee!==null?e.Fee.fromPartial(t.fee):void 0,n}};function p(){return{publicKey:void 0,modeInfo:void 0,sequence:`0`}}e.SignerInfo={encode(t,n=r.default.Writer.create()){return t.publicKey!==void 0&&a.Any.encode(t.publicKey,n.uint32(10).fork()).ldelim(),t.modeInfo!==void 0&&e.ModeInfo.encode(t.modeInfo,n.uint32(18).fork()).ldelim(),t.sequence!==`0`&&n.uint32(24).uint64(t.sequence),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?i.len:i.pos+n,s=p();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.publicKey=a.Any.decode(i,i.uint32());break;case 2:s.modeInfo=e.ModeInfo.decode(i,i.uint32());break;case 3:s.sequence=T(i.uint64());break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{publicKey:E(t.publicKey)?a.Any.fromJSON(t.publicKey):void 0,modeInfo:E(t.modeInfo)?e.ModeInfo.fromJSON(t.modeInfo):void 0,sequence:E(t.sequence)?String(t.sequence):`0`}},toJSON(t){let n={};return t.publicKey!==void 0&&(n.publicKey=t.publicKey?a.Any.toJSON(t.publicKey):void 0),t.modeInfo!==void 0&&(n.modeInfo=t.modeInfo?e.ModeInfo.toJSON(t.modeInfo):void 0),t.sequence!==void 0&&(n.sequence=t.sequence),n},fromPartial(t){let n=p();return n.publicKey=t.publicKey!==void 0&&t.publicKey!==null?a.Any.fromPartial(t.publicKey):void 0,n.modeInfo=t.modeInfo!==void 0&&t.modeInfo!==null?e.ModeInfo.fromPartial(t.modeInfo):void 0,n.sequence=t.sequence??`0`,n}};function g(){return{single:void 0,multi:void 0}}e.ModeInfo={encode(t,n=r.default.Writer.create()){return t.single!==void 0&&e.ModeInfo_Single.encode(t.single,n.uint32(10).fork()).ldelim(),t.multi!==void 0&&e.ModeInfo_Multi.encode(t.multi,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=g();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.single=e.ModeInfo_Single.decode(i,i.uint32());break;case 2:o.multi=e.ModeInfo_Multi.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{single:E(t.single)?e.ModeInfo_Single.fromJSON(t.single):void 0,multi:E(t.multi)?e.ModeInfo_Multi.fromJSON(t.multi):void 0}},toJSON(t){let n={};return t.single!==void 0&&(n.single=t.single?e.ModeInfo_Single.toJSON(t.single):void 0),t.multi!==void 0&&(n.multi=t.multi?e.ModeInfo_Multi.toJSON(t.multi):void 0),n},fromPartial(t){let n=g();return n.single=t.single!==void 0&&t.single!==null?e.ModeInfo_Single.fromPartial(t.single):void 0,n.multi=t.multi!==void 0&&t.multi!==null?e.ModeInfo_Multi.fromPartial(t.multi):void 0,n}};function _(){return{mode:0}}e.ModeInfo_Single={encode(e,t=r.default.Writer.create()){return e.mode!==0&&t.uint32(8).int32(e.mode),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=_();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.mode=n.int32();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{mode:E(e.mode)?(0,i.signModeFromJSON)(e.mode):0}},toJSON(e){let t={};return e.mode!==void 0&&(t.mode=(0,i.signModeToJSON)(e.mode)),t},fromPartial(e){let t=_();return t.mode=e.mode??0,t}};function v(){return{bitarray:void 0,modeInfos:[]}}e.ModeInfo_Multi={encode(t,n=r.default.Writer.create()){t.bitarray!==void 0&&o.CompactBitArray.encode(t.bitarray,n.uint32(10).fork()).ldelim();for(let r of t.modeInfos)e.ModeInfo.encode(r,n.uint32(18).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,s=v();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:s.bitarray=o.CompactBitArray.decode(i,i.uint32());break;case 2:s.modeInfos.push(e.ModeInfo.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{bitarray:E(t.bitarray)?o.CompactBitArray.fromJSON(t.bitarray):void 0,modeInfos:Array.isArray(t?.modeInfos)?t.modeInfos.map(t=>e.ModeInfo.fromJSON(t)):[]}},toJSON(t){let n={};return t.bitarray!==void 0&&(n.bitarray=t.bitarray?o.CompactBitArray.toJSON(t.bitarray):void 0),t.modeInfos?n.modeInfos=t.modeInfos.map(t=>t?e.ModeInfo.toJSON(t):void 0):n.modeInfos=[],n},fromPartial(t){let n=v();return n.bitarray=t.bitarray!==void 0&&t.bitarray!==null?o.CompactBitArray.fromPartial(t.bitarray):void 0,n.modeInfos=t.modeInfos?.map(t=>e.ModeInfo.fromPartial(t))||[],n}};function y(){return{amount:[],gasLimit:`0`,payer:``,granter:``}}e.Fee={encode(e,t=r.default.Writer.create()){for(let n of e.amount)s.Coin.encode(n,t.uint32(10).fork()).ldelim();return e.gasLimit!==`0`&&t.uint32(16).uint64(e.gasLimit),e.payer!==``&&t.uint32(26).string(e.payer),e.granter!==``&&t.uint32(34).string(e.granter),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=y();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.amount.push(s.Coin.decode(n,n.uint32()));break;case 2:a.gasLimit=T(n.uint64());break;case 3:a.payer=n.string();break;case 4:a.granter=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{amount:Array.isArray(e?.amount)?e.amount.map(e=>s.Coin.fromJSON(e)):[],gasLimit:E(e.gasLimit)?String(e.gasLimit):`0`,payer:E(e.payer)?String(e.payer):``,granter:E(e.granter)?String(e.granter):``}},toJSON(e){let t={};return e.amount?t.amount=e.amount.map(e=>e?s.Coin.toJSON(e):void 0):t.amount=[],e.gasLimit!==void 0&&(t.gasLimit=e.gasLimit),e.payer!==void 0&&(t.payer=e.payer),e.granter!==void 0&&(t.granter=e.granter),t},fromPartial(e){let t=y();return t.amount=e.amount?.map(e=>s.Coin.fromPartial(e))||[],t.gasLimit=e.gasLimit??`0`,t.payer=e.payer??``,t.granter=e.granter??``,t}};var b=(()=>{if(b!==void 0)return b;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),x=b.atob||(e=>b.Buffer.from(e,`base64`).toString(`binary`));function S(e){let t=x(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var C=b.btoa||(e=>b.Buffer.from(e,`binary`).toString(`base64`));function w(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return C(t.join(``))}function T(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function E(e){return e!=null}})),Sc=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ProtoSignDocDecoder=void 0;var t=xc(),n=vc();e.ProtoSignDocDecoder=class e{static decode(n){return new e(t.SignDoc.decode(n))}constructor(e,t=n.defaultProtoCodec){this.signDoc=e,this.protoCodec=t}get txBody(){return this._txBody||=t.TxBody.decode(this.signDoc.bodyBytes),this._txBody}get txMsgs(){let e=[];for(let t of this.txBody.messages)e.push(this.protoCodec.unpackAny(t));return e}get authInfo(){return this._authInfo||=t.AuthInfo.decode(this.signDoc.authInfoBytes),this._authInfo}get chainId(){return this.signDoc.chainId}get accountNumber(){return this.signDoc.accountNumber.toString()}toBytes(){return t.SignDoc.encode(this.signDoc).finish()}toJSON(){return{txBody:Object.assign(Object.assign({},t.TxBody.toJSON(this.txBody)),{messages:this.txMsgs.map(e=>this.protoCodec.unpackedAnyToJSONRecursive(e))}),authInfo:t.AuthInfo.toJSON(this.authInfo),chainId:this.chainId,accountNumber:this.accountNumber}}}})),Cc=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),wc=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.BaseKVStore=void 0,e.BaseKVStore=class{constructor(e,t){this.provider=e,this._prefix=t}get(e){return t(this,void 0,void 0,function*(){let t=this.prefix()+`/`+e;return(yield this.provider.get())[t]})}set(e,t){let n=this.prefix()+`/`+e;return this.provider.set({[n]:t})}prefix(){return this._prefix}}})),Tc=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.ExtensionKVStore=void 0;var n=wc();e.ExtensionKVStore=class e extends n.BaseKVStore{constructor(t){if(e.KVStoreProvider||typeof browser>`u`||!browser.storage||!browser.storage.local||(e.KVStoreProvider={get:browser.storage.local.get,set:browser.storage.local.set,multiGet:browser.storage.local.get}),!e.KVStoreProvider)throw Error(`Can't initialize kv store for browser extension`);super(e.KVStoreProvider,t)}multiGet(n){return t(this,void 0,void 0,function*(){n=Array.from(new Set(n));let t=(yield e.KVStoreProvider.multiGet(n.map(e=>this.prefix()+`/`+e)))??{},r=Object.keys(t);for(let e of r){let n=e.slice(this.prefix().length+1);t[n]=t[e],delete t[e]}return t})}}})),Ec=a((e=>{s(),Object.defineProperty(e,`__esModule`,{value:!0}),e.MemoryKVStore=void 0;var t=wc(),n=class{constructor(){this.store={}}get(){return Promise.resolve(this.store)}set(e){return this.store=Object.assign(Object.assign({},this.store),e),Promise.resolve()}checkNotPrimitiveField(e){Object.keys(e).forEach(t=>{let n=e[t];if(typeof n==`object`&&n){if(n.constructor!==Object&&n.constructor!==Array)throw Error(`${t} may not be serializable: ${n.constructor.name}`);this.checkNotPrimitiveField(n)}})}};e.MemoryKVStore=class extends t.BaseKVStore{constructor(e){super(new n,e)}}})),Dc=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.LocalKVStore=void 0,e.LocalKVStore=class{constructor(e){this._prefix=e}get(e){let t=this.prefix()+`/`+e,n=localStorage.getItem(t);return n===null?Promise.resolve(void 0):Promise.resolve(JSON.parse(n))}set(e,t){let n=this.prefix()+`/`+e;return t===null?Promise.resolve(localStorage.removeItem(n)):Promise.resolve(localStorage.setItem(n,JSON.stringify(t)))}prefix(){return this._prefix}}})),Oc=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.IndexedDBKVStore=void 0,e.IndexedDBKVStore=class{constructor(e){this._prefix=e}get(e){return t(this,void 0,void 0,function*(){let t=(yield this.getDB()).transaction([this.prefix()],`readonly`).objectStore(this.prefix());return new Promise((n,r)=>{let i=t.get(e);i.onerror=e=>{e.stopPropagation(),r(e.target)},i.onsuccess=()=>{i.result?n(i.result.data):n(void 0)}})})}set(e,n){return t(this,void 0,void 0,function*(){if(n===null){let t=(yield this.getDB()).transaction([this.prefix()],`readwrite`).objectStore(this.prefix());return new Promise((n,r)=>{let i=t.delete(e);i.onerror=e=>{e.stopPropagation(),r(e.target)},i.onsuccess=()=>{n()}})}else{let t=(yield this.getDB()).transaction([this.prefix()],`readwrite`).objectStore(this.prefix());return new Promise((r,i)=>{let a=t.put({key:e,data:n});a.onerror=e=>{e.stopPropagation(),i(e.target)},a.onsuccess=()=>{r()}})}})}prefix(){return this._prefix}getDB(){return t(this,void 0,void 0,function*(){return this.cachedDB?this.cachedDB:new Promise((e,t)=>{let n=window.indexedDB.open(this.prefix());n.onerror=e=>{e.stopPropagation(),t(e.target)},n.onupgradeneeded=e=>{e.target.result.createObjectStore(this.prefix(),{keyPath:`key`})},n.onsuccess=()=>{this.cachedDB=n.result,e(n.result)}})})}}})),kc=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.PrefixKVStore=void 0,e.PrefixKVStore=class{constructor(e,t){this.kvStore=e,this._prefix=t}prefix(){return this._prefix}get(e){return t(this,void 0,void 0,function*(){let t=this.prefix()+`/`+e;return yield this.kvStore.get(t)})}set(e,n){return t(this,void 0,void 0,function*(){let t=this.prefix()+`/`+e;return yield this.kvStore.set(t,n)})}}})),Ac=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.WrapMultiGetKVStore=void 0,e.WrapMultiGetKVStore=class{constructor(e){this.kvStore=e}multiGet(e){return t(this,void 0,void 0,function*(){e=Array.from(new Set(e));let n={},r=[];for(let i of e)r.push(t(this,void 0,void 0,function*(){n[i]=yield this.kvStore.get(i)}));return yield Promise.all(r),n})}}})),jc=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(Cc(),e),n(Tc(),e),n(wc(),e),n(Ec(),e),n(Dc(),e),n(Oc(),e),n(kc(),e),n(Ac(),e)})),Mc=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=E(),n=k();function r(e){let n=t(`sha256`).update(e).digest();try{return t(`rmd160`).update(n).digest()}catch{return t(`ripemd160`).update(n).digest()}}e.hash160=r;function i(e,t){return n(`sha512`,e).update(t).digest()}e.hmacSHA512=i})),Nc=a(((e,t)=>{_();var n=k(),r=y.alloc(1,1),i=y.alloc(1,0);function a(e,t,a,o,s){let c=y.alloc(32,0),l=y.alloc(32,1);c=n(`sha256`,c).update(l).update(i).update(t).update(e).update(s||``).digest(),l=n(`sha256`,c).update(l).digest(),c=n(`sha256`,c).update(l).update(r).update(t).update(e).update(s||``).digest(),l=n(`sha256`,c).update(l).digest(),l=n(`sha256`,c).update(l).digest();let u=l;for(;!o(u)||!a(u);)c=n(`sha256`,c).update(l).update(i).digest(),l=n(`sha256`,c).update(l).digest(),l=n(`sha256`,c).update(l).digest(),u=l;return u}t.exports=a})),Pc=a(((e,t)=>{_();var n=O(),r=j().ec,i=new r(`secp256k1`),a=Nc(),o=y.alloc(32,0),s=y.from(`fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141`,`hex`),c=y.from(`fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f`,`hex`),l=i.curve.n,u=l.shrn(1),d=i.curve.g,f=`Expected Private`,p=`Expected Point`,m=`Expected Tweak`,h=`Expected Hash`,g=`Expected Signature`,v=`Expected Extra Data (32 bytes)`;function b(e){return e instanceof Uint8Array&&e.length===32}function x(e){return b(e)?s.compare(e)>0:!1}function S(e){if(!(e instanceof Uint8Array)||e.length<33)return!1;let t=e[0],n=e.subarray(1,33);if(o.compare(n)===0||c.compare(n)<=0)return!1;if((t===2||t===3)&&e.length===33){try{M(e)}catch{return!1}return!0}let r=e.subarray(33);return o.compare(r)===0||c.compare(r)<=0?!1:t===4&&e.length===65}function C(e){return e[0]!==4}function w(e){return S(e)?C(e):!1}function T(e){return b(e)?o.compare(e)<0&&s.compare(e)>0:!1}function E(e){let t=e.subarray(0,32),n=e.subarray(32,64);return e instanceof Uint8Array&&e.length===64&&s.compare(t)>0&&s.compare(n)>0}function D(e,t){return e===void 0&&t!==void 0?C(t):e===void 0?!0:e}function k(e){return new n(e)}function A(e){return e.toArrayLike(y,`be`,32)}function M(e){return i.curve.decodePoint(e)}function N(e,t){return y.from(e._encode(t))}function P(e,t,n){if(!S(e)||!S(t))throw TypeError(p);let r=M(e),i=M(t),a=r.add(i);return a.isInfinity()?null:N(a,D(n,e))}function F(e,t,n){if(!S(e))throw TypeError(p);if(!x(t))throw TypeError(m);let r=D(n,e),i=M(e);if(o.compare(t)===0)return N(i,r);let a=k(t),s=d.mul(a),c=i.add(s);return c.isInfinity()?null:N(c,r)}function I(e,t){if(!S(e))throw TypeError(p);let n=M(e);if(n.isInfinity())throw TypeError(p);return N(n,D(t,e))}function L(e,t){if(!T(e))throw TypeError(f);let n=k(e),r=d.mul(n);return r.isInfinity()?null:N(r,D(t))}function R(e,t,n){if(!S(e))throw TypeError(p);if(!x(t))throw TypeError(m);let r=D(n,e),i=M(e),a=k(t),o=i.mul(a);return o.isInfinity()?null:N(o,r)}function ee(e,t){if(!T(e))throw TypeError(f);if(!x(t))throw TypeError(m);let n=k(e),r=k(t),i=A(n.add(r).umod(l));return T(i)?i:null}function te(e,t){if(!T(e))throw TypeError(f);if(!x(t))throw TypeError(m);let n=k(e),r=k(t),i=A(n.sub(r).umod(l));return T(i)?i:null}function ne(e,t){return ie(e,t)}function re(e,t,n){return ie(e,t,n)}function ie(e,t,n){if(!b(e))throw TypeError(h);if(!T(t))throw TypeError(f);if(n!==void 0&&!b(n))throw TypeError(v);let r=k(t),i=k(e),o,s;a(e,t,function(e){let t=k(e),n=d.mul(t);return!(n.isInfinity()||(o=n.x.umod(l),o.isZero()===0)||(s=t.invm(l).mul(i.add(r.mul(o))).umod(l),s.isZero()===0))},T,n),s.cmp(u)>0&&(s=l.sub(s));let c=y.allocUnsafe(64);return A(o).copy(c,0),A(s).copy(c,32),c}function ae(e,t,n,r){if(!b(e))throw TypeError(h);if(!S(t))throw TypeError(p);if(!E(n))throw TypeError(g);let i=M(t),a=k(n.subarray(0,32)),o=k(n.subarray(32,64));if(r&&o.cmp(u)>0||a.gtn(0)<=0||o.gtn(0)<=0)return!1;let s=k(e),c=o.invm(l),f=s.mul(c).umod(l),m=a.mul(c).umod(l),_=d.mulAdd(f,i,m);return _.isInfinity()?!1:_.x.umod(l).eq(a)}t.exports={isPoint:S,isPointCompressed:w,isPrivate:T,pointAdd:P,pointAddScalar:F,pointCompress:I,pointFromScalar:L,pointMultiply:R,privateAdd:ee,privateSub:te,sign:ne,signWithEntropy:re,verify:ae}})),Fc=a(((e,t)=>{var n={Array:function(e){return e!=null&&e.constructor===Array},Boolean:function(e){return typeof e==`boolean`},Function:function(e){return typeof e==`function`},Nil:function(e){return e==null},Number:function(e){return typeof e==`number`},Object:function(e){return typeof e==`object`},String:function(e){return typeof e==`string`},"":function(){return!0}};for(var r in n.Null=n.Nil,n)n[r].toJSON=function(e){return e}.bind(null,r);t.exports=n})),Ic=a(((e,t)=>{var n=Fc();function r(e){return e.name||e.toString().match(/function (.*?)\s*\(/)[1]}function i(e){return n.Nil(e)?``:r(e.constructor)}function a(e){return n.Function(e)?``:n.String(e)?JSON.stringify(e):e&&n.Object(e)?``:e}function o(e,t){Error.captureStackTrace&&Error.captureStackTrace(e,t)}function s(e){return n.Function(e)?e.toJSON?e.toJSON():r(e):n.Array(e)?`Array`:e&&n.Object(e)?`Object`:e===void 0?``:e}function c(e,t,n){var r=a(t);return`Expected `+s(e)+`, got`+(n===``?``:` `+n)+(r===``?``:` `+r)}function l(e,t,n){n||=i(t),this.message=c(e,t,n),o(this,l),this.__type=e,this.__value=t,this.__valueTypeName=n}l.prototype=Object.create(Error.prototype),l.prototype.constructor=l;function u(e,t,n,r,i){var a=`" of type `;return t===`key`&&(a=`" with key type `),c(`property "`+s(n)+a+s(e),r,i)}function d(e,t,n,r,a){e?(a||=i(r),this.message=u(e,n,t,r,a)):this.message=`Unexpected property "`+t+`"`,o(this,l),this.__label=n,this.__property=t,this.__type=e,this.__value=r,this.__valueTypeName=a}d.prototype=Object.create(Error.prototype),d.prototype.constructor=l;function f(e,t){return new l(e,{},t)}function p(e,t,n){return e instanceof d?(t=t+`.`+e.__property,e=new d(e.__type,t,e.__label,e.__value,e.__valueTypeName)):e instanceof l&&(e=new d(e.__type,t,n,e.__value,e.__valueTypeName)),o(e),e}t.exports={TfTypeError:l,TfPropertyTypeError:d,tfCustomError:f,tfSubError:p,tfJSON:s,getValueTypeName:i}})),Lc=a(((e,t)=>{_();var n=Fc(),r=Ic();function i(e){return y.isBuffer(e)}function a(e){return typeof e==`string`&&/^([0-9a-f]{2})+$/i.test(e)}function o(e,t){var n=e.toJSON();function i(i){if(!e(i))return!1;if(i.length===t)return!0;throw r.tfCustomError(n+`(Length: `+t+`)`,n+`(Length: `+i.length+`)`)}return i.toJSON=function(){return n},i}var s=o.bind(null,n.Array),c=o.bind(null,i),l=o.bind(null,a),u=o.bind(null,n.String);function d(e,t,r){r||=n.Number;function i(n,i){return r(n,i)&&n>e&&n<t}return i.toJSON=function(){return`${r.toJSON()} between [${e}, ${t}]`},i}var f=2**53-1;function p(e){return typeof e==`number`&&isFinite(e)}function m(e){return e<<24>>24===e}function h(e){return e<<16>>16===e}function g(e){return(e|0)===e}function v(e){return typeof e==`number`&&e>=-f&&e<=f&&Math.floor(e)===e}function b(e){return(e&255)===e}function x(e){return(e&65535)===e}function S(e){return e>>>0===e}function C(e){return typeof e==`number`&&e>=0&&e<=f&&Math.floor(e)===e}var w={ArrayN:s,Buffer:i,BufferN:c,Finite:p,Hex:a,HexN:l,Int8:m,Int16:h,Int32:g,Int53:v,Range:d,StringN:u,UInt8:b,UInt16:x,UInt32:S,UInt53:C};for(var T in w)w[T].toJSON=function(e){return e}.bind(null,T);t.exports=w})),Rc=a(((e,t)=>{var n=Ic(),r=Fc(),i=n.tfJSON,a=n.TfTypeError,o=n.TfPropertyTypeError,s=n.tfSubError,c=n.getValueTypeName,l={arrayOf:function(e,t){e=u(e),t||={};function n(n,i){return!r.Array(n)||r.Nil(n)||t.minLength!==void 0&&n.length<t.minLength||t.maxLength!==void 0&&n.length>t.maxLength||t.length!==void 0&&n.length!==t.length?!1:n.every(function(t,n){try{return d(e,t,i)}catch(e){throw s(e,n)}})}return n.toJSON=function(){var n=`[`+i(e)+`]`;return t.length===void 0?(t.minLength!==void 0||t.maxLength!==void 0)&&(n+=`{`+(t.minLength===void 0?0:t.minLength)+`,`+(t.maxLength===void 0?1/0:t.maxLength)+`}`):n+=`{`+t.length+`}`,n},n},maybe:function e(t){t=u(t);function n(n,i){return r.Nil(n)||t(n,i,e)}return n.toJSON=function(){return`?`+i(t)},n},map:function(e,t){e=u(e),t&&=u(t);function n(n,i){if(!r.Object(n)||r.Nil(n))return!1;for(var a in n){try{t&&d(t,a,i)}catch(e){throw s(e,a,`key`)}try{var o=n[a];d(e,o,i)}catch(e){throw s(e,a)}}return!0}return t?n.toJSON=function(){return`{`+i(t)+`: `+i(e)+`}`}:n.toJSON=function(){return`{`+i(e)+`}`},n},object:function(e){var t={};for(var n in e)t[n]=u(e[n]);function a(e,n){if(!r.Object(e)||r.Nil(e))return!1;var i;try{for(i in t){var a=t[i],c=e[i];d(a,c,n)}}catch(e){throw s(e,i)}if(n){for(i in e)if(!t[i])throw new o(void 0,i)}return!0}return a.toJSON=function(){return i(t)},a},anyOf:function(){var e=[].slice.call(arguments).map(u);function t(t,n){return e.some(function(e){try{return d(e,t,n)}catch{return!1}})}return t.toJSON=function(){return e.map(i).join(`|`)},t},allOf:function(){var e=[].slice.call(arguments).map(u);function t(t,n){return e.every(function(e){try{return d(e,t,n)}catch{return!1}})}return t.toJSON=function(){return e.map(i).join(` & `)},t},quacksLike:function(e){function t(t){return e===c(t)}return t.toJSON=function(){return e},t},tuple:function(){var e=[].slice.call(arguments).map(u);function t(t,n){return r.Nil(t)||r.Nil(t.length)||n&&t.length!==e.length?!1:e.every(function(e,r){try{return d(e,t[r],n)}catch(e){throw s(e,r)}})}return t.toJSON=function(){return`(`+e.map(i).join(`, `)+`)`},t},value:function(e){function t(t){return t===e}return t.toJSON=function(){return e},t}};l.oneOf=l.anyOf;function u(e){if(r.String(e))return e[0]===`?`?l.maybe(e.slice(1)):r[e]||l.quacksLike(e);if(e&&r.Object(e)){if(r.Array(e)){if(e.length!==1)throw TypeError(`Expected compile() parameter of type Array of length 1`);return l.arrayOf(e[0])}return l.object(e)}else if(r.Function(e))return e;return l.value(e)}function d(e,t,n,i){if(r.Function(e)){if(e(t,n))return!0;throw new a(i||e,t)}return d(u(e),t,n)}for(var f in r)d[f]=r[f];for(f in l)d[f]=l[f];var p=Lc();for(f in p)d[f]=p[f];d.compile=u,d.TfTypeError=a,d.TfPropertyTypeError=o,t.exports=d})),zc=a(((e,t)=>{_();var n=Qn();function r(e,t){if(t!==void 0&&e[0]!==t)throw Error(`Invalid network version`);if(e.length===33)return{version:e[0],privateKey:e.slice(1,33),compressed:!1};if(e.length!==34)throw Error(`Invalid WIF length`);if(e[33]!==1)throw Error(`Invalid compression flag`);return{version:e[0],privateKey:e.slice(1,33),compressed:!0}}function i(e,t,n){var r=new y(n?34:33);return r.writeUInt8(e,0),t.copy(r,1),n&&(r[33]=1),r}function a(e,t){return r(n.decode(e),t)}function o(e,t,r){return typeof e==`number`?n.encode(i(e,t,r)):n.encode(i(e.version,e.privateKey,e.compressed))}t.exports={decode:a,decodeRaw:r,encode:o,encodeRaw:i}})),Bc=a((e=>{_(),Object.defineProperty(e,`__esModule`,{value:!0});var t=Mc(),n=Qn(),r=Pc(),i=Rc(),a=zc(),o=i.BufferN(32),s=i.compile({wif:i.UInt8,bip32:{public:i.UInt32,private:i.UInt32}}),c={messagePrefix:`Bitcoin Signed Message:
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/utils-14NfwrBn.js","assets/chunk-CzyJ72yW.js","assets/dist-rLdy04_b.js","assets/dist-BNDiu-ID.js","assets/dist-CbYzjs0N.js","assets/build-DFEPAT8y.js","assets/build-DXB-Xkl3.js","assets/sha2-CtXu6r0A.js","assets/legacy-Mhle6HPJ.js","assets/pbkdf2-DnaBsumg.js","assets/has-property-descriptors-eLb-xvm3.js","assets/build-BPw0SHWb.js","assets/name-service-D-oY_Ca5.js","assets/dist-BRCQU1Li.js","assets/index-BIOEiLJw.js","assets/preload-helper-DzyYoeor.js","assets/secp256k1-COENLGio.js","assets/utils-Ds5_DcfQ.js","assets/hmac-Ct2FWp2C.js","assets/utils-DBNb3TAV.js","assets/_shortw_utils-CZEAaHmN.js","assets/src-BVVCPwNZ.js","assets/utils-tO6_qHLh.js","assets/index.es-Bk6Eex5v.js","assets/esm-Bwjh0hft.js","assets/sha256-BdXxttE2.js","assets/sha3-CDZ-aOth.js","assets/exports-CHrRDjNC.js","assets/lit-element-CPGuB_v8.js","assets/browser-ponyfill-BtdYAc_i.js","assets/events-Dz20IHRz.js","assets/index.es-Db9uv8UH.js","assets/index.es-GvscGfHE.js","assets/elliptic-29QpX1Dw.js","assets/bn-2we3y6fO.js","assets/big-Do47_XZn.js","assets/lit-CDbVcvTE.js","assets/utils-ihIHVwY-.js","assets/formatUnits-DjLK35gc.js","assets/createConnector-BcHSC56W.js","assets/isAddressEqual-D_XbkOak.js","assets/getAbiItem-BJPwnmQn.js","assets/base-CqFrPqX1.js","assets/toBytes-DiTqRJTE.js","assets/stringify-DoeZ9PaV.js","assets/assertRequest-S6qmRF-X.js","assets/node-BqRbpq2S.js","assets/encodeFunctionData-dy9a9oBR.js","assets/createBatchScheduler-CgjpLR7V.js","assets/bs58-BBhlX9sY.js","assets/Codec-D4K5RIsS.js","assets/http-BVmqTAvl.js","assets/withTimeout-CjYhtdDq.js","assets/fallback-BZWOX_W7.js","assets/networks-CWeJ1anG.js","assets/index-E_6jknHw.css","assets/p256-08O5ugWR.js","assets/blake2-CGlfsXoS.js","assets/esm-SeYA9l8u.js","assets/blakejs-Dk2rjG-7.js","assets/src-Djtn6dts.js"])))=>i.map(i=>d[i]);
2
+ import{a as e,n as t,o as n,r,s as i,t as a}from"./chunk-CzyJ72yW.js";import{n as o,t as s}from"./dist-CbYzjs0N.js";import{D as c,H as l,b as u,n as d,q as f,t as p}from"./createConnector-BcHSC56W.js";import{n as m,t as h}from"./dist-BNDiu-ID.js";import{t as g}from"./preload-helper-DzyYoeor.js";import{i as _,r as v,t as y}from"./dist-rLdy04_b.js";import{t as b}from"./networks-CWeJ1anG.js";import{i as x,n as S,t as C}from"./bs58-BBhlX9sY.js";import{t as w}from"./bn-2we3y6fO.js";import{a as T,i as E,n as D,o as O,r as k,s as A,t as j}from"./elliptic-29QpX1Dw.js";import{t as M}from"./events-Dz20IHRz.js";import{c as N,i as P,l as F,o as I,s as L,u as R}from"./index.es-Bk6Eex5v.js";import{_ as ee,a as te,d as ne,f as re,g as ie,h as ae,i as z,l as oe,n as se,o as ce,p as le,r as ue,s as de,t as fe,u as pe,v as me}from"./browser-ponyfill-BtdYAc_i.js";import{n as he,t as ge}from"./esm-Bwjh0hft.js";import{$ as _e,$t as ve,A as B,At as ye,B as be,Bt as xe,C as Se,Ct as Ce,D as we,Dt as Te,E as Ee,Et as De,F as V,Ft as Oe,G as ke,Gt as Ae,H as je,Ht as Me,I as Ne,It as Pe,J as Fe,Jt as Ie,K as Le,Kt as Re,L as ze,Lt as Be,M as Ve,Mt as He,N as Ue,Nt as We,O as Ge,Ot as Ke,P as qe,Pt as Je,Q as Ye,Qt as Xe,R as Ze,Rt as Qe,S as $e,St as et,T as tt,Tt as nt,U as rt,Ut as it,V as at,Vt as ot,W as st,Wt as ct,X as H,Xt as lt,Y as ut,Yt as dt,Z as ft,Zt as pt,_ as mt,_t as ht,a as gt,at as _t,b as vt,bt as yt,c as bt,ct as xt,d as St,en as Ct,et as wt,f as Tt,ft as Et,g as Dt,gt as Ot,h as kt,ht as At,i as jt,it as Mt,j as Nt,jt as Pt,k as Ft,kt as It,l as Lt,lt as Rt,m as zt,mt as Bt,n as Vt,nt as Ht,o as Ut,ot as Wt,p as Gt,pt as Kt,q as qt,qt as Jt,r as Yt,rt as Xt,s as Zt,st as Qt,t as $t,tn as en,tt as tn,u as nn,ut as rn,v as an,vt as on,w as sn,wt as cn,x as ln,xt as un,y as dn,yt as fn,z as pn,zt as mn}from"./dist-BRCQU1Li.js";import{S as hn,it as gn,nt as _n,rt as vn,tt as yn}from"./index-BIOEiLJw.js";import{a as bn,o as xn,t as Sn}from"./build-DXB-Xkl3.js";import{a as Cn,c as wn,d as Tn,f as En,i as Dn,l as On,n as kn,o as U,r as An,s as jn,u as Mn}from"./utils-14NfwrBn.js";import{n as Nn,t as Pn}from"./src-C5tae8dD.js";import{n as Fn}from"./bignumber-CoBv9ViP.js";import{t as In}from"./v4-BcCgZyuS.js";import{n as Ln,t as Rn}from"./src-Djtn6dts.js";import{cosmosAssets as zn,registryIdsToSKCosmosNetworks as Bn}from"./chain-registry-CMG34mbw.js";import{t as Vn}from"./cjs-C4xHpwSP.js";var Hn=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.utf8Write=e.utf8Read=e.utf8Length=void 0;function t(e){let t=0,n=0;for(let r=0;r<e.length;++r)n=e.charCodeAt(r),n<128?t+=1:n<2048?t+=2:(n&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320?(++r,t+=4):t+=3;return t}e.utf8Length=t;function n(e,t,n){if(n-t<1)return``;let r=[],i=[],a=0,o;for(;t<n;)o=e[t++],o<128?r[a++]=o:o>191&&o<224?r[a++]=(o&31)<<6|e[t++]&63:o>239&&o<365?(o=((o&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,r[a++]=55296+(o>>10),r[a++]=56320+(o&1023)):r[a++]=(o&15)<<12|(e[t++]&63)<<6|e[t++]&63,a>8191&&((i||=[]).push(String.fromCharCode(...r)),a=0);return i?(a&&i.push(String.fromCharCode(...r.slice(0,a))),i.join(``)):String.fromCharCode(...r.slice(0,a))}e.utf8Read=n;function r(e,t,n){let r=n,i,a;for(let r=0;r<e.length;++r)i=e.charCodeAt(r),i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)==55296&&((a=e.charCodeAt(r+1))&64512)==56320?(i=65536+((i&1023)<<10)+(a&1023),++r,t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128);return n-r}e.utf8Write=r})),Un=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.writeByte=e.writeFixed32=e.int64Length=e.writeVarint64=e.writeVarint32=e.readInt32=e.readUInt32=e.zzDecode=e.zzEncode=e.varint32read=e.varint32write=e.uInt64ToString=e.int64ToString=e.int64FromString=e.varint64write=e.varint64read=void 0;function t(){let e=0,t=0;for(let n=0;n<28;n+=7){let r=this.buf[this.pos++];if(e|=(r&127)<<n,!(r&128))return this.assertBounds(),[e,t]}let n=this.buf[this.pos++];if(e|=(n&15)<<28,t=(n&112)>>4,!(n&128))return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let r=this.buf[this.pos++];if(t|=(r&127)<<n,!(r&128))return this.assertBounds(),[e,t]}throw Error(`invalid varint`)}e.varint64read=t;function n(e,t,n){for(let r=0;r<28;r+=7){let i=e>>>r,a=!(!(i>>>7)&&t==0),o=(a?i|128:i)&255;if(n.push(o),!a)return}let r=e>>>28&15|(t&7)<<4,i=!!(t>>3);if(n.push((i?r|128:r)&255),i){for(let e=3;e<31;e+=7){let r=t>>>e,i=!!(r>>>7),a=(i?r|128:r)&255;if(n.push(a),!i)return}n.push(t>>>31&1)}}e.varint64write=n;var r=4294967296;function i(e){let t=e[0]===`-`;t&&(e=e.slice(1));let n=1e6,i=0,a=0;function o(t,o){let s=Number(e.slice(t,o));a*=n,i=i*n+s,i>=r&&(a+=i/r|0,i%=r)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),t?l(i,a):c(i,a)}e.int64FromString=i;function a(e,t){let n=c(e,t),r=n.hi&2147483648;r&&(n=l(n.lo,n.hi));let i=o(n.lo,n.hi);return r?`-`+i:i}e.int64ToString=a;function o(e,t){if({lo:e,hi:t}=s(e,t),t<=2097151)return String(r*t+e);let n=e&16777215,i=(e>>>24|t<<8)&16777215,a=t>>16&65535,o=n+i*6777216+a*6710656,c=i+a*8147497,l=a*2,d=1e7;return o>=d&&(c+=Math.floor(o/d),o%=d),c>=d&&(l+=Math.floor(c/d),c%=d),l.toString()+u(c)+u(o)}e.uInt64ToString=o;function s(e,t){return{lo:e>>>0,hi:t>>>0}}function c(e,t){return{lo:e|0,hi:t|0}}function l(e,t){return t=~t,e?e=~e+1:t+=1,c(e,t)}var u=e=>{let t=String(e);return`0000000`.slice(t.length)+t};function d(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e>>>=7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e>>=7;t.push(1)}}e.varint32write=d;function f(){let e=this.buf[this.pos++],t=e&127;if(!(e&128)||(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128)))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let t=5;e&128&&t<10;t++)e=this.buf[this.pos++];if(e&128)throw Error(`invalid varint`);return this.assertBounds(),t>>>0}e.varint32read=f;function p(e,t){let n=t>>31;return t=((t<<1|e>>>31)^n)>>>0,e=(e<<1^n)>>>0,[e,t]}e.zzEncode=p;function m(e,t){let n=-(e&1);return e=((e>>>1|t<<31)^n)>>>0,t=(t>>>1^n)>>>0,[e,t]}e.zzDecode=m;function h(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+e[t+3]*16777216}e.readUInt32=h;function g(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}e.readInt32=g;function _(e,t,n){for(;e>127;)t[n++]=e&127|128,e>>>=7;t[n]=e}e.writeVarint32=_;function v(e,t,n){for(;e.hi;)t[n++]=e.lo&127|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=e.lo&127|128,e.lo>>>=7;t[n++]=e.lo}e.writeVarint64=v;function y(e,t){let n=e,r=(e>>>28|t<<4)>>>0,i=t>>>24;return i===0?r===0?n<16384?n<128?1:2:n<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:i<128?9:10}e.int64Length=y;function b(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}e.writeFixed32=b;function x(e,t,n){t[n]=e&255}e.writeByte=x})),Wn=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BinaryWriter=e.BinaryReader=e.WireType=void 0;var t=Hn(),n=Un(),r;(function(e){e[e.Varint=0]=`Varint`,e[e.Fixed64=1]=`Fixed64`,e[e.Bytes=2]=`Bytes`,e[e.Fixed32=5]=`Fixed32`})(r||(e.WireType=r={})),e.BinaryReader=class{assertBounds(){if(this.pos>this.len)throw RangeError(`premature EOF`)}constructor(e){this.buf=e?new Uint8Array(e):new Uint8Array,this.pos=0,this.type=0,this.len=this.buf.length}tag(){let e=this.uint32(),t=e>>>3,n=e&7;if(t<=0||n<0||n>5)throw Error(`illegal tag: field no `+t+` wire type `+n);return[t,n,e]}skip(e){if(typeof e==`number`){if(this.pos+e>this.len)throw c(this,e);this.pos+=e}else do if(this.pos>=this.len)throw c(this);while(this.buf[this.pos++]&128);return this}skipType(e){switch(e){case r.Varint:this.skip();break;case r.Fixed64:this.skip(8);break;case r.Bytes:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!=4;)this.skipType(e);break;case r.Fixed32:this.skip(4);break;default:throw Error(`invalid wire type `+e+` at offset `+this.pos)}return this}uint32(){return n.varint32read.bind(this)()}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e%2==1?(e+1)/-2:e/2}fixed32(){let e=(0,n.readUInt32)(this.buf,this.pos);return this.pos+=4,e}sfixed32(){let e=(0,n.readInt32)(this.buf,this.pos);return this.pos+=4,e}int64(){let[e,t]=n.varint64read.bind(this)();return BigInt((0,n.int64ToString)(e,t))}uint64(){let[e,t]=n.varint64read.bind(this)();return BigInt((0,n.uInt64ToString)(e,t))}sint64(){let[e,t]=n.varint64read.bind(this)();return[e,t]=(0,n.zzDecode)(e,t),BigInt((0,n.int64ToString)(e,t))}fixed64(){let e=this.sfixed32(),t=this.sfixed32();return BigInt((0,n.uInt64ToString)(e,t))}sfixed64(){let e=this.sfixed32(),t=this.sfixed32();return BigInt((0,n.int64ToString)(e,t))}float(){throw Error(`float not supported`)}double(){throw Error(`double not supported`)}bool(){let[e,t]=n.varint64read.bind(this)();return e!==0||t!==0}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){let e=this.bytes();return(0,t.utf8Read)(e,0,e.length)}};var i=class{constructor(e,t,n){this.fn=e,this.len=t,this.val=n}proceed(e,t){this.fn&&this.fn(this.val,e,t)}},a=class{constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}};e.BinaryWriter=class e{constructor(){this.len=0,this.uint64=e.prototype.int64,this.sfixed64=e.prototype.fixed64,this.sfixed32=e.prototype.fixed32,this.head=new i(null,0,0),this.tail=this.head,this.states=null}static create(){return new e}static alloc(e){return typeof Uint8Array<`u`?s(e=>new Uint8Array(e),Uint8Array.prototype.subarray)(e):Array(e)}_push(e,t,n){return this.tail=this.tail.next=new i(e,t,n),this.len+=t,this}finish(){let t=this.head.next,n=0,r=e.alloc(this.len);for(;t;)t.proceed(r,n),n+=t.len,t=t.next;return r}fork(){return this.states=new a(this),this.head=this.tail=new i(null,0,0),this.len=0,this}reset(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new i(null,0,0),this.len=0),this}ldelim(){let e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this}tag(e,t){return this.uint32((e<<3|t)>>>0)}uint32(e){return this.len+=(this.tail=this.tail.next=new i(n.writeVarint32,(e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(n.writeVarint64,10,(0,n.int64FromString)(e.toString())):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}int64(e){let{lo:t,hi:r}=(0,n.int64FromString)(e.toString());return this._push(n.writeVarint64,(0,n.int64Length)(t,r),{lo:t,hi:r})}sint64(e){let{lo:t,hi:r}=(0,n.int64FromString)(e.toString());return[t,r]=(0,n.zzEncode)(t,r),this._push(n.writeVarint64,(0,n.int64Length)(t,r),{lo:t,hi:r})}fixed64(e){let{lo:t,hi:r}=(0,n.int64FromString)(e.toString());return this._push(n.writeFixed32,4,t)._push(n.writeFixed32,4,r)}bool(e){return this._push(n.writeByte,1,+!!e)}fixed32(e){return this._push(n.writeFixed32,4,e>>>0)}float(e){throw Error(`float not supported`+e)}double(e){throw Error(`double not supported`+e)}bytes(e){let t=e.length>>>0;return t?this.uint32(t)._push(o,t,e):this._push(n.writeByte,1,0)}string(e){let r=(0,t.utf8Length)(e);return r?this.uint32(r)._push(t.utf8Write,r,e):this._push(n.writeByte,1,0)}};function o(e,t,n){if(typeof Uint8Array<`u`)t.set(e,n);else for(let r=0;r<e.length;++r)t[n+r]=e[r]}function s(e,t,n){let r=n||8192,i=r>>>1,a=null,o=r;return function(n){if(n<1||n>i)return e(n);o+n>r&&(a=e(r),o=0);let s=t.call(a,o,o+=n);return o&7&&(o=(o|7)+1),s}}function c(e,t){return RangeError(`index out of range: `+e.pos+` + `+(t||1)+` > `+e.len)}})),Gn=a((e=>{_(),m(),Object.defineProperty(e,`__esModule`,{value:!0}),e.fromJsonTimestamp=e.fromTimestamp=e.toTimestamp=e.isRpc=e.setPaginationParams=e.isObject=e.isSet=e.fromDuration=e.toDuration=e.omitDefault=e.base64FromBytes=e.bytesFromBase64=void 0;var t=(()=>{if(t!==void 0)return t;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),n=t.atob||(e=>t.Buffer.from(e,`base64`).toString(`binary`));function r(e){let t=n(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;++e)r[e]=t.charCodeAt(e);return r}e.bytesFromBase64=r;var i=t.btoa||(e=>t.Buffer.from(e,`binary`).toString(`base64`));function a(e){let t=[];return e.forEach(e=>{t.push(String.fromCharCode(e))}),i(t.join(``))}e.base64FromBytes=a;function o(e){if(typeof e==`string`)return e===``?void 0:e;if(typeof e==`number`)return e===0?void 0:e;if(typeof e==`boolean`)return e===!1?void 0:e;if(typeof e==`bigint`)return e===BigInt(0)?void 0:e;throw Error(`Got unsupported type ${typeof e}`)}e.omitDefault=o;function s(e){return{seconds:BigInt(Math.floor(parseInt(e)/1e9)),nanos:parseInt(e)%1e9}}e.toDuration=s;function c(e){return(parseInt(e.seconds.toString())*1e9+e.nanos).toString()}e.fromDuration=c;function l(e){return e!=null}e.isSet=l;function u(e){return typeof e==`object`&&!!e}e.isObject=u,e.setPaginationParams=(e,t)=>t?(t?.countTotal!==void 0&&(e.params[`pagination.count_total`]=t.countTotal),t?.key!==void 0&&(e.params[`pagination.key`]=y.from(t.key).toString(`base64`)),t?.limit!==void 0&&(e.params[`pagination.limit`]=t.limit.toString()),t?.offset!==void 0&&(e.params[`pagination.offset`]=t.offset.toString()),t?.reverse!==void 0&&(e.params[`pagination.reverse`]=t.reverse),e):e;function d(e){return e!=null&&typeof e.request==`function`}e.isRpc=d;function f(e){return{seconds:b(e.getTime()/1e3),nanos:e.getTime()%1e3*1e6}}e.toTimestamp=f;function p(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}e.fromTimestamp=p;var g=e=>({seconds:l(e.seconds)?BigInt(e.seconds.toString()):BigInt(0),nanos:l(e.nanos)?Number(e.nanos):0});function v(e){return e instanceof Date?f(e):typeof e==`string`?f(new Date(e)):g(e)}e.fromJsonTimestamp=v;function b(e){return BigInt(Math.trunc(e))}})),Kn=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Any=e.protobufPackage=void 0;var t=Wn(),n=Gn();e.protobufPackage=`google.protobuf`;function r(){return{typeUrl:``,value:new Uint8Array}}e.Any={typeUrl:`/google.protobuf.Any`,encode(e,n=t.BinaryWriter.create()){return e.typeUrl!==``&&n.uint32(10).string(e.typeUrl),e.value.length!==0&&n.uint32(18).bytes(e.value),n},decode(e,n){let i=e instanceof t.BinaryReader?e:new t.BinaryReader(e),a=n===void 0?i.len:i.pos+n,o=r();for(;i.pos<a;){let e=i.uint32();switch(e>>>3){case 1:o.typeUrl=i.string();break;case 2:o.value=i.bytes();break;default:i.skipType(e&7);break}}return o},fromJSON(e){let t=r();return(0,n.isSet)(e.typeUrl)&&(t.typeUrl=String(e.typeUrl)),(0,n.isSet)(e.value)&&(t.value=(0,n.bytesFromBase64)(e.value)),t},toJSON(e){let t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=(0,n.base64FromBytes)(e.value===void 0?new Uint8Array:e.value)),t},fromPartial(e){let t=r();return t.typeUrl=e.typeUrl??``,t.value=e.value??new Uint8Array,t}}})),qn=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CompactBitArray=e.MultiSignature=e.protobufPackage=void 0;var t=Wn(),n=Gn();e.protobufPackage=`cosmos.crypto.multisig.v1beta1`;function r(){return{signatures:[]}}e.MultiSignature={typeUrl:`/cosmos.crypto.multisig.v1beta1.MultiSignature`,encode(e,n=t.BinaryWriter.create()){for(let t of e.signatures)n.uint32(10).bytes(t);return n},decode(e,n){let i=e instanceof t.BinaryReader?e:new t.BinaryReader(e),a=n===void 0?i.len:i.pos+n,o=r();for(;i.pos<a;){let e=i.uint32();switch(e>>>3){case 1:o.signatures.push(i.bytes());break;default:i.skipType(e&7);break}}return o},fromJSON(e){let t=r();return Array.isArray(e?.signatures)&&(t.signatures=e.signatures.map(e=>(0,n.bytesFromBase64)(e))),t},toJSON(e){let t={};return e.signatures?t.signatures=e.signatures.map(e=>(0,n.base64FromBytes)(e===void 0?new Uint8Array:e)):t.signatures=[],t},fromPartial(e){let t=r();return t.signatures=e.signatures?.map(e=>e)||[],t}};function i(){return{extraBitsStored:0,elems:new Uint8Array}}e.CompactBitArray={typeUrl:`/cosmos.crypto.multisig.v1beta1.CompactBitArray`,encode(e,n=t.BinaryWriter.create()){return e.extraBitsStored!==0&&n.uint32(8).uint32(e.extraBitsStored),e.elems.length!==0&&n.uint32(18).bytes(e.elems),n},decode(e,n){let r=e instanceof t.BinaryReader?e:new t.BinaryReader(e),a=n===void 0?r.len:r.pos+n,o=i();for(;r.pos<a;){let e=r.uint32();switch(e>>>3){case 1:o.extraBitsStored=r.uint32();break;case 2:o.elems=r.bytes();break;default:r.skipType(e&7);break}}return o},fromJSON(e){let t=i();return(0,n.isSet)(e.extraBitsStored)&&(t.extraBitsStored=Number(e.extraBitsStored)),(0,n.isSet)(e.elems)&&(t.elems=(0,n.bytesFromBase64)(e.elems)),t},toJSON(e){let t={};return e.extraBitsStored!==void 0&&(t.extraBitsStored=Math.round(e.extraBitsStored)),e.elems!==void 0&&(t.elems=(0,n.base64FromBytes)(e.elems===void 0?new Uint8Array:e.elems)),t},fromPartial(e){let t=i();return t.extraBitsStored=e.extraBitsStored??0,t.elems=e.elems??new Uint8Array,t}}})),Jn=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SignatureDescriptor_Data_Multi=e.SignatureDescriptor_Data_Single=e.SignatureDescriptor_Data=e.SignatureDescriptor=e.SignatureDescriptors=e.signModeToJSON=e.signModeFromJSON=e.SignMode=e.protobufPackage=void 0;var t=qn(),n=Kn(),r=Wn(),i=Gn();e.protobufPackage=`cosmos.tx.signing.v1beta1`;var a;(function(e){e[e.SIGN_MODE_UNSPECIFIED=0]=`SIGN_MODE_UNSPECIFIED`,e[e.SIGN_MODE_DIRECT=1]=`SIGN_MODE_DIRECT`,e[e.SIGN_MODE_TEXTUAL=2]=`SIGN_MODE_TEXTUAL`,e[e.SIGN_MODE_DIRECT_AUX=3]=`SIGN_MODE_DIRECT_AUX`,e[e.SIGN_MODE_LEGACY_AMINO_JSON=127]=`SIGN_MODE_LEGACY_AMINO_JSON`,e[e.SIGN_MODE_EIP_191=191]=`SIGN_MODE_EIP_191`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(a||(e.SignMode=a={}));function o(e){switch(e){case 0:case`SIGN_MODE_UNSPECIFIED`:return a.SIGN_MODE_UNSPECIFIED;case 1:case`SIGN_MODE_DIRECT`:return a.SIGN_MODE_DIRECT;case 2:case`SIGN_MODE_TEXTUAL`:return a.SIGN_MODE_TEXTUAL;case 3:case`SIGN_MODE_DIRECT_AUX`:return a.SIGN_MODE_DIRECT_AUX;case 127:case`SIGN_MODE_LEGACY_AMINO_JSON`:return a.SIGN_MODE_LEGACY_AMINO_JSON;case 191:case`SIGN_MODE_EIP_191`:return a.SIGN_MODE_EIP_191;default:return a.UNRECOGNIZED}}e.signModeFromJSON=o;function s(e){switch(e){case a.SIGN_MODE_UNSPECIFIED:return`SIGN_MODE_UNSPECIFIED`;case a.SIGN_MODE_DIRECT:return`SIGN_MODE_DIRECT`;case a.SIGN_MODE_TEXTUAL:return`SIGN_MODE_TEXTUAL`;case a.SIGN_MODE_DIRECT_AUX:return`SIGN_MODE_DIRECT_AUX`;case a.SIGN_MODE_LEGACY_AMINO_JSON:return`SIGN_MODE_LEGACY_AMINO_JSON`;case a.SIGN_MODE_EIP_191:return`SIGN_MODE_EIP_191`;case a.UNRECOGNIZED:default:return`UNRECOGNIZED`}}e.signModeToJSON=s;function c(){return{signatures:[]}}e.SignatureDescriptors={typeUrl:`/cosmos.tx.signing.v1beta1.SignatureDescriptors`,encode(t,n=r.BinaryWriter.create()){for(let r of t.signatures)e.SignatureDescriptor.encode(r,n.uint32(10).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.BinaryReader?t:new r.BinaryReader(t),a=n===void 0?i.len:i.pos+n,o=c();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.signatures.push(e.SignatureDescriptor.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){let n=c();return Array.isArray(t?.signatures)&&(n.signatures=t.signatures.map(t=>e.SignatureDescriptor.fromJSON(t))),n},toJSON(t){let n={};return t.signatures?n.signatures=t.signatures.map(t=>t?e.SignatureDescriptor.toJSON(t):void 0):n.signatures=[],n},fromPartial(t){let n=c();return n.signatures=t.signatures?.map(t=>e.SignatureDescriptor.fromPartial(t))||[],n}};function l(){return{publicKey:void 0,data:void 0,sequence:BigInt(0)}}e.SignatureDescriptor={typeUrl:`/cosmos.tx.signing.v1beta1.SignatureDescriptor`,encode(t,i=r.BinaryWriter.create()){return t.publicKey!==void 0&&n.Any.encode(t.publicKey,i.uint32(10).fork()).ldelim(),t.data!==void 0&&e.SignatureDescriptor_Data.encode(t.data,i.uint32(18).fork()).ldelim(),t.sequence!==BigInt(0)&&i.uint32(24).uint64(t.sequence),i},decode(t,i){let a=t instanceof r.BinaryReader?t:new r.BinaryReader(t),o=i===void 0?a.len:a.pos+i,s=l();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.publicKey=n.Any.decode(a,a.uint32());break;case 2:s.data=e.SignatureDescriptor_Data.decode(a,a.uint32());break;case 3:s.sequence=a.uint64();break;default:a.skipType(t&7);break}}return s},fromJSON(t){let r=l();return(0,i.isSet)(t.publicKey)&&(r.publicKey=n.Any.fromJSON(t.publicKey)),(0,i.isSet)(t.data)&&(r.data=e.SignatureDescriptor_Data.fromJSON(t.data)),(0,i.isSet)(t.sequence)&&(r.sequence=BigInt(t.sequence.toString())),r},toJSON(t){let r={};return t.publicKey!==void 0&&(r.publicKey=t.publicKey?n.Any.toJSON(t.publicKey):void 0),t.data!==void 0&&(r.data=t.data?e.SignatureDescriptor_Data.toJSON(t.data):void 0),t.sequence!==void 0&&(r.sequence=(t.sequence||BigInt(0)).toString()),r},fromPartial(t){let r=l();return t.publicKey!==void 0&&t.publicKey!==null&&(r.publicKey=n.Any.fromPartial(t.publicKey)),t.data!==void 0&&t.data!==null&&(r.data=e.SignatureDescriptor_Data.fromPartial(t.data)),t.sequence!==void 0&&t.sequence!==null&&(r.sequence=BigInt(t.sequence.toString())),r}};function u(){return{single:void 0,multi:void 0}}e.SignatureDescriptor_Data={typeUrl:`/cosmos.tx.signing.v1beta1.Data`,encode(t,n=r.BinaryWriter.create()){return t.single!==void 0&&e.SignatureDescriptor_Data_Single.encode(t.single,n.uint32(10).fork()).ldelim(),t.multi!==void 0&&e.SignatureDescriptor_Data_Multi.encode(t.multi,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.BinaryReader?t:new r.BinaryReader(t),a=n===void 0?i.len:i.pos+n,o=u();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.single=e.SignatureDescriptor_Data_Single.decode(i,i.uint32());break;case 2:o.multi=e.SignatureDescriptor_Data_Multi.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){let n=u();return(0,i.isSet)(t.single)&&(n.single=e.SignatureDescriptor_Data_Single.fromJSON(t.single)),(0,i.isSet)(t.multi)&&(n.multi=e.SignatureDescriptor_Data_Multi.fromJSON(t.multi)),n},toJSON(t){let n={};return t.single!==void 0&&(n.single=t.single?e.SignatureDescriptor_Data_Single.toJSON(t.single):void 0),t.multi!==void 0&&(n.multi=t.multi?e.SignatureDescriptor_Data_Multi.toJSON(t.multi):void 0),n},fromPartial(t){let n=u();return t.single!==void 0&&t.single!==null&&(n.single=e.SignatureDescriptor_Data_Single.fromPartial(t.single)),t.multi!==void 0&&t.multi!==null&&(n.multi=e.SignatureDescriptor_Data_Multi.fromPartial(t.multi)),n}};function d(){return{mode:0,signature:new Uint8Array}}e.SignatureDescriptor_Data_Single={typeUrl:`/cosmos.tx.signing.v1beta1.Single`,encode(e,t=r.BinaryWriter.create()){return e.mode!==0&&t.uint32(8).int32(e.mode),e.signature.length!==0&&t.uint32(18).bytes(e.signature),t},decode(e,t){let n=e instanceof r.BinaryReader?e:new r.BinaryReader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.mode=n.int32();break;case 2:a.signature=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){let t=d();return(0,i.isSet)(e.mode)&&(t.mode=o(e.mode)),(0,i.isSet)(e.signature)&&(t.signature=(0,i.bytesFromBase64)(e.signature)),t},toJSON(e){let t={};return e.mode!==void 0&&(t.mode=s(e.mode)),e.signature!==void 0&&(t.signature=(0,i.base64FromBytes)(e.signature===void 0?new Uint8Array:e.signature)),t},fromPartial(e){let t=d();return t.mode=e.mode??0,t.signature=e.signature??new Uint8Array,t}};function f(){return{bitarray:void 0,signatures:[]}}e.SignatureDescriptor_Data_Multi={typeUrl:`/cosmos.tx.signing.v1beta1.Multi`,encode(n,i=r.BinaryWriter.create()){n.bitarray!==void 0&&t.CompactBitArray.encode(n.bitarray,i.uint32(10).fork()).ldelim();for(let t of n.signatures)e.SignatureDescriptor_Data.encode(t,i.uint32(18).fork()).ldelim();return i},decode(n,i){let a=n instanceof r.BinaryReader?n:new r.BinaryReader(n),o=i===void 0?a.len:a.pos+i,s=f();for(;a.pos<o;){let n=a.uint32();switch(n>>>3){case 1:s.bitarray=t.CompactBitArray.decode(a,a.uint32());break;case 2:s.signatures.push(e.SignatureDescriptor_Data.decode(a,a.uint32()));break;default:a.skipType(n&7);break}}return s},fromJSON(n){let r=f();return(0,i.isSet)(n.bitarray)&&(r.bitarray=t.CompactBitArray.fromJSON(n.bitarray)),Array.isArray(n?.signatures)&&(r.signatures=n.signatures.map(t=>e.SignatureDescriptor_Data.fromJSON(t))),r},toJSON(n){let r={};return n.bitarray!==void 0&&(r.bitarray=n.bitarray?t.CompactBitArray.toJSON(n.bitarray):void 0),n.signatures?r.signatures=n.signatures.map(t=>t?e.SignatureDescriptor_Data.toJSON(t):void 0):r.signatures=[],r},fromPartial(n){let r=f();return n.bitarray!==void 0&&n.bitarray!==null&&(r.bitarray=t.CompactBitArray.fromPartial(n.bitarray)),r.signatures=n.signatures?.map(t=>e.SignatureDescriptor_Data.fromPartial(t))||[],r}}})),Yn=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DecProto=e.IntProto=e.DecCoin=e.Coin=e.protobufPackage=void 0;var t=Wn(),n=Gn();e.protobufPackage=`cosmos.base.v1beta1`;function r(){return{denom:``,amount:``}}e.Coin={typeUrl:`/cosmos.base.v1beta1.Coin`,encode(e,n=t.BinaryWriter.create()){return e.denom!==``&&n.uint32(10).string(e.denom),e.amount!==``&&n.uint32(18).string(e.amount),n},decode(e,n){let i=e instanceof t.BinaryReader?e:new t.BinaryReader(e),a=n===void 0?i.len:i.pos+n,o=r();for(;i.pos<a;){let e=i.uint32();switch(e>>>3){case 1:o.denom=i.string();break;case 2:o.amount=i.string();break;default:i.skipType(e&7);break}}return o},fromJSON(e){let t=r();return(0,n.isSet)(e.denom)&&(t.denom=String(e.denom)),(0,n.isSet)(e.amount)&&(t.amount=String(e.amount)),t},toJSON(e){let t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){let t=r();return t.denom=e.denom??``,t.amount=e.amount??``,t}};function i(){return{denom:``,amount:``}}e.DecCoin={typeUrl:`/cosmos.base.v1beta1.DecCoin`,encode(e,n=t.BinaryWriter.create()){return e.denom!==``&&n.uint32(10).string(e.denom),e.amount!==``&&n.uint32(18).string(e.amount),n},decode(e,n){let r=e instanceof t.BinaryReader?e:new t.BinaryReader(e),a=n===void 0?r.len:r.pos+n,o=i();for(;r.pos<a;){let e=r.uint32();switch(e>>>3){case 1:o.denom=r.string();break;case 2:o.amount=r.string();break;default:r.skipType(e&7);break}}return o},fromJSON(e){let t=i();return(0,n.isSet)(e.denom)&&(t.denom=String(e.denom)),(0,n.isSet)(e.amount)&&(t.amount=String(e.amount)),t},toJSON(e){let t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){let t=i();return t.denom=e.denom??``,t.amount=e.amount??``,t}};function a(){return{int:``}}e.IntProto={typeUrl:`/cosmos.base.v1beta1.IntProto`,encode(e,n=t.BinaryWriter.create()){return e.int!==``&&n.uint32(10).string(e.int),n},decode(e,n){let r=e instanceof t.BinaryReader?e:new t.BinaryReader(e),i=n===void 0?r.len:r.pos+n,o=a();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:o.int=r.string();break;default:r.skipType(e&7);break}}return o},fromJSON(e){let t=a();return(0,n.isSet)(e.int)&&(t.int=String(e.int)),t},toJSON(e){let t={};return e.int!==void 0&&(t.int=e.int),t},fromPartial(e){let t=a();return t.int=e.int??``,t}};function o(){return{dec:``}}e.DecProto={typeUrl:`/cosmos.base.v1beta1.DecProto`,encode(e,n=t.BinaryWriter.create()){return e.dec!==``&&n.uint32(10).string(e.dec),n},decode(e,n){let r=e instanceof t.BinaryReader?e:new t.BinaryReader(e),i=n===void 0?r.len:r.pos+n,a=o();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:a.dec=r.string();break;default:r.skipType(e&7);break}}return a},fromJSON(e){let t=o();return(0,n.isSet)(e.dec)&&(t.dec=String(e.dec)),t},toJSON(e){let t={};return e.dec!==void 0&&(t.dec=e.dec),t},fromPartial(e){let t=o();return t.dec=e.dec??``,t}}})),Xn=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AuxSignerData=e.Tip=e.Fee=e.ModeInfo_Multi=e.ModeInfo_Single=e.ModeInfo=e.SignerInfo=e.AuthInfo=e.TxBody=e.SignDocDirectAux=e.SignDoc=e.TxRaw=e.Tx=e.protobufPackage=void 0;var t=Kn(),n=Jn(),r=qn(),i=Yn(),a=Wn(),o=Gn();e.protobufPackage=`cosmos.tx.v1beta1`;function s(){return{body:void 0,authInfo:void 0,signatures:[]}}e.Tx={typeUrl:`/cosmos.tx.v1beta1.Tx`,encode(t,n=a.BinaryWriter.create()){t.body!==void 0&&e.TxBody.encode(t.body,n.uint32(10).fork()).ldelim(),t.authInfo!==void 0&&e.AuthInfo.encode(t.authInfo,n.uint32(18).fork()).ldelim();for(let e of t.signatures)n.uint32(26).bytes(e);return n},decode(t,n){let r=t instanceof a.BinaryReader?t:new a.BinaryReader(t),i=n===void 0?r.len:r.pos+n,o=s();for(;r.pos<i;){let t=r.uint32();switch(t>>>3){case 1:o.body=e.TxBody.decode(r,r.uint32());break;case 2:o.authInfo=e.AuthInfo.decode(r,r.uint32());break;case 3:o.signatures.push(r.bytes());break;default:r.skipType(t&7);break}}return o},fromJSON(t){let n=s();return(0,o.isSet)(t.body)&&(n.body=e.TxBody.fromJSON(t.body)),(0,o.isSet)(t.authInfo)&&(n.authInfo=e.AuthInfo.fromJSON(t.authInfo)),Array.isArray(t?.signatures)&&(n.signatures=t.signatures.map(e=>(0,o.bytesFromBase64)(e))),n},toJSON(t){let n={};return t.body!==void 0&&(n.body=t.body?e.TxBody.toJSON(t.body):void 0),t.authInfo!==void 0&&(n.authInfo=t.authInfo?e.AuthInfo.toJSON(t.authInfo):void 0),t.signatures?n.signatures=t.signatures.map(e=>(0,o.base64FromBytes)(e===void 0?new Uint8Array:e)):n.signatures=[],n},fromPartial(t){let n=s();return t.body!==void 0&&t.body!==null&&(n.body=e.TxBody.fromPartial(t.body)),t.authInfo!==void 0&&t.authInfo!==null&&(n.authInfo=e.AuthInfo.fromPartial(t.authInfo)),n.signatures=t.signatures?.map(e=>e)||[],n}};function c(){return{bodyBytes:new Uint8Array,authInfoBytes:new Uint8Array,signatures:[]}}e.TxRaw={typeUrl:`/cosmos.tx.v1beta1.TxRaw`,encode(e,t=a.BinaryWriter.create()){e.bodyBytes.length!==0&&t.uint32(10).bytes(e.bodyBytes),e.authInfoBytes.length!==0&&t.uint32(18).bytes(e.authInfoBytes);for(let n of e.signatures)t.uint32(26).bytes(n);return t},decode(e,t){let n=e instanceof a.BinaryReader?e:new a.BinaryReader(e),r=t===void 0?n.len:n.pos+t,i=c();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:i.bodyBytes=n.bytes();break;case 2:i.authInfoBytes=n.bytes();break;case 3:i.signatures.push(n.bytes());break;default:n.skipType(e&7);break}}return i},fromJSON(e){let t=c();return(0,o.isSet)(e.bodyBytes)&&(t.bodyBytes=(0,o.bytesFromBase64)(e.bodyBytes)),(0,o.isSet)(e.authInfoBytes)&&(t.authInfoBytes=(0,o.bytesFromBase64)(e.authInfoBytes)),Array.isArray(e?.signatures)&&(t.signatures=e.signatures.map(e=>(0,o.bytesFromBase64)(e))),t},toJSON(e){let t={};return e.bodyBytes!==void 0&&(t.bodyBytes=(0,o.base64FromBytes)(e.bodyBytes===void 0?new Uint8Array:e.bodyBytes)),e.authInfoBytes!==void 0&&(t.authInfoBytes=(0,o.base64FromBytes)(e.authInfoBytes===void 0?new Uint8Array:e.authInfoBytes)),e.signatures?t.signatures=e.signatures.map(e=>(0,o.base64FromBytes)(e===void 0?new Uint8Array:e)):t.signatures=[],t},fromPartial(e){let t=c();return t.bodyBytes=e.bodyBytes??new Uint8Array,t.authInfoBytes=e.authInfoBytes??new Uint8Array,t.signatures=e.signatures?.map(e=>e)||[],t}};function l(){return{bodyBytes:new Uint8Array,authInfoBytes:new Uint8Array,chainId:``,accountNumber:BigInt(0)}}e.SignDoc={typeUrl:`/cosmos.tx.v1beta1.SignDoc`,encode(e,t=a.BinaryWriter.create()){return e.bodyBytes.length!==0&&t.uint32(10).bytes(e.bodyBytes),e.authInfoBytes.length!==0&&t.uint32(18).bytes(e.authInfoBytes),e.chainId!==``&&t.uint32(26).string(e.chainId),e.accountNumber!==BigInt(0)&&t.uint32(32).uint64(e.accountNumber),t},decode(e,t){let n=e instanceof a.BinaryReader?e:new a.BinaryReader(e),r=t===void 0?n.len:n.pos+t,i=l();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:i.bodyBytes=n.bytes();break;case 2:i.authInfoBytes=n.bytes();break;case 3:i.chainId=n.string();break;case 4:i.accountNumber=n.uint64();break;default:n.skipType(e&7);break}}return i},fromJSON(e){let t=l();return(0,o.isSet)(e.bodyBytes)&&(t.bodyBytes=(0,o.bytesFromBase64)(e.bodyBytes)),(0,o.isSet)(e.authInfoBytes)&&(t.authInfoBytes=(0,o.bytesFromBase64)(e.authInfoBytes)),(0,o.isSet)(e.chainId)&&(t.chainId=String(e.chainId)),(0,o.isSet)(e.accountNumber)&&(t.accountNumber=BigInt(e.accountNumber.toString())),t},toJSON(e){let t={};return e.bodyBytes!==void 0&&(t.bodyBytes=(0,o.base64FromBytes)(e.bodyBytes===void 0?new Uint8Array:e.bodyBytes)),e.authInfoBytes!==void 0&&(t.authInfoBytes=(0,o.base64FromBytes)(e.authInfoBytes===void 0?new Uint8Array:e.authInfoBytes)),e.chainId!==void 0&&(t.chainId=e.chainId),e.accountNumber!==void 0&&(t.accountNumber=(e.accountNumber||BigInt(0)).toString()),t},fromPartial(e){let t=l();return t.bodyBytes=e.bodyBytes??new Uint8Array,t.authInfoBytes=e.authInfoBytes??new Uint8Array,t.chainId=e.chainId??``,e.accountNumber!==void 0&&e.accountNumber!==null&&(t.accountNumber=BigInt(e.accountNumber.toString())),t}};function u(){return{bodyBytes:new Uint8Array,publicKey:void 0,chainId:``,accountNumber:BigInt(0),sequence:BigInt(0),tip:void 0}}e.SignDocDirectAux={typeUrl:`/cosmos.tx.v1beta1.SignDocDirectAux`,encode(n,r=a.BinaryWriter.create()){return n.bodyBytes.length!==0&&r.uint32(10).bytes(n.bodyBytes),n.publicKey!==void 0&&t.Any.encode(n.publicKey,r.uint32(18).fork()).ldelim(),n.chainId!==``&&r.uint32(26).string(n.chainId),n.accountNumber!==BigInt(0)&&r.uint32(32).uint64(n.accountNumber),n.sequence!==BigInt(0)&&r.uint32(40).uint64(n.sequence),n.tip!==void 0&&e.Tip.encode(n.tip,r.uint32(50).fork()).ldelim(),r},decode(n,r){let i=n instanceof a.BinaryReader?n:new a.BinaryReader(n),o=r===void 0?i.len:i.pos+r,s=u();for(;i.pos<o;){let n=i.uint32();switch(n>>>3){case 1:s.bodyBytes=i.bytes();break;case 2:s.publicKey=t.Any.decode(i,i.uint32());break;case 3:s.chainId=i.string();break;case 4:s.accountNumber=i.uint64();break;case 5:s.sequence=i.uint64();break;case 6:s.tip=e.Tip.decode(i,i.uint32());break;default:i.skipType(n&7);break}}return s},fromJSON(n){let r=u();return(0,o.isSet)(n.bodyBytes)&&(r.bodyBytes=(0,o.bytesFromBase64)(n.bodyBytes)),(0,o.isSet)(n.publicKey)&&(r.publicKey=t.Any.fromJSON(n.publicKey)),(0,o.isSet)(n.chainId)&&(r.chainId=String(n.chainId)),(0,o.isSet)(n.accountNumber)&&(r.accountNumber=BigInt(n.accountNumber.toString())),(0,o.isSet)(n.sequence)&&(r.sequence=BigInt(n.sequence.toString())),(0,o.isSet)(n.tip)&&(r.tip=e.Tip.fromJSON(n.tip)),r},toJSON(n){let r={};return n.bodyBytes!==void 0&&(r.bodyBytes=(0,o.base64FromBytes)(n.bodyBytes===void 0?new Uint8Array:n.bodyBytes)),n.publicKey!==void 0&&(r.publicKey=n.publicKey?t.Any.toJSON(n.publicKey):void 0),n.chainId!==void 0&&(r.chainId=n.chainId),n.accountNumber!==void 0&&(r.accountNumber=(n.accountNumber||BigInt(0)).toString()),n.sequence!==void 0&&(r.sequence=(n.sequence||BigInt(0)).toString()),n.tip!==void 0&&(r.tip=n.tip?e.Tip.toJSON(n.tip):void 0),r},fromPartial(n){let r=u();return r.bodyBytes=n.bodyBytes??new Uint8Array,n.publicKey!==void 0&&n.publicKey!==null&&(r.publicKey=t.Any.fromPartial(n.publicKey)),r.chainId=n.chainId??``,n.accountNumber!==void 0&&n.accountNumber!==null&&(r.accountNumber=BigInt(n.accountNumber.toString())),n.sequence!==void 0&&n.sequence!==null&&(r.sequence=BigInt(n.sequence.toString())),n.tip!==void 0&&n.tip!==null&&(r.tip=e.Tip.fromPartial(n.tip)),r}};function d(){return{messages:[],memo:``,timeoutHeight:BigInt(0),extensionOptions:[],nonCriticalExtensionOptions:[]}}e.TxBody={typeUrl:`/cosmos.tx.v1beta1.TxBody`,encode(e,n=a.BinaryWriter.create()){for(let r of e.messages)t.Any.encode(r,n.uint32(10).fork()).ldelim();e.memo!==``&&n.uint32(18).string(e.memo),e.timeoutHeight!==BigInt(0)&&n.uint32(24).uint64(e.timeoutHeight);for(let r of e.extensionOptions)t.Any.encode(r,n.uint32(8186).fork()).ldelim();for(let r of e.nonCriticalExtensionOptions)t.Any.encode(r,n.uint32(16378).fork()).ldelim();return n},decode(e,n){let r=e instanceof a.BinaryReader?e:new a.BinaryReader(e),i=n===void 0?r.len:r.pos+n,o=d();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:o.messages.push(t.Any.decode(r,r.uint32()));break;case 2:o.memo=r.string();break;case 3:o.timeoutHeight=r.uint64();break;case 1023:o.extensionOptions.push(t.Any.decode(r,r.uint32()));break;case 2047:o.nonCriticalExtensionOptions.push(t.Any.decode(r,r.uint32()));break;default:r.skipType(e&7);break}}return o},fromJSON(e){let n=d();return Array.isArray(e?.messages)&&(n.messages=e.messages.map(e=>t.Any.fromJSON(e))),(0,o.isSet)(e.memo)&&(n.memo=String(e.memo)),(0,o.isSet)(e.timeoutHeight)&&(n.timeoutHeight=BigInt(e.timeoutHeight.toString())),Array.isArray(e?.extensionOptions)&&(n.extensionOptions=e.extensionOptions.map(e=>t.Any.fromJSON(e))),Array.isArray(e?.nonCriticalExtensionOptions)&&(n.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions.map(e=>t.Any.fromJSON(e))),n},toJSON(e){let n={};return e.messages?n.messages=e.messages.map(e=>e?t.Any.toJSON(e):void 0):n.messages=[],e.memo!==void 0&&(n.memo=e.memo),e.timeoutHeight!==void 0&&(n.timeoutHeight=(e.timeoutHeight||BigInt(0)).toString()),e.extensionOptions?n.extensionOptions=e.extensionOptions.map(e=>e?t.Any.toJSON(e):void 0):n.extensionOptions=[],e.nonCriticalExtensionOptions?n.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions.map(e=>e?t.Any.toJSON(e):void 0):n.nonCriticalExtensionOptions=[],n},fromPartial(e){let n=d();return n.messages=e.messages?.map(e=>t.Any.fromPartial(e))||[],n.memo=e.memo??``,e.timeoutHeight!==void 0&&e.timeoutHeight!==null&&(n.timeoutHeight=BigInt(e.timeoutHeight.toString())),n.extensionOptions=e.extensionOptions?.map(e=>t.Any.fromPartial(e))||[],n.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions?.map(e=>t.Any.fromPartial(e))||[],n}};function f(){return{signerInfos:[],fee:void 0,tip:void 0}}e.AuthInfo={typeUrl:`/cosmos.tx.v1beta1.AuthInfo`,encode(t,n=a.BinaryWriter.create()){for(let r of t.signerInfos)e.SignerInfo.encode(r,n.uint32(10).fork()).ldelim();return t.fee!==void 0&&e.Fee.encode(t.fee,n.uint32(18).fork()).ldelim(),t.tip!==void 0&&e.Tip.encode(t.tip,n.uint32(26).fork()).ldelim(),n},decode(t,n){let r=t instanceof a.BinaryReader?t:new a.BinaryReader(t),i=n===void 0?r.len:r.pos+n,o=f();for(;r.pos<i;){let t=r.uint32();switch(t>>>3){case 1:o.signerInfos.push(e.SignerInfo.decode(r,r.uint32()));break;case 2:o.fee=e.Fee.decode(r,r.uint32());break;case 3:o.tip=e.Tip.decode(r,r.uint32());break;default:r.skipType(t&7);break}}return o},fromJSON(t){let n=f();return Array.isArray(t?.signerInfos)&&(n.signerInfos=t.signerInfos.map(t=>e.SignerInfo.fromJSON(t))),(0,o.isSet)(t.fee)&&(n.fee=e.Fee.fromJSON(t.fee)),(0,o.isSet)(t.tip)&&(n.tip=e.Tip.fromJSON(t.tip)),n},toJSON(t){let n={};return t.signerInfos?n.signerInfos=t.signerInfos.map(t=>t?e.SignerInfo.toJSON(t):void 0):n.signerInfos=[],t.fee!==void 0&&(n.fee=t.fee?e.Fee.toJSON(t.fee):void 0),t.tip!==void 0&&(n.tip=t.tip?e.Tip.toJSON(t.tip):void 0),n},fromPartial(t){let n=f();return n.signerInfos=t.signerInfos?.map(t=>e.SignerInfo.fromPartial(t))||[],t.fee!==void 0&&t.fee!==null&&(n.fee=e.Fee.fromPartial(t.fee)),t.tip!==void 0&&t.tip!==null&&(n.tip=e.Tip.fromPartial(t.tip)),n}};function p(){return{publicKey:void 0,modeInfo:void 0,sequence:BigInt(0)}}e.SignerInfo={typeUrl:`/cosmos.tx.v1beta1.SignerInfo`,encode(n,r=a.BinaryWriter.create()){return n.publicKey!==void 0&&t.Any.encode(n.publicKey,r.uint32(10).fork()).ldelim(),n.modeInfo!==void 0&&e.ModeInfo.encode(n.modeInfo,r.uint32(18).fork()).ldelim(),n.sequence!==BigInt(0)&&r.uint32(24).uint64(n.sequence),r},decode(n,r){let i=n instanceof a.BinaryReader?n:new a.BinaryReader(n),o=r===void 0?i.len:i.pos+r,s=p();for(;i.pos<o;){let n=i.uint32();switch(n>>>3){case 1:s.publicKey=t.Any.decode(i,i.uint32());break;case 2:s.modeInfo=e.ModeInfo.decode(i,i.uint32());break;case 3:s.sequence=i.uint64();break;default:i.skipType(n&7);break}}return s},fromJSON(n){let r=p();return(0,o.isSet)(n.publicKey)&&(r.publicKey=t.Any.fromJSON(n.publicKey)),(0,o.isSet)(n.modeInfo)&&(r.modeInfo=e.ModeInfo.fromJSON(n.modeInfo)),(0,o.isSet)(n.sequence)&&(r.sequence=BigInt(n.sequence.toString())),r},toJSON(n){let r={};return n.publicKey!==void 0&&(r.publicKey=n.publicKey?t.Any.toJSON(n.publicKey):void 0),n.modeInfo!==void 0&&(r.modeInfo=n.modeInfo?e.ModeInfo.toJSON(n.modeInfo):void 0),n.sequence!==void 0&&(r.sequence=(n.sequence||BigInt(0)).toString()),r},fromPartial(n){let r=p();return n.publicKey!==void 0&&n.publicKey!==null&&(r.publicKey=t.Any.fromPartial(n.publicKey)),n.modeInfo!==void 0&&n.modeInfo!==null&&(r.modeInfo=e.ModeInfo.fromPartial(n.modeInfo)),n.sequence!==void 0&&n.sequence!==null&&(r.sequence=BigInt(n.sequence.toString())),r}};function m(){return{single:void 0,multi:void 0}}e.ModeInfo={typeUrl:`/cosmos.tx.v1beta1.ModeInfo`,encode(t,n=a.BinaryWriter.create()){return t.single!==void 0&&e.ModeInfo_Single.encode(t.single,n.uint32(10).fork()).ldelim(),t.multi!==void 0&&e.ModeInfo_Multi.encode(t.multi,n.uint32(18).fork()).ldelim(),n},decode(t,n){let r=t instanceof a.BinaryReader?t:new a.BinaryReader(t),i=n===void 0?r.len:r.pos+n,o=m();for(;r.pos<i;){let t=r.uint32();switch(t>>>3){case 1:o.single=e.ModeInfo_Single.decode(r,r.uint32());break;case 2:o.multi=e.ModeInfo_Multi.decode(r,r.uint32());break;default:r.skipType(t&7);break}}return o},fromJSON(t){let n=m();return(0,o.isSet)(t.single)&&(n.single=e.ModeInfo_Single.fromJSON(t.single)),(0,o.isSet)(t.multi)&&(n.multi=e.ModeInfo_Multi.fromJSON(t.multi)),n},toJSON(t){let n={};return t.single!==void 0&&(n.single=t.single?e.ModeInfo_Single.toJSON(t.single):void 0),t.multi!==void 0&&(n.multi=t.multi?e.ModeInfo_Multi.toJSON(t.multi):void 0),n},fromPartial(t){let n=m();return t.single!==void 0&&t.single!==null&&(n.single=e.ModeInfo_Single.fromPartial(t.single)),t.multi!==void 0&&t.multi!==null&&(n.multi=e.ModeInfo_Multi.fromPartial(t.multi)),n}};function h(){return{mode:0}}e.ModeInfo_Single={typeUrl:`/cosmos.tx.v1beta1.Single`,encode(e,t=a.BinaryWriter.create()){return e.mode!==0&&t.uint32(8).int32(e.mode),t},decode(e,t){let n=e instanceof a.BinaryReader?e:new a.BinaryReader(e),r=t===void 0?n.len:n.pos+t,i=h();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:i.mode=n.int32();break;default:n.skipType(e&7);break}}return i},fromJSON(e){let t=h();return(0,o.isSet)(e.mode)&&(t.mode=(0,n.signModeFromJSON)(e.mode)),t},toJSON(e){let t={};return e.mode!==void 0&&(t.mode=(0,n.signModeToJSON)(e.mode)),t},fromPartial(e){let t=h();return t.mode=e.mode??0,t}};function g(){return{bitarray:void 0,modeInfos:[]}}e.ModeInfo_Multi={typeUrl:`/cosmos.tx.v1beta1.Multi`,encode(t,n=a.BinaryWriter.create()){t.bitarray!==void 0&&r.CompactBitArray.encode(t.bitarray,n.uint32(10).fork()).ldelim();for(let r of t.modeInfos)e.ModeInfo.encode(r,n.uint32(18).fork()).ldelim();return n},decode(t,n){let i=t instanceof a.BinaryReader?t:new a.BinaryReader(t),o=n===void 0?i.len:i.pos+n,s=g();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.bitarray=r.CompactBitArray.decode(i,i.uint32());break;case 2:s.modeInfos.push(e.ModeInfo.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return s},fromJSON(t){let n=g();return(0,o.isSet)(t.bitarray)&&(n.bitarray=r.CompactBitArray.fromJSON(t.bitarray)),Array.isArray(t?.modeInfos)&&(n.modeInfos=t.modeInfos.map(t=>e.ModeInfo.fromJSON(t))),n},toJSON(t){let n={};return t.bitarray!==void 0&&(n.bitarray=t.bitarray?r.CompactBitArray.toJSON(t.bitarray):void 0),t.modeInfos?n.modeInfos=t.modeInfos.map(t=>t?e.ModeInfo.toJSON(t):void 0):n.modeInfos=[],n},fromPartial(t){let n=g();return t.bitarray!==void 0&&t.bitarray!==null&&(n.bitarray=r.CompactBitArray.fromPartial(t.bitarray)),n.modeInfos=t.modeInfos?.map(t=>e.ModeInfo.fromPartial(t))||[],n}};function _(){return{amount:[],gasLimit:BigInt(0),payer:``,granter:``}}e.Fee={typeUrl:`/cosmos.tx.v1beta1.Fee`,encode(e,t=a.BinaryWriter.create()){for(let n of e.amount)i.Coin.encode(n,t.uint32(10).fork()).ldelim();return e.gasLimit!==BigInt(0)&&t.uint32(16).uint64(e.gasLimit),e.payer!==``&&t.uint32(26).string(e.payer),e.granter!==``&&t.uint32(34).string(e.granter),t},decode(e,t){let n=e instanceof a.BinaryReader?e:new a.BinaryReader(e),r=t===void 0?n.len:n.pos+t,o=_();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:o.amount.push(i.Coin.decode(n,n.uint32()));break;case 2:o.gasLimit=n.uint64();break;case 3:o.payer=n.string();break;case 4:o.granter=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){let t=_();return Array.isArray(e?.amount)&&(t.amount=e.amount.map(e=>i.Coin.fromJSON(e))),(0,o.isSet)(e.gasLimit)&&(t.gasLimit=BigInt(e.gasLimit.toString())),(0,o.isSet)(e.payer)&&(t.payer=String(e.payer)),(0,o.isSet)(e.granter)&&(t.granter=String(e.granter)),t},toJSON(e){let t={};return e.amount?t.amount=e.amount.map(e=>e?i.Coin.toJSON(e):void 0):t.amount=[],e.gasLimit!==void 0&&(t.gasLimit=(e.gasLimit||BigInt(0)).toString()),e.payer!==void 0&&(t.payer=e.payer),e.granter!==void 0&&(t.granter=e.granter),t},fromPartial(e){let t=_();return t.amount=e.amount?.map(e=>i.Coin.fromPartial(e))||[],e.gasLimit!==void 0&&e.gasLimit!==null&&(t.gasLimit=BigInt(e.gasLimit.toString())),t.payer=e.payer??``,t.granter=e.granter??``,t}};function v(){return{amount:[],tipper:``}}e.Tip={typeUrl:`/cosmos.tx.v1beta1.Tip`,encode(e,t=a.BinaryWriter.create()){for(let n of e.amount)i.Coin.encode(n,t.uint32(10).fork()).ldelim();return e.tipper!==``&&t.uint32(18).string(e.tipper),t},decode(e,t){let n=e instanceof a.BinaryReader?e:new a.BinaryReader(e),r=t===void 0?n.len:n.pos+t,o=v();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:o.amount.push(i.Coin.decode(n,n.uint32()));break;case 2:o.tipper=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){let t=v();return Array.isArray(e?.amount)&&(t.amount=e.amount.map(e=>i.Coin.fromJSON(e))),(0,o.isSet)(e.tipper)&&(t.tipper=String(e.tipper)),t},toJSON(e){let t={};return e.amount?t.amount=e.amount.map(e=>e?i.Coin.toJSON(e):void 0):t.amount=[],e.tipper!==void 0&&(t.tipper=e.tipper),t},fromPartial(e){let t=v();return t.amount=e.amount?.map(e=>i.Coin.fromPartial(e))||[],t.tipper=e.tipper??``,t}};function y(){return{address:``,signDoc:void 0,mode:0,sig:new Uint8Array}}e.AuxSignerData={typeUrl:`/cosmos.tx.v1beta1.AuxSignerData`,encode(t,n=a.BinaryWriter.create()){return t.address!==``&&n.uint32(10).string(t.address),t.signDoc!==void 0&&e.SignDocDirectAux.encode(t.signDoc,n.uint32(18).fork()).ldelim(),t.mode!==0&&n.uint32(24).int32(t.mode),t.sig.length!==0&&n.uint32(34).bytes(t.sig),n},decode(t,n){let r=t instanceof a.BinaryReader?t:new a.BinaryReader(t),i=n===void 0?r.len:r.pos+n,o=y();for(;r.pos<i;){let t=r.uint32();switch(t>>>3){case 1:o.address=r.string();break;case 2:o.signDoc=e.SignDocDirectAux.decode(r,r.uint32());break;case 3:o.mode=r.int32();break;case 4:o.sig=r.bytes();break;default:r.skipType(t&7);break}}return o},fromJSON(t){let r=y();return(0,o.isSet)(t.address)&&(r.address=String(t.address)),(0,o.isSet)(t.signDoc)&&(r.signDoc=e.SignDocDirectAux.fromJSON(t.signDoc)),(0,o.isSet)(t.mode)&&(r.mode=(0,n.signModeFromJSON)(t.mode)),(0,o.isSet)(t.sig)&&(r.sig=(0,o.bytesFromBase64)(t.sig)),r},toJSON(t){let r={};return t.address!==void 0&&(r.address=t.address),t.signDoc!==void 0&&(r.signDoc=t.signDoc?e.SignDocDirectAux.toJSON(t.signDoc):void 0),t.mode!==void 0&&(r.mode=(0,n.signModeToJSON)(t.mode)),t.sig!==void 0&&(r.sig=(0,o.base64FromBytes)(t.sig===void 0?new Uint8Array:t.sig)),r},fromPartial(t){let n=y();return n.address=t.address??``,t.signDoc!==void 0&&t.signDoc!==null&&(n.signDoc=e.SignDocDirectAux.fromPartial(t.signDoc)),n.mode=t.mode??0,n.sig=t.sig??new Uint8Array,n}}})),Zn=a(((e,t)=>{var n=C(),r=A().Buffer;t.exports=function(e){function t(t){var i=e(t);return n.encode(r.concat([t,i],t.length+4))}function i(t){var n=t.slice(0,-4),r=t.slice(-4),i=e(n);if(!(r[0]^i[0]|r[1]^i[1]|r[2]^i[2]|r[3]^i[3]))return n}function a(e){var t=n.decodeUnsafe(e);if(t)return i(t)}function o(t){var r=i(n.decode(t),e);if(!r)throw Error(`Invalid checksum`);return r}return{encode:t,decode:o,decodeUnsafe:a}}})),Qn=a(((e,t)=>{var n=E(),r=Zn();function i(e){var t=n(`sha256`).update(e).digest();return n(`sha256`).update(t).digest()}t.exports=r(i)})),W=a(((t,n)=>{m(),(function(e,r){typeof t==`object`?n.exports=t=r():typeof define==`function`&&define.amd?define([],r):e.CryptoJS=r()})(t,function(){var t=t||function(t,n){var r;if(typeof window<`u`&&window.crypto&&(r=window.crypto),typeof self<`u`&&self.crypto&&(r=self.crypto),typeof globalThis<`u`&&globalThis.crypto&&(r=globalThis.crypto),!r&&typeof window<`u`&&window.msCrypto&&(r=window.msCrypto),!r&&h!==void 0&&h.crypto&&(r=h.crypto),!r&&typeof e==`function`)try{r=D()}catch{}var i=function(){if(r){if(typeof r.getRandomValues==`function`)try{return r.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof r.randomBytes==`function`)try{return r.randomBytes(4).readInt32LE()}catch{}}throw Error(`Native crypto module could not be used to get secure random number.`)},a=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),o={},s=o.lib={},c=s.Base=function(){return{extend:function(e){var t=a(this);return e&&t.mixIn(e),(!t.hasOwnProperty(`init`)||this.init===t.init)&&(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty(`toString`)&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),l=s.WordArray=c.extend({init:function(e,t){e=this.words=e||[],t==n?this.sigBytes=e.length*4:this.sigBytes=t},toString:function(e){return(e||d).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var a=0;a<i;a++){var o=n[a>>>2]>>>24-a%4*8&255;t[r+a>>>2]|=o<<24-(r+a)%4*8}else for(var s=0;s<i;s+=4)t[r+s>>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,n=this.sigBytes;e[n>>>2]&=4294967295<<32-n%4*8,e.length=t.ceil(n/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(i());return new l.init(t,e)}}),u=o.enc={},d=u.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var a=t[i>>>2]>>>24-i%4*8&255;r.push((a>>>4).toString(16)),r.push((a&15).toString(16))}return r.join(``)},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new l.init(n,t/2)}},f=u.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var a=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(a))}return r.join(``)},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(e.charCodeAt(r)&255)<<24-r%4*8;return new l.init(n,t)}},p=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch{throw Error(`Malformed UTF-8 data`)}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},m=s.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(e){typeof e==`string`&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var n,r=this._data,i=r.words,a=r.sigBytes,o=this.blockSize,s=a/(o*4);s=e?t.ceil(s):t.max((s|0)-this._minBufferSize,0);var c=s*o,u=t.min(c*4,a);if(c){for(var d=0;d<c;d+=o)this._doProcessBlock(i,d);n=i.splice(0,c),r.sigBytes-=u}return new l.init(n,u)},clone:function(){var e=c.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});s.Hasher=m.extend({cfg:c.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){m.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:512/32,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new g.HMAC.init(e,n).finalize(t)}}});var g=o.algo={};return o}(Math);return t})})),$n=a(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(W()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(t){var n=e,r=n.lib,i=r.Base,a=r.WordArray,o=n.x64={};o.Word=i.extend({init:function(e,t){this.high=e,this.low=t}}),o.WordArray=i.extend({init:function(e,n){e=this.words=e||[],n==t?this.sigBytes=e.length*8:this.sigBytes=n},toX32:function(){for(var e=this.words,t=e.length,n=[],r=0;r<t;r++){var i=e[r];n.push(i.high),n.push(i.low)}return a.create(n,this.sigBytes)},clone:function(){for(var e=i.clone.call(this),t=e.words=this.words.slice(0),n=t.length,r=0;r<n;r++)t[r]=t[r].clone();return e}})})(),e})})),er=a(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(W()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(){if(typeof ArrayBuffer==`function`){var t=e.lib.WordArray,n=t.init,r=t.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||typeof Uint8ClampedArray<`u`&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var t=e.byteLength,r=[],i=0;i<t;i++)r[i>>>2]|=e[i]<<24-i%4*8;n.call(this,r,t)}else n.apply(this,arguments)};r.prototype=t}})(),e.lib.WordArray})})),tr=a(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(W()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.WordArray,r=t.enc;r.Utf16=r.Utf16BE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i+=2){var a=t[i>>>2]>>>16-i%4*8&65535;r.push(String.fromCharCode(a))}return r.join(``)},parse:function(e){for(var t=e.length,r=[],i=0;i<t;i++)r[i>>>1]|=e.charCodeAt(i)<<16-i%2*16;return n.create(r,t*2)}},r.Utf16LE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],a=0;a<n;a+=2){var o=i(t[a>>>2]>>>16-a%4*8&65535);r.push(String.fromCharCode(o))}return r.join(``)},parse:function(e){for(var t=e.length,r=[],a=0;a<t;a++)r[a>>>1]|=i(e.charCodeAt(a)<<16-a%2*16);return n.create(r,t*2)}};function i(e){return e<<8&4278255360|e>>>8&16711935}})(),e.enc.Utf16})})),nr=a(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(W()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.WordArray,r=t.enc;r.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var i=[],a=0;a<n;a+=3)for(var o=t[a>>>2]>>>24-a%4*8&255,s=t[a+1>>>2]>>>24-(a+1)%4*8&255,c=t[a+2>>>2]>>>24-(a+2)%4*8&255,l=o<<16|s<<8|c,u=0;u<4&&a+u*.75<n;u++)i.push(r.charAt(l>>>6*(3-u)&63));var d=r.charAt(64);if(d)for(;i.length%4;)i.push(d);return i.join(``)},parse:function(e){var t=e.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var a=0;a<n.length;a++)r[n.charCodeAt(a)]=a}var o=n.charAt(64);if(o){var s=e.indexOf(o);s!==-1&&(t=s)}return i(e,t,r)},_map:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`};function i(e,t,r){for(var i=[],a=0,o=0;o<t;o++)if(o%4){var s=r[e.charCodeAt(o-1)]<<o%4*2|r[e.charCodeAt(o)]>>>6-o%4*2;i[a>>>2]|=s<<24-a%4*8,a++}return n.create(i,a)}})(),e.enc.Base64})})),rr=a(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(W()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.WordArray,r=t.enc;r.Base64url={stringify:function(e,t){t===void 0&&(t=!0);var n=e.words,r=e.sigBytes,i=t?this._safe_map:this._map;e.clamp();for(var a=[],o=0;o<r;o+=3)for(var s=n[o>>>2]>>>24-o%4*8&255,c=n[o+1>>>2]>>>24-(o+1)%4*8&255,l=n[o+2>>>2]>>>24-(o+2)%4*8&255,u=s<<16|c<<8|l,d=0;d<4&&o+d*.75<r;d++)a.push(i.charAt(u>>>6*(3-d)&63));var f=i.charAt(64);if(f)for(;a.length%4;)a.push(f);return a.join(``)},parse:function(e,t){t===void 0&&(t=!0);var n=e.length,r=t?this._safe_map:this._map,a=this._reverseMap;if(!a){a=this._reverseMap=[];for(var o=0;o<r.length;o++)a[r.charCodeAt(o)]=o}var s=r.charAt(64);if(s){var c=e.indexOf(s);c!==-1&&(n=c)}return i(e,n,a)},_map:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`,_safe_map:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`};function i(e,t,r){for(var i=[],a=0,o=0;o<t;o++)if(o%4){var s=r[e.charCodeAt(o-1)]<<o%4*2|r[e.charCodeAt(o)]>>>6-o%4*2;i[a>>>2]|=s<<24-a%4*8,a++}return n.create(i,a)}})(),e.enc.Base64url})})),ir=a(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(W()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.algo,s=[];(function(){for(var e=0;e<64;e++)s[e]=t.abs(t.sin(e+1))*4294967296|0})();var c=o.MD5=a.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360}var a=this._hash.words,o=e[t+0],c=e[t+1],p=e[t+2],m=e[t+3],h=e[t+4],g=e[t+5],_=e[t+6],v=e[t+7],y=e[t+8],b=e[t+9],x=e[t+10],S=e[t+11],C=e[t+12],w=e[t+13],T=e[t+14],E=e[t+15],D=a[0],O=a[1],k=a[2],A=a[3];D=l(D,O,k,A,o,7,s[0]),A=l(A,D,O,k,c,12,s[1]),k=l(k,A,D,O,p,17,s[2]),O=l(O,k,A,D,m,22,s[3]),D=l(D,O,k,A,h,7,s[4]),A=l(A,D,O,k,g,12,s[5]),k=l(k,A,D,O,_,17,s[6]),O=l(O,k,A,D,v,22,s[7]),D=l(D,O,k,A,y,7,s[8]),A=l(A,D,O,k,b,12,s[9]),k=l(k,A,D,O,x,17,s[10]),O=l(O,k,A,D,S,22,s[11]),D=l(D,O,k,A,C,7,s[12]),A=l(A,D,O,k,w,12,s[13]),k=l(k,A,D,O,T,17,s[14]),O=l(O,k,A,D,E,22,s[15]),D=u(D,O,k,A,c,5,s[16]),A=u(A,D,O,k,_,9,s[17]),k=u(k,A,D,O,S,14,s[18]),O=u(O,k,A,D,o,20,s[19]),D=u(D,O,k,A,g,5,s[20]),A=u(A,D,O,k,x,9,s[21]),k=u(k,A,D,O,E,14,s[22]),O=u(O,k,A,D,h,20,s[23]),D=u(D,O,k,A,b,5,s[24]),A=u(A,D,O,k,T,9,s[25]),k=u(k,A,D,O,m,14,s[26]),O=u(O,k,A,D,y,20,s[27]),D=u(D,O,k,A,w,5,s[28]),A=u(A,D,O,k,p,9,s[29]),k=u(k,A,D,O,v,14,s[30]),O=u(O,k,A,D,C,20,s[31]),D=d(D,O,k,A,g,4,s[32]),A=d(A,D,O,k,y,11,s[33]),k=d(k,A,D,O,S,16,s[34]),O=d(O,k,A,D,T,23,s[35]),D=d(D,O,k,A,c,4,s[36]),A=d(A,D,O,k,h,11,s[37]),k=d(k,A,D,O,v,16,s[38]),O=d(O,k,A,D,x,23,s[39]),D=d(D,O,k,A,w,4,s[40]),A=d(A,D,O,k,o,11,s[41]),k=d(k,A,D,O,m,16,s[42]),O=d(O,k,A,D,_,23,s[43]),D=d(D,O,k,A,b,4,s[44]),A=d(A,D,O,k,C,11,s[45]),k=d(k,A,D,O,E,16,s[46]),O=d(O,k,A,D,p,23,s[47]),D=f(D,O,k,A,o,6,s[48]),A=f(A,D,O,k,v,10,s[49]),k=f(k,A,D,O,T,15,s[50]),O=f(O,k,A,D,g,21,s[51]),D=f(D,O,k,A,C,6,s[52]),A=f(A,D,O,k,m,10,s[53]),k=f(k,A,D,O,x,15,s[54]),O=f(O,k,A,D,c,21,s[55]),D=f(D,O,k,A,y,6,s[56]),A=f(A,D,O,k,E,10,s[57]),k=f(k,A,D,O,_,15,s[58]),O=f(O,k,A,D,w,21,s[59]),D=f(D,O,k,A,h,6,s[60]),A=f(A,D,O,k,S,10,s[61]),k=f(k,A,D,O,p,15,s[62]),O=f(O,k,A,D,b,21,s[63]),a[0]=a[0]+D|0,a[1]=a[1]+O|0,a[2]=a[2]+k|0,a[3]=a[3]+A|0},_doFinalize:function(){var e=this._data,n=e.words,r=this._nDataBytes*8,i=e.sigBytes*8;n[i>>>5]|=128<<24-i%32;var a=t.floor(r/4294967296),o=r;n[(i+64>>>9<<4)+15]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360,n[(i+64>>>9<<4)+14]=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,e.sigBytes=(n.length+1)*4,this._process();for(var s=this._hash,c=s.words,l=0;l<4;l++){var u=c[l];c[l]=(u<<8|u>>>24)&16711935|(u<<24|u>>>8)&4278255360}return s},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});function l(e,t,n,r,i,a,o){var s=e+(t&n|~t&r)+i+o;return(s<<a|s>>>32-a)+t}function u(e,t,n,r,i,a,o){var s=e+(t&r|n&~r)+i+o;return(s<<a|s>>>32-a)+t}function d(e,t,n,r,i,a,o){var s=e+(t^n^r)+i+o;return(s<<a|s>>>32-a)+t}function f(e,t,n,r,i,a,o){var s=e+(n^(t|~r))+i+o;return(s<<a|s>>>32-a)+t}n.MD5=a._createHelper(c),n.HmacMD5=a._createHmacHelper(c)})(Math),e.MD5})})),ar=a(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(W()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib,r=n.WordArray,i=n.Hasher,a=t.algo,o=[],s=a.SHA1=i.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],s=n[3],c=n[4],l=0;l<80;l++){if(l<16)o[l]=e[t+l]|0;else{var u=o[l-3]^o[l-8]^o[l-14]^o[l-16];o[l]=u<<1|u>>>31}var d=(r<<5|r>>>27)+c+o[l];l<20?d+=(i&a|~i&s)+1518500249:l<40?d+=(i^a^s)+1859775393:l<60?d+=(i&a|i&s|a&s)-1894007588:d+=(i^a^s)-899497514,c=s,s=a,a=i<<30|i>>>2,i=r,r=d}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=this._nDataBytes*8,r=e.sigBytes*8;return t[r>>>5]|=128<<24-r%32,t[(r+64>>>9<<4)+14]=Math.floor(n/4294967296),t[(r+64>>>9<<4)+15]=n,e.sigBytes=t.length*4,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s)})(),e.SHA1})})),or=a(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(W()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.algo,s=[],c=[];(function(){function e(e){for(var n=t.sqrt(e),r=2;r<=n;r++)if(!(e%r))return!1;return!0}function n(e){return(e-(e|0))*4294967296|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(s[i]=n(t.pow(r,1/2))),c[i]=n(t.pow(r,1/3)),i++),r++})();var l=[],u=o.SHA256=a.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],u=n[5],d=n[6],f=n[7],p=0;p<64;p++){if(p<16)l[p]=e[t+p]|0;else{var m=l[p-15],h=(m<<25|m>>>7)^(m<<14|m>>>18)^m>>>3,g=l[p-2],_=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;l[p]=h+l[p-7]+_+l[p-16]}var v=s&u^~s&d,y=r&i^r&a^i&a,b=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),x=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),S=f+x+v+c[p]+l[p],C=b+y;f=d,d=u,u=s,s=o+S|0,o=a,a=i,i=r,r=S+C|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+o|0,n[4]=n[4]+s|0,n[5]=n[5]+u|0,n[6]=n[6]+d|0,n[7]=n[7]+f|0},_doFinalize:function(){var e=this._data,n=e.words,r=this._nDataBytes*8,i=e.sigBytes*8;return n[i>>>5]|=128<<24-i%32,n[(i+64>>>9<<4)+14]=t.floor(r/4294967296),n[(i+64>>>9<<4)+15]=r,e.sigBytes=n.length*4,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});n.SHA256=a._createHelper(u),n.HmacSHA256=a._createHmacHelper(u)})(Math),e.SHA256})})),sr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),or()):typeof define==`function`&&define.amd?define([`./core`,`./sha256`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.WordArray,r=t.algo,i=r.SHA256,a=r.SHA224=i.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=i._doFinalize.call(this);return e.sigBytes-=4,e}});t.SHA224=i._createHelper(a),t.HmacSHA224=i._createHmacHelper(a)})(),e.SHA224})})),cr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),$n()):typeof define==`function`&&define.amd?define([`./core`,`./x64-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.Hasher,r=t.x64,i=r.Word,a=r.WordArray,o=t.algo;function s(){return i.create.apply(i,arguments)}var c=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],l=[];(function(){for(var e=0;e<80;e++)l[e]=s()})();var u=o.SHA512=n.extend({_doReset:function(){this._hash=new a.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],u=n[5],d=n[6],f=n[7],p=r.high,m=r.low,h=i.high,g=i.low,_=a.high,v=a.low,y=o.high,b=o.low,x=s.high,S=s.low,C=u.high,w=u.low,T=d.high,E=d.low,D=f.high,O=f.low,k=p,A=m,j=h,M=g,N=_,P=v,F=y,I=b,L=x,R=S,ee=C,te=w,ne=T,re=E,ie=D,ae=O,z=0;z<80;z++){var oe,se,ce=l[z];if(z<16)se=ce.high=e[t+z*2]|0,oe=ce.low=e[t+z*2+1]|0;else{var le=l[z-15],ue=le.high,de=le.low,fe=(ue>>>1|de<<31)^(ue>>>8|de<<24)^ue>>>7,pe=(de>>>1|ue<<31)^(de>>>8|ue<<24)^(de>>>7|ue<<25),me=l[z-2],he=me.high,ge=me.low,_e=(he>>>19|ge<<13)^(he<<3|ge>>>29)^he>>>6,ve=(ge>>>19|he<<13)^(ge<<3|he>>>29)^(ge>>>6|he<<26),B=l[z-7],ye=B.high,be=B.low,xe=l[z-16],Se=xe.high,Ce=xe.low;oe=pe+be,se=fe+ye+ +(oe>>>0<pe>>>0),oe+=ve,se=se+_e+ +(oe>>>0<ve>>>0),oe+=Ce,se=se+Se+ +(oe>>>0<Ce>>>0),ce.high=se,ce.low=oe}var we=L&ee^~L&ne,Te=R&te^~R&re,Ee=k&j^k&N^j&N,De=A&M^A&P^M&P,V=(k>>>28|A<<4)^(k<<30|A>>>2)^(k<<25|A>>>7),Oe=(A>>>28|k<<4)^(A<<30|k>>>2)^(A<<25|k>>>7),ke=(L>>>14|R<<18)^(L>>>18|R<<14)^(L<<23|R>>>9),Ae=(R>>>14|L<<18)^(R>>>18|L<<14)^(R<<23|L>>>9),je=c[z],Me=je.high,Ne=je.low,Pe=ae+Ae,Fe=ie+ke+ +(Pe>>>0<ae>>>0),Pe=Pe+Te,Fe=Fe+we+ +(Pe>>>0<Te>>>0),Pe=Pe+Ne,Fe=Fe+Me+ +(Pe>>>0<Ne>>>0),Pe=Pe+oe,Fe=Fe+se+ +(Pe>>>0<oe>>>0),Ie=Oe+De,Le=V+Ee+ +(Ie>>>0<Oe>>>0);ie=ne,ae=re,ne=ee,re=te,ee=L,te=R,R=I+Pe|0,L=F+Fe+ +(R>>>0<I>>>0)|0,F=N,I=P,N=j,P=M,j=k,M=A,A=Pe+Ie|0,k=Fe+Le+ +(A>>>0<Pe>>>0)|0}m=r.low=m+A,r.high=p+k+ +(m>>>0<A>>>0),g=i.low=g+M,i.high=h+j+ +(g>>>0<M>>>0),v=a.low=v+P,a.high=_+N+ +(v>>>0<P>>>0),b=o.low=b+I,o.high=y+F+ +(b>>>0<I>>>0),S=s.low=S+R,s.high=x+L+ +(S>>>0<R>>>0),w=u.low=w+te,u.high=C+ee+ +(w>>>0<te>>>0),E=d.low=E+re,d.high=T+ne+ +(E>>>0<re>>>0),O=f.low=O+ae,f.high=D+ie+ +(O>>>0<ae>>>0)},_doFinalize:function(){var e=this._data,t=e.words,n=this._nDataBytes*8,r=e.sigBytes*8;return t[r>>>5]|=128<<24-r%32,t[(r+128>>>10<<5)+30]=Math.floor(n/4294967296),t[(r+128>>>10<<5)+31]=n,e.sigBytes=t.length*4,this._process(),this._hash.toX32()},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:1024/32});t.SHA512=n._createHelper(u),t.HmacSHA512=n._createHmacHelper(u)})(),e.SHA512})})),lr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),$n(),cr()):typeof define==`function`&&define.amd?define([`./core`,`./x64-core`,`./sha512`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.x64,r=n.Word,i=n.WordArray,a=t.algo,o=a.SHA512,s=a.SHA384=o.extend({_doReset:function(){this._hash=new i.init([new r.init(3418070365,3238371032),new r.init(1654270250,914150663),new r.init(2438529370,812702999),new r.init(355462360,4144912697),new r.init(1731405415,4290775857),new r.init(2394180231,1750603025),new r.init(3675008525,1694076839),new r.init(1203062813,3204075428)])},_doFinalize:function(){var e=o._doFinalize.call(this);return e.sigBytes-=16,e}});t.SHA384=o._createHelper(s),t.HmacSHA384=o._createHmacHelper(s)})(),e.SHA384})})),ur=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),$n()):typeof define==`function`&&define.amd?define([`./core`,`./x64-core`],r):r(n.CryptoJS)})(e,function(e){return(function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.x64.Word,s=n.algo,c=[],l=[],u=[];(function(){for(var e=1,t=0,n=0;n<24;n++){c[e+5*t]=(n+1)*(n+2)/2%64;var r=t%5,i=(2*e+3*t)%5;e=r,t=i}for(var e=0;e<5;e++)for(var t=0;t<5;t++)l[e+5*t]=t+(2*e+3*t)%5*5;for(var a=1,s=0;s<24;s++){for(var d=0,f=0,p=0;p<7;p++){if(a&1){var m=(1<<p)-1;m<32?f^=1<<m:d^=1<<m-32}a&128?a=a<<1^113:a<<=1}u[s]=o.create(d,f)}})();var d=[];(function(){for(var e=0;e<25;e++)d[e]=o.create()})();var f=s.SHA3=a.extend({cfg:a.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new o.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var n=this._state,r=this.blockSize/2,i=0;i<r;i++){var a=e[t+2*i],o=e[t+2*i+1];a=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360,o=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360;var s=n[i];s.high^=o,s.low^=a}for(var f=0;f<24;f++){for(var p=0;p<5;p++){for(var m=0,h=0,g=0;g<5;g++){var s=n[p+5*g];m^=s.high,h^=s.low}var _=d[p];_.high=m,_.low=h}for(var p=0;p<5;p++)for(var v=d[(p+4)%5],y=d[(p+1)%5],b=y.high,x=y.low,m=v.high^(b<<1|x>>>31),h=v.low^(x<<1|b>>>31),g=0;g<5;g++){var s=n[p+5*g];s.high^=m,s.low^=h}for(var S=1;S<25;S++){var m,h,s=n[S],C=s.high,w=s.low,T=c[S];T<32?(m=C<<T|w>>>32-T,h=w<<T|C>>>32-T):(m=w<<T-32|C>>>64-T,h=C<<T-32|w>>>64-T);var E=d[l[S]];E.high=m,E.low=h}var D=d[0],O=n[0];D.high=O.high,D.low=O.low;for(var p=0;p<5;p++)for(var g=0;g<5;g++){var S=p+5*g,s=n[S],k=d[S],A=d[(p+1)%5+5*g],j=d[(p+2)%5+5*g];s.high=k.high^~A.high&j.high,s.low=k.low^~A.low&j.low}var s=n[0],M=u[f];s.high^=M.high,s.low^=M.low}},_doFinalize:function(){var e=this._data,n=e.words;this._nDataBytes*8;var r=e.sigBytes*8,a=this.blockSize*32;n[r>>>5]|=1<<24-r%32,n[(t.ceil((r+1)/a)*a>>>5)-1]|=128,e.sigBytes=n.length*4,this._process();for(var o=this._state,s=this.cfg.outputLength/8,c=s/8,l=[],u=0;u<c;u++){var d=o[u],f=d.high,p=d.low;f=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360,p=(p<<8|p>>>24)&16711935|(p<<24|p>>>8)&4278255360,l.push(p),l.push(f)}return new i.init(l,s)},clone:function(){for(var e=a.clone.call(this),t=e._state=this._state.slice(0),n=0;n<25;n++)t[n]=t[n].clone();return e}});n.SHA3=a._createHelper(f),n.HmacSHA3=a._createHmacHelper(f)})(Math),e.SHA3})})),dr=a(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(W()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.algo,s=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),l=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),d=i.create([0,1518500249,1859775393,2400959708,2840853838]),f=i.create([1352829926,1548603684,1836072691,2053994217,0]),p=o.RIPEMD160=a.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360}for(var a=this._hash.words,o=d.words,p=f.words,b=s.words,x=c.words,S=l.words,C=u.words,w,T,E,D,O,k=w=a[0],A=T=a[1],j=E=a[2],M=D=a[3],N=O=a[4],P,n=0;n<80;n+=1)P=w+e[t+b[n]]|0,n<16?P+=m(T,E,D)+o[0]:n<32?P+=h(T,E,D)+o[1]:n<48?P+=g(T,E,D)+o[2]:n<64?P+=_(T,E,D)+o[3]:P+=v(T,E,D)+o[4],P|=0,P=y(P,S[n]),P=P+O|0,w=O,O=D,D=y(E,10),E=T,T=P,P=k+e[t+x[n]]|0,n<16?P+=v(A,j,M)+p[0]:n<32?P+=_(A,j,M)+p[1]:n<48?P+=g(A,j,M)+p[2]:n<64?P+=h(A,j,M)+p[3]:P+=m(A,j,M)+p[4],P|=0,P=y(P,C[n]),P=P+N|0,k=N,N=M,M=y(j,10),j=A,A=P;P=a[1]+E+M|0,a[1]=a[2]+D+N|0,a[2]=a[3]+O+k|0,a[3]=a[4]+w+A|0,a[4]=a[0]+T+j|0,a[0]=P},_doFinalize:function(){var e=this._data,t=e.words,n=this._nDataBytes*8,r=e.sigBytes*8;t[r>>>5]|=128<<24-r%32,t[(r+64>>>9<<4)+14]=(n<<8|n>>>24)&16711935|(n<<24|n>>>8)&4278255360,e.sigBytes=(t.length+1)*4,this._process();for(var i=this._hash,a=i.words,o=0;o<5;o++){var s=a[o];a[o]=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360}return i},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});function m(e,t,n){return e^t^n}function h(e,t,n){return e&t|~e&n}function g(e,t,n){return(e|~t)^n}function _(e,t,n){return e&n|t&~n}function v(e,t,n){return e^(t|~n)}function y(e,t){return e<<t|e>>>32-t}n.RIPEMD160=a._createHelper(p),n.HmacRIPEMD160=a._createHmacHelper(p)})(Math),e.RIPEMD160})})),fr=a(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(W()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){(function(){var t=e,n=t.lib.Base,r=t.enc.Utf8,i=t.algo;i.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,typeof t==`string`&&(t=r.parse(t));var n=e.blockSize,i=n*4;t.sigBytes>i&&(t=e.finalize(t)),t.clamp();for(var a=this._oKey=t.clone(),o=this._iKey=t.clone(),s=a.words,c=o.words,l=0;l<n;l++)s[l]^=1549556828,c[l]^=909522486;a.sigBytes=o.sigBytes=i,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})})()})})),pr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),or(),fr()):typeof define==`function`&&define.amd?define([`./core`,`./sha256`,`./hmac`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib,r=n.Base,i=n.WordArray,a=t.algo,o=a.SHA256,s=a.HMAC,c=a.PBKDF2=r.extend({cfg:r.extend({keySize:128/32,hasher:o,iterations:25e4}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=s.create(n.hasher,e),a=i.create(),o=i.create([1]),c=a.words,l=o.words,u=n.keySize,d=n.iterations;c.length<u;){var f=r.update(t).finalize(o);r.reset();for(var p=f.words,m=p.length,h=f,g=1;g<d;g++){h=r.finalize(h),r.reset();for(var _=h.words,v=0;v<m;v++)p[v]^=_[v]}a.concat(f),l[0]++}return a.sigBytes=u*4,a}});t.PBKDF2=function(e,t,n){return c.create(n).compute(e,t)}})(),e.PBKDF2})})),mr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),ar(),fr()):typeof define==`function`&&define.amd?define([`./core`,`./sha1`,`./hmac`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib,r=n.Base,i=n.WordArray,a=t.algo,o=a.MD5,s=a.EvpKDF=r.extend({cfg:r.extend({keySize:128/32,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n,r=this.cfg,a=r.hasher.create(),o=i.create(),s=o.words,c=r.keySize,l=r.iterations;s.length<c;){n&&a.update(n),n=a.update(e).finalize(t),a.reset();for(var u=1;u<l;u++)n=a.finalize(n),a.reset();o.concat(n)}return o.sigBytes=c*4,o}});t.EvpKDF=function(e,t,n){return s.create(n).compute(e,t)}})(),e.EvpKDF})})),hr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),mr()):typeof define==`function`&&define.amd?define([`./core`,`./evpkdf`],r):r(n.CryptoJS)})(e,function(e){e.lib.Cipher||function(t){var n=e,r=n.lib,i=r.Base,a=r.WordArray,o=r.BufferedBlockAlgorithm,s=n.enc;s.Utf8;var c=s.Base64,l=n.algo.EvpKDF,u=r.Cipher=o.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return typeof e==`string`?S:y}return function(t){return{encrypt:function(n,r,i){return e(r).encrypt(t,n,r,i)},decrypt:function(n,r,i){return e(r).decrypt(t,n,r,i)}}}}()});r.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var d=n.mode={},f=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),p=d.CBC=function(){var e=f.extend();e.Encryptor=e.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize;n.call(this,e,t,i),r.encryptBlock(e,t),this._prevBlock=e.slice(t,t+i)}}),e.Decryptor=e.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,a=e.slice(t,t+i);r.decryptBlock(e,t),n.call(this,e,t,i),this._prevBlock=a}});function n(e,n,r){var i,a=this._iv;a?(i=a,this._iv=t):i=this._prevBlock;for(var o=0;o<r;o++)e[n+o]^=i[o]}return e}(),m=n.pad={},h=m.Pkcs7={pad:function(e,t){for(var n=t*4,r=n-e.sigBytes%n,i=r<<24|r<<16|r<<8|r,o=[],s=0;s<r;s+=4)o.push(i);var c=a.create(o,r);e.concat(c)},unpad:function(e){var t=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=t}};r.BlockCipher=u.extend({cfg:u.cfg.extend({mode:p,padding:h}),reset:function(){var e;u.reset.call(this);var t=this.cfg,n=t.iv,r=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=r.createEncryptor:(e=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(r,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:128/32});var g=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),_=n.format={},v=_.OpenSSL={stringify:function(e){var t,n=e.ciphertext,r=e.salt;return t=r?a.create([1398893684,1701076831]).concat(r).concat(n):n,t.toString(c)},parse:function(e){var t,n=c.parse(e),r=n.words;return r[0]==1398893684&&r[1]==1701076831&&(t=a.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),g.create({ciphertext:n,salt:t})}},y=r.SerializableCipher=i.extend({cfg:i.extend({format:v}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r),a=i.finalize(t),o=i.cfg;return g.create({ciphertext:a,key:n,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return typeof e==`string`?t.parse(e,this):e}}),b=n.kdf={},x=b.OpenSSL={execute:function(e,t,n,r,i){if(r||=a.random(64/8),i)var o=l.create({keySize:t+n,hasher:i}).compute(e,r);else var o=l.create({keySize:t+n}).compute(e,r);var s=a.create(o.words.slice(t),n*4);return o.sigBytes=t*4,g.create({key:o,iv:s,salt:r})}},S=r.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:x}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=r.kdf.execute(n,e.keySize,e.ivSize,r.salt,r.hasher);r.iv=i.iv;var a=y.encrypt.call(this,e,t,i.key,r);return a.mixIn(i),a},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var i=r.kdf.execute(n,e.keySize,e.ivSize,t.salt,r.hasher);return r.iv=i.iv,y.decrypt.call(this,e,t,i.key,r)}})}()})})),gr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.mode.CFB=function(){var t=e.lib.BlockCipherMode.extend();t.Encryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize;n.call(this,e,t,i,r),this._prevBlock=e.slice(t,t+i)}}),t.Decryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,a=e.slice(t,t+i);n.call(this,e,t,i,r),this._prevBlock=a}});function n(e,t,n,r){var i,a=this._iv;a?(i=a.slice(0),this._iv=void 0):i=this._prevBlock,r.encryptBlock(i,0);for(var o=0;o<n;o++)e[t+o]^=i[o]}return t}(),e.mode.CFB})})),_r=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.mode.CTR=function(){var t=e.lib.BlockCipherMode.extend();return t.Decryptor=t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,i=this._iv,a=this._counter;i&&(a=this._counter=i.slice(0),this._iv=void 0);var o=a.slice(0);n.encryptBlock(o,0),a[r-1]=a[r-1]+1|0;for(var s=0;s<r;s++)e[t+s]^=o[s]}}),t}(),e.mode.CTR})})),vr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.mode.CTRGladman=function(){var t=e.lib.BlockCipherMode.extend();function n(e){if((e>>24&255)==255){var t=e>>16&255,n=e>>8&255,r=e&255;t===255?(t=0,n===255?(n=0,r===255?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}else e+=1<<24;return e}function r(e){return(e[0]=n(e[0]))===0&&(e[1]=n(e[1])),e}return t.Decryptor=t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,a=this._iv,o=this._counter;a&&(o=this._counter=a.slice(0),this._iv=void 0),r(o);var s=o.slice(0);n.encryptBlock(s,0);for(var c=0;c<i;c++)e[t+c]^=s[c]}}),t}(),e.mode.CTRGladman})})),yr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.mode.OFB=function(){var t=e.lib.BlockCipherMode.extend();return t.Decryptor=t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,i=this._iv,a=this._keystream;i&&(a=this._keystream=i.slice(0),this._iv=void 0),n.encryptBlock(a,0);for(var o=0;o<r;o++)e[t+o]^=a[o]}}),t}(),e.mode.OFB})})),br=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.mode.ECB=function(){var t=e.lib.BlockCipherMode.extend();return t.Encryptor=t.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),t.Decryptor=t.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),t}(),e.mode.ECB})})),xr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.pad.AnsiX923={pad:function(e,t){var n=e.sigBytes,r=t*4,i=r-n%r,a=n+i-1;e.clamp(),e.words[a>>>2]|=i<<24-a%4*8,e.sigBytes+=i},unpad:function(e){var t=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=t}},e.pad.Ansix923})})),Sr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.pad.Iso10126={pad:function(t,n){var r=n*4,i=r-t.sigBytes%r;t.concat(e.lib.WordArray.random(i-1)).concat(e.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=t}},e.pad.Iso10126})})),Cr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.pad.Iso97971={pad:function(t,n){t.concat(e.lib.WordArray.create([2147483648],1)),e.pad.ZeroPadding.pad(t,n)},unpad:function(t){e.pad.ZeroPadding.unpad(t),t.sigBytes--}},e.pad.Iso97971})})),wr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.pad.ZeroPadding={pad:function(e,t){var n=t*4;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){for(var t=e.words,n=e.sigBytes-1,n=e.sigBytes-1;n>=0;n--)if(t[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}}},e.pad.ZeroPadding})})),Tr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding})})),Er=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(t){var n=e,r=n.lib.CipherParams,i=n.enc.Hex,a=n.format;a.Hex={stringify:function(e){return e.ciphertext.toString(i)},parse:function(e){var t=i.parse(e);return r.create({ciphertext:t})}}})(),e.format.Hex})})),Dr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),nr(),ir(),mr(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./enc-base64`,`./md5`,`./evpkdf`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.BlockCipher,r=t.algo,i=[],a=[],o=[],s=[],c=[],l=[],u=[],d=[],f=[],p=[];(function(){for(var e=[],t=0;t<256;t++)t<128?e[t]=t<<1:e[t]=t<<1^283;for(var n=0,r=0,t=0;t<256;t++){var m=r^r<<1^r<<2^r<<3^r<<4;m=m>>>8^m&255^99,i[n]=m,a[m]=n;var h=e[n],g=e[h],_=e[g],v=e[m]*257^m*16843008;o[n]=v<<24|v>>>8,s[n]=v<<16|v>>>16,c[n]=v<<8|v>>>24,l[n]=v;var v=_*16843009^g*65537^h*257^n*16843008;u[m]=v<<24|v>>>8,d[m]=v<<16|v>>>16,f[m]=v<<8|v>>>24,p[m]=v,n?(n=h^e[e[e[_^h]]],r^=e[e[r]]):n=r=1}})();var m=[0,1,2,4,8,16,32,64,128,27,54],h=r.AES=n.extend({_doReset:function(){var e;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var t=this._keyPriorReset=this._key,n=t.words,r=t.sigBytes/4,a=((this._nRounds=r+6)+1)*4,o=this._keySchedule=[],s=0;s<a;s++)s<r?o[s]=n[s]:(e=o[s-1],s%r?r>6&&s%r==4&&(e=i[e>>>24]<<24|i[e>>>16&255]<<16|i[e>>>8&255]<<8|i[e&255]):(e=e<<8|e>>>24,e=i[e>>>24]<<24|i[e>>>16&255]<<16|i[e>>>8&255]<<8|i[e&255],e^=m[s/r|0]<<24),o[s]=o[s-r]^e);for(var c=this._invKeySchedule=[],l=0;l<a;l++){var s=a-l;if(l%4)var e=o[s];else var e=o[s-4];l<4||s<=4?c[l]=e:c[l]=u[i[e>>>24]]^d[i[e>>>16&255]]^f[i[e>>>8&255]]^p[i[e&255]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,s,c,l,i)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,u,d,f,p,a);var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,a,o,s){for(var c=this._nRounds,l=e[t]^n[0],u=e[t+1]^n[1],d=e[t+2]^n[2],f=e[t+3]^n[3],p=4,m=1;m<c;m++){var h=r[l>>>24]^i[u>>>16&255]^a[d>>>8&255]^o[f&255]^n[p++],g=r[u>>>24]^i[d>>>16&255]^a[f>>>8&255]^o[l&255]^n[p++],_=r[d>>>24]^i[f>>>16&255]^a[l>>>8&255]^o[u&255]^n[p++],v=r[f>>>24]^i[l>>>16&255]^a[u>>>8&255]^o[d&255]^n[p++];l=h,u=g,d=_,f=v}var h=(s[l>>>24]<<24|s[u>>>16&255]<<16|s[d>>>8&255]<<8|s[f&255])^n[p++],g=(s[u>>>24]<<24|s[d>>>16&255]<<16|s[f>>>8&255]<<8|s[l&255])^n[p++],_=(s[d>>>24]<<24|s[f>>>16&255]<<16|s[l>>>8&255]<<8|s[u&255])^n[p++],v=(s[f>>>24]<<24|s[l>>>16&255]<<16|s[u>>>8&255]<<8|s[d&255])^n[p++];e[t]=h,e[t+1]=g,e[t+2]=_,e[t+3]=v},keySize:256/32});t.AES=n._createHelper(h)})(),e.AES})})),Or=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),nr(),ir(),mr(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./enc-base64`,`./md5`,`./evpkdf`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib,r=n.WordArray,i=n.BlockCipher,a=t.algo,o=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],l=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],u=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],d=a.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],n=0;n<56;n++){var r=o[n]-1;t[n]=e[r>>>5]>>>31-r%32&1}for(var i=this._subKeys=[],a=0;a<16;a++){for(var l=i[a]=[],u=c[a],n=0;n<24;n++)l[n/6|0]|=t[(s[n]-1+u)%28]<<31-n%6,l[4+(n/6|0)]|=t[28+(s[n+24]-1+u)%28]<<31-n%6;l[0]=l[0]<<1|l[0]>>>31;for(var n=1;n<7;n++)l[n]=l[n]>>>(n-1)*4+3;l[7]=l[7]<<5|l[7]>>>27}for(var d=this._invSubKeys=[],n=0;n<16;n++)d[n]=i[15-n]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,n){this._lBlock=e[t],this._rBlock=e[t+1],f.call(this,4,252645135),f.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),f.call(this,1,1431655765);for(var r=0;r<16;r++){for(var i=n[r],a=this._lBlock,o=this._rBlock,s=0,c=0;c<8;c++)s|=l[c][((o^i[c])&u[c])>>>0];this._lBlock=o,this._rBlock=a^s}var d=this._lBlock;this._lBlock=this._rBlock,this._rBlock=d,f.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),f.call(this,16,65535),f.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function f(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<<e}function p(e,t){var n=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<<e}t.DES=i._createHelper(d);var m=a.TripleDES=i.extend({_doReset:function(){var e=this._key.words;if(e.length!==2&&e.length!==4&&e.length<6)throw Error(`Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.`);var t=e.slice(0,2),n=e.length<4?e.slice(0,2):e.slice(2,4),i=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=d.createEncryptor(r.create(t)),this._des2=d.createEncryptor(r.create(n)),this._des3=d.createEncryptor(r.create(i))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:192/32,ivSize:64/32,blockSize:64/32});t.TripleDES=i._createHelper(m)})(),e.TripleDES})})),kr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),nr(),ir(),mr(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./enc-base64`,`./md5`,`./evpkdf`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.StreamCipher,r=t.algo,i=r.RC4=n.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes,r=this._S=[],i=0;i<256;i++)r[i]=i;for(var i=0,a=0;i<256;i++){var o=i%n,s=t[o>>>2]>>>24-o%4*8&255;a=(a+r[i]+s)%256;var c=r[i];r[i]=r[a],r[a]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=a.call(this)},keySize:256/32,ivSize:0});function a(){for(var e=this._S,t=this._i,n=this._j,r=0,i=0;i<4;i++){t=(t+1)%256,n=(n+e[t])%256;var a=e[t];e[t]=e[n],e[n]=a,r|=e[(e[t]+e[n])%256]<<24-i*8}return this._i=t,this._j=n,r}t.RC4=n._createHelper(i);var o=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)a.call(this)}});t.RC4Drop=n._createHelper(o)})(),e.RC4})})),Ar=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),nr(),ir(),mr(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./enc-base64`,`./md5`,`./evpkdf`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.StreamCipher,r=t.algo,i=[],a=[],o=[],s=r.Rabbit=n.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,n=0;n<4;n++)e[n]=(e[n]<<8|e[n]>>>24)&16711935|(e[n]<<24|e[n]>>>8)&4278255360;var r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,e[0]&4294901760|e[1]&65535,e[3]<<16|e[3]>>>16,e[1]&4294901760|e[2]&65535,e[0]<<16|e[0]>>>16,e[2]&4294901760|e[3]&65535,e[1]<<16|e[1]>>>16,e[3]&4294901760|e[0]&65535];this._b=0;for(var n=0;n<4;n++)c.call(this);for(var n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var a=t.words,o=a[0],s=a[1],l=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,u=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360,d=l>>>16|u&4294901760,f=u<<16|l&65535;i[0]^=l,i[1]^=d,i[2]^=u,i[3]^=f,i[4]^=l,i[5]^=d,i[6]^=u,i[7]^=f;for(var n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=(i[r]<<8|i[r]>>>24)&16711935|(i[r]<<24|i[r]>>>8)&4278255360,e[t+r]^=i[r]},blockSize:128/32,ivSize:64/32});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)a[n]=t[n];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+ +(t[0]>>>0<a[0]>>>0)|0,t[2]=t[2]+886263092+ +(t[1]>>>0<a[1]>>>0)|0,t[3]=t[3]+1295307597+ +(t[2]>>>0<a[2]>>>0)|0,t[4]=t[4]+3545052371+ +(t[3]>>>0<a[3]>>>0)|0,t[5]=t[5]+886263092+ +(t[4]>>>0<a[4]>>>0)|0,t[6]=t[6]+1295307597+ +(t[5]>>>0<a[5]>>>0)|0,t[7]=t[7]+3545052371+ +(t[6]>>>0<a[6]>>>0)|0,this._b=+(t[7]>>>0<a[7]>>>0);for(var n=0;n<8;n++){var r=e[n]+t[n],i=r&65535,s=r>>>16;o[n]=((i*i>>>17)+i*s>>>15)+s*s^((r&4294901760)*r|0)+((r&65535)*r|0)}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}t.Rabbit=n._createHelper(s)})(),e.Rabbit})})),jr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),nr(),ir(),mr(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./enc-base64`,`./md5`,`./evpkdf`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.StreamCipher,r=t.algo,i=[],a=[],o=[],s=r.RabbitLegacy=n.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],r=this._C=[e[2]<<16|e[2]>>>16,e[0]&4294901760|e[1]&65535,e[3]<<16|e[3]>>>16,e[1]&4294901760|e[2]&65535,e[0]<<16|e[0]>>>16,e[2]&4294901760|e[3]&65535,e[1]<<16|e[1]>>>16,e[3]&4294901760|e[0]&65535];this._b=0;for(var i=0;i<4;i++)c.call(this);for(var i=0;i<8;i++)r[i]^=n[i+4&7];if(t){var a=t.words,o=a[0],s=a[1],l=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,u=(s<<8|s>>>24)&16711935|(s<<24|s>>>8)&4278255360,d=l>>>16|u&4294901760,f=u<<16|l&65535;r[0]^=l,r[1]^=d,r[2]^=u,r[3]^=f,r[4]^=l,r[5]^=d,r[6]^=u,r[7]^=f;for(var i=0;i<4;i++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=(i[r]<<8|i[r]>>>24)&16711935|(i[r]<<24|i[r]>>>8)&4278255360,e[t+r]^=i[r]},blockSize:128/32,ivSize:64/32});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)a[n]=t[n];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+ +(t[0]>>>0<a[0]>>>0)|0,t[2]=t[2]+886263092+ +(t[1]>>>0<a[1]>>>0)|0,t[3]=t[3]+1295307597+ +(t[2]>>>0<a[2]>>>0)|0,t[4]=t[4]+3545052371+ +(t[3]>>>0<a[3]>>>0)|0,t[5]=t[5]+886263092+ +(t[4]>>>0<a[4]>>>0)|0,t[6]=t[6]+1295307597+ +(t[5]>>>0<a[5]>>>0)|0,t[7]=t[7]+3545052371+ +(t[6]>>>0<a[6]>>>0)|0,this._b=+(t[7]>>>0<a[7]>>>0);for(var n=0;n<8;n++){var r=e[n]+t[n],i=r&65535,s=r>>>16;o[n]=((i*i>>>17)+i*s>>>15)+s*s^((r&4294901760)*r|0)+((r&65535)*r|0)}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}t.RabbitLegacy=n._createHelper(s)})(),e.RabbitLegacy})})),Mr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),nr(),ir(),mr(),hr()):typeof define==`function`&&define.amd?define([`./core`,`./enc-base64`,`./md5`,`./evpkdf`,`./cipher-core`],r):r(n.CryptoJS)})(e,function(e){return(function(){var t=e,n=t.lib.BlockCipher,r=t.algo;let i=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],a=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var o={pbox:[],sbox:[]};function s(e,t){let n=t>>24&255,r=t>>16&255,i=t>>8&255,a=t&255,o=e.sbox[0][n]+e.sbox[1][r];return o^=e.sbox[2][i],o+=e.sbox[3][a],o}function c(e,t,n){let r=t,i=n,a;for(let t=0;t<16;++t)r^=e.pbox[t],i=s(e,r)^i,a=r,r=i,i=a;return a=r,r=i,i=a,i^=e.pbox[16],r^=e.pbox[17],{left:r,right:i}}function l(e,t,n){let r=t,i=n,a;for(let t=17;t>1;--t)r^=e.pbox[t],i=s(e,r)^i,a=r,r=i,i=a;return a=r,r=i,i=a,i^=e.pbox[1],r^=e.pbox[0],{left:r,right:i}}function u(e,t,n){for(let t=0;t<4;t++){e.sbox[t]=[];for(let n=0;n<256;n++)e.sbox[t][n]=a[t][n]}let r=0;for(let a=0;a<18;a++)e.pbox[a]=i[a]^t[r],r++,r>=n&&(r=0);let o=0,s=0,l=0;for(let t=0;t<18;t+=2)l=c(e,o,s),o=l.left,s=l.right,e.pbox[t]=o,e.pbox[t+1]=s;for(let t=0;t<4;t++)for(let n=0;n<256;n+=2)l=c(e,o,s),o=l.left,s=l.right,e.sbox[t][n]=o,e.sbox[t][n+1]=s;return!0}var d=r.Blowfish=n.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var e=this._keyPriorReset=this._key,t=e.words;u(o,t,e.sigBytes/4)}},encryptBlock:function(e,t){var n=c(o,e[t],e[t+1]);e[t]=n.left,e[t+1]=n.right},decryptBlock:function(e,t){var n=l(o,e[t],e[t+1]);e[t]=n.left,e[t+1]=n.right},blockSize:64/32,keySize:128/32,ivSize:64/32});t.Blowfish=n._createHelper(d)})(),e.Blowfish})})),Nr=a(((e,t)=>{(function(n,r,i){typeof e==`object`?t.exports=e=r(W(),$n(),er(),tr(),nr(),rr(),ir(),ar(),or(),sr(),cr(),lr(),ur(),dr(),fr(),pr(),mr(),hr(),gr(),_r(),vr(),yr(),br(),xr(),Sr(),Cr(),wr(),Tr(),Er(),Dr(),Or(),kr(),Ar(),jr(),Mr()):typeof define==`function`&&define.amd?define(`./core,./x64-core,./lib-typedarrays,./enc-utf16,./enc-base64,./enc-base64url,./md5,./sha1,./sha256,./sha224,./sha512,./sha384,./sha3,./ripemd160,./hmac,./pbkdf2,./evpkdf,./cipher-core,./mode-cfb,./mode-ctr,./mode-ctr-gladman,./mode-ofb,./mode-ecb,./pad-ansix923,./pad-iso10126,./pad-iso97971,./pad-zeropadding,./pad-nopadding,./format-hex,./aes,./tripledes,./rc4,./rabbit,./rabbit-legacy,./blowfish`.split(`,`),r):n.CryptoJS=r(n.CryptoJS)})(e,function(e){return e})})),Pr=a(((e,t)=>{t.exports=n;function n(e,t){for(var n=Array(arguments.length-1),r=0,i=2,a=!0;i<arguments.length;)n[r++]=arguments[i++];return new Promise(function(i,o){n[r]=function(e){if(a)if(a=!1,e)o(e);else{for(var t=Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];i.apply(null,t)}};try{e.apply(t||null,n)}catch(e){a&&(a=!1,o(e))}})}})),Fr=a((e=>{var t=e;t.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&e.charAt(t)===`=`;)++n;return Math.ceil(e.length*3)/4-n};for(var n=Array(64),r=Array(123),i=0;i<64;)r[n[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;t.encode=function(e,t,r){for(var i=null,a=[],o=0,s=0,c;t<r;){var l=e[t++];switch(s){case 0:a[o++]=n[l>>2],c=(l&3)<<4,s=1;break;case 1:a[o++]=n[c|l>>4],c=(l&15)<<2,s=2;break;case 2:a[o++]=n[c|l>>6],a[o++]=n[l&63],s=0;break}o>8191&&((i||=[]).push(String.fromCharCode.apply(String,a)),o=0)}return s&&(a[o++]=n[c],a[o++]=61,s===1&&(a[o++]=61)),i?(o&&i.push(String.fromCharCode.apply(String,a.slice(0,o))),i.join(``)):String.fromCharCode.apply(String,a.slice(0,o))};var a=`invalid encoding`;t.decode=function(e,t,n){for(var i=n,o=0,s,c=0;c<e.length;){var l=e.charCodeAt(c++);if(l===61&&o>1)break;if((l=r[l])===void 0)throw Error(a);switch(o){case 0:s=l,o=1;break;case 1:t[n++]=s<<2|(l&48)>>4,s=l,o=2;break;case 2:t[n++]=(s&15)<<4|(l&60)>>2,s=l,o=3;break;case 3:t[n++]=(s&3)<<6|l,o=0;break}}if(o===1)throw Error(a);return n-i},t.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}})),Ir=a(((e,t)=>{t.exports=n;function n(){this._listeners={}}n.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},n.prototype.off=function(e,t){if(e===void 0)this._listeners={};else if(t===void 0)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},n.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}})),Lr=a(((e,t)=>{t.exports=n(n);function n(e){return typeof Float32Array<`u`?(function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=n[3]===128;function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3]}function a(e,r,i){t[0]=e,r[i]=n[3],r[i+1]=n[2],r[i+2]=n[1],r[i+3]=n[0]}e.writeFloatLE=r?i:a,e.writeFloatBE=r?a:i;function o(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function s(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.readFloatLE=r?o:s,e.readFloatBE=r?s:o})():(function(){function t(e,t,n,r){var i=+(t<0);if(i&&(t=-t),t===0)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var a=Math.floor(Math.log(t)/Math.LN2),o=Math.round(t*2**-a*8388608)&8388607;e((i<<31|a+127<<23|o)>>>0,n,r)}}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,i);function n(e,t,n){var r=e(t,n),i=(r>>31)*2+1,a=r>>>23&255,o=r&8388607;return a===255?o?NaN:i*(1/0):a===0?i*1401298464324817e-60*o:i*2**(a-150)*(o+8388608)}e.readFloatLE=n.bind(null,a),e.readFloatBE=n.bind(null,o)})(),typeof Float64Array<`u`?(function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=n[7]===128;function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3],r[i+4]=n[4],r[i+5]=n[5],r[i+6]=n[6],r[i+7]=n[7]}function a(e,r,i){t[0]=e,r[i]=n[7],r[i+1]=n[6],r[i+2]=n[5],r[i+3]=n[4],r[i+4]=n[3],r[i+5]=n[2],r[i+6]=n[1],r[i+7]=n[0]}e.writeDoubleLE=r?i:a,e.writeDoubleBE=r?a:i;function o(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function s(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.readDoubleLE=r?o:s,e.readDoubleBE=r?s:o})():(function(){function t(e,t,n,r,i,a){var o=+(r<0);if(o&&(r=-r),r===0)e(0,i,a+t),e(1/r>0?0:2147483648,i,a+n);else if(isNaN(r))e(0,i,a+t),e(2146959360,i,a+n);else if(r>17976931348623157e292)e(0,i,a+t),e((o<<31|2146435072)>>>0,i,a+n);else{var s;if(r<22250738585072014e-324)s=r/5e-324,e(s>>>0,i,a+t),e((o<<31|s/4294967296)>>>0,i,a+n);else{var c=Math.floor(Math.log(r)/Math.LN2);c===1024&&(c=1023),s=r*2**-c,e(s*4503599627370496>>>0,i,a+t),e((o<<31|c+1023<<20|s*1048576&1048575)>>>0,i,a+n)}}}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,i,4,0);function n(e,t,n,r,i){var a=e(r,i+t),o=e(r,i+n),s=(o>>31)*2+1,c=o>>>20&2047,l=4294967296*(o&1048575)+a;return c===2047?l?NaN:s*(1/0):c===0?s*5e-324*l:s*2**(c-1075)*(l+4503599627370496)}e.readDoubleLE=n.bind(null,a,0,4),e.readDoubleBE=n.bind(null,o,4,0)})(),e}function r(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function i(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=e&255}function a(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}})),Rr=a(((t,n)=>{n.exports=r;function r(t){try{if(typeof e!=`function`)return null;var n=e(t);return n&&(n.length||Object.keys(n).length)?n:null}catch{return null}}})),zr=a((e=>{var t=e,n=`�`;t.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)n=e.charCodeAt(r),n<128?t+=1:n<2048?t+=2:(n&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320?(++r,t+=4):t+=3;return t},t.read=function(e,t,r){if(r-t<1)return``;for(var i=``,a=t;a<r;){var o=e[a++];if(o<=127)i+=String.fromCharCode(o);else if(o>=192&&o<224){var s=(o&31)<<6|e[a++]&63;i+=s>=128?String.fromCharCode(s):n}else if(o>=224&&o<240){var c=(o&15)<<12|(e[a++]&63)<<6|e[a++]&63;i+=c>=2048?String.fromCharCode(c):n}else if(o>=240){var l=(o&7)<<18|(e[a++]&63)<<12|(e[a++]&63)<<6|e[a++]&63;l<65536||l>1114111?i+=n:(l-=65536,i+=String.fromCharCode(55296+(l>>10)),i+=String.fromCharCode(56320+(l&1023)))}}return i},t.write=function(e,t,n){for(var r=n,i,a,o=0;o<e.length;++o)i=e.charCodeAt(o),i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)==55296&&((a=e.charCodeAt(o+1))&64512)==56320?(i=65536+((i&1023)<<10)+(a&1023),++o,t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128);return n-r}})),Br=a(((e,t)=>{t.exports=n;function n(e,t,n){var r=n||8192,i=r>>>1,a=null,o=r;return function(n){if(n<1||n>i)return e(n);o+n>r&&(a=e(r),o=0);var s=t.call(a,o,o+=n);return o&7&&(o=(o|7)+1),s}}})),Vr=`cosmiframe`,Hr=`cosmiframe_keystorechange`,Ur=class{_mutable;actions;_env;logger;constructor(){this._mutable={state:U.Init}}get env(){return this._env}setEnv(e){this._env=e}setActions=e=>{this.actions=e};get isMobile(){return this.env?.device===`mobile`}get mutable(){return this._mutable}get state(){return this.mutable.state}get isInit(){return this.state===`Init`}get isDone(){return this.state===`Done`}get isError(){return this.state===`Error`}get isPending(){return this.state===`Pending`}get data(){return this.mutable.data}get message(){return this.mutable.message}setState(e){this.logger?.debug(`[State Change] ${this.state} (${this.walletStatus}) -> ${e} (${this.chainName}/${this.walletName})`),this._mutable.state=e,this.actions?.state?.(e)}setData(e){this._mutable.data=e,this.actions?.data?.(e)}setMessage(e){this.logger?.debug(`[Message Set] ${e} (${this.chainName}/${this.walletName})`),this._mutable.message=e,this.actions?.message?.(e)}reset(){this.setData(void 0),this.setMessage(void 0),this.setState(U.Init)}get walletStatus(){return Dn(this.state,this.message)}get isWalletOnceConnect(){return this.isWalletConnected||this.isWalletError}get isWalletConnecting(){return this.walletStatus===`Connecting`}get isWalletConnected(){return this.walletStatus===`Connected`}get isWalletDisconnected(){return this.walletStatus===`Disconnected`}get isWalletRejected(){return this.walletStatus===`Rejected`}get isWalletNotExist(){return this.walletStatus===`NotExist`}get isWalletError(){return this.walletStatus===`Error`}},Wr=class extends Ur{clientMutable={state:U.Init};emitter;_walletInfo;callbacks;session;walletConnectOptions;isActive=!1;throwErrors=!1;constructor(e){super(),this._walletInfo=e}get appUrl(){return this.client?.appUrl}get qrUrl(){return this.client?.qrUrl}activate(){this.isActive=!0}inactivate(){this.isActive=!1}get client(){return this.clientMutable?.data}initingClient(){this.clientMutable.state=U.Pending,this.clientMutable.message=void 0,this.clientMutable.data=void 0}initClientDone(e){this.clientMutable.data=e,this.clientMutable.state=U.Done,this.clientMutable.message=void 0}initClientError(e){this.logger?.error(`${this.walletPrettyName} initClientError: ${e?.message}`),this.clientMutable.message=e?.message,this.clientMutable.state=U.Error,this.isModeExtension?this.setClientNotExist():this.setError(`InitClientError: ${e.message}`)}get walletInfo(){return this._walletInfo}get isModeExtension(){return this.walletInfo.mode===`extension`}get isModeWalletConnect(){return this.walletInfo.mode===`wallet-connect`}get downloadInfo(){let e=this.walletInfo.downloads||[];return e=e.filter(e=>e.device===this.env?.device||!e.device),e.length===1||(e=e.filter(e=>e.os===this.env?.os||!e.os),e.length===1)||(e=e.filter(e=>e.browser===this.env?.browser||!e.browser)),e[0]}get walletName(){return this.walletInfo.name}get walletPrettyName(){return this.walletInfo.prettyName}get rejectMessageSource(){return typeof this.walletInfo.rejectMessage==`string`?this.walletInfo.rejectMessage:this.walletInfo.rejectMessage?.source}get rejectMessageTarget(){if(typeof this.walletInfo.rejectMessage!=`string`)return this.walletInfo.rejectMessage?.target}get rejectCode(){return this.walletInfo.rejectCode}rejectMatched(e){return this.rejectMessageSource&&e.message===this.rejectMessageSource||this.rejectCode&&e.code===this.rejectCode}updateCallbacks(e){this.callbacks={...this.callbacks,...e}}_disconnect=async(e,t)=>{await this.callbacks?.beforeDisconnect?.(),await this.client?.disconnect?.(t),this.clientMutable.state!==U.Error&&this.reset(),this.walletName!==`cosmiframe`&&window.localStorage.removeItem(`cosmos-kit@2:core//current-wallet`),e&&(this.emitter?.emit(`sync_disconnect`,this.chainName),this.logger?.debug("[WALLET EVENT] Emit `sync_disconnect`")),await this.callbacks?.afterDisconnect?.()};disconnect=async(e,t)=>{await this._disconnect(e,t)};setClientNotExist(e){let t=e===void 0?Error():e;t.message=jn.message,this.setError(t)}setRejected(e){let t=e===void 0?Error():e;t.message=Mn.message,this.setError(t)}setError(e){let t=typeof e==`string`||e===void 0?Error(e):e;if(this.setState(U.Error),this.setMessage(t.message),this.throwErrors===!0||this.throwErrors===`connect_only`&&t.name===`ConnectError`)throw t}connect=async e=>{await this.callbacks?.beforeConnect?.();let t=typeof this.walletInfo.mobileDisabled==`boolean`?this.walletInfo.mobileDisabled:this.walletInfo.mobileDisabled();if(this.isMobile&&t){this.setError(new wn(`This wallet is not supported on mobile, please use desktop browsers.`));return}e&&(this.emitter?.emit(`sync_connect`,this.chainName),this.logger?.debug(`[Event Emit] \`sync_connect\` (${this.chainName}/${this.walletName})`));try{if(!this.client&&(this.setState(U.Pending),this.setMessage(`InitClient`),await this.initClient(this.walletInfo.mode===`wallet-connect`?this.walletConnectOptions:void 0),this.emitter?.emit(`broadcast_client`,this.client),this.logger?.debug("[WALLET EVENT] Emit `broadcast_client`"),!this.client)){this.setClientNotExist(new wn);return}await this.update()}catch(e){this.setError(new wn(e.message))}await this.callbacks?.afterConnect?.()}},Gr=class extends Wr{mainWallet;chainRecord;_rpcEndpoint;_restEndpoint;connectChains;offlineSigner;namespace=`cosmos`;preferredSignType;constructor(e,t){super(e),this.chainRecord=t,this.preferredSignType=t.clientOptions?.preferredSignType||`amino`}get chain(){return this.chainRecord.chain}get assetList(){return this.chainRecord.assetList}get isTestNet(){return this.chainName.includes(`testnet`)}get preferredEndpoints(){return this.chainRecord.preferredEndpoints}get rpcEndpoints(){return this.preferredEndpoints?.rpc||[]}get restEndpoints(){return this.preferredEndpoints?.rest||[]}get isLazy(){return this.preferredEndpoints.isLazy}addEndpoints(e){this.chainRecord.preferredEndpoints={isLazy:e?.isLazy??this.preferredEndpoints?.isLazy,rpc:[...e?.rpc||[],...this.preferredEndpoints?.rpc||[]],rest:[...e?.rest||[],...this.preferredEndpoints?.rest||[]]}}get chainName(){return this.chainRecord.name}get chainLogoUrl(){return this.assetList?.assets[0]?.logo_URIs?.svg||this.assetList?.assets[0]?.logo_URIs?.png||void 0}get stargateOptions(){return this.chainRecord.clientOptions?.stargate}get signingStargateOptions(){return this.chainRecord.clientOptions?.signingStargate||this.chainRecord.clientOptions?.stargate}get signingCosmwasmOptions(){return this.chainRecord.clientOptions?.signingCosmwasm}get assets(){return this.assetList?.assets}get chainId(){return this.chain?.chain_id}get cosmwasmEnabled(){return this.chain?.codebase?.cosmwasm_enabled}get username(){return this.data?.username}get address(){return this.data?.address}setData(e){this.logger?.debug(`[Data Change] ${JSON.stringify(this.data)} -> ${JSON.stringify(e)} (${this.chainName}/${this.walletName})`),this._mutable.data=e,this.actions?.data?.(e);let t=window.localStorage.getItem(`cosmos-kit@2:core//accounts`),n=t?JSON.parse(t):[];e===void 0?n=n.filter(e=>e.chainId!==this.chainId||e.namespace!==this.namespace):(n=n.filter(e=>e.chainId!==this.chainId||e.namespace!==this.namespace),n.push(e)),window?.localStorage.setItem(`cosmos-kit@2:core//accounts`,JSON.stringify(n)),this.session?.update()}initClient(e){throw Error(`initClient not implemented`)}async update(e={connect:!0}){this.setState(U.Pending),this.setMessage(void 0);try{e.connect&&(this.connectChains?await this.connectChains():await this?.client?.connect?.(this.chainId));let t;try{this.logger?.debug(`Fetching ${this.walletName} ${this.chainId} account.`),t=await this?.client?.getSimpleAccount(this.chainId)}catch(e){if(this.rejectMatched(e)){this.logger?.debug(`Fetching rejected.`),this.setRejected(new wn);return}if(this.client&&this?.client?.addChain)this.logger?.debug(`Going to add chain ${this.chainId}`),await this.client.addChain(this.chainRecord),t=await this.client.getSimpleAccount(this.chainId);else throw e}this.setData(t),this.setState(U.Done),this.setMessage(void 0)}catch(e){e&&this.rejectMatched(e)?this.setRejected(new wn):this.setError(new wn(e.message))}!this.isWalletRejected&&this.walletName!==`cosmiframe`&&window?.localStorage.setItem(`cosmos-kit@2:core//current-wallet`,this.walletName)}getRpcEndpoint=async e=>{let{getIsLazy:t}=await g(async()=>{let{getIsLazy:e}=await import(`./utils-14NfwrBn.js`).then(e=>e.t);return{getIsLazy:e}},__vite__mapDeps([0,1,2,3,4])),n=t(void 0,this.isLazy,this._rpcEndpoint?.isLazy,e,this.logger);if(n)return this._rpcEndpoint||this.rpcEndpoints[0]||Promise.reject(`No endpoint available.`);let{isValidEndpoint:r}=await g(async()=>{let{isValidEndpoint:e}=await import(`./utils-14NfwrBn.js`).then(e=>e.t);return{isValidEndpoint:e}},__vite__mapDeps([0,1,2,3,4]));if(this._rpcEndpoint&&await r(this._rpcEndpoint,`rpc`,n,this.logger))return this._rpcEndpoint;let{getFastestEndpoint:i}=await g(async()=>{let{getFastestEndpoint:e}=await import(`./utils-14NfwrBn.js`).then(e=>e.t);return{getFastestEndpoint:e}},__vite__mapDeps([0,1,2,3,4]));return this._rpcEndpoint=await i(this.rpcEndpoints,`rpc`,this.logger),this._rpcEndpoint};getRestEndpoint=async e=>{let{getIsLazy:t}=await g(async()=>{let{getIsLazy:e}=await import(`./utils-14NfwrBn.js`).then(e=>e.t);return{getIsLazy:e}},__vite__mapDeps([0,1,2,3,4])),n=t(void 0,this.isLazy,this._restEndpoint?.isLazy,e,this.logger);if(n)return this._restEndpoint||this.restEndpoints[0]||Promise.reject(`No endpoint available.`);let r=`rest`,{isValidEndpoint:i}=await g(async()=>{let{isValidEndpoint:e}=await import(`./utils-14NfwrBn.js`).then(e=>e.t);return{isValidEndpoint:e}},__vite__mapDeps([0,1,2,3,4]));if(this._restEndpoint&&await i(this._restEndpoint,r,n,this.logger))return this._restEndpoint;let{getFastestEndpoint:a}=await g(async()=>{let{getFastestEndpoint:e}=await import(`./utils-14NfwrBn.js`).then(e=>e.t);return{getFastestEndpoint:e}},__vite__mapDeps([0,1,2,3,4]));return this._restEndpoint=await a(this.restEndpoints,r,this.logger),this._restEndpoint};getStargateClient=async()=>{let e=await this.getRpcEndpoint(),{StargateClient:t}=await g(async()=>{let{StargateClient:e}=await import(`./build-DFEPAT8y.js`).then(e=>i(e.t()));return{StargateClient:e}},__vite__mapDeps([5,1,6,7,8,9,2,3,10,4]));return t.connect(e,this.stargateOptions)};getCosmWasmClient=async()=>{let e=await this.getRpcEndpoint(),{CosmWasmClient:t}=await g(async()=>{let{CosmWasmClient:e}=await import(`./build-BPw0SHWb.js`).then(e=>i(e.default));return{CosmWasmClient:e}},__vite__mapDeps([11,1,6,7,8,9,2,3,5,10,4]));return t.connect(e)};getNameService=async()=>{let e=await this.getCosmWasmClient(),{getNameServiceRegistryFromChainName:t}=await g(async()=>{let{getNameServiceRegistryFromChainName:e}=await import(`./utils-14NfwrBn.js`).then(e=>e.t);return{getNameServiceRegistryFromChainName:e}},__vite__mapDeps([0,1,2,3,4])),n=t(this.chainName),{NameService:r}=await g(async()=>{let{NameService:e}=await import(`./name-service-D-oY_Ca5.js`).then(e=>e.t);return{NameService:e}},__vite__mapDeps([12,1]));return new r(e,n)};async initOfflineSigner(e){if(this.client===void 0)throw Error(`WalletClient is not initialized`);e&&(this.preferredSignType=e),this.offlineSigner=await this.client.getOfflineSigner(this.chainId,this.preferredSignType)}getSigningStargateClient=async()=>{let e=await this.getRpcEndpoint();this.offlineSigner||await this.initOfflineSigner();let{SigningStargateClient:t}=await g(async()=>{let{SigningStargateClient:e}=await import(`./build-DFEPAT8y.js`).then(e=>i(e.t()));return{SigningStargateClient:e}},__vite__mapDeps([5,1,6,7,8,9,2,3,10,4]));return t.connectWithSigner(e,this.offlineSigner,this.signingStargateOptions)};getSigningCosmWasmClient=async()=>{let e=await this.getRpcEndpoint();this.offlineSigner||await this.initOfflineSigner();let{SigningCosmWasmClient:t}=await g(async()=>{let{SigningCosmWasmClient:e}=await import(`./build-BPw0SHWb.js`).then(e=>i(e.default));return{SigningCosmWasmClient:e}},__vite__mapDeps([11,1,6,7,8,9,2,3,5,10,4]));return t.connectWithSigner(e,this.offlineSigner,this.signingCosmwasmOptions)};getSigningClient=async e=>{switch(e){case`stargate`:return await this.getSigningStargateClient();case`cosmwasm`:return await this.getSigningCosmWasmClient();default:return this.getSigningStargateClient()}};estimateFee=async(e,t,n,r)=>{if(!this.address)throw Error(`Address is required to estimate fee. Try connect to fetch address.`);let a;switch(t){case`stargate`:a=this.signingStargateOptions?.gasPrice;break;case`cosmwasm`:a=this.signingCosmwasmOptions?.gasPrice;break;default:a=this.signingStargateOptions?.gasPrice;break}if(!a)throw Error(`Gas price must be set in the client options when auto gas is used.`);let o=await(await this.getSigningClient(t)).simulate(this.address,e,n),{calculateFee:s}=await g(async()=>{let{calculateFee:e}=await import(`./build-DFEPAT8y.js`).then(e=>i(e.t()));return{calculateFee:e}},__vite__mapDeps([5,1,6,7,8,9,2,3,10,4]));return s(Math.round(o*(r||1.4)),a)};sign=async(e,t,n,r)=>{if(!this.address)throw Error(`Address is required to estimate fee. Try connect to fetch address.`);let i=await this.getSigningClient(r),a;return a=t===void 0||typeof t==`number`?await this.estimateFee(e,r,n,t):t,await i.sign(this.address,e,a,n||``)};broadcast=async(e,t)=>{let n=await this.getSigningClient(t),{TxRaw:r}=await g(async()=>{let{TxRaw:e}=await import(`./tx-CXZ9mGxZ.js`).then(e=>i(e.default));return{TxRaw:e}},[]),a=r.encode(e).finish(),o,s;switch(t){case`stargate`:o=this.signingStargateOptions?.broadcastTimeoutMs,s=this.signingStargateOptions?.broadcastPollIntervalMs;break;case`cosmwasm`:o=this.signingCosmwasmOptions?.broadcastTimeoutMs,s=this.signingCosmwasmOptions?.broadcastPollIntervalMs;break;default:o=this.signingStargateOptions?.broadcastTimeoutMs,s=this.signingStargateOptions?.broadcastPollIntervalMs;break}return n.broadcastTx(a,o,s)};signAndBroadcast=async(e,t,n,r)=>{let i=await this.sign(e,t,n,r);return this.broadcast(i,r)}},Kr=i(M()),qr=class extends Wr{_chainWalletMap;preferredEndpoints;ChainWallet;constructor(e,t){super(e),this.ChainWallet=t,this.emitter=new Kr.default,this.emitter.on(`broadcast_client`,e=>{this.logger?.debug(`[Event Fired] \`broadcast_client\` (${this.walletName})`),this.chainWalletMap?.forEach(t=>{t.initClientDone(e)})}),this.emitter.on(`broadcast_env`,e=>{this.logger?.debug(`[Event Fired] \`broadcast_env\` (${this.walletName})`),this.chainWalletMap?.forEach(t=>{t.setEnv(e)})}),this.emitter.on(`sync_connect`,async e=>{this.logger?.debug(`[Event Fired] \`sync_connect\` (${this.walletName})`),await this.connectAll(!0,e),this.update()}),this.emitter.on(`sync_disconnect`,async e=>{this.logger?.debug(`[Event Fired] \`sync_disconnect\` (${this.walletName})`),await this.disconnectAll(!0,e),this.reset()}),this.emitter.on(`reset`,e=>{this.logger?.debug(`[Event Fired] \`reset\` (${this.walletName})`),e.forEach(e=>Array.from(this.chainWalletMap.values()).find(t=>t.chainId===e)?.reset())})}initingClient(){this.clientMutable.state=U.Pending,this.clientMutable.message=void 0,this.clientMutable.data=void 0,this.actions?.clientState?.(U.Pending),this.actions?.clientMessage?.(void 0),this.chainWalletMap?.forEach(e=>{e.initingClient()})}initClientDone(e){this.clientMutable.data=e,this.clientMutable.state=U.Done,this.clientMutable.message=void 0,this.actions?.clientState?.(U.Done),this.actions?.clientMessage?.(void 0),this.chainWalletMap?.forEach(t=>{t.initClientDone(e)})}initClientError(e){if(this.clientMutable.message=e?.message,this.clientMutable.state=U.Error,this.actions?.clientState?.(U.Error),this.actions?.clientMessage?.(e?.message),this.chainWalletMap?.forEach(t=>{t.initClientError(e)}),this.throwErrors===!0)throw Error(this.clientMutable.message)}onSetChainsDone(){}makeFinalEndpoints(e){let t=e.name.includes(`testnet`);return{isLazy:e.preferredEndpoints?.isLazy,rpc:[...e.preferredEndpoints?.rpc||[],...this.preferredEndpoints?.[e.name]?.rpc||[],...e.chain?.apis?.rpc?.map(e=>e.address)||[],t?`https://rpc.testcosmos.directory/${e.name}`:`https://rpc.cosmos.directory/${e.name}`],rest:[...e.preferredEndpoints?.rest||[],...this.preferredEndpoints?.[e.name]?.rest||[],...e.chain?.apis?.rest?.map(e=>e.address)||[],t?`https://rest.testcosmos.directory/${e.name}`:`https://rest.cosmos.directory/${e.name}`]}}addEnpoints(e){this.getChainWalletList(!1).forEach(t=>{t.addEndpoints(e[t.chainName])})}setChains(e,t=!0){(t||!this._chainWalletMap)&&(this._chainWalletMap=new Map),e.forEach(e=>{let t=new this.ChainWallet(this.walletInfo,{...e,preferredEndpoints:this.makeFinalEndpoints(e)});t.mainWallet=this,t.emitter=this.emitter,t.logger=this.logger,t.throwErrors=this.throwErrors,t.session=this.session,t.walletConnectOptions=this.walletConnectOptions,t.initClient=this.initClient,this._chainWalletMap.set(e.name,t)}),this.onSetChainsDone()}get chainWalletMap(){return this._chainWalletMap}getChainWallet=e=>this.chainWalletMap?.get(e);getChainWalletList=(e=!0)=>{let t=Array.from(this.chainWalletMap.values());return e?t.filter(e=>e.isActive):t};getGlobalStatusAndMessage=(e=!0)=>{let t=this.getChainWalletList(e),n=t.find(e=>e.isWalletNotExist);return n?[n.walletStatus,n.message]:(n=t.find(e=>e.isWalletConnecting),n?[Cn.Connecting,void 0]:(n=t.find(e=>e.isWalletDisconnected),n?[Cn.Disconnected,`Exist disconnected wallets`]:(n=t.find(e=>e.isError||e.isWalletRejected),n?[n.walletStatus,n.message]:[Cn.Connected,void 0])))};async update(){if(this.walletStatus===`NotExist`)return window.localStorage.removeItem(`cosmos-kit@2:core//current-wallet`);this.setData(void 0),this.setMessage(void 0),this.setState(U.Done),this.activate(),this.walletName!==`cosmiframe`&&window?.localStorage.setItem(`cosmos-kit@2:core//current-wallet`,this.walletName)}reset(){this.setData(void 0),this.setMessage(void 0),this.setState(U.Init),this.inactivate()}async connectAll(e=!0,t){let n=this.getChainWalletList(e);if(!(n.length>0&&n.every(e=>e.isModeWalletConnect&&e.connectChains)))for(let e of n)e.chainName!==t&&await e.connect()}async disconnectAll(e=!0,t,n){let r=this.getChainWalletList(e);for(let e of r)e.chainName!==t&&await e.disconnect(!1,n)}},Jr=class extends Gr{constructor(e,t){super(e,t)}},Yr=class{cosmiframe;constructor(e){this.cosmiframe=e}async getSimpleAccount(...e){return await this.cosmiframe.p.getSimpleAccount(...e)}async connect(...e){return await this.cosmiframe.p.connect(...e)}async enable(...e){await this.cosmiframe.p.enable(...e)}async suggestToken(...e){await this.cosmiframe.p.suggestToken(...e)}async addChain(...e){let t=e[0];t&&`clientOptions`in t&&(t={...t,clientOptions:{}},e[0]=t),await this.cosmiframe.p.addChain(...e)}async getAccount(...e){return await this.cosmiframe.p.getAccount(...e)}getOfflineSigner(e,t){return t===`direct`?this.getOfflineSignerDirect(e):this.getOfflineSignerAmino(e)}getOfflineSignerAmino(e){return this.cosmiframe.getOfflineSignerAmino(e)}getOfflineSignerDirect(e){return this.cosmiframe.getOfflineSignerDirect(e)}async sign(...e){return await this.cosmiframe.p.sign(...e)}async signAmino(...e){return await this.cosmiframe.p.signAmino(...e)}async signDirect(...e){return await this.cosmiframe.p.signDirect(...e)}async signArbitrary(...e){return await this.cosmiframe.p.signArbitrary(...e)}async getEnigmaPubKey(...e){return await this.cosmiframe.p.getEnigmaPubKey(...e)}async getEnigmaTxEncryptionKey(...e){return await this.cosmiframe.p.getEnigmaTxEncryptionKey(...e)}async enigmaEncrypt(...e){return await this.cosmiframe.p.enigmaEncrypt(...e)}async enigmaDecrypt(...e){return await this.cosmiframe.p.enigmaDecrypt(...e)}async sendTx(...e){return await this.cosmiframe.p.sendTx(...e)}},Xr=Object.defineProperty,Zr=(e,t,n)=>t in e?Xr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qr=(e,t)=>Xr(e,`name`,{value:t,configurable:!0}),$r=(e,t,n)=>(Zr(e,typeof t==`symbol`?t:t+``,n),n),ei=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},ti=(e,t,n)=>(ei(e,t,`read from private field`),n?n.call(e):t.get(e)),ni=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},ri=(e,t,n,r)=>(ei(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),ii=class extends Error{constructor(e){super(e),this.name=`CosmiframeTimeoutError`}};Qr(ii,`CosmiframeTimeoutError`);var ai=ii,oi=Qr((e,t,n)=>new Promise((r,i)=>{let a=null,o=In(),s=Qr(({origin:e,source:n,data:c})=>{!li(t,e)||n!==window.parent||c.id!==o||(window.removeEventListener(`message`,s),a!==null&&clearTimeout(a),c.type===`success`?r({result:c.response,origin:e}):i(Error(c.error)))},`listener`);window.addEventListener(`message`,s);try{let t={...e,id:o};window.parent.postMessage(t,`*`)}catch(e){window.removeEventListener(`message`,s),i(e)}n&&(a=setTimeout(()=>{window.removeEventListener(`message`,s),i(new ai(`Timed out after ${n}ms waiting for parent to respond.`))},n))}),`callParentMethod`),si=Qr(e=>{if(!e||e.type===`error`)return{type:`error`,error:e&&e.type===`error`&&e.error||`Handled by outer wallet.`};if(e.type===`success`)return{type:`success`,response:e.value}},`processOverrideHandler`),ci=Qr(()=>typeof window<`u`&&window.self!==window.parent,`isInIframe`),li=Qr((e,t)=>e.some(e=>e===`*`||typeof e==`string`&&t===e||e instanceof RegExp&&e.test(t)),`isOriginAllowed`),ui,di=class{constructor(e,t){$r(this,`chainId`),ni(this,ui,void 0),this.chainId=e,ri(this,ui,t)}async getAccounts(){return(await oi({method:`getAccounts`,params:[],chainId:this.chainId,signerType:`direct`},ti(this,ui))).result}async signDirect(e,t){return(await oi({method:`signDirect`,params:[e,t],chainId:this.chainId,signerType:`direct`},ti(this,ui))).result}};ui=new WeakMap,Qr(di,`CosmiframeDirectSigner`);var fi=di,pi,mi=class{constructor(e,t){$r(this,`chainId`),ni(this,pi,void 0),this.chainId=e,ri(this,pi,t)}async getAccounts(){return(await oi({method:`getAccounts`,params:[],chainId:this.chainId,signerType:`amino`},ti(this,pi))).result}async signAmino(e,t){return(await oi({method:`signAmino`,params:[e,t],chainId:this.chainId,signerType:`amino`},ti(this,pi))).result}};pi=new WeakMap,Qr(mi,`CosmiframeAminoSigner`);var hi=mi,gi,_i=class{constructor(e,t){$r(this,`chainId`),ni(this,gi,void 0),this.chainId=e,ri(this,gi,t)}async getAccounts(){try{return(await oi({method:`getAccounts`,params:[],chainId:this.chainId,signerType:`amino`},ti(this,gi))).result}catch{return(await oi({method:`getAccounts`,params:[],chainId:this.chainId,signerType:`direct`},ti(this,gi))).result}}async signDirect(e,t){return(await oi({method:`signDirect`,params:[e,t],chainId:this.chainId,signerType:`direct`},ti(this,gi))).result}async signAmino(e,t){return(await oi({method:`signAmino`,params:[e,t],chainId:this.chainId,signerType:`amino`},ti(this,gi))).result}};gi=new WeakMap,Qr(_i,`CosmiframeEitherSigner`);var vi=_i,yi;(function(e){e.IsCosmiframe=`isCosmiframe`,e.GetMetadata=`getMetadata`})(yi||={});var bi,xi=class{constructor(e){if(ni(this,bi,void 0),$r(this,`p`),!e.length)throw Error(`You must explicitly allow parent origins.`);if(e.includes(`*`))throw Error("It is very unsafe to allow all origins because a controlling app has the power to manipulate messages before they are signed. If you really want to do this, pass in `UNSAFE_ALLOW_ANY_ORIGIN`.");ri(this,bi,e.includes(`UNSAFE_ALLOW_ANY_ORIGIN`)?[`*`]:[...e]),this.p=new Proxy({getEnigmaUtils:e=>({getPubkey:()=>this.p.getEnigmaPubKey(e),decrypt:(...t)=>this.p.enigmaDecrypt(e,...t),encrypt:(...t)=>this.p.enigmaEncrypt(e,...t),getTxEncryptionKey:(...t)=>this.p.getEnigmaTxEncryptionKey(e,...t)})},{get:(e,t)=>t in e&&typeof e[t]!=`function`?e[t]:(...n)=>t in e&&typeof e[t]==`function`?e[t](...n):this.callParentMethod({method:t.toString(),params:n}).then(({result:e})=>e)})}callParentMethod(e,t){return oi(e,ti(this,bi),t)}async isReady(){if(!ci())return!1;try{let{origin:e,result:t}=await this.callParentMethod({internal:!0,method:yi.IsCosmiframe,params:[]},500);return e||t}catch(e){if(e instanceof ai)return!1;throw e}}async getMetadata(){return(await this.callParentMethod({internal:!0,method:yi.GetMetadata,params:[]},500)).result}getKeplrClient(){let e=new Proxy({version:`cosmiframe`,mode:`extension`,defaultOptions:{},getOfflineSigner:this.getOfflineSigner.bind(this),getOfflineSignerOnlyAmino:this.getOfflineSignerAmino.bind(this),getOfflineSignerAuto:e=>Promise.resolve(this.getOfflineSigner(e)),getEnigmaUtils:t=>({getPubkey:()=>e.getEnigmaPubKey(t),decrypt:(...n)=>e.enigmaDecrypt(t,...n),encrypt:(...n)=>e.enigmaEncrypt(t,...n),getTxEncryptionKey:(...n)=>e.getEnigmaTxEncryptionKey(t,...n)})},{get:(e,t)=>t in e&&typeof e[t]!=`function`?e[t]:(...n)=>t in e&&typeof e[t]==`function`?e[t](...n):this.callParentMethod({method:t.toString(),params:n}).then(({result:e})=>e)});return e}getOfflineSigner(e){return new vi(e,ti(this,bi))}getOfflineSignerAmino(e){return new hi(e,ti(this,bi))}getOfflineSignerDirect(e){return new fi(e,ti(this,bi))}static listen(e){let{iframe:t,target:n,getOfflineSignerDirect:r,getOfflineSignerAmino:i,nonSignerOverrides:a,signerOverrides:o,origins:s,metadata:c}=e,l=s?.length?s:[`*`],u={[yi.IsCosmiframe]:()=>!0,[yi.GetMetadata]:()=>c||null},d=Qr(async({source:e,origin:s,data:c})=>{if(!t.contentWindow)throw Error(`Iframe contentWindow does not exist.`);if(e!==t.contentWindow||!li(l,s)||!c||typeof c!=`object`||!(`id`in c)||!(`method`in c)||!(`params`in c))return;let{id:d,params:f,chainId:p,signType:m,internal:h}=c,{method:g,signerType:_}=c;_||=m,g=g.replace(/^signer:/,``);let v;try{if(h){if(typeof u[g]!=`function`)throw Error(`Unknown internal method: ${g}`);v={type:`success`,response:await u[g](...f)}}else if(_){if(!p)throw Error(`Missing chainId in signer message request`);let e=typeof o==`function`?await o(p):o;if(e&&g in e){let t=si(await e[g](...f));t&&(v=t)}if(!v){let e=_===`direct`?await r(p):await i(p);if(!(g in e)||typeof e[g]!=`function`)throw Error(`No ${_} signer method '${g}' for chain ID '${p}'.`);v={type:`success`,response:await e[g](...f)}}}else{let e=typeof a==`function`?await a():a;if(e&&g in e){let t=si(await e[g](...f));t&&(v=t)}if(!v){if(!(g in n)||typeof n[g]!=`function`)throw Error(`No method '${g}' on target.`);v={type:`success`,response:await n[g](...f)}}}}catch(e){v={type:`error`,error:e instanceof Error?e.message:`${e}`}}t.contentWindow?.postMessage({...v,id:d},s)},`listener`);return window.addEventListener(`message`,d),()=>window.removeEventListener(`message`,d)}};bi=new WeakMap,Qr(xi,`Cosmiframe`);var Si=xi,Ci=class extends qr{constructor(e){super(e,Jr)}get walletInfo(){return this._walletInfo}async initClient(){this.initingClient();let e=new Si(this.walletInfo.allowedParentOrigins);if(!await e.isReady()){this.initClientError(Error(`Failed to detect Cosmiframe parent of allowed origin wrapping this app in an iframe.`));return}let t=await e.getMetadata();t?.name&&typeof t.name==`string`&&(this.walletInfo.prettyName=t.name),t?.imageUrl&&typeof t.imageUrl==`string`&&(this.walletInfo.logo=t.imageUrl),this.initClientDone(new Yr(e))}},wi={name:Vr,prettyName:`Cosmiframe`,logo:`data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGgKICAgIGZpbGw9IiM5MzkzOTMiCiAgICBkPSJNOC4xNCAxMC45NmMtLjA5LjMzLS4xNC42OC0uMTQgMS4wNCAwIDEuMS40NSAyLjEgMS4xNyAyLjgzbC0xLjQyIDEuNDJDNi42NyAxNS4xNiA2IDEzLjY2IDYgMTJjMC0uOTMuMjEtMS44LjU4LTIuNTlMNS4xMSA3Ljk0QzQuNCA5LjEzIDQgMTAuNTIgNCAxMmMwIDIuMjEuOSA0LjIxIDIuMzUgNS42NWwtMS40MiAxLjQyQzMuMTIgMTcuMjYgMiAxNC43NiAyIDEyYzAtMi4wNC42MS0zLjkzIDEuNjYtNS41MUwxLjM5IDQuMjIgMi44IDIuODFsMTguMzggMTguMzgtMS40MSAxLjQxTDguMTQgMTAuOTZ6bTkuMjggMy42M2MuMzctLjc5LjU4LTEuNjYuNTgtMi41OSAwLTEuNjYtLjY3LTMuMTYtMS43Ni00LjI0bC0xLjQyIDEuNDJDMTUuNTUgOS45IDE2IDEwLjkgMTYgMTJjMCAuMzYtLjA1LjcxLS4xNCAxLjA0bDEuNTYgMS41NXpNMjAgMTJjMCAxLjQ4LS40IDIuODctMS4xMSA0LjA2bDEuNDUgMS40NUMyMS4zOSAxNS45MyAyMiAxNC4wNCAyMiAxMmMwLTIuNzYtMS4xMi01LjI2LTIuOTMtNy4wN2wtMS40MiAxLjQyQzE5LjEgNy43OSAyMCA5Ljc5IDIwIDEyeiI+PC9wYXRoPgo8L3N2Zz4=`,mode:`extension`,mobileDisabled:!1,rejectMessage:{source:`Request rejected`},connectEventNamesOnWindow:[Hr],allowedParentOrigins:[]},Ti=e=>new Ci({...wi,allowedParentOrigins:e}),Ei=i(a(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.bowser=r():n.bowser=r()})(e,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,`__esModule`,{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t||4&t&&typeof e==`object`&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,`default`,{enumerable:!0,value:e}),2&t&&typeof e!=`string`)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=90)}({17:function(e,t,n){t.__esModule=!0,t.default=void 0;var r=n(18);t.default=function(){function e(){}return e.getFirstMatch=function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||``},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||``},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case`NT`:return`NT`;case`XP`:return`XP`;case`NT 5.0`:return`2000`;case`NT 5.1`:return`XP`;case`NT 5.2`:return`2003`;case`NT 6.0`:return`Vista`;case`NT 6.1`:return`7`;case`NT 6.2`:return`8`;case`NT 6.3`:return`8.1`;case`NT 10.0`:return`10`;default:return}},e.getMacOSVersionName=function(e){var t=e.split(`.`).splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),t[0]===10)switch(t[1]){case 5:return`Leopard`;case 6:return`Snow Leopard`;case 7:return`Lion`;case 8:return`Mountain Lion`;case 9:return`Mavericks`;case 10:return`Yosemite`;case 11:return`El Capitan`;case 12:return`Sierra`;case 13:return`High Sierra`;case 14:return`Mojave`;case 15:return`Catalina`;default:return}},e.getAndroidVersionName=function(e){var t=e.split(`.`).splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(t[0]===1&&t[1]<5))return t[0]===1&&t[1]<6?`Cupcake`:t[0]===1&&t[1]>=6?`Donut`:t[0]===2&&t[1]<2?`Eclair`:t[0]===2&&t[1]===2?`Froyo`:t[0]===2&&t[1]>2?`Gingerbread`:t[0]===3?`Honeycomb`:t[0]===4&&t[1]<1?`Ice Cream Sandwich`:t[0]===4&&t[1]<4?`Jelly Bean`:t[0]===4&&t[1]>=4?`KitKat`:t[0]===5?`Lollipop`:t[0]===6?`Marshmallow`:t[0]===7?`Nougat`:t[0]===8?`Oreo`:t[0]===9?`Pie`:void 0},e.getVersionPrecision=function(e){return e.split(`.`).length},e.compareVersions=function(t,n,r){r===void 0&&(r=!1);var i=e.getVersionPrecision(t),a=e.getVersionPrecision(n),o=Math.max(i,a),s=0,c=e.map([t,n],(function(t){var n=o-e.getVersionPrecision(t),r=t+Array(n+1).join(`.0`);return e.map(r.split(`.`),(function(e){return Array(20-e.length).join(`0`)+e})).reverse()}));for(r&&(s=o-Math.min(i,a)),--o;o>=s;){if(c[0][o]>c[1][o])return 1;if(c[0][o]===c[1][o]){if(o===s)return 0;--o}else if(c[0][o]<c[1][o])return-1}},e.map=function(e,t){var n,r=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)r.push(t(e[n]));return r},e.find=function(e,t){var n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){var i=e[n];if(t(i,n))return i}},e.assign=function(e){for(var t,n,r=e,i=arguments.length,a=Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];if(Object.assign)return Object.assign.apply(Object,[e].concat(a));var s=function(){var e=a[t];typeof e==`object`&&e&&Object.keys(e).forEach((function(t){r[t]=e[t]}))};for(t=0,n=a.length;t<n;t+=1)s();return e},e.getBrowserAlias=function(e){return r.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return r.BROWSER_MAP[e]||``},e}(),e.exports=t.default},18:function(e,t,n){t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":`amazon_silk`,"Android Browser":`android`,Bada:`bada`,BlackBerry:`blackberry`,Chrome:`chrome`,Chromium:`chromium`,Electron:`electron`,Epiphany:`epiphany`,Firefox:`firefox`,Focus:`focus`,Generic:`generic`,"Google Search":`google_search`,Googlebot:`googlebot`,"Internet Explorer":`ie`,"K-Meleon":`k_meleon`,Maxthon:`maxthon`,"Microsoft Edge":`edge`,"MZ Browser":`mz`,"NAVER Whale Browser":`naver`,Opera:`opera`,"Opera Coast":`opera_coast`,PhantomJS:`phantomjs`,Puffin:`puffin`,QupZilla:`qupzilla`,QQ:`qq`,QQLite:`qqlite`,Safari:`safari`,Sailfish:`sailfish`,"Samsung Internet for Android":`samsung_internet`,SeaMonkey:`seamonkey`,Sleipnir:`sleipnir`,Swing:`swing`,Tizen:`tizen`,"UC Browser":`uc`,Vivaldi:`vivaldi`,"WebOS Browser":`webos`,WeChat:`wechat`,"Yandex Browser":`yandex`,Roku:`roku`},t.BROWSER_MAP={amazon_silk:`Amazon Silk`,android:`Android Browser`,bada:`Bada`,blackberry:`BlackBerry`,chrome:`Chrome`,chromium:`Chromium`,electron:`Electron`,epiphany:`Epiphany`,firefox:`Firefox`,focus:`Focus`,generic:`Generic`,googlebot:`Googlebot`,google_search:`Google Search`,ie:`Internet Explorer`,k_meleon:`K-Meleon`,maxthon:`Maxthon`,edge:`Microsoft Edge`,mz:`MZ Browser`,naver:`NAVER Whale Browser`,opera:`Opera`,opera_coast:`Opera Coast`,phantomjs:`PhantomJS`,puffin:`Puffin`,qupzilla:`QupZilla`,qq:`QQ Browser`,qqlite:`QQ Browser Lite`,safari:`Safari`,sailfish:`Sailfish`,samsung_internet:`Samsung Internet for Android`,seamonkey:`SeaMonkey`,sleipnir:`Sleipnir`,swing:`Swing`,tizen:`Tizen`,uc:`UC Browser`,vivaldi:`Vivaldi`,webos:`WebOS Browser`,wechat:`WeChat`,yandex:`Yandex Browser`},t.PLATFORMS_MAP={tablet:`tablet`,mobile:`mobile`,desktop:`desktop`,tv:`tv`},t.OS_MAP={WindowsPhone:`Windows Phone`,Windows:`Windows`,MacOS:`macOS`,iOS:`iOS`,Android:`Android`,WebOS:`WebOS`,BlackBerry:`BlackBerry`,Bada:`Bada`,Tizen:`Tizen`,Linux:`Linux`,ChromeOS:`Chrome OS`,PlayStation4:`PlayStation 4`,Roku:`Roku`},t.ENGINE_MAP={EdgeHTML:`EdgeHTML`,Blink:`Blink`,Trident:`Trident`,Presto:`Presto`,Gecko:`Gecko`,WebKit:`WebKit`}},90:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(91))&&r.__esModule?r:{default:r},a=n(18);function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}t.default=function(){function e(){}var t,n,r;return e.getParser=function(e,t){if(t===void 0&&(t=!1),typeof e!=`string`)throw Error(`UserAgent should be a string`);return new i.default(e,t)},e.parse=function(e){return new i.default(e).getResult()},t=e,r=[{key:`BROWSER_MAP`,get:function(){return a.BROWSER_MAP}},{key:`ENGINE_MAP`,get:function(){return a.ENGINE_MAP}},{key:`OS_MAP`,get:function(){return a.OS_MAP}},{key:`PLATFORMS_MAP`,get:function(){return a.PLATFORMS_MAP}}],(n=null)&&o(t.prototype,n),r&&o(t,r),e}(),e.exports=t.default},91:function(e,t,n){t.__esModule=!0,t.default=void 0;var r=c(n(92)),i=c(n(93)),a=c(n(94)),o=c(n(95)),s=c(n(17));function c(e){return e&&e.__esModule?e:{default:e}}t.default=function(){function e(e,t){if(t===void 0&&(t=!1),e==null||e===``)throw Error(`UserAgent parameter can't be empty`);this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=s.default.find(r.default,(function(t){if(typeof t.test==`function`)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw Error(`Browser's test function is not valid`)}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||``:this.getBrowser().name||``},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=s.default.find(i.default,(function(t){if(typeof t.test==`function`)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw Error(`Browser's test function is not valid`)}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||``:t||``},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){e===void 0&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||``:t||``},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=s.default.find(a.default,(function(t){if(typeof t.test==`function`)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw Error(`Browser's test function is not valid`)}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||``:this.getEngine().name||``},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=s.default.find(o.default,(function(t){if(typeof t.test==`function`)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw Error(`Browser's test function is not valid`)}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return s.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,n={},r=0,i={},a=0;if(Object.keys(e).forEach((function(t){var o=e[t];typeof o==`string`?(i[t]=o,a+=1):typeof o==`object`&&(n[t]=o,r+=1)})),r>0){var o=Object.keys(n),c=s.default.find(o,(function(e){return t.isOS(e)}));if(c){var l=this.satisfies(n[c]);if(l!==void 0)return l}var u=s.default.find(o,(function(e){return t.isPlatform(e)}));if(u){var d=this.satisfies(n[u]);if(d!==void 0)return d}}if(a>0){var f=Object.keys(i),p=s.default.find(f,(function(e){return t.isBrowser(e,!0)}));if(p!==void 0)return this.compareVersion(i[p])}},t.isBrowser=function(e,t){t===void 0&&(t=!1);var n=this.getBrowserName().toLowerCase(),r=e.toLowerCase(),i=s.default.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n},t.compareVersion=function(e){var t=[0],n=e,r=!1,i=this.getBrowserVersion();if(typeof i==`string`)return e[0]===`>`||e[0]===`<`?(n=e.substr(1),e[1]===`=`?(r=!0,n=e.substr(2)):t=[],e[0]===`>`?t.push(1):t.push(-1)):e[0]===`=`?n=e.substr(1):e[0]===`~`&&(r=!0,n=e.substr(1)),t.indexOf(s.default.compareVersions(i,n,r))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return t===void 0&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return e===void 0&&(e=[]),e.some((function(e){return t.is(e)}))},e}(),e.exports=t.default},92:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=/version\/(\d+(\.?_?\d+)+)/i;t.default=[{test:[/googlebot/i],describe:function(e){var t={name:`Googlebot`},n=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:`Opera`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:`Opera`},n=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:`Samsung Internet for Android`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:`NAVER Whale Browser`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:`MZ Browser`},n=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:`Focus`},n=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:`Swing`},n=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:`Opera Coast`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:`Opera Touch`},n=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:`Yandex Browser`},n=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:`UC Browser`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:`Maxthon`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:`Epiphany`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:`Puffin`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:`Sleipnir`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:`K-Meleon`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:`WeChat`},n=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?`QQ Browser Lite`:`QQ Browser`},n=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:`Internet Explorer`},n=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:`Microsoft Edge`},n=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:`Microsoft Edge`},n=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:`Vivaldi`},n=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:`SeaMonkey`},n=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:`Sailfish`},n=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:`Amazon Silk`},n=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:`PhantomJS`},n=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:`SlimerJS`},n=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:`BlackBerry`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:`WebOS Browser`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:`Bada`},n=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:`Tizen`},n=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:`QupZilla`},n=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:`Firefox`},n=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:`Electron`},n=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:`Miui`},n=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:`Chromium`},n=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:`Chrome`},n=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:`Google Search`},n=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:`Android Browser`},n=i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:`PlayStation 4`},n=i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:`Safari`},n=i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=e.search(`\\(`)===-1?/^(.*)\/(.*) /:/^(.*)\/(.*)[ \t]\((.*)/;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}],e.exports=t.default},93:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=n(18);t.default=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:a.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=i.default.getWindowsVersionName(t);return{name:a.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:a.OS_MAP.iOS},n=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,`.`),n=i.default.getMacOSVersionName(t),r={name:a.OS_MAP.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,`.`);return{name:a.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=i.default.getAndroidVersionName(t),r={name:a.OS_MAP.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:a.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:a.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:a.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:a.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.PlayStation4,version:t}}}],e.exports=t.default},94:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=n(18);t.default=[{test:[/googlebot/i],describe:function(){return{type:`bot`,vendor:`Google`}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&`Nova`,n={type:a.PLATFORMS_MAP.mobile,vendor:`Huawei`};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:`Nexus`}}},{test:[/ipad/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:`Apple`,model:`iPad`}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:`Apple`,model:`iPad`}}},{test:[/kftt build/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:`Amazon`,model:`Kindle Fire HD 7`}}},{test:[/silk/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:`Amazon`}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:a.PLATFORMS_MAP.mobile,vendor:`Apple`,model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:`Nexus`}}},{test:[/[^-]mobi/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return e.getBrowserName(!0)===`blackberry`},describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:`BlackBerry`}}},{test:function(e){return e.getBrowserName(!0)===`bada`},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return e.getBrowserName()===`windows phone`},describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:`Microsoft`}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(`.`)[0]);return e.getOSName(!0)===`android`&&t>=3},describe:function(){return{type:a.PLATFORMS_MAP.tablet}}},{test:function(e){return e.getOSName(!0)===`android`},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return e.getOSName(!0)===`macos`},describe:function(){return{type:a.PLATFORMS_MAP.desktop,vendor:`Apple`}}},{test:function(e){return e.getOSName(!0)===`windows`},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return e.getOSName(!0)===`linux`},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return e.getOSName(!0)===`playstation 4`},describe:function(){return{type:a.PLATFORMS_MAP.tv}}},{test:function(e){return e.getOSName(!0)===`roku`},describe:function(){return{type:a.PLATFORMS_MAP.tv}}}],e.exports=t.default},95:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=n(18);t.default=[{test:function(e){return e.getBrowserName(!0)===`microsoft edge`},describe:function(e){if(/\sedg\//i.test(e))return{name:a.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:a.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:a.ENGINE_MAP.Trident},n=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:a.ENGINE_MAP.Presto},n=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:a.ENGINE_MAP.Gecko},n=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:a.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:a.ENGINE_MAP.WebKit},n=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}],e.exports=t.default}})}))}))());_();var Di=T(),Oi=(e,t)=>{let n=[];for(let t of e)n.push(`${t.port_id}/${t.channel_id}`);let r=`${n.join(`/`)}/${t}`;return`ibc/`+y.from(new Uint8Array(new Di.sha256().update(y.from(r)).digest())).toString(`hex`).toUpperCase()},ki=(e,t,n)=>e.find(e=>e.chain_1.chain_name===n&&e.chain_2.chain_name===t),Ai=(e,t,n)=>ki(e,t,n)||ki(e,n,t),ji=e=>e.channels.find(e=>e.chain_1.port_id===`transfer`&&e.chain_2.port_id===`transfer`),Mi=e=>e.channels.find(e=>e.chain_1.port_id.startsWith(`wasm.`)&&e.chain_2.port_id===`transfer`||e.chain_1.port_id===`transfer`&&e.chain_2.port_id.startsWith(`wasm`)),Ni=(e,t,n,r,i)=>{let a=Ai(e,t,n);if(!a)return[];let o=i.startsWith(`cw20:`)?Mi(a):ji(a);if(!o)return[];let s;s=a.chain_1.chain_name===t?o.chain_1:o.chain_2;let c=[s],l=r.find(({chain_name:e})=>e===n);if(!l)return c;let u=l.assets.find(e=>e.base===i);if(!u)return c;let d=u.traces?.filter?.(e=>e.type===`ibc`||e.type===`ibc-cw20`)??[];if(!d.length)return c;d.length;let[f]=d;return[...c,...Ni(e,n,f.counterparty.chain_name,r,f.counterparty.base_denom)]},Pi=(e,t,n,r,i)=>{let a=Ai(e,t,n);if(a){if(!(i.startsWith(`cw20:`)?Mi(a):ji(a)))return;let o=Ni(e,t,n,r,i),s=r.find(({chain_name:e})=>e===n);if(!s)return Oi(o,i);let c=s.assets.find(e=>e.base===i);return c?Oi(o,(c.traces?.find?.(e=>e.type===`ibc`))?.counterparty?.base_denom??c.base):Oi(o,i)}},Fi=(e,t,n)=>{let r=t.filter(t=>t.chain_1.chain_name===e||t.chain_2.chain_name===e).map(r=>{let i=r.chain_1.chain_name===e?`chain_2`:`chain_1`,a=r.chain_1.chain_name===e?`chain_1`:`chain_2`,o=r[i].chain_name,s=r[i],c=r[a],l=n.find(e=>e.chain_name===o);if(!l)return;let u={...l,assets:l.assets.filter(e=>!(l.chain_name===`carbon`&&e.base.startsWith(`ibc/`)))}.assets.filter(e=>!e.base.startsWith(`cw20:`)).map(r=>{let i=Pi(t,e,o,n,r.base),a={...r};return a.base=i,a.denom_units=a.denom_units.map(e=>{if(e.denom===r.base){let t={...e};return t.denom=i,t.aliases=[e.denom],t}return e}),a}),d=ji(r);if(d)return{chain:{...c,...d[a]},counterparty:{...s,...d[i]},assets:u}}).filter(Boolean).reduce((e,t)=>{e[t.chain.chain_name]=e[t.chain.chain_name]||[];let n=t.assets.map(e=>{try{return{...e,traces:[{type:`ibc`,counterparty:{channel_id:t.counterparty.channel_id,base_denom:e.denom_units[0]?.aliases?.[0]??e.denom_units[0].denom,chain_name:t.counterparty.chain_name},chain:{channel_id:t.chain.channel_id}}]}}catch{}}).filter(Boolean),r={...t,assets:n};return e[t.chain.chain_name].push(r),e},{});return Object.keys(r).map(e=>({chain_name:e,assets:r[e].reduce((e,t)=>[...e,...t.assets],[])}))},Ii=(e,t,n)=>{let r=t.filter(t=>t.chain_1.chain_name===e||t.chain_2.chain_name===e).map(r=>{let i=r.chain_1.chain_name===e?`chain_2`:`chain_1`,a=r.chain_1.chain_name===e?`chain_1`:`chain_2`,o=r[i].chain_name,s=r[i],c=r[a],l=n.find(e=>e.chain_name===o);if(!l)return;let u=l.assets.filter(e=>e.base.startsWith(`cw20:`)).map(r=>{let i=Pi(t,e,o,n,r.base),a={...r};return a.base=i,a.denom_units=a.denom_units.map(e=>{if(e.denom===r.base){let t={...e};return t.denom=i,t.aliases=[e.denom],t}return e}),a});if(!u.length)return;let d=Mi(r);if(d)return{chain:{...c,...d[a]},counterparty:{...s,...d[i]},assets:u}}).filter(Boolean).reduce((e,t)=>{let n=t;e[n.chain.chain_name]=e[n.chain.chain_name]||[];let r=n.assets.map(e=>{try{return{...e,traces:[{type:`ibc-cw20`,counterparty:{port:t.counterparty.port_id,channel_id:t.counterparty.channel_id,base_denom:e.denom_units[0]?.aliases?.[0]??e.denom_units[0].denom,chain_name:t.counterparty.chain_name},chain:{port:t.chain.port_id,channel_id:t.chain.channel_id}}]}}catch{}}).filter(Boolean),i={...t,assets:r};return e[t.chain.chain_name].push(i),e},{});return Object.keys(r).map(e=>({chain_name:e,assets:r[e].reduce((e,t)=>[...e,...t.assets],[])}))},Li=(e,t,n)=>{let r=Fi(e,t,n),i=Ii(e,t,n);return r.reduce((e,t)=>{let n=t.chain_name,r=[...t.assets],a=i.find(e=>e.chain_name===n);return a&&[].push.apply(r,a.assets),[{chain_name:n,assets:r},...e]},[])},Ri=class{chainName;fetcher;_chain;_assetList;_assetLists;_ibcData=[];constructor(e){this.chainName=e.chainName,this.fetcher=e.fetcher,this.refresh()}refresh(){this._assetList=this.fetcher.getChainAssetList(this.chainName),this._ibcData=this.fetcher.getChainIbcData(this.chainName),this._chain=this.fetcher.getChain(this.chainName);let e=this._ibcData.reduce((e,t)=>(e.includes(t.chain_1.chain_name)||e.push(t.chain_1.chain_name),e.includes(t.chain_2.chain_name)||e.push(t.chain_2.chain_name),e),[]);this._assetLists=this.fetcher.assetLists.filter(t=>e.includes(t.chain_name))}get chain(){return this._chain}get nativeAssetList(){return this._assetList}get assetLists(){return Li(this.chainName,this._ibcData,this._assetLists)}};s();function zi(e){e===``&&(e=`.`);var t=e.charAt(0)===`/`;e=Hi(e);for(var n=e.split(`/`),r=[],i=0;i<n.length;i++){var a=n[i];a!==`.`&&(a===`..`&&(t||!t&&r.length>0&&r[0]!==`..`)?r.pop():r.push(a))}if(!t&&r.length<2)switch(r.length){case 1:r[0]===``&&r.unshift(`.`);break;default:r.push(`.`)}return e=r.join(`/`),t&&e.charAt(0)!==`/`&&(e=`/`+e),e}function Bi(e,t=``){if(e===``)return e;e=zi(e);var n=e.split(`/`),r=n[n.length-1];return r===``&&n.length>1?n[n.length-2]:t.length>0&&r.substr(r.length-t.length)===t?r.substr(0,r.length-t.length):r}var Vi=RegExp(`//+`,`g`);function Hi(e){return e=e.replace(Vi,`/`),e}var Ui=i(fe()),Wi=e=>(0,Ui.default)(e).then(e=>{if(e.status>=400)throw Error(`Bad response`);return e.json()}),Gi=class{urls=[];_assetLists=[];_chains=[];_ibcData=[];chainInfoList=[];constructor(e={}){e.chains&&(this._chains=e.chains),e.assetLists&&(this._assetLists=e.assetLists),e.ibcData&&(this._ibcData=e.ibcData),e.urls&&(this.urls=e.urls)}get chains(){return this._chains}get assetLists(){return this._assetLists}get ibcData(){return this._ibcData}getChain(e){return this._chains.find(t=>t.chain_name===e)}getChainAssetList(e){return this._assetLists.find(t=>t.chain_name===e)}getGeneratedAssetLists(e){return Li(e,this._ibcData,this._assetLists)}getChainIbcData(e){return this._ibcData.filter(t=>t.chain_1.chain_name===e||t.chain_2.chain_name===e)}getChainInfo(e){let t=this.chainInfoList.find(t=>t.chainName===e);return t||(t=new Ri({chainName:e,fetcher:this}),this.chainInfoList.push(t)),t}upsertChain(e){if(!this._chains.find(t=>t.chain_name===e.chain_name&&t.network_type===e.network_type)){this._chains.push(e);return}this._chains=this._chains.map(t=>t.chain_name===e.chain_name&&t.network_type===e.network_type?e:t)}updateAssetList(e){if(!this._assetLists.find(t=>t.chain_name===e.chain_name)){this._assetLists.push(e);return}this._assetLists=this._assetLists.map(t=>t.chain_name===e.chain_name?e:t)}upsertIbcData(e){if(!this._ibcData.find(t=>t.chain_1.chain_name===e.chain_1.chain_name&&t.chain_2.chain_name===e.chain_2.chain_name)){this._ibcData.push(e);return}this._ibcData=this._ibcData.map(t=>t.chain_1.chain_name===e.chain_1.chain_name&&t.chain_2.chain_name===e.chain_2.chain_name?e:t)}update(e){if(!e.$schema)throw Error(`not a registered JSON schema type`);switch(Bi(e.$schema,`.schema.json`)){case`chain`:this.upsertChain(e);break;case`assetlist`:this.updateAssetList(e);break;case`ibc_data`:this.upsertIbcData(e);break;default:throw Error(`unknown schema type`)}this.chainInfoList.forEach(e=>{e.refresh()})}async fetch(e){let t=await Wi(e);this.update(t)}async fetchUrls(){return Promise.all(this.urls.map(e=>this.fetch(e)))}},Ki=class extends Ur{isActive=!1;chainRecord;_wallets;namespace=`cosmos`;session;repelWallet=!0;callbackOptions;fetchInfo=!1;constructor(e,t=[]){if(super(),this.chainRecord=e,this._wallets=t,this.repelWallet&&this.wallets.forEach(e=>{e.updateCallbacks({...e.callbacks,beforeConnect:async()=>{this.wallets.forEach(async t=>{!t.isWalletDisconnected&&t!==e&&await t.disconnect(!1,this.callbackOptions?.beforeConnect?.disconnect)})}})}),!this.chainRecord.chain){this.fetchInfo=!0;let t=new Gi({urls:[`https://raw.githubusercontent.com/cosmos/chain-registry/master/${e.name}/chain.json`]});t.fetchUrls().then(()=>{this.chainRecord.chain=t.getChain(e.name),this.actions?.render?.(e=>e+1)}).catch(t=>{this.chainRecord.chain=null,this.logger?.warn(`Failed to fetch chain info for chain ${e.name}: [${t.name}] ${t.message}`)})}if(!this.chainRecord.assetList){this.fetchInfo=!0;let t=new Gi({urls:[`https://raw.githubusercontent.com/cosmos/chain-registry/master/${e.name}/assetlist.json`]});t.fetchUrls().then(()=>{this.chainRecord.assetList=t.getChainAssetList(e.name)}).catch(t=>{this.chainRecord.assetList=null,this.logger?.warn(`Failed to fetch assetList info for chain ${e.name}: [${t.name}] ${t.message}`)})}this.fetchInfo&&this._wallets.forEach(e=>e.chainRecord=this.chainRecord)}setCallbackOptions(e){this.callbackOptions=e}setEnv(e){this._env=e,this.wallets.forEach(t=>t.setEnv(e))}activate(){this.isActive=!0,this.wallets.forEach(e=>e.activate())}get chainName(){return this.chainRecord.name}get chainLogo(){return this.chainRecord.assetList?.assets[0]?.logo_URIs?.svg||this.chainRecord.assetList?.assets[0]?.logo_URIs?.png||void 0}get wallets(){return this._wallets}get platformEnabledWallets(){return this.isMobile?this._wallets.filter(e=>typeof e.walletInfo.mobileDisabled==`boolean`?!e.walletInfo.mobileDisabled:!e.walletInfo.mobileDisabled()):this._wallets}get isSingleWallet(){return this.wallets.length===1}get current(){if(!this.repelWallet){this.logger.warn("when `repelWallet` is set false, `current` is always undefined.");return}return this.wallets.find(e=>!e.isWalletNotExist&&!e.isWalletDisconnected)}getWallet=e=>this.wallets.find(t=>t.walletName===e);openView=()=>{this.actions?.viewWalletRepo?.(this),this.actions?.viewOpen?.(!0)};closeView=()=>{this.actions?.viewOpen?.(!1)};connect=async(e,t=!0)=>{e?await this.getWallet(e)?.connect(t):this.openView()};disconnect=async(e,t=!0,n)=>{e?await this.getWallet(e)?.disconnect(t,n):await this.current.disconnect(t,n)};getRpcEndpoint=async e=>{for(let t of this.wallets)try{return await t.getRpcEndpoint(e)}catch(e){this.logger?.debug(`${e.name}: ${e.message}`)}return Promise.reject(`No valid RPC endpoint for chain ${this.chainName}!`)};getRestEndpoint=async e=>{for(let t of this.wallets)try{return await t.getRestEndpoint(e)}catch(e){this.logger?.debug(`${e.name}: ${e.message}`)}return Promise.reject(`No valid REST endpoint for chain ${this.chainName}!`)};getStargateClient=async()=>{for(let e of this.wallets)try{return await e.getStargateClient()}catch(e){this.logger?.debug(`${e.name}: ${e.message}`)}return Promise.reject(`Something wrong! Probably no valid RPC endpoint for chain ${this.chainName}.`)};getCosmWasmClient=async()=>{for(let e of this.wallets)try{return await e.getCosmWasmClient()}catch(e){this.logger?.debug(`${e.name}: ${e.message}`)}return Promise.reject(`Something wrong! Probably no valid RPC endpoint for chain ${this.chainName}.`)};getNameService=async()=>{for(let e of this.wallets)try{return await e.getNameService()}catch(e){this.logger?.debug(`${e.name}: ${e.message}`)}return Promise.reject(`Something wrong! Probably no valid RPC endpoint or name service is not registered for chain ${this.chainName}.`)}},qi=class extends Ur{chainRecords=[];walletRepos=[];defaultNameService=`icns`;mainWallets=[];coreEmitter;walletConnectOptions;session;repelWallet=!0;isLazy;throwErrors;subscribeConnectEvents;cosmiframeEnabled;_reconnectMap={};constructor(e,t,n,r,i=!0,a=[/^https?:\/\/localhost(:\d+)?/,/^https:\/\/(.+\.)?osmosis\.zone/,/^https:\/\/(.+\.)?daodao\.zone/,/^https:\/\/.+-da0da0\.vercel\.app/,/^https:\/\/(.+\.)?abstract\.money/],o,s,c,l,u,d){super(),this.throwErrors=r,this.subscribeConnectEvents=i,this.coreEmitter=new Kr.default,this.logger=n,s&&(this.defaultNameService=s),this.session=new kn({duration:18e5,callback:()=>{this.mainWallets.forEach(e=>e.disconnectAll(!1)),window?.localStorage.removeItem(`cosmos-kit@2:core//accounts`),window?.localStorage.removeItem(`cosmos-kit@2:core//current-wallet`)},...d}),this.walletConnectOptions=c,this.cosmiframeEnabled=ci()&&!!a?.length,t=[...this.cosmiframeEnabled?[Ti(a)]:[],...t],t.forEach(({walletName:e})=>this._reconnectMap[e]=()=>this._reconnect(e,!0)),this.init(e,o,t,c,l,u)}init(e,t,n,r,i,a){this.logger.info(`${e.length} chains and ${n.length} wallets are provided!`),this.isLazy=a?.isLazy,this.chainRecords=e.map(e=>{let n=typeof e==`string`?e:e.chain_name;return En(e,t,i,a?.endpoints?.[n],this.isLazy,this.logger)}),this.mainWallets=n.map(e=>(e.logger=this.logger,e.throwErrors=this.throwErrors,e.session=this.session,e.walletConnectOptions=this.walletConnectOptions,e?.setChains(this.chainRecords),e)),this.chainRecords.forEach((e,t)=>{let r=new Ki(e,n.map(({getChainWallet:t})=>t(e.name)));r.logger=this.logger,r.repelWallet=this.repelWallet,r.session=this.session,this.walletRepos.push(r),r.fetchInfo&&(this.chainRecords[t]=r.chainRecord)}),this.checkEndpoints(a?.endpoints)}checkEndpoints(e){Object.keys(e||{}).map(e=>{this.chainRecords.findIndex(t=>t.name===e)===-1&&this.logger?.warn(`You are providing endpointOptions with unrecognized chain NAME ${e} (NOT found such chain in ChainProvider property "chains")`)})}setWalletRepel(e){this.repelWallet=e,this.walletRepos.forEach(t=>t.repelWallet=e),window?.localStorage.setItem(`cosmos-kit@2:core//repel-wallet`,e.toString())}addEndpoints=e=>{this.mainWallets.forEach(t=>{t.addEnpoints(e)})};addChains=(e,t,n,r)=>{let i=e.map(e=>{let i=typeof e==`string`?e:e.chain_name;return En(e,t,n,r?.[i],this.isLazy,this.logger)});i.forEach(e=>{let t=this.chainRecords.findIndex(t=>t.name===e.name);t==-1?this.chainRecords.push(e):this.chainRecords[t]=e}),this.checkEndpoints(r),this.mainWallets.forEach(e=>{e.setChains(i,!1)}),i.forEach((e,t)=>{let n=new Ki(e,this.mainWallets.map(({getChainWallet:t})=>t(e.name)));n.setActions({viewOpen:this.actions?.viewOpen,viewWalletRepo:this.actions?.viewWalletRepo}),n.wallets.forEach(e=>{e.setActions({data:this.actions?.data,state:this.actions?.state,message:this.actions?.message})}),n.logger=this.logger,n.repelWallet=this.repelWallet,n.session=this.session,n.fetchInfo&&(this.chainRecords[t]=n.chainRecord);let r=this.walletRepos.findIndex(e=>e.chainName===n.chainName);r==-1?this.walletRepos.push(n):this.walletRepos[r]=n})};on=(e,t)=>{this.coreEmitter.on(e,t)};off=(e,t)=>{this.coreEmitter.off(e,t)};get activeRepos(){return this.walletRepos.filter(e=>e.isActive===!0)}getMainWallet=e=>{let t=this.mainWallets.find(t=>t.walletName===e);if(!t)throw new Tn(e);return t};getWalletRepo=e=>{let t=this.walletRepos.find(t=>t.chainName===e);if(!t)throw Error(`Chain ${e} is not provided.`);return t};getChainWallet=(e,t)=>{let n=this.getMainWallet(t).getChainWallet(e);if(!n)throw Error(`${e} is not provided!`);return n};getChainRecord=e=>{let t=this.chainRecords.find(t=>t.name===e);if(!t)throw Error(`${e} is not provided!`);return t};getChainLogo=e=>{let t=this.getChainRecord(e);return t?.assetList?.assets[0]?.logo_URIs?.svg||t?.assetList?.assets[0]?.logo_URIs?.png||void 0};getNameService=async e=>{let t;if(e)t=e;else{if(!this.defaultNameService)throw Error(`defaultNameService is undefined`);let{getNameServiceRegistryFromName:e}=await g(async()=>{let{getNameServiceRegistryFromName:e}=await import(`./utils-14NfwrBn.js`).then(e=>e.t);return{getNameServiceRegistryFromName:e}},__vite__mapDeps([0,1,2,3,4])),n=e(this.defaultNameService);if(!n)throw Error(`Unknown defaultNameService `+this.defaultNameService);t=n.chainName}return await this.getWalletRepo(t).getNameService()};_reconnect=async(e,t=!1,n)=>{t&&this.getMainWallet(e)?.isWalletDisconnected||(this.logger?.debug("[Event Emit] `refresh_connection` (manager)"),this.coreEmitter.emit(`refresh_connection`),await this.getMainWallet(e).connect(),await Promise.all(this.getMainWallet(e).getChainWalletList(!0).map((e,t)=>n?n.includes(e.chainName)?e.connect(!1):void 0:t===0?e.connect(!0):void 0)))};_restoreAccounts=async()=>{let e=this.cosmiframeEnabled?Vr:window.localStorage.getItem(`cosmos-kit@2:core//current-wallet`);if(e)try{let t=this.getMainWallet(e);t.activate();let n;if(t.clientMutable.state===U.Done){let e=window.localStorage.getItem(`cosmos-kit@2:core//accounts`);if(e&&e!==`[]`){let r=JSON.parse(e).flatMap(e=>{let n=t.getChainWalletList(!1).find(t=>t.chainRecord.chain?.chain_id===e.chainId&&t.namespace===e.namespace);return n?.activate(),t.walletInfo.mode===`wallet-connect`&&(n?.setData(e),n?.setState(U.Done)),n||[]});t.setState(U.Done);let i=r.flatMap(e=>{try{let t=this.getWalletRepo(e.chainName);return t.activate(),t.chainRecord}catch{return[]}}),a=async()=>{try{return await t.client?.enable?.(i.map(e=>e.chain.chain_id)),!0}catch(e){if(e instanceof Error&&t.rejectMatched(e))return this.logger?.error(`Failed to connect to stored chains: ${e.message}`),!1;throw e}};try{if(!await a())return}catch{for(let e of i)await t.client?.addChain?.(e);if(!await a())return}n=i.map(e=>e.name)}}t.walletInfo.mode!==`wallet-connect`&&await this._reconnect(e,void 0,n)}catch(e){if(e instanceof Tn)this.logger?.warn(e.message);else throw e}};_handleCosmiframeKeystoreChangeEvent=e=>{typeof e.data==`object`&&`event`in e.data&&e.data.event===`cosmiframe_keystorechange`&&(window.dispatchEvent(new Event(Hr)),this._reconnect(Vr))};onMounted=async()=>{if(typeof window>`u`)return;this.cosmiframeEnabled&&window.addEventListener(`message`,this._handleCosmiframeKeystoreChangeEvent);let e=Ei.default.getParser(window.navigator.userAgent),t={browser:e.getBrowserName(!0),device:e.getPlatform().type||`desktop`,os:e.getOSName(!0)};this.setEnv(t),this.walletRepos.forEach(e=>e.setEnv(t)),await Promise.all(this.mainWallets.map(async e=>{e.setEnv(t),e.emitter?.emit(`broadcast_env`,t),this.subscribeConnectEvents&&(e.walletInfo.connectEventNamesOnWindow?.forEach(t=>{window.addEventListener(t,this._reconnectMap[e.walletName]),this.logger?.debug(`Add "${t}" event listener to window`)}),e.walletInfo.connectEventNamesOnClient?.forEach(async t=>{e.client?.on?.(t,this._reconnectMap[e.walletName]),this.logger?.debug(`Add "${t}" event listener to wallet client ${e.walletPrettyName}`)})),e.walletInfo.mode===`wallet-connect`?await e.initClient(this.walletConnectOptions):await e.initClient()})),await this._restoreAccounts()};onUnmounted=()=>{typeof window>`u`||(this.cosmiframeEnabled&&window.removeEventListener(`message`,this._handleCosmiframeKeystoreChangeEvent),this.mainWallets.forEach(e=>{e.walletInfo.connectEventNamesOnWindow?.forEach(t=>{window.removeEventListener(t,this._reconnectMap[e.walletName])}),e.walletInfo.connectEventNamesOnClient?.forEach(async t=>{e.client?.off?.(t,this._reconnectMap[e.walletName])})}))}},Ji={osmosis:{rpc:[`https://rpc-osmosis.keplr.app/`],rest:[`https://lcd-osmosis.keplr.app/`]},osmosistestnet:{rpc:[`https://rpc-test.osmosis.zone/`],rest:[`https://lcd-test.osmosis.zone/`]},cosmoshub:{rpc:[`https://rpc-cosmoshub.keplr.app`],rest:[`https://lcd-cosmoshub.keplr.app`]},terra:{rpc:[`https://rpc-columbus.keplr.app`],rest:[`https://lcd-columbus.keplr.app`]},secretnetwork:{rpc:[`https://rpc-secret.keplr.app`],rest:[`https://lcd-secret.keplr.app`]},akash:{rpc:[`https://rpc-akash.keplr.app`],rest:[`https://lcd-akash.keplr.app`]},regen:{rpc:[`https://rpc-regen.keplr.app`],rest:[`https://lcd-regen.keplr.app`]},sentinel:{rpc:[`https://rpc-sentinel.keplr.app`],rest:[`https://lcd-sentinel.keplr.app`]},persistence:{rpc:[`https://rpc-persistence.keplr.app`],rest:[`https://lcd-persistence.keplr.app`]},irisnet:{rpc:[`https://rpc-iris.keplr.app`],rest:[`https://lcd-iris.keplr.app`]},cryptoorgchain:{rpc:[`https://rpc-crypto-org.keplr.app/`],rest:[`https://lcd-crypto-org.keplr.app/`]},starname:{rpc:[`https://rpc-iov.keplr.app`],rest:[`https://lcd-iov.keplr.app`]},emoney:{rpc:[`https://rpc-emoney.keplr.app`],rest:[`https://lcd-emoney.keplr.app`]},juno:{rpc:[`https://rpc-juno.itastakers.com`],rest:[`https://lcd-juno.itastakers.com`]},microtick:{rpc:[`https://rpc-microtick.keplr.app`],rest:[`https://lcd-microtick.keplr.app`]},likecoin:{rpc:[`https://mainnet-node.like.co/rpc`],rest:[`https://mainnet-node.like.co`]},impacthub:{rpc:[`https://rpc-impacthub.keplr.app`],rest:[`https://lcd-impacthub.keplr.app`]},bitcanna:{rpc:[`https://rpc.bitcanna.io`],rest:[`https://lcd.bitcanna.io`]},bitsong:{rpc:[`https://rpc.explorebitsong.com`],rest:[`https://lcd.explorebitsong.com`]},kichain:{rpc:[`https://rpc-mainnet.blockchain.ki`],rest:[`https://api-mainnet.blockchain.ki`]},panacea:{rpc:[`https://rpc.gopanacea.org`],rest:[`https://api.gopanacea.org`]},bostrom:{rpc:[`https://rpc.bostrom.cybernode.ai`],rest:[`https://lcd.bostrom.cybernode.ai`]},comdex:{rpc:[`https://rpc.comdex.one`],rest:[`https://rest.comdex.one`]},cheqd:{rpc:[`https://rpc.cheqd.net`],rest:[`https://api.cheqd.net`]},stargaze:{rpc:[`https://rpc.stargaze-apis.com`],rest:[`https://rest.stargaze-apis.com`]},chihuahua:{rpc:[`https://rpc.chihuahua.wtf`],rest:[`https://api.chihuahua.wtf`]},lumnetwork:{rpc:[`https://node0.mainnet.lum.network/rpc`],rest:[`https://node0.mainnet.lum.network/rest`]},vidulum:{rpc:[`https://mainnet-rpc.vidulum.app`],rest:[`https://mainnet-lcd.vidulum.app`]},desmos:{rpc:[`https://rpc.mainnet.desmos.network`],rest:[`https://api.mainnet.desmos.network`]},dig:{rpc:[`https://rpc-1-dig.notional.ventures`],rest:[`https://api-1-dig.notional.ventures`]},sommelier:{rpc:[`https://rpc-sommelier.keplr.app`],rest:[`https://lcd-sommelier.keplr.app`]},sifchain:{rpc:[`https://rpc.sifchain.finance`],rest:[`https://api-int.sifchain.finance`]},bandchain:{rpc:[`https://rpc.laozi3.bandchain.org`],rest:[`https://laozi1.bandchain.org/api`]},konstellation:{rpc:[`https://node1.konstellation.tech:26657`],rest:[`https://node1.konstellation.tech:1318`]},umee:{rpc:[`https://rpc.aphrodite.main.network.umee.cc`],rest:[`https://api.aphrodite.main.network.umee.cc`]},gravitybridge:{rpc:[`https://gravitychain.io:26657`],rest:[`https://gravitychain.io:1317`]},decentr:{rpc:[`https://poseidon.mainnet.decentr.xyz`],rest:[`https://rest.mainnet.decentr.xyz`]},shentu:{rpc:[`https://shenturpc.certikpowered.info`],rest:[`https://azuredragon.noopsbycertik.com`]},carbon:{rpc:[`https://tm-api.carbon.network`],rest:[`https://api.carbon.network`]},injective:{rpc:[`https://public.api.injective.network`],rest:[`https://public.lcd.injective.network`]},cerberus:{rpc:[`https://rpc.cerberus.zone:26657`],rest:[`https://api.cerberus.zone:1317`]},fetchhub:{rpc:[`https://rpc-fetchhub.fetch.ai:443`],rest:[`https://rest-fetchhub.fetch.ai`]},assetmantle:{rpc:[`https://rpc.assetmantle.one/`],rest:[`https://rest.assetmantle.one/`]},provenance:{rpc:[`https://rpc.provenance.io/`],rest:[`https://api.provenance.io`]},galaxy:{rpc:[`https://rpc.galaxychain.zone`],rest:[`https://rest.galaxychain.zone`]},meme:{rpc:[`https://rpc-meme-1.meme.sx:443`],rest:[`https://api-meme-1.meme.sx:443`]},evmos:{rpc:[`https://rpc-evmos.keplr.app/`],rest:[`https://lcd-evmos.keplr.app/`]},terra2:{rpc:[`https://rpc.terrav2.ccvalidators.com/`],rest:[`https://phoenix-lcd.terra.dev/`]},rizon:{rpc:[`https://rpcapi.rizon.world/`],rest:[`https://restapi.rizon.world/`]},kava:{rpc:[`https://rpc-kava.keplr.app`],rest:[`https://lcd-kava.keplr.app`]},genesisl1:{rpc:[`https://26657.genesisl1.org`],rest:[`https://api.genesisl1.org`]}},Yi=class extends Gr{constructor(e,t){super(e,t)}},Xi=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),Zi=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),Qi=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),$i=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),ea=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),ta=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.EIP6963EventNames=void 0,(function(e){e.Announce=`eip6963:announceProvider`,e.Request=`eip6963:requestProvider`})(e.EIP6963EventNames||={})})),na=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),ra=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),ia=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CHAIN_TYPE_TO_GENESIS_HASH=e.GENESIS_HASH_TO_CHAIN_TYPE=e.NETWORK_TO_GENESIS_HASH=e.GENESIS_HASH_TO_NETWORK=e.ChainType=e.Network=e.GenesisHash=e.BitcoinSignMessageType=void 0,(function(e){e.ECDSA=`ecdsa`,e.BIP322_SIMPLE=`bip322-simple`})(e.BitcoinSignMessageType||={});var t;(function(e){e.MAINNET=`000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f`,e.TESTNET=`000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943`,e.SIGNET=`00000008819873e925422c1ff0f99f7cc9bbb232af63a077a480a3633bee1ef6`})(t=e.GenesisHash||={});var n;(function(e){e.MAINNET=`mainnet`,e.LIVENET=`livenet`,e.TESTNET=`testnet`,e.SIGNET=`signet`})(n=e.Network||={});var r;(function(e){e.BITCOIN_MAINNET=`BITCOIN_MAINNET`,e.BITCOIN_TESTNET=`BITCOIN_TESTNET`,e.BITCOIN_SIGNET=`BITCOIN_SIGNET`})(r=e.ChainType||={}),e.GENESIS_HASH_TO_NETWORK={[t.MAINNET]:n.MAINNET,[t.TESTNET]:n.TESTNET,[t.SIGNET]:n.SIGNET},e.NETWORK_TO_GENESIS_HASH={[n.MAINNET]:t.MAINNET,[n.LIVENET]:t.MAINNET,[n.TESTNET]:t.TESTNET,[n.SIGNET]:t.SIGNET},e.GENESIS_HASH_TO_CHAIN_TYPE={[t.MAINNET]:r.BITCOIN_MAINNET,[t.TESTNET]:r.BITCOIN_TESTNET,[t.SIGNET]:r.BITCOIN_SIGNET},e.CHAIN_TYPE_TO_GENESIS_HASH={[r.BITCOIN_MAINNET]:t.MAINNET,[r.BITCOIN_TESTNET]:t.TESTNET,[r.BITCOIN_SIGNET]:t.SIGNET}})),aa=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(ea(),e),n(ta(),e),n(na(),e),n(ra(),e),n(ia(),e)})),oa=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),sa=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.EthTxStatus=e.EthSignType=void 0,(function(e){e.MESSAGE=`message`,e.TRANSACTION=`transaction`,e.EIP712=`eip-712`})(e.EthSignType||={}),(function(e){e.Success=`0x1`,e.Failure=`0x0`})(e.EthTxStatus||={})})),ca=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),la=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),ua=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),da=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),fa=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(Xi(),e),n(Zi(),e),n(Qi(),e),n($i(),e),n(aa(),e),n(oa(),e),n(sa(),e),n(ca(),e),n(la(),e),n(ua(),e),n(da(),e)})),pa=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromHex=e.toHex=void 0;function t(e){let t=``;for(let n of e)t+=(`0`+n.toString(16)).slice(-2);return t}e.toHex=t;function n(e){if(e.length%2!=0)throw Error(`hex string length must be a multiple of 2`);let t=[];for(let n=0;n<e.length;n+=2){let r=e.substr(n,2);if(!r.match(/[0-9a-f]{2}/i))throw Error(`hex string contains invalid characters`);t.push(parseInt(r,16))}return new Uint8Array(t)}e.fromHex=n})),ma=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.JSONUint8Array=void 0;var t=pa();e.JSONUint8Array=class e{static parse(e){return JSON.parse(e,(e,n)=>{if(e===`__proto__`)throw Error(`__proto__ is disallowed`);return n&&typeof n==`string`&&n.startsWith(`__uint8array__`)?(0,t.fromHex)(n.replace(`__uint8array__`,``)):typeof BigInt<`u`&&n&&typeof n==`string`&&n.startsWith(`__bigint__`)?BigInt(n.replace(`__bigint__`,``)):n})}static stringify(e){return JSON.stringify(e,(e,n)=>{if(e===`__proto__`)throw Error(`__proto__ is disallowed`);if(n&&(n instanceof Uint8Array||typeof n==`object`&&`type`in n&&`data`in n&&n.type===`Buffer`&&Array.isArray(n.data))){let e=n instanceof Uint8Array?n:new Uint8Array(n.data);return`__uint8array__${(0,t.toHex)(e)}`}return typeof n==`bigint`?`__bigint__${n.toString()}`:n})}static wrap(t){if(t!==void 0)return JSON.parse(e.stringify(t))}static unwrap(t){if(t!==void 0)return e.parse(e.stringify(t))}}})),G=a(((e,t)=>{t.exports=r;var n=null;try{n=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function r(e,t,n){this.low=e|0,this.high=t|0,this.unsigned=!!n}r.prototype.__isLong__,Object.defineProperty(r.prototype,`__isLong__`,{value:!0});function i(e){return(e&&e.__isLong__)===!0}r.isLong=i;var a={},o={};function s(e,t){var n,r,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(r=o[e],r)?r:(n=l(e,(e|0)<0?-1:0,!0),i&&(o[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(r=a[e],r)?r:(n=l(e,e<0?-1:0,!1),i&&(a[e]=n),n))}r.fromInt=s;function c(e,t){if(isNaN(e))return t?b:y;if(t){if(e<0)return b;if(e>=g)return T}else{if(e<=-_)return E;if(e+1>=_)return w}return e<0?c(-e,t).neg():l(e%h|0,e/h|0,t)}r.fromNumber=c;function l(e,t,n){return new r(e,t,n)}r.fromBits=l;var u=Math.pow;function d(e,t,n){if(e.length===0)throw Error(`empty string`);if(e===`NaN`||e===`Infinity`||e===`+Infinity`||e===`-Infinity`)return y;if(typeof t==`number`?(n=t,t=!1):t=!!t,n||=10,n<2||36<n)throw RangeError(`radix`);var r;if((r=e.indexOf(`-`))>0)throw Error(`interior hyphen`);if(r===0)return d(e.substring(1),t,n).neg();for(var i=c(u(n,8)),a=y,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),l=parseInt(e.substring(o,o+s),n);if(s<8){var f=c(u(n,s));a=a.mul(f).add(c(l))}else a=a.mul(i),a=a.add(c(l))}return a.unsigned=t,a}r.fromString=d;function f(e,t){return typeof e==`number`?c(e,t):typeof e==`string`?d(e,t):l(e.low,e.high,typeof t==`boolean`?t:e.unsigned)}r.fromValue=f;var p=65536,m=1<<24,h=p*p,g=h*h,_=g/2,v=s(m),y=s(0);r.ZERO=y;var b=s(0,!0);r.UZERO=b;var x=s(1);r.ONE=x;var S=s(1,!0);r.UONE=S;var C=s(-1);r.NEG_ONE=C;var w=l(-1,2147483647,!1);r.MAX_VALUE=w;var T=l(-1,-1,!0);r.MAX_UNSIGNED_VALUE=T;var E=l(0,-2147483648,!1);r.MIN_VALUE=E;var D=r.prototype;D.toInt=function(){return this.unsigned?this.low>>>0:this.low},D.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},D.toString=function(e){if(e||=10,e<2||36<e)throw RangeError(`radix`);if(this.isZero())return`0`;if(this.isNegative())if(this.eq(E)){var t=c(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}else return`-`+this.neg().toString(e);for(var i=c(u(e,6),this.unsigned),a=this,o=``;;){var s=a.div(i),l=(a.sub(s.mul(i)).toInt()>>>0).toString(e);if(a=s,a.isZero())return l+o;for(;l.length<6;)l=`0`+l;o=``+l+o}},D.getHighBits=function(){return this.high},D.getHighBitsUnsigned=function(){return this.high>>>0},D.getLowBits=function(){return this.low},D.getLowBitsUnsigned=function(){return this.low>>>0},D.getNumBitsAbs=function(){if(this.isNegative())return this.eq(E)?64:this.neg().getNumBitsAbs();for(var e=this.high==0?this.low:this.high,t=31;t>0&&!(e&1<<t);t--);return this.high==0?t+1:t+33},D.isZero=function(){return this.high===0&&this.low===0},D.eqz=D.isZero,D.isNegative=function(){return!this.unsigned&&this.high<0},D.isPositive=function(){return this.unsigned||this.high>=0},D.isOdd=function(){return(this.low&1)==1},D.isEven=function(){return(this.low&1)==0},D.equals=function(e){return i(e)||(e=f(e)),this.unsigned!==e.unsigned&&this.high>>>31==1&&e.high>>>31==1?!1:this.high===e.high&&this.low===e.low},D.eq=D.equals,D.notEquals=function(e){return!this.eq(e)},D.neq=D.notEquals,D.ne=D.notEquals,D.lessThan=function(e){return this.comp(e)<0},D.lt=D.lessThan,D.lessThanOrEqual=function(e){return this.comp(e)<=0},D.lte=D.lessThanOrEqual,D.le=D.lessThanOrEqual,D.greaterThan=function(e){return this.comp(e)>0},D.gt=D.greaterThan,D.greaterThanOrEqual=function(e){return this.comp(e)>=0},D.gte=D.greaterThanOrEqual,D.ge=D.greaterThanOrEqual,D.compare=function(e){if(i(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},D.comp=D.compare,D.negate=function(){return!this.unsigned&&this.eq(E)?E:this.not().add(x)},D.neg=D.negate,D.add=function(e){i(e)||(e=f(e));var t=this.high>>>16,n=this.high&65535,r=this.low>>>16,a=this.low&65535,o=e.high>>>16,s=e.high&65535,c=e.low>>>16,u=e.low&65535,d=0,p=0,m=0,h=0;return h+=a+u,m+=h>>>16,h&=65535,m+=r+c,p+=m>>>16,m&=65535,p+=n+s,d+=p>>>16,p&=65535,d+=t+o,d&=65535,l(m<<16|h,d<<16|p,this.unsigned)},D.subtract=function(e){return i(e)||(e=f(e)),this.add(e.neg())},D.sub=D.subtract,D.multiply=function(e){if(this.isZero())return y;if(i(e)||(e=f(e)),n)return l(n.mul(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned);if(e.isZero())return y;if(this.eq(E))return e.isOdd()?E:y;if(e.eq(E))return this.isOdd()?E:y;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(v)&&e.lt(v))return c(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,r=this.high&65535,a=this.low>>>16,o=this.low&65535,s=e.high>>>16,u=e.high&65535,d=e.low>>>16,p=e.low&65535,m=0,h=0,g=0,_=0;return _+=o*p,g+=_>>>16,_&=65535,g+=a*p,h+=g>>>16,g&=65535,g+=o*d,h+=g>>>16,g&=65535,h+=r*p,m+=h>>>16,h&=65535,h+=a*d,m+=h>>>16,h&=65535,h+=o*u,m+=h>>>16,h&=65535,m+=t*p+r*d+a*u+o*s,m&=65535,l(g<<16|_,m<<16|h,this.unsigned)},D.mul=D.multiply,D.divide=function(e){if(i(e)||(e=f(e)),e.isZero())throw Error(`division by zero`);if(n)return!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1?this:l((this.unsigned?n.div_u:n.div_s)(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned);if(this.isZero())return this.unsigned?b:y;var t,r,a;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return b;if(e.gt(this.shru(1)))return S;a=b}else{if(this.eq(E))return e.eq(x)||e.eq(C)?E:e.eq(E)?x:(t=this.shr(1).div(e).shl(1),t.eq(y)?e.isNegative()?x:C:(r=this.sub(e.mul(t)),a=t.add(r.div(e)),a));if(e.eq(E))return this.unsigned?b:y;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=y}for(r=this;r.gte(e);){t=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(t)/Math.LN2),s=o<=48?1:u(2,o-48),d=c(t),p=d.mul(e);p.isNegative()||p.gt(r);)t-=s,d=c(t,this.unsigned),p=d.mul(e);d.isZero()&&(d=x),a=a.add(d),r=r.sub(p)}return a},D.div=D.divide,D.modulo=function(e){return i(e)||(e=f(e)),n?l((this.unsigned?n.rem_u:n.rem_s)(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},D.mod=D.modulo,D.rem=D.modulo,D.not=function(){return l(~this.low,~this.high,this.unsigned)},D.and=function(e){return i(e)||(e=f(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},D.or=function(e){return i(e)||(e=f(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},D.xor=function(e){return i(e)||(e=f(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},D.shiftLeft=function(e){return i(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):l(0,this.low<<e-32,this.unsigned)},D.shl=D.shiftLeft,D.shiftRight=function(e){return i(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},D.shr=D.shiftRight,D.shiftRightUnsigned=function(e){if(i(e)&&(e=e.toInt()),e&=63,e===0)return this;var t=this.high;if(e<32){var n=this.low;return l(n>>>e|t<<32-e,t>>>e,this.unsigned)}else if(e===32)return l(t,0,this.unsigned);else return l(t>>>e-32,0,this.unsigned)},D.shru=D.shiftRightUnsigned,D.shr_u=D.shiftRightUnsigned,D.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},D.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},D.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},D.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},D.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]},r.fromBytes=function(e,t,n){return n?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}})),ha=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.CosmJSOfflineSigner=e.CosmJSOfflineSignerOnlyAmino=void 0;var n=class{constructor(e,t,n){this.chainId=e,this.keplr=t,this.signOptions=n}getAccounts(){return t(this,void 0,void 0,function*(){let e=yield this.keplr.getKey(this.chainId);return[{address:e.bech32Address,algo:`secp256k1`,pubkey:e.pubKey}]})}signAmino(e,n){return t(this,void 0,void 0,function*(){if(this.chainId!==n.chain_id)throw Error(`Unmatched chain id with the offline signer`);if((yield this.keplr.getKey(n.chain_id)).bech32Address!==e)throw Error(`Unknown signer address`);return yield this.keplr.signAmino(this.chainId,e,n,this.signOptions)})}sign(e,n){return t(this,void 0,void 0,function*(){return yield this.signAmino(e,n)})}};e.CosmJSOfflineSignerOnlyAmino=n,e.CosmJSOfflineSigner=class extends n{constructor(e,t,n){super(e,t,n)}signDirect(e,n){return t(this,void 0,void 0,function*(){if(this.chainId!==n.chainId)throw Error(`Unmatched chain id with the offline signer`);if((yield this.keplr.getKey(n.chainId)).bech32Address!==e)throw Error(`Unknown signer address`);return yield this.keplr.signDirect(this.chainId,e,n,this.signOptions)})}}})),ga=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.KeplrEnigmaUtils=void 0,e.KeplrEnigmaUtils=class{constructor(e,t){this.chainId=e,this.keplr=t}getPubkey(){return t(this,void 0,void 0,function*(){return yield this.keplr.getEnigmaPubKey(this.chainId)})}getTxEncryptionKey(e){return t(this,void 0,void 0,function*(){return yield this.keplr.getEnigmaTxEncryptionKey(this.chainId,e)})}encrypt(e,n){return t(this,void 0,void 0,function*(){return yield this.keplr.enigmaEncrypt(this.chainId,e,n)})}decrypt(e,n){return t(this,void 0,void 0,function*(){return yield this.keplr.enigmaDecrypt(this.chainId,e,n)})}}})),_a=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BUILD_VERSION=void 0,e.BUILD_VERSION=`0.12.313`})),va=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.metaId=e.KeplrLogoBase64=void 0,e.KeplrLogoBase64=`iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAACPfSURBVHgBzV0L0B9VdT9nvy/vB6nVOg4GEx/VER3A1iqo9aMzFgWtoOhgsYaHYNV2lNEqxAdfmKHTakuDTge1FJK2tqOtGqoWFWti8TFSxGDriFSbIK+qgB95h+Tb09397+49r3t3/99/LT0zm//e9917fud3zr27SRB+EbKd1gAcOhFg/kSYmjoBiJ4JhMsB6LHFJetS+wfoAowOQOKnumGVUfSX+23Ba0uRfFaGsh6pNKDqP2PzQN5TbNxqjAeqi2CuWLuvAuU74eT1O+AXIAhDSaX0g+fBFL6ymHShfFhT5RvdknNLzsTIb+cChmzb2OJqJY8aQG9gaAUXaXLbOH0gL4mXmXHC/HYUv1thEWyDk9bPwQAyOQC2H1wHGb29uNtQdLcmFJBv2AsFAPVQJDQPlFBYFACpso7+kFm17g/9sUgr3QFWNI3VtQWO0KaCGXbDBLJwAFSKz2cLjtvglhNFGmr6NomgxEQdT1kYK8N0uzBwH3bosHJo3EKkD1ZG0X6ctAFEW6cAAiwYCAsDwM2HL4e8tHpa45a7NN2UUaxBmFAPmpdt+rGDq0zdrpP2I6yRig06ANHNHuAwjxlzFp67fhOMKeMBoLT6Kby+GHMGmklySVosJAO+ajK9LX6Uxl51eyqZp/tYvVcPbRklynQ7au913aaeBwLRz+6CDU4dhw2yvhVh++EzIcPvBOXXc+SXJz3LMVYeEblOYxKZMx/kF4V70aZPv+q+7ceUmaivHTu0hDSWqzwRWa4rAsTtcOuuM6Gn9APAzYfeVszsM8UAazoVCgDj1DELneqrBgrq/ilyKUFwFE2R8cX8UABD1OmaOx87pkw137gxoP9ssq91xfUZ+Pddl0MP6QbAVwt/Pw+boY+MCQzsquNY6VhCHUoGNeY4fUKjVLR9JdIC8IkxkTrqkerVPsNsHxCk17RUPtFstJw6tE2RfNAPl35Cs7XrSHcGhWPHADBWIJj25XJ8ipbJcUmlZR01Fs+bh0vg+eujBhwHQOnzoaD9pFAi25ZhD2XzPKmHNAAQyC/zHbCelFNGicBPpxP8jZFA0El37xyaHA8oqm8uBGfB89Zv84p8AJTRPuD24m4dpKSLAdhPPGKv8wx4+1l8dO/vtVWL1PvQKMIIxOtFo3VKKy9y4JNmkboflef2N5K5gglO8nYHfgxAhfJHwQQkL9EmXgfHqNcnLkBSwWAPEUFfrG3Xs6k8b+dg66N6RpS7DNMvAp+vwTXrB2Lt7dqugWm4HhyxANhe+P2U5fcBQy0mYh+nntOmL0BcoMREK8vNr8uiCgnKkAEixIO5Zo41IOKKrgPNWFvw1liuVDWHvNi+f/NHs6BErmdJ/Tnugt5Clhl5mVPdUnCkLnMhfVwC8hUz5c69qifm4vYBLrWT285Jq7aUdAOM4ut02ycAkLECilgGb1+1naNcugLJAPPF1iFlid7FxmjH6VO3R99d2zdOwa2k+gNpNVGGcObc5vPRExZvKFwxjahLil1olGf7qd0DgWIXjM+5Hbusg2syxMvVU9RSWv/R/tbvWyUflMZoQ9YwE6vfhxHK1ensy3HC6FlypG56ixZnBDJ1bf/2OwPeU8Qyeh6n5kDrGxZoGSA7CrMiqPEubjFdF5tTnzbGkrkoy+L5HgslGSbyPG4QR85YTp7PABi10sbqTTBIym8T2jnpvsV8EEwQ6EhG8Ha+ZtXHHHjk8M+hr1D7R1TQK1ftumIAtI1Nuo+Vpw+GAHod8rR5qXSqX5mOWzixcpanrIM8RhL9yP6UzM0fLljg1PVzIwY4cujMTovuQBVQD2tnc+zy2ynG6NoGdjJBbO5QWxdoa4aoj9fHwl46jIMBX6Tqt8+j/DwEixcswNsTJNYSwxVkzaIlcF55UwEAc9wwFgA8ZUQnYOt2AcN1b4mybvCh7IN6UH8zLx2ggVcnnY66BqpnxdcILDCaZ3Dn3/RK/nNJAGN7EUy9slkTwBsPeXZhJE3JuoicNn47jJhllwvoVe5RuaJ5Mz7avgCHTZutnBqzy0U0eXblKGIlRuaOHMnXT8ONB2d6Bo+9JeaeTJ2By9pyXslbQ8RRAUU6oI68sdOlpkikkSQIRxoPL4dadmgUSqHzURH5ukaOiqQS1kxPw4nTWfkFL/WDTEr6xR5xBY6v9NGqoFeJEu08BdcrHoDLFr7KQ9np2Glv/EKRSAYoCJQED0GDX2Q5wOYKajAuoW55N5UXAKA8m1mI+jvbUL+6CwGEKFdKQlHDmYRrNWBAgYMzAbZWG5IIZIASGpGTZ+eFdXEPGsf6yZs1wEUnTBeJYzrbmZyOwWgMBRZy7YlL4A1rp2Eh8m8PzsNp39yfrOMqE5i76FK0l1d0+tHjV8Hrj10KQ8h39x2Bk2/5WRisZCQ2HrXKU7GCmKDM6SpCmC9cQA7rus25n3TFEgMNY8U8mErEXIK2UOZvEdK0vvEpKwZT/l2H5uGc2x8S7KDHQzFPaDOC21LlvDCqF1xTmt06sX1JAMk0h8nqDAaICOOgp2BWiB20GZvfZU9bARufuhyGkFL5p9/6INx9KHdezTb7EwfhdQxAKV9LXqaQddOdf3Uu0ndKMIEet58eYIsKBeuIWT7P8sow0UazxGW/unw45R8slP/tB+HHxW87mAoMUbOBmZ4T/Y4h0ykAjSPj+Pxx23aOrQOvUmKgAMdVeaxXBwicJc5duwQ2Pm0Y5T98lODlheXfUyi/sXxyqF9s/2KULgJhgLRPlDKNOSxIJqJ/VGUTMIDxgaQsGsaZq7Q03u7Zx0zDNSesgiGkVP4ZtxSWfyAHHnsYP68WBhNl4NQEVZMzc3M3PZSv71O3nYAecxIXULdHM5Zfry1DVpHS8z5u+RR8/uTOzVJvOffbP4fv7Tka37K2WU5+m9Of+jFxNz3pKeBCqX9S2hd9eXSfGqu1NpTbKrS3xy2fhs+dshqOWTTMjN/63T3w9QcfsSwIvrI9RWOPOn3FBoEdgj0QM57SaTIwELjbz9Y1CDfgLzKKotFN2efaFVPwuResLkDQ/2/QpWTj9/bCP9x9UG4x7UwgrsT+9E88Va0DgbfJmx4jXpAt3WETZThem7HEYYCkwgnc7TLPO2YxwudeOJzy//TO/fDRXQeqIcLcmoHNDE0ZueWx9s7alm8BHYabyAXELDpeFmk3qRsa0wWkqLdRzmdfdMxgyv/AD/bDBwsA8LDDzmYhjFDXEeBN1FUgL2V6nMVfqL+vymI0HWPDvlK6gJx3qG4JBPLdOSj5y+euLKL+KRhCKuXfsb+eQ+phVZlQFgoqT0vsYcnNMjFAWslxIupL8UNbP+/DuoDE+CY+GMm7j18Gr3vSYhhCPvajg/Bn39+/YIvXRI9Obuvr2fOknILGz1guIAkOitdDb2ToZpQ+gqxrFJEPq2OsyVJ++QDvKpT/rmcugyHkE3cdgvfdvq+w/BBUsgFHWzyMW7ws8IHbMoMoGy+oFgzQ2/r1AkdamMlBhDUmdQEx9xJJe2UXP31pBYAh5BsPHIG33bqX+fwI9VcgAIguQKVQC4aktH0mK7V3CwsCo0EXQ2sPl4A0iebNsGYMce9F/rWc8+QlcOVJwxzxfm9uHs7/+sMOKBNb0Ja71cKaJrVyqWMr1rms4el7BoHUL6p3wJqyxDZvoF2ATuvAS4OgzH72L0/Blc8ZxvLv3p/Dq3fMwd4jsfUKGvLjIzU5cpuCH9WS2vz3k+4gMNKZmx1jBow9sGy3YMnB3eM2/jIGwrUrM9j6opWweoBTvlL5Z29/GPYeptbvV2M5oAuTJVtu6tQZ3ikOF17f61MUBul2AWQjUlccJccUjBEqXpDUMYAOsqIgqBf3uJUIn3nJquK0b/K9fqn813zlYbh3/zx7nsaeO/bwVRWKzlvWg3jMYILM2GgouhrvbWDKr8diRHTyqudldDEBA3Dl60+/YiA4rrD8T79k5WDKf+2/KuXrSL2OzsEtr6HClIuReiEvZjYUtf5Yi44YgEwSI/Vic9KBHjpbtElZoF1bh/Kb8Zo6q4sj3utnVlT0P6nsKXz9a7/8MNyzb/RaF1Nb3fYolsRcRb0u6mfZsnM1mhc7RCTxMigR+EWsWhUn66EpmEB4n6RcDFusMvtDL1wOz3rM5Kd8lfJvKix/b171G+iVfV6uwc7+hORxjZ/y2k26hNYFJIIC36ezQxVj3Y5FMCsQljuBYP1dBbbjgutTr3j+MnjpcYtgCLlo+174/oPz7nd8Md9vlOvRvicC1F3BHiWTuotpo8y+lBz17baOuCWHIYaIATzLZ+l3PGcpXHT8EhhC3vn1/fCt+4+MLF8xdgAitidzdcpnBU37VP+BDnNG1lNm9tAea1MwQI/V96iM2j9kFTYzTET/VXpCy9f9mMOeOv8dv7a0AsAQcsUtB+BT/3UYmtM9d0wBCt/3G8OJWQ7PoQ7r9PrukM6DID53t8wJUPSzSLTKv7SZ6r+XlG35OQDJeV307MUVAIaQq79zELb85yFBx9jhkxF4XT5pv36b79I7hngnsRGId2wXeox3AayOg2jZ3qe9NOoXLsiBxeZ52vpFsOmUYU75rr7tYAWACtA84FV/d6/ZiiaftfmXP7hleOuRUmaXtWtdu9ba4xzAt/IIgiMTEqDRwdoA4sUAzyqOeDfPDKf8D912cOTzXcrn/5SL3RLz8wkNDLHArnVTXNkOQHoDopZ+L4NUoOi5q0AK4UmNFXj5zQNOIDoGWLsqg2tftgJWL5mcYq7/j8Pw4VsPyrknAk7sEfwhv0kCo+4PIK3sCbbWvT8KxWYkPQEFDr5Ioh6SzUfmRhYq5ZB5mFep/E+eWZzyrZpc+Z/6wSNw5TcOmICPK5UrQdO8LjfH5R7tq/VzrR57Wjp248EFAEZHBp+2sQuNZA5kmroY67OntBZZXE88plD+WYXyV0+u/HKPf+lX9tf/hg60IBBKM0qH5FYU2bt6Ga+Q7ENXaOqxcUU+RMSNA6TEXYBAIEVHCdbAKK8pY/my7uhmcjXV/RYgXr0U4dozVgym/Ndv2xuOqVvF1kzAx3Zjgjgz+FtVBxie23DcgJOMZzq69oNAdFpRpLhRpqH80BxVQ5zAZxmprf+q314Gxz9u8vP98mj39z69F/YVr3UzV3HsX/5Cct2BOYl0QCHSAO62D2MKj+QDqDFNphX/HIBsD+gkRgMpCxeKl44sgITES5pJdwOXzyyF054y+RHvvXtq5R+i4JoSikT2Sdc4ls/7AkgDw+tL5IsOrIi+HVExgKVx25NUZJXWflDeKP9PJg8mAMDJa6eqa1Iplf+GT+2F+/bkYlGxy7qhiQ9AKCpm+e5a6TYAFgiNLaWAwCcVEV083ee7PI9SxL+pKw291a4J/PjHJej3+2hIpfx/rJWP2u+Dq1hUAPHKYuWectHz95ohmnyAxOt3nQFJSW4DvUFa6zZ5jdhPoMVJnWEFGuxAaCGyp/D1Gz7JLF9t9bjiW4tnrBVYQIqXj2OUJ9Ns/FT9UC+OgvRBkLZstRuwL3sUMJyI37iDR1v5nyiUP1e/0/don8Ac77b1HIYw7Vm5Trf16zw3Jqg7cllAVJaCrJ5fOJL4OUCkN49iWlZwJsb/QUSJ9kS88X8k77nxAPzgJ/PGvyOApG6eX2Y0ZcyHx2IFnQaQykHzKhj6uwMAP45ICgpg9NoGJg9/qP3D+RKHVD0Ir0b5xB8FFii/3r3jf45WZwiefxfWD5D09a2ylQFYJkD/lbhj+bFX596HIcbae4Oh/MeiSwCoC+ehOl4dXaq83raN8qm6qkWkum19VS9F2nqhHa/flj8KAFhVvCfY8rpVcOzqrJpDVs8nq+fE58fvm3q6LMtZ+ypd/8PMObtYm0zUleNnTV7RJiN5NX1lug/TNugCKX6FD0I0XLR/Nwl1IoaqTPh6aJnC97OPAgIKObY4Ov7wq1bCBX8/2vsLyua/nrU7ZdzCOXUbt8AeV7AF4Ni7gSrfNXXGEInlzaqOaut1Lb2x3PaqmYFknbYNYw3OAMgYAdu6MGIEePTk6Y+fgut+d1X15jBlKfwKLIDqitfNTFsYWXRj2YRifQwLGUu2rICCLSRDGJZoruiDardQKT0ovqH7AJYRMCTdw0jBRKG+6P/R3QI2UoLg2nNXVZ+Me/Ru6D8HV+GZqhdLY94oXbqczOmrAUqj6Ky9wKX+Biyesl2AejGAVToJpQsrdhTfx+pFjPD/BARXnb0y6ddDmVQAt9A4CLiF2jqZUlxbt7LuiDUbhTuxQtclqZ7EFVN6UHRQPHDFp6zeAwUsXO64fx6+f/88DCG//qRpmH3FingQSMFydVnMelv3kPt1Mt13zkDCrTfX1uwFh77VZ6kL60geGmW2SrRKh1ZxdX2+EMzqgS2Asfq2HiubgAH2FMHbH358P9z78xyGkFecsBhmf2eFQ//oAEJZsirLcnQZRLKDVbi2+Ma6W4t2ACKAwi8OQkIDnGgMwJXeBnQ0UiJnAREcEsn8PFg9VzaqsknjgPsemofzrt07GAheXoDg8lesgNjauL7U/MYBwxnFA4Z2N0gWSJnDKC1QuILreIFfgrmiMYB4QMkQyJQIudoViLYUKJ9NPjBFzQiTSN3vfQ/lcP6AIDjjxMXwxt9c5isuB0PPoUzuCDKKW73IF+5EKY8snTcMk+UIOr7IHHCaqwEEKL/fXto1kKN4kooP9yRcBOigESQoJpEqfqjHvv/BHC74WHG2PxAI3jizFN744hoE4ARtpC8UytTKDb4bbKDYKLTD/4vtn1Kmr/AI9bcuIMEAMuADq/hcKr5hA7sbgPb8AEw+THwQxK3y/oIJLhwQBBcWILhwZpmlaQDDbD6FB+WiVm4uleqCh7T/t0wQ+mt2DfJswmOFpAuoJj8PMuBzjoa14jkbiLgh4iJaMMEE4ix6yQSX/M0+2Nvvf8PrlAsKEJRXbHdQLS4gWKrnQZhVbuMyLBMEV4COq8hUfCAOkhQr6CNhuwtw6B+aq6Z/swVkwDCgYFRv3EDbnkLw1/Q7gQj3U4995z1H4eKP7B0MBOefurS6hPVQ3OJH1tVY97juAMUOQlpveMfgsgCrZ+g+V+8mmnMA7xI+us3jAJFlwbrDwZBemPZUkEAywaQAaINNuRO5896j8KZr9gwGgvMKAJw3sxQs7aNRBDr5zfsDz2K5xWdkAWb8PmmLtkfBaOo4l97zy32+WlhB7aBiAgpRPXGrp+BCCMwZwKT/VFz7QiaXTNMo6M575+GqGw7AULLht5bC2ScvERQe/LwCgYkDwFV8AIV1IXrHIGMIeXCURRSOFGeF6DeB3jvm8L6awLwbbxO1IpDi79Rrv88/rVqwKOtqxuFf4Hz+lsNV3vvPWQFDyFtOXwb7DxLcdNsjclwIz1jFBM380CsPec1bRPkmEsX3EqFMfQdQj1Gl1bcCqdiqKRt9ENIRhYlPt7gy63RYeFIgYACpG9h8GMAFKCWwqxnjXwoQlD75vQOB4I9evbwa98u3HbEgYArwlOoqGqSSuUq08k1Z8wdZVXaotvx7ARRVgPtRaGPFlYRTPPcLWoKAFNbOWsGEboDCLyI4ChldJRM84ZcyuPC0Yf7W8DvPXl6A6iB8+duP+B+PAgchGoYSytfMIfItSMI9CmPUdUDUtyVj/YcRozIydc1XsvyvSCtAhIVijDCJ/gmES0GS8x39/f2Qvu4Lo7/pe8FAIHjTy5fCrvvmYdf981bxag58vaq/VAJ6DR2GwKBgzRyhTp0v1hE7rb8sN+8C+Nl+CN5U9C+2exBe9DSBIIA5OWy2Z+L7AD7egoVE0Kd3MPyVdpN3/Y0H4fovHoQhZMVShD+5eAU85QlTIZKv14ef3aMO3kgHfF4gh87BUNgpiLMBE+SpMckPDjPgR778DEAp0L4QIrGft9E/2F0EA5moN4FUFuPswVGN1cydg2DLF4YDwR9ftAKe3IIAROQtlQRW+Y1CnQMgpLB70DsFAYhcbTnNhe6VgTr4QXbxMv5CSCyuOCCSdTWrCOXzwyeYQJwxtNXJvADaLQUItt44EAiWIVx5cQCBVnQzPn9LGBSrLdwHiGYC8W0Ce2bzIanaRsqTQHVUKA6EnPyWEbhbiB3wcErWboIrblIhClSfx6xf543qlwD44i2PwBBSguDSDcvgV4pAs6F1CQKb1m8BAzBip4XOsS8HRf1hiKdwvRajgyClcO9wJ5z1M0bglt+Ape2HjJsQ4NBtJwSBfDAC8ckZgXNULK8P/N0++NJAICiVf8XvL69+o0xAMYrW1oxuHXtSKNmAuxOPETgzRF4Hg/kuwGUEQanE3AUYyvfoH5irmESQHMYhAP1No11gaOf7wb/dBzd9azgQbHrzcni8AAE6vtuCI+4KGDu0v5HXx8S/J9Ag0i6gUaa6+CLqKF+k2Y7A+9QLybbnjDGY8sm3LB6feGXBHQB85J/2w3/fM8z3hY8rlH/5m2NM4LgCBxwyKPR3ArZfZweQg/92MHd2AeaNoFIoGAVDS/tim9fSv1YEmLyJ4wBHuT4o1GtrVbb/AMG7rt4zHAgeg/D+N6fdgWUCT9mJdC4BYdmAMYL7QQhJWnQ/BqnuLUBQvDACNx7gfr/px7y9m1AaBRrQUowVKFJGcKAAwaWbhwXBe9/CQeBTsssE0AUGSCievx2044W3gWLhyFI8W9SUu/B//X5MX0NI2SfUDwksluFj1L8tG2hg1HXKFz1Xfmwv/OShHIaQEgTveesyWLlMWXvzbsADI3QEgDCqk0HcDRhXQDYYzbQC2rNzT8kqyPKULH99cBhWmEQobukcCLbMAUEe8n76QA7v+Ys98NMHhwHBYwsQXFaAoDw0atY46grAugV7VuDFDd5BkWQY831g6xdzbalkYwLQ0T65jBC7tCsRY00g2DGmPgrWtN+CEzgQAH5WgOC9m4cDwXHHZnDpHywdgUAoawSKkVVbKpdWa1nD21FkAhTy7IAbo38OIBTmpzllBn9PCTYg8W2gYJIJpH351GHt0IJPPhN/Bg2KBgTvK5jgZwOC4N0tCOxcpc9mbAGS8vl2L27pum/rCvxPwtj+3rNYewIYgjmP8mOAGWQXQBHaB3DB5oOEDGB4+oECBO+/au9gIFhbgOCcVy1ulZUBRIErlaqVz+YLUMcUGJgEAngyVSfUjVI+WMv3joUTlwSBBdEg7wIgNhc+jlIsOCAweSSA8ECh/A9cs6/aJQwhp/zGFJx/7hJB+RiNA/wj5fBMXf4fAWPvBLQFxZSoF9ZjBzfqhyYPJO3za0JxT/rEAkllgqNgrvSYm7jr7nnYVDDBUCA4+XlTsOHcxc6cOX2jejaUVk/xj0hjShduwQv8YoEaZwYc81fcK2VMJFx5RBBnJRJj6zwNertLGN2XILjiz/fCUFKC4DWvXhQUCRbEbkxAUvkcIPotoa3DyooH3u1ZPTp5niLdxQa58CiYILKrmFTacSnQOTgWLhSsqB+00lUf9f2PCxB8dMtwXxqfOjMNp58+zeicWzFjBYi4AbIuhFt9iAVQX7vLfyZubqTRkbDP/UIe+xYJeT7VeaoMdV/8vv58zC1boAhKbC8KH03Vcxt9ikWj7/NI1eV56PTJ84o/bv7GI1X64vOH+V/HGwB88fPzzazDuoJe28AEIVXfI69X35G/xsVT7y6Cw/nbMWL1bcPmXm8RAaJM4ZWjYgnk/S9YSLKO+vXdQqQNYxFxD4xB2P3XChB8/JPDfFBSyssKELz0jGlh8dbaI+cCAGaL6AWGgiHy/OGseKW406VwABsQ6bRSZnpRWT1w6i5QAm0z5bDf0RheGdk0gOMinGdjc/7STYdh22cPw1Dy0tOnAgj0BZHL1LUHQ55rAMId0zngzoyU1slShvnyl6Vj4rkCYBNvZM/+HO776Xy0fUr27a8nQe0foAiwnjuNbuqfoHRFp8hA1bqFhIso/rjhnw9V9y84ZbEaPS6YSD/1aRncRPVXxsjmRz71hzz2J/rz4HmLpvKduG5m15psesmuIr3Gq9Tmad+CctHMwOoX0VlkZGlWnqGth6pepTjeDmsKFG0w5LM8Xcek2X1m8oMSwj3KOl66XYtYHQBQ9SUArLLl3yaSoOe/tsZINl2TYbZ7x/q5Auw7Y9G/jgOi9B6heoz1BX7fyPLRqR/GIvC3dqB2IHo8SrsCfWYAcm7YsQayL5AuVdM58XroUH1sO4c9KV+eBag2O8o5jf5PJMpvcM8DYLSlEucAwO75r8oX5wcQ+gvbNCetFRgBA0/LQyevPjlgIqU4smNqcLC2QnnqXgNDKpqxB0HEv7vKkuWij0h9J1+u7fzWFgB5fmRLkTmnAxyMKMSz+CgLEFtQ3Z/pvwnmNIiYYsAfpwGDzzAeOLwzgcAC4OQZxUMcCEbJntJArrWsLykf1TomlQ8g3IB3wdKpbdAAYOQG8q3tbBxlcaoW9M7y3bYAUQWio0itqFGaAiM5fcrfUE8zhQUPBwaFcfXYoMbQz9z2EQGCkzdqg37dpr+YwgEiSsZ2HVNXcQC0ZXYzzpV12/9mK4fpzRA5yxcW2Ty5dgcgT/hSCtMg8KzaWnejFP4iSS2+AA654IjRLweB159v5WT6cEHi5MVo35ajVTQHQ9sO3efyrnmETc10WgDs3vGE3QUMtoIW9RDIHyhxL3wmB4UBiV3wuHWrcYAilg2tQtH0TfLZmOW3z8jrseqBtkkCBdSCewpI5ZEcW5eDUqqpp0ACrL1mkuJ4ecvsR3B380ziP9qbh/lZ5LEAG7BdDAUE9PIBXEsWymFWaRgF4sxh5iP6CGNxANq5BK0KyoUwL48BWrCQbMfn4wJB5RlWaMvQdRVCycz6gXwlx/sAODIVrL8UAYAiFthdLObVYmYeGNRDg14MDwzk1ImAJSjOWSmlKM/ivb5QK1gwB5m6fLymHJ3n5n256+PVB3BZIZRhWDOSoNd169rmAgDDMDnRJm79AMqgGnnqi+/eXjSYMf9tCWvRDtKkEUUdrMsWknYPfrC2glRdVi+L5MfSmXfAg/WHGTwPMHIwNHrDljoQAq8viNeXOwFO8+weffp39LZ7419l61URuP/X6jQePb/4Ea6glZYOQ3r0GywWDa3ruvIXY1Zt6vboUyccJmiExwg8NhCflEFiTvwZmoS2fgLr35Xlo1fGWFNavQoKHRfguITdeARPBUdcANxRuALK6Hyehx4Q2H0zIVB5DTVDT1Dwh5V9gPXtjrjBHuhFjIHYWg9XgrwnoTTpEqxitSEZZXvP0tZBoVT3eVQ7nl/M9JLLtkjqbyT6vy3/aMdx24jwEr3OGEO/p8iExQswgO3Tt2w2XlUWwKTHG6XJmQdZVmjmq8qE8kDuNjQQBUCbbK1wXYc/k2KF6DMDuFs/DyB15U0b/xq3QUSS/932D29+4uZiDTeBY/3Jew8kGkg8EWMHSPQtWIHMYsu+nc7IB2mUaUi2bccin/lilg9OHjplmkUA4pauJew0aNNl107NQkI6/7/1H35t7SyWINCKid0n8jymAFL5dabew7t9eQN6IHRcDjptkfz+uFW7lqyUjo5yXZ9f5aFsCw6LJIwHI78EdMll16WVX0onAEq5swBBcUpwVtHtbnM6qBYee1ovn2y8rnr6SD+h3BschOLCHC3di04pbX1cXJB6Fh5bm4iSfdqHliF0//XvHOV41sbrpjZDD+kFgFLuvHn9tmxq/tQRCEA+gHgKiitIC7N+jNVXykqCBqQ7kP6QlKJ5G9uXl5e8F2mPUfw2xuJTcwMHyBwQ5SveHE/auCXu87v67yXPeOFds8XG+fK2E2STQp7HPoRo6tS/sX08r8t/Rx9moO3D1BmN2/ccoK0H3pkAqnbe3r9Jh7Lmr3G19I7+fj9jtXg5APoflMTv54qA9+rLtnRTvpbeDMDljq89qQDA/PoCclurjJTlQsQ3R9jBixMMPZtxpBWhx0LuL7kW6QpnmQgbua5Al3fWw7Y8ZZ2BBXDLI4QnLUT5vJ8FyzNmdq3DPJstrOaVxZzX8M/DpNWjYgeInvjpOpmyWvAYAsPiZq61g3P6J63bsoG1/Axi+d5p3uhhsohFC+aA0IanQbSDJrf8imvrPGSbZyP7+74yMQAaKb8tXA5TZxYdbiiumapzAQAIx8WuYiDqBlpqb8vRAoClFwYApSg256BYHwCZUOSkAJC/DAAFzcPO4u6Go5BtKRQ/BwPIYADQ8qyZXTMZZCcW+4UXF6OsyZDWFQ+8DqKKWTgAMhcI4wHAKLatE+wuCoC6LK5cDwCoACbKdxd9FgrGncUrnNtHv9M7h1I6l/8FAVO2ym5DPSIAAAAASUVORK5CYII=`,e.metaId=`d_2hxd99brRo`})),ya=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=`ffffffff-ffff-ffff-ffff-ffffffffffff`})),ba=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=`00000000-0000-0000-0000-000000000000`})),xa=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i})),Sa=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=xa();function n(e){return typeof e==`string`&&t.default.test(e)}e.default=n})),Ca=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Sa();function n(e){if(!(0,t.default)(e))throw TypeError(`Invalid UUID`);let n;return Uint8Array.of((n=parseInt(e.slice(0,8),16))>>>24,n>>>16&255,n>>>8&255,n&255,(n=parseInt(e.slice(9,13),16))>>>8,n&255,(n=parseInt(e.slice(14,18),16))>>>8,n&255,(n=parseInt(e.slice(19,23),16))>>>8,n&255,(n=parseInt(e.slice(24,36),16))/1099511627776&255,n/4294967296&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255)}e.default=n})),wa=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.unsafeStringify=void 0;var t=Sa(),n=[];for(let e=0;e<256;++e)n.push((e+256).toString(16).slice(1));function r(e,t=0){return(n[e[t+0]]+n[e[t+1]]+n[e[t+2]]+n[e[t+3]]+`-`+n[e[t+4]]+n[e[t+5]]+`-`+n[e[t+6]]+n[e[t+7]]+`-`+n[e[t+8]]+n[e[t+9]]+`-`+n[e[t+10]]+n[e[t+11]]+n[e[t+12]]+n[e[t+13]]+n[e[t+14]]+n[e[t+15]]).toLowerCase()}e.unsafeStringify=r;function i(e,n=0){let i=r(e,n);if(!(0,t.default)(i))throw TypeError(`Stringified UUID is invalid`);return i}e.default=i})),Ta=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t,n=new Uint8Array(16);function r(){if(!t){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);t=crypto.getRandomValues.bind(crypto)}return t(n)}e.default=r})),Ea=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.updateV1State=void 0;var t=Ta(),n=wa(),r={};function i(e,i,s){let c,l=e?._v6??!1;if(e){let t=Object.keys(e);t.length===1&&t[0]===`_v6`&&(e=void 0)}if(e)c=o(e.random??e.rng?.()??(0,t.default)(),e.msecs,e.nsecs,e.clockseq,e.node,i,s);else{let e=Date.now(),n=(0,t.default)();a(r,e,n),c=o(n,r.msecs,r.nsecs,l?void 0:r.clockseq,l?void 0:r.node,i,s)}return i??(0,n.unsafeStringify)(c)}function a(e,t,n){return e.msecs??=-1/0,e.nsecs??=0,t===e.msecs?(e.nsecs++,e.nsecs>=1e4&&(e.node=void 0,e.nsecs=0)):t>e.msecs?e.nsecs=0:t<e.msecs&&(e.node=void 0),e.node||(e.node=n.slice(10,16),e.node[0]|=1,e.clockseq=(n[8]<<8|n[9])&16383),e.msecs=t,e}e.updateV1State=a;function o(e,t,n,r,i,a,o=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!a)a=new Uint8Array(16),o=0;else if(o<0||o+16>a.length)throw RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);t??=Date.now(),n??=0,r??=(e[8]<<8|e[9])&16383,i??=e.slice(10,16),t+=0xb1d069b5400;let s=((t&268435455)*1e4+n)%4294967296;a[o++]=s>>>24&255,a[o++]=s>>>16&255,a[o++]=s>>>8&255,a[o++]=s&255;let c=t/4294967296*1e4&268435455;a[o++]=c>>>8&255,a[o++]=c&255,a[o++]=c>>>24&15|16,a[o++]=c>>>16&255,a[o++]=r>>>8|128,a[o++]=r&255;for(let e=0;e<6;++e)a[o++]=i[e];return a}e.default=i})),Da=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Ca(),n=wa();function r(e){let r=i(typeof e==`string`?(0,t.default)(e):e);return typeof e==`string`?(0,n.unsafeStringify)(r):r}e.default=r;function i(e){return Uint8Array.of((e[6]&15)<<4|e[7]>>4&15,(e[7]&15)<<4|(e[4]&240)>>4,(e[4]&15)<<4|(e[5]&240)>>4,(e[5]&15)<<4|(e[0]&240)>>4,(e[0]&15)<<4|(e[1]&240)>>4,(e[1]&15)<<4|(e[2]&240)>>4,96|e[2]&15,e[3],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}})),Oa=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});function t(e){return n(i(a(e),e.length*8))}function n(e){let t=new Uint8Array(e.length*4);for(let n=0;n<e.length*4;n++)t[n]=e[n>>2]>>>n%4*8&255;return t}function r(e){return(e+64>>>9<<4)+14+1}function i(e,t){let n=new Uint32Array(r(t)).fill(0);n.set(e),n[t>>5]|=128<<t%32,n[n.length-1]=t,e=n;let i=1732584193,a=-271733879,s=-1732584194,c=271733878;for(let t=0;t<e.length;t+=16){let n=i,r=a,p=s,m=c;i=l(i,a,s,c,e[t],7,-680876936),c=l(c,i,a,s,e[t+1],12,-389564586),s=l(s,c,i,a,e[t+2],17,606105819),a=l(a,s,c,i,e[t+3],22,-1044525330),i=l(i,a,s,c,e[t+4],7,-176418897),c=l(c,i,a,s,e[t+5],12,1200080426),s=l(s,c,i,a,e[t+6],17,-1473231341),a=l(a,s,c,i,e[t+7],22,-45705983),i=l(i,a,s,c,e[t+8],7,1770035416),c=l(c,i,a,s,e[t+9],12,-1958414417),s=l(s,c,i,a,e[t+10],17,-42063),a=l(a,s,c,i,e[t+11],22,-1990404162),i=l(i,a,s,c,e[t+12],7,1804603682),c=l(c,i,a,s,e[t+13],12,-40341101),s=l(s,c,i,a,e[t+14],17,-1502002290),a=l(a,s,c,i,e[t+15],22,1236535329),i=u(i,a,s,c,e[t+1],5,-165796510),c=u(c,i,a,s,e[t+6],9,-1069501632),s=u(s,c,i,a,e[t+11],14,643717713),a=u(a,s,c,i,e[t],20,-373897302),i=u(i,a,s,c,e[t+5],5,-701558691),c=u(c,i,a,s,e[t+10],9,38016083),s=u(s,c,i,a,e[t+15],14,-660478335),a=u(a,s,c,i,e[t+4],20,-405537848),i=u(i,a,s,c,e[t+9],5,568446438),c=u(c,i,a,s,e[t+14],9,-1019803690),s=u(s,c,i,a,e[t+3],14,-187363961),a=u(a,s,c,i,e[t+8],20,1163531501),i=u(i,a,s,c,e[t+13],5,-1444681467),c=u(c,i,a,s,e[t+2],9,-51403784),s=u(s,c,i,a,e[t+7],14,1735328473),a=u(a,s,c,i,e[t+12],20,-1926607734),i=d(i,a,s,c,e[t+5],4,-378558),c=d(c,i,a,s,e[t+8],11,-2022574463),s=d(s,c,i,a,e[t+11],16,1839030562),a=d(a,s,c,i,e[t+14],23,-35309556),i=d(i,a,s,c,e[t+1],4,-1530992060),c=d(c,i,a,s,e[t+4],11,1272893353),s=d(s,c,i,a,e[t+7],16,-155497632),a=d(a,s,c,i,e[t+10],23,-1094730640),i=d(i,a,s,c,e[t+13],4,681279174),c=d(c,i,a,s,e[t],11,-358537222),s=d(s,c,i,a,e[t+3],16,-722521979),a=d(a,s,c,i,e[t+6],23,76029189),i=d(i,a,s,c,e[t+9],4,-640364487),c=d(c,i,a,s,e[t+12],11,-421815835),s=d(s,c,i,a,e[t+15],16,530742520),a=d(a,s,c,i,e[t+2],23,-995338651),i=f(i,a,s,c,e[t],6,-198630844),c=f(c,i,a,s,e[t+7],10,1126891415),s=f(s,c,i,a,e[t+14],15,-1416354905),a=f(a,s,c,i,e[t+5],21,-57434055),i=f(i,a,s,c,e[t+12],6,1700485571),c=f(c,i,a,s,e[t+3],10,-1894986606),s=f(s,c,i,a,e[t+10],15,-1051523),a=f(a,s,c,i,e[t+1],21,-2054922799),i=f(i,a,s,c,e[t+8],6,1873313359),c=f(c,i,a,s,e[t+15],10,-30611744),s=f(s,c,i,a,e[t+6],15,-1560198380),a=f(a,s,c,i,e[t+13],21,1309151649),i=f(i,a,s,c,e[t+4],6,-145523070),c=f(c,i,a,s,e[t+11],10,-1120210379),s=f(s,c,i,a,e[t+2],15,718787259),a=f(a,s,c,i,e[t+9],21,-343485551),i=o(i,n),a=o(a,r),s=o(s,p),c=o(c,m)}return Uint32Array.of(i,a,s,c)}function a(e){if(e.length===0)return new Uint32Array;let t=new Uint32Array(r(e.length*8)).fill(0);for(let n=0;n<e.length;n++)t[n>>2]|=(e[n]&255)<<n%4*8;return t}function o(e,t){let n=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(n>>16)<<16|n&65535}function s(e,t){return e<<t|e>>>32-t}function c(e,t,n,r,i,a){return o(s(o(o(t,e),o(r,a)),i),n)}function l(e,t,n,r,i,a,o){return c(t&n|~t&r,e,t,i,a,o)}function u(e,t,n,r,i,a,o){return c(t&r|n&~r,e,t,i,a,o)}function d(e,t,n,r,i,a,o){return c(t^n^r,e,t,i,a,o)}function f(e,t,n,r,i,a,o){return c(n^(t|~r),e,t,i,a,o)}e.default=t})),ka=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.URL=e.DNS=e.stringToBytes=void 0;var t=Ca(),n=wa();function r(e){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t}e.stringToBytes=r,e.DNS=`6ba7b810-9dad-11d1-80b4-00c04fd430c8`,e.URL=`6ba7b811-9dad-11d1-80b4-00c04fd430c8`;function i(e,i,a,o,s,c){let l=typeof a==`string`?r(a):a,u=typeof o==`string`?(0,t.default)(o):o;if(typeof o==`string`&&(o=(0,t.default)(o)),o?.length!==16)throw TypeError(`Namespace must be array-like (16 iterable integer values, 0-255)`);let d=new Uint8Array(16+l.length);if(d.set(u),d.set(l,u.length),d=i(d),d[6]=d[6]&15|e,d[8]=d[8]&63|128,s){if(c||=0,c<0||c+16>s.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let e=0;e<16;++e)s[c+e]=d[e];return s}return(0,n.unsafeStringify)(d)}e.default=i})),Aa=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.URL=e.DNS=void 0;var t=Oa(),n=ka(),r=ka();Object.defineProperty(e,`DNS`,{enumerable:!0,get:function(){return r.DNS}}),Object.defineProperty(e,`URL`,{enumerable:!0,get:function(){return r.URL}});function i(e,r,i,a){return(0,n.default)(48,t.default,e,r,i,a)}i.DNS=n.DNS,i.URL=n.URL,e.default=i})),ja=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)}})),Ma=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=ja(),n=Ta(),r=wa();function i(e,i,a){if(t.default.randomUUID&&!i&&!e)return t.default.randomUUID();e||={};let o=e.random??e.rng?.()??(0,n.default)();if(o.length<16)throw Error(`Random bytes length must be >= 16`);if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,i){if(a||=0,a<0||a+16>i.length)throw RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`);for(let e=0;e<16;++e)i[a+e]=o[e];return i}return(0,r.unsafeStringify)(o)}e.default=i})),Na=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});function t(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:return t^n^r;case 2:return t&n^t&r^n&r;case 3:return t^n^r}}function n(e,t){return e<<t|e>>>32-t}function r(e){let r=[1518500249,1859775393,2400959708,3395469782],i=[1732584193,4023233417,2562383102,271733878,3285377520],a=new Uint8Array(e.length+1);a.set(e),a[e.length]=128,e=a;let o=e.length/4+2,s=Math.ceil(o/16),c=Array(s);for(let t=0;t<s;++t){let n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=e[t*64+r*4]<<24|e[t*64+r*4+1]<<16|e[t*64+r*4+2]<<8|e[t*64+r*4+3];c[t]=n}c[s-1][14]=(e.length-1)*8/2**32,c[s-1][14]=Math.floor(c[s-1][14]),c[s-1][15]=(e.length-1)*8&4294967295;for(let e=0;e<s;++e){let a=new Uint32Array(80);for(let t=0;t<16;++t)a[t]=c[e][t];for(let e=16;e<80;++e)a[e]=n(a[e-3]^a[e-8]^a[e-14]^a[e-16],1);let o=i[0],s=i[1],l=i[2],u=i[3],d=i[4];for(let e=0;e<80;++e){let i=Math.floor(e/20),c=n(o,5)+t(i,s,l,u)+d+r[i]+a[e]>>>0;d=u,u=l,l=n(s,30)>>>0,s=o,o=c}i[0]=i[0]+o>>>0,i[1]=i[1]+s>>>0,i[2]=i[2]+l>>>0,i[3]=i[3]+u>>>0,i[4]=i[4]+d>>>0}return Uint8Array.of(i[0]>>24,i[0]>>16,i[0]>>8,i[0],i[1]>>24,i[1]>>16,i[1]>>8,i[1],i[2]>>24,i[2]>>16,i[2]>>8,i[2],i[3]>>24,i[3]>>16,i[3]>>8,i[3],i[4]>>24,i[4]>>16,i[4]>>8,i[4])}e.default=r})),Pa=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.URL=e.DNS=void 0;var t=Na(),n=ka(),r=ka();Object.defineProperty(e,`DNS`,{enumerable:!0,get:function(){return r.DNS}}),Object.defineProperty(e,`URL`,{enumerable:!0,get:function(){return r.URL}});function i(e,r,i,a){return(0,n.default)(80,t.default,e,r,i,a)}i.DNS=n.DNS,i.URL=n.URL,e.default=i})),Fa=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=wa(),n=Ea(),r=Da();function i(e,i,a){e??={},a??=0;let o=(0,n.default)({...e,_v6:!0},new Uint8Array(16));if(o=(0,r.default)(o),i){if(a<0||a+16>i.length)throw RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`);for(let e=0;e<16;e++)i[a+e]=o[e];return i}return(0,t.unsafeStringify)(o)}e.default=i})),Ia=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Ca(),n=wa();function r(e){let r=i(typeof e==`string`?(0,t.default)(e):e);return typeof e==`string`?(0,n.unsafeStringify)(r):r}e.default=r;function i(e){return Uint8Array.of((e[3]&15)<<4|e[4]>>4&15,(e[4]&15)<<4|(e[5]&240)>>4,(e[5]&15)<<4|e[6]&15,e[7],(e[1]&15)<<4|(e[2]&240)>>4,(e[2]&15)<<4|(e[3]&240)>>4,16|(e[0]&240)>>4,(e[0]&15)<<4|(e[1]&240)>>4,e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}})),La=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.updateV7State=void 0;var t=Ta(),n=wa(),r={};function i(e,i,s){let c;if(e)c=o(e.random??e.rng?.()??(0,t.default)(),e.msecs,e.seq,i,s);else{let e=Date.now(),n=(0,t.default)();a(r,e,n),c=o(n,r.msecs,r.seq,i,s)}return i??(0,n.unsafeStringify)(c)}function a(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=n[6]<<23|n[7]<<16|n[8]<<8|n[9],e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}e.updateV7State=a;function o(e,t,n,r,i=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),n??=e[6]*127<<24|e[7]<<16|e[8]<<8|e[9],r[i++]=t/1099511627776&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=t&255,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|e[10]&3,r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}e.default=i})),Ra=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Sa();function n(e){if(!(0,t.default)(e))throw TypeError(`Invalid UUID`);return parseInt(e.slice(14,15),16)}e.default=n})),za=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.version=e.validate=e.v7=e.v6ToV1=e.v6=e.v5=e.v4=e.v3=e.v1ToV6=e.v1=e.stringify=e.parse=e.NIL=e.MAX=void 0;var t=ya();Object.defineProperty(e,`MAX`,{enumerable:!0,get:function(){return t.default}});var n=ba();Object.defineProperty(e,`NIL`,{enumerable:!0,get:function(){return n.default}});var r=Ca();Object.defineProperty(e,`parse`,{enumerable:!0,get:function(){return r.default}});var i=wa();Object.defineProperty(e,`stringify`,{enumerable:!0,get:function(){return i.default}});var a=Ea();Object.defineProperty(e,`v1`,{enumerable:!0,get:function(){return a.default}});var o=Da();Object.defineProperty(e,`v1ToV6`,{enumerable:!0,get:function(){return o.default}});var s=Aa();Object.defineProperty(e,`v3`,{enumerable:!0,get:function(){return s.default}});var c=Ma();Object.defineProperty(e,`v4`,{enumerable:!0,get:function(){return c.default}});var l=Pa();Object.defineProperty(e,`v5`,{enumerable:!0,get:function(){return l.default}});var u=Fa();Object.defineProperty(e,`v6`,{enumerable:!0,get:function(){return u.default}});var d=Ia();Object.defineProperty(e,`v6ToV1`,{enumerable:!0,get:function(){return d.default}});var f=La();Object.defineProperty(e,`v7`,{enumerable:!0,get:function(){return f.default}});var p=Sa();Object.defineProperty(e,`validate`,{enumerable:!0,get:function(){return p.default}});var m=Ra();Object.defineProperty(e,`version`,{enumerable:!0,get:function(){return m.default}})})),Ba=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},n=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.BitcoinProvider=e.Keplr=e.EthereumProviderRpcError=void 0;var r=fa(),i=ma(),a=n(Vn()),o=n(G()),s=ha(),c=ga(),l=_a(),u=n(M()),d=va(),f=za(),p=class e extends Error{constructor(t,n,r){super(n),this.code=t,this.data=r,Object.setPrototypeOf(this,e.prototype)}};e.EthereumProviderRpcError=p,e.Keplr=class e{constructor(){this.enigmaUtils=new Map,this.version=l.BUILD_VERSION,this.mode=`extension`,this.defaultOptions={},this.ethereum=new h(this),this.starknet=void 0,this.bitcoin=new g(this)}static staticRequestMethod(e,t){let n=`ReactNativeWebView`in window,r=n?e=>{window.ReactNativeWebView.postMessage(JSON.stringify(e))}:e=>{window.postMessage(e,window.location.origin)},a=n?e=>{if(e&&typeof e==`string`)try{return JSON.parse(e)}catch{}return e}:e=>e,o=new Uint8Array(8),s=Array.from(crypto.getRandomValues(o)).map(e=>e.toString(16)).join(``),c={type:window.keplrRequestMetaIdSupport?`proxy-request${d.metaId?`-${d.metaId}`:``}`:`proxy-request`,id:s,method:e,args:i.JSONUint8Array.wrap(t)};return new Promise((e,t)=>{let n=r=>{let o=a(r.data);if(!o||o.type!==`proxy-request-response`||o.id!==s)return;window.removeEventListener(`message`,n);let c=i.JSONUint8Array.unwrap(o.result);if(!c){t(Error(`Result is null`));return}if(c.error){t(Error(c.error));return}e(c.return)};window.addEventListener(`message`,n),r(c)})}requestMethod(t,n){return e.staticRequestMethod(t,n)}static getKeplr(n=1500){return t(this,void 0,void 0,function*(){yield m();let t=`ReactNativeWebView`in window,r=typeof navigator<`u`&&`userAgent`in navigator?navigator.userAgent.includes(`Firefox`):!1;if(!(!t&&!r&&window.keplrRequestMetaIdSupport==null))return new Promise((t,r)=>{let i=setTimeout(()=>{t(void 0)},n);e.staticRequestMethod(`ping`,[]).then(()=>{clearTimeout(i),t(new e)}).catch(n=>{(n?.message)?.includes(`Invalid method: ping`)?(clearTimeout(i),t(new e)):r(n)})})})}ping(){return t(this,void 0,void 0,function*(){yield this.requestMethod(`ping`,[])})}enable(e){return t(this,void 0,void 0,function*(){yield this.requestMethod(`enable`,[e])})}disable(e){return t(this,void 0,void 0,function*(){yield this.requestMethod(`disable`,[e])})}experimentalSuggestChain(e){return t(this,void 0,void 0,function*(){if(e.hideInUI)throw Error(`hideInUI is not allowed`);e.features?.includes(`stargate`)||e.features?.includes(`no-legacy-stdTx`),yield this.requestMethod(`experimentalSuggestChain`,[e])})}getKey(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getKey`,[e])})}getKeysSettled(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getKeysSettled`,[e])})}sendTx(e,n,r){return t(this,void 0,void 0,function*(){return`length`in n,yield this.requestMethod(`sendTx`,[e,n,r])})}signAmino(e,n,r,i={}){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signAmino`,[e,n,r,(0,a.default)(this.defaultOptions.sign??{},i)])})}signDirect(e,n,r,i={}){return t(this,void 0,void 0,function*(){let t=yield this.requestMethod(`signDirect`,[e,n,{bodyBytes:r.bodyBytes,authInfoBytes:r.authInfoBytes,chainId:r.chainId,accountNumber:r.accountNumber?r.accountNumber.toString():null},(0,a.default)(this.defaultOptions.sign??{},i)]),s=t.signed;return{signed:{bodyBytes:s.bodyBytes,authInfoBytes:s.authInfoBytes,chainId:s.chainId,accountNumber:o.default.fromString(s.accountNumber)},signature:t.signature}})}signDirectAux(e,n,r,i={}){return t(this,void 0,void 0,function*(){let t=yield this.requestMethod(`signDirectAux`,[e,n,{bodyBytes:r.bodyBytes,publicKey:r.publicKey,chainId:r.chainId,accountNumber:r.accountNumber?r.accountNumber.toString():null,sequence:r.sequence?r.sequence.toString():null},(0,a.default)({preferNoSetMemo:this.defaultOptions.sign?.preferNoSetMemo},i)]),s=t.signed;return{signed:{bodyBytes:s.bodyBytes,publicKey:s.publicKey||void 0,chainId:s.chainId,accountNumber:o.default.fromString(s.accountNumber),sequence:o.default.fromString(s.sequence)},signature:t.signature}})}signArbitrary(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signArbitrary`,[e,n,r])})}signICNSAdr36(e,t,n,r,i){return this.requestMethod(`signICNSAdr36`,[e,t,n,r,i])}verifyArbitrary(e,n,r,i){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`verifyArbitrary`,[e,n,r,i])})}signEthereum(e,n,r,i){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signEthereum`,[e,n,r,i])})}getOfflineSigner(e,t){return new s.CosmJSOfflineSigner(e,this,t)}getOfflineSignerOnlyAmino(e,t){return new s.CosmJSOfflineSignerOnlyAmino(e,this,t)}getOfflineSignerAuto(e,n){return t(this,void 0,void 0,function*(){return(yield this.getKey(e)).isNanoLedger?new s.CosmJSOfflineSignerOnlyAmino(e,this,n):new s.CosmJSOfflineSigner(e,this,n)})}suggestToken(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`suggestToken`,[e,n,r])})}getSecret20ViewingKey(e,n){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getSecret20ViewingKey`,[e,n])})}getEnigmaPubKey(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getEnigmaPubKey`,[e])})}getEnigmaTxEncryptionKey(e,n){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getEnigmaTxEncryptionKey`,[e,n])})}enigmaEncrypt(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`enigmaEncrypt`,[e,n,r])})}enigmaDecrypt(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`enigmaDecrypt`,[e,n,r])})}getEnigmaUtils(e){if(this.enigmaUtils.has(e))return this.enigmaUtils.get(e);let t=new c.KeplrEnigmaUtils(e,this);return this.enigmaUtils.set(e,t),t}experimentalSignEIP712CosmosTx_v0(e,n,r,i,o={}){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`experimentalSignEIP712CosmosTx_v0`,[e,n,r,i,(0,a.default)(this.defaultOptions.sign??{},o)])})}getChainInfosWithoutEndpoints(){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getChainInfosWithoutEndpoints`,[])})}changeKeyRingName({defaultName:e,editable:n=!0}){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`changeKeyRingName`,[{defaultName:e,editable:n}])})}sendEthereumTx(e,n){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`sendEthereumTx`,[e,n])})}suggestERC20(e,n){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`suggestERC20`,[e,n])})}getChainInfoWithoutEndpoints(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getChainInfoWithoutEndpoints`,[e])})}getStarknetKey(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getStarknetKey`,[e])})}getStarknetKeysSettled(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getStarknetKeysSettled`,[e])})}signStarknetTx(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signStarknetTx`,[e,n,r])})}signStarknetDeployAccountTransaction(e,n){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signStarknetDeployAccountTransaction`,[e,n])})}getBitcoinKey(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getBitcoinKey`,[e])})}getBitcoinKeysSettled(e){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`getBitcoinKeysSettled`,[e])})}signPsbt(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signPsbt`,[e,n,r])})}signPsbts(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`signPsbts`,[e,n,r])})}__core__getAnalyticsId(){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`__core__getAnalyticsId`,[])})}__core__privilageSignAminoWithdrawRewards(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`__core__privilageSignAminoWithdrawRewards`,[e,n,r])})}__core__privilageSignAminoDelegate(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`__core__privilageSignAminoDelegate`,[e,n,r])})}__core__privilageSignAminoExecuteCosmWasm(e,n,r){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`__core__privilageSignAminoExecuteCosmWasm`,[e,n,r])})}__core__webpageClosed(){return t(this,void 0,void 0,function*(){return yield this.requestMethod(`__core__webpageClosed`,[])})}};var m=()=>document.readyState===`complete`?Promise.resolve():new Promise(e=>{let t=n=>{n.target&&n.target.readyState===`complete`&&(e(),document.removeEventListener(`readystatechange`,t))};document.addEventListener(`readystatechange`,t)}),h=class e extends u.default{constructor(n){if(super(),this.keplr=n,this.eip6963ProviderInfo={uuid:(0,f.v4)(),name:`Keplr`,rdns:`app.keplr`,icon:`data:image/png;base64,${d.KeplrLogoBase64}`},this.chainId=null,this.networkVersion=null,this.selectedAddress=null,this.isKeplr=!0,this.isMetaMask=!0,this._isConnected=!1,this._currentChainId=null,this._initProviderState=()=>t(this,void 0,void 0,function*(){let t=yield e.requestMethod(`request`,{method:`keplr_initProviderState`});if(t){let{currentEvmChainId:e,currentChainId:n,selectedAddress:r}=t;n!=null&&e!=null&&r!=null&&(this._handleConnect(e),this._handleChainChanged(e),this._currentChainId=n,this._handleAccountsChanged(r))}}),this._initProviderState(),window.addEventListener(`keplr_keystorechange`,()=>t(this,void 0,void 0,function*(){if(this._currentChainId&&(yield n.getChainInfoWithoutEndpoints(this._currentChainId))){let e=null;try{e=(yield n.getKey(this._currentChainId)).ethereumHexAddress}catch(e){e?.message.includes(`on Ledger by selecting the chain in the extension`)}this._handleAccountsChanged(e)}})),window.addEventListener(`keplr_chainChanged`,e=>{if(e.detail.origin===window.location.origin){let t=e.detail.evmChainId;this._handleChainChanged(t)}}),window.addEventListener(`keplr_ethSubscription`,e=>{let t=e.detail.origin,n=e.detail.providerId;if(t===window.location.origin&&n===this.eip6963ProviderInfo?.uuid){let t=e.detail.data;this.emit(`message`,{type:`eth_subscription`,data:t})}}),this.eip6963ProviderInfo){let e=new CustomEvent(r.EIP6963EventNames.Announce,{detail:Object.freeze({info:this.eip6963ProviderInfo,provider:this})});window.addEventListener(r.EIP6963EventNames.Request,()=>window.dispatchEvent(e)),window.dispatchEvent(e)}}static requestMethod(e,n){return t(this,void 0,void 0,function*(){let t=`ReactNativeWebView`in window,r=t?e=>{window.ReactNativeWebView.postMessage(JSON.stringify(e))}:e=>{window.postMessage(e,window.location.origin)},a=t?e=>{if(e&&typeof e==`string`)try{return JSON.parse(e)}catch{}return e}:e=>e,o=new Uint8Array(8),s=Array.from(crypto.getRandomValues(o)).map(e=>e.toString(16)).join(``),c={type:window.keplrRequestMetaIdSupport?`proxy-request${d.metaId?`-${d.metaId}`:``}`:`proxy-request`,id:s,method:`ethereum`,args:i.JSONUint8Array.wrap(n),ethereumProviderMethod:e};return new Promise((e,t)=>{let n=r=>{let o=a(r.data);if(!o||o.type!==`proxy-request-response`||o.id!==s)return;window.removeEventListener(`message`,n);let c=i.JSONUint8Array.unwrap(o.result);if(!c){t(Error(`Result is null`));return}if(c.error){let e=c.error;t(e.code&&!e.module?new p(e.code,e.message,e.data):Error(e));return}e(c.return)};window.addEventListener(`message`,n),r(c)})})}_handleConnect(e){return t(this,void 0,void 0,function*(){if(!this._isConnected){this._isConnected=!0;let t=`0x${e.toString(16)}`;this.emit(`connect`,{chainId:t})}})}_handleDisconnect(){return t(this,void 0,void 0,function*(){this._isConnected&&(yield e.requestMethod(`request`,{method:`keplr_disconnect`}),this._isConnected=!1,this.chainId=null,this.selectedAddress=null,this.networkVersion=null,this.emit(`disconnect`))})}_handleChainChanged(e){return t(this,void 0,void 0,function*(){let t=`0x${e.toString(16)}`;t!==this.chainId&&(this.chainId=t,this.networkVersion=e.toString(10),this.emit(`chainChanged`,t))})}_handleAccountsChanged(e){return t(this,void 0,void 0,function*(){this.selectedAddress!==e&&(this.selectedAddress=e,e?this.emit(`accountsChanged`,[e]):this.emit(`accountsChanged`,[]))})}isConnected(){return this._isConnected}request({method:n,params:r,chainId:i}){return t(this,void 0,void 0,function*(){if(typeof n!=`string`)throw Error("Invalid paramater: `method` must be a string");return this._isConnected||(yield this._initProviderState()),yield e.requestMethod(`request`,{method:n,params:r,providerId:this.eip6963ProviderInfo?.uuid,chainId:i})})}enable(){return t(this,void 0,void 0,function*(){return yield e.requestMethod(`request`,{method:`eth_requestAccounts`})})}net_version(){return t(this,void 0,void 0,function*(){return yield e.requestMethod(`request`,{method:`net_version`})})}},g=class e extends u.default{constructor(e){super(),this.keplr=e,this._handleNetworkChanged=e=>t(this,void 0,void 0,function*(){this.emit(`networkChanged`,e)}),this._handleAccountsChanged=e=>t(this,void 0,void 0,function*(){e&&e.length>0?(this.emit(`accountChanged`,e),this.emit(`accountsChanged`,e)):(this.emit(`accountChanged`,[``]),this.emit(`accountsChanged`,[``]))}),window.addEventListener(`keplr_keystorechange`,()=>t(this,void 0,void 0,function*(){let e=null;try{e=yield this.getAccounts()}catch(e){e?.message.includes(`on Ledger by selecting the chain in the extension`)}this._handleAccountsChanged(e)})),window.addEventListener(`keplr_bitcoinChainChanged`,e=>t(this,void 0,void 0,function*(){if(e.detail.origin===window.location.origin){let t=e.detail.network,n=null;try{n=yield this.getAccounts()}catch(e){e?.message.includes(`on Ledger by selecting the chain in the extension`)}this._handleNetworkChanged(t),this._handleAccountsChanged(n)}})),window.addEventListener(`keplr_bitcoinAccountsChanged`,()=>t(this,void 0,void 0,function*(){let e=null;try{e=yield this.getAccounts()}catch(e){e?.message.includes(`on Ledger by selecting the chain in the extension`)}this._handleAccountsChanged(e)}))}static _requestMethod(e,n){return t(this,void 0,void 0,function*(){let t=`ReactNativeWebView`in window,r=t?e=>{window.ReactNativeWebView.postMessage(JSON.stringify(e))}:e=>{window.postMessage(e,window.location.origin)},a=t?e=>{if(e&&typeof e==`string`)try{return JSON.parse(e)}catch{}return e}:e=>e,o=new Uint8Array(8),s=Array.from(crypto.getRandomValues(o)).map(e=>e.toString(16)).join(``),c={type:window.keplrRequestMetaIdSupport?`proxy-request${d.metaId?`-${d.metaId}`:``}`:`proxy-request`,id:s,method:`bitcoin`,args:i.JSONUint8Array.wrap(n),bitcoinProviderMethod:e};return new Promise((e,t)=>{let n=r=>{let o=a(r.data);if(!o||o.type!==`proxy-request-response`||o.id!==s)return;window.removeEventListener(`message`,n);let c=i.JSONUint8Array.unwrap(o.result);if(!c){t(Error(`Result is null`));return}if(c.error){t(Error(c.error));return}e(c.return)};window.addEventListener(`message`,n),r(c)})})}getAccounts(){return e._requestMethod(`getAccounts`,[])}requestAccounts(){return t(this,void 0,void 0,function*(){return e._requestMethod(`requestAccounts`,[])})}disconnect(){return t(this,void 0,void 0,function*(){return e._requestMethod(`disconnect`,[])})}getNetwork(){return t(this,void 0,void 0,function*(){return e._requestMethod(`getNetwork`,[])})}switchNetwork(n){return t(this,void 0,void 0,function*(){return e._requestMethod(`switchNetwork`,[n])})}getChain(){return t(this,void 0,void 0,function*(){return e._requestMethod(`getChain`,[])})}switchChain(n){return t(this,void 0,void 0,function*(){return e._requestMethod(`switchChain`,[n])})}getPublicKey(){return t(this,void 0,void 0,function*(){return e._requestMethod(`getPublicKey`,[])})}getBalance(){return t(this,void 0,void 0,function*(){return e._requestMethod(`getBalance`,[])})}getInscriptions(n,r){return t(this,void 0,void 0,function*(){return e._requestMethod(`getInscriptions`,[n,r])})}signMessage(n,r){return t(this,void 0,void 0,function*(){return e._requestMethod(`signMessage`,[n,r])})}sendBitcoin(n,r){return t(this,void 0,void 0,function*(){return e._requestMethod(`sendBitcoin`,[n,r])})}pushTx(n){return t(this,void 0,void 0,function*(){return e._requestMethod(`pushTx`,[n])})}pushPsbt(n){return t(this,void 0,void 0,function*(){return e._requestMethod(`pushPsbt`,[n])})}signPsbt(n,r){return t(this,void 0,void 0,function*(){return e._requestMethod(`signPsbt`,[n,r])})}signPsbts(n,r){return t(this,void 0,void 0,function*(){return e._requestMethod(`signPsbts`,[n,r])})}getAddress(){return t(this,void 0,void 0,function*(){return(yield this.getAccounts())[0]})}connectWallet(){return t(this,void 0,void 0,function*(){return this.requestAccounts()})}};e.BitcoinProvider=g})),Va=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.KeplrFallback=void 0;var n=Ba();e.KeplrFallback=class extends n.Keplr{constructor(e){super(),this.onKeplrNotDetected=e,this.isKeplrDetected=null,this.onKeplrNotDetected&&n.Keplr.getKeplr(500).then(e=>{var t;e||(t=this.onKeplrNotDetected)==null||t.call(this)})}requestMethod(e,r){return t(this,void 0,void 0,function*(){if(this.isKeplrDetected??((yield n.Keplr.getKeplr(500))?this.isKeplrDetected=!0:this.isKeplrDetected=!1),this.isKeplrDetected)return n.Keplr.staticRequestMethod(e,r);{let t=window.keplr;if(t)return t[e](...r);throw Error(`Can't detect keplr fallback`)}})}}})),Ha=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(Ba(),e),n(Va(),e)})),Ua=a(((e,t)=>{var n=(function(e){var t=1e7,r=7,i=9007199254740992,a=p(i),o=`0123456789abcdefghijklmnopqrstuvwxyz`,s=typeof BigInt==`function`;function c(e,t,n,r){return e===void 0?c[0]:t===void 0||+t==10&&!n?B(e):fe(e,t,n,r)}function l(e,t){this.value=e,this.sign=t,this.isSmall=!1}l.prototype=Object.create(c.prototype);function u(e){this.value=e,this.sign=e<0,this.isSmall=!0}u.prototype=Object.create(c.prototype);function d(e){this.value=e}d.prototype=Object.create(c.prototype);function f(e){return-i<e&&e<i}function p(e){return e<1e7?[e]:e<0x5af3107a4000?[e%1e7,Math.floor(e/1e7)]:[e%1e7,Math.floor(e/1e7)%1e7,Math.floor(e/0x5af3107a4000)]}function m(e){h(e);var n=e.length;if(n<4&&F(e,a)<0)switch(n){case 0:return 0;case 1:return e[0];case 2:return e[0]+e[1]*t;default:return e[0]+(e[1]+e[2]*t)*t}return e}function h(e){for(var t=e.length;e[--t]===0;);e.length=t+1}function g(e){for(var t=Array(e),n=-1;++n<e;)t[n]=0;return t}function _(e){return e>0?Math.floor(e):Math.ceil(e)}function v(e,n){var r=e.length,i=n.length,a=Array(r),o=0,s=t,c,l;for(l=0;l<i;l++)c=e[l]+n[l]+o,o=+(c>=s),a[l]=c-o*s;for(;l<r;)c=e[l]+o,o=+(c===s),a[l++]=c-o*s;return o>0&&a.push(o),a}function y(e,t){return e.length>=t.length?v(e,t):v(t,e)}function b(e,n){var r=e.length,i=Array(r),a=t,o,s;for(s=0;s<r;s++)o=e[s]-a+n,n=Math.floor(o/a),i[s]=o-n*a,n+=1;for(;n>0;)i[s++]=n%a,n=Math.floor(n/a);return i}l.prototype.add=function(e){var t=B(e);if(this.sign!==t.sign)return this.subtract(t.negate());var n=this.value,r=t.value;return t.isSmall?new l(b(n,Math.abs(r)),this.sign):new l(y(n,r),this.sign)},l.prototype.plus=l.prototype.add,u.prototype.add=function(e){var t=B(e),n=this.value;if(n<0!==t.sign)return this.subtract(t.negate());var r=t.value;if(t.isSmall){if(f(n+r))return new u(n+r);r=p(Math.abs(r))}return new l(b(r,Math.abs(n)),n<0)},u.prototype.plus=u.prototype.add,d.prototype.add=function(e){return new d(this.value+B(e).value)},d.prototype.plus=d.prototype.add;function x(e,n){var r=e.length,i=n.length,a=Array(r),o=0,s=t,c,l;for(c=0;c<i;c++)l=e[c]-o-n[c],l<0?(l+=s,o=1):o=0,a[c]=l;for(c=i;c<r;c++){if(l=e[c]-o,l<0)l+=s;else{a[c++]=l;break}a[c]=l}for(;c<r;c++)a[c]=e[c];return h(a),a}function S(e,t,n){var r;return F(e,t)>=0?r=x(e,t):(r=x(t,e),n=!n),r=m(r),typeof r==`number`?(n&&(r=-r),new u(r)):new l(r,n)}function C(e,n,r){var i=e.length,a=Array(i),o=-n,s=t,c,d;for(c=0;c<i;c++)d=e[c]+o,o=Math.floor(d/s),d%=s,a[c]=d<0?d+s:d;return a=m(a),typeof a==`number`?(r&&(a=-a),new u(a)):new l(a,r)}l.prototype.subtract=function(e){var t=B(e);if(this.sign!==t.sign)return this.add(t.negate());var n=this.value,r=t.value;return t.isSmall?C(n,Math.abs(r),this.sign):S(n,r,this.sign)},l.prototype.minus=l.prototype.subtract,u.prototype.subtract=function(e){var t=B(e),n=this.value;if(n<0!==t.sign)return this.add(t.negate());var r=t.value;return t.isSmall?new u(n-r):C(r,Math.abs(n),n>=0)},u.prototype.minus=u.prototype.subtract,d.prototype.subtract=function(e){return new d(this.value-B(e).value)},d.prototype.minus=d.prototype.subtract,l.prototype.negate=function(){return new l(this.value,!this.sign)},u.prototype.negate=function(){var e=this.sign,t=new u(-this.value);return t.sign=!e,t},d.prototype.negate=function(){return new d(-this.value)},l.prototype.abs=function(){return new l(this.value,!1)},u.prototype.abs=function(){return new u(Math.abs(this.value))},d.prototype.abs=function(){return new d(this.value>=0?this.value:-this.value)};function w(e,n){var r=e.length,i=n.length,a=g(r+i),o=t,s,c,l,u,d;for(l=0;l<r;++l){u=e[l];for(var f=0;f<i;++f)d=n[f],s=u*d+a[l+f],c=Math.floor(s/o),a[l+f]=s-c*o,a[l+f+1]+=c}return h(a),a}function T(e,n){var r=e.length,i=Array(r),a=t,o=0,s,c;for(c=0;c<r;c++)s=e[c]*n+o,o=Math.floor(s/a),i[c]=s-o*a;for(;o>0;)i[c++]=o%a,o=Math.floor(o/a);return i}function E(e,t){for(var n=[];t-- >0;)n.push(0);return n.concat(e)}function D(e,t){var n=Math.max(e.length,t.length);if(n<=30)return w(e,t);n=Math.ceil(n/2);var r=e.slice(n),i=e.slice(0,n),a=t.slice(n),o=t.slice(0,n),s=D(i,o),c=D(r,a),l=y(y(s,E(x(x(D(y(i,r),y(o,a)),s),c),n)),E(c,2*n));return h(l),l}function O(e,t){return-.012*e-.012*t+15e-6*e*t>0}l.prototype.multiply=function(e){var n=B(e),r=this.value,i=n.value,a=this.sign!==n.sign,o;if(n.isSmall){if(i===0)return c[0];if(i===1)return this;if(i===-1)return this.negate();if(o=Math.abs(i),o<t)return new l(T(r,o),a);i=p(o)}return O(r.length,i.length)?new l(D(r,i),a):new l(w(r,i),a)},l.prototype.times=l.prototype.multiply;function k(e,n,r){return e<t?new l(T(n,e),r):new l(w(n,p(e)),r)}u.prototype._multiplyBySmall=function(e){return f(e.value*this.value)?new u(e.value*this.value):k(Math.abs(e.value),p(Math.abs(this.value)),this.sign!==e.sign)},l.prototype._multiplyBySmall=function(e){return e.value===0?c[0]:e.value===1?this:e.value===-1?this.negate():k(Math.abs(e.value),this.value,this.sign!==e.sign)},u.prototype.multiply=function(e){return B(e)._multiplyBySmall(this)},u.prototype.times=u.prototype.multiply,d.prototype.multiply=function(e){return new d(this.value*B(e).value)},d.prototype.times=d.prototype.multiply;function A(e){var n=e.length,r=g(n+n),i=t,a,o,s,c,l;for(s=0;s<n;s++){c=e[s],o=0-c*c;for(var u=s;u<n;u++)l=e[u],a=c*l*2+r[s+u]+o,o=Math.floor(a/i),r[s+u]=a-o*i;r[s+n]=o}return h(r),r}l.prototype.square=function(){return new l(A(this.value),!1)},u.prototype.square=function(){var e=this.value*this.value;return f(e)?new u(e):new l(A(p(Math.abs(this.value))),!1)},d.prototype.square=function(e){return new d(this.value*this.value)};function j(e,n){var r=e.length,i=n.length,a=t,o=g(n.length),s=n[i-1],c=Math.ceil(a/(2*s)),l=T(e,c),u=T(n,c),d,f,p,h,_,v,y;for(l.length<=r&&l.push(0),u.push(0),s=u[i-1],f=r-i;f>=0;f--){for(d=a-1,l[f+i]!==s&&(d=Math.floor((l[f+i]*a+l[f+i-1])/s)),p=0,h=0,v=u.length,_=0;_<v;_++)p+=d*u[_],y=Math.floor(p/a),h+=l[f+_]-(p-y*a),p=y,h<0?(l[f+_]=h+a,h=-1):(l[f+_]=h,h=0);for(;h!==0;){for(--d,p=0,_=0;_<v;_++)p+=l[f+_]-a+u[_],p<0?(l[f+_]=p+a,p=0):(l[f+_]=p,p=1);h+=p}o[f]=d}return l=N(l,c)[0],[m(o),m(l)]}function M(e,n){for(var r=e.length,i=n.length,a=[],o=[],s=t,c,l,u,d,f;r;){if(o.unshift(e[--r]),h(o),F(o,n)<0){a.push(0);continue}l=o.length,u=o[l-1]*s+o[l-2],d=n[i-1]*s+n[i-2],l>i&&(u=(u+1)*s),c=Math.ceil(u/d);do{if(f=T(n,c),F(f,o)<=0)break;c--}while(c);a.push(c),o=x(o,f)}return a.reverse(),[m(a),m(o)]}function N(e,n){var r=e.length,i=g(r),a=t,o,s,c=0,l;for(o=r-1;o>=0;--o)l=c*a+e[o],s=_(l/n),c=l-s*n,i[o]=s|0;return[i,c|0]}function P(e,n){var r,i=B(n);if(s)return[new d(e.value/i.value),new d(e.value%i.value)];var a=e.value,o=i.value,f;if(o===0)throw Error(`Cannot divide by zero`);if(e.isSmall)return i.isSmall?[new u(_(a/o)),new u(a%o)]:[c[0],e];if(i.isSmall){if(o===1)return[e,c[0]];if(o==-1)return[e.negate(),c[0]];var h=Math.abs(o);if(h<t){r=N(a,h),f=m(r[0]);var g=r[1];return e.sign&&(g=-g),typeof f==`number`?(e.sign!==i.sign&&(f=-f),[new u(f),new u(g)]):[new l(f,e.sign!==i.sign),new u(g)]}o=p(h)}var v=F(a,o);if(v===-1)return[c[0],e];if(v===0)return[c[e.sign===i.sign?1:-1],c[0]];r=a.length+o.length<=200?j(a,o):M(a,o),f=r[0];var y=e.sign!==i.sign,b=r[1],x=e.sign;return typeof f==`number`?(y&&(f=-f),f=new u(f)):f=new l(f,y),typeof b==`number`?(x&&(b=-b),b=new u(b)):b=new l(b,x),[f,b]}l.prototype.divmod=function(e){var t=P(this,e);return{quotient:t[0],remainder:t[1]}},d.prototype.divmod=u.prototype.divmod=l.prototype.divmod,l.prototype.divide=function(e){return P(this,e)[0]},d.prototype.over=d.prototype.divide=function(e){return new d(this.value/B(e).value)},u.prototype.over=u.prototype.divide=l.prototype.over=l.prototype.divide,l.prototype.mod=function(e){return P(this,e)[1]},d.prototype.mod=d.prototype.remainder=function(e){return new d(this.value%B(e).value)},u.prototype.remainder=u.prototype.mod=l.prototype.remainder=l.prototype.mod,l.prototype.pow=function(e){var t=B(e),n=this.value,r=t.value,i,a,o;if(r===0)return c[1];if(n===0)return c[0];if(n===1)return c[1];if(n===-1)return t.isEven()?c[1]:c[-1];if(t.sign)return c[0];if(!t.isSmall)throw Error(`The exponent `+t.toString()+` is too large.`);if(this.isSmall&&f(i=n**+r))return new u(_(i));for(a=this,o=c[1];r&!0&&(o=o.times(a),--r),r!==0;)r/=2,a=a.square();return o},u.prototype.pow=l.prototype.pow,d.prototype.pow=function(e){var t=B(e),n=this.value,r=t.value,i=BigInt(0),a=BigInt(1),o=BigInt(2);if(r===i)return c[1];if(n===i)return c[0];if(n===a)return c[1];if(n===BigInt(-1))return t.isEven()?c[1]:c[-1];if(t.isNegative())return new d(i);for(var s=this,l=c[1];(r&a)===a&&(l=l.times(s),--r),r!==i;)r/=o,s=s.square();return l},l.prototype.modPow=function(e,t){if(e=B(e),t=B(t),t.isZero())throw Error(`Cannot take modPow with modulus 0`);var n=c[1],r=this.mod(t);for(e.isNegative()&&(e=e.multiply(c[-1]),r=r.modInv(t));e.isPositive();){if(r.isZero())return c[0];e.isOdd()&&(n=n.multiply(r).mod(t)),e=e.divide(2),r=r.square().mod(t)}return n},d.prototype.modPow=u.prototype.modPow=l.prototype.modPow;function F(e,t){if(e.length!==t.length)return e.length>t.length?1:-1;for(var n=e.length-1;n>=0;n--)if(e[n]!==t[n])return e[n]>t[n]?1:-1;return 0}l.prototype.compareAbs=function(e){var t=B(e),n=this.value,r=t.value;return t.isSmall?1:F(n,r)},u.prototype.compareAbs=function(e){var t=B(e),n=Math.abs(this.value),r=t.value;return t.isSmall?(r=Math.abs(r),n===r?0:n>r?1:-1):-1},d.prototype.compareAbs=function(e){var t=this.value,n=B(e).value;return t=t>=0?t:-t,n=n>=0?n:-n,t===n?0:t>n?1:-1},l.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=B(e),n=this.value,r=t.value;return this.sign===t.sign?t.isSmall?this.sign?-1:1:F(n,r)*(this.sign?-1:1):t.sign?1:-1},l.prototype.compareTo=l.prototype.compare,u.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=B(e),n=this.value,r=t.value;return t.isSmall?n==r?0:n>r?1:-1:n<0===t.sign?n<0?1:-1:n<0?-1:1},u.prototype.compareTo=u.prototype.compare,d.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=this.value,n=B(e).value;return t===n?0:t>n?1:-1},d.prototype.compareTo=d.prototype.compare,l.prototype.equals=function(e){return this.compare(e)===0},d.prototype.eq=d.prototype.equals=u.prototype.eq=u.prototype.equals=l.prototype.eq=l.prototype.equals,l.prototype.notEquals=function(e){return this.compare(e)!==0},d.prototype.neq=d.prototype.notEquals=u.prototype.neq=u.prototype.notEquals=l.prototype.neq=l.prototype.notEquals,l.prototype.greater=function(e){return this.compare(e)>0},d.prototype.gt=d.prototype.greater=u.prototype.gt=u.prototype.greater=l.prototype.gt=l.prototype.greater,l.prototype.lesser=function(e){return this.compare(e)<0},d.prototype.lt=d.prototype.lesser=u.prototype.lt=u.prototype.lesser=l.prototype.lt=l.prototype.lesser,l.prototype.greaterOrEquals=function(e){return this.compare(e)>=0},d.prototype.geq=d.prototype.greaterOrEquals=u.prototype.geq=u.prototype.greaterOrEquals=l.prototype.geq=l.prototype.greaterOrEquals,l.prototype.lesserOrEquals=function(e){return this.compare(e)<=0},d.prototype.leq=d.prototype.lesserOrEquals=u.prototype.leq=u.prototype.lesserOrEquals=l.prototype.leq=l.prototype.lesserOrEquals,l.prototype.isEven=function(){return(this.value[0]&1)==0},u.prototype.isEven=function(){return(this.value&1)==0},d.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},l.prototype.isOdd=function(){return(this.value[0]&1)==1},u.prototype.isOdd=function(){return(this.value&1)==1},d.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},l.prototype.isPositive=function(){return!this.sign},u.prototype.isPositive=function(){return this.value>0},d.prototype.isPositive=u.prototype.isPositive,l.prototype.isNegative=function(){return this.sign},u.prototype.isNegative=function(){return this.value<0},d.prototype.isNegative=u.prototype.isNegative,l.prototype.isUnit=function(){return!1},u.prototype.isUnit=function(){return Math.abs(this.value)===1},d.prototype.isUnit=function(){return this.abs().value===BigInt(1)},l.prototype.isZero=function(){return!1},u.prototype.isZero=function(){return this.value===0},d.prototype.isZero=function(){return this.value===BigInt(0)},l.prototype.isDivisibleBy=function(e){var t=B(e);return t.isZero()?!1:t.isUnit()?!0:t.compareAbs(2)===0?this.isEven():this.mod(t).isZero()},d.prototype.isDivisibleBy=u.prototype.isDivisibleBy=l.prototype.isDivisibleBy;function I(e){var t=e.abs();if(t.isUnit())return!1;if(t.equals(2)||t.equals(3)||t.equals(5))return!0;if(t.isEven()||t.isDivisibleBy(3)||t.isDivisibleBy(5))return!1;if(t.lesser(49))return!0}function L(e,t){for(var r=e.prev(),i=r,a=0,o,s,c;i.isEven();)i=i.divide(2),a++;next:for(s=0;s<t.length;s++)if(!e.lesser(t[s])&&(c=n(t[s]).modPow(i,e),!(c.isUnit()||c.equals(r)))){for(o=a-1;o!=0;o--){if(c=c.square().mod(e),c.isUnit())return!1;if(c.equals(r))continue next}return!1}return!0}l.prototype.isPrime=function(t){var r=I(this);if(r!==e)return r;var i=this.abs(),a=i.bitLength();if(a<=64)return L(i,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var o=Math.log(2)*a.toJSNumber(),s=Math.ceil(t===!0?2*o**2:o),c=[],l=0;l<s;l++)c.push(n(l+2));return L(i,c)},d.prototype.isPrime=u.prototype.isPrime=l.prototype.isPrime,l.prototype.isProbablePrime=function(t,r){var i=I(this);if(i!==e)return i;for(var a=this.abs(),o=t===e?5:t,s=[],c=0;c<o;c++)s.push(n.randBetween(2,a.minus(2),r));return L(a,s)},d.prototype.isProbablePrime=u.prototype.isProbablePrime=l.prototype.isProbablePrime,l.prototype.modInv=function(e){for(var t=n.zero,r=n.one,i=B(e),a=this.abs(),o,s,c;!a.isZero();)o=i.divide(a),s=t,c=i,t=r,i=a,r=s.subtract(o.multiply(r)),a=c.subtract(o.multiply(a));if(!i.isUnit())throw Error(this.toString()+` and `+e.toString()+` are not co-prime`);return t.compare(0)===-1&&(t=t.add(e)),this.isNegative()?t.negate():t},d.prototype.modInv=u.prototype.modInv=l.prototype.modInv,l.prototype.next=function(){var e=this.value;return this.sign?C(e,1,this.sign):new l(b(e,1),this.sign)},u.prototype.next=function(){var e=this.value;return e+1<i?new u(e+1):new l(a,!1)},d.prototype.next=function(){return new d(this.value+BigInt(1))},l.prototype.prev=function(){var e=this.value;return this.sign?new l(b(e,1),!0):C(e,1,this.sign)},u.prototype.prev=function(){var e=this.value;return e-1>-i?new u(e-1):new l(a,!0)},d.prototype.prev=function(){return new d(this.value-BigInt(1))};for(var R=[1];2*R[R.length-1]<=t;)R.push(2*R[R.length-1]);var ee=R.length,te=R[ee-1];function ne(e){return Math.abs(e)<=t}l.prototype.shiftLeft=function(e){var t=B(e).toJSNumber();if(!ne(t))throw Error(String(t)+` is too large for shifting.`);if(t<0)return this.shiftRight(-t);var n=this;if(n.isZero())return n;for(;t>=ee;)n=n.multiply(te),t-=ee-1;return n.multiply(R[t])},d.prototype.shiftLeft=u.prototype.shiftLeft=l.prototype.shiftLeft,l.prototype.shiftRight=function(e){var t,n=B(e).toJSNumber();if(!ne(n))throw Error(String(n)+` is too large for shifting.`);if(n<0)return this.shiftLeft(-n);for(var r=this;n>=ee;){if(r.isZero()||r.isNegative()&&r.isUnit())return r;t=P(r,te),r=t[1].isNegative()?t[0].prev():t[0],n-=ee-1}return t=P(r,R[n]),t[1].isNegative()?t[0].prev():t[0]},d.prototype.shiftRight=u.prototype.shiftRight=l.prototype.shiftRight;function re(e,t,r){t=B(t);for(var i=e.isNegative(),a=t.isNegative(),o=i?e.not():e,s=a?t.not():t,c=0,l=0,u=null,d=null,f=[];!o.isZero()||!s.isZero();)u=P(o,te),c=u[1].toJSNumber(),i&&(c=te-1-c),d=P(s,te),l=d[1].toJSNumber(),a&&(l=te-1-l),o=u[0],s=d[0],f.push(r(c,l));for(var p=r(+!!i,+!!a)===0?n(0):n(-1),m=f.length-1;m>=0;--m)p=p.multiply(te).add(n(f[m]));return p}l.prototype.not=function(){return this.negate().prev()},d.prototype.not=u.prototype.not=l.prototype.not,l.prototype.and=function(e){return re(this,e,function(e,t){return e&t})},d.prototype.and=u.prototype.and=l.prototype.and,l.prototype.or=function(e){return re(this,e,function(e,t){return e|t})},d.prototype.or=u.prototype.or=l.prototype.or,l.prototype.xor=function(e){return re(this,e,function(e,t){return e^t})},d.prototype.xor=u.prototype.xor=l.prototype.xor;var ie=1<<30,ae=(t&-t)*(t&-t)|ie;function z(e){var n=e.value,r=typeof n==`number`?n|ie:typeof n==`bigint`?n|BigInt(ie):n[0]+n[1]*t|ae;return r&-r}function oe(e,t){if(t.compareTo(e)<=0){var r=oe(e,t.square(t)),i=r.p,a=r.e,o=i.multiply(t);return o.compareTo(e)<=0?{p:o,e:a*2+1}:{p:i,e:a*2}}return{p:n(1),e:0}}l.prototype.bitLength=function(){var e=this;return e.compareTo(n(0))<0&&(e=e.negate().subtract(n(1))),e.compareTo(n(0))===0?n(0):n(oe(e,n(2)).e).add(n(1))},d.prototype.bitLength=u.prototype.bitLength=l.prototype.bitLength;function se(e,t){return e=B(e),t=B(t),e.greater(t)?e:t}function ce(e,t){return e=B(e),t=B(t),e.lesser(t)?e:t}function le(e,t){if(e=B(e).abs(),t=B(t).abs(),e.equals(t))return e;if(e.isZero())return t;if(t.isZero())return e;for(var n=c[1],r,i;e.isEven()&&t.isEven();)r=ce(z(e),z(t)),e=e.divide(r),t=t.divide(r),n=n.multiply(r);for(;e.isEven();)e=e.divide(z(e));do{for(;t.isEven();)t=t.divide(z(t));e.greater(t)&&(i=t,t=e,e=i),t=t.subtract(e)}while(!t.isZero());return n.isUnit()?e:e.multiply(n)}function ue(e,t){return e=B(e).abs(),t=B(t).abs(),e.divide(le(e,t)).multiply(t)}function de(e,n,r){e=B(e),n=B(n);var i=r||Math.random,a=ce(e,n),o=se(e,n).subtract(a).add(1);if(o.isSmall)return a.add(Math.floor(i()*o));for(var s=he(o,t).value,l=[],u=!0,d=0;d<s.length;d++){var f=u?s[d]+(d+1<s.length?s[d+1]/t:0):t,p=_(i()*f);l.push(p),p<s[d]&&(u=!1)}return a.add(c.fromArray(l,t,!1))}var fe=function(e,t,n,r){n||=o,e=String(e),r||(e=e.toLowerCase(),n=n.toLowerCase());var i=e.length,a,s=Math.abs(t),c={};for(a=0;a<n.length;a++)c[n[a]]=a;for(a=0;a<i;a++){var l=e[a];if(l!==`-`&&l in c&&c[l]>=s){if(l===`1`&&s===1)continue;throw Error(l+` is not a valid digit in base `+t+`.`)}}t=B(t);var u=[],d=e[0]===`-`;for(a=+!!d;a<e.length;a++){var l=e[a];if(l in c)u.push(B(c[l]));else if(l===`<`){var f=a;do a++;while(e[a]!==`>`&&a<e.length);u.push(B(e.slice(f+1,a)))}else throw Error(l+` is not a valid character`)}return pe(u,t,d)};function pe(e,t,n){var r=c[0],i=c[1],a;for(a=e.length-1;a>=0;a--)r=r.add(e[a].times(i)),i=i.times(t);return n?r.negate():r}function me(e,t){return t||=o,e<t.length?t[e]:`<`+e+`>`}function he(e,t){if(t=n(t),t.isZero()){if(e.isZero())return{value:[0],isNegative:!1};throw Error(`Cannot convert nonzero numbers to base 0.`)}if(t.equals(-1)){if(e.isZero())return{value:[0],isNegative:!1};if(e.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-e.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var r=Array.apply(null,Array(e.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return r.unshift([1]),{value:[].concat.apply([],r),isNegative:!1}}var i=!1;if(e.isNegative()&&t.isPositive()&&(i=!0,e=e.abs()),t.isUnit())return e.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(e.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:i};for(var a=[],o=e,s;o.isNegative()||o.compareAbs(t)>=0;){s=o.divmod(t),o=s.quotient;var c=s.remainder;c.isNegative()&&(c=t.minus(c).abs(),o=o.next()),a.push(c.toJSNumber())}return a.push(o.toJSNumber()),{value:a.reverse(),isNegative:i}}function ge(e,t,n){var r=he(e,t);return(r.isNegative?`-`:``)+r.value.map(function(e){return me(e,n)}).join(``)}l.prototype.toArray=function(e){return he(this,e)},u.prototype.toArray=function(e){return he(this,e)},d.prototype.toArray=function(e){return he(this,e)},l.prototype.toString=function(t,n){if(t===e&&(t=10),t!==10||n)return ge(this,t,n);for(var r=this.value,i=r.length,a=String(r[--i]),o=`0000000`,s;--i>=0;)s=String(r[i]),a+=o.slice(s.length)+s;return(this.sign?`-`:``)+a},u.prototype.toString=function(t,n){return t===e&&(t=10),t!=10||n?ge(this,t,n):String(this.value)},d.prototype.toString=u.prototype.toString,d.prototype.toJSON=l.prototype.toJSON=u.prototype.toJSON=function(){return this.toString()},l.prototype.valueOf=function(){return parseInt(this.toString(),10)},l.prototype.toJSNumber=l.prototype.valueOf,u.prototype.valueOf=function(){return this.value},u.prototype.toJSNumber=u.prototype.valueOf,d.prototype.valueOf=d.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};function _e(e){if(f(+e)){var t=+e;if(t===_(t))return s?new d(BigInt(t)):new u(t);throw Error(`Invalid integer: `+e)}var n=e[0]===`-`;n&&(e=e.slice(1));var i=e.split(/e/i);if(i.length>2)throw Error(`Invalid integer: `+i.join(`e`));if(i.length===2){var a=i[1];if(a[0]===`+`&&(a=a.slice(1)),a=+a,a!==_(a)||!f(a))throw Error(`Invalid integer: `+a+` is not a valid exponent.`);var o=i[0],c=o.indexOf(`.`);if(c>=0&&(a-=o.length-c-1,o=o.slice(0,c)+o.slice(c+1)),a<0)throw Error(`Cannot include negative exponent part for integers`);o+=Array(a+1).join(`0`),e=o}if(!/^([0-9][0-9]*)$/.test(e))throw Error(`Invalid integer: `+e);if(s)return new d(BigInt(n?`-`+e:e));for(var p=[],m=e.length,g=r,v=m-g;m>0;)p.push(+e.slice(v,m)),v-=g,v<0&&(v=0),m-=g;return h(p),new l(p,n)}function ve(e){if(s)return new d(BigInt(e));if(f(e)){if(e!==_(e))throw Error(e+` is not an integer.`);return new u(e)}return _e(e.toString())}function B(e){return typeof e==`number`?ve(e):typeof e==`string`?_e(e):typeof e==`bigint`?new d(e):e}for(var ye=0;ye<1e3;ye++)c[ye]=B(ye),ye>0&&(c[-ye]=B(-ye));return c.one=c[1],c.zero=c[0],c.minusOne=c[-1],c.max=se,c.min=ce,c.gcd=le,c.lcm=ue,c.isInstance=function(e){return e instanceof l||e instanceof u||e instanceof d},c.randBetween=de,c.fromArray=function(e,t,n){return pe(e.map(B),B(t||10),n)},c})();t!==void 0&&t.hasOwnProperty(`exports`)&&(t.exports=n),typeof define==`function`&&define.amd&&define(function(){return n})})),Wa=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.exponentDecStringToDecString=e.isExponentDecString=e.isValidDecimalString=e.isValidIntegerString=void 0;var t=/^-?\d+$/,n=/^-?\d+.?\d*$/,r=/^(-?)([\d.]+)e([-+])([\d]+)$/;function i(e){return t.test(e)}e.isValidIntegerString=i;function a(e){return n.test(e)}e.isValidDecimalString=a;function o(e){return r.test(e)}e.isExponentDecString=o;function s(e){let t=``;for(let n=0;n<e;n++)t+=`0`;return t}function c(e){for(;e.length>0&&e[0]===`0`;)e=e.slice(1);return e.length===0||e[0]===`.`?`0`+e:e}function l(e){let t=e.split(r);if(t.length!==6)return e;let n=t[1]===`-`,i=t[2],a=i.indexOf(`.`),o=t[4],l=parseInt(o)*(t[3]===`-`?-1:1);if(a>=0){let e=i.length-a-1;l-=e,i=c(i.replace(`.`,``))}let u=n?`-`:``;if(l<0){if(i.length>-l){let e=i.length+l;return u+(i.slice(0,e)+`.`+i.slice(e))}return u+`0.`+s(-(i.length+l))+i}else return u+i+s(l)}e.exponentDecStringToDecString=l})),Ga=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Uint=e.Int=void 0;var n=t(Ua()),r=Wa(),i=class e{constructor(e){if(typeof e==`number`&&(e=e.toString()),typeof e==`string`){if(!(0,r.isValidIntegerString)(e))if((0,r.isExponentDecString)(e))e=(0,r.exponentDecStringToDecString)(e);else throw Error(`invalid integer: ${e}`);this.int=(0,n.default)(e)}else this.int=(0,n.default)(e);this.checkBitLen()}checkBitLen(){if(this.int.abs().gt(e.maxInt))throw Error(`Integer out of range ${this.int.toString()}`)}toString(){return this.int.toString(10)}isNegative(){return this.int.isNegative()}isPositive(){return this.int.isPositive()}isZero(){return this.int.eq((0,n.default)(0))}equals(e){return this.int.equals(e.int)}gt(e){return this.int.gt(e.int)}gte(e){return this.int.greaterOrEquals(e.int)}lt(e){return this.int.lt(e.int)}lte(e){return this.int.lesserOrEquals(e.int)}abs(){return new e(this.int.abs())}absUInt(){return new a(this.int.abs())}add(t){return new e(this.int.add(t.int))}sub(t){return new e(this.int.subtract(t.int))}mul(t){return new e(this.int.multiply(t.int))}div(t){return new e(this.int.divide(t.int))}mod(t){return new e(this.int.mod(t.int))}neg(){return new e(this.int.negate())}pow(t){return new e(this.int.pow(t.toBigNumber()))}toBigNumber(){return this.int}};e.Int=i,i.maxInt=(0,n.default)(`115792089237316195423570985008687907853269984665640564039457584007913129639935`);var a=class e{constructor(e){if(typeof e==`number`&&(e=e.toString()),typeof e==`string`){if(!(0,r.isValidIntegerString)(e))if((0,r.isExponentDecString)(e))e=(0,r.exponentDecStringToDecString)(e);else throw Error(`invalid integer: ${e}`);this.uint=(0,n.default)(e)}else this.uint=(0,n.default)(e);if(this.uint.isNegative())throw TypeError(`Uint should not be negative`);this.checkBitLen()}checkBitLen(){if(this.uint.abs().bitLength().gt(256))throw Error(`Integer out of range ${this.uint.toString()}`)}toString(){return this.uint.toString(10)}isZero(){return this.uint.eq((0,n.default)(0))}equals(e){return this.uint.equals(e.uint)}gt(e){return this.uint.gt(e.uint)}gte(e){return this.uint.greaterOrEquals(e.uint)}lt(e){return this.uint.lt(e.uint)}lte(e){return this.uint.lesserOrEquals(e.uint)}add(t){return new e(this.uint.add(t.uint))}sub(t){return new e(this.uint.subtract(t.uint))}mul(t){return new e(this.uint.multiply(t.uint))}div(t){return new e(this.uint.divide(t.uint))}mod(t){return new e(this.uint.mod(t.uint))}pow(t){return new e(this.uint.pow(t.toBigNumber()))}toBigNumber(){return this.uint}};e.Uint=a})),Ka=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.integerStringToUSLocaleString=void 0;function t(e){if(e.indexOf(`.`)>=0)throw Error(`${e} is not integer`);if(typeof BigInt<`u`)return BigInt(e).toLocaleString(`en-US`);let t=e,n=[];for(let e=t.length;e>0;e-=3)n.push(t.slice(Math.max(0,e-3),e));return n.reverse().join(`,`)}e.integerStringToUSLocaleString=t})),qa=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Dec=void 0;var n=t(Ua()),r=Ga(),i=Wa(),a=Ka(),o=class e{static calcPrecisionMultiplier(t){if(t<0)throw Error(`Invalid prec`);if(t>e.precision)throw Error(`Too much precision`);let r=t.toString(),i=e.precisionMultipliers.get(r);if(i)return i;let a=e.precision-t,o=(0,n.default)(10).pow(a);return e.precisionMultipliers.set(r,o),o}static reduceDecimalsFromString(t){let n=t.indexOf(`.`);if(n<0)return{res:t,isDownToZero:!1};let r=t.length-1-n-e.precision;if(r<=0)return{res:t,isDownToZero:!1};let i=t.slice(0,t.length-r);return{res:i,isDownToZero:/^[0.]*$/.test(i)}}constructor(t,a=0){if(typeof t==`number`&&(t=t.toString()),typeof t==`string`){if(t.length===0)throw Error(`empty string`);if(!(0,i.isValidDecimalString)(t))if((0,i.isExponentDecString)(t))t=(0,i.exponentDecStringToDecString)(t);else throw Error(`invalid decimal: ${t}`);let r=e.reduceDecimalsFromString(t);r.isDownToZero,t=r.res,t.indexOf(`.`)>=0&&(a=t.length-t.indexOf(`.`)-1,t=t.replace(`.`,``)),this.int=(0,n.default)(t)}else t instanceof r.Int||t instanceof r.Uint?this.int=(0,n.default)(t.toString()):this.int=(0,n.default)(t);this.int=this.int.multiply(e.calcPrecisionMultiplier(a)),this.checkBitLen()}checkBitLen(){if(this.int.abs().gt(e.maxDec))throw Error(`Integer out of range ${this.int.toString()}`)}isZero(){return this.int.eq((0,n.default)(0))}isNegative(){return this.int.isNegative()}isPositive(){return this.int.isPositive()}equals(e){return this.int.eq(e.int)}gt(e){return this.int.gt(e.int)}gte(e){return this.int.geq(e.int)}lt(e){return this.int.lt(e.int)}lte(e){return this.int.leq(e.int)}neg(){return new e(this.int.negate(),e.precision)}abs(){return new e(this.int.abs(),e.precision)}add(t){return new e(this.int.add(t.int),e.precision)}sub(t){return new e(this.int.subtract(t.int),e.precision)}pow(t){if(t.isZero())return new e(1);if(t.isNegative())return new e(1).quo(this.pow(t.abs()));let n=new e(this.int,e.precision),i=new e(1);for(let e=t;e.gt(new r.Int(1));e=e.div(new r.Int(2)))e.mod(new r.Int(2)).isZero()||(i=i.mul(n)),n=n.mul(n);return n.mul(i)}approxSqrt(){return this.approxRoot(2)}approxRoot(t,n=300){if(this.isNegative())return this.neg().approxRoot(t).neg();if(t===1||this.isZero()||this.equals(e.one))return this;if(t===0)return e.one;let[i,a]=[e.one,e.one];for(let o=0;a.abs().gt(e.smallestDec)&&o<n;o++){let n=i.pow(new r.Int(t-1));n.isZero()&&(n=e.smallestDec),a=this.quo(n),a=a.sub(i),a=a.quoTruncate(new e(t)),i=i.add(a)}return i}mul(t){return new e(this.mulRaw(t).chopPrecisionAndRound(),e.precision)}mulTruncate(t){return new e(this.mulRaw(t).chopPrecisionAndTruncate(),e.precision)}mulRoundUp(t){return new e(this.mulRaw(t).chopPrecisionAndRoundUp(),e.precision)}mulRaw(t){return new e(this.int.multiply(t.int),e.precision)}quo(t){return new e(this.quoRaw(t).chopPrecisionAndRound(),e.precision)}quoTruncate(t){return new e(this.quoRaw(t).chopPrecisionAndTruncate(),e.precision)}quoRoundUp(t){return new e(this.quoRaw(t).chopPrecisionAndRoundUp(),e.precision)}quoRaw(t){let n=e.calcPrecisionMultiplier(0);return new e(this.int.multiply(n).multiply(n).divide(t.int),e.precision)}isInteger(){let t=e.calcPrecisionMultiplier(0);return this.int.remainder(t).equals((0,n.default)(0))}chopPrecisionAndRound(){if(this.isNegative())return this.abs().chopPrecisionAndRound().negate();let t=e.calcPrecisionMultiplier(0),r=t.divide((0,n.default)(2)),{quotient:i,remainder:a}=this.int.divmod(t);return a.equals((0,n.default)(0))||a.lt(r)?i:a.gt(r)?i.add((0,n.default)(1)):i.divide((0,n.default)(2)).equals((0,n.default)(0))?i:i.add((0,n.default)(1))}chopPrecisionAndRoundUp(){if(this.isNegative())return this.abs().chopPrecisionAndTruncate().negate();let t=e.calcPrecisionMultiplier(0),{quotient:r,remainder:i}=this.int.divmod(t);return i.equals((0,n.default)(0))?r:r.add((0,n.default)(1))}chopPrecisionAndTruncate(){let t=e.calcPrecisionMultiplier(0);return this.int.divide(t)}toString(t=e.precision,r=!1){let i=e.calcPrecisionMultiplier(0),{quotient:o,remainder:s}=this.int.abs().divmod(i),c=s.toString(10);for(let t=0,n=c.length;t<e.precision-n;t++)c=`0`+c;c=c.substring(0,t);let l=this.isNegative()&&!(o.eq((0,n.default)(0))&&c.length===0),u=r?(0,a.integerStringToUSLocaleString)(o.toString()):o.toString();return`${l?`-`:``}${u}${c.length>0?`.`+c:``}`}round(){return new r.Int(this.chopPrecisionAndRound())}roundUp(){return new r.Int(this.chopPrecisionAndRoundUp())}truncate(){return new r.Int(this.chopPrecisionAndTruncate())}roundDec(){return new e(this.chopPrecisionAndRound(),0)}roundUpDec(){return new e(this.chopPrecisionAndRoundUp(),0)}truncateDec(){return new e(this.chopPrecisionAndTruncate(),0)}};e.Dec=o,o.precision=18,o.decimalPrecisionBits=60,o.maxDec=(0,n.default)(`133499189745056880149688856635597007162669032647290798121690100488888732861290034376435130433535`),o.precisionMultipliers=new Map,o.zero=new o(0),o.smallestDec=new o(`1`,o.precision),o.one=new o(1),r.Int.prototype.toDec=function(){return new o(this)},r.Uint.prototype.toDec=function(){return new o(this)}})),Ja=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DecUtils=void 0;var t=qa(),n=Ga(),r=class e{static trim(e){let t=typeof e==`string`?e:e.toString();if(t.indexOf(`.`)<0)return t;for(let e=t.length-1;e>=0&&t[e]===`0`;e--)t=t.slice(0,e);return t.length>0&&t[t.length-1]===`.`&&(t=t.slice(0,t.length-1)),t}static getTenExponentN(r){if(r<-t.Dec.precision)throw Error(`Too little precision`);if(e.tenExponentNs[r.toString()])return e.tenExponentNs[r.toString()];let i=new t.Dec(10).pow(new n.Int(r));return e.tenExponentNs[r.toString()]=i,i}static getTenExponentNInPrecisionRange(n){if(n>t.Dec.precision)throw Error(`Too much precision`);return e.getTenExponentN(n)}static getPrecisionDec(t){return e.getTenExponentNInPrecisionRange(t)}};e.DecUtils=r,r.tenExponentNs={}})),Ya=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Coin=void 0;var t=Ga();e.Coin=class e{static parse(t){let n=RegExp(`([0-9]+)[ ]*([a-zA-Z]+)$`).exec(t);if(!n||n.length!==3)throw Error(`Invalid coin str`);let r=n[2],i=n[1];return new e(r,i)}constructor(e,n){this.denom=e,this.amount=n instanceof t.Int?n:new t.Int(n)}toString(){return`${this.amount.toString()}${this.denom}`}}})),Xa=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CoinUtils=void 0;var t=Ya(),n=Ga(),r=qa(),i=Ja(),a=Ka(),o=class e{static createCoinsFromPrimitives(e){return e.map(e=>new t.Coin(e.denom,e.amount))}static amountOf(e,t){let r=e.find(e=>e.denom===t);return r?r.amount:new n.Int(0)}static exclude(e,t){return e.filter(e=>t.indexOf(e.denom)===0)}static concat(...e){return e.length===0?[]:e.slice().reduce((e,n)=>{let r=e.find(e=>e.denom===n.denom);if(r){let i=new t.Coin(r.denom,r.amount.add(n.amount));e.push(i)}else{let r=new t.Coin(n.denom,n.amount);e.push(r)}return e},[])}static getCoinFromDecimals(e,n,i){let a=e.find(e=>e.coinDenom===i);if(!a)throw Error(`Invalid currency`);let o=new r.Dec(1);for(let e=0;e<a.coinDecimals;e++)o=o.mul(new r.Dec(10));let s=new r.Dec(n);if(s=s.mul(o),!new r.Dec(s.truncate()).equals(s))throw Error(`Can't divide anymore`);return new t.Coin(a.coinMinimalDenom,s.truncate())}static parseDecAndDenomFromCoin(e,t){let n=e.find(e=>e.coinMinimalDenom===t.denom);n||={coinDecimals:0,coinDenom:t.denom,coinMinimalDenom:t.denom};let i=new r.Dec(1);for(let e=0;e<n.coinDecimals;e++)i=i.mul(new r.Dec(10));return{amount:new r.Dec(t.amount).quoTruncate(i).toString(n.coinDecimals),denom:n.coinDenom}}static shrinkDecimals(t,n,i,a=!1){if(t.equals(new r.Dec(0)))return`0`;let o=t.isNegative(),s=t.abs().truncate(),c=t.abs().sub(new r.Dec(s)),l=Math.max(i-s.toString().length+1,n),u=l===0?``:c.toString(l).replace(`0.`,``),d=a?e.integerStringToUSLocaleString(s.toString()):s.toString();return(o?`-`:``)+d+(u.length>0?`.`:``)+u}static coinToTrimmedString(e,t,n=` `){let a=new r.Dec(e.amount).quoTruncate(i.DecUtils.getPrecisionDec(t.coinDecimals));return`${i.DecUtils.trim(a)}${n}${t.coinDenom}`}};e.CoinUtils=o,o.integerStringToUSLocaleString=a.integerStringToUSLocaleString})),Za=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.IntPretty=void 0;var t=Ga(),n=qa(),r=Ja(),i=Xa();e.IntPretty=class e{constructor(e){if(this.floatingDecimalPointRight=0,this._options={maxDecimals:0,trim:!1,shrink:!1,ready:!0,locale:!0,inequalitySymbol:!1,inequalitySymbolSeparator:` `},typeof e==`object`&&`toDec`in e?e=e.toDec():e instanceof n.Dec||(e=new n.Dec(e)),e.isZero()){this.dec=e;return}let r=e,i=0;for(let e=0;e<18&&!(!r.truncate().equals(new t.Int(0))&&r.equals(new n.Dec(r.truncate())));e++)r=r.mul(new n.Dec(10)),i++;this.dec=e,this._options.maxDecimals=i}get options(){return this._options}moveDecimalPointLeft(e){let t=this.clone();return t.floatingDecimalPointRight+=-e,t}moveDecimalPointRight(e){let t=this.clone();return t.floatingDecimalPointRight+=e,t}increasePrecision(e){return this.moveDecimalPointLeft(e)}decreasePrecision(e){return this.moveDecimalPointRight(e)}maxDecimals(e){let t=this.clone();return t._options.maxDecimals=e,t}inequalitySymbol(e){let t=this.clone();return t._options.inequalitySymbol=e,t}inequalitySymbolSeparator(e){let t=this.clone();return t._options.inequalitySymbolSeparator=e,t}trim(e){let t=this.clone();return t._options.trim=e,t}shrink(e){let t=this.clone();return t._options.shrink=e,t}locale(e){let t=this.clone();return t._options.locale=e,t}ready(e){let t=this.clone();return t._options.ready=e,t}get isReady(){return this._options.ready}add(t){t instanceof n.Dec||(t=t.toDec());let r=new e(this.toDec().add(t));return r._options=Object.assign({},this._options),r}sub(t){t instanceof n.Dec||(t=t.toDec());let r=new e(this.toDec().sub(t));return r._options=Object.assign({},this._options),r}mul(t){t instanceof n.Dec||(t=t.toDec());let r=new e(this.toDec().mul(t));return r._options=Object.assign({},this._options),r}quo(t){t instanceof n.Dec||(t=t.toDec());let r=new e(this.toDec().quo(t));return r._options=Object.assign({},this._options),r}toDec(){if(this.floatingDecimalPointRight===0)return this.dec;if(this.floatingDecimalPointRight>0)return this.dec.mulTruncate(r.DecUtils.getTenExponentN(this.floatingDecimalPointRight));{let e=-this.floatingDecimalPointRight,t=this.dec;for(;e>0;)if(e>=n.Dec.precision)t=t.mulTruncate(r.DecUtils.getTenExponentN(-n.Dec.precision)),e-=n.Dec.precision;else{t=t.mulTruncate(r.DecUtils.getTenExponentN(-(e%n.Dec.precision)));break}return t}}toString(){return this.toStringWithSymbols(``,``)}toStringWithSymbols(e,t){let n=this.toDec();if(this._options.inequalitySymbol&&!n.isZero()&&n.abs().lt(r.DecUtils.getTenExponentN(-this._options.maxDecimals))){let i=n.isNegative();return`${i?`>`:`<`}${this._options.inequalitySymbolSeparator}${i?`-`:``}${e}${r.DecUtils.getTenExponentN(-this._options.maxDecimals).toString(this._options.maxDecimals,this._options.locale)}${t}`}let a;a=this._options.shrink?i.CoinUtils.shrinkDecimals(n,0,this._options.maxDecimals,this._options.locale):n.toString(this._options.maxDecimals,this._options.locale),this._options.trim&&(a=r.DecUtils.trim(a));let o=a.charAt(0)===`-`;return o&&(a=a.slice(1)),`${o?`-`:``}${e}${a}${t}`}clone(){let t=new e(this.dec);return t.dec=this.dec,t.floatingDecimalPointRight=this.floatingDecimalPointRight,t._options=Object.assign({},this._options),t}}})),Qa=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CoinPretty=void 0;var t=Za(),n=qa(),r=Ja();e.CoinPretty=class e{constructor(e,i){this._currency=e,this._options={separator:` `,upperCase:!1,lowerCase:!1,hideDenom:!1,hideIBCMetadata:!1},typeof i==`object`&&`toDec`in i?i=i.toDec():i instanceof n.Dec||(i=new n.Dec(i)),this.intPretty=new t.IntPretty(i.quoTruncate(r.DecUtils.getTenExponentNInPrecisionRange(e.coinDecimals))).maxDecimals(e.coinDecimals)}get options(){return Object.assign(Object.assign({},this._options),this.intPretty.options)}get denom(){return this.currency.coinDenom}get currency(){return this._currency}setCurrency(e){let t=this.clone();return t.intPretty=this.intPretty.moveDecimalPointRight(this._currency.coinDecimals-e.coinDecimals),t._currency=e,t}separator(e){let t=this.clone();return t._options.separator=e,t}upperCase(e){let t=this.clone();return t._options.upperCase=e,t._options.lowerCase=!e,t}lowerCase(e){let t=this.clone();return t._options.lowerCase=e,t._options.upperCase=!e,t}hideDenom(e){let t=this.clone();return t._options.hideDenom=e,t}hideIBCMetadata(e){let t=this.clone();return t._options.hideIBCMetadata=e,t}moveDecimalPointLeft(e){let t=this.clone();return t.intPretty=t.intPretty.moveDecimalPointLeft(e),t}moveDecimalPointRight(e){let t=this.clone();return t.intPretty=t.intPretty.moveDecimalPointRight(e),t}increasePrecision(e){return this.moveDecimalPointLeft(e)}decreasePrecision(e){return this.moveDecimalPointRight(e)}maxDecimals(e){let t=this.clone();return t.intPretty=t.intPretty.maxDecimals(e),t}inequalitySymbol(e){let t=this.clone();return t.intPretty=t.intPretty.inequalitySymbol(e),t}inequalitySymbolSeparator(e){let t=this.clone();return t.intPretty=t.intPretty.inequalitySymbolSeparator(e),t}trim(e){let t=this.clone();return t.intPretty=t.intPretty.trim(e),t}shrink(e){let t=this.clone();return t.intPretty=t.intPretty.shrink(e),t}locale(e){let t=this.clone();return t.intPretty=t.intPretty.locale(e),t}ready(e){let t=this.clone();return t.intPretty=t.intPretty.ready(e),t}get isReady(){return this.intPretty.isReady}add(t){let n=t instanceof e;if(n&&`currency`in t&&this.currency.coinMinimalDenom!==t.currency.coinMinimalDenom)return this.clone();`toDec`in t&&(t=t.toDec());let i=this.clone();return i.intPretty=i.intPretty.add(n?t:t.mul(r.DecUtils.getTenExponentNInPrecisionRange(-this._currency.coinDecimals))),i}sub(t){let n=t instanceof e;if(n&&`currency`in t&&this.currency.coinMinimalDenom!==t.currency.coinMinimalDenom)return this.clone();`toDec`in t&&(t=t.toDec());let i=this.clone();return i.intPretty=i.intPretty.sub(n?t:t.mul(r.DecUtils.getTenExponentNInPrecisionRange(-this._currency.coinDecimals))),i}mul(e){let t=this.clone();return t.intPretty=t.intPretty.mul(e),t}quo(e){let t=this.clone();return t.intPretty=t.intPretty.quo(e),t}toDec(){return this.intPretty.toDec()}toCoin(){let e=this.toDec().mulTruncate(r.DecUtils.getTenExponentNInPrecisionRange(this.currency.coinDecimals)).truncate();return{denom:this.currency.coinMinimalDenom,amount:e.toString()}}toString(){let e=this.denom;this._options.hideIBCMetadata&&`originCurrency`in this.currency&&this.currency.originCurrency&&(e=this.currency.originCurrency.coinDenom),this._options.upperCase&&(e=e.toUpperCase()),this._options.lowerCase&&(e=e.toLowerCase());let t=this._options.separator;return this._options.hideDenom&&(e=``,t=``),this.intPretty.toStringWithSymbols(``,`${t}${e}`)}clone(){let t=new e(this._currency,0);return t._options=Object.assign({},this._options),t.intPretty=this.intPretty.clone(),t}}})),$a=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.PricePretty=void 0;var t=Za(),n=Ja();e.PricePretty=class e{constructor(e,n){this._fiatCurrency=e,this._options={separator:``,upperCase:!1,lowerCase:!1,locale:`en-US`},this.intPretty=new t.IntPretty(n).maxDecimals(e.maxDecimals).shrink(!0).trim(!0).locale(!1).inequalitySymbol(!0),this._options.locale=e.locale}get options(){return Object.assign(Object.assign({},this.intPretty.options),this._options)}get symbol(){return this._fiatCurrency.symbol}get fiatCurrency(){return this._fiatCurrency}separator(e){let t=this.clone();return t._options.separator=e,t}upperCase(e){let t=this.clone();return t._options.upperCase=e,t._options.lowerCase=!e,t}lowerCase(e){let t=this.clone();return t._options.lowerCase=e,t._options.upperCase=!e,t}moveDecimalPointLeft(e){let t=this.clone();return t.intPretty=t.intPretty.moveDecimalPointLeft(e),t}moveDecimalPointRight(e){let t=this.clone();return t.intPretty=t.intPretty.moveDecimalPointRight(e),t}increasePrecision(e){return this.moveDecimalPointLeft(e)}decreasePrecision(e){return this.moveDecimalPointRight(e)}maxDecimals(e){let t=this.clone();return t.intPretty=t.intPretty.maxDecimals(e),t}inequalitySymbol(e){let t=this.clone();return t.intPretty=t.intPretty.inequalitySymbol(e),t}inequalitySymbolSeparator(e){let t=this.clone();return t.intPretty=t.intPretty.inequalitySymbolSeparator(e),t}trim(e){let t=this.clone();return t.intPretty=t.intPretty.trim(e),t}shrink(e){let t=this.clone();return t.intPretty=t.intPretty.shrink(e),t}locale(e){let t=this.clone();return t._options.locale=e,t}ready(e){let t=this.clone();return t.intPretty=t.intPretty.ready(e),t}get isReady(){return this.intPretty.isReady}add(e){let t=this.clone();return t.intPretty=t.intPretty.add(e),t}sub(e){let t=this.clone();return t.intPretty=t.intPretty.sub(e),t}mul(e){let t=this.clone();return t.intPretty=t.intPretty.mul(e),t}quo(e){let t=this.clone();return t.intPretty=t.intPretty.quo(e),t}toDec(){return this.intPretty.toDec()}toString(){let e=this.symbol;this._options.upperCase&&(e=e.toUpperCase()),this._options.lowerCase&&(e=e.toLowerCase());let t=this.toDec(),r=this.options;if(r.inequalitySymbol&&!t.isZero()&&t.abs().lt(n.DecUtils.getTenExponentN(-r.maxDecimals)))return this.intPretty.toStringWithSymbols(`${e}${this._options.separator}`,``);let i=parseFloat(this.intPretty.toString()).toLocaleString(r.locale,{maximumFractionDigits:r.maxDecimals}),a=i.charAt(0)===`-`;return a&&(i=i.slice(1)),`${a?`-`:``}${e}${this._options.separator}${i}`}clone(){let t=new e(this._fiatCurrency,0);return t._options=Object.assign({},this._options),t.intPretty=this.intPretty.clone(),t}}})),eo=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.RatePretty=void 0;var t=Za();e.RatePretty=class e{constructor(e){this._options={separator:``,symbol:`%`},this.intPretty=new t.IntPretty(e),this.intPretty=this.intPretty.maxDecimals(3).shrink(!1).trim(!0).locale(!0).inequalitySymbol(!0)}get options(){return Object.assign(Object.assign({},this.intPretty.options),this._options)}separator(e){let t=this.clone();return t._options.separator=e,t}symbol(e){let t=this.clone();return t._options.symbol=e,t}moveDecimalPointLeft(e){let t=this.clone();return t.intPretty=t.intPretty.moveDecimalPointLeft(e),t}moveDecimalPointRight(e){let t=this.clone();return t.intPretty=t.intPretty.moveDecimalPointRight(e),t}maxDecimals(e){let t=this.clone();return t.intPretty=t.intPretty.maxDecimals(e),t}inequalitySymbol(e){let t=this.clone();return t.intPretty=t.intPretty.inequalitySymbol(e),t}inequalitySymbolSeparator(e){let t=this.clone();return t.intPretty=t.intPretty.inequalitySymbolSeparator(e),t}trim(e){let t=this.clone();return t.intPretty=t.intPretty.trim(e),t}shrink(e){let t=this.clone();return t.intPretty=t.intPretty.shrink(e),t}locale(e){let t=this.clone();return t.intPretty=t.intPretty.locale(e),t}ready(e){let t=this.clone();return t.intPretty=t.intPretty.ready(e),t}get isReady(){return this.intPretty.isReady}add(e){let t=this.clone();return t.intPretty=t.intPretty.add(e),t}sub(e){let t=this.clone();return t.intPretty=t.intPretty.sub(e),t}mul(e){let t=this.clone();return t.intPretty=t.intPretty.mul(e),t}quo(e){let t=this.clone();return t.intPretty=t.intPretty.quo(e),t}toDec(){return this.intPretty.toDec()}toString(){return this.intPretty.moveDecimalPointRight(2).toStringWithSymbols(``,`${this._options.separator}${this._options.symbol}`)}clone(){let t=new e(0);return t._options=Object.assign({},this._options),t.intPretty=this.intPretty.clone(),t}}})),to=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(Za(),e),n(Qa(),e),n(Ya(),e),n(Ga(),e),n(qa(),e),n(Xa(),e),n(Ja(),e),n($a(),e),n(eo(),e)})),no=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isSimpleFetchError=e.SimpleFetchError=void 0;var t=class e extends Error{constructor(t,n,r){super(`Failed to get response from ${new URL(n,t).toString()}`),this.baseURL=t,this.url=n,this.response=r,Object.setPrototypeOf(this,e.prototype)}};e.SimpleFetchError=t;function n(e){return e instanceof t}e.isSimpleFetchError=n})),ro=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},n=e&&e.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};Object.defineProperty(e,`__esModule`,{value:!0}),e.simpleFetch=e.makeURL=void 0;var r=no();function i(e,t){let n=new URL(e);return e=o(n.origin),t=o(n.pathname)+`/`+a(t),o(e+`/`+a(t))}e.makeURL=i;function a(e){return e.length>0&&e[0]===`/`?e.slice(1):e}function o(e){return e.length>0&&e[e.length-1]===`/`?e.slice(0,e.length-1):e}function s(e,a,o){return t(this,void 0,void 0,function*(){typeof a!=`string`&&(a&&(o=a),a=``),a===`/`&&(a=``);let t=i(e,a),s=o||{},{headers:l}=s,u=n(s,[`headers`]),d=yield fetch(t,Object.assign({headers:Object.assign({accept:`application/json, text/plain, */*`},l)},u)),f;if((d.headers.get(`content-type`)||``).startsWith(`application/json`))f=yield d.json();else{let e=yield d.text(),t=e.trim();f=t.startsWith(`{`)&&t.endsWith(`}`)?JSON.parse(t):e}let p={url:t,data:f,headers:d.headers,status:d.status,statusText:d.statusText};if(!(o?.validateStatus||c)(d.status))throw new r.SimpleFetchError(e,a,p);return p})}e.simpleFetch=s;function c(e){return e===200}})),io=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),ao=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(ro(),e),n(no(),e),n(io(),e)})),oo=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.BaseAccount=void 0;var n=to(),r=ao();e.BaseAccount=class e{static fetchFromRest(n,i,a=!1){return t(this,void 0,void 0,function*(){let t=yield(0,r.simpleFetch)(n,`/cosmos/auth/v1beta1/accounts/${i}`,{validateStatus:function(e){return e>=200&&e<300||e===404}});return e.fromProtoJSON(t.data,a?i:``)})}static fromProtoJSON(t,r=``){if(!t.account){if(!r)throw Error(`Account's address is unknown: ${JSON.stringify(t)}`);return new e(``,r,new n.Int(0),new n.Int(0))}let i=t.account,a=i[`@type`]||``,o=i.BaseAccount||i.baseAccount||i.base_account;o&&(i=o);let s=i.account;s&&(i=s);let c=i.BaseVestingAccount||i.baseVestingAccount||i.base_vesting_account;if(c){i=c;let e=i.BaseAccount||i.baseAccount||i.base_account;e&&(i=e)}let l=i.address;if(!l){if(!r)throw Error(`Account's address is unknown: ${JSON.stringify(t)}`);l=r}let u=i.account_number,d=i.sequence;return new e(a,l,new n.Int(u||`0`),new n.Int(d||`0`))}constructor(e,t,n,r){this.type=e,this.address=t,this.accountNumber=n,this.sequence=r}getType(){return this.type}getAddress(){return this.address}getAccountNumber(){return this.accountNumber}getSequence(){return this.sequence}}})),so,co=t((()=>{so=`logger/5.8.0`}));function lo(){try{let e=[];if([`NFD`,`NFC`,`NFKD`,`NFKC`].forEach(t=>{try{if(`test`.normalize(t)!==`test`)throw Error(`bad normalize`)}catch{e.push(t)}}),e.length)throw Error(`missing `+e.join(`, `));if(`é`.normalize(`NFD`)!==`é`)throw Error(`broken implementation`)}catch(e){return e.message}return null}var uo,fo,po,mo,ho,go,_o,vo,yo,bo,xo=t((()=>{co(),uo=!1,fo=!1,po={debug:1,default:2,info:2,warning:3,error:4,off:5},mo=po.default,ho=null,go=lo(),(function(e){e.DEBUG=`DEBUG`,e.INFO=`INFO`,e.WARNING=`WARNING`,e.ERROR=`ERROR`,e.OFF=`OFF`})(_o||={}),(function(e){e.UNKNOWN_ERROR=`UNKNOWN_ERROR`,e.NOT_IMPLEMENTED=`NOT_IMPLEMENTED`,e.UNSUPPORTED_OPERATION=`UNSUPPORTED_OPERATION`,e.NETWORK_ERROR=`NETWORK_ERROR`,e.SERVER_ERROR=`SERVER_ERROR`,e.TIMEOUT=`TIMEOUT`,e.BUFFER_OVERRUN=`BUFFER_OVERRUN`,e.NUMERIC_FAULT=`NUMERIC_FAULT`,e.MISSING_NEW=`MISSING_NEW`,e.INVALID_ARGUMENT=`INVALID_ARGUMENT`,e.MISSING_ARGUMENT=`MISSING_ARGUMENT`,e.UNEXPECTED_ARGUMENT=`UNEXPECTED_ARGUMENT`,e.CALL_EXCEPTION=`CALL_EXCEPTION`,e.INSUFFICIENT_FUNDS=`INSUFFICIENT_FUNDS`,e.NONCE_EXPIRED=`NONCE_EXPIRED`,e.REPLACEMENT_UNDERPRICED=`REPLACEMENT_UNDERPRICED`,e.UNPREDICTABLE_GAS_LIMIT=`UNPREDICTABLE_GAS_LIMIT`,e.TRANSACTION_REPLACED=`TRANSACTION_REPLACED`,e.ACTION_REJECTED=`ACTION_REJECTED`})(vo||={}),yo=`0123456789abcdef`,bo=class e{constructor(e){Object.defineProperty(this,`version`,{enumerable:!0,value:e,writable:!1})}_log(e,t){let n=e.toLowerCase();po[n]??this.throwArgumentError(`invalid log level name`,`logLevel`,e),!(mo>po[n])&&console.log.apply(console,t)}debug(...t){this._log(e.levels.DEBUG,t)}info(...t){this._log(e.levels.INFO,t)}warn(...t){this._log(e.levels.WARNING,t)}makeError(t,n,r){if(fo)return this.makeError(`censored error`,n,{});n||=e.errors.UNKNOWN_ERROR,r||={};let i=[];Object.keys(r).forEach(e=>{let t=r[e];try{if(t instanceof Uint8Array){let n=``;for(let e=0;e<t.length;e++)n+=yo[t[e]>>4],n+=yo[t[e]&15];i.push(e+`=Uint8Array(0x`+n+`)`)}else i.push(e+`=`+JSON.stringify(t))}catch{i.push(e+`=`+JSON.stringify(r[e].toString()))}}),i.push(`code=${n}`),i.push(`version=${this.version}`);let a=t,o=``;switch(n){case vo.NUMERIC_FAULT:{o=`NUMERIC_FAULT`;let e=t;switch(e){case`overflow`:case`underflow`:case`division-by-zero`:o+=`-`+e;break;case`negative-power`:case`negative-width`:o+=`-unsupported`;break;case`unbound-bitwise-result`:o+=`-unbound-result`;break}break}case vo.CALL_EXCEPTION:case vo.INSUFFICIENT_FUNDS:case vo.MISSING_NEW:case vo.NONCE_EXPIRED:case vo.REPLACEMENT_UNDERPRICED:case vo.TRANSACTION_REPLACED:case vo.UNPREDICTABLE_GAS_LIMIT:o=n;break}o&&(t+=` [ See: https://links.ethers.org/v5-errors-`+o+` ]`),i.length&&(t+=` (`+i.join(`, `)+`)`);let s=Error(t);return s.reason=a,s.code=n,Object.keys(r).forEach(function(e){s[e]=r[e]}),s}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(t,n,r){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:n,value:r})}assert(e,t,n,r){e||this.throwError(t,n,r)}assertArgument(e,t,n,r){e||this.throwArgumentError(t,n,r)}checkNormalize(t){t??=`platform missing String.prototype.normalize`,go&&this.throwError(`platform missing String.prototype.normalize`,e.errors.UNSUPPORTED_OPERATION,{operation:`String.prototype.normalize`,form:go})}checkSafeUint53(t,n){typeof t==`number`&&(n??=`value not safe`,(t<0||t>=9007199254740991)&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:`checkSafeInteger`,fault:`out-of-safe-range`,value:t}),t%1&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:`checkSafeInteger`,fault:`non-integer`,value:t}))}checkArgumentCount(t,n,r){r=r?`: `+r:``,t<n&&this.throwError(`missing argument`+r,e.errors.MISSING_ARGUMENT,{count:t,expectedCount:n}),t>n&&this.throwError(`too many arguments`+r,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:n})}checkNew(t,n){(t===Object||t==null)&&this.throwError(`missing new`,e.errors.MISSING_NEW,{name:n.name})}checkAbstract(t,n){t===n?this.throwError(`cannot instantiate abstract class `+JSON.stringify(n.name)+` directly; use a sub-class`,e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:`new`}):(t===Object||t==null)&&this.throwError(`missing new`,e.errors.MISSING_NEW,{name:n.name})}static globalLogger(){return ho||=new e(so),ho}static setCensorship(t,n){if(!t&&n&&this.globalLogger().throwError(`cannot permanently disable censorship`,e.errors.UNSUPPORTED_OPERATION,{operation:`setCensorship`}),uo){if(!t)return;this.globalLogger().throwError(`error censorship permanent`,e.errors.UNSUPPORTED_OPERATION,{operation:`setCensorship`})}fo=!!t,uo=!!n}static setLogLevel(t){let n=po[t.toLowerCase()];if(n==null){e.globalLogger().warn(`invalid log level - `+t);return}mo=n}static from(t){return new e(t)}},bo.errors=vo,bo.levels=_o})),So,Co=t((()=>{So=`bytes/5.8.0`}));function wo(e){return!!e.toHexString}function To(e){return e.slice||=function(){let t=Array.prototype.slice.call(arguments);return To(new Uint8Array(Array.prototype.slice.apply(e,t)))},e}function Eo(e){return Mo(e)&&!(e.length%2)||Oo(e)}function Do(e){return typeof e==`number`&&e==e&&e%1==0}function Oo(e){if(e==null)return!1;if(e.constructor===Uint8Array)return!0;if(typeof e==`string`||!Do(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){let n=e[t];if(!Do(n)||n<0||n>=256)return!1}return!0}function ko(e,t){if(t||={},typeof e==`number`){Io.checkSafeUint53(e,`invalid arrayify value`);let t=[];for(;e;)t.unshift(e&255),e=parseInt(String(e/256));return t.length===0&&t.push(0),To(new Uint8Array(t))}if(t.allowMissingPrefix&&typeof e==`string`&&e.substring(0,2)!==`0x`&&(e=`0x`+e),wo(e)&&(e=e.toHexString()),Mo(e)){let n=e.substring(2);n.length%2&&(t.hexPad===`left`?n=`0`+n:t.hexPad===`right`?n+=`0`:Io.throwArgumentError(`hex data is odd-length`,`value`,e));let r=[];for(let e=0;e<n.length;e+=2)r.push(parseInt(n.substring(e,e+2),16));return To(new Uint8Array(r))}return Oo(e)?To(new Uint8Array(e)):Io.throwArgumentError(`invalid arrayify value`,`value`,e)}function Ao(e){let t=e.map(e=>ko(e)),n=t.reduce((e,t)=>e+t.length,0),r=new Uint8Array(n);return t.reduce((e,t)=>(r.set(t,e),e+t.length),0),To(r)}function jo(e){let t=ko(e);if(t.length===0)return t;let n=0;for(;n<t.length&&t[n]===0;)n++;return n&&(t=t.slice(n)),t}function Mo(e,t){return!(typeof e!=`string`||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}function No(e,t){if(t||={},typeof e==`number`){Io.checkSafeUint53(e,`invalid hexlify value`);let t=``;for(;e;)t=Lo[e&15]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t=`0`+t),`0x`+t):`0x00`}if(typeof e==`bigint`)return e=e.toString(16),e.length%2?`0x0`+e:`0x`+e;if(t.allowMissingPrefix&&typeof e==`string`&&e.substring(0,2)!==`0x`&&(e=`0x`+e),wo(e))return e.toHexString();if(Mo(e))return e.length%2&&(t.hexPad===`left`?e=`0x0`+e.substring(2):t.hexPad===`right`?e+=`0`:Io.throwArgumentError(`hex data is odd-length`,`value`,e)),e.toLowerCase();if(Oo(e)){let t=`0x`;for(let n=0;n<e.length;n++){let r=e[n];t+=Lo[(r&240)>>4]+Lo[r&15]}return t}return Io.throwArgumentError(`invalid hexlify value`,`value`,e)}function Po(e){if(typeof e!=`string`)e=No(e);else if(!Mo(e)||e.length%2)return null;return(e.length-2)/2}function Fo(e,t,n){return typeof e==`string`?(!Mo(e)||e.length%2)&&Io.throwArgumentError(`invalid hexData`,`value`,e):e=No(e),t=2+2*t,n==null?`0x`+e.substring(t):`0x`+e.substring(t,2+2*n)}var Io,Lo,Ro=t((()=>{xo(),Co(),Io=new bo(So),Lo=`0123456789abcdef`})),zo,Bo=t((()=>{zo=`bignumber/5.8.0`}));function Vo(e){if(typeof e!=`string`)return Vo(e.toString(16));if(e[0]===`-`)return e=e.substring(1),e[0]===`-`&&Jo.throwArgumentError(`invalid hex`,`value`,e),e=Vo(e),e===`0x00`?e:`-`+e;if(e.substring(0,2)!==`0x`&&(e=`0x`+e),e===`0x`)return`0x00`;for(e.length%2&&(e=`0x0`+e.substring(2));e.length>4&&e.substring(0,4)===`0x00`;)e=`0x`+e.substring(4);return e}function Ho(e){return Qo.from(Vo(e))}function K(e){let t=Qo.from(e).toHexString();return t[0]===`-`?new qo(`-`+t.substring(3),16):new qo(t.substring(2),16)}function Uo(e,t,n){let r={fault:e,operation:t};return n!=null&&(r.value=n),Jo.throwError(e,bo.errors.NUMERIC_FAULT,r)}function Wo(e){return new qo(e,36).toString(16)}function Go(e){return new qo(e,16).toString(36)}var Ko,qo,Jo,Yo,Xo,Zo,Qo,$o=t((()=>{Ko=i(w()),Ro(),xo(),Bo(),qo=Ko.default.BN,Jo=new bo(zo),Yo={},Xo=9007199254740991,Zo=!1,Qo=class e{constructor(e,t){e!==Yo&&Jo.throwError(`cannot call constructor directly; use BigNumber.from`,bo.errors.UNSUPPORTED_OPERATION,{operation:`new (BigNumber)`}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Ho(K(this).fromTwos(e))}toTwos(e){return Ho(K(this).toTwos(e))}abs(){return this._hex[0]===`-`?e.from(this._hex.substring(1)):this}add(e){return Ho(K(this).add(K(e)))}sub(e){return Ho(K(this).sub(K(e)))}div(t){return e.from(t).isZero()&&Uo(`division-by-zero`,`div`),Ho(K(this).div(K(t)))}mul(e){return Ho(K(this).mul(K(e)))}mod(e){let t=K(e);return t.isNeg()&&Uo(`division-by-zero`,`mod`),Ho(K(this).umod(t))}pow(e){let t=K(e);return t.isNeg()&&Uo(`negative-power`,`pow`),Ho(K(this).pow(t))}and(e){let t=K(e);return(this.isNegative()||t.isNeg())&&Uo(`unbound-bitwise-result`,`and`),Ho(K(this).and(t))}or(e){let t=K(e);return(this.isNegative()||t.isNeg())&&Uo(`unbound-bitwise-result`,`or`),Ho(K(this).or(t))}xor(e){let t=K(e);return(this.isNegative()||t.isNeg())&&Uo(`unbound-bitwise-result`,`xor`),Ho(K(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&Uo(`negative-width`,`mask`),Ho(K(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Uo(`negative-width`,`shl`),Ho(K(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Uo(`negative-width`,`shr`),Ho(K(this).shrn(e))}eq(e){return K(this).eq(K(e))}lt(e){return K(this).lt(K(e))}lte(e){return K(this).lte(K(e))}gt(e){return K(this).gt(K(e))}gte(e){return K(this).gte(K(e))}isNegative(){return this._hex[0]===`-`}isZero(){return K(this).isZero()}toNumber(){try{return K(this).toNumber()}catch{Uo(`overflow`,`toNumber`,this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Jo.throwError(`this platform does not support BigInt`,bo.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?Zo||(Zo=!0,Jo.warn(`BigNumber.toString does not accept any parameters; base-10 is assumed`)):arguments[0]===16?Jo.throwError(`BigNumber.toString does not accept any parameters; use bigNumber.toHexString()`,bo.errors.UNEXPECTED_ARGUMENT,{}):Jo.throwError(`BigNumber.toString does not accept parameters`,bo.errors.UNEXPECTED_ARGUMENT,{})),K(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:`BigNumber`,hex:this.toHexString()}}static from(t){if(t instanceof e)return t;if(typeof t==`string`)return t.match(/^-?0x[0-9a-f]+$/i)?new e(Yo,Vo(t)):t.match(/^-?[0-9]+$/)?new e(Yo,Vo(new qo(t))):Jo.throwArgumentError(`invalid BigNumber string`,`value`,t);if(typeof t==`number`)return t%1&&Uo(`underflow`,`BigNumber.from`,t),(t>=Xo||t<=-Xo)&&Uo(`overflow`,`BigNumber.from`,t),e.from(String(t));let n=t;if(typeof n==`bigint`)return e.from(n.toString());if(Oo(n))return e.from(No(n));if(n)if(n.toHexString){let t=n.toHexString();if(typeof t==`string`)return e.from(t)}else{let t=n._hex;if(t==null&&n.type===`BigNumber`&&(t=n.hex),typeof t==`string`&&(Mo(t)||t[0]===`-`&&Mo(t.substring(1))))return e.from(t)}return Jo.throwArgumentError(`invalid BigNumber value`,`value`,t)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}})),es=t((()=>{$o(),Ro(),xo(),Bo()})),ts=a(((e,t)=>{m(),s(),(function(){var e=`input is invalid type`,n=`finalize already called`,r=typeof window==`object`,i=r?window:{};i.JS_SHA3_NO_WINDOW&&(r=!1);var a=!r&&typeof self==`object`;!i.JS_SHA3_NO_NODE_JS&&typeof o==`object`&&o.versions&&o.versions.node?i=h:a&&(i=self);var s=!i.JS_SHA3_NO_COMMON_JS&&typeof t==`object`&&t.exports,c=typeof define==`function`&&define.amd,l=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<`u`,u=`0123456789abcdef`.split(``),d=[31,7936,2031616,520093696],f=[4,1024,262144,67108864],p=[1,256,65536,16777216],m=[6,1536,393216,100663296],g=[0,8,16,24],_=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],v=[224,256,384,512],y=[128,256],b=[`hex`,`buffer`,`arrayBuffer`,`array`,`digest`],x={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(e){return Object.prototype.toString.call(e)===`[object Array]`}),l&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(e){return typeof e==`object`&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var S=function(e,t,n){return function(r){return new L(e,t,e).update(r)[n]()}},C=function(e,t,n){return function(r,i){return new L(e,t,i).update(r)[n]()}},w=function(e,t,n){return function(t,r,i,a){return k[`cshake`+e].update(t,r,i,a)[n]()}},T=function(e,t,n){return function(t,r,i,a){return k[`kmac`+e].update(t,r,i,a)[n]()}},E=function(e,t,n,r){for(var i=0;i<b.length;++i){var a=b[i];e[a]=t(n,r,a)}return e},D=function(e,t){var n=S(e,t,`hex`);return n.create=function(){return new L(e,t,e)},n.update=function(e){return n.create().update(e)},E(n,S,e,t)},O=[{name:`keccak`,padding:p,bits:v,createMethod:D},{name:`sha3`,padding:m,bits:v,createMethod:D},{name:`shake`,padding:d,bits:y,createMethod:function(e,t){var n=C(e,t,`hex`);return n.create=function(n){return new L(e,t,n)},n.update=function(e,t){return n.create(t).update(e)},E(n,C,e,t)}},{name:`cshake`,padding:f,bits:y,createMethod:function(e,t){var n=x[e],r=w(e,t,`hex`);return r.create=function(r,i,a){return!i&&!a?k[`shake`+e].create(r):new L(e,t,r).bytepad([i,a],n)},r.update=function(e,t,n,i){return r.create(t,n,i).update(e)},E(r,w,e,t)}},{name:`kmac`,padding:f,bits:y,createMethod:function(e,t){var n=x[e],r=T(e,t,`hex`);return r.create=function(r,i,a){return new R(e,t,i).bytepad([`KMAC`,a],n).bytepad([r],n)},r.update=function(e,t,n,i){return r.create(e,n,i).update(t)},E(r,T,e,t)}}],k={},A=[],j=0;j<O.length;++j)for(var M=O[j],N=M.bits,P=0;P<N.length;++P){var F=M.name+`_`+N[P];if(A.push(F),k[F]=M.createMethod(N[P],M.padding),M.name!==`sha3`){var I=M.name+N[P];A.push(I),k[I]=k[F]}}function L(e,t,n){this.blocks=[],this.s=[],this.padding=t,this.outputBits=n,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(n&31)>>3;for(var r=0;r<50;++r)this.s[r]=0}L.prototype.update=function(t){if(this.finalized)throw Error(n);var r,i=typeof t;if(i!==`string`){if(i===`object`){if(t===null)throw Error(e);if(l&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!l||!ArrayBuffer.isView(t)))throw Error(e)}else throw Error(e);r=!0}for(var a=this.blocks,o=this.byteCount,s=t.length,c=this.blockCount,u=0,d=this.s,f,p;u<s;){if(this.reset)for(this.reset=!1,a[0]=this.block,f=1;f<c+1;++f)a[f]=0;if(r)for(f=this.start;u<s&&f<o;++u)a[f>>2]|=t[u]<<g[f++&3];else for(f=this.start;u<s&&f<o;++u)p=t.charCodeAt(u),p<128?a[f>>2]|=p<<g[f++&3]:p<2048?(a[f>>2]|=(192|p>>6)<<g[f++&3],a[f>>2]|=(128|p&63)<<g[f++&3]):p<55296||p>=57344?(a[f>>2]|=(224|p>>12)<<g[f++&3],a[f>>2]|=(128|p>>6&63)<<g[f++&3],a[f>>2]|=(128|p&63)<<g[f++&3]):(p=65536+((p&1023)<<10|t.charCodeAt(++u)&1023),a[f>>2]|=(240|p>>18)<<g[f++&3],a[f>>2]|=(128|p>>12&63)<<g[f++&3],a[f>>2]|=(128|p>>6&63)<<g[f++&3],a[f>>2]|=(128|p&63)<<g[f++&3]);if(this.lastByteIndex=f,f>=o){for(this.start=f-o,this.block=a[c],f=0;f<c;++f)d[f]^=a[f];ee(d),this.reset=!0}else this.start=f}return this},L.prototype.encode=function(e,t){var n=e&255,r=1,i=[n];for(e>>=8,n=e&255;n>0;)i.unshift(n),e>>=8,n=e&255,++r;return t?i.push(r):i.unshift(r),this.update(i),i.length},L.prototype.encodeString=function(t){var n,r=typeof t;if(r!==`string`){if(r===`object`){if(t===null)throw Error(e);if(l&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!l||!ArrayBuffer.isView(t)))throw Error(e)}else throw Error(e);n=!0}var i=0,a=t.length;if(n)i=a;else for(var o=0;o<t.length;++o){var s=t.charCodeAt(o);s<128?i+=1:s<2048?i+=2:s<55296||s>=57344?i+=3:(s=65536+((s&1023)<<10|t.charCodeAt(++o)&1023),i+=4)}return i+=this.encode(i*8),this.update(t),i},L.prototype.bytepad=function(e,t){for(var n=this.encode(t),r=0;r<e.length;++r)n+=this.encodeString(e[r]);var i=t-n%t,a=[];return a.length=i,this.update(a),this},L.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,n=this.blockCount,r=this.s;if(e[t>>2]|=this.padding[t&3],this.lastByteIndex===this.byteCount)for(e[0]=e[n],t=1;t<n+1;++t)e[t]=0;for(e[n-1]|=2147483648,t=0;t<n;++t)r[t]^=e[t];ee(r)}},L.prototype.toString=L.prototype.hex=function(){this.finalize();for(var e=this.blockCount,t=this.s,n=this.outputBlocks,r=this.extraBytes,i=0,a=0,o=``,s;a<n;){for(i=0;i<e&&a<n;++i,++a)s=t[i],o+=u[s>>4&15]+u[s&15]+u[s>>12&15]+u[s>>8&15]+u[s>>20&15]+u[s>>16&15]+u[s>>28&15]+u[s>>24&15];a%e===0&&(ee(t),i=0)}return r&&(s=t[i],o+=u[s>>4&15]+u[s&15],r>1&&(o+=u[s>>12&15]+u[s>>8&15]),r>2&&(o+=u[s>>20&15]+u[s>>16&15])),o},L.prototype.arrayBuffer=function(){this.finalize();for(var e=this.blockCount,t=this.s,n=this.outputBlocks,r=this.extraBytes,i=0,a=0,o=this.outputBits>>3,s=r?new ArrayBuffer(n+1<<2):new ArrayBuffer(o),c=new Uint32Array(s);a<n;){for(i=0;i<e&&a<n;++i,++a)c[a]=t[i];a%e===0&&ee(t)}return r&&(c[i]=t[i],s=s.slice(0,o)),s},L.prototype.buffer=L.prototype.arrayBuffer,L.prototype.digest=L.prototype.array=function(){this.finalize();for(var e=this.blockCount,t=this.s,n=this.outputBlocks,r=this.extraBytes,i=0,a=0,o=[],s,c;a<n;){for(i=0;i<e&&a<n;++i,++a)s=a<<2,c=t[i],o[s]=c&255,o[s+1]=c>>8&255,o[s+2]=c>>16&255,o[s+3]=c>>24&255;a%e===0&&ee(t)}return r&&(s=a<<2,c=t[i],o[s]=c&255,r>1&&(o[s+1]=c>>8&255),r>2&&(o[s+2]=c>>16&255)),o};function R(e,t,n){L.call(this,e,t,n)}R.prototype=new L,R.prototype.finalize=function(){return this.encode(this.outputBits,!0),L.prototype.finalize.call(this)};var ee=function(e){var t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,N,P,F,I,L,R,ee,te,ne,re,ie,ae,z,oe,se,ce,le,ue,de,fe,pe,me,he,ge,_e,ve,B,ye,be,xe,Se,Ce;for(r=0;r<48;r+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],a=e[1]^e[11]^e[21]^e[31]^e[41],o=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],u=e[6]^e[16]^e[26]^e[36]^e[46],d=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],p=e[9]^e[19]^e[29]^e[39]^e[49],t=f^(o<<1|s>>>31),n=p^(s<<1|o>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=i^(c<<1|l>>>31),n=a^(l<<1|c>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=o^(u<<1|d>>>31),n=s^(d<<1|u>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=c^(f<<1|p>>>31),n=l^(p<<1|f>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=u^(i<<1|a>>>31),n=d^(a<<1|i>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,m=e[0],h=e[1],se=e[11]<<4|e[10]>>>28,ce=e[10]<<4|e[11]>>>28,k=e[20]<<3|e[21]>>>29,A=e[21]<<3|e[20]>>>29,be=e[31]<<9|e[30]>>>23,xe=e[30]<<9|e[31]>>>23,ie=e[40]<<18|e[41]>>>14,ae=e[41]<<18|e[40]>>>14,F=e[2]<<1|e[3]>>>31,I=e[3]<<1|e[2]>>>31,g=e[13]<<12|e[12]>>>20,v=e[12]<<12|e[13]>>>20,le=e[22]<<10|e[23]>>>22,ue=e[23]<<10|e[22]>>>22,j=e[33]<<13|e[32]>>>19,M=e[32]<<13|e[33]>>>19,Se=e[42]<<2|e[43]>>>30,Ce=e[43]<<2|e[42]>>>30,he=e[5]<<30|e[4]>>>2,ge=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,R=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,b=e[24]<<11|e[25]>>>21,de=e[34]<<15|e[35]>>>17,fe=e[35]<<15|e[34]>>>17,N=e[45]<<29|e[44]>>>3,P=e[44]<<29|e[45]>>>3,T=e[6]<<28|e[7]>>>4,E=e[7]<<28|e[6]>>>4,_e=e[17]<<23|e[16]>>>9,ve=e[16]<<23|e[17]>>>9,ee=e[26]<<25|e[27]>>>7,te=e[27]<<25|e[26]>>>7,x=e[36]<<21|e[37]>>>11,S=e[37]<<21|e[36]>>>11,pe=e[47]<<24|e[46]>>>8,me=e[46]<<24|e[47]>>>8,z=e[8]<<27|e[9]>>>5,oe=e[9]<<27|e[8]>>>5,D=e[18]<<20|e[19]>>>12,O=e[19]<<20|e[18]>>>12,B=e[29]<<7|e[28]>>>25,ye=e[28]<<7|e[29]>>>25,ne=e[38]<<8|e[39]>>>24,re=e[39]<<8|e[38]>>>24,C=e[48]<<14|e[49]>>>18,w=e[49]<<14|e[48]>>>18,e[0]=m^~g&y,e[1]=h^~v&b,e[10]=T^~D&k,e[11]=E^~O&A,e[20]=F^~L&ee,e[21]=I^~R&te,e[30]=z^~se&le,e[31]=oe^~ce&ue,e[40]=he^~_e&B,e[41]=ge^~ve&ye,e[2]=g^~y&x,e[3]=v^~b&S,e[12]=D^~k&j,e[13]=O^~A&M,e[22]=L^~ee&ne,e[23]=R^~te&re,e[32]=se^~le&de,e[33]=ce^~ue&fe,e[42]=_e^~B&be,e[43]=ve^~ye&xe,e[4]=y^~x&C,e[5]=b^~S&w,e[14]=k^~j&N,e[15]=A^~M&P,e[24]=ee^~ne&ie,e[25]=te^~re&ae,e[34]=le^~de&pe,e[35]=ue^~fe&me,e[44]=B^~be&Se,e[45]=ye^~xe&Ce,e[6]=x^~C&m,e[7]=S^~w&h,e[16]=j^~N&T,e[17]=M^~P&E,e[26]=ne^~ie&F,e[27]=re^~ae&I,e[36]=de^~pe&z,e[37]=fe^~me&oe,e[46]=be^~Se&he,e[47]=xe^~Ce&ge,e[8]=C^~m&g,e[9]=w^~h&v,e[18]=N^~T&D,e[19]=P^~E&O,e[28]=ie^~F&L,e[29]=ae^~I&R,e[38]=pe^~z&se,e[39]=me^~oe&ce,e[48]=Se^~he&_e,e[49]=Ce^~ge&ve,e[0]^=_[r],e[1]^=_[r+1]};if(s)t.exports=k;else{for(j=0;j<A.length;++j)i[A[j]]=k[A[j]];c&&define(function(){return k})}})()})),ns=r({keccak256:()=>rs});function rs(e){return`0x`+is.default.keccak_256(ko(e))}var is,as=t((()=>{is=i(ts()),Ro()})),os,ss=t((()=>{os=`rlp/5.8.0`}));function cs(e){let t=[];for(;e;)t.unshift(e&255),e>>=8;return t}function ls(e){if(Array.isArray(e)){let t=[];if(e.forEach(function(e){t=t.concat(ls(e))}),t.length<=55)return t.unshift(192+t.length),t;let n=cs(t.length);return n.unshift(247+n.length),n.concat(t)}Eo(e)||ds.throwArgumentError(`RLP object must be BytesLike`,`object`,e);let t=Array.prototype.slice.call(ko(e));if(t.length===1&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;let n=cs(t.length);return n.unshift(183+n.length),n.concat(t)}function us(e){return No(ls(e))}var ds,fs=t((()=>{Ro(),xo(),ss(),ds=new bo(os)})),ps,ms=t((()=>{ps=`address/5.8.0`})),hs=r({getAddress:()=>ys,getContractAddress:()=>Ss,getCreate2Address:()=>Cs,getIcapAddress:()=>xs,isAddress:()=>bs});function gs(e){Mo(e,20)||ws.throwArgumentError(`invalid address`,`address`,e),e=e.toLowerCase();let t=e.substring(2).split(``),n=new Uint8Array(40);for(let e=0;e<40;e++)n[e]=t[e].charCodeAt(0);let r=ko(rs(n));for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(r[e>>1]&15)>=8&&(t[e+1]=t[e+1].toUpperCase());return`0x`+t.join(``)}function _s(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}function vs(e){e=e.toUpperCase(),e=e.substring(4)+e.substring(0,2)+`00`;let t=e.split(``).map(e=>Es[e]).join(``);for(;t.length>=Ds;){let e=t.substring(0,Ds);t=parseInt(e,10)%97+t.substring(e.length)}let n=String(98-parseInt(t,10)%97);for(;n.length<2;)n=`0`+n;return n}function ys(e){let t=null;if(typeof e!=`string`&&ws.throwArgumentError(`invalid address`,`address`,e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))e.substring(0,2)!==`0x`&&(e=`0x`+e),t=gs(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&ws.throwArgumentError(`bad address checksum`,`address`,e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==vs(e)&&ws.throwArgumentError(`bad icap checksum`,`address`,e),t=Wo(e.substring(4));t.length<40;)t=`0`+t;t=gs(`0x`+t)}else ws.throwArgumentError(`invalid address`,`address`,e);return t}function bs(e){try{return ys(e),!0}catch{}return!1}function xs(e){let t=Go(ys(e).substring(2)).toUpperCase();for(;t.length<30;)t=`0`+t;return`XE`+vs(`XE00`+t)+t}function Ss(e){let t=null;try{t=ys(e.from)}catch{ws.throwArgumentError(`missing from address`,`transaction`,e)}let n=jo(ko(Qo.from(e.nonce).toHexString()));return ys(Fo(rs(us([t,n])),12))}function Cs(e,t,n){return Po(t)!==32&&ws.throwArgumentError(`salt must be 32 bytes`,`salt`,t),Po(n)!==32&&ws.throwArgumentError(`initCodeHash must be 32 bytes`,`initCodeHash`,n),ys(Fo(rs(Ao([`0xff`,ys(e),t,n])),12))}var ws,Ts,Es,Ds,Os=t((()=>{Ro(),es(),as(),fs(),xo(),ms(),ws=new bo(ps),Ts=9007199254740991,Es={};for(let e=0;e<10;e++)Es[String(e)]=String(e);for(let e=0;e<26;e++)Es[String.fromCharCode(65+e)]=String(10+e);Ds=Math.floor(_s(Ts))})),ks=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),r=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),i=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n};Object.defineProperty(e,`__esModule`,{value:!0}),e.Bech32Address=void 0;var a=i(xn()),o=(_(),n(v)),s=(Os(),n(hs));e.Bech32Address=class e{static shortenAddress(e,t){if(t>=e.length)return e;let n=e.indexOf(`1`),r=e.slice(0,n),i=e.slice(n+1);if(t-=r.length,t-=3,--t,t<=0)return``;let a=Math.floor(i.length/2),o=i.slice(0,a),s=i.slice(a);for(;t<o.length+s.length;)(o.length+s.length)%2==1&&o.length>0?o=o.slice(0,o.length-1):s=s.slice(1);return r+`1`+o+`...`+s}static fromBech32(t,n){let r=a.default.decode(t);if(n&&r.prefix!==n)throw Error(`Unmatched prefix`);return new e(new Uint8Array((0,a.fromWords)(r.words)))}static validate(e,t){let{prefix:n}=a.default.decode(e);if(t&&t!==n)throw Error(`Unexpected prefix (expected: ${t}, actual: ${n})`)}static defaultBech32Config(e,t=`val`,n=`cons`,r=`pub`,i=`oper`){return{bech32PrefixAccAddr:e,bech32PrefixAccPub:e+r,bech32PrefixValAddr:e+t+i,bech32PrefixValPub:e+t+i+r,bech32PrefixConsAddr:e+t+n,bech32PrefixConsPub:e+t+n+r}}constructor(e){this.address=e}toBech32(e){let t=a.default.toWords(this.address);return a.default.encode(e,t)}toHex(e=!0){let t=o.Buffer.from(this.address).toString(`hex`);if(t.length===0)throw Error(`Empty address`);return e?(0,s.getAddress)(`0x`+t):`0x`+t}}})),As=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ChainIdHelper=void 0;var t=class e{static parse(t){if(t===`injective-777`||t===`injective-888`)return{identifier:t,version:0};let n=t.split(e.VersionFormatRegExp).filter(Boolean);return n.length===2?{identifier:n[0],version:parseInt(n[1])}:{identifier:t,version:0}}static hasChainVersion(t){return e.parse(t).identifier!==t}};e.ChainIdHelper=t,t.VersionFormatRegExp=/(.+)-([\d]+)/})),js=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.EthermintChainIdHelper=void 0;var t=As();e.EthermintChainIdHelper=class{static parse(e){let n=t.ChainIdHelper.parse(e);if(e.startsWith(`injective`))return[`injective-777`,`injective-888`].includes(e)?Object.assign({ethChainId:5},n):Object.assign({ethChainId:1},n);let r=e.match(`^([a-z]{1,})_{1}([1-9][0-9]*)-{1}([1-9][0-9]*)$`);if(!r||r.length!==4||r[1]===``||Number.isNaN(parseFloat(r[2]))||!Number.isInteger(parseFloat(r[2])))throw Error(`Invalid chainId for ethermint: ${e}`);return Object.assign(Object.assign({},n),{ethChainId:parseFloat(r[2])})}}})),Ms=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(As(),e),n(js(),e)})),Ns=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.WsReadyState=void 0,(function(e){e[e.CONNECTING=0]=`CONNECTING`,e[e.OPEN=1]=`OPEN`,e[e.CLOSING=2]=`CLOSING`,e[e.CLOSED=3]=`CLOSED`,e[e.NONE=4]=`NONE`})(e.WsReadyState||={})})),Ps=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.TendermintTxTracer=void 0;var t=Ns(),r=(_(),n(v));e.TendermintTxTracer=class{constructor(e,t,n={}){this.url=e,this.wsEndpoint=t,this.options=n,this.newBlockSubscribes=[],this.txSubscribes=new Map,this.pendingQueries=new Map,this.listeners={},this.onOpen=e=>{this.newBlockSubscribes.length>0&&this.sendSubscribeBlockRpc();for(let[e,t]of this.txSubscribes)this.sendSubscribeTxRpc(e,t.params);for(let[e,t]of this.pendingQueries)this.sendQueryRpc(e,t.method,t.params);for(let t of this.listeners.open??[])t(e)},this.onMessage=e=>{for(let t of this.listeners.message??[])t(e);if(e.data)try{let t=JSON.parse(e.data);if(t?.id&&this.pendingQueries.has(t.id)&&(t.error?this.pendingQueries.get(t.id).rejector(Error(t.error.data||t.error.message)):t.result?.tx_result?this.pendingQueries.get(t.id).resolver(t.result.tx_result):this.pendingQueries.get(t.id).resolver(t.result),this.pendingQueries.delete(t.id)),t?.result?.data?.type===`tendermint/event/NewBlock`)for(let e of this.newBlockSubscribes)e.handler(t.result.data.value);t?.result?.data?.type===`tendermint/event/Tx`&&t?.id&&this.txSubscribes.has(t.id)&&(t.error?this.txSubscribes.get(t.id).rejector(Error(t.error.data||t.error.message)):this.txSubscribes.get(t.id).resolver(t.result.data.value.TxResult.result),this.txSubscribes.delete(t.id))}catch{}},this.onClose=e=>{for(let t of this.listeners.close??[])t(e)},this.ws=this.options.wsObject?new this.options.wsObject(this.getWsEndpoint()):new WebSocket(this.getWsEndpoint()),this.ws.onopen=this.onOpen,this.ws.onmessage=this.onMessage,this.ws.onclose=this.onClose}getWsEndpoint(){let e=this.url;if(e.startsWith(`http`)&&(e=e.replace(`http`,`ws`)),!e.endsWith(this.wsEndpoint)){let t=this.wsEndpoint.startsWith(`/`)?this.wsEndpoint:`/`+this.wsEndpoint;e=e.endsWith(`/`)?e+t.slice(1):e+t}return e}close(){this.ws.close()}get readyState(){switch(this.ws.readyState){case 0:return t.WsReadyState.CONNECTING;case 1:return t.WsReadyState.OPEN;case 2:return t.WsReadyState.CLOSING;case 3:return t.WsReadyState.CLOSED;default:return t.WsReadyState.NONE}}addEventListener(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)}subscribeBlock(e){return this.newBlockSubscribes.push({handler:e}),this.newBlockSubscribes.length===1&&this.sendSubscribeBlockRpc(),()=>{this.newBlockSubscribes=this.newBlockSubscribes.filter(t=>t.handler!==e)}}sendSubscribeBlockRpc(){this.readyState===t.WsReadyState.OPEN&&this.ws.send(JSON.stringify({jsonrpc:`2.0`,method:`subscribe`,params:[`tm.event='NewBlock'`],id:1}))}traceTx(e){return new Promise(t=>{this.queryTx(e).then(n=>{if(e instanceof Uint8Array){t(n);return}if(n?.total_count!==`0`){t(n);return}}).catch(()=>{}),this.subscribeTx(e).then(t)}).then(e=>new Promise(t=>{setTimeout(()=>t(e),100)}))}subscribeTx(e){if(e instanceof Uint8Array){let t=this.createRandomId(),n={query:`tm.event='Tx' AND tx.hash='${r.Buffer.from(e).toString(`hex`).toUpperCase()}'`};return new Promise((e,r)=>{this.txSubscribes.set(t,{params:n,resolver:e,rejector:r}),this.sendSubscribeTxRpc(t,n)})}else{let t=this.createRandomId(),n={query:`tm.event='Tx' and `+Object.keys(e).map(t=>({key:t,value:e[t]})).map(e=>`${e.key}=${typeof e.value==`string`?`'${e.value}'`:e.value}`).join(` and `),page:`1`,per_page:`1`,order_by:`desc`};return new Promise((e,r)=>{this.txSubscribes.set(t,{params:n,resolver:e,rejector:r}),this.sendSubscribeTxRpc(t,n)})}}sendSubscribeTxRpc(e,n){this.readyState===t.WsReadyState.OPEN&&this.ws.send(JSON.stringify({jsonrpc:`2.0`,method:`subscribe`,params:n,id:e}))}queryTx(e){if(e instanceof Uint8Array)return this.query(`tx`,{hash:r.Buffer.from(e).toString(`base64`),prove:!1});{let t={query:Object.keys(e).map(t=>({key:t,value:e[t]})).map(e=>`${e.key}=${typeof e.value==`string`?`'${e.value}'`:e.value}`).join(` and `),page:`1`,per_page:`1`,order_by:`desc`};return this.query(`tx_search`,t)}}query(e,t){let n=this.createRandomId();return new Promise((r,i)=>{this.pendingQueries.set(n,{method:e,params:t,resolver:r,rejector:i}),this.sendQueryRpc(n,e,t)})}sendQueryRpc(e,n,r){this.readyState===t.WsReadyState.OPEN&&this.ws.send(JSON.stringify({jsonrpc:`2.0`,method:n,params:r,id:e}))}createRandomId(){return parseInt(Array.from({length:6}).map(()=>Math.floor(Math.random()*100)).join(``))}}})),Fs=a(((e,t)=>{t.exports=r;var n=Is();function r(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=r.zero=new r(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var a=r.zeroHash=`\0\0\0\0\0\0\0\0`;r.fromNumber=function(e){if(e===0)return i;var t=e<0;t&&(e=-e);var n=e>>>0,a=(e-n)/4294967296>>>0;return t&&(a=~a>>>0,n=~n>>>0,++n>4294967295&&(n=0,++a>4294967295&&(a=0))),new r(n,a)},r.from=function(e){if(typeof e==`number`)return r.fromNumber(e);if(n.isString(e))if(n.Long)e=n.Long.fromString(e);else return r.fromNumber(parseInt(e,10));return e.low||e.high?new r(e.low>>>0,e.high>>>0):i},r.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+n*4294967296)}return this.lo+this.hi*4294967296},r.prototype.toLong=function(e){return n.Long?new n.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var o=String.prototype.charCodeAt;r.fromHash=function(e){return e===a?i:new r((o.call(e,0)|o.call(e,1)<<8|o.call(e,2)<<16|o.call(e,3)<<24)>>>0,(o.call(e,4)|o.call(e,5)<<8|o.call(e,6)<<16|o.call(e,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},r.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},r.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}})),Is=a((e=>{m();var t=e;t.asPromise=Pr(),t.base64=Fr(),t.EventEmitter=Ir(),t.float=Lr(),t.inquire=Rr(),t.utf8=zr(),t.pool=Br(),t.LongBits=Fs(),t.isNode=!!(h!==void 0&&h&&h.process&&h.process.versions&&h.process.versions.node),t.global=t.isNode&&h||typeof window<`u`&&window||typeof self<`u`&&self||e,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e},t.isString=function(e){return typeof e==`string`||e instanceof String},t.isObject=function(e){return e&&typeof e==`object`},t.isset=t.isSet=function(e,t){var n=e[t];return n!=null&&e.hasOwnProperty(t)?typeof n!=`object`||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1},t.Buffer=(function(){try{var e=t.inquire(`buffer`).Buffer;return e.prototype.utf8Write?e:null}catch{return null}})(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(e){return typeof e==`number`?t.Buffer?t._Buffer_allocUnsafe(e):new t.Array(e):t.Buffer?t._Buffer_from(e):typeof Uint8Array>`u`?e:new Uint8Array(e)},t.Array=typeof Uint8Array<`u`?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||t.inquire(`long`),t.key2Re=/^true|false|0|1$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(e){return e?t.LongBits.from(e).toHash():t.LongBits.zeroHash},t.longFromHash=function(e,n){var r=t.LongBits.fromHash(e);return t.Long?t.Long.fromBits(r.lo,r.hi,n):r.toNumber(!!n)};function n(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;++i)(e[r[i]]===void 0||!n)&&(e[r[i]]=t[r[i]]);return e}t.merge=n,t.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function r(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,`message`,{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,`stack`,{value:Error().stack||``}),r&&n(this,r)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,`name`,{get:function(){return e}}),t.prototype.toString=function(){return this.name+`: `+this.message},t}t.newError=r,t.ProtocolError=r(`ProtocolError`),t.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(t[e[n]]===1&&this[e[n]]!==void 0&&this[e[n]]!==null)return e[n]}},t.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var e=t.Buffer;if(!e){t._Buffer_from=t._Buffer_allocUnsafe=null;return}t._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},t._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}}})),Ls=a(((e,t)=>{t.exports=u;var n=Is(),r,i=n.LongBits,a=n.base64,o=n.utf8;function s(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function c(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function u(){this.len=0,this.head=new s(c,0,0),this.tail=this.head,this.states=null}var d=function(){return n.Buffer?function(){return(u.create=function(){return new r})()}:function(){return new u}};u.create=d(),u.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(u.alloc=n.pool(u.alloc,n.Array.prototype.subarray)),u.prototype._push=function(e,t,n){return this.tail=this.tail.next=new s(e,t,n),this.len+=t,this};function f(e,t,n){t[n]=e&255}function p(e,t,n){for(;e>127;)t[n++]=e&127|128,e>>>=7;t[n]=e}function m(e,t){this.len=e,this.next=void 0,this.val=t}m.prototype=Object.create(s.prototype),m.prototype.fn=p,u.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new m((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},u.prototype.int32=function(e){return e<0?this._push(h,10,i.fromNumber(e)):this.uint32(e)},u.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function h(e,t,n){for(;e.hi;)t[n++]=e.lo&127|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=e.lo&127|128,e.lo>>>=7;t[n++]=e.lo}u.prototype.uint64=function(e){var t=i.from(e);return this._push(h,t.length(),t)},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(h,t.length(),t)},u.prototype.bool=function(e){return this._push(f,1,+!!e)};function g(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}u.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(e){var t=i.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},u.prototype.double=function(e){return this._push(n.float.writeDoubleLE,8,e)};var _=n.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};u.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(f,1,0);if(n.isString(e)){var r=u.alloc(t=a.length(e));a.decode(e,r,0),e=r}return this.uint32(t)._push(_,t,e)},u.prototype.string=function(e){var t=o.length(e);return t?this.uint32(t)._push(o.write,t,e):this._push(f,1,0)},u.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new s(c,0,0),this.len=0,this},u.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new s(c,0,0),this.len=0),this},u.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},u.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},u._configure=function(e){r=e,u.create=d(),r._configure()}})),Rs=a(((e,t)=>{t.exports=i;var n=Ls();(i.prototype=Object.create(n.prototype)).constructor=i;var r=Is();function i(){n.call(this)}i._configure=function(){i.alloc=r._Buffer_allocUnsafe,i.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&r.Buffer.prototype.set.name===`set`?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},i.prototype.bytes=function(e){r.isString(e)&&(e=r._Buffer_from(e,`base64`));var t=e.length>>>0;return this.uint32(t),t&&this._push(i.writeBytesBuffer,t,e),this};function a(e,t,n){e.length<40?r.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}i.prototype.string=function(e){var t=r.Buffer.byteLength(e);return this.uint32(t),t&&this._push(a,t,e),this},i._configure()})),zs=a(((e,t)=>{t.exports=s;var n=Is(),r,i=n.LongBits,a=n.utf8;function o(e,t){return RangeError(`index out of range: `+e.pos+` + `+(t||1)+` > `+e.len)}function s(e){this.buf=e,this.pos=0,this.len=e.length}var c=typeof Uint8Array<`u`?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new s(e);throw Error(`illegal buffer`)}:function(e){if(Array.isArray(e))return new s(e);throw Error(`illegal buffer`)},l=function(){return n.Buffer?function(e){return(s.create=function(e){return n.Buffer.isBuffer(e)?new r(e):c(e)})(e)}:c};s.create=l(),s.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,s.prototype.uint32=(function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,o(this,10);return e}})(),s.prototype.int32=function(){return this.uint32()|0},s.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function u(){var e=new i(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw o(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,e}if(this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw o(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error(`invalid varint encoding`)}s.prototype.bool=function(){return this.uint32()!==0};function d(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}s.prototype.fixed32=function(){if(this.pos+4>this.len)throw o(this,4);return d(this.buf,this.pos+=4)},s.prototype.sfixed32=function(){if(this.pos+4>this.len)throw o(this,4);return d(this.buf,this.pos+=4)|0};function f(){if(this.pos+8>this.len)throw o(this,8);return new i(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}s.prototype.float=function(){if(this.pos+4>this.len)throw o(this,4);var e=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},s.prototype.double=function(){if(this.pos+8>this.len)throw o(this,4);var e=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},s.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw o(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},s.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},s.prototype.skip=function(e){if(typeof e==`number`){if(this.pos+e>this.len)throw o(this,e);this.pos+=e}else do if(this.pos>=this.len)throw o(this);while(this.buf[this.pos++]&128);return this},s.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!=4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type `+e+` at offset `+this.pos)}return this},s._configure=function(e){r=e,s.create=l(),r._configure();var t=n.Long?`toLong`:`toNumber`;n.merge(s.prototype,{int64:function(){return u.call(this)[t](!1)},uint64:function(){return u.call(this)[t](!0)},sint64:function(){return u.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}})),Bs=a(((e,t)=>{t.exports=i;var n=zs();(i.prototype=Object.create(n.prototype)).constructor=i;var r=Is();function i(e){n.call(this,e)}i._configure=function(){r.Buffer&&(i.prototype._slice=r.Buffer.prototype.slice)},i.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString(`utf-8`,this.pos,this.pos=Math.min(this.pos+e,this.len))},i._configure()})),Vs=a(((e,t)=>{t.exports=r;var n=Is();(r.prototype=Object.create(n.EventEmitter.prototype)).constructor=r;function r(e,t,r){if(typeof e!=`function`)throw TypeError(`rpcImpl must be a function`);n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!t,this.responseDelimited=!!r}r.prototype.rpcCall=function e(t,r,i,a,o){if(!a)throw TypeError(`request must be specified`);var s=this;if(!o)return n.asPromise(e,s,t,r,i,a);if(!s.rpcImpl){setTimeout(function(){o(Error(`already ended`))},0);return}try{return s.rpcImpl(t,r[s.requestDelimited?`encodeDelimited`:`encode`](a).finish(),function(e,n){if(e)return s.emit(`error`,e,t),o(e);if(n===null){s.end(!0);return}if(!(n instanceof i))try{n=i[s.responseDelimited?`decodeDelimited`:`decode`](n)}catch(e){return s.emit(`error`,e,t),o(e)}return s.emit(`data`,n,t),o(null,n)})}catch(e){s.emit(`error`,e,t),setTimeout(function(){o(e)},0);return}},r.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit(`end`).off()),this}})),Hs=a((e=>{var t=e;t.Service=Vs()})),Us=a(((e,t)=>{t.exports={}})),Ws=a((e=>{var t=e;t.build=`minimal`,t.Writer=Ls(),t.BufferWriter=Rs(),t.Reader=zs(),t.BufferReader=Bs(),t.util=Is(),t.rpc=Hs(),t.roots=Us(),t.configure=n;function n(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}n()})),q=a(((e,t)=>{t.exports=Ws()})),Gs=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.MsgInstallBundleResponse=e.MsgInstallBundle=e.MsgProvisionResponse=e.MsgProvision=e.MsgWalletSpendActionResponse=e.MsgWalletSpendAction=e.MsgWalletActionResponse=e.MsgWalletAction=e.MsgDeliverInboundResponse=e.MsgDeliverInbound=e.protobufPackage=void 0;var n=t(G()),r=t(q());e.protobufPackage=`agoric.swingset`;function i(){return{messages:[],nums:[],ack:`0`,submitter:new Uint8Array}}e.MsgDeliverInbound={encode(e,t=r.default.Writer.create()){for(let n of e.messages)t.uint32(10).string(n);t.uint32(18).fork();for(let n of e.nums)t.uint64(n);return t.ldelim(),e.ack!==`0`&&t.uint32(24).uint64(e.ack),e.submitter.length!==0&&t.uint32(34).bytes(e.submitter),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.messages.push(n.string());break;case 2:if((e&7)==2){let e=n.uint32()+n.pos;for(;n.pos<e;)o.nums.push(x(n.uint64()))}else o.nums.push(x(n.uint64()));break;case 3:o.ack=x(n.uint64());break;case 4:o.submitter=n.bytes();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{messages:Array.isArray(e?.messages)?e.messages.map(e=>String(e)):[],nums:Array.isArray(e?.nums)?e.nums.map(e=>String(e)):[],ack:S(e.ack)?String(e.ack):`0`,submitter:S(e.submitter)?v(e.submitter):new Uint8Array}},toJSON(e){let t={};return e.messages?t.messages=e.messages.map(e=>e):t.messages=[],e.nums?t.nums=e.nums.map(e=>e):t.nums=[],e.ack!==void 0&&(t.ack=e.ack),e.submitter!==void 0&&(t.submitter=b(e.submitter===void 0?new Uint8Array:e.submitter)),t},fromPartial(e){let t=i();return t.messages=e.messages?.map(e=>e)||[],t.nums=e.nums?.map(e=>e)||[],t.ack=e.ack??`0`,t.submitter=e.submitter??new Uint8Array,t}};function a(){return{}}e.MsgDeliverInboundResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=a();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return o},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return a()}};function o(){return{owner:new Uint8Array,action:``}}e.MsgWalletAction={encode(e,t=r.default.Writer.create()){return e.owner.length!==0&&t.uint32(10).bytes(e.owner),e.action!==``&&t.uint32(18).string(e.action),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=o();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.owner=n.bytes();break;case 2:a.action=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{owner:S(e.owner)?v(e.owner):new Uint8Array,action:S(e.action)?String(e.action):``}},toJSON(e){let t={};return e.owner!==void 0&&(t.owner=b(e.owner===void 0?new Uint8Array:e.owner)),e.action!==void 0&&(t.action=e.action),t},fromPartial(e){let t=o();return t.owner=e.owner??new Uint8Array,t.action=e.action??``,t}};function s(){return{}}e.MsgWalletActionResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return s()}};function c(){return{owner:new Uint8Array,spendAction:``}}e.MsgWalletSpendAction={encode(e,t=r.default.Writer.create()){return e.owner.length!==0&&t.uint32(10).bytes(e.owner),e.spendAction!==``&&t.uint32(18).string(e.spendAction),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.owner=n.bytes();break;case 2:a.spendAction=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{owner:S(e.owner)?v(e.owner):new Uint8Array,spendAction:S(e.spendAction)?String(e.spendAction):``}},toJSON(e){let t={};return e.owner!==void 0&&(t.owner=b(e.owner===void 0?new Uint8Array:e.owner)),e.spendAction!==void 0&&(t.spendAction=e.spendAction),t},fromPartial(e){let t=c();return t.owner=e.owner??new Uint8Array,t.spendAction=e.spendAction??``,t}};function l(){return{}}e.MsgWalletSpendActionResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return l()}};function u(){return{nickname:``,address:new Uint8Array,powerFlags:[],submitter:new Uint8Array}}e.MsgProvision={encode(e,t=r.default.Writer.create()){e.nickname!==``&&t.uint32(10).string(e.nickname),e.address.length!==0&&t.uint32(18).bytes(e.address);for(let n of e.powerFlags)t.uint32(26).string(n);return e.submitter.length!==0&&t.uint32(34).bytes(e.submitter),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.nickname=n.string();break;case 2:a.address=n.bytes();break;case 3:a.powerFlags.push(n.string());break;case 4:a.submitter=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{nickname:S(e.nickname)?String(e.nickname):``,address:S(e.address)?v(e.address):new Uint8Array,powerFlags:Array.isArray(e?.powerFlags)?e.powerFlags.map(e=>String(e)):[],submitter:S(e.submitter)?v(e.submitter):new Uint8Array}},toJSON(e){let t={};return e.nickname!==void 0&&(t.nickname=e.nickname),e.address!==void 0&&(t.address=b(e.address===void 0?new Uint8Array:e.address)),e.powerFlags?t.powerFlags=e.powerFlags.map(e=>e):t.powerFlags=[],e.submitter!==void 0&&(t.submitter=b(e.submitter===void 0?new Uint8Array:e.submitter)),t},fromPartial(e){let t=u();return t.nickname=e.nickname??``,t.address=e.address??new Uint8Array,t.powerFlags=e.powerFlags?.map(e=>e)||[],t.submitter=e.submitter??new Uint8Array,t}};function d(){return{}}e.MsgProvisionResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return d()}};function f(){return{bundle:``,submitter:new Uint8Array,compressedBundle:new Uint8Array,uncompressedSize:`0`}}e.MsgInstallBundle={encode(e,t=r.default.Writer.create()){return e.bundle!==``&&t.uint32(10).string(e.bundle),e.submitter.length!==0&&t.uint32(18).bytes(e.submitter),e.compressedBundle.length!==0&&t.uint32(26).bytes(e.compressedBundle),e.uncompressedSize!==`0`&&t.uint32(32).int64(e.uncompressedSize),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.bundle=n.string();break;case 2:a.submitter=n.bytes();break;case 3:a.compressedBundle=n.bytes();break;case 4:a.uncompressedSize=x(n.int64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{bundle:S(e.bundle)?String(e.bundle):``,submitter:S(e.submitter)?v(e.submitter):new Uint8Array,compressedBundle:S(e.compressedBundle)?v(e.compressedBundle):new Uint8Array,uncompressedSize:S(e.uncompressedSize)?String(e.uncompressedSize):`0`}},toJSON(e){let t={};return e.bundle!==void 0&&(t.bundle=e.bundle),e.submitter!==void 0&&(t.submitter=b(e.submitter===void 0?new Uint8Array:e.submitter)),e.compressedBundle!==void 0&&(t.compressedBundle=b(e.compressedBundle===void 0?new Uint8Array:e.compressedBundle)),e.uncompressedSize!==void 0&&(t.uncompressedSize=e.uncompressedSize),t},fromPartial(e){let t=f();return t.bundle=e.bundle??``,t.submitter=e.submitter??new Uint8Array,t.compressedBundle=e.compressedBundle??new Uint8Array,t.uncompressedSize=e.uncompressedSize??`0`,t}};function p(){return{}}e.MsgInstallBundleResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=p();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return p()}};var g=(()=>{if(g!==void 0)return g;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),_=g.atob||(e=>g.Buffer.from(e,`base64`).toString(`binary`));function v(e){let t=_(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var y=g.btoa||(e=>g.Buffer.from(e,`binary`).toString(`base64`));function b(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return y(t.join(``))}function x(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function S(e){return e!=null}})),Ks=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.DecProto=e.IntProto=e.DecCoin=e.Coin=e.protobufPackage=void 0;var n=t(G()),r=t(q());e.protobufPackage=`cosmos.base.v1beta1`;function i(){return{denom:``,amount:``}}e.Coin={encode(e,t=r.default.Writer.create()){return e.denom!==``&&t.uint32(10).string(e.denom),e.amount!==``&&t.uint32(18).string(e.amount),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.denom=n.string();break;case 2:o.amount=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{denom:c(e.denom)?String(e.denom):``,amount:c(e.amount)?String(e.amount):``}},toJSON(e){let t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){let t=i();return t.denom=e.denom??``,t.amount=e.amount??``,t}};function a(){return{denom:``,amount:``}}e.DecCoin={encode(e,t=r.default.Writer.create()){return e.denom!==``&&t.uint32(10).string(e.denom),e.amount!==``&&t.uint32(18).string(e.amount),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=a();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.denom=n.string();break;case 2:o.amount=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{denom:c(e.denom)?String(e.denom):``,amount:c(e.amount)?String(e.amount):``}},toJSON(e){let t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){let t=a();return t.denom=e.denom??``,t.amount=e.amount??``,t}};function o(){return{int:``}}e.IntProto={encode(e,t=r.default.Writer.create()){return e.int!==``&&t.uint32(10).string(e.int),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=o();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.int=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{int:c(e.int)?String(e.int):``}},toJSON(e){let t={};return e.int!==void 0&&(t.int=e.int),t},fromPartial(e){let t=o();return t.int=e.int??``,t}};function s(){return{dec:``}}e.DecProto={encode(e,t=r.default.Writer.create()){return e.dec!==``&&t.uint32(10).string(e.dec),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.dec=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{dec:c(e.dec)?String(e.dec):``}},toJSON(e){let t={};return e.dec!==void 0&&(t.dec=e.dec),t},fromPartial(e){let t=s();return t.dec=e.dec??``,t}},r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function c(e){return e!=null}})),qs=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Metadata=e.DenomUnit=e.Supply=e.Output=e.Input=e.SendEnabled=e.Params=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=Ks();e.protobufPackage=`cosmos.bank.v1beta1`;function a(){return{sendEnabled:[],defaultSendEnabled:!1}}e.Params={encode(t,n=r.default.Writer.create()){for(let r of t.sendEnabled)e.SendEnabled.encode(r,n.uint32(10).fork()).ldelim();return t.defaultSendEnabled===!0&&n.uint32(16).bool(t.defaultSendEnabled),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?i.len:i.pos+n,s=a();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.sendEnabled.push(e.SendEnabled.decode(i,i.uint32()));break;case 2:s.defaultSendEnabled=i.bool();break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{sendEnabled:Array.isArray(t?.sendEnabled)?t.sendEnabled.map(t=>e.SendEnabled.fromJSON(t)):[],defaultSendEnabled:f(t.defaultSendEnabled)?!!t.defaultSendEnabled:!1}},toJSON(t){let n={};return t.sendEnabled?n.sendEnabled=t.sendEnabled.map(t=>t?e.SendEnabled.toJSON(t):void 0):n.sendEnabled=[],t.defaultSendEnabled!==void 0&&(n.defaultSendEnabled=t.defaultSendEnabled),n},fromPartial(t){let n=a();return n.sendEnabled=t.sendEnabled?.map(t=>e.SendEnabled.fromPartial(t))||[],n.defaultSendEnabled=t.defaultSendEnabled??!1,n}};function o(){return{denom:``,enabled:!1}}e.SendEnabled={encode(e,t=r.default.Writer.create()){return e.denom!==``&&t.uint32(10).string(e.denom),e.enabled===!0&&t.uint32(16).bool(e.enabled),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=o();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.denom=n.string();break;case 2:a.enabled=n.bool();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{denom:f(e.denom)?String(e.denom):``,enabled:f(e.enabled)?!!e.enabled:!1}},toJSON(e){let t={};return e.denom!==void 0&&(t.denom=e.denom),e.enabled!==void 0&&(t.enabled=e.enabled),t},fromPartial(e){let t=o();return t.denom=e.denom??``,t.enabled=e.enabled??!1,t}};function s(){return{address:``,coins:[]}}e.Input={encode(e,t=r.default.Writer.create()){e.address!==``&&t.uint32(10).string(e.address);for(let n of e.coins)i.Coin.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=s();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.address=n.string();break;case 2:o.coins.push(i.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{address:f(e.address)?String(e.address):``,coins:Array.isArray(e?.coins)?e.coins.map(e=>i.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.address!==void 0&&(t.address=e.address),e.coins?t.coins=e.coins.map(e=>e?i.Coin.toJSON(e):void 0):t.coins=[],t},fromPartial(e){let t=s();return t.address=e.address??``,t.coins=e.coins?.map(e=>i.Coin.fromPartial(e))||[],t}};function c(){return{address:``,coins:[]}}e.Output={encode(e,t=r.default.Writer.create()){e.address!==``&&t.uint32(10).string(e.address);for(let n of e.coins)i.Coin.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=c();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.address=n.string();break;case 2:o.coins.push(i.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{address:f(e.address)?String(e.address):``,coins:Array.isArray(e?.coins)?e.coins.map(e=>i.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.address!==void 0&&(t.address=e.address),e.coins?t.coins=e.coins.map(e=>e?i.Coin.toJSON(e):void 0):t.coins=[],t},fromPartial(e){let t=c();return t.address=e.address??``,t.coins=e.coins?.map(e=>i.Coin.fromPartial(e))||[],t}};function l(){return{total:[]}}e.Supply={encode(e,t=r.default.Writer.create()){for(let n of e.total)i.Coin.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=l();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.total.push(i.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{total:Array.isArray(e?.total)?e.total.map(e=>i.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.total?t.total=e.total.map(e=>e?i.Coin.toJSON(e):void 0):t.total=[],t},fromPartial(e){let t=l();return t.total=e.total?.map(e=>i.Coin.fromPartial(e))||[],t}};function u(){return{denom:``,exponent:0,aliases:[]}}e.DenomUnit={encode(e,t=r.default.Writer.create()){e.denom!==``&&t.uint32(10).string(e.denom),e.exponent!==0&&t.uint32(16).uint32(e.exponent);for(let n of e.aliases)t.uint32(26).string(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.denom=n.string();break;case 2:a.exponent=n.uint32();break;case 3:a.aliases.push(n.string());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{denom:f(e.denom)?String(e.denom):``,exponent:f(e.exponent)?Number(e.exponent):0,aliases:Array.isArray(e?.aliases)?e.aliases.map(e=>String(e)):[]}},toJSON(e){let t={};return e.denom!==void 0&&(t.denom=e.denom),e.exponent!==void 0&&(t.exponent=Math.round(e.exponent)),e.aliases?t.aliases=e.aliases.map(e=>e):t.aliases=[],t},fromPartial(e){let t=u();return t.denom=e.denom??``,t.exponent=e.exponent??0,t.aliases=e.aliases?.map(e=>e)||[],t}};function d(){return{description:``,denomUnits:[],base:``,display:``,name:``,symbol:``}}e.Metadata={encode(t,n=r.default.Writer.create()){t.description!==``&&n.uint32(10).string(t.description);for(let r of t.denomUnits)e.DenomUnit.encode(r,n.uint32(18).fork()).ldelim();return t.base!==``&&n.uint32(26).string(t.base),t.display!==``&&n.uint32(34).string(t.display),t.name!==``&&n.uint32(42).string(t.name),t.symbol!==``&&n.uint32(50).string(t.symbol),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=d();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.description=i.string();break;case 2:o.denomUnits.push(e.DenomUnit.decode(i,i.uint32()));break;case 3:o.base=i.string();break;case 4:o.display=i.string();break;case 5:o.name=i.string();break;case 6:o.symbol=i.string();break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{description:f(t.description)?String(t.description):``,denomUnits:Array.isArray(t?.denomUnits)?t.denomUnits.map(t=>e.DenomUnit.fromJSON(t)):[],base:f(t.base)?String(t.base):``,display:f(t.display)?String(t.display):``,name:f(t.name)?String(t.name):``,symbol:f(t.symbol)?String(t.symbol):``}},toJSON(t){let n={};return t.description!==void 0&&(n.description=t.description),t.denomUnits?n.denomUnits=t.denomUnits.map(t=>t?e.DenomUnit.toJSON(t):void 0):n.denomUnits=[],t.base!==void 0&&(n.base=t.base),t.display!==void 0&&(n.display=t.display),t.name!==void 0&&(n.name=t.name),t.symbol!==void 0&&(n.symbol=t.symbol),n},fromPartial(t){let n=d();return n.description=t.description??``,n.denomUnits=t.denomUnits?.map(t=>e.DenomUnit.fromPartial(t))||[],n.base=t.base??``,n.display=t.display??``,n.name=t.name??``,n.symbol=t.symbol??``,n}},r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function f(e){return e!=null}})),Js=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.MsgMultiSendResponse=e.MsgMultiSend=e.MsgSendResponse=e.MsgSend=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=Ks(),a=qs();e.protobufPackage=`cosmos.bank.v1beta1`;function o(){return{fromAddress:``,toAddress:``,amount:[]}}e.MsgSend={encode(e,t=r.default.Writer.create()){e.fromAddress!==``&&t.uint32(10).string(e.fromAddress),e.toAddress!==``&&t.uint32(18).string(e.toAddress);for(let n of e.amount)i.Coin.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,s=o();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:s.fromAddress=n.string();break;case 2:s.toAddress=n.string();break;case 3:s.amount.push(i.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{fromAddress:u(e.fromAddress)?String(e.fromAddress):``,toAddress:u(e.toAddress)?String(e.toAddress):``,amount:Array.isArray(e?.amount)?e.amount.map(e=>i.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.fromAddress!==void 0&&(t.fromAddress=e.fromAddress),e.toAddress!==void 0&&(t.toAddress=e.toAddress),e.amount?t.amount=e.amount.map(e=>e?i.Coin.toJSON(e):void 0):t.amount=[],t},fromPartial(e){let t=o();return t.fromAddress=e.fromAddress??``,t.toAddress=e.toAddress??``,t.amount=e.amount?.map(e=>i.Coin.fromPartial(e))||[],t}};function s(){return{}}e.MsgSendResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return s()}};function c(){return{inputs:[],outputs:[]}}e.MsgMultiSend={encode(e,t=r.default.Writer.create()){for(let n of e.inputs)a.Input.encode(n,t.uint32(10).fork()).ldelim();for(let n of e.outputs)a.Output.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.inputs.push(a.Input.decode(n,n.uint32()));break;case 2:o.outputs.push(a.Output.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{inputs:Array.isArray(e?.inputs)?e.inputs.map(e=>a.Input.fromJSON(e)):[],outputs:Array.isArray(e?.outputs)?e.outputs.map(e=>a.Output.fromJSON(e)):[]}},toJSON(e){let t={};return e.inputs?t.inputs=e.inputs.map(e=>e?a.Input.toJSON(e):void 0):t.inputs=[],e.outputs?t.outputs=e.outputs.map(e=>e?a.Output.toJSON(e):void 0):t.outputs=[],t},fromPartial(e){let t=c();return t.inputs=e.inputs?.map(e=>a.Input.fromPartial(e))||[],t.outputs=e.outputs?.map(e=>a.Output.fromPartial(e))||[],t}};function l(){return{}}e.MsgMultiSendResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return l()}},r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function u(e){return e!=null}})),Ys=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Timestamp=e.protobufPackage=void 0;var n=t(G()),r=t(q());e.protobufPackage=`google.protobuf`;function i(){return{seconds:`0`,nanos:0}}e.Timestamp={encode(e,t=r.default.Writer.create()){return e.seconds!==`0`&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),o=t===void 0?n.len:n.pos+t,s=i();for(;n.pos<o;){let e=n.uint32();switch(e>>>3){case 1:s.seconds=a(n.int64());break;case 2:s.nanos=n.int32();break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{seconds:o(e.seconds)?String(e.seconds):`0`,nanos:o(e.nanos)?Number(e.nanos):0}},toJSON(e){let t={};return e.seconds!==void 0&&(t.seconds=e.seconds),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){let t=i();return t.seconds=e.seconds??`0`,t.nanos=e.nanos??0,t}};function a(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function o(e){return e!=null}})),Xs=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.ProofOps=e.ProofOp=e.DominoOp=e.ValueOp=e.Proof=e.protobufPackage=void 0;var n=t(G()),r=t(q());e.protobufPackage=`tendermint.crypto`;function i(){return{total:`0`,index:`0`,leafHash:new Uint8Array,aunts:[]}}e.Proof={encode(e,t=r.default.Writer.create()){e.total!==`0`&&t.uint32(8).int64(e.total),e.index!==`0`&&t.uint32(16).int64(e.index),e.leafHash.length!==0&&t.uint32(26).bytes(e.leafHash);for(let n of e.aunts)t.uint32(34).bytes(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.total=g(n.int64());break;case 2:o.index=g(n.int64());break;case 3:o.leafHash=n.bytes();break;case 4:o.aunts.push(n.bytes());break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{total:_(e.total)?String(e.total):`0`,index:_(e.index)?String(e.index):`0`,leafHash:_(e.leafHash)?d(e.leafHash):new Uint8Array,aunts:Array.isArray(e?.aunts)?e.aunts.map(e=>d(e)):[]}},toJSON(e){let t={};return e.total!==void 0&&(t.total=e.total),e.index!==void 0&&(t.index=e.index),e.leafHash!==void 0&&(t.leafHash=p(e.leafHash===void 0?new Uint8Array:e.leafHash)),e.aunts?t.aunts=e.aunts.map(e=>p(e===void 0?new Uint8Array:e)):t.aunts=[],t},fromPartial(e){let t=i();return t.total=e.total??`0`,t.index=e.index??`0`,t.leafHash=e.leafHash??new Uint8Array,t.aunts=e.aunts?.map(e=>e)||[],t}};function a(){return{key:new Uint8Array,proof:void 0}}e.ValueOp={encode(t,n=r.default.Writer.create()){return t.key.length!==0&&n.uint32(10).bytes(t.key),t.proof!==void 0&&e.Proof.encode(t.proof,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?i.len:i.pos+n,s=a();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.key=i.bytes();break;case 2:s.proof=e.Proof.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{key:_(t.key)?d(t.key):new Uint8Array,proof:_(t.proof)?e.Proof.fromJSON(t.proof):void 0}},toJSON(t){let n={};return t.key!==void 0&&(n.key=p(t.key===void 0?new Uint8Array:t.key)),t.proof!==void 0&&(n.proof=t.proof?e.Proof.toJSON(t.proof):void 0),n},fromPartial(t){let n=a();return n.key=t.key??new Uint8Array,n.proof=t.proof!==void 0&&t.proof!==null?e.Proof.fromPartial(t.proof):void 0,n}};function o(){return{key:``,input:``,output:``}}e.DominoOp={encode(e,t=r.default.Writer.create()){return e.key!==``&&t.uint32(10).string(e.key),e.input!==``&&t.uint32(18).string(e.input),e.output!==``&&t.uint32(26).string(e.output),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=o();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.key=n.string();break;case 2:a.input=n.string();break;case 3:a.output=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{key:_(e.key)?String(e.key):``,input:_(e.input)?String(e.input):``,output:_(e.output)?String(e.output):``}},toJSON(e){let t={};return e.key!==void 0&&(t.key=e.key),e.input!==void 0&&(t.input=e.input),e.output!==void 0&&(t.output=e.output),t},fromPartial(e){let t=o();return t.key=e.key??``,t.input=e.input??``,t.output=e.output??``,t}};function s(){return{type:``,key:new Uint8Array,data:new Uint8Array}}e.ProofOp={encode(e,t=r.default.Writer.create()){return e.type!==``&&t.uint32(10).string(e.type),e.key.length!==0&&t.uint32(18).bytes(e.key),e.data.length!==0&&t.uint32(26).bytes(e.data),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.type=n.string();break;case 2:a.key=n.bytes();break;case 3:a.data=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{type:_(e.type)?String(e.type):``,key:_(e.key)?d(e.key):new Uint8Array,data:_(e.data)?d(e.data):new Uint8Array}},toJSON(e){let t={};return e.type!==void 0&&(t.type=e.type),e.key!==void 0&&(t.key=p(e.key===void 0?new Uint8Array:e.key)),e.data!==void 0&&(t.data=p(e.data===void 0?new Uint8Array:e.data)),t},fromPartial(e){let t=s();return t.type=e.type??``,t.key=e.key??new Uint8Array,t.data=e.data??new Uint8Array,t}};function c(){return{ops:[]}}e.ProofOps={encode(t,n=r.default.Writer.create()){for(let r of t.ops)e.ProofOp.encode(r,n.uint32(10).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=c();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.ops.push(e.ProofOp.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{ops:Array.isArray(t?.ops)?t.ops.map(t=>e.ProofOp.fromJSON(t)):[]}},toJSON(t){let n={};return t.ops?n.ops=t.ops.map(t=>t?e.ProofOp.toJSON(t):void 0):n.ops=[],n},fromPartial(t){let n=c();return n.ops=t.ops?.map(t=>e.ProofOp.fromPartial(t))||[],n}};var l=(()=>{if(l!==void 0)return l;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),u=l.atob||(e=>l.Buffer.from(e,`base64`).toString(`binary`));function d(e){let t=u(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var f=l.btoa||(e=>l.Buffer.from(e,`binary`).toString(`base64`));function p(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return f(t.join(``))}function g(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function _(e){return e!=null}})),Zs=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Consensus=e.App=e.protobufPackage=void 0;var n=t(G()),r=t(q());e.protobufPackage=`tendermint.version`;function i(){return{protocol:`0`,software:``}}e.App={encode(e,t=r.default.Writer.create()){return e.protocol!==`0`&&t.uint32(8).uint64(e.protocol),e.software!==``&&t.uint32(18).string(e.software),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,s=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:s.protocol=o(n.uint64());break;case 2:s.software=n.string();break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{protocol:s(e.protocol)?String(e.protocol):`0`,software:s(e.software)?String(e.software):``}},toJSON(e){let t={};return e.protocol!==void 0&&(t.protocol=e.protocol),e.software!==void 0&&(t.software=e.software),t},fromPartial(e){let t=i();return t.protocol=e.protocol??`0`,t.software=e.software??``,t}};function a(){return{block:`0`,app:`0`}}e.Consensus={encode(e,t=r.default.Writer.create()){return e.block!==`0`&&t.uint32(8).uint64(e.block),e.app!==`0`&&t.uint32(16).uint64(e.app),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,s=a();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:s.block=o(n.uint64());break;case 2:s.app=o(n.uint64());break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{block:s(e.block)?String(e.block):`0`,app:s(e.app)?String(e.app):`0`}},toJSON(e){let t={};return e.block!==void 0&&(t.block=e.block),e.app!==void 0&&(t.app=e.app),t},fromPartial(e){let t=a();return t.block=e.block??`0`,t.app=e.app??`0`,t}};function o(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function s(e){return e!=null}})),Qs=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.PublicKey=e.protobufPackage=void 0;var n=t(G()),r=t(q());e.protobufPackage=`tendermint.crypto`;function i(){return{ed25519:void 0,secp256k1:void 0}}e.PublicKey={encode(e,t=r.default.Writer.create()){return e.ed25519!==void 0&&t.uint32(10).bytes(e.ed25519),e.secp256k1!==void 0&&t.uint32(18).bytes(e.secp256k1),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.ed25519=n.bytes();break;case 2:o.secp256k1=n.bytes();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{ed25519:u(e.ed25519)?s(e.ed25519):void 0,secp256k1:u(e.secp256k1)?s(e.secp256k1):void 0}},toJSON(e){let t={};return e.ed25519!==void 0&&(t.ed25519=e.ed25519===void 0?void 0:l(e.ed25519)),e.secp256k1!==void 0&&(t.secp256k1=e.secp256k1===void 0?void 0:l(e.secp256k1)),t},fromPartial(e){let t=i();return t.ed25519=e.ed25519??void 0,t.secp256k1=e.secp256k1??void 0,t}};var a=(()=>{if(a!==void 0)return a;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),o=a.atob||(e=>a.Buffer.from(e,`base64`).toString(`binary`));function s(e){let t=o(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var c=a.btoa||(e=>a.Buffer.from(e,`binary`).toString(`base64`));function l(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return c(t.join(``))}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function u(e){return e!=null}})),$s=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.SimpleValidator=e.Validator=e.ValidatorSet=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=Qs();e.protobufPackage=`tendermint.types`;function a(){return{validators:[],proposer:void 0,totalVotingPower:`0`}}e.ValidatorSet={encode(t,n=r.default.Writer.create()){for(let r of t.validators)e.Validator.encode(r,n.uint32(10).fork()).ldelim();return t.proposer!==void 0&&e.Validator.encode(t.proposer,n.uint32(18).fork()).ldelim(),t.totalVotingPower!==`0`&&n.uint32(24).int64(t.totalVotingPower),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?i.len:i.pos+n,s=a();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.validators.push(e.Validator.decode(i,i.uint32()));break;case 2:s.proposer=e.Validator.decode(i,i.uint32());break;case 3:s.totalVotingPower=p(i.int64());break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{validators:Array.isArray(t?.validators)?t.validators.map(t=>e.Validator.fromJSON(t)):[],proposer:g(t.proposer)?e.Validator.fromJSON(t.proposer):void 0,totalVotingPower:g(t.totalVotingPower)?String(t.totalVotingPower):`0`}},toJSON(t){let n={};return t.validators?n.validators=t.validators.map(t=>t?e.Validator.toJSON(t):void 0):n.validators=[],t.proposer!==void 0&&(n.proposer=t.proposer?e.Validator.toJSON(t.proposer):void 0),t.totalVotingPower!==void 0&&(n.totalVotingPower=t.totalVotingPower),n},fromPartial(t){let n=a();return n.validators=t.validators?.map(t=>e.Validator.fromPartial(t))||[],n.proposer=t.proposer!==void 0&&t.proposer!==null?e.Validator.fromPartial(t.proposer):void 0,n.totalVotingPower=t.totalVotingPower??`0`,n}};function o(){return{address:new Uint8Array,pubKey:void 0,votingPower:`0`,proposerPriority:`0`}}e.Validator={encode(e,t=r.default.Writer.create()){return e.address.length!==0&&t.uint32(10).bytes(e.address),e.pubKey!==void 0&&i.PublicKey.encode(e.pubKey,t.uint32(18).fork()).ldelim(),e.votingPower!==`0`&&t.uint32(24).int64(e.votingPower),e.proposerPriority!==`0`&&t.uint32(32).int64(e.proposerPriority),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,s=o();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:s.address=n.bytes();break;case 2:s.pubKey=i.PublicKey.decode(n,n.uint32());break;case 3:s.votingPower=p(n.int64());break;case 4:s.proposerPriority=p(n.int64());break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{address:g(e.address)?u(e.address):new Uint8Array,pubKey:g(e.pubKey)?i.PublicKey.fromJSON(e.pubKey):void 0,votingPower:g(e.votingPower)?String(e.votingPower):`0`,proposerPriority:g(e.proposerPriority)?String(e.proposerPriority):`0`}},toJSON(e){let t={};return e.address!==void 0&&(t.address=f(e.address===void 0?new Uint8Array:e.address)),e.pubKey!==void 0&&(t.pubKey=e.pubKey?i.PublicKey.toJSON(e.pubKey):void 0),e.votingPower!==void 0&&(t.votingPower=e.votingPower),e.proposerPriority!==void 0&&(t.proposerPriority=e.proposerPriority),t},fromPartial(e){let t=o();return t.address=e.address??new Uint8Array,t.pubKey=e.pubKey!==void 0&&e.pubKey!==null?i.PublicKey.fromPartial(e.pubKey):void 0,t.votingPower=e.votingPower??`0`,t.proposerPriority=e.proposerPriority??`0`,t}};function s(){return{pubKey:void 0,votingPower:`0`}}e.SimpleValidator={encode(e,t=r.default.Writer.create()){return e.pubKey!==void 0&&i.PublicKey.encode(e.pubKey,t.uint32(10).fork()).ldelim(),e.votingPower!==`0`&&t.uint32(16).int64(e.votingPower),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=s();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.pubKey=i.PublicKey.decode(n,n.uint32());break;case 2:o.votingPower=p(n.int64());break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{pubKey:g(e.pubKey)?i.PublicKey.fromJSON(e.pubKey):void 0,votingPower:g(e.votingPower)?String(e.votingPower):`0`}},toJSON(e){let t={};return e.pubKey!==void 0&&(t.pubKey=e.pubKey?i.PublicKey.toJSON(e.pubKey):void 0),e.votingPower!==void 0&&(t.votingPower=e.votingPower),t},fromPartial(e){let t=s();return t.pubKey=e.pubKey!==void 0&&e.pubKey!==null?i.PublicKey.fromPartial(e.pubKey):void 0,t.votingPower=e.votingPower??`0`,t}};var c=(()=>{if(c!==void 0)return c;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),l=c.atob||(e=>c.Buffer.from(e,`base64`).toString(`binary`));function u(e){let t=l(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var d=c.btoa||(e=>c.Buffer.from(e,`binary`).toString(`base64`));function f(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return d(t.join(``))}function p(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function g(e){return e!=null}})),ec=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.TxProof=e.BlockMeta=e.LightBlock=e.SignedHeader=e.Proposal=e.CommitSig=e.Commit=e.Vote=e.Data=e.Header=e.BlockID=e.Part=e.PartSetHeader=e.signedMsgTypeToJSON=e.signedMsgTypeFromJSON=e.SignedMsgType=e.blockIDFlagToJSON=e.blockIDFlagFromJSON=e.BlockIDFlag=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=Ys(),a=Xs(),o=Zs(),s=$s();e.protobufPackage=`tendermint.types`;var c;(function(e){e[e.BLOCK_ID_FLAG_UNKNOWN=0]=`BLOCK_ID_FLAG_UNKNOWN`,e[e.BLOCK_ID_FLAG_ABSENT=1]=`BLOCK_ID_FLAG_ABSENT`,e[e.BLOCK_ID_FLAG_COMMIT=2]=`BLOCK_ID_FLAG_COMMIT`,e[e.BLOCK_ID_FLAG_NIL=3]=`BLOCK_ID_FLAG_NIL`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(c=e.BlockIDFlag||={});function l(e){switch(e){case 0:case`BLOCK_ID_FLAG_UNKNOWN`:return c.BLOCK_ID_FLAG_UNKNOWN;case 1:case`BLOCK_ID_FLAG_ABSENT`:return c.BLOCK_ID_FLAG_ABSENT;case 2:case`BLOCK_ID_FLAG_COMMIT`:return c.BLOCK_ID_FLAG_COMMIT;case 3:case`BLOCK_ID_FLAG_NIL`:return c.BLOCK_ID_FLAG_NIL;default:return c.UNRECOGNIZED}}e.blockIDFlagFromJSON=l;function u(e){switch(e){case c.BLOCK_ID_FLAG_UNKNOWN:return`BLOCK_ID_FLAG_UNKNOWN`;case c.BLOCK_ID_FLAG_ABSENT:return`BLOCK_ID_FLAG_ABSENT`;case c.BLOCK_ID_FLAG_COMMIT:return`BLOCK_ID_FLAG_COMMIT`;case c.BLOCK_ID_FLAG_NIL:return`BLOCK_ID_FLAG_NIL`;default:return`UNKNOWN`}}e.blockIDFlagToJSON=u;var d;(function(e){e[e.SIGNED_MSG_TYPE_UNKNOWN=0]=`SIGNED_MSG_TYPE_UNKNOWN`,e[e.SIGNED_MSG_TYPE_PREVOTE=1]=`SIGNED_MSG_TYPE_PREVOTE`,e[e.SIGNED_MSG_TYPE_PRECOMMIT=2]=`SIGNED_MSG_TYPE_PRECOMMIT`,e[e.SIGNED_MSG_TYPE_PROPOSAL=32]=`SIGNED_MSG_TYPE_PROPOSAL`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(d=e.SignedMsgType||={});function f(e){switch(e){case 0:case`SIGNED_MSG_TYPE_UNKNOWN`:return d.SIGNED_MSG_TYPE_UNKNOWN;case 1:case`SIGNED_MSG_TYPE_PREVOTE`:return d.SIGNED_MSG_TYPE_PREVOTE;case 2:case`SIGNED_MSG_TYPE_PRECOMMIT`:return d.SIGNED_MSG_TYPE_PRECOMMIT;case 32:case`SIGNED_MSG_TYPE_PROPOSAL`:return d.SIGNED_MSG_TYPE_PROPOSAL;default:return d.UNRECOGNIZED}}e.signedMsgTypeFromJSON=f;function p(e){switch(e){case d.SIGNED_MSG_TYPE_UNKNOWN:return`SIGNED_MSG_TYPE_UNKNOWN`;case d.SIGNED_MSG_TYPE_PREVOTE:return`SIGNED_MSG_TYPE_PREVOTE`;case d.SIGNED_MSG_TYPE_PRECOMMIT:return`SIGNED_MSG_TYPE_PRECOMMIT`;case d.SIGNED_MSG_TYPE_PROPOSAL:return`SIGNED_MSG_TYPE_PROPOSAL`;default:return`UNKNOWN`}}e.signedMsgTypeToJSON=p;function g(){return{total:0,hash:new Uint8Array}}e.PartSetHeader={encode(e,t=r.default.Writer.create()){return e.total!==0&&t.uint32(8).uint32(e.total),e.hash.length!==0&&t.uint32(18).bytes(e.hash),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=g();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.total=n.uint32();break;case 2:a.hash=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{total:R(e.total)?Number(e.total):0,hash:R(e.hash)?j(e.hash):new Uint8Array}},toJSON(e){let t={};return e.total!==void 0&&(t.total=Math.round(e.total)),e.hash!==void 0&&(t.hash=N(e.hash===void 0?new Uint8Array:e.hash)),t},fromPartial(e){let t=g();return t.total=e.total??0,t.hash=e.hash??new Uint8Array,t}};function _(){return{index:0,bytes:new Uint8Array,proof:void 0}}e.Part={encode(e,t=r.default.Writer.create()){return e.index!==0&&t.uint32(8).uint32(e.index),e.bytes.length!==0&&t.uint32(18).bytes(e.bytes),e.proof!==void 0&&a.Proof.encode(e.proof,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=_();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.index=n.uint32();break;case 2:o.bytes=n.bytes();break;case 3:o.proof=a.Proof.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{index:R(e.index)?Number(e.index):0,bytes:R(e.bytes)?j(e.bytes):new Uint8Array,proof:R(e.proof)?a.Proof.fromJSON(e.proof):void 0}},toJSON(e){let t={};return e.index!==void 0&&(t.index=Math.round(e.index)),e.bytes!==void 0&&(t.bytes=N(e.bytes===void 0?new Uint8Array:e.bytes)),e.proof!==void 0&&(t.proof=e.proof?a.Proof.toJSON(e.proof):void 0),t},fromPartial(e){let t=_();return t.index=e.index??0,t.bytes=e.bytes??new Uint8Array,t.proof=e.proof!==void 0&&e.proof!==null?a.Proof.fromPartial(e.proof):void 0,t}};function v(){return{hash:new Uint8Array,partSetHeader:void 0}}e.BlockID={encode(t,n=r.default.Writer.create()){return t.hash.length!==0&&n.uint32(10).bytes(t.hash),t.partSetHeader!==void 0&&e.PartSetHeader.encode(t.partSetHeader,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=v();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.hash=i.bytes();break;case 2:o.partSetHeader=e.PartSetHeader.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{hash:R(t.hash)?j(t.hash):new Uint8Array,partSetHeader:R(t.partSetHeader)?e.PartSetHeader.fromJSON(t.partSetHeader):void 0}},toJSON(t){let n={};return t.hash!==void 0&&(n.hash=N(t.hash===void 0?new Uint8Array:t.hash)),t.partSetHeader!==void 0&&(n.partSetHeader=t.partSetHeader?e.PartSetHeader.toJSON(t.partSetHeader):void 0),n},fromPartial(t){let n=v();return n.hash=t.hash??new Uint8Array,n.partSetHeader=t.partSetHeader!==void 0&&t.partSetHeader!==null?e.PartSetHeader.fromPartial(t.partSetHeader):void 0,n}};function y(){return{version:void 0,chainId:``,height:`0`,time:void 0,lastBlockId:void 0,lastCommitHash:new Uint8Array,dataHash:new Uint8Array,validatorsHash:new Uint8Array,nextValidatorsHash:new Uint8Array,consensusHash:new Uint8Array,appHash:new Uint8Array,lastResultsHash:new Uint8Array,evidenceHash:new Uint8Array,proposerAddress:new Uint8Array}}e.Header={encode(t,n=r.default.Writer.create()){return t.version!==void 0&&o.Consensus.encode(t.version,n.uint32(10).fork()).ldelim(),t.chainId!==``&&n.uint32(18).string(t.chainId),t.height!==`0`&&n.uint32(24).int64(t.height),t.time!==void 0&&i.Timestamp.encode(P(t.time),n.uint32(34).fork()).ldelim(),t.lastBlockId!==void 0&&e.BlockID.encode(t.lastBlockId,n.uint32(42).fork()).ldelim(),t.lastCommitHash.length!==0&&n.uint32(50).bytes(t.lastCommitHash),t.dataHash.length!==0&&n.uint32(58).bytes(t.dataHash),t.validatorsHash.length!==0&&n.uint32(66).bytes(t.validatorsHash),t.nextValidatorsHash.length!==0&&n.uint32(74).bytes(t.nextValidatorsHash),t.consensusHash.length!==0&&n.uint32(82).bytes(t.consensusHash),t.appHash.length!==0&&n.uint32(90).bytes(t.appHash),t.lastResultsHash.length!==0&&n.uint32(98).bytes(t.lastResultsHash),t.evidenceHash.length!==0&&n.uint32(106).bytes(t.evidenceHash),t.proposerAddress.length!==0&&n.uint32(114).bytes(t.proposerAddress),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),s=n===void 0?a.len:a.pos+n,c=y();for(;a.pos<s;){let t=a.uint32();switch(t>>>3){case 1:c.version=o.Consensus.decode(a,a.uint32());break;case 2:c.chainId=a.string();break;case 3:c.height=L(a.int64());break;case 4:c.time=F(i.Timestamp.decode(a,a.uint32()));break;case 5:c.lastBlockId=e.BlockID.decode(a,a.uint32());break;case 6:c.lastCommitHash=a.bytes();break;case 7:c.dataHash=a.bytes();break;case 8:c.validatorsHash=a.bytes();break;case 9:c.nextValidatorsHash=a.bytes();break;case 10:c.consensusHash=a.bytes();break;case 11:c.appHash=a.bytes();break;case 12:c.lastResultsHash=a.bytes();break;case 13:c.evidenceHash=a.bytes();break;case 14:c.proposerAddress=a.bytes();break;default:a.skipType(t&7);break}}return c},fromJSON(t){return{version:R(t.version)?o.Consensus.fromJSON(t.version):void 0,chainId:R(t.chainId)?String(t.chainId):``,height:R(t.height)?String(t.height):`0`,time:R(t.time)?I(t.time):void 0,lastBlockId:R(t.lastBlockId)?e.BlockID.fromJSON(t.lastBlockId):void 0,lastCommitHash:R(t.lastCommitHash)?j(t.lastCommitHash):new Uint8Array,dataHash:R(t.dataHash)?j(t.dataHash):new Uint8Array,validatorsHash:R(t.validatorsHash)?j(t.validatorsHash):new Uint8Array,nextValidatorsHash:R(t.nextValidatorsHash)?j(t.nextValidatorsHash):new Uint8Array,consensusHash:R(t.consensusHash)?j(t.consensusHash):new Uint8Array,appHash:R(t.appHash)?j(t.appHash):new Uint8Array,lastResultsHash:R(t.lastResultsHash)?j(t.lastResultsHash):new Uint8Array,evidenceHash:R(t.evidenceHash)?j(t.evidenceHash):new Uint8Array,proposerAddress:R(t.proposerAddress)?j(t.proposerAddress):new Uint8Array}},toJSON(t){let n={};return t.version!==void 0&&(n.version=t.version?o.Consensus.toJSON(t.version):void 0),t.chainId!==void 0&&(n.chainId=t.chainId),t.height!==void 0&&(n.height=t.height),t.time!==void 0&&(n.time=t.time.toISOString()),t.lastBlockId!==void 0&&(n.lastBlockId=t.lastBlockId?e.BlockID.toJSON(t.lastBlockId):void 0),t.lastCommitHash!==void 0&&(n.lastCommitHash=N(t.lastCommitHash===void 0?new Uint8Array:t.lastCommitHash)),t.dataHash!==void 0&&(n.dataHash=N(t.dataHash===void 0?new Uint8Array:t.dataHash)),t.validatorsHash!==void 0&&(n.validatorsHash=N(t.validatorsHash===void 0?new Uint8Array:t.validatorsHash)),t.nextValidatorsHash!==void 0&&(n.nextValidatorsHash=N(t.nextValidatorsHash===void 0?new Uint8Array:t.nextValidatorsHash)),t.consensusHash!==void 0&&(n.consensusHash=N(t.consensusHash===void 0?new Uint8Array:t.consensusHash)),t.appHash!==void 0&&(n.appHash=N(t.appHash===void 0?new Uint8Array:t.appHash)),t.lastResultsHash!==void 0&&(n.lastResultsHash=N(t.lastResultsHash===void 0?new Uint8Array:t.lastResultsHash)),t.evidenceHash!==void 0&&(n.evidenceHash=N(t.evidenceHash===void 0?new Uint8Array:t.evidenceHash)),t.proposerAddress!==void 0&&(n.proposerAddress=N(t.proposerAddress===void 0?new Uint8Array:t.proposerAddress)),n},fromPartial(t){let n=y();return n.version=t.version!==void 0&&t.version!==null?o.Consensus.fromPartial(t.version):void 0,n.chainId=t.chainId??``,n.height=t.height??`0`,n.time=t.time??void 0,n.lastBlockId=t.lastBlockId!==void 0&&t.lastBlockId!==null?e.BlockID.fromPartial(t.lastBlockId):void 0,n.lastCommitHash=t.lastCommitHash??new Uint8Array,n.dataHash=t.dataHash??new Uint8Array,n.validatorsHash=t.validatorsHash??new Uint8Array,n.nextValidatorsHash=t.nextValidatorsHash??new Uint8Array,n.consensusHash=t.consensusHash??new Uint8Array,n.appHash=t.appHash??new Uint8Array,n.lastResultsHash=t.lastResultsHash??new Uint8Array,n.evidenceHash=t.evidenceHash??new Uint8Array,n.proposerAddress=t.proposerAddress??new Uint8Array,n}};function b(){return{txs:[]}}e.Data={encode(e,t=r.default.Writer.create()){for(let n of e.txs)t.uint32(10).bytes(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=b();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.txs.push(n.bytes());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{txs:Array.isArray(e?.txs)?e.txs.map(e=>j(e)):[]}},toJSON(e){let t={};return e.txs?t.txs=e.txs.map(e=>N(e===void 0?new Uint8Array:e)):t.txs=[],t},fromPartial(e){let t=b();return t.txs=e.txs?.map(e=>e)||[],t}};function x(){return{type:0,height:`0`,round:0,blockId:void 0,timestamp:void 0,validatorAddress:new Uint8Array,validatorIndex:0,signature:new Uint8Array}}e.Vote={encode(t,n=r.default.Writer.create()){return t.type!==0&&n.uint32(8).int32(t.type),t.height!==`0`&&n.uint32(16).int64(t.height),t.round!==0&&n.uint32(24).int32(t.round),t.blockId!==void 0&&e.BlockID.encode(t.blockId,n.uint32(34).fork()).ldelim(),t.timestamp!==void 0&&i.Timestamp.encode(P(t.timestamp),n.uint32(42).fork()).ldelim(),t.validatorAddress.length!==0&&n.uint32(50).bytes(t.validatorAddress),t.validatorIndex!==0&&n.uint32(56).int32(t.validatorIndex),t.signature.length!==0&&n.uint32(66).bytes(t.signature),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,s=x();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.type=a.int32();break;case 2:s.height=L(a.int64());break;case 3:s.round=a.int32();break;case 4:s.blockId=e.BlockID.decode(a,a.uint32());break;case 5:s.timestamp=F(i.Timestamp.decode(a,a.uint32()));break;case 6:s.validatorAddress=a.bytes();break;case 7:s.validatorIndex=a.int32();break;case 8:s.signature=a.bytes();break;default:a.skipType(t&7);break}}return s},fromJSON(t){return{type:R(t.type)?f(t.type):0,height:R(t.height)?String(t.height):`0`,round:R(t.round)?Number(t.round):0,blockId:R(t.blockId)?e.BlockID.fromJSON(t.blockId):void 0,timestamp:R(t.timestamp)?I(t.timestamp):void 0,validatorAddress:R(t.validatorAddress)?j(t.validatorAddress):new Uint8Array,validatorIndex:R(t.validatorIndex)?Number(t.validatorIndex):0,signature:R(t.signature)?j(t.signature):new Uint8Array}},toJSON(t){let n={};return t.type!==void 0&&(n.type=p(t.type)),t.height!==void 0&&(n.height=t.height),t.round!==void 0&&(n.round=Math.round(t.round)),t.blockId!==void 0&&(n.blockId=t.blockId?e.BlockID.toJSON(t.blockId):void 0),t.timestamp!==void 0&&(n.timestamp=t.timestamp.toISOString()),t.validatorAddress!==void 0&&(n.validatorAddress=N(t.validatorAddress===void 0?new Uint8Array:t.validatorAddress)),t.validatorIndex!==void 0&&(n.validatorIndex=Math.round(t.validatorIndex)),t.signature!==void 0&&(n.signature=N(t.signature===void 0?new Uint8Array:t.signature)),n},fromPartial(t){let n=x();return n.type=t.type??0,n.height=t.height??`0`,n.round=t.round??0,n.blockId=t.blockId!==void 0&&t.blockId!==null?e.BlockID.fromPartial(t.blockId):void 0,n.timestamp=t.timestamp??void 0,n.validatorAddress=t.validatorAddress??new Uint8Array,n.validatorIndex=t.validatorIndex??0,n.signature=t.signature??new Uint8Array,n}};function S(){return{height:`0`,round:0,blockId:void 0,signatures:[]}}e.Commit={encode(t,n=r.default.Writer.create()){t.height!==`0`&&n.uint32(8).int64(t.height),t.round!==0&&n.uint32(16).int32(t.round),t.blockId!==void 0&&e.BlockID.encode(t.blockId,n.uint32(26).fork()).ldelim();for(let r of t.signatures)e.CommitSig.encode(r,n.uint32(34).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=S();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.height=L(i.int64());break;case 2:o.round=i.int32();break;case 3:o.blockId=e.BlockID.decode(i,i.uint32());break;case 4:o.signatures.push(e.CommitSig.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{height:R(t.height)?String(t.height):`0`,round:R(t.round)?Number(t.round):0,blockId:R(t.blockId)?e.BlockID.fromJSON(t.blockId):void 0,signatures:Array.isArray(t?.signatures)?t.signatures.map(t=>e.CommitSig.fromJSON(t)):[]}},toJSON(t){let n={};return t.height!==void 0&&(n.height=t.height),t.round!==void 0&&(n.round=Math.round(t.round)),t.blockId!==void 0&&(n.blockId=t.blockId?e.BlockID.toJSON(t.blockId):void 0),t.signatures?n.signatures=t.signatures.map(t=>t?e.CommitSig.toJSON(t):void 0):n.signatures=[],n},fromPartial(t){let n=S();return n.height=t.height??`0`,n.round=t.round??0,n.blockId=t.blockId!==void 0&&t.blockId!==null?e.BlockID.fromPartial(t.blockId):void 0,n.signatures=t.signatures?.map(t=>e.CommitSig.fromPartial(t))||[],n}};function C(){return{blockIdFlag:0,validatorAddress:new Uint8Array,timestamp:void 0,signature:new Uint8Array}}e.CommitSig={encode(e,t=r.default.Writer.create()){return e.blockIdFlag!==0&&t.uint32(8).int32(e.blockIdFlag),e.validatorAddress.length!==0&&t.uint32(18).bytes(e.validatorAddress),e.timestamp!==void 0&&i.Timestamp.encode(P(e.timestamp),t.uint32(26).fork()).ldelim(),e.signature.length!==0&&t.uint32(34).bytes(e.signature),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=C();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.blockIdFlag=n.int32();break;case 2:o.validatorAddress=n.bytes();break;case 3:o.timestamp=F(i.Timestamp.decode(n,n.uint32()));break;case 4:o.signature=n.bytes();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{blockIdFlag:R(e.blockIdFlag)?l(e.blockIdFlag):0,validatorAddress:R(e.validatorAddress)?j(e.validatorAddress):new Uint8Array,timestamp:R(e.timestamp)?I(e.timestamp):void 0,signature:R(e.signature)?j(e.signature):new Uint8Array}},toJSON(e){let t={};return e.blockIdFlag!==void 0&&(t.blockIdFlag=u(e.blockIdFlag)),e.validatorAddress!==void 0&&(t.validatorAddress=N(e.validatorAddress===void 0?new Uint8Array:e.validatorAddress)),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.signature!==void 0&&(t.signature=N(e.signature===void 0?new Uint8Array:e.signature)),t},fromPartial(e){let t=C();return t.blockIdFlag=e.blockIdFlag??0,t.validatorAddress=e.validatorAddress??new Uint8Array,t.timestamp=e.timestamp??void 0,t.signature=e.signature??new Uint8Array,t}};function w(){return{type:0,height:`0`,round:0,polRound:0,blockId:void 0,timestamp:void 0,signature:new Uint8Array}}e.Proposal={encode(t,n=r.default.Writer.create()){return t.type!==0&&n.uint32(8).int32(t.type),t.height!==`0`&&n.uint32(16).int64(t.height),t.round!==0&&n.uint32(24).int32(t.round),t.polRound!==0&&n.uint32(32).int32(t.polRound),t.blockId!==void 0&&e.BlockID.encode(t.blockId,n.uint32(42).fork()).ldelim(),t.timestamp!==void 0&&i.Timestamp.encode(P(t.timestamp),n.uint32(50).fork()).ldelim(),t.signature.length!==0&&n.uint32(58).bytes(t.signature),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,s=w();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.type=a.int32();break;case 2:s.height=L(a.int64());break;case 3:s.round=a.int32();break;case 4:s.polRound=a.int32();break;case 5:s.blockId=e.BlockID.decode(a,a.uint32());break;case 6:s.timestamp=F(i.Timestamp.decode(a,a.uint32()));break;case 7:s.signature=a.bytes();break;default:a.skipType(t&7);break}}return s},fromJSON(t){return{type:R(t.type)?f(t.type):0,height:R(t.height)?String(t.height):`0`,round:R(t.round)?Number(t.round):0,polRound:R(t.polRound)?Number(t.polRound):0,blockId:R(t.blockId)?e.BlockID.fromJSON(t.blockId):void 0,timestamp:R(t.timestamp)?I(t.timestamp):void 0,signature:R(t.signature)?j(t.signature):new Uint8Array}},toJSON(t){let n={};return t.type!==void 0&&(n.type=p(t.type)),t.height!==void 0&&(n.height=t.height),t.round!==void 0&&(n.round=Math.round(t.round)),t.polRound!==void 0&&(n.polRound=Math.round(t.polRound)),t.blockId!==void 0&&(n.blockId=t.blockId?e.BlockID.toJSON(t.blockId):void 0),t.timestamp!==void 0&&(n.timestamp=t.timestamp.toISOString()),t.signature!==void 0&&(n.signature=N(t.signature===void 0?new Uint8Array:t.signature)),n},fromPartial(t){let n=w();return n.type=t.type??0,n.height=t.height??`0`,n.round=t.round??0,n.polRound=t.polRound??0,n.blockId=t.blockId!==void 0&&t.blockId!==null?e.BlockID.fromPartial(t.blockId):void 0,n.timestamp=t.timestamp??void 0,n.signature=t.signature??new Uint8Array,n}};function T(){return{header:void 0,commit:void 0}}e.SignedHeader={encode(t,n=r.default.Writer.create()){return t.header!==void 0&&e.Header.encode(t.header,n.uint32(10).fork()).ldelim(),t.commit!==void 0&&e.Commit.encode(t.commit,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=T();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.header=e.Header.decode(i,i.uint32());break;case 2:o.commit=e.Commit.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{header:R(t.header)?e.Header.fromJSON(t.header):void 0,commit:R(t.commit)?e.Commit.fromJSON(t.commit):void 0}},toJSON(t){let n={};return t.header!==void 0&&(n.header=t.header?e.Header.toJSON(t.header):void 0),t.commit!==void 0&&(n.commit=t.commit?e.Commit.toJSON(t.commit):void 0),n},fromPartial(t){let n=T();return n.header=t.header!==void 0&&t.header!==null?e.Header.fromPartial(t.header):void 0,n.commit=t.commit!==void 0&&t.commit!==null?e.Commit.fromPartial(t.commit):void 0,n}};function E(){return{signedHeader:void 0,validatorSet:void 0}}e.LightBlock={encode(t,n=r.default.Writer.create()){return t.signedHeader!==void 0&&e.SignedHeader.encode(t.signedHeader,n.uint32(10).fork()).ldelim(),t.validatorSet!==void 0&&s.ValidatorSet.encode(t.validatorSet,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=E();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.signedHeader=e.SignedHeader.decode(i,i.uint32());break;case 2:o.validatorSet=s.ValidatorSet.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{signedHeader:R(t.signedHeader)?e.SignedHeader.fromJSON(t.signedHeader):void 0,validatorSet:R(t.validatorSet)?s.ValidatorSet.fromJSON(t.validatorSet):void 0}},toJSON(t){let n={};return t.signedHeader!==void 0&&(n.signedHeader=t.signedHeader?e.SignedHeader.toJSON(t.signedHeader):void 0),t.validatorSet!==void 0&&(n.validatorSet=t.validatorSet?s.ValidatorSet.toJSON(t.validatorSet):void 0),n},fromPartial(t){let n=E();return n.signedHeader=t.signedHeader!==void 0&&t.signedHeader!==null?e.SignedHeader.fromPartial(t.signedHeader):void 0,n.validatorSet=t.validatorSet!==void 0&&t.validatorSet!==null?s.ValidatorSet.fromPartial(t.validatorSet):void 0,n}};function D(){return{blockId:void 0,blockSize:`0`,header:void 0,numTxs:`0`}}e.BlockMeta={encode(t,n=r.default.Writer.create()){return t.blockId!==void 0&&e.BlockID.encode(t.blockId,n.uint32(10).fork()).ldelim(),t.blockSize!==`0`&&n.uint32(16).int64(t.blockSize),t.header!==void 0&&e.Header.encode(t.header,n.uint32(26).fork()).ldelim(),t.numTxs!==`0`&&n.uint32(32).int64(t.numTxs),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=D();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.blockId=e.BlockID.decode(i,i.uint32());break;case 2:o.blockSize=L(i.int64());break;case 3:o.header=e.Header.decode(i,i.uint32());break;case 4:o.numTxs=L(i.int64());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{blockId:R(t.blockId)?e.BlockID.fromJSON(t.blockId):void 0,blockSize:R(t.blockSize)?String(t.blockSize):`0`,header:R(t.header)?e.Header.fromJSON(t.header):void 0,numTxs:R(t.numTxs)?String(t.numTxs):`0`}},toJSON(t){let n={};return t.blockId!==void 0&&(n.blockId=t.blockId?e.BlockID.toJSON(t.blockId):void 0),t.blockSize!==void 0&&(n.blockSize=t.blockSize),t.header!==void 0&&(n.header=t.header?e.Header.toJSON(t.header):void 0),t.numTxs!==void 0&&(n.numTxs=t.numTxs),n},fromPartial(t){let n=D();return n.blockId=t.blockId!==void 0&&t.blockId!==null?e.BlockID.fromPartial(t.blockId):void 0,n.blockSize=t.blockSize??`0`,n.header=t.header!==void 0&&t.header!==null?e.Header.fromPartial(t.header):void 0,n.numTxs=t.numTxs??`0`,n}};function O(){return{rootHash:new Uint8Array,data:new Uint8Array,proof:void 0}}e.TxProof={encode(e,t=r.default.Writer.create()){return e.rootHash.length!==0&&t.uint32(10).bytes(e.rootHash),e.data.length!==0&&t.uint32(18).bytes(e.data),e.proof!==void 0&&a.Proof.encode(e.proof,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=O();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.rootHash=n.bytes();break;case 2:o.data=n.bytes();break;case 3:o.proof=a.Proof.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{rootHash:R(e.rootHash)?j(e.rootHash):new Uint8Array,data:R(e.data)?j(e.data):new Uint8Array,proof:R(e.proof)?a.Proof.fromJSON(e.proof):void 0}},toJSON(e){let t={};return e.rootHash!==void 0&&(t.rootHash=N(e.rootHash===void 0?new Uint8Array:e.rootHash)),e.data!==void 0&&(t.data=N(e.data===void 0?new Uint8Array:e.data)),e.proof!==void 0&&(t.proof=e.proof?a.Proof.toJSON(e.proof):void 0),t},fromPartial(e){let t=O();return t.rootHash=e.rootHash??new Uint8Array,t.data=e.data??new Uint8Array,t.proof=e.proof!==void 0&&e.proof!==null?a.Proof.fromPartial(e.proof):void 0,t}};var k=(()=>{if(k!==void 0)return k;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),A=k.atob||(e=>k.Buffer.from(e,`base64`).toString(`binary`));function j(e){let t=A(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var M=k.btoa||(e=>k.Buffer.from(e,`binary`).toString(`base64`));function N(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return M(t.join(``))}function P(e){return{seconds:Math.trunc(e.getTime()/1e3).toString(),nanos:e.getTime()%1e3*1e6}}function F(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}function I(e){return e instanceof Date?e:typeof e==`string`?new Date(e):F(i.Timestamp.fromJSON(e))}function L(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function R(e){return e!=null}})),tc=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Any=e.protobufPackage=void 0;var n=t(G()),r=t(q());e.protobufPackage=`google.protobuf`;function i(){return{typeUrl:``,value:new Uint8Array}}e.Any={encode(e,t=r.default.Writer.create()){return e.typeUrl!==``&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.typeUrl=n.string();break;case 2:o.value=n.bytes();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{typeUrl:u(e.typeUrl)?String(e.typeUrl):``,value:u(e.value)?s(e.value):new Uint8Array}},toJSON(e){let t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=l(e.value===void 0?new Uint8Array:e.value)),t},fromPartial(e){let t=i();return t.typeUrl=e.typeUrl??``,t.value=e.value??new Uint8Array,t}};var a=(()=>{if(a!==void 0)return a;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),o=a.atob||(e=>a.Buffer.from(e,`base64`).toString(`binary`));function s(e){let t=o(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var c=a.btoa||(e=>a.Buffer.from(e,`binary`).toString(`base64`));function l(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return c(t.join(``))}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function u(e){return e!=null}})),nc=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Duration=e.protobufPackage=void 0;var n=t(G()),r=t(q());e.protobufPackage=`google.protobuf`;function i(){return{seconds:`0`,nanos:0}}e.Duration={encode(e,t=r.default.Writer.create()){return e.seconds!==`0`&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),o=t===void 0?n.len:n.pos+t,s=i();for(;n.pos<o;){let e=n.uint32();switch(e>>>3){case 1:s.seconds=a(n.int64());break;case 2:s.nanos=n.int32();break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{seconds:o(e.seconds)?String(e.seconds):`0`,nanos:o(e.nanos)?Number(e.nanos):0}},toJSON(e){let t={};return e.seconds!==void 0&&(t.seconds=e.seconds),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){let t=i();return t.seconds=e.seconds??`0`,t.nanos=e.nanos??0,t}};function a(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function o(e){return e!=null}})),rc=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Pool=e.RedelegationResponse=e.RedelegationEntryResponse=e.DelegationResponse=e.Params=e.Redelegation=e.RedelegationEntry=e.UnbondingDelegationEntry=e.UnbondingDelegation=e.Delegation=e.DVVTriplets=e.DVVTriplet=e.DVPairs=e.DVPair=e.ValAddresses=e.Validator=e.Description=e.Commission=e.CommissionRates=e.HistoricalInfo=e.bondStatusToJSON=e.bondStatusFromJSON=e.BondStatus=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=Ys(),a=ec(),o=tc(),s=nc(),c=Ks();e.protobufPackage=`cosmos.staking.v1beta1`;var l;(function(e){e[e.BOND_STATUS_UNSPECIFIED=0]=`BOND_STATUS_UNSPECIFIED`,e[e.BOND_STATUS_UNBONDED=1]=`BOND_STATUS_UNBONDED`,e[e.BOND_STATUS_UNBONDING=2]=`BOND_STATUS_UNBONDING`,e[e.BOND_STATUS_BONDED=3]=`BOND_STATUS_BONDED`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(l=e.BondStatus||={});function u(e){switch(e){case 0:case`BOND_STATUS_UNSPECIFIED`:return l.BOND_STATUS_UNSPECIFIED;case 1:case`BOND_STATUS_UNBONDED`:return l.BOND_STATUS_UNBONDED;case 2:case`BOND_STATUS_UNBONDING`:return l.BOND_STATUS_UNBONDING;case 3:case`BOND_STATUS_BONDED`:return l.BOND_STATUS_BONDED;default:return l.UNRECOGNIZED}}e.bondStatusFromJSON=u;function d(e){switch(e){case l.BOND_STATUS_UNSPECIFIED:return`BOND_STATUS_UNSPECIFIED`;case l.BOND_STATUS_UNBONDED:return`BOND_STATUS_UNBONDED`;case l.BOND_STATUS_UNBONDING:return`BOND_STATUS_UNBONDING`;case l.BOND_STATUS_BONDED:return`BOND_STATUS_BONDED`;default:return`UNKNOWN`}}e.bondStatusToJSON=d;function f(){return{header:void 0,valset:[]}}e.HistoricalInfo={encode(t,n=r.default.Writer.create()){t.header!==void 0&&a.Header.encode(t.header,n.uint32(10).fork()).ldelim();for(let r of t.valset)e.Validator.encode(r,n.uint32(18).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?i.len:i.pos+n,s=f();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.header=a.Header.decode(i,i.uint32());break;case 2:s.valset.push(e.Validator.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{header:I(t.header)?a.Header.fromJSON(t.header):void 0,valset:Array.isArray(t?.valset)?t.valset.map(t=>e.Validator.fromJSON(t)):[]}},toJSON(t){let n={};return t.header!==void 0&&(n.header=t.header?a.Header.toJSON(t.header):void 0),t.valset?n.valset=t.valset.map(t=>t?e.Validator.toJSON(t):void 0):n.valset=[],n},fromPartial(t){let n=f();return n.header=t.header!==void 0&&t.header!==null?a.Header.fromPartial(t.header):void 0,n.valset=t.valset?.map(t=>e.Validator.fromPartial(t))||[],n}};function p(){return{rate:``,maxRate:``,maxChangeRate:``}}e.CommissionRates={encode(e,t=r.default.Writer.create()){return e.rate!==``&&t.uint32(10).string(e.rate),e.maxRate!==``&&t.uint32(18).string(e.maxRate),e.maxChangeRate!==``&&t.uint32(26).string(e.maxChangeRate),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=p();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.rate=n.string();break;case 2:a.maxRate=n.string();break;case 3:a.maxChangeRate=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{rate:I(e.rate)?String(e.rate):``,maxRate:I(e.maxRate)?String(e.maxRate):``,maxChangeRate:I(e.maxChangeRate)?String(e.maxChangeRate):``}},toJSON(e){let t={};return e.rate!==void 0&&(t.rate=e.rate),e.maxRate!==void 0&&(t.maxRate=e.maxRate),e.maxChangeRate!==void 0&&(t.maxChangeRate=e.maxChangeRate),t},fromPartial(e){let t=p();return t.rate=e.rate??``,t.maxRate=e.maxRate??``,t.maxChangeRate=e.maxChangeRate??``,t}};function m(){return{commissionRates:void 0,updateTime:void 0}}e.Commission={encode(t,n=r.default.Writer.create()){return t.commissionRates!==void 0&&e.CommissionRates.encode(t.commissionRates,n.uint32(10).fork()).ldelim(),t.updateTime!==void 0&&i.Timestamp.encode(M(t.updateTime),n.uint32(18).fork()).ldelim(),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,s=m();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.commissionRates=e.CommissionRates.decode(a,a.uint32());break;case 2:s.updateTime=N(i.Timestamp.decode(a,a.uint32()));break;default:a.skipType(t&7);break}}return s},fromJSON(t){return{commissionRates:I(t.commissionRates)?e.CommissionRates.fromJSON(t.commissionRates):void 0,updateTime:I(t.updateTime)?P(t.updateTime):void 0}},toJSON(t){let n={};return t.commissionRates!==void 0&&(n.commissionRates=t.commissionRates?e.CommissionRates.toJSON(t.commissionRates):void 0),t.updateTime!==void 0&&(n.updateTime=t.updateTime.toISOString()),n},fromPartial(t){let n=m();return n.commissionRates=t.commissionRates!==void 0&&t.commissionRates!==null?e.CommissionRates.fromPartial(t.commissionRates):void 0,n.updateTime=t.updateTime??void 0,n}};function h(){return{moniker:``,identity:``,website:``,securityContact:``,details:``}}e.Description={encode(e,t=r.default.Writer.create()){return e.moniker!==``&&t.uint32(10).string(e.moniker),e.identity!==``&&t.uint32(18).string(e.identity),e.website!==``&&t.uint32(26).string(e.website),e.securityContact!==``&&t.uint32(34).string(e.securityContact),e.details!==``&&t.uint32(42).string(e.details),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=h();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.moniker=n.string();break;case 2:a.identity=n.string();break;case 3:a.website=n.string();break;case 4:a.securityContact=n.string();break;case 5:a.details=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{moniker:I(e.moniker)?String(e.moniker):``,identity:I(e.identity)?String(e.identity):``,website:I(e.website)?String(e.website):``,securityContact:I(e.securityContact)?String(e.securityContact):``,details:I(e.details)?String(e.details):``}},toJSON(e){let t={};return e.moniker!==void 0&&(t.moniker=e.moniker),e.identity!==void 0&&(t.identity=e.identity),e.website!==void 0&&(t.website=e.website),e.securityContact!==void 0&&(t.securityContact=e.securityContact),e.details!==void 0&&(t.details=e.details),t},fromPartial(e){let t=h();return t.moniker=e.moniker??``,t.identity=e.identity??``,t.website=e.website??``,t.securityContact=e.securityContact??``,t.details=e.details??``,t}};function g(){return{operatorAddress:``,consensusPubkey:void 0,jailed:!1,status:0,tokens:``,delegatorShares:``,description:void 0,unbondingHeight:`0`,unbondingTime:void 0,commission:void 0,minSelfDelegation:``}}e.Validator={encode(t,n=r.default.Writer.create()){return t.operatorAddress!==``&&n.uint32(10).string(t.operatorAddress),t.consensusPubkey!==void 0&&o.Any.encode(t.consensusPubkey,n.uint32(18).fork()).ldelim(),t.jailed===!0&&n.uint32(24).bool(t.jailed),t.status!==0&&n.uint32(32).int32(t.status),t.tokens!==``&&n.uint32(42).string(t.tokens),t.delegatorShares!==``&&n.uint32(50).string(t.delegatorShares),t.description!==void 0&&e.Description.encode(t.description,n.uint32(58).fork()).ldelim(),t.unbondingHeight!==`0`&&n.uint32(64).int64(t.unbondingHeight),t.unbondingTime!==void 0&&i.Timestamp.encode(M(t.unbondingTime),n.uint32(74).fork()).ldelim(),t.commission!==void 0&&e.Commission.encode(t.commission,n.uint32(82).fork()).ldelim(),t.minSelfDelegation!==``&&n.uint32(90).string(t.minSelfDelegation),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),s=n===void 0?a.len:a.pos+n,c=g();for(;a.pos<s;){let t=a.uint32();switch(t>>>3){case 1:c.operatorAddress=a.string();break;case 2:c.consensusPubkey=o.Any.decode(a,a.uint32());break;case 3:c.jailed=a.bool();break;case 4:c.status=a.int32();break;case 5:c.tokens=a.string();break;case 6:c.delegatorShares=a.string();break;case 7:c.description=e.Description.decode(a,a.uint32());break;case 8:c.unbondingHeight=F(a.int64());break;case 9:c.unbondingTime=N(i.Timestamp.decode(a,a.uint32()));break;case 10:c.commission=e.Commission.decode(a,a.uint32());break;case 11:c.minSelfDelegation=a.string();break;default:a.skipType(t&7);break}}return c},fromJSON(t){return{operatorAddress:I(t.operatorAddress)?String(t.operatorAddress):``,consensusPubkey:I(t.consensusPubkey)?o.Any.fromJSON(t.consensusPubkey):void 0,jailed:I(t.jailed)?!!t.jailed:!1,status:I(t.status)?u(t.status):0,tokens:I(t.tokens)?String(t.tokens):``,delegatorShares:I(t.delegatorShares)?String(t.delegatorShares):``,description:I(t.description)?e.Description.fromJSON(t.description):void 0,unbondingHeight:I(t.unbondingHeight)?String(t.unbondingHeight):`0`,unbondingTime:I(t.unbondingTime)?P(t.unbondingTime):void 0,commission:I(t.commission)?e.Commission.fromJSON(t.commission):void 0,minSelfDelegation:I(t.minSelfDelegation)?String(t.minSelfDelegation):``}},toJSON(t){let n={};return t.operatorAddress!==void 0&&(n.operatorAddress=t.operatorAddress),t.consensusPubkey!==void 0&&(n.consensusPubkey=t.consensusPubkey?o.Any.toJSON(t.consensusPubkey):void 0),t.jailed!==void 0&&(n.jailed=t.jailed),t.status!==void 0&&(n.status=d(t.status)),t.tokens!==void 0&&(n.tokens=t.tokens),t.delegatorShares!==void 0&&(n.delegatorShares=t.delegatorShares),t.description!==void 0&&(n.description=t.description?e.Description.toJSON(t.description):void 0),t.unbondingHeight!==void 0&&(n.unbondingHeight=t.unbondingHeight),t.unbondingTime!==void 0&&(n.unbondingTime=t.unbondingTime.toISOString()),t.commission!==void 0&&(n.commission=t.commission?e.Commission.toJSON(t.commission):void 0),t.minSelfDelegation!==void 0&&(n.minSelfDelegation=t.minSelfDelegation),n},fromPartial(t){let n=g();return n.operatorAddress=t.operatorAddress??``,n.consensusPubkey=t.consensusPubkey!==void 0&&t.consensusPubkey!==null?o.Any.fromPartial(t.consensusPubkey):void 0,n.jailed=t.jailed??!1,n.status=t.status??0,n.tokens=t.tokens??``,n.delegatorShares=t.delegatorShares??``,n.description=t.description!==void 0&&t.description!==null?e.Description.fromPartial(t.description):void 0,n.unbondingHeight=t.unbondingHeight??`0`,n.unbondingTime=t.unbondingTime??void 0,n.commission=t.commission!==void 0&&t.commission!==null?e.Commission.fromPartial(t.commission):void 0,n.minSelfDelegation=t.minSelfDelegation??``,n}};function _(){return{addresses:[]}}e.ValAddresses={encode(e,t=r.default.Writer.create()){for(let n of e.addresses)t.uint32(10).string(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=_();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.addresses.push(n.string());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{addresses:Array.isArray(e?.addresses)?e.addresses.map(e=>String(e)):[]}},toJSON(e){let t={};return e.addresses?t.addresses=e.addresses.map(e=>e):t.addresses=[],t},fromPartial(e){let t=_();return t.addresses=e.addresses?.map(e=>e)||[],t}};function v(){return{delegatorAddress:``,validatorAddress:``}}e.DVPair={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==``&&t.uint32(18).string(e.validatorAddress),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=v();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorAddress=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:I(e.delegatorAddress)?String(e.delegatorAddress):``,validatorAddress:I(e.validatorAddress)?String(e.validatorAddress):``}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),t},fromPartial(e){let t=v();return t.delegatorAddress=e.delegatorAddress??``,t.validatorAddress=e.validatorAddress??``,t}};function y(){return{pairs:[]}}e.DVPairs={encode(t,n=r.default.Writer.create()){for(let r of t.pairs)e.DVPair.encode(r,n.uint32(10).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=y();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.pairs.push(e.DVPair.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{pairs:Array.isArray(t?.pairs)?t.pairs.map(t=>e.DVPair.fromJSON(t)):[]}},toJSON(t){let n={};return t.pairs?n.pairs=t.pairs.map(t=>t?e.DVPair.toJSON(t):void 0):n.pairs=[],n},fromPartial(t){let n=y();return n.pairs=t.pairs?.map(t=>e.DVPair.fromPartial(t))||[],n}};function b(){return{delegatorAddress:``,validatorSrcAddress:``,validatorDstAddress:``}}e.DVVTriplet={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorSrcAddress!==``&&t.uint32(18).string(e.validatorSrcAddress),e.validatorDstAddress!==``&&t.uint32(26).string(e.validatorDstAddress),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=b();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorSrcAddress=n.string();break;case 3:a.validatorDstAddress=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:I(e.delegatorAddress)?String(e.delegatorAddress):``,validatorSrcAddress:I(e.validatorSrcAddress)?String(e.validatorSrcAddress):``,validatorDstAddress:I(e.validatorDstAddress)?String(e.validatorDstAddress):``}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorSrcAddress!==void 0&&(t.validatorSrcAddress=e.validatorSrcAddress),e.validatorDstAddress!==void 0&&(t.validatorDstAddress=e.validatorDstAddress),t},fromPartial(e){let t=b();return t.delegatorAddress=e.delegatorAddress??``,t.validatorSrcAddress=e.validatorSrcAddress??``,t.validatorDstAddress=e.validatorDstAddress??``,t}};function x(){return{triplets:[]}}e.DVVTriplets={encode(t,n=r.default.Writer.create()){for(let r of t.triplets)e.DVVTriplet.encode(r,n.uint32(10).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=x();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.triplets.push(e.DVVTriplet.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{triplets:Array.isArray(t?.triplets)?t.triplets.map(t=>e.DVVTriplet.fromJSON(t)):[]}},toJSON(t){let n={};return t.triplets?n.triplets=t.triplets.map(t=>t?e.DVVTriplet.toJSON(t):void 0):n.triplets=[],n},fromPartial(t){let n=x();return n.triplets=t.triplets?.map(t=>e.DVVTriplet.fromPartial(t))||[],n}};function S(){return{delegatorAddress:``,validatorAddress:``,shares:``}}e.Delegation={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==``&&t.uint32(18).string(e.validatorAddress),e.shares!==``&&t.uint32(26).string(e.shares),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=S();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorAddress=n.string();break;case 3:a.shares=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:I(e.delegatorAddress)?String(e.delegatorAddress):``,validatorAddress:I(e.validatorAddress)?String(e.validatorAddress):``,shares:I(e.shares)?String(e.shares):``}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.shares!==void 0&&(t.shares=e.shares),t},fromPartial(e){let t=S();return t.delegatorAddress=e.delegatorAddress??``,t.validatorAddress=e.validatorAddress??``,t.shares=e.shares??``,t}};function C(){return{delegatorAddress:``,validatorAddress:``,entries:[]}}e.UnbondingDelegation={encode(t,n=r.default.Writer.create()){t.delegatorAddress!==``&&n.uint32(10).string(t.delegatorAddress),t.validatorAddress!==``&&n.uint32(18).string(t.validatorAddress);for(let r of t.entries)e.UnbondingDelegationEntry.encode(r,n.uint32(26).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=C();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.delegatorAddress=i.string();break;case 2:o.validatorAddress=i.string();break;case 3:o.entries.push(e.UnbondingDelegationEntry.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{delegatorAddress:I(t.delegatorAddress)?String(t.delegatorAddress):``,validatorAddress:I(t.validatorAddress)?String(t.validatorAddress):``,entries:Array.isArray(t?.entries)?t.entries.map(t=>e.UnbondingDelegationEntry.fromJSON(t)):[]}},toJSON(t){let n={};return t.delegatorAddress!==void 0&&(n.delegatorAddress=t.delegatorAddress),t.validatorAddress!==void 0&&(n.validatorAddress=t.validatorAddress),t.entries?n.entries=t.entries.map(t=>t?e.UnbondingDelegationEntry.toJSON(t):void 0):n.entries=[],n},fromPartial(t){let n=C();return n.delegatorAddress=t.delegatorAddress??``,n.validatorAddress=t.validatorAddress??``,n.entries=t.entries?.map(t=>e.UnbondingDelegationEntry.fromPartial(t))||[],n}};function w(){return{creationHeight:`0`,completionTime:void 0,initialBalance:``,balance:``}}e.UnbondingDelegationEntry={encode(e,t=r.default.Writer.create()){return e.creationHeight!==`0`&&t.uint32(8).int64(e.creationHeight),e.completionTime!==void 0&&i.Timestamp.encode(M(e.completionTime),t.uint32(18).fork()).ldelim(),e.initialBalance!==``&&t.uint32(26).string(e.initialBalance),e.balance!==``&&t.uint32(34).string(e.balance),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=w();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.creationHeight=F(n.int64());break;case 2:o.completionTime=N(i.Timestamp.decode(n,n.uint32()));break;case 3:o.initialBalance=n.string();break;case 4:o.balance=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{creationHeight:I(e.creationHeight)?String(e.creationHeight):`0`,completionTime:I(e.completionTime)?P(e.completionTime):void 0,initialBalance:I(e.initialBalance)?String(e.initialBalance):``,balance:I(e.balance)?String(e.balance):``}},toJSON(e){let t={};return e.creationHeight!==void 0&&(t.creationHeight=e.creationHeight),e.completionTime!==void 0&&(t.completionTime=e.completionTime.toISOString()),e.initialBalance!==void 0&&(t.initialBalance=e.initialBalance),e.balance!==void 0&&(t.balance=e.balance),t},fromPartial(e){let t=w();return t.creationHeight=e.creationHeight??`0`,t.completionTime=e.completionTime??void 0,t.initialBalance=e.initialBalance??``,t.balance=e.balance??``,t}};function T(){return{creationHeight:`0`,completionTime:void 0,initialBalance:``,sharesDst:``}}e.RedelegationEntry={encode(e,t=r.default.Writer.create()){return e.creationHeight!==`0`&&t.uint32(8).int64(e.creationHeight),e.completionTime!==void 0&&i.Timestamp.encode(M(e.completionTime),t.uint32(18).fork()).ldelim(),e.initialBalance!==``&&t.uint32(26).string(e.initialBalance),e.sharesDst!==``&&t.uint32(34).string(e.sharesDst),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=T();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.creationHeight=F(n.int64());break;case 2:o.completionTime=N(i.Timestamp.decode(n,n.uint32()));break;case 3:o.initialBalance=n.string();break;case 4:o.sharesDst=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{creationHeight:I(e.creationHeight)?String(e.creationHeight):`0`,completionTime:I(e.completionTime)?P(e.completionTime):void 0,initialBalance:I(e.initialBalance)?String(e.initialBalance):``,sharesDst:I(e.sharesDst)?String(e.sharesDst):``}},toJSON(e){let t={};return e.creationHeight!==void 0&&(t.creationHeight=e.creationHeight),e.completionTime!==void 0&&(t.completionTime=e.completionTime.toISOString()),e.initialBalance!==void 0&&(t.initialBalance=e.initialBalance),e.sharesDst!==void 0&&(t.sharesDst=e.sharesDst),t},fromPartial(e){let t=T();return t.creationHeight=e.creationHeight??`0`,t.completionTime=e.completionTime??void 0,t.initialBalance=e.initialBalance??``,t.sharesDst=e.sharesDst??``,t}};function E(){return{delegatorAddress:``,validatorSrcAddress:``,validatorDstAddress:``,entries:[]}}e.Redelegation={encode(t,n=r.default.Writer.create()){t.delegatorAddress!==``&&n.uint32(10).string(t.delegatorAddress),t.validatorSrcAddress!==``&&n.uint32(18).string(t.validatorSrcAddress),t.validatorDstAddress!==``&&n.uint32(26).string(t.validatorDstAddress);for(let r of t.entries)e.RedelegationEntry.encode(r,n.uint32(34).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=E();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.delegatorAddress=i.string();break;case 2:o.validatorSrcAddress=i.string();break;case 3:o.validatorDstAddress=i.string();break;case 4:o.entries.push(e.RedelegationEntry.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{delegatorAddress:I(t.delegatorAddress)?String(t.delegatorAddress):``,validatorSrcAddress:I(t.validatorSrcAddress)?String(t.validatorSrcAddress):``,validatorDstAddress:I(t.validatorDstAddress)?String(t.validatorDstAddress):``,entries:Array.isArray(t?.entries)?t.entries.map(t=>e.RedelegationEntry.fromJSON(t)):[]}},toJSON(t){let n={};return t.delegatorAddress!==void 0&&(n.delegatorAddress=t.delegatorAddress),t.validatorSrcAddress!==void 0&&(n.validatorSrcAddress=t.validatorSrcAddress),t.validatorDstAddress!==void 0&&(n.validatorDstAddress=t.validatorDstAddress),t.entries?n.entries=t.entries.map(t=>t?e.RedelegationEntry.toJSON(t):void 0):n.entries=[],n},fromPartial(t){let n=E();return n.delegatorAddress=t.delegatorAddress??``,n.validatorSrcAddress=t.validatorSrcAddress??``,n.validatorDstAddress=t.validatorDstAddress??``,n.entries=t.entries?.map(t=>e.RedelegationEntry.fromPartial(t))||[],n}};function D(){return{unbondingTime:void 0,maxValidators:0,maxEntries:0,historicalEntries:0,bondDenom:``}}e.Params={encode(e,t=r.default.Writer.create()){return e.unbondingTime!==void 0&&s.Duration.encode(e.unbondingTime,t.uint32(10).fork()).ldelim(),e.maxValidators!==0&&t.uint32(16).uint32(e.maxValidators),e.maxEntries!==0&&t.uint32(24).uint32(e.maxEntries),e.historicalEntries!==0&&t.uint32(32).uint32(e.historicalEntries),e.bondDenom!==``&&t.uint32(42).string(e.bondDenom),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=D();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.unbondingTime=s.Duration.decode(n,n.uint32());break;case 2:a.maxValidators=n.uint32();break;case 3:a.maxEntries=n.uint32();break;case 4:a.historicalEntries=n.uint32();break;case 5:a.bondDenom=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{unbondingTime:I(e.unbondingTime)?s.Duration.fromJSON(e.unbondingTime):void 0,maxValidators:I(e.maxValidators)?Number(e.maxValidators):0,maxEntries:I(e.maxEntries)?Number(e.maxEntries):0,historicalEntries:I(e.historicalEntries)?Number(e.historicalEntries):0,bondDenom:I(e.bondDenom)?String(e.bondDenom):``}},toJSON(e){let t={};return e.unbondingTime!==void 0&&(t.unbondingTime=e.unbondingTime?s.Duration.toJSON(e.unbondingTime):void 0),e.maxValidators!==void 0&&(t.maxValidators=Math.round(e.maxValidators)),e.maxEntries!==void 0&&(t.maxEntries=Math.round(e.maxEntries)),e.historicalEntries!==void 0&&(t.historicalEntries=Math.round(e.historicalEntries)),e.bondDenom!==void 0&&(t.bondDenom=e.bondDenom),t},fromPartial(e){let t=D();return t.unbondingTime=e.unbondingTime!==void 0&&e.unbondingTime!==null?s.Duration.fromPartial(e.unbondingTime):void 0,t.maxValidators=e.maxValidators??0,t.maxEntries=e.maxEntries??0,t.historicalEntries=e.historicalEntries??0,t.bondDenom=e.bondDenom??``,t}};function O(){return{delegation:void 0,balance:void 0}}e.DelegationResponse={encode(t,n=r.default.Writer.create()){return t.delegation!==void 0&&e.Delegation.encode(t.delegation,n.uint32(10).fork()).ldelim(),t.balance!==void 0&&c.Coin.encode(t.balance,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=O();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.delegation=e.Delegation.decode(i,i.uint32());break;case 2:o.balance=c.Coin.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{delegation:I(t.delegation)?e.Delegation.fromJSON(t.delegation):void 0,balance:I(t.balance)?c.Coin.fromJSON(t.balance):void 0}},toJSON(t){let n={};return t.delegation!==void 0&&(n.delegation=t.delegation?e.Delegation.toJSON(t.delegation):void 0),t.balance!==void 0&&(n.balance=t.balance?c.Coin.toJSON(t.balance):void 0),n},fromPartial(t){let n=O();return n.delegation=t.delegation!==void 0&&t.delegation!==null?e.Delegation.fromPartial(t.delegation):void 0,n.balance=t.balance!==void 0&&t.balance!==null?c.Coin.fromPartial(t.balance):void 0,n}};function k(){return{redelegationEntry:void 0,balance:``}}e.RedelegationEntryResponse={encode(t,n=r.default.Writer.create()){return t.redelegationEntry!==void 0&&e.RedelegationEntry.encode(t.redelegationEntry,n.uint32(10).fork()).ldelim(),t.balance!==``&&n.uint32(34).string(t.balance),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=k();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.redelegationEntry=e.RedelegationEntry.decode(i,i.uint32());break;case 4:o.balance=i.string();break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{redelegationEntry:I(t.redelegationEntry)?e.RedelegationEntry.fromJSON(t.redelegationEntry):void 0,balance:I(t.balance)?String(t.balance):``}},toJSON(t){let n={};return t.redelegationEntry!==void 0&&(n.redelegationEntry=t.redelegationEntry?e.RedelegationEntry.toJSON(t.redelegationEntry):void 0),t.balance!==void 0&&(n.balance=t.balance),n},fromPartial(t){let n=k();return n.redelegationEntry=t.redelegationEntry!==void 0&&t.redelegationEntry!==null?e.RedelegationEntry.fromPartial(t.redelegationEntry):void 0,n.balance=t.balance??``,n}};function A(){return{redelegation:void 0,entries:[]}}e.RedelegationResponse={encode(t,n=r.default.Writer.create()){t.redelegation!==void 0&&e.Redelegation.encode(t.redelegation,n.uint32(10).fork()).ldelim();for(let r of t.entries)e.RedelegationEntryResponse.encode(r,n.uint32(18).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=A();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.redelegation=e.Redelegation.decode(i,i.uint32());break;case 2:o.entries.push(e.RedelegationEntryResponse.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{redelegation:I(t.redelegation)?e.Redelegation.fromJSON(t.redelegation):void 0,entries:Array.isArray(t?.entries)?t.entries.map(t=>e.RedelegationEntryResponse.fromJSON(t)):[]}},toJSON(t){let n={};return t.redelegation!==void 0&&(n.redelegation=t.redelegation?e.Redelegation.toJSON(t.redelegation):void 0),t.entries?n.entries=t.entries.map(t=>t?e.RedelegationEntryResponse.toJSON(t):void 0):n.entries=[],n},fromPartial(t){let n=A();return n.redelegation=t.redelegation!==void 0&&t.redelegation!==null?e.Redelegation.fromPartial(t.redelegation):void 0,n.entries=t.entries?.map(t=>e.RedelegationEntryResponse.fromPartial(t))||[],n}};function j(){return{notBondedTokens:``,bondedTokens:``}}e.Pool={encode(e,t=r.default.Writer.create()){return e.notBondedTokens!==``&&t.uint32(10).string(e.notBondedTokens),e.bondedTokens!==``&&t.uint32(18).string(e.bondedTokens),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=j();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.notBondedTokens=n.string();break;case 2:a.bondedTokens=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{notBondedTokens:I(e.notBondedTokens)?String(e.notBondedTokens):``,bondedTokens:I(e.bondedTokens)?String(e.bondedTokens):``}},toJSON(e){let t={};return e.notBondedTokens!==void 0&&(t.notBondedTokens=e.notBondedTokens),e.bondedTokens!==void 0&&(t.bondedTokens=e.bondedTokens),t},fromPartial(e){let t=j();return t.notBondedTokens=e.notBondedTokens??``,t.bondedTokens=e.bondedTokens??``,t}};function M(e){return{seconds:Math.trunc(e.getTime()/1e3).toString(),nanos:e.getTime()%1e3*1e6}}function N(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}function P(e){return e instanceof Date?e:typeof e==`string`?new Date(e):N(i.Timestamp.fromJSON(e))}function F(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function I(e){return e!=null}})),ic=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.MsgUndelegateResponse=e.MsgUndelegate=e.MsgBeginRedelegateResponse=e.MsgBeginRedelegate=e.MsgDelegateResponse=e.MsgDelegate=e.MsgEditValidatorResponse=e.MsgEditValidator=e.MsgCreateValidatorResponse=e.MsgCreateValidator=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=Ys(),a=rc(),o=tc(),s=Ks();e.protobufPackage=`cosmos.staking.v1beta1`;function c(){return{description:void 0,commission:void 0,minSelfDelegation:``,delegatorAddress:``,validatorAddress:``,pubkey:void 0,value:void 0}}e.MsgCreateValidator={encode(e,t=r.default.Writer.create()){return e.description!==void 0&&a.Description.encode(e.description,t.uint32(10).fork()).ldelim(),e.commission!==void 0&&a.CommissionRates.encode(e.commission,t.uint32(18).fork()).ldelim(),e.minSelfDelegation!==``&&t.uint32(26).string(e.minSelfDelegation),e.delegatorAddress!==``&&t.uint32(34).string(e.delegatorAddress),e.validatorAddress!==``&&t.uint32(42).string(e.validatorAddress),e.pubkey!==void 0&&o.Any.encode(e.pubkey,t.uint32(50).fork()).ldelim(),e.value!==void 0&&s.Coin.encode(e.value,t.uint32(58).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,l=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:l.description=a.Description.decode(n,n.uint32());break;case 2:l.commission=a.CommissionRates.decode(n,n.uint32());break;case 3:l.minSelfDelegation=n.string();break;case 4:l.delegatorAddress=n.string();break;case 5:l.validatorAddress=n.string();break;case 6:l.pubkey=o.Any.decode(n,n.uint32());break;case 7:l.value=s.Coin.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return l},fromJSON(e){return{description:x(e.description)?a.Description.fromJSON(e.description):void 0,commission:x(e.commission)?a.CommissionRates.fromJSON(e.commission):void 0,minSelfDelegation:x(e.minSelfDelegation)?String(e.minSelfDelegation):``,delegatorAddress:x(e.delegatorAddress)?String(e.delegatorAddress):``,validatorAddress:x(e.validatorAddress)?String(e.validatorAddress):``,pubkey:x(e.pubkey)?o.Any.fromJSON(e.pubkey):void 0,value:x(e.value)?s.Coin.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.description!==void 0&&(t.description=e.description?a.Description.toJSON(e.description):void 0),e.commission!==void 0&&(t.commission=e.commission?a.CommissionRates.toJSON(e.commission):void 0),e.minSelfDelegation!==void 0&&(t.minSelfDelegation=e.minSelfDelegation),e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.pubkey!==void 0&&(t.pubkey=e.pubkey?o.Any.toJSON(e.pubkey):void 0),e.value!==void 0&&(t.value=e.value?s.Coin.toJSON(e.value):void 0),t},fromPartial(e){let t=c();return t.description=e.description!==void 0&&e.description!==null?a.Description.fromPartial(e.description):void 0,t.commission=e.commission!==void 0&&e.commission!==null?a.CommissionRates.fromPartial(e.commission):void 0,t.minSelfDelegation=e.minSelfDelegation??``,t.delegatorAddress=e.delegatorAddress??``,t.validatorAddress=e.validatorAddress??``,t.pubkey=e.pubkey!==void 0&&e.pubkey!==null?o.Any.fromPartial(e.pubkey):void 0,t.value=e.value!==void 0&&e.value!==null?s.Coin.fromPartial(e.value):void 0,t}};function l(){return{}}e.MsgCreateValidatorResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return l()}};function u(){return{description:void 0,validatorAddress:``,commissionRate:``,minSelfDelegation:``}}e.MsgEditValidator={encode(e,t=r.default.Writer.create()){return e.description!==void 0&&a.Description.encode(e.description,t.uint32(10).fork()).ldelim(),e.validatorAddress!==``&&t.uint32(18).string(e.validatorAddress),e.commissionRate!==``&&t.uint32(26).string(e.commissionRate),e.minSelfDelegation!==``&&t.uint32(34).string(e.minSelfDelegation),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.description=a.Description.decode(n,n.uint32());break;case 2:o.validatorAddress=n.string();break;case 3:o.commissionRate=n.string();break;case 4:o.minSelfDelegation=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{description:x(e.description)?a.Description.fromJSON(e.description):void 0,validatorAddress:x(e.validatorAddress)?String(e.validatorAddress):``,commissionRate:x(e.commissionRate)?String(e.commissionRate):``,minSelfDelegation:x(e.minSelfDelegation)?String(e.minSelfDelegation):``}},toJSON(e){let t={};return e.description!==void 0&&(t.description=e.description?a.Description.toJSON(e.description):void 0),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.commissionRate!==void 0&&(t.commissionRate=e.commissionRate),e.minSelfDelegation!==void 0&&(t.minSelfDelegation=e.minSelfDelegation),t},fromPartial(e){let t=u();return t.description=e.description!==void 0&&e.description!==null?a.Description.fromPartial(e.description):void 0,t.validatorAddress=e.validatorAddress??``,t.commissionRate=e.commissionRate??``,t.minSelfDelegation=e.minSelfDelegation??``,t}};function d(){return{}}e.MsgEditValidatorResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return d()}};function f(){return{delegatorAddress:``,validatorAddress:``,amount:void 0}}e.MsgDelegate={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==``&&t.uint32(18).string(e.validatorAddress),e.amount!==void 0&&s.Coin.encode(e.amount,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorAddress=n.string();break;case 3:a.amount=s.Coin.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:x(e.delegatorAddress)?String(e.delegatorAddress):``,validatorAddress:x(e.validatorAddress)?String(e.validatorAddress):``,amount:x(e.amount)?s.Coin.fromJSON(e.amount):void 0}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.amount!==void 0&&(t.amount=e.amount?s.Coin.toJSON(e.amount):void 0),t},fromPartial(e){let t=f();return t.delegatorAddress=e.delegatorAddress??``,t.validatorAddress=e.validatorAddress??``,t.amount=e.amount!==void 0&&e.amount!==null?s.Coin.fromPartial(e.amount):void 0,t}};function p(){return{}}e.MsgDelegateResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=p();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return p()}};function m(){return{delegatorAddress:``,validatorSrcAddress:``,validatorDstAddress:``,amount:void 0}}e.MsgBeginRedelegate={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorSrcAddress!==``&&t.uint32(18).string(e.validatorSrcAddress),e.validatorDstAddress!==``&&t.uint32(26).string(e.validatorDstAddress),e.amount!==void 0&&s.Coin.encode(e.amount,t.uint32(34).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=m();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorSrcAddress=n.string();break;case 3:a.validatorDstAddress=n.string();break;case 4:a.amount=s.Coin.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:x(e.delegatorAddress)?String(e.delegatorAddress):``,validatorSrcAddress:x(e.validatorSrcAddress)?String(e.validatorSrcAddress):``,validatorDstAddress:x(e.validatorDstAddress)?String(e.validatorDstAddress):``,amount:x(e.amount)?s.Coin.fromJSON(e.amount):void 0}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorSrcAddress!==void 0&&(t.validatorSrcAddress=e.validatorSrcAddress),e.validatorDstAddress!==void 0&&(t.validatorDstAddress=e.validatorDstAddress),e.amount!==void 0&&(t.amount=e.amount?s.Coin.toJSON(e.amount):void 0),t},fromPartial(e){let t=m();return t.delegatorAddress=e.delegatorAddress??``,t.validatorSrcAddress=e.validatorSrcAddress??``,t.validatorDstAddress=e.validatorDstAddress??``,t.amount=e.amount!==void 0&&e.amount!==null?s.Coin.fromPartial(e.amount):void 0,t}};function h(){return{completionTime:void 0}}e.MsgBeginRedelegateResponse={encode(e,t=r.default.Writer.create()){return e.completionTime!==void 0&&i.Timestamp.encode(v(e.completionTime),t.uint32(10).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=h();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.completionTime=y(i.Timestamp.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{completionTime:x(e.completionTime)?b(e.completionTime):void 0}},toJSON(e){let t={};return e.completionTime!==void 0&&(t.completionTime=e.completionTime.toISOString()),t},fromPartial(e){let t=h();return t.completionTime=e.completionTime??void 0,t}};function g(){return{delegatorAddress:``,validatorAddress:``,amount:void 0}}e.MsgUndelegate={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==``&&t.uint32(18).string(e.validatorAddress),e.amount!==void 0&&s.Coin.encode(e.amount,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=g();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorAddress=n.string();break;case 3:a.amount=s.Coin.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:x(e.delegatorAddress)?String(e.delegatorAddress):``,validatorAddress:x(e.validatorAddress)?String(e.validatorAddress):``,amount:x(e.amount)?s.Coin.fromJSON(e.amount):void 0}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.amount!==void 0&&(t.amount=e.amount?s.Coin.toJSON(e.amount):void 0),t},fromPartial(e){let t=g();return t.delegatorAddress=e.delegatorAddress??``,t.validatorAddress=e.validatorAddress??``,t.amount=e.amount!==void 0&&e.amount!==null?s.Coin.fromPartial(e.amount):void 0,t}};function _(){return{completionTime:void 0}}e.MsgUndelegateResponse={encode(e,t=r.default.Writer.create()){return e.completionTime!==void 0&&i.Timestamp.encode(v(e.completionTime),t.uint32(10).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=_();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.completionTime=y(i.Timestamp.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{completionTime:x(e.completionTime)?b(e.completionTime):void 0}},toJSON(e){let t={};return e.completionTime!==void 0&&(t.completionTime=e.completionTime.toISOString()),t},fromPartial(e){let t=_();return t.completionTime=e.completionTime??void 0,t}};function v(e){return{seconds:Math.trunc(e.getTime()/1e3).toString(),nanos:e.getTime()%1e3*1e6}}function y(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}function b(e){return e instanceof Date?e:typeof e==`string`?new Date(e):y(i.Timestamp.fromJSON(e))}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function x(e){return e!=null}})),ac=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Grant=e.GenericAuthorization=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=Ys(),a=tc();e.protobufPackage=`cosmos.authz.v1beta1`;function o(){return{msg:``}}e.GenericAuthorization={encode(e,t=r.default.Writer.create()){return e.msg!==``&&t.uint32(10).string(e.msg),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=o();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.msg=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{msg:d(e.msg)?String(e.msg):``}},toJSON(e){let t={};return e.msg!==void 0&&(t.msg=e.msg),t},fromPartial(e){let t=o();return t.msg=e.msg??``,t}};function s(){return{authorization:void 0,expiration:void 0}}e.Grant={encode(e,t=r.default.Writer.create()){return e.authorization!==void 0&&a.Any.encode(e.authorization,t.uint32(10).fork()).ldelim(),e.expiration!==void 0&&i.Timestamp.encode(c(e.expiration),t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),o=t===void 0?n.len:n.pos+t,c=s();for(;n.pos<o;){let e=n.uint32();switch(e>>>3){case 1:c.authorization=a.Any.decode(n,n.uint32());break;case 2:c.expiration=l(i.Timestamp.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return c},fromJSON(e){return{authorization:d(e.authorization)?a.Any.fromJSON(e.authorization):void 0,expiration:d(e.expiration)?u(e.expiration):void 0}},toJSON(e){let t={};return e.authorization!==void 0&&(t.authorization=e.authorization?a.Any.toJSON(e.authorization):void 0),e.expiration!==void 0&&(t.expiration=e.expiration.toISOString()),t},fromPartial(e){let t=s();return t.authorization=e.authorization!==void 0&&e.authorization!==null?a.Any.fromPartial(e.authorization):void 0,t.expiration=e.expiration??void 0,t}};function c(e){return{seconds:Math.trunc(e.getTime()/1e3).toString(),nanos:e.getTime()%1e3*1e6}}function l(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}function u(e){return e instanceof Date?e:typeof e==`string`?new Date(e):l(i.Timestamp.fromJSON(e))}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function d(e){return e!=null}})),oc=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.MsgRevokeResponse=e.MsgRevoke=e.MsgGrantResponse=e.MsgExec=e.MsgExecResponse=e.MsgGrant=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=ac(),a=tc();e.protobufPackage=`cosmos.authz.v1beta1`;function o(){return{granter:``,grantee:``,grant:void 0}}e.MsgGrant={encode(e,t=r.default.Writer.create()){return e.granter!==``&&t.uint32(10).string(e.granter),e.grantee!==``&&t.uint32(18).string(e.grantee),e.grant!==void 0&&i.Grant.encode(e.grant,t.uint32(26).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,s=o();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:s.granter=n.string();break;case 2:s.grantee=n.string();break;case 3:s.grant=i.Grant.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{granter:y(e.granter)?String(e.granter):``,grantee:y(e.grantee)?String(e.grantee):``,grant:y(e.grant)?i.Grant.fromJSON(e.grant):void 0}},toJSON(e){let t={};return e.granter!==void 0&&(t.granter=e.granter),e.grantee!==void 0&&(t.grantee=e.grantee),e.grant!==void 0&&(t.grant=e.grant?i.Grant.toJSON(e.grant):void 0),t},fromPartial(e){let t=o();return t.granter=e.granter??``,t.grantee=e.grantee??``,t.grant=e.grant!==void 0&&e.grant!==null?i.Grant.fromPartial(e.grant):void 0,t}};function s(){return{results:[]}}e.MsgExecResponse={encode(e,t=r.default.Writer.create()){for(let n of e.results)t.uint32(10).bytes(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.results.push(n.bytes());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{results:Array.isArray(e?.results)?e.results.map(e=>g(e)):[]}},toJSON(e){let t={};return e.results?t.results=e.results.map(e=>v(e===void 0?new Uint8Array:e)):t.results=[],t},fromPartial(e){let t=s();return t.results=e.results?.map(e=>e)||[],t}};function c(){return{grantee:``,msgs:[]}}e.MsgExec={encode(e,t=r.default.Writer.create()){e.grantee!==``&&t.uint32(10).string(e.grantee);for(let n of e.msgs)a.Any.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.grantee=n.string();break;case 2:o.msgs.push(a.Any.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{grantee:y(e.grantee)?String(e.grantee):``,msgs:Array.isArray(e?.msgs)?e.msgs.map(e=>a.Any.fromJSON(e)):[]}},toJSON(e){let t={};return e.grantee!==void 0&&(t.grantee=e.grantee),e.msgs?t.msgs=e.msgs.map(e=>e?a.Any.toJSON(e):void 0):t.msgs=[],t},fromPartial(e){let t=c();return t.grantee=e.grantee??``,t.msgs=e.msgs?.map(e=>a.Any.fromPartial(e))||[],t}};function l(){return{}}e.MsgGrantResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return l()}};function u(){return{granter:``,grantee:``,msgTypeUrl:``}}e.MsgRevoke={encode(e,t=r.default.Writer.create()){return e.granter!==``&&t.uint32(10).string(e.granter),e.grantee!==``&&t.uint32(18).string(e.grantee),e.msgTypeUrl!==``&&t.uint32(26).string(e.msgTypeUrl),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.granter=n.string();break;case 2:a.grantee=n.string();break;case 3:a.msgTypeUrl=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{granter:y(e.granter)?String(e.granter):``,grantee:y(e.grantee)?String(e.grantee):``,msgTypeUrl:y(e.msgTypeUrl)?String(e.msgTypeUrl):``}},toJSON(e){let t={};return e.granter!==void 0&&(t.granter=e.granter),e.grantee!==void 0&&(t.grantee=e.grantee),e.msgTypeUrl!==void 0&&(t.msgTypeUrl=e.msgTypeUrl),t},fromPartial(e){let t=u();return t.granter=e.granter??``,t.grantee=e.grantee??``,t.msgTypeUrl=e.msgTypeUrl??``,t}};function d(){return{}}e.MsgRevokeResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return d()}};var f=(()=>{if(f!==void 0)return f;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),p=f.atob||(e=>f.Buffer.from(e,`base64`).toString(`binary`));function g(e){let t=p(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var _=f.btoa||(e=>f.Buffer.from(e,`binary`).toString(`base64`));function v(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return _(t.join(``))}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function y(e){return e!=null}})),sc=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.TallyParams=e.VotingParams=e.DepositParams=e.Vote=e.TallyResult=e.Proposal=e.Deposit=e.TextProposal=e.WeightedVoteOption=e.proposalStatusToJSON=e.proposalStatusFromJSON=e.ProposalStatus=e.voteOptionToJSON=e.voteOptionFromJSON=e.VoteOption=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=Ys(),a=Ks(),o=tc(),s=nc();e.protobufPackage=`cosmos.gov.v1beta1`;var c;(function(e){e[e.VOTE_OPTION_UNSPECIFIED=0]=`VOTE_OPTION_UNSPECIFIED`,e[e.VOTE_OPTION_YES=1]=`VOTE_OPTION_YES`,e[e.VOTE_OPTION_ABSTAIN=2]=`VOTE_OPTION_ABSTAIN`,e[e.VOTE_OPTION_NO=3]=`VOTE_OPTION_NO`,e[e.VOTE_OPTION_NO_WITH_VETO=4]=`VOTE_OPTION_NO_WITH_VETO`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(c=e.VoteOption||={});function l(e){switch(e){case 0:case`VOTE_OPTION_UNSPECIFIED`:return c.VOTE_OPTION_UNSPECIFIED;case 1:case`VOTE_OPTION_YES`:return c.VOTE_OPTION_YES;case 2:case`VOTE_OPTION_ABSTAIN`:return c.VOTE_OPTION_ABSTAIN;case 3:case`VOTE_OPTION_NO`:return c.VOTE_OPTION_NO;case 4:case`VOTE_OPTION_NO_WITH_VETO`:return c.VOTE_OPTION_NO_WITH_VETO;default:return c.UNRECOGNIZED}}e.voteOptionFromJSON=l;function u(e){switch(e){case c.VOTE_OPTION_UNSPECIFIED:return`VOTE_OPTION_UNSPECIFIED`;case c.VOTE_OPTION_YES:return`VOTE_OPTION_YES`;case c.VOTE_OPTION_ABSTAIN:return`VOTE_OPTION_ABSTAIN`;case c.VOTE_OPTION_NO:return`VOTE_OPTION_NO`;case c.VOTE_OPTION_NO_WITH_VETO:return`VOTE_OPTION_NO_WITH_VETO`;default:return`UNKNOWN`}}e.voteOptionToJSON=u;var d;(function(e){e[e.PROPOSAL_STATUS_UNSPECIFIED=0]=`PROPOSAL_STATUS_UNSPECIFIED`,e[e.PROPOSAL_STATUS_DEPOSIT_PERIOD=1]=`PROPOSAL_STATUS_DEPOSIT_PERIOD`,e[e.PROPOSAL_STATUS_VOTING_PERIOD=2]=`PROPOSAL_STATUS_VOTING_PERIOD`,e[e.PROPOSAL_STATUS_PASSED=3]=`PROPOSAL_STATUS_PASSED`,e[e.PROPOSAL_STATUS_REJECTED=4]=`PROPOSAL_STATUS_REJECTED`,e[e.PROPOSAL_STATUS_FAILED=5]=`PROPOSAL_STATUS_FAILED`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(d=e.ProposalStatus||={});function f(e){switch(e){case 0:case`PROPOSAL_STATUS_UNSPECIFIED`:return d.PROPOSAL_STATUS_UNSPECIFIED;case 1:case`PROPOSAL_STATUS_DEPOSIT_PERIOD`:return d.PROPOSAL_STATUS_DEPOSIT_PERIOD;case 2:case`PROPOSAL_STATUS_VOTING_PERIOD`:return d.PROPOSAL_STATUS_VOTING_PERIOD;case 3:case`PROPOSAL_STATUS_PASSED`:return d.PROPOSAL_STATUS_PASSED;case 4:case`PROPOSAL_STATUS_REJECTED`:return d.PROPOSAL_STATUS_REJECTED;case 5:case`PROPOSAL_STATUS_FAILED`:return d.PROPOSAL_STATUS_FAILED;default:return d.UNRECOGNIZED}}e.proposalStatusFromJSON=f;function p(e){switch(e){case d.PROPOSAL_STATUS_UNSPECIFIED:return`PROPOSAL_STATUS_UNSPECIFIED`;case d.PROPOSAL_STATUS_DEPOSIT_PERIOD:return`PROPOSAL_STATUS_DEPOSIT_PERIOD`;case d.PROPOSAL_STATUS_VOTING_PERIOD:return`PROPOSAL_STATUS_VOTING_PERIOD`;case d.PROPOSAL_STATUS_PASSED:return`PROPOSAL_STATUS_PASSED`;case d.PROPOSAL_STATUS_REJECTED:return`PROPOSAL_STATUS_REJECTED`;case d.PROPOSAL_STATUS_FAILED:return`PROPOSAL_STATUS_FAILED`;default:return`UNKNOWN`}}e.proposalStatusToJSON=p;function g(){return{option:0,weight:``}}e.WeightedVoteOption={encode(e,t=r.default.Writer.create()){return e.option!==0&&t.uint32(8).int32(e.option),e.weight!==``&&t.uint32(18).string(e.weight),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=g();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.option=n.int32();break;case 2:a.weight=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{option:P(e.option)?l(e.option):0,weight:P(e.weight)?String(e.weight):``}},toJSON(e){let t={};return e.option!==void 0&&(t.option=u(e.option)),e.weight!==void 0&&(t.weight=e.weight),t},fromPartial(e){let t=g();return t.option=e.option??0,t.weight=e.weight??``,t}};function _(){return{title:``,description:``}}e.TextProposal={encode(e,t=r.default.Writer.create()){return e.title!==``&&t.uint32(10).string(e.title),e.description!==``&&t.uint32(18).string(e.description),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=_();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.title=n.string();break;case 2:a.description=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{title:P(e.title)?String(e.title):``,description:P(e.description)?String(e.description):``}},toJSON(e){let t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),t},fromPartial(e){let t=_();return t.title=e.title??``,t.description=e.description??``,t}};function v(){return{proposalId:`0`,depositor:``,amount:[]}}e.Deposit={encode(e,t=r.default.Writer.create()){e.proposalId!==`0`&&t.uint32(8).uint64(e.proposalId),e.depositor!==``&&t.uint32(18).string(e.depositor);for(let n of e.amount)a.Coin.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=v();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.proposalId=N(n.uint64());break;case 2:o.depositor=n.string();break;case 3:o.amount.push(a.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{proposalId:P(e.proposalId)?String(e.proposalId):`0`,depositor:P(e.depositor)?String(e.depositor):``,amount:Array.isArray(e?.amount)?e.amount.map(e=>a.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.proposalId!==void 0&&(t.proposalId=e.proposalId),e.depositor!==void 0&&(t.depositor=e.depositor),e.amount?t.amount=e.amount.map(e=>e?a.Coin.toJSON(e):void 0):t.amount=[],t},fromPartial(e){let t=v();return t.proposalId=e.proposalId??`0`,t.depositor=e.depositor??``,t.amount=e.amount?.map(e=>a.Coin.fromPartial(e))||[],t}};function y(){return{proposalId:`0`,content:void 0,status:0,finalTallyResult:void 0,submitTime:void 0,depositEndTime:void 0,totalDeposit:[],votingStartTime:void 0,votingEndTime:void 0}}e.Proposal={encode(t,n=r.default.Writer.create()){t.proposalId!==`0`&&n.uint32(8).uint64(t.proposalId),t.content!==void 0&&o.Any.encode(t.content,n.uint32(18).fork()).ldelim(),t.status!==0&&n.uint32(24).int32(t.status),t.finalTallyResult!==void 0&&e.TallyResult.encode(t.finalTallyResult,n.uint32(34).fork()).ldelim(),t.submitTime!==void 0&&i.Timestamp.encode(A(t.submitTime),n.uint32(42).fork()).ldelim(),t.depositEndTime!==void 0&&i.Timestamp.encode(A(t.depositEndTime),n.uint32(50).fork()).ldelim();for(let e of t.totalDeposit)a.Coin.encode(e,n.uint32(58).fork()).ldelim();return t.votingStartTime!==void 0&&i.Timestamp.encode(A(t.votingStartTime),n.uint32(66).fork()).ldelim(),t.votingEndTime!==void 0&&i.Timestamp.encode(A(t.votingEndTime),n.uint32(74).fork()).ldelim(),n},decode(t,n){let s=t instanceof r.default.Reader?t:new r.default.Reader(t),c=n===void 0?s.len:s.pos+n,l=y();for(;s.pos<c;){let t=s.uint32();switch(t>>>3){case 1:l.proposalId=N(s.uint64());break;case 2:l.content=o.Any.decode(s,s.uint32());break;case 3:l.status=s.int32();break;case 4:l.finalTallyResult=e.TallyResult.decode(s,s.uint32());break;case 5:l.submitTime=j(i.Timestamp.decode(s,s.uint32()));break;case 6:l.depositEndTime=j(i.Timestamp.decode(s,s.uint32()));break;case 7:l.totalDeposit.push(a.Coin.decode(s,s.uint32()));break;case 8:l.votingStartTime=j(i.Timestamp.decode(s,s.uint32()));break;case 9:l.votingEndTime=j(i.Timestamp.decode(s,s.uint32()));break;default:s.skipType(t&7);break}}return l},fromJSON(t){return{proposalId:P(t.proposalId)?String(t.proposalId):`0`,content:P(t.content)?o.Any.fromJSON(t.content):void 0,status:P(t.status)?f(t.status):0,finalTallyResult:P(t.finalTallyResult)?e.TallyResult.fromJSON(t.finalTallyResult):void 0,submitTime:P(t.submitTime)?M(t.submitTime):void 0,depositEndTime:P(t.depositEndTime)?M(t.depositEndTime):void 0,totalDeposit:Array.isArray(t?.totalDeposit)?t.totalDeposit.map(e=>a.Coin.fromJSON(e)):[],votingStartTime:P(t.votingStartTime)?M(t.votingStartTime):void 0,votingEndTime:P(t.votingEndTime)?M(t.votingEndTime):void 0}},toJSON(t){let n={};return t.proposalId!==void 0&&(n.proposalId=t.proposalId),t.content!==void 0&&(n.content=t.content?o.Any.toJSON(t.content):void 0),t.status!==void 0&&(n.status=p(t.status)),t.finalTallyResult!==void 0&&(n.finalTallyResult=t.finalTallyResult?e.TallyResult.toJSON(t.finalTallyResult):void 0),t.submitTime!==void 0&&(n.submitTime=t.submitTime.toISOString()),t.depositEndTime!==void 0&&(n.depositEndTime=t.depositEndTime.toISOString()),t.totalDeposit?n.totalDeposit=t.totalDeposit.map(e=>e?a.Coin.toJSON(e):void 0):n.totalDeposit=[],t.votingStartTime!==void 0&&(n.votingStartTime=t.votingStartTime.toISOString()),t.votingEndTime!==void 0&&(n.votingEndTime=t.votingEndTime.toISOString()),n},fromPartial(t){let n=y();return n.proposalId=t.proposalId??`0`,n.content=t.content!==void 0&&t.content!==null?o.Any.fromPartial(t.content):void 0,n.status=t.status??0,n.finalTallyResult=t.finalTallyResult!==void 0&&t.finalTallyResult!==null?e.TallyResult.fromPartial(t.finalTallyResult):void 0,n.submitTime=t.submitTime??void 0,n.depositEndTime=t.depositEndTime??void 0,n.totalDeposit=t.totalDeposit?.map(e=>a.Coin.fromPartial(e))||[],n.votingStartTime=t.votingStartTime??void 0,n.votingEndTime=t.votingEndTime??void 0,n}};function b(){return{yes:``,abstain:``,no:``,noWithVeto:``}}e.TallyResult={encode(e,t=r.default.Writer.create()){return e.yes!==``&&t.uint32(10).string(e.yes),e.abstain!==``&&t.uint32(18).string(e.abstain),e.no!==``&&t.uint32(26).string(e.no),e.noWithVeto!==``&&t.uint32(34).string(e.noWithVeto),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=b();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.yes=n.string();break;case 2:a.abstain=n.string();break;case 3:a.no=n.string();break;case 4:a.noWithVeto=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{yes:P(e.yes)?String(e.yes):``,abstain:P(e.abstain)?String(e.abstain):``,no:P(e.no)?String(e.no):``,noWithVeto:P(e.noWithVeto)?String(e.noWithVeto):``}},toJSON(e){let t={};return e.yes!==void 0&&(t.yes=e.yes),e.abstain!==void 0&&(t.abstain=e.abstain),e.no!==void 0&&(t.no=e.no),e.noWithVeto!==void 0&&(t.noWithVeto=e.noWithVeto),t},fromPartial(e){let t=b();return t.yes=e.yes??``,t.abstain=e.abstain??``,t.no=e.no??``,t.noWithVeto=e.noWithVeto??``,t}};function x(){return{proposalId:`0`,voter:``,option:0,options:[]}}e.Vote={encode(t,n=r.default.Writer.create()){t.proposalId!==`0`&&n.uint32(8).uint64(t.proposalId),t.voter!==``&&n.uint32(18).string(t.voter),t.option!==0&&n.uint32(24).int32(t.option);for(let r of t.options)e.WeightedVoteOption.encode(r,n.uint32(34).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=x();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.proposalId=N(i.uint64());break;case 2:o.voter=i.string();break;case 3:o.option=i.int32();break;case 4:o.options.push(e.WeightedVoteOption.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{proposalId:P(t.proposalId)?String(t.proposalId):`0`,voter:P(t.voter)?String(t.voter):``,option:P(t.option)?l(t.option):0,options:Array.isArray(t?.options)?t.options.map(t=>e.WeightedVoteOption.fromJSON(t)):[]}},toJSON(t){let n={};return t.proposalId!==void 0&&(n.proposalId=t.proposalId),t.voter!==void 0&&(n.voter=t.voter),t.option!==void 0&&(n.option=u(t.option)),t.options?n.options=t.options.map(t=>t?e.WeightedVoteOption.toJSON(t):void 0):n.options=[],n},fromPartial(t){let n=x();return n.proposalId=t.proposalId??`0`,n.voter=t.voter??``,n.option=t.option??0,n.options=t.options?.map(t=>e.WeightedVoteOption.fromPartial(t))||[],n}};function S(){return{minDeposit:[],maxDepositPeriod:void 0}}e.DepositParams={encode(e,t=r.default.Writer.create()){for(let n of e.minDeposit)a.Coin.encode(n,t.uint32(10).fork()).ldelim();return e.maxDepositPeriod!==void 0&&s.Duration.encode(e.maxDepositPeriod,t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=S();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.minDeposit.push(a.Coin.decode(n,n.uint32()));break;case 2:o.maxDepositPeriod=s.Duration.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{minDeposit:Array.isArray(e?.minDeposit)?e.minDeposit.map(e=>a.Coin.fromJSON(e)):[],maxDepositPeriod:P(e.maxDepositPeriod)?s.Duration.fromJSON(e.maxDepositPeriod):void 0}},toJSON(e){let t={};return e.minDeposit?t.minDeposit=e.minDeposit.map(e=>e?a.Coin.toJSON(e):void 0):t.minDeposit=[],e.maxDepositPeriod!==void 0&&(t.maxDepositPeriod=e.maxDepositPeriod?s.Duration.toJSON(e.maxDepositPeriod):void 0),t},fromPartial(e){let t=S();return t.minDeposit=e.minDeposit?.map(e=>a.Coin.fromPartial(e))||[],t.maxDepositPeriod=e.maxDepositPeriod!==void 0&&e.maxDepositPeriod!==null?s.Duration.fromPartial(e.maxDepositPeriod):void 0,t}};function C(){return{votingPeriod:void 0}}e.VotingParams={encode(e,t=r.default.Writer.create()){return e.votingPeriod!==void 0&&s.Duration.encode(e.votingPeriod,t.uint32(10).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=C();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.votingPeriod=s.Duration.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{votingPeriod:P(e.votingPeriod)?s.Duration.fromJSON(e.votingPeriod):void 0}},toJSON(e){let t={};return e.votingPeriod!==void 0&&(t.votingPeriod=e.votingPeriod?s.Duration.toJSON(e.votingPeriod):void 0),t},fromPartial(e){let t=C();return t.votingPeriod=e.votingPeriod!==void 0&&e.votingPeriod!==null?s.Duration.fromPartial(e.votingPeriod):void 0,t}};function w(){return{quorum:new Uint8Array,threshold:new Uint8Array,vetoThreshold:new Uint8Array}}e.TallyParams={encode(e,t=r.default.Writer.create()){return e.quorum.length!==0&&t.uint32(10).bytes(e.quorum),e.threshold.length!==0&&t.uint32(18).bytes(e.threshold),e.vetoThreshold.length!==0&&t.uint32(26).bytes(e.vetoThreshold),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=w();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.quorum=n.bytes();break;case 2:a.threshold=n.bytes();break;case 3:a.vetoThreshold=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{quorum:P(e.quorum)?D(e.quorum):new Uint8Array,threshold:P(e.threshold)?D(e.threshold):new Uint8Array,vetoThreshold:P(e.vetoThreshold)?D(e.vetoThreshold):new Uint8Array}},toJSON(e){let t={};return e.quorum!==void 0&&(t.quorum=k(e.quorum===void 0?new Uint8Array:e.quorum)),e.threshold!==void 0&&(t.threshold=k(e.threshold===void 0?new Uint8Array:e.threshold)),e.vetoThreshold!==void 0&&(t.vetoThreshold=k(e.vetoThreshold===void 0?new Uint8Array:e.vetoThreshold)),t},fromPartial(e){let t=w();return t.quorum=e.quorum??new Uint8Array,t.threshold=e.threshold??new Uint8Array,t.vetoThreshold=e.vetoThreshold??new Uint8Array,t}};var T=(()=>{if(T!==void 0)return T;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),E=T.atob||(e=>T.Buffer.from(e,`base64`).toString(`binary`));function D(e){let t=E(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var O=T.btoa||(e=>T.Buffer.from(e,`binary`).toString(`base64`));function k(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return O(t.join(``))}function A(e){return{seconds:Math.trunc(e.getTime()/1e3).toString(),nanos:e.getTime()%1e3*1e6}}function j(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}function M(e){return e instanceof Date?e:typeof e==`string`?new Date(e):j(i.Timestamp.fromJSON(e))}function N(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function P(e){return e!=null}})),cc=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.MsgDepositResponse=e.MsgDeposit=e.MsgVoteWeightedResponse=e.MsgVoteWeighted=e.MsgVoteResponse=e.MsgVote=e.MsgSubmitProposalResponse=e.MsgSubmitProposal=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=sc(),a=tc(),o=Ks();e.protobufPackage=`cosmos.gov.v1beta1`;function s(){return{content:void 0,initialDeposit:[],proposer:``}}e.MsgSubmitProposal={encode(e,t=r.default.Writer.create()){e.content!==void 0&&a.Any.encode(e.content,t.uint32(10).fork()).ldelim();for(let n of e.initialDeposit)o.Coin.encode(n,t.uint32(18).fork()).ldelim();return e.proposer!==``&&t.uint32(26).string(e.proposer),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,c=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:c.content=a.Any.decode(n,n.uint32());break;case 2:c.initialDeposit.push(o.Coin.decode(n,n.uint32()));break;case 3:c.proposer=n.string();break;default:n.skipType(e&7);break}}return c},fromJSON(e){return{content:g(e.content)?a.Any.fromJSON(e.content):void 0,initialDeposit:Array.isArray(e?.initialDeposit)?e.initialDeposit.map(e=>o.Coin.fromJSON(e)):[],proposer:g(e.proposer)?String(e.proposer):``}},toJSON(e){let t={};return e.content!==void 0&&(t.content=e.content?a.Any.toJSON(e.content):void 0),e.initialDeposit?t.initialDeposit=e.initialDeposit.map(e=>e?o.Coin.toJSON(e):void 0):t.initialDeposit=[],e.proposer!==void 0&&(t.proposer=e.proposer),t},fromPartial(e){let t=s();return t.content=e.content!==void 0&&e.content!==null?a.Any.fromPartial(e.content):void 0,t.initialDeposit=e.initialDeposit?.map(e=>o.Coin.fromPartial(e))||[],t.proposer=e.proposer??``,t}};function c(){return{proposalId:`0`}}e.MsgSubmitProposalResponse={encode(e,t=r.default.Writer.create()){return e.proposalId!==`0`&&t.uint32(8).uint64(e.proposalId),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.proposalId=h(n.uint64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{proposalId:g(e.proposalId)?String(e.proposalId):`0`}},toJSON(e){let t={};return e.proposalId!==void 0&&(t.proposalId=e.proposalId),t},fromPartial(e){let t=c();return t.proposalId=e.proposalId??`0`,t}};function l(){return{proposalId:`0`,voter:``,option:0}}e.MsgVote={encode(e,t=r.default.Writer.create()){return e.proposalId!==`0`&&t.uint32(8).uint64(e.proposalId),e.voter!==``&&t.uint32(18).string(e.voter),e.option!==0&&t.uint32(24).int32(e.option),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.proposalId=h(n.uint64());break;case 2:a.voter=n.string();break;case 3:a.option=n.int32();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{proposalId:g(e.proposalId)?String(e.proposalId):`0`,voter:g(e.voter)?String(e.voter):``,option:g(e.option)?(0,i.voteOptionFromJSON)(e.option):0}},toJSON(e){let t={};return e.proposalId!==void 0&&(t.proposalId=e.proposalId),e.voter!==void 0&&(t.voter=e.voter),e.option!==void 0&&(t.option=(0,i.voteOptionToJSON)(e.option)),t},fromPartial(e){let t=l();return t.proposalId=e.proposalId??`0`,t.voter=e.voter??``,t.option=e.option??0,t}};function u(){return{}}e.MsgVoteResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return u()}};function d(){return{proposalId:`0`,voter:``,options:[]}}e.MsgVoteWeighted={encode(e,t=r.default.Writer.create()){e.proposalId!==`0`&&t.uint32(8).uint64(e.proposalId),e.voter!==``&&t.uint32(18).string(e.voter);for(let n of e.options)i.WeightedVoteOption.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=d();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.proposalId=h(n.uint64());break;case 2:o.voter=n.string();break;case 3:o.options.push(i.WeightedVoteOption.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{proposalId:g(e.proposalId)?String(e.proposalId):`0`,voter:g(e.voter)?String(e.voter):``,options:Array.isArray(e?.options)?e.options.map(e=>i.WeightedVoteOption.fromJSON(e)):[]}},toJSON(e){let t={};return e.proposalId!==void 0&&(t.proposalId=e.proposalId),e.voter!==void 0&&(t.voter=e.voter),e.options?t.options=e.options.map(e=>e?i.WeightedVoteOption.toJSON(e):void 0):t.options=[],t},fromPartial(e){let t=d();return t.proposalId=e.proposalId??`0`,t.voter=e.voter??``,t.options=e.options?.map(e=>i.WeightedVoteOption.fromPartial(e))||[],t}};function f(){return{}}e.MsgVoteWeightedResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return f()}};function p(){return{proposalId:`0`,depositor:``,amount:[]}}e.MsgDeposit={encode(e,t=r.default.Writer.create()){e.proposalId!==`0`&&t.uint32(8).uint64(e.proposalId),e.depositor!==``&&t.uint32(18).string(e.depositor);for(let n of e.amount)o.Coin.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=p();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.proposalId=h(n.uint64());break;case 2:a.depositor=n.string();break;case 3:a.amount.push(o.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{proposalId:g(e.proposalId)?String(e.proposalId):`0`,depositor:g(e.depositor)?String(e.depositor):``,amount:Array.isArray(e?.amount)?e.amount.map(e=>o.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.proposalId!==void 0&&(t.proposalId=e.proposalId),e.depositor!==void 0&&(t.depositor=e.depositor),e.amount?t.amount=e.amount.map(e=>e?o.Coin.toJSON(e):void 0):t.amount=[],t},fromPartial(e){let t=p();return t.proposalId=e.proposalId??`0`,t.depositor=e.depositor??``,t.amount=e.amount?.map(e=>o.Coin.fromPartial(e))||[],t}};function m(){return{}}e.MsgDepositResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=m();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return m()}};function h(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function g(e){return e!=null}})),lc=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.MsgFundCommunityPoolResponse=e.MsgFundCommunityPool=e.MsgWithdrawValidatorCommissionResponse=e.MsgWithdrawValidatorCommission=e.MsgWithdrawDelegatorRewardResponse=e.MsgWithdrawDelegatorReward=e.MsgSetWithdrawAddressResponse=e.MsgSetWithdrawAddress=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=Ks();e.protobufPackage=`cosmos.distribution.v1beta1`;function a(){return{delegatorAddress:``,withdrawAddress:``}}e.MsgSetWithdrawAddress={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.withdrawAddress!==``&&t.uint32(18).string(e.withdrawAddress),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=a();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.delegatorAddress=n.string();break;case 2:o.withdrawAddress=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{delegatorAddress:p(e.delegatorAddress)?String(e.delegatorAddress):``,withdrawAddress:p(e.withdrawAddress)?String(e.withdrawAddress):``}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.withdrawAddress!==void 0&&(t.withdrawAddress=e.withdrawAddress),t},fromPartial(e){let t=a();return t.delegatorAddress=e.delegatorAddress??``,t.withdrawAddress=e.withdrawAddress??``,t}};function o(){return{}}e.MsgSetWithdrawAddressResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=o();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return o()}};function s(){return{delegatorAddress:``,validatorAddress:``}}e.MsgWithdrawDelegatorReward={encode(e,t=r.default.Writer.create()){return e.delegatorAddress!==``&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==``&&t.uint32(18).string(e.validatorAddress),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.delegatorAddress=n.string();break;case 2:a.validatorAddress=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{delegatorAddress:p(e.delegatorAddress)?String(e.delegatorAddress):``,validatorAddress:p(e.validatorAddress)?String(e.validatorAddress):``}},toJSON(e){let t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),t},fromPartial(e){let t=s();return t.delegatorAddress=e.delegatorAddress??``,t.validatorAddress=e.validatorAddress??``,t}};function c(){return{}}e.MsgWithdrawDelegatorRewardResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return c()}};function l(){return{validatorAddress:``}}e.MsgWithdrawValidatorCommission={encode(e,t=r.default.Writer.create()){return e.validatorAddress!==``&&t.uint32(10).string(e.validatorAddress),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.validatorAddress=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{validatorAddress:p(e.validatorAddress)?String(e.validatorAddress):``}},toJSON(e){let t={};return e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),t},fromPartial(e){let t=l();return t.validatorAddress=e.validatorAddress??``,t}};function u(){return{}}e.MsgWithdrawValidatorCommissionResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return u()}};function d(){return{amount:[],depositor:``}}e.MsgFundCommunityPool={encode(e,t=r.default.Writer.create()){for(let n of e.amount)i.Coin.encode(n,t.uint32(10).fork()).ldelim();return e.depositor!==``&&t.uint32(18).string(e.depositor),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=d();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.amount.push(i.Coin.decode(n,n.uint32()));break;case 2:o.depositor=n.string();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{amount:Array.isArray(e?.amount)?e.amount.map(e=>i.Coin.fromJSON(e)):[],depositor:p(e.depositor)?String(e.depositor):``}},toJSON(e){let t={};return e.amount?t.amount=e.amount.map(e=>e?i.Coin.toJSON(e):void 0):t.amount=[],e.depositor!==void 0&&(t.depositor=e.depositor),t},fromPartial(e){let t=d();return t.amount=e.amount?.map(e=>i.Coin.fromPartial(e))||[],t.depositor=e.depositor??``,t}};function f(){return{}}e.MsgFundCommunityPoolResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return f()}},r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function p(e){return e!=null}})),uc=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Model=e.AbsoluteTxPosition=e.ContractCodeHistoryEntry=e.ContractInfo=e.CodeInfo=e.Params=e.AccessConfig=e.AccessTypeParam=e.contractCodeHistoryOperationTypeToJSON=e.contractCodeHistoryOperationTypeFromJSON=e.ContractCodeHistoryOperationType=e.accessTypeToJSON=e.accessTypeFromJSON=e.AccessType=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=tc();e.protobufPackage=`cosmwasm.wasm.v1`;var a;(function(e){e[e.ACCESS_TYPE_UNSPECIFIED=0]=`ACCESS_TYPE_UNSPECIFIED`,e[e.ACCESS_TYPE_NOBODY=1]=`ACCESS_TYPE_NOBODY`,e[e.ACCESS_TYPE_ONLY_ADDRESS=2]=`ACCESS_TYPE_ONLY_ADDRESS`,e[e.ACCESS_TYPE_EVERYBODY=3]=`ACCESS_TYPE_EVERYBODY`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(a=e.AccessType||={});function o(e){switch(e){case 0:case`ACCESS_TYPE_UNSPECIFIED`:return a.ACCESS_TYPE_UNSPECIFIED;case 1:case`ACCESS_TYPE_NOBODY`:return a.ACCESS_TYPE_NOBODY;case 2:case`ACCESS_TYPE_ONLY_ADDRESS`:return a.ACCESS_TYPE_ONLY_ADDRESS;case 3:case`ACCESS_TYPE_EVERYBODY`:return a.ACCESS_TYPE_EVERYBODY;default:return a.UNRECOGNIZED}}e.accessTypeFromJSON=o;function s(e){switch(e){case a.ACCESS_TYPE_UNSPECIFIED:return`ACCESS_TYPE_UNSPECIFIED`;case a.ACCESS_TYPE_NOBODY:return`ACCESS_TYPE_NOBODY`;case a.ACCESS_TYPE_ONLY_ADDRESS:return`ACCESS_TYPE_ONLY_ADDRESS`;case a.ACCESS_TYPE_EVERYBODY:return`ACCESS_TYPE_EVERYBODY`;default:return`UNKNOWN`}}e.accessTypeToJSON=s;var c;(function(e){e[e.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED=0]=`CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED`,e[e.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT=1]=`CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT`,e[e.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE=2]=`CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE`,e[e.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS=3]=`CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(c=e.ContractCodeHistoryOperationType||={});function l(e){switch(e){case 0:case`CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED`:return c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED;case 1:case`CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT`:return c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT;case 2:case`CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE`:return c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE;case 3:case`CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS`:return c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS;default:return c.UNRECOGNIZED}}e.contractCodeHistoryOperationTypeFromJSON=l;function u(e){switch(e){case c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED:return`CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED`;case c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT:return`CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT`;case c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE:return`CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE`;case c.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS:return`CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS`;default:return`UNKNOWN`}}e.contractCodeHistoryOperationTypeToJSON=u;function d(){return{value:0}}e.AccessTypeParam={encode(e,t=r.default.Writer.create()){return e.value!==0&&t.uint32(8).int32(e.value),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.value=n.int32();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{value:D(e.value)?o(e.value):0}},toJSON(e){let t={};return e.value!==void 0&&(t.value=s(e.value)),t},fromPartial(e){let t=d();return t.value=e.value??0,t}};function f(){return{permission:0,address:``}}e.AccessConfig={encode(e,t=r.default.Writer.create()){return e.permission!==0&&t.uint32(8).int32(e.permission),e.address!==``&&t.uint32(18).string(e.address),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.permission=n.int32();break;case 2:a.address=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{permission:D(e.permission)?o(e.permission):0,address:D(e.address)?String(e.address):``}},toJSON(e){let t={};return e.permission!==void 0&&(t.permission=s(e.permission)),e.address!==void 0&&(t.address=e.address),t},fromPartial(e){let t=f();return t.permission=e.permission??0,t.address=e.address??``,t}};function p(){return{codeUploadAccess:void 0,instantiateDefaultPermission:0,maxWasmCodeSize:`0`}}e.Params={encode(t,n=r.default.Writer.create()){return t.codeUploadAccess!==void 0&&e.AccessConfig.encode(t.codeUploadAccess,n.uint32(10).fork()).ldelim(),t.instantiateDefaultPermission!==0&&n.uint32(16).int32(t.instantiateDefaultPermission),t.maxWasmCodeSize!==`0`&&n.uint32(24).uint64(t.maxWasmCodeSize),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=p();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.codeUploadAccess=e.AccessConfig.decode(i,i.uint32());break;case 2:o.instantiateDefaultPermission=i.int32();break;case 3:o.maxWasmCodeSize=E(i.uint64());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{codeUploadAccess:D(t.codeUploadAccess)?e.AccessConfig.fromJSON(t.codeUploadAccess):void 0,instantiateDefaultPermission:D(t.instantiateDefaultPermission)?o(t.instantiateDefaultPermission):0,maxWasmCodeSize:D(t.maxWasmCodeSize)?String(t.maxWasmCodeSize):`0`}},toJSON(t){let n={};return t.codeUploadAccess!==void 0&&(n.codeUploadAccess=t.codeUploadAccess?e.AccessConfig.toJSON(t.codeUploadAccess):void 0),t.instantiateDefaultPermission!==void 0&&(n.instantiateDefaultPermission=s(t.instantiateDefaultPermission)),t.maxWasmCodeSize!==void 0&&(n.maxWasmCodeSize=t.maxWasmCodeSize),n},fromPartial(t){let n=p();return n.codeUploadAccess=t.codeUploadAccess!==void 0&&t.codeUploadAccess!==null?e.AccessConfig.fromPartial(t.codeUploadAccess):void 0,n.instantiateDefaultPermission=t.instantiateDefaultPermission??0,n.maxWasmCodeSize=t.maxWasmCodeSize??`0`,n}};function g(){return{codeHash:new Uint8Array,creator:``,instantiateConfig:void 0}}e.CodeInfo={encode(t,n=r.default.Writer.create()){return t.codeHash.length!==0&&n.uint32(10).bytes(t.codeHash),t.creator!==``&&n.uint32(18).string(t.creator),t.instantiateConfig!==void 0&&e.AccessConfig.encode(t.instantiateConfig,n.uint32(42).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=g();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.codeHash=i.bytes();break;case 2:o.creator=i.string();break;case 5:o.instantiateConfig=e.AccessConfig.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{codeHash:D(t.codeHash)?C(t.codeHash):new Uint8Array,creator:D(t.creator)?String(t.creator):``,instantiateConfig:D(t.instantiateConfig)?e.AccessConfig.fromJSON(t.instantiateConfig):void 0}},toJSON(t){let n={};return t.codeHash!==void 0&&(n.codeHash=T(t.codeHash===void 0?new Uint8Array:t.codeHash)),t.creator!==void 0&&(n.creator=t.creator),t.instantiateConfig!==void 0&&(n.instantiateConfig=t.instantiateConfig?e.AccessConfig.toJSON(t.instantiateConfig):void 0),n},fromPartial(t){let n=g();return n.codeHash=t.codeHash??new Uint8Array,n.creator=t.creator??``,n.instantiateConfig=t.instantiateConfig!==void 0&&t.instantiateConfig!==null?e.AccessConfig.fromPartial(t.instantiateConfig):void 0,n}};function _(){return{codeId:`0`,creator:``,admin:``,label:``,created:void 0,ibcPortId:``,extension:void 0}}e.ContractInfo={encode(t,n=r.default.Writer.create()){return t.codeId!==`0`&&n.uint32(8).uint64(t.codeId),t.creator!==``&&n.uint32(18).string(t.creator),t.admin!==``&&n.uint32(26).string(t.admin),t.label!==``&&n.uint32(34).string(t.label),t.created!==void 0&&e.AbsoluteTxPosition.encode(t.created,n.uint32(42).fork()).ldelim(),t.ibcPortId!==``&&n.uint32(50).string(t.ibcPortId),t.extension!==void 0&&i.Any.encode(t.extension,n.uint32(58).fork()).ldelim(),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,s=_();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.codeId=E(a.uint64());break;case 2:s.creator=a.string();break;case 3:s.admin=a.string();break;case 4:s.label=a.string();break;case 5:s.created=e.AbsoluteTxPosition.decode(a,a.uint32());break;case 6:s.ibcPortId=a.string();break;case 7:s.extension=i.Any.decode(a,a.uint32());break;default:a.skipType(t&7);break}}return s},fromJSON(t){return{codeId:D(t.codeId)?String(t.codeId):`0`,creator:D(t.creator)?String(t.creator):``,admin:D(t.admin)?String(t.admin):``,label:D(t.label)?String(t.label):``,created:D(t.created)?e.AbsoluteTxPosition.fromJSON(t.created):void 0,ibcPortId:D(t.ibcPortId)?String(t.ibcPortId):``,extension:D(t.extension)?i.Any.fromJSON(t.extension):void 0}},toJSON(t){let n={};return t.codeId!==void 0&&(n.codeId=t.codeId),t.creator!==void 0&&(n.creator=t.creator),t.admin!==void 0&&(n.admin=t.admin),t.label!==void 0&&(n.label=t.label),t.created!==void 0&&(n.created=t.created?e.AbsoluteTxPosition.toJSON(t.created):void 0),t.ibcPortId!==void 0&&(n.ibcPortId=t.ibcPortId),t.extension!==void 0&&(n.extension=t.extension?i.Any.toJSON(t.extension):void 0),n},fromPartial(t){let n=_();return n.codeId=t.codeId??`0`,n.creator=t.creator??``,n.admin=t.admin??``,n.label=t.label??``,n.created=t.created!==void 0&&t.created!==null?e.AbsoluteTxPosition.fromPartial(t.created):void 0,n.ibcPortId=t.ibcPortId??``,n.extension=t.extension!==void 0&&t.extension!==null?i.Any.fromPartial(t.extension):void 0,n}};function v(){return{operation:0,codeId:`0`,updated:void 0,msg:new Uint8Array}}e.ContractCodeHistoryEntry={encode(t,n=r.default.Writer.create()){return t.operation!==0&&n.uint32(8).int32(t.operation),t.codeId!==`0`&&n.uint32(16).uint64(t.codeId),t.updated!==void 0&&e.AbsoluteTxPosition.encode(t.updated,n.uint32(26).fork()).ldelim(),t.msg.length!==0&&n.uint32(34).bytes(t.msg),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=v();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.operation=i.int32();break;case 2:o.codeId=E(i.uint64());break;case 3:o.updated=e.AbsoluteTxPosition.decode(i,i.uint32());break;case 4:o.msg=i.bytes();break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{operation:D(t.operation)?l(t.operation):0,codeId:D(t.codeId)?String(t.codeId):`0`,updated:D(t.updated)?e.AbsoluteTxPosition.fromJSON(t.updated):void 0,msg:D(t.msg)?C(t.msg):new Uint8Array}},toJSON(t){let n={};return t.operation!==void 0&&(n.operation=u(t.operation)),t.codeId!==void 0&&(n.codeId=t.codeId),t.updated!==void 0&&(n.updated=t.updated?e.AbsoluteTxPosition.toJSON(t.updated):void 0),t.msg!==void 0&&(n.msg=T(t.msg===void 0?new Uint8Array:t.msg)),n},fromPartial(t){let n=v();return n.operation=t.operation??0,n.codeId=t.codeId??`0`,n.updated=t.updated!==void 0&&t.updated!==null?e.AbsoluteTxPosition.fromPartial(t.updated):void 0,n.msg=t.msg??new Uint8Array,n}};function y(){return{blockHeight:`0`,txIndex:`0`}}e.AbsoluteTxPosition={encode(e,t=r.default.Writer.create()){return e.blockHeight!==`0`&&t.uint32(8).uint64(e.blockHeight),e.txIndex!==`0`&&t.uint32(16).uint64(e.txIndex),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=y();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.blockHeight=E(n.uint64());break;case 2:a.txIndex=E(n.uint64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{blockHeight:D(e.blockHeight)?String(e.blockHeight):`0`,txIndex:D(e.txIndex)?String(e.txIndex):`0`}},toJSON(e){let t={};return e.blockHeight!==void 0&&(t.blockHeight=e.blockHeight),e.txIndex!==void 0&&(t.txIndex=e.txIndex),t},fromPartial(e){let t=y();return t.blockHeight=e.blockHeight??`0`,t.txIndex=e.txIndex??`0`,t}};function b(){return{key:new Uint8Array,value:new Uint8Array}}e.Model={encode(e,t=r.default.Writer.create()){return e.key.length!==0&&t.uint32(10).bytes(e.key),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=b();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.key=n.bytes();break;case 2:a.value=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{key:D(e.key)?C(e.key):new Uint8Array,value:D(e.value)?C(e.value):new Uint8Array}},toJSON(e){let t={};return e.key!==void 0&&(t.key=T(e.key===void 0?new Uint8Array:e.key)),e.value!==void 0&&(t.value=T(e.value===void 0?new Uint8Array:e.value)),t},fromPartial(e){let t=b();return t.key=e.key??new Uint8Array,t.value=e.value??new Uint8Array,t}};var x=(()=>{if(x!==void 0)return x;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),S=x.atob||(e=>x.Buffer.from(e,`base64`).toString(`binary`));function C(e){let t=S(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var w=x.btoa||(e=>x.Buffer.from(e,`binary`).toString(`base64`));function T(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return w(t.join(``))}function E(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function D(e){return e!=null}})),dc=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.MsgClearAdminResponse=e.MsgClearAdmin=e.MsgUpdateAdminResponse=e.MsgUpdateAdmin=e.MsgMigrateContractResponse=e.MsgMigrateContract=e.MsgExecuteContractResponse=e.MsgExecuteContract=e.MsgInstantiateContractResponse=e.MsgInstantiateContract=e.MsgStoreCodeResponse=e.MsgStoreCode=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=uc(),a=Ks();e.protobufPackage=`cosmwasm.wasm.v1`;function o(){return{sender:``,wasmByteCode:new Uint8Array,instantiatePermission:void 0}}e.MsgStoreCode={encode(e,t=r.default.Writer.create()){return e.sender!==``&&t.uint32(10).string(e.sender),e.wasmByteCode.length!==0&&t.uint32(18).bytes(e.wasmByteCode),e.instantiatePermission!==void 0&&i.AccessConfig.encode(e.instantiatePermission,t.uint32(42).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,s=o();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:s.sender=n.string();break;case 2:s.wasmByteCode=n.bytes();break;case 5:s.instantiatePermission=i.AccessConfig.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{sender:E(e.sender)?String(e.sender):``,wasmByteCode:E(e.wasmByteCode)?S(e.wasmByteCode):new Uint8Array,instantiatePermission:E(e.instantiatePermission)?i.AccessConfig.fromJSON(e.instantiatePermission):void 0}},toJSON(e){let t={};return e.sender!==void 0&&(t.sender=e.sender),e.wasmByteCode!==void 0&&(t.wasmByteCode=w(e.wasmByteCode===void 0?new Uint8Array:e.wasmByteCode)),e.instantiatePermission!==void 0&&(t.instantiatePermission=e.instantiatePermission?i.AccessConfig.toJSON(e.instantiatePermission):void 0),t},fromPartial(e){let t=o();return t.sender=e.sender??``,t.wasmByteCode=e.wasmByteCode??new Uint8Array,t.instantiatePermission=e.instantiatePermission!==void 0&&e.instantiatePermission!==null?i.AccessConfig.fromPartial(e.instantiatePermission):void 0,t}};function s(){return{codeId:`0`}}e.MsgStoreCodeResponse={encode(e,t=r.default.Writer.create()){return e.codeId!==`0`&&t.uint32(8).uint64(e.codeId),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.codeId=T(n.uint64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{codeId:E(e.codeId)?String(e.codeId):`0`}},toJSON(e){let t={};return e.codeId!==void 0&&(t.codeId=e.codeId),t},fromPartial(e){let t=s();return t.codeId=e.codeId??`0`,t}};function c(){return{sender:``,admin:``,codeId:`0`,label:``,msg:new Uint8Array,funds:[]}}e.MsgInstantiateContract={encode(e,t=r.default.Writer.create()){e.sender!==``&&t.uint32(10).string(e.sender),e.admin!==``&&t.uint32(18).string(e.admin),e.codeId!==`0`&&t.uint32(24).uint64(e.codeId),e.label!==``&&t.uint32(34).string(e.label),e.msg.length!==0&&t.uint32(42).bytes(e.msg);for(let n of e.funds)a.Coin.encode(n,t.uint32(50).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.sender=n.string();break;case 2:o.admin=n.string();break;case 3:o.codeId=T(n.uint64());break;case 4:o.label=n.string();break;case 5:o.msg=n.bytes();break;case 6:o.funds.push(a.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{sender:E(e.sender)?String(e.sender):``,admin:E(e.admin)?String(e.admin):``,codeId:E(e.codeId)?String(e.codeId):`0`,label:E(e.label)?String(e.label):``,msg:E(e.msg)?S(e.msg):new Uint8Array,funds:Array.isArray(e?.funds)?e.funds.map(e=>a.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.sender!==void 0&&(t.sender=e.sender),e.admin!==void 0&&(t.admin=e.admin),e.codeId!==void 0&&(t.codeId=e.codeId),e.label!==void 0&&(t.label=e.label),e.msg!==void 0&&(t.msg=w(e.msg===void 0?new Uint8Array:e.msg)),e.funds?t.funds=e.funds.map(e=>e?a.Coin.toJSON(e):void 0):t.funds=[],t},fromPartial(e){let t=c();return t.sender=e.sender??``,t.admin=e.admin??``,t.codeId=e.codeId??`0`,t.label=e.label??``,t.msg=e.msg??new Uint8Array,t.funds=e.funds?.map(e=>a.Coin.fromPartial(e))||[],t}};function l(){return{address:``,data:new Uint8Array}}e.MsgInstantiateContractResponse={encode(e,t=r.default.Writer.create()){return e.address!==``&&t.uint32(10).string(e.address),e.data.length!==0&&t.uint32(18).bytes(e.data),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.address=n.string();break;case 2:a.data=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{address:E(e.address)?String(e.address):``,data:E(e.data)?S(e.data):new Uint8Array}},toJSON(e){let t={};return e.address!==void 0&&(t.address=e.address),e.data!==void 0&&(t.data=w(e.data===void 0?new Uint8Array:e.data)),t},fromPartial(e){let t=l();return t.address=e.address??``,t.data=e.data??new Uint8Array,t}};function u(){return{sender:``,contract:``,msg:new Uint8Array,funds:[]}}e.MsgExecuteContract={encode(e,t=r.default.Writer.create()){e.sender!==``&&t.uint32(10).string(e.sender),e.contract!==``&&t.uint32(18).string(e.contract),e.msg.length!==0&&t.uint32(26).bytes(e.msg);for(let n of e.funds)a.Coin.encode(n,t.uint32(42).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.sender=n.string();break;case 2:o.contract=n.string();break;case 3:o.msg=n.bytes();break;case 5:o.funds.push(a.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{sender:E(e.sender)?String(e.sender):``,contract:E(e.contract)?String(e.contract):``,msg:E(e.msg)?S(e.msg):new Uint8Array,funds:Array.isArray(e?.funds)?e.funds.map(e=>a.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.sender!==void 0&&(t.sender=e.sender),e.contract!==void 0&&(t.contract=e.contract),e.msg!==void 0&&(t.msg=w(e.msg===void 0?new Uint8Array:e.msg)),e.funds?t.funds=e.funds.map(e=>e?a.Coin.toJSON(e):void 0):t.funds=[],t},fromPartial(e){let t=u();return t.sender=e.sender??``,t.contract=e.contract??``,t.msg=e.msg??new Uint8Array,t.funds=e.funds?.map(e=>a.Coin.fromPartial(e))||[],t}};function d(){return{data:new Uint8Array}}e.MsgExecuteContractResponse={encode(e,t=r.default.Writer.create()){return e.data.length!==0&&t.uint32(10).bytes(e.data),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.data=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{data:E(e.data)?S(e.data):new Uint8Array}},toJSON(e){let t={};return e.data!==void 0&&(t.data=w(e.data===void 0?new Uint8Array:e.data)),t},fromPartial(e){let t=d();return t.data=e.data??new Uint8Array,t}};function f(){return{sender:``,contract:``,codeId:`0`,msg:new Uint8Array}}e.MsgMigrateContract={encode(e,t=r.default.Writer.create()){return e.sender!==``&&t.uint32(10).string(e.sender),e.contract!==``&&t.uint32(18).string(e.contract),e.codeId!==`0`&&t.uint32(24).uint64(e.codeId),e.msg.length!==0&&t.uint32(34).bytes(e.msg),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.sender=n.string();break;case 2:a.contract=n.string();break;case 3:a.codeId=T(n.uint64());break;case 4:a.msg=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{sender:E(e.sender)?String(e.sender):``,contract:E(e.contract)?String(e.contract):``,codeId:E(e.codeId)?String(e.codeId):`0`,msg:E(e.msg)?S(e.msg):new Uint8Array}},toJSON(e){let t={};return e.sender!==void 0&&(t.sender=e.sender),e.contract!==void 0&&(t.contract=e.contract),e.codeId!==void 0&&(t.codeId=e.codeId),e.msg!==void 0&&(t.msg=w(e.msg===void 0?new Uint8Array:e.msg)),t},fromPartial(e){let t=f();return t.sender=e.sender??``,t.contract=e.contract??``,t.codeId=e.codeId??`0`,t.msg=e.msg??new Uint8Array,t}};function p(){return{data:new Uint8Array}}e.MsgMigrateContractResponse={encode(e,t=r.default.Writer.create()){return e.data.length!==0&&t.uint32(10).bytes(e.data),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=p();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.data=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{data:E(e.data)?S(e.data):new Uint8Array}},toJSON(e){let t={};return e.data!==void 0&&(t.data=w(e.data===void 0?new Uint8Array:e.data)),t},fromPartial(e){let t=p();return t.data=e.data??new Uint8Array,t}};function g(){return{sender:``,newAdmin:``,contract:``}}e.MsgUpdateAdmin={encode(e,t=r.default.Writer.create()){return e.sender!==``&&t.uint32(10).string(e.sender),e.newAdmin!==``&&t.uint32(18).string(e.newAdmin),e.contract!==``&&t.uint32(26).string(e.contract),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=g();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.sender=n.string();break;case 2:a.newAdmin=n.string();break;case 3:a.contract=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{sender:E(e.sender)?String(e.sender):``,newAdmin:E(e.newAdmin)?String(e.newAdmin):``,contract:E(e.contract)?String(e.contract):``}},toJSON(e){let t={};return e.sender!==void 0&&(t.sender=e.sender),e.newAdmin!==void 0&&(t.newAdmin=e.newAdmin),e.contract!==void 0&&(t.contract=e.contract),t},fromPartial(e){let t=g();return t.sender=e.sender??``,t.newAdmin=e.newAdmin??``,t.contract=e.contract??``,t}};function _(){return{}}e.MsgUpdateAdminResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=_();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return _()}};function v(){return{sender:``,contract:``}}e.MsgClearAdmin={encode(e,t=r.default.Writer.create()){return e.sender!==``&&t.uint32(10).string(e.sender),e.contract!==``&&t.uint32(26).string(e.contract),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=v();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.sender=n.string();break;case 3:a.contract=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{sender:E(e.sender)?String(e.sender):``,contract:E(e.contract)?String(e.contract):``}},toJSON(e){let t={};return e.sender!==void 0&&(t.sender=e.sender),e.contract!==void 0&&(t.contract=e.contract),t},fromPartial(e){let t=v();return t.sender=e.sender??``,t.contract=e.contract??``,t}};function y(){return{}}e.MsgClearAdminResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=y();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return y()}};var b=(()=>{if(b!==void 0)return b;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),x=b.atob||(e=>b.Buffer.from(e,`base64`).toString(`binary`));function S(e){let t=x(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var C=b.btoa||(e=>b.Buffer.from(e,`binary`).toString(`base64`));function w(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return C(t.join(``))}function T(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function E(e){return e!=null}})),fc=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.ModuleVersion=e.CancelSoftwareUpgradeProposal=e.SoftwareUpgradeProposal=e.Plan=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=Ys(),a=tc();e.protobufPackage=`cosmos.upgrade.v1beta1`;function o(){return{name:``,time:void 0,height:`0`,info:``,upgradedClientState:void 0}}e.Plan={encode(e,t=r.default.Writer.create()){return e.name!==``&&t.uint32(10).string(e.name),e.time!==void 0&&i.Timestamp.encode(u(e.time),t.uint32(18).fork()).ldelim(),e.height!==`0`&&t.uint32(24).int64(e.height),e.info!==``&&t.uint32(34).string(e.info),e.upgradedClientState!==void 0&&a.Any.encode(e.upgradedClientState,t.uint32(42).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),s=t===void 0?n.len:n.pos+t,c=o();for(;n.pos<s;){let e=n.uint32();switch(e>>>3){case 1:c.name=n.string();break;case 2:c.time=d(i.Timestamp.decode(n,n.uint32()));break;case 3:c.height=p(n.int64());break;case 4:c.info=n.string();break;case 5:c.upgradedClientState=a.Any.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return c},fromJSON(e){return{name:m(e.name)?String(e.name):``,time:m(e.time)?f(e.time):void 0,height:m(e.height)?String(e.height):`0`,info:m(e.info)?String(e.info):``,upgradedClientState:m(e.upgradedClientState)?a.Any.fromJSON(e.upgradedClientState):void 0}},toJSON(e){let t={};return e.name!==void 0&&(t.name=e.name),e.time!==void 0&&(t.time=e.time.toISOString()),e.height!==void 0&&(t.height=e.height),e.info!==void 0&&(t.info=e.info),e.upgradedClientState!==void 0&&(t.upgradedClientState=e.upgradedClientState?a.Any.toJSON(e.upgradedClientState):void 0),t},fromPartial(e){let t=o();return t.name=e.name??``,t.time=e.time??void 0,t.height=e.height??`0`,t.info=e.info??``,t.upgradedClientState=e.upgradedClientState!==void 0&&e.upgradedClientState!==null?a.Any.fromPartial(e.upgradedClientState):void 0,t}};function s(){return{title:``,description:``,plan:void 0}}e.SoftwareUpgradeProposal={encode(t,n=r.default.Writer.create()){return t.title!==``&&n.uint32(10).string(t.title),t.description!==``&&n.uint32(18).string(t.description),t.plan!==void 0&&e.Plan.encode(t.plan,n.uint32(26).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=s();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.title=i.string();break;case 2:o.description=i.string();break;case 3:o.plan=e.Plan.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{title:m(t.title)?String(t.title):``,description:m(t.description)?String(t.description):``,plan:m(t.plan)?e.Plan.fromJSON(t.plan):void 0}},toJSON(t){let n={};return t.title!==void 0&&(n.title=t.title),t.description!==void 0&&(n.description=t.description),t.plan!==void 0&&(n.plan=t.plan?e.Plan.toJSON(t.plan):void 0),n},fromPartial(t){let n=s();return n.title=t.title??``,n.description=t.description??``,n.plan=t.plan!==void 0&&t.plan!==null?e.Plan.fromPartial(t.plan):void 0,n}};function c(){return{title:``,description:``}}e.CancelSoftwareUpgradeProposal={encode(e,t=r.default.Writer.create()){return e.title!==``&&t.uint32(10).string(e.title),e.description!==``&&t.uint32(18).string(e.description),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=c();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.title=n.string();break;case 2:a.description=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{title:m(e.title)?String(e.title):``,description:m(e.description)?String(e.description):``}},toJSON(e){let t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),t},fromPartial(e){let t=c();return t.title=e.title??``,t.description=e.description??``,t}};function l(){return{name:``,version:`0`}}e.ModuleVersion={encode(e,t=r.default.Writer.create()){return e.name!==``&&t.uint32(10).string(e.name),e.version!==`0`&&t.uint32(16).uint64(e.version),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.name=n.string();break;case 2:a.version=p(n.uint64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{name:m(e.name)?String(e.name):``,version:m(e.version)?String(e.version):`0`}},toJSON(e){let t={};return e.name!==void 0&&(t.name=e.name),e.version!==void 0&&(t.version=e.version),t},fromPartial(e){let t=l();return t.name=e.name??``,t.version=e.version??`0`,t}};function u(e){return{seconds:Math.trunc(e.getTime()/1e3).toString(),nanos:e.getTime()%1e3*1e6}}function d(e){let t=Number(e.seconds)*1e3;return t+=e.nanos/1e6,new Date(t)}function f(e){return e instanceof Date?e:typeof e==`string`?new Date(e):d(i.Timestamp.fromJSON(e))}function p(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function m(e){return e!=null}})),pc=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Params=e.Height=e.UpgradeProposal=e.ClientUpdateProposal=e.ClientConsensusStates=e.ConsensusStateWithHeight=e.IdentifiedClientState=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=tc(),a=fc();e.protobufPackage=`ibc.core.client.v1`;function o(){return{clientId:``,clientState:void 0}}e.IdentifiedClientState={encode(e,t=r.default.Writer.create()){return e.clientId!==``&&t.uint32(10).string(e.clientId),e.clientState!==void 0&&i.Any.encode(e.clientState,t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,s=o();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:s.clientId=n.string();break;case 2:s.clientState=i.Any.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{clientId:m(e.clientId)?String(e.clientId):``,clientState:m(e.clientState)?i.Any.fromJSON(e.clientState):void 0}},toJSON(e){let t={};return e.clientId!==void 0&&(t.clientId=e.clientId),e.clientState!==void 0&&(t.clientState=e.clientState?i.Any.toJSON(e.clientState):void 0),t},fromPartial(e){let t=o();return t.clientId=e.clientId??``,t.clientState=e.clientState!==void 0&&e.clientState!==null?i.Any.fromPartial(e.clientState):void 0,t}};function s(){return{height:void 0,consensusState:void 0}}e.ConsensusStateWithHeight={encode(t,n=r.default.Writer.create()){return t.height!==void 0&&e.Height.encode(t.height,n.uint32(10).fork()).ldelim(),t.consensusState!==void 0&&i.Any.encode(t.consensusState,n.uint32(18).fork()).ldelim(),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,c=s();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:c.height=e.Height.decode(a,a.uint32());break;case 2:c.consensusState=i.Any.decode(a,a.uint32());break;default:a.skipType(t&7);break}}return c},fromJSON(t){return{height:m(t.height)?e.Height.fromJSON(t.height):void 0,consensusState:m(t.consensusState)?i.Any.fromJSON(t.consensusState):void 0}},toJSON(t){let n={};return t.height!==void 0&&(n.height=t.height?e.Height.toJSON(t.height):void 0),t.consensusState!==void 0&&(n.consensusState=t.consensusState?i.Any.toJSON(t.consensusState):void 0),n},fromPartial(t){let n=s();return n.height=t.height!==void 0&&t.height!==null?e.Height.fromPartial(t.height):void 0,n.consensusState=t.consensusState!==void 0&&t.consensusState!==null?i.Any.fromPartial(t.consensusState):void 0,n}};function c(){return{clientId:``,consensusStates:[]}}e.ClientConsensusStates={encode(t,n=r.default.Writer.create()){t.clientId!==``&&n.uint32(10).string(t.clientId);for(let r of t.consensusStates)e.ConsensusStateWithHeight.encode(r,n.uint32(18).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=c();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.clientId=i.string();break;case 2:o.consensusStates.push(e.ConsensusStateWithHeight.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{clientId:m(t.clientId)?String(t.clientId):``,consensusStates:Array.isArray(t?.consensusStates)?t.consensusStates.map(t=>e.ConsensusStateWithHeight.fromJSON(t)):[]}},toJSON(t){let n={};return t.clientId!==void 0&&(n.clientId=t.clientId),t.consensusStates?n.consensusStates=t.consensusStates.map(t=>t?e.ConsensusStateWithHeight.toJSON(t):void 0):n.consensusStates=[],n},fromPartial(t){let n=c();return n.clientId=t.clientId??``,n.consensusStates=t.consensusStates?.map(t=>e.ConsensusStateWithHeight.fromPartial(t))||[],n}};function l(){return{title:``,description:``,subjectClientId:``,substituteClientId:``}}e.ClientUpdateProposal={encode(e,t=r.default.Writer.create()){return e.title!==``&&t.uint32(10).string(e.title),e.description!==``&&t.uint32(18).string(e.description),e.subjectClientId!==``&&t.uint32(26).string(e.subjectClientId),e.substituteClientId!==``&&t.uint32(34).string(e.substituteClientId),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.title=n.string();break;case 2:a.description=n.string();break;case 3:a.subjectClientId=n.string();break;case 4:a.substituteClientId=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{title:m(e.title)?String(e.title):``,description:m(e.description)?String(e.description):``,subjectClientId:m(e.subjectClientId)?String(e.subjectClientId):``,substituteClientId:m(e.substituteClientId)?String(e.substituteClientId):``}},toJSON(e){let t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),e.subjectClientId!==void 0&&(t.subjectClientId=e.subjectClientId),e.substituteClientId!==void 0&&(t.substituteClientId=e.substituteClientId),t},fromPartial(e){let t=l();return t.title=e.title??``,t.description=e.description??``,t.subjectClientId=e.subjectClientId??``,t.substituteClientId=e.substituteClientId??``,t}};function u(){return{title:``,description:``,plan:void 0,upgradedClientState:void 0}}e.UpgradeProposal={encode(e,t=r.default.Writer.create()){return e.title!==``&&t.uint32(10).string(e.title),e.description!==``&&t.uint32(18).string(e.description),e.plan!==void 0&&a.Plan.encode(e.plan,t.uint32(26).fork()).ldelim(),e.upgradedClientState!==void 0&&i.Any.encode(e.upgradedClientState,t.uint32(34).fork()).ldelim(),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),o=t===void 0?n.len:n.pos+t,s=u();for(;n.pos<o;){let e=n.uint32();switch(e>>>3){case 1:s.title=n.string();break;case 2:s.description=n.string();break;case 3:s.plan=a.Plan.decode(n,n.uint32());break;case 4:s.upgradedClientState=i.Any.decode(n,n.uint32());break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{title:m(e.title)?String(e.title):``,description:m(e.description)?String(e.description):``,plan:m(e.plan)?a.Plan.fromJSON(e.plan):void 0,upgradedClientState:m(e.upgradedClientState)?i.Any.fromJSON(e.upgradedClientState):void 0}},toJSON(e){let t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),e.plan!==void 0&&(t.plan=e.plan?a.Plan.toJSON(e.plan):void 0),e.upgradedClientState!==void 0&&(t.upgradedClientState=e.upgradedClientState?i.Any.toJSON(e.upgradedClientState):void 0),t},fromPartial(e){let t=u();return t.title=e.title??``,t.description=e.description??``,t.plan=e.plan!==void 0&&e.plan!==null?a.Plan.fromPartial(e.plan):void 0,t.upgradedClientState=e.upgradedClientState!==void 0&&e.upgradedClientState!==null?i.Any.fromPartial(e.upgradedClientState):void 0,t}};function d(){return{revisionNumber:`0`,revisionHeight:`0`}}e.Height={encode(e,t=r.default.Writer.create()){return e.revisionNumber!==`0`&&t.uint32(8).uint64(e.revisionNumber),e.revisionHeight!==`0`&&t.uint32(16).uint64(e.revisionHeight),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.revisionNumber=p(n.uint64());break;case 2:a.revisionHeight=p(n.uint64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{revisionNumber:m(e.revisionNumber)?String(e.revisionNumber):`0`,revisionHeight:m(e.revisionHeight)?String(e.revisionHeight):`0`}},toJSON(e){let t={};return e.revisionNumber!==void 0&&(t.revisionNumber=e.revisionNumber),e.revisionHeight!==void 0&&(t.revisionHeight=e.revisionHeight),t},fromPartial(e){let t=d();return t.revisionNumber=e.revisionNumber??`0`,t.revisionHeight=e.revisionHeight??`0`,t}};function f(){return{allowedClients:[]}}e.Params={encode(e,t=r.default.Writer.create()){for(let n of e.allowedClients)t.uint32(10).string(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.allowedClients.push(n.string());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{allowedClients:Array.isArray(e?.allowedClients)?e.allowedClients.map(e=>String(e)):[]}},toJSON(e){let t={};return e.allowedClients?t.allowedClients=e.allowedClients.map(e=>e):t.allowedClients=[],t},fromPartial(e){let t=f();return t.allowedClients=e.allowedClients?.map(e=>e)||[],t}};function p(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function m(e){return e!=null}})),mc=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.MsgTransferResponse=e.MsgTransfer=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=Ks(),a=pc();e.protobufPackage=`ibc.applications.transfer.v1`;function o(){return{sourcePort:``,sourceChannel:``,token:void 0,sender:``,receiver:``,timeoutHeight:void 0,timeoutTimestamp:`0`,memo:``}}e.MsgTransfer={encode(e,t=r.default.Writer.create()){return e.sourcePort!==``&&t.uint32(10).string(e.sourcePort),e.sourceChannel!==``&&t.uint32(18).string(e.sourceChannel),e.token!==void 0&&i.Coin.encode(e.token,t.uint32(26).fork()).ldelim(),e.sender!==``&&t.uint32(34).string(e.sender),e.receiver!==``&&t.uint32(42).string(e.receiver),e.timeoutHeight!==void 0&&a.Height.encode(e.timeoutHeight,t.uint32(50).fork()).ldelim(),e.timeoutTimestamp!==`0`&&t.uint32(56).uint64(e.timeoutTimestamp),e.memo!==``&&t.uint32(66).string(e.memo),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),s=t===void 0?n.len:n.pos+t,l=o();for(;n.pos<s;){let e=n.uint32();switch(e>>>3){case 1:l.sourcePort=n.string();break;case 2:l.sourceChannel=n.string();break;case 3:l.token=i.Coin.decode(n,n.uint32());break;case 4:l.sender=n.string();break;case 5:l.receiver=n.string();break;case 6:l.timeoutHeight=a.Height.decode(n,n.uint32());break;case 7:l.timeoutTimestamp=c(n.uint64());break;case 8:l.memo=n.string();break;default:n.skipType(e&7);break}}return l},fromJSON(e){return{sourcePort:l(e.sourcePort)?String(e.sourcePort):``,sourceChannel:l(e.sourceChannel)?String(e.sourceChannel):``,token:l(e.token)?i.Coin.fromJSON(e.token):void 0,sender:l(e.sender)?String(e.sender):``,receiver:l(e.receiver)?String(e.receiver):``,timeoutHeight:l(e.timeoutHeight)?a.Height.fromJSON(e.timeoutHeight):void 0,timeoutTimestamp:l(e.timeoutTimestamp)?String(e.timeoutTimestamp):`0`,memo:l(e.memo)?String(e.memo):``}},toJSON(e){let t={};return e.sourcePort!==void 0&&(t.sourcePort=e.sourcePort),e.sourceChannel!==void 0&&(t.sourceChannel=e.sourceChannel),e.token!==void 0&&(t.token=e.token?i.Coin.toJSON(e.token):void 0),e.sender!==void 0&&(t.sender=e.sender),e.receiver!==void 0&&(t.receiver=e.receiver),e.timeoutHeight!==void 0&&(t.timeoutHeight=e.timeoutHeight?a.Height.toJSON(e.timeoutHeight):void 0),e.timeoutTimestamp!==void 0&&(t.timeoutTimestamp=e.timeoutTimestamp),e.memo!==void 0&&(t.memo=e.memo),t},fromPartial(e){let t=o();return t.sourcePort=e.sourcePort??``,t.sourceChannel=e.sourceChannel??``,t.token=e.token!==void 0&&e.token!==null?i.Coin.fromPartial(e.token):void 0,t.sender=e.sender??``,t.receiver=e.receiver??``,t.timeoutHeight=e.timeoutHeight!==void 0&&e.timeoutHeight!==null?a.Height.fromPartial(e.timeoutHeight):void 0,t.timeoutTimestamp=e.timeoutTimestamp??`0`,t.memo=e.memo??``,t}};function s(){return{}}e.MsgTransferResponse={encode(e,t=r.default.Writer.create()){return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=s();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){default:n.skipType(e&7);break}}return a},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return s()}};function c(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function l(e){return e!=null}})),hc=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.UnknownMessage=void 0;var t=(_(),n(v));e.UnknownMessage=class{constructor(e,t){this._typeUrl=e,this._value=t}get typeUrl(){return this._typeUrl}get value(){return this._value}toJSON(){return{typeUrl:this._typeUrl,value:t.Buffer.from(this._value).toString(`base64`)}}}})),gc=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.StakeAuthorization_Validators=e.StakeAuthorization=e.authorizationTypeToJSON=e.authorizationTypeFromJSON=e.AuthorizationType=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=Ks();e.protobufPackage=`cosmos.staking.v1beta1`;var a;(function(e){e[e.AUTHORIZATION_TYPE_UNSPECIFIED=0]=`AUTHORIZATION_TYPE_UNSPECIFIED`,e[e.AUTHORIZATION_TYPE_DELEGATE=1]=`AUTHORIZATION_TYPE_DELEGATE`,e[e.AUTHORIZATION_TYPE_UNDELEGATE=2]=`AUTHORIZATION_TYPE_UNDELEGATE`,e[e.AUTHORIZATION_TYPE_REDELEGATE=3]=`AUTHORIZATION_TYPE_REDELEGATE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(a=e.AuthorizationType||={});function o(e){switch(e){case 0:case`AUTHORIZATION_TYPE_UNSPECIFIED`:return a.AUTHORIZATION_TYPE_UNSPECIFIED;case 1:case`AUTHORIZATION_TYPE_DELEGATE`:return a.AUTHORIZATION_TYPE_DELEGATE;case 2:case`AUTHORIZATION_TYPE_UNDELEGATE`:return a.AUTHORIZATION_TYPE_UNDELEGATE;case 3:case`AUTHORIZATION_TYPE_REDELEGATE`:return a.AUTHORIZATION_TYPE_REDELEGATE;default:return a.UNRECOGNIZED}}e.authorizationTypeFromJSON=o;function s(e){switch(e){case a.AUTHORIZATION_TYPE_UNSPECIFIED:return`AUTHORIZATION_TYPE_UNSPECIFIED`;case a.AUTHORIZATION_TYPE_DELEGATE:return`AUTHORIZATION_TYPE_DELEGATE`;case a.AUTHORIZATION_TYPE_UNDELEGATE:return`AUTHORIZATION_TYPE_UNDELEGATE`;case a.AUTHORIZATION_TYPE_REDELEGATE:return`AUTHORIZATION_TYPE_REDELEGATE`;default:return`UNKNOWN`}}e.authorizationTypeToJSON=s;function c(){return{maxTokens:void 0,allowList:void 0,denyList:void 0,authorizationType:0}}e.StakeAuthorization={encode(t,n=r.default.Writer.create()){return t.maxTokens!==void 0&&i.Coin.encode(t.maxTokens,n.uint32(10).fork()).ldelim(),t.allowList!==void 0&&e.StakeAuthorization_Validators.encode(t.allowList,n.uint32(18).fork()).ldelim(),t.denyList!==void 0&&e.StakeAuthorization_Validators.encode(t.denyList,n.uint32(26).fork()).ldelim(),t.authorizationType!==0&&n.uint32(32).int32(t.authorizationType),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,s=c();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.maxTokens=i.Coin.decode(a,a.uint32());break;case 2:s.allowList=e.StakeAuthorization_Validators.decode(a,a.uint32());break;case 3:s.denyList=e.StakeAuthorization_Validators.decode(a,a.uint32());break;case 4:s.authorizationType=a.int32();break;default:a.skipType(t&7);break}}return s},fromJSON(t){return{maxTokens:u(t.maxTokens)?i.Coin.fromJSON(t.maxTokens):void 0,allowList:u(t.allowList)?e.StakeAuthorization_Validators.fromJSON(t.allowList):void 0,denyList:u(t.denyList)?e.StakeAuthorization_Validators.fromJSON(t.denyList):void 0,authorizationType:u(t.authorizationType)?o(t.authorizationType):0}},toJSON(t){let n={};return t.maxTokens!==void 0&&(n.maxTokens=t.maxTokens?i.Coin.toJSON(t.maxTokens):void 0),t.allowList!==void 0&&(n.allowList=t.allowList?e.StakeAuthorization_Validators.toJSON(t.allowList):void 0),t.denyList!==void 0&&(n.denyList=t.denyList?e.StakeAuthorization_Validators.toJSON(t.denyList):void 0),t.authorizationType!==void 0&&(n.authorizationType=s(t.authorizationType)),n},fromPartial(t){let n=c();return n.maxTokens=t.maxTokens!==void 0&&t.maxTokens!==null?i.Coin.fromPartial(t.maxTokens):void 0,n.allowList=t.allowList!==void 0&&t.allowList!==null?e.StakeAuthorization_Validators.fromPartial(t.allowList):void 0,n.denyList=t.denyList!==void 0&&t.denyList!==null?e.StakeAuthorization_Validators.fromPartial(t.denyList):void 0,n.authorizationType=t.authorizationType??0,n}};function l(){return{address:[]}}e.StakeAuthorization_Validators={encode(e,t=r.default.Writer.create()){for(let n of e.address)t.uint32(10).string(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.address.push(n.string());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{address:Array.isArray(e?.address)?e.address.map(e=>String(e)):[]}},toJSON(e){let t={};return e.address?t.address=e.address.map(e=>e):t.address=[],t},fromPartial(e){let t=l();return t.address=e.address?.map(e=>e)||[],t}},r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function u(e){return e!=null}})),_c=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.SendAuthorization=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=Ks();e.protobufPackage=`cosmos.bank.v1beta1`;function a(){return{spendLimit:[]}}e.SendAuthorization={encode(e,t=r.default.Writer.create()){for(let n of e.spendLimit)i.Coin.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),o=t===void 0?n.len:n.pos+t,s=a();for(;n.pos<o;){let e=n.uint32();switch(e>>>3){case 1:s.spendLimit.push(i.Coin.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return s},fromJSON(e){return{spendLimit:Array.isArray(e?.spendLimit)?e.spendLimit.map(e=>i.Coin.fromJSON(e)):[]}},toJSON(e){let t={};return e.spendLimit?t.spendLimit=e.spendLimit.map(e=>e?i.Coin.toJSON(e):void 0):t.spendLimit=[],t},fromPartial(e){let t=a();return t.spendLimit=e.spendLimit?.map(e=>i.Coin.fromPartial(e))||[],t}},r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure())})),vc=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),r=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.defaultProtoCodec=e.ProtoCodec=void 0;var i=Gs(),a=Js(),o=ic(),s=oc(),c=cc(),l=lc(),u=dc(),d=mc(),f=hc(),p=ac(),m=gc(),h=_c(),g=(_(),n(v));r(hc(),e);var y=class{constructor(){this.typeUrlMap=new Map}unpackAnyFactory(e){if(this.typeUrlMap.has(e))return this.typeUrlMap.get(e)}unpackAny(e){let t=this.unpackAnyFactory(e.typeUrl);if(!t)return new f.UnknownMessage(e.typeUrl,e.value);let n=t.decode(e.value);return Object.assign(Object.assign({},e),{unpacked:n})}unpackedAnyToJSONRecursive(e){if(e instanceof f.UnknownMessage)return e.toJSON();let t=this.unpackAnyFactory(e.typeUrl);if(t&&`unpacked`in e&&e.unpacked){let n=e=>{let t=typeof e==`object`&&!(e instanceof f.UnknownMessage)&&`typeUrl`in e&&e.typeUrl&&typeof e.typeUrl==`string`&&`value`in e&&e.value&&typeof e.value==`string`;if(t)try{g.Buffer.from(e.value,`base64`)}catch{return!1}return t},r=e=>{let t=this.unpackAnyFactory(e.typeUrl),n=g.Buffer.from(e.value,`base64`);if(!t)return new f.UnknownMessage(e.typeUrl,n).toJSON();let r=t.decode(n);return{typeUrl:e.typeUrl,value:t.toJSON(r)}},i=e=>{if(Array.isArray(e))for(let t=0;t<e.length;t++){let a=e[t];n(a)?e[t]=r(a):typeof a==`object`&&(e[t]=i(a))}else for(let t in e){let a=e[t];n(a)?e[t]=r(a):typeof a==`object`&&(e[t]=i(a))}return e},a=t.toJSON(e.unpacked);if(a&&typeof a==`object`)return a=i(a),{typeUrl:e.typeUrl,value:a}}return new f.UnknownMessage(e.typeUrl,e.value).toJSON()}registerAny(e,t){this.typeUrlMap.set(e,t)}};e.ProtoCodec=y,e.defaultProtoCodec=new y,e.defaultProtoCodec.registerAny(`/agoric.swingset.MsgWalletSpendAction`,i.MsgWalletSpendAction),e.defaultProtoCodec.registerAny(`/agoric.swingset.MsgProvision`,i.MsgProvision),e.defaultProtoCodec.registerAny(`/cosmos.bank.v1beta1.MsgSend`,a.MsgSend),e.defaultProtoCodec.registerAny(`/cosmos.bank.v1beta1.MsgMultiSend`,a.MsgMultiSend),e.defaultProtoCodec.registerAny(`/cosmos.staking.v1beta1.MsgDelegate`,o.MsgDelegate),e.defaultProtoCodec.registerAny(`/cosmos.staking.v1beta1.MsgUndelegate`,o.MsgUndelegate),e.defaultProtoCodec.registerAny(`/cosmos.staking.v1beta1.MsgBeginRedelegate`,o.MsgBeginRedelegate),e.defaultProtoCodec.registerAny(`/cosmwasm.wasm.v1.MsgExecuteContract`,u.MsgExecuteContract),e.defaultProtoCodec.registerAny(`/cosmwasm.wasm.v1.MsgInstantiateContract`,u.MsgInstantiateContract),e.defaultProtoCodec.registerAny(`/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward`,l.MsgWithdrawDelegatorReward),e.defaultProtoCodec.registerAny(`/cosmos.distribution.v1beta1.MsgSetWithdrawAddress`,l.MsgSetWithdrawAddress),e.defaultProtoCodec.registerAny(`/ibc.applications.transfer.v1.MsgTransfer`,d.MsgTransfer),e.defaultProtoCodec.registerAny(`/cosmos.gov.v1beta1.MsgVote`,c.MsgVote),e.defaultProtoCodec.registerAny(`/cosmos.authz.v1beta1.MsgGrant`,s.MsgGrant),e.defaultProtoCodec.registerAny(`/cosmos.authz.v1beta1.GenericAuthorization`,p.GenericAuthorization),e.defaultProtoCodec.registerAny(`/cosmos.staking.v1beta1.StakeAuthorization`,m.StakeAuthorization),e.defaultProtoCodec.registerAny(`/cosmos.bank.v1beta1.SendAuthorization`,h.SendAuthorization),e.defaultProtoCodec.registerAny(`/cosmos.authz.v1beta1.MsgRevoke`,s.MsgRevoke),e.defaultProtoCodec.registerAny(`/cosmos.authz.v1beta1.MsgExec`,s.MsgExec)})),yc=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.CompactBitArray=e.MultiSignature=e.protobufPackage=void 0;var n=t(G()),r=t(q());e.protobufPackage=`cosmos.crypto.multisig.v1beta1`;function i(){return{signatures:[]}}e.MultiSignature={encode(e,t=r.default.Writer.create()){for(let n of e.signatures)t.uint32(10).bytes(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),a=t===void 0?n.len:n.pos+t,o=i();for(;n.pos<a;){let e=n.uint32();switch(e>>>3){case 1:o.signatures.push(n.bytes());break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{signatures:Array.isArray(e?.signatures)?e.signatures.map(e=>c(e)):[]}},toJSON(e){let t={};return e.signatures?t.signatures=e.signatures.map(e=>u(e===void 0?new Uint8Array:e)):t.signatures=[],t},fromPartial(e){let t=i();return t.signatures=e.signatures?.map(e=>e)||[],t}};function a(){return{extraBitsStored:0,elems:new Uint8Array}}e.CompactBitArray={encode(e,t=r.default.Writer.create()){return e.extraBitsStored!==0&&t.uint32(8).uint32(e.extraBitsStored),e.elems.length!==0&&t.uint32(18).bytes(e.elems),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=a();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.extraBitsStored=n.uint32();break;case 2:o.elems=n.bytes();break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{extraBitsStored:d(e.extraBitsStored)?Number(e.extraBitsStored):0,elems:d(e.elems)?c(e.elems):new Uint8Array}},toJSON(e){let t={};return e.extraBitsStored!==void 0&&(t.extraBitsStored=Math.round(e.extraBitsStored)),e.elems!==void 0&&(t.elems=u(e.elems===void 0?new Uint8Array:e.elems)),t},fromPartial(e){let t=a();return t.extraBitsStored=e.extraBitsStored??0,t.elems=e.elems??new Uint8Array,t}};var o=(()=>{if(o!==void 0)return o;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),s=o.atob||(e=>o.Buffer.from(e,`base64`).toString(`binary`));function c(e){let t=s(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var l=o.btoa||(e=>o.Buffer.from(e,`binary`).toString(`base64`));function u(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return l(t.join(``))}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function d(e){return e!=null}})),bc=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.SignatureDescriptor_Data_Multi=e.SignatureDescriptor_Data_Single=e.SignatureDescriptor_Data=e.SignatureDescriptor=e.SignatureDescriptors=e.signModeToJSON=e.signModeFromJSON=e.SignMode=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=tc(),a=yc();e.protobufPackage=`cosmos.tx.signing.v1beta1`;var o;(function(e){e[e.SIGN_MODE_UNSPECIFIED=0]=`SIGN_MODE_UNSPECIFIED`,e[e.SIGN_MODE_DIRECT=1]=`SIGN_MODE_DIRECT`,e[e.SIGN_MODE_TEXTUAL=2]=`SIGN_MODE_TEXTUAL`,e[e.SIGN_MODE_LEGACY_AMINO_JSON=127]=`SIGN_MODE_LEGACY_AMINO_JSON`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`})(o=e.SignMode||={});function s(e){switch(e){case 0:case`SIGN_MODE_UNSPECIFIED`:return o.SIGN_MODE_UNSPECIFIED;case 1:case`SIGN_MODE_DIRECT`:return o.SIGN_MODE_DIRECT;case 2:case`SIGN_MODE_TEXTUAL`:return o.SIGN_MODE_TEXTUAL;case 127:case`SIGN_MODE_LEGACY_AMINO_JSON`:return o.SIGN_MODE_LEGACY_AMINO_JSON;default:return o.UNRECOGNIZED}}e.signModeFromJSON=s;function c(e){switch(e){case o.SIGN_MODE_UNSPECIFIED:return`SIGN_MODE_UNSPECIFIED`;case o.SIGN_MODE_DIRECT:return`SIGN_MODE_DIRECT`;case o.SIGN_MODE_TEXTUAL:return`SIGN_MODE_TEXTUAL`;case o.SIGN_MODE_LEGACY_AMINO_JSON:return`SIGN_MODE_LEGACY_AMINO_JSON`;default:return`UNKNOWN`}}e.signModeToJSON=c;function l(){return{signatures:[]}}e.SignatureDescriptors={encode(t,n=r.default.Writer.create()){for(let r of t.signatures)e.SignatureDescriptor.encode(r,n.uint32(10).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=l();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.signatures.push(e.SignatureDescriptor.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{signatures:Array.isArray(t?.signatures)?t.signatures.map(t=>e.SignatureDescriptor.fromJSON(t)):[]}},toJSON(t){let n={};return t.signatures?n.signatures=t.signatures.map(t=>t?e.SignatureDescriptor.toJSON(t):void 0):n.signatures=[],n},fromPartial(t){let n=l();return n.signatures=t.signatures?.map(t=>e.SignatureDescriptor.fromPartial(t))||[],n}};function u(){return{publicKey:void 0,data:void 0,sequence:`0`}}e.SignatureDescriptor={encode(t,n=r.default.Writer.create()){return t.publicKey!==void 0&&i.Any.encode(t.publicKey,n.uint32(10).fork()).ldelim(),t.data!==void 0&&e.SignatureDescriptor_Data.encode(t.data,n.uint32(18).fork()).ldelim(),t.sequence!==`0`&&n.uint32(24).uint64(t.sequence),n},decode(t,n){let a=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?a.len:a.pos+n,s=u();for(;a.pos<o;){let t=a.uint32();switch(t>>>3){case 1:s.publicKey=i.Any.decode(a,a.uint32());break;case 2:s.data=e.SignatureDescriptor_Data.decode(a,a.uint32());break;case 3:s.sequence=x(a.uint64());break;default:a.skipType(t&7);break}}return s},fromJSON(t){return{publicKey:S(t.publicKey)?i.Any.fromJSON(t.publicKey):void 0,data:S(t.data)?e.SignatureDescriptor_Data.fromJSON(t.data):void 0,sequence:S(t.sequence)?String(t.sequence):`0`}},toJSON(t){let n={};return t.publicKey!==void 0&&(n.publicKey=t.publicKey?i.Any.toJSON(t.publicKey):void 0),t.data!==void 0&&(n.data=t.data?e.SignatureDescriptor_Data.toJSON(t.data):void 0),t.sequence!==void 0&&(n.sequence=t.sequence),n},fromPartial(t){let n=u();return n.publicKey=t.publicKey!==void 0&&t.publicKey!==null?i.Any.fromPartial(t.publicKey):void 0,n.data=t.data!==void 0&&t.data!==null?e.SignatureDescriptor_Data.fromPartial(t.data):void 0,n.sequence=t.sequence??`0`,n}};function d(){return{single:void 0,multi:void 0}}e.SignatureDescriptor_Data={encode(t,n=r.default.Writer.create()){return t.single!==void 0&&e.SignatureDescriptor_Data_Single.encode(t.single,n.uint32(10).fork()).ldelim(),t.multi!==void 0&&e.SignatureDescriptor_Data_Multi.encode(t.multi,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=d();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.single=e.SignatureDescriptor_Data_Single.decode(i,i.uint32());break;case 2:o.multi=e.SignatureDescriptor_Data_Multi.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{single:S(t.single)?e.SignatureDescriptor_Data_Single.fromJSON(t.single):void 0,multi:S(t.multi)?e.SignatureDescriptor_Data_Multi.fromJSON(t.multi):void 0}},toJSON(t){let n={};return t.single!==void 0&&(n.single=t.single?e.SignatureDescriptor_Data_Single.toJSON(t.single):void 0),t.multi!==void 0&&(n.multi=t.multi?e.SignatureDescriptor_Data_Multi.toJSON(t.multi):void 0),n},fromPartial(t){let n=d();return n.single=t.single!==void 0&&t.single!==null?e.SignatureDescriptor_Data_Single.fromPartial(t.single):void 0,n.multi=t.multi!==void 0&&t.multi!==null?e.SignatureDescriptor_Data_Multi.fromPartial(t.multi):void 0,n}};function f(){return{mode:0,signature:new Uint8Array}}e.SignatureDescriptor_Data_Single={encode(e,t=r.default.Writer.create()){return e.mode!==0&&t.uint32(8).int32(e.mode),e.signature.length!==0&&t.uint32(18).bytes(e.signature),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=f();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.mode=n.int32();break;case 2:a.signature=n.bytes();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{mode:S(e.mode)?s(e.mode):0,signature:S(e.signature)?v(e.signature):new Uint8Array}},toJSON(e){let t={};return e.mode!==void 0&&(t.mode=c(e.mode)),e.signature!==void 0&&(t.signature=b(e.signature===void 0?new Uint8Array:e.signature)),t},fromPartial(e){let t=f();return t.mode=e.mode??0,t.signature=e.signature??new Uint8Array,t}};function p(){return{bitarray:void 0,signatures:[]}}e.SignatureDescriptor_Data_Multi={encode(t,n=r.default.Writer.create()){t.bitarray!==void 0&&a.CompactBitArray.encode(t.bitarray,n.uint32(10).fork()).ldelim();for(let r of t.signatures)e.SignatureDescriptor_Data.encode(r,n.uint32(18).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?i.len:i.pos+n,s=p();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.bitarray=a.CompactBitArray.decode(i,i.uint32());break;case 2:s.signatures.push(e.SignatureDescriptor_Data.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{bitarray:S(t.bitarray)?a.CompactBitArray.fromJSON(t.bitarray):void 0,signatures:Array.isArray(t?.signatures)?t.signatures.map(t=>e.SignatureDescriptor_Data.fromJSON(t)):[]}},toJSON(t){let n={};return t.bitarray!==void 0&&(n.bitarray=t.bitarray?a.CompactBitArray.toJSON(t.bitarray):void 0),t.signatures?n.signatures=t.signatures.map(t=>t?e.SignatureDescriptor_Data.toJSON(t):void 0):n.signatures=[],n},fromPartial(t){let n=p();return n.bitarray=t.bitarray!==void 0&&t.bitarray!==null?a.CompactBitArray.fromPartial(t.bitarray):void 0,n.signatures=t.signatures?.map(t=>e.SignatureDescriptor_Data.fromPartial(t))||[],n}};var g=(()=>{if(g!==void 0)return g;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),_=g.atob||(e=>g.Buffer.from(e,`base64`).toString(`binary`));function v(e){let t=_(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var y=g.btoa||(e=>g.Buffer.from(e,`binary`).toString(`base64`));function b(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return y(t.join(``))}function x(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function S(e){return e!=null}})),xc=a((e=>{m();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Fee=e.ModeInfo_Multi=e.ModeInfo_Single=e.ModeInfo=e.SignerInfo=e.AuthInfo=e.TxBody=e.SignDoc=e.TxRaw=e.Tx=e.protobufPackage=void 0;var n=t(G()),r=t(q()),i=bc(),a=tc(),o=yc(),s=Ks();e.protobufPackage=`cosmos.tx.v1beta1`;function c(){return{body:void 0,authInfo:void 0,signatures:[]}}e.Tx={encode(t,n=r.default.Writer.create()){t.body!==void 0&&e.TxBody.encode(t.body,n.uint32(10).fork()).ldelim(),t.authInfo!==void 0&&e.AuthInfo.encode(t.authInfo,n.uint32(18).fork()).ldelim();for(let e of t.signatures)n.uint32(26).bytes(e);return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=c();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.body=e.TxBody.decode(i,i.uint32());break;case 2:o.authInfo=e.AuthInfo.decode(i,i.uint32());break;case 3:o.signatures.push(i.bytes());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{body:E(t.body)?e.TxBody.fromJSON(t.body):void 0,authInfo:E(t.authInfo)?e.AuthInfo.fromJSON(t.authInfo):void 0,signatures:Array.isArray(t?.signatures)?t.signatures.map(e=>S(e)):[]}},toJSON(t){let n={};return t.body!==void 0&&(n.body=t.body?e.TxBody.toJSON(t.body):void 0),t.authInfo!==void 0&&(n.authInfo=t.authInfo?e.AuthInfo.toJSON(t.authInfo):void 0),t.signatures?n.signatures=t.signatures.map(e=>w(e===void 0?new Uint8Array:e)):n.signatures=[],n},fromPartial(t){let n=c();return n.body=t.body!==void 0&&t.body!==null?e.TxBody.fromPartial(t.body):void 0,n.authInfo=t.authInfo!==void 0&&t.authInfo!==null?e.AuthInfo.fromPartial(t.authInfo):void 0,n.signatures=t.signatures?.map(e=>e)||[],n}};function l(){return{bodyBytes:new Uint8Array,authInfoBytes:new Uint8Array,signatures:[]}}e.TxRaw={encode(e,t=r.default.Writer.create()){e.bodyBytes.length!==0&&t.uint32(10).bytes(e.bodyBytes),e.authInfoBytes.length!==0&&t.uint32(18).bytes(e.authInfoBytes);for(let n of e.signatures)t.uint32(26).bytes(n);return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=l();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.bodyBytes=n.bytes();break;case 2:a.authInfoBytes=n.bytes();break;case 3:a.signatures.push(n.bytes());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{bodyBytes:E(e.bodyBytes)?S(e.bodyBytes):new Uint8Array,authInfoBytes:E(e.authInfoBytes)?S(e.authInfoBytes):new Uint8Array,signatures:Array.isArray(e?.signatures)?e.signatures.map(e=>S(e)):[]}},toJSON(e){let t={};return e.bodyBytes!==void 0&&(t.bodyBytes=w(e.bodyBytes===void 0?new Uint8Array:e.bodyBytes)),e.authInfoBytes!==void 0&&(t.authInfoBytes=w(e.authInfoBytes===void 0?new Uint8Array:e.authInfoBytes)),e.signatures?t.signatures=e.signatures.map(e=>w(e===void 0?new Uint8Array:e)):t.signatures=[],t},fromPartial(e){let t=l();return t.bodyBytes=e.bodyBytes??new Uint8Array,t.authInfoBytes=e.authInfoBytes??new Uint8Array,t.signatures=e.signatures?.map(e=>e)||[],t}};function u(){return{bodyBytes:new Uint8Array,authInfoBytes:new Uint8Array,chainId:``,accountNumber:`0`}}e.SignDoc={encode(e,t=r.default.Writer.create()){return e.bodyBytes.length!==0&&t.uint32(10).bytes(e.bodyBytes),e.authInfoBytes.length!==0&&t.uint32(18).bytes(e.authInfoBytes),e.chainId!==``&&t.uint32(26).string(e.chainId),e.accountNumber!==`0`&&t.uint32(32).uint64(e.accountNumber),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=u();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.bodyBytes=n.bytes();break;case 2:a.authInfoBytes=n.bytes();break;case 3:a.chainId=n.string();break;case 4:a.accountNumber=T(n.uint64());break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{bodyBytes:E(e.bodyBytes)?S(e.bodyBytes):new Uint8Array,authInfoBytes:E(e.authInfoBytes)?S(e.authInfoBytes):new Uint8Array,chainId:E(e.chainId)?String(e.chainId):``,accountNumber:E(e.accountNumber)?String(e.accountNumber):`0`}},toJSON(e){let t={};return e.bodyBytes!==void 0&&(t.bodyBytes=w(e.bodyBytes===void 0?new Uint8Array:e.bodyBytes)),e.authInfoBytes!==void 0&&(t.authInfoBytes=w(e.authInfoBytes===void 0?new Uint8Array:e.authInfoBytes)),e.chainId!==void 0&&(t.chainId=e.chainId),e.accountNumber!==void 0&&(t.accountNumber=e.accountNumber),t},fromPartial(e){let t=u();return t.bodyBytes=e.bodyBytes??new Uint8Array,t.authInfoBytes=e.authInfoBytes??new Uint8Array,t.chainId=e.chainId??``,t.accountNumber=e.accountNumber??`0`,t}};function d(){return{messages:[],memo:``,timeoutHeight:`0`,extensionOptions:[],nonCriticalExtensionOptions:[]}}e.TxBody={encode(e,t=r.default.Writer.create()){for(let n of e.messages)a.Any.encode(n,t.uint32(10).fork()).ldelim();e.memo!==``&&t.uint32(18).string(e.memo),e.timeoutHeight!==`0`&&t.uint32(24).uint64(e.timeoutHeight);for(let n of e.extensionOptions)a.Any.encode(n,t.uint32(8186).fork()).ldelim();for(let n of e.nonCriticalExtensionOptions)a.Any.encode(n,t.uint32(16378).fork()).ldelim();return t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,o=d();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:o.messages.push(a.Any.decode(n,n.uint32()));break;case 2:o.memo=n.string();break;case 3:o.timeoutHeight=T(n.uint64());break;case 1023:o.extensionOptions.push(a.Any.decode(n,n.uint32()));break;case 2047:o.nonCriticalExtensionOptions.push(a.Any.decode(n,n.uint32()));break;default:n.skipType(e&7);break}}return o},fromJSON(e){return{messages:Array.isArray(e?.messages)?e.messages.map(e=>a.Any.fromJSON(e)):[],memo:E(e.memo)?String(e.memo):``,timeoutHeight:E(e.timeoutHeight)?String(e.timeoutHeight):`0`,extensionOptions:Array.isArray(e?.extensionOptions)?e.extensionOptions.map(e=>a.Any.fromJSON(e)):[],nonCriticalExtensionOptions:Array.isArray(e?.nonCriticalExtensionOptions)?e.nonCriticalExtensionOptions.map(e=>a.Any.fromJSON(e)):[]}},toJSON(e){let t={};return e.messages?t.messages=e.messages.map(e=>e?a.Any.toJSON(e):void 0):t.messages=[],e.memo!==void 0&&(t.memo=e.memo),e.timeoutHeight!==void 0&&(t.timeoutHeight=e.timeoutHeight),e.extensionOptions?t.extensionOptions=e.extensionOptions.map(e=>e?a.Any.toJSON(e):void 0):t.extensionOptions=[],e.nonCriticalExtensionOptions?t.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions.map(e=>e?a.Any.toJSON(e):void 0):t.nonCriticalExtensionOptions=[],t},fromPartial(e){let t=d();return t.messages=e.messages?.map(e=>a.Any.fromPartial(e))||[],t.memo=e.memo??``,t.timeoutHeight=e.timeoutHeight??`0`,t.extensionOptions=e.extensionOptions?.map(e=>a.Any.fromPartial(e))||[],t.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions?.map(e=>a.Any.fromPartial(e))||[],t}};function f(){return{signerInfos:[],fee:void 0}}e.AuthInfo={encode(t,n=r.default.Writer.create()){for(let r of t.signerInfos)e.SignerInfo.encode(r,n.uint32(10).fork()).ldelim();return t.fee!==void 0&&e.Fee.encode(t.fee,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=f();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.signerInfos.push(e.SignerInfo.decode(i,i.uint32()));break;case 2:o.fee=e.Fee.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{signerInfos:Array.isArray(t?.signerInfos)?t.signerInfos.map(t=>e.SignerInfo.fromJSON(t)):[],fee:E(t.fee)?e.Fee.fromJSON(t.fee):void 0}},toJSON(t){let n={};return t.signerInfos?n.signerInfos=t.signerInfos.map(t=>t?e.SignerInfo.toJSON(t):void 0):n.signerInfos=[],t.fee!==void 0&&(n.fee=t.fee?e.Fee.toJSON(t.fee):void 0),n},fromPartial(t){let n=f();return n.signerInfos=t.signerInfos?.map(t=>e.SignerInfo.fromPartial(t))||[],n.fee=t.fee!==void 0&&t.fee!==null?e.Fee.fromPartial(t.fee):void 0,n}};function p(){return{publicKey:void 0,modeInfo:void 0,sequence:`0`}}e.SignerInfo={encode(t,n=r.default.Writer.create()){return t.publicKey!==void 0&&a.Any.encode(t.publicKey,n.uint32(10).fork()).ldelim(),t.modeInfo!==void 0&&e.ModeInfo.encode(t.modeInfo,n.uint32(18).fork()).ldelim(),t.sequence!==`0`&&n.uint32(24).uint64(t.sequence),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),o=n===void 0?i.len:i.pos+n,s=p();for(;i.pos<o;){let t=i.uint32();switch(t>>>3){case 1:s.publicKey=a.Any.decode(i,i.uint32());break;case 2:s.modeInfo=e.ModeInfo.decode(i,i.uint32());break;case 3:s.sequence=T(i.uint64());break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{publicKey:E(t.publicKey)?a.Any.fromJSON(t.publicKey):void 0,modeInfo:E(t.modeInfo)?e.ModeInfo.fromJSON(t.modeInfo):void 0,sequence:E(t.sequence)?String(t.sequence):`0`}},toJSON(t){let n={};return t.publicKey!==void 0&&(n.publicKey=t.publicKey?a.Any.toJSON(t.publicKey):void 0),t.modeInfo!==void 0&&(n.modeInfo=t.modeInfo?e.ModeInfo.toJSON(t.modeInfo):void 0),t.sequence!==void 0&&(n.sequence=t.sequence),n},fromPartial(t){let n=p();return n.publicKey=t.publicKey!==void 0&&t.publicKey!==null?a.Any.fromPartial(t.publicKey):void 0,n.modeInfo=t.modeInfo!==void 0&&t.modeInfo!==null?e.ModeInfo.fromPartial(t.modeInfo):void 0,n.sequence=t.sequence??`0`,n}};function g(){return{single:void 0,multi:void 0}}e.ModeInfo={encode(t,n=r.default.Writer.create()){return t.single!==void 0&&e.ModeInfo_Single.encode(t.single,n.uint32(10).fork()).ldelim(),t.multi!==void 0&&e.ModeInfo_Multi.encode(t.multi,n.uint32(18).fork()).ldelim(),n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,o=g();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:o.single=e.ModeInfo_Single.decode(i,i.uint32());break;case 2:o.multi=e.ModeInfo_Multi.decode(i,i.uint32());break;default:i.skipType(t&7);break}}return o},fromJSON(t){return{single:E(t.single)?e.ModeInfo_Single.fromJSON(t.single):void 0,multi:E(t.multi)?e.ModeInfo_Multi.fromJSON(t.multi):void 0}},toJSON(t){let n={};return t.single!==void 0&&(n.single=t.single?e.ModeInfo_Single.toJSON(t.single):void 0),t.multi!==void 0&&(n.multi=t.multi?e.ModeInfo_Multi.toJSON(t.multi):void 0),n},fromPartial(t){let n=g();return n.single=t.single!==void 0&&t.single!==null?e.ModeInfo_Single.fromPartial(t.single):void 0,n.multi=t.multi!==void 0&&t.multi!==null?e.ModeInfo_Multi.fromPartial(t.multi):void 0,n}};function _(){return{mode:0}}e.ModeInfo_Single={encode(e,t=r.default.Writer.create()){return e.mode!==0&&t.uint32(8).int32(e.mode),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=_();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.mode=n.int32();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{mode:E(e.mode)?(0,i.signModeFromJSON)(e.mode):0}},toJSON(e){let t={};return e.mode!==void 0&&(t.mode=(0,i.signModeToJSON)(e.mode)),t},fromPartial(e){let t=_();return t.mode=e.mode??0,t}};function v(){return{bitarray:void 0,modeInfos:[]}}e.ModeInfo_Multi={encode(t,n=r.default.Writer.create()){t.bitarray!==void 0&&o.CompactBitArray.encode(t.bitarray,n.uint32(10).fork()).ldelim();for(let r of t.modeInfos)e.ModeInfo.encode(r,n.uint32(18).fork()).ldelim();return n},decode(t,n){let i=t instanceof r.default.Reader?t:new r.default.Reader(t),a=n===void 0?i.len:i.pos+n,s=v();for(;i.pos<a;){let t=i.uint32();switch(t>>>3){case 1:s.bitarray=o.CompactBitArray.decode(i,i.uint32());break;case 2:s.modeInfos.push(e.ModeInfo.decode(i,i.uint32()));break;default:i.skipType(t&7);break}}return s},fromJSON(t){return{bitarray:E(t.bitarray)?o.CompactBitArray.fromJSON(t.bitarray):void 0,modeInfos:Array.isArray(t?.modeInfos)?t.modeInfos.map(t=>e.ModeInfo.fromJSON(t)):[]}},toJSON(t){let n={};return t.bitarray!==void 0&&(n.bitarray=t.bitarray?o.CompactBitArray.toJSON(t.bitarray):void 0),t.modeInfos?n.modeInfos=t.modeInfos.map(t=>t?e.ModeInfo.toJSON(t):void 0):n.modeInfos=[],n},fromPartial(t){let n=v();return n.bitarray=t.bitarray!==void 0&&t.bitarray!==null?o.CompactBitArray.fromPartial(t.bitarray):void 0,n.modeInfos=t.modeInfos?.map(t=>e.ModeInfo.fromPartial(t))||[],n}};function y(){return{amount:[],gasLimit:`0`,payer:``,granter:``}}e.Fee={encode(e,t=r.default.Writer.create()){for(let n of e.amount)s.Coin.encode(n,t.uint32(10).fork()).ldelim();return e.gasLimit!==`0`&&t.uint32(16).uint64(e.gasLimit),e.payer!==``&&t.uint32(26).string(e.payer),e.granter!==``&&t.uint32(34).string(e.granter),t},decode(e,t){let n=e instanceof r.default.Reader?e:new r.default.Reader(e),i=t===void 0?n.len:n.pos+t,a=y();for(;n.pos<i;){let e=n.uint32();switch(e>>>3){case 1:a.amount.push(s.Coin.decode(n,n.uint32()));break;case 2:a.gasLimit=T(n.uint64());break;case 3:a.payer=n.string();break;case 4:a.granter=n.string();break;default:n.skipType(e&7);break}}return a},fromJSON(e){return{amount:Array.isArray(e?.amount)?e.amount.map(e=>s.Coin.fromJSON(e)):[],gasLimit:E(e.gasLimit)?String(e.gasLimit):`0`,payer:E(e.payer)?String(e.payer):``,granter:E(e.granter)?String(e.granter):``}},toJSON(e){let t={};return e.amount?t.amount=e.amount.map(e=>e?s.Coin.toJSON(e):void 0):t.amount=[],e.gasLimit!==void 0&&(t.gasLimit=e.gasLimit),e.payer!==void 0&&(t.payer=e.payer),e.granter!==void 0&&(t.granter=e.granter),t},fromPartial(e){let t=y();return t.amount=e.amount?.map(e=>s.Coin.fromPartial(e))||[],t.gasLimit=e.gasLimit??`0`,t.payer=e.payer??``,t.granter=e.granter??``,t}};var b=(()=>{if(b!==void 0)return b;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(h!==void 0)return h;throw`Unable to locate global object`})(),x=b.atob||(e=>b.Buffer.from(e,`base64`).toString(`binary`));function S(e){let t=x(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}var C=b.btoa||(e=>b.Buffer.from(e,`binary`).toString(`base64`));function w(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return C(t.join(``))}function T(e){return e.toString()}r.default.util.Long!==n.default&&(r.default.util.Long=n.default,r.default.configure());function E(e){return e!=null}})),Sc=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ProtoSignDocDecoder=void 0;var t=xc(),n=vc();e.ProtoSignDocDecoder=class e{static decode(n){return new e(t.SignDoc.decode(n))}constructor(e,t=n.defaultProtoCodec){this.signDoc=e,this.protoCodec=t}get txBody(){return this._txBody||=t.TxBody.decode(this.signDoc.bodyBytes),this._txBody}get txMsgs(){let e=[];for(let t of this.txBody.messages)e.push(this.protoCodec.unpackAny(t));return e}get authInfo(){return this._authInfo||=t.AuthInfo.decode(this.signDoc.authInfoBytes),this._authInfo}get chainId(){return this.signDoc.chainId}get accountNumber(){return this.signDoc.accountNumber.toString()}toBytes(){return t.SignDoc.encode(this.signDoc).finish()}toJSON(){return{txBody:Object.assign(Object.assign({},t.TxBody.toJSON(this.txBody)),{messages:this.txMsgs.map(e=>this.protoCodec.unpackedAnyToJSONRecursive(e))}),authInfo:t.AuthInfo.toJSON(this.authInfo),chainId:this.chainId,accountNumber:this.accountNumber}}}})),Cc=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),wc=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.BaseKVStore=void 0,e.BaseKVStore=class{constructor(e,t){this.provider=e,this._prefix=t}get(e){return t(this,void 0,void 0,function*(){let t=this.prefix()+`/`+e;return(yield this.provider.get())[t]})}set(e,t){let n=this.prefix()+`/`+e;return this.provider.set({[n]:t})}prefix(){return this._prefix}}})),Tc=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.ExtensionKVStore=void 0;var n=wc();e.ExtensionKVStore=class e extends n.BaseKVStore{constructor(t){if(e.KVStoreProvider||typeof browser>`u`||!browser.storage||!browser.storage.local||(e.KVStoreProvider={get:browser.storage.local.get,set:browser.storage.local.set,multiGet:browser.storage.local.get}),!e.KVStoreProvider)throw Error(`Can't initialize kv store for browser extension`);super(e.KVStoreProvider,t)}multiGet(n){return t(this,void 0,void 0,function*(){n=Array.from(new Set(n));let t=(yield e.KVStoreProvider.multiGet(n.map(e=>this.prefix()+`/`+e)))??{},r=Object.keys(t);for(let e of r){let n=e.slice(this.prefix().length+1);t[n]=t[e],delete t[e]}return t})}}})),Ec=a((e=>{s(),Object.defineProperty(e,`__esModule`,{value:!0}),e.MemoryKVStore=void 0;var t=wc(),n=class{constructor(){this.store={}}get(){return Promise.resolve(this.store)}set(e){return this.store=Object.assign(Object.assign({},this.store),e),Promise.resolve()}checkNotPrimitiveField(e){Object.keys(e).forEach(t=>{let n=e[t];if(typeof n==`object`&&n){if(n.constructor!==Object&&n.constructor!==Array)throw Error(`${t} may not be serializable: ${n.constructor.name}`);this.checkNotPrimitiveField(n)}})}};e.MemoryKVStore=class extends t.BaseKVStore{constructor(e){super(new n,e)}}})),Dc=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.LocalKVStore=void 0,e.LocalKVStore=class{constructor(e){this._prefix=e}get(e){let t=this.prefix()+`/`+e,n=localStorage.getItem(t);return n===null?Promise.resolve(void 0):Promise.resolve(JSON.parse(n))}set(e,t){let n=this.prefix()+`/`+e;return t===null?Promise.resolve(localStorage.removeItem(n)):Promise.resolve(localStorage.setItem(n,JSON.stringify(t)))}prefix(){return this._prefix}}})),Oc=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.IndexedDBKVStore=void 0,e.IndexedDBKVStore=class{constructor(e){this._prefix=e}get(e){return t(this,void 0,void 0,function*(){let t=(yield this.getDB()).transaction([this.prefix()],`readonly`).objectStore(this.prefix());return new Promise((n,r)=>{let i=t.get(e);i.onerror=e=>{e.stopPropagation(),r(e.target)},i.onsuccess=()=>{i.result?n(i.result.data):n(void 0)}})})}set(e,n){return t(this,void 0,void 0,function*(){if(n===null){let t=(yield this.getDB()).transaction([this.prefix()],`readwrite`).objectStore(this.prefix());return new Promise((n,r)=>{let i=t.delete(e);i.onerror=e=>{e.stopPropagation(),r(e.target)},i.onsuccess=()=>{n()}})}else{let t=(yield this.getDB()).transaction([this.prefix()],`readwrite`).objectStore(this.prefix());return new Promise((r,i)=>{let a=t.put({key:e,data:n});a.onerror=e=>{e.stopPropagation(),i(e.target)},a.onsuccess=()=>{r()}})}})}prefix(){return this._prefix}getDB(){return t(this,void 0,void 0,function*(){return this.cachedDB?this.cachedDB:new Promise((e,t)=>{let n=window.indexedDB.open(this.prefix());n.onerror=e=>{e.stopPropagation(),t(e.target)},n.onupgradeneeded=e=>{e.target.result.createObjectStore(this.prefix(),{keyPath:`key`})},n.onsuccess=()=>{this.cachedDB=n.result,e(n.result)}})})}}})),kc=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.PrefixKVStore=void 0,e.PrefixKVStore=class{constructor(e,t){this.kvStore=e,this._prefix=t}prefix(){return this._prefix}get(e){return t(this,void 0,void 0,function*(){let t=this.prefix()+`/`+e;return yield this.kvStore.get(t)})}set(e,n){return t(this,void 0,void 0,function*(){let t=this.prefix()+`/`+e;return yield this.kvStore.set(t,n)})}}})),Ac=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.WrapMultiGetKVStore=void 0,e.WrapMultiGetKVStore=class{constructor(e){this.kvStore=e}multiGet(e){return t(this,void 0,void 0,function*(){e=Array.from(new Set(e));let n={},r=[];for(let i of e)r.push(t(this,void 0,void 0,function*(){n[i]=yield this.kvStore.get(i)}));return yield Promise.all(r),n})}}})),jc=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(Cc(),e),n(Tc(),e),n(wc(),e),n(Ec(),e),n(Dc(),e),n(Oc(),e),n(kc(),e),n(Ac(),e)})),Mc=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=E(),n=k();function r(e){let n=t(`sha256`).update(e).digest();try{return t(`rmd160`).update(n).digest()}catch{return t(`ripemd160`).update(n).digest()}}e.hash160=r;function i(e,t){return n(`sha512`,e).update(t).digest()}e.hmacSHA512=i})),Nc=a(((e,t)=>{_();var n=k(),r=y.alloc(1,1),i=y.alloc(1,0);function a(e,t,a,o,s){let c=y.alloc(32,0),l=y.alloc(32,1);c=n(`sha256`,c).update(l).update(i).update(t).update(e).update(s||``).digest(),l=n(`sha256`,c).update(l).digest(),c=n(`sha256`,c).update(l).update(r).update(t).update(e).update(s||``).digest(),l=n(`sha256`,c).update(l).digest(),l=n(`sha256`,c).update(l).digest();let u=l;for(;!o(u)||!a(u);)c=n(`sha256`,c).update(l).update(i).digest(),l=n(`sha256`,c).update(l).digest(),l=n(`sha256`,c).update(l).digest(),u=l;return u}t.exports=a})),Pc=a(((e,t)=>{_();var n=O(),r=j().ec,i=new r(`secp256k1`),a=Nc(),o=y.alloc(32,0),s=y.from(`fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141`,`hex`),c=y.from(`fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f`,`hex`),l=i.curve.n,u=l.shrn(1),d=i.curve.g,f=`Expected Private`,p=`Expected Point`,m=`Expected Tweak`,h=`Expected Hash`,g=`Expected Signature`,v=`Expected Extra Data (32 bytes)`;function b(e){return e instanceof Uint8Array&&e.length===32}function x(e){return b(e)?s.compare(e)>0:!1}function S(e){if(!(e instanceof Uint8Array)||e.length<33)return!1;let t=e[0],n=e.subarray(1,33);if(o.compare(n)===0||c.compare(n)<=0)return!1;if((t===2||t===3)&&e.length===33){try{M(e)}catch{return!1}return!0}let r=e.subarray(33);return o.compare(r)===0||c.compare(r)<=0?!1:t===4&&e.length===65}function C(e){return e[0]!==4}function w(e){return S(e)?C(e):!1}function T(e){return b(e)?o.compare(e)<0&&s.compare(e)>0:!1}function E(e){let t=e.subarray(0,32),n=e.subarray(32,64);return e instanceof Uint8Array&&e.length===64&&s.compare(t)>0&&s.compare(n)>0}function D(e,t){return e===void 0&&t!==void 0?C(t):e===void 0?!0:e}function k(e){return new n(e)}function A(e){return e.toArrayLike(y,`be`,32)}function M(e){return i.curve.decodePoint(e)}function N(e,t){return y.from(e._encode(t))}function P(e,t,n){if(!S(e)||!S(t))throw TypeError(p);let r=M(e),i=M(t),a=r.add(i);return a.isInfinity()?null:N(a,D(n,e))}function F(e,t,n){if(!S(e))throw TypeError(p);if(!x(t))throw TypeError(m);let r=D(n,e),i=M(e);if(o.compare(t)===0)return N(i,r);let a=k(t),s=d.mul(a),c=i.add(s);return c.isInfinity()?null:N(c,r)}function I(e,t){if(!S(e))throw TypeError(p);let n=M(e);if(n.isInfinity())throw TypeError(p);return N(n,D(t,e))}function L(e,t){if(!T(e))throw TypeError(f);let n=k(e),r=d.mul(n);return r.isInfinity()?null:N(r,D(t))}function R(e,t,n){if(!S(e))throw TypeError(p);if(!x(t))throw TypeError(m);let r=D(n,e),i=M(e),a=k(t),o=i.mul(a);return o.isInfinity()?null:N(o,r)}function ee(e,t){if(!T(e))throw TypeError(f);if(!x(t))throw TypeError(m);let n=k(e),r=k(t),i=A(n.add(r).umod(l));return T(i)?i:null}function te(e,t){if(!T(e))throw TypeError(f);if(!x(t))throw TypeError(m);let n=k(e),r=k(t),i=A(n.sub(r).umod(l));return T(i)?i:null}function ne(e,t){return ie(e,t)}function re(e,t,n){return ie(e,t,n)}function ie(e,t,n){if(!b(e))throw TypeError(h);if(!T(t))throw TypeError(f);if(n!==void 0&&!b(n))throw TypeError(v);let r=k(t),i=k(e),o,s;a(e,t,function(e){let t=k(e),n=d.mul(t);return!(n.isInfinity()||(o=n.x.umod(l),o.isZero()===0)||(s=t.invm(l).mul(i.add(r.mul(o))).umod(l),s.isZero()===0))},T,n),s.cmp(u)>0&&(s=l.sub(s));let c=y.allocUnsafe(64);return A(o).copy(c,0),A(s).copy(c,32),c}function ae(e,t,n,r){if(!b(e))throw TypeError(h);if(!S(t))throw TypeError(p);if(!E(n))throw TypeError(g);let i=M(t),a=k(n.subarray(0,32)),o=k(n.subarray(32,64));if(r&&o.cmp(u)>0||a.gtn(0)<=0||o.gtn(0)<=0)return!1;let s=k(e),c=o.invm(l),f=s.mul(c).umod(l),m=a.mul(c).umod(l),_=d.mulAdd(f,i,m);return _.isInfinity()?!1:_.x.umod(l).eq(a)}t.exports={isPoint:S,isPointCompressed:w,isPrivate:T,pointAdd:P,pointAddScalar:F,pointCompress:I,pointFromScalar:L,pointMultiply:R,privateAdd:ee,privateSub:te,sign:ne,signWithEntropy:re,verify:ae}})),Fc=a(((e,t)=>{var n={Array:function(e){return e!=null&&e.constructor===Array},Boolean:function(e){return typeof e==`boolean`},Function:function(e){return typeof e==`function`},Nil:function(e){return e==null},Number:function(e){return typeof e==`number`},Object:function(e){return typeof e==`object`},String:function(e){return typeof e==`string`},"":function(){return!0}};for(var r in n.Null=n.Nil,n)n[r].toJSON=function(e){return e}.bind(null,r);t.exports=n})),Ic=a(((e,t)=>{var n=Fc();function r(e){return e.name||e.toString().match(/function (.*?)\s*\(/)[1]}function i(e){return n.Nil(e)?``:r(e.constructor)}function a(e){return n.Function(e)?``:n.String(e)?JSON.stringify(e):e&&n.Object(e)?``:e}function o(e,t){Error.captureStackTrace&&Error.captureStackTrace(e,t)}function s(e){return n.Function(e)?e.toJSON?e.toJSON():r(e):n.Array(e)?`Array`:e&&n.Object(e)?`Object`:e===void 0?``:e}function c(e,t,n){var r=a(t);return`Expected `+s(e)+`, got`+(n===``?``:` `+n)+(r===``?``:` `+r)}function l(e,t,n){n||=i(t),this.message=c(e,t,n),o(this,l),this.__type=e,this.__value=t,this.__valueTypeName=n}l.prototype=Object.create(Error.prototype),l.prototype.constructor=l;function u(e,t,n,r,i){var a=`" of type `;return t===`key`&&(a=`" with key type `),c(`property "`+s(n)+a+s(e),r,i)}function d(e,t,n,r,a){e?(a||=i(r),this.message=u(e,n,t,r,a)):this.message=`Unexpected property "`+t+`"`,o(this,l),this.__label=n,this.__property=t,this.__type=e,this.__value=r,this.__valueTypeName=a}d.prototype=Object.create(Error.prototype),d.prototype.constructor=l;function f(e,t){return new l(e,{},t)}function p(e,t,n){return e instanceof d?(t=t+`.`+e.__property,e=new d(e.__type,t,e.__label,e.__value,e.__valueTypeName)):e instanceof l&&(e=new d(e.__type,t,n,e.__value,e.__valueTypeName)),o(e),e}t.exports={TfTypeError:l,TfPropertyTypeError:d,tfCustomError:f,tfSubError:p,tfJSON:s,getValueTypeName:i}})),Lc=a(((e,t)=>{_();var n=Fc(),r=Ic();function i(e){return y.isBuffer(e)}function a(e){return typeof e==`string`&&/^([0-9a-f]{2})+$/i.test(e)}function o(e,t){var n=e.toJSON();function i(i){if(!e(i))return!1;if(i.length===t)return!0;throw r.tfCustomError(n+`(Length: `+t+`)`,n+`(Length: `+i.length+`)`)}return i.toJSON=function(){return n},i}var s=o.bind(null,n.Array),c=o.bind(null,i),l=o.bind(null,a),u=o.bind(null,n.String);function d(e,t,r){r||=n.Number;function i(n,i){return r(n,i)&&n>e&&n<t}return i.toJSON=function(){return`${r.toJSON()} between [${e}, ${t}]`},i}var f=2**53-1;function p(e){return typeof e==`number`&&isFinite(e)}function m(e){return e<<24>>24===e}function h(e){return e<<16>>16===e}function g(e){return(e|0)===e}function v(e){return typeof e==`number`&&e>=-f&&e<=f&&Math.floor(e)===e}function b(e){return(e&255)===e}function x(e){return(e&65535)===e}function S(e){return e>>>0===e}function C(e){return typeof e==`number`&&e>=0&&e<=f&&Math.floor(e)===e}var w={ArrayN:s,Buffer:i,BufferN:c,Finite:p,Hex:a,HexN:l,Int8:m,Int16:h,Int32:g,Int53:v,Range:d,StringN:u,UInt8:b,UInt16:x,UInt32:S,UInt53:C};for(var T in w)w[T].toJSON=function(e){return e}.bind(null,T);t.exports=w})),Rc=a(((e,t)=>{var n=Ic(),r=Fc(),i=n.tfJSON,a=n.TfTypeError,o=n.TfPropertyTypeError,s=n.tfSubError,c=n.getValueTypeName,l={arrayOf:function(e,t){e=u(e),t||={};function n(n,i){return!r.Array(n)||r.Nil(n)||t.minLength!==void 0&&n.length<t.minLength||t.maxLength!==void 0&&n.length>t.maxLength||t.length!==void 0&&n.length!==t.length?!1:n.every(function(t,n){try{return d(e,t,i)}catch(e){throw s(e,n)}})}return n.toJSON=function(){var n=`[`+i(e)+`]`;return t.length===void 0?(t.minLength!==void 0||t.maxLength!==void 0)&&(n+=`{`+(t.minLength===void 0?0:t.minLength)+`,`+(t.maxLength===void 0?1/0:t.maxLength)+`}`):n+=`{`+t.length+`}`,n},n},maybe:function e(t){t=u(t);function n(n,i){return r.Nil(n)||t(n,i,e)}return n.toJSON=function(){return`?`+i(t)},n},map:function(e,t){e=u(e),t&&=u(t);function n(n,i){if(!r.Object(n)||r.Nil(n))return!1;for(var a in n){try{t&&d(t,a,i)}catch(e){throw s(e,a,`key`)}try{var o=n[a];d(e,o,i)}catch(e){throw s(e,a)}}return!0}return t?n.toJSON=function(){return`{`+i(t)+`: `+i(e)+`}`}:n.toJSON=function(){return`{`+i(e)+`}`},n},object:function(e){var t={};for(var n in e)t[n]=u(e[n]);function a(e,n){if(!r.Object(e)||r.Nil(e))return!1;var i;try{for(i in t){var a=t[i],c=e[i];d(a,c,n)}}catch(e){throw s(e,i)}if(n){for(i in e)if(!t[i])throw new o(void 0,i)}return!0}return a.toJSON=function(){return i(t)},a},anyOf:function(){var e=[].slice.call(arguments).map(u);function t(t,n){return e.some(function(e){try{return d(e,t,n)}catch{return!1}})}return t.toJSON=function(){return e.map(i).join(`|`)},t},allOf:function(){var e=[].slice.call(arguments).map(u);function t(t,n){return e.every(function(e){try{return d(e,t,n)}catch{return!1}})}return t.toJSON=function(){return e.map(i).join(` & `)},t},quacksLike:function(e){function t(t){return e===c(t)}return t.toJSON=function(){return e},t},tuple:function(){var e=[].slice.call(arguments).map(u);function t(t,n){return r.Nil(t)||r.Nil(t.length)||n&&t.length!==e.length?!1:e.every(function(e,r){try{return d(e,t[r],n)}catch(e){throw s(e,r)}})}return t.toJSON=function(){return`(`+e.map(i).join(`, `)+`)`},t},value:function(e){function t(t){return t===e}return t.toJSON=function(){return e},t}};l.oneOf=l.anyOf;function u(e){if(r.String(e))return e[0]===`?`?l.maybe(e.slice(1)):r[e]||l.quacksLike(e);if(e&&r.Object(e)){if(r.Array(e)){if(e.length!==1)throw TypeError(`Expected compile() parameter of type Array of length 1`);return l.arrayOf(e[0])}return l.object(e)}else if(r.Function(e))return e;return l.value(e)}function d(e,t,n,i){if(r.Function(e)){if(e(t,n))return!0;throw new a(i||e,t)}return d(u(e),t,n)}for(var f in r)d[f]=r[f];for(f in l)d[f]=l[f];var p=Lc();for(f in p)d[f]=p[f];d.compile=u,d.TfTypeError=a,d.TfPropertyTypeError=o,t.exports=d})),zc=a(((e,t)=>{_();var n=Qn();function r(e,t){if(t!==void 0&&e[0]!==t)throw Error(`Invalid network version`);if(e.length===33)return{version:e[0],privateKey:e.slice(1,33),compressed:!1};if(e.length!==34)throw Error(`Invalid WIF length`);if(e[33]!==1)throw Error(`Invalid compression flag`);return{version:e[0],privateKey:e.slice(1,33),compressed:!0}}function i(e,t,n){var r=new y(n?34:33);return r.writeUInt8(e,0),t.copy(r,1),n&&(r[33]=1),r}function a(e,t){return r(n.decode(e),t)}function o(e,t,r){return typeof e==`number`?n.encode(i(e,t,r)):n.encode(i(e.version,e.privateKey,e.compressed))}t.exports={decode:a,decodeRaw:r,encode:o,encodeRaw:i}})),Bc=a((e=>{_(),Object.defineProperty(e,`__esModule`,{value:!0});var t=Mc(),n=Qn(),r=Pc(),i=Rc(),a=zc(),o=i.BufferN(32),s=i.compile({wif:i.UInt8,bip32:{public:i.UInt32,private:i.UInt32}}),c={messagePrefix:`Bitcoin Signed Message:
3
3
  `,bech32:`bc`,bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},l=2147483648,u=2**31-1;function d(e){return i.String(e)&&e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)!==null}function f(e){return i.UInt32(e)&&e<=u}var p=class{constructor(e,t,n,r,a=0,o=0,c=0){this.__D=e,this.__Q=t,this.chainCode=n,this.network=r,this.__DEPTH=a,this.__INDEX=o,this.__PARENT_FINGERPRINT=c,i(s,r),this.lowR=!1}get depth(){return this.__DEPTH}get index(){return this.__INDEX}get parentFingerprint(){return this.__PARENT_FINGERPRINT}get publicKey(){return this.__Q===void 0&&(this.__Q=r.pointFromScalar(this.__D,!0)),this.__Q}get privateKey(){return this.__D}get identifier(){return t.hash160(this.publicKey)}get fingerprint(){return this.identifier.slice(0,4)}get compressed(){return!0}isNeutered(){return this.__D===void 0}neutered(){return b(this.publicKey,this.chainCode,this.network,this.depth,this.index,this.parentFingerprint)}toBase58(){let e=this.network,t=this.isNeutered()?e.bip32.public:e.bip32.private,r=y.allocUnsafe(78);return r.writeUInt32BE(t,0),r.writeUInt8(this.depth,4),r.writeUInt32BE(this.parentFingerprint,5),r.writeUInt32BE(this.index,9),this.chainCode.copy(r,13),this.isNeutered()?this.publicKey.copy(r,45):(r.writeUInt8(0,45),this.privateKey.copy(r,46)),n.encode(r)}toWIF(){if(!this.privateKey)throw TypeError(`Missing private key`);return a.encode(this.network.wif,this.privateKey,!0)}derive(e){i(i.UInt32,e);let n=e>=l,a=y.allocUnsafe(37);if(n){if(this.isNeutered())throw TypeError(`Missing private key for hardened child key`);a[0]=0,this.privateKey.copy(a,1),a.writeUInt32BE(e,33)}else this.publicKey.copy(a,0),a.writeUInt32BE(e,33);let o=t.hmacSHA512(this.chainCode,a),s=o.slice(0,32),c=o.slice(32);if(!r.isPrivate(s))return this.derive(e+1);let u;if(this.isNeutered()){let t=r.pointAddScalar(this.publicKey,s,!0);if(t===null)return this.derive(e+1);u=b(t,c,this.network,this.depth+1,e,this.fingerprint.readUInt32BE(0))}else{let t=r.privateAdd(this.privateKey,s);if(t==null)return this.derive(e+1);u=g(t,c,this.network,this.depth+1,e,this.fingerprint.readUInt32BE(0))}return u}deriveHardened(e){return i(f,e),this.derive(e+l)}derivePath(e){i(d,e);let t=e.split(`/`);if(t[0]===`m`){if(this.parentFingerprint)throw TypeError(`Expected master, got child`);t=t.slice(1)}return t.reduce((e,t)=>{let n;return t.slice(-1)===`'`?(n=parseInt(t.slice(0,-1),10),e.deriveHardened(n)):(n=parseInt(t,10),e.derive(n))},this)}sign(e,t){if(!this.privateKey)throw Error(`Missing private key`);if(t===void 0&&(t=this.lowR),t===!1)return r.sign(e,this.privateKey);{let t=r.sign(e,this.privateKey),n=y.alloc(32,0),i=0;for(;t[0]>127;)i++,n.writeUIntLE(i,0,6),t=r.signWithEntropy(e,this.privateKey,n);return t}}verify(e,t){return r.verify(e,this.publicKey,t)}};function m(e,t){let r=n.decode(e);if(r.length!==78)throw TypeError(`Invalid buffer length`);t||=c;let i=r.readUInt32BE(0);if(i!==t.bip32.private&&i!==t.bip32.public)throw TypeError(`Invalid network version`);let a=r[4],o=r.readUInt32BE(5);if(a===0&&o!==0)throw TypeError(`Invalid parent fingerprint`);let s=r.readUInt32BE(9);if(a===0&&s!==0)throw TypeError(`Invalid index`);let l=r.slice(13,45),u;if(i===t.bip32.private){if(r.readUInt8(45)!==0)throw TypeError(`Invalid private key`);u=g(r.slice(46,78),l,t,a,s,o)}else u=b(r.slice(45,78),l,t,a,s,o);return u}e.fromBase58=m;function h(e,t,n){return g(e,t,n)}e.fromPrivateKey=h;function g(e,t,n,a,s,l){if(i({privateKey:o,chainCode:o},{privateKey:e,chainCode:t}),n||=c,!r.isPrivate(e))throw TypeError(`Private key not in range [1, n)`);return new p(e,void 0,t,n,a,s,l)}function v(e,t,n){return b(e,t,n)}e.fromPublicKey=v;function b(e,t,n,a,s,l){if(i({publicKey:i.BufferN(33),chainCode:o},{publicKey:e,chainCode:t}),n||=c,!r.isPoint(e))throw TypeError(`Point is not on the curve`);return new p(void 0,e,t,n,a,s,l)}function x(e,n){if(i(i.Buffer,e),e.length<16)throw TypeError(`Seed should be at least 128 bits`);if(e.length>64)throw TypeError(`Seed should be at most 512 bits`);n||=c;let r=t.hmacSHA512(y.from(`Bitcoin seed`,`utf8`),e);return h(r.slice(0,32),r.slice(32),n)}e.fromSeed=x})),Vc=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Bc();e.fromSeed=t.fromSeed,e.fromBase58=t.fromBase58,e.fromPublicKey=t.fromPublicKey,e.fromPrivateKey=t.fromPrivateKey})),Hc=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.Mnemonic=void 0;var r=Pn(),i=Vc(),a=Qn(),o=(_(),n(v));e.Mnemonic=class e{static generateWallet(n,r=`m/44'/118'/0'/0/0`,i=``,a=256){return t(this,void 0,void 0,function*(){let t=yield e.generateSeed(n,a);return{privKey:e.generateWalletFromMnemonic(t,r,i),mnemonic:t}})}static validateMnemonic(e){return r.validateMnemonic(e)}static generateSeed(e,n=128){return t(this,void 0,void 0,function*(){if(n%32!=0)throw TypeError(`invalid entropy`);let t=new Uint8Array(n/8);return t=yield e(t),r.entropyToMnemonic(o.Buffer.from(t).toString(`hex`))})}static generateWalletFromMnemonic(e,t=`m/44'/118'/0'/0/0`,n=``){let a=r.mnemonicToSeedSync(e,n),o=i.fromSeed(a).derivePath(t).privateKey;if(!o)throw Error(`null hd key`);return o}static generateMasterSeedFromMnemonic(e,t=``){let n=r.mnemonicToSeedSync(e,t),s=i.fromSeed(n);return o.Buffer.from(a.decode(s.toBase58()))}static generatePrivateKeyFromMasterSeed(e,t=`m/44'/118'/0'/0/0`){let n=i.fromBase58(a.encode(e)).derivePath(t).privateKey;if(!n)throw Error(`null hd key`);return n}}})),Uc=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Hash=void 0;var t=T(),r=(as(),n(ns)),i=(_(),n(v));e.Hash=class{static sha256(e){return new Uint8Array(new t.sha256().update(e).digest())}static keccak256(e){return i.Buffer.from((0,r.keccak256)(e).replace(`0x`,``),`hex`)}static truncHashPortion(e,t=e.length,n=0){return e.substring(0,t)+`…`+e.substring(e.length-n,e.length)}}})),Wc=a((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.PubKeySecp256k1=e.PrivKeySecp256k1=void 0;var r=j(),i=t(Nr()),a=(_(),n(v)),o=Uc();e.PrivKeySecp256k1=class e{static generateRandomKey(){let t=new r.ec(`secp256k1`);return new e(a.Buffer.from(t.genKeyPair().getPrivate().toArray()))}constructor(e){this.privKey=e}toBytes(){return new Uint8Array(this.privKey)}getPubKey(){let e=new r.ec(`secp256k1`).keyFromPrivate(this.privKey);return new s(new Uint8Array(e.getPublic().encodeCompressed(`array`)))}signDigest32(e){if(e.length!==32)throw Error(`Invalid length of digest to sign: ${e.length}`);let t=new r.ec(`secp256k1`).keyFromPrivate(this.privKey).sign(e,{canonical:!0});return{r:new Uint8Array(t.r.toArray(`be`,32)),s:new Uint8Array(t.s.toArray(`be`,32)),v:t.recoveryParam}}};var s=class{constructor(e){if(this.pubKey=e,e.length!==33&&e.length!==65)throw Error(`Invalid length of public key: ${e.length}`)}toBytes(e){if(e&&this.pubKey.length===65||!e&&this.pubKey.length===33)return this.pubKey;let t=this.toKeyPair();return e?new Uint8Array(a.Buffer.from(t.getPublic().encode(`hex`,!1),`hex`)):new Uint8Array(a.Buffer.from(t.getPublic().encodeCompressed(`hex`),`hex`))}getAddress(){return this.getCosmosAddress()}getCosmosAddress(){let e=i.default.SHA256(i.default.lib.WordArray.create(this.toBytes(!1))).toString();return e=i.default.RIPEMD160(i.default.enc.Hex.parse(e)).toString(),new Uint8Array(a.Buffer.from(e,`hex`))}getEthAddress(){return o.Hash.keccak256(this.toBytes(!0).slice(1)).slice(-20)}toKeyPair(){return new r.ec(`secp256k1`).keyFromPublic(a.Buffer.from(this.pubKey).toString(`hex`),`hex`)}verifyDigest32(e,t){if(e.length!==32)throw Error(`Invalid length of digest to verify: ${e.length}`);if(t.length!==64)throw Error(`Invalid length of signature: ${t.length}`);let n=new r.ec(`secp256k1`),i=t.slice(0,32),o=t.slice(32);return n.verify(e,{r:a.Buffer.from(i).toString(`hex`),s:a.Buffer.from(o).toString(`hex`)},this.toKeyPair())}};e.PubKeySecp256k1=s})),Gc=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(Hc(),e),n(Wc(),e),n(Uc(),e)})),Kc=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DenomHelper=void 0;var t=(_(),n(v)),r=Gc();e.DenomHelper=class{static ibcDenom(e,n){let i=[];for(let t of e)i.push(`${t.portId}/${t.channelId}`);let a=`${i.join(`/`)}/${n}`;return`ibc/`+t.Buffer.from(r.Hash.sha256(t.Buffer.from(a))).toString(`hex`).toUpperCase()}constructor(e){this._denom=e;let t=this.denom.split(/(\w+):(\w+):(.+)/).filter(Boolean);if(t.length!==1&&t.length!==3)throw Error(`Invalid denom: ${this.denom}`);this._type=t.length===3?t[0]:``,this._contractAddress=t.length===3?t[1]:``}get denom(){return this._denom}get type(){return this._type||`native`}get contractAddress(){return this._contractAddress}}})),qc=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.toGenerator=void 0;function*t(e){return yield e}e.toGenerator=t})),Jc=r({$mobx:()=>X,FlowCancellationError:()=>sm,ObservableMap:()=>Cm,ObservableSet:()=>Em,Reaction:()=>zp,_allowStateChanges:()=>Du,_allowStateChangesInsideComputed:()=>ld,_allowStateReadsEnd:()=>Bu,_allowStateReadsStart:()=>zu,_autoAction:()=>$p,_endAction:()=>Eu,_getAdministration:()=>Pf,_getGlobalState:()=>Uu,_interceptReads:()=>kd,_isComputingDerivation:()=>Mu,_resetGlobalState:()=>Wu,_startAction:()=>Tu,action:()=>Qp,autorun:()=>dd,comparer:()=>ip,computed:()=>wp,configure:()=>vd,createAtom:()=>Nl,defineProperty:()=>Kd,entries:()=>Vd,extendObservable:()=>yd,flow:()=>um,flowResult:()=>Dd,get:()=>Gd,getAtom:()=>Nf,getDebugName:()=>Ff,getDependencyTree:()=>bd,getObserverTree:()=>Sd,has:()=>Wd,intercept:()=>Ad,isAction:()=>ud,isBoxedObservable:()=>Ap,isComputed:()=>Pd,isComputedProp:()=>Fd,isFlow:()=>Od,isFlowCancellationError:()=>Td,isObservable:()=>Ld,isObservableArray:()=>bf,isObservableMap:()=>wm,isObservableObject:()=>Ef,isObservableProp:()=>Rd,isObservableSet:()=>Dm,keys:()=>zd,makeAutoObservable:()=>hf,makeObservable:()=>mf,observable:()=>yp,observe:()=>Jd,onBecomeObserved:()=>hd,onBecomeUnobserved:()=>gd,onReactionError:()=>nd,override:()=>op,ownKeys:()=>qd,reaction:()=>pd,remove:()=>Ud,runInAction:()=>ld,set:()=>Hd,spy:()=>sd,toJS:()=>$d,trace:()=>ef,transaction:()=>tf,untracked:()=>Iu,values:()=>Bd,when:()=>nf});function J(e){var t=[...arguments].slice(1);throw Error(typeof e==`number`?`[MobX] minified error nr: `+e+(t.length?` `+t.map(String).join(`,`):``)+`. Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts`:`[MobX] `+e)}function Yc(){return typeof globalThis<`u`?globalThis:typeof window<`u`?window:h===void 0?typeof self<`u`?self:Hf:h}function Xc(){Yf||J(`Proxy not available`)}function Zc(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}function Qc(e){return typeof e==`function`}function $c(e){switch(typeof e){case`string`:case`symbol`:case`number`:return!0}return!1}function el(e){return typeof e==`object`&&!!e}function tl(e){if(!el(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var n=Object.hasOwnProperty.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n.toString()===Xf}function nl(e){var t=e?.constructor;return t?t.name===`GeneratorFunction`||t.displayName===`GeneratorFunction`:!1}function rl(e,t,n){Gf(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function il(e,t,n){Gf(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function al(e,t){var n=`isMobX`+e;return t.prototype[n]=!0,function(e){return el(e)&&e[n]===!0}}function ol(e){return e!=null&&Object.prototype.toString.call(e)===`[object Map]`}function sl(e){return Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(e)))===null}function cl(e){return e!=null&&Object.prototype.toString.call(e)===`[object Set]`}function ll(e){var t=Object.keys(e);if(!Qf)return t;var n=Object.getOwnPropertySymbols(e);return n.length?[].concat(t,n.filter(function(t){return Kf.propertyIsEnumerable.call(e,t)})):t}function ul(e){return e===null?null:typeof e==`object`?``+e:e}function dl(e,t){return Kf.hasOwnProperty.call(e,t)}function fl(e,t){return!!(e&t)}function pl(e,t,n){return n?e|=t:e&=~t,e}function ml(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function hl(e,t,n){if(Cl())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&wl(i,n.prototype),i}function gl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,El(r.key),r)}}function _l(e,t,n){return t&&gl(e.prototype,t),n&&gl(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function vl(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=Dl(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
4
4
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yl(){return yl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yl.apply(null,arguments)}function bl(e){return bl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},bl(e)}function xl(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,wl(e,t)}function Sl(e){try{return Function.toString.call(e).indexOf(`[native code]`)!==-1}catch{return typeof e==`function`}}function Cl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Cl=function(){return!!e})()}function wl(e,t){return wl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},wl(e,t)}function Tl(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function El(e){var t=Tl(e,`string`);return typeof t==`symbol`?t:t+``}function Dl(e,t){if(e){if(typeof e==`string`)return ml(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ml(e,t):void 0}}function Ol(e){var t=typeof Map==`function`?new Map:void 0;return Ol=function(e){if(e===null||!Sl(e))return e;if(typeof e!=`function`)throw TypeError(`Super expression must either be null or a function`);if(t!==void 0){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return hl(e,arguments,bl(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),wl(n,e)},Ol(e)}function kl(e){function t(t,n){if(Ml(n))return e.decorate_20223_(t,n);Al(t,n,e)}return Object.assign(t,e)}function Al(e,t,n){dl(e,tp)||rl(e,tp,yl({},e[tp])),Hl(n)||(e[tp][t]=n)}function jl(e){return dl(e,tp)||rl(e,tp,yl({},e[tp])),e[tp]}function Ml(e){return typeof e==`object`&&typeof e.kind==`string`}function Nl(e,t,n){t===void 0&&(t=Zf),n===void 0&&(n=Zf);var r=new np(e);return t!==Zf&&hd(r,t),n!==Zf&&gd(r,n),r}function Pl(e,t){return e===t}function Fl(e,t){return Lf(e,t)}function Il(e,t){return Lf(e,t,1)}function Ll(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e==1/t:e!==e&&t!==t}function Rl(e,t,n){return Ld(e)?e:Array.isArray(e)?yp.array(e,{name:n}):tl(e)?yp.object(e,void 0,{name:n}):ol(e)?yp.map(e,{name:n}):cl(e)?yp.set(e,{name:n}):typeof e==`function`&&!ud(e)&&!Od(e)?nl(e)?um(e):$p(n,e):e}function zl(e,t,n){if(e==null||Ef(e)||bf(e)||wm(e)||Dm(e))return e;if(Array.isArray(e))return yp.array(e,{name:n,deep:!1});if(tl(e))return yp.object(e,void 0,{name:n,deep:!1});if(ol(e))return yp.map(e,{name:n,deep:!1});if(cl(e))return yp.set(e,{name:n,deep:!1})}function Bl(e){return e}function Vl(e,t){return Lf(e,t)?t:e}function Hl(e){return e.annotationType_===ap}function Ul(e,t){return 0}function Wl(e,t,n,r){J(`'`+this.annotationType_+`' can only be used with 'makeObservable'`)}function Gl(e,t){}function Kl(e,t){return{annotationType_:e,options_:t,make_:ql,extend_:Jl,decorate_20223_:Yl}}function ql(e,t,n,r){var i;return(i=this.options_)!=null&&i.bound?this.extend_(e,t,n,!1)===null?0:1:r===e.target_?this.extend_(e,t,n,!1)===null?0:2:ud(n.value)?1:(Gf(r,t,Zl(e,this,t,n,!1)),2)}function Jl(e,t,n,r){var i=Zl(e,this,t,n);return e.defineProperty_(t,i,r)}function Yl(e,t){var n=t.kind,r=t.name,i=t.addInitializer,a=this,o=function(e){return Cu(a.options_?.name??r.toString(),e,a.options_?.autoAction??!1)};if(n==`field`)return function(e){var t,n=e;return ud(n)||(n=o(n)),(t=a.options_)!=null&&t.bound&&(n=n.bind(this),n.isMobxAction=!0),n};if(n==`method`){var s;return ud(e)||(e=o(e)),(s=this.options_)!=null&&s.bound&&i(function(){var e=this,t=e[r].bind(e);t.isMobxAction=!0,e[r]=t}),e}J(`Cannot apply '`+a.annotationType_+`' to '`+String(r)+`' (kind: `+n+`):`+(`
5
- '`+a.annotationType_+`' can only be used on properties with a function value.`))}function Xl(e,t,n,r){t.annotationType_,r.value}function Zl(e,t,n,r,i){var a,o;i===void 0&&(i=Q.safeDescriptors),Xl(e,t,n,r);var s=r.value;return(a=t.options_)!=null&&a.bound&&(s=s.bind(e.proxy_??e.target_)),{value:Cu(t.options_?.name??n.toString(),s,t.options_?.autoAction??!1,(o=t.options_)!=null&&o.bound?e.proxy_??e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function Ql(e,t){return{annotationType_:e,options_:t,make_:$l,extend_:eu,decorate_20223_:tu}}function $l(e,t,n,r){var i;return r===e.target_?this.extend_(e,t,n,!1)===null?0:2:(i=this.options_)!=null&&i.bound&&(!dl(e.target_,t)||!Od(e.target_[t]))&&this.extend_(e,t,n,!1)===null?0:Od(n.value)?1:(Gf(r,t,ru(e,this,t,n,!1,!1)),2)}function eu(e,t,n,r){var i=ru(e,this,t,n,this.options_?.bound);return e.defineProperty_(t,i,r)}function tu(e,t){var n,r=t.name,i=t.addInitializer;return Od(e)||(e=um(e)),(n=this.options_)!=null&&n.bound&&i(function(){var e=this,t=e[r].bind(e);t.isMobXFlow=!0,e[r]=t}),e}function nu(e,t,n,r){t.annotationType_,r.value}function ru(e,t,n,r,i,a){a===void 0&&(a=Q.safeDescriptors),nu(e,t,n,r);var o=r.value;return Od(o)||(o=um(o)),i&&(o=o.bind(e.proxy_??e.target_),o.isMobXFlow=!0),{value:o,configurable:a?e.isPlainObject_:!0,enumerable:!1,writable:!a}}function iu(e,t){return{annotationType_:e,options_:t,make_:au,extend_:ou,decorate_20223_:su}}function au(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function ou(e,t,n,r){return cu(e,this,t,n),e.defineComputedProperty_(t,yl({},this.options_,{get:n.get,set:n.set}),r)}function su(e,t){var n=this,r=t.name,i=t.addInitializer;return i(function(){var t=wf(this)[X],i=yl({},n.options_,{get:e,context:this});i.name||=`ObservableObject.`+r.toString(),t.values_.set(r,new jp(i))}),function(){return this[X].getObservablePropValue_(r)}}function cu(e,t,n,r){t.annotationType_,r.get}function lu(e,t){return{annotationType_:e,options_:t,make_:uu,extend_:du,decorate_20223_:fu}}function uu(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function du(e,t,n,r){return pu(e,this,t,n),e.defineObservableProperty_(t,n.value,this.options_?.enhancer??Rl,r)}function fu(e,t){var n=this,r=t.kind,i=t.name,a=new WeakSet;function o(e,t){var r=wf(e)[X],o=new kp(t,n.options_?.enhancer??Rl,`ObservableObject.`+i.toString(),!1);r.values_.set(i,o),a.add(e)}if(r==`accessor`)return{get:function(){return a.has(this)||o(this,e.get.call(this)),this[X].getObservablePropValue_(i)},set:function(e){return a.has(this)||o(this,e),this[X].setObservablePropValue_(i,e)},init:function(e){return a.has(this)||o(this,e),e}}}function pu(e,t,n,r){t.annotationType_}function mu(e){return{annotationType_:sp,options_:e,make_:hu,extend_:gu,decorate_20223_:_u}}function hu(e,t,n,r){var i;if(n.get)return wp.make_(e,t,n,r);if(n.set){var a=ud(n.set)?n.set:Cu(t.toString(),n.set);return r===e.target_?e.defineProperty_(t,{configurable:Q.safeDescriptors?e.isPlainObject_:!0,set:a})===null?0:2:(Gf(r,t,{configurable:!0,set:a}),2)}if(r!==e.target_&&typeof n.value==`function`){var o;if(nl(n.value)){var s;return((s=this.options_)!=null&&s.autoBind?um.bound:um).make_(e,t,n,r)}return((o=this.options_)!=null&&o.autoBind?$p.bound:$p).make_(e,t,n,r)}var c=this.options_?.deep===!1?yp.ref:yp;return typeof n.value==`function`&&(i=this.options_)!=null&&i.autoBind&&(n.value=n.value.bind(e.proxy_??e.target_)),c.make_(e,t,n,r)}function gu(e,t,n,r){var i;return n.get?wp.extend_(e,t,n,r):n.set?e.defineProperty_(t,{configurable:Q.safeDescriptors?e.isPlainObject_:!0,set:Cu(t.toString(),n.set)},r):(typeof n.value==`function`&&(i=this.options_)!=null&&i.autoBind&&(n.value=n.value.bind(e.proxy_??e.target_)),(this.options_?.deep===!1?yp.ref:yp).extend_(e,t,n,r))}function _u(e,t){J(`'`+this.annotationType_+`' cannot be used as a decorator`)}function vu(e){return e||pp}function yu(e){return e.deep===!0?Rl:e.deep===!1?Bl:xu(e.defaultDecorator)}function bu(e){return e?e.defaultDecorator??mu(e):void 0}function xu(e){return e?e.options_?.enhancer??Rl:Rl}function Su(e,t,n){if(Ml(t))return mp.decorate_20223_(e,t);if($c(t)){Al(e,t,mp);return}return Ld(e)?e:tl(e)?yp.object(e,t,n):Array.isArray(e)?yp.array(e,t):ol(e)?yp.map(e,t):cl(e)?yp.set(e,t):typeof e==`object`&&e?e:yp.box(e,t)}function Cu(e,t,n,r){n===void 0&&(n=!1);function i(){return wu(e,n,t,r||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},Dp&&(Op.value=e,Gf(i,`name`,Op)),i}function wu(e,t,n,r,i){var a=Tu(e,t,r,i);try{return n.apply(r,i)}catch(e){throw a.error_=e,e}finally{Eu(a)}}function Tu(e,t,n,r){var i=!1,a=0,o=Q.trackingDerivation,s=!t||!o;Xu();var c=Q.allowStateChanges;s&&(Lu(),c=Ou(!0));var l=zu(!0),u={runAsAction_:s,prevDerivation_:o,prevAllowStateChanges_:c,prevAllowStateReads_:l,notifySpy_:i,startTime_:a,actionId_:Ep++,parentActionId_:Tp};return Tp=u.actionId_,u}function Eu(e){Tp!==e.actionId_&&J(30),Tp=e.parentActionId_,e.error_!==void 0&&(Q.suppressReactionErrors=!0),ku(e.prevAllowStateChanges_),Bu(e.prevAllowStateReads_),Zu(),e.runAsAction_&&Ru(e.prevDerivation_),Q.suppressReactionErrors=!1}function Du(e,t){var n=Ou(e);try{return t()}finally{ku(n)}}function Ou(e){var t=Q.allowStateChanges;return Q.allowStateChanges=e,t}function ku(e){Q.allowStateChanges=e}function Au(e){return e instanceof Pp}function ju(e){switch(e.dependenciesState_){case Z.UP_TO_DATE_:return!1;case Z.NOT_TRACKING_:case Z.STALE_:return!0;case Z.POSSIBLY_STALE_:for(var t=zu(!0),n=Lu(),r=e.observing_,i=r.length,a=0;a<i;a++){var o=r[a];if(Mp(o)){if(Q.disableErrorBoundaries)o.get();else try{o.get()}catch{return Ru(n),Bu(t),!0}if(e.dependenciesState_===Z.STALE_)return Ru(n),Bu(t),!0}}return Vu(e),Ru(n),Bu(t),!1}}function Mu(){return Q.trackingDerivation!==null}function Nu(e,t,n){var r=zu(!0);Vu(e),e.newObserving_=Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++Q.runId;var i=Q.trackingDerivation;Q.trackingDerivation=e,Q.inBatch++;var a;if(Q.disableErrorBoundaries===!0)a=t.call(n);else try{a=t.call(n)}catch(e){a=new Pp(e)}return Q.inBatch--,Q.trackingDerivation=i,Pu(e),Bu(r),a}function Pu(e){for(var t=e.observing_,n=e.observing_=e.newObserving_,r=Z.UP_TO_DATE_,i=0,a=e.unboundDepsCount_,o=0;o<a;o++){var s=n[o];s.diffValue===0&&(s.diffValue=1,i!==o&&(n[i]=s),i++),s.dependenciesState_>r&&(r=s.dependenciesState_)}for(n.length=i,e.newObserving_=null,a=t.length;a--;){var c=t[a];c.diffValue===0&&Ju(c,e),c.diffValue=0}for(;i--;){var l=n[i];l.diffValue===1&&(l.diffValue=0,qu(l,e))}r!==Z.UP_TO_DATE_&&(e.dependenciesState_=r,e.onBecomeStale_())}function Fu(e){var t=e.observing_;e.observing_=[];for(var n=t.length;n--;)Ju(t[n],e);e.dependenciesState_=Z.NOT_TRACKING_}function Iu(e){var t=Lu();try{return e()}finally{Ru(t)}}function Lu(){var e=Q.trackingDerivation;return Q.trackingDerivation=null,e}function Ru(e){Q.trackingDerivation=e}function zu(e){var t=Q.allowStateReads;return Q.allowStateReads=e,t}function Bu(e){Q.allowStateReads=e}function Vu(e){if(e.dependenciesState_!==Z.UP_TO_DATE_){e.dependenciesState_=Z.UP_TO_DATE_;for(var t=e.observing_,n=t.length;n--;)t[n].lowestObserverState_=Z.UP_TO_DATE_}}function Hu(){if((Q.pendingReactions.length||Q.inBatch||Q.isRunningReactions)&&J(36),Rp=!0,Lp){var e=Yc();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),Q=new Ip}}function Uu(){return Q}function Wu(){var e=new Ip;for(var t in e)Fp.indexOf(t)===-1&&(Q[t]=e[t]);Q.allowStateChanges=!Q.enforceActions}function Gu(e){return e.observers_&&e.observers_.size>0}function Ku(e){return e.observers_}function qu(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function Ju(e,t){e.observers_.delete(t),e.observers_.size===0&&Yu(e)}function Yu(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,Q.pendingUnobservations.push(e))}function Xu(){Q.inBatch++}function Zu(){if(--Q.inBatch===0){rd();for(var e=Q.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,n.observers_.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBUO()),n instanceof jp&&n.suspend_())}Q.pendingUnobservations=[]}}function Qu(e){var t=Q.trackingDerivation;return t===null?(e.observers_.size===0&&Q.inBatch>0&&Yu(e),!1):(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&Q.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved)}function $u(e){e.lowestObserverState_!==Z.STALE_&&(e.lowestObserverState_=Z.STALE_,e.observers_.forEach(function(e){e.dependenciesState_===Z.UP_TO_DATE_&&e.onBecomeStale_(),e.dependenciesState_=Z.STALE_}))}function ed(e){e.lowestObserverState_!==Z.STALE_&&(e.lowestObserverState_=Z.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Z.POSSIBLY_STALE_?t.dependenciesState_=Z.STALE_:t.dependenciesState_===Z.UP_TO_DATE_&&(e.lowestObserverState_=Z.UP_TO_DATE_)}))}function td(e){e.lowestObserverState_===Z.UP_TO_DATE_&&(e.lowestObserverState_=Z.POSSIBLY_STALE_,e.observers_.forEach(function(e){e.dependenciesState_===Z.UP_TO_DATE_&&(e.dependenciesState_=Z.POSSIBLY_STALE_,e.onBecomeStale_())}))}function nd(e){return Q.globalReactionErrorHandlers.push(e),function(){var t=Q.globalReactionErrorHandlers.indexOf(e);t>=0&&Q.globalReactionErrorHandlers.splice(t,1)}}function rd(){Q.inBatch>0||Q.isRunningReactions||Vp(id)}function id(){Q.isRunningReactions=!0;for(var e=Q.pendingReactions,t=0;e.length>0;){++t===Bp&&e.splice(0);for(var n=e.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction_()}Q.isRunningReactions=!1}function ad(e){var t=Vp;Vp=function(n){return e(function(){return t(n)})}}function od(){return!1}function sd(e){return function(){}}function cd(e){return function(t,n){if(Qc(t))return Cu(t.name||qp,t,e);if(Qc(n))return Cu(t,n,e);if(Ml(n))return(e?Xp:Jp).decorate_20223_(t,n);if($c(n))return Al(t,n,e?Xp:Jp);if($c(t))return kl(Kl(e?Gp:Up,{name:t,autoAction:e}))}}function ld(e){return wu(e.name||qp,!1,e,this,void 0)}function ud(e){return Qc(e)&&e.isMobxAction===!0}function dd(e,t){var n;t===void 0&&(t=Jf);var r=t?.name??`Autorun`,i=!t.scheduler&&!t.delay,a;if(i)a=new zp(r,function(){this.track(c)},t.onError,t.requiresObservable);else{var o=fd(t),s=!1;a=new zp(r,function(){s||(s=!0,o(function(){s=!1,a.isDisposed||a.track(c)}))},t.onError,t.requiresObservable)}function c(){e(a)}return(n=t)!=null&&(n=n.signal)!=null&&n.aborted||a.schedule_(),a.getDisposer_(t?.signal)}function fd(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:em}function pd(e,t,n){var r;n===void 0&&(n=Jf);var i=n.name??`Reaction`,a=Qp(i,n.onError?md(n.onError,t):t),o=!n.scheduler&&!n.delay,s=fd(n),c=!0,l=!1,u,d=n.compareStructural?ip.structural:n.equals||ip.default,f=new zp(i,function(){c||o?p():l||(l=!0,s(p))},n.onError,n.requiresObservable);function p(){if(l=!1,!f.isDisposed){var t=!1,r=u;f.track(function(){var n=Du(!1,function(){return e(f)});t=c||!d(u,n),u=n}),(c&&n.fireImmediately||!c&&t)&&a(u,r,f),c=!1}}return(r=n)!=null&&(r=r.signal)!=null&&r.aborted||f.schedule_(),f.getDisposer_(n?.signal)}function md(e,t){return function(){try{return t.apply(this,arguments)}catch(t){e.call(this,t)}}}function hd(e,t,n){return _d(tm,e,t,n)}function gd(e,t,n){return _d(nm,e,t,n)}function _d(e,t,n,r){var i=typeof r==`function`?Nf(t,n):Nf(t),a=Qc(r)?r:n,o=e+`L`;return i[o]?i[o].add(a):i[o]=new Set([a]),function(){var e=i[o];e&&(e.delete(a),e.size===0&&delete i[o])}}function vd(e){e.isolateGlobalState===!0&&Hu();var t=e.useProxies,n=e.enforceActions;if(t!==void 0&&(Q.useProxies=t===im?!0:t===rm?!1:typeof Proxy<`u`),t===`ifavailable`&&(Q.verifyProxies=!0),n!==void 0){var r=n===im?im:n===am;Q.enforceActions=r,Q.allowStateChanges=!(r===!0||r===im)}[`computedRequiresReaction`,`reactionRequiresObservable`,`observableRequiresReaction`,`disableErrorBoundaries`,`safeDescriptors`].forEach(function(t){t in e&&(Q[t]=!!e[t])}),Q.allowStateReads=!Q.observableRequiresReaction,e.reactionScheduler&&ad(e.reactionScheduler)}function yd(e,t,n,r){var i=ep(t);return If(function(){var t=wf(e,r)[X];$f(i).forEach(function(e){t.extend_(e,i[e],n&&e in n?n[e]:!0)})}),e}function bd(e,t){return xd(Nf(e,t))}function xd(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=wd(e.observing_).map(xd)),t}function Sd(e,t){return Cd(Nf(e,t))}function Cd(e){var t={name:e.name_};return Gu(e)&&(t.observers=Array.from(Ku(e)).map(Cd)),t}function wd(e){return Array.from(new Set(e))}function Td(e){return e instanceof sm}function Ed(e){Qc(e.cancel)&&e.cancel()}function Dd(e){return e}function Od(e){return e?.isMobXFlow===!0}function kd(e,t,n){var r;return wm(e)||bf(e)||Ap(e)?r=Pf(e):Ef(e)&&(r=Pf(e,t)),r.dehancer=typeof t==`function`?t:n,function(){r.dehancer=void 0}}function Ad(e,t,n){return Qc(n)?Md(e,t,n):jd(e,t)}function jd(e,t){return Pf(e).intercept_(t)}function Md(e,t,n){return Pf(e,t).intercept_(n)}function Nd(e,t){return t===void 0?Mp(e):Ef(e)===!1||!e[X].values_.has(t)?!1:Mp(Nf(e,t))}function Pd(e){return Nd(e)}function Fd(e,t){return Nd(e,t)}function Id(e,t){return e?t===void 0?Ef(e)||!!e[X]||rp(e)||Hp(e)||Mp(e):Ef(e)?e[X].values_.has(t):!1:!1}function Ld(e){return Id(e)}function Rd(e,t){return Id(e,t)}function zd(e){if(Ef(e))return e[X].keys_();if(wm(e)||Dm(e))return Array.from(e.keys());if(bf(e))return e.map(function(e,t){return t});J(5)}function Bd(e){if(Ef(e))return zd(e).map(function(t){return e[t]});if(wm(e))return zd(e).map(function(t){return e.get(t)});if(Dm(e))return Array.from(e.values());if(bf(e))return e.slice();J(6)}function Vd(e){if(Ef(e))return zd(e).map(function(t){return[t,e[t]]});if(wm(e))return zd(e).map(function(t){return[t,e.get(t)]});if(Dm(e))return Array.from(e.entries());if(bf(e))return e.map(function(e,t){return[t,e]});J(7)}function Hd(e,t,n){if(arguments.length===2&&!Dm(e)){Xu();var r=t;try{for(var i in r)Hd(e,i,r[i])}finally{Zu()}return}Ef(e)?e[X].set_(t,n):wm(e)?e.set(t,n):Dm(e)?e.add(t):bf(e)?(typeof t!=`number`&&(t=parseInt(t,10)),t<0&&J(`Invalid index: '`+t+`'`),Xu(),t>=e.length&&(e.length=t+1),e[t]=n,Zu()):J(8)}function Ud(e,t){Ef(e)?e[X].delete_(t):wm(e)||Dm(e)?e.delete(t):bf(e)?(typeof t!=`number`&&(t=parseInt(t,10)),e.splice(t,1)):J(9)}function Wd(e,t){if(Ef(e))return e[X].has_(t);if(wm(e)||Dm(e))return e.has(t);if(bf(e))return t>=0&&t<e.length;J(10)}function Gd(e,t){if(Wd(e,t)){if(Ef(e))return e[X].get_(t);if(wm(e))return e.get(t);if(bf(e))return e[t];J(11)}}function Kd(e,t,n){if(Ef(e))return e[X].defineProperty_(t,n);J(39)}function qd(e){if(Ef(e))return e[X].ownKeys_();J(38)}function Jd(e,t,n,r){return Qc(n)?Xd(e,t,n,r):Yd(e,t,n)}function Yd(e,t,n){return Pf(e).observe_(t,n)}function Xd(e,t,n,r){return Pf(e,t).observe_(n,r)}function Zd(e,t,n){return e.set(t,n),n}function Qd(e,t){if(typeof e!=`object`||!e||e instanceof Date||!Ld(e))return e;if(Ap(e)||Mp(e))return Qd(e.get(),t);if(t.has(e))return t.get(e);if(bf(e)){var n=Zd(t,e,Array(e.length));return e.forEach(function(e,r){n[r]=Qd(e,t)}),n}if(Dm(e)){var r=Zd(t,e,new Set);return e.forEach(function(e){r.add(Qd(e,t))}),r}if(wm(e)){var i=Zd(t,e,new Map);return e.forEach(function(e,n){i.set(n,Qd(e,t))}),i}else{var a=Zd(t,e,{});return qd(e).forEach(function(n){Kf.propertyIsEnumerable.call(e,n)&&(a[n]=Qd(e[n],t))}),a}}function $d(e,t){return Qd(e,new Map)}function ef(){}function tf(e,t){t===void 0&&(t=void 0),Xu();try{return e.apply(t)}finally{Zu()}}function nf(e,t,n){return arguments.length===1||t&&typeof t==`object`?af(e,t):rf(e,t,n||{})}function rf(e,t,n){var r;if(typeof n.timeout==`number`){var i=Error(`WHEN_TIMEOUT`);r=setTimeout(function(){if(!o[X].isDisposed)if(o(),n.onError)n.onError(i);else throw i},n.timeout)}n.name=`When`;var a=Cu(`When-effect`,t),o=dd(function(t){Du(!1,e)&&(t.dispose(),r&&clearTimeout(r),a())},n);return o}function af(e,t){var n;if(t!=null&&(n=t.signal)!=null&&n.aborted)return Object.assign(Promise.reject(Error(`WHEN_ABORTED`)),{cancel:function(){return null}});var r,i,a=new Promise(function(n,a){var o,s=rf(e,n,yl({},t,{onError:a}));r=function(){s(),a(Error(`WHEN_CANCELLED`))},i=function(){s(),a(Error(`WHEN_ABORTED`))},t==null||(o=t.signal)==null||o.addEventListener==null||o.addEventListener(`abort`,i)}).finally(function(){var e;return t==null||(e=t.signal)==null||e.removeEventListener==null?void 0:e.removeEventListener(`abort`,i)});return a.cancel=r,a}function of(e){return e[X]}function sf(e,t){var n;return Xc(),e=wf(e,t),(n=e[X]).proxy_??(n.proxy_=new Proxy(e,dm))}function cf(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function lf(e,t){var n=e.interceptors_||=[];return n.push(t),Zc(function(){var e=n.indexOf(t);e!==-1&&n.splice(e,1)})}function uf(e,t){var n=Lu();try{for(var r=[].concat(e.interceptors_||[]),i=0,a=r.length;i<a&&(t=r[i](t),t&&!t.type&&J(14),t);i++);return t}finally{Ru(n)}}function df(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function ff(e,t){var n=e.changeListeners_||=[];return n.push(t),Zc(function(){var e=n.indexOf(t);e!==-1&&n.splice(e,1)})}function pf(e,t){var n=Lu(),r=e.changeListeners_;if(r){r=r.slice();for(var i=0,a=r.length;i<a;i++)r[i](t);Ru(n)}}function mf(e,t,n){return If(function(){var r=wf(e,n)[X];t??=jl(e),$f(t).forEach(function(e){return r.make_(e,t[e])})}),e}function hf(e,t,n){return tl(e)?yd(e,e,t,n):(If(function(){var r=wf(e,n)[X];if(!e[fm]){var i=Object.getPrototypeOf(e),a=new Set([].concat($f(e),$f(i)));a.delete(`constructor`),a.delete(X),rl(i,fm,a)}e[fm].forEach(function(e){return r.make_(e,t&&e in t?t[e]:!0)})}),e)}function gf(e,t,n,r){return n===void 0&&(n=`ObservableArray`),r===void 0&&(r=!1),Xc(),If(function(){var i=new _m(n,t,r,!1);il(i.values_,X,i);var a=new Proxy(i.values_,gm);return i.proxy_=a,e&&e.length&&i.spliceWithArray_(0,0,e),a})}function Y(e,t){typeof Array.prototype[e]==`function`&&(vm[e]=t(e))}function _f(e){return function(){var t=this[X];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_);return n[e].apply(n,arguments)}}function vf(e){return function(t,n){var r=this,i=this[X];return i.atom_.reportObserved(),i.dehanceValues_(i.values_)[e](function(e,i){return t.call(n,e,i,r)})}}function yf(e){return function(){var t=this,n=this[X];n.atom_.reportObserved();var r=n.dehanceValues_(n.values_),i=arguments[0];return arguments[0]=function(e,n,r){return i(e,n,r,t)},r[e].apply(r,arguments)}}function bf(e){return el(e)&&ym(e[X])}function xf(e){return e[Symbol.toStringTag]=`MapIterator`,Bf(e)}function Sf(e){if(ol(e)||wm(e))return e;if(Array.isArray(e))return new Map(e);if(tl(e)){var t=new Map;for(var n in e)t.set(n,e[n]);return t}else return J(21,e)}function Cf(e){return e[Symbol.toStringTag]=`SetIterator`,Bf(e)}function wf(e,t){if(dl(e,X))return e;var n=t?.name??`ObservableObject`;return rl(e,X,new Am(e,new Map,String(n),bu(t))),e}function Tf(e){return Om[e]||(Om[e]={get:function(){return this[X].getObservablePropValue_(e)},set:function(t){return this[X].setObservablePropValue_(e,t)}})}function Ef(e){return el(e)?jm(e[X]):!1}function Df(e,t,n){var r;(r=e.target_[tp])==null||delete r[n]}function Of(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__===void 0?e.prototype=t:e.prototype.__proto__=t}function kf(e){return{enumerable:!1,configurable:!0,get:function(){return this[X].get_(e)},set:function(t){this[X].set_(e,t)}}}function Af(e){Gf(Im.prototype,``+e,kf(e))}function jf(e){if(e>Pm){for(var t=Pm;t<e+100;t++)Af(t);Pm=e}}function Mf(e,t,n){return new Im(e,t,n)}function Nf(e,t){if(typeof e==`object`&&e){if(bf(e))return t!==void 0&&J(23),e[X].atom_;if(Dm(e))return e.atom_;if(wm(e)){if(t===void 0)return e.keysAtom_;var n=e.data_.get(t)||e.hasMap_.get(t);return n||J(25,t,Ff(e)),n}if(Ef(e)){if(!t)return J(26);var r=e[X].values_.get(t);return r||J(27,t,Ff(e)),r}if(rp(e)||Mp(e)||Hp(e))return e}else if(Qc(e)&&Hp(e[X]))return e[X];J(28)}function Pf(e,t){if(e||J(29),t!==void 0)return Pf(Nf(e,t));if(rp(e)||Mp(e)||Hp(e)||wm(e)||Dm(e))return e;if(e[X])return e[X];J(24,e)}function Ff(e,t){var n;if(t!==void 0)n=Nf(e,t);else if(ud(e))return e.name;else n=Ef(e)||wm(e)||Dm(e)?Pf(e):Nf(e);return n.name_}function If(e){var t=Lu(),n=Ou(!0);Xu();try{return e()}finally{Zu(),ku(n),Ru(t)}}function Lf(e,t,n){return n===void 0&&(n=-1),Rf(e,t,n)}function Rf(e,t,n,r,i){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var a=typeof e;if(a!==`function`&&a!==`object`&&typeof t!=`object`)return!1;var o=Lm.call(e);if(o!==Lm.call(t))return!1;switch(o){case`[object RegExp]`:case`[object String]`:return``+e==``+t;case`[object Number]`:return+e==+e?+e==0?1/e==1/t:+e==+t:+t!=+t;case`[object Date]`:case`[object Boolean]`:return+e==+t;case`[object Symbol]`:return typeof Symbol<`u`&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case`[object Map]`:case`[object Set]`:n>=0&&n++;break}e=zf(e),t=zf(t);var s=o===`[object Array]`;if(!s){if(typeof e!=`object`||typeof t!=`object`)return!1;var c=e.constructor,l=t.constructor;if(c!==l&&!(Qc(c)&&c instanceof c&&Qc(l)&&l instanceof l)&&`constructor`in e&&`constructor`in t)return!1}if(n===0)return!1;n<0&&(n=-1),r||=[],i||=[];for(var u=r.length;u--;)if(r[u]===e)return i[u]===t;if(r.push(e),i.push(t),s){if(u=e.length,u!==t.length)return!1;for(;u--;)if(!Rf(e[u],t[u],n-1,r,i))return!1}else{var d=Object.keys(e),f=d.length;if(Object.keys(t).length!==f)return!1;for(var p=0;p<f;p++){var m=d[p];if(!(dl(t,m)&&Rf(e[m],t[m],n-1,r,i)))return!1}}return r.pop(),i.pop(),!0}function zf(e){return bf(e)?e.slice():ol(e)||wm(e)||cl(e)||Dm(e)?Array.from(e.entries()):e}function Bf(e){return e[Symbol.iterator]=Vf,Object.assign(Object.create(Rm),e)}function Vf(){return this}var Hf,Uf,Wf,Gf,Kf,qf,Jf,Yf,Xf,Zf,Qf,$f,ep,tp,X,np,rp,ip,ap,op,sp,cp,lp,up,dp,fp,pp,mp,hp,gp,_p,vp,yp,bp,xp,Sp,Cp,wp,Tp,Ep,Dp,Op,kp,Ap,jp,Mp,Z,Np,Pp,Fp,Ip,Lp,Rp,Q,zp,Bp,Vp,Hp,Up,Wp,Gp,Kp,qp,Jp,Yp,Xp,Zp,Qp,$p,em,tm,nm,rm,im,am,om,sm,cm,lm,um,dm,fm,pm,mm,hm,gm,_m,vm,ym,bm,xm,Sm,Cm,wm,Tm,Em,Dm,Om,km,Am,jm,Mm,Nm,Pm,Fm,Im,Lm,Rm,zm=t((()=>{m(),Hf={},Uf=Object.assign,Wf=Object.getOwnPropertyDescriptor,Gf=Object.defineProperty,Kf=Object.prototype,qf=[],Object.freeze(qf),Jf={},Object.freeze(Jf),Yf=typeof Proxy<`u`,Xf=Object.toString(),Zf=function(){},Qf=Object.getOwnPropertySymbols!==void 0,$f=typeof Reflect<`u`&&Reflect.ownKeys?Reflect.ownKeys:Qf?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,ep=Object.getOwnPropertyDescriptors||function(e){var t={};return $f(e).forEach(function(n){t[n]=Wf(e,n)}),t},tp=Symbol(`mobx-stored-annotations`),X=Symbol(`mobx administration`),np=function(){function e(e){e===void 0&&(e=`Atom`),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=Z.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=e}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(e){return e()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(e){return e()})},t.reportObserved=function(){return Qu(this)},t.reportChanged=function(){Xu(),$u(this),Zu()},t.toString=function(){return this.name_},_l(e,[{key:`isBeingObserved`,get:function(){return fl(this.flags_,e.isBeingObservedMask_)},set:function(t){this.flags_=pl(this.flags_,e.isBeingObservedMask_,t)}},{key:`isPendingUnobservation`,get:function(){return fl(this.flags_,e.isPendingUnobservationMask_)},set:function(t){this.flags_=pl(this.flags_,e.isPendingUnobservationMask_,t)}},{key:`diffValue`,get:function(){return+!!fl(this.flags_,e.diffValueMask_)},set:function(t){this.flags_=pl(this.flags_,e.diffValueMask_,t===1)}}])}(),np.isBeingObservedMask_=1,np.isPendingUnobservationMask_=2,np.diffValueMask_=4,rp=al(`Atom`,np),ip={identity:Pl,structural:Fl,default:Ll,shallow:Il},ap=`override`,op=kl({annotationType_:ap,make_:Ul,extend_:Wl,decorate_20223_:Gl}),sp=`true`,cp=mu(),lp=`observable`,up=`observable.ref`,dp=`observable.shallow`,fp=`observable.struct`,pp={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0},Object.freeze(pp),mp=lu(lp),hp=lu(up,{enhancer:Bl}),gp=lu(dp,{enhancer:zl}),_p=lu(fp,{enhancer:Vl}),vp=kl(mp),Uf(Su,vp),yp=Uf(Su,{box:function(e,t){var n=vu(t);return new kp(e,yu(n),n.name,!0,n.equals)},array:function(e,t){var n=vu(t);return(Q.useProxies===!1||n.proxy===!1?Mf:gf)(e,yu(n),n.name)},map:function(e,t){var n=vu(t);return new Cm(e,yu(n),n.name)},set:function(e,t){var n=vu(t);return new Em(e,yu(n),n.name)},object:function(e,t,n){return If(function(){return yd(Q.useProxies===!1||n?.proxy===!1?wf({},n):sf({},n),e,t)})},ref:kl(hp),shallow:kl(gp),deep:vp,struct:kl(_p)}),bp=`computed`,xp=`computed.struct`,Sp=iu(bp),Cp=iu(xp,{equals:ip.structural}),wp=function(e,t){if(Ml(t))return Sp.decorate_20223_(e,t);if($c(t))return Al(e,t,Sp);if(tl(e))return kl(iu(bp,e));var n=tl(t)?t:{};return n.get=e,n.name||=e.name||``,new jp(n)},Object.assign(wp,Sp),wp.struct=kl(Cp),Tp=0,Ep=1,Dp=Wf(function(){},`name`)?.configurable??!1,Op={value:`action`,configurable:!0,writable:!1,enumerable:!1},kp=function(e){function t(t,n,r,i,a){var o;return r===void 0&&(r=`ObservableValue`),i===void 0&&(i=!0),a===void 0&&(a=ip.default),o=e.call(this,r)||this,o.enhancer=void 0,o.name_=void 0,o.equals=void 0,o.hasUnreportedChange_=!1,o.interceptors_=void 0,o.changeListeners_=void 0,o.value_=void 0,o.dehancer=void 0,o.enhancer=n,o.name_=r,o.equals=a,o.value_=n(t,void 0,r),o}xl(t,e);var n=t.prototype;return n.dehanceValue=function(e){return this.dehancer===void 0?e:this.dehancer(e)},n.set=function(e){this.value_,e=this.prepareNewValue_(e),e!==Q.UNCHANGED&&this.setNewValue_(e)},n.prepareNewValue_=function(e){if(cf(this)){var t=uf(this,{object:this,type:mm,newValue:e});if(!t)return Q.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value_,this.name_),this.equals(this.value_,e)?Q.UNCHANGED:e},n.setNewValue_=function(e){var t=this.value_;this.value_=e,this.reportChanged(),df(this)&&pf(this,{type:mm,object:this,newValue:e,oldValue:t})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(e){return lf(this,e)},n.observe_=function(e,t){return t&&e({observableKind:`value`,debugObjectName:this.name_,object:this,type:mm,newValue:this.value_,oldValue:void 0}),ff(this,e)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+`[`+this.value_+`]`},n.valueOf=function(){return ul(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},t}(np),Ap=al(`ObservableValue`,kp),jp=function(){function e(e){this.dependenciesState_=Z.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Z.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new Pp(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=Np.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,e.get||J(31),this.derivation=e.get,this.name_=e.name||`ComputedValue`,e.set&&(this.setter_=Cu(`ComputedValue-setter`,e.set)),this.equals_=e.equals||(e.compareStructural||e.struct?ip.structural:ip.default),this.scope_=e.context,this.requiresReaction_=e.requiresReaction,this.keepAlive_=!!e.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){td(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(e){return e()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(e){return e()})},t.get=function(){if(this.isComputing&&J(32,this.name_,this.derivation),Q.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)ju(this)&&(this.warnAboutUntrackedRead_(),Xu(),this.value_=this.computeValue_(!1),Zu());else if(Qu(this),ju(this)){var e=Q.trackingContext;this.keepAlive_&&!e&&(Q.trackingContext=this),this.trackAndCompute()&&ed(this),Q.trackingContext=e}var t=this.value_;if(Au(t))throw t.cause;return t},t.set=function(e){if(this.setter_){this.isRunningSetter&&J(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,e)}finally{this.isRunningSetter=!1}}else J(34,this.name_)},t.trackAndCompute=function(){var e=this.value_,t=this.dependenciesState_===Z.NOT_TRACKING_,n=this.computeValue_(!0),r=t||Au(e)||Au(n)||!this.equals_(e,n);return r&&(this.value_=n),r},t.computeValue_=function(e){this.isComputing=!0;var t=Ou(!1),n;if(e)n=Nu(this,this.derivation,this.scope_);else if(Q.disableErrorBoundaries===!0)n=this.derivation.call(this.scope_);else try{n=this.derivation.call(this.scope_)}catch(e){n=new Pp(e)}return ku(t),this.isComputing=!1,n},t.suspend_=function(){this.keepAlive_||(Fu(this),this.value_=void 0)},t.observe_=function(e,t){var n=this,r=!0,i=void 0;return dd(function(){var a=n.get();if(!r||t){var o=Lu();e({observableKind:`computed`,debugObjectName:n.name_,type:mm,object:n,newValue:a,oldValue:i}),Ru(o)}r=!1,i=a})},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+`[`+this.derivation.toString()+`]`},t.valueOf=function(){return ul(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},_l(e,[{key:`isComputing`,get:function(){return fl(this.flags_,e.isComputingMask_)},set:function(t){this.flags_=pl(this.flags_,e.isComputingMask_,t)}},{key:`isRunningSetter`,get:function(){return fl(this.flags_,e.isRunningSetterMask_)},set:function(t){this.flags_=pl(this.flags_,e.isRunningSetterMask_,t)}},{key:`isBeingObserved`,get:function(){return fl(this.flags_,e.isBeingObservedMask_)},set:function(t){this.flags_=pl(this.flags_,e.isBeingObservedMask_,t)}},{key:`isPendingUnobservation`,get:function(){return fl(this.flags_,e.isPendingUnobservationMask_)},set:function(t){this.flags_=pl(this.flags_,e.isPendingUnobservationMask_,t)}},{key:`diffValue`,get:function(){return+!!fl(this.flags_,e.diffValueMask_)},set:function(t){this.flags_=pl(this.flags_,e.diffValueMask_,t===1)}}])}(),jp.isComputingMask_=1,jp.isRunningSetterMask_=2,jp.isBeingObservedMask_=4,jp.isPendingUnobservationMask_=8,jp.diffValueMask_=16,Mp=al(`ComputedValue`,jp),(function(e){e[e.NOT_TRACKING_=-1]=`NOT_TRACKING_`,e[e.UP_TO_DATE_=0]=`UP_TO_DATE_`,e[e.POSSIBLY_STALE_=1]=`POSSIBLY_STALE_`,e[e.STALE_=2]=`STALE_`})(Z||={}),(function(e){e[e.NONE=0]=`NONE`,e[e.LOG=1]=`LOG`,e[e.BREAK=2]=`BREAK`})(Np||={}),Pp=function(e){this.cause=void 0,this.cause=e},Fp=[`mobxGuid`,`spyListeners`,`enforceActions`,`computedRequiresReaction`,`reactionRequiresObservable`,`observableRequiresReaction`,`allowStateReads`,`disableErrorBoundaries`,`runId`,`UNCHANGED`,`useProxies`],Ip=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},Lp=!0,Rp=!1,Q=function(){var e=Yc();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Lp=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new Ip().version&&(Lp=!1),Lp?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Ip):(setTimeout(function(){Rp||J(35)},1),new Ip)}(),zp=function(){function e(e,t,n,r){e===void 0&&(e=`Reaction`),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Z.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=Np.NONE,this.name_=e,this.onInvalidate_=t,this.errorHandler_=n,this.requiresObservable_=r}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled||(this.isScheduled=!0,Q.pendingReactions.push(this),rd())},t.runReaction_=function(){if(!this.isDisposed){Xu(),this.isScheduled=!1;var e=Q.trackingContext;if(Q.trackingContext=this,ju(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(e){this.reportExceptionInDerivation_(e)}}Q.trackingContext=e,Zu()}},t.track=function(e){if(!this.isDisposed){Xu(),this.isRunning=!0;var t=Q.trackingContext;Q.trackingContext=this;var n=Nu(this,e,void 0);Q.trackingContext=t,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&Fu(this),Au(n)&&this.reportExceptionInDerivation_(n.cause),Zu()}},t.reportExceptionInDerivation_=function(e){var t=this;if(this.errorHandler_){this.errorHandler_(e,this);return}if(Q.disableErrorBoundaries)throw e;``+this,Q.suppressReactionErrors,Q.globalReactionErrorHandlers.forEach(function(n){return n(e,t)})},t.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(Xu(),Fu(this),Zu()))},t.getDisposer_=function(e){var t=this,n=function n(){t.dispose(),e==null||e.removeEventListener==null||e.removeEventListener(`abort`,n)};return e==null||e.addEventListener==null||e.addEventListener(`abort`,n),n[X]=this,`dispose`in Symbol&&typeof Symbol.dispose==`symbol`&&(n[Symbol.dispose]=n),n},t.toString=function(){return`Reaction[`+this.name_+`]`},t.trace=function(e){e===void 0&&(e=!1)},_l(e,[{key:`isDisposed`,get:function(){return fl(this.flags_,e.isDisposedMask_)},set:function(t){this.flags_=pl(this.flags_,e.isDisposedMask_,t)}},{key:`isScheduled`,get:function(){return fl(this.flags_,e.isScheduledMask_)},set:function(t){this.flags_=pl(this.flags_,e.isScheduledMask_,t)}},{key:`isTrackPending`,get:function(){return fl(this.flags_,e.isTrackPendingMask_)},set:function(t){this.flags_=pl(this.flags_,e.isTrackPendingMask_,t)}},{key:`isRunning`,get:function(){return fl(this.flags_,e.isRunningMask_)},set:function(t){this.flags_=pl(this.flags_,e.isRunningMask_,t)}},{key:`diffValue`,get:function(){return+!!fl(this.flags_,e.diffValueMask_)},set:function(t){this.flags_=pl(this.flags_,e.diffValueMask_,t===1)}}])}(),zp.isDisposedMask_=1,zp.isScheduledMask_=2,zp.isTrackPendingMask_=4,zp.isRunningMask_=8,zp.diffValueMask_=16,Bp=100,Vp=function(e){return e()},Hp=al(`Reaction`,zp),Up=`action`,Wp=`action.bound`,Gp=`autoAction`,Kp=`autoAction.bound`,qp=`<unnamed action>`,Jp=Kl(Up),Yp=Kl(Wp,{bound:!0}),Xp=Kl(Gp,{autoAction:!0}),Zp=Kl(Kp,{autoAction:!0,bound:!0}),Qp=cd(!1),Object.assign(Qp,Jp),$p=cd(!0),Object.assign($p,Xp),Qp.bound=kl(Yp),$p.bound=kl(Zp),em=function(e){return e()},tm=`onBO`,nm=`onBUO`,rm=`never`,im=`always`,am=`observed`,om=0,sm=function(e){function t(){var n=e.call(this,`FLOW_CANCELLED`)||this;return Object.setPrototypeOf(n,(this instanceof t?this.constructor:void 0).prototype),n.name=`FlowCancellationError`,n}xl(t,e);var n=t.prototype;return n.toString=function(){return`Error: `+this.message},t}(Ol(Error)),cm=Ql(`flow`),lm=Ql(`flow.bound`,{bound:!0}),um=Object.assign(function(e,t){if(Ml(t))return cm.decorate_20223_(e,t);if($c(t))return Al(e,t,cm);var n=e,r=n.name||`<unnamed flow>`,i=function(){var e=this,t=arguments,i=++om,a=Qp(r+` - runid: `+i+` - init`,n).apply(e,t),o,s=void 0,c=new Promise(function(e,t){var n=0;o=t;function c(e){s=void 0;var o;try{o=Qp(r+` - runid: `+i+` - yield `+ n++,a.next).call(a,e)}catch(e){return t(e)}u(o)}function l(e){s=void 0;var o;try{o=Qp(r+` - runid: `+i+` - yield `+ n++,a.throw).call(a,e)}catch(e){return t(e)}u(o)}function u(n){if(Qc(n?.then)){n.then(u,t);return}return n.done?e(n.value):(s=Promise.resolve(n.value),s.then(c,l))}c(void 0)});return c.cancel=Qp(r+` - runid: `+i+` - cancel`,function(){try{s&&Ed(s);var e=a.return(void 0),t=Promise.resolve(e.value);t.then(Zf,Zf),Ed(t),o(new sm)}catch(e){o(e)}}),c};return i.isMobXFlow=!0,i},cm),um.bound=kl(lm),dm={has:function(e,t){return of(e).has_(t)},get:function(e,t){return of(e).get_(t)},set:function(e,t,n){return $c(t)?of(e).set_(t,n,!0)??!0:!1},deleteProperty:function(e,t){return $c(t)?of(e).delete_(t,!0)??!0:!1},defineProperty:function(e,t,n){return of(e).defineProperty_(t,n)??!0},ownKeys:function(e){return of(e).ownKeys_()},preventExtensions:function(e){J(13)}},fm=Symbol(`mobx-keys`),pm=`splice`,mm=`update`,hm=1e4,gm={get:function(e,t){var n=e[X];return t===X?n:t===`length`?n.getArrayLength_():typeof t==`string`&&!isNaN(t)?n.get_(parseInt(t)):dl(vm,t)?vm[t]:e[t]},set:function(e,t,n){var r=e[X];return t===`length`&&r.setArrayLength_(n),typeof t==`symbol`||isNaN(t)?e[t]=n:r.set_(parseInt(t),n),!0},preventExtensions:function(){J(15)}},_m=function(){function e(e,t,n,r){e===void 0&&(e=`ObservableArray`),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=n,this.legacyMode_=r,this.atom_=new np(e),this.enhancer_=function(e,n){return t(e,n,`ObservableArray[..]`)}}var t=e.prototype;return t.dehanceValue_=function(e){return this.dehancer===void 0?e:this.dehancer(e)},t.dehanceValues_=function(e){return this.dehancer!==void 0&&e.length>0?e.map(this.dehancer):e},t.intercept_=function(e){return lf(this,e)},t.observe_=function(e,t){return t===void 0&&(t=!1),t&&e({observableKind:`array`,object:this.proxy_,debugObjectName:this.atom_.name_,type:`splice`,index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),ff(this,e)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(e){(typeof e!=`number`||isNaN(e)||e<0)&&J(`Out of range: `+e);var t=this.values_.length;if(e!==t)if(e>t){for(var n=Array(e-t),r=0;r<e-t;r++)n[r]=void 0;this.spliceWithArray_(t,0,n)}else this.spliceWithArray_(e,t-e)},t.updateArrayLength_=function(e,t){e!==this.lastKnownLength_&&J(16),this.lastKnownLength_+=t,this.legacyMode_&&t>0&&jf(e+t+1)},t.spliceWithArray_=function(e,t,n){var r=this;this.atom_;var i=this.values_.length;if(e===void 0?e=0:e>i?e=i:e<0&&(e=Math.max(0,i+e)),t=arguments.length===1?i-e:t==null?0:Math.max(0,Math.min(t,i-e)),n===void 0&&(n=qf),cf(this)){var a=uf(this,{object:this.proxy_,type:pm,index:e,removedCount:t,added:n});if(!a)return qf;t=a.removedCount,n=a.added}if(n=n.length===0?n:n.map(function(e){return r.enhancer_(e,void 0)}),this.legacyMode_){var o=n.length-t;this.updateArrayLength_(i,o)}var s=this.spliceItemsIntoValues_(e,t,n);return(t!==0||n.length!==0)&&this.notifyArraySplice_(e,n,s),this.dehanceValues_(s)},t.spliceItemsIntoValues_=function(e,t,n){if(n.length<hm){var r;return(r=this.values_).splice.apply(r,[e,t].concat(n))}else{var i=this.values_.slice(e,e+t),a=this.values_.slice(e+t);this.values_.length+=n.length-t;for(var o=0;o<n.length;o++)this.values_[e+o]=n[o];for(var s=0;s<a.length;s++)this.values_[e+n.length+s]=a[s];return i}},t.notifyArrayChildUpdate_=function(e,t,n){var r=!this.owned_&&od(),i=df(this),a=i||r?{observableKind:`array`,object:this.proxy_,type:mm,debugObjectName:this.atom_.name_,index:e,newValue:t,oldValue:n}:null;this.atom_.reportChanged(),i&&pf(this,a)},t.notifyArraySplice_=function(e,t,n){var r=!this.owned_&&od(),i=df(this),a=i||r?{observableKind:`array`,object:this.proxy_,debugObjectName:this.atom_.name_,type:pm,index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;this.atom_.reportChanged(),i&&pf(this,a)},t.get_=function(e){if(!(this.legacyMode_&&e>=this.values_.length))return this.atom_.reportObserved(),this.dehanceValue_(this.values_[e])},t.set_=function(e,t){var n=this.values_;if(this.legacyMode_&&e>n.length&&J(17,e,n.length),e<n.length){this.atom_;var r=n[e];if(cf(this)){var i=uf(this,{type:mm,object:this.proxy_,index:e,newValue:t});if(!i)return;t=i.newValue}t=this.enhancer_(t,r),t!==r&&(n[e]=t,this.notifyArrayChildUpdate_(e,t,r))}else{for(var a=Array(e+1-n.length),o=0;o<a.length-1;o++)a[o]=void 0;a[a.length-1]=t,this.spliceWithArray_(n.length,0,a)}},e}(),vm={clear:function(){return this.splice(0)},replace:function(e){var t=this[X];return t.spliceWithArray_(0,t.values_.length,e)},toJSON:function(){return this.slice()},splice:function(e,t){var n=[...arguments].slice(2),r=this[X];switch(arguments.length){case 0:return[];case 1:return r.spliceWithArray_(e);case 2:return r.spliceWithArray_(e,t)}return r.spliceWithArray_(e,t,n)},spliceWithArray:function(e,t,n){return this[X].spliceWithArray_(e,t,n)},push:function(){var e=this[X],t=[...arguments];return e.spliceWithArray_(e.values_.length,0,t),e.values_.length},pop:function(){return this.splice(Math.max(this[X].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){var e=this[X],t=[...arguments];return e.spliceWithArray_(0,0,t),e.values_.length},reverse:function(){return Q.trackingDerivation&&J(37,`reverse`),this.replace(this.slice().reverse()),this},sort:function(){Q.trackingDerivation&&J(37,`sort`);var e=this.slice();return e.sort.apply(e,arguments),this.replace(e),this},remove:function(e){var t=this[X],n=t.dehanceValues_(t.values_).indexOf(e);return n>-1?(this.splice(n,1),!0):!1}},Y(`at`,_f),Y(`concat`,_f),Y(`flat`,_f),Y(`includes`,_f),Y(`indexOf`,_f),Y(`join`,_f),Y(`lastIndexOf`,_f),Y(`slice`,_f),Y(`toString`,_f),Y(`toLocaleString`,_f),Y(`toSorted`,_f),Y(`toSpliced`,_f),Y(`with`,_f),Y(`every`,vf),Y(`filter`,vf),Y(`find`,vf),Y(`findIndex`,vf),Y(`findLast`,vf),Y(`findLastIndex`,vf),Y(`flatMap`,vf),Y(`forEach`,vf),Y(`map`,vf),Y(`some`,vf),Y(`toReversed`,vf),Y(`reduce`,yf),Y(`reduceRight`,yf),ym=al(`ObservableArrayAdministration`,_m),bm={},xm=`add`,Sm=`delete`,Cm=function(){function e(e,t,n){var r=this;t===void 0&&(t=Rl),n===void 0&&(n=`ObservableMap`),this.enhancer_=void 0,this.name_=void 0,this[X]=bm,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=t,this.name_=n,Qc(Map)||J(18),If(function(){r.keysAtom_=Nl(`ObservableMap.keys()`),r.data_=new Map,r.hasMap_=new Map,e&&r.merge(e)})}var t=e.prototype;return t.has_=function(e){return this.data_.has(e)},t.has=function(e){var t=this;if(!Q.trackingDerivation)return this.has_(e);var n=this.hasMap_.get(e);if(!n){var r=n=new kp(this.has_(e),Bl,`ObservableMap.key?`,!1);this.hasMap_.set(e,r),gd(r,function(){return t.hasMap_.delete(e)})}return n.get()},t.set=function(e,t){var n=this.has_(e);if(cf(this)){var r=uf(this,{type:n?mm:xm,object:this,newValue:t,name:e});if(!r)return this;t=r.newValue}return n?this.updateValue_(e,t):this.addValue_(e,t),this},t.delete=function(e){var t=this;if(this.keysAtom_,cf(this)&&!uf(this,{type:Sm,object:this,name:e}))return!1;if(this.has_(e)){var n=od(),r=df(this),i=r||n?{observableKind:`map`,debugObjectName:this.name_,type:Sm,object:this,oldValue:this.data_.get(e).value_,name:e}:null;return tf(function(){var n;t.keysAtom_.reportChanged(),(n=t.hasMap_.get(e))==null||n.setNewValue_(!1),t.data_.get(e).setNewValue_(void 0),t.data_.delete(e)}),r&&pf(this,i),!0}return!1},t.updateValue_=function(e,t){var n=this.data_.get(e);if(t=n.prepareNewValue_(t),t!==Q.UNCHANGED){var r=od(),i=df(this),a=i||r?{observableKind:`map`,debugObjectName:this.name_,type:mm,object:this,oldValue:n.value_,name:e,newValue:t}:null;n.setNewValue_(t),i&&pf(this,a)}},t.addValue_=function(e,t){var n=this;this.keysAtom_,tf(function(){var r,i=new kp(t,n.enhancer_,`ObservableMap.key`,!1);n.data_.set(e,i),t=i.value_,(r=n.hasMap_.get(e))==null||r.setNewValue_(!0),n.keysAtom_.reportChanged()});var r=od(),i=df(this),a=i||r?{observableKind:`map`,debugObjectName:this.name_,type:xm,object:this,name:e,newValue:t}:null;i&&pf(this,a)},t.get=function(e){return this.has(e)?this.dehanceValue_(this.data_.get(e).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(e){return this.dehancer===void 0?e:this.dehancer(e)},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var e=this,t=this.keys();return xf({next:function(){var n=t.next(),r=n.done,i=n.value;return{done:r,value:r?void 0:e.get(i)}}})},t.entries=function(){var e=this,t=this.keys();return xf({next:function(){var n=t.next(),r=n.done,i=n.value;return{done:r,value:r?void 0:[i,e.get(i)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(e,t){for(var n=vl(this),r;!(r=n()).done;){var i=r.value,a=i[0],o=i[1];e.call(t,o,a,this)}},t.merge=function(e){var t=this;return wm(e)&&(e=new Map(e)),tf(function(){tl(e)?ll(e).forEach(function(n){return t.set(n,e[n])}):Array.isArray(e)?e.forEach(function(e){var n=e[0],r=e[1];return t.set(n,r)}):ol(e)?(sl(e)||J(19,e),e.forEach(function(e,n){return t.set(n,e)})):e!=null&&J(20,e)}),this},t.clear=function(){var e=this;tf(function(){Iu(function(){for(var t=vl(e.keys()),n;!(n=t()).done;){var r=n.value;e.delete(r)}})})},t.replace=function(e){var t=this;return tf(function(){for(var n=Sf(e),r=new Map,i=!1,a=vl(t.data_.keys()),o;!(o=a()).done;){var s=o.value;if(!n.has(s))if(t.delete(s))i=!0;else{var c=t.data_.get(s);r.set(s,c)}}for(var l=vl(n.entries()),u;!(u=l()).done;){var d=u.value,f=d[0],p=d[1],m=t.data_.has(f);if(t.set(f,p),t.data_.has(f)){var h=t.data_.get(f);r.set(f,h),m||(i=!0)}}if(!i)if(t.data_.size!==r.size)t.keysAtom_.reportChanged();else for(var g=t.data_.keys(),_=r.keys(),v=g.next(),y=_.next();!v.done;){if(v.value!==y.value){t.keysAtom_.reportChanged();break}v=g.next(),y=_.next()}t.data_=r}),this},t.toString=function(){return`[object ObservableMap]`},t.toJSON=function(){return Array.from(this)},t.observe_=function(e,t){return ff(this,e)},t.intercept_=function(e){return lf(this,e)},_l(e,[{key:`size`,get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return`Map`}}])}(),wm=al(`ObservableMap`,Cm),Tm={},Em=function(){function e(e,t,n){var r=this;t===void 0&&(t=Rl),n===void 0&&(n=`ObservableSet`),this.name_=void 0,this[X]=Tm,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=n,Qc(Set)||J(22),this.enhancer_=function(e,r){return t(e,r,n)},If(function(){r.atom_=Nl(r.name_),e&&r.replace(e)})}var t=e.prototype;return t.dehanceValue_=function(e){return this.dehancer===void 0?e:this.dehancer(e)},t.clear=function(){var e=this;tf(function(){Iu(function(){for(var t=vl(e.data_.values()),n;!(n=t()).done;){var r=n.value;e.delete(r)}})})},t.forEach=function(e,t){for(var n=vl(this),r;!(r=n()).done;){var i=r.value;e.call(t,i,i,this)}},t.add=function(e){var t=this;if(this.atom_,cf(this)){var n=uf(this,{type:xm,object:this,newValue:e});if(!n)return this;e=n.newValue}if(!this.has(e)){tf(function(){t.data_.add(t.enhancer_(e,void 0)),t.atom_.reportChanged()});var r=!1,i=df(this),a=i||r?{observableKind:`set`,debugObjectName:this.name_,type:xm,object:this,newValue:e}:null;i&&pf(this,a)}return this},t.delete=function(e){var t=this;if(cf(this)&&!uf(this,{type:Sm,object:this,oldValue:e}))return!1;if(this.has(e)){var n=!1,r=df(this),i=r||n?{observableKind:`set`,debugObjectName:this.name_,type:Sm,object:this,oldValue:e}:null;return tf(function(){t.atom_.reportChanged(),t.data_.delete(e)}),r&&pf(this,i),!0}return!1},t.has=function(e){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(e))},t.entries=function(){var e=this.values();return Cf({next:function(){var t=e.next(),n=t.value,r=t.done;return r?{value:void 0,done:r}:{value:[n,n],done:r}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var e=this,t=this.data_.values();return Cf({next:function(){var n=t.next(),r=n.value,i=n.done;return i?{value:void 0,done:i}:{value:e.dehanceValue_(r),done:i}}})},t.intersection=function(e){return cl(e)&&!Dm(e)?e.intersection(this):new Set(this).intersection(e)},t.union=function(e){return cl(e)&&!Dm(e)?e.union(this):new Set(this).union(e)},t.difference=function(e){return new Set(this).difference(e)},t.symmetricDifference=function(e){return cl(e)&&!Dm(e)?e.symmetricDifference(this):new Set(this).symmetricDifference(e)},t.isSubsetOf=function(e){return new Set(this).isSubsetOf(e)},t.isSupersetOf=function(e){return new Set(this).isSupersetOf(e)},t.isDisjointFrom=function(e){return cl(e)&&!Dm(e)?e.isDisjointFrom(this):new Set(this).isDisjointFrom(e)},t.replace=function(e){var t=this;return Dm(e)&&(e=new Set(e)),tf(function(){Array.isArray(e)||cl(e)?(t.clear(),e.forEach(function(e){return t.add(e)})):e!=null&&J(`Cannot initialize set from `+e)}),this},t.observe_=function(e,t){return ff(this,e)},t.intercept_=function(e){return lf(this,e)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return`[object ObservableSet]`},t[Symbol.iterator]=function(){return this.values()},_l(e,[{key:`size`,get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return`Set`}}])}(),Dm=al(`ObservableSet`,Em),Om=Object.create(null),km=`remove`,Am=function(){function e(e,t,n,r){t===void 0&&(t=new Map),r===void 0&&(r=cp),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=e,this.values_=t,this.name_=n,this.defaultAnnotation_=r,this.keysAtom_=new np(`ObservableObject.keys`),this.isPlainObject_=tl(this.target_)}var t=e.prototype;return t.getObservablePropValue_=function(e){return this.values_.get(e).get()},t.setObservablePropValue_=function(e,t){var n=this.values_.get(e);if(n instanceof jp)return n.set(t),!0;if(cf(this)){var r=uf(this,{type:mm,object:this.proxy_||this.target_,name:e,newValue:t});if(!r)return null;t=r.newValue}if(t=n.prepareNewValue_(t),t!==Q.UNCHANGED){var i=df(this),a=i?{type:mm,observableKind:`object`,debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:n.value_,name:e,newValue:t}:null;n.setNewValue_(t),i&&pf(this,a)}return!0},t.get_=function(e){return Q.trackingDerivation&&!dl(this.target_,e)&&this.has_(e),this.target_[e]},t.set_=function(e,t,n){return n===void 0&&(n=!1),dl(this.target_,e)?this.values_.has(e)?this.setObservablePropValue_(e,t):n?Reflect.set(this.target_,e,t):(this.target_[e]=t,!0):this.extend_(e,{value:t,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,n)},t.has_=function(e){if(!Q.trackingDerivation)return e in this.target_;this.pendingKeys_||=new Map;var t=this.pendingKeys_.get(e);return t||(t=new kp(e in this.target_,Bl,`ObservableObject.key?`,!1),this.pendingKeys_.set(e,t)),t.get()},t.make_=function(e,t){if(t===!0&&(t=this.defaultAnnotation_),t!==!1){if(!(e in this.target_)){var n;if((n=this.target_[tp])!=null&&n[e])return;J(1,t.annotationType_,this.name_+`.`+e.toString())}for(var r=this.target_;r&&r!==Kf;){var i=Wf(r,e);if(i){var a=t.make_(this,e,i,r);if(a===0)return;if(a===1)break}r=Object.getPrototypeOf(r)}Df(this,t,e)}},t.extend_=function(e,t,n,r){if(r===void 0&&(r=!1),n===!0&&(n=this.defaultAnnotation_),n===!1)return this.defineProperty_(e,t,r);var i=n.extend_(this,e,t,r);return i&&Df(this,n,e),i},t.defineProperty_=function(e,t,n){n===void 0&&(n=!1),this.keysAtom_;try{Xu();var r=this.delete_(e);if(!r)return r;if(cf(this)){var i=uf(this,{object:this.proxy_||this.target_,name:e,type:xm,newValue:t.value});if(!i)return null;var a=i.newValue;t.value!==a&&(t=yl({},t,{value:a}))}if(n){if(!Reflect.defineProperty(this.target_,e,t))return!1}else Gf(this.target_,e,t);this.notifyPropertyAddition_(e,t.value)}finally{Zu()}return!0},t.defineObservableProperty_=function(e,t,n,r){r===void 0&&(r=!1),this.keysAtom_;try{Xu();var i=this.delete_(e);if(!i)return i;if(cf(this)){var a=uf(this,{object:this.proxy_||this.target_,name:e,type:xm,newValue:t});if(!a)return null;t=a.newValue}var o=Tf(e),s={configurable:Q.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:o.get,set:o.set};if(r){if(!Reflect.defineProperty(this.target_,e,s))return!1}else Gf(this.target_,e,s);var c=new kp(t,n,`ObservableObject.key`,!1);this.values_.set(e,c),this.notifyPropertyAddition_(e,c.value_)}finally{Zu()}return!0},t.defineComputedProperty_=function(e,t,n){n===void 0&&(n=!1),this.keysAtom_;try{Xu();var r=this.delete_(e);if(!r)return r;if(cf(this)&&!uf(this,{object:this.proxy_||this.target_,name:e,type:xm,newValue:void 0}))return null;t.name||=`ObservableObject.key`,t.context=this.proxy_||this.target_;var i=Tf(e),a={configurable:Q.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:i.get,set:i.set};if(n){if(!Reflect.defineProperty(this.target_,e,a))return!1}else Gf(this.target_,e,a);this.values_.set(e,new jp(t)),this.notifyPropertyAddition_(e,void 0)}finally{Zu()}return!0},t.delete_=function(e,t){if(t===void 0&&(t=!1),this.keysAtom_,!dl(this.target_,e))return!0;if(cf(this)&&!uf(this,{object:this.proxy_||this.target_,name:e,type:km}))return null;try{var n;Xu();var r=df(this),i=!1,a=this.values_.get(e),o=void 0;if(!a&&(r||i)&&(o=Wf(this.target_,e)?.value),t){if(!Reflect.deleteProperty(this.target_,e))return!1}else delete this.target_[e];if(a&&(this.values_.delete(e),a instanceof kp&&(o=a.value_),$u(a)),this.keysAtom_.reportChanged(),(n=this.pendingKeys_)==null||(n=n.get(e))==null||n.set(e in this.target_),r||i){var s={type:km,observableKind:`object`,object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:o,name:e};r&&pf(this,s)}}finally{Zu()}return!0},t.observe_=function(e,t){return ff(this,e)},t.intercept_=function(e){return lf(this,e)},t.notifyPropertyAddition_=function(e,t){var n,r=df(this),i=!1;if(r||i){var a=r||i?{type:xm,observableKind:`object`,debugObjectName:this.name_,object:this.proxy_||this.target_,name:e,newValue:t}:null;r&&pf(this,a)}(n=this.pendingKeys_)==null||(n=n.get(e))==null||n.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),$f(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}(),jm=al(`ObservableObjectAdministration`,Am),Mm=kf(0),Nm=function(){var e=!1,t={};return Object.defineProperty(t,`0`,{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),Pm=0,Fm=function(){},Of(Fm,Array.prototype),Im=function(e){function t(t,n,r,i){var a;return r===void 0&&(r=`ObservableArray`),i===void 0&&(i=!1),a=e.call(this)||this,If(function(){var e=new _m(r,n,i,!0);e.proxy_=a,il(a,X,e),t&&t.length&&a.spliceWithArray(0,0,t),Nm&&Object.defineProperty(a,`0`,Mm)}),a}xl(t,e);var n=t.prototype;return n.concat=function(){this[X].atom_.reportObserved();var e=[...arguments];return Array.prototype.concat.apply(this.slice(),e.map(function(e){return bf(e)?e.slice():e}))},n[Symbol.iterator]=function(){var e=this,t=0;return Bf({next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0,value:void 0}}})},_l(t,[{key:`length`,get:function(){return this[X].getArrayLength_()},set:function(e){this[X].setArrayLength_(e)}},{key:Symbol.toStringTag,get:function(){return`Array`}}])}(Fm),Object.entries(vm).forEach(function(e){var t=e[0],n=e[1];t!==`concat`&&rl(Im.prototype,t,n)}),jf(1e3),Lm=Kf.toString,Rm=Yc().Iterator?.prototype||{},[`Symbol`,`Map`,`Set`].forEach(function(e){Yc()[e]===void 0&&J(`MobX requires global '`+e+`' to be available or polyfilled`)}),typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__==`object`&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:sd,extras:{getDebugName:Ff},$mobx:X})})),Bm=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DebounceActionTimer=void 0;var t=(zm(),n(Jc));e.DebounceActionTimer=class{constructor(e,n){this.debounceMs=e,this.handler=n,this.requests=[],this.startTime=0,this.tick=()=>{let e=this.debounceMs<=0;if(this.debounceMs>0&&Date.now()-this.startTime>=this.debounceMs&&(e=!0),e){let e=this.requests.slice(),t=this.handler(e);typeof t==`object`&&`then`in t?Promise.resolve(t).then(t=>{this.handleResponses(e,t)}):this.handleResponses(e,t),this.requests=[]}else this.nextTick(this.tick)},this.handleResponses=(e,n)=>{(0,t.runInAction)(()=>{for(let t=0;t<e.length;t++){let r=e[t],i=n[t];r.action(i)}});for(let t of e)t.resolver()}}call(e,t){return new Promise(n=>{let r=this.requests.length===0;this.requests.push({args:e,action:t,resolver:n}),r&&this.startTimer()})}startTimer(){this.startTime=Date.now(),this.nextTick(this.tick)}nextTick(e){if(this.debounceMs<=0){Promise.resolve().then(e);return}typeof window<`u`&&window.requestAnimationFrame?window.requestAnimationFrame(e):setTimeout(e,this.debounceMs)}}})),Vm=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(qc(),e),n(Bm(),e)})),Hm=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.Debouncer=void 0,e.Debouncer=class{static promise(e){let n;return(...r)=>t(this,void 0,void 0,function*(){if(n)return n;try{return n=e.apply(this,r),yield n}finally{n=void 0}})}}})),Um=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(Hm(),e)})),Wm=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.unescapeHTML=e.escapeHTML=void 0;function t(e){return e.replace(/</g,`\\u003c`).replace(/>/g,`\\u003e`).replace(/&/g,`\\u0026`)}e.escapeHTML=t;function n(e){return e.replace(/\\u003c/g,`<`).replace(/\\u003e/g,`>`).replace(/\\u0026/g,`&`)}e.unescapeHTML=n})),Gm=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.sortedJsonByKeyStringify=e.sortObjectByKey=void 0;function t(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map(t);let n=Object.keys(e).sort(),r={};return n.forEach(n=>{r[n]=t(e[n])}),r}e.sortObjectByKey=t;function n(e){return JSON.stringify(t(e))}e.sortedJsonByKeyStringify=n})),Km=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(Gm(),e)})),qm=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateICNSName=e.parseICNSName=void 0;function t(e){let t=e.split(`.`);if(t.length===2&&t[0].length>0&&t[1].length>0)return[t[0],t[1]]}e.parseICNSName=t;function n(e,n){let r=t(e);return r?r[1]===n:!1}e.validateICNSName=n})),Jm=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(jc(),e),n(Kc(),e),n(Vm(),e),n(Um(),e),n(Wm(),e),n(Km(),e),n(qm(),e)})),Ym=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.serializeSignDoc=e.encodeSecp256k1Signature=e.encodeSecp256k1Pubkey=void 0;var t=(_(),n(v)),r=Jm();function i(e){if(e.length!==33||e[0]!==2&&e[0]!==3)throw Error(`Public key must be compressed secp256k1, i.e. 33 bytes starting with 0x02 or 0x03`);return{type:`tendermint/PubKeySecp256k1`,value:t.Buffer.from(e).toString(`base64`)}}e.encodeSecp256k1Pubkey=i;function a(e,n){if(n.length!==64)throw Error(`Signature must be 64 bytes long. Cosmos SDK uses a 2x32 byte fixed length encoding for the secp256k1 signature integers r and s.`);return{pub_key:i(e),signature:t.Buffer.from(n).toString(`base64`)}}e.encodeSecp256k1Signature=a;function o(e){return t.Buffer.from((0,r.escapeHTML)((0,r.sortedJsonByKeyStringify)(e)))}e.serializeSignDoc=o})),Xm=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(Ym(),e)})),Zm=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.verifyADR36Amino=e.verifyADR36AminoSignDoc=e.makeADR36AminoSignDoc=e.checkAndValidateADR36AminoSignDoc=void 0;var t=Xm(),r=ks(),i=(_(),n(v)),a=Gc();function o(e,t){if(!(e&&e.msgs&&Array.isArray(e.msgs)&&e.msgs.length===1&&e.msgs[0].type===`sign/MsgSignData`))return!1;if(e.chain_id!==``)throw Error(`Chain id should be empty string for ADR-36 signing`);if(e.memo!==``)throw Error(`Memo should be empty string for ADR-36 signing`);if(e.account_number!==`0`)throw Error(`Account number should be "0" for ADR-36 signing`);if(e.sequence!==`0`)throw Error(`Sequence should be "0" for ADR-36 signing`);if(e.fee.gas!==`0`)throw Error(`Gas should be "0" for ADR-36 signing`);if(e.fee.amount.length!==0)throw Error(`Fee amount should be empty array for ADR-36 signing`);let n=e.msgs[0];if(n.type!==`sign/MsgSignData`)throw Error(`Invalid type of ADR-36 sign msg: ${n.type}`);if(!n.value)throw Error(`Empty value in the msg`);let a=n.value.signer;if(!a)throw Error(`Empty signer in the ADR-36 msg`);r.Bech32Address.validate(a,t);let o=n.value.data;if(!o)throw Error(`Empty data in the ADR-36 msg`);let s=i.Buffer.from(o,`base64`);if(s.toString(`base64`)!==o)throw Error(`Data is not encoded by base64`);if(s.length===0)throw Error(`Empty data in the ADR-36 msg`);return!0}e.checkAndValidateADR36AminoSignDoc=o;function s(e,t){return t=i.Buffer.from(t).toString(`base64`),{chain_id:``,account_number:`0`,sequence:`0`,fee:{gas:`0`,amount:[]},msgs:[{type:`sign/MsgSignData`,value:{signer:e,data:t}}],memo:``}}e.makeADR36AminoSignDoc=s;function c(e,n,i,s,c=`secp256k1`){if(!o(n,e))throw Error(`Invalid sign doc for ADR-36`);let l=new a.PubKeySecp256k1(i);if((c===`ethsecp256k1`?new r.Bech32Address(l.getEthAddress()).toBech32(e):new r.Bech32Address(l.getCosmosAddress()).toBech32(e))!==n.msgs[0].value.signer)throw Error(`Unmatched signer`);let u=(0,t.serializeSignDoc)(n);return l.verifyDigest32(c===`ethsecp256k1`?a.Hash.keccak256(u):a.Hash.sha256(u),s)}e.verifyADR36AminoSignDoc=c;function l(e,t,n,r,i,a=`secp256k1`){return c(e,s(t,n),r,i,a)}e.verifyADR36Amino=l})),Qm=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(Zm(),e)})),$m=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SignDocWrapper=void 0;var t=Sc(),n=xc(),r=Qm();e.SignDocWrapper=class e{constructor(e){this.signDoc=e,`msgs`in e?this.mode=`amino`:this.mode=`direct`,this.mode===`amino`?this.isADR36SignDoc=(0,r.checkAndValidateADR36AminoSignDoc)(this.aminoSignDoc):this.isADR36SignDoc=!1}static fromAminoSignDoc(t){return new e(t)}static fromDirectSignDoc(t){return new e(t)}static fromDirectSignDocBytes(t){return new e(n.SignDoc.decode(t))}clone(){return new e(this.signDoc)}get protoSignDoc(){if(this.mode===`amino`)throw Error(`Sign doc is encoded as Amino Json`);if(`msgs`in this.signDoc)throw Error(`Unexpected error`);return this._protoSignDoc||=new t.ProtoSignDocDecoder(this.signDoc),this._protoSignDoc}get aminoSignDoc(){if(this.mode===`direct`)throw Error(`Sign doc is encoded as Protobuf`);if(!(`msgs`in this.signDoc))throw Error(`Unexpected error`);return this.signDoc}get chainId(){return this.mode===`direct`?this.protoSignDoc.chainId:this.aminoSignDoc.chain_id}get memo(){return this.mode===`direct`?this.protoSignDoc.txBody.memo:this.aminoSignDoc.memo}get fees(){if(this.mode===`direct`){let e=[];for(let t of this.protoSignDoc.authInfo.fee?.amount??[]){if(t.denom==null||t.amount==null)throw Error(`Invalid fee`);e.push({denom:t.denom,amount:t.amount})}return e}return this.aminoSignDoc.fee.amount}get payer(){return this.mode===`direct`?this.protoSignDoc.authInfo.fee?.payer:this.aminoSignDoc.fee.payer}get granter(){return this.mode===`direct`?this.protoSignDoc.authInfo.fee?.granter:this.aminoSignDoc.fee.granter}get gas(){return this.mode===`direct`?this.protoSignDoc.authInfo.fee?.gasLimit?parseInt(this.protoSignDoc.authInfo.fee.gasLimit):0:parseInt(this.aminoSignDoc.fee.gas)}}})),eh=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(vc(),e),n(Sc(),e),n($m(),e)})),th=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(oo(),e),n(ks(),e),n(Ms(),e),n(Ps(),e),n(eh(),e),n(Qm(),e),n(Xm(),e)})),nh=Ha(),rh=th(),ih=i(Fn()),ah=e=>e.apis?.rpc?.[0]?.address??``,oh=e=>e.apis?.rest?.[0]?.address??``,sh=e=>e.explorers?.[0]?.url??``,ch={fullSemver:/v?(\d+\.\d+\.\d+)(?=-[\w.-]+|$)/,partialSemver:/v?(\d+\.\d+)(?=(?:\.\d+)?(?=-[\w.-]+|$))/,basicVersion:/v?(\d+)(?=(?:\.\d+)?(?:\.\d+)?(?=-[\w.-]+|$))/,tagged:/@v(\d+\.\d+)(?:\.x)?(?=-[\w.-]+|$)/,embedded:/\/v(\d+\.\d+\.\d+)(?=-[\w.-]+|$)/,simple:/v?(\d+)(?:\.(\d+))?(?:\.(\d+))?$/,complexEmbedded:/[\w-]+\/[\w-]+ v(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:-\d+[\w.-]*)/,taggedVersion:/[\w-]+\/[\w-]+ v(\d+)(?:\.(\d+))?(?:\.(\d+))?(?=-[\w.-]+|$)/};function lh(e){let t=null;return ch.fullSemver.test(e)?t=e.match(ch.fullSemver)?.[1]:ch.partialSemver.test(e)?t=e.match(ch.partialSemver)?.[1]:ch.basicVersion.test(e)?t=e.match(ch.basicVersion)?.[1]:ch.taggedVersion.test(e)?t=e.match(ch.taggedVersion)?.[1]:ch.complexEmbedded.test(e)?t=e.match(ch.complexEmbedded)?.[1]:ch.simple.test(e)?t=e.match(ch.simple)?.[1]:ch.tagged.test(e)?t=e.match(ch.tagged)?.[1]:ch.embedded.test(e)&&(t=e.match(ch.embedded)?.[1]),t?uh(t):null}function uh(e){let t=e.split(`.`);for(;t.length<3;)t.push(`0`);return t.join(`.`)}var dh=(e,t,n={getRpcEndpoint:ah,getRestEndpoint:oh,getExplorer:sh})=>{n.getRestEndpoint||=oh,n.getRpcEndpoint||=ah,n.getExplorer||=sh;let r=[];if(e.codebase?.sdk?.type===`cosmos`||e.codebase?.cosmos_sdk_version){let t;if(t=e.codebase?.sdk?.type===`cosmos`&&e.codebase.sdk.version?lh(e.codebase.sdk.version):e.codebase?.cosmos_sdk_version?lh(e.codebase.cosmos_sdk_version):`0.40.0`,ih.default.satisfies(t,`>=0.40`)&&r.push(`stargate`),ih.default.satisfies(t,`>=0.43`)&&r.push(`no-legacy-stdTx`),r.push(`ibc-transfer`),ih.default.satisfies(t,`>=0.45`)&&r.push(`ibc-go`),e.codebase?.cosmwasm?.enabled??e.codebase?.cosmwasm_enabled??!1){r.push(`cosmwasm`);let t=lh(e.codebase?.cosmwasm?.version??e.codebase?.cosmwasm_version??`0.24.0`);ih.default.satisfies(t,`>=0.24.0`)&&r.push(`wasmd_0.24+`)}}let i=t.find(t=>t.chain_name===e.chain_name)?.assets||[],a=e.fees?.fee_tokens.map(e=>e.denom)||[],o=e.fees?.fee_tokens?.reduce((e,t)=>(e[t.denom]={low:t.low_gas_price??.01,average:t.average_gas_price??.025,high:t.high_gas_price??.04},e),{}),s=e.staking?.staking_tokens.map(e=>e.denom)||[],c=i.map(e=>({coinDenom:e.symbol,coinMinimalDenom:e.base,coinDecimals:e.denom_units.filter(t=>t.denom===e.display)[0]?.exponent,coinGeckoId:e.coingecko_id||void 0,coinImageUrl:e.logo_URIs?.svg??e.logo_URIs?.png})),l=c.find(e=>s.includes(e.coinDenom))??c[0],u=c.filter(e=>a.includes(e.coinMinimalDenom)).map(e=>{if(!(e.coinMinimalDenom in o))return e;let t=o[e.coinMinimalDenom];return{...e,gasPriceStep:t}}),d=c.filter(e=>l.coinDenom===e.coinDenom).map(e=>{if(!(e.coinMinimalDenom in o))return e;let t=o[e.coinMinimalDenom];return{...e,gasPriceStep:t}});return{rpc:n.getRpcEndpoint(e),rest:n.getRestEndpoint(e),chainId:e.chain_id,chainName:e.pretty_name,bip44:{coinType:e.slip44},bech32Config:rh.Bech32Address.defaultBech32Config(e.bech32_prefix),currencies:c,stakeCurrency:l||c[0],feeCurrencies:u.length===0?d:u,features:r}},fh=i(G()),ph=class{static addItem(e,t,n){let r={value:t,expiry:new Date().getTime()+n},i=localStorage.getItem(e),a=i?JSON.parse(i):[];a.push(r),localStorage.setItem(e,JSON.stringify(a))}static getItems(e){let t=localStorage.getItem(e);if(!t)return[];let n=JSON.parse(t),r=new Date,i=[];for(let e of n)r.getTime()<=e.expiry&&i.push(e.value);return localStorage.setItem(e,JSON.stringify(i.map(e=>({value:e,expiry:n.find(t=>t.value===e).expiry})))),i}static removeItem(e,t){let n=localStorage.getItem(e);if(!n)return;let r=JSON.parse(n);r=r.filter(e=>e.value!==t),localStorage.setItem(e,JSON.stringify(r))}},mh=class{client;_defaultSignOptions={preferNoSetFee:!1,preferNoSetMemo:!0,disableBalanceCheck:!0};get defaultSignOptions(){return this._defaultSignOptions}setDefaultSignOptions(e){this._defaultSignOptions=e}constructor(e){this.client=e}async enable(e){await this.client.enable(e)}async suggestToken({chainId:e,tokens:t,type:n}){if(n===`cw20`)for(let{contractAddress:n,viewingKey:r}of t)await this.client.suggestToken(e,n,r)}async getSimpleAccount(e){let{address:t,username:n}=await this.getAccount(e);return{namespace:`cosmos`,chainId:e,address:t,username:n}}async getAccount(e){let t=await this.client.getKey(e);return{username:t.name,address:t.bech32Address,algo:t.algo,pubkey:t.pubKey,isNanoLedger:t.isNanoLedger}}getOfflineSigner(e,t){switch(t){case`amino`:return this.getOfflineSignerAmino(e);case`direct`:return this.getOfflineSignerDirect(e);default:return this.getOfflineSignerAmino(e)}}getOfflineSignerAmino(e){return{getAccounts:async()=>[await this.getAccount(e)],signAmino:async(t,n)=>this.signAmino(e,t,n,this.defaultSignOptions)}}getOfflineSignerDirect(e){return{getAccounts:async()=>[await this.getAccount(e)],signDirect:async(t,n)=>{let r=await this.signDirect(e,t,n,this.defaultSignOptions);return{...r,signed:{...r.signed,accountNumber:BigInt(r.signed.accountNumber.toString())}}}}}async addChain(e){let t=ph.getItems(`cosmos-kit@2:keplr/supported-chain`);if(t&&t.length>0&&t.includes(e.name))return;let n=dh(e.chain,e.assetList?[e.assetList]:[]);e.preferredEndpoints?.rest?.[0]&&(n.rest=e.preferredEndpoints?.rest?.[0]),e.preferredEndpoints?.rpc?.[0]&&(n.rpc=e.preferredEndpoints?.rpc?.[0]);try{await this.client.experimentalSuggestChain(n),ph.addItem(`cosmos-kit@2:keplr/supported-chain`,e.name,1e3*60)}catch(e){throw e}}async signAmino(e,t,n,r){return await this.client.signAmino(e,t,n,r||this.defaultSignOptions)}async signArbitrary(e,t,n){return await this.client.signArbitrary(e,t,n)}async signDirect(e,t,n,r){let i=await this.client.signDirect(e,t,{...n,accountNumber:fh.default.fromString(n.accountNumber.toString())},r||this.defaultSignOptions);return{...i,signed:{...i.signed,accountNumber:BigInt(i.signed.accountNumber.toString())}}}async sendTx(e,t,n){return await this.client.sendTx(e,t,n)}},hh=[new class extends qr{constructor(e,t){super(e,Yi),this.preferredEndpoints=t}async initClient(){this.initingClient();try{let e=await nh.Keplr.getKeplr();this.initClientDone(e?new mh(e):void 0)}catch(e){this.initClientError(e)}}}({name:`keplr-extension`,prettyName:`Keplr`,logo:`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAB+ASURBVHgB7Z1NbFxVlsfPKzsfTUJc6baZjkTcFTELJLA6ySzQJJGwe9FSmAXxzAJ604QN9GJomgVsoEUi0RtY8NWLhg2kN8NqKlkMGbHARgpILDoYGSQ2KIWNFIQNKZskhNiu1/f/PpxyuapcH/e+e+595yc9XrnKuFKv3jn3fN+AhK4pla8Uq3SjuI0GiiEFxYCCUvpaSGH0OCAaqgVhMX0+CAM8Ltb/nSD6OSi2e68w+p2w7e/wJaiqz1ht/zthNWzyO2EQVtb/Shh8VfeS+pvx362p/xdPrNJqpUg7q5XJvVu8l9BIQMI6EOxrtFIiKhxUgqwEm34FIVY3YCkV8lTABa5AOYQVKBUokUIYQMF8VaCgAoWxmwZnRFHcIpcKoFi+XNpO2w6qG6KkbpJfq5tECXxQcnelFbojUAognKHY8vhUHdODNFj5ZnJvhXKG9woAq/pVWj2oHuK4X33kcRF0oTnriuEDdUwvTo5Mk+d4qQBGyt9iRR9XDx9UH/GgCLzQB9PqOKfciumFyTtmyDO8UQDD5YXxIBb4E+KnCyZQcaAKRQqh9qovysBpBZCY90+qhycoNvEFIRNiZVA7PUDbpl2OHTipANLVXpn5J8W8F2yjlMHbAzRw2kVF4JQCgOCr0/PqGCdBYIaLisAJBfDL8pXSKq2+RSL4ggO4pAhYK4DEx8eK/ycSBMdwQRGwVQAj5757MqyFp8THF1wmDRaqrMHbxBB2CkDMfcFHoAiUNTDBzRooECOw6q/S2ickwi94BmpT1MJ2SQWynydGsLAAZNUX8gQna8C6BSCrvpA3Emvgk+HyN9aD29YsAInwC0IkgK/sosHTtlqUrSgAmPxrtFoOpXxXEKy6BJkrgJHylYMhrU1Jek8QbpGkCyezbjLKNAbwi3OLj4TK9xHhF4SNIC4QUpB5XCAzBTB87rvng1r4NgmC0IaBl7NMFWbiAkD4qVY7RYIgdMqpxcmR02QY4wpAabOXSSL9gtALxpWAUQUwUl58S/k2J0kQhJ5AQ9HC5PCjZAhjMQCY/SL8gtAfkKGR2Io2ghEFID6/IOgjVC60qcCgdhdAhF8QjKE9JqBVAcQ9/LVXSBAEI4SF4OR3Dw6fIU1oUwBxhR+KfIR+2H9bgYa24Qho9LaB6Lk96jGO9PWU9PXGx41/rx/mr9c2Pbe0UlNHWPdzGD1X//vL6rnl5Pn49fhxs78ndEdA4SFdFYNaFEBc2782JfP4WwNBhJDiuFM9TgV9tE7gUyHPA1AEc9fXIsUwn5y/Tp7DIYqiLdVBGjyko3eg7zsu3lBz7RMR/ljIx4YG1Xkgeoxz/DOruSvO8NnSaqQYcIZCwDl9Lu8owZ3ZRYMT/XYRDlKfJC29JcoZEOpjw9vpnqEBulcJOQQ9Tyt4FuC6gqPD2zY8D9diNlEGHy2uKIshVg55Ap2012LZe4r6oK87Nk9BP9yEuCGPqPMxdYiw8wJK4YJSBlAIUAYfqnM+WHtqcfKXPctgz3dxPMZrzdvOPvjkD4/uFIF3lFQhnL98UymFm5GV4Cl9xQN6vqtHyouXfPP7U6E/vm/7JrNTcBtYBO/M/eSrMsBW5hPUAz0pAJ+KfUTo80eqDM5f/smjgGJvrkDXCiCZ4HuJHAf+/MOjO+h3SvjFvM8ncBPeVUrgpS+u+2AV9OQKdH3nu276Y5V/+u7bZLUXNvDO3I3IKnA8eNi1K9CVAhgpf3sypOAtchARfKEToAD+ePEHhy2C7lyBjhWAq9V+qLR77fDtIvhCV8AicNQ1qO6mwQOdFgh1XKKmhP9514QfK/7UxF4RfqFrEBj+x29/Ht1DjlFMCoQ6oiMLwLXAH6ryzty3R0pwBS2gDPnEhapT1oAKCB7oJCDYkYRg9SdHePyunfT+RFGEX9AG7iXXrIFkr80t2dICcGX1Rz4fq76Y+4JJ3r18k/48e9UVa2BCZQWm2/3ClsukC6s/An3i6wtZ8MC+7XT2WDG65xxgS9ltawG4sPrD3z97bEiKeYRMQVzg9x8vu9CF2NYKaKvGuK/+xyNtLMIvZA/iArj3YBFwJgjDE21fb/UC99Ufwv935fMLgm0eUZYAYgNMaVsX0NICWKOVcWIKzP6/Hr6dBIEDKDRLh5cwpHi1drPlzlwtLQCuNf+jkeklaT6OLCWDQGejsV3xANCvk2h54yDRRjArEa5cOkoNWR0I1ZAj7h0+22+mrrDMDmB82MLkyKEWr21mpPztQWxVTMwQ4ecDhPvC4k36fGktGuo5m8zt0w2UwlgyiSmdysRVKeDzT0xV1yckM6NpMLCF3VJ4Mpo6xowXxnaL8Fviw2TUFibsQNiXM+qjx/vgvXG8lDwHRZDOb+BkeuPePHPf7XTiwhJxIwkGTm96vtkvczT/n7n7Nhfrsp0Fqxl65bMW+G6B0GGmw0Pq4JKbf3b2Gr355Y/EiYCCysLk8IHNzzfA0fwfTUoxBbNA6NEFl664roGU3GN3/YxFQRhcAW41As02FNlkPynhHydmwO8XzIDgFVYrV4W+HqTicMAqgMWIjj5bIEV9+L3viROJbG9QAM1spgeJEfgixe/XD4Qdvuq//t939OIX170aow1L5omLVyMBtBWVxz3L0GXdJNubXIDh8gIbZ09Mf72kq/3f1MHVpzcBLAEIY9YxAoapwU1FQRuuiBL+cWKEBP30gNUd1Wrpap8n4QeIa6CfH+csQbryNV4Fa8WrtHqw/olGlThOTIC2tunD+UBq5uNgXKqaCalb8JyK0GeZpz+a1C8woq0CuJ+YwExzOkW94Odni6zOeEO5P4jQZ2mW87Jka+P1PzUqgIPEAIZa0wlE8DsjHfGVVZqO1/1c2LDIrysAdP+pE4t8GzbsEDpHBL97YiWQnWvEyAooFsuXS+kP6wpglVZLxADx/TsHUWb4tSL4vYHrh+AoNgQxDaey5e20bd3Sr3cBxokBEvnvDMysR54768i2jzxx8YdMLAEuC1utrsy/XgH8miyDtMlx5hNWbIOVHoKfx3SeSbAbkOmYAFzboW32i9rCIFiX9fp/jXX///g+HheII/Xm/jyfwhJvwPXFjD+T2QEscA8xiG8VwrCpC2A9AyDBv+bAzBdz3zxQrIgJmKwT4DBDUNmNpfRxpACK5StY/a1aAAj+SepvI3NJpBorv5j72QA34KUvzLXy4h5nYOUWS7HMxwpgsKE80AZHhsX3rwd9+BNTVyS6b4E3ku5IU3BwA67RSgnnSAGEFFj3/8X8j4EvinJV+KOy6tsDmQFTrgCPUeKFaNGPFEBgefqPmP8xmLyDVf8NZtNk8gjiAaZcAQ5uQEjhLRdAWQAlsoiY/zA7b9BvpqoS4WeESVfAthsQhPGiX4j/U7PqAhzfl9/VP07v/aDM/qsk8AMFVyawbfHWCoUhnFML4Fdkkbya/3PRGOkrmZSiCr1halSa7Xt+gwVAFlOATNIimZNG+cXk548JKwBFQTaVQEBBCedU8kpkiXuHBihvoIxXovzuYMoKuIdBc5B1C+BIzsx/pPhM+ZWCOUzM+bdpAaT7fgzGVYD25pfnxf9PW0+lsMdN0C2IugCd7qrtex/VgIWddMPa6g/zPw/+fxrsE+F3G93B2qFkM1RbVJXsF1ZpsESWwI6wvjOXjJ+SYJ/7nDcwM+CoxRqYbTRQtLr8+u7/p5V9Ivx+AAtO93dpc0oQWgAKNvsAOO3sqhsIPzr5JNLvF9gwVSc2s2BIBQ4qE6Bo6xb1NQUIX/HZWV4tvHG/RWfm5oeLNzntZsMKuAGP3/Uz0oXtRXAwbQrIGgRAfAwAQvhR2ssNjFp7YWx3R7+L+QNzMnykKbrHhqWBQFtuIiTQigLw0fznKvxgTxfKVjZjbQ3SubqzOWNDdmJhqAWw9k37Zv5zFn7QzcaYogDao9sKuNPi9bb2zvs9SgEi4Pcs826+bq63DGZtz2dLa6QTW+nwIAyLBVvDQHxxAVyJ9sPX7JQ81Gf0A4KkOrFlcaEl2Jqq7+aG5MpcMkXWhVRfNzeZD9+NSXQH7MYsLoYWYwBuWwCuVfgNSRBQKzq/d5vXu2BjGIjrN5hrwt/L9RYl0J7ZJb2ZABvXOwjX9lr5ll33MWH2u1Te28v1lkBge3S7fXZkwlIMwOUMAPr5s9pXXhe9+PQ+l2nrQHelpC2ZsKQA3FxdMMnHxZHdvUye2SOBwLYsr+hWAHZkwsq7uhhlRg24q5N8erMAJBXYDs0hAKsKIPNSYNcsAJh7/824ym8rejHnJQaQLTaut1oWUAiUfTuwSzcXar8R8Xe5rbcXC2BMYgBt0e0C2AkCBkXJAmwBgn6uD/ToxQKQNGB7ljQvCLbcYgkCtgFBv3ccb4vtx5cXJZAde/KkAFxgLtoc0v3x3f1YW0dlz8bMyI0F4MKqkvr9PtDP3EWpBWiNiby9DdnI/B1dSAFi5fdlkGc/QiypwGyxERy3oAB4WwDw+V0s9mnF0T4tAEkHNsfEEB8bi6NYAHXA73/Ro227+t15Bt+VWAHN2WNAMdooBy5kPRR0D+MVxSfTHzw8uoP65fi+/v+Gj4x6kCGB7GdeCTjEdC8QmP6up/wa0RHF16FEfMRE2s5CKjD7QiCOFoBvpj+A+a8jqmx7H3uumChmy0UMgCO+mf7gsbt2ki6evvs2EjbiS5FU5p+Cm++EbZ99M/1xjR/Q6LvDAhAr4BamNrXJRR0AN55jPs67F84e0x/WESvgFj4VSFmIAfBJA77ooen/jBJUEysJLIDHNO6J5zI+TU3ObSEQAn8+FfwAtPCaXKn/MrZLXAEyt629jS7Z3LoACPz5tHU3/P4z9+0h0+A9fMiB94O4AI6D1d+nwB8EEn5/FkEkmL94rzwrAZ+qI3NZCvxnjwJ/WQp/yv7kPfOoBCD8ptzYXLgAtmMA2NoZqT8fQJXe1MReK+kjvOf76r0fHtVXb+AC93ItZe2R3DV8+zDkA1YUgn2PW47K49/x+uHd0ar40hc/0tKKXxmVZhwd9ktkcmXDwe+HBeAyWHEv/vbn1oW/HvxbpiaKubAGfJuSlCsL4I0v3Qz8YaVFDv4P6uC6YQdcAlgDqENAevX85Z+0755jG8Q8fJuTmBsFgJXflS294j78QTq+b3t0din3DgF5YWxXdOB647pjUxU8XnI87XrEwxmJmSsAWxqUo++Pa4GgKAp47lF+NAZC4LEvqwyUF47UXYESgFWA89fqPHd9LTpcqcY8vs+sIrbxvefCAsBNl5Xvj9UbZjpSOmnTyJ2J6YjHo8k5jyO3Y4VA9MC+zSvpfKIQYCXMJ2coCQQW8RivoXDLphXhYxVkLhSAztUfNwFKQVNBz7tQ62J/F/51qixAvWL4f+VqzBpy86C0fJyP6L0C0F31h9x73nLf3KhXFkdp46psSgEc3+fnHgneL1m+NfwIdvB1kxTvFQDSUYLQDzD/fXXvvFYAMP196/cXssdX8x94rgBk9Rf6A8Fen2M+3iqALFN/gr/4vi+Ctwrgo0U/Ov4Eu/i+L4K3CsDVun+BD+hy9H0EmpcKIC03FYR+4NRxaQovFcB5TwZ+CPZAdWceCr68rAQ0Oe8PmQVYGM1q/qUUOBvmkx6BueSclgLrVPw+dv41wzsFYNr8R2ahXXYh7g/Y3AyEx/uT5/CaKIuNNAo1fm5sBsI5q0nOz+RkIxTvFIDt6P9ycpN2UoAEJQBlgANKAt1yo8nZR3BNUKuPbr/Pl9aix6mwcwKmf14UdOZ3Gr5skxf3/GV3cv+4Fjg+pI3/ZlgRY8lAEEShXVUI6RCW80mXniv7MNha/W0oQu+WGh+KfyAo9a7G/mSzT4wF4z6KG2b6m1/+SH9Th4sbr+Rp9QdeKQAIjI+TaeeTbcxw4AbFRGBuigCC/9zsNec3XMmL75/ilar7bGmNfAcC9pupK9EqywUUXR1+73vnhT9vqz/w6tPmpfUXq+2zarV94uJVqxYP/h1PXPwh2mLdh30W87b6A7EAHAYr7sRU1cr4bbznhLJEfOm45LD625h3mPknTme56QbCn4edaRpBfODEhWyVwFzynr7MWkBtBofV38b9640FYEqxuECqBLK4gXwTfoCa/7wWZnnzqfPe+w+BfOTjH8g0j3y87JXwI5vydA59/5TMFcC8oZX6c+n+i5QgUnGmePGL6951WXIS/lzEAEzh+rZTukCtgAlrCKa/Dzsr14Nhn5w6/iQG0AfS/38LE4IKv983XhjbTXnHQhZAv5bLW/pvK7bqWOyWdy/f9G66MqL+3AJ/Nq6xFxZAHtN/W6HTCuBUdaiDvAf+6slcASwbENY8pwBboasvwsfpymePFYkjtoKAmTp3SwbuJdn8ozk6qvR8m67M0fRPsVBOXS0EFDgf3ZEMQHN0jMjyaXMV7qZ/1goAsu9FHYAPjSgm+CyZuNMPPpn/XE3/lFykAU18yHmJATQFllE/GRKfhJ+z6Z+Si0IgMdezpZ/6CF/Sqxir5kLUPxcWgATssqUfIf7IAwsAfv/rh28nF8hNHYDk7bPjwz6i+D6kV1HtJyPYW2PlyizLpr2Z0c+q4np5Nfx+TFZ2AVuWsVgAOaCXm8t1/98Vvz/FlrVVCCnMvA5AKveyZbaH6iuXlbRLfn+KneB4WM28EhDozttj+y2hNb1cb1ctAIz3Qr7fNb/fhgsQohKQLKC7IxA76Qit6cWXd9UCwMrvYtDP1vW2cqXmRQFkSi/9F587aAG4FPRrJFdBQN2Ve9hcU2jNZzmIATx+106nW3xtVbNaiQHoDgLu2UZCG3oJMLkUqMWq7/p0H2tZgIDCJcoY3ebO2JBogHb0cr1dqdhExP+vjkX8m2ElCBgEFWvREp0fWCq9tqab6+1KvwaEHxF/12NANjMu1iRnVuNkEKR+RAm0pxuf3oXVPxV+H753m/GWQo0KVgaCiBuQLd34mNwDgD4JP7BlAQRh+BViAJYUgN4PfadYAG3pphiIcwDQN+EHNq+3FzEA8ICj+d+s6Kb4iqsL4KPwA5u7WmEmYIUsMKv5Q987NEhCa1wPAvoq/MBiELBqTWpwQ8LX1FXHj0AgOsDyvkloKzAX4MSFzjK+s8zagH0WfihbWzEXDAW1umxC8x0d1velHhEF0BIoXBenMfks/MDmzIUAzUAhhRWyhO4PDwtA8AffhR/YrAGooR3YVhYA6P7wUABSD+AHYyqm47vwA9tzFwsDtGZNAXxoYNcZTts9C70BRX722FAulLnNFOAqrVYKN2inNQWQBgJ18vhdPyPBXdDVB+HPQ4t3vG+DvRhAUcl+oTq51+rWYLqDdmk2QHAP9PO73tXXDbYD1hUl+5GNZasWAJjwgWTrZ7eA0sYkn7x9b5YVQLTwW3eyTERBYQGIFeAGcaR/SMVudlDe+NxuCrCCc6QAbKYCde1j34hYAfyBkp6a2JvLKk74/zYtgLDeAlCpwK/IIiYuhFgBvIG/n5dgXzNs+/8YBoJzpABstQSnmMqFihXAj3hs91Duv5vzl/WnwLuhUKtFdeGpBVAhi7wz9xOZABbAY5IWZENq8otlZqYGphs2WABoCiCLmPSHYGrKxiH2eWFsV26Ke7YC97rtvowC1SkA5QTMkGXOXzZjBcDkfO1wfnLL3ECUf2qiKAVadZiyeLuhlrQARApghbZVyDImLwqGhYgrkD2o6strlL8dts1/sJsGo0U/UgBJNaC3bgCAKyA3YjakuX1U9cmuTRvhYP4rqpWkArjeIauQZUy5AQCuwN/v2xPdnIIZcI0R3ZdAX2s4mP+KdZd/XRpUJuBTsgwujsnpKAhAnVFKQIKC+kkj/LC0ZNVvDqxc2+m/mNr6aKh1SQgpsB4IxAUyrSHhBrwwJvUBuoBFBctKIvxbAwuXx8j1wmYLILTYEFTPO3M3yDSYGfC6ZAb6ot7cd3VH3qx58YvrxITp9MF6VGwbrcyskv0gGZqDECgx7UNCCexRrsAfL151bidc2yC6/8zdu8TU7wIsbFxmMg7SaiV9vOEbHC4vXCHMCbBMOhEmCzCQ4ZGPl7uam59XoDTh44up3z2YyMxkYG11cXJkb/pD4zc5TQzAhcrqYt2bzJ6T7EBrUoUMt0mEv3uyvJ87YEOsr/Hb/ICY8FKG/hJu6n/89udSLNQAVvyL6rpA+CWt1ztPXPyBGLFBxhudfuuZgJRUa2Z54/1lbBeNDQ1EyievLgGCe1CEf1CH+Pj9w8n3T5iu/2HDN1wsXymqAMElYhAHAPuTOvKs8/b4whCxzSIjwQUoWkTzfxcFR0XwdXH4ve9ZKQDl/2/4cjdIVlISzMYKwIV788vshRCKB/4uzF+fTV+s9mjSgYmP43FZ9bWCRYTz6g+a5f3OqWOcmICL+JBalWwE6fYnNe1wReAW+LLtGJTaQ6M76D/27RCBNwRcyJf45P1TzjU+sUkBBBROh8TrpkCaDq6ALaLxYokiQKWia64BVnpkO8TEz44TF6z21jUFsr35uSaMlBcvhRSWiBEwTzFUggMw69DS+YZyTz5jtpNuCqyXB9QKD6HHNlsi9NkBq5Xb6o+pXwuTdxxofL5p6Z/yWs6p2+VJYsQbX/4Y3cwcfHIIF1JkOFJlAMsAygD9DLb+TceGt9O/Dw9GZ8nX2wHNPgxNf6UBCtNNn2725HB5YVydpogZMGXfn9jLumgHbgIUAQadwg/UbSHgGuy/bSBa1e9RKUuY9rLC8wDfN0x/jtuwKwvgkLIAZjY/3wKlBD5Rp4PEDFupwX5ILQNsBImbY1k9Xk4shfrNISHc6eeCQO+JhL0QPQelN6oEXwSdJ8yFv6n5D9p1/yBiyE4BzEcXellF593p608nER0lqabzESh3BKo5Cn/C6VYvtJSgVRp8hSyPCWsFVlR08QkCB1DqyzUYDAZobbrVay0VAIqCVDrwDDHlXRVsgdaVVl7BFlj5f6/uQR5TfpoTBMHb30zuq7R6va0NrXyHs8QYKAG4A9LKK2QNhB8tvpyFHwyEK6fbvd5WASxOjkwTkxbhVsD0QvBFlICQFbjXJqausDb7wVarP+gkinaamDOfRGDfZa6NBfdBmhfCzzjgt85Wqz/oKKekUoKoCRgnB8DEGtkUVDDBc7PXooI0F8Dqv3Bi+NEtf4864JflyyWVFbhEjhA38ciUH0EPMPkRcOZu8tczSKsHtjL/QUcSgj+kMgKvkiPAPPu3977nWZIpOAMCfbiHcC+5JPyd+P7rv0sdwm1YSKfAGoBbgLp9QegU+PrI77vg69eDqj+V95/QrgCAigX8SZ1eJgeJh3zcLrPthLa4PvtBKYBHFybveLvz3+8SlwKCzYACeHh0h1gEwgZ8GPrSrua/9f/TJUlAEI1CTrkCjaSuwfF9O6ImHCF/xFvR3Vhv5XadTgN/9fR057vsCjSC7joMzoBVIO5BPsAqjwq+/1HCv2xpfoN2arXTi//1L6eoS3pe+lx3BZoBq+Do8HZRBh7ipdAn9GL63/p/e8QXV6AVqTJIpxCJm+AWMO8h9BjM4qPQ11FVpv+hbk3/lL7uap9cga2AEkBf/xEMCBWFwI56gYc/78sE5w54anFy5BXqkb7v4l+UF19RJgir+YFZAGWASsMjiWLAIUohGyDsEHIcny+t0YXFm87l63UQhOGrC/95x5+oD/q+Y5MCIcQD2E0PyhoEFMcSZQAXIlUK6UQgoTsg1LNKyOeTUWo4xz9L5yf8/l107VBl8kBfQ3u0LFm+xwN0sD+Z6YfjzmjOXzzcE2c8l6cpvkvJTEQMc0GdPc4Q6q+v16IZiensRKE53Vb7tf9bmhgpf3swpOATEvoiHQIaDwiNh4SmA0LT10H6Oyn1A0Ub/14/tBLE+mGm9Y/T328cfLqUCLwIdv+0mvDb29/SiFICJ5USeIsEQTBFX0G/RrTanUkNMvsBIoLgJCj20Sj8wEjYWqUHT6nT8yQIgh56rPTbCmN5q7ymBwVBO4aEHxhNXI/877dvh0HwCAmC0BMq139G5fpPkiGM5p6Sf7jEBAShB5JCn5NkEOPJZxW0OEWiBAShO5TZ32+VXydkVrsqgUFB6BCDPn8jmRav56l5SBB6IaTw0e+6GOnVL5l3r6BiUJ3KIQUlEgQhpaqyZhO6Kvw6JfMCdHxA1DGjnpkEQUBp7wx6+rMWfmClAwVNDCu07ZBLew0IggkQ6d9F17Q09vT0/mSZJC6A4KB0Egp5Am282kt7u4XFBAu0E6/RwJTEBYScMK1M/kdtrfr1sBphI6lCwXNYrPr1sJthJdaA4ClsVv162A6xw2wBdXpeFIHgOOxW/XrYzqHCbIEkXXiGBMFBEOHfTVcPcBV+4MQY28QtOKWsAeksFFyApbnfDKfmWIsiEJgzTbG5P02O4OQge1EEAiNQwntG3YtnXRL8FKd3skgUwThJsFDIGCU4MyHROeXjv9LvbH6beLOVTdJkhKrC+0UZCCYIKKgQ1c65uto3w8u9rJI9CsbVwwfJsx2MhUzByo4GnXPKzJ+20axjmlxsZjdcXhinWBHcT/EWZtJ3IDSjqiRimkL6QD2eUeb9jMvmfSfkcjfLZCuzEkEpBPRr9YVDIYhiyA8Q6koYhDNBGHyqrMXKGq3MVB1I2+lGtrOto1S+VLxKu+E+FJXJV8JRC2hI3SQlipVDehaYEvvp0WQdCHilENISBFw9r4S+NrOLrlV8X9W7QRRAD0BRVGlncTC2IggKo6AUg7rpoBzWFYS6AX+VPk6USCNK0QRtFUrj33SMaix4rVGfD69v/J2AqsnzEYkQV+OXYgFP/l8l2GF1hdaqRbpRFcHunn8Cz9Ea2bs7Ut4AAAAASUVORK5CYII=`,mode:`extension`,mobileDisabled:()=>!(typeof document<`u`&&document.readyState===`complete`&&window.keplr&&window.keplr.mode===`mobile-web`),rejectMessage:{source:`Request rejected`},connectEventNamesOnWindow:[`keplr_keystorechange`],supportedChains:`agoric.akash.archway.axelar.bostrom.celestia.certik.comdex.cosmoshub.cryptoorgchain.dymension.emoney.evmos.gravitybridge.injective.irisnet.ixo.juno.kava.kujira.noble.nois.osmosis.persistence.quicksilver.regen.secretnetwork.sentinel.sifchain.sommelier.stargaze.starname.stride.terra2.tgrade.umee`.split(`.`),downloads:[{device:`desktop`,browser:`chrome`,link:`https://chrome.google.com/webstore/detail/keplr/dmkamcknogkgcdfhhbddcghachkejeap?hl=en`},{device:`desktop`,browser:`firefox`,link:`https://addons.mozilla.org/en-US/firefox/addon/keplr/`},{link:`https://www.keplr.app/download`}]},Ji)],gh={osmosis:{rpc:[`https://rpc-osmosis.keplr.app/`],rest:[`https://lcd-osmosis.keplr.app/`]},osmosistestnet:{rpc:[`https://rpc-test.osmosis.zone/`],rest:[`https://lcd-test.osmosis.zone/`]},cosmoshub:{rpc:[`https://rpc-cosmoshub.keplr.app`],rest:[`https://lcd-cosmoshub.keplr.app`]},terra:{rpc:[`https://rpc-columbus.keplr.app`],rest:[`https://lcd-columbus.keplr.app`]},secretnetwork:{rpc:[`https://rpc-secret.keplr.app`],rest:[`https://lcd-secret.keplr.app`]},akash:{rpc:[`https://rpc-akash.keplr.app`],rest:[`https://lcd-akash.keplr.app`]},regen:{rpc:[`https://rpc-regen.keplr.app`],rest:[`https://lcd-regen.keplr.app`]},sentinel:{rpc:[`https://rpc-sentinel.keplr.app`],rest:[`https://lcd-sentinel.keplr.app`]},persistence:{rpc:[`https://rpc-persistence.keplr.app`],rest:[`https://lcd-persistence.keplr.app`]},irisnet:{rpc:[`https://rpc-iris.keplr.app`],rest:[`https://lcd-iris.keplr.app`]},cryptoorgchain:{rpc:[`https://rpc-crypto-org.keplr.app/`],rest:[`https://lcd-crypto-org.keplr.app/`]},starname:{rpc:[`https://rpc-iov.keplr.app`],rest:[`https://lcd-iov.keplr.app`]},emoney:{rpc:[`https://rpc-emoney.keplr.app`],rest:[`https://lcd-emoney.keplr.app`]},juno:{rpc:[`https://rpc-juno.itastakers.com`],rest:[`https://lcd-juno.itastakers.com`]},microtick:{rpc:[`https://rpc-microtick.keplr.app`],rest:[`https://lcd-microtick.keplr.app`]},likecoin:{rpc:[`https://mainnet-node.like.co/rpc`],rest:[`https://mainnet-node.like.co`]},impacthub:{rpc:[`https://rpc-impacthub.keplr.app`],rest:[`https://lcd-impacthub.keplr.app`]},bitcanna:{rpc:[`https://rpc.bitcanna.io`],rest:[`https://lcd.bitcanna.io`]},bitsong:{rpc:[`https://rpc.explorebitsong.com`],rest:[`https://lcd.explorebitsong.com`]},kichain:{rpc:[`https://rpc-mainnet.blockchain.ki`],rest:[`https://api-mainnet.blockchain.ki`]},panacea:{rpc:[`https://rpc.gopanacea.org`],rest:[`https://api.gopanacea.org`]},bostrom:{rpc:[`https://rpc.bostrom.cybernode.ai`],rest:[`https://lcd.bostrom.cybernode.ai`]},comdex:{rpc:[`https://rpc.comdex.one`],rest:[`https://rest.comdex.one`]},cheqd:{rpc:[`https://rpc.cheqd.net`],rest:[`https://api.cheqd.net`]},stargaze:{rpc:[`https://rpc.stargaze-apis.com`],rest:[`https://rest.stargaze-apis.com`]},chihuahua:{rpc:[`https://rpc.chihuahua.wtf`],rest:[`https://api.chihuahua.wtf`]},lumnetwork:{rpc:[`https://node0.mainnet.lum.network/rpc`],rest:[`https://node0.mainnet.lum.network/rest`]},vidulum:{rpc:[`https://mainnet-rpc.vidulum.app`],rest:[`https://mainnet-lcd.vidulum.app`]},desmos:{rpc:[`https://rpc.mainnet.desmos.network`],rest:[`https://api.mainnet.desmos.network`]},dig:{rpc:[`https://rpc-1-dig.notional.ventures`],rest:[`https://api-1-dig.notional.ventures`]},sommelier:{rpc:[`https://rpc-sommelier.keplr.app`],rest:[`https://lcd-sommelier.keplr.app`]},sifchain:{rpc:[`https://rpc.sifchain.finance`],rest:[`https://api-int.sifchain.finance`]},bandchain:{rpc:[`https://rpc.laozi3.bandchain.org`],rest:[`https://laozi1.bandchain.org/api`]},konstellation:{rpc:[`https://node1.konstellation.tech:26657`],rest:[`https://node1.konstellation.tech:1318`]},umee:{rpc:[`https://rpc.aphrodite.main.network.umee.cc`],rest:[`https://api.aphrodite.main.network.umee.cc`]},gravitybridge:{rpc:[`https://gravitychain.io:26657`],rest:[`https://gravitychain.io:1317`]},decentr:{rpc:[`https://poseidon.mainnet.decentr.xyz`],rest:[`https://rest.mainnet.decentr.xyz`]},shentu:{rpc:[`https://shenturpc.certikpowered.info`],rest:[`https://azuredragon.noopsbycertik.com`]},carbon:{rpc:[`https://tm-api.carbon.network`],rest:[`https://api.carbon.network`]},injective:{rpc:[`https://public.api.injective.network`],rest:[`https://public.lcd.injective.network`]},cerberus:{rpc:[`https://rpc.cerberus.zone:26657`],rest:[`https://api.cerberus.zone:1317`]},fetchhub:{rpc:[`https://rpc-fetchhub.fetch.ai:443`],rest:[`https://rest-fetchhub.fetch.ai`]},assetmantle:{rpc:[`https://rpc.assetmantle.one/`],rest:[`https://rest.assetmantle.one/`]},provenance:{rpc:[`https://rpc.provenance.io/`],rest:[`https://api.provenance.io`]},galaxy:{rpc:[`https://rpc.galaxychain.zone`],rest:[`https://rest.galaxychain.zone`]},meme:{rpc:[`https://rpc-meme-1.meme.sx:443`],rest:[`https://api-meme-1.meme.sx:443`]},evmos:{rpc:[`https://rpc-evmos.keplr.app/`],rest:[`https://lcd-evmos.keplr.app/`]},terra2:{rpc:[`https://rpc.terrav2.ccvalidators.com/`],rest:[`https://phoenix-lcd.terra.dev/`]},rizon:{rpc:[`https://rpcapi.rizon.world/`],rest:[`https://restapi.rizon.world/`]},kava:{rpc:[`https://rpc-kava.keplr.app`],rest:[`https://lcd-kava.keplr.app`]},genesisl1:{rpc:[`https://26657.genesisl1.org`],rest:[`https://api.genesisl1.org`]}},_h=class extends Gr{WCClient;clientMutable={state:U.Init};options;constructor(e,t,n){super(e,t),this.WCClient=n}setClientNotExist(){this.setState(U.Error),this.setMessage(this.clientMutable.message)}},vh=class extends me{constructor(e){super(),this.opts=e,this.protocol=`wc`,this.version=2}},yh=class extends me{constructor(e,t){super(),this.core=e,this.logger=t,this.records=new Map}},bh=class{constructor(e,t){this.logger=e,this.core=t}},xh=class extends me{constructor(e,t){super(),this.relayer=e,this.logger=t}},Sh=class extends me{constructor(e){super()}},Ch=class{constructor(e,t,n,r){this.core=e,this.logger=t,this.name=n}},wh=class extends me{constructor(e,t){super(),this.relayer=e,this.logger=t}},Th=class extends me{constructor(e,t){super(),this.core=e,this.logger=t}},Eh=class{constructor(e,t,n){this.core=e,this.logger=t,this.store=n}},Dh=class{constructor(e,t){this.projectId=e,this.logger=t}},Oh=class{constructor(e,t,n){this.core=e,this.logger=t,this.telemetryEnabled=n}},kh=class{constructor(e){this.opts=e,this.protocol=`wc`,this.version=2}},Ah=class{constructor(e){this.client=e}};function jh(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function Mh(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Nh(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var Ph=`[object RegExp]`,Fh=`[object String]`,Ih=`[object Number]`,Lh=`[object Boolean]`,Rh=`[object Symbol]`,zh=`[object Date]`,Bh=`[object Map]`,Vh=`[object Set]`,Hh=`[object Array]`,Uh=`[object Function]`,Wh=`[object ArrayBuffer]`,Gh=`[object Object]`,Kh=`[object Error]`,qh=`[object DataView]`,Jh=`[object Uint8Array]`,Yh=`[object Uint8ClampedArray]`,Xh=`[object Uint16Array]`,Zh=`[object Uint32Array]`,Qh=`[object BigUint64Array]`,$h=`[object Int8Array]`,eg=`[object Int16Array]`,tg=`[object Int32Array]`,ng=`[object BigInt64Array]`,rg=`[object Float32Array]`,ig=`[object Float64Array]`;function ag(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)===`[object Object]`:!1}_();function og(e,t,n){return sg(e,t,void 0,void 0,void 0,void 0,n)}function sg(e,t,n,r,i,a,o){let s=o(e,t,n,r,i,a);if(s!==void 0)return s;if(typeof e==typeof t)switch(typeof e){case`bigint`:case`string`:case`boolean`:case`symbol`:case`undefined`:return e===t;case`number`:return e===t||Object.is(e,t);case`function`:return e===t;case`object`:return cg(e,t,a,o)}return cg(e,t,a,o)}function cg(e,t,n,r){if(Object.is(e,t))return!0;let i=Nh(e),a=Nh(t);if(i===`[object Arguments]`&&(i=Gh),a===`[object Arguments]`&&(a=Gh),i!==a)return!1;switch(i){case Fh:return e.toString()===t.toString();case Ih:return jh(e.valueOf(),t.valueOf());case Lh:case zh:case Rh:return Object.is(e.valueOf(),t.valueOf());case Ph:return e.source===t.source&&e.flags===t.flags;case Uh:return e===t}n??=new Map;let o=n.get(e),s=n.get(t);if(o!=null&&s!=null)return o===t;n.set(e,t),n.set(t,e);try{switch(i){case Bh:if(e.size!==t.size)return!1;for(let[i,a]of e.entries())if(!t.has(i)||!sg(a,t.get(i),i,e,t,n,r))return!1;return!0;case Vh:{if(e.size!==t.size)return!1;let i=Array.from(e.values()),a=Array.from(t.values());for(let o=0;o<i.length;o++){let s=i[o],c=a.findIndex(i=>sg(s,i,void 0,e,t,n,r));if(c===-1)return!1;a.splice(c,1)}return!0}case Hh:case Jh:case Yh:case Xh:case Zh:case Qh:case $h:case eg:case tg:case ng:case rg:case ig:if(y!==void 0&&y.isBuffer(e)!==y.isBuffer(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!sg(e[i],t[i],i,e,t,n,r))return!1;return!0;case Wh:return e.byteLength===t.byteLength?cg(new Uint8Array(e),new Uint8Array(t),n,r):!1;case qh:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:cg(new Uint8Array(e),new Uint8Array(t),n,r);case Kh:return e.name===t.name&&e.message===t.message;case Gh:{if(!(cg(e.constructor,t.constructor,n,r)||ag(e)&&ag(t)))return!1;let i=[...Object.keys(e),...Mh(e)],a=[...Object.keys(t),...Mh(t)];if(i.length!==a.length)return!1;for(let a=0;a<i.length;a++){let o=i[a],s=e[o];if(!Object.hasOwn(t,o))return!1;let c=t[o];if(!sg(s,c,o,e,t,n,r))return!1}return!0}default:return!1}}finally{n.delete(e),n.delete(t)}}function lg(){}function ug(e,t){return og(e,t,lg)}s();var $=R(),dg=P(),fg=`core`,pg=`wc@2:${fg}:`,mg={name:fg,logger:`error`},hg={database:`:memory:`},gg=`crypto`,_g=`client_ed25519_seed`,vg=$.ONE_DAY,yg=`keychain`,bg=`messages`,xg=$.SIX_HOURS,Sg=`publisher`,Cg=`relayer`,wg={message:`relayer_message`,message_ack:`relayer_message_ack`,connect:`relayer_connect`,disconnect:`relayer_disconnect`,error:`relayer_error`,connection_stalled:`relayer_connection_stalled`,transport_closed:`relayer_transport_closed`,publish:`relayer_publish`},Tg={payload:`payload`,connect:`connect`,disconnect:`disconnect`,error:`error`},Eg=.1,Dg=`2.23.9`,Og={link_mode:`link_mode`,relay:`relay`},kg={inbound:`inbound`,outbound:`outbound`},Ag=`WALLETCONNECT_CLIENT_ID`,jg={created:`subscription_created`,deleted:`subscription_deleted`,expired:`subscription_expired`,disabled:`subscription_disabled`,sync:`subscription_sync`,resubscribed:`subscription_resubscribed`};$.THIRTY_DAYS;var Mg=`subscription`;$.FIVE_SECONDS*1e3;var Ng=`pairing`;$.THIRTY_DAYS;var Pg={wc_pairingDelete:{req:{ttl:$.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:$.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:$.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:$.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:$.ONE_DAY,prompt:!1,tag:0},res:{ttl:$.ONE_DAY,prompt:!1,tag:0}}},Fg={create:`pairing_create`,expire:`pairing_expire`,delete:`pairing_delete`,ping:`pairing_ping`},Ig={created:`history_created`,updated:`history_updated`,deleted:`history_deleted`,sync:`history_sync`},Lg=`history`,Rg=`expirer`,zg={created:`expirer_created`,deleted:`expirer_deleted`,expired:`expirer_expired`,sync:`expirer_sync`};$.ONE_DAY;var Bg=`verify-api`,Vg=`https://verify.walletconnect.com`,Hg=`https://verify.walletconnect.org`,Ug=`${Hg}/v3`,Wg=[Vg,Hg],Gg=`echo`,Kg=`https://echo.walletconnect.com`,qg={pairing_started:`pairing_started`,pairing_uri_validation_success:`pairing_uri_validation_success`,pairing_uri_not_expired:`pairing_uri_not_expired`,store_new_pairing:`store_new_pairing`,subscribing_pairing_topic:`subscribing_pairing_topic`,subscribe_pairing_topic_success:`subscribe_pairing_topic_success`,existing_pairing:`existing_pairing`,pairing_not_expired:`pairing_not_expired`,emit_inactive_pairing:`emit_inactive_pairing`,emit_session_proposal:`emit_session_proposal`,subscribing_to_pairing_topic:`subscribing_to_pairing_topic`},Jg={no_wss_connection:`no_wss_connection`,no_internet_connection:`no_internet_connection`,malformed_pairing_uri:`malformed_pairing_uri`,active_pairing_already_exists:`active_pairing_already_exists`,subscribe_pairing_topic_failure:`subscribe_pairing_topic_failure`,pairing_expired:`pairing_expired`,proposal_expired:`proposal_expired`,proposal_listener_not_found:`proposal_listener_not_found`},Yg={session_approve_started:`session_approve_started`,proposal_not_expired:`proposal_not_expired`,session_namespaces_validation_success:`session_namespaces_validation_success`,create_session_topic:`create_session_topic`,subscribing_session_topic:`subscribing_session_topic`,subscribe_session_topic_success:`subscribe_session_topic_success`,publishing_session_approve:`publishing_session_approve`,session_approve_publish_success:`session_approve_publish_success`,store_session:`store_session`,publishing_session_settle:`publishing_session_settle`,session_settle_publish_success:`session_settle_publish_success`,session_request_response_started:`session_request_response_started`,session_request_response_validation_success:`session_request_response_validation_success`,session_request_response_publish_started:`session_request_response_publish_started`},Xg={no_internet_connection:`no_internet_connection`,no_wss_connection:`no_wss_connection`,proposal_expired:`proposal_expired`,subscribe_session_topic_failure:`subscribe_session_topic_failure`,session_approve_publish_failure:`session_approve_publish_failure`,session_settle_publish_failure:`session_settle_publish_failure`,session_approve_namespace_validation_failure:`session_approve_namespace_validation_failure`,proposal_not_found:`proposal_not_found`,session_request_response_validation_failure:`session_request_response_validation_failure`,session_request_response_publish_failure:`session_request_response_publish_failure`},Zg={authenticated_session_approve_started:`authenticated_session_approve_started`,authenticated_session_not_expired:`authenticated_session_not_expired`,chains_caip2_compliant:`chains_caip2_compliant`,chains_evm_compliant:`chains_evm_compliant`,create_authenticated_session_topic:`create_authenticated_session_topic`,cacaos_verified:`cacaos_verified`,store_authenticated_session:`store_authenticated_session`,subscribing_authenticated_session_topic:`subscribing_authenticated_session_topic`,subscribe_authenticated_session_topic_success:`subscribe_authenticated_session_topic_success`,publishing_authenticated_session_approve:`publishing_authenticated_session_approve`,authenticated_session_approve_publish_success:`authenticated_session_approve_publish_success`},Qg={no_internet_connection:`no_internet_connection`,no_wss_connection:`no_wss_connection`,missing_session_authenticate_request:`missing_session_authenticate_request`,session_authenticate_request_expired:`session_authenticate_request_expired`,chains_caip2_compliant_failure:`chains_caip2_compliant_failure`,chains_evm_compliant_failure:`chains_evm_compliant_failure`,invalid_cacao:`invalid_cacao`,subscribe_authenticated_session_topic_failure:`subscribe_authenticated_session_topic_failure`,authenticated_session_approve_publish_failure:`authenticated_session_approve_publish_failure`,authenticated_session_pending_request_not_found:`authenticated_session_pending_request_not_found`},$g=.1,e_=`event-client`,t_=`https://pulse.walletconnect.org/batch`,n_=class{constructor(e,t){this.core=e,this.logger=t,this.keychain=new Map,this.name=yg,this.version=`0.3`,this.initialized=!1,this.storagePrefix=pg,this.init=async()=>{if(!this.initialized){let e=await this.getKeyChain();typeof e<`u`&&(this.keychain=e),this.initialized=!0}},this.has=e=>(this.isInitialized(),this.keychain.has(e)),this.set=async(e,t)=>{this.isInitialized(),this.keychain.set(e,t),await this.persist()},this.get=e=>{this.isInitialized();let t=this.keychain.get(e);if(typeof t>`u`){let{message:t}=V(`NO_MATCHING_KEY`,`${this.name}: ${e}`);throw Error(t)}return t},this.del=async e=>{this.isInitialized(),this.keychain.delete(e),await this.persist()},this.core=e,this.logger=ve(t,this.name)}get context(){return en(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//`+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Re(e))}async getKeyChain(){let e=await this.core.storage.getItem(this.storageKey);return typeof e<`u`?et(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){let{message:e}=V(`NOT_INITIALIZED`,this.name);throw Error(e)}}},r_=class{constructor(e,t,n){this.core=e,this.logger=t,this.name=gg,this.randomSessionIdentifier=Ne(),this.initialized=!1,this.init=async()=>{this.initialized||=(await this.keychain.init(),!0)},this.hasKeys=e=>(this.isInitialized(),this.keychain.has(e)),this.getClientId=async()=>{if(this.isInitialized(),this.clientId)return this.clientId;let e=L(I(await this.getClientSeed()).publicKey);return this.clientId=e,e},this.generateKeyPair=()=>{this.isInitialized();let e=ct();return this.setPrivateKey(e.publicKey,e.privateKey)},this.signJWT=async e=>{this.isInitialized();let t=I(await this.getClientSeed()),n=this.randomSessionIdentifier;return await N(n,e,vg,t)},this.generateSharedKey=(e,t,n)=>{this.isInitialized();let r=it(this.getPrivateKey(e),t);return this.setSymKey(r,n)},this.setSymKey=async(e,t)=>{this.isInitialized();let n=t||ke(e);return await this.keychain.set(n,e),n},this.deleteKeyPair=async e=>{this.isInitialized(),await this.keychain.del(e)},this.deleteSymKey=async e=>{this.isInitialized(),await this.keychain.del(e)},this.encode=async(e,t,n)=>{this.isInitialized();let r=Zt(n),i=he(t);if(yt(r))return qt(i,n?.encoding);if(Yt(r)){let t=r.senderPublicKey,n=r.receiverPublicKey;e=await this.generateSharedKey(t,n)}let a=this.getSymKey(e),{type:o,senderPublicKey:s}=r;return Ut({type:o,symKey:a,message:i,senderPublicKey:s,encoding:n?.encoding})},this.decode=async(e,t,n)=>{this.isInitialized();let r=Fe(t,n);if(yt(r))return ge(rt(t,n?.encoding));if(Yt(r)){let t=r.receiverPublicKey,n=r.senderPublicKey;e=await this.generateSharedKey(t,n)}try{return ge(we({symKey:this.getSymKey(e),encoded:t,encoding:n?.encoding}))}catch(t){this.logger.error(`Failed to decode message from topic: '${e}', clientId: '${await this.getClientId()}'`),this.logger.error(t)}},this.getPayloadType=(e,t=st)=>St(De({encoded:e,encoding:t}).type),this.getPayloadSenderPublicKey=(e,t=st)=>{let n=De({encoded:e,encoding:t});return n.senderPublicKey?Rn(n.senderPublicKey,Ie):void 0},this.core=e,this.logger=ve(t,this.name),this.keychain=n||new n_(this.core,this.logger)}get context(){return en(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e=``;try{e=this.keychain.get(_g)}catch{e=Ne(),await this.keychain.set(_g,e)}return Ln(e,`base16`)}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){let{message:e}=V(`NOT_INITIALIZED`,this.name);throw Error(e)}}},i_=class extends bh{constructor(e,t){super(e,t),this.logger=e,this.core=t,this.messages=new Map,this.messagesWithoutClientAck=new Map,this.name=bg,this.version=`0.3`,this.initialized=!1,this.storagePrefix=pg,this.init=async()=>{if(!this.initialized){this.logger.trace(`Initialized`);try{let e=await this.getRelayerMessages();typeof e<`u`&&(this.messages=e);let t=await this.getRelayerMessagesWithoutClientAck();typeof t<`u`&&(this.messagesWithoutClientAck=t),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:`method`,method:`restore`,size:this.messages.size})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}finally{this.initialized=!0}}},this.set=async(e,t,n)=>{this.isInitialized();let r=ze(t),i=this.messages.get(e);if(typeof i>`u`&&(i={}),typeof i[r]<`u`)return r;if(i[r]=t,this.messages.set(e,i),n===kg.inbound){let n=this.messagesWithoutClientAck.get(e)||{};this.messagesWithoutClientAck.set(e,{...n,[r]:t})}return await this.persist(),r},this.get=e=>{this.isInitialized();let t=this.messages.get(e);return typeof t>`u`&&(t={}),t},this.getWithoutAck=e=>{this.isInitialized();let t={};for(let n of e){let e=this.messagesWithoutClientAck.get(n)||{};t[n]=Object.values(e)}return t},this.has=(e,t)=>(this.isInitialized(),typeof this.get(e)[ze(t)]<`u`),this.ack=async(e,t)=>{this.isInitialized();let n=this.messagesWithoutClientAck.get(e);if(typeof n>`u`)return;let r=ze(t);delete n[r],Object.keys(n).length===0?this.messagesWithoutClientAck.delete(e):this.messagesWithoutClientAck.set(e,n),await this.persist()},this.del=async e=>{this.isInitialized(),this.messages.delete(e),this.messagesWithoutClientAck.delete(e),await this.persist()},this.logger=ve(e,this.name),this.core=t}get context(){return en(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//`+this.name}get storageKeyWithoutClientAck(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//`+this.name+`_withoutClientAck`}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Re(e))}async setRelayerMessagesWithoutClientAck(e){await this.core.storage.setItem(this.storageKeyWithoutClientAck,Re(e))}async getRelayerMessages(){let e=await this.core.storage.getItem(this.storageKey);return typeof e<`u`?et(e):void 0}async getRelayerMessagesWithoutClientAck(){let e=await this.core.storage.getItem(this.storageKeyWithoutClientAck);return typeof e<`u`?et(e):void 0}async persist(){await this.setRelayerMessages(this.messages),await this.setRelayerMessagesWithoutClientAck(this.messagesWithoutClientAck)}isInitialized(){if(!this.initialized){let{message:e}=V(`NOT_INITIALIZED`,this.name);throw Error(e)}}},a_=class extends xh{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.events=new Kr.EventEmitter,this.name=Sg,this.queue=new Map,this.publishTimeout=(0,$.toMiliseconds)($.ONE_MINUTE),this.initialPublishTimeout=(0,$.toMiliseconds)($.ONE_SECOND*15),this.needsTransportRestart=!1,this.publish=async(e,t,n)=>{this.logger.debug(`Publishing Payload`),this.logger.trace({type:`method`,method:`publish`,params:{topic:e,message:t,opts:n}});let r=n?.ttl||xg,i=n?.prompt||!1,a=n?.tag||0,o=n?.id||re().toString(),s=Jt(Ze().protocol),c={id:o,method:n?.publishMethod||s.publish,params:{topic:e,message:t,ttl:r,prompt:i,tag:a,attestation:n?.attestation,...n?.tvf}},l=`Failed to publish payload, please try again. id:${o} tag:${a}`;try{at(c.params?.prompt)&&delete c.params?.prompt,at(c.params?.tag)&&delete c.params?.tag;let r=new Promise(async e=>{let t=({id:n})=>{c.id?.toString()===n.toString()&&(this.removeRequestFromQueue(n),this.relayer.events.removeListener(wg.publish,t),e())};this.relayer.events.on(wg.publish,t);let r=Ve(new Promise((e,t)=>{this.rpcPublish(c,n).then(e).catch(e=>{this.logger.warn(e,e?.message),t(e)})}),this.initialPublishTimeout,`Failed initial publish, retrying.... id:${o} tag:${a}`);try{await r,this.events.removeListener(wg.publish,t)}catch(e){this.queue.set(o,{request:c,opts:n,attempt:1}),this.logger.warn(e,e?.message)}});this.logger.trace({type:`method`,method:`publish`,params:{id:o,topic:e,message:t,opts:n}}),await Ve(r,this.publishTimeout,l)}catch(e){if(this.logger.debug(`Failed to Publish Payload`),this.logger.error(e),n?.internal?.throwOnFailedPublish)throw e}finally{this.queue.delete(o)}},this.publishCustom=async e=>{this.logger.debug(`Publishing custom payload`),this.logger.trace({type:`method`,method:`publishCustom`,params:e});let{payload:t,opts:n={}}=e,{attestation:r,tvf:i,publishMethod:a,prompt:o,tag:s,ttl:c=$.FIVE_MINUTES}=n,l=n.id||re().toString(),u=Jt(Ze().protocol),d=a||u.publish,f={id:l,method:d,params:{...t,ttl:c,prompt:o,tag:s,attestation:r,...i}},p=`Failed to publish custom payload, please try again. id:${l} tag:${s}`;try{at(f.params?.prompt)&&delete f.params?.prompt,at(f.params?.tag)&&delete f.params?.tag;let e=new Promise(async e=>{let t=({id:n})=>{f.id?.toString()===n.toString()&&(this.removeRequestFromQueue(n),this.relayer.events.removeListener(wg.publish,t),e())};this.relayer.events.on(wg.publish,t);let r=Ve(new Promise((e,t)=>{this.rpcPublish(f,n).then(e).catch(e=>{this.logger.warn(e,e?.message),t(e)})}),this.initialPublishTimeout,`Failed initial custom payload publish, retrying.... method:${d} id:${l} tag:${s}`);try{await r,this.events.removeListener(wg.publish,t)}catch(e){this.queue.set(l,{request:f,opts:n,attempt:1}),this.logger.warn(e,e?.message)}});this.logger.trace({type:`method`,method:`publish`,params:{id:l,payload:t,opts:n}}),await Ve(e,this.publishTimeout,p)}catch(e){if(this.logger.debug(`Failed to Publish Payload`),this.logger.error(e),n?.internal?.throwOnFailedPublish)throw e}finally{this.queue.delete(l)}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.relayer=e,this.logger=ve(t,this.name),this.registerEventListeners()}get context(){return en(this.logger)}async rpcPublish(e,t){this.logger.debug(`Outgoing Relay Payload`),this.logger.trace({type:`message`,direction:`outgoing`,request:e});let n=await this.relayer.request(e);return this.relayer.events.emit(wg.publish,{...e,...t}),this.logger.debug(`Successfully Published Payload`),n}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async(e,t)=>{let n=e.attempt+1;this.queue.set(t,{...e,attempt:n}),this.logger.warn({},`Publisher: queue->publishing: ${e.request.id}, tag: ${e.request.params?.tag}, attempt: ${n}`),await this.rpcPublish(e.request,e.opts),this.logger.warn({},`Publisher: queue->published: ${e.request.id}`)})}registerEventListeners(){this.relayer.core.heartbeat.on(ee.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(wg.connection_stalled);return}this.checkQueue()}),this.relayer.on(wg.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}},o_=class{constructor(){this.map=new Map,this.set=(e,t)=>{let n=this.get(e);this.exists(e,t)||this.map.set(e,[...n,t])},this.get=e=>this.map.get(e)||[],this.exists=(e,t)=>this.get(e).includes(t),this.delete=(e,t)=>{if(typeof t>`u`){this.map.delete(e);return}if(!this.map.has(e))return;let n=this.get(e);if(!this.exists(e,t))return;let r=n.filter(e=>e!==t);if(!r.length){this.map.delete(e);return}this.map.set(e,r)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}},s_=class extends wh{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.subscriptions=new Map,this.topicMap=new o_,this.events=new Kr.EventEmitter,this.name=Mg,this.version=`0.3`,this.pending=new Map,this.cached=[],this.initialized=!1,this.storagePrefix=pg,this.subscribeTimeout=(0,$.toMiliseconds)($.ONE_MINUTE),this.initialSubscribeTimeout=(0,$.toMiliseconds)($.ONE_SECOND*15),this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace(`Initialized`),this.registerEventListeners(),await this.restore()),this.initialized=!0},this.subscribe=async(e,t)=>{this.isInitialized(),this.logger.debug(`Subscribing Topic`),this.logger.trace({type:`method`,method:`subscribe`,params:{topic:e,opts:t}});try{let n=Ze(t),r={topic:e,relay:n,transportType:t?.transportType};t?.internal?.skipSubscribe||this.pending.set(e,r);let i=await this.rpcSubscribe(e,n,t);return typeof i==`string`&&(this.onSubscribe(i,r),this.logger.debug(`Successfully Subscribed Topic`),this.logger.trace({type:`method`,method:`subscribe`,params:{topic:e,opts:t}})),i}catch(e){throw this.logger.debug(`Failed to Subscribe Topic`),this.logger.error(e),e}},this.unsubscribe=async(e,t)=>{this.isInitialized(),typeof t?.id<`u`?await this.unsubscribeById(e,t.id,t):await this.unsubscribeByTopic(e,t)},this.isSubscribed=e=>new Promise(t=>{t(this.topicMap.topics.includes(e))}),this.isKnownTopic=e=>new Promise(t=>{t(this.topicMap.topics.includes(e)||this.pending.has(e)||this.cached.some(t=>t.topic===e))}),this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{await this.restore(),await this.onRestart()},this.checkPending=async()=>{if(this.pending.size===0&&(!this.initialized||!this.relayer.connected))return;let e=[];this.pending.forEach(t=>{e.push(t)}),await this.batchSubscribe(e)},this.registerEventListeners=()=>{this.relayer.core.heartbeat.on(ee.pulse,async()=>{await this.checkPending()}),this.events.on(jg.created,async e=>{let t=jg.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,data:e}),await this.persist()}),this.events.on(jg.deleted,async e=>{let t=jg.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,data:e}),await this.persist()})},this.relayer=e,this.logger=ve(t,this.name),this.clientId=``}get context(){return en(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+`//`+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}get hasAnyTopics(){return this.topicMap.topics.length>0||this.pending.size>0||this.cached.length>0||this.subscriptions.size>0}hasSubscription(e,t){let n=!1;try{n=this.getSubscription(e).topic===t}catch{}return n}reset(){this.cached=[],this.initialized=!0}onDisable(){this.values.length>0&&(this.cached=this.values),this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){let n=this.topicMap.get(e);await Promise.all(n.map(async n=>await this.unsubscribeById(e,n,t)))}async unsubscribeById(e,t,n){this.logger.debug(`Unsubscribing Topic`),this.logger.trace({type:`method`,method:`unsubscribe`,params:{topic:e,id:t,opts:n}});try{let r=$t(`USER_DISCONNECTED`,`${this.name}, ${e}`);await this.onUnsubscribe(e,t,r);let i=Ze(n);await this.restartToComplete({topic:e,id:t,relay:i}),await this.rpcUnsubscribe(e,t,i),this.logger.debug(`Successfully Unsubscribed Topic`),this.logger.trace({type:`method`,method:`unsubscribe`,params:{topic:e,id:t,opts:n}})}catch(e){throw this.logger.debug(`Failed to Unsubscribe Topic`),this.logger.error(e),e}}async rpcSubscribe(e,t,n){let r=await this.getSubscriptionId(e);if(n?.internal?.skipSubscribe)return r;(!n||n?.transportType===Og.relay)&&await this.restartToComplete({topic:e,id:e,relay:t});let i={method:Jt(t.protocol).subscribe,params:{topic:e}};this.logger.debug(`Outgoing Relay Payload`),this.logger.trace({type:`payload`,direction:`outgoing`,request:i});let a=n?.internal?.throwOnFailedPublish;try{if(n?.transportType===Og.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(i).catch(e=>this.logger.warn(e))},(0,$.toMiliseconds)($.ONE_SECOND)),r;let t=await Ve(new Promise(async t=>{let n=r=>{r.topic===e&&(this.events.removeListener(jg.created,n),t(r.id))};this.events.on(jg.created,n);try{let r=await Ve(new Promise((e,t)=>{this.relayer.request(i).catch(e=>{this.logger.warn(e,e?.message),t(e)}).then(e)}),this.initialSubscribeTimeout,`Subscribing to ${e} failed, please try again`);this.events.removeListener(jg.created,n),t(r)}catch{}}),this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!t&&a)throw Error(`Subscribing to ${e} failed, please try again`);return t?r:null}catch(e){if(this.logger.debug(`Outgoing Relay Subscribe Payload stalled`),this.relayer.events.emit(wg.connection_stalled),a)throw e}return null}async rpcBatchSubscribe(e){if(!e.length)return!0;let t=e[0].relay,n={method:Jt(t.protocol).batchSubscribe,params:{topics:e.map(e=>e.topic)}};this.logger.debug(`Outgoing Relay Payload`),this.logger.trace({type:`payload`,direction:`outgoing`,request:n});try{return await Ve(new Promise((e,t)=>{this.relayer.request(n).then(e).catch(e=>{this.logger.warn(e),t(e)})}),this.subscribeTimeout,`rpcBatchSubscribe failed, please try again`),!0}catch{return this.relayer.events.emit(wg.connection_stalled),!1}}async rpcBatchFetchMessages(e){if(!e.length)return;let t=e[0].relay,n={method:Jt(t.protocol).batchFetchMessages,params:{topics:e.map(e=>e.topic)}};this.logger.debug(`Outgoing Relay Payload`),this.logger.trace({type:`payload`,direction:`outgoing`,request:n});let r;try{r=await await Ve(new Promise((e,t)=>{this.relayer.request(n).catch(e=>{this.logger.warn(e),t(e)}).then(e)}),this.subscribeTimeout,`rpcBatchFetchMessages failed, please try again`)}catch{this.relayer.events.emit(wg.connection_stalled)}return r}rpcUnsubscribe(e,t,n){let r={method:Jt(n.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug(`Outgoing Relay Payload`),this.logger.trace({type:`payload`,direction:`outgoing`,request:r}),this.relayer.request(r)}onSubscribe(e,t){this.setSubscription(e,{...t,id:e}),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(e=>{this.setSubscription(e.id,{...e}),this.pending.delete(e.topic)})}async onUnsubscribe(e,t,n){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,n),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.logger.debug(`Setting subscription`),this.logger.trace({type:`method`,method:`setSubscription`,id:e,subscription:t}),this.addSubscription(e,t)}addSubscription(e,t){this.subscriptions.set(e,{...t}),this.topicMap.set(t.topic,e),this.events.emit(jg.created,t)}getSubscription(e){this.logger.debug(`Getting subscription`),this.logger.trace({type:`method`,method:`getSubscription`,id:e});let t=this.subscriptions.get(e);if(!t){let{message:t}=V(`NO_MATCHING_KEY`,`${this.name}: ${e}`);throw Error(t)}return t}deleteSubscription(e,t){this.logger.debug(`Deleting subscription`),this.logger.trace({type:`method`,method:`deleteSubscription`,id:e,reason:t});let n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(jg.deleted,{...n,reason:t})}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(jg.sync)}async onRestart(){if(this.cached.length){let e=[...this.cached],t=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let n=0;n<t;n++){let t=e.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(t)}}this.events.emit(jg.resubscribed)}async restore(){try{let e=await this.getRelayerSubscriptions();if(typeof e>`u`||!e.length)return;if(this.subscriptions.size&&!e.every(e=>e.topic===this.subscriptions.get(e.id)?.topic)){let{message:e}=V(`RESTORE_WILL_OVERRIDE`,this.name);throw this.logger.error(e),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:`method`,method:`restore`,subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(e.length){if(!await this.rpcBatchSubscribe(e)){this.logger.warn(`Batch subscribe failed for ${e.length} topics, adding to pending for retry`),e.forEach(e=>{this.pending.set(e.topic,e)});return}this.onBatchSubscribe(await Promise.all(e.map(async e=>({...e,id:await this.getSubscriptionId(e.topic)}))))}}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);let t=await this.rpcBatchFetchMessages(e);t&&t.messages&&(await Ye((0,$.toMiliseconds)($.ONE_SECOND)),await this.relayer.handleBatchMessageEvents(t.messages))}async onConnect(){await this.restart(),this.reset()}onDisconnect(){this.onDisable()}isInitialized(){if(!this.initialized){let{message:e}=V(`NOT_INITIALIZED`,this.name);throw Error(e)}}async restartToComplete(e){!this.relayer.connected&&!this.relayer.connecting&&(this.cached.push(e),await this.relayer.transportOpen())}async getClientId(){return this.clientId||=await this.relayer.core.crypto.getClientId(),this.clientId}async getSubscriptionId(e){return ze(e+await this.getClientId())}},c_=class extends Sh{constructor(e){super(e),this.protocol=`wc`,this.version=2,this.events=new Kr.EventEmitter,this.name=Cg,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.hasExperiencedNetworkDisruption=!1,this.heartBeatTimeout=(0,$.toMiliseconds)($.THIRTY_SECONDS+$.FIVE_SECONDS),this.reconnectInProgress=!1,this.requestsInFlight=[],this.connectTimeout=(0,$.toMiliseconds)($.ONE_SECOND*15),this.stalledRestartInProgress=!1,this.stalledRestartBackoff=0,this.stalledRestartBaseInterval=(0,$.toMiliseconds)($.ONE_SECOND*2),this.stalledRestartMaxInterval=(0,$.toMiliseconds)($.THIRTY_SECONDS),this.request=async e=>{this.logger.debug(`Publishing Request Payload`);let t=e.id||re().toString();await this.toEstablishConnection();try{this.logger.trace({id:t,method:e.method,topic:e.params?.topic},`relayer.request - publishing...`);let n=`${t}:${e.params?.tag||``}`;this.requestsInFlight.push(n);let r=await this.provider.request(e);return this.requestsInFlight=this.requestsInFlight.filter(e=>e!==n),r}catch(e){throw this.logger.debug(`Failed to Publish Request: ${t}`),e}},this.resetPingTimeout=()=>{Bt()&&(clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{try{this.logger.debug({},`pingTimeout: Connection stalled, terminating...`),this.provider?.connection?.socket?.terminate?.()}catch(e){this.logger.warn(e,e?.message)}},this.heartBeatTimeout))},this.onPayloadHandler=e=>{this.onProviderPayload(e),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.warn({},`Relayer connected 🛜`),this.startPingTimeout(),this.stalledRestartBackoff=0,this.events.emit(wg.connect)},this.onDisconnectHandler=()=>{this.logger.warn({},`Relayer disconnected 🛑`),this.requestsInFlight=[],this.onProviderDisconnect()},this.onProviderErrorHandler=e=>{this.logger.fatal(`Fatal socket error: ${e.message}`),this.events.emit(wg.error,e),this.logger.fatal(`Fatal socket error received, closing transport`),this.transportExplicitlyClosed=!0,clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,this.reconnectInProgress=!1,this.transportClose().catch(e=>this.logger.warn(e))},this.registerProviderListeners=()=>{this.provider.on(Tg.payload,this.onPayloadHandler),this.provider.on(Tg.connect,this.onConnectHandler),this.provider.on(Tg.disconnect,this.onDisconnectHandler),this.provider.on(Tg.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=Rt({logger:e.logger??`error`,name:this.name}),this.messages=new i_(this.logger,e.core),this.subscriber=new s_(this,this.logger),this.publisher=new a_(this,this.logger),this.projectId=e.projectId,this.relayUrl=e.relayUrl||`wss://relay.walletconnect.org`,gt()?this.packageName=Le():Ee()&&(this.bundleId=Le()),this.provider={}}async init(){this.logger.trace(`Initialized`),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.transportOpen().catch(e=>this.logger.warn(e,e?.message))}get context(){return en(this.logger)}get connected(){return this.provider?.connection?.socket?.readyState===1}get connecting(){return this.provider?.connection?.socket?.readyState===0||this.connectPromise!==void 0}async publish(e,t,n){this.isInitialized(),await this.publisher.publish(e,t,n),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now(),transportType:Og.relay},kg.outbound)}async publishCustom(e){this.isInitialized(),await this.publisher.publishCustom(e)}async subscribe(e,t){this.isInitialized(),(!t?.transportType||t?.transportType===`relay`)&&await this.toEstablishConnection();let n=t?.internal?.throwOnFailedPublish??!0,r=this.subscriber.topicMap.get(e)?.[0]||``,i,a=t=>{t.topic===e&&(this.subscriber.off(jg.created,a),i())};return await Promise.all([new Promise(e=>{i=e,this.subscriber.on(jg.created,a)}),new Promise((i,a)=>{this.subscriber.subscribe(e,{internal:{throwOnFailedPublish:n},...t}).then(e=>{r=e||r,i()}).catch(e=>{n?a(e):i()})})]),r}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportDisconnect(){this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await Ve(this.provider.disconnect(),2e3,`provider.disconnect()`).catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,clearTimeout(this.stalledRestartTimeout),this.stalledRestartInProgress=!1,this.stalledRestartBackoff=0,await this.resetTransport()}async transportOpen(e){if(!this.subscriber.hasAnyTopics){this.logger.info(`Starting WS connection skipped because the client has no topics to work with.`);return}if(this.connectPromise?(this.logger.debug({},`Waiting for existing connection attempt to resolve...`),await this.connectPromise,this.logger.debug({},`Existing connection attempt resolved`)):(this.connectPromise=this.connect(e).finally(()=>{this.connectPromise=void 0}),await this.connectPromise),!this.connected)throw Error(`Couldn't establish socket connection to the relay server: ${this.relayUrl}`)}async restartTransport(e){this.logger.debug({},`Restarting transport...`),!this.connectionAttemptInProgress&&(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.resetTransport(),await this.transportOpen())}async resetTransport(){this.reconnectInProgress=!0,clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,await this.transportDisconnect(),await this.subscriber.stop(),this.reconnectInProgress=!1}async confirmOnlineStateOrThrow(){if(!await Me())throw Error(`No internet connection detected. Please restart your network and try again.`)}async handleBatchMessageEvents(e){if(e?.length===0){this.logger.trace(`Batch message events is empty. Ignoring...`);return}let t=e.sort((e,t)=>e.publishedAt-t.publishedAt);this.logger.debug(`Batch of ${t.length} message events sorted`);for(let e of t)try{await this.onMessageEvent(e)}catch(e){this.logger.warn(e,`Error while processing batch message event: `+e?.message)}this.logger.trace(`Batch of ${t.length} message events processed`)}async onLinkMessageEvent(e,t){let{topic:n}=e;if(!t.sessionExists){let e={topic:n,expiry:Se($.FIVE_MINUTES),relay:{protocol:`irn`},active:!1};await this.core.pairing.pairings.set(n,e)}this.events.emit(wg.message,e),await this.recordMessageEvent(e,kg.inbound)}async connect(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),this.transportExplicitlyClosed=!1;let t=1;try{for(;t<6;){this.connectionAttemptInProgress=!0;try{if(this.transportExplicitlyClosed)break;this.logger.debug({},`Connecting to ${this.relayUrl}, attempt: ${t}...`),await this.createProvider(),await new Promise((e,t)=>{let n=()=>{t(Error(`Connection interrupted while trying to connect`))};this.provider.once(Tg.disconnect,n),Ve(this.provider.connect(),this.connectTimeout,`Socket stalled when trying to connect to ${this.relayUrl}`).then(()=>e()).catch(t).finally(()=>{this.provider.off(Tg.disconnect,n),clearTimeout(this.reconnectTimeout)})}),await new Promise((e,t)=>{let n=()=>{t(Error(`Connection interrupted while trying to subscribe`))};this.provider.once(Tg.disconnect,n),this.subscriber.start().then(e).catch(t).finally(()=>{this.provider.off(Tg.disconnect,n)})}),this.hasExperiencedNetworkDisruption=!1}catch(e){await this.subscriber.stop();let t=e;this.logger.warn({},t.message),this.hasExperiencedNetworkDisruption=!0}if(this.connected){this.logger.debug({},`Connected to ${this.relayUrl} successfully on attempt: ${t}`);break}await new Promise(e=>setTimeout(e,(0,$.toMiliseconds)(t*1))),t++}}finally{this.connectionAttemptInProgress=!1,clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,this.reconnectInProgress=!1}}startPingTimeout(){if(Bt())try{this.provider?.connection?.socket?.on(`ping`,()=>{this.resetPingTimeout()}),this.resetPingTimeout()}catch(e){this.logger.warn(e,e?.message)}}async createProvider(){if(this.provider.connection&&(this.unregisterProviderListeners(),this.connected))try{await Ve(this.provider.disconnect(),1e3,`Closing previous provider`)}catch{}let e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new ue(new se(Vt({sdkVersion:Dg,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId,packageName:this.packageName}))),this.registerProviderListeners()}async recordMessageEvent(e,t){let{topic:n,message:r}=e;await this.messages.set(n,r,t)}async shouldIgnoreMessageEvent(e){let{topic:t,message:n}=e;if(!n||n.length===0)return this.logger.warn(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isKnownTopic(t))return this.logger.warn(`Ignoring message for unknown topic ${t}`),!0;let r=this.messages.has(t,n);return r&&this.logger.warn(`Ignoring duplicate message: ${n}`),r}async onProviderPayload(e){if(this.logger.debug(`Incoming Relay Payload`),this.logger.trace({type:`payload`,direction:`incoming`,payload:e}),te(e)){if(!e.method.endsWith(`_subscription`))return;let t=e.params,{topic:n,message:r,publishedAt:i,attestation:a}=t.data,o={topic:n,message:r,publishedAt:i,transportType:Og.relay,attestation:a};this.logger.debug(`Emitting Relayer Payload`),this.logger.trace({type:`event`,event:t.id,...o}),this.events.emit(t.id,o),await this.acknowledgePayload(e),await this.onMessageEvent(o)}else ce(e)&&this.events.emit(wg.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(await this.recordMessageEvent(e,kg.inbound),this.events.emit(wg.message,e))}async acknowledgePayload(e){let t=ne(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(Tg.payload,this.onPayloadHandler),this.provider.off(Tg.connect,this.onConnectHandler),this.provider.off(Tg.disconnect,this.onDisconnectHandler),this.provider.off(Tg.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await Me();cn(async t=>{e!==t&&(e=t,t?await this.transportOpen().catch(e=>this.logger.error(e,e?.message)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))}),this.core.heartbeat.on(ee.pulse,async()=>{if(!this.transportExplicitlyClosed&&!this.connected&&At())try{await this.confirmOnlineStateOrThrow(),await this.transportOpen()}catch(e){this.logger.warn(e,e?.message)}}),this.events.on(wg.connection_stalled,()=>{if(this.transportExplicitlyClosed||this.stalledRestartInProgress)return;this.stalledRestartInProgress=!0;let e=this.stalledRestartBackoff===0?0:Math.min(2**(this.stalledRestartBackoff-1)*this.stalledRestartBaseInterval,this.stalledRestartMaxInterval);this.stalledRestartBackoff++,this.logger.warn(`Connection stalled, restarting transport${e?` in ${e}ms`:``}...`),this.stalledRestartTimeout=setTimeout(async()=>{try{if(this.transportExplicitlyClosed)return;await this.restartTransport()}catch(e){this.logger.error(e,e?.message)}finally{this.stalledRestartInProgress=!1}},e)})}async onProviderDisconnect(){if(clearTimeout(this.pingTimeout),this.events.emit(wg.disconnect),!this.reconnectInProgress){this.reconnectInProgress=!0;try{await this.subscriber.stop()}catch(e){this.logger.warn(e,`subscriber.stop() failed during disconnect`)}if(!this.subscriber.hasAnyTopics||this.transportExplicitlyClosed){this.reconnectInProgress=!1;return}this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e,e?.message)),this.reconnectTimeout=void 0,this.reconnectInProgress=!1},(0,$.toMiliseconds)(Eg))}}isInitialized(){if(!this.initialized){let{message:e}=V(`NOT_INITIALIZED`,this.name);throw Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectPromise){await this.connectPromise;return}this.connectPromise=this.connect().finally(()=>{this.connectPromise=void 0}),await this.connectPromise}}},l_=class extends Ch{constructor(e,t,n,r=pg,i=void 0){super(e,t,n,r),this.core=e,this.logger=t,this.name=n,this.map=new Map,this.version=`0.3`,this.cached=[],this.initialized=!1,this.storagePrefix=pg,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||=(this.logger.trace(`Initialized`),await this.restore(),this.cached.forEach(e=>{this.getKey&&e!==null&&!at(e)?this.map.set(this.getKey(e),e):ft(e)?this.map.set(e.id,e):B(e)&&this.map.set(e.topic,e)}),this.cached=[],!0)},this.set=async(e,t)=>{this.isInitialized(),this.map.has(e)?await this.update(e,t):(this.logger.debug(`Setting value`),this.logger.trace({type:`method`,method:`set`,key:e,value:t}),this.map.set(e,t),await this.persist())},this.get=e=>(this.isInitialized(),this.logger.debug(`Getting value`),this.logger.trace({type:`method`,method:`get`,key:e}),this.getData(e)),this.getAll=e=>(this.isInitialized(),e?this.values.filter(t=>Object.keys(e).every(n=>ug(t[n],e[n]))):this.values),this.update=async(e,t)=>{this.isInitialized(),this.logger.debug(`Updating value`),this.logger.trace({type:`method`,method:`update`,key:e,update:t});let n={...this.getData(e),...t};this.map.set(e,n),await this.persist()},this.delete=async(e,t)=>{this.isInitialized(),this.map.has(e)&&(this.logger.debug(`Deleting value`),this.logger.trace({type:`method`,method:`delete`,key:e,reason:t}),this.map.delete(e),this.addToRecentlyDeleted(e),await this.persist())},this.logger=ve(t,this.name),this.storagePrefix=r,this.getKey=i}get context(){return en(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//`+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){let t=this.map.get(e);if(!t){if(this.recentlyDeleted.includes(e)){let{message:t}=V(`MISSING_OR_INVALID`,`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(t),Error(t)}let{message:t}=V(`NO_MATCHING_KEY`,`${this.name}: ${e}`);throw this.logger.error(t),Error(t)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{let e=await this.getDataStore();if(typeof e>`u`||!e.length)return;if(this.map.size){let{message:e}=V(`RESTORE_WILL_OVERRIDE`,this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:`method`,method:`restore`,value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){let{message:e}=V(`NOT_INITIALIZED`,this.name);throw Error(e)}}},u_=class{constructor(e,t){this.core=e,this.logger=t,this.name=Ng,this.version=`0.3`,this.events=new Kr.default,this.initialized=!1,this.storagePrefix=pg,this.ignoredPayloadTypes=[1],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace(`Initialized`))},this.register=({methods:e})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...e])]},this.create=async e=>{this.isInitialized();let t=Ne(),n=await this.core.crypto.setSymKey(t),r=Se($.FIVE_MINUTES),i={protocol:`irn`},a={topic:n,expiry:r,relay:i,active:!1,methods:e?.methods},o=Wt({protocol:this.core.protocol,version:this.core.version,topic:n,symKey:t,relay:i,expiryTimestamp:r,methods:e?.methods});return this.events.emit(Fg.create,a),this.core.expirer.set(n,r),await this.pairings.set(n,a),await this.core.relayer.subscribe(n,{transportType:e?.transportType,internal:e?.internal}),{topic:n,uri:o}},this.pair=async e=>{this.isInitialized();let t=this.core.eventClient.createEvent({properties:{topic:e?.uri,trace:[qg.pairing_started]}});this.isValidPair(e,t);let{topic:n,symKey:r,relay:i,expiryTimestamp:a,methods:o}=Ce(e.uri);t.props.properties.topic=n,t.addTrace(qg.pairing_uri_validation_success),t.addTrace(qg.pairing_uri_not_expired);let s;if(this.pairings.keys.includes(n)){if(s=this.pairings.get(n),t.addTrace(qg.existing_pairing),s.active)throw t.setError(Jg.active_pairing_already_exists),Error(`Pairing already exists: ${n}. Please try again with a new connection URI.`);t.addTrace(qg.pairing_not_expired)}let c=a||Se($.FIVE_MINUTES),l={topic:n,relay:i,expiry:c,active:!1,methods:o};this.core.expirer.set(n,c),await this.pairings.set(n,l),t.addTrace(qg.store_new_pairing),e.activatePairing&&await this.activate({topic:n}),this.events.emit(Fg.create,l),t.addTrace(qg.emit_inactive_pairing),this.core.crypto.keychain.has(n)||await this.core.crypto.setSymKey(r,n),t.addTrace(qg.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{t.setError(Jg.no_internet_connection)}try{await this.core.relayer.subscribe(n,{relay:i})}catch(e){throw t.setError(Jg.subscribe_pairing_topic_failure),e}return t.addTrace(qg.subscribe_pairing_topic_success),l},this.activate=async({topic:e})=>{this.isInitialized();let t=Se($.FIVE_MINUTES);this.core.expirer.set(e,t),await this.pairings.update(e,{active:!0,expiry:t})},this.ping=async e=>{this.isInitialized(),await this.isValidPing(e),this.logger.warn(`ping() is deprecated and will be removed in the next major release.`);let{topic:t}=e;if(this.pairings.keys.includes(t)){let e=await this.sendRequest(t,`wc_pairingPing`,{}),{done:n,resolve:r,reject:i}=Ue();this.events.once(H(`pairing_ping`,e),({error:e})=>{e?i(e):r()}),await n()}},this.updateExpiry=async({topic:e,expiry:t})=>{this.isInitialized(),await this.pairings.update(e,{expiry:t})},this.updateMetadata=async({topic:e,metadata:t})=>{this.isInitialized(),await this.pairings.update(e,{peerMetadata:t})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async e=>{this.isInitialized(),await this.isValidDisconnect(e);let{topic:t}=e;this.pairings.keys.includes(t)&&(await this.sendRequest(t,`wc_pairingDelete`,$t(`USER_DISCONNECTED`)),await this.deletePairing(t))},this.formatUriFromPairing=e=>{this.isInitialized();let{topic:t,relay:n,expiry:r,methods:i}=e,a=this.core.crypto.keychain.get(t);return Wt({protocol:this.core.protocol,version:this.core.version,topic:t,symKey:a,relay:n,expiryTimestamp:r,methods:i})},this.sendRequest=async(e,t,n)=>{let r=pe(t,n),i=await this.core.crypto.encode(e,r),a=Pg[t].req;return this.core.history.set(e,r),this.core.relayer.publish(e,i,a),r.id},this.sendResult=async(e,t,n)=>{let r=ne(e,n),i=await this.core.crypto.encode(t,r),a=Pg[(await this.core.history.get(t,e)).request.method].res;await this.core.relayer.publish(t,i,a),await this.core.history.resolve(r)},this.sendError=async(e,t,n)=>{let r=oe(e,n),i=await this.core.crypto.encode(t,r),a=(await this.core.history.get(t,e)).request.method,o=Pg[a]?Pg[a].res:Pg.unregistered_method.res;await this.core.relayer.publish(t,i,o),await this.core.history.resolve(r)},this.deletePairing=async(e,t)=>{await this.core.relayer.unsubscribe(e),await Promise.all([this.pairings.delete(e,$t(`USER_DISCONNECTED`)),this.core.crypto.deleteSymKey(e),t?Promise.resolve():this.core.expirer.del(e)])},this.cleanup=async()=>{let e=this.pairings.getAll().filter(e=>Lt(e.expiry));await Promise.all(e.map(e=>this.deletePairing(e.topic)))},this.onRelayEventRequest=async e=>{let{topic:t,payload:n}=e;switch(n.method){case`wc_pairingPing`:return await this.onPairingPingRequest(t,n);case`wc_pairingDelete`:return await this.onPairingDeleteRequest(t,n);default:return await this.onUnknownRpcMethodRequest(t,n)}},this.onRelayEventResponse=async e=>{let{topic:t,payload:n}=e,r=(await this.core.history.get(t,n.id)).request.method;switch(r){case`wc_pairingPing`:return this.onPairingPingResponse(t,n);default:return this.onUnknownRpcMethodResponse(r)}},this.onPairingPingRequest=async(e,t)=>{let{id:n}=t;try{this.isValidPing({topic:e}),await this.sendResult(n,e,!0),this.events.emit(Fg.ping,{id:n,topic:e})}catch(t){await this.sendError(n,e,t),this.logger.error(t)}},this.onPairingPingResponse=(e,t)=>{let{id:n}=t;setTimeout(()=>{de(t)?this.events.emit(H(`pairing_ping`,n),{}):z(t)&&this.events.emit(H(`pairing_ping`,n),{error:t.error})},500)},this.onPairingDeleteRequest=async(e,t)=>{let{id:n}=t;try{this.isValidDisconnect({topic:e}),await this.deletePairing(e),this.events.emit(Fg.delete,{id:n,topic:e})}catch(t){await this.sendError(n,e,t),this.logger.error(t)}},this.onUnknownRpcMethodRequest=async(e,t)=>{let{id:n,method:r}=t;try{if(this.registeredMethods.includes(r))return;let t=$t(`WC_METHOD_UNSUPPORTED`,r);await this.sendError(n,e,t),this.logger.error(t)}catch(t){await this.sendError(n,e,t),this.logger.error(t)}},this.onUnknownRpcMethodResponse=e=>{this.registeredMethods.includes(e)||this.logger.error($t(`WC_METHOD_UNSUPPORTED`,e))},this.isValidPair=(e,t)=>{if(!_e(e)){let{message:n}=V(`MISSING_OR_INVALID`,`pair() params: ${e}`);throw t.setError(Jg.malformed_pairing_uri),Error(n)}if(!nn(e.uri)){let{message:n}=V(`MISSING_OR_INVALID`,`pair() uri: ${e.uri}`);throw t.setError(Jg.malformed_pairing_uri),Error(n)}let n=Ce(e?.uri);if(!n?.relay?.protocol){let{message:e}=V(`MISSING_OR_INVALID`,`pair() uri#relay-protocol`);throw t.setError(Jg.malformed_pairing_uri),Error(e)}if(!n?.symKey){let{message:e}=V(`MISSING_OR_INVALID`,`pair() uri#symKey`);throw t.setError(Jg.malformed_pairing_uri),Error(e)}if(n?.expiryTimestamp&&(0,$.toMiliseconds)(n?.expiryTimestamp)<Date.now()){t.setError(Jg.pairing_expired);let{message:e}=V(`EXPIRED`,`pair() URI has expired. Please try again with a new connection URI.`);throw Error(e)}},this.isValidPing=async e=>{if(!_e(e)){let{message:t}=V(`MISSING_OR_INVALID`,`ping() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidDisconnect=async e=>{if(!_e(e)){let{message:t}=V(`MISSING_OR_INVALID`,`disconnect() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidPairingTopic=async e=>{if(!zt(e,!1)){let{message:t}=V(`MISSING_OR_INVALID`,`pairing topic should be a string: ${e}`);throw Error(t)}if(!this.pairings.keys.includes(e)){let{message:t}=V(`NO_MATCHING_KEY`,`pairing topic doesn't exist: ${e}`);throw Error(t)}if(Lt(this.pairings.get(e).expiry)){await this.deletePairing(e);let{message:t}=V(`EXPIRED`,`pairing topic: ${e}`);throw Error(t)}},this.core=e,this.logger=ve(t,this.name),this.pairings=new l_(this.core,this.logger,this.name,this.storagePrefix)}get context(){return en(this.logger)}isInitialized(){if(!this.initialized){let{message:e}=V(`NOT_INITIALIZED`,this.name);throw Error(e)}}registerRelayerEvents(){this.core.relayer.on(wg.message,async e=>{let{topic:t,message:n,transportType:r}=e;if(this.pairings.keys.includes(t)&&r!==Og.link_mode&&!this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))try{let e=await this.core.crypto.decode(t,n);te(e)?(this.core.history.set(t,e),await this.onRelayEventRequest({topic:t,payload:e})):ce(e)&&(await this.core.history.resolve(e),await this.onRelayEventResponse({topic:t,payload:e}),this.core.history.delete(t,e.id)),await this.core.relayer.messages.ack(t,n)}catch(e){this.logger.error(e)}})}registerExpirerEvents(){this.core.expirer.on(zg.expired,async e=>{let{topic:t}=We(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(Fg.expire,{topic:t}))})}},d_=class extends yh{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.records=new Map,this.events=new Kr.EventEmitter,this.name=Lg,this.version=`0.3`,this.cached=[],this.initialized=!1,this.storagePrefix=pg,this.init=async()=>{this.initialized||=(this.logger.trace(`Initialized`),await this.restore(),this.cached.forEach(e=>this.records.set(e.id,e)),this.cached=[],this.registerEventListeners(),!0)},this.set=(e,t,n)=>{if(this.isInitialized(),this.logger.debug(`Setting JSON-RPC request history record`),this.logger.trace({type:`method`,method:`set`,topic:e,request:t,chainId:n}),this.records.has(t.id))return;let r={id:t.id,topic:e,request:{method:t.method,params:t.params||null},chainId:n,expiry:Se($.THIRTY_DAYS)};this.records.set(r.id,r),this.persist(),this.events.emit(Ig.created,r)},this.resolve=async e=>{if(this.isInitialized(),this.logger.debug(`Updating JSON-RPC response history record`),this.logger.trace({type:`method`,method:`update`,response:e}),!this.records.has(e.id))return;let t=await this.getRecord(e.id);typeof t.response<`u`||(t.response=z(e)?{error:e.error}:{result:e.result},this.records.set(t.id,t),this.persist(),this.events.emit(Ig.updated,t))},this.get=async(e,t)=>(this.isInitialized(),this.logger.debug(`Getting record`),this.logger.trace({type:`method`,method:`get`,topic:e,id:t}),await this.getRecord(t)),this.delete=(e,t)=>{this.isInitialized(),this.logger.debug(`Deleting record`),this.logger.trace({type:`method`,method:`delete`,id:t}),this.values.forEach(n=>{if(n.topic===e){if(typeof t<`u`&&n.id!==t)return;this.records.delete(n.id),this.events.emit(Ig.deleted,n)}}),this.persist()},this.exists=async(e,t)=>(this.isInitialized(),this.records.has(t)?(await this.getRecord(t)).topic===e:!1),this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=ve(t,this.name)}get context(){return en(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//`+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){let e=[];return this.values.forEach(t=>{if(typeof t.response<`u`)return;let n={topic:t.topic,request:pe(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(n)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();let t=this.records.get(e);if(!t){let{message:t}=V(`NO_MATCHING_KEY`,`${this.name}: ${e}`);throw Error(t)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Ig.sync)}async restore(){try{let e=await this.getJsonRpcRecords();if(typeof e>`u`||!e.length)return;if(this.records.size){let{message:e}=V(`RESTORE_WILL_OVERRIDE`,this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:`method`,method:`restore`,records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(Ig.created,e=>{let t=Ig.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,record:e})}),this.events.on(Ig.updated,e=>{let t=Ig.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,record:e})}),this.events.on(Ig.deleted,e=>{let t=Ig.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,record:e})}),this.core.heartbeat.on(ee.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(t=>{(0,$.toMiliseconds)(t.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${t.id}`),this.records.delete(t.id),this.events.emit(Ig.deleted,t,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){let{message:e}=V(`NOT_INITIALIZED`,this.name);throw Error(e)}}},f_=class extends Th{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.expirations=new Map,this.events=new Kr.EventEmitter,this.name=Rg,this.version=`0.3`,this.cached=[],this.initialized=!1,this.storagePrefix=pg,this.init=async()=>{this.initialized||=(this.logger.trace(`Initialized`),await this.restore(),this.cached.forEach(e=>this.expirations.set(e.target,e)),this.cached=[],this.registerEventListeners(),!0)},this.has=e=>{try{let t=this.formatTarget(e);return typeof this.getExpiration(t)<`u`}catch{return!1}},this.set=(e,t)=>{this.isInitialized();let n=this.formatTarget(e),r={target:n,expiry:t};this.expirations.set(n,r),this.checkExpiry(n,r),this.events.emit(zg.created,{target:n,expiration:r})},this.get=e=>{this.isInitialized();let t=this.formatTarget(e);return this.getExpiration(t)},this.del=e=>{if(this.isInitialized(),this.has(e)){let t=this.formatTarget(e),n=this.getExpiration(t);this.expirations.delete(t),this.events.emit(zg.deleted,{target:t,expiration:n})}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=ve(t,this.name)}get context(){return en(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//`+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e==`string`)return Nt(e);if(typeof e==`number`)return an(e);let{message:t}=V(`UNKNOWN_TYPE`,`Target type: ${typeof e}`);throw Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(zg.sync)}async restore(){try{let e=await this.getExpirations();if(typeof e>`u`||!e.length)return;if(this.expirations.size){let{message:e}=V(`RESTORE_WILL_OVERRIDE`,this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:`method`,method:`restore`,expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){let t=this.expirations.get(e);if(!t){let{message:t}=V(`NO_MATCHING_KEY`,`${this.name}: ${e}`);throw this.logger.warn(t),Error(t)}return t}checkExpiry(e,t){let{expiry:n}=t;(0,$.toMiliseconds)(n)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(zg.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(ee.pulse,()=>this.checkExpirations()),this.events.on(zg.created,e=>{let t=zg.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,data:e}),this.persist()}),this.events.on(zg.expired,e=>{let t=zg.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,data:e}),this.persist()}),this.events.on(zg.deleted,e=>{let t=zg.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){let{message:e}=V(`NOT_INITIALIZED`,this.name);throw Error(e)}}},p_=class extends Eh{constructor(e,t,n){super(e,t,n),this.core=e,this.logger=t,this.store=n,this.name=Bg,this.verifyUrlV3=Ug,this.storagePrefix=pg,this.version=2,this.init=async()=>{this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&(0,$.toMiliseconds)(this.publicKey?.expiresAt)<Date.now()&&(this.logger.debug(`verify v2 public key expired`),await this.removePublicKey()))},this.register=async e=>{if(!Ae()||this.isDevEnv)return;let t=window.location.origin,{id:n,decryptedId:r}=e,i=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${t}&id=${n}&decryptedId=${r}`;try{let e=(0,dg.getDocument)(),t=this.startAbortTimer($.ONE_SECOND*5),r=await new Promise((r,a)=>{let o=()=>{window.removeEventListener(`message`,c),e.body.removeChild(s),a(`attestation aborted`)};this.abortController.signal.addEventListener(`abort`,o);let s=e.createElement(`iframe`);s.src=i,s.style.display=`none`,s.addEventListener(`error`,o,{signal:this.abortController.signal});let c=i=>{if(i.data&&typeof i.data==`string`)try{let a=JSON.parse(i.data);if(a.type===`verify_attestation`){if(F(a.attestation).payload.id!==n)return;clearInterval(t),e.body.removeChild(s),this.abortController.signal.removeEventListener(`abort`,o),window.removeEventListener(`message`,c),r(a.attestation===null?``:a.attestation)}}catch(e){this.logger.warn(e)}};e.body.appendChild(s),window.addEventListener(`message`,c,{signal:this.abortController.signal})});return this.logger.debug(r,`jwt attestation`),r}catch(e){this.logger.warn(e)}return``},this.resolve=async e=>{if(this.isDevEnv)return``;let{attestationId:t,hash:n,encryptedId:r}=e;if(t===``){this.logger.debug(`resolve: attestationId is empty, skipping`);return}if(t){if(F(t).payload.id!==r)return;let e=await this.isValidJwtAttestation(t);if(e){if(!e.isVerified){this.logger.warn(`resolve: jwt attestation: origin url not verified`);return}return e}}if(!n)return;let i=this.getVerifyUrl(e?.verifyUrl);return this.fetchAttestation(n,i)},this.fetchAttestation=async(e,t)=>{this.logger.debug(`resolving attestation: ${e} from url: ${t}`);let n=this.startAbortTimer($.ONE_SECOND*5),r=await fetch(`${t}/attestation/${e}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(n),r.status===200?await r.json():void 0},this.getVerifyUrl=e=>{let t=e||`https://verify.walletconnect.org`;return Wg.includes(t)||(this.logger.info(`verify url: ${t}, not included in trusted list, assigning default: https://verify.walletconnect.org`),t=`https://verify.walletconnect.org`),t},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);let e=this.startAbortTimer($.FIVE_SECONDS),t=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(e),await t.json()}catch(e){this.logger.warn(e)}},this.persistPublicKey=async e=>{this.logger.debug(e,`persisting public key to local storage`),await this.store.setItem(this.storeKey,e),this.publicKey=e},this.removePublicKey=async()=>{this.logger.debug(`removing verify v2 public key from storage`),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async e=>{let t=await this.getPublicKey();try{if(t)return this.validateAttestation(e,t)}catch(e){this.logger.error(e),this.logger.warn(`error validating attestation`)}let n=await this.fetchAndPersistPublicKey();try{if(n)return this.validateAttestation(e,n)}catch(e){this.logger.error(e),this.logger.warn(`error validating attestation`)}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async e=>{let t=await this.fetchPublicKey();t&&(await this.persistPublicKey(t),e(t))});let e=await this.fetchPromise;return this.fetchPromise=void 0,e},this.validateAttestation=(e,t)=>{let n=Tt(e,t.publicKey),r={hasExpired:(0,$.toMiliseconds)(n.exp)<Date.now(),payload:n};if(r.hasExpired)throw this.logger.warn(`resolve: jwt attestation expired`),Error(`JWT attestation expired`);return{origin:r.payload.origin,isScam:r.payload.isScam,isVerified:r.payload.isVerified}},this.logger=ve(t,this.name),this.abortController=new AbortController,this.isDevEnv=pn(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//verify:public:key`}get context(){return en(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),(0,$.toMiliseconds)(e))}},m_=class extends Dh{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.context=Gg,this.registerDeviceToken=async e=>{let{clientId:t,token:n,notificationType:r,enableEncrypted:i=!1}=e,a=`${Kg}/${this.projectId}/clients`;await fetch(a,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({client_id:t,type:r,token:n,always_raw:i})})},this.logger=ve(t,this.context)}},h_=class extends Oh{constructor(e,t,n=!0){super(e,t,n),this.core=e,this.logger=t,this.context=e_,this.storagePrefix=pg,this.storageVersion=$g,this.events=new Map,this.shouldPersist=!1,this.init=async()=>{if(!pn())try{let e={eventId:tn(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:`INIT`,type:``,properties:{client_id:await this.core.crypto.getClientId(),user_agent:wt(this.core.relayer.protocol,this.core.relayer.version,Dg)}}};await this.sendEvent([e])}catch(e){this.logger.warn(e)}},this.createEvent=e=>{let{event:t=`ERROR`,type:n=``,properties:{topic:r,trace:i}}=e,a=tn(),o=this.core.projectId||``,s={eventId:a,timestamp:Date.now(),props:{event:t,type:n,properties:{topic:r,trace:i}},bundleId:o,domain:this.getAppDomain(),...this.setMethods(a)};return this.telemetryEnabled&&(this.events.set(a,s),this.shouldPersist=!0),s},this.getEvent=e=>{let{eventId:t,topic:n}=e;if(t)return this.events.get(t);let r=Array.from(this.events.values()).find(e=>e.props.properties.topic===n);if(r)return{...r,...this.setMethods(r.eventId)}},this.deleteEvent=e=>{let{eventId:t}=e;this.events.delete(t),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(ee.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(e=>{(0,$.fromMiliseconds)(Date.now())-(0,$.fromMiliseconds)(e.timestamp)>86400&&(this.events.delete(e.eventId),this.shouldPersist=!0)})})},this.setMethods=e=>({addTrace:t=>this.addTrace(e,t),setError:t=>this.setError(e,t)}),this.addTrace=(e,t)=>{let n=this.events.get(e);n&&(n.props.properties.trace.push(t),this.events.set(e,n),this.shouldPersist=!0)},this.setError=(e,t)=>{let n=this.events.get(e);n&&(n.props.type=t,n.timestamp=Date.now(),this.events.set(e,n),this.shouldPersist=!0)},this.persist=async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1},this.restore=async()=>{try{let e=await this.core.storage.getItem(this.storageKey)||[];if(!e.length)return;e.forEach(e=>{this.events.set(e.eventId,{...e,...this.setMethods(e.eventId)})})}catch(e){this.logger.warn(e)}},this.submit=async()=>{if(!this.telemetryEnabled||this.events.size===0)return;let e=[];for(let[t,n]of this.events)n.props.type&&e.push(n);if(e.length!==0)try{if((await this.sendEvent(e)).ok)for(let t of e)this.events.delete(t.eventId),this.shouldPersist=!0}catch(e){this.logger.warn(e)}},this.sendEvent=async e=>{let t=this.getAppDomain()?``:`&sp=desktop`;return await fetch(`${t_}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${Dg}${t}`,{method:`POST`,body:JSON.stringify(e)})},this.getAppDomain=()=>Ge().url,this.logger=ve(t,this.context),this.telemetryEnabled=n,n?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+`//`+this.context}},g_=class e extends vh{constructor(e){super(e),this.protocol=`wc`,this.version=2,this.name=fg,this.events=new Kr.EventEmitter,this.initialized=!1,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.dispatchEnvelope=({topic:e,message:t,sessionExists:n})=>{if(!e||!t)return;let r={topic:e,message:t,publishedAt:Date.now(),transportType:Og.link_mode};this.relayer.onLinkMessageEvent(r,{sessionExists:n})};let t=this.getGlobalCore(e?.customStoragePrefix);if(t)try{return this.customStoragePrefix=t.customStoragePrefix,this.logger=t.logger,this.heartbeat=t.heartbeat,this.crypto=t.crypto,this.history=t.history,this.expirer=t.expirer,this.storage=t.storage,this.relayer=t.relayer,this.pairing=t.pairing,this.verify=t.verify,this.echoClient=t.echoClient,this.linkModeSupportedApps=t.linkModeSupportedApps,this.eventClient=t.eventClient,this.initialized=t.initialized,this.logChunkController=t.logChunkController,t}catch{}this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||`wss://relay.walletconnect.org`,this.customStoragePrefix=e?.customStoragePrefix?`:${e.customStoragePrefix}`:``;let{logger:n,chunkLoggerController:r}=Ct({opts:Xe({level:typeof e?.logger==`string`&&e.logger?e.logger:mg.logger,name:fg}),maxSizeInBytes:e?.maxLogBlobSizeInBytes,loggerOverride:e?.logger});this.logChunkController=r,this.logChunkController?.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{this.logChunkController?.downloadLogsBlobInBrowser&&this.logChunkController?.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()})}),this.logger=ve(n,this.name),this.heartbeat=new ie,this.crypto=new r_(this,this.logger,e?.keychain),this.history=new d_(this,this.logger),this.expirer=new f_(this,this.logger),this.storage=e?.storage?e.storage:new ae({...hg,...e?.storageOptions}),this.relayer=new c_({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new u_(this,this.logger),this.verify=new p_(this,this.logger,this.storage),this.echoClient=new m_(this.projectId||``,this.logger),this.linkModeSupportedApps=[],this.eventClient=new h_(this,this.logger,e?.telemetryEnabled),this.setGlobalCore(this)}static async init(t){let n=new e(t);await n.initialize();let r=await n.crypto.getClientId();return await n.storage.setItem(Ag,r),n}get context(){return en(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){return this.logChunkController?.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(`WALLETCONNECT_LINK_MODE_APPS`,this.linkModeSupportedApps))}async initialize(){this.logger.trace(`Initialized`);try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.linkModeSupportedApps=await this.storage.getItem(`WALLETCONNECT_LINK_MODE_APPS`)||[],this.initialized=!0,this.logger.info(`Core Initialization Success`)}catch(e){throw this.logger.warn(e,`Core Initialization Failure at epoch ${Date.now()}`),this.logger.error(e.message),e}}getGlobalCore(e=``){try{if(this.isGlobalCoreDisabled())return;let t=`_walletConnectCore_${e}`,n=`${t}_count`;return globalThis[n]=(globalThis[n]||0)+1,globalThis[n],globalThis[t]}catch{return}}setGlobalCore(e){try{if(this.isGlobalCoreDisabled())return;let t=`_walletConnectCore_${e.opts?.customStoragePrefix||``}`;globalThis[t]=e}catch{}}isGlobalCoreDisabled(){try{return typeof o<`u`&&{}.DISABLE_GLOBAL_CORE===`true`}catch{return!0}}};m();var __=`client`,v_=`wc@2:${__}:`,y_={name:__,logger:`error`,controller:!1,relayUrl:`wss://relay.walletconnect.org`},b_=`WALLETCONNECT_DEEPLINK_CHOICE`,x_=`proposal`;$.THIRTY_DAYS;var S_=`Proposal expired`,C_=`session`,w_=$.SEVEN_DAYS,T_=`engine`,E_={wc_sessionPropose:{req:{ttl:$.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:$.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:$.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:$.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:$.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:$.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:$.ONE_DAY,prompt:!1,tag:1104},res:{ttl:$.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:$.ONE_DAY,prompt:!1,tag:1106},res:{ttl:$.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:$.FIVE_MINUTES*3,prompt:!0,tag:1108},res:{ttl:$.FIVE_MINUTES*3,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:$.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:$.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:$.ONE_DAY,prompt:!1,tag:1112},res:{ttl:$.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:$.ONE_DAY,prompt:!1,tag:1114},res:{ttl:$.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:$.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:$.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:$.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:$.FIVE_MINUTES,prompt:!1,tag:1119}}},D_={min:$.FIVE_MINUTES,max:$.SEVEN_DAYS},O_={idle:`IDLE`,active:`ACTIVE`},k_={eth_sendTransaction:{key:``},eth_sendRawTransaction:{key:``},wallet_sendCalls:{key:``},solana_signTransaction:{key:`signature`},solana_signAllTransactions:{key:`transactions`},solana_signAndSendTransaction:{key:`signature`},sui_signAndExecuteTransaction:{key:`digest`},sui_signTransaction:{key:``},hedera_signAndExecuteTransaction:{key:`transactionId`},hedera_executeTransaction:{key:`transactionId`},near_signTransaction:{key:``},near_signTransactions:{key:``},tron_signTransaction:{key:`txID`},xrpl_signTransaction:{key:``},xrpl_signTransactionFor:{key:``},algo_signTxn:{key:``},sendTransfer:{key:`txid`},stacks_stxTransfer:{key:`txId`},polkadot_signTransaction:{key:``},cosmos_signDirect:{key:``}},A_=`request`,j_=[`wc_sessionPropose`,`wc_sessionRequest`,`wc_authRequest`,`wc_sessionAuthenticate`],M_=`auth`,N_=`authKeys`,P_=`pairingTopics`,F_=`requests`,I_=`wc@1.5:${M_}:`,L_=`${I_}:PUB_KEY`,R_=class extends Ah{constructor(e){super(e),this.name=T_,this.events=new Kr.default,this.initialized=!1,this.requestQueue={state:O_.idle,queue:[]},this.sessionRequestQueue={state:O_.idle,queue:[]},this.emittedSessionRequests=new Mt({limit:500}),this.requestQueueDelay=$.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.pendingSessions=new Map,this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.registerSubscriptionCleanup(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(E_)}),this.initialized=!0,setTimeout(async()=>{await this.processPendingMessageEvents(),this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},(0,$.toMiliseconds)(this.requestQueueDelay)))},this.connect=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();let t={...e,requiredNamespaces:e.requiredNamespaces||{},optionalNamespaces:e.optionalNamespaces||{}};await this.isValidConnect(t),t.optionalNamespaces=Je(t.requiredNamespaces,t.optionalNamespaces),t.requiredNamespaces={};let{pairingTopic:n,requiredNamespaces:r,optionalNamespaces:i,sessionProperties:a,scopedProperties:o,relays:s,authentication:c,walletPay:l}=t,u=c?.[0]?.ttl||E_.wc_sessionPropose.req.ttl||$.FIVE_MINUTES;this.validateRequestExpiry(u);let d=n,f,p=!1;try{if(d){let e=this.client.core.pairing.pairings.get(d);this.client.logger.warn(`connect() with existing pairing topic is deprecated and will be removed in the next major release.`),p=e.active}}catch(e){throw this.client.logger.error(`connect() -> pairing.get(${d}) failed`),e}if(!d||!p){let{topic:e,uri:t}=await this.client.core.pairing.create({internal:{skipSubscribe:!0}});d=e,f=t}if(!d){let{message:e}=V(`NO_MATCHING_KEY`,`connect() pairing topic: ${d}`);throw Error(e)}let m=await this.client.core.crypto.generateKeyPair(),h=Se(u),g={requiredNamespaces:r,optionalNamespaces:i,relays:s??[{protocol:`irn`}],proposer:{publicKey:m,metadata:this.client.metadata},expiryTimestamp:h,pairingTopic:d,...a&&{sessionProperties:a},...o&&{scopedProperties:o},id:le(),...(c||l)&&{requests:{authentication:c?.map(e=>{let{domain:t,chains:n,nonce:r,uri:i,exp:a,nbf:o,type:s,statement:c,requestId:l,resources:u,signatureTypes:d}=e;return{domain:t,chains:n,nonce:r,type:s??`caip122`,aud:i,version:`1`,iat:new Date().toISOString(),exp:a,nbf:o,statement:c,requestId:l,resources:u,signatureTypes:d}}),walletPay:l}}},_=H(`session_connect`,g.id),{reject:v,resolve:y,done:b}=Ue(u,S_),x=({id:e})=>{if(e===g.id){this.client.events.off(`proposal_expire`,x);let e=this.pendingSessions.get(g.id);if(e){let{sessionTopic:t,publicKey:n}=e;Promise.all([this.client.core.relayer.unsubscribe(t),this.client.core.crypto.keychain.has(t)?this.client.core.crypto.deleteSymKey(t):Promise.resolve(),this.client.core.crypto.keychain.has(n)?this.client.core.crypto.deleteKeyPair(n):Promise.resolve()]).catch(e=>this.client.logger.warn(e))}this.pendingSessions.delete(g.id),this.events.emit(_,{error:{message:S_,code:0}})}};return this.client.events.on(`proposal_expire`,x),this.events.once(_,({error:e,session:t})=>{this.client.events.off(`proposal_expire`,x),e?v(e):t&&y(t)}),await this.setProposal(g.id,g),await this.sendProposeSession({proposal:g,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:g.id}}}).catch(e=>{throw this.deleteProposal(g.id),e}),{uri:f,approval:b}},this.pair=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(e)}catch(e){throw this.client.logger.error(`pair() failed`),e}},this.approve=async e=>{let t=this.client.core.eventClient.createEvent({properties:{topic:e?.id?.toString(),trace:[Yg.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(e){throw t.setError(Xg.no_internet_connection),e}try{await this.isValidProposalId(e?.id)}catch(n){throw this.client.logger.error(`approve() -> proposal.get(${e?.id}) failed`),t.setError(Xg.proposal_not_found),n}try{await this.isValidApprove(e)}catch(e){throw this.client.logger.error(`approve() -> isValidApprove() failed`),t.setError(Xg.session_approve_namespace_validation_failure),e}let{id:n,relayProtocol:r,namespaces:i,sessionProperties:a,scopedProperties:o,sessionConfig:s,proposalRequestsResponses:c}=e,l=this.client.proposal.get(n);this.client.core.eventClient.deleteEvent({eventId:t.eventId});let{pairingTopic:u,proposer:d,requiredNamespaces:f,optionalNamespaces:p}=l,m=this.client.core.eventClient?.getEvent({topic:u});m||=this.client.core.eventClient?.createEvent({type:Yg.session_approve_started,properties:{topic:u,trace:[Yg.session_approve_started,Yg.session_namespaces_validation_success]}});let h=await this.client.core.crypto.generateKeyPair(),g=d.publicKey,_=await this.client.core.crypto.generateSharedKey(h,g),v={relay:{protocol:r??`irn`},namespaces:i,controller:{publicKey:h,metadata:this.client.metadata},expiry:Se(w_),...a&&{sessionProperties:a},...o&&{scopedProperties:o},...s&&{sessionConfig:s},proposalRequestsResponses:c},y=Og.relay;m.addTrace(Yg.subscribing_session_topic);try{await this.client.core.relayer.subscribe(_,{transportType:y,internal:{skipSubscribe:!0}})}catch(e){throw m.setError(Xg.subscribe_session_topic_failure),e}m.addTrace(Yg.subscribe_session_topic_success);let b={...v,topic:_,requiredNamespaces:f,optionalNamespaces:p,pairingTopic:u,acknowledged:!1,self:v.controller,peer:{publicKey:d.publicKey,metadata:d.metadata},controller:h,transportType:Og.relay,authentication:c?.authentication,walletPayResult:c?.walletPay};await this.client.session.set(_,b),m.addTrace(Yg.store_session);try{await this.sendApproveSession({sessionTopic:_,proposal:l,pairingProposalResponse:{relay:{protocol:r??`irn`},responderPublicKey:h},sessionSettleRequest:v,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:n,...this.getTVFApproveParams(b)}}}),m.addTrace(Yg.session_approve_publish_success)}catch(e){throw this.client.logger.error(e),this.client.session.delete(_,$t(`USER_DISCONNECTED`)),await this.client.core.relayer.unsubscribe(_),e}return this.client.core.eventClient.deleteEvent({eventId:m.eventId}),await this.client.core.pairing.updateMetadata({topic:u,metadata:d.metadata}),await this.deleteProposal(n),await this.client.core.pairing.activate({topic:u}),await this.setExpiry(_,Se(w_)),{topic:_,acknowledged:()=>Promise.resolve(this.client.session.get(_))}},this.reject=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(e)}catch(e){throw this.client.logger.error(`reject() -> isValidReject() failed`),e}let{id:t,reason:n}=e,r;try{r=this.client.proposal.get(t).pairingTopic}catch(e){throw this.client.logger.error(`reject() -> proposal.get(${t}) failed`),e}r&&await this.sendError({id:t,topic:r,error:n,rpcOpts:E_.wc_sessionPropose.reject}),await this.deleteProposal(t)},this.update=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(e)}catch(e){throw this.client.logger.error(`update() -> isValidUpdate() failed`),e}let{topic:t,namespaces:n}=e,{done:r,resolve:i,reject:a}=Ue($.FIVE_MINUTES,`Session update request expired without receiving any acknowledgement`),o=le(),s=re().toString(),c=this.client.session.get(t).namespaces;return this.events.once(H(`session_update`,o),({error:e})=>{e?a(e):i()}),await this.client.session.update(t,{namespaces:n}),await this.sendRequest({topic:t,method:`wc_sessionUpdate`,params:{namespaces:n},throwOnFailedPublish:!0,clientRpcId:o,relayRpcId:s}).catch(e=>{this.client.logger.error(e),this.client.session.update(t,{namespaces:c}),a(e)}),{acknowledged:r}},this.extend=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(e)}catch(e){throw this.client.logger.error(`extend() -> isValidExtend() failed`),e}let{topic:t}=e,n=le(),{done:r,resolve:i,reject:a}=Ue($.FIVE_MINUTES,`Session extend request expired without receiving any acknowledgement`);return this.events.once(H(`session_extend`,n),({error:e})=>{e?a(e):i()}),await this.setExpiry(t,Se(w_)),this.sendRequest({topic:t,method:`wc_sessionExtend`,params:{},clientRpcId:n,throwOnFailedPublish:!0}).catch(e=>{a(e)}),{acknowledged:r}},this.request=async e=>{this.isInitialized();try{await this.isValidRequest(e)}catch(e){throw this.client.logger.error(`request() -> isValidRequest() failed`),e}let{chainId:t,request:n,topic:r,expiry:i=E_.wc_sessionRequest.req.ttl}=e,a=this.client.session.get(r);a?.transportType===Og.relay&&await this.confirmOnlineStateOrThrow();let o=le(),s=re().toString(),{done:c,resolve:l,reject:u}=Ue(i,`Request expired. Please try again.`);this.events.once(H(`session_request`,o),({error:e,result:t})=>{e?u(e):l(t)});let d=`wc_sessionRequest`,f=this.getAppLinkIfEnabled(a.peer.metadata,a.transportType);if(f)return await this.sendRequest({clientRpcId:o,relayRpcId:s,topic:r,method:d,params:{request:{...n,expiryTimestamp:Se(i)},chainId:t},expiry:i,throwOnFailedPublish:!0,appLink:f}).catch(e=>u(e)),this.client.events.emit(`session_request_sent`,{topic:r,request:n,chainId:t,id:o}),await c();let p={request:{...n,expiryTimestamp:Se(i)},chainId:t};return await Promise.all([new Promise(async e=>{await this.sendRequest({clientRpcId:o,relayRpcId:s,topic:r,method:d,params:p,expiry:i,throwOnFailedPublish:!0,tvf:this.getTVFParams(o,p)}).catch(e=>u(e)),this.client.events.emit(`session_request_sent`,{topic:r,request:n,chainId:t,id:o}),e()}),new Promise(async e=>{a.sessionConfig?.disableDeepLink||await Ft({id:o,topic:r,wcDeepLink:await lt(this.client.core.storage,b_)}),e()}),c()]).then(e=>e[2])},this.respond=async e=>{this.isInitialized();let t=this.client.core.eventClient.createEvent({properties:{topic:e?.topic||e?.response?.id?.toString(),trace:[Yg.session_request_response_started]}});try{await this.isValidRespond(e)}catch(e){throw t.addTrace(e?.message),t.setError(Xg.session_request_response_validation_failure),e}t.addTrace(Yg.session_request_response_validation_success);let{topic:n,response:r}=e,{id:i}=r,a=this.client.session.get(n);a.transportType===Og.relay&&await this.confirmOnlineStateOrThrow();let o=this.getAppLinkIfEnabled(a.peer.metadata,a.transportType);try{t.addTrace(Yg.session_request_response_publish_started),de(r)?await this.sendResult({id:i,topic:n,result:r.result,throwOnFailedPublish:!0,appLink:o}):z(r)&&await this.sendError({id:i,topic:n,error:r.error,appLink:o}),this.cleanupAfterResponse(e)}catch(e){throw t.addTrace(e?.message),t.setError(Xg.session_request_response_publish_failure),e}},this.ping=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(e)}catch(e){throw this.client.logger.error(`ping() -> isValidPing() failed`),e}let{topic:t}=e;if(this.client.session.keys.includes(t)){let e=le(),n=re().toString(),{done:r,resolve:i,reject:a}=Ue($.FIVE_MINUTES,`Ping request expired without receiving any acknowledgement`);this.events.once(H(`session_ping`,e),({error:e})=>{e?a(e):i()}),await Promise.all([this.sendRequest({topic:t,method:`wc_sessionPing`,params:{},throwOnFailedPublish:!0,clientRpcId:e,relayRpcId:n}),r()])}else this.client.core.pairing.pairings.keys.includes(t)&&(this.client.logger.warn(`ping() on pairing topic is deprecated and will be removed in the next major release.`),await this.client.core.pairing.ping({topic:t}))},this.emit=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(e);let{topic:t,event:n,chainId:r}=e,i=re().toString(),a=le();await this.sendRequest({topic:t,method:`wc_sessionEvent`,params:{event:n,chainId:r},throwOnFailedPublish:!0,relayRpcId:i,clientRpcId:a})},this.disconnect=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(e);let{topic:t}=e;if(this.client.session.keys.includes(t))await this.sendRequest({topic:t,method:`wc_sessionDelete`,params:$t(`USER_DISCONNECTED`),throwOnFailedPublish:!0}),await this.deleteSession({topic:t,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(t))await this.client.core.pairing.disconnect({topic:t});else{let{message:e}=V(`MISMATCHED_TOPIC`,`Session or pairing topic not found: ${t}`);throw Error(e)}},this.find=e=>(this.isInitialized(),this.client.session.getAll().filter(t=>sn(t,e))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async(e,t)=>{this.isInitialized(),this.isValidAuthenticate(e);let n=t&&this.client.core.linkModeSupportedApps.includes(t)&&this.client.metadata.redirect?.linkMode,r=n?Og.link_mode:Og.relay;r===Og.relay&&await this.confirmOnlineStateOrThrow();let{chains:i,statement:a=``,uri:o,domain:s,nonce:c,type:l,exp:u,nbf:d,methods:f=[],expiry:p}=e,m=[...e.resources||[]],{topic:h,uri:g}=await this.client.core.pairing.create({methods:[`wc_sessionAuthenticate`],transportType:r});if(this.client.logger.info({message:`Generated new pairing`,pairing:{topic:h,uri:g}}),this.client.auth.authKeys.keys.includes(L_)){let{responseTopic:e,publicKey:t}=this.client.auth.authKeys.get(L_);e&&(await this.client.core.relayer.unsubscribe(e).catch(e=>this.client.logger.warn(e)),await this.client.auth.pairingTopics.delete(e,{message:`replaced`,code:0}).catch(e=>this.client.logger.warn(e))),t&&this.client.core.crypto.keychain.has(t)&&await this.client.core.crypto.deleteKeyPair(t)}let _=await this.client.core.crypto.generateKeyPair(),v=ke(_);if(await Promise.all([this.client.auth.authKeys.set(L_,{responseTopic:v,publicKey:_}),this.client.auth.pairingTopics.set(v,{topic:v,pairingTopic:h})]),await this.client.core.relayer.subscribe(v,{transportType:r}),this.client.logger.info(`sending request to new pairing topic: ${h}`),f.length>0){let{namespace:e}=Qt(i[0]),t=on(e,`request`,f);Xt(m)&&(t=ht(t,m.pop())),m.push(t)}let y=p&&p>E_.wc_sessionAuthenticate.req.ttl?p:E_.wc_sessionAuthenticate.req.ttl,b={authPayload:{type:l??`caip122`,chains:i,statement:a,aud:o,domain:s,version:`1`,nonce:c,iat:new Date().toISOString(),exp:u,nbf:d,resources:m},requester:{publicKey:_,metadata:this.client.metadata},expiryTimestamp:Se(y)},x={requiredNamespaces:{},optionalNamespaces:{eip155:{chains:i,methods:[...new Set([`personal_sign`,...f])],events:[`chainChanged`,`accountsChanged`]}},relays:[{protocol:`irn`}],pairingTopic:h,proposer:{publicKey:_,metadata:this.client.metadata},expiryTimestamp:Se(E_.wc_sessionPropose.req.ttl),id:le()},{done:S,resolve:C,reject:w}=Ue(y,`Request expired`),T=le(),E=H(`session_connect`,x.id),D=H(`session_request`,T),O=async({error:e,session:t})=>{this.events.off(D,k),e?w(e):t&&C({session:t})},k=async e=>{if(await this.deletePendingAuthRequest(T,{message:`fulfilled`,code:0}),e.error){let t=$t(`WC_METHOD_UNSUPPORTED`,`wc_sessionAuthenticate`);return e.error.code===t.code?void 0:(this.events.off(E,O),w(e.error.message))}await this.deleteProposal(x.id),this.events.off(E,O);let{cacaos:n,responder:i}=e.result,a=[],o=[];for(let e of n){await nt({cacao:e,projectId:this.client.core.projectId})||(this.client.logger.error(e,`Signature verification failed`),w($t(`SESSION_SETTLEMENT_FAILED`,`Signature verification failed`)));let{p:t}=e,n=Xt(t.resources),r=[Ot(t.iss)],i=kt(t.iss);if(n){let e=dt(n),t=mt(n);a.push(...e),r.push(...t)}for(let e of r)o.push(`${e}:${i}`)}let s=await this.client.core.crypto.generateSharedKey(_,i.publicKey),c;a.length>0&&(c={topic:s,acknowledged:!0,self:{publicKey:_,metadata:this.client.metadata},peer:i,controller:i.publicKey,expiry:Se(w_),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:`irn`},pairingTopic:h,namespaces:dn([...new Set(a)],[...new Set(o)]),transportType:r},await this.client.core.relayer.subscribe(s,{transportType:r}),await this.client.session.set(s,c),h&&await this.client.core.pairing.updateMetadata({topic:h,metadata:i.metadata}),c=this.client.session.get(s)),this.client.metadata.redirect?.linkMode&&i.metadata.redirect?.linkMode&&i.metadata.redirect?.universal&&t&&(this.client.core.addLinkModeSupportedApp(i.metadata.redirect.universal),this.client.session.update(s,{transportType:Og.link_mode})),C({auths:n,session:c})};this.events.once(E,O),this.events.once(D,k);let A;try{if(n){let e=pe(`wc_sessionAuthenticate`,b,T);this.client.core.history.set(h,e),A=Gt(t,h,await this.client.core.crypto.encode(``,e,{type:2,encoding:Et}))}else await Promise.all([this.sendRequest({topic:h,method:`wc_sessionAuthenticate`,params:b,expiry:e.expiry,throwOnFailedPublish:!0,clientRpcId:T}),this.sendRequest({topic:h,method:`wc_sessionPropose`,params:x,expiry:E_.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:x.id})])}catch(e){throw this.events.off(E,O),this.events.off(D,k),e}return await this.setProposal(x.id,x),await this.setAuthRequest(T,{request:{...b,verifyContext:{}},pairingTopic:h,transportType:r}),{uri:A??g,response:S}},this.approveSessionAuthenticate=async e=>{let{id:t,auths:n}=e,r=this.client.core.eventClient.createEvent({properties:{topic:t.toString(),trace:[Zg.authenticated_session_approve_started]}});try{this.isInitialized()}catch(e){throw r.setError(Qg.no_internet_connection),e}let i=this.getPendingAuthRequest(t);if(!i)throw r.setError(Qg.authenticated_session_pending_request_not_found),Error(`Could not find pending auth request with id ${t}`);let a=i.transportType||Og.relay;a===Og.relay&&await this.confirmOnlineStateOrThrow();let o=i.requester.publicKey,s=await this.client.core.crypto.generateKeyPair(),c=ke(o),l={type:1,receiverPublicKey:o,senderPublicKey:s},u=[],d=[];for(let e of n){if(!await nt({cacao:e,projectId:this.client.core.projectId})){r.setError(Qg.invalid_cacao);let e=$t(`SESSION_SETTLEMENT_FAILED`,`Signature verification failed`);throw await this.sendError({id:t,topic:c,error:e,encodeOpts:l}),Error(e.message)}r.addTrace(Zg.cacaos_verified);let{p:n}=e,i=Xt(n.resources),a=[Ot(n.iss)],o=kt(n.iss);if(i){let e=dt(i),t=mt(i);u.push(...e),a.push(...t)}for(let e of a)d.push(`${e}:${o}`)}let f=await this.client.core.crypto.generateSharedKey(s,o);r.addTrace(Zg.create_authenticated_session_topic);let p;if(u?.length>0){p={topic:f,acknowledged:!0,self:{publicKey:s,metadata:this.client.metadata},peer:{publicKey:o,metadata:i.requester.metadata},controller:o,expiry:Se(w_),authentication:n,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:`irn`},pairingTopic:i.pairingTopic,namespaces:dn([...new Set(u)],[...new Set(d)]),transportType:a},r.addTrace(Zg.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(f,{transportType:a})}catch(e){throw r.setError(Qg.subscribe_authenticated_session_topic_failure),e}r.addTrace(Zg.subscribe_authenticated_session_topic_success),await this.client.session.set(f,p),r.addTrace(Zg.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:i.pairingTopic,metadata:i.requester.metadata})}r.addTrace(Zg.publishing_authenticated_session_approve);try{await this.sendResult({topic:c,id:t,result:{cacaos:n,responder:{publicKey:s,metadata:this.client.metadata}},encodeOpts:l,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(i.requester.metadata,a)})}catch(e){throw r.setError(Qg.authenticated_session_approve_publish_failure),e}return await this.client.auth.requests.delete(t,{message:`fulfilled`,code:0}),await this.client.core.pairing.activate({topic:i.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:r.eventId}),{session:p}},this.rejectSessionAuthenticate=async e=>{this.isInitialized();let{id:t,reason:n}=e,r=this.getPendingAuthRequest(t);if(!r)throw Error(`Could not find pending auth request with id ${t}`);r.transportType===Og.relay&&await this.confirmOnlineStateOrThrow();let i=r.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),o=ke(i),s={type:1,receiverPublicKey:i,senderPublicKey:a};await this.sendError({id:t,topic:o,error:n,encodeOpts:s,rpcOpts:E_.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(r.requester.metadata,r.transportType)}),await this.client.auth.requests.delete(t,{message:`rejected`,code:0}),await this.deleteProposal(t)},this.formatAuthMessage=e=>{this.isInitialized();let{request:t,iss:n}=e;return He(t,n)},this.processRelayMessageCache=()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{let e=this.relayMessageCache.shift();e&&await this.onRelayMessage(e)}catch(e){this.client.logger.error(e)}},50)},this.cleanupDuplicatePairings=async e=>{if(e.pairingTopic)try{let t=this.client.core.pairing.pairings.get(e.pairingTopic),n=this.client.core.pairing.pairings.getAll().filter(n=>n.peerMetadata?.url&&n.peerMetadata?.url===e.peer.metadata.url&&n.topic&&n.topic!==t.topic);if(n.length===0)return;this.client.logger.info(`Cleaning up ${n.length} duplicate pairing(s)`),await Promise.all(n.map(e=>this.client.core.pairing.disconnect({topic:e.topic}))),this.client.logger.info(`Duplicate pairings clean up finished`)}catch(e){this.client.logger.error(e)}},this.deleteSession=async e=>{let{topic:t,expirerHasDeleted:n=!1,emitEvent:r=!0,id:i=0}=e,{self:a}=this.client.session.get(t);await this.client.core.relayer.unsubscribe(t),await this.client.session.delete(t,$t(`USER_DISCONNECTED`)),this.addToRecentlyDeleted(t,`session`),this.client.core.crypto.keychain.has(a.publicKey)&&await this.client.core.crypto.deleteKeyPair(a.publicKey),this.client.core.crypto.keychain.has(t)&&await this.client.core.crypto.deleteSymKey(t),n||this.client.core.expirer.del(t),this.client.core.storage.removeItem(b_).catch(e=>this.client.logger.warn(e)),t===this.sessionRequestQueue.queue[0]?.topic&&(this.sessionRequestQueue.state=O_.idle),await Promise.all(this.getPendingSessionRequests().filter(e=>e.topic===t).map(e=>this.deletePendingSessionRequest(e.id,$t(`USER_DISCONNECTED`)))),r&&this.client.events.emit(`session_delete`,{id:i,topic:t})},this.deleteProposal=async(e,t)=>{if(t)try{let t=this.client.proposal.get(e);this.client.core.eventClient.getEvent({topic:t.pairingTopic})?.setError(Xg.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(e,$t(`USER_DISCONNECTED`)),t?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,`proposal`)},this.deletePendingSessionRequest=async(e,t,n=!1)=>{await Promise.all([this.client.pendingRequest.delete(e,t),n?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,`request`),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(t=>t.id!==e),n&&(this.sessionRequestQueue.state=O_.idle,this.client.events.emit(`session_request_expire`,{id:e}))},this.deletePendingAuthRequest=async(e,t,n=!1)=>{await Promise.all([this.client.auth.requests.delete(e,t),n?Promise.resolve():this.client.core.expirer.del(e)])},this.setExpiry=async(e,t)=>{this.client.session.keys.includes(e)&&(this.client.core.expirer.set(e,t),await this.client.session.update(e,{expiry:t}))},this.setProposal=async(e,t)=>{this.client.core.expirer.set(e,Se(E_.wc_sessionPropose.req.ttl)),await this.client.proposal.set(e,t)},this.setAuthRequest=async(e,t)=>{let{request:n,pairingTopic:r,transportType:i=Og.relay}=t;this.client.core.expirer.set(e,n.expiryTimestamp),await this.client.auth.requests.set(e,{authPayload:n.authPayload,requester:n.requester,expiryTimestamp:n.expiryTimestamp,id:e,pairingTopic:r,verifyContext:n.verifyContext,transportType:i})},this.setPendingSessionRequest=async e=>{let{id:t,topic:n,params:r,verifyContext:i}=e,a=r.request.expiryTimestamp||Se(E_.wc_sessionRequest.req.ttl);this.client.core.expirer.set(t,a),await this.client.pendingRequest.set(t,{id:t,topic:n,params:r,verifyContext:i})},this.sendRequest=async e=>{let{topic:t,method:n,params:r,expiry:i,relayRpcId:a,clientRpcId:o,throwOnFailedPublish:s,appLink:c,tvf:l,publishOpts:u={}}=e,d=pe(n,r,o),f,p=!!c;try{let e=p?Et:st;f=await this.client.core.crypto.encode(t,d,{encoding:e})}catch(e){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${t} failed`),e}let m;if(j_.includes(n)){let e=ze(JSON.stringify(d)),t=ze(f);m=await this.client.core.verify.register({id:t,decryptedId:e})}let g={...E_[n].req,...u};if(g.attestation=m,i&&(g.ttl=i),a&&(g.id=a),this.client.core.history.set(t,d),p){let e=Gt(c,t,f);await h.Linking.openURL(e,this.client.name)}else g.tvf={...l,correlationId:d.id},s?(g.internal={...g.internal,throwOnFailedPublish:!0},await this.client.core.relayer.publish(t,f,g)):this.client.core.relayer.publish(t,f,g).catch(e=>this.client.logger.error(e));return d.id},this.sendProposeSession=async e=>{let{proposal:t,publishOpts:n}=e,r=pe(`wc_sessionPropose`,t,t.id);this.client.core.history.set(t.pairingTopic,r);let i=await this.client.core.crypto.encode(t.pairingTopic,r,{encoding:st}),a=ze(JSON.stringify(r)),o=ze(i),s=await this.client.core.verify.register({id:o,decryptedId:a});await this.client.core.relayer.publishCustom({payload:{pairingTopic:t.pairingTopic,sessionProposal:i},opts:{...n,publishMethod:`wc_proposeSession`,attestation:s}})},this.sendApproveSession=async e=>{let{sessionTopic:t,pairingProposalResponse:n,proposal:r,sessionSettleRequest:i,publishOpts:a}=e,o=ne(r.id,n),s=await this.client.core.crypto.encode(r.pairingTopic,o,{encoding:st}),c=pe(`wc_sessionSettle`,i,a?.id),l=await this.client.core.crypto.encode(t,c,{encoding:st});this.client.core.history.set(t,c),await this.client.core.relayer.publishCustom({payload:{sessionTopic:t,pairingTopic:r.pairingTopic,sessionProposalResponse:s,sessionSettlementRequest:l},opts:{...a,publishMethod:`wc_approveSession`}})},this.sendResult=async e=>{let{id:t,topic:n,result:r,throwOnFailedPublish:i,encodeOpts:a,appLink:o}=e,s=ne(t,r),c,l=o&&typeof h?.Linking<`u`;try{let e=l?Et:st;c=await this.client.core.crypto.encode(n,s,{...a||{},encoding:e})}catch(e){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${n} failed`),e}let u,d;try{u=await this.client.core.history.get(n,t);let e=u.request;try{d=this.getTVFParams(t,e.params,r)}catch(e){this.client.logger.warn(`sendResult() -> getTVFParams() failed: ${e?.message}`)}}catch(e){throw this.client.logger.error(`sendResult() -> history.get(${n}, ${t}) failed`),e}if(l){let e=Gt(o,n,c);await h.Linking.openURL(e,this.client.name)}else{let e=E_[u.request.method].res;e.tvf={...d,correlationId:t},i?(e.internal={...e.internal,throwOnFailedPublish:!0},await this.client.core.relayer.publish(n,c,e)):this.client.core.relayer.publish(n,c,e).catch(e=>this.client.logger.error(e))}await this.client.core.history.resolve(s)},this.sendError=async e=>{let{id:t,topic:n,error:r,encodeOpts:i,rpcOpts:a,appLink:o}=e,s=oe(t,r),c,l=o&&typeof h?.Linking<`u`;try{let e=l?Et:st;c=await this.client.core.crypto.encode(n,s,{...i||{},encoding:e})}catch(e){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${n} failed`),e}let u;try{u=await this.client.core.history.get(n,t)}catch(e){throw this.client.logger.error(`sendError() -> history.get(${n}, ${t}) failed`),e}if(l){let e=Gt(o,n,c);await h.Linking.openURL(e,this.client.name)}else{let e=u.request.method,t=a||E_[e].res;this.client.core.relayer.publish(n,c,t)}await this.client.core.history.resolve(s)},this.cleanup=async()=>{let e=[],t=[];this.client.session.getAll().forEach(t=>{let n=!1;Lt(t.expiry)&&(n=!0),this.client.core.crypto.keychain.has(t.topic)||(n=!0),n&&e.push(t.topic)}),this.client.proposal.getAll().forEach(e=>{Lt(e.expiryTimestamp)&&t.push(e.id)}),await Promise.all([...e.map(e=>this.deleteSession({topic:e})),...t.map(e=>this.deleteProposal(e))])},this.onProviderMessageEvent=async e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):await this.onRelayMessage(e)},this.onRelayEventRequest=async e=>{this.requestQueue.queue.push(e),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===O_.active){this.client.logger.info(`Request queue already active, skipping...`);return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=O_.active;let e=this.requestQueue.queue.shift();if(e)try{await this.processRequest(e)}catch(e){this.client.logger.warn(e)}}this.requestQueue.state=O_.idle},this.processRequest=async e=>{let{topic:t,payload:n,attestation:r,transportType:i,encryptedId:a}=e,o=n.method;if(!this.shouldIgnorePairingRequest({topic:t,requestMethod:o}))switch(o){case`wc_sessionPropose`:return await this.onSessionProposeRequest({topic:t,payload:n,attestation:r,encryptedId:a});case`wc_sessionSettle`:return await this.onSessionSettleRequest(t,n);case`wc_sessionUpdate`:return await this.onSessionUpdateRequest(t,n);case`wc_sessionExtend`:return await this.onSessionExtendRequest(t,n);case`wc_sessionPing`:return await this.onSessionPingRequest(t,n);case`wc_sessionDelete`:return await this.onSessionDeleteRequest(t,n);case`wc_sessionRequest`:return await this.onSessionRequest({topic:t,payload:n,attestation:r,encryptedId:a,transportType:i});case`wc_sessionEvent`:return await this.onSessionEventRequest(t,n);case`wc_sessionAuthenticate`:return await this.onSessionAuthenticateRequest({topic:t,payload:n,attestation:r,encryptedId:a,transportType:i});default:return this.client.logger.info(`Unsupported request method ${o}`)}},this.onRelayEventResponse=async e=>{let{topic:t,payload:n,transportType:r}=e,i=(await this.client.core.history.get(t,n.id)).request.method;switch(i){case`wc_sessionPropose`:return this.onSessionProposeResponse(t,n,r);case`wc_sessionSettle`:return this.onSessionSettleResponse(t,n);case`wc_sessionUpdate`:return this.onSessionUpdateResponse(t,n);case`wc_sessionExtend`:return this.onSessionExtendResponse(t,n);case`wc_sessionPing`:return this.onSessionPingResponse(t,n);case`wc_sessionRequest`:return this.onSessionRequestResponse(t,n);case`wc_sessionAuthenticate`:return this.onSessionAuthenticateResponse(t,n);default:return this.client.logger.info(`Unsupported response method ${i}`)}},this.onRelayEventUnknownPayload=e=>{let{topic:t}=e,{message:n}=V(`MISSING_OR_INVALID`,`Decoded payload on topic ${t} is not identifiable as a JSON-RPC request or a response.`);throw Error(n)},this.shouldIgnorePairingRequest=e=>{let{topic:t,requestMethod:n}=e,r=this.expectedPairingMethodMap.get(t);return!r||r.includes(n)?!1:!!(r.includes(`wc_sessionAuthenticate`)&&this.client.events.listenerCount(`session_authenticate`)>0)},this.onSessionProposeRequest=async e=>{let{topic:t,payload:n,attestation:r,encryptedId:i}=e,{params:a,id:o}=n;try{let e=this.client.core.eventClient.getEvent({topic:t});this.client.events.listenerCount(`session_proposal`)===0&&e?.setError(Jg.proposal_listener_not_found),this.isValidConnect({...n.params});let s={id:o,pairingTopic:t,expiryTimestamp:a.expiryTimestamp||Se(E_.wc_sessionPropose.req.ttl),attestation:r,encryptedId:i,...a};await this.setProposal(o,s);let c=await this.getVerifyContext({attestationId:r,hash:ze(JSON.stringify(n)),encryptedId:i,metadata:s.proposer.metadata});e?.addTrace(qg.emit_session_proposal),this.client.events.emit(`session_proposal`,{id:o,params:s,verifyContext:c})}catch(e){await this.sendError({id:o,topic:t,error:e,rpcOpts:E_.wc_sessionPropose.autoReject}),this.client.logger.error(e)}},this.onSessionProposeResponse=async(e,t,n)=>{let{id:r}=t;if(de(t)){let{result:i}=t;this.client.logger.trace({type:`method`,method:`onSessionProposeResponse`,result:i});let a=this.client.proposal.get(r);this.client.logger.trace({type:`method`,method:`onSessionProposeResponse`,proposal:a});let o=a.proposer.publicKey;this.client.logger.trace({type:`method`,method:`onSessionProposeResponse`,selfPublicKey:o});let s=i.responderPublicKey;this.client.logger.trace({type:`method`,method:`onSessionProposeResponse`,peerPublicKey:s});let c=await this.client.core.crypto.generateSharedKey(o,s);this.pendingSessions.set(r,{sessionTopic:c,pairingTopic:e,proposalId:r,publicKey:o});let l=await this.client.core.relayer.subscribe(c,{transportType:n});this.client.logger.trace({type:`method`,method:`onSessionProposeResponse`,subscriptionId:l}),await this.client.core.pairing.activate({topic:e})}else if(z(t)){await this.deleteProposal(r);let e=H(`session_connect`,r);if(this.events.listenerCount(e)===0)throw Error(`emitting ${e} without any listeners, 954`);this.events.emit(e,{error:t.error})}},this.onSessionSettleRequest=async(e,t)=>{let{id:n,params:r}=t;try{this.isValidSessionSettleRequest(r);let{relay:n,controller:i,expiry:a,namespaces:o,sessionProperties:s,scopedProperties:c,sessionConfig:l,proposalRequestsResponses:u}=t.params,d=[...this.pendingSessions.values()].find(t=>t.sessionTopic===e);if(!d)return this.client.logger.error(`Pending session not found for topic ${e}`);let f=this.client.proposal.get(d.proposalId),p={topic:e,relay:n,expiry:a,namespaces:o,acknowledged:!0,pairingTopic:d.pairingTopic,requiredNamespaces:f.requiredNamespaces,optionalNamespaces:f.optionalNamespaces,controller:i.publicKey,self:{publicKey:d.publicKey,metadata:this.client.metadata},peer:{publicKey:i.publicKey,metadata:i.metadata},...s&&{sessionProperties:s},...c&&{scopedProperties:c},...l&&{sessionConfig:l},transportType:Og.relay,authentication:u?.authentication,walletPayResult:u?.walletPay};await this.client.session.set(p.topic,p),await this.setExpiry(p.topic,p.expiry),await this.client.core.pairing.updateMetadata({topic:d.pairingTopic,metadata:p.peer.metadata}),this.pendingSessions.delete(d.proposalId),this.deleteProposal(d.proposalId,!1),this.cleanupDuplicatePairings(p),await this.sendResult({id:t.id,topic:e,throwOnFailedPublish:!0,result:!0}),this.client.events.emit(`session_connect`,{session:p}),this.events.emit(H(`session_connect`,d.proposalId),{session:p})}catch(t){await this.sendError({id:n,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionSettleResponse=async(e,t)=>{let{id:n}=t;de(t)?(await this.client.session.update(e,{acknowledged:!0}),this.events.emit(H(`session_approve`,n),{})):z(t)&&(await this.deleteSession({topic:e,emitEvent:!1}),this.events.emit(H(`session_approve`,n),{error:t.error}))},this.onSessionUpdateRequest=async(e,t)=>{let{params:n,id:r}=t;try{let t=`${e}_session_update`,i=Pt.get(t);if(i&&this.isRequestOutOfSync(i,r)){this.client.logger.warn(`Discarding out of sync request - ${r}`),this.sendError({id:r,topic:e,error:$t(`INVALID_UPDATE_REQUEST`)});return}this.isValidUpdate({topic:e,...n});try{Pt.set(t,r),await this.client.session.update(e,{namespaces:n.namespaces}),await this.sendResult({id:r,topic:e,result:!0})}catch(e){throw Pt.delete(t),e}this.client.events.emit(`session_update`,{id:r,topic:e,params:n})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}},this.isRequestOutOfSync=(e,t)=>t.toString().slice(0,-3)<e.toString().slice(0,-3),this.onSessionUpdateResponse=(e,t)=>{let{id:n}=t,r=H(`session_update`,n);if(this.events.listenerCount(r)===0)throw Error(`emitting ${r} without any listeners`);de(t)?this.events.emit(H(`session_update`,n),{}):z(t)&&this.events.emit(H(`session_update`,n),{error:t.error})},this.onSessionExtendRequest=async(e,t)=>{let{id:n}=t;try{this.isValidExtend({topic:e}),await this.setExpiry(e,Se(w_)),await this.sendResult({id:n,topic:e,result:!0}),this.client.events.emit(`session_extend`,{id:n,topic:e})}catch(t){await this.sendError({id:n,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionExtendResponse=(e,t)=>{let{id:n}=t,r=H(`session_extend`,n);if(this.events.listenerCount(r)===0)throw Error(`emitting ${r} without any listeners`);de(t)?this.events.emit(H(`session_extend`,n),{}):z(t)&&this.events.emit(H(`session_extend`,n),{error:t.error})},this.onSessionPingRequest=async(e,t)=>{let{id:n}=t;try{this.isValidPing({topic:e}),await this.sendResult({id:n,topic:e,result:!0,throwOnFailedPublish:!0}),this.client.events.emit(`session_ping`,{id:n,topic:e})}catch(t){await this.sendError({id:n,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionPingResponse=(e,t)=>{let{id:n}=t,r=H(`session_ping`,n);setTimeout(()=>{if(this.events.listenerCount(r)===0)throw Error(`emitting ${r} without any listeners 2176`);de(t)?this.events.emit(H(`session_ping`,n),{}):z(t)&&this.events.emit(H(`session_ping`,n),{error:t.error})},500)},this.onSessionDeleteRequest=async(e,t)=>{let{id:n}=t;try{await this.isValidDisconnect({topic:e,reason:t.params}),this.cleanupPendingSentRequestsForTopic({topic:e,error:$t(`USER_DISCONNECTED`)}),await this.deleteSession({topic:e,id:n})}catch(e){this.client.logger.error(e)}},this.onSessionRequest=async e=>{let{topic:t,payload:n,attestation:r,encryptedId:i,transportType:a}=e,{id:o,params:s}=n;try{await this.isValidRequest({topic:t,...s});let e=this.client.session.get(t),n={id:o,topic:t,params:s,verifyContext:await this.getVerifyContext({attestationId:r,hash:ze(JSON.stringify(pe(`wc_sessionRequest`,s,o))),encryptedId:i,metadata:e.peer.metadata,transportType:a})};await this.setPendingSessionRequest(n),a===Og.link_mode&&e.peer.metadata.redirect?.universal&&this.client.core.addLinkModeSupportedApp(e.peer.metadata.redirect?.universal),this.client.signConfig?.disableRequestQueue?this.emitSessionRequest(n):(this.addSessionRequestToSessionRequestQueue(n),this.processSessionRequestQueue())}catch(e){await this.sendError({id:o,topic:t,error:e}),this.client.logger.error(e)}},this.onSessionRequestResponse=(e,t)=>{let{id:n}=t,r=H(`session_request`,n);if(this.events.listenerCount(r)===0)throw Error(`emitting ${r} without any listeners`);de(t)?this.events.emit(H(`session_request`,n),{result:t.result}):z(t)&&this.events.emit(H(`session_request`,n),{error:t.error})},this.onSessionEventRequest=async(e,t)=>{let{id:n,params:r}=t;try{let t=`${e}_session_event_${r.event.name}`,i=Pt.get(t);if(i&&this.isRequestOutOfSync(i,n)){this.client.logger.info(`Discarding out of sync request - ${n}`);return}this.isValidEmit({topic:e,...r}),this.client.events.emit(`session_event`,{id:n,topic:e,params:r}),Pt.set(t,n)}catch(t){await this.sendError({id:n,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionAuthenticateResponse=(e,t)=>{let{id:n}=t;this.client.logger.trace({type:`method`,method:`onSessionAuthenticateResponse`,topic:e,payload:t}),de(t)?this.events.emit(H(`session_request`,n),{result:t.result}):z(t)&&this.events.emit(H(`session_request`,n),{error:t.error})},this.onSessionAuthenticateRequest=async e=>{let{topic:t,payload:n,attestation:r,encryptedId:i,transportType:a}=e;try{let{requester:e,authPayload:o,expiryTimestamp:s}=n.params,c=await this.getVerifyContext({attestationId:r,hash:ze(JSON.stringify(n)),encryptedId:i,metadata:e.metadata,transportType:a}),l={requester:e,pairingTopic:t,id:n.id,authPayload:o,verifyContext:c,expiryTimestamp:s};await this.setAuthRequest(n.id,{request:l,pairingTopic:t,transportType:a}),a===Og.link_mode&&e.metadata.redirect?.universal&&this.client.core.addLinkModeSupportedApp(e.metadata.redirect.universal),this.client.events.emit(`session_authenticate`,{topic:t,params:n.params,id:n.id,verifyContext:c})}catch(e){this.client.logger.error(e);let r=n.params.requester.publicKey,i=await this.client.core.crypto.generateKeyPair(),o=this.getAppLinkIfEnabled(n.params.requester.metadata,a),s={type:1,receiverPublicKey:r,senderPublicKey:i};await this.sendError({id:n.id,topic:t,error:e,encodeOpts:s,rpcOpts:E_.wc_sessionAuthenticate.autoReject,appLink:o})}},this.addSessionRequestToSessionRequestQueue=e=>{this.sessionRequestQueue.queue.push(e)},this.cleanupAfterResponse=e=>{this.deletePendingSessionRequest(e.response.id,{message:`fulfilled`,code:0}),setTimeout(()=>{this.sessionRequestQueue.state=O_.idle,this.processSessionRequestQueue()},(0,$.toMiliseconds)(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:e,error:t})=>{let n=this.client.core.history.pending;n.length>0&&n.filter(t=>t.topic===e&&t.request.method===`wc_sessionRequest`).forEach(e=>{this.events.emit(H(`session_request`,e.request.id),{error:t})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===O_.active){this.client.logger.info(`session request queue is already active.`);return}let e=this.sessionRequestQueue.queue[0];if(!e){this.client.logger.info(`session request queue is empty.`);return}try{this.emitSessionRequest(e)}catch(e){this.client.logger.error(e)}},this.emitSessionRequest=e=>{if(this.emittedSessionRequests.has(e.id)){this.client.logger.warn({id:e.id},`Skipping emitting \`session_request\` event for duplicate request. id: ${e.id}`);return}this.sessionRequestQueue.state=O_.active,this.emittedSessionRequests.add(e.id),this.client.events.emit(`session_request`,e)},this.cleanupInProgress=!1,this.cleanupOrphanedSubscriptions=async()=>{let e=this.client.core.relayer.subscriber.topics;if(e.length===0)return;let t=new Set(this.client.session.keys),n=new Set(this.client.core.pairing.pairings.keys),r=new Set([...this.pendingSessions.values()].map(e=>e.sessionTopic)),i;if(this.client.auth.authKeys.keys.includes(L_)){let{responseTopic:e}=this.client.auth.authKeys.get(L_);i=e}for(let a of e)if(!t.has(a)&&!n.has(a)&&!r.has(a)&&a!==i){this.client.logger.info(`Cleaning up orphaned subscriber topic: ${a}`);try{await this.client.core.relayer.subscriber.unsubscribe(a)}catch(e){this.client.logger.warn(e,`Failed to clean up orphaned subscription: ${a}`)}}},this.onPairingCreated=e=>{if(e.methods&&this.expectedPairingMethodMap.set(e.topic,e.methods),e.active)return;let t=this.client.proposal.getAll().find(t=>t.pairingTopic===e.topic);t&&this.onSessionProposeRequest({topic:e.topic,payload:pe(`wc_sessionPropose`,{...t,requiredNamespaces:t.requiredNamespaces,optionalNamespaces:t.optionalNamespaces,relays:t.relays,proposer:t.proposer,sessionProperties:t.sessionProperties,scopedProperties:t.scopedProperties},t.id),attestation:t.attestation,encryptedId:t.encryptedId})},this.isValidConnect=async e=>{if(!_e(e)){let{message:t}=V(`MISSING_OR_INVALID`,`connect() params: ${JSON.stringify(e)}`);throw Error(t)}let{pairingTopic:t,requiredNamespaces:n,optionalNamespaces:r,sessionProperties:i,scopedProperties:a,relays:o}=e;if(at(t)||await this.isValidPairingTopic(t),!Ht(o,!0)){let{message:e}=V(`MISSING_OR_INVALID`,`connect() relays: ${o}`);throw Error(e)}if(n&&!at(n)&&Pe(n)!==0&&([`fatal`,`error`,`silent`].includes(this.client.logger.level)||this.client.logger.warn(`requiredNamespaces are deprecated and are automatically assigned to optionalNamespaces`),this.validateNamespaces(n,`requiredNamespaces`)),r&&!at(r)&&Pe(r)!==0&&this.validateNamespaces(r,`optionalNamespaces`),i&&!at(i)&&this.validateSessionProps(i,`sessionProperties`),a&&!at(a)){this.validateSessionProps(a,`scopedProperties`);let e=Object.keys(n||{}).concat(Object.keys(r||{}));if(!Object.keys(a).every(t=>e.includes(t.split(`:`)[0])))throw Error(`Scoped properties must be a subset of required/optional namespaces, received: ${JSON.stringify(a)}, required/optional namespaces: ${JSON.stringify(e)}`)}},this.validateNamespaces=(e,t)=>{let n=$e(e,`connect()`,t);if(n)throw Error(n.message)},this.isValidApprove=async e=>{if(!_e(e))throw Error(V(`MISSING_OR_INVALID`,`approve() params: ${e}`).message);let{id:t,namespaces:n,relayProtocol:r,sessionProperties:i,scopedProperties:a}=e;this.checkRecentlyDeleted(t),await this.isValidProposalId(t);let o=this.client.proposal.get(t),s=vt(n,`approve()`);if(s)throw Error(s.message);let c=tt(o.requiredNamespaces,n,`approve()`);if(c)throw Error(c.message);if(!zt(r,!0)){let{message:e}=V(`MISSING_OR_INVALID`,`approve() relayProtocol: ${r}`);throw Error(e)}if(i&&!at(i)&&this.validateSessionProps(i,`sessionProperties`),a&&!at(a)){this.validateSessionProps(a,`scopedProperties`);let e=new Set(Object.keys(n));if(!Object.keys(a).every(t=>e.has(t.split(`:`)[0])))throw Error(`Scoped properties must be a subset of approved namespaces, received: ${JSON.stringify(a)}, approved namespaces: ${Array.from(e).join(`, `)}`)}},this.isValidReject=async e=>{if(!_e(e)){let{message:t}=V(`MISSING_OR_INVALID`,`reject() params: ${e}`);throw Error(t)}let{id:t,reason:n}=e;if(this.checkRecentlyDeleted(t),await this.isValidProposalId(t),!_t(n)){let{message:e}=V(`MISSING_OR_INVALID`,`reject() reason: ${JSON.stringify(n)}`);throw Error(e)}},this.isValidSessionSettleRequest=e=>{if(!_e(e)){let{message:t}=V(`MISSING_OR_INVALID`,`onSessionSettleRequest() params: ${e}`);throw Error(t)}let{relay:t,controller:n,namespaces:r,expiry:i}=e;if(!Oe(t)){let{message:e}=V(`MISSING_OR_INVALID`,`onSessionSettleRequest() relay protocol should be a string`);throw Error(e)}let a=pt(n,`onSessionSettleRequest()`);if(a)throw Error(a.message);let o=vt(r,`onSessionSettleRequest()`);if(o)throw Error(o.message);if(Lt(i)){let{message:e}=V(`EXPIRED`,`onSessionSettleRequest()`);throw Error(e)}},this.isValidUpdate=async e=>{if(!_e(e)){let{message:t}=V(`MISSING_OR_INVALID`,`update() params: ${e}`);throw Error(t)}let{topic:t,namespaces:n}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);let r=this.client.session.get(t),i=vt(n,`update()`);if(i)throw Error(i.message);let a=tt(r.requiredNamespaces,n,`update()`);if(a)throw Error(a.message)},this.isValidExtend=async e=>{if(!_e(e)){let{message:t}=V(`MISSING_OR_INVALID`,`extend() params: ${e}`);throw Error(t)}let{topic:t}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t)},this.isValidRequest=async e=>{if(!_e(e)){let{message:t}=V(`MISSING_OR_INVALID`,`request() params: ${e}`);throw Error(t)}let{topic:t,request:n,chainId:r,expiry:i}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);let{namespaces:a}=this.client.session.get(t);if(!Be(a,r)){let{message:e}=V(`MISSING_OR_INVALID`,`request() chainId: ${r}`);throw Error(e)}if(!Kt(n)){let{message:e}=V(`MISSING_OR_INVALID`,`request() ${JSON.stringify(n)}`);throw Error(e)}if(!It(a,r,n.method)){let{message:e}=V(`MISSING_OR_INVALID`,`request() method: ${n.method}`);throw Error(e)}this.validateRequestExpiry(i)},this.isValidRespond=async e=>{if(!_e(e)){let{message:t}=V(`MISSING_OR_INVALID`,`respond() params: ${e}`);throw Error(t)}let{topic:t,response:n}=e;try{await this.isValidSessionTopic(t)}catch(t){throw e?.response?.id&&this.cleanupAfterResponse(e),t}if(!ot(n)){let{message:e}=V(`MISSING_OR_INVALID`,`respond() response: ${JSON.stringify(n)}`);throw Error(e)}let r=this.client.pendingRequest.get(n.id);if(r.topic!==t){let{message:e}=V(`MISMATCHED_TOPIC`,`Request response topic mismatch. reqId: ${n.id}, expected topic: ${r.topic}, received topic: ${t}`);throw Error(e)}},this.isValidPing=async e=>{if(!_e(e)){let{message:t}=V(`MISSING_OR_INVALID`,`ping() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.isValidEmit=async e=>{if(!_e(e)){let{message:t}=V(`MISSING_OR_INVALID`,`emit() params: ${e}`);throw Error(t)}let{topic:t,event:n,chainId:r}=e;await this.isValidSessionTopic(t);let{namespaces:i}=this.client.session.get(t);if(!Be(i,r)){let{message:e}=V(`MISSING_OR_INVALID`,`emit() chainId: ${r}`);throw Error(e)}if(!Te(n)){let{message:e}=V(`MISSING_OR_INVALID`,`emit() event: ${JSON.stringify(n)}`);throw Error(e)}if(!mn(i,r,n.name)){let{message:e}=V(`MISSING_OR_INVALID`,`emit() event: ${JSON.stringify(n)}`);throw Error(e)}},this.isValidDisconnect=async e=>{if(!_e(e)){let{message:t}=V(`MISSING_OR_INVALID`,`disconnect() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.isValidAuthenticate=e=>{let{chains:t,uri:n,domain:r,nonce:i}=e;if(!Array.isArray(t)||t.length===0)throw Error(`chains is required and must be a non-empty array`);if(!zt(n,!1))throw Error(`uri is required parameter`);if(!zt(r,!1))throw Error(`domain is required parameter`);if(!zt(i,!1))throw Error(`nonce is required parameter`);if([...new Set(t.map(e=>Qt(e).namespace))].length>1)throw Error(`Multi-namespace requests are not supported. Please request single namespace only.`);let{namespace:a}=Qt(t[0]);if(a!==`eip155`)throw Error(`Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.`)},this.getVerifyContext=async e=>{let{attestationId:t,hash:n,encryptedId:r,metadata:i,transportType:a}=e,o={verified:{verifyUrl:i.verifyUrl||`https://verify.walletconnect.org`,validation:`UNKNOWN`,origin:i.url||``}};try{if(a===Og.link_mode){let e=this.getAppLinkIfEnabled(i,a);return o.verified.validation=e&&new URL(e).origin===new URL(i.url).origin?`VALID`:`INVALID`,o}let e=await this.client.core.verify.resolve({attestationId:t,hash:n,encryptedId:r,verifyUrl:i.verifyUrl});e&&(o.verified.origin=e.origin,o.verified.isScam=e.isScam,o.verified.validation=e.origin===new URL(i.url).origin?`VALID`:`INVALID`)}catch(e){this.client.logger.warn(e)}return this.client.logger.debug(`Verify context: ${JSON.stringify(o)}`),o},this.validateSessionProps=(e,t)=>{Object.values(e).forEach((n,r)=>{if(n==null){let{message:i}=V(`MISSING_OR_INVALID`,`${t} must contain an existing value for each key. Received: ${n} for key ${Object.keys(e)[r]}`);throw Error(i)}})},this.getPendingAuthRequest=e=>{let t=this.client.auth.requests.get(e);return typeof t==`object`?t:void 0},this.addToRecentlyDeleted=(e,t)=>{if(this.recentlyDeletedMap.set(e,t),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let e=0,t=this.recentlyDeletedLimit/2;for(let n of this.recentlyDeletedMap.keys()){if(e++>=t)break;this.recentlyDeletedMap.delete(n)}}},this.checkRecentlyDeleted=e=>{let t=this.recentlyDeletedMap.get(e);if(t){let{message:n}=V(`MISSING_OR_INVALID`,`Record was recently deleted - ${t}: ${e}`);throw Error(n)}},this.isLinkModeEnabled=(e,t)=>!e||t!==Og.link_mode?!1:this.client.metadata?.redirect?.linkMode===!0&&this.client.metadata?.redirect?.universal!==void 0&&this.client.metadata?.redirect?.universal!==``&&e?.redirect?.universal!==void 0&&e?.redirect?.universal!==``&&e?.redirect?.linkMode===!0&&this.client.core.linkModeSupportedApps.includes(e.redirect.universal)&&typeof h?.Linking<`u`,this.getAppLinkIfEnabled=(e,t)=>this.isLinkModeEnabled(e,t)?e?.redirect?.universal:void 0,this.handleLinkModeMessage=({url:e})=>{if(!e||!e.includes(`wc_ev`)||!e.includes(`topic`))return;let t=ln(e,`topic`)||``,n=decodeURIComponent(ln(e,`wc_ev`)||``),r=this.client.session.keys.includes(t);r&&this.client.session.update(t,{transportType:Og.link_mode}),this.client.core.dispatchEnvelope({topic:t,message:n,sessionExists:r})},this.registerLinkModeListeners=async()=>{if(pn()||jt()&&this.client.metadata.redirect?.linkMode){let e=h?.Linking;if(typeof e<`u`){e.addEventListener(`url`,this.handleLinkModeMessage,this.client.name);let t=await e.getInitialURL();t&&setTimeout(()=>{this.handleLinkModeMessage({url:t})},50)}}},this.getTVFApproveParams=e=>{try{return{approvedChains:un(e.namespaces),approvedMethods:ut(e.namespaces),approvedEvents:qe(e.namespaces),sessionProperties:e.sessionProperties,scopedProperties:e.scopedProperties}}catch(e){return this.client.logger.warn(e,`Error getting TVF approve params`),{}}},this.getTVFParams=(e,t,n)=>{if(!t.request?.method)return{};let r={correlationId:e,rpcMethods:[t.request.method],chainId:t.chainId};try{r.txHashes=this.extractTxHashesFromResult(t.request,n),r.contractAddresses=this.isValidContractData(t.request.params)?[t.request.params?.[0]?.to]:[]}catch(e){this.client.logger.warn(e,`Error getting TVF params`)}return r},this.isValidContractData=e=>{if(!e)return!1;try{let t=e?.data||e?.[0]?.data;if(!t.startsWith(`0x`))return!1;let n=t.slice(2);return/^[0-9a-fA-F]*$/.test(n)?n.length%2==0:!1}catch{}return!1},this.extractTxHashesFromResult=(e,t)=>{try{if(!t)return[];let n=e.method,r=k_[n];if(n===`sui_signTransaction`)return[Qe(t.transactionBytes)];if(n===`near_signTransaction`)return[ye(t)];if(n===`near_signTransactions`)return t.map(e=>ye(e));if(n===`xrpl_signTransactionFor`||n===`xrpl_signTransaction`)return[t.tx_json?.hash];if(n===`polkadot_signTransaction`)return[Dt({transaction:e.params.transactionPayload,signature:t.signature})];if(n===`algo_signTxn`)return bt(t)?t.map(e=>xe(e)):[xe(t)];if(n===`cosmos_signDirect`)return[fn(t)];if(n===`wallet_sendCalls`)return rn(t);if(typeof t==`string`)return[t];let i=t[r.key];if(bt(i))return n===`solana_signAllTransactions`?i.map(e=>Ke(e)):i;if(typeof i==`string`)return[i]}catch(e){this.client.logger.warn(e,`Error extracting tx hashes from result`)}return[]}}async processPendingMessageEvents(){try{let e=this.client.session.keys,t=this.client.core.relayer.messages.getWithoutAck(e);for(let[e,n]of Object.entries(t))for(let t of n)try{await this.onProviderMessageEvent({topic:e,message:t,publishedAt:Date.now()})}catch{this.client.logger.warn(`Error processing pending message event for topic: ${e}, message: ${t}`)}}catch(e){this.client.logger.warn(e,`processPendingMessageEvents failed`)}}isInitialized(){if(!this.initialized){let{message:e}=V(`NOT_INITIALIZED`,this.name);throw Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(wg.message,e=>{this.onProviderMessageEvent(e)})}async onRelayMessage(e){let{topic:t,message:n,attestation:r,transportType:i}=e,{publicKey:a}=this.client.auth.authKeys.keys.includes(L_)?this.client.auth.authKeys.get(L_):{publicKey:void 0};try{let e=await this.client.core.crypto.decode(t,n,{receiverPublicKey:a,encoding:i===Og.link_mode?Et:st});te(e)?(this.client.core.history.set(t,e),await this.onRelayEventRequest({topic:t,payload:e,attestation:r,transportType:i,encryptedId:ze(n)})):ce(e)?(await this.client.core.history.resolve(e),await this.onRelayEventResponse({topic:t,payload:e,transportType:i}),this.client.core.history.delete(t,e.id)):(this.client.logger.error(`onRelayMessage() -> unknown payload: ${JSON.stringify(e)}`),await this.onRelayEventUnknownPayload({topic:t,payload:e,transportType:i})),await this.client.core.relayer.messages.ack(t,n)}catch(e){this.client.logger.error(`onRelayMessage() -> failed to process an inbound message: ${n}`),this.client.logger.error(e)}}registerExpirerEvents(){this.client.core.expirer.on(zg.expired,async e=>{let{topic:t,id:n}=We(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,V(`EXPIRED`),!0);if(n&&this.client.auth.requests.keys.includes(n))return await this.deletePendingAuthRequest(n,V(`EXPIRED`),!0);t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit(`session_expire`,{topic:t})):n&&(await this.deleteProposal(n,!0),this.client.events.emit(`proposal_expire`,{id:n}))})}registerSubscriptionCleanup(){this.client.core.heartbeat.on(`heartbeat_pulse`,async()=>{if(!this.cleanupInProgress){this.cleanupInProgress=!0;try{await this.cleanupOrphanedSubscriptions()}catch(e){this.client.logger.warn(e)}finally{this.cleanupInProgress=!1}}})}registerPairingEvents(){this.client.core.pairing.events.on(Fg.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(Fg.delete,e=>{this.addToRecentlyDeleted(e.topic,`pairing`)})}isValidPairingTopic(e){if(!zt(e,!1)){let{message:t}=V(`MISSING_OR_INVALID`,`pairing topic should be a string: ${e}`);throw Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){let{message:t}=V(`NO_MATCHING_KEY`,`pairing topic doesn't exist: ${e}`);throw Error(t)}if(Lt(this.client.core.pairing.pairings.get(e).expiry)){let{message:t}=V(`EXPIRED`,`pairing topic: ${e}`);throw Error(t)}}async isValidSessionTopic(e){if(!zt(e,!1)){let{message:t}=V(`MISSING_OR_INVALID`,`session topic should be a string: ${e}`);throw Error(t)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){let{message:t}=V(`NO_MATCHING_KEY`,`session topic doesn't exist: ${e}`);throw Error(t)}if(Lt(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});let{message:t}=V(`EXPIRED`,`session topic: ${e}`);throw Error(t)}if(!this.client.core.crypto.keychain.has(e)){let{message:t}=V(`MISSING_OR_INVALID`,`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),Error(t)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(zt(e,!1)){let{message:t}=V(`NO_MATCHING_KEY`,`session or pairing topic doesn't exist: ${e}`);throw Error(t)}else{let{message:t}=V(`MISSING_OR_INVALID`,`session or pairing topic should be a string: ${e}`);throw Error(t)}}async isValidProposalId(e){if(!be(e)){let{message:t}=V(`MISSING_OR_INVALID`,`proposal id should be a number: ${e}`);throw Error(t)}if(!this.client.proposal.keys.includes(e)){let{message:t}=V(`NO_MATCHING_KEY`,`proposal id doesn't exist: ${e}`);throw Error(t)}if(Lt(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);let{message:t}=V(`EXPIRED`,`proposal id: ${e}`);throw Error(t)}}validateRequestExpiry(e){if(e&&!xt(e,D_)){let{message:t}=V(`MISSING_OR_INVALID`,`request() expiry: ${e}. Expiry must be a number (in seconds) between ${D_.min} and ${D_.max}`);throw Error(t)}}},z_=class extends l_{constructor(e,t){super(e,t,x_,v_),this.core=e,this.logger=t}},B_=class extends l_{constructor(e,t){super(e,t,C_,v_),this.core=e,this.logger=t}},V_=class extends l_{constructor(e,t){super(e,t,A_,v_,e=>e.id),this.core=e,this.logger=t}},H_=class extends l_{constructor(e,t){super(e,t,N_,I_,()=>L_),this.core=e,this.logger=t}},U_=class extends l_{constructor(e,t){super(e,t,P_,I_),this.core=e,this.logger=t}},W_=class extends l_{constructor(e,t){super(e,t,F_,I_,e=>e.id),this.core=e,this.logger=t}},G_=class{constructor(e,t){this.core=e,this.logger=t,this.authKeys=new H_(this.core,this.logger),this.pairingTopics=new U_(this.core,this.logger),this.requests=new W_(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}},K_=class e extends kh{constructor(e){super(e),this.protocol=`wc`,this.version=2,this.name=y_.name,this.events=new Kr.EventEmitter,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.removeAllListeners=e=>this.events.removeAllListeners(e),this.connect=async e=>{try{return await this.engine.connect(e)}catch(e){throw this.logger.error(e.message),e}},this.pair=async e=>{try{return await this.engine.pair(e)}catch(e){throw this.logger.error(e.message),e}},this.approve=async e=>{try{return await this.engine.approve(e)}catch(e){throw this.logger.error(e.message),e}},this.reject=async e=>{try{return await this.engine.reject(e)}catch(e){throw this.logger.error(e.message),e}},this.update=async e=>{try{return await this.engine.update(e)}catch(e){throw this.logger.error(e.message),e}},this.extend=async e=>{try{return await this.engine.extend(e)}catch(e){throw this.logger.error(e.message),e}},this.request=async e=>{try{return await this.engine.request(e)}catch(e){throw this.logger.error(e.message),e}},this.respond=async e=>{try{return await this.engine.respond(e)}catch(e){throw this.logger.error(e.message),e}},this.ping=async e=>{try{return await this.engine.ping(e)}catch(e){throw this.logger.error(e.message),e}},this.emit=async e=>{try{return await this.engine.emit(e)}catch(e){throw this.logger.error(e.message),e}},this.disconnect=async e=>{try{return await this.engine.disconnect(e)}catch(e){throw this.logger.error(e.message),e}},this.find=e=>{try{return this.engine.find(e)}catch(e){throw this.logger.error(e.message),e}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(e){throw this.logger.error(e.message),e}},this.authenticate=async(e,t)=>{try{return await this.engine.authenticate(e,t)}catch(e){throw this.logger.error(e.message),e}},this.formatAuthMessage=e=>{try{return this.engine.formatAuthMessage(e)}catch(e){throw this.logger.error(e.message),e}},this.approveSessionAuthenticate=async e=>{try{return await this.engine.approveSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}},this.rejectSessionAuthenticate=async e=>{try{return await this.engine.rejectSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}},this.name=e?.name||y_.name,this.metadata=je(e?.metadata),this.signConfig=e?.signConfig;let t=Rt({logger:e?.logger||y_.logger,name:this.name});this.logger=t,this.core=e?.core||new g_(e),this.session=new B_(this.core,this.logger),this.proposal=new z_(this.core,this.logger),this.pendingRequest=new V_(this.core,this.logger),this.engine=new R_(this),this.auth=new G_(this.core,this.logger)}static async init(t){let n=new e(t);return await n.initialize(),n}get context(){return en(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace(`Initialized`);try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info(`SignClient Initialization Success`)}catch(e){throw this.logger.info(`SignClient Initialization Failure`),this.logger.error(e.message),e}}},q_=`WALLETCONNECT_DEEPLINK_CHOICE`,J_={isHttpUrl(e){return e.startsWith(`http://`)||e.startsWith(`https://`)},formatNativeUrl(e,t,n,r){if(J_.isHttpUrl(e))return this.formatUniversalUrl(e,t,r);let i=e.replaceAll(`/`,``).replaceAll(`:`,``);return J_.setWalletConnectDeepLink(i,r),`${i}://wc?uri=${encodeURIComponent(t)}`},formatUniversalUrl(e,t,n){if(!J_.isHttpUrl(e))return this.formatNativeUrl(e,t,n);let r=e;return e.endsWith(`/`)&&(r=e.slice(0,-1)),J_.setWalletConnectDeepLink(r,n),`${r}/wc?uri=${encodeURIComponent(t)}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t=`_self`){window.open(e,t,`noreferrer noopener`)},setWalletConnectDeepLink(e,t){localStorage.setItem(q_,JSON.stringify({href:e,name:t}))},removeWalletConnectDeepLink(){localStorage.removeItem(q_)}};_();var Y_=`https://explorer-api.walletconnect.com`,X_=class{walletInfo;signClient;wcCloudInfo;actions;qrUrl;appUrl;pairings=[];sessions=[];emitter;logger;options;relayUrl;env;requiredNamespaces;_defaultSignOptions={preferNoSetFee:!1,preferNoSetMemo:!0,disableBalanceCheck:!0};constructor(e){if(!e.walletconnect)throw Error(`'walletconnect' info for wallet ${e.prettyName} is not provided in wallet registry.`);this.walletInfo=e,this.qrUrl={state:U.Init},this.appUrl={state:U.Init},this.requiredNamespaces=e.walletconnect.requiredNamespaces}get defaultSignOptions(){return this._defaultSignOptions}setDefaultSignOptions(e){this._defaultSignOptions=e}get isMobile(){return this.env?.device===`mobile`}get wcName(){return this.walletInfo.walletconnect.name}get wcEncoding(){return this.walletInfo.walletconnect.encoding||`hex`}get wcProjectId(){return this.walletInfo.walletconnect.projectId}get wcMobile(){return this.walletInfo.walletconnect.mobile}get accounts(){let e=[];return this.sessions.forEach(t=>{Object.entries(t.namespaces).forEach(([,t])=>{t.accounts.forEach(t=>{let[n,r,i]=t.split(`:`);e.push({namespace:n,chainId:r,address:i})})})}),e}deleteSession(e){let t=[];this.sessions=this.sessions.filter(n=>n.topic===e?(n.namespaces.cosmos.accounts.forEach(e=>{let[,n]=e.split(`:`);t.push(n)}),!1):!0),this.emitter?.emit(`reset`,t),this.logger?.debug("[WALLET EVENT] Emit `reset`")}subscribeToEvents(){if(this.signClient===void 0)throw Error(`WalletConnect is not initialized`);this.signClient.on(`session_ping`,e=>{this.logger?.debug(`EVENT`,`session_ping`,e)}),this.signClient.on(`session_event`,async e=>{this.logger?.debug(`EVENT`,`session_event`,e)}),this.signClient.on(`session_update`,({topic:e,params:t})=>{this.logger?.debug(`EVENT`,`session_update`,{topic:e,params:t})}),this.signClient.on(`session_delete`,e=>{this.logger?.debug(`EVENT`,`session_delete`,e),this.deleteSession(e.topic)}),this.signClient.on(`session_expire`,e=>{this.logger?.debug(`EVENT`,`session_expire`,e),this.deleteSession(e.topic)}),this.signClient.on(`session_proposal`,e=>{this.logger?.debug(`EVENT`,`session_proposal`,e)}),this.signClient.on(`session_request`,e=>{this.logger?.debug(`EVENT`,`session_request`,e)}),this.signClient.on(`proposal_expire`,e=>{this.logger?.debug(`EVENT`,`proposal_expire`,e)})}async deleteInactivePairings(){if(this.signClient===void 0)throw Error(`WalletConnect is not initialized`);for(let e of this.signClient.pairing.getAll({active:!1}))await this.signClient.pairing.delete(e.topic,{code:7001,message:`Clear inactive pairings.`}),this.logger?.debug(`Delete inactive pairing:`,e.topic)}async deleteAllPairings(){if(this.signClient===void 0)throw Error(`WalletConnect is not initialized`);for(let e of this.signClient.pairing.getAll())await this.signClient.pairing.delete(e.topic,{code:7001,message:`Clear pairings.`}),this.logger?.debug(`Delete pairing:`,e.topic)}restorePairings(){if(this.signClient===void 0)throw Error(`WalletConnect is not initialized`);this.pairings=this.signClient.pairing.getAll({active:!0}).filter(e=>e.peerMetadata?.name===this.wcName&&e.expiry*1e3>Date.now()+1e3),this.logger?.debug(`RESTORED PAIRINGS: `,this.pairings)}get pairing(){return this.pairings[0]}restoreSessions(){if(this.signClient===void 0)throw Error(`WalletConnect is not initialized`);this.sessions=this.signClient.session.getAll().filter(e=>e.peer.metadata.name===this.wcName&&e.expiry*1e3>Date.now()+1e3),this.logger?.debug(`RESTORED SESSIONS: `,this.sessions)}async getSession(e,t){return this.signClient===void 0&&await this.init(),this.sessions.find(n=>n.namespaces[e]?.accounts?.find(n=>n.startsWith(`${e}:${t}`)))}get walletName(){return this.walletInfo.name}get dappProjectId(){return this.options?.signClient.projectId}setActions(e){this.actions=e}setQRState(e){this.qrUrl.state=e,this.actions?.qrUrl?.state(e)}setQRError(e){this.setQRState(U.Error),this.qrUrl.message=typeof e==`string`?e:e?.message,this.actions?.qrUrl?.message?.(this.qrUrl.message),typeof e!=`string`&&e?.stack&&this.logger?.error(e.stack)}async init(){await this.initSignClient(),this.isMobile&&await this.initAppUrl()}async initSignClient(){this.signClient&&this.relayUrl===this.options?.signClient.relayUrl||(this.signClient=await K_.init(this.options?.signClient),this.relayUrl=this.options?.signClient.relayUrl,this.logger?.debug(`CREATED CLIENT: `,this.signClient),this.logger?.debug(`relayerRegion `,this.options?.signClient.relayUrl),this.subscribeToEvents(),this.restorePairings(),this.restoreSessions())}async initWCCloudInfo(){let e=`${Y_}/v3/wallets?projectId=${this.dappProjectId}&sdks=sign_v2&search=${this.wcName}`,t=await(await fetch(e)).json();this.wcCloudInfo=t.listings[this.walletInfo.walletconnect.projectId],this.logger?.debug(`WalletConnect Info:`,this.wcCloudInfo)}async initAppUrl(){this.appUrl.state=U.Pending,this.wcCloudInfo||await this.initWCCloudInfo();let e=this.wcCloudInfo.mobile.native||this.wcMobile?.native,t=this.wcCloudInfo.mobile.universal||this.wcMobile?.universal;this.appUrl.data={native:e,universal:t},this.appUrl.state=U.Done}get nativeUrl(){let e=this.appUrl.data?.native;if(typeof e==`string`||e===void 0)return e;{let{android:t,ios:n,macos:r,windows:i}=e;switch(this.env?.os){case`android`:return t;case`ios`:return n;case`macos`:return r;case`windows`:return i;default:throw Error(`Unknown os: ${this.env?.os}.`)}}}get universalUrl(){return this.appUrl.data?.universal}get redirectHref(){return this.nativeUrl||this.universalUrl}get redirectHrefWithWCUri(){let e;return this.nativeUrl?e=(this.walletInfo.walletconnect.formatNativeUrl||J_.formatNativeUrl)(this.nativeUrl,this.qrUrl.data,this.env?.os,this.walletName):this.universalUrl&&(e=(this.walletInfo.walletconnect.formatUniversalUrl||J_.formatUniversalUrl)(this.universalUrl,this.qrUrl.data,this.walletName)),e}get displayQRCode(){return!(this.pairing||this.redirect)}get redirect(){return!!(this.isMobile&&(this.nativeUrl||this.universalUrl))}openApp(e=!0){let t=e?this.redirectHrefWithWCUri:this.redirectHref;t?(this.logger?.debug(`Redirecting:`,t),J_.openHref(t)):this.logger?.error(`No redirecting href.`)}async connect(e,t){this.signClient===void 0&&await this.init(),this.qrUrl.state!==`Init`&&this.setQRState(U.Init);let n=typeof e==`string`?[`cosmos:${e}`]:e.map(e=>`cosmos:${e}`);this.restorePairings();let r=this.pairing;this.logger?.debug(`Restored active pairing topic is:`,r?.topic),this.displayQRCode&&this.setQRState(U.Pending);let i={cosmos:{methods:[`cosmos_getAccounts`,`cosmos_signAmino`,`cosmos_signDirect`,...this.requiredNamespaces?.methods??[]],chains:n,events:[`chainChanged`,`accountsChanged`,...this.requiredNamespaces?.events??[]]}},a;try{this.logger?.debug(`Connecting chains:`,n),a=await this.signClient.connect({pairingTopic:r?.topic,requiredNamespaces:i,...t}),this.qrUrl.data=a.uri,this.logger?.debug(`Using QR URI:`,a.uri),this.displayQRCode&&this.setQRState(U.Done)}catch(e){this.logger?.error(`Client connect error: `,e),this.displayQRCode&&this.setQRError(e);return}this.redirect&&this.openApp();try{let e=await a.approval();this.logger?.debug(`Established session:`,e),this.sessions.push(e),this.restorePairings()}catch(e){throw this.logger?.error(`Session approval error: `,e),await this.deleteInactivePairings(),e?e.code==5001?Mn:e:(this.displayQRCode&&this.setQRError(On),Error(`Proposal Expired`))}finally{!r&&this.qrUrl.message!==On.message&&this.setQRState(U.Init)}}async disconnect(e){if(this.signClient===void 0&&await this.init(),e?.walletconnect?.removeAllPairings===!0&&await this.deleteAllPairings(),this.sessions.length!==0){for(let e of this.sessions)try{this.logger?.debug(`Delete session:`,e);let{getSdkError:t}=await g(async()=>{let{getSdkError:e}=await import(`./dist-BC-yZnz1.js`).then(e=>e.dt);return{getSdkError:e}},__vite__mapDeps([13,1,14,15,16,17,18,19,20,21,22,23,24,4,25,26,27,28,29,30,2,3,31,32,33,34,10,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60]));await this.signClient.disconnect({topic:e.topic,reason:t(`USER_DISCONNECTED`)})}catch(t){this.logger?.error(`SignClient.disconnect session ${e.topic} failed:`,t)}this.sessions=[],this.emitter?.emit(`sync_disconnect`),this.logger?.debug("[WALLET EVENT] Emit `sync_disconnect`")}}async getSimpleAccount(e){let t=this.accounts.find(({chainId:t})=>t===e);if(!t)throw Error(`Chain ${e} is not connected yet, please check the session approval namespaces`);return t}getOfflineSignerAmino(e){return{getAccounts:async()=>[await this.getAccount(e)],signAmino:(t,n)=>this.signAmino(e,t,n)}}getOfflineSignerDirect(e){return{getAccounts:async()=>[await this.getAccount(e)],signDirect:(t,n)=>this.signDirect(e,t,n)}}async getOfflineSigner(e,t){return t===`amino`&&this.getOfflineSignerAmino?this.getOfflineSignerAmino(e):t===`direct`&&this.getOfflineSignerDirect?this.getOfflineSignerDirect(e):this.getOfflineSignerAmino?this.getOfflineSignerAmino?.(e):this.getOfflineSignerDirect(e)}async _getAccount(e){let t=await this.getSession(`cosmos`,e);if(!t)throw Error(`Session for ${e} not established yet.`);let n=await this.signClient.request({topic:t.topic,chainId:`cosmos:${e}`,request:{method:`cosmos_getAccounts`,params:{}}});return this.logger?.debug(`Response of cosmos_getAccounts`,n),n}async getAccount(e){let{address:t,algo:n,pubkey:r}=(await this._getAccount(e))[0];return{address:t,algo:n,pubkey:new Uint8Array(y.from(r,this.wcEncoding))}}async _signAmino(e,t,n,r){let i=await this.getSession(`cosmos`,e);if(!i)throw Error(`Session for ${e} not established yet.`);this.redirect&&this.openApp();let a=await this.signClient.request({topic:i.topic,chainId:`cosmos:${e}`,request:{method:`cosmos_signAmino`,params:{signerAddress:t,signDoc:n}}});return this.logger?.debug(`Response of cosmos_signAmino`,a),a}async signAmino(e,t,n,r){return await this._signAmino(e,t,n,r||this.defaultSignOptions)}async _signDirect(e,t,n,r){let i=await this.getSession(`cosmos`,e);if(!i)throw Error(`Session for ${e} not established yet.`);let a={signerAddress:t,signDoc:{chainId:n.chainId,bodyBytes:y.from(n.bodyBytes).toString(this.wcEncoding),authInfoBytes:y.from(n.authInfoBytes).toString(this.wcEncoding),accountNumber:n.accountNumber.toString()}};this.redirect&&this.openApp();let o=await this.signClient.request({topic:i.topic,chainId:`cosmos:${e}`,request:{method:`cosmos_signDirect`,params:a}});return this.logger?.debug(`Response of cosmos_signDirect`,o),o}async signDirect(e,t,n,r){let{signed:i,signature:a}=await this._signDirect(e,t,n,r||this.defaultSignOptions);return{signed:{chainId:i.chainId,accountNumber:BigInt(i.accountNumber),authInfoBytes:new Uint8Array(y.from(i.authInfoBytes,this.wcEncoding)),bodyBytes:new Uint8Array(y.from(i.bodyBytes,this.wcEncoding))},signature:a}}},Z_=class extends qr{WCClient;clientMutable={state:U.Init};constructor(e,t,n){if(!e.walletconnect)throw Error(`'walletconnect' info for wallet ${e.prettyName} is not provided in wallet registry.`);super(e,t),this.WCClient=n}async initClient(e){if(!e){this.initClientError(Error("`walletconnectOptions` is not provided."));return}if(!e.signClient.projectId){this.initClientError(Error("`projectId` is not provided in `walletconnectOptions`."));return}this.initingClient();try{let t=new this.WCClient(this.walletInfo);t.logger=this.logger,t.emitter=this.emitter,t.env=this.env,t.options=e,this.initClientDone(t)}catch(e){this.initClientError(e)}}},Q_=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MessageRegistry=void 0,e.MessageRegistry=class{constructor(){this.registeredMsgType=new Map}registerMessage(e){if(this.registeredMsgType.has(e.type()))throw Error(`Already registered type ${e.type()}`);this.registeredMsgType.set(e.type(),e)}parseMessage(e){if(!e.type)throw Error(`Null type`);let t=this.registeredMsgType.get(e.type);if(!t)throw Error(`Unregistered msg type ${e.type}`);return Object.setPrototypeOf(e.msg,t.prototype)}}})),$_=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromHex=e.toHex=void 0;function t(e){let t=``;for(let n of e)t+=(`0`+n.toString(16)).slice(-2);return t}e.toHex=t;function n(e){if(e.length%2!=0)throw Error(`hex string length must be a multiple of 2`);let t=[];for(let n=0;n<e.length;n+=2){let r=e.substr(n,2);if(!r.match(/[0-9a-f]{2}/i))throw Error(`hex string contains invalid characters`);t.push(parseInt(r,16))}return new Uint8Array(t)}e.fromHex=n})),ev=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.JSONUint8Array=void 0;var t=$_();e.JSONUint8Array=class e{static parse(e){return JSON.parse(e,(e,n)=>{if(e===`__proto__`)throw Error(`__proto__ is disallowed`);return n&&typeof n==`string`&&n.startsWith(`__uint8array__`)?(0,t.fromHex)(n.replace(`__uint8array__`,``)):typeof BigInt<`u`&&n&&typeof n==`string`&&n.startsWith(`__bigint__`)?BigInt(n.replace(`__bigint__`,``)):n})}static stringify(e){return JSON.stringify(e,(e,n)=>{if(e===`__proto__`)throw Error(`__proto__ is disallowed`);if(n&&(n instanceof Uint8Array||typeof n==`object`&&`type`in n&&`data`in n&&n.type===`Buffer`&&Array.isArray(n.data))){let e=n instanceof Uint8Array?n:new Uint8Array(n.data);return`__uint8array__${(0,t.toHex)(e)}`}return typeof n==`bigint`?`__bigint__${n.toString()}`:n})}static wrap(t){if(t!==void 0)return JSON.parse(e.stringify(t))}static unwrap(t){if(t!==void 0)return e.parse(e.stringify(t))}}})),tv=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.Router=void 0;var n=Q_(),r=ev();e.Router=class{constructor(e){this.envProducer=e,this.msgRegistry=new n.MessageRegistry,this.registeredHandler=new Map,this.guards=[],this.port=``,this._isInitialized=!1}get isInitialized(){return this._isInitialized}registerMessage(e){this.msgRegistry.registerMessage(e)}addHandler(e,t){if(this.registeredHandler.has(e))throw Error(`Already registered type ${e}`);this.registeredHandler.set(e,t)}addGuard(e){this.guards.push(e)}listen(e,n){return t(this,void 0,void 0,function*(){if(this.port=e,this.attachHandler(),n){let e;this._initWaiter=new Promise(t=>{e=t}),yield n(),e()}this._isInitialized=!0})}unlisten(){this.port=``,this.detachHandler()}handleMessage(e,n){return t(this,void 0,void 0,function*(){this.isInitialized||(yield this._initWaiter);let t=this.msgRegistry.parseMessage(r.JSONUint8Array.unwrap(e)),i=this.envProducer(n,t.routerMeta??{});for(let e of this.guards)yield e(i,t,n);t.validateBasic();let a=t.route();if(!a)throw Error(`Null router`);let o=this.registeredHandler.get(a);if(!o)throw Error(`Can't get handler`);return r.JSONUint8Array.wrap(yield o(i,t))})}}})),nv=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),rv=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),iv=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),av=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.EthereumProviderRpcError=e.KeplrError=void 0,e.KeplrError=class e extends Error{constructor(t,n,r){super(r),this.module=t,this.code=n,Object.setPrototypeOf(this,e.prototype)}},e.EthereumProviderRpcError=class e extends Error{constructor(t,n,r){super(n),this.code=t,this.data=r,Object.setPrototypeOf(this,e.prototype)}}})),ov=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Message=void 0,e.Message=class{approveExternal(e,t){return!1}}})),sv=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.WEBPAGE_PORT=e.APP_PORT=e.BACKGROUND_PORT=void 0,e.BACKGROUND_PORT=`background`,e.APP_PORT=`popup`,e.WEBPAGE_PORT=`webpage`})),cv=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.sendSimpleMessage=e.SimpleMessage=void 0;var n=ov(),r=Symbol(),i=Symbol(),a=class extends n.Message{constructor(e,t,n){super(),this[r]=e,this[i]=t;for(let e of Object.keys(n))this[e]=n[e]}route(){return this[r]}type(){return this[i]}validateBasic(){}approveExternal(){return!0}};e.SimpleMessage=a;function o(e,n,r,i,o){return t(this,void 0,void 0,function*(){return yield e.sendMessage(n,new a(r,i,o))})}e.sendSimpleMessage=o})),lv=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(tv(),e),n(nv(),e),n(rv(),e),n(iv(),e),n(av(),e),n(ov(),e),n(sv(),e),n(Q_(),e),n(cv(),e),n(ev(),e)})),uv=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.KeplrEnigmaUtils=void 0,e.KeplrEnigmaUtils=class{constructor(e,t){this.chainId=e,this.keplr=t}getPubkey(){return t(this,void 0,void 0,function*(){return yield this.keplr.getEnigmaPubKey(this.chainId)})}getTxEncryptionKey(e){return t(this,void 0,void 0,function*(){return yield this.keplr.getEnigmaTxEncryptionKey(this.chainId,e)})}encrypt(e,n){return t(this,void 0,void 0,function*(){return yield this.keplr.enigmaEncrypt(this.chainId,e,n)})}decrypt(e,n){return t(this,void 0,void 0,function*(){return yield this.keplr.enigmaDecrypt(this.chainId,e,n)})}}})),dv=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.CosmJSOfflineSigner=e.CosmJSOfflineSignerOnlyAmino=void 0;var n=class{constructor(e,t,n){this.chainId=e,this.keplr=t,this.signOptions=n}getAccounts(){return t(this,void 0,void 0,function*(){let e=yield this.keplr.getKey(this.chainId);return[{address:e.bech32Address,algo:`secp256k1`,pubkey:e.pubKey}]})}signAmino(e,n){return t(this,void 0,void 0,function*(){if(this.chainId!==n.chain_id)throw Error(`Unmatched chain id with the offline signer`);if((yield this.keplr.getKey(n.chain_id)).bech32Address!==e)throw Error(`Unknown signer address`);return yield this.keplr.signAmino(this.chainId,e,n,this.signOptions)})}sign(e,n){return t(this,void 0,void 0,function*(){return yield this.signAmino(e,n)})}};e.CosmJSOfflineSignerOnlyAmino=n,e.CosmJSOfflineSigner=class extends n{constructor(e,t,n){super(e,t,n)}signDirect(e,n){return t(this,void 0,void 0,function*(){if(this.chainId!==n.chainId)throw Error(`Unmatched chain id with the offline signer`);if((yield this.keplr.getKey(n.chainId)).bech32Address!==e)throw Error(`Unknown signer address`);return yield this.keplr.signDirect(this.chainId,e,n,this.signOptions)})}}})),fv=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Keplr=void 0;var i=lv(),a=uv(),o=dv(),s=r(Vn()),c=r(G()),l=(_(),n(v)),u=r(M());e.Keplr=class{constructor(e,t,n){this.version=e,this.mode=t,this.requester=n,this.enigmaUtils=new Map,this.defaultOptions={},this.ethereum=new f(this,this.requester),this.starknet=new m(this,this.requester),this.bitcoin=new h(this,this.requester)}ping(){return t(this,void 0,void 0,function*(){yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`chains`,`keplr-ping`,{})})}enable(e){return typeof e==`string`&&(e=[e]),new Promise((t,n)=>{let r=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`permission-interactive`,`enable-access`,{chainIds:e}).then(t).catch(n).finally(()=>r=!0),setTimeout(()=>{r||this.protectedTryOpenSidePanelIfEnabled()},300)})}isEnabled(e){return t(this,void 0,void 0,function*(){return typeof e==`string`&&(e=[e]),yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`permission-interactive`,`is-enabled-access`,{chainIds:e})})}disable(e){return t(this,void 0,void 0,function*(){return typeof e==`string`&&(e=[e]),new Promise((t,n)=>{let r=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`permission-interactive`,`disable-access`,{chainIds:e??[]}).then(t).catch(n).finally(()=>r=!0),setTimeout(()=>{r||this.protectedTryOpenSidePanelIfEnabled()},300)})})}experimentalSuggestChain(e){return t(this,void 0,void 0,function*(){if(e.hideInUI)throw Error(`hideInUI is not allowed`);if(e.gasPriceStep){let t=Object.assign({},e.gasPriceStep);for(let n of e.feeCurrencies)n.gasPriceStep||=t;delete e.gasPriceStep}return e.coinType&&delete e.coinType,new Promise((t,n)=>{let r=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`chains`,`need-suggest-chain-info-interaction`,{chainInfo:e}).then(a=>{a||(r=!0),(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`chains`,`suggest-chain-info`,{chainInfo:e}).then(t).catch(n).finally(()=>r=!0),setTimeout(()=>{r||this.protectedTryOpenSidePanelIfEnabled()},300)})})})}getKey(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let r=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-cosmos`,`get-cosmos-key`,{chainId:e}).then(t).catch(n).finally(()=>r=!0),setTimeout(()=>{r||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getKeysSettled(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let r=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-cosmos`,`get-cosmos-keys-settled`,{chainIds:e}).then(t).catch(n).finally(()=>r=!0),setTimeout(()=>{r||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getChainInfosWithoutEndpoints(){return t(this,void 0,void 0,function*(){return new Promise((e,t)=>{let n=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`chains`,`get-chain-infos-without-endpoints`,{}).then(t=>e(t.chainInfos)).catch(t).finally(()=>n=!0),setTimeout(()=>{n||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getChainInfoWithoutEndpoints(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let r=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`chains`,`get-chain-info-without-endpoints`,{chainId:e}).then(e=>t(e.chainInfo)).catch(n).finally(()=>r=!0),setTimeout(()=>{r||this.protectedTryOpenSidePanelIfEnabled()},300)})})}sendTx(e,n,r){return t(this,void 0,void 0,function*(){return yield this.enable(e),yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`background-tx`,`send-tx-to-background`,{chainId:e,tx:n,mode:r})})}signAmino(e,n,r,a={}){return t(this,void 0,void 0,function*(){return new Promise((t,o)=>{let c=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-cosmos`,`request-cosmos-sign-amino`,{chainId:e,signer:n,signDoc:r,signOptions:(0,s.default)(this.defaultOptions.sign??{},a)}).then(t).catch(o).finally(()=>c=!0),setTimeout(()=>{c||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signDirect(e,n,r,a={}){return t(this,void 0,void 0,function*(){return new Promise((t,o)=>{let l=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-cosmos`,`request-cosmos-sign-direct`,{chainId:e,signer:n,signDoc:{bodyBytes:r.bodyBytes,authInfoBytes:r.authInfoBytes,chainId:r.chainId,accountNumber:r.accountNumber?r.accountNumber.toString():null},signOptions:(0,s.default)(this.defaultOptions.sign??{},a)}).then(e=>t({signed:{bodyBytes:e.signed.bodyBytes,authInfoBytes:e.signed.authInfoBytes,chainId:e.signed.chainId,accountNumber:c.default.fromString(e.signed.accountNumber)},signature:e.signature})).catch(o).finally(()=>l=!0),setTimeout(()=>{l||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signDirectAux(e,n,r,a={}){return t(this,void 0,void 0,function*(){return new Promise((t,o)=>{let l=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-cosmos`,`request-cosmos-sign-direct-aux`,{chainId:e,signer:n,signDoc:{bodyBytes:r.bodyBytes,publicKey:r.publicKey,chainId:r.chainId,accountNumber:r.accountNumber?r.accountNumber.toString():null,sequence:r.sequence?r.sequence.toString():null},signOptions:(0,s.default)({preferNoSetMemo:this.defaultOptions.sign?.preferNoSetMemo},a)}).then(e=>t({signed:{bodyBytes:e.signed.bodyBytes,publicKey:e.signed.publicKey,chainId:e.signed.chainId,accountNumber:c.default.fromString(e.signed.accountNumber),sequence:c.default.fromString(e.signed.sequence)},signature:e.signature})).catch(o).finally(()=>l=!0),setTimeout(()=>{l||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signArbitrary(e,n,r){return t(this,void 0,void 0,function*(){return new Promise((t,a)=>{let o=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-cosmos`,`request-cosmos-sign-amino-adr-36`,{chainId:e,signer:n,data:typeof r==`string`?l.Buffer.from(r):r,signOptions:{isADR36WithString:typeof r==`string`}}).then(t).catch(a).finally(()=>o=!0),setTimeout(()=>{o||this.protectedTryOpenSidePanelIfEnabled()},300)})})}verifyArbitrary(e,n,r,a){return t(this,void 0,void 0,function*(){return typeof r==`string`&&(r=l.Buffer.from(r)),new Promise((t,o)=>{let s=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-cosmos`,`verify-cosmos-sign-amino-adr-36`,{chainId:e,signer:n,data:r,signature:a}).then(t).catch(o).finally(()=>s=!0),setTimeout(()=>{s||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signEthereum(e,n,r,a){return t(this,void 0,void 0,function*(){return new Promise((t,o)=>{let s=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-ethereum`,`request-sign-ethereum`,{chainId:e,signer:n,message:typeof r==`string`?l.Buffer.from(r):r,signType:a}).then(t).catch(o).finally(()=>s=!0),setTimeout(()=>{s||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signICNSAdr36(e,n,r,a,o){return t(this,void 0,void 0,function*(){return new Promise((t,s)=>{let c=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-cosmos`,`request-icns-adr-36-signatures-v2`,{chainId:e,contractAddress:n,owner:r,username:a,addressChainIds:o}).then(t).catch(s).finally(()=>c=!0),setTimeout(()=>{c||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getOfflineSigner(e,t){return new o.CosmJSOfflineSigner(e,this,t)}getOfflineSignerOnlyAmino(e,t){return new o.CosmJSOfflineSignerOnlyAmino(e,this,t)}getOfflineSignerAuto(e,n){return t(this,void 0,void 0,function*(){return(yield this.getKey(e)).isNanoLedger?new o.CosmJSOfflineSignerOnlyAmino(e,this,n):new o.CosmJSOfflineSigner(e,this,n)})}suggestToken(e,n,r){return t(this,void 0,void 0,function*(){return new Promise((t,a)=>{let o=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`token-cw20`,`SuggestTokenMsg`,{chainId:e,contractAddress:n,viewingKey:r}).then(t).catch(a).finally(()=>o=!0),setTimeout(()=>{o||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getSecret20ViewingKey(e,n){return t(this,void 0,void 0,function*(){return new Promise((t,r)=>{let a=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`token-cw20`,`get-secret20-viewing-key`,{chainId:e,contractAddress:n}).then(t).catch(r).finally(()=>a=!0),setTimeout(()=>{a||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getEnigmaPubKey(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let r=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`secret-wasm`,`get-pubkey-msg`,{chainId:e}).then(t).catch(n).finally(()=>r=!0),setTimeout(()=>{r||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getEnigmaTxEncryptionKey(e,n){return t(this,void 0,void 0,function*(){return new Promise((t,r)=>{let a=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`secret-wasm`,`get-tx-encryption-key-msg`,{chainId:e,nonce:n}).then(t).catch(r).finally(()=>a=!0),setTimeout(()=>{a||this.protectedTryOpenSidePanelIfEnabled()},300)})})}enigmaEncrypt(e,n,r){return t(this,void 0,void 0,function*(){return new Promise((t,a)=>{let o=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`secret-wasm`,`request-encrypt-msg`,{chainId:e,contractCodeHash:n,msg:r}).then(t).catch(a).finally(()=>o=!0),setTimeout(()=>{o||this.protectedTryOpenSidePanelIfEnabled()},300)})})}enigmaDecrypt(e,n,r){return t(this,void 0,void 0,function*(){return!n||n.length===0?new Uint8Array:new Promise((t,a)=>{let o=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`secret-wasm`,`request-decrypt-msg`,{chainId:e,cipherText:n,nonce:r}).then(t).catch(a).finally(()=>o=!0),setTimeout(()=>{o||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getEnigmaUtils(e){if(this.enigmaUtils.has(e))return this.enigmaUtils.get(e);let t=new a.KeplrEnigmaUtils(e,this);return this.enigmaUtils.set(e,t),t}experimentalSignEIP712CosmosTx_v0(e,n,r,a,o={}){return t(this,void 0,void 0,function*(){return new Promise((t,c)=>{let l=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-cosmos`,`request-sign-eip-712-cosmos-tx-v0`,{chainId:e,signer:n,eip712:r,signDoc:a,signOptions:(0,s.default)(this.defaultOptions.sign??{},o)}).then(t).catch(c).finally(()=>l=!0),setTimeout(()=>{l||this.protectedTryOpenSidePanelIfEnabled()},300)})})}__core__getAnalyticsId(){return t(this,void 0,void 0,function*(){return yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`analytics`,`get-analytics-id`,{})})}changeKeyRingName({defaultName:e,editable:n=!0}){return t(this,void 0,void 0,function*(){return new Promise((t,r)=>{let a=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-v2`,`change-keyring-name-interactive`,{defaultName:e,editable:n}).then(t).catch(r).finally(()=>a=!0),setTimeout(()=>{a||this.protectedTryOpenSidePanelIfEnabled()},300)})})}__core__privilageSignAminoWithdrawRewards(e,n,r){return t(this,void 0,void 0,function*(){return yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-cosmos`,`PrivilegeCosmosSignAminoWithdrawRewards`,{chainId:e,signer:n,signDoc:r})})}__core__privilageSignAminoDelegate(e,n,r){return t(this,void 0,void 0,function*(){return yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-cosmos`,`PrivilegeCosmosSignAminoDelegate`,{chainId:e,signer:n,signDoc:r})})}__core__privilageSignAminoExecuteCosmWasm(e,n,r){return t(this,void 0,void 0,function*(){return yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-cosmos`,`PrivilegeCosmosSignAminoExecuteCosmWasm`,{chainId:e,signer:n,signDoc:r})})}sendEthereumTx(e,n){return t(this,void 0,void 0,function*(){return yield this.enable(e),yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`background-tx-ethereum`,`send-ethereum-tx-to-background`,{chainId:e,tx:n})})}suggestERC20(e,n){return t(this,void 0,void 0,function*(){return new Promise((t,r)=>{let a=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`token-erc20`,`SuggestERC20TokenMsg`,{chainId:e,contractAddress:n}).then(t).catch(r).finally(()=>a=!0),setTimeout(()=>{a||this.protectedTryOpenSidePanelIfEnabled()},300)})})}__core__webpageClosed(){return t(this,void 0,void 0,function*(){yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`interaction`,`injected-webpage-closed`,{})})}getStarknetKey(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let r=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-starknet`,`get-starknet-key`,{chainId:e}).then(t).catch(n).finally(()=>r=!0),setTimeout(()=>{r||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getStarknetKeysSettled(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let r=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-starknet`,`get-starknet-keys-settled`,{chainIds:e}).then(t).catch(n).finally(()=>r=!0),setTimeout(()=>{r||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signStarknetTx(e,n,r){return t(this,void 0,void 0,function*(){return new Promise((t,a)=>{let o=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-starknet`,`request-sign-starknet-tx`,{chainId:e,transactions:n,details:r}).then(t).catch(a).finally(()=>o=!0),setTimeout(()=>{o||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signStarknetDeployAccountTransaction(e,n){return t(this,void 0,void 0,function*(){return new Promise((t,r)=>{let a=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-starknet`,`request-sign-starknet-deploy-account-tx`,{chainId:e,transaction:n}).then(t).catch(r).finally(()=>a=!0),setTimeout(()=>{a||this.protectedTryOpenSidePanelIfEnabled()})})})}getBitcoinKey(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let r=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-bitcoin`,`get-bitcoin-key`,{chainId:e}).then(t).catch(n).finally(()=>r=!0),setTimeout(()=>{r||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getBitcoinKeysSettled(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let r=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-bitcoin`,`get-bitcoin-keys-settled`,{chainIds:e}).then(t).catch(n).finally(()=>r=!0),setTimeout(()=>{r||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signPsbt(e,n,r){return t(this,void 0,void 0,function*(){return yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-bitcoin`,`request-sign-bitcoin-psbt`,{chainId:e,psbtHex:n,options:r})})}signPsbts(e,n,r){return t(this,void 0,void 0,function*(){return yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-bitcoin`,`request-sign-bitcoin-psbts`,{chainId:e,psbtsHexes:n,options:r})})}protectedTryOpenSidePanelIfEnabled(e=!1){return t(this,void 0,void 0,function*(){let t=!1;if(typeof window<`u`&&window.__keplr_content_script===!0&&(t=!0),t&&(yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`side-panel`,`GetSidePanelEnabledMsg`,{})).enabled)try{return yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`router-extension/src/router/extension.ts`,`tryOpenSidePanelIfEnabled`,{})}catch(t){if(!e&&t.message&&t.message.includes(`in response to a user gesture`)&&!document.getElementById(`__open_keplr_side_panel__`)){if(yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`interaction`,`ping-content-script-tab-has-opened-side-panel`,{}))return;let e=yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring`,`GetIsLockedMsg`,{}),t=yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`settings`,`GetThemeOptionMsg`,{}),n=`
5
+ '`+a.annotationType_+`' can only be used on properties with a function value.`))}function Xl(e,t,n,r){t.annotationType_,r.value}function Zl(e,t,n,r,i){var a,o;i===void 0&&(i=Q.safeDescriptors),Xl(e,t,n,r);var s=r.value;return(a=t.options_)!=null&&a.bound&&(s=s.bind(e.proxy_??e.target_)),{value:Cu(t.options_?.name??n.toString(),s,t.options_?.autoAction??!1,(o=t.options_)!=null&&o.bound?e.proxy_??e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function Ql(e,t){return{annotationType_:e,options_:t,make_:$l,extend_:eu,decorate_20223_:tu}}function $l(e,t,n,r){var i;return r===e.target_?this.extend_(e,t,n,!1)===null?0:2:(i=this.options_)!=null&&i.bound&&(!dl(e.target_,t)||!Od(e.target_[t]))&&this.extend_(e,t,n,!1)===null?0:Od(n.value)?1:(Gf(r,t,ru(e,this,t,n,!1,!1)),2)}function eu(e,t,n,r){var i=ru(e,this,t,n,this.options_?.bound);return e.defineProperty_(t,i,r)}function tu(e,t){var n,r=t.name,i=t.addInitializer;return Od(e)||(e=um(e)),(n=this.options_)!=null&&n.bound&&i(function(){var e=this,t=e[r].bind(e);t.isMobXFlow=!0,e[r]=t}),e}function nu(e,t,n,r){t.annotationType_,r.value}function ru(e,t,n,r,i,a){a===void 0&&(a=Q.safeDescriptors),nu(e,t,n,r);var o=r.value;return Od(o)||(o=um(o)),i&&(o=o.bind(e.proxy_??e.target_),o.isMobXFlow=!0),{value:o,configurable:a?e.isPlainObject_:!0,enumerable:!1,writable:!a}}function iu(e,t){return{annotationType_:e,options_:t,make_:au,extend_:ou,decorate_20223_:su}}function au(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function ou(e,t,n,r){return cu(e,this,t,n),e.defineComputedProperty_(t,yl({},this.options_,{get:n.get,set:n.set}),r)}function su(e,t){var n=this,r=t.name,i=t.addInitializer;return i(function(){var t=wf(this)[X],i=yl({},n.options_,{get:e,context:this});i.name||=`ObservableObject.`+r.toString(),t.values_.set(r,new jp(i))}),function(){return this[X].getObservablePropValue_(r)}}function cu(e,t,n,r){t.annotationType_,r.get}function lu(e,t){return{annotationType_:e,options_:t,make_:uu,extend_:du,decorate_20223_:fu}}function uu(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function du(e,t,n,r){return pu(e,this,t,n),e.defineObservableProperty_(t,n.value,this.options_?.enhancer??Rl,r)}function fu(e,t){var n=this,r=t.kind,i=t.name,a=new WeakSet;function o(e,t){var r=wf(e)[X],o=new kp(t,n.options_?.enhancer??Rl,`ObservableObject.`+i.toString(),!1);r.values_.set(i,o),a.add(e)}if(r==`accessor`)return{get:function(){return a.has(this)||o(this,e.get.call(this)),this[X].getObservablePropValue_(i)},set:function(e){return a.has(this)||o(this,e),this[X].setObservablePropValue_(i,e)},init:function(e){return a.has(this)||o(this,e),e}}}function pu(e,t,n,r){t.annotationType_}function mu(e){return{annotationType_:sp,options_:e,make_:hu,extend_:gu,decorate_20223_:_u}}function hu(e,t,n,r){var i;if(n.get)return wp.make_(e,t,n,r);if(n.set){var a=ud(n.set)?n.set:Cu(t.toString(),n.set);return r===e.target_?e.defineProperty_(t,{configurable:Q.safeDescriptors?e.isPlainObject_:!0,set:a})===null?0:2:(Gf(r,t,{configurable:!0,set:a}),2)}if(r!==e.target_&&typeof n.value==`function`){var o;if(nl(n.value)){var s;return((s=this.options_)!=null&&s.autoBind?um.bound:um).make_(e,t,n,r)}return((o=this.options_)!=null&&o.autoBind?$p.bound:$p).make_(e,t,n,r)}var c=this.options_?.deep===!1?yp.ref:yp;return typeof n.value==`function`&&(i=this.options_)!=null&&i.autoBind&&(n.value=n.value.bind(e.proxy_??e.target_)),c.make_(e,t,n,r)}function gu(e,t,n,r){var i;return n.get?wp.extend_(e,t,n,r):n.set?e.defineProperty_(t,{configurable:Q.safeDescriptors?e.isPlainObject_:!0,set:Cu(t.toString(),n.set)},r):(typeof n.value==`function`&&(i=this.options_)!=null&&i.autoBind&&(n.value=n.value.bind(e.proxy_??e.target_)),(this.options_?.deep===!1?yp.ref:yp).extend_(e,t,n,r))}function _u(e,t){J(`'`+this.annotationType_+`' cannot be used as a decorator`)}function vu(e){return e||pp}function yu(e){return e.deep===!0?Rl:e.deep===!1?Bl:xu(e.defaultDecorator)}function bu(e){return e?e.defaultDecorator??mu(e):void 0}function xu(e){return e?e.options_?.enhancer??Rl:Rl}function Su(e,t,n){if(Ml(t))return mp.decorate_20223_(e,t);if($c(t)){Al(e,t,mp);return}return Ld(e)?e:tl(e)?yp.object(e,t,n):Array.isArray(e)?yp.array(e,t):ol(e)?yp.map(e,t):cl(e)?yp.set(e,t):typeof e==`object`&&e?e:yp.box(e,t)}function Cu(e,t,n,r){n===void 0&&(n=!1);function i(){return wu(e,n,t,r||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},Dp&&(Op.value=e,Gf(i,`name`,Op)),i}function wu(e,t,n,r,i){var a=Tu(e,t,r,i);try{return n.apply(r,i)}catch(e){throw a.error_=e,e}finally{Eu(a)}}function Tu(e,t,n,r){var i=!1,a=0,o=Q.trackingDerivation,s=!t||!o;Xu();var c=Q.allowStateChanges;s&&(Lu(),c=Ou(!0));var l=zu(!0),u={runAsAction_:s,prevDerivation_:o,prevAllowStateChanges_:c,prevAllowStateReads_:l,notifySpy_:i,startTime_:a,actionId_:Ep++,parentActionId_:Tp};return Tp=u.actionId_,u}function Eu(e){Tp!==e.actionId_&&J(30),Tp=e.parentActionId_,e.error_!==void 0&&(Q.suppressReactionErrors=!0),ku(e.prevAllowStateChanges_),Bu(e.prevAllowStateReads_),Zu(),e.runAsAction_&&Ru(e.prevDerivation_),Q.suppressReactionErrors=!1}function Du(e,t){var n=Ou(e);try{return t()}finally{ku(n)}}function Ou(e){var t=Q.allowStateChanges;return Q.allowStateChanges=e,t}function ku(e){Q.allowStateChanges=e}function Au(e){return e instanceof Pp}function ju(e){switch(e.dependenciesState_){case Z.UP_TO_DATE_:return!1;case Z.NOT_TRACKING_:case Z.STALE_:return!0;case Z.POSSIBLY_STALE_:for(var t=zu(!0),n=Lu(),r=e.observing_,i=r.length,a=0;a<i;a++){var o=r[a];if(Mp(o)){if(Q.disableErrorBoundaries)o.get();else try{o.get()}catch{return Ru(n),Bu(t),!0}if(e.dependenciesState_===Z.STALE_)return Ru(n),Bu(t),!0}}return Vu(e),Ru(n),Bu(t),!1}}function Mu(){return Q.trackingDerivation!==null}function Nu(e,t,n){var r=zu(!0);Vu(e),e.newObserving_=Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++Q.runId;var i=Q.trackingDerivation;Q.trackingDerivation=e,Q.inBatch++;var a;if(Q.disableErrorBoundaries===!0)a=t.call(n);else try{a=t.call(n)}catch(e){a=new Pp(e)}return Q.inBatch--,Q.trackingDerivation=i,Pu(e),Bu(r),a}function Pu(e){for(var t=e.observing_,n=e.observing_=e.newObserving_,r=Z.UP_TO_DATE_,i=0,a=e.unboundDepsCount_,o=0;o<a;o++){var s=n[o];s.diffValue===0&&(s.diffValue=1,i!==o&&(n[i]=s),i++),s.dependenciesState_>r&&(r=s.dependenciesState_)}for(n.length=i,e.newObserving_=null,a=t.length;a--;){var c=t[a];c.diffValue===0&&Ju(c,e),c.diffValue=0}for(;i--;){var l=n[i];l.diffValue===1&&(l.diffValue=0,qu(l,e))}r!==Z.UP_TO_DATE_&&(e.dependenciesState_=r,e.onBecomeStale_())}function Fu(e){var t=e.observing_;e.observing_=[];for(var n=t.length;n--;)Ju(t[n],e);e.dependenciesState_=Z.NOT_TRACKING_}function Iu(e){var t=Lu();try{return e()}finally{Ru(t)}}function Lu(){var e=Q.trackingDerivation;return Q.trackingDerivation=null,e}function Ru(e){Q.trackingDerivation=e}function zu(e){var t=Q.allowStateReads;return Q.allowStateReads=e,t}function Bu(e){Q.allowStateReads=e}function Vu(e){if(e.dependenciesState_!==Z.UP_TO_DATE_){e.dependenciesState_=Z.UP_TO_DATE_;for(var t=e.observing_,n=t.length;n--;)t[n].lowestObserverState_=Z.UP_TO_DATE_}}function Hu(){if((Q.pendingReactions.length||Q.inBatch||Q.isRunningReactions)&&J(36),Rp=!0,Lp){var e=Yc();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),Q=new Ip}}function Uu(){return Q}function Wu(){var e=new Ip;for(var t in e)Fp.indexOf(t)===-1&&(Q[t]=e[t]);Q.allowStateChanges=!Q.enforceActions}function Gu(e){return e.observers_&&e.observers_.size>0}function Ku(e){return e.observers_}function qu(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function Ju(e,t){e.observers_.delete(t),e.observers_.size===0&&Yu(e)}function Yu(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,Q.pendingUnobservations.push(e))}function Xu(){Q.inBatch++}function Zu(){if(--Q.inBatch===0){rd();for(var e=Q.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,n.observers_.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBUO()),n instanceof jp&&n.suspend_())}Q.pendingUnobservations=[]}}function Qu(e){var t=Q.trackingDerivation;return t===null?(e.observers_.size===0&&Q.inBatch>0&&Yu(e),!1):(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&Q.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved)}function $u(e){e.lowestObserverState_!==Z.STALE_&&(e.lowestObserverState_=Z.STALE_,e.observers_.forEach(function(e){e.dependenciesState_===Z.UP_TO_DATE_&&e.onBecomeStale_(),e.dependenciesState_=Z.STALE_}))}function ed(e){e.lowestObserverState_!==Z.STALE_&&(e.lowestObserverState_=Z.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Z.POSSIBLY_STALE_?t.dependenciesState_=Z.STALE_:t.dependenciesState_===Z.UP_TO_DATE_&&(e.lowestObserverState_=Z.UP_TO_DATE_)}))}function td(e){e.lowestObserverState_===Z.UP_TO_DATE_&&(e.lowestObserverState_=Z.POSSIBLY_STALE_,e.observers_.forEach(function(e){e.dependenciesState_===Z.UP_TO_DATE_&&(e.dependenciesState_=Z.POSSIBLY_STALE_,e.onBecomeStale_())}))}function nd(e){return Q.globalReactionErrorHandlers.push(e),function(){var t=Q.globalReactionErrorHandlers.indexOf(e);t>=0&&Q.globalReactionErrorHandlers.splice(t,1)}}function rd(){Q.inBatch>0||Q.isRunningReactions||Vp(id)}function id(){Q.isRunningReactions=!0;for(var e=Q.pendingReactions,t=0;e.length>0;){++t===Bp&&e.splice(0);for(var n=e.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction_()}Q.isRunningReactions=!1}function ad(e){var t=Vp;Vp=function(n){return e(function(){return t(n)})}}function od(){return!1}function sd(e){return function(){}}function cd(e){return function(t,n){if(Qc(t))return Cu(t.name||qp,t,e);if(Qc(n))return Cu(t,n,e);if(Ml(n))return(e?Xp:Jp).decorate_20223_(t,n);if($c(n))return Al(t,n,e?Xp:Jp);if($c(t))return kl(Kl(e?Gp:Up,{name:t,autoAction:e}))}}function ld(e){return wu(e.name||qp,!1,e,this,void 0)}function ud(e){return Qc(e)&&e.isMobxAction===!0}function dd(e,t){var n;t===void 0&&(t=Jf);var r=t?.name??`Autorun`,i=!t.scheduler&&!t.delay,a;if(i)a=new zp(r,function(){this.track(c)},t.onError,t.requiresObservable);else{var o=fd(t),s=!1;a=new zp(r,function(){s||(s=!0,o(function(){s=!1,a.isDisposed||a.track(c)}))},t.onError,t.requiresObservable)}function c(){e(a)}return(n=t)!=null&&(n=n.signal)!=null&&n.aborted||a.schedule_(),a.getDisposer_(t?.signal)}function fd(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:em}function pd(e,t,n){var r;n===void 0&&(n=Jf);var i=n.name??`Reaction`,a=Qp(i,n.onError?md(n.onError,t):t),o=!n.scheduler&&!n.delay,s=fd(n),c=!0,l=!1,u,d=n.compareStructural?ip.structural:n.equals||ip.default,f=new zp(i,function(){c||o?p():l||(l=!0,s(p))},n.onError,n.requiresObservable);function p(){if(l=!1,!f.isDisposed){var t=!1,r=u;f.track(function(){var n=Du(!1,function(){return e(f)});t=c||!d(u,n),u=n}),(c&&n.fireImmediately||!c&&t)&&a(u,r,f),c=!1}}return(r=n)!=null&&(r=r.signal)!=null&&r.aborted||f.schedule_(),f.getDisposer_(n?.signal)}function md(e,t){return function(){try{return t.apply(this,arguments)}catch(t){e.call(this,t)}}}function hd(e,t,n){return _d(tm,e,t,n)}function gd(e,t,n){return _d(nm,e,t,n)}function _d(e,t,n,r){var i=typeof r==`function`?Nf(t,n):Nf(t),a=Qc(r)?r:n,o=e+`L`;return i[o]?i[o].add(a):i[o]=new Set([a]),function(){var e=i[o];e&&(e.delete(a),e.size===0&&delete i[o])}}function vd(e){e.isolateGlobalState===!0&&Hu();var t=e.useProxies,n=e.enforceActions;if(t!==void 0&&(Q.useProxies=t===im?!0:t===rm?!1:typeof Proxy<`u`),t===`ifavailable`&&(Q.verifyProxies=!0),n!==void 0){var r=n===im?im:n===am;Q.enforceActions=r,Q.allowStateChanges=!(r===!0||r===im)}[`computedRequiresReaction`,`reactionRequiresObservable`,`observableRequiresReaction`,`disableErrorBoundaries`,`safeDescriptors`].forEach(function(t){t in e&&(Q[t]=!!e[t])}),Q.allowStateReads=!Q.observableRequiresReaction,e.reactionScheduler&&ad(e.reactionScheduler)}function yd(e,t,n,r){var i=ep(t);return If(function(){var t=wf(e,r)[X];$f(i).forEach(function(e){t.extend_(e,i[e],n&&e in n?n[e]:!0)})}),e}function bd(e,t){return xd(Nf(e,t))}function xd(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=wd(e.observing_).map(xd)),t}function Sd(e,t){return Cd(Nf(e,t))}function Cd(e){var t={name:e.name_};return Gu(e)&&(t.observers=Array.from(Ku(e)).map(Cd)),t}function wd(e){return Array.from(new Set(e))}function Td(e){return e instanceof sm}function Ed(e){Qc(e.cancel)&&e.cancel()}function Dd(e){return e}function Od(e){return e?.isMobXFlow===!0}function kd(e,t,n){var r;return wm(e)||bf(e)||Ap(e)?r=Pf(e):Ef(e)&&(r=Pf(e,t)),r.dehancer=typeof t==`function`?t:n,function(){r.dehancer=void 0}}function Ad(e,t,n){return Qc(n)?Md(e,t,n):jd(e,t)}function jd(e,t){return Pf(e).intercept_(t)}function Md(e,t,n){return Pf(e,t).intercept_(n)}function Nd(e,t){return t===void 0?Mp(e):Ef(e)===!1||!e[X].values_.has(t)?!1:Mp(Nf(e,t))}function Pd(e){return Nd(e)}function Fd(e,t){return Nd(e,t)}function Id(e,t){return e?t===void 0?Ef(e)||!!e[X]||rp(e)||Hp(e)||Mp(e):Ef(e)?e[X].values_.has(t):!1:!1}function Ld(e){return Id(e)}function Rd(e,t){return Id(e,t)}function zd(e){if(Ef(e))return e[X].keys_();if(wm(e)||Dm(e))return Array.from(e.keys());if(bf(e))return e.map(function(e,t){return t});J(5)}function Bd(e){if(Ef(e))return zd(e).map(function(t){return e[t]});if(wm(e))return zd(e).map(function(t){return e.get(t)});if(Dm(e))return Array.from(e.values());if(bf(e))return e.slice();J(6)}function Vd(e){if(Ef(e))return zd(e).map(function(t){return[t,e[t]]});if(wm(e))return zd(e).map(function(t){return[t,e.get(t)]});if(Dm(e))return Array.from(e.entries());if(bf(e))return e.map(function(e,t){return[t,e]});J(7)}function Hd(e,t,n){if(arguments.length===2&&!Dm(e)){Xu();var r=t;try{for(var i in r)Hd(e,i,r[i])}finally{Zu()}return}Ef(e)?e[X].set_(t,n):wm(e)?e.set(t,n):Dm(e)?e.add(t):bf(e)?(typeof t!=`number`&&(t=parseInt(t,10)),t<0&&J(`Invalid index: '`+t+`'`),Xu(),t>=e.length&&(e.length=t+1),e[t]=n,Zu()):J(8)}function Ud(e,t){Ef(e)?e[X].delete_(t):wm(e)||Dm(e)?e.delete(t):bf(e)?(typeof t!=`number`&&(t=parseInt(t,10)),e.splice(t,1)):J(9)}function Wd(e,t){if(Ef(e))return e[X].has_(t);if(wm(e)||Dm(e))return e.has(t);if(bf(e))return t>=0&&t<e.length;J(10)}function Gd(e,t){if(Wd(e,t)){if(Ef(e))return e[X].get_(t);if(wm(e))return e.get(t);if(bf(e))return e[t];J(11)}}function Kd(e,t,n){if(Ef(e))return e[X].defineProperty_(t,n);J(39)}function qd(e){if(Ef(e))return e[X].ownKeys_();J(38)}function Jd(e,t,n,r){return Qc(n)?Xd(e,t,n,r):Yd(e,t,n)}function Yd(e,t,n){return Pf(e).observe_(t,n)}function Xd(e,t,n,r){return Pf(e,t).observe_(n,r)}function Zd(e,t,n){return e.set(t,n),n}function Qd(e,t){if(typeof e!=`object`||!e||e instanceof Date||!Ld(e))return e;if(Ap(e)||Mp(e))return Qd(e.get(),t);if(t.has(e))return t.get(e);if(bf(e)){var n=Zd(t,e,Array(e.length));return e.forEach(function(e,r){n[r]=Qd(e,t)}),n}if(Dm(e)){var r=Zd(t,e,new Set);return e.forEach(function(e){r.add(Qd(e,t))}),r}if(wm(e)){var i=Zd(t,e,new Map);return e.forEach(function(e,n){i.set(n,Qd(e,t))}),i}else{var a=Zd(t,e,{});return qd(e).forEach(function(n){Kf.propertyIsEnumerable.call(e,n)&&(a[n]=Qd(e[n],t))}),a}}function $d(e,t){return Qd(e,new Map)}function ef(){}function tf(e,t){t===void 0&&(t=void 0),Xu();try{return e.apply(t)}finally{Zu()}}function nf(e,t,n){return arguments.length===1||t&&typeof t==`object`?af(e,t):rf(e,t,n||{})}function rf(e,t,n){var r;if(typeof n.timeout==`number`){var i=Error(`WHEN_TIMEOUT`);r=setTimeout(function(){if(!o[X].isDisposed)if(o(),n.onError)n.onError(i);else throw i},n.timeout)}n.name=`When`;var a=Cu(`When-effect`,t),o=dd(function(t){Du(!1,e)&&(t.dispose(),r&&clearTimeout(r),a())},n);return o}function af(e,t){var n;if(t!=null&&(n=t.signal)!=null&&n.aborted)return Object.assign(Promise.reject(Error(`WHEN_ABORTED`)),{cancel:function(){return null}});var r,i,a=new Promise(function(n,a){var o,s=rf(e,n,yl({},t,{onError:a}));r=function(){s(),a(Error(`WHEN_CANCELLED`))},i=function(){s(),a(Error(`WHEN_ABORTED`))},t==null||(o=t.signal)==null||o.addEventListener==null||o.addEventListener(`abort`,i)}).finally(function(){var e;return t==null||(e=t.signal)==null||e.removeEventListener==null?void 0:e.removeEventListener(`abort`,i)});return a.cancel=r,a}function of(e){return e[X]}function sf(e,t){var n;return Xc(),e=wf(e,t),(n=e[X]).proxy_??(n.proxy_=new Proxy(e,dm))}function cf(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function lf(e,t){var n=e.interceptors_||=[];return n.push(t),Zc(function(){var e=n.indexOf(t);e!==-1&&n.splice(e,1)})}function uf(e,t){var n=Lu();try{for(var r=[].concat(e.interceptors_||[]),i=0,a=r.length;i<a&&(t=r[i](t),t&&!t.type&&J(14),t);i++);return t}finally{Ru(n)}}function df(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function ff(e,t){var n=e.changeListeners_||=[];return n.push(t),Zc(function(){var e=n.indexOf(t);e!==-1&&n.splice(e,1)})}function pf(e,t){var n=Lu(),r=e.changeListeners_;if(r){r=r.slice();for(var i=0,a=r.length;i<a;i++)r[i](t);Ru(n)}}function mf(e,t,n){return If(function(){var r=wf(e,n)[X];t??=jl(e),$f(t).forEach(function(e){return r.make_(e,t[e])})}),e}function hf(e,t,n){return tl(e)?yd(e,e,t,n):(If(function(){var r=wf(e,n)[X];if(!e[fm]){var i=Object.getPrototypeOf(e),a=new Set([].concat($f(e),$f(i)));a.delete(`constructor`),a.delete(X),rl(i,fm,a)}e[fm].forEach(function(e){return r.make_(e,t&&e in t?t[e]:!0)})}),e)}function gf(e,t,n,r){return n===void 0&&(n=`ObservableArray`),r===void 0&&(r=!1),Xc(),If(function(){var i=new _m(n,t,r,!1);il(i.values_,X,i);var a=new Proxy(i.values_,gm);return i.proxy_=a,e&&e.length&&i.spliceWithArray_(0,0,e),a})}function Y(e,t){typeof Array.prototype[e]==`function`&&(vm[e]=t(e))}function _f(e){return function(){var t=this[X];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_);return n[e].apply(n,arguments)}}function vf(e){return function(t,n){var r=this,i=this[X];return i.atom_.reportObserved(),i.dehanceValues_(i.values_)[e](function(e,i){return t.call(n,e,i,r)})}}function yf(e){return function(){var t=this,n=this[X];n.atom_.reportObserved();var r=n.dehanceValues_(n.values_),i=arguments[0];return arguments[0]=function(e,n,r){return i(e,n,r,t)},r[e].apply(r,arguments)}}function bf(e){return el(e)&&ym(e[X])}function xf(e){return e[Symbol.toStringTag]=`MapIterator`,Bf(e)}function Sf(e){if(ol(e)||wm(e))return e;if(Array.isArray(e))return new Map(e);if(tl(e)){var t=new Map;for(var n in e)t.set(n,e[n]);return t}else return J(21,e)}function Cf(e){return e[Symbol.toStringTag]=`SetIterator`,Bf(e)}function wf(e,t){if(dl(e,X))return e;var n=t?.name??`ObservableObject`;return rl(e,X,new Am(e,new Map,String(n),bu(t))),e}function Tf(e){return Om[e]||(Om[e]={get:function(){return this[X].getObservablePropValue_(e)},set:function(t){return this[X].setObservablePropValue_(e,t)}})}function Ef(e){return el(e)?jm(e[X]):!1}function Df(e,t,n){var r;(r=e.target_[tp])==null||delete r[n]}function Of(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__===void 0?e.prototype=t:e.prototype.__proto__=t}function kf(e){return{enumerable:!1,configurable:!0,get:function(){return this[X].get_(e)},set:function(t){this[X].set_(e,t)}}}function Af(e){Gf(Im.prototype,``+e,kf(e))}function jf(e){if(e>Pm){for(var t=Pm;t<e+100;t++)Af(t);Pm=e}}function Mf(e,t,n){return new Im(e,t,n)}function Nf(e,t){if(typeof e==`object`&&e){if(bf(e))return t!==void 0&&J(23),e[X].atom_;if(Dm(e))return e.atom_;if(wm(e)){if(t===void 0)return e.keysAtom_;var n=e.data_.get(t)||e.hasMap_.get(t);return n||J(25,t,Ff(e)),n}if(Ef(e)){if(!t)return J(26);var r=e[X].values_.get(t);return r||J(27,t,Ff(e)),r}if(rp(e)||Mp(e)||Hp(e))return e}else if(Qc(e)&&Hp(e[X]))return e[X];J(28)}function Pf(e,t){if(e||J(29),t!==void 0)return Pf(Nf(e,t));if(rp(e)||Mp(e)||Hp(e)||wm(e)||Dm(e))return e;if(e[X])return e[X];J(24,e)}function Ff(e,t){var n;if(t!==void 0)n=Nf(e,t);else if(ud(e))return e.name;else n=Ef(e)||wm(e)||Dm(e)?Pf(e):Nf(e);return n.name_}function If(e){var t=Lu(),n=Ou(!0);Xu();try{return e()}finally{Zu(),ku(n),Ru(t)}}function Lf(e,t,n){return n===void 0&&(n=-1),Rf(e,t,n)}function Rf(e,t,n,r,i){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var a=typeof e;if(a!==`function`&&a!==`object`&&typeof t!=`object`)return!1;var o=Lm.call(e);if(o!==Lm.call(t))return!1;switch(o){case`[object RegExp]`:case`[object String]`:return``+e==``+t;case`[object Number]`:return+e==+e?+e==0?1/e==1/t:+e==+t:+t!=+t;case`[object Date]`:case`[object Boolean]`:return+e==+t;case`[object Symbol]`:return typeof Symbol<`u`&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case`[object Map]`:case`[object Set]`:n>=0&&n++;break}e=zf(e),t=zf(t);var s=o===`[object Array]`;if(!s){if(typeof e!=`object`||typeof t!=`object`)return!1;var c=e.constructor,l=t.constructor;if(c!==l&&!(Qc(c)&&c instanceof c&&Qc(l)&&l instanceof l)&&`constructor`in e&&`constructor`in t)return!1}if(n===0)return!1;n<0&&(n=-1),r||=[],i||=[];for(var u=r.length;u--;)if(r[u]===e)return i[u]===t;if(r.push(e),i.push(t),s){if(u=e.length,u!==t.length)return!1;for(;u--;)if(!Rf(e[u],t[u],n-1,r,i))return!1}else{var d=Object.keys(e),f=d.length;if(Object.keys(t).length!==f)return!1;for(var p=0;p<f;p++){var m=d[p];if(!(dl(t,m)&&Rf(e[m],t[m],n-1,r,i)))return!1}}return r.pop(),i.pop(),!0}function zf(e){return bf(e)?e.slice():ol(e)||wm(e)||cl(e)||Dm(e)?Array.from(e.entries()):e}function Bf(e){return e[Symbol.iterator]=Vf,Object.assign(Object.create(Rm),e)}function Vf(){return this}var Hf,Uf,Wf,Gf,Kf,qf,Jf,Yf,Xf,Zf,Qf,$f,ep,tp,X,np,rp,ip,ap,op,sp,cp,lp,up,dp,fp,pp,mp,hp,gp,_p,vp,yp,bp,xp,Sp,Cp,wp,Tp,Ep,Dp,Op,kp,Ap,jp,Mp,Z,Np,Pp,Fp,Ip,Lp,Rp,Q,zp,Bp,Vp,Hp,Up,Wp,Gp,Kp,qp,Jp,Yp,Xp,Zp,Qp,$p,em,tm,nm,rm,im,am,om,sm,cm,lm,um,dm,fm,pm,mm,hm,gm,_m,vm,ym,bm,xm,Sm,Cm,wm,Tm,Em,Dm,Om,km,Am,jm,Mm,Nm,Pm,Fm,Im,Lm,Rm,zm=t((()=>{m(),Hf={},Uf=Object.assign,Wf=Object.getOwnPropertyDescriptor,Gf=Object.defineProperty,Kf=Object.prototype,qf=[],Object.freeze(qf),Jf={},Object.freeze(Jf),Yf=typeof Proxy<`u`,Xf=Object.toString(),Zf=function(){},Qf=Object.getOwnPropertySymbols!==void 0,$f=typeof Reflect<`u`&&Reflect.ownKeys?Reflect.ownKeys:Qf?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,ep=Object.getOwnPropertyDescriptors||function(e){var t={};return $f(e).forEach(function(n){t[n]=Wf(e,n)}),t},tp=Symbol(`mobx-stored-annotations`),X=Symbol(`mobx administration`),np=function(){function e(e){e===void 0&&(e=`Atom`),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=Z.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=e}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(e){return e()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(e){return e()})},t.reportObserved=function(){return Qu(this)},t.reportChanged=function(){Xu(),$u(this),Zu()},t.toString=function(){return this.name_},_l(e,[{key:`isBeingObserved`,get:function(){return fl(this.flags_,e.isBeingObservedMask_)},set:function(t){this.flags_=pl(this.flags_,e.isBeingObservedMask_,t)}},{key:`isPendingUnobservation`,get:function(){return fl(this.flags_,e.isPendingUnobservationMask_)},set:function(t){this.flags_=pl(this.flags_,e.isPendingUnobservationMask_,t)}},{key:`diffValue`,get:function(){return+!!fl(this.flags_,e.diffValueMask_)},set:function(t){this.flags_=pl(this.flags_,e.diffValueMask_,t===1)}}])}(),np.isBeingObservedMask_=1,np.isPendingUnobservationMask_=2,np.diffValueMask_=4,rp=al(`Atom`,np),ip={identity:Pl,structural:Fl,default:Ll,shallow:Il},ap=`override`,op=kl({annotationType_:ap,make_:Ul,extend_:Wl,decorate_20223_:Gl}),sp=`true`,cp=mu(),lp=`observable`,up=`observable.ref`,dp=`observable.shallow`,fp=`observable.struct`,pp={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0},Object.freeze(pp),mp=lu(lp),hp=lu(up,{enhancer:Bl}),gp=lu(dp,{enhancer:zl}),_p=lu(fp,{enhancer:Vl}),vp=kl(mp),Uf(Su,vp),yp=Uf(Su,{box:function(e,t){var n=vu(t);return new kp(e,yu(n),n.name,!0,n.equals)},array:function(e,t){var n=vu(t);return(Q.useProxies===!1||n.proxy===!1?Mf:gf)(e,yu(n),n.name)},map:function(e,t){var n=vu(t);return new Cm(e,yu(n),n.name)},set:function(e,t){var n=vu(t);return new Em(e,yu(n),n.name)},object:function(e,t,n){return If(function(){return yd(Q.useProxies===!1||n?.proxy===!1?wf({},n):sf({},n),e,t)})},ref:kl(hp),shallow:kl(gp),deep:vp,struct:kl(_p)}),bp=`computed`,xp=`computed.struct`,Sp=iu(bp),Cp=iu(xp,{equals:ip.structural}),wp=function(e,t){if(Ml(t))return Sp.decorate_20223_(e,t);if($c(t))return Al(e,t,Sp);if(tl(e))return kl(iu(bp,e));var n=tl(t)?t:{};return n.get=e,n.name||=e.name||``,new jp(n)},Object.assign(wp,Sp),wp.struct=kl(Cp),Tp=0,Ep=1,Dp=Wf(function(){},`name`)?.configurable??!1,Op={value:`action`,configurable:!0,writable:!1,enumerable:!1},kp=function(e){function t(t,n,r,i,a){var o;return r===void 0&&(r=`ObservableValue`),i===void 0&&(i=!0),a===void 0&&(a=ip.default),o=e.call(this,r)||this,o.enhancer=void 0,o.name_=void 0,o.equals=void 0,o.hasUnreportedChange_=!1,o.interceptors_=void 0,o.changeListeners_=void 0,o.value_=void 0,o.dehancer=void 0,o.enhancer=n,o.name_=r,o.equals=a,o.value_=n(t,void 0,r),o}xl(t,e);var n=t.prototype;return n.dehanceValue=function(e){return this.dehancer===void 0?e:this.dehancer(e)},n.set=function(e){this.value_,e=this.prepareNewValue_(e),e!==Q.UNCHANGED&&this.setNewValue_(e)},n.prepareNewValue_=function(e){if(cf(this)){var t=uf(this,{object:this,type:mm,newValue:e});if(!t)return Q.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value_,this.name_),this.equals(this.value_,e)?Q.UNCHANGED:e},n.setNewValue_=function(e){var t=this.value_;this.value_=e,this.reportChanged(),df(this)&&pf(this,{type:mm,object:this,newValue:e,oldValue:t})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(e){return lf(this,e)},n.observe_=function(e,t){return t&&e({observableKind:`value`,debugObjectName:this.name_,object:this,type:mm,newValue:this.value_,oldValue:void 0}),ff(this,e)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+`[`+this.value_+`]`},n.valueOf=function(){return ul(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},t}(np),Ap=al(`ObservableValue`,kp),jp=function(){function e(e){this.dependenciesState_=Z.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Z.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new Pp(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=Np.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,e.get||J(31),this.derivation=e.get,this.name_=e.name||`ComputedValue`,e.set&&(this.setter_=Cu(`ComputedValue-setter`,e.set)),this.equals_=e.equals||(e.compareStructural||e.struct?ip.structural:ip.default),this.scope_=e.context,this.requiresReaction_=e.requiresReaction,this.keepAlive_=!!e.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){td(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(e){return e()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(e){return e()})},t.get=function(){if(this.isComputing&&J(32,this.name_,this.derivation),Q.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)ju(this)&&(this.warnAboutUntrackedRead_(),Xu(),this.value_=this.computeValue_(!1),Zu());else if(Qu(this),ju(this)){var e=Q.trackingContext;this.keepAlive_&&!e&&(Q.trackingContext=this),this.trackAndCompute()&&ed(this),Q.trackingContext=e}var t=this.value_;if(Au(t))throw t.cause;return t},t.set=function(e){if(this.setter_){this.isRunningSetter&&J(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,e)}finally{this.isRunningSetter=!1}}else J(34,this.name_)},t.trackAndCompute=function(){var e=this.value_,t=this.dependenciesState_===Z.NOT_TRACKING_,n=this.computeValue_(!0),r=t||Au(e)||Au(n)||!this.equals_(e,n);return r&&(this.value_=n),r},t.computeValue_=function(e){this.isComputing=!0;var t=Ou(!1),n;if(e)n=Nu(this,this.derivation,this.scope_);else if(Q.disableErrorBoundaries===!0)n=this.derivation.call(this.scope_);else try{n=this.derivation.call(this.scope_)}catch(e){n=new Pp(e)}return ku(t),this.isComputing=!1,n},t.suspend_=function(){this.keepAlive_||(Fu(this),this.value_=void 0)},t.observe_=function(e,t){var n=this,r=!0,i=void 0;return dd(function(){var a=n.get();if(!r||t){var o=Lu();e({observableKind:`computed`,debugObjectName:n.name_,type:mm,object:n,newValue:a,oldValue:i}),Ru(o)}r=!1,i=a})},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+`[`+this.derivation.toString()+`]`},t.valueOf=function(){return ul(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},_l(e,[{key:`isComputing`,get:function(){return fl(this.flags_,e.isComputingMask_)},set:function(t){this.flags_=pl(this.flags_,e.isComputingMask_,t)}},{key:`isRunningSetter`,get:function(){return fl(this.flags_,e.isRunningSetterMask_)},set:function(t){this.flags_=pl(this.flags_,e.isRunningSetterMask_,t)}},{key:`isBeingObserved`,get:function(){return fl(this.flags_,e.isBeingObservedMask_)},set:function(t){this.flags_=pl(this.flags_,e.isBeingObservedMask_,t)}},{key:`isPendingUnobservation`,get:function(){return fl(this.flags_,e.isPendingUnobservationMask_)},set:function(t){this.flags_=pl(this.flags_,e.isPendingUnobservationMask_,t)}},{key:`diffValue`,get:function(){return+!!fl(this.flags_,e.diffValueMask_)},set:function(t){this.flags_=pl(this.flags_,e.diffValueMask_,t===1)}}])}(),jp.isComputingMask_=1,jp.isRunningSetterMask_=2,jp.isBeingObservedMask_=4,jp.isPendingUnobservationMask_=8,jp.diffValueMask_=16,Mp=al(`ComputedValue`,jp),(function(e){e[e.NOT_TRACKING_=-1]=`NOT_TRACKING_`,e[e.UP_TO_DATE_=0]=`UP_TO_DATE_`,e[e.POSSIBLY_STALE_=1]=`POSSIBLY_STALE_`,e[e.STALE_=2]=`STALE_`})(Z||={}),(function(e){e[e.NONE=0]=`NONE`,e[e.LOG=1]=`LOG`,e[e.BREAK=2]=`BREAK`})(Np||={}),Pp=function(e){this.cause=void 0,this.cause=e},Fp=[`mobxGuid`,`spyListeners`,`enforceActions`,`computedRequiresReaction`,`reactionRequiresObservable`,`observableRequiresReaction`,`allowStateReads`,`disableErrorBoundaries`,`runId`,`UNCHANGED`,`useProxies`],Ip=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},Lp=!0,Rp=!1,Q=function(){var e=Yc();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Lp=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new Ip().version&&(Lp=!1),Lp?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Ip):(setTimeout(function(){Rp||J(35)},1),new Ip)}(),zp=function(){function e(e,t,n,r){e===void 0&&(e=`Reaction`),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Z.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=Np.NONE,this.name_=e,this.onInvalidate_=t,this.errorHandler_=n,this.requiresObservable_=r}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled||(this.isScheduled=!0,Q.pendingReactions.push(this),rd())},t.runReaction_=function(){if(!this.isDisposed){Xu(),this.isScheduled=!1;var e=Q.trackingContext;if(Q.trackingContext=this,ju(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(e){this.reportExceptionInDerivation_(e)}}Q.trackingContext=e,Zu()}},t.track=function(e){if(!this.isDisposed){Xu(),this.isRunning=!0;var t=Q.trackingContext;Q.trackingContext=this;var n=Nu(this,e,void 0);Q.trackingContext=t,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&Fu(this),Au(n)&&this.reportExceptionInDerivation_(n.cause),Zu()}},t.reportExceptionInDerivation_=function(e){var t=this;if(this.errorHandler_){this.errorHandler_(e,this);return}if(Q.disableErrorBoundaries)throw e;``+this,Q.suppressReactionErrors,Q.globalReactionErrorHandlers.forEach(function(n){return n(e,t)})},t.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(Xu(),Fu(this),Zu()))},t.getDisposer_=function(e){var t=this,n=function n(){t.dispose(),e==null||e.removeEventListener==null||e.removeEventListener(`abort`,n)};return e==null||e.addEventListener==null||e.addEventListener(`abort`,n),n[X]=this,`dispose`in Symbol&&typeof Symbol.dispose==`symbol`&&(n[Symbol.dispose]=n),n},t.toString=function(){return`Reaction[`+this.name_+`]`},t.trace=function(e){e===void 0&&(e=!1)},_l(e,[{key:`isDisposed`,get:function(){return fl(this.flags_,e.isDisposedMask_)},set:function(t){this.flags_=pl(this.flags_,e.isDisposedMask_,t)}},{key:`isScheduled`,get:function(){return fl(this.flags_,e.isScheduledMask_)},set:function(t){this.flags_=pl(this.flags_,e.isScheduledMask_,t)}},{key:`isTrackPending`,get:function(){return fl(this.flags_,e.isTrackPendingMask_)},set:function(t){this.flags_=pl(this.flags_,e.isTrackPendingMask_,t)}},{key:`isRunning`,get:function(){return fl(this.flags_,e.isRunningMask_)},set:function(t){this.flags_=pl(this.flags_,e.isRunningMask_,t)}},{key:`diffValue`,get:function(){return+!!fl(this.flags_,e.diffValueMask_)},set:function(t){this.flags_=pl(this.flags_,e.diffValueMask_,t===1)}}])}(),zp.isDisposedMask_=1,zp.isScheduledMask_=2,zp.isTrackPendingMask_=4,zp.isRunningMask_=8,zp.diffValueMask_=16,Bp=100,Vp=function(e){return e()},Hp=al(`Reaction`,zp),Up=`action`,Wp=`action.bound`,Gp=`autoAction`,Kp=`autoAction.bound`,qp=`<unnamed action>`,Jp=Kl(Up),Yp=Kl(Wp,{bound:!0}),Xp=Kl(Gp,{autoAction:!0}),Zp=Kl(Kp,{autoAction:!0,bound:!0}),Qp=cd(!1),Object.assign(Qp,Jp),$p=cd(!0),Object.assign($p,Xp),Qp.bound=kl(Yp),$p.bound=kl(Zp),em=function(e){return e()},tm=`onBO`,nm=`onBUO`,rm=`never`,im=`always`,am=`observed`,om=0,sm=function(e){function t(){var n=e.call(this,`FLOW_CANCELLED`)||this;return Object.setPrototypeOf(n,(this instanceof t?this.constructor:void 0).prototype),n.name=`FlowCancellationError`,n}xl(t,e);var n=t.prototype;return n.toString=function(){return`Error: `+this.message},t}(Ol(Error)),cm=Ql(`flow`),lm=Ql(`flow.bound`,{bound:!0}),um=Object.assign(function(e,t){if(Ml(t))return cm.decorate_20223_(e,t);if($c(t))return Al(e,t,cm);var n=e,r=n.name||`<unnamed flow>`,i=function(){var e=this,t=arguments,i=++om,a=Qp(r+` - runid: `+i+` - init`,n).apply(e,t),o,s=void 0,c=new Promise(function(e,t){var n=0;o=t;function c(e){s=void 0;var o;try{o=Qp(r+` - runid: `+i+` - yield `+ n++,a.next).call(a,e)}catch(e){return t(e)}u(o)}function l(e){s=void 0;var o;try{o=Qp(r+` - runid: `+i+` - yield `+ n++,a.throw).call(a,e)}catch(e){return t(e)}u(o)}function u(n){if(Qc(n?.then)){n.then(u,t);return}return n.done?e(n.value):(s=Promise.resolve(n.value),s.then(c,l))}c(void 0)});return c.cancel=Qp(r+` - runid: `+i+` - cancel`,function(){try{s&&Ed(s);var e=a.return(void 0),t=Promise.resolve(e.value);t.then(Zf,Zf),Ed(t),o(new sm)}catch(e){o(e)}}),c};return i.isMobXFlow=!0,i},cm),um.bound=kl(lm),dm={has:function(e,t){return of(e).has_(t)},get:function(e,t){return of(e).get_(t)},set:function(e,t,n){return $c(t)?of(e).set_(t,n,!0)??!0:!1},deleteProperty:function(e,t){return $c(t)?of(e).delete_(t,!0)??!0:!1},defineProperty:function(e,t,n){return of(e).defineProperty_(t,n)??!0},ownKeys:function(e){return of(e).ownKeys_()},preventExtensions:function(e){J(13)}},fm=Symbol(`mobx-keys`),pm=`splice`,mm=`update`,hm=1e4,gm={get:function(e,t){var n=e[X];return t===X?n:t===`length`?n.getArrayLength_():typeof t==`string`&&!isNaN(t)?n.get_(parseInt(t)):dl(vm,t)?vm[t]:e[t]},set:function(e,t,n){var r=e[X];return t===`length`&&r.setArrayLength_(n),typeof t==`symbol`||isNaN(t)?e[t]=n:r.set_(parseInt(t),n),!0},preventExtensions:function(){J(15)}},_m=function(){function e(e,t,n,r){e===void 0&&(e=`ObservableArray`),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=n,this.legacyMode_=r,this.atom_=new np(e),this.enhancer_=function(e,n){return t(e,n,`ObservableArray[..]`)}}var t=e.prototype;return t.dehanceValue_=function(e){return this.dehancer===void 0?e:this.dehancer(e)},t.dehanceValues_=function(e){return this.dehancer!==void 0&&e.length>0?e.map(this.dehancer):e},t.intercept_=function(e){return lf(this,e)},t.observe_=function(e,t){return t===void 0&&(t=!1),t&&e({observableKind:`array`,object:this.proxy_,debugObjectName:this.atom_.name_,type:`splice`,index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),ff(this,e)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(e){(typeof e!=`number`||isNaN(e)||e<0)&&J(`Out of range: `+e);var t=this.values_.length;if(e!==t)if(e>t){for(var n=Array(e-t),r=0;r<e-t;r++)n[r]=void 0;this.spliceWithArray_(t,0,n)}else this.spliceWithArray_(e,t-e)},t.updateArrayLength_=function(e,t){e!==this.lastKnownLength_&&J(16),this.lastKnownLength_+=t,this.legacyMode_&&t>0&&jf(e+t+1)},t.spliceWithArray_=function(e,t,n){var r=this;this.atom_;var i=this.values_.length;if(e===void 0?e=0:e>i?e=i:e<0&&(e=Math.max(0,i+e)),t=arguments.length===1?i-e:t==null?0:Math.max(0,Math.min(t,i-e)),n===void 0&&(n=qf),cf(this)){var a=uf(this,{object:this.proxy_,type:pm,index:e,removedCount:t,added:n});if(!a)return qf;t=a.removedCount,n=a.added}if(n=n.length===0?n:n.map(function(e){return r.enhancer_(e,void 0)}),this.legacyMode_){var o=n.length-t;this.updateArrayLength_(i,o)}var s=this.spliceItemsIntoValues_(e,t,n);return(t!==0||n.length!==0)&&this.notifyArraySplice_(e,n,s),this.dehanceValues_(s)},t.spliceItemsIntoValues_=function(e,t,n){if(n.length<hm){var r;return(r=this.values_).splice.apply(r,[e,t].concat(n))}else{var i=this.values_.slice(e,e+t),a=this.values_.slice(e+t);this.values_.length+=n.length-t;for(var o=0;o<n.length;o++)this.values_[e+o]=n[o];for(var s=0;s<a.length;s++)this.values_[e+n.length+s]=a[s];return i}},t.notifyArrayChildUpdate_=function(e,t,n){var r=!this.owned_&&od(),i=df(this),a=i||r?{observableKind:`array`,object:this.proxy_,type:mm,debugObjectName:this.atom_.name_,index:e,newValue:t,oldValue:n}:null;this.atom_.reportChanged(),i&&pf(this,a)},t.notifyArraySplice_=function(e,t,n){var r=!this.owned_&&od(),i=df(this),a=i||r?{observableKind:`array`,object:this.proxy_,debugObjectName:this.atom_.name_,type:pm,index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;this.atom_.reportChanged(),i&&pf(this,a)},t.get_=function(e){if(!(this.legacyMode_&&e>=this.values_.length))return this.atom_.reportObserved(),this.dehanceValue_(this.values_[e])},t.set_=function(e,t){var n=this.values_;if(this.legacyMode_&&e>n.length&&J(17,e,n.length),e<n.length){this.atom_;var r=n[e];if(cf(this)){var i=uf(this,{type:mm,object:this.proxy_,index:e,newValue:t});if(!i)return;t=i.newValue}t=this.enhancer_(t,r),t!==r&&(n[e]=t,this.notifyArrayChildUpdate_(e,t,r))}else{for(var a=Array(e+1-n.length),o=0;o<a.length-1;o++)a[o]=void 0;a[a.length-1]=t,this.spliceWithArray_(n.length,0,a)}},e}(),vm={clear:function(){return this.splice(0)},replace:function(e){var t=this[X];return t.spliceWithArray_(0,t.values_.length,e)},toJSON:function(){return this.slice()},splice:function(e,t){var n=[...arguments].slice(2),r=this[X];switch(arguments.length){case 0:return[];case 1:return r.spliceWithArray_(e);case 2:return r.spliceWithArray_(e,t)}return r.spliceWithArray_(e,t,n)},spliceWithArray:function(e,t,n){return this[X].spliceWithArray_(e,t,n)},push:function(){var e=this[X],t=[...arguments];return e.spliceWithArray_(e.values_.length,0,t),e.values_.length},pop:function(){return this.splice(Math.max(this[X].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){var e=this[X],t=[...arguments];return e.spliceWithArray_(0,0,t),e.values_.length},reverse:function(){return Q.trackingDerivation&&J(37,`reverse`),this.replace(this.slice().reverse()),this},sort:function(){Q.trackingDerivation&&J(37,`sort`);var e=this.slice();return e.sort.apply(e,arguments),this.replace(e),this},remove:function(e){var t=this[X],n=t.dehanceValues_(t.values_).indexOf(e);return n>-1?(this.splice(n,1),!0):!1}},Y(`at`,_f),Y(`concat`,_f),Y(`flat`,_f),Y(`includes`,_f),Y(`indexOf`,_f),Y(`join`,_f),Y(`lastIndexOf`,_f),Y(`slice`,_f),Y(`toString`,_f),Y(`toLocaleString`,_f),Y(`toSorted`,_f),Y(`toSpliced`,_f),Y(`with`,_f),Y(`every`,vf),Y(`filter`,vf),Y(`find`,vf),Y(`findIndex`,vf),Y(`findLast`,vf),Y(`findLastIndex`,vf),Y(`flatMap`,vf),Y(`forEach`,vf),Y(`map`,vf),Y(`some`,vf),Y(`toReversed`,vf),Y(`reduce`,yf),Y(`reduceRight`,yf),ym=al(`ObservableArrayAdministration`,_m),bm={},xm=`add`,Sm=`delete`,Cm=function(){function e(e,t,n){var r=this;t===void 0&&(t=Rl),n===void 0&&(n=`ObservableMap`),this.enhancer_=void 0,this.name_=void 0,this[X]=bm,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=t,this.name_=n,Qc(Map)||J(18),If(function(){r.keysAtom_=Nl(`ObservableMap.keys()`),r.data_=new Map,r.hasMap_=new Map,e&&r.merge(e)})}var t=e.prototype;return t.has_=function(e){return this.data_.has(e)},t.has=function(e){var t=this;if(!Q.trackingDerivation)return this.has_(e);var n=this.hasMap_.get(e);if(!n){var r=n=new kp(this.has_(e),Bl,`ObservableMap.key?`,!1);this.hasMap_.set(e,r),gd(r,function(){return t.hasMap_.delete(e)})}return n.get()},t.set=function(e,t){var n=this.has_(e);if(cf(this)){var r=uf(this,{type:n?mm:xm,object:this,newValue:t,name:e});if(!r)return this;t=r.newValue}return n?this.updateValue_(e,t):this.addValue_(e,t),this},t.delete=function(e){var t=this;if(this.keysAtom_,cf(this)&&!uf(this,{type:Sm,object:this,name:e}))return!1;if(this.has_(e)){var n=od(),r=df(this),i=r||n?{observableKind:`map`,debugObjectName:this.name_,type:Sm,object:this,oldValue:this.data_.get(e).value_,name:e}:null;return tf(function(){var n;t.keysAtom_.reportChanged(),(n=t.hasMap_.get(e))==null||n.setNewValue_(!1),t.data_.get(e).setNewValue_(void 0),t.data_.delete(e)}),r&&pf(this,i),!0}return!1},t.updateValue_=function(e,t){var n=this.data_.get(e);if(t=n.prepareNewValue_(t),t!==Q.UNCHANGED){var r=od(),i=df(this),a=i||r?{observableKind:`map`,debugObjectName:this.name_,type:mm,object:this,oldValue:n.value_,name:e,newValue:t}:null;n.setNewValue_(t),i&&pf(this,a)}},t.addValue_=function(e,t){var n=this;this.keysAtom_,tf(function(){var r,i=new kp(t,n.enhancer_,`ObservableMap.key`,!1);n.data_.set(e,i),t=i.value_,(r=n.hasMap_.get(e))==null||r.setNewValue_(!0),n.keysAtom_.reportChanged()});var r=od(),i=df(this),a=i||r?{observableKind:`map`,debugObjectName:this.name_,type:xm,object:this,name:e,newValue:t}:null;i&&pf(this,a)},t.get=function(e){return this.has(e)?this.dehanceValue_(this.data_.get(e).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(e){return this.dehancer===void 0?e:this.dehancer(e)},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var e=this,t=this.keys();return xf({next:function(){var n=t.next(),r=n.done,i=n.value;return{done:r,value:r?void 0:e.get(i)}}})},t.entries=function(){var e=this,t=this.keys();return xf({next:function(){var n=t.next(),r=n.done,i=n.value;return{done:r,value:r?void 0:[i,e.get(i)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(e,t){for(var n=vl(this),r;!(r=n()).done;){var i=r.value,a=i[0],o=i[1];e.call(t,o,a,this)}},t.merge=function(e){var t=this;return wm(e)&&(e=new Map(e)),tf(function(){tl(e)?ll(e).forEach(function(n){return t.set(n,e[n])}):Array.isArray(e)?e.forEach(function(e){var n=e[0],r=e[1];return t.set(n,r)}):ol(e)?(sl(e)||J(19,e),e.forEach(function(e,n){return t.set(n,e)})):e!=null&&J(20,e)}),this},t.clear=function(){var e=this;tf(function(){Iu(function(){for(var t=vl(e.keys()),n;!(n=t()).done;){var r=n.value;e.delete(r)}})})},t.replace=function(e){var t=this;return tf(function(){for(var n=Sf(e),r=new Map,i=!1,a=vl(t.data_.keys()),o;!(o=a()).done;){var s=o.value;if(!n.has(s))if(t.delete(s))i=!0;else{var c=t.data_.get(s);r.set(s,c)}}for(var l=vl(n.entries()),u;!(u=l()).done;){var d=u.value,f=d[0],p=d[1],m=t.data_.has(f);if(t.set(f,p),t.data_.has(f)){var h=t.data_.get(f);r.set(f,h),m||(i=!0)}}if(!i)if(t.data_.size!==r.size)t.keysAtom_.reportChanged();else for(var g=t.data_.keys(),_=r.keys(),v=g.next(),y=_.next();!v.done;){if(v.value!==y.value){t.keysAtom_.reportChanged();break}v=g.next(),y=_.next()}t.data_=r}),this},t.toString=function(){return`[object ObservableMap]`},t.toJSON=function(){return Array.from(this)},t.observe_=function(e,t){return ff(this,e)},t.intercept_=function(e){return lf(this,e)},_l(e,[{key:`size`,get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return`Map`}}])}(),wm=al(`ObservableMap`,Cm),Tm={},Em=function(){function e(e,t,n){var r=this;t===void 0&&(t=Rl),n===void 0&&(n=`ObservableSet`),this.name_=void 0,this[X]=Tm,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=n,Qc(Set)||J(22),this.enhancer_=function(e,r){return t(e,r,n)},If(function(){r.atom_=Nl(r.name_),e&&r.replace(e)})}var t=e.prototype;return t.dehanceValue_=function(e){return this.dehancer===void 0?e:this.dehancer(e)},t.clear=function(){var e=this;tf(function(){Iu(function(){for(var t=vl(e.data_.values()),n;!(n=t()).done;){var r=n.value;e.delete(r)}})})},t.forEach=function(e,t){for(var n=vl(this),r;!(r=n()).done;){var i=r.value;e.call(t,i,i,this)}},t.add=function(e){var t=this;if(this.atom_,cf(this)){var n=uf(this,{type:xm,object:this,newValue:e});if(!n)return this;e=n.newValue}if(!this.has(e)){tf(function(){t.data_.add(t.enhancer_(e,void 0)),t.atom_.reportChanged()});var r=!1,i=df(this),a=i||r?{observableKind:`set`,debugObjectName:this.name_,type:xm,object:this,newValue:e}:null;i&&pf(this,a)}return this},t.delete=function(e){var t=this;if(cf(this)&&!uf(this,{type:Sm,object:this,oldValue:e}))return!1;if(this.has(e)){var n=!1,r=df(this),i=r||n?{observableKind:`set`,debugObjectName:this.name_,type:Sm,object:this,oldValue:e}:null;return tf(function(){t.atom_.reportChanged(),t.data_.delete(e)}),r&&pf(this,i),!0}return!1},t.has=function(e){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(e))},t.entries=function(){var e=this.values();return Cf({next:function(){var t=e.next(),n=t.value,r=t.done;return r?{value:void 0,done:r}:{value:[n,n],done:r}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var e=this,t=this.data_.values();return Cf({next:function(){var n=t.next(),r=n.value,i=n.done;return i?{value:void 0,done:i}:{value:e.dehanceValue_(r),done:i}}})},t.intersection=function(e){return cl(e)&&!Dm(e)?e.intersection(this):new Set(this).intersection(e)},t.union=function(e){return cl(e)&&!Dm(e)?e.union(this):new Set(this).union(e)},t.difference=function(e){return new Set(this).difference(e)},t.symmetricDifference=function(e){return cl(e)&&!Dm(e)?e.symmetricDifference(this):new Set(this).symmetricDifference(e)},t.isSubsetOf=function(e){return new Set(this).isSubsetOf(e)},t.isSupersetOf=function(e){return new Set(this).isSupersetOf(e)},t.isDisjointFrom=function(e){return cl(e)&&!Dm(e)?e.isDisjointFrom(this):new Set(this).isDisjointFrom(e)},t.replace=function(e){var t=this;return Dm(e)&&(e=new Set(e)),tf(function(){Array.isArray(e)||cl(e)?(t.clear(),e.forEach(function(e){return t.add(e)})):e!=null&&J(`Cannot initialize set from `+e)}),this},t.observe_=function(e,t){return ff(this,e)},t.intercept_=function(e){return lf(this,e)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return`[object ObservableSet]`},t[Symbol.iterator]=function(){return this.values()},_l(e,[{key:`size`,get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return`Set`}}])}(),Dm=al(`ObservableSet`,Em),Om=Object.create(null),km=`remove`,Am=function(){function e(e,t,n,r){t===void 0&&(t=new Map),r===void 0&&(r=cp),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=e,this.values_=t,this.name_=n,this.defaultAnnotation_=r,this.keysAtom_=new np(`ObservableObject.keys`),this.isPlainObject_=tl(this.target_)}var t=e.prototype;return t.getObservablePropValue_=function(e){return this.values_.get(e).get()},t.setObservablePropValue_=function(e,t){var n=this.values_.get(e);if(n instanceof jp)return n.set(t),!0;if(cf(this)){var r=uf(this,{type:mm,object:this.proxy_||this.target_,name:e,newValue:t});if(!r)return null;t=r.newValue}if(t=n.prepareNewValue_(t),t!==Q.UNCHANGED){var i=df(this),a=i?{type:mm,observableKind:`object`,debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:n.value_,name:e,newValue:t}:null;n.setNewValue_(t),i&&pf(this,a)}return!0},t.get_=function(e){return Q.trackingDerivation&&!dl(this.target_,e)&&this.has_(e),this.target_[e]},t.set_=function(e,t,n){return n===void 0&&(n=!1),dl(this.target_,e)?this.values_.has(e)?this.setObservablePropValue_(e,t):n?Reflect.set(this.target_,e,t):(this.target_[e]=t,!0):this.extend_(e,{value:t,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,n)},t.has_=function(e){if(!Q.trackingDerivation)return e in this.target_;this.pendingKeys_||=new Map;var t=this.pendingKeys_.get(e);return t||(t=new kp(e in this.target_,Bl,`ObservableObject.key?`,!1),this.pendingKeys_.set(e,t)),t.get()},t.make_=function(e,t){if(t===!0&&(t=this.defaultAnnotation_),t!==!1){if(!(e in this.target_)){var n;if((n=this.target_[tp])!=null&&n[e])return;J(1,t.annotationType_,this.name_+`.`+e.toString())}for(var r=this.target_;r&&r!==Kf;){var i=Wf(r,e);if(i){var a=t.make_(this,e,i,r);if(a===0)return;if(a===1)break}r=Object.getPrototypeOf(r)}Df(this,t,e)}},t.extend_=function(e,t,n,r){if(r===void 0&&(r=!1),n===!0&&(n=this.defaultAnnotation_),n===!1)return this.defineProperty_(e,t,r);var i=n.extend_(this,e,t,r);return i&&Df(this,n,e),i},t.defineProperty_=function(e,t,n){n===void 0&&(n=!1),this.keysAtom_;try{Xu();var r=this.delete_(e);if(!r)return r;if(cf(this)){var i=uf(this,{object:this.proxy_||this.target_,name:e,type:xm,newValue:t.value});if(!i)return null;var a=i.newValue;t.value!==a&&(t=yl({},t,{value:a}))}if(n){if(!Reflect.defineProperty(this.target_,e,t))return!1}else Gf(this.target_,e,t);this.notifyPropertyAddition_(e,t.value)}finally{Zu()}return!0},t.defineObservableProperty_=function(e,t,n,r){r===void 0&&(r=!1),this.keysAtom_;try{Xu();var i=this.delete_(e);if(!i)return i;if(cf(this)){var a=uf(this,{object:this.proxy_||this.target_,name:e,type:xm,newValue:t});if(!a)return null;t=a.newValue}var o=Tf(e),s={configurable:Q.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:o.get,set:o.set};if(r){if(!Reflect.defineProperty(this.target_,e,s))return!1}else Gf(this.target_,e,s);var c=new kp(t,n,`ObservableObject.key`,!1);this.values_.set(e,c),this.notifyPropertyAddition_(e,c.value_)}finally{Zu()}return!0},t.defineComputedProperty_=function(e,t,n){n===void 0&&(n=!1),this.keysAtom_;try{Xu();var r=this.delete_(e);if(!r)return r;if(cf(this)&&!uf(this,{object:this.proxy_||this.target_,name:e,type:xm,newValue:void 0}))return null;t.name||=`ObservableObject.key`,t.context=this.proxy_||this.target_;var i=Tf(e),a={configurable:Q.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:i.get,set:i.set};if(n){if(!Reflect.defineProperty(this.target_,e,a))return!1}else Gf(this.target_,e,a);this.values_.set(e,new jp(t)),this.notifyPropertyAddition_(e,void 0)}finally{Zu()}return!0},t.delete_=function(e,t){if(t===void 0&&(t=!1),this.keysAtom_,!dl(this.target_,e))return!0;if(cf(this)&&!uf(this,{object:this.proxy_||this.target_,name:e,type:km}))return null;try{var n;Xu();var r=df(this),i=!1,a=this.values_.get(e),o=void 0;if(!a&&(r||i)&&(o=Wf(this.target_,e)?.value),t){if(!Reflect.deleteProperty(this.target_,e))return!1}else delete this.target_[e];if(a&&(this.values_.delete(e),a instanceof kp&&(o=a.value_),$u(a)),this.keysAtom_.reportChanged(),(n=this.pendingKeys_)==null||(n=n.get(e))==null||n.set(e in this.target_),r||i){var s={type:km,observableKind:`object`,object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:o,name:e};r&&pf(this,s)}}finally{Zu()}return!0},t.observe_=function(e,t){return ff(this,e)},t.intercept_=function(e){return lf(this,e)},t.notifyPropertyAddition_=function(e,t){var n,r=df(this),i=!1;if(r||i){var a=r||i?{type:xm,observableKind:`object`,debugObjectName:this.name_,object:this.proxy_||this.target_,name:e,newValue:t}:null;r&&pf(this,a)}(n=this.pendingKeys_)==null||(n=n.get(e))==null||n.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),$f(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}(),jm=al(`ObservableObjectAdministration`,Am),Mm=kf(0),Nm=function(){var e=!1,t={};return Object.defineProperty(t,`0`,{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),Pm=0,Fm=function(){},Of(Fm,Array.prototype),Im=function(e){function t(t,n,r,i){var a;return r===void 0&&(r=`ObservableArray`),i===void 0&&(i=!1),a=e.call(this)||this,If(function(){var e=new _m(r,n,i,!0);e.proxy_=a,il(a,X,e),t&&t.length&&a.spliceWithArray(0,0,t),Nm&&Object.defineProperty(a,`0`,Mm)}),a}xl(t,e);var n=t.prototype;return n.concat=function(){this[X].atom_.reportObserved();var e=[...arguments];return Array.prototype.concat.apply(this.slice(),e.map(function(e){return bf(e)?e.slice():e}))},n[Symbol.iterator]=function(){var e=this,t=0;return Bf({next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0,value:void 0}}})},_l(t,[{key:`length`,get:function(){return this[X].getArrayLength_()},set:function(e){this[X].setArrayLength_(e)}},{key:Symbol.toStringTag,get:function(){return`Array`}}])}(Fm),Object.entries(vm).forEach(function(e){var t=e[0],n=e[1];t!==`concat`&&rl(Im.prototype,t,n)}),jf(1e3),Lm=Kf.toString,Rm=Yc().Iterator?.prototype||{},[`Symbol`,`Map`,`Set`].forEach(function(e){Yc()[e]===void 0&&J(`MobX requires global '`+e+`' to be available or polyfilled`)}),typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__==`object`&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:sd,extras:{getDebugName:Ff},$mobx:X})})),Bm=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DebounceActionTimer=void 0;var t=(zm(),n(Jc));e.DebounceActionTimer=class{constructor(e,n){this.debounceMs=e,this.handler=n,this.requests=[],this.startTime=0,this.tick=()=>{let e=this.debounceMs<=0;if(this.debounceMs>0&&Date.now()-this.startTime>=this.debounceMs&&(e=!0),e){let e=this.requests.slice(),t=this.handler(e);typeof t==`object`&&`then`in t?Promise.resolve(t).then(t=>{this.handleResponses(e,t)}):this.handleResponses(e,t),this.requests=[]}else this.nextTick(this.tick)},this.handleResponses=(e,n)=>{(0,t.runInAction)(()=>{for(let t=0;t<e.length;t++){let r=e[t],i=n[t];r.action(i)}});for(let t of e)t.resolver()}}call(e,t){return new Promise(n=>{let r=this.requests.length===0;this.requests.push({args:e,action:t,resolver:n}),r&&this.startTimer()})}startTimer(){this.startTime=Date.now(),this.nextTick(this.tick)}nextTick(e){if(this.debounceMs<=0){Promise.resolve().then(e);return}typeof window<`u`&&window.requestAnimationFrame?window.requestAnimationFrame(e):setTimeout(e,this.debounceMs)}}})),Vm=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(qc(),e),n(Bm(),e)})),Hm=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.Debouncer=void 0,e.Debouncer=class{static promise(e){let n;return(...r)=>t(this,void 0,void 0,function*(){if(n)return n;try{return n=e.apply(this,r),yield n}finally{n=void 0}})}}})),Um=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(Hm(),e)})),Wm=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.unescapeHTML=e.escapeHTML=void 0;function t(e){return e.replace(/</g,`\\u003c`).replace(/>/g,`\\u003e`).replace(/&/g,`\\u0026`)}e.escapeHTML=t;function n(e){return e.replace(/\\u003c/g,`<`).replace(/\\u003e/g,`>`).replace(/\\u0026/g,`&`)}e.unescapeHTML=n})),Gm=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.sortedJsonByKeyStringify=e.sortObjectByKey=void 0;function t(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map(t);let n=Object.keys(e).sort(),r={};return n.forEach(n=>{r[n]=t(e[n])}),r}e.sortObjectByKey=t;function n(e){return JSON.stringify(t(e))}e.sortedJsonByKeyStringify=n})),Km=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(Gm(),e)})),qm=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateICNSName=e.parseICNSName=void 0;function t(e){let t=e.split(`.`);if(t.length===2&&t[0].length>0&&t[1].length>0)return[t[0],t[1]]}e.parseICNSName=t;function n(e,n){let r=t(e);return r?r[1]===n:!1}e.validateICNSName=n})),Jm=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(jc(),e),n(Kc(),e),n(Vm(),e),n(Um(),e),n(Wm(),e),n(Km(),e),n(qm(),e)})),Ym=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.serializeSignDoc=e.encodeSecp256k1Signature=e.encodeSecp256k1Pubkey=void 0;var t=(_(),n(v)),r=Jm();function i(e){if(e.length!==33||e[0]!==2&&e[0]!==3)throw Error(`Public key must be compressed secp256k1, i.e. 33 bytes starting with 0x02 or 0x03`);return{type:`tendermint/PubKeySecp256k1`,value:t.Buffer.from(e).toString(`base64`)}}e.encodeSecp256k1Pubkey=i;function a(e,n){if(n.length!==64)throw Error(`Signature must be 64 bytes long. Cosmos SDK uses a 2x32 byte fixed length encoding for the secp256k1 signature integers r and s.`);return{pub_key:i(e),signature:t.Buffer.from(n).toString(`base64`)}}e.encodeSecp256k1Signature=a;function o(e){return t.Buffer.from((0,r.escapeHTML)((0,r.sortedJsonByKeyStringify)(e)))}e.serializeSignDoc=o})),Xm=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(Ym(),e)})),Zm=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.verifyADR36Amino=e.verifyADR36AminoSignDoc=e.makeADR36AminoSignDoc=e.checkAndValidateADR36AminoSignDoc=void 0;var t=Xm(),r=ks(),i=(_(),n(v)),a=Gc();function o(e,t){if(!(e&&e.msgs&&Array.isArray(e.msgs)&&e.msgs.length===1&&e.msgs[0].type===`sign/MsgSignData`))return!1;if(e.chain_id!==``)throw Error(`Chain id should be empty string for ADR-36 signing`);if(e.memo!==``)throw Error(`Memo should be empty string for ADR-36 signing`);if(e.account_number!==`0`)throw Error(`Account number should be "0" for ADR-36 signing`);if(e.sequence!==`0`)throw Error(`Sequence should be "0" for ADR-36 signing`);if(e.fee.gas!==`0`)throw Error(`Gas should be "0" for ADR-36 signing`);if(e.fee.amount.length!==0)throw Error(`Fee amount should be empty array for ADR-36 signing`);let n=e.msgs[0];if(n.type!==`sign/MsgSignData`)throw Error(`Invalid type of ADR-36 sign msg: ${n.type}`);if(!n.value)throw Error(`Empty value in the msg`);let a=n.value.signer;if(!a)throw Error(`Empty signer in the ADR-36 msg`);r.Bech32Address.validate(a,t);let o=n.value.data;if(!o)throw Error(`Empty data in the ADR-36 msg`);let s=i.Buffer.from(o,`base64`);if(s.toString(`base64`)!==o)throw Error(`Data is not encoded by base64`);if(s.length===0)throw Error(`Empty data in the ADR-36 msg`);return!0}e.checkAndValidateADR36AminoSignDoc=o;function s(e,t){return t=i.Buffer.from(t).toString(`base64`),{chain_id:``,account_number:`0`,sequence:`0`,fee:{gas:`0`,amount:[]},msgs:[{type:`sign/MsgSignData`,value:{signer:e,data:t}}],memo:``}}e.makeADR36AminoSignDoc=s;function c(e,n,i,s,c=`secp256k1`){if(!o(n,e))throw Error(`Invalid sign doc for ADR-36`);let l=new a.PubKeySecp256k1(i);if((c===`ethsecp256k1`?new r.Bech32Address(l.getEthAddress()).toBech32(e):new r.Bech32Address(l.getCosmosAddress()).toBech32(e))!==n.msgs[0].value.signer)throw Error(`Unmatched signer`);let u=(0,t.serializeSignDoc)(n);return l.verifyDigest32(c===`ethsecp256k1`?a.Hash.keccak256(u):a.Hash.sha256(u),s)}e.verifyADR36AminoSignDoc=c;function l(e,t,n,r,i,a=`secp256k1`){return c(e,s(t,n),r,i,a)}e.verifyADR36Amino=l})),Qm=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(Zm(),e)})),$m=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SignDocWrapper=void 0;var t=Sc(),n=xc(),r=Qm();e.SignDocWrapper=class e{constructor(e){this.signDoc=e,`msgs`in e?this.mode=`amino`:this.mode=`direct`,this.mode===`amino`?this.isADR36SignDoc=(0,r.checkAndValidateADR36AminoSignDoc)(this.aminoSignDoc):this.isADR36SignDoc=!1}static fromAminoSignDoc(t){return new e(t)}static fromDirectSignDoc(t){return new e(t)}static fromDirectSignDocBytes(t){return new e(n.SignDoc.decode(t))}clone(){return new e(this.signDoc)}get protoSignDoc(){if(this.mode===`amino`)throw Error(`Sign doc is encoded as Amino Json`);if(`msgs`in this.signDoc)throw Error(`Unexpected error`);return this._protoSignDoc||=new t.ProtoSignDocDecoder(this.signDoc),this._protoSignDoc}get aminoSignDoc(){if(this.mode===`direct`)throw Error(`Sign doc is encoded as Protobuf`);if(!(`msgs`in this.signDoc))throw Error(`Unexpected error`);return this.signDoc}get chainId(){return this.mode===`direct`?this.protoSignDoc.chainId:this.aminoSignDoc.chain_id}get memo(){return this.mode===`direct`?this.protoSignDoc.txBody.memo:this.aminoSignDoc.memo}get fees(){if(this.mode===`direct`){let e=[];for(let t of this.protoSignDoc.authInfo.fee?.amount??[]){if(t.denom==null||t.amount==null)throw Error(`Invalid fee`);e.push({denom:t.denom,amount:t.amount})}return e}return this.aminoSignDoc.fee.amount}get payer(){return this.mode===`direct`?this.protoSignDoc.authInfo.fee?.payer:this.aminoSignDoc.fee.payer}get granter(){return this.mode===`direct`?this.protoSignDoc.authInfo.fee?.granter:this.aminoSignDoc.fee.granter}get gas(){return this.mode===`direct`?this.protoSignDoc.authInfo.fee?.gasLimit?parseInt(this.protoSignDoc.authInfo.fee.gasLimit):0:parseInt(this.aminoSignDoc.fee.gas)}}})),eh=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(vc(),e),n(Sc(),e),n($m(),e)})),th=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(oo(),e),n(ks(),e),n(Ms(),e),n(Ps(),e),n(eh(),e),n(Qm(),e),n(Xm(),e)})),nh=Ha(),rh=th(),ih=i(Fn()),ah=e=>e.apis?.rpc?.[0]?.address??``,oh=e=>e.apis?.rest?.[0]?.address??``,sh=e=>e.explorers?.[0]?.url??``,ch={fullSemver:/v?(\d+\.\d+\.\d+)(?=-[\w.-]+|$)/,partialSemver:/v?(\d+\.\d+)(?=(?:\.\d+)?(?=-[\w.-]+|$))/,basicVersion:/v?(\d+)(?=(?:\.\d+)?(?:\.\d+)?(?=-[\w.-]+|$))/,tagged:/@v(\d+\.\d+)(?:\.x)?(?=-[\w.-]+|$)/,embedded:/\/v(\d+\.\d+\.\d+)(?=-[\w.-]+|$)/,simple:/v?(\d+)(?:\.(\d+))?(?:\.(\d+))?$/,complexEmbedded:/[\w-]+\/[\w-]+ v(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:-\d+[\w.-]*)/,taggedVersion:/[\w-]+\/[\w-]+ v(\d+)(?:\.(\d+))?(?:\.(\d+))?(?=-[\w.-]+|$)/};function lh(e){let t=null;return ch.fullSemver.test(e)?t=e.match(ch.fullSemver)?.[1]:ch.partialSemver.test(e)?t=e.match(ch.partialSemver)?.[1]:ch.basicVersion.test(e)?t=e.match(ch.basicVersion)?.[1]:ch.taggedVersion.test(e)?t=e.match(ch.taggedVersion)?.[1]:ch.complexEmbedded.test(e)?t=e.match(ch.complexEmbedded)?.[1]:ch.simple.test(e)?t=e.match(ch.simple)?.[1]:ch.tagged.test(e)?t=e.match(ch.tagged)?.[1]:ch.embedded.test(e)&&(t=e.match(ch.embedded)?.[1]),t?uh(t):null}function uh(e){let t=e.split(`.`);for(;t.length<3;)t.push(`0`);return t.join(`.`)}var dh=(e,t,n={getRpcEndpoint:ah,getRestEndpoint:oh,getExplorer:sh})=>{n.getRestEndpoint||=oh,n.getRpcEndpoint||=ah,n.getExplorer||=sh;let r=[];if(e.codebase?.sdk?.type===`cosmos`||e.codebase?.cosmos_sdk_version){let t;if(t=e.codebase?.sdk?.type===`cosmos`&&e.codebase.sdk.version?lh(e.codebase.sdk.version):e.codebase?.cosmos_sdk_version?lh(e.codebase.cosmos_sdk_version):`0.40.0`,ih.default.satisfies(t,`>=0.40`)&&r.push(`stargate`),ih.default.satisfies(t,`>=0.43`)&&r.push(`no-legacy-stdTx`),r.push(`ibc-transfer`),ih.default.satisfies(t,`>=0.45`)&&r.push(`ibc-go`),e.codebase?.cosmwasm?.enabled??e.codebase?.cosmwasm_enabled??!1){r.push(`cosmwasm`);let t=lh(e.codebase?.cosmwasm?.version??e.codebase?.cosmwasm_version??`0.24.0`);ih.default.satisfies(t,`>=0.24.0`)&&r.push(`wasmd_0.24+`)}}let i=t.find(t=>t.chain_name===e.chain_name)?.assets||[],a=e.fees?.fee_tokens.map(e=>e.denom)||[],o=e.fees?.fee_tokens?.reduce((e,t)=>(e[t.denom]={low:t.low_gas_price??.01,average:t.average_gas_price??.025,high:t.high_gas_price??.04},e),{}),s=e.staking?.staking_tokens.map(e=>e.denom)||[],c=i.map(e=>({coinDenom:e.symbol,coinMinimalDenom:e.base,coinDecimals:e.denom_units.filter(t=>t.denom===e.display)[0]?.exponent,coinGeckoId:e.coingecko_id||void 0,coinImageUrl:e.logo_URIs?.svg??e.logo_URIs?.png})),l=c.find(e=>s.includes(e.coinDenom))??c[0],u=c.filter(e=>a.includes(e.coinMinimalDenom)).map(e=>{if(!(e.coinMinimalDenom in o))return e;let t=o[e.coinMinimalDenom];return{...e,gasPriceStep:t}}),d=c.filter(e=>l.coinDenom===e.coinDenom).map(e=>{if(!(e.coinMinimalDenom in o))return e;let t=o[e.coinMinimalDenom];return{...e,gasPriceStep:t}});return{rpc:n.getRpcEndpoint(e),rest:n.getRestEndpoint(e),chainId:e.chain_id,chainName:e.pretty_name,bip44:{coinType:e.slip44},bech32Config:rh.Bech32Address.defaultBech32Config(e.bech32_prefix),currencies:c,stakeCurrency:l||c[0],feeCurrencies:u.length===0?d:u,features:r}},fh=i(G()),ph=class{static addItem(e,t,n){let r={value:t,expiry:new Date().getTime()+n},i=localStorage.getItem(e),a=i?JSON.parse(i):[];a.push(r),localStorage.setItem(e,JSON.stringify(a))}static getItems(e){let t=localStorage.getItem(e);if(!t)return[];let n=JSON.parse(t),r=new Date,i=[];for(let e of n)r.getTime()<=e.expiry&&i.push(e.value);return localStorage.setItem(e,JSON.stringify(i.map(e=>({value:e,expiry:n.find(t=>t.value===e).expiry})))),i}static removeItem(e,t){let n=localStorage.getItem(e);if(!n)return;let r=JSON.parse(n);r=r.filter(e=>e.value!==t),localStorage.setItem(e,JSON.stringify(r))}},mh=class{client;_defaultSignOptions={preferNoSetFee:!1,preferNoSetMemo:!0,disableBalanceCheck:!0};get defaultSignOptions(){return this._defaultSignOptions}setDefaultSignOptions(e){this._defaultSignOptions=e}constructor(e){this.client=e}async enable(e){await this.client.enable(e)}async suggestToken({chainId:e,tokens:t,type:n}){if(n===`cw20`)for(let{contractAddress:n,viewingKey:r}of t)await this.client.suggestToken(e,n,r)}async getSimpleAccount(e){let{address:t,username:n}=await this.getAccount(e);return{namespace:`cosmos`,chainId:e,address:t,username:n}}async getAccount(e){let t=await this.client.getKey(e);return{username:t.name,address:t.bech32Address,algo:t.algo,pubkey:t.pubKey,isNanoLedger:t.isNanoLedger}}getOfflineSigner(e,t){switch(t){case`amino`:return this.getOfflineSignerAmino(e);case`direct`:return this.getOfflineSignerDirect(e);default:return this.getOfflineSignerAmino(e)}}getOfflineSignerAmino(e){return{getAccounts:async()=>[await this.getAccount(e)],signAmino:async(t,n)=>this.signAmino(e,t,n,this.defaultSignOptions)}}getOfflineSignerDirect(e){return{getAccounts:async()=>[await this.getAccount(e)],signDirect:async(t,n)=>{let r=await this.signDirect(e,t,n,this.defaultSignOptions);return{...r,signed:{...r.signed,accountNumber:BigInt(r.signed.accountNumber.toString())}}}}}async addChain(e){let t=ph.getItems(`cosmos-kit@2:keplr/supported-chain`);if(t&&t.length>0&&t.includes(e.name))return;let n=dh(e.chain,e.assetList?[e.assetList]:[]);e.preferredEndpoints?.rest?.[0]&&(n.rest=e.preferredEndpoints?.rest?.[0]),e.preferredEndpoints?.rpc?.[0]&&(n.rpc=e.preferredEndpoints?.rpc?.[0]);try{await this.client.experimentalSuggestChain(n),ph.addItem(`cosmos-kit@2:keplr/supported-chain`,e.name,1e3*60)}catch(e){throw e}}async signAmino(e,t,n,r){return await this.client.signAmino(e,t,n,r||this.defaultSignOptions)}async signArbitrary(e,t,n){return await this.client.signArbitrary(e,t,n)}async signDirect(e,t,n,r){let i=await this.client.signDirect(e,t,{...n,accountNumber:fh.default.fromString(n.accountNumber.toString())},r||this.defaultSignOptions);return{...i,signed:{...i.signed,accountNumber:BigInt(i.signed.accountNumber.toString())}}}async sendTx(e,t,n){return await this.client.sendTx(e,t,n)}},hh=[new class extends qr{constructor(e,t){super(e,Yi),this.preferredEndpoints=t}async initClient(){this.initingClient();try{let e=await nh.Keplr.getKeplr();this.initClientDone(e?new mh(e):void 0)}catch(e){this.initClientError(e)}}}({name:`keplr-extension`,prettyName:`Keplr`,logo:`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAB+ASURBVHgB7Z1NbFxVlsfPKzsfTUJc6baZjkTcFTELJLA6ySzQJJGwe9FSmAXxzAJ604QN9GJomgVsoEUi0RtY8NWLhg2kN8NqKlkMGbHARgpILDoYGSQ2KIWNFIQNKZskhNiu1/f/PpxyuapcH/e+e+595yc9XrnKuFKv3jn3fN+AhK4pla8Uq3SjuI0GiiEFxYCCUvpaSGH0OCAaqgVhMX0+CAM8Ltb/nSD6OSi2e68w+p2w7e/wJaiqz1ht/zthNWzyO2EQVtb/Shh8VfeS+pvx362p/xdPrNJqpUg7q5XJvVu8l9BIQMI6EOxrtFIiKhxUgqwEm34FIVY3YCkV8lTABa5AOYQVKBUokUIYQMF8VaCgAoWxmwZnRFHcIpcKoFi+XNpO2w6qG6KkbpJfq5tECXxQcnelFbojUAognKHY8vhUHdODNFj5ZnJvhXKG9woAq/pVWj2oHuK4X33kcRF0oTnriuEDdUwvTo5Mk+d4qQBGyt9iRR9XDx9UH/GgCLzQB9PqOKfciumFyTtmyDO8UQDD5YXxIBb4E+KnCyZQcaAKRQqh9qovysBpBZCY90+qhycoNvEFIRNiZVA7PUDbpl2OHTipANLVXpn5J8W8F2yjlMHbAzRw2kVF4JQCgOCr0/PqGCdBYIaLisAJBfDL8pXSKq2+RSL4ggO4pAhYK4DEx8eK/ycSBMdwQRGwVQAj5757MqyFp8THF1wmDRaqrMHbxBB2CkDMfcFHoAiUNTDBzRooECOw6q/S2ickwi94BmpT1MJ2SQWynydGsLAAZNUX8gQna8C6BSCrvpA3Emvgk+HyN9aD29YsAInwC0IkgK/sosHTtlqUrSgAmPxrtFoOpXxXEKy6BJkrgJHylYMhrU1Jek8QbpGkCyezbjLKNAbwi3OLj4TK9xHhF4SNIC4QUpB5XCAzBTB87rvng1r4NgmC0IaBl7NMFWbiAkD4qVY7RYIgdMqpxcmR02QY4wpAabOXSSL9gtALxpWAUQUwUl58S/k2J0kQhJ5AQ9HC5PCjZAhjMQCY/SL8gtAfkKGR2Io2ghEFID6/IOgjVC60qcCgdhdAhF8QjKE9JqBVAcQ9/LVXSBAEI4SF4OR3Dw6fIU1oUwBxhR+KfIR+2H9bgYa24Qho9LaB6Lk96jGO9PWU9PXGx41/rx/mr9c2Pbe0UlNHWPdzGD1X//vL6rnl5Pn49fhxs78ndEdA4SFdFYNaFEBc2782JfP4WwNBhJDiuFM9TgV9tE7gUyHPA1AEc9fXIsUwn5y/Tp7DIYqiLdVBGjyko3eg7zsu3lBz7RMR/ljIx4YG1Xkgeoxz/DOruSvO8NnSaqQYcIZCwDl9Lu8owZ3ZRYMT/XYRDlKfJC29JcoZEOpjw9vpnqEBulcJOQQ9Tyt4FuC6gqPD2zY8D9diNlEGHy2uKIshVg55Ap2012LZe4r6oK87Nk9BP9yEuCGPqPMxdYiw8wJK4YJSBlAIUAYfqnM+WHtqcfKXPctgz3dxPMZrzdvOPvjkD4/uFIF3lFQhnL98UymFm5GV4Cl9xQN6vqtHyouXfPP7U6E/vm/7JrNTcBtYBO/M/eSrMsBW5hPUAz0pAJ+KfUTo80eqDM5f/smjgGJvrkDXCiCZ4HuJHAf+/MOjO+h3SvjFvM8ncBPeVUrgpS+u+2AV9OQKdH3nu276Y5V/+u7bZLUXNvDO3I3IKnA8eNi1K9CVAhgpf3sypOAtchARfKEToAD+ePEHhy2C7lyBjhWAq9V+qLR77fDtIvhCV8AicNQ1qO6mwQOdFgh1XKKmhP9514QfK/7UxF4RfqFrEBj+x29/Ht1DjlFMCoQ6oiMLwLXAH6ryzty3R0pwBS2gDPnEhapT1oAKCB7oJCDYkYRg9SdHePyunfT+RFGEX9AG7iXXrIFkr80t2dICcGX1Rz4fq76Y+4JJ3r18k/48e9UVa2BCZQWm2/3ClsukC6s/An3i6wtZ8MC+7XT2WDG65xxgS9ltawG4sPrD3z97bEiKeYRMQVzg9x8vu9CF2NYKaKvGuK/+xyNtLMIvZA/iArj3YBFwJgjDE21fb/UC99Ufwv935fMLgm0eUZYAYgNMaVsX0NICWKOVcWIKzP6/Hr6dBIEDKDRLh5cwpHi1drPlzlwtLQCuNf+jkeklaT6OLCWDQGejsV3xANCvk2h54yDRRjArEa5cOkoNWR0I1ZAj7h0+22+mrrDMDmB82MLkyKEWr21mpPztQWxVTMwQ4ecDhPvC4k36fGktGuo5m8zt0w2UwlgyiSmdysRVKeDzT0xV1yckM6NpMLCF3VJ4Mpo6xowXxnaL8Fviw2TUFibsQNiXM+qjx/vgvXG8lDwHRZDOb+BkeuPePHPf7XTiwhJxIwkGTm96vtkvczT/n7n7Nhfrsp0Fqxl65bMW+G6B0GGmw0Pq4JKbf3b2Gr355Y/EiYCCysLk8IHNzzfA0fwfTUoxBbNA6NEFl664roGU3GN3/YxFQRhcAW41As02FNlkPynhHydmwO8XzIDgFVYrV4W+HqTicMAqgMWIjj5bIEV9+L3viROJbG9QAM1spgeJEfgixe/XD4Qdvuq//t939OIX170aow1L5omLVyMBtBWVxz3L0GXdJNubXIDh8gIbZ09Mf72kq/3f1MHVpzcBLAEIY9YxAoapwU1FQRuuiBL+cWKEBP30gNUd1Wrpap8n4QeIa6CfH+csQbryNV4Fa8WrtHqw/olGlThOTIC2tunD+UBq5uNgXKqaCalb8JyK0GeZpz+a1C8woq0CuJ+YwExzOkW94Odni6zOeEO5P4jQZ2mW87Jka+P1PzUqgIPEAIZa0wlE8DsjHfGVVZqO1/1c2LDIrysAdP+pE4t8GzbsEDpHBL97YiWQnWvEyAooFsuXS+kP6wpglVZLxADx/TsHUWb4tSL4vYHrh+AoNgQxDaey5e20bd3Sr3cBxokBEvnvDMysR54768i2jzxx8YdMLAEuC1utrsy/XgH8miyDtMlx5hNWbIOVHoKfx3SeSbAbkOmYAFzboW32i9rCIFiX9fp/jXX///g+HheII/Xm/jyfwhJvwPXFjD+T2QEscA8xiG8VwrCpC2A9AyDBv+bAzBdz3zxQrIgJmKwT4DBDUNmNpfRxpACK5StY/a1aAAj+SepvI3NJpBorv5j72QA34KUvzLXy4h5nYOUWS7HMxwpgsKE80AZHhsX3rwd9+BNTVyS6b4E3ku5IU3BwA67RSgnnSAGEFFj3/8X8j4EvinJV+KOy6tsDmQFTrgCPUeKFaNGPFEBgefqPmP8xmLyDVf8NZtNk8gjiAaZcAQ5uQEjhLRdAWQAlsoiY/zA7b9BvpqoS4WeESVfAthsQhPGiX4j/U7PqAhzfl9/VP07v/aDM/qsk8AMFVyawbfHWCoUhnFML4Fdkkbya/3PRGOkrmZSiCr1halSa7Xt+gwVAFlOATNIimZNG+cXk548JKwBFQTaVQEBBCedU8kpkiXuHBihvoIxXovzuYMoKuIdBc5B1C+BIzsx/pPhM+ZWCOUzM+bdpAaT7fgzGVYD25pfnxf9PW0+lsMdN0C2IugCd7qrtex/VgIWddMPa6g/zPw/+fxrsE+F3G93B2qFkM1RbVJXsF1ZpsESWwI6wvjOXjJ+SYJ/7nDcwM+CoxRqYbTRQtLr8+u7/p5V9Ivx+AAtO93dpc0oQWgAKNvsAOO3sqhsIPzr5JNLvF9gwVSc2s2BIBQ4qE6Bo6xb1NQUIX/HZWV4tvHG/RWfm5oeLNzntZsMKuAGP3/Uz0oXtRXAwbQrIGgRAfAwAQvhR2ssNjFp7YWx3R7+L+QNzMnykKbrHhqWBQFtuIiTQigLw0fznKvxgTxfKVjZjbQ3SubqzOWNDdmJhqAWw9k37Zv5zFn7QzcaYogDao9sKuNPi9bb2zvs9SgEi4Pcs826+bq63DGZtz2dLa6QTW+nwIAyLBVvDQHxxAVyJ9sPX7JQ81Gf0A4KkOrFlcaEl2Jqq7+aG5MpcMkXWhVRfNzeZD9+NSXQH7MYsLoYWYwBuWwCuVfgNSRBQKzq/d5vXu2BjGIjrN5hrwt/L9RYl0J7ZJb2ZABvXOwjX9lr5ll33MWH2u1Te28v1lkBge3S7fXZkwlIMwOUMAPr5s9pXXhe9+PQ+l2nrQHelpC2ZsKQA3FxdMMnHxZHdvUye2SOBwLYsr+hWAHZkwsq7uhhlRg24q5N8erMAJBXYDs0hAKsKIPNSYNcsAJh7/824ym8rejHnJQaQLTaut1oWUAiUfTuwSzcXar8R8Xe5rbcXC2BMYgBt0e0C2AkCBkXJAmwBgn6uD/ToxQKQNGB7ljQvCLbcYgkCtgFBv3ccb4vtx5cXJZAde/KkAFxgLtoc0v3x3f1YW0dlz8bMyI0F4MKqkvr9PtDP3EWpBWiNiby9DdnI/B1dSAFi5fdlkGc/QiypwGyxERy3oAB4WwDw+V0s9mnF0T4tAEkHNsfEEB8bi6NYAHXA73/Ro227+t15Bt+VWAHN2WNAMdooBy5kPRR0D+MVxSfTHzw8uoP65fi+/v+Gj4x6kCGB7GdeCTjEdC8QmP6up/wa0RHF16FEfMRE2s5CKjD7QiCOFoBvpj+A+a8jqmx7H3uumChmy0UMgCO+mf7gsbt2ki6evvs2EjbiS5FU5p+Cm++EbZ99M/1xjR/Q6LvDAhAr4BamNrXJRR0AN55jPs67F84e0x/WESvgFj4VSFmIAfBJA77ooen/jBJUEysJLIDHNO6J5zI+TU3ObSEQAn8+FfwAtPCaXKn/MrZLXAEyt629jS7Z3LoACPz5tHU3/P4z9+0h0+A9fMiB94O4AI6D1d+nwB8EEn5/FkEkmL94rzwrAZ+qI3NZCvxnjwJ/WQp/yv7kPfOoBCD8ptzYXLgAtmMA2NoZqT8fQJXe1MReK+kjvOf76r0fHtVXb+AC93ItZe2R3DV8+zDkA1YUgn2PW47K49/x+uHd0ar40hc/0tKKXxmVZhwd9ktkcmXDwe+HBeAyWHEv/vbn1oW/HvxbpiaKubAGfJuSlCsL4I0v3Qz8YaVFDv4P6uC6YQdcAlgDqENAevX85Z+0755jG8Q8fJuTmBsFgJXflS294j78QTq+b3t0din3DgF5YWxXdOB647pjUxU8XnI87XrEwxmJmSsAWxqUo++Pa4GgKAp47lF+NAZC4LEvqwyUF47UXYESgFWA89fqPHd9LTpcqcY8vs+sIrbxvefCAsBNl5Xvj9UbZjpSOmnTyJ2J6YjHo8k5jyO3Y4VA9MC+zSvpfKIQYCXMJ2coCQQW8RivoXDLphXhYxVkLhSAztUfNwFKQVNBz7tQ62J/F/51qixAvWL4f+VqzBpy86C0fJyP6L0C0F31h9x73nLf3KhXFkdp46psSgEc3+fnHgneL1m+NfwIdvB1kxTvFQDSUYLQDzD/fXXvvFYAMP196/cXssdX8x94rgBk9Rf6A8Fen2M+3iqALFN/gr/4vi+Ctwrgo0U/Ov4Eu/i+L4K3CsDVun+BD+hy9H0EmpcKIC03FYR+4NRxaQovFcB5TwZ+CPZAdWceCr68rAQ0Oe8PmQVYGM1q/qUUOBvmkx6BueSclgLrVPw+dv41wzsFYNr8R2ahXXYh7g/Y3AyEx/uT5/CaKIuNNAo1fm5sBsI5q0nOz+RkIxTvFIDt6P9ycpN2UoAEJQBlgANKAt1yo8nZR3BNUKuPbr/Pl9aix6mwcwKmf14UdOZ3Gr5skxf3/GV3cv+4Fjg+pI3/ZlgRY8lAEEShXVUI6RCW80mXniv7MNha/W0oQu+WGh+KfyAo9a7G/mSzT4wF4z6KG2b6m1/+SH9Th4sbr+Rp9QdeKQAIjI+TaeeTbcxw4AbFRGBuigCC/9zsNec3XMmL75/ilar7bGmNfAcC9pupK9EqywUUXR1+73vnhT9vqz/w6tPmpfUXq+2zarV94uJVqxYP/h1PXPwh2mLdh30W87b6A7EAHAYr7sRU1cr4bbznhLJEfOm45LD625h3mPknTme56QbCn4edaRpBfODEhWyVwFzynr7MWkBtBofV38b9640FYEqxuECqBLK4gXwTfoCa/7wWZnnzqfPe+w+BfOTjH8g0j3y87JXwI5vydA59/5TMFcC8oZX6c+n+i5QgUnGmePGL6951WXIS/lzEAEzh+rZTukCtgAlrCKa/Dzsr14Nhn5w6/iQG0AfS/38LE4IKv983XhjbTXnHQhZAv5bLW/pvK7bqWOyWdy/f9G66MqL+3AJ/Nq6xFxZAHtN/W6HTCuBUdaiDvAf+6slcASwbENY8pwBboasvwsfpymePFYkjtoKAmTp3SwbuJdn8ozk6qvR8m67M0fRPsVBOXS0EFDgf3ZEMQHN0jMjyaXMV7qZ/1goAsu9FHYAPjSgm+CyZuNMPPpn/XE3/lFykAU18yHmJATQFllE/GRKfhJ+z6Z+Si0IgMdezpZ/6CF/Sqxir5kLUPxcWgATssqUfIf7IAwsAfv/rh28nF8hNHYDk7bPjwz6i+D6kV1HtJyPYW2PlyizLpr2Z0c+q4np5Nfx+TFZ2AVuWsVgAOaCXm8t1/98Vvz/FlrVVCCnMvA5AKveyZbaH6iuXlbRLfn+KneB4WM28EhDozttj+y2hNb1cb1ctAIz3Qr7fNb/fhgsQohKQLKC7IxA76Qit6cWXd9UCwMrvYtDP1vW2cqXmRQFkSi/9F587aAG4FPRrJFdBQN2Ve9hcU2jNZzmIATx+106nW3xtVbNaiQHoDgLu2UZCG3oJMLkUqMWq7/p0H2tZgIDCJcoY3ebO2JBogHb0cr1dqdhExP+vjkX8m2ElCBgEFWvREp0fWCq9tqab6+1KvwaEHxF/12NANjMu1iRnVuNkEKR+RAm0pxuf3oXVPxV+H753m/GWQo0KVgaCiBuQLd34mNwDgD4JP7BlAQRh+BViAJYUgN4PfadYAG3pphiIcwDQN+EHNq+3FzEA8ICj+d+s6Kb4iqsL4KPwA5u7WmEmYIUsMKv5Q987NEhCa1wPAvoq/MBiELBqTWpwQ8LX1FXHj0AgOsDyvkloKzAX4MSFzjK+s8zagH0WfihbWzEXDAW1umxC8x0d1velHhEF0BIoXBenMfks/MDmzIUAzUAhhRWyhO4PDwtA8AffhR/YrAGooR3YVhYA6P7wUABSD+AHYyqm47vwA9tzFwsDtGZNAXxoYNcZTts9C70BRX722FAulLnNFOAqrVYKN2inNQWQBgJ18vhdPyPBXdDVB+HPQ4t3vG+DvRhAUcl+oTq51+rWYLqDdmk2QHAP9PO73tXXDbYD1hUl+5GNZasWAJjwgWTrZ7eA0sYkn7x9b5YVQLTwW3eyTERBYQGIFeAGcaR/SMVudlDe+NxuCrCCc6QAbKYCde1j34hYAfyBkp6a2JvLKk74/zYtgLDeAlCpwK/IIiYuhFgBvIG/n5dgXzNs+/8YBoJzpABstQSnmMqFihXAj3hs91Duv5vzl/WnwLuhUKtFdeGpBVAhi7wz9xOZABbAY5IWZENq8otlZqYGphs2WABoCiCLmPSHYGrKxiH2eWFsV26Ke7YC97rtvowC1SkA5QTMkGXOXzZjBcDkfO1wfnLL3ECUf2qiKAVadZiyeLuhlrQARApghbZVyDImLwqGhYgrkD2o6strlL8dts1/sJsGo0U/UgBJNaC3bgCAKyA3YjakuX1U9cmuTRvhYP4rqpWkArjeIauQZUy5AQCuwN/v2xPdnIIZcI0R3ZdAX2s4mP+KdZd/XRpUJuBTsgwujsnpKAhAnVFKQIKC+kkj/LC0ZNVvDqxc2+m/mNr6aKh1SQgpsB4IxAUyrSHhBrwwJvUBuoBFBctKIvxbAwuXx8j1wmYLILTYEFTPO3M3yDSYGfC6ZAb6ot7cd3VH3qx58YvrxITp9MF6VGwbrcyskv0gGZqDECgx7UNCCexRrsAfL151bidc2yC6/8zdu8TU7wIsbFxmMg7SaiV9vOEbHC4vXCHMCbBMOhEmCzCQ4ZGPl7uam59XoDTh44up3z2YyMxkYG11cXJkb/pD4zc5TQzAhcrqYt2bzJ6T7EBrUoUMt0mEv3uyvJ87YEOsr/Hb/ICY8FKG/hJu6n/89udSLNQAVvyL6rpA+CWt1ztPXPyBGLFBxhudfuuZgJRUa2Z54/1lbBeNDQ1EyievLgGCe1CEf1CH+Pj9w8n3T5iu/2HDN1wsXymqAMElYhAHAPuTOvKs8/b4whCxzSIjwQUoWkTzfxcFR0XwdXH4ve9ZKQDl/2/4cjdIVlISzMYKwIV788vshRCKB/4uzF+fTV+s9mjSgYmP43FZ9bWCRYTz6g+a5f3OqWOcmICL+JBalWwE6fYnNe1wReAW+LLtGJTaQ6M76D/27RCBNwRcyJf45P1TzjU+sUkBBBROh8TrpkCaDq6ALaLxYokiQKWia64BVnpkO8TEz44TF6z21jUFsr35uSaMlBcvhRSWiBEwTzFUggMw69DS+YZyTz5jtpNuCqyXB9QKD6HHNlsi9NkBq5Xb6o+pXwuTdxxofL5p6Z/yWs6p2+VJYsQbX/4Y3cwcfHIIF1JkOFJlAMsAygD9DLb+TceGt9O/Dw9GZ8nX2wHNPgxNf6UBCtNNn2725HB5YVydpogZMGXfn9jLumgHbgIUAQadwg/UbSHgGuy/bSBa1e9RKUuY9rLC8wDfN0x/jtuwKwvgkLIAZjY/3wKlBD5Rp4PEDFupwX5ILQNsBImbY1k9Xk4shfrNISHc6eeCQO+JhL0QPQelN6oEXwSdJ8yFv6n5D9p1/yBiyE4BzEcXellF593p608nER0lqabzESh3BKo5Cn/C6VYvtJSgVRp8hSyPCWsFVlR08QkCB1DqyzUYDAZobbrVay0VAIqCVDrwDDHlXRVsgdaVVl7BFlj5f6/uQR5TfpoTBMHb30zuq7R6va0NrXyHs8QYKAG4A9LKK2QNhB8tvpyFHwyEK6fbvd5WASxOjkwTkxbhVsD0QvBFlICQFbjXJqausDb7wVarP+gkinaamDOfRGDfZa6NBfdBmhfCzzjgt85Wqz/oKKekUoKoCRgnB8DEGtkUVDDBc7PXooI0F8Dqv3Bi+NEtf4864JflyyWVFbhEjhA38ciUH0EPMPkRcOZu8tczSKsHtjL/QUcSgj+kMgKvkiPAPPu3977nWZIpOAMCfbiHcC+5JPyd+P7rv0sdwm1YSKfAGoBbgLp9QegU+PrI77vg69eDqj+V95/QrgCAigX8SZ1eJgeJh3zcLrPthLa4PvtBKYBHFybveLvz3+8SlwKCzYACeHh0h1gEwgZ8GPrSrua/9f/TJUlAEI1CTrkCjaSuwfF9O6ImHCF/xFvR3Vhv5XadTgN/9fR057vsCjSC7joMzoBVIO5BPsAqjwq+/1HCv2xpfoN2arXTi//1L6eoS3pe+lx3BZoBq+Do8HZRBh7ipdAn9GL63/p/e8QXV6AVqTJIpxCJm+AWMO8h9BjM4qPQ11FVpv+hbk3/lL7uap9cga2AEkBf/xEMCBWFwI56gYc/78sE5w54anFy5BXqkb7v4l+UF19RJgir+YFZAGWASsMjiWLAIUohGyDsEHIcny+t0YXFm87l63UQhOGrC/95x5+oD/q+Y5MCIcQD2E0PyhoEFMcSZQAXIlUK6UQgoTsg1LNKyOeTUWo4xz9L5yf8/l107VBl8kBfQ3u0LFm+xwN0sD+Z6YfjzmjOXzzcE2c8l6cpvkvJTEQMc0GdPc4Q6q+v16IZiensRKE53Vb7tf9bmhgpf3swpOATEvoiHQIaDwiNh4SmA0LT10H6Oyn1A0Ub/14/tBLE+mGm9Y/T328cfLqUCLwIdv+0mvDb29/SiFICJ5USeIsEQTBFX0G/RrTanUkNMvsBIoLgJCj20Sj8wEjYWqUHT6nT8yQIgh56rPTbCmN5q7ymBwVBO4aEHxhNXI/877dvh0HwCAmC0BMq139G5fpPkiGM5p6Sf7jEBAShB5JCn5NkEOPJZxW0OEWiBAShO5TZ32+VXydkVrsqgUFB6BCDPn8jmRav56l5SBB6IaTw0e+6GOnVL5l3r6BiUJ3KIQUlEgQhpaqyZhO6Kvw6JfMCdHxA1DGjnpkEQUBp7wx6+rMWfmClAwVNDCu07ZBLew0IggkQ6d9F17Q09vT0/mSZJC6A4KB0Egp5Am282kt7u4XFBAu0E6/RwJTEBYScMK1M/kdtrfr1sBphI6lCwXNYrPr1sJthJdaA4ClsVv162A6xw2wBdXpeFIHgOOxW/XrYzqHCbIEkXXiGBMFBEOHfTVcPcBV+4MQY28QtOKWsAeksFFyApbnfDKfmWIsiEJgzTbG5P02O4OQge1EEAiNQwntG3YtnXRL8FKd3skgUwThJsFDIGCU4MyHROeXjv9LvbH6beLOVTdJkhKrC+0UZCCYIKKgQ1c65uto3w8u9rJI9CsbVwwfJsx2MhUzByo4GnXPKzJ+20axjmlxsZjdcXhinWBHcT/EWZtJ3IDSjqiRimkL6QD2eUeb9jMvmfSfkcjfLZCuzEkEpBPRr9YVDIYhiyA8Q6koYhDNBGHyqrMXKGq3MVB1I2+lGtrOto1S+VLxKu+E+FJXJV8JRC2hI3SQlipVDehaYEvvp0WQdCHilENISBFw9r4S+NrOLrlV8X9W7QRRAD0BRVGlncTC2IggKo6AUg7rpoBzWFYS6AX+VPk6USCNK0QRtFUrj33SMaix4rVGfD69v/J2AqsnzEYkQV+OXYgFP/l8l2GF1hdaqRbpRFcHunn8Cz9Ea2bs7Ut4AAAAASUVORK5CYII=`,mode:`extension`,mobileDisabled:()=>!(typeof document<`u`&&document.readyState===`complete`&&window.keplr&&window.keplr.mode===`mobile-web`),rejectMessage:{source:`Request rejected`},connectEventNamesOnWindow:[`keplr_keystorechange`],supportedChains:`agoric.akash.archway.axelar.bostrom.celestia.certik.comdex.cosmoshub.cryptoorgchain.dymension.emoney.evmos.gravitybridge.injective.irisnet.ixo.juno.kava.kujira.noble.nois.osmosis.persistence.quicksilver.regen.secretnetwork.sentinel.sifchain.sommelier.stargaze.starname.stride.terra2.tgrade.umee`.split(`.`),downloads:[{device:`desktop`,browser:`chrome`,link:`https://chrome.google.com/webstore/detail/keplr/dmkamcknogkgcdfhhbddcghachkejeap?hl=en`},{device:`desktop`,browser:`firefox`,link:`https://addons.mozilla.org/en-US/firefox/addon/keplr/`},{link:`https://www.keplr.app/download`}]},Ji)],gh={osmosis:{rpc:[`https://rpc-osmosis.keplr.app/`],rest:[`https://lcd-osmosis.keplr.app/`]},osmosistestnet:{rpc:[`https://rpc-test.osmosis.zone/`],rest:[`https://lcd-test.osmosis.zone/`]},cosmoshub:{rpc:[`https://rpc-cosmoshub.keplr.app`],rest:[`https://lcd-cosmoshub.keplr.app`]},terra:{rpc:[`https://rpc-columbus.keplr.app`],rest:[`https://lcd-columbus.keplr.app`]},secretnetwork:{rpc:[`https://rpc-secret.keplr.app`],rest:[`https://lcd-secret.keplr.app`]},akash:{rpc:[`https://rpc-akash.keplr.app`],rest:[`https://lcd-akash.keplr.app`]},regen:{rpc:[`https://rpc-regen.keplr.app`],rest:[`https://lcd-regen.keplr.app`]},sentinel:{rpc:[`https://rpc-sentinel.keplr.app`],rest:[`https://lcd-sentinel.keplr.app`]},persistence:{rpc:[`https://rpc-persistence.keplr.app`],rest:[`https://lcd-persistence.keplr.app`]},irisnet:{rpc:[`https://rpc-iris.keplr.app`],rest:[`https://lcd-iris.keplr.app`]},cryptoorgchain:{rpc:[`https://rpc-crypto-org.keplr.app/`],rest:[`https://lcd-crypto-org.keplr.app/`]},starname:{rpc:[`https://rpc-iov.keplr.app`],rest:[`https://lcd-iov.keplr.app`]},emoney:{rpc:[`https://rpc-emoney.keplr.app`],rest:[`https://lcd-emoney.keplr.app`]},juno:{rpc:[`https://rpc-juno.itastakers.com`],rest:[`https://lcd-juno.itastakers.com`]},microtick:{rpc:[`https://rpc-microtick.keplr.app`],rest:[`https://lcd-microtick.keplr.app`]},likecoin:{rpc:[`https://mainnet-node.like.co/rpc`],rest:[`https://mainnet-node.like.co`]},impacthub:{rpc:[`https://rpc-impacthub.keplr.app`],rest:[`https://lcd-impacthub.keplr.app`]},bitcanna:{rpc:[`https://rpc.bitcanna.io`],rest:[`https://lcd.bitcanna.io`]},bitsong:{rpc:[`https://rpc.explorebitsong.com`],rest:[`https://lcd.explorebitsong.com`]},kichain:{rpc:[`https://rpc-mainnet.blockchain.ki`],rest:[`https://api-mainnet.blockchain.ki`]},panacea:{rpc:[`https://rpc.gopanacea.org`],rest:[`https://api.gopanacea.org`]},bostrom:{rpc:[`https://rpc.bostrom.cybernode.ai`],rest:[`https://lcd.bostrom.cybernode.ai`]},comdex:{rpc:[`https://rpc.comdex.one`],rest:[`https://rest.comdex.one`]},cheqd:{rpc:[`https://rpc.cheqd.net`],rest:[`https://api.cheqd.net`]},stargaze:{rpc:[`https://rpc.stargaze-apis.com`],rest:[`https://rest.stargaze-apis.com`]},chihuahua:{rpc:[`https://rpc.chihuahua.wtf`],rest:[`https://api.chihuahua.wtf`]},lumnetwork:{rpc:[`https://node0.mainnet.lum.network/rpc`],rest:[`https://node0.mainnet.lum.network/rest`]},vidulum:{rpc:[`https://mainnet-rpc.vidulum.app`],rest:[`https://mainnet-lcd.vidulum.app`]},desmos:{rpc:[`https://rpc.mainnet.desmos.network`],rest:[`https://api.mainnet.desmos.network`]},dig:{rpc:[`https://rpc-1-dig.notional.ventures`],rest:[`https://api-1-dig.notional.ventures`]},sommelier:{rpc:[`https://rpc-sommelier.keplr.app`],rest:[`https://lcd-sommelier.keplr.app`]},sifchain:{rpc:[`https://rpc.sifchain.finance`],rest:[`https://api-int.sifchain.finance`]},bandchain:{rpc:[`https://rpc.laozi3.bandchain.org`],rest:[`https://laozi1.bandchain.org/api`]},konstellation:{rpc:[`https://node1.konstellation.tech:26657`],rest:[`https://node1.konstellation.tech:1318`]},umee:{rpc:[`https://rpc.aphrodite.main.network.umee.cc`],rest:[`https://api.aphrodite.main.network.umee.cc`]},gravitybridge:{rpc:[`https://gravitychain.io:26657`],rest:[`https://gravitychain.io:1317`]},decentr:{rpc:[`https://poseidon.mainnet.decentr.xyz`],rest:[`https://rest.mainnet.decentr.xyz`]},shentu:{rpc:[`https://shenturpc.certikpowered.info`],rest:[`https://azuredragon.noopsbycertik.com`]},carbon:{rpc:[`https://tm-api.carbon.network`],rest:[`https://api.carbon.network`]},injective:{rpc:[`https://public.api.injective.network`],rest:[`https://public.lcd.injective.network`]},cerberus:{rpc:[`https://rpc.cerberus.zone:26657`],rest:[`https://api.cerberus.zone:1317`]},fetchhub:{rpc:[`https://rpc-fetchhub.fetch.ai:443`],rest:[`https://rest-fetchhub.fetch.ai`]},assetmantle:{rpc:[`https://rpc.assetmantle.one/`],rest:[`https://rest.assetmantle.one/`]},provenance:{rpc:[`https://rpc.provenance.io/`],rest:[`https://api.provenance.io`]},galaxy:{rpc:[`https://rpc.galaxychain.zone`],rest:[`https://rest.galaxychain.zone`]},meme:{rpc:[`https://rpc-meme-1.meme.sx:443`],rest:[`https://api-meme-1.meme.sx:443`]},evmos:{rpc:[`https://rpc-evmos.keplr.app/`],rest:[`https://lcd-evmos.keplr.app/`]},terra2:{rpc:[`https://rpc.terrav2.ccvalidators.com/`],rest:[`https://phoenix-lcd.terra.dev/`]},rizon:{rpc:[`https://rpcapi.rizon.world/`],rest:[`https://restapi.rizon.world/`]},kava:{rpc:[`https://rpc-kava.keplr.app`],rest:[`https://lcd-kava.keplr.app`]},genesisl1:{rpc:[`https://26657.genesisl1.org`],rest:[`https://api.genesisl1.org`]}},_h=class extends Gr{WCClient;clientMutable={state:U.Init};options;constructor(e,t,n){super(e,t),this.WCClient=n}setClientNotExist(){this.setState(U.Error),this.setMessage(this.clientMutable.message)}},vh=class extends me{constructor(e){super(),this.opts=e,this.protocol=`wc`,this.version=2}},yh=class extends me{constructor(e,t){super(),this.core=e,this.logger=t,this.records=new Map}},bh=class{constructor(e,t){this.logger=e,this.core=t}},xh=class extends me{constructor(e,t){super(),this.relayer=e,this.logger=t}},Sh=class extends me{constructor(e){super()}},Ch=class{constructor(e,t,n,r){this.core=e,this.logger=t,this.name=n}},wh=class extends me{constructor(e,t){super(),this.relayer=e,this.logger=t}},Th=class extends me{constructor(e,t){super(),this.core=e,this.logger=t}},Eh=class{constructor(e,t,n){this.core=e,this.logger=t,this.store=n}},Dh=class{constructor(e,t){this.projectId=e,this.logger=t}},Oh=class{constructor(e,t,n){this.core=e,this.logger=t,this.telemetryEnabled=n}},kh=class{constructor(e){this.opts=e,this.protocol=`wc`,this.version=2}},Ah=class{constructor(e){this.client=e}};function jh(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function Mh(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Nh(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var Ph=`[object RegExp]`,Fh=`[object String]`,Ih=`[object Number]`,Lh=`[object Boolean]`,Rh=`[object Symbol]`,zh=`[object Date]`,Bh=`[object Map]`,Vh=`[object Set]`,Hh=`[object Array]`,Uh=`[object Function]`,Wh=`[object ArrayBuffer]`,Gh=`[object Object]`,Kh=`[object Error]`,qh=`[object DataView]`,Jh=`[object Uint8Array]`,Yh=`[object Uint8ClampedArray]`,Xh=`[object Uint16Array]`,Zh=`[object Uint32Array]`,Qh=`[object BigUint64Array]`,$h=`[object Int8Array]`,eg=`[object Int16Array]`,tg=`[object Int32Array]`,ng=`[object BigInt64Array]`,rg=`[object Float32Array]`,ig=`[object Float64Array]`;function ag(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)===`[object Object]`:!1}_();function og(e,t,n){return sg(e,t,void 0,void 0,void 0,void 0,n)}function sg(e,t,n,r,i,a,o){let s=o(e,t,n,r,i,a);if(s!==void 0)return s;if(typeof e==typeof t)switch(typeof e){case`bigint`:case`string`:case`boolean`:case`symbol`:case`undefined`:return e===t;case`number`:return e===t||Object.is(e,t);case`function`:return e===t;case`object`:return cg(e,t,a,o)}return cg(e,t,a,o)}function cg(e,t,n,r){if(Object.is(e,t))return!0;let i=Nh(e),a=Nh(t);if(i===`[object Arguments]`&&(i=Gh),a===`[object Arguments]`&&(a=Gh),i!==a)return!1;switch(i){case Fh:return e.toString()===t.toString();case Ih:return jh(e.valueOf(),t.valueOf());case Lh:case zh:case Rh:return Object.is(e.valueOf(),t.valueOf());case Ph:return e.source===t.source&&e.flags===t.flags;case Uh:return e===t}n??=new Map;let o=n.get(e),s=n.get(t);if(o!=null&&s!=null)return o===t;n.set(e,t),n.set(t,e);try{switch(i){case Bh:if(e.size!==t.size)return!1;for(let[i,a]of e.entries())if(!t.has(i)||!sg(a,t.get(i),i,e,t,n,r))return!1;return!0;case Vh:{if(e.size!==t.size)return!1;let i=Array.from(e.values()),a=Array.from(t.values());for(let o=0;o<i.length;o++){let s=i[o],c=a.findIndex(i=>sg(s,i,void 0,e,t,n,r));if(c===-1)return!1;a.splice(c,1)}return!0}case Hh:case Jh:case Yh:case Xh:case Zh:case Qh:case $h:case eg:case tg:case ng:case rg:case ig:if(y!==void 0&&y.isBuffer(e)!==y.isBuffer(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!sg(e[i],t[i],i,e,t,n,r))return!1;return!0;case Wh:return e.byteLength===t.byteLength?cg(new Uint8Array(e),new Uint8Array(t),n,r):!1;case qh:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:cg(new Uint8Array(e),new Uint8Array(t),n,r);case Kh:return e.name===t.name&&e.message===t.message;case Gh:{if(!(cg(e.constructor,t.constructor,n,r)||ag(e)&&ag(t)))return!1;let i=[...Object.keys(e),...Mh(e)],a=[...Object.keys(t),...Mh(t)];if(i.length!==a.length)return!1;for(let a=0;a<i.length;a++){let o=i[a],s=e[o];if(!Object.hasOwn(t,o))return!1;let c=t[o];if(!sg(s,c,o,e,t,n,r))return!1}return!0}default:return!1}}finally{n.delete(e),n.delete(t)}}function lg(){}function ug(e,t){return og(e,t,lg)}s();var $=R(),dg=P(),fg=`core`,pg=`wc@2:${fg}:`,mg={name:fg,logger:`error`},hg={database:`:memory:`},gg=`crypto`,_g=`client_ed25519_seed`,vg=$.ONE_DAY,yg=`keychain`,bg=`messages`,xg=$.SIX_HOURS,Sg=`publisher`,Cg=`relayer`,wg={message:`relayer_message`,message_ack:`relayer_message_ack`,connect:`relayer_connect`,disconnect:`relayer_disconnect`,error:`relayer_error`,connection_stalled:`relayer_connection_stalled`,transport_closed:`relayer_transport_closed`,publish:`relayer_publish`},Tg={payload:`payload`,connect:`connect`,disconnect:`disconnect`,error:`error`},Eg=.1,Dg=`2.23.9`,Og={link_mode:`link_mode`,relay:`relay`},kg={inbound:`inbound`,outbound:`outbound`},Ag=`WALLETCONNECT_CLIENT_ID`,jg={created:`subscription_created`,deleted:`subscription_deleted`,expired:`subscription_expired`,disabled:`subscription_disabled`,sync:`subscription_sync`,resubscribed:`subscription_resubscribed`};$.THIRTY_DAYS;var Mg=`subscription`;$.FIVE_SECONDS*1e3;var Ng=`pairing`;$.THIRTY_DAYS;var Pg={wc_pairingDelete:{req:{ttl:$.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:$.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:$.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:$.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:$.ONE_DAY,prompt:!1,tag:0},res:{ttl:$.ONE_DAY,prompt:!1,tag:0}}},Fg={create:`pairing_create`,expire:`pairing_expire`,delete:`pairing_delete`,ping:`pairing_ping`},Ig={created:`history_created`,updated:`history_updated`,deleted:`history_deleted`,sync:`history_sync`},Lg=`history`,Rg=`expirer`,zg={created:`expirer_created`,deleted:`expirer_deleted`,expired:`expirer_expired`,sync:`expirer_sync`};$.ONE_DAY;var Bg=`verify-api`,Vg=`https://verify.walletconnect.com`,Hg=`https://verify.walletconnect.org`,Ug=`${Hg}/v3`,Wg=[Vg,Hg],Gg=`echo`,Kg=`https://echo.walletconnect.com`,qg={pairing_started:`pairing_started`,pairing_uri_validation_success:`pairing_uri_validation_success`,pairing_uri_not_expired:`pairing_uri_not_expired`,store_new_pairing:`store_new_pairing`,subscribing_pairing_topic:`subscribing_pairing_topic`,subscribe_pairing_topic_success:`subscribe_pairing_topic_success`,existing_pairing:`existing_pairing`,pairing_not_expired:`pairing_not_expired`,emit_inactive_pairing:`emit_inactive_pairing`,emit_session_proposal:`emit_session_proposal`,subscribing_to_pairing_topic:`subscribing_to_pairing_topic`},Jg={no_wss_connection:`no_wss_connection`,no_internet_connection:`no_internet_connection`,malformed_pairing_uri:`malformed_pairing_uri`,active_pairing_already_exists:`active_pairing_already_exists`,subscribe_pairing_topic_failure:`subscribe_pairing_topic_failure`,pairing_expired:`pairing_expired`,proposal_expired:`proposal_expired`,proposal_listener_not_found:`proposal_listener_not_found`},Yg={session_approve_started:`session_approve_started`,proposal_not_expired:`proposal_not_expired`,session_namespaces_validation_success:`session_namespaces_validation_success`,create_session_topic:`create_session_topic`,subscribing_session_topic:`subscribing_session_topic`,subscribe_session_topic_success:`subscribe_session_topic_success`,publishing_session_approve:`publishing_session_approve`,session_approve_publish_success:`session_approve_publish_success`,store_session:`store_session`,publishing_session_settle:`publishing_session_settle`,session_settle_publish_success:`session_settle_publish_success`,session_request_response_started:`session_request_response_started`,session_request_response_validation_success:`session_request_response_validation_success`,session_request_response_publish_started:`session_request_response_publish_started`},Xg={no_internet_connection:`no_internet_connection`,no_wss_connection:`no_wss_connection`,proposal_expired:`proposal_expired`,subscribe_session_topic_failure:`subscribe_session_topic_failure`,session_approve_publish_failure:`session_approve_publish_failure`,session_settle_publish_failure:`session_settle_publish_failure`,session_approve_namespace_validation_failure:`session_approve_namespace_validation_failure`,proposal_not_found:`proposal_not_found`,session_request_response_validation_failure:`session_request_response_validation_failure`,session_request_response_publish_failure:`session_request_response_publish_failure`},Zg={authenticated_session_approve_started:`authenticated_session_approve_started`,authenticated_session_not_expired:`authenticated_session_not_expired`,chains_caip2_compliant:`chains_caip2_compliant`,chains_evm_compliant:`chains_evm_compliant`,create_authenticated_session_topic:`create_authenticated_session_topic`,cacaos_verified:`cacaos_verified`,store_authenticated_session:`store_authenticated_session`,subscribing_authenticated_session_topic:`subscribing_authenticated_session_topic`,subscribe_authenticated_session_topic_success:`subscribe_authenticated_session_topic_success`,publishing_authenticated_session_approve:`publishing_authenticated_session_approve`,authenticated_session_approve_publish_success:`authenticated_session_approve_publish_success`},Qg={no_internet_connection:`no_internet_connection`,no_wss_connection:`no_wss_connection`,missing_session_authenticate_request:`missing_session_authenticate_request`,session_authenticate_request_expired:`session_authenticate_request_expired`,chains_caip2_compliant_failure:`chains_caip2_compliant_failure`,chains_evm_compliant_failure:`chains_evm_compliant_failure`,invalid_cacao:`invalid_cacao`,subscribe_authenticated_session_topic_failure:`subscribe_authenticated_session_topic_failure`,authenticated_session_approve_publish_failure:`authenticated_session_approve_publish_failure`,authenticated_session_pending_request_not_found:`authenticated_session_pending_request_not_found`},$g=.1,e_=`event-client`,t_=`https://pulse.walletconnect.org/batch`,n_=class{constructor(e,t){this.core=e,this.logger=t,this.keychain=new Map,this.name=yg,this.version=`0.3`,this.initialized=!1,this.storagePrefix=pg,this.init=async()=>{if(!this.initialized){let e=await this.getKeyChain();typeof e<`u`&&(this.keychain=e),this.initialized=!0}},this.has=e=>(this.isInitialized(),this.keychain.has(e)),this.set=async(e,t)=>{this.isInitialized(),this.keychain.set(e,t),await this.persist()},this.get=e=>{this.isInitialized();let t=this.keychain.get(e);if(typeof t>`u`){let{message:t}=V(`NO_MATCHING_KEY`,`${this.name}: ${e}`);throw Error(t)}return t},this.del=async e=>{this.isInitialized(),this.keychain.delete(e),await this.persist()},this.core=e,this.logger=ve(t,this.name)}get context(){return en(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//`+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Re(e))}async getKeyChain(){let e=await this.core.storage.getItem(this.storageKey);return typeof e<`u`?et(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){let{message:e}=V(`NOT_INITIALIZED`,this.name);throw Error(e)}}},r_=class{constructor(e,t,n){this.core=e,this.logger=t,this.name=gg,this.randomSessionIdentifier=Ne(),this.initialized=!1,this.init=async()=>{this.initialized||=(await this.keychain.init(),!0)},this.hasKeys=e=>(this.isInitialized(),this.keychain.has(e)),this.getClientId=async()=>{if(this.isInitialized(),this.clientId)return this.clientId;let e=L(I(await this.getClientSeed()).publicKey);return this.clientId=e,e},this.generateKeyPair=()=>{this.isInitialized();let e=ct();return this.setPrivateKey(e.publicKey,e.privateKey)},this.signJWT=async e=>{this.isInitialized();let t=I(await this.getClientSeed()),n=this.randomSessionIdentifier;return await N(n,e,vg,t)},this.generateSharedKey=(e,t,n)=>{this.isInitialized();let r=it(this.getPrivateKey(e),t);return this.setSymKey(r,n)},this.setSymKey=async(e,t)=>{this.isInitialized();let n=t||ke(e);return await this.keychain.set(n,e),n},this.deleteKeyPair=async e=>{this.isInitialized(),await this.keychain.del(e)},this.deleteSymKey=async e=>{this.isInitialized(),await this.keychain.del(e)},this.encode=async(e,t,n)=>{this.isInitialized();let r=Zt(n),i=he(t);if(yt(r))return qt(i,n?.encoding);if(Yt(r)){let t=r.senderPublicKey,n=r.receiverPublicKey;e=await this.generateSharedKey(t,n)}let a=this.getSymKey(e),{type:o,senderPublicKey:s}=r;return Ut({type:o,symKey:a,message:i,senderPublicKey:s,encoding:n?.encoding})},this.decode=async(e,t,n)=>{this.isInitialized();let r=Fe(t,n);if(yt(r))return ge(rt(t,n?.encoding));if(Yt(r)){let t=r.receiverPublicKey,n=r.senderPublicKey;e=await this.generateSharedKey(t,n)}try{return ge(we({symKey:this.getSymKey(e),encoded:t,encoding:n?.encoding}))}catch(t){this.logger.error(`Failed to decode message from topic: '${e}', clientId: '${await this.getClientId()}'`),this.logger.error(t)}},this.getPayloadType=(e,t=st)=>St(De({encoded:e,encoding:t}).type),this.getPayloadSenderPublicKey=(e,t=st)=>{let n=De({encoded:e,encoding:t});return n.senderPublicKey?Rn(n.senderPublicKey,Ie):void 0},this.core=e,this.logger=ve(t,this.name),this.keychain=n||new n_(this.core,this.logger)}get context(){return en(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e=``;try{e=this.keychain.get(_g)}catch{e=Ne(),await this.keychain.set(_g,e)}return Ln(e,`base16`)}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){let{message:e}=V(`NOT_INITIALIZED`,this.name);throw Error(e)}}},i_=class extends bh{constructor(e,t){super(e,t),this.logger=e,this.core=t,this.messages=new Map,this.messagesWithoutClientAck=new Map,this.name=bg,this.version=`0.3`,this.initialized=!1,this.storagePrefix=pg,this.init=async()=>{if(!this.initialized){this.logger.trace(`Initialized`);try{let e=await this.getRelayerMessages();typeof e<`u`&&(this.messages=e);let t=await this.getRelayerMessagesWithoutClientAck();typeof t<`u`&&(this.messagesWithoutClientAck=t),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:`method`,method:`restore`,size:this.messages.size})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}finally{this.initialized=!0}}},this.set=async(e,t,n)=>{this.isInitialized();let r=ze(t),i=this.messages.get(e);if(typeof i>`u`&&(i={}),typeof i[r]<`u`)return r;if(i[r]=t,this.messages.set(e,i),n===kg.inbound){let n=this.messagesWithoutClientAck.get(e)||{};this.messagesWithoutClientAck.set(e,{...n,[r]:t})}return await this.persist(),r},this.get=e=>{this.isInitialized();let t=this.messages.get(e);return typeof t>`u`&&(t={}),t},this.getWithoutAck=e=>{this.isInitialized();let t={};for(let n of e){let e=this.messagesWithoutClientAck.get(n)||{};t[n]=Object.values(e)}return t},this.has=(e,t)=>(this.isInitialized(),typeof this.get(e)[ze(t)]<`u`),this.ack=async(e,t)=>{this.isInitialized();let n=this.messagesWithoutClientAck.get(e);if(typeof n>`u`)return;let r=ze(t);delete n[r],Object.keys(n).length===0?this.messagesWithoutClientAck.delete(e):this.messagesWithoutClientAck.set(e,n),await this.persist()},this.del=async e=>{this.isInitialized(),this.messages.delete(e),this.messagesWithoutClientAck.delete(e),await this.persist()},this.logger=ve(e,this.name),this.core=t}get context(){return en(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//`+this.name}get storageKeyWithoutClientAck(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//`+this.name+`_withoutClientAck`}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Re(e))}async setRelayerMessagesWithoutClientAck(e){await this.core.storage.setItem(this.storageKeyWithoutClientAck,Re(e))}async getRelayerMessages(){let e=await this.core.storage.getItem(this.storageKey);return typeof e<`u`?et(e):void 0}async getRelayerMessagesWithoutClientAck(){let e=await this.core.storage.getItem(this.storageKeyWithoutClientAck);return typeof e<`u`?et(e):void 0}async persist(){await this.setRelayerMessages(this.messages),await this.setRelayerMessagesWithoutClientAck(this.messagesWithoutClientAck)}isInitialized(){if(!this.initialized){let{message:e}=V(`NOT_INITIALIZED`,this.name);throw Error(e)}}},a_=class extends xh{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.events=new Kr.EventEmitter,this.name=Sg,this.queue=new Map,this.publishTimeout=(0,$.toMiliseconds)($.ONE_MINUTE),this.initialPublishTimeout=(0,$.toMiliseconds)($.ONE_SECOND*15),this.needsTransportRestart=!1,this.publish=async(e,t,n)=>{this.logger.debug(`Publishing Payload`),this.logger.trace({type:`method`,method:`publish`,params:{topic:e,message:t,opts:n}});let r=n?.ttl||xg,i=n?.prompt||!1,a=n?.tag||0,o=n?.id||re().toString(),s=Jt(Ze().protocol),c={id:o,method:n?.publishMethod||s.publish,params:{topic:e,message:t,ttl:r,prompt:i,tag:a,attestation:n?.attestation,...n?.tvf}},l=`Failed to publish payload, please try again. id:${o} tag:${a}`;try{at(c.params?.prompt)&&delete c.params?.prompt,at(c.params?.tag)&&delete c.params?.tag;let r=new Promise(async e=>{let t=({id:n})=>{c.id?.toString()===n.toString()&&(this.removeRequestFromQueue(n),this.relayer.events.removeListener(wg.publish,t),e())};this.relayer.events.on(wg.publish,t);let r=Ve(new Promise((e,t)=>{this.rpcPublish(c,n).then(e).catch(e=>{this.logger.warn(e,e?.message),t(e)})}),this.initialPublishTimeout,`Failed initial publish, retrying.... id:${o} tag:${a}`);try{await r,this.events.removeListener(wg.publish,t)}catch(e){this.queue.set(o,{request:c,opts:n,attempt:1}),this.logger.warn(e,e?.message)}});this.logger.trace({type:`method`,method:`publish`,params:{id:o,topic:e,message:t,opts:n}}),await Ve(r,this.publishTimeout,l)}catch(e){if(this.logger.debug(`Failed to Publish Payload`),this.logger.error(e),n?.internal?.throwOnFailedPublish)throw e}finally{this.queue.delete(o)}},this.publishCustom=async e=>{this.logger.debug(`Publishing custom payload`),this.logger.trace({type:`method`,method:`publishCustom`,params:e});let{payload:t,opts:n={}}=e,{attestation:r,tvf:i,publishMethod:a,prompt:o,tag:s,ttl:c=$.FIVE_MINUTES}=n,l=n.id||re().toString(),u=Jt(Ze().protocol),d=a||u.publish,f={id:l,method:d,params:{...t,ttl:c,prompt:o,tag:s,attestation:r,...i}},p=`Failed to publish custom payload, please try again. id:${l} tag:${s}`;try{at(f.params?.prompt)&&delete f.params?.prompt,at(f.params?.tag)&&delete f.params?.tag;let e=new Promise(async e=>{let t=({id:n})=>{f.id?.toString()===n.toString()&&(this.removeRequestFromQueue(n),this.relayer.events.removeListener(wg.publish,t),e())};this.relayer.events.on(wg.publish,t);let r=Ve(new Promise((e,t)=>{this.rpcPublish(f,n).then(e).catch(e=>{this.logger.warn(e,e?.message),t(e)})}),this.initialPublishTimeout,`Failed initial custom payload publish, retrying.... method:${d} id:${l} tag:${s}`);try{await r,this.events.removeListener(wg.publish,t)}catch(e){this.queue.set(l,{request:f,opts:n,attempt:1}),this.logger.warn(e,e?.message)}});this.logger.trace({type:`method`,method:`publish`,params:{id:l,payload:t,opts:n}}),await Ve(e,this.publishTimeout,p)}catch(e){if(this.logger.debug(`Failed to Publish Payload`),this.logger.error(e),n?.internal?.throwOnFailedPublish)throw e}finally{this.queue.delete(l)}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.relayer=e,this.logger=ve(t,this.name),this.registerEventListeners()}get context(){return en(this.logger)}async rpcPublish(e,t){this.logger.debug(`Outgoing Relay Payload`),this.logger.trace({type:`message`,direction:`outgoing`,request:e});let n=await this.relayer.request(e);return this.relayer.events.emit(wg.publish,{...e,...t}),this.logger.debug(`Successfully Published Payload`),n}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async(e,t)=>{let n=e.attempt+1;this.queue.set(t,{...e,attempt:n}),this.logger.warn({},`Publisher: queue->publishing: ${e.request.id}, tag: ${e.request.params?.tag}, attempt: ${n}`),await this.rpcPublish(e.request,e.opts),this.logger.warn({},`Publisher: queue->published: ${e.request.id}`)})}registerEventListeners(){this.relayer.core.heartbeat.on(ee.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(wg.connection_stalled);return}this.checkQueue()}),this.relayer.on(wg.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}},o_=class{constructor(){this.map=new Map,this.set=(e,t)=>{let n=this.get(e);this.exists(e,t)||this.map.set(e,[...n,t])},this.get=e=>this.map.get(e)||[],this.exists=(e,t)=>this.get(e).includes(t),this.delete=(e,t)=>{if(typeof t>`u`){this.map.delete(e);return}if(!this.map.has(e))return;let n=this.get(e);if(!this.exists(e,t))return;let r=n.filter(e=>e!==t);if(!r.length){this.map.delete(e);return}this.map.set(e,r)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}},s_=class extends wh{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.subscriptions=new Map,this.topicMap=new o_,this.events=new Kr.EventEmitter,this.name=Mg,this.version=`0.3`,this.pending=new Map,this.cached=[],this.initialized=!1,this.storagePrefix=pg,this.subscribeTimeout=(0,$.toMiliseconds)($.ONE_MINUTE),this.initialSubscribeTimeout=(0,$.toMiliseconds)($.ONE_SECOND*15),this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace(`Initialized`),this.registerEventListeners(),await this.restore()),this.initialized=!0},this.subscribe=async(e,t)=>{this.isInitialized(),this.logger.debug(`Subscribing Topic`),this.logger.trace({type:`method`,method:`subscribe`,params:{topic:e,opts:t}});try{let n=Ze(t),r={topic:e,relay:n,transportType:t?.transportType};t?.internal?.skipSubscribe||this.pending.set(e,r);let i=await this.rpcSubscribe(e,n,t);return typeof i==`string`&&(this.onSubscribe(i,r),this.logger.debug(`Successfully Subscribed Topic`),this.logger.trace({type:`method`,method:`subscribe`,params:{topic:e,opts:t}})),i}catch(e){throw this.logger.debug(`Failed to Subscribe Topic`),this.logger.error(e),e}},this.unsubscribe=async(e,t)=>{this.isInitialized(),typeof t?.id<`u`?await this.unsubscribeById(e,t.id,t):await this.unsubscribeByTopic(e,t)},this.isSubscribed=e=>new Promise(t=>{t(this.topicMap.topics.includes(e))}),this.isKnownTopic=e=>new Promise(t=>{t(this.topicMap.topics.includes(e)||this.pending.has(e)||this.cached.some(t=>t.topic===e))}),this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{await this.restore(),await this.onRestart()},this.checkPending=async()=>{if(this.pending.size===0&&(!this.initialized||!this.relayer.connected))return;let e=[];this.pending.forEach(t=>{e.push(t)}),await this.batchSubscribe(e)},this.registerEventListeners=()=>{this.relayer.core.heartbeat.on(ee.pulse,async()=>{await this.checkPending()}),this.events.on(jg.created,async e=>{let t=jg.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,data:e}),await this.persist()}),this.events.on(jg.deleted,async e=>{let t=jg.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,data:e}),await this.persist()})},this.relayer=e,this.logger=ve(t,this.name),this.clientId=``}get context(){return en(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+`//`+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}get hasAnyTopics(){return this.topicMap.topics.length>0||this.pending.size>0||this.cached.length>0||this.subscriptions.size>0}hasSubscription(e,t){let n=!1;try{n=this.getSubscription(e).topic===t}catch{}return n}reset(){this.cached=[],this.initialized=!0}onDisable(){this.values.length>0&&(this.cached=this.values),this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){let n=this.topicMap.get(e);await Promise.all(n.map(async n=>await this.unsubscribeById(e,n,t)))}async unsubscribeById(e,t,n){this.logger.debug(`Unsubscribing Topic`),this.logger.trace({type:`method`,method:`unsubscribe`,params:{topic:e,id:t,opts:n}});try{let r=$t(`USER_DISCONNECTED`,`${this.name}, ${e}`);await this.onUnsubscribe(e,t,r);let i=Ze(n);await this.restartToComplete({topic:e,id:t,relay:i}),await this.rpcUnsubscribe(e,t,i),this.logger.debug(`Successfully Unsubscribed Topic`),this.logger.trace({type:`method`,method:`unsubscribe`,params:{topic:e,id:t,opts:n}})}catch(e){throw this.logger.debug(`Failed to Unsubscribe Topic`),this.logger.error(e),e}}async rpcSubscribe(e,t,n){let r=await this.getSubscriptionId(e);if(n?.internal?.skipSubscribe)return r;(!n||n?.transportType===Og.relay)&&await this.restartToComplete({topic:e,id:e,relay:t});let i={method:Jt(t.protocol).subscribe,params:{topic:e}};this.logger.debug(`Outgoing Relay Payload`),this.logger.trace({type:`payload`,direction:`outgoing`,request:i});let a=n?.internal?.throwOnFailedPublish;try{if(n?.transportType===Og.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(i).catch(e=>this.logger.warn(e))},(0,$.toMiliseconds)($.ONE_SECOND)),r;let t=await Ve(new Promise(async t=>{let n=r=>{r.topic===e&&(this.events.removeListener(jg.created,n),t(r.id))};this.events.on(jg.created,n);try{let r=await Ve(new Promise((e,t)=>{this.relayer.request(i).catch(e=>{this.logger.warn(e,e?.message),t(e)}).then(e)}),this.initialSubscribeTimeout,`Subscribing to ${e} failed, please try again`);this.events.removeListener(jg.created,n),t(r)}catch{}}),this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!t&&a)throw Error(`Subscribing to ${e} failed, please try again`);return t?r:null}catch(e){if(this.logger.debug(`Outgoing Relay Subscribe Payload stalled`),this.relayer.events.emit(wg.connection_stalled),a)throw e}return null}async rpcBatchSubscribe(e){if(!e.length)return!0;let t=e[0].relay,n={method:Jt(t.protocol).batchSubscribe,params:{topics:e.map(e=>e.topic)}};this.logger.debug(`Outgoing Relay Payload`),this.logger.trace({type:`payload`,direction:`outgoing`,request:n});try{return await Ve(new Promise((e,t)=>{this.relayer.request(n).then(e).catch(e=>{this.logger.warn(e),t(e)})}),this.subscribeTimeout,`rpcBatchSubscribe failed, please try again`),!0}catch{return this.relayer.events.emit(wg.connection_stalled),!1}}async rpcBatchFetchMessages(e){if(!e.length)return;let t=e[0].relay,n={method:Jt(t.protocol).batchFetchMessages,params:{topics:e.map(e=>e.topic)}};this.logger.debug(`Outgoing Relay Payload`),this.logger.trace({type:`payload`,direction:`outgoing`,request:n});let r;try{r=await await Ve(new Promise((e,t)=>{this.relayer.request(n).catch(e=>{this.logger.warn(e),t(e)}).then(e)}),this.subscribeTimeout,`rpcBatchFetchMessages failed, please try again`)}catch{this.relayer.events.emit(wg.connection_stalled)}return r}rpcUnsubscribe(e,t,n){let r={method:Jt(n.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug(`Outgoing Relay Payload`),this.logger.trace({type:`payload`,direction:`outgoing`,request:r}),this.relayer.request(r)}onSubscribe(e,t){this.setSubscription(e,{...t,id:e}),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(e=>{this.setSubscription(e.id,{...e}),this.pending.delete(e.topic)})}async onUnsubscribe(e,t,n){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,n),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.logger.debug(`Setting subscription`),this.logger.trace({type:`method`,method:`setSubscription`,id:e,subscription:t}),this.addSubscription(e,t)}addSubscription(e,t){this.subscriptions.set(e,{...t}),this.topicMap.set(t.topic,e),this.events.emit(jg.created,t)}getSubscription(e){this.logger.debug(`Getting subscription`),this.logger.trace({type:`method`,method:`getSubscription`,id:e});let t=this.subscriptions.get(e);if(!t){let{message:t}=V(`NO_MATCHING_KEY`,`${this.name}: ${e}`);throw Error(t)}return t}deleteSubscription(e,t){this.logger.debug(`Deleting subscription`),this.logger.trace({type:`method`,method:`deleteSubscription`,id:e,reason:t});let n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(jg.deleted,{...n,reason:t})}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(jg.sync)}async onRestart(){if(this.cached.length){let e=[...this.cached],t=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let n=0;n<t;n++){let t=e.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(t)}}this.events.emit(jg.resubscribed)}async restore(){try{let e=await this.getRelayerSubscriptions();if(typeof e>`u`||!e.length)return;if(this.subscriptions.size&&!e.every(e=>e.topic===this.subscriptions.get(e.id)?.topic)){let{message:e}=V(`RESTORE_WILL_OVERRIDE`,this.name);throw this.logger.error(e),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:`method`,method:`restore`,subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(e.length){if(!await this.rpcBatchSubscribe(e)){this.logger.warn(`Batch subscribe failed for ${e.length} topics, adding to pending for retry`),e.forEach(e=>{this.pending.set(e.topic,e)});return}this.onBatchSubscribe(await Promise.all(e.map(async e=>({...e,id:await this.getSubscriptionId(e.topic)}))))}}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);let t=await this.rpcBatchFetchMessages(e);t&&t.messages&&(await Ye((0,$.toMiliseconds)($.ONE_SECOND)),await this.relayer.handleBatchMessageEvents(t.messages))}async onConnect(){await this.restart(),this.reset()}onDisconnect(){this.onDisable()}isInitialized(){if(!this.initialized){let{message:e}=V(`NOT_INITIALIZED`,this.name);throw Error(e)}}async restartToComplete(e){!this.relayer.connected&&!this.relayer.connecting&&(this.cached.push(e),await this.relayer.transportOpen())}async getClientId(){return this.clientId||=await this.relayer.core.crypto.getClientId(),this.clientId}async getSubscriptionId(e){return ze(e+await this.getClientId())}},c_=class extends Sh{constructor(e){super(e),this.protocol=`wc`,this.version=2,this.events=new Kr.EventEmitter,this.name=Cg,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.hasExperiencedNetworkDisruption=!1,this.heartBeatTimeout=(0,$.toMiliseconds)($.THIRTY_SECONDS+$.FIVE_SECONDS),this.reconnectInProgress=!1,this.requestsInFlight=[],this.connectTimeout=(0,$.toMiliseconds)($.ONE_SECOND*15),this.stalledRestartInProgress=!1,this.stalledRestartBackoff=0,this.stalledRestartBaseInterval=(0,$.toMiliseconds)($.ONE_SECOND*2),this.stalledRestartMaxInterval=(0,$.toMiliseconds)($.THIRTY_SECONDS),this.request=async e=>{this.logger.debug(`Publishing Request Payload`);let t=e.id||re().toString();await this.toEstablishConnection();try{this.logger.trace({id:t,method:e.method,topic:e.params?.topic},`relayer.request - publishing...`);let n=`${t}:${e.params?.tag||``}`;this.requestsInFlight.push(n);let r=await this.provider.request(e);return this.requestsInFlight=this.requestsInFlight.filter(e=>e!==n),r}catch(e){throw this.logger.debug(`Failed to Publish Request: ${t}`),e}},this.resetPingTimeout=()=>{Bt()&&(clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{try{this.logger.debug({},`pingTimeout: Connection stalled, terminating...`),this.provider?.connection?.socket?.terminate?.()}catch(e){this.logger.warn(e,e?.message)}},this.heartBeatTimeout))},this.onPayloadHandler=e=>{this.onProviderPayload(e),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.warn({},`Relayer connected 🛜`),this.startPingTimeout(),this.stalledRestartBackoff=0,this.events.emit(wg.connect)},this.onDisconnectHandler=()=>{this.logger.warn({},`Relayer disconnected 🛑`),this.requestsInFlight=[],this.onProviderDisconnect()},this.onProviderErrorHandler=e=>{this.logger.fatal(`Fatal socket error: ${e.message}`),this.events.emit(wg.error,e),this.logger.fatal(`Fatal socket error received, closing transport`),this.transportExplicitlyClosed=!0,clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,this.reconnectInProgress=!1,this.transportClose().catch(e=>this.logger.warn(e))},this.registerProviderListeners=()=>{this.provider.on(Tg.payload,this.onPayloadHandler),this.provider.on(Tg.connect,this.onConnectHandler),this.provider.on(Tg.disconnect,this.onDisconnectHandler),this.provider.on(Tg.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=Rt({logger:e.logger??`error`,name:this.name}),this.messages=new i_(this.logger,e.core),this.subscriber=new s_(this,this.logger),this.publisher=new a_(this,this.logger),this.projectId=e.projectId,this.relayUrl=e.relayUrl||`wss://relay.walletconnect.org`,gt()?this.packageName=Le():Ee()&&(this.bundleId=Le()),this.provider={}}async init(){this.logger.trace(`Initialized`),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.transportOpen().catch(e=>this.logger.warn(e,e?.message))}get context(){return en(this.logger)}get connected(){return this.provider?.connection?.socket?.readyState===1}get connecting(){return this.provider?.connection?.socket?.readyState===0||this.connectPromise!==void 0}async publish(e,t,n){this.isInitialized(),await this.publisher.publish(e,t,n),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now(),transportType:Og.relay},kg.outbound)}async publishCustom(e){this.isInitialized(),await this.publisher.publishCustom(e)}async subscribe(e,t){this.isInitialized(),(!t?.transportType||t?.transportType===`relay`)&&await this.toEstablishConnection();let n=t?.internal?.throwOnFailedPublish??!0,r=this.subscriber.topicMap.get(e)?.[0]||``,i,a=t=>{t.topic===e&&(this.subscriber.off(jg.created,a),i())};return await Promise.all([new Promise(e=>{i=e,this.subscriber.on(jg.created,a)}),new Promise((i,a)=>{this.subscriber.subscribe(e,{internal:{throwOnFailedPublish:n},...t}).then(e=>{r=e||r,i()}).catch(e=>{n?a(e):i()})})]),r}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportDisconnect(){this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await Ve(this.provider.disconnect(),2e3,`provider.disconnect()`).catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,clearTimeout(this.stalledRestartTimeout),this.stalledRestartInProgress=!1,this.stalledRestartBackoff=0,await this.resetTransport()}async transportOpen(e){if(!this.subscriber.hasAnyTopics){this.logger.info(`Starting WS connection skipped because the client has no topics to work with.`);return}if(this.connectPromise?(this.logger.debug({},`Waiting for existing connection attempt to resolve...`),await this.connectPromise,this.logger.debug({},`Existing connection attempt resolved`)):(this.connectPromise=this.connect(e).finally(()=>{this.connectPromise=void 0}),await this.connectPromise),!this.connected)throw Error(`Couldn't establish socket connection to the relay server: ${this.relayUrl}`)}async restartTransport(e){this.logger.debug({},`Restarting transport...`),!this.connectionAttemptInProgress&&(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.resetTransport(),await this.transportOpen())}async resetTransport(){this.reconnectInProgress=!0,clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,await this.transportDisconnect(),await this.subscriber.stop(),this.reconnectInProgress=!1}async confirmOnlineStateOrThrow(){if(!await Me())throw Error(`No internet connection detected. Please restart your network and try again.`)}async handleBatchMessageEvents(e){if(e?.length===0){this.logger.trace(`Batch message events is empty. Ignoring...`);return}let t=e.sort((e,t)=>e.publishedAt-t.publishedAt);this.logger.debug(`Batch of ${t.length} message events sorted`);for(let e of t)try{await this.onMessageEvent(e)}catch(e){this.logger.warn(e,`Error while processing batch message event: `+e?.message)}this.logger.trace(`Batch of ${t.length} message events processed`)}async onLinkMessageEvent(e,t){let{topic:n}=e;if(!t.sessionExists){let e={topic:n,expiry:Se($.FIVE_MINUTES),relay:{protocol:`irn`},active:!1};await this.core.pairing.pairings.set(n,e)}this.events.emit(wg.message,e),await this.recordMessageEvent(e,kg.inbound)}async connect(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),this.transportExplicitlyClosed=!1;let t=1;try{for(;t<6;){this.connectionAttemptInProgress=!0;try{if(this.transportExplicitlyClosed)break;this.logger.debug({},`Connecting to ${this.relayUrl}, attempt: ${t}...`),await this.createProvider(),await new Promise((e,t)=>{let n=()=>{t(Error(`Connection interrupted while trying to connect`))};this.provider.once(Tg.disconnect,n),Ve(this.provider.connect(),this.connectTimeout,`Socket stalled when trying to connect to ${this.relayUrl}`).then(()=>e()).catch(t).finally(()=>{this.provider.off(Tg.disconnect,n),clearTimeout(this.reconnectTimeout)})}),await new Promise((e,t)=>{let n=()=>{t(Error(`Connection interrupted while trying to subscribe`))};this.provider.once(Tg.disconnect,n),this.subscriber.start().then(e).catch(t).finally(()=>{this.provider.off(Tg.disconnect,n)})}),this.hasExperiencedNetworkDisruption=!1}catch(e){await this.subscriber.stop();let t=e;this.logger.warn({},t.message),this.hasExperiencedNetworkDisruption=!0}if(this.connected){this.logger.debug({},`Connected to ${this.relayUrl} successfully on attempt: ${t}`);break}await new Promise(e=>setTimeout(e,(0,$.toMiliseconds)(t*1))),t++}}finally{this.connectionAttemptInProgress=!1,clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,this.reconnectInProgress=!1}}startPingTimeout(){if(Bt())try{this.provider?.connection?.socket?.on(`ping`,()=>{this.resetPingTimeout()}),this.resetPingTimeout()}catch(e){this.logger.warn(e,e?.message)}}async createProvider(){if(this.provider.connection&&(this.unregisterProviderListeners(),this.connected))try{await Ve(this.provider.disconnect(),1e3,`Closing previous provider`)}catch{}let e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new ue(new se(Vt({sdkVersion:Dg,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId,packageName:this.packageName}))),this.registerProviderListeners()}async recordMessageEvent(e,t){let{topic:n,message:r}=e;await this.messages.set(n,r,t)}async shouldIgnoreMessageEvent(e){let{topic:t,message:n}=e;if(!n||n.length===0)return this.logger.warn(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isKnownTopic(t))return this.logger.warn(`Ignoring message for unknown topic ${t}`),!0;let r=this.messages.has(t,n);return r&&this.logger.warn(`Ignoring duplicate message: ${n}`),r}async onProviderPayload(e){if(this.logger.debug(`Incoming Relay Payload`),this.logger.trace({type:`payload`,direction:`incoming`,payload:e}),te(e)){if(!e.method.endsWith(`_subscription`))return;let t=e.params,{topic:n,message:r,publishedAt:i,attestation:a}=t.data,o={topic:n,message:r,publishedAt:i,transportType:Og.relay,attestation:a};this.logger.debug(`Emitting Relayer Payload`),this.logger.trace({type:`event`,event:t.id,...o}),this.events.emit(t.id,o),await this.acknowledgePayload(e),await this.onMessageEvent(o)}else ce(e)&&this.events.emit(wg.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(await this.recordMessageEvent(e,kg.inbound),this.events.emit(wg.message,e))}async acknowledgePayload(e){let t=ne(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(Tg.payload,this.onPayloadHandler),this.provider.off(Tg.connect,this.onConnectHandler),this.provider.off(Tg.disconnect,this.onDisconnectHandler),this.provider.off(Tg.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await Me();cn(async t=>{e!==t&&(e=t,t?await this.transportOpen().catch(e=>this.logger.error(e,e?.message)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))}),this.core.heartbeat.on(ee.pulse,async()=>{if(!this.transportExplicitlyClosed&&!this.connected&&At())try{await this.confirmOnlineStateOrThrow(),await this.transportOpen()}catch(e){this.logger.warn(e,e?.message)}}),this.events.on(wg.connection_stalled,()=>{if(this.transportExplicitlyClosed||this.stalledRestartInProgress)return;this.stalledRestartInProgress=!0;let e=this.stalledRestartBackoff===0?0:Math.min(2**(this.stalledRestartBackoff-1)*this.stalledRestartBaseInterval,this.stalledRestartMaxInterval);this.stalledRestartBackoff++,this.logger.warn(`Connection stalled, restarting transport${e?` in ${e}ms`:``}...`),this.stalledRestartTimeout=setTimeout(async()=>{try{if(this.transportExplicitlyClosed)return;await this.restartTransport()}catch(e){this.logger.error(e,e?.message)}finally{this.stalledRestartInProgress=!1}},e)})}async onProviderDisconnect(){if(clearTimeout(this.pingTimeout),this.events.emit(wg.disconnect),!this.reconnectInProgress){this.reconnectInProgress=!0;try{await this.subscriber.stop()}catch(e){this.logger.warn(e,`subscriber.stop() failed during disconnect`)}if(!this.subscriber.hasAnyTopics||this.transportExplicitlyClosed){this.reconnectInProgress=!1;return}this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e,e?.message)),this.reconnectTimeout=void 0,this.reconnectInProgress=!1},(0,$.toMiliseconds)(Eg))}}isInitialized(){if(!this.initialized){let{message:e}=V(`NOT_INITIALIZED`,this.name);throw Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectPromise){await this.connectPromise;return}this.connectPromise=this.connect().finally(()=>{this.connectPromise=void 0}),await this.connectPromise}}},l_=class extends Ch{constructor(e,t,n,r=pg,i=void 0){super(e,t,n,r),this.core=e,this.logger=t,this.name=n,this.map=new Map,this.version=`0.3`,this.cached=[],this.initialized=!1,this.storagePrefix=pg,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||=(this.logger.trace(`Initialized`),await this.restore(),this.cached.forEach(e=>{this.getKey&&e!==null&&!at(e)?this.map.set(this.getKey(e),e):ft(e)?this.map.set(e.id,e):B(e)&&this.map.set(e.topic,e)}),this.cached=[],!0)},this.set=async(e,t)=>{this.isInitialized(),this.map.has(e)?await this.update(e,t):(this.logger.debug(`Setting value`),this.logger.trace({type:`method`,method:`set`,key:e,value:t}),this.map.set(e,t),await this.persist())},this.get=e=>(this.isInitialized(),this.logger.debug(`Getting value`),this.logger.trace({type:`method`,method:`get`,key:e}),this.getData(e)),this.getAll=e=>(this.isInitialized(),e?this.values.filter(t=>Object.keys(e).every(n=>ug(t[n],e[n]))):this.values),this.update=async(e,t)=>{this.isInitialized(),this.logger.debug(`Updating value`),this.logger.trace({type:`method`,method:`update`,key:e,update:t});let n={...this.getData(e),...t};this.map.set(e,n),await this.persist()},this.delete=async(e,t)=>{this.isInitialized(),this.map.has(e)&&(this.logger.debug(`Deleting value`),this.logger.trace({type:`method`,method:`delete`,key:e,reason:t}),this.map.delete(e),this.addToRecentlyDeleted(e),await this.persist())},this.logger=ve(t,this.name),this.storagePrefix=r,this.getKey=i}get context(){return en(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//`+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){let t=this.map.get(e);if(!t){if(this.recentlyDeleted.includes(e)){let{message:t}=V(`MISSING_OR_INVALID`,`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(t),Error(t)}let{message:t}=V(`NO_MATCHING_KEY`,`${this.name}: ${e}`);throw this.logger.error(t),Error(t)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{let e=await this.getDataStore();if(typeof e>`u`||!e.length)return;if(this.map.size){let{message:e}=V(`RESTORE_WILL_OVERRIDE`,this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:`method`,method:`restore`,value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){let{message:e}=V(`NOT_INITIALIZED`,this.name);throw Error(e)}}},u_=class{constructor(e,t){this.core=e,this.logger=t,this.name=Ng,this.version=`0.3`,this.events=new Kr.default,this.initialized=!1,this.storagePrefix=pg,this.ignoredPayloadTypes=[1],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace(`Initialized`))},this.register=({methods:e})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...e])]},this.create=async e=>{this.isInitialized();let t=Ne(),n=await this.core.crypto.setSymKey(t),r=Se($.FIVE_MINUTES),i={protocol:`irn`},a={topic:n,expiry:r,relay:i,active:!1,methods:e?.methods},o=Wt({protocol:this.core.protocol,version:this.core.version,topic:n,symKey:t,relay:i,expiryTimestamp:r,methods:e?.methods});return this.events.emit(Fg.create,a),this.core.expirer.set(n,r),await this.pairings.set(n,a),await this.core.relayer.subscribe(n,{transportType:e?.transportType,internal:e?.internal}),{topic:n,uri:o}},this.pair=async e=>{this.isInitialized();let t=this.core.eventClient.createEvent({properties:{topic:e?.uri,trace:[qg.pairing_started]}});this.isValidPair(e,t);let{topic:n,symKey:r,relay:i,expiryTimestamp:a,methods:o}=Ce(e.uri);t.props.properties.topic=n,t.addTrace(qg.pairing_uri_validation_success),t.addTrace(qg.pairing_uri_not_expired);let s;if(this.pairings.keys.includes(n)){if(s=this.pairings.get(n),t.addTrace(qg.existing_pairing),s.active)throw t.setError(Jg.active_pairing_already_exists),Error(`Pairing already exists: ${n}. Please try again with a new connection URI.`);t.addTrace(qg.pairing_not_expired)}let c=a||Se($.FIVE_MINUTES),l={topic:n,relay:i,expiry:c,active:!1,methods:o};this.core.expirer.set(n,c),await this.pairings.set(n,l),t.addTrace(qg.store_new_pairing),e.activatePairing&&await this.activate({topic:n}),this.events.emit(Fg.create,l),t.addTrace(qg.emit_inactive_pairing),this.core.crypto.keychain.has(n)||await this.core.crypto.setSymKey(r,n),t.addTrace(qg.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{t.setError(Jg.no_internet_connection)}try{await this.core.relayer.subscribe(n,{relay:i})}catch(e){throw t.setError(Jg.subscribe_pairing_topic_failure),e}return t.addTrace(qg.subscribe_pairing_topic_success),l},this.activate=async({topic:e})=>{this.isInitialized();let t=Se($.FIVE_MINUTES);this.core.expirer.set(e,t),await this.pairings.update(e,{active:!0,expiry:t})},this.ping=async e=>{this.isInitialized(),await this.isValidPing(e),this.logger.warn(`ping() is deprecated and will be removed in the next major release.`);let{topic:t}=e;if(this.pairings.keys.includes(t)){let e=await this.sendRequest(t,`wc_pairingPing`,{}),{done:n,resolve:r,reject:i}=Ue();this.events.once(H(`pairing_ping`,e),({error:e})=>{e?i(e):r()}),await n()}},this.updateExpiry=async({topic:e,expiry:t})=>{this.isInitialized(),await this.pairings.update(e,{expiry:t})},this.updateMetadata=async({topic:e,metadata:t})=>{this.isInitialized(),await this.pairings.update(e,{peerMetadata:t})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async e=>{this.isInitialized(),await this.isValidDisconnect(e);let{topic:t}=e;this.pairings.keys.includes(t)&&(await this.sendRequest(t,`wc_pairingDelete`,$t(`USER_DISCONNECTED`)),await this.deletePairing(t))},this.formatUriFromPairing=e=>{this.isInitialized();let{topic:t,relay:n,expiry:r,methods:i}=e,a=this.core.crypto.keychain.get(t);return Wt({protocol:this.core.protocol,version:this.core.version,topic:t,symKey:a,relay:n,expiryTimestamp:r,methods:i})},this.sendRequest=async(e,t,n)=>{let r=pe(t,n),i=await this.core.crypto.encode(e,r),a=Pg[t].req;return this.core.history.set(e,r),this.core.relayer.publish(e,i,a),r.id},this.sendResult=async(e,t,n)=>{let r=ne(e,n),i=await this.core.crypto.encode(t,r),a=Pg[(await this.core.history.get(t,e)).request.method].res;await this.core.relayer.publish(t,i,a),await this.core.history.resolve(r)},this.sendError=async(e,t,n)=>{let r=oe(e,n),i=await this.core.crypto.encode(t,r),a=(await this.core.history.get(t,e)).request.method,o=Pg[a]?Pg[a].res:Pg.unregistered_method.res;await this.core.relayer.publish(t,i,o),await this.core.history.resolve(r)},this.deletePairing=async(e,t)=>{await this.core.relayer.unsubscribe(e),await Promise.all([this.pairings.delete(e,$t(`USER_DISCONNECTED`)),this.core.crypto.deleteSymKey(e),t?Promise.resolve():this.core.expirer.del(e)])},this.cleanup=async()=>{let e=this.pairings.getAll().filter(e=>Lt(e.expiry));await Promise.all(e.map(e=>this.deletePairing(e.topic)))},this.onRelayEventRequest=async e=>{let{topic:t,payload:n}=e;switch(n.method){case`wc_pairingPing`:return await this.onPairingPingRequest(t,n);case`wc_pairingDelete`:return await this.onPairingDeleteRequest(t,n);default:return await this.onUnknownRpcMethodRequest(t,n)}},this.onRelayEventResponse=async e=>{let{topic:t,payload:n}=e,r=(await this.core.history.get(t,n.id)).request.method;switch(r){case`wc_pairingPing`:return this.onPairingPingResponse(t,n);default:return this.onUnknownRpcMethodResponse(r)}},this.onPairingPingRequest=async(e,t)=>{let{id:n}=t;try{this.isValidPing({topic:e}),await this.sendResult(n,e,!0),this.events.emit(Fg.ping,{id:n,topic:e})}catch(t){await this.sendError(n,e,t),this.logger.error(t)}},this.onPairingPingResponse=(e,t)=>{let{id:n}=t;setTimeout(()=>{de(t)?this.events.emit(H(`pairing_ping`,n),{}):z(t)&&this.events.emit(H(`pairing_ping`,n),{error:t.error})},500)},this.onPairingDeleteRequest=async(e,t)=>{let{id:n}=t;try{this.isValidDisconnect({topic:e}),await this.deletePairing(e),this.events.emit(Fg.delete,{id:n,topic:e})}catch(t){await this.sendError(n,e,t),this.logger.error(t)}},this.onUnknownRpcMethodRequest=async(e,t)=>{let{id:n,method:r}=t;try{if(this.registeredMethods.includes(r))return;let t=$t(`WC_METHOD_UNSUPPORTED`,r);await this.sendError(n,e,t),this.logger.error(t)}catch(t){await this.sendError(n,e,t),this.logger.error(t)}},this.onUnknownRpcMethodResponse=e=>{this.registeredMethods.includes(e)||this.logger.error($t(`WC_METHOD_UNSUPPORTED`,e))},this.isValidPair=(e,t)=>{if(!_e(e)){let{message:n}=V(`MISSING_OR_INVALID`,`pair() params: ${e}`);throw t.setError(Jg.malformed_pairing_uri),Error(n)}if(!nn(e.uri)){let{message:n}=V(`MISSING_OR_INVALID`,`pair() uri: ${e.uri}`);throw t.setError(Jg.malformed_pairing_uri),Error(n)}let n=Ce(e?.uri);if(!n?.relay?.protocol){let{message:e}=V(`MISSING_OR_INVALID`,`pair() uri#relay-protocol`);throw t.setError(Jg.malformed_pairing_uri),Error(e)}if(!n?.symKey){let{message:e}=V(`MISSING_OR_INVALID`,`pair() uri#symKey`);throw t.setError(Jg.malformed_pairing_uri),Error(e)}if(n?.expiryTimestamp&&(0,$.toMiliseconds)(n?.expiryTimestamp)<Date.now()){t.setError(Jg.pairing_expired);let{message:e}=V(`EXPIRED`,`pair() URI has expired. Please try again with a new connection URI.`);throw Error(e)}},this.isValidPing=async e=>{if(!_e(e)){let{message:t}=V(`MISSING_OR_INVALID`,`ping() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidDisconnect=async e=>{if(!_e(e)){let{message:t}=V(`MISSING_OR_INVALID`,`disconnect() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidPairingTopic=async e=>{if(!zt(e,!1)){let{message:t}=V(`MISSING_OR_INVALID`,`pairing topic should be a string: ${e}`);throw Error(t)}if(!this.pairings.keys.includes(e)){let{message:t}=V(`NO_MATCHING_KEY`,`pairing topic doesn't exist: ${e}`);throw Error(t)}if(Lt(this.pairings.get(e).expiry)){await this.deletePairing(e);let{message:t}=V(`EXPIRED`,`pairing topic: ${e}`);throw Error(t)}},this.core=e,this.logger=ve(t,this.name),this.pairings=new l_(this.core,this.logger,this.name,this.storagePrefix)}get context(){return en(this.logger)}isInitialized(){if(!this.initialized){let{message:e}=V(`NOT_INITIALIZED`,this.name);throw Error(e)}}registerRelayerEvents(){this.core.relayer.on(wg.message,async e=>{let{topic:t,message:n,transportType:r}=e;if(this.pairings.keys.includes(t)&&r!==Og.link_mode&&!this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))try{let e=await this.core.crypto.decode(t,n);te(e)?(this.core.history.set(t,e),await this.onRelayEventRequest({topic:t,payload:e})):ce(e)&&(await this.core.history.resolve(e),await this.onRelayEventResponse({topic:t,payload:e}),this.core.history.delete(t,e.id)),await this.core.relayer.messages.ack(t,n)}catch(e){this.logger.error(e)}})}registerExpirerEvents(){this.core.expirer.on(zg.expired,async e=>{let{topic:t}=We(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(Fg.expire,{topic:t}))})}},d_=class extends yh{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.records=new Map,this.events=new Kr.EventEmitter,this.name=Lg,this.version=`0.3`,this.cached=[],this.initialized=!1,this.storagePrefix=pg,this.init=async()=>{this.initialized||=(this.logger.trace(`Initialized`),await this.restore(),this.cached.forEach(e=>this.records.set(e.id,e)),this.cached=[],this.registerEventListeners(),!0)},this.set=(e,t,n)=>{if(this.isInitialized(),this.logger.debug(`Setting JSON-RPC request history record`),this.logger.trace({type:`method`,method:`set`,topic:e,request:t,chainId:n}),this.records.has(t.id))return;let r={id:t.id,topic:e,request:{method:t.method,params:t.params||null},chainId:n,expiry:Se($.THIRTY_DAYS)};this.records.set(r.id,r),this.persist(),this.events.emit(Ig.created,r)},this.resolve=async e=>{if(this.isInitialized(),this.logger.debug(`Updating JSON-RPC response history record`),this.logger.trace({type:`method`,method:`update`,response:e}),!this.records.has(e.id))return;let t=await this.getRecord(e.id);typeof t.response<`u`||(t.response=z(e)?{error:e.error}:{result:e.result},this.records.set(t.id,t),this.persist(),this.events.emit(Ig.updated,t))},this.get=async(e,t)=>(this.isInitialized(),this.logger.debug(`Getting record`),this.logger.trace({type:`method`,method:`get`,topic:e,id:t}),await this.getRecord(t)),this.delete=(e,t)=>{this.isInitialized(),this.logger.debug(`Deleting record`),this.logger.trace({type:`method`,method:`delete`,id:t}),this.values.forEach(n=>{if(n.topic===e){if(typeof t<`u`&&n.id!==t)return;this.records.delete(n.id),this.events.emit(Ig.deleted,n)}}),this.persist()},this.exists=async(e,t)=>(this.isInitialized(),this.records.has(t)?(await this.getRecord(t)).topic===e:!1),this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=ve(t,this.name)}get context(){return en(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//`+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){let e=[];return this.values.forEach(t=>{if(typeof t.response<`u`)return;let n={topic:t.topic,request:pe(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(n)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();let t=this.records.get(e);if(!t){let{message:t}=V(`NO_MATCHING_KEY`,`${this.name}: ${e}`);throw Error(t)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Ig.sync)}async restore(){try{let e=await this.getJsonRpcRecords();if(typeof e>`u`||!e.length)return;if(this.records.size){let{message:e}=V(`RESTORE_WILL_OVERRIDE`,this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:`method`,method:`restore`,records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(Ig.created,e=>{let t=Ig.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,record:e})}),this.events.on(Ig.updated,e=>{let t=Ig.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,record:e})}),this.events.on(Ig.deleted,e=>{let t=Ig.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,record:e})}),this.core.heartbeat.on(ee.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(t=>{(0,$.toMiliseconds)(t.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${t.id}`),this.records.delete(t.id),this.events.emit(Ig.deleted,t,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){let{message:e}=V(`NOT_INITIALIZED`,this.name);throw Error(e)}}},f_=class extends Th{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.expirations=new Map,this.events=new Kr.EventEmitter,this.name=Rg,this.version=`0.3`,this.cached=[],this.initialized=!1,this.storagePrefix=pg,this.init=async()=>{this.initialized||=(this.logger.trace(`Initialized`),await this.restore(),this.cached.forEach(e=>this.expirations.set(e.target,e)),this.cached=[],this.registerEventListeners(),!0)},this.has=e=>{try{let t=this.formatTarget(e);return typeof this.getExpiration(t)<`u`}catch{return!1}},this.set=(e,t)=>{this.isInitialized();let n=this.formatTarget(e),r={target:n,expiry:t};this.expirations.set(n,r),this.checkExpiry(n,r),this.events.emit(zg.created,{target:n,expiration:r})},this.get=e=>{this.isInitialized();let t=this.formatTarget(e);return this.getExpiration(t)},this.del=e=>{if(this.isInitialized(),this.has(e)){let t=this.formatTarget(e),n=this.getExpiration(t);this.expirations.delete(t),this.events.emit(zg.deleted,{target:t,expiration:n})}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=ve(t,this.name)}get context(){return en(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//`+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e==`string`)return Nt(e);if(typeof e==`number`)return an(e);let{message:t}=V(`UNKNOWN_TYPE`,`Target type: ${typeof e}`);throw Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(zg.sync)}async restore(){try{let e=await this.getExpirations();if(typeof e>`u`||!e.length)return;if(this.expirations.size){let{message:e}=V(`RESTORE_WILL_OVERRIDE`,this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:`method`,method:`restore`,expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){let t=this.expirations.get(e);if(!t){let{message:t}=V(`NO_MATCHING_KEY`,`${this.name}: ${e}`);throw this.logger.warn(t),Error(t)}return t}checkExpiry(e,t){let{expiry:n}=t;(0,$.toMiliseconds)(n)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(zg.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(ee.pulse,()=>this.checkExpirations()),this.events.on(zg.created,e=>{let t=zg.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,data:e}),this.persist()}),this.events.on(zg.expired,e=>{let t=zg.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,data:e}),this.persist()}),this.events.on(zg.deleted,e=>{let t=zg.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:`event`,event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){let{message:e}=V(`NOT_INITIALIZED`,this.name);throw Error(e)}}},p_=class extends Eh{constructor(e,t,n){super(e,t,n),this.core=e,this.logger=t,this.store=n,this.name=Bg,this.verifyUrlV3=Ug,this.storagePrefix=pg,this.version=2,this.init=async()=>{this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&(0,$.toMiliseconds)(this.publicKey?.expiresAt)<Date.now()&&(this.logger.debug(`verify v2 public key expired`),await this.removePublicKey()))},this.register=async e=>{if(!Ae()||this.isDevEnv)return;let t=window.location.origin,{id:n,decryptedId:r}=e,i=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${t}&id=${n}&decryptedId=${r}`;try{let e=(0,dg.getDocument)(),t=this.startAbortTimer($.ONE_SECOND*5),r=await new Promise((r,a)=>{let o=()=>{window.removeEventListener(`message`,c),e.body.removeChild(s),a(`attestation aborted`)};this.abortController.signal.addEventListener(`abort`,o);let s=e.createElement(`iframe`);s.src=i,s.style.display=`none`,s.addEventListener(`error`,o,{signal:this.abortController.signal});let c=i=>{if(i.data&&typeof i.data==`string`)try{let a=JSON.parse(i.data);if(a.type===`verify_attestation`){if(F(a.attestation).payload.id!==n)return;clearInterval(t),e.body.removeChild(s),this.abortController.signal.removeEventListener(`abort`,o),window.removeEventListener(`message`,c),r(a.attestation===null?``:a.attestation)}}catch(e){this.logger.warn(e)}};e.body.appendChild(s),window.addEventListener(`message`,c,{signal:this.abortController.signal})});return this.logger.debug(r,`jwt attestation`),r}catch(e){this.logger.warn(e)}return``},this.resolve=async e=>{if(this.isDevEnv)return``;let{attestationId:t,hash:n,encryptedId:r}=e;if(t===``){this.logger.debug(`resolve: attestationId is empty, skipping`);return}if(t){if(F(t).payload.id!==r)return;let e=await this.isValidJwtAttestation(t);if(e){if(!e.isVerified){this.logger.warn(`resolve: jwt attestation: origin url not verified`);return}return e}}if(!n)return;let i=this.getVerifyUrl(e?.verifyUrl);return this.fetchAttestation(n,i)},this.fetchAttestation=async(e,t)=>{this.logger.debug(`resolving attestation: ${e} from url: ${t}`);let n=this.startAbortTimer($.ONE_SECOND*5),r=await fetch(`${t}/attestation/${e}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(n),r.status===200?await r.json():void 0},this.getVerifyUrl=e=>{let t=e||`https://verify.walletconnect.org`;return Wg.includes(t)||(this.logger.info(`verify url: ${t}, not included in trusted list, assigning default: https://verify.walletconnect.org`),t=`https://verify.walletconnect.org`),t},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);let e=this.startAbortTimer($.FIVE_SECONDS),t=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(e),await t.json()}catch(e){this.logger.warn(e)}},this.persistPublicKey=async e=>{this.logger.debug(e,`persisting public key to local storage`),await this.store.setItem(this.storeKey,e),this.publicKey=e},this.removePublicKey=async()=>{this.logger.debug(`removing verify v2 public key from storage`),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async e=>{let t=await this.getPublicKey();try{if(t)return this.validateAttestation(e,t)}catch(e){this.logger.error(e),this.logger.warn(`error validating attestation`)}let n=await this.fetchAndPersistPublicKey();try{if(n)return this.validateAttestation(e,n)}catch(e){this.logger.error(e),this.logger.warn(`error validating attestation`)}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async e=>{let t=await this.fetchPublicKey();t&&(await this.persistPublicKey(t),e(t))});let e=await this.fetchPromise;return this.fetchPromise=void 0,e},this.validateAttestation=(e,t)=>{let n=Tt(e,t.publicKey),r={hasExpired:(0,$.toMiliseconds)(n.exp)<Date.now(),payload:n};if(r.hasExpired)throw this.logger.warn(`resolve: jwt attestation expired`),Error(`JWT attestation expired`);return{origin:r.payload.origin,isScam:r.payload.isScam,isVerified:r.payload.isVerified}},this.logger=ve(t,this.name),this.abortController=new AbortController,this.isDevEnv=pn(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+`//verify:public:key`}get context(){return en(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),(0,$.toMiliseconds)(e))}},m_=class extends Dh{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.context=Gg,this.registerDeviceToken=async e=>{let{clientId:t,token:n,notificationType:r,enableEncrypted:i=!1}=e,a=`${Kg}/${this.projectId}/clients`;await fetch(a,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({client_id:t,type:r,token:n,always_raw:i})})},this.logger=ve(t,this.context)}},h_=class extends Oh{constructor(e,t,n=!0){super(e,t,n),this.core=e,this.logger=t,this.context=e_,this.storagePrefix=pg,this.storageVersion=$g,this.events=new Map,this.shouldPersist=!1,this.init=async()=>{if(!pn())try{let e={eventId:tn(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:`INIT`,type:``,properties:{client_id:await this.core.crypto.getClientId(),user_agent:wt(this.core.relayer.protocol,this.core.relayer.version,Dg)}}};await this.sendEvent([e])}catch(e){this.logger.warn(e)}},this.createEvent=e=>{let{event:t=`ERROR`,type:n=``,properties:{topic:r,trace:i}}=e,a=tn(),o=this.core.projectId||``,s={eventId:a,timestamp:Date.now(),props:{event:t,type:n,properties:{topic:r,trace:i}},bundleId:o,domain:this.getAppDomain(),...this.setMethods(a)};return this.telemetryEnabled&&(this.events.set(a,s),this.shouldPersist=!0),s},this.getEvent=e=>{let{eventId:t,topic:n}=e;if(t)return this.events.get(t);let r=Array.from(this.events.values()).find(e=>e.props.properties.topic===n);if(r)return{...r,...this.setMethods(r.eventId)}},this.deleteEvent=e=>{let{eventId:t}=e;this.events.delete(t),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(ee.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(e=>{(0,$.fromMiliseconds)(Date.now())-(0,$.fromMiliseconds)(e.timestamp)>86400&&(this.events.delete(e.eventId),this.shouldPersist=!0)})})},this.setMethods=e=>({addTrace:t=>this.addTrace(e,t),setError:t=>this.setError(e,t)}),this.addTrace=(e,t)=>{let n=this.events.get(e);n&&(n.props.properties.trace.push(t),this.events.set(e,n),this.shouldPersist=!0)},this.setError=(e,t)=>{let n=this.events.get(e);n&&(n.props.type=t,n.timestamp=Date.now(),this.events.set(e,n),this.shouldPersist=!0)},this.persist=async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1},this.restore=async()=>{try{let e=await this.core.storage.getItem(this.storageKey)||[];if(!e.length)return;e.forEach(e=>{this.events.set(e.eventId,{...e,...this.setMethods(e.eventId)})})}catch(e){this.logger.warn(e)}},this.submit=async()=>{if(!this.telemetryEnabled||this.events.size===0)return;let e=[];for(let[t,n]of this.events)n.props.type&&e.push(n);if(e.length!==0)try{if((await this.sendEvent(e)).ok)for(let t of e)this.events.delete(t.eventId),this.shouldPersist=!0}catch(e){this.logger.warn(e)}},this.sendEvent=async e=>{let t=this.getAppDomain()?``:`&sp=desktop`;return await fetch(`${t_}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${Dg}${t}`,{method:`POST`,body:JSON.stringify(e)})},this.getAppDomain=()=>Ge().url,this.logger=ve(t,this.context),this.telemetryEnabled=n,n?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+`//`+this.context}},g_=class e extends vh{constructor(e){super(e),this.protocol=`wc`,this.version=2,this.name=fg,this.events=new Kr.EventEmitter,this.initialized=!1,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.dispatchEnvelope=({topic:e,message:t,sessionExists:n})=>{if(!e||!t)return;let r={topic:e,message:t,publishedAt:Date.now(),transportType:Og.link_mode};this.relayer.onLinkMessageEvent(r,{sessionExists:n})};let t=this.getGlobalCore(e?.customStoragePrefix);if(t)try{return this.customStoragePrefix=t.customStoragePrefix,this.logger=t.logger,this.heartbeat=t.heartbeat,this.crypto=t.crypto,this.history=t.history,this.expirer=t.expirer,this.storage=t.storage,this.relayer=t.relayer,this.pairing=t.pairing,this.verify=t.verify,this.echoClient=t.echoClient,this.linkModeSupportedApps=t.linkModeSupportedApps,this.eventClient=t.eventClient,this.initialized=t.initialized,this.logChunkController=t.logChunkController,t}catch{}this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||`wss://relay.walletconnect.org`,this.customStoragePrefix=e?.customStoragePrefix?`:${e.customStoragePrefix}`:``;let{logger:n,chunkLoggerController:r}=Ct({opts:Xe({level:typeof e?.logger==`string`&&e.logger?e.logger:mg.logger,name:fg}),maxSizeInBytes:e?.maxLogBlobSizeInBytes,loggerOverride:e?.logger});this.logChunkController=r,this.logChunkController?.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{this.logChunkController?.downloadLogsBlobInBrowser&&this.logChunkController?.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()})}),this.logger=ve(n,this.name),this.heartbeat=new ie,this.crypto=new r_(this,this.logger,e?.keychain),this.history=new d_(this,this.logger),this.expirer=new f_(this,this.logger),this.storage=e?.storage?e.storage:new ae({...hg,...e?.storageOptions}),this.relayer=new c_({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new u_(this,this.logger),this.verify=new p_(this,this.logger,this.storage),this.echoClient=new m_(this.projectId||``,this.logger),this.linkModeSupportedApps=[],this.eventClient=new h_(this,this.logger,e?.telemetryEnabled),this.setGlobalCore(this)}static async init(t){let n=new e(t);await n.initialize();let r=await n.crypto.getClientId();return await n.storage.setItem(Ag,r),n}get context(){return en(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){return this.logChunkController?.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(`WALLETCONNECT_LINK_MODE_APPS`,this.linkModeSupportedApps))}async initialize(){this.logger.trace(`Initialized`);try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.linkModeSupportedApps=await this.storage.getItem(`WALLETCONNECT_LINK_MODE_APPS`)||[],this.initialized=!0,this.logger.info(`Core Initialization Success`)}catch(e){throw this.logger.warn(e,`Core Initialization Failure at epoch ${Date.now()}`),this.logger.error(e.message),e}}getGlobalCore(e=``){try{if(this.isGlobalCoreDisabled())return;let t=`_walletConnectCore_${e}`,n=`${t}_count`;return globalThis[n]=(globalThis[n]||0)+1,globalThis[n],globalThis[t]}catch{return}}setGlobalCore(e){try{if(this.isGlobalCoreDisabled())return;let t=`_walletConnectCore_${e.opts?.customStoragePrefix||``}`;globalThis[t]=e}catch{}}isGlobalCoreDisabled(){try{return typeof o<`u`&&{}.DISABLE_GLOBAL_CORE===`true`}catch{return!0}}};m();var __=`client`,v_=`wc@2:${__}:`,y_={name:__,logger:`error`,controller:!1,relayUrl:`wss://relay.walletconnect.org`},b_=`WALLETCONNECT_DEEPLINK_CHOICE`,x_=`proposal`;$.THIRTY_DAYS;var S_=`Proposal expired`,C_=`session`,w_=$.SEVEN_DAYS,T_=`engine`,E_={wc_sessionPropose:{req:{ttl:$.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:$.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:$.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:$.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:$.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:$.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:$.ONE_DAY,prompt:!1,tag:1104},res:{ttl:$.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:$.ONE_DAY,prompt:!1,tag:1106},res:{ttl:$.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:$.FIVE_MINUTES*3,prompt:!0,tag:1108},res:{ttl:$.FIVE_MINUTES*3,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:$.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:$.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:$.ONE_DAY,prompt:!1,tag:1112},res:{ttl:$.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:$.ONE_DAY,prompt:!1,tag:1114},res:{ttl:$.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:$.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:$.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:$.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:$.FIVE_MINUTES,prompt:!1,tag:1119}}},D_={min:$.FIVE_MINUTES,max:$.SEVEN_DAYS},O_={idle:`IDLE`,active:`ACTIVE`},k_={eth_sendTransaction:{key:``},eth_sendRawTransaction:{key:``},wallet_sendCalls:{key:``},solana_signTransaction:{key:`signature`},solana_signAllTransactions:{key:`transactions`},solana_signAndSendTransaction:{key:`signature`},sui_signAndExecuteTransaction:{key:`digest`},sui_signTransaction:{key:``},hedera_signAndExecuteTransaction:{key:`transactionId`},hedera_executeTransaction:{key:`transactionId`},near_signTransaction:{key:``},near_signTransactions:{key:``},tron_signTransaction:{key:`txID`},xrpl_signTransaction:{key:``},xrpl_signTransactionFor:{key:``},algo_signTxn:{key:``},sendTransfer:{key:`txid`},stacks_stxTransfer:{key:`txId`},polkadot_signTransaction:{key:``},cosmos_signDirect:{key:``}},A_=`request`,j_=[`wc_sessionPropose`,`wc_sessionRequest`,`wc_authRequest`,`wc_sessionAuthenticate`],M_=`auth`,N_=`authKeys`,P_=`pairingTopics`,F_=`requests`,I_=`wc@1.5:${M_}:`,L_=`${I_}:PUB_KEY`,R_=class extends Ah{constructor(e){super(e),this.name=T_,this.events=new Kr.default,this.initialized=!1,this.requestQueue={state:O_.idle,queue:[]},this.sessionRequestQueue={state:O_.idle,queue:[]},this.emittedSessionRequests=new Mt({limit:500}),this.requestQueueDelay=$.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.pendingSessions=new Map,this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.registerSubscriptionCleanup(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(E_)}),this.initialized=!0,setTimeout(async()=>{await this.processPendingMessageEvents(),this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},(0,$.toMiliseconds)(this.requestQueueDelay)))},this.connect=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();let t={...e,requiredNamespaces:e.requiredNamespaces||{},optionalNamespaces:e.optionalNamespaces||{}};await this.isValidConnect(t),t.optionalNamespaces=Je(t.requiredNamespaces,t.optionalNamespaces),t.requiredNamespaces={};let{pairingTopic:n,requiredNamespaces:r,optionalNamespaces:i,sessionProperties:a,scopedProperties:o,relays:s,authentication:c,walletPay:l}=t,u=c?.[0]?.ttl||E_.wc_sessionPropose.req.ttl||$.FIVE_MINUTES;this.validateRequestExpiry(u);let d=n,f,p=!1;try{if(d){let e=this.client.core.pairing.pairings.get(d);this.client.logger.warn(`connect() with existing pairing topic is deprecated and will be removed in the next major release.`),p=e.active}}catch(e){throw this.client.logger.error(`connect() -> pairing.get(${d}) failed`),e}if(!d||!p){let{topic:e,uri:t}=await this.client.core.pairing.create({internal:{skipSubscribe:!0}});d=e,f=t}if(!d){let{message:e}=V(`NO_MATCHING_KEY`,`connect() pairing topic: ${d}`);throw Error(e)}let m=await this.client.core.crypto.generateKeyPair(),h=Se(u),g={requiredNamespaces:r,optionalNamespaces:i,relays:s??[{protocol:`irn`}],proposer:{publicKey:m,metadata:this.client.metadata},expiryTimestamp:h,pairingTopic:d,...a&&{sessionProperties:a},...o&&{scopedProperties:o},id:le(),...(c||l)&&{requests:{authentication:c?.map(e=>{let{domain:t,chains:n,nonce:r,uri:i,exp:a,nbf:o,type:s,statement:c,requestId:l,resources:u,signatureTypes:d}=e;return{domain:t,chains:n,nonce:r,type:s??`caip122`,aud:i,version:`1`,iat:new Date().toISOString(),exp:a,nbf:o,statement:c,requestId:l,resources:u,signatureTypes:d}}),walletPay:l}}},_=H(`session_connect`,g.id),{reject:v,resolve:y,done:b}=Ue(u,S_),x=({id:e})=>{if(e===g.id){this.client.events.off(`proposal_expire`,x);let e=this.pendingSessions.get(g.id);if(e){let{sessionTopic:t,publicKey:n}=e;Promise.all([this.client.core.relayer.unsubscribe(t),this.client.core.crypto.keychain.has(t)?this.client.core.crypto.deleteSymKey(t):Promise.resolve(),this.client.core.crypto.keychain.has(n)?this.client.core.crypto.deleteKeyPair(n):Promise.resolve()]).catch(e=>this.client.logger.warn(e))}this.pendingSessions.delete(g.id),this.events.emit(_,{error:{message:S_,code:0}})}};return this.client.events.on(`proposal_expire`,x),this.events.once(_,({error:e,session:t})=>{this.client.events.off(`proposal_expire`,x),e?v(e):t&&y(t)}),await this.setProposal(g.id,g),await this.sendProposeSession({proposal:g,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:g.id}}}).catch(e=>{throw this.deleteProposal(g.id),e}),{uri:f,approval:b}},this.pair=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(e)}catch(e){throw this.client.logger.error(`pair() failed`),e}},this.approve=async e=>{let t=this.client.core.eventClient.createEvent({properties:{topic:e?.id?.toString(),trace:[Yg.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(e){throw t.setError(Xg.no_internet_connection),e}try{await this.isValidProposalId(e?.id)}catch(n){throw this.client.logger.error(`approve() -> proposal.get(${e?.id}) failed`),t.setError(Xg.proposal_not_found),n}try{await this.isValidApprove(e)}catch(e){throw this.client.logger.error(`approve() -> isValidApprove() failed`),t.setError(Xg.session_approve_namespace_validation_failure),e}let{id:n,relayProtocol:r,namespaces:i,sessionProperties:a,scopedProperties:o,sessionConfig:s,proposalRequestsResponses:c}=e,l=this.client.proposal.get(n);this.client.core.eventClient.deleteEvent({eventId:t.eventId});let{pairingTopic:u,proposer:d,requiredNamespaces:f,optionalNamespaces:p}=l,m=this.client.core.eventClient?.getEvent({topic:u});m||=this.client.core.eventClient?.createEvent({type:Yg.session_approve_started,properties:{topic:u,trace:[Yg.session_approve_started,Yg.session_namespaces_validation_success]}});let h=await this.client.core.crypto.generateKeyPair(),g=d.publicKey,_=await this.client.core.crypto.generateSharedKey(h,g),v={relay:{protocol:r??`irn`},namespaces:i,controller:{publicKey:h,metadata:this.client.metadata},expiry:Se(w_),...a&&{sessionProperties:a},...o&&{scopedProperties:o},...s&&{sessionConfig:s},proposalRequestsResponses:c},y=Og.relay;m.addTrace(Yg.subscribing_session_topic);try{await this.client.core.relayer.subscribe(_,{transportType:y,internal:{skipSubscribe:!0}})}catch(e){throw m.setError(Xg.subscribe_session_topic_failure),e}m.addTrace(Yg.subscribe_session_topic_success);let b={...v,topic:_,requiredNamespaces:f,optionalNamespaces:p,pairingTopic:u,acknowledged:!1,self:v.controller,peer:{publicKey:d.publicKey,metadata:d.metadata},controller:h,transportType:Og.relay,authentication:c?.authentication,walletPayResult:c?.walletPay};await this.client.session.set(_,b),m.addTrace(Yg.store_session);try{await this.sendApproveSession({sessionTopic:_,proposal:l,pairingProposalResponse:{relay:{protocol:r??`irn`},responderPublicKey:h},sessionSettleRequest:v,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:n,...this.getTVFApproveParams(b)}}}),m.addTrace(Yg.session_approve_publish_success)}catch(e){throw this.client.logger.error(e),this.client.session.delete(_,$t(`USER_DISCONNECTED`)),await this.client.core.relayer.unsubscribe(_),e}return this.client.core.eventClient.deleteEvent({eventId:m.eventId}),await this.client.core.pairing.updateMetadata({topic:u,metadata:d.metadata}),await this.deleteProposal(n),await this.client.core.pairing.activate({topic:u}),await this.setExpiry(_,Se(w_)),{topic:_,acknowledged:()=>Promise.resolve(this.client.session.get(_))}},this.reject=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(e)}catch(e){throw this.client.logger.error(`reject() -> isValidReject() failed`),e}let{id:t,reason:n}=e,r;try{r=this.client.proposal.get(t).pairingTopic}catch(e){throw this.client.logger.error(`reject() -> proposal.get(${t}) failed`),e}r&&await this.sendError({id:t,topic:r,error:n,rpcOpts:E_.wc_sessionPropose.reject}),await this.deleteProposal(t)},this.update=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(e)}catch(e){throw this.client.logger.error(`update() -> isValidUpdate() failed`),e}let{topic:t,namespaces:n}=e,{done:r,resolve:i,reject:a}=Ue($.FIVE_MINUTES,`Session update request expired without receiving any acknowledgement`),o=le(),s=re().toString(),c=this.client.session.get(t).namespaces;return this.events.once(H(`session_update`,o),({error:e})=>{e?a(e):i()}),await this.client.session.update(t,{namespaces:n}),await this.sendRequest({topic:t,method:`wc_sessionUpdate`,params:{namespaces:n},throwOnFailedPublish:!0,clientRpcId:o,relayRpcId:s}).catch(e=>{this.client.logger.error(e),this.client.session.update(t,{namespaces:c}),a(e)}),{acknowledged:r}},this.extend=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(e)}catch(e){throw this.client.logger.error(`extend() -> isValidExtend() failed`),e}let{topic:t}=e,n=le(),{done:r,resolve:i,reject:a}=Ue($.FIVE_MINUTES,`Session extend request expired without receiving any acknowledgement`);return this.events.once(H(`session_extend`,n),({error:e})=>{e?a(e):i()}),await this.setExpiry(t,Se(w_)),this.sendRequest({topic:t,method:`wc_sessionExtend`,params:{},clientRpcId:n,throwOnFailedPublish:!0}).catch(e=>{a(e)}),{acknowledged:r}},this.request=async e=>{this.isInitialized();try{await this.isValidRequest(e)}catch(e){throw this.client.logger.error(`request() -> isValidRequest() failed`),e}let{chainId:t,request:n,topic:r,expiry:i=E_.wc_sessionRequest.req.ttl}=e,a=this.client.session.get(r);a?.transportType===Og.relay&&await this.confirmOnlineStateOrThrow();let o=le(),s=re().toString(),{done:c,resolve:l,reject:u}=Ue(i,`Request expired. Please try again.`);this.events.once(H(`session_request`,o),({error:e,result:t})=>{e?u(e):l(t)});let d=`wc_sessionRequest`,f=this.getAppLinkIfEnabled(a.peer.metadata,a.transportType);if(f)return await this.sendRequest({clientRpcId:o,relayRpcId:s,topic:r,method:d,params:{request:{...n,expiryTimestamp:Se(i)},chainId:t},expiry:i,throwOnFailedPublish:!0,appLink:f}).catch(e=>u(e)),this.client.events.emit(`session_request_sent`,{topic:r,request:n,chainId:t,id:o}),await c();let p={request:{...n,expiryTimestamp:Se(i)},chainId:t};return await Promise.all([new Promise(async e=>{await this.sendRequest({clientRpcId:o,relayRpcId:s,topic:r,method:d,params:p,expiry:i,throwOnFailedPublish:!0,tvf:this.getTVFParams(o,p)}).catch(e=>u(e)),this.client.events.emit(`session_request_sent`,{topic:r,request:n,chainId:t,id:o}),e()}),new Promise(async e=>{a.sessionConfig?.disableDeepLink||await Ft({id:o,topic:r,wcDeepLink:await lt(this.client.core.storage,b_)}),e()}),c()]).then(e=>e[2])},this.respond=async e=>{this.isInitialized();let t=this.client.core.eventClient.createEvent({properties:{topic:e?.topic||e?.response?.id?.toString(),trace:[Yg.session_request_response_started]}});try{await this.isValidRespond(e)}catch(e){throw t.addTrace(e?.message),t.setError(Xg.session_request_response_validation_failure),e}t.addTrace(Yg.session_request_response_validation_success);let{topic:n,response:r}=e,{id:i}=r,a=this.client.session.get(n);a.transportType===Og.relay&&await this.confirmOnlineStateOrThrow();let o=this.getAppLinkIfEnabled(a.peer.metadata,a.transportType);try{t.addTrace(Yg.session_request_response_publish_started),de(r)?await this.sendResult({id:i,topic:n,result:r.result,throwOnFailedPublish:!0,appLink:o}):z(r)&&await this.sendError({id:i,topic:n,error:r.error,appLink:o}),this.cleanupAfterResponse(e)}catch(e){throw t.addTrace(e?.message),t.setError(Xg.session_request_response_publish_failure),e}},this.ping=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(e)}catch(e){throw this.client.logger.error(`ping() -> isValidPing() failed`),e}let{topic:t}=e;if(this.client.session.keys.includes(t)){let e=le(),n=re().toString(),{done:r,resolve:i,reject:a}=Ue($.FIVE_MINUTES,`Ping request expired without receiving any acknowledgement`);this.events.once(H(`session_ping`,e),({error:e})=>{e?a(e):i()}),await Promise.all([this.sendRequest({topic:t,method:`wc_sessionPing`,params:{},throwOnFailedPublish:!0,clientRpcId:e,relayRpcId:n}),r()])}else this.client.core.pairing.pairings.keys.includes(t)&&(this.client.logger.warn(`ping() on pairing topic is deprecated and will be removed in the next major release.`),await this.client.core.pairing.ping({topic:t}))},this.emit=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(e);let{topic:t,event:n,chainId:r}=e,i=re().toString(),a=le();await this.sendRequest({topic:t,method:`wc_sessionEvent`,params:{event:n,chainId:r},throwOnFailedPublish:!0,relayRpcId:i,clientRpcId:a})},this.disconnect=async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(e);let{topic:t}=e;if(this.client.session.keys.includes(t))await this.sendRequest({topic:t,method:`wc_sessionDelete`,params:$t(`USER_DISCONNECTED`),throwOnFailedPublish:!0}),await this.deleteSession({topic:t,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(t))await this.client.core.pairing.disconnect({topic:t});else{let{message:e}=V(`MISMATCHED_TOPIC`,`Session or pairing topic not found: ${t}`);throw Error(e)}},this.find=e=>(this.isInitialized(),this.client.session.getAll().filter(t=>sn(t,e))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async(e,t)=>{this.isInitialized(),this.isValidAuthenticate(e);let n=t&&this.client.core.linkModeSupportedApps.includes(t)&&this.client.metadata.redirect?.linkMode,r=n?Og.link_mode:Og.relay;r===Og.relay&&await this.confirmOnlineStateOrThrow();let{chains:i,statement:a=``,uri:o,domain:s,nonce:c,type:l,exp:u,nbf:d,methods:f=[],expiry:p}=e,m=[...e.resources||[]],{topic:h,uri:g}=await this.client.core.pairing.create({methods:[`wc_sessionAuthenticate`],transportType:r});if(this.client.logger.info({message:`Generated new pairing`,pairing:{topic:h,uri:g}}),this.client.auth.authKeys.keys.includes(L_)){let{responseTopic:e,publicKey:t}=this.client.auth.authKeys.get(L_);e&&(await this.client.core.relayer.unsubscribe(e).catch(e=>this.client.logger.warn(e)),await this.client.auth.pairingTopics.delete(e,{message:`replaced`,code:0}).catch(e=>this.client.logger.warn(e))),t&&this.client.core.crypto.keychain.has(t)&&await this.client.core.crypto.deleteKeyPair(t)}let _=await this.client.core.crypto.generateKeyPair(),v=ke(_);if(await Promise.all([this.client.auth.authKeys.set(L_,{responseTopic:v,publicKey:_}),this.client.auth.pairingTopics.set(v,{topic:v,pairingTopic:h})]),await this.client.core.relayer.subscribe(v,{transportType:r}),this.client.logger.info(`sending request to new pairing topic: ${h}`),f.length>0){let{namespace:e}=Qt(i[0]),t=on(e,`request`,f);Xt(m)&&(t=ht(t,m.pop())),m.push(t)}let y=p&&p>E_.wc_sessionAuthenticate.req.ttl?p:E_.wc_sessionAuthenticate.req.ttl,b={authPayload:{type:l??`caip122`,chains:i,statement:a,aud:o,domain:s,version:`1`,nonce:c,iat:new Date().toISOString(),exp:u,nbf:d,resources:m},requester:{publicKey:_,metadata:this.client.metadata},expiryTimestamp:Se(y)},x={requiredNamespaces:{},optionalNamespaces:{eip155:{chains:i,methods:[...new Set([`personal_sign`,...f])],events:[`chainChanged`,`accountsChanged`]}},relays:[{protocol:`irn`}],pairingTopic:h,proposer:{publicKey:_,metadata:this.client.metadata},expiryTimestamp:Se(E_.wc_sessionPropose.req.ttl),id:le()},{done:S,resolve:C,reject:w}=Ue(y,`Request expired`),T=le(),E=H(`session_connect`,x.id),D=H(`session_request`,T),O=async({error:e,session:t})=>{this.events.off(D,k),e?w(e):t&&C({session:t})},k=async e=>{if(await this.deletePendingAuthRequest(T,{message:`fulfilled`,code:0}),e.error){let t=$t(`WC_METHOD_UNSUPPORTED`,`wc_sessionAuthenticate`);return e.error.code===t.code?void 0:(this.events.off(E,O),w(e.error.message))}await this.deleteProposal(x.id),this.events.off(E,O);let{cacaos:n,responder:i}=e.result,a=[],o=[];for(let e of n){await nt({cacao:e,projectId:this.client.core.projectId})||(this.client.logger.error(e,`Signature verification failed`),w($t(`SESSION_SETTLEMENT_FAILED`,`Signature verification failed`)));let{p:t}=e,n=Xt(t.resources),r=[Ot(t.iss)],i=kt(t.iss);if(n){let e=dt(n),t=mt(n);a.push(...e),r.push(...t)}for(let e of r)o.push(`${e}:${i}`)}let s=await this.client.core.crypto.generateSharedKey(_,i.publicKey),c;a.length>0&&(c={topic:s,acknowledged:!0,self:{publicKey:_,metadata:this.client.metadata},peer:i,controller:i.publicKey,expiry:Se(w_),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:`irn`},pairingTopic:h,namespaces:dn([...new Set(a)],[...new Set(o)]),transportType:r},await this.client.core.relayer.subscribe(s,{transportType:r}),await this.client.session.set(s,c),h&&await this.client.core.pairing.updateMetadata({topic:h,metadata:i.metadata}),c=this.client.session.get(s)),this.client.metadata.redirect?.linkMode&&i.metadata.redirect?.linkMode&&i.metadata.redirect?.universal&&t&&(this.client.core.addLinkModeSupportedApp(i.metadata.redirect.universal),this.client.session.update(s,{transportType:Og.link_mode})),C({auths:n,session:c})};this.events.once(E,O),this.events.once(D,k);let A;try{if(n){let e=pe(`wc_sessionAuthenticate`,b,T);this.client.core.history.set(h,e),A=Gt(t,h,await this.client.core.crypto.encode(``,e,{type:2,encoding:Et}))}else await Promise.all([this.sendRequest({topic:h,method:`wc_sessionAuthenticate`,params:b,expiry:e.expiry,throwOnFailedPublish:!0,clientRpcId:T}),this.sendRequest({topic:h,method:`wc_sessionPropose`,params:x,expiry:E_.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:x.id})])}catch(e){throw this.events.off(E,O),this.events.off(D,k),e}return await this.setProposal(x.id,x),await this.setAuthRequest(T,{request:{...b,verifyContext:{}},pairingTopic:h,transportType:r}),{uri:A??g,response:S}},this.approveSessionAuthenticate=async e=>{let{id:t,auths:n}=e,r=this.client.core.eventClient.createEvent({properties:{topic:t.toString(),trace:[Zg.authenticated_session_approve_started]}});try{this.isInitialized()}catch(e){throw r.setError(Qg.no_internet_connection),e}let i=this.getPendingAuthRequest(t);if(!i)throw r.setError(Qg.authenticated_session_pending_request_not_found),Error(`Could not find pending auth request with id ${t}`);let a=i.transportType||Og.relay;a===Og.relay&&await this.confirmOnlineStateOrThrow();let o=i.requester.publicKey,s=await this.client.core.crypto.generateKeyPair(),c=ke(o),l={type:1,receiverPublicKey:o,senderPublicKey:s},u=[],d=[];for(let e of n){if(!await nt({cacao:e,projectId:this.client.core.projectId})){r.setError(Qg.invalid_cacao);let e=$t(`SESSION_SETTLEMENT_FAILED`,`Signature verification failed`);throw await this.sendError({id:t,topic:c,error:e,encodeOpts:l}),Error(e.message)}r.addTrace(Zg.cacaos_verified);let{p:n}=e,i=Xt(n.resources),a=[Ot(n.iss)],o=kt(n.iss);if(i){let e=dt(i),t=mt(i);u.push(...e),a.push(...t)}for(let e of a)d.push(`${e}:${o}`)}let f=await this.client.core.crypto.generateSharedKey(s,o);r.addTrace(Zg.create_authenticated_session_topic);let p;if(u?.length>0){p={topic:f,acknowledged:!0,self:{publicKey:s,metadata:this.client.metadata},peer:{publicKey:o,metadata:i.requester.metadata},controller:o,expiry:Se(w_),authentication:n,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:`irn`},pairingTopic:i.pairingTopic,namespaces:dn([...new Set(u)],[...new Set(d)]),transportType:a},r.addTrace(Zg.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(f,{transportType:a})}catch(e){throw r.setError(Qg.subscribe_authenticated_session_topic_failure),e}r.addTrace(Zg.subscribe_authenticated_session_topic_success),await this.client.session.set(f,p),r.addTrace(Zg.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:i.pairingTopic,metadata:i.requester.metadata})}r.addTrace(Zg.publishing_authenticated_session_approve);try{await this.sendResult({topic:c,id:t,result:{cacaos:n,responder:{publicKey:s,metadata:this.client.metadata}},encodeOpts:l,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(i.requester.metadata,a)})}catch(e){throw r.setError(Qg.authenticated_session_approve_publish_failure),e}return await this.client.auth.requests.delete(t,{message:`fulfilled`,code:0}),await this.client.core.pairing.activate({topic:i.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:r.eventId}),{session:p}},this.rejectSessionAuthenticate=async e=>{this.isInitialized();let{id:t,reason:n}=e,r=this.getPendingAuthRequest(t);if(!r)throw Error(`Could not find pending auth request with id ${t}`);r.transportType===Og.relay&&await this.confirmOnlineStateOrThrow();let i=r.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),o=ke(i),s={type:1,receiverPublicKey:i,senderPublicKey:a};await this.sendError({id:t,topic:o,error:n,encodeOpts:s,rpcOpts:E_.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(r.requester.metadata,r.transportType)}),await this.client.auth.requests.delete(t,{message:`rejected`,code:0}),await this.deleteProposal(t)},this.formatAuthMessage=e=>{this.isInitialized();let{request:t,iss:n}=e;return He(t,n)},this.processRelayMessageCache=()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{let e=this.relayMessageCache.shift();e&&await this.onRelayMessage(e)}catch(e){this.client.logger.error(e)}},50)},this.cleanupDuplicatePairings=async e=>{if(e.pairingTopic)try{let t=this.client.core.pairing.pairings.get(e.pairingTopic),n=this.client.core.pairing.pairings.getAll().filter(n=>n.peerMetadata?.url&&n.peerMetadata?.url===e.peer.metadata.url&&n.topic&&n.topic!==t.topic);if(n.length===0)return;this.client.logger.info(`Cleaning up ${n.length} duplicate pairing(s)`),await Promise.all(n.map(e=>this.client.core.pairing.disconnect({topic:e.topic}))),this.client.logger.info(`Duplicate pairings clean up finished`)}catch(e){this.client.logger.error(e)}},this.deleteSession=async e=>{let{topic:t,expirerHasDeleted:n=!1,emitEvent:r=!0,id:i=0}=e,{self:a}=this.client.session.get(t);await this.client.core.relayer.unsubscribe(t),await this.client.session.delete(t,$t(`USER_DISCONNECTED`)),this.addToRecentlyDeleted(t,`session`),this.client.core.crypto.keychain.has(a.publicKey)&&await this.client.core.crypto.deleteKeyPair(a.publicKey),this.client.core.crypto.keychain.has(t)&&await this.client.core.crypto.deleteSymKey(t),n||this.client.core.expirer.del(t),this.client.core.storage.removeItem(b_).catch(e=>this.client.logger.warn(e)),t===this.sessionRequestQueue.queue[0]?.topic&&(this.sessionRequestQueue.state=O_.idle),await Promise.all(this.getPendingSessionRequests().filter(e=>e.topic===t).map(e=>this.deletePendingSessionRequest(e.id,$t(`USER_DISCONNECTED`)))),r&&this.client.events.emit(`session_delete`,{id:i,topic:t})},this.deleteProposal=async(e,t)=>{if(t)try{let t=this.client.proposal.get(e);this.client.core.eventClient.getEvent({topic:t.pairingTopic})?.setError(Xg.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(e,$t(`USER_DISCONNECTED`)),t?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,`proposal`)},this.deletePendingSessionRequest=async(e,t,n=!1)=>{await Promise.all([this.client.pendingRequest.delete(e,t),n?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,`request`),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(t=>t.id!==e),n&&(this.sessionRequestQueue.state=O_.idle,this.client.events.emit(`session_request_expire`,{id:e}))},this.deletePendingAuthRequest=async(e,t,n=!1)=>{await Promise.all([this.client.auth.requests.delete(e,t),n?Promise.resolve():this.client.core.expirer.del(e)])},this.setExpiry=async(e,t)=>{this.client.session.keys.includes(e)&&(this.client.core.expirer.set(e,t),await this.client.session.update(e,{expiry:t}))},this.setProposal=async(e,t)=>{this.client.core.expirer.set(e,Se(E_.wc_sessionPropose.req.ttl)),await this.client.proposal.set(e,t)},this.setAuthRequest=async(e,t)=>{let{request:n,pairingTopic:r,transportType:i=Og.relay}=t;this.client.core.expirer.set(e,n.expiryTimestamp),await this.client.auth.requests.set(e,{authPayload:n.authPayload,requester:n.requester,expiryTimestamp:n.expiryTimestamp,id:e,pairingTopic:r,verifyContext:n.verifyContext,transportType:i})},this.setPendingSessionRequest=async e=>{let{id:t,topic:n,params:r,verifyContext:i}=e,a=r.request.expiryTimestamp||Se(E_.wc_sessionRequest.req.ttl);this.client.core.expirer.set(t,a),await this.client.pendingRequest.set(t,{id:t,topic:n,params:r,verifyContext:i})},this.sendRequest=async e=>{let{topic:t,method:n,params:r,expiry:i,relayRpcId:a,clientRpcId:o,throwOnFailedPublish:s,appLink:c,tvf:l,publishOpts:u={}}=e,d=pe(n,r,o),f,p=!!c;try{let e=p?Et:st;f=await this.client.core.crypto.encode(t,d,{encoding:e})}catch(e){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${t} failed`),e}let m;if(j_.includes(n)){let e=ze(JSON.stringify(d)),t=ze(f);m=await this.client.core.verify.register({id:t,decryptedId:e})}let g={...E_[n].req,...u};if(g.attestation=m,i&&(g.ttl=i),a&&(g.id=a),this.client.core.history.set(t,d),p){let e=Gt(c,t,f);await h.Linking.openURL(e,this.client.name)}else g.tvf={...l,correlationId:d.id},s?(g.internal={...g.internal,throwOnFailedPublish:!0},await this.client.core.relayer.publish(t,f,g)):this.client.core.relayer.publish(t,f,g).catch(e=>this.client.logger.error(e));return d.id},this.sendProposeSession=async e=>{let{proposal:t,publishOpts:n}=e,r=pe(`wc_sessionPropose`,t,t.id);this.client.core.history.set(t.pairingTopic,r);let i=await this.client.core.crypto.encode(t.pairingTopic,r,{encoding:st}),a=ze(JSON.stringify(r)),o=ze(i),s=await this.client.core.verify.register({id:o,decryptedId:a});await this.client.core.relayer.publishCustom({payload:{pairingTopic:t.pairingTopic,sessionProposal:i},opts:{...n,publishMethod:`wc_proposeSession`,attestation:s}})},this.sendApproveSession=async e=>{let{sessionTopic:t,pairingProposalResponse:n,proposal:r,sessionSettleRequest:i,publishOpts:a}=e,o=ne(r.id,n),s=await this.client.core.crypto.encode(r.pairingTopic,o,{encoding:st}),c=pe(`wc_sessionSettle`,i,a?.id),l=await this.client.core.crypto.encode(t,c,{encoding:st});this.client.core.history.set(t,c),await this.client.core.relayer.publishCustom({payload:{sessionTopic:t,pairingTopic:r.pairingTopic,sessionProposalResponse:s,sessionSettlementRequest:l},opts:{...a,publishMethod:`wc_approveSession`}})},this.sendResult=async e=>{let{id:t,topic:n,result:r,throwOnFailedPublish:i,encodeOpts:a,appLink:o}=e,s=ne(t,r),c,l=o&&typeof h?.Linking<`u`;try{let e=l?Et:st;c=await this.client.core.crypto.encode(n,s,{...a||{},encoding:e})}catch(e){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${n} failed`),e}let u,d;try{u=await this.client.core.history.get(n,t);let e=u.request;try{d=this.getTVFParams(t,e.params,r)}catch(e){this.client.logger.warn(`sendResult() -> getTVFParams() failed: ${e?.message}`)}}catch(e){throw this.client.logger.error(`sendResult() -> history.get(${n}, ${t}) failed`),e}if(l){let e=Gt(o,n,c);await h.Linking.openURL(e,this.client.name)}else{let e=E_[u.request.method].res;e.tvf={...d,correlationId:t},i?(e.internal={...e.internal,throwOnFailedPublish:!0},await this.client.core.relayer.publish(n,c,e)):this.client.core.relayer.publish(n,c,e).catch(e=>this.client.logger.error(e))}await this.client.core.history.resolve(s)},this.sendError=async e=>{let{id:t,topic:n,error:r,encodeOpts:i,rpcOpts:a,appLink:o}=e,s=oe(t,r),c,l=o&&typeof h?.Linking<`u`;try{let e=l?Et:st;c=await this.client.core.crypto.encode(n,s,{...i||{},encoding:e})}catch(e){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${n} failed`),e}let u;try{u=await this.client.core.history.get(n,t)}catch(e){throw this.client.logger.error(`sendError() -> history.get(${n}, ${t}) failed`),e}if(l){let e=Gt(o,n,c);await h.Linking.openURL(e,this.client.name)}else{let e=u.request.method,t=a||E_[e].res;this.client.core.relayer.publish(n,c,t)}await this.client.core.history.resolve(s)},this.cleanup=async()=>{let e=[],t=[];this.client.session.getAll().forEach(t=>{let n=!1;Lt(t.expiry)&&(n=!0),this.client.core.crypto.keychain.has(t.topic)||(n=!0),n&&e.push(t.topic)}),this.client.proposal.getAll().forEach(e=>{Lt(e.expiryTimestamp)&&t.push(e.id)}),await Promise.all([...e.map(e=>this.deleteSession({topic:e})),...t.map(e=>this.deleteProposal(e))])},this.onProviderMessageEvent=async e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):await this.onRelayMessage(e)},this.onRelayEventRequest=async e=>{this.requestQueue.queue.push(e),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===O_.active){this.client.logger.info(`Request queue already active, skipping...`);return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=O_.active;let e=this.requestQueue.queue.shift();if(e)try{await this.processRequest(e)}catch(e){this.client.logger.warn(e)}}this.requestQueue.state=O_.idle},this.processRequest=async e=>{let{topic:t,payload:n,attestation:r,transportType:i,encryptedId:a}=e,o=n.method;if(!this.shouldIgnorePairingRequest({topic:t,requestMethod:o}))switch(o){case`wc_sessionPropose`:return await this.onSessionProposeRequest({topic:t,payload:n,attestation:r,encryptedId:a});case`wc_sessionSettle`:return await this.onSessionSettleRequest(t,n);case`wc_sessionUpdate`:return await this.onSessionUpdateRequest(t,n);case`wc_sessionExtend`:return await this.onSessionExtendRequest(t,n);case`wc_sessionPing`:return await this.onSessionPingRequest(t,n);case`wc_sessionDelete`:return await this.onSessionDeleteRequest(t,n);case`wc_sessionRequest`:return await this.onSessionRequest({topic:t,payload:n,attestation:r,encryptedId:a,transportType:i});case`wc_sessionEvent`:return await this.onSessionEventRequest(t,n);case`wc_sessionAuthenticate`:return await this.onSessionAuthenticateRequest({topic:t,payload:n,attestation:r,encryptedId:a,transportType:i});default:return this.client.logger.info(`Unsupported request method ${o}`)}},this.onRelayEventResponse=async e=>{let{topic:t,payload:n,transportType:r}=e,i=(await this.client.core.history.get(t,n.id)).request.method;switch(i){case`wc_sessionPropose`:return this.onSessionProposeResponse(t,n,r);case`wc_sessionSettle`:return this.onSessionSettleResponse(t,n);case`wc_sessionUpdate`:return this.onSessionUpdateResponse(t,n);case`wc_sessionExtend`:return this.onSessionExtendResponse(t,n);case`wc_sessionPing`:return this.onSessionPingResponse(t,n);case`wc_sessionRequest`:return this.onSessionRequestResponse(t,n);case`wc_sessionAuthenticate`:return this.onSessionAuthenticateResponse(t,n);default:return this.client.logger.info(`Unsupported response method ${i}`)}},this.onRelayEventUnknownPayload=e=>{let{topic:t}=e,{message:n}=V(`MISSING_OR_INVALID`,`Decoded payload on topic ${t} is not identifiable as a JSON-RPC request or a response.`);throw Error(n)},this.shouldIgnorePairingRequest=e=>{let{topic:t,requestMethod:n}=e,r=this.expectedPairingMethodMap.get(t);return!r||r.includes(n)?!1:!!(r.includes(`wc_sessionAuthenticate`)&&this.client.events.listenerCount(`session_authenticate`)>0)},this.onSessionProposeRequest=async e=>{let{topic:t,payload:n,attestation:r,encryptedId:i}=e,{params:a,id:o}=n;try{let e=this.client.core.eventClient.getEvent({topic:t});this.client.events.listenerCount(`session_proposal`)===0&&e?.setError(Jg.proposal_listener_not_found),this.isValidConnect({...n.params});let s={id:o,pairingTopic:t,expiryTimestamp:a.expiryTimestamp||Se(E_.wc_sessionPropose.req.ttl),attestation:r,encryptedId:i,...a};await this.setProposal(o,s);let c=await this.getVerifyContext({attestationId:r,hash:ze(JSON.stringify(n)),encryptedId:i,metadata:s.proposer.metadata});e?.addTrace(qg.emit_session_proposal),this.client.events.emit(`session_proposal`,{id:o,params:s,verifyContext:c})}catch(e){await this.sendError({id:o,topic:t,error:e,rpcOpts:E_.wc_sessionPropose.autoReject}),this.client.logger.error(e)}},this.onSessionProposeResponse=async(e,t,n)=>{let{id:r}=t;if(de(t)){let{result:i}=t;this.client.logger.trace({type:`method`,method:`onSessionProposeResponse`,result:i});let a=this.client.proposal.get(r);this.client.logger.trace({type:`method`,method:`onSessionProposeResponse`,proposal:a});let o=a.proposer.publicKey;this.client.logger.trace({type:`method`,method:`onSessionProposeResponse`,selfPublicKey:o});let s=i.responderPublicKey;this.client.logger.trace({type:`method`,method:`onSessionProposeResponse`,peerPublicKey:s});let c=await this.client.core.crypto.generateSharedKey(o,s);this.pendingSessions.set(r,{sessionTopic:c,pairingTopic:e,proposalId:r,publicKey:o});let l=await this.client.core.relayer.subscribe(c,{transportType:n});this.client.logger.trace({type:`method`,method:`onSessionProposeResponse`,subscriptionId:l}),await this.client.core.pairing.activate({topic:e})}else if(z(t)){await this.deleteProposal(r);let e=H(`session_connect`,r);if(this.events.listenerCount(e)===0)throw Error(`emitting ${e} without any listeners, 954`);this.events.emit(e,{error:t.error})}},this.onSessionSettleRequest=async(e,t)=>{let{id:n,params:r}=t;try{this.isValidSessionSettleRequest(r);let{relay:n,controller:i,expiry:a,namespaces:o,sessionProperties:s,scopedProperties:c,sessionConfig:l,proposalRequestsResponses:u}=t.params,d=[...this.pendingSessions.values()].find(t=>t.sessionTopic===e);if(!d)return this.client.logger.error(`Pending session not found for topic ${e}`);let f=this.client.proposal.get(d.proposalId),p={topic:e,relay:n,expiry:a,namespaces:o,acknowledged:!0,pairingTopic:d.pairingTopic,requiredNamespaces:f.requiredNamespaces,optionalNamespaces:f.optionalNamespaces,controller:i.publicKey,self:{publicKey:d.publicKey,metadata:this.client.metadata},peer:{publicKey:i.publicKey,metadata:i.metadata},...s&&{sessionProperties:s},...c&&{scopedProperties:c},...l&&{sessionConfig:l},transportType:Og.relay,authentication:u?.authentication,walletPayResult:u?.walletPay};await this.client.session.set(p.topic,p),await this.setExpiry(p.topic,p.expiry),await this.client.core.pairing.updateMetadata({topic:d.pairingTopic,metadata:p.peer.metadata}),this.pendingSessions.delete(d.proposalId),this.deleteProposal(d.proposalId,!1),this.cleanupDuplicatePairings(p),await this.sendResult({id:t.id,topic:e,throwOnFailedPublish:!0,result:!0}),this.client.events.emit(`session_connect`,{session:p}),this.events.emit(H(`session_connect`,d.proposalId),{session:p})}catch(t){await this.sendError({id:n,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionSettleResponse=async(e,t)=>{let{id:n}=t;de(t)?(await this.client.session.update(e,{acknowledged:!0}),this.events.emit(H(`session_approve`,n),{})):z(t)&&(await this.deleteSession({topic:e,emitEvent:!1}),this.events.emit(H(`session_approve`,n),{error:t.error}))},this.onSessionUpdateRequest=async(e,t)=>{let{params:n,id:r}=t;try{let t=`${e}_session_update`,i=Pt.get(t);if(i&&this.isRequestOutOfSync(i,r)){this.client.logger.warn(`Discarding out of sync request - ${r}`),this.sendError({id:r,topic:e,error:$t(`INVALID_UPDATE_REQUEST`)});return}this.isValidUpdate({topic:e,...n});try{Pt.set(t,r),await this.client.session.update(e,{namespaces:n.namespaces}),await this.sendResult({id:r,topic:e,result:!0})}catch(e){throw Pt.delete(t),e}this.client.events.emit(`session_update`,{id:r,topic:e,params:n})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}},this.isRequestOutOfSync=(e,t)=>t.toString().slice(0,-3)<e.toString().slice(0,-3),this.onSessionUpdateResponse=(e,t)=>{let{id:n}=t,r=H(`session_update`,n);if(this.events.listenerCount(r)===0)throw Error(`emitting ${r} without any listeners`);de(t)?this.events.emit(H(`session_update`,n),{}):z(t)&&this.events.emit(H(`session_update`,n),{error:t.error})},this.onSessionExtendRequest=async(e,t)=>{let{id:n}=t;try{this.isValidExtend({topic:e}),await this.setExpiry(e,Se(w_)),await this.sendResult({id:n,topic:e,result:!0}),this.client.events.emit(`session_extend`,{id:n,topic:e})}catch(t){await this.sendError({id:n,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionExtendResponse=(e,t)=>{let{id:n}=t,r=H(`session_extend`,n);if(this.events.listenerCount(r)===0)throw Error(`emitting ${r} without any listeners`);de(t)?this.events.emit(H(`session_extend`,n),{}):z(t)&&this.events.emit(H(`session_extend`,n),{error:t.error})},this.onSessionPingRequest=async(e,t)=>{let{id:n}=t;try{this.isValidPing({topic:e}),await this.sendResult({id:n,topic:e,result:!0,throwOnFailedPublish:!0}),this.client.events.emit(`session_ping`,{id:n,topic:e})}catch(t){await this.sendError({id:n,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionPingResponse=(e,t)=>{let{id:n}=t,r=H(`session_ping`,n);setTimeout(()=>{if(this.events.listenerCount(r)===0)throw Error(`emitting ${r} without any listeners 2176`);de(t)?this.events.emit(H(`session_ping`,n),{}):z(t)&&this.events.emit(H(`session_ping`,n),{error:t.error})},500)},this.onSessionDeleteRequest=async(e,t)=>{let{id:n}=t;try{await this.isValidDisconnect({topic:e,reason:t.params}),this.cleanupPendingSentRequestsForTopic({topic:e,error:$t(`USER_DISCONNECTED`)}),await this.deleteSession({topic:e,id:n})}catch(e){this.client.logger.error(e)}},this.onSessionRequest=async e=>{let{topic:t,payload:n,attestation:r,encryptedId:i,transportType:a}=e,{id:o,params:s}=n;try{await this.isValidRequest({topic:t,...s});let e=this.client.session.get(t),n={id:o,topic:t,params:s,verifyContext:await this.getVerifyContext({attestationId:r,hash:ze(JSON.stringify(pe(`wc_sessionRequest`,s,o))),encryptedId:i,metadata:e.peer.metadata,transportType:a})};await this.setPendingSessionRequest(n),a===Og.link_mode&&e.peer.metadata.redirect?.universal&&this.client.core.addLinkModeSupportedApp(e.peer.metadata.redirect?.universal),this.client.signConfig?.disableRequestQueue?this.emitSessionRequest(n):(this.addSessionRequestToSessionRequestQueue(n),this.processSessionRequestQueue())}catch(e){await this.sendError({id:o,topic:t,error:e}),this.client.logger.error(e)}},this.onSessionRequestResponse=(e,t)=>{let{id:n}=t,r=H(`session_request`,n);if(this.events.listenerCount(r)===0)throw Error(`emitting ${r} without any listeners`);de(t)?this.events.emit(H(`session_request`,n),{result:t.result}):z(t)&&this.events.emit(H(`session_request`,n),{error:t.error})},this.onSessionEventRequest=async(e,t)=>{let{id:n,params:r}=t;try{let t=`${e}_session_event_${r.event.name}`,i=Pt.get(t);if(i&&this.isRequestOutOfSync(i,n)){this.client.logger.info(`Discarding out of sync request - ${n}`);return}this.isValidEmit({topic:e,...r}),this.client.events.emit(`session_event`,{id:n,topic:e,params:r}),Pt.set(t,n)}catch(t){await this.sendError({id:n,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionAuthenticateResponse=(e,t)=>{let{id:n}=t;this.client.logger.trace({type:`method`,method:`onSessionAuthenticateResponse`,topic:e,payload:t}),de(t)?this.events.emit(H(`session_request`,n),{result:t.result}):z(t)&&this.events.emit(H(`session_request`,n),{error:t.error})},this.onSessionAuthenticateRequest=async e=>{let{topic:t,payload:n,attestation:r,encryptedId:i,transportType:a}=e;try{let{requester:e,authPayload:o,expiryTimestamp:s}=n.params,c=await this.getVerifyContext({attestationId:r,hash:ze(JSON.stringify(n)),encryptedId:i,metadata:e.metadata,transportType:a}),l={requester:e,pairingTopic:t,id:n.id,authPayload:o,verifyContext:c,expiryTimestamp:s};await this.setAuthRequest(n.id,{request:l,pairingTopic:t,transportType:a}),a===Og.link_mode&&e.metadata.redirect?.universal&&this.client.core.addLinkModeSupportedApp(e.metadata.redirect.universal),this.client.events.emit(`session_authenticate`,{topic:t,params:n.params,id:n.id,verifyContext:c})}catch(e){this.client.logger.error(e);let r=n.params.requester.publicKey,i=await this.client.core.crypto.generateKeyPair(),o=this.getAppLinkIfEnabled(n.params.requester.metadata,a),s={type:1,receiverPublicKey:r,senderPublicKey:i};await this.sendError({id:n.id,topic:t,error:e,encodeOpts:s,rpcOpts:E_.wc_sessionAuthenticate.autoReject,appLink:o})}},this.addSessionRequestToSessionRequestQueue=e=>{this.sessionRequestQueue.queue.push(e)},this.cleanupAfterResponse=e=>{this.deletePendingSessionRequest(e.response.id,{message:`fulfilled`,code:0}),setTimeout(()=>{this.sessionRequestQueue.state=O_.idle,this.processSessionRequestQueue()},(0,$.toMiliseconds)(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:e,error:t})=>{let n=this.client.core.history.pending;n.length>0&&n.filter(t=>t.topic===e&&t.request.method===`wc_sessionRequest`).forEach(e=>{this.events.emit(H(`session_request`,e.request.id),{error:t})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===O_.active){this.client.logger.info(`session request queue is already active.`);return}let e=this.sessionRequestQueue.queue[0];if(!e){this.client.logger.info(`session request queue is empty.`);return}try{this.emitSessionRequest(e)}catch(e){this.client.logger.error(e)}},this.emitSessionRequest=e=>{if(this.emittedSessionRequests.has(e.id)){this.client.logger.warn({id:e.id},`Skipping emitting \`session_request\` event for duplicate request. id: ${e.id}`);return}this.sessionRequestQueue.state=O_.active,this.emittedSessionRequests.add(e.id),this.client.events.emit(`session_request`,e)},this.cleanupInProgress=!1,this.cleanupOrphanedSubscriptions=async()=>{let e=this.client.core.relayer.subscriber.topics;if(e.length===0)return;let t=new Set(this.client.session.keys),n=new Set(this.client.core.pairing.pairings.keys),r=new Set([...this.pendingSessions.values()].map(e=>e.sessionTopic)),i;if(this.client.auth.authKeys.keys.includes(L_)){let{responseTopic:e}=this.client.auth.authKeys.get(L_);i=e}for(let a of e)if(!t.has(a)&&!n.has(a)&&!r.has(a)&&a!==i){this.client.logger.info(`Cleaning up orphaned subscriber topic: ${a}`);try{await this.client.core.relayer.subscriber.unsubscribe(a)}catch(e){this.client.logger.warn(e,`Failed to clean up orphaned subscription: ${a}`)}}},this.onPairingCreated=e=>{if(e.methods&&this.expectedPairingMethodMap.set(e.topic,e.methods),e.active)return;let t=this.client.proposal.getAll().find(t=>t.pairingTopic===e.topic);t&&this.onSessionProposeRequest({topic:e.topic,payload:pe(`wc_sessionPropose`,{...t,requiredNamespaces:t.requiredNamespaces,optionalNamespaces:t.optionalNamespaces,relays:t.relays,proposer:t.proposer,sessionProperties:t.sessionProperties,scopedProperties:t.scopedProperties},t.id),attestation:t.attestation,encryptedId:t.encryptedId})},this.isValidConnect=async e=>{if(!_e(e)){let{message:t}=V(`MISSING_OR_INVALID`,`connect() params: ${JSON.stringify(e)}`);throw Error(t)}let{pairingTopic:t,requiredNamespaces:n,optionalNamespaces:r,sessionProperties:i,scopedProperties:a,relays:o}=e;if(at(t)||await this.isValidPairingTopic(t),!Ht(o,!0)){let{message:e}=V(`MISSING_OR_INVALID`,`connect() relays: ${o}`);throw Error(e)}if(n&&!at(n)&&Pe(n)!==0&&([`fatal`,`error`,`silent`].includes(this.client.logger.level)||this.client.logger.warn(`requiredNamespaces are deprecated and are automatically assigned to optionalNamespaces`),this.validateNamespaces(n,`requiredNamespaces`)),r&&!at(r)&&Pe(r)!==0&&this.validateNamespaces(r,`optionalNamespaces`),i&&!at(i)&&this.validateSessionProps(i,`sessionProperties`),a&&!at(a)){this.validateSessionProps(a,`scopedProperties`);let e=Object.keys(n||{}).concat(Object.keys(r||{}));if(!Object.keys(a).every(t=>e.includes(t.split(`:`)[0])))throw Error(`Scoped properties must be a subset of required/optional namespaces, received: ${JSON.stringify(a)}, required/optional namespaces: ${JSON.stringify(e)}`)}},this.validateNamespaces=(e,t)=>{let n=$e(e,`connect()`,t);if(n)throw Error(n.message)},this.isValidApprove=async e=>{if(!_e(e))throw Error(V(`MISSING_OR_INVALID`,`approve() params: ${e}`).message);let{id:t,namespaces:n,relayProtocol:r,sessionProperties:i,scopedProperties:a}=e;this.checkRecentlyDeleted(t),await this.isValidProposalId(t);let o=this.client.proposal.get(t),s=vt(n,`approve()`);if(s)throw Error(s.message);let c=tt(o.requiredNamespaces,n,`approve()`);if(c)throw Error(c.message);if(!zt(r,!0)){let{message:e}=V(`MISSING_OR_INVALID`,`approve() relayProtocol: ${r}`);throw Error(e)}if(i&&!at(i)&&this.validateSessionProps(i,`sessionProperties`),a&&!at(a)){this.validateSessionProps(a,`scopedProperties`);let e=new Set(Object.keys(n));if(!Object.keys(a).every(t=>e.has(t.split(`:`)[0])))throw Error(`Scoped properties must be a subset of approved namespaces, received: ${JSON.stringify(a)}, approved namespaces: ${Array.from(e).join(`, `)}`)}},this.isValidReject=async e=>{if(!_e(e)){let{message:t}=V(`MISSING_OR_INVALID`,`reject() params: ${e}`);throw Error(t)}let{id:t,reason:n}=e;if(this.checkRecentlyDeleted(t),await this.isValidProposalId(t),!_t(n)){let{message:e}=V(`MISSING_OR_INVALID`,`reject() reason: ${JSON.stringify(n)}`);throw Error(e)}},this.isValidSessionSettleRequest=e=>{if(!_e(e)){let{message:t}=V(`MISSING_OR_INVALID`,`onSessionSettleRequest() params: ${e}`);throw Error(t)}let{relay:t,controller:n,namespaces:r,expiry:i}=e;if(!Oe(t)){let{message:e}=V(`MISSING_OR_INVALID`,`onSessionSettleRequest() relay protocol should be a string`);throw Error(e)}let a=pt(n,`onSessionSettleRequest()`);if(a)throw Error(a.message);let o=vt(r,`onSessionSettleRequest()`);if(o)throw Error(o.message);if(Lt(i)){let{message:e}=V(`EXPIRED`,`onSessionSettleRequest()`);throw Error(e)}},this.isValidUpdate=async e=>{if(!_e(e)){let{message:t}=V(`MISSING_OR_INVALID`,`update() params: ${e}`);throw Error(t)}let{topic:t,namespaces:n}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);let r=this.client.session.get(t),i=vt(n,`update()`);if(i)throw Error(i.message);let a=tt(r.requiredNamespaces,n,`update()`);if(a)throw Error(a.message)},this.isValidExtend=async e=>{if(!_e(e)){let{message:t}=V(`MISSING_OR_INVALID`,`extend() params: ${e}`);throw Error(t)}let{topic:t}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t)},this.isValidRequest=async e=>{if(!_e(e)){let{message:t}=V(`MISSING_OR_INVALID`,`request() params: ${e}`);throw Error(t)}let{topic:t,request:n,chainId:r,expiry:i}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);let{namespaces:a}=this.client.session.get(t);if(!Be(a,r)){let{message:e}=V(`MISSING_OR_INVALID`,`request() chainId: ${r}`);throw Error(e)}if(!Kt(n)){let{message:e}=V(`MISSING_OR_INVALID`,`request() ${JSON.stringify(n)}`);throw Error(e)}if(!It(a,r,n.method)){let{message:e}=V(`MISSING_OR_INVALID`,`request() method: ${n.method}`);throw Error(e)}this.validateRequestExpiry(i)},this.isValidRespond=async e=>{if(!_e(e)){let{message:t}=V(`MISSING_OR_INVALID`,`respond() params: ${e}`);throw Error(t)}let{topic:t,response:n}=e;try{await this.isValidSessionTopic(t)}catch(t){throw e?.response?.id&&this.cleanupAfterResponse(e),t}if(!ot(n)){let{message:e}=V(`MISSING_OR_INVALID`,`respond() response: ${JSON.stringify(n)}`);throw Error(e)}let r=this.client.pendingRequest.get(n.id);if(r.topic!==t){let{message:e}=V(`MISMATCHED_TOPIC`,`Request response topic mismatch. reqId: ${n.id}, expected topic: ${r.topic}, received topic: ${t}`);throw Error(e)}},this.isValidPing=async e=>{if(!_e(e)){let{message:t}=V(`MISSING_OR_INVALID`,`ping() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.isValidEmit=async e=>{if(!_e(e)){let{message:t}=V(`MISSING_OR_INVALID`,`emit() params: ${e}`);throw Error(t)}let{topic:t,event:n,chainId:r}=e;await this.isValidSessionTopic(t);let{namespaces:i}=this.client.session.get(t);if(!Be(i,r)){let{message:e}=V(`MISSING_OR_INVALID`,`emit() chainId: ${r}`);throw Error(e)}if(!Te(n)){let{message:e}=V(`MISSING_OR_INVALID`,`emit() event: ${JSON.stringify(n)}`);throw Error(e)}if(!mn(i,r,n.name)){let{message:e}=V(`MISSING_OR_INVALID`,`emit() event: ${JSON.stringify(n)}`);throw Error(e)}},this.isValidDisconnect=async e=>{if(!_e(e)){let{message:t}=V(`MISSING_OR_INVALID`,`disconnect() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.isValidAuthenticate=e=>{let{chains:t,uri:n,domain:r,nonce:i}=e;if(!Array.isArray(t)||t.length===0)throw Error(`chains is required and must be a non-empty array`);if(!zt(n,!1))throw Error(`uri is required parameter`);if(!zt(r,!1))throw Error(`domain is required parameter`);if(!zt(i,!1))throw Error(`nonce is required parameter`);if([...new Set(t.map(e=>Qt(e).namespace))].length>1)throw Error(`Multi-namespace requests are not supported. Please request single namespace only.`);let{namespace:a}=Qt(t[0]);if(a!==`eip155`)throw Error(`Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.`)},this.getVerifyContext=async e=>{let{attestationId:t,hash:n,encryptedId:r,metadata:i,transportType:a}=e,o={verified:{verifyUrl:i.verifyUrl||`https://verify.walletconnect.org`,validation:`UNKNOWN`,origin:i.url||``}};try{if(a===Og.link_mode){let e=this.getAppLinkIfEnabled(i,a);return o.verified.validation=e&&new URL(e).origin===new URL(i.url).origin?`VALID`:`INVALID`,o}let e=await this.client.core.verify.resolve({attestationId:t,hash:n,encryptedId:r,verifyUrl:i.verifyUrl});e&&(o.verified.origin=e.origin,o.verified.isScam=e.isScam,o.verified.validation=e.origin===new URL(i.url).origin?`VALID`:`INVALID`)}catch(e){this.client.logger.warn(e)}return this.client.logger.debug(`Verify context: ${JSON.stringify(o)}`),o},this.validateSessionProps=(e,t)=>{Object.values(e).forEach((n,r)=>{if(n==null){let{message:i}=V(`MISSING_OR_INVALID`,`${t} must contain an existing value for each key. Received: ${n} for key ${Object.keys(e)[r]}`);throw Error(i)}})},this.getPendingAuthRequest=e=>{let t=this.client.auth.requests.get(e);return typeof t==`object`?t:void 0},this.addToRecentlyDeleted=(e,t)=>{if(this.recentlyDeletedMap.set(e,t),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let e=0,t=this.recentlyDeletedLimit/2;for(let n of this.recentlyDeletedMap.keys()){if(e++>=t)break;this.recentlyDeletedMap.delete(n)}}},this.checkRecentlyDeleted=e=>{let t=this.recentlyDeletedMap.get(e);if(t){let{message:n}=V(`MISSING_OR_INVALID`,`Record was recently deleted - ${t}: ${e}`);throw Error(n)}},this.isLinkModeEnabled=(e,t)=>!e||t!==Og.link_mode?!1:this.client.metadata?.redirect?.linkMode===!0&&this.client.metadata?.redirect?.universal!==void 0&&this.client.metadata?.redirect?.universal!==``&&e?.redirect?.universal!==void 0&&e?.redirect?.universal!==``&&e?.redirect?.linkMode===!0&&this.client.core.linkModeSupportedApps.includes(e.redirect.universal)&&typeof h?.Linking<`u`,this.getAppLinkIfEnabled=(e,t)=>this.isLinkModeEnabled(e,t)?e?.redirect?.universal:void 0,this.handleLinkModeMessage=({url:e})=>{if(!e||!e.includes(`wc_ev`)||!e.includes(`topic`))return;let t=ln(e,`topic`)||``,n=decodeURIComponent(ln(e,`wc_ev`)||``),r=this.client.session.keys.includes(t);r&&this.client.session.update(t,{transportType:Og.link_mode}),this.client.core.dispatchEnvelope({topic:t,message:n,sessionExists:r})},this.registerLinkModeListeners=async()=>{if(pn()||jt()&&this.client.metadata.redirect?.linkMode){let e=h?.Linking;if(typeof e<`u`){e.addEventListener(`url`,this.handleLinkModeMessage,this.client.name);let t=await e.getInitialURL();t&&setTimeout(()=>{this.handleLinkModeMessage({url:t})},50)}}},this.getTVFApproveParams=e=>{try{return{approvedChains:un(e.namespaces),approvedMethods:ut(e.namespaces),approvedEvents:qe(e.namespaces),sessionProperties:e.sessionProperties,scopedProperties:e.scopedProperties}}catch(e){return this.client.logger.warn(e,`Error getting TVF approve params`),{}}},this.getTVFParams=(e,t,n)=>{if(!t.request?.method)return{};let r={correlationId:e,rpcMethods:[t.request.method],chainId:t.chainId};try{r.txHashes=this.extractTxHashesFromResult(t.request,n),r.contractAddresses=this.isValidContractData(t.request.params)?[t.request.params?.[0]?.to]:[]}catch(e){this.client.logger.warn(e,`Error getting TVF params`)}return r},this.isValidContractData=e=>{if(!e)return!1;try{let t=e?.data||e?.[0]?.data;if(!t.startsWith(`0x`))return!1;let n=t.slice(2);return/^[0-9a-fA-F]*$/.test(n)?n.length%2==0:!1}catch{}return!1},this.extractTxHashesFromResult=(e,t)=>{try{if(!t)return[];let n=e.method,r=k_[n];if(n===`sui_signTransaction`)return[Qe(t.transactionBytes)];if(n===`near_signTransaction`)return[ye(t)];if(n===`near_signTransactions`)return t.map(e=>ye(e));if(n===`xrpl_signTransactionFor`||n===`xrpl_signTransaction`)return[t.tx_json?.hash];if(n===`polkadot_signTransaction`)return[Dt({transaction:e.params.transactionPayload,signature:t.signature})];if(n===`algo_signTxn`)return bt(t)?t.map(e=>xe(e)):[xe(t)];if(n===`cosmos_signDirect`)return[fn(t)];if(n===`wallet_sendCalls`)return rn(t);if(typeof t==`string`)return[t];let i=t[r.key];if(bt(i))return n===`solana_signAllTransactions`?i.map(e=>Ke(e)):i;if(typeof i==`string`)return[i]}catch(e){this.client.logger.warn(e,`Error extracting tx hashes from result`)}return[]}}async processPendingMessageEvents(){try{let e=this.client.session.keys,t=this.client.core.relayer.messages.getWithoutAck(e);for(let[e,n]of Object.entries(t))for(let t of n)try{await this.onProviderMessageEvent({topic:e,message:t,publishedAt:Date.now()})}catch{this.client.logger.warn(`Error processing pending message event for topic: ${e}, message: ${t}`)}}catch(e){this.client.logger.warn(e,`processPendingMessageEvents failed`)}}isInitialized(){if(!this.initialized){let{message:e}=V(`NOT_INITIALIZED`,this.name);throw Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(wg.message,e=>{this.onProviderMessageEvent(e)})}async onRelayMessage(e){let{topic:t,message:n,attestation:r,transportType:i}=e,{publicKey:a}=this.client.auth.authKeys.keys.includes(L_)?this.client.auth.authKeys.get(L_):{publicKey:void 0};try{let e=await this.client.core.crypto.decode(t,n,{receiverPublicKey:a,encoding:i===Og.link_mode?Et:st});te(e)?(this.client.core.history.set(t,e),await this.onRelayEventRequest({topic:t,payload:e,attestation:r,transportType:i,encryptedId:ze(n)})):ce(e)?(await this.client.core.history.resolve(e),await this.onRelayEventResponse({topic:t,payload:e,transportType:i}),this.client.core.history.delete(t,e.id)):(this.client.logger.error(`onRelayMessage() -> unknown payload: ${JSON.stringify(e)}`),await this.onRelayEventUnknownPayload({topic:t,payload:e,transportType:i})),await this.client.core.relayer.messages.ack(t,n)}catch(e){this.client.logger.error(`onRelayMessage() -> failed to process an inbound message: ${n}`),this.client.logger.error(e)}}registerExpirerEvents(){this.client.core.expirer.on(zg.expired,async e=>{let{topic:t,id:n}=We(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,V(`EXPIRED`),!0);if(n&&this.client.auth.requests.keys.includes(n))return await this.deletePendingAuthRequest(n,V(`EXPIRED`),!0);t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit(`session_expire`,{topic:t})):n&&(await this.deleteProposal(n,!0),this.client.events.emit(`proposal_expire`,{id:n}))})}registerSubscriptionCleanup(){this.client.core.heartbeat.on(`heartbeat_pulse`,async()=>{if(!this.cleanupInProgress){this.cleanupInProgress=!0;try{await this.cleanupOrphanedSubscriptions()}catch(e){this.client.logger.warn(e)}finally{this.cleanupInProgress=!1}}})}registerPairingEvents(){this.client.core.pairing.events.on(Fg.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(Fg.delete,e=>{this.addToRecentlyDeleted(e.topic,`pairing`)})}isValidPairingTopic(e){if(!zt(e,!1)){let{message:t}=V(`MISSING_OR_INVALID`,`pairing topic should be a string: ${e}`);throw Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){let{message:t}=V(`NO_MATCHING_KEY`,`pairing topic doesn't exist: ${e}`);throw Error(t)}if(Lt(this.client.core.pairing.pairings.get(e).expiry)){let{message:t}=V(`EXPIRED`,`pairing topic: ${e}`);throw Error(t)}}async isValidSessionTopic(e){if(!zt(e,!1)){let{message:t}=V(`MISSING_OR_INVALID`,`session topic should be a string: ${e}`);throw Error(t)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){let{message:t}=V(`NO_MATCHING_KEY`,`session topic doesn't exist: ${e}`);throw Error(t)}if(Lt(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});let{message:t}=V(`EXPIRED`,`session topic: ${e}`);throw Error(t)}if(!this.client.core.crypto.keychain.has(e)){let{message:t}=V(`MISSING_OR_INVALID`,`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),Error(t)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(zt(e,!1)){let{message:t}=V(`NO_MATCHING_KEY`,`session or pairing topic doesn't exist: ${e}`);throw Error(t)}else{let{message:t}=V(`MISSING_OR_INVALID`,`session or pairing topic should be a string: ${e}`);throw Error(t)}}async isValidProposalId(e){if(!be(e)){let{message:t}=V(`MISSING_OR_INVALID`,`proposal id should be a number: ${e}`);throw Error(t)}if(!this.client.proposal.keys.includes(e)){let{message:t}=V(`NO_MATCHING_KEY`,`proposal id doesn't exist: ${e}`);throw Error(t)}if(Lt(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);let{message:t}=V(`EXPIRED`,`proposal id: ${e}`);throw Error(t)}}validateRequestExpiry(e){if(e&&!xt(e,D_)){let{message:t}=V(`MISSING_OR_INVALID`,`request() expiry: ${e}. Expiry must be a number (in seconds) between ${D_.min} and ${D_.max}`);throw Error(t)}}},z_=class extends l_{constructor(e,t){super(e,t,x_,v_),this.core=e,this.logger=t}},B_=class extends l_{constructor(e,t){super(e,t,C_,v_),this.core=e,this.logger=t}},V_=class extends l_{constructor(e,t){super(e,t,A_,v_,e=>e.id),this.core=e,this.logger=t}},H_=class extends l_{constructor(e,t){super(e,t,N_,I_,()=>L_),this.core=e,this.logger=t}},U_=class extends l_{constructor(e,t){super(e,t,P_,I_),this.core=e,this.logger=t}},W_=class extends l_{constructor(e,t){super(e,t,F_,I_,e=>e.id),this.core=e,this.logger=t}},G_=class{constructor(e,t){this.core=e,this.logger=t,this.authKeys=new H_(this.core,this.logger),this.pairingTopics=new U_(this.core,this.logger),this.requests=new W_(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}},K_=class e extends kh{constructor(e){super(e),this.protocol=`wc`,this.version=2,this.name=y_.name,this.events=new Kr.EventEmitter,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.removeAllListeners=e=>this.events.removeAllListeners(e),this.connect=async e=>{try{return await this.engine.connect(e)}catch(e){throw this.logger.error(e.message),e}},this.pair=async e=>{try{return await this.engine.pair(e)}catch(e){throw this.logger.error(e.message),e}},this.approve=async e=>{try{return await this.engine.approve(e)}catch(e){throw this.logger.error(e.message),e}},this.reject=async e=>{try{return await this.engine.reject(e)}catch(e){throw this.logger.error(e.message),e}},this.update=async e=>{try{return await this.engine.update(e)}catch(e){throw this.logger.error(e.message),e}},this.extend=async e=>{try{return await this.engine.extend(e)}catch(e){throw this.logger.error(e.message),e}},this.request=async e=>{try{return await this.engine.request(e)}catch(e){throw this.logger.error(e.message),e}},this.respond=async e=>{try{return await this.engine.respond(e)}catch(e){throw this.logger.error(e.message),e}},this.ping=async e=>{try{return await this.engine.ping(e)}catch(e){throw this.logger.error(e.message),e}},this.emit=async e=>{try{return await this.engine.emit(e)}catch(e){throw this.logger.error(e.message),e}},this.disconnect=async e=>{try{return await this.engine.disconnect(e)}catch(e){throw this.logger.error(e.message),e}},this.find=e=>{try{return this.engine.find(e)}catch(e){throw this.logger.error(e.message),e}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(e){throw this.logger.error(e.message),e}},this.authenticate=async(e,t)=>{try{return await this.engine.authenticate(e,t)}catch(e){throw this.logger.error(e.message),e}},this.formatAuthMessage=e=>{try{return this.engine.formatAuthMessage(e)}catch(e){throw this.logger.error(e.message),e}},this.approveSessionAuthenticate=async e=>{try{return await this.engine.approveSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}},this.rejectSessionAuthenticate=async e=>{try{return await this.engine.rejectSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}},this.name=e?.name||y_.name,this.metadata=je(e?.metadata),this.signConfig=e?.signConfig;let t=Rt({logger:e?.logger||y_.logger,name:this.name});this.logger=t,this.core=e?.core||new g_(e),this.session=new B_(this.core,this.logger),this.proposal=new z_(this.core,this.logger),this.pendingRequest=new V_(this.core,this.logger),this.engine=new R_(this),this.auth=new G_(this.core,this.logger)}static async init(t){let n=new e(t);return await n.initialize(),n}get context(){return en(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace(`Initialized`);try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info(`SignClient Initialization Success`)}catch(e){throw this.logger.info(`SignClient Initialization Failure`),this.logger.error(e.message),e}}},q_=`WALLETCONNECT_DEEPLINK_CHOICE`,J_={isHttpUrl(e){return e.startsWith(`http://`)||e.startsWith(`https://`)},formatNativeUrl(e,t,n,r){if(J_.isHttpUrl(e))return this.formatUniversalUrl(e,t,r);let i=e.replaceAll(`/`,``).replaceAll(`:`,``);return J_.setWalletConnectDeepLink(i,r),`${i}://wc?uri=${encodeURIComponent(t)}`},formatUniversalUrl(e,t,n){if(!J_.isHttpUrl(e))return this.formatNativeUrl(e,t,n);let r=e;return e.endsWith(`/`)&&(r=e.slice(0,-1)),J_.setWalletConnectDeepLink(r,n),`${r}/wc?uri=${encodeURIComponent(t)}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t=`_self`){window.open(e,t,`noreferrer noopener`)},setWalletConnectDeepLink(e,t){localStorage.setItem(q_,JSON.stringify({href:e,name:t}))},removeWalletConnectDeepLink(){localStorage.removeItem(q_)}};_();var Y_=`https://explorer-api.walletconnect.com`,X_=class{walletInfo;signClient;wcCloudInfo;actions;qrUrl;appUrl;pairings=[];sessions=[];emitter;logger;options;relayUrl;env;requiredNamespaces;_defaultSignOptions={preferNoSetFee:!1,preferNoSetMemo:!0,disableBalanceCheck:!0};constructor(e){if(!e.walletconnect)throw Error(`'walletconnect' info for wallet ${e.prettyName} is not provided in wallet registry.`);this.walletInfo=e,this.qrUrl={state:U.Init},this.appUrl={state:U.Init},this.requiredNamespaces=e.walletconnect.requiredNamespaces}get defaultSignOptions(){return this._defaultSignOptions}setDefaultSignOptions(e){this._defaultSignOptions=e}get isMobile(){return this.env?.device===`mobile`}get wcName(){return this.walletInfo.walletconnect.name}get wcEncoding(){return this.walletInfo.walletconnect.encoding||`hex`}get wcProjectId(){return this.walletInfo.walletconnect.projectId}get wcMobile(){return this.walletInfo.walletconnect.mobile}get accounts(){let e=[];return this.sessions.forEach(t=>{Object.entries(t.namespaces).forEach(([,t])=>{t.accounts.forEach(t=>{let[n,r,i]=t.split(`:`);e.push({namespace:n,chainId:r,address:i})})})}),e}deleteSession(e){let t=[];this.sessions=this.sessions.filter(n=>n.topic===e?(n.namespaces.cosmos.accounts.forEach(e=>{let[,n]=e.split(`:`);t.push(n)}),!1):!0),this.emitter?.emit(`reset`,t),this.logger?.debug("[WALLET EVENT] Emit `reset`")}subscribeToEvents(){if(this.signClient===void 0)throw Error(`WalletConnect is not initialized`);this.signClient.on(`session_ping`,e=>{this.logger?.debug(`EVENT`,`session_ping`,e)}),this.signClient.on(`session_event`,async e=>{this.logger?.debug(`EVENT`,`session_event`,e)}),this.signClient.on(`session_update`,({topic:e,params:t})=>{this.logger?.debug(`EVENT`,`session_update`,{topic:e,params:t})}),this.signClient.on(`session_delete`,e=>{this.logger?.debug(`EVENT`,`session_delete`,e),this.deleteSession(e.topic)}),this.signClient.on(`session_expire`,e=>{this.logger?.debug(`EVENT`,`session_expire`,e),this.deleteSession(e.topic)}),this.signClient.on(`session_proposal`,e=>{this.logger?.debug(`EVENT`,`session_proposal`,e)}),this.signClient.on(`session_request`,e=>{this.logger?.debug(`EVENT`,`session_request`,e)}),this.signClient.on(`proposal_expire`,e=>{this.logger?.debug(`EVENT`,`proposal_expire`,e)})}async deleteInactivePairings(){if(this.signClient===void 0)throw Error(`WalletConnect is not initialized`);for(let e of this.signClient.pairing.getAll({active:!1}))await this.signClient.pairing.delete(e.topic,{code:7001,message:`Clear inactive pairings.`}),this.logger?.debug(`Delete inactive pairing:`,e.topic)}async deleteAllPairings(){if(this.signClient===void 0)throw Error(`WalletConnect is not initialized`);for(let e of this.signClient.pairing.getAll())await this.signClient.pairing.delete(e.topic,{code:7001,message:`Clear pairings.`}),this.logger?.debug(`Delete pairing:`,e.topic)}restorePairings(){if(this.signClient===void 0)throw Error(`WalletConnect is not initialized`);this.pairings=this.signClient.pairing.getAll({active:!0}).filter(e=>e.peerMetadata?.name===this.wcName&&e.expiry*1e3>Date.now()+1e3),this.logger?.debug(`RESTORED PAIRINGS: `,this.pairings)}get pairing(){return this.pairings[0]}restoreSessions(){if(this.signClient===void 0)throw Error(`WalletConnect is not initialized`);this.sessions=this.signClient.session.getAll().filter(e=>e.peer.metadata.name===this.wcName&&e.expiry*1e3>Date.now()+1e3),this.logger?.debug(`RESTORED SESSIONS: `,this.sessions)}async getSession(e,t){return this.signClient===void 0&&await this.init(),this.sessions.find(n=>n.namespaces[e]?.accounts?.find(n=>n.startsWith(`${e}:${t}`)))}get walletName(){return this.walletInfo.name}get dappProjectId(){return this.options?.signClient.projectId}setActions(e){this.actions=e}setQRState(e){this.qrUrl.state=e,this.actions?.qrUrl?.state(e)}setQRError(e){this.setQRState(U.Error),this.qrUrl.message=typeof e==`string`?e:e?.message,this.actions?.qrUrl?.message?.(this.qrUrl.message),typeof e!=`string`&&e?.stack&&this.logger?.error(e.stack)}async init(){await this.initSignClient(),this.isMobile&&await this.initAppUrl()}async initSignClient(){this.signClient&&this.relayUrl===this.options?.signClient.relayUrl||(this.signClient=await K_.init(this.options?.signClient),this.relayUrl=this.options?.signClient.relayUrl,this.logger?.debug(`CREATED CLIENT: `,this.signClient),this.logger?.debug(`relayerRegion `,this.options?.signClient.relayUrl),this.subscribeToEvents(),this.restorePairings(),this.restoreSessions())}async initWCCloudInfo(){let e=`${Y_}/v3/wallets?projectId=${this.dappProjectId}&sdks=sign_v2&search=${this.wcName}`,t=await(await fetch(e)).json();this.wcCloudInfo=t.listings[this.walletInfo.walletconnect.projectId],this.logger?.debug(`WalletConnect Info:`,this.wcCloudInfo)}async initAppUrl(){this.appUrl.state=U.Pending,this.wcCloudInfo||await this.initWCCloudInfo();let e=this.wcCloudInfo.mobile.native||this.wcMobile?.native,t=this.wcCloudInfo.mobile.universal||this.wcMobile?.universal;this.appUrl.data={native:e,universal:t},this.appUrl.state=U.Done}get nativeUrl(){let e=this.appUrl.data?.native;if(typeof e==`string`||e===void 0)return e;{let{android:t,ios:n,macos:r,windows:i}=e;switch(this.env?.os){case`android`:return t;case`ios`:return n;case`macos`:return r;case`windows`:return i;default:throw Error(`Unknown os: ${this.env?.os}.`)}}}get universalUrl(){return this.appUrl.data?.universal}get redirectHref(){return this.nativeUrl||this.universalUrl}get redirectHrefWithWCUri(){let e;return this.nativeUrl?e=(this.walletInfo.walletconnect.formatNativeUrl||J_.formatNativeUrl)(this.nativeUrl,this.qrUrl.data,this.env?.os,this.walletName):this.universalUrl&&(e=(this.walletInfo.walletconnect.formatUniversalUrl||J_.formatUniversalUrl)(this.universalUrl,this.qrUrl.data,this.walletName)),e}get displayQRCode(){return!(this.pairing||this.redirect)}get redirect(){return!!(this.isMobile&&(this.nativeUrl||this.universalUrl))}openApp(e=!0){let t=e?this.redirectHrefWithWCUri:this.redirectHref;t?(this.logger?.debug(`Redirecting:`,t),J_.openHref(t)):this.logger?.error(`No redirecting href.`)}async connect(e,t){this.signClient===void 0&&await this.init(),this.qrUrl.state!==`Init`&&this.setQRState(U.Init);let n=typeof e==`string`?[`cosmos:${e}`]:e.map(e=>`cosmos:${e}`);this.restorePairings();let r=this.pairing;this.logger?.debug(`Restored active pairing topic is:`,r?.topic),this.displayQRCode&&this.setQRState(U.Pending);let i={cosmos:{methods:[`cosmos_getAccounts`,`cosmos_signAmino`,`cosmos_signDirect`,...this.requiredNamespaces?.methods??[]],chains:n,events:[`chainChanged`,`accountsChanged`,...this.requiredNamespaces?.events??[]]}},a;try{this.logger?.debug(`Connecting chains:`,n),a=await this.signClient.connect({pairingTopic:r?.topic,requiredNamespaces:i,...t}),this.qrUrl.data=a.uri,this.logger?.debug(`Using QR URI:`,a.uri),this.displayQRCode&&this.setQRState(U.Done)}catch(e){this.logger?.error(`Client connect error: `,e),this.displayQRCode&&this.setQRError(e);return}this.redirect&&this.openApp();try{let e=await a.approval();this.logger?.debug(`Established session:`,e),this.sessions.push(e),this.restorePairings()}catch(e){throw this.logger?.error(`Session approval error: `,e),await this.deleteInactivePairings(),e?e.code==5001?Mn:e:(this.displayQRCode&&this.setQRError(On),Error(`Proposal Expired`))}finally{!r&&this.qrUrl.message!==On.message&&this.setQRState(U.Init)}}async disconnect(e){if(this.signClient===void 0&&await this.init(),e?.walletconnect?.removeAllPairings===!0&&await this.deleteAllPairings(),this.sessions.length!==0){for(let e of this.sessions)try{this.logger?.debug(`Delete session:`,e);let{getSdkError:t}=await g(async()=>{let{getSdkError:e}=await import(`./dist-BRCQU1Li.js`).then(e=>e.dt);return{getSdkError:e}},__vite__mapDeps([13,1,14,15,16,17,18,19,20,21,22,23,24,4,25,26,27,28,29,30,2,3,31,32,33,34,10,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60]));await this.signClient.disconnect({topic:e.topic,reason:t(`USER_DISCONNECTED`)})}catch(t){this.logger?.error(`SignClient.disconnect session ${e.topic} failed:`,t)}this.sessions=[],this.emitter?.emit(`sync_disconnect`),this.logger?.debug("[WALLET EVENT] Emit `sync_disconnect`")}}async getSimpleAccount(e){let t=this.accounts.find(({chainId:t})=>t===e);if(!t)throw Error(`Chain ${e} is not connected yet, please check the session approval namespaces`);return t}getOfflineSignerAmino(e){return{getAccounts:async()=>[await this.getAccount(e)],signAmino:(t,n)=>this.signAmino(e,t,n)}}getOfflineSignerDirect(e){return{getAccounts:async()=>[await this.getAccount(e)],signDirect:(t,n)=>this.signDirect(e,t,n)}}async getOfflineSigner(e,t){return t===`amino`&&this.getOfflineSignerAmino?this.getOfflineSignerAmino(e):t===`direct`&&this.getOfflineSignerDirect?this.getOfflineSignerDirect(e):this.getOfflineSignerAmino?this.getOfflineSignerAmino?.(e):this.getOfflineSignerDirect(e)}async _getAccount(e){let t=await this.getSession(`cosmos`,e);if(!t)throw Error(`Session for ${e} not established yet.`);let n=await this.signClient.request({topic:t.topic,chainId:`cosmos:${e}`,request:{method:`cosmos_getAccounts`,params:{}}});return this.logger?.debug(`Response of cosmos_getAccounts`,n),n}async getAccount(e){let{address:t,algo:n,pubkey:r}=(await this._getAccount(e))[0];return{address:t,algo:n,pubkey:new Uint8Array(y.from(r,this.wcEncoding))}}async _signAmino(e,t,n,r){let i=await this.getSession(`cosmos`,e);if(!i)throw Error(`Session for ${e} not established yet.`);this.redirect&&this.openApp();let a=await this.signClient.request({topic:i.topic,chainId:`cosmos:${e}`,request:{method:`cosmos_signAmino`,params:{signerAddress:t,signDoc:n}}});return this.logger?.debug(`Response of cosmos_signAmino`,a),a}async signAmino(e,t,n,r){return await this._signAmino(e,t,n,r||this.defaultSignOptions)}async _signDirect(e,t,n,r){let i=await this.getSession(`cosmos`,e);if(!i)throw Error(`Session for ${e} not established yet.`);let a={signerAddress:t,signDoc:{chainId:n.chainId,bodyBytes:y.from(n.bodyBytes).toString(this.wcEncoding),authInfoBytes:y.from(n.authInfoBytes).toString(this.wcEncoding),accountNumber:n.accountNumber.toString()}};this.redirect&&this.openApp();let o=await this.signClient.request({topic:i.topic,chainId:`cosmos:${e}`,request:{method:`cosmos_signDirect`,params:a}});return this.logger?.debug(`Response of cosmos_signDirect`,o),o}async signDirect(e,t,n,r){let{signed:i,signature:a}=await this._signDirect(e,t,n,r||this.defaultSignOptions);return{signed:{chainId:i.chainId,accountNumber:BigInt(i.accountNumber),authInfoBytes:new Uint8Array(y.from(i.authInfoBytes,this.wcEncoding)),bodyBytes:new Uint8Array(y.from(i.bodyBytes,this.wcEncoding))},signature:a}}},Z_=class extends qr{WCClient;clientMutable={state:U.Init};constructor(e,t,n){if(!e.walletconnect)throw Error(`'walletconnect' info for wallet ${e.prettyName} is not provided in wallet registry.`);super(e,t),this.WCClient=n}async initClient(e){if(!e){this.initClientError(Error("`walletconnectOptions` is not provided."));return}if(!e.signClient.projectId){this.initClientError(Error("`projectId` is not provided in `walletconnectOptions`."));return}this.initingClient();try{let t=new this.WCClient(this.walletInfo);t.logger=this.logger,t.emitter=this.emitter,t.env=this.env,t.options=e,this.initClientDone(t)}catch(e){this.initClientError(e)}}},Q_=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MessageRegistry=void 0,e.MessageRegistry=class{constructor(){this.registeredMsgType=new Map}registerMessage(e){if(this.registeredMsgType.has(e.type()))throw Error(`Already registered type ${e.type()}`);this.registeredMsgType.set(e.type(),e)}parseMessage(e){if(!e.type)throw Error(`Null type`);let t=this.registeredMsgType.get(e.type);if(!t)throw Error(`Unregistered msg type ${e.type}`);return Object.setPrototypeOf(e.msg,t.prototype)}}})),$_=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromHex=e.toHex=void 0;function t(e){let t=``;for(let n of e)t+=(`0`+n.toString(16)).slice(-2);return t}e.toHex=t;function n(e){if(e.length%2!=0)throw Error(`hex string length must be a multiple of 2`);let t=[];for(let n=0;n<e.length;n+=2){let r=e.substr(n,2);if(!r.match(/[0-9a-f]{2}/i))throw Error(`hex string contains invalid characters`);t.push(parseInt(r,16))}return new Uint8Array(t)}e.fromHex=n})),ev=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.JSONUint8Array=void 0;var t=$_();e.JSONUint8Array=class e{static parse(e){return JSON.parse(e,(e,n)=>{if(e===`__proto__`)throw Error(`__proto__ is disallowed`);return n&&typeof n==`string`&&n.startsWith(`__uint8array__`)?(0,t.fromHex)(n.replace(`__uint8array__`,``)):typeof BigInt<`u`&&n&&typeof n==`string`&&n.startsWith(`__bigint__`)?BigInt(n.replace(`__bigint__`,``)):n})}static stringify(e){return JSON.stringify(e,(e,n)=>{if(e===`__proto__`)throw Error(`__proto__ is disallowed`);if(n&&(n instanceof Uint8Array||typeof n==`object`&&`type`in n&&`data`in n&&n.type===`Buffer`&&Array.isArray(n.data))){let e=n instanceof Uint8Array?n:new Uint8Array(n.data);return`__uint8array__${(0,t.toHex)(e)}`}return typeof n==`bigint`?`__bigint__${n.toString()}`:n})}static wrap(t){if(t!==void 0)return JSON.parse(e.stringify(t))}static unwrap(t){if(t!==void 0)return e.parse(e.stringify(t))}}})),tv=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.Router=void 0;var n=Q_(),r=ev();e.Router=class{constructor(e){this.envProducer=e,this.msgRegistry=new n.MessageRegistry,this.registeredHandler=new Map,this.guards=[],this.port=``,this._isInitialized=!1}get isInitialized(){return this._isInitialized}registerMessage(e){this.msgRegistry.registerMessage(e)}addHandler(e,t){if(this.registeredHandler.has(e))throw Error(`Already registered type ${e}`);this.registeredHandler.set(e,t)}addGuard(e){this.guards.push(e)}listen(e,n){return t(this,void 0,void 0,function*(){if(this.port=e,this.attachHandler(),n){let e;this._initWaiter=new Promise(t=>{e=t}),yield n(),e()}this._isInitialized=!0})}unlisten(){this.port=``,this.detachHandler()}handleMessage(e,n){return t(this,void 0,void 0,function*(){this.isInitialized||(yield this._initWaiter);let t=this.msgRegistry.parseMessage(r.JSONUint8Array.unwrap(e)),i=this.envProducer(n,t.routerMeta??{});for(let e of this.guards)yield e(i,t,n);t.validateBasic();let a=t.route();if(!a)throw Error(`Null router`);let o=this.registeredHandler.get(a);if(!o)throw Error(`Can't get handler`);return r.JSONUint8Array.wrap(yield o(i,t))})}}})),nv=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),rv=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),iv=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),av=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.EthereumProviderRpcError=e.KeplrError=void 0,e.KeplrError=class e extends Error{constructor(t,n,r){super(r),this.module=t,this.code=n,Object.setPrototypeOf(this,e.prototype)}},e.EthereumProviderRpcError=class e extends Error{constructor(t,n,r){super(n),this.code=t,this.data=r,Object.setPrototypeOf(this,e.prototype)}}})),ov=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Message=void 0,e.Message=class{approveExternal(e,t){return!1}}})),sv=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.WEBPAGE_PORT=e.APP_PORT=e.BACKGROUND_PORT=void 0,e.BACKGROUND_PORT=`background`,e.APP_PORT=`popup`,e.WEBPAGE_PORT=`webpage`})),cv=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.sendSimpleMessage=e.SimpleMessage=void 0;var n=ov(),r=Symbol(),i=Symbol(),a=class extends n.Message{constructor(e,t,n){super(),this[r]=e,this[i]=t;for(let e of Object.keys(n))this[e]=n[e]}route(){return this[r]}type(){return this[i]}validateBasic(){}approveExternal(){return!0}};e.SimpleMessage=a;function o(e,n,r,i,o){return t(this,void 0,void 0,function*(){return yield e.sendMessage(n,new a(r,i,o))})}e.sendSimpleMessage=o})),lv=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(tv(),e),n(nv(),e),n(rv(),e),n(iv(),e),n(av(),e),n(ov(),e),n(sv(),e),n(Q_(),e),n(cv(),e),n(ev(),e)})),uv=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.KeplrEnigmaUtils=void 0,e.KeplrEnigmaUtils=class{constructor(e,t){this.chainId=e,this.keplr=t}getPubkey(){return t(this,void 0,void 0,function*(){return yield this.keplr.getEnigmaPubKey(this.chainId)})}getTxEncryptionKey(e){return t(this,void 0,void 0,function*(){return yield this.keplr.getEnigmaTxEncryptionKey(this.chainId,e)})}encrypt(e,n){return t(this,void 0,void 0,function*(){return yield this.keplr.enigmaEncrypt(this.chainId,e,n)})}decrypt(e,n){return t(this,void 0,void 0,function*(){return yield this.keplr.enigmaDecrypt(this.chainId,e,n)})}}})),dv=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.CosmJSOfflineSigner=e.CosmJSOfflineSignerOnlyAmino=void 0;var n=class{constructor(e,t,n){this.chainId=e,this.keplr=t,this.signOptions=n}getAccounts(){return t(this,void 0,void 0,function*(){let e=yield this.keplr.getKey(this.chainId);return[{address:e.bech32Address,algo:`secp256k1`,pubkey:e.pubKey}]})}signAmino(e,n){return t(this,void 0,void 0,function*(){if(this.chainId!==n.chain_id)throw Error(`Unmatched chain id with the offline signer`);if((yield this.keplr.getKey(n.chain_id)).bech32Address!==e)throw Error(`Unknown signer address`);return yield this.keplr.signAmino(this.chainId,e,n,this.signOptions)})}sign(e,n){return t(this,void 0,void 0,function*(){return yield this.signAmino(e,n)})}};e.CosmJSOfflineSignerOnlyAmino=n,e.CosmJSOfflineSigner=class extends n{constructor(e,t,n){super(e,t,n)}signDirect(e,n){return t(this,void 0,void 0,function*(){if(this.chainId!==n.chainId)throw Error(`Unmatched chain id with the offline signer`);if((yield this.keplr.getKey(n.chainId)).bech32Address!==e)throw Error(`Unknown signer address`);return yield this.keplr.signDirect(this.chainId,e,n,this.signOptions)})}}})),fv=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Keplr=void 0;var i=lv(),a=uv(),o=dv(),s=r(Vn()),c=r(G()),l=(_(),n(v)),u=r(M());e.Keplr=class{constructor(e,t,n){this.version=e,this.mode=t,this.requester=n,this.enigmaUtils=new Map,this.defaultOptions={},this.ethereum=new f(this,this.requester),this.starknet=new m(this,this.requester),this.bitcoin=new h(this,this.requester)}ping(){return t(this,void 0,void 0,function*(){yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`chains`,`keplr-ping`,{})})}enable(e){return typeof e==`string`&&(e=[e]),new Promise((t,n)=>{let r=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`permission-interactive`,`enable-access`,{chainIds:e}).then(t).catch(n).finally(()=>r=!0),setTimeout(()=>{r||this.protectedTryOpenSidePanelIfEnabled()},300)})}isEnabled(e){return t(this,void 0,void 0,function*(){return typeof e==`string`&&(e=[e]),yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`permission-interactive`,`is-enabled-access`,{chainIds:e})})}disable(e){return t(this,void 0,void 0,function*(){return typeof e==`string`&&(e=[e]),new Promise((t,n)=>{let r=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`permission-interactive`,`disable-access`,{chainIds:e??[]}).then(t).catch(n).finally(()=>r=!0),setTimeout(()=>{r||this.protectedTryOpenSidePanelIfEnabled()},300)})})}experimentalSuggestChain(e){return t(this,void 0,void 0,function*(){if(e.hideInUI)throw Error(`hideInUI is not allowed`);if(e.gasPriceStep){let t=Object.assign({},e.gasPriceStep);for(let n of e.feeCurrencies)n.gasPriceStep||=t;delete e.gasPriceStep}return e.coinType&&delete e.coinType,new Promise((t,n)=>{let r=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`chains`,`need-suggest-chain-info-interaction`,{chainInfo:e}).then(a=>{a||(r=!0),(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`chains`,`suggest-chain-info`,{chainInfo:e}).then(t).catch(n).finally(()=>r=!0),setTimeout(()=>{r||this.protectedTryOpenSidePanelIfEnabled()},300)})})})}getKey(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let r=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-cosmos`,`get-cosmos-key`,{chainId:e}).then(t).catch(n).finally(()=>r=!0),setTimeout(()=>{r||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getKeysSettled(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let r=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-cosmos`,`get-cosmos-keys-settled`,{chainIds:e}).then(t).catch(n).finally(()=>r=!0),setTimeout(()=>{r||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getChainInfosWithoutEndpoints(){return t(this,void 0,void 0,function*(){return new Promise((e,t)=>{let n=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`chains`,`get-chain-infos-without-endpoints`,{}).then(t=>e(t.chainInfos)).catch(t).finally(()=>n=!0),setTimeout(()=>{n||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getChainInfoWithoutEndpoints(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let r=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`chains`,`get-chain-info-without-endpoints`,{chainId:e}).then(e=>t(e.chainInfo)).catch(n).finally(()=>r=!0),setTimeout(()=>{r||this.protectedTryOpenSidePanelIfEnabled()},300)})})}sendTx(e,n,r){return t(this,void 0,void 0,function*(){return yield this.enable(e),yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`background-tx`,`send-tx-to-background`,{chainId:e,tx:n,mode:r})})}signAmino(e,n,r,a={}){return t(this,void 0,void 0,function*(){return new Promise((t,o)=>{let c=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-cosmos`,`request-cosmos-sign-amino`,{chainId:e,signer:n,signDoc:r,signOptions:(0,s.default)(this.defaultOptions.sign??{},a)}).then(t).catch(o).finally(()=>c=!0),setTimeout(()=>{c||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signDirect(e,n,r,a={}){return t(this,void 0,void 0,function*(){return new Promise((t,o)=>{let l=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-cosmos`,`request-cosmos-sign-direct`,{chainId:e,signer:n,signDoc:{bodyBytes:r.bodyBytes,authInfoBytes:r.authInfoBytes,chainId:r.chainId,accountNumber:r.accountNumber?r.accountNumber.toString():null},signOptions:(0,s.default)(this.defaultOptions.sign??{},a)}).then(e=>t({signed:{bodyBytes:e.signed.bodyBytes,authInfoBytes:e.signed.authInfoBytes,chainId:e.signed.chainId,accountNumber:c.default.fromString(e.signed.accountNumber)},signature:e.signature})).catch(o).finally(()=>l=!0),setTimeout(()=>{l||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signDirectAux(e,n,r,a={}){return t(this,void 0,void 0,function*(){return new Promise((t,o)=>{let l=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-cosmos`,`request-cosmos-sign-direct-aux`,{chainId:e,signer:n,signDoc:{bodyBytes:r.bodyBytes,publicKey:r.publicKey,chainId:r.chainId,accountNumber:r.accountNumber?r.accountNumber.toString():null,sequence:r.sequence?r.sequence.toString():null},signOptions:(0,s.default)({preferNoSetMemo:this.defaultOptions.sign?.preferNoSetMemo},a)}).then(e=>t({signed:{bodyBytes:e.signed.bodyBytes,publicKey:e.signed.publicKey,chainId:e.signed.chainId,accountNumber:c.default.fromString(e.signed.accountNumber),sequence:c.default.fromString(e.signed.sequence)},signature:e.signature})).catch(o).finally(()=>l=!0),setTimeout(()=>{l||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signArbitrary(e,n,r){return t(this,void 0,void 0,function*(){return new Promise((t,a)=>{let o=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-cosmos`,`request-cosmos-sign-amino-adr-36`,{chainId:e,signer:n,data:typeof r==`string`?l.Buffer.from(r):r,signOptions:{isADR36WithString:typeof r==`string`}}).then(t).catch(a).finally(()=>o=!0),setTimeout(()=>{o||this.protectedTryOpenSidePanelIfEnabled()},300)})})}verifyArbitrary(e,n,r,a){return t(this,void 0,void 0,function*(){return typeof r==`string`&&(r=l.Buffer.from(r)),new Promise((t,o)=>{let s=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-cosmos`,`verify-cosmos-sign-amino-adr-36`,{chainId:e,signer:n,data:r,signature:a}).then(t).catch(o).finally(()=>s=!0),setTimeout(()=>{s||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signEthereum(e,n,r,a){return t(this,void 0,void 0,function*(){return new Promise((t,o)=>{let s=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-ethereum`,`request-sign-ethereum`,{chainId:e,signer:n,message:typeof r==`string`?l.Buffer.from(r):r,signType:a}).then(t).catch(o).finally(()=>s=!0),setTimeout(()=>{s||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signICNSAdr36(e,n,r,a,o){return t(this,void 0,void 0,function*(){return new Promise((t,s)=>{let c=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-cosmos`,`request-icns-adr-36-signatures-v2`,{chainId:e,contractAddress:n,owner:r,username:a,addressChainIds:o}).then(t).catch(s).finally(()=>c=!0),setTimeout(()=>{c||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getOfflineSigner(e,t){return new o.CosmJSOfflineSigner(e,this,t)}getOfflineSignerOnlyAmino(e,t){return new o.CosmJSOfflineSignerOnlyAmino(e,this,t)}getOfflineSignerAuto(e,n){return t(this,void 0,void 0,function*(){return(yield this.getKey(e)).isNanoLedger?new o.CosmJSOfflineSignerOnlyAmino(e,this,n):new o.CosmJSOfflineSigner(e,this,n)})}suggestToken(e,n,r){return t(this,void 0,void 0,function*(){return new Promise((t,a)=>{let o=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`token-cw20`,`SuggestTokenMsg`,{chainId:e,contractAddress:n,viewingKey:r}).then(t).catch(a).finally(()=>o=!0),setTimeout(()=>{o||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getSecret20ViewingKey(e,n){return t(this,void 0,void 0,function*(){return new Promise((t,r)=>{let a=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`token-cw20`,`get-secret20-viewing-key`,{chainId:e,contractAddress:n}).then(t).catch(r).finally(()=>a=!0),setTimeout(()=>{a||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getEnigmaPubKey(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let r=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`secret-wasm`,`get-pubkey-msg`,{chainId:e}).then(t).catch(n).finally(()=>r=!0),setTimeout(()=>{r||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getEnigmaTxEncryptionKey(e,n){return t(this,void 0,void 0,function*(){return new Promise((t,r)=>{let a=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`secret-wasm`,`get-tx-encryption-key-msg`,{chainId:e,nonce:n}).then(t).catch(r).finally(()=>a=!0),setTimeout(()=>{a||this.protectedTryOpenSidePanelIfEnabled()},300)})})}enigmaEncrypt(e,n,r){return t(this,void 0,void 0,function*(){return new Promise((t,a)=>{let o=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`secret-wasm`,`request-encrypt-msg`,{chainId:e,contractCodeHash:n,msg:r}).then(t).catch(a).finally(()=>o=!0),setTimeout(()=>{o||this.protectedTryOpenSidePanelIfEnabled()},300)})})}enigmaDecrypt(e,n,r){return t(this,void 0,void 0,function*(){return!n||n.length===0?new Uint8Array:new Promise((t,a)=>{let o=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`secret-wasm`,`request-decrypt-msg`,{chainId:e,cipherText:n,nonce:r}).then(t).catch(a).finally(()=>o=!0),setTimeout(()=>{o||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getEnigmaUtils(e){if(this.enigmaUtils.has(e))return this.enigmaUtils.get(e);let t=new a.KeplrEnigmaUtils(e,this);return this.enigmaUtils.set(e,t),t}experimentalSignEIP712CosmosTx_v0(e,n,r,a,o={}){return t(this,void 0,void 0,function*(){return new Promise((t,c)=>{let l=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-cosmos`,`request-sign-eip-712-cosmos-tx-v0`,{chainId:e,signer:n,eip712:r,signDoc:a,signOptions:(0,s.default)(this.defaultOptions.sign??{},o)}).then(t).catch(c).finally(()=>l=!0),setTimeout(()=>{l||this.protectedTryOpenSidePanelIfEnabled()},300)})})}__core__getAnalyticsId(){return t(this,void 0,void 0,function*(){return yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`analytics`,`get-analytics-id`,{})})}changeKeyRingName({defaultName:e,editable:n=!0}){return t(this,void 0,void 0,function*(){return new Promise((t,r)=>{let a=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-v2`,`change-keyring-name-interactive`,{defaultName:e,editable:n}).then(t).catch(r).finally(()=>a=!0),setTimeout(()=>{a||this.protectedTryOpenSidePanelIfEnabled()},300)})})}__core__privilageSignAminoWithdrawRewards(e,n,r){return t(this,void 0,void 0,function*(){return yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-cosmos`,`PrivilegeCosmosSignAminoWithdrawRewards`,{chainId:e,signer:n,signDoc:r})})}__core__privilageSignAminoDelegate(e,n,r){return t(this,void 0,void 0,function*(){return yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-cosmos`,`PrivilegeCosmosSignAminoDelegate`,{chainId:e,signer:n,signDoc:r})})}__core__privilageSignAminoExecuteCosmWasm(e,n,r){return t(this,void 0,void 0,function*(){return yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-cosmos`,`PrivilegeCosmosSignAminoExecuteCosmWasm`,{chainId:e,signer:n,signDoc:r})})}sendEthereumTx(e,n){return t(this,void 0,void 0,function*(){return yield this.enable(e),yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`background-tx-ethereum`,`send-ethereum-tx-to-background`,{chainId:e,tx:n})})}suggestERC20(e,n){return t(this,void 0,void 0,function*(){return new Promise((t,r)=>{let a=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`token-erc20`,`SuggestERC20TokenMsg`,{chainId:e,contractAddress:n}).then(t).catch(r).finally(()=>a=!0),setTimeout(()=>{a||this.protectedTryOpenSidePanelIfEnabled()},300)})})}__core__webpageClosed(){return t(this,void 0,void 0,function*(){yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`interaction`,`injected-webpage-closed`,{})})}getStarknetKey(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let r=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-starknet`,`get-starknet-key`,{chainId:e}).then(t).catch(n).finally(()=>r=!0),setTimeout(()=>{r||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getStarknetKeysSettled(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let r=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-starknet`,`get-starknet-keys-settled`,{chainIds:e}).then(t).catch(n).finally(()=>r=!0),setTimeout(()=>{r||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signStarknetTx(e,n,r){return t(this,void 0,void 0,function*(){return new Promise((t,a)=>{let o=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-starknet`,`request-sign-starknet-tx`,{chainId:e,transactions:n,details:r}).then(t).catch(a).finally(()=>o=!0),setTimeout(()=>{o||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signStarknetDeployAccountTransaction(e,n){return t(this,void 0,void 0,function*(){return new Promise((t,r)=>{let a=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-starknet`,`request-sign-starknet-deploy-account-tx`,{chainId:e,transaction:n}).then(t).catch(r).finally(()=>a=!0),setTimeout(()=>{a||this.protectedTryOpenSidePanelIfEnabled()})})})}getBitcoinKey(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let r=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-bitcoin`,`get-bitcoin-key`,{chainId:e}).then(t).catch(n).finally(()=>r=!0),setTimeout(()=>{r||this.protectedTryOpenSidePanelIfEnabled()},300)})})}getBitcoinKeysSettled(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{let r=!1;(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-bitcoin`,`get-bitcoin-keys-settled`,{chainIds:e}).then(t).catch(n).finally(()=>r=!0),setTimeout(()=>{r||this.protectedTryOpenSidePanelIfEnabled()},300)})})}signPsbt(e,n,r){return t(this,void 0,void 0,function*(){return yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-bitcoin`,`request-sign-bitcoin-psbt`,{chainId:e,psbtHex:n,options:r})})}signPsbts(e,n,r){return t(this,void 0,void 0,function*(){return yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring-bitcoin`,`request-sign-bitcoin-psbts`,{chainId:e,psbtsHexes:n,options:r})})}protectedTryOpenSidePanelIfEnabled(e=!1){return t(this,void 0,void 0,function*(){let t=!1;if(typeof window<`u`&&window.__keplr_content_script===!0&&(t=!0),t&&(yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`side-panel`,`GetSidePanelEnabledMsg`,{})).enabled)try{return yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`router-extension/src/router/extension.ts`,`tryOpenSidePanelIfEnabled`,{})}catch(t){if(!e&&t.message&&t.message.includes(`in response to a user gesture`)&&!document.getElementById(`__open_keplr_side_panel__`)){if(yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`interaction`,`ping-content-script-tab-has-opened-side-panel`,{}))return;let e=yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`keyring`,`GetIsLockedMsg`,{}),t=yield(0,i.sendSimpleMessage)(this.requester,i.BACKGROUND_PORT,`settings`,`GetThemeOptionMsg`,{}),n=`
6
6
  @font-face {
7
7
  font-family: 'Inter-SemiBold-Keplr';
8
8
  src: url('${chrome.runtime.getURL(`/assets/Inter-SemiBold.ttf`)}') format('truetype');