From d2db34e0b533f1802797752dc73378648d49eac2 Mon Sep 17 00:00:00 2001 From: Yeferson Licet Date: Thu, 11 Jul 2024 14:02:57 -0300 Subject: [PATCH 1/7] Adding android lib --- .gitignore | 7 +- bun.lockb | Bin 182320 -> 182848 bytes .../android-web3-provider/app/build.gradle | 50 +++++ .../app/proguard-rules.pro | 21 +++ .../app/src/main/AndroidManifest.xml | 20 ++ .../src/main/java/com/trust/web3/demo/App.kt | 9 + .../java/com/trust/web3/demo/DAppMethod.kt | 29 +++ .../java/com/trust/web3/demo/MainActivity.kt | 87 +++++++++ .../main/java/com/trust/web3/demo/Numeric.kt | 65 +++++++ .../com/trust/web3/demo/WebAppInterface.kt | 154 ++++++++++++++++ .../com/trust/web3/demo/WebViewExtension.kt | 29 +++ .../drawable-v24/ic_launcher_foreground.xml | 30 +++ .../res/drawable/ic_launcher_background.xml | 170 +++++++++++++++++ .../app/src/main/res/layout/activity_main.xml | 15 ++ .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 + .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 + .../app/src/main/res/values/colors.xml | 10 + .../app/src/main/res/values/strings.xml | 3 + .../app/src/main/res/values/themes.xml | 16 ++ packages/android-web3-provider/build.gradle | 35 ++++ .../android-web3-provider/gradle.properties | 23 +++ .../gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 54708 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 + packages/android-web3-provider/gradlew | 172 ++++++++++++++++++ packages/android-web3-provider/index.ts | 33 ++++ .../android-web3-provider/lib/build.gradle | 55 ++++++ .../lib/proguard-rules.pro | 21 +++ .../lib/src/main/AndroidManifest.xml | 1 + .../lib/src/main/res/raw/trust_min.js | 34 ++++ packages/android-web3-provider/package.json | 30 +++ .../android-web3-provider/rollup.config.js | 50 +++++ .../android-web3-provider/settings.gradle | 3 + packages/android-web3-provider/tsconfig.json | 9 + 33 files changed, 1195 insertions(+), 2 deletions(-) create mode 100644 packages/android-web3-provider/app/build.gradle create mode 100644 packages/android-web3-provider/app/proguard-rules.pro create mode 100644 packages/android-web3-provider/app/src/main/AndroidManifest.xml create mode 100644 packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/App.kt create mode 100644 packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/DAppMethod.kt create mode 100644 packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/MainActivity.kt create mode 100644 packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/Numeric.kt create mode 100644 packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/WebAppInterface.kt create mode 100644 packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/WebViewExtension.kt create mode 100644 packages/android-web3-provider/app/src/main/res/drawable-v24/ic_launcher_foreground.xml create mode 100644 packages/android-web3-provider/app/src/main/res/drawable/ic_launcher_background.xml create mode 100644 packages/android-web3-provider/app/src/main/res/layout/activity_main.xml create mode 100644 packages/android-web3-provider/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 packages/android-web3-provider/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 packages/android-web3-provider/app/src/main/res/values/colors.xml create mode 100644 packages/android-web3-provider/app/src/main/res/values/strings.xml create mode 100644 packages/android-web3-provider/app/src/main/res/values/themes.xml create mode 100644 packages/android-web3-provider/build.gradle create mode 100644 packages/android-web3-provider/gradle.properties create mode 100644 packages/android-web3-provider/gradle/wrapper/gradle-wrapper.jar create mode 100644 packages/android-web3-provider/gradle/wrapper/gradle-wrapper.properties create mode 100755 packages/android-web3-provider/gradlew create mode 100644 packages/android-web3-provider/index.ts create mode 100644 packages/android-web3-provider/lib/build.gradle create mode 100644 packages/android-web3-provider/lib/proguard-rules.pro create mode 100644 packages/android-web3-provider/lib/src/main/AndroidManifest.xml create mode 100644 packages/android-web3-provider/lib/src/main/res/raw/trust_min.js create mode 100644 packages/android-web3-provider/package.json create mode 100644 packages/android-web3-provider/rollup.config.js create mode 100644 packages/android-web3-provider/settings.gradle create mode 100644 packages/android-web3-provider/tsconfig.json diff --git a/.gitignore b/.gitignore index f33affd4..1a785c0f 100644 --- a/.gitignore +++ b/.gitignore @@ -173,5 +173,8 @@ dist # Finder (MacOS) folder config .DS_Store - - +packages/android-web3-provider/build +packages/android-web3-provider/app/build/* +packages/android-web3-provider/lib/build/* +packages/android-web3-provider/.gradle +local.properties \ No newline at end of file diff --git a/bun.lockb b/bun.lockb index a08858a2ca6070e5fffaa956b781b85051ff6f37..74418988aec7ae9d2acf5abf1ac52947f753051d 100755 GIT binary patch delta 26301 zcmeHvd2|)U^8fTCH@QQAuqQV+I}q0F%MAo_*<}laoq#L}SqNk!37aelDky>vVSs)C z5rPN^il7K8q6mth@&iPHusm4=R2D%L6a>DXn(j%W!aMK0^F7}`e#be~t*+|o>gww1 zWqL?&e!*kcVviTXT8s$KSvj#mv)@xPewfp-*6D`5Ui@a0-}DwsJ6!nY*@Ol6Uf#T4 zRp>dfa7aMOPhT;E5I;VOQu+fJb%8UAa*QQItB!&&imS zM_Q(VCi$@v7XoXb(=##(LbHpMjwt5|Iv!ZdL1Lo2U{nB8!Owwf1Gk1iO<;H6rog|s z2!3`^XjV>snz8^|N&Xu69>CdIdHIDIigI4knb~>ip%V*~y%3`O9eOJBD%pV~QAZ#} zX7@%Fq-A`@)JbIiZqSsUnUh*voRO}43^_74qiAArc21F!Q8ZyX`gO^2aOSQ!AE03HUyx3&CgrMtVlt#4HHp7E!f|GDokgdTAfS zCaR9>k*ZhF@Oq-jV^fPlVNg~wXfm!bYC`>`g?hFcP{N>&G+qLidTE%_E{YNihiAY2QWEL;yv?w}q^h5K$H_H3Y!15+KQ+e$z~Md=z;)C9PzpU_i^ zXrwxeGIA$n6e@}lHK5I)A-!o+6`jL|6HrKXJry9z><1<~tuS>=2E5!MQ1IsfQ-B=@ zrhGGC(z6SV$XXaA_y?hnyd45tpsI8}Y$F?UfKjwGQ?{iWFzBA8I~$9FtAJ6a^du7w z&P^>UN-fM%p2$yE=vj&uQlruk)?~os{KE9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w5!H&c5fq?X>sQw?NbTkVO}F zt@K_!r`|5mbXK_ghPh5b?)Be~gRTMkyS|?s$-bzL%W)JH+w<^Bw)x@Q(>34PuCN18 zD=X|;Yo)i_!Z>bF`eD|ljnZxBp*G6?d2Z_tbMF4bZ2l3YgPZvyPJjFnneD}XI--1| zJ`~IrY~B&22{Rp4qTEIw;ezXqaKYz~Dvd+?Vw7}PaRQTN#+yq0y(DPkJ*fUNlK%CZ G_P+oSHyAAd diff --git a/packages/android-web3-provider/app/build.gradle b/packages/android-web3-provider/app/build.gradle new file mode 100644 index 00000000..7cc31b7e --- /dev/null +++ b/packages/android-web3-provider/app/build.gradle @@ -0,0 +1,50 @@ +plugins { + id 'com.android.application' + id 'kotlin-android' +} + +android { + namespace 'com.trust.web3.demo' + compileSdkVersion 30 + buildToolsVersion "30.0.3" + + defaultConfig { + applicationId "com.trust.web3.demo" + minSdkVersion 23 + targetSdkVersion 30 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = '1.8' + } +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + implementation 'androidx.core:core-ktx:1.2.0' + implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + + implementation "com.louiscad.splitties:splitties-alertdialog-material:3.0.0" + implementation "com.trustwallet:wallet-core:2.9.7" + + implementation 'com.github.trustwallet:trust-web3-provider:main' + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' +} \ No newline at end of file diff --git a/packages/android-web3-provider/app/proguard-rules.pro b/packages/android-web3-provider/app/proguard-rules.pro new file mode 100644 index 00000000..481bb434 --- /dev/null +++ b/packages/android-web3-provider/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/packages/android-web3-provider/app/src/main/AndroidManifest.xml b/packages/android-web3-provider/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..019ae2d9 --- /dev/null +++ b/packages/android-web3-provider/app/src/main/AndroidManifest.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/App.kt b/packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/App.kt new file mode 100644 index 00000000..4ed5f201 --- /dev/null +++ b/packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/App.kt @@ -0,0 +1,9 @@ +package com.trust.web3.demo + +import android.app.Application + +class App: Application() { + init { + System.loadLibrary("TrustWalletCore") + } +} \ No newline at end of file diff --git a/packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/DAppMethod.kt b/packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/DAppMethod.kt new file mode 100644 index 00000000..9a335695 --- /dev/null +++ b/packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/DAppMethod.kt @@ -0,0 +1,29 @@ +package com.trust.web3.demo + +enum class DAppMethod { + SIGNTRANSACTION, + SIGNPERSONALMESSAGE, + SIGNMESSAGE, + SIGNTYPEDMESSAGE, + ECRECOVER, + REQUESTACCOUNTS, + WATCHASSET, + ADDETHEREUMCHAIN, + UNKNOWN; + + companion object { + fun fromValue(value: String): DAppMethod { + return when (value) { + "signTransaction" -> SIGNTRANSACTION + "signPersonalMessage" -> SIGNPERSONALMESSAGE + "signMessage" -> SIGNMESSAGE + "signTypedMessage" -> SIGNTYPEDMESSAGE + "ecRecover" -> ECRECOVER + "requestAccounts" -> REQUESTACCOUNTS + "watchAsset" -> WATCHASSET + "addEthereumChain" -> ADDETHEREUMCHAIN + else -> UNKNOWN + } + } + } +} diff --git a/packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/MainActivity.kt b/packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/MainActivity.kt new file mode 100644 index 00000000..9c22c6c3 --- /dev/null +++ b/packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/MainActivity.kt @@ -0,0 +1,87 @@ +package com.trust.web3.demo + +import android.graphics.Bitmap +import android.net.http.SslError +import android.os.Bundle +import android.webkit.SslErrorHandler +import android.webkit.WebView +import android.webkit.WebViewClient +import androidx.appcompat.app.AppCompatActivity +import com.example.namespace.R + +class MainActivity : AppCompatActivity() { + companion object { + private const val DAPP_URL = "https://www.magiceden.io/me" + private const val CHAIN_ID = 56 + private const val RPC_URL = "https://bsc-dataseed2.binance.org" + } + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + setContentView(R.layout.activity_main) + + val provderJs = loadProviderJs() + val initJs = loadInitJs( + CHAIN_ID, + RPC_URL + ) + WebView.setWebContentsDebuggingEnabled(true) + val webview: WebView = findViewById(R.id.webview) + webview.settings.run { + javaScriptEnabled = true + domStorageEnabled = true + } + WebAppInterface(this, webview, DAPP_URL).run { + webview.addJavascriptInterface(this, "_tw_") + + val webViewClient = object : WebViewClient() { + override fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?) { + super.onPageStarted(view, url, favicon) + view?.evaluateJavascript(provderJs, null) + view?.evaluateJavascript(initJs, null) + } + + override fun onReceivedSslError( + view: WebView?, + handler: SslErrorHandler?, + error: SslError? + ) { + // Ignore SSL certificate errors + handler?.proceed() + println(error.toString()) + } + } + webview.webViewClient = webViewClient + webview.loadUrl(DAPP_URL) + } + } + + private fun loadProviderJs(): String { + return resources.openRawResource(R.raw.trust_min).bufferedReader().use { it.readText() } + } + + private fun loadInitJs(chainId: Int, rpcUrl: String): String { + val source = """ + (function() { + var config = { + ethereum: { + chainId: $chainId, + rpcUrl: "$rpcUrl" + }, + solana: { + cluster: "mainnet-beta", + }, + isDebug: true + }; + trustwallet.ethereum = new trustwallet.Provider(config); + trustwallet.solana = new trustwallet.SolanaProvider(config); + trustwallet.postMessage = (json) => { + window._tw_.postMessage(JSON.stringify(json)); + } + window.ethereum = trustwallet.ethereum; + })(); + """ + return source + } +} diff --git a/packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/Numeric.kt b/packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/Numeric.kt new file mode 100644 index 00000000..dfb25a98 --- /dev/null +++ b/packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/Numeric.kt @@ -0,0 +1,65 @@ +package com.trust.web3.demo + +import kotlin.experimental.and + +object Numeric { + fun containsHexPrefix(input: String): Boolean { + return input.length > 1 && input[0] == '0' && input[1] == 'x' + } + + fun cleanHexPrefix(input: String): String { + return if (containsHexPrefix(input)) { + input.substring(2) + } else { + input + } + } + + fun hexStringToByteArray(input: String): ByteArray { + val cleanInput = cleanHexPrefix(input) + + val len = cleanInput.length + + if (len == 0) { + return byteArrayOf() + } + + val data: ByteArray + val startIdx: Int + if (len % 2 != 0) { + data = ByteArray(len / 2 + 1) + data[0] = Character.digit(cleanInput[0], 16).toByte() + startIdx = 1 + } else { + data = ByteArray(len / 2) + startIdx = 0 + } + + var i = startIdx + while (i < len) { + data[(i + 1) / 2] = + ((Character.digit(cleanInput[i], 16) shl 4) + Character.digit( + cleanInput[i + 1], + 16 + )).toByte() + i += 2 + } + return data + } + + fun toHexString(input: ByteArray?, offset: Int, length: Int, withPrefix: Boolean): String { + val stringBuilder = StringBuilder() + if (withPrefix) { + stringBuilder.append("0x") + } + for (i in offset until offset + length) { + stringBuilder.append(String.format("%02x", input!![i] and 0xFF.toByte())) + } + + return stringBuilder.toString() + } + + fun toHexString(input: ByteArray?): String { + return toHexString(input, 0, input!!.size, true) + } +} diff --git a/packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/WebAppInterface.kt b/packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/WebAppInterface.kt new file mode 100644 index 00000000..92c7d2e3 --- /dev/null +++ b/packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/WebAppInterface.kt @@ -0,0 +1,154 @@ +package com.trust.web3.demo + +import android.content.Context +import android.webkit.JavascriptInterface +import android.webkit.WebView +import org.json.JSONObject +import splitties.alertdialog.appcompat.cancelButton +import splitties.alertdialog.appcompat.message +import splitties.alertdialog.appcompat.okButton +import splitties.alertdialog.appcompat.title +import splitties.alertdialog.material.materialAlertDialog +import wallet.core.jni.CoinType +import wallet.core.jni.Curve +import wallet.core.jni.PrivateKey + +class WebAppInterface( + private val context: Context, + private val webView: WebView, + private val dappUrl: String +) { + private val privateKey = + PrivateKey("0x4646464646464646464646464646464646464646464646464646464646464646".toHexByteArray()) + private val addr = CoinType.ETHEREUM.deriveAddress(privateKey).toLowerCase() + private val pubKey = CoinType.SOLANA.deriveAddress(privateKey) + + @JavascriptInterface + fun postMessage(json: String) { + val obj = JSONObject(json) + println(obj) + val id = obj.getLong("id") + val method = DAppMethod.fromValue(obj.getString("name")) + val network = obj.getString("network") + when (method) { + DAppMethod.REQUESTACCOUNTS -> { + context.materialAlertDialog { + title = "Request Accounts" + message = "${dappUrl} requests your address" + okButton { + val address = if (network == "solana") pubKey else addr + val setAddress = "window.$network.setAddress(\"$address\");" + val callback = "window.$network.sendResponse($id, [\"$address\"])" + webView.post { + webView.evaluateJavascript(setAddress) { + // ignore + } + webView.evaluateJavascript(callback) { value -> + println(value) + } + } + } + cancelButton() + }.show() + } + DAppMethod.SIGNMESSAGE -> { + val data = extractMessage(obj) + if (network == "ethereum") + handleSignMessage(id, data, addPrefix = false) + else + handleSignSolanaMessage(id, data) + } + DAppMethod.SIGNPERSONALMESSAGE -> { + val data = extractMessage(obj) + handleSignMessage(id, data, addPrefix = true) + } + DAppMethod.SIGNTYPEDMESSAGE -> { + val data = extractMessage(obj) + val raw = extractRaw(obj) + handleSignTypedMessage(id, data, raw) + } + else -> { + context.materialAlertDialog { + title = "Error" + message = "$method not implemented" + okButton { + } + }.show() + } + } + } + + private fun extractMessage(json: JSONObject): ByteArray { + val param = json.getJSONObject("object") + val data = param.getString("data") + return Numeric.hexStringToByteArray(data) + } + + private fun extractRaw(json: JSONObject): String { + val param = json.getJSONObject("object") + return param.getString("raw") + } + + private fun handleSignMessage(id: Long, data: ByteArray, addPrefix: Boolean) { + context.materialAlertDialog { + title = "Sign Ethereum Message" + message = if (addPrefix) String(data, Charsets.UTF_8) else Numeric.toHexString(data) + cancelButton { + webView.sendError("ethereum","Cancel", id) + } + okButton { + webView.sendResult("ethereum", signEthereumMessage(data, addPrefix), id) + } + }.show() + } + + private fun handleSignSolanaMessage(id: Long, data: ByteArray) { + context.materialAlertDialog { + title = "Sign Solana Message" + message = String(data, Charsets.UTF_8) ?: Numeric.toHexString(data) + cancelButton { + webView.sendError("solana", "Cancel", id) + } + okButton { + webView.sendResult("solana", signSolanaMessage(data), id) + } + }.show() + } + + private fun handleSignTypedMessage(id: Long, data: ByteArray, raw: String) { + context.materialAlertDialog { + title = "Sign Typed Message" + message = raw + cancelButton { + webView.sendError("ethereum","Cancel", id) + } + okButton { + webView.sendResult("ethereum", signEthereumMessage(data, false), id) + } + }.show() + } + + private fun signEthereumMessage(message: ByteArray, addPrefix: Boolean): String { + var data = message + if (addPrefix) { + val messagePrefix = "\u0019Ethereum Signed Message:\n" + val prefix = (messagePrefix + message.size).toByteArray() + val result = ByteArray(prefix.size + message.size) + System.arraycopy(prefix, 0, result, 0, prefix.size) + System.arraycopy(message, 0, result, prefix.size, message.size) + data = wallet.core.jni.Hash.keccak256(result) + } + + val signatureData = privateKey.sign(data, Curve.SECP256K1) + .apply { + (this[this.size - 1]) = (this[this.size - 1] + 27).toByte() + } + return Numeric.toHexString(signatureData) + } + + private fun signSolanaMessage(message: ByteArray): String { + val signature = privateKey.sign(message, Curve.ED25519) + return Numeric.toHexString(signature) + + } +} diff --git a/packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/WebViewExtension.kt b/packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/WebViewExtension.kt new file mode 100644 index 00000000..02103716 --- /dev/null +++ b/packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/WebViewExtension.kt @@ -0,0 +1,29 @@ +package com.trust.web3.demo + +import android.webkit.WebView + +fun WebView.sendError(network: String, message: String, methodId: Long) { + val script = "window.$network.sendError($methodId, \"$message\")" + this.post { + this.evaluateJavascript(script) {} + } +} + +fun WebView.sendResult(network: String, message: String, methodId: Long) { + val script = "window.$network.sendResponse($methodId, \"$message\")" + this.post { + this.evaluateJavascript(script) {} + } +} + +fun WebView.sendResults(network: String, messages: List, methodId: Long) { + val message = messages.joinToString(separator = ",") + val script = "window.$network.sendResponse($methodId, \"$message\")" + this.post { + this.evaluateJavascript(script) {} + } +} + +fun String.toHexByteArray(): ByteArray { + return Numeric.hexStringToByteArray(this) +} diff --git a/packages/android-web3-provider/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/packages/android-web3-provider/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 00000000..2b068d11 --- /dev/null +++ b/packages/android-web3-provider/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/packages/android-web3-provider/app/src/main/res/drawable/ic_launcher_background.xml b/packages/android-web3-provider/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 00000000..07d5da9c --- /dev/null +++ b/packages/android-web3-provider/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/android-web3-provider/app/src/main/res/layout/activity_main.xml b/packages/android-web3-provider/app/src/main/res/layout/activity_main.xml new file mode 100644 index 00000000..5c9c82fd --- /dev/null +++ b/packages/android-web3-provider/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,15 @@ + + + + + + \ No newline at end of file diff --git a/packages/android-web3-provider/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/packages/android-web3-provider/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 00000000..eca70cfe --- /dev/null +++ b/packages/android-web3-provider/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/packages/android-web3-provider/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/packages/android-web3-provider/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 00000000..eca70cfe --- /dev/null +++ b/packages/android-web3-provider/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/packages/android-web3-provider/app/src/main/res/values/colors.xml b/packages/android-web3-provider/app/src/main/res/values/colors.xml new file mode 100644 index 00000000..f8c6127d --- /dev/null +++ b/packages/android-web3-provider/app/src/main/res/values/colors.xml @@ -0,0 +1,10 @@ + + + #FFBB86FC + #FF6200EE + #FF3700B3 + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/packages/android-web3-provider/app/src/main/res/values/strings.xml b/packages/android-web3-provider/app/src/main/res/values/strings.xml new file mode 100644 index 00000000..2112ca5a --- /dev/null +++ b/packages/android-web3-provider/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + Web3 Provider Demo + \ No newline at end of file diff --git a/packages/android-web3-provider/app/src/main/res/values/themes.xml b/packages/android-web3-provider/app/src/main/res/values/themes.xml new file mode 100644 index 00000000..eebc2d04 --- /dev/null +++ b/packages/android-web3-provider/app/src/main/res/values/themes.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/packages/android-web3-provider/build.gradle b/packages/android-web3-provider/build.gradle new file mode 100644 index 00000000..5dc5397e --- /dev/null +++ b/packages/android-web3-provider/build.gradle @@ -0,0 +1,35 @@ + + +buildscript { + ext.kotlin_version = "1.8.0" // Update to a compatible Kotlin version + repositories { + google() + mavenCentral() + maven { url 'https://jitpack.io' } + } + dependencies { + classpath 'com.android.tools.build:gradle:8.0.2' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + mavenCentral() + maven { url 'https://jitpack.io' } + maven { + url = uri("https://maven.pkg.github.com/trustwallet/wallet-core") + Properties properties = new Properties() + properties.load(project.rootProject.file('local.properties').newDataInputStream()) + credentials { + username = properties.getProperty("gpr.user") + password = properties.getProperty("gpr.key") + } + } + } +} + +task clean(type: Delete) { + delete rootProject.buildDir +} \ No newline at end of file diff --git a/packages/android-web3-provider/gradle.properties b/packages/android-web3-provider/gradle.properties new file mode 100644 index 00000000..c7b6913b --- /dev/null +++ b/packages/android-web3-provider/gradle.properties @@ -0,0 +1,23 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app"s APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Automatically convert third-party libraries to use AndroidX +android.enableJetifier=true +# Kotlin code style for this project: "official" or "obsolete": +kotlin.code.style=official +# Disable generation of the BuildConfig class +android.defaults.buildfeatures.buildconfig=false diff --git a/packages/android-web3-provider/gradle/wrapper/gradle-wrapper.jar b/packages/android-web3-provider/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..7a3265ee94c0ab25cf079ac8ccdf87f41d455d42 GIT binary patch literal 54708 zcmagFV|ZrKvM!pAZQHhO+qP}9lTNj?q^^Y^VFp)SH8qbSJ)2BQ2girk4u zvO<3q)c?v~^Z#E_K}1nTQbJ9gQ9<%vVRAxVj)8FwL5_iTdUB>&m3fhE=kRWl;g`&m z!W5kh{WsV%fO*%je&j+Lv4xxK~zsEYQls$Q-p&dwID|A)!7uWtJF-=Tm1{V@#x*+kUI$=%KUuf2ka zjiZ{oiL1MXE2EjciJM!jrjFNwCh`~hL>iemrqwqnX?T*MX;U>>8yRcZb{Oy+VKZos zLiFKYPw=LcaaQt8tj=eoo3-@bG_342HQ%?jpgAE?KCLEHC+DmjxAfJ%Og^$dpC8Xw zAcp-)tfJm}BPNq_+6m4gBgBm3+CvmL>4|$2N$^Bz7W(}fz1?U-u;nE`+9`KCLuqg} zwNstNM!J4Uw|78&Y9~9>MLf56to!@qGkJw5Thx%zkzj%Ek9Nn1QA@8NBXbwyWC>9H z#EPwjMNYPigE>*Ofz)HfTF&%PFj$U6mCe-AFw$U%-L?~-+nSXHHKkdgC5KJRTF}`G zE_HNdrE}S0zf4j{r_f-V2imSqW?}3w-4=f@o@-q+cZgaAbZ((hn))@|eWWhcT2pLpTpL!;_5*vM=sRL8 zqU##{U#lJKuyqW^X$ETU5ETeEVzhU|1m1750#f}38_5N9)B_2|v@1hUu=Kt7-@dhA zq_`OMgW01n`%1dB*}C)qxC8q;?zPeF_r;>}%JYmlER_1CUbKa07+=TV45~symC*g8 zW-8(gag#cAOuM0B1xG8eTp5HGVLE}+gYTmK=`X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}B0ptSsMg9p8@ZE5A6LfMk1qdsf8T^zkdC3rUhB$`s zBdanX%L3tF7*YZ4^A8MvOvhfr&B)QOWCLJ^02kw5;P%n~5e`sa6MG{E2N^*2ZX@ge zI2>ve##O?I}sWX)UqK^_bRz@;5HWp5{ziyg?QuEjXfMP!j zpr(McSAQz>ME?M-3NSoCn$91#_iNnULp6tD0NN7Z0s#G~-~xWZFWN-%KUVi^yz~-` zn;AeGvjLJ~{1p#^?$>zM4vu=3mjBI$(_tC~NC0o@6<{zS_*3nGfUsHr3Gdgn%XedF zQUP=j5Mb>9=#f7aPl;cm$=I0u*WP}aVE!lCYw2Ht{Z_j9mp1h>dHGKkEZP6f^6O@J zndJ2+rWjxp|3#<2oO=8v!oHMX{|Vb|^G~pU_A6=ckBQvt>o+dpgYy(D=VCj65GE&jJj{&-*iq?z)PHNee&-@Mie~#LD*={ex8h(-)<@|55 zUr(}L?mz#;d|mrD%zrh<-*=;5*7K$B`zPjJ%m2pwr*G6tf8tN%a

_x$+l{{cH8$W#CT literal 0 HcmV?d00001 diff --git a/packages/android-web3-provider/gradle/wrapper/gradle-wrapper.properties b/packages/android-web3-provider/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..4aad4dbc --- /dev/null +++ b/packages/android-web3-provider/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Thu Jul 11 13:20:47 ART 2024 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/packages/android-web3-provider/gradlew b/packages/android-web3-provider/gradlew new file mode 100755 index 00000000..cccdd3d5 --- /dev/null +++ b/packages/android-web3-provider/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/packages/android-web3-provider/index.ts b/packages/android-web3-provider/index.ts new file mode 100644 index 00000000..cbf91836 --- /dev/null +++ b/packages/android-web3-provider/index.ts @@ -0,0 +1,33 @@ +import { SolanaProvider } from '@trustwallet/web3-provider-solana'; +import { EthereumProvider } from '@trustwallet/web3-provider-ethereum'; +import { CosmosProvider } from '@trustwallet/web3-provider-cosmos'; +import { Web3Provider } from '@trustwallet/web3-provider-core'; +import { + AdapterStrategyType, + IHandler, +} from '@trustwallet/web3-provider-core/adapter/Adapter'; +import { ISolanaProviderConfig } from '@trustwallet/web3-provider-solana/types/SolanaProvider'; +import { ICosmosProviderConfig } from '@trustwallet/web3-provider-cosmos/types/CosmosProvider'; +import { IEthereumProviderConfig } from '@trustwallet/web3-provider-ethereum/types/EthereumProvider'; +import { AptosProvider } from '@trustwallet/web3-provider-aptos'; +import { IAptosProviderConfig } from '@trustwallet/web3-provider-aptos/types/AptosProvider'; + +const core = (strategy: AdapterStrategyType, handler?: IHandler) => + new Web3Provider({ strategy, handler }); + +const solana = (config: ISolanaProviderConfig) => new SolanaProvider(config); + +const cosmos = (config: ICosmosProviderConfig) => new CosmosProvider(config); + +const ethereum = (config: IEthereumProviderConfig) => + new EthereumProvider(config); + +const aptos = (config: IAptosProviderConfig) => new AptosProvider(config); + +window.trustwallet = { + core, + solana, + cosmos, + ethereum, + aptos, +}; diff --git a/packages/android-web3-provider/lib/build.gradle b/packages/android-web3-provider/lib/build.gradle new file mode 100644 index 00000000..aa5e6895 --- /dev/null +++ b/packages/android-web3-provider/lib/build.gradle @@ -0,0 +1,55 @@ +apply plugin: 'com.android.library' +apply plugin: 'maven-publish' + +group='com.trustwallet' + +def getArtificatId = { -> + return "web3-provider" +} +def getVersionName = { -> + return System.getenv('TAG_NAME') ?: "1.0.4" +} + +android { + compileSdkVersion 28 + namespace 'trust.web3jproviderV2' + defaultConfig { + minSdkVersion 23 + targetSdkVersion 28 + versionCode 1 + project.archivesBaseName = getArtificatId() + versionName getVersionName() + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } + +} + +dependencies {} + +publishing { + publications { + web3provider(MavenPublication) { + groupId group + artifactId getArtificatId() + version getVersionName() + artifact("$buildDir/outputs/aar/${getArtificatId()}-release.aar") + } + } + + repositories { + maven { + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/trustwallet/trust-web3-provider") + credentials { + username = System.getenv("GPR_USER") + password = System.getenv("GPR_API_KEY") + } + } + } +} diff --git a/packages/android-web3-provider/lib/proguard-rules.pro b/packages/android-web3-provider/lib/proguard-rules.pro new file mode 100644 index 00000000..f1b42451 --- /dev/null +++ b/packages/android-web3-provider/lib/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/packages/android-web3-provider/lib/src/main/AndroidManifest.xml b/packages/android-web3-provider/lib/src/main/AndroidManifest.xml new file mode 100644 index 00000000..cc947c56 --- /dev/null +++ b/packages/android-web3-provider/lib/src/main/AndroidManifest.xml @@ -0,0 +1 @@ + diff --git a/packages/android-web3-provider/lib/src/main/res/raw/trust_min.js b/packages/android-web3-provider/lib/src/main/res/raw/trust_min.js new file mode 100644 index 00000000..115c0181 --- /dev/null +++ b/packages/android-web3-provider/lib/src/main/res/raw/trust_min.js @@ -0,0 +1,34 @@ +(function(ft){typeof define=="function"&&define.amd?define(ft):ft()})(function(){"use strict";var ft=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Nn(e){var t=e.default;if(typeof t=="function"){var r=function(){return t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var ie={},nf={};nf.byteLength=$E,nf.toByteArray=OE,nf.fromByteArray=UE;for(var pi=[],Pn=[],CE=typeof Uint8Array<"u"?Uint8Array:Array,Tl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ao=0,LE=Tl.length;Ao0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function $E(e){var t=Np(e),r=t[0],n=t[1];return(r+n)*3/4-n}function ME(e,t,r){return(t+r)*3/4-r}function OE(e){var t,r=Np(e),n=r[0],i=r[1],s=new CE(ME(e,n,i)),o=0,a=i>0?n-4:n,c;for(c=0;c>16&255,s[o++]=t>>8&255,s[o++]=t&255;return i===2&&(t=Pn[e.charCodeAt(c)]<<2|Pn[e.charCodeAt(c+1)]>>4,s[o++]=t&255),i===1&&(t=Pn[e.charCodeAt(c)]<<10|Pn[e.charCodeAt(c+1)]<<4|Pn[e.charCodeAt(c+2)]>>2,s[o++]=t>>8&255,s[o++]=t&255),s}function NE(e){return pi[e>>18&63]+pi[e>>12&63]+pi[e>>6&63]+pi[e&63]}function PE(e,t,r){for(var n,i=[],s=t;sa?a:o+s));return n===1?(t=e[r-1],i.push(pi[t>>2]+pi[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(pi[t>>10]+pi[t>>4&63]+pi[t<<2&63]+"=")),i.join("")}var kl={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */kl.read=function(e,t,r,n,i){var s,o,a=i*8-n-1,c=(1<>1,l=-7,y=r?i-1:0,A=r?-1:1,v=e[t+y];for(y+=A,s=v&(1<<-l)-1,v>>=-l,l+=a;l>0;s=s*256+e[t+y],y+=A,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;l>0;o=o*256+e[t+y],y+=A,l-=8);if(s===0)s=1-u;else{if(s===c)return o?NaN:(v?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-u}return(v?-1:1)*o*Math.pow(2,s-n)},kl.write=function(e,t,r,n,i,s){var o,a,c,u=s*8-i-1,l=(1<>1,A=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,v=n?0:s-1,R=n?1:-1,M=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+y>=1?t+=A/c:t+=A*Math.pow(2,1-y),t*c>=2&&(o++,c/=2),o+y>=l?(a=0,o=l):o+y>=1?(a=(t*c-1)*Math.pow(2,i),o=o+y):(a=t*Math.pow(2,y-1)*Math.pow(2,i),o=0));i>=8;e[r+v]=a&255,v+=R,a/=256,i-=8);for(o=o<0;e[r+v]=o&255,v+=R,o/=256,u-=8);e[r+v-R]|=M*128};/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */(function(e){const t=nf,r=kl,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=F,e.INSPECT_MAX_BYTES=50;const i=2147483647;e.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=s(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&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 s(){try{const C=new Uint8Array(1),w={foo:function(){return 42}};return Object.setPrototypeOf(w,Uint8Array.prototype),Object.setPrototypeOf(C,w),C.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function o(C){if(C>i)throw new RangeError('The value "'+C+'" is invalid for option "size"');const w=new Uint8Array(C);return Object.setPrototypeOf(w,a.prototype),w}function a(C,w,b){if(typeof C=="number"){if(typeof w=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return y(C)}return c(C,w,b)}a.poolSize=8192;function c(C,w,b){if(typeof C=="string")return A(C,w);if(ArrayBuffer.isView(C))return R(C);if(C==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof C);if(Wt(C,ArrayBuffer)||C&&Wt(C.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Wt(C,SharedArrayBuffer)||C&&Wt(C.buffer,SharedArrayBuffer)))return M(C,w,b);if(typeof C=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const D=C.valueOf&&C.valueOf();if(D!=null&&D!==C)return a.from(D,w,b);const V=P(C);if(V)return V;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof C[Symbol.toPrimitive]=="function")return a.from(C[Symbol.toPrimitive]("string"),w,b);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof C)}a.from=function(C,w,b){return c(C,w,b)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function u(C){if(typeof C!="number")throw new TypeError('"size" argument must be of type number');if(C<0)throw new RangeError('The value "'+C+'" is invalid for option "size"')}function l(C,w,b){return u(C),C<=0?o(C):w!==void 0?typeof b=="string"?o(C).fill(w,b):o(C).fill(w):o(C)}a.alloc=function(C,w,b){return l(C,w,b)};function y(C){return u(C),o(C<0?0:H(C)|0)}a.allocUnsafe=function(C){return y(C)},a.allocUnsafeSlow=function(C){return y(C)};function A(C,w){if((typeof w!="string"||w==="")&&(w="utf8"),!a.isEncoding(w))throw new TypeError("Unknown encoding: "+w);const b=N(C,w)|0;let D=o(b);const V=D.write(C,w);return V!==b&&(D=D.slice(0,V)),D}function v(C){const w=C.length<0?0:H(C.length)|0,b=o(w);for(let D=0;D=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return C|0}function F(C){return+C!=C&&(C=0),a.alloc(+C)}a.isBuffer=function(w){return w!=null&&w._isBuffer===!0&&w!==a.prototype},a.compare=function(w,b){if(Wt(w,Uint8Array)&&(w=a.from(w,w.offset,w.byteLength)),Wt(b,Uint8Array)&&(b=a.from(b,b.offset,b.byteLength)),!a.isBuffer(w)||!a.isBuffer(b))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(w===b)return 0;let D=w.length,V=b.length;for(let X=0,ae=Math.min(D,V);XV.length?(a.isBuffer(ae)||(ae=a.from(ae)),ae.copy(V,X)):Uint8Array.prototype.set.call(V,ae,X);else if(a.isBuffer(ae))ae.copy(V,X);else throw new TypeError('"list" argument must be an Array of Buffers');X+=ae.length}return V};function N(C,w){if(a.isBuffer(C))return C.length;if(ArrayBuffer.isView(C)||Wt(C,ArrayBuffer))return C.byteLength;if(typeof C!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof C);const b=C.length,D=arguments.length>2&&arguments[2]===!0;if(!D&&b===0)return 0;let V=!1;for(;;)switch(w){case"ascii":case"latin1":case"binary":return b;case"utf8":case"utf-8":return He(C).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b*2;case"hex":return b>>>1;case"base64":return ut(C).length;default:if(V)return D?-1:He(C).length;w=(""+w).toLowerCase(),V=!0}}a.byteLength=N;function $(C,w,b){let D=!1;if((w===void 0||w<0)&&(w=0),w>this.length||((b===void 0||b>this.length)&&(b=this.length),b<=0)||(b>>>=0,w>>>=0,b<=w))return"";for(C||(C="utf8");;)switch(C){case"hex":return x(this,w,b);case"utf8":case"utf-8":return f(this,w,b);case"ascii":return _(this,w,b);case"latin1":case"binary":return E(this,w,b);case"base64":return g(this,w,b);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,w,b);default:if(D)throw new TypeError("Unknown encoding: "+C);C=(C+"").toLowerCase(),D=!0}}a.prototype._isBuffer=!0;function q(C,w,b){const D=C[w];C[w]=C[b],C[b]=D}a.prototype.swap16=function(){const w=this.length;if(w%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let b=0;bb&&(w+=" ... "),""},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(w,b,D,V,X){if(Wt(w,Uint8Array)&&(w=a.from(w,w.offset,w.byteLength)),!a.isBuffer(w))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof w);if(b===void 0&&(b=0),D===void 0&&(D=w?w.length:0),V===void 0&&(V=0),X===void 0&&(X=this.length),b<0||D>w.length||V<0||X>this.length)throw new RangeError("out of range index");if(V>=X&&b>=D)return 0;if(V>=X)return-1;if(b>=D)return 1;if(b>>>=0,D>>>=0,V>>>=0,X>>>=0,this===w)return 0;let ae=X-V,Ze=D-b;const Ge=Math.min(ae,Ze),We=this.slice(V,X),jt=w.slice(b,D);for(let ze=0;ze2147483647?b=2147483647:b<-2147483648&&(b=-2147483648),b=+b,xt(b)&&(b=V?0:C.length-1),b<0&&(b=C.length+b),b>=C.length){if(V)return-1;b=C.length-1}else if(b<0)if(V)b=0;else return-1;if(typeof w=="string"&&(w=a.from(w,D)),a.isBuffer(w))return w.length===0?-1:Z(C,w,b,D,V);if(typeof w=="number")return w=w&255,typeof Uint8Array.prototype.indexOf=="function"?V?Uint8Array.prototype.indexOf.call(C,w,b):Uint8Array.prototype.lastIndexOf.call(C,w,b):Z(C,[w],b,D,V);throw new TypeError("val must be string, number or Buffer")}function Z(C,w,b,D,V){let X=1,ae=C.length,Ze=w.length;if(D!==void 0&&(D=String(D).toLowerCase(),D==="ucs2"||D==="ucs-2"||D==="utf16le"||D==="utf-16le")){if(C.length<2||w.length<2)return-1;X=2,ae/=2,Ze/=2,b/=2}function Ge(jt,ze){return X===1?jt[ze]:jt.readUInt16BE(ze*X)}let We;if(V){let jt=-1;for(We=b;Weae&&(b=ae-Ze),We=b;We>=0;We--){let jt=!0;for(let ze=0;zeV&&(D=V)):D=V;const X=w.length;D>X/2&&(D=X/2);let ae;for(ae=0;ae>>0,isFinite(D)?(D=D>>>0,V===void 0&&(V="utf8")):(V=D,D=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const X=this.length-b;if((D===void 0||D>X)&&(D=X),w.length>0&&(D<0||b<0)||b>this.length)throw new RangeError("Attempt to write outside buffer bounds");V||(V="utf8");let ae=!1;for(;;)switch(V){case"hex":return z(this,w,b,D);case"utf8":case"utf-8":return ee(this,w,b,D);case"ascii":case"latin1":case"binary":return se(this,w,b,D);case"base64":return Q(this,w,b,D);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,w,b,D);default:if(ae)throw new TypeError("Unknown encoding: "+V);V=(""+V).toLowerCase(),ae=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function g(C,w,b){return w===0&&b===C.length?t.fromByteArray(C):t.fromByteArray(C.slice(w,b))}function f(C,w,b){b=Math.min(C.length,b);const D=[];let V=w;for(;V239?4:X>223?3:X>191?2:1;if(V+Ze<=b){let Ge,We,jt,ze;switch(Ze){case 1:X<128&&(ae=X);break;case 2:Ge=C[V+1],(Ge&192)===128&&(ze=(X&31)<<6|Ge&63,ze>127&&(ae=ze));break;case 3:Ge=C[V+1],We=C[V+2],(Ge&192)===128&&(We&192)===128&&(ze=(X&15)<<12|(Ge&63)<<6|We&63,ze>2047&&(ze<55296||ze>57343)&&(ae=ze));break;case 4:Ge=C[V+1],We=C[V+2],jt=C[V+3],(Ge&192)===128&&(We&192)===128&&(jt&192)===128&&(ze=(X&15)<<18|(Ge&63)<<12|(We&63)<<6|jt&63,ze>65535&&ze<1114112&&(ae=ze))}}ae===null?(ae=65533,Ze=1):ae>65535&&(ae-=65536,D.push(ae>>>10&1023|55296),ae=56320|ae&1023),D.push(ae),V+=Ze}return m(D)}const h=4096;function m(C){const w=C.length;if(w<=h)return String.fromCharCode.apply(String,C);let b="",D=0;for(;DD)&&(b=D);let V="";for(let X=w;XD&&(w=D),b<0?(b+=D,b<0&&(b=0)):b>D&&(b=D),bb)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(w,b,D){w=w>>>0,b=b>>>0,D||B(w,b,this.length);let V=this[w],X=1,ae=0;for(;++ae>>0,b=b>>>0,D||B(w,b,this.length);let V=this[w+--b],X=1;for(;b>0&&(X*=256);)V+=this[w+--b]*X;return V},a.prototype.readUint8=a.prototype.readUInt8=function(w,b){return w=w>>>0,b||B(w,1,this.length),this[w]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(w,b){return w=w>>>0,b||B(w,2,this.length),this[w]|this[w+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(w,b){return w=w>>>0,b||B(w,2,this.length),this[w]<<8|this[w+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(w,b){return w=w>>>0,b||B(w,4,this.length),(this[w]|this[w+1]<<8|this[w+2]<<16)+this[w+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(w,b){return w=w>>>0,b||B(w,4,this.length),this[w]*16777216+(this[w+1]<<16|this[w+2]<<8|this[w+3])},a.prototype.readBigUInt64LE=Xt(function(w){w=w>>>0,pe(w,"offset");const b=this[w],D=this[w+7];(b===void 0||D===void 0)&&we(w,this.length-8);const V=b+this[++w]*2**8+this[++w]*2**16+this[++w]*2**24,X=this[++w]+this[++w]*2**8+this[++w]*2**16+D*2**24;return BigInt(V)+(BigInt(X)<>>0,pe(w,"offset");const b=this[w],D=this[w+7];(b===void 0||D===void 0)&&we(w,this.length-8);const V=b*2**24+this[++w]*2**16+this[++w]*2**8+this[++w],X=this[++w]*2**24+this[++w]*2**16+this[++w]*2**8+D;return(BigInt(V)<>>0,b=b>>>0,D||B(w,b,this.length);let V=this[w],X=1,ae=0;for(;++ae=X&&(V-=Math.pow(2,8*b)),V},a.prototype.readIntBE=function(w,b,D){w=w>>>0,b=b>>>0,D||B(w,b,this.length);let V=b,X=1,ae=this[w+--V];for(;V>0&&(X*=256);)ae+=this[w+--V]*X;return X*=128,ae>=X&&(ae-=Math.pow(2,8*b)),ae},a.prototype.readInt8=function(w,b){return w=w>>>0,b||B(w,1,this.length),this[w]&128?(255-this[w]+1)*-1:this[w]},a.prototype.readInt16LE=function(w,b){w=w>>>0,b||B(w,2,this.length);const D=this[w]|this[w+1]<<8;return D&32768?D|4294901760:D},a.prototype.readInt16BE=function(w,b){w=w>>>0,b||B(w,2,this.length);const D=this[w+1]|this[w]<<8;return D&32768?D|4294901760:D},a.prototype.readInt32LE=function(w,b){return w=w>>>0,b||B(w,4,this.length),this[w]|this[w+1]<<8|this[w+2]<<16|this[w+3]<<24},a.prototype.readInt32BE=function(w,b){return w=w>>>0,b||B(w,4,this.length),this[w]<<24|this[w+1]<<16|this[w+2]<<8|this[w+3]},a.prototype.readBigInt64LE=Xt(function(w){w=w>>>0,pe(w,"offset");const b=this[w],D=this[w+7];(b===void 0||D===void 0)&&we(w,this.length-8);const V=this[w+4]+this[w+5]*2**8+this[w+6]*2**16+(D<<24);return(BigInt(V)<>>0,pe(w,"offset");const b=this[w],D=this[w+7];(b===void 0||D===void 0)&&we(w,this.length-8);const V=(b<<24)+this[++w]*2**16+this[++w]*2**8+this[++w];return(BigInt(V)<>>0,b||B(w,4,this.length),r.read(this,w,!0,23,4)},a.prototype.readFloatBE=function(w,b){return w=w>>>0,b||B(w,4,this.length),r.read(this,w,!1,23,4)},a.prototype.readDoubleLE=function(w,b){return w=w>>>0,b||B(w,8,this.length),r.read(this,w,!0,52,8)},a.prototype.readDoubleBE=function(w,b){return w=w>>>0,b||B(w,8,this.length),r.read(this,w,!1,52,8)};function d(C,w,b,D,V,X){if(!a.isBuffer(C))throw new TypeError('"buffer" argument must be a Buffer instance');if(w>V||wC.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(w,b,D,V){if(w=+w,b=b>>>0,D=D>>>0,!V){const Ze=Math.pow(2,8*D)-1;d(this,w,b,D,Ze,0)}let X=1,ae=0;for(this[b]=w&255;++ae>>0,D=D>>>0,!V){const Ze=Math.pow(2,8*D)-1;d(this,w,b,D,Ze,0)}let X=D-1,ae=1;for(this[b+X]=w&255;--X>=0&&(ae*=256);)this[b+X]=w/ae&255;return b+D},a.prototype.writeUint8=a.prototype.writeUInt8=function(w,b,D){return w=+w,b=b>>>0,D||d(this,w,b,1,255,0),this[b]=w&255,b+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(w,b,D){return w=+w,b=b>>>0,D||d(this,w,b,2,65535,0),this[b]=w&255,this[b+1]=w>>>8,b+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(w,b,D){return w=+w,b=b>>>0,D||d(this,w,b,2,65535,0),this[b]=w>>>8,this[b+1]=w&255,b+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(w,b,D){return w=+w,b=b>>>0,D||d(this,w,b,4,4294967295,0),this[b+3]=w>>>24,this[b+2]=w>>>16,this[b+1]=w>>>8,this[b]=w&255,b+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(w,b,D){return w=+w,b=b>>>0,D||d(this,w,b,4,4294967295,0),this[b]=w>>>24,this[b+1]=w>>>16,this[b+2]=w>>>8,this[b+3]=w&255,b+4};function k(C,w,b,D,V){Pe(w,D,V,C,b,7);let X=Number(w&BigInt(4294967295));C[b++]=X,X=X>>8,C[b++]=X,X=X>>8,C[b++]=X,X=X>>8,C[b++]=X;let ae=Number(w>>BigInt(32)&BigInt(4294967295));return C[b++]=ae,ae=ae>>8,C[b++]=ae,ae=ae>>8,C[b++]=ae,ae=ae>>8,C[b++]=ae,b}function W(C,w,b,D,V){Pe(w,D,V,C,b,7);let X=Number(w&BigInt(4294967295));C[b+7]=X,X=X>>8,C[b+6]=X,X=X>>8,C[b+5]=X,X=X>>8,C[b+4]=X;let ae=Number(w>>BigInt(32)&BigInt(4294967295));return C[b+3]=ae,ae=ae>>8,C[b+2]=ae,ae=ae>>8,C[b+1]=ae,ae=ae>>8,C[b]=ae,b+8}a.prototype.writeBigUInt64LE=Xt(function(w,b=0){return k(this,w,b,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=Xt(function(w,b=0){return W(this,w,b,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(w,b,D,V){if(w=+w,b=b>>>0,!V){const Ge=Math.pow(2,8*D-1);d(this,w,b,D,Ge-1,-Ge)}let X=0,ae=1,Ze=0;for(this[b]=w&255;++X>0)-Ze&255;return b+D},a.prototype.writeIntBE=function(w,b,D,V){if(w=+w,b=b>>>0,!V){const Ge=Math.pow(2,8*D-1);d(this,w,b,D,Ge-1,-Ge)}let X=D-1,ae=1,Ze=0;for(this[b+X]=w&255;--X>=0&&(ae*=256);)w<0&&Ze===0&&this[b+X+1]!==0&&(Ze=1),this[b+X]=(w/ae>>0)-Ze&255;return b+D},a.prototype.writeInt8=function(w,b,D){return w=+w,b=b>>>0,D||d(this,w,b,1,127,-128),w<0&&(w=255+w+1),this[b]=w&255,b+1},a.prototype.writeInt16LE=function(w,b,D){return w=+w,b=b>>>0,D||d(this,w,b,2,32767,-32768),this[b]=w&255,this[b+1]=w>>>8,b+2},a.prototype.writeInt16BE=function(w,b,D){return w=+w,b=b>>>0,D||d(this,w,b,2,32767,-32768),this[b]=w>>>8,this[b+1]=w&255,b+2},a.prototype.writeInt32LE=function(w,b,D){return w=+w,b=b>>>0,D||d(this,w,b,4,2147483647,-2147483648),this[b]=w&255,this[b+1]=w>>>8,this[b+2]=w>>>16,this[b+3]=w>>>24,b+4},a.prototype.writeInt32BE=function(w,b,D){return w=+w,b=b>>>0,D||d(this,w,b,4,2147483647,-2147483648),w<0&&(w=4294967295+w+1),this[b]=w>>>24,this[b+1]=w>>>16,this[b+2]=w>>>8,this[b+3]=w&255,b+4},a.prototype.writeBigInt64LE=Xt(function(w,b=0){return k(this,w,b,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=Xt(function(w,b=0){return W(this,w,b,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function K(C,w,b,D,V,X){if(b+D>C.length)throw new RangeError("Index out of range");if(b<0)throw new RangeError("Index out of range")}function re(C,w,b,D,V){return w=+w,b=b>>>0,V||K(C,w,b,4),r.write(C,w,b,D,23,4),b+4}a.prototype.writeFloatLE=function(w,b,D){return re(this,w,b,!0,D)},a.prototype.writeFloatBE=function(w,b,D){return re(this,w,b,!1,D)};function xe(C,w,b,D,V){return w=+w,b=b>>>0,V||K(C,w,b,8),r.write(C,w,b,D,52,8),b+8}a.prototype.writeDoubleLE=function(w,b,D){return xe(this,w,b,!0,D)},a.prototype.writeDoubleBE=function(w,b,D){return xe(this,w,b,!1,D)},a.prototype.copy=function(w,b,D,V){if(!a.isBuffer(w))throw new TypeError("argument should be a Buffer");if(D||(D=0),!V&&V!==0&&(V=this.length),b>=w.length&&(b=w.length),b||(b=0),V>0&&V=this.length)throw new RangeError("Index out of range");if(V<0)throw new RangeError("sourceEnd out of bounds");V>this.length&&(V=this.length),w.length-b>>0,D=D===void 0?this.length:D>>>0,w||(w=0);let X;if(typeof w=="number")for(X=b;X2**32?V=tt(String(b)):typeof b=="bigint"&&(V=String(b),(b>BigInt(2)**BigInt(32)||b<-(BigInt(2)**BigInt(32)))&&(V=tt(V)),V+="n"),D+=` It must be ${w}. Received ${V}`,D},RangeError);function tt(C){let w="",b=C.length;const D=C[0]==="-"?1:0;for(;b>=D+4;b-=3)w=`_${C.slice(b-3,b)}${w}`;return`${C.slice(0,b)}${w}`}function Ue(C,w,b){pe(w,"offset"),(C[w]===void 0||C[w+b]===void 0)&&we(w,C.length-(b+1))}function Pe(C,w,b,D,V,X){if(C>b||C3?w===0||w===BigInt(0)?Ze=`>= 0${ae} and < 2${ae} ** ${(X+1)*8}${ae}`:Ze=`>= -(2${ae} ** ${(X+1)*8-1}${ae}) and < 2 ** ${(X+1)*8-1}${ae}`:Ze=`>= ${w}${ae} and <= ${b}${ae}`,new be.ERR_OUT_OF_RANGE("value",Ze,C)}Ue(D,V,X)}function pe(C,w){if(typeof C!="number")throw new be.ERR_INVALID_ARG_TYPE(w,"number",C)}function we(C,w,b){throw Math.floor(C)!==C?(pe(C,b),new be.ERR_OUT_OF_RANGE(b||"offset","an integer",C)):w<0?new be.ERR_BUFFER_OUT_OF_BOUNDS:new be.ERR_OUT_OF_RANGE(b||"offset",`>= ${b?1:0} and <= ${w}`,C)}const ke=/[^+/0-9A-Za-z-_]/g;function vt(C){if(C=C.split("=")[0],C=C.trim().replace(ke,""),C.length<2)return"";for(;C.length%4!==0;)C=C+"=";return C}function He(C,w){w=w||1/0;let b;const D=C.length;let V=null;const X=[];for(let ae=0;ae55295&&b<57344){if(!V){if(b>56319){(w-=3)>-1&&X.push(239,191,189);continue}else if(ae+1===D){(w-=3)>-1&&X.push(239,191,189);continue}V=b;continue}if(b<56320){(w-=3)>-1&&X.push(239,191,189),V=b;continue}b=(V-55296<<10|b-56320)+65536}else V&&(w-=3)>-1&&X.push(239,191,189);if(V=null,b<128){if((w-=1)<0)break;X.push(b)}else if(b<2048){if((w-=2)<0)break;X.push(b>>6|192,b&63|128)}else if(b<65536){if((w-=3)<0)break;X.push(b>>12|224,b>>6&63|128,b&63|128)}else if(b<1114112){if((w-=4)<0)break;X.push(b>>18|240,b>>12&63|128,b>>6&63|128,b&63|128)}else throw new Error("Invalid code point")}return X}function it(C){const w=[];for(let b=0;b>8,V=b%256,X.push(V),X.push(D);return X}function ut(C){return t.toByteArray(vt(C))}function pt(C,w,b,D){let V;for(V=0;V=w.length||V>=C.length);++V)w[V+b]=C[V];return V}function Wt(C,w){return C instanceof w||C!=null&&C.constructor!=null&&C.constructor.name!=null&&C.constructor.name===w.name}function xt(C){return C!==C}const At=function(){const C="0123456789abcdef",w=new Array(256);for(let b=0;b<16;++b){const D=b*16;for(let V=0;V<16;++V)w[D+V]=C[b]+C[V]}return w}();function Xt(C){return typeof BigInt>"u"?Tt:C}function Tt(){throw new Error("BigInt not supported")}})(ie);var Un={exports:{}},Bo=typeof Reflect=="object"?Reflect:null,Pp=Bo&&typeof Bo.apply=="function"?Bo.apply:function(t,r,n){return Function.prototype.apply.call(t,r,n)},sf;Bo&&typeof Bo.ownKeys=="function"?sf=Bo.ownKeys:Object.getOwnPropertySymbols?sf=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:sf=function(t){return Object.getOwnPropertyNames(t)};function FE(e){console&&console.warn&&console.warn(e)}var Up=Number.isNaN||function(t){return t!==t};function Zt(){Zt.init.call(this)}Un.exports=Zt,Un.exports.once=zE,Zt.EventEmitter=Zt,Zt.prototype._events=void 0,Zt.prototype._eventsCount=0,Zt.prototype._maxListeners=void 0;var Fp=10;function of(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(Zt,"defaultMaxListeners",{enumerable:!0,get:function(){return Fp},set:function(e){if(typeof e!="number"||e<0||Up(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Fp=e}}),Zt.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Zt.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Up(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function Dp(e){return e._maxListeners===void 0?Zt.defaultMaxListeners:e._maxListeners}Zt.prototype.getMaxListeners=function(){return Dp(this)},Zt.prototype.emit=function(t){for(var r=[],n=1;n0&&(o=r[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=s[t];if(c===void 0)return!1;if(typeof c=="function")Pp(c,this,r);else for(var u=c.length,l=Vp(c,u),n=0;n0&&o.length>i&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=o.length,FE(a)}return e}Zt.prototype.addListener=function(t,r){return Hp(this,t,r,!1)},Zt.prototype.on=Zt.prototype.addListener,Zt.prototype.prependListener=function(t,r){return Hp(this,t,r,!0)};function DE(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function jp(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=DE.bind(n);return i.listener=r,n.wrapFn=i,i}Zt.prototype.once=function(t,r){return of(r),this.on(t,jp(this,t,r)),this},Zt.prototype.prependOnceListener=function(t,r){return of(r),this.prependListener(t,jp(this,t,r)),this},Zt.prototype.removeListener=function(t,r){var n,i,s,o,a;if(of(r),i=this._events,i===void 0)return this;if(n=i[t],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,n.listener||r));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===r||n[o].listener===r){a=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():HE(n,s),n.length===1&&(i[t]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",t,a||r)}return this},Zt.prototype.off=Zt.prototype.removeListener,Zt.prototype.removeAllListeners=function(t){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i=0;i--)this.removeListener(t,r[i]);return this};function zp(e,t,r){var n=e._events;if(n===void 0)return[];var i=n[t];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?jE(i):Vp(i,i.length)}Zt.prototype.listeners=function(t){return zp(this,t,!0)},Zt.prototype.rawListeners=function(t){return zp(this,t,!1)},Zt.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):qp.call(e,t)},Zt.prototype.listenerCount=qp;function qp(e){var t=this._events;if(t!==void 0){var r=t[e];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}Zt.prototype.eventNames=function(){return this._eventsCount>0?sf(this._events):[]};function Vp(e,t){for(var r=new Array(t),n=0;n{if(!t.has(e))throw TypeError("Cannot "+r)},af=(e,t,r)=>(Kp(e,t,"read from private field"),r?r.call(e):t.get(e)),Zp=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Gp=(e,t,r,n)=>(Kp(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),cf,Io;const Ma={PROMISES:"PROMISES",CALLBACK:"CALLBACK"},Yp=class{constructor(e){Zp(this,cf,void 0),Zp(this,Io,void 0),this.setStrategy(e)}static isCallbackAdapterRequest(e){return e.id!==void 0}setHandler(e){return Gp(this,Io,e),this}request(e,t){if(!af(this,Io))throw new Error("No handler defined for Adapter");return Yp.isCallbackAdapterRequest(e)?af(this,Io).call(this,{network:t,id:e.id,name:e.method,params:e.params,object:e.params}):af(this,Io).call(this,{name:e.method,network:t,params:e.params,object:e.params})}setStrategy(e){return Gp(this,cf,e),this}getStrategy(){return af(this,cf)}};let Xp=Yp;cf=new WeakMap,Io=new WeakMap;var VE=Object.defineProperty,WE=Object.defineProperties,KE=Object.getOwnPropertyDescriptors,Jp=Object.getOwnPropertySymbols,ZE=Object.prototype.hasOwnProperty,GE=Object.prototype.propertyIsEnumerable,Qp=(e,t,r)=>t in e?VE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,YE=(e,t)=>{for(var r in t||(t={}))ZE.call(t,r)&&Qp(e,r,t[r]);if(Jp)for(var r of Jp(t))GE.call(t,r)&&Qp(e,r,t[r]);return e},XE=(e,t)=>WE(e,KE(t));class JE extends Xp{constructor(){super(Ma.CALLBACK),this.callback=new Map}async request(t,r){return new Promise((n,i)=>{const s=new Date().getTime()+Math.floor(Math.random()*1e3);this.callback.set(s.toString(),{reject:i,resolve:n}),super.request(XE(YE({},t),{id:s}),r)})}sendResponse(t,r){if(this.callback.has(t.toString())){const n=this.callback.get(t.toString());this.callback.delete(t.toString()),n?.resolve(r)}else console.error(`Unable to find callback for requestId: ${t}`)}sendError(t,r){if(this.callback.has(t.toString())){const n=this.callback.get(t.toString());this.callback.delete(t.toString()),n?.reject(r)}else console.error(`Unable to find callback for requestId: ${t}`)}}class QE extends Xp{constructor(){super(Ma.PROMISES)}request(t,r){return super.request(t,r)}}class Cl extends Un.exports.EventEmitter{setAdapter(t){return this.adapter=t,this}async request(t){try{if(!this.adapter)throw new Error("No adapter set, maybe you forgot to register the provider?");const r=await this.adapter.request(t,this.getNetwork());return this.emit("onResponseReady",t,r),r}catch(r){throw r}}sendResponse(t,r){if(!this.adapter)throw new Error("Adapter not found");if(this.adapter.getStrategy()!==Ma.CALLBACK)throw new Error("Trying to send callback request on promisified adapter");this.adapter.sendResponse(t,r)}sendError(t,r){if(!this.adapter)throw new Error("Adapter not found");if(this.adapter.getStrategy()!==Ma.CALLBACK)throw new Error("Trying to send callback request on promisified adapter");this.adapter.sendError(t,r)}}var eg=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},Ro=(e,t,r)=>(eg(e,t,"read from private field"),r?r.call(e):t.get(e)),ex=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},tx=(e,t,r,n)=>(eg(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Ci;class rx{constructor(t){ex(this,Ci,void 0);const r=t.strategy===Ma.CALLBACK?new JE:new QE;t.handler&&r.setHandler(t.handler),this.setAdapter(r)}setHandler(t){Ro(this,Ci).setHandler(t)}setAdapter(t){return tx(this,Ci,t),this}registerProvider(t){return t.setAdapter(Ro(this,Ci)),this}registerProviders(t){return t.forEach(r=>this.registerProvider(r)),this}sendResponse(t,r){Ro(this,Ci).getStrategy()==="CALLBACK"&&Ro(this,Ci).sendResponse(t,r)}sendError(t,r){Ro(this,Ci).getStrategy()==="CALLBACK"&&Ro(this,Ci).sendError(t,r)}}Ci=new WeakMap;function tg(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function nx(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function ff(e,...t){if(!nx(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function ix(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");tg(e.outputLen),tg(e.blockLen)}function uf(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function sx(e,t){ff(e);const r=t.outputLen;if(e.lengthnew DataView(e.buffer,e.byteOffset,e.byteLength),gi=(e,t)=>e<<32-t|e>>>t;new Uint8Array(new Uint32Array([287454020]).buffer)[0];function rg(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Ml(e){return typeof e=="string"&&(e=rg(e)),ff(e),e}function ng(...e){let t=0;for(let n=0;ne().update(Ml(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function og(e=32){if(Ll&&typeof Ll.getRandomValues=="function")return Ll.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}function ox(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,u=n?0:4;e.setUint32(t+c,o,n),e.setUint32(t+u,a,n)}const ax=(e,t,r)=>e&t^~e&r,cx=(e,t,r)=>e&t^e&r^t&r;class ag extends ig{constructor(t,r,n,i){super(),this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=$l(this.buffer)}update(t){uf(this);const{view:r,buffer:n,blockLen:i}=this;t=Ml(t);const s=t.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let y=o;yl.length)throw new Error("_sha2: outputLen bigger than state");for(let y=0;y>Ol&lf)}:{h:Number(e>>Ol&lf)|0,l:Number(e&lf)|0}}function fx(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;iBigInt(e>>>0)<>>0),lx=(e,t,r)=>e>>>r,hx=(e,t,r)=>e<<32-r|t>>>r,dx=(e,t,r)=>e>>>r|t<<32-r,px=(e,t,r)=>e<<32-r|t>>>r,gx=(e,t,r)=>e<<64-r|t>>>r-32,yx=(e,t,r)=>e>>>r-32|t<<64-r,wx=(e,t)=>t,mx=(e,t)=>e,bx=(e,t,r)=>e<>>32-r,vx=(e,t,r)=>t<>>32-r,_x=(e,t,r)=>t<>>64-r,Ex=(e,t,r)=>e<>>64-r;function xx(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}const mt={fromBig:cg,split:fx,toBig:ux,shrSH:lx,shrSL:hx,rotrSH:dx,rotrSL:px,rotrBH:gx,rotrBL:yx,rotr32H:wx,rotr32L:mx,rotlSH:bx,rotlSL:vx,rotlBH:_x,rotlBL:Ex,add:xx,add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/2**32|0)|0,add4L:(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H:(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0,add5H:(e,t,r,n,i,s)=>t+r+n+i+s+(e/2**32|0)|0,add5L:(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0)},[Sx,Ax]=(()=>mt.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))))(),ts=new Uint32Array(80),rs=new Uint32Array(80);class Bx extends ag{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:r,Bh:n,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:u,El:l,Fh:y,Fl:A,Gh:v,Gl:R,Hh:M,Hl:P}=this;return[t,r,n,i,s,o,a,c,u,l,y,A,v,R,M,P]}set(t,r,n,i,s,o,a,c,u,l,y,A,v,R,M,P){this.Ah=t|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=u|0,this.El=l|0,this.Fh=y|0,this.Fl=A|0,this.Gh=v|0,this.Gl=R|0,this.Hh=M|0,this.Hl=P|0}process(t,r){for(let N=0;N<16;N++,r+=4)ts[N]=t.getUint32(r),rs[N]=t.getUint32(r+=4);for(let N=16;N<80;N++){const $=ts[N-15]|0,q=rs[N-15]|0,G=mt.rotrSH($,q,1)^mt.rotrSH($,q,8)^mt.shrSH($,q,7),Z=mt.rotrSL($,q,1)^mt.rotrSL($,q,8)^mt.shrSL($,q,7),z=ts[N-2]|0,ee=rs[N-2]|0,se=mt.rotrSH(z,ee,19)^mt.rotrBH(z,ee,61)^mt.shrSH(z,ee,6),Q=mt.rotrSL(z,ee,19)^mt.rotrBL(z,ee,61)^mt.shrSL(z,ee,6),I=mt.add4L(Z,Q,rs[N-7],rs[N-16]),g=mt.add4H(I,G,se,ts[N-7],ts[N-16]);ts[N]=g|0,rs[N]=I|0}let{Ah:n,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:u,Dl:l,Eh:y,El:A,Fh:v,Fl:R,Gh:M,Gl:P,Hh:H,Hl:F}=this;for(let N=0;N<80;N++){const $=mt.rotrSH(y,A,14)^mt.rotrSH(y,A,18)^mt.rotrBH(y,A,41),q=mt.rotrSL(y,A,14)^mt.rotrSL(y,A,18)^mt.rotrBL(y,A,41),G=y&v^~y&M,Z=A&R^~A&P,z=mt.add5L(F,q,Z,Ax[N],rs[N]),ee=mt.add5H(z,H,$,G,Sx[N],ts[N]),se=z|0,Q=mt.rotrSH(n,i,28)^mt.rotrBH(n,i,34)^mt.rotrBH(n,i,39),I=mt.rotrSL(n,i,28)^mt.rotrBL(n,i,34)^mt.rotrBL(n,i,39),g=n&s^n&a^s&a,f=i&o^i&c^o&c;H=M|0,F=P|0,M=v|0,P=R|0,v=y|0,R=A|0,{h:y,l:A}=mt.add(u|0,l|0,ee|0,se|0),u=a|0,l=c|0,a=s|0,c=o|0,s=n|0,o=i|0;const h=mt.add3L(se,I,f);n=mt.add3H(h,ee,Q,g),i=h|0}({h:n,l:i}=mt.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:o}=mt.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=mt.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:u,l}=mt.add(this.Dh|0,this.Dl|0,u|0,l|0),{h:y,l:A}=mt.add(this.Eh|0,this.El|0,y|0,A|0),{h:v,l:R}=mt.add(this.Fh|0,this.Fl|0,v|0,R|0),{h:M,l:P}=mt.add(this.Gh|0,this.Gl|0,M|0,P|0),{h:H,l:F}=mt.add(this.Hh|0,this.Hl|0,H|0,F|0),this.set(n,i,s,o,a,c,u,l,y,A,v,R,M,P,H,F)}roundClean(){ts.fill(0),rs.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const fg=sg(()=>new Bx);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ug=BigInt(0),hf=BigInt(1),Ix=BigInt(2);function Hs(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function Oa(e){if(!Hs(e))throw new Error("Uint8Array expected")}const Rx=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function js(e){Oa(e);let t="";for(let r=0;r=Li._0&&e<=Li._9)return e-Li._0;if(e>=Li._A&&e<=Li._F)return e-(Li._A-10);if(e>=Li._a&&e<=Li._f)return e-(Li._a-10)}function To(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let i=0,s=0;iug;e>>=hf,t+=1);return t}function $x(e,t){return e>>BigInt(t)&hf}function Mx(e,t,r){return e|(r?hf:ug)<(Ix<new Uint8Array(e),dg=e=>Uint8Array.from(e);function pg(e,t,r){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=Ul(e),i=Ul(e),s=0;const o=()=>{n.fill(1),i.fill(0),s=0},a=(...y)=>r(i,n,...y),c=(y=Ul())=>{i=a(dg([0]),y),n=a(),y.length!==0&&(i=a(dg([1]),y),n=a())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let y=0;const A=[];for(;y{o(),c(y);let v;for(;!(v=A(u()));)c();return o(),v}}const Ox={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||Hs(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Lo(e,t,r={}){const n=(i,s,o)=>{const a=Ox[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);const c=e[i];if(!(o&&c===void 0)&&!a(c,e))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${s}`)};for(const[i,s]of Object.entries(t))n(i,s,!1);for(const[i,s]of Object.entries(r))n(i,s,!0);return e}var Nx=Object.freeze({__proto__:null,isBytes:Hs,abytes:Oa,bytesToHex:js,numberToHexUnpadded:lg,hexToNumber:Nl,hexToBytes:To,bytesToNumberBE:zs,bytesToNumberLE:ko,numberToBytesBE:Co,numberToBytesLE:Na,numberToVarBytesBE:Tx,ensureBytes:Cr,concatBytes:qs,equalBytes:kx,utf8ToBytes:Cx,bitLen:Lx,bitGet:$x,bitSet:Mx,bitMask:Pl,createHmacDrbg:pg,validateObject:Lo});/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Fr=BigInt(0),hr=BigInt(1),Vs=BigInt(2),Px=BigInt(3),Fl=BigInt(4),gg=BigInt(5),yg=BigInt(8);BigInt(9),BigInt(16);function ir(e,t){const r=e%t;return r>=Fr?r:t+r}function Ux(e,t,r){if(r<=Fr||t 0");if(r===hr)return Fr;let n=hr;for(;t>Fr;)t&hr&&(n=n*e%r),e=e*e%r,t>>=hr;return n}function wr(e,t,r){let n=e;for(;t-- >Fr;)n*=n,n%=r;return n}function Dl(e,t){if(e===Fr||t<=Fr)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=ir(e,t),n=t,i=Fr,s=hr;for(;r!==Fr;){const a=n/r,c=n%r,u=i-s*a;n=r,r=c,i=s,s=u}if(n!==hr)throw new Error("invert: does not exist");return ir(i,t)}function Fx(e){const t=(e-hr)/Vs;let r,n,i;for(r=e-hr,n=0;r%Vs===Fr;r/=Vs,n++);for(i=Vs;i(ir(e,t)&hr)===hr,jx=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function zx(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=jx.reduce((n,i)=>(n[i]="function",n),t);return Lo(e,r)}function qx(e,t,r){if(r 0");if(r===Fr)return e.ONE;if(r===hr)return t;let n=e.ONE,i=t;for(;r>Fr;)r&hr&&(n=e.mul(n,i)),i=e.sqr(i),r>>=hr;return n}function Vx(e,t){const r=new Array(t.length),n=t.reduce((s,o,a)=>e.is0(o)?s:(r[a]=s,e.mul(s,o)),e.ONE),i=e.inv(n);return t.reduceRight((s,o,a)=>e.is0(o)?s:(r[a]=e.mul(s,r[a]),e.mul(s,o)),i),r}function wg(e,t){const r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function mg(e,t,r=!1,n={}){if(e<=Fr)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:i,nByteLength:s}=wg(e,t);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=Dx(e),a=Object.freeze({ORDER:e,BITS:i,BYTES:s,MASK:Pl(i),ZERO:Fr,ONE:hr,create:c=>ir(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Fr<=c&&cc===Fr,isOdd:c=>(c&hr)===hr,neg:c=>ir(-c,e),eql:(c,u)=>c===u,sqr:c=>ir(c*c,e),add:(c,u)=>ir(c+u,e),sub:(c,u)=>ir(c-u,e),mul:(c,u)=>ir(c*u,e),pow:(c,u)=>qx(a,c,u),div:(c,u)=>ir(c*Dl(u,e),e),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>Dl(c,e),sqrt:n.sqrt||(c=>o(a,c)),invertBatch:c=>Vx(a,c),cmov:(c,u,l)=>l?u:c,toBytes:c=>r?Na(c,s):Co(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return r?ko(c):zs(c)}});return Object.freeze(a)}function Wx(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?e.neg(r):r}function bg(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function vg(e){const t=bg(e);return t+Math.ceil(t/2)}function Kx(e,t,r=!1){const n=e.length,i=bg(t),s=vg(t);if(n<16||n1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);const o=r?zs(e):ko(e),a=ir(o,t-hr)+hr;return r?Na(a,i):Co(a,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Zx=BigInt(0),Hl=BigInt(1);function _g(e,t){const r=(i,s)=>{const o=s.negate();return i?o:s},n=i=>{const s=Math.ceil(t/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:r,unsafeLadder(i,s){let o=e.ZERO,a=i;for(;s>Zx;)s&Hl&&(o=o.add(a)),a=a.double(),s>>=Hl;return o},precomputeWindow(i,s){const{windows:o,windowSize:a}=n(s),c=[];let u=i,l=u;for(let y=0;y>=v,P>c&&(P-=A,o+=Hl);const H=M,F=M+Math.abs(P)-1,N=R%2!==0,$=P<0;P===0?l=l.add(r(N,s[H])):u=u.add(r($,s[F]))}return{p:u,f:l}},wNAFCached(i,s,o,a){const c=i._WINDOW_SIZE||1;let u=s.get(i);return u||(u=this.precomputeWindow(i,c),c!==1&&s.set(i,a(u))),this.wNAF(c,u,o)}}}function jl(e){return zx(e.Fp),Lo(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...wg(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ri=BigInt(0),An=BigInt(1),df=BigInt(2),Gx=BigInt(8),Yx={zip215:!0};function Xx(e){const t=jl(e);return Lo(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}function zl(e){const t=Xx(e),{Fp:r,n,prehash:i,hash:s,randomBytes:o,nByteLength:a,h:c}=t,u=df<{try{return{isValid:!0,value:r.sqrt(E*r.inv(x))}}catch{return{isValid:!1,value:ri}}}),A=t.adjustScalarBytes||(E=>E),v=t.domain||((E,x,T)=>{if(x.length||T)throw new Error("Contexts/pre-hash are not supported");return E}),R=E=>typeof E=="bigint"&&riR(E)&&R(x)&&EE===ri||M(E,u);function H(E,x){if(M(E,x))return E;throw new Error(`Expected valid scalar < ${x}, got ${typeof E} ${E}`)}function F(E){return E===ri?E:H(E,n)}const N=new Map;function $(E){if(!(E instanceof q))throw new Error("ExtendedPoint expected")}class q{constructor(x,T,B,d){if(this.ex=x,this.ey=T,this.ez=B,this.et=d,!P(x))throw new Error("x required");if(!P(T))throw new Error("y required");if(!P(B))throw new Error("z required");if(!P(d))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(x){if(x instanceof q)throw new Error("extended point not allowed");const{x:T,y:B}=x||{};if(!P(T)||!P(B))throw new Error("invalid affine point");return new q(T,B,An,l(T*B))}static normalizeZ(x){const T=r.invertBatch(x.map(B=>B.ez));return x.map((B,d)=>B.toAffine(T[d])).map(q.fromAffine)}_setWindowSize(x){this._WINDOW_SIZE=x,N.delete(this)}assertValidity(){const{a:x,d:T}=t;if(this.is0())throw new Error("bad point: ZERO");const{ex:B,ey:d,ez:k,et:W}=this,K=l(B*B),re=l(d*d),xe=l(k*k),be=l(xe*xe),ge=l(K*x),tt=l(xe*l(ge+re)),Ue=l(be+l(T*l(K*re)));if(tt!==Ue)throw new Error("bad point: equation left != right (1)");const Pe=l(B*d),pe=l(k*W);if(Pe!==pe)throw new Error("bad point: equation left != right (2)")}equals(x){$(x);const{ex:T,ey:B,ez:d}=this,{ex:k,ey:W,ez:K}=x,re=l(T*K),xe=l(k*d),be=l(B*K),ge=l(W*d);return re===xe&&be===ge}is0(){return this.equals(q.ZERO)}negate(){return new q(l(-this.ex),this.ey,this.ez,l(-this.et))}double(){const{a:x}=t,{ex:T,ey:B,ez:d}=this,k=l(T*T),W=l(B*B),K=l(df*l(d*d)),re=l(x*k),xe=T+B,be=l(l(xe*xe)-k-W),ge=re+W,tt=ge-K,Ue=re-W,Pe=l(be*tt),pe=l(ge*Ue),we=l(be*Ue),ke=l(tt*ge);return new q(Pe,pe,ke,we)}add(x){$(x);const{a:T,d:B}=t,{ex:d,ey:k,ez:W,et:K}=this,{ex:re,ey:xe,ez:be,et:ge}=x;if(T===BigInt(-1)){const Wt=l((k-d)*(xe+re)),xt=l((k+d)*(xe-re)),At=l(xt-Wt);if(At===ri)return this.double();const Xt=l(W*df*ge),Tt=l(K*df*be),C=Tt+Xt,w=xt+Wt,b=Tt-Xt,D=l(C*At),V=l(w*b),X=l(C*b),ae=l(At*w);return new q(D,V,ae,X)}const tt=l(d*re),Ue=l(k*xe),Pe=l(K*B*ge),pe=l(W*be),we=l((d+k)*(re+xe)-tt-Ue),ke=pe-Pe,vt=pe+Pe,He=l(Ue-T*tt),it=l(we*ke),Ht=l(vt*He),ut=l(we*He),pt=l(ke*vt);return new q(it,Ht,pt,ut)}subtract(x){return this.add(x.negate())}wNAF(x){return z.wNAFCached(this,N,x,q.normalizeZ)}multiply(x){const{p:T,f:B}=this.wNAF(H(x,n));return q.normalizeZ([T,B])[0]}multiplyUnsafe(x){let T=F(x);return T===ri?Z:this.equals(Z)||T===An?this:this.equals(G)?this.wNAF(T).p:z.unsafeLadder(this,T)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return z.unsafeLadder(this,n).is0()}toAffine(x){const{ex:T,ey:B,ez:d}=this,k=this.is0();x==null&&(x=k?Gx:r.inv(d));const W=l(T*x),K=l(B*x),re=l(d*x);if(k)return{x:ri,y:An};if(re!==An)throw new Error("invZ was invalid");return{x:W,y:K}}clearCofactor(){const{h:x}=t;return x===An?this:this.multiplyUnsafe(x)}static fromHex(x,T=!1){const{d:B,a:d}=t,k=r.BYTES;x=Cr("pointHex",x,k);const W=x.slice(),K=x[k-1];W[k-1]=K&-129;const re=ko(W);re===ri||(T?H(re,u):H(re,r.ORDER));const xe=l(re*re),be=l(xe-An),ge=l(B*xe-d);let{isValid:tt,value:Ue}=y(be,ge);if(!tt)throw new Error("Point.fromHex: invalid y coordinate");const Pe=(Ue&An)===An,pe=(K&128)!==0;if(!T&&Ue===ri&&pe)throw new Error("Point.fromHex: x=0 and x_0=1");return pe!==Pe&&(Ue=l(-Ue)),q.fromAffine({x:Ue,y:re})}static fromPrivateKey(x){return Q(x).point}toRawBytes(){const{x,y:T}=this.toAffine(),B=Na(T,r.BYTES);return B[B.length-1]|=x&An?128:0,B}toHex(){return js(this.toRawBytes())}}q.BASE=new q(t.Gx,t.Gy,An,l(t.Gx*t.Gy)),q.ZERO=new q(ri,An,An,ri);const{BASE:G,ZERO:Z}=q,z=_g(q,a*8);function ee(E){return ir(E,n)}function se(E){return ee(ko(E))}function Q(E){const x=a;E=Cr("private key",E,x);const T=Cr("hashed private key",s(E),2*x),B=A(T.slice(0,x)),d=T.slice(x,2*x),k=se(B),W=G.multiply(k),K=W.toRawBytes();return{head:B,prefix:d,scalar:k,point:W,pointBytes:K}}function I(E){return Q(E).pointBytes}function g(E=new Uint8Array,...x){const T=qs(...x);return se(s(v(T,Cr("context",E),!!i)))}function f(E,x,T={}){E=Cr("message",E),i&&(E=i(E));const{prefix:B,scalar:d,pointBytes:k}=Q(x),W=g(T.context,B,E),K=G.multiply(W).toRawBytes(),re=g(T.context,K,k,E),xe=ee(W+re*d);F(xe);const be=qs(K,Na(xe,r.BYTES));return Cr("result",be,a*2)}const h=Yx;function m(E,x,T,B=h){const{context:d,zip215:k}=B,W=r.BYTES;E=Cr("signature",E,2*W),x=Cr("message",x),i&&(x=i(x));const K=ko(E.slice(W,2*W));let re,xe,be;try{re=q.fromHex(T,k),xe=q.fromHex(E.slice(0,W),k),be=G.multiplyUnsafe(K)}catch{return!1}if(!k&&re.isSmallOrder())return!1;const ge=g(d,xe.toRawBytes(),re.toRawBytes(),x);return xe.add(re.multiplyUnsafe(ge)).subtract(be).clearCofactor().equals(q.ZERO)}return G._setWindowSize(8),{CURVE:t,getPublicKey:I,sign:f,verify:m,ExtendedPoint:q,utils:{getExtendedPublicKey:Q,randomPrivateKey:()=>o(r.BYTES),precompute(E=8,x=q.BASE){return x._setWindowSize(E),x.multiply(BigInt(3)),x}}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */BigInt(0),BigInt(1);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ql=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Eg=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const Jx=BigInt(1),Vl=BigInt(2),Qx=BigInt(5),xg=BigInt(10),eS=BigInt(20),tS=BigInt(40),Sg=BigInt(80);function rS(e){const t=ql,n=e*e%t*e%t,i=wr(n,Vl,t)*n%t,s=wr(i,Jx,t)*e%t,o=wr(s,Qx,t)*s%t,a=wr(o,xg,t)*o%t,c=wr(a,eS,t)*a%t,u=wr(c,tS,t)*c%t,l=wr(u,Sg,t)*u%t,y=wr(l,Sg,t)*u%t,A=wr(y,xg,t)*o%t;return{pow_p_5_8:wr(A,Vl,t)*e%t,b2:n}}function nS(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function iS(e,t){const r=ql,n=ir(t*t*t,r),i=ir(n*n*t,r),s=rS(e*i).pow_p_5_8;let o=ir(e*n*s,r);const a=ir(t*o*o,r),c=o,u=ir(o*Eg,r),l=a===e,y=a===ir(-e,r),A=a===ir(-e*Eg,r);return l&&(o=c),(y||A)&&(o=u),Hx(o,r)&&(o=ir(-o,r)),{isValid:l||y,value:o}}const $i=mg(ql,void 0,!0),Wl={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:$i,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:fg,randomBytes:og,adjustScalarBytes:nS,uvRatio:iS},pf=zl(Wl);function Ag(e,t,r){if(t.length>255)throw new Error("Context is too big");return ng(rg("SigEd25519 no Ed25519 collisions"),new Uint8Array([r?1:0,t.length]),t,e)}({...Wl},{...Wl});const sS=($i.ORDER+BigInt(3))/BigInt(8);$i.pow(Vl,sS),$i.sqrt($i.neg($i.ONE)),($i.ORDER-BigInt(5))/BigInt(8),BigInt(486662),Wx($i,$i.neg(BigInt(486664))),BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var Kl={exports:{}},oS={},aS=Object.freeze({__proto__:null,default:oS}),Bg=Nn(aS);(function(e){(function(t,r){function n(g,f){if(!g)throw new Error(f||"Assertion failed")}function i(g,f){g.super_=f;var h=function(){};h.prototype=f.prototype,g.prototype=new h,g.prototype.constructor=g}function s(g,f,h){if(s.isBN(g))return g;this.negative=0,this.words=null,this.length=0,this.red=null,g!==null&&((f==="le"||f==="be")&&(h=f,f=10),this._init(g||0,f||10,h||"be"))}typeof t=="object"?t.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=Bg.Buffer}catch{}s.isBN=function(f){return f instanceof s?!0:f!==null&&typeof f=="object"&&f.constructor.wordSize===s.wordSize&&Array.isArray(f.words)},s.max=function(f,h){return f.cmp(h)>0?f:h},s.min=function(f,h){return f.cmp(h)<0?f:h},s.prototype._init=function(f,h,m){if(typeof f=="number")return this._initNumber(f,h,m);if(typeof f=="object")return this._initArray(f,h,m);h==="hex"&&(h=16),n(h===(h|0)&&h>=2&&h<=36),f=f.toString().replace(/\s+/g,"");var _=0;f[0]==="-"&&(_++,this.negative=1),_=0;_-=3)x=f[_]|f[_-1]<<8|f[_-2]<<16,this.words[E]|=x<>>26-T&67108863,T+=24,T>=26&&(T-=26,E++);else if(m==="le")for(_=0,E=0;_>>26-T&67108863,T+=24,T>=26&&(T-=26,E++);return this._strip()};function a(g,f){var h=g.charCodeAt(f);if(h>=48&&h<=57)return h-48;if(h>=65&&h<=70)return h-55;if(h>=97&&h<=102)return h-87;n(!1,"Invalid character in "+g)}function c(g,f,h){var m=a(g,h);return h-1>=f&&(m|=a(g,h-1)<<4),m}s.prototype._parseHex=function(f,h,m){this.length=Math.ceil((f.length-h)/6),this.words=new Array(this.length);for(var _=0;_=h;_-=2)T=c(f,h,_)<=18?(E-=18,x+=1,this.words[x]|=T>>>26):E+=8;else{var B=f.length-h;for(_=B%2===0?h+1:h;_=18?(E-=18,x+=1,this.words[x]|=T>>>26):E+=8}this._strip()};function u(g,f,h,m){for(var _=0,E=0,x=Math.min(g.length,h),T=f;T=49?E=B-49+10:B>=17?E=B-17+10:E=B,n(B>=0&&E1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=y}catch{s.prototype.inspect=y}else s.prototype.inspect=y;function y(){return(this.red?""}var A=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],v=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],R=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(f,h){f=f||10,h=h|0||1;var m;if(f===16||f==="hex"){m="";for(var _=0,E=0,x=0;x>>24-_&16777215,_+=2,_>=26&&(_-=26,x--),E!==0||x!==this.length-1?m=A[6-B.length]+B+m:m=B+m}for(E!==0&&(m=E.toString(16)+m);m.length%h!==0;)m="0"+m;return this.negative!==0&&(m="-"+m),m}if(f===(f|0)&&f>=2&&f<=36){var d=v[f],k=R[f];m="";var W=this.clone();for(W.negative=0;!W.isZero();){var K=W.modrn(k).toString(f);W=W.idivn(k),W.isZero()?m=K+m:m=A[d-K.length]+K+m}for(this.isZero()&&(m="0"+m);m.length%h!==0;)m="0"+m;return this.negative!==0&&(m="-"+m),m}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var f=this.words[0];return this.length===2?f+=this.words[1]*67108864:this.length===3&&this.words[2]===1?f+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-f:f},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(f,h){return this.toArrayLike(o,f,h)}),s.prototype.toArray=function(f,h){return this.toArrayLike(Array,f,h)};var M=function(f,h){return f.allocUnsafe?f.allocUnsafe(h):new f(h)};s.prototype.toArrayLike=function(f,h,m){this._strip();var _=this.byteLength(),E=m||Math.max(1,_);n(_<=E,"byte array longer than desired length"),n(E>0,"Requested array length <= 0");var x=M(f,E),T=h==="le"?"LE":"BE";return this["_toArrayLike"+T](x,_),x},s.prototype._toArrayLikeLE=function(f,h){for(var m=0,_=0,E=0,x=0;E>8&255),m>16&255),x===6?(m>24&255),_=0,x=0):(_=T>>>24,x+=2)}if(m=0&&(f[m--]=T>>8&255),m>=0&&(f[m--]=T>>16&255),x===6?(m>=0&&(f[m--]=T>>24&255),_=0,x=0):(_=T>>>24,x+=2)}if(m>=0)for(f[m--]=_;m>=0;)f[m--]=0},Math.clz32?s.prototype._countBits=function(f){return 32-Math.clz32(f)}:s.prototype._countBits=function(f){var h=f,m=0;return h>=4096&&(m+=13,h>>>=13),h>=64&&(m+=7,h>>>=7),h>=8&&(m+=4,h>>>=4),h>=2&&(m+=2,h>>>=2),m+h},s.prototype._zeroBits=function(f){if(f===0)return 26;var h=f,m=0;return h&8191||(m+=13,h>>>=13),h&127||(m+=7,h>>>=7),h&15||(m+=4,h>>>=4),h&3||(m+=2,h>>>=2),h&1||m++,m},s.prototype.bitLength=function(){var f=this.words[this.length-1],h=this._countBits(f);return(this.length-1)*26+h};function P(g){for(var f=new Array(g.bitLength()),h=0;h>>_&1}return f}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var f=0,h=0;hf.length?this.clone().ior(f):f.clone().ior(this)},s.prototype.uor=function(f){return this.length>f.length?this.clone().iuor(f):f.clone().iuor(this)},s.prototype.iuand=function(f){var h;this.length>f.length?h=f:h=this;for(var m=0;mf.length?this.clone().iand(f):f.clone().iand(this)},s.prototype.uand=function(f){return this.length>f.length?this.clone().iuand(f):f.clone().iuand(this)},s.prototype.iuxor=function(f){var h,m;this.length>f.length?(h=this,m=f):(h=f,m=this);for(var _=0;_f.length?this.clone().ixor(f):f.clone().ixor(this)},s.prototype.uxor=function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},s.prototype.inotn=function(f){n(typeof f=="number"&&f>=0);var h=Math.ceil(f/26)|0,m=f%26;this._expand(h),m>0&&h--;for(var _=0;_0&&(this.words[_]=~this.words[_]&67108863>>26-m),this._strip()},s.prototype.notn=function(f){return this.clone().inotn(f)},s.prototype.setn=function(f,h){n(typeof f=="number"&&f>=0);var m=f/26|0,_=f%26;return this._expand(m+1),h?this.words[m]=this.words[m]|1<<_:this.words[m]=this.words[m]&~(1<<_),this._strip()},s.prototype.iadd=function(f){var h;if(this.negative!==0&&f.negative===0)return this.negative=0,h=this.isub(f),this.negative^=1,this._normSign();if(this.negative===0&&f.negative!==0)return f.negative=0,h=this.isub(f),f.negative=1,h._normSign();var m,_;this.length>f.length?(m=this,_=f):(m=f,_=this);for(var E=0,x=0;x<_.length;x++)h=(m.words[x]|0)+(_.words[x]|0)+E,this.words[x]=h&67108863,E=h>>>26;for(;E!==0&&x>>26;if(this.length=m.length,E!==0)this.words[this.length]=E,this.length++;else if(m!==this)for(;xf.length?this.clone().iadd(f):f.clone().iadd(this)},s.prototype.isub=function(f){if(f.negative!==0){f.negative=0;var h=this.iadd(f);return f.negative=1,h._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var m=this.cmp(f);if(m===0)return this.negative=0,this.length=1,this.words[0]=0,this;var _,E;m>0?(_=this,E=f):(_=f,E=this);for(var x=0,T=0;T>26,this.words[T]=h&67108863;for(;x!==0&&T<_.length;T++)h=(_.words[T]|0)+x,x=h>>26,this.words[T]=h&67108863;if(x===0&&T<_.length&&_!==this)for(;T<_.length;T++)this.words[T]=_.words[T];return this.length=Math.max(this.length,T),_!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(f){return this.clone().isub(f)};function H(g,f,h){h.negative=f.negative^g.negative;var m=g.length+f.length|0;h.length=m,m=m-1|0;var _=g.words[0]|0,E=f.words[0]|0,x=_*E,T=x&67108863,B=x/67108864|0;h.words[0]=T;for(var d=1;d>>26,W=B&67108863,K=Math.min(d,f.length-1),re=Math.max(0,d-g.length+1);re<=K;re++){var xe=d-re|0;_=g.words[xe]|0,E=f.words[re]|0,x=_*E+W,k+=x/67108864|0,W=x&67108863}h.words[d]=W|0,B=k|0}return B!==0?h.words[d]=B|0:h.length--,h._strip()}var F=function(f,h,m){var _=f.words,E=h.words,x=m.words,T=0,B,d,k,W=_[0]|0,K=W&8191,re=W>>>13,xe=_[1]|0,be=xe&8191,ge=xe>>>13,tt=_[2]|0,Ue=tt&8191,Pe=tt>>>13,pe=_[3]|0,we=pe&8191,ke=pe>>>13,vt=_[4]|0,He=vt&8191,it=vt>>>13,Ht=_[5]|0,ut=Ht&8191,pt=Ht>>>13,Wt=_[6]|0,xt=Wt&8191,At=Wt>>>13,Xt=_[7]|0,Tt=Xt&8191,C=Xt>>>13,w=_[8]|0,b=w&8191,D=w>>>13,V=_[9]|0,X=V&8191,ae=V>>>13,Ze=E[0]|0,Ge=Ze&8191,We=Ze>>>13,jt=E[1]|0,ze=jt&8191,rr=jt>>>13,$a=E[2]|0,yr=$a&8191,vr=$a>>>13,Rl=E[3]|0,zt=Rl&8191,Yt=Rl>>>13,es=E[4]|0,ur=es&8191,lr=es>>>13,tf=E[5]|0,_r=tf&8191,kt=tf>>>13,rf=E[6]|0,S=rf&8191,L=rf>>>13,O=E[7]|0,p=O&8191,U=O>>>13,J=E[8]|0,Y=J&8191,ue=J>>>13,_e=E[9]|0,Ae=_e&8191,Ee=_e>>>13;m.negative=f.negative^h.negative,m.length=19,B=Math.imul(K,Ge),d=Math.imul(K,We),d=d+Math.imul(re,Ge)|0,k=Math.imul(re,We);var Bt=(T+B|0)+((d&8191)<<13)|0;T=(k+(d>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,B=Math.imul(be,Ge),d=Math.imul(be,We),d=d+Math.imul(ge,Ge)|0,k=Math.imul(ge,We),B=B+Math.imul(K,ze)|0,d=d+Math.imul(K,rr)|0,d=d+Math.imul(re,ze)|0,k=k+Math.imul(re,rr)|0;var Le=(T+B|0)+((d&8191)<<13)|0;T=(k+(d>>>13)|0)+(Le>>>26)|0,Le&=67108863,B=Math.imul(Ue,Ge),d=Math.imul(Ue,We),d=d+Math.imul(Pe,Ge)|0,k=Math.imul(Pe,We),B=B+Math.imul(be,ze)|0,d=d+Math.imul(be,rr)|0,d=d+Math.imul(ge,ze)|0,k=k+Math.imul(ge,rr)|0,B=B+Math.imul(K,yr)|0,d=d+Math.imul(K,vr)|0,d=d+Math.imul(re,yr)|0,k=k+Math.imul(re,vr)|0;var Ke=(T+B|0)+((d&8191)<<13)|0;T=(k+(d>>>13)|0)+(Ke>>>26)|0,Ke&=67108863,B=Math.imul(we,Ge),d=Math.imul(we,We),d=d+Math.imul(ke,Ge)|0,k=Math.imul(ke,We),B=B+Math.imul(Ue,ze)|0,d=d+Math.imul(Ue,rr)|0,d=d+Math.imul(Pe,ze)|0,k=k+Math.imul(Pe,rr)|0,B=B+Math.imul(be,yr)|0,d=d+Math.imul(be,vr)|0,d=d+Math.imul(ge,yr)|0,k=k+Math.imul(ge,vr)|0,B=B+Math.imul(K,zt)|0,d=d+Math.imul(K,Yt)|0,d=d+Math.imul(re,zt)|0,k=k+Math.imul(re,Yt)|0;var Ye=(T+B|0)+((d&8191)<<13)|0;T=(k+(d>>>13)|0)+(Ye>>>26)|0,Ye&=67108863,B=Math.imul(He,Ge),d=Math.imul(He,We),d=d+Math.imul(it,Ge)|0,k=Math.imul(it,We),B=B+Math.imul(we,ze)|0,d=d+Math.imul(we,rr)|0,d=d+Math.imul(ke,ze)|0,k=k+Math.imul(ke,rr)|0,B=B+Math.imul(Ue,yr)|0,d=d+Math.imul(Ue,vr)|0,d=d+Math.imul(Pe,yr)|0,k=k+Math.imul(Pe,vr)|0,B=B+Math.imul(be,zt)|0,d=d+Math.imul(be,Yt)|0,d=d+Math.imul(ge,zt)|0,k=k+Math.imul(ge,Yt)|0,B=B+Math.imul(K,ur)|0,d=d+Math.imul(K,lr)|0,d=d+Math.imul(re,ur)|0,k=k+Math.imul(re,lr)|0;var lt=(T+B|0)+((d&8191)<<13)|0;T=(k+(d>>>13)|0)+(lt>>>26)|0,lt&=67108863,B=Math.imul(ut,Ge),d=Math.imul(ut,We),d=d+Math.imul(pt,Ge)|0,k=Math.imul(pt,We),B=B+Math.imul(He,ze)|0,d=d+Math.imul(He,rr)|0,d=d+Math.imul(it,ze)|0,k=k+Math.imul(it,rr)|0,B=B+Math.imul(we,yr)|0,d=d+Math.imul(we,vr)|0,d=d+Math.imul(ke,yr)|0,k=k+Math.imul(ke,vr)|0,B=B+Math.imul(Ue,zt)|0,d=d+Math.imul(Ue,Yt)|0,d=d+Math.imul(Pe,zt)|0,k=k+Math.imul(Pe,Yt)|0,B=B+Math.imul(be,ur)|0,d=d+Math.imul(be,lr)|0,d=d+Math.imul(ge,ur)|0,k=k+Math.imul(ge,lr)|0,B=B+Math.imul(K,_r)|0,d=d+Math.imul(K,kt)|0,d=d+Math.imul(re,_r)|0,k=k+Math.imul(re,kt)|0;var ct=(T+B|0)+((d&8191)<<13)|0;T=(k+(d>>>13)|0)+(ct>>>26)|0,ct&=67108863,B=Math.imul(xt,Ge),d=Math.imul(xt,We),d=d+Math.imul(At,Ge)|0,k=Math.imul(At,We),B=B+Math.imul(ut,ze)|0,d=d+Math.imul(ut,rr)|0,d=d+Math.imul(pt,ze)|0,k=k+Math.imul(pt,rr)|0,B=B+Math.imul(He,yr)|0,d=d+Math.imul(He,vr)|0,d=d+Math.imul(it,yr)|0,k=k+Math.imul(it,vr)|0,B=B+Math.imul(we,zt)|0,d=d+Math.imul(we,Yt)|0,d=d+Math.imul(ke,zt)|0,k=k+Math.imul(ke,Yt)|0,B=B+Math.imul(Ue,ur)|0,d=d+Math.imul(Ue,lr)|0,d=d+Math.imul(Pe,ur)|0,k=k+Math.imul(Pe,lr)|0,B=B+Math.imul(be,_r)|0,d=d+Math.imul(be,kt)|0,d=d+Math.imul(ge,_r)|0,k=k+Math.imul(ge,kt)|0,B=B+Math.imul(K,S)|0,d=d+Math.imul(K,L)|0,d=d+Math.imul(re,S)|0,k=k+Math.imul(re,L)|0;var Xe=(T+B|0)+((d&8191)<<13)|0;T=(k+(d>>>13)|0)+(Xe>>>26)|0,Xe&=67108863,B=Math.imul(Tt,Ge),d=Math.imul(Tt,We),d=d+Math.imul(C,Ge)|0,k=Math.imul(C,We),B=B+Math.imul(xt,ze)|0,d=d+Math.imul(xt,rr)|0,d=d+Math.imul(At,ze)|0,k=k+Math.imul(At,rr)|0,B=B+Math.imul(ut,yr)|0,d=d+Math.imul(ut,vr)|0,d=d+Math.imul(pt,yr)|0,k=k+Math.imul(pt,vr)|0,B=B+Math.imul(He,zt)|0,d=d+Math.imul(He,Yt)|0,d=d+Math.imul(it,zt)|0,k=k+Math.imul(it,Yt)|0,B=B+Math.imul(we,ur)|0,d=d+Math.imul(we,lr)|0,d=d+Math.imul(ke,ur)|0,k=k+Math.imul(ke,lr)|0,B=B+Math.imul(Ue,_r)|0,d=d+Math.imul(Ue,kt)|0,d=d+Math.imul(Pe,_r)|0,k=k+Math.imul(Pe,kt)|0,B=B+Math.imul(be,S)|0,d=d+Math.imul(be,L)|0,d=d+Math.imul(ge,S)|0,k=k+Math.imul(ge,L)|0,B=B+Math.imul(K,p)|0,d=d+Math.imul(K,U)|0,d=d+Math.imul(re,p)|0,k=k+Math.imul(re,U)|0;var rt=(T+B|0)+((d&8191)<<13)|0;T=(k+(d>>>13)|0)+(rt>>>26)|0,rt&=67108863,B=Math.imul(b,Ge),d=Math.imul(b,We),d=d+Math.imul(D,Ge)|0,k=Math.imul(D,We),B=B+Math.imul(Tt,ze)|0,d=d+Math.imul(Tt,rr)|0,d=d+Math.imul(C,ze)|0,k=k+Math.imul(C,rr)|0,B=B+Math.imul(xt,yr)|0,d=d+Math.imul(xt,vr)|0,d=d+Math.imul(At,yr)|0,k=k+Math.imul(At,vr)|0,B=B+Math.imul(ut,zt)|0,d=d+Math.imul(ut,Yt)|0,d=d+Math.imul(pt,zt)|0,k=k+Math.imul(pt,Yt)|0,B=B+Math.imul(He,ur)|0,d=d+Math.imul(He,lr)|0,d=d+Math.imul(it,ur)|0,k=k+Math.imul(it,lr)|0,B=B+Math.imul(we,_r)|0,d=d+Math.imul(we,kt)|0,d=d+Math.imul(ke,_r)|0,k=k+Math.imul(ke,kt)|0,B=B+Math.imul(Ue,S)|0,d=d+Math.imul(Ue,L)|0,d=d+Math.imul(Pe,S)|0,k=k+Math.imul(Pe,L)|0,B=B+Math.imul(be,p)|0,d=d+Math.imul(be,U)|0,d=d+Math.imul(ge,p)|0,k=k+Math.imul(ge,U)|0,B=B+Math.imul(K,Y)|0,d=d+Math.imul(K,ue)|0,d=d+Math.imul(re,Y)|0,k=k+Math.imul(re,ue)|0;var Je=(T+B|0)+((d&8191)<<13)|0;T=(k+(d>>>13)|0)+(Je>>>26)|0,Je&=67108863,B=Math.imul(X,Ge),d=Math.imul(X,We),d=d+Math.imul(ae,Ge)|0,k=Math.imul(ae,We),B=B+Math.imul(b,ze)|0,d=d+Math.imul(b,rr)|0,d=d+Math.imul(D,ze)|0,k=k+Math.imul(D,rr)|0,B=B+Math.imul(Tt,yr)|0,d=d+Math.imul(Tt,vr)|0,d=d+Math.imul(C,yr)|0,k=k+Math.imul(C,vr)|0,B=B+Math.imul(xt,zt)|0,d=d+Math.imul(xt,Yt)|0,d=d+Math.imul(At,zt)|0,k=k+Math.imul(At,Yt)|0,B=B+Math.imul(ut,ur)|0,d=d+Math.imul(ut,lr)|0,d=d+Math.imul(pt,ur)|0,k=k+Math.imul(pt,lr)|0,B=B+Math.imul(He,_r)|0,d=d+Math.imul(He,kt)|0,d=d+Math.imul(it,_r)|0,k=k+Math.imul(it,kt)|0,B=B+Math.imul(we,S)|0,d=d+Math.imul(we,L)|0,d=d+Math.imul(ke,S)|0,k=k+Math.imul(ke,L)|0,B=B+Math.imul(Ue,p)|0,d=d+Math.imul(Ue,U)|0,d=d+Math.imul(Pe,p)|0,k=k+Math.imul(Pe,U)|0,B=B+Math.imul(be,Y)|0,d=d+Math.imul(be,ue)|0,d=d+Math.imul(ge,Y)|0,k=k+Math.imul(ge,ue)|0,B=B+Math.imul(K,Ae)|0,d=d+Math.imul(K,Ee)|0,d=d+Math.imul(re,Ae)|0,k=k+Math.imul(re,Ee)|0;var $e=(T+B|0)+((d&8191)<<13)|0;T=(k+(d>>>13)|0)+($e>>>26)|0,$e&=67108863,B=Math.imul(X,ze),d=Math.imul(X,rr),d=d+Math.imul(ae,ze)|0,k=Math.imul(ae,rr),B=B+Math.imul(b,yr)|0,d=d+Math.imul(b,vr)|0,d=d+Math.imul(D,yr)|0,k=k+Math.imul(D,vr)|0,B=B+Math.imul(Tt,zt)|0,d=d+Math.imul(Tt,Yt)|0,d=d+Math.imul(C,zt)|0,k=k+Math.imul(C,Yt)|0,B=B+Math.imul(xt,ur)|0,d=d+Math.imul(xt,lr)|0,d=d+Math.imul(At,ur)|0,k=k+Math.imul(At,lr)|0,B=B+Math.imul(ut,_r)|0,d=d+Math.imul(ut,kt)|0,d=d+Math.imul(pt,_r)|0,k=k+Math.imul(pt,kt)|0,B=B+Math.imul(He,S)|0,d=d+Math.imul(He,L)|0,d=d+Math.imul(it,S)|0,k=k+Math.imul(it,L)|0,B=B+Math.imul(we,p)|0,d=d+Math.imul(we,U)|0,d=d+Math.imul(ke,p)|0,k=k+Math.imul(ke,U)|0,B=B+Math.imul(Ue,Y)|0,d=d+Math.imul(Ue,ue)|0,d=d+Math.imul(Pe,Y)|0,k=k+Math.imul(Pe,ue)|0,B=B+Math.imul(be,Ae)|0,d=d+Math.imul(be,Ee)|0,d=d+Math.imul(ge,Ae)|0,k=k+Math.imul(ge,Ee)|0;var De=(T+B|0)+((d&8191)<<13)|0;T=(k+(d>>>13)|0)+(De>>>26)|0,De&=67108863,B=Math.imul(X,yr),d=Math.imul(X,vr),d=d+Math.imul(ae,yr)|0,k=Math.imul(ae,vr),B=B+Math.imul(b,zt)|0,d=d+Math.imul(b,Yt)|0,d=d+Math.imul(D,zt)|0,k=k+Math.imul(D,Yt)|0,B=B+Math.imul(Tt,ur)|0,d=d+Math.imul(Tt,lr)|0,d=d+Math.imul(C,ur)|0,k=k+Math.imul(C,lr)|0,B=B+Math.imul(xt,_r)|0,d=d+Math.imul(xt,kt)|0,d=d+Math.imul(At,_r)|0,k=k+Math.imul(At,kt)|0,B=B+Math.imul(ut,S)|0,d=d+Math.imul(ut,L)|0,d=d+Math.imul(pt,S)|0,k=k+Math.imul(pt,L)|0,B=B+Math.imul(He,p)|0,d=d+Math.imul(He,U)|0,d=d+Math.imul(it,p)|0,k=k+Math.imul(it,U)|0,B=B+Math.imul(we,Y)|0,d=d+Math.imul(we,ue)|0,d=d+Math.imul(ke,Y)|0,k=k+Math.imul(ke,ue)|0,B=B+Math.imul(Ue,Ae)|0,d=d+Math.imul(Ue,Ee)|0,d=d+Math.imul(Pe,Ae)|0,k=k+Math.imul(Pe,Ee)|0;var Re=(T+B|0)+((d&8191)<<13)|0;T=(k+(d>>>13)|0)+(Re>>>26)|0,Re&=67108863,B=Math.imul(X,zt),d=Math.imul(X,Yt),d=d+Math.imul(ae,zt)|0,k=Math.imul(ae,Yt),B=B+Math.imul(b,ur)|0,d=d+Math.imul(b,lr)|0,d=d+Math.imul(D,ur)|0,k=k+Math.imul(D,lr)|0,B=B+Math.imul(Tt,_r)|0,d=d+Math.imul(Tt,kt)|0,d=d+Math.imul(C,_r)|0,k=k+Math.imul(C,kt)|0,B=B+Math.imul(xt,S)|0,d=d+Math.imul(xt,L)|0,d=d+Math.imul(At,S)|0,k=k+Math.imul(At,L)|0,B=B+Math.imul(ut,p)|0,d=d+Math.imul(ut,U)|0,d=d+Math.imul(pt,p)|0,k=k+Math.imul(pt,U)|0,B=B+Math.imul(He,Y)|0,d=d+Math.imul(He,ue)|0,d=d+Math.imul(it,Y)|0,k=k+Math.imul(it,ue)|0,B=B+Math.imul(we,Ae)|0,d=d+Math.imul(we,Ee)|0,d=d+Math.imul(ke,Ae)|0,k=k+Math.imul(ke,Ee)|0;var Oe=(T+B|0)+((d&8191)<<13)|0;T=(k+(d>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,B=Math.imul(X,ur),d=Math.imul(X,lr),d=d+Math.imul(ae,ur)|0,k=Math.imul(ae,lr),B=B+Math.imul(b,_r)|0,d=d+Math.imul(b,kt)|0,d=d+Math.imul(D,_r)|0,k=k+Math.imul(D,kt)|0,B=B+Math.imul(Tt,S)|0,d=d+Math.imul(Tt,L)|0,d=d+Math.imul(C,S)|0,k=k+Math.imul(C,L)|0,B=B+Math.imul(xt,p)|0,d=d+Math.imul(xt,U)|0,d=d+Math.imul(At,p)|0,k=k+Math.imul(At,U)|0,B=B+Math.imul(ut,Y)|0,d=d+Math.imul(ut,ue)|0,d=d+Math.imul(pt,Y)|0,k=k+Math.imul(pt,ue)|0,B=B+Math.imul(He,Ae)|0,d=d+Math.imul(He,Ee)|0,d=d+Math.imul(it,Ae)|0,k=k+Math.imul(it,Ee)|0;var Ne=(T+B|0)+((d&8191)<<13)|0;T=(k+(d>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,B=Math.imul(X,_r),d=Math.imul(X,kt),d=d+Math.imul(ae,_r)|0,k=Math.imul(ae,kt),B=B+Math.imul(b,S)|0,d=d+Math.imul(b,L)|0,d=d+Math.imul(D,S)|0,k=k+Math.imul(D,L)|0,B=B+Math.imul(Tt,p)|0,d=d+Math.imul(Tt,U)|0,d=d+Math.imul(C,p)|0,k=k+Math.imul(C,U)|0,B=B+Math.imul(xt,Y)|0,d=d+Math.imul(xt,ue)|0,d=d+Math.imul(At,Y)|0,k=k+Math.imul(At,ue)|0,B=B+Math.imul(ut,Ae)|0,d=d+Math.imul(ut,Ee)|0,d=d+Math.imul(pt,Ae)|0,k=k+Math.imul(pt,Ee)|0;var Ie=(T+B|0)+((d&8191)<<13)|0;T=(k+(d>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,B=Math.imul(X,S),d=Math.imul(X,L),d=d+Math.imul(ae,S)|0,k=Math.imul(ae,L),B=B+Math.imul(b,p)|0,d=d+Math.imul(b,U)|0,d=d+Math.imul(D,p)|0,k=k+Math.imul(D,U)|0,B=B+Math.imul(Tt,Y)|0,d=d+Math.imul(Tt,ue)|0,d=d+Math.imul(C,Y)|0,k=k+Math.imul(C,ue)|0,B=B+Math.imul(xt,Ae)|0,d=d+Math.imul(xt,Ee)|0,d=d+Math.imul(At,Ae)|0,k=k+Math.imul(At,Ee)|0;var ce=(T+B|0)+((d&8191)<<13)|0;T=(k+(d>>>13)|0)+(ce>>>26)|0,ce&=67108863,B=Math.imul(X,p),d=Math.imul(X,U),d=d+Math.imul(ae,p)|0,k=Math.imul(ae,U),B=B+Math.imul(b,Y)|0,d=d+Math.imul(b,ue)|0,d=d+Math.imul(D,Y)|0,k=k+Math.imul(D,ue)|0,B=B+Math.imul(Tt,Ae)|0,d=d+Math.imul(Tt,Ee)|0,d=d+Math.imul(C,Ae)|0,k=k+Math.imul(C,Ee)|0;var fe=(T+B|0)+((d&8191)<<13)|0;T=(k+(d>>>13)|0)+(fe>>>26)|0,fe&=67108863,B=Math.imul(X,Y),d=Math.imul(X,ue),d=d+Math.imul(ae,Y)|0,k=Math.imul(ae,ue),B=B+Math.imul(b,Ae)|0,d=d+Math.imul(b,Ee)|0,d=d+Math.imul(D,Ae)|0,k=k+Math.imul(D,Ee)|0;var ye=(T+B|0)+((d&8191)<<13)|0;T=(k+(d>>>13)|0)+(ye>>>26)|0,ye&=67108863,B=Math.imul(X,Ae),d=Math.imul(X,Ee),d=d+Math.imul(ae,Ae)|0,k=Math.imul(ae,Ee);var he=(T+B|0)+((d&8191)<<13)|0;return T=(k+(d>>>13)|0)+(he>>>26)|0,he&=67108863,x[0]=Bt,x[1]=Le,x[2]=Ke,x[3]=Ye,x[4]=lt,x[5]=ct,x[6]=Xe,x[7]=rt,x[8]=Je,x[9]=$e,x[10]=De,x[11]=Re,x[12]=Oe,x[13]=Ne,x[14]=Ie,x[15]=ce,x[16]=fe,x[17]=ye,x[18]=he,T!==0&&(x[19]=T,m.length++),m};Math.imul||(F=H);function N(g,f,h){h.negative=f.negative^g.negative,h.length=g.length+f.length;for(var m=0,_=0,E=0;E>>26)|0,_+=x>>>26,x&=67108863}h.words[E]=T,m=x,x=_}return m!==0?h.words[E]=m:h.length--,h._strip()}function $(g,f,h){return N(g,f,h)}s.prototype.mulTo=function(f,h){var m,_=this.length+f.length;return this.length===10&&f.length===10?m=F(this,f,h):_<63?m=H(this,f,h):_<1024?m=N(this,f,h):m=$(this,f,h),m},s.prototype.mul=function(f){var h=new s(null);return h.words=new Array(this.length+f.length),this.mulTo(f,h)},s.prototype.mulf=function(f){var h=new s(null);return h.words=new Array(this.length+f.length),$(this,f,h)},s.prototype.imul=function(f){return this.clone().mulTo(f,this)},s.prototype.imuln=function(f){var h=f<0;h&&(f=-f),n(typeof f=="number"),n(f<67108864);for(var m=0,_=0;_>=26,m+=E/67108864|0,m+=x>>>26,this.words[_]=x&67108863}return m!==0&&(this.words[_]=m,this.length++),h?this.ineg():this},s.prototype.muln=function(f){return this.clone().imuln(f)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(f){var h=P(f);if(h.length===0)return new s(1);for(var m=this,_=0;_=0);var h=f%26,m=(f-h)/26,_=67108863>>>26-h<<26-h,E;if(h!==0){var x=0;for(E=0;E>>26-h}x&&(this.words[E]=x,this.length++)}if(m!==0){for(E=this.length-1;E>=0;E--)this.words[E+m]=this.words[E];for(E=0;E=0);var _;h?_=(h-h%26)/26:_=0;var E=f%26,x=Math.min((f-E)/26,this.length),T=67108863^67108863>>>E<x)for(this.length-=x,d=0;d=0&&(k!==0||d>=_);d--){var W=this.words[d]|0;this.words[d]=k<<26-E|W>>>E,k=W&T}return B&&k!==0&&(B.words[B.length++]=k),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(f,h,m){return n(this.negative===0),this.iushrn(f,h,m)},s.prototype.shln=function(f){return this.clone().ishln(f)},s.prototype.ushln=function(f){return this.clone().iushln(f)},s.prototype.shrn=function(f){return this.clone().ishrn(f)},s.prototype.ushrn=function(f){return this.clone().iushrn(f)},s.prototype.testn=function(f){n(typeof f=="number"&&f>=0);var h=f%26,m=(f-h)/26,_=1<=0);var h=f%26,m=(f-h)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=m)return this;if(h!==0&&m++,this.length=Math.min(m,this.length),h!==0){var _=67108863^67108863>>>h<=67108864;h++)this.words[h]-=67108864,h===this.length-1?this.words[h+1]=1:this.words[h+1]++;return this.length=Math.max(this.length,h+1),this},s.prototype.isubn=function(f){if(n(typeof f=="number"),n(f<67108864),f<0)return this.iaddn(-f);if(this.negative!==0)return this.negative=0,this.iaddn(f),this.negative=1,this;if(this.words[0]-=f,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var h=0;h>26)-(B/67108864|0),this.words[E+m]=x&67108863}for(;E>26,this.words[E+m]=x&67108863;if(T===0)return this._strip();for(n(T===-1),T=0,E=0;E>26,this.words[E]=x&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(f,h){var m=this.length-f.length,_=this.clone(),E=f,x=E.words[E.length-1]|0,T=this._countBits(x);m=26-T,m!==0&&(E=E.ushln(m),_.iushln(m),x=E.words[E.length-1]|0);var B=_.length-E.length,d;if(h!=="mod"){d=new s(null),d.length=B+1,d.words=new Array(d.length);for(var k=0;k=0;K--){var re=(_.words[E.length+K]|0)*67108864+(_.words[E.length+K-1]|0);for(re=Math.min(re/x|0,67108863),_._ishlnsubmul(E,re,K);_.negative!==0;)re--,_.negative=0,_._ishlnsubmul(E,1,K),_.isZero()||(_.negative^=1);d&&(d.words[K]=re)}return d&&d._strip(),_._strip(),h!=="div"&&m!==0&&_.iushrn(m),{div:d||null,mod:_}},s.prototype.divmod=function(f,h,m){if(n(!f.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var _,E,x;return this.negative!==0&&f.negative===0?(x=this.neg().divmod(f,h),h!=="mod"&&(_=x.div.neg()),h!=="div"&&(E=x.mod.neg(),m&&E.negative!==0&&E.iadd(f)),{div:_,mod:E}):this.negative===0&&f.negative!==0?(x=this.divmod(f.neg(),h),h!=="mod"&&(_=x.div.neg()),{div:_,mod:x.mod}):this.negative&f.negative?(x=this.neg().divmod(f.neg(),h),h!=="div"&&(E=x.mod.neg(),m&&E.negative!==0&&E.isub(f)),{div:x.div,mod:E}):f.length>this.length||this.cmp(f)<0?{div:new s(0),mod:this}:f.length===1?h==="div"?{div:this.divn(f.words[0]),mod:null}:h==="mod"?{div:null,mod:new s(this.modrn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new s(this.modrn(f.words[0]))}:this._wordDiv(f,h)},s.prototype.div=function(f){return this.divmod(f,"div",!1).div},s.prototype.mod=function(f){return this.divmod(f,"mod",!1).mod},s.prototype.umod=function(f){return this.divmod(f,"mod",!0).mod},s.prototype.divRound=function(f){var h=this.divmod(f);if(h.mod.isZero())return h.div;var m=h.div.negative!==0?h.mod.isub(f):h.mod,_=f.ushrn(1),E=f.andln(1),x=m.cmp(_);return x<0||E===1&&x===0?h.div:h.div.negative!==0?h.div.isubn(1):h.div.iaddn(1)},s.prototype.modrn=function(f){var h=f<0;h&&(f=-f),n(f<=67108863);for(var m=(1<<26)%f,_=0,E=this.length-1;E>=0;E--)_=(m*_+(this.words[E]|0))%f;return h?-_:_},s.prototype.modn=function(f){return this.modrn(f)},s.prototype.idivn=function(f){var h=f<0;h&&(f=-f),n(f<=67108863);for(var m=0,_=this.length-1;_>=0;_--){var E=(this.words[_]|0)+m*67108864;this.words[_]=E/f|0,m=E%f}return this._strip(),h?this.ineg():this},s.prototype.divn=function(f){return this.clone().idivn(f)},s.prototype.egcd=function(f){n(f.negative===0),n(!f.isZero());var h=this,m=f.clone();h.negative!==0?h=h.umod(f):h=h.clone();for(var _=new s(1),E=new s(0),x=new s(0),T=new s(1),B=0;h.isEven()&&m.isEven();)h.iushrn(1),m.iushrn(1),++B;for(var d=m.clone(),k=h.clone();!h.isZero();){for(var W=0,K=1;!(h.words[0]&K)&&W<26;++W,K<<=1);if(W>0)for(h.iushrn(W);W-- >0;)(_.isOdd()||E.isOdd())&&(_.iadd(d),E.isub(k)),_.iushrn(1),E.iushrn(1);for(var re=0,xe=1;!(m.words[0]&xe)&&re<26;++re,xe<<=1);if(re>0)for(m.iushrn(re);re-- >0;)(x.isOdd()||T.isOdd())&&(x.iadd(d),T.isub(k)),x.iushrn(1),T.iushrn(1);h.cmp(m)>=0?(h.isub(m),_.isub(x),E.isub(T)):(m.isub(h),x.isub(_),T.isub(E))}return{a:x,b:T,gcd:m.iushln(B)}},s.prototype._invmp=function(f){n(f.negative===0),n(!f.isZero());var h=this,m=f.clone();h.negative!==0?h=h.umod(f):h=h.clone();for(var _=new s(1),E=new s(0),x=m.clone();h.cmpn(1)>0&&m.cmpn(1)>0;){for(var T=0,B=1;!(h.words[0]&B)&&T<26;++T,B<<=1);if(T>0)for(h.iushrn(T);T-- >0;)_.isOdd()&&_.iadd(x),_.iushrn(1);for(var d=0,k=1;!(m.words[0]&k)&&d<26;++d,k<<=1);if(d>0)for(m.iushrn(d);d-- >0;)E.isOdd()&&E.iadd(x),E.iushrn(1);h.cmp(m)>=0?(h.isub(m),_.isub(E)):(m.isub(h),E.isub(_))}var W;return h.cmpn(1)===0?W=_:W=E,W.cmpn(0)<0&&W.iadd(f),W},s.prototype.gcd=function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var h=this.clone(),m=f.clone();h.negative=0,m.negative=0;for(var _=0;h.isEven()&&m.isEven();_++)h.iushrn(1),m.iushrn(1);do{for(;h.isEven();)h.iushrn(1);for(;m.isEven();)m.iushrn(1);var E=h.cmp(m);if(E<0){var x=h;h=m,m=x}else if(E===0||m.cmpn(1)===0)break;h.isub(m)}while(!0);return m.iushln(_)},s.prototype.invm=function(f){return this.egcd(f).a.umod(f)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(f){return this.words[0]&f},s.prototype.bincn=function(f){n(typeof f=="number");var h=f%26,m=(f-h)/26,_=1<>>26,T&=67108863,this.words[x]=T}return E!==0&&(this.words[x]=E,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(f){var h=f<0;if(this.negative!==0&&!h)return-1;if(this.negative===0&&h)return 1;this._strip();var m;if(this.length>1)m=1;else{h&&(f=-f),n(f<=67108863,"Number is too big");var _=this.words[0]|0;m=_===f?0:_f.length)return 1;if(this.length=0;m--){var _=this.words[m]|0,E=f.words[m]|0;if(_!==E){_E&&(h=1);break}}return h},s.prototype.gtn=function(f){return this.cmpn(f)===1},s.prototype.gt=function(f){return this.cmp(f)===1},s.prototype.gten=function(f){return this.cmpn(f)>=0},s.prototype.gte=function(f){return this.cmp(f)>=0},s.prototype.ltn=function(f){return this.cmpn(f)===-1},s.prototype.lt=function(f){return this.cmp(f)===-1},s.prototype.lten=function(f){return this.cmpn(f)<=0},s.prototype.lte=function(f){return this.cmp(f)<=0},s.prototype.eqn=function(f){return this.cmpn(f)===0},s.prototype.eq=function(f){return this.cmp(f)===0},s.red=function(f){return new Q(f)},s.prototype.toRed=function(f){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),f.convertTo(this)._forceRed(f)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(f){return this.red=f,this},s.prototype.forceRed=function(f){return n(!this.red,"Already a number in reduction context"),this._forceRed(f)},s.prototype.redAdd=function(f){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,f)},s.prototype.redIAdd=function(f){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,f)},s.prototype.redSub=function(f){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,f)},s.prototype.redISub=function(f){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,f)},s.prototype.redShl=function(f){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,f)},s.prototype.redMul=function(f){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.mul(this,f)},s.prototype.redIMul=function(f){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.imul(this,f)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(f){return n(this.red&&!f.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,f)};var q={k256:null,p224:null,p192:null,p25519:null};function G(g,f){this.name=g,this.p=new s(f,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}G.prototype._tmp=function(){var f=new s(null);return f.words=new Array(Math.ceil(this.n/13)),f},G.prototype.ireduce=function(f){var h=f,m;do this.split(h,this.tmp),h=this.imulK(h),h=h.iadd(this.tmp),m=h.bitLength();while(m>this.n);var _=m0?h.isub(this.p):h.strip!==void 0?h.strip():h._strip(),h},G.prototype.split=function(f,h){f.iushrn(this.n,0,h)},G.prototype.imulK=function(f){return f.imul(this.k)};function Z(){G.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(Z,G),Z.prototype.split=function(f,h){for(var m=4194303,_=Math.min(f.length,9),E=0;E<_;E++)h.words[E]=f.words[E];if(h.length=_,f.length<=9){f.words[0]=0,f.length=1;return}var x=f.words[9];for(h.words[h.length++]=x&m,E=10;E>>22,x=T}x>>>=22,f.words[E-10]=x,x===0&&f.length>10?f.length-=10:f.length-=9},Z.prototype.imulK=function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var h=0,m=0;m>>=26,f.words[m]=E,h=_}return h!==0&&(f.words[f.length++]=h),f},s._prime=function(f){if(q[f])return q[f];var h;if(f==="k256")h=new Z;else if(f==="p224")h=new z;else if(f==="p192")h=new ee;else if(f==="p25519")h=new se;else throw new Error("Unknown prime "+f);return q[f]=h,h};function Q(g){if(typeof g=="string"){var f=s._prime(g);this.m=f.p,this.prime=f}else n(g.gtn(1),"modulus must be greater than 1"),this.m=g,this.prime=null}Q.prototype._verify1=function(f){n(f.negative===0,"red works only with positives"),n(f.red,"red works only with red numbers")},Q.prototype._verify2=function(f,h){n((f.negative|h.negative)===0,"red works only with positives"),n(f.red&&f.red===h.red,"red works only with red numbers")},Q.prototype.imod=function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):(l(f,f.umod(this.m)._forceRed(this)),f)},Q.prototype.neg=function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},Q.prototype.add=function(f,h){this._verify2(f,h);var m=f.add(h);return m.cmp(this.m)>=0&&m.isub(this.m),m._forceRed(this)},Q.prototype.iadd=function(f,h){this._verify2(f,h);var m=f.iadd(h);return m.cmp(this.m)>=0&&m.isub(this.m),m},Q.prototype.sub=function(f,h){this._verify2(f,h);var m=f.sub(h);return m.cmpn(0)<0&&m.iadd(this.m),m._forceRed(this)},Q.prototype.isub=function(f,h){this._verify2(f,h);var m=f.isub(h);return m.cmpn(0)<0&&m.iadd(this.m),m},Q.prototype.shl=function(f,h){return this._verify1(f),this.imod(f.ushln(h))},Q.prototype.imul=function(f,h){return this._verify2(f,h),this.imod(f.imul(h))},Q.prototype.mul=function(f,h){return this._verify2(f,h),this.imod(f.mul(h))},Q.prototype.isqr=function(f){return this.imul(f,f.clone())},Q.prototype.sqr=function(f){return this.mul(f,f)},Q.prototype.sqrt=function(f){if(f.isZero())return f.clone();var h=this.m.andln(3);if(n(h%2===1),h===3){var m=this.m.add(new s(1)).iushrn(2);return this.pow(f,m)}for(var _=this.m.subn(1),E=0;!_.isZero()&&_.andln(1)===0;)E++,_.iushrn(1);n(!_.isZero());var x=new s(1).toRed(this),T=x.redNeg(),B=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new s(2*d*d).toRed(this);this.pow(d,B).cmp(T)!==0;)d.redIAdd(T);for(var k=this.pow(d,_),W=this.pow(f,_.addn(1).iushrn(1)),K=this.pow(f,_),re=E;K.cmp(x)!==0;){for(var xe=K,be=0;xe.cmp(x)!==0;be++)xe=xe.redSqr();n(be=0;E--){for(var k=h.words[E],W=d-1;W>=0;W--){var K=k>>W&1;if(x!==_[0]&&(x=this.sqr(x)),K===0&&T===0){B=0;continue}T<<=1,T|=K,B++,!(B!==m&&(E!==0||W!==0))&&(x=this.mul(x,_[T]),B=0,T=0)}d=26}return x},Q.prototype.convertTo=function(f){var h=f.umod(this.m);return h===f?h.clone():h},Q.prototype.convertFrom=function(f){var h=f.clone();return h.red=null,h},s.mont=function(f){return new I(f)};function I(g){Q.call(this,g),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(I,Q),I.prototype.convertTo=function(f){return this.imod(f.ushln(this.shift))},I.prototype.convertFrom=function(f){var h=this.imod(f.mul(this.rinv));return h.red=null,h},I.prototype.imul=function(f,h){if(f.isZero()||h.isZero())return f.words[0]=0,f.length=1,f;var m=f.imul(h),_=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=m.isub(_).iushrn(this.shift),x=E;return E.cmp(this.m)>=0?x=E.isub(this.m):E.cmpn(0)<0&&(x=E.iadd(this.m)),x._forceRed(this)},I.prototype.mul=function(f,h){if(f.isZero()||h.isZero())return new s(0)._forceRed(this);var m=f.mul(h),_=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=m.isub(_).iushrn(this.shift),x=E;return E.cmp(this.m)>=0?x=E.isub(this.m):E.cmpn(0)<0&&(x=E.iadd(this.m)),x._forceRed(this)},I.prototype.invm=function(f){var h=this.imod(f._invmp(this.m).mul(this.r2));return h._forceRed(this)}})(e,ft)})(Kl);var Ig=Kl.exports,gf={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh */(function(e,t){var r=ie,n=r.Buffer;function i(o,a){for(var c in o)a[c]=o[c]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=s);function s(o,a,c){return n(o,a,c)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(o,a,c){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,a,c)},s.alloc=function(o,a,c){if(typeof o!="number")throw new TypeError("Argument must be a number");var u=n(o);return a!==void 0?typeof c=="string"?u.fill(a,c):u.fill(a):u.fill(0),u},s.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}})(gf,gf.exports);var yf=gf.exports.Buffer;function cS(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r>>0,N=new Uint8Array(F);P!==H;){for(var $=v[P],q=0,G=F-1;($!==0||q>>0,N[G]=$%o>>>0,$=$/o>>>0;if($!==0)throw new Error("Non-zero carry");M=q,P++}for(var Z=F-M;Z!==F&&N[Z]===0;)Z++;for(var z=a.repeat(R);Z>>0,F=new Uint8Array(H);v[R];){var N=t[v.charCodeAt(R)];if(N===255)return;for(var $=0,q=H-1;(N!==0||$>>0,F[q]=N%256>>>0,N=N/256>>>0;if(N!==0)throw new Error("Non-zero carry");P=$,R++}for(var G=H-P;G!==H&&F[G]===0;)G++;var Z=yf.allocUnsafe(M+(H-G));Z.fill(0,0,M);for(var z=M;G!==H;)Z[z++]=F[G++];return Z}function A(v){var R=y(v);if(R)return R;throw new Error("Non-base"+o+" character")}return{encode:l,decodeUnsafe:y,decode:A}}var fS=cS,uS=fS,lS="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",Ar=uS(lS);const hS=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ns=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),is=new Uint32Array(64);class dS extends ag{constructor(){super(64,32,8,!1),this.A=ns[0]|0,this.B=ns[1]|0,this.C=ns[2]|0,this.D=ns[3]|0,this.E=ns[4]|0,this.F=ns[5]|0,this.G=ns[6]|0,this.H=ns[7]|0}get(){const{A:t,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[t,r,n,i,s,o,a,c]}set(t,r,n,i,s,o,a,c){this.A=t|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(t,r){for(let y=0;y<16;y++,r+=4)is[y]=t.getUint32(r,!1);for(let y=16;y<64;y++){const A=is[y-15],v=is[y-2],R=gi(A,7)^gi(A,18)^A>>>3,M=gi(v,17)^gi(v,19)^v>>>10;is[y]=M+is[y-7]+R+is[y-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:u,H:l}=this;for(let y=0;y<64;y++){const A=gi(a,6)^gi(a,11)^gi(a,25),v=l+A+ax(a,c,u)+hS[y]+is[y]|0,M=(gi(n,2)^gi(n,13)^gi(n,22))+cx(n,i,s)|0;l=u,u=c,c=a,a=o+v|0,o=s,s=i,i=n,n=v+M|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(n,i,s,o,a,c,u,l)}roundClean(){is.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Zl=sg(()=>new dS);var Zr={};function Mi(e,t,r){return t<=e&&e<=r}function wf(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function pS(e){for(var t=String(e),r=t.length,n=0,i=[];n57343)i.push(s);else if(56320<=s&&s<=57343)i.push(65533);else if(55296<=s&&s<=56319)if(n===r-1)i.push(65533);else{var o=e.charCodeAt(n+1);if(56320<=o&&o<=57343){var a=s&1023,c=o&1023;i.push(65536+(a<<10)+c),n+=1}else i.push(65533)}n+=1}return i}function gS(e){for(var t="",r=0;r>10)+55296,(n&1023)+56320))}return t}var mf=-1;function Gl(e){this.tokens=[].slice.call(e)}Gl.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():mf},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.pop());else this.tokens.unshift(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.shift());else this.tokens.push(e)}};var $o=-1;function Yl(e,t){if(e)throw TypeError("Decoder error");return t||65533}var bf="utf-8";function vf(e,t){if(!(this instanceof vf))return new vf(e,t);if(e=e!==void 0?String(e).toLowerCase():bf,e!==bf)throw new Error("Encoding not supported. Only utf-8 is supported");t=wf(t),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!t.fatal,this._ignoreBOM=!!t.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}vf.prototype={decode:function(t,r){var n;typeof t=="object"&&t instanceof ArrayBuffer?n=new Uint8Array(t):typeof t=="object"&&"buffer"in t&&t.buffer instanceof ArrayBuffer?n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):n=new Uint8Array(0),r=wf(r),this._streaming||(this._decoder=new yS({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!r.stream;for(var i=new Gl(n),s=[],o;!i.endOfStream()&&(o=this._decoder.handler(i,i.read()),o!==$o);)o!==null&&(Array.isArray(o)?s.push.apply(s,o):s.push(o));if(!this._streaming){do{if(o=this._decoder.handler(i,i.read()),o===$o)break;o!==null&&(Array.isArray(o)?s.push.apply(s,o):s.push(o))}while(!i.endOfStream());this._decoder=null}return s.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(s[0]===65279?(this._BOMseen=!0,s.shift()):this._BOMseen=!0),gS(s)}};function _f(e,t){if(!(this instanceof _f))return new _f(e,t);if(e=e!==void 0?String(e).toLowerCase():bf,e!==bf)throw new Error("Encoding not supported. Only utf-8 is supported");t=wf(t),this._streaming=!1,this._encoder=null,this._options={fatal:!!t.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}_f.prototype={encode:function(t,r){t=t?String(t):"",r=wf(r),this._streaming||(this._encoder=new wS(this._options)),this._streaming=!!r.stream;for(var n=[],i=new Gl(pS(t)),s;!i.endOfStream()&&(s=this._encoder.handler(i,i.read()),s!==$o);)Array.isArray(s)?n.push.apply(n,s):n.push(s);if(!this._streaming){for(;s=this._encoder.handler(i,i.read()),s!==$o;)Array.isArray(s)?n.push.apply(n,s):n.push(s);this._encoder=null}return new Uint8Array(n)}};function yS(e){var t=e.fatal,r=0,n=0,i=0,s=128,o=191;this.handler=function(a,c){if(c===mf&&i!==0)return i=0,Yl(t);if(c===mf)return $o;if(i===0){if(Mi(c,0,127))return c;if(Mi(c,194,223))i=1,r=c-192;else if(Mi(c,224,239))c===224&&(s=160),c===237&&(o=159),i=2,r=c-224;else if(Mi(c,240,244))c===240&&(s=144),c===244&&(o=143),i=3,r=c-240;else return Yl(t);return r=r<<6*i,null}if(!Mi(c,s,o))return r=i=n=0,s=128,o=191,a.prepend(c),Yl(t);if(s=128,o=191,n+=1,r+=c-128<<6*(i-n),n!==i)return null;var u=r;return r=i=n=0,u}}function wS(e){e.fatal,this.handler=function(t,r){if(r===mf)return $o;if(Mi(r,0,127))return r;var n,i;Mi(r,128,2047)?(n=1,i=192):Mi(r,2048,65535)?(n=2,i=224):Mi(r,65536,1114111)&&(n=3,i=240);for(var s=[(r>>6*n)+i];n>0;){var o=r>>6*(n-1);s.push(128|o&63),n-=1}return s}}var mS=Object.freeze({__proto__:null,TextEncoder:_f,TextDecoder:vf}),bS=Nn(mS),vS=ft&&ft.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),_S=ft&&ft.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),yi=ft&&ft.__decorate||function(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},ES=ft&&ft.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.hasOwnProperty.call(e,r)&&vS(t,e,r);return _S(t,e),t},Rg=ft&&ft.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zr,"__esModule",{value:!0});var Tg=Zr.deserializeUnchecked=Og=Zr.deserialize=Mg=Zr.serialize=Zr.BinaryReader=Zr.BinaryWriter=Zr.BorshError=Zr.baseDecode=Zr.baseEncode=void 0;const ss=Rg(Kl.exports),kg=Rg(Ar),xS=ES(bS),SS=typeof TextDecoder!="function"?xS.TextDecoder:TextDecoder,AS=new SS("utf-8",{fatal:!0});function BS(e){return typeof e=="string"&&(e=ie.Buffer.from(e,"utf8")),kg.default.encode(ie.Buffer.from(e))}Zr.baseEncode=BS;function IS(e){return ie.Buffer.from(kg.default.decode(e))}Zr.baseDecode=IS;const Xl=1024;class ln extends Error{constructor(t){super(t),this.fieldPath=[],this.originalMessage=t}addToFieldPath(t){this.fieldPath.splice(0,0,t),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}Zr.BorshError=ln;class Cg{constructor(){this.buf=ie.Buffer.alloc(Xl),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=ie.Buffer.concat([this.buf,ie.Buffer.alloc(Xl)]))}writeU8(t){this.maybeResize(),this.buf.writeUInt8(t,this.length),this.length+=1}writeU16(t){this.maybeResize(),this.buf.writeUInt16LE(t,this.length),this.length+=2}writeU32(t){this.maybeResize(),this.buf.writeUInt32LE(t,this.length),this.length+=4}writeU64(t){this.maybeResize(),this.writeBuffer(ie.Buffer.from(new ss.default(t).toArray("le",8)))}writeU128(t){this.maybeResize(),this.writeBuffer(ie.Buffer.from(new ss.default(t).toArray("le",16)))}writeU256(t){this.maybeResize(),this.writeBuffer(ie.Buffer.from(new ss.default(t).toArray("le",32)))}writeU512(t){this.maybeResize(),this.writeBuffer(ie.Buffer.from(new ss.default(t).toArray("le",64)))}writeBuffer(t){this.buf=ie.Buffer.concat([ie.Buffer.from(this.buf.subarray(0,this.length)),t,ie.Buffer.alloc(Xl)]),this.length+=t.length}writeString(t){this.maybeResize();const r=ie.Buffer.from(t,"utf8");this.writeU32(r.length),this.writeBuffer(r)}writeFixedArray(t){this.writeBuffer(ie.Buffer.from(t))}writeArray(t,r){this.maybeResize(),this.writeU32(t.length);for(const n of t)this.maybeResize(),r(n)}toArray(){return this.buf.subarray(0,this.length)}}Zr.BinaryWriter=Cg;function wi(e,t,r){const n=r.value;r.value=function(...i){try{return n.apply(this,i)}catch(s){if(s instanceof RangeError){const o=s.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(o)>=0)throw new ln("Reached the end of buffer when deserializing")}throw s}}}class Bn{constructor(t){this.buf=t,this.offset=0}readU8(){const t=this.buf.readUInt8(this.offset);return this.offset+=1,t}readU16(){const t=this.buf.readUInt16LE(this.offset);return this.offset+=2,t}readU32(){const t=this.buf.readUInt32LE(this.offset);return this.offset+=4,t}readU64(){const t=this.readBuffer(8);return new ss.default(t,"le")}readU128(){const t=this.readBuffer(16);return new ss.default(t,"le")}readU256(){const t=this.readBuffer(32);return new ss.default(t,"le")}readU512(){const t=this.readBuffer(64);return new ss.default(t,"le")}readBuffer(t){if(this.offset+t>this.buf.length)throw new ln(`Expected buffer length ${t} isn't within bounds`);const r=this.buf.slice(this.offset,this.offset+t);return this.offset+=t,r}readString(){const t=this.readU32(),r=this.readBuffer(t);try{return AS.decode(r)}catch(n){throw new ln(`Error decoding UTF-8 string: ${n}`)}}readFixedArray(t){return new Uint8Array(this.readBuffer(t))}readArray(t){const r=this.readU32(),n=Array();for(let i=0;i{Ws(e,t,s,n[0],i)});else if(n.kind!==void 0)switch(n.kind){case"option":{r==null?i.writeU8(0):(i.writeU8(1),Ws(e,t,r,n.type,i));break}case"map":{i.writeU32(r.size),r.forEach((s,o)=>{Ws(e,t,o,n.key,i),Ws(e,t,s,n.value,i)});break}default:throw new ln(`FieldType ${n} unrecognized`)}else $g(e,r,i)}catch(s){throw s instanceof ln&&s.addToFieldPath(t),s}}function $g(e,t,r){if(typeof t.borshSerialize=="function"){t.borshSerialize(r);return}const n=e.get(t.constructor);if(!n)throw new ln(`Class ${t.constructor.name} is missing in schema`);if(n.kind==="struct")n.fields.map(([i,s])=>{Ws(e,i,t[i],s,r)});else if(n.kind==="enum"){const i=t[n.field];for(let s=0;sKs(e,t,r[0],n))}if(r.kind==="option")return n.readU8()?Ks(e,t,r.type,n):void 0;if(r.kind==="map"){let i=new Map;const s=n.readU32();for(let o=0;o=n.values.length)throw new ln(`Enum index: ${i} is out of range`);const[s,o]=n.values[i],a=Ks(e,s,o,r);return new t({[s]:a})}throw new ln(`Unexpected schema kind: ${n.kind} for ${t.constructor.name}`)}function TS(e,t,r,n=Bn){const i=new n(r),s=Jl(e,t,i);if(i.offsetthis.span)throw new RangeError("indeterminate span");return this.span}replicate(t){const r=Object.create(this.constructor.prototype);return Object.assign(r,this),r.property=t,r}fromArray(t){}}ne.Layout=qt;function eh(e,t){return t.property?e+"["+t.property+"]":e}ne.nameWithProperty=eh;function CS(e,t){if(typeof e!="function")throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(e,"layout_"))throw new Error("Class is already bound to a layout");if(!(t&&t instanceof qt))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(t,"boundConstructor_"))throw new Error("layout is already bound to a constructor");e.layout_=t,t.boundConstructor_=e,t.makeDestinationObject=()=>new e,Object.defineProperty(e.prototype,"encode",{value(r,n){return t.encode(this,r,n)},writable:!0}),Object.defineProperty(e,"decode",{value(r,n){return t.decode(r,n)},writable:!0})}ne.bindConstructorLayout=CS;class wn extends qt{isCount(){throw new Error("ExternalLayout is abstract")}}ne.ExternalLayout=wn;class Ng extends wn{constructor(t=1,r){if(!Number.isInteger(t)||0>=t)throw new TypeError("elementSpan must be a (positive) integer");super(-1,r),this.elementSpan=t}isCount(){return!0}decode(t,r=0){Mo(t);const n=t.length-r;return Math.floor(n/this.elementSpan)}encode(t,r,n){return 0}}ne.GreedyCount=Ng;class th extends wn{constructor(t,r=0,n){if(!(t instanceof qt))throw new TypeError("layout must be a Layout");if(!Number.isInteger(r))throw new TypeError("offset must be integer or undefined");super(t.span,n||t.property),this.layout=t,this.offset=r}isCount(){return this.layout instanceof Fn||this.layout instanceof ni}decode(t,r=0){return this.layout.decode(t,r+this.offset)}encode(t,r,n=0){return this.layout.encode(t,r,n+this.offset)}}ne.OffsetLayout=th;class Fn extends qt{constructor(t,r){if(super(t,r),6o+i.encode(a,r,n+o),0);return this.count instanceof wn&&this.count.encode(t.length,r,n),s}}ne.Sequence=Vg;class Wg extends qt{constructor(t,r,n){if(!(Array.isArray(t)&&t.reduce((s,o)=>s&&o instanceof qt,!0)))throw new TypeError("fields must be array of Layout instances");typeof r=="boolean"&&n===void 0&&(n=r,r=void 0);for(const s of t)if(0>s.span&&s.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let i=-1;try{i=t.reduce((s,o)=>s+o.getSpan(),0)}catch{}super(i,r),this.fields=t,this.decodePrefixes=!!n}getSpan(t,r=0){if(0<=this.span)return this.span;let n=0;try{n=this.fields.reduce((i,s)=>{const o=s.getSpan(t,r);return r+=o,i+o},0)}catch{throw new RangeError("indeterminate span")}return n}decode(t,r=0){Mo(t);const n=this.makeDestinationObject();for(const i of this.fields)if(i.property!==void 0&&(n[i.property]=i.decode(t,r)),r+=i.getSpan(t,r),this.decodePrefixes&&t.length===r)break;return n}encode(t,r,n=0){const i=n;let s=0,o=0;for(const a of this.fields){let c=a.span;if(o=0c&&(c=a.getSpan(r,n)))}s=n,n+=c}return s+o-i}fromArray(t){const r=this.makeDestinationObject();for(const n of this.fields)n.property!==void 0&&0n.span?r=-1:0<=r&&(r+=n.span)}}}ne.Structure=Wg;class nh{constructor(t){this.property=t}decode(t,r){throw new Error("UnionDiscriminator is abstract")}encode(t,r,n){throw new Error("UnionDiscriminator is abstract")}}ne.UnionDiscriminator=nh;class Sf extends nh{constructor(t,r){if(!(t instanceof wn&&t.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(r||t.property||"variant"),this.layout=t}decode(t,r){return this.layout.decode(t,r)}encode(t,r,n){return this.layout.encode(t,r,n)}}ne.UnionLayoutDiscriminator=Sf;class ih extends qt{constructor(t,r,n){let i;if(t instanceof Fn||t instanceof ni)i=new Sf(new th(t));else if(t instanceof wn&&t.isCount())i=new Sf(t);else if(t instanceof nh)i=t;else throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(r===void 0&&(r=null),!(r===null||r instanceof qt))throw new TypeError("defaultLayout must be null or a Layout");if(r!==null){if(0>r.span)throw new Error("defaultLayout must have constant span");r.property===void 0&&(r=r.replicate("content"))}let s=-1;r&&(s=r.span,0<=s&&(t instanceof Fn||t instanceof ni)&&(s+=i.layout.span)),super(s,n),this.discriminator=i,this.usesPrefixDiscriminator=t instanceof Fn||t instanceof ni,this.defaultLayout=r,this.registry={};let o=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(a){return o(a)},this.configGetSourceVariant=function(a){o=a.bind(this)}}getSpan(t,r=0){if(0<=this.span)return this.span;const n=this.getVariant(t,r);if(!n)throw new Error("unable to determine span for unrecognized variant");return n.getSpan(t,r)}defaultGetSourceVariant(t){if(Object.prototype.hasOwnProperty.call(t,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(t,this.defaultLayout.property))return;const r=this.registry[t[this.discriminator.property]];if(r&&(!r.layout||r.property&&Object.prototype.hasOwnProperty.call(t,r.property)))return r}else for(const r in this.registry){const n=this.registry[r];if(n.property&&Object.prototype.hasOwnProperty.call(t,n.property))return n}throw new Error("unable to infer src variant")}decode(t,r=0){let n;const i=this.discriminator,s=i.decode(t,r),o=this.registry[s];if(o===void 0){const a=this.defaultLayout;let c=0;this.usesPrefixDiscriminator&&(c=i.layout.span),n=this.makeDestinationObject(),n[i.property]=s,n[a.property]=a.decode(t,r+c)}else n=o.decode(t,r);return n}encode(t,r,n=0){const i=this.getSourceVariant(t);if(i===void 0){const s=this.discriminator,o=this.defaultLayout;let a=0;return this.usesPrefixDiscriminator&&(a=s.layout.span),s.encode(t[s.property],r,n),a+o.encode(t[o.property],r,n+a)}return i.encode(t,r,n)}addVariant(t,r,n){const i=new Kg(this,t,r,n);return this.registry[t]=i,i}getVariant(t,r=0){let n;return t instanceof Uint8Array?n=this.discriminator.decode(t,r):n=t,this.registry[n]}}ne.Union=ih;class Kg extends qt{constructor(t,r,n,i){if(!(t instanceof ih))throw new TypeError("union must be a Union");if(!Number.isInteger(r)||0>r)throw new TypeError("variant must be a (non-negative) integer");if(typeof n=="string"&&i===void 0&&(i=n,n=null),n){if(!(n instanceof qt))throw new TypeError("layout must be a Layout");if(t.defaultLayout!==null&&0<=n.span&&n.span>t.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof i!="string")throw new TypeError("variant must have a String property")}let s=t.span;0>t.span&&(s=n?n.span:0,0<=s&&t.usesPrefixDiscriminator&&(s+=t.discriminator.layout.span)),super(s,i),this.union=t,this.variant=r,this.layout=n||null}getSpan(t,r=0){if(0<=this.span)return this.span;let n=0;this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span);let i=0;return this.layout&&(i=this.layout.getSpan(t,r+n)),n+i}decode(t,r=0){const n=this.makeDestinationObject();if(this!==this.union.getVariant(t,r))throw new Error("variant mismatch");let i=0;return this.union.usesPrefixDiscriminator&&(i=this.union.discriminator.layout.span),this.layout?n[this.property]=this.layout.decode(t,r+i):this.property?n[this.property]=!0:this.union.usesPrefixDiscriminator&&(n[this.union.discriminator.property]=this.variant),n}encode(t,r,n=0){let i=0;if(this.union.usesPrefixDiscriminator&&(i=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(t,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,r,n);let s=i;if(this.layout&&(this.layout.encode(t[this.property],r,n+i),s+=this.layout.getSpan(r,n+i),0<=this.union.span&&s>this.union.span))throw new Error("encoded variant overruns containing union");return s}fromArray(t){if(this.layout)return this.layout.fromArray(t)}}ne.VariantLayout=Kg;function No(e){return 0>e&&(e+=4294967296),e}class sh extends qt{constructor(t,r,n){if(!(t instanceof Fn||t instanceof ni))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof r=="string"&&n===void 0&&(n=r,r=!1),4=r)throw new TypeError("bits must be positive integer");const i=8*t.span,s=t.fields.reduce((o,a)=>o+a.bits,0);if(r+s>i)throw new Error("bits too long for span remainder ("+(i-s)+" of "+i+" remain)");this.container=t,this.bits=r,this.valueMask=(1<>>this.start}encode(t){if(typeof t!="number"||!Number.isInteger(t)||t!==No(t&this.valueMask))throw new TypeError(eh("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const r=this.container._packedGetValue(),n=No(t<n&&(n=this.length.decode(t,r)),n}decode(t,r=0){let n=this.span;return 0>n&&(n=this.length.decode(t,r)),Nt(t).slice(r,r+n)}encode(t,r,n){let i=this.length;if(this.length instanceof wn&&(i=t.length),!(t instanceof Uint8Array&&i===t.length))throw new TypeError(eh("Blob.encode",this)+" requires (length "+i+") Uint8Array as src");if(n+i>r.length)throw new RangeError("encoding overruns Uint8Array");const s=Nt(t);return Nt(r).write(s.toString("hex"),n,i,"hex"),this.length instanceof wn&&this.length.encode(i,r,n),i}}ne.Blob=Gg;class Yg extends qt{constructor(t){super(-1,t)}getSpan(t,r=0){Mo(t);let n=r;for(;nr.length)throw new RangeError("encoding overruns Buffer");const o=Nt(r);return i.copy(o,n),o[n+s]=0,s+1}}ne.CString=Yg;class Xg extends qt{constructor(t,r){if(typeof t=="string"&&r===void 0&&(r=t,t=void 0),t===void 0)t=-1;else if(!Number.isInteger(t))throw new TypeError("maxSpan must be an integer");super(-1,r),this.maxSpan=t}getSpan(t,r=0){return Mo(t),t.length-r}decode(t,r=0){const n=this.getSpan(t,r);if(0<=this.maxSpan&&this.maxSpanr.length)throw new RangeError("encoding overruns Buffer");return i.copy(Nt(r),n),s}}ne.UTF8=Xg;class Jg extends qt{constructor(t,r){super(0,r),this.value=t}decode(t,r){return this.value}encode(t,r,n){return 0}}ne.Constant=Jg,ne.greedy=(e,t)=>new Ng(e,t);var Gs=ne.offset=(e,t,r)=>new th(e,t,r),Ut=ne.u8=e=>new Fn(1,e),Dn=ne.u16=e=>new Fn(2,e);ne.u24=e=>new Fn(3,e);var qe=ne.u32=e=>new Fn(4,e);ne.u40=e=>new Fn(5,e),ne.u48=e=>new Fn(6,e);var Gr=ne.nu64=e=>new Pg(e);ne.u16be=e=>new ni(2,e),ne.u24be=e=>new ni(3,e),ne.u32be=e=>new ni(4,e),ne.u40be=e=>new ni(5,e),ne.u48be=e=>new ni(6,e),ne.nu64be=e=>new Ug(e),ne.s8=e=>new Zs(1,e),ne.s16=e=>new Zs(2,e),ne.s24=e=>new Zs(3,e),ne.s32=e=>new Zs(4,e),ne.s40=e=>new Zs(5,e),ne.s48=e=>new Zs(6,e);var In=ne.ns64=e=>new Fg(e);ne.s16be=e=>new Oo(2,e),ne.s24be=e=>new Oo(3,e),ne.s32be=e=>new Oo(4,e),ne.s40be=e=>new Oo(5,e),ne.s48be=e=>new Oo(6,e),ne.ns64be=e=>new Dg(e),ne.f32=e=>new Hg(e),ne.f32be=e=>new jg(e),ne.f64=e=>new zg(e),ne.f64be=e=>new qg(e);var Fe=ne.struct=(e,t,r)=>new Wg(e,t,r);ne.bits=(e,t,r)=>new sh(e,t,r);var en=ne.seq=(e,t,r)=>new Vg(e,t,r);ne.union=(e,t,r)=>new ih(e,t,r),ne.unionLayoutDiscriminator=(e,t)=>new Sf(e,t);var nr=ne.blob=(e,t)=>new Gg(e,t);ne.cstr=e=>new Yg(e),ne.utf8=(e,t)=>new Xg(e,t),ne.constant=(e,t)=>new Jg(e,t);var Pa={};Object.defineProperty(Pa,"__esModule",{value:!0});function LS(e){{const t=ie.Buffer.from(e);t.reverse();const r=t.toString("hex");return r.length===0?BigInt(0):BigInt(`0x${r}`)}}var $S=Pa.toBigIntLE=LS;function MS(e){{const t=e.toString("hex");return t.length===0?BigInt(0):BigInt(`0x${t}`)}}Pa.toBigIntBE=MS;function OS(e,t){{const r=e.toString(16),n=ie.Buffer.from(r.padStart(t*2,"0").slice(0,t*2),"hex");return n.reverse(),n}}var NS=Pa.toBufferLE=OS;function PS(e,t){{const r=e.toString(16);return ie.Buffer.from(r.padStart(t*2,"0").slice(0,t*2),"hex")}}Pa.toBufferBE=PS;class US extends TypeError{constructor(t,r){let n;const{message:i,...s}=t,{path:o}=t,a=o.length===0?i:"At path: "+o.join(".")+" -- "+i;super(a),Object.assign(this,s),this.name=this.constructor.name,this.failures=()=>{var c;return(c=n)!=null?c:n=[t,...r()]}}}function FS(e){return os(e)&&typeof e[Symbol.iterator]=="function"}function os(e){return typeof e=="object"&&e!=null}function ii(e){return typeof e=="string"?JSON.stringify(e):""+e}function DS(e){const{done:t,value:r}=e.next();return t?void 0:r}function HS(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:i,branch:s}=t,{type:o}=r,{refinement:a,message:c="Expected a value of type `"+o+"`"+(a?" with refinement `"+a+"`":"")+", but received: `"+ii(n)+"`"}=e;return{value:n,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...e,message:c}}function*Qg(e,t,r,n){FS(e)||(e=[e]);for(const i of e){const s=HS(i,t,r,n);s&&(yield s)}}function*ah(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:o=!1}=r,a={path:n,branch:i};if(s&&(e=t.coercer(e,a),o&&t.type!=="type"&&os(t.schema)&&os(e)&&!Array.isArray(e)))for(const u in e)t.schema[u]===void 0&&delete e[u];let c=!0;for(const u of t.validator(e,a))c=!1,yield[u,void 0];for(let[u,l,y]of t.entries(e,a)){const A=ah(l,y,{path:u===void 0?n:[...n,u],branch:u===void 0?i:[...i,l],coerce:s,mask:o});for(const v of A)v[0]?(c=!1,yield[v[0],void 0]):s&&(l=v[1],u===void 0?e=l:e instanceof Map?e.set(u,l):e instanceof Set?e.add(l):os(e)&&(e[u]=l))}if(c)for(const u of t.refiner(e,a))c=!1,yield[u,void 0];c&&(yield[void 0,e])}class mi{constructor(t){const{type:r,schema:n,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=t;this.type=r,this.schema=n,this.entries=a,this.coercer=o,i?this.validator=(c,u)=>{const l=i(c,u);return Qg(l,u,this,c)}:this.validator=()=>[],s?this.refiner=(c,u)=>{const l=s(c,u);return Qg(l,u,this,c)}:this.refiner=()=>[]}assert(t){return jS(t,this)}create(t){return Be(t,this)}is(t){return e1(t,this)}mask(t){return zS(t,this)}validate(t,r={}){return Ua(t,this,r)}}function jS(e,t){const r=Ua(e,t);if(r[0])throw r[0]}function Be(e,t){const r=Ua(e,t,{coerce:!0});if(r[0])throw r[0];return r[1]}function zS(e,t){const r=Ua(e,t,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}function e1(e,t){return!Ua(e,t)[0]}function Ua(e,t,r={}){const n=ah(e,t,r),i=DS(n);return i[0]?[new US(i[0],function*(){for(const o of n)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function Ys(e,t){return new mi({type:e,schema:null,validator:t})}function qS(){return Ys("any",()=>!0)}function Ce(e){return new mi({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||"Expected an array value, but received: "+ii(t)}})}function bi(){return Ys("boolean",e=>typeof e=="boolean")}function ch(e){return Ys("instance",t=>t instanceof e||"Expected a `"+e.name+"` instance, but received: "+ii(t))}function dr(e){const t=ii(e),r=typeof e;return new mi({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||"Expected the literal `"+t+"`, but received: "+ii(n)}})}function VS(){return Ys("never",()=>!1)}function Te(e){return new mi({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function te(){return Ys("number",e=>typeof e=="number"&&!isNaN(e)||"Expected a number, but received: "+ii(e))}function Qe(e){return new mi({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function t1(e,t){return new mi({type:"record",schema:null,*entries(r){if(os(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator(r){return os(r)||"Expected an object, but received: "+ii(r)}})}function Se(){return Ys("string",e=>typeof e=="string"||"Expected a string, but received: "+ii(e))}function fh(e){const t=VS();return new mi({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;ir.type).join(" | ");return new mi({type:"union",schema:null,validator(r,n){const i=[];for(const s of e){const[...o]=ah(r,s,n),[a]=o;if(a[0])for(const[c]of o)c&&i.push(c);else return[]}return["Expected the value to satisfy a union of `"+t+"`, but received: "+ii(r),...i]}})}function Fa(){return Ys("unknown",()=>!0)}function Da(e,t,r){return new mi({...e,coercer:(n,i)=>e1(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}var Af,WS=new Uint8Array(16);function r1(){if(!Af&&(Af=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Af))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Af(WS)}var KS=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Bf(e){return typeof e=="string"&&KS.test(e)}for(var Yr=[],uh=0;uh<256;++uh)Yr.push((uh+256).toString(16).substr(1));function If(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=(Yr[e[t+0]]+Yr[e[t+1]]+Yr[e[t+2]]+Yr[e[t+3]]+"-"+Yr[e[t+4]]+Yr[e[t+5]]+"-"+Yr[e[t+6]]+Yr[e[t+7]]+"-"+Yr[e[t+8]]+Yr[e[t+9]]+"-"+Yr[e[t+10]]+Yr[e[t+11]]+Yr[e[t+12]]+Yr[e[t+13]]+Yr[e[t+14]]+Yr[e[t+15]]).toLowerCase();if(!Bf(r))throw TypeError("Stringified UUID is invalid");return r}var n1,lh,hh=0,dh=0;function ZS(e,t,r){var n=t&&r||0,i=t||new Array(16);e=e||{};var s=e.node||n1,o=e.clockseq!==void 0?e.clockseq:lh;if(s==null||o==null){var a=e.random||(e.rng||r1)();s==null&&(s=n1=[a[0]|1,a[1],a[2],a[3],a[4],a[5]]),o==null&&(o=lh=(a[6]<<8|a[7])&16383)}var c=e.msecs!==void 0?e.msecs:Date.now(),u=e.nsecs!==void 0?e.nsecs:dh+1,l=c-hh+(u-dh)/1e4;if(l<0&&e.clockseq===void 0&&(o=o+1&16383),(l<0||c>hh)&&e.nsecs===void 0&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");hh=c,dh=u,lh=o,c+=122192928e5;var y=((c&268435455)*1e4+u)%4294967296;i[n++]=y>>>24&255,i[n++]=y>>>16&255,i[n++]=y>>>8&255,i[n++]=y&255;var A=c/4294967296*1e4&268435455;i[n++]=A>>>8&255,i[n++]=A&255,i[n++]=A>>>24&15|16,i[n++]=A>>>16&255,i[n++]=o>>>8|128,i[n++]=o&255;for(var v=0;v<6;++v)i[n+v]=s[v];return t||If(i)}function i1(e){if(!Bf(e))throw TypeError("Invalid UUID");var t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}function GS(e){e=unescape(encodeURIComponent(e));for(var t=[],r=0;r>5]>>>i%32&255,o=parseInt(n.charAt(s>>>4&15)+n.charAt(s&15),16);t.push(o)}return t}function o1(e){return(e+64>>>9<<4)+14+1}function e3(e,t){e[t>>5]|=128<>5]|=(e[n/8]&255)<>16)+(t>>16)+(r>>16);return n<<16|r&65535}function r3(e,t){return e<>>32-t}function Rf(e,t,r,n,i,s){return as(r3(as(as(t,e),as(n,s)),i),r)}function tn(e,t,r,n,i,s,o){return Rf(t&r|~t&n,e,t,i,s,o)}function rn(e,t,r,n,i,s,o){return Rf(t&n|r&~n,e,t,i,s,o)}function nn(e,t,r,n,i,s,o){return Rf(t^r^n,e,t,i,s,o)}function sn(e,t,r,n,i,s,o){return Rf(r^(t|~n),e,t,i,s,o)}var n3=s1("v3",48,JS),i3=n3;function s3(e,t,r){e=e||{};var n=e.random||(e.rng||r1)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return If(n)}function o3(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:return t^r^n;case 2:return t&r^t&n^r&n;case 3:return t^r^n}}function ph(e,t){return e<>>32-t}function a3(e){var t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){var n=unescape(encodeURIComponent(e));e=[];for(var i=0;i>>0;N=F,F=H,H=ph(P,30)>>>0,P=M,M=G}r[0]=r[0]+M>>>0,r[1]=r[1]+P>>>0,r[2]=r[2]+H>>>0,r[3]=r[3]+F>>>0,r[4]=r[4]+N>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var c3=s1("v5",80,a3),f3=c3,u3="00000000-0000-0000-0000-000000000000";function l3(e){if(!Bf(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}var h3=Object.freeze({__proto__:null,v1:ZS,v3:i3,v4:s3,v5:f3,NIL:u3,version:l3,validate:Bf,stringify:If,parse:i1}),a1=Nn(h3);const d3=a1.v4;var p3=function(e,t,r,n){if(typeof e!="string")throw new TypeError(e+" must be a string");n=n||{};const i=typeof n.version=="number"?n.version:2;if(i!==1&&i!==2)throw new TypeError(i+" must be 1 or 2");const s={method:e};if(i===2&&(s.jsonrpc="2.0"),t){if(typeof t!="object"&&!Array.isArray(t))throw new TypeError(t+" must be an object, array or omitted");s.params=t}if(typeof r>"u"){const o=typeof n.generator=="function"?n.generator:function(){return d3()};s.id=o(s,n)}else i===2&&r===null?n.notificationIdNull&&(s.id=null):s.id=r;return s};const g3=a1.v4,y3=p3,Ha=function(e,t){if(!(this instanceof Ha))return new Ha(e,t);t||(t={}),this.options={reviver:typeof t.reviver<"u"?t.reviver:null,replacer:typeof t.replacer<"u"?t.replacer:null,generator:typeof t.generator<"u"?t.generator:function(){return g3()},version:typeof t.version<"u"?t.version:2,notificationIdNull:typeof t.notificationIdNull=="boolean"?t.notificationIdNull:!1},this.callServer=e};var w3=Ha;Ha.prototype.request=function(e,t,r,n){const i=this;let s=null;const o=Array.isArray(e)&&typeof t=="function";if(this.options.version===1&&o)throw new TypeError("JSON-RPC 1.0 does not support batching");if(o||!o&&e&&typeof e=="object"&&typeof t=="function")n=t,s=e;else{typeof r=="function"&&(n=r,r=void 0);const u=typeof n=="function";try{s=y3(e,t,r,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(l){if(u)return n(l);throw l}if(!u)return s}let c;try{c=JSON.stringify(s,this.options.replacer)}catch(u){return n(u)}return this.callServer(c,function(u,l){i._parseResponse(u,l,n)}),s},Ha.prototype._parseResponse=function(e,t,r){if(e){r(e);return}if(!t)return r();let n;try{n=JSON.parse(t,this.options.reviver)}catch(i){return r(i)}if(r.length===3)if(Array.isArray(n)){const i=function(o){return typeof o.error<"u"},s=function(o){return!i(o)};return r(null,n.filter(i),n.filter(s))}else return r(null,n.error,n.result);r(null,n)};var c1={},gh={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(c,u,l){this.fn=c,this.context=u,this.once=l||!1}function s(c,u,l,y,A){if(typeof l!="function")throw new TypeError("The listener must be a function");var v=new i(l,y||c,A),R=r?r+u:u;return c._events[R]?c._events[R].fn?c._events[R]=[c._events[R],v]:c._events[R].push(v):(c._events[R]=v,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var u=[],l,y;if(this._eventsCount===0)return u;for(y in l=this._events)t.call(l,y)&&u.push(r?y.slice(1):y);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(l)):u},a.prototype.listeners=function(u){var l=r?r+u:u,y=this._events[l];if(!y)return[];if(y.fn)return[y.fn];for(var A=0,v=y.length,R=new Array(v);A++this.rpc_id),u?this.dataPack=u:this.dataPack=new E3.DefaultDataPack,this.autoconnect&&this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}connect(){this.socket||this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}call(t,r,n,i){return!i&&typeof n=="object"&&(i=n,n=null),new Promise((s,o)=>{if(!this.ready)return o(new Error("socket not ready"));const a=this.generate_request_id(t,r),c={jsonrpc:"2.0",method:t,params:r||void 0,id:a};this.socket.send(this.dataPack.encode(c),i,u=>{if(u)return o(u);this.queue[a]={promise:[s,o]},n&&(this.queue[a].timeout=setTimeout(()=>{delete this.queue[a],o(new Error("reply timeout"))},n))})})}async login(t){const r=await this.call("rpc.login",t);if(!r)throw new Error("authentication failed");return r}async listMethods(){return await this.call("__listMethods")}notify(t,r){return new Promise((n,i)=>{if(!this.ready)return i(new Error("socket not ready"));const s={jsonrpc:"2.0",method:t,params:r};this.socket.send(this.dataPack.encode(s),o=>{if(o)return i(o);n()})})}async subscribe(t){typeof t=="string"&&(t=[t]);const r=await this.call("rpc.on",t);if(typeof t=="string"&&r[t]!=="ok")throw new Error("Failed subscribing to an event '"+t+"' with: "+r[t]);return r}async unsubscribe(t){typeof t=="string"&&(t=[t]);const r=await this.call("rpc.off",t);if(typeof t=="string"&&r[t]!=="ok")throw new Error("Failed unsubscribing from an event with: "+r);return r}close(t,r){this.socket.close(t||1e3,r)}setAutoReconnect(t){this.reconnect=t}setReconnectInterval(t){this.reconnect_interval=t}setMaxReconnects(t){this.max_reconnects=t}_connect(t,r){clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(t,r),this.socket.addEventListener("open",()=>{this.ready=!0,this.emit("open"),this.current_reconnects=0}),this.socket.addEventListener("message",({data:n})=>{n instanceof ArrayBuffer&&(n=ie.Buffer.from(n).toString());try{n=this.dataPack.decode(n)}catch{return}if(n.notification&&this.listeners(n.notification).length){if(!Object.keys(n.params).length)return this.emit(n.notification);const i=[n.notification];if(n.params.constructor===Object)i.push(n.params);else for(let s=0;s{this.emit.apply(this,i)})}if(!this.queue[n.id])return n.method?Promise.resolve().then(()=>{this.emit(n.method,n?.params)}):void 0;"error"in n=="result"in n&&this.queue[n.id].promise[1](new Error('Server response malformed. Response must include either "result" or "error", but not both.')),this.queue[n.id].timeout&&clearTimeout(this.queue[n.id].timeout),n.error?this.queue[n.id].promise[1](n.error):this.queue[n.id].promise[0](n.result),delete this.queue[n.id]}),this.socket.addEventListener("error",n=>this.emit("error",n)),this.socket.addEventListener("close",({code:n,reason:i})=>{this.ready&&setTimeout(()=>this.emit("close",n,i),0),this.ready=!1,this.socket=void 0,n!==1e3&&(this.current_reconnects++,this.reconnect&&(this.max_reconnects>this.current_reconnects||this.max_reconnects===0)&&(this.reconnect_timer_id=setTimeout(()=>this._connect(t,r),this.reconnect_interval)))})}}var S3=c1.default=x3,f1={};Object.defineProperty(f1,"__esModule",{value:!0});const A3=gh.exports;class B3 extends A3.EventEmitter{socket;constructor(t,r,n){super(),this.socket=new window.WebSocket(t,n),this.socket.onopen=()=>this.emit("open"),this.socket.onmessage=i=>this.emit("message",i.data),this.socket.onerror=i=>this.emit("error",i),this.socket.onclose=i=>{this.emit("close",i.code,i.reason)}}send(t,r,n){const i=n||r;try{this.socket.send(t),i()}catch(s){i(s)}}close(t,r){this.socket.close(t,r)}addEventListener(t,r,n){this.socket.addEventListener(t,r,n)}}function I3(e,t){return new B3(e,t)}var R3=f1.default=I3;const T3=[],k3=BigInt(0),ja=BigInt(1),C3=BigInt(2),L3=BigInt(7),$3=BigInt(256),M3=BigInt(113);for(let e=0,t=ja,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5];let i=k3;for(let s=0;s<7;s++)t=(t<>L3)*M3)%$3,t&C3&&(i^=ja<<(ja<Number.parseInt(u[0],16)&8?"00"+u:u,r=u=>{const l=u.toString(16);return l.length&1?`0${l}`:l},n=t(r(e.s)),i=t(r(e.r)),s=n.length/2,o=i.length/2,a=r(s),c=r(o);return`30${r(o+s+4)}02${c}${i}02${a}${n}`}},Oi=BigInt(0),Hn=BigInt(1);BigInt(2);const u1=BigInt(3);BigInt(4);function U3(e){const t=O3(e),{Fp:r}=t,n=t.toBytes||((R,M,P)=>{const H=M.toAffine();return qs(Uint8Array.from([4]),r.toBytes(H.x),r.toBytes(H.y))}),i=t.fromBytes||(R=>{const M=R.subarray(1),P=r.fromBytes(M.subarray(0,r.BYTES)),H=r.fromBytes(M.subarray(r.BYTES,2*r.BYTES));return{x:P,y:H}});function s(R){const{a:M,b:P}=t,H=r.sqr(R),F=r.mul(H,R);return r.add(r.add(F,r.mul(R,M)),P)}if(!r.eql(r.sqr(t.Gy),s(t.Gx)))throw new Error("bad generator point: equation left != right");function o(R){return typeof R=="bigint"&&Oir.eql(N,r.ZERO);return F(P)&&F(H)?y.ZERO:new y(P,H,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(M){const P=r.invertBatch(M.map(H=>H.pz));return M.map((H,F)=>H.toAffine(P[F])).map(y.fromAffine)}static fromHex(M){const P=y.fromAffine(i(Cr("pointHex",M)));return P.assertValidity(),P}static fromPrivateKey(M){return y.BASE.multiply(c(M))}_setWindowSize(M){this._WINDOW_SIZE=M,u.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:M,y:P}=this.toAffine();if(!r.isValid(M)||!r.isValid(P))throw new Error("bad point: x or y not FE");const H=r.sqr(P),F=s(M);if(!r.eql(H,F))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:M}=this.toAffine();if(r.isOdd)return!r.isOdd(M);throw new Error("Field doesn't support isOdd")}equals(M){l(M);const{px:P,py:H,pz:F}=this,{px:N,py:$,pz:q}=M,G=r.eql(r.mul(P,q),r.mul(N,F)),Z=r.eql(r.mul(H,q),r.mul($,F));return G&&Z}negate(){return new y(this.px,r.neg(this.py),this.pz)}double(){const{a:M,b:P}=t,H=r.mul(P,u1),{px:F,py:N,pz:$}=this;let q=r.ZERO,G=r.ZERO,Z=r.ZERO,z=r.mul(F,F),ee=r.mul(N,N),se=r.mul($,$),Q=r.mul(F,N);return Q=r.add(Q,Q),Z=r.mul(F,$),Z=r.add(Z,Z),q=r.mul(M,Z),G=r.mul(H,se),G=r.add(q,G),q=r.sub(ee,G),G=r.add(ee,G),G=r.mul(q,G),q=r.mul(Q,q),Z=r.mul(H,Z),se=r.mul(M,se),Q=r.sub(z,se),Q=r.mul(M,Q),Q=r.add(Q,Z),Z=r.add(z,z),z=r.add(Z,z),z=r.add(z,se),z=r.mul(z,Q),G=r.add(G,z),se=r.mul(N,$),se=r.add(se,se),z=r.mul(se,Q),q=r.sub(q,z),Z=r.mul(se,ee),Z=r.add(Z,Z),Z=r.add(Z,Z),new y(q,G,Z)}add(M){l(M);const{px:P,py:H,pz:F}=this,{px:N,py:$,pz:q}=M;let G=r.ZERO,Z=r.ZERO,z=r.ZERO;const ee=t.a,se=r.mul(t.b,u1);let Q=r.mul(P,N),I=r.mul(H,$),g=r.mul(F,q),f=r.add(P,H),h=r.add(N,$);f=r.mul(f,h),h=r.add(Q,I),f=r.sub(f,h),h=r.add(P,F);let m=r.add(N,q);return h=r.mul(h,m),m=r.add(Q,g),h=r.sub(h,m),m=r.add(H,F),G=r.add($,q),m=r.mul(m,G),G=r.add(I,g),m=r.sub(m,G),z=r.mul(ee,h),G=r.mul(se,g),z=r.add(G,z),G=r.sub(I,z),z=r.add(I,z),Z=r.mul(G,z),I=r.add(Q,Q),I=r.add(I,Q),g=r.mul(ee,g),h=r.mul(se,h),I=r.add(I,g),g=r.sub(Q,g),g=r.mul(ee,g),h=r.add(h,g),Q=r.mul(I,h),Z=r.add(Z,Q),Q=r.mul(m,h),G=r.mul(f,G),G=r.sub(G,Q),Q=r.mul(f,I),z=r.mul(m,z),z=r.add(z,Q),new y(G,Z,z)}subtract(M){return this.add(M.negate())}is0(){return this.equals(y.ZERO)}wNAF(M){return v.wNAFCached(this,u,M,P=>{const H=r.invertBatch(P.map(F=>F.pz));return P.map((F,N)=>F.toAffine(H[N])).map(y.fromAffine)})}multiplyUnsafe(M){const P=y.ZERO;if(M===Oi)return P;if(a(M),M===Hn)return this;const{endo:H}=t;if(!H)return v.unsafeLadder(this,M);let{k1neg:F,k1:N,k2neg:$,k2:q}=H.splitScalar(M),G=P,Z=P,z=this;for(;N>Oi||q>Oi;)N&Hn&&(G=G.add(z)),q&Hn&&(Z=Z.add(z)),z=z.double(),N>>=Hn,q>>=Hn;return F&&(G=G.negate()),$&&(Z=Z.negate()),Z=new y(r.mul(Z.px,H.beta),Z.py,Z.pz),G.add(Z)}multiply(M){a(M);let P=M,H,F;const{endo:N}=t;if(N){const{k1neg:$,k1:q,k2neg:G,k2:Z}=N.splitScalar(P);let{p:z,f:ee}=this.wNAF(q),{p:se,f:Q}=this.wNAF(Z);z=v.constTimeNegate($,z),se=v.constTimeNegate(G,se),se=new y(r.mul(se.px,N.beta),se.py,se.pz),H=z.add(se),F=ee.add(Q)}else{const{p:$,f:q}=this.wNAF(P);H=$,F=q}return y.normalizeZ([H,F])[0]}multiplyAndAddUnsafe(M,P,H){const F=y.BASE,N=(q,G)=>G===Oi||G===Hn||!q.equals(F)?q.multiplyUnsafe(G):q.multiply(G),$=N(this,P).add(N(M,H));return $.is0()?void 0:$}toAffine(M){const{px:P,py:H,pz:F}=this,N=this.is0();M==null&&(M=N?r.ONE:r.inv(F));const $=r.mul(P,M),q=r.mul(H,M),G=r.mul(F,M);if(N)return{x:r.ZERO,y:r.ZERO};if(!r.eql(G,r.ONE))throw new Error("invZ was invalid");return{x:$,y:q}}isTorsionFree(){const{h:M,isTorsionFree:P}=t;if(M===Hn)return!0;if(P)return P(y,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:M,clearCofactor:P}=t;return M===Hn?this:P?P(y,this):this.multiplyUnsafe(t.h)}toRawBytes(M=!0){return this.assertValidity(),n(y,this,M)}toHex(M=!0){return js(this.toRawBytes(M))}}y.BASE=new y(t.Gx,t.Gy,r.ONE),y.ZERO=new y(r.ZERO,r.ONE,r.ZERO);const A=t.nBitLength,v=_g(y,t.endo?Math.ceil(A/2):A);return{CURVE:t,ProjectivePoint:y,normPrivateKeyToScalar:c,weierstrassEquation:s,isWithinCurveOrder:o}}function F3(e){const t=jl(e);return Lo(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function D3(e){const t=F3(e),{Fp:r,n}=t,i=r.BYTES+1,s=2*r.BYTES+1;function o(h){return Oijs(Co(h,t.nByteLength));function R(h){const m=n>>Hn;return h>m}function M(h){return R(h)?a(-h):h}const P=(h,m,_)=>zs(h.slice(m,_));class H{constructor(m,_,E){this.r=m,this.s=_,this.recovery=E,this.assertValidity()}static fromCompact(m){const _=t.nByteLength;return m=Cr("compactSignature",m,_*2),new H(P(m,0,_),P(m,_,2*_))}static fromDER(m){const{r:_,s:E}=Xs.toSig(Cr("DER",m));return new H(_,E)}assertValidity(){if(!A(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!A(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(m){return new H(this.r,this.s,m)}recoverPublicKey(m){const{r:_,s:E,recovery:x}=this,T=Z(Cr("msgHash",m));if(x==null||![0,1,2,3].includes(x))throw new Error("recovery id invalid");const B=x===2||x===3?_+t.n:_;if(B>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const d=x&1?"03":"02",k=u.fromHex(d+v(B)),W=c(B),K=a(-T*W),re=a(E*W),xe=u.BASE.multiplyAndAddUnsafe(k,K,re);if(!xe)throw new Error("point at infinify");return xe.assertValidity(),xe}hasHighS(){return R(this.s)}normalizeS(){return this.hasHighS()?new H(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return To(this.toDERHex())}toDERHex(){return Xs.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return To(this.toCompactHex())}toCompactHex(){return v(this.r)+v(this.s)}}const F={isValidPrivateKey(h){try{return l(h),!0}catch{return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{const h=vg(t.n);return Kx(t.randomBytes(h),t.n)},precompute(h=8,m=u.BASE){return m._setWindowSize(h),m.multiply(BigInt(3)),m}};function N(h,m=!0){return u.fromPrivateKey(h).toRawBytes(m)}function $(h){const m=Hs(h),_=typeof h=="string",E=(m||_)&&h.length;return m?E===i||E===s:_?E===2*i||E===2*s:h instanceof u}function q(h,m,_=!0){if($(h))throw new Error("first arg must be private key");if(!$(m))throw new Error("second arg must be public key");return u.fromHex(m).multiply(l(h)).toRawBytes(_)}const G=t.bits2int||function(h){const m=zs(h),_=h.length*8-t.nBitLength;return _>0?m>>BigInt(_):m},Z=t.bits2int_modN||function(h){return a(G(h))},z=Pl(t.nBitLength);function ee(h){if(typeof h!="bigint")throw new Error("bigint expected");if(!(Oi<=h&&hge in _))throw new Error("sign() legacy options not supported");const{hash:E,randomBytes:x}=t;let{lowS:T,prehash:B,extraEntropy:d}=_;T==null&&(T=!0),h=Cr("msgHash",h),B&&(h=Cr("prehashed msgHash",E(h)));const k=Z(h),W=l(m),K=[ee(W),ee(k)];if(d!=null&&d!==!1){const ge=d===!0?x(r.BYTES):d;K.push(Cr("extraEntropy",ge))}const re=qs(...K),xe=k;function be(ge){const tt=G(ge);if(!A(tt))return;const Ue=c(tt),Pe=u.BASE.multiply(tt).toAffine(),pe=a(Pe.x);if(pe===Oi)return;const we=a(Ue*a(xe+pe*W));if(we===Oi)return;let ke=(Pe.x===pe?0:2)|Number(Pe.y&Hn),vt=we;return T&&R(we)&&(vt=M(we),ke^=1),new H(pe,vt,ke)}return{seed:re,k2sig:be}}const Q={lowS:t.lowS,prehash:!1},I={lowS:t.lowS,prehash:!1};function g(h,m,_=Q){const{seed:E,k2sig:x}=se(h,m,_),T=t;return pg(T.hash.outputLen,T.nByteLength,T.hmac)(E,x)}u.BASE._setWindowSize(8);function f(h,m,_,E=I){const x=h;if(m=Cr("msgHash",m),_=Cr("publicKey",_),"strict"in E)throw new Error("options.strict was renamed to lowS");const{lowS:T,prehash:B}=E;let d,k;try{if(typeof x=="string"||Hs(x))try{d=H.fromDER(x)}catch(Pe){if(!(Pe instanceof Xs.Err))throw Pe;d=H.fromCompact(x)}else if(typeof x=="object"&&typeof x.r=="bigint"&&typeof x.s=="bigint"){const{r:Pe,s:pe}=x;d=new H(Pe,pe)}else throw new Error("PARSE");k=u.fromHex(_)}catch(Pe){if(Pe.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(T&&d.hasHighS())return!1;B&&(m=t.hash(m));const{r:W,s:K}=d,re=Z(m),xe=c(K),be=a(re*xe),ge=a(W*xe),tt=u.BASE.multiplyAndAddUnsafe(k,be,ge)?.toAffine();return tt?a(tt.x)===W:!1}return{CURVE:t,getPublicKey:N,getSharedSecret:q,sign:g,verify:f,ProjectivePoint:u,Signature:H,utils:F}}class l1 extends ig{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,ix(t);const n=Ml(r);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?t.create().update(n).digest():n);for(let o=0;onew l1(e,t).update(r).digest();h1.create=(e,t)=>new l1(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function H3(e){return{hash:e,hmac:(t,...r)=>h1(e,t,ng(...r)),randomBytes:og}}function j3(e,t){const r=n=>D3({...e,...H3(n)});return Object.freeze({...r(t),create:r})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const d1=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),p1=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),z3=BigInt(1),yh=BigInt(2),g1=(e,t)=>(e+t/yh)/t;function q3(e){const t=d1,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),u=e*e*e%t,l=u*u*e%t,y=wr(l,r,t)*l%t,A=wr(y,r,t)*l%t,v=wr(A,yh,t)*u%t,R=wr(v,i,t)*v%t,M=wr(R,s,t)*R%t,P=wr(M,a,t)*M%t,H=wr(P,c,t)*P%t,F=wr(H,a,t)*M%t,N=wr(F,r,t)*l%t,$=wr(N,o,t)*R%t,q=wr($,n,t)*u%t,G=wr(q,yh,t);if(!wh.eql(wh.sqr(G),e))throw new Error("Cannot find square root");return G}const wh=mg(d1,void 0,void 0,{sqrt:q3}),mh=j3({a:BigInt(0),b:BigInt(7),Fp:wh,n:p1,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=p1,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-z3*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=g1(s*e,t),c=g1(-n*e,t);let u=ir(e-a*r-c*i,t),l=ir(-a*n-c*s,t);const y=u>o,A=l>o;if(y&&(u=t-u),A&&(l=t-l),u>o||l>o)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:y,k1:u,k2neg:A,k2:l}}}},Zl);BigInt(0),mh.ProjectivePoint,pf.utils.randomPrivateKey;function y1(e){try{return pf.ExtendedPoint.fromHex(e),!0}catch{return!1}}const w1=(e,t)=>pf.sign(e,t.slice(0,32)),V3=pf.verify,Uo=e=>ie.Buffer.isBuffer(e)?e:e instanceof Uint8Array?ie.Buffer.from(e.buffer,e.byteOffset,e.byteLength):ie.Buffer.from(e);class W3{constructor(t){Object.assign(this,t)}encode(){return ie.Buffer.from(Mg(Tf,this))}static decode(t){return Og(Tf,this,t)}static decodeUnchecked(t){return Tg(Tf,this,t)}}const Tf=new Map;var m1;const K3=32,cs=32;function Z3(e){return e._bn!==void 0}let b1=1;class et extends W3{constructor(t){if(super({}),this._bn=void 0,Z3(t))this._bn=t._bn;else{if(typeof t=="string"){const r=Ar.decode(t);if(r.length!=cs)throw new Error("Invalid public key input");this._bn=new Ig(r)}else this._bn=new Ig(t);if(this._bn.byteLength()>cs)throw new Error("Invalid public key input")}}static unique(){const t=new et(b1);return b1+=1,new et(t.toBuffer())}equals(t){return this._bn.eq(t._bn)}toBase58(){return Ar.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){const t=this.toBuffer();return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}toBuffer(){const t=this._bn.toArrayLike(ie.Buffer);if(t.length===cs)return t;const r=ie.Buffer.alloc(32);return t.copy(r,32-t.length),r}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(t,r,n){const i=ie.Buffer.concat([t.toBuffer(),ie.Buffer.from(r),n.toBuffer()]),s=Zl(i);return new et(s)}static createProgramAddressSync(t,r){let n=ie.Buffer.alloc(0);t.forEach(function(s){if(s.length>K3)throw new TypeError("Max seed length exceeded");n=ie.Buffer.concat([n,Uo(s)])}),n=ie.Buffer.concat([n,r.toBuffer(),ie.Buffer.from("ProgramDerivedAddress")]);const i=Zl(n);if(y1(i))throw new Error("Invalid seeds, address must fall off the curve");return new et(i)}static async createProgramAddress(t,r){return this.createProgramAddressSync(t,r)}static findProgramAddressSync(t,r){let n=255,i;for(;n!=0;){try{const s=t.concat(ie.Buffer.from([n]));i=this.createProgramAddressSync(s,r)}catch(s){if(s instanceof TypeError)throw s;n--;continue}return[i,n]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(t,r){return this.findProgramAddressSync(t,r)}static isOnCurve(t){const r=new et(t);return y1(r.toBytes())}}m1=et,et.default=new m1("11111111111111111111111111111111"),Tf.set(et,{kind:"struct",fields:[["_bn","u256"]]}),new et("BPFLoader1111111111111111111111111111111111");const Fo=1280-40-8,bh=127,kf=64;class v1 extends Error{constructor(t){super(`Signature ${t} has expired: block height exceeded.`),this.signature=void 0,this.signature=t}}Object.defineProperty(v1.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});class _1 extends Error{constructor(t,r){super(`Transaction was not confirmed in ${r.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${t} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=t}}Object.defineProperty(_1.prototype,"name",{value:"TransactionExpiredTimeoutError"});class za extends Error{constructor(t){super(`Signature ${t} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=t}}Object.defineProperty(za.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});class Cf{constructor(t,r){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=t,this.accountKeysFromLookups=r}keySegments(){const t=[this.staticAccountKeys];return this.accountKeysFromLookups&&(t.push(this.accountKeysFromLookups.writable),t.push(this.accountKeysFromLookups.readonly)),t}get(t){for(const r of this.keySegments()){if(t255+1)throw new Error("Account index overflow encountered during compilation");const n=new Map;this.keySegments().flat().forEach((s,o)=>{n.set(s.toBase58(),o)});const i=s=>{const o=n.get(s.toBase58());if(o===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return o};return t.map(s=>({programIdIndex:i(s.programId),accountKeyIndexes:s.keys.map(o=>i(o.pubkey)),data:s.data}))}}const St=(e="publicKey")=>nr(32,e),G3=(e="signature")=>nr(64,e),Do=(e="string")=>{const t=Fe([qe("length"),qe("lengthPadding"),nr(Gs(qe(),-8),"chars")],e),r=t.decode.bind(t),n=t.encode.bind(t),i=t;return i.decode=(s,o)=>r(s,o).chars.toString(),i.encode=(s,o,a)=>{const c={chars:ie.Buffer.from(s,"utf8")};return n(c,o,a)},i.alloc=s=>qe().span+qe().span+ie.Buffer.from(s,"utf8").length,i},Y3=(e="authorized")=>Fe([St("staker"),St("withdrawer")],e),X3=(e="lockup")=>Fe([In("unixTimestamp"),In("epoch"),St("custodian")],e),J3=(e="voteInit")=>Fe([St("nodePubkey"),St("authorizedVoter"),St("authorizedWithdrawer"),Ut("commission")],e),Q3=(e="voteAuthorizeWithSeedArgs")=>Fe([qe("voteAuthorizationType"),St("currentAuthorityDerivedKeyOwnerPubkey"),Do("currentAuthorityDerivedKeySeed"),St("newAuthorized")],e);function Rn(e){let t=0,r=0;for(;;){let n=e.shift();if(t|=(n&127)<>=7,r==0){e.push(n);break}else n|=128,e.push(n)}}function sr(e,t){if(!e)throw new Error(t||"Assertion failed")}class Lf{constructor(t,r){this.payer=void 0,this.keyMetaMap=void 0,this.payer=t,this.keyMetaMap=r}static compile(t,r){const n=new Map,i=o=>{const a=o.toBase58();let c=n.get(a);return c===void 0&&(c={isSigner:!1,isWritable:!1,isInvoked:!1},n.set(a,c)),c},s=i(r);s.isSigner=!0,s.isWritable=!0;for(const o of t){i(o.programId).isInvoked=!0;for(const a of o.keys){const c=i(a.pubkey);c.isSigner||=a.isSigner,c.isWritable||=a.isWritable}}return new Lf(r,n)}getMessageComponents(){const t=[...this.keyMetaMap.entries()];sr(t.length<=256,"Max static account keys length exceeded");const r=t.filter(([,c])=>c.isSigner&&c.isWritable),n=t.filter(([,c])=>c.isSigner&&!c.isWritable),i=t.filter(([,c])=>!c.isSigner&&c.isWritable),s=t.filter(([,c])=>!c.isSigner&&!c.isWritable),o={numRequiredSignatures:r.length+n.length,numReadonlySignedAccounts:n.length,numReadonlyUnsignedAccounts:s.length};{sr(r.length>0,"Expected at least one writable signer key");const[c]=r[0];sr(c===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}const a=[...r.map(([c])=>new et(c)),...n.map(([c])=>new et(c)),...i.map(([c])=>new et(c)),...s.map(([c])=>new et(c))];return[o,a]}extractTableLookup(t){const[r,n]=this.drainKeysFoundInLookupTable(t.state.addresses,o=>!o.isSigner&&!o.isInvoked&&o.isWritable),[i,s]=this.drainKeysFoundInLookupTable(t.state.addresses,o=>!o.isSigner&&!o.isInvoked&&!o.isWritable);if(!(r.length===0&&i.length===0))return[{accountKey:t.key,writableIndexes:r,readonlyIndexes:i},{writable:n,readonly:s}]}drainKeysFoundInLookupTable(t,r){const n=new Array,i=new Array;for(const[s,o]of this.keyMetaMap.entries())if(r(o)){const a=new et(s),c=t.findIndex(u=>u.equals(a));c>=0&&(sr(c<256,"Max lookup table index exceeded"),n.push(c),i.push(a),this.keyMetaMap.delete(s))}return[n,i]}}const E1="Reached end of buffer unexpectedly";function Ni(e){if(e.length===0)throw new Error(E1);return e.shift()}function kn(e,...t){const[r]=t;if(t.length===2?r+(t[1]??0)>e.length:r>=e.length)throw new Error(E1);return e.splice(...t)}class Pi{constructor(t){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=t.header,this.accountKeys=t.accountKeys.map(r=>new et(r)),this.recentBlockhash=t.recentBlockhash,this.instructions=t.instructions,this.instructions.forEach(r=>this.indexToProgramIds.set(r.programIdIndex,this.accountKeys[r.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:Ar.decode(t.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new Cf(this.staticAccountKeys)}static compile(t){const r=Lf.compile(t.instructions,t.payerKey),[n,i]=r.getMessageComponents(),o=new Cf(i).compileInstructions(t.instructions).map(a=>({programIdIndex:a.programIdIndex,accounts:a.accountKeyIndexes,data:Ar.encode(a.data)}));return new Pi({header:n,accountKeys:i,recentBlockhash:t.recentBlockhash,instructions:o})}isAccountSigner(t){return t=this.header.numRequiredSignatures){const n=t-r,s=this.accountKeys.length-r-this.header.numReadonlyUnsignedAccounts;return n!this.isProgramId(r))}serialize(){const t=this.accountKeys.length;let r=[];Tn(r,t);const n=this.instructions.map(y=>{const{accounts:A,programIdIndex:v}=y,R=Array.from(Ar.decode(y.data));let M=[];Tn(M,A.length);let P=[];return Tn(P,R.length),{programIdIndex:v,keyIndicesCount:ie.Buffer.from(M),keyIndices:A,dataLength:ie.Buffer.from(P),data:R}});let i=[];Tn(i,n.length);let s=ie.Buffer.alloc(Fo);ie.Buffer.from(i).copy(s);let o=i.length;n.forEach(y=>{const v=Fe([Ut("programIdIndex"),nr(y.keyIndicesCount.length,"keyIndicesCount"),en(Ut("keyIndex"),y.keyIndices.length,"keyIndices"),nr(y.dataLength.length,"dataLength"),en(Ut("userdatum"),y.data.length,"data")]).encode(y,s,o);o+=v}),s=s.slice(0,o);const a=Fe([nr(1,"numRequiredSignatures"),nr(1,"numReadonlySignedAccounts"),nr(1,"numReadonlyUnsignedAccounts"),nr(r.length,"keyCount"),en(St("key"),t,"keys"),St("recentBlockhash")]),c={numRequiredSignatures:ie.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:ie.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:ie.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:ie.Buffer.from(r),keys:this.accountKeys.map(y=>Uo(y.toBytes())),recentBlockhash:Ar.decode(this.recentBlockhash)};let u=ie.Buffer.alloc(2048);const l=a.encode(c,u);return s.copy(u,l),u.slice(0,l+s.length)}static from(t){let r=[...t];const n=Ni(r);if(n!==(n&bh))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");const i=Ni(r),s=Ni(r),o=Rn(r);let a=[];for(let A=0;A0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new Cf(this.staticAccountKeys,r)}isAccountSigner(t){return t=n){const i=t-n,s=this.addressTableLookups.reduce((o,a)=>o+a.writableIndexes.length,0);return i=this.header.numRequiredSignatures){const i=t-r,o=n-r-this.header.numReadonlyUnsignedAccounts;return is.key.equals(n.accountKey));if(!i)throw new Error(`Failed to find address lookup table account for table key ${n.accountKey.toBase58()}`);for(const s of n.writableIndexes)if(sl.toBytes()),recentBlockhash:Ar.decode(this.recentBlockhash),instructionsLength:new Uint8Array(n),serializedInstructions:r,addressTableLookupsLength:new Uint8Array(s),serializedAddressTableLookups:i},a);return a.slice(0,u)}serializeInstructions(){let t=0;const r=new Uint8Array(Fo);for(const n of this.compiledInstructions){const i=Array();Tn(i,n.accountKeyIndexes.length);const s=Array();Tn(s,n.data.length);const o=Fe([Ut("programIdIndex"),nr(i.length,"encodedAccountKeyIndexesLength"),en(Ut(),n.accountKeyIndexes.length,"accountKeyIndexes"),nr(s.length,"encodedDataLength"),nr(n.data.length,"data")]);t+=o.encode({programIdIndex:n.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(i),accountKeyIndexes:n.accountKeyIndexes,encodedDataLength:new Uint8Array(s),data:n.data},r,t)}return r.slice(0,t)}serializeAddressTableLookups(){let t=0;const r=new Uint8Array(Fo);for(const n of this.addressTableLookups){const i=Array();Tn(i,n.writableIndexes.length);const s=Array();Tn(s,n.readonlyIndexes.length);const o=Fe([St("accountKey"),nr(i.length,"encodedWritableIndexesLength"),en(Ut(),n.writableIndexes.length,"writableIndexes"),nr(s.length,"encodedReadonlyIndexesLength"),en(Ut(),n.readonlyIndexes.length,"readonlyIndexes")]);t+=o.encode({accountKey:n.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(i),writableIndexes:n.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(s),readonlyIndexes:n.readonlyIndexes},r,t)}return r.slice(0,t)}static deserialize(t){let r=[...t];const n=Ni(r),i=n&bh;sr(n!==i,"Expected versioned message but received legacy message");const s=i;sr(s===0,`Expected versioned message with version 0 but found version ${s}`);const o={numRequiredSignatures:Ni(r),numReadonlySignedAccounts:Ni(r),numReadonlyUnsignedAccounts:Ni(r)},a=[],c=Rn(r);for(let R=0;R{const t=x1.deserializeMessageVersion(e);if(t==="legacy")return Pi.from(e);if(t===0)return qa.deserialize(e);throw new Error(`Transaction message version ${t} deserialization is not supported`)}};let fs=function(e){return e[e.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",e[e.PROCESSED=1]="PROCESSED",e[e.TIMED_OUT=2]="TIMED_OUT",e[e.NONCE_INVALID=3]="NONCE_INVALID",e}({});const eA=ie.Buffer.alloc(kf).fill(0);class S1{constructor(t){this.keys=void 0,this.programId=void 0,this.data=ie.Buffer.alloc(0),this.programId=t.programId,this.keys=t.keys,t.data&&(this.data=t.data)}toJSON(){return{keys:this.keys.map(({pubkey:t,isSigner:r,isWritable:n})=>({pubkey:t.toJSON(),isSigner:r,isWritable:n})),programId:this.programId.toJSON(),data:[...this.data]}}}class us{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(t){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,!!t)if(t.feePayer&&(this.feePayer=t.feePayer),t.signatures&&(this.signatures=t.signatures),Object.prototype.hasOwnProperty.call(t,"nonceInfo")){const{minContextSlot:r,nonceInfo:n}=t;this.minNonceContextSlot=r,this.nonceInfo=n}else if(Object.prototype.hasOwnProperty.call(t,"lastValidBlockHeight")){const{blockhash:r,lastValidBlockHeight:n}=t;this.recentBlockhash=r,this.lastValidBlockHeight=n}else{const{recentBlockhash:r,nonceInfo:n}=t;n&&(this.nonceInfo=n),this.recentBlockhash=r}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(t=>t.toJSON()),signers:this.signatures.map(({publicKey:t})=>t.toJSON())}}add(...t){if(t.length===0)throw new Error("No instructions");return t.forEach(r=>{"instructions"in r?this.instructions=this.instructions.concat(r.instructions):"data"in r&&"programId"in r&&"keys"in r?this.instructions.push(r):this.instructions.push(new S1(r))}),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let t,r;if(this.nonceInfo?(t=this.nonceInfo.nonce,this.instructions[0]!=this.nonceInfo.nonceInstruction?r=[this.nonceInfo.nonceInstruction,...this.instructions]:r=this.instructions):(t=this.recentBlockhash,r=this.instructions),!t)throw new Error("Transaction recentBlockhash required");r.length<1&&console.warn("No instructions provided");let n;if(this.feePayer)n=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)n=this.signatures[0].publicKey;else throw new Error("Transaction fee payer required");for(let M=0;M{M.keys.forEach(H=>{s.push({...H})});const P=M.programId.toString();i.includes(P)||i.push(P)}),i.forEach(M=>{s.push({pubkey:new et(M),isSigner:!1,isWritable:!1})});const o=[];s.forEach(M=>{const P=M.pubkey.toString(),H=o.findIndex(F=>F.pubkey.toString()===P);H>-1?(o[H].isWritable=o[H].isWritable||M.isWritable,o[H].isSigner=o[H].isSigner||M.isSigner):o.push(M)}),o.sort(function(M,P){if(M.isSigner!==P.isSigner)return M.isSigner?-1:1;if(M.isWritable!==P.isWritable)return M.isWritable?-1:1;const H={localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"};return M.pubkey.toBase58().localeCompare(P.pubkey.toBase58(),"en",H)});const a=o.findIndex(M=>M.pubkey.equals(n));if(a>-1){const[M]=o.splice(a,1);M.isSigner=!0,M.isWritable=!0,o.unshift(M)}else o.unshift({pubkey:n,isSigner:!0,isWritable:!0});for(const M of this.signatures){const P=o.findIndex(H=>H.pubkey.equals(M.publicKey));if(P>-1)o[P].isSigner||(o[P].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."));else throw new Error(`unknown signer: ${M.publicKey.toString()}`)}let c=0,u=0,l=0;const y=[],A=[];o.forEach(({pubkey:M,isSigner:P,isWritable:H})=>{P?(y.push(M.toString()),c+=1,H||(u+=1)):(A.push(M.toString()),H||(l+=1))});const v=y.concat(A),R=r.map(M=>{const{data:P,programId:H}=M;return{programIdIndex:v.indexOf(H.toString()),accounts:M.keys.map(F=>v.indexOf(F.pubkey.toString())),data:Ar.encode(P)}});return R.forEach(M=>{sr(M.programIdIndex>=0),M.accounts.forEach(P=>sr(P>=0))}),new Pi({header:{numRequiredSignatures:c,numReadonlySignedAccounts:u,numReadonlyUnsignedAccounts:l},accountKeys:v,recentBlockhash:t,instructions:R})}_compile(){const t=this.compileMessage(),r=t.accountKeys.slice(0,t.header.numRequiredSignatures);return this.signatures.length===r.length&&this.signatures.every((i,s)=>r[s].equals(i.publicKey))||(this.signatures=r.map(n=>({signature:null,publicKey:n}))),t}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(t){return(await t.getFeeForMessage(this.compileMessage())).value}setSigners(...t){if(t.length===0)throw new Error("No signers");const r=new Set;this.signatures=t.filter(n=>{const i=n.toString();return r.has(i)?!1:(r.add(i),!0)}).map(n=>({signature:null,publicKey:n}))}sign(...t){if(t.length===0)throw new Error("No signers");const r=new Set,n=[];for(const s of t){const o=s.publicKey.toString();r.has(o)||(r.add(o),n.push(s))}this.signatures=n.map(s=>({signature:null,publicKey:s.publicKey}));const i=this._compile();this._partialSign(i,...n)}partialSign(...t){if(t.length===0)throw new Error("No signers");const r=new Set,n=[];for(const s of t){const o=s.publicKey.toString();r.has(o)||(r.add(o),n.push(s))}const i=this._compile();this._partialSign(i,...n)}_partialSign(t,...r){const n=t.serialize();r.forEach(i=>{const s=w1(n,i.secretKey);this._addSignature(i.publicKey,Uo(s))})}addSignature(t,r){this._compile(),this._addSignature(t,r)}_addSignature(t,r){sr(r.length===64);const n=this.signatures.findIndex(i=>t.equals(i.publicKey));if(n<0)throw new Error(`unknown signer: ${t.toString()}`);this.signatures[n].signature=ie.Buffer.from(r)}verifySignatures(t=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),t)}_getMessageSignednessErrors(t,r){const n={};for(const{signature:i,publicKey:s}of this.signatures)i===null?r&&(n.missing||=[]).push(s):V3(i,t,s.toBytes())||(n.invalid||=[]).push(s);return n.invalid||n.missing?n:void 0}serialize(t){const{requireAllSignatures:r,verifySignatures:n}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},t),i=this.serializeMessage();if(n){const s=this._getMessageSignednessErrors(i,r);if(s){let o="Signature verification failed.";throw s.invalid&&(o+=` +Invalid signature for public key${s.invalid.length===1?"":"(s)"} [\`${s.invalid.map(a=>a.toBase58()).join("`, `")}\`].`),s.missing&&(o+=` +Missing signature for public key${s.missing.length===1?"":"(s)"} [\`${s.missing.map(a=>a.toBase58()).join("`, `")}\`].`),new Error(o)}}return this._serialize(i)}_serialize(t){const{signatures:r}=this,n=[];Tn(n,r.length);const i=n.length+r.length*64+t.length,s=ie.Buffer.alloc(i);return sr(r.length<256),ie.Buffer.from(n).copy(s,0),r.forEach(({signature:o},a)=>{o!==null&&(sr(o.length===64,"signature has invalid length"),ie.Buffer.from(o).copy(s,n.length+a*64))}),t.copy(s,n.length+r.length*64),sr(s.length<=Fo,`Transaction too large: ${s.length} > ${Fo}`),s}get keys(){return sr(this.instructions.length===1),this.instructions[0].keys.map(t=>t.pubkey)}get programId(){return sr(this.instructions.length===1),this.instructions[0].programId}get data(){return sr(this.instructions.length===1),this.instructions[0].data}static from(t){let r=[...t];const n=Rn(r);let i=[];for(let s=0;s0&&(n.feePayer=t.accountKeys[0]),r.forEach((i,s)=>{const o={signature:i==Ar.encode(eA)?null:Ar.decode(i),publicKey:t.accountKeys[s]};n.signatures.push(o)}),t.instructions.forEach(i=>{const s=i.accounts.map(o=>{const a=t.accountKeys[o];return{pubkey:a,isSigner:n.signatures.some(c=>c.publicKey.toString()===a.toString())||t.isAccountSigner(o),isWritable:t.isAccountWritable(o)}});n.instructions.push(new S1({keys:s,programId:t.accountKeys[i.programIdIndex],data:Ar.decode(i.data)}))}),n._message=t,n._json=n.toJSON(),n}}class Va{get version(){return this.message.version}constructor(t,r){if(this.signatures=void 0,this.message=void 0,r!==void 0)sr(r.length===t.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=r;else{const n=[];for(let i=0;io.equals(i.publicKey));sr(s>=0,`Cannot sign with non signer key ${i.publicKey.toBase58()}`),this.signatures[s]=w1(r,i.secretKey)}}addSignature(t,r){sr(r.byteLength===64,"Signature must be 64 bytes long");const i=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex(s=>s.equals(t));sr(i>=0,`Can not add signature; \`${t.toBase58()}\` is not required to sign this transaction`),this.signatures[i]=r}}const tA=1e3/(160/64);new et("SysvarC1ock11111111111111111111111111111111"),new et("SysvarEpochSchedu1e111111111111111111111111"),new et("Sysvar1nstructions1111111111111111111111111"),new et("SysvarRecentB1ockHashes11111111111111111111"),new et("SysvarRent111111111111111111111111111111111"),new et("SysvarRewards111111111111111111111111111111"),new et("SysvarS1otHashes111111111111111111111111111"),new et("SysvarS1otHistory11111111111111111111111111"),new et("SysvarStakeHistory1111111111111111111111111");function Ho(e){return new Promise(t=>setTimeout(t,e))}const rA=Gr("lamportsPerSignature"),A1=Fe([qe("version"),qe("state"),St("authorizedPubkey"),St("nonce"),Fe([rA],"feeCalculator")]);A1.span;class vh{constructor(t){this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=t.authorizedPubkey,this.nonce=t.nonce,this.feeCalculator=t.feeCalculator}static fromAccountData(t){const r=A1.decode(Uo(t),0);return new vh({authorizedPubkey:new et(r.authorizedPubkey),nonce:new et(r.nonce).toString(),feeCalculator:r.feeCalculator})}}const nA=e=>{const t=e.decode.bind(e),r=e.encode.bind(e);return{decode:t,encode:r}},jo=(e=>t=>{const r=nr(e,t),{encode:n,decode:i}=nA(r),s=r;return s.decode=(o,a)=>{const c=i(o,a);return $S(ie.Buffer.from(c))},s.encode=(o,a,c)=>{const u=NS(o,e);return n(u,a,c)},s})(8);Object.freeze({Create:{index:0,layout:Fe([qe("instruction"),In("lamports"),In("space"),St("programId")])},Assign:{index:1,layout:Fe([qe("instruction"),St("programId")])},Transfer:{index:2,layout:Fe([qe("instruction"),jo("lamports")])},CreateWithSeed:{index:3,layout:Fe([qe("instruction"),St("base"),Do("seed"),In("lamports"),In("space"),St("programId")])},AdvanceNonceAccount:{index:4,layout:Fe([qe("instruction")])},WithdrawNonceAccount:{index:5,layout:Fe([qe("instruction"),In("lamports")])},InitializeNonceAccount:{index:6,layout:Fe([qe("instruction"),St("authorized")])},AuthorizeNonceAccount:{index:7,layout:Fe([qe("instruction"),St("authorized")])},Allocate:{index:8,layout:Fe([qe("instruction"),In("space")])},AllocateWithSeed:{index:9,layout:Fe([qe("instruction"),St("base"),Do("seed"),In("space"),St("programId")])},AssignWithSeed:{index:10,layout:Fe([qe("instruction"),St("base"),Do("seed"),St("programId")])},TransferWithSeed:{index:11,layout:Fe([qe("instruction"),jo("lamports"),Do("seed"),St("programId")])},UpgradeNonceAccount:{index:12,layout:Fe([qe("instruction")])}}),new et("11111111111111111111111111111111"),new et("BPFLoader2111111111111111111111111111111111");function iA(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var sA=Object.prototype.toString,oA=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};function Wa(e,t){var r,n,i,s,o,a,c;if(e===!0)return"true";if(e===!1)return"false";switch(typeof e){case"object":if(e===null)return null;if(e.toJSON&&typeof e.toJSON=="function")return Wa(e.toJSON(),t);if(c=sA.call(e),c==="[object Array]"){for(i="[",n=e.length-1,r=0;r-1&&(i+=Wa(e[r],!0)),i+"]"}else if(c==="[object Object]"){for(s=oA(e).sort(),n=s.length,i="",r=0;r1;)e/=2,t++;return t}function cA(e){return e===0?1:(e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e+1)}class fA{constructor(t,r,n,i,s){this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=t,this.leaderScheduleSlotOffset=r,this.warmup=n,this.firstNormalEpoch=i,this.firstNormalSlot=s}getEpoch(t){return this.getEpochAndSlotIndex(t)[0]}getEpochAndSlotIndex(t){if(t{const o=R3(s,{autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3,...r});return"socket"in o?this.underlyingSocket=o.socket:this.underlyingSocket=o,o};super(i,t,r,n),this.underlyingSocket=void 0}call(...t){const r=this.underlyingSocket?.readyState;return r===1?super.call(...t):Promise.reject(new Error("Tried to call a JSON-RPC method `"+t[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+r+")"))}notify(...t){const r=this.underlyingSocket?.readyState;return r===1?super.notify(...t):Promise.reject(new Error("Tried to send a JSON-RPC notification `"+t[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+r+")"))}}function hA(e,t){let r;try{r=e.layout.decode(t)}catch(n){throw new Error("invalid instruction; "+n)}if(r.typeIndex!==e.index)throw new Error(`invalid account data; account type mismatch ${r.typeIndex} != ${e.index}`);return r}const R1=56;class T1{constructor(t){this.key=void 0,this.state=void 0,this.key=t.key,this.state=t.state}isActive(){const t=BigInt("0xffffffffffffffff");return this.state.deactivationSlot===t}static deserialize(t){const r=hA(dA,t),n=t.length-R1;sr(n>=0,"lookup table is invalid"),sr(n%32===0,"lookup table is invalid");const i=n/32,{addresses:s}=Fe([en(St(),i,"addresses")]).decode(t.slice(R1));return{deactivationSlot:r.deactivationSlot,lastExtendedSlot:r.lastExtendedSlot,lastExtendedSlotStartIndex:r.lastExtendedStartIndex,authority:r.authority.length!==0?new et(r.authority[0]):void 0,addresses:s.map(o=>new et(o))}}}const dA={index:1,layout:Fe([qe("typeIndex"),jo("deactivationSlot"),Gr("lastExtendedSlot"),Ut("lastExtendedStartIndex"),Ut(),en(St(),Gs(Ut(),-1),"authority")])},pA=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i;function gA(e){const t=e.match(pA);if(t==null)throw TypeError(`Failed to validate endpoint URL \`${e}\``);const[r,n,i,s]=t,o=e.startsWith("https:")?"wss:":"ws:",a=i==null?null:parseInt(i.slice(1),10),c=a==null?"":`:${a+1}`;return`${o}//${n}${c}${s}`}const kr=Da(ch(et),Se(),e=>new et(e)),k1=fh([Se(),dr("base64")]),Eh=Da(ch(ie.Buffer),k1,e=>ie.Buffer.from(e[0],"base64")),yA=30*1e3;function wA(e){if(/^https?:/.test(e)===!1)throw new TypeError("Endpoint URL must start with `http:` or `https:`.");return e}function or(e){let t,r;if(typeof e=="string")t=e;else if(e){const{commitment:n,...i}=e;t=n,r=i}return{commitment:t,config:r}}function C1(e){return mn([me({jsonrpc:dr("2.0"),id:Se(),result:e}),me({jsonrpc:dr("2.0"),id:Se(),error:me({code:Fa(),message:Se(),data:Qe(qS())})})])}const mA=C1(Fa());function bt(e){return Da(C1(e),mA,t=>"error"in t?t:{...t,result:Be(t.result,e)})}function mr(e){return bt(me({context:me({slot:te()}),value:e}))}function $f(e){return me({context:me({slot:te()}),value:e})}function xh(e,t){return e===0?new qa({header:t.header,staticAccountKeys:t.accountKeys.map(r=>new et(r)),recentBlockhash:t.recentBlockhash,compiledInstructions:t.instructions.map(r=>({programIdIndex:r.programIdIndex,accountKeyIndexes:r.accounts,data:Ar.decode(r.data)})),addressTableLookups:t.addressTableLookups}):new Pi(t)}const bA=me({foundation:te(),foundationTerm:te(),initial:te(),taper:te(),terminal:te()}),vA=bt(Ce(Te(me({epoch:te(),effectiveSlot:te(),amount:te(),postBalance:te(),commission:Qe(Te(te()))})))),_A=Ce(me({slot:te(),prioritizationFee:te()})),EA=me({total:te(),validator:te(),foundation:te(),epoch:te()}),xA=me({epoch:te(),slotIndex:te(),slotsInEpoch:te(),absoluteSlot:te(),blockHeight:Qe(te()),transactionCount:Qe(te())}),SA=me({slotsPerEpoch:te(),leaderScheduleSlotOffset:te(),warmup:bi(),firstNormalEpoch:te(),firstNormalSlot:te()}),AA=t1(Se(),Ce(te())),Js=Te(mn([me({}),Se()])),BA=me({err:Js}),IA=dr("receivedSignature"),RA=me({"solana-core":Se(),"feature-set":Qe(te())}),L1=mr(me({err:Te(mn([me({}),Se()])),logs:Te(Ce(Se())),accounts:Qe(Te(Ce(Te(me({executable:bi(),owner:Se(),lamports:te(),data:Ce(Se()),rentEpoch:Qe(te())}))))),unitsConsumed:Qe(te()),returnData:Qe(Te(me({programId:Se(),data:fh([Se(),dr("base64")])})))})),TA=mr(me({byIdentity:t1(Se(),Ce(te())),range:me({firstSlot:te(),lastSlot:te()})}));function kA(e,t,r,n,i,s){const o=r||uA;let a;s!=null&&console.warn("You have supplied an `httpAgent` when creating a `Connection` in a browser environment.It has been ignored; `httpAgent` is only used in Node environments.");let c;return n&&(c=async(l,y)=>{const A=await new Promise((v,R)=>{try{n(l,y,(M,P)=>v([M,P]))}catch(M){R(M)}});return await o(...A)}),new w3(async(l,y)=>{const A={method:"POST",body:l,agent:a,headers:Object.assign({"Content-Type":"application/json"},t||{},C6)};try{let v=5,R,M=500;for(;c?R=await c(e,A):R=await o(e,A),!(R.status!==429||i===!0||(v-=1,v===0));)console.error(`Server responded with ${R.status} ${R.statusText}. Retrying after ${M}ms delay...`),await Ho(M),M*=2;const P=await R.text();R.ok?y(null,P):y(new Error(`${R.status} ${R.statusText}: ${P}`))}catch(v){v instanceof Error&&y(v)}},{})}function CA(e){return(t,r)=>new Promise((n,i)=>{e.request(t,r,(s,o)=>{if(s){i(s);return}n(o)})})}function LA(e){return t=>new Promise((r,n)=>{t.length===0&&r([]);const i=t.map(s=>e.request(s.methodName,s.args));e.request(i,(s,o)=>{if(s){n(s);return}r(o)})})}const $A=bt(bA),MA=bt(EA),OA=bt(_A),NA=bt(xA),PA=bt(SA),UA=bt(AA),FA=bt(te()),DA=mr(me({total:te(),circulating:te(),nonCirculating:te(),nonCirculatingAccounts:Ce(kr)})),Sh=me({amount:Se(),uiAmount:Te(te()),decimals:te(),uiAmountString:Qe(Se())}),HA=mr(Ce(me({address:kr,amount:Se(),uiAmount:Te(te()),decimals:te(),uiAmountString:Qe(Se())}))),jA=mr(Ce(me({pubkey:kr,account:me({executable:bi(),owner:kr,lamports:te(),data:Eh,rentEpoch:te()})}))),Ah=me({program:Se(),parsed:Fa(),space:te()}),zA=mr(Ce(me({pubkey:kr,account:me({executable:bi(),owner:kr,lamports:te(),data:Ah,rentEpoch:te()})}))),qA=mr(Ce(me({lamports:te(),address:kr}))),Za=me({executable:bi(),owner:kr,lamports:te(),data:Eh,rentEpoch:te()}),VA=me({pubkey:kr,account:Za}),WA=Da(mn([ch(ie.Buffer),Ah]),mn([k1,Ah]),e=>Array.isArray(e)?Be(e,Eh):e),Bh=me({executable:bi(),owner:kr,lamports:te(),data:WA,rentEpoch:te()}),KA=me({pubkey:kr,account:Bh}),ZA=me({state:mn([dr("active"),dr("inactive"),dr("activating"),dr("deactivating")]),active:te(),inactive:te()}),GA=bt(Ce(me({signature:Se(),slot:te(),err:Js,memo:Te(Se()),blockTime:Qe(Te(te()))}))),YA=bt(Ce(me({signature:Se(),slot:te(),err:Js,memo:Te(Se()),blockTime:Qe(Te(te()))}))),XA=me({subscription:te(),result:$f(Za)}),JA=me({pubkey:kr,account:Za}),QA=me({subscription:te(),result:$f(JA)}),e6=me({parent:te(),slot:te(),root:te()}),t6=me({subscription:te(),result:e6}),r6=mn([me({type:mn([dr("firstShredReceived"),dr("completed"),dr("optimisticConfirmation"),dr("root")]),slot:te(),timestamp:te()}),me({type:dr("createdBank"),parent:te(),slot:te(),timestamp:te()}),me({type:dr("frozen"),slot:te(),timestamp:te(),stats:me({numTransactionEntries:te(),numSuccessfulTransactions:te(),numFailedTransactions:te(),maxTransactionsPerEntry:te()})}),me({type:dr("dead"),slot:te(),timestamp:te(),err:Se()})]),n6=me({subscription:te(),result:r6}),i6=me({subscription:te(),result:$f(mn([BA,IA]))}),s6=me({subscription:te(),result:te()}),o6=me({pubkey:Se(),gossip:Te(Se()),tpu:Te(Se()),rpc:Te(Se()),version:Te(Se())}),$1=me({votePubkey:Se(),nodePubkey:Se(),activatedStake:te(),epochVoteAccount:bi(),epochCredits:Ce(fh([te(),te(),te()])),commission:te(),lastVote:te(),rootSlot:Te(te())}),a6=bt(me({current:Ce($1),delinquent:Ce($1)})),c6=mn([dr("processed"),dr("confirmed"),dr("finalized")]),f6=me({slot:te(),confirmations:Te(te()),err:Js,confirmationStatus:Qe(c6)}),u6=mr(Ce(Te(f6))),l6=bt(te()),M1=me({accountKey:kr,writableIndexes:Ce(te()),readonlyIndexes:Ce(te())}),Ih=me({signatures:Ce(Se()),message:me({accountKeys:Ce(Se()),header:me({numRequiredSignatures:te(),numReadonlySignedAccounts:te(),numReadonlyUnsignedAccounts:te()}),instructions:Ce(me({accounts:Ce(te()),data:Se(),programIdIndex:te()})),recentBlockhash:Se(),addressTableLookups:Qe(Ce(M1))})}),O1=me({pubkey:kr,signer:bi(),writable:bi(),source:Qe(mn([dr("transaction"),dr("lookupTable")]))}),N1=me({accountKeys:Ce(O1),signatures:Ce(Se())}),P1=me({parsed:Fa(),program:Se(),programId:kr}),U1=me({accounts:Ce(kr),data:Se(),programId:kr}),h6=mn([U1,P1]),d6=mn([me({parsed:Fa(),program:Se(),programId:Se()}),me({accounts:Ce(Se()),data:Se(),programId:Se()})]),F1=Da(h6,d6,e=>"accounts"in e?Be(e,U1):Be(e,P1)),D1=me({signatures:Ce(Se()),message:me({accountKeys:Ce(O1),instructions:Ce(F1),recentBlockhash:Se(),addressTableLookups:Qe(Te(Ce(M1)))})}),Mf=me({accountIndex:te(),mint:Se(),owner:Qe(Se()),uiTokenAmount:Sh}),H1=me({writable:Ce(kr),readonly:Ce(kr)}),Of=me({err:Js,fee:te(),innerInstructions:Qe(Te(Ce(me({index:te(),instructions:Ce(me({accounts:Ce(te()),data:Se(),programIdIndex:te()}))})))),preBalances:Ce(te()),postBalances:Ce(te()),logMessages:Qe(Te(Ce(Se()))),preTokenBalances:Qe(Te(Ce(Mf))),postTokenBalances:Qe(Te(Ce(Mf))),loadedAddresses:Qe(H1),computeUnitsConsumed:Qe(te())}),Rh=me({err:Js,fee:te(),innerInstructions:Qe(Te(Ce(me({index:te(),instructions:Ce(F1)})))),preBalances:Ce(te()),postBalances:Ce(te()),logMessages:Qe(Te(Ce(Se()))),preTokenBalances:Qe(Te(Ce(Mf))),postTokenBalances:Qe(Te(Ce(Mf))),loadedAddresses:Qe(H1),computeUnitsConsumed:Qe(te())}),zo=mn([dr(0),dr("legacy")]),Qs=me({pubkey:Se(),lamports:te(),postBalance:Te(te()),rewardType:Te(Se()),commission:Qe(Te(te()))}),p6=bt(Te(me({blockhash:Se(),previousBlockhash:Se(),parentSlot:te(),transactions:Ce(me({transaction:Ih,meta:Te(Of),version:Qe(zo)})),rewards:Qe(Ce(Qs)),blockTime:Te(te()),blockHeight:Te(te())}))),g6=bt(Te(me({blockhash:Se(),previousBlockhash:Se(),parentSlot:te(),rewards:Qe(Ce(Qs)),blockTime:Te(te()),blockHeight:Te(te())}))),y6=bt(Te(me({blockhash:Se(),previousBlockhash:Se(),parentSlot:te(),transactions:Ce(me({transaction:N1,meta:Te(Of),version:Qe(zo)})),rewards:Qe(Ce(Qs)),blockTime:Te(te()),blockHeight:Te(te())}))),w6=bt(Te(me({blockhash:Se(),previousBlockhash:Se(),parentSlot:te(),transactions:Ce(me({transaction:D1,meta:Te(Rh),version:Qe(zo)})),rewards:Qe(Ce(Qs)),blockTime:Te(te()),blockHeight:Te(te())}))),m6=bt(Te(me({blockhash:Se(),previousBlockhash:Se(),parentSlot:te(),transactions:Ce(me({transaction:N1,meta:Te(Rh),version:Qe(zo)})),rewards:Qe(Ce(Qs)),blockTime:Te(te()),blockHeight:Te(te())}))),b6=bt(Te(me({blockhash:Se(),previousBlockhash:Se(),parentSlot:te(),rewards:Qe(Ce(Qs)),blockTime:Te(te()),blockHeight:Te(te())}))),v6=bt(Te(me({blockhash:Se(),previousBlockhash:Se(),parentSlot:te(),transactions:Ce(me({transaction:Ih,meta:Te(Of)})),rewards:Qe(Ce(Qs)),blockTime:Te(te())}))),j1=bt(Te(me({blockhash:Se(),previousBlockhash:Se(),parentSlot:te(),signatures:Ce(Se()),blockTime:Te(te())}))),Th=bt(Te(me({slot:te(),meta:Te(Of),blockTime:Qe(Te(te())),transaction:Ih,version:Qe(zo)}))),Nf=bt(Te(me({slot:te(),transaction:D1,meta:Te(Rh),blockTime:Qe(Te(te())),version:Qe(zo)}))),_6=mr(me({blockhash:Se(),feeCalculator:me({lamportsPerSignature:te()})})),E6=mr(me({blockhash:Se(),lastValidBlockHeight:te()})),x6=mr(bi()),S6=me({slot:te(),numTransactions:te(),numSlots:te(),samplePeriodSecs:te()}),A6=bt(Ce(S6)),B6=mr(Te(me({feeCalculator:me({lamportsPerSignature:te()})}))),I6=bt(Se()),R6=bt(Se()),T6=me({err:Js,logs:Ce(Se()),signature:Se()}),k6=me({result:$f(T6),subscription:te()}),C6={"solana-client":"js/0.0.0-development"};class L6{constructor(t,r){this._commitment=void 0,this._confirmTransactionInitialTimeout=void 0,this._rpcEndpoint=void 0,this._rpcWsEndpoint=void 0,this._rpcClient=void 0,this._rpcRequest=void 0,this._rpcBatchRequest=void 0,this._rpcWebSocket=void 0,this._rpcWebSocketConnected=!1,this._rpcWebSocketHeartbeat=null,this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketGeneration=0,this._disableBlockhashCaching=!1,this._pollingBlockhash=!1,this._blockhashInfo={latestBlockhash:null,lastFetch:0,transactionSignatures:[],simulatedSignatures:[]},this._nextClientSubscriptionId=0,this._subscriptionDisposeFunctionsByClientSubscriptionId={},this._subscriptionHashByClientSubscriptionId={},this._subscriptionStateChangeCallbacksByHash={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,this.getBlockHeight=(()=>{const u={};return async l=>{const{commitment:y,config:A}=or(l),v=this._buildArgs([],y,void 0,A),R=B1(v);return u[R]=u[R]??(async()=>{try{const M=await this._rpcRequest("getBlockHeight",v),P=Be(M,bt(te()));if("error"in P)throw new je(P.error,"failed to get block height information");return P.result}finally{delete u[R]}})(),await u[R]}})();let n,i,s,o,a,c;r&&typeof r=="string"?this._commitment=r:r&&(this._commitment=r.commitment,this._confirmTransactionInitialTimeout=r.confirmTransactionInitialTimeout,n=r.wsEndpoint,i=r.httpHeaders,s=r.fetch,o=r.fetchMiddleware,a=r.disableRetryOnRateLimit,c=r.httpAgent),this._rpcEndpoint=wA(t),this._rpcWsEndpoint=n||gA(t),this._rpcClient=kA(t,i,s,o,a,c),this._rpcRequest=CA(this._rpcClient),this._rpcBatchRequest=LA(this._rpcClient),this._rpcWebSocket=new lA(this._rpcWsEndpoint,{autoconnect:!1,max_reconnects:1/0}),this._rpcWebSocket.on("open",this._wsOnOpen.bind(this)),this._rpcWebSocket.on("error",this._wsOnError.bind(this)),this._rpcWebSocket.on("close",this._wsOnClose.bind(this)),this._rpcWebSocket.on("accountNotification",this._wsOnAccountNotification.bind(this)),this._rpcWebSocket.on("programNotification",this._wsOnProgramAccountNotification.bind(this)),this._rpcWebSocket.on("slotNotification",this._wsOnSlotNotification.bind(this)),this._rpcWebSocket.on("slotsUpdatesNotification",this._wsOnSlotUpdatesNotification.bind(this)),this._rpcWebSocket.on("signatureNotification",this._wsOnSignatureNotification.bind(this)),this._rpcWebSocket.on("rootNotification",this._wsOnRootNotification.bind(this)),this._rpcWebSocket.on("logsNotification",this._wsOnLogsNotification.bind(this))}get commitment(){return this._commitment}get rpcEndpoint(){return this._rpcEndpoint}async getBalanceAndContext(t,r){const{commitment:n,config:i}=or(r),s=this._buildArgs([t.toBase58()],n,void 0,i),o=await this._rpcRequest("getBalance",s),a=Be(o,mr(te()));if("error"in a)throw new je(a.error,`failed to get balance for ${t.toBase58()}`);return a.result}async getBalance(t,r){return await this.getBalanceAndContext(t,r).then(n=>n.value).catch(n=>{throw new Error("failed to get balance of account "+t.toBase58()+": "+n)})}async getBlockTime(t){const r=await this._rpcRequest("getBlockTime",[t]),n=Be(r,bt(Te(te())));if("error"in n)throw new je(n.error,`failed to get block time for slot ${t}`);return n.result}async getMinimumLedgerSlot(){const t=await this._rpcRequest("minimumLedgerSlot",[]),r=Be(t,bt(te()));if("error"in r)throw new je(r.error,"failed to get minimum ledger slot");return r.result}async getFirstAvailableBlock(){const t=await this._rpcRequest("getFirstAvailableBlock",[]),r=Be(t,FA);if("error"in r)throw new je(r.error,"failed to get first available block");return r.result}async getSupply(t){let r={};typeof t=="string"?r={commitment:t}:t?r={...t,commitment:t&&t.commitment||this.commitment}:r={commitment:this.commitment};const n=await this._rpcRequest("getSupply",[r]),i=Be(n,DA);if("error"in i)throw new je(i.error,"failed to get supply");return i.result}async getTokenSupply(t,r){const n=this._buildArgs([t.toBase58()],r),i=await this._rpcRequest("getTokenSupply",n),s=Be(i,mr(Sh));if("error"in s)throw new je(s.error,"failed to get token supply");return s.result}async getTokenAccountBalance(t,r){const n=this._buildArgs([t.toBase58()],r),i=await this._rpcRequest("getTokenAccountBalance",n),s=Be(i,mr(Sh));if("error"in s)throw new je(s.error,"failed to get token account balance");return s.result}async getTokenAccountsByOwner(t,r,n){const{commitment:i,config:s}=or(n);let o=[t.toBase58()];"mint"in r?o.push({mint:r.mint.toBase58()}):o.push({programId:r.programId.toBase58()});const a=this._buildArgs(o,i,"base64",s),c=await this._rpcRequest("getTokenAccountsByOwner",a),u=Be(c,jA);if("error"in u)throw new je(u.error,`failed to get token accounts owned by account ${t.toBase58()}`);return u.result}async getParsedTokenAccountsByOwner(t,r,n){let i=[t.toBase58()];"mint"in r?i.push({mint:r.mint.toBase58()}):i.push({programId:r.programId.toBase58()});const s=this._buildArgs(i,n,"jsonParsed"),o=await this._rpcRequest("getTokenAccountsByOwner",s),a=Be(o,zA);if("error"in a)throw new je(a.error,`failed to get token accounts owned by account ${t.toBase58()}`);return a.result}async getLargestAccounts(t){const r={...t,commitment:t&&t.commitment||this.commitment},n=r.filter||r.commitment?[r]:[],i=await this._rpcRequest("getLargestAccounts",n),s=Be(i,qA);if("error"in s)throw new je(s.error,"failed to get largest accounts");return s.result}async getTokenLargestAccounts(t,r){const n=this._buildArgs([t.toBase58()],r),i=await this._rpcRequest("getTokenLargestAccounts",n),s=Be(i,HA);if("error"in s)throw new je(s.error,"failed to get token largest accounts");return s.result}async getAccountInfoAndContext(t,r){const{commitment:n,config:i}=or(r),s=this._buildArgs([t.toBase58()],n,"base64",i),o=await this._rpcRequest("getAccountInfo",s),a=Be(o,mr(Te(Za)));if("error"in a)throw new je(a.error,`failed to get info about account ${t.toBase58()}`);return a.result}async getParsedAccountInfo(t,r){const{commitment:n,config:i}=or(r),s=this._buildArgs([t.toBase58()],n,"jsonParsed",i),o=await this._rpcRequest("getAccountInfo",s),a=Be(o,mr(Te(Bh)));if("error"in a)throw new je(a.error,`failed to get info about account ${t.toBase58()}`);return a.result}async getAccountInfo(t,r){try{return(await this.getAccountInfoAndContext(t,r)).value}catch(n){throw new Error("failed to get info about account "+t.toBase58()+": "+n)}}async getMultipleParsedAccounts(t,r){const{commitment:n,config:i}=or(r),s=t.map(u=>u.toBase58()),o=this._buildArgs([s],n,"jsonParsed",i),a=await this._rpcRequest("getMultipleAccounts",o),c=Be(a,mr(Ce(Te(Bh))));if("error"in c)throw new je(c.error,`failed to get info for accounts ${s}`);return c.result}async getMultipleAccountsInfoAndContext(t,r){const{commitment:n,config:i}=or(r),s=t.map(u=>u.toBase58()),o=this._buildArgs([s],n,"base64",i),a=await this._rpcRequest("getMultipleAccounts",o),c=Be(a,mr(Ce(Te(Za))));if("error"in c)throw new je(c.error,`failed to get info for accounts ${s}`);return c.result}async getMultipleAccountsInfo(t,r){return(await this.getMultipleAccountsInfoAndContext(t,r)).value}async getStakeActivation(t,r,n){const{commitment:i,config:s}=or(r),o=this._buildArgs([t.toBase58()],i,void 0,{...s,epoch:n??s?.epoch}),a=await this._rpcRequest("getStakeActivation",o),c=Be(a,bt(ZA));if("error"in c)throw new je(c.error,`failed to get Stake Activation ${t.toBase58()}`);return c.result}async getProgramAccounts(t,r){const{commitment:n,config:i}=or(r),{encoding:s,...o}=i||{},a=this._buildArgs([t.toBase58()],n,s||"base64",o),c=await this._rpcRequest("getProgramAccounts",a),u=Ce(VA),l=o.withContext===!0?Be(c,mr(u)):Be(c,bt(u));if("error"in l)throw new je(l.error,`failed to get accounts owned by program ${t.toBase58()}`);return l.result}async getParsedProgramAccounts(t,r){const{commitment:n,config:i}=or(r),s=this._buildArgs([t.toBase58()],n,"jsonParsed",i),o=await this._rpcRequest("getProgramAccounts",s),a=Be(o,bt(Ce(KA)));if("error"in a)throw new je(a.error,`failed to get accounts owned by program ${t.toBase58()}`);return a.result}async confirmTransaction(t,r){let n;if(typeof t=="string")n=t;else{const s=t;if(s.abortSignal?.aborted)return Promise.reject(s.abortSignal.reason);n=s.signature}let i;try{i=Ar.decode(n)}catch{throw new Error("signature must be base58 encoded: "+n)}return sr(i.length===64,"signature has invalid length"),typeof t=="string"?await this.confirmTransactionUsingLegacyTimeoutStrategy({commitment:r||this.commitment,signature:n}):"lastValidBlockHeight"in t?await this.confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:r||this.commitment,strategy:t}):await this.confirmTransactionUsingDurableNonceStrategy({commitment:r||this.commitment,strategy:t})}getCancellationPromise(t){return new Promise((r,n)=>{t!=null&&(t.aborted?n(t.reason):t.addEventListener("abort",()=>{n(t.reason)}))})}getTransactionConfirmationPromise({commitment:t,signature:r}){let n,i,s=!1;const o=new Promise((c,u)=>{try{n=this.onSignature(r,(y,A)=>{n=void 0;const v={context:A,value:y};c({__type:fs.PROCESSED,response:v})},t);const l=new Promise(y=>{n==null?y():i=this._onSubscriptionStateChange(n,A=>{A==="subscribed"&&y()})});(async()=>{if(await l,s)return;const y=await this.getSignatureStatus(r);if(s||y==null)return;const{context:A,value:v}=y;if(v!=null)if(v?.err)u(v.err);else{switch(t){case"confirmed":case"single":case"singleGossip":{if(v.confirmationStatus==="processed")return;break}case"finalized":case"max":case"root":{if(v.confirmationStatus==="processed"||v.confirmationStatus==="confirmed")return;break}case"processed":case"recent":}s=!0,c({__type:fs.PROCESSED,response:{context:A,value:v}})}})()}catch(l){u(l)}});return{abortConfirmation:()=>{i&&(i(),i=void 0),n!=null&&(this.removeSignatureListener(n),n=void 0)},confirmationPromise:o}}async confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:t,strategy:{abortSignal:r,lastValidBlockHeight:n,signature:i}}){let s=!1;const o=new Promise(y=>{const A=async()=>{try{return await this.getBlockHeight(t)}catch{return-1}};(async()=>{let v=await A();if(!s){for(;v<=n;)if(await Ho(1e3),s||(v=await A(),s))return;y({__type:fs.BLOCKHEIGHT_EXCEEDED})}})()}),{abortConfirmation:a,confirmationPromise:c}=this.getTransactionConfirmationPromise({commitment:t,signature:i}),u=this.getCancellationPromise(r);let l;try{const y=await Promise.race([u,c,o]);if(y.__type===fs.PROCESSED)l=y.response;else throw new v1(i)}finally{s=!0,a()}return l}async confirmTransactionUsingDurableNonceStrategy({commitment:t,strategy:{abortSignal:r,minContextSlot:n,nonceAccountPubkey:i,nonceValue:s,signature:o}}){let a=!1;const c=new Promise(v=>{let R=s,M=null;const P=async()=>{try{const{context:H,value:F}=await this.getNonceAndContext(i,{commitment:t,minContextSlot:n});return M=H.slot,F?.nonce}catch{return R}};(async()=>{if(R=await P(),!a)for(;;){if(s!==R){v({__type:fs.NONCE_INVALID,slotInWhichNonceDidAdvance:M});return}if(await Ho(2e3),a||(R=await P(),a))return}})()}),{abortConfirmation:u,confirmationPromise:l}=this.getTransactionConfirmationPromise({commitment:t,signature:o}),y=this.getCancellationPromise(r);let A;try{const v=await Promise.race([y,l,c]);if(v.__type===fs.PROCESSED)A=v.response;else{let R;for(;;){const M=await this.getSignatureStatus(o);if(M==null)break;if(M.context.slot<(v.slotInWhichNonceDidAdvance??n)){await Ho(400);continue}R=M;break}if(R?.value){const M=t||"finalized",{confirmationStatus:P}=R.value;switch(M){case"processed":case"recent":if(P!=="processed"&&P!=="confirmed"&&P!=="finalized")throw new za(o);break;case"confirmed":case"single":case"singleGossip":if(P!=="confirmed"&&P!=="finalized")throw new za(o);break;case"finalized":case"max":case"root":if(P!=="finalized")throw new za(o);break;default:(H=>{})(M)}A={context:R.context,value:{err:R.value.err}}}else throw new za(o)}}finally{a=!0,u()}return A}async confirmTransactionUsingLegacyTimeoutStrategy({commitment:t,signature:r}){let n;const i=new Promise(c=>{let u=this._confirmTransactionInitialTimeout||6e4;switch(t){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":{u=this._confirmTransactionInitialTimeout||3e4;break}}n=setTimeout(()=>c({__type:fs.TIMED_OUT,timeoutMs:u}),u)}),{abortConfirmation:s,confirmationPromise:o}=this.getTransactionConfirmationPromise({commitment:t,signature:r});let a;try{const c=await Promise.race([o,i]);if(c.__type===fs.PROCESSED)a=c.response;else throw new _1(r,c.timeoutMs/1e3)}finally{clearTimeout(n),s()}return a}async getClusterNodes(){const t=await this._rpcRequest("getClusterNodes",[]),r=Be(t,bt(Ce(o6)));if("error"in r)throw new je(r.error,"failed to get cluster nodes");return r.result}async getVoteAccounts(t){const r=this._buildArgs([],t),n=await this._rpcRequest("getVoteAccounts",r),i=Be(n,a6);if("error"in i)throw new je(i.error,"failed to get vote accounts");return i.result}async getSlot(t){const{commitment:r,config:n}=or(t),i=this._buildArgs([],r,void 0,n),s=await this._rpcRequest("getSlot",i),o=Be(s,bt(te()));if("error"in o)throw new je(o.error,"failed to get slot");return o.result}async getSlotLeader(t){const{commitment:r,config:n}=or(t),i=this._buildArgs([],r,void 0,n),s=await this._rpcRequest("getSlotLeader",i),o=Be(s,bt(Se()));if("error"in o)throw new je(o.error,"failed to get slot leader");return o.result}async getSlotLeaders(t,r){const n=[t,r],i=await this._rpcRequest("getSlotLeaders",n),s=Be(i,bt(Ce(kr)));if("error"in s)throw new je(s.error,"failed to get slot leaders");return s.result}async getSignatureStatus(t,r){const{context:n,value:i}=await this.getSignatureStatuses([t],r);sr(i.length===1);const s=i[0];return{context:n,value:s}}async getSignatureStatuses(t,r){const n=[t];r&&n.push(r);const i=await this._rpcRequest("getSignatureStatuses",n),s=Be(i,u6);if("error"in s)throw new je(s.error,"failed to get signature status");return s.result}async getTransactionCount(t){const{commitment:r,config:n}=or(t),i=this._buildArgs([],r,void 0,n),s=await this._rpcRequest("getTransactionCount",i),o=Be(s,bt(te()));if("error"in o)throw new je(o.error,"failed to get transaction count");return o.result}async getTotalSupply(t){return(await this.getSupply({commitment:t,excludeNonCirculatingAccountsList:!0})).value.total}async getInflationGovernor(t){const r=this._buildArgs([],t),n=await this._rpcRequest("getInflationGovernor",r),i=Be(n,$A);if("error"in i)throw new je(i.error,"failed to get inflation");return i.result}async getInflationReward(t,r,n){const{commitment:i,config:s}=or(n),o=this._buildArgs([t.map(u=>u.toBase58())],i,void 0,{...s,epoch:r??s?.epoch}),a=await this._rpcRequest("getInflationReward",o),c=Be(a,vA);if("error"in c)throw new je(c.error,"failed to get inflation reward");return c.result}async getInflationRate(){const t=await this._rpcRequest("getInflationRate",[]),r=Be(t,MA);if("error"in r)throw new je(r.error,"failed to get inflation rate");return r.result}async getEpochInfo(t){const{commitment:r,config:n}=or(t),i=this._buildArgs([],r,void 0,n),s=await this._rpcRequest("getEpochInfo",i),o=Be(s,NA);if("error"in o)throw new je(o.error,"failed to get epoch info");return o.result}async getEpochSchedule(){const t=await this._rpcRequest("getEpochSchedule",[]),r=Be(t,PA);if("error"in r)throw new je(r.error,"failed to get epoch schedule");const n=r.result;return new fA(n.slotsPerEpoch,n.leaderScheduleSlotOffset,n.warmup,n.firstNormalEpoch,n.firstNormalSlot)}async getLeaderSchedule(){const t=await this._rpcRequest("getLeaderSchedule",[]),r=Be(t,UA);if("error"in r)throw new je(r.error,"failed to get leader schedule");return r.result}async getMinimumBalanceForRentExemption(t,r){const n=this._buildArgs([t],r),i=await this._rpcRequest("getMinimumBalanceForRentExemption",n),s=Be(i,l6);return"error"in s?(console.warn("Unable to fetch minimum balance for rent exemption"),0):s.result}async getRecentBlockhashAndContext(t){const r=this._buildArgs([],t),n=await this._rpcRequest("getRecentBlockhash",r),i=Be(n,_6);if("error"in i)throw new je(i.error,"failed to get recent blockhash");return i.result}async getRecentPerformanceSamples(t){const r=await this._rpcRequest("getRecentPerformanceSamples",t?[t]:[]),n=Be(r,A6);if("error"in n)throw new je(n.error,"failed to get recent performance samples");return n.result}async getFeeCalculatorForBlockhash(t,r){const n=this._buildArgs([t],r),i=await this._rpcRequest("getFeeCalculatorForBlockhash",n),s=Be(i,B6);if("error"in s)throw new je(s.error,"failed to get fee calculator");const{context:o,value:a}=s.result;return{context:o,value:a!==null?a.feeCalculator:null}}async getFeeForMessage(t,r){const n=Uo(t.serialize()).toString("base64"),i=this._buildArgs([n],r),s=await this._rpcRequest("getFeeForMessage",i),o=Be(s,mr(Te(te())));if("error"in o)throw new je(o.error,"failed to get fee for message");if(o.result===null)throw new Error("invalid blockhash");return o.result}async getRecentPrioritizationFees(t){const r=t?.lockedWritableAccounts?.map(o=>o.toBase58()),n=r?.length?[r]:[],i=await this._rpcRequest("getRecentPrioritizationFees",n),s=Be(i,OA);if("error"in s)throw new je(s.error,"failed to get recent prioritization fees");return s.result}async getRecentBlockhash(t){try{return(await this.getRecentBlockhashAndContext(t)).value}catch(r){throw new Error("failed to get recent blockhash: "+r)}}async getLatestBlockhash(t){try{return(await this.getLatestBlockhashAndContext(t)).value}catch(r){throw new Error("failed to get recent blockhash: "+r)}}async getLatestBlockhashAndContext(t){const{commitment:r,config:n}=or(t),i=this._buildArgs([],r,void 0,n),s=await this._rpcRequest("getLatestBlockhash",i),o=Be(s,E6);if("error"in o)throw new je(o.error,"failed to get latest blockhash");return o.result}async isBlockhashValid(t,r){const{commitment:n,config:i}=or(r),s=this._buildArgs([t],n,void 0,i),o=await this._rpcRequest("isBlockhashValid",s),a=Be(o,x6);if("error"in a)throw new je(a.error,"failed to determine if the blockhash `"+t+"`is valid");return a.result}async getVersion(){const t=await this._rpcRequest("getVersion",[]),r=Be(t,bt(RA));if("error"in r)throw new je(r.error,"failed to get version");return r.result}async getGenesisHash(){const t=await this._rpcRequest("getGenesisHash",[]),r=Be(t,bt(Se()));if("error"in r)throw new je(r.error,"failed to get genesis hash");return r.result}async getBlock(t,r){const{commitment:n,config:i}=or(r),s=this._buildArgsAtLeastConfirmed([t],n,void 0,i),o=await this._rpcRequest("getBlock",s);try{switch(i?.transactionDetails){case"accounts":{const a=Be(o,y6);if("error"in a)throw a.error;return a.result}case"none":{const a=Be(o,g6);if("error"in a)throw a.error;return a.result}default:{const a=Be(o,p6);if("error"in a)throw a.error;const{result:c}=a;return c?{...c,transactions:c.transactions.map(({transaction:u,meta:l,version:y})=>({meta:l,transaction:{...u,message:xh(y,u.message)},version:y}))}:null}}}catch(a){throw new je(a,"failed to get confirmed block")}}async getParsedBlock(t,r){const{commitment:n,config:i}=or(r),s=this._buildArgsAtLeastConfirmed([t],n,"jsonParsed",i),o=await this._rpcRequest("getBlock",s);try{switch(i?.transactionDetails){case"accounts":{const a=Be(o,m6);if("error"in a)throw a.error;return a.result}case"none":{const a=Be(o,b6);if("error"in a)throw a.error;return a.result}default:{const a=Be(o,w6);if("error"in a)throw a.error;return a.result}}}catch(a){throw new je(a,"failed to get block")}}async getBlockProduction(t){let r,n;if(typeof t=="string")n=t;else if(t){const{commitment:a,...c}=t;n=a,r=c}const i=this._buildArgs([],n,"base64",r),s=await this._rpcRequest("getBlockProduction",i),o=Be(s,TA);if("error"in o)throw new je(o.error,"failed to get block production information");return o.result}async getTransaction(t,r){const{commitment:n,config:i}=or(r),s=this._buildArgsAtLeastConfirmed([t],n,void 0,i),o=await this._rpcRequest("getTransaction",s),a=Be(o,Th);if("error"in a)throw new je(a.error,"failed to get transaction");const c=a.result;return c&&{...c,transaction:{...c.transaction,message:xh(c.version,c.transaction.message)}}}async getParsedTransaction(t,r){const{commitment:n,config:i}=or(r),s=this._buildArgsAtLeastConfirmed([t],n,"jsonParsed",i),o=await this._rpcRequest("getTransaction",s),a=Be(o,Nf);if("error"in a)throw new je(a.error,"failed to get transaction");return a.result}async getParsedTransactions(t,r){const{commitment:n,config:i}=or(r),s=t.map(c=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([c],n,"jsonParsed",i)}));return(await this._rpcBatchRequest(s)).map(c=>{const u=Be(c,Nf);if("error"in u)throw new je(u.error,"failed to get transactions");return u.result})}async getTransactions(t,r){const{commitment:n,config:i}=or(r),s=t.map(c=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([c],n,void 0,i)}));return(await this._rpcBatchRequest(s)).map(c=>{const u=Be(c,Th);if("error"in u)throw new je(u.error,"failed to get transactions");const l=u.result;return l&&{...l,transaction:{...l.transaction,message:xh(l.version,l.transaction.message)}}})}async getConfirmedBlock(t,r){const n=this._buildArgsAtLeastConfirmed([t],r),i=await this._rpcRequest("getConfirmedBlock",n),s=Be(i,v6);if("error"in s)throw new je(s.error,"failed to get confirmed block");const o=s.result;if(!o)throw new Error("Confirmed block "+t+" not found");const a={...o,transactions:o.transactions.map(({transaction:c,meta:u})=>{const l=new Pi(c.message);return{meta:u,transaction:{...c,message:l}}})};return{...a,transactions:a.transactions.map(({transaction:c,meta:u})=>({meta:u,transaction:us.populate(c.message,c.signatures)}))}}async getBlocks(t,r,n){const i=this._buildArgsAtLeastConfirmed(r!==void 0?[t,r]:[t],n),s=await this._rpcRequest("getBlocks",i),o=Be(s,bt(Ce(te())));if("error"in o)throw new je(o.error,"failed to get blocks");return o.result}async getBlockSignatures(t,r){const n=this._buildArgsAtLeastConfirmed([t],r,void 0,{transactionDetails:"signatures",rewards:!1}),i=await this._rpcRequest("getBlock",n),s=Be(i,j1);if("error"in s)throw new je(s.error,"failed to get block");const o=s.result;if(!o)throw new Error("Block "+t+" not found");return o}async getConfirmedBlockSignatures(t,r){const n=this._buildArgsAtLeastConfirmed([t],r,void 0,{transactionDetails:"signatures",rewards:!1}),i=await this._rpcRequest("getConfirmedBlock",n),s=Be(i,j1);if("error"in s)throw new je(s.error,"failed to get confirmed block");const o=s.result;if(!o)throw new Error("Confirmed block "+t+" not found");return o}async getConfirmedTransaction(t,r){const n=this._buildArgsAtLeastConfirmed([t],r),i=await this._rpcRequest("getConfirmedTransaction",n),s=Be(i,Th);if("error"in s)throw new je(s.error,"failed to get transaction");const o=s.result;if(!o)return o;const a=new Pi(o.transaction.message),c=o.transaction.signatures;return{...o,transaction:us.populate(a,c)}}async getParsedConfirmedTransaction(t,r){const n=this._buildArgsAtLeastConfirmed([t],r,"jsonParsed"),i=await this._rpcRequest("getConfirmedTransaction",n),s=Be(i,Nf);if("error"in s)throw new je(s.error,"failed to get confirmed transaction");return s.result}async getParsedConfirmedTransactions(t,r){const n=t.map(o=>({methodName:"getConfirmedTransaction",args:this._buildArgsAtLeastConfirmed([o],r,"jsonParsed")}));return(await this._rpcBatchRequest(n)).map(o=>{const a=Be(o,Nf);if("error"in a)throw new je(a.error,"failed to get confirmed transactions");return a.result})}async getConfirmedSignaturesForAddress(t,r,n){let i={},s=await this.getFirstAvailableBlock();for(;!("until"in i)&&(r--,!(r<=0||r0&&(i.until=c.signatures[c.signatures.length-1].toString())}catch(c){if(c instanceof Error&&c.message.includes("skipped"))continue;throw c}let o=await this.getSlot("finalized");for(;!("before"in i)&&(n++,!(n>o));)try{const c=await this.getConfirmedBlockSignatures(n);c.signatures.length>0&&(i.before=c.signatures[c.signatures.length-1].toString())}catch(c){if(c instanceof Error&&c.message.includes("skipped"))continue;throw c}return(await this.getConfirmedSignaturesForAddress2(t,i)).map(c=>c.signature)}async getConfirmedSignaturesForAddress2(t,r,n){const i=this._buildArgsAtLeastConfirmed([t.toBase58()],n,void 0,r),s=await this._rpcRequest("getConfirmedSignaturesForAddress2",i),o=Be(s,GA);if("error"in o)throw new je(o.error,"failed to get confirmed signatures for address");return o.result}async getSignaturesForAddress(t,r,n){const i=this._buildArgsAtLeastConfirmed([t.toBase58()],n,void 0,r),s=await this._rpcRequest("getSignaturesForAddress",i),o=Be(s,YA);if("error"in o)throw new je(o.error,"failed to get signatures for address");return o.result}async getAddressLookupTable(t,r){const{context:n,value:i}=await this.getAccountInfoAndContext(t,r);let s=null;return i!==null&&(s=new T1({key:t,state:T1.deserialize(i.data)})),{context:n,value:s}}async getNonceAndContext(t,r){const{context:n,value:i}=await this.getAccountInfoAndContext(t,r);let s=null;return i!==null&&(s=vh.fromAccountData(i.data)),{context:n,value:s}}async getNonce(t,r){return await this.getNonceAndContext(t,r).then(n=>n.value).catch(n=>{throw new Error("failed to get nonce for account "+t.toBase58()+": "+n)})}async requestAirdrop(t,r){const n=await this._rpcRequest("requestAirdrop",[t.toBase58(),r]),i=Be(n,I6);if("error"in i)throw new je(i.error,`airdrop to ${t.toBase58()} failed`);return i.result}async _blockhashWithExpiryBlockHeight(t){if(!t){for(;this._pollingBlockhash;)await Ho(100);const n=Date.now()-this._blockhashInfo.lastFetch>=yA;if(this._blockhashInfo.latestBlockhash!==null&&!n)return this._blockhashInfo.latestBlockhash}return await this._pollNewBlockhash()}async _pollNewBlockhash(){this._pollingBlockhash=!0;try{const t=Date.now(),r=this._blockhashInfo.latestBlockhash,n=r?r.blockhash:null;for(let i=0;i<50;i++){const s=await this.getLatestBlockhash("finalized");if(n!==s.blockhash)return this._blockhashInfo={latestBlockhash:s,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},s;await Ho(tA/2)}throw new Error(`Unable to obtain a new blockhash after ${Date.now()-t}ms`)}finally{this._pollingBlockhash=!1}}async getStakeMinimumDelegation(t){const{commitment:r,config:n}=or(t),i=this._buildArgs([],r,"base64",n),s=await this._rpcRequest("getStakeMinimumDelegation",i),o=Be(s,mr(te()));if("error"in o)throw new je(o.error,"failed to get stake minimum delegation");return o.result}async simulateTransaction(t,r,n){if("message"in t){const M=t.serialize(),P=ie.Buffer.from(M).toString("base64");if(Array.isArray(r)||n!==void 0)throw new Error("Invalid arguments");const H=r||{};H.encoding="base64","commitment"in H||(H.commitment=this.commitment);const F=[P,H],N=await this._rpcRequest("simulateTransaction",F),$=Be(N,L1);if("error"in $)throw new Error("failed to simulate transaction: "+$.error.message);return $.result}let i;if(t instanceof us){let R=t;i=new us,i.feePayer=R.feePayer,i.instructions=t.instructions,i.nonceInfo=R.nonceInfo,i.signatures=R.signatures}else i=us.populate(t),i._message=i._json=void 0;if(r!==void 0&&!Array.isArray(r))throw new Error("Invalid arguments");const s=r;if(i.nonceInfo&&s)i.sign(...s);else{let R=this._disableBlockhashCaching;for(;;){const M=await this._blockhashWithExpiryBlockHeight(R);if(i.lastValidBlockHeight=M.lastValidBlockHeight,i.recentBlockhash=M.blockhash,!s)break;if(i.sign(...s),!i.signature)throw new Error("!signature");const P=i.signature.toString("base64");if(!this._blockhashInfo.simulatedSignatures.includes(P)&&!this._blockhashInfo.transactionSignatures.includes(P)){this._blockhashInfo.simulatedSignatures.push(P);break}else R=!0}}const o=i._compile(),a=o.serialize(),u=i._serialize(a).toString("base64"),l={encoding:"base64",commitment:this.commitment};if(n){const R=(Array.isArray(n)?n:o.nonProgramIds()).map(M=>M.toBase58());l.accounts={encoding:"base64",addresses:R}}s&&(l.sigVerify=!0);const y=[u,l],A=await this._rpcRequest("simulateTransaction",y),v=Be(A,L1);if("error"in v){let R;if("data"in v.error&&(R=v.error.data.logs,R&&Array.isArray(R))){const M=` + `,P=M+R.join(M);console.error(v.error.message,P)}throw new I1("failed to simulate transaction: "+v.error.message,R)}return v.result}async sendTransaction(t,r,n){if("version"in t){if(r&&Array.isArray(r))throw new Error("Invalid arguments");const o=t.serialize();return await this.sendRawTransaction(o,r)}if(r===void 0||!Array.isArray(r))throw new Error("Invalid arguments");const i=r;if(t.nonceInfo)t.sign(...i);else{let o=this._disableBlockhashCaching;for(;;){const a=await this._blockhashWithExpiryBlockHeight(o);if(t.lastValidBlockHeight=a.lastValidBlockHeight,t.recentBlockhash=a.blockhash,t.sign(...i),!t.signature)throw new Error("!signature");const c=t.signature.toString("base64");if(this._blockhashInfo.transactionSignatures.includes(c))o=!0;else{this._blockhashInfo.transactionSignatures.push(c);break}}}const s=t.serialize();return await this.sendRawTransaction(s,n)}async sendRawTransaction(t,r){const n=Uo(t).toString("base64");return await this.sendEncodedTransaction(n,r)}async sendEncodedTransaction(t,r){const n={encoding:"base64"},i=r&&r.skipPreflight,s=i===!0?"processed":r&&r.preflightCommitment||this.commitment;r&&r.maxRetries!=null&&(n.maxRetries=r.maxRetries),r&&r.minContextSlot!=null&&(n.minContextSlot=r.minContextSlot),i&&(n.skipPreflight=i),s&&(n.preflightCommitment=s);const o=[t,n],a=await this._rpcRequest("sendTransaction",o),c=Be(a,R6);if("error"in c){let u;throw"data"in c.error&&(u=c.error.data.logs),new I1("failed to send transaction: "+c.error.message,u)}return c.result}_wsOnOpen(){this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval(()=>{(async()=>{try{await this._rpcWebSocket.notify("ping")}catch{}})()},5e3),this._updateSubscriptions()}_wsOnError(t){this._rpcWebSocketConnected=!1,console.error("ws error:",t.message)}_wsOnClose(t){if(this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),t===1e3){this._updateSubscriptions();return}this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach(([r,n])=>{this._setSubscription(r,{...n,state:"pending"})})}_setSubscription(t,r){const n=this._subscriptionsByHash[t]?.state;if(this._subscriptionsByHash[t]=r,n!==r.state){const i=this._subscriptionStateChangeCallbacksByHash[t];i&&i.forEach(s=>{try{s(r.state)}catch{}})}}_onSubscriptionStateChange(t,r){const n=this._subscriptionHashByClientSubscriptionId[t];if(n==null)return()=>{};const i=this._subscriptionStateChangeCallbacksByHash[n]||=new Set;return i.add(r),()=>{i.delete(r),i.size===0&&delete this._subscriptionStateChangeCallbacksByHash[n]}}async _updateSubscriptions(){if(Object.keys(this._subscriptionsByHash).length===0){this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout(()=>{this._rpcWebSocketIdleTimeout=null;try{this._rpcWebSocket.close()}catch(n){n instanceof Error&&console.log(`Error when closing socket connection: ${n.message}`)}},500));return}if(this._rpcWebSocketIdleTimeout!==null&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),!this._rpcWebSocketConnected){this._rpcWebSocket.connect();return}const t=this._rpcWebSocketGeneration,r=()=>t===this._rpcWebSocketGeneration;await Promise.all(Object.keys(this._subscriptionsByHash).map(async n=>{const i=this._subscriptionsByHash[n];if(i!==void 0)switch(i.state){case"pending":case"unsubscribed":if(i.callbacks.size===0){delete this._subscriptionsByHash[n],i.state==="unsubscribed"&&delete this._subscriptionCallbacksByServerSubscriptionId[i.serverSubscriptionId],await this._updateSubscriptions();return}await(async()=>{const{args:s,method:o}=i;try{this._setSubscription(n,{...i,state:"subscribing"});const a=await this._rpcWebSocket.call(o,s);this._setSubscription(n,{...i,serverSubscriptionId:a,state:"subscribed"}),this._subscriptionCallbacksByServerSubscriptionId[a]=i.callbacks,await this._updateSubscriptions()}catch(a){if(a instanceof Error&&console.error(`${o} error for argument`,s,a.message),!r())return;this._setSubscription(n,{...i,state:"pending"}),await this._updateSubscriptions()}})();break;case"subscribed":i.callbacks.size===0&&await(async()=>{const{serverSubscriptionId:s,unsubscribeMethod:o}=i;if(this._subscriptionsAutoDisposedByRpc.has(s))this._subscriptionsAutoDisposedByRpc.delete(s);else{this._setSubscription(n,{...i,state:"unsubscribing"}),this._setSubscription(n,{...i,state:"unsubscribing"});try{await this._rpcWebSocket.call(o,[s])}catch(a){if(a instanceof Error&&console.error(`${o} error:`,a.message),!r())return;this._setSubscription(n,{...i,state:"subscribed"}),await this._updateSubscriptions();return}}this._setSubscription(n,{...i,state:"unsubscribed"}),await this._updateSubscriptions()})();break}}))}_handleServerNotification(t,r){const n=this._subscriptionCallbacksByServerSubscriptionId[t];n!==void 0&&n.forEach(i=>{try{i(...r)}catch(s){console.error(s)}})}_wsOnAccountNotification(t){const{result:r,subscription:n}=Be(t,XA);this._handleServerNotification(n,[r.value,r.context])}_makeSubscription(t,r){const n=this._nextClientSubscriptionId++,i=B1([t.method,r]),s=this._subscriptionsByHash[i];return s===void 0?this._subscriptionsByHash[i]={...t,args:r,callbacks:new Set([t.callback]),state:"pending"}:s.callbacks.add(t.callback),this._subscriptionHashByClientSubscriptionId[n]=i,this._subscriptionDisposeFunctionsByClientSubscriptionId[n]=async()=>{delete this._subscriptionDisposeFunctionsByClientSubscriptionId[n],delete this._subscriptionHashByClientSubscriptionId[n];const o=this._subscriptionsByHash[i];sr(o!==void 0,`Could not find a \`Subscription\` when tearing down client subscription #${n}`),o.callbacks.delete(t.callback),await this._updateSubscriptions()},this._updateSubscriptions(),n}onAccountChange(t,r,n){const i=this._buildArgs([t.toBase58()],n||this._commitment||"finalized","base64");return this._makeSubscription({callback:r,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},i)}async removeAccountChangeListener(t){await this._unsubscribeClientSubscription(t,"account change")}_wsOnProgramAccountNotification(t){const{result:r,subscription:n}=Be(t,QA);this._handleServerNotification(n,[{accountId:r.value.pubkey,accountInfo:r.value.account},r.context])}onProgramAccountChange(t,r,n,i){const s=this._buildArgs([t.toBase58()],n||this._commitment||"finalized","base64",i?{filters:i}:void 0);return this._makeSubscription({callback:r,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},s)}async removeProgramAccountChangeListener(t){await this._unsubscribeClientSubscription(t,"program account change")}onLogs(t,r,n){const i=this._buildArgs([typeof t=="object"?{mentions:[t.toString()]}:t],n||this._commitment||"finalized");return this._makeSubscription({callback:r,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},i)}async removeOnLogsListener(t){await this._unsubscribeClientSubscription(t,"logs")}_wsOnLogsNotification(t){const{result:r,subscription:n}=Be(t,k6);this._handleServerNotification(n,[r.value,r.context])}_wsOnSlotNotification(t){const{result:r,subscription:n}=Be(t,t6);this._handleServerNotification(n,[r])}onSlotChange(t){return this._makeSubscription({callback:t,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}async removeSlotChangeListener(t){await this._unsubscribeClientSubscription(t,"slot change")}_wsOnSlotUpdatesNotification(t){const{result:r,subscription:n}=Be(t,n6);this._handleServerNotification(n,[r])}onSlotUpdate(t){return this._makeSubscription({callback:t,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}async removeSlotUpdateListener(t){await this._unsubscribeClientSubscription(t,"slot update")}async _unsubscribeClientSubscription(t,r){const n=this._subscriptionDisposeFunctionsByClientSubscriptionId[t];n?await n():console.warn(`Ignored unsubscribe request because an active subscription with id \`${t}\` for '${r}' events could not be found.`)}_buildArgs(t,r,n,i){const s=r||this._commitment;if(s||n||i){let o={};n&&(o.encoding=n),s&&(o.commitment=s),i&&(o=Object.assign(o,i)),t.push(o)}return t}_buildArgsAtLeastConfirmed(t,r,n,i){const s=r||this._commitment;if(s&&!["confirmed","finalized"].includes(s))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(t,r,n,i)}_wsOnSignatureNotification(t){const{result:r,subscription:n}=Be(t,i6);r.value!=="receivedSignature"&&this._subscriptionsAutoDisposedByRpc.add(n),this._handleServerNotification(n,r.value==="receivedSignature"?[{type:"received"},r.context]:[{type:"status",result:r.value},r.context])}onSignature(t,r,n){const i=this._buildArgs([t],n||this._commitment||"finalized"),s=this._makeSubscription({callback:(o,a)=>{if(o.type==="status"){r(o.result,a);try{this.removeSignatureListener(s)}catch{}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},i);return s}onSignatureWithOptions(t,r,n){const{commitment:i,...s}={...n,commitment:n&&n.commitment||this._commitment||"finalized"},o=this._buildArgs([t],i,void 0,s),a=this._makeSubscription({callback:(c,u)=>{r(c,u);try{this.removeSignatureListener(a)}catch{}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},o);return a}async removeSignatureListener(t){await this._unsubscribeClientSubscription(t,"signature result")}_wsOnRootNotification(t){const{result:r,subscription:n}=Be(t,s6);this._handleServerNotification(n,[r])}onRootChange(t){return this._makeSubscription({callback:t,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(t){await this._unsubscribeClientSubscription(t,"root change")}}Object.freeze({CreateLookupTable:{index:0,layout:Fe([qe("instruction"),jo("recentSlot"),Ut("bumpSeed")])},FreezeLookupTable:{index:1,layout:Fe([qe("instruction")])},ExtendLookupTable:{index:2,layout:Fe([qe("instruction"),jo(),en(St(),Gs(qe(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:Fe([qe("instruction")])},CloseLookupTable:{index:4,layout:Fe([qe("instruction")])}}),new et("AddressLookupTab1e1111111111111111111111111"),Object.freeze({RequestUnits:{index:0,layout:Fe([Ut("instruction"),qe("units"),qe("additionalFee")])},RequestHeapFrame:{index:1,layout:Fe([Ut("instruction"),qe("bytes")])},SetComputeUnitLimit:{index:2,layout:Fe([Ut("instruction"),qe("units")])},SetComputeUnitPrice:{index:3,layout:Fe([Ut("instruction"),jo("microLamports")])}}),new et("ComputeBudget111111111111111111111111111111"),Fe([Ut("numSignatures"),Ut("padding"),Dn("signatureOffset"),Dn("signatureInstructionIndex"),Dn("publicKeyOffset"),Dn("publicKeyInstructionIndex"),Dn("messageDataOffset"),Dn("messageDataSize"),Dn("messageInstructionIndex")]),new et("Ed25519SigVerify111111111111111111111111111"),mh.utils.isValidPrivateKey,mh.getPublicKey,Fe([Ut("numSignatures"),Dn("signatureOffset"),Ut("signatureInstructionIndex"),Dn("ethAddressOffset"),Ut("ethAddressInstructionIndex"),Dn("messageDataOffset"),Dn("messageDataSize"),Ut("messageInstructionIndex"),nr(20,"ethAddress"),nr(64,"signature"),Ut("recoveryId")]),new et("KeccakSecp256k11111111111111111111111111111");var z1;new et("StakeConfig11111111111111111111111111111111");class q1{constructor(t,r,n){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=t,this.epoch=r,this.custodian=n}}z1=q1,q1.default=new z1(0,0,et.default),Object.freeze({Initialize:{index:0,layout:Fe([qe("instruction"),Y3(),X3()])},Authorize:{index:1,layout:Fe([qe("instruction"),St("newAuthorized"),qe("stakeAuthorizationType")])},Delegate:{index:2,layout:Fe([qe("instruction")])},Split:{index:3,layout:Fe([qe("instruction"),In("lamports")])},Withdraw:{index:4,layout:Fe([qe("instruction"),In("lamports")])},Deactivate:{index:5,layout:Fe([qe("instruction")])},Merge:{index:7,layout:Fe([qe("instruction")])},AuthorizeWithSeed:{index:8,layout:Fe([qe("instruction"),St("newAuthorized"),qe("stakeAuthorizationType"),Do("authoritySeed"),St("authorityOwner")])}}),Object.freeze({Staker:{index:0},Withdrawer:{index:1}}),new et("Stake11111111111111111111111111111111111111"),Object.freeze({InitializeAccount:{index:0,layout:Fe([qe("instruction"),J3()])},Authorize:{index:1,layout:Fe([qe("instruction"),St("newAuthorized"),qe("voteAuthorizationType")])},Withdraw:{index:3,layout:Fe([qe("instruction"),In("lamports")])},UpdateValidatorIdentity:{index:4,layout:Fe([qe("instruction")])},AuthorizeWithSeed:{index:10,layout:Fe([qe("instruction"),Q3()])}}),Object.freeze({Voter:{index:0},Withdrawer:{index:1}}),new et("Vote111111111111111111111111111111111111111"),new et("Va1idator1nfo111111111111111111111111111111"),me({name:Se(),website:Qe(Se()),details:Qe(Se()),keybaseUsername:Qe(Se())}),new et("Vote111111111111111111111111111111111111111"),Fe([St("nodePubkey"),St("authorizedWithdrawer"),Ut("commission"),Gr(),en(Fe([Gr("slot"),qe("confirmationCount")]),Gs(qe(),-8),"votes"),Ut("rootSlotValid"),Gr("rootSlot"),Gr(),en(Fe([Gr("epoch"),St("authorizedVoter")]),Gs(qe(),-8),"authorizedVoters"),Fe([en(Fe([St("authorizedPubkey"),Gr("epochOfLastAuthorizedSwitch"),Gr("targetEpoch")]),32,"buf"),Gr("idx"),Ut("isEmpty")],"priorVoters"),Gr(),en(Fe([Gr("epoch"),Gr("credits"),Gr("prevCredits")]),Gs(qe(),-8),"epochCredits"),Fe([Gr("slot"),Gr("timestamp")],"lastTimestamp")]);const V1="solana:signAndSendTransaction",$6="solana:signIn",W1="solana:signMessage",K1="solana:signTransaction",M6="standard:connect",O6="standard:disconnect",N6="standard:events";var Z1=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},P6=(e,t,r)=>(Z1(e,t,"read from private field"),r?r.call(e):t.get(e)),U6=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},F6=(e,t,r,n)=>(Z1(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Pf;function D6(e){const t=({register:r})=>r(e);try{window.dispatchEvent(new H6(t))}catch(r){console.error(`wallet-standard:register-wallet event could not be dispatched +`,r)}try{window.addEventListener("wallet-standard:app-ready",({detail:r})=>t(r))}catch(r){console.error(`wallet-standard:app-ready event listener could not be added +`,r)}}class H6 extends Event{constructor(t){super("wallet-standard:register-wallet",{bubbles:!1,cancelable:!1,composed:!1}),U6(this,Pf,void 0),F6(this,Pf,t)}get detail(){return P6(this,Pf)}get type(){return"wallet-standard:register-wallet"}preventDefault(){throw new Error("preventDefault cannot be called")}stopImmediatePropagation(){throw new Error("stopImmediatePropagation cannot be called")}stopPropagation(){throw new Error("stopPropagation cannot be called")}}Pf=new WeakMap;function j6(e){D6(e.getInstanceWithAdapter())}const z6="solana:mainnet",kh=[z6];function Ch(e){return kh.includes(e)}function Uf(e){return"version"in e}var G1=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},qo=(e,t,r)=>(G1(e,t,"read from private field"),r?r.call(e):t.get(e)),Vo=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Wo=(e,t,r,n)=>(G1(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Ff,Df,Hf,jf,zf,qf;const q6=kh,V6=[V1,K1,W1],Y1=class{constructor({address:e,publicKey:t,label:r,icon:n}){Vo(this,Ff,void 0),Vo(this,Df,void 0),Vo(this,Hf,void 0),Vo(this,jf,void 0),Vo(this,zf,void 0),Vo(this,qf,void 0),new.target===Y1&&Object.freeze(this),Wo(this,Ff,e),Wo(this,Df,t),Wo(this,Hf,q6),Wo(this,jf,V6),Wo(this,zf,r),Wo(this,qf,n)}get address(){return qo(this,Ff)}get publicKey(){return qo(this,Df).slice()}get chains(){return qo(this,Hf).slice()}get features(){return qo(this,jf).slice()}get label(){return qo(this,zf)}get icon(){return qo(this,qf)}};let W6=Y1;Ff=new WeakMap,Df=new WeakMap,Hf=new WeakMap,jf=new WeakMap,zf=new WeakMap,qf=new WeakMap;const K6="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTgiIGhlaWdodD0iNjUiIHZpZXdCb3g9IjAgMCA1OCA2NSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTAgOS4zODk0OUwyOC44OTA3IDBWNjUuMDA0MkM4LjI1NDUgNTYuMzM2OSAwIDM5LjcyNDggMCAzMC4zMzUzVjkuMzg5NDlaIiBmaWxsPSIjMDUwMEZGIi8+CjxwYXRoIGQ9Ik01Ny43ODIyIDkuMzg5NDlMMjguODkxNSAwVjY1LjAwNDJDNDkuNTI3NyA1Ni4zMzY5IDU3Ljc4MjIgMzkuNzI0OCA1Ny43ODIyIDMwLjMzNTNWOS4zODk0OVoiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl8yMjAxXzY5NDIpIi8+CjxkZWZzPgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MF9saW5lYXJfMjIwMV82OTQyIiB4MT0iNTEuMzYxNSIgeTE9Ii00LjE1MjkzIiB4Mj0iMjkuNTM4NCIgeTI9IjY0LjUxNDciIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agb2Zmc2V0PSIwLjAyMTEyIiBzdG9wLWNvbG9yPSIjMDAwMEZGIi8+CjxzdG9wIG9mZnNldD0iMC4wNzYyNDIzIiBzdG9wLWNvbG9yPSIjMDA5NEZGIi8+CjxzdG9wIG9mZnNldD0iMC4xNjMwODkiIHN0b3AtY29sb3I9IiM0OEZGOTEiLz4KPHN0b3Agb2Zmc2V0PSIwLjQyMDA0OSIgc3RvcC1jb2xvcj0iIzAwOTRGRiIvPgo8c3RvcCBvZmZzZXQ9IjAuNjgyODg2IiBzdG9wLWNvbG9yPSIjMDAzOEZGIi8+CjxzdG9wIG9mZnNldD0iMC45MDI0NjUiIHN0b3AtY29sb3I9IiMwNTAwRkYiLz4KPC9saW5lYXJHcmFkaWVudD4KPC9kZWZzPgo8L3N2Zz4K";function Z6(e,t){return G6(e,t)}function G6(e,t){if(e===t)return!0;const r=e.length;if(r!==t.length)return!1;for(let n=0;n{if(!t.has(e))throw TypeError("Cannot "+r)},nt=(e,t,r)=>(Lh(e,t,"read from private field"),r?r.call(e):t.get(e)),Dr=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},$h=(e,t,r,n)=>(Lh(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Mh=(e,t,r)=>(Lh(e,t,"access private method"),r),eo,Oh,Nh,Ph,on,hn,Uh,Vf,Fh,Dh,X1,Ko,Wf,Hh,jh,zh,Kf,qh,Zf,Vh;const Y6="trust:",J1=class{constructor(e){Dr(this,Vf),Dr(this,Dh),Dr(this,eo,{}),Dr(this,Oh,"1.0.0"),Dr(this,Nh,"Trust"),Dr(this,Ph,K6),Dr(this,on,null),Dr(this,hn,void 0),Dr(this,Uh,(t,r)=>{var n;return(n=nt(this,eo)[t])!=null&&n.push(r)||(nt(this,eo)[t]=[r]),()=>Mh(this,Dh,X1).call(this,t,r)}),Dr(this,Ko,()=>{var t;const r=(t=nt(this,hn).publicKey)==null?void 0:t.toBase58();if(r){const n=nt(this,hn).publicKey.toBytes(),i=nt(this,on);(!i||i.address!==r||!Z6(i.publicKey,n))&&($h(this,on,new W6({address:r,publicKey:n})),Mh(this,Vf,Fh).call(this,"change",{accounts:this.accounts}))}}),Dr(this,Wf,()=>{nt(this,on)&&($h(this,on,null),Mh(this,Vf,Fh).call(this,"change",{accounts:this.accounts}))}),Dr(this,Hh,()=>{nt(this,hn).publicKey?nt(this,Ko).call(this):nt(this,Wf).call(this)}),Dr(this,jh,async({silent:t}={})=>(nt(this,on)||await nt(this,hn).connect(t?{onlyIfTrusted:!0}:void 0),nt(this,Ko).call(this),{accounts:this.accounts})),Dr(this,zh,async()=>{await nt(this,hn).disconnect()}),Dr(this,Kf,async(...t)=>{if(!nt(this,on))throw new Error("not connected");const r=[];if(t.length===1){const{transaction:n,account:i,chain:s,options:o}=t[0],{minContextSlot:a,preflightCommitment:c,skipPreflight:u,maxRetries:l}=o||{};if(i!==nt(this,on))throw new Error("invalid account");if(!Ch(s))throw new Error("invalid chain");const{signature:y}=await nt(this,hn).signAndSendTransaction(Va.deserialize(n),{preflightCommitment:c,minContextSlot:a,maxRetries:l,skipPreflight:u});r.push({signature:Ar.decode(y)})}else if(t.length>1)for(const n of t)r.push(...await nt(this,Kf).call(this,n));return r}),Dr(this,qh,async(...t)=>{if(!nt(this,on))throw new Error("not connected");const r=[];if(t.length===1){const{transaction:n,account:i,chain:s}=t[0];if(i!==nt(this,on))throw new Error("invalid account");if(s&&!Ch(s))throw new Error("invalid chain");const o=await nt(this,hn).signTransaction(Va.deserialize(n)),a=Uf(o)?o.serialize():new Uint8Array(o.serialize({requireAllSignatures:!1,verifySignatures:!1}));r.push({signedTransaction:a})}else if(t.length>1){let n;for(const o of t){if(o.account!==nt(this,on))throw new Error("invalid account");if(o.chain){if(!Ch(o.chain))throw new Error("invalid chain");if(n){if(o.chain!==n)throw new Error("conflicting chain")}else n=o.chain}}const i=t.map(({transaction:o})=>Va.deserialize(o)),s=await nt(this,hn).signAllTransactions(i);r.push(...s.map(o=>({signedTransaction:Uf(o)?o.serialize():new Uint8Array(o.serialize({requireAllSignatures:!1,verifySignatures:!1}))})))}return r}),Dr(this,Zf,async(...t)=>{if(!nt(this,on))throw new Error("not connected");const r=[];if(t.length===1){const{message:n,account:i}=t[0];if(i!==nt(this,on))throw new Error("invalid account");const{signature:s}=await nt(this,hn).signMessage(n);r.push({signedMessage:n,signature:s})}else if(t.length>1)for(const n of t)r.push(...await nt(this,Zf).call(this,n));return r}),Dr(this,Vh,async(...t)=>{const r=[];if(t.length>1)for(const n of t)r.push(await nt(this,hn).signIn(n));else return[await nt(this,hn).signIn(t[0])];return r}),new.target===J1&&Object.freeze(this),$h(this,hn,e),e.on("connect",nt(this,Ko),this),e.on("disconnect",nt(this,Wf),this),e.on("accountChanged",nt(this,Hh),this),nt(this,Ko).call(this)}get version(){return nt(this,Oh)}get name(){return nt(this,Nh)}get icon(){return nt(this,Ph)}get chains(){return kh.slice()}get features(){return{[M6]:{version:"1.0.0",connect:nt(this,jh)},[O6]:{version:"1.0.0",disconnect:nt(this,zh)},[N6]:{version:"1.0.0",on:nt(this,Uh)},[V1]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signAndSendTransaction:nt(this,Kf)},[K1]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signTransaction:nt(this,qh)},[W1]:{version:"1.0.0",signMessage:nt(this,Zf)},[$6]:{version:"1.0.0",signIn:nt(this,Vh)},[Y6]:{trust:nt(this,hn)}}}get accounts(){return nt(this,on)?[nt(this,on)]:[]}};let X6=J1;eo=new WeakMap,Oh=new WeakMap,Nh=new WeakMap,Ph=new WeakMap,on=new WeakMap,hn=new WeakMap,Uh=new WeakMap,Vf=new WeakSet,Fh=function(e,...t){var r;(r=nt(this,eo)[e])==null||r.forEach(n=>n.apply(null,t))},Dh=new WeakSet,X1=function(e,t){var r;nt(this,eo)[e]=(r=nt(this,eo)[e])==null?void 0:r.filter(n=>t!==n)},Ko=new WeakMap,Wf=new WeakMap,Hh=new WeakMap,jh=new WeakMap,zh=new WeakMap,Kf=new WeakMap,qh=new WeakMap,Zf=new WeakMap,Vh=new WeakMap;class J6{constructor(t,r=!1){this.useLegacySign=!1,this.provider=t,this.useLegacySign=r}async connect(t){const r=await this.provider.internalRequest({method:"requestAccounts",params:{options:t}});return this.provider.emit("connect"),{publicKey:new et(r[0])}}async signTransaction(t){if(this.useLegacySign)return await this.legacySign(t);const r=JSON.stringify(t);let n="legacy",i;Uf(t)?(n=t.version,i=ie.Buffer.from(t.message.serialize()).toString("base64")):i=ie.Buffer.from(t.serializeMessage()).toString("base64");const s=ie.Buffer.from(t.serialize({requireAllSignatures:!1,verifySignatures:!1})).toString("base64"),o=await this.provider.internalRequest({method:"signRawTransaction",params:{data:r,raw:s,rawMessage:i,version:n}});return this.provider.mapSignedTransaction(t,o)}async legacySign(t){const r=JSON.stringify(t),n=typeof t.version!="number"?"legacy":t.version,i=Ar.encode(n==="legacy"?t.serializeMessage():n===0?t.message.serialize():t.serialize());try{const s=await this.provider.internalRequest({method:"signRawTransaction",params:{data:r,raw:i,version:n}});return this.provider.mapSignedTransaction(t,s)}catch(s){console.log(`<== Error: ${s}`)}}async request(t,r){var n;switch(t.method){case"signTransaction":return this.signTransaction(t.params);case"connect":return this.connect((n=t?.params)==null?void 0:n.options)}return r()}}var Wh=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},Kh=(e,t,r)=>(Wh(e,t,"read from private field"),r?r.call(e):t.get(e)),Gf=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Zh=(e,t,r,n)=>(Wh(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Yf=(e,t,r)=>(Wh(e,t,"access private method"),r),Xf,Jf,Qf,Zo,Ga;const eu=class extends Cl{constructor(e){super(),Gf(this,Zo),Gf(this,Xf,!1),Gf(this,Jf,!0),this.isTrust=!0,this.isTrustWallet=!0,Gf(this,Qf,!1),e&&(typeof e.enableAdapter<"u"&&Zh(this,Jf,e.enableAdapter),typeof e.cluster<"u"&&(this.connection=new L6(e.cluster,"confirmed")),typeof e.disableMobileAdapter<"u"&&Zh(this,Xf,e.disableMobileAdapter),typeof e.useLegacySign<"u"&&Zh(this,Qf,e.useLegacySign),typeof e.isTrust<"u"&&(this.isTrust=e.isTrust,this.isTrustWallet=e.isTrust)),Kh(this,Jf)&&j6(this),Kh(this,Xf)||(this.mobileAdapter=new J6(this,Kh(this,Qf)))}static bufferToHex(e){return"0x"+ie.Buffer.from(e).toString("hex")}static messageToBuffer(e){let t=ie.Buffer.from([]);try{typeof e=="string"?t=ie.Buffer.from(e.replace("0x",""),"hex"):t=ie.Buffer.from(e)}catch(r){console.log(`messageToBuffer error: ${r}`)}return t}getInstanceWithAdapter(){return new X6(this)}async connect(e){const t=await Yf(this,Zo,Ga).call(this,{method:"connect",params:{options:e}});return this.publicKey=t.publicKey,t}disconnect(){return new Promise(e=>{this.publicKey=null,this.emit("disconnect"),e()})}async signAndSendTransaction(e,t){const r=await this.signTransaction(e);return{signature:await this.connection.sendRawTransaction(r.serialize(),t)}}signTransaction(e){return Yf(this,Zo,Ga).call(this,{method:"signTransaction",params:e})}signAllTransactions(e){return Promise.all(e.map(t=>this.signTransaction(t)))}async signRawTransactionMulti(e){return(await Yf(this,Zo,Ga).call(this,{method:"signRawTransactionMulti",params:{transactions:e.map(t=>{const r=JSON.stringify(t);let n="legacy",i;Uf(t)?(n=t.version,i=ie.Buffer.from(t.message.serialize()).toString("base64")):i=ie.Buffer.from(t.serializeMessage()).toString("base64");const s=ie.Buffer.from(t.serialize({requireAllSignatures:!1,verifySignatures:!1})).toString("base64");return{data:r,raw:s,rawMessage:i,version:n}})}})).map((t,r)=>this.mapSignedTransaction(e[r],t))}async signMessage(e){var t;const r=eu.bufferToHex(e),n=await Yf(this,Zo,Ga).call(this,{method:"signMessage",params:{data:r}});return{signature:ie.Buffer.from(eu.messageToBuffer(n).buffer),publicKey:(t=this.publicKey)==null?void 0:t.toBase58()}}signIn(e){throw new Error("Method not implemented.")}getNetwork(){return eu.NETWORK}mapSignedTransaction(e,t){return e.addSignature(this.publicKey,Ar.decode(t)),e}request(e){throw new Error("Not implemented")}internalRequest(e){return super.request(e)}};let Q1=eu;Xf=new WeakMap,Jf=new WeakMap,Qf=new WeakMap,Zo=new WeakSet,Ga=function(e){const t=()=>this.internalRequest(e);return this.mobileAdapter?this.mobileAdapter.request(e,t):t()},Q1.NETWORK="solana";var Go={},ls={},tu={},ru={},nu={},ey={},Yo={},iu={},Hr={};Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.output=Hr.exists=Hr.hash=Hr.bytes=Hr.bool=Hr.number=void 0;function su(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}Hr.number=su;function ty(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}Hr.bool=ty;function Q6(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function Gh(e,...t){if(!Q6(e))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}Hr.bytes=Gh;function ry(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");su(e.outputLen),su(e.blockLen)}Hr.hash=ry;function ny(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}Hr.exists=ny;function iy(e,t){Gh(e);const r=t.outputLen;if(e.lengthnew Uint8Array(z.buffer,z.byteOffset,z.byteLength);e.u8=r;const n=z=>new Uint32Array(z.buffer,z.byteOffset,Math.floor(z.byteLength/4));e.u32=n;function i(z){return z instanceof Uint8Array||z!=null&&typeof z=="object"&&z.constructor.name==="Uint8Array"}const s=z=>new DataView(z.buffer,z.byteOffset,z.byteLength);e.createView=s;const o=(z,ee)=>z<<32-ee|z>>>ee;if(e.rotr=o,e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,!e.isLE)throw new Error("Non little-endian hardware is not supported");const a=Array.from({length:256},(z,ee)=>ee.toString(16).padStart(2,"0"));function c(z){if(!i(z))throw new Error("Uint8Array expected");let ee="";for(let se=0;se=u._0&&z<=u._9)return z-u._0;if(z>=u._A&&z<=u._F)return z-(u._A-10);if(z>=u._a&&z<=u._f)return z-(u._a-10)}function y(z){if(typeof z!="string")throw new Error("hex string expected, got "+typeof z);const ee=z.length,se=ee/2;if(ee%2)throw new Error("padded hex string expected, got unpadded hex of length "+ee);const Q=new Uint8Array(se);for(let I=0,g=0;I{};e.nextTick=A;async function v(z,ee,se){let Q=Date.now();for(let I=0;I=0&&gz().update(M(Q)).digest(),se=z();return ee.outputLen=se.outputLen,ee.blockLen=se.blockLen,ee.create=()=>z(),ee}e.wrapConstructor=$;function q(z){const ee=(Q,I)=>z(I).update(M(Q)).digest(),se=z({});return ee.outputLen=se.outputLen,ee.blockLen=se.blockLen,ee.create=Q=>z(Q),ee}e.wrapConstructorWithOpts=q;function G(z){const ee=(Q,I)=>z(I).update(M(Q)).digest(),se=z({});return ee.outputLen=se.outputLen,ee.blockLen=se.blockLen,ee.create=Q=>z(Q),ee}e.wrapXOFConstructorWithOpts=G;function Z(z=32){if(t.crypto&&typeof t.crypto.getRandomValues=="function")return t.crypto.getRandomValues(new Uint8Array(z));throw new Error("crypto.getRandomValues must be defined")}e.randomBytes=Z}(Ui),Object.defineProperty(iu,"__esModule",{value:!0}),iu.SHA2=void 0;const Yh=Hr,Ya=Ui;function tB(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,u=n?0:4;e.setUint32(t+c,o,n),e.setUint32(t+u,a,n)}class rB extends Ya.Hash{constructor(t,r,n,i){super(),this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=(0,Ya.createView)(this.buffer)}update(t){(0,Yh.exists)(this);const{view:r,buffer:n,blockLen:i}=this;t=(0,Ya.toBytes)(t);const s=t.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let y=o;yl.length)throw new Error("_sha2: outputLen bigger than state");for(let y=0;ye&t^~e&r,sB=(e,t,r)=>e&t^e&r^t&r,oB=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),hs=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ds=new Uint32Array(64);class sy extends nB.SHA2{constructor(){super(64,32,8,!1),this.A=hs[0]|0,this.B=hs[1]|0,this.C=hs[2]|0,this.D=hs[3]|0,this.E=hs[4]|0,this.F=hs[5]|0,this.G=hs[6]|0,this.H=hs[7]|0}get(){const{A:t,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[t,r,n,i,s,o,a,c]}set(t,r,n,i,s,o,a,c){this.A=t|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(t,r){for(let y=0;y<16;y++,r+=4)ds[y]=t.getUint32(r,!1);for(let y=16;y<64;y++){const A=ds[y-15],v=ds[y-2],R=(0,jn.rotr)(A,7)^(0,jn.rotr)(A,18)^A>>>3,M=(0,jn.rotr)(v,17)^(0,jn.rotr)(v,19)^v>>>10;ds[y]=M+ds[y-7]+R+ds[y-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:u,H:l}=this;for(let y=0;y<64;y++){const A=(0,jn.rotr)(a,6)^(0,jn.rotr)(a,11)^(0,jn.rotr)(a,25),v=l+A+iB(a,c,u)+oB[y]+ds[y]|0,M=((0,jn.rotr)(n,2)^(0,jn.rotr)(n,13)^(0,jn.rotr)(n,22))+sB(n,i,s)|0;l=u,u=c,c=a,a=o+v|0,o=s,s=i,i=n,n=v+M|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(n,i,s,o,a,c,u,l)}roundClean(){ds.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class aB extends sy{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}Yo.sha256=(0,jn.wrapConstructor)(()=>new sy),Yo.sha224=(0,jn.wrapConstructor)(()=>new aB);var ht={},st={};Object.defineProperty(st,"__esModule",{value:!0}),st.validateObject=st.createHmacDrbg=st.bitMask=st.bitSet=st.bitGet=st.bitLen=st.utf8ToBytes=st.equalBytes=st.concatBytes=st.ensureBytes=st.numberToVarBytesBE=st.numberToBytesLE=st.numberToBytesBE=st.bytesToNumberLE=st.bytesToNumberBE=st.hexToBytes=st.hexToNumber=st.numberToHexUnpadded=st.bytesToHex=st.isBytes=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const oy=BigInt(0),au=BigInt(1),cB=BigInt(2);function Xo(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}st.isBytes=Xo;const fB=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Xh(e){if(!Xo(e))throw new Error("Uint8Array expected");let t="";for(let r=0;r=Fi._0&&e<=Fi._9)return e-Fi._0;if(e>=Fi._A&&e<=Fi._F)return e-(Fi._A-10);if(e>=Fi._a&&e<=Fi._f)return e-(Fi._a-10)}function cu(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let i=0,s=0;ioy;e>>=au,t+=1);return t}st.bitLen=wB;function mB(e,t){return e>>BigInt(t)&au}st.bitGet=mB;const bB=(e,t,r)=>e|(r?au:oy)<(cB<new Uint8Array(e),ly=e=>Uint8Array.from(e);function _B(e,t,r){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=Qh(e),i=Qh(e),s=0;const o=()=>{n.fill(1),i.fill(0),s=0},a=(...y)=>r(i,n,...y),c=(y=Qh())=>{i=a(ly([0]),y),n=a(),y.length!==0&&(i=a(ly([1]),y),n=a())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let y=0;const A=[];for(;y{o(),c(y);let v;for(;!(v=A(u()));)c();return o(),v}}st.createHmacDrbg=_B;const EB={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||Xo(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function xB(e,t,r={}){const n=(i,s,o)=>{const a=EB[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);const c=e[i];if(!(o&&c===void 0)&&!a(c,e))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${s}`)};for(const[i,s]of Object.entries(t))n(i,s,!1);for(const[i,s]of Object.entries(r))n(i,s,!0);return e}st.validateObject=xB,Object.defineProperty(ht,"__esModule",{value:!0}),ht.mapHashToField=ht.getMinHashLength=ht.getFieldBytesLength=ht.hashToPrivateScalar=ht.FpSqrtEven=ht.FpSqrtOdd=ht.Field=ht.nLength=ht.FpIsSquare=ht.FpDiv=ht.FpInvertBatch=ht.FpPow=ht.validateField=ht.isNegativeLE=ht.FpSqrt=ht.tonelliShanks=ht.invert=ht.pow2=ht.pow=ht.mod=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Cn=st,jr=BigInt(0),Jt=BigInt(1),ps=BigInt(2),SB=BigInt(3),ed=BigInt(4),hy=BigInt(5),dy=BigInt(8);BigInt(9),BigInt(16);function Ln(e,t){const r=e%t;return r>=jr?r:t+r}ht.mod=Ln;function py(e,t,r){if(r<=jr||t 0");if(r===Jt)return jr;let n=Jt;for(;t>jr;)t&Jt&&(n=n*e%r),e=e*e%r,t>>=Jt;return n}ht.pow=py;function AB(e,t,r){let n=e;for(;t-- >jr;)n*=n,n%=r;return n}ht.pow2=AB;function fu(e,t){if(e===jr||t<=jr)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=Ln(e,t),n=t,i=jr,s=Jt;for(;r!==jr;){const a=n/r,c=n%r,u=i-s*a;n=r,r=c,i=s,s=u}if(n!==Jt)throw new Error("invert: does not exist");return Ln(i,t)}ht.invert=fu;function gy(e){const t=(e-Jt)/ps;let r,n,i;for(r=e-Jt,n=0;r%ps===jr;r/=ps,n++);for(i=ps;i(Ln(e,t)&Jt)===Jt;ht.isNegativeLE=BB;const IB=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function RB(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=IB.reduce((n,i)=>(n[i]="function",n),t);return(0,Cn.validateObject)(e,r)}ht.validateField=RB;function wy(e,t,r){if(r 0");if(r===jr)return e.ONE;if(r===Jt)return t;let n=e.ONE,i=t;for(;r>jr;)r&Jt&&(n=e.mul(n,i)),i=e.sqr(i),r>>=Jt;return n}ht.FpPow=wy;function my(e,t){const r=new Array(t.length),n=t.reduce((s,o,a)=>e.is0(o)?s:(r[a]=s,e.mul(s,o)),e.ONE),i=e.inv(n);return t.reduceRight((s,o,a)=>e.is0(o)?s:(r[a]=e.mul(s,r[a]),e.mul(s,o)),i),r}ht.FpInvertBatch=my;function TB(e,t,r){return e.mul(t,typeof r=="bigint"?fu(r,e.ORDER):e.inv(r))}ht.FpDiv=TB;function kB(e){const t=(e.ORDER-Jt)/ps;return r=>{const n=e.pow(r,t);return e.eql(n,e.ZERO)||e.eql(n,e.ONE)}}ht.FpIsSquare=kB;function td(e,t){const r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}ht.nLength=td;function CB(e,t,r=!1,n={}){if(e<=jr)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:i,nByteLength:s}=td(e,t);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=yy(e),a=Object.freeze({ORDER:e,BITS:i,BYTES:s,MASK:(0,Cn.bitMask)(i),ZERO:jr,ONE:Jt,create:c=>Ln(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return jr<=c&&cc===jr,isOdd:c=>(c&Jt)===Jt,neg:c=>Ln(-c,e),eql:(c,u)=>c===u,sqr:c=>Ln(c*c,e),add:(c,u)=>Ln(c+u,e),sub:(c,u)=>Ln(c-u,e),mul:(c,u)=>Ln(c*u,e),pow:(c,u)=>wy(a,c,u),div:(c,u)=>Ln(c*fu(u,e),e),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>fu(c,e),sqrt:n.sqrt||(c=>o(a,c)),invertBatch:c=>my(a,c),cmov:(c,u,l)=>l?u:c,toBytes:c=>r?(0,Cn.numberToBytesLE)(c,s):(0,Cn.numberToBytesBE)(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return r?(0,Cn.bytesToNumberLE)(c):(0,Cn.bytesToNumberBE)(c)}});return Object.freeze(a)}ht.Field=CB;function LB(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?r:e.neg(r)}ht.FpSqrtOdd=LB;function $B(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?e.neg(r):r}ht.FpSqrtEven=$B;function MB(e,t,r=!1){e=(0,Cn.ensureBytes)("privateHash",e);const n=e.length,i=td(t).nByteLength+8;if(i<24||n1024)throw new Error(`hashToPrivateScalar: expected ${i}-1024 bytes of input, got ${n}`);const s=r?(0,Cn.bytesToNumberLE)(e):(0,Cn.bytesToNumberBE)(e);return Ln(s,t-Jt)+Jt}ht.hashToPrivateScalar=MB;function rd(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}ht.getFieldBytesLength=rd;function by(e){const t=rd(e);return t+Math.ceil(t/2)}ht.getMinHashLength=by;function OB(e,t,r=!1){const n=e.length,i=rd(t),s=by(t);if(n<16||n1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);const o=r?(0,Cn.bytesToNumberBE)(e):(0,Cn.bytesToNumberLE)(e),a=Ln(o,t-Jt)+Jt;return r?(0,Cn.numberToBytesLE)(a,i):(0,Cn.numberToBytesBE)(a,i)}ht.mapHashToField=OB;var nd={},Jo={};Object.defineProperty(Jo,"__esModule",{value:!0}),Jo.validateBasic=Jo.wNAF=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const vy=ht,NB=st,PB=BigInt(0),id=BigInt(1);function UB(e,t){const r=(i,s)=>{const o=s.negate();return i?o:s},n=i=>{const s=Math.ceil(t/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:r,unsafeLadder(i,s){let o=e.ZERO,a=i;for(;s>PB;)s&id&&(o=o.add(a)),a=a.double(),s>>=id;return o},precomputeWindow(i,s){const{windows:o,windowSize:a}=n(s),c=[];let u=i,l=u;for(let y=0;y>=v,P>c&&(P-=A,o+=id);const H=M,F=M+Math.abs(P)-1,N=R%2!==0,$=P<0;P===0?l=l.add(r(N,s[H])):u=u.add(r($,s[F]))}return{p:u,f:l}},wNAFCached(i,s,o,a){const c=i._WINDOW_SIZE||1;let u=s.get(i);return u||(u=this.precomputeWindow(i,c),c!==1&&s.set(i,a(u))),this.wNAF(c,u,o)}}}Jo.wNAF=UB;function FB(e){return(0,vy.validateField)(e.Fp),(0,NB.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,vy.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}Jo.validateBasic=FB,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mapToCurveSimpleSWU=e.SWUFpSqrtRatio=e.weierstrass=e.weierstrassPoints=e.DER=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=ht,r=st,n=st,i=Jo;function s(F){const N=(0,i.validateBasic)(F);r.validateObject(N,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:$,Fp:q,a:G}=N;if($){if(!q.eql(G,q.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof $!="object"||typeof $.beta!="bigint"||typeof $.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...N})}const{bytesToNumberBE:o,hexToBytes:a}=r;e.DER={Err:class extends Error{constructor(N=""){super(N)}},_parseInt(F){const{Err:N}=e.DER;if(F.length<2||F[0]!==2)throw new N("Invalid signature integer tag");const $=F[1],q=F.subarray(2,$+2);if(!$||q.length!==$)throw new N("Invalid signature integer: wrong length");if(q[0]&128)throw new N("Invalid signature integer: negative");if(q[0]===0&&!(q[1]&128))throw new N("Invalid signature integer: unnecessary leading zero");return{d:o(q),l:F.subarray($+2)}},toSig(F){const{Err:N}=e.DER,$=typeof F=="string"?a(F):F;if(!r.isBytes($))throw new Error("ui8a expected");let q=$.length;if(q<2||$[0]!=48)throw new N("Invalid signature tag");if($[1]!==q-2)throw new N("Invalid signature: incorrect length");const{d:G,l:Z}=e.DER._parseInt($.subarray(2)),{d:z,l:ee}=e.DER._parseInt(Z);if(ee.length)throw new N("Invalid signature: left bytes after parsing");return{r:G,s:z}},hexFromSig(F){const N=Q=>Number.parseInt(Q[0],16)&8?"00"+Q:Q,$=Q=>{const I=Q.toString(16);return I.length&1?`0${I}`:I},q=N($(F.s)),G=N($(F.r)),Z=q.length/2,z=G.length/2,ee=$(Z),se=$(z);return`30${$(z+Z+4)}02${se}${G}02${ee}${q}`}};const c=BigInt(0),u=BigInt(1),l=BigInt(2),y=BigInt(3),A=BigInt(4);function v(F){const N=s(F),{Fp:$}=N,q=N.toBytes||((m,_,E)=>{const x=_.toAffine();return r.concatBytes(Uint8Array.from([4]),$.toBytes(x.x),$.toBytes(x.y))}),G=N.fromBytes||(m=>{const _=m.subarray(1),E=$.fromBytes(_.subarray(0,$.BYTES)),x=$.fromBytes(_.subarray($.BYTES,2*$.BYTES));return{x:E,y:x}});function Z(m){const{a:_,b:E}=N,x=$.sqr(m),T=$.mul(x,m);return $.add($.add(T,$.mul(m,_)),E)}if(!$.eql($.sqr(N.Gy),Z(N.Gx)))throw new Error("bad generator point: equation left != right");function z(m){return typeof m=="bigint"&&c$.eql(B,$.ZERO);return T(E)&&T(x)?g.ZERO:new g(E,x,$.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(_){const E=$.invertBatch(_.map(x=>x.pz));return _.map((x,T)=>x.toAffine(E[T])).map(g.fromAffine)}static fromHex(_){const E=g.fromAffine(G((0,n.ensureBytes)("pointHex",_)));return E.assertValidity(),E}static fromPrivateKey(_){return g.BASE.multiply(se(_))}_setWindowSize(_){this._WINDOW_SIZE=_,Q.delete(this)}assertValidity(){if(this.is0()){if(N.allowInfinityPoint&&!$.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:_,y:E}=this.toAffine();if(!$.isValid(_)||!$.isValid(E))throw new Error("bad point: x or y not FE");const x=$.sqr(E),T=Z(_);if(!$.eql(x,T))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:_}=this.toAffine();if($.isOdd)return!$.isOdd(_);throw new Error("Field doesn't support isOdd")}equals(_){I(_);const{px:E,py:x,pz:T}=this,{px:B,py:d,pz:k}=_,W=$.eql($.mul(E,k),$.mul(B,T)),K=$.eql($.mul(x,k),$.mul(d,T));return W&&K}negate(){return new g(this.px,$.neg(this.py),this.pz)}double(){const{a:_,b:E}=N,x=$.mul(E,y),{px:T,py:B,pz:d}=this;let k=$.ZERO,W=$.ZERO,K=$.ZERO,re=$.mul(T,T),xe=$.mul(B,B),be=$.mul(d,d),ge=$.mul(T,B);return ge=$.add(ge,ge),K=$.mul(T,d),K=$.add(K,K),k=$.mul(_,K),W=$.mul(x,be),W=$.add(k,W),k=$.sub(xe,W),W=$.add(xe,W),W=$.mul(k,W),k=$.mul(ge,k),K=$.mul(x,K),be=$.mul(_,be),ge=$.sub(re,be),ge=$.mul(_,ge),ge=$.add(ge,K),K=$.add(re,re),re=$.add(K,re),re=$.add(re,be),re=$.mul(re,ge),W=$.add(W,re),be=$.mul(B,d),be=$.add(be,be),re=$.mul(be,ge),k=$.sub(k,re),K=$.mul(be,xe),K=$.add(K,K),K=$.add(K,K),new g(k,W,K)}add(_){I(_);const{px:E,py:x,pz:T}=this,{px:B,py:d,pz:k}=_;let W=$.ZERO,K=$.ZERO,re=$.ZERO;const xe=N.a,be=$.mul(N.b,y);let ge=$.mul(E,B),tt=$.mul(x,d),Ue=$.mul(T,k),Pe=$.add(E,x),pe=$.add(B,d);Pe=$.mul(Pe,pe),pe=$.add(ge,tt),Pe=$.sub(Pe,pe),pe=$.add(E,T);let we=$.add(B,k);return pe=$.mul(pe,we),we=$.add(ge,Ue),pe=$.sub(pe,we),we=$.add(x,T),W=$.add(d,k),we=$.mul(we,W),W=$.add(tt,Ue),we=$.sub(we,W),re=$.mul(xe,pe),W=$.mul(be,Ue),re=$.add(W,re),W=$.sub(tt,re),re=$.add(tt,re),K=$.mul(W,re),tt=$.add(ge,ge),tt=$.add(tt,ge),Ue=$.mul(xe,Ue),pe=$.mul(be,pe),tt=$.add(tt,Ue),Ue=$.sub(ge,Ue),Ue=$.mul(xe,Ue),pe=$.add(pe,Ue),ge=$.mul(tt,pe),K=$.add(K,ge),ge=$.mul(we,pe),W=$.mul(Pe,W),W=$.sub(W,ge),ge=$.mul(Pe,tt),re=$.mul(we,re),re=$.add(re,ge),new g(W,K,re)}subtract(_){return this.add(_.negate())}is0(){return this.equals(g.ZERO)}wNAF(_){return h.wNAFCached(this,Q,_,E=>{const x=$.invertBatch(E.map(T=>T.pz));return E.map((T,B)=>T.toAffine(x[B])).map(g.fromAffine)})}multiplyUnsafe(_){const E=g.ZERO;if(_===c)return E;if(ee(_),_===u)return this;const{endo:x}=N;if(!x)return h.unsafeLadder(this,_);let{k1neg:T,k1:B,k2neg:d,k2:k}=x.splitScalar(_),W=E,K=E,re=this;for(;B>c||k>c;)B&u&&(W=W.add(re)),k&u&&(K=K.add(re)),re=re.double(),B>>=u,k>>=u;return T&&(W=W.negate()),d&&(K=K.negate()),K=new g($.mul(K.px,x.beta),K.py,K.pz),W.add(K)}multiply(_){ee(_);let E=_,x,T;const{endo:B}=N;if(B){const{k1neg:d,k1:k,k2neg:W,k2:K}=B.splitScalar(E);let{p:re,f:xe}=this.wNAF(k),{p:be,f:ge}=this.wNAF(K);re=h.constTimeNegate(d,re),be=h.constTimeNegate(W,be),be=new g($.mul(be.px,B.beta),be.py,be.pz),x=re.add(be),T=xe.add(ge)}else{const{p:d,f:k}=this.wNAF(E);x=d,T=k}return g.normalizeZ([x,T])[0]}multiplyAndAddUnsafe(_,E,x){const T=g.BASE,B=(k,W)=>W===c||W===u||!k.equals(T)?k.multiplyUnsafe(W):k.multiply(W),d=B(this,E).add(B(_,x));return d.is0()?void 0:d}toAffine(_){const{px:E,py:x,pz:T}=this,B=this.is0();_==null&&(_=B?$.ONE:$.inv(T));const d=$.mul(E,_),k=$.mul(x,_),W=$.mul(T,_);if(B)return{x:$.ZERO,y:$.ZERO};if(!$.eql(W,$.ONE))throw new Error("invZ was invalid");return{x:d,y:k}}isTorsionFree(){const{h:_,isTorsionFree:E}=N;if(_===u)return!0;if(E)return E(g,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:_,clearCofactor:E}=N;return _===u?this:E?E(g,this):this.multiplyUnsafe(N.h)}toRawBytes(_=!0){return this.assertValidity(),q(g,this,_)}toHex(_=!0){return r.bytesToHex(this.toRawBytes(_))}}g.BASE=new g(N.Gx,N.Gy,$.ONE),g.ZERO=new g($.ZERO,$.ONE,$.ZERO);const f=N.nBitLength,h=(0,i.wNAF)(g,N.endo?Math.ceil(f/2):f);return{CURVE:N,ProjectivePoint:g,normPrivateKeyToScalar:se,weierstrassEquation:Z,isWithinCurveOrder:z}}e.weierstrassPoints=v;function R(F){const N=(0,i.validateBasic)(F);return r.validateObject(N,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...N})}function M(F){const N=R(F),{Fp:$,n:q}=N,G=$.BYTES+1,Z=2*$.BYTES+1;function z(pe){return cr.bytesToHex(r.numberToBytesBE(pe,N.nByteLength));function m(pe){const we=q>>u;return pe>we}function _(pe){return m(pe)?ee(-pe):pe}const E=(pe,we,ke)=>r.bytesToNumberBE(pe.slice(we,ke));class x{constructor(we,ke,vt){this.r=we,this.s=ke,this.recovery=vt,this.assertValidity()}static fromCompact(we){const ke=N.nByteLength;return we=(0,n.ensureBytes)("compactSignature",we,ke*2),new x(E(we,0,ke),E(we,ke,2*ke))}static fromDER(we){const{r:ke,s:vt}=e.DER.toSig((0,n.ensureBytes)("DER",we));return new x(ke,vt)}assertValidity(){if(!f(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!f(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(we){return new x(this.r,this.s,we)}recoverPublicKey(we){const{r:ke,s:vt,recovery:He}=this,it=K((0,n.ensureBytes)("msgHash",we));if(He==null||![0,1,2,3].includes(He))throw new Error("recovery id invalid");const Ht=He===2||He===3?ke+N.n:ke;if(Ht>=$.ORDER)throw new Error("recovery id 2 or 3 invalid");const ut=He&1?"03":"02",pt=Q.fromHex(ut+h(Ht)),Wt=se(Ht),xt=ee(-it*Wt),At=ee(vt*Wt),Xt=Q.BASE.multiplyAndAddUnsafe(pt,xt,At);if(!Xt)throw new Error("point at infinify");return Xt.assertValidity(),Xt}hasHighS(){return m(this.s)}normalizeS(){return this.hasHighS()?new x(this.r,ee(-this.s),this.recovery):this}toDERRawBytes(){return r.hexToBytes(this.toDERHex())}toDERHex(){return e.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return r.hexToBytes(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const T={isValidPrivateKey(pe){try{return I(pe),!0}catch{return!1}},normPrivateKeyToScalar:I,randomPrivateKey:()=>{const pe=t.getMinHashLength(N.n);return t.mapHashToField(N.randomBytes(pe),N.n)},precompute(pe=8,we=Q.BASE){return we._setWindowSize(pe),we.multiply(BigInt(3)),we}};function B(pe,we=!0){return Q.fromPrivateKey(pe).toRawBytes(we)}function d(pe){const we=r.isBytes(pe),ke=typeof pe=="string",vt=(we||ke)&&pe.length;return we?vt===G||vt===Z:ke?vt===2*G||vt===2*Z:pe instanceof Q}function k(pe,we,ke=!0){if(d(pe))throw new Error("first arg must be private key");if(!d(we))throw new Error("second arg must be public key");return Q.fromHex(we).multiply(I(pe)).toRawBytes(ke)}const W=N.bits2int||function(pe){const we=r.bytesToNumberBE(pe),ke=pe.length*8-N.nBitLength;return ke>0?we>>BigInt(ke):we},K=N.bits2int_modN||function(pe){return ee(W(pe))},re=r.bitMask(N.nBitLength);function xe(pe){if(typeof pe!="bigint")throw new Error("bigint expected");if(!(c<=pe&&peC in ke))throw new Error("sign() legacy options not supported");const{hash:vt,randomBytes:He}=N;let{lowS:it,prehash:Ht,extraEntropy:ut}=ke;it==null&&(it=!0),pe=(0,n.ensureBytes)("msgHash",pe),Ht&&(pe=(0,n.ensureBytes)("prehashed msgHash",vt(pe)));const pt=K(pe),Wt=I(we),xt=[xe(Wt),xe(pt)];if(ut!=null){const C=ut===!0?He($.BYTES):ut;xt.push((0,n.ensureBytes)("extraEntropy",C))}const At=r.concatBytes(...xt),Xt=pt;function Tt(C){const w=W(C);if(!f(w))return;const b=se(w),D=Q.BASE.multiply(w).toAffine(),V=ee(D.x);if(V===c)return;const X=ee(b*ee(Xt+V*Wt));if(X===c)return;let ae=(D.x===V?0:2)|Number(D.y&u),Ze=X;return it&&m(X)&&(Ze=_(X),ae^=1),new x(V,Ze,ae)}return{seed:At,k2sig:Tt}}const ge={lowS:N.lowS,prehash:!1},tt={lowS:N.lowS,prehash:!1};function Ue(pe,we,ke=ge){const{seed:vt,k2sig:He}=be(pe,we,ke),it=N;return r.createHmacDrbg(it.hash.outputLen,it.nByteLength,it.hmac)(vt,He)}Q.BASE._setWindowSize(8);function Pe(pe,we,ke,vt=tt){const He=pe;if(we=(0,n.ensureBytes)("msgHash",we),ke=(0,n.ensureBytes)("publicKey",ke),"strict"in vt)throw new Error("options.strict was renamed to lowS");const{lowS:it,prehash:Ht}=vt;let ut,pt;try{if(typeof He=="string"||r.isBytes(He))try{ut=x.fromDER(He)}catch(D){if(!(D instanceof e.DER.Err))throw D;ut=x.fromCompact(He)}else if(typeof He=="object"&&typeof He.r=="bigint"&&typeof He.s=="bigint"){const{r:D,s:V}=He;ut=new x(D,V)}else throw new Error("PARSE");pt=Q.fromHex(ke)}catch(D){if(D.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(it&&ut.hasHighS())return!1;Ht&&(we=N.hash(we));const{r:Wt,s:xt}=ut,At=K(we),Xt=se(xt),Tt=ee(At*Xt),C=ee(Wt*Xt),w=Q.BASE.multiplyAndAddUnsafe(pt,Tt,C)?.toAffine();return w?ee(w.x)===Wt:!1}return{CURVE:N,getPublicKey:B,getSharedSecret:k,sign:Ue,verify:Pe,ProjectivePoint:Q,Signature:x,utils:T}}e.weierstrass=M;function P(F,N){const $=F.ORDER;let q=c;for(let m=$-u;m%l===c;m/=l)q+=u;const G=q,Z=l<{let E=g,x=F.pow(_,Q),T=F.sqr(x);T=F.mul(T,_);let B=F.mul(m,T);B=F.pow(B,se),B=F.mul(B,x),x=F.mul(B,_),T=F.mul(B,m);let d=F.mul(T,x);B=F.pow(d,I);let k=F.eql(B,F.ONE);x=F.mul(T,f),B=F.mul(d,E),T=F.cmov(x,T,k),d=F.cmov(B,d,k);for(let W=G;W>u;W--){let K=W-l;K=l<{let T=F.sqr(x);const B=F.mul(E,x);T=F.mul(T,B);let d=F.pow(T,m);d=F.mul(d,B);const k=F.mul(d,_),W=F.mul(F.sqr(d),x),K=F.eql(W,E);let re=F.cmov(k,d,K);return{isValid:K,value:re}}}return h}e.SWUFpSqrtRatio=P;function H(F,N){if(t.validateField(F),!F.isValid(N.A)||!F.isValid(N.B)||!F.isValid(N.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const $=P(F,N.Z);if(!F.isOdd)throw new Error("Fp.isOdd is not implemented!");return q=>{let G,Z,z,ee,se,Q,I,g;G=F.sqr(q),G=F.mul(G,N.Z),Z=F.sqr(G),Z=F.add(Z,G),z=F.add(Z,F.ONE),z=F.mul(z,N.B),ee=F.cmov(N.Z,F.neg(Z),!F.eql(Z,F.ZERO)),ee=F.mul(ee,N.A),Z=F.sqr(z),Q=F.sqr(ee),se=F.mul(Q,N.A),Z=F.add(Z,se),Z=F.mul(Z,z),Q=F.mul(Q,ee),se=F.mul(Q,N.B),Z=F.add(Z,se),I=F.mul(G,z);const{isValid:f,value:h}=$(Z,Q);g=F.mul(G,q),g=F.mul(g,h),I=F.cmov(I,z,f),g=F.cmov(g,h,f);const m=F.isOdd(q)===F.isOdd(g);return g=F.cmov(F.neg(g),g,m),I=F.div(I,ee),{x:I,y:g}}}e.mapToCurveSimpleSWU=H}(nd);var zn={};Object.defineProperty(zn,"__esModule",{value:!0}),zn.createHasher=zn.isogenyMap=zn.hash_to_field=zn.expand_message_xof=zn.expand_message_xmd=void 0;const DB=ht,$n=st;function HB(e){if((0,$n.isBytes)(e))return e;if(typeof e=="string")return(0,$n.utf8ToBytes)(e);throw new Error("DST must be Uint8Array or string")}const jB=$n.bytesToNumberBE;function gs(e,t){if(e<0||e>=1<<8*t)throw new Error(`bad I2OSP call: value=${e} length=${t}`);const r=Array.from({length:t}).fill(0);for(let n=t-1;n>=0;n--)r[n]=e&255,e>>>=8;return new Uint8Array(r)}function zB(e,t){const r=new Uint8Array(e.length);for(let n=0;n255&&(t=n((0,$n.concatBytes)((0,$n.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));const{outputLen:i,blockLen:s}=n,o=Math.ceil(r/i);if(o>255)throw new Error("Invalid xmd length");const a=(0,$n.concatBytes)(t,gs(t.length,1)),c=gs(0,s),u=gs(r,2),l=new Array(o),y=n((0,$n.concatBytes)(c,e,u,gs(0,1),a));l[0]=n((0,$n.concatBytes)(y,gs(1,1),a));for(let v=1;v<=o;v++){const R=[zB(y,l[v-1]),gs(v+1,1),a];l[v]=n((0,$n.concatBytes)(...R))}return(0,$n.concatBytes)(...l).slice(0,r)}zn.expand_message_xmd=_y;function Ey(e,t,r,n,i){if(Xa(e),Xa(t),sd(r),t.length>255){const s=Math.ceil(2*n/8);t=i.create({dkLen:s}).update((0,$n.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return i.create({dkLen:r}).update(e).update(gs(r,2)).update(t).update(gs(t.length,1)).digest()}zn.expand_message_xof=Ey;function od(e,t,r){(0,$n.validateObject)(r,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:n,k:i,m:s,hash:o,expand:a,DST:c}=r;Xa(e),sd(t);const u=HB(c),l=n.toString(2).length,y=Math.ceil((l+i)/8),A=t*s*y;let v;if(a==="xmd")v=_y(e,u,A,o);else if(a==="xof")v=Ey(e,u,A,i,o);else if(a==="_internal_pass")v=e;else throw new Error('expand must be "xmd" or "xof"');const R=new Array(t);for(let M=0;MArray.from(n).reverse());return(n,i)=>{const[s,o,a,c]=r.map(u=>u.reduce((l,y)=>e.add(e.mul(l,n),y)));return n=e.div(s,o),i=e.mul(i,e.div(a,c)),{x:n,y:i}}}zn.isogenyMap=qB;function VB(e,t,r){if(typeof t!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(n,i){const s=od(n,2,{...r,DST:r.DST,...i}),o=e.fromAffine(t(s[0])),a=e.fromAffine(t(s[1])),c=o.add(a).clearCofactor();return c.assertValidity(),c},encodeToCurve(n,i){const s=od(n,1,{...r,DST:r.encodeDST,...i}),o=e.fromAffine(t(s[0])).clearCofactor();return o.assertValidity(),o}}}zn.createHasher=VB;var Qo={},xy={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hmac=e.HMAC=void 0;const t=Hr,r=Ui;class n extends r.Hash{constructor(o,a){super(),this.finished=!1,this.destroyed=!1,(0,t.hash)(o);const c=(0,r.toBytes)(a);if(this.iHash=o.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const u=this.blockLen,l=new Uint8Array(u);l.set(c.length>u?o.create().update(c).digest():c);for(let y=0;ynew n(s,o).update(a).digest();e.hmac=i,e.hmac.create=(s,o)=>new n(s,o)})(xy),Object.defineProperty(Qo,"__esModule",{value:!0}),Qo.createCurve=Qo.getHash=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const WB=xy,Sy=Ui,KB=nd;function Ay(e){return{hash:e,hmac:(t,...r)=>(0,WB.hmac)(e,t,(0,Sy.concatBytes)(...r)),randomBytes:Sy.randomBytes}}Qo.getHash=Ay;function ZB(e,t){const r=n=>(0,KB.weierstrass)({...e,...Ay(n)});return Object.freeze({...r(t),create:r})}Qo.createCurve=ZB,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.encodeToCurve=e.hashToCurve=e.schnorr=e.secp256k1=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=Yo,r=Ui,n=ht,i=nd,s=st,o=zn,a=Qo,c=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),u=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),l=BigInt(1),y=BigInt(2),A=(x,T)=>(x+T/y)/T;function v(x){const T=c,B=BigInt(3),d=BigInt(6),k=BigInt(11),W=BigInt(22),K=BigInt(23),re=BigInt(44),xe=BigInt(88),be=x*x*x%T,ge=be*be*x%T,tt=(0,n.pow2)(ge,B,T)*ge%T,Ue=(0,n.pow2)(tt,B,T)*ge%T,Pe=(0,n.pow2)(Ue,y,T)*be%T,pe=(0,n.pow2)(Pe,k,T)*Pe%T,we=(0,n.pow2)(pe,W,T)*pe%T,ke=(0,n.pow2)(we,re,T)*we%T,vt=(0,n.pow2)(ke,xe,T)*ke%T,He=(0,n.pow2)(vt,re,T)*we%T,it=(0,n.pow2)(He,B,T)*ge%T,Ht=(0,n.pow2)(it,K,T)*pe%T,ut=(0,n.pow2)(Ht,d,T)*be%T,pt=(0,n.pow2)(ut,y,T);if(!R.eql(R.sqr(pt),x))throw new Error("Cannot find square root");return pt}const R=(0,n.Field)(c,void 0,void 0,{sqrt:v});e.secp256k1=(0,a.createCurve)({a:BigInt(0),b:BigInt(7),Fp:R,n:u,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:x=>{const T=u,B=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),d=-l*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),k=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),W=B,K=BigInt("0x100000000000000000000000000000000"),re=A(W*x,T),xe=A(-d*x,T);let be=(0,n.mod)(x-re*B-xe*k,T),ge=(0,n.mod)(-re*d-xe*W,T);const tt=be>K,Ue=ge>K;if(tt&&(be=T-be),Ue&&(ge=T-ge),be>K||ge>K)throw new Error("splitScalar: Endomorphism failed, k="+x);return{k1neg:tt,k1:be,k2neg:Ue,k2:ge}}}},t.sha256);const M=BigInt(0),P=x=>typeof x=="bigint"&&Mtypeof x=="bigint"&&Mk.charCodeAt(0)));B=(0,s.concatBytes)(d,d),F[x]=B}return(0,t.sha256)((0,s.concatBytes)(B,...T))}const $=x=>x.toRawBytes(!0).slice(1),q=x=>(0,s.numberToBytesBE)(x,32),G=x=>(0,n.mod)(x,c),Z=x=>(0,n.mod)(x,u),z=e.secp256k1.ProjectivePoint,ee=(x,T,B)=>z.BASE.multiplyAndAddUnsafe(x,T,B);function se(x){let T=e.secp256k1.utils.normPrivateKeyToScalar(x),B=z.fromPrivateKey(T);return{scalar:B.hasEvenY()?T:Z(-T),bytes:$(B)}}function Q(x){if(!P(x))throw new Error("bad x: need 0 < x < p");const T=G(x*x),B=G(T*x+BigInt(7));let d=v(B);d%y!==M&&(d=G(-d));const k=new z(x,d,l);return k.assertValidity(),k}function I(...x){return Z((0,s.bytesToNumberBE)(N("BIP0340/challenge",...x)))}function g(x){return se(x).bytes}function f(x,T,B=(0,r.randomBytes)(32)){const d=(0,s.ensureBytes)("message",x),{bytes:k,scalar:W}=se(T),K=(0,s.ensureBytes)("auxRand",B,32),re=q(W^(0,s.bytesToNumberBE)(N("BIP0340/aux",K))),xe=N("BIP0340/nonce",re,k,d),be=Z((0,s.bytesToNumberBE)(xe));if(be===M)throw new Error("sign failed: k is zero");const{bytes:ge,scalar:tt}=se(be),Ue=I(ge,k,d),Pe=new Uint8Array(64);if(Pe.set(ge,0),Pe.set(q(Z(tt+Ue*W)),32),!h(Pe,d,k))throw new Error("sign: Invalid signature produced");return Pe}function h(x,T,B){const d=(0,s.ensureBytes)("signature",x,64),k=(0,s.ensureBytes)("message",T),W=(0,s.ensureBytes)("publicKey",B,32);try{const K=Q((0,s.bytesToNumberBE)(W)),re=(0,s.bytesToNumberBE)(d.subarray(0,32));if(!P(re))return!1;const xe=(0,s.bytesToNumberBE)(d.subarray(32,64));if(!H(xe))return!1;const be=I(q(re),$(K),k),ge=ee(K,xe,Z(-be));return!(!ge||!ge.hasEvenY()||ge.toAffine().x!==re)}catch{return!1}}e.schnorr=(()=>({getPublicKey:g,sign:f,verify:h,utils:{randomPrivateKey:e.secp256k1.utils.randomPrivateKey,lift_x:Q,pointToBytes:$,numberToBytesBE:s.numberToBytesBE,bytesToNumberBE:s.bytesToNumberBE,taggedHash:N,mod:n.mod}}))();const m=(()=>(0,o.isogenyMap)(R,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(x=>x.map(T=>BigInt(T)))))(),_=(()=>(0,i.mapToCurveSimpleSWU)(R,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:R.create(BigInt("-11"))}))(),E=(()=>(0,o.createHasher)(e.secp256k1.ProjectivePoint,x=>{const{x:T,y:B}=_(R.create(x[0]));return m(T,B)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:R.ORDER,m:1,k:128,expand:"xmd",hash:t.sha256}))();e.hashToCurve=(()=>E.hashToCurve)(),e.encodeToCurve=(()=>E.encodeToCurve)()}(ey),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.secp256k1=void 0;var t=ey;Object.defineProperty(e,"secp256k1",{enumerable:!0,get:function(){return t.secp256k1}})}(nu),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MAX_WITHDRAWALS_PER_PAYLOAD=e.RLP_EMPTY_STRING=e.KECCAK256_RLP=e.KECCAK256_RLP_S=e.KECCAK256_RLP_ARRAY=e.KECCAK256_RLP_ARRAY_S=e.KECCAK256_NULL=e.KECCAK256_NULL_S=e.TWO_POW256=e.SECP256K1_ORDER_DIV_2=e.SECP256K1_ORDER=e.MAX_INTEGER_BIGINT=e.MAX_INTEGER=e.MAX_UINT64=void 0;const t=ie,r=nu;e.MAX_UINT64=BigInt("0xffffffffffffffff"),e.MAX_INTEGER=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),e.MAX_INTEGER_BIGINT=BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"),e.SECP256K1_ORDER=r.secp256k1.CURVE.n,e.SECP256K1_ORDER_DIV_2=r.secp256k1.CURVE.n/BigInt(2),e.TWO_POW256=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),e.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",e.KECCAK256_NULL=t.Buffer.from(e.KECCAK256_NULL_S,"hex"),e.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",e.KECCAK256_RLP_ARRAY=t.Buffer.from(e.KECCAK256_RLP_ARRAY_S,"hex"),e.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",e.KECCAK256_RLP=t.Buffer.from(e.KECCAK256_RLP_S,"hex"),e.RLP_EMPTY_STRING=t.Buffer.from([128]),e.MAX_WITHDRAWALS_PER_PAYLOAD=16}(ru);var uu={};Object.defineProperty(uu,"__esModule",{value:!0}),uu.GWEI_TO_WEI=void 0,uu.GWEI_TO_WEI=BigInt(1e9);var ad={},vi={};Object.defineProperty(vi,"__esModule",{value:!0}),vi.RLP=vi.utils=vi.decode=vi.encode=void 0;function cd(e){if(Array.isArray(e)){const r=[];let n=0;for(let i=0;ie.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return e.slice(t,r)}function By(e){if(e[0]===0)throw new Error("invalid RLP: extra zeros");return ky(Ty(e))}function Iy(e,t){if(e<56)return Uint8Array.from([e+t]);const r=ld(e),n=r.length/2,i=ld(t+55+n);return Uint8Array.from(lu(i+r))}function Ry(e,t=!1){if(typeof e>"u"||e===null||e.length===0)return Uint8Array.from([]);const r=$y(e),n=fd(r);if(t)return n;if(n.remainder.length!==0)throw new Error("invalid RLP: remainder must be zero");return n.data}vi.decode=Ry;function fd(e){let t,r,n,i,s;const o=[],a=e[0];if(a<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(a<=183){if(t=a-127,a===128?n=Uint8Array.from([]):n=ea(e,1,t),t===2&&n[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:n,remainder:e.slice(t)}}else if(a<=191){if(r=a-182,e.length-1e.length)throw new Error("invalid RLP: total length is larger than the data");for(i=ea(e,r,c);i.length;)s=fd(i),o.push(s.data),i=s.remainder;return{data:o,remainder:e.slice(c)}}}const GB=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Ty(e){let t="";for(let r=0;rn+i.length,0),r=new Uint8Array(t);for(let n=0,i=0;n=2&&e[0]==="0"&&e[1]==="x"}function XB(e){return typeof e!="string"?e:Ly(e)?e.slice(2):e}function $y(e){if(e instanceof Uint8Array)return e;if(typeof e=="string")return Ly(e)?lu(YB(XB(e))):Cy(e);if(typeof e=="number"||typeof e=="bigint")return e?lu(ld(e)):Uint8Array.from([]);if(e==null)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof e)}vi.utils={bytesToHex:Ty,concatBytes:ud,hexToBytes:lu,utf8ToBytes:Cy},vi.RLP={encode:cd,decode:Ry};var qn={},Qt={},ot={};Object.defineProperty(ot,"__esModule",{value:!0}),ot.add5L=ot.add5H=ot.add4H=ot.add4L=ot.add3H=ot.add3L=ot.add=ot.rotlBL=ot.rotlBH=ot.rotlSL=ot.rotlSH=ot.rotr32L=ot.rotr32H=ot.rotrBL=ot.rotrBH=ot.rotrSL=ot.rotrSH=ot.shrSL=ot.shrSH=ot.toBig=ot.split=ot.fromBig=void 0;const hu=BigInt(2**32-1),hd=BigInt(32);function dd(e,t=!1){return t?{h:Number(e&hu),l:Number(e>>hd&hu)}:{h:Number(e>>hd&hu)|0,l:Number(e&hu)|0}}ot.fromBig=dd;function My(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;iBigInt(e>>>0)<>>0);ot.toBig=Oy;const Ny=(e,t,r)=>e>>>r;ot.shrSH=Ny;const Py=(e,t,r)=>e<<32-r|t>>>r;ot.shrSL=Py;const Uy=(e,t,r)=>e>>>r|t<<32-r;ot.rotrSH=Uy;const Fy=(e,t,r)=>e<<32-r|t>>>r;ot.rotrSL=Fy;const Dy=(e,t,r)=>e<<64-r|t>>>r-32;ot.rotrBH=Dy;const Hy=(e,t,r)=>e>>>r-32|t<<64-r;ot.rotrBL=Hy;const jy=(e,t)=>t;ot.rotr32H=jy;const zy=(e,t)=>e;ot.rotr32L=zy;const qy=(e,t,r)=>e<>>32-r;ot.rotlSH=qy;const Vy=(e,t,r)=>t<>>32-r;ot.rotlSL=Vy;const Wy=(e,t,r)=>t<>>64-r;ot.rotlBH=Wy;const Ky=(e,t,r)=>e<>>64-r;ot.rotlBL=Ky;function Zy(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}ot.add=Zy;const Gy=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);ot.add3L=Gy;const Yy=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;ot.add3H=Yy;const Xy=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);ot.add4L=Xy;const Jy=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;ot.add4H=Jy;const Qy=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);ot.add5L=Qy;const ew=(e,t,r,n,i,s)=>t+r+n+i+s+(e/2**32|0)|0;ot.add5H=ew;const JB={fromBig:dd,split:My,toBig:Oy,shrSH:Ny,shrSL:Py,rotrSH:Uy,rotrSL:Fy,rotrBH:Dy,rotrBL:Hy,rotr32H:jy,rotr32L:zy,rotlSH:qy,rotlSL:Vy,rotlBH:Wy,rotlBL:Ky,add:Zy,add3L:Gy,add3H:Yy,add4L:Xy,add4H:Jy,add5H:ew,add5L:Qy};ot.default=JB,Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.shake256=Qt.shake128=Qt.keccak_512=Qt.keccak_384=Qt.keccak_256=Qt.keccak_224=Qt.sha3_512=Qt.sha3_384=Qt.sha3_256=Qt.sha3_224=Qt.Keccak=Qt.keccakP=void 0;const ta=Hr,Ja=ot,Qa=Ui,[tw,rw,nw]=[[],[],[]],QB=BigInt(0),ec=BigInt(1),eI=BigInt(2),tI=BigInt(7),rI=BigInt(256),nI=BigInt(113);for(let e=0,t=ec,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],tw.push(2*(5*n+r)),rw.push((e+1)*(e+2)/2%64);let i=QB;for(let s=0;s<7;s++)t=(t<>tI)*nI)%rI,t&eI&&(i^=ec<<(ec<r>32?(0,Ja.rotlBH)(e,t,r):(0,Ja.rotlSH)(e,t,r),sw=(e,t,r)=>r>32?(0,Ja.rotlBL)(e,t,r):(0,Ja.rotlSL)(e,t,r);function ow(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let o=0;o<10;o++)r[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,u=r[c],l=r[c+1],y=iw(u,l,1)^r[a],A=sw(u,l,1)^r[a+1];for(let v=0;v<50;v+=10)e[o+v]^=y,e[o+v+1]^=A}let i=e[2],s=e[3];for(let o=0;o<24;o++){const a=rw[o],c=iw(i,s,a),u=sw(i,s,a),l=tw[o];i=e[l],s=e[l+1],e[l]=c,e[l+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=e[o+a];for(let a=0;a<10;a++)e[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}e[0]^=iI[n],e[1]^=sI[n]}r.fill(0)}Qt.keccakP=ow;class tc extends Qa.Hash{constructor(t,r,n,i=!1,s=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,ta.number)(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,Qa.u32)(this.state)}keccak(){ow(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){(0,ta.exists)(this);const{blockLen:r,state:n}=this;t=(0,Qa.toBytes)(t);const i=t.length;for(let s=0;s=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);t.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,ta.number)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,ta.output)(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return t||(t=new tc(r,n,i,o,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=n,t.outputLen=i,t.enableXOF=o,t.destroyed=this.destroyed,t}}Qt.Keccak=tc;const ys=(e,t,r)=>(0,Qa.wrapConstructor)(()=>new tc(t,e,r));Qt.sha3_224=ys(6,144,224/8),Qt.sha3_256=ys(6,136,256/8),Qt.sha3_384=ys(6,104,384/8),Qt.sha3_512=ys(6,72,512/8),Qt.keccak_224=ys(1,144,224/8),Qt.keccak_256=ys(1,136,256/8),Qt.keccak_384=ys(1,104,384/8),Qt.keccak_512=ys(1,72,512/8);const aw=(e,t,r)=>(0,Qa.wrapXOFConstructorWithOpts)((n={})=>new tc(t,e,n.dkLen===void 0?r:n.dkLen,!0));Qt.shake128=aw(31,168,128/8),Qt.shake256=aw(31,136,256/8);function pd(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var du={exports:{}};(function(e,t){var r=ft&&ft.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=t.wrapHash=t.equalsBytes=t.hexToBytes=t.bytesToUtf8=t.utf8ToBytes=t.createView=t.concatBytes=t.toHex=t.bytesToHex=t.assertBytes=t.assertBool=void 0;const n=r(Hr),i=Ui,s=n.default.bool;t.assertBool=s;const o=n.default.bytes;t.assertBytes=o;var a=Ui;Object.defineProperty(t,"bytesToHex",{enumerable:!0,get:function(){return a.bytesToHex}}),Object.defineProperty(t,"toHex",{enumerable:!0,get:function(){return a.bytesToHex}}),Object.defineProperty(t,"concatBytes",{enumerable:!0,get:function(){return a.concatBytes}}),Object.defineProperty(t,"createView",{enumerable:!0,get:function(){return a.createView}}),Object.defineProperty(t,"utf8ToBytes",{enumerable:!0,get:function(){return a.utf8ToBytes}});function c(A){if(!(A instanceof Uint8Array))throw new TypeError(`bytesToUtf8 expected Uint8Array, got ${typeof A}`);return new TextDecoder().decode(A)}t.bytesToUtf8=c;function u(A){const v=A.startsWith("0x")?A.substring(2):A;return(0,i.hexToBytes)(v)}t.hexToBytes=u;function l(A,v){if(A.length!==v.length)return!1;for(let R=0;R(n.default.bytes(v),A(v))}t.wrapHash=y,t.crypto=(()=>{const A=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,v=typeof pd=="function"&&pd.bind(e);return{node:v&&!A?v("crypto"):void 0,web:A}})()})(du,du.exports),Object.defineProperty(qn,"__esModule",{value:!0}),qn.keccak512=qn.keccak384=qn.keccak256=qn.keccak224=void 0;const rc=Qt,pu=du.exports;qn.keccak224=(0,pu.wrapHash)(rc.keccak_224),qn.keccak256=(()=>{const e=(0,pu.wrapHash)(rc.keccak_256);return e.create=rc.keccak_256.create,e})(),qn.keccak384=(0,pu.wrapHash)(rc.keccak_384),qn.keccak512=(0,pu.wrapHash)(rc.keccak_512);var to={},Vn={},er={};Object.defineProperty(er,"__esModule",{value:!0}),er.isHexString=er.getKeys=er.fromAscii=er.fromUtf8=er.toAscii=er.arrayContainsArray=er.getBinarySize=er.padToEven=er.stripHexPrefix=er.isHexPrefixed=void 0;function cw(e){if(typeof e!="string")throw new Error(`[isHexPrefixed] input must be type 'string', received type ${typeof e}`);return e[0]==="0"&&e[1]==="x"}er.isHexPrefixed=cw;const oI=e=>{if(typeof e!="string")throw new Error(`[stripHexPrefix] input must be type 'string', received ${typeof e}`);return cw(e)?e.slice(2):e};er.stripHexPrefix=oI;function fw(e){let t=e;if(typeof t!="string")throw new Error(`[padToEven] value must be type 'string', received ${typeof t}`);return t.length%2&&(t=`0${t}`),t}er.padToEven=fw;function aI(e){if(typeof e!="string")throw new Error(`[getBinarySize] method requires input type 'string', received ${typeof e}`);return ie.Buffer.byteLength(e,"utf8")}er.getBinarySize=aI;function cI(e,t,r){if(Array.isArray(e)!==!0)throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof e}'`);if(Array.isArray(t)!==!0)throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof t}'`);return t[r===!0?"some":"every"](n=>e.indexOf(n)>=0)}er.arrayContainsArray=cI;function fI(e){let t="",r=0;const n=e.length;for(e.substring(0,2)==="0x"&&(r=2);r0&&e.length!==2+2*t)}er.isHexString=dI,Object.defineProperty(Vn,"__esModule",{value:!0}),Vn.assertIsString=Vn.assertIsArray=Vn.assertIsBuffer=Vn.assertIsHexString=void 0;const pI=er,gI=function(e){if(!(0,pI.isHexString)(e)){const t=`This method only supports 0x-prefixed hex strings but input was: ${e}`;throw new Error(t)}};Vn.assertIsHexString=gI;const yI=function(e){if(!ie.Buffer.isBuffer(e)){const t=`This method only supports Buffer but input was: ${e}`;throw new Error(t)}};Vn.assertIsBuffer=yI;const wI=function(e){if(!Array.isArray(e)){const t=`This method only supports number arrays but input was: ${e}`;throw new Error(t)}};Vn.assertIsArray=wI;const mI=function(e){if(typeof e!="string"){const t=`This method only supports strings but input was: ${e}`;throw new Error(t)}};Vn.assertIsString=mI,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.intToUnpaddedBuffer=e.bigIntToUnpaddedBuffer=e.bigIntToHex=e.bufArrToArr=e.arrToBufArr=e.validateNoLeadingZeroes=e.baToJSON=e.toUtf8=e.short=e.addHexPrefix=e.toUnsigned=e.fromSigned=e.bufferToInt=e.bigIntToBuffer=e.bufferToBigInt=e.bufferToHex=e.toBuffer=e.unpadHexString=e.unpadArray=e.unpadBuffer=e.setLengthRight=e.setLengthLeft=e.zeros=e.intToBuffer=e.intToHex=void 0;const t=Vn,r=er,n=function(f){if(!Number.isSafeInteger(f)||f<0)throw new Error(`Received an invalid integer type: ${f}`);return`0x${f.toString(16)}`};e.intToHex=n;const i=function(f){const h=(0,e.intToHex)(f);return ie.Buffer.from((0,r.padToEven)(h.slice(2)),"hex")};e.intToBuffer=i;const s=function(f){return ie.Buffer.allocUnsafe(f).fill(0)};e.zeros=s;const o=function(f,h,m){const _=(0,e.zeros)(h);return m?f.length0&&h.toString()==="0";)f=f.slice(1),h=f[0];return f},l=function(f){return(0,t.assertIsBuffer)(f),u(f)};e.unpadBuffer=l;const y=function(f){return(0,t.assertIsArray)(f),u(f)};e.unpadArray=y;const A=function(f){return(0,t.assertIsHexString)(f),f=(0,r.stripHexPrefix)(f),"0x"+u(f)};e.unpadHexString=A;const v=function(f){if(f==null)return ie.Buffer.allocUnsafe(0);if(ie.Buffer.isBuffer(f)||Array.isArray(f)||f instanceof Uint8Array)return ie.Buffer.from(f);if(typeof f=="string"){if(!(0,r.isHexString)(f))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${f}`);return ie.Buffer.from((0,r.padToEven)((0,r.stripHexPrefix)(f)),"hex")}if(typeof f=="number")return(0,e.intToBuffer)(f);if(typeof f=="bigint"){if(f0&&m[0]===0)throw new Error(`${h} cannot have leading zeroes, received: ${m.toString("hex")}`)};e.validateNoLeadingZeroes=z;function ee(f){return Array.isArray(f)?f.map(h=>ee(h)):ie.Buffer.from(f)}e.arrToBufArr=ee;function se(f){return Array.isArray(f)?f.map(h=>se(h)):Uint8Array.from(f??[])}e.bufArrToArr=se;const Q=f=>"0x"+f.toString(16);e.bigIntToHex=Q;function I(f){return(0,e.unpadBuffer)(P(f))}e.bigIntToUnpaddedBuffer=I;function g(f){return(0,e.unpadBuffer)((0,e.intToBuffer)(f))}e.intToUnpaddedBuffer=g}(to),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.accountBodyToRLP=e.accountBodyToSlim=e.accountBodyFromSlim=e.isZeroAddress=e.zeroAddress=e.importPublic=e.privateToAddress=e.privateToPublic=e.publicToAddress=e.pubToAddress=e.isValidPublic=e.isValidPrivate=e.generateAddress2=e.generateAddress=e.isValidChecksumAddress=e.toChecksumAddress=e.isValidAddress=e.Account=void 0;const t=vi,r=qn,n=nu,i=du.exports,s=to,o=ru,a=Vn,c=er,u=BigInt(0);class l{constructor(g=u,f=u,h=o.KECCAK256_RLP,m=o.KECCAK256_NULL){this.nonce=g,this.balance=f,this.storageRoot=h,this.codeHash=m,this._validate()}static fromAccountData(g){const{nonce:f,balance:h,storageRoot:m,codeHash:_}=g;return new l(f!==void 0?(0,s.bufferToBigInt)((0,s.toBuffer)(f)):void 0,h!==void 0?(0,s.bufferToBigInt)((0,s.toBuffer)(h)):void 0,m!==void 0?(0,s.toBuffer)(m):void 0,_!==void 0?(0,s.toBuffer)(_):void 0)}static fromRlpSerializedAccount(g){const f=(0,s.arrToBufArr)(t.RLP.decode(Uint8Array.from(g)));if(!Array.isArray(f))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(f)}static fromValuesArray(g){const[f,h,m,_]=g;return new l((0,s.bufferToBigInt)(f),(0,s.bufferToBigInt)(h),m,_)}_validate(){if(this.nonce=8?E+=f[x].toUpperCase():E+=f[x];return E};e.toChecksumAddress=A;const v=function(I,g){return(0,e.isValidAddress)(I)&&(0,e.toChecksumAddress)(I,g)===I};e.isValidChecksumAddress=v;const R=function(I,g){return(0,a.assertIsBuffer)(I),(0,a.assertIsBuffer)(g),(0,s.bufferToBigInt)(g)===BigInt(0)?ie.Buffer.from((0,r.keccak256)(t.RLP.encode((0,s.bufArrToArr)([I,null])))).slice(-20):ie.Buffer.from((0,r.keccak256)(t.RLP.encode((0,s.bufArrToArr)([I,g])))).slice(-20)};e.generateAddress=R;const M=function(I,g,f){if((0,a.assertIsBuffer)(I),(0,a.assertIsBuffer)(g),(0,a.assertIsBuffer)(f),I.length!==20)throw new Error("Expected from to be of length 20");if(g.length!==32)throw new Error("Expected salt to be of length 32");const h=(0,r.keccak256)(ie.Buffer.concat([ie.Buffer.from("ff","hex"),I,g,(0,r.keccak256)(f)]));return(0,s.toBuffer)(h).slice(-20)};e.generateAddress2=M;const P=function(I){return n.secp256k1.utils.isValidPrivateKey(I)};e.isValidPrivate=P;const H=function(I,g=!1){if((0,a.assertIsBuffer)(I),I.length===64)try{return n.secp256k1.ProjectivePoint.fromHex(ie.Buffer.concat([ie.Buffer.from([4]),I])),!0}catch{return!1}if(!g)return!1;try{return n.secp256k1.ProjectivePoint.fromHex(I),!0}catch{return!1}};e.isValidPublic=H;const F=function(I,g=!1){if((0,a.assertIsBuffer)(I),g&&I.length!==64&&(I=ie.Buffer.from(n.secp256k1.ProjectivePoint.fromHex(I).toRawBytes(!1).slice(1))),I.length!==64)throw new Error("Expected pubKey to be of length 64");return ie.Buffer.from((0,r.keccak256)(I)).slice(-20)};e.pubToAddress=F,e.publicToAddress=e.pubToAddress;const N=function(I){return(0,a.assertIsBuffer)(I),ie.Buffer.from(n.secp256k1.ProjectivePoint.fromPrivateKey(I).toRawBytes(!1).slice(1))};e.privateToPublic=N;const $=function(I){return(0,e.publicToAddress)((0,e.privateToPublic)(I))};e.privateToAddress=$;const q=function(I){return(0,a.assertIsBuffer)(I),I.length!==64&&(I=ie.Buffer.from(n.secp256k1.ProjectivePoint.fromHex(I).toRawBytes(!1).slice(1))),I};e.importPublic=q;const G=function(){const g=(0,s.zeros)(20);return(0,s.bufferToHex)(g)};e.zeroAddress=G;const Z=function(I){try{(0,a.assertIsString)(I)}catch{return!1}return(0,e.zeroAddress)()===I};e.isZeroAddress=Z;function z(I){const[g,f,h,m]=I;return[g,f,(0,s.arrToBufArr)(h).length===0?o.KECCAK256_RLP:h,(0,s.arrToBufArr)(m).length===0?o.KECCAK256_NULL:m]}e.accountBodyFromSlim=z;const ee=new Uint8Array(0);function se(I){const[g,f,h,m]=I;return[g,f,(0,s.arrToBufArr)(h).equals(o.KECCAK256_RLP)?ee:h,(0,s.arrToBufArr)(m).equals(o.KECCAK256_NULL)?ee:m]}e.accountBodyToSlim=se;function Q(I,g=!0){const f=g?z(I):I;return(0,s.arrToBufArr)(t.RLP.encode(f))}e.accountBodyToRLP=Q}(ad);var nc={};Object.defineProperty(nc,"__esModule",{value:!0}),nc.Address=void 0;const ic=ad,gu=to;class Di{constructor(t){if(t.length!==20)throw new Error("Invalid address length");this.buf=t}static zero(){return new Di((0,gu.zeros)(20))}static fromString(t){if(!(0,ic.isValidAddress)(t))throw new Error("Invalid address");return new Di((0,gu.toBuffer)(t))}static fromPublicKey(t){if(!ie.Buffer.isBuffer(t))throw new Error("Public key should be Buffer");const r=(0,ic.pubToAddress)(t);return new Di(r)}static fromPrivateKey(t){if(!ie.Buffer.isBuffer(t))throw new Error("Private key should be Buffer");const r=(0,ic.privateToAddress)(t);return new Di(r)}static generate(t,r){if(typeof r!="bigint")throw new Error("Expected nonce to be a bigint");return new Di((0,ic.generateAddress)(t.buf,(0,gu.bigIntToBuffer)(r)))}static generate2(t,r,n){if(!ie.Buffer.isBuffer(r))throw new Error("Expected salt to be a Buffer");if(!ie.Buffer.isBuffer(n))throw new Error("Expected initCode to be a Buffer");return new Di((0,ic.generateAddress2)(t.buf,r,n))}equals(t){return this.buf.equals(t.buf)}isZero(){return this.equals(Di.zero())}isPrecompileOrSystemAddress(){const t=(0,gu.bufferToBigInt)(this.buf),r=BigInt(0),n=BigInt("0xffff");return t>=r&&t<=n}toString(){return"0x"+this.buf.toString("hex")}toBuffer(){return ie.Buffer.from(this.buf)}}nc.Address=Di;var yu={},gd={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toType=e.TypeOutput=void 0;const t=to,r=er;var n;(function(s){s[s.Number=0]="Number",s[s.BigInt=1]="BigInt",s[s.Buffer=2]="Buffer",s[s.PrefixedHexString=3]="PrefixedHexString"})(n=e.TypeOutput||(e.TypeOutput={}));function i(s,o){if(s===null)return null;if(s===void 0)return;if(typeof s=="string"&&!(0,r.isHexString)(s))throw new Error(`A string must be provided with a 0x-prefix, given: ${s}`);if(typeof s=="number"&&!Number.isSafeInteger(s))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const a=(0,t.toBuffer)(s);switch(o){case n.Buffer:return a;case n.BigInt:return(0,t.bufferToBigInt)(a);case n.Number:{const c=(0,t.bufferToBigInt)(a);if(c>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(c)}case n.PrefixedHexString:return(0,t.bufferToHex)(a);default:throw new Error("unknown outputType")}}e.toType=i})(gd),Object.defineProperty(yu,"__esModule",{value:!0}),yu.Withdrawal=void 0;const uw=nc,yd=to,br=gd;class sc{constructor(t,r,n,i){this.index=t,this.validatorIndex=r,this.address=n,this.amount=i}static fromWithdrawalData(t){const{index:r,validatorIndex:n,address:i,amount:s}=t,o=(0,br.toType)(r,br.TypeOutput.BigInt),a=(0,br.toType)(n,br.TypeOutput.BigInt),c=new uw.Address((0,br.toType)(i,br.TypeOutput.Buffer)),u=(0,br.toType)(s,br.TypeOutput.BigInt);return new sc(o,a,c,u)}static fromValuesArray(t){if(t.length!==4)throw Error(`Invalid withdrawalArray length expected=4 actual=${t.length}`);const[r,n,i,s]=t;return sc.fromWithdrawalData({index:r,validatorIndex:n,address:i,amount:s})}static toBufferArray(t){const{index:r,validatorIndex:n,address:i,amount:s}=t,o=(0,br.toType)(r,br.TypeOutput.BigInt)===BigInt(0)?ie.Buffer.alloc(0):(0,br.toType)(r,br.TypeOutput.Buffer),a=(0,br.toType)(n,br.TypeOutput.BigInt)===BigInt(0)?ie.Buffer.alloc(0):(0,br.toType)(n,br.TypeOutput.Buffer);let c;i instanceof uw.Address?c=i.buf:c=(0,br.toType)(i,br.TypeOutput.Buffer);const u=(0,br.toType)(s,br.TypeOutput.BigInt)===BigInt(0)?ie.Buffer.alloc(0):(0,br.toType)(s,br.TypeOutput.Buffer);return[o,a,c,u]}raw(){return sc.toBufferArray(this)}toValue(){return{index:this.index,validatorIndex:this.validatorIndex,address:this.address.buf,amount:this.amount}}toJSON(){return{index:(0,yd.bigIntToHex)(this.index),validatorIndex:(0,yd.bigIntToHex)(this.validatorIndex),address:"0x"+this.address.buf.toString("hex"),amount:(0,yd.bigIntToHex)(this.amount)}}}yu.Withdrawal=sc;var an={};Object.defineProperty(an,"__esModule",{value:!0}),an.hashPersonalMessage=an.isValidSignature=an.fromRpcSig=an.toCompactSig=an.toRpcSig=an.ecrecover=an.ecsign=void 0;const bI=qn,lw=nu,bn=to,wd=ru,vI=Vn;function _I(e,t,r){const n=lw.secp256k1.sign(e,t),i=n.toCompactRawBytes(),s=ie.Buffer.from(i.slice(0,32)),o=ie.Buffer.from(i.slice(32,64)),a=r===void 0?BigInt(n.recovery+27):BigInt(n.recovery+35)+BigInt(r)*BigInt(2);return{r:s,s:o,v:a}}an.ecsign=_I;function wu(e,t){return e===BigInt(0)||e===BigInt(1)?e:t===void 0?e-BigInt(27):e-(t*BigInt(2)+BigInt(35))}function mu(e){return e===BigInt(0)||e===BigInt(1)}const EI=function(e,t,r,n,i){const s=ie.Buffer.concat([(0,bn.setLengthLeft)(r,32),(0,bn.setLengthLeft)(n,32)],64),o=wu(t,i);if(!mu(o))throw new Error("Invalid signature v value");const c=lw.secp256k1.Signature.fromCompact(s).addRecoveryBit(Number(o)).recoverPublicKey(e);return ie.Buffer.from(c.toRawBytes(!1).slice(1))};an.ecrecover=EI;const xI=function(e,t,r,n){const i=wu(e,n);if(!mu(i))throw new Error("Invalid signature v value");return(0,bn.bufferToHex)(ie.Buffer.concat([(0,bn.setLengthLeft)(t,32),(0,bn.setLengthLeft)(r,32),(0,bn.toBuffer)(e)]))};an.toRpcSig=xI;const SI=function(e,t,r,n){const i=wu(e,n);if(!mu(i))throw new Error("Invalid signature v value");let s=r;return(e>BigInt(28)&&e%BigInt(2)===BigInt(1)||e===BigInt(1)||e===BigInt(28))&&(s=ie.Buffer.from(r),s[0]|=128),(0,bn.bufferToHex)(ie.Buffer.concat([(0,bn.setLengthLeft)(t,32),(0,bn.setLengthLeft)(s,32)]))};an.toCompactSig=SI;const AI=function(e){const t=(0,bn.toBuffer)(e);let r,n,i;if(t.length>=65)r=t.slice(0,32),n=t.slice(32,64),i=(0,bn.bufferToBigInt)(t.slice(64));else if(t.length===64)r=t.slice(0,32),n=t.slice(32,64),i=BigInt((0,bn.bufferToInt)(t.slice(32,33))>>7),n[0]&=127;else throw new Error("Invalid signature length");return i<27&&(i=i+BigInt(27)),{v:i,r,s:n}};an.fromRpcSig=AI;const BI=function(e,t,r,n=!0,i){if(t.length!==32||r.length!==32||!mu(wu(e,i)))return!1;const s=(0,bn.bufferToBigInt)(t),o=(0,bn.bufferToBigInt)(r);return!(s===BigInt(0)||s>=wd.SECP256K1_ORDER||o===BigInt(0)||o>=wd.SECP256K1_ORDER||n&&o>=wd.SECP256K1_ORDER_DIV_2)};an.isValidSignature=BI;const II=function(e){(0,vI.assertIsBuffer)(e);const t=ie.Buffer.from(`Ethereum Signed Message: +${e.length}`,"utf-8");return ie.Buffer.from((0,bI.keccak256)(ie.Buffer.concat([t,e])))};an.hashPersonalMessage=II;var hw={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.compactBytesToNibbles=e.bytesToNibbles=e.nibblesToCompactBytes=e.nibblesToBytes=e.hasTerminator=void 0;const t=o=>o.length>0&&o[o.length-1]===16;e.hasTerminator=t;const r=(o,a)=>{for(let c=0,u=0;u{let a=0;(0,e.hasTerminator)(o)&&(a=1,o=o.subarray(0,o.length-1));const c=new Uint8Array(o.length/2+1);return c[0]=a<<5,(o.length&1)===1&&(c[0]|=16,c[0]|=o[0],o=o.subarray(1)),(0,e.nibblesToBytes)(o,c.subarray(1)),c};e.nibblesToCompactBytes=n;const i=o=>{const a=o.length*2+1,c=new Uint8Array(a);for(let u=0;u{if(o.length===0)return o;let a=(0,e.bytesToNibbles)(o);a[0]<2&&(a=a.subarray(0,a.length-1));const c=2-(a[0]&1);return a.subarray(c)};e.compactBytesToNibbles=s})(hw);var bu={};Object.defineProperty(bu,"__esModule",{value:!0}),bu.AsyncEventEmitter=void 0;const RI=Un.exports;async function TI(e,t,r){let n;for await(const i of t)try{i.length<2?i.call(e,r):await new Promise((s,o)=>{i.call(e,r,a=>{a?o(a):s()})})}catch(s){n=s}if(n)throw n}class kI extends RI.EventEmitter{emit(t,...r){let[n,i]=r;const s=this;let o=s._events[t]??[];return i===void 0&&typeof n=="function"&&(i=n,n=void 0),(t==="newListener"||t==="removeListener")&&(n={event:n,fn:i},i=void 0),o=Array.isArray(o)?o:[o],TI(s,o.slice(),n).then(i).catch(i),s.listenerCount(t)>0}once(t,r){const n=this;let i;if(typeof r!="function")throw new TypeError("listener must be a function");return r.length>=2?i=function(s,o){n.removeListener(t,i),r(s,o)}:i=function(s){n.removeListener(t,i),r(s,i)},n.on(t,i),n}first(t,r){let n=this._events[t]??[];if(typeof r!="function")throw new TypeError("listener must be a function");return Array.isArray(n)||(this._events[t]=n=[n]),n.unshift(r),this}before(t,r,n){return this.beforeOrAfter(t,r,n)}after(t,r,n){return this.beforeOrAfter(t,r,n,"after")}beforeOrAfter(t,r,n,i){let s=this._events[t]??[],o,a;const c=i==="after"?1:0;if(typeof n!="function")throw new TypeError("listener must be a function");if(typeof r!="function")throw new TypeError("target must be a function");for(Array.isArray(s)||(this._events[t]=s=[s]),a=s.length,o=s.length;o--;)if(s[o]===r){a=o+c;break}return s.splice(a,0,n),this}on(t,r){return super.on(t,r)}addListener(t,r){return super.addListener(t,r)}prependListener(t,r){return super.prependListener(t,r)}prependOnceListener(t,r){return super.prependOnceListener(t,r)}removeAllListeners(t){return super.removeAllListeners(t)}removeListener(t,r){return super.removeListener(t,r)}eventNames(){return super.eventNames()}listeners(t){return super.listeners(t)}listenerCount(t){return super.listenerCount(t)}getMaxListeners(){return super.getMaxListeners()}setMaxListeners(t){return super.setMaxListeners(t)}}bu.AsyncEventEmitter=kI;var vu={};Object.defineProperty(vu,"__esModule",{value:!0}),vu.Lock=void 0;class CI{constructor(){this.permits=1,this.promiseResolverQueue=[]}async acquire(){return this.permits>0?(this.permits-=1,Promise.resolve(!0)):new Promise(t=>this.promiseResolverQueue.push(t))}release(){if(this.permits+=1,this.permits>1&&this.promiseResolverQueue.length>0)console.warn("Lock.permits should never be > 0 when there is someone waiting.");else if(this.permits===1&&this.promiseResolverQueue.length>0){this.permits-=1;const t=this.promiseResolverQueue.shift();t&&t(!0)}}}vu.Lock=CI;var ra={},ro={},pr=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},_i=[],Wn=[],LI=typeof Uint8Array<"u"?Uint8Array:Array,md=!1;function dw(){md=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,r=e.length;t0)throw new Error("Invalid string. Length must be a multiple of 4");s=e[a-2]==="="?2:e[a-1]==="="?1:0,o=new LI(a*3/4-s),n=s>0?a-4:a;var c=0;for(t=0,r=0;t>16&255,o[c++]=i>>8&255,o[c++]=i&255;return s===2?(i=Wn[e.charCodeAt(t)]<<2|Wn[e.charCodeAt(t+1)]>>4,o[c++]=i&255):s===1&&(i=Wn[e.charCodeAt(t)]<<10|Wn[e.charCodeAt(t+1)]<<4|Wn[e.charCodeAt(t+2)]>>2,o[c++]=i>>8&255,o[c++]=i&255),o}function MI(e){return _i[e>>18&63]+_i[e>>12&63]+_i[e>>6&63]+_i[e&63]}function OI(e,t,r){for(var n,i=[],s=t;sc?c:a+o));return n===1?(t=e[r-1],i+=_i[t>>2],i+=_i[t<<4&63],i+="=="):n===2&&(t=(e[r-2]<<8)+e[r-1],i+=_i[t>>10],i+=_i[t>>4&63],i+=_i[t<<2&63],i+="="),s.push(i),s.join("")}function _u(e,t,r,n,i){var s,o,a=i*8-n-1,c=(1<>1,l=-7,y=r?i-1:0,A=r?-1:1,v=e[t+y];for(y+=A,s=v&(1<<-l)-1,v>>=-l,l+=a;l>0;s=s*256+e[t+y],y+=A,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;l>0;o=o*256+e[t+y],y+=A,l-=8);if(s===0)s=1-u;else{if(s===c)return o?NaN:(v?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-u}return(v?-1:1)*o*Math.pow(2,s-n)}function gw(e,t,r,n,i,s){var o,a,c,u=s*8-i-1,l=(1<>1,A=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,v=n?0:s-1,R=n?1:-1,M=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+y>=1?t+=A/c:t+=A*Math.pow(2,1-y),t*c>=2&&(o++,c/=2),o+y>=l?(a=0,o=l):o+y>=1?(a=(t*c-1)*Math.pow(2,i),o=o+y):(a=t*Math.pow(2,y-1)*Math.pow(2,i),o=0));i>=8;e[r+v]=a&255,v+=R,a/=256,i-=8);for(o=o<0;e[r+v]=o&255,v+=R,o/=256,u-=8);e[r+v-R]|=M*128}var NI={}.toString,yw=Array.isArray||function(e){return NI.call(e)=="[object Array]"};/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */var PI=50;le.TYPED_ARRAY_SUPPORT=pr.TYPED_ARRAY_SUPPORT!==void 0?pr.TYPED_ARRAY_SUPPORT:!0,Eu();function Eu(){return le.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Hi(e,t){if(Eu()=Eu())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Eu().toString(16)+" bytes");return e|0}le.isBuffer=a8;function Ei(e){return!!(e!=null&&e._isBuffer)}le.compare=function(t,r){if(!Ei(t)||!Ei(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var n=t.length,i=r.length,s=0,o=Math.min(n,i);s>>1;case"base64":return Rw(e).length;default:if(n)return Au(e).length;t=(""+t).toLowerCase(),n=!0}}le.byteLength=bw;function jI(e,t,r){var n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return JI(this,t,r);case"utf8":case"utf-8":return xw(this,t,r);case"ascii":return YI(this,t,r);case"latin1":case"binary":return XI(this,t,r);case"base64":return ZI(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return QI(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}le.prototype._isBuffer=!0;function no(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}le.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;r0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},le.prototype.compare=function(t,r,n,i,s){if(!Ei(t))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),s===void 0&&(s=this.length),r<0||n>t.length||i<0||s>this.length)throw new RangeError("out of range index");if(i>=s&&r>=n)return 0;if(i>=s)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,s>>>=0,this===t)return 0;for(var o=s-i,a=n-r,c=Math.min(o,a),u=this.slice(i,s),l=t.slice(r,n),y=0;y2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(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=le.from(t,n)),Ei(t))return t.length===0?-1:_w(e,t,r,n,i);if(typeof t=="number")return t=t&255,le.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):_w(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function _w(e,t,r,n,i){var s=1,o=e.length,a=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;s=2,o/=2,a/=2,r/=2}function c(v,R){return s===1?v[R]:v.readUInt16BE(R*s)}var u;if(i){var l=-1;for(u=r;uo&&(r=o-a),u=r;u>=0;u--){for(var y=!0,A=0;Ai&&(n=i)):n=i;var s=t.length;if(s%2!==0)throw new TypeError("Invalid hex string");n>s/2&&(n=s/2);for(var o=0;os)&&(n=s),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return zI(this,t,r,n);case"utf8":case"utf-8":return qI(this,t,r,n);case"ascii":return Ew(this,t,r,n);case"latin1":case"binary":return VI(this,t,r,n);case"base64":return WI(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return KI(this,t,r,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},le.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ZI(e,t,r){return t===0&&r===e.length?pw(e):pw(e.slice(t,r))}function xw(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:s>223?3:s>191?2:1;if(i+a<=r){var c,u,l,y;switch(a){case 1:s<128&&(o=s);break;case 2:c=e[i+1],(c&192)===128&&(y=(s&31)<<6|c&63,y>127&&(o=y));break;case 3:c=e[i+1],u=e[i+2],(c&192)===128&&(u&192)===128&&(y=(s&15)<<12|(c&63)<<6|u&63,y>2047&&(y<55296||y>57343)&&(o=y));break;case 4:c=e[i+1],u=e[i+2],l=e[i+3],(c&192)===128&&(u&192)===128&&(l&192)===128&&(y=(s&15)<<18|(c&63)<<12|(u&63)<<6|l&63,y>65535&&y<1114112&&(o=y))}}o===null?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=a}return GI(n)}var Sw=4096;function GI(e){var t=e.length;if(t<=Sw)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn)&&(r=n);for(var i="",s=t;sn&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),rr)throw new RangeError("Trying to access beyond buffer length")}le.prototype.readUIntLE=function(t,r,n){t=t|0,r=r|0,n||zr(t,r,this.length);for(var i=this[t],s=1,o=0;++o0&&(s*=256);)i+=this[t+--r]*s;return i},le.prototype.readUInt8=function(t,r){return r||zr(t,1,this.length),this[t]},le.prototype.readUInt16LE=function(t,r){return r||zr(t,2,this.length),this[t]|this[t+1]<<8},le.prototype.readUInt16BE=function(t,r){return r||zr(t,2,this.length),this[t]<<8|this[t+1]},le.prototype.readUInt32LE=function(t,r){return r||zr(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},le.prototype.readUInt32BE=function(t,r){return r||zr(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},le.prototype.readIntLE=function(t,r,n){t=t|0,r=r|0,n||zr(t,r,this.length);for(var i=this[t],s=1,o=0;++o=s&&(i-=Math.pow(2,8*r)),i},le.prototype.readIntBE=function(t,r,n){t=t|0,r=r|0,n||zr(t,r,this.length);for(var i=r,s=1,o=this[t+--i];i>0&&(s*=256);)o+=this[t+--i]*s;return s*=128,o>=s&&(o-=Math.pow(2,8*r)),o},le.prototype.readInt8=function(t,r){return r||zr(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},le.prototype.readInt16LE=function(t,r){r||zr(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n},le.prototype.readInt16BE=function(t,r){r||zr(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n},le.prototype.readInt32LE=function(t,r){return r||zr(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},le.prototype.readInt32BE=function(t,r){return r||zr(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},le.prototype.readFloatLE=function(t,r){return r||zr(t,4,this.length),_u(this,t,!0,23,4)},le.prototype.readFloatBE=function(t,r){return r||zr(t,4,this.length),_u(this,t,!1,23,4)},le.prototype.readDoubleLE=function(t,r){return r||zr(t,8,this.length),_u(this,t,!0,52,8)},le.prototype.readDoubleBE=function(t,r){return r||zr(t,8,this.length),_u(this,t,!1,52,8)};function vn(e,t,r,n,i,s){if(!Ei(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}le.prototype.writeUIntLE=function(t,r,n,i){if(t=+t,r=r|0,n=n|0,!i){var s=Math.pow(2,8*n)-1;vn(this,t,r,n,s,0)}var o=1,a=0;for(this[r]=t&255;++a=0&&(a*=256);)this[r+o]=t/a&255;return r+n},le.prototype.writeUInt8=function(t,r,n){return t=+t,r=r|0,n||vn(this,t,r,1,255,0),le.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=t&255,r+1};function xu(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,s=Math.min(e.length-r,2);i>>(n?i:1-i)*8}le.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r|0,n||vn(this,t,r,2,65535,0),le.TYPED_ARRAY_SUPPORT?(this[r]=t&255,this[r+1]=t>>>8):xu(this,t,r,!0),r+2},le.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r|0,n||vn(this,t,r,2,65535,0),le.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=t&255):xu(this,t,r,!1),r+2};function Su(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,s=Math.min(e.length-r,4);i>>(n?i:3-i)*8&255}le.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r|0,n||vn(this,t,r,4,4294967295,0),le.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255):Su(this,t,r,!0),r+4},le.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r|0,n||vn(this,t,r,4,4294967295,0),le.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255):Su(this,t,r,!1),r+4},le.prototype.writeIntLE=function(t,r,n,i){if(t=+t,r=r|0,!i){var s=Math.pow(2,8*n-1);vn(this,t,r,n,s-1,-s)}var o=0,a=1,c=0;for(this[r]=t&255;++o>0)-c&255;return r+n},le.prototype.writeIntBE=function(t,r,n,i){if(t=+t,r=r|0,!i){var s=Math.pow(2,8*n-1);vn(this,t,r,n,s-1,-s)}var o=n-1,a=1,c=0;for(this[r+o]=t&255;--o>=0&&(a*=256);)t<0&&c===0&&this[r+o+1]!==0&&(c=1),this[r+o]=(t/a>>0)-c&255;return r+n},le.prototype.writeInt8=function(t,r,n){return t=+t,r=r|0,n||vn(this,t,r,1,127,-128),le.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=t&255,r+1},le.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r|0,n||vn(this,t,r,2,32767,-32768),le.TYPED_ARRAY_SUPPORT?(this[r]=t&255,this[r+1]=t>>>8):xu(this,t,r,!0),r+2},le.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r|0,n||vn(this,t,r,2,32767,-32768),le.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=t&255):xu(this,t,r,!1),r+2},le.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r|0,n||vn(this,t,r,4,2147483647,-2147483648),le.TYPED_ARRAY_SUPPORT?(this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):Su(this,t,r,!0),r+4},le.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r|0,n||vn(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),le.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255):Su(this,t,r,!1),r+4};function Aw(e,t,r,n,i,s){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Bw(e,t,r,n,i){return i||Aw(e,t,r,4),gw(e,t,r,n,23,4),r+4}le.prototype.writeFloatLE=function(t,r,n){return Bw(this,t,r,!0,n)},le.prototype.writeFloatBE=function(t,r,n){return Bw(this,t,r,!1,n)};function Iw(e,t,r,n,i){return i||Aw(e,t,r,8),gw(e,t,r,n,52,8),r+8}le.prototype.writeDoubleLE=function(t,r,n){return Iw(this,t,r,!0,n)},le.prototype.writeDoubleBE=function(t,r,n){return Iw(this,t,r,!1,n)},le.prototype.copy=function(t,r,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r=0;--o)t[o+r]=this[o+n];else if(s<1e3||!le.TYPED_ARRAY_SUPPORT)for(o=0;o>>0,n=n===void 0?this.length:n>>>0,t||(t=0);var o;if(typeof t=="number")for(o=r;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}else if(o+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}function i8(e){for(var t=[],r=0;r>8,i=r%256,s.push(i),s.push(n);return s}function Rw(e){return $I(t8(e))}function Bu(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function o8(e){return e!==e}function a8(e){return e!=null&&(!!e._isBuffer||Tw(e)||c8(e))}function Tw(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function c8(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&Tw(e.slice(0,0))}function kw(){throw new Error("setTimeout has not been defined")}function Cw(){throw new Error("clearTimeout has not been defined")}var ws=kw,ms=Cw;typeof pr.setTimeout=="function"&&(ws=setTimeout),typeof pr.clearTimeout=="function"&&(ms=clearTimeout);function Lw(e){if(ws===setTimeout)return setTimeout(e,0);if((ws===kw||!ws)&&setTimeout)return ws=setTimeout,setTimeout(e,0);try{return ws(e,0)}catch{try{return ws.call(null,e,0)}catch{return ws.call(this,e,0)}}}function f8(e){if(ms===clearTimeout)return clearTimeout(e);if((ms===Cw||!ms)&&clearTimeout)return ms=clearTimeout,clearTimeout(e);try{return ms(e)}catch{try{return ms.call(null,e)}catch{return ms.call(this,e)}}}var ji=[],na=!1,io,Iu=-1;function u8(){!na||!io||(na=!1,io.length?ji=io.concat(ji):Iu=-1,ji.length&&$w())}function $w(){if(!na){var e=Lw(u8);na=!0;for(var t=ji.length;t;){for(io=ji,ji=[];++Iu1)for(var r=1;r=i)return a;switch(a){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch{return"[Circular]"}default:return a}}),o=n[r];r=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),Lu(t)?r.showHidden=t:t&&Od(r,t),Si(r.showHidden)&&(r.showHidden=!1),Si(r.depth)&&(r.depth=2),Si(r.colors)&&(r.colors=!1),Si(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=j8),Cu(r,e,r.depth)}xi.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},xi.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function j8(e,t){var r=xi.styles[t];return r?"\x1B["+xi.colors[r][0]+"m"+e+"\x1B["+xi.colors[r][1]+"m":e}function z8(e,t){return e}function q8(e){var t={};return e.forEach(function(r,n){t[r]=!0}),t}function Cu(e,t,r){if(e.customInspect&&t&&uc(t.inspect)&&t.inspect!==xi&&!(t.constructor&&t.constructor.prototype===t)){var n=t.inspect(r,e);return bs(n)||(n=Cu(e,n,r)),n}var i=V8(e,t);if(i)return i;var s=Object.keys(t),o=q8(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(t)),fc(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return Rd(t);if(s.length===0){if(uc(t)){var a=t.name?": "+t.name:"";return e.stylize("[Function"+a+"]","special")}if(cc(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if($u(t))return e.stylize(Date.prototype.toString.call(t),"date");if(fc(t))return Rd(t)}var c="",u=!1,l=["{","}"];if(kd(t)&&(u=!0,l=["[","]"]),uc(t)){var y=t.name?": "+t.name:"";c=" [Function"+y+"]"}if(cc(t)&&(c=" "+RegExp.prototype.toString.call(t)),$u(t)&&(c=" "+Date.prototype.toUTCString.call(t)),fc(t)&&(c=" "+Rd(t)),s.length===0&&(!u||t.length==0))return l[0]+c+l[1];if(r<0)return cc(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var A;return u?A=W8(e,t,r,o,s):A=s.map(function(v){return Td(e,t,r,o,v,u)}),e.seen.pop(),K8(A,c,l)}function V8(e,t){if(Si(t))return e.stylize("undefined","undefined");if(bs(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(Ld(t))return e.stylize(""+t,"number");if(Lu(t))return e.stylize(""+t,"boolean");if(zi(t))return e.stylize("null","null")}function Rd(e){return"["+Error.prototype.toString.call(e)+"]"}function W8(e,t,r,n,i){for(var s=[],o=0,a=t.length;o-1&&(s?a=a.split(` +`).map(function(u){return" "+u}).join(` +`).substr(2):a=` +`+a.split(` +`).map(function(u){return" "+u}).join(` +`))):a=e.stylize("[Circular]","special")),Si(o)){if(s&&i.match(/^\d+$/))return a;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+a}function K8(e,t,r){var n=e.reduce(function(i,s){return s.indexOf(` +`)>=0,i+s.replace(/\u001b\[\d\d?m/g,"").length+1},0);return n>60?r[0]+(t===""?"":t+` + `)+" "+e.join(`, + `)+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function kd(e){return Array.isArray(e)}function Lu(e){return typeof e=="boolean"}function zi(e){return e===null}function Cd(e){return e==null}function Ld(e){return typeof e=="number"}function bs(e){return typeof e=="string"}function Pw(e){return typeof e=="symbol"}function Si(e){return e===void 0}function cc(e){return qi(e)&&$d(e)==="[object RegExp]"}function qi(e){return typeof e=="object"&&e!==null}function $u(e){return qi(e)&&$d(e)==="[object Date]"}function fc(e){return qi(e)&&($d(e)==="[object Error]"||e instanceof Error)}function uc(e){return typeof e=="function"}function Uw(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}function Fw(e){return le.isBuffer(e)}function $d(e){return Object.prototype.toString.call(e)}function Md(e){return e<10?"0"+e.toString(10):e.toString(10)}var Z8=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function G8(){var e=new Date,t=[Md(e.getHours()),Md(e.getMinutes()),Md(e.getSeconds())].join(":");return[e.getDate(),Z8[e.getMonth()],t].join(" ")}function Dw(){console.log("%s - %s",G8(),Ru.apply(null,arguments))}function Od(e,t){if(!t||!qi(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}function Hw(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var ao=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function Nd(e){if(typeof e!="function")throw new TypeError('The "original" argument must be of type Function');if(ao&&e[ao]){var t=e[ao];if(typeof t!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,ao,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var r,n,i=new Promise(function(a,c){r=a,n=c}),s=[],o=0;o0?this.tail.next=t:this.head=t,this.tail=t,++this.length},co.prototype.unshift=function(e){var t={data:e,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length},co.prototype.shift=function(){if(this.length!==0){var e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},co.prototype.clear=function(){this.head=this.tail=null,this.length=0},co.prototype.join=function(e){if(this.length===0)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},co.prototype.concat=function(e){if(this.length===0)return ie.Buffer.alloc(0);if(this.length===1)return this.head.data;for(var t=ie.Buffer.allocUnsafe(e>>>0),r=this.head,n=0;r;)r.data.copy(t,n),n+=r.data.length,r=r.next;return t};var Pd=gf.exports.Buffer,zw=Pd.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Q8(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function eR(e){var t=Q8(e);if(typeof t!="string"&&(Pd.isEncoding===zw||!zw(e)))throw new Error("Unknown encoding: "+e);return t||e}var qw=lc;function lc(e){this.encoding=eR(e);var t;switch(this.encoding){case"utf16le":this.text=oR,this.end=aR,t=4;break;case"utf8":this.fillLast=nR,t=4;break;case"base64":this.text=cR,this.end=fR,t=3;break;default:this.write=uR,this.end=lR;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Pd.allocUnsafe(t)}lc.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function tR(e,t,r){var n=t.length-1;if(n=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function rR(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function nR(e){var t=this.lastTotal-this.lastNeed,r=rR(this,e);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function iR(e,t){var r=tR(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function sR(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function oR(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function aR(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function cR(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function fR(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function uR(e){return e.toString(this.encoding)}function lR(e){return e&&e.length?this.write(e):""}ar.ReadableState=Vw;var Vt=Id("stream");qr(ar,Un.exports);function hR(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function dR(e,t){return e.listeners(t).length}function Vw(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof Kn&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,n=this.objectMode?16:16*1024;this.highWaterMark=r||r===0?r:n,this.highWaterMark=~~this.highWaterMark,this.buffer=new co,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new qw(e.encoding),this.encoding=e.encoding)}function ar(e){if(!(this instanceof ar))return new ar(e);this._readableState=new Vw(e,this),this.readable=!0,e&&typeof e.read=="function"&&(this._read=e.read),Un.exports.call(this)}ar.prototype.push=function(e,t){var r=this._readableState;return!r.objectMode&&typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=le.from(e,t),t="")),Ww(this,r,e,t,!1)},ar.prototype.unshift=function(e){var t=this._readableState;return Ww(this,t,e,"",!0)},ar.prototype.isPaused=function(){return this._readableState.flowing===!1};function Ww(e,t,r,n,i){var s=yR(t,r);if(s)e.emit("error",s);else if(r===null)t.reading=!1,wR(e,t);else if(t.objectMode||r&&r.length>0)if(t.ended&&!i){var o=new Error("stream.push() after EOF");e.emit("error",o)}else if(t.endEmitted&&i){var a=new Error("stream.unshift() after end event");e.emit("error",a)}else{var c;t.decoder&&!i&&!n&&(r=t.decoder.write(r),c=!t.objectMode&&r.length===0),i||(t.reading=!1),c||(t.flowing&&t.length===0&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&Mu(e))),mR(e,t)}else i||(t.reading=!1);return pR(t)}function pR(e){return!e.ended&&(e.needReadable||e.length=Kw?e=Kw:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function Zw(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=gR(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}ar.prototype.read=function(e){Vt("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return Vt("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?Dd(this):Mu(this),null;if(e=Zw(e,t),e===0&&t.ended)return t.length===0&&Dd(this),null;var n=t.needReadable;Vt("need readable",n),(t.length===0||t.length-e0?i=Yw(e,t):i=null,i===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&Dd(this)),i!==null&&this.emit("data",i),i};function yR(e,t){var r=null;return!le.isBuffer(t)&&typeof t!="string"&&t!==null&&t!==void 0&&!e.objectMode&&(r=new TypeError("Invalid non-string/buffer chunk")),r}function wR(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,Mu(e)}}function Mu(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(Vt("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Mn(Gw,e):Gw(e))}function Gw(e){Vt("emit readable"),e.emit("readable"),Fd(e)}function mR(e,t){t.readingMore||(t.readingMore=!0,Mn(bR,e,t))}function bR(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length1&&Xw(n.pipes,e)!==-1)&&!u&&(Vt("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,y=!0),r.pause())}function v(H){Vt("onerror",H),P(),e.removeListener("error",v),dR(e,"error")===0&&e.emit("error",H)}hR(e,"error",v);function R(){e.removeListener("finish",M),P()}e.once("close",R);function M(){Vt("onfinish"),e.removeListener("close",R),P()}e.once("finish",M);function P(){Vt("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(Vt("pipe resume"),r.resume()),e};function vR(e){return function(){var t=e._readableState;Vt("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&e.listeners("data").length&&(t.flowing=!0,Fd(e))}}ar.prototype.unpipe=function(e){var t=this._readableState;if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.head.data:r=t.buffer.concat(t.length),t.buffer.clear()):r=SR(e,t.buffer,t.decoder),r}function SR(e,t,r){var n;return es.length?s.length:e;if(o===s.length?i+=s:i+=s.slice(0,e),e-=o,e===0){o===s.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=s.slice(o));break}++n}return t.length-=n,i}function BR(e,t){var r=le.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var s=n.data,o=e>s.length?s.length:e;if(s.copy(r,r.length-e,0,o),e-=o,e===0){o===s.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=s.slice(o));break}++i}return t.length-=i,r}function Dd(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,Mn(IR,t,e))}function IR(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function RR(e,t){for(var r=0,n=e.length;r-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this};function $R(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=ie.Buffer.from(t,r)),t}function MR(e,t,r,n,i){r=$R(t,r,n),ie.Buffer.isBuffer(r)&&(n="buffer");var s=t.objectMode?1:r.length;t.length+=s;var o=t.lengthe._pos){var n=r.substr(e._pos);if(e._charset==="x-user-defined"){for(var i=new le(n.length),s=0;se._pos&&(e.push(new le(new Uint8Array(o.result.slice(e._pos)))),e._pos=o.result.byteLength)},o.onload=function(){e.push(null)},o.readAsArrayBuffer(r);break}e._xhr.readyState===fo.DONE&&e._mode!=="ms-stream"&&e.push(null)};function qR(e){if(e instanceof Uint8Array){if(e.byteOffset===0&&e.byteLength===e.buffer.byteLength)return e.buffer;if(typeof e.buffer.slice=="function")return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(ie.isBuffer(e)){for(var t=new Uint8Array(e.length),r=e.length,n=0;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Kd=dc-om,sa=Math.floor,Zd=String.fromCharCode;function am(e){throw new RangeError(tT[e])}function rT(e,t){const r=[];let n=e.length;for(;n--;)r[n]=t(e[n]);return r}function nT(e,t){const r=e.split("@");let n="";r.length>1&&(n=r[0]+"@",e=r[1]),e=e.replace(eT,".");const i=e.split("."),s=rT(i,t).join(".");return n+s}function iT(e){const t=[];let r=0;const n=e.length;for(;r=55296&&i<=56319&&r>1,e+=sa(e/t);e>Kd*Wd>>1;n+=dc)e=sa(e/Kd);return sa(n+(Kd+1)*e/(e+ZR))},oT=function(e){const t=[];e=iT(e);const r=e.length;let n=XR,i=0,s=YR;for(const c of e)c<128&&t.push(Zd(c));const o=t.length;let a=o;for(o&&t.push(JR);a=n&&lsa((Vd-i)/u)&&am("overflow"),i+=(c-n)*u,n=c;for(const l of e)if(lVd&&am("overflow"),l===n){let y=i;for(let A=dc;;A+=dc){const v=A<=s?om:A>=s+Wd?Wd:A-s;if(y0&&a>o&&(a=o);for(var c=0;c=0?(y=u.substr(0,l),A=u.substr(l+1)):(y=u,A=""),v=decodeURIComponent(y),R=decodeURIComponent(A),cT(i,v)?fm(i[v])?i[v].push(R):i[v]=[i[v],R]:i[v]=R}return i}const hm=pr.URL,dm=pr.URLSearchParams;var lT={parse:uo,resolve:vm,resolveObject:_m,fileURLToPath:mm,format:bm,Url:On,URL:hm,URLSearchParams:dm};function On(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var hT=/^([a-z0-9.+-]+:)/i,dT=/:[0-9]*$/,pT=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,gT=["<",">",'"',"`"," ","\r",` +`," "],yT=["{","}","|","\\","^","`"].concat(gT),Gd=["'"].concat(yT),pm=["%","/","?",";","#"].concat(Gd),gm=["/","?","#"],wT=255,ym=/^[+a-z0-9A-Z_-]{0,63}$/,mT=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,bT={javascript:!0,"javascript:":!0},Yd={javascript:!0,"javascript:":!0},oa={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function uo(e,t,r){if(e&&qi(e)&&e instanceof On)return e;var n=new On;return n.parse(e,t,r),n}On.prototype.parse=function(e,t,r){return wm(this,e,t,r)};function wm(e,t,r,n){if(!bs(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),s=i!==-1&&i127?Z+="x":Z+=G[z];if(!Z.match(ym)){var se=q.slice(0,v),Q=q.slice(v+1),I=G.match(mT);I&&(se.push(I[1]),Q.unshift(I[2])),Q.length&&(c="/"+Q.join(".")+c),e.hostname=se.join(".");break}}}}e.hostname.length>wT?e.hostname="":e.hostname=e.hostname.toLowerCase(),$||(e.hostname=aT(e.hostname)),P=e.port?":"+e.port:"";var g=e.hostname||"";e.host=g+P,e.href+=e.host,$&&(e.hostname=e.hostname.substr(1,e.hostname.length-2),c[0]!=="/"&&(c="/"+c))}if(!bT[y])for(v=0,M=Gd.length;v0?r.host.split("@"):!1,q&&(r.auth=q.shift(),r.host=r.hostname=q.shift())),r.search=e.search,r.query=e.query,(!zi(r.pathname)||!zi(r.search))&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!N.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var G=N.slice(-1)[0],Z=(r.host||e.host||N.length>1)&&(G==="."||G==="..")||G==="",z=0,ee=N.length;ee>=0;ee--)G=N[ee],G==="."?N.splice(ee,1):G===".."?(N.splice(ee,1),z++):z&&(N.splice(ee,1),z--);if(!H&&!F)for(;z--;z)N.unshift("..");H&&N[0]!==""&&(!N[0]||N[0].charAt(0)!=="/")&&N.unshift(""),Z&&N.join("/").substr(-1)!=="/"&&N.push("");var se=N[0]===""||N[0]&&N[0].charAt(0)==="/";return $&&(r.hostname=r.host=se?"":N.length?N.shift():"",q=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1,q&&(r.auth=q.shift(),r.host=r.hostname=q.shift())),H=H||r.host&&N.length,H&&!se&&N.unshift(""),N.length?r.pathname=N.join("/"):(r.pathname=null,r.path=null),(!zi(r.pathname)||!zi(r.search))&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},On.prototype.parseHost=function(){return Em(this)};function Em(e){var t=e.host,r=dT.exec(t);r&&(r=r[0],r!==":"&&(e.port=r.substr(1)),t=t.substr(0,t.length-r.length)),t&&(e.hostname=t)}var _T=Object.freeze({__proto__:null,parse:uo,resolve:vm,resolveObject:_m,fileURLToPath:mm,format:bm,URL:hm,URLSearchParams:dm,default:lT,Url:On});function Jd(e,t){typeof e=="string"&&(e=uo(e));var r=pr.location.protocol.search(/^https?:$/)===-1?"http:":"",n=e.protocol||r,i=e.hostname||e.host,s=e.port,o=e.path||"/";i&&i.indexOf(":")!==-1&&(i="["+i+"]"),e.url=(i?n+"//"+i:"")+(s?":"+s:"")+o,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var a=new Xr(e);return t&&a.on("response",t),a}function xm(e,t){var r=Jd(e,t);return r.end(),r}function Qd(){}Qd.defaultMaxSockets=4;var Sm=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],Am={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"},ET={request:Jd,get:xm,Agent:Qd,METHODS:Sm,STATUS_CODES:Am},xT=Object.freeze({__proto__:null,request:Jd,get:xm,Agent:Qd,METHODS:Sm,STATUS_CODES:Am,default:ET}),ST=Nn(xT);function e0(e,t){typeof e=="string"&&(e=uo(e));var r=pr.location.protocol.search(/^https?:$/)===-1?"http:":"",n=e.protocol||r,i=e.hostname||e.host,s=e.port,o=e.path||"/";i&&i.indexOf(":")!==-1&&(i="["+i+"]"),e.url=(i?n+"//"+i:"")+(s?":"+s:"")+o,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var a=new Xr(e);return t&&a.on("response",t),a}function Bm(e,t){var r=e0(e,t);return r.end(),r}function t0(){}t0.defaultMaxSockets=4;var Im=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],Rm={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"},AT={request:e0,get:Bm,Agent:t0,METHODS:Im,STATUS_CODES:Rm},BT=Object.freeze({__proto__:null,request:e0,get:Bm,Agent:t0,METHODS:Im,STATUS_CODES:Rm,default:AT}),IT=Nn(BT),Tm={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};function RT(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}function Wi(e,t,r,n,i){if(t.subarray&&e.subarray){e.set(t.subarray(r,r+n),i);return}for(var s=0;s=0;)e[t]=0}var CT=0,Lm=1,LT=2,$T=3,MT=258,r0=29,gc=256,yc=gc+1+r0,ca=30,n0=19,$m=2*yc+1,lo=15,i0=16,OT=7,s0=256,Mm=16,Om=17,Nm=18,o0=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Uu=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],NT=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Pm=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],PT=512,Ki=new Array((yc+2)*2);aa(Ki);var wc=new Array(ca*2);aa(wc);var mc=new Array(PT);aa(mc);var bc=new Array(MT-$T+1);aa(bc);var a0=new Array(r0);aa(a0);var Fu=new Array(ca);aa(Fu);function c0(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}var Um,Fm,Dm;function f0(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function Hm(e){return e<256?mc[e]:mc[256+(e>>>7)]}function vc(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function En(e,t,r){e.bi_valid>i0-r?(e.bi_buf|=t<>i0-e.bi_valid,e.bi_valid+=r-i0):(e.bi_buf|=t<>>=1,r<<=1;while(--t>0);return r>>>1}function UT(e){e.bi_valid===16?(vc(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function FT(e,t){var r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,s=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,a=t.stat_desc.extra_base,c=t.stat_desc.max_length,u,l,y,A,v,R,M=0;for(A=0;A<=lo;A++)e.bl_count[A]=0;for(r[e.heap[e.heap_max]*2+1]=0,u=e.heap_max+1;u<$m;u++)l=e.heap[u],A=r[r[l*2+1]*2+1]+1,A>c&&(A=c,M++),r[l*2+1]=A,!(l>n)&&(e.bl_count[A]++,v=0,l>=a&&(v=o[l-a]),R=r[l*2],e.opt_len+=R*(A+v),s&&(e.static_len+=R*(i[l*2+1]+v)));if(M!==0){do{for(A=c-1;e.bl_count[A]===0;)A--;e.bl_count[A]--,e.bl_count[A+1]+=2,e.bl_count[c]--,M-=2}while(M>0);for(A=c;A!==0;A--)for(l=e.bl_count[A];l!==0;)y=e.heap[--u],!(y>n)&&(r[y*2+1]!==A&&(e.opt_len+=(A-r[y*2+1])*r[y*2],r[y*2+1]=A),l--)}}function zm(e,t,r){var n=new Array(lo+1),i=0,s,o;for(s=1;s<=lo;s++)n[s]=i=i+r[s-1]<<1;for(o=0;o<=t;o++){var a=e[o*2+1];a!==0&&(e[o*2]=jm(n[a]++,a))}}function DT(){var e,t,r,n,i,s=new Array(lo+1);for(r=0,n=0;n>=7;n8?vc(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function HT(e,t,r,n){Vm(e),n&&(vc(e,r),vc(e,~r)),Wi(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function Wm(e,t,r,n){var i=t*2,s=r*2;return e[i]>1;o>=1;o--)u0(e,r,o);u=s;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],u0(e,r,1),a=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=a,r[u*2]=r[o*2]+r[a*2],e.depth[u]=(e.depth[o]>=e.depth[a]?e.depth[o]:e.depth[a])+1,r[o*2+1]=r[a*2+1]=u,e.heap[1]=u++,u0(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],FT(e,t),zm(r,c,e.bl_count)}function Zm(e,t,r){var n,i=-1,s,o=t[0*2+1],a=0,c=7,u=4;for(o===0&&(c=138,u=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)s=o,o=t[(n+1)*2+1],!(++a=3&&e.bl_tree[Pm[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function zT(e,t,r,n){var i;for(En(e,t-257,5),En(e,r-1,5),En(e,n-4,4),i=0;i>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return km;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return Cm;for(r=32;r0?(e.strm.data_type===kT&&(e.strm.data_type=qT(e)),l0(e,e.l_desc),l0(e,e.d_desc),o=jT(e),i=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=i&&(i=s)):i=s=r+5,r+4<=i&&t!==-1?Xm(e,t,r,n):e.strategy===TT||s===i?(En(e,(Lm<<1)+(n?1:0),3),Km(e,Ki,wc)):(En(e,(LT<<1)+(n?1:0),3),zT(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),Km(e,e.dyn_ltree,e.dyn_dtree)),qm(e),n&&Vm(e)}function vs(e,t,r){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=r&255,e.last_lit++,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(bc[r]+gc+1)*2]++,e.dyn_dtree[Hm(t)*2]++),e.last_lit===e.lit_bufsize-1}function h0(e,t,r,n){for(var i=e&65535|0,s=e>>>16&65535|0,o=0;r!==0;){o=r>2e3?2e3:r,r-=o;do i=i+t[n++]|0,s=s+i|0;while(--o);i%=65521,s%=65521}return i|s<<16|0}function ZT(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t}var GT=ZT();function Vr(e,t,r,n){var i=GT,s=n+r;e^=-1;for(var o=n;o>>8^i[(e^t[o])&255];return e^-1}var ho=0,YT=1,XT=3,_s=4,Jm=5,Es=0,Qm=1,xs=-2,JT=-3,d0=-5,QT=-1,e4=1,Du=2,t4=3,r4=4,n4=2,p0=8,i4=9,s4=29,o4=256,g0=o4+1+s4,a4=30,c4=19,f4=2*g0+1,u4=15,Ft=3,Ss=258,si=Ss+Ft+1,l4=32,y0=42,w0=69,Hu=73,ju=91,zu=103,po=113,_c=666,$r=1,Ec=2,go=3,fa=4,h4=3;function As(e,t){return e.msg=Tm[t],t}function eb(e){return(e<<1)-(e>4?9:0)}function yo(e){for(var t=e.length;--t>=0;)e[t]=0}function Bs(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(Wi(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))}function Jr(e,t){KT(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Bs(e.strm)}function Pt(e,t){e.pending_buf[e.pending++]=t}function xc(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function d4(e,t,r,n){var i=e.avail_in;return i>n&&(i=n),i===0?0:(e.avail_in-=i,Wi(t,e.input,e.next_in,i,r),e.state.wrap===1?e.adler=h0(e.adler,t,i,r):e.state.wrap===2&&(e.adler=Vr(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)}function tb(e,t){var r=e.max_chain_length,n=e.strstart,i,s,o=e.prev_length,a=e.nice_match,c=e.strstart>e.w_size-si?e.strstart-(e.w_size-si):0,u=e.window,l=e.w_mask,y=e.prev,A=e.strstart+Ss,v=u[n+o-1],R=u[n+o];e.prev_length>=e.good_match&&(r>>=2),a>e.lookahead&&(a=e.lookahead);do if(i=t,!(u[i+o]!==R||u[i+o-1]!==v||u[i]!==u[n]||u[++i]!==u[n+1])){n+=2,i++;do;while(u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&no){if(e.match_start=t,o=s,s>=a)break;v=u[n+o-1],R=u[n+o]}}while((t=y[t&l])>c&&--r!==0);return o<=e.lookahead?o:e.lookahead}function Sc(e){var t=e.w_size,r,n,i,s,o;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-si)){Wi(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do i=e.head[--r],e.head[r]=i>=t?i-t:0;while(--n);n=t,r=n;do i=e.prev[--r],e.prev[r]=i>=t?i-t:0;while(--n);s+=t}if(e.strm.avail_in===0)break;if(n=d4(e.strm,e.window,e.strstart+e.lookahead,s),e.lookahead+=n,e.lookahead+e.insert>=Ft)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Sc(e),e.lookahead===0&&t===ho)return $r;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((e.strstart===0||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,Jr(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-si&&(Jr(e,!1),e.strm.avail_out===0))return $r}return e.insert=0,t===_s?(Jr(e,!0),e.strm.avail_out===0?go:fa):(e.strstart>e.block_start&&(Jr(e,!1),e.strm.avail_out===0),$r)}function m0(e,t){for(var r,n;;){if(e.lookahead=Ft&&(e.ins_h=(e.ins_h<=Ft)if(n=vs(e,e.strstart-e.match_start,e.match_length-Ft),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Ft){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<=Ft&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=Ft-1)),e.prev_length>=Ft&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-Ft,n=vs(e,e.strstart-1-e.prev_match,e.prev_length-Ft),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=(e.ins_h<=Ft&&e.strstart>0&&(i=e.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){s=e.strstart+Ss;do;while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=Ft?(r=vs(e,1,e.match_length-Ft),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=vs(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(Jr(e,!1),e.strm.avail_out===0))return $r}return e.insert=0,t===_s?(Jr(e,!0),e.strm.avail_out===0?go:fa):e.last_lit&&(Jr(e,!1),e.strm.avail_out===0)?$r:Ec}function y4(e,t){for(var r;;){if(e.lookahead===0&&(Sc(e),e.lookahead===0)){if(t===ho)return $r;break}if(e.match_length=0,r=vs(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(Jr(e,!1),e.strm.avail_out===0))return $r}return e.insert=0,t===_s?(Jr(e,!0),e.strm.avail_out===0?go:fa):e.last_lit&&(Jr(e,!1),e.strm.avail_out===0)?$r:Ec}function Bi(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}var la;la=[new Bi(0,0,0,0,p4),new Bi(4,4,8,4,m0),new Bi(4,5,16,8,m0),new Bi(4,6,32,32,m0),new Bi(4,4,16,16,ua),new Bi(8,16,32,32,ua),new Bi(8,16,128,128,ua),new Bi(8,32,128,256,ua),new Bi(32,128,258,1024,ua),new Bi(32,258,258,4096,ua)];function w4(e){e.window_size=2*e.w_size,yo(e.head),e.max_lazy_match=la[e.level].max_lazy,e.good_match=la[e.level].good_length,e.nice_match=la[e.level].nice_length,e.max_chain_length=la[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=Ft-1,e.match_available=0,e.ins_h=0}function m4(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=p0,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Gn(f4*2),this.dyn_dtree=new Gn((2*a4+1)*2),this.bl_tree=new Gn((2*c4+1)*2),yo(this.dyn_ltree),yo(this.dyn_dtree),yo(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Gn(u4+1),this.heap=new Gn(2*g0+1),yo(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Gn(2*g0+1),yo(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function b4(e){var t;return!e||!e.state?As(e,xs):(e.total_in=e.total_out=0,e.data_type=n4,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?y0:po,e.adler=t.wrap===2?0:1,t.last_flush=ho,VT(t),Es)}function rb(e){var t=b4(e);return t===Es&&w4(e.state),t}function v4(e,t,r,n,i,s){if(!e)return xs;var o=1;if(t===QT&&(t=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>i4||r!==p0||n<8||n>15||t<0||t>9||s<0||s>r4)return As(e,xs);n===8&&(n=9);var a=new m4;return e.state=a,a.strm=e,a.wrap=o,a.gzhead=null,a.w_bits=n,a.w_size=1<Jm||t<0)return e?As(e,xs):xs;if(n=e.state,!e.output||!e.input&&e.avail_in!==0||n.status===_c&&t!==_s)return As(e,e.avail_out===0?d0:xs);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===y0)if(n.wrap===2)e.adler=0,Pt(n,31),Pt(n,139),Pt(n,8),n.gzhead?(Pt(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Pt(n,n.gzhead.time&255),Pt(n,n.gzhead.time>>8&255),Pt(n,n.gzhead.time>>16&255),Pt(n,n.gzhead.time>>24&255),Pt(n,n.level===9?2:n.strategy>=Du||n.level<2?4:0),Pt(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(Pt(n,n.gzhead.extra.length&255),Pt(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Vr(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=w0):(Pt(n,0),Pt(n,0),Pt(n,0),Pt(n,0),Pt(n,0),Pt(n,n.level===9?2:n.strategy>=Du||n.level<2?4:0),Pt(n,h4),n.status=po);else{var o=p0+(n.w_bits-8<<4)<<8,a=-1;n.strategy>=Du||n.level<2?a=0:n.level<6?a=1:n.level===6?a=2:a=3,o|=a<<6,n.strstart!==0&&(o|=l4),o+=31-o%31,n.status=po,xc(n,o),n.strstart!==0&&(xc(n,e.adler>>>16),xc(n,e.adler&65535)),e.adler=1}if(n.status===w0)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=Vr(e.adler,n.pending_buf,n.pending-i,i)),Bs(e),i=n.pending,n.pending===n.pending_buf_size));)Pt(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=Vr(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=Hu)}else n.status=Hu;if(n.status===Hu)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=Vr(e.adler,n.pending_buf,n.pending-i,i)),Bs(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}n.gzindexi&&(e.adler=Vr(e.adler,n.pending_buf,n.pending-i,i)),s===0&&(n.gzindex=0,n.status=ju)}else n.status=ju;if(n.status===ju)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=Vr(e.adler,n.pending_buf,n.pending-i,i)),Bs(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}n.gzindexi&&(e.adler=Vr(e.adler,n.pending_buf,n.pending-i,i)),s===0&&(n.status=zu)}else n.status=zu;if(n.status===zu&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Bs(e),n.pending+2<=n.pending_buf_size&&(Pt(n,e.adler&255),Pt(n,e.adler>>8&255),e.adler=0,n.status=po)):n.status=po),n.pending!==0){if(Bs(e),e.avail_out===0)return n.last_flush=-1,Es}else if(e.avail_in===0&&eb(t)<=eb(r)&&t!==_s)return As(e,d0);if(n.status===_c&&e.avail_in!==0)return As(e,d0);if(e.avail_in!==0||n.lookahead!==0||t!==ho&&n.status!==_c){var c=n.strategy===Du?y4(n,t):n.strategy===t4?g4(n,t):la[n.level].func(n,t);if((c===go||c===fa)&&(n.status=_c),c===$r||c===go)return e.avail_out===0&&(n.last_flush=-1),Es;if(c===Ec&&(t===YT?WT(n):t!==Jm&&(Xm(n,0,0,!1),t===XT&&(yo(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Bs(e),e.avail_out===0))return n.last_flush=-1,Es}return t!==_s?Es:n.wrap<=0?Qm:(n.wrap===2?(Pt(n,e.adler&255),Pt(n,e.adler>>8&255),Pt(n,e.adler>>16&255),Pt(n,e.adler>>24&255),Pt(n,e.total_in&255),Pt(n,e.total_in>>8&255),Pt(n,e.total_in>>16&255),Pt(n,e.total_in>>24&255)):(xc(n,e.adler>>>16),xc(n,e.adler&65535)),Bs(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Es:Qm)}function E4(e){var t;return!e||!e.state?xs:(t=e.state.status,t!==y0&&t!==w0&&t!==Hu&&t!==ju&&t!==zu&&t!==po&&t!==_c?As(e,xs):(e.state=null,t===po?As(e,JT):Es))}var qu=30,x4=12;function S4(e,t){var r,n,i,s,o,a,c,u,l,y,A,v,R,M,P,H,F,N,$,q,G,Z,z,ee,se;r=e.state,n=e.next_in,ee=e.input,i=n+(e.avail_in-5),s=e.next_out,se=e.output,o=s-(t-e.avail_out),a=s+(e.avail_out-257),c=r.dmax,u=r.wsize,l=r.whave,y=r.wnext,A=r.window,v=r.hold,R=r.bits,M=r.lencode,P=r.distcode,H=(1<>>24,v>>>=$,R-=$,$=N>>>16&255,$===0)se[s++]=N&65535;else if($&16){q=N&65535,$&=15,$&&(R<$&&(v+=ee[n++]<>>=$,R-=$),R<15&&(v+=ee[n++]<>>24,v>>>=$,R-=$,$=N>>>16&255,$&16){if(G=N&65535,$&=15,R<$&&(v+=ee[n++]<c){e.msg="invalid distance too far back",r.mode=qu;break e}if(v>>>=$,R-=$,$=s-o,G>$){if($=G-$,$>l&&r.sane){e.msg="invalid distance too far back",r.mode=qu;break e}if(Z=0,z=A,y===0){if(Z+=u-$,$2;)se[s++]=z[Z++],se[s++]=z[Z++],se[s++]=z[Z++],q-=3;q&&(se[s++]=z[Z++],q>1&&(se[s++]=z[Z++]))}else{Z=s-G;do se[s++]=se[Z++],se[s++]=se[Z++],se[s++]=se[Z++],q-=3;while(q>2);q&&(se[s++]=se[Z++],q>1&&(se[s++]=se[Z++]))}}else if($&64){e.msg="invalid distance code",r.mode=qu;break e}else{N=P[(N&65535)+(v&(1<<$)-1)];continue r}break}}else if($&64)if($&32){r.mode=x4;break e}else{e.msg="invalid literal/length code",r.mode=qu;break e}else{N=M[(N&65535)+(v&(1<<$)-1)];continue t}break}}while(n>3,n-=q,R-=q<<3,v&=(1<=1&&Q[A]===0;A--);if(v>A&&(v=A),A===0)return i[s++]=1<<24|64<<16|0,i[s++]=1<<24|64<<16|0,a.bits=1,0;for(y=1;y0&&(e===sb||A!==1))return-1;for(I[1]=0,u=1;unb||e===ob&&H>ib)return 1;for(;;){h=u-M,o[l]se?(m=g[f+o[l]],_=z[ee+o[l]]):(m=32+64,_=0),N=1<>M)+$]=h<<24|m<<16|_|0;while($!==0);for(N=1<>=1;if(N!==0?(F&=N-1,F+=N):F=0,l++,--Q[u]===0){if(u===A)break;u=t[r+o[l]]}if(u>v&&(F&G)!==q){for(M===0&&(M=v),Z+=y,R=u-M,P=1<nb||e===ob&&H>ib)return 1;q=F&G,i[q]=v<<24|R<<16|Z-s|0}}return F!==0&&(i[Z+F]=u-M<<24|64<<16|0),a.bits=v,0}var T4=0,ab=1,cb=2,fb=4,k4=5,Vu=6,Bc=0,C4=1,L4=2,Is=-2,$4=-3,M4=-4,O4=-5,ub=8,lb=1,hb=2,db=3,pb=4,gb=5,yb=6,wb=7,mb=8,bb=9,vb=10,_b=11,Zi=12,v0=13,Eb=14,_0=15,xb=16,Sb=17,Ab=18,Bb=19,Wu=20,Ku=21,Ib=22,Rb=23,Tb=24,kb=25,Cb=26,E0=27,Lb=28,$b=29,cr=30,N4=31,P4=32,U4=852,F4=592;function Mb(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function D4(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Gn(320),this.work=new Gn(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function H4(e){var t;return!e||!e.state?Is:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=lb,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Pu(U4),t.distcode=t.distdyn=new Pu(F4),t.sane=1,t.back=-1,Bc)}function Ob(e){var t;return!e||!e.state?Is:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,H4(e))}function j4(e,t){var r,n;return!e||!e.state||(n=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?Is:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,Ob(e))}function z4(e,t){var r,n;return e?(n=new D4,e.state=n,n.window=null,r=j4(e,t),r!==Bc&&(e.state=null),r):Is}var Nb=!0,x0,S0;function q4(e){if(Nb){var t;for(x0=new Pu(512),S0=new Pu(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Ac(ab,e.lens,0,288,x0,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Ac(cb,e.lens,0,32,S0,0,e.work,{bits:5}),Nb=!1}e.lencode=x0,e.lenbits=9,e.distcode=S0,e.distbits=5}function V4(e,t,r,n){var i,s=e.state;return s.window===null&&(s.wsize=1<=s.wsize?(Wi(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>n&&(i=n),Wi(s.window,t,r-n,i,s.wnext),n-=i,n?(Wi(s.window,t,r-n,n,0),s.wnext=n,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=Vr(r.check,ee,2,0),u=0,l=0,r.mode=hb;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((u&255)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=cr;break}if((u&15)!==ub){e.msg="unknown compression method",r.mode=cr;break}if(u>>>=4,l-=4,Z=(u&15)+8,r.wbits===0)r.wbits=Z;else if(Z>r.wbits){e.msg="invalid window size",r.mode=cr;break}r.dmax=1<>8&1),r.flags&512&&(ee[0]=u&255,ee[1]=u>>>8&255,r.check=Vr(r.check,ee,2,0)),u=0,l=0,r.mode=db;case db:for(;l<32;){if(a===0)break e;a--,u+=n[s++]<>>8&255,ee[2]=u>>>16&255,ee[3]=u>>>24&255,r.check=Vr(r.check,ee,4,0)),u=0,l=0,r.mode=pb;case pb:for(;l<16;){if(a===0)break e;a--,u+=n[s++]<>8),r.flags&512&&(ee[0]=u&255,ee[1]=u>>>8&255,r.check=Vr(r.check,ee,2,0)),u=0,l=0,r.mode=gb;case gb:if(r.flags&1024){for(;l<16;){if(a===0)break e;a--,u+=n[s++]<>>8&255,r.check=Vr(r.check,ee,2,0)),u=0,l=0}else r.head&&(r.head.extra=null);r.mode=yb;case yb:if(r.flags&1024&&(v=r.length,v>a&&(v=a),v&&(r.head&&(Z=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),Wi(r.head.extra,n,s,v,Z)),r.flags&512&&(r.check=Vr(r.check,n,v,s)),a-=v,s+=v,r.length-=v),r.length))break e;r.length=0,r.mode=wb;case wb:if(r.flags&2048){if(a===0)break e;v=0;do Z=n[s+v++],r.head&&Z&&r.length<65536&&(r.head.name+=String.fromCharCode(Z));while(Z&&v>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Zi;break;case vb:for(;l<32;){if(a===0)break e;a--,u+=n[s++]<>>=l&7,l-=l&7,r.mode=E0;break}for(;l<3;){if(a===0)break e;a--,u+=n[s++]<>>=1,l-=1,u&3){case 0:r.mode=Eb;break;case 1:if(q4(r),r.mode=Wu,t===Vu){u>>>=2,l-=2;break e}break;case 2:r.mode=Sb;break;case 3:e.msg="invalid block type",r.mode=cr}u>>>=2,l-=2;break;case Eb:for(u>>>=l&7,l-=l&7;l<32;){if(a===0)break e;a--,u+=n[s++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=cr;break}if(r.length=u&65535,u=0,l=0,r.mode=_0,t===Vu)break e;case _0:r.mode=xb;case xb:if(v=r.length,v){if(v>a&&(v=a),v>c&&(v=c),v===0)break e;Wi(i,n,s,v,o),a-=v,s+=v,c-=v,o+=v,r.length-=v;break}r.mode=Zi;break;case Sb:for(;l<14;){if(a===0)break e;a--,u+=n[s++]<>>=5,l-=5,r.ndist=(u&31)+1,u>>>=5,l-=5,r.ncode=(u&15)+4,u>>>=4,l-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=cr;break}r.have=0,r.mode=Ab;case Ab:for(;r.have>>=3,l-=3}for(;r.have<19;)r.lens[I[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,se={bits:r.lenbits},z=Ac(T4,r.lens,0,19,r.lencode,0,r.work,se),r.lenbits=se.bits,z){e.msg="invalid code lengths set",r.mode=cr;break}r.have=0,r.mode=Bb;case Bb:for(;r.have>>24,F=P>>>16&255,N=P&65535,!(H<=l);){if(a===0)break e;a--,u+=n[s++]<>>=H,l-=H,r.lens[r.have++]=N;else{if(N===16){for(Q=H+2;l>>=H,l-=H,r.have===0){e.msg="invalid bit length repeat",r.mode=cr;break}Z=r.lens[r.have-1],v=3+(u&3),u>>>=2,l-=2}else if(N===17){for(Q=H+3;l>>=H,l-=H,Z=0,v=3+(u&7),u>>>=3,l-=3}else{for(Q=H+7;l>>=H,l-=H,Z=0,v=11+(u&127),u>>>=7,l-=7}if(r.have+v>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=cr;break}for(;v--;)r.lens[r.have++]=Z}}if(r.mode===cr)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=cr;break}if(r.lenbits=9,se={bits:r.lenbits},z=Ac(ab,r.lens,0,r.nlen,r.lencode,0,r.work,se),r.lenbits=se.bits,z){e.msg="invalid literal/lengths set",r.mode=cr;break}if(r.distbits=6,r.distcode=r.distdyn,se={bits:r.distbits},z=Ac(cb,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,se),r.distbits=se.bits,z){e.msg="invalid distances set",r.mode=cr;break}if(r.mode=Wu,t===Vu)break e;case Wu:r.mode=Ku;case Ku:if(a>=6&&c>=258){e.next_out=o,e.avail_out=c,e.next_in=s,e.avail_in=a,r.hold=u,r.bits=l,S4(e,A),o=e.next_out,i=e.output,c=e.avail_out,s=e.next_in,n=e.input,a=e.avail_in,u=r.hold,l=r.bits,r.mode===Zi&&(r.back=-1);break}for(r.back=0;P=r.lencode[u&(1<>>24,F=P>>>16&255,N=P&65535,!(H<=l);){if(a===0)break e;a--,u+=n[s++]<>$)],H=P>>>24,F=P>>>16&255,N=P&65535,!($+H<=l);){if(a===0)break e;a--,u+=n[s++]<>>=$,l-=$,r.back+=$}if(u>>>=H,l-=H,r.back+=H,r.length=N,F===0){r.mode=Cb;break}if(F&32){r.back=-1,r.mode=Zi;break}if(F&64){e.msg="invalid literal/length code",r.mode=cr;break}r.extra=F&15,r.mode=Ib;case Ib:if(r.extra){for(Q=r.extra;l>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Rb;case Rb:for(;P=r.distcode[u&(1<>>24,F=P>>>16&255,N=P&65535,!(H<=l);){if(a===0)break e;a--,u+=n[s++]<>$)],H=P>>>24,F=P>>>16&255,N=P&65535,!($+H<=l);){if(a===0)break e;a--,u+=n[s++]<>>=$,l-=$,r.back+=$}if(u>>>=H,l-=H,r.back+=H,F&64){e.msg="invalid distance code",r.mode=cr;break}r.offset=N,r.extra=F&15,r.mode=Tb;case Tb:if(r.extra){for(Q=r.extra;l>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=cr;break}r.mode=kb;case kb:if(c===0)break e;if(v=A-c,r.offset>v){if(v=r.offset-v,v>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=cr;break}v>r.wnext?(v-=r.wnext,R=r.wsize-v):R=r.wnext-v,v>r.length&&(v=r.length),M=r.window}else M=i,R=o-r.offset,v=r.length;v>c&&(v=c),c-=v,r.length-=v;do i[o++]=M[R++];while(--v);r.length===0&&(r.mode=Ku);break;case Cb:if(c===0)break e;i[o++]=r.length,c--,r.mode=Ku;break;case E0:if(r.wrap){for(;l<32;){if(a===0)break e;a--,u|=n[s++]<Tc)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}oi.prototype.init=function(e,t,r,n,i){this.windowBits=e,this.level=t,this.memLevel=r,this.strategy=n,(this.mode===Ic||this.mode===Gu)&&(this.windowBits+=16),this.mode===Tc&&(this.windowBits+=32),(this.mode===pa||this.mode===Rc)&&(this.windowBits=-this.windowBits),this.strm=new RT;var s;switch(this.mode){case da:case Ic:case pa:s=v4(this.strm,this.level,Vb,this.windowBits,this.memLevel,this.strategy);break;case Zu:case Gu:case Rc:case Tc:s=z4(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}if(s!==Yu){this._error(s);return}this.write_in_progress=!1,this.init_done=!0},oi.prototype.params=function(){throw new Error("deflateParams Not supported")},oi.prototype._writeCheck=function(){if(!this.init_done)throw new Error("write before init");if(this.mode===A0)throw new Error("already finalized");if(this.write_in_progress)throw new Error("write already in progress");if(this.pending_close)throw new Error("close is pending")},oi.prototype.write=function(e,t,r,n,i,s,o){this._writeCheck(),this.write_in_progress=!0;var a=this;return _n.nextTick(function(){a.write_in_progress=!1;var c=a._write(e,t,r,n,i,s,o);a.callback(c[0],c[1]),a.pending_close&&a.close()}),this};function u5(e,t){for(var r=0;rMe.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsMe.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelMe.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelMe.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=Me.Z_FILTERED&&e.strategy!=Me.Z_HUFFMAN_ONLY&&e.strategy!=Me.Z_RLE&&e.strategy!=Me.Z_FIXED&&e.strategy!=Me.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!le.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new Me.Zlib(t);var r=this;this._hadError=!1,this._binding.onerror=function(s,o){r._binding=null,r._hadError=!0;var a=new Error(s);a.errno=o,a.code=ga[o],r.emit("error",a)};var n=Me.Z_DEFAULT_COMPRESSION;typeof e.level=="number"&&(n=e.level);var i=Me.Z_DEFAULT_STRATEGY;typeof e.strategy=="number"&&(i=e.strategy),this._binding.init(e.windowBits||Me.Z_DEFAULT_WINDOWBITS,n,e.memLevel||Me.Z_DEFAULT_MEMLEVEL,i,e.dictionary),this._buffer=new le(this._chunkSize),this._offset=0,this._closed=!1,this._level=n,this._strategy=i,this.once("end",this.close)}qr(fr,Zn),fr.prototype.params=function(e,t,r){if(eMe.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=Me.Z_FILTERED&&t!=Me.Z_HUFFMAN_ONLY&&t!=Me.Z_RLE&&t!=Me.Z_FIXED&&t!=Me.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var n=this;this.flush(Me.Z_SYNC_FLUSH,function(){n._binding.params(e,t),n._hadError||(n._level=e,n._strategy=t,r&&r())})}else _n.nextTick(r)},fr.prototype.reset=function(){return this._binding.reset()},fr.prototype._flush=function(e){this._transform(new le(0),"",e)},fr.prototype.flush=function(e,t){var r=this._writableState;if((typeof e=="function"||e===void 0&&!t)&&(t=e,e=Me.Z_FULL_FLUSH),r.ended)t&&_n.nextTick(t);else if(r.ending)t&&this.once("end",t);else if(r.needDrain){var n=this;this.once("drain",function(){n.flush(t)})}else this._flushFlag=e,this.write(new le(0),"",t)},fr.prototype.close=function(e){if(e&&_n.nextTick(e),!this._closed){this._closed=!0,this._binding.close();var t=this;_n.nextTick(function(){t.emit("close")})}},fr.prototype._transform=function(e,t,r){var n,i=this._writableState,s=i.ending||i.ended,o=s&&(!e||i.length===e.length);if(!e===null&&!le.isBuffer(e))return r(new Error("invalid input"));o?n=Me.Z_FINISH:(n=this._flushFlag,e.length>=i.length&&(this._flushFlag=this._opts.flush||Me.Z_NO_FLUSH)),this._processChunk(e,n,r)},fr.prototype._processChunk=function(e,t,r){var n=e&&e.length,i=this._chunkSize-this._offset,s=0,o=this,a=typeof r=="function";if(!a){var c=[],u=0,l;this.on("error",function(M){l=M});do var y=this._binding.writeSync(t,e,s,n,this._buffer,this._offset,i);while(!this._hadError&&R(y[0],y[1]));if(this._hadError)throw l;var A=le.concat(c,u);return this.close(),A}var v=this._binding.write(t,e,s,n,this._buffer,this._offset,i);v.buffer=e,v.callback=R;function R(M,P){if(!o._hadError){var H=i-P;if(l5(H>=0,"have should not go down"),H>0){var F=o._buffer.slice(o._offset,o._offset+H);o._offset+=H,a?o.push(F):(c.push(F),u+=F.length)}if((P===0||o._offset>=o._chunkSize)&&(i=o._chunkSize,o._offset=0,o._buffer=new le(o._chunkSize)),P===0){if(s+=n-M,n=M,!a)return!0;var N=o._binding.write(t,e,s,n,o._buffer,o._offset,o._chunkSize);N.callback=R,N.buffer=e;return}if(!a)return!1;r()}}},qr(Rs,fr),qr(Ts,fr),qr(ks,fr),qr(Cs,fr),qr(Ls,fr),qr($s,fr),qr(Ms,fr);var h5={codes:ga,createDeflate:Kb,createInflate:Zb,createDeflateRaw:Gb,createInflateRaw:Yb,createGzip:Xb,createGunzip:Jb,createUnzip:Qb,deflate:ev,deflateSync:tv,gzip:rv,gzipSync:nv,deflateRaw:iv,deflateRawSync:sv,unzip:ov,unzipSync:av,inflate:cv,inflateSync:fv,gunzip:uv,gunzipSync:lv,inflateRaw:hv,inflateRawSync:dv,Deflate:Rs,Inflate:Ts,Gzip:ks,Gunzip:Cs,DeflateRaw:Ls,InflateRaw:$s,Unzip:Ms,Zlib:fr},d5=Object.freeze({__proto__:null,codes:ga,createDeflate:Kb,createInflate:Zb,createDeflateRaw:Gb,createInflateRaw:Yb,createGzip:Xb,createGunzip:Jb,createUnzip:Qb,deflate:ev,deflateSync:tv,gzip:rv,gzipSync:nv,deflateRaw:iv,deflateRawSync:sv,unzip:ov,unzipSync:av,inflate:cv,inflateSync:fv,gunzip:uv,gunzipSync:lv,inflateRaw:hv,inflateRawSync:dv,Deflate:Rs,Inflate:Ts,Gzip:ks,Gunzip:Cs,DeflateRaw:Ls,InflateRaw:$s,Unzip:Ms,Zlib:fr,default:h5}),p5=Nn(d5),g5=Nn(J8),y5=Nn(_T);Object.defineProperty(ro,"__esModule",{value:!0}),ro.InvalidStatusCodeError=ro.InvalidCertError=void 0;const pv=Object.freeze({redirect:!0,expectStatusCode:200,headers:{},full:!1,keepAlive:!0,cors:!1,referrer:!1,sslAllowSelfSigned:!1,_redirectCount:0});class I0 extends Error{constructor(t,r){super(t),this.fingerprint256=r}}ro.InvalidCertError=I0;class R0 extends Error{constructor(t){super(`Request Failed. Status Code: ${t}`),this.statusCode=t}}ro.InvalidStatusCodeError=R0;function gv(e,t){if(!t||t==="text"||t==="json")try{let r=new TextDecoder("utf8",{fatal:!0}).decode(e);if(t==="text")return r;try{return JSON.parse(r)}catch(n){if(t==="json")throw n;return r}}catch(r){if(t==="text"||t==="json")throw r}return e}let yv={};function T0(e,t){let r={...pv,...t};const n=ST,i=IT,s=p5,{promisify:o}=g5,{resolve:a}=y5,c=!!/^https/.test(e);let u={method:r.method||"GET",headers:{"Accept-Encoding":"gzip, deflate, br"}};const l=A=>A.replace(/:| /g,"").toLowerCase();if(r.keepAlive){const A={keepAlive:!0,keepAliveMsecs:3e4,maxFreeSockets:1024,maxCachedSessions:1024},v=[c,c&&r.sslPinnedCertificates?.map(R=>l(R)).sort()].join();u.agent=yv[v]||(yv[v]=new(c?i:n).Agent(A))}r.type==="json"&&(u.headers["Content-Type"]="application/json"),r.data&&(r.method||(u.method="POST"),u.body=r.type==="json"?JSON.stringify(r.data):r.data),u.headers={...u.headers,...r.headers},r.sslAllowSelfSigned&&(u.rejectUnauthorized=!1);const y=async A=>{const v=A.statusCode;if(r.redirect&&300<=v&&v<400&&A.headers.location){if(r._redirectCount==10)throw new Error("Request failed. Too much redirects.");return r._redirectCount+=1,await T0(a(e,A.headers.location),r)}if(r.expectStatusCode&&v!==r.expectStatusCode)throw A.resume(),new R0(v);let R=[];for await(const F of A)R.push(F);let M=ie.Buffer.concat(R);const P=A.headers["content-encoding"];P==="br"&&(M=await o(s.brotliDecompress)(M)),(P==="gzip"||P==="deflate")&&(M=await o(s.unzip)(M));const H=gv(M,r.type);return r.full?{headers:A.headers,status:v,body:H}:H};return new Promise((A,v)=>{const R=async F=>{if(F&&F.code==="DEPTH_ZERO_SELF_SIGNED_CERT")try{await T0(e,{...r,sslAllowSelfSigned:!0,sslPinnedCertificates:[]})}catch(N){N&&N.fingerprint256&&(F=new I0(`Self-signed SSL certificate: ${N.fingerprint256}`,N.fingerprint256))}v(F)},M=(c?i:n).request(e,u,F=>{F.on("error",R),(async()=>{try{A(await y(F))}catch(N){v(N)}})()});M.on("error",R);const P=r.sslPinnedCertificates?.map(F=>l(F)),H=F=>{const N=l(F.getPeerCertificate()?.fingerprint256||"");if(!(!N&&F.isSessionReused())&&!P.includes(N))return M.emit("error",new I0(`Invalid SSL certificate: ${N} Expected: ${P}`,N)),M.abort()};r.sslPinnedCertificates&&M.on("socket",F=>{F.listeners("secureConnect").map($=>($.name||"").replace("bound ","")).includes("mfetchSecureConnect")||F.on("secureConnect",H.bind(null,F))}),r.keepAlive&&M.setNoDelay(!0),u.body&&M.write(u.body),M.end()})}const w5=new Set(["Accept","Accept-Language","Content-Language","Content-Type"].map(e=>e.toLowerCase())),m5=new Set(["Accept-Charset","Accept-Encoding","Access-Control-Request-Headers","Access-Control-Request-Method","Connection","Content-Length","Cookie","Cookie2","Date","DNT","Expect","Host","Keep-Alive","Origin","Referer","TE","Trailer","Transfer-Encoding","Upgrade","Via"].map(e=>e.toLowerCase()));async function b5(e,t){let r={...pv,...t};const n=new Headers;r.type==="json"&&n.set("Content-Type","application/json");let i=new URL(e);if(i.username){const c=btoa(`${i.username}:${i.password}`);n.set("Authorization",`Basic ${c}`),i.username="",i.password=""}e=""+i;for(let c in r.headers){const u=c.toLowerCase();(w5.has(u)||r.cors&&!m5.has(u))&&n.set(c,r.headers[c])}let s={headers:n,redirect:r.redirect?"follow":"manual"};r.referrer||(s.referrerPolicy="no-referrer"),r.cors&&(s.mode="cors"),r.data&&(r.method||(s.method="POST"),s.body=r.type==="json"?JSON.stringify(r.data):r.data);const o=await fetch(e,s);if(r.expectStatusCode&&o.status!==r.expectStatusCode)throw new R0(o.status);const a=gv(new Uint8Array(await o.arrayBuffer()),r.type);return r.full?{headers:Object.fromEntries(o.headers.entries()),status:o.status,body:a}:a}const v5=!!(typeof process=="object"&&process.versions&&process.versions.node&&process.versions.v8);function _5(e,t){return(v5?T0:b5)(e,t)}ro.default=_5,Object.defineProperty(ra,"__esModule",{value:!0}),ra.getProvider=ra.fetchFromProvider=void 0;const E5=ro,x5=async(e,t)=>(await(0,E5.default)(e,{headers:{"content-type":"application/json"},type:"json",data:{method:t.method,params:t.params,jsonrpc:"2.0",id:1}})).result;ra.fetchFromProvider=x5;const S5=e=>{if(typeof e=="string")return e;if(e?.connection?.url!==void 0)return e.connection.url;throw new Error("Must provide valid provider URL or Web3Provider")};ra.getProvider=S5,function(e){var t=ft&&ft.__createBinding||(Object.create?function(i,s,o,a){a===void 0&&(a=o);var c=Object.getOwnPropertyDescriptor(s,o);(!c||("get"in c?!s.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(i,a,c)}:function(i,s,o,a){a===void 0&&(a=o),i[a]=s[o]}),r=ft&&ft.__exportStar||function(i,s){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&t(s,i,o)};Object.defineProperty(e,"__esModule",{value:!0}),e.toAscii=e.stripHexPrefix=e.padToEven=e.isHexString=e.isHexPrefixed=e.getKeys=e.getBinarySize=e.fromUtf8=e.fromAscii=e.arrayContainsArray=void 0,r(ru,e),r(uu,e),r(ad,e),r(nc,e),r(yu,e),r(an,e),r(to,e),r(gd,e),r(hw,e),r(bu,e);var n=er;Object.defineProperty(e,"arrayContainsArray",{enumerable:!0,get:function(){return n.arrayContainsArray}}),Object.defineProperty(e,"fromAscii",{enumerable:!0,get:function(){return n.fromAscii}}),Object.defineProperty(e,"fromUtf8",{enumerable:!0,get:function(){return n.fromUtf8}}),Object.defineProperty(e,"getBinarySize",{enumerable:!0,get:function(){return n.getBinarySize}}),Object.defineProperty(e,"getKeys",{enumerable:!0,get:function(){return n.getKeys}}),Object.defineProperty(e,"isHexPrefixed",{enumerable:!0,get:function(){return n.isHexPrefixed}}),Object.defineProperty(e,"isHexString",{enumerable:!0,get:function(){return n.isHexString}}),Object.defineProperty(e,"padToEven",{enumerable:!0,get:function(){return n.padToEven}}),Object.defineProperty(e,"stripHexPrefix",{enumerable:!0,get:function(){return n.stripHexPrefix}}),Object.defineProperty(e,"toAscii",{enumerable:!0,get:function(){return n.toAscii}}),r(vu,e),r(ra,e)}(tu);var Qr={},oe={},ya={},Rt={},Yn={},Os={},dn={};Object.defineProperty(dn,"__esModule",{value:!0});function A5(e,t){return e??t()}function B5(e){return Array.isArray(e)&&e.length>0}function I5(e){return e==null}function R5(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}var T5=(e,t)=>Object.hasOwnProperty.call(e,t);function k5(e){return Object.getOwnPropertyNames(e)}var wv=(e=>(e[e.Null=4]="Null",e[e.Comma=1]="Comma",e[e.Wrapper=1]="Wrapper",e[e.True=4]="True",e[e.False=5]="False",e[e.Quote=1]="Quote",e[e.Colon=1]="Colon",e[e.Date=24]="Date",e))(wv||{}),mv=/"|\\|\n|\r|\t/gu;function C5(e){if(typeof e!="object"||e===null)return!1;try{let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch{return!1}}function bv(e){return e.charCodeAt(0)<=127}function L5(e){return e.split("").reduce((r,n)=>bv(n)?r+1:r+2,0)+A5(e.match(mv),()=>[]).length}function $5(e){return e.toString().length}dn.isNonEmptyArray=B5,dn.isNullOrUndefined=I5,dn.isObject=R5,dn.hasProperty=T5,dn.getKnownPropertyNames=k5,dn.JsonSize=wv,dn.ESCAPE_CHARACTERS_REGEXP=mv,dn.isPlainObject=C5,dn.isASCII=bv,dn.calculateStringSize=L5,dn.calculateNumberSize=$5;class k0 extends Error{constructor(t,{cause:r}={}){super(t),this.name=k0.name,r&&(this.cause=r),this.message=t}}var M5=Object.freeze({__proto__:null,ErrorWithCause:k0}),O5=Nn(M5);const N5=(e,t)=>{if(!e||!t||!(e instanceof Error)||!(t.prototype instanceof Error)&&t!==Error)return;const r=new Set;let n=e;for(;n&&!r.has(n);){if(r.add(n),n instanceof t)return n;n=Ju(n)}},Ju=e=>{if(!(!e||typeof e!="object"||!("cause"in e)))if(typeof e.cause=="function"){const t=e.cause();return t instanceof Error?t:void 0}else return e.cause instanceof Error?e.cause:void 0},vv=(e,t)=>{if(!(e instanceof Error))return"";const r=e.stack||"";if(t.has(e))return r+` +causes have become circular...`;const n=Ju(e);return n?(t.add(e),r+` +caused by: `+vv(n,t)):r},P5=e=>vv(e,new Set),_v=(e,t,r)=>{if(!(e instanceof Error))return"";const n=r?"":e.message||"";if(t.has(e))return n+": ...";const i=Ju(e);if(i){t.add(e);const s="cause"in e&&typeof e.cause=="function";return n+(s?"":": ")+_v(i,t,s)}else return n};var U5=Object.freeze({__proto__:null,findCauseByReference:N5,getErrorCause:Ju,stackWithCauses:P5,messageWithCauses:e=>_v(e,new Set)}),F5=Nn(U5);const{ErrorWithCause:D5}=O5,{findCauseByReference:H5,getErrorCause:j5,messageWithCauses:z5,stackWithCauses:q5}=F5;var V5={ErrorWithCause:D5,findCauseByReference:H5,getErrorCause:j5,stackWithCauses:q5,messageWithCauses:z5};Object.defineProperty(Os,"__esModule",{value:!0});var Ev=dn,W5=V5;function K5(e){return e instanceof Error||Ev.isObject.call(void 0,e)&&e.constructor.name==="Error"}function xv(e){return typeof e=="object"&&e!==null&&"code"in e}function Sv(e){return typeof e=="object"&&e!==null&&"message"in e}function Z5(e){return typeof e=="object"&&e!==null&&"stack"in e}function G5(e){return Sv(e)&&typeof e.message=="string"?e.message:Ev.isNullOrUndefined.call(void 0,e)?"":String(e)}function Y5(e,t){if(K5(e)){let r;return Error.length===2?r=new Error(t,{cause:e}):r=new W5.ErrorWithCause(t,{cause:e}),xv(e)&&(r.code=e.code),r}return t.length>0?new Error(`${String(e)}: ${t}`):new Error(String(e))}Os.isErrorWithCode=xv,Os.isErrorWithMessage=Sv,Os.isErrorWithStack=Z5,Os.getErrorMessage=G5,Os.wrapError=Y5;class Av extends TypeError{constructor(t,r){let n;const{message:i,explanation:s,...o}=t,{path:a}=t,c=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??c),s!=null&&(this.cause=c),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function X5(e){return Xn(e)&&typeof e[Symbol.iterator]=="function"}function Xn(e){return typeof e=="object"&&e!=null}function Bv(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Mr(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function J5(e){const{done:t,value:r}=e.next();return t?void 0:r}function Q5(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:i,branch:s}=t,{type:o}=r,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${Mr(n)}\``}=e;return{value:n,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...e,message:c}}function*C0(e,t,r,n){X5(e)||(e=[e]);for(const i of e){const s=Q5(i,t,r,n);s&&(yield s)}}function*L0(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:o=!1}=r,a={path:n,branch:i};if(s&&(e=t.coercer(e,a),o&&t.type!=="type"&&Xn(t.schema)&&Xn(e)&&!Array.isArray(e)))for(const u in e)t.schema[u]===void 0&&delete e[u];let c="valid";for(const u of t.validator(e,a))u.explanation=r.message,c="not_valid",yield[u,void 0];for(let[u,l,y]of t.entries(e,a)){const A=L0(l,y,{path:u===void 0?n:[...n,u],branch:u===void 0?i:[...i,l],coerce:s,mask:o,message:r.message});for(const v of A)v[0]?(c=v[0].refinement!=null?"not_refined":"not_valid",yield[v[0],void 0]):s&&(l=v[1],u===void 0?e=l:e instanceof Map?e.set(u,l):e instanceof Set?e.add(l):Xn(e)&&(l!==void 0||u in e)&&(e[u]=l))}if(c!=="not_valid")for(const u of t.refiner(e,a))u.explanation=r.message,c="not_refined",yield[u,void 0];c==="valid"&&(yield[void 0,e])}class Br{constructor(t){const{type:r,schema:n,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=t;this.type=r,this.schema=n,this.entries=a,this.coercer=o,i?this.validator=(c,u)=>{const l=i(c,u);return C0(l,u,this,c)}:this.validator=()=>[],s?this.refiner=(c,u)=>{const l=s(c,u);return C0(l,u,this,c)}:this.refiner=()=>[]}assert(t,r){return Iv(t,this,r)}create(t,r){return Rv(t,this,r)}is(t){return $0(t,this)}mask(t,r){return Tv(t,this,r)}validate(t,r={}){return wa(t,this,r)}}function Iv(e,t,r){const n=wa(e,t,{message:r});if(n[0])throw n[0]}function Rv(e,t,r){const n=wa(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Tv(e,t,r){const n=wa(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function $0(e,t){return!wa(e,t)[0]}function wa(e,t,r={}){const n=L0(e,t,r),i=J5(n);return i[0]?[new Av(i[0],function*(){for(const o of n)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function ek(...e){const t=e[0].type==="type",r=e.map(i=>i.schema),n=Object.assign({},...r);return t?Cc(n):kc(n)}function xn(e,t){return new Br({type:e,schema:null,validator:t})}function tk(e,t){return new Br({...e,refiner:(r,n)=>r===void 0||e.refiner(r,n),validator(r,n){return r===void 0?!0:(t(r,n),e.validator(r,n))}})}function rk(e){return new Br({type:"dynamic",schema:null,*entries(t,r){yield*e(t,r).entries(t,r)},validator(t,r){return e(t,r).validator(t,r)},coercer(t,r){return e(t,r).coercer(t,r)},refiner(t,r){return e(t,r).refiner(t,r)}})}function nk(e){let t;return new Br({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator(r,n){return t??(t=e()),t.validator(r,n)},coercer(r,n){return t??(t=e()),t.coercer(r,n)},refiner(r,n){return t??(t=e()),t.refiner(r,n)}})}function ik(e,t){const{schema:r}=e,n={...r};for(const i of t)delete n[i];switch(e.type){case"type":return Cc(n);default:return kc(n)}}function sk(e){const t=e instanceof Br,r=t?{...e.schema}:{...e};for(const n in r)r[n]=kv(r[n]);return t&&e.type==="type"?Cc(r):kc(r)}function ok(e,t){const{schema:r}=e,n={};for(const i of t)n[i]=r[i];switch(e.type){case"type":return Cc(n);default:return kc(n)}}function ak(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),xn(e,t)}function ck(){return xn("any",()=>!0)}function fk(e){return new Br({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${Mr(t)}`}})}function uk(){return xn("bigint",e=>typeof e=="bigint")}function lk(){return xn("boolean",e=>typeof e=="boolean")}function hk(){return xn("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${Mr(e)}`)}function dk(e){const t={},r=e.map(n=>Mr(n)).join();for(const n of e)t[n]=n;return new Br({type:"enums",schema:t,validator(n){return e.includes(n)||`Expected one of \`${r}\`, but received: ${Mr(n)}`}})}function pk(){return xn("func",e=>typeof e=="function"||`Expected a function, but received: ${Mr(e)}`)}function gk(e){return xn("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${Mr(t)}`)}function yk(){return xn("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${Mr(e)}`)}function wk(e){return new Br({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)},*validator(t,r){for(const n of e)yield*n.validator(t,r)},*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})}function mk(e){const t=Mr(e),r=typeof e;return new Br({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${Mr(n)}`}})}function bk(e,t){return new Br({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,e],yield[n,i,t]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${Mr(r)}`}})}function M0(){return xn("never",()=>!1)}function vk(e){return new Br({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function _k(){return xn("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${Mr(e)}`)}function kc(e){const t=e?Object.keys(e):[],r=M0();return new Br({type:"object",schema:e||null,*entries(n){if(e&&Xn(n)){const i=new Set(Object.keys(n));for(const s of t)i.delete(s),yield[s,n[s],e[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return Xn(n)||`Expected an object, but received: ${Mr(n)}`},coercer(n){return Xn(n)?{...n}:n}})}function kv(e){return new Br({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function Ek(e,t){return new Br({type:"record",schema:null,*entries(r){if(Xn(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator(r){return Xn(r)||`Expected an object, but received: ${Mr(r)}`}})}function xk(){return xn("regexp",e=>e instanceof RegExp)}function Sk(e){return new Br({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer(t){return t instanceof Set?new Set(t):t},validator(t){return t instanceof Set||`Expected a \`Set\` object, but received: ${Mr(t)}`}})}function Cv(){return xn("string",e=>typeof e=="string"||`Expected a string, but received: ${Mr(e)}`)}function Ak(e){const t=M0();return new Br({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;ir.type).join(" | ");return new Br({type:"union",schema:null,coercer(r){for(const n of e){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of e){const[...o]=L0(r,s,n),[a]=o;if(a[0])for(const[c]of o)c&&i.push(c);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${Mr(r)}`,...i]}})}function Lv(){return xn("unknown",()=>!0)}function O0(e,t,r){return new Br({...e,coercer:(n,i)=>$0(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}function Ik(e,t,r={}){return O0(e,Lv(),n=>{const i=typeof t=="function"?t():t;if(n===void 0)return i;if(!r.strict&&Bv(n)&&Bv(i)){const s={...n};let o=!1;for(const a in i)s[a]===void 0&&(s[a]=i[a],o=!0);if(o)return s}return n})}function Rk(e){return O0(e,Cv(),t=>t.trim())}function Tk(e){return bo(e,"empty",t=>{const r=$v(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function $v(e){return e instanceof Map||e instanceof Set?e.size:e.length}function kk(e,t,r={}){const{exclusive:n}=r;return bo(e,"max",i=>n?in?i>t:i>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${i}\``)}function Lk(e){return bo(e,"nonempty",t=>$v(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function $k(e,t){return bo(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function Mk(e,t,r=t){const n=`Expected a ${e.type}`,i=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return bo(e,"size",s=>{if(typeof s=="number"||s instanceof Date)return t<=s&&s<=r||`${n} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:o}=s;return t<=o&&o<=r||`${n} with a size ${i} but received one with a size of \`${o}\``}else{const{length:o}=s;return t<=o&&o<=r||`${n} with a length ${i} but received one with a length of \`${o}\``}})}function bo(e,t,r){return new Br({...e,*refiner(n,i){yield*e.refiner(n,i);const s=r(n,i),o=C0(s,i,e,n);for(const a of o)yield{...a,refinement:t}}})}var Ok=Object.freeze({__proto__:null,Struct:Br,StructError:Av,any:ck,array:fk,assert:Iv,assign:ek,bigint:uk,boolean:lk,coerce:O0,create:Rv,date:hk,defaulted:Ik,define:xn,deprecated:tk,dynamic:rk,empty:Tk,enums:dk,func:pk,instance:gk,integer:yk,intersection:wk,is:$0,lazy:nk,literal:mk,map:bk,mask:Tv,max:kk,min:Ck,never:M0,nonempty:Lk,nullable:vk,number:_k,object:kc,omit:ik,optional:kv,partial:sk,pattern:$k,pick:ok,record:Ek,refine:bo,regexp:xk,set:Sk,size:Mk,string:Cv,struct:ak,trimmed:Rk,tuple:Ak,type:Cc,union:Bk,unknown:Lv,validate:wa}),Ns=Nn(Ok);Object.defineProperty(Yn,"__esModule",{value:!0});function Nk(e){let t,r=e[0],n=1;for(;nr.call(t,...o)),t=void 0)}return r}var Pk=Os,Uk=Ns;function Fk(e){return typeof Nk([e,"optionalAccess",t=>t.prototype,"optionalAccess",t=>t.constructor,"optionalAccess",t=>t.name])=="string"}function Dk(e){return Pk.getErrorMessage.call(void 0,e).replace(/\.$/u,"")}function Mv(e,t){return Fk(e)?new e({message:t}):e({message:t})}var N0=class extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}};function Hk(e,t="Assertion failed.",r=N0){if(!e)throw t instanceof Error?t:Mv(r,t)}function jk(e,t,r="Assertion failed",n=N0){try{Uk.assert.call(void 0,e,t)}catch(i){throw Mv(n,`${r}: ${Dk(i)}.`)}}function zk(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}Yn.AssertionError=N0,Yn.assert=Hk,Yn.assertStruct=jk,Yn.assertExhaustive=zk;var tr={},Wr={};Object.defineProperty(Wr,"__esModule",{value:!0}),Wr.output=Wr.exists=Wr.hash=Wr.bytes=Wr.bool=Wr.number=Wr.isBytes=void 0;function Qu(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}Wr.number=Qu;function Ov(e){if(typeof e!="boolean")throw new Error(`boolean expected, not ${e}`)}Wr.bool=Ov;function Nv(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}Wr.isBytes=Nv;function P0(e,...t){if(!Nv(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}Wr.bytes=P0;function Pv(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Qu(e.outputLen),Qu(e.blockLen)}Wr.hash=Pv;function Uv(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}Wr.exists=Uv;function Fv(e,t){P0(e);const r=t.outputLen;if(e.length>U0&el)}:{h:Number(e>>U0&el)|0,l:Number(e&el)|0}}at.fromBig=F0;function Dv(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;iBigInt(e>>>0)<>>0);at.toBig=Hv;const jv=(e,t,r)=>e>>>r;at.shrSH=jv;const zv=(e,t,r)=>e<<32-r|t>>>r;at.shrSL=zv;const qv=(e,t,r)=>e>>>r|t<<32-r;at.rotrSH=qv;const Vv=(e,t,r)=>e<<32-r|t>>>r;at.rotrSL=Vv;const Wv=(e,t,r)=>e<<64-r|t>>>r-32;at.rotrBH=Wv;const Kv=(e,t,r)=>e>>>r-32|t<<64-r;at.rotrBL=Kv;const Zv=(e,t)=>t;at.rotr32H=Zv;const Gv=(e,t)=>e;at.rotr32L=Gv;const Yv=(e,t,r)=>e<>>32-r;at.rotlSH=Yv;const Xv=(e,t,r)=>t<>>32-r;at.rotlSL=Xv;const Jv=(e,t,r)=>t<>>64-r;at.rotlBH=Jv;const Qv=(e,t,r)=>e<>>64-r;at.rotlBL=Qv;function e_(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}at.add=e_;const t_=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);at.add3L=t_;const r_=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;at.add3H=r_;const n_=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);at.add4L=n_;const i_=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;at.add4H=i_;const s_=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);at.add5L=s_;const o_=(e,t,r,n,i,s)=>t+r+n+i+s+(e/2**32|0)|0;at.add5H=o_;const Vk={fromBig:F0,split:Dv,toBig:Hv,shrSH:jv,shrSL:zv,rotrSH:qv,rotrSL:Vv,rotrBH:Wv,rotrBL:Kv,rotr32H:Zv,rotr32L:Gv,rotlSH:Yv,rotlSL:Xv,rotlBH:Jv,rotlBL:Qv,add:e_,add3L:t_,add3H:r_,add4L:n_,add4H:i_,add5H:o_,add5L:s_};at.default=Vk;var a_={},tl={};Object.defineProperty(tl,"__esModule",{value:!0}),tl.crypto=void 0,tl.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,function(e){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(e,"__esModule",{value:!0}),e.randomBytes=e.wrapXOFConstructorWithOpts=e.wrapConstructorWithOpts=e.wrapConstructor=e.checkOpts=e.Hash=e.concatBytes=e.toBytes=e.utf8ToBytes=e.asyncLoop=e.nextTick=e.hexToBytes=e.bytesToHex=e.byteSwap32=e.byteSwapIfBE=e.byteSwap=e.isLE=e.rotl=e.rotr=e.createView=e.u32=e.u8=e.isBytes=void 0;const t=tl,r=Wr;function n(I){return I instanceof Uint8Array||I!=null&&typeof I=="object"&&I.constructor.name==="Uint8Array"}e.isBytes=n;const i=I=>new Uint8Array(I.buffer,I.byteOffset,I.byteLength);e.u8=i;const s=I=>new Uint32Array(I.buffer,I.byteOffset,Math.floor(I.byteLength/4));e.u32=s;const o=I=>new DataView(I.buffer,I.byteOffset,I.byteLength);e.createView=o;const a=(I,g)=>I<<32-g|I>>>g;e.rotr=a;const c=(I,g)=>I<>>32-g>>>0;e.rotl=c,e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;const u=I=>I<<24&4278190080|I<<8&16711680|I>>>8&65280|I>>>24&255;e.byteSwap=u,e.byteSwapIfBE=e.isLE?I=>I:I=>(0,e.byteSwap)(I);function l(I){for(let g=0;gg.toString(16).padStart(2,"0"));function A(I){(0,r.bytes)(I);let g="";for(let f=0;f=v._0&&I<=v._9)return I-v._0;if(I>=v._A&&I<=v._F)return I-(v._A-10);if(I>=v._a&&I<=v._f)return I-(v._a-10)}function M(I){if(typeof I!="string")throw new Error("hex string expected, got "+typeof I);const g=I.length,f=g/2;if(g%2)throw new Error("padded hex string expected, got unpadded hex of length "+g);const h=new Uint8Array(f);for(let m=0,_=0;m{};e.nextTick=P;async function H(I,g,f){let h=Date.now();for(let m=0;m=0&&_I().update(N(h)).digest(),f=I();return g.outputLen=f.outputLen,g.blockLen=f.blockLen,g.create=()=>I(),g}e.wrapConstructor=z;function ee(I){const g=(h,m)=>I(m).update(N(h)).digest(),f=I({});return g.outputLen=f.outputLen,g.blockLen=f.blockLen,g.create=h=>I(h),g}e.wrapConstructorWithOpts=ee;function se(I){const g=(h,m)=>I(m).update(N(h)).digest(),f=I({});return g.outputLen=f.outputLen,g.blockLen=f.blockLen,g.create=h=>I(h),g}e.wrapXOFConstructorWithOpts=se;function Q(I=32){if(t.crypto&&typeof t.crypto.getRandomValues=="function")return t.crypto.getRandomValues(new Uint8Array(I));throw new Error("crypto.getRandomValues must be defined")}e.randomBytes=Q}(a_),Object.defineProperty(tr,"__esModule",{value:!0}),tr.shake256=tr.shake128=tr.keccak_512=tr.keccak_384=tr.keccak_256=tr.keccak_224=tr.sha3_512=tr.sha3_384=tr.sha3_256=tr.sha3_224=tr.Keccak=tr.keccakP=void 0;const ma=Wr,Lc=at,Gi=a_,c_=[],f_=[],u_=[],Wk=BigInt(0),$c=BigInt(1),Kk=BigInt(2),Zk=BigInt(7),Gk=BigInt(256),Yk=BigInt(113);for(let e=0,t=$c,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],c_.push(2*(5*n+r)),f_.push((e+1)*(e+2)/2%64);let i=Wk;for(let s=0;s<7;s++)t=(t<<$c^(t>>Zk)*Yk)%Gk,t&Kk&&(i^=$c<<($c<r>32?(0,Lc.rotlBH)(e,t,r):(0,Lc.rotlSH)(e,t,r),h_=(e,t,r)=>r>32?(0,Lc.rotlBL)(e,t,r):(0,Lc.rotlSL)(e,t,r);function d_(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let o=0;o<10;o++)r[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,u=r[c],l=r[c+1],y=l_(u,l,1)^r[a],A=h_(u,l,1)^r[a+1];for(let v=0;v<50;v+=10)e[o+v]^=y,e[o+v+1]^=A}let i=e[2],s=e[3];for(let o=0;o<24;o++){const a=f_[o],c=l_(i,s,a),u=h_(i,s,a),l=c_[o];i=e[l],s=e[l+1],e[l]=c,e[l+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=e[o+a];for(let a=0;a<10;a++)e[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}e[0]^=Xk[n],e[1]^=Jk[n]}r.fill(0)}tr.keccakP=d_;class Mc extends Gi.Hash{constructor(t,r,n,i=!1,s=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,ma.number)(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,Gi.u32)(this.state)}keccak(){Gi.isLE||(0,Gi.byteSwap32)(this.state32),d_(this.state32,this.rounds),Gi.isLE||(0,Gi.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(t){(0,ma.exists)(this);const{blockLen:r,state:n}=this;t=(0,Gi.toBytes)(t);const i=t.length;for(let s=0;s=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);t.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,ma.number)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,ma.output)(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return t||(t=new Mc(r,n,i,o,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=n,t.outputLen=i,t.enableXOF=o,t.destroyed=this.destroyed,t}}tr.Keccak=Mc;const Ps=(e,t,r)=>(0,Gi.wrapConstructor)(()=>new Mc(t,e,r));tr.sha3_224=Ps(6,144,224/8),tr.sha3_256=Ps(6,136,256/8),tr.sha3_384=Ps(6,104,384/8),tr.sha3_512=Ps(6,72,512/8),tr.keccak_224=Ps(1,144,224/8),tr.keccak_256=Ps(1,136,256/8),tr.keccak_384=Ps(1,104,384/8),tr.keccak_512=Ps(1,72,512/8);const p_=(e,t,r)=>(0,Gi.wrapXOFConstructorWithOpts)((n={})=>new Mc(t,e,n.dkLen===void 0?r:n.dkLen,!0));tr.shake128=p_(31,168,128/8),tr.shake256=p_(31,136,256/8);var D0={};(function(e){/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(e,"__esModule",{value:!0}),e.bytes=e.stringToBytes=e.str=e.bytesToString=e.hex=e.utf8=e.bech32m=e.bech32=e.base58check=e.createBase58check=e.base58xmr=e.base58xrp=e.base58flickr=e.base58=e.base64urlnopad=e.base64url=e.base64nopad=e.base64=e.base32crockford=e.base32hex=e.base32=e.base16=e.utils=e.assertNumber=void 0;function t(I){if(!Number.isSafeInteger(I))throw new Error(`Wrong integer: ${I}`)}e.assertNumber=t;function r(I){return I instanceof Uint8Array||I!=null&&typeof I=="object"&&I.constructor.name==="Uint8Array"}function n(...I){const g=_=>_,f=(_,E)=>x=>_(E(x)),h=I.map(_=>_.encode).reduceRight(f,g),m=I.map(_=>_.decode).reduce(f,g);return{encode:h,decode:m}}function i(I){return{encode:g=>{if(!Array.isArray(g)||g.length&&typeof g[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return g.map(f=>{if(t(f),f<0||f>=I.length)throw new Error(`Digit index outside alphabet: ${f} (alphabet: ${I.length})`);return I[f]})},decode:g=>{if(!Array.isArray(g)||g.length&&typeof g[0]!="string")throw new Error("alphabet.decode input should be array of strings");return g.map(f=>{if(typeof f!="string")throw new Error(`alphabet.decode: not string element=${f}`);const h=I.indexOf(f);if(h===-1)throw new Error(`Unknown letter: "${f}". Allowed: ${I}`);return h})}}}function s(I=""){if(typeof I!="string")throw new Error("join separator should be string");return{encode:g=>{if(!Array.isArray(g)||g.length&&typeof g[0]!="string")throw new Error("join.encode input should be array of strings");for(let f of g)if(typeof f!="string")throw new Error(`join.encode: non-string input=${f}`);return g.join(I)},decode:g=>{if(typeof g!="string")throw new Error("join.decode input should be string");return g.split(I)}}}function o(I,g="="){if(t(I),typeof g!="string")throw new Error("padding chr should be string");return{encode(f){if(!Array.isArray(f)||f.length&&typeof f[0]!="string")throw new Error("padding.encode input should be array of strings");for(let h of f)if(typeof h!="string")throw new Error(`padding.encode: non-string input=${h}`);for(;f.length*I%8;)f.push(g);return f},decode(f){if(!Array.isArray(f)||f.length&&typeof f[0]!="string")throw new Error("padding.encode input should be array of strings");for(let m of f)if(typeof m!="string")throw new Error(`padding.decode: non-string input=${m}`);let h=f.length;if(h*I%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;h>0&&f[h-1]===g;h--)if(!((h-1)*I%8))throw new Error("Invalid padding: string has too much padding");return f.slice(0,h)}}}function a(I){if(typeof I!="function")throw new Error("normalize fn should be function");return{encode:g=>g,decode:g=>I(g)}}function c(I,g,f){if(g<2)throw new Error(`convertRadix: wrong from=${g}, base cannot be less than 2`);if(f<2)throw new Error(`convertRadix: wrong to=${f}, base cannot be less than 2`);if(!Array.isArray(I))throw new Error("convertRadix: data should be array");if(!I.length)return[];let h=0;const m=[],_=Array.from(I);for(_.forEach(E=>{if(t(E),E<0||E>=g)throw new Error(`Wrong integer: ${E}`)});;){let E=0,x=!0;for(let T=h;T<_.length;T++){const B=_[T],d=g*E+B;if(!Number.isSafeInteger(d)||g*E/g!==E||d-B!==g*E)throw new Error("convertRadix: carry overflow");E=d%f;const k=Math.floor(d/f);if(_[T]=k,!Number.isSafeInteger(k)||k*f+E!==d)throw new Error("convertRadix: carry overflow");if(x)k?x=!1:h=T;else continue}if(m.push(E),x)break}for(let E=0;Eg?u(g,I%g):I,l=(I,g)=>I+(g-u(I,g));function y(I,g,f,h){if(!Array.isArray(I))throw new Error("convertRadix2: data should be array");if(g<=0||g>32)throw new Error(`convertRadix2: wrong from=${g}`);if(f<=0||f>32)throw new Error(`convertRadix2: wrong to=${f}`);if(l(g,f)>32)throw new Error(`convertRadix2: carry overflow from=${g} to=${f} carryBits=${l(g,f)}`);let m=0,_=0;const E=2**f-1,x=[];for(const T of I){if(t(T),T>=2**g)throw new Error(`convertRadix2: invalid data word=${T} from=${g}`);if(m=m<32)throw new Error(`convertRadix2: carry overflow pos=${_} from=${g}`);for(_+=g;_>=f;_-=f)x.push((m>>_-f&E)>>>0);m&=2**_-1}if(m=m<=g)throw new Error("Excess padding");if(!h&&m)throw new Error(`Non-zero padding: ${m}`);return h&&_>0&&x.push(m>>>0),x}function A(I){return t(I),{encode:g=>{if(!r(g))throw new Error("radix.encode input should be Uint8Array");return c(Array.from(g),2**8,I)},decode:g=>{if(!Array.isArray(g)||g.length&&typeof g[0]!="number")throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(c(g,I,2**8))}}}function v(I,g=!1){if(t(I),I<=0||I>32)throw new Error("radix2: bits should be in (0..32]");if(l(8,I)>32||l(I,8)>32)throw new Error("radix2: carry overflow");return{encode:f=>{if(!r(f))throw new Error("radix2.encode input should be Uint8Array");return y(Array.from(f),8,I,!g)},decode:f=>{if(!Array.isArray(f)||f.length&&typeof f[0]!="number")throw new Error("radix2.decode input should be array of numbers");return Uint8Array.from(y(f,I,8,g))}}}function R(I){if(typeof I!="function")throw new Error("unsafeWrapper fn should be function");return function(...g){try{return I.apply(null,g)}catch{}}}function M(I,g){if(t(I),typeof g!="function")throw new Error("checksum fn should be function");return{encode(f){if(!r(f))throw new Error("checksum.encode: input should be Uint8Array");const h=g(f).slice(0,I),m=new Uint8Array(f.length+I);return m.set(f),m.set(h,f.length),m},decode(f){if(!r(f))throw new Error("checksum.decode: input should be Uint8Array");const h=f.slice(0,-I),m=g(h).slice(0,I),_=f.slice(-I);for(let E=0;EI.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),e.base64=n(v(6),i("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),o(6),s("")),e.base64nopad=n(v(6),i("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),s("")),e.base64url=n(v(6),i("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),o(6),s("")),e.base64urlnopad=n(v(6),i("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),s(""));const P=I=>n(A(58),i(I),s(""));e.base58=P("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),e.base58flickr=P("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),e.base58xrp=P("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const H=[0,2,3,5,6,7,9,10,11];e.base58xmr={encode(I){let g="";for(let f=0;fn(M(4,g=>I(I(g))),e.base58);e.createBase58check=F,e.base58check=e.createBase58check;const N=n(i("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),s("")),$=[996825010,642813549,513874426,1027748829,705979059];function q(I){const g=I>>25;let f=(I&33554431)<<5;for(let h=0;h<$.length;h++)(g>>h&1)===1&&(f^=$[h]);return f}function G(I,g,f=1){const h=I.length;let m=1;for(let _=0;_126)throw new Error(`Invalid prefix (${I})`);m=q(m)^E>>5}m=q(m);for(let _=0;_W)throw new TypeError(`Length ${K} exceeds limit ${W}`);const re=d.toLowerCase(),xe=G(re,k,g);return`${re}1${N.encode(k)}${xe}`}function x(d,k=90){if(typeof d!="string")throw new Error(`bech32.decode input should be string, not ${typeof d}`);if(d.length<8||k!==!1&&d.length>k)throw new TypeError(`Wrong string length: ${d.length} (${d}). Expected (8..${k})`);const W=d.toLowerCase();if(d!==W&&d!==d.toUpperCase())throw new Error("String must be lowercase or uppercase");const K=W.lastIndexOf("1");if(K===0||K===-1)throw new Error('Letter "1" must be present between prefix and data only');const re=W.slice(0,K),xe=W.slice(K+1);if(xe.length<6)throw new Error("Data must be at least 6 characters long");const be=N.decode(xe).slice(0,-6),ge=G(re,be,g);if(!xe.endsWith(ge))throw new Error(`Invalid checksum in ${d}: expected "${ge}"`);return{prefix:re,words:be}}const T=R(x);function B(d){const{prefix:k,words:W}=x(d,!1);return{prefix:k,words:W,bytes:h(W)}}return{encode:E,decode:x,decodeToBytes:B,decodeUnsafe:T,fromWords:h,fromWordsUnsafe:_,toWords:m}}e.bech32=Z("bech32"),e.bech32m=Z("bech32m"),e.utf8={encode:I=>new TextDecoder().decode(I),decode:I=>new TextEncoder().encode(I)},e.hex=n(v(4),i("0123456789abcdef"),s(""),a(I=>{if(typeof I!="string"||I.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof I} with length ${I.length}`);return I.toLowerCase()}));const z={utf8:e.utf8,hex:e.hex,base16:e.base16,base32:e.base32,base64:e.base64,base64url:e.base64url,base58:e.base58,base58xmr:e.base58xmr},ee="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr",se=(I,g)=>{if(typeof I!="string"||!z.hasOwnProperty(I))throw new TypeError(ee);if(!r(g))throw new TypeError("bytesToString() expects Uint8Array");return z[I].encode(g)};e.bytesToString=se,e.str=e.bytesToString;const Q=(I,g)=>{if(!z.hasOwnProperty(I))throw new TypeError(ee);if(typeof g!="string")throw new TypeError("stringToBytes() expects string");return z[I].decode(g)};e.stringToBytes=Q,e.bytes=e.stringToBytes})(D0),Object.defineProperty(Rt,"__esModule",{value:!0});function Qk(e){let t,r=e[0],n=1;for(;nr.call(t,...o)),t=void 0)}return r}var Kr=Yn,eC=tr,pn=Ns,g_=D0,y_=48,w_=58,m_=87;function tC(){const e=[];return()=>{if(e.length===0)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}var rC=tC();function H0(e){return e instanceof Uint8Array}function vo(e){Kr.assert.call(void 0,H0(e),"Value must be a Uint8Array.")}function j0(e){if(vo(e),e.length===0)return"0x";const t=rC(),r=new Array(e.length);for(let n=0;ni.toLowerCase,"optionalCall",i=>i()])==="0x")return new Uint8Array;T_(e);const t=nl(e).toLowerCase(),r=t.length%2===0?t:`0${t}`,n=new Uint8Array(r.length/2);for(let i=0;i=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return rl(t)}function aC(e,t){Kr.assert.call(void 0,t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function cC(e,t){Kr.assert.call(void 0,typeof e=="bigint","Value must be a bigint."),Kr.assert.call(void 0,typeof t=="number","Byte length must be a number."),Kr.assert.call(void 0,t>0,"Byte length must be greater than 0."),Kr.assert.call(void 0,aC(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let i=0;i>=BigInt(8);return n.reverse()}function __(e){Kr.assert.call(void 0,typeof e=="number","Value must be a number."),Kr.assert.call(void 0,e>=0,"Value must be a non-negative number."),Kr.assert.call(void 0,Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return rl(t)}function E_(e){return Kr.assert.call(void 0,typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}function fC(e){return Kr.assert.call(void 0,typeof e=="string","Value must be a string."),g_.base64.decode(e)}function x_(e){if(typeof e=="bigint")return v_(e);if(typeof e=="number")return __(e);if(typeof e=="string")return e.startsWith("0x")?rl(e):E_(e);if(H0(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}function uC(e){const t=new Array(e.length);let r=0;for(let i=0;i{const s=r[i];return Kr.assert.call(void 0,pn.is.call(void 0,s,pn.string.call(void 0)),"Hash shorter than address."),parseInt(s,16)>7?n.toUpperCase():n}).join("")}`}function C_(e){return pn.is.call(void 0,e,z0)?k_(e)===e:!1}function L_(e){return e.startsWith("0x")?e:e.startsWith("0X")?`0x${e.substring(2)}`:`0x${e}`}function nl(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}Rt.HexStruct=S_,Rt.StrictHexStruct=A_,Rt.HexAddressStruct=B_,Rt.HexChecksumAddressStruct=z0,Rt.isHexString=I_,Rt.isStrictHexString=R_,Rt.assertIsHexString=T_,Rt.assertIsStrictHexString=hC,Rt.isValidHexAddress=dC,Rt.getChecksumAddress=k_,Rt.isValidChecksumAddress=C_,Rt.add0x=L_,Rt.remove0x=nl,Rt.isBytes=H0,Rt.assertIsBytes=vo,Rt.bytesToHex=j0,Rt.bytesToBigInt=b_,Rt.bytesToSignedBigInt=nC,Rt.bytesToNumber=iC,Rt.bytesToString=sC,Rt.bytesToBase64=oC,Rt.hexToBytes=rl,Rt.bigIntToBytes=v_,Rt.signedBigIntToBytes=cC,Rt.numberToBytes=__,Rt.stringToBytes=E_,Rt.base64ToBytes=fC,Rt.valueToBytes=x_,Rt.concatBytes=uC,Rt.createDataView=lC,Object.defineProperty(ya,"__esModule",{value:!0});var Oc=Rt,ba=Yn,pC=e=>(ba.assert.call(void 0,typeof e=="number","Value must be a number."),ba.assert.call(void 0,e>=0,"Value must be a non-negative number."),ba.assert.call(void 0,Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),Oc.add0x.call(void 0,e.toString(16))),gC=e=>(ba.assert.call(void 0,typeof e=="bigint","Value must be a bigint."),ba.assert.call(void 0,e>=0,"Value must be a non-negative bigint."),Oc.add0x.call(void 0,e.toString(16))),yC=e=>{Oc.assertIsHexString.call(void 0,e);const t=parseInt(e,16);return ba.assert.call(void 0,Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t},wC=e=>(Oc.assertIsHexString.call(void 0,e),BigInt(Oc.add0x.call(void 0,e)));ya.numberToHex=pC,ya.bigIntToHex=gC,ya.hexToNumber=yC,ya.hexToBigInt=wC;var q0={};Object.defineProperty(q0,"__esModule",{value:!0});function mC({suppressUnhandledRejection:e=!1}={}){let t,r;const n=new Promise((i,s)=>{t=i,r=s});return e&&n.catch(i=>{}),{promise:n,resolve:t,reject:r}}q0.createDeferredPromise=mC;var Nc={};Object.defineProperty(Nc,"__esModule",{value:!0});var $_=(e=>(e[e.Millisecond=1]="Millisecond",e[e.Second=1e3]="Second",e[e.Minute=6e4]="Minute",e[e.Hour=36e5]="Hour",e[e.Day=864e5]="Day",e[e.Week=6048e5]="Week",e[e.Year=31536e6]="Year",e))($_||{}),bC=e=>Number.isInteger(e)&&e>=0,M_=(e,t)=>{if(!bC(e))throw new Error(`"${t}" must be a non-negative integer. Received: "${e}".`)};function vC(e,t){return M_(e,"count"),e*t}function _C(e){return M_(e,"timestamp"),Date.now()-e}Nc.Duration=$_,Nc.inMilliseconds=vC,Nc.timeSince=_C;var ai={},_o={exports:{}};const EC="2.0.0",O_=256,xC=Number.MAX_SAFE_INTEGER||9007199254740991,SC=16,AC=O_-6;var il={MAX_LENGTH:O_,MAX_SAFE_COMPONENT_LENGTH:SC,MAX_SAFE_BUILD_LENGTH:AC,MAX_SAFE_INTEGER:xC,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:EC,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},sl=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=il,s=sl;t=e.exports={};const o=t.re=[],a=t.safeRe=[],c=t.src=[],u=t.t={};let l=0;const y="[a-zA-Z0-9-]",A=[["\\s",1],["\\d",i],[y,n]],v=M=>{for(const[P,H]of A)M=M.split(`${P}*`).join(`${P}{0,${H}}`).split(`${P}+`).join(`${P}{1,${H}}`);return M},R=(M,P,H)=>{const F=v(P),N=l++;s(M,N,P),u[M]=N,c[N]=P,o[N]=new RegExp(P,H?"g":void 0),a[N]=new RegExp(F,H?"g":void 0)};R("NUMERICIDENTIFIER","0|[1-9]\\d*"),R("NUMERICIDENTIFIERLOOSE","\\d+"),R("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${y}*`),R("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),R("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),R("PRERELEASEIDENTIFIER",`(?:${c[u.NUMERICIDENTIFIER]}|${c[u.NONNUMERICIDENTIFIER]})`),R("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NUMERICIDENTIFIERLOOSE]}|${c[u.NONNUMERICIDENTIFIER]})`),R("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),R("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),R("BUILDIDENTIFIER",`${y}+`),R("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),R("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),R("FULL",`^${c[u.FULLPLAIN]}$`),R("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),R("LOOSE",`^${c[u.LOOSEPLAIN]}$`),R("GTLT","((?:<|>)?=?)"),R("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),R("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),R("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),R("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),R("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),R("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),R("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),R("COERCE",`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),R("COERCEFULL",c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),R("COERCERTL",c[u.COERCE],!0),R("COERCERTLFULL",c[u.COERCEFULL],!0),R("LONETILDE","(?:~>?)"),R("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",R("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),R("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),R("LONECARET","(?:\\^)"),R("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",R("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),R("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),R("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),R("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),R("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",R("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),R("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),R("STAR","(<|>)?=?\\s*\\*"),R("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),R("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(_o,_o.exports);const BC=Object.freeze({loose:!0}),IC=Object.freeze({});var V0=e=>e?typeof e!="object"?BC:e:IC;const N_=/^[0-9]+$/,P_=(e,t)=>{const r=N_.test(e),n=N_.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:eP_(t,e)};const ol=sl,{MAX_LENGTH:F_,MAX_SAFE_INTEGER:al}=il,{safeRe:D_,t:H_}=_o.exports,RC=V0,{compareIdentifiers:va}=U_;class ci{constructor(t,r){if(r=RC(r),t instanceof ci){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>F_)throw new TypeError(`version is longer than ${F_} characters`);ol("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?D_[H_.LOOSE]:D_[H_.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>al||this.major<0)throw new TypeError("Invalid major version");if(this.minor>al||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>al||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),va(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}var gn=ci;const j_=gn;var _a=(e,t,r=!1)=>{if(e instanceof j_)return e;try{return new j_(e,t)}catch(n){if(!r)return null;throw n}};const TC=_a;var kC=(e,t)=>{const r=TC(e,t);return r?r.version:null};const CC=_a;var LC=(e,t)=>{const r=CC(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};const z_=gn;var $C=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new z_(e instanceof z_?e.version:e,r).inc(t,n,i).version}catch{return null}};const q_=_a;var MC=(e,t)=>{const r=q_(e,null,!0),n=q_(t,null,!0),i=r.compare(n);if(i===0)return null;const s=i>0,o=s?r:n,a=s?n:r,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c)return!a.patch&&!a.minor?"major":o.patch?"patch":o.minor?"minor":"major";const l=c?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};const OC=gn;var NC=(e,t)=>new OC(e,t).major;const PC=gn;var UC=(e,t)=>new PC(e,t).minor;const FC=gn;var DC=(e,t)=>new FC(e,t).patch;const HC=_a;var jC=(e,t)=>{const r=HC(e,t);return r&&r.prerelease.length?r.prerelease:null};const V_=gn;var fi=(e,t,r)=>new V_(e,r).compare(new V_(t,r));const zC=fi;var qC=(e,t,r)=>zC(t,e,r);const VC=fi;var WC=(e,t)=>VC(e,t,!0);const W_=gn;var W0=(e,t,r)=>{const n=new W_(e,r),i=new W_(t,r);return n.compare(i)||n.compareBuild(i)};const KC=W0;var ZC=(e,t)=>e.sort((r,n)=>KC(r,n,t));const GC=W0;var YC=(e,t)=>e.sort((r,n)=>GC(n,r,t));const XC=fi;var cl=(e,t,r)=>XC(e,t,r)>0;const JC=fi;var K0=(e,t,r)=>JC(e,t,r)<0;const QC=fi;var K_=(e,t,r)=>QC(e,t,r)===0;const eL=fi;var Z_=(e,t,r)=>eL(e,t,r)!==0;const tL=fi;var Z0=(e,t,r)=>tL(e,t,r)>=0;const rL=fi;var G0=(e,t,r)=>rL(e,t,r)<=0;const nL=K_,iL=Z_,sL=cl,oL=Z0,aL=K0,cL=G0;var G_=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return nL(e,r,n);case"!=":return iL(e,r,n);case">":return sL(e,r,n);case">=":return oL(e,r,n);case"<":return aL(e,r,n);case"<=":return cL(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};const fL=gn,uL=_a,{safeRe:fl,t:ul}=_o.exports;var lL=(e,t)=>{if(e instanceof fL)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?fl[ul.COERCEFULL]:fl[ul.COERCE]);else{const c=t.includePrerelease?fl[ul.COERCERTLFULL]:fl[ul.COERCERTL];let u;for(;(u=c.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||u.index+u[0].length!==r.index+r[0].length)&&(r=u),c.lastIndex=u.index+u[1].length+u[2].length;c.lastIndex=-1}if(r===null)return null;const n=r[2],i=r[3]||"0",s=r[4]||"0",o=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return uL(`${n}.${i}.${s}${o}${a}`,t)};class hL{constructor(){this.max=1e3,this.map=new Map}get(t){const r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(t,r)}return this}}var dL=hL,Y0,Y_;function ui(){if(Y_)return Y0;Y_=1;class e{constructor(f,h){if(h=n(h),f instanceof e)return f.loose===!!h.loose&&f.includePrerelease===!!h.includePrerelease?f:new e(f.raw,h);if(f instanceof i)return this.raw=f.value,this.set=[[f]],this.format(),this;if(this.options=h,this.loose=!!h.loose,this.includePrerelease=!!h.includePrerelease,this.raw=f.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(m=>this.parseRange(m.trim())).filter(m=>m.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const m=this.set[0];if(this.set=this.set.filter(_=>!R(_[0])),this.set.length===0)this.set=[m];else if(this.set.length>1){for(const _ of this.set)if(_.length===1&&M(_[0])){this.set=[_];break}}}this.format()}format(){return this.range=this.set.map(f=>f.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(f){const m=((this.options.includePrerelease&&A)|(this.options.loose&&v))+":"+f,_=r.get(m);if(_)return _;const E=this.options.loose,x=E?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];f=f.replace(x,Q(this.options.includePrerelease)),s("hyphen replace",f),f=f.replace(a[c.COMPARATORTRIM],u),s("comparator trim",f),f=f.replace(a[c.TILDETRIM],l),s("tilde trim",f),f=f.replace(a[c.CARETTRIM],y),s("caret trim",f);let T=f.split(" ").map(W=>H(W,this.options)).join(" ").split(/\s+/).map(W=>se(W,this.options));E&&(T=T.filter(W=>(s("loose invalid filter",W,this.options),!!W.match(a[c.COMPARATORLOOSE])))),s("range list",T);const B=new Map,d=T.map(W=>new i(W,this.options));for(const W of d){if(R(W))return[W];B.set(W.value,W)}B.size>1&&B.has("")&&B.delete("");const k=[...B.values()];return r.set(m,k),k}intersects(f,h){if(!(f instanceof e))throw new TypeError("a Range is required");return this.set.some(m=>P(m,h)&&f.set.some(_=>P(_,h)&&m.every(E=>_.every(x=>E.intersects(x,h)))))}test(f){if(!f)return!1;if(typeof f=="string")try{f=new o(f,this.options)}catch{return!1}for(let h=0;hg.value==="<0.0.0-0",M=g=>g.value==="",P=(g,f)=>{let h=!0;const m=g.slice();let _=m.pop();for(;h&&m.length;)h=m.every(E=>_.intersects(E,f)),_=m.pop();return h},H=(g,f)=>(s("comp",g,f),g=q(g,f),s("caret",g),g=N(g,f),s("tildes",g),g=Z(g,f),s("xrange",g),g=ee(g,f),s("stars",g),g),F=g=>!g||g.toLowerCase()==="x"||g==="*",N=(g,f)=>g.trim().split(/\s+/).map(h=>$(h,f)).join(" "),$=(g,f)=>{const h=f.loose?a[c.TILDELOOSE]:a[c.TILDE];return g.replace(h,(m,_,E,x,T)=>{s("tilde",g,m,_,E,x,T);let B;return F(_)?B="":F(E)?B=`>=${_}.0.0 <${+_+1}.0.0-0`:F(x)?B=`>=${_}.${E}.0 <${_}.${+E+1}.0-0`:T?(s("replaceTilde pr",T),B=`>=${_}.${E}.${x}-${T} <${_}.${+E+1}.0-0`):B=`>=${_}.${E}.${x} <${_}.${+E+1}.0-0`,s("tilde return",B),B})},q=(g,f)=>g.trim().split(/\s+/).map(h=>G(h,f)).join(" "),G=(g,f)=>{s("caret",g,f);const h=f.loose?a[c.CARETLOOSE]:a[c.CARET],m=f.includePrerelease?"-0":"";return g.replace(h,(_,E,x,T,B)=>{s("caret",g,_,E,x,T,B);let d;return F(E)?d="":F(x)?d=`>=${E}.0.0${m} <${+E+1}.0.0-0`:F(T)?E==="0"?d=`>=${E}.${x}.0${m} <${E}.${+x+1}.0-0`:d=`>=${E}.${x}.0${m} <${+E+1}.0.0-0`:B?(s("replaceCaret pr",B),E==="0"?x==="0"?d=`>=${E}.${x}.${T}-${B} <${E}.${x}.${+T+1}-0`:d=`>=${E}.${x}.${T}-${B} <${E}.${+x+1}.0-0`:d=`>=${E}.${x}.${T}-${B} <${+E+1}.0.0-0`):(s("no pr"),E==="0"?x==="0"?d=`>=${E}.${x}.${T}${m} <${E}.${x}.${+T+1}-0`:d=`>=${E}.${x}.${T}${m} <${E}.${+x+1}.0-0`:d=`>=${E}.${x}.${T} <${+E+1}.0.0-0`),s("caret return",d),d})},Z=(g,f)=>(s("replaceXRanges",g,f),g.split(/\s+/).map(h=>z(h,f)).join(" ")),z=(g,f)=>{g=g.trim();const h=f.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return g.replace(h,(m,_,E,x,T,B)=>{s("xRange",g,m,_,E,x,T,B);const d=F(E),k=d||F(x),W=k||F(T),K=W;return _==="="&&K&&(_=""),B=f.includePrerelease?"-0":"",d?_===">"||_==="<"?m="<0.0.0-0":m="*":_&&K?(k&&(x=0),T=0,_===">"?(_=">=",k?(E=+E+1,x=0,T=0):(x=+x+1,T=0)):_==="<="&&(_="<",k?E=+E+1:x=+x+1),_==="<"&&(B="-0"),m=`${_+E}.${x}.${T}${B}`):k?m=`>=${E}.0.0${B} <${+E+1}.0.0-0`:W&&(m=`>=${E}.${x}.0${B} <${E}.${+x+1}.0-0`),s("xRange return",m),m})},ee=(g,f)=>(s("replaceStars",g,f),g.trim().replace(a[c.STAR],"")),se=(g,f)=>(s("replaceGTE0",g,f),g.trim().replace(a[f.includePrerelease?c.GTE0PRE:c.GTE0],"")),Q=g=>(f,h,m,_,E,x,T,B,d,k,W,K)=>(F(m)?h="":F(_)?h=`>=${m}.0.0${g?"-0":""}`:F(E)?h=`>=${m}.${_}.0${g?"-0":""}`:x?h=`>=${h}`:h=`>=${h}${g?"-0":""}`,F(d)?B="":F(k)?B=`<${+d+1}.0.0-0`:F(W)?B=`<${d}.${+k+1}.0-0`:K?B=`<=${d}.${k}.${W}-${K}`:g?B=`<${d}.${k}.${+W+1}-0`:B=`<=${B}`,`${h} ${B}`.trim()),I=(g,f,h)=>{for(let m=0;m0){const _=g[m].semver;if(_.major===f.major&&_.minor===f.minor&&_.patch===f.patch)return!0}return!1}return!0};return Y0}var X0,X_;function ll(){if(X_)return X0;X_=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(l,y){if(y=r(y),l instanceof t){if(l.loose===!!y.loose)return l;l=l.value}l=l.trim().split(/\s+/).join(" "),o("comparator",l,y),this.options=y,this.loose=!!y.loose,this.parse(l),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(l){const y=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],A=l.match(y);if(!A)throw new TypeError(`Invalid comparator: ${l}`);this.operator=A[1]!==void 0?A[1]:"",this.operator==="="&&(this.operator=""),A[2]?this.semver=new a(A[2],this.options.loose):this.semver=e}toString(){return this.value}test(l){if(o("Comparator.test",l,this.options.loose),this.semver===e||l===e)return!0;if(typeof l=="string")try{l=new a(l,this.options)}catch{return!1}return s(l,this.operator,this.semver,this.options)}intersects(l,y){if(!(l instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(l.value,y).test(this.value):l.operator===""?l.value===""?!0:new c(this.value,y).test(l.semver):(y=r(y),y.includePrerelease&&(this.value==="<0.0.0-0"||l.value==="<0.0.0-0")||!y.includePrerelease&&(this.value.startsWith("<0.0.0")||l.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&l.operator.startsWith(">")||this.operator.startsWith("<")&&l.operator.startsWith("<")||this.semver.version===l.semver.version&&this.operator.includes("=")&&l.operator.includes("=")||s(this.semver,"<",l.semver,y)&&this.operator.startsWith(">")&&l.operator.startsWith("<")||s(this.semver,">",l.semver,y)&&this.operator.startsWith("<")&&l.operator.startsWith(">")))}}X0=t;const r=V0,{safeRe:n,t:i}=_o.exports,s=G_,o=sl,a=gn,c=ui();return X0}const pL=ui();var hl=(e,t,r)=>{try{t=new pL(t,r)}catch{return!1}return t.test(e)};const gL=ui();var yL=(e,t)=>new gL(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));const wL=gn,mL=ui();var bL=(e,t,r)=>{let n=null,i=null,s=null;try{s=new mL(t,r)}catch{return null}return e.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new wL(n,r))}),n};const vL=gn,_L=ui();var EL=(e,t,r)=>{let n=null,i=null,s=null;try{s=new _L(t,r)}catch{return null}return e.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new vL(n,r))}),n};const J0=gn,xL=ui(),J_=cl;var SL=(e,t)=>{e=new xL(e,t);let r=new J0("0.0.0");if(e.test(r)||(r=new J0("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n{const a=new J0(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||J_(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||J_(r,s))&&(r=s)}return r&&e.test(r)?r:null};const AL=ui();var BL=(e,t)=>{try{return new AL(e,t).range||"*"}catch{return null}};const IL=gn,Q_=ll(),{ANY:RL}=Q_,TL=ui(),kL=hl,e2=cl,t2=K0,CL=G0,LL=Z0;var Q0=(e,t,r,n)=>{e=new IL(e,n),t=new TL(t,n);let i,s,o,a,c;switch(r){case">":i=e2,s=CL,o=t2,a=">",c=">=";break;case"<":i=t2,s=LL,o=e2,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(kL(e,t,n))return!1;for(let u=0;u{v.semver===RL&&(v=new Q_(">=0.0.0")),y=y||v,A=A||v,i(v.semver,y.semver,n)?y=v:o(v.semver,A.semver,n)&&(A=v)}),y.operator===a||y.operator===c||(!A.operator||A.operator===a)&&s(e,A.semver))return!1;if(A.operator===c&&o(e,A.semver))return!1}return!0};const $L=Q0;var ML=(e,t,r)=>$L(e,t,">",r);const OL=Q0;var NL=(e,t,r)=>OL(e,t,"<",r);const r2=ui();var PL=(e,t,r)=>(e=new r2(e,r),t=new r2(t,r),e.intersects(t,r));const UL=hl,FL=fi;var DL=(e,t,r)=>{const n=[];let i=null,s=null;const o=e.sort((l,y)=>FL(l,y,r));for(const l of o)UL(l,t,r)?(s=l,i||(i=l)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const a=[];for(const[l,y]of n)l===y?a.push(l):!y&&l===o[0]?a.push("*"):y?l===o[0]?a.push(`<=${y}`):a.push(`${l} - ${y}`):a.push(`>=${l}`);const c=a.join(" || "),u=typeof t.raw=="string"?t.raw:String(t);return c.length{if(e===t)return!0;e=new n2(e,r),t=new n2(t,r);let n=!1;e:for(const i of e.set){for(const s of t.set){const o=zL(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},jL=[new ep(">=0.0.0-0")],i2=[new ep(">=0.0.0")],zL=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===tp){if(t.length===1&&t[0].semver===tp)return!0;r.includePrerelease?e=jL:e=i2}if(t.length===1&&t[0].semver===tp){if(r.includePrerelease)return!0;t=i2}const n=new Set;let i,s;for(const v of e)v.operator===">"||v.operator===">="?i=s2(i,v,r):v.operator==="<"||v.operator==="<="?s=o2(s,v,r):n.add(v.semver);if(n.size>1)return null;let o;if(i&&s){if(o=rp(i.semver,s.semver,r),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const v of n){if(i&&!Pc(v,String(i),r)||s&&!Pc(v,String(s),r))return null;for(const R of t)if(!Pc(v,String(R),r))return!1;return!0}let a,c,u,l,y=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,A=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;y&&y.prerelease.length===1&&s.operator==="<"&&y.prerelease[0]===0&&(y=!1);for(const v of t){if(l=l||v.operator===">"||v.operator===">=",u=u||v.operator==="<"||v.operator==="<=",i){if(A&&v.semver.prerelease&&v.semver.prerelease.length&&v.semver.major===A.major&&v.semver.minor===A.minor&&v.semver.patch===A.patch&&(A=!1),v.operator===">"||v.operator===">="){if(a=s2(i,v,r),a===v&&a!==i)return!1}else if(i.operator===">="&&!Pc(i.semver,String(v),r))return!1}if(s){if(y&&v.semver.prerelease&&v.semver.prerelease.length&&v.semver.major===y.major&&v.semver.minor===y.minor&&v.semver.patch===y.patch&&(y=!1),v.operator==="<"||v.operator==="<="){if(c=o2(s,v,r),c===v&&c!==s)return!1}else if(s.operator==="<="&&!Pc(s.semver,String(v),r))return!1}if(!v.operator&&(s||i)&&o!==0)return!1}return!(i&&u&&!s&&o!==0||s&&l&&!i&&o!==0||A||y)},s2=(e,t,r)=>{if(!e)return t;const n=rp(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},o2=(e,t,r)=>{if(!e)return t;const n=rp(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var qL=HL;const np=_o.exports,a2=il,VL=gn,c2=U_,WL=_a,KL=kC,ZL=LC,GL=$C,YL=MC,XL=NC,JL=UC,QL=DC,e$=jC,t$=fi,r$=qC,n$=WC,i$=W0,s$=ZC,o$=YC,a$=cl,c$=K0,f$=K_,u$=Z_,l$=Z0,h$=G0,d$=G_,p$=lL,g$=ll(),y$=ui();var w$={parse:WL,valid:KL,clean:ZL,inc:GL,diff:YL,major:XL,minor:JL,patch:QL,prerelease:e$,compare:t$,rcompare:r$,compareLoose:n$,compareBuild:i$,sort:s$,rsort:o$,gt:a$,lt:c$,eq:f$,neq:u$,gte:l$,lte:h$,cmp:d$,coerce:p$,Comparator:g$,Range:y$,satisfies:hl,toComparators:yL,maxSatisfying:bL,minSatisfying:EL,minVersion:SL,validRange:BL,outside:Q0,gtr:ML,ltr:NL,intersects:PL,simplifyRange:DL,subset:qL,SemVer:VL,re:np.re,src:np.src,tokens:np.t,SEMVER_SPEC_VERSION:a2.SEMVER_SPEC_VERSION,RELEASE_TYPES:a2.RELEASE_TYPES,compareIdentifiers:c2.compareIdentifiers,rcompareIdentifiers:c2.rcompareIdentifiers};Object.defineProperty(ai,"__esModule",{value:!0});var f2=Yn,Uc=w$,Ea=Ns,ip=Ea.refine.call(void 0,Ea.string.call(void 0),"Version",e=>Uc.valid.call(void 0,e)===null?`Expected SemVer version, got "${e}"`:!0),sp=Ea.refine.call(void 0,Ea.string.call(void 0),"Version range",e=>Uc.validRange.call(void 0,e)===null?`Expected SemVer range, got "${e}"`:!0);function m$(e){return Ea.is.call(void 0,e,ip)}function b$(e){return Ea.is.call(void 0,e,sp)}function v$(e){f2.assertStruct.call(void 0,e,ip)}function _$(e){f2.assertStruct.call(void 0,e,sp)}function E$(e,t){return Uc.gt.call(void 0,e,t)}function x$(e,t){return Uc.gtr.call(void 0,e,t)}function S$(e,t){return Uc.satisfies.call(void 0,e,t,{includePrerelease:!0})}ai.VersionStruct=ip,ai.VersionRangeStruct=sp,ai.isValidSemVerVersion=m$,ai.isValidSemVerRange=b$,ai.assertIsSemVerVersion=v$,ai.assertIsSemVerRange=_$,ai.gtVersion=E$,ai.gtRange=x$,ai.satisfiesVersionRange=S$;var It={};Object.defineProperty(It,"__esModule",{value:!0});var Yi=Yn,A$=dn,dt=Ns,xa=e=>dt.object.call(void 0,e);function u2({path:e,branch:t}){const r=e[e.length-1];return A$.hasProperty.call(void 0,t[t.length-2],r)}function Fc(e){return new dt.Struct({...e,type:`optional ${e.type}`,validator:(t,r)=>!u2(r)||e.validator(t,r),refiner:(t,r)=>!u2(r)||e.refiner(t,r)})}var B$=()=>dt.define.call(void 0,"finite number",e=>dt.is.call(void 0,e,dt.number.call(void 0))&&Number.isFinite(e)),Dc=dt.union.call(void 0,[dt.literal.call(void 0,null),dt.boolean.call(void 0),B$(),dt.string.call(void 0),dt.array.call(void 0,dt.lazy.call(void 0,()=>Dc)),dt.record.call(void 0,dt.string.call(void 0),dt.lazy.call(void 0,()=>Dc))]),Eo=dt.coerce.call(void 0,Dc,dt.any.call(void 0),e=>(Yi.assertStruct.call(void 0,e,Dc),JSON.parse(JSON.stringify(e,(t,r)=>{if(!(t==="__proto__"||t==="constructor"))return r}))));function I$(e){try{return l2(e),!0}catch{return!1}}function l2(e){return dt.create.call(void 0,e,Eo)}function R$(e){Yi.assertStruct.call(void 0,e,Eo,"Invalid JSON value");const t=JSON.stringify(e);return new TextEncoder().encode(t).byteLength}var h2="2.0",Sa=dt.literal.call(void 0,h2),Hc=dt.nullable.call(void 0,dt.union.call(void 0,[dt.number.call(void 0),dt.string.call(void 0)])),jc=xa({code:dt.integer.call(void 0),message:dt.string.call(void 0),data:Fc(Eo),stack:Fc(dt.string.call(void 0))}),op=dt.union.call(void 0,[dt.record.call(void 0,dt.string.call(void 0),Eo),dt.array.call(void 0,Eo)]),ap=xa({id:Hc,jsonrpc:Sa,method:dt.string.call(void 0),params:Fc(op)}),cp=xa({jsonrpc:Sa,method:dt.string.call(void 0),params:Fc(op)});function T$(e){return dt.is.call(void 0,e,cp)}function k$(e,t){Yi.assertStruct.call(void 0,e,cp,"Invalid JSON-RPC notification",t)}function C$(e){return dt.is.call(void 0,e,ap)}function L$(e,t){Yi.assertStruct.call(void 0,e,ap,"Invalid JSON-RPC request",t)}var fp=dt.object.call(void 0,{id:Hc,jsonrpc:Sa,result:dt.optional.call(void 0,dt.unknown.call(void 0)),error:dt.optional.call(void 0,jc)}),dl=xa({id:Hc,jsonrpc:Sa,result:Eo}),pl=xa({id:Hc,jsonrpc:Sa,error:jc}),up=dt.union.call(void 0,[dl,pl]);function $$(e){return dt.is.call(void 0,e,fp)}function M$(e,t){Yi.assertStruct.call(void 0,e,fp,"Invalid pending JSON-RPC response",t)}function O$(e){return dt.is.call(void 0,e,up)}function N$(e,t){Yi.assertStruct.call(void 0,e,up,"Invalid JSON-RPC response",t)}function P$(e){return dt.is.call(void 0,e,dl)}function U$(e,t){Yi.assertStruct.call(void 0,e,dl,"Invalid JSON-RPC success response",t)}function F$(e){return dt.is.call(void 0,e,pl)}function D$(e,t){Yi.assertStruct.call(void 0,e,pl,"Invalid JSON-RPC failure response",t)}function H$(e){return dt.is.call(void 0,e,jc)}function j$(e,t){Yi.assertStruct.call(void 0,e,jc,"Invalid JSON-RPC error",t)}function z$(e){const{permitEmptyString:t,permitFractions:r,permitNull:n}={permitEmptyString:!0,permitFractions:!1,permitNull:!0,...e};return s=>!!(typeof s=="number"&&(r||Number.isInteger(s))||typeof s=="string"&&(t||s.length>0)||n&&s===null)}It.object=xa,It.exactOptional=Fc,It.UnsafeJsonStruct=Dc,It.JsonStruct=Eo,It.isValidJson=I$,It.getSafeJson=l2,It.getJsonSize=R$,It.jsonrpc2=h2,It.JsonRpcVersionStruct=Sa,It.JsonRpcIdStruct=Hc,It.JsonRpcErrorStruct=jc,It.JsonRpcParamsStruct=op,It.JsonRpcRequestStruct=ap,It.JsonRpcNotificationStruct=cp,It.isJsonRpcNotification=T$,It.assertIsJsonRpcNotification=k$,It.isJsonRpcRequest=C$,It.assertIsJsonRpcRequest=L$,It.PendingJsonRpcResponseStruct=fp,It.JsonRpcSuccessStruct=dl,It.JsonRpcFailureStruct=pl,It.JsonRpcResponseStruct=up,It.isPendingJsonRpcResponse=$$,It.assertIsPendingJsonRpcResponse=M$,It.isJsonRpcResponse=O$,It.assertIsJsonRpcResponse=N$,It.isJsonRpcSuccess=P$,It.assertIsJsonRpcSuccess=U$,It.isJsonRpcFailure=F$,It.assertIsJsonRpcFailure=D$,It.isJsonRpcError=H$,It.assertIsJsonRpcError=j$,It.getJsonRpcIdValidator=z$;var gl={},lp={exports:{}},hp,d2;function q$(){if(d2)return hp;d2=1;var e=1e3,t=e*60,r=t*60,n=r*24,i=n*7,s=n*365.25;hp=function(l,y){y=y||{};var A=typeof l;if(A==="string"&&l.length>0)return o(l);if(A==="number"&&isFinite(l))return y.long?c(l):a(l);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(l))};function o(l){if(l=String(l),!(l.length>100)){var y=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(y){var A=parseFloat(y[1]),v=(y[2]||"ms").toLowerCase();switch(v){case"years":case"year":case"yrs":case"yr":case"y":return A*s;case"weeks":case"week":case"w":return A*i;case"days":case"day":case"d":return A*n;case"hours":case"hour":case"hrs":case"hr":case"h":return A*r;case"minutes":case"minute":case"mins":case"min":case"m":return A*t;case"seconds":case"second":case"secs":case"sec":case"s":return A*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return A;default:return}}}}function a(l){var y=Math.abs(l);return y>=n?Math.round(l/n)+"d":y>=r?Math.round(l/r)+"h":y>=t?Math.round(l/t)+"m":y>=e?Math.round(l/e)+"s":l+"ms"}function c(l){var y=Math.abs(l);return y>=n?u(l,y,n,"day"):y>=r?u(l,y,r,"hour"):y>=t?u(l,y,t,"minute"):y>=e?u(l,y,e,"second"):l+" ms"}function u(l,y,A,v){var R=y>=A*1.5;return Math.round(l/A)+" "+v+(R?"s":"")}return hp}function V$(e){r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=i,r.enabled=o,r.humanize=q$(),r.destroy=u,Object.keys(e).forEach(l=>{r[l]=e[l]}),r.names=[],r.skips=[],r.formatters={};function t(l){let y=0;for(let A=0;A{if(G==="%%")return"%";$++;const z=r.formatters[Z];if(typeof z=="function"){const ee=P[$];G=z.call(H,ee),P.splice($,1),$--}return G}),r.formatArgs.call(H,P),(H.log||r.log).apply(H,P)}return M.namespace=l,M.useColors=r.useColors(),M.color=r.selectColor(l),M.extend=n,M.destroy=r.destroy,Object.defineProperty(M,"enabled",{enumerable:!0,configurable:!1,get:()=>A!==null?A:(v!==r.namespaces&&(v=r.namespaces,R=r.enabled(l)),R),set:P=>{A=P}}),typeof r.init=="function"&&r.init(M),M}function n(l,y){const A=r(this.namespace+(typeof y>"u"?":":y)+l);return A.log=this.log,A}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let y;const A=(typeof l=="string"?l:"").split(/[\s,]+/),v=A.length;for(y=0;y"-"+y)].join(",");return r.enable(""),l}function o(l){if(l[l.length-1]==="*")return!0;let y,A;for(y=0,A=r.skips.length;y{let c=!1;return()=>{c||(c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function n(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const u="color: "+this.color;c.splice(1,0,u,"color: inherit");let l=0,y=0;c[0].replace(/%[a-zA-Z%]/g,A=>{A!=="%%"&&(l++,A==="%c"&&(y=l))}),c.splice(y,0,u)}t.log=console.debug||console.log||(()=>{});function i(c){try{c?t.storage.setItem("debug",c):t.storage.removeItem("debug")}catch{}}function s(){let c;try{c=t.storage.getItem("debug")}catch{}return!c&&typeof process<"u"&&"env"in process&&(c=process.env.DEBUG),c}function o(){try{return localStorage}catch{}}e.exports=W$(t);const{formatters:a}=e.exports;a.j=function(c){try{return JSON.stringify(c)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}}})(lp,lp.exports),Object.defineProperty(gl,"__esModule",{value:!0});function K$(e){return e&&e.__esModule?e:{default:e}}var Z$=lp.exports,G$=K$(Z$),Y$=G$.default.call(void 0,"metamask");function X$(e){return Y$.extend(e)}function J$(e,t){return e.extend(t)}gl.createProjectLogger=X$,gl.createModuleLogger=J$;var Ir={};Object.defineProperty(Ir,"__esModule",{value:!0});function p2(e){let t,r=e[0],n=1;for(;nr.call(t,...o)),t=void 0)}return r}var yn=Ns,dp=/^(?[-a-z0-9]{3,8}):(?[-_a-zA-Z0-9]{1,32})$/u,pp=/^[-a-z0-9]{3,8}$/u,gp=/^[-_a-zA-Z0-9]{1,32}$/u,yp=/^(?(?[-a-z0-9]{3,8}):(?[-_a-zA-Z0-9]{1,32})):(?[-.%a-zA-Z0-9]{1,128})$/u,g2=/^[-.%a-zA-Z0-9]{1,128}$/u,y2=yn.pattern.call(void 0,yn.string.call(void 0),dp),w2=yn.pattern.call(void 0,yn.string.call(void 0),pp),m2=yn.pattern.call(void 0,yn.string.call(void 0),gp),b2=yn.pattern.call(void 0,yn.string.call(void 0),yp),v2=yn.pattern.call(void 0,yn.string.call(void 0),g2),_2=(e=>(e.Eip155="eip155",e))(_2||{});function Q$(e){return yn.is.call(void 0,e,y2)}function E2(e){return yn.is.call(void 0,e,w2)}function x2(e){return yn.is.call(void 0,e,m2)}function eM(e){return yn.is.call(void 0,e,b2)}function tM(e){return yn.is.call(void 0,e,v2)}function rM(e){const t=dp.exec(e);if(!p2([t,"optionalAccess",r=>r.groups]))throw new Error("Invalid CAIP chain ID.");return{namespace:t.groups.namespace,reference:t.groups.reference}}function nM(e){const t=yp.exec(e);if(!p2([t,"optionalAccess",r=>r.groups]))throw new Error("Invalid CAIP account ID.");return{address:t.groups.accountAddress,chainId:t.groups.chainId,chain:{namespace:t.groups.namespace,reference:t.groups.reference}}}function iM(e,t){if(!E2(e))throw new Error(`Invalid "namespace", must match: ${pp.toString()}`);if(!x2(t))throw new Error(`Invalid "reference", must match: ${gp.toString()}`);return`${e}:${t}`}Ir.CAIP_CHAIN_ID_REGEX=dp,Ir.CAIP_NAMESPACE_REGEX=pp,Ir.CAIP_REFERENCE_REGEX=gp,Ir.CAIP_ACCOUNT_ID_REGEX=yp,Ir.CAIP_ACCOUNT_ADDRESS_REGEX=g2,Ir.CaipChainIdStruct=y2,Ir.CaipNamespaceStruct=w2,Ir.CaipReferenceStruct=m2,Ir.CaipAccountIdStruct=b2,Ir.CaipAccountAddressStruct=v2,Ir.KnownCaipNamespace=_2,Ir.isCaipChainId=Q$,Ir.isCaipNamespace=E2,Ir.isCaipReference=x2,Ir.isCaipAccountId=eM,Ir.isCaipAccountAddress=tM,Ir.parseCaipChainId=rM,Ir.parseCaipAccountId=nM,Ir.toCaipChainId=iM;var wp={},yl={};Object.defineProperty(yl,"__esModule",{value:!0});function S2(e,t){return e??t()}var sM=Yn,oM=Ns,aM=(e,t={})=>{const r=S2(t.paddingRequired,()=>!1),n=S2(t.characterSet,()=>"base64");let i;n==="base64"?i=String.raw`[A-Za-z0-9+\/]`:(sM.assert.call(void 0,n==="base64url"),i=String.raw`[-_A-Za-z0-9]`);let s;return r?s=new RegExp(`^(?:${i}{4})*(?:${i}{3}=|${i}{2}==)?$`,"u"):s=new RegExp(`^(?:${i}{4})*(?:${i}{2,3}|${i}{3}=|${i}{2}==)?$`,"u"),oM.pattern.call(void 0,e,s)};yl.base64=aM,Object.defineProperty(wp,"__esModule",{value:!0});var cM=yl,A2=Ns,fM=A2.size.call(void 0,cM.base64.call(void 0,A2.string.call(void 0),{paddingRequired:!0}),44,44);wp.ChecksumStruct=fM;var Aa={};Object.defineProperty(Aa,"__esModule",{value:!0});var Ba=Rt,uM=Yn,gr=Ns,B2=gr.union.call(void 0,[gr.number.call(void 0),gr.bigint.call(void 0),gr.string.call(void 0),Ba.StrictHexStruct]),lM=gr.coerce.call(void 0,gr.number.call(void 0),B2,Number),hM=gr.coerce.call(void 0,gr.bigint.call(void 0),B2,BigInt);gr.union.call(void 0,[Ba.StrictHexStruct,gr.instance.call(void 0,Uint8Array)]);var dM=gr.coerce.call(void 0,gr.instance.call(void 0,Uint8Array),gr.union.call(void 0,[Ba.StrictHexStruct]),Ba.hexToBytes),pM=gr.coerce.call(void 0,Ba.StrictHexStruct,gr.instance.call(void 0,Uint8Array),Ba.bytesToHex);function gM(e){try{const t=gr.create.call(void 0,e,lM);return uM.assert.call(void 0,Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){throw t instanceof gr.StructError?new Error(`Expected a number-like value, got "${e}".`):t}}function yM(e){try{return gr.create.call(void 0,e,hM)}catch(t){throw t instanceof gr.StructError?new Error(`Expected a number-like value, got "${String(t.value)}".`):t}}function wM(e){if(typeof e=="string"&&e.toLowerCase()==="0x")return new Uint8Array;try{return gr.create.call(void 0,e,dM)}catch(t){throw t instanceof gr.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}function mM(e){if(e instanceof Uint8Array&&e.length===0||typeof e=="string"&&e.toLowerCase()==="0x")return"0x";try{return gr.create.call(void 0,e,pM)}catch(t){throw t instanceof gr.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Aa.createNumber=gM,Aa.createBigInt=yM,Aa.createBytes=wM,Aa.createHex=mM;var wl={},zc={};Object.defineProperty(zc,"__esModule",{value:!0});var I2=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},bM=(e,t,r)=>(I2(e,t,"read from private field"),r?r.call(e):t.get(e)),vM=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},_M=(e,t,r,n)=>(I2(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);zc.__privateGet=bM,zc.__privateAdd=vM,zc.__privateSet=_M,Object.defineProperty(wl,"__esModule",{value:!0});var Or=zc,li,mp=class{constructor(e){Or.__privateAdd.call(void 0,this,li,void 0),Or.__privateSet.call(void 0,this,li,new Map(e)),Object.freeze(this)}get size(){return Or.__privateGet.call(void 0,this,li).size}[Symbol.iterator](){return Or.__privateGet.call(void 0,this,li)[Symbol.iterator]()}entries(){return Or.__privateGet.call(void 0,this,li).entries()}forEach(e,t){return Or.__privateGet.call(void 0,this,li).forEach((r,n,i)=>e.call(t,r,n,this))}get(e){return Or.__privateGet.call(void 0,this,li).get(e)}has(e){return Or.__privateGet.call(void 0,this,li).has(e)}keys(){return Or.__privateGet.call(void 0,this,li).keys()}values(){return Or.__privateGet.call(void 0,this,li).values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([e,t])=>`${String(e)} => ${String(t)}`).join(", ")} `:""}}`}};li=new WeakMap;var Ii,bp=class{constructor(e){Or.__privateAdd.call(void 0,this,Ii,void 0),Or.__privateSet.call(void 0,this,Ii,new Set(e)),Object.freeze(this)}get size(){return Or.__privateGet.call(void 0,this,Ii).size}[Symbol.iterator](){return Or.__privateGet.call(void 0,this,Ii)[Symbol.iterator]()}entries(){return Or.__privateGet.call(void 0,this,Ii).entries()}forEach(e,t){return Or.__privateGet.call(void 0,this,Ii).forEach((r,n,i)=>e.call(t,r,n,this))}has(e){return Or.__privateGet.call(void 0,this,Ii).has(e)}keys(){return Or.__privateGet.call(void 0,this,Ii).keys()}values(){return Or.__privateGet.call(void 0,this,Ii).values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(e=>String(e)).join(", ")} `:""}}`}};Ii=new WeakMap,Object.freeze(mp),Object.freeze(mp.prototype),Object.freeze(bp),Object.freeze(bp.prototype),wl.FrozenMap=mp,wl.FrozenSet=bp,Object.defineProperty(oe,"__esModule",{value:!0});var ml=ya,EM=q0,vp=Nc,Xi=ai,$t=It,R2=gl,Nr=Ir,xM=wp,SM=yl,bl=Aa,Dt=Rt,vl=Yn,qc=Os,hi=dn,T2=wl;oe.AssertionError=vl.AssertionError,oe.CAIP_ACCOUNT_ADDRESS_REGEX=Nr.CAIP_ACCOUNT_ADDRESS_REGEX,oe.CAIP_ACCOUNT_ID_REGEX=Nr.CAIP_ACCOUNT_ID_REGEX,oe.CAIP_CHAIN_ID_REGEX=Nr.CAIP_CHAIN_ID_REGEX,oe.CAIP_NAMESPACE_REGEX=Nr.CAIP_NAMESPACE_REGEX,oe.CAIP_REFERENCE_REGEX=Nr.CAIP_REFERENCE_REGEX,oe.CaipAccountAddressStruct=Nr.CaipAccountAddressStruct,oe.CaipAccountIdStruct=Nr.CaipAccountIdStruct,oe.CaipChainIdStruct=Nr.CaipChainIdStruct,oe.CaipNamespaceStruct=Nr.CaipNamespaceStruct,oe.CaipReferenceStruct=Nr.CaipReferenceStruct,oe.ChecksumStruct=xM.ChecksumStruct,oe.Duration=vp.Duration,oe.ESCAPE_CHARACTERS_REGEXP=hi.ESCAPE_CHARACTERS_REGEXP,oe.FrozenMap=T2.FrozenMap,oe.FrozenSet=T2.FrozenSet,oe.HexAddressStruct=Dt.HexAddressStruct,oe.HexChecksumAddressStruct=Dt.HexChecksumAddressStruct,oe.HexStruct=Dt.HexStruct,oe.JsonRpcErrorStruct=$t.JsonRpcErrorStruct,oe.JsonRpcFailureStruct=$t.JsonRpcFailureStruct,oe.JsonRpcIdStruct=$t.JsonRpcIdStruct,oe.JsonRpcNotificationStruct=$t.JsonRpcNotificationStruct,oe.JsonRpcParamsStruct=$t.JsonRpcParamsStruct,oe.JsonRpcRequestStruct=$t.JsonRpcRequestStruct,oe.JsonRpcResponseStruct=$t.JsonRpcResponseStruct,oe.JsonRpcSuccessStruct=$t.JsonRpcSuccessStruct,oe.JsonRpcVersionStruct=$t.JsonRpcVersionStruct,oe.JsonSize=hi.JsonSize,oe.JsonStruct=$t.JsonStruct,oe.KnownCaipNamespace=Nr.KnownCaipNamespace,oe.PendingJsonRpcResponseStruct=$t.PendingJsonRpcResponseStruct,oe.StrictHexStruct=Dt.StrictHexStruct,oe.UnsafeJsonStruct=$t.UnsafeJsonStruct,oe.VersionRangeStruct=Xi.VersionRangeStruct,oe.VersionStruct=Xi.VersionStruct,oe.add0x=Dt.add0x,oe.assert=vl.assert,oe.assertExhaustive=vl.assertExhaustive,oe.assertIsBytes=Dt.assertIsBytes,oe.assertIsHexString=Dt.assertIsHexString,oe.assertIsJsonRpcError=$t.assertIsJsonRpcError,oe.assertIsJsonRpcFailure=$t.assertIsJsonRpcFailure,oe.assertIsJsonRpcNotification=$t.assertIsJsonRpcNotification,oe.assertIsJsonRpcRequest=$t.assertIsJsonRpcRequest,oe.assertIsJsonRpcResponse=$t.assertIsJsonRpcResponse,oe.assertIsJsonRpcSuccess=$t.assertIsJsonRpcSuccess,oe.assertIsPendingJsonRpcResponse=$t.assertIsPendingJsonRpcResponse,oe.assertIsSemVerRange=Xi.assertIsSemVerRange,oe.assertIsSemVerVersion=Xi.assertIsSemVerVersion,oe.assertIsStrictHexString=Dt.assertIsStrictHexString,oe.assertStruct=vl.assertStruct,oe.base64=SM.base64,oe.base64ToBytes=Dt.base64ToBytes,oe.bigIntToBytes=Dt.bigIntToBytes,oe.bigIntToHex=ml.bigIntToHex,oe.bytesToBase64=Dt.bytesToBase64,oe.bytesToBigInt=Dt.bytesToBigInt,oe.bytesToHex=Dt.bytesToHex,oe.bytesToNumber=Dt.bytesToNumber,oe.bytesToSignedBigInt=Dt.bytesToSignedBigInt,oe.bytesToString=Dt.bytesToString,oe.calculateNumberSize=hi.calculateNumberSize,oe.calculateStringSize=hi.calculateStringSize,oe.concatBytes=Dt.concatBytes,oe.createBigInt=bl.createBigInt,oe.createBytes=bl.createBytes,oe.createDataView=Dt.createDataView,oe.createDeferredPromise=EM.createDeferredPromise,oe.createHex=bl.createHex,oe.createModuleLogger=R2.createModuleLogger,oe.createNumber=bl.createNumber,oe.createProjectLogger=R2.createProjectLogger,oe.exactOptional=$t.exactOptional,oe.getChecksumAddress=Dt.getChecksumAddress,oe.getErrorMessage=qc.getErrorMessage,oe.getJsonRpcIdValidator=$t.getJsonRpcIdValidator,oe.getJsonSize=$t.getJsonSize,oe.getKnownPropertyNames=hi.getKnownPropertyNames,oe.getSafeJson=$t.getSafeJson,oe.gtRange=Xi.gtRange,oe.gtVersion=Xi.gtVersion,oe.hasProperty=hi.hasProperty,oe.hexToBigInt=ml.hexToBigInt,oe.hexToBytes=Dt.hexToBytes,oe.hexToNumber=ml.hexToNumber,oe.inMilliseconds=vp.inMilliseconds,oe.isASCII=hi.isASCII,oe.isBytes=Dt.isBytes,oe.isCaipAccountAddress=Nr.isCaipAccountAddress,oe.isCaipAccountId=Nr.isCaipAccountId,oe.isCaipChainId=Nr.isCaipChainId,oe.isCaipNamespace=Nr.isCaipNamespace,oe.isCaipReference=Nr.isCaipReference,oe.isErrorWithCode=qc.isErrorWithCode,oe.isErrorWithMessage=qc.isErrorWithMessage,oe.isErrorWithStack=qc.isErrorWithStack,oe.isHexString=Dt.isHexString,oe.isJsonRpcError=$t.isJsonRpcError,oe.isJsonRpcFailure=$t.isJsonRpcFailure,oe.isJsonRpcNotification=$t.isJsonRpcNotification,oe.isJsonRpcRequest=$t.isJsonRpcRequest,oe.isJsonRpcResponse=$t.isJsonRpcResponse,oe.isJsonRpcSuccess=$t.isJsonRpcSuccess,oe.isNonEmptyArray=hi.isNonEmptyArray,oe.isNullOrUndefined=hi.isNullOrUndefined,oe.isObject=hi.isObject,oe.isPendingJsonRpcResponse=$t.isPendingJsonRpcResponse,oe.isPlainObject=hi.isPlainObject,oe.isStrictHexString=Dt.isStrictHexString,oe.isValidChecksumAddress=Dt.isValidChecksumAddress,oe.isValidHexAddress=Dt.isValidHexAddress,oe.isValidJson=$t.isValidJson,oe.isValidSemVerRange=Xi.isValidSemVerRange,oe.isValidSemVerVersion=Xi.isValidSemVerVersion,oe.jsonrpc2=$t.jsonrpc2,oe.numberToBytes=Dt.numberToBytes,oe.numberToHex=ml.numberToHex,oe.object=$t.object,oe.parseCaipAccountId=Nr.parseCaipAccountId,oe.parseCaipChainId=Nr.parseCaipChainId,oe.remove0x=Dt.remove0x,oe.satisfiesVersionRange=Xi.satisfiesVersionRange,oe.signedBigIntToBytes=Dt.signedBigIntToBytes,oe.stringToBytes=Dt.stringToBytes,oe.timeSince=vp.timeSince,oe.toCaipChainId=Nr.toCaipChainId,oe.valueToBytes=Dt.valueToBytes,oe.wrapError=qc.wrapError,Object.defineProperty(Qr,"__esModule",{value:!0}),Qr.normalize=Qr.recoverPublicKey=Qr.concatSig=Qr.legacyToBuffer=Qr.isNullish=Qr.padWithZeroes=void 0;const Ji=tu,Ia=oe;function _p(e,t){if(e!==""&&!/^[a-f0-9]+$/iu.test(e))throw new Error(`Expected an unprefixed hex string. Received: ${e}`);if(t<0)throw new Error(`Expected a non-negative integer target length. Received: ${t}`);return String.prototype.padStart.call(e,t,"0")}Qr.padWithZeroes=_p;function k2(e){return e==null}Qr.isNullish=k2;function AM(e){return typeof e=="string"&&!(0,Ji.isHexString)(e)?ie.Buffer.from(e):(0,Ji.toBuffer)(e)}Qr.legacyToBuffer=AM;function BM(e,t,r){const n=(0,Ji.fromSigned)(t),i=(0,Ji.fromSigned)(r),s=(0,Ji.bufferToInt)(e),o=_p((0,Ji.toUnsigned)(n).toString("hex"),64),a=_p((0,Ji.toUnsigned)(i).toString("hex"),64),c=(0,Ia.remove0x)((0,Ia.numberToHex)(s));return(0,Ia.add0x)(o.concat(a,c))}Qr.concatSig=BM;function IM(e,t){const r=(0,Ji.fromRpcSig)(t);return(0,Ji.ecrecover)(e,r.v,r.r,r.s)}Qr.recoverPublicKey=IM;function RM(e){if(!k2(e)){if(typeof e=="number"){if(e<0)return"0x";const t=(0,Ia.numberToBytes)(e);e=(0,Ia.bytesToHex)(t)}if(typeof e!="string"){let t="eth-sig-util.normalize() requires hex string or integer input.";throw t+=` received ${typeof e}: ${e}`,new Error(t)}return(0,Ia.add0x)(e.toLowerCase())}}Qr.normalize=RM,Object.defineProperty(ls,"__esModule",{value:!0}),ls.extractPublicKey=ls.recoverPersonalSignature=ls.personalSign=void 0;const Ra=tu,Ri=Qr;function TM({privateKey:e,data:t}){if((0,Ri.isNullish)(t))throw new Error("Missing data parameter");if((0,Ri.isNullish)(e))throw new Error("Missing privateKey parameter");const r=(0,Ri.legacyToBuffer)(t),n=(0,Ra.hashPersonalMessage)(r),i=(0,Ra.ecsign)(n,e);return(0,Ri.concatSig)((0,Ra.toBuffer)(i.v),i.r,i.s)}ls.personalSign=TM;function kM({data:e,signature:t}){if((0,Ri.isNullish)(e))throw new Error("Missing data parameter");if((0,Ri.isNullish)(t))throw new Error("Missing signature parameter");const r=C2(e,t),n=(0,Ra.publicToAddress)(r);return(0,Ra.bufferToHex)(n)}ls.recoverPersonalSignature=kM;function CM({data:e,signature:t}){if((0,Ri.isNullish)(e))throw new Error("Missing data parameter");if((0,Ri.isNullish)(t))throw new Error("Missing signature parameter");return`0x${C2(e,t).toString("hex")}`}ls.extractPublicKey=CM;function C2(e,t){const r=(0,Ra.hashPersonalMessage)((0,Ri.legacyToBuffer)(e));return(0,Ri.recoverPublicKey)(r,t)}var L2={},$2={},M2={},di={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ParserError=e.getErrorStack=e.getErrorMessage=void 0;const t=oe,r=s=>typeof s=="string"?s:s instanceof Error||(0,t.isObject)(s)&&(0,t.hasProperty)(s,"message")&&typeof s.message=="string"?s.message:"Unknown error.";e.getErrorMessage=r;const n=s=>{if(s instanceof Error)return s.stack};e.getErrorStack=n;class i extends Error{constructor(o,a){super(o),this.name="ParserError";const c=(0,e.getErrorStack)(a);c&&(this.stack=c)}}e.ParserError=i})(di);var Ep={},_l={};Object.defineProperty(_l,"__esModule",{value:!0}),_l.iterate=void 0;const O2=oe,LM=function*(e,t=32){for(let r=0;r{(0,O2.assert)(s>=0,"Cannot skip a negative number of bytes."),(0,O2.assert)(s%t===0,"Length must be a multiple of the size."),r+=s},i=e.subarray(r);yield{skip:n,value:i}}return{skip:()=>{},value:new Uint8Array}};_l.iterate=LM;var xp={},N2={},Us={},Fs={};Object.defineProperty(Fs,"__esModule",{value:!0}),Fs.padEnd=Fs.padStart=Fs.set=void 0;const Sp=oe,P2=32,$M=(e,t,r)=>(0,Sp.concatBytes)([e.subarray(0,r),t,e.subarray(r+t.length)]);Fs.set=$M;const MM=(e,t=P2)=>{const r=new Uint8Array(Math.max(t-e.length,0)).fill(0);return(0,Sp.concatBytes)([r,e])};Fs.padStart=MM;const OM=(e,t=P2)=>{const r=new Uint8Array(Math.max(t-e.length,0)).fill(0);return(0,Sp.concatBytes)([e,r])};Fs.padEnd=OM,function(e){var t=ft&&ft.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,a)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=ft&&ft.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(Fs,e)}(Us),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.address=e.getAddress=void 0;const t=oe,r=di,n=Us,i=s=>{const o=(0,t.createBytes)(s);return(0,t.assert)(o.length<=20,new r.ParserError(`Invalid address value. Expected address to be 20 bytes long, but received ${o.length} bytes.`)),(0,n.padStart)(o,20)};e.getAddress=i,e.address={isDynamic:!1,isType:s=>s==="address",getByteLength(){return 32},encode({buffer:s,value:o,packed:a}){const c=(0,e.getAddress)(o);if(a)return(0,t.concatBytes)([s,c]);const u=(0,n.padStart)(c);return(0,t.concatBytes)([s,u])},decode({value:s}){return(0,t.add0x)((0,t.bytesToHex)(s.slice(12,32)))}}}(N2);var Ap={},El={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.fixedBytes=e.getByteLength=void 0;const t=oe,r=di,n=Us,i=/^bytes([0-9]{1,2})$/u,s=o=>{const a=o.match(i)?.[1];(0,t.assert)(a,`Invalid byte length. Expected a number between 1 and 32, but received "${o}".`);const c=Number(a);return(0,t.assert)(c>0&&c<=32,new r.ParserError(`Invalid byte length. Expected a number between 1 and 32, but received "${o}".`)),c};e.getByteLength=s,e.fixedBytes={isDynamic:!1,isType(o){return i.test(o)},getByteLength(){return 32},encode({type:o,buffer:a,value:c,packed:u}){const l=(0,e.getByteLength)(o),y=(0,t.createBytes)(c);return(0,t.assert)(y.length<=l,new r.ParserError(`Expected a value of length ${l}, but received a value of length ${y.length}.`)),u?(0,t.concatBytes)([a,(0,n.padEnd)(y,l)]):(0,t.concatBytes)([a,(0,n.padEnd)(y)])},decode({type:o,value:a}){const c=(0,e.getByteLength)(o);return a.slice(0,c)}}})(El);var Bp={},U2;function F2(){return U2||(U2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.tuple=e.getTupleElements=void 0;const t=oe,r=di,n=$p(),i=/^\((.+)\)$/u,s=a=>i.test(a),o=a=>{(0,t.assert)(a.startsWith("(")&&a.endsWith(")"),new r.ParserError(`Invalid tuple type. Expected tuple type, but received "${a}".`));const c=[];let u="",l=0;for(let y=1;y{const l=(0,n.getParser)(u);return(0,n.isDynamicParser)(l,u)})},isType(a){return s(a)},getByteLength(a){return(0,n.isDynamicParser)(this,a)?32:(0,e.getTupleElements)(a).reduce((u,l)=>u+(0,n.getParser)(l).getByteLength(l),0)},encode({type:a,buffer:c,value:u,packed:l,tight:y}){const A=(0,e.getTupleElements)(a);return(0,n.pack)({types:A,values:u,byteArray:c,packed:l,tight:y})},decode({type:a,value:c,skip:u}){const l=(0,e.getTupleElements)(a),y=this.getByteLength(a)-32;return u(y),(0,n.unpack)(l,c)}}}(Bp)),Bp}var D2;function NM(){return D2||(D2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.array=e.getTupleType=e.getArrayType=e.isArrayType=void 0;const t=oe,r=di,n=$p(),i=Us,s=El,o=F2(),a=/^(?.*)\[(?\d*?)\]$/u,c=y=>a.test(y);e.isArrayType=c;const u=y=>{const A=y.match(a);return(0,t.assert)(A?.groups?.type,new r.ParserError(`Invalid array type. Expected an array type, but received "${y}".`)),[A.groups.type,A.groups.length?parseInt(A.groups.length,10):void 0]};e.getArrayType=u;const l=(y,A)=>`(${new Array(A).fill(y).join(",")})`;e.getTupleType=l,e.array={isDynamic(y){const[A,v]=(0,e.getArrayType)(y);return v===void 0||(0,n.isDynamicParser)((0,n.getParser)(A),A)},isType(y){return(0,e.isArrayType)(y)},getByteLength(y){(0,t.assert)((0,e.isArrayType)(y),new r.ParserError(`Expected an array type, but received "${y}".`));const[A,v]=(0,e.getArrayType)(y);return!(0,n.isDynamicParser)(this,y)&&v!==void 0?o.tuple.getByteLength((0,e.getTupleType)(A,v)):32},encode({type:y,buffer:A,value:v,packed:R,tight:M}){const[P,H]=(0,e.getArrayType)(y);if((0,t.assert)(!R||!(0,e.isArrayType)(P),new r.ParserError("Cannot pack nested arrays.")),R&&(0,n.isDynamicParser)((0,n.getParser)(P),P))return(0,n.pack)({types:new Array(v.length).fill(P),values:v,byteArray:A,packed:R,arrayPacked:!0,tight:M});if(H)return(0,t.assert)(H===v.length,new r.ParserError(`Array length does not match type length. Expected a length of ${H}, but received ${v.length}.`)),o.tuple.encode({type:(0,e.getTupleType)(P,H),buffer:A,value:v,packed:s.fixedBytes.isType(P)&&M,tight:M});if(R)return(0,n.pack)({types:new Array(v.length).fill(P),values:v,byteArray:A,packed:s.fixedBytes.isType(P)&&M,arrayPacked:!0,tight:M});const F=(0,i.padStart)((0,t.numberToBytes)(v.length));return(0,n.pack)({types:new Array(v.length).fill(P),values:v,byteArray:(0,t.concatBytes)([A,F]),packed:R,tight:M})},decode({type:y,value:A,...v}){const[R,M]=(0,e.getArrayType)(y);if(M){const H=o.tuple.decode({type:(0,e.getTupleType)(R,M),value:A,...v});return(0,t.assert)(H.length===M,new r.ParserError(`Array length does not match type length. Expected a length of ${M}, but received ${H.length}.`)),H}const P=(0,t.bytesToNumber)(A.subarray(0,32));return(0,n.unpack)(new Array(P).fill(R),A.subarray(32))}}}(Ap)),Ap}var H2={};class j2 extends TypeError{constructor(t,r){let n;const{message:i,explanation:s,...o}=t,{path:a}=t,c=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??c),s!=null&&(this.cause=c),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function PM(e){return Jn(e)&&typeof e[Symbol.iterator]=="function"}function Jn(e){return typeof e=="object"&&e!=null}function z2(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Pr(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function UM(e){const{done:t,value:r}=e.next();return t?void 0:r}function FM(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:i,branch:s}=t,{type:o}=r,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${Pr(n)}\``}=e;return{value:n,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...e,message:c}}function*Ip(e,t,r,n){PM(e)||(e=[e]);for(const i of e){const s=FM(i,t,r,n);s&&(yield s)}}function*Rp(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:o=!1}=r,a={path:n,branch:i};if(s&&(e=t.coercer(e,a),o&&t.type!=="type"&&Jn(t.schema)&&Jn(e)&&!Array.isArray(e)))for(const u in e)t.schema[u]===void 0&&delete e[u];let c="valid";for(const u of t.validator(e,a))u.explanation=r.message,c="not_valid",yield[u,void 0];for(let[u,l,y]of t.entries(e,a)){const A=Rp(l,y,{path:u===void 0?n:[...n,u],branch:u===void 0?i:[...i,l],coerce:s,mask:o,message:r.message});for(const v of A)v[0]?(c=v[0].refinement!=null?"not_refined":"not_valid",yield[v[0],void 0]):s&&(l=v[1],u===void 0?e=l:e instanceof Map?e.set(u,l):e instanceof Set?e.add(l):Jn(e)&&(l!==void 0||u in e)&&(e[u]=l))}if(c!=="not_valid")for(const u of t.refiner(e,a))u.explanation=r.message,c="not_refined",yield[u,void 0];c==="valid"&&(yield[void 0,e])}class Rr{constructor(t){const{type:r,schema:n,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=t;this.type=r,this.schema=n,this.entries=a,this.coercer=o,i?this.validator=(c,u)=>{const l=i(c,u);return Ip(l,u,this,c)}:this.validator=()=>[],s?this.refiner=(c,u)=>{const l=s(c,u);return Ip(l,u,this,c)}:this.refiner=()=>[]}assert(t,r){return q2(t,this,r)}create(t,r){return V2(t,this,r)}is(t){return Tp(t,this)}mask(t,r){return W2(t,this,r)}validate(t,r={}){return Ta(t,this,r)}}function q2(e,t,r){const n=Ta(e,t,{message:r});if(n[0])throw n[0]}function V2(e,t,r){const n=Ta(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function W2(e,t,r){const n=Ta(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function Tp(e,t){return!Ta(e,t)[0]}function Ta(e,t,r={}){const n=Rp(e,t,r),i=UM(n);return i[0]?[new j2(i[0],function*(){for(const o of n)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function DM(...e){const t=e[0].type==="type",r=e.map(i=>i.schema),n=Object.assign({},...r);return t?Wc(n):Vc(n)}function Sn(e,t){return new Rr({type:e,schema:null,validator:t})}function HM(e,t){return new Rr({...e,refiner:(r,n)=>r===void 0||e.refiner(r,n),validator(r,n){return r===void 0?!0:(t(r,n),e.validator(r,n))}})}function jM(e){return new Rr({type:"dynamic",schema:null,*entries(t,r){yield*e(t,r).entries(t,r)},validator(t,r){return e(t,r).validator(t,r)},coercer(t,r){return e(t,r).coercer(t,r)},refiner(t,r){return e(t,r).refiner(t,r)}})}function zM(e){let t;return new Rr({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator(r,n){return t??(t=e()),t.validator(r,n)},coercer(r,n){return t??(t=e()),t.coercer(r,n)},refiner(r,n){return t??(t=e()),t.refiner(r,n)}})}function qM(e,t){const{schema:r}=e,n={...r};for(const i of t)delete n[i];switch(e.type){case"type":return Wc(n);default:return Vc(n)}}function VM(e){const t=e instanceof Rr,r=t?{...e.schema}:{...e};for(const n in r)r[n]=K2(r[n]);return t&&e.type==="type"?Wc(r):Vc(r)}function WM(e,t){const{schema:r}=e,n={};for(const i of t)n[i]=r[i];switch(e.type){case"type":return Wc(n);default:return Vc(n)}}function KM(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Sn(e,t)}function ZM(){return Sn("any",()=>!0)}function GM(e){return new Rr({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${Pr(t)}`}})}function YM(){return Sn("bigint",e=>typeof e=="bigint")}function XM(){return Sn("boolean",e=>typeof e=="boolean")}function JM(){return Sn("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${Pr(e)}`)}function QM(e){const t={},r=e.map(n=>Pr(n)).join();for(const n of e)t[n]=n;return new Rr({type:"enums",schema:t,validator(n){return e.includes(n)||`Expected one of \`${r}\`, but received: ${Pr(n)}`}})}function eO(){return Sn("func",e=>typeof e=="function"||`Expected a function, but received: ${Pr(e)}`)}function tO(e){return Sn("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${Pr(t)}`)}function rO(){return Sn("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${Pr(e)}`)}function nO(e){return new Rr({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)},*validator(t,r){for(const n of e)yield*n.validator(t,r)},*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})}function iO(e){const t=Pr(e),r=typeof e;return new Rr({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${Pr(n)}`}})}function sO(e,t){return new Rr({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,e],yield[n,i,t]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${Pr(r)}`}})}function kp(){return Sn("never",()=>!1)}function oO(e){return new Rr({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function aO(){return Sn("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${Pr(e)}`)}function Vc(e){const t=e?Object.keys(e):[],r=kp();return new Rr({type:"object",schema:e||null,*entries(n){if(e&&Jn(n)){const i=new Set(Object.keys(n));for(const s of t)i.delete(s),yield[s,n[s],e[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return Jn(n)||`Expected an object, but received: ${Pr(n)}`},coercer(n){return Jn(n)?{...n}:n}})}function K2(e){return new Rr({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function cO(e,t){return new Rr({type:"record",schema:null,*entries(r){if(Jn(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator(r){return Jn(r)||`Expected an object, but received: ${Pr(r)}`}})}function fO(){return Sn("regexp",e=>e instanceof RegExp)}function uO(e){return new Rr({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer(t){return t instanceof Set?new Set(t):t},validator(t){return t instanceof Set||`Expected a \`Set\` object, but received: ${Pr(t)}`}})}function Z2(){return Sn("string",e=>typeof e=="string"||`Expected a string, but received: ${Pr(e)}`)}function lO(e){const t=kp();return new Rr({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;ir.type).join(" | ");return new Rr({type:"union",schema:null,coercer(r){for(const n of e){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of e){const[...o]=Rp(r,s,n),[a]=o;if(a[0])for(const[c]of o)c&&i.push(c);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${Pr(r)}`,...i]}})}function G2(){return Sn("unknown",()=>!0)}function Cp(e,t,r){return new Rr({...e,coercer:(n,i)=>Tp(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}function dO(e,t,r={}){return Cp(e,G2(),n=>{const i=typeof t=="function"?t():t;if(n===void 0)return i;if(!r.strict&&z2(n)&&z2(i)){const s={...n};let o=!1;for(const a in i)s[a]===void 0&&(s[a]=i[a],o=!0);if(o)return s}return n})}function pO(e){return Cp(e,Z2(),t=>t.trim())}function gO(e){return xo(e,"empty",t=>{const r=Y2(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function Y2(e){return e instanceof Map||e instanceof Set?e.size:e.length}function yO(e,t,r={}){const{exclusive:n}=r;return xo(e,"max",i=>n?in?i>t:i>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${i}\``)}function mO(e){return xo(e,"nonempty",t=>Y2(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function bO(e,t){return xo(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function vO(e,t,r=t){const n=`Expected a ${e.type}`,i=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return xo(e,"size",s=>{if(typeof s=="number"||s instanceof Date)return t<=s&&s<=r||`${n} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:o}=s;return t<=o&&o<=r||`${n} with a size ${i} but received one with a size of \`${o}\``}else{const{length:o}=s;return t<=o&&o<=r||`${n} with a length ${i} but received one with a length of \`${o}\``}})}function xo(e,t,r){return new Rr({...e,*refiner(n,i){yield*e.refiner(n,i);const s=r(n,i),o=Ip(s,i,e,n);for(const a of o)yield{...a,refinement:t}}})}var _O=Object.freeze({__proto__:null,Struct:Rr,StructError:j2,any:ZM,array:GM,assert:q2,assign:DM,bigint:YM,boolean:XM,coerce:Cp,create:V2,date:JM,defaulted:dO,define:Sn,deprecated:HM,dynamic:jM,empty:gO,enums:QM,func:eO,instance:tO,integer:rO,intersection:nO,is:Tp,lazy:zM,literal:iO,map:sO,mask:W2,max:yO,min:wO,never:kp,nonempty:mO,nullable:oO,number:aO,object:Vc,omit:qM,optional:K2,partial:VM,pattern:bO,pick:WM,record:cO,refine:xo,regexp:fO,set:uO,size:vO,string:Z2,struct:KM,trimmed:pO,tuple:lO,type:Wc,union:hO,unknown:G2,validate:Ta}),X2=Nn(_O),Lp={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.number=e.getBigInt=e.assertNumberLength=e.getLength=e.isSigned=void 0;const t=oe,r=di,n=Us,i=/^u?int(?[0-9]*)?$/u,s=u=>!u.startsWith("u");e.isSigned=s;const o=u=>{if(u==="int"||u==="uint")return 256;const l=u.match(i);(0,t.assert)(l?.groups?.length,new r.ParserError(`Invalid number type. Expected a number type, but received "${u}".`));const y=parseInt(l.groups.length,10);return(0,t.assert)(y>=8&&y<=256,new r.ParserError(`Invalid number length. Expected a number between 8 and 256, but received "${u}".`)),(0,t.assert)(y%8===0,new r.ParserError(`Invalid number length. Expected a multiple of 8, but received "${u}".`)),y};e.getLength=o;const a=(u,l)=>{const y=(0,e.getLength)(l),A=BigInt(2)**BigInt(y-((0,e.isSigned)(l)?1:0))-BigInt(1);if((0,e.isSigned)(l)){(0,t.assert)(u>=-(A+BigInt(1))&&u<=A,new r.ParserError(`Number "${u}" is out of range for type "${l}".`));return}(0,t.assert)(u<=A,new r.ParserError(`Number "${u}" is out of range for type "${l}".`))};e.assertNumberLength=a;const c=u=>{try{return(0,t.createBigInt)(u)}catch{throw new r.ParserError(`Invalid number. Expected a valid number value, but received "${u}".`)}};e.getBigInt=c,e.number={isDynamic:!1,isType(u){return i.test(u)},getByteLength(){return 32},encode({type:u,buffer:l,value:y,packed:A}){const v=(0,e.getBigInt)(y);if((0,e.assertNumberLength)(v,u),(0,e.isSigned)(u)){if(A){const R=(0,e.getLength)(u)/8;return(0,t.concatBytes)([l,(0,t.signedBigIntToBytes)(v,R)])}return(0,t.concatBytes)([l,(0,n.padStart)((0,t.signedBigIntToBytes)(v,32))])}if(A){const R=(0,e.getLength)(u)/8;return(0,t.concatBytes)([l,(0,n.padStart)((0,t.bigIntToBytes)(v),R)])}return(0,t.concatBytes)([l,(0,n.padStart)((0,t.bigIntToBytes)(v))])},decode({type:u,value:l}){const y=l.subarray(0,32);if((0,e.isSigned)(u)){const v=(0,t.bytesToSignedBigInt)(y);return(0,e.assertNumberLength)(v,u),v}const A=(0,t.bytesToBigInt)(y);return(0,e.assertNumberLength)(A,u),A}}})(Lp),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.bool=e.getBooleanValue=void 0;const t=oe,r=X2,n=di,i=Lp,s=(0,r.coerce)((0,r.boolean)(),(0,r.union)([(0,r.literal)("true"),(0,r.literal)("false")]),a=>a==="true"),o=a=>{try{return(0,r.create)(a,s)?BigInt(1):BigInt(0)}catch{throw new n.ParserError(`Invalid boolean value. Expected a boolean literal, or the string "true" or "false", but received "${a}".`)}};e.getBooleanValue=o,e.bool={isDynamic:!1,isType:a=>a==="bool",getByteLength(){return 32},encode({buffer:a,value:c,packed:u,tight:l}){const y=(0,e.getBooleanValue)(c);return u?(0,t.concatBytes)([a,(0,t.bigIntToBytes)(y)]):i.number.encode({type:"uint256",buffer:a,value:y,packed:u,tight:l})},decode(a){return i.number.decode({...a,type:"uint256"})===BigInt(1)}}}(H2);var Kc={};Object.defineProperty(Kc,"__esModule",{value:!0}),Kc.bytes=void 0;const Zc=oe,J2=Us;Kc.bytes={isDynamic:!0,isType:e=>e==="bytes",getByteLength(){return 32},encode({buffer:e,value:t,packed:r}){const n=(0,Zc.createBytes)(t);if(r)return(0,Zc.concatBytes)([e,n]);const i=Math.ceil(n.byteLength/32)*32;return(0,Zc.concatBytes)([e,(0,J2.padStart)((0,Zc.numberToBytes)(n.byteLength)),(0,J2.padEnd)(n,i)])},decode({value:e}){const t=e.subarray(0,32),r=(0,Zc.bytesToNumber)(t);return e.slice(32,32+r)}};var Q2={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.fn=e.getFunction=void 0;const t=oe,r=X2,n=di,i=El,s=(0,r.coerce)((0,r.object)({address:t.StrictHexStruct,selector:t.StrictHexStruct}),(0,r.union)([t.StrictHexStruct,(0,r.instance)(Uint8Array)]),a=>{const c=(0,t.createBytes)(a);return(0,t.assert)(c.length===24,new n.ParserError(`Invalid Solidity function. Expected function to be 24 bytes long, but received ${c.length} bytes.`)),{address:(0,t.bytesToHex)(c.subarray(0,20)),selector:(0,t.bytesToHex)(c.subarray(20,24))}}),o=a=>{const c=(0,r.create)(a,s);return(0,t.concatBytes)([(0,t.hexToBytes)(c.address),(0,t.hexToBytes)(c.selector)])};e.getFunction=o,e.fn={isDynamic:!1,isType:a=>a==="function",getByteLength(){return 32},encode({buffer:a,value:c,packed:u,tight:l}){const y=(0,e.getFunction)(c);return i.fixedBytes.encode({type:"bytes24",buffer:a,value:y,packed:u,tight:l})},decode({value:a}){return{address:(0,t.bytesToHex)(a.slice(0,20)),selector:(0,t.bytesToHex)(a.slice(20,24))}}}})(Q2);var eE={};Object.defineProperty(eE,"__esModule",{value:!0});var xl={};Object.defineProperty(xl,"__esModule",{value:!0}),xl.string=void 0;const tE=oe,rE=Kc;xl.string={isDynamic:!0,isType:e=>e==="string",getByteLength(){return 32},encode({buffer:e,value:t,packed:r,tight:n}){return rE.bytes.encode({type:"bytes",buffer:e,value:(0,tE.stringToBytes)(t),packed:r,tight:n})},decode(e){return(0,tE.bytesToString)(rE.bytes.decode(e))}};var nE;function iE(){return nE||(nE=1,function(e){var t=ft&&ft.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,a)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=ft&&ft.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(N2,e),r(NM(),e),r(H2,e),r(Kc,e),r(El,e),r(Q2,e),r(Lp,e),r(eE,e),r(xl,e),r(F2(),e)}(xp)),xp}var sE;function $p(){return sE||(sE=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.unpack=e.pack=e.isDynamicParser=e.getParser=void 0;const t=oe,r=di,n=_l,i=iE(),s=Us,o=l=>{const y={address:i.address,array:i.array,bool:i.bool,bytes:i.bytes,fixedBytes:i.fixedBytes,function:i.fn,number:i.number,string:i.string,tuple:i.tuple},A=y[l];if(A)return A;const v=Object.values(y).find(R=>R.isType(l));if(v)return v;throw new r.ParserError(`The type "${l}" is not supported.`)};e.getParser=o;const a=(l,y)=>{const{isDynamic:A}=l;return typeof A=="function"?A(y):A};e.isDynamicParser=a;const c=({types:l,values:y,packed:A=!1,tight:v=!1,arrayPacked:R=!1,byteArray:M=new Uint8Array})=>{(0,t.assert)(l.length===y.length,new r.ParserError(`The number of types (${l.length}) does not match the number of values (${y.length}).`));const{staticBuffer:P,dynamicBuffer:H,pointers:F}=l.reduce(({staticBuffer:q,dynamicBuffer:G,pointers:Z},z,ee)=>{const se=(0,e.getParser)(z),Q=y[ee];if(A||R||!(0,e.isDynamicParser)(se,z))return{staticBuffer:se.encode({buffer:q,value:Q,type:z,packed:A,tight:v}),dynamicBuffer:G,pointers:Z};const I=(0,t.concatBytes)([q,new Uint8Array(32)]),g=se.encode({buffer:G,value:Q,type:z,packed:A,tight:v});return{staticBuffer:I,dynamicBuffer:g,pointers:[...Z,{position:q.length,pointer:G.length}]}},{staticBuffer:new Uint8Array,dynamicBuffer:new Uint8Array,pointers:[]});(0,t.assert)(!A&&!R||H.length===0,new r.ParserError("Invalid pack state."));const N=P.length,$=F.reduce((q,{pointer:G,position:Z})=>{const z=(0,s.padStart)((0,t.numberToBytes)(N+G));return(0,s.set)(q,z,Z)},P);return(0,t.concatBytes)([M,$,H])};e.pack=c;const u=(l,y)=>{const A=(0,n.iterate)(y);return l.map(v=>{const{value:{value:R,skip:M},done:P}=A.next();(0,t.assert)(!P,new r.ParserError(`The encoded value is invalid for the provided types. Reached end of buffer while attempting to parse "${v}".`));const H=(0,e.getParser)(v);if((0,e.isDynamicParser)(H,v)){const N=(0,t.bytesToNumber)(R.subarray(0,32)),$=y.subarray(N);return H.decode({type:v,value:$,skip:M})}return H.decode({type:v,value:R,skip:M})})};e.unpack=u}(Ep)),Ep}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decodeSingle=e.decode=e.encodePacked=e.encodeSingle=e.encode=void 0;const t=oe,r=di,n=$p(),i=(u,l,y,A)=>{try{return(0,n.pack)({types:u,values:l,packed:y,tight:A})}catch(v){throw v instanceof r.ParserError?new r.ParserError(`Unable to encode value: ${v.message}`,v):new r.ParserError(`An unexpected error occurred: ${(0,r.getErrorMessage)(v)}`,v)}};e.encode=i;const s=(u,l)=>(0,e.encode)([u],[l]);e.encodeSingle=s;const o=(u,l,y)=>(0,e.encode)(u,l,!0,y);e.encodePacked=o;const a=(u,l)=>{const y=(0,t.createBytes)(l);try{return(0,n.unpack)(u,y)}catch(A){throw A instanceof r.ParserError?new r.ParserError(`Unable to decode value: ${A.message}`,A):new r.ParserError(`An unexpected error occurred: ${(0,r.getErrorMessage)(A)}`,A)}};e.decode=a;const c=(u,l)=>{const y=(0,e.decode)([u],l);return(0,t.assert)(y.length===1,new r.ParserError("Decoded value array has unexpected length.")),y[0]};e.decodeSingle=c})(M2);var oE={},aE={};Object.defineProperty(aE,"__esModule",{value:!0}),function(e){var t=ft&&ft.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,a)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=ft&&ft.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(aE,e)}(oE),function(e){var t=ft&&ft.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,a)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=ft&&ft.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(M2,e),r(di,e),r(oE,e)}($2),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.recoverTypedSignature=e.signTypedData=e.typedSignatureHash=e.TypedDataUtils=e.TYPED_MESSAGE_SCHEMA=e.SignTypedDataVersion=void 0;const t=tu,r=$2,n=iE(),i=Us,s=oe,o=qn,a=Qr;var c;(function(I){I.V1="V1",I.V3="V3",I.V4="V4"})(c=e.SignTypedDataVersion||(e.SignTypedDataVersion={})),e.TYPED_MESSAGE_SCHEMA={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]};function u(I,g){if(Object.keys(c).includes(I)){if(g&&!g.includes(I))throw new Error(`SignTypedDataVersion not allowed: '${I}'. Allowed versions are: ${g.join(", ")}`)}else throw new Error(`Invalid version: '${I}'`)}function l(I,g){(0,s.assert)(g!==null,`Unable to encode value: Invalid number. Expected a valid number value, but received "${g}".`);const f=BigInt(g),h=(0,n.getLength)(I),m=BigInt(2)**BigInt(h)-BigInt(1);return(0,s.assert)(f>=-m&&f<=m,`Unable to encode value: Number "${g}" is out of range for type "${I}".`),f}function y(I){let g=BigInt(0);for(let f=0;f=49?g+=h-BigInt(49)+BigInt(10):h>=17?g+=h-BigInt(17)+BigInt(10):g+=h}return(0,i.padStart)((0,s.bigIntToBytes)(g),20)}function A(I,g,f,h,m){if(u(m,[c.V3,c.V4]),I[f]!==void 0)return["bytes32",m===c.V4&&h==null?"0x0000000000000000000000000000000000000000000000000000000000000000":(0,t.arrToBufArr)((0,o.keccak256)(v(f,h,I,m)))];if(f==="function")throw new Error('Unsupported or invalid type: "function"');if(h===void 0)throw new Error(`missing value for field ${g} of type ${f}`);if(f==="address"){if(typeof h=="number")return["address",(0,i.padStart)((0,s.numberToBytes)(h),20)];if((0,s.isStrictHexString)(h))return["address",(0,s.add0x)(h)];if(typeof h=="string")return["address",y(h).subarray(0,20)]}if(f==="bool")return["bool",!!h];if(f==="bytes")return typeof h=="number"?h=(0,s.numberToBytes)(h):(0,s.isStrictHexString)(h)||h==="0x"?h=(0,s.hexToBytes)(h):typeof h=="string"&&(h=(0,s.stringToBytes)(h)),["bytes32",(0,t.arrToBufArr)((0,o.keccak256)(h))];if(f.startsWith("bytes")&&f!=="bytes"&&!f.includes("["))return typeof h=="number"?h<0?["bytes32",new Uint8Array(32)]:["bytes32",(0,s.bigIntToBytes)(BigInt(h))]:(0,s.isStrictHexString)(h)?["bytes32",(0,s.hexToBytes)(h)]:["bytes32",h];if(f.startsWith("int")&&!f.includes("[")){const _=l(f,h);return _>=BigInt(0)?["uint256",_]:["int256",_]}if(f==="string")return typeof h=="number"?h=(0,s.numberToBytes)(h):h=(0,s.stringToBytes)(h??""),["bytes32",(0,t.arrToBufArr)((0,o.keccak256)(h))];if(f.endsWith("]")){if(m===c.V3)throw new Error("Arrays are unimplemented in encodeData; use V4 extension");const _=f.slice(0,f.lastIndexOf("[")),E=h.map(x=>A(I,g,_,x,m));return["bytes32",(0,t.arrToBufArr)((0,o.keccak256)((0,r.encode)(E.map(([x])=>x),E.map(([,x])=>x))))]}return[f,h]}function v(I,g,f,h){u(h,[c.V3,c.V4]);const m=["bytes32"],_=[H(I,f)];for(const E of f[I]){if(h===c.V3&&g[E.name]===void 0)continue;const[x,T]=A(f,E.name,E.type,g[E.name],h);m.push(x),_.push(T)}return(0,t.arrToBufArr)((0,r.encode)(m,_))}function R(I,g){let f="";const h=M(I,g);h.delete(I);const m=[I,...Array.from(h).sort()];for(const _ of m){if(!g[_])throw new Error(`No type definition specified: ${_}`);f+=`${_}(${g[_].map(({name:x,type:T})=>`${T} ${x}`).join(",")})`}return f}function M(I,g,f=new Set){if(typeof I!="string")throw new Error(`Invalid findTypeDependencies input ${JSON.stringify(I)}`);if([I]=I.match(/^\w*/u),f.has(I)||g[I]===void 0)return f;f.add(I);for(const m of g[I])M(m.type,g,f);return f}function P(I,g,f,h){u(h,[c.V3,c.V4]);const m=v(I,g,f,h),_=(0,o.keccak256)(m);return(0,t.arrToBufArr)(_)}function H(I,g){const f=(0,s.stringToBytes)(R(I,g));return(0,t.arrToBufArr)((0,o.keccak256)(f))}function F(I){const g={};for(const f in e.TYPED_MESSAGE_SCHEMA.properties)I[f]&&(g[f]=I[f]);return"types"in g&&(g.types=Object.assign({EIP712Domain:[]},g.types)),g}function N(I,g){u(g,[c.V3,c.V4]);const f=F(I),{domain:h}=f,m={EIP712Domain:f.types.EIP712Domain};return P("EIP712Domain",h,m,g)}function $(I,g){u(g,[c.V3,c.V4]);const f=F(I),h=[(0,s.hexToBytes)("1901")];return h.push(N(I,g)),f.primaryType!=="EIP712Domain"&&h.push(P(f.primaryType,f.message,f.types,g)),(0,t.arrToBufArr)((0,o.keccak256)((0,s.concatBytes)(h)))}e.TypedDataUtils={encodeData:v,encodeType:R,findTypeDependencies:M,hashStruct:P,hashType:H,sanitizeData:F,eip712Hash:$,eip712DomainHash:N};function q(I){const g=ee(I);return(0,s.bytesToHex)(g)}e.typedSignatureHash=q;function G(I,g){if((0,n.isArrayType)(I)&&Array.isArray(g)){const[f]=(0,n.getArrayType)(I);return g.map(h=>G(f,h))}if(I==="address"){if(typeof g=="number")return(0,i.padStart)((0,s.numberToBytes)(g),20);if((0,s.isStrictHexString)(g))return(0,i.padStart)((0,s.hexToBytes)(g).subarray(0,20),20);if(g instanceof Uint8Array)return(0,i.padStart)(g.subarray(0,20),20)}if(I==="bool")return!!g;if(I.startsWith("bytes")&&I!=="bytes"){const f=(0,n.getByteLength)(I);if(typeof g=="number")return g<0?new Uint8Array:(0,s.numberToBytes)(g).subarray(0,f);if((0,s.isStrictHexString)(g))return(0,s.hexToBytes)(g).subarray(0,f);if(g instanceof Uint8Array)return g.subarray(0,f)}if(I.startsWith("uint")&&typeof g=="number")return Math.abs(g);if(I.startsWith("int")&&typeof g=="number"){const f=(0,n.getLength)(I);return BigInt.asIntN(f,BigInt(g))}return g}function Z(I){return I.map(g=>typeof g=="number"?(0,i.padStart)((0,s.numberToBytes)(g),32):(0,s.isStrictHexString)(g)?(0,i.padStart)((0,s.hexToBytes)(g).subarray(0,32),32):g instanceof Uint8Array?(0,i.padStart)(g.subarray(0,32),32):g)}function z(I,g){return g.map(f=>{if(typeof f=="string"||typeof f=="number"||typeof f=="bigint"){const h=l(I,f);if(h>=BigInt(0))return(0,i.padStart)((0,s.bigIntToBytes)(h),32);const m=(0,n.getLength)(I),_=BigInt.asIntN(m,h);return(0,s.signedBigIntToBytes)(_,32)}return f})}function ee(I){const g=new Error("Expect argument to be non-empty array");if(typeof I!="object"||!("length"in I)||!I.length)throw g;const f=I.map(({name:E,type:x,value:T})=>{if(x==="address[]")return{name:E,type:"bytes32[]",value:Z(T)};if(x.startsWith("int")&&(0,n.isArrayType)(x)){const[B,d]=(0,n.getArrayType)(x);return{name:E,type:`bytes32[${d??""}]`,value:z(B,T)}}return{name:E,type:x,value:G(x,T)}}),h=f.map(E=>E.type!=="bytes"?E.value:(0,a.legacyToBuffer)(E.value)),m=f.map(E=>{if(E.type==="function")throw new Error('Unsupported or invalid type: "function"');return E.type}),_=I.map(E=>{if(!E.name)throw g;return`${E.type} ${E.name}`});return(0,t.arrToBufArr)((0,o.keccak256)((0,r.encodePacked)(["bytes32","bytes32"],[(0,o.keccak256)((0,r.encodePacked)(["string[]"],[_],!0)),(0,o.keccak256)((0,r.encodePacked)(m,h,!0))])))}function se({privateKey:I,data:g,version:f}){if(u(f),(0,a.isNullish)(g))throw new Error("Missing data parameter");if((0,a.isNullish)(I))throw new Error("Missing private key parameter");const h=f===c.V1?ee(g):e.TypedDataUtils.eip712Hash(g,f),m=(0,t.ecsign)(h,I);return(0,a.concatSig)((0,t.arrToBufArr)((0,s.bigIntToBytes)(m.v)),m.r,m.s)}e.signTypedData=se;function Q({data:I,signature:g,version:f}){if(u(f),(0,a.isNullish)(I))throw new Error("Missing data parameter");if((0,a.isNullish)(g))throw new Error("Missing signature parameter");const h=f===c.V1?ee(I):e.TypedDataUtils.eip712Hash(I,f),m=(0,a.recoverPublicKey)(h,g),_=(0,t.publicToAddress)(m);return(0,s.bytesToHex)(_)}e.recoverTypedSignature=Q}(L2);var Qn={},cE={exports:{}};(function(e){(function(t){var r=function(S){var L,O=new Float64Array(16);if(S)for(L=0;L>24&255,S[L+1]=O>>16&255,S[L+2]=O>>8&255,S[L+3]=O&255,S[L+4]=p>>24&255,S[L+5]=p>>16&255,S[L+6]=p>>8&255,S[L+7]=p&255}function M(S,L,O,p,U){var J,Y=0;for(J=0;J>>8)-1}function P(S,L,O,p){return M(S,L,O,p,16)}function H(S,L,O,p){return M(S,L,O,p,32)}function F(S,L,O,p){for(var U=p[0]&255|(p[1]&255)<<8|(p[2]&255)<<16|(p[3]&255)<<24,J=O[0]&255|(O[1]&255)<<8|(O[2]&255)<<16|(O[3]&255)<<24,Y=O[4]&255|(O[5]&255)<<8|(O[6]&255)<<16|(O[7]&255)<<24,ue=O[8]&255|(O[9]&255)<<8|(O[10]&255)<<16|(O[11]&255)<<24,_e=O[12]&255|(O[13]&255)<<8|(O[14]&255)<<16|(O[15]&255)<<24,Ae=p[4]&255|(p[5]&255)<<8|(p[6]&255)<<16|(p[7]&255)<<24,Ee=L[0]&255|(L[1]&255)<<8|(L[2]&255)<<16|(L[3]&255)<<24,Bt=L[4]&255|(L[5]&255)<<8|(L[6]&255)<<16|(L[7]&255)<<24,Le=L[8]&255|(L[9]&255)<<8|(L[10]&255)<<16|(L[11]&255)<<24,Ke=L[12]&255|(L[13]&255)<<8|(L[14]&255)<<16|(L[15]&255)<<24,Ye=p[8]&255|(p[9]&255)<<8|(p[10]&255)<<16|(p[11]&255)<<24,lt=O[16]&255|(O[17]&255)<<8|(O[18]&255)<<16|(O[19]&255)<<24,ct=O[20]&255|(O[21]&255)<<8|(O[22]&255)<<16|(O[23]&255)<<24,Xe=O[24]&255|(O[25]&255)<<8|(O[26]&255)<<16|(O[27]&255)<<24,rt=O[28]&255|(O[29]&255)<<8|(O[30]&255)<<16|(O[31]&255)<<24,Je=p[12]&255|(p[13]&255)<<8|(p[14]&255)<<16|(p[15]&255)<<24,$e=U,De=J,Re=Y,Oe=ue,Ne=_e,Ie=Ae,ce=Ee,fe=Bt,ye=Le,he=Ke,de=Ye,ve=lt,Ve=ct,gt=Xe,wt=rt,yt=Je,j,Et=0;Et<20;Et+=2)j=$e+Ve|0,Ne^=j<<7|j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+Je|0,S[0]=$e>>>0&255,S[1]=$e>>>8&255,S[2]=$e>>>16&255,S[3]=$e>>>24&255,S[4]=De>>>0&255,S[5]=De>>>8&255,S[6]=De>>>16&255,S[7]=De>>>24&255,S[8]=Re>>>0&255,S[9]=Re>>>8&255,S[10]=Re>>>16&255,S[11]=Re>>>24&255,S[12]=Oe>>>0&255,S[13]=Oe>>>8&255,S[14]=Oe>>>16&255,S[15]=Oe>>>24&255,S[16]=Ne>>>0&255,S[17]=Ne>>>8&255,S[18]=Ne>>>16&255,S[19]=Ne>>>24&255,S[20]=Ie>>>0&255,S[21]=Ie>>>8&255,S[22]=Ie>>>16&255,S[23]=Ie>>>24&255,S[24]=ce>>>0&255,S[25]=ce>>>8&255,S[26]=ce>>>16&255,S[27]=ce>>>24&255,S[28]=fe>>>0&255,S[29]=fe>>>8&255,S[30]=fe>>>16&255,S[31]=fe>>>24&255,S[32]=ye>>>0&255,S[33]=ye>>>8&255,S[34]=ye>>>16&255,S[35]=ye>>>24&255,S[36]=he>>>0&255,S[37]=he>>>8&255,S[38]=he>>>16&255,S[39]=he>>>24&255,S[40]=de>>>0&255,S[41]=de>>>8&255,S[42]=de>>>16&255,S[43]=de>>>24&255,S[44]=ve>>>0&255,S[45]=ve>>>8&255,S[46]=ve>>>16&255,S[47]=ve>>>24&255,S[48]=Ve>>>0&255,S[49]=Ve>>>8&255,S[50]=Ve>>>16&255,S[51]=Ve>>>24&255,S[52]=gt>>>0&255,S[53]=gt>>>8&255,S[54]=gt>>>16&255,S[55]=gt>>>24&255,S[56]=wt>>>0&255,S[57]=wt>>>8&255,S[58]=wt>>>16&255,S[59]=wt>>>24&255,S[60]=yt>>>0&255,S[61]=yt>>>8&255,S[62]=yt>>>16&255,S[63]=yt>>>24&255}function N(S,L,O,p){for(var U=p[0]&255|(p[1]&255)<<8|(p[2]&255)<<16|(p[3]&255)<<24,J=O[0]&255|(O[1]&255)<<8|(O[2]&255)<<16|(O[3]&255)<<24,Y=O[4]&255|(O[5]&255)<<8|(O[6]&255)<<16|(O[7]&255)<<24,ue=O[8]&255|(O[9]&255)<<8|(O[10]&255)<<16|(O[11]&255)<<24,_e=O[12]&255|(O[13]&255)<<8|(O[14]&255)<<16|(O[15]&255)<<24,Ae=p[4]&255|(p[5]&255)<<8|(p[6]&255)<<16|(p[7]&255)<<24,Ee=L[0]&255|(L[1]&255)<<8|(L[2]&255)<<16|(L[3]&255)<<24,Bt=L[4]&255|(L[5]&255)<<8|(L[6]&255)<<16|(L[7]&255)<<24,Le=L[8]&255|(L[9]&255)<<8|(L[10]&255)<<16|(L[11]&255)<<24,Ke=L[12]&255|(L[13]&255)<<8|(L[14]&255)<<16|(L[15]&255)<<24,Ye=p[8]&255|(p[9]&255)<<8|(p[10]&255)<<16|(p[11]&255)<<24,lt=O[16]&255|(O[17]&255)<<8|(O[18]&255)<<16|(O[19]&255)<<24,ct=O[20]&255|(O[21]&255)<<8|(O[22]&255)<<16|(O[23]&255)<<24,Xe=O[24]&255|(O[25]&255)<<8|(O[26]&255)<<16|(O[27]&255)<<24,rt=O[28]&255|(O[29]&255)<<8|(O[30]&255)<<16|(O[31]&255)<<24,Je=p[12]&255|(p[13]&255)<<8|(p[14]&255)<<16|(p[15]&255)<<24,$e=U,De=J,Re=Y,Oe=ue,Ne=_e,Ie=Ae,ce=Ee,fe=Bt,ye=Le,he=Ke,de=Ye,ve=lt,Ve=ct,gt=Xe,wt=rt,yt=Je,j,Et=0;Et<20;Et+=2)j=$e+Ve|0,Ne^=j<<7|j>>>32-7,j=Ne+$e|0,ye^=j<<9|j>>>32-9,j=ye+Ne|0,Ve^=j<<13|j>>>32-13,j=Ve+ye|0,$e^=j<<18|j>>>32-18,j=Ie+De|0,he^=j<<7|j>>>32-7,j=he+Ie|0,gt^=j<<9|j>>>32-9,j=gt+he|0,De^=j<<13|j>>>32-13,j=De+gt|0,Ie^=j<<18|j>>>32-18,j=de+ce|0,wt^=j<<7|j>>>32-7,j=wt+de|0,Re^=j<<9|j>>>32-9,j=Re+wt|0,ce^=j<<13|j>>>32-13,j=ce+Re|0,de^=j<<18|j>>>32-18,j=yt+ve|0,Oe^=j<<7|j>>>32-7,j=Oe+yt|0,fe^=j<<9|j>>>32-9,j=fe+Oe|0,ve^=j<<13|j>>>32-13,j=ve+fe|0,yt^=j<<18|j>>>32-18,j=$e+Oe|0,De^=j<<7|j>>>32-7,j=De+$e|0,Re^=j<<9|j>>>32-9,j=Re+De|0,Oe^=j<<13|j>>>32-13,j=Oe+Re|0,$e^=j<<18|j>>>32-18,j=Ie+Ne|0,ce^=j<<7|j>>>32-7,j=ce+Ie|0,fe^=j<<9|j>>>32-9,j=fe+ce|0,Ne^=j<<13|j>>>32-13,j=Ne+fe|0,Ie^=j<<18|j>>>32-18,j=de+he|0,ve^=j<<7|j>>>32-7,j=ve+de|0,ye^=j<<9|j>>>32-9,j=ye+ve|0,he^=j<<13|j>>>32-13,j=he+ye|0,de^=j<<18|j>>>32-18,j=yt+wt|0,Ve^=j<<7|j>>>32-7,j=Ve+yt|0,gt^=j<<9|j>>>32-9,j=gt+Ve|0,wt^=j<<13|j>>>32-13,j=wt+gt|0,yt^=j<<18|j>>>32-18;S[0]=$e>>>0&255,S[1]=$e>>>8&255,S[2]=$e>>>16&255,S[3]=$e>>>24&255,S[4]=Ie>>>0&255,S[5]=Ie>>>8&255,S[6]=Ie>>>16&255,S[7]=Ie>>>24&255,S[8]=de>>>0&255,S[9]=de>>>8&255,S[10]=de>>>16&255,S[11]=de>>>24&255,S[12]=yt>>>0&255,S[13]=yt>>>8&255,S[14]=yt>>>16&255,S[15]=yt>>>24&255,S[16]=ce>>>0&255,S[17]=ce>>>8&255,S[18]=ce>>>16&255,S[19]=ce>>>24&255,S[20]=fe>>>0&255,S[21]=fe>>>8&255,S[22]=fe>>>16&255,S[23]=fe>>>24&255,S[24]=ye>>>0&255,S[25]=ye>>>8&255,S[26]=ye>>>16&255,S[27]=ye>>>24&255,S[28]=he>>>0&255,S[29]=he>>>8&255,S[30]=he>>>16&255,S[31]=he>>>24&255}function $(S,L,O,p){F(S,L,O,p)}function q(S,L,O,p){N(S,L,O,p)}var G=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function Z(S,L,O,p,U,J,Y){var ue=new Uint8Array(16),_e=new Uint8Array(64),Ae,Ee;for(Ee=0;Ee<16;Ee++)ue[Ee]=0;for(Ee=0;Ee<8;Ee++)ue[Ee]=J[Ee];for(;U>=64;){for($(_e,ue,Y,G),Ee=0;Ee<64;Ee++)S[L+Ee]=O[p+Ee]^_e[Ee];for(Ae=1,Ee=8;Ee<16;Ee++)Ae=Ae+(ue[Ee]&255)|0,ue[Ee]=Ae&255,Ae>>>=8;U-=64,L+=64,p+=64}if(U>0)for($(_e,ue,Y,G),Ee=0;Ee=64;){for($(Y,J,U,G),_e=0;_e<64;_e++)S[L+_e]=Y[_e];for(ue=1,_e=8;_e<16;_e++)ue=ue+(J[_e]&255)|0,J[_e]=ue&255,ue>>>=8;O-=64,L+=64}if(O>0)for($(Y,J,U,G),_e=0;_e>>13|O<<3)&8191,p=S[4]&255|(S[5]&255)<<8,this.r[2]=(O>>>10|p<<6)&7939,U=S[6]&255|(S[7]&255)<<8,this.r[3]=(p>>>7|U<<9)&8191,J=S[8]&255|(S[9]&255)<<8,this.r[4]=(U>>>4|J<<12)&255,this.r[5]=J>>>1&8190,Y=S[10]&255|(S[11]&255)<<8,this.r[6]=(J>>>14|Y<<2)&8191,ue=S[12]&255|(S[13]&255)<<8,this.r[7]=(Y>>>11|ue<<5)&8065,_e=S[14]&255|(S[15]&255)<<8,this.r[8]=(ue>>>8|_e<<8)&8191,this.r[9]=_e>>>5&127,this.pad[0]=S[16]&255|(S[17]&255)<<8,this.pad[1]=S[18]&255|(S[19]&255)<<8,this.pad[2]=S[20]&255|(S[21]&255)<<8,this.pad[3]=S[22]&255|(S[23]&255)<<8,this.pad[4]=S[24]&255|(S[25]&255)<<8,this.pad[5]=S[26]&255|(S[27]&255)<<8,this.pad[6]=S[28]&255|(S[29]&255)<<8,this.pad[7]=S[30]&255|(S[31]&255)<<8};Q.prototype.blocks=function(S,L,O){for(var p=this.fin?0:2048,U,J,Y,ue,_e,Ae,Ee,Bt,Le,Ke,Ye,lt,ct,Xe,rt,Je,$e,De,Re,Oe=this.h[0],Ne=this.h[1],Ie=this.h[2],ce=this.h[3],fe=this.h[4],ye=this.h[5],he=this.h[6],de=this.h[7],ve=this.h[8],Ve=this.h[9],gt=this.r[0],wt=this.r[1],yt=this.r[2],j=this.r[3],Et=this.r[4],Mt=this.r[5],Ot=this.r[6],_t=this.r[7],Ct=this.r[8],Lt=this.r[9];O>=16;)U=S[L+0]&255|(S[L+1]&255)<<8,Oe+=U&8191,J=S[L+2]&255|(S[L+3]&255)<<8,Ne+=(U>>>13|J<<3)&8191,Y=S[L+4]&255|(S[L+5]&255)<<8,Ie+=(J>>>10|Y<<6)&8191,ue=S[L+6]&255|(S[L+7]&255)<<8,ce+=(Y>>>7|ue<<9)&8191,_e=S[L+8]&255|(S[L+9]&255)<<8,fe+=(ue>>>4|_e<<12)&8191,ye+=_e>>>1&8191,Ae=S[L+10]&255|(S[L+11]&255)<<8,he+=(_e>>>14|Ae<<2)&8191,Ee=S[L+12]&255|(S[L+13]&255)<<8,de+=(Ae>>>11|Ee<<5)&8191,Bt=S[L+14]&255|(S[L+15]&255)<<8,ve+=(Ee>>>8|Bt<<8)&8191,Ve+=Bt>>>5|p,Le=0,Ke=Le,Ke+=Oe*gt,Ke+=Ne*(5*Lt),Ke+=Ie*(5*Ct),Ke+=ce*(5*_t),Ke+=fe*(5*Ot),Le=Ke>>>13,Ke&=8191,Ke+=ye*(5*Mt),Ke+=he*(5*Et),Ke+=de*(5*j),Ke+=ve*(5*yt),Ke+=Ve*(5*wt),Le+=Ke>>>13,Ke&=8191,Ye=Le,Ye+=Oe*wt,Ye+=Ne*gt,Ye+=Ie*(5*Lt),Ye+=ce*(5*Ct),Ye+=fe*(5*_t),Le=Ye>>>13,Ye&=8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(5*Lt),$e+=Ve*(5*Ct),Le+=$e>>>13,$e&=8191,De=Le,De+=Oe*Ct,De+=Ne*_t,De+=Ie*Ot,De+=ce*Mt,De+=fe*Et,Le=De>>>13,De&=8191,De+=ye*j,De+=he*yt,De+=de*wt,De+=ve*gt,De+=Ve*(5*Lt),Le+=De>>>13,De&=8191,Re=Le,Re+=Oe*Lt,Re+=Ne*Ct,Re+=Ie*_t,Re+=ce*Ot,Re+=fe*Mt,Le=Re>>>13,Re&=8191,Re+=ye*Et,Re+=he*j,Re+=de*yt,Re+=ve*wt,Re+=Ve*gt,Le+=Re>>>13,Re&=8191,Le=(Le<<2)+Le|0,Le=Le+Ke|0,Ke=Le&8191,Le=Le>>>13,Ye+=Le,Oe=Ke,Ne=Ye,Ie=lt,ce=ct,fe=Xe,ye=rt,he=Je,de=$e,ve=De,Ve=Re,L+=16,O-=16;this.h[0]=Oe,this.h[1]=Ne,this.h[2]=Ie,this.h[3]=ce,this.h[4]=fe,this.h[5]=ye,this.h[6]=he,this.h[7]=de,this.h[8]=ve,this.h[9]=Ve},Q.prototype.finish=function(S,L){var O=new Uint16Array(10),p,U,J,Y;if(this.leftover){for(Y=this.leftover,this.buffer[Y++]=1;Y<16;Y++)this.buffer[Y]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(p=this.h[1]>>>13,this.h[1]&=8191,Y=2;Y<10;Y++)this.h[Y]+=p,p=this.h[Y]>>>13,this.h[Y]&=8191;for(this.h[0]+=p*5,p=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=p,p=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=p,O[0]=this.h[0]+5,p=O[0]>>>13,O[0]&=8191,Y=1;Y<10;Y++)O[Y]=this.h[Y]+p,p=O[Y]>>>13,O[Y]&=8191;for(O[9]-=8192,U=(p^1)-1,Y=0;Y<10;Y++)O[Y]&=U;for(U=~U,Y=0;Y<10;Y++)this.h[Y]=this.h[Y]&U|O[Y];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,J=this.h[0]+this.pad[0],this.h[0]=J&65535,Y=1;Y<8;Y++)J=(this.h[Y]+this.pad[Y]|0)+(J>>>16)|0,this.h[Y]=J&65535;S[L+0]=this.h[0]>>>0&255,S[L+1]=this.h[0]>>>8&255,S[L+2]=this.h[1]>>>0&255,S[L+3]=this.h[1]>>>8&255,S[L+4]=this.h[2]>>>0&255,S[L+5]=this.h[2]>>>8&255,S[L+6]=this.h[3]>>>0&255,S[L+7]=this.h[3]>>>8&255,S[L+8]=this.h[4]>>>0&255,S[L+9]=this.h[4]>>>8&255,S[L+10]=this.h[5]>>>0&255,S[L+11]=this.h[5]>>>8&255,S[L+12]=this.h[6]>>>0&255,S[L+13]=this.h[6]>>>8&255,S[L+14]=this.h[7]>>>0&255,S[L+15]=this.h[7]>>>8&255},Q.prototype.update=function(S,L,O){var p,U;if(this.leftover){for(U=16-this.leftover,U>O&&(U=O),p=0;p=16&&(U=O-O%16,this.blocks(S,L,U),L+=U,O-=U),O){for(p=0;p>16&1),J[O-1]&=65535;J[15]=Y[15]-32767-(J[14]>>16&1),U=J[15]>>16&1,J[14]&=65535,E(Y,J,1-U)}for(O=0;O<16;O++)S[2*O]=Y[O]&255,S[2*O+1]=Y[O]>>8}function T(S,L){var O=new Uint8Array(32),p=new Uint8Array(32);return x(O,S),x(p,L),H(O,0,p,0)}function B(S){var L=new Uint8Array(32);return x(L,S),L[0]&1}function d(S,L){var O;for(O=0;O<16;O++)S[O]=L[2*O]+(L[2*O+1]<<8);S[15]&=32767}function k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+U+65535,U=Math.floor(p/65536),J=p-U*65536,p=Y+U+65535,U=Math.floor(p/65536),Y=p-U*65536,p=ue+U+65535,U=Math.floor(p/65536),ue=p-U*65536,p=_e+U+65535,U=Math.floor(p/65536),_e=p-U*65536,p=Ae+U+65535,U=Math.floor(p/65536),Ae=p-U*65536,p=Ee+U+65535,U=Math.floor(p/65536),Ee=p-U*65536,p=Bt+U+65535,U=Math.floor(p/65536),Bt=p-U*65536,p=Le+U+65535,U=Math.floor(p/65536),Le=p-U*65536,p=Ke+U+65535,U=Math.floor(p/65536),Ke=p-U*65536,p=Ye+U+65535,U=Math.floor(p/65536),Ye=p-U*65536,p=lt+U+65535,U=Math.floor(p/65536),lt=p-U*65536,p=ct+U+65535,U=Math.floor(p/65536),ct=p-U*65536,p=Xe+U+65535,U=Math.floor(p/65536),Xe=p-U*65536,p=rt+U+65535,U=Math.floor(p/65536),rt=p-U*65536,p=Je+U+65535,U=Math.floor(p/65536),Je=p-U*65536,p=$e+U+65535,U=Math.floor(p/65536),$e=p-U*65536,J+=U-1+37*(U-1),U=1,p=J+U+65535,U=Math.floor(p/65536),J=p-U*65536,p=Y+U+65535,U=Math.floor(p/65536),Y=p-U*65536,p=ue+U+65535,U=Math.floor(p/65536),ue=p-U*65536,p=_e+U+65535,U=Math.floor(p/65536),_e=p-U*65536,p=Ae+U+65535,U=Math.floor(p/65536),Ae=p-U*65536,p=Ee+U+65535,U=Math.floor(p/65536),Ee=p-U*65536,p=Bt+U+65535,U=Math.floor(p/65536),Bt=p-U*65536,p=Le+U+65535,U=Math.floor(p/65536),Le=p-U*65536,p=Ke+U+65535,U=Math.floor(p/65536),Ke=p-U*65536,p=Ye+U+65535,U=Math.floor(p/65536),Ye=p-U*65536,p=lt+U+65535,U=Math.floor(p/65536),lt=p-U*65536,p=ct+U+65535,U=Math.floor(p/65536),ct=p-U*65536,p=Xe+U+65535,U=Math.floor(p/65536),Xe=p-U*65536,p=rt+U+65535,U=Math.floor(p/65536),rt=p-U*65536,p=Je+U+65535,U=Math.floor(p/65536),Je=p-U*65536,p=$e+U+65535,U=Math.floor(p/65536),$e=p-U*65536,J+=U-1+37*(U-1),S[0]=J,S[1]=Y,S[2]=ue,S[3]=_e,S[4]=Ae,S[5]=Ee,S[6]=Bt,S[7]=Le,S[8]=Ke,S[9]=Ye,S[10]=lt,S[11]=ct,S[12]=Xe,S[13]=rt,S[14]=Je,S[15]=$e}function re(S,L){K(S,L,L)}function xe(S,L){var O=r(),p;for(p=0;p<16;p++)O[p]=L[p];for(p=253;p>=0;p--)re(O,O),p!==2&&p!==4&&K(O,O,L);for(p=0;p<16;p++)S[p]=O[p]}function be(S,L){var O=r(),p;for(p=0;p<16;p++)O[p]=L[p];for(p=250;p>=0;p--)re(O,O),p!==1&&K(O,O,L);for(p=0;p<16;p++)S[p]=O[p]}function ge(S,L,O){var p=new Uint8Array(32),U=new Float64Array(80),J,Y,ue=r(),_e=r(),Ae=r(),Ee=r(),Bt=r(),Le=r();for(Y=0;Y<31;Y++)p[Y]=L[Y];for(p[31]=L[31]&127|64,p[0]&=248,d(U,O),Y=0;Y<16;Y++)_e[Y]=U[Y],Ee[Y]=ue[Y]=Ae[Y]=0;for(ue[0]=Ee[0]=1,Y=254;Y>=0;--Y)J=p[Y>>>3]>>>(Y&7)&1,E(ue,_e,J),E(Ae,Ee,J),k(Bt,ue,Ae),W(ue,ue,Ae),k(Ae,_e,Ee),W(_e,_e,Ee),re(Ee,Bt),re(Le,ue),K(ue,Ae,ue),K(Ae,_e,Bt),k(Bt,ue,Ae),W(ue,ue,Ae),re(_e,ue),W(Ae,Ee,Le),K(ue,Ae,c),k(ue,ue,Ee),K(Ae,Ae,ue),K(ue,Ee,Le),K(Ee,_e,U),re(_e,Bt),E(ue,_e,J),E(Ae,Ee,J);for(Y=0;Y<16;Y++)U[Y+16]=ue[Y],U[Y+32]=Ae[Y],U[Y+48]=_e[Y],U[Y+64]=Ee[Y];var Ke=U.subarray(32),Ye=U.subarray(16);return xe(Ke,Ke),K(Ye,Ye,Ke),x(S,Ye),0}function tt(S,L){return ge(S,L,s)}function Ue(S,L){return n(L,32),tt(S,L)}function Pe(S,L,O){var p=new Uint8Array(32);return ge(p,O,L),q(S,i,p,G)}var pe=f,we=h;function ke(S,L,O,p,U,J){var Y=new Uint8Array(32);return Pe(Y,U,J),pe(S,L,O,p,Y)}function vt(S,L,O,p,U,J){var Y=new Uint8Array(32);return Pe(Y,U,J),we(S,L,O,p,Y)}var He=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function it(S,L,O,p){for(var U=new Int32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<32-28)^(_t>>>34-32|Ve<<32-(34-32))^(_t>>>39-32|Ve<<32-(39-32)),fe=(_t>>>28|Ve<<32-28)^(Ve>>>34-32|_t<<32-(34-32))^(Ve>>>39-32|_t<<32-(39-32)),ye+=fe&65535,he+=fe>>>16,de+=ce&65535,ve+=ce>>>16,ce=Ve>^Ve&wt^gt&wt,fe=_t&Ct^_t&Lt^Ct&Lt,ye+=fe&65535,he+=fe>>>16,de+=ce&65535,ve+=ce>>>16,he+=ye>>>16,de+=he>>>16,ve+=de>>>16,Ke=de&65535|ve<<16,De=ye&65535|he<<16,ce=Ae,fe=Xe,ye=fe&65535,he=fe>>>16,de=ce&65535,ve=ce>>>16,ce=Re,fe=Oe,ye+=fe&65535,he+=fe>>>16,de+=ce&65535,ve+=ce>>>16,he+=ye>>>16,de+=he>>>16,ve+=de>>>16,Ae=de&65535|ve<<16,Xe=ye&65535|he<<16,gt=Y,wt=ue,yt=_e,j=Ae,Et=Ee,Mt=Bt,Ot=Le,Ve=Ke,Ct=Ye,Lt=lt,Tr=ct,Kt=Xe,Er=rt,xr=Je,Sr=$e,_t=De,Ne%16===15)for(Ie=0;Ie<16;Ie++)ce=U[Ie],fe=J[Ie],ye=fe&65535,he=fe>>>16,de=ce&65535,ve=ce>>>16,ce=U[(Ie+9)%16],fe=J[(Ie+9)%16],ye+=fe&65535,he+=fe>>>16,de+=ce&65535,ve+=ce>>>16,Re=U[(Ie+1)%16],Oe=J[(Ie+1)%16],ce=(Re>>>1|Oe<<32-1)^(Re>>>8|Oe<<32-8)^Re>>>7,fe=(Oe>>>1|Re<<32-1)^(Oe>>>8|Re<<32-8)^(Oe>>>7|Re<<32-7),ye+=fe&65535,he+=fe>>>16,de+=ce&65535,ve+=ce>>>16,Re=U[(Ie+14)%16],Oe=J[(Ie+14)%16],ce=(Re>>>19|Oe<<32-19)^(Oe>>>61-32|Re<<32-(61-32))^Re>>>6,fe=(Oe>>>19|Re<<32-19)^(Re>>>61-32|Oe<<32-(61-32))^(Oe>>>6|Re<<32-6),ye+=fe&65535,he+=fe>>>16,de+=ce&65535,ve+=ce>>>16,he+=ye>>>16,de+=he>>>16,ve+=de>>>16,U[Ie]=de&65535|ve<<16,J[Ie]=ye&65535|he<<16;ce=Ve,fe=_t,ye=fe&65535,he=fe>>>16,de=ce&65535,ve=ce>>>16,ce=S[0],fe=L[0],ye+=fe&65535,he+=fe>>>16,de+=ce&65535,ve+=ce>>>16,he+=ye>>>16,de+=he>>>16,ve+=de>>>16,S[0]=Ve=de&65535|ve<<16,L[0]=_t=ye&65535|he<<16,ce=gt,fe=Ct,ye=fe&65535,he=fe>>>16,de=ce&65535,ve=ce>>>16,ce=S[1],fe=L[1],ye+=fe&65535,he+=fe>>>16,de+=ce&65535,ve+=ce>>>16,he+=ye>>>16,de+=he>>>16,ve+=de>>>16,S[1]=gt=de&65535|ve<<16,L[1]=Ct=ye&65535|he<<16,ce=wt,fe=Lt,ye=fe&65535,he=fe>>>16,de=ce&65535,ve=ce>>>16,ce=S[2],fe=L[2],ye+=fe&65535,he+=fe>>>16,de+=ce&65535,ve+=ce>>>16,he+=ye>>>16,de+=he>>>16,ve+=de>>>16,S[2]=wt=de&65535|ve<<16,L[2]=Lt=ye&65535|he<<16,ce=yt,fe=Tr,ye=fe&65535,he=fe>>>16,de=ce&65535,ve=ce>>>16,ce=S[3],fe=L[3],ye+=fe&65535,he+=fe>>>16,de+=ce&65535,ve+=ce>>>16,he+=ye>>>16,de+=he>>>16,ve+=de>>>16,S[3]=yt=de&65535|ve<<16,L[3]=Tr=ye&65535|he<<16,ce=j,fe=Kt,ye=fe&65535,he=fe>>>16,de=ce&65535,ve=ce>>>16,ce=S[4],fe=L[4],ye+=fe&65535,he+=fe>>>16,de+=ce&65535,ve+=ce>>>16,he+=ye>>>16,de+=he>>>16,ve+=de>>>16,S[4]=j=de&65535|ve<<16,L[4]=Kt=ye&65535|he<<16,ce=Et,fe=Er,ye=fe&65535,he=fe>>>16,de=ce&65535,ve=ce>>>16,ce=S[5],fe=L[5],ye+=fe&65535,he+=fe>>>16,de+=ce&65535,ve+=ce>>>16,he+=ye>>>16,de+=he>>>16,ve+=de>>>16,S[5]=Et=de&65535|ve<<16,L[5]=Er=ye&65535|he<<16,ce=Mt,fe=xr,ye=fe&65535,he=fe>>>16,de=ce&65535,ve=ce>>>16,ce=S[6],fe=L[6],ye+=fe&65535,he+=fe>>>16,de+=ce&65535,ve+=ce>>>16,he+=ye>>>16,de+=he>>>16,ve+=de>>>16,S[6]=Mt=de&65535|ve<<16,L[6]=xr=ye&65535|he<<16,ce=Ot,fe=Sr,ye=fe&65535,he=fe>>>16,de=ce&65535,ve=ce>>>16,ce=S[7],fe=L[7],ye+=fe&65535,he+=fe>>>16,de+=ce&65535,ve+=ce>>>16,he+=ye>>>16,de+=he>>>16,ve+=de>>>16,S[7]=Ot=de&65535|ve<<16,L[7]=Sr=ye&65535|he<<16,Ur+=128,p-=128}return p}function Ht(S,L,O){var p=new Int32Array(8),U=new Int32Array(8),J=new Uint8Array(256),Y,ue=O;for(p[0]=1779033703,p[1]=3144134277,p[2]=1013904242,p[3]=2773480762,p[4]=1359893119,p[5]=2600822924,p[6]=528734635,p[7]=1541459225,U[0]=4089235720,U[1]=2227873595,U[2]=4271175723,U[3]=1595750129,U[4]=2917565137,U[5]=725511199,U[6]=4215389547,U[7]=327033209,it(p,U,L,O),O%=128,Y=0;Y=0;--U)p=O[U/8|0]>>(U&7)&1,pt(S,L,p),ut(L,S),ut(S,S),pt(S,L,p)}function At(S,L){var O=[r(),r(),r(),r()];m(O[0],y),m(O[1],A),m(O[2],a),K(O[3],y,A),xt(S,O,L)}function Xt(S,L,O){var p=new Uint8Array(64),U=[r(),r(),r(),r()],J;for(O||n(L,32),Ht(p,L,32),p[0]&=248,p[31]&=127,p[31]|=64,At(U,p),Wt(S,U),J=0;J<32;J++)L[J+32]=S[J];return 0}var Tt=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function C(S,L){var O,p,U,J;for(p=63;p>=32;--p){for(O=0,U=p-32,J=p-12;U>4)*Tt[U],O=L[U]>>8,L[U]&=255;for(U=0;U<32;U++)L[U]-=O*Tt[U];for(p=0;p<32;p++)L[p+1]+=L[p]>>8,S[p]=L[p]&255}function w(S){var L=new Float64Array(64),O;for(O=0;O<64;O++)L[O]=S[O];for(O=0;O<64;O++)S[O]=0;C(S,L)}function b(S,L,O,p){var U=new Uint8Array(64),J=new Uint8Array(64),Y=new Uint8Array(64),ue,_e,Ae=new Float64Array(64),Ee=[r(),r(),r(),r()];Ht(U,p,32),U[0]&=248,U[31]&=127,U[31]|=64;var Bt=O+64;for(ue=0;ue>7&&W(S[0],o,S[0]),K(S[3],S[0],S[1]),0)}function V(S,L,O,p){var U,J=new Uint8Array(32),Y=new Uint8Array(64),ue=[r(),r(),r(),r()],_e=[r(),r(),r(),r()];if(O<64||D(_e,p))return-1;for(U=0;U=0},t.sign.keyPair=function(){var S=new Uint8Array(Yt),L=new Uint8Array(es);return Xt(S,L),{publicKey:S,secretKey:L}},t.sign.keyPair.fromSecretKey=function(S){if(kt(S),S.length!==es)throw new Error("bad secret key size");for(var L=new Uint8Array(Yt),O=0;O0&&(c=n-a-i),s.padding="0".repeat(c);const u=JSON.stringify(s);return fE({publicKey:e,data:u,version:r})}Qn.encryptSafely=AO;function uE({encryptedData:e,privateKey:t}){if((0,ki.isNullish)(e))throw new Error("Missing encryptedData parameter");if((0,ki.isNullish)(t))throw new Error("Missing privateKey parameter");switch(e.version){case"x25519-xsalsa20-poly1305":{const r=ie.Buffer.from(t,"hex"),n=So.box.keyPair.fromSecretKey(r).secretKey,i=Ti.base64.decode(e.nonce),s=Ti.base64.decode(e.ciphertext),o=Ti.base64.decode(e.ephemPublicKey),a=So.box.open(s,i,o,n);try{if(!a)throw new Error;const c=Ti.utf8.encode(a);if(!c)throw new Error;return c}catch(c){throw c&&typeof c.message=="string"&&c.message.length?new Error(`Decryption failed: ${c.message}`):new Error("Decryption failed.")}}default:throw new Error("Encryption type/version not supported.")}}Qn.decrypt=uE;function BO({encryptedData:e,privateKey:t}){if((0,ki.isNullish)(e))throw new Error("Missing encryptedData parameter");if((0,ki.isNullish)(t))throw new Error("Missing privateKey parameter");return JSON.parse(uE({encryptedData:e,privateKey:t})).data}Qn.decryptSafely=BO;function IO(e){const t=ie.Buffer.from(e,"hex"),r=So.box.keyPair.fromSecretKey(t).publicKey;return Ti.base64.encode(r)}Qn.getEncryptionPublicKey=IO,function(e){var t=ft&&ft.__createBinding||(Object.create?function(i,s,o,a){a===void 0&&(a=o);var c=Object.getOwnPropertyDescriptor(s,o);(!c||("get"in c?!s.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(i,a,c)}:function(i,s,o,a){a===void 0&&(a=o),i[a]=s[o]}),r=ft&&ft.__exportStar||function(i,s){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&t(s,i,o)};Object.defineProperty(e,"__esModule",{value:!0}),e.normalize=e.concatSig=void 0,r(ls,e),r(L2,e),r(Qn,e);var n=Qr;Object.defineProperty(e,"concatSig",{enumerable:!0,get:function(){return n.concatSig}}),Object.defineProperty(e,"normalize",{enumerable:!0,get:function(){return n.normalize}})}(Go);class lE extends Error{constructor(t,r){super(),this.code=t,this.message=r}toString(){return`${this.message} (${this.code})`}}var RO=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},TO=(e,t,r)=>(RO(e,t,"read from private field"),r?r.call(e):t.get(e)),kO=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Mp;const ka=class{constructor(e){kO(this,Mp,["eth_newFilter","eth_newBlockFilter","eth_newPendingTransactionFilter","eth_uninstallFilter","eth_subscribe"]),this.provider=e}static isUTF8(e){try{return new TextDecoder("utf8",{fatal:!0}).decode(e),!0}catch{return!1}}static bufferToHex(e){return"0x"+ie.Buffer.from(e).toString("hex")}static messageToBuffer(e){let t=ie.Buffer.from([]);try{typeof e=="string"?t=ie.Buffer.from(e.replace("0x",""),"hex"):t=ie.Buffer.from(e)}catch(r){console.log(`messageToBuffer error: ${r}`)}return t}request(e){if(TO(this,Mp).includes(e.method))return Promise.reject(new lE(4200,`EthereumProvider does not support calling ${e.method}`));switch(e.method){case"wallet_requestPermissions":return this.provider.internalRequest({method:"wallet_requestPermissions",params:e.params});case"eth_requestAccounts":return this.provider.internalRequest({method:"requestAccounts",params:{}});case"eth_sign":return this.ethSign(e.params);case"personal_sign":return this.personalSign(e.params);case"personal_ecRecover":return this.personalECRecover(e.params);case"eth_signTypedData_v3":return this.ethSignTypedData(e.params,Go.SignTypedDataVersion.V3);case"eth_signTypedData_v4":return this.ethSignTypedData(e.params,Go.SignTypedDataVersion.V4);case"eth_signTypedData":return this.ethSignTypedData(e.params,Go.SignTypedDataVersion.V1);case"eth_sendTransaction":return this.provider.internalRequest({method:"signTransaction",params:e.params[0]});case"wallet_watchAsset":{const{options:t,type:r}=e.params,{address:n,symbol:i,decimals:s}=t;return this.provider.internalRequest({method:"watchAsset",params:{type:r,contract:n,symbol:i,decimals:s||0}})}case"wallet_addEthereumChain":return this.provider.internalRequest({method:"addEthereumChain",params:e.params[0]});case"wallet_switchEthereumChain":return this.provider.internalRequest({method:"switchEthereumChain",params:e.params[0]});default:return this.provider.getRPC().call({method:e.method,jsonrpc:"2.0",params:e.params})}}personalECRecover(e){return this.provider.internalRequest({method:"ecRecover",params:{signature:e[1],message:e[0]}})}async personalSign(e){const[t]=await this.provider.request({method:"eth_accounts"});if(!t)throw new Error("Unable to execute personal_sign");let[r,n]=e;typeof r=="string"&&t.toLowerCase()===r.toLowerCase()&&(r=e[1],n=e[0]);const i=ka.messageToBuffer(r);return this.provider.internalRequest({method:"signPersonalMessage",params:{data:i.length===0?ka.bufferToHex(r):r,address:n}})}ethSign(e){if(!e)throw new Error("Missing params");const[t,r]=e,n=ka.messageToBuffer(r),i=ka.bufferToHex(n);return this.provider.internalRequest({method:ka.isUTF8(n)?"signPersonalMessage":"signMessage",params:{data:i,address:t}})}async ethSignTypedData(e,t){const[r]=await this.provider.request({method:"eth_accounts"});if(!r)throw new Error("Unable to execute ethSignTypedData, address is not present");let[n,i]=e;typeof n=="string"&&r.toLowerCase()===n.toLowerCase()&&(n=e[1],i=e[0]);const s=typeof n=="string"?JSON.parse(n):n,{chainId:o}=s.domain||{};if(typeof o<"u"&&Number(o)!==Number(this.provider.getChainId()))throw new Error("Provided chainId does not match the currently active chain");const a=t!==Go.SignTypedDataVersion.V1?Go.TypedDataUtils.eip712Hash(s,t):"";return this.provider.internalRequest({method:"signTypedMessage",params:{data:"0x"+a.toString("hex"),raw:typeof n=="string"?n:JSON.stringify(n),address:i,version:t}})}};let CO=ka;Mp=new WeakMap;var hE=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},LO=(e,t,r)=>(hE(e,t,"read from private field"),r?r.call(e):t.get(e)),$O=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},MO=(e,t,r,n)=>(hE(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Sl;class OO{constructor(t){$O(this,Sl,void 0),MO(this,Sl,t)}async getBlockNumber(){return(await this.call({jsonrpc:"2.0",method:"eth_blockNumber",params:[]})).result}async getBlockByNumber(t){return(await this.call({jsonrpc:"2.0",method:"eth_getBlockByNumber",params:[t,!1]})).result}getFilterLogs(t){return this.call({jsonrpc:"2.0",method:"eth_getLogs",params:[t]})}async call(t){const r=await(await fetch(LO(this,Sl),{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)})).json();if(!r.result&&r.error)throw new Error(r.error.message||"rpc error");return r}}Sl=new WeakMap;var dE=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},ei=(e,t,r)=>(dE(e,t,"read from private field"),r?r.call(e):t.get(e)),Ca=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},ti=(e,t,r,n)=>(dE(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Qi,Gc,Al,Yc,Ds,Xc;const pE=class extends Cl{constructor(e){super(),Ca(this,Qi,void 0),Ca(this,Gc,void 0),Ca(this,Al,!1),Ca(this,Yc,!1),Ca(this,Ds,void 0),Ca(this,Xc,void 0),this.isTrust=!0,this.isTrustWallet=!0,this.request=this.request.bind(this),e&&(e.chainId&&ti(this,Qi,e.chainId),e.rpc&&ti(this,Gc,e.rpc),typeof e.overwriteMetamask<"u"&&ti(this,Yc,e.overwriteMetamask),typeof e.disableMobileAdapter<"u"&&ti(this,Al,e.disableMobileAdapter),typeof e.isTrust<"u"&&(this.isTrust=e.isTrust,this.isTrustWallet=e.isTrust),ti(this,Xc,new OO(ei(this,Gc)))),ei(this,Al)||(this.mobileAdapter=new CO(this)),super.on("onResponseReady",this.onResponseReady.bind(this)),this.connect()}connect(){this.emit("connect",{chainId:ei(this,Qi)})}enable(){return this.request({method:"eth_requestAccounts"})}sendAsync(e,t){Array.isArray(e)?Promise.all(e.map(r=>this.request(r))).then(r=>t(null,r)).catch(r=>t(r,null)):this.request(e).then(r=>t(null,r)).catch(r=>t(r,null))}_send(e){const t={jsonrpc:"2.0",result:null};switch(e.method){case"eth_accounts":case"eth_coinbase":case"net_version":case"eth_chainId":t.result=this.handleStaticRequests({method:"eth_accounts"});break;default:throw new lE(4200,`Trust does not support calling ${e.method} synchronously without a callback. Please provide a callback parameter to call ${e.method} asynchronously.`)}return t}send(e,t){if(typeof e=="string"&&(!t||Array.isArray(t))){const r=this;return new Promise((n,i)=>{try{const s=r.request({method:e,params:t});s instanceof Promise?s.then(n).catch(i):n(s)}catch(s){i(s)}})}else if(e&&typeof e=="object"&&typeof t=="function")return this.request(e).then(t);return this._send(e)}internalRequest(e){return super.request(e)}request(e){const t=()=>this.internalRequest(e);if(this.mobileAdapter){const r=this.handleStaticRequests(e,()=>this.mobileAdapter.request(e));return r instanceof Promise?r:Promise.resolve(r)}return this.handleStaticRequests(e,t)}handleStaticRequests(e,t){switch(e.method){case"net_version":return ei(this,Qi)?parseInt(ei(this,Qi)):void 0;case"eth_chainId":return ei(this,Qi);case"eth_accounts":case"eth_coinbase":return ei(this,Ds)?[ei(this,Ds)]:[]}if(t)return t()}onResponseReady(e,t){var r,n,i,s;if(t)switch(e.method){case"eth_requestAccounts":case"requestAccounts":ti(this,Ds,t[0]);break;case"wallet_requestPermissions":ti(this,Ds,(s=(i=(n=(r=t[0])==null?void 0:r.caveats)==null?void 0:n[0])==null?void 0:i.value)==null?void 0:s[0]);break}}getNetwork(){return pE.NETWORK}get connected(){return!0}get isMetaMask(){return ei(this,Yc)}getChainId(){return ei(this,Qi)}getNetworkVersion(){return this.handleStaticRequests({method:"net_version "})}setChainId(e){ti(this,Qi,e)}setRPCUrl(e){ti(this,Gc,e)}getRPC(){return ei(this,Xc)}setOverwriteMetamask(e){ti(this,Yc,e)}getAddress(){return ei(this,Ds)}setAddress(e){ti(this,Ds,e)}setRPC(e){ti(this,Xc,e)}};let gE=pE;Qi=new WeakMap,Gc=new WeakMap,Al=new WeakMap,Yc=new WeakMap,Ds=new WeakMap,Xc=new WeakMap,gE.NETWORK="ethereum";class NO{constructor(t){this.provider=t}async request(t,r){if(t.method==="getKey"){const i=await this.provider.internalRequest({method:"requestAccounts",params:t.params}),s=JSON.parse(i);return{algo:"secp256k1",address:s.address,bech32Address:s.address,pubKey:ie.Buffer.from(s.pubKey,"hex")}}const n={signAmino:"signTransaction",signDirect:"signTransaction",signArbitrary:"signMessage",sendTx:"sendTransaction"};return n[t.method]?this.provider.internalRequest({method:n[t.method],params:t.params}):r()}}var yE=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},wE=(e,t,r)=>(yE(e,t,"read from private field"),r?r.call(e):t.get(e)),PO=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},UO=(e,t,r,n)=>(yE(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Jc;const Qc=class extends Cl{constructor(e){super(),PO(this,Jc,!1),this.isKeplr=!0,this.isTrust=!0,this.isTrustWallet=!0,e&&(typeof e.disableMobileAdapter<"u"&&UO(this,Jc,e.disableMobileAdapter),typeof e.isKeplr<"u"&&(this.isKeplr=e.isKeplr),typeof e.isTrust<"u"&&(this.isTrust=e.isTrust,this.isTrustWallet=e.isTrust)),wE(this,Jc)||(this.mobileAdapter=new NO(this))}static bufferToHex(e){return"0x"+ie.Buffer.from(e).toString("hex")}getNetwork(){return Qc.NETWORK}isMobileAdapterEnabled(){return!wE(this,Jc)}enable(e){return this.request({method:"enable",params:{chainIds:e}})}internalRequest(e){return super.request(e)}request(e){const t=()=>this.internalRequest(e);return this.mobileAdapter?this.mobileAdapter.request(e,t):t()}getKey(e){return this.request({method:"getKey",params:{chainId:e}})}async sendTx(e,t,r){const n=ie.Buffer.from(t).toString("base64"),i=await this.request({method:"sendTx",params:{raw:n,chainId:e,mode:r}});return ie.Buffer.from(i,"hex")}async signArbitrary(e,t,r){const n=ie.Buffer.from(r),i=Qc.bufferToHex(n);return await this.request({method:"signArbitrary",params:{chainId:e,data:i,signerAddress:t}})}async signAmino(e,t,r){const n=await this.request({method:"signAmino",params:{chainId:e,sign_doc:r}}),{signed:i,signature:s}=JSON.parse(n);return{signed:i,signature:s}}async signDirect(e,t,r){const n={bodyBytes:Qc.bufferToHex(r.bodyBytes),authInfoBytes:Qc.bufferToHex(r.authInfoBytes)},i=await this.request({method:"signDirect",params:{signerAddress:t,chainId:e,sign_doc:n}}),{signature:s}=JSON.parse(i);return{signed:r,signature:s}}experimentalSuggestChain(){}getOfflineSignerDirect(e){return{getAccounts:async()=>[await this.getKey(e)],signDirect:async(t,r)=>{if(e!==r.chainId)throw new Error("Unmatched chain id with the offline signer");if((await this.getKey(r.chainId)).address!==t)throw new Error("Unknown signer address");return await this.signDirect(e,t,r)}}}getOfflineSigner(e){return this.getOfflineSignerAmino(e)}getOfflineSignerAuto(e){return this.getOfflineSignerAmino(e)}getOfflineSignerAmino(e){return{getAccounts:async()=>{const t=await this.getKey(e);return[{address:t.bech32Address,algo:"secp256k1",pubkey:t.pubKey}]},sign:(t,r)=>this.signAmino(e,t,r),signAmino:(t,r)=>this.signAmino(e,t,r)}}};let mE=Qc;Jc=new WeakMap,mE.NETWORK="cosmos";var Op={exports:{}},La=typeof Reflect=="object"?Reflect:null,bE=La&&typeof La.apply=="function"?La.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)},Bl;La&&typeof La.ownKeys=="function"?Bl=La.ownKeys:Object.getOwnPropertySymbols?Bl=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Bl=function(e){return Object.getOwnPropertyNames(e)};function FO(e){console&&console.warn&&console.warn(e)}var vE=Number.isNaN||function(e){return e!==e};function Gt(){Gt.init.call(this)}Op.exports=Gt,Op.exports.once=zO,Gt.EventEmitter=Gt,Gt.prototype._events=void 0,Gt.prototype._eventsCount=0,Gt.prototype._maxListeners=void 0;var _E=10;function Il(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(Gt,"defaultMaxListeners",{enumerable:!0,get:function(){return _E},set:function(e){if(typeof e!="number"||e<0||vE(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");_E=e}}),Gt.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Gt.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||vE(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function EE(e){return e._maxListeners===void 0?Gt.defaultMaxListeners:e._maxListeners}Gt.prototype.getMaxListeners=function(){return EE(this)},Gt.prototype.emit=function(e){for(var t=[],r=1;r0&&(s=t[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var a=i[e];if(a===void 0)return!1;if(typeof a=="function")bE(a,this,t);else for(var c=a.length,u=IE(a,c),r=0;r0&&o.length>i&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=o.length,FO(a)}return e}Gt.prototype.addListener=function(e,t){return xE(this,e,t,!1)},Gt.prototype.on=Gt.prototype.addListener,Gt.prototype.prependListener=function(e,t){return xE(this,e,t,!0)};function DO(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function SE(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=DO.bind(n);return i.listener=r,n.wrapFn=i,i}Gt.prototype.once=function(e,t){return Il(t),this.on(e,SE(this,e,t)),this},Gt.prototype.prependOnceListener=function(e,t){return Il(t),this.prependListener(e,SE(this,e,t)),this},Gt.prototype.removeListener=function(e,t){var r,n,i,s,o;if(Il(t),n=this._events,n===void 0)return this;if(r=n[e],r===void 0)return this;if(r===t||r.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if(typeof r!="function"){for(i=-1,s=r.length-1;s>=0;s--)if(r[s]===t||r[s].listener===t){o=r[s].listener,i=s;break}if(i<0)return this;i===0?r.shift():HO(r,i),r.length===1&&(n[e]=r[0]),n.removeListener!==void 0&&this.emit("removeListener",e,o||t)}return this},Gt.prototype.off=Gt.prototype.removeListener,Gt.prototype.removeAllListeners=function(e){var t,r,n;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var i=Object.keys(r),s;for(n=0;n=0;n--)this.removeListener(e,t[n]);return this};function AE(e,t,r){var n=e._events;if(n===void 0)return[];var i=n[t];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?jO(i):IE(i,i.length)}Gt.prototype.listeners=function(e){return AE(this,e,!0)},Gt.prototype.rawListeners=function(e){return AE(this,e,!1)},Gt.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):BE.call(e,t)},Gt.prototype.listenerCount=BE;function BE(e){var t=this._events;if(t!==void 0){var r=t[e];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}Gt.prototype.eventNames=function(){return this._eventsCount>0?Bl(this._events):[]};function IE(e,t){for(var r=new Array(t),n=0;n({address:r,application:i,chainId:this.chainId,fullMessage:n,message:e.message,nonce:e.nonce,prefix:t,signature:a}))}async signAndSubmitTransaction(e){const t=await this.signTransaction(e),r=await this.request({method:"sendTransaction",params:{tx:t}});return{hash:ef.messageToBuffer(r).toString()}}async signTransaction(e){const t=await this.request({method:"signTransaction",params:{data:e}});return JSON.parse(ef.messageToBuffer(t).toString())}};let kE=ef;kE.NETWORK="aptos";const WO=(e,t)=>new rx({strategy:e,handler:t}),KO=e=>new Q1(e),ZO=e=>new mE(e),GO=e=>new gE(e),YO=e=>new kE(e);window.trustwallet={core:WO,solana:KO,cosmos:ZO,ethereum:GO,aptos:YO}}); diff --git a/packages/android-web3-provider/package.json b/packages/android-web3-provider/package.json new file mode 100644 index 00000000..c0af332a --- /dev/null +++ b/packages/android-web3-provider/package.json @@ -0,0 +1,30 @@ +{ + "name": "@trustwallet/android-web3-provider", + "version": "4.0.0", + "type": "module", + "main": "dist/index.cjs.js", + "module": "dist/index.es.js", + "unpkg": "dist/index.umd.js", + "types": "dist/types/index.d.ts", + "author": "Trust ", + "license": "MIT", + "sideEffects": false, + "files": [ + "dist" + ], + "scripts": { + "build:clean": "rm -rf dist", + "build:types": "tsc", + "build:source": "bun build:clean; rollup --config ./rollup.config.js", + "dev": "bun build ./index.ts --outdir ./dist --watch" + }, + "dependencies": { + "@trustwallet/web3-provider-core": "workspace:*", + "@trustwallet/web3-provider-ethereum": "workspace:*", + "@trustwallet/web3-provider-solana": "workspace:*", + "@trustwallet/web3-provider-cosmos": "workspace:*", + "@trustwallet/web3-provider-aptos": "workspace:*", + "rollup-plugin-polyfill-node": "0.13.0" + }, + "devDependencies": { } +} diff --git a/packages/android-web3-provider/rollup.config.js b/packages/android-web3-provider/rollup.config.js new file mode 100644 index 00000000..e1329e2f --- /dev/null +++ b/packages/android-web3-provider/rollup.config.js @@ -0,0 +1,50 @@ +import esbuild from 'rollup-plugin-esbuild'; +import { nodeResolve } from '@rollup/plugin-node-resolve'; +import commonjs from '@rollup/plugin-commonjs'; +import { name, dependencies } from './package.json'; +import nodePolyfills from 'rollup-plugin-polyfill-node'; +import inject from '@rollup/plugin-inject'; + +const input = './index.ts'; +const plugins = [ + nodeResolve({ preferBuiltins: false, browser: true }), + commonjs(), + inject({ + modules: { + Buffer: ['buffer', 'Buffer'], + }, + }), + nodePolyfills(), + esbuild({ + minify: true, + tsconfig: './tsconfig.json', + loaders: { + '.json': 'json', + }, + }), +]; + +function createConfig( + packageName, + packageDependencies, + umd = {}, + cjs = {}, + es = {}, +) { + return [ + { + input, + plugins, + output: { + file: './lib/src/main/res/raw/trust_min.js', + format: 'umd', + exports: 'named', + name: packageName, + sourcemap: false, + ...umd, + }, + }, + ]; +} + +export default createConfig(name, Object.keys(dependencies)); diff --git a/packages/android-web3-provider/settings.gradle b/packages/android-web3-provider/settings.gradle new file mode 100644 index 00000000..45be8697 --- /dev/null +++ b/packages/android-web3-provider/settings.gradle @@ -0,0 +1,3 @@ +include ':app' +include ':lib' +rootProject.name = "Web3 Provider Demo" \ No newline at end of file diff --git a/packages/android-web3-provider/tsconfig.json b/packages/android-web3-provider/tsconfig.json new file mode 100644 index 00000000..5e8e402c --- /dev/null +++ b/packages/android-web3-provider/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "exclude": ["package.json", "rollup.config.js", "tsconfig.json", "tests", "./dist"], + "compilerOptions": { + "rootDir": "./", + "outDir": "./dist/types", + "emitDeclarationOnly": true + } +} From f860046def58ec94f7265f211780fd0db1113889 Mon Sep 17 00:00:00 2001 From: Yeferson Licet Date: Thu, 11 Jul 2024 14:14:07 -0300 Subject: [PATCH 2/7] Adding jitpack --- packages/android-web3-provider/jitpack.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 packages/android-web3-provider/jitpack.yml diff --git a/packages/android-web3-provider/jitpack.yml b/packages/android-web3-provider/jitpack.yml new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/packages/android-web3-provider/jitpack.yml @@ -0,0 +1 @@ + From 460e8fba337c0e850dd665eb614b8b788de0ba93 Mon Sep 17 00:00:00 2001 From: Yeferson Licet Date: Thu, 11 Jul 2024 14:42:33 -0300 Subject: [PATCH 3/7] Adding jitpack --- jitpack.yml | 5 +++++ packages/android-web3-provider/jitpack.yml | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 jitpack.yml delete mode 100644 packages/android-web3-provider/jitpack.yml diff --git a/jitpack.yml b/jitpack.yml new file mode 100644 index 00000000..0bf000cc --- /dev/null +++ b/jitpack.yml @@ -0,0 +1,5 @@ +jdk: + - openjdk8 + +build: + script: ./packages/android-web3-provider/gradlew build diff --git a/packages/android-web3-provider/jitpack.yml b/packages/android-web3-provider/jitpack.yml deleted file mode 100644 index 8b137891..00000000 --- a/packages/android-web3-provider/jitpack.yml +++ /dev/null @@ -1 +0,0 @@ - From 3dd650e33d1bea6b4d5efbae1c5f3e8f4a5fd7eb Mon Sep 17 00:00:00 2001 From: Yeferson Licet Date: Thu, 11 Jul 2024 15:15:48 -0300 Subject: [PATCH 4/7] Adding before install script --- jitpack.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jitpack.yml b/jitpack.yml index 0bf000cc..1affe8dd 100644 --- a/jitpack.yml +++ b/jitpack.yml @@ -1,5 +1,8 @@ jdk: - openjdk8 +before_install: + - echo "installing" + build: script: ./packages/android-web3-provider/gradlew build From 694fdbfa6b5d1ec36e11a1ebdedd28294e3de161 Mon Sep 17 00:00:00 2001 From: Yeferson Licet Date: Thu, 11 Jul 2024 15:49:09 -0300 Subject: [PATCH 5/7] Rename to android --- .gitignore | 8 ++++---- jitpack.yml | 2 +- .../app/build.gradle | 2 +- .../app/proguard-rules.pro | 0 .../app/src/main/AndroidManifest.xml | 0 .../app/src/main/java/com/trust/web3/demo/App.kt | 0 .../src/main/java/com/trust/web3/demo/DAppMethod.kt | 0 .../main/java/com/trust/web3/demo/MainActivity.kt | 0 .../src/main/java/com/trust/web3/demo/Numeric.kt | 0 .../java/com/trust/web3/demo/WebAppInterface.kt | 0 .../java/com/trust/web3/demo/WebViewExtension.kt | 0 .../res/drawable-v24/ic_launcher_foreground.xml | 0 .../main/res/drawable/ic_launcher_background.xml | 0 .../app/src/main/res/layout/activity_main.xml | 0 .../src/main/res/mipmap-anydpi-v26/ic_launcher.xml | 0 .../res/mipmap-anydpi-v26/ic_launcher_round.xml | 0 .../app/src/main/res/values/colors.xml | 0 .../app/src/main/res/values/strings.xml | 0 .../app/src/main/res/values/themes.xml | 0 .../{android-web3-provider => android}/build.gradle | 2 +- .../gradle.properties | 0 .../gradle/wrapper/gradle-wrapper.jar | Bin .../gradle/wrapper/gradle-wrapper.properties | 0 packages/{android-web3-provider => android}/gradlew | 0 .../{android-web3-provider => android}/index.ts | 0 .../lib/build.gradle | 0 .../lib/proguard-rules.pro | 0 .../lib/src/main/AndroidManifest.xml | 0 .../lib/src/main/res/raw/trust_min.js | 0 .../{android-web3-provider => android}/package.json | 0 .../rollup.config.js | 0 .../settings.gradle | 0 .../tsconfig.json | 0 33 files changed, 7 insertions(+), 7 deletions(-) rename packages/{android-web3-provider => android}/app/build.gradle (93%) rename packages/{android-web3-provider => android}/app/proguard-rules.pro (100%) rename packages/{android-web3-provider => android}/app/src/main/AndroidManifest.xml (100%) rename packages/{android-web3-provider => android}/app/src/main/java/com/trust/web3/demo/App.kt (100%) rename packages/{android-web3-provider => android}/app/src/main/java/com/trust/web3/demo/DAppMethod.kt (100%) rename packages/{android-web3-provider => android}/app/src/main/java/com/trust/web3/demo/MainActivity.kt (100%) rename packages/{android-web3-provider => android}/app/src/main/java/com/trust/web3/demo/Numeric.kt (100%) rename packages/{android-web3-provider => android}/app/src/main/java/com/trust/web3/demo/WebAppInterface.kt (100%) rename packages/{android-web3-provider => android}/app/src/main/java/com/trust/web3/demo/WebViewExtension.kt (100%) rename packages/{android-web3-provider => android}/app/src/main/res/drawable-v24/ic_launcher_foreground.xml (100%) rename packages/{android-web3-provider => android}/app/src/main/res/drawable/ic_launcher_background.xml (100%) rename packages/{android-web3-provider => android}/app/src/main/res/layout/activity_main.xml (100%) rename packages/{android-web3-provider => android}/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml (100%) rename packages/{android-web3-provider => android}/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml (100%) rename packages/{android-web3-provider => android}/app/src/main/res/values/colors.xml (100%) rename packages/{android-web3-provider => android}/app/src/main/res/values/strings.xml (100%) rename packages/{android-web3-provider => android}/app/src/main/res/values/themes.xml (100%) rename packages/{android-web3-provider => android}/build.gradle (92%) rename packages/{android-web3-provider => android}/gradle.properties (100%) rename packages/{android-web3-provider => android}/gradle/wrapper/gradle-wrapper.jar (100%) rename packages/{android-web3-provider => android}/gradle/wrapper/gradle-wrapper.properties (100%) rename packages/{android-web3-provider => android}/gradlew (100%) rename packages/{android-web3-provider => android}/index.ts (100%) rename packages/{android-web3-provider => android}/lib/build.gradle (100%) rename packages/{android-web3-provider => android}/lib/proguard-rules.pro (100%) rename packages/{android-web3-provider => android}/lib/src/main/AndroidManifest.xml (100%) rename packages/{android-web3-provider => android}/lib/src/main/res/raw/trust_min.js (100%) rename packages/{android-web3-provider => android}/package.json (100%) rename packages/{android-web3-provider => android}/rollup.config.js (100%) rename packages/{android-web3-provider => android}/settings.gradle (100%) rename packages/{android-web3-provider => android}/tsconfig.json (100%) diff --git a/.gitignore b/.gitignore index 1a785c0f..3eab5d30 100644 --- a/.gitignore +++ b/.gitignore @@ -173,8 +173,8 @@ dist # Finder (MacOS) folder config .DS_Store -packages/android-web3-provider/build -packages/android-web3-provider/app/build/* -packages/android-web3-provider/lib/build/* -packages/android-web3-provider/.gradle +packages/android/build +packages/android/app/build/* +packages/android/lib/build/* +packages/android/.gradle local.properties \ No newline at end of file diff --git a/jitpack.yml b/jitpack.yml index 1affe8dd..d58e4c10 100644 --- a/jitpack.yml +++ b/jitpack.yml @@ -5,4 +5,4 @@ before_install: - echo "installing" build: - script: ./packages/android-web3-provider/gradlew build + script: ./packages/android/gradlew build diff --git a/packages/android-web3-provider/app/build.gradle b/packages/android/app/build.gradle similarity index 93% rename from packages/android-web3-provider/app/build.gradle rename to packages/android/app/build.gradle index 7cc31b7e..4e711c41 100644 --- a/packages/android-web3-provider/app/build.gradle +++ b/packages/android/app/build.gradle @@ -43,7 +43,7 @@ dependencies { implementation "com.louiscad.splitties:splitties-alertdialog-material:3.0.0" implementation "com.trustwallet:wallet-core:2.9.7" - implementation 'com.github.trustwallet:trust-web3-provider:main' + implementation 'com.github.trustwallet:trust-web3-provider:4.0.1:packages/android-web3-provider/lib' testImplementation 'junit:junit:4.+' androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' diff --git a/packages/android-web3-provider/app/proguard-rules.pro b/packages/android/app/proguard-rules.pro similarity index 100% rename from packages/android-web3-provider/app/proguard-rules.pro rename to packages/android/app/proguard-rules.pro diff --git a/packages/android-web3-provider/app/src/main/AndroidManifest.xml b/packages/android/app/src/main/AndroidManifest.xml similarity index 100% rename from packages/android-web3-provider/app/src/main/AndroidManifest.xml rename to packages/android/app/src/main/AndroidManifest.xml diff --git a/packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/App.kt b/packages/android/app/src/main/java/com/trust/web3/demo/App.kt similarity index 100% rename from packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/App.kt rename to packages/android/app/src/main/java/com/trust/web3/demo/App.kt diff --git a/packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/DAppMethod.kt b/packages/android/app/src/main/java/com/trust/web3/demo/DAppMethod.kt similarity index 100% rename from packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/DAppMethod.kt rename to packages/android/app/src/main/java/com/trust/web3/demo/DAppMethod.kt diff --git a/packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/MainActivity.kt b/packages/android/app/src/main/java/com/trust/web3/demo/MainActivity.kt similarity index 100% rename from packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/MainActivity.kt rename to packages/android/app/src/main/java/com/trust/web3/demo/MainActivity.kt diff --git a/packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/Numeric.kt b/packages/android/app/src/main/java/com/trust/web3/demo/Numeric.kt similarity index 100% rename from packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/Numeric.kt rename to packages/android/app/src/main/java/com/trust/web3/demo/Numeric.kt diff --git a/packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/WebAppInterface.kt b/packages/android/app/src/main/java/com/trust/web3/demo/WebAppInterface.kt similarity index 100% rename from packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/WebAppInterface.kt rename to packages/android/app/src/main/java/com/trust/web3/demo/WebAppInterface.kt diff --git a/packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/WebViewExtension.kt b/packages/android/app/src/main/java/com/trust/web3/demo/WebViewExtension.kt similarity index 100% rename from packages/android-web3-provider/app/src/main/java/com/trust/web3/demo/WebViewExtension.kt rename to packages/android/app/src/main/java/com/trust/web3/demo/WebViewExtension.kt diff --git a/packages/android-web3-provider/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/packages/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml similarity index 100% rename from packages/android-web3-provider/app/src/main/res/drawable-v24/ic_launcher_foreground.xml rename to packages/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml diff --git a/packages/android-web3-provider/app/src/main/res/drawable/ic_launcher_background.xml b/packages/android/app/src/main/res/drawable/ic_launcher_background.xml similarity index 100% rename from packages/android-web3-provider/app/src/main/res/drawable/ic_launcher_background.xml rename to packages/android/app/src/main/res/drawable/ic_launcher_background.xml diff --git a/packages/android-web3-provider/app/src/main/res/layout/activity_main.xml b/packages/android/app/src/main/res/layout/activity_main.xml similarity index 100% rename from packages/android-web3-provider/app/src/main/res/layout/activity_main.xml rename to packages/android/app/src/main/res/layout/activity_main.xml diff --git a/packages/android-web3-provider/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/packages/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml similarity index 100% rename from packages/android-web3-provider/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml rename to packages/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml diff --git a/packages/android-web3-provider/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/packages/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml similarity index 100% rename from packages/android-web3-provider/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml rename to packages/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml diff --git a/packages/android-web3-provider/app/src/main/res/values/colors.xml b/packages/android/app/src/main/res/values/colors.xml similarity index 100% rename from packages/android-web3-provider/app/src/main/res/values/colors.xml rename to packages/android/app/src/main/res/values/colors.xml diff --git a/packages/android-web3-provider/app/src/main/res/values/strings.xml b/packages/android/app/src/main/res/values/strings.xml similarity index 100% rename from packages/android-web3-provider/app/src/main/res/values/strings.xml rename to packages/android/app/src/main/res/values/strings.xml diff --git a/packages/android-web3-provider/app/src/main/res/values/themes.xml b/packages/android/app/src/main/res/values/themes.xml similarity index 100% rename from packages/android-web3-provider/app/src/main/res/values/themes.xml rename to packages/android/app/src/main/res/values/themes.xml diff --git a/packages/android-web3-provider/build.gradle b/packages/android/build.gradle similarity index 92% rename from packages/android-web3-provider/build.gradle rename to packages/android/build.gradle index 5dc5397e..d0728351 100644 --- a/packages/android-web3-provider/build.gradle +++ b/packages/android/build.gradle @@ -1,7 +1,7 @@ buildscript { - ext.kotlin_version = "1.8.0" // Update to a compatible Kotlin version + ext.kotlin_version = "1.8.0" repositories { google() mavenCentral() diff --git a/packages/android-web3-provider/gradle.properties b/packages/android/gradle.properties similarity index 100% rename from packages/android-web3-provider/gradle.properties rename to packages/android/gradle.properties diff --git a/packages/android-web3-provider/gradle/wrapper/gradle-wrapper.jar b/packages/android/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from packages/android-web3-provider/gradle/wrapper/gradle-wrapper.jar rename to packages/android/gradle/wrapper/gradle-wrapper.jar diff --git a/packages/android-web3-provider/gradle/wrapper/gradle-wrapper.properties b/packages/android/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from packages/android-web3-provider/gradle/wrapper/gradle-wrapper.properties rename to packages/android/gradle/wrapper/gradle-wrapper.properties diff --git a/packages/android-web3-provider/gradlew b/packages/android/gradlew similarity index 100% rename from packages/android-web3-provider/gradlew rename to packages/android/gradlew diff --git a/packages/android-web3-provider/index.ts b/packages/android/index.ts similarity index 100% rename from packages/android-web3-provider/index.ts rename to packages/android/index.ts diff --git a/packages/android-web3-provider/lib/build.gradle b/packages/android/lib/build.gradle similarity index 100% rename from packages/android-web3-provider/lib/build.gradle rename to packages/android/lib/build.gradle diff --git a/packages/android-web3-provider/lib/proguard-rules.pro b/packages/android/lib/proguard-rules.pro similarity index 100% rename from packages/android-web3-provider/lib/proguard-rules.pro rename to packages/android/lib/proguard-rules.pro diff --git a/packages/android-web3-provider/lib/src/main/AndroidManifest.xml b/packages/android/lib/src/main/AndroidManifest.xml similarity index 100% rename from packages/android-web3-provider/lib/src/main/AndroidManifest.xml rename to packages/android/lib/src/main/AndroidManifest.xml diff --git a/packages/android-web3-provider/lib/src/main/res/raw/trust_min.js b/packages/android/lib/src/main/res/raw/trust_min.js similarity index 100% rename from packages/android-web3-provider/lib/src/main/res/raw/trust_min.js rename to packages/android/lib/src/main/res/raw/trust_min.js diff --git a/packages/android-web3-provider/package.json b/packages/android/package.json similarity index 100% rename from packages/android-web3-provider/package.json rename to packages/android/package.json diff --git a/packages/android-web3-provider/rollup.config.js b/packages/android/rollup.config.js similarity index 100% rename from packages/android-web3-provider/rollup.config.js rename to packages/android/rollup.config.js diff --git a/packages/android-web3-provider/settings.gradle b/packages/android/settings.gradle similarity index 100% rename from packages/android-web3-provider/settings.gradle rename to packages/android/settings.gradle diff --git a/packages/android-web3-provider/tsconfig.json b/packages/android/tsconfig.json similarity index 100% rename from packages/android-web3-provider/tsconfig.json rename to packages/android/tsconfig.json From 4bcf8ce8ae25279f031678a37a41e9c28484c8cb Mon Sep 17 00:00:00 2001 From: Yeferson Licet Date: Thu, 11 Jul 2024 16:01:42 -0300 Subject: [PATCH 6/7] Moving to root dir --- .gitignore | 8 ++++---- {packages/android => android}/app/build.gradle | 0 .../android => android}/app/proguard-rules.pro | 0 .../app/src/main/AndroidManifest.xml | 0 .../app/src/main/java/com/trust/web3/demo/App.kt | 0 .../src/main/java/com/trust/web3/demo/DAppMethod.kt | 0 .../main/java/com/trust/web3/demo/MainActivity.kt | 0 .../src/main/java/com/trust/web3/demo/Numeric.kt | 0 .../java/com/trust/web3/demo/WebAppInterface.kt | 0 .../java/com/trust/web3/demo/WebViewExtension.kt | 0 .../res/drawable-v24/ic_launcher_foreground.xml | 0 .../main/res/drawable/ic_launcher_background.xml | 0 .../app/src/main/res/layout/activity_main.xml | 0 .../src/main/res/mipmap-anydpi-v26/ic_launcher.xml | 0 .../res/mipmap-anydpi-v26/ic_launcher_round.xml | 0 .../app/src/main/res/values/colors.xml | 0 .../app/src/main/res/values/strings.xml | 0 .../app/src/main/res/values/themes.xml | 0 {packages/android => android}/build.gradle | 0 {packages/android => android}/gradle.properties | 0 .../gradle/wrapper/gradle-wrapper.jar | Bin .../gradle/wrapper/gradle-wrapper.properties | 0 {packages/android => android}/gradlew | 0 {packages/android => android}/lib/build.gradle | 0 .../android => android}/lib/proguard-rules.pro | 0 .../lib/src/main/AndroidManifest.xml | 0 .../lib/src/main/res/raw/trust_min.js | 0 {packages/android => android}/settings.gradle | 0 jitpack.yml | 6 ------ .../{android => android-web3-provider}/index.ts | 0 .../{android => android-web3-provider}/package.json | 0 .../rollup.config.js | 2 +- packages/android-web3-provider/settings.gradle | 3 +++ .../tsconfig.json | 0 packages/ios-web3-provider/swift/trust-min.js | 4 ++-- 35 files changed, 10 insertions(+), 13 deletions(-) rename {packages/android => android}/app/build.gradle (100%) rename {packages/android => android}/app/proguard-rules.pro (100%) rename {packages/android => android}/app/src/main/AndroidManifest.xml (100%) rename {packages/android => android}/app/src/main/java/com/trust/web3/demo/App.kt (100%) rename {packages/android => android}/app/src/main/java/com/trust/web3/demo/DAppMethod.kt (100%) rename {packages/android => android}/app/src/main/java/com/trust/web3/demo/MainActivity.kt (100%) rename {packages/android => android}/app/src/main/java/com/trust/web3/demo/Numeric.kt (100%) rename {packages/android => android}/app/src/main/java/com/trust/web3/demo/WebAppInterface.kt (100%) rename {packages/android => android}/app/src/main/java/com/trust/web3/demo/WebViewExtension.kt (100%) rename {packages/android => android}/app/src/main/res/drawable-v24/ic_launcher_foreground.xml (100%) rename {packages/android => android}/app/src/main/res/drawable/ic_launcher_background.xml (100%) rename {packages/android => android}/app/src/main/res/layout/activity_main.xml (100%) rename {packages/android => android}/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml (100%) rename {packages/android => android}/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml (100%) rename {packages/android => android}/app/src/main/res/values/colors.xml (100%) rename {packages/android => android}/app/src/main/res/values/strings.xml (100%) rename {packages/android => android}/app/src/main/res/values/themes.xml (100%) rename {packages/android => android}/build.gradle (100%) rename {packages/android => android}/gradle.properties (100%) rename {packages/android => android}/gradle/wrapper/gradle-wrapper.jar (100%) rename {packages/android => android}/gradle/wrapper/gradle-wrapper.properties (100%) rename {packages/android => android}/gradlew (100%) rename {packages/android => android}/lib/build.gradle (100%) rename {packages/android => android}/lib/proguard-rules.pro (100%) rename {packages/android => android}/lib/src/main/AndroidManifest.xml (100%) rename {packages/android => android}/lib/src/main/res/raw/trust_min.js (100%) rename {packages/android => android}/settings.gradle (100%) rename packages/{android => android-web3-provider}/index.ts (100%) rename packages/{android => android-web3-provider}/package.json (100%) rename packages/{android => android-web3-provider}/rollup.config.js (93%) create mode 100644 packages/android-web3-provider/settings.gradle rename packages/{android => android-web3-provider}/tsconfig.json (100%) diff --git a/.gitignore b/.gitignore index 3eab5d30..d65f2d47 100644 --- a/.gitignore +++ b/.gitignore @@ -173,8 +173,8 @@ dist # Finder (MacOS) folder config .DS_Store -packages/android/build -packages/android/app/build/* -packages/android/lib/build/* -packages/android/.gradle +android/build +android/app/build/* +android/lib/build/* +android/.gradle local.properties \ No newline at end of file diff --git a/packages/android/app/build.gradle b/android/app/build.gradle similarity index 100% rename from packages/android/app/build.gradle rename to android/app/build.gradle diff --git a/packages/android/app/proguard-rules.pro b/android/app/proguard-rules.pro similarity index 100% rename from packages/android/app/proguard-rules.pro rename to android/app/proguard-rules.pro diff --git a/packages/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml similarity index 100% rename from packages/android/app/src/main/AndroidManifest.xml rename to android/app/src/main/AndroidManifest.xml diff --git a/packages/android/app/src/main/java/com/trust/web3/demo/App.kt b/android/app/src/main/java/com/trust/web3/demo/App.kt similarity index 100% rename from packages/android/app/src/main/java/com/trust/web3/demo/App.kt rename to android/app/src/main/java/com/trust/web3/demo/App.kt diff --git a/packages/android/app/src/main/java/com/trust/web3/demo/DAppMethod.kt b/android/app/src/main/java/com/trust/web3/demo/DAppMethod.kt similarity index 100% rename from packages/android/app/src/main/java/com/trust/web3/demo/DAppMethod.kt rename to android/app/src/main/java/com/trust/web3/demo/DAppMethod.kt diff --git a/packages/android/app/src/main/java/com/trust/web3/demo/MainActivity.kt b/android/app/src/main/java/com/trust/web3/demo/MainActivity.kt similarity index 100% rename from packages/android/app/src/main/java/com/trust/web3/demo/MainActivity.kt rename to android/app/src/main/java/com/trust/web3/demo/MainActivity.kt diff --git a/packages/android/app/src/main/java/com/trust/web3/demo/Numeric.kt b/android/app/src/main/java/com/trust/web3/demo/Numeric.kt similarity index 100% rename from packages/android/app/src/main/java/com/trust/web3/demo/Numeric.kt rename to android/app/src/main/java/com/trust/web3/demo/Numeric.kt diff --git a/packages/android/app/src/main/java/com/trust/web3/demo/WebAppInterface.kt b/android/app/src/main/java/com/trust/web3/demo/WebAppInterface.kt similarity index 100% rename from packages/android/app/src/main/java/com/trust/web3/demo/WebAppInterface.kt rename to android/app/src/main/java/com/trust/web3/demo/WebAppInterface.kt diff --git a/packages/android/app/src/main/java/com/trust/web3/demo/WebViewExtension.kt b/android/app/src/main/java/com/trust/web3/demo/WebViewExtension.kt similarity index 100% rename from packages/android/app/src/main/java/com/trust/web3/demo/WebViewExtension.kt rename to android/app/src/main/java/com/trust/web3/demo/WebViewExtension.kt diff --git a/packages/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml similarity index 100% rename from packages/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml rename to android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml diff --git a/packages/android/app/src/main/res/drawable/ic_launcher_background.xml b/android/app/src/main/res/drawable/ic_launcher_background.xml similarity index 100% rename from packages/android/app/src/main/res/drawable/ic_launcher_background.xml rename to android/app/src/main/res/drawable/ic_launcher_background.xml diff --git a/packages/android/app/src/main/res/layout/activity_main.xml b/android/app/src/main/res/layout/activity_main.xml similarity index 100% rename from packages/android/app/src/main/res/layout/activity_main.xml rename to android/app/src/main/res/layout/activity_main.xml diff --git a/packages/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml similarity index 100% rename from packages/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml rename to android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml diff --git a/packages/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml similarity index 100% rename from packages/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml rename to android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml diff --git a/packages/android/app/src/main/res/values/colors.xml b/android/app/src/main/res/values/colors.xml similarity index 100% rename from packages/android/app/src/main/res/values/colors.xml rename to android/app/src/main/res/values/colors.xml diff --git a/packages/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml similarity index 100% rename from packages/android/app/src/main/res/values/strings.xml rename to android/app/src/main/res/values/strings.xml diff --git a/packages/android/app/src/main/res/values/themes.xml b/android/app/src/main/res/values/themes.xml similarity index 100% rename from packages/android/app/src/main/res/values/themes.xml rename to android/app/src/main/res/values/themes.xml diff --git a/packages/android/build.gradle b/android/build.gradle similarity index 100% rename from packages/android/build.gradle rename to android/build.gradle diff --git a/packages/android/gradle.properties b/android/gradle.properties similarity index 100% rename from packages/android/gradle.properties rename to android/gradle.properties diff --git a/packages/android/gradle/wrapper/gradle-wrapper.jar b/android/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from packages/android/gradle/wrapper/gradle-wrapper.jar rename to android/gradle/wrapper/gradle-wrapper.jar diff --git a/packages/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from packages/android/gradle/wrapper/gradle-wrapper.properties rename to android/gradle/wrapper/gradle-wrapper.properties diff --git a/packages/android/gradlew b/android/gradlew similarity index 100% rename from packages/android/gradlew rename to android/gradlew diff --git a/packages/android/lib/build.gradle b/android/lib/build.gradle similarity index 100% rename from packages/android/lib/build.gradle rename to android/lib/build.gradle diff --git a/packages/android/lib/proguard-rules.pro b/android/lib/proguard-rules.pro similarity index 100% rename from packages/android/lib/proguard-rules.pro rename to android/lib/proguard-rules.pro diff --git a/packages/android/lib/src/main/AndroidManifest.xml b/android/lib/src/main/AndroidManifest.xml similarity index 100% rename from packages/android/lib/src/main/AndroidManifest.xml rename to android/lib/src/main/AndroidManifest.xml diff --git a/packages/android/lib/src/main/res/raw/trust_min.js b/android/lib/src/main/res/raw/trust_min.js similarity index 100% rename from packages/android/lib/src/main/res/raw/trust_min.js rename to android/lib/src/main/res/raw/trust_min.js diff --git a/packages/android/settings.gradle b/android/settings.gradle similarity index 100% rename from packages/android/settings.gradle rename to android/settings.gradle diff --git a/jitpack.yml b/jitpack.yml index d58e4c10..8474bddc 100644 --- a/jitpack.yml +++ b/jitpack.yml @@ -1,8 +1,2 @@ -jdk: - - openjdk8 - before_install: - echo "installing" - -build: - script: ./packages/android/gradlew build diff --git a/packages/android/index.ts b/packages/android-web3-provider/index.ts similarity index 100% rename from packages/android/index.ts rename to packages/android-web3-provider/index.ts diff --git a/packages/android/package.json b/packages/android-web3-provider/package.json similarity index 100% rename from packages/android/package.json rename to packages/android-web3-provider/package.json diff --git a/packages/android/rollup.config.js b/packages/android-web3-provider/rollup.config.js similarity index 93% rename from packages/android/rollup.config.js rename to packages/android-web3-provider/rollup.config.js index e1329e2f..523941f5 100644 --- a/packages/android/rollup.config.js +++ b/packages/android-web3-provider/rollup.config.js @@ -36,7 +36,7 @@ function createConfig( input, plugins, output: { - file: './lib/src/main/res/raw/trust_min.js', + file: '../../android/lib/src/main/res/raw/trust_min.js', format: 'umd', exports: 'named', name: packageName, diff --git a/packages/android-web3-provider/settings.gradle b/packages/android-web3-provider/settings.gradle new file mode 100644 index 00000000..45be8697 --- /dev/null +++ b/packages/android-web3-provider/settings.gradle @@ -0,0 +1,3 @@ +include ':app' +include ':lib' +rootProject.name = "Web3 Provider Demo" \ No newline at end of file diff --git a/packages/android/tsconfig.json b/packages/android-web3-provider/tsconfig.json similarity index 100% rename from packages/android/tsconfig.json rename to packages/android-web3-provider/tsconfig.json diff --git a/packages/ios-web3-provider/swift/trust-min.js b/packages/ios-web3-provider/swift/trust-min.js index 87721372..f68fac6d 100644 --- a/packages/ios-web3-provider/swift/trust-min.js +++ b/packages/ios-web3-provider/swift/trust-min.js @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5222e9d5000eb5db2f905765888032be2ea1208aafc5a89f1b3ef2c3168b02d6 -size 675036 +oid sha256:cf06ad37ab960afdc7b6cecd86a20acc4f040294ac831f7593a37c8cf246fd4e +size 675087 From 5954f82ede085eff937bb2146d4f5244db417b09 Mon Sep 17 00:00:00 2001 From: Yeferson Licet Date: Thu, 11 Jul 2024 16:11:11 -0300 Subject: [PATCH 7/7] Rollback version --- android/app/build.gradle | 3 +-- android/app/src/main/AndroidManifest.xml | 4 +++- .../main/java/com/trust/web3/demo/MainActivity.kt | 1 - android/build.gradle | 13 ++++++++----- android/gradle/wrapper/gradle-wrapper.properties | 4 ++-- android/lib/build.gradle | 3 ++- android/lib/src/main/AndroidManifest.xml | 2 +- 7 files changed, 17 insertions(+), 13 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 4e711c41..350b3d7d 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -4,7 +4,6 @@ plugins { } android { - namespace 'com.trust.web3.demo' compileSdkVersion 30 buildToolsVersion "30.0.3" @@ -43,7 +42,7 @@ dependencies { implementation "com.louiscad.splitties:splitties-alertdialog-material:3.0.0" implementation "com.trustwallet:wallet-core:2.9.7" - implementation 'com.github.trustwallet:trust-web3-provider:4.0.1:packages/android-web3-provider/lib' + implementation 'com.github.trustwallet:trust-web3-provider:2.0.0-alpha' testImplementation 'junit:junit:4.+' androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 019ae2d9..ba4431bd 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,7 @@ - + + android { compileSdkVersion 28 - namespace 'trust.web3jproviderV2' + defaultConfig { minSdkVersion 23 targetSdkVersion 28 diff --git a/android/lib/src/main/AndroidManifest.xml b/android/lib/src/main/AndroidManifest.xml index cc947c56..f57d9dd7 100644 --- a/android/lib/src/main/AndroidManifest.xml +++ b/android/lib/src/main/AndroidManifest.xml @@ -1 +1 @@ - +