@multiversx/sdk-dapp 2.14.3 → 2.14.4

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 (231) hide show
  1. package/UI/DappModal/hooks/index.js +1 -1
  2. package/UI/DappModal/hooks/useDappModal.js +1 -1
  3. package/UI/DappModal/index.js +1 -1
  4. package/UI/ModalContainer/ModalContainer.js +1 -1
  5. package/UI/ModalContainer/index.js +1 -1
  6. package/UI/NotificationModal/NotificationModal.js +1 -1
  7. package/UI/NotificationModal/index.js +1 -1
  8. package/UI/SignTransactionsModals/SignTransactionsModals.js +1 -1
  9. package/UI/SignTransactionsModals/SignWithDeviceModal/SignStep.js +1 -1
  10. package/UI/SignTransactionsModals/SignWithDeviceModal/SignWithDeviceModal.js +1 -1
  11. package/UI/SignTransactionsModals/SignWithDeviceModal/components/SignStepBody.js +1 -1
  12. package/UI/SignTransactionsModals/SignWithDeviceModal/components/components/ConfirmFee/ConfirmFee.js +1 -1
  13. package/UI/SignTransactionsModals/SignWithDeviceModal/components/components/ConfirmFee/index.js +1 -1
  14. package/UI/SignTransactionsModals/SignWithDeviceModal/components/components/NftSftPreviewComponent/NftSftPreviewComponent.js +1 -1
  15. package/UI/SignTransactionsModals/SignWithDeviceModal/components/components/NftSftPreviewComponent/index.js +1 -1
  16. package/UI/SignTransactionsModals/SignWithDeviceModal/components/index.js +1 -1
  17. package/UI/SignTransactionsModals/SignWithDeviceModal/index.js +1 -1
  18. package/UI/SignTransactionsModals/SignWithExtensionModal/SignWithExtensionModal.js +1 -1
  19. package/UI/SignTransactionsModals/SignWithExtensionModal/index.js +1 -1
  20. package/UI/SignTransactionsModals/SignWithLedgerModal/LedgerGuardianSigningModalError.js +1 -1
  21. package/UI/SignTransactionsModals/SignWithLedgerModal/SignWithLedgerModal.js +1 -1
  22. package/UI/SignTransactionsModals/SignWithLedgerModal/index.js +1 -1
  23. package/UI/SignTransactionsModals/SignWithOperaModal/SignWithOperaModal.js +1 -1
  24. package/UI/SignTransactionsModals/SignWithOperaModal/index.js +1 -1
  25. package/UI/SignTransactionsModals/SignWithWalletConnectModal/index.js +1 -1
  26. package/UI/SignTransactionsModals/components/ConfirmationScreen.js +1 -1
  27. package/UI/SignTransactionsModals/components/DeviceConfirmationScreen.js +1 -1
  28. package/UI/SignTransactionsModals/components/SignWaitingScreenModal/SignWaitingScreenModal.js +1 -1
  29. package/UI/SignTransactionsModals/components/SignWaitingScreenModal/index.js +1 -1
  30. package/UI/SignTransactionsModals/components/TransactionStatusToast.js +1 -1
  31. package/UI/SignTransactionsModals/components/index.js +1 -1
  32. package/UI/SignTransactionsModals/index.js +1 -1
  33. package/UI/TransactionDetails/TransactionDetails.js +1 -1
  34. package/UI/TransactionDetails/components/TransactionDetailsBody.js +1 -1
  35. package/UI/TransactionDetails/components/index.js +1 -1
  36. package/UI/TransactionDetails/index.js +1 -1
  37. package/UI/TransactionInfo/TransactionInfo.js +1 -1
  38. package/UI/TransactionInfo/components/AddressDetailItem/AddressDetailitem.js +1 -1
  39. package/UI/TransactionInfo/components/AddressDetailItem/index.js +1 -1
  40. package/UI/TransactionInfo/components/EventsList/EventsList.js +1 -1
  41. package/UI/TransactionInfo/components/EventsList/index.js +1 -1
  42. package/UI/TransactionInfo/components/NonceMessage/NonceMessage.js +1 -1
  43. package/UI/TransactionInfo/components/NonceMessage/index.js +1 -1
  44. package/UI/TransactionInfo/components/OperationsList/OperationList.js +1 -1
  45. package/UI/TransactionInfo/components/OperationsList/components/DetailedItem.js +1 -1
  46. package/UI/TransactionInfo/components/OperationsList/components/OperationBlock.js +1 -1
  47. package/UI/TransactionInfo/components/OperationsList/components/OperationRow.js +1 -1
  48. package/UI/TransactionInfo/components/OperationsList/components/OperationText.js +1 -1
  49. package/UI/TransactionInfo/components/OperationsList/components/index.js +1 -1
  50. package/UI/TransactionInfo/components/OperationsList/index.js +1 -1
  51. package/UI/TransactionInfo/components/ScResultsList/ScResultsList.js +1 -1
  52. package/UI/TransactionInfo/components/ScResultsList/components/ResultHash/ResultHash.js +1 -1
  53. package/UI/TransactionInfo/components/ScResultsList/components/ResultHash/index.js +1 -1
  54. package/UI/TransactionInfo/components/ScResultsList/components/ResultReceiver/ResultReceiver.js +1 -1
  55. package/UI/TransactionInfo/components/ScResultsList/components/ResultReceiver/index.js +1 -1
  56. package/UI/TransactionInfo/components/ScResultsList/components/ResultSender/ResultSender.js +1 -1
  57. package/UI/TransactionInfo/components/ScResultsList/components/ResultSender/index.js +1 -1
  58. package/UI/TransactionInfo/components/ScResultsList/index.js +1 -1
  59. package/UI/TransactionInfo/components/ScrDetailItem/ScrDetailItem.js +1 -1
  60. package/UI/TransactionInfo/components/ScrDetailItem/index.js +1 -1
  61. package/UI/TransactionInfo/components/TransactionAction/TransactionAction.js +1 -1
  62. package/UI/TransactionInfo/components/TransactionAction/components/ActionText/index.js +1 -1
  63. package/UI/TransactionInfo/components/TransactionAction/components/index.js +1 -1
  64. package/UI/TransactionInfo/components/TransactionAction/index.js +1 -1
  65. package/UI/TransactionInfo/components/TransactionLogs/TransactionLogs.js +1 -1
  66. package/UI/TransactionInfo/components/TransactionLogs/index.js +1 -1
  67. package/UI/TransactionInfo/components/index.js +1 -1
  68. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoFrom/TransactionInfoFrom.js +1 -1
  69. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoFrom/index.js +1 -1
  70. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoMethod/TransactionInfoMethod.js +1 -1
  71. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoMethod/index.js +1 -1
  72. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoMiniblock/TransactionInfoMiniblock.js +1 -1
  73. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoMiniblock/index.js +1 -1
  74. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoNonce/TransactionInfoNonce.js +1 -1
  75. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoNonce/index.js +1 -1
  76. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoScResults/TransactionInfoScResults.js +1 -1
  77. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoScResults/index.js +1 -1
  78. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoTo/TransactionInfoTo.js +1 -1
  79. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoTo/index.js +1 -1
  80. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoTokenOperations/TransactionInfoTokenOperations.js +1 -1
  81. package/UI/TransactionInfo/components/transactionInfoFields/TransactionInfoTokenOperations/index.js +1 -1
  82. package/UI/TransactionInfo/components/transactionInfoFields/index.js +1 -1
  83. package/UI/TransactionInfo/index.js +1 -1
  84. package/UI/TransactionsTable/TransactionsTable.js +1 -1
  85. package/UI/TransactionsTable/components/AccountName.js +1 -1
  86. package/UI/TransactionsTable/components/TransactionHash.js +1 -1
  87. package/UI/TransactionsTable/components/TransactionReceiver.js +1 -1
  88. package/UI/TransactionsTable/components/TransactionRow.js +1 -1
  89. package/UI/TransactionsTable/components/TransactionSender.js +1 -1
  90. package/UI/TransactionsTable/components/index.js +1 -1
  91. package/UI/TransactionsTable/index.js +1 -1
  92. package/UI/TransactionsToastList/TransactionsToastList.js +1 -1
  93. package/UI/TransactionsToastList/components/CustomToast/CustomToast.js +1 -1
  94. package/UI/TransactionsToastList/components/CustomToast/components/IconToast/IconToast.js +1 -1
  95. package/UI/TransactionsToastList/components/CustomToast/components/IconToast/components/IconToastFooter/IconToastFooter.js +1 -1
  96. package/UI/TransactionsToastList/components/CustomToast/components/IconToast/components/IconToastFooter/components/TransactionToastFooter.js +1 -1
  97. package/UI/TransactionsToastList/components/CustomToast/components/IconToast/components/IconToastFooter/components/index.js +1 -1
  98. package/UI/TransactionsToastList/components/CustomToast/components/IconToast/components/IconToastFooter/index.js +1 -1
  99. package/UI/TransactionsToastList/components/CustomToast/components/IconToast/index.js +1 -1
  100. package/UI/TransactionsToastList/components/CustomToast/components/SimpleToast.js +1 -1
  101. package/UI/TransactionsToastList/components/CustomToast/components/index.js +1 -1
  102. package/UI/TransactionsToastList/components/CustomToast/helpers/index.js +1 -1
  103. package/UI/TransactionsToastList/components/CustomToast/helpers/useMemoizedCloseButton.js +1 -1
  104. package/UI/TransactionsToastList/components/CustomToast/index.js +1 -1
  105. package/UI/TransactionsToastList/components/TransactionToast/TransactionToast.js +1 -1
  106. package/UI/TransactionsToastList/components/TransactionToast/components/DefaultToastDeleteButton.js +1 -1
  107. package/UI/TransactionsToastList/components/TransactionToast/components/TransactionToastContent.js +1 -1
  108. package/UI/TransactionsToastList/components/TransactionToast/components/index.js +1 -1
  109. package/UI/TransactionsToastList/components/TransactionToast/hooks/useTransactionToast.js +1 -1
  110. package/UI/TransactionsToastList/components/TransactionToast/index.js +1 -1
  111. package/UI/TransactionsToastList/components/TransactionToastGuard.js +1 -1
  112. package/UI/TransactionsToastList/components/index.js +1 -1
  113. package/UI/TransactionsToastList/index.js +1 -1
  114. package/UI/Trim/Trim.js +1 -1
  115. package/UI/Trim/index.js +1 -1
  116. package/UI/index.js +1 -1
  117. package/UI/ledger/LedgerLoginButton/LedgerLoginButton.js +1 -1
  118. package/UI/ledger/LedgerLoginButton/index.js +1 -1
  119. package/UI/ledger/LedgerLoginContainer/AddressRow.js +1 -1
  120. package/UI/ledger/LedgerLoginContainer/AddressTable.js +1 -1
  121. package/UI/ledger/LedgerLoginContainer/ConfirmAddress.js +1 -1
  122. package/UI/ledger/LedgerLoginContainer/index.js +1 -1
  123. package/UI/ledger/index.js +1 -1
  124. package/UI/operaWallet/OperaWalletLoginButton/OperaWalletLoginButton.js +1 -1
  125. package/UI/operaWallet/OperaWalletLoginButton/index.js +1 -1
  126. package/UI/pages/UnlockPage/index.js +1 -1
  127. package/UI/pages/index.js +1 -1
  128. package/UI/walletConnect/WalletConnectLoginButton/WalletConnectLoginButton.js +1 -1
  129. package/UI/walletConnect/WalletConnectLoginButton/index.js +1 -1
  130. package/UI/walletConnect/WalletConnectLoginContainer/index.js +1 -1
  131. package/UI/walletConnect/index.js +1 -1
  132. package/__chunks__/{chunk-6OFXQVUT.js → chunk-52Y6CHVB.js} +2 -2
  133. package/__chunks__/{chunk-BYITR7E4.js → chunk-5UZMHOUB.js} +2 -2
  134. package/__chunks__/chunk-74RR42GW.js +2 -0
  135. package/__chunks__/{chunk-J57T5QE3.js → chunk-7EKFPJ4U.js} +2 -2
  136. package/__chunks__/{chunk-2SCW4SVI.js → chunk-BOG6ROSF.js} +2 -2
  137. package/__chunks__/{chunk-X27CJBLI.js → chunk-CCPH6YBW.js} +2 -2
  138. package/__chunks__/{chunk-HDZI637B.js → chunk-EFBSLWOT.js} +2 -2
  139. package/__chunks__/chunk-GAYS6IZO.js +2 -0
  140. package/__chunks__/{chunk-WOOPC5ZW.js → chunk-JCB2UFE6.js} +2 -2
  141. package/__chunks__/{chunk-AUPP7RGC.js → chunk-JFYYTG2B.js} +2 -2
  142. package/__chunks__/chunk-LDOD4URJ.js +2 -0
  143. package/__chunks__/{chunk-C7BMLFJP.js → chunk-LI2YTG6T.js} +2 -2
  144. package/__chunks__/{chunk-GJBD7RPH.js → chunk-N4AS4WKH.js} +2 -2
  145. package/__chunks__/{chunk-I2ZNHA6A.js → chunk-O3AHG24N.js} +2 -2
  146. package/__chunks__/{chunk-RDLDEORR.js → chunk-OATDAXFL.js} +2 -2
  147. package/__chunks__/{chunk-XUZZU2SJ.js → chunk-PEFNQYFJ.js} +2 -2
  148. package/__chunks__/{chunk-LRX2BJPT.js → chunk-QDMQLFXE.js} +2 -2
  149. package/__chunks__/{chunk-BPNXCDIK.js → chunk-RA4VBSV4.js} +2 -2
  150. package/__chunks__/{chunk-UGI3Z2VB.js → chunk-SIX6M33Q.js} +2 -2
  151. package/__chunks__/{chunk-KVOYPUTL.js → chunk-SRAOPXTJ.js} +2 -2
  152. package/__chunks__/{chunk-ZE7Y2E3X.js → chunk-SZOZTDWH.js} +2 -2
  153. package/__chunks__/chunk-UJFVVD7I.js +2 -0
  154. package/__chunks__/chunk-UP3FFMFW.js +2 -0
  155. package/__chunks__/{chunk-YGG5ERHH.js → chunk-V24SSAOI.js} +2 -2
  156. package/__commonjs/UI/SignTransactionsModals/SignTransactionsModals.js +9 -9
  157. package/__commonjs/UI/SignTransactionsModals/SignWithDeviceModal/SignWithDeviceModal.js +8 -8
  158. package/__commonjs/UI/SignTransactionsModals/SignWithDeviceModal/index.js +8 -8
  159. package/__commonjs/UI/SignTransactionsModals/SignWithLedgerModal/LedgerGuardianSigningModalError.js +14 -14
  160. package/__commonjs/UI/SignTransactionsModals/SignWithLedgerModal/SignWithLedgerModal.js +1 -1
  161. package/__commonjs/UI/SignTransactionsModals/SignWithLedgerModal/index.js +1 -1
  162. package/__commonjs/UI/SignTransactionsModals/components/ConfirmationScreen.js +2 -2
  163. package/__commonjs/UI/SignTransactionsModals/components/DeviceConfirmationScreen.js +2 -2
  164. package/__commonjs/UI/SignTransactionsModals/components/TransactionStatusToast.js +2 -2
  165. package/__commonjs/UI/SignTransactionsModals/components/index.js +12 -12
  166. package/__commonjs/UI/SignTransactionsModals/index.js +9 -9
  167. package/__commonjs/UI/TransactionDetails/TransactionDetails.js +1 -1
  168. package/__commonjs/UI/TransactionDetails/components/TransactionDetailsBody.js +1 -1
  169. package/__commonjs/UI/TransactionDetails/components/index.js +1 -1
  170. package/__commonjs/UI/TransactionDetails/index.js +1 -1
  171. package/__commonjs/UI/TransactionsToastList/TransactionsToastList.js +3 -3
  172. package/__commonjs/UI/TransactionsToastList/components/CustomToast/CustomToast.js +2 -2
  173. package/__commonjs/UI/TransactionsToastList/components/CustomToast/components/IconToast/IconToast.js +2 -2
  174. package/__commonjs/UI/TransactionsToastList/components/CustomToast/components/IconToast/components/IconToastFooter/IconToastFooter.js +1 -1
  175. package/__commonjs/UI/TransactionsToastList/components/CustomToast/components/IconToast/components/IconToastFooter/components/TransactionToastFooter.js +1 -1
  176. package/__commonjs/UI/TransactionsToastList/components/CustomToast/components/IconToast/components/IconToastFooter/components/index.js +1 -1
  177. package/__commonjs/UI/TransactionsToastList/components/CustomToast/components/IconToast/components/IconToastFooter/index.js +1 -1
  178. package/__commonjs/UI/TransactionsToastList/components/CustomToast/components/IconToast/index.js +2 -2
  179. package/__commonjs/UI/TransactionsToastList/components/CustomToast/components/SimpleToast.js +1 -1
  180. package/__commonjs/UI/TransactionsToastList/components/CustomToast/components/index.js +2 -2
  181. package/__commonjs/UI/TransactionsToastList/components/CustomToast/helpers/index.js +1 -1
  182. package/__commonjs/UI/TransactionsToastList/components/CustomToast/helpers/useMemoizedCloseButton.js +1 -1
  183. package/__commonjs/UI/TransactionsToastList/components/CustomToast/index.js +2 -2
  184. package/__commonjs/UI/TransactionsToastList/components/TransactionToast/TransactionToast.js +3 -3
  185. package/__commonjs/UI/TransactionsToastList/components/TransactionToast/components/DefaultToastDeleteButton.js +1 -1
  186. package/__commonjs/UI/TransactionsToastList/components/TransactionToast/components/TransactionToastContent.js +2 -2
  187. package/__commonjs/UI/TransactionsToastList/components/TransactionToast/components/index.js +3 -3
  188. package/__commonjs/UI/TransactionsToastList/components/TransactionToast/index.js +3 -3
  189. package/__commonjs/UI/TransactionsToastList/components/TransactionToastGuard.js +3 -3
  190. package/__commonjs/UI/TransactionsToastList/components/index.js +3 -3
  191. package/__commonjs/UI/TransactionsToastList/index.js +3 -3
  192. package/__commonjs/UI/index.js +18 -18
  193. package/__commonjs/components/TransactionStatusToast/FailedTransactionStatusToast.js +2 -2
  194. package/__commonjs/hooks/index.js +1 -1
  195. package/__commonjs/hooks/transactions/index.js +1 -1
  196. package/__commonjs/hooks/transactions/useParseMultiEsdtTransferData.js +1 -1
  197. package/__commonjs/hooks/transactions/useSignMultipleTransactions.js +1 -1
  198. package/__commonjs/hooks/transactions/useSignTransactionsWithDevice.js +1 -1
  199. package/__commonjs/hooks/transactions/useSignTransactionsWithLedger.js +1 -1
  200. package/__mocks__/index.js +1 -1
  201. package/__mocks__/utils/index.js +1 -1
  202. package/__mocks__/utils/renderWithProvider.js +1 -1
  203. package/components/LogoutListener/LogoutListener.js +1 -1
  204. package/components/LogoutListener/helpers/index.js +1 -1
  205. package/components/LogoutListener/helpers/useLogoutFromMultipleTabs.js +1 -1
  206. package/components/LogoutListener/helpers/useNativeAuthLogout.js +1 -1
  207. package/components/LogoutListener/helpers/useNativeAuthLogoutWarning/index.js +1 -1
  208. package/components/LogoutListener/helpers/useNativeAuthLogoutWarning/useNativeAuthLogoutWarning.js +1 -1
  209. package/components/LogoutListener/index.js +1 -1
  210. package/components/TransactionStatusToast/FailedTransactionStatusToast.js +1 -1
  211. package/components/TransactionsTracker/TransactionTracker.js +1 -1
  212. package/components/TransactionsTracker/index.js +1 -1
  213. package/components/TransactionsTracker/useTransactionsTracker.js +1 -1
  214. package/hooks/index.js +1 -1
  215. package/hooks/toasts/index.js +1 -1
  216. package/hooks/toasts/useTransactionsToasts.js +1 -1
  217. package/hooks/transactions/index.js +1 -1
  218. package/hooks/transactions/useParseMultiEsdtTransferData.js +1 -1
  219. package/hooks/transactions/useSignMultipleTransactions.js +1 -1
  220. package/hooks/transactions/useSignTransactionsWithDevice.js +1 -1
  221. package/hooks/transactions/useSignTransactionsWithLedger.js +1 -1
  222. package/package.json +1 -1
  223. package/wrappers/DappProvider/CustomComponents.js +1 -1
  224. package/wrappers/DappProvider/DappProvider.js +1 -1
  225. package/wrappers/DappProvider/index.js +1 -1
  226. package/wrappers/index.js +1 -1
  227. package/__chunks__/chunk-6NLOVYDI.js +0 -2
  228. package/__chunks__/chunk-7F37MW76.js +0 -2
  229. package/__chunks__/chunk-KK6D6OI6.js +0 -2
  230. package/__chunks__/chunk-SYJSPEIV.js +0 -2
  231. package/__chunks__/chunk-T26DIT4Y.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,pr=Object.getOwnPropertySymbols,Vr=Object.getPrototypeOf,cr=Object.prototype.hasOwnProperty,Xr=Object.prototype.propertyIsEnumerable;var ur=(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)&&ur(t,e,r[e]);if(pr)for(var e of pr(r))Xr.call(r,e)&&ur(t,e,r[e]);return t},fr=(t,r)=>Yr(t,$r(r));var Jr=(t,r)=>()=>(t&&(r=t(t=0)),r);var G=(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 O=(t,r,e)=>(e=t!=null?Wr(Vr(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=G(H=>{"use strict";f();H.byteLength=re;H.toByteArray=te;H.fromByteArray=ae;var I=[],F=[],Zr=typeof Uint8Array!="undefined"?Uint8Array:Array,Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(E=0,dr=Q.length;E<dr;++E)I[E]=Q[E],F[Q.charCodeAt(E)]=E;var E,dr;F["-".charCodeAt(0)]=62;F["_".charCodeAt(0)]=63;function hr(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=hr(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=hr(t),n=e[0],i=e[1],a=new Zr(ee(t,n,i)),o=0,p=i>0?n-4:n,u;for(u=0;u<p;u+=4)r=F[t.charCodeAt(u)]<<18|F[t.charCodeAt(u+1)]<<12|F[t.charCodeAt(u+2)]<<6|F[t.charCodeAt(u+3)],a[o++]=r>>16&255,a[o++]=r>>8&255,a[o++]=r&255;return i===2&&(r=F[t.charCodeAt(u)]<<2|F[t.charCodeAt(u+1)]>>4,a[o++]=r&255),i===1&&(r=F[t.charCodeAt(u)]<<10|F[t.charCodeAt(u+1)]<<4|F[t.charCodeAt(u+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,p=e-n;o<p;o+=a)i.push(ie(t,o,o+a>p?p: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=G(V=>{f();V.read=function(t,r,e,n,i){var a,o,p=i*8-n-1,u=(1<<p)-1,l=u>>1,g=-7,c=e?i-1:0,h=e?-1:1,d=t[r+c];for(c+=h,a=d&(1<<-g)-1,d>>=-g,g+=p;g>0;a=a*256+t[r+c],c+=h,g-=8);for(o=a&(1<<-g)-1,a>>=-g,g+=n;g>0;o=o*256+t[r+c],c+=h,g-=8);if(a===0)a=1-l;else{if(a===u)return o?NaN:(d?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-l}return(d?-1:1)*o*Math.pow(2,a-n)};V.write=function(t,r,e,n,i,a){var o,p,u,l=a*8-i-1,g=(1<<l)-1,c=g>>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=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?(p=isNaN(r)?1:0,o=g):(o=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+c>=1?r+=h/u:r+=h*Math.pow(2,1-c),r*u>=2&&(o++,u/=2),o+c>=g?(p=0,o=g):o+c>=1?(p=(r*u-1)*Math.pow(2,i),o=o+c):(p=r*Math.pow(2,c-1)*Math.pow(2,i),o=0));i>=8;t[e+d]=p&255,d+=v,p/=256,i-=8);for(o=o<<i|p,l+=i;l>0;t[e+d]=o&255,d+=v,o/=256,l-=8);t[e+d-v]|=$*128}});var Dr=G(C=>{"use strict";f();var X=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 R(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 pe(t,r);if(ArrayBuffer.isView(t))return ue(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?R(t):r!==void 0?typeof e=="string"?R(t).fill(r,e):R(t).fill(r):R(t)}s.alloc=function(t,r,e){return se(t,r,e)};function Z(t){return kr(t),R(t<0?0:rr(t)|0)}s.allocUnsafe=function(t){return Z(t)};s.allocUnsafeSlow=function(t){return Z(t)};function pe(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=R(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=R(r),n=0;n<r;n+=1)e[n]=t[n]&255;return e}function ue(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=R(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)?R(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 Ar(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 _(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)_(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)_(this,e,e+3),_(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)_(this,e,e+7),_(this,e+1,e+6),_(this,e+2,e+5),_(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,p=n-e,u=Math.min(o,p),l=this.slice(i,a),g=r.slice(e,n),c=0;c<u;++c)if(l[c]!==g[c]){o=l[c],p=g[c];break}return o<p?-1:p<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,p=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,p/=2,e/=2}function u(d,v){return a===1?d[v]:d.readUInt16BE(v*a)}var l;if(i){var g=-1;for(l=e;l<o;l++)if(u(t,l)===u(r,g===-1?0:l-g)){if(g===-1&&(g=l),l-g+1===p)return g*a}else g!==-1&&(l-=l-g),g=-1}else for(e+p>o&&(e=o-p),l=e;l>=0;l--){for(var c=!0,h=0;h<p;h++)if(u(t,l+h)!==u(r,h)){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 p=parseInt(r.substr(o*2,2),16);if(er(p))return o;t[e+o]=p}return o}function de(t,r,e,n){return W(j(r,t.length-e),t,e,n)}function he(t,r,e,n){return W(be(r),t,e,n)}function ye(t,r,e,n){return W(Ar(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 de(this,r,e,n);case"ascii":case"latin1":case"binary":return he(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?X.fromByteArray(t):X.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,p=a>239?4:a>223?3:a>191?2:1;if(i+p<=e){var u,l,g,c;switch(p){case 1:a<128&&(o=a);break;case 2:u=t[i+1],(u&192)===128&&(c=(a&31)<<6|u&63,c>127&&(o=c));break;case 3:u=t[i+1],l=t[i+2],(u&192)===128&&(l&192)===128&&(c=(a&15)<<12|(u&63)<<6|l&63,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:u=t[i+1],l=t[i+2],g=t[i+3],(u&192)===128&&(l&192)===128&&(g&192)===128&&(c=(a&15)<<18|(u&63)<<12|(l&63)<<6|g&63,c>65535&&c<1114112&&(o=c))}}o===null?(o=65533,p=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=p}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+=Re[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,p=0;for(this[e]=r&255;++p<n&&(o*=256);)this[e+p]=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,p=1;for(this[e+o]=r&255;--o>=0&&(p*=256);)this[e+o]=r/p&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,p=1,u=0;for(this[e]=r&255;++o<n&&(p*=256);)r<0&&u===0&&this[e+o-1]!==0&&(u=1),this[e+o]=(r/p>>0)-u&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,p=1,u=0;for(this[e+o]=r&255;--o>=0&&(p*=256);)r<0&&u===0&&this[e+o+1]!==0&&(u=1),this[e+o]=(r/p>>0)-u&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 Rr(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 Rr(this,r,e,!0,n)};s.prototype.writeDoubleBE=function(r,e,n){return Rr(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 p=s.isBuffer(r)?r:s.from(r,i),u=p.length;if(u===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(o=0;o<n-e;++o)this[o+e]=p[o%u]}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 Ar(t){return X.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 Re=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=G((Oe,Lr)=>{f();var T=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 Ae(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 A=[],N=!1,U,Y=-1;function De(){!N||!U||(N=!1,U.length?A=U.concat(A):Y=-1,A.length&&_r())}function _r(){if(!N){var t=Er(De);N=!0;for(var r=A.length;r;){for(U=A,A=[];++Y<r;)U&&U[Y].run();Y=-1,r=A.length}U=null,N=!1,Ae(t)}}T.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];A.push(new Ur(t,r)),A.length===1&&!N&&Er(_r)};function Ur(t,r){this.fun=t,this.array=r}Ur.prototype.run=function(){this.fun.apply(null,this.array)};T.title="browser";T.browser=!0;T.env={};T.argv=[];T.version="";T.versions={};function D(){}T.on=D;T.addListener=D;T.once=D;T.off=D;T.removeListener=D;T.removeAllListeners=D;T.emit=D;T.prependListener=D;T.prependOnceListener=D;T.listeners=function(t){return[]};T.binding=function(t){throw new Error("process.binding is not supported")};T.cwd=function(){return"/"};T.chdir=function(t){throw new Error("process.chdir is not supported")};T.umask=function(){return 0}});var y,m,He,f=Jr(()=>{y=O(Dr()),m=O(Cr()),He=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=O(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 Gr(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(p=>Boolean(p))&&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=O(require("bignumber.js"));f();f();f();f();f();f();f();f();f();f();f();var Or=(t,r)=>{let e=[],n=t.indexOf(r,0);for(;n>=0;)e.push(n),n=t.indexOf(r,n+1);return e};function Hr(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(),p=0;for(let c=0;c<o;c++){let h={type:"nftTransaction",data:"",receiver:n};for(let d=0;d<3;d++){switch(d){case 0:h.token=z(a[p]),h.data=a[p];break;case 1:{let v=a[p]&&a[p].length?a[p]:"";v&&v!=="00"?h.nonce=v:h.type="esdtTransaction",h.data=`${h.data}@${a[p]}`;break}case 2:h.amount=new sr.default(a[p],16).toString(10),h.data=`${h.data}@${a[p]}`;break;default:break}e=p+1,p++}r[c]=h}let u=r.length!==o,l=r.some(c=>Or(c.data,"@").length!==2),g=r.some(c=>c.data.startsWith("@"));if(u||l||g)return[];if(a[e]){let c=a[e];for(let h=e+1;h<a.length;h++)c+="@"+a[h];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(u,l){e(g=>fr(lr({},g),{[u]:l}))}function o(u,l){return r==null?qr:u in r?r[u]:l!=null&&String(l)in r?r[l]:qr}function p(){if(t&&t.length>0){let u=[];t.forEach((l,g)=>{let c=l.getData().toString(),h=Hr(c);if(h.length>0)h.forEach((d,v)=>{let $={transaction:l,multiTxData:d.data,transactionIndex:v};a(d.data,{tokenId:d.token?d.token:"",amount:d.amount?d.amount:"",type:d.type,nonce:d.nonce?d.nonce:"",multiTxData:d.data,receiver:d.receiver}),u.push($)});else{let{tokenId:d,amount:v}=Gr(l.getData().toString());d&&a(l.getData().toString(),{tokenId:d,amount:v,receiver:l.getReceiver().bech32()}),u.push({transaction:l,transactionIndex:g})}}),i(u)}}return(0,M.useEffect)(()=>{p()},[t==null?void 0:t.length]),{parsedTransactionsByDataField:r,getTxInfoByDataField:o,allTransactions:n}}0&&(module.exports={useParseMultiEsdtTransferData});
1
+ "use strict";var Wr=Object.create;var M=Object.defineProperty,Yr=Object.defineProperties,zr=Object.getOwnPropertyDescriptor,$r=Object.getOwnPropertyDescriptors,Qr=Object.getOwnPropertyNames,pr=Object.getOwnPropertySymbols,Vr=Object.getPrototypeOf,cr=Object.prototype.hasOwnProperty,Xr=Object.prototype.propertyIsEnumerable;var ur=(t,r,e)=>r in t?M(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)&&ur(t,e,r[e]);if(pr)for(var e of pr(r))Xr.call(r,e)&&ur(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)M(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&&M(t,i,{get:()=>r[i],enumerable:!(n=zr(r,i))||n.enumerable});return t};var H=(t,r,e)=>(e=t!=null?Wr(Vr(t)):{},gr(r||!t||!t.__esModule?M(e,"default",{value:t,enumerable:!0}):e,t)),jr=t=>gr(M({},"__esModule",{value:!0}),t);var yr=O(q=>{"use strict";f();q.byteLength=re;q.toByteArray=te;q.fromByteArray=ae;var I=[],F=[],Zr=typeof Uint8Array!="undefined"?Uint8Array:Array,Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(E=0,dr=Q.length;E<dr;++E)I[E]=Q[E],F[Q.charCodeAt(E)]=E;var E,dr;F["-".charCodeAt(0)]=62;F["_".charCodeAt(0)]=63;function hr(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=hr(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=hr(t),n=e[0],i=e[1],a=new Zr(ee(t,n,i)),o=0,p=i>0?n-4:n,u;for(u=0;u<p;u+=4)r=F[t.charCodeAt(u)]<<18|F[t.charCodeAt(u+1)]<<12|F[t.charCodeAt(u+2)]<<6|F[t.charCodeAt(u+3)],a[o++]=r>>16&255,a[o++]=r>>8&255,a[o++]=r&255;return i===2&&(r=F[t.charCodeAt(u)]<<2|F[t.charCodeAt(u+1)]>>4,a[o++]=r&255),i===1&&(r=F[t.charCodeAt(u)]<<10|F[t.charCodeAt(u+1)]<<4|F[t.charCodeAt(u+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,p=e-n;o<p;o+=a)i.push(ie(t,o,o+a>p?p: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(V=>{f();V.read=function(t,r,e,n,i){var a,o,p=i*8-n-1,u=(1<<p)-1,l=u>>1,g=-7,c=e?i-1:0,h=e?-1:1,d=t[r+c];for(c+=h,a=d&(1<<-g)-1,d>>=-g,g+=p;g>0;a=a*256+t[r+c],c+=h,g-=8);for(o=a&(1<<-g)-1,a>>=-g,g+=n;g>0;o=o*256+t[r+c],c+=h,g-=8);if(a===0)a=1-l;else{if(a===u)return o?NaN:(d?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-l}return(d?-1:1)*o*Math.pow(2,a-n)};V.write=function(t,r,e,n,i,a){var o,p,u,l=a*8-i-1,g=(1<<l)-1,c=g>>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,v=n?1:-1,P=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(p=isNaN(r)?1:0,o=g):(o=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+c>=1?r+=h/u:r+=h*Math.pow(2,1-c),r*u>=2&&(o++,u/=2),o+c>=g?(p=0,o=g):o+c>=1?(p=(r*u-1)*Math.pow(2,i),o=o+c):(p=r*Math.pow(2,c-1)*Math.pow(2,i),o=0));i>=8;t[e+d]=p&255,d+=v,p/=256,i-=8);for(o=o<<i|p,l+=i;l>0;t[e+d]=o&255,d+=v,o/=256,l-=8);t[e+d-v]|=P*128}});var Dr=O(C=>{"use strict";f();var X=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 W=2147483647;C.kMaxLength=W;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 R(t){if(t>W)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 pe(t,r);if(ArrayBuffer.isView(t))return ue(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?R(t):r!==void 0?typeof e=="string"?R(t).fill(r,e):R(t).fill(r):R(t)}s.alloc=function(t,r,e){return se(t,r,e)};function Z(t){return kr(t),R(t<0?0:rr(t)|0)}s.allocUnsafe=function(t){return Z(t)};s.allocUnsafeSlow=function(t){return Z(t)};function pe(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=R(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=R(r),n=0;n<r;n+=1)e[n]=t[n]&255;return e}function ue(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=R(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)?R(0):J(t);if(t.type==="Buffer"&&Array.isArray(t.data))return J(t.data)}function rr(t){if(t>=W)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+W.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 Ar(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 _(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)_(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)_(this,e,e+3),_(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)_(this,e,e+7),_(this,e+1,e+6),_(this,e+2,e+5),_(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,p=n-e,u=Math.min(o,p),l=this.slice(i,a),g=r.slice(e,n),c=0;c<u;++c)if(l[c]!==g[c]){o=l[c],p=g[c];break}return o<p?-1:p<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,p=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,p/=2,e/=2}function u(d,v){return a===1?d[v]:d.readUInt16BE(v*a)}var l;if(i){var g=-1;for(l=e;l<o;l++)if(u(t,l)===u(r,g===-1?0:l-g)){if(g===-1&&(g=l),l-g+1===p)return g*a}else g!==-1&&(l-=l-g),g=-1}else for(e+p>o&&(e=o-p),l=e;l>=0;l--){for(var c=!0,h=0;h<p;h++)if(u(t,l+h)!==u(r,h)){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 p=parseInt(r.substr(o*2,2),16);if(er(p))return o;t[e+o]=p}return o}function de(t,r,e,n){return Y(j(r,t.length-e),t,e,n)}function he(t,r,e,n){return Y(be(r),t,e,n)}function ye(t,r,e,n){return Y(Ar(r),t,e,n)}function me(t,r,e,n){return Y(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 de(this,r,e,n);case"ascii":case"latin1":case"binary":return he(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?X.fromByteArray(t):X.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,p=a>239?4:a>223?3:a>191?2:1;if(i+p<=e){var u,l,g,c;switch(p){case 1:a<128&&(o=a);break;case 2:u=t[i+1],(u&192)===128&&(c=(a&31)<<6|u&63,c>127&&(o=c));break;case 3:u=t[i+1],l=t[i+2],(u&192)===128&&(l&192)===128&&(c=(a&15)<<12|(u&63)<<6|l&63,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:u=t[i+1],l=t[i+2],g=t[i+3],(u&192)===128&&(l&192)===128&&(g&192)===128&&(c=(a&15)<<18|(u&63)<<12|(l&63)<<6|g&63,c>65535&&c<1114112&&(o=c))}}o===null?(o=65533,p=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=p}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+=Re[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,p=0;for(this[e]=r&255;++p<n&&(o*=256);)this[e+p]=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,p=1;for(this[e+o]=r&255;--o>=0&&(p*=256);)this[e+o]=r/p&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,p=1,u=0;for(this[e]=r&255;++o<n&&(p*=256);)r<0&&u===0&&this[e+o-1]!==0&&(u=1),this[e+o]=(r/p>>0)-u&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,p=1,u=0;for(this[e+o]=r&255;--o>=0&&(p*=256);)r<0&&u===0&&this[e+o+1]!==0&&(u=1),this[e+o]=(r/p>>0)-u&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 Rr(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 Rr(this,r,e,!0,n)};s.prototype.writeDoubleBE=function(r,e,n){return Rr(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 p=s.isBuffer(r)?r:s.from(r,i),u=p.length;if(u===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(o=0;o<n-e;++o)this[o+e]=p[o%u]}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 Ar(t){return X.toByteArray(Se(t))}function Y(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 Re=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((Oe,Lr)=>{f();var T=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 Ae(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 A=[],N=!1,U,z=-1;function De(){!N||!U||(N=!1,U.length?A=U.concat(A):z=-1,A.length&&_r())}function _r(){if(!N){var t=Er(De);N=!0;for(var r=A.length;r;){for(U=A,A=[];++z<r;)U&&U[z].run();z=-1,r=A.length}U=null,N=!1,Ae(t)}}T.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];A.push(new Ur(t,r)),A.length===1&&!N&&Er(_r)};function Ur(t,r){this.fun=t,this.array=r}Ur.prototype.run=function(){this.fun.apply(null,this.array)};T.title="browser";T.browser=!0;T.env={};T.argv=[];T.version="";T.versions={};function D(){}T.on=D;T.addListener=D;T.once=D;T.off=D;T.removeListener=D;T.removeAllListeners=D;T.emit=D;T.prependListener=D;T.prependOnceListener=D;T.listeners=function(t){return[]};T.binding=function(t){throw new Error("process.binding is not supported")};T.cwd=function(){return"/"};T.chdir=function(t){throw new Error("process.chdir is not supported")};T.umask=function(){return 0}});var y,m,He,f=Jr(()=>{y=H(Dr()),m=H(Cr()),He=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 G=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 $(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:$(a));function Gr(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(p=>Boolean(p))&&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();f();var Or=(t,r)=>{let e=[],n=t.indexOf(r,0);for(;n>=0;)e.push(n),n=t.indexOf(r,n+1);return e};function Hr(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(),p=0;for(let c=0;c<o;c++){let h={type:"nftTransaction",data:"",receiver:n};for(let d=0;d<3;d++){switch(d){case 0:h.token=$(a[p]),h.data=a[p];break;case 1:{let v=a[p]&&a[p].length?a[p]:"";v&&v!=="00"?h.nonce=v:h.type="esdtTransaction",h.data=`${h.data}@${a[p]}`;break}case 2:h.amount=new sr.default(a[p],16).toString(10),h.data=`${h.data}@${a[p]}`;break;default:break}e=p+1,p++}r[c]=h}let u=r.length!==o,l=r.some(c=>Or(c.data,"@").length!==2),g=r.some(c=>c.data.startsWith("@"));if(u||l||g)return[];if(a[e]){let c=a[e];for(let h=e+1;h<a.length;h++)c+="@"+a[h];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,G.useState)({}),[n,i]=(0,G.useState)([]);function a(u,l){e(g=>fr(lr({},g),{[u]:l}))}function o(u,l){return r==null?qr:u in r?r[u]:l!=null&&String(l)in r?r[l]:qr}function p(){if(t&&t.length>0){let u=[];t.forEach((l,g)=>{let c=l.getData().toString(),h=Hr(c);if(h.length>0)h.forEach((d,v)=>{let P={transaction:l,multiTxData:d.data,transactionIndex:v};a(d.data,{tokenId:d.token?d.token:"",amount:d.amount?d.amount:"",type:d.type,nonce:d.nonce?d.nonce:"",multiTxData:d.data,receiver:d.receiver}),u.push(P)});else{let d=l.getData().toString(),{tokenId:v,amount:P}=Gr(d);v&&a(d,{tokenId:v,amount:P,receiver:l.getReceiver().bech32()}),u.push({transaction:l,transactionIndex:g,multiTxData:d})}}),i(u)}}return(0,G.useEffect)(()=>{p()},[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 Bi=Object.create;var Ee=Object.defineProperty,Ui=Object.defineProperties,Vi=Object.getOwnPropertyDescriptor,Gi=Object.getOwnPropertyDescriptors,$i=Object.getOwnPropertyNames,Ge=Object.getOwnPropertySymbols,Wi=Object.getPrototypeOf,Ot=Object.prototype.hasOwnProperty,Yr=Object.prototype.propertyIsEnumerable;var Kr=(e,t,r)=>t in e?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,x=(e,t)=>{for(var r in t||(t={}))Ot.call(t,r)&&Kr(e,r,t[r]);if(Ge)for(var r of Ge(t))Yr.call(t,r)&&Kr(e,r,t[r]);return e},b=(e,t)=>Ui(e,Gi(t));var Ft=(e,t)=>{var r={};for(var o in e)Ot.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&Ge)for(var o of Ge(e))t.indexOf(o)<0&&Yr.call(e,o)&&(r[o]=e[o]);return r};var y=(e,t)=>()=>(e&&(t=e(e=0)),t);var $e=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),se=(e,t)=>{for(var r in t)Ee(e,r,{get:t[r],enumerable:!0})},Xr=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of $i(t))!Ot.call(e,i)&&i!==r&&Ee(e,i,{get:()=>t[i],enumerable:!(o=Vi(t,i))||o.enumerable});return e};var A=(e,t,r)=>(r=e!=null?Bi(Wi(e)):{},Xr(t||!e||!e.__esModule?Ee(r,"default",{value:e,enumerable:!0}):r,e)),ke=e=>Xr(Ee({},"__esModule",{value:!0}),e);var G=(e,t,r)=>new Promise((o,i)=>{var l=d=>{try{m(r.next(d))}catch(g){i(g)}},p=d=>{try{m(r.throw(d))}catch(g){i(g)}},m=d=>d.done?o(d.value):Promise.resolve(d.value).then(l,p);m((r=r.apply(e,t)).next())});var Jr=$e(We=>{"use strict";n();We.byteLength=qi;We.toByteArray=zi;We.fromByteArray=Xi;var $=[],O=[],Hi=typeof Uint8Array!="undefined"?Uint8Array:Array,Bt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ce=0,Zr=Bt.length;ce<Zr;++ce)$[ce]=Bt[ce],O[Bt.charCodeAt(ce)]=ce;var ce,Zr;O["-".charCodeAt(0)]=62;O["_".charCodeAt(0)]=63;function Qr(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var o=r===t?0:4-r%4;return[r,o]}function qi(e){var t=Qr(e),r=t[0],o=t[1];return(r+o)*3/4-o}function ji(e,t,r){return(t+r)*3/4-r}function zi(e){var t,r=Qr(e),o=r[0],i=r[1],l=new Hi(ji(e,o,i)),p=0,m=i>0?o-4:o,d;for(d=0;d<m;d+=4)t=O[e.charCodeAt(d)]<<18|O[e.charCodeAt(d+1)]<<12|O[e.charCodeAt(d+2)]<<6|O[e.charCodeAt(d+3)],l[p++]=t>>16&255,l[p++]=t>>8&255,l[p++]=t&255;return i===2&&(t=O[e.charCodeAt(d)]<<2|O[e.charCodeAt(d+1)]>>4,l[p++]=t&255),i===1&&(t=O[e.charCodeAt(d)]<<10|O[e.charCodeAt(d+1)]<<4|O[e.charCodeAt(d+2)]>>2,l[p++]=t>>8&255,l[p++]=t&255),l}function Ki(e){return $[e>>18&63]+$[e>>12&63]+$[e>>6&63]+$[e&63]}function Yi(e,t,r){for(var o,i=[],l=t;l<r;l+=3)o=(e[l]<<16&16711680)+(e[l+1]<<8&65280)+(e[l+2]&255),i.push(Ki(o));return i.join("")}function Xi(e){for(var t,r=e.length,o=r%3,i=[],l=16383,p=0,m=r-o;p<m;p+=l)i.push(Yi(e,p,p+l>m?m:p+l));return o===1?(t=e[r-1],i.push($[t>>2]+$[t<<4&63]+"==")):o===2&&(t=(e[r-2]<<8)+e[r-1],i.push($[t>>10]+$[t>>4&63]+$[t<<2&63]+"=")),i.join("")}});var en=$e(Ut=>{n();Ut.read=function(e,t,r,o,i){var l,p,m=i*8-o-1,d=(1<<m)-1,g=d>>1,h=-7,T=r?i-1:0,w=r?-1:1,S=e[t+T];for(T+=w,l=S&(1<<-h)-1,S>>=-h,h+=m;h>0;l=l*256+e[t+T],T+=w,h-=8);for(p=l&(1<<-h)-1,l>>=-h,h+=o;h>0;p=p*256+e[t+T],T+=w,h-=8);if(l===0)l=1-g;else{if(l===d)return p?NaN:(S?-1:1)*(1/0);p=p+Math.pow(2,o),l=l-g}return(S?-1:1)*p*Math.pow(2,l-o)};Ut.write=function(e,t,r,o,i,l){var p,m,d,g=l*8-i-1,h=(1<<g)-1,T=h>>1,w=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=o?0:l-1,E=o?1:-1,V=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(m=isNaN(t)?1:0,p=h):(p=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-p))<1&&(p--,d*=2),p+T>=1?t+=w/d:t+=w*Math.pow(2,1-T),t*d>=2&&(p++,d/=2),p+T>=h?(m=0,p=h):p+T>=1?(m=(t*d-1)*Math.pow(2,i),p=p+T):(m=t*Math.pow(2,T-1)*Math.pow(2,i),p=0));i>=8;e[r+S]=m&255,S+=E,m/=256,i-=8);for(p=p<<i|m,g+=i;g>0;e[r+S]=p&255,S+=E,p/=256,g-=8);e[r+S-E]|=V*128}});var gn=$e(ye=>{"use strict";n();var Vt=Jr(),Te=en(),tn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ye.Buffer=u;ye.SlowBuffer=ra;ye.INSPECT_MAX_BYTES=50;var He=2147483647;ye.kMaxLength=He;u.TYPED_ARRAY_SUPPORT=Zi();!u.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Zi(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch(r){return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.buffer}});Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.byteOffset}});function X(e){if(e>He)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Ht(e)}return on(e,t,r)}u.poolSize=8192;function on(e,t,r){if(typeof e=="string")return Ji(e,t);if(ArrayBuffer.isView(e))return ea(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(W(e,ArrayBuffer)||e&&W(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(W(e,SharedArrayBuffer)||e&&W(e.buffer,SharedArrayBuffer)))return $t(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var o=e.valueOf&&e.valueOf();if(o!=null&&o!==e)return u.from(o,t,r);var i=ta(e);if(i)return i;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}u.from=function(e,t,r){return on(e,t,r)};Object.setPrototypeOf(u.prototype,Uint8Array.prototype);Object.setPrototypeOf(u,Uint8Array);function an(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function Qi(e,t,r){return an(e),e<=0?X(e):t!==void 0?typeof r=="string"?X(e).fill(t,r):X(e).fill(t):X(e)}u.alloc=function(e,t,r){return Qi(e,t,r)};function Ht(e){return an(e),X(e<0?0:qt(e)|0)}u.allocUnsafe=function(e){return Ht(e)};u.allocUnsafeSlow=function(e){return Ht(e)};function Ji(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=sn(e,t)|0,o=X(r),i=o.write(e,t);return i!==r&&(o=o.slice(0,i)),o}function Gt(e){for(var t=e.length<0?0:qt(e.length)|0,r=X(t),o=0;o<t;o+=1)r[o]=e[o]&255;return r}function ea(e){if(W(e,Uint8Array)){var t=new Uint8Array(e);return $t(t.buffer,t.byteOffset,t.byteLength)}return Gt(e)}function $t(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var o;return t===void 0&&r===void 0?o=new Uint8Array(e):r===void 0?o=new Uint8Array(e,t):o=new Uint8Array(e,t,r),Object.setPrototypeOf(o,u.prototype),o}function ta(e){if(u.isBuffer(e)){var t=qt(e.length)|0,r=X(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||jt(e.length)?X(0):Gt(e);if(e.type==="Buffer"&&Array.isArray(e.data))return Gt(e.data)}function qt(e){if(e>=He)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+He.toString(16)+" bytes");return e|0}function ra(e){return+e!=e&&(e=0),u.alloc(+e)}u.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==u.prototype};u.compare=function(t,r){if(W(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),W(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),!u.isBuffer(t)||!u.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;for(var o=t.length,i=r.length,l=0,p=Math.min(o,i);l<p;++l)if(t[l]!==r[l]){o=t[l],i=r[l];break}return o<i?-1:i<o?1:0};u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};u.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return u.alloc(0);var o;if(r===void 0)for(r=0,o=0;o<t.length;++o)r+=t[o].length;var i=u.allocUnsafe(r),l=0;for(o=0;o<t.length;++o){var p=t[o];if(W(p,Uint8Array))l+p.length>i.length?u.from(p).copy(i,l):Uint8Array.prototype.set.call(i,p,l);else if(u.isBuffer(p))p.copy(i,l);else throw new TypeError('"list" argument must be an Array of Buffers');l+=p.length}return i};function sn(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||W(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,o=arguments.length>2&&arguments[2]===!0;if(!o&&r===0)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Wt(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return mn(e).length;default:if(i)return o?-1:Wt(e).length;t=(""+t).toLowerCase(),i=!0}}u.byteLength=sn;function na(e,t,r){var o=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return ma(this,t,r);case"utf8":case"utf-8":return ln(this,t,r);case"ascii":return ua(this,t,r);case"latin1":case"binary":return da(this,t,r);case"base64":return la(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ga(this,t,r);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}u.prototype._isBuffer=!0;function le(e,t,r){var o=e[t];e[t]=e[r],e[r]=o}u.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)le(this,r,r+1);return this};u.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)le(this,r,r+3),le(this,r+1,r+2);return this};u.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)le(this,r,r+7),le(this,r+1,r+6),le(this,r+2,r+5),le(this,r+3,r+4);return this};u.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?ln(this,0,t):na.apply(this,arguments)};u.prototype.toLocaleString=u.prototype.toString;u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:u.compare(this,t)===0};u.prototype.inspect=function(){var t="",r=ye.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};tn&&(u.prototype[tn]=u.prototype.inspect);u.prototype.compare=function(t,r,o,i,l){if(W(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(r===void 0&&(r=0),o===void 0&&(o=t?t.length:0),i===void 0&&(i=0),l===void 0&&(l=this.length),r<0||o>t.length||i<0||l>this.length)throw new RangeError("out of range index");if(i>=l&&r>=o)return 0;if(i>=l)return-1;if(r>=o)return 1;if(r>>>=0,o>>>=0,i>>>=0,l>>>=0,this===t)return 0;for(var p=l-i,m=o-r,d=Math.min(p,m),g=this.slice(i,l),h=t.slice(r,o),T=0;T<d;++T)if(g[T]!==h[T]){p=g[T],m=h[T];break}return p<m?-1:m<p?1:0};function cn(e,t,r,o,i){if(e.length===0)return-1;if(typeof r=="string"?(o=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,jt(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=u.from(t,o)),u.isBuffer(t))return t.length===0?-1:rn(e,t,r,o,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):rn(e,[t],r,o,i);throw new TypeError("val must be string, number or Buffer")}function rn(e,t,r,o,i){var l=1,p=e.length,m=t.length;if(o!==void 0&&(o=String(o).toLowerCase(),o==="ucs2"||o==="ucs-2"||o==="utf16le"||o==="utf-16le")){if(e.length<2||t.length<2)return-1;l=2,p/=2,m/=2,r/=2}function d(S,E){return l===1?S[E]:S.readUInt16BE(E*l)}var g;if(i){var h=-1;for(g=r;g<p;g++)if(d(e,g)===d(t,h===-1?0:g-h)){if(h===-1&&(h=g),g-h+1===m)return h*l}else h!==-1&&(g-=g-h),h=-1}else for(r+m>p&&(r=p-m),g=r;g>=0;g--){for(var T=!0,w=0;w<m;w++)if(d(e,g+w)!==d(t,w)){T=!1;break}if(T)return g}return-1}u.prototype.includes=function(t,r,o){return this.indexOf(t,r,o)!==-1};u.prototype.indexOf=function(t,r,o){return cn(this,t,r,o,!0)};u.prototype.lastIndexOf=function(t,r,o){return cn(this,t,r,o,!1)};function oa(e,t,r,o){r=Number(r)||0;var i=e.length-r;o?(o=Number(o),o>i&&(o=i)):o=i;var l=t.length;o>l/2&&(o=l/2);for(var p=0;p<o;++p){var m=parseInt(t.substr(p*2,2),16);if(jt(m))return p;e[r+p]=m}return p}function ia(e,t,r,o){return qe(Wt(t,e.length-r),e,r,o)}function aa(e,t,r,o){return qe(ya(t),e,r,o)}function sa(e,t,r,o){return qe(mn(t),e,r,o)}function ca(e,t,r,o){return qe(ha(t,e.length-r),e,r,o)}u.prototype.write=function(t,r,o,i){if(r===void 0)i="utf8",o=this.length,r=0;else if(o===void 0&&typeof r=="string")i=r,o=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(o)?(o=o>>>0,i===void 0&&(i="utf8")):(i=o,o=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var l=this.length-r;if((o===void 0||o>l)&&(o=l),t.length>0&&(o<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var p=!1;;)switch(i){case"hex":return oa(this,t,r,o);case"utf8":case"utf-8":return ia(this,t,r,o);case"ascii":case"latin1":case"binary":return aa(this,t,r,o);case"base64":return sa(this,t,r,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ca(this,t,r,o);default:if(p)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),p=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function la(e,t,r){return t===0&&r===e.length?Vt.fromByteArray(e):Vt.fromByteArray(e.slice(t,r))}function ln(e,t,r){r=Math.min(e.length,r);for(var o=[],i=t;i<r;){var l=e[i],p=null,m=l>239?4:l>223?3:l>191?2:1;if(i+m<=r){var d,g,h,T;switch(m){case 1:l<128&&(p=l);break;case 2:d=e[i+1],(d&192)===128&&(T=(l&31)<<6|d&63,T>127&&(p=T));break;case 3:d=e[i+1],g=e[i+2],(d&192)===128&&(g&192)===128&&(T=(l&15)<<12|(d&63)<<6|g&63,T>2047&&(T<55296||T>57343)&&(p=T));break;case 4:d=e[i+1],g=e[i+2],h=e[i+3],(d&192)===128&&(g&192)===128&&(h&192)===128&&(T=(l&15)<<18|(d&63)<<12|(g&63)<<6|h&63,T>65535&&T<1114112&&(p=T))}}p===null?(p=65533,m=1):p>65535&&(p-=65536,o.push(p>>>10&1023|55296),p=56320|p&1023),o.push(p),i+=m}return pa(o)}var nn=4096;function pa(e){var t=e.length;if(t<=nn)return String.fromCharCode.apply(String,e);for(var r="",o=0;o<t;)r+=String.fromCharCode.apply(String,e.slice(o,o+=nn));return r}function ua(e,t,r){var o="";r=Math.min(e.length,r);for(var i=t;i<r;++i)o+=String.fromCharCode(e[i]&127);return o}function da(e,t,r){var o="";r=Math.min(e.length,r);for(var i=t;i<r;++i)o+=String.fromCharCode(e[i]);return o}function ma(e,t,r){var o=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>o)&&(r=o);for(var i="",l=t;l<r;++l)i+=xa[e[l]];return i}function ga(e,t,r){for(var o=e.slice(t,r),i="",l=0;l<o.length-1;l+=2)i+=String.fromCharCode(o[l]+o[l+1]*256);return i}u.prototype.slice=function(t,r){var o=this.length;t=~~t,r=r===void 0?o:~~r,t<0?(t+=o,t<0&&(t=0)):t>o&&(t=o),r<0?(r+=o,r<0&&(r=0)):r>o&&(r=o),r<t&&(r=t);var i=this.subarray(t,r);return Object.setPrototypeOf(i,u.prototype),i};function L(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(t,r,o){t=t>>>0,r=r>>>0,o||L(t,r,this.length);for(var i=this[t],l=1,p=0;++p<r&&(l*=256);)i+=this[t+p]*l;return i};u.prototype.readUintBE=u.prototype.readUIntBE=function(t,r,o){t=t>>>0,r=r>>>0,o||L(t,r,this.length);for(var i=this[t+--r],l=1;r>0&&(l*=256);)i+=this[t+--r]*l;return i};u.prototype.readUint8=u.prototype.readUInt8=function(t,r){return t=t>>>0,r||L(t,1,this.length),this[t]};u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||L(t,2,this.length),this[t]|this[t+1]<<8};u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||L(t,2,this.length),this[t]<<8|this[t+1]};u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||L(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};u.prototype.readIntLE=function(t,r,o){t=t>>>0,r=r>>>0,o||L(t,r,this.length);for(var i=this[t],l=1,p=0;++p<r&&(l*=256);)i+=this[t+p]*l;return l*=128,i>=l&&(i-=Math.pow(2,8*r)),i};u.prototype.readIntBE=function(t,r,o){t=t>>>0,r=r>>>0,o||L(t,r,this.length);for(var i=r,l=1,p=this[t+--i];i>0&&(l*=256);)p+=this[t+--i]*l;return l*=128,p>=l&&(p-=Math.pow(2,8*r)),p};u.prototype.readInt8=function(t,r){return t=t>>>0,r||L(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};u.prototype.readInt16LE=function(t,r){t=t>>>0,r||L(t,2,this.length);var o=this[t]|this[t+1]<<8;return o&32768?o|4294901760:o};u.prototype.readInt16BE=function(t,r){t=t>>>0,r||L(t,2,this.length);var o=this[t+1]|this[t]<<8;return o&32768?o|4294901760:o};u.prototype.readInt32LE=function(t,r){return t=t>>>0,r||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};u.prototype.readInt32BE=function(t,r){return t=t>>>0,r||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};u.prototype.readFloatLE=function(t,r){return t=t>>>0,r||L(t,4,this.length),Te.read(this,t,!0,23,4)};u.prototype.readFloatBE=function(t,r){return t=t>>>0,r||L(t,4,this.length),Te.read(this,t,!1,23,4)};u.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||L(t,8,this.length),Te.read(this,t,!0,52,8)};u.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||L(t,8,this.length),Te.read(this,t,!1,52,8)};function C(e,t,r,o,i,l){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<l)throw new RangeError('"value" argument is out of bounds');if(r+o>e.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,r,o,i){if(t=+t,r=r>>>0,o=o>>>0,!i){var l=Math.pow(2,8*o)-1;C(this,t,r,o,l,0)}var p=1,m=0;for(this[r]=t&255;++m<o&&(p*=256);)this[r+m]=t/p&255;return r+o};u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,r,o,i){if(t=+t,r=r>>>0,o=o>>>0,!i){var l=Math.pow(2,8*o)-1;C(this,t,r,o,l,0)}var p=o-1,m=1;for(this[r+p]=t&255;--p>=0&&(m*=256);)this[r+p]=t/m&255;return r+o};u.prototype.writeUint8=u.prototype.writeUInt8=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,1,255,0),this[r]=t&255,r+1};u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2};u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2};u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4};u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};u.prototype.writeIntLE=function(t,r,o,i){if(t=+t,r=r>>>0,!i){var l=Math.pow(2,8*o-1);C(this,t,r,o,l-1,-l)}var p=0,m=1,d=0;for(this[r]=t&255;++p<o&&(m*=256);)t<0&&d===0&&this[r+p-1]!==0&&(d=1),this[r+p]=(t/m>>0)-d&255;return r+o};u.prototype.writeIntBE=function(t,r,o,i){if(t=+t,r=r>>>0,!i){var l=Math.pow(2,8*o-1);C(this,t,r,o,l-1,-l)}var p=o-1,m=1,d=0;for(this[r+p]=t&255;--p>=0&&(m*=256);)t<0&&d===0&&this[r+p+1]!==0&&(d=1),this[r+p]=(t/m>>0)-d&255;return r+o};u.prototype.writeInt8=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};u.prototype.writeInt16LE=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};u.prototype.writeInt16BE=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};u.prototype.writeInt32LE=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4};u.prototype.writeInt32BE=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};function pn(e,t,r,o,i,l){if(r+o>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function un(e,t,r,o,i){return t=+t,r=r>>>0,i||pn(e,t,r,4,34028234663852886e22,-34028234663852886e22),Te.write(e,t,r,o,23,4),r+4}u.prototype.writeFloatLE=function(t,r,o){return un(this,t,r,!0,o)};u.prototype.writeFloatBE=function(t,r,o){return un(this,t,r,!1,o)};function dn(e,t,r,o,i){return t=+t,r=r>>>0,i||pn(e,t,r,8,17976931348623157e292,-17976931348623157e292),Te.write(e,t,r,o,52,8),r+8}u.prototype.writeDoubleLE=function(t,r,o){return dn(this,t,r,!0,o)};u.prototype.writeDoubleBE=function(t,r,o){return dn(this,t,r,!1,o)};u.prototype.copy=function(t,r,o,i){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(o||(o=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<o&&(i=o),i===o||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(o<0||o>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r<i-o&&(i=t.length-r+o);var l=i-o;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,o,i):Uint8Array.prototype.set.call(t,this.subarray(o,i),r),l};u.prototype.fill=function(t,r,o,i){if(typeof t=="string"){if(typeof r=="string"?(i=r,r=0,o=this.length):typeof o=="string"&&(i=o,o=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){var l=t.charCodeAt(0);(i==="utf8"&&l<128||i==="latin1")&&(t=l)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<o)throw new RangeError("Out of range index");if(o<=r)return this;r=r>>>0,o=o===void 0?this.length:o>>>0,t||(t=0);var p;if(typeof t=="number")for(p=r;p<o;++p)this[p]=t;else{var m=u.isBuffer(t)?t:u.from(t,i),d=m.length;if(d===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(p=0;p<o-r;++p)this[p+r]=m[p%d]}return this};var fa=/[^+/0-9A-Za-z-_]/g;function Ta(e){if(e=e.split("=")[0],e=e.trim().replace(fa,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Wt(e,t){t=t||1/0;for(var r,o=e.length,i=null,l=[],p=0;p<o;++p){if(r=e.charCodeAt(p),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&l.push(239,191,189);continue}else if(p+1===o){(t-=3)>-1&&l.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&l.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&l.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;l.push(r)}else if(r<2048){if((t-=2)<0)break;l.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;l.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;l.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return l}function ya(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function ha(e,t){for(var r,o,i,l=[],p=0;p<e.length&&!((t-=2)<0);++p)r=e.charCodeAt(p),o=r>>8,i=r%256,l.push(i),l.push(o);return l}function mn(e){return Vt.toByteArray(Ta(e))}function qe(e,t,r,o){for(var i=0;i<o&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function W(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function jt(e){return e!==e}var xa=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var o=r*16,i=0;i<16;++i)t[o+i]=e[r]+e[i];return t}()});var xn=$e((Ec,hn)=>{n();var k=hn.exports={},H,q;function zt(){throw new Error("setTimeout has not been defined")}function Kt(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?H=setTimeout:H=zt}catch(e){H=zt}try{typeof clearTimeout=="function"?q=clearTimeout:q=Kt}catch(e){q=Kt}})();function fn(e){if(H===setTimeout)return setTimeout(e,0);if((H===zt||!H)&&setTimeout)return H=setTimeout,setTimeout(e,0);try{return H(e,0)}catch(t){try{return H.call(null,e,0)}catch(r){return H.call(this,e,0)}}}function Sa(e){if(q===clearTimeout)return clearTimeout(e);if((q===Kt||!q)&&clearTimeout)return q=clearTimeout,clearTimeout(e);try{return q(e)}catch(t){try{return q.call(null,e)}catch(r){return q.call(this,e)}}}var Z=[],he=!1,pe,je=-1;function wa(){!he||!pe||(he=!1,pe.length?Z=pe.concat(Z):je=-1,Z.length&&Tn())}function Tn(){if(!he){var e=fn(wa);he=!0;for(var t=Z.length;t;){for(pe=Z,Z=[];++je<t;)pe&&pe[je].run();je=-1,t=Z.length}pe=null,he=!1,Sa(e)}}k.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];Z.push(new yn(e,t)),Z.length===1&&!he&&fn(Tn)};function yn(e,t){this.fun=e,this.array=t}yn.prototype.run=function(){this.fun.apply(null,this.array)};k.title="browser";k.browser=!0;k.env={};k.argv=[];k.version="";k.versions={};function Q(){}k.on=Q;k.addListener=Q;k.once=Q;k.off=Q;k.removeListener=Q;k.removeAllListeners=Q;k.emit=Q;k.prependListener=Q;k.prependOnceListener=Q;k.listeners=function(e){return[]};k.binding=function(e){throw new Error("process.binding is not supported")};k.cwd=function(){return"/"};k.chdir=function(e){throw new Error("process.chdir is not supported")};k.umask=function(){return 0}});var a,s,kc,n=y(()=>{a=A(gn()),s=A(xn()),kc=function(e){function t(){var o=this||self;return delete e.prototype.__magic__,o}if(typeof globalThis=="object")return globalThis;if(this)return t();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:t});var r=__magic__;return r}(Object)});var j=y(()=>{"use strict";n()});var In=y(()=>{"use strict";n()});var vn=y(()=>{"use strict";n()});var An=y(()=>{"use strict";n()});var bn=y(()=>{"use strict";n()});var En=y(()=>{"use strict";n()});var P=y(()=>{"use strict";n()});var kn=y(()=>{"use strict";n()});var Dn=y(()=>{"use strict";n()});var Nn=y(()=>{"use strict";n()});var F=y(()=>{"use strict";n();In();vn();An();j();bn();En();P();kn();Dn();Nn()});var tr,rr=y(()=>{"use strict";n();tr={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."}}});function Mn(e){let t=null;if((e==null?void 0:e.statusCode)in tr){let r=e==null?void 0:e.statusCode,{message:o}=tr[r];t=Ea.includes(r)?_n:o}return{errorMessage:t,defaultErrorMessage:_n}}var _n,Aa,ba,Ea,nr=y(()=>{"use strict";n();rr();_n="Check if the MultiversX app is open on Ledger",Aa=28161,ba=28160,Ea=[Aa,ba]});var Fn=y(()=>{"use strict";n()});var xe,Bn,gl,Un,fl,Vn,Tl,yl,ka,Le=y(()=>{"use strict";n();F();xe={devnet:{id:"devnet",chainId:"D",name:"Devnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://xportal.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://devnet-wallet.multiversx.com",apiAddress:"https://devnet-api.multiversx.com",explorerAddress:"http://devnet-explorer.multiversx.com",apiTimeout:"4000"},testnet:{id:"testnet",chainId:"T",name:"Testnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://xportal.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://testnet-wallet.multiversx.com",apiAddress:"https://testnet-api.multiversx.com",explorerAddress:"http://testnet-explorer.multiversx.com",apiTimeout:"4000"},mainnet:{id:"mainnet",chainId:"1",name:"Mainnet",egldLabel:"EGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://xportal.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://wallet.multiversx.com",apiAddress:"https://api.multiversx.com",explorerAddress:"https://explorer.multiversx.com",apiTimeout:"4000"}},{chainId:Bn,egldLabel:gl}=xe["devnet"],{chainId:Un,egldLabel:fl}=xe["testnet"],{chainId:Vn,egldLabel:Tl}=xe["mainnet"],yl={["devnet"]:Bn,["testnet"]:Un,["mainnet"]:Vn},ka={[Bn]:"devnet",[Un]:"testnet",[Vn]:"mainnet"}});var Gn=y(()=>{"use strict";n()});var $n,or=y(()=>{"use strict";n();$n="transaction-status-toast-id"});var z,Wn=y(()=>{"use strict";n();z=require("@multiversx/sdk-web-wallet-provider")});var Hn=y(()=>{"use strict";n()});var qn=y(()=>{"use strict";n()});var ir,ar,jn,Ke,zn,Se,I=y(()=>{"use strict";n();Fn();Le();rr();Gn();or();Wn();Hn();qn();ir=5e4,ar=1e9,jn=1,Ke="logout",zn="login",Se="0"});var Ye,sr=y(()=>{"use strict";n();Ye=()=>Date.now()/1e3});var Kn=y(()=>{"use strict";n()});var Yn=y(()=>{"use strict";n()});var Xn=y(()=>{"use strict";n();sr();Kn();Yn()});var lr={};se(lr,{getItem:()=>Na,localStorageKeys:()=>ue,removeItem:()=>La,setItem:()=>Da});var ue,cr,Da,Na,La,Re=y(()=>{"use strict";n();Xn();ue={loginExpiresAt:"sdk-dapp-login-expires-at",logoutEvent:"sdk-dapp-logout-event"},cr=typeof localStorage!="undefined",Da=({key:e,data:t,expires:r})=>{!cr||localStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Na=e=>{if(!cr)return;let t=localStorage.getItem(String(e));if(!t)return null;let r=JSON.parse(t);return!r||!r.hasOwnProperty("expires")||!r.hasOwnProperty("data")?null:Ye()>=r.expires?(localStorage.removeItem(String(e)),null):r.data},La=e=>{!cr||localStorage.removeItem(String(e))}});var pr={};se(pr,{clear:()=>eo,getItem:()=>Qn,removeItem:()=>Jn,setItem:()=>Zn,storage:()=>Ra});var Zn,Qn,Jn,eo,Ra,to=y(()=>{"use strict";n();Zn=({key:e,data:t,expires:r})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Qn=e=>{let t=sessionStorage.getItem(String(e));if(!t)return null;let r=JSON.parse(t);return!r||!r.hasOwnProperty("expires")||!r.hasOwnProperty("data")?null:Date.now()>=r.expires?(sessionStorage.removeItem(String(e)),null):r.data},Jn=e=>sessionStorage.removeItem(String(e)),eo=()=>sessionStorage.clear(),Ra={setItem:Zn,getItem:Qn,removeItem:Jn,clear:eo}});var we,Xe=y(()=>{"use strict";n();Re();to();we={session:pr,local:lr}});var ur,D,Ze,U=y(()=>{"use strict";n();ur=require("@reduxjs/toolkit");I();D=(0,ur.createAction)(Ke),Ze=(0,ur.createAction)(zn,e=>({payload:e}))});var mr,ro,no,Qe,dr,oo,io,Xl,ao,Zl,Ql,Jl,ep,tp,rp,np,op,Je,et=y(()=>{"use strict";n();mr=require("@multiversx/sdk-core"),ro=require("@reduxjs/toolkit"),no=require("redux-persist");I();Xe();Re();U();Qe={balance:"...",address:"",isGuarded:!1,nonce:0,txCount:0,scrCount:0,claimableRewards:Se},dr={address:"",websocketEvent:null,websocketBatchEvent:null,accounts:{"":Qe},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},oo=(0,ro.createSlice)({name:"accountInfoSlice",initialState:dr,reducers:{setAddress:(e,t)=>{let r=t.payload;e.address=r,e.publicKey=new mr.Address(r).hex()},setAccount:(e,t)=>{let r=e.address===t.payload.address;e.accounts={[e.address]:r?t.payload:Qe},e.shard=t.payload.shard,e.isAccountLoading=!1,e.accountLoadingError=null},setAccountNonce:(e,t)=>{let{address:r}=e;e.accounts[r].nonce=t.payload},setAccountShard:(e,t)=>{e.shard=t.payload},setLedgerAccount:(e,t)=>{e.ledgerAccount=t.payload},updateLedgerAccount:(e,t)=>{e.ledgerAccount!=null&&(e.ledgerAccount.index=t.payload.index,e.ledgerAccount.address=t.payload.address)},setWalletConnectAccount:(e,t)=>{e.walletConnectAccount=t.payload},setIsAccountLoading:(e,t)=>{e.isAccountLoading=t.payload,e.accountLoadingError=null},setAccountLoadingError:(e,t)=>{e.accountLoadingError=t.payload,e.isAccountLoading=!1},setWebsocketEvent:(e,t)=>{e.websocketEvent={timestamp:Date.now(),message:t.payload}},setWebsocketBatchEvent:(e,t)=>{e.websocketBatchEvent={timestamp:Date.now(),data:t.payload}}},extraReducers:e=>{e.addCase(D,()=>(we.local.removeItem(ue.loginExpiresAt),dr)),e.addCase(Ze,(t,r)=>{let{address:o}=r.payload;t.address=o,t.publicKey=new mr.Address(o).hex()}),e.addCase(no.REHYDRATE,(t,r)=>{var g;if(!((g=r.payload)!=null&&g.account))return;let{account:o}=r.payload,{address:i,shard:l,accounts:p,publicKey:m}=o;t.address=i,t.shard=l;let d=p&&i in p;t.accounts=d?p:dr.accounts,t.publicKey=m})}}),{setAccount:io,setAddress:Xl,setAccountNonce:ao,setAccountShard:Zl,setLedgerAccount:Ql,updateLedgerAccount:Jl,setWalletConnectAccount:ep,setIsAccountLoading:tp,setAccountLoadingError:rp,setWebsocketEvent:np,setWebsocketBatchEvent:op}=oo.actions,Je=oo.reducer});function Ce(){return new Date().setHours(new Date().getHours()+24)}function Pe(e){we.local.setItem({key:ue.loginExpiresAt,data:e,expires:e})}var gr=y(()=>{"use strict";n();Xe();Re()});var lo,so,po,gp,fp,Tp,yp,hp,xp,uo,Sp,tt,rt=y(()=>{"use strict";n();lo=require("@reduxjs/toolkit");gr();j();U();so={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,operaLogin:null,isLoginSessionInvalid:!1},po=(0,lo.createSlice)({name:"loginInfoSlice",initialState:so,reducers:{setLoginMethod:(e,t)=>{e.loginMethod=t.payload},setTokenLogin:(e,t)=>{e.tokenLogin=t.payload},setTokenLoginSignature:(e,t)=>{(e==null?void 0:e.tokenLogin)!=null&&(e.tokenLogin.signature=t.payload)},setWalletLogin:(e,t)=>{e.walletLogin=t.payload},setWalletConnectLogin:(e,t)=>{e.walletConnectLogin=t.payload},setLedgerLogin:(e,t)=>{e.ledgerLogin=t.payload},invalidateLoginSession:e=>{e.isLoginSessionInvalid=!0},setLogoutRoute:(e,t)=>{e.logoutRoute=t.payload}},extraReducers:e=>{e.addCase(D,()=>so),e.addCase(Ze,(t,r)=>{t.loginMethod=r.payload.loginMethod,Pe(Ce())})}}),{setLoginMethod:gp,setWalletConnectLogin:fp,setLedgerLogin:Tp,setTokenLogin:yp,setTokenLoginSignature:hp,setWalletLogin:xp,invalidateLoginSession:uo,setLogoutRoute:Sp}=po.actions,tt=po.reducer});var go,mo,fo,Ap,bp,Ep,kp,nt,ot=y(()=>{"use strict";n();go=require("@reduxjs/toolkit");U();mo={},fo=(0,go.createSlice)({name:"modalsSlice",initialState:mo,reducers:{setTxSubmittedModal:(e,t)=>{e.txSubmittedModal=t.payload},setNotificationModal:(e,t)=>{e.notificationModal=t.payload},clearTxSubmittedModal:e=>{e.txSubmittedModal=void 0},clearNotificationModal:e=>{e.notificationModal=void 0}},extraReducers:e=>{e.addCase(D,()=>mo)}}),{setTxSubmittedModal:Ap,setNotificationModal:bp,clearTxSubmittedModal:Ep,clearNotificationModal:kp}=fo.actions,nt=fo.reducer});var To=y(()=>{"use strict";n()});var yo=y(()=>{"use strict";n();To()});function fr(e){return e[Math.floor(Math.random()*e.length)]}var ho=y(()=>{"use strict";n()});var xo=y(()=>{"use strict";n();yo();ho();nr()});var So,wo,Tr,Ca,Io,Vp,Gp,it,at=y(()=>{"use strict";n();So=require("@reduxjs/toolkit"),wo=A(require("lodash.omit"));xo();Tr={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletConnectV2Options:{},walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},Ca={network:Tr,chainID:"-1"},Io=(0,So.createSlice)({name:"appConfig",initialState:Ca,reducers:{initializeNetworkConfig:(e,t)=>{let r=fr(t.payload.walletConnectBridgeAddresses),o=fr(t.payload.walletConnectV2RelayAddresses),i=(0,wo.default)(t.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=b(x(x({},e.network),i),{walletConnectBridgeAddress:r,walletConnectV2RelayAddress:o})},setChainID:(e,t)=>{e.chainID=t.payload}}}),{initializeNetworkConfig:Vp,setChainID:Gp}=Io.actions,it=Io.reducer});var vo,yr,Ao,zp,Kp,Yp,st,ct=y(()=>{"use strict";n();vo=require("@reduxjs/toolkit");F();U();yr={isSigning:!1,signedSessions:{}},Ao=(0,vo.createSlice)({name:"signedMessageInfoSliceState",initialState:yr,reducers:{setSignSession:(e,t)=>{let{sessionId:r,signedSession:o,errorMessage:i}=t.payload;i&&(e.errorMessage=i),e.isSigning=o.status==="pending",e.signedSessions[r]=o},setSignSessionState:(e,t)=>x(x({},e),t.payload),clearSignedMessageInfo:()=>yr},extraReducers:e=>{e.addCase(D,()=>yr)}}),{setSignSession:zp,clearSignedMessageInfo:Kp,setSignSessionState:Yp}=Ao.actions,st=Ao.reducer});var Eo,ko,bo,Do,nu,ou,iu,au,su,cu,lt,pt=y(()=>{"use strict";n();Eo=require("@reduxjs/toolkit"),ko=require("redux-persist");or();F();sr();U();bo={customToasts:[],transactionToasts:[],failTransactionToast:null},Do=(0,Eo.createSlice)({name:"toastsSlice",initialState:bo,reducers:{addCustomToast:(e,t)=>{e.customToasts.push(b(x({},t.payload),{type:"custom",toastId:t.payload.toastId||`custom-toast-${e.customToasts.length+1}`}))},removeCustomToast:(e,t)=>{e.customToasts=e.customToasts.filter(r=>r.toastId!==t.payload)},addTransactionToast:(e,t)=>{e.transactionToasts.push({type:"transaction",startTimestamp:Ye(),toastId:t.payload||`custom-toast-${e.transactionToasts.length+1}`})},removeTransactionToast:(e,t)=>{e.transactionToasts=e.transactionToasts.filter(r=>r.toastId!==t.payload)},addFailTransactionToast:(e,t)=>{e.failTransactionToast=b(x({},t.payload),{toastId:$n})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(D,()=>bo),e.addCase(ko.REHYDRATE,(t,r)=>{var i,l;let o=(l=(i=r.customToasts)==null?void 0:i.filter(p=>!("component"in p)))!=null?l:[];t.customToasts=o})}}),{addCustomToast:nu,removeCustomToast:ou,addTransactionToast:iu,removeTransactionToast:au,addFailTransactionToast:su,removeFailTransactionToast:cu}=Do.actions,lt=Do.reducer});var No,xr,Sr,wr,Pa,hr,Lo,du,mu,gu,ut,dt=y(()=>{"use strict";n();No=require("@reduxjs/toolkit");U();xr="Transaction failed",Sr="Transaction successful",wr="Processing transaction",Pa="Transaction submitted",hr={},Lo=(0,No.createSlice)({name:"transactionsInfo",initialState:hr,reducers:{setTransactionsDisplayInfo(e,t){let{sessionId:r,transactionsDisplayInfo:o}=t.payload;r!=null&&(e[r]={errorMessage:(o==null?void 0:o.errorMessage)||xr,successMessage:(o==null?void 0:o.successMessage)||Sr,processingMessage:(o==null?void 0:o.processingMessage)||wr,submittedMessage:(o==null?void 0:o.submittedMessage)||Pa,transactionDuration:o==null?void 0:o.transactionDuration})},clearTransactionsInfoForSessionId(e,t){t.payload!=null&&delete e[t.payload]},clearTransactionsInfo:()=>hr},extraReducers:e=>{e.addCase(D,()=>hr)}}),{clearTransactionsInfo:du,setTransactionsDisplayInfo:mu,clearTransactionsInfoForSessionId:gu}=Lo.actions,ut=Lo.reducer});function Ro(e){return e!=null&&(Ha(e)||Ya(e))}function mt(e){return e!=null&&(qa(e)||Xa(e))}function gt(e){return e!=null&&(ja(e)||Za(e))}function Co(e){return e!=null&&(za(e)||Qa(e))}function Po(e){return e!=null&&Ka(e)}function Ha(e){return e!=null&&Ma.includes(e)}function qa(e){return e!=null&&Oa.includes(e)}function ja(e){return e!=null&&Fa.includes(e)}function za(e){return e!=null&&Ba.includes(e)}function Ka(e){return e!=null&&Ua.includes(e)}function Ya(e){return e!=null&&Va.includes(e)}function Xa(e){return e!=null&&Ga.includes(e)}function Za(e){return e!=null&&$a.includes(e)}function Qa(e){return e!=null&&Wa.includes(e)}var Ma,Oa,Fa,Ba,Ua,Va,Ga,$a,Wa,vr=y(()=>{"use strict";n();j();Ma=["sent"],Oa=["success"],Fa=["fail","cancelled","timedOut"],Ba=["invalid"],Ua=["timedOut"],Va=["pending"],Ga=["success"],$a=["fail","invalid"],Wa=["not executed"]});var _o,Mo,_e,Ja,Oo,vu,Au,bu,Eu,ku,Du,Nu,Lu,Ru,Cu,ft,Tt=y(()=>{"use strict";n();_o=require("@reduxjs/toolkit"),Mo=require("redux-persist");j();vr();U();_e={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},Ja={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},Oo=(0,_o.createSlice)({name:"transactionsSlice",initialState:_e,reducers:{moveTransactionsToSignedState:(e,t)=>{var g,h;let{sessionId:r,transactions:o,errorMessage:i,status:l,redirectRoute:p,customTransactionInformation:m={}}=t.payload,d=((g=e.customTransactionInformationForSessionId)==null?void 0:g[r])||Ja;e.signedTransactions[r]={transactions:o,status:l,errorMessage:i,redirectRoute:p,customTransactionInformation:x(x({},d),m)},((h=e==null?void 0:e.transactionsToSign)==null?void 0:h.sessionId)===r&&(e.transactionsToSign=_e.transactionsToSign)},clearSignedTransaction:(e,t)=>{e.signedTransactions[t.payload]&&delete e.signedTransactions[t.payload]},clearTransactionToSign:e=>{e!=null&&e.transactionsToSign&&(e.transactionsToSign=null)},updateSignedTransaction:(e,t)=>{e.signedTransactions=x(x({},e.signedTransactions),t.payload)},updateSignedTransactions:(e,t)=>{let{sessionId:r,status:o,errorMessage:i,transactions:l}=t.payload;e.signedTransactions[r]!=null&&(e.signedTransactions[r].status=o,i!=null&&(e.signedTransactions[r].errorMessage=i),l!=null&&(e.signedTransactions[r].transactions=l))},updateSignedTransactionStatus:(e,t)=>{var d,g,h,T,w,S,E,V;let{sessionId:r,status:o,errorMessage:i,transactionHash:l,inTransit:p}=t.payload,m=(g=(d=e.signedTransactions)==null?void 0:d[r])==null?void 0:g.transactions;if(m!=null){e.signedTransactions[r].transactions=m.map(M=>M.hash===l?b(x({},M),{status:o,errorMessage:i,inTransit:p}):M);let N=(T=(h=e.signedTransactions[r])==null?void 0:h.transactions)==null?void 0:T.every(M=>mt(M.status)),Ct=(S=(w=e.signedTransactions[r])==null?void 0:w.transactions)==null?void 0:S.every(M=>gt(M.status)),Pt=(V=(E=e.signedTransactions[r])==null?void 0:E.transactions)==null?void 0:V.every(M=>Co(M.status));N&&(e.signedTransactions[r].status="success"),Ct&&(e.signedTransactions[r].status="fail"),Pt&&(e.signedTransactions[r].status="invalid")}},setTransactionsToSign:(e,t)=>{e.transactionsToSign=t.payload;let{sessionId:r,customTransactionInformation:o}=t.payload;e.customTransactionInformationForSessionId[r]=o,e.signTransactionsError=null},clearAllTransactionsToSign:e=>{e.transactionsToSign=_e.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=_e.signedTransactions},setSignTransactionsError:(e,t)=>{e.signTransactionsError=t.payload},setSignTransactionsCancelMessage:(e,t)=>{e.signTransactionsCancelMessage=t.payload}},extraReducers:e=>{e.addCase(D,()=>_e),e.addCase(Mo.REHYDRATE,(t,r)=>{var p;if(t.signTransactionsCancelMessage=null,!((p=r.payload)!=null&&p.transactions))return;let{signedTransactions:o,customTransactionInformationForSessionId:i}=r.payload.transactions,l=Object.entries(o).reduce((m,[d,g])=>{let h=new Date(d),T=new Date;return T.setHours(T.getHours()+5),T-h>0||(m[d]=g),m},{});i!=null&&(t.customTransactionInformationForSessionId=i),o!=null&&(t.signedTransactions=l)})}}),{updateSignedTransactionStatus:vu,updateSignedTransactions:Au,setTransactionsToSign:bu,clearAllTransactionsToSign:Eu,clearAllSignedTransactions:ku,clearSignedTransaction:Du,clearTransactionToSign:Nu,setSignTransactionsError:Lu,setSignTransactionsCancelMessage:Ru,moveTransactionsToSignedState:Cu}=Oo.actions,ft=Oo.reducer});var Fo,Ar,Bo,Ou,Fu,Bu,Uu,yt,ht=y(()=>{"use strict";n();Fo=require("@reduxjs/toolkit");U();Ar={},Bo=(0,Fo.createSlice)({name:"batchTransactionsSlice",initialState:Ar,reducers:{setBatchTransactions:(e,t)=>{e[t.payload.id]=t.payload},updateBatchTransactions:(e,t)=>{e[t.payload.id]=t.payload},clearBatchTransactions:(e,t)=>{delete e[t.payload.batchId]},clearAllBatchTransactions:()=>Ar},extraReducers:e=>{e.addCase(D,()=>Ar)}}),{setBatchTransactions:Ou,updateBatchTransactions:Fu,clearBatchTransactions:Bu,clearAllBatchTransactions:Uu}=Bo.actions,yt=Bo.reducer});var Vo,Uo,Go,Wu,$o,br=y(()=>{"use strict";n();Vo=require("@reduxjs/toolkit");U();Uo={},Go=(0,Vo.createSlice)({name:"dappConfigSlice",initialState:Uo,reducers:{setDappConfig:(e,t)=>{if(e&&t.payload){let{logoutRoute:r,shouldUseWebViewProvider:o}=t.payload;e.logoutRoute=r,e.shouldUseWebViewProvider=o}else e=t.payload}},extraReducers:e=>{e.addCase(D,()=>Uo)}}),{setDappConfig:Wu}=Go.actions,$o=Go.reducer});var Ie=y(()=>{"use strict";n();et();rt();ot();at();ct();pt();dt();Tt();ht();br()});var Cr=y(()=>{"use strict";n()});var Qo,Zo,Jo,Lm,Rm,Cm,Pm,_m,Mm,ei,ti=y(()=>{"use strict";n();Qo=require("@reduxjs/toolkit");U();Zo={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},Jo=(0,Qo.createSlice)({name:"dappModalsSlice",initialState:Zo,reducers:{setDappModalVisibility:(e,t)=>{e.visible=t.payload},setDappModalHeaderVisibility:(e,t)=>{e.modal.showHeader=t.payload},setDappModalFooterVisibility:(e,t)=>{e.modal.showFooter=t.payload},setDappModalHeaderText:(e,t)=>{e.modal.headerText=t.payload},setDappModalFooterText:(e,t)=>{e.modal.footerText=t.payload},setDappModalConfig:(e,t)=>{e.modal=x({},t.payload)}},extraReducers:e=>{e.addCase(D,()=>Zo)}}),{setDappModalVisibility:Lm,setDappModalHeaderVisibility:Rm,setDappModalFooterVisibility:Cm,setDappModalHeaderText:Pm,setDappModalFooterText:_m,setDappModalConfig:Mm}=Jo.actions,ei=Jo.reducer});var ri,ss,cs,me,bt=y(()=>{"use strict";n();ri=require("@reduxjs/toolkit");Cr();et();ht();br();ti();rt();ot();at();ct();pt();dt();Tt();ss={["account"]:Je,["dappModal"]:ei,["dappConfig"]:$o,["loginInfo"]:tt,["modals"]:nt,["networkConfig"]:it,["signedMessageInfo"]:st,["toasts"]:lt,["transactionsInfo"]:ut,["transactions"]:ft,["batchTransactions"]:yt},cs=(e={})=>(0,ri.combineReducers)(x(x({},ss),e)),me=cs});var ai={};se(ai,{default:()=>As,sessionStorageReducers:()=>Pr});function J(e,t=[]){return{key:e,version:1,storage:oi.default,blacklist:t}}var _,ni,oi,ls,Me,ps,us,ds,ms,gs,fs,Ts,ys,hs,xs,ii,Ss,Pr,ws,Is,vs,As,si=y(()=>{"use strict";n();_=require("redux-persist"),ni=A(require("redux-persist/lib/storage")),oi=A(require("redux-persist/lib/storage/session"));bt();Ie();et();ht();rt();ot();at();ct();pt();dt();Tt();Cr();ls={persistReducersStorageType:"localStorage"},Me={["account"]:"sdk-dapp-account",["loginInfo"]:"sdk-dapp-login-info",["modals"]:"sdk-dapp-modals",["networkConfig"]:"sdk-dapp-network-config"},ps=J(Me["account"]),us=J(Me["loginInfo"]),ds=J(Me["modals"]),ms=J(Me["networkConfig"]),gs={2:e=>b(x({},e),{networkConfig:Tr})};fs=J("sdk-dapp-transactionsInfo"),Ts=J("sdk-dapp-transactions",["transactionsToSign"]),ys=J("sdk-dapp-batchTransactions",["batchTransactions"]),hs=J("sdk-dapp-toasts"),xs=J("sdk-dapp-signedMessageInfo"),ii={key:"sdk-dapp-store",version:2,storage:ni.default,whitelist:Object.keys(Me),migrate:(0,_.createMigrate)(gs,{debug:!1})},Ss=b(x({},ii),{whitelist:[]}),Pr={["toasts"]:(0,_.persistReducer)(hs,lt),["transactions"]:(0,_.persistReducer)(Ts,ft),["transactionsInfo"]:(0,_.persistReducer)(fs,ut),["batchTransactions"]:(0,_.persistReducer)(ys,yt),["signedMessageInfo"]:(0,_.persistReducer)(xs,st)},ws=b(x({},Pr),{["account"]:(0,_.persistReducer)(ps,Je),["loginInfo"]:(0,_.persistReducer)(us,tt),["modals"]:(0,_.persistReducer)(ds,nt),["networkConfig"]:(0,_.persistReducer)(ms,it)}),Is=ls.persistReducersStorageType==="localStorage",vs=Is?(0,_.persistReducer)(ii,me(Pr)):(0,_.persistReducer)(Ss,me(ws)),As=vs});var ci={};se(ci,{default:()=>bs});var bs,li=y(()=>{"use strict";n();bt();bs=me()});var pi={};se(pi,{default:()=>ks});var B,Es,ks,ui=y(()=>{"use strict";n();B=require("redux-persist"),Es=[B.FLUSH,B.REHYDRATE,B.PAUSE,B.PERSIST,B.PURGE,B.REGISTER],ks=Es});var gi={};se(gi,{default:()=>mi});function mi(e){return(0,di.persistStore)(e)}var di,fi=y(()=>{"use strict";n();di=require("redux-persist")});var wc={};se(wc,{useSignMultipleTransactions:()=>Sc});module.exports=ke(wc);n();var ge=require("react"),fe=require("@multiversx/sdk-core");n();var Ne=require("react");n();var Zt=require("@multiversx/sdk-core"),Qt=A(require("bignumber.js"));j();n();var Sn=require("@multiversx/sdk-core");function Ia(e){try{let t=new Sn.Address(e);return Boolean(t.bech32())}catch(t){return!1}}function ze(e){return(e==null?void 0:e.startsWith("erd"))&&e.length===62&&/^\w+$/.test(e)&&Ia(e)}n();n();function Yt(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>127)return!1;return!0}function De(e){let t=e;try{let r=a.Buffer.from(e,"hex").toString();Yt(r)&&r.length>1&&(t=r)}catch(r){}return t}var Xt={tokenId:"",amount:""},va=e=>e.split("@").map((l,p)=>[2,3].includes(p)?l:De(l));function Jt(e){if(!e)return Xt;let t=e.startsWith("ESDTTransfer"),r=e.startsWith("ESDTNFTTransfer")&&e.includes("@");if(t){let[,o,i]=e.split("@");try{let l=a.Buffer.from(o,"hex").toString("ascii");if(!l)return Xt;let p=new Qt.default("0x"+i.replace("0x","")).toString(10);return{tokenId:l,amount:p}}catch(l){console.error("Error getting token from transaction data",l)}}if(r)try{let[,o,i,l,p]=va(e);if([o,i,l,p].every(m=>Boolean(m))&&ze(new Zt.Address(p).bech32()))return{tokenId:`${o}-${i}`,amount:new Qt.default(l,16).toString(10),collection:o,nonce:i,receiver:new Zt.Address(p).bech32()}}catch(o){}return Xt}n();var er=A(require("bignumber.js"));F();n();var Ln=(e,t)=>{let r=[],o=e.indexOf(t,0);for(;o>=0;)r.push(o),o=e.indexOf(t,o+1);return r};function Rn(e){let t=[],r=0;try{if((e==null?void 0:e.startsWith("MultiESDTNFTTransfer"))&&(e==null?void 0:e.includes("@"))){let[,o,i,...l]=e==null?void 0:e.split("@");if(o){let p=new er.default(i,16).toNumber(),m=0;for(let T=0;T<p;T++){let w={type:"nftTransaction",data:"",receiver:o};for(let S=0;S<3;S++){switch(S){case 0:w.token=De(l[m]),w.data=l[m];break;case 1:{let E=l[m]&&l[m].length?l[m]:"";E&&E!=="00"?w.nonce=E:w.type="esdtTransaction",w.data=`${w.data}@${l[m]}`;break}case 2:w.amount=new er.default(l[m],16).toString(10),w.data=`${w.data}@${l[m]}`;break;default:break}r=m+1,m++}t[T]=w}let d=t.length!==p,g=t.some(T=>Ln(T.data,"@").length!==2),h=t.some(T=>T.data.startsWith("@"));if(d||g||h)return[];if(l[r]){let T=l[r];for(let w=r+1;w<l.length;w++)T+="@"+l[w];t[p]={type:"scCall",data:T,receiver:o}}}}}catch(o){return console.error("failed parsing tx",o),t}return t}var Cn={tokenId:"",amount:"",type:"",multiTxData:"",receiver:""};function Pn({transactions:e}){let[t,r]=(0,Ne.useState)({}),[o,i]=(0,Ne.useState)([]);function l(d,g){r(h=>b(x({},h),{[d]:g}))}function p(d,g){return t==null?Cn:d in t?t[d]:g!=null&&String(g)in t?t[g]:Cn}function m(){if(e&&e.length>0){let d=[];e.forEach((g,h)=>{let T=g.getData().toString(),w=Rn(T);if(w.length>0)w.forEach((S,E)=>{let V={transaction:g,multiTxData:S.data,transactionIndex:E};l(S.data,{tokenId:S.token?S.token:"",amount:S.amount?S.amount:"",type:S.type,nonce:S.nonce?S.nonce:"",multiTxData:S.data,receiver:S.receiver}),d.push(V)});else{let{tokenId:S,amount:E}=Jt(g.getData().toString());S&&l(g.getData().toString(),{tokenId:S,amount:E,receiver:g.getReceiver().bech32()}),d.push({transaction:g,transactionIndex:h})}}),i(d)}}return(0,Ne.useEffect)(()=>{m()},[e==null?void 0:e.length]),{parsedTransactionsByDataField:t,getTxInfoByDataField:p,allTransactions:o}}nr();n();function On({tokenId:e,erdLabel:t}){return Boolean(e&&e!==t)}n();n();n();n();Ie();n();var Wo=A(require("lodash.isequal")),xt=require("reselect");F();var f=(0,xt.createSelectorCreator)(xt.defaultMemoize,Wo.default),St=(e,t)=>e!=""&&Boolean(t);var K=e=>e.account,wt=f(K,e=>e.address),Er=f(K,wt,(e,t)=>t in e.accounts?e.accounts[t]:Qe),ad=f(K,Er,(e,t)=>{let i=e,{accounts:r}=i,o=Ft(i,["accounts"]);return b(x({},o),{account:t})}),sd=f(Er,e=>e.balance),es=f(Er,e=>{var t;return((t=e==null?void 0:e.nonce)==null?void 0:t.valueOf())||0}),cd=f(K,e=>e.shard),ld=f(K,e=>e.ledgerAccount),pd=f(K,e=>e.walletConnectAccount),ud=f(K,e=>e.isAccountLoading),dd=f(K,e=>e.accountLoadingError),md=f(K,e=>e.websocketEvent),gd=f(K,e=>e.websocketBatchEvent);n();var ts=e=>e.dappConfig,yd=f(ts,e=>e.shouldUseWebViewProvider);n();var ie=e=>e.loginInfo,wd=f(ie,e=>e.loginMethod),Id=f(ie,wt,(e,t)=>St(e.loginMethod,t)),vd=f(ie,e=>e.walletConnectLogin),Ad=f(ie,e=>e.ledgerLogin),bd=f(ie,e=>e.walletLogin),Ed=f(ie,e=>e.isLoginSessionInvalid),kd=f(ie,e=>e.tokenLogin),Dd=f(ie,e=>e.logoutRoute);n();var Ho=e=>e.modals,Rd=f(Ho,e=>e.txSubmittedModal),Cd=f(Ho,e=>e.notificationModal);n();var de=e=>e.networkConfig,Md=f(de,e=>e.chainID),Od=f(de,e=>e.network.walletConnectBridgeAddress),Fd=f(de,e=>e.network.walletConnectV2RelayAddress),Bd=f(de,e=>e.network.walletConnectV2ProjectId),Ud=f(de,e=>e.network.walletConnectV2Options),Vd=f(de,e=>e.network.walletConnectDeepLink),kr=f(de,e=>e.network),rs=f(kr,e=>e.apiAddress),qo=f(kr,e=>e.explorerAddress),Gd=f(kr,e=>e.egldLabel);n();var It=e=>e.signedMessageInfo,Hd=f(It,e=>e.isSigning),qd=f(It,e=>e.errorMessage),jd=f(It,e=>{let t=Object.keys(e.signedSessions),r=t.length;return e.signedSessions[t[r-1]]}),zd=f(It,e=>{let t=Object.keys(e.signedSessions),r=t.length;return t.length>0?t[r-1]:""});n();var Dr=e=>e.toasts,Xd=f(Dr,e=>e.customToasts),Zd=f(Dr,e=>e.transactionToasts),Qd=f(Dr,e=>e.failTransactionToast);n();Ie();var jo={errorMessage:xr,successMessage:Sr,processingMessage:wr},ns=e=>e.transactionsInfo,rm=f(ns,(e,t)=>t,(e,t)=>t!=null&&(e==null?void 0:e[Number(t)])||jo);n();n();var Y=require("@multiversx/sdk-core"),Ko=require("@multiversx/sdk-core/out/signature");I();n();var Lr=require("@multiversx/sdk-core/out");n();n();function Nr(e){try{let t=atob(e),r=btoa(t),o=a.Buffer.from(e,"base64").toString(),i=a.Buffer.from(o).toString("base64");if(e===r&&e===i||t===o)return!0}catch(t){return!1}return!1}n();n();var zo=e=>{let t=e!=null?e:"";return Nr(t)?Lr.TransactionPayload.fromEncoded(t):new Lr.TransactionPayload(t)};function Rr(e){var r,o,i;let t=new Y.Transaction(x(x({value:e.value.valueOf(),data:zo(e.data),nonce:e.nonce.valueOf(),receiver:new Y.Address(e.receiver),sender:new Y.Address(e.sender),gasLimit:(r=e.gasLimit.valueOf())!=null?r:ir,gasPrice:(o=e.gasPrice.valueOf())!=null?o:ar,chainID:e.chainID.valueOf(),version:new Y.TransactionVersion((i=e.version)!=null?i:jn)},e.options?{options:new Y.TransactionOptions(e.options)}:{}),e.guardian?{guardian:new Y.Address(e.guardian)}:{}));return e.guardianSignature&&t.applyGuardianSignature({hex:()=>e.guardianSignature||""}),e.signature&&t.applySignature(new Ko.Signature(e.signature)),t}n();n();n();n();var _r=require("@reduxjs/toolkit"),xi=require("react-redux/lib/utils/Subscription");Ie();n();var Yo=A(require("lodash.throttle"));I();Ie();gr();Xe();Re();var os=[Ke],vt=!1,is=(0,Yo.default)(()=>{Pe(Ce())},5e3),Xo=e=>t=>r=>{var d;if(os.includes(r.type))return t(r);let o=e.getState(),i=we.local.getItem(ue.loginExpiresAt);if(!St((d=o==null?void 0:o.loginInfo)==null?void 0:d.loginMethod,o==null?void 0:o.account.address))return t(r);if(i==null)return Pe(Ce());let p=Date.now();return i-p<0&&!vt?setTimeout(()=>{vt=!0,e.dispatch(uo())},1e3):(vt&&(vt=!1),is()),t(r)};n();n();function At(){return typeof sessionStorage!="undefined"}var Ti=At()?(si(),ke(ai)).default:(li(),ke(ci)).default,yi=At()?(ui(),ke(pi)).default:[],hi=At()?(fi(),ke(gi)).default:e=>e;bt();var ee=(0,_r.configureStore)({reducer:Ti,middleware:e=>e({serializableCheck:{ignoredActions:[...yi,ao.type,io.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(Xo)}),Si=(0,xi.createSubscription)(ee),fg=hi(ee),Tg=(0,_r.configureStore)({reducer:me});n();n();var Ns=require("@multiversx/sdk-core/out");n();I();n();var wi=require("@multiversx/sdk-core");F();n();n();n();n();n();n();n();n();n();P();n();n();P();n();n();n();var Os=A(require("bignumber.js"));I();n();var Ms=require("@multiversx/sdk-core"),Mr=A(require("bignumber.js"));I();n();var Ps=A(require("bignumber.js"));n();Mr.default.config({ROUNDING_MODE:Mr.default.ROUND_FLOOR});n();n();n();I();n();n();n();n();I();n();I();n();var Fs=require("@multiversx/sdk-core");I();n();var Fe=require("@multiversx/sdk-core"),Us=require("@multiversx/sdk-network-providers");I();n();n();var Bs=A(require("bignumber.js"));I();n();I();n();n();n();n();n();n();I();n();I();n();I();n();P();var Gs=["reDelegateRewards","claimRewards","unBond"],$s=["wrapEgld","unwrapEgld"],Ws=["unStake"],Hs=["unDelegate"];n();n();n();I();n();var zs=A(require("bignumber.js"));n();n();P();n();var Ks=A(require("bignumber.js"));n();n();n();n();j();n();var Js=require("@multiversx/sdk-web-wallet-provider");I();n();var Zs=A(require("qs"));n();n();var Br=()=>typeof window!="undefined"&&typeof(window==null?void 0:window.location)!="undefined";n();var gh={search:Br()?window.location.search:"",removeParams:[]};n();n();n();n();P();n();n();n();var ec=A(require("linkifyjs"));n();I();n();var tc=A(require("bignumber.js"));n();F();n();n();j();n();j();n();n();n();P();n();P();n();var rc=A(require("bignumber.js"));I();P();n();P();n();var bi=require("react");F();n();n();P();n();n();var nc=require("@multiversx/sdk-core/out"),oc=A(require("bignumber.js"));P();n();F();n();n();F();var iS=[{label:"Raw",value:"raw"},{label:"Text",value:"text"},{label:"Decimal",value:"decimal"},{label:"Smart",value:"smart"}];n();var Ei=require("react");F();n();var ac=require("react");P();var dS=["create","localMint","ESDTLocalMint","addQuantity","burn","localBurn","ESDTLocalBurn","wipe","writeLog","signalError"];vr();var Dt=e=>e.transactions,Be=f(Dt,e=>e.signedTransactions),ZS=f(Dt,e=>e.signTransactionsError),QS=f(Dt,e=>e.signTransactionsCancelMessage),Nt=e=>t=>Object.entries(t).reduce((r,[o,i])=>(e(i.status)&&(r[o]=i),r),{}),JS=f(Be,Nt(Ro)),ew=f(Be,Nt(mt)),tw=f(Be,Nt(gt)),rw=f(Be,Nt(Po)),sc=f(Dt,e=>{var t;return(e==null?void 0:e.transactionsToSign)==null?null:b(x({},e.transactionsToSign),{transactions:((t=e==null?void 0:e.transactionsToSign)==null?void 0:t.transactions.map(r=>Rr(r)))||[]})}),nw=f(Be,(e,t)=>t,(e,t)=>t!=null?(e==null?void 0:e[t])||{}:{});n();n();var ki=require("react"),ve=require("react-redux");var cc={store:ee,subscription:Si},Ur=(0,ki.createContext)(cc),Sw=(0,ve.createStoreHook)(Ur),ww=(0,ve.createDispatchHook)(Ur),lc=(0,ve.createSelectorHook)(Ur);n();n();var uc=A(require("axios"));n();n();n();n();n();n();var Vr=({transactions:e,isGuarded:t})=>t?e.every(o=>Boolean(o.getGuardianSignature().toString("hex"))):!0;n();n();n();Le();n();var dc=A(require("axios"));n();var mc=A(require("axios"));n();Le();n();Le();I();n();var Tc=require("@multiversx/sdk-extension-provider"),yc=require("@multiversx/sdk-hw-provider"),hc=require("@multiversx/sdk-opera-provider"),xc=require("@multiversx/sdk-web-wallet-provider");I();j();n();n();n();var re=e=>`Unable to perform ${e}, Provider not initialized`,Lt=class{init(){return Promise.resolve(!1)}login(t){throw new Error(re(`login with options: ${t}`))}logout(t){throw new Error(re(`logout with options: ${t}`))}getAddress(){throw new Error(re("getAddress"))}isInitialized(){return!1}isConnected(){return Promise.resolve(!1)}sendTransaction(t,r){throw new Error(re(`sendTransaction with transactions: ${t} options: ${r}`))}signTransaction(t,r){throw new Error(re(`signTransaction with transactions: ${t} options: ${r}`))}signTransactions(t,r){throw new Error(re(`signTransactions with transactions: ${t} options: ${r}`))}signMessage(t,r){throw new Error(re(`signTransactions with ${t} and options ${r}`))}sendCustomMessage({method:t,params:r}){throw new Error(re(`sendCustomMessage with method: ${t} params: ${r}`))}sendCustomRequest(t){throw new Error(re(`sendSessionEvent with options: ${t}`))}ping(){return Promise.resolve(!1)}},fc=new Lt;var Rt={};function Sc({isLedger:e=!1,transactionsToSign:t,egldLabel:r,address:o,activeGuardianAddress:i,hasGuardianScreen:l,onCancel:p,onSignTransaction:m,onTransactionsSignError:d,onTransactionsSignSuccess:g,onGetScamAddressData:h}){var Hr,qr,jr;let T=Boolean(i),[w,S]=(0,ge.useState)(0),[E,V]=(0,ge.useState)(),[N,Ct]=(0,ge.useState)(null),[Pt,M]=(0,ge.useState)(!1),{getTxInfoByDataField:Di,allTransactions:ne}=Pn({transactions:i?t==null?void 0:t.map(v=>{v.setSender(fe.Address.fromBech32(o)),v.setVersion(fe.TransactionVersion.withTxOptions()),v.setGuardian(fe.Address.fromBech32(i));let R=x({guarded:!0},e?{hashSign:!0}:{});return v.setOptions(fe.TransactionOptions.withOptions(R)),v}):t}),_t=w===ne.length-1;(0,ge.useEffect)(()=>{Ni()},[w,ne]);function Ni(){return G(this,null,function*(){var zr;let v=ne[w];if(v==null)return;let{transaction:R,multiTxData:Ae}=v,Ue=R.getData().toString(),Mt=Di(R.getData().toString(),Ae),{tokenId:oe}=Mt,ae=R.getReceiver().toString(),be=o!==ae,Oi=ae in Rt;if(be&&!Oi&&h!=null){let Ve=yield h(ae);Rt=x(x({},Rt),Ve!=null&&Ve.scamInfo?{[ae]:Ve.scamInfo}:{})}let Fi=Boolean(oe&&On({tokenId:oe,erdLabel:r}));Ct({transaction:R,receiverScamInfo:((zr=Rt[ae])==null?void 0:zr.info)||null,transactionTokenInfo:Mt,isTokenTransaction:Fi,dataField:Ue})})}function Gr(){S(0),V(void 0),M(!1)}function $r(){return G(this,null,function*(){if(N==null)return;M(e);let v;try{v=yield m(N.transaction)}catch(oe){console.error(oe,"sign error");let{message:ae}=oe,be=e?Mn(oe).errorMessage:null;return Gr(),d(be!=null?be:ae)}let R={[w]:v},Ae=E?x(x({},E),R):R;if(V(Ae),!_t){S(oe=>oe+1),M(!1);return}if(!Ae)return;let Ue=Object.values(Ae);!Vr({isGuarded:T,transactions:Ue})&&l||(g(Ue),Gr())})}function Li(){try{if(N==null)return;if(N.transaction.getSignature().toString("hex")&&!_t){S(R=>R+1);return}$r()}catch(v){$r()}}let Ri=w===0;function Ci(){Ri?p==null||p():S(v=>v-1)}let Wr=Boolean(((Hr=N==null?void 0:N.transactionTokenInfo)==null?void 0:Hr.type)&&((qr=N==null?void 0:N.transactionTokenInfo)==null?void 0:qr.multiTxData)&&!(N!=null&&N.dataField.endsWith((jr=N==null?void 0:N.transactionTokenInfo)==null?void 0:jr.multiTxData)));function Pi(){Wr?S(v=>v+1):Li()}function _i(){S(v=>{let R=v+1;return R>(ne==null?void 0:ne.length)?v:R})}function Mi(){S(v=>{let R=v-1;return R<0?v:R})}return{allTransactions:ne,onSignTransaction:Pi,onNext:_i,onPrev:Mi,waitingForDevice:Pt,onAbort:Ci,isLastTransaction:_t,isFirstTransaction:w===0,hasMultipleTransactions:ne.length>1,shouldContinueWithoutSigning:Wr,currentStep:w,signedTransactions:E,setSignedTransactions:V,currentTransaction:N}}0&&(module.exports={useSignMultipleTransactions});
1
+ "use strict";var Bi=Object.create;var Ee=Object.defineProperty,Ui=Object.defineProperties,Vi=Object.getOwnPropertyDescriptor,Gi=Object.getOwnPropertyDescriptors,$i=Object.getOwnPropertyNames,Ge=Object.getOwnPropertySymbols,Wi=Object.getPrototypeOf,Ot=Object.prototype.hasOwnProperty,Yr=Object.prototype.propertyIsEnumerable;var Kr=(e,t,r)=>t in e?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,x=(e,t)=>{for(var r in t||(t={}))Ot.call(t,r)&&Kr(e,r,t[r]);if(Ge)for(var r of Ge(t))Yr.call(t,r)&&Kr(e,r,t[r]);return e},E=(e,t)=>Ui(e,Gi(t));var Ft=(e,t)=>{var r={};for(var o in e)Ot.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&Ge)for(var o of Ge(e))t.indexOf(o)<0&&Yr.call(e,o)&&(r[o]=e[o]);return r};var y=(e,t)=>()=>(e&&(t=e(e=0)),t);var $e=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),se=(e,t)=>{for(var r in t)Ee(e,r,{get:t[r],enumerable:!0})},Xr=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of $i(t))!Ot.call(e,i)&&i!==r&&Ee(e,i,{get:()=>t[i],enumerable:!(o=Vi(t,i))||o.enumerable});return e};var A=(e,t,r)=>(r=e!=null?Bi(Wi(e)):{},Xr(t||!e||!e.__esModule?Ee(r,"default",{value:e,enumerable:!0}):r,e)),ke=e=>Xr(Ee({},"__esModule",{value:!0}),e);var G=(e,t,r)=>new Promise((o,i)=>{var l=d=>{try{m(r.next(d))}catch(g){i(g)}},p=d=>{try{m(r.throw(d))}catch(g){i(g)}},m=d=>d.done?o(d.value):Promise.resolve(d.value).then(l,p);m((r=r.apply(e,t)).next())});var Jr=$e(We=>{"use strict";n();We.byteLength=qi;We.toByteArray=zi;We.fromByteArray=Xi;var $=[],F=[],Hi=typeof Uint8Array!="undefined"?Uint8Array:Array,Bt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ce=0,Zr=Bt.length;ce<Zr;++ce)$[ce]=Bt[ce],F[Bt.charCodeAt(ce)]=ce;var ce,Zr;F["-".charCodeAt(0)]=62;F["_".charCodeAt(0)]=63;function Qr(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var o=r===t?0:4-r%4;return[r,o]}function qi(e){var t=Qr(e),r=t[0],o=t[1];return(r+o)*3/4-o}function ji(e,t,r){return(t+r)*3/4-r}function zi(e){var t,r=Qr(e),o=r[0],i=r[1],l=new Hi(ji(e,o,i)),p=0,m=i>0?o-4:o,d;for(d=0;d<m;d+=4)t=F[e.charCodeAt(d)]<<18|F[e.charCodeAt(d+1)]<<12|F[e.charCodeAt(d+2)]<<6|F[e.charCodeAt(d+3)],l[p++]=t>>16&255,l[p++]=t>>8&255,l[p++]=t&255;return i===2&&(t=F[e.charCodeAt(d)]<<2|F[e.charCodeAt(d+1)]>>4,l[p++]=t&255),i===1&&(t=F[e.charCodeAt(d)]<<10|F[e.charCodeAt(d+1)]<<4|F[e.charCodeAt(d+2)]>>2,l[p++]=t>>8&255,l[p++]=t&255),l}function Ki(e){return $[e>>18&63]+$[e>>12&63]+$[e>>6&63]+$[e&63]}function Yi(e,t,r){for(var o,i=[],l=t;l<r;l+=3)o=(e[l]<<16&16711680)+(e[l+1]<<8&65280)+(e[l+2]&255),i.push(Ki(o));return i.join("")}function Xi(e){for(var t,r=e.length,o=r%3,i=[],l=16383,p=0,m=r-o;p<m;p+=l)i.push(Yi(e,p,p+l>m?m:p+l));return o===1?(t=e[r-1],i.push($[t>>2]+$[t<<4&63]+"==")):o===2&&(t=(e[r-2]<<8)+e[r-1],i.push($[t>>10]+$[t>>4&63]+$[t<<2&63]+"=")),i.join("")}});var en=$e(Ut=>{n();Ut.read=function(e,t,r,o,i){var l,p,m=i*8-o-1,d=(1<<m)-1,g=d>>1,h=-7,T=r?i-1:0,w=r?-1:1,S=e[t+T];for(T+=w,l=S&(1<<-h)-1,S>>=-h,h+=m;h>0;l=l*256+e[t+T],T+=w,h-=8);for(p=l&(1<<-h)-1,l>>=-h,h+=o;h>0;p=p*256+e[t+T],T+=w,h-=8);if(l===0)l=1-g;else{if(l===d)return p?NaN:(S?-1:1)*(1/0);p=p+Math.pow(2,o),l=l-g}return(S?-1:1)*p*Math.pow(2,l-o)};Ut.write=function(e,t,r,o,i,l){var p,m,d,g=l*8-i-1,h=(1<<g)-1,T=h>>1,w=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=o?0:l-1,b=o?1:-1,O=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(m=isNaN(t)?1:0,p=h):(p=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-p))<1&&(p--,d*=2),p+T>=1?t+=w/d:t+=w*Math.pow(2,1-T),t*d>=2&&(p++,d/=2),p+T>=h?(m=0,p=h):p+T>=1?(m=(t*d-1)*Math.pow(2,i),p=p+T):(m=t*Math.pow(2,T-1)*Math.pow(2,i),p=0));i>=8;e[r+S]=m&255,S+=b,m/=256,i-=8);for(p=p<<i|m,g+=i;g>0;e[r+S]=p&255,S+=b,p/=256,g-=8);e[r+S-b]|=O*128}});var gn=$e(ye=>{"use strict";n();var Vt=Jr(),Te=en(),tn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ye.Buffer=u;ye.SlowBuffer=ra;ye.INSPECT_MAX_BYTES=50;var He=2147483647;ye.kMaxLength=He;u.TYPED_ARRAY_SUPPORT=Zi();!u.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Zi(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch(r){return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.buffer}});Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(!!u.isBuffer(this))return this.byteOffset}});function X(e){if(e>He)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Ht(e)}return on(e,t,r)}u.poolSize=8192;function on(e,t,r){if(typeof e=="string")return Ji(e,t);if(ArrayBuffer.isView(e))return ea(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(W(e,ArrayBuffer)||e&&W(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(W(e,SharedArrayBuffer)||e&&W(e.buffer,SharedArrayBuffer)))return $t(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var o=e.valueOf&&e.valueOf();if(o!=null&&o!==e)return u.from(o,t,r);var i=ta(e);if(i)return i;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}u.from=function(e,t,r){return on(e,t,r)};Object.setPrototypeOf(u.prototype,Uint8Array.prototype);Object.setPrototypeOf(u,Uint8Array);function an(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function Qi(e,t,r){return an(e),e<=0?X(e):t!==void 0?typeof r=="string"?X(e).fill(t,r):X(e).fill(t):X(e)}u.alloc=function(e,t,r){return Qi(e,t,r)};function Ht(e){return an(e),X(e<0?0:qt(e)|0)}u.allocUnsafe=function(e){return Ht(e)};u.allocUnsafeSlow=function(e){return Ht(e)};function Ji(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=sn(e,t)|0,o=X(r),i=o.write(e,t);return i!==r&&(o=o.slice(0,i)),o}function Gt(e){for(var t=e.length<0?0:qt(e.length)|0,r=X(t),o=0;o<t;o+=1)r[o]=e[o]&255;return r}function ea(e){if(W(e,Uint8Array)){var t=new Uint8Array(e);return $t(t.buffer,t.byteOffset,t.byteLength)}return Gt(e)}function $t(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var o;return t===void 0&&r===void 0?o=new Uint8Array(e):r===void 0?o=new Uint8Array(e,t):o=new Uint8Array(e,t,r),Object.setPrototypeOf(o,u.prototype),o}function ta(e){if(u.isBuffer(e)){var t=qt(e.length)|0,r=X(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||jt(e.length)?X(0):Gt(e);if(e.type==="Buffer"&&Array.isArray(e.data))return Gt(e.data)}function qt(e){if(e>=He)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+He.toString(16)+" bytes");return e|0}function ra(e){return+e!=e&&(e=0),u.alloc(+e)}u.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==u.prototype};u.compare=function(t,r){if(W(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),W(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),!u.isBuffer(t)||!u.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;for(var o=t.length,i=r.length,l=0,p=Math.min(o,i);l<p;++l)if(t[l]!==r[l]){o=t[l],i=r[l];break}return o<i?-1:i<o?1:0};u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};u.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return u.alloc(0);var o;if(r===void 0)for(r=0,o=0;o<t.length;++o)r+=t[o].length;var i=u.allocUnsafe(r),l=0;for(o=0;o<t.length;++o){var p=t[o];if(W(p,Uint8Array))l+p.length>i.length?u.from(p).copy(i,l):Uint8Array.prototype.set.call(i,p,l);else if(u.isBuffer(p))p.copy(i,l);else throw new TypeError('"list" argument must be an Array of Buffers');l+=p.length}return i};function sn(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||W(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,o=arguments.length>2&&arguments[2]===!0;if(!o&&r===0)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Wt(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return mn(e).length;default:if(i)return o?-1:Wt(e).length;t=(""+t).toLowerCase(),i=!0}}u.byteLength=sn;function na(e,t,r){var o=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return ma(this,t,r);case"utf8":case"utf-8":return ln(this,t,r);case"ascii":return ua(this,t,r);case"latin1":case"binary":return da(this,t,r);case"base64":return la(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ga(this,t,r);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}u.prototype._isBuffer=!0;function le(e,t,r){var o=e[t];e[t]=e[r],e[r]=o}u.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)le(this,r,r+1);return this};u.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)le(this,r,r+3),le(this,r+1,r+2);return this};u.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)le(this,r,r+7),le(this,r+1,r+6),le(this,r+2,r+5),le(this,r+3,r+4);return this};u.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?ln(this,0,t):na.apply(this,arguments)};u.prototype.toLocaleString=u.prototype.toString;u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:u.compare(this,t)===0};u.prototype.inspect=function(){var t="",r=ye.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};tn&&(u.prototype[tn]=u.prototype.inspect);u.prototype.compare=function(t,r,o,i,l){if(W(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(r===void 0&&(r=0),o===void 0&&(o=t?t.length:0),i===void 0&&(i=0),l===void 0&&(l=this.length),r<0||o>t.length||i<0||l>this.length)throw new RangeError("out of range index");if(i>=l&&r>=o)return 0;if(i>=l)return-1;if(r>=o)return 1;if(r>>>=0,o>>>=0,i>>>=0,l>>>=0,this===t)return 0;for(var p=l-i,m=o-r,d=Math.min(p,m),g=this.slice(i,l),h=t.slice(r,o),T=0;T<d;++T)if(g[T]!==h[T]){p=g[T],m=h[T];break}return p<m?-1:m<p?1:0};function cn(e,t,r,o,i){if(e.length===0)return-1;if(typeof r=="string"?(o=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,jt(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=u.from(t,o)),u.isBuffer(t))return t.length===0?-1:rn(e,t,r,o,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):rn(e,[t],r,o,i);throw new TypeError("val must be string, number or Buffer")}function rn(e,t,r,o,i){var l=1,p=e.length,m=t.length;if(o!==void 0&&(o=String(o).toLowerCase(),o==="ucs2"||o==="ucs-2"||o==="utf16le"||o==="utf-16le")){if(e.length<2||t.length<2)return-1;l=2,p/=2,m/=2,r/=2}function d(S,b){return l===1?S[b]:S.readUInt16BE(b*l)}var g;if(i){var h=-1;for(g=r;g<p;g++)if(d(e,g)===d(t,h===-1?0:g-h)){if(h===-1&&(h=g),g-h+1===m)return h*l}else h!==-1&&(g-=g-h),h=-1}else for(r+m>p&&(r=p-m),g=r;g>=0;g--){for(var T=!0,w=0;w<m;w++)if(d(e,g+w)!==d(t,w)){T=!1;break}if(T)return g}return-1}u.prototype.includes=function(t,r,o){return this.indexOf(t,r,o)!==-1};u.prototype.indexOf=function(t,r,o){return cn(this,t,r,o,!0)};u.prototype.lastIndexOf=function(t,r,o){return cn(this,t,r,o,!1)};function oa(e,t,r,o){r=Number(r)||0;var i=e.length-r;o?(o=Number(o),o>i&&(o=i)):o=i;var l=t.length;o>l/2&&(o=l/2);for(var p=0;p<o;++p){var m=parseInt(t.substr(p*2,2),16);if(jt(m))return p;e[r+p]=m}return p}function ia(e,t,r,o){return qe(Wt(t,e.length-r),e,r,o)}function aa(e,t,r,o){return qe(ya(t),e,r,o)}function sa(e,t,r,o){return qe(mn(t),e,r,o)}function ca(e,t,r,o){return qe(ha(t,e.length-r),e,r,o)}u.prototype.write=function(t,r,o,i){if(r===void 0)i="utf8",o=this.length,r=0;else if(o===void 0&&typeof r=="string")i=r,o=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(o)?(o=o>>>0,i===void 0&&(i="utf8")):(i=o,o=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var l=this.length-r;if((o===void 0||o>l)&&(o=l),t.length>0&&(o<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var p=!1;;)switch(i){case"hex":return oa(this,t,r,o);case"utf8":case"utf-8":return ia(this,t,r,o);case"ascii":case"latin1":case"binary":return aa(this,t,r,o);case"base64":return sa(this,t,r,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ca(this,t,r,o);default:if(p)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),p=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function la(e,t,r){return t===0&&r===e.length?Vt.fromByteArray(e):Vt.fromByteArray(e.slice(t,r))}function ln(e,t,r){r=Math.min(e.length,r);for(var o=[],i=t;i<r;){var l=e[i],p=null,m=l>239?4:l>223?3:l>191?2:1;if(i+m<=r){var d,g,h,T;switch(m){case 1:l<128&&(p=l);break;case 2:d=e[i+1],(d&192)===128&&(T=(l&31)<<6|d&63,T>127&&(p=T));break;case 3:d=e[i+1],g=e[i+2],(d&192)===128&&(g&192)===128&&(T=(l&15)<<12|(d&63)<<6|g&63,T>2047&&(T<55296||T>57343)&&(p=T));break;case 4:d=e[i+1],g=e[i+2],h=e[i+3],(d&192)===128&&(g&192)===128&&(h&192)===128&&(T=(l&15)<<18|(d&63)<<12|(g&63)<<6|h&63,T>65535&&T<1114112&&(p=T))}}p===null?(p=65533,m=1):p>65535&&(p-=65536,o.push(p>>>10&1023|55296),p=56320|p&1023),o.push(p),i+=m}return pa(o)}var nn=4096;function pa(e){var t=e.length;if(t<=nn)return String.fromCharCode.apply(String,e);for(var r="",o=0;o<t;)r+=String.fromCharCode.apply(String,e.slice(o,o+=nn));return r}function ua(e,t,r){var o="";r=Math.min(e.length,r);for(var i=t;i<r;++i)o+=String.fromCharCode(e[i]&127);return o}function da(e,t,r){var o="";r=Math.min(e.length,r);for(var i=t;i<r;++i)o+=String.fromCharCode(e[i]);return o}function ma(e,t,r){var o=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>o)&&(r=o);for(var i="",l=t;l<r;++l)i+=xa[e[l]];return i}function ga(e,t,r){for(var o=e.slice(t,r),i="",l=0;l<o.length-1;l+=2)i+=String.fromCharCode(o[l]+o[l+1]*256);return i}u.prototype.slice=function(t,r){var o=this.length;t=~~t,r=r===void 0?o:~~r,t<0?(t+=o,t<0&&(t=0)):t>o&&(t=o),r<0?(r+=o,r<0&&(r=0)):r>o&&(r=o),r<t&&(r=t);var i=this.subarray(t,r);return Object.setPrototypeOf(i,u.prototype),i};function L(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(t,r,o){t=t>>>0,r=r>>>0,o||L(t,r,this.length);for(var i=this[t],l=1,p=0;++p<r&&(l*=256);)i+=this[t+p]*l;return i};u.prototype.readUintBE=u.prototype.readUIntBE=function(t,r,o){t=t>>>0,r=r>>>0,o||L(t,r,this.length);for(var i=this[t+--r],l=1;r>0&&(l*=256);)i+=this[t+--r]*l;return i};u.prototype.readUint8=u.prototype.readUInt8=function(t,r){return t=t>>>0,r||L(t,1,this.length),this[t]};u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||L(t,2,this.length),this[t]|this[t+1]<<8};u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||L(t,2,this.length),this[t]<<8|this[t+1]};u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||L(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};u.prototype.readIntLE=function(t,r,o){t=t>>>0,r=r>>>0,o||L(t,r,this.length);for(var i=this[t],l=1,p=0;++p<r&&(l*=256);)i+=this[t+p]*l;return l*=128,i>=l&&(i-=Math.pow(2,8*r)),i};u.prototype.readIntBE=function(t,r,o){t=t>>>0,r=r>>>0,o||L(t,r,this.length);for(var i=r,l=1,p=this[t+--i];i>0&&(l*=256);)p+=this[t+--i]*l;return l*=128,p>=l&&(p-=Math.pow(2,8*r)),p};u.prototype.readInt8=function(t,r){return t=t>>>0,r||L(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};u.prototype.readInt16LE=function(t,r){t=t>>>0,r||L(t,2,this.length);var o=this[t]|this[t+1]<<8;return o&32768?o|4294901760:o};u.prototype.readInt16BE=function(t,r){t=t>>>0,r||L(t,2,this.length);var o=this[t+1]|this[t]<<8;return o&32768?o|4294901760:o};u.prototype.readInt32LE=function(t,r){return t=t>>>0,r||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};u.prototype.readInt32BE=function(t,r){return t=t>>>0,r||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};u.prototype.readFloatLE=function(t,r){return t=t>>>0,r||L(t,4,this.length),Te.read(this,t,!0,23,4)};u.prototype.readFloatBE=function(t,r){return t=t>>>0,r||L(t,4,this.length),Te.read(this,t,!1,23,4)};u.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||L(t,8,this.length),Te.read(this,t,!0,52,8)};u.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||L(t,8,this.length),Te.read(this,t,!1,52,8)};function C(e,t,r,o,i,l){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<l)throw new RangeError('"value" argument is out of bounds');if(r+o>e.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,r,o,i){if(t=+t,r=r>>>0,o=o>>>0,!i){var l=Math.pow(2,8*o)-1;C(this,t,r,o,l,0)}var p=1,m=0;for(this[r]=t&255;++m<o&&(p*=256);)this[r+m]=t/p&255;return r+o};u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,r,o,i){if(t=+t,r=r>>>0,o=o>>>0,!i){var l=Math.pow(2,8*o)-1;C(this,t,r,o,l,0)}var p=o-1,m=1;for(this[r+p]=t&255;--p>=0&&(m*=256);)this[r+p]=t/m&255;return r+o};u.prototype.writeUint8=u.prototype.writeUInt8=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,1,255,0),this[r]=t&255,r+1};u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2};u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2};u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4};u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};u.prototype.writeIntLE=function(t,r,o,i){if(t=+t,r=r>>>0,!i){var l=Math.pow(2,8*o-1);C(this,t,r,o,l-1,-l)}var p=0,m=1,d=0;for(this[r]=t&255;++p<o&&(m*=256);)t<0&&d===0&&this[r+p-1]!==0&&(d=1),this[r+p]=(t/m>>0)-d&255;return r+o};u.prototype.writeIntBE=function(t,r,o,i){if(t=+t,r=r>>>0,!i){var l=Math.pow(2,8*o-1);C(this,t,r,o,l-1,-l)}var p=o-1,m=1,d=0;for(this[r+p]=t&255;--p>=0&&(m*=256);)t<0&&d===0&&this[r+p+1]!==0&&(d=1),this[r+p]=(t/m>>0)-d&255;return r+o};u.prototype.writeInt8=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};u.prototype.writeInt16LE=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};u.prototype.writeInt16BE=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};u.prototype.writeInt32LE=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4};u.prototype.writeInt32BE=function(t,r,o){return t=+t,r=r>>>0,o||C(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};function pn(e,t,r,o,i,l){if(r+o>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function un(e,t,r,o,i){return t=+t,r=r>>>0,i||pn(e,t,r,4,34028234663852886e22,-34028234663852886e22),Te.write(e,t,r,o,23,4),r+4}u.prototype.writeFloatLE=function(t,r,o){return un(this,t,r,!0,o)};u.prototype.writeFloatBE=function(t,r,o){return un(this,t,r,!1,o)};function dn(e,t,r,o,i){return t=+t,r=r>>>0,i||pn(e,t,r,8,17976931348623157e292,-17976931348623157e292),Te.write(e,t,r,o,52,8),r+8}u.prototype.writeDoubleLE=function(t,r,o){return dn(this,t,r,!0,o)};u.prototype.writeDoubleBE=function(t,r,o){return dn(this,t,r,!1,o)};u.prototype.copy=function(t,r,o,i){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(o||(o=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<o&&(i=o),i===o||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(o<0||o>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r<i-o&&(i=t.length-r+o);var l=i-o;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,o,i):Uint8Array.prototype.set.call(t,this.subarray(o,i),r),l};u.prototype.fill=function(t,r,o,i){if(typeof t=="string"){if(typeof r=="string"?(i=r,r=0,o=this.length):typeof o=="string"&&(i=o,o=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){var l=t.charCodeAt(0);(i==="utf8"&&l<128||i==="latin1")&&(t=l)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<o)throw new RangeError("Out of range index");if(o<=r)return this;r=r>>>0,o=o===void 0?this.length:o>>>0,t||(t=0);var p;if(typeof t=="number")for(p=r;p<o;++p)this[p]=t;else{var m=u.isBuffer(t)?t:u.from(t,i),d=m.length;if(d===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(p=0;p<o-r;++p)this[p+r]=m[p%d]}return this};var fa=/[^+/0-9A-Za-z-_]/g;function Ta(e){if(e=e.split("=")[0],e=e.trim().replace(fa,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Wt(e,t){t=t||1/0;for(var r,o=e.length,i=null,l=[],p=0;p<o;++p){if(r=e.charCodeAt(p),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&l.push(239,191,189);continue}else if(p+1===o){(t-=3)>-1&&l.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&l.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&l.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;l.push(r)}else if(r<2048){if((t-=2)<0)break;l.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;l.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;l.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return l}function ya(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function ha(e,t){for(var r,o,i,l=[],p=0;p<e.length&&!((t-=2)<0);++p)r=e.charCodeAt(p),o=r>>8,i=r%256,l.push(i),l.push(o);return l}function mn(e){return Vt.toByteArray(Ta(e))}function qe(e,t,r,o){for(var i=0;i<o&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function W(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function jt(e){return e!==e}var xa=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var o=r*16,i=0;i<16;++i)t[o+i]=e[r]+e[i];return t}()});var xn=$e((Ec,hn)=>{n();var k=hn.exports={},H,q;function zt(){throw new Error("setTimeout has not been defined")}function Kt(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?H=setTimeout:H=zt}catch(e){H=zt}try{typeof clearTimeout=="function"?q=clearTimeout:q=Kt}catch(e){q=Kt}})();function fn(e){if(H===setTimeout)return setTimeout(e,0);if((H===zt||!H)&&setTimeout)return H=setTimeout,setTimeout(e,0);try{return H(e,0)}catch(t){try{return H.call(null,e,0)}catch(r){return H.call(this,e,0)}}}function Sa(e){if(q===clearTimeout)return clearTimeout(e);if((q===Kt||!q)&&clearTimeout)return q=clearTimeout,clearTimeout(e);try{return q(e)}catch(t){try{return q.call(null,e)}catch(r){return q.call(this,e)}}}var Z=[],he=!1,pe,je=-1;function wa(){!he||!pe||(he=!1,pe.length?Z=pe.concat(Z):je=-1,Z.length&&Tn())}function Tn(){if(!he){var e=fn(wa);he=!0;for(var t=Z.length;t;){for(pe=Z,Z=[];++je<t;)pe&&pe[je].run();je=-1,t=Z.length}pe=null,he=!1,Sa(e)}}k.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];Z.push(new yn(e,t)),Z.length===1&&!he&&fn(Tn)};function yn(e,t){this.fun=e,this.array=t}yn.prototype.run=function(){this.fun.apply(null,this.array)};k.title="browser";k.browser=!0;k.env={};k.argv=[];k.version="";k.versions={};function Q(){}k.on=Q;k.addListener=Q;k.once=Q;k.off=Q;k.removeListener=Q;k.removeAllListeners=Q;k.emit=Q;k.prependListener=Q;k.prependOnceListener=Q;k.listeners=function(e){return[]};k.binding=function(e){throw new Error("process.binding is not supported")};k.cwd=function(){return"/"};k.chdir=function(e){throw new Error("process.chdir is not supported")};k.umask=function(){return 0}});var a,s,kc,n=y(()=>{a=A(gn()),s=A(xn()),kc=function(e){function t(){var o=this||self;return delete e.prototype.__magic__,o}if(typeof globalThis=="object")return globalThis;if(this)return t();e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:t});var r=__magic__;return r}(Object)});var j=y(()=>{"use strict";n()});var In=y(()=>{"use strict";n()});var vn=y(()=>{"use strict";n()});var An=y(()=>{"use strict";n()});var bn=y(()=>{"use strict";n()});var En=y(()=>{"use strict";n()});var P=y(()=>{"use strict";n()});var kn=y(()=>{"use strict";n()});var Dn=y(()=>{"use strict";n()});var Nn=y(()=>{"use strict";n()});var B=y(()=>{"use strict";n();In();vn();An();j();bn();En();P();kn();Dn();Nn()});var tr,rr=y(()=>{"use strict";n();tr={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."}}});function Mn(e){let t=null;if((e==null?void 0:e.statusCode)in tr){let r=e==null?void 0:e.statusCode,{message:o}=tr[r];t=Ea.includes(r)?_n:o}return{errorMessage:t,defaultErrorMessage:_n}}var _n,Aa,ba,Ea,nr=y(()=>{"use strict";n();rr();_n="Check if the MultiversX app is open on Ledger",Aa=28161,ba=28160,Ea=[Aa,ba]});var Fn=y(()=>{"use strict";n()});var xe,Bn,gl,Un,fl,Vn,Tl,yl,ka,Le=y(()=>{"use strict";n();B();xe={devnet:{id:"devnet",chainId:"D",name:"Devnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://xportal.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://devnet-wallet.multiversx.com",apiAddress:"https://devnet-api.multiversx.com",explorerAddress:"http://devnet-explorer.multiversx.com",apiTimeout:"4000"},testnet:{id:"testnet",chainId:"T",name:"Testnet",egldLabel:"xEGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://xportal.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://testnet-wallet.multiversx.com",apiAddress:"https://testnet-api.multiversx.com",explorerAddress:"http://testnet-explorer.multiversx.com",apiTimeout:"4000"},mainnet:{id:"mainnet",chainId:"1",name:"Mainnet",egldLabel:"EGLD",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://xportal.com/",walletConnectBridgeAddresses:["https://bridge.walletconnect.org"],walletConnectV2RelayAddresses:["wss://relay.walletconnect.com"],walletAddress:"https://wallet.multiversx.com",apiAddress:"https://api.multiversx.com",explorerAddress:"https://explorer.multiversx.com",apiTimeout:"4000"}},{chainId:Bn,egldLabel:gl}=xe["devnet"],{chainId:Un,egldLabel:fl}=xe["testnet"],{chainId:Vn,egldLabel:Tl}=xe["mainnet"],yl={["devnet"]:Bn,["testnet"]:Un,["mainnet"]:Vn},ka={[Bn]:"devnet",[Un]:"testnet",[Vn]:"mainnet"}});var Gn=y(()=>{"use strict";n()});var $n,or=y(()=>{"use strict";n();$n="transaction-status-toast-id"});var z,Wn=y(()=>{"use strict";n();z=require("@multiversx/sdk-web-wallet-provider")});var Hn=y(()=>{"use strict";n()});var qn=y(()=>{"use strict";n()});var ir,ar,jn,Ke,zn,Se,I=y(()=>{"use strict";n();Fn();Le();rr();Gn();or();Wn();Hn();qn();ir=5e4,ar=1e9,jn=1,Ke="logout",zn="login",Se="0"});var Ye,sr=y(()=>{"use strict";n();Ye=()=>Date.now()/1e3});var Kn=y(()=>{"use strict";n()});var Yn=y(()=>{"use strict";n()});var Xn=y(()=>{"use strict";n();sr();Kn();Yn()});var lr={};se(lr,{getItem:()=>Na,localStorageKeys:()=>ue,removeItem:()=>La,setItem:()=>Da});var ue,cr,Da,Na,La,Re=y(()=>{"use strict";n();Xn();ue={loginExpiresAt:"sdk-dapp-login-expires-at",logoutEvent:"sdk-dapp-logout-event"},cr=typeof localStorage!="undefined",Da=({key:e,data:t,expires:r})=>{!cr||localStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Na=e=>{if(!cr)return;let t=localStorage.getItem(String(e));if(!t)return null;let r=JSON.parse(t);return!r||!r.hasOwnProperty("expires")||!r.hasOwnProperty("data")?null:Ye()>=r.expires?(localStorage.removeItem(String(e)),null):r.data},La=e=>{!cr||localStorage.removeItem(String(e))}});var pr={};se(pr,{clear:()=>eo,getItem:()=>Qn,removeItem:()=>Jn,setItem:()=>Zn,storage:()=>Ra});var Zn,Qn,Jn,eo,Ra,to=y(()=>{"use strict";n();Zn=({key:e,data:t,expires:r})=>{sessionStorage.setItem(String(e),JSON.stringify({expires:r,data:t}))},Qn=e=>{let t=sessionStorage.getItem(String(e));if(!t)return null;let r=JSON.parse(t);return!r||!r.hasOwnProperty("expires")||!r.hasOwnProperty("data")?null:Date.now()>=r.expires?(sessionStorage.removeItem(String(e)),null):r.data},Jn=e=>sessionStorage.removeItem(String(e)),eo=()=>sessionStorage.clear(),Ra={setItem:Zn,getItem:Qn,removeItem:Jn,clear:eo}});var we,Xe=y(()=>{"use strict";n();Re();to();we={session:pr,local:lr}});var ur,D,Ze,V=y(()=>{"use strict";n();ur=require("@reduxjs/toolkit");I();D=(0,ur.createAction)(Ke),Ze=(0,ur.createAction)(zn,e=>({payload:e}))});var mr,ro,no,Qe,dr,oo,io,Xl,ao,Zl,Ql,Jl,ep,tp,rp,np,op,Je,et=y(()=>{"use strict";n();mr=require("@multiversx/sdk-core"),ro=require("@reduxjs/toolkit"),no=require("redux-persist");I();Xe();Re();V();Qe={balance:"...",address:"",isGuarded:!1,nonce:0,txCount:0,scrCount:0,claimableRewards:Se},dr={address:"",websocketEvent:null,websocketBatchEvent:null,accounts:{"":Qe},ledgerAccount:null,publicKey:"",walletConnectAccount:null,isAccountLoading:!0,accountLoadingError:null},oo=(0,ro.createSlice)({name:"accountInfoSlice",initialState:dr,reducers:{setAddress:(e,t)=>{let r=t.payload;e.address=r,e.publicKey=new mr.Address(r).hex()},setAccount:(e,t)=>{let r=e.address===t.payload.address;e.accounts={[e.address]:r?t.payload:Qe},e.shard=t.payload.shard,e.isAccountLoading=!1,e.accountLoadingError=null},setAccountNonce:(e,t)=>{let{address:r}=e;e.accounts[r].nonce=t.payload},setAccountShard:(e,t)=>{e.shard=t.payload},setLedgerAccount:(e,t)=>{e.ledgerAccount=t.payload},updateLedgerAccount:(e,t)=>{e.ledgerAccount!=null&&(e.ledgerAccount.index=t.payload.index,e.ledgerAccount.address=t.payload.address)},setWalletConnectAccount:(e,t)=>{e.walletConnectAccount=t.payload},setIsAccountLoading:(e,t)=>{e.isAccountLoading=t.payload,e.accountLoadingError=null},setAccountLoadingError:(e,t)=>{e.accountLoadingError=t.payload,e.isAccountLoading=!1},setWebsocketEvent:(e,t)=>{e.websocketEvent={timestamp:Date.now(),message:t.payload}},setWebsocketBatchEvent:(e,t)=>{e.websocketBatchEvent={timestamp:Date.now(),data:t.payload}}},extraReducers:e=>{e.addCase(D,()=>(we.local.removeItem(ue.loginExpiresAt),dr)),e.addCase(Ze,(t,r)=>{let{address:o}=r.payload;t.address=o,t.publicKey=new mr.Address(o).hex()}),e.addCase(no.REHYDRATE,(t,r)=>{var g;if(!((g=r.payload)!=null&&g.account))return;let{account:o}=r.payload,{address:i,shard:l,accounts:p,publicKey:m}=o;t.address=i,t.shard=l;let d=p&&i in p;t.accounts=d?p:dr.accounts,t.publicKey=m})}}),{setAccount:io,setAddress:Xl,setAccountNonce:ao,setAccountShard:Zl,setLedgerAccount:Ql,updateLedgerAccount:Jl,setWalletConnectAccount:ep,setIsAccountLoading:tp,setAccountLoadingError:rp,setWebsocketEvent:np,setWebsocketBatchEvent:op}=oo.actions,Je=oo.reducer});function Ce(){return new Date().setHours(new Date().getHours()+24)}function Pe(e){we.local.setItem({key:ue.loginExpiresAt,data:e,expires:e})}var gr=y(()=>{"use strict";n();Xe();Re()});var lo,so,po,gp,fp,Tp,yp,hp,xp,uo,Sp,tt,rt=y(()=>{"use strict";n();lo=require("@reduxjs/toolkit");gr();j();V();so={loginMethod:"",walletConnectLogin:null,ledgerLogin:null,tokenLogin:null,walletLogin:null,extensionLogin:null,operaLogin:null,isLoginSessionInvalid:!1},po=(0,lo.createSlice)({name:"loginInfoSlice",initialState:so,reducers:{setLoginMethod:(e,t)=>{e.loginMethod=t.payload},setTokenLogin:(e,t)=>{e.tokenLogin=t.payload},setTokenLoginSignature:(e,t)=>{(e==null?void 0:e.tokenLogin)!=null&&(e.tokenLogin.signature=t.payload)},setWalletLogin:(e,t)=>{e.walletLogin=t.payload},setWalletConnectLogin:(e,t)=>{e.walletConnectLogin=t.payload},setLedgerLogin:(e,t)=>{e.ledgerLogin=t.payload},invalidateLoginSession:e=>{e.isLoginSessionInvalid=!0},setLogoutRoute:(e,t)=>{e.logoutRoute=t.payload}},extraReducers:e=>{e.addCase(D,()=>so),e.addCase(Ze,(t,r)=>{t.loginMethod=r.payload.loginMethod,Pe(Ce())})}}),{setLoginMethod:gp,setWalletConnectLogin:fp,setLedgerLogin:Tp,setTokenLogin:yp,setTokenLoginSignature:hp,setWalletLogin:xp,invalidateLoginSession:uo,setLogoutRoute:Sp}=po.actions,tt=po.reducer});var go,mo,fo,Ap,bp,Ep,kp,nt,ot=y(()=>{"use strict";n();go=require("@reduxjs/toolkit");V();mo={},fo=(0,go.createSlice)({name:"modalsSlice",initialState:mo,reducers:{setTxSubmittedModal:(e,t)=>{e.txSubmittedModal=t.payload},setNotificationModal:(e,t)=>{e.notificationModal=t.payload},clearTxSubmittedModal:e=>{e.txSubmittedModal=void 0},clearNotificationModal:e=>{e.notificationModal=void 0}},extraReducers:e=>{e.addCase(D,()=>mo)}}),{setTxSubmittedModal:Ap,setNotificationModal:bp,clearTxSubmittedModal:Ep,clearNotificationModal:kp}=fo.actions,nt=fo.reducer});var To=y(()=>{"use strict";n()});var yo=y(()=>{"use strict";n();To()});function fr(e){return e[Math.floor(Math.random()*e.length)]}var ho=y(()=>{"use strict";n()});var xo=y(()=>{"use strict";n();yo();ho();nr()});var So,wo,Tr,Ca,Io,Vp,Gp,it,at=y(()=>{"use strict";n();So=require("@reduxjs/toolkit"),wo=A(require("lodash.omit"));xo();Tr={id:"not-configured",chainId:"",name:"NOT CONFIGURED",egldLabel:"",decimals:"18",digits:"4",gasPerDataByte:"1500",walletConnectDeepLink:"",walletConnectBridgeAddress:"",walletConnectV2RelayAddress:"",walletConnectV2ProjectId:"",walletConnectV2Options:{},walletAddress:"",apiAddress:"",explorerAddress:"",apiTimeout:"4000"},Ca={network:Tr,chainID:"-1"},Io=(0,So.createSlice)({name:"appConfig",initialState:Ca,reducers:{initializeNetworkConfig:(e,t)=>{let r=fr(t.payload.walletConnectBridgeAddresses),o=fr(t.payload.walletConnectV2RelayAddresses),i=(0,wo.default)(t.payload,"walletConnectBridgeAddresses","walletConnectV2RelayAddresses");e.network=E(x(x({},e.network),i),{walletConnectBridgeAddress:r,walletConnectV2RelayAddress:o})},setChainID:(e,t)=>{e.chainID=t.payload}}}),{initializeNetworkConfig:Vp,setChainID:Gp}=Io.actions,it=Io.reducer});var vo,yr,Ao,zp,Kp,Yp,st,ct=y(()=>{"use strict";n();vo=require("@reduxjs/toolkit");B();V();yr={isSigning:!1,signedSessions:{}},Ao=(0,vo.createSlice)({name:"signedMessageInfoSliceState",initialState:yr,reducers:{setSignSession:(e,t)=>{let{sessionId:r,signedSession:o,errorMessage:i}=t.payload;i&&(e.errorMessage=i),e.isSigning=o.status==="pending",e.signedSessions[r]=o},setSignSessionState:(e,t)=>x(x({},e),t.payload),clearSignedMessageInfo:()=>yr},extraReducers:e=>{e.addCase(D,()=>yr)}}),{setSignSession:zp,clearSignedMessageInfo:Kp,setSignSessionState:Yp}=Ao.actions,st=Ao.reducer});var Eo,ko,bo,Do,nu,ou,iu,au,su,cu,lt,pt=y(()=>{"use strict";n();Eo=require("@reduxjs/toolkit"),ko=require("redux-persist");or();B();sr();V();bo={customToasts:[],transactionToasts:[],failTransactionToast:null},Do=(0,Eo.createSlice)({name:"toastsSlice",initialState:bo,reducers:{addCustomToast:(e,t)=>{e.customToasts.push(E(x({},t.payload),{type:"custom",toastId:t.payload.toastId||`custom-toast-${e.customToasts.length+1}`}))},removeCustomToast:(e,t)=>{e.customToasts=e.customToasts.filter(r=>r.toastId!==t.payload)},addTransactionToast:(e,t)=>{e.transactionToasts.push({type:"transaction",startTimestamp:Ye(),toastId:t.payload||`custom-toast-${e.transactionToasts.length+1}`})},removeTransactionToast:(e,t)=>{e.transactionToasts=e.transactionToasts.filter(r=>r.toastId!==t.payload)},addFailTransactionToast:(e,t)=>{e.failTransactionToast=E(x({},t.payload),{toastId:$n})},removeFailTransactionToast:e=>{e.failTransactionToast=null}},extraReducers:e=>{e.addCase(D,()=>bo),e.addCase(ko.REHYDRATE,(t,r)=>{var i,l;let o=(l=(i=r.customToasts)==null?void 0:i.filter(p=>!("component"in p)))!=null?l:[];t.customToasts=o})}}),{addCustomToast:nu,removeCustomToast:ou,addTransactionToast:iu,removeTransactionToast:au,addFailTransactionToast:su,removeFailTransactionToast:cu}=Do.actions,lt=Do.reducer});var No,xr,Sr,wr,Pa,hr,Lo,du,mu,gu,ut,dt=y(()=>{"use strict";n();No=require("@reduxjs/toolkit");V();xr="Transaction failed",Sr="Transaction successful",wr="Processing transaction",Pa="Transaction submitted",hr={},Lo=(0,No.createSlice)({name:"transactionsInfo",initialState:hr,reducers:{setTransactionsDisplayInfo(e,t){let{sessionId:r,transactionsDisplayInfo:o}=t.payload;r!=null&&(e[r]={errorMessage:(o==null?void 0:o.errorMessage)||xr,successMessage:(o==null?void 0:o.successMessage)||Sr,processingMessage:(o==null?void 0:o.processingMessage)||wr,submittedMessage:(o==null?void 0:o.submittedMessage)||Pa,transactionDuration:o==null?void 0:o.transactionDuration})},clearTransactionsInfoForSessionId(e,t){t.payload!=null&&delete e[t.payload]},clearTransactionsInfo:()=>hr},extraReducers:e=>{e.addCase(D,()=>hr)}}),{clearTransactionsInfo:du,setTransactionsDisplayInfo:mu,clearTransactionsInfoForSessionId:gu}=Lo.actions,ut=Lo.reducer});function Ro(e){return e!=null&&(Ha(e)||Ya(e))}function mt(e){return e!=null&&(qa(e)||Xa(e))}function gt(e){return e!=null&&(ja(e)||Za(e))}function Co(e){return e!=null&&(za(e)||Qa(e))}function Po(e){return e!=null&&Ka(e)}function Ha(e){return e!=null&&Ma.includes(e)}function qa(e){return e!=null&&Oa.includes(e)}function ja(e){return e!=null&&Fa.includes(e)}function za(e){return e!=null&&Ba.includes(e)}function Ka(e){return e!=null&&Ua.includes(e)}function Ya(e){return e!=null&&Va.includes(e)}function Xa(e){return e!=null&&Ga.includes(e)}function Za(e){return e!=null&&$a.includes(e)}function Qa(e){return e!=null&&Wa.includes(e)}var Ma,Oa,Fa,Ba,Ua,Va,Ga,$a,Wa,vr=y(()=>{"use strict";n();j();Ma=["sent"],Oa=["success"],Fa=["fail","cancelled","timedOut"],Ba=["invalid"],Ua=["timedOut"],Va=["pending"],Ga=["success"],$a=["fail","invalid"],Wa=["not executed"]});var _o,Mo,_e,Ja,Oo,vu,Au,bu,Eu,ku,Du,Nu,Lu,Ru,Cu,ft,Tt=y(()=>{"use strict";n();_o=require("@reduxjs/toolkit"),Mo=require("redux-persist");j();vr();V();_e={signedTransactions:{},transactionsToSign:null,signTransactionsError:null,signTransactionsCancelMessage:null,customTransactionInformationForSessionId:{}},Ja={signWithoutSending:!1,sessionInformation:null,redirectAfterSign:!1},Oo=(0,_o.createSlice)({name:"transactionsSlice",initialState:_e,reducers:{moveTransactionsToSignedState:(e,t)=>{var g,h;let{sessionId:r,transactions:o,errorMessage:i,status:l,redirectRoute:p,customTransactionInformation:m={}}=t.payload,d=((g=e.customTransactionInformationForSessionId)==null?void 0:g[r])||Ja;e.signedTransactions[r]={transactions:o,status:l,errorMessage:i,redirectRoute:p,customTransactionInformation:x(x({},d),m)},((h=e==null?void 0:e.transactionsToSign)==null?void 0:h.sessionId)===r&&(e.transactionsToSign=_e.transactionsToSign)},clearSignedTransaction:(e,t)=>{e.signedTransactions[t.payload]&&delete e.signedTransactions[t.payload]},clearTransactionToSign:e=>{e!=null&&e.transactionsToSign&&(e.transactionsToSign=null)},updateSignedTransaction:(e,t)=>{e.signedTransactions=x(x({},e.signedTransactions),t.payload)},updateSignedTransactions:(e,t)=>{let{sessionId:r,status:o,errorMessage:i,transactions:l}=t.payload;e.signedTransactions[r]!=null&&(e.signedTransactions[r].status=o,i!=null&&(e.signedTransactions[r].errorMessage=i),l!=null&&(e.signedTransactions[r].transactions=l))},updateSignedTransactionStatus:(e,t)=>{var d,g,h,T,w,S,b,O;let{sessionId:r,status:o,errorMessage:i,transactionHash:l,inTransit:p}=t.payload,m=(g=(d=e.signedTransactions)==null?void 0:d[r])==null?void 0:g.transactions;if(m!=null){e.signedTransactions[r].transactions=m.map(M=>M.hash===l?E(x({},M),{status:o,errorMessage:i,inTransit:p}):M);let N=(T=(h=e.signedTransactions[r])==null?void 0:h.transactions)==null?void 0:T.every(M=>mt(M.status)),Ct=(S=(w=e.signedTransactions[r])==null?void 0:w.transactions)==null?void 0:S.every(M=>gt(M.status)),Pt=(O=(b=e.signedTransactions[r])==null?void 0:b.transactions)==null?void 0:O.every(M=>Co(M.status));N&&(e.signedTransactions[r].status="success"),Ct&&(e.signedTransactions[r].status="fail"),Pt&&(e.signedTransactions[r].status="invalid")}},setTransactionsToSign:(e,t)=>{e.transactionsToSign=t.payload;let{sessionId:r,customTransactionInformation:o}=t.payload;e.customTransactionInformationForSessionId[r]=o,e.signTransactionsError=null},clearAllTransactionsToSign:e=>{e.transactionsToSign=_e.transactionsToSign,e.signTransactionsError=null},clearAllSignedTransactions:e=>{e.signedTransactions=_e.signedTransactions},setSignTransactionsError:(e,t)=>{e.signTransactionsError=t.payload},setSignTransactionsCancelMessage:(e,t)=>{e.signTransactionsCancelMessage=t.payload}},extraReducers:e=>{e.addCase(D,()=>_e),e.addCase(Mo.REHYDRATE,(t,r)=>{var p;if(t.signTransactionsCancelMessage=null,!((p=r.payload)!=null&&p.transactions))return;let{signedTransactions:o,customTransactionInformationForSessionId:i}=r.payload.transactions,l=Object.entries(o).reduce((m,[d,g])=>{let h=new Date(d),T=new Date;return T.setHours(T.getHours()+5),T-h>0||(m[d]=g),m},{});i!=null&&(t.customTransactionInformationForSessionId=i),o!=null&&(t.signedTransactions=l)})}}),{updateSignedTransactionStatus:vu,updateSignedTransactions:Au,setTransactionsToSign:bu,clearAllTransactionsToSign:Eu,clearAllSignedTransactions:ku,clearSignedTransaction:Du,clearTransactionToSign:Nu,setSignTransactionsError:Lu,setSignTransactionsCancelMessage:Ru,moveTransactionsToSignedState:Cu}=Oo.actions,ft=Oo.reducer});var Fo,Ar,Bo,Ou,Fu,Bu,Uu,yt,ht=y(()=>{"use strict";n();Fo=require("@reduxjs/toolkit");V();Ar={},Bo=(0,Fo.createSlice)({name:"batchTransactionsSlice",initialState:Ar,reducers:{setBatchTransactions:(e,t)=>{e[t.payload.id]=t.payload},updateBatchTransactions:(e,t)=>{e[t.payload.id]=t.payload},clearBatchTransactions:(e,t)=>{delete e[t.payload.batchId]},clearAllBatchTransactions:()=>Ar},extraReducers:e=>{e.addCase(D,()=>Ar)}}),{setBatchTransactions:Ou,updateBatchTransactions:Fu,clearBatchTransactions:Bu,clearAllBatchTransactions:Uu}=Bo.actions,yt=Bo.reducer});var Vo,Uo,Go,Wu,$o,br=y(()=>{"use strict";n();Vo=require("@reduxjs/toolkit");V();Uo={},Go=(0,Vo.createSlice)({name:"dappConfigSlice",initialState:Uo,reducers:{setDappConfig:(e,t)=>{if(e&&t.payload){let{logoutRoute:r,shouldUseWebViewProvider:o}=t.payload;e.logoutRoute=r,e.shouldUseWebViewProvider=o}else e=t.payload}},extraReducers:e=>{e.addCase(D,()=>Uo)}}),{setDappConfig:Wu}=Go.actions,$o=Go.reducer});var Ie=y(()=>{"use strict";n();et();rt();ot();at();ct();pt();dt();Tt();ht();br()});var Cr=y(()=>{"use strict";n()});var Qo,Zo,Jo,Lm,Rm,Cm,Pm,_m,Mm,ei,ti=y(()=>{"use strict";n();Qo=require("@reduxjs/toolkit");V();Zo={visible:!1,modal:{showHeader:!0,showFooter:!1,headerText:"",footerText:""}},Jo=(0,Qo.createSlice)({name:"dappModalsSlice",initialState:Zo,reducers:{setDappModalVisibility:(e,t)=>{e.visible=t.payload},setDappModalHeaderVisibility:(e,t)=>{e.modal.showHeader=t.payload},setDappModalFooterVisibility:(e,t)=>{e.modal.showFooter=t.payload},setDappModalHeaderText:(e,t)=>{e.modal.headerText=t.payload},setDappModalFooterText:(e,t)=>{e.modal.footerText=t.payload},setDappModalConfig:(e,t)=>{e.modal=x({},t.payload)}},extraReducers:e=>{e.addCase(D,()=>Zo)}}),{setDappModalVisibility:Lm,setDappModalHeaderVisibility:Rm,setDappModalFooterVisibility:Cm,setDappModalHeaderText:Pm,setDappModalFooterText:_m,setDappModalConfig:Mm}=Jo.actions,ei=Jo.reducer});var ri,ss,cs,me,bt=y(()=>{"use strict";n();ri=require("@reduxjs/toolkit");Cr();et();ht();br();ti();rt();ot();at();ct();pt();dt();Tt();ss={["account"]:Je,["dappModal"]:ei,["dappConfig"]:$o,["loginInfo"]:tt,["modals"]:nt,["networkConfig"]:it,["signedMessageInfo"]:st,["toasts"]:lt,["transactionsInfo"]:ut,["transactions"]:ft,["batchTransactions"]:yt},cs=(e={})=>(0,ri.combineReducers)(x(x({},ss),e)),me=cs});var ai={};se(ai,{default:()=>As,sessionStorageReducers:()=>Pr});function J(e,t=[]){return{key:e,version:1,storage:oi.default,blacklist:t}}var _,ni,oi,ls,Me,ps,us,ds,ms,gs,fs,Ts,ys,hs,xs,ii,Ss,Pr,ws,Is,vs,As,si=y(()=>{"use strict";n();_=require("redux-persist"),ni=A(require("redux-persist/lib/storage")),oi=A(require("redux-persist/lib/storage/session"));bt();Ie();et();ht();rt();ot();at();ct();pt();dt();Tt();Cr();ls={persistReducersStorageType:"localStorage"},Me={["account"]:"sdk-dapp-account",["loginInfo"]:"sdk-dapp-login-info",["modals"]:"sdk-dapp-modals",["networkConfig"]:"sdk-dapp-network-config"},ps=J(Me["account"]),us=J(Me["loginInfo"]),ds=J(Me["modals"]),ms=J(Me["networkConfig"]),gs={2:e=>E(x({},e),{networkConfig:Tr})};fs=J("sdk-dapp-transactionsInfo"),Ts=J("sdk-dapp-transactions",["transactionsToSign"]),ys=J("sdk-dapp-batchTransactions",["batchTransactions"]),hs=J("sdk-dapp-toasts"),xs=J("sdk-dapp-signedMessageInfo"),ii={key:"sdk-dapp-store",version:2,storage:ni.default,whitelist:Object.keys(Me),migrate:(0,_.createMigrate)(gs,{debug:!1})},Ss=E(x({},ii),{whitelist:[]}),Pr={["toasts"]:(0,_.persistReducer)(hs,lt),["transactions"]:(0,_.persistReducer)(Ts,ft),["transactionsInfo"]:(0,_.persistReducer)(fs,ut),["batchTransactions"]:(0,_.persistReducer)(ys,yt),["signedMessageInfo"]:(0,_.persistReducer)(xs,st)},ws=E(x({},Pr),{["account"]:(0,_.persistReducer)(ps,Je),["loginInfo"]:(0,_.persistReducer)(us,tt),["modals"]:(0,_.persistReducer)(ds,nt),["networkConfig"]:(0,_.persistReducer)(ms,it)}),Is=ls.persistReducersStorageType==="localStorage",vs=Is?(0,_.persistReducer)(ii,me(Pr)):(0,_.persistReducer)(Ss,me(ws)),As=vs});var ci={};se(ci,{default:()=>bs});var bs,li=y(()=>{"use strict";n();bt();bs=me()});var pi={};se(pi,{default:()=>ks});var U,Es,ks,ui=y(()=>{"use strict";n();U=require("redux-persist"),Es=[U.FLUSH,U.REHYDRATE,U.PAUSE,U.PERSIST,U.PURGE,U.REGISTER],ks=Es});var gi={};se(gi,{default:()=>mi});function mi(e){return(0,di.persistStore)(e)}var di,fi=y(()=>{"use strict";n();di=require("redux-persist")});var wc={};se(wc,{useSignMultipleTransactions:()=>Sc});module.exports=ke(wc);n();var ge=require("react"),fe=require("@multiversx/sdk-core");n();var Ne=require("react");n();var Zt=require("@multiversx/sdk-core"),Qt=A(require("bignumber.js"));j();n();var Sn=require("@multiversx/sdk-core");function Ia(e){try{let t=new Sn.Address(e);return Boolean(t.bech32())}catch(t){return!1}}function ze(e){return(e==null?void 0:e.startsWith("erd"))&&e.length===62&&/^\w+$/.test(e)&&Ia(e)}n();n();function Yt(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>127)return!1;return!0}function De(e){let t=e;try{let r=a.Buffer.from(e,"hex").toString();Yt(r)&&r.length>1&&(t=r)}catch(r){}return t}var Xt={tokenId:"",amount:""},va=e=>e.split("@").map((l,p)=>[2,3].includes(p)?l:De(l));function Jt(e){if(!e)return Xt;let t=e.startsWith("ESDTTransfer"),r=e.startsWith("ESDTNFTTransfer")&&e.includes("@");if(t){let[,o,i]=e.split("@");try{let l=a.Buffer.from(o,"hex").toString("ascii");if(!l)return Xt;let p=new Qt.default("0x"+i.replace("0x","")).toString(10);return{tokenId:l,amount:p}}catch(l){console.error("Error getting token from transaction data",l)}}if(r)try{let[,o,i,l,p]=va(e);if([o,i,l,p].every(m=>Boolean(m))&&ze(new Zt.Address(p).bech32()))return{tokenId:`${o}-${i}`,amount:new Qt.default(l,16).toString(10),collection:o,nonce:i,receiver:new Zt.Address(p).bech32()}}catch(o){}return Xt}n();var er=A(require("bignumber.js"));B();n();var Ln=(e,t)=>{let r=[],o=e.indexOf(t,0);for(;o>=0;)r.push(o),o=e.indexOf(t,o+1);return r};function Rn(e){let t=[],r=0;try{if((e==null?void 0:e.startsWith("MultiESDTNFTTransfer"))&&(e==null?void 0:e.includes("@"))){let[,o,i,...l]=e==null?void 0:e.split("@");if(o){let p=new er.default(i,16).toNumber(),m=0;for(let T=0;T<p;T++){let w={type:"nftTransaction",data:"",receiver:o};for(let S=0;S<3;S++){switch(S){case 0:w.token=De(l[m]),w.data=l[m];break;case 1:{let b=l[m]&&l[m].length?l[m]:"";b&&b!=="00"?w.nonce=b:w.type="esdtTransaction",w.data=`${w.data}@${l[m]}`;break}case 2:w.amount=new er.default(l[m],16).toString(10),w.data=`${w.data}@${l[m]}`;break;default:break}r=m+1,m++}t[T]=w}let d=t.length!==p,g=t.some(T=>Ln(T.data,"@").length!==2),h=t.some(T=>T.data.startsWith("@"));if(d||g||h)return[];if(l[r]){let T=l[r];for(let w=r+1;w<l.length;w++)T+="@"+l[w];t[p]={type:"scCall",data:T,receiver:o}}}}}catch(o){return console.error("failed parsing tx",o),t}return t}var Cn={tokenId:"",amount:"",type:"",multiTxData:"",receiver:""};function Pn({transactions:e}){let[t,r]=(0,Ne.useState)({}),[o,i]=(0,Ne.useState)([]);function l(d,g){r(h=>E(x({},h),{[d]:g}))}function p(d,g){return t==null?Cn:d in t?t[d]:g!=null&&String(g)in t?t[g]:Cn}function m(){if(e&&e.length>0){let d=[];e.forEach((g,h)=>{let T=g.getData().toString(),w=Rn(T);if(w.length>0)w.forEach((S,b)=>{let O={transaction:g,multiTxData:S.data,transactionIndex:b};l(S.data,{tokenId:S.token?S.token:"",amount:S.amount?S.amount:"",type:S.type,nonce:S.nonce?S.nonce:"",multiTxData:S.data,receiver:S.receiver}),d.push(O)});else{let S=g.getData().toString(),{tokenId:b,amount:O}=Jt(S);b&&l(S,{tokenId:b,amount:O,receiver:g.getReceiver().bech32()}),d.push({transaction:g,transactionIndex:h,multiTxData:S})}}),i(d)}}return(0,Ne.useEffect)(()=>{m()},[e==null?void 0:e.length]),{parsedTransactionsByDataField:t,getTxInfoByDataField:p,allTransactions:o}}nr();n();function On({tokenId:e,erdLabel:t}){return Boolean(e&&e!==t)}n();n();n();n();Ie();n();var Wo=A(require("lodash.isequal")),xt=require("reselect");B();var f=(0,xt.createSelectorCreator)(xt.defaultMemoize,Wo.default),St=(e,t)=>e!=""&&Boolean(t);var K=e=>e.account,wt=f(K,e=>e.address),Er=f(K,wt,(e,t)=>t in e.accounts?e.accounts[t]:Qe),ad=f(K,Er,(e,t)=>{let i=e,{accounts:r}=i,o=Ft(i,["accounts"]);return E(x({},o),{account:t})}),sd=f(Er,e=>e.balance),es=f(Er,e=>{var t;return((t=e==null?void 0:e.nonce)==null?void 0:t.valueOf())||0}),cd=f(K,e=>e.shard),ld=f(K,e=>e.ledgerAccount),pd=f(K,e=>e.walletConnectAccount),ud=f(K,e=>e.isAccountLoading),dd=f(K,e=>e.accountLoadingError),md=f(K,e=>e.websocketEvent),gd=f(K,e=>e.websocketBatchEvent);n();var ts=e=>e.dappConfig,yd=f(ts,e=>e.shouldUseWebViewProvider);n();var ie=e=>e.loginInfo,wd=f(ie,e=>e.loginMethod),Id=f(ie,wt,(e,t)=>St(e.loginMethod,t)),vd=f(ie,e=>e.walletConnectLogin),Ad=f(ie,e=>e.ledgerLogin),bd=f(ie,e=>e.walletLogin),Ed=f(ie,e=>e.isLoginSessionInvalid),kd=f(ie,e=>e.tokenLogin),Dd=f(ie,e=>e.logoutRoute);n();var Ho=e=>e.modals,Rd=f(Ho,e=>e.txSubmittedModal),Cd=f(Ho,e=>e.notificationModal);n();var de=e=>e.networkConfig,Md=f(de,e=>e.chainID),Od=f(de,e=>e.network.walletConnectBridgeAddress),Fd=f(de,e=>e.network.walletConnectV2RelayAddress),Bd=f(de,e=>e.network.walletConnectV2ProjectId),Ud=f(de,e=>e.network.walletConnectV2Options),Vd=f(de,e=>e.network.walletConnectDeepLink),kr=f(de,e=>e.network),rs=f(kr,e=>e.apiAddress),qo=f(kr,e=>e.explorerAddress),Gd=f(kr,e=>e.egldLabel);n();var It=e=>e.signedMessageInfo,Hd=f(It,e=>e.isSigning),qd=f(It,e=>e.errorMessage),jd=f(It,e=>{let t=Object.keys(e.signedSessions),r=t.length;return e.signedSessions[t[r-1]]}),zd=f(It,e=>{let t=Object.keys(e.signedSessions),r=t.length;return t.length>0?t[r-1]:""});n();var Dr=e=>e.toasts,Xd=f(Dr,e=>e.customToasts),Zd=f(Dr,e=>e.transactionToasts),Qd=f(Dr,e=>e.failTransactionToast);n();Ie();var jo={errorMessage:xr,successMessage:Sr,processingMessage:wr},ns=e=>e.transactionsInfo,rm=f(ns,(e,t)=>t,(e,t)=>t!=null&&(e==null?void 0:e[Number(t)])||jo);n();n();var Y=require("@multiversx/sdk-core"),Ko=require("@multiversx/sdk-core/out/signature");I();n();var Lr=require("@multiversx/sdk-core/out");n();n();function Nr(e){try{let t=atob(e),r=btoa(t),o=a.Buffer.from(e,"base64").toString(),i=a.Buffer.from(o).toString("base64");if(e===r&&e===i||t===o)return!0}catch(t){return!1}return!1}n();n();var zo=e=>{let t=e!=null?e:"";return Nr(t)?Lr.TransactionPayload.fromEncoded(t):new Lr.TransactionPayload(t)};function Rr(e){var r,o,i;let t=new Y.Transaction(x(x({value:e.value.valueOf(),data:zo(e.data),nonce:e.nonce.valueOf(),receiver:new Y.Address(e.receiver),sender:new Y.Address(e.sender),gasLimit:(r=e.gasLimit.valueOf())!=null?r:ir,gasPrice:(o=e.gasPrice.valueOf())!=null?o:ar,chainID:e.chainID.valueOf(),version:new Y.TransactionVersion((i=e.version)!=null?i:jn)},e.options?{options:new Y.TransactionOptions(e.options)}:{}),e.guardian?{guardian:new Y.Address(e.guardian)}:{}));return e.guardianSignature&&t.applyGuardianSignature({hex:()=>e.guardianSignature||""}),e.signature&&t.applySignature(new Ko.Signature(e.signature)),t}n();n();n();n();var _r=require("@reduxjs/toolkit"),xi=require("react-redux/lib/utils/Subscription");Ie();n();var Yo=A(require("lodash.throttle"));I();Ie();gr();Xe();Re();var os=[Ke],vt=!1,is=(0,Yo.default)(()=>{Pe(Ce())},5e3),Xo=e=>t=>r=>{var d;if(os.includes(r.type))return t(r);let o=e.getState(),i=we.local.getItem(ue.loginExpiresAt);if(!St((d=o==null?void 0:o.loginInfo)==null?void 0:d.loginMethod,o==null?void 0:o.account.address))return t(r);if(i==null)return Pe(Ce());let p=Date.now();return i-p<0&&!vt?setTimeout(()=>{vt=!0,e.dispatch(uo())},1e3):(vt&&(vt=!1),is()),t(r)};n();n();function At(){return typeof sessionStorage!="undefined"}var Ti=At()?(si(),ke(ai)).default:(li(),ke(ci)).default,yi=At()?(ui(),ke(pi)).default:[],hi=At()?(fi(),ke(gi)).default:e=>e;bt();var ee=(0,_r.configureStore)({reducer:Ti,middleware:e=>e({serializableCheck:{ignoredActions:[...yi,ao.type,io.type],ignoredPaths:["payload.nonce","account.account.nonce","providers.accountProvider"]}}).concat(Xo)}),Si=(0,xi.createSubscription)(ee),fg=hi(ee),Tg=(0,_r.configureStore)({reducer:me});n();n();var Ns=require("@multiversx/sdk-core/out");n();I();n();var wi=require("@multiversx/sdk-core");B();n();n();n();n();n();n();n();n();n();P();n();n();P();n();n();n();var Os=A(require("bignumber.js"));I();n();var Ms=require("@multiversx/sdk-core"),Mr=A(require("bignumber.js"));I();n();var Ps=A(require("bignumber.js"));n();Mr.default.config({ROUNDING_MODE:Mr.default.ROUND_FLOOR});n();n();n();I();n();n();n();n();I();n();I();n();var Fs=require("@multiversx/sdk-core");I();n();var Fe=require("@multiversx/sdk-core"),Us=require("@multiversx/sdk-network-providers");I();n();n();var Bs=A(require("bignumber.js"));I();n();I();n();n();n();n();n();n();I();n();I();n();I();n();P();var Gs=["reDelegateRewards","claimRewards","unBond"],$s=["wrapEgld","unwrapEgld"],Ws=["unStake"],Hs=["unDelegate"];n();n();n();I();n();var zs=A(require("bignumber.js"));n();n();P();n();var Ks=A(require("bignumber.js"));n();n();n();n();j();n();var Js=require("@multiversx/sdk-web-wallet-provider");I();n();var Zs=A(require("qs"));n();n();var Br=()=>typeof window!="undefined"&&typeof(window==null?void 0:window.location)!="undefined";n();var gh={search:Br()?window.location.search:"",removeParams:[]};n();n();n();n();P();n();n();n();var ec=A(require("linkifyjs"));n();I();n();var tc=A(require("bignumber.js"));n();B();n();n();j();n();j();n();n();n();P();n();P();n();var rc=A(require("bignumber.js"));I();P();n();P();n();var bi=require("react");B();n();n();P();n();n();var nc=require("@multiversx/sdk-core/out"),oc=A(require("bignumber.js"));P();n();B();n();n();B();var iS=[{label:"Raw",value:"raw"},{label:"Text",value:"text"},{label:"Decimal",value:"decimal"},{label:"Smart",value:"smart"}];n();var Ei=require("react");B();n();var ac=require("react");P();var dS=["create","localMint","ESDTLocalMint","addQuantity","burn","localBurn","ESDTLocalBurn","wipe","writeLog","signalError"];vr();var Dt=e=>e.transactions,Be=f(Dt,e=>e.signedTransactions),ZS=f(Dt,e=>e.signTransactionsError),QS=f(Dt,e=>e.signTransactionsCancelMessage),Nt=e=>t=>Object.entries(t).reduce((r,[o,i])=>(e(i.status)&&(r[o]=i),r),{}),JS=f(Be,Nt(Ro)),ew=f(Be,Nt(mt)),tw=f(Be,Nt(gt)),rw=f(Be,Nt(Po)),sc=f(Dt,e=>{var t;return(e==null?void 0:e.transactionsToSign)==null?null:E(x({},e.transactionsToSign),{transactions:((t=e==null?void 0:e.transactionsToSign)==null?void 0:t.transactions.map(r=>Rr(r)))||[]})}),nw=f(Be,(e,t)=>t,(e,t)=>t!=null?(e==null?void 0:e[t])||{}:{});n();n();var ki=require("react"),ve=require("react-redux");var cc={store:ee,subscription:Si},Ur=(0,ki.createContext)(cc),Sw=(0,ve.createStoreHook)(Ur),ww=(0,ve.createDispatchHook)(Ur),lc=(0,ve.createSelectorHook)(Ur);n();n();var uc=A(require("axios"));n();n();n();n();n();n();var Vr=({transactions:e,isGuarded:t})=>t?e.every(o=>Boolean(o.getGuardianSignature().toString("hex"))):!0;n();n();n();Le();n();var dc=A(require("axios"));n();var mc=A(require("axios"));n();Le();n();Le();I();n();var Tc=require("@multiversx/sdk-extension-provider"),yc=require("@multiversx/sdk-hw-provider"),hc=require("@multiversx/sdk-opera-provider"),xc=require("@multiversx/sdk-web-wallet-provider");I();j();n();n();n();var re=e=>`Unable to perform ${e}, Provider not initialized`,Lt=class{init(){return Promise.resolve(!1)}login(t){throw new Error(re(`login with options: ${t}`))}logout(t){throw new Error(re(`logout with options: ${t}`))}getAddress(){throw new Error(re("getAddress"))}isInitialized(){return!1}isConnected(){return Promise.resolve(!1)}sendTransaction(t,r){throw new Error(re(`sendTransaction with transactions: ${t} options: ${r}`))}signTransaction(t,r){throw new Error(re(`signTransaction with transactions: ${t} options: ${r}`))}signTransactions(t,r){throw new Error(re(`signTransactions with transactions: ${t} options: ${r}`))}signMessage(t,r){throw new Error(re(`signTransactions with ${t} and options ${r}`))}sendCustomMessage({method:t,params:r}){throw new Error(re(`sendCustomMessage with method: ${t} params: ${r}`))}sendCustomRequest(t){throw new Error(re(`sendSessionEvent with options: ${t}`))}ping(){return Promise.resolve(!1)}},fc=new Lt;var Rt={};function Sc({isLedger:e=!1,transactionsToSign:t,egldLabel:r,address:o,activeGuardianAddress:i,hasGuardianScreen:l,onCancel:p,onSignTransaction:m,onTransactionsSignError:d,onTransactionsSignSuccess:g,onGetScamAddressData:h}){var Hr,qr,jr;let T=Boolean(i),[w,S]=(0,ge.useState)(0),[b,O]=(0,ge.useState)(),[N,Ct]=(0,ge.useState)(null),[Pt,M]=(0,ge.useState)(!1),{getTxInfoByDataField:Di,allTransactions:ne}=Pn({transactions:i?t==null?void 0:t.map(v=>{v.setSender(fe.Address.fromBech32(o)),v.setVersion(fe.TransactionVersion.withTxOptions()),v.setGuardian(fe.Address.fromBech32(i));let R=x({guarded:!0},e?{hashSign:!0}:{});return v.setOptions(fe.TransactionOptions.withOptions(R)),v}):t}),_t=w===ne.length-1;(0,ge.useEffect)(()=>{Ni()},[w,ne]);function Ni(){return G(this,null,function*(){var zr;let v=ne[w];if(v==null)return;let{transaction:R,multiTxData:Ae}=v,Ue=R.getData().toString(),Mt=Di(R.getData().toString(),Ae),{tokenId:oe}=Mt,ae=R.getReceiver().toString(),be=o!==ae,Oi=ae in Rt;if(be&&!Oi&&h!=null){let Ve=yield h(ae);Rt=x(x({},Rt),Ve!=null&&Ve.scamInfo?{[ae]:Ve.scamInfo}:{})}let Fi=Boolean(oe&&On({tokenId:oe,erdLabel:r}));Ct({transaction:R,receiverScamInfo:((zr=Rt[ae])==null?void 0:zr.info)||null,transactionTokenInfo:Mt,isTokenTransaction:Fi,dataField:Ue})})}function Gr(){S(0),O(void 0),M(!1)}function $r(){return G(this,null,function*(){if(N==null)return;M(e);let v;try{v=yield m(N.transaction)}catch(oe){console.error(oe,"sign error");let{message:ae}=oe,be=e?Mn(oe).errorMessage:null;return Gr(),d(be!=null?be:ae)}let R={[w]:v},Ae=b?x(x({},b),R):R;if(O(Ae),!_t){S(oe=>oe+1),M(!1);return}if(!Ae)return;let Ue=Object.values(Ae);!Vr({isGuarded:T,transactions:Ue})&&l||(g(Ue),Gr())})}function Li(){try{if(N==null)return;if(N.transaction.getSignature().toString("hex")&&!_t){S(R=>R+1);return}$r()}catch(v){$r()}}let Ri=w===0;function Ci(){Ri?p==null||p():S(v=>v-1)}let Wr=Boolean(((Hr=N==null?void 0:N.transactionTokenInfo)==null?void 0:Hr.type)&&((qr=N==null?void 0:N.transactionTokenInfo)==null?void 0:qr.multiTxData)&&!(N!=null&&N.dataField.endsWith((jr=N==null?void 0:N.transactionTokenInfo)==null?void 0:jr.multiTxData)));function Pi(){Wr?S(v=>v+1):Li()}function _i(){S(v=>{let R=v+1;return R>(ne==null?void 0:ne.length)?v:R})}function Mi(){S(v=>{let R=v-1;return R<0?v:R})}return{allTransactions:ne,onSignTransaction:Pi,onNext:_i,onPrev:Mi,waitingForDevice:Pt,onAbort:Ci,isLastTransaction:_t,isFirstTransaction:w===0,hasMultipleTransactions:ne.length>1,shouldContinueWithoutSigning:Wr,currentStep:w,signedTransactions:b,setSignedTransactions:O,currentTransaction:N}}0&&(module.exports={useSignMultipleTransactions});
2
2
  /*!
3
3
  * The buffer module from node.js, for the browser.
4
4
  *