@multiversx/sdk-dapp 2.10.0 → 2.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/UI/DappModal/hooks/index.js +1 -1
  2. package/UI/DappModal/hooks/useDappModal.js +1 -1
  3. package/UI/DappModal/index.js +1 -1
  4. package/UI/ModalContainer/ModalContainer.js +1 -1
  5. package/UI/ModalContainer/index.js +1 -1
  6. package/UI/NotificationModal/index.js +1 -1
  7. package/UI/SignTransactionsModals/SignTransactionsModals.js +1 -1
  8. package/UI/SignTransactionsModals/SignWithDeviceModal/SignStep.js +1 -1
  9. package/UI/SignTransactionsModals/SignWithDeviceModal/index.js +1 -1
  10. package/UI/SignTransactionsModals/SignWithExtensionModal/index.js +1 -1
  11. package/UI/SignTransactionsModals/SignWithLedgerModal/index.js +1 -1
  12. package/UI/SignTransactionsModals/SignWithOperaModal/index.js +1 -1
  13. package/UI/SignTransactionsModals/SignWithWalletConnectModal/index.js +1 -1
  14. package/UI/SignTransactionsModals/components/ConfirmationScreen.js +1 -1
  15. package/UI/SignTransactionsModals/components/DeviceConfirmationScreen.js +1 -1
  16. package/UI/SignTransactionsModals/components/index.js +1 -1
  17. package/UI/SignTransactionsModals/index.js +1 -1
  18. package/UI/TransactionInfo/TransactionInfo.js +1 -1
  19. package/UI/TransactionInfo/components/NonceMessage/NonceMessage.js +1 -1
  20. package/UI/TransactionInfo/components/NonceMessage/index.js +1 -1
  21. package/UI/TransactionInfo/components/index.js +1 -1
  22. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoNonce/TransactionInfoNonce.js +1 -1
  23. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoNonce/index.js +1 -1
  24. package/UI/TransactionInfo/components/transactionInfoFields/index.js +1 -1
  25. package/UI/TransactionInfo/index.js +1 -1
  26. package/UI/TransactionsTable/TransactionsTable.js +1 -1
  27. package/UI/TransactionsTable/index.js +1 -1
  28. package/UI/TransactionsToastList/TransactionsToastList.js +1 -1
  29. package/UI/TransactionsToastList/components/TransactionToast/TransactionToast.js +1 -1
  30. package/UI/TransactionsToastList/components/TransactionToast/hooks/useTransactionToast.js +1 -1
  31. package/UI/TransactionsToastList/components/TransactionToast/index.js +1 -1
  32. package/UI/TransactionsToastList/components/TransactionToastGuard.js +1 -1
  33. package/UI/TransactionsToastList/components/index.js +1 -1
  34. package/UI/TransactionsToastList/index.js +1 -1
  35. package/UI/extension/ExtensionLoginButton/index.js +1 -1
  36. package/UI/index.js +1 -1
  37. package/UI/ledger/LedgerLoginButton/index.js +1 -1
  38. package/UI/ledger/LedgerLoginContainer/ConfirmAddress.js +1 -1
  39. package/UI/ledger/LedgerLoginContainer/index.js +1 -1
  40. package/UI/ledger/index.js +1 -1
  41. package/UI/operaWallet/OperaWalletLoginButton/index.js +1 -1
  42. package/UI/pages/UnlockPage/index.js +1 -1
  43. package/UI/pages/index.js +1 -1
  44. package/UI/walletConnect/WalletConnectLoginButton/index.js +1 -1
  45. package/UI/walletConnect/WalletConnectLoginContainer/index.js +1 -1
  46. package/UI/walletConnect/index.js +1 -1
  47. package/UI/webWallet/WebWalletLoginButton/index.js +1 -1
  48. package/__chunks__/{chunk-PXLDGKC4.js → chunk-23C7PSCU.js} +2 -2
  49. package/__chunks__/{chunk-MXMO5VOA.js → chunk-62LPCEWI.js} +2 -2
  50. package/__chunks__/chunk-6DYUOTME.js +2 -0
  51. package/__chunks__/{chunk-6QEOI4LP.js → chunk-7KZPFHA7.js} +2 -2
  52. package/__chunks__/{chunk-XWZAWT7G.js → chunk-AWQPH4LC.js} +1 -1
  53. package/__chunks__/{chunk-AE66JOMW.js → chunk-BM4XGIZN.js} +2 -2
  54. package/__chunks__/{chunk-UJNUZKVY.js → chunk-F5O3Z6FA.js} +2 -2
  55. package/__chunks__/{chunk-KWMPPLTR.js → chunk-GYT7W4IV.js} +2 -2
  56. package/__chunks__/chunk-HFLWYN2V.js +2 -0
  57. package/__chunks__/{chunk-ZXAUVMQ6.js → chunk-HQYYJGF4.js} +2 -2
  58. package/__chunks__/{chunk-M3DCFIB7.js → chunk-K3WF2VCZ.js} +2 -2
  59. package/__chunks__/{chunk-J32KR5O6.js → chunk-KDSNYB35.js} +2 -2
  60. package/__chunks__/{chunk-3JKM5GE5.js → chunk-KYFQ6IIQ.js} +2 -2
  61. package/__chunks__/{chunk-NA7BBONT.js → chunk-MYBMSS23.js} +2 -2
  62. package/__chunks__/{chunk-TMIKWYU6.js → chunk-QVIRQKAN.js} +2 -2
  63. package/__chunks__/{chunk-TR2J6DEL.js → chunk-U5LSCOHZ.js} +2 -2
  64. package/__chunks__/{chunk-BTPDVQON.js → chunk-UNWWLB6H.js} +2 -2
  65. package/__chunks__/{chunk-OGY2VJHG.js → chunk-VH5YTYFI.js} +2 -2
  66. package/__chunks__/{chunk-XW22FF2X.js → chunk-W3YW72OF.js} +2 -2
  67. package/__chunks__/{chunk-SK3C6ZOZ.js → chunk-YNIWDNDQ.js} +2 -2
  68. package/__chunks__/{chunk-TWBQ7KS3.js → chunk-YX7HCJV4.js} +2 -2
  69. package/__chunks__/{chunk-ZERBKBEF.js → chunk-ZV5ESV2M.js} +2 -2
  70. package/__commonjs/UI/DappModal/hooks/index.js +1 -1
  71. package/__commonjs/UI/DappModal/hooks/useDappModal.js +1 -1
  72. package/__commonjs/UI/DappModal/index.js +1 -1
  73. package/__commonjs/UI/ModalContainer/ModalContainer.js +1 -1
  74. package/__commonjs/UI/ModalContainer/index.js +1 -1
  75. package/__commonjs/UI/NotificationModal/index.js +1 -1
  76. package/__commonjs/UI/SignTransactionsModals/SignTransactionsModals.js +1 -1
  77. package/__commonjs/UI/SignTransactionsModals/SignWithDeviceModal/SignStep.js +1 -1
  78. package/__commonjs/UI/SignTransactionsModals/SignWithDeviceModal/index.js +1 -1
  79. package/__commonjs/UI/SignTransactionsModals/SignWithExtensionModal/index.js +1 -1
  80. package/__commonjs/UI/SignTransactionsModals/SignWithLedgerModal/index.js +1 -1
  81. package/__commonjs/UI/SignTransactionsModals/SignWithOperaModal/index.js +1 -1
  82. package/__commonjs/UI/SignTransactionsModals/SignWithWalletConnectModal/index.js +1 -1
  83. package/__commonjs/UI/SignTransactionsModals/components/ConfirmationScreen.js +1 -1
  84. package/__commonjs/UI/SignTransactionsModals/components/DeviceConfirmationScreen.js +1 -1
  85. package/__commonjs/UI/SignTransactionsModals/components/index.js +1 -1
  86. package/__commonjs/UI/SignTransactionsModals/index.js +1 -1
  87. package/__commonjs/UI/TransactionInfo/TransactionInfo.js +1 -1
  88. package/__commonjs/UI/TransactionInfo/components/NonceMessage/NonceMessage.js +1 -1
  89. package/__commonjs/UI/TransactionInfo/components/NonceMessage/index.js +1 -1
  90. package/__commonjs/UI/TransactionInfo/components/index.js +1 -1
  91. package/__commonjs/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoNonce/TransactionInfoNonce.js +1 -1
  92. package/__commonjs/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoNonce/index.js +1 -1
  93. package/__commonjs/UI/TransactionInfo/components/transactionInfoFields/index.js +1 -1
  94. package/__commonjs/UI/TransactionInfo/index.js +1 -1
  95. package/__commonjs/UI/TransactionsTable/TransactionsTable.js +1 -1
  96. package/__commonjs/UI/TransactionsTable/index.js +1 -1
  97. package/__commonjs/UI/TransactionsToastList/TransactionsToastList.js +1 -1
  98. package/__commonjs/UI/TransactionsToastList/components/TransactionToast/TransactionToast.js +1 -1
  99. package/__commonjs/UI/TransactionsToastList/components/TransactionToast/hooks/useTransactionToast.js +1 -1
  100. package/__commonjs/UI/TransactionsToastList/components/TransactionToast/index.js +1 -1
  101. package/__commonjs/UI/TransactionsToastList/components/TransactionToastGuard.js +1 -1
  102. package/__commonjs/UI/TransactionsToastList/components/index.js +1 -1
  103. package/__commonjs/UI/TransactionsToastList/index.js +1 -1
  104. package/__commonjs/UI/extension/ExtensionLoginButton/index.js +1 -1
  105. package/__commonjs/UI/index.js +1 -1
  106. package/__commonjs/UI/ledger/LedgerLoginButton/index.js +1 -1
  107. package/__commonjs/UI/ledger/LedgerLoginContainer/ConfirmAddress.js +1 -1
  108. package/__commonjs/UI/ledger/LedgerLoginContainer/index.js +1 -1
  109. package/__commonjs/UI/ledger/index.js +1 -1
  110. package/__commonjs/UI/operaWallet/OperaWalletLoginButton/index.js +1 -1
  111. package/__commonjs/UI/pages/UnlockPage/index.js +1 -1
  112. package/__commonjs/UI/pages/index.js +1 -1
  113. package/__commonjs/UI/walletConnect/WalletConnectLoginButton/index.js +1 -1
  114. package/__commonjs/UI/walletConnect/WalletConnectLoginContainer/index.js +1 -1
  115. package/__commonjs/UI/walletConnect/index.js +1 -1
  116. package/__commonjs/UI/webWallet/WebWalletLoginButton/index.js +1 -1
  117. package/__commonjs/__mocks__/index.js +1 -1
  118. package/__commonjs/__mocks__/utils/index.js +1 -1
  119. package/__commonjs/__mocks__/utils/renderWithProvider.js +1 -1
  120. package/__commonjs/components/LogoutListener/LogoutListener.js +1 -1
  121. package/__commonjs/components/LogoutListener/helpers/index.js +1 -1
  122. package/__commonjs/components/LogoutListener/helpers/useLogoutFromMultipleTabs.js +1 -1
  123. package/__commonjs/components/LogoutListener/helpers/useNativeAuthLogout.js +1 -1
  124. package/__commonjs/components/LogoutListener/helpers/useNativeAuthLogoutWarning/index.js +1 -1
  125. package/__commonjs/components/LogoutListener/helpers/useNativeAuthLogoutWarning/useNativeAuthLogoutWarning.js +1 -1
  126. package/__commonjs/components/LogoutListener/index.js +1 -1
  127. package/__commonjs/components/ProviderInitializer.js +1 -1
  128. package/__commonjs/components/TransactionsTracker/TransactionTracker.js +1 -1
  129. package/__commonjs/components/TransactionsTracker/index.js +1 -1
  130. package/__commonjs/components/TransactionsTracker/useTransactionsTracker.js +1 -1
  131. package/__commonjs/hooks/index.js +1 -1
  132. package/__commonjs/hooks/login/index.js +1 -1
  133. package/__commonjs/hooks/login/useExtensionLogin.js +1 -1
  134. package/__commonjs/hooks/login/useLedgerLogin.js +1 -1
  135. package/__commonjs/hooks/login/useLoginService.js +1 -1
  136. package/__commonjs/hooks/login/useOperaLogin.js +1 -1
  137. package/__commonjs/hooks/login/useWalletConnectLogin.js +1 -1
  138. package/__commonjs/hooks/login/useWalletConnectV2Login.js +1 -1
  139. package/__commonjs/hooks/login/useWebWalletLogin.js +1 -1
  140. package/__commonjs/hooks/transactions/index.js +1 -1
  141. package/__commonjs/hooks/transactions/useTrackTransactionStatus.js +1 -1
  142. package/__commonjs/services/index.js +1 -1
  143. package/__commonjs/services/nativeAuth/index.js +1 -1
  144. package/__commonjs/services/nativeAuth/methods/getNativeAuthConfig.js +1 -1
  145. package/__commonjs/services/nativeAuth/methods/index.js +1 -1
  146. package/__commonjs/services/nativeAuth/nativeAuth.js +1 -1
  147. package/__commonjs/wrappers/DappProvider/CustomComponents.js +1 -1
  148. package/__commonjs/wrappers/DappProvider/index.js +1 -1
  149. package/__commonjs/wrappers/index.js +1 -1
  150. package/__mocks__/index.js +1 -1
  151. package/__mocks__/utils/index.js +1 -1
  152. package/__mocks__/utils/renderWithProvider.js +1 -1
  153. package/components/LogoutListener/LogoutListener.js +1 -1
  154. package/components/LogoutListener/helpers/index.js +1 -1
  155. package/components/LogoutListener/helpers/useLogoutFromMultipleTabs.js +1 -1
  156. package/components/LogoutListener/helpers/useNativeAuthLogout.js +1 -1
  157. package/components/LogoutListener/helpers/useNativeAuthLogoutWarning/index.js +1 -1
  158. package/components/LogoutListener/helpers/useNativeAuthLogoutWarning/useNativeAuthLogoutWarning.js +1 -1
  159. package/components/LogoutListener/index.js +1 -1
  160. package/components/ProviderInitializer.js +1 -1
  161. package/components/TransactionsTracker/TransactionTracker.js +1 -1
  162. package/components/TransactionsTracker/index.js +1 -1
  163. package/components/TransactionsTracker/useTransactionsTracker.js +1 -1
  164. package/hooks/index.js +1 -1
  165. package/hooks/login/index.js +1 -1
  166. package/hooks/login/useExtensionLogin.js +1 -1
  167. package/hooks/login/useLedgerLogin.js +1 -1
  168. package/hooks/login/useLoginService.js +1 -1
  169. package/hooks/login/useOperaLogin.js +1 -1
  170. package/hooks/login/useWalletConnectLogin.js +1 -1
  171. package/hooks/login/useWalletConnectV2Login.js +1 -1
  172. package/hooks/login/useWebWalletLogin.js +1 -1
  173. package/hooks/transactions/index.js +1 -1
  174. package/hooks/transactions/useTrackTransactionStatus.js +1 -1
  175. package/package.json +1 -1
  176. package/providers/webviewProvider/index.js +1 -1
  177. package/providers/webviewProvider/requestMethods.js +1 -1
  178. package/providers/webviewProvider/webviewProvider.js +1 -1
  179. package/services/index.js +1 -1
  180. package/services/nativeAuth/index.js +1 -1
  181. package/services/nativeAuth/methods/getNativeAuthConfig.js +1 -1
  182. package/services/nativeAuth/methods/index.js +1 -1
  183. package/services/nativeAuth/nativeAuth.js +1 -1
  184. package/wrappers/DappProvider/CustomComponents.js +1 -1
  185. package/wrappers/DappProvider/index.js +1 -1
  186. package/wrappers/index.js +1 -1
  187. package/__chunks__/chunk-HYUP22HC.js +0 -2
  188. package/__chunks__/chunk-PLVN6R4K.js +0 -2
@@ -1,4 +1,4 @@
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");let r=Date.now();if(xt.current!=null&&r<xt.current.timestamp*1e3+Ns)return xt.current;if(ue.current!=null)return yield ue.current;ue.current=Ds(e,t);try{let n=yield ue.current;if(n==null)throw ue.current=null,new Error("could not get block hash");return xt.current={hash:n.hash,timestamp:n.timestamp},ue.current=null,n}catch(n){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,origin: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={origin: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:{origin:(r=e==null?void 0:e.origin)!=null?r:De.origin,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{origin: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});
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");let r=Date.now();if(xt.current!=null&&r<xt.current.timestamp*1e3+Ns)return xt.current;if(ue.current!=null)return yield ue.current;ue.current=Ds(e,t);try{let n=yield ue.current;if(n==null)throw ue.current=null,new Error("could not get block hash");return xt.current={hash:n.hash,timestamp:n.timestamp},ue.current=null,n}catch(n){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,origin: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={origin:typeof window!="undefined"?(mi=window==null?void 0:window.location)==null?void 0:mi.origin:"",apiAddress:"https://api.multiversx.com",expirySeconds:60*60*24,tokenExpirationToastWarningSeconds:5*60},Sr=e=>{var r,n,i,l,p;return e===!0?De:{origin:(r=e==null?void 0:e.origin)!=null?r:De.origin,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{origin: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 Yr=Object.create;var H=Object.defineProperty;var zr=Object.getOwnPropertyDescriptor;var Jr=Object.getOwnPropertyNames,pr=Object.getOwnPropertySymbols,Xr=Object.getPrototypeOf,hr=Object.prototype.hasOwnProperty,Qr=Object.prototype.propertyIsEnumerable;var cr=(e,r,t)=>r in e?H(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,J=(e,r)=>{for(var t in r||(r={}))hr.call(r,t)&&cr(e,t,r[t]);if(pr)for(var t of pr(r))Qr.call(r,t)&&cr(e,t,r[t]);return e};var Zr=(e,r)=>()=>(e&&(r=e(e=0)),r);var G=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),jr=(e,r)=>{for(var t in r)H(e,t,{get:r[t],enumerable:!0})},fr=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Jr(r))!hr.call(e,i)&&i!==t&&H(e,i,{get:()=>r[i],enumerable:!(n=zr(r,i))||n.enumerable});return e};var X=(e,r,t)=>(t=e!=null?Yr(Xr(e)):{},fr(r||!e||!e.__esModule?H(t,"default",{value:e,enumerable:!0}):t,e)),rt=e=>fr(H({},"__esModule",{value:!0}),e);var F=(e,r,t)=>new Promise((n,i)=>{var o=p=>{try{s(t.next(p))}catch(h){i(h)}},u=p=>{try{s(t.throw(p))}catch(h){i(h)}},s=p=>p.done?n(p.value):Promise.resolve(p.value).then(o,u);s((t=t.apply(e,r)).next())});var yr=G(K=>{"use strict";c();K.byteLength=et;K.toByteArray=it;K.fromByteArray=at;var B=[],A=[],tt=typeof Uint8Array!="undefined"?Uint8Array:Array,Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(_=0,lr=Q.length;_<lr;++_)B[_]=Q[_],A[Q.charCodeAt(_)]=_;var _,lr;A["-".charCodeAt(0)]=62;A["_".charCodeAt(0)]=63;function xr(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 et(e){var r=xr(e),t=r[0],n=r[1];return(t+n)*3/4-n}function nt(e,r,t){return(r+t)*3/4-t}function it(e){var r,t=xr(e),n=t[0],i=t[1],o=new tt(nt(e,n,i)),u=0,s=i>0?n-4:n,p;for(p=0;p<s;p+=4)r=A[e.charCodeAt(p)]<<18|A[e.charCodeAt(p+1)]<<12|A[e.charCodeAt(p+2)]<<6|A[e.charCodeAt(p+3)],o[u++]=r>>16&255,o[u++]=r>>8&255,o[u++]=r&255;return i===2&&(r=A[e.charCodeAt(p)]<<2|A[e.charCodeAt(p+1)]>>4,o[u++]=r&255),i===1&&(r=A[e.charCodeAt(p)]<<10|A[e.charCodeAt(p+1)]<<4|A[e.charCodeAt(p+2)]>>2,o[u++]=r>>8&255,o[u++]=r&255),o}function ot(e){return B[e>>18&63]+B[e>>12&63]+B[e>>6&63]+B[e&63]}function ut(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(ot(n));return i.join("")}function at(e){for(var r,t=e.length,n=t%3,i=[],o=16383,u=0,s=t-n;u<s;u+=o)i.push(ut(e,u,u+o>s?s:u+o));return n===1?(r=e[t-1],i.push(B[r>>2]+B[r<<4&63]+"==")):n===2&&(r=(e[t-2]<<8)+e[t-1],i.push(B[r>>10]+B[r>>4&63]+B[r<<2&63]+"=")),i.join("")}});var mr=G(Z=>{c();Z.read=function(e,r,t,n,i){var o,u,s=i*8-n-1,p=(1<<s)-1,h=p>>1,l=-7,f=t?i-1:0,d=t?-1:1,g=e[r+f];for(f+=d,o=g&(1<<-l)-1,g>>=-l,l+=s;l>0;o=o*256+e[r+f],f+=d,l-=8);for(u=o&(1<<-l)-1,o>>=-l,l+=n;l>0;u=u*256+e[r+f],f+=d,l-=8);if(o===0)o=1-h;else{if(o===p)return u?NaN:(g?-1:1)*(1/0);u=u+Math.pow(2,n),o=o-h}return(g?-1:1)*u*Math.pow(2,o-n)};Z.write=function(e,r,t,n,i,o){var u,s,p,h=o*8-i-1,l=(1<<h)-1,f=l>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:o-1,O=n?1:-1,qr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,u=l):(u=Math.floor(Math.log(r)/Math.LN2),r*(p=Math.pow(2,-u))<1&&(u--,p*=2),u+f>=1?r+=d/p:r+=d*Math.pow(2,1-f),r*p>=2&&(u++,p/=2),u+f>=l?(s=0,u=l):u+f>=1?(s=(r*p-1)*Math.pow(2,i),u=u+f):(s=r*Math.pow(2,f-1)*Math.pow(2,i),u=0));i>=8;e[t+g]=s&255,g+=O,s/=256,i-=8);for(u=u<<i|s,h+=i;h>0;e[t+g]=u&255,g+=O,u/=256,h-=8);e[t+g-O]|=qr*128}});var Sr=G(R=>{"use strict";c();var j=yr(),b=mr(),wr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;R.Buffer=a;R.SlowBuffer=lt;R.INSPECT_MAX_BYTES=50;var V=2147483647;R.kMaxLength=V;a.TYPED_ARRAY_SUPPORT=st();!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 st(){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 nr(e)}return gr(e,r,t)}a.poolSize=8192;function gr(e,r,t){if(typeof e=="string")return ct(e,r);if(ArrayBuffer.isView(e))return ht(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(v(e,ArrayBuffer)||e&&v(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(v(e,SharedArrayBuffer)||e&&v(e.buffer,SharedArrayBuffer)))return tr(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=ft(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 gr(e,r,t)};Object.setPrototypeOf(a.prototype,Uint8Array.prototype);Object.setPrototypeOf(a,Uint8Array);function Tr(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 pt(e,r,t){return Tr(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 pt(e,r,t)};function nr(e){return Tr(e),U(e<0?0:ir(e)|0)}a.allocUnsafe=function(e){return nr(e)};a.allocUnsafeSlow=function(e){return nr(e)};function ct(e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var t=Ar(e,r)|0,n=U(t),i=n.write(e,r);return i!==t&&(n=n.slice(0,i)),n}function rr(e){for(var r=e.length<0?0:ir(e.length)|0,t=U(r),n=0;n<r;n+=1)t[n]=e[n]&255;return t}function ht(e){if(v(e,Uint8Array)){var r=new Uint8Array(e);return tr(r.buffer,r.byteOffset,r.byteLength)}return rr(e)}function tr(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 ft(e){if(a.isBuffer(e)){var r=ir(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"||or(e.length)?U(0):rr(e);if(e.type==="Buffer"&&Array.isArray(e.data))return rr(e.data)}function ir(e){if(e>=V)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+V.toString(16)+" bytes");return e|0}function lt(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(v(r,Uint8Array)&&(r=a.from(r,r.offset,r.byteLength)),v(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(v(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 Ar(e,r){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||v(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 er(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Ur(e).length;default:if(i)return n?-1:er(e).length;r=(""+r).toLowerCase(),i=!0}}a.byteLength=Ar;function xt(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 Bt(this,r,t);case"utf8":case"utf-8":return Br(this,r,t);case"ascii":return At(this,r,t);case"latin1":case"binary":return Ft(this,r,t);case"base64":return gt(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return vt(this,r,t);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}a.prototype._isBuffer=!0;function k(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)k(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)k(this,t,t+3),k(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)k(this,t,t+7),k(this,t+1,t+6),k(this,t+2,t+5),k(this,t+3,t+4);return this};a.prototype.toString=function(){var r=this.length;return r===0?"":arguments.length===0?Br(this,0,r):xt.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=R.INSPECT_MAX_BYTES;return r=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(r+=" ... "),"<Buffer "+r+">"};wr&&(a.prototype[wr]=a.prototype.inspect);a.prototype.compare=function(r,t,n,i,o){if(v(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,s=n-t,p=Math.min(u,s),h=this.slice(i,o),l=r.slice(t,n),f=0;f<p;++f)if(h[f]!==l[f]){u=h[f],s=l[f];break}return u<s?-1:s<u?1:0};function Fr(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,or(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:Er(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):Er(e,[r],t,n,i);throw new TypeError("val must be string, number or Buffer")}function Er(e,r,t,n,i){var o=1,u=e.length,s=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,s/=2,t/=2}function p(g,O){return o===1?g[O]:g.readUInt16BE(O*o)}var h;if(i){var l=-1;for(h=t;h<u;h++)if(p(e,h)===p(r,l===-1?0:h-l)){if(l===-1&&(l=h),h-l+1===s)return l*o}else l!==-1&&(h-=h-l),l=-1}else for(t+s>u&&(t=u-s),h=t;h>=0;h--){for(var f=!0,d=0;d<s;d++)if(p(e,h+d)!==p(r,d)){f=!1;break}if(f)return h}return-1}a.prototype.includes=function(r,t,n){return this.indexOf(r,t,n)!==-1};a.prototype.indexOf=function(r,t,n){return Fr(this,r,t,n,!0)};a.prototype.lastIndexOf=function(r,t,n){return Fr(this,r,t,n,!1)};function yt(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 s=parseInt(r.substr(u*2,2),16);if(or(s))return u;e[t+u]=s}return u}function mt(e,r,t,n){return q(er(r,e.length-t),e,t,n)}function wt(e,r,t,n){return q(Ut(r),e,t,n)}function Et(e,r,t,n){return q(Ur(r),e,t,n)}function dt(e,r,t,n){return q(St(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 yt(this,r,t,n);case"utf8":case"utf-8":return mt(this,r,t,n);case"ascii":case"latin1":case"binary":return wt(this,r,t,n);case"base64":return Et(this,r,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return dt(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 gt(e,r,t){return r===0&&t===e.length?j.fromByteArray(e):j.fromByteArray(e.slice(r,t))}function Br(e,r,t){t=Math.min(e.length,t);for(var n=[],i=r;i<t;){var o=e[i],u=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=t){var p,h,l,f;switch(s){case 1:o<128&&(u=o);break;case 2:p=e[i+1],(p&192)===128&&(f=(o&31)<<6|p&63,f>127&&(u=f));break;case 3:p=e[i+1],h=e[i+2],(p&192)===128&&(h&192)===128&&(f=(o&15)<<12|(p&63)<<6|h&63,f>2047&&(f<55296||f>57343)&&(u=f));break;case 4:p=e[i+1],h=e[i+2],l=e[i+3],(p&192)===128&&(h&192)===128&&(l&192)===128&&(f=(o&15)<<18|(p&63)<<12|(h&63)<<6|l&63,f>65535&&f<1114112&&(u=f))}}u===null?(u=65533,s=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|u&1023),n.push(u),i+=s}return Tt(n)}var dr=4096;function Tt(e){var r=e.length;if(r<=dr)return String.fromCharCode.apply(String,e);for(var t="",n=0;n<r;)t+=String.fromCharCode.apply(String,e.slice(n,n+=dr));return t}function At(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 Ft(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 Bt(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+=Ct[e[o]];return i}function vt(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 E(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||E(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||E(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||E(r,1,this.length),this[r]};a.prototype.readUint16LE=a.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||E(r,2,this.length),this[r]|this[r+1]<<8};a.prototype.readUint16BE=a.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||E(r,2,this.length),this[r]<<8|this[r+1]};a.prototype.readUint32LE=a.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||E(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||E(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||E(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||E(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||E(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};a.prototype.readInt16LE=function(r,t){r=r>>>0,t||E(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||E(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||E(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||E(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||E(r,4,this.length),b.read(this,r,!0,23,4)};a.prototype.readFloatBE=function(r,t){return r=r>>>0,t||E(r,4,this.length),b.read(this,r,!1,23,4)};a.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||E(r,8,this.length),b.read(this,r,!0,52,8)};a.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||E(r,8,this.length),b.read(this,r,!1,52,8)};function T(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;T(this,r,t,n,o,0)}var u=1,s=0;for(this[t]=r&255;++s<n&&(u*=256);)this[t+s]=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;T(this,r,t,n,o,0)}var u=n-1,s=1;for(this[t+u]=r&255;--u>=0&&(s*=256);)this[t+u]=r/s&255;return t+n};a.prototype.writeUint8=a.prototype.writeUInt8=function(r,t,n){return r=+r,t=t>>>0,n||T(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||T(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||T(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||T(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||T(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);T(this,r,t,n,o-1,-o)}var u=0,s=1,p=0;for(this[t]=r&255;++u<n&&(s*=256);)r<0&&p===0&&this[t+u-1]!==0&&(p=1),this[t+u]=(r/s>>0)-p&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);T(this,r,t,n,o-1,-o)}var u=n-1,s=1,p=0;for(this[t+u]=r&255;--u>=0&&(s*=256);)r<0&&p===0&&this[t+u+1]!==0&&(p=1),this[t+u]=(r/s>>0)-p&255;return t+n};a.prototype.writeInt8=function(r,t,n){return r=+r,t=t>>>0,n||T(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||T(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||T(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||T(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||T(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 vr(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 Ir(e,r,t,n,i){return r=+r,t=t>>>0,i||vr(e,r,t,4,34028234663852886e22,-34028234663852886e22),b.write(e,r,t,n,23,4),t+4}a.prototype.writeFloatLE=function(r,t,n){return Ir(this,r,t,!0,n)};a.prototype.writeFloatBE=function(r,t,n){return Ir(this,r,t,!1,n)};function Nr(e,r,t,n,i){return r=+r,t=t>>>0,i||vr(e,r,t,8,17976931348623157e292,-17976931348623157e292),b.write(e,r,t,n,52,8),t+8}a.prototype.writeDoubleLE=function(r,t,n){return Nr(this,r,t,!0,n)};a.prototype.writeDoubleBE=function(r,t,n){return Nr(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 s=a.isBuffer(r)?r:a.from(r,i),p=s.length;if(p===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(u=0;u<n-t;++u)this[u+t]=s[u%p]}return this};var It=/[^+/0-9A-Za-z-_]/g;function Nt(e){if(e=e.split("=")[0],e=e.trim().replace(It,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function er(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 Ut(e){for(var r=[],t=0;t<e.length;++t)r.push(e.charCodeAt(t)&255);return r}function St(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 Ur(e){return j.toByteArray(Nt(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 v(e,r){return e instanceof r||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===r.name}function or(e){return e!==e}var Ct=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 Lr=G((Kt,Dr)=>{c();var w=Dr.exports={},I,N;function ur(){throw new Error("setTimeout has not been defined")}function ar(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?I=setTimeout:I=ur}catch(e){I=ur}try{typeof clearTimeout=="function"?N=clearTimeout:N=ar}catch(e){N=ar}})();function Cr(e){if(I===setTimeout)return setTimeout(e,0);if((I===ur||!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 _t(e){if(N===clearTimeout)return clearTimeout(e);if((N===ar||!N)&&clearTimeout)return N=clearTimeout,clearTimeout(e);try{return N(e)}catch(r){try{return N.call(null,e)}catch(t){return N.call(this,e)}}}var S=[],M=!1,D,Y=-1;function kt(){!M||!D||(M=!1,D.length?S=D.concat(S):Y=-1,S.length&&_r())}function _r(){if(!M){var e=Cr(kt);M=!0;for(var r=S.length;r;){for(D=S,S=[];++Y<r;)D&&D[Y].run();Y=-1,r=S.length}D=null,M=!1,_t(e)}}w.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];S.push(new kr(e,r)),S.length===1&&!M&&Cr(_r)};function kr(e,r){this.fun=e,this.array=r}kr.prototype.run=function(){this.fun.apply(null,this.array)};w.title="browser";w.browser=!0;w.env={};w.argv=[];w.version="";w.versions={};function C(){}w.on=C;w.addListener=C;w.once=C;w.off=C;w.removeListener=C;w.removeAllListeners=C;w.emit=C;w.prependListener=C;w.prependOnceListener=C;w.listeners=function(e){return[]};w.binding=function(e){throw new Error("process.binding is not supported")};w.cwd=function(){return"/"};w.chdir=function(e){throw new Error("process.chdir is not supported")};w.umask=function(){return 0}});var x,y,Vt,c=Zr(()=>{x=X(Sr()),y=X(Lr()),Vt=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 Pt={};jr(Pt,{nativeAuth:()=>Mt});module.exports=rt(Pt);c();c();c();c();var Dt=e=>e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,""),P=e=>Dt(x.Buffer.from(e,"utf8").toString("base64"));c();var Pr=X(require("axios"));c();var Or="blocks";c();c();c();function br(e){return F(this,null,function*(){return yield new Promise(r=>{setTimeout(()=>r(),e)})})}c();var Rr=(e,r,t,n=0)=>F(void 0,null,function*(){try{return yield e(...t)}catch(i){return n<r.retries?((r==null?void 0:r.delay)!=null&&(yield br(r.delay)),yield Rr(e,r,t,n+1)):null}}),Mr=(e,r={retries:5,delay:500})=>(...t)=>F(void 0,null,function*(){return yield Rr(e,r,t)});var Lt=4,Ot=3e4,z={current:null},L={current:null},bt=Mr((e,r)=>F(void 0,null,function*(){let{data:t}=yield Pr.default.get(`${e}/${Or}?from=${Lt}&size=1&fields=hash,timestamp${r?"&shard="+r:""}`),[n]=t;return n}));function Hr(e,r){return F(this,null,function*(){if(e==null)throw new Error("missing api url");let t=Date.now();if(z.current!=null&&t<z.current.timestamp*1e3+Ot)return z.current;if(L.current!=null)return yield L.current;L.current=bt(e,r);try{let n=yield L.current;if(n==null)throw L.current=null,new Error("could not get block hash");return z.current={hash:n.hash,timestamp:n.timestamp},L.current=null,n}catch(n){return L.current=null,null}})}c();c();c();function W(e){return atob(e)}c();c();c();function Rt(e){return Object.prototype.toString.call(e)==="[object String]"}var Wr=e=>{if(!e||!Rt(e))return null;try{let[r,t,n]=e.split("."),i=W(r),o=W(t),[u,s,p,h]=o.split("."),l=JSON.parse(W(h)),f=W(u),d={ttl:Number(p),address:i,extraInfo:l,origin:f,signature:n,blockHash:s,body:o};return h==="e30"&&delete d.extraInfo,d}catch(r){return null}};c();c();c();var $r=()=>Date.now()/1e3;var Gr=e=>{let r=Wr(e);if(!r)return{isExpired:!1};let t=$r(),{ttl:n,extraInfo:i}=r,o=i.timestamp;if(!o)return{isExpired:!1};let u=o+n,s=t>u,p=u-t;return{isExpired:s,expiresAt:u,secondsUntilExpires:p}};c();var Kr,$={origin:typeof window!="undefined"?(Kr=window==null?void 0:window.location)==null?void 0:Kr.hostname:"",apiAddress:"https://api.multiversx.com",expirySeconds:60*60*24,tokenExpirationToastWarningSeconds:5*60},sr=e=>{var t,n,i,o,u;return e===!0?$:{origin:(t=e==null?void 0:e.origin)!=null?t:$.origin,blockHashShard:(n=e==null?void 0:e.blockHashShard)!=null?n:null,expirySeconds:(i=e==null?void 0:e.expirySeconds)!=null?i:$.expirySeconds,apiAddress:(o=e==null?void 0:e.apiAddress)!=null?o:$.apiAddress,tokenExpirationToastWarningSeconds:(u=e==null?void 0:e.tokenExpirationToastWarningSeconds)!=null?u:$.tokenExpirationToastWarningSeconds}};c();var Vr=({address:e,token:r,signature:t})=>{let n=P(e),i=P(r);return`${n}.${i}.${t}`};var Mt=e=>{let{origin:r,apiAddress:t,expirySeconds:n,blockHashShard:i}=sr(e);return{getNativeAuthConfig:sr,initialize:(...p)=>F(void 0,[...p],function*(u={},s){if(!t||!r)return"";let h=s!=null?s:yield Hr(t,i),{hash:l,timestamp:f}=h,d=P(JSON.stringify(J(J({},u),f?{timestamp:f}:{})));return`${P(r)}.${l}.${n}.${d}`}),getToken:Vr,getTokenExpiration:Gr}};0&&(module.exports={nativeAuth});
1
+ "use strict";var Yr=Object.create;var H=Object.defineProperty;var zr=Object.getOwnPropertyDescriptor;var Jr=Object.getOwnPropertyNames,pr=Object.getOwnPropertySymbols,Xr=Object.getPrototypeOf,hr=Object.prototype.hasOwnProperty,Qr=Object.prototype.propertyIsEnumerable;var cr=(e,r,t)=>r in e?H(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,J=(e,r)=>{for(var t in r||(r={}))hr.call(r,t)&&cr(e,t,r[t]);if(pr)for(var t of pr(r))Qr.call(r,t)&&cr(e,t,r[t]);return e};var Zr=(e,r)=>()=>(e&&(r=e(e=0)),r);var G=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),jr=(e,r)=>{for(var t in r)H(e,t,{get:r[t],enumerable:!0})},fr=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Jr(r))!hr.call(e,i)&&i!==t&&H(e,i,{get:()=>r[i],enumerable:!(n=zr(r,i))||n.enumerable});return e};var X=(e,r,t)=>(t=e!=null?Yr(Xr(e)):{},fr(r||!e||!e.__esModule?H(t,"default",{value:e,enumerable:!0}):t,e)),rt=e=>fr(H({},"__esModule",{value:!0}),e);var F=(e,r,t)=>new Promise((n,i)=>{var o=p=>{try{s(t.next(p))}catch(h){i(h)}},u=p=>{try{s(t.throw(p))}catch(h){i(h)}},s=p=>p.done?n(p.value):Promise.resolve(p.value).then(o,u);s((t=t.apply(e,r)).next())});var yr=G(K=>{"use strict";c();K.byteLength=et;K.toByteArray=it;K.fromByteArray=at;var B=[],A=[],tt=typeof Uint8Array!="undefined"?Uint8Array:Array,Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(_=0,lr=Q.length;_<lr;++_)B[_]=Q[_],A[Q.charCodeAt(_)]=_;var _,lr;A["-".charCodeAt(0)]=62;A["_".charCodeAt(0)]=63;function xr(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 et(e){var r=xr(e),t=r[0],n=r[1];return(t+n)*3/4-n}function nt(e,r,t){return(r+t)*3/4-t}function it(e){var r,t=xr(e),n=t[0],i=t[1],o=new tt(nt(e,n,i)),u=0,s=i>0?n-4:n,p;for(p=0;p<s;p+=4)r=A[e.charCodeAt(p)]<<18|A[e.charCodeAt(p+1)]<<12|A[e.charCodeAt(p+2)]<<6|A[e.charCodeAt(p+3)],o[u++]=r>>16&255,o[u++]=r>>8&255,o[u++]=r&255;return i===2&&(r=A[e.charCodeAt(p)]<<2|A[e.charCodeAt(p+1)]>>4,o[u++]=r&255),i===1&&(r=A[e.charCodeAt(p)]<<10|A[e.charCodeAt(p+1)]<<4|A[e.charCodeAt(p+2)]>>2,o[u++]=r>>8&255,o[u++]=r&255),o}function ot(e){return B[e>>18&63]+B[e>>12&63]+B[e>>6&63]+B[e&63]}function ut(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(ot(n));return i.join("")}function at(e){for(var r,t=e.length,n=t%3,i=[],o=16383,u=0,s=t-n;u<s;u+=o)i.push(ut(e,u,u+o>s?s:u+o));return n===1?(r=e[t-1],i.push(B[r>>2]+B[r<<4&63]+"==")):n===2&&(r=(e[t-2]<<8)+e[t-1],i.push(B[r>>10]+B[r>>4&63]+B[r<<2&63]+"=")),i.join("")}});var mr=G(Z=>{c();Z.read=function(e,r,t,n,i){var o,u,s=i*8-n-1,p=(1<<s)-1,h=p>>1,l=-7,f=t?i-1:0,d=t?-1:1,g=e[r+f];for(f+=d,o=g&(1<<-l)-1,g>>=-l,l+=s;l>0;o=o*256+e[r+f],f+=d,l-=8);for(u=o&(1<<-l)-1,o>>=-l,l+=n;l>0;u=u*256+e[r+f],f+=d,l-=8);if(o===0)o=1-h;else{if(o===p)return u?NaN:(g?-1:1)*(1/0);u=u+Math.pow(2,n),o=o-h}return(g?-1:1)*u*Math.pow(2,o-n)};Z.write=function(e,r,t,n,i,o){var u,s,p,h=o*8-i-1,l=(1<<h)-1,f=l>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:o-1,O=n?1:-1,qr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,u=l):(u=Math.floor(Math.log(r)/Math.LN2),r*(p=Math.pow(2,-u))<1&&(u--,p*=2),u+f>=1?r+=d/p:r+=d*Math.pow(2,1-f),r*p>=2&&(u++,p/=2),u+f>=l?(s=0,u=l):u+f>=1?(s=(r*p-1)*Math.pow(2,i),u=u+f):(s=r*Math.pow(2,f-1)*Math.pow(2,i),u=0));i>=8;e[t+g]=s&255,g+=O,s/=256,i-=8);for(u=u<<i|s,h+=i;h>0;e[t+g]=u&255,g+=O,u/=256,h-=8);e[t+g-O]|=qr*128}});var Sr=G(R=>{"use strict";c();var j=yr(),b=mr(),wr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;R.Buffer=a;R.SlowBuffer=lt;R.INSPECT_MAX_BYTES=50;var V=2147483647;R.kMaxLength=V;a.TYPED_ARRAY_SUPPORT=st();!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 st(){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 nr(e)}return gr(e,r,t)}a.poolSize=8192;function gr(e,r,t){if(typeof e=="string")return ct(e,r);if(ArrayBuffer.isView(e))return ht(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(v(e,ArrayBuffer)||e&&v(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(v(e,SharedArrayBuffer)||e&&v(e.buffer,SharedArrayBuffer)))return tr(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=ft(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 gr(e,r,t)};Object.setPrototypeOf(a.prototype,Uint8Array.prototype);Object.setPrototypeOf(a,Uint8Array);function Tr(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 pt(e,r,t){return Tr(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 pt(e,r,t)};function nr(e){return Tr(e),U(e<0?0:ir(e)|0)}a.allocUnsafe=function(e){return nr(e)};a.allocUnsafeSlow=function(e){return nr(e)};function ct(e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var t=Ar(e,r)|0,n=U(t),i=n.write(e,r);return i!==t&&(n=n.slice(0,i)),n}function rr(e){for(var r=e.length<0?0:ir(e.length)|0,t=U(r),n=0;n<r;n+=1)t[n]=e[n]&255;return t}function ht(e){if(v(e,Uint8Array)){var r=new Uint8Array(e);return tr(r.buffer,r.byteOffset,r.byteLength)}return rr(e)}function tr(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 ft(e){if(a.isBuffer(e)){var r=ir(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"||or(e.length)?U(0):rr(e);if(e.type==="Buffer"&&Array.isArray(e.data))return rr(e.data)}function ir(e){if(e>=V)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+V.toString(16)+" bytes");return e|0}function lt(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(v(r,Uint8Array)&&(r=a.from(r,r.offset,r.byteLength)),v(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(v(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 Ar(e,r){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||v(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 er(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Ur(e).length;default:if(i)return n?-1:er(e).length;r=(""+r).toLowerCase(),i=!0}}a.byteLength=Ar;function xt(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 Bt(this,r,t);case"utf8":case"utf-8":return Br(this,r,t);case"ascii":return At(this,r,t);case"latin1":case"binary":return Ft(this,r,t);case"base64":return gt(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return vt(this,r,t);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}a.prototype._isBuffer=!0;function k(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)k(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)k(this,t,t+3),k(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)k(this,t,t+7),k(this,t+1,t+6),k(this,t+2,t+5),k(this,t+3,t+4);return this};a.prototype.toString=function(){var r=this.length;return r===0?"":arguments.length===0?Br(this,0,r):xt.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=R.INSPECT_MAX_BYTES;return r=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(r+=" ... "),"<Buffer "+r+">"};wr&&(a.prototype[wr]=a.prototype.inspect);a.prototype.compare=function(r,t,n,i,o){if(v(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,s=n-t,p=Math.min(u,s),h=this.slice(i,o),l=r.slice(t,n),f=0;f<p;++f)if(h[f]!==l[f]){u=h[f],s=l[f];break}return u<s?-1:s<u?1:0};function Fr(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,or(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:Er(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):Er(e,[r],t,n,i);throw new TypeError("val must be string, number or Buffer")}function Er(e,r,t,n,i){var o=1,u=e.length,s=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,s/=2,t/=2}function p(g,O){return o===1?g[O]:g.readUInt16BE(O*o)}var h;if(i){var l=-1;for(h=t;h<u;h++)if(p(e,h)===p(r,l===-1?0:h-l)){if(l===-1&&(l=h),h-l+1===s)return l*o}else l!==-1&&(h-=h-l),l=-1}else for(t+s>u&&(t=u-s),h=t;h>=0;h--){for(var f=!0,d=0;d<s;d++)if(p(e,h+d)!==p(r,d)){f=!1;break}if(f)return h}return-1}a.prototype.includes=function(r,t,n){return this.indexOf(r,t,n)!==-1};a.prototype.indexOf=function(r,t,n){return Fr(this,r,t,n,!0)};a.prototype.lastIndexOf=function(r,t,n){return Fr(this,r,t,n,!1)};function yt(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 s=parseInt(r.substr(u*2,2),16);if(or(s))return u;e[t+u]=s}return u}function mt(e,r,t,n){return q(er(r,e.length-t),e,t,n)}function wt(e,r,t,n){return q(Ut(r),e,t,n)}function Et(e,r,t,n){return q(Ur(r),e,t,n)}function dt(e,r,t,n){return q(St(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 yt(this,r,t,n);case"utf8":case"utf-8":return mt(this,r,t,n);case"ascii":case"latin1":case"binary":return wt(this,r,t,n);case"base64":return Et(this,r,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return dt(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 gt(e,r,t){return r===0&&t===e.length?j.fromByteArray(e):j.fromByteArray(e.slice(r,t))}function Br(e,r,t){t=Math.min(e.length,t);for(var n=[],i=r;i<t;){var o=e[i],u=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=t){var p,h,l,f;switch(s){case 1:o<128&&(u=o);break;case 2:p=e[i+1],(p&192)===128&&(f=(o&31)<<6|p&63,f>127&&(u=f));break;case 3:p=e[i+1],h=e[i+2],(p&192)===128&&(h&192)===128&&(f=(o&15)<<12|(p&63)<<6|h&63,f>2047&&(f<55296||f>57343)&&(u=f));break;case 4:p=e[i+1],h=e[i+2],l=e[i+3],(p&192)===128&&(h&192)===128&&(l&192)===128&&(f=(o&15)<<18|(p&63)<<12|(h&63)<<6|l&63,f>65535&&f<1114112&&(u=f))}}u===null?(u=65533,s=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|u&1023),n.push(u),i+=s}return Tt(n)}var dr=4096;function Tt(e){var r=e.length;if(r<=dr)return String.fromCharCode.apply(String,e);for(var t="",n=0;n<r;)t+=String.fromCharCode.apply(String,e.slice(n,n+=dr));return t}function At(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 Ft(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 Bt(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+=Ct[e[o]];return i}function vt(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 E(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||E(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||E(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||E(r,1,this.length),this[r]};a.prototype.readUint16LE=a.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||E(r,2,this.length),this[r]|this[r+1]<<8};a.prototype.readUint16BE=a.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||E(r,2,this.length),this[r]<<8|this[r+1]};a.prototype.readUint32LE=a.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||E(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||E(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||E(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||E(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||E(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};a.prototype.readInt16LE=function(r,t){r=r>>>0,t||E(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||E(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||E(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||E(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||E(r,4,this.length),b.read(this,r,!0,23,4)};a.prototype.readFloatBE=function(r,t){return r=r>>>0,t||E(r,4,this.length),b.read(this,r,!1,23,4)};a.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||E(r,8,this.length),b.read(this,r,!0,52,8)};a.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||E(r,8,this.length),b.read(this,r,!1,52,8)};function T(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;T(this,r,t,n,o,0)}var u=1,s=0;for(this[t]=r&255;++s<n&&(u*=256);)this[t+s]=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;T(this,r,t,n,o,0)}var u=n-1,s=1;for(this[t+u]=r&255;--u>=0&&(s*=256);)this[t+u]=r/s&255;return t+n};a.prototype.writeUint8=a.prototype.writeUInt8=function(r,t,n){return r=+r,t=t>>>0,n||T(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||T(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||T(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||T(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||T(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);T(this,r,t,n,o-1,-o)}var u=0,s=1,p=0;for(this[t]=r&255;++u<n&&(s*=256);)r<0&&p===0&&this[t+u-1]!==0&&(p=1),this[t+u]=(r/s>>0)-p&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);T(this,r,t,n,o-1,-o)}var u=n-1,s=1,p=0;for(this[t+u]=r&255;--u>=0&&(s*=256);)r<0&&p===0&&this[t+u+1]!==0&&(p=1),this[t+u]=(r/s>>0)-p&255;return t+n};a.prototype.writeInt8=function(r,t,n){return r=+r,t=t>>>0,n||T(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||T(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||T(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||T(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||T(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 vr(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 Ir(e,r,t,n,i){return r=+r,t=t>>>0,i||vr(e,r,t,4,34028234663852886e22,-34028234663852886e22),b.write(e,r,t,n,23,4),t+4}a.prototype.writeFloatLE=function(r,t,n){return Ir(this,r,t,!0,n)};a.prototype.writeFloatBE=function(r,t,n){return Ir(this,r,t,!1,n)};function Nr(e,r,t,n,i){return r=+r,t=t>>>0,i||vr(e,r,t,8,17976931348623157e292,-17976931348623157e292),b.write(e,r,t,n,52,8),t+8}a.prototype.writeDoubleLE=function(r,t,n){return Nr(this,r,t,!0,n)};a.prototype.writeDoubleBE=function(r,t,n){return Nr(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 s=a.isBuffer(r)?r:a.from(r,i),p=s.length;if(p===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(u=0;u<n-t;++u)this[u+t]=s[u%p]}return this};var It=/[^+/0-9A-Za-z-_]/g;function Nt(e){if(e=e.split("=")[0],e=e.trim().replace(It,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function er(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 Ut(e){for(var r=[],t=0;t<e.length;++t)r.push(e.charCodeAt(t)&255);return r}function St(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 Ur(e){return j.toByteArray(Nt(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 v(e,r){return e instanceof r||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===r.name}function or(e){return e!==e}var Ct=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 Lr=G((Kt,Dr)=>{c();var w=Dr.exports={},I,N;function ur(){throw new Error("setTimeout has not been defined")}function ar(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?I=setTimeout:I=ur}catch(e){I=ur}try{typeof clearTimeout=="function"?N=clearTimeout:N=ar}catch(e){N=ar}})();function Cr(e){if(I===setTimeout)return setTimeout(e,0);if((I===ur||!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 _t(e){if(N===clearTimeout)return clearTimeout(e);if((N===ar||!N)&&clearTimeout)return N=clearTimeout,clearTimeout(e);try{return N(e)}catch(r){try{return N.call(null,e)}catch(t){return N.call(this,e)}}}var S=[],M=!1,D,Y=-1;function kt(){!M||!D||(M=!1,D.length?S=D.concat(S):Y=-1,S.length&&_r())}function _r(){if(!M){var e=Cr(kt);M=!0;for(var r=S.length;r;){for(D=S,S=[];++Y<r;)D&&D[Y].run();Y=-1,r=S.length}D=null,M=!1,_t(e)}}w.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];S.push(new kr(e,r)),S.length===1&&!M&&Cr(_r)};function kr(e,r){this.fun=e,this.array=r}kr.prototype.run=function(){this.fun.apply(null,this.array)};w.title="browser";w.browser=!0;w.env={};w.argv=[];w.version="";w.versions={};function C(){}w.on=C;w.addListener=C;w.once=C;w.off=C;w.removeListener=C;w.removeAllListeners=C;w.emit=C;w.prependListener=C;w.prependOnceListener=C;w.listeners=function(e){return[]};w.binding=function(e){throw new Error("process.binding is not supported")};w.cwd=function(){return"/"};w.chdir=function(e){throw new Error("process.chdir is not supported")};w.umask=function(){return 0}});var x,y,Vt,c=Zr(()=>{x=X(Sr()),y=X(Lr()),Vt=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 Pt={};jr(Pt,{nativeAuth:()=>Mt});module.exports=rt(Pt);c();c();c();c();var Dt=e=>e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,""),P=e=>Dt(x.Buffer.from(e,"utf8").toString("base64"));c();var Pr=X(require("axios"));c();var Or="blocks";c();c();c();function br(e){return F(this,null,function*(){return yield new Promise(r=>{setTimeout(()=>r(),e)})})}c();var Rr=(e,r,t,n=0)=>F(void 0,null,function*(){try{return yield e(...t)}catch(i){return n<r.retries?((r==null?void 0:r.delay)!=null&&(yield br(r.delay)),yield Rr(e,r,t,n+1)):null}}),Mr=(e,r={retries:5,delay:500})=>(...t)=>F(void 0,null,function*(){return yield Rr(e,r,t)});var Lt=4,Ot=3e4,z={current:null},L={current:null},bt=Mr((e,r)=>F(void 0,null,function*(){let{data:t}=yield Pr.default.get(`${e}/${Or}?from=${Lt}&size=1&fields=hash,timestamp${r?"&shard="+r:""}`),[n]=t;return n}));function Hr(e,r){return F(this,null,function*(){if(e==null)throw new Error("missing api url");let t=Date.now();if(z.current!=null&&t<z.current.timestamp*1e3+Ot)return z.current;if(L.current!=null)return yield L.current;L.current=bt(e,r);try{let n=yield L.current;if(n==null)throw L.current=null,new Error("could not get block hash");return z.current={hash:n.hash,timestamp:n.timestamp},L.current=null,n}catch(n){return L.current=null,null}})}c();c();c();function W(e){return atob(e)}c();c();c();function Rt(e){return Object.prototype.toString.call(e)==="[object String]"}var Wr=e=>{if(!e||!Rt(e))return null;try{let[r,t,n]=e.split("."),i=W(r),o=W(t),[u,s,p,h]=o.split("."),l=JSON.parse(W(h)),f=W(u),d={ttl:Number(p),address:i,extraInfo:l,origin:f,signature:n,blockHash:s,body:o};return h==="e30"&&delete d.extraInfo,d}catch(r){return null}};c();c();c();var $r=()=>Date.now()/1e3;var Gr=e=>{let r=Wr(e);if(!r)return{isExpired:!1};let t=$r(),{ttl:n,extraInfo:i}=r,o=i.timestamp;if(!o)return{isExpired:!1};let u=o+n,s=t>u,p=u-t;return{isExpired:s,expiresAt:u,secondsUntilExpires:p}};c();var Kr,$={origin:typeof window!="undefined"?(Kr=window==null?void 0:window.location)==null?void 0:Kr.origin:"",apiAddress:"https://api.multiversx.com",expirySeconds:60*60*24,tokenExpirationToastWarningSeconds:5*60},sr=e=>{var t,n,i,o,u;return e===!0?$:{origin:(t=e==null?void 0:e.origin)!=null?t:$.origin,blockHashShard:(n=e==null?void 0:e.blockHashShard)!=null?n:null,expirySeconds:(i=e==null?void 0:e.expirySeconds)!=null?i:$.expirySeconds,apiAddress:(o=e==null?void 0:e.apiAddress)!=null?o:$.apiAddress,tokenExpirationToastWarningSeconds:(u=e==null?void 0:e.tokenExpirationToastWarningSeconds)!=null?u:$.tokenExpirationToastWarningSeconds}};c();var Vr=({address:e,token:r,signature:t})=>{let n=P(e),i=P(r);return`${n}.${i}.${t}`};var Mt=e=>{let{origin:r,apiAddress:t,expirySeconds:n,blockHashShard:i}=sr(e);return{getNativeAuthConfig:sr,initialize:(...p)=>F(void 0,[...p],function*(u={},s){if(!t||!r)return"";let h=s!=null?s:yield Hr(t,i),{hash:l,timestamp:f}=h,d=P(JSON.stringify(J(J({},u),f?{timestamp:f}:{})));return`${P(r)}.${l}.${n}.${d}`}),getToken:Vr,getTokenExpiration:Gr}};0&&(module.exports={nativeAuth});
2
2
  /*!
3
3
  * The buffer module from node.js, for the browser.
4
4
  *