@multiversx/sdk-dapp 2.9.1 → 2.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -2
- package/UI/DappModal/hooks/index.js +1 -1
- package/UI/DappModal/hooks/useDappModal.js +1 -1
- package/UI/DappModal/index.js +1 -1
- package/UI/ModalContainer/ModalContainer.js +1 -1
- package/UI/ModalContainer/index.js +1 -1
- package/UI/NotificationModal/index.js +1 -1
- package/UI/SignTransactionsModals/SignTransactionsModals.js +1 -1
- package/UI/SignTransactionsModals/SignWithDeviceModal/SignStep.js +1 -1
- package/UI/SignTransactionsModals/SignWithDeviceModal/index.js +1 -1
- package/UI/SignTransactionsModals/SignWithExtensionModal/index.js +1 -1
- package/UI/SignTransactionsModals/SignWithLedgerModal/index.js +1 -1
- package/UI/SignTransactionsModals/SignWithOperaModal/index.js +1 -1
- package/UI/SignTransactionsModals/SignWithWalletConnectModal/index.js +1 -1
- package/UI/SignTransactionsModals/components/ConfirmationScreen.js +1 -1
- package/UI/SignTransactionsModals/components/DeviceConfirmationScreen.js +1 -1
- package/UI/SignTransactionsModals/components/index.js +1 -1
- package/UI/SignTransactionsModals/index.js +1 -1
- package/UI/TransactionInfo/TransactionInfo.js +1 -1
- package/UI/TransactionInfo/components/NonceMessage/NonceMessage.js +1 -1
- package/UI/TransactionInfo/components/NonceMessage/index.js +1 -1
- package/UI/TransactionInfo/components/index.js +1 -1
- package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoNonce/TransactionInfoNonce.js +1 -1
- package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoNonce/index.js +1 -1
- package/UI/TransactionInfo/components/transactionInfoFields/index.js +1 -1
- package/UI/TransactionInfo/index.js +1 -1
- package/UI/TransactionsTable/TransactionsTable.js +1 -1
- package/UI/TransactionsTable/index.js +1 -1
- package/UI/TransactionsToastList/TransactionsToastList.js +1 -1
- package/UI/TransactionsToastList/components/TransactionToast/TransactionToast.js +1 -1
- package/UI/TransactionsToastList/components/TransactionToast/hooks/useTransactionToast.js +1 -1
- package/UI/TransactionsToastList/components/TransactionToast/index.js +1 -1
- package/UI/TransactionsToastList/components/TransactionToastGuard.js +1 -1
- package/UI/TransactionsToastList/components/index.js +1 -1
- package/UI/TransactionsToastList/index.js +1 -1
- package/UI/extension/ExtensionLoginButton/index.js +1 -1
- package/UI/index.js +1 -1
- package/UI/ledger/LedgerLoginButton/index.js +1 -1
- package/UI/ledger/LedgerLoginContainer/ConfirmAddress.js +1 -1
- package/UI/ledger/LedgerLoginContainer/index.js +1 -1
- package/UI/ledger/index.js +1 -1
- package/UI/operaWallet/OperaWalletLoginButton/index.js +1 -1
- package/UI/pages/UnlockPage/index.js +1 -1
- package/UI/pages/index.js +1 -1
- package/UI/walletConnect/WalletConnectLoginButton/index.js +1 -1
- package/UI/walletConnect/WalletConnectLoginContainer/index.js +1 -1
- package/UI/walletConnect/index.js +1 -1
- package/UI/webWallet/WebWalletLoginButton/index.js +1 -1
- package/__chunks__/{chunk-CLT7BMUZ.js → chunk-2WCENO6D.js} +2 -2
- package/__chunks__/{chunk-GQKJXIDW.js → chunk-3Q7OTNFY.js} +2 -2
- package/__chunks__/{chunk-YS6UGIJF.js → chunk-43MYPOBW.js} +2 -2
- package/__chunks__/chunk-7AMV6USN.js +2 -0
- package/__chunks__/{chunk-EO33KRFB.js → chunk-ACFBL4A7.js} +2 -2
- package/__chunks__/{chunk-SQX4F25H.js → chunk-B4AJMI3T.js} +2 -2
- package/__chunks__/chunk-B4D6WVTB.js +2 -0
- package/__chunks__/{chunk-R72QG63F.js → chunk-CB3TM7NC.js} +2 -2
- package/__chunks__/{chunk-TMO4CU4X.js → chunk-DEO64IOA.js} +2 -2
- package/__chunks__/chunk-EZOGNXLH.js +2 -0
- package/__chunks__/{chunk-5V5FXSXD.js → chunk-GZYBS3RX.js} +2 -2
- package/__chunks__/{chunk-R2A7CTVV.js → chunk-IJJ232SS.js} +2 -2
- package/__chunks__/{chunk-3LC2R5IL.js → chunk-KU6GMEDW.js} +2 -2
- package/__chunks__/{chunk-2L6NVTPG.js → chunk-L4CGB34M.js} +2 -2
- package/__chunks__/{chunk-AJRQYEGW.js → chunk-NDKKNO3E.js} +2 -2
- package/__chunks__/chunk-P44CM6L4.js +2 -0
- package/__chunks__/{chunk-532JEGBO.js → chunk-PEA6B2ZZ.js} +2 -2
- package/__chunks__/chunk-R7ADKYKL.js +2 -0
- package/__chunks__/{chunk-S4YBNUTR.js → chunk-TRBGUYRQ.js} +2 -2
- package/__chunks__/{chunk-SJJMR3SF.js → chunk-U2XXWBAJ.js} +2 -2
- package/__chunks__/{chunk-J23NIYYN.js → chunk-V2L6I47E.js} +2 -2
- package/__chunks__/{chunk-V2YBBCN3.js → chunk-ZETCVO2R.js} +2 -2
- package/__chunks__/{chunk-NGFJHP3T.js → chunk-ZUKUDAXO.js} +2 -2
- package/__commonjs/UI/DappModal/hooks/index.js +1 -1
- package/__commonjs/UI/DappModal/hooks/useDappModal.js +1 -1
- package/__commonjs/UI/DappModal/index.js +3 -3
- package/__commonjs/UI/ModalContainer/ModalContainer.js +3 -3
- package/__commonjs/UI/ModalContainer/index.js +3 -3
- package/__commonjs/UI/NotificationModal/index.js +4 -4
- package/__commonjs/UI/SignTransactionsModals/SignTransactionsModals.js +22 -22
- package/__commonjs/UI/SignTransactionsModals/SignWithDeviceModal/SignStep.js +5 -5
- package/__commonjs/UI/SignTransactionsModals/SignWithDeviceModal/index.js +7 -7
- package/__commonjs/UI/SignTransactionsModals/SignWithExtensionModal/index.js +5 -5
- package/__commonjs/UI/SignTransactionsModals/SignWithLedgerModal/index.js +7 -7
- package/__commonjs/UI/SignTransactionsModals/SignWithOperaModal/index.js +5 -5
- package/__commonjs/UI/SignTransactionsModals/SignWithWalletConnectModal/index.js +5 -5
- package/__commonjs/UI/SignTransactionsModals/components/ConfirmationScreen.js +14 -14
- package/__commonjs/UI/SignTransactionsModals/components/DeviceConfirmationScreen.js +14 -14
- package/__commonjs/UI/SignTransactionsModals/components/index.js +14 -14
- package/__commonjs/UI/SignTransactionsModals/index.js +22 -22
- package/__commonjs/UI/TransactionInfo/TransactionInfo.js +26 -26
- package/__commonjs/UI/TransactionInfo/components/NonceMessage/NonceMessage.js +2 -2
- package/__commonjs/UI/TransactionInfo/components/NonceMessage/index.js +2 -2
- package/__commonjs/UI/TransactionInfo/components/index.js +27 -27
- package/__commonjs/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoNonce/TransactionInfoNonce.js +2 -2
- package/__commonjs/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoNonce/index.js +2 -2
- package/__commonjs/UI/TransactionInfo/components/transactionInfoFields/index.js +12 -12
- package/__commonjs/UI/TransactionInfo/index.js +27 -27
- package/__commonjs/UI/TransactionsTable/TransactionsTable.js +10 -10
- package/__commonjs/UI/TransactionsTable/index.js +5 -5
- package/__commonjs/UI/TransactionsToastList/TransactionsToastList.js +14 -14
- package/__commonjs/UI/TransactionsToastList/components/TransactionToast/TransactionToast.js +4 -4
- package/__commonjs/UI/TransactionsToastList/components/TransactionToast/hooks/useTransactionToast.js +2 -2
- package/__commonjs/UI/TransactionsToastList/components/TransactionToast/index.js +4 -4
- package/__commonjs/UI/TransactionsToastList/components/TransactionToastGuard.js +4 -4
- package/__commonjs/UI/TransactionsToastList/components/index.js +9 -9
- package/__commonjs/UI/TransactionsToastList/index.js +14 -14
- package/__commonjs/UI/extension/ExtensionLoginButton/index.js +4 -4
- package/__commonjs/UI/index.js +67 -67
- package/__commonjs/UI/ledger/LedgerLoginButton/index.js +16 -16
- package/__commonjs/UI/ledger/LedgerLoginContainer/ConfirmAddress.js +2 -2
- package/__commonjs/UI/ledger/LedgerLoginContainer/index.js +15 -15
- package/__commonjs/UI/ledger/index.js +16 -16
- package/__commonjs/UI/operaWallet/OperaWalletLoginButton/index.js +3 -3
- package/__commonjs/UI/pages/UnlockPage/index.js +19 -19
- package/__commonjs/UI/pages/index.js +19 -19
- package/__commonjs/UI/walletConnect/WalletConnectLoginButton/index.js +7 -7
- package/__commonjs/UI/walletConnect/WalletConnectLoginContainer/index.js +6 -6
- package/__commonjs/UI/walletConnect/index.js +7 -7
- package/__commonjs/UI/webWallet/WebWalletLoginButton/index.js +3 -3
- package/__commonjs/__mocks__/index.js +1 -1
- package/__commonjs/__mocks__/utils/index.js +1 -1
- package/__commonjs/__mocks__/utils/renderWithProvider.js +1 -1
- package/__commonjs/components/LogoutListener/LogoutListener.js +1 -1
- package/__commonjs/components/LogoutListener/helpers/index.js +1 -1
- package/__commonjs/components/LogoutListener/helpers/useLogoutFromMultipleTabs.js +1 -1
- package/__commonjs/components/LogoutListener/helpers/useNativeAuthLogout.js +1 -1
- package/__commonjs/components/LogoutListener/helpers/useNativeAuthLogoutWarning/index.js +1 -1
- package/__commonjs/components/LogoutListener/helpers/useNativeAuthLogoutWarning/useNativeAuthLogoutWarning.js +1 -1
- package/__commonjs/components/LogoutListener/index.js +1 -1
- package/__commonjs/components/ProviderInitializer.js +1 -1
- package/__commonjs/components/TransactionsTracker/TransactionTracker.js +1 -1
- package/__commonjs/components/TransactionsTracker/index.js +1 -1
- package/__commonjs/components/TransactionsTracker/useTransactionsTracker.js +1 -1
- package/__commonjs/hooks/index.js +1 -1
- package/__commonjs/hooks/login/index.js +1 -1
- package/__commonjs/hooks/login/useExtensionLogin.js +1 -1
- package/__commonjs/hooks/login/useLedgerLogin.js +1 -1
- package/__commonjs/hooks/login/useLoginService.js +1 -1
- package/__commonjs/hooks/login/useOperaLogin.js +1 -1
- package/__commonjs/hooks/login/useWalletConnectLogin.js +1 -1
- package/__commonjs/hooks/login/useWalletConnectV2Login.js +1 -1
- package/__commonjs/hooks/login/useWebWalletLogin.js +1 -1
- package/__commonjs/hooks/transactions/index.js +1 -1
- package/__commonjs/hooks/transactions/useTrackTransactionStatus.js +1 -1
- package/__commonjs/providers/webviewProvider/index.js +1 -1
- package/__commonjs/providers/webviewProvider/requestMethods.js +1 -1
- package/__commonjs/providers/webviewProvider/webviewProvider.js +1 -1
- package/__commonjs/services/index.js +1 -1
- package/__commonjs/services/nativeAuth/helpers/getLatestBlockHash.js +1 -1
- package/__commonjs/services/nativeAuth/helpers/index.js +1 -1
- package/__commonjs/services/nativeAuth/index.js +1 -1
- package/__commonjs/services/nativeAuth/methods/getToken.js +1 -1
- package/__commonjs/services/nativeAuth/methods/index.js +1 -1
- package/__commonjs/services/nativeAuth/nativeAuth.js +1 -1
- package/__commonjs/utils/platform/detectCurrentPlatform.js +1 -1
- package/__commonjs/wrappers/DappProvider/CustomComponents.js +1 -1
- package/__commonjs/wrappers/DappProvider/index.js +1 -1
- package/__commonjs/wrappers/index.js +1 -1
- package/__mocks__/index.js +1 -1
- package/__mocks__/utils/index.js +1 -1
- package/__mocks__/utils/renderWithProvider.js +1 -1
- package/components/LogoutListener/LogoutListener.js +1 -1
- package/components/LogoutListener/helpers/index.js +1 -1
- package/components/LogoutListener/helpers/useLogoutFromMultipleTabs.js +1 -1
- package/components/LogoutListener/helpers/useNativeAuthLogout.js +1 -1
- package/components/LogoutListener/helpers/useNativeAuthLogoutWarning/index.js +1 -1
- package/components/LogoutListener/helpers/useNativeAuthLogoutWarning/useNativeAuthLogoutWarning.js +1 -1
- package/components/LogoutListener/index.js +1 -1
- package/components/ProviderInitializer.js +1 -1
- package/components/TransactionsTracker/TransactionTracker.js +1 -1
- package/components/TransactionsTracker/index.js +1 -1
- package/components/TransactionsTracker/useTransactionsTracker.js +1 -1
- package/hooks/index.js +1 -1
- package/hooks/login/index.js +1 -1
- package/hooks/login/useExtensionLogin.js +1 -1
- package/hooks/login/useLedgerLogin.js +1 -1
- package/hooks/login/useLoginService.js +1 -1
- package/hooks/login/useOperaLogin.js +1 -1
- package/hooks/login/useWalletConnectLogin.js +1 -1
- package/hooks/login/useWalletConnectV2Login.js +1 -1
- package/hooks/login/useWebWalletLogin.js +1 -1
- package/hooks/transactions/index.js +1 -1
- package/hooks/transactions/useTrackTransactionStatus.js +1 -1
- package/package.json +1 -1
- package/providers/webviewProvider/index.js +1 -1
- package/providers/webviewProvider/requestMethods.js +1 -1
- package/providers/webviewProvider/webviewProvider.js +1 -1
- package/services/index.js +1 -1
- package/services/nativeAuth/helpers/getLatestBlockHash.js +1 -1
- package/services/nativeAuth/helpers/index.js +1 -1
- package/services/nativeAuth/index.js +1 -1
- package/services/nativeAuth/methods/getToken.js +1 -1
- package/services/nativeAuth/methods/index.js +1 -1
- package/services/nativeAuth/nativeAuth.js +1 -1
- package/utils/platform/detectCurrentPlatform.js +1 -1
- package/wrappers/DappProvider/CustomComponents.js +1 -1
- package/wrappers/DappProvider/index.js +1 -1
- package/wrappers/index.js +1 -1
- package/__chunks__/chunk-EZZRM4AA.js +0 -2
- package/__chunks__/chunk-J3Q7UDAZ.js +0 -2
- package/__chunks__/chunk-KGWZO4AR.js +0 -2
- package/__chunks__/chunk-W5ATJOIY.js +0 -2
- package/__chunks__/chunk-WOES4HAT.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var hi=Object.create;var Se=Object.defineProperty,xi=Object.defineProperties,Si=Object.getOwnPropertyDescriptor,wi=Object.getOwnPropertyDescriptors,bi=Object.getOwnPropertyNames,Re=Object.getOwnPropertySymbols,Ai=Object.getPrototypeOf,xt=Object.prototype.hasOwnProperty,Ar=Object.prototype.propertyIsEnumerable;var br=(e,t,r)=>t in e?Se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,x=(e,t)=>{for(var r in t||(t={}))xt.call(t,r)&&br(e,r,t[r]);if(Re)for(var r of Re(t))Ar.call(t,r)&&br(e,r,t[r]);return e},A=(e,t)=>xi(e,wi(t));var Ir=(e,t)=>{var r={};for(var n in e)xt.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Re)for(var n of Re(e))t.indexOf(n)<0&&Ar.call(e,n)&&(r[n]=e[n]);return r};var h=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ce=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),oe=(e,t)=>{for(var r in t)Se(e,r,{get:t[r],enumerable:!0})},vr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of bi(t))!xt.call(e,i)&&i!==r&&Se(e,i,{get:()=>t[i],enumerable:!(n=Si(t,i))||n.enumerable});return e};var w=(e,t,r)=>(r=e!=null?hi(Ai(e)):{},vr(t||!e||!e.__esModule?Se(r,"default",{value:e,enumerable:!0}):r,e)),we=e=>vr(Se({},"__esModule",{value:!0}),e);var I=(e,t,r)=>new Promise((n,i)=>{var l=m=>{try{d(r.next(m))}catch(g){i(g)}},p=m=>{try{d(r.throw(m))}catch(g){i(g)}},d=m=>m.done?n(m.value):Promise.resolve(m.value).then(l,p);d((r=r.apply(e,t)).next())});var Lr=Ce(Pe=>{"use strict";o();Pe.byteLength=vi;Pe.toByteArray=Ei;Pe.fromByteArray=Di;var V=[],F=[],Ii=typeof Uint8Array!="undefined"?Uint8Array:Array,St="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ie=0,kr=St.length;ie<kr;++ie)V[ie]=St[ie],F[St.charCodeAt(ie)]=ie;var ie,kr;F["-".charCodeAt(0)]=62;F["_".charCodeAt(0)]=63;function Er(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function vi(e){var t=Er(e),r=t[0],n=t[1];return(r+n)*3/4-n}function ki(e,t,r){return(t+r)*3/4-r}function Ei(e){var t,r=Er(e),n=r[0],i=r[1],l=new Ii(ki(e,n,i)),p=0,d=i>0?n-4:n,m;for(m=0;m<d;m+=4)t=F[e.charCodeAt(m)]<<18|F[e.charCodeAt(m+1)]<<12|F[e.charCodeAt(m+2)]<<6|F[e.charCodeAt(m+3)],l[p++]=t>>16&255,l[p++]=t>>8&255,l[p++]=t&255;return i===2&&(t=F[e.charCodeAt(m)]<<2|F[e.charCodeAt(m+1)]>>4,l[p++]=t&255),i===1&&(t=F[e.charCodeAt(m)]<<10|F[e.charCodeAt(m+1)]<<4|F[e.charCodeAt(m+2)]>>2,l[p++]=t>>8&255,l[p++]=t&255),l}function Li(e){return V[e>>18&63]+V[e>>12&63]+V[e>>6&63]+V[e&63]}function Ni(e,t,r){for(var n,i=[],l=t;l<r;l+=3)n=(e[l]<<16&16711680)+(e[l+1]<<8&65280)+(e[l+2]&255),i.push(Li(n));return i.join("")}function Di(e){for(var t,r=e.length,n=r%3,i=[],l=16383,p=0,d=r-n;p<d;p+=l)i.push(Ni(e,p,p+l>d?d:p+l));return n===1?(t=e[r-1],i.push(V[t>>2]+V[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(V[t>>10]+V[t>>4&63]+V[t<<2&63]+"=")),i.join("")}});var Nr=Ce(wt=>{o();wt.read=function(e,t,r,n,i){var l,p,d=i*8-n-1,m=(1<<d)-1,g=m>>1,y=-7,f=r?i-1:0,S=r?-1:1,E=e[t+f];for(f+=S,l=E&(1<<-y)-1,E>>=-y,y+=d;y>0;l=l*256+e[t+f],f+=S,y-=8);for(p=l&(1<<-y)-1,l>>=-y,y+=n;y>0;p=p*256+e[t+f],f+=S,y-=8);if(l===0)l=1-g;else{if(l===m)return p?NaN:(E?-1:1)*(1/0);p=p+Math.pow(2,n),l=l-g}return(E?-1:1)*p*Math.pow(2,l-n)};wt.write=function(e,t,r,n,i,l){var p,d,m,g=l*8-i-1,y=(1<<g)-1,f=y>>1,S=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=n?0:l-1,C=n?1:-1,P=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(d=isNaN(t)?1:0,p=y):(p=Math.floor(Math.log(t)/Math.LN2),t*(m=Math.pow(2,-p))<1&&(p--,m*=2),p+f>=1?t+=S/m:t+=S*Math.pow(2,1-f),t*m>=2&&(p++,m/=2),p+f>=y?(d=0,p=y):p+f>=1?(d=(t*m-1)*Math.pow(2,i),p=p+f):(d=t*Math.pow(2,f-1)*Math.pow(2,i),p=0));i>=8;e[r+E]=d&255,E+=C,d/=256,i-=8);for(p=p<<i|d,g+=i;g>0;e[r+E]=p&255,E+=C,p/=256,g-=8);e[r+E-C]|=P*128}});var Gr=Ce(de=>{"use strict";o();var bt=Lr(),ue=Nr(),Dr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;de.Buffer=u;de.SlowBuffer=Oi;de.INSPECT_MAX_BYTES=50;var _e=2147483647;de.kMaxLength=_e;u.TYPED_ARRAY_SUPPORT=Ri();!u.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Ri(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch(r){return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.buffer}});Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.byteOffset}});function j(e){if(e>_e)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return kt(e)}return Pr(e,t,r)}u.poolSize=8192;function Pr(e,t,r){if(typeof e=="string")return Pi(e,t);if(ArrayBuffer.isView(e))return _i(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($(e,ArrayBuffer)||e&&$(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&($(e,SharedArrayBuffer)||e&&$(e.buffer,SharedArrayBuffer)))return It(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return u.from(n,t,r);var i=Mi(e);if(i)return i;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}u.from=function(e,t,r){return Pr(e,t,r)};Object.setPrototypeOf(u.prototype,Uint8Array.prototype);Object.setPrototypeOf(u,Uint8Array);function _r(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function Ci(e,t,r){return _r(e),e<=0?j(e):t!==void 0?typeof r=="string"?j(e).fill(t,r):j(e).fill(t):j(e)}u.alloc=function(e,t,r){return Ci(e,t,r)};function kt(e){return _r(e),j(e<0?0:Et(e)|0)}u.allocUnsafe=function(e){return kt(e)};u.allocUnsafeSlow=function(e){return kt(e)};function Pi(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=Mr(e,t)|0,n=j(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function At(e){for(var t=e.length<0?0:Et(e.length)|0,r=j(t),n=0;n<t;n+=1)r[n]=e[n]&255;return r}function _i(e){if($(e,Uint8Array)){var t=new Uint8Array(e);return It(t.buffer,t.byteOffset,t.byteLength)}return At(e)}function It(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return t===void 0&&r===void 0?n=new Uint8Array(e):r===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function Mi(e){if(u.isBuffer(e)){var t=Et(e.length)|0,r=j(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||Lt(e.length)?j(0):At(e);if(e.type==="Buffer"&&Array.isArray(e.data))return At(e.data)}function Et(e){if(e>=_e)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+_e.toString(16)+" bytes");return e|0}function Oi(e){return+e!=e&&(e=0),u.alloc(+e)}u.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==u.prototype};u.compare=function(t,r){if($(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),$(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),!u.isBuffer(t)||!u.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;for(var n=t.length,i=r.length,l=0,p=Math.min(n,i);l<p;++l)if(t[l]!==r[l]){n=t[l],i=r[l];break}return n<i?-1:i<n?1:0};u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};u.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return u.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<t.length;++n)r+=t[n].length;var i=u.allocUnsafe(r),l=0;for(n=0;n<t.length;++n){var p=t[n];if($(p,Uint8Array))l+p.length>i.length?u.from(p).copy(i,l):Uint8Array.prototype.set.call(i,p,l);else if(u.isBuffer(p))p.copy(i,l);else throw new TypeError('"list" argument must be an Array of Buffers');l+=p.length}return i};function Mr(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return vt(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return $r(e).length;default:if(i)return n?-1:vt(e).length;t=(""+t).toLowerCase(),i=!0}}u.byteLength=Mr;function Fi(e,t,r){var n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return zi(this,t,r);case"utf8":case"utf-8":return Fr(this,t,r);case"ascii":return qi(this,t,r);case"latin1":case"binary":return ji(this,t,r);case"base64":return Hi(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ki(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function ae(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}u.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)ae(this,r,r+1);return this};u.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)ae(this,r,r+3),ae(this,r+1,r+2);return this};u.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)ae(this,r,r+7),ae(this,r+1,r+6),ae(this,r+2,r+5),ae(this,r+3,r+4);return this};u.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?Fr(this,0,t):Fi.apply(this,arguments)};u.prototype.toLocaleString=u.prototype.toString;u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:u.compare(this,t)===0};u.prototype.inspect=function(){var t="",r=de.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};Dr&&(u.prototype[Dr]=u.prototype.inspect);u.prototype.compare=function(t,r,n,i,l){if($(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(r===void 0&&(r=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),l===void 0&&(l=this.length),r<0||n>t.length||i<0||l>this.length)throw new RangeError("out of range index");if(i>=l&&r>=n)return 0;if(i>=l)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,l>>>=0,this===t)return 0;for(var p=l-i,d=n-r,m=Math.min(p,d),g=this.slice(i,l),y=t.slice(r,n),f=0;f<m;++f)if(g[f]!==y[f]){p=g[f],d=y[f];break}return p<d?-1:d<p?1:0};function Or(e,t,r,n,i){if(e.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Lt(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=u.from(t,n)),u.isBuffer(t))return t.length===0?-1:Rr(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Rr(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Rr(e,t,r,n,i){var l=1,p=e.length,d=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;l=2,p/=2,d/=2,r/=2}function m(E,C){return l===1?E[C]:E.readUInt16BE(C*l)}var g;if(i){var y=-1;for(g=r;g<p;g++)if(m(e,g)===m(t,y===-1?0:g-y)){if(y===-1&&(y=g),g-y+1===d)return y*l}else y!==-1&&(g-=g-y),y=-1}else for(r+d>p&&(r=p-d),g=r;g>=0;g--){for(var f=!0,S=0;S<d;S++)if(m(e,g+S)!==m(t,S)){f=!1;break}if(f)return g}return-1}u.prototype.includes=function(t,r,n){return this.indexOf(t,r,n)!==-1};u.prototype.indexOf=function(t,r,n){return Or(this,t,r,n,!0)};u.prototype.lastIndexOf=function(t,r,n){return Or(this,t,r,n,!1)};function Bi(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var l=t.length;n>l/2&&(n=l/2);for(var p=0;p<n;++p){var d=parseInt(t.substr(p*2,2),16);if(Lt(d))return p;e[r+p]=d}return p}function Ui(e,t,r,n){return Me(vt(t,e.length-r),e,r,n)}function Vi(e,t,r,n){return Me(Xi(t),e,r,n)}function $i(e,t,r,n){return Me($r(t),e,r,n)}function Gi(e,t,r,n){return Me(Ji(t,e.length-r),e,r,n)}u.prototype.write=function(t,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var l=this.length-r;if((n===void 0||n>l)&&(n=l),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var p=!1;;)switch(i){case"hex":return Bi(this,t,r,n);case"utf8":case"utf-8":return Ui(this,t,r,n);case"ascii":case"latin1":case"binary":return Vi(this,t,r,n);case"base64":return $i(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Gi(this,t,r,n);default:if(p)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),p=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Hi(e,t,r){return t===0&&r===e.length?bt.fromByteArray(e):bt.fromByteArray(e.slice(t,r))}function Fr(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var l=e[i],p=null,d=l>239?4:l>223?3:l>191?2:1;if(i+d<=r){var m,g,y,f;switch(d){case 1:l<128&&(p=l);break;case 2:m=e[i+1],(m&192)===128&&(f=(l&31)<<6|m&63,f>127&&(p=f));break;case 3:m=e[i+1],g=e[i+2],(m&192)===128&&(g&192)===128&&(f=(l&15)<<12|(m&63)<<6|g&63,f>2047&&(f<55296||f>57343)&&(p=f));break;case 4:m=e[i+1],g=e[i+2],y=e[i+3],(m&192)===128&&(g&192)===128&&(y&192)===128&&(f=(l&15)<<18|(m&63)<<12|(g&63)<<6|y&63,f>65535&&f<1114112&&(p=f))}}p===null?(p=65533,d=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|p&1023),n.push(p),i+=d}return Wi(n)}var Cr=4096;function Wi(e){var t=e.length;if(t<=Cr)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Cr));return r}function qi(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]&127);return n}function ji(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function zi(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",l=t;l<r;++l)i+=Qi[e[l]];return i}function Ki(e,t,r){for(var n=e.slice(t,r),i="",l=0;l<n.length-1;l+=2)i+=String.fromCharCode(n[l]+n[l+1]*256);return i}u.prototype.slice=function(t,r){var n=this.length;t=~~t,r=r===void 0?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<t&&(r=t);var i=this.subarray(t,r);return Object.setPrototypeOf(i,u.prototype),i};function L(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||L(t,r,this.length);for(var i=this[t],l=1,p=0;++p<r&&(l*=256);)i+=this[t+p]*l;return i};u.prototype.readUintBE=u.prototype.readUIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||L(t,r,this.length);for(var i=this[t+--r],l=1;r>0&&(l*=256);)i+=this[t+--r]*l;return i};u.prototype.readUint8=u.prototype.readUInt8=function(t,r){return t=t>>>0,r||L(t,1,this.length),this[t]};u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||L(t,2,this.length),this[t]|this[t+1]<<8};u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||L(t,2,this.length),this[t]<<8|this[t+1]};u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||L(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};u.prototype.readIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||L(t,r,this.length);for(var i=this[t],l=1,p=0;++p<r&&(l*=256);)i+=this[t+p]*l;return l*=128,i>=l&&(i-=Math.pow(2,8*r)),i};u.prototype.readIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||L(t,r,this.length);for(var i=r,l=1,p=this[t+--i];i>0&&(l*=256);)p+=this[t+--i]*l;return l*=128,p>=l&&(p-=Math.pow(2,8*r)),p};u.prototype.readInt8=function(t,r){return t=t>>>0,r||L(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};u.prototype.readInt16LE=function(t,r){t=t>>>0,r||L(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(t,r){t=t>>>0,r||L(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(t,r){return t=t>>>0,r||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};u.prototype.readInt32BE=function(t,r){return t=t>>>0,r||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};u.prototype.readFloatLE=function(t,r){return t=t>>>0,r||L(t,4,this.length),ue.read(this,t,!0,23,4)};u.prototype.readFloatBE=function(t,r){return t=t>>>0,r||L(t,4,this.length),ue.read(this,t,!1,23,4)};u.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||L(t,8,this.length),ue.read(this,t,!0,52,8)};u.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||L(t,8,this.length),ue.read(this,t,!1,52,8)};function D(e,t,r,n,i,l){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<l)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){var l=Math.pow(2,8*n)-1;D(this,t,r,n,l,0)}var p=1,d=0;for(this[r]=t&255;++d<n&&(p*=256);)this[r+d]=t/p&255;return r+n};u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){var l=Math.pow(2,8*n)-1;D(this,t,r,n,l,0)}var p=n-1,d=1;for(this[r+p]=t&255;--p>=0&&(d*=256);)this[r+p]=t/d&255;return r+n};u.prototype.writeUint8=u.prototype.writeUInt8=function(t,r,n){return t=+t,r=r>>>0,n||D(this,t,r,1,255,0),this[r]=t&255,r+1};u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||D(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2};u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||D(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2};u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||D(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4};u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||D(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};u.prototype.writeIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){var l=Math.pow(2,8*n-1);D(this,t,r,n,l-1,-l)}var p=0,d=1,m=0;for(this[r]=t&255;++p<n&&(d*=256);)t<0&&m===0&&this[r+p-1]!==0&&(m=1),this[r+p]=(t/d>>0)-m&255;return r+n};u.prototype.writeIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){var l=Math.pow(2,8*n-1);D(this,t,r,n,l-1,-l)}var p=n-1,d=1,m=0;for(this[r+p]=t&255;--p>=0&&(d*=256);)t<0&&m===0&&this[r+p+1]!==0&&(m=1),this[r+p]=(t/d>>0)-m&255;return r+n};u.prototype.writeInt8=function(t,r,n){return t=+t,r=r>>>0,n||D(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};u.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||D(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};u.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||D(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};u.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||D(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4};u.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||D(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};function Br(e,t,r,n,i,l){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Ur(e,t,r,n,i){return t=+t,r=r>>>0,i||Br(e,t,r,4,34028234663852886e22,-34028234663852886e22),ue.write(e,t,r,n,23,4),r+4}u.prototype.writeFloatLE=function(t,r,n){return Ur(this,t,r,!0,n)};u.prototype.writeFloatBE=function(t,r,n){return Ur(this,t,r,!1,n)};function Vr(e,t,r,n,i){return t=+t,r=r>>>0,i||Br(e,t,r,8,17976931348623157e292,-17976931348623157e292),ue.write(e,t,r,n,52,8),r+8}u.prototype.writeDoubleLE=function(t,r,n){return Vr(this,t,r,!0,n)};u.prototype.writeDoubleBE=function(t,r,n){return Vr(this,t,r,!1,n)};u.prototype.copy=function(t,r,n,i){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r<i-n&&(i=t.length-r+n);var l=i-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(t,this.subarray(n,i),r),l};u.prototype.fill=function(t,r,n,i){if(typeof t=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){var l=t.charCodeAt(0);(i==="utf8"&&l<128||i==="latin1")&&(t=l)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);var p;if(typeof t=="number")for(p=r;p<n;++p)this[p]=t;else{var d=u.isBuffer(t)?t:u.from(t,i),m=d.length;if(m===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(p=0;p<n-r;++p)this[p+r]=d[p%m]}return this};var Yi=/[^+/0-9A-Za-z-_]/g;function Zi(e){if(e=e.split("=")[0],e=e.trim().replace(Yi,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function vt(e,t){t=t||1/0;for(var r,n=e.length,i=null,l=[],p=0;p<n;++p){if(r=e.charCodeAt(p),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&l.push(239,191,189);continue}else if(p+1===n){(t-=3)>-1&&l.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&l.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&l.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;l.push(r)}else if(r<2048){if((t-=2)<0)break;l.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;l.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;l.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return l}function Xi(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function Ji(e,t){for(var r,n,i,l=[],p=0;p<e.length&&!((t-=2)<0);++p)r=e.charCodeAt(p),n=r>>8,i=r%256,l.push(i),l.push(n);return l}function $r(e){return bt.toByteArray(Zi(e))}function Me(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function $(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Lt(e){return e!==e}var Qi=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=r*16,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()});var zr=Ce((Us,jr)=>{o();var k=jr.exports={},G,H;function Nt(){throw new Error("setTimeout has not been defined")}function Dt(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?G=setTimeout:G=Nt}catch(e){G=Nt}try{typeof clearTimeout=="function"?H=clearTimeout:H=Dt}catch(e){H=Dt}})();function Hr(e){if(G===setTimeout)return setTimeout(e,0);if((G===Nt||!G)&&setTimeout)return G=setTimeout,setTimeout(e,0);try{return G(e,0)}catch(t){try{return G.call(null,e,0)}catch(r){return G.call(this,e,0)}}}function ea(e){if(H===clearTimeout)return clearTimeout(e);if((H===Dt||!H)&&clearTimeout)return H=clearTimeout,clearTimeout(e);try{return H(e)}catch(t){try{return H.call(null,e)}catch(r){return H.call(this,e)}}}var z=[],me=!1,se,Oe=-1;function ta(){!me||!se||(me=!1,se.length?z=se.concat(z):Oe=-1,z.length&&Wr())}function Wr(){if(!me){var e=Hr(ta);me=!0;for(var t=z.length;t;){for(se=z,z=[];++Oe<t;)se&&se[Oe].run();Oe=-1,t=z.length}se=null,me=!1,ea(e)}}k.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];z.push(new qr(e,t)),z.length===1&&!me&&Hr(Wr)};function qr(e,t){this.fun=e,this.array=t}qr.prototype.run=function(){this.fun.apply(null,this.array)};k.title="browser";k.browser=!0;k.env={};k.argv=[];k.version="";k.versions={};function K(){}k.on=K;k.addListener=K;k.once=K;k.off=K;k.removeListener=K;k.removeAllListeners=K;k.emit=K;k.prependListener=K;k.prependOnceListener=K;k.listeners=function(e){return[]};k.binding=function(e){throw new Error("process.binding is not supported")};k.cwd=function(){return"/"};k.chdir=function(e){throw new Error("process.chdir is not supported")};k.umask=function(){return 0}});var a,s,Vs,o=h(()=>{a=w(Gr()),s=w(zr()),Vs=function(e){function t(){var n=this||self;return delete e.prototype.__magic__,n}if(typeof globalThis=="object")return globalThis;if(this)return t();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:t});var r=__magic__;return r}(Object)});var Kr=h(()=>{"use strict";o()});var Yr=h(()=>{"use strict";o()});var Zr=h(()=>{"use strict";o()});var Xr=h(()=>{"use strict";o()});var Y=h(()=>{"use strict";o()});var Jr=h(()=>{"use strict";o()});var Qr=h(()=>{"use strict";o()});var R=h(()=>{"use strict";o()});var en=h(()=>{"use strict";o()});var tn=h(()=>{"use strict";o()});var _=h(()=>{"use strict";o();Yr();Zr();Xr();Y();Jr();Qr();R();en();tn()});var Rt,rn,ic,nn,ac,on,sc,cc,lc,an=h(()=>{"use strict";o();_();Rt={devnet:{id:"devnet",chainId:"D",name:"Devnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://xportal.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://devnet-wallet.multiversx.com",apiAddress:"https://devnet-api.multiversx.com",explorerAddress:"http://devnet-explorer.multiversx.com",apiTimeout:"4000"},testnet:{id:"testnet",chainId:"T",name:"Testnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://xportal.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://testnet-wallet.multiversx.com",apiAddress:"https://testnet-api.multiversx.com",explorerAddress:"http://testnet-explorer.multiversx.com",apiTimeout:"4000"},mainnet:{id:"mainnet",chainId:"1",name:"Mainnet",egldLabel:"EGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://xportal.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://wallet.multiversx.com",apiAddress:"https://api.multiversx.com",explorerAddress:"https://explorer.multiversx.com",apiTimeout:"4000"}},{chainId:rn,egldLabel:ic}=Rt["devnet"],{chainId:nn,egldLabel:ac}=Rt["testnet"],{chainId:on,egldLabel:sc}=Rt["mainnet"],cc={["devnet"]:rn,["testnet"]:nn,["mainnet"]:on},lc={[rn]:"devnet",[nn]:"testnet",[on]:"mainnet"}});var Ct=h(()=>{"use strict";o()});var sn=h(()=>{"use strict";o()});var cn,Pt=h(()=>{"use strict";o();cn="transaction-status-toast-id"});var W,ln=h(()=>{"use strict";o();W=require("@multiversx/sdk-web-wallet-provider")});var pn,Fe,J,ge,un,_t,Be,dn,Q,v=h(()=>{"use strict";o();Kr();an();Ct();sn();Pt();ln();pn=.01,Fe=1500,J=5e4,ge=1e9,un=1,_t=4294967295,Be="logout",dn="login",Q="0"});var fe,Ue=h(()=>{"use strict";o();fe=()=>Date.now()/1e3});var mn=h(()=>{"use strict";o()});var gn=h(()=>{"use strict";o()});var fn=h(()=>{"use strict";o();Ue();mn();gn()});var Ot={};oe(Ot,{getItem:()=>na,localStorageKeys:()=>ce,removeItem:()=>oa,setItem:()=>ra});var ce,Mt,ra,na,oa,be=h(()=>{"use strict";o();fn();ce={loginExpiresAt:"sdk-dapp-login-expires-at",logoutEvent:"sdk-dapp-logout-event"},Mt=typeof localStorage!="undefined",ra=({key:e,data:t,expires:r})=>{!Mt||localStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},na=e=>{if(!Mt)return;let t=localStorage.getItem(String(e));if(!t)return null;let r=JSON.parse(t);return!r||!r.hasOwnProperty("expires")||!r.hasOwnProperty("data")?null:fe()>=r.expires?(localStorage.removeItem(String(e)),null):r.data},oa=e=>{!Mt||localStorage.removeItem(String(e))}});var Ft={};oe(Ft,{clear:()=>xn,getItem:()=>yn,removeItem:()=>hn,setItem:()=>Tn,storage:()=>ia});var Tn,yn,hn,xn,ia,Sn=h(()=>{"use strict";o();Tn=({key:e,data:t,expires:r})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},yn=e=>{let t=sessionStorage.getItem(String(e));if(!t)return null;let r=JSON.parse(t);return!r||!r.hasOwnProperty("expires")||!r.hasOwnProperty("data")?null:Date.now()>=r.expires?(sessionStorage.removeItem(String(e)),null):r.data},hn=e=>sessionStorage.removeItem(String(e)),xn=()=>sessionStorage.clear(),ia={setItem:Tn,getItem:yn,removeItem:hn,clear:xn}});var Te,Ve=h(()=>{"use strict";o();be();Sn();Te={session:Ft,local:Ot}});var Bt,N,$e,Z=h(()=>{"use strict";o();Bt=require("@reduxjs/toolkit");v();N=(0,Bt.createAction)(Be),$e=(0,Bt.createAction)(dn,e=>({payload:e}))});var Vt,wn,bn,Ge,Ut,An,In,Uc,vn,Vc,$c,Gc,Hc,Wc,qc,jc,He,We=h(()=>{"use strict";o();Vt=require("@multiversx/sdk-core"),wn=require("@reduxjs/toolkit"),bn=require("redux-persist");v();Ve();be();Z();Ge={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:Q},Ut={address:"",websocketEvent:null,accounts:{"":Ge},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},An=(0,wn.createSlice)({name:"accountInfoSlice",initialState:Ut,reducers:{setAddress:(e,t)=>{let r=t.payload;e.address=r,e.publicKey=new Vt.Address(r).hex()},setAccount:(e,t)=>{let r=e.address===t.payload.address;e.accounts={[e.address]:r?t.payload:Ge},e.shard=t.payload.shard,e.isAccountLoading=!1,e.accountLoadingError=null},setAccountNonce:(e,t)=>{let{address:r}=e;e.accounts[r].nonce=t.payload},setAccountShard:(e,t)=>{e.shard=t.payload},setLedgerAccount:(e,t)=>{e.ledgerAccount=t.payload},updateLedgerAccount:(e,t)=>{e.ledgerAccount!=null&&(e.ledgerAccount.index=t.payload.index,e.ledgerAccount.address=t.payload.address)},setWalletConnectAccount:(e,t)=>{e.walletConnectAccount=t.payload},setIsAccountLoading:(e,t)=>{e.isAccountLoading=t.payload,e.accountLoadingError=null},setAccountLoadingError:(e,t)=>{e.accountLoadingError=t.payload,e.isAccountLoading=!1},setWebsocketEvent:(e,t)=>{e.websocketEvent={timestamp:Date.now(),message:t.payload}}},extraReducers:e=>{e.addCase(N,()=>(Te.local.removeItem(ce.loginExpiresAt),Ut)),e.addCase($e,(t,r)=>{let{address:n}=r.payload;t.address=n,t.publicKey=new Vt.Address(n).hex()}),e.addCase(bn.REHYDRATE,(t,r)=>{var g;if(!((g=r.payload)!=null&&g.account))return;let{account:n}=r.payload,{address:i,shard:l,accounts:p,publicKey:d}=n;t.address=i,t.shard=l;let m=p&&i in p;t.accounts=m?p:Ut.accounts,t.publicKey=d})}}),{setAccount:In,setAddress:Uc,setAccountNonce:vn,setAccountShard:Vc,setLedgerAccount:$c,updateLedgerAccount:Gc,setWalletConnectAccount:Hc,setIsAccountLoading:Wc,setAccountLoadingError:qc,setWebsocketEvent:jc}=An.actions,He=An.reducer});function Ae(){return new Date().setHours(new Date().getHours()+24)}function Ie(e){Te.local.setItem({key:ce.loginExpiresAt,data:e,expires:e})}var $t=h(()=>{"use strict";o();Ve();be()});var En,kn,Ln,rl,nl,ol,il,al,sl,Nn,cl,qe,je=h(()=>{"use strict";o();En=require("@reduxjs/toolkit");$t();Y();Z();kn={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,operaLogin:null,isLoginSessionInvalid:!1},Ln=(0,En.createSlice)({name:"loginInfoSlice",initialState:kn,reducers:{setLoginMethod:(e,t)=>{e.loginMethod=t.payload},setTokenLogin:(e,t)=>{e.tokenLogin=t.payload},setTokenLoginSignature:(e,t)=>{(e==null?void 0:e.tokenLogin)!=null&&(e.tokenLogin.signature=t.payload)},setWalletLogin:(e,t)=>{e.walletLogin=t.payload},setWalletConnectLogin:(e,t)=>{e.walletConnectLogin=t.payload},setLedgerLogin:(e,t)=>{e.ledgerLogin=t.payload},invalidateLoginSession:e=>{e.isLoginSessionInvalid=!0},setLogoutRoute:(e,t)=>{e.logoutRoute=t.payload}},extraReducers:e=>{e.addCase(N,()=>kn),e.addCase($e,(t,r)=>{t.loginMethod=r.payload.loginMethod,Ie(Ae())})}}),{setLoginMethod:rl,setWalletConnectLogin:nl,setLedgerLogin:ol,setTokenLogin:il,setTokenLoginSignature:al,setWalletLogin:sl,invalidateLoginSession:Nn,setLogoutRoute:cl}=Ln.actions,qe=Ln.reducer});var Rn,Dn,Cn,dl,Gt,ml,gl,ze,Ke=h(()=>{"use strict";o();Rn=require("@reduxjs/toolkit");Z();Dn={},Cn=(0,Rn.createSlice)({name:"modalsSlice",initialState:Dn,reducers:{setTxSubmittedModal:(e,t)=>{e.txSubmittedModal=t.payload},setNotificationModal:(e,t)=>{e.notificationModal=t.payload},clearTxSubmittedModal:e=>{e.txSubmittedModal=void 0},clearNotificationModal:e=>{e.notificationModal=void 0}},extraReducers:e=>{e.addCase(N,()=>Dn)}}),{setTxSubmittedModal:dl,setNotificationModal:Gt,clearTxSubmittedModal:ml,clearNotificationModal:gl}=Cn.actions,ze=Cn.reducer});var Pn=h(()=>{"use strict";o()});var _n=h(()=>{"use strict";o();Pn()});function Ht(e){return e[Math.floor(Math.random()*e.length)]}var Mn=h(()=>{"use strict";o()});var On=h(()=>{"use strict";o();Ct()});var Fn=h(()=>{"use strict";o();_n();Mn();On()});var Bn,Un,Wt,sa,Vn,Dl,Rl,Ye,Ze=h(()=>{"use strict";o();Bn=require("@reduxjs/toolkit"),Un=w(require("lodash.omit"));Fn();Wt={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletConnectV2Options:{},walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},sa={network:Wt,chainID:"-1"},Vn=(0,Bn.createSlice)({name:"appConfig",initialState:sa,reducers:{initializeNetworkConfig:(e,t)=>{let r=Ht(t.payload.walletConnectBridgeAddresses),n=Ht(t.payload.walletConnectV2RelayAddresses),i=(0,Un.default)(t.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=A(x(x({},e.network),i),{walletConnectBridgeAddress:r,walletConnectV2RelayAddress:n})},setChainID:(e,t)=>{e.chainID=t.payload}}}),{initializeNetworkConfig:Dl,setChainID:Rl}=Vn.actions,Ye=Vn.reducer});var $n,qt,Gn,Fl,Bl,Ul,Xe,Je=h(()=>{"use strict";o();$n=require("@reduxjs/toolkit");_();Z();qt={isSigning:!1,signedSessions:{}},Gn=(0,$n.createSlice)({name:"signedMessageInfoSliceState",initialState:qt,reducers:{setSignSession:(e,t)=>{let{sessionId:r,signedSession:n,errorMessage:i}=t.payload;return A(x({},e),{errorMessage:i!=null?i:e.errorMessage,isSigning:n.status==="pending",signedSessions:A(x({},e.signedSessions),{[r]:n})})},setSignSessionState:(e,t)=>x(x({},e),t.payload),clearSignedMessageInfo:()=>qt},extraReducers:e=>{e.addCase(N,()=>qt)}}),{setSignSession:Fl,clearSignedMessageInfo:Bl,setSignSessionState:Ul}=Gn.actions,Xe=Gn.reducer});var Wn,qn,Hn,jn,zl,Kl,Yl,Zl,Xl,Jl,Qe,et=h(()=>{"use strict";o();Wn=require("@reduxjs/toolkit"),qn=require("redux-persist");Pt();_();Ue();Z();Hn={customToasts:[],transactionToasts:[],failTransactionToast:null},jn=(0,Wn.createSlice)({name:"toastsSlice",initialState:Hn,reducers:{addCustomToast:(e,t)=>{e.customToasts.push(A(x({},t.payload),{type:"custom",toastId:t.payload.toastId||`custom-toast-${e.customToasts.length+1}`}))},removeCustomToast:(e,t)=>{e.customToasts=e.customToasts.filter(r=>r.toastId!==t.payload)},addTransactionToast:(e,t)=>{e.transactionToasts.push({type:"transaction",startTimestamp:fe(),toastId:t.payload||`custom-toast-${e.transactionToasts.length+1}`})},removeTransactionToast:(e,t)=>{e.transactionToasts=e.transactionToasts.filter(r=>r.toastId!==t.payload)},addFailTransactionToast:(e,t)=>{e.failTransactionToast=A(x({},t.payload),{toastId:cn})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(N,()=>Hn),e.addCase(qn.REHYDRATE,(t,r)=>{var i,l;let n=(l=(i=r.customToasts)==null?void 0:i.filter(p=>!("component"in p)))!=null?l:[];t.customToasts=n})}}),{addCustomToast:zl,removeCustomToast:Kl,addTransactionToast:Yl,removeTransactionToast:Zl,addFailTransactionToast:Xl,removeFailTransactionToast:Jl}=jn.actions,Qe=jn.reducer});var zn,zt,Kt,Yt,ca,jt,Kn,rp,Yn,np,tt,rt=h(()=>{"use strict";o();zn=require("@reduxjs/toolkit");Z();zt="Transaction failed",Kt="Transaction successful",Yt="Processing transaction",ca="Transaction submitted",jt={},Kn=(0,zn.createSlice)({name:"transactionsInfo",initialState:jt,reducers:{setTransactionsDisplayInfo(e,t){let{sessionId:r,transactionsDisplayInfo:n}=t.payload;r!=null&&(e[r]={errorMessage:(n==null?void 0:n.errorMessage)||zt,successMessage:(n==null?void 0:n.successMessage)||Kt,processingMessage:(n==null?void 0:n.processingMessage)||Yt,submittedMessage:(n==null?void 0:n.submittedMessage)||ca,transactionDuration:n==null?void 0:n.transactionDuration})},clearTransactionsInfoForSessionId(e,t){t.payload!=null&&delete e[t.payload]},clearTransactionsInfo:()=>jt},extraReducers:e=>{e.addCase(N,()=>jt)}}),{clearTransactionsInfo:rp,setTransactionsDisplayInfo:Yn,clearTransactionsInfoForSessionId:np}=Kn.actions,tt=Kn.reducer});function Zn(e){return e!=null&&(ya(e)||wa(e))}function nt(e){return e!=null&&(ha(e)||ba(e))}function ot(e){return e!=null&&(xa(e)||Aa(e))}function Xn(e){return e!=null&&Sa(e)}function ya(e){return e!=null&&pa.includes(e)}function ha(e){return e!=null&&ua.includes(e)}function xa(e){return e!=null&&da.includes(e)}function Sa(e){return e!=null&&ma.includes(e)}function wa(e){return e!=null&&ga.includes(e)}function ba(e){return e!=null&&fa.includes(e)}function Aa(e){return e!=null&&Ta.includes(e)}var pa,ua,da,ma,ga,fa,Ta,Xt=h(()=>{"use strict";o();Y();pa=["sent"],ua=["success"],da=["fail","cancelled","timedOut"],ma=["timedOut"],ga=["pending"],fa=["success"],Ta=["fail","invalid"]});var Jn,Qn,ve,Ia,eo,dp,mp,to,ro,no,Jt,gp,fp,oo,Tp,it,at=h(()=>{"use strict";o();Jn=require("@reduxjs/toolkit"),Qn=require("redux-persist");Y();Xt();Z();ve={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},Ia={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},eo=(0,Jn.createSlice)({name:"transactionsSlice",initialState:ve,reducers:{moveTransactionsToSignedState:(e,t)=>{var m,g;let{sessionId:r,transactions:n,errorMessage:i,status:l,redirectRoute:p}=t.payload,d=((m=e.customTransactionInformationForSessionId)==null?void 0:m[r])||Ia;e.signedTransactions[r]={transactions:n,status:l,errorMessage:i,redirectRoute:p,customTransactionInformation:d},((g=e==null?void 0:e.transactionsToSign)==null?void 0:g.sessionId)===r&&(e.transactionsToSign=ve.transactionsToSign)},clearSignedTransaction:(e,t)=>{e.signedTransactions[t.payload]&&delete e.signedTransactions[t.payload]},clearTransactionToSign:e=>{e!=null&&e.transactionsToSign&&(e.transactionsToSign=null)},updateSignedTransaction:(e,t)=>{e.signedTransactions=x(x({},e.signedTransactions),t.payload)},updateSignedTransactions:(e,t)=>{let{sessionId:r,status:n,errorMessage:i,transactions:l}=t.payload;e.signedTransactions[r]!=null&&(e.signedTransactions[r].status=n,i!=null&&(e.signedTransactions[r].errorMessage=i),l!=null&&(e.signedTransactions[r].transactions=l))},updateSignedTransactionStatus:(e,t)=>{var d,m,g,y,f,S;let{sessionId:r,status:n,errorMessage:i,transactionHash:l}=t.payload,p=(m=(d=e.signedTransactions)==null?void 0:d[r])==null?void 0:m.transactions;if(p!=null){e.signedTransactions[r].transactions=p.map(P=>P.hash===l?A(x({},P),{status:n,errorMessage:i}):P);let E=(y=(g=e.signedTransactions[r])==null?void 0:g.transactions)==null?void 0:y.every(P=>nt(P.status)),C=(S=(f=e.signedTransactions[r])==null?void 0:f.transactions)==null?void 0:S.every(P=>ot(P.status));E&&(e.signedTransactions[r].status="success"),C&&(e.signedTransactions[r].status="fail")}},setTransactionsToSign:(e,t)=>{e.transactionsToSign=t.payload;let{sessionId:r,customTransactionInformation:n}=t.payload;e.customTransactionInformationForSessionId[r]=n,e.signTransactionsError=null},clearAllTransactionsToSign:e=>{e.transactionsToSign=ve.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=ve.signedTransactions},setSignTransactionsError:(e,t)=>{e.signTransactionsError=t.payload},setSignTransactionsCancelMessage:(e,t)=>{e.signTransactionsCancelMessage=t.payload}},extraReducers:e=>{e.addCase(N,()=>ve),e.addCase(Qn.REHYDRATE,(t,r)=>{var p;if(t.signTransactionsCancelMessage=null,!((p=r.payload)!=null&&p.transactions))return;let{signedTransactions:n,customTransactionInformationForSessionId:i}=r.payload.transactions,l=Object.entries(n).reduce((d,[m,g])=>{let y=new Date(m),f=new Date;return f.setHours(f.getHours()+5),f-y>0||(d[m]=g),d},{});i!=null&&(t.customTransactionInformationForSessionId=i),n!=null&&(t.signedTransactions=l)})}}),{updateSignedTransactionStatus:dp,updateSignedTransactions:mp,setTransactionsToSign:to,clearAllTransactionsToSign:ro,clearAllSignedTransactions:no,clearSignedTransaction:Jt,clearTransactionToSign:gp,setSignTransactionsError:fp,setSignTransactionsCancelMessage:oo,moveTransactionsToSignedState:Tp}=eo.actions,it=eo.reducer});var ee=h(()=>{"use strict";o();We();je();Ke();Ze();Je();et();rt();at()});var Qt=h(()=>{"use strict";o()});var lo,co,po,Vp,$p,Gp,Hp,Wp,qp,uo,mo=h(()=>{"use strict";o();lo=require("@reduxjs/toolkit");Z();co={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},po=(0,lo.createSlice)({name:"dappModalsSlice",initialState:co,reducers:{setDappModalVisibility:(e,t)=>{e.visible=t.payload},setDappModalHeaderVisibility:(e,t)=>{e.modal.showHeader=t.payload},setDappModalFooterVisibility:(e,t)=>{e.modal.showFooter=t.payload},setDappModalHeaderText:(e,t)=>{e.modal.headerText=t.payload},setDappModalFooterText:(e,t)=>{e.modal.footerText=t.payload},setDappModalConfig:(e,t)=>{e.modal=x({},t.payload)}},extraReducers:e=>{e.addCase(N,()=>co)}}),{setDappModalVisibility:Vp,setDappModalHeaderVisibility:$p,setDappModalFooterVisibility:Gp,setDappModalHeaderText:Hp,setDappModalFooterText:Wp,setDappModalConfig:qp}=po.actions,uo=po.reducer});var go,La,Na,le,ut=h(()=>{"use strict";o();go=require("@reduxjs/toolkit");Qt();We();mo();je();Ke();Ze();Je();et();rt();at();La={["account"]:He,["dappModal"]:uo,["loginInfo"]:qe,["modals"]:ze,["networkConfig"]:Ye,["signedMessageInfo"]:Xe,["toasts"]:Qe,["transactionsInfo"]:tt,["transactions"]:it},Na=(e={})=>(0,go.combineReducers)(x(x({},La),e)),le=Na});var ho={};oe(ho,{default:()=>Wa,sessionStorageReducers:()=>er});function te(e,t=[]){return{key:e,version:1,storage:To.default,blacklist:t}}var M,fo,To,Da,ke,Ra,Ca,Pa,_a,Ma,Oa,Fa,Ba,Ua,yo,Va,er,$a,Ga,Ha,Wa,xo=h(()=>{"use strict";o();M=require("redux-persist"),fo=w(require("redux-persist/lib/storage")),To=w(require("redux-persist/lib/storage/session"));ut();ee();We();je();Ke();Ze();Je();et();rt();at();Qt();Da={persistReducersStorageType:"localStorage"},ke={["account"]:"sdk-dapp-account",["loginInfo"]:"sdk-dapp-login-info",["modals"]:"sdk-dapp-modals",["networkConfig"]:"sdk-dapp-network-config"},Ra=te(ke["account"]),Ca=te(ke["loginInfo"]),Pa=te(ke["modals"]),_a=te(ke["networkConfig"]),Ma={2:e=>A(x({},e),{networkConfig:Wt})};Oa=te("sdk-dapp-transactionsInfo"),Fa=te("sdk-dapp-transactions",["transactionsToSign"]),Ba=te("sdk-dapp-toasts"),Ua=te("sdk-dapp-signedMessageInfo"),yo={key:"sdk-dapp-store",version:2,storage:fo.default,whitelist:Object.keys(ke),migrate:(0,M.createMigrate)(Ma,{debug:!1})},Va=A(x({},yo),{whitelist:[]}),er={["toasts"]:(0,M.persistReducer)(Ba,Qe),["transactions"]:(0,M.persistReducer)(Fa,it),["transactionsInfo"]:(0,M.persistReducer)(Oa,tt),["signedMessageInfo"]:(0,M.persistReducer)(Ua,Xe)},$a=A(x({},er),{["account"]:(0,M.persistReducer)(Ra,He),["loginInfo"]:(0,M.persistReducer)(Ca,qe),["modals"]:(0,M.persistReducer)(Pa,ze),["networkConfig"]:(0,M.persistReducer)(_a,Ye)}),Ga=Da.persistReducersStorageType==="localStorage",Ha=Ga?(0,M.persistReducer)(yo,le(er)):(0,M.persistReducer)(Va,le($a)),Wa=Ha});var So={};oe(So,{default:()=>qa});var qa,wo=h(()=>{"use strict";o();ut();qa=le()});var bo={};oe(bo,{default:()=>za});var B,ja,za,Ao=h(()=>{"use strict";o();B=require("redux-persist"),ja=[B.FLUSH,B.REHYDRATE,B.PAUSE,B.PERSIST,B.PURGE,B.REGISTER],za=ja});var ko={};oe(ko,{default:()=>vo});function vo(e){return(0,Io.persistStore)(e)}var Io,Eo=h(()=>{"use strict";o();Io=require("redux-persist")});var _s={};oe(_s,{calcTotalFee:()=>ar,isCrossShardTransaction:()=>zo,nativeAuth:()=>Ps,removeAllSignedTransactions:()=>Za,removeAllTransactionsToSign:()=>Xa,removeSignedTransaction:()=>Ya,removeTransactionsToSign:()=>Ka,sendTransactions:()=>Ls,signTransactions:()=>sr});module.exports=we(_s);o();o();o();ee();o();var tr=require("@reduxjs/toolkit"),Ro=require("react-redux/lib/utils/Subscription");ee();o();var ao=w(require("lodash.throttle"));v();o();var io=w(require("lodash.isequal")),st=require("reselect");_();var T=(0,st.createSelectorCreator)(st.defaultMemoize,io.default),ct=(e,t)=>e!=""&&Boolean(t);ee();$t();Ve();be();var va=[Be],lt=!1,ka=(0,ao.default)(()=>{Ie(Ae())},5e3),so=e=>t=>r=>{var m;if(va.includes(r.type))return t(r);let n=e.getState(),i=Te.local.getItem(ce.loginExpiresAt);if(!ct((m=n==null?void 0:n.loginInfo)==null?void 0:m.loginMethod,n==null?void 0:n.account.address))return t(r);if(i==null)return Ie(Ae());let p=Date.now();return i-p<0&&!lt?setTimeout(()=>{lt=!0,e.dispatch(Nn())},1e3):(lt&&(lt=!1),ka()),t(r)};o();o();function pt(){return typeof sessionStorage!="undefined"}var Lo=pt()?(xo(),we(ho)).default:(wo(),we(So)).default,No=pt()?(Ao(),we(bo)).default:[],Do=pt()?(Eo(),we(ko)).default:e=>e;ut();var b=(0,tr.configureStore)({reducer:Lo,middleware:e=>e({serializableCheck:{ignoredActions:[...No,vn.type,In.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(so)}),bu=(0,Ro.createSubscription)(b),Au=Do(b),Iu=(0,tr.configureStore)({reducer:le});function Ka(e){b.dispatch(Jt(e))}function Ya(e){b.dispatch(Jt(e))}function Za(){b.dispatch(no())}function Xa(){b.dispatch(ro())}o();o();var $o=w(require("bignumber.js"));v();o();ee();var X=e=>e.account,Ee=T(X,e=>e.address),rr=T(X,Ee,(e,t)=>t in e.accounts?e.accounts[t]:Ge),Ru=T(X,rr,(e,t)=>{let i=e,{accounts:r}=i,n=Ir(i,["accounts"]);return A(x({},n),{account:t})}),Co=T(rr,e=>e.balance),Po=T(rr,e=>{var t;return((t=e==null?void 0:e.nonce)==null?void 0:t.valueOf())||0}),Cu=T(X,e=>e.shard),Pu=T(X,e=>e.ledgerAccount),_u=T(X,e=>e.walletConnectAccount),Mu=T(X,e=>e.isAccountLoading),Ou=T(X,e=>e.accountLoadingError),Fu=T(X,e=>e.websocketEvent);o();var pe=e=>e.networkConfig,dt=T(pe,e=>e.chainID),Vu=T(pe,e=>e.network.walletConnectBridgeAddress),$u=T(pe,e=>e.network.walletConnectV2RelayAddress),Gu=T(pe,e=>e.network.walletConnectV2ProjectId),Hu=T(pe,e=>e.network.walletConnectV2Options),Wu=T(pe,e=>e.network.walletConnectDeepLink),nr=T(pe,e=>e.network),_o=T(nr,e=>e.apiAddress),Mo=T(nr,e=>e.explorerAddress),qu=T(nr,e=>e.egldLabel);ee();_();o();var Oo=w(require("bignumber.js"));v();var mt=e=>{if(isNaN(e)||e==null||String(e).includes("Infinity"))return!1;let[t,r]=e.split(".");if(r)for(;r.charAt(r.length-1)===Q;)r=r.slice(0,-1);let n=r?[t,r].join("."):t,i=new Oo.default(n);return i.toString(10)===n&&i.comparedTo(0)>=0};o();var ir=w(require("bignumber.js"));v();o();var U=require("@multiversx/sdk-core"),Uo=require("@multiversx/sdk-network-providers");v();o();o();var Fo=w(require("bignumber.js")),or=(e,t=!0)=>{let r=String(e);if(!r.match(/^[-]?\d+$/))return!1;let n=new Fo.default(r),i=t?0:-1;return n.toString(10)===r&&n.comparedTo(0)>=i};o();v();o();var Bo={from:"erd12dnfhej64s6c56ka369gkyj3hwv5ms0y5rxgsk2k7hkd2vuk7rvqxkalsa",to:"erd12dnfhej64s6c56ka369gkyj3hwv5ms0y5rxgsk2k7hkd2vuk7rvqxkalsa"};function Vo({minGasLimit:e=String(J),gasLimit:t,gasPrice:r,data:n,gasPerDataByte:i,gasPriceModifier:l,defaultGasPrice:p=String(ge),chainId:d}){let m=n||"",g=or(t)?t:e,y=mt(r)?r:p,f=new U.Transaction({nonce:0,value:U.TokenPayment.egldFromAmount("0"),receiver:new U.Address(Bo.to),sender:new U.Address(Bo.to),gasPrice:parseInt(y),gasLimit:parseInt(g),data:new U.TransactionPayload(m.trim()),chainID:d,version:new U.TransactionVersion(1)}),S=new Uo.NetworkConfig;S.MinGasLimit=parseInt(e),S.GasPerDataByte=parseInt(i),S.GasPriceModifier=parseFloat(l);try{return f.computeFee(S).toString(10)}catch(E){return Q}}function ar(e,t){let r=new ir.default(0);return e.forEach(n=>{let i=Vo({gasPerDataByte:String(Fe),gasPriceModifier:String(pn),minGasLimit:String(t),gasLimit:n.getGasLimit().valueOf().toString(),gasPrice:n.getGasPrice().valueOf().toString(),data:n.getData().toString(),chainId:n.getChainID().valueOf()});r=r.plus(new ir.default(i))}),r}function sr(l){return I(this,arguments,function*({transactions:e,callbackRoute:t,minGasLimit:r=J,customTransactionInformation:n,transactionsDisplayInfo:i}){let p=b.getState(),d=Date.now().toString(),m=Co(p),g=dt(p),y=Array.isArray(e)?e:[e],f=ar(y,r);if(!new $o.default(mt(m)?m:"0").minus(f).isGreaterThan(0)){let q={type:"warning",iconClassName:"text-warning",title:"Insufficient EGLD funds",description:"Current EGLD balance cannot cover the transaction fees."};return b.dispatch(Gt(q)),{error:"insufficient funds",sessionId:null}}if(!(y==null?void 0:y.every(q=>q.getChainID().valueOf()===g.valueOf()))){let q={type:"warning",iconClassName:"text-warning",title:"Network change detected",description:"The application tried to change the transaction network"};return b.dispatch(Gt(q)),{error:"Invalid ChainID",sessionId:null}}let P={sessionId:d,callbackRoute:t,customTransactionInformation:n,transactions:y.map(q=>q.toPlainObject())};return b.dispatch(oo(null)),b.dispatch(to(P)),b.dispatch(Yn({sessionId:d,transactionsDisplayInfo:i})),{sessionId:d}})}o();var yr=require("@multiversx/sdk-core"),hr=w(require("bignumber.js"));v();o();var O=require("@multiversx/sdk-core");v();o();function cr(e){try{return a.Buffer.from(e,"base64").toString()===atob(e)}catch(t){return!1}}function ye(e){return atob(e)}function Le(e){var i,l,p;let{data:t}=e,r=cr(t!=null?t:"")?O.TransactionPayload.fromEncoded(t):new O.TransactionPayload(t),n=new O.Transaction(x({value:e.value.valueOf(),data:r,nonce:e.nonce.valueOf(),receiver:new O.Address(e.receiver),sender:new O.Address(e.sender),gasLimit:(i=e.gasLimit.valueOf())!=null?i:J,gasPrice:(l=e.gasPrice.valueOf())!=null?l:ge,chainID:e.chainID.valueOf(),version:new O.TransactionVersion((p=e.version)!=null?p:un)},e.options?{options:new O.TransactionOptions(e.options)}:{}));return n.applySignature({hex:()=>e.signature||""},new O.Address(e.sender)),n}o();o();var ne=e=>e.loginInfo,Ld=T(ne,e=>e.loginMethod),Nd=T(ne,Ee,(e,t)=>ct(e.loginMethod,t)),Dd=T(ne,e=>e.walletConnectLogin),Rd=T(ne,e=>e.ledgerLogin),Cd=T(ne,e=>e.walletLogin),Pd=T(ne,e=>e.isLoginSessionInvalid),_d=T(ne,e=>e.tokenLogin),Md=T(ne,e=>e.logoutRoute);o();var Go=e=>e.modals,Bd=T(Go,e=>e.txSubmittedModal),Ud=T(Go,e=>e.notificationModal);o();var lr=e=>e.signedMessageInfo,Gd=T(lr,e=>e.isSigning),Hd=T(lr,e=>e.errorMessage),Wd=T(lr,e=>{let t=Object.keys(e.signedSessions),r=t.length;return e.signedSessions[t[r-1]]});o();var pr=e=>e.toasts,zd=T(pr,e=>e.customToasts),Kd=T(pr,e=>e.transactionToasts),Yd=T(pr,e=>e.failTransactionToast);o();ee();var Ho={errorMessage:zt,successMessage:Kt,processingMessage:Yt},Ja=e=>e.transactionsInfo,Qd=T(Ja,(e,t)=>t,(e,t)=>t!=null&&(e==null?void 0:e[Number(t)])||Ho);o();o();Xt();o();var es=w(require("bignumber.js"));_();o();o();o();o();var rs=require("@multiversx/sdk-core"),ns=w(require("bignumber.js"));Y();o();var ts=require("@multiversx/sdk-core");o();o();o();var dr=require("@multiversx/sdk-core/out");o();v();var os=e=>{let t=a.Buffer.from([0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);if(e.slice(0,t.length).equals(t))return!0;let n=a.Buffer.alloc(32).fill(0);return e.equals(n)},ur=e=>{try{let r=parseInt("11",2),n=parseInt("01",2),i=a.Buffer.from(e,"hex"),l=i[31];if(os(i))return _t;let p=l&r;return p>3-1&&(p=l&n),p}catch(t){return-1}};function zo({receiverAddress:e,senderShard:t,senderAddress:r}){try{let n=new dr.Address(e),i=ur(n.pubkey());if(t==null&&r!=null){let l=new dr.Address(r);return ur(l)===i}return i===t}catch(n){return!1}}o();var Ko=require("@multiversx/sdk-core");_();o();o();o();o();Y();o();o();o();o();o();o();o();var mr="accounts";var gr="blocks";o();o();o();o();R();o();o();R();o();o();o();var cs=w(require("bignumber.js"));v();o();var ss=require("@multiversx/sdk-core"),fr=w(require("bignumber.js"));v();o();fr.default.config({ROUNDING_MODE:fr.default.ROUND_FLOOR});o();o();o();v();o();o();o();o();v();o();v();o();var ls=require("@multiversx/sdk-core");v();o();o();o();o();v();o();R();var us=["reDelegateRewards","claimRewards","unBond"],ds=["wrapEgld","unwrapEgld"],ms=["unStake"],gs=["unDelegate"];o();o();o();v();o();var ys=w(require("bignumber.js"));o();o();o();o();R();o();var hs=w(require("bignumber.js"));o();o();o();o();R();o();o();o();var Ss=w(require("linkifyjs"));o();v();o();var ws=w(require("bignumber.js"));o();_();o();o();Y();o();Y();o();o();o();R();o();R();o();var bs=w(require("bignumber.js"));v();R();o();R();o();var Qo=require("react");_();o();o();R();o();o();var As=require("@multiversx/sdk-core/out"),Is=w(require("bignumber.js"));R();o();_();o();o();_();var Th=[{label:"Raw",value:"raw"},{label:"Text",value:"text"},{label:"Decimal",value:"decimal"},{label:"Smart",value:"smart"}];o();var ei=require("react");_();o();var ks=require("react");R();var Ah=["create","localMint","ESDTLocalMint","addQuantity","burn","localBurn","ESDTLocalBurn","wipe","writeLog","signalError"];var yt=e=>e.transactions,Ne=T(yt,e=>e.signedTransactions),sx=T(yt,e=>e.signTransactionsError),cx=T(yt,e=>e.signTransactionsCancelMessage),ht=e=>t=>Object.entries(t).reduce((r,[n,i])=>(e(i.status)&&(r[n]=i),r),{}),lx=T(Ne,ht(Zn)),px=T(Ne,ht(nt)),ux=T(Ne,ht(ot)),dx=T(Ne,ht(Xn)),mx=T(yt,e=>{var t;return(e==null?void 0:e.transactionsToSign)==null?null:A(x({},e.transactionsToSign),{transactions:((t=e==null?void 0:e.transactionsToSign)==null?void 0:t.transactions.map(r=>Le(r)))||[]})}),gx=T(Ne,(e,t)=>t,(e,t)=>t!=null?(e==null?void 0:e[t])||{}:{});o();o();var ri=w(require("axios"));o();o();var ti=e=>{let t=e!=null?e:_o(b.getState());return t.endsWith("/")?t.slice(0,-1):t};function ni(e){return I(this,null,function*(){if(!e)return null;let r=`${ti()}/${mr}/${e}`;try{let{data:n}=yield ri.default.get(r);return n}catch(n){console.error("error fetching configuration for ",r)}return null})}function oi(e){return I(this,null,function*(){return yield ni(e)})}o();function ii(e){let t=b.getState(),r=Po(t);return e?r&&!isNaN(r)?Math.max(r,e.nonce):e.nonce:r}function Es(e){let t=new hr.default(J),r=new hr.default(Fe),n=e?r.times(a.Buffer.from(e).length):0;return t.plus(n).toString(10)}function ai(t){return I(this,arguments,function*({transactions:e}){let r=Ee(b.getState()),n=yield oi(r),i=ii(n);return e.map(l=>{let{value:p,receiver:d,data:m="",chainID:g,version:y=1,options:f,gasPrice:S=ge,gasLimit:E=Es(l.data)}=l,C=d;try{C=new yr.Address(d).hex()}catch(yi){throw"Invalid Receiver address"}let P=dt(b.getState()).valueOf().toString(),q=g||P;return Le({value:p,receiver:C,data:m,gasPrice:S,gasLimit:Number(E),nonce:Number(i.valueOf().toString()),sender:new yr.Address(r).hex(),chainID:q,version:y,options:f})})})}function Ls(m){return I(this,arguments,function*({transactions:e,transactionsDisplayInfo:t,redirectAfterSign:r=!0,callbackRoute:n=window.location.pathname,signWithoutSending:i,completedTransactionsDelay:l,sessionInformation:p,minGasLimit:d}){try{let g=Array.isArray(e)?e:[e],y=g.every(S=>Object.getPrototypeOf(S).toPlainObject!=null),f=g;return y||(f=yield ai({transactions:g,minGasLimit:d})),sr({transactions:f,minGasLimit:d,callbackRoute:n,transactionsDisplayInfo:t,customTransactionInformation:{redirectAfterSign:r,completedTransactionsDelay:l,sessionInformation:p,signWithoutSending:i}})}catch(g){return console.error("error signing transaction",g),{error:g,sessionId:null}}})}o();o();o();o();var Ns=e=>e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,""),he=e=>Ns(a.Buffer.from(e,"utf8").toString("base64"));o();var pi=w(require("axios"));o();o();o();function si(e){return I(this,null,function*(){return yield new Promise(t=>{setTimeout(()=>t(),e)})})}o();var ci=(e,t,r,n=0)=>I(void 0,null,function*(){try{return yield e(...r)}catch(i){return n<t.retries?((t==null?void 0:t.delay)!=null&&(yield si(t.delay)),yield ci(e,t,r,n+1)):null}}),li=(e,t={retries:5,delay:500})=>(...r)=>I(void 0,null,function*(){return yield ci(e,t,r)});var ui=3e4,xr=null,xe={current:null},Sr={current:!1},Ds=li((e,t)=>I(void 0,null,function*(){let{data:r}=yield pi.default.get(`${e}/${gr}?from=3&size=1&fields=hash,timestamp${t?"&shard="+t:""}`),[n]=r;return n}));function di(e,t){return I(this,null,function*(){if(e==null)throw new Error("missing api url");if(xr!=null&&Date.now()<xr&&xe.current!=null)return xe.current;{if(Sr.current)return yield Rs();Sr.current=!0,xe.current=null;let n=yield Ds(e,t);return xe.current=n,xr=Date.now()+ui,Sr.current=!1,n}})}function Rs(){return I(this,null,function*(){return new Promise((e,t)=>{let r,n=setInterval(()=>{xe.current!=null&&(clearInterval(n),clearTimeout(r),e(xe.current))},50);r=setTimeout(()=>{clearInterval(n),t("could not generate new token")},ui)})})}o();function Cs(e){return Object.prototype.toString.call(e)==="[object String]"}var mi=e=>{if(!e||!Cs(e))return null;try{let[t,r,n]=e.split("."),i=ye(t),l=ye(r),[p,d,m,g]=l.split("."),y=JSON.parse(ye(g)),f=ye(p),S={ttl:Number(m),address:i,extraInfo:y,host:f,signature:n,blockHash:d,body:l};return g==="e30"&&delete S.extraInfo,S}catch(t){return null}};o();o();Ue();var gi=e=>{let t=mi(e);if(!t)return{isExpired:!1};let r=fe(),{ttl:n,extraInfo:i}=t,l=i.timestamp;if(!l)return{isExpired:!1};let p=l+n,d=r>p,m=p-r;return{isExpired:d,expiresAt:p,secondsUntilExpires:m}};o();var fi,De={hostname:typeof window!="undefined"?(fi=window==null?void 0:window.location)==null?void 0:fi.hostname:"",apiAddress:"https://api.multiversx.com",expirySeconds:60*60*24,tokenExpirationToastWarningSeconds:5*60},wr=e=>{var r,n,i,l,p;return e===!0?De:{hostname:(r=e==null?void 0:e.hostname)!=null?r:De.hostname,blockHashShard:(n=e==null?void 0:e.blockHashShard)!=null?n:null,expirySeconds:(i=e==null?void 0:e.expirySeconds)!=null?i:De.expirySeconds,apiAddress:(l=e==null?void 0:e.apiAddress)!=null?l:De.apiAddress,tokenExpirationToastWarningSeconds:(p=e==null?void 0:e.tokenExpirationToastWarningSeconds)!=null?p:De.tokenExpirationToastWarningSeconds}};o();var Ti=({address:e,token:t,signature:r})=>{let n=he(e),i=he(t);return`${n}.${i}.${r}`};var Ps=e=>{let{hostname:t,apiAddress:r,expirySeconds:n,blockHashShard:i}=wr(e);return{getNativeAuthConfig:wr,initialize:(...m)=>I(void 0,[...m],function*(p={},d){if(!r||!t)return"";let{hash:g,timestamp:y}=d!=null?d:yield di(r,i),f=he(JSON.stringify(x(x({},p),y?{timestamp:y}:{})));return`${he(t)}.${g}.${n}.${f}`}),getToken:Ti,getTokenExpiration:gi}};0&&(module.exports={calcTotalFee,isCrossShardTransaction,nativeAuth,removeAllSignedTransactions,removeAllTransactionsToSign,removeSignedTransaction,removeTransactionsToSign,sendTransactions,signTransactions});
|
|
1
|
+
"use strict";var Ti=Object.create;var Se=Object.defineProperty,yi=Object.defineProperties,hi=Object.getOwnPropertyDescriptor,xi=Object.getOwnPropertyDescriptors,Si=Object.getOwnPropertyNames,Re=Object.getOwnPropertySymbols,wi=Object.getPrototypeOf,St=Object.prototype.hasOwnProperty,br=Object.prototype.propertyIsEnumerable;var wr=(e,t,r)=>t in e?Se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,x=(e,t)=>{for(var r in t||(t={}))St.call(t,r)&&wr(e,r,t[r]);if(Re)for(var r of Re(t))br.call(t,r)&&wr(e,r,t[r]);return e},A=(e,t)=>yi(e,xi(t));var Ar=(e,t)=>{var r={};for(var n in e)St.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Re)for(var n of Re(e))t.indexOf(n)<0&&br.call(e,n)&&(r[n]=e[n]);return r};var h=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ce=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),oe=(e,t)=>{for(var r in t)Se(e,r,{get:t[r],enumerable:!0})},Ir=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Si(t))!St.call(e,i)&&i!==r&&Se(e,i,{get:()=>t[i],enumerable:!(n=hi(t,i))||n.enumerable});return e};var w=(e,t,r)=>(r=e!=null?Ti(wi(e)):{},Ir(t||!e||!e.__esModule?Se(r,"default",{value:e,enumerable:!0}):r,e)),we=e=>Ir(Se({},"__esModule",{value:!0}),e);var k=(e,t,r)=>new Promise((n,i)=>{var l=m=>{try{d(r.next(m))}catch(g){i(g)}},p=m=>{try{d(r.throw(m))}catch(g){i(g)}},d=m=>m.done?n(m.value):Promise.resolve(m.value).then(l,p);d((r=r.apply(e,t)).next())});var Er=Ce(Pe=>{"use strict";o();Pe.byteLength=Ai;Pe.toByteArray=vi;Pe.fromByteArray=Li;var V=[],F=[],bi=typeof Uint8Array!="undefined"?Uint8Array:Array,wt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ie=0,vr=wt.length;ie<vr;++ie)V[ie]=wt[ie],F[wt.charCodeAt(ie)]=ie;var ie,vr;F["-".charCodeAt(0)]=62;F["_".charCodeAt(0)]=63;function kr(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function Ai(e){var t=kr(e),r=t[0],n=t[1];return(r+n)*3/4-n}function Ii(e,t,r){return(t+r)*3/4-r}function vi(e){var t,r=kr(e),n=r[0],i=r[1],l=new bi(Ii(e,n,i)),p=0,d=i>0?n-4:n,m;for(m=0;m<d;m+=4)t=F[e.charCodeAt(m)]<<18|F[e.charCodeAt(m+1)]<<12|F[e.charCodeAt(m+2)]<<6|F[e.charCodeAt(m+3)],l[p++]=t>>16&255,l[p++]=t>>8&255,l[p++]=t&255;return i===2&&(t=F[e.charCodeAt(m)]<<2|F[e.charCodeAt(m+1)]>>4,l[p++]=t&255),i===1&&(t=F[e.charCodeAt(m)]<<10|F[e.charCodeAt(m+1)]<<4|F[e.charCodeAt(m+2)]>>2,l[p++]=t>>8&255,l[p++]=t&255),l}function ki(e){return V[e>>18&63]+V[e>>12&63]+V[e>>6&63]+V[e&63]}function Ei(e,t,r){for(var n,i=[],l=t;l<r;l+=3)n=(e[l]<<16&16711680)+(e[l+1]<<8&65280)+(e[l+2]&255),i.push(ki(n));return i.join("")}function Li(e){for(var t,r=e.length,n=r%3,i=[],l=16383,p=0,d=r-n;p<d;p+=l)i.push(Ei(e,p,p+l>d?d:p+l));return n===1?(t=e[r-1],i.push(V[t>>2]+V[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(V[t>>10]+V[t>>4&63]+V[t<<2&63]+"=")),i.join("")}});var Lr=Ce(bt=>{o();bt.read=function(e,t,r,n,i){var l,p,d=i*8-n-1,m=(1<<d)-1,g=m>>1,y=-7,f=r?i-1:0,S=r?-1:1,v=e[t+f];for(f+=S,l=v&(1<<-y)-1,v>>=-y,y+=d;y>0;l=l*256+e[t+f],f+=S,y-=8);for(p=l&(1<<-y)-1,l>>=-y,y+=n;y>0;p=p*256+e[t+f],f+=S,y-=8);if(l===0)l=1-g;else{if(l===m)return p?NaN:(v?-1:1)*(1/0);p=p+Math.pow(2,n),l=l-g}return(v?-1:1)*p*Math.pow(2,l-n)};bt.write=function(e,t,r,n,i,l){var p,d,m,g=l*8-i-1,y=(1<<g)-1,f=y>>1,S=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,v=n?0:l-1,C=n?1:-1,P=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(d=isNaN(t)?1:0,p=y):(p=Math.floor(Math.log(t)/Math.LN2),t*(m=Math.pow(2,-p))<1&&(p--,m*=2),p+f>=1?t+=S/m:t+=S*Math.pow(2,1-f),t*m>=2&&(p++,m/=2),p+f>=y?(d=0,p=y):p+f>=1?(d=(t*m-1)*Math.pow(2,i),p=p+f):(d=t*Math.pow(2,f-1)*Math.pow(2,i),p=0));i>=8;e[r+v]=d&255,v+=C,d/=256,i-=8);for(p=p<<i|d,g+=i;g>0;e[r+v]=p&255,v+=C,p/=256,g-=8);e[r+v-C]|=P*128}});var $r=Ce(me=>{"use strict";o();var At=Er(),de=Lr(),Nr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;me.Buffer=u;me.SlowBuffer=_i;me.INSPECT_MAX_BYTES=50;var _e=2147483647;me.kMaxLength=_e;u.TYPED_ARRAY_SUPPORT=Ni();!u.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Ni(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch(r){return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.buffer}});Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.byteOffset}});function j(e){if(e>_e)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Et(e)}return Cr(e,t,r)}u.poolSize=8192;function Cr(e,t,r){if(typeof e=="string")return Ri(e,t);if(ArrayBuffer.isView(e))return Ci(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($(e,ArrayBuffer)||e&&$(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&($(e,SharedArrayBuffer)||e&&$(e.buffer,SharedArrayBuffer)))return vt(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return u.from(n,t,r);var i=Pi(e);if(i)return i;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}u.from=function(e,t,r){return Cr(e,t,r)};Object.setPrototypeOf(u.prototype,Uint8Array.prototype);Object.setPrototypeOf(u,Uint8Array);function Pr(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function Di(e,t,r){return Pr(e),e<=0?j(e):t!==void 0?typeof r=="string"?j(e).fill(t,r):j(e).fill(t):j(e)}u.alloc=function(e,t,r){return Di(e,t,r)};function Et(e){return Pr(e),j(e<0?0:Lt(e)|0)}u.allocUnsafe=function(e){return Et(e)};u.allocUnsafeSlow=function(e){return Et(e)};function Ri(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=_r(e,t)|0,n=j(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function It(e){for(var t=e.length<0?0:Lt(e.length)|0,r=j(t),n=0;n<t;n+=1)r[n]=e[n]&255;return r}function Ci(e){if($(e,Uint8Array)){var t=new Uint8Array(e);return vt(t.buffer,t.byteOffset,t.byteLength)}return It(e)}function vt(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return t===void 0&&r===void 0?n=new Uint8Array(e):r===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function Pi(e){if(u.isBuffer(e)){var t=Lt(e.length)|0,r=j(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||Nt(e.length)?j(0):It(e);if(e.type==="Buffer"&&Array.isArray(e.data))return It(e.data)}function Lt(e){if(e>=_e)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+_e.toString(16)+" bytes");return e|0}function _i(e){return+e!=e&&(e=0),u.alloc(+e)}u.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==u.prototype};u.compare=function(t,r){if($(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),$(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),!u.isBuffer(t)||!u.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;for(var n=t.length,i=r.length,l=0,p=Math.min(n,i);l<p;++l)if(t[l]!==r[l]){n=t[l],i=r[l];break}return n<i?-1:i<n?1:0};u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};u.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return u.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<t.length;++n)r+=t[n].length;var i=u.allocUnsafe(r),l=0;for(n=0;n<t.length;++n){var p=t[n];if($(p,Uint8Array))l+p.length>i.length?u.from(p).copy(i,l):Uint8Array.prototype.set.call(i,p,l);else if(u.isBuffer(p))p.copy(i,l);else throw new TypeError('"list" argument must be an Array of Buffers');l+=p.length}return i};function _r(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return kt(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Vr(e).length;default:if(i)return n?-1:kt(e).length;t=(""+t).toLowerCase(),i=!0}}u.byteLength=_r;function Mi(e,t,r){var n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return qi(this,t,r);case"utf8":case"utf-8":return Or(this,t,r);case"ascii":return Hi(this,t,r);case"latin1":case"binary":return Wi(this,t,r);case"base64":return $i(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ji(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function ae(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}u.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)ae(this,r,r+1);return this};u.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)ae(this,r,r+3),ae(this,r+1,r+2);return this};u.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)ae(this,r,r+7),ae(this,r+1,r+6),ae(this,r+2,r+5),ae(this,r+3,r+4);return this};u.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?Or(this,0,t):Mi.apply(this,arguments)};u.prototype.toLocaleString=u.prototype.toString;u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:u.compare(this,t)===0};u.prototype.inspect=function(){var t="",r=me.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};Nr&&(u.prototype[Nr]=u.prototype.inspect);u.prototype.compare=function(t,r,n,i,l){if($(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(r===void 0&&(r=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),l===void 0&&(l=this.length),r<0||n>t.length||i<0||l>this.length)throw new RangeError("out of range index");if(i>=l&&r>=n)return 0;if(i>=l)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,l>>>=0,this===t)return 0;for(var p=l-i,d=n-r,m=Math.min(p,d),g=this.slice(i,l),y=t.slice(r,n),f=0;f<m;++f)if(g[f]!==y[f]){p=g[f],d=y[f];break}return p<d?-1:d<p?1:0};function Mr(e,t,r,n,i){if(e.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Nt(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=u.from(t,n)),u.isBuffer(t))return t.length===0?-1:Dr(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Dr(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Dr(e,t,r,n,i){var l=1,p=e.length,d=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;l=2,p/=2,d/=2,r/=2}function m(v,C){return l===1?v[C]:v.readUInt16BE(C*l)}var g;if(i){var y=-1;for(g=r;g<p;g++)if(m(e,g)===m(t,y===-1?0:g-y)){if(y===-1&&(y=g),g-y+1===d)return y*l}else y!==-1&&(g-=g-y),y=-1}else for(r+d>p&&(r=p-d),g=r;g>=0;g--){for(var f=!0,S=0;S<d;S++)if(m(e,g+S)!==m(t,S)){f=!1;break}if(f)return g}return-1}u.prototype.includes=function(t,r,n){return this.indexOf(t,r,n)!==-1};u.prototype.indexOf=function(t,r,n){return Mr(this,t,r,n,!0)};u.prototype.lastIndexOf=function(t,r,n){return Mr(this,t,r,n,!1)};function Oi(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var l=t.length;n>l/2&&(n=l/2);for(var p=0;p<n;++p){var d=parseInt(t.substr(p*2,2),16);if(Nt(d))return p;e[r+p]=d}return p}function Fi(e,t,r,n){return Me(kt(t,e.length-r),e,r,n)}function Bi(e,t,r,n){return Me(Yi(t),e,r,n)}function Ui(e,t,r,n){return Me(Vr(t),e,r,n)}function Vi(e,t,r,n){return Me(Zi(t,e.length-r),e,r,n)}u.prototype.write=function(t,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var l=this.length-r;if((n===void 0||n>l)&&(n=l),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var p=!1;;)switch(i){case"hex":return Oi(this,t,r,n);case"utf8":case"utf-8":return Fi(this,t,r,n);case"ascii":case"latin1":case"binary":return Bi(this,t,r,n);case"base64":return Ui(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Vi(this,t,r,n);default:if(p)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),p=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function $i(e,t,r){return t===0&&r===e.length?At.fromByteArray(e):At.fromByteArray(e.slice(t,r))}function Or(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var l=e[i],p=null,d=l>239?4:l>223?3:l>191?2:1;if(i+d<=r){var m,g,y,f;switch(d){case 1:l<128&&(p=l);break;case 2:m=e[i+1],(m&192)===128&&(f=(l&31)<<6|m&63,f>127&&(p=f));break;case 3:m=e[i+1],g=e[i+2],(m&192)===128&&(g&192)===128&&(f=(l&15)<<12|(m&63)<<6|g&63,f>2047&&(f<55296||f>57343)&&(p=f));break;case 4:m=e[i+1],g=e[i+2],y=e[i+3],(m&192)===128&&(g&192)===128&&(y&192)===128&&(f=(l&15)<<18|(m&63)<<12|(g&63)<<6|y&63,f>65535&&f<1114112&&(p=f))}}p===null?(p=65533,d=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|p&1023),n.push(p),i+=d}return Gi(n)}var Rr=4096;function Gi(e){var t=e.length;if(t<=Rr)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Rr));return r}function Hi(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]&127);return n}function Wi(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function qi(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",l=t;l<r;++l)i+=Xi[e[l]];return i}function ji(e,t,r){for(var n=e.slice(t,r),i="",l=0;l<n.length-1;l+=2)i+=String.fromCharCode(n[l]+n[l+1]*256);return i}u.prototype.slice=function(t,r){var n=this.length;t=~~t,r=r===void 0?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<t&&(r=t);var i=this.subarray(t,r);return Object.setPrototypeOf(i,u.prototype),i};function L(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||L(t,r,this.length);for(var i=this[t],l=1,p=0;++p<r&&(l*=256);)i+=this[t+p]*l;return i};u.prototype.readUintBE=u.prototype.readUIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||L(t,r,this.length);for(var i=this[t+--r],l=1;r>0&&(l*=256);)i+=this[t+--r]*l;return i};u.prototype.readUint8=u.prototype.readUInt8=function(t,r){return t=t>>>0,r||L(t,1,this.length),this[t]};u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||L(t,2,this.length),this[t]|this[t+1]<<8};u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||L(t,2,this.length),this[t]<<8|this[t+1]};u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||L(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};u.prototype.readIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||L(t,r,this.length);for(var i=this[t],l=1,p=0;++p<r&&(l*=256);)i+=this[t+p]*l;return l*=128,i>=l&&(i-=Math.pow(2,8*r)),i};u.prototype.readIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||L(t,r,this.length);for(var i=r,l=1,p=this[t+--i];i>0&&(l*=256);)p+=this[t+--i]*l;return l*=128,p>=l&&(p-=Math.pow(2,8*r)),p};u.prototype.readInt8=function(t,r){return t=t>>>0,r||L(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};u.prototype.readInt16LE=function(t,r){t=t>>>0,r||L(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(t,r){t=t>>>0,r||L(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(t,r){return t=t>>>0,r||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};u.prototype.readInt32BE=function(t,r){return t=t>>>0,r||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};u.prototype.readFloatLE=function(t,r){return t=t>>>0,r||L(t,4,this.length),de.read(this,t,!0,23,4)};u.prototype.readFloatBE=function(t,r){return t=t>>>0,r||L(t,4,this.length),de.read(this,t,!1,23,4)};u.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||L(t,8,this.length),de.read(this,t,!0,52,8)};u.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||L(t,8,this.length),de.read(this,t,!1,52,8)};function D(e,t,r,n,i,l){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<l)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){var l=Math.pow(2,8*n)-1;D(this,t,r,n,l,0)}var p=1,d=0;for(this[r]=t&255;++d<n&&(p*=256);)this[r+d]=t/p&255;return r+n};u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){var l=Math.pow(2,8*n)-1;D(this,t,r,n,l,0)}var p=n-1,d=1;for(this[r+p]=t&255;--p>=0&&(d*=256);)this[r+p]=t/d&255;return r+n};u.prototype.writeUint8=u.prototype.writeUInt8=function(t,r,n){return t=+t,r=r>>>0,n||D(this,t,r,1,255,0),this[r]=t&255,r+1};u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||D(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2};u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||D(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2};u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||D(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4};u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||D(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};u.prototype.writeIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){var l=Math.pow(2,8*n-1);D(this,t,r,n,l-1,-l)}var p=0,d=1,m=0;for(this[r]=t&255;++p<n&&(d*=256);)t<0&&m===0&&this[r+p-1]!==0&&(m=1),this[r+p]=(t/d>>0)-m&255;return r+n};u.prototype.writeIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){var l=Math.pow(2,8*n-1);D(this,t,r,n,l-1,-l)}var p=n-1,d=1,m=0;for(this[r+p]=t&255;--p>=0&&(d*=256);)t<0&&m===0&&this[r+p+1]!==0&&(m=1),this[r+p]=(t/d>>0)-m&255;return r+n};u.prototype.writeInt8=function(t,r,n){return t=+t,r=r>>>0,n||D(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};u.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||D(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};u.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||D(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};u.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||D(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4};u.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||D(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};function Fr(e,t,r,n,i,l){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Br(e,t,r,n,i){return t=+t,r=r>>>0,i||Fr(e,t,r,4,34028234663852886e22,-34028234663852886e22),de.write(e,t,r,n,23,4),r+4}u.prototype.writeFloatLE=function(t,r,n){return Br(this,t,r,!0,n)};u.prototype.writeFloatBE=function(t,r,n){return Br(this,t,r,!1,n)};function Ur(e,t,r,n,i){return t=+t,r=r>>>0,i||Fr(e,t,r,8,17976931348623157e292,-17976931348623157e292),de.write(e,t,r,n,52,8),r+8}u.prototype.writeDoubleLE=function(t,r,n){return Ur(this,t,r,!0,n)};u.prototype.writeDoubleBE=function(t,r,n){return Ur(this,t,r,!1,n)};u.prototype.copy=function(t,r,n,i){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r<i-n&&(i=t.length-r+n);var l=i-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(t,this.subarray(n,i),r),l};u.prototype.fill=function(t,r,n,i){if(typeof t=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){var l=t.charCodeAt(0);(i==="utf8"&&l<128||i==="latin1")&&(t=l)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);var p;if(typeof t=="number")for(p=r;p<n;++p)this[p]=t;else{var d=u.isBuffer(t)?t:u.from(t,i),m=d.length;if(m===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(p=0;p<n-r;++p)this[p+r]=d[p%m]}return this};var zi=/[^+/0-9A-Za-z-_]/g;function Ki(e){if(e=e.split("=")[0],e=e.trim().replace(zi,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function kt(e,t){t=t||1/0;for(var r,n=e.length,i=null,l=[],p=0;p<n;++p){if(r=e.charCodeAt(p),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&l.push(239,191,189);continue}else if(p+1===n){(t-=3)>-1&&l.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&l.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&l.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;l.push(r)}else if(r<2048){if((t-=2)<0)break;l.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;l.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;l.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return l}function Yi(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function Zi(e,t){for(var r,n,i,l=[],p=0;p<e.length&&!((t-=2)<0);++p)r=e.charCodeAt(p),n=r>>8,i=r%256,l.push(i),l.push(n);return l}function Vr(e){return At.toByteArray(Ki(e))}function Me(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function $(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Nt(e){return e!==e}var Xi=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=r*16,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()});var jr=Ce((Bs,qr)=>{o();var E=qr.exports={},G,H;function Dt(){throw new Error("setTimeout has not been defined")}function Rt(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?G=setTimeout:G=Dt}catch(e){G=Dt}try{typeof clearTimeout=="function"?H=clearTimeout:H=Rt}catch(e){H=Rt}})();function Gr(e){if(G===setTimeout)return setTimeout(e,0);if((G===Dt||!G)&&setTimeout)return G=setTimeout,setTimeout(e,0);try{return G(e,0)}catch(t){try{return G.call(null,e,0)}catch(r){return G.call(this,e,0)}}}function Ji(e){if(H===clearTimeout)return clearTimeout(e);if((H===Rt||!H)&&clearTimeout)return H=clearTimeout,clearTimeout(e);try{return H(e)}catch(t){try{return H.call(null,e)}catch(r){return H.call(this,e)}}}var z=[],ge=!1,se,Oe=-1;function Qi(){!ge||!se||(ge=!1,se.length?z=se.concat(z):Oe=-1,z.length&&Hr())}function Hr(){if(!ge){var e=Gr(Qi);ge=!0;for(var t=z.length;t;){for(se=z,z=[];++Oe<t;)se&&se[Oe].run();Oe=-1,t=z.length}se=null,ge=!1,Ji(e)}}E.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];z.push(new Wr(e,t)),z.length===1&&!ge&&Gr(Hr)};function Wr(e,t){this.fun=e,this.array=t}Wr.prototype.run=function(){this.fun.apply(null,this.array)};E.title="browser";E.browser=!0;E.env={};E.argv=[];E.version="";E.versions={};function K(){}E.on=K;E.addListener=K;E.once=K;E.off=K;E.removeListener=K;E.removeAllListeners=K;E.emit=K;E.prependListener=K;E.prependOnceListener=K;E.listeners=function(e){return[]};E.binding=function(e){throw new Error("process.binding is not supported")};E.cwd=function(){return"/"};E.chdir=function(e){throw new Error("process.chdir is not supported")};E.umask=function(){return 0}});var a,s,Us,o=h(()=>{a=w($r()),s=w(jr()),Us=function(e){function t(){var n=this||self;return delete e.prototype.__magic__,n}if(typeof globalThis=="object")return globalThis;if(this)return t();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:t});var r=__magic__;return r}(Object)});var zr=h(()=>{"use strict";o()});var Kr=h(()=>{"use strict";o()});var Yr=h(()=>{"use strict";o()});var Zr=h(()=>{"use strict";o()});var Y=h(()=>{"use strict";o()});var Xr=h(()=>{"use strict";o()});var Jr=h(()=>{"use strict";o()});var R=h(()=>{"use strict";o()});var Qr=h(()=>{"use strict";o()});var en=h(()=>{"use strict";o()});var _=h(()=>{"use strict";o();Kr();Yr();Zr();Y();Xr();Jr();R();Qr();en()});var Ct,tn,oc,rn,ic,nn,ac,sc,cc,on=h(()=>{"use strict";o();_();Ct={devnet:{id:"devnet",chainId:"D",name:"Devnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://xportal.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://devnet-wallet.multiversx.com",apiAddress:"https://devnet-api.multiversx.com",explorerAddress:"http://devnet-explorer.multiversx.com",apiTimeout:"4000"},testnet:{id:"testnet",chainId:"T",name:"Testnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://xportal.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://testnet-wallet.multiversx.com",apiAddress:"https://testnet-api.multiversx.com",explorerAddress:"http://testnet-explorer.multiversx.com",apiTimeout:"4000"},mainnet:{id:"mainnet",chainId:"1",name:"Mainnet",egldLabel:"EGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://xportal.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://wallet.multiversx.com",apiAddress:"https://api.multiversx.com",explorerAddress:"https://explorer.multiversx.com",apiTimeout:"4000"}},{chainId:tn,egldLabel:oc}=Ct["devnet"],{chainId:rn,egldLabel:ic}=Ct["testnet"],{chainId:nn,egldLabel:ac}=Ct["mainnet"],sc={["devnet"]:tn,["testnet"]:rn,["mainnet"]:nn},cc={[tn]:"devnet",[rn]:"testnet",[nn]:"mainnet"}});var Pt=h(()=>{"use strict";o()});var an=h(()=>{"use strict";o()});var sn,_t=h(()=>{"use strict";o();sn="transaction-status-toast-id"});var W,cn=h(()=>{"use strict";o();W=require("@multiversx/sdk-web-wallet-provider")});var ln,Fe,J,fe,pn,Mt,Be,un,Q,I=h(()=>{"use strict";o();zr();on();Pt();an();_t();cn();ln=.01,Fe=1500,J=5e4,fe=1e9,pn=1,Mt=4294967295,Be="logout",un="login",Q="0"});var Te,Ue=h(()=>{"use strict";o();Te=()=>Date.now()/1e3});var dn=h(()=>{"use strict";o()});var mn=h(()=>{"use strict";o()});var gn=h(()=>{"use strict";o();Ue();dn();mn()});var Ft={};oe(Ft,{getItem:()=>ta,localStorageKeys:()=>ce,removeItem:()=>ra,setItem:()=>ea});var ce,Ot,ea,ta,ra,be=h(()=>{"use strict";o();gn();ce={loginExpiresAt:"sdk-dapp-login-expires-at",logoutEvent:"sdk-dapp-logout-event"},Ot=typeof localStorage!="undefined",ea=({key:e,data:t,expires:r})=>{!Ot||localStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},ta=e=>{if(!Ot)return;let t=localStorage.getItem(String(e));if(!t)return null;let r=JSON.parse(t);return!r||!r.hasOwnProperty("expires")||!r.hasOwnProperty("data")?null:Te()>=r.expires?(localStorage.removeItem(String(e)),null):r.data},ra=e=>{!Ot||localStorage.removeItem(String(e))}});var Bt={};oe(Bt,{clear:()=>hn,getItem:()=>Tn,removeItem:()=>yn,setItem:()=>fn,storage:()=>na});var fn,Tn,yn,hn,na,xn=h(()=>{"use strict";o();fn=({key:e,data:t,expires:r})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Tn=e=>{let t=sessionStorage.getItem(String(e));if(!t)return null;let r=JSON.parse(t);return!r||!r.hasOwnProperty("expires")||!r.hasOwnProperty("data")?null:Date.now()>=r.expires?(sessionStorage.removeItem(String(e)),null):r.data},yn=e=>sessionStorage.removeItem(String(e)),hn=()=>sessionStorage.clear(),na={setItem:fn,getItem:Tn,removeItem:yn,clear:hn}});var ye,Ve=h(()=>{"use strict";o();be();xn();ye={session:Bt,local:Ft}});var Ut,N,$e,Z=h(()=>{"use strict";o();Ut=require("@reduxjs/toolkit");I();N=(0,Ut.createAction)(Be),$e=(0,Ut.createAction)(un,e=>({payload:e}))});var $t,Sn,wn,Ge,Vt,bn,An,Bc,In,Uc,Vc,$c,Gc,Hc,Wc,qc,He,We=h(()=>{"use strict";o();$t=require("@multiversx/sdk-core"),Sn=require("@reduxjs/toolkit"),wn=require("redux-persist");I();Ve();be();Z();Ge={balance:"...",address:"",nonce:0,txCount:0,scrCount:0,claimableRewards:Q},Vt={address:"",websocketEvent:null,accounts:{"":Ge},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},bn=(0,Sn.createSlice)({name:"accountInfoSlice",initialState:Vt,reducers:{setAddress:(e,t)=>{let r=t.payload;e.address=r,e.publicKey=new $t.Address(r).hex()},setAccount:(e,t)=>{let r=e.address===t.payload.address;e.accounts={[e.address]:r?t.payload:Ge},e.shard=t.payload.shard,e.isAccountLoading=!1,e.accountLoadingError=null},setAccountNonce:(e,t)=>{let{address:r}=e;e.accounts[r].nonce=t.payload},setAccountShard:(e,t)=>{e.shard=t.payload},setLedgerAccount:(e,t)=>{e.ledgerAccount=t.payload},updateLedgerAccount:(e,t)=>{e.ledgerAccount!=null&&(e.ledgerAccount.index=t.payload.index,e.ledgerAccount.address=t.payload.address)},setWalletConnectAccount:(e,t)=>{e.walletConnectAccount=t.payload},setIsAccountLoading:(e,t)=>{e.isAccountLoading=t.payload,e.accountLoadingError=null},setAccountLoadingError:(e,t)=>{e.accountLoadingError=t.payload,e.isAccountLoading=!1},setWebsocketEvent:(e,t)=>{e.websocketEvent={timestamp:Date.now(),message:t.payload}}},extraReducers:e=>{e.addCase(N,()=>(ye.local.removeItem(ce.loginExpiresAt),Vt)),e.addCase($e,(t,r)=>{let{address:n}=r.payload;t.address=n,t.publicKey=new $t.Address(n).hex()}),e.addCase(wn.REHYDRATE,(t,r)=>{var g;if(!((g=r.payload)!=null&&g.account))return;let{account:n}=r.payload,{address:i,shard:l,accounts:p,publicKey:d}=n;t.address=i,t.shard=l;let m=p&&i in p;t.accounts=m?p:Vt.accounts,t.publicKey=d})}}),{setAccount:An,setAddress:Bc,setAccountNonce:In,setAccountShard:Uc,setLedgerAccount:Vc,updateLedgerAccount:$c,setWalletConnectAccount:Gc,setIsAccountLoading:Hc,setAccountLoadingError:Wc,setWebsocketEvent:qc}=bn.actions,He=bn.reducer});function Ae(){return new Date().setHours(new Date().getHours()+24)}function Ie(e){ye.local.setItem({key:ce.loginExpiresAt,data:e,expires:e})}var Gt=h(()=>{"use strict";o();Ve();be()});var kn,vn,En,tl,rl,nl,ol,il,al,Ln,sl,qe,je=h(()=>{"use strict";o();kn=require("@reduxjs/toolkit");Gt();Y();Z();vn={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,operaLogin:null,isLoginSessionInvalid:!1},En=(0,kn.createSlice)({name:"loginInfoSlice",initialState:vn,reducers:{setLoginMethod:(e,t)=>{e.loginMethod=t.payload},setTokenLogin:(e,t)=>{e.tokenLogin=t.payload},setTokenLoginSignature:(e,t)=>{(e==null?void 0:e.tokenLogin)!=null&&(e.tokenLogin.signature=t.payload)},setWalletLogin:(e,t)=>{e.walletLogin=t.payload},setWalletConnectLogin:(e,t)=>{e.walletConnectLogin=t.payload},setLedgerLogin:(e,t)=>{e.ledgerLogin=t.payload},invalidateLoginSession:e=>{e.isLoginSessionInvalid=!0},setLogoutRoute:(e,t)=>{e.logoutRoute=t.payload}},extraReducers:e=>{e.addCase(N,()=>vn),e.addCase($e,(t,r)=>{t.loginMethod=r.payload.loginMethod,Ie(Ae())})}}),{setLoginMethod:tl,setWalletConnectLogin:rl,setLedgerLogin:nl,setTokenLogin:ol,setTokenLoginSignature:il,setWalletLogin:al,invalidateLoginSession:Ln,setLogoutRoute:sl}=En.actions,qe=En.reducer});var Dn,Nn,Rn,ul,Ht,dl,ml,ze,Ke=h(()=>{"use strict";o();Dn=require("@reduxjs/toolkit");Z();Nn={},Rn=(0,Dn.createSlice)({name:"modalsSlice",initialState:Nn,reducers:{setTxSubmittedModal:(e,t)=>{e.txSubmittedModal=t.payload},setNotificationModal:(e,t)=>{e.notificationModal=t.payload},clearTxSubmittedModal:e=>{e.txSubmittedModal=void 0},clearNotificationModal:e=>{e.notificationModal=void 0}},extraReducers:e=>{e.addCase(N,()=>Nn)}}),{setTxSubmittedModal:ul,setNotificationModal:Ht,clearTxSubmittedModal:dl,clearNotificationModal:ml}=Rn.actions,ze=Rn.reducer});var Cn=h(()=>{"use strict";o()});var Pn=h(()=>{"use strict";o();Cn()});function Wt(e){return e[Math.floor(Math.random()*e.length)]}var _n=h(()=>{"use strict";o()});var Mn=h(()=>{"use strict";o();Pt()});var On=h(()=>{"use strict";o();Pn();_n();Mn()});var Fn,Bn,qt,ia,Un,Nl,Dl,Ye,Ze=h(()=>{"use strict";o();Fn=require("@reduxjs/toolkit"),Bn=w(require("lodash.omit"));On();qt={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletConnectV2Options:{},walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},ia={network:qt,chainID:"-1"},Un=(0,Fn.createSlice)({name:"appConfig",initialState:ia,reducers:{initializeNetworkConfig:(e,t)=>{let r=Wt(t.payload.walletConnectBridgeAddresses),n=Wt(t.payload.walletConnectV2RelayAddresses),i=(0,Bn.default)(t.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=A(x(x({},e.network),i),{walletConnectBridgeAddress:r,walletConnectV2RelayAddress:n})},setChainID:(e,t)=>{e.chainID=t.payload}}}),{initializeNetworkConfig:Nl,setChainID:Dl}=Un.actions,Ye=Un.reducer});var Vn,jt,$n,Ol,Fl,Bl,Xe,Je=h(()=>{"use strict";o();Vn=require("@reduxjs/toolkit");_();Z();jt={isSigning:!1,signedSessions:{}},$n=(0,Vn.createSlice)({name:"signedMessageInfoSliceState",initialState:jt,reducers:{setSignSession:(e,t)=>{let{sessionId:r,signedSession:n,errorMessage:i}=t.payload;return A(x({},e),{errorMessage:i!=null?i:e.errorMessage,isSigning:n.status==="pending",signedSessions:A(x({},e.signedSessions),{[r]:n})})},setSignSessionState:(e,t)=>x(x({},e),t.payload),clearSignedMessageInfo:()=>jt},extraReducers:e=>{e.addCase(N,()=>jt)}}),{setSignSession:Ol,clearSignedMessageInfo:Fl,setSignSessionState:Bl}=$n.actions,Xe=$n.reducer});var Hn,Wn,Gn,qn,jl,zl,Kl,Yl,Zl,Xl,Qe,et=h(()=>{"use strict";o();Hn=require("@reduxjs/toolkit"),Wn=require("redux-persist");_t();_();Ue();Z();Gn={customToasts:[],transactionToasts:[],failTransactionToast:null},qn=(0,Hn.createSlice)({name:"toastsSlice",initialState:Gn,reducers:{addCustomToast:(e,t)=>{e.customToasts.push(A(x({},t.payload),{type:"custom",toastId:t.payload.toastId||`custom-toast-${e.customToasts.length+1}`}))},removeCustomToast:(e,t)=>{e.customToasts=e.customToasts.filter(r=>r.toastId!==t.payload)},addTransactionToast:(e,t)=>{e.transactionToasts.push({type:"transaction",startTimestamp:Te(),toastId:t.payload||`custom-toast-${e.transactionToasts.length+1}`})},removeTransactionToast:(e,t)=>{e.transactionToasts=e.transactionToasts.filter(r=>r.toastId!==t.payload)},addFailTransactionToast:(e,t)=>{e.failTransactionToast=A(x({},t.payload),{toastId:sn})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(N,()=>Gn),e.addCase(Wn.REHYDRATE,(t,r)=>{var i,l;let n=(l=(i=r.customToasts)==null?void 0:i.filter(p=>!("component"in p)))!=null?l:[];t.customToasts=n})}}),{addCustomToast:jl,removeCustomToast:zl,addTransactionToast:Kl,removeTransactionToast:Yl,addFailTransactionToast:Zl,removeFailTransactionToast:Xl}=qn.actions,Qe=qn.reducer});var jn,Kt,Yt,Zt,aa,zt,zn,tp,Kn,rp,tt,rt=h(()=>{"use strict";o();jn=require("@reduxjs/toolkit");Z();Kt="Transaction failed",Yt="Transaction successful",Zt="Processing transaction",aa="Transaction submitted",zt={},zn=(0,jn.createSlice)({name:"transactionsInfo",initialState:zt,reducers:{setTransactionsDisplayInfo(e,t){let{sessionId:r,transactionsDisplayInfo:n}=t.payload;r!=null&&(e[r]={errorMessage:(n==null?void 0:n.errorMessage)||Kt,successMessage:(n==null?void 0:n.successMessage)||Yt,processingMessage:(n==null?void 0:n.processingMessage)||Zt,submittedMessage:(n==null?void 0:n.submittedMessage)||aa,transactionDuration:n==null?void 0:n.transactionDuration})},clearTransactionsInfoForSessionId(e,t){t.payload!=null&&delete e[t.payload]},clearTransactionsInfo:()=>zt},extraReducers:e=>{e.addCase(N,()=>zt)}}),{clearTransactionsInfo:tp,setTransactionsDisplayInfo:Kn,clearTransactionsInfoForSessionId:rp}=zn.actions,tt=zn.reducer});function Yn(e){return e!=null&&(fa(e)||xa(e))}function nt(e){return e!=null&&(Ta(e)||Sa(e))}function ot(e){return e!=null&&(ya(e)||wa(e))}function Zn(e){return e!=null&&ha(e)}function fa(e){return e!=null&&ca.includes(e)}function Ta(e){return e!=null&&la.includes(e)}function ya(e){return e!=null&&pa.includes(e)}function ha(e){return e!=null&&ua.includes(e)}function xa(e){return e!=null&&da.includes(e)}function Sa(e){return e!=null&&ma.includes(e)}function wa(e){return e!=null&&ga.includes(e)}var ca,la,pa,ua,da,ma,ga,Jt=h(()=>{"use strict";o();Y();ca=["sent"],la=["success"],pa=["fail","cancelled","timedOut"],ua=["timedOut"],da=["pending"],ma=["success"],ga=["fail","invalid"]});var Xn,Jn,ve,ba,Qn,up,dp,eo,to,ro,Qt,mp,gp,no,fp,it,at=h(()=>{"use strict";o();Xn=require("@reduxjs/toolkit"),Jn=require("redux-persist");Y();Jt();Z();ve={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},ba={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},Qn=(0,Xn.createSlice)({name:"transactionsSlice",initialState:ve,reducers:{moveTransactionsToSignedState:(e,t)=>{var m,g;let{sessionId:r,transactions:n,errorMessage:i,status:l,redirectRoute:p}=t.payload,d=((m=e.customTransactionInformationForSessionId)==null?void 0:m[r])||ba;e.signedTransactions[r]={transactions:n,status:l,errorMessage:i,redirectRoute:p,customTransactionInformation:d},((g=e==null?void 0:e.transactionsToSign)==null?void 0:g.sessionId)===r&&(e.transactionsToSign=ve.transactionsToSign)},clearSignedTransaction:(e,t)=>{e.signedTransactions[t.payload]&&delete e.signedTransactions[t.payload]},clearTransactionToSign:e=>{e!=null&&e.transactionsToSign&&(e.transactionsToSign=null)},updateSignedTransaction:(e,t)=>{e.signedTransactions=x(x({},e.signedTransactions),t.payload)},updateSignedTransactions:(e,t)=>{let{sessionId:r,status:n,errorMessage:i,transactions:l}=t.payload;e.signedTransactions[r]!=null&&(e.signedTransactions[r].status=n,i!=null&&(e.signedTransactions[r].errorMessage=i),l!=null&&(e.signedTransactions[r].transactions=l))},updateSignedTransactionStatus:(e,t)=>{var d,m,g,y,f,S;let{sessionId:r,status:n,errorMessage:i,transactionHash:l}=t.payload,p=(m=(d=e.signedTransactions)==null?void 0:d[r])==null?void 0:m.transactions;if(p!=null){e.signedTransactions[r].transactions=p.map(P=>P.hash===l?A(x({},P),{status:n,errorMessage:i}):P);let v=(y=(g=e.signedTransactions[r])==null?void 0:g.transactions)==null?void 0:y.every(P=>nt(P.status)),C=(S=(f=e.signedTransactions[r])==null?void 0:f.transactions)==null?void 0:S.every(P=>ot(P.status));v&&(e.signedTransactions[r].status="success"),C&&(e.signedTransactions[r].status="fail")}},setTransactionsToSign:(e,t)=>{e.transactionsToSign=t.payload;let{sessionId:r,customTransactionInformation:n}=t.payload;e.customTransactionInformationForSessionId[r]=n,e.signTransactionsError=null},clearAllTransactionsToSign:e=>{e.transactionsToSign=ve.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=ve.signedTransactions},setSignTransactionsError:(e,t)=>{e.signTransactionsError=t.payload},setSignTransactionsCancelMessage:(e,t)=>{e.signTransactionsCancelMessage=t.payload}},extraReducers:e=>{e.addCase(N,()=>ve),e.addCase(Jn.REHYDRATE,(t,r)=>{var p;if(t.signTransactionsCancelMessage=null,!((p=r.payload)!=null&&p.transactions))return;let{signedTransactions:n,customTransactionInformationForSessionId:i}=r.payload.transactions,l=Object.entries(n).reduce((d,[m,g])=>{let y=new Date(m),f=new Date;return f.setHours(f.getHours()+5),f-y>0||(d[m]=g),d},{});i!=null&&(t.customTransactionInformationForSessionId=i),n!=null&&(t.signedTransactions=l)})}}),{updateSignedTransactionStatus:up,updateSignedTransactions:dp,setTransactionsToSign:eo,clearAllTransactionsToSign:to,clearAllSignedTransactions:ro,clearSignedTransaction:Qt,clearTransactionToSign:mp,setSignTransactionsError:gp,setSignTransactionsCancelMessage:no,moveTransactionsToSignedState:fp}=Qn.actions,it=Qn.reducer});var ee=h(()=>{"use strict";o();We();je();Ke();Ze();Je();et();rt();at()});var er=h(()=>{"use strict";o()});var co,so,lo,Up,Vp,$p,Gp,Hp,Wp,po,uo=h(()=>{"use strict";o();co=require("@reduxjs/toolkit");Z();so={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},lo=(0,co.createSlice)({name:"dappModalsSlice",initialState:so,reducers:{setDappModalVisibility:(e,t)=>{e.visible=t.payload},setDappModalHeaderVisibility:(e,t)=>{e.modal.showHeader=t.payload},setDappModalFooterVisibility:(e,t)=>{e.modal.showFooter=t.payload},setDappModalHeaderText:(e,t)=>{e.modal.headerText=t.payload},setDappModalFooterText:(e,t)=>{e.modal.footerText=t.payload},setDappModalConfig:(e,t)=>{e.modal=x({},t.payload)}},extraReducers:e=>{e.addCase(N,()=>so)}}),{setDappModalVisibility:Up,setDappModalHeaderVisibility:Vp,setDappModalFooterVisibility:$p,setDappModalHeaderText:Gp,setDappModalFooterText:Hp,setDappModalConfig:Wp}=lo.actions,po=lo.reducer});var mo,ka,Ea,le,ut=h(()=>{"use strict";o();mo=require("@reduxjs/toolkit");er();We();uo();je();Ke();Ze();Je();et();rt();at();ka={["account"]:He,["dappModal"]:po,["loginInfo"]:qe,["modals"]:ze,["networkConfig"]:Ye,["signedMessageInfo"]:Xe,["toasts"]:Qe,["transactionsInfo"]:tt,["transactions"]:it},Ea=(e={})=>(0,mo.combineReducers)(x(x({},ka),e)),le=Ea});var yo={};oe(yo,{default:()=>Ga,sessionStorageReducers:()=>tr});function te(e,t=[]){return{key:e,version:1,storage:fo.default,blacklist:t}}var M,go,fo,La,ke,Na,Da,Ra,Ca,Pa,_a,Ma,Oa,Fa,To,Ba,tr,Ua,Va,$a,Ga,ho=h(()=>{"use strict";o();M=require("redux-persist"),go=w(require("redux-persist/lib/storage")),fo=w(require("redux-persist/lib/storage/session"));ut();ee();We();je();Ke();Ze();Je();et();rt();at();er();La={persistReducersStorageType:"localStorage"},ke={["account"]:"sdk-dapp-account",["loginInfo"]:"sdk-dapp-login-info",["modals"]:"sdk-dapp-modals",["networkConfig"]:"sdk-dapp-network-config"},Na=te(ke["account"]),Da=te(ke["loginInfo"]),Ra=te(ke["modals"]),Ca=te(ke["networkConfig"]),Pa={2:e=>A(x({},e),{networkConfig:qt})};_a=te("sdk-dapp-transactionsInfo"),Ma=te("sdk-dapp-transactions",["transactionsToSign"]),Oa=te("sdk-dapp-toasts"),Fa=te("sdk-dapp-signedMessageInfo"),To={key:"sdk-dapp-store",version:2,storage:go.default,whitelist:Object.keys(ke),migrate:(0,M.createMigrate)(Pa,{debug:!1})},Ba=A(x({},To),{whitelist:[]}),tr={["toasts"]:(0,M.persistReducer)(Oa,Qe),["transactions"]:(0,M.persistReducer)(Ma,it),["transactionsInfo"]:(0,M.persistReducer)(_a,tt),["signedMessageInfo"]:(0,M.persistReducer)(Fa,Xe)},Ua=A(x({},tr),{["account"]:(0,M.persistReducer)(Na,He),["loginInfo"]:(0,M.persistReducer)(Da,qe),["modals"]:(0,M.persistReducer)(Ra,ze),["networkConfig"]:(0,M.persistReducer)(Ca,Ye)}),Va=La.persistReducersStorageType==="localStorage",$a=Va?(0,M.persistReducer)(To,le(tr)):(0,M.persistReducer)(Ba,le(Ua)),Ga=$a});var xo={};oe(xo,{default:()=>Ha});var Ha,So=h(()=>{"use strict";o();ut();Ha=le()});var wo={};oe(wo,{default:()=>qa});var B,Wa,qa,bo=h(()=>{"use strict";o();B=require("redux-persist"),Wa=[B.FLUSH,B.REHYDRATE,B.PAUSE,B.PERSIST,B.PURGE,B.REGISTER],qa=Wa});var vo={};oe(vo,{default:()=>Io});function Io(e){return(0,Ao.persistStore)(e)}var Ao,ko=h(()=>{"use strict";o();Ao=require("redux-persist")});var Ps={};oe(Ps,{calcTotalFee:()=>sr,isCrossShardTransaction:()=>jo,nativeAuth:()=>Cs,removeAllSignedTransactions:()=>Ka,removeAllTransactionsToSign:()=>Ya,removeSignedTransaction:()=>za,removeTransactionsToSign:()=>ja,sendTransactions:()=>ks,signTransactions:()=>cr});module.exports=we(Ps);o();o();o();ee();o();var rr=require("@reduxjs/toolkit"),Do=require("react-redux/lib/utils/Subscription");ee();o();var io=w(require("lodash.throttle"));I();o();var oo=w(require("lodash.isequal")),st=require("reselect");_();var T=(0,st.createSelectorCreator)(st.defaultMemoize,oo.default),ct=(e,t)=>e!=""&&Boolean(t);ee();Gt();Ve();be();var Aa=[Be],lt=!1,Ia=(0,io.default)(()=>{Ie(Ae())},5e3),ao=e=>t=>r=>{var m;if(Aa.includes(r.type))return t(r);let n=e.getState(),i=ye.local.getItem(ce.loginExpiresAt);if(!ct((m=n==null?void 0:n.loginInfo)==null?void 0:m.loginMethod,n==null?void 0:n.account.address))return t(r);if(i==null)return Ie(Ae());let p=Date.now();return i-p<0&&!lt?setTimeout(()=>{lt=!0,e.dispatch(Ln())},1e3):(lt&&(lt=!1),Ia()),t(r)};o();o();function pt(){return typeof sessionStorage!="undefined"}var Eo=pt()?(ho(),we(yo)).default:(So(),we(xo)).default,Lo=pt()?(bo(),we(wo)).default:[],No=pt()?(ko(),we(vo)).default:e=>e;ut();var b=(0,rr.configureStore)({reducer:Eo,middleware:e=>e({serializableCheck:{ignoredActions:[...Lo,In.type,An.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(ao)}),wu=(0,Do.createSubscription)(b),bu=No(b),Au=(0,rr.configureStore)({reducer:le});function ja(e){b.dispatch(Qt(e))}function za(e){b.dispatch(Qt(e))}function Ka(){b.dispatch(ro())}function Ya(){b.dispatch(to())}o();o();var Vo=w(require("bignumber.js"));I();o();ee();var X=e=>e.account,Ee=T(X,e=>e.address),nr=T(X,Ee,(e,t)=>t in e.accounts?e.accounts[t]:Ge),Du=T(X,nr,(e,t)=>{let i=e,{accounts:r}=i,n=Ar(i,["accounts"]);return A(x({},n),{account:t})}),Ro=T(nr,e=>e.balance),Co=T(nr,e=>{var t;return((t=e==null?void 0:e.nonce)==null?void 0:t.valueOf())||0}),Ru=T(X,e=>e.shard),Cu=T(X,e=>e.ledgerAccount),Pu=T(X,e=>e.walletConnectAccount),_u=T(X,e=>e.isAccountLoading),Mu=T(X,e=>e.accountLoadingError),Ou=T(X,e=>e.websocketEvent);o();var pe=e=>e.networkConfig,dt=T(pe,e=>e.chainID),Uu=T(pe,e=>e.network.walletConnectBridgeAddress),Vu=T(pe,e=>e.network.walletConnectV2RelayAddress),$u=T(pe,e=>e.network.walletConnectV2ProjectId),Gu=T(pe,e=>e.network.walletConnectV2Options),Hu=T(pe,e=>e.network.walletConnectDeepLink),or=T(pe,e=>e.network),Po=T(or,e=>e.apiAddress),_o=T(or,e=>e.explorerAddress),Wu=T(or,e=>e.egldLabel);ee();_();o();var Mo=w(require("bignumber.js"));I();var mt=e=>{if(isNaN(e)||e==null||String(e).includes("Infinity"))return!1;let[t,r]=e.split(".");if(r)for(;r.charAt(r.length-1)===Q;)r=r.slice(0,-1);let n=r?[t,r].join("."):t,i=new Mo.default(n);return i.toString(10)===n&&i.comparedTo(0)>=0};o();var ar=w(require("bignumber.js"));I();o();var U=require("@multiversx/sdk-core"),Bo=require("@multiversx/sdk-network-providers");I();o();o();var Oo=w(require("bignumber.js")),ir=(e,t=!0)=>{let r=String(e);if(!r.match(/^[-]?\d+$/))return!1;let n=new Oo.default(r),i=t?0:-1;return n.toString(10)===r&&n.comparedTo(0)>=i};o();I();o();var Fo={from:"erd12dnfhej64s6c56ka369gkyj3hwv5ms0y5rxgsk2k7hkd2vuk7rvqxkalsa",to:"erd12dnfhej64s6c56ka369gkyj3hwv5ms0y5rxgsk2k7hkd2vuk7rvqxkalsa"};function Uo({minGasLimit:e=String(J),gasLimit:t,gasPrice:r,data:n,gasPerDataByte:i,gasPriceModifier:l,defaultGasPrice:p=String(fe),chainId:d}){let m=n||"",g=ir(t)?t:e,y=mt(r)?r:p,f=new U.Transaction({nonce:0,value:U.TokenPayment.egldFromAmount("0"),receiver:new U.Address(Fo.to),sender:new U.Address(Fo.to),gasPrice:parseInt(y),gasLimit:parseInt(g),data:new U.TransactionPayload(m.trim()),chainID:d,version:new U.TransactionVersion(1)}),S=new Bo.NetworkConfig;S.MinGasLimit=parseInt(e),S.GasPerDataByte=parseInt(i),S.GasPriceModifier=parseFloat(l);try{return f.computeFee(S).toString(10)}catch(v){return Q}}function sr(e,t){let r=new ar.default(0);return e.forEach(n=>{let i=Uo({gasPerDataByte:String(Fe),gasPriceModifier:String(ln),minGasLimit:String(t),gasLimit:n.getGasLimit().valueOf().toString(),gasPrice:n.getGasPrice().valueOf().toString(),data:n.getData().toString(),chainId:n.getChainID().valueOf()});r=r.plus(new ar.default(i))}),r}function cr(l){return k(this,arguments,function*({transactions:e,callbackRoute:t,minGasLimit:r=J,customTransactionInformation:n,transactionsDisplayInfo:i}){let p=b.getState(),d=Date.now().toString(),m=Ro(p),g=dt(p),y=Array.isArray(e)?e:[e],f=sr(y,r);if(!new Vo.default(mt(m)?m:"0").minus(f).isGreaterThan(0)){let q={type:"warning",iconClassName:"text-warning",title:"Insufficient EGLD funds",description:"Current EGLD balance cannot cover the transaction fees."};return b.dispatch(Ht(q)),{error:"insufficient funds",sessionId:null}}if(!(y==null?void 0:y.every(q=>q.getChainID().valueOf()===g.valueOf()))){let q={type:"warning",iconClassName:"text-warning",title:"Network change detected",description:"The application tried to change the transaction network"};return b.dispatch(Ht(q)),{error:"Invalid ChainID",sessionId:null}}let P={sessionId:d,callbackRoute:t,customTransactionInformation:n,transactions:y.map(q=>q.toPlainObject())};return b.dispatch(no(null)),b.dispatch(eo(P)),b.dispatch(Kn({sessionId:d,transactionsDisplayInfo:i})),{sessionId:d}})}o();var hr=require("@multiversx/sdk-core"),xr=w(require("bignumber.js"));I();o();var O=require("@multiversx/sdk-core");I();o();function lr(e){try{return a.Buffer.from(e,"base64").toString()===atob(e)}catch(t){return!1}}function he(e){return atob(e)}function Le(e){var i,l,p;let{data:t}=e,r=lr(t!=null?t:"")?O.TransactionPayload.fromEncoded(t):new O.TransactionPayload(t),n=new O.Transaction(x({value:e.value.valueOf(),data:r,nonce:e.nonce.valueOf(),receiver:new O.Address(e.receiver),sender:new O.Address(e.sender),gasLimit:(i=e.gasLimit.valueOf())!=null?i:J,gasPrice:(l=e.gasPrice.valueOf())!=null?l:fe,chainID:e.chainID.valueOf(),version:new O.TransactionVersion((p=e.version)!=null?p:pn)},e.options?{options:new O.TransactionOptions(e.options)}:{}));return n.applySignature({hex:()=>e.signature||""},new O.Address(e.sender)),n}o();o();var ne=e=>e.loginInfo,Ed=T(ne,e=>e.loginMethod),Ld=T(ne,Ee,(e,t)=>ct(e.loginMethod,t)),Nd=T(ne,e=>e.walletConnectLogin),Dd=T(ne,e=>e.ledgerLogin),Rd=T(ne,e=>e.walletLogin),Cd=T(ne,e=>e.isLoginSessionInvalid),Pd=T(ne,e=>e.tokenLogin),_d=T(ne,e=>e.logoutRoute);o();var $o=e=>e.modals,Fd=T($o,e=>e.txSubmittedModal),Bd=T($o,e=>e.notificationModal);o();var pr=e=>e.signedMessageInfo,$d=T(pr,e=>e.isSigning),Gd=T(pr,e=>e.errorMessage),Hd=T(pr,e=>{let t=Object.keys(e.signedSessions),r=t.length;return e.signedSessions[t[r-1]]});o();var ur=e=>e.toasts,jd=T(ur,e=>e.customToasts),zd=T(ur,e=>e.transactionToasts),Kd=T(ur,e=>e.failTransactionToast);o();ee();var Go={errorMessage:Kt,successMessage:Yt,processingMessage:Zt},Za=e=>e.transactionsInfo,Jd=T(Za,(e,t)=>t,(e,t)=>t!=null&&(e==null?void 0:e[Number(t)])||Go);o();o();Jt();o();var Ja=w(require("bignumber.js"));_();o();o();o();o();var es=require("@multiversx/sdk-core"),ts=w(require("bignumber.js"));Y();o();var Qa=require("@multiversx/sdk-core");o();o();o();var mr=require("@multiversx/sdk-core/out");o();I();var rs=e=>{let t=a.Buffer.from([0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);if(e.slice(0,t.length).equals(t))return!0;let n=a.Buffer.alloc(32).fill(0);return e.equals(n)},dr=e=>{try{let r=parseInt("11",2),n=parseInt("01",2),i=a.Buffer.from(e,"hex"),l=i[31];if(rs(i))return Mt;let p=l&r;return p>3-1&&(p=l&n),p}catch(t){return-1}};function jo({receiverAddress:e,senderShard:t,senderAddress:r}){try{let n=new mr.Address(e),i=dr(n.pubkey());if(t==null&&r!=null){let l=new mr.Address(r);return dr(l)===i}return i===t}catch(n){return!1}}o();var zo=require("@multiversx/sdk-core");_();o();o();o();o();Y();o();o();o();o();o();o();o();var gr="accounts";var fr="blocks";o();o();o();o();R();o();o();R();o();o();o();var as=w(require("bignumber.js"));I();o();var is=require("@multiversx/sdk-core"),Tr=w(require("bignumber.js"));I();o();Tr.default.config({ROUNDING_MODE:Tr.default.ROUND_FLOOR});o();o();o();I();o();o();o();o();I();o();I();o();var ss=require("@multiversx/sdk-core");I();o();o();o();o();I();o();R();var ls=["reDelegateRewards","claimRewards","unBond"],ps=["wrapEgld","unwrapEgld"],us=["unStake"],ds=["unDelegate"];o();o();o();I();o();var fs=w(require("bignumber.js"));o();o();o();o();R();o();var Ts=w(require("bignumber.js"));o();o();o();o();R();o();o();o();var hs=w(require("linkifyjs"));o();I();o();var xs=w(require("bignumber.js"));o();_();o();o();Y();o();Y();o();o();o();R();o();R();o();var Ss=w(require("bignumber.js"));I();R();o();R();o();var Jo=require("react");_();o();o();R();o();o();var ws=require("@multiversx/sdk-core/out"),bs=w(require("bignumber.js"));R();o();_();o();o();_();var fh=[{label:"Raw",value:"raw"},{label:"Text",value:"text"},{label:"Decimal",value:"decimal"},{label:"Smart",value:"smart"}];o();var Qo=require("react");_();o();var Is=require("react");R();var bh=["create","localMint","ESDTLocalMint","addQuantity","burn","localBurn","ESDTLocalBurn","wipe","writeLog","signalError"];var yt=e=>e.transactions,Ne=T(yt,e=>e.signedTransactions),ax=T(yt,e=>e.signTransactionsError),sx=T(yt,e=>e.signTransactionsCancelMessage),ht=e=>t=>Object.entries(t).reduce((r,[n,i])=>(e(i.status)&&(r[n]=i),r),{}),cx=T(Ne,ht(Yn)),lx=T(Ne,ht(nt)),px=T(Ne,ht(ot)),ux=T(Ne,ht(Zn)),dx=T(yt,e=>{var t;return(e==null?void 0:e.transactionsToSign)==null?null:A(x({},e.transactionsToSign),{transactions:((t=e==null?void 0:e.transactionsToSign)==null?void 0:t.transactions.map(r=>Le(r)))||[]})}),mx=T(Ne,(e,t)=>t,(e,t)=>t!=null?(e==null?void 0:e[t])||{}:{});o();o();var ti=w(require("axios"));o();o();var ei=e=>{let t=e!=null?e:Po(b.getState());return t.endsWith("/")?t.slice(0,-1):t};function ri(e){return k(this,null,function*(){if(!e)return null;let r=`${ei()}/${gr}/${e}`;try{let{data:n}=yield ti.default.get(r);return n}catch(n){console.error("error fetching configuration for ",r)}return null})}function ni(e){return k(this,null,function*(){return yield ri(e)})}o();function oi(e){let t=b.getState(),r=Co(t);return e?r&&!isNaN(r)?Math.max(r,e.nonce):e.nonce:r}function vs(e){let t=new xr.default(J),r=new xr.default(Fe),n=e?r.times(a.Buffer.from(e).length):0;return t.plus(n).toString(10)}function ii(t){return k(this,arguments,function*({transactions:e}){let r=Ee(b.getState()),n=yield ni(r),i=oi(n);return e.map(l=>{let{value:p,receiver:d,data:m="",chainID:g,version:y=1,options:f,gasPrice:S=fe,gasLimit:v=vs(l.data)}=l,C=d;try{C=new hr.Address(d).hex()}catch(fi){throw"Invalid Receiver address"}let P=dt(b.getState()).valueOf().toString(),q=g||P;return Le({value:p,receiver:C,data:m,gasPrice:S,gasLimit:Number(v),nonce:Number(i.valueOf().toString()),sender:new hr.Address(r).hex(),chainID:q,version:y,options:f})})})}function ks(m){return k(this,arguments,function*({transactions:e,transactionsDisplayInfo:t,redirectAfterSign:r=!0,callbackRoute:n=window.location.pathname,signWithoutSending:i,completedTransactionsDelay:l,sessionInformation:p,minGasLimit:d}){try{let g=Array.isArray(e)?e:[e],y=g.every(S=>Object.getPrototypeOf(S).toPlainObject!=null),f=g;return y||(f=yield ii({transactions:g,minGasLimit:d})),cr({transactions:f,minGasLimit:d,callbackRoute:n,transactionsDisplayInfo:t,customTransactionInformation:{redirectAfterSign:r,completedTransactionsDelay:l,sessionInformation:p,signWithoutSending:i}})}catch(g){return console.error("error signing transaction",g),{error:g,sessionId:null}}})}o();o();o();o();var Es=e=>e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,""),xe=e=>Es(a.Buffer.from(e,"utf8").toString("base64"));o();var li=w(require("axios"));o();o();o();function ai(e){return k(this,null,function*(){return yield new Promise(t=>{setTimeout(()=>t(),e)})})}o();var si=(e,t,r,n=0)=>k(void 0,null,function*(){try{return yield e(...r)}catch(i){return n<t.retries?((t==null?void 0:t.delay)!=null&&(yield ai(t.delay)),yield si(e,t,r,n+1)):null}}),ci=(e,t={retries:5,delay:500})=>(...r)=>k(void 0,null,function*(){return yield si(e,t,r)});var Ls=4,Ns=3e4,xt={current:null},ue={current:null},Ds=ci((e,t)=>k(void 0,null,function*(){let{data:r}=yield li.default.get(`${e}/${fr}?from=${Ls}&size=1&fields=hash,timestamp${t?"&shard="+t:""}`),[n]=r;return n}));function pi(e,t){return k(this,null,function*(){if(e==null)throw new Error("missing api url");if(xt.current!=null&&Date.now()<xt.current.timestamp*1e3+Ns)return xt.current;if(ue.current!=null)return yield ue.current;ue.current=Ds(e,t);try{let r=yield ue.current;if(r==null)throw ue.current=null,new Error("could not get block hash");return xt.current={hash:r.hash,timestamp:r.timestamp},ue.current=null,r}catch(r){return ue.current=null,null}})}o();function Rs(e){return Object.prototype.toString.call(e)==="[object String]"}var ui=e=>{if(!e||!Rs(e))return null;try{let[t,r,n]=e.split("."),i=he(t),l=he(r),[p,d,m,g]=l.split("."),y=JSON.parse(he(g)),f=he(p),S={ttl:Number(m),address:i,extraInfo:y,host:f,signature:n,blockHash:d,body:l};return g==="e30"&&delete S.extraInfo,S}catch(t){return null}};o();o();Ue();var di=e=>{let t=ui(e);if(!t)return{isExpired:!1};let r=Te(),{ttl:n,extraInfo:i}=t,l=i.timestamp;if(!l)return{isExpired:!1};let p=l+n,d=r>p,m=p-r;return{isExpired:d,expiresAt:p,secondsUntilExpires:m}};o();var mi,De={hostname:typeof window!="undefined"?(mi=window==null?void 0:window.location)==null?void 0:mi.hostname:"",apiAddress:"https://api.multiversx.com",expirySeconds:60*60*24,tokenExpirationToastWarningSeconds:5*60},Sr=e=>{var r,n,i,l,p;return e===!0?De:{hostname:(r=e==null?void 0:e.hostname)!=null?r:De.hostname,blockHashShard:(n=e==null?void 0:e.blockHashShard)!=null?n:null,expirySeconds:(i=e==null?void 0:e.expirySeconds)!=null?i:De.expirySeconds,apiAddress:(l=e==null?void 0:e.apiAddress)!=null?l:De.apiAddress,tokenExpirationToastWarningSeconds:(p=e==null?void 0:e.tokenExpirationToastWarningSeconds)!=null?p:De.tokenExpirationToastWarningSeconds}};o();var gi=({address:e,token:t,signature:r})=>{let n=xe(e),i=xe(t);return`${n}.${i}.${r}`};var Cs=e=>{let{hostname:t,apiAddress:r,expirySeconds:n,blockHashShard:i}=Sr(e);return{getNativeAuthConfig:Sr,initialize:(...m)=>k(void 0,[...m],function*(p={},d){if(!r||!t)return"";let g=d!=null?d:yield pi(r,i),{hash:y,timestamp:f}=g,S=xe(JSON.stringify(x(x({},p),f?{timestamp:f}:{})));return`${xe(t)}.${y}.${n}.${S}`}),getToken:gi,getTokenExpiration:di}};0&&(module.exports={calcTotalFee,isCrossShardTransaction,nativeAuth,removeAllSignedTransactions,removeAllTransactionsToSign,removeSignedTransaction,removeTransactionsToSign,sendTransactions,signTransactions});
|
|
2
2
|
/*!
|
|
3
3
|
* The buffer module from node.js, for the browser.
|
|
4
4
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Or=Object.create;var P=Object.defineProperty;var kr=Object.getOwnPropertyDescriptor;var Mr=Object.getOwnPropertyNames;var br=Object.getPrototypeOf,Pr=Object.prototype.hasOwnProperty;var Hr=(e,r)=>()=>(e&&(r=e(e=0)),r);var H=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Gr=(e,r)=>{for(var t in r)P(e,t,{get:r[t],enumerable:!0})},or=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Mr(r))!Pr.call(e,i)&&i!==t&&P(e,i,{get:()=>r[i],enumerable:!(n=kr(r,i))||n.enumerable});return e};var Y=(e,r,t)=>(t=e!=null?Or(br(e)):{},or(r||!e||!e.__esModule?P(t,"default",{value:e,enumerable:!0}):t,e)),Vr=e=>or(P({},"__esModule",{value:!0}),e);var g=(e,r,t)=>new Promise((n,i)=>{var o=f=>{try{h(t.next(f))}catch(c){i(c)}},u=f=>{try{h(t.throw(f))}catch(c){i(c)}},h=f=>f.done?n(f.value):Promise.resolve(f.value).then(o,u);h((t=t.apply(e,r)).next())});var fr=H(G=>{"use strict";l();G.byteLength=Kr;G.toByteArray=qr;G.fromByteArray=zr;var F=[],E=[],Wr=typeof Uint8Array!="undefined"?Uint8Array:Array,q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(_=0,ur=q.length;_<ur;++_)F[_]=q[_],E[q.charCodeAt(_)]=_;var _,ur;E["-".charCodeAt(0)]=62;E["_".charCodeAt(0)]=63;function ar(e){var r=e.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");t===-1&&(t=r);var n=t===r?0:4-t%4;return[t,n]}function Kr(e){var r=ar(e),t=r[0],n=r[1];return(t+n)*3/4-n}function Yr(e,r,t){return(r+t)*3/4-t}function qr(e){var r,t=ar(e),n=t[0],i=t[1],o=new Wr(Yr(e,n,i)),u=0,h=i>0?n-4:n,f;for(f=0;f<h;f+=4)r=E[e.charCodeAt(f)]<<18|E[e.charCodeAt(f+1)]<<12|E[e.charCodeAt(f+2)]<<6|E[e.charCodeAt(f+3)],o[u++]=r>>16&255,o[u++]=r>>8&255,o[u++]=r&255;return i===2&&(r=E[e.charCodeAt(f)]<<2|E[e.charCodeAt(f+1)]>>4,o[u++]=r&255),i===1&&(r=E[e.charCodeAt(f)]<<10|E[e.charCodeAt(f+1)]<<4|E[e.charCodeAt(f+2)]>>2,o[u++]=r>>8&255,o[u++]=r&255),o}function Jr(e){return F[e>>18&63]+F[e>>12&63]+F[e>>6&63]+F[e&63]}function Xr(e,r,t){for(var n,i=[],o=r;o<t;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),i.push(Jr(n));return i.join("")}function zr(e){for(var r,t=e.length,n=t%3,i=[],o=16383,u=0,h=t-n;u<h;u+=o)i.push(Xr(e,u,u+o>h?h:u+o));return n===1?(r=e[t-1],i.push(F[r>>2]+F[r<<4&63]+"==")):n===2&&(r=(e[t-2]<<8)+e[t-1],i.push(F[r>>10]+F[r>>4&63]+F[r<<2&63]+"=")),i.join("")}});var hr=H(J=>{l();J.read=function(e,r,t,n,i){var o,u,h=i*8-n-1,f=(1<<h)-1,c=f>>1,s=-7,p=t?i-1:0,T=t?-1:1,m=e[r+p];for(p+=T,o=m&(1<<-s)-1,m>>=-s,s+=h;s>0;o=o*256+e[r+p],p+=T,s-=8);for(u=o&(1<<-s)-1,o>>=-s,s+=n;s>0;u=u*256+e[r+p],p+=T,s-=8);if(o===0)o=1-c;else{if(o===f)return u?NaN:(m?-1:1)*(1/0);u=u+Math.pow(2,n),o=o-c}return(m?-1:1)*u*Math.pow(2,o-n)};J.write=function(e,r,t,n,i,o){var u,h,f,c=o*8-i-1,s=(1<<c)-1,p=s>>1,T=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:o-1,R=n?1:-1,Rr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(h=isNaN(r)?1:0,u=s):(u=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-u))<1&&(u--,f*=2),u+p>=1?r+=T/f:r+=T*Math.pow(2,1-p),r*f>=2&&(u++,f/=2),u+p>=s?(h=0,u=s):u+p>=1?(h=(r*f-1)*Math.pow(2,i),u=u+p):(h=r*Math.pow(2,p-1)*Math.pow(2,i),u=0));i>=8;e[t+m]=h&255,m+=R,h/=256,i-=8);for(u=u<<i|h,c+=i;c>0;e[t+m]=u&255,m+=R,u/=256,c-=8);e[t+m-R]|=Rr*128}});var Br=H(k=>{"use strict";l();var X=fr(),O=hr(),cr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;k.Buffer=a;k.SlowBuffer=tt;k.INSPECT_MAX_BYTES=50;var V=2147483647;k.kMaxLength=V;a.TYPED_ARRAY_SUPPORT=$r();!a.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function $r(){try{var e=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(e,r),e.foo()===42}catch(t){return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(!!a.isBuffer(this))return this.buffer}});Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(!!a.isBuffer(this))return this.byteOffset}});function U(e){if(e>V)throw new RangeError('The value "'+e+'" is invalid for option "size"');var r=new Uint8Array(e);return Object.setPrototypeOf(r,a.prototype),r}function a(e,r,t){if(typeof e=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Z(e)}return lr(e,r,t)}a.poolSize=8192;function lr(e,r,t){if(typeof e=="string")return Zr(e,r);if(ArrayBuffer.isView(e))return jr(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(A(e,ArrayBuffer)||e&&A(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(A(e,SharedArrayBuffer)||e&&A(e.buffer,SharedArrayBuffer)))return $(e,r,t);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return a.from(n,r,t);var i=rt(e);if(i)return i;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return a.from(e[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}a.from=function(e,r,t){return lr(e,r,t)};Object.setPrototypeOf(a.prototype,Uint8Array.prototype);Object.setPrototypeOf(a,Uint8Array);function yr(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function Qr(e,r,t){return yr(e),e<=0?U(e):r!==void 0?typeof t=="string"?U(e).fill(r,t):U(e).fill(r):U(e)}a.alloc=function(e,r,t){return Qr(e,r,t)};function Z(e){return yr(e),U(e<0?0:j(e)|0)}a.allocUnsafe=function(e){return Z(e)};a.allocUnsafeSlow=function(e){return Z(e)};function Zr(e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var t=wr(e,r)|0,n=U(t),i=n.write(e,r);return i!==t&&(n=n.slice(0,i)),n}function z(e){for(var r=e.length<0?0:j(e.length)|0,t=U(r),n=0;n<r;n+=1)t[n]=e[n]&255;return t}function jr(e){if(A(e,Uint8Array)){var r=new Uint8Array(e);return $(r.buffer,r.byteOffset,r.byteLength)}return z(e)}function $(e,r,t){if(r<0||e.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<r+(t||0))throw new RangeError('"length" is outside of buffer bounds');var n;return r===void 0&&t===void 0?n=new Uint8Array(e):t===void 0?n=new Uint8Array(e,r):n=new Uint8Array(e,r,t),Object.setPrototypeOf(n,a.prototype),n}function rt(e){if(a.isBuffer(e)){var r=j(e.length)|0,t=U(r);return t.length===0||e.copy(t,0,0,r),t}if(e.length!==void 0)return typeof e.length!="number"||rr(e.length)?U(0):z(e);if(e.type==="Buffer"&&Array.isArray(e.data))return z(e.data)}function j(e){if(e>=V)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+V.toString(16)+" bytes");return e|0}function tt(e){return+e!=e&&(e=0),a.alloc(+e)}a.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==a.prototype};a.compare=function(r,t){if(A(r,Uint8Array)&&(r=a.from(r,r.offset,r.byteLength)),A(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(r)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===t)return 0;for(var n=r.length,i=t.length,o=0,u=Math.min(n,i);o<u;++o)if(r[o]!==t[o]){n=r[o],i=t[o];break}return n<i?-1:i<n?1:0};a.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};a.concat=function(r,t){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return a.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<r.length;++n)t+=r[n].length;var i=a.allocUnsafe(t),o=0;for(n=0;n<r.length;++n){var u=r[n];if(A(u,Uint8Array))o+u.length>i.length?a.from(u).copy(i,o):Uint8Array.prototype.set.call(i,u,o);else if(a.isBuffer(u))u.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=u.length}return i};function wr(e,r){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||A(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var t=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return Q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Fr(e).length;default:if(i)return n?-1:Q(e).length;r=(""+r).toLowerCase(),i=!0}}a.byteLength=wr;function et(e,r,t){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return st(this,r,t);case"utf8":case"utf-8":return mr(this,r,t);case"ascii":return ct(this,r,t);case"latin1":case"binary":return pt(this,r,t);case"base64":return ft(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return lt(this,r,t);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}a.prototype._isBuffer=!0;function D(e,r,t){var n=e[r];e[r]=e[t],e[t]=n}a.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<r;t+=2)D(this,t,t+1);return this};a.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<r;t+=4)D(this,t,t+3),D(this,t+1,t+2);return this};a.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<r;t+=8)D(this,t,t+7),D(this,t+1,t+6),D(this,t+2,t+5),D(this,t+3,t+4);return this};a.prototype.toString=function(){var r=this.length;return r===0?"":arguments.length===0?mr(this,0,r):et.apply(this,arguments)};a.prototype.toLocaleString=a.prototype.toString;a.prototype.equals=function(r){if(!a.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:a.compare(this,r)===0};a.prototype.inspect=function(){var r="",t=k.INSPECT_MAX_BYTES;return r=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(r+=" ... "),"<Buffer "+r+">"};cr&&(a.prototype[cr]=a.prototype.inspect);a.prototype.compare=function(r,t,n,i,o){if(A(r,Uint8Array)&&(r=a.from(r,r.offset,r.byteLength)),!a.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(t===void 0&&(t=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),t<0||n>r.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&t>=n)return 0;if(i>=o)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,o>>>=0,this===r)return 0;for(var u=o-i,h=n-t,f=Math.min(u,h),c=this.slice(i,o),s=r.slice(t,n),p=0;p<f;++p)if(c[p]!==s[p]){u=c[p],h=s[p];break}return u<h?-1:h<u?1:0};function xr(e,r,t,n,i){if(e.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,rr(t)&&(t=i?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(i)return-1;t=e.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof r=="string"&&(r=a.from(r,n)),a.isBuffer(r))return r.length===0?-1:pr(e,r,t,n,i);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):pr(e,[r],t,n,i);throw new TypeError("val must be string, number or Buffer")}function pr(e,r,t,n,i){var o=1,u=e.length,h=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||r.length<2)return-1;o=2,u/=2,h/=2,t/=2}function f(m,R){return o===1?m[R]:m.readUInt16BE(R*o)}var c;if(i){var s=-1;for(c=t;c<u;c++)if(f(e,c)===f(r,s===-1?0:c-s)){if(s===-1&&(s=c),c-s+1===h)return s*o}else s!==-1&&(c-=c-s),s=-1}else for(t+h>u&&(t=u-h),c=t;c>=0;c--){for(var p=!0,T=0;T<h;T++)if(f(e,c+T)!==f(r,T)){p=!1;break}if(p)return c}return-1}a.prototype.includes=function(r,t,n){return this.indexOf(r,t,n)!==-1};a.prototype.indexOf=function(r,t,n){return xr(this,r,t,n,!0)};a.prototype.lastIndexOf=function(r,t,n){return xr(this,r,t,n,!1)};function nt(e,r,t,n){t=Number(t)||0;var i=e.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;var o=r.length;n>o/2&&(n=o/2);for(var u=0;u<n;++u){var h=parseInt(r.substr(u*2,2),16);if(rr(h))return u;e[t+u]=h}return u}function it(e,r,t,n){return W(Q(r,e.length-t),e,t,n)}function ot(e,r,t,n){return W(xt(r),e,t,n)}function ut(e,r,t,n){return W(Fr(r),e,t,n)}function at(e,r,t,n){return W(mt(r,e.length-t),e,t,n)}a.prototype.write=function(r,t,n,i){if(t===void 0)i="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")i=t,n=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-t;if((n===void 0||n>o)&&(n=o),r.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var u=!1;;)switch(i){case"hex":return nt(this,r,t,n);case"utf8":case"utf-8":return it(this,r,t,n);case"ascii":case"latin1":case"binary":return ot(this,r,t,n);case"base64":return ut(this,r,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return at(this,r,t,n);default:if(u)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),u=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ft(e,r,t){return r===0&&t===e.length?X.fromByteArray(e):X.fromByteArray(e.slice(r,t))}function mr(e,r,t){t=Math.min(e.length,t);for(var n=[],i=r;i<t;){var o=e[i],u=null,h=o>239?4:o>223?3:o>191?2:1;if(i+h<=t){var f,c,s,p;switch(h){case 1:o<128&&(u=o);break;case 2:f=e[i+1],(f&192)===128&&(p=(o&31)<<6|f&63,p>127&&(u=p));break;case 3:f=e[i+1],c=e[i+2],(f&192)===128&&(c&192)===128&&(p=(o&15)<<12|(f&63)<<6|c&63,p>2047&&(p<55296||p>57343)&&(u=p));break;case 4:f=e[i+1],c=e[i+2],s=e[i+3],(f&192)===128&&(c&192)===128&&(s&192)===128&&(p=(o&15)<<18|(f&63)<<12|(c&63)<<6|s&63,p>65535&&p<1114112&&(u=p))}}u===null?(u=65533,h=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|u&1023),n.push(u),i+=h}return ht(n)}var sr=4096;function ht(e){var r=e.length;if(r<=sr)return String.fromCharCode.apply(String,e);for(var t="",n=0;n<r;)t+=String.fromCharCode.apply(String,e.slice(n,n+=sr));return t}function ct(e,r,t){var n="";t=Math.min(e.length,t);for(var i=r;i<t;++i)n+=String.fromCharCode(e[i]&127);return n}function pt(e,r,t){var n="";t=Math.min(e.length,t);for(var i=r;i<t;++i)n+=String.fromCharCode(e[i]);return n}function st(e,r,t){var n=e.length;(!r||r<0)&&(r=0),(!t||t<0||t>n)&&(t=n);for(var i="",o=r;o<t;++o)i+=Et[e[o]];return i}function lt(e,r,t){for(var n=e.slice(r,t),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}a.prototype.slice=function(r,t){var n=this.length;r=~~r,t=t===void 0?n:~~t,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<r&&(t=r);var i=this.subarray(r,t);return Object.setPrototypeOf(i,a.prototype),i};function w(e,r,t){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(r,t,n){r=r>>>0,t=t>>>0,n||w(r,t,this.length);for(var i=this[r],o=1,u=0;++u<t&&(o*=256);)i+=this[r+u]*o;return i};a.prototype.readUintBE=a.prototype.readUIntBE=function(r,t,n){r=r>>>0,t=t>>>0,n||w(r,t,this.length);for(var i=this[r+--t],o=1;t>0&&(o*=256);)i+=this[r+--t]*o;return i};a.prototype.readUint8=a.prototype.readUInt8=function(r,t){return r=r>>>0,t||w(r,1,this.length),this[r]};a.prototype.readUint16LE=a.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||w(r,2,this.length),this[r]|this[r+1]<<8};a.prototype.readUint16BE=a.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||w(r,2,this.length),this[r]<<8|this[r+1]};a.prototype.readUint32LE=a.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||w(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};a.prototype.readUint32BE=a.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};a.prototype.readIntLE=function(r,t,n){r=r>>>0,t=t>>>0,n||w(r,t,this.length);for(var i=this[r],o=1,u=0;++u<t&&(o*=256);)i+=this[r+u]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i};a.prototype.readIntBE=function(r,t,n){r=r>>>0,t=t>>>0,n||w(r,t,this.length);for(var i=t,o=1,u=this[r+--i];i>0&&(o*=256);)u+=this[r+--i]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*t)),u};a.prototype.readInt8=function(r,t){return r=r>>>0,t||w(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};a.prototype.readInt16LE=function(r,t){r=r>>>0,t||w(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};a.prototype.readInt16BE=function(r,t){r=r>>>0,t||w(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};a.prototype.readInt32LE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};a.prototype.readInt32BE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};a.prototype.readFloatLE=function(r,t){return r=r>>>0,t||w(r,4,this.length),O.read(this,r,!0,23,4)};a.prototype.readFloatBE=function(r,t){return r=r>>>0,t||w(r,4,this.length),O.read(this,r,!1,23,4)};a.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||w(r,8,this.length),O.read(this,r,!0,52,8)};a.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||w(r,8,this.length),O.read(this,r,!1,52,8)};function x(e,r,t,n,i,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(t+n>e.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(r,t,n,i){if(r=+r,t=t>>>0,n=n>>>0,!i){var o=Math.pow(2,8*n)-1;x(this,r,t,n,o,0)}var u=1,h=0;for(this[t]=r&255;++h<n&&(u*=256);)this[t+h]=r/u&255;return t+n};a.prototype.writeUintBE=a.prototype.writeUIntBE=function(r,t,n,i){if(r=+r,t=t>>>0,n=n>>>0,!i){var o=Math.pow(2,8*n)-1;x(this,r,t,n,o,0)}var u=n-1,h=1;for(this[t+u]=r&255;--u>=0&&(h*=256);)this[t+u]=r/h&255;return t+n};a.prototype.writeUint8=a.prototype.writeUInt8=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,1,255,0),this[t]=r&255,t+1};a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2};a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2};a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4};a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};a.prototype.writeIntLE=function(r,t,n,i){if(r=+r,t=t>>>0,!i){var o=Math.pow(2,8*n-1);x(this,r,t,n,o-1,-o)}var u=0,h=1,f=0;for(this[t]=r&255;++u<n&&(h*=256);)r<0&&f===0&&this[t+u-1]!==0&&(f=1),this[t+u]=(r/h>>0)-f&255;return t+n};a.prototype.writeIntBE=function(r,t,n,i){if(r=+r,t=t>>>0,!i){var o=Math.pow(2,8*n-1);x(this,r,t,n,o-1,-o)}var u=n-1,h=1,f=0;for(this[t+u]=r&255;--u>=0&&(h*=256);)r<0&&f===0&&this[t+u+1]!==0&&(f=1),this[t+u]=(r/h>>0)-f&255;return t+n};a.prototype.writeInt8=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1};a.prototype.writeInt16LE=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2};a.prototype.writeInt16BE=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2};a.prototype.writeInt32LE=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4};a.prototype.writeInt32BE=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function Er(e,r,t,n,i,o){if(t+n>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Tr(e,r,t,n,i){return r=+r,t=t>>>0,i||Er(e,r,t,4,34028234663852886e22,-34028234663852886e22),O.write(e,r,t,n,23,4),t+4}a.prototype.writeFloatLE=function(r,t,n){return Tr(this,r,t,!0,n)};a.prototype.writeFloatBE=function(r,t,n){return Tr(this,r,t,!1,n)};function gr(e,r,t,n,i){return r=+r,t=t>>>0,i||Er(e,r,t,8,17976931348623157e292,-17976931348623157e292),O.write(e,r,t,n,52,8),t+8}a.prototype.writeDoubleLE=function(r,t,n){return gr(this,r,t,!0,n)};a.prototype.writeDoubleBE=function(r,t,n){return gr(this,r,t,!1,n)};a.prototype.copy=function(r,t,n,i){if(!a.isBuffer(r))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),t>=r.length&&(t=r.length),t||(t=0),i>0&&i<n&&(i=n),i===n||r.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-t<i-n&&(i=r.length-t+n);var o=i-n;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,n,i):Uint8Array.prototype.set.call(r,this.subarray(n,i),t),o};a.prototype.fill=function(r,t,n,i){if(typeof r=="string"){if(typeof t=="string"?(i=t,t=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!a.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(r.length===1){var o=r.charCodeAt(0);(i==="utf8"&&o<128||i==="latin1")&&(r=o)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var u;if(typeof r=="number")for(u=t;u<n;++u)this[u]=r;else{var h=a.isBuffer(r)?r:a.from(r,i),f=h.length;if(f===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(u=0;u<n-t;++u)this[u+t]=h[u%f]}return this};var yt=/[^+/0-9A-Za-z-_]/g;function wt(e){if(e=e.split("=")[0],e=e.trim().replace(yt,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Q(e,r){r=r||1/0;for(var t,n=e.length,i=null,o=[],u=0;u<n;++u){if(t=e.charCodeAt(u),t>55295&&t<57344){if(!i){if(t>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(u+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=t;continue}if(t<56320){(r-=3)>-1&&o.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,t<128){if((r-=1)<0)break;o.push(t)}else if(t<2048){if((r-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}function xt(e){for(var r=[],t=0;t<e.length;++t)r.push(e.charCodeAt(t)&255);return r}function mt(e,r){for(var t,n,i,o=[],u=0;u<e.length&&!((r-=2)<0);++u)t=e.charCodeAt(u),n=t>>8,i=t%256,o.push(i),o.push(n);return o}function Fr(e){return X.toByteArray(wt(e))}function W(e,r,t,n){for(var i=0;i<n&&!(i+t>=r.length||i>=e.length);++i)r[i+t]=e[i];return i}function A(e,r){return e instanceof r||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===r.name}function rr(e){return e!==e}var Et=function(){for(var e="0123456789abcdef",r=new Array(256),t=0;t<16;++t)for(var n=t*16,i=0;i<16;++i)r[n+i]=e[t]+e[i];return r}()});var Nr=H((Ct,dr)=>{l();var y=dr.exports={},v,d;function tr(){throw new Error("setTimeout has not been defined")}function er(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?v=setTimeout:v=tr}catch(e){v=tr}try{typeof clearTimeout=="function"?d=clearTimeout:d=er}catch(e){d=er}})();function Ir(e){if(v===setTimeout)return setTimeout(e,0);if((v===tr||!v)&&setTimeout)return v=setTimeout,setTimeout(e,0);try{return v(e,0)}catch(r){try{return v.call(null,e,0)}catch(t){return v.call(this,e,0)}}}function Tt(e){if(d===clearTimeout)return clearTimeout(e);if((d===er||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(r){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}var C=[],M=!1,L,K=-1;function gt(){!M||!L||(M=!1,L.length?C=L.concat(C):K=-1,C.length&&Ar())}function Ar(){if(!M){var e=Ir(gt);M=!0;for(var r=C.length;r;){for(L=C,C=[];++K<r;)L&&L[K].run();K=-1,r=C.length}L=null,M=!1,Tt(e)}}y.nextTick=function(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)r[t-1]=arguments[t];C.push(new vr(e,r)),C.length===1&&!M&&Ir(Ar)};function vr(e,r){this.fun=e,this.array=r}vr.prototype.run=function(){this.fun.apply(null,this.array)};y.title="browser";y.browser=!0;y.env={};y.argv=[];y.version="";y.versions={};function S(){}y.on=S;y.addListener=S;y.once=S;y.off=S;y.removeListener=S;y.removeAllListeners=S;y.emit=S;y.prependListener=S;y.prependOnceListener=S;y.listeners=function(e){return[]};y.binding=function(e){throw new Error("process.binding is not supported")};y.cwd=function(){return"/"};y.chdir=function(e){throw new Error("process.chdir is not supported")};y.umask=function(){return 0}});var B,I,St,l=Hr(()=>{B=Y(Br()),I=Y(Nr()),St=function(e){function r(){var n=this||self;return delete e.prototype.__magic__,n}if(typeof globalThis=="object")return globalThis;if(this)return r();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:r});var t=__magic__;return t}(Object)});var At={};Gr(At,{getLatestBlockHash:()=>Bt});module.exports=Vr(At);l();var Dr=Y(require("axios"));l();var Ur="blocks";l();l();l();function Cr(e){return g(this,null,function*(){return yield new Promise(r=>{setTimeout(()=>r(),e)})})}l();var Sr=(e,r,t,n=0)=>g(void 0,null,function*(){try{return yield e(...t)}catch(i){return n<r.retries?((r==null?void 0:r.delay)!=null&&(yield Cr(r.delay)),yield Sr(e,r,t,n+1)):null}}),_r=(e,r={retries:5,delay:500})=>(...t)=>g(void 0,null,function*(){return yield Sr(e,r,t)});var Lr=3e4,nr=null,b={current:null},ir={current:!1},Ft=_r((e,r)=>g(void 0,null,function*(){let{data:t}=yield Dr.default.get(`${e}/${Ur}?from=3&size=1&fields=hash,timestamp${r?"&shard="+r:""}`),[n]=t;return n}));function Bt(e,r){return g(this,null,function*(){if(e==null)throw new Error("missing api url");if(nr!=null&&Date.now()<nr&&b.current!=null)return b.current;{if(ir.current)return yield It();ir.current=!0,b.current=null;let n=yield Ft(e,r);return b.current=n,nr=Date.now()+Lr,ir.current=!1,n}})}function It(){return g(this,null,function*(){return new Promise((e,r)=>{let t,n=setInterval(()=>{b.current!=null&&(clearInterval(n),clearTimeout(t),e(b.current))},50);t=setTimeout(()=>{clearInterval(n),r("could not generate new token")},Lr)})})}0&&(module.exports={getLatestBlockHash});
|
|
1
|
+
"use strict";var Lr=Object.create;var P=Object.defineProperty;var Or=Object.getOwnPropertyDescriptor;var Rr=Object.getOwnPropertyNames;var kr=Object.getPrototypeOf,Mr=Object.prototype.hasOwnProperty;var br=(e,r)=>()=>(e&&(r=e(e=0)),r);var H=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Pr=(e,r)=>{for(var t in r)P(e,t,{get:r[t],enumerable:!0})},ir=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Rr(r))!Mr.call(e,i)&&i!==t&&P(e,i,{get:()=>r[i],enumerable:!(n=Or(r,i))||n.enumerable});return e};var V=(e,r,t)=>(t=e!=null?Lr(kr(e)):{},ir(r||!e||!e.__esModule?P(t,"default",{value:e,enumerable:!0}):t,e)),Hr=e=>ir(P({},"__esModule",{value:!0}),e);var N=(e,r,t)=>new Promise((n,i)=>{var o=h=>{try{c(t.next(h))}catch(f){i(f)}},u=h=>{try{c(t.throw(h))}catch(f){i(f)}},c=h=>h.done?n(h.value):Promise.resolve(h.value).then(o,u);c((t=t.apply(e,r)).next())});var ar=H(W=>{"use strict";l();W.byteLength=Kr;W.toByteArray=Gr;W.fromByteArray=Xr;var g=[],E=[],Wr=typeof Uint8Array!="undefined"?Uint8Array:Array,X="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(_=0,or=X.length;_<or;++_)g[_]=X[_],E[X.charCodeAt(_)]=_;var _,or;E["-".charCodeAt(0)]=62;E["_".charCodeAt(0)]=63;function ur(e){var r=e.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");t===-1&&(t=r);var n=t===r?0:4-t%4;return[t,n]}function Kr(e){var r=ur(e),t=r[0],n=r[1];return(t+n)*3/4-n}function qr(e,r,t){return(r+t)*3/4-t}function Gr(e){var r,t=ur(e),n=t[0],i=t[1],o=new Wr(qr(e,n,i)),u=0,c=i>0?n-4:n,h;for(h=0;h<c;h+=4)r=E[e.charCodeAt(h)]<<18|E[e.charCodeAt(h+1)]<<12|E[e.charCodeAt(h+2)]<<6|E[e.charCodeAt(h+3)],o[u++]=r>>16&255,o[u++]=r>>8&255,o[u++]=r&255;return i===2&&(r=E[e.charCodeAt(h)]<<2|E[e.charCodeAt(h+1)]>>4,o[u++]=r&255),i===1&&(r=E[e.charCodeAt(h)]<<10|E[e.charCodeAt(h+1)]<<4|E[e.charCodeAt(h+2)]>>2,o[u++]=r>>8&255,o[u++]=r&255),o}function Yr(e){return g[e>>18&63]+g[e>>12&63]+g[e>>6&63]+g[e&63]}function Vr(e,r,t){for(var n,i=[],o=r;o<t;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),i.push(Yr(n));return i.join("")}function Xr(e){for(var r,t=e.length,n=t%3,i=[],o=16383,u=0,c=t-n;u<c;u+=o)i.push(Vr(e,u,u+o>c?c:u+o));return n===1?(r=e[t-1],i.push(g[r>>2]+g[r<<4&63]+"==")):n===2&&(r=(e[t-2]<<8)+e[t-1],i.push(g[r>>10]+g[r>>4&63]+g[r<<2&63]+"=")),i.join("")}});var hr=H($=>{l();$.read=function(e,r,t,n,i){var o,u,c=i*8-n-1,h=(1<<c)-1,f=h>>1,s=-7,p=t?i-1:0,T=t?-1:1,m=e[r+p];for(p+=T,o=m&(1<<-s)-1,m>>=-s,s+=c;s>0;o=o*256+e[r+p],p+=T,s-=8);for(u=o&(1<<-s)-1,o>>=-s,s+=n;s>0;u=u*256+e[r+p],p+=T,s-=8);if(o===0)o=1-f;else{if(o===h)return u?NaN:(m?-1:1)*(1/0);u=u+Math.pow(2,n),o=o-f}return(m?-1:1)*u*Math.pow(2,o-n)};$.write=function(e,r,t,n,i,o){var u,c,h,f=o*8-i-1,s=(1<<f)-1,p=s>>1,T=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:o-1,R=n?1:-1,Dr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,u=s):(u=Math.floor(Math.log(r)/Math.LN2),r*(h=Math.pow(2,-u))<1&&(u--,h*=2),u+p>=1?r+=T/h:r+=T*Math.pow(2,1-p),r*h>=2&&(u++,h/=2),u+p>=s?(c=0,u=s):u+p>=1?(c=(r*h-1)*Math.pow(2,i),u=u+p):(c=r*Math.pow(2,p-1)*Math.pow(2,i),u=0));i>=8;e[t+m]=c&255,m+=R,c/=256,i-=8);for(u=u<<i|c,f+=i;f>0;e[t+m]=u&255,m+=R,u/=256,f-=8);e[t+m-R]|=Dr*128}});var Fr=H(M=>{"use strict";l();var z=ar(),k=hr(),cr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;M.Buffer=a;M.SlowBuffer=jr;M.INSPECT_MAX_BYTES=50;var K=2147483647;M.kMaxLength=K;a.TYPED_ARRAY_SUPPORT=$r();!a.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function $r(){try{var e=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(e,r),e.foo()===42}catch(t){return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(!!a.isBuffer(this))return this.buffer}});Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(!!a.isBuffer(this))return this.byteOffset}});function d(e){if(e>K)throw new RangeError('The value "'+e+'" is invalid for option "size"');var r=new Uint8Array(e);return Object.setPrototypeOf(r,a.prototype),r}function a(e,r,t){if(typeof e=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return j(e)}return sr(e,r,t)}a.poolSize=8192;function sr(e,r,t){if(typeof e=="string")return Jr(e,r);if(ArrayBuffer.isView(e))return Qr(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(A(e,ArrayBuffer)||e&&A(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(A(e,SharedArrayBuffer)||e&&A(e.buffer,SharedArrayBuffer)))return Q(e,r,t);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return a.from(n,r,t);var i=Zr(e);if(i)return i;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return a.from(e[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}a.from=function(e,r,t){return sr(e,r,t)};Object.setPrototypeOf(a.prototype,Uint8Array.prototype);Object.setPrototypeOf(a,Uint8Array);function lr(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function zr(e,r,t){return lr(e),e<=0?d(e):r!==void 0?typeof t=="string"?d(e).fill(r,t):d(e).fill(r):d(e)}a.alloc=function(e,r,t){return zr(e,r,t)};function j(e){return lr(e),d(e<0?0:rr(e)|0)}a.allocUnsafe=function(e){return j(e)};a.allocUnsafeSlow=function(e){return j(e)};function Jr(e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var t=yr(e,r)|0,n=d(t),i=n.write(e,r);return i!==t&&(n=n.slice(0,i)),n}function J(e){for(var r=e.length<0?0:rr(e.length)|0,t=d(r),n=0;n<r;n+=1)t[n]=e[n]&255;return t}function Qr(e){if(A(e,Uint8Array)){var r=new Uint8Array(e);return Q(r.buffer,r.byteOffset,r.byteLength)}return J(e)}function Q(e,r,t){if(r<0||e.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<r+(t||0))throw new RangeError('"length" is outside of buffer bounds');var n;return r===void 0&&t===void 0?n=new Uint8Array(e):t===void 0?n=new Uint8Array(e,r):n=new Uint8Array(e,r,t),Object.setPrototypeOf(n,a.prototype),n}function Zr(e){if(a.isBuffer(e)){var r=rr(e.length)|0,t=d(r);return t.length===0||e.copy(t,0,0,r),t}if(e.length!==void 0)return typeof e.length!="number"||tr(e.length)?d(0):J(e);if(e.type==="Buffer"&&Array.isArray(e.data))return J(e.data)}function rr(e){if(e>=K)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K.toString(16)+" bytes");return e|0}function jr(e){return+e!=e&&(e=0),a.alloc(+e)}a.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==a.prototype};a.compare=function(r,t){if(A(r,Uint8Array)&&(r=a.from(r,r.offset,r.byteLength)),A(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(r)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===t)return 0;for(var n=r.length,i=t.length,o=0,u=Math.min(n,i);o<u;++o)if(r[o]!==t[o]){n=r[o],i=t[o];break}return n<i?-1:i<n?1:0};a.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};a.concat=function(r,t){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return a.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<r.length;++n)t+=r[n].length;var i=a.allocUnsafe(t),o=0;for(n=0;n<r.length;++n){var u=r[n];if(A(u,Uint8Array))o+u.length>i.length?a.from(u).copy(i,o):Uint8Array.prototype.set.call(i,u,o);else if(a.isBuffer(u))u.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=u.length}return i};function yr(e,r){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||A(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var t=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return Z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return gr(e).length;default:if(i)return n?-1:Z(e).length;r=(""+r).toLowerCase(),i=!0}}a.byteLength=yr;function rt(e,r,t){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return ft(this,r,t);case"utf8":case"utf-8":return xr(this,r,t);case"ascii":return ht(this,r,t);case"latin1":case"binary":return ct(this,r,t);case"base64":return ut(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pt(this,r,t);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}a.prototype._isBuffer=!0;function D(e,r,t){var n=e[r];e[r]=e[t],e[t]=n}a.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<r;t+=2)D(this,t,t+1);return this};a.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<r;t+=4)D(this,t,t+3),D(this,t+1,t+2);return this};a.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<r;t+=8)D(this,t,t+7),D(this,t+1,t+6),D(this,t+2,t+5),D(this,t+3,t+4);return this};a.prototype.toString=function(){var r=this.length;return r===0?"":arguments.length===0?xr(this,0,r):rt.apply(this,arguments)};a.prototype.toLocaleString=a.prototype.toString;a.prototype.equals=function(r){if(!a.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:a.compare(this,r)===0};a.prototype.inspect=function(){var r="",t=M.INSPECT_MAX_BYTES;return r=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(r+=" ... "),"<Buffer "+r+">"};cr&&(a.prototype[cr]=a.prototype.inspect);a.prototype.compare=function(r,t,n,i,o){if(A(r,Uint8Array)&&(r=a.from(r,r.offset,r.byteLength)),!a.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(t===void 0&&(t=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),t<0||n>r.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&t>=n)return 0;if(i>=o)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,o>>>=0,this===r)return 0;for(var u=o-i,c=n-t,h=Math.min(u,c),f=this.slice(i,o),s=r.slice(t,n),p=0;p<h;++p)if(f[p]!==s[p]){u=f[p],c=s[p];break}return u<c?-1:c<u?1:0};function wr(e,r,t,n,i){if(e.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,tr(t)&&(t=i?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(i)return-1;t=e.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof r=="string"&&(r=a.from(r,n)),a.isBuffer(r))return r.length===0?-1:fr(e,r,t,n,i);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):fr(e,[r],t,n,i);throw new TypeError("val must be string, number or Buffer")}function fr(e,r,t,n,i){var o=1,u=e.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||r.length<2)return-1;o=2,u/=2,c/=2,t/=2}function h(m,R){return o===1?m[R]:m.readUInt16BE(R*o)}var f;if(i){var s=-1;for(f=t;f<u;f++)if(h(e,f)===h(r,s===-1?0:f-s)){if(s===-1&&(s=f),f-s+1===c)return s*o}else s!==-1&&(f-=f-s),s=-1}else for(t+c>u&&(t=u-c),f=t;f>=0;f--){for(var p=!0,T=0;T<c;T++)if(h(e,f+T)!==h(r,T)){p=!1;break}if(p)return f}return-1}a.prototype.includes=function(r,t,n){return this.indexOf(r,t,n)!==-1};a.prototype.indexOf=function(r,t,n){return wr(this,r,t,n,!0)};a.prototype.lastIndexOf=function(r,t,n){return wr(this,r,t,n,!1)};function tt(e,r,t,n){t=Number(t)||0;var i=e.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;var o=r.length;n>o/2&&(n=o/2);for(var u=0;u<n;++u){var c=parseInt(r.substr(u*2,2),16);if(tr(c))return u;e[t+u]=c}return u}function et(e,r,t,n){return q(Z(r,e.length-t),e,t,n)}function nt(e,r,t,n){return q(yt(r),e,t,n)}function it(e,r,t,n){return q(gr(r),e,t,n)}function ot(e,r,t,n){return q(wt(r,e.length-t),e,t,n)}a.prototype.write=function(r,t,n,i){if(t===void 0)i="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")i=t,n=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-t;if((n===void 0||n>o)&&(n=o),r.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var u=!1;;)switch(i){case"hex":return tt(this,r,t,n);case"utf8":case"utf-8":return et(this,r,t,n);case"ascii":case"latin1":case"binary":return nt(this,r,t,n);case"base64":return it(this,r,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ot(this,r,t,n);default:if(u)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),u=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ut(e,r,t){return r===0&&t===e.length?z.fromByteArray(e):z.fromByteArray(e.slice(r,t))}function xr(e,r,t){t=Math.min(e.length,t);for(var n=[],i=r;i<t;){var o=e[i],u=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c<=t){var h,f,s,p;switch(c){case 1:o<128&&(u=o);break;case 2:h=e[i+1],(h&192)===128&&(p=(o&31)<<6|h&63,p>127&&(u=p));break;case 3:h=e[i+1],f=e[i+2],(h&192)===128&&(f&192)===128&&(p=(o&15)<<12|(h&63)<<6|f&63,p>2047&&(p<55296||p>57343)&&(u=p));break;case 4:h=e[i+1],f=e[i+2],s=e[i+3],(h&192)===128&&(f&192)===128&&(s&192)===128&&(p=(o&15)<<18|(h&63)<<12|(f&63)<<6|s&63,p>65535&&p<1114112&&(u=p))}}u===null?(u=65533,c=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|u&1023),n.push(u),i+=c}return at(n)}var pr=4096;function at(e){var r=e.length;if(r<=pr)return String.fromCharCode.apply(String,e);for(var t="",n=0;n<r;)t+=String.fromCharCode.apply(String,e.slice(n,n+=pr));return t}function ht(e,r,t){var n="";t=Math.min(e.length,t);for(var i=r;i<t;++i)n+=String.fromCharCode(e[i]&127);return n}function ct(e,r,t){var n="";t=Math.min(e.length,t);for(var i=r;i<t;++i)n+=String.fromCharCode(e[i]);return n}function ft(e,r,t){var n=e.length;(!r||r<0)&&(r=0),(!t||t<0||t>n)&&(t=n);for(var i="",o=r;o<t;++o)i+=xt[e[o]];return i}function pt(e,r,t){for(var n=e.slice(r,t),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}a.prototype.slice=function(r,t){var n=this.length;r=~~r,t=t===void 0?n:~~t,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<r&&(t=r);var i=this.subarray(r,t);return Object.setPrototypeOf(i,a.prototype),i};function w(e,r,t){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(r,t,n){r=r>>>0,t=t>>>0,n||w(r,t,this.length);for(var i=this[r],o=1,u=0;++u<t&&(o*=256);)i+=this[r+u]*o;return i};a.prototype.readUintBE=a.prototype.readUIntBE=function(r,t,n){r=r>>>0,t=t>>>0,n||w(r,t,this.length);for(var i=this[r+--t],o=1;t>0&&(o*=256);)i+=this[r+--t]*o;return i};a.prototype.readUint8=a.prototype.readUInt8=function(r,t){return r=r>>>0,t||w(r,1,this.length),this[r]};a.prototype.readUint16LE=a.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||w(r,2,this.length),this[r]|this[r+1]<<8};a.prototype.readUint16BE=a.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||w(r,2,this.length),this[r]<<8|this[r+1]};a.prototype.readUint32LE=a.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||w(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};a.prototype.readUint32BE=a.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};a.prototype.readIntLE=function(r,t,n){r=r>>>0,t=t>>>0,n||w(r,t,this.length);for(var i=this[r],o=1,u=0;++u<t&&(o*=256);)i+=this[r+u]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i};a.prototype.readIntBE=function(r,t,n){r=r>>>0,t=t>>>0,n||w(r,t,this.length);for(var i=t,o=1,u=this[r+--i];i>0&&(o*=256);)u+=this[r+--i]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*t)),u};a.prototype.readInt8=function(r,t){return r=r>>>0,t||w(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};a.prototype.readInt16LE=function(r,t){r=r>>>0,t||w(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};a.prototype.readInt16BE=function(r,t){r=r>>>0,t||w(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};a.prototype.readInt32LE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};a.prototype.readInt32BE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};a.prototype.readFloatLE=function(r,t){return r=r>>>0,t||w(r,4,this.length),k.read(this,r,!0,23,4)};a.prototype.readFloatBE=function(r,t){return r=r>>>0,t||w(r,4,this.length),k.read(this,r,!1,23,4)};a.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||w(r,8,this.length),k.read(this,r,!0,52,8)};a.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||w(r,8,this.length),k.read(this,r,!1,52,8)};function x(e,r,t,n,i,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(t+n>e.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(r,t,n,i){if(r=+r,t=t>>>0,n=n>>>0,!i){var o=Math.pow(2,8*n)-1;x(this,r,t,n,o,0)}var u=1,c=0;for(this[t]=r&255;++c<n&&(u*=256);)this[t+c]=r/u&255;return t+n};a.prototype.writeUintBE=a.prototype.writeUIntBE=function(r,t,n,i){if(r=+r,t=t>>>0,n=n>>>0,!i){var o=Math.pow(2,8*n)-1;x(this,r,t,n,o,0)}var u=n-1,c=1;for(this[t+u]=r&255;--u>=0&&(c*=256);)this[t+u]=r/c&255;return t+n};a.prototype.writeUint8=a.prototype.writeUInt8=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,1,255,0),this[t]=r&255,t+1};a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2};a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2};a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4};a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};a.prototype.writeIntLE=function(r,t,n,i){if(r=+r,t=t>>>0,!i){var o=Math.pow(2,8*n-1);x(this,r,t,n,o-1,-o)}var u=0,c=1,h=0;for(this[t]=r&255;++u<n&&(c*=256);)r<0&&h===0&&this[t+u-1]!==0&&(h=1),this[t+u]=(r/c>>0)-h&255;return t+n};a.prototype.writeIntBE=function(r,t,n,i){if(r=+r,t=t>>>0,!i){var o=Math.pow(2,8*n-1);x(this,r,t,n,o-1,-o)}var u=n-1,c=1,h=0;for(this[t+u]=r&255;--u>=0&&(c*=256);)r<0&&h===0&&this[t+u+1]!==0&&(h=1),this[t+u]=(r/c>>0)-h&255;return t+n};a.prototype.writeInt8=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1};a.prototype.writeInt16LE=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2};a.prototype.writeInt16BE=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2};a.prototype.writeInt32LE=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4};a.prototype.writeInt32BE=function(r,t,n){return r=+r,t=t>>>0,n||x(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function mr(e,r,t,n,i,o){if(t+n>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Er(e,r,t,n,i){return r=+r,t=t>>>0,i||mr(e,r,t,4,34028234663852886e22,-34028234663852886e22),k.write(e,r,t,n,23,4),t+4}a.prototype.writeFloatLE=function(r,t,n){return Er(this,r,t,!0,n)};a.prototype.writeFloatBE=function(r,t,n){return Er(this,r,t,!1,n)};function Tr(e,r,t,n,i){return r=+r,t=t>>>0,i||mr(e,r,t,8,17976931348623157e292,-17976931348623157e292),k.write(e,r,t,n,52,8),t+8}a.prototype.writeDoubleLE=function(r,t,n){return Tr(this,r,t,!0,n)};a.prototype.writeDoubleBE=function(r,t,n){return Tr(this,r,t,!1,n)};a.prototype.copy=function(r,t,n,i){if(!a.isBuffer(r))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),t>=r.length&&(t=r.length),t||(t=0),i>0&&i<n&&(i=n),i===n||r.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-t<i-n&&(i=r.length-t+n);var o=i-n;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,n,i):Uint8Array.prototype.set.call(r,this.subarray(n,i),t),o};a.prototype.fill=function(r,t,n,i){if(typeof r=="string"){if(typeof t=="string"?(i=t,t=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!a.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(r.length===1){var o=r.charCodeAt(0);(i==="utf8"&&o<128||i==="latin1")&&(r=o)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var u;if(typeof r=="number")for(u=t;u<n;++u)this[u]=r;else{var c=a.isBuffer(r)?r:a.from(r,i),h=c.length;if(h===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(u=0;u<n-t;++u)this[u+t]=c[u%h]}return this};var st=/[^+/0-9A-Za-z-_]/g;function lt(e){if(e=e.split("=")[0],e=e.trim().replace(st,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Z(e,r){r=r||1/0;for(var t,n=e.length,i=null,o=[],u=0;u<n;++u){if(t=e.charCodeAt(u),t>55295&&t<57344){if(!i){if(t>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(u+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=t;continue}if(t<56320){(r-=3)>-1&&o.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,t<128){if((r-=1)<0)break;o.push(t)}else if(t<2048){if((r-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}function yt(e){for(var r=[],t=0;t<e.length;++t)r.push(e.charCodeAt(t)&255);return r}function wt(e,r){for(var t,n,i,o=[],u=0;u<e.length&&!((r-=2)<0);++u)t=e.charCodeAt(u),n=t>>8,i=t%256,o.push(i),o.push(n);return o}function gr(e){return z.toByteArray(lt(e))}function q(e,r,t,n){for(var i=0;i<n&&!(i+t>=r.length||i>=e.length);++i)r[i+t]=e[i];return i}function A(e,r){return e instanceof r||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===r.name}function tr(e){return e!==e}var xt=function(){for(var e="0123456789abcdef",r=new Array(256),t=0;t<16;++t)for(var n=t*16,i=0;i<16;++i)r[n+i]=e[t]+e[i];return r}()});var Nr=H((dt,vr)=>{l();var y=vr.exports={},I,v;function er(){throw new Error("setTimeout has not been defined")}function nr(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?I=setTimeout:I=er}catch(e){I=er}try{typeof clearTimeout=="function"?v=clearTimeout:v=nr}catch(e){v=nr}})();function Br(e){if(I===setTimeout)return setTimeout(e,0);if((I===er||!I)&&setTimeout)return I=setTimeout,setTimeout(e,0);try{return I(e,0)}catch(r){try{return I.call(null,e,0)}catch(t){return I.call(this,e,0)}}}function mt(e){if(v===clearTimeout)return clearTimeout(e);if((v===nr||!v)&&clearTimeout)return v=clearTimeout,clearTimeout(e);try{return v(e)}catch(r){try{return v.call(null,e)}catch(t){return v.call(this,e)}}}var C=[],b=!1,L,G=-1;function Et(){!b||!L||(b=!1,L.length?C=L.concat(C):G=-1,C.length&&Ar())}function Ar(){if(!b){var e=Br(Et);b=!0;for(var r=C.length;r;){for(L=C,C=[];++G<r;)L&&L[G].run();G=-1,r=C.length}L=null,b=!1,mt(e)}}y.nextTick=function(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)r[t-1]=arguments[t];C.push(new Ir(e,r)),C.length===1&&!b&&Br(Ar)};function Ir(e,r){this.fun=e,this.array=r}Ir.prototype.run=function(){this.fun.apply(null,this.array)};y.title="browser";y.browser=!0;y.env={};y.argv=[];y.version="";y.versions={};function S(){}y.on=S;y.addListener=S;y.once=S;y.off=S;y.removeListener=S;y.removeAllListeners=S;y.emit=S;y.prependListener=S;y.prependOnceListener=S;y.listeners=function(e){return[]};y.binding=function(e){throw new Error("process.binding is not supported")};y.cwd=function(){return"/"};y.chdir=function(e){throw new Error("process.chdir is not supported")};y.umask=function(){return 0}});var F,B,Ct,l=br(()=>{F=V(Fr()),B=V(Nr()),Ct=function(e){function r(){var n=this||self;return delete e.prototype.__magic__,n}if(typeof globalThis=="object")return globalThis;if(this)return r();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:r});var t=__magic__;return t}(Object)});var At={};Pr(At,{getLatestBlockHash:()=>Bt});module.exports=Hr(At);l();var _r=V(require("axios"));l();var Ur="blocks";l();l();l();function dr(e){return N(this,null,function*(){return yield new Promise(r=>{setTimeout(()=>r(),e)})})}l();var Cr=(e,r,t,n=0)=>N(void 0,null,function*(){try{return yield e(...t)}catch(i){return n<r.retries?((r==null?void 0:r.delay)!=null&&(yield dr(r.delay)),yield Cr(e,r,t,n+1)):null}}),Sr=(e,r={retries:5,delay:500})=>(...t)=>N(void 0,null,function*(){return yield Cr(e,r,t)});var Tt=4,gt=3e4,Y={current:null},O={current:null},Ft=Sr((e,r)=>N(void 0,null,function*(){let{data:t}=yield _r.default.get(`${e}/${Ur}?from=${Tt}&size=1&fields=hash,timestamp${r?"&shard="+r:""}`),[n]=t;return n}));function Bt(e,r){return N(this,null,function*(){if(e==null)throw new Error("missing api url");if(Y.current!=null&&Date.now()<Y.current.timestamp*1e3+gt)return Y.current;if(O.current!=null)return yield O.current;O.current=Ft(e,r);try{let t=yield O.current;if(t==null)throw O.current=null,new Error("could not get block hash");return Y.current={hash:t.hash,timestamp:t.timestamp},O.current=null,t}catch(t){return O.current=null,null}})}0&&(module.exports={getLatestBlockHash});
|
|
2
2
|
/*!
|
|
3
3
|
* The buffer module from node.js, for the browser.
|
|
4
4
|
*
|