@multiversx/sdk-dapp 2.10.8 → 2.10.9

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 (277) 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/ExplorerLink/ExplorerLink.js +1 -1
  5. package/UI/ExplorerLink/index.js +1 -1
  6. package/UI/ModalContainer/ModalContainer.js +1 -1
  7. package/UI/ModalContainer/index.js +1 -1
  8. package/UI/NotificationModal/index.js +1 -1
  9. package/UI/SignTransactionsModals/SignTransactionsModals.js +1 -1
  10. package/UI/SignTransactionsModals/SignWithDeviceModal/SignStep.js +1 -1
  11. package/UI/SignTransactionsModals/SignWithDeviceModal/index.js +1 -1
  12. package/UI/SignTransactionsModals/SignWithExtensionModal/index.js +1 -1
  13. package/UI/SignTransactionsModals/SignWithExtraModal/index.js +1 -1
  14. package/UI/SignTransactionsModals/SignWithLedgerModal/index.js +1 -1
  15. package/UI/SignTransactionsModals/SignWithOperaModal/index.js +1 -1
  16. package/UI/SignTransactionsModals/SignWithWalletConnectModal/index.js +1 -1
  17. package/UI/SignTransactionsModals/components/ConfirmationScreen.js +1 -1
  18. package/UI/SignTransactionsModals/components/DeviceConfirmationScreen.js +1 -1
  19. package/UI/SignTransactionsModals/components/TransactionStatusToast.js +1 -1
  20. package/UI/SignTransactionsModals/components/index.js +1 -1
  21. package/UI/SignTransactionsModals/index.js +1 -1
  22. package/UI/TokenDetails/index.js +1 -1
  23. package/UI/TransactionDetails/TransactionDetails.js +1 -1
  24. package/UI/TransactionDetails/components/TransactionDetailsBody.js +1 -1
  25. package/UI/TransactionDetails/components/index.js +1 -1
  26. package/UI/TransactionDetails/index.js +1 -1
  27. package/UI/TransactionInfo/TransactionInfo.js +1 -1
  28. package/UI/TransactionInfo/components/AddressDetailItem/AddressDetailitem.js +1 -1
  29. package/UI/TransactionInfo/components/AddressDetailItem/index.js +1 -1
  30. package/UI/TransactionInfo/components/NonceMessage/NonceMessage.js +1 -1
  31. package/UI/TransactionInfo/components/NonceMessage/index.js +1 -1
  32. package/UI/TransactionInfo/components/OperationsList/OperationList.js +1 -1
  33. package/UI/TransactionInfo/components/OperationsList/components/DetailedItem.js +1 -1
  34. package/UI/TransactionInfo/components/OperationsList/components/OperationBlock.js +1 -1
  35. package/UI/TransactionInfo/components/OperationsList/components/OperationRow.js +1 -1
  36. package/UI/TransactionInfo/components/OperationsList/components/OperationText.js +1 -1
  37. package/UI/TransactionInfo/components/OperationsList/components/OperationToken.js +1 -1
  38. package/UI/TransactionInfo/components/OperationsList/components/index.js +1 -1
  39. package/UI/TransactionInfo/components/OperationsList/index.js +1 -1
  40. package/UI/TransactionInfo/components/ScResultsList/ScResultsList.js +1 -1
  41. package/UI/TransactionInfo/components/ScResultsList/components/ResultHash/ResultHash.js +1 -1
  42. package/UI/TransactionInfo/components/ScResultsList/components/ResultHash/index.js +1 -1
  43. package/UI/TransactionInfo/components/ScResultsList/components/ResultReceiver/ResultReceiver.js +1 -1
  44. package/UI/TransactionInfo/components/ScResultsList/components/ResultReceiver/index.js +1 -1
  45. package/UI/TransactionInfo/components/ScResultsList/components/ResultSender/ResultSender.js +1 -1
  46. package/UI/TransactionInfo/components/ScResultsList/components/ResultSender/index.js +1 -1
  47. package/UI/TransactionInfo/components/ScResultsList/index.js +1 -1
  48. package/UI/TransactionInfo/components/ScrDetailItem/ScrDetailItem.js +1 -1
  49. package/UI/TransactionInfo/components/ScrDetailItem/index.js +1 -1
  50. package/UI/TransactionInfo/components/TransactionAction/TransactionAction.js +1 -1
  51. package/UI/TransactionInfo/components/TransactionAction/components/ActionText/index.js +1 -1
  52. package/UI/TransactionInfo/components/TransactionAction/components/ActionToken.js +1 -1
  53. package/UI/TransactionInfo/components/TransactionAction/components/TransactionActionBlock/components/TransactionActionCollection.js +1 -1
  54. package/UI/TransactionInfo/components/TransactionAction/components/TransactionActionBlock/components/TransactionActionNft.js +1 -1
  55. package/UI/TransactionInfo/components/TransactionAction/components/TransactionActionBlock/components/TransactionActionToken.js +1 -1
  56. package/UI/TransactionInfo/components/TransactionAction/components/TransactionActionBlock/components/index.js +1 -1
  57. package/UI/TransactionInfo/components/TransactionAction/components/TransactionActionBlock/index.js +1 -1
  58. package/UI/TransactionInfo/components/TransactionAction/components/index.js +1 -1
  59. package/UI/TransactionInfo/components/TransactionAction/index.js +1 -1
  60. package/UI/TransactionInfo/components/TransactionLogs/TransactionLogs.js +1 -1
  61. package/UI/TransactionInfo/components/TransactionLogs/index.js +1 -1
  62. package/UI/TransactionInfo/components/index.js +1 -1
  63. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoFee/TransactionInfoFee.js +1 -1
  64. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoFee/index.js +1 -1
  65. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoFrom/TransactionInfoFrom.js +1 -1
  66. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoFrom/index.js +1 -1
  67. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoMethod/TransactionInfoMethod.js +1 -1
  68. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoMethod/index.js +1 -1
  69. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoMiniblock/TransactionInfoMiniblock.js +1 -1
  70. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoMiniblock/index.js +1 -1
  71. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoNonce/TransactionInfoNonce.js +1 -1
  72. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoNonce/index.js +1 -1
  73. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoScResults/TransactionInfoScResults.js +1 -1
  74. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoScResults/index.js +1 -1
  75. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoTo/TransactionInfoTo.js +1 -1
  76. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoTo/index.js +1 -1
  77. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoTokenOperations/TransactionInfoTokenOperations.js +1 -1
  78. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoTokenOperations/index.js +1 -1
  79. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoValue/TransactionInfoValue.js +1 -1
  80. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoValue/index.js +1 -1
  81. package/UI/TransactionInfo/components/transactionInfoFields/index.js +1 -1
  82. package/UI/TransactionInfo/index.js +1 -1
  83. package/UI/TransactionsTable/TransactionsTable.js +1 -1
  84. package/UI/TransactionsTable/components/LockedTokenAddressIcon.js +1 -1
  85. package/UI/TransactionsTable/components/TransactionHash.js +1 -1
  86. package/UI/TransactionsTable/components/TransactionReceiver.js +1 -1
  87. package/UI/TransactionsTable/components/TransactionRow.js +1 -1
  88. package/UI/TransactionsTable/components/TransactionSender.js +1 -1
  89. package/UI/TransactionsTable/components/TransactionShardsTransition.js +1 -1
  90. package/UI/TransactionsTable/components/TransactionValue/TransactionValue.js +1 -1
  91. package/UI/TransactionsTable/components/TransactionValue/index.js +1 -1
  92. package/UI/TransactionsTable/components/index.js +1 -1
  93. package/UI/TransactionsTable/index.js +1 -1
  94. package/UI/TransactionsToastList/TransactionsToastList.js +1 -1
  95. package/UI/TransactionsToastList/components/CustomToast/CustomToast.js +1 -1
  96. package/UI/TransactionsToastList/components/CustomToast/components/IconToast/IconToast.js +1 -1
  97. package/UI/TransactionsToastList/components/CustomToast/components/IconToast/components/IconToastFooter/IconToastFooter.js +1 -1
  98. package/UI/TransactionsToastList/components/CustomToast/components/IconToast/components/IconToastFooter/components/TransactionToastFooter.js +1 -1
  99. package/UI/TransactionsToastList/components/CustomToast/components/IconToast/components/IconToastFooter/components/index.js +1 -1
  100. package/UI/TransactionsToastList/components/CustomToast/components/IconToast/components/IconToastFooter/index.js +1 -1
  101. package/UI/TransactionsToastList/components/CustomToast/components/IconToast/index.js +1 -1
  102. package/UI/TransactionsToastList/components/CustomToast/components/SimpleToast.js +1 -1
  103. package/UI/TransactionsToastList/components/CustomToast/components/index.js +1 -1
  104. package/UI/TransactionsToastList/components/CustomToast/helpers/index.js +1 -1
  105. package/UI/TransactionsToastList/components/CustomToast/helpers/useMemoizedCloseButton.js +1 -1
  106. package/UI/TransactionsToastList/components/CustomToast/index.js +1 -1
  107. package/UI/TransactionsToastList/components/TransactionToast/TransactionToast.js +1 -1
  108. package/UI/TransactionsToastList/components/TransactionToast/components/TransactionToastContent.js +1 -1
  109. package/UI/TransactionsToastList/components/TransactionToast/components/index.js +1 -1
  110. package/UI/TransactionsToastList/components/TransactionToast/hooks/useTransactionToast.js +1 -1
  111. package/UI/TransactionsToastList/components/TransactionToast/index.js +1 -1
  112. package/UI/TransactionsToastList/components/TransactionToastGuard.js +1 -1
  113. package/UI/TransactionsToastList/components/index.js +1 -1
  114. package/UI/TransactionsToastList/index.js +1 -1
  115. package/UI/extension/ExtensionLoginButton/index.js +1 -1
  116. package/UI/index.js +1 -1
  117. package/UI/ledger/LedgerLoginButton/index.js +1 -1
  118. package/UI/ledger/LedgerLoginContainer/AddressRow.js +1 -1
  119. package/UI/ledger/LedgerLoginContainer/AddressTable.js +1 -1
  120. package/UI/ledger/LedgerLoginContainer/ConfirmAddress.js +1 -1
  121. package/UI/ledger/LedgerLoginContainer/index.js +1 -1
  122. package/UI/ledger/index.js +1 -1
  123. package/UI/operaWallet/OperaWalletLoginButton/index.js +1 -1
  124. package/UI/pages/UnlockPage/index.js +1 -1
  125. package/UI/pages/index.js +1 -1
  126. package/UI/walletConnect/WalletConnectLoginButton/index.js +1 -1
  127. package/UI/walletConnect/WalletConnectLoginContainer/index.js +1 -1
  128. package/UI/walletConnect/index.js +1 -1
  129. package/UI/webWallet/WebWalletLoginButton/index.js +1 -1
  130. package/__chunks__/{chunk-T2F5EQGC.js → chunk-2Y5IVM7W.js} +2 -2
  131. package/__chunks__/{chunk-N3XSMRZC.js → chunk-C7FBN3IX.js} +2 -2
  132. package/__chunks__/{chunk-ZFXNOUTU.js → chunk-FUKODOKV.js} +2 -2
  133. package/__chunks__/{chunk-5FR53APV.js → chunk-HAEPPCYL.js} +2 -2
  134. package/__chunks__/{chunk-XNWXDIAZ.js → chunk-MOP2PGBR.js} +2 -2
  135. package/__chunks__/chunk-R2TK2Z7D.js +2 -0
  136. package/__chunks__/{chunk-AEZWROKB.js → chunk-VZX4SOAF.js} +2 -2
  137. package/__chunks__/{chunk-TH46W4XN.js → chunk-WOVYNC3H.js} +2 -2
  138. package/__commonjs/UI/SignTransactionsModals/SignTransactionsModals.js +11 -11
  139. package/__commonjs/UI/SignTransactionsModals/SignWithDeviceModal/index.js +1 -1
  140. package/__commonjs/UI/SignTransactionsModals/SignWithLedgerModal/index.js +1 -1
  141. package/__commonjs/UI/SignTransactionsModals/index.js +11 -11
  142. package/__commonjs/UI/index.js +1 -1
  143. package/__commonjs/hooks/index.js +1 -1
  144. package/__commonjs/hooks/transactions/index.js +4 -4
  145. package/__commonjs/hooks/transactions/useParseMultiEsdtTransferData.js +1 -1
  146. package/__commonjs/hooks/transactions/useSignMultipleTransactions.js +1 -1
  147. package/__commonjs/hooks/transactions/useSignTransactionsWithDevice.js +1 -1
  148. package/__commonjs/hooks/transactions/useSignTransactionsWithLedger.js +1 -1
  149. package/__commonjs/utils/index.js +1 -1
  150. package/__commonjs/utils/transactions/index.js +1 -1
  151. package/__commonjs/utils/transactions/parseMultiEsdtTransferData.js +1 -1
  152. package/__mocks__/index.js +1 -1
  153. package/__mocks__/utils/index.js +1 -1
  154. package/__mocks__/utils/renderWithProvider.js +1 -1
  155. package/apiCalls/accounts/getAccountFromApi.js +1 -1
  156. package/apiCalls/accounts/index.js +1 -1
  157. package/apiCalls/configuration/getNetworkConfig.js +1 -1
  158. package/apiCalls/configuration/index.js +1 -1
  159. package/apiCalls/getScamAddressData.js +1 -1
  160. package/apiCalls/index.js +1 -1
  161. package/apiCalls/transactions/getTransactionsByHashes.js +1 -1
  162. package/apiCalls/transactions/index.js +1 -1
  163. package/apiCalls/transactions/sendSignedTransactions.js +1 -1
  164. package/apiCalls/utils/getCleanApiAddress.js +1 -1
  165. package/apiCalls/utils/index.js +1 -1
  166. package/components/LogoutListener/LogoutListener.js +1 -1
  167. package/components/LogoutListener/helpers/index.js +1 -1
  168. package/components/LogoutListener/helpers/useLogoutFromMultipleTabs.js +1 -1
  169. package/components/LogoutListener/helpers/useNativeAuthLogout.js +1 -1
  170. package/components/LogoutListener/helpers/useNativeAuthLogoutWarning/index.js +1 -1
  171. package/components/LogoutListener/helpers/useNativeAuthLogoutWarning/useNativeAuthLogoutWarning.js +1 -1
  172. package/components/LogoutListener/index.js +1 -1
  173. package/components/ProviderInitializer.js +1 -1
  174. package/components/TransactionSender/TransactionSender.js +1 -1
  175. package/components/TransactionSender/index.js +1 -1
  176. package/components/TransactionStatusToast/FailedTransactionStatusToast.js +1 -1
  177. package/components/TransactionsTracker/TransactionTracker.js +1 -1
  178. package/components/TransactionsTracker/index.js +1 -1
  179. package/components/TransactionsTracker/useTransactionsTracker.js +1 -1
  180. package/hooks/account/index.js +1 -1
  181. package/hooks/account/useGetAccount.js +1 -1
  182. package/hooks/account/useGetAccountInfo.js +1 -1
  183. package/hooks/account/useGetIsLoggedIn.js +1 -1
  184. package/hooks/account/useGetLoginInfo.js +1 -1
  185. package/hooks/account/useGetWebsocketEvent.js +1 -1
  186. package/hooks/index.js +1 -1
  187. package/hooks/login/index.js +1 -1
  188. package/hooks/login/useExtensionLogin.js +1 -1
  189. package/hooks/login/useLedgerLogin.js +1 -1
  190. package/hooks/login/useLoginService.js +1 -1
  191. package/hooks/login/useOperaLogin.js +1 -1
  192. package/hooks/login/useWalletConnectLogin.js +1 -1
  193. package/hooks/login/useWalletConnectV2Login.js +1 -1
  194. package/hooks/login/useWebWalletLogin.js +1 -1
  195. package/hooks/signMessage/index.js +1 -1
  196. package/hooks/signMessage/useGetLastSignedMessageSession.js +1 -1
  197. package/hooks/signMessage/useGetSignMessageSession.js +1 -1
  198. package/hooks/signMessage/useGetSignedMessageStatus.js +1 -1
  199. package/hooks/signMessage/useSignMessage.js +1 -1
  200. package/hooks/transactions/helpers/getShouldMoveTransactionsToSignedState.js +1 -1
  201. package/hooks/transactions/helpers/index.js +1 -1
  202. package/hooks/transactions/helpers/useSetTransactionNonces.js +1 -1
  203. package/hooks/transactions/index.js +1 -1
  204. package/hooks/transactions/useCheckTransactionStatus/checkBatch.js +1 -1
  205. package/hooks/transactions/useCheckTransactionStatus/index.js +1 -1
  206. package/hooks/transactions/useCheckTransactionStatus/useCheckTransactionStatus.js +1 -1
  207. package/hooks/transactions/useGetActiveTransactionsStatus.js +1 -1
  208. package/hooks/transactions/useGetFailedTransactions.js +1 -1
  209. package/hooks/transactions/useGetLastPendingTransactionHash.js +1 -1
  210. package/hooks/transactions/useGetPendingTransactions.js +1 -1
  211. package/hooks/transactions/useGetSignTransactionsError.js +1 -1
  212. package/hooks/transactions/useGetSignedTransactions.js +1 -1
  213. package/hooks/transactions/useGetSuccessfulTransactions.js +1 -1
  214. package/hooks/transactions/useGetTokenDetails.js +1 -1
  215. package/hooks/transactions/useGetTransactionDisplayInfo.js +1 -1
  216. package/hooks/transactions/useParseMultiEsdtTransferData.js +1 -1
  217. package/hooks/transactions/useParseSignedTransactions.js +1 -1
  218. package/hooks/transactions/useSignMultipleTransactions.js +1 -1
  219. package/hooks/transactions/useSignTransactions.js +1 -1
  220. package/hooks/transactions/useSignTransactionsCommonData.js +1 -1
  221. package/hooks/transactions/useSignTransactionsWithDevice.js +1 -1
  222. package/hooks/transactions/useSignTransactionsWithLedger.js +1 -1
  223. package/hooks/transactions/useTrackTransactionStatus.js +1 -1
  224. package/hooks/useGetNetworkConfig.js +1 -1
  225. package/hooks/useGetNotification.js +1 -1
  226. package/hooks/websocketListener/index.js +1 -1
  227. package/hooks/websocketListener/useInitializeWebsocketConnection.js +1 -1
  228. package/hooks/websocketListener/useRegisterWebsocketListener.js +1 -1
  229. package/package.json +1 -1
  230. package/reduxStore/selectors/index.js +1 -1
  231. package/reduxStore/selectors/transactionsSelectors.js +1 -1
  232. package/services/index.js +1 -1
  233. package/services/nativeAuth/helpers/getAuthorizationInfo.js +1 -1
  234. package/services/nativeAuth/helpers/getIsNativeAuthSingingForbidden.js +1 -1
  235. package/services/nativeAuth/helpers/index.js +1 -1
  236. package/services/nativeAuth/index.js +1 -1
  237. package/services/nativeAuth/methods/getToken.js +1 -1
  238. package/services/nativeAuth/methods/getTokenExpiration.js +1 -1
  239. package/services/nativeAuth/methods/index.js +1 -1
  240. package/services/nativeAuth/nativeAuth.js +1 -1
  241. package/services/transactions/index.js +1 -1
  242. package/services/transactions/sendTransactions.js +1 -1
  243. package/services/transactions/transformAndSignTransactions.js +1 -1
  244. package/utils/account/getAccount.js +1 -1
  245. package/utils/account/getAccountBalance.js +1 -1
  246. package/utils/account/getAccountShard.js +1 -1
  247. package/utils/account/getAddress.js +1 -1
  248. package/utils/account/getLatestNonce.js +1 -1
  249. package/utils/account/index.js +1 -1
  250. package/utils/account/refreshAccount.js +1 -1
  251. package/utils/account/signMessage.js +1 -1
  252. package/utils/getIsLoggedIn.js +1 -1
  253. package/utils/index.js +1 -1
  254. package/utils/logout.js +1 -1
  255. package/utils/network/getChainID.js +1 -1
  256. package/utils/network/getEgldLabel.js +1 -1
  257. package/utils/network/getNetworkConfig.js +1 -1
  258. package/utils/network/index.js +1 -1
  259. package/utils/transactions/getAllTransactionsLink.js +1 -1
  260. package/utils/transactions/getTransactionLink.js +1 -1
  261. package/utils/transactions/index.js +1 -1
  262. package/utils/transactions/parseMultiEsdtTransferData.js +1 -1
  263. package/web/hooks/index.js +1 -1
  264. package/web/hooks/useIdleTimer.js +1 -1
  265. package/web/index.js +1 -1
  266. package/wrappers/AppInitializer.js +1 -1
  267. package/wrappers/AuthenticatedRoutesWrapper/index.js +1 -1
  268. package/wrappers/AxiosInterceptorContext/AxiosInterceptorContext.js +1 -1
  269. package/wrappers/AxiosInterceptorContext/components/AxiosInterceptor.js +1 -1
  270. package/wrappers/AxiosInterceptorContext/components/AxiosInterceptorContextProvider.js +1 -1
  271. package/wrappers/AxiosInterceptorContext/components/LoginInfoListener.js +1 -1
  272. package/wrappers/AxiosInterceptorContext/components/index.js +1 -1
  273. package/wrappers/AxiosInterceptorContext/index.js +1 -1
  274. package/wrappers/DappProvider/CustomComponents.js +1 -1
  275. package/wrappers/DappProvider/index.js +1 -1
  276. package/wrappers/index.js +1 -1
  277. package/__chunks__/chunk-ASRZMYCJ.js +0 -2
@@ -1,4 +1,4 @@
1
- "use strict";var Wr=Object.create;var P=Object.defineProperty,Yr=Object.defineProperties,zr=Object.getOwnPropertyDescriptor,$r=Object.getOwnPropertyDescriptors,Qr=Object.getOwnPropertyNames,ur=Object.getOwnPropertySymbols,Xr=Object.getPrototypeOf,cr=Object.prototype.hasOwnProperty,Vr=Object.prototype.propertyIsEnumerable;var pr=(t,r,e)=>r in t?P(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,lr=(t,r)=>{for(var e in r||(r={}))cr.call(r,e)&&pr(t,e,r[e]);if(ur)for(var e of ur(r))Vr.call(r,e)&&pr(t,e,r[e]);return t},fr=(t,r)=>Yr(t,$r(r));var Jr=(t,r)=>()=>(t&&(r=t(t=0)),r);var O=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports),Kr=(t,r)=>{for(var e in r)P(t,e,{get:r[e],enumerable:!0})},gr=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Qr(r))!cr.call(t,i)&&i!==e&&P(t,i,{get:()=>r[i],enumerable:!(n=zr(r,i))||n.enumerable});return t};var H=(t,r,e)=>(e=t!=null?Wr(Xr(t)):{},gr(r||!t||!t.__esModule?P(e,"default",{value:t,enumerable:!0}):e,t)),jr=t=>gr(P({},"__esModule",{value:!0}),t);var yr=O(G=>{"use strict";f();G.byteLength=re;G.toByteArray=te;G.fromByteArray=ae;var I=[],F=[],Zr=typeof Uint8Array!="undefined"?Uint8Array:Array,Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(E=0,hr=Q.length;E<hr;++E)I[E]=Q[E],F[Q.charCodeAt(E)]=E;var E,hr;F["-".charCodeAt(0)]=62;F["_".charCodeAt(0)]=63;function dr(t){var r=t.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=t.indexOf("=");e===-1&&(e=r);var n=e===r?0:4-e%4;return[e,n]}function re(t){var r=dr(t),e=r[0],n=r[1];return(e+n)*3/4-n}function ee(t,r,e){return(r+e)*3/4-e}function te(t){var r,e=dr(t),n=e[0],i=e[1],a=new Zr(ee(t,n,i)),o=0,u=i>0?n-4:n,p;for(p=0;p<u;p+=4)r=F[t.charCodeAt(p)]<<18|F[t.charCodeAt(p+1)]<<12|F[t.charCodeAt(p+2)]<<6|F[t.charCodeAt(p+3)],a[o++]=r>>16&255,a[o++]=r>>8&255,a[o++]=r&255;return i===2&&(r=F[t.charCodeAt(p)]<<2|F[t.charCodeAt(p+1)]>>4,a[o++]=r&255),i===1&&(r=F[t.charCodeAt(p)]<<10|F[t.charCodeAt(p+1)]<<4|F[t.charCodeAt(p+2)]>>2,a[o++]=r>>8&255,a[o++]=r&255),a}function ne(t){return I[t>>18&63]+I[t>>12&63]+I[t>>6&63]+I[t&63]}function ie(t,r,e){for(var n,i=[],a=r;a<e;a+=3)n=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(t[a+2]&255),i.push(ne(n));return i.join("")}function ae(t){for(var r,e=t.length,n=e%3,i=[],a=16383,o=0,u=e-n;o<u;o+=a)i.push(ie(t,o,o+a>u?u:o+a));return n===1?(r=t[e-1],i.push(I[r>>2]+I[r<<4&63]+"==")):n===2&&(r=(t[e-2]<<8)+t[e-1],i.push(I[r>>10]+I[r>>4&63]+I[r<<2&63]+"=")),i.join("")}});var mr=O(X=>{f();X.read=function(t,r,e,n,i){var a,o,u=i*8-n-1,p=(1<<u)-1,l=p>>1,g=-7,c=e?i-1:0,d=e?-1:1,h=t[r+c];for(c+=d,a=h&(1<<-g)-1,h>>=-g,g+=u;g>0;a=a*256+t[r+c],c+=d,g-=8);for(o=a&(1<<-g)-1,a>>=-g,g+=n;g>0;o=o*256+t[r+c],c+=d,g-=8);if(a===0)a=1-l;else{if(a===p)return o?NaN:(h?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-l}return(h?-1:1)*o*Math.pow(2,a-n)};X.write=function(t,r,e,n,i,a){var o,u,p,l=a*8-i-1,g=(1<<l)-1,c=g>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:a-1,k=n?1:-1,$=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(u=isNaN(r)?1:0,o=g):(o=Math.floor(Math.log(r)/Math.LN2),r*(p=Math.pow(2,-o))<1&&(o--,p*=2),o+c>=1?r+=d/p:r+=d*Math.pow(2,1-c),r*p>=2&&(o++,p/=2),o+c>=g?(u=0,o=g):o+c>=1?(u=(r*p-1)*Math.pow(2,i),o=o+c):(u=r*Math.pow(2,c-1)*Math.pow(2,i),o=0));i>=8;t[e+h]=u&255,h+=k,u/=256,i-=8);for(o=o<<i|u,l+=i;l>0;t[e+h]=o&255,h+=k,o/=256,l-=8);t[e+h-k]|=$*128}});var _r=O(C=>{"use strict";f();var V=yr(),L=mr(),xr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;C.Buffer=s;C.SlowBuffer=le;C.INSPECT_MAX_BYTES=50;var q=2147483647;C.kMaxLength=q;s.TYPED_ARRAY_SUPPORT=oe();!s.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 oe(){try{var t=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(t,r),t.foo()===42}catch(e){return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(!!s.isBuffer(this))return this.buffer}});Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(!!s.isBuffer(this))return this.byteOffset}});function A(t){if(t>q)throw new RangeError('The value "'+t+'" is invalid for option "size"');var r=new Uint8Array(t);return Object.setPrototypeOf(r,s.prototype),r}function s(t,r,e){if(typeof t=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Z(t)}return vr(t,r,e)}s.poolSize=8192;function vr(t,r,e){if(typeof t=="string")return ue(t,r);if(ArrayBuffer.isView(t))return pe(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(S(t,ArrayBuffer)||t&&S(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(S(t,SharedArrayBuffer)||t&&S(t.buffer,SharedArrayBuffer)))return K(t,r,e);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return s.from(n,r,e);var i=ce(t);if(i)return i;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return s.from(t[Symbol.toPrimitive]("string"),r,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}s.from=function(t,r,e){return vr(t,r,e)};Object.setPrototypeOf(s.prototype,Uint8Array.prototype);Object.setPrototypeOf(s,Uint8Array);function kr(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function se(t,r,e){return kr(t),t<=0?A(t):r!==void 0?typeof e=="string"?A(t).fill(r,e):A(t).fill(r):A(t)}s.alloc=function(t,r,e){return se(t,r,e)};function Z(t){return kr(t),A(t<0?0:rr(t)|0)}s.allocUnsafe=function(t){return Z(t)};s.allocUnsafeSlow=function(t){return Z(t)};function ue(t,r){if((typeof r!="string"||r==="")&&(r="utf8"),!s.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var e=Fr(t,r)|0,n=A(e),i=n.write(t,r);return i!==e&&(n=n.slice(0,i)),n}function J(t){for(var r=t.length<0?0:rr(t.length)|0,e=A(r),n=0;n<r;n+=1)e[n]=t[n]&255;return e}function pe(t){if(S(t,Uint8Array)){var r=new Uint8Array(t);return K(r.buffer,r.byteOffset,r.byteLength)}return J(t)}function K(t,r,e){if(r<0||t.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<r+(e||0))throw new RangeError('"length" is outside of buffer bounds');var n;return r===void 0&&e===void 0?n=new Uint8Array(t):e===void 0?n=new Uint8Array(t,r):n=new Uint8Array(t,r,e),Object.setPrototypeOf(n,s.prototype),n}function ce(t){if(s.isBuffer(t)){var r=rr(t.length)|0,e=A(r);return e.length===0||t.copy(e,0,0,r),e}if(t.length!==void 0)return typeof t.length!="number"||er(t.length)?A(0):J(t);if(t.type==="Buffer"&&Array.isArray(t.data))return J(t.data)}function rr(t){if(t>=q)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+q.toString(16)+" bytes");return t|0}function le(t){return+t!=t&&(t=0),s.alloc(+t)}s.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==s.prototype};s.compare=function(r,e){if(S(r,Uint8Array)&&(r=s.from(r,r.offset,r.byteLength)),S(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(r)||!s.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===e)return 0;for(var n=r.length,i=e.length,a=0,o=Math.min(n,i);a<o;++a)if(r[a]!==e[a]){n=r[a],i=e[a];break}return n<i?-1:i<n?1:0};s.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}};s.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return s.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var i=s.allocUnsafe(e),a=0;for(n=0;n<r.length;++n){var o=r[n];if(S(o,Uint8Array))a+o.length>i.length?s.from(o).copy(i,a):Uint8Array.prototype.set.call(i,o,a);else if(s.isBuffer(o))o.copy(i,a);else throw new TypeError('"list" argument must be an Array of Buffers');a+=o.length}return i};function Fr(t,r){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||S(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var e=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&e===0)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return j(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Rr(t).length;default:if(i)return n?-1:j(t).length;r=(""+r).toLowerCase(),i=!0}}s.byteLength=Fr;function fe(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return ke(this,r,e);case"utf8":case"utf-8":return Sr(this,r,e);case"ascii":return we(this,r,e);case"latin1":case"binary":return ve(this,r,e);case"base64":return xe(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Fe(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function D(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}s.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 e=0;e<r;e+=2)D(this,e,e+1);return this};s.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 e=0;e<r;e+=4)D(this,e,e+3),D(this,e+1,e+2);return this};s.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 e=0;e<r;e+=8)D(this,e,e+7),D(this,e+1,e+6),D(this,e+2,e+5),D(this,e+3,e+4);return this};s.prototype.toString=function(){var r=this.length;return r===0?"":arguments.length===0?Sr(this,0,r):fe.apply(this,arguments)};s.prototype.toLocaleString=s.prototype.toString;s.prototype.equals=function(r){if(!s.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:s.compare(this,r)===0};s.prototype.inspect=function(){var r="",e=C.INSPECT_MAX_BYTES;return r=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(r+=" ... "),"<Buffer "+r+">"};xr&&(s.prototype[xr]=s.prototype.inspect);s.prototype.compare=function(r,e,n,i,a){if(S(r,Uint8Array)&&(r=s.from(r,r.offset,r.byteLength)),!s.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),e<0||n>r.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&e>=n)return 0;if(i>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,a>>>=0,this===r)return 0;for(var o=a-i,u=n-e,p=Math.min(o,u),l=this.slice(i,a),g=r.slice(e,n),c=0;c<p;++c)if(l[c]!==g[c]){o=l[c],u=g[c];break}return o<u?-1:u<o?1:0};function Ir(t,r,e,n,i){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,er(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=s.from(r,n)),s.isBuffer(r))return r.length===0?-1:Tr(t,r,e,n,i);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Tr(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function Tr(t,r,e,n,i){var a=1,o=t.length,u=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;a=2,o/=2,u/=2,e/=2}function p(h,k){return a===1?h[k]:h.readUInt16BE(k*a)}var l;if(i){var g=-1;for(l=e;l<o;l++)if(p(t,l)===p(r,g===-1?0:l-g)){if(g===-1&&(g=l),l-g+1===u)return g*a}else g!==-1&&(l-=l-g),g=-1}else for(e+u>o&&(e=o-u),l=e;l>=0;l--){for(var c=!0,d=0;d<u;d++)if(p(t,l+d)!==p(r,d)){c=!1;break}if(c)return l}return-1}s.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};s.prototype.indexOf=function(r,e,n){return Ir(this,r,e,n,!0)};s.prototype.lastIndexOf=function(r,e,n){return Ir(this,r,e,n,!1)};function ge(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var a=r.length;n>a/2&&(n=a/2);for(var o=0;o<n;++o){var u=parseInt(r.substr(o*2,2),16);if(er(u))return o;t[e+o]=u}return o}function he(t,r,e,n){return W(j(r,t.length-e),t,e,n)}function de(t,r,e,n){return W(be(r),t,e,n)}function ye(t,r,e,n){return W(Rr(r),t,e,n)}function me(t,r,e,n){return W(Be(r,t.length-e),t,e,n)}s.prototype.write=function(r,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e>>>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 a=this.length-e;if((n===void 0||n>a)&&(n=a),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return ge(this,r,e,n);case"utf8":case"utf-8":return he(this,r,e,n);case"ascii":case"latin1":case"binary":return de(this,r,e,n);case"base64":return ye(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return me(this,r,e,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function xe(t,r,e){return r===0&&e===t.length?V.fromByteArray(t):V.fromByteArray(t.slice(r,e))}function Sr(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var a=t[i],o=null,u=a>239?4:a>223?3:a>191?2:1;if(i+u<=e){var p,l,g,c;switch(u){case 1:a<128&&(o=a);break;case 2:p=t[i+1],(p&192)===128&&(c=(a&31)<<6|p&63,c>127&&(o=c));break;case 3:p=t[i+1],l=t[i+2],(p&192)===128&&(l&192)===128&&(c=(a&15)<<12|(p&63)<<6|l&63,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:p=t[i+1],l=t[i+2],g=t[i+3],(p&192)===128&&(l&192)===128&&(g&192)===128&&(c=(a&15)<<18|(p&63)<<12|(l&63)<<6|g&63,c>65535&&c<1114112&&(o=c))}}o===null?(o=65533,u=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=u}return Te(n)}var wr=4096;function Te(t){var r=t.length;if(r<=wr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=wr));return e}function we(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]&127);return n}function ve(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function ke(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",a=r;a<e;++a)i+=Ae[t[a]];return i}function Fe(t,r,e){for(var n=t.slice(r,e),i="",a=0;a<n.length-1;a+=2)i+=String.fromCharCode(n[a]+n[a+1]*256);return i}s.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var i=this.subarray(r,e);return Object.setPrototypeOf(i,s.prototype),i};function w(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(r,e,n){r=r>>>0,e=e>>>0,n||w(r,e,this.length);for(var i=this[r],a=1,o=0;++o<e&&(a*=256);)i+=this[r+o]*a;return i};s.prototype.readUintBE=s.prototype.readUIntBE=function(r,e,n){r=r>>>0,e=e>>>0,n||w(r,e,this.length);for(var i=this[r+--e],a=1;e>0&&(a*=256);)i+=this[r+--e]*a;return i};s.prototype.readUint8=s.prototype.readUInt8=function(r,e){return r=r>>>0,e||w(r,1,this.length),this[r]};s.prototype.readUint16LE=s.prototype.readUInt16LE=function(r,e){return r=r>>>0,e||w(r,2,this.length),this[r]|this[r+1]<<8};s.prototype.readUint16BE=s.prototype.readUInt16BE=function(r,e){return r=r>>>0,e||w(r,2,this.length),this[r]<<8|this[r+1]};s.prototype.readUint32LE=s.prototype.readUInt32LE=function(r,e){return r=r>>>0,e||w(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};s.prototype.readUint32BE=s.prototype.readUInt32BE=function(r,e){return r=r>>>0,e||w(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};s.prototype.readIntLE=function(r,e,n){r=r>>>0,e=e>>>0,n||w(r,e,this.length);for(var i=this[r],a=1,o=0;++o<e&&(a*=256);)i+=this[r+o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*e)),i};s.prototype.readIntBE=function(r,e,n){r=r>>>0,e=e>>>0,n||w(r,e,this.length);for(var i=e,a=1,o=this[r+--i];i>0&&(a*=256);)o+=this[r+--i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};s.prototype.readInt8=function(r,e){return r=r>>>0,e||w(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};s.prototype.readInt16LE=function(r,e){r=r>>>0,e||w(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(r,e){r=r>>>0,e||w(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(r,e){return r=r>>>0,e||w(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};s.prototype.readInt32BE=function(r,e){return r=r>>>0,e||w(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};s.prototype.readFloatLE=function(r,e){return r=r>>>0,e||w(r,4,this.length),L.read(this,r,!0,23,4)};s.prototype.readFloatBE=function(r,e){return r=r>>>0,e||w(r,4,this.length),L.read(this,r,!1,23,4)};s.prototype.readDoubleLE=function(r,e){return r=r>>>0,e||w(r,8,this.length),L.read(this,r,!0,52,8)};s.prototype.readDoubleBE=function(r,e){return r=r>>>0,e||w(r,8,this.length),L.read(this,r,!1,52,8)};function v(t,r,e,n,i,a){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<a)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(r,e,n,i){if(r=+r,e=e>>>0,n=n>>>0,!i){var a=Math.pow(2,8*n)-1;v(this,r,e,n,a,0)}var o=1,u=0;for(this[e]=r&255;++u<n&&(o*=256);)this[e+u]=r/o&255;return e+n};s.prototype.writeUintBE=s.prototype.writeUIntBE=function(r,e,n,i){if(r=+r,e=e>>>0,n=n>>>0,!i){var a=Math.pow(2,8*n)-1;v(this,r,e,n,a,0)}var o=n-1,u=1;for(this[e+o]=r&255;--o>=0&&(u*=256);)this[e+o]=r/u&255;return e+n};s.prototype.writeUint8=s.prototype.writeUInt8=function(r,e,n){return r=+r,e=e>>>0,n||v(this,r,e,1,255,0),this[e]=r&255,e+1};s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e>>>0,n||v(this,r,e,2,65535,0),this[e]=r&255,this[e+1]=r>>>8,e+2};s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e>>>0,n||v(this,r,e,2,65535,0),this[e]=r>>>8,this[e+1]=r&255,e+2};s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e>>>0,n||v(this,r,e,4,4294967295,0),this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255,e+4};s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e>>>0,n||v(this,r,e,4,4294967295,0),this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255,e+4};s.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e>>>0,!i){var a=Math.pow(2,8*n-1);v(this,r,e,n,a-1,-a)}var o=0,u=1,p=0;for(this[e]=r&255;++o<n&&(u*=256);)r<0&&p===0&&this[e+o-1]!==0&&(p=1),this[e+o]=(r/u>>0)-p&255;return e+n};s.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e>>>0,!i){var a=Math.pow(2,8*n-1);v(this,r,e,n,a-1,-a)}var o=n-1,u=1,p=0;for(this[e+o]=r&255;--o>=0&&(u*=256);)r<0&&p===0&&this[e+o+1]!==0&&(p=1),this[e+o]=(r/u>>0)-p&255;return e+n};s.prototype.writeInt8=function(r,e,n){return r=+r,e=e>>>0,n||v(this,r,e,1,127,-128),r<0&&(r=255+r+1),this[e]=r&255,e+1};s.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e>>>0,n||v(this,r,e,2,32767,-32768),this[e]=r&255,this[e+1]=r>>>8,e+2};s.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e>>>0,n||v(this,r,e,2,32767,-32768),this[e]=r>>>8,this[e+1]=r&255,e+2};s.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e>>>0,n||v(this,r,e,4,2147483647,-2147483648),this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24,e+4};s.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e>>>0,n||v(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255,e+4};function br(t,r,e,n,i,a){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Br(t,r,e,n,i){return r=+r,e=e>>>0,i||br(t,r,e,4,34028234663852886e22,-34028234663852886e22),L.write(t,r,e,n,23,4),e+4}s.prototype.writeFloatLE=function(r,e,n){return Br(this,r,e,!0,n)};s.prototype.writeFloatBE=function(r,e,n){return Br(this,r,e,!1,n)};function Ar(t,r,e,n,i){return r=+r,e=e>>>0,i||br(t,r,e,8,17976931348623157e292,-17976931348623157e292),L.write(t,r,e,n,52,8),e+8}s.prototype.writeDoubleLE=function(r,e,n){return Ar(this,r,e,!0,n)};s.prototype.writeDoubleBE=function(r,e,n){return Ar(this,r,e,!1,n)};s.prototype.copy=function(r,e,n,i){if(!s.isBuffer(r))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<n&&(i=n),i===n||r.length===0||this.length===0)return 0;if(e<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-e<i-n&&(i=r.length-e+n);var a=i-n;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(e,n,i):Uint8Array.prototype.set.call(r,this.subarray(n,i),e),a};s.prototype.fill=function(r,e,n,i){if(typeof r=="string"){if(typeof e=="string"?(i=e,e=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"&&!s.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(r.length===1){var a=r.charCodeAt(0);(i==="utf8"&&a<128||i==="latin1")&&(r=a)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var o;if(typeof r=="number")for(o=e;o<n;++o)this[o]=r;else{var u=s.isBuffer(r)?r:s.from(r,i),p=u.length;if(p===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(o=0;o<n-e;++o)this[o+e]=u[o%p]}return this};var Ie=/[^+/0-9A-Za-z-_]/g;function Se(t){if(t=t.split("=")[0],t=t.trim().replace(Ie,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function j(t,r){r=r||1/0;for(var e,n=t.length,i=null,a=[],o=0;o<n;++o){if(e=t.charCodeAt(o),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(o+1===n){(r-=3)>-1&&a.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&a.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;a.push(e)}else if(e<2048){if((r-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}function be(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function Be(t,r){for(var e,n,i,a=[],o=0;o<t.length&&!((r-=2)<0);++o)e=t.charCodeAt(o),n=e>>8,i=e%256,a.push(i),a.push(n);return a}function Rr(t){return V.toByteArray(Se(t))}function W(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function S(t,r){return t instanceof r||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===r.name}function er(t){return t!==t}var Ae=function(){for(var t="0123456789abcdef",r=new Array(256),e=0;e<16;++e)for(var n=e*16,i=0;i<16;++i)r[n+i]=t[e]+t[i];return r}()});var Cr=O((He,Lr)=>{f();var x=Lr.exports={},b,B;function tr(){throw new Error("setTimeout has not been defined")}function nr(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?b=setTimeout:b=tr}catch(t){b=tr}try{typeof clearTimeout=="function"?B=clearTimeout:B=nr}catch(t){B=nr}})();function Er(t){if(b===setTimeout)return setTimeout(t,0);if((b===tr||!b)&&setTimeout)return b=setTimeout,setTimeout(t,0);try{return b(t,0)}catch(r){try{return b.call(null,t,0)}catch(e){return b.call(this,t,0)}}}function Re(t){if(B===clearTimeout)return clearTimeout(t);if((B===nr||!B)&&clearTimeout)return B=clearTimeout,clearTimeout(t);try{return B(t)}catch(r){try{return B.call(null,t)}catch(e){return B.call(this,t)}}}var R=[],N=!1,U,Y=-1;function _e(){!N||!U||(N=!1,U.length?R=U.concat(R):Y=-1,R.length&&Dr())}function Dr(){if(!N){var t=Er(_e);N=!0;for(var r=R.length;r;){for(U=R,R=[];++Y<r;)U&&U[Y].run();Y=-1,r=R.length}U=null,N=!1,Re(t)}}x.nextTick=function(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];R.push(new Ur(t,r)),R.length===1&&!N&&Er(Dr)};function Ur(t,r){this.fun=t,this.array=r}Ur.prototype.run=function(){this.fun.apply(null,this.array)};x.title="browser";x.browser=!0;x.env={};x.argv=[];x.version="";x.versions={};function _(){}x.on=_;x.addListener=_;x.once=_;x.off=_;x.removeListener=_;x.removeAllListeners=_;x.emit=_;x.prependListener=_;x.prependOnceListener=_;x.listeners=function(t){return[]};x.binding=function(t){throw new Error("process.binding is not supported")};x.cwd=function(){return"/"};x.chdir=function(t){throw new Error("process.chdir is not supported")};x.umask=function(){return 0}});var y,m,Ge,f=Jr(()=>{y=H(_r()),m=H(Cr()),Ge=function(t){function r(){var n=this||self;return delete t.prototype.__magic__,n}if(typeof globalThis=="object")return globalThis;if(this)return r();t.defineProperty(t.prototype,"__magic__",{configurable:!0,get:r});var e=__magic__;return e}(Object)});var Ce={};Kr(Ce,{useParseMultiEsdtTransferData:()=>Le});module.exports=jr(Ce);f();var M=require("react");f();var ar=require("@multiversx/sdk-core"),or=H(require("bignumber.js"));f();f();var Nr=require("@multiversx/sdk-core");function Ee(t){try{let r=new Nr.Address(t);return Boolean(r.bech32())}catch(r){return!1}}function Pr(t){return(t==null?void 0:t.startsWith("erd"))&&t.length===62&&/^\w+$/.test(t)&&Ee(t)}f();f();function Mr(t){for(let r=0;r<t.length;r++)if(t.charCodeAt(r)>127)return!1;return!0}function z(t){let r=t;try{let e=y.Buffer.from(t,"hex").toString();Mr(e)&&e.length>1&&(r=e)}catch(e){}return r}var ir={tokenId:"",amount:""},Ue=t=>t.split("@").map((a,o)=>[2,3].includes(o)?a:z(a));function Or(t){if(!t)return ir;let r=t.startsWith("ESDTTransfer"),e=t.startsWith("ESDTNFTTransfer")&&t.includes("@");if(r){let[,n,i]=t.split("@");try{let a=y.Buffer.from(n,"hex").toString("ascii");if(!a)return ir;let o=new or.default("0x"+i.replace("0x","")).toString(10);return{tokenId:a,amount:o}}catch(a){console.error("Error getting token from transaction data",a)}}if(e)try{let[,n,i,a,o]=Ue(t);if([n,i,a,o].every(u=>Boolean(u))&&Pr(new ar.Address(o).bech32()))return{tokenId:`${n}-${i}`,amount:new or.default(a,16).toString(10),collection:n,nonce:i,receiver:new ar.Address(o).bech32()}}catch(n){}return ir}f();var sr=H(require("bignumber.js"));f();f();f();f();f();f();f();f();f();f();var Hr=(t,r)=>{let e=[],n=t.indexOf(r,0);for(;n>=0;)e.push(n),n=t.indexOf(r,n+1);return e};function Gr(t){let r=[],e=0;try{if((t==null?void 0:t.startsWith("MultiESDTNFTTransfer"))&&(t==null?void 0:t.includes("@"))){let[,n,i,...a]=t==null?void 0:t.split("@");if(n){let o=new sr.default(i,16).toNumber(),u=0;for(let c=0;c<o;c++){let d={type:"nftTransaction",data:"",receiver:n};for(let h=0;h<3;h++){switch(h){case 0:d.token=z(a[u]),d.data=a[u];break;case 1:{let k=a[u]&&a[u].length?a[u]:"";k?d.nonce=k:d.type="esdtTransaction",d.data=`${d.data}@${a[u]}`;break}case 2:d.amount=new sr.default(a[u],16).toString(10),d.data=`${d.data}@${a[u]}`;break;default:break}e=u+1,u++}r[c]=d}let p=r.length!==o,l=r.some(c=>Hr(c.data,"@").length!==2),g=r.some(c=>c.data.startsWith("@"));if(p||l||g)return[];if(a[e]){let c=a[e];for(let d=e+1;d<a.length;d++)c+="@"+a[d];r[o]={type:"scCall",data:c,receiver:n}}}}}catch(n){return console.error("failed parsing tx",n),r}return r}var qr={tokenId:"",amount:"",type:"",multiTxData:"",receiver:""};function Le({transactions:t}){let[r,e]=(0,M.useState)({}),[n,i]=(0,M.useState)([]);function a(p,l){e(g=>fr(lr({},g),{[p]:l}))}function o(p,l){return r==null?qr:p in r?r[p]:l!=null&&String(l)in r?r[l]:qr}function u(){if(t&&t.length>0){let p=[];t.forEach((l,g)=>{let c=l.getData().toString(),d=Gr(c);if(d.length>0)d.forEach((h,k)=>{let $={transaction:l,multiTxData:h.data,transactionIndex:k};a(h.data,{tokenId:h.token?h.token:"",amount:h.amount?h.amount:"",type:h.type,nonce:h.nonce?h.nonce:"",multiTxData:h.data,receiver:h.receiver}),p.push($)});else{let{tokenId:h,amount:k}=Or(l.getData().toString());h&&a(l.getData().toString(),{tokenId:h,amount:k,receiver:l.getReceiver().bech32()}),p.push({transaction:l,transactionIndex:g})}}),i(p)}}return(0,M.useEffect)(()=>{u()},[t==null?void 0:t.length]),{parsedTransactionsByDataField:r,getTxInfoByDataField:o,allTransactions:n}}0&&(module.exports={useParseMultiEsdtTransferData});
1
+ "use strict";var Wr=Object.create;var P=Object.defineProperty,Yr=Object.defineProperties,zr=Object.getOwnPropertyDescriptor,$r=Object.getOwnPropertyDescriptors,Qr=Object.getOwnPropertyNames,ur=Object.getOwnPropertySymbols,Xr=Object.getPrototypeOf,cr=Object.prototype.hasOwnProperty,Vr=Object.prototype.propertyIsEnumerable;var pr=(t,r,e)=>r in t?P(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,lr=(t,r)=>{for(var e in r||(r={}))cr.call(r,e)&&pr(t,e,r[e]);if(ur)for(var e of ur(r))Vr.call(r,e)&&pr(t,e,r[e]);return t},fr=(t,r)=>Yr(t,$r(r));var Jr=(t,r)=>()=>(t&&(r=t(t=0)),r);var O=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports),Kr=(t,r)=>{for(var e in r)P(t,e,{get:r[e],enumerable:!0})},gr=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Qr(r))!cr.call(t,i)&&i!==e&&P(t,i,{get:()=>r[i],enumerable:!(n=zr(r,i))||n.enumerable});return t};var H=(t,r,e)=>(e=t!=null?Wr(Xr(t)):{},gr(r||!t||!t.__esModule?P(e,"default",{value:t,enumerable:!0}):e,t)),jr=t=>gr(P({},"__esModule",{value:!0}),t);var yr=O(G=>{"use strict";f();G.byteLength=re;G.toByteArray=te;G.fromByteArray=ae;var I=[],F=[],Zr=typeof Uint8Array!="undefined"?Uint8Array:Array,Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(E=0,hr=Q.length;E<hr;++E)I[E]=Q[E],F[Q.charCodeAt(E)]=E;var E,hr;F["-".charCodeAt(0)]=62;F["_".charCodeAt(0)]=63;function dr(t){var r=t.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=t.indexOf("=");e===-1&&(e=r);var n=e===r?0:4-e%4;return[e,n]}function re(t){var r=dr(t),e=r[0],n=r[1];return(e+n)*3/4-n}function ee(t,r,e){return(r+e)*3/4-e}function te(t){var r,e=dr(t),n=e[0],i=e[1],a=new Zr(ee(t,n,i)),o=0,u=i>0?n-4:n,p;for(p=0;p<u;p+=4)r=F[t.charCodeAt(p)]<<18|F[t.charCodeAt(p+1)]<<12|F[t.charCodeAt(p+2)]<<6|F[t.charCodeAt(p+3)],a[o++]=r>>16&255,a[o++]=r>>8&255,a[o++]=r&255;return i===2&&(r=F[t.charCodeAt(p)]<<2|F[t.charCodeAt(p+1)]>>4,a[o++]=r&255),i===1&&(r=F[t.charCodeAt(p)]<<10|F[t.charCodeAt(p+1)]<<4|F[t.charCodeAt(p+2)]>>2,a[o++]=r>>8&255,a[o++]=r&255),a}function ne(t){return I[t>>18&63]+I[t>>12&63]+I[t>>6&63]+I[t&63]}function ie(t,r,e){for(var n,i=[],a=r;a<e;a+=3)n=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(t[a+2]&255),i.push(ne(n));return i.join("")}function ae(t){for(var r,e=t.length,n=e%3,i=[],a=16383,o=0,u=e-n;o<u;o+=a)i.push(ie(t,o,o+a>u?u:o+a));return n===1?(r=t[e-1],i.push(I[r>>2]+I[r<<4&63]+"==")):n===2&&(r=(t[e-2]<<8)+t[e-1],i.push(I[r>>10]+I[r>>4&63]+I[r<<2&63]+"=")),i.join("")}});var mr=O(X=>{f();X.read=function(t,r,e,n,i){var a,o,u=i*8-n-1,p=(1<<u)-1,l=p>>1,g=-7,c=e?i-1:0,d=e?-1:1,h=t[r+c];for(c+=d,a=h&(1<<-g)-1,h>>=-g,g+=u;g>0;a=a*256+t[r+c],c+=d,g-=8);for(o=a&(1<<-g)-1,a>>=-g,g+=n;g>0;o=o*256+t[r+c],c+=d,g-=8);if(a===0)a=1-l;else{if(a===p)return o?NaN:(h?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-l}return(h?-1:1)*o*Math.pow(2,a-n)};X.write=function(t,r,e,n,i,a){var o,u,p,l=a*8-i-1,g=(1<<l)-1,c=g>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:a-1,v=n?1:-1,$=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(u=isNaN(r)?1:0,o=g):(o=Math.floor(Math.log(r)/Math.LN2),r*(p=Math.pow(2,-o))<1&&(o--,p*=2),o+c>=1?r+=d/p:r+=d*Math.pow(2,1-c),r*p>=2&&(o++,p/=2),o+c>=g?(u=0,o=g):o+c>=1?(u=(r*p-1)*Math.pow(2,i),o=o+c):(u=r*Math.pow(2,c-1)*Math.pow(2,i),o=0));i>=8;t[e+h]=u&255,h+=v,u/=256,i-=8);for(o=o<<i|u,l+=i;l>0;t[e+h]=o&255,h+=v,o/=256,l-=8);t[e+h-v]|=$*128}});var _r=O(C=>{"use strict";f();var V=yr(),L=mr(),xr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;C.Buffer=s;C.SlowBuffer=le;C.INSPECT_MAX_BYTES=50;var q=2147483647;C.kMaxLength=q;s.TYPED_ARRAY_SUPPORT=oe();!s.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 oe(){try{var t=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(t,r),t.foo()===42}catch(e){return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(!!s.isBuffer(this))return this.buffer}});Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(!!s.isBuffer(this))return this.byteOffset}});function A(t){if(t>q)throw new RangeError('The value "'+t+'" is invalid for option "size"');var r=new Uint8Array(t);return Object.setPrototypeOf(r,s.prototype),r}function s(t,r,e){if(typeof t=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Z(t)}return vr(t,r,e)}s.poolSize=8192;function vr(t,r,e){if(typeof t=="string")return ue(t,r);if(ArrayBuffer.isView(t))return pe(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(S(t,ArrayBuffer)||t&&S(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(S(t,SharedArrayBuffer)||t&&S(t.buffer,SharedArrayBuffer)))return K(t,r,e);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return s.from(n,r,e);var i=ce(t);if(i)return i;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return s.from(t[Symbol.toPrimitive]("string"),r,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}s.from=function(t,r,e){return vr(t,r,e)};Object.setPrototypeOf(s.prototype,Uint8Array.prototype);Object.setPrototypeOf(s,Uint8Array);function kr(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function se(t,r,e){return kr(t),t<=0?A(t):r!==void 0?typeof e=="string"?A(t).fill(r,e):A(t).fill(r):A(t)}s.alloc=function(t,r,e){return se(t,r,e)};function Z(t){return kr(t),A(t<0?0:rr(t)|0)}s.allocUnsafe=function(t){return Z(t)};s.allocUnsafeSlow=function(t){return Z(t)};function ue(t,r){if((typeof r!="string"||r==="")&&(r="utf8"),!s.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var e=Fr(t,r)|0,n=A(e),i=n.write(t,r);return i!==e&&(n=n.slice(0,i)),n}function J(t){for(var r=t.length<0?0:rr(t.length)|0,e=A(r),n=0;n<r;n+=1)e[n]=t[n]&255;return e}function pe(t){if(S(t,Uint8Array)){var r=new Uint8Array(t);return K(r.buffer,r.byteOffset,r.byteLength)}return J(t)}function K(t,r,e){if(r<0||t.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<r+(e||0))throw new RangeError('"length" is outside of buffer bounds');var n;return r===void 0&&e===void 0?n=new Uint8Array(t):e===void 0?n=new Uint8Array(t,r):n=new Uint8Array(t,r,e),Object.setPrototypeOf(n,s.prototype),n}function ce(t){if(s.isBuffer(t)){var r=rr(t.length)|0,e=A(r);return e.length===0||t.copy(e,0,0,r),e}if(t.length!==void 0)return typeof t.length!="number"||er(t.length)?A(0):J(t);if(t.type==="Buffer"&&Array.isArray(t.data))return J(t.data)}function rr(t){if(t>=q)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+q.toString(16)+" bytes");return t|0}function le(t){return+t!=t&&(t=0),s.alloc(+t)}s.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==s.prototype};s.compare=function(r,e){if(S(r,Uint8Array)&&(r=s.from(r,r.offset,r.byteLength)),S(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(r)||!s.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===e)return 0;for(var n=r.length,i=e.length,a=0,o=Math.min(n,i);a<o;++a)if(r[a]!==e[a]){n=r[a],i=e[a];break}return n<i?-1:i<n?1:0};s.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}};s.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return s.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var i=s.allocUnsafe(e),a=0;for(n=0;n<r.length;++n){var o=r[n];if(S(o,Uint8Array))a+o.length>i.length?s.from(o).copy(i,a):Uint8Array.prototype.set.call(i,o,a);else if(s.isBuffer(o))o.copy(i,a);else throw new TypeError('"list" argument must be an Array of Buffers');a+=o.length}return i};function Fr(t,r){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||S(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var e=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&e===0)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return j(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Rr(t).length;default:if(i)return n?-1:j(t).length;r=(""+r).toLowerCase(),i=!0}}s.byteLength=Fr;function fe(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return ke(this,r,e);case"utf8":case"utf-8":return Sr(this,r,e);case"ascii":return we(this,r,e);case"latin1":case"binary":return ve(this,r,e);case"base64":return xe(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Fe(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function D(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}s.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 e=0;e<r;e+=2)D(this,e,e+1);return this};s.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 e=0;e<r;e+=4)D(this,e,e+3),D(this,e+1,e+2);return this};s.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 e=0;e<r;e+=8)D(this,e,e+7),D(this,e+1,e+6),D(this,e+2,e+5),D(this,e+3,e+4);return this};s.prototype.toString=function(){var r=this.length;return r===0?"":arguments.length===0?Sr(this,0,r):fe.apply(this,arguments)};s.prototype.toLocaleString=s.prototype.toString;s.prototype.equals=function(r){if(!s.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:s.compare(this,r)===0};s.prototype.inspect=function(){var r="",e=C.INSPECT_MAX_BYTES;return r=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(r+=" ... "),"<Buffer "+r+">"};xr&&(s.prototype[xr]=s.prototype.inspect);s.prototype.compare=function(r,e,n,i,a){if(S(r,Uint8Array)&&(r=s.from(r,r.offset,r.byteLength)),!s.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),e<0||n>r.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&e>=n)return 0;if(i>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,a>>>=0,this===r)return 0;for(var o=a-i,u=n-e,p=Math.min(o,u),l=this.slice(i,a),g=r.slice(e,n),c=0;c<p;++c)if(l[c]!==g[c]){o=l[c],u=g[c];break}return o<u?-1:u<o?1:0};function Ir(t,r,e,n,i){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,er(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=s.from(r,n)),s.isBuffer(r))return r.length===0?-1:Tr(t,r,e,n,i);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Tr(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function Tr(t,r,e,n,i){var a=1,o=t.length,u=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;a=2,o/=2,u/=2,e/=2}function p(h,v){return a===1?h[v]:h.readUInt16BE(v*a)}var l;if(i){var g=-1;for(l=e;l<o;l++)if(p(t,l)===p(r,g===-1?0:l-g)){if(g===-1&&(g=l),l-g+1===u)return g*a}else g!==-1&&(l-=l-g),g=-1}else for(e+u>o&&(e=o-u),l=e;l>=0;l--){for(var c=!0,d=0;d<u;d++)if(p(t,l+d)!==p(r,d)){c=!1;break}if(c)return l}return-1}s.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};s.prototype.indexOf=function(r,e,n){return Ir(this,r,e,n,!0)};s.prototype.lastIndexOf=function(r,e,n){return Ir(this,r,e,n,!1)};function ge(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var a=r.length;n>a/2&&(n=a/2);for(var o=0;o<n;++o){var u=parseInt(r.substr(o*2,2),16);if(er(u))return o;t[e+o]=u}return o}function he(t,r,e,n){return W(j(r,t.length-e),t,e,n)}function de(t,r,e,n){return W(be(r),t,e,n)}function ye(t,r,e,n){return W(Rr(r),t,e,n)}function me(t,r,e,n){return W(Be(r,t.length-e),t,e,n)}s.prototype.write=function(r,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e>>>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 a=this.length-e;if((n===void 0||n>a)&&(n=a),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return ge(this,r,e,n);case"utf8":case"utf-8":return he(this,r,e,n);case"ascii":case"latin1":case"binary":return de(this,r,e,n);case"base64":return ye(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return me(this,r,e,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function xe(t,r,e){return r===0&&e===t.length?V.fromByteArray(t):V.fromByteArray(t.slice(r,e))}function Sr(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var a=t[i],o=null,u=a>239?4:a>223?3:a>191?2:1;if(i+u<=e){var p,l,g,c;switch(u){case 1:a<128&&(o=a);break;case 2:p=t[i+1],(p&192)===128&&(c=(a&31)<<6|p&63,c>127&&(o=c));break;case 3:p=t[i+1],l=t[i+2],(p&192)===128&&(l&192)===128&&(c=(a&15)<<12|(p&63)<<6|l&63,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:p=t[i+1],l=t[i+2],g=t[i+3],(p&192)===128&&(l&192)===128&&(g&192)===128&&(c=(a&15)<<18|(p&63)<<12|(l&63)<<6|g&63,c>65535&&c<1114112&&(o=c))}}o===null?(o=65533,u=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=u}return Te(n)}var wr=4096;function Te(t){var r=t.length;if(r<=wr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=wr));return e}function we(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]&127);return n}function ve(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function ke(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",a=r;a<e;++a)i+=Ae[t[a]];return i}function Fe(t,r,e){for(var n=t.slice(r,e),i="",a=0;a<n.length-1;a+=2)i+=String.fromCharCode(n[a]+n[a+1]*256);return i}s.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var i=this.subarray(r,e);return Object.setPrototypeOf(i,s.prototype),i};function w(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(r,e,n){r=r>>>0,e=e>>>0,n||w(r,e,this.length);for(var i=this[r],a=1,o=0;++o<e&&(a*=256);)i+=this[r+o]*a;return i};s.prototype.readUintBE=s.prototype.readUIntBE=function(r,e,n){r=r>>>0,e=e>>>0,n||w(r,e,this.length);for(var i=this[r+--e],a=1;e>0&&(a*=256);)i+=this[r+--e]*a;return i};s.prototype.readUint8=s.prototype.readUInt8=function(r,e){return r=r>>>0,e||w(r,1,this.length),this[r]};s.prototype.readUint16LE=s.prototype.readUInt16LE=function(r,e){return r=r>>>0,e||w(r,2,this.length),this[r]|this[r+1]<<8};s.prototype.readUint16BE=s.prototype.readUInt16BE=function(r,e){return r=r>>>0,e||w(r,2,this.length),this[r]<<8|this[r+1]};s.prototype.readUint32LE=s.prototype.readUInt32LE=function(r,e){return r=r>>>0,e||w(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};s.prototype.readUint32BE=s.prototype.readUInt32BE=function(r,e){return r=r>>>0,e||w(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};s.prototype.readIntLE=function(r,e,n){r=r>>>0,e=e>>>0,n||w(r,e,this.length);for(var i=this[r],a=1,o=0;++o<e&&(a*=256);)i+=this[r+o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*e)),i};s.prototype.readIntBE=function(r,e,n){r=r>>>0,e=e>>>0,n||w(r,e,this.length);for(var i=e,a=1,o=this[r+--i];i>0&&(a*=256);)o+=this[r+--i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};s.prototype.readInt8=function(r,e){return r=r>>>0,e||w(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};s.prototype.readInt16LE=function(r,e){r=r>>>0,e||w(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(r,e){r=r>>>0,e||w(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(r,e){return r=r>>>0,e||w(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};s.prototype.readInt32BE=function(r,e){return r=r>>>0,e||w(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};s.prototype.readFloatLE=function(r,e){return r=r>>>0,e||w(r,4,this.length),L.read(this,r,!0,23,4)};s.prototype.readFloatBE=function(r,e){return r=r>>>0,e||w(r,4,this.length),L.read(this,r,!1,23,4)};s.prototype.readDoubleLE=function(r,e){return r=r>>>0,e||w(r,8,this.length),L.read(this,r,!0,52,8)};s.prototype.readDoubleBE=function(r,e){return r=r>>>0,e||w(r,8,this.length),L.read(this,r,!1,52,8)};function k(t,r,e,n,i,a){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<a)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(r,e,n,i){if(r=+r,e=e>>>0,n=n>>>0,!i){var a=Math.pow(2,8*n)-1;k(this,r,e,n,a,0)}var o=1,u=0;for(this[e]=r&255;++u<n&&(o*=256);)this[e+u]=r/o&255;return e+n};s.prototype.writeUintBE=s.prototype.writeUIntBE=function(r,e,n,i){if(r=+r,e=e>>>0,n=n>>>0,!i){var a=Math.pow(2,8*n)-1;k(this,r,e,n,a,0)}var o=n-1,u=1;for(this[e+o]=r&255;--o>=0&&(u*=256);)this[e+o]=r/u&255;return e+n};s.prototype.writeUint8=s.prototype.writeUInt8=function(r,e,n){return r=+r,e=e>>>0,n||k(this,r,e,1,255,0),this[e]=r&255,e+1};s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e>>>0,n||k(this,r,e,2,65535,0),this[e]=r&255,this[e+1]=r>>>8,e+2};s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e>>>0,n||k(this,r,e,2,65535,0),this[e]=r>>>8,this[e+1]=r&255,e+2};s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e>>>0,n||k(this,r,e,4,4294967295,0),this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255,e+4};s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e>>>0,n||k(this,r,e,4,4294967295,0),this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255,e+4};s.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e>>>0,!i){var a=Math.pow(2,8*n-1);k(this,r,e,n,a-1,-a)}var o=0,u=1,p=0;for(this[e]=r&255;++o<n&&(u*=256);)r<0&&p===0&&this[e+o-1]!==0&&(p=1),this[e+o]=(r/u>>0)-p&255;return e+n};s.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e>>>0,!i){var a=Math.pow(2,8*n-1);k(this,r,e,n,a-1,-a)}var o=n-1,u=1,p=0;for(this[e+o]=r&255;--o>=0&&(u*=256);)r<0&&p===0&&this[e+o+1]!==0&&(p=1),this[e+o]=(r/u>>0)-p&255;return e+n};s.prototype.writeInt8=function(r,e,n){return r=+r,e=e>>>0,n||k(this,r,e,1,127,-128),r<0&&(r=255+r+1),this[e]=r&255,e+1};s.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e>>>0,n||k(this,r,e,2,32767,-32768),this[e]=r&255,this[e+1]=r>>>8,e+2};s.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e>>>0,n||k(this,r,e,2,32767,-32768),this[e]=r>>>8,this[e+1]=r&255,e+2};s.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e>>>0,n||k(this,r,e,4,2147483647,-2147483648),this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24,e+4};s.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e>>>0,n||k(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255,e+4};function br(t,r,e,n,i,a){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Br(t,r,e,n,i){return r=+r,e=e>>>0,i||br(t,r,e,4,34028234663852886e22,-34028234663852886e22),L.write(t,r,e,n,23,4),e+4}s.prototype.writeFloatLE=function(r,e,n){return Br(this,r,e,!0,n)};s.prototype.writeFloatBE=function(r,e,n){return Br(this,r,e,!1,n)};function Ar(t,r,e,n,i){return r=+r,e=e>>>0,i||br(t,r,e,8,17976931348623157e292,-17976931348623157e292),L.write(t,r,e,n,52,8),e+8}s.prototype.writeDoubleLE=function(r,e,n){return Ar(this,r,e,!0,n)};s.prototype.writeDoubleBE=function(r,e,n){return Ar(this,r,e,!1,n)};s.prototype.copy=function(r,e,n,i){if(!s.isBuffer(r))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<n&&(i=n),i===n||r.length===0||this.length===0)return 0;if(e<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-e<i-n&&(i=r.length-e+n);var a=i-n;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(e,n,i):Uint8Array.prototype.set.call(r,this.subarray(n,i),e),a};s.prototype.fill=function(r,e,n,i){if(typeof r=="string"){if(typeof e=="string"?(i=e,e=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"&&!s.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(r.length===1){var a=r.charCodeAt(0);(i==="utf8"&&a<128||i==="latin1")&&(r=a)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var o;if(typeof r=="number")for(o=e;o<n;++o)this[o]=r;else{var u=s.isBuffer(r)?r:s.from(r,i),p=u.length;if(p===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(o=0;o<n-e;++o)this[o+e]=u[o%p]}return this};var Ie=/[^+/0-9A-Za-z-_]/g;function Se(t){if(t=t.split("=")[0],t=t.trim().replace(Ie,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function j(t,r){r=r||1/0;for(var e,n=t.length,i=null,a=[],o=0;o<n;++o){if(e=t.charCodeAt(o),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(o+1===n){(r-=3)>-1&&a.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&a.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;a.push(e)}else if(e<2048){if((r-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}function be(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function Be(t,r){for(var e,n,i,a=[],o=0;o<t.length&&!((r-=2)<0);++o)e=t.charCodeAt(o),n=e>>8,i=e%256,a.push(i),a.push(n);return a}function Rr(t){return V.toByteArray(Se(t))}function W(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function S(t,r){return t instanceof r||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===r.name}function er(t){return t!==t}var Ae=function(){for(var t="0123456789abcdef",r=new Array(256),e=0;e<16;++e)for(var n=e*16,i=0;i<16;++i)r[n+i]=t[e]+t[i];return r}()});var Cr=O((He,Lr)=>{f();var x=Lr.exports={},b,B;function tr(){throw new Error("setTimeout has not been defined")}function nr(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?b=setTimeout:b=tr}catch(t){b=tr}try{typeof clearTimeout=="function"?B=clearTimeout:B=nr}catch(t){B=nr}})();function Er(t){if(b===setTimeout)return setTimeout(t,0);if((b===tr||!b)&&setTimeout)return b=setTimeout,setTimeout(t,0);try{return b(t,0)}catch(r){try{return b.call(null,t,0)}catch(e){return b.call(this,t,0)}}}function Re(t){if(B===clearTimeout)return clearTimeout(t);if((B===nr||!B)&&clearTimeout)return B=clearTimeout,clearTimeout(t);try{return B(t)}catch(r){try{return B.call(null,t)}catch(e){return B.call(this,t)}}}var R=[],N=!1,U,Y=-1;function _e(){!N||!U||(N=!1,U.length?R=U.concat(R):Y=-1,R.length&&Dr())}function Dr(){if(!N){var t=Er(_e);N=!0;for(var r=R.length;r;){for(U=R,R=[];++Y<r;)U&&U[Y].run();Y=-1,r=R.length}U=null,N=!1,Re(t)}}x.nextTick=function(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];R.push(new Ur(t,r)),R.length===1&&!N&&Er(Dr)};function Ur(t,r){this.fun=t,this.array=r}Ur.prototype.run=function(){this.fun.apply(null,this.array)};x.title="browser";x.browser=!0;x.env={};x.argv=[];x.version="";x.versions={};function _(){}x.on=_;x.addListener=_;x.once=_;x.off=_;x.removeListener=_;x.removeAllListeners=_;x.emit=_;x.prependListener=_;x.prependOnceListener=_;x.listeners=function(t){return[]};x.binding=function(t){throw new Error("process.binding is not supported")};x.cwd=function(){return"/"};x.chdir=function(t){throw new Error("process.chdir is not supported")};x.umask=function(){return 0}});var y,m,Ge,f=Jr(()=>{y=H(_r()),m=H(Cr()),Ge=function(t){function r(){var n=this||self;return delete t.prototype.__magic__,n}if(typeof globalThis=="object")return globalThis;if(this)return r();t.defineProperty(t.prototype,"__magic__",{configurable:!0,get:r});var e=__magic__;return e}(Object)});var Ce={};Kr(Ce,{useParseMultiEsdtTransferData:()=>Le});module.exports=jr(Ce);f();var M=require("react");f();var ar=require("@multiversx/sdk-core"),or=H(require("bignumber.js"));f();f();var Nr=require("@multiversx/sdk-core");function Ee(t){try{let r=new Nr.Address(t);return Boolean(r.bech32())}catch(r){return!1}}function Pr(t){return(t==null?void 0:t.startsWith("erd"))&&t.length===62&&/^\w+$/.test(t)&&Ee(t)}f();f();function Mr(t){for(let r=0;r<t.length;r++)if(t.charCodeAt(r)>127)return!1;return!0}function z(t){let r=t;try{let e=y.Buffer.from(t,"hex").toString();Mr(e)&&e.length>1&&(r=e)}catch(e){}return r}var ir={tokenId:"",amount:""},Ue=t=>t.split("@").map((a,o)=>[2,3].includes(o)?a:z(a));function Or(t){if(!t)return ir;let r=t.startsWith("ESDTTransfer"),e=t.startsWith("ESDTNFTTransfer")&&t.includes("@");if(r){let[,n,i]=t.split("@");try{let a=y.Buffer.from(n,"hex").toString("ascii");if(!a)return ir;let o=new or.default("0x"+i.replace("0x","")).toString(10);return{tokenId:a,amount:o}}catch(a){console.error("Error getting token from transaction data",a)}}if(e)try{let[,n,i,a,o]=Ue(t);if([n,i,a,o].every(u=>Boolean(u))&&Pr(new ar.Address(o).bech32()))return{tokenId:`${n}-${i}`,amount:new or.default(a,16).toString(10),collection:n,nonce:i,receiver:new ar.Address(o).bech32()}}catch(n){}return ir}f();var sr=H(require("bignumber.js"));f();f();f();f();f();f();f();f();f();f();var Hr=(t,r)=>{let e=[],n=t.indexOf(r,0);for(;n>=0;)e.push(n),n=t.indexOf(r,n+1);return e};function Gr(t){let r=[],e=0;try{if((t==null?void 0:t.startsWith("MultiESDTNFTTransfer"))&&(t==null?void 0:t.includes("@"))){let[,n,i,...a]=t==null?void 0:t.split("@");if(n){let o=new sr.default(i,16).toNumber(),u=0;for(let c=0;c<o;c++){let d={type:"nftTransaction",data:"",receiver:n};for(let h=0;h<3;h++){switch(h){case 0:d.token=z(a[u]),d.data=a[u];break;case 1:{let v=a[u]&&a[u].length?a[u]:"";v&&v!=="00"?d.nonce=v:d.type="esdtTransaction",d.data=`${d.data}@${a[u]}`;break}case 2:d.amount=new sr.default(a[u],16).toString(10),d.data=`${d.data}@${a[u]}`;break;default:break}e=u+1,u++}r[c]=d}let p=r.length!==o,l=r.some(c=>Hr(c.data,"@").length!==2),g=r.some(c=>c.data.startsWith("@"));if(p||l||g)return[];if(a[e]){let c=a[e];for(let d=e+1;d<a.length;d++)c+="@"+a[d];r[o]={type:"scCall",data:c,receiver:n}}}}}catch(n){return console.error("failed parsing tx",n),r}return r}var qr={tokenId:"",amount:"",type:"",multiTxData:"",receiver:""};function Le({transactions:t}){let[r,e]=(0,M.useState)({}),[n,i]=(0,M.useState)([]);function a(p,l){e(g=>fr(lr({},g),{[p]:l}))}function o(p,l){return r==null?qr:p in r?r[p]:l!=null&&String(l)in r?r[l]:qr}function u(){if(t&&t.length>0){let p=[];t.forEach((l,g)=>{let c=l.getData().toString(),d=Gr(c);if(d.length>0)d.forEach((h,v)=>{let $={transaction:l,multiTxData:h.data,transactionIndex:v};a(h.data,{tokenId:h.token?h.token:"",amount:h.amount?h.amount:"",type:h.type,nonce:h.nonce?h.nonce:"",multiTxData:h.data,receiver:h.receiver}),p.push($)});else{let{tokenId:h,amount:v}=Or(l.getData().toString());h&&a(l.getData().toString(),{tokenId:h,amount:v,receiver:l.getReceiver().bech32()}),p.push({transaction:l,transactionIndex:g})}}),i(p)}}return(0,M.useEffect)(()=>{u()},[t==null?void 0:t.length]),{parsedTransactionsByDataField:r,getTxInfoByDataField:o,allTransactions:n}}0&&(module.exports={useParseMultiEsdtTransferData});
2
2
  /*!
3
3
  * The buffer module from node.js, for the browser.
4
4
  *
@@ -1,4 +1,4 @@
1
- "use strict";var Rr=Object.create;var Y=Object.defineProperty,Er=Object.defineProperties,br=Object.getOwnPropertyDescriptor,_r=Object.getOwnPropertyDescriptors,Ar=Object.getOwnPropertyNames,De=Object.getOwnPropertySymbols,Dr=Object.getPrototypeOf,Le=Object.prototype.hasOwnProperty,Br=Object.prototype.propertyIsEnumerable;var Be=(t,e,r)=>e in t?Y(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,U=(t,e)=>{for(var r in e||(e={}))Le.call(e,r)&&Be(t,r,e[r]);if(De)for(var r of De(e))Br.call(e,r)&&Be(t,r,e[r]);return t},Ce=(t,e)=>Er(t,_r(e));var Lr=(t,e)=>()=>(t&&(e=t(t=0)),e);var $=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Cr=(t,e)=>{for(var r in e)Y(t,r,{get:e[r],enumerable:!0})},Ue=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ar(e))!Le.call(t,i)&&i!==r&&Y(t,i,{get:()=>e[i],enumerable:!(n=br(e,i))||n.enumerable});return t};var Q=(t,e,r)=>(r=t!=null?Rr(Dr(t)):{},Ue(e||!t||!t.__esModule?Y(r,"default",{value:t,enumerable:!0}):r,t)),Ur=t=>Ue(Y({},"__esModule",{value:!0}),t);var oe=(t,e,r)=>new Promise((n,i)=>{var o=c=>{try{u(r.next(c))}catch(p){i(p)}},a=c=>{try{u(r.throw(c))}catch(p){i(p)}},u=c=>c.done?n(c.value):Promise.resolve(c.value).then(o,a);u((r=r.apply(t,e)).next())});var Pe=$(j=>{"use strict";f();j.byteLength=Mr;j.toByteArray=Or;j.fromByteArray=Wr;var R=[],F=[],Nr=typeof Uint8Array!="undefined"?Uint8Array:Array,ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(N=0,Ne=ae.length;N<Ne;++N)R[N]=ae[N],F[ae.charCodeAt(N)]=N;var N,Ne;F["-".charCodeAt(0)]=62;F["_".charCodeAt(0)]=63;function Me(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function Mr(t){var e=Me(t),r=e[0],n=e[1];return(r+n)*3/4-n}function Pr(t,e,r){return(e+r)*3/4-r}function Or(t){var e,r=Me(t),n=r[0],i=r[1],o=new Nr(Pr(t,n,i)),a=0,u=i>0?n-4:n,c;for(c=0;c<u;c+=4)e=F[t.charCodeAt(c)]<<18|F[t.charCodeAt(c+1)]<<12|F[t.charCodeAt(c+2)]<<6|F[t.charCodeAt(c+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return i===2&&(e=F[t.charCodeAt(c)]<<2|F[t.charCodeAt(c+1)]>>4,o[a++]=e&255),i===1&&(e=F[t.charCodeAt(c)]<<10|F[t.charCodeAt(c+1)]<<4|F[t.charCodeAt(c+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}function Gr(t){return R[t>>18&63]+R[t>>12&63]+R[t>>6&63]+R[t&63]}function Hr(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),i.push(Gr(n));return i.join("")}function Wr(t){for(var e,r=t.length,n=r%3,i=[],o=16383,a=0,u=r-n;a<u;a+=o)i.push(Hr(t,a,a+o>u?u:a+o));return n===1?(e=t[r-1],i.push(R[e>>2]+R[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(R[e>>10]+R[e>>4&63]+R[e<<2&63]+"=")),i.join("")}});var Oe=$(se=>{f();se.read=function(t,e,r,n,i){var o,a,u=i*8-n-1,c=(1<<u)-1,p=c>>1,d=-7,l=r?i-1:0,h=r?-1:1,g=t[e+l];for(l+=h,o=g&(1<<-d)-1,g>>=-d,d+=u;d>0;o=o*256+t[e+l],l+=h,d-=8);for(a=o&(1<<-d)-1,o>>=-d,d+=n;d>0;a=a*256+t[e+l],l+=h,d-=8);if(o===0)o=1-p;else{if(o===c)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-p}return(g?-1:1)*a*Math.pow(2,o-n)};se.write=function(t,e,r,n,i,o){var a,u,c,p=o*8-i-1,d=(1<<p)-1,l=d>>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:o-1,S=n?1:-1,q=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=d):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+l>=1?e+=h/c:e+=h*Math.pow(2,1-l),e*c>=2&&(a++,c/=2),a+l>=d?(u=0,a=d):a+l>=1?(u=(e*c-1)*Math.pow(2,i),a=a+l):(u=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[r+g]=u&255,g+=S,u/=256,i-=8);for(a=a<<i|u,p+=i;p>0;t[r+g]=a&255,g+=S,a/=256,p-=8);t[r+g-S]|=q*128}});var Je=$(H=>{"use strict";f();var ce=Pe(),G=Oe(),Ge=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;H.Buffer=s;H.SlowBuffer=$r;H.INSPECT_MAX_BYTES=50;var K=2147483647;H.kMaxLength=K;s.TYPED_ARRAY_SUPPORT=qr();!s.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 qr(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch(r){return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(!!s.isBuffer(this))return this.buffer}});Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(!!s.isBuffer(this))return this.byteOffset}});function D(t){if(t>K)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,s.prototype),e}function s(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return fe(t)}return qe(t,e,r)}s.poolSize=8192;function qe(t,e,r){if(typeof t=="string")return Yr(t,e);if(ArrayBuffer.isView(t))return Xr(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(E(t,ArrayBuffer)||t&&E(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(E(t,SharedArrayBuffer)||t&&E(t.buffer,SharedArrayBuffer)))return pe(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return s.from(n,e,r);var i=zr(t);if(i)return i;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return s.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}s.from=function(t,e,r){return qe(t,e,r)};Object.setPrototypeOf(s.prototype,Uint8Array.prototype);Object.setPrototypeOf(s,Uint8Array);function Ve(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function Vr(t,e,r){return Ve(t),t<=0?D(t):e!==void 0?typeof r=="string"?D(t).fill(e,r):D(t).fill(e):D(t)}s.alloc=function(t,e,r){return Vr(t,e,r)};function fe(t){return Ve(t),D(t<0?0:ge(t)|0)}s.allocUnsafe=function(t){return fe(t)};s.allocUnsafeSlow=function(t){return fe(t)};function Yr(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=Ye(t,e)|0,n=D(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function ue(t){for(var e=t.length<0?0:ge(t.length)|0,r=D(e),n=0;n<e;n+=1)r[n]=t[n]&255;return r}function Xr(t){if(E(t,Uint8Array)){var e=new Uint8Array(t);return pe(e.buffer,e.byteOffset,e.byteLength)}return ue(t)}function pe(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return e===void 0&&r===void 0?n=new Uint8Array(t):r===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,r),Object.setPrototypeOf(n,s.prototype),n}function zr(t){if(s.isBuffer(t)){var e=ge(t.length)|0,r=D(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||de(t.length)?D(0):ue(t);if(t.type==="Buffer"&&Array.isArray(t.data))return ue(t.data)}function ge(t){if(t>=K)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K.toString(16)+" bytes");return t|0}function $r(t){return+t!=t&&(t=0),s.alloc(+t)}s.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==s.prototype};s.compare=function(e,r){if(E(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),E(r,Uint8Array)&&(r=s.from(r,r.offset,r.byteLength)),!s.isBuffer(e)||!s.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;for(var n=e.length,i=r.length,o=0,a=Math.min(n,i);o<a;++o)if(e[o]!==r[o]){n=e[o],i=r[o];break}return n<i?-1:i<n?1:0};s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};s.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return s.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var i=s.allocUnsafe(r),o=0;for(n=0;n<e.length;++n){var a=e[n];if(E(a,Uint8Array))o+a.length>i.length?s.from(a).copy(i,o):Uint8Array.prototype.set.call(i,a,o);else if(s.isBuffer(a))a.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return i};function Ye(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||E(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return le(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Ke(t).length;default:if(i)return n?-1:le(t).length;e=(""+e).toLowerCase(),i=!0}}s.byteLength=Ye;function Qr(t,e,r){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return ot(this,e,r);case"utf8":case"utf-8":return ze(this,e,r);case"ascii":return nt(this,e,r);case"latin1":case"binary":return it(this,e,r);case"base64":return rt(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return at(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function M(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}s.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)M(this,r,r+1);return this};s.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)M(this,r,r+3),M(this,r+1,r+2);return this};s.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)M(this,r,r+7),M(this,r+1,r+6),M(this,r+2,r+5),M(this,r+3,r+4);return this};s.prototype.toString=function(){var e=this.length;return e===0?"":arguments.length===0?ze(this,0,e):Qr.apply(this,arguments)};s.prototype.toLocaleString=s.prototype.toString;s.prototype.equals=function(e){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:s.compare(this,e)===0};s.prototype.inspect=function(){var e="",r=H.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};Ge&&(s.prototype[Ge]=s.prototype.inspect);s.prototype.compare=function(e,r,n,i,o){if(E(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var a=o-i,u=n-r,c=Math.min(a,u),p=this.slice(i,o),d=e.slice(r,n),l=0;l<c;++l)if(p[l]!==d[l]){a=p[l],u=d[l];break}return a<u?-1:u<a?1:0};function Xe(t,e,r,n,i){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,de(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof e=="string"&&(e=s.from(e,n)),s.isBuffer(e))return e.length===0?-1:He(t,e,r,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):He(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function He(t,e,r,n,i){var o=1,a=t.length,u=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,a/=2,u/=2,r/=2}function c(g,S){return o===1?g[S]:g.readUInt16BE(S*o)}var p;if(i){var d=-1;for(p=r;p<a;p++)if(c(t,p)===c(e,d===-1?0:p-d)){if(d===-1&&(d=p),p-d+1===u)return d*o}else d!==-1&&(p-=p-d),d=-1}else for(r+u>a&&(r=a-u),p=r;p>=0;p--){for(var l=!0,h=0;h<u;h++)if(c(t,p+h)!==c(e,h)){l=!1;break}if(l)return p}return-1}s.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};s.prototype.indexOf=function(e,r,n){return Xe(this,e,r,n,!0)};s.prototype.lastIndexOf=function(e,r,n){return Xe(this,e,r,n,!1)};function jr(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var o=e.length;n>o/2&&(n=o/2);for(var a=0;a<n;++a){var u=parseInt(e.substr(a*2,2),16);if(de(u))return a;t[r+a]=u}return a}function Kr(t,e,r,n){return J(le(e,t.length-r),t,r,n)}function Jr(t,e,r,n){return J(ut(e),t,r,n)}function Zr(t,e,r,n){return J(Ke(e),t,r,n)}function et(t,e,r,n){return J(pt(e,t.length-r),t,r,n)}s.prototype.write=function(e,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 o=this.length-r;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return jr(this,e,r,n);case"utf8":case"utf-8":return Kr(this,e,r,n);case"ascii":case"latin1":case"binary":return Jr(this,e,r,n);case"base64":return Zr(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return et(this,e,r,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function rt(t,e,r){return e===0&&r===t.length?ce.fromByteArray(t):ce.fromByteArray(t.slice(e,r))}function ze(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o=t[i],a=null,u=o>239?4:o>223?3:o>191?2:1;if(i+u<=r){var c,p,d,l;switch(u){case 1:o<128&&(a=o);break;case 2:c=t[i+1],(c&192)===128&&(l=(o&31)<<6|c&63,l>127&&(a=l));break;case 3:c=t[i+1],p=t[i+2],(c&192)===128&&(p&192)===128&&(l=(o&15)<<12|(c&63)<<6|p&63,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:c=t[i+1],p=t[i+2],d=t[i+3],(c&192)===128&&(p&192)===128&&(d&192)===128&&(l=(o&15)<<18|(c&63)<<12|(p&63)<<6|d&63,l>65535&&l<1114112&&(a=l))}}a===null?(a=65533,u=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=u}return tt(n)}var We=4096;function tt(t){var e=t.length;if(e<=We)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=We));return r}function nt(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]&127);return n}function it(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function ot(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=lt[t[o]];return i}function at(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}s.prototype.slice=function(e,r){var n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);var i=this.subarray(e,r);return Object.setPrototypeOf(i,s.prototype),i};function v(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||v(e,r,this.length);for(var i=this[e],o=1,a=0;++a<r&&(o*=256);)i+=this[e+a]*o;return i};s.prototype.readUintBE=s.prototype.readUIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||v(e,r,this.length);for(var i=this[e+--r],o=1;r>0&&(o*=256);)i+=this[e+--r]*o;return i};s.prototype.readUint8=s.prototype.readUInt8=function(e,r){return e=e>>>0,r||v(e,1,this.length),this[e]};s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||v(e,2,this.length),this[e]|this[e+1]<<8};s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||v(e,2,this.length),this[e]<<8|this[e+1]};s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||v(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||v(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};s.prototype.readIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||v(e,r,this.length);for(var i=this[e],o=1,a=0;++a<r&&(o*=256);)i+=this[e+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i};s.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||v(e,r,this.length);for(var i=r,o=1,a=this[e+--i];i>0&&(o*=256);)a+=this[e+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*r)),a};s.prototype.readInt8=function(e,r){return e=e>>>0,r||v(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};s.prototype.readInt16LE=function(e,r){e=e>>>0,r||v(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(e,r){e=e>>>0,r||v(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(e,r){return e=e>>>0,r||v(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};s.prototype.readInt32BE=function(e,r){return e=e>>>0,r||v(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};s.prototype.readFloatLE=function(e,r){return e=e>>>0,r||v(e,4,this.length),G.read(this,e,!0,23,4)};s.prototype.readFloatBE=function(e,r){return e=e>>>0,r||v(e,4,this.length),G.read(this,e,!1,23,4)};s.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||v(e,8,this.length),G.read(this,e,!0,52,8)};s.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||v(e,8,this.length),G.read(this,e,!1,52,8)};function k(t,e,r,n,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){var o=Math.pow(2,8*n)-1;k(this,e,r,n,o,0)}var a=1,u=0;for(this[r]=e&255;++u<n&&(a*=256);)this[r+u]=e/a&255;return r+n};s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){var o=Math.pow(2,8*n)-1;k(this,e,r,n,o,0)}var a=n-1,u=1;for(this[r+a]=e&255;--a>=0&&(u*=256);)this[r+a]=e/u&255;return r+n};s.prototype.writeUint8=s.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,1,255,0),this[r]=e&255,r+1};s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};s.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){var o=Math.pow(2,8*n-1);k(this,e,r,n,o-1,-o)}var a=0,u=1,c=0;for(this[r]=e&255;++a<n&&(u*=256);)e<0&&c===0&&this[r+a-1]!==0&&(c=1),this[r+a]=(e/u>>0)-c&255;return r+n};s.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){var o=Math.pow(2,8*n-1);k(this,e,r,n,o-1,-o)}var a=n-1,u=1,c=0;for(this[r+a]=e&255;--a>=0&&(u*=256);)e<0&&c===0&&this[r+a+1]!==0&&(c=1),this[r+a]=(e/u>>0)-c&255;return r+n};s.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};s.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};s.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};s.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};s.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function $e(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Qe(t,e,r,n,i){return e=+e,r=r>>>0,i||$e(t,e,r,4,34028234663852886e22,-34028234663852886e22),G.write(t,e,r,n,23,4),r+4}s.prototype.writeFloatLE=function(e,r,n){return Qe(this,e,r,!0,n)};s.prototype.writeFloatBE=function(e,r,n){return Qe(this,e,r,!1,n)};function je(t,e,r,n,i){return e=+e,r=r>>>0,i||$e(t,e,r,8,17976931348623157e292,-17976931348623157e292),G.write(t,e,r,n,52,8),r+8}s.prototype.writeDoubleLE=function(e,r,n){return je(this,e,r,!0,n)};s.prototype.writeDoubleBE=function(e,r,n){return je(this,e,r,!1,n)};s.prototype.copy=function(e,r,n,i){if(!s.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<n&&(i=n),i===n||e.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),e.length-r<i-n&&(i=e.length-r+n);var o=i-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),r),o};s.prototype.fill=function(e,r,n,i){if(typeof e=="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"&&!s.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(e.length===1){var o=e.charCodeAt(0);(i==="utf8"&&o<128||i==="latin1")&&(e=o)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));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,e||(e=0);var a;if(typeof e=="number")for(a=r;a<n;++a)this[a]=e;else{var u=s.isBuffer(e)?e:s.from(e,i),c=u.length;if(c===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(a=0;a<n-r;++a)this[a+r]=u[a%c]}return this};var st=/[^+/0-9A-Za-z-_]/g;function ct(t){if(t=t.split("=")[0],t=t.trim().replace(st,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function le(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function ut(t){for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function pt(t,e){for(var r,n,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function Ke(t){return ce.toByteArray(ct(t))}function J(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function E(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function de(t){return t!==t}var lt=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=r*16,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()});var nr=$((Rt,tr)=>{f();var x=tr.exports={},b,_;function he(){throw new Error("setTimeout has not been defined")}function me(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?b=setTimeout:b=he}catch(t){b=he}try{typeof clearTimeout=="function"?_=clearTimeout:_=me}catch(t){_=me}})();function Ze(t){if(b===setTimeout)return setTimeout(t,0);if((b===he||!b)&&setTimeout)return b=setTimeout,setTimeout(t,0);try{return b(t,0)}catch(e){try{return b.call(null,t,0)}catch(r){return b.call(this,t,0)}}}function ft(t){if(_===clearTimeout)return clearTimeout(t);if((_===me||!_)&&clearTimeout)return _=clearTimeout,clearTimeout(t);try{return _(t)}catch(e){try{return _.call(null,t)}catch(r){return _.call(this,t)}}}var B=[],W=!1,P,Z=-1;function gt(){!W||!P||(W=!1,P.length?B=P.concat(B):Z=-1,B.length&&er())}function er(){if(!W){var t=Ze(gt);W=!0;for(var e=B.length;e;){for(P=B,B=[];++Z<e;)P&&P[Z].run();Z=-1,e=B.length}P=null,W=!1,ft(t)}}x.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];B.push(new rr(t,e)),B.length===1&&!W&&Ze(er)};function rr(t,e){this.fun=t,this.array=e}rr.prototype.run=function(){this.fun.apply(null,this.array)};x.title="browser";x.browser=!0;x.env={};x.argv=[];x.version="";x.versions={};function L(){}x.on=L;x.addListener=L;x.once=L;x.off=L;x.removeListener=L;x.removeAllListeners=L;x.emit=L;x.prependListener=L;x.prependOnceListener=L;x.listeners=function(t){return[]};x.binding=function(t){throw new Error("process.binding is not supported")};x.cwd=function(){return"/"};x.chdir=function(t){throw new Error("process.chdir is not supported")};x.umask=function(){return 0}});var m,y,Et,f=Lr(()=>{m=Q(Je()),y=Q(nr()),Et=function(t){function e(){var n=this||self;return delete t.prototype.__magic__,n}if(typeof globalThis=="object")return globalThis;if(this)return e();t.defineProperty(t.prototype,"__magic__",{configurable:!0,get:e});var r=__magic__;return r}(Object)});var vt={};Cr(vt,{useSignMultipleTransactions:()=>wt});module.exports=Ur(vt);f();var O=require("react");f();var X=require("react");f();var Te=require("@multiversx/sdk-core"),xe=Q(require("bignumber.js"));f();f();var ir=require("@multiversx/sdk-core");function dt(t){try{let e=new ir.Address(t);return Boolean(e.bech32())}catch(e){return!1}}function or(t){return(t==null?void 0:t.startsWith("erd"))&&t.length===62&&/^\w+$/.test(t)&&dt(t)}f();f();function ar(t){for(let e=0;e<t.length;e++)if(t.charCodeAt(e)>127)return!1;return!0}function ee(t){let e=t;try{let r=m.Buffer.from(t,"hex").toString();ar(r)&&r.length>1&&(e=r)}catch(r){}return e}var ye={tokenId:"",amount:""},mt=t=>t.split("@").map((o,a)=>[2,3].includes(a)?o:ee(o));function sr(t){if(!t)return ye;let e=t.startsWith("ESDTTransfer"),r=t.startsWith("ESDTNFTTransfer")&&t.includes("@");if(e){let[,n,i]=t.split("@");try{let o=m.Buffer.from(n,"hex").toString("ascii");if(!o)return ye;let a=new xe.default("0x"+i.replace("0x","")).toString(10);return{tokenId:o,amount:a}}catch(o){console.error("Error getting token from transaction data",o)}}if(r)try{let[,n,i,o,a]=mt(t);if([n,i,o,a].every(u=>Boolean(u))&&or(new Te.Address(a).bech32()))return{tokenId:`${n}-${i}`,amount:new xe.default(o,16).toString(10),collection:n,nonce:i,receiver:new Te.Address(a).bech32()}}catch(n){}return ye}f();var we=Q(require("bignumber.js"));f();f();f();f();f();f();f();f();f();f();var cr=(t,e)=>{let r=[],n=t.indexOf(e,0);for(;n>=0;)r.push(n),n=t.indexOf(e,n+1);return r};function ur(t){let e=[],r=0;try{if((t==null?void 0:t.startsWith("MultiESDTNFTTransfer"))&&(t==null?void 0:t.includes("@"))){let[,n,i,...o]=t==null?void 0:t.split("@");if(n){let a=new we.default(i,16).toNumber(),u=0;for(let l=0;l<a;l++){let h={type:"nftTransaction",data:"",receiver:n};for(let g=0;g<3;g++){switch(g){case 0:h.token=ee(o[u]),h.data=o[u];break;case 1:{let S=o[u]&&o[u].length?o[u]:"";S?h.nonce=S:h.type="esdtTransaction",h.data=`${h.data}@${o[u]}`;break}case 2:h.amount=new we.default(o[u],16).toString(10),h.data=`${h.data}@${o[u]}`;break;default:break}r=u+1,u++}e[l]=h}let c=e.length!==a,p=e.some(l=>cr(l.data,"@").length!==2),d=e.some(l=>l.data.startsWith("@"));if(c||p||d)return[];if(o[r]){let l=o[r];for(let h=r+1;h<o.length;h++)l+="@"+o[h];e[a]={type:"scCall",data:l,receiver:n}}}}}catch(n){return console.error("failed parsing tx",n),e}return e}var pr={tokenId:"",amount:"",type:"",multiTxData:"",receiver:""};function lr({transactions:t}){let[e,r]=(0,X.useState)({}),[n,i]=(0,X.useState)([]);function o(c,p){r(d=>Ce(U({},d),{[c]:p}))}function a(c,p){return e==null?pr:c in e?e[c]:p!=null&&String(p)in e?e[p]:pr}function u(){if(t&&t.length>0){let c=[];t.forEach((p,d)=>{let l=p.getData().toString(),h=ur(l);if(h.length>0)h.forEach((g,S)=>{let q={transaction:p,multiTxData:g.data,transactionIndex:S};o(g.data,{tokenId:g.token?g.token:"",amount:g.amount?g.amount:"",type:g.type,nonce:g.nonce?g.nonce:"",multiTxData:g.data,receiver:g.receiver}),c.push(q)});else{let{tokenId:g,amount:S}=sr(p.getData().toString());g&&o(p.getData().toString(),{tokenId:g,amount:S,receiver:p.getReceiver().bech32()}),c.push({transaction:p,transactionIndex:d})}}),i(c)}}return(0,X.useEffect)(()=>{u()},[t==null?void 0:t.length]),{parsedTransactionsByDataField:e,getTxInfoByDataField:a,allTransactions:n}}f();f();var ve={36864:{code:"codeSuccess",message:"Success"},27013:{code:"ERR_USER_DENIED",message:"Rejected by user"},27904:{code:"ERR_UNKNOWN_INSTRUCTION",message:"Unknown instruction"},28160:{code:"ERR_WRONG_CLA",message:"Wrong CLA"},28161:{code:"ERR_INVALID_ARGUMENTS",message:"Invalid arguments"},28162:{code:"ERR_INVALID_MESSAGE",message:"Invalid message"},28163:{code:"ERR_INVALID_P1",message:"Invalid P1"},28164:{code:"ERR_MESSAGE_TOO_LONG",message:"Message too long"},28165:{code:"ERR_RECEIVER_TOO_LONG",message:"Receiver too long"},28166:{code:"ERR_AMOUNT_TOO_LONG",message:"Amount too long"},28167:{code:"ERR_CONTRACT_DATA_DISABLED",message:"Contract data disabled in app options"},28168:{code:"ERR_MESSAGE_INCOMPLETE",message:"Message incomplete"},28176:{code:"ERR_SIGNATURE_FAILED",message:"Signature failed"},28169:{code:"ERR_WRONG_TX_VERSION",message:"Wrong TX version"},28170:{code:"ERR_NONCE_TOO_LONG",message:"Nonce too long"},28171:{code:"ERR_INVALID_AMOUNT",message:"Invalid amount"},28172:{code:"ERR_INVALID_FEE",message:"Invalid fee"},28173:{code:"ERR_PRETTY_FAILED",message:"Pretty failed"},28174:{code:"ERR_DATA_TOO_LONG",message:"Data too long"},28175:{code:"ERR_WRONG_TX_OPTIONS",message:"Invalid transaction options"},28177:{code:"ERR_SIGN_TX_DEPRECATED",message:"Regular transaction signing is deprecated in this version. Use hash signing."}};var fr="Check if the MultiversX app is open on Ledger",yt=28161,Tt=28160,xt=[yt,Tt];function gr(t){let e=null;if((t==null?void 0:t.statusCode)in ve){let r=t==null?void 0:t.statusCode,{message:n}=ve[r];e=xt.includes(r)?fr:n}return{errorMessage:e,defaultErrorMessage:fr}}f();function dr({tokenId:t,erdLabel:e}){return Boolean(t&&t!==e)}var re={};function wt({isLedger:t=!1,transactionsToSign:e,egldLabel:r,address:n,onCancel:i,onSignTransaction:o,onTransactionsSignError:a,onTransactionsSignSuccess:u,onGetScamAddressData:c}){var Fe,Re,Ee;let[p,d]=(0,O.useState)(0),[l,h]=(0,O.useState)(),[g,S]=(0,O.useState)(null),[q,te]=(0,O.useState)(!1),{getTxInfoByDataField:hr,allTransactions:C}=lr({transactions:e}),ne=p===C.length-1;(0,O.useEffect)(()=>{mr()},[p,C]);function mr(){return oe(this,null,function*(){var Ae;let w=C[p];if(w==null)return;let{transaction:I,multiTxData:A}=w,ie=I.getData().toString(),be=hr(I.getData().toString(),A),{tokenId:_e}=be,V=I.getReceiver().toString(),Sr=n!==V,kr=V in re;if(Sr&&!kr&&c!=null){let z=yield c(V);re=U(U({},re),z!=null&&z.scamInfo?{[V]:z.scamInfo}:{})}let Fr=Boolean(_e&&dr({tokenId:_e,erdLabel:r}));S({transaction:I,receiverScamInfo:((Ae=re[V])==null?void 0:Ae.info)||null,transactionTokenInfo:be,isTokenTransaction:Fr,dataField:ie})})}function Ie(){d(0),h(void 0),te(!1)}function Se(){return oe(this,null,function*(){try{if(g==null)return;te(t);let w=yield o(g.transaction),I={[p]:w},A=l?U(U({},l),I):I;h(A),ne?A&&(u(Object.values(A)),Ie()):(d(ie=>ie+1),te(!1))}catch(w){console.error(w,"sign error");let{message:I}=w,A=t?gr(w).errorMessage:null;Ie(),a(A!=null?A:I)}})}function yr(){try{if(g==null)return;g.transaction.getSignature().hex()?ne||d(I=>I+1):Se()}catch(w){Se()}}let Tr=p===0;function xr(){Tr?i==null||i():d(w=>w-1)}let ke=Boolean(((Fe=g==null?void 0:g.transactionTokenInfo)==null?void 0:Fe.type)&&((Re=g==null?void 0:g.transactionTokenInfo)==null?void 0:Re.multiTxData)&&!(g!=null&&g.dataField.endsWith((Ee=g==null?void 0:g.transactionTokenInfo)==null?void 0:Ee.multiTxData)));function wr(){ke?d(w=>w+1):yr()}function vr(){d(w=>{let I=w+1;return I>(C==null?void 0:C.length)?w:I})}function Ir(){d(w=>{let I=w-1;return I<0?w:I})}return{allTransactions:C,onSignTransaction:wr,onNext:vr,onPrev:Ir,waitingForDevice:q,onAbort:xr,isLastTransaction:ne,isFirstTransaction:p===0,hasMultipleTransactions:C.length>1,shouldContinueWithoutSigning:ke,currentStep:p,signedTransactions:l,currentTransaction:g}}0&&(module.exports={useSignMultipleTransactions});
1
+ "use strict";var Rr=Object.create;var Y=Object.defineProperty,Er=Object.defineProperties,br=Object.getOwnPropertyDescriptor,_r=Object.getOwnPropertyDescriptors,Ar=Object.getOwnPropertyNames,De=Object.getOwnPropertySymbols,Dr=Object.getPrototypeOf,Le=Object.prototype.hasOwnProperty,Br=Object.prototype.propertyIsEnumerable;var Be=(t,e,r)=>e in t?Y(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,U=(t,e)=>{for(var r in e||(e={}))Le.call(e,r)&&Be(t,r,e[r]);if(De)for(var r of De(e))Br.call(e,r)&&Be(t,r,e[r]);return t},Ce=(t,e)=>Er(t,_r(e));var Lr=(t,e)=>()=>(t&&(e=t(t=0)),e);var $=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Cr=(t,e)=>{for(var r in e)Y(t,r,{get:e[r],enumerable:!0})},Ue=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ar(e))!Le.call(t,i)&&i!==r&&Y(t,i,{get:()=>e[i],enumerable:!(n=br(e,i))||n.enumerable});return t};var Q=(t,e,r)=>(r=t!=null?Rr(Dr(t)):{},Ue(e||!t||!t.__esModule?Y(r,"default",{value:t,enumerable:!0}):r,t)),Ur=t=>Ue(Y({},"__esModule",{value:!0}),t);var oe=(t,e,r)=>new Promise((n,i)=>{var o=c=>{try{u(r.next(c))}catch(p){i(p)}},a=c=>{try{u(r.throw(c))}catch(p){i(p)}},u=c=>c.done?n(c.value):Promise.resolve(c.value).then(o,a);u((r=r.apply(t,e)).next())});var Pe=$(j=>{"use strict";f();j.byteLength=Mr;j.toByteArray=Or;j.fromByteArray=Wr;var R=[],F=[],Nr=typeof Uint8Array!="undefined"?Uint8Array:Array,ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(N=0,Ne=ae.length;N<Ne;++N)R[N]=ae[N],F[ae.charCodeAt(N)]=N;var N,Ne;F["-".charCodeAt(0)]=62;F["_".charCodeAt(0)]=63;function Me(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function Mr(t){var e=Me(t),r=e[0],n=e[1];return(r+n)*3/4-n}function Pr(t,e,r){return(e+r)*3/4-r}function Or(t){var e,r=Me(t),n=r[0],i=r[1],o=new Nr(Pr(t,n,i)),a=0,u=i>0?n-4:n,c;for(c=0;c<u;c+=4)e=F[t.charCodeAt(c)]<<18|F[t.charCodeAt(c+1)]<<12|F[t.charCodeAt(c+2)]<<6|F[t.charCodeAt(c+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return i===2&&(e=F[t.charCodeAt(c)]<<2|F[t.charCodeAt(c+1)]>>4,o[a++]=e&255),i===1&&(e=F[t.charCodeAt(c)]<<10|F[t.charCodeAt(c+1)]<<4|F[t.charCodeAt(c+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}function Gr(t){return R[t>>18&63]+R[t>>12&63]+R[t>>6&63]+R[t&63]}function Hr(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),i.push(Gr(n));return i.join("")}function Wr(t){for(var e,r=t.length,n=r%3,i=[],o=16383,a=0,u=r-n;a<u;a+=o)i.push(Hr(t,a,a+o>u?u:a+o));return n===1?(e=t[r-1],i.push(R[e>>2]+R[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(R[e>>10]+R[e>>4&63]+R[e<<2&63]+"=")),i.join("")}});var Oe=$(se=>{f();se.read=function(t,e,r,n,i){var o,a,u=i*8-n-1,c=(1<<u)-1,p=c>>1,d=-7,l=r?i-1:0,h=r?-1:1,g=t[e+l];for(l+=h,o=g&(1<<-d)-1,g>>=-d,d+=u;d>0;o=o*256+t[e+l],l+=h,d-=8);for(a=o&(1<<-d)-1,o>>=-d,d+=n;d>0;a=a*256+t[e+l],l+=h,d-=8);if(o===0)o=1-p;else{if(o===c)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-p}return(g?-1:1)*a*Math.pow(2,o-n)};se.write=function(t,e,r,n,i,o){var a,u,c,p=o*8-i-1,d=(1<<p)-1,l=d>>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:o-1,S=n?1:-1,q=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=d):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+l>=1?e+=h/c:e+=h*Math.pow(2,1-l),e*c>=2&&(a++,c/=2),a+l>=d?(u=0,a=d):a+l>=1?(u=(e*c-1)*Math.pow(2,i),a=a+l):(u=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[r+g]=u&255,g+=S,u/=256,i-=8);for(a=a<<i|u,p+=i;p>0;t[r+g]=a&255,g+=S,a/=256,p-=8);t[r+g-S]|=q*128}});var Je=$(H=>{"use strict";f();var ce=Pe(),G=Oe(),Ge=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;H.Buffer=s;H.SlowBuffer=$r;H.INSPECT_MAX_BYTES=50;var K=2147483647;H.kMaxLength=K;s.TYPED_ARRAY_SUPPORT=qr();!s.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 qr(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch(r){return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(!!s.isBuffer(this))return this.buffer}});Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(!!s.isBuffer(this))return this.byteOffset}});function D(t){if(t>K)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,s.prototype),e}function s(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return fe(t)}return qe(t,e,r)}s.poolSize=8192;function qe(t,e,r){if(typeof t=="string")return Yr(t,e);if(ArrayBuffer.isView(t))return Xr(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(E(t,ArrayBuffer)||t&&E(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(E(t,SharedArrayBuffer)||t&&E(t.buffer,SharedArrayBuffer)))return pe(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return s.from(n,e,r);var i=zr(t);if(i)return i;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return s.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}s.from=function(t,e,r){return qe(t,e,r)};Object.setPrototypeOf(s.prototype,Uint8Array.prototype);Object.setPrototypeOf(s,Uint8Array);function Ve(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function Vr(t,e,r){return Ve(t),t<=0?D(t):e!==void 0?typeof r=="string"?D(t).fill(e,r):D(t).fill(e):D(t)}s.alloc=function(t,e,r){return Vr(t,e,r)};function fe(t){return Ve(t),D(t<0?0:ge(t)|0)}s.allocUnsafe=function(t){return fe(t)};s.allocUnsafeSlow=function(t){return fe(t)};function Yr(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=Ye(t,e)|0,n=D(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function ue(t){for(var e=t.length<0?0:ge(t.length)|0,r=D(e),n=0;n<e;n+=1)r[n]=t[n]&255;return r}function Xr(t){if(E(t,Uint8Array)){var e=new Uint8Array(t);return pe(e.buffer,e.byteOffset,e.byteLength)}return ue(t)}function pe(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return e===void 0&&r===void 0?n=new Uint8Array(t):r===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,r),Object.setPrototypeOf(n,s.prototype),n}function zr(t){if(s.isBuffer(t)){var e=ge(t.length)|0,r=D(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||de(t.length)?D(0):ue(t);if(t.type==="Buffer"&&Array.isArray(t.data))return ue(t.data)}function ge(t){if(t>=K)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K.toString(16)+" bytes");return t|0}function $r(t){return+t!=t&&(t=0),s.alloc(+t)}s.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==s.prototype};s.compare=function(e,r){if(E(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),E(r,Uint8Array)&&(r=s.from(r,r.offset,r.byteLength)),!s.isBuffer(e)||!s.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;for(var n=e.length,i=r.length,o=0,a=Math.min(n,i);o<a;++o)if(e[o]!==r[o]){n=e[o],i=r[o];break}return n<i?-1:i<n?1:0};s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};s.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return s.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var i=s.allocUnsafe(r),o=0;for(n=0;n<e.length;++n){var a=e[n];if(E(a,Uint8Array))o+a.length>i.length?s.from(a).copy(i,o):Uint8Array.prototype.set.call(i,a,o);else if(s.isBuffer(a))a.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return i};function Ye(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||E(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return le(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Ke(t).length;default:if(i)return n?-1:le(t).length;e=(""+e).toLowerCase(),i=!0}}s.byteLength=Ye;function Qr(t,e,r){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return ot(this,e,r);case"utf8":case"utf-8":return ze(this,e,r);case"ascii":return nt(this,e,r);case"latin1":case"binary":return it(this,e,r);case"base64":return rt(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return at(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function M(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}s.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)M(this,r,r+1);return this};s.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)M(this,r,r+3),M(this,r+1,r+2);return this};s.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)M(this,r,r+7),M(this,r+1,r+6),M(this,r+2,r+5),M(this,r+3,r+4);return this};s.prototype.toString=function(){var e=this.length;return e===0?"":arguments.length===0?ze(this,0,e):Qr.apply(this,arguments)};s.prototype.toLocaleString=s.prototype.toString;s.prototype.equals=function(e){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:s.compare(this,e)===0};s.prototype.inspect=function(){var e="",r=H.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};Ge&&(s.prototype[Ge]=s.prototype.inspect);s.prototype.compare=function(e,r,n,i,o){if(E(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var a=o-i,u=n-r,c=Math.min(a,u),p=this.slice(i,o),d=e.slice(r,n),l=0;l<c;++l)if(p[l]!==d[l]){a=p[l],u=d[l];break}return a<u?-1:u<a?1:0};function Xe(t,e,r,n,i){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,de(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof e=="string"&&(e=s.from(e,n)),s.isBuffer(e))return e.length===0?-1:He(t,e,r,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):He(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function He(t,e,r,n,i){var o=1,a=t.length,u=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,a/=2,u/=2,r/=2}function c(g,S){return o===1?g[S]:g.readUInt16BE(S*o)}var p;if(i){var d=-1;for(p=r;p<a;p++)if(c(t,p)===c(e,d===-1?0:p-d)){if(d===-1&&(d=p),p-d+1===u)return d*o}else d!==-1&&(p-=p-d),d=-1}else for(r+u>a&&(r=a-u),p=r;p>=0;p--){for(var l=!0,h=0;h<u;h++)if(c(t,p+h)!==c(e,h)){l=!1;break}if(l)return p}return-1}s.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};s.prototype.indexOf=function(e,r,n){return Xe(this,e,r,n,!0)};s.prototype.lastIndexOf=function(e,r,n){return Xe(this,e,r,n,!1)};function jr(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var o=e.length;n>o/2&&(n=o/2);for(var a=0;a<n;++a){var u=parseInt(e.substr(a*2,2),16);if(de(u))return a;t[r+a]=u}return a}function Kr(t,e,r,n){return J(le(e,t.length-r),t,r,n)}function Jr(t,e,r,n){return J(ut(e),t,r,n)}function Zr(t,e,r,n){return J(Ke(e),t,r,n)}function et(t,e,r,n){return J(pt(e,t.length-r),t,r,n)}s.prototype.write=function(e,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 o=this.length-r;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return jr(this,e,r,n);case"utf8":case"utf-8":return Kr(this,e,r,n);case"ascii":case"latin1":case"binary":return Jr(this,e,r,n);case"base64":return Zr(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return et(this,e,r,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function rt(t,e,r){return e===0&&r===t.length?ce.fromByteArray(t):ce.fromByteArray(t.slice(e,r))}function ze(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o=t[i],a=null,u=o>239?4:o>223?3:o>191?2:1;if(i+u<=r){var c,p,d,l;switch(u){case 1:o<128&&(a=o);break;case 2:c=t[i+1],(c&192)===128&&(l=(o&31)<<6|c&63,l>127&&(a=l));break;case 3:c=t[i+1],p=t[i+2],(c&192)===128&&(p&192)===128&&(l=(o&15)<<12|(c&63)<<6|p&63,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:c=t[i+1],p=t[i+2],d=t[i+3],(c&192)===128&&(p&192)===128&&(d&192)===128&&(l=(o&15)<<18|(c&63)<<12|(p&63)<<6|d&63,l>65535&&l<1114112&&(a=l))}}a===null?(a=65533,u=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=u}return tt(n)}var We=4096;function tt(t){var e=t.length;if(e<=We)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=We));return r}function nt(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]&127);return n}function it(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function ot(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=lt[t[o]];return i}function at(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}s.prototype.slice=function(e,r){var n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);var i=this.subarray(e,r);return Object.setPrototypeOf(i,s.prototype),i};function v(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||v(e,r,this.length);for(var i=this[e],o=1,a=0;++a<r&&(o*=256);)i+=this[e+a]*o;return i};s.prototype.readUintBE=s.prototype.readUIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||v(e,r,this.length);for(var i=this[e+--r],o=1;r>0&&(o*=256);)i+=this[e+--r]*o;return i};s.prototype.readUint8=s.prototype.readUInt8=function(e,r){return e=e>>>0,r||v(e,1,this.length),this[e]};s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||v(e,2,this.length),this[e]|this[e+1]<<8};s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||v(e,2,this.length),this[e]<<8|this[e+1]};s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||v(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||v(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};s.prototype.readIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||v(e,r,this.length);for(var i=this[e],o=1,a=0;++a<r&&(o*=256);)i+=this[e+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i};s.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||v(e,r,this.length);for(var i=r,o=1,a=this[e+--i];i>0&&(o*=256);)a+=this[e+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*r)),a};s.prototype.readInt8=function(e,r){return e=e>>>0,r||v(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};s.prototype.readInt16LE=function(e,r){e=e>>>0,r||v(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(e,r){e=e>>>0,r||v(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(e,r){return e=e>>>0,r||v(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};s.prototype.readInt32BE=function(e,r){return e=e>>>0,r||v(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};s.prototype.readFloatLE=function(e,r){return e=e>>>0,r||v(e,4,this.length),G.read(this,e,!0,23,4)};s.prototype.readFloatBE=function(e,r){return e=e>>>0,r||v(e,4,this.length),G.read(this,e,!1,23,4)};s.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||v(e,8,this.length),G.read(this,e,!0,52,8)};s.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||v(e,8,this.length),G.read(this,e,!1,52,8)};function k(t,e,r,n,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){var o=Math.pow(2,8*n)-1;k(this,e,r,n,o,0)}var a=1,u=0;for(this[r]=e&255;++u<n&&(a*=256);)this[r+u]=e/a&255;return r+n};s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){var o=Math.pow(2,8*n)-1;k(this,e,r,n,o,0)}var a=n-1,u=1;for(this[r+a]=e&255;--a>=0&&(u*=256);)this[r+a]=e/u&255;return r+n};s.prototype.writeUint8=s.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,1,255,0),this[r]=e&255,r+1};s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};s.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){var o=Math.pow(2,8*n-1);k(this,e,r,n,o-1,-o)}var a=0,u=1,c=0;for(this[r]=e&255;++a<n&&(u*=256);)e<0&&c===0&&this[r+a-1]!==0&&(c=1),this[r+a]=(e/u>>0)-c&255;return r+n};s.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){var o=Math.pow(2,8*n-1);k(this,e,r,n,o-1,-o)}var a=n-1,u=1,c=0;for(this[r+a]=e&255;--a>=0&&(u*=256);)e<0&&c===0&&this[r+a+1]!==0&&(c=1),this[r+a]=(e/u>>0)-c&255;return r+n};s.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};s.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};s.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};s.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};s.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||k(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function $e(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Qe(t,e,r,n,i){return e=+e,r=r>>>0,i||$e(t,e,r,4,34028234663852886e22,-34028234663852886e22),G.write(t,e,r,n,23,4),r+4}s.prototype.writeFloatLE=function(e,r,n){return Qe(this,e,r,!0,n)};s.prototype.writeFloatBE=function(e,r,n){return Qe(this,e,r,!1,n)};function je(t,e,r,n,i){return e=+e,r=r>>>0,i||$e(t,e,r,8,17976931348623157e292,-17976931348623157e292),G.write(t,e,r,n,52,8),r+8}s.prototype.writeDoubleLE=function(e,r,n){return je(this,e,r,!0,n)};s.prototype.writeDoubleBE=function(e,r,n){return je(this,e,r,!1,n)};s.prototype.copy=function(e,r,n,i){if(!s.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<n&&(i=n),i===n||e.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),e.length-r<i-n&&(i=e.length-r+n);var o=i-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),r),o};s.prototype.fill=function(e,r,n,i){if(typeof e=="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"&&!s.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(e.length===1){var o=e.charCodeAt(0);(i==="utf8"&&o<128||i==="latin1")&&(e=o)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));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,e||(e=0);var a;if(typeof e=="number")for(a=r;a<n;++a)this[a]=e;else{var u=s.isBuffer(e)?e:s.from(e,i),c=u.length;if(c===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(a=0;a<n-r;++a)this[a+r]=u[a%c]}return this};var st=/[^+/0-9A-Za-z-_]/g;function ct(t){if(t=t.split("=")[0],t=t.trim().replace(st,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function le(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function ut(t){for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function pt(t,e){for(var r,n,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function Ke(t){return ce.toByteArray(ct(t))}function J(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function E(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function de(t){return t!==t}var lt=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=r*16,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()});var nr=$((Rt,tr)=>{f();var x=tr.exports={},b,_;function he(){throw new Error("setTimeout has not been defined")}function me(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?b=setTimeout:b=he}catch(t){b=he}try{typeof clearTimeout=="function"?_=clearTimeout:_=me}catch(t){_=me}})();function Ze(t){if(b===setTimeout)return setTimeout(t,0);if((b===he||!b)&&setTimeout)return b=setTimeout,setTimeout(t,0);try{return b(t,0)}catch(e){try{return b.call(null,t,0)}catch(r){return b.call(this,t,0)}}}function ft(t){if(_===clearTimeout)return clearTimeout(t);if((_===me||!_)&&clearTimeout)return _=clearTimeout,clearTimeout(t);try{return _(t)}catch(e){try{return _.call(null,t)}catch(r){return _.call(this,t)}}}var B=[],W=!1,P,Z=-1;function gt(){!W||!P||(W=!1,P.length?B=P.concat(B):Z=-1,B.length&&er())}function er(){if(!W){var t=Ze(gt);W=!0;for(var e=B.length;e;){for(P=B,B=[];++Z<e;)P&&P[Z].run();Z=-1,e=B.length}P=null,W=!1,ft(t)}}x.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];B.push(new rr(t,e)),B.length===1&&!W&&Ze(er)};function rr(t,e){this.fun=t,this.array=e}rr.prototype.run=function(){this.fun.apply(null,this.array)};x.title="browser";x.browser=!0;x.env={};x.argv=[];x.version="";x.versions={};function L(){}x.on=L;x.addListener=L;x.once=L;x.off=L;x.removeListener=L;x.removeAllListeners=L;x.emit=L;x.prependListener=L;x.prependOnceListener=L;x.listeners=function(t){return[]};x.binding=function(t){throw new Error("process.binding is not supported")};x.cwd=function(){return"/"};x.chdir=function(t){throw new Error("process.chdir is not supported")};x.umask=function(){return 0}});var m,y,Et,f=Lr(()=>{m=Q(Je()),y=Q(nr()),Et=function(t){function e(){var n=this||self;return delete t.prototype.__magic__,n}if(typeof globalThis=="object")return globalThis;if(this)return e();t.defineProperty(t.prototype,"__magic__",{configurable:!0,get:e});var r=__magic__;return r}(Object)});var vt={};Cr(vt,{useSignMultipleTransactions:()=>wt});module.exports=Ur(vt);f();var O=require("react");f();var X=require("react");f();var Te=require("@multiversx/sdk-core"),xe=Q(require("bignumber.js"));f();f();var ir=require("@multiversx/sdk-core");function dt(t){try{let e=new ir.Address(t);return Boolean(e.bech32())}catch(e){return!1}}function or(t){return(t==null?void 0:t.startsWith("erd"))&&t.length===62&&/^\w+$/.test(t)&&dt(t)}f();f();function ar(t){for(let e=0;e<t.length;e++)if(t.charCodeAt(e)>127)return!1;return!0}function ee(t){let e=t;try{let r=m.Buffer.from(t,"hex").toString();ar(r)&&r.length>1&&(e=r)}catch(r){}return e}var ye={tokenId:"",amount:""},mt=t=>t.split("@").map((o,a)=>[2,3].includes(a)?o:ee(o));function sr(t){if(!t)return ye;let e=t.startsWith("ESDTTransfer"),r=t.startsWith("ESDTNFTTransfer")&&t.includes("@");if(e){let[,n,i]=t.split("@");try{let o=m.Buffer.from(n,"hex").toString("ascii");if(!o)return ye;let a=new xe.default("0x"+i.replace("0x","")).toString(10);return{tokenId:o,amount:a}}catch(o){console.error("Error getting token from transaction data",o)}}if(r)try{let[,n,i,o,a]=mt(t);if([n,i,o,a].every(u=>Boolean(u))&&or(new Te.Address(a).bech32()))return{tokenId:`${n}-${i}`,amount:new xe.default(o,16).toString(10),collection:n,nonce:i,receiver:new Te.Address(a).bech32()}}catch(n){}return ye}f();var we=Q(require("bignumber.js"));f();f();f();f();f();f();f();f();f();f();var cr=(t,e)=>{let r=[],n=t.indexOf(e,0);for(;n>=0;)r.push(n),n=t.indexOf(e,n+1);return r};function ur(t){let e=[],r=0;try{if((t==null?void 0:t.startsWith("MultiESDTNFTTransfer"))&&(t==null?void 0:t.includes("@"))){let[,n,i,...o]=t==null?void 0:t.split("@");if(n){let a=new we.default(i,16).toNumber(),u=0;for(let l=0;l<a;l++){let h={type:"nftTransaction",data:"",receiver:n};for(let g=0;g<3;g++){switch(g){case 0:h.token=ee(o[u]),h.data=o[u];break;case 1:{let S=o[u]&&o[u].length?o[u]:"";S&&S!=="00"?h.nonce=S:h.type="esdtTransaction",h.data=`${h.data}@${o[u]}`;break}case 2:h.amount=new we.default(o[u],16).toString(10),h.data=`${h.data}@${o[u]}`;break;default:break}r=u+1,u++}e[l]=h}let c=e.length!==a,p=e.some(l=>cr(l.data,"@").length!==2),d=e.some(l=>l.data.startsWith("@"));if(c||p||d)return[];if(o[r]){let l=o[r];for(let h=r+1;h<o.length;h++)l+="@"+o[h];e[a]={type:"scCall",data:l,receiver:n}}}}}catch(n){return console.error("failed parsing tx",n),e}return e}var pr={tokenId:"",amount:"",type:"",multiTxData:"",receiver:""};function lr({transactions:t}){let[e,r]=(0,X.useState)({}),[n,i]=(0,X.useState)([]);function o(c,p){r(d=>Ce(U({},d),{[c]:p}))}function a(c,p){return e==null?pr:c in e?e[c]:p!=null&&String(p)in e?e[p]:pr}function u(){if(t&&t.length>0){let c=[];t.forEach((p,d)=>{let l=p.getData().toString(),h=ur(l);if(h.length>0)h.forEach((g,S)=>{let q={transaction:p,multiTxData:g.data,transactionIndex:S};o(g.data,{tokenId:g.token?g.token:"",amount:g.amount?g.amount:"",type:g.type,nonce:g.nonce?g.nonce:"",multiTxData:g.data,receiver:g.receiver}),c.push(q)});else{let{tokenId:g,amount:S}=sr(p.getData().toString());g&&o(p.getData().toString(),{tokenId:g,amount:S,receiver:p.getReceiver().bech32()}),c.push({transaction:p,transactionIndex:d})}}),i(c)}}return(0,X.useEffect)(()=>{u()},[t==null?void 0:t.length]),{parsedTransactionsByDataField:e,getTxInfoByDataField:a,allTransactions:n}}f();f();var ve={36864:{code:"codeSuccess",message:"Success"},27013:{code:"ERR_USER_DENIED",message:"Rejected by user"},27904:{code:"ERR_UNKNOWN_INSTRUCTION",message:"Unknown instruction"},28160:{code:"ERR_WRONG_CLA",message:"Wrong CLA"},28161:{code:"ERR_INVALID_ARGUMENTS",message:"Invalid arguments"},28162:{code:"ERR_INVALID_MESSAGE",message:"Invalid message"},28163:{code:"ERR_INVALID_P1",message:"Invalid P1"},28164:{code:"ERR_MESSAGE_TOO_LONG",message:"Message too long"},28165:{code:"ERR_RECEIVER_TOO_LONG",message:"Receiver too long"},28166:{code:"ERR_AMOUNT_TOO_LONG",message:"Amount too long"},28167:{code:"ERR_CONTRACT_DATA_DISABLED",message:"Contract data disabled in app options"},28168:{code:"ERR_MESSAGE_INCOMPLETE",message:"Message incomplete"},28176:{code:"ERR_SIGNATURE_FAILED",message:"Signature failed"},28169:{code:"ERR_WRONG_TX_VERSION",message:"Wrong TX version"},28170:{code:"ERR_NONCE_TOO_LONG",message:"Nonce too long"},28171:{code:"ERR_INVALID_AMOUNT",message:"Invalid amount"},28172:{code:"ERR_INVALID_FEE",message:"Invalid fee"},28173:{code:"ERR_PRETTY_FAILED",message:"Pretty failed"},28174:{code:"ERR_DATA_TOO_LONG",message:"Data too long"},28175:{code:"ERR_WRONG_TX_OPTIONS",message:"Invalid transaction options"},28177:{code:"ERR_SIGN_TX_DEPRECATED",message:"Regular transaction signing is deprecated in this version. Use hash signing."}};var fr="Check if the MultiversX app is open on Ledger",yt=28161,Tt=28160,xt=[yt,Tt];function gr(t){let e=null;if((t==null?void 0:t.statusCode)in ve){let r=t==null?void 0:t.statusCode,{message:n}=ve[r];e=xt.includes(r)?fr:n}return{errorMessage:e,defaultErrorMessage:fr}}f();function dr({tokenId:t,erdLabel:e}){return Boolean(t&&t!==e)}var re={};function wt({isLedger:t=!1,transactionsToSign:e,egldLabel:r,address:n,onCancel:i,onSignTransaction:o,onTransactionsSignError:a,onTransactionsSignSuccess:u,onGetScamAddressData:c}){var Fe,Re,Ee;let[p,d]=(0,O.useState)(0),[l,h]=(0,O.useState)(),[g,S]=(0,O.useState)(null),[q,te]=(0,O.useState)(!1),{getTxInfoByDataField:hr,allTransactions:C}=lr({transactions:e}),ne=p===C.length-1;(0,O.useEffect)(()=>{mr()},[p,C]);function mr(){return oe(this,null,function*(){var Ae;let w=C[p];if(w==null)return;let{transaction:I,multiTxData:A}=w,ie=I.getData().toString(),be=hr(I.getData().toString(),A),{tokenId:_e}=be,V=I.getReceiver().toString(),Sr=n!==V,kr=V in re;if(Sr&&!kr&&c!=null){let z=yield c(V);re=U(U({},re),z!=null&&z.scamInfo?{[V]:z.scamInfo}:{})}let Fr=Boolean(_e&&dr({tokenId:_e,erdLabel:r}));S({transaction:I,receiverScamInfo:((Ae=re[V])==null?void 0:Ae.info)||null,transactionTokenInfo:be,isTokenTransaction:Fr,dataField:ie})})}function Ie(){d(0),h(void 0),te(!1)}function Se(){return oe(this,null,function*(){try{if(g==null)return;te(t);let w=yield o(g.transaction),I={[p]:w},A=l?U(U({},l),I):I;h(A),ne?A&&(u(Object.values(A)),Ie()):(d(ie=>ie+1),te(!1))}catch(w){console.error(w,"sign error");let{message:I}=w,A=t?gr(w).errorMessage:null;Ie(),a(A!=null?A:I)}})}function yr(){try{if(g==null)return;g.transaction.getSignature().hex()?ne||d(I=>I+1):Se()}catch(w){Se()}}let Tr=p===0;function xr(){Tr?i==null||i():d(w=>w-1)}let ke=Boolean(((Fe=g==null?void 0:g.transactionTokenInfo)==null?void 0:Fe.type)&&((Re=g==null?void 0:g.transactionTokenInfo)==null?void 0:Re.multiTxData)&&!(g!=null&&g.dataField.endsWith((Ee=g==null?void 0:g.transactionTokenInfo)==null?void 0:Ee.multiTxData)));function wr(){ke?d(w=>w+1):yr()}function vr(){d(w=>{let I=w+1;return I>(C==null?void 0:C.length)?w:I})}function Ir(){d(w=>{let I=w-1;return I<0?w:I})}return{allTransactions:C,onSignTransaction:wr,onNext:vr,onPrev:Ir,waitingForDevice:q,onAbort:xr,isLastTransaction:ne,isFirstTransaction:p===0,hasMultipleTransactions:C.length>1,shouldContinueWithoutSigning:ke,currentStep:p,signedTransactions:l,currentTransaction:g}}0&&(module.exports={useSignMultipleTransactions});
2
2
  /*!
3
3
  * The buffer module from node.js, for the browser.
4
4
  *