diff --git a/package.json b/package.json index b619ae066..24e7b533f 100644 --- a/package.json +++ b/package.json @@ -92,9 +92,10 @@ "web3": "^1.10.0" }, "devDependencies": { + "@actions/core": "^1.10.1", "@babel/eslint-parser": "^7.13.14", "@depay/web3-mock": "^13.26.0", - "@playwright/test": "^1.31.0", + "@playwright/test": "1.31.2", "@polkadot/ts": "^0.4.22", "@quasar/quasar-app-extension-apollo": "^2.1.0-beta.1", "@quasar/quasar-app-extension-qmarkdown": "^2.0.0-beta.10", diff --git a/src/components/assets/transfer/XcmBridge.vue b/src/components/assets/transfer/XcmBridge.vue index 7ce208f86..ed6b7d8a7 100644 --- a/src/components/assets/transfer/XcmBridge.vue +++ b/src/components/assets/transfer/XcmBridge.vue @@ -12,6 +12,7 @@ :is-selectable="isH160 ? false : true" :balance="String(fromAddressBalance)" :symbol="token.metadata.symbol" + data-testid="xcm-select-from-chain" />
@@ -29,6 +30,7 @@ :is-selectable="true" :balance="String(destAddressBalance)" :symbol="token.metadata.symbol" + data-testid="xcm-select-to-chain" />
-
+
{{ diff --git a/src/components/dashboard/InflationRateChart.vue b/src/components/dashboard/InflationRateChart.vue index 64c411dda..471564084 100644 --- a/src/components/dashboard/InflationRateChart.vue +++ b/src/components/dashboard/InflationRateChart.vue @@ -2,7 +2,7 @@
-
+
{{ diff --git a/src/components/header/modals/ModalNetworkWallet.vue b/src/components/header/modals/ModalNetworkWallet.vue index 181caa521..ff580ff94 100644 --- a/src/components/header/modals/ModalNetworkWallet.vue +++ b/src/components/header/modals/ModalNetworkWallet.vue @@ -27,7 +27,7 @@ :is-disabled="isDisabled" />
-
+
- +
icon diff --git a/src/staking-v3/components/DynamicAdsArea.vue b/src/staking-v3/components/DynamicAdsArea.vue index 4a243f4e9..269087fcd 100644 --- a/src/staking-v3/components/DynamicAdsArea.vue +++ b/src/staking-v3/components/DynamicAdsArea.vue @@ -30,6 +30,7 @@
diff --git a/src/staking-v3/components/RegisterBanner.vue b/src/staking-v3/components/RegisterBanner.vue index 00333de44..179785e81 100644 --- a/src/staking-v3/components/RegisterBanner.vue +++ b/src/staking-v3/components/RegisterBanner.vue @@ -4,6 +4,7 @@ :to="networkParam + Path.DappStaking + Path.Register" class="wrapper--register-banner" :style="{ backgroundImage: `url(${require('src/staking-v3/assets/register_bg.webp')})` }" + data-testid="register-dapp-banner" >
🎉 {{ `${$t('stakingV3.congrats')}` }}
diff --git a/tests/assets-transactions-evm.spec.ts b/tests/assets-transactions-evm.spec.ts deleted file mode 100644 index 4a9506793..000000000 --- a/tests/assets-transactions-evm.spec.ts +++ /dev/null @@ -1,121 +0,0 @@ -import { clickDisclaimerButton } from 'src/modules/playwright'; -import { BrowserContext, Page, expect } from '@playwright/test'; -import { test } from './fixtures'; -import { - ALICE_ACCOUNT_NAME, - ALICE_ACCOUNT_SEED, - ALICE_ADDRESS, - ALICE_EVM_ADDRESS, - BOB_ACCOUNT_NAME, - BOB_ACCOUNT_SEED, - BOB_ADDRESS, - closePolkadotWelcomePopup, - connectToNetwork, - createAccount, - createMetamaskAccount, - selectAccount, - signInMetamask, - signTransaction, - connectWithEVM, - changeNetworkOnEVM, -} from './common'; -import { ApiPromise } from '@polkadot/api'; -import { chainDecimals, getApi, getBalance } from './common-api'; - -let api: ApiPromise; -test.beforeAll(async () => { - api = await getApi(); -}); - -test.afterAll(async () => { - await api.disconnect(); -}); - -test.beforeEach(async ({ page, context }: { page: Page; context: BrowserContext }) => { - await page.goto('/astar/assets'); - await clickDisclaimerButton(page); - const walletTab = page.getByTestId('select-wallet-tab'); - await walletTab.click(); - - await closePolkadotWelcomePopup(context); - await createAccount(page, ALICE_ACCOUNT_SEED, ALICE_ACCOUNT_NAME); - await createAccount(page, BOB_ACCOUNT_SEED, BOB_ACCOUNT_NAME); - await createMetamaskAccount( - page, - 'bottom drive obey lake curtain smoke basket hold race lonely fit walk', - 'Test' - ); - await page.goto('/astar/assets'); - await connectToNetwork(page); - await selectAccount(page, ALICE_ACCOUNT_NAME); -}); - -test.describe('account panel', () => { - // Test case: AS002 - test('should transfer tokens from Alice to Bob on EVM account', async ({ - page, - context, - }: { - page: Page; - context: BrowserContext; - }) => { - // transfer test (from native to evm) :: need to testing - page.getByTestId('transfer-link-button').click(); - const faucetAmount = BigInt(200); - await page.getByPlaceholder('Destination Address').fill(ALICE_EVM_ADDRESS); - await page.getByPlaceholder('0.0').fill(faucetAmount.toString()); - await page.locator('.box--warning label').check(); - await page.getByRole('button', { name: 'Confirm' }).click(); - await signTransaction(context); - await page.waitForSelector('.four', { state: 'hidden' }); - await expect(page.getByText('Success')).toBeVisible(); - - //metamask setup - await page.locator('.btn--account').click(); - await page.locator('.wrapper--modal-drawer .modal-close').first().click(); - await page.getByText('MetaMask').click(); - await signInMetamask(page, context); - - //transfer test (from evm to native) - await page.goto('/custom-node/assets/transfer?token=astr&mode=local'); - await page.locator('.btn--connect').click(); - await page.getByText('MetaMask').click(); - const metamaskWindow = await connectWithEVM(page, context); - await changeNetworkOnEVM(page, context, metamaskWindow); - await page.waitForSelector('.modal-close', { state: 'hidden' }); - await expect(page.getByText('Select a Wallet')).toBeHidden(); - - const baseTransferAmount = BigInt(10); - //BOB_ADDRESS > ALICE_EVM_ADDRESS - const bobBalanceBeforeTransaction = await getBalance(BOB_ADDRESS); - const overTransferAmount = bobBalanceBeforeTransaction + baseTransferAmount; - await page.getByPlaceholder('Destination Address').fill(BOB_ADDRESS); - await page.getByPlaceholder('0.0').fill(overTransferAmount.toString()); - await expect(page.getByText('the funds will likely be lost')).toBeVisible(); - await expect(page.getByText('Insufficient')).toBeVisible(); - - // Invalid destination address - await page.getByPlaceholder('Destination Address').fill('invalid address'); - await page.getByPlaceholder('0.0').fill('0'); - await expect(page.getByText('Inputted invalid destination address')).toBeVisible(); - - // transfer alice_evm to native - await page.getByPlaceholder('Destination Address').fill(BOB_ADDRESS); - await page.getByPlaceholder('0.0').fill(baseTransferAmount.toString()); - await page.locator('.box--warning label').check(); - await expect(page.getByRole('button', { name: 'Confirm' })).toBeDisabled(); - - // MEMO: There's an issue where the balance between from and to of metamask is different, so this should be solved in another PR. - // await page.getByRole('button', { name: 'Confirm' }).click(); - - // send transaction - // await signTransaction(context); - // await page.waitForSelector('.four', { state: 'hidden' }); - - // await expect(page.getByText('Success')).toBeVisible(); - // const bobBalanceAfterTransaction = await getBalance(BOB_ADDRESS); - // expect(bobBalanceAfterTransaction - bobBalanceBeforeTransaction).toEqual( - // transferAmount * BigInt(Math.pow(10, chainDecimals)) - // ); - }); -}); diff --git a/tests/chopsticks/assethub.yml b/tests/chopsticks/assethub.yml new file mode 100644 index 000000000..7b20dd0d0 --- /dev/null +++ b/tests/chopsticks/assethub.yml @@ -0,0 +1,29 @@ +endpoint: wss://asset-hub-polkadot-rpc.dwellir.com +mock-signature-host: true +block: ${env.ASSETHUB_BLOCK_NUMBER} +db: ./db.sqlite +port: 9956 +# wasm-override: acala-2150.wasm + +import-storage: + System: + Account: + - - - 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY + - providers: 1 + data: + free: 1000000000000000 + - - - 246gNkjCexYRsCpdjtVhz35sHjcb21jpqipzT9u4uwKV8iEE + - data: + free: 1000000000000000 + - - - 249LSvsEyxS4VpEJGg62yhYA7sHy1KcgGW6KzACBCLW1RsZF + - data: + free: 1000000000000000 + - - - 21y4X7QDByUjnu5KX9W1H5TbG2wTLPDbhYFHqc4v6Q1nTBnu + - data: + free: 1000000000000000 + - - - 265dERKLvMFwWWvtGNUjQBrHFTT88VcEtb5QYh2Zuj79UGMf + - data: + free: 1000000000000000 + - - - 21XH88Kd5vDLkrZMb4D2eYJAB9yKbycfkYBqAaD1wQQi1uJ8 + - data: + free: 1000000000000000 diff --git a/tests/chopsticks/moonbeam.yml b/tests/chopsticks/moonbeam.yml index cd80a9107..865479342 100644 --- a/tests/chopsticks/moonbeam.yml +++ b/tests/chopsticks/moonbeam.yml @@ -12,10 +12,6 @@ import-storage: - providers: 1 data: free: '100000000000000000000000' - TechCommitteeCollective: - Members: ['0xf24FF3a9CF04c71Dbc94D0b566f7A27B94566cac'] - CouncilCollective: - Members: ['0xf24FF3a9CF04c71Dbc94D0b566f7A27B94566cac'] TreasuryCouncilCollective: Members: ['0xf24FF3a9CF04c71Dbc94D0b566f7A27B94566cac'] AuthorFilter: diff --git a/tests/chopsticks/setup-preconditions-api.js b/tests/chopsticks/setup-preconditions-api.js index aae3190f6..924eff1b1 100644 --- a/tests/chopsticks/setup-preconditions-api.js +++ b/tests/chopsticks/setup-preconditions-api.js @@ -27,8 +27,8 @@ async function run(nodeName, networkInfo, args) { // register dApp console.info('Registering dApps with sender: ', sender.address); - const tx4 = api.tx.dappsStaking.register(sender.address, { Evm: TEST_DAPP_ADDRESS }); - const tx5 = api.tx.dappsStaking.register(bob.address, { Evm: TEST_DAPP_ADDRESS_2 }); + const tx4 = api.tx.dappStaking.register(sender.address, { Evm: TEST_DAPP_ADDRESS }); + const tx5 = api.tx.dappStaking.register(bob.address, { Evm: TEST_DAPP_ADDRESS_2 }); await sendTransaction(api.tx.sudo.sudo(tx4), sender); await sendTransaction(api.tx.sudo.sudo(tx5), sender); diff --git a/tests/chopsticks/start-chopsticks.js b/tests/chopsticks/start-chopsticks.js index 6881e7f77..83547389c 100644 --- a/tests/chopsticks/start-chopsticks.js +++ b/tests/chopsticks/start-chopsticks.js @@ -27,8 +27,11 @@ const spawnDetached = (cmd) => { // Execute the run function with the given parameters async function executeRun() { try { + // const childProcess = spawnDetached( + // 'npx @acala-network/chopsticks@latest xcm -p=tests/chopsticks/astar.yml -p=tests/chopsticks/moonbeam.yml -p=tests/chopsticks/acala.yml -p=tests/chopsticks/interlay.yml -p=tests/chopsticks/bifrost.yml -r=tests/chopsticks/polkadot.yml' + // ); const childProcess = spawnDetached( - 'npx @acala-network/chopsticks@latest xcm -p=tests/chopsticks/astar.yml -p=tests/chopsticks/moonbeam.yml -p=tests/chopsticks/acala.yml -p=tests/chopsticks/interlay.yml -p=tests/chopsticks/bifrost.yml -r=tests/chopsticks/polkadot.yml' + 'npx @acala-network/chopsticks@latest xcm -p=tests/chopsticks/astar.yml -p=tests/chopsticks/acala.yml -p=tests/chopsticks/assethub.yml -r=tests/chopsticks/polkadot.yml' ); console.info('Chopsticks started with pid:', childProcess.pid); diff --git a/tests/chopsticks/start-playwright.js b/tests/chopsticks/start-playwright.js index 73418ec12..7f7615514 100644 --- a/tests/chopsticks/start-playwright.js +++ b/tests/chopsticks/start-playwright.js @@ -1,3 +1,5 @@ +const core = require('@actions/core'); + /* eslint-disable @typescript-eslint/no-var-requires */ const spawn = (cmd) => new Promise((resolve, reject) => { @@ -6,7 +8,7 @@ const spawn = (cmd) => const stdout = []; cp.stdout.on('data', (data) => { stdout.push(data.toString()); - console.info(data.toString()) + console.info(data.toString()); if (data.toString().includes('Ctrl+C')) { cp.kill(9); @@ -32,16 +34,26 @@ async function run(nodeName, networkInfo, args) { console.info('endpoint :', endpoint); let result = await spawn('npx playwright install --with-deps'); + + // Print playwright version + await spawn('npx playwright --version'); + + // Start tests result = await spawn( `BASE_URL=\'${args[0]}\' ENDPOINT=\'${endpoint}\' HEADLESS='true' CI='true' npx playwright test tests/test_specs --project=chromium` ); // MEMO: for debugging specific test case // result = await spawn( - // `BASE_URL=\'${args[0]}\' ENDPOINT=\'${endpoint}\' npx playwright test tests/assets-transactions-evm.spec.ts --project=chromium --debug` + // `BASE_URL=\'${args[0]}\' ENDPOINT=\'${endpoint}\' HEADLESS='true' npx playwright test test_specs/assets-transactions.spec.ts --project=chromium` // ); - return result?.includes('failed') ? 0 : 1; + const runResult = result?.includes('failed') || result?.includes('flaky') ? 1 : 0; + if (runResult !== 0) { + core.setFailed('One or more playwright tests failed.'); + } + + return runResult; } module.exports = { run }; diff --git a/tests/chopsticks/tx-utils.mjs b/tests/chopsticks/tx-utils.mjs index f49fa1735..5aff6967f 100644 --- a/tests/chopsticks/tx-utils.mjs +++ b/tests/chopsticks/tx-utils.mjs @@ -13,7 +13,6 @@ export async function sendTransaction(transaction, sender) { unsubscribe(); } - clearTimeout(timeout); resolve(true); } }) @@ -24,9 +23,5 @@ export async function sendTransaction(transaction, sender) { console.error(error); reject(error); }); - - timeout = setTimeout(() => { - reject(new Error('Transaction timeout')); - }, SPAWNING_TIME); }); } diff --git a/tests/common.ts b/tests/common.ts index cf9e70086..242bde1e3 100644 --- a/tests/common.ts +++ b/tests/common.ts @@ -36,10 +36,20 @@ export const connectToNetwork = async (page: Page): Promise => { await page.waitForNavigation(); }; -export const selectAccount = async (page: Page, accountName: string): Promise => { +export const selectAccount = async ( + page: Page, + accountName: string, + context: BrowserContext +): Promise => { const walletTab = page.getByTestId('select-wallet-tab'); await walletTab.click(); await page.getByTestId('Polkadot.js').click(); + + // Account selection popup + const extensionWindow = await getWindow('polkadot{.js}', context); + await extensionWindow.locator('label').filter({ hasText: 'Select all' }).locator('span').click(); + await extensionWindow.getByRole('button', { name: 'Connect 2 account(s)' }).click(); + await page.getByText(`${accountName} (extension)`).click(); await page.getByRole('button', { name: 'Connect', exact: true }).click(); }; @@ -90,7 +100,7 @@ export const closePolkadotWelcomePopup = async (context: BrowserContext): Promis const extensionWindow = await getWindow('polkadot{.js}', context); const extensionAcceptButton = extensionWindow.getByText('Understood, let me continue'); await extensionAcceptButton.click(); - const extensionAcceptButton2 = extensionWindow.getByText('Yes, allow this application access'); + const extensionAcceptButton2 = extensionWindow.getByText('Understood'); await extensionAcceptButton2.click(); }; @@ -143,15 +153,22 @@ export const signInMetamask = async (page: Page, context: BrowserContext): Promi export const connectWithEVM = async (page: Page, context: BrowserContext): Promise => { const extensionWindow = await getWindow('MetaMask Notification', context); - await extensionWindow.waitForLoadState('load'); - await extensionWindow.waitForSelector('.permissions-connect-header__title', { state: 'visible' }); - - await extensionWindow - .locator('.permissions-connect-choose-account__bottom-buttons') - .getByRole('button', { name: 'Next' }) - .click(); + // connect account + // await extensionWindow.locator('button btn--rounded btn-primary').click(); + await extensionWindow.getByRole('button', { name: 'Next' }).click(); await extensionWindow.locator('data-testid=page-container-footer-next').click(); + // ---------------------------- + + // await extensionWindow.waitForLoadState('load'); + // await extensionWindow.waitForSelector('.permissions-connect-header__title', { state: 'visible' }); + + // await extensionWindow + // .locator('.permissions-connect-choose-account__bottom-buttons') + // .getByRole('button', { name: 'Next' }) + // .click(); + + // await extensionWindow.locator('data-testid=page-container-footer-next').click(); return extensionWindow; }; diff --git a/tests/main.spec.ts b/tests/main.spec.ts index 50ac00957..f64d1d46c 100644 --- a/tests/main.spec.ts +++ b/tests/main.spec.ts @@ -1,11 +1,11 @@ import { test, expect } from '@playwright/test'; import { checkPolicyInLocalStorage } from 'src/modules/playwright'; -test.beforeEach(async ({ page }) => { - await page.goto('/'); -}); - test.describe('init screen', () => { + test.beforeEach(async ({ page }) => { + await page.goto('/'); + }); + test('should disclaimer is opened unless agreed', async ({ page }) => { await checkPolicyInLocalStorage(page); diff --git a/tests/polkadot_wallet/background.js b/tests/polkadot_wallet/background.js index c4ec83b34..552915058 100644 --- a/tests/polkadot_wallet/background.js +++ b/tests/polkadot_wallet/background.js @@ -1,2 +1,2 @@ /*! For license information please see background.js.LICENSE.txt */ -(()=>{var __webpack_modules__={464:(e,t,n)=>{!function(e){"use strict";var t=function(e){var t,n=new Float64Array(16);if(e)for(t=0;t>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n,e[t+4]=r>>24&255,e[t+5]=r>>16&255,e[t+6]=r>>8&255,e[t+7]=255&r}function y(e,t,n,r,i){var s,a=0;for(s=0;s>>8)-1}function m(e,t,n,r){return y(e,t,n,r,16)}function g(e,t,n,r){return y(e,t,n,r,32)}function b(e,t,n,r){!function(e,t,n,r){for(var i,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,o=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,c=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,u=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,l=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,h=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,p=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,f=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,y=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,m=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,g=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,v=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,w=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,x=s,S=a,P=o,T=c,k=u,M=l,A=h,V=d,N=p,E=f,I=y,H=m,O=g,C=b,L=v,U=w,B=0;B<20;B+=2)x^=(i=(O^=(i=(N^=(i=(k^=(i=x+O|0)<<7|i>>>25)+x|0)<<9|i>>>23)+k|0)<<13|i>>>19)+N|0)<<18|i>>>14,M^=(i=(S^=(i=(C^=(i=(E^=(i=M+S|0)<<7|i>>>25)+M|0)<<9|i>>>23)+E|0)<<13|i>>>19)+C|0)<<18|i>>>14,I^=(i=(A^=(i=(P^=(i=(L^=(i=I+A|0)<<7|i>>>25)+I|0)<<9|i>>>23)+L|0)<<13|i>>>19)+P|0)<<18|i>>>14,U^=(i=(H^=(i=(V^=(i=(T^=(i=U+H|0)<<7|i>>>25)+U|0)<<9|i>>>23)+T|0)<<13|i>>>19)+V|0)<<18|i>>>14,x^=(i=(T^=(i=(P^=(i=(S^=(i=x+T|0)<<7|i>>>25)+x|0)<<9|i>>>23)+S|0)<<13|i>>>19)+P|0)<<18|i>>>14,M^=(i=(k^=(i=(V^=(i=(A^=(i=M+k|0)<<7|i>>>25)+M|0)<<9|i>>>23)+A|0)<<13|i>>>19)+V|0)<<18|i>>>14,I^=(i=(E^=(i=(N^=(i=(H^=(i=I+E|0)<<7|i>>>25)+I|0)<<9|i>>>23)+H|0)<<13|i>>>19)+N|0)<<18|i>>>14,U^=(i=(L^=(i=(C^=(i=(O^=(i=U+L|0)<<7|i>>>25)+U|0)<<9|i>>>23)+O|0)<<13|i>>>19)+C|0)<<18|i>>>14;x=x+s|0,S=S+a|0,P=P+o|0,T=T+c|0,k=k+u|0,M=M+l|0,A=A+h|0,V=V+d|0,N=N+p|0,E=E+f|0,I=I+y|0,H=H+m|0,O=O+g|0,C=C+b|0,L=L+v|0,U=U+w|0,e[0]=x>>>0&255,e[1]=x>>>8&255,e[2]=x>>>16&255,e[3]=x>>>24&255,e[4]=S>>>0&255,e[5]=S>>>8&255,e[6]=S>>>16&255,e[7]=S>>>24&255,e[8]=P>>>0&255,e[9]=P>>>8&255,e[10]=P>>>16&255,e[11]=P>>>24&255,e[12]=T>>>0&255,e[13]=T>>>8&255,e[14]=T>>>16&255,e[15]=T>>>24&255,e[16]=k>>>0&255,e[17]=k>>>8&255,e[18]=k>>>16&255,e[19]=k>>>24&255,e[20]=M>>>0&255,e[21]=M>>>8&255,e[22]=M>>>16&255,e[23]=M>>>24&255,e[24]=A>>>0&255,e[25]=A>>>8&255,e[26]=A>>>16&255,e[27]=A>>>24&255,e[28]=V>>>0&255,e[29]=V>>>8&255,e[30]=V>>>16&255,e[31]=V>>>24&255,e[32]=N>>>0&255,e[33]=N>>>8&255,e[34]=N>>>16&255,e[35]=N>>>24&255,e[36]=E>>>0&255,e[37]=E>>>8&255,e[38]=E>>>16&255,e[39]=E>>>24&255,e[40]=I>>>0&255,e[41]=I>>>8&255,e[42]=I>>>16&255,e[43]=I>>>24&255,e[44]=H>>>0&255,e[45]=H>>>8&255,e[46]=H>>>16&255,e[47]=H>>>24&255,e[48]=O>>>0&255,e[49]=O>>>8&255,e[50]=O>>>16&255,e[51]=O>>>24&255,e[52]=C>>>0&255,e[53]=C>>>8&255,e[54]=C>>>16&255,e[55]=C>>>24&255,e[56]=L>>>0&255,e[57]=L>>>8&255,e[58]=L>>>16&255,e[59]=L>>>24&255,e[60]=U>>>0&255,e[61]=U>>>8&255,e[62]=U>>>16&255,e[63]=U>>>24&255}(e,t,n,r)}function v(e,t,n,r){!function(e,t,n,r){for(var i,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,o=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,c=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,u=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,l=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,h=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,p=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,f=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,y=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,m=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,g=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,v=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,w=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,x=0;x<20;x+=2)s^=(i=(g^=(i=(p^=(i=(u^=(i=s+g|0)<<7|i>>>25)+s|0)<<9|i>>>23)+u|0)<<13|i>>>19)+p|0)<<18|i>>>14,l^=(i=(a^=(i=(b^=(i=(f^=(i=l+a|0)<<7|i>>>25)+l|0)<<9|i>>>23)+f|0)<<13|i>>>19)+b|0)<<18|i>>>14,y^=(i=(h^=(i=(o^=(i=(v^=(i=y+h|0)<<7|i>>>25)+y|0)<<9|i>>>23)+v|0)<<13|i>>>19)+o|0)<<18|i>>>14,w^=(i=(m^=(i=(d^=(i=(c^=(i=w+m|0)<<7|i>>>25)+w|0)<<9|i>>>23)+c|0)<<13|i>>>19)+d|0)<<18|i>>>14,s^=(i=(c^=(i=(o^=(i=(a^=(i=s+c|0)<<7|i>>>25)+s|0)<<9|i>>>23)+a|0)<<13|i>>>19)+o|0)<<18|i>>>14,l^=(i=(u^=(i=(d^=(i=(h^=(i=l+u|0)<<7|i>>>25)+l|0)<<9|i>>>23)+h|0)<<13|i>>>19)+d|0)<<18|i>>>14,y^=(i=(f^=(i=(p^=(i=(m^=(i=y+f|0)<<7|i>>>25)+y|0)<<9|i>>>23)+m|0)<<13|i>>>19)+p|0)<<18|i>>>14,w^=(i=(v^=(i=(b^=(i=(g^=(i=w+v|0)<<7|i>>>25)+w|0)<<9|i>>>23)+g|0)<<13|i>>>19)+b|0)<<18|i>>>14;e[0]=s>>>0&255,e[1]=s>>>8&255,e[2]=s>>>16&255,e[3]=s>>>24&255,e[4]=l>>>0&255,e[5]=l>>>8&255,e[6]=l>>>16&255,e[7]=l>>>24&255,e[8]=y>>>0&255,e[9]=y>>>8&255,e[10]=y>>>16&255,e[11]=y>>>24&255,e[12]=w>>>0&255,e[13]=w>>>8&255,e[14]=w>>>16&255,e[15]=w>>>24&255,e[16]=h>>>0&255,e[17]=h>>>8&255,e[18]=h>>>16&255,e[19]=h>>>24&255,e[20]=d>>>0&255,e[21]=d>>>8&255,e[22]=d>>>16&255,e[23]=d>>>24&255,e[24]=p>>>0&255,e[25]=p>>>8&255,e[26]=p>>>16&255,e[27]=p>>>24&255,e[28]=f>>>0&255,e[29]=f>>>8&255,e[30]=f>>>16&255,e[31]=f>>>24&255}(e,t,n,r)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function x(e,t,n,r,i,s,a){var o,c,u=new Uint8Array(16),l=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=s[c];for(;i>=64;){for(b(l,u,a,w),c=0;c<64;c++)e[t+c]=n[r+c]^l[c];for(o=1,c=8;c<16;c++)o=o+(255&u[c])|0,u[c]=255&o,o>>>=8;i-=64,t+=64,r+=64}if(i>0)for(b(l,u,a,w),c=0;c=64;){for(b(c,o,i,w),a=0;a<64;a++)e[t+a]=c[a];for(s=1,a=8;a<16;a++)s=s+(255&o[a])|0,o[a]=255&s,s>>>=8;n-=64,t+=64}if(n>0)for(b(c,o,i,w),a=0;a>>13|n<<3),r=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(n>>>10|r<<6),i=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(r>>>7|i<<9),s=255&e[8]|(255&e[9])<<8,this.r[4]=255&(i>>>4|s<<12),this.r[5]=s>>>1&8190,a=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(s>>>14|a<<2),o=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(a>>>11|o<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(o>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function M(e,t,n,r,i,s){var a=new k(s);return a.update(n,r,i),a.finish(e,t),0}function A(e,t,n,r,i,s){var a=new Uint8Array(16);return M(a,0,n,r,i,s),m(e,t,a,0)}function V(e,t,n,r,i){var s;if(n<32)return-1;for(T(e,0,t,0,n,r,i),M(e,16,e,32,n-32,e),s=0;s<16;s++)e[s]=0;return 0}function N(e,t,n,r,i){var s,a=new Uint8Array(32);if(n<32)return-1;if(P(a,0,32,r,i),0!==A(t,16,t,32,n-32,a))return-1;for(T(e,0,t,0,n,r,i),s=0;s<32;s++)e[s]=0;return 0}function E(e,t){var n;for(n=0;n<16;n++)e[n]=0|t[n]}function I(e){var t,n,r=1;for(t=0;t<16;t++)n=e[t]+r+65535,r=Math.floor(n/65536),e[t]=n-65536*r;e[0]+=r-1+37*(r-1)}function H(e,t,n){for(var r,i=~(n-1),s=0;s<16;s++)r=i&(e[s]^t[s]),e[s]^=r,t[s]^=r}function O(e,n){var r,i,s,a=t(),o=t();for(r=0;r<16;r++)o[r]=n[r];for(I(o),I(o),I(o),i=0;i<2;i++){for(a[0]=o[0]-65517,r=1;r<15;r++)a[r]=o[r]-65535-(a[r-1]>>16&1),a[r-1]&=65535;a[15]=o[15]-32767-(a[14]>>16&1),s=a[15]>>16&1,a[14]&=65535,H(o,a,1-s)}for(r=0;r<16;r++)e[2*r]=255&o[r],e[2*r+1]=o[r]>>8}function C(e,t){var n=new Uint8Array(32),r=new Uint8Array(32);return O(n,e),O(r,t),g(n,0,r,0)}function L(e){var t=new Uint8Array(32);return O(t,e),1&t[0]}function U(e,t){var n;for(n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function B(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]+n[r]}function z(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]-n[r]}function R(e,t,n){var r,i,s=0,a=0,o=0,c=0,u=0,l=0,h=0,d=0,p=0,f=0,y=0,m=0,g=0,b=0,v=0,w=0,x=0,S=0,P=0,T=0,k=0,M=0,A=0,V=0,N=0,E=0,I=0,H=0,O=0,C=0,L=0,U=n[0],B=n[1],z=n[2],R=n[3],j=n[4],D=n[5],X=n[6],F=n[7],q=n[8],W=n[9],Z=n[10],K=n[11],G=n[12],Y=n[13],J=n[14],Q=n[15];s+=(r=t[0])*U,a+=r*B,o+=r*z,c+=r*R,u+=r*j,l+=r*D,h+=r*X,d+=r*F,p+=r*q,f+=r*W,y+=r*Z,m+=r*K,g+=r*G,b+=r*Y,v+=r*J,w+=r*Q,a+=(r=t[1])*U,o+=r*B,c+=r*z,u+=r*R,l+=r*j,h+=r*D,d+=r*X,p+=r*F,f+=r*q,y+=r*W,m+=r*Z,g+=r*K,b+=r*G,v+=r*Y,w+=r*J,x+=r*Q,o+=(r=t[2])*U,c+=r*B,u+=r*z,l+=r*R,h+=r*j,d+=r*D,p+=r*X,f+=r*F,y+=r*q,m+=r*W,g+=r*Z,b+=r*K,v+=r*G,w+=r*Y,x+=r*J,S+=r*Q,c+=(r=t[3])*U,u+=r*B,l+=r*z,h+=r*R,d+=r*j,p+=r*D,f+=r*X,y+=r*F,m+=r*q,g+=r*W,b+=r*Z,v+=r*K,w+=r*G,x+=r*Y,S+=r*J,P+=r*Q,u+=(r=t[4])*U,l+=r*B,h+=r*z,d+=r*R,p+=r*j,f+=r*D,y+=r*X,m+=r*F,g+=r*q,b+=r*W,v+=r*Z,w+=r*K,x+=r*G,S+=r*Y,P+=r*J,T+=r*Q,l+=(r=t[5])*U,h+=r*B,d+=r*z,p+=r*R,f+=r*j,y+=r*D,m+=r*X,g+=r*F,b+=r*q,v+=r*W,w+=r*Z,x+=r*K,S+=r*G,P+=r*Y,T+=r*J,k+=r*Q,h+=(r=t[6])*U,d+=r*B,p+=r*z,f+=r*R,y+=r*j,m+=r*D,g+=r*X,b+=r*F,v+=r*q,w+=r*W,x+=r*Z,S+=r*K,P+=r*G,T+=r*Y,k+=r*J,M+=r*Q,d+=(r=t[7])*U,p+=r*B,f+=r*z,y+=r*R,m+=r*j,g+=r*D,b+=r*X,v+=r*F,w+=r*q,x+=r*W,S+=r*Z,P+=r*K,T+=r*G,k+=r*Y,M+=r*J,A+=r*Q,p+=(r=t[8])*U,f+=r*B,y+=r*z,m+=r*R,g+=r*j,b+=r*D,v+=r*X,w+=r*F,x+=r*q,S+=r*W,P+=r*Z,T+=r*K,k+=r*G,M+=r*Y,A+=r*J,V+=r*Q,f+=(r=t[9])*U,y+=r*B,m+=r*z,g+=r*R,b+=r*j,v+=r*D,w+=r*X,x+=r*F,S+=r*q,P+=r*W,T+=r*Z,k+=r*K,M+=r*G,A+=r*Y,V+=r*J,N+=r*Q,y+=(r=t[10])*U,m+=r*B,g+=r*z,b+=r*R,v+=r*j,w+=r*D,x+=r*X,S+=r*F,P+=r*q,T+=r*W,k+=r*Z,M+=r*K,A+=r*G,V+=r*Y,N+=r*J,E+=r*Q,m+=(r=t[11])*U,g+=r*B,b+=r*z,v+=r*R,w+=r*j,x+=r*D,S+=r*X,P+=r*F,T+=r*q,k+=r*W,M+=r*Z,A+=r*K,V+=r*G,N+=r*Y,E+=r*J,I+=r*Q,g+=(r=t[12])*U,b+=r*B,v+=r*z,w+=r*R,x+=r*j,S+=r*D,P+=r*X,T+=r*F,k+=r*q,M+=r*W,A+=r*Z,V+=r*K,N+=r*G,E+=r*Y,I+=r*J,H+=r*Q,b+=(r=t[13])*U,v+=r*B,w+=r*z,x+=r*R,S+=r*j,P+=r*D,T+=r*X,k+=r*F,M+=r*q,A+=r*W,V+=r*Z,N+=r*K,E+=r*G,I+=r*Y,H+=r*J,O+=r*Q,v+=(r=t[14])*U,w+=r*B,x+=r*z,S+=r*R,P+=r*j,T+=r*D,k+=r*X,M+=r*F,A+=r*q,V+=r*W,N+=r*Z,E+=r*K,I+=r*G,H+=r*Y,O+=r*J,C+=r*Q,w+=(r=t[15])*U,a+=38*(S+=r*z),o+=38*(P+=r*R),c+=38*(T+=r*j),u+=38*(k+=r*D),l+=38*(M+=r*X),h+=38*(A+=r*F),d+=38*(V+=r*q),p+=38*(N+=r*W),f+=38*(E+=r*Z),y+=38*(I+=r*K),m+=38*(H+=r*G),g+=38*(O+=r*Y),b+=38*(C+=r*J),v+=38*(L+=r*Q),s=(r=(s+=38*(x+=r*B))+(i=1)+65535)-65536*(i=Math.floor(r/65536)),a=(r=a+i+65535)-65536*(i=Math.floor(r/65536)),o=(r=o+i+65535)-65536*(i=Math.floor(r/65536)),c=(r=c+i+65535)-65536*(i=Math.floor(r/65536)),u=(r=u+i+65535)-65536*(i=Math.floor(r/65536)),l=(r=l+i+65535)-65536*(i=Math.floor(r/65536)),h=(r=h+i+65535)-65536*(i=Math.floor(r/65536)),d=(r=d+i+65535)-65536*(i=Math.floor(r/65536)),p=(r=p+i+65535)-65536*(i=Math.floor(r/65536)),f=(r=f+i+65535)-65536*(i=Math.floor(r/65536)),y=(r=y+i+65535)-65536*(i=Math.floor(r/65536)),m=(r=m+i+65535)-65536*(i=Math.floor(r/65536)),g=(r=g+i+65535)-65536*(i=Math.floor(r/65536)),b=(r=b+i+65535)-65536*(i=Math.floor(r/65536)),v=(r=v+i+65535)-65536*(i=Math.floor(r/65536)),w=(r=w+i+65535)-65536*(i=Math.floor(r/65536)),s=(r=(s+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(r/65536)),a=(r=a+i+65535)-65536*(i=Math.floor(r/65536)),o=(r=o+i+65535)-65536*(i=Math.floor(r/65536)),c=(r=c+i+65535)-65536*(i=Math.floor(r/65536)),u=(r=u+i+65535)-65536*(i=Math.floor(r/65536)),l=(r=l+i+65535)-65536*(i=Math.floor(r/65536)),h=(r=h+i+65535)-65536*(i=Math.floor(r/65536)),d=(r=d+i+65535)-65536*(i=Math.floor(r/65536)),p=(r=p+i+65535)-65536*(i=Math.floor(r/65536)),f=(r=f+i+65535)-65536*(i=Math.floor(r/65536)),y=(r=y+i+65535)-65536*(i=Math.floor(r/65536)),m=(r=m+i+65535)-65536*(i=Math.floor(r/65536)),g=(r=g+i+65535)-65536*(i=Math.floor(r/65536)),b=(r=b+i+65535)-65536*(i=Math.floor(r/65536)),v=(r=v+i+65535)-65536*(i=Math.floor(r/65536)),w=(r=w+i+65535)-65536*(i=Math.floor(r/65536)),s+=i-1+37*(i-1),e[0]=s,e[1]=a,e[2]=o,e[3]=c,e[4]=u,e[5]=l,e[6]=h,e[7]=d,e[8]=p,e[9]=f,e[10]=y,e[11]=m,e[12]=g,e[13]=b,e[14]=v,e[15]=w}function j(e,t){R(e,t,t)}function D(e,n){var r,i=t();for(r=0;r<16;r++)i[r]=n[r];for(r=253;r>=0;r--)j(i,i),2!==r&&4!==r&&R(i,i,n);for(r=0;r<16;r++)e[r]=i[r]}function X(e,n){var r,i=t();for(r=0;r<16;r++)i[r]=n[r];for(r=250;r>=0;r--)j(i,i),1!==r&&R(i,i,n);for(r=0;r<16;r++)e[r]=i[r]}function F(e,n,r){var i,s,a=new Uint8Array(32),o=new Float64Array(80),u=t(),l=t(),h=t(),d=t(),p=t(),f=t();for(s=0;s<31;s++)a[s]=n[s];for(a[31]=127&n[31]|64,a[0]&=248,U(o,r),s=0;s<16;s++)l[s]=o[s],d[s]=u[s]=h[s]=0;for(u[0]=d[0]=1,s=254;s>=0;--s)H(u,l,i=a[s>>>3]>>>(7&s)&1),H(h,d,i),B(p,u,h),z(u,u,h),B(h,l,d),z(l,l,d),j(d,p),j(f,u),R(u,h,u),R(h,l,p),B(p,u,h),z(u,u,h),j(l,u),z(h,d,f),R(u,h,c),B(u,u,d),R(h,h,u),R(u,d,f),R(d,l,o),j(l,p),H(u,l,i),H(h,d,i);for(s=0;s<16;s++)o[s+16]=u[s],o[s+32]=h[s],o[s+48]=l[s],o[s+64]=d[s];var y=o.subarray(32),m=o.subarray(16);return D(y,y),R(m,m,y),O(e,m),0}function q(e,t){return F(e,t,s)}function W(e,t){return r(t,32),q(e,t)}function Z(e,t,n){var r=new Uint8Array(32);return F(r,n,t),v(e,i,r,w)}k.prototype.blocks=function(e,t,n){for(var r,i,s,a,o,c,u,l,h,d,p,f,y,m,g,b,v,w,x,S=this.fin?0:2048,P=this.h[0],T=this.h[1],k=this.h[2],M=this.h[3],A=this.h[4],V=this.h[5],N=this.h[6],E=this.h[7],I=this.h[8],H=this.h[9],O=this.r[0],C=this.r[1],L=this.r[2],U=this.r[3],B=this.r[4],z=this.r[5],R=this.r[6],j=this.r[7],D=this.r[8],X=this.r[9];n>=16;)d=h=0,d+=(P+=8191&(r=255&e[t+0]|(255&e[t+1])<<8))*O,d+=(T+=8191&(r>>>13|(i=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*X),d+=(k+=8191&(i>>>10|(s=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*D),d+=(M+=8191&(s>>>7|(a=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*j),h=(d+=(A+=8191&(a>>>4|(o=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*R))>>>13,d&=8191,d+=(V+=o>>>1&8191)*(5*z),d+=(N+=8191&(o>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*B),d+=(E+=8191&(c>>>11|(u=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*U),d+=(I+=8191&(u>>>8|(l=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*L),p=h+=(d+=(H+=l>>>5|S)*(5*C))>>>13,p+=P*C,p+=T*O,p+=k*(5*X),p+=M*(5*D),h=(p+=A*(5*j))>>>13,p&=8191,p+=V*(5*R),p+=N*(5*z),p+=E*(5*B),p+=I*(5*U),h+=(p+=H*(5*L))>>>13,p&=8191,f=h,f+=P*L,f+=T*C,f+=k*O,f+=M*(5*X),h=(f+=A*(5*D))>>>13,f&=8191,f+=V*(5*j),f+=N*(5*R),f+=E*(5*z),f+=I*(5*B),y=h+=(f+=H*(5*U))>>>13,y+=P*U,y+=T*L,y+=k*C,y+=M*O,h=(y+=A*(5*X))>>>13,y&=8191,y+=V*(5*D),y+=N*(5*j),y+=E*(5*R),y+=I*(5*z),m=h+=(y+=H*(5*B))>>>13,m+=P*B,m+=T*U,m+=k*L,m+=M*C,h=(m+=A*O)>>>13,m&=8191,m+=V*(5*X),m+=N*(5*D),m+=E*(5*j),m+=I*(5*R),g=h+=(m+=H*(5*z))>>>13,g+=P*z,g+=T*B,g+=k*U,g+=M*L,h=(g+=A*C)>>>13,g&=8191,g+=V*O,g+=N*(5*X),g+=E*(5*D),g+=I*(5*j),b=h+=(g+=H*(5*R))>>>13,b+=P*R,b+=T*z,b+=k*B,b+=M*U,h=(b+=A*L)>>>13,b&=8191,b+=V*C,b+=N*O,b+=E*(5*X),b+=I*(5*D),v=h+=(b+=H*(5*j))>>>13,v+=P*j,v+=T*R,v+=k*z,v+=M*B,h=(v+=A*U)>>>13,v&=8191,v+=V*L,v+=N*C,v+=E*O,v+=I*(5*X),w=h+=(v+=H*(5*D))>>>13,w+=P*D,w+=T*j,w+=k*R,w+=M*z,h=(w+=A*B)>>>13,w&=8191,w+=V*U,w+=N*L,w+=E*C,w+=I*O,x=h+=(w+=H*(5*X))>>>13,x+=P*X,x+=T*D,x+=k*j,x+=M*R,h=(x+=A*z)>>>13,x&=8191,x+=V*B,x+=N*U,x+=E*L,x+=I*C,P=d=8191&(h=(h=((h+=(x+=H*O)>>>13)<<2)+h|0)+(d&=8191)|0),T=p+=h>>>=13,k=f&=8191,M=y&=8191,A=m&=8191,V=g&=8191,N=b&=8191,E=v&=8191,I=w&=8191,H=x&=8191,t+=16,n-=16;this.h[0]=P,this.h[1]=T,this.h[2]=k,this.h[3]=M,this.h[4]=A,this.h[5]=V,this.h[6]=N,this.h[7]=E,this.h[8]=I,this.h[9]=H},k.prototype.finish=function(e,t){var n,r,i,s,a=new Uint16Array(10);if(this.leftover){for(s=this.leftover,this.buffer[s++]=1;s<16;s++)this.buffer[s]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,s=2;s<10;s++)this.h[s]+=n,n=this.h[s]>>>13,this.h[s]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,a[0]=this.h[0]+5,n=a[0]>>>13,a[0]&=8191,s=1;s<10;s++)a[s]=this.h[s]+n,n=a[s]>>>13,a[s]&=8191;for(a[9]-=8192,r=(1^n)-1,s=0;s<10;s++)a[s]&=r;for(r=~r,s=0;s<10;s++)this.h[s]=this.h[s]&r|a[s];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),i=this.h[0]+this.pad[0],this.h[0]=65535&i,s=1;s<8;s++)i=(this.h[s]+this.pad[s]|0)+(i>>>16)|0,this.h[s]=65535&i;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},k.prototype.update=function(e,t,n){var r,i;if(this.leftover){for((i=16-this.leftover)>n&&(i=n),r=0;r=16&&(i=n-n%16,this.blocks(e,t,i),t+=i,n-=i),n){for(r=0;r=128;){for(S=0;S<16;S++)P=8*S+G,E[S]=n[P+0]<<24|n[P+1]<<16|n[P+2]<<8|n[P+3],I[S]=n[P+4]<<24|n[P+5]<<16|n[P+6]<<8|n[P+7];for(S=0;S<80;S++)if(i=H,s=O,a=C,o=L,c=U,u=B,l=z,d=j,p=D,f=X,y=F,m=q,g=W,b=Z,M=65535&(k=K),A=k>>>16,V=65535&(T=R),N=T>>>16,M+=65535&(k=(q>>>14|U<<18)^(q>>>18|U<<14)^(U>>>9|q<<23)),A+=k>>>16,V+=65535&(T=(U>>>14|q<<18)^(U>>>18|q<<14)^(q>>>9|U<<23)),N+=T>>>16,M+=65535&(k=q&W^~q&Z),A+=k>>>16,V+=65535&(T=U&B^~U&z),N+=T>>>16,M+=65535&(k=Y[2*S+1]),A+=k>>>16,V+=65535&(T=Y[2*S]),N+=T>>>16,T=E[S%16],A+=(k=I[S%16])>>>16,V+=65535&T,N+=T>>>16,V+=(A+=(M+=65535&k)>>>16)>>>16,M=65535&(k=x=65535&M|A<<16),A=k>>>16,V=65535&(T=w=65535&V|(N+=V>>>16)<<16),N=T>>>16,M+=65535&(k=(j>>>28|H<<4)^(H>>>2|j<<30)^(H>>>7|j<<25)),A+=k>>>16,V+=65535&(T=(H>>>28|j<<4)^(j>>>2|H<<30)^(j>>>7|H<<25)),N+=T>>>16,A+=(k=j&D^j&X^D&X)>>>16,V+=65535&(T=H&O^H&C^O&C),N+=T>>>16,h=65535&(V+=(A+=(M+=65535&k)>>>16)>>>16)|(N+=V>>>16)<<16,v=65535&M|A<<16,M=65535&(k=y),A=k>>>16,V=65535&(T=o),N=T>>>16,A+=(k=x)>>>16,V+=65535&(T=w),N+=T>>>16,O=i,C=s,L=a,U=o=65535&(V+=(A+=(M+=65535&k)>>>16)>>>16)|(N+=V>>>16)<<16,B=c,z=u,R=l,H=h,D=d,X=p,F=f,q=y=65535&M|A<<16,W=m,Z=g,K=b,j=v,S%16==15)for(P=0;P<16;P++)T=E[P],M=65535&(k=I[P]),A=k>>>16,V=65535&T,N=T>>>16,T=E[(P+9)%16],M+=65535&(k=I[(P+9)%16]),A+=k>>>16,V+=65535&T,N+=T>>>16,w=E[(P+1)%16],M+=65535&(k=((x=I[(P+1)%16])>>>1|w<<31)^(x>>>8|w<<24)^(x>>>7|w<<25)),A+=k>>>16,V+=65535&(T=(w>>>1|x<<31)^(w>>>8|x<<24)^w>>>7),N+=T>>>16,w=E[(P+14)%16],A+=(k=((x=I[(P+14)%16])>>>19|w<<13)^(w>>>29|x<<3)^(x>>>6|w<<26))>>>16,V+=65535&(T=(w>>>19|x<<13)^(x>>>29|w<<3)^w>>>6),N+=T>>>16,N+=(V+=(A+=(M+=65535&k)>>>16)>>>16)>>>16,E[P]=65535&V|N<<16,I[P]=65535&M|A<<16;M=65535&(k=j),A=k>>>16,V=65535&(T=H),N=T>>>16,T=e[0],A+=(k=t[0])>>>16,V+=65535&T,N+=T>>>16,N+=(V+=(A+=(M+=65535&k)>>>16)>>>16)>>>16,e[0]=H=65535&V|N<<16,t[0]=j=65535&M|A<<16,M=65535&(k=D),A=k>>>16,V=65535&(T=O),N=T>>>16,T=e[1],A+=(k=t[1])>>>16,V+=65535&T,N+=T>>>16,N+=(V+=(A+=(M+=65535&k)>>>16)>>>16)>>>16,e[1]=O=65535&V|N<<16,t[1]=D=65535&M|A<<16,M=65535&(k=X),A=k>>>16,V=65535&(T=C),N=T>>>16,T=e[2],A+=(k=t[2])>>>16,V+=65535&T,N+=T>>>16,N+=(V+=(A+=(M+=65535&k)>>>16)>>>16)>>>16,e[2]=C=65535&V|N<<16,t[2]=X=65535&M|A<<16,M=65535&(k=F),A=k>>>16,V=65535&(T=L),N=T>>>16,T=e[3],A+=(k=t[3])>>>16,V+=65535&T,N+=T>>>16,N+=(V+=(A+=(M+=65535&k)>>>16)>>>16)>>>16,e[3]=L=65535&V|N<<16,t[3]=F=65535&M|A<<16,M=65535&(k=q),A=k>>>16,V=65535&(T=U),N=T>>>16,T=e[4],A+=(k=t[4])>>>16,V+=65535&T,N+=T>>>16,N+=(V+=(A+=(M+=65535&k)>>>16)>>>16)>>>16,e[4]=U=65535&V|N<<16,t[4]=q=65535&M|A<<16,M=65535&(k=W),A=k>>>16,V=65535&(T=B),N=T>>>16,T=e[5],A+=(k=t[5])>>>16,V+=65535&T,N+=T>>>16,N+=(V+=(A+=(M+=65535&k)>>>16)>>>16)>>>16,e[5]=B=65535&V|N<<16,t[5]=W=65535&M|A<<16,M=65535&(k=Z),A=k>>>16,V=65535&(T=z),N=T>>>16,T=e[6],A+=(k=t[6])>>>16,V+=65535&T,N+=T>>>16,N+=(V+=(A+=(M+=65535&k)>>>16)>>>16)>>>16,e[6]=z=65535&V|N<<16,t[6]=Z=65535&M|A<<16,M=65535&(k=K),A=k>>>16,V=65535&(T=R),N=T>>>16,T=e[7],A+=(k=t[7])>>>16,V+=65535&T,N+=T>>>16,N+=(V+=(A+=(M+=65535&k)>>>16)>>>16)>>>16,e[7]=R=65535&V|N<<16,t[7]=K=65535&M|A<<16,G+=128,r-=128}return r}function Q(e,t,n){var r,i=new Int32Array(8),s=new Int32Array(8),a=new Uint8Array(256),o=n;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,s[0]=4089235720,s[1]=2227873595,s[2]=4271175723,s[3]=1595750129,s[4]=2917565137,s[5]=725511199,s[6]=4215389547,s[7]=327033209,J(i,s,t,n),n%=128,r=0;r=0;--i)$(e,t,r=n[i/8|0]>>(7&i)&1),_(t,e),_(e,e),$(e,t,r)}function ne(e,n){var r=[t(),t(),t(),t()];E(r[0],h),E(r[1],d),E(r[2],o),R(r[3],h,d),te(e,r,n)}function re(e,n,i){var s,a=new Uint8Array(64),o=[t(),t(),t(),t()];for(i||r(n,32),Q(a,n,32),a[0]&=248,a[31]&=127,a[31]|=64,ne(o,a),ee(e,o),s=0;s<32;s++)n[s+32]=e[s];return 0}var ie=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 se(e,t){var n,r,i,s;for(r=63;r>=32;--r){for(n=0,i=r-32,s=r-12;i>4)*ie[i],n=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=n*ie[i];for(r=0;r<32;r++)t[r+1]+=t[r]>>8,e[r]=255&t[r]}function ae(e){var t,n=new Float64Array(64);for(t=0;t<64;t++)n[t]=e[t];for(t=0;t<64;t++)e[t]=0;se(e,n)}function oe(e,n,r,i){var s,a,o=new Uint8Array(64),c=new Uint8Array(64),u=new Uint8Array(64),l=new Float64Array(64),h=[t(),t(),t(),t()];Q(o,i,32),o[0]&=248,o[31]&=127,o[31]|=64;var d=r+64;for(s=0;s>7&&z(e[0],a,e[0]),R(e[3],e[0],e[1]),0)}(d,i))return-1;for(s=0;s=0},e.sign.keyPair=function(){var e=new Uint8Array(he),t=new Uint8Array(de);return re(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(fe(e),e.length!==de)throw new Error("bad secret key size");for(var t=new Uint8Array(he),n=0;n=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function c(e,t,n){var r=o(e,n);return n-1>=t&&(r|=o(e,n-1)<<4),r}function u(e,t,n,i){for(var s=0,a=0,o=Math.min(e.length,n),c=t;c=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&a0?e:t},s.min=function(e,t){return e.cmp(t)<0?e:t},s.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[s]|=a<>>26-o&67108863,(o+=24)>=26&&(o-=26,s++);else if("le"===n)for(i=0,s=0;i>>26-o&67108863,(o+=24)>=26&&(o-=26,s++);return this._strip()},s.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=c(e,t,r)<=18?(s-=18,a+=1,this.words[a]|=i>>>26):s+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(s-=18,a+=1,this.words[a]|=i>>>26):s+=8;this._strip()},s.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var s=e.length-n,a=s%r,o=Math.min(s,s-a)+n,c=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch(e){s.prototype.inspect=h}else s.prototype.inspect=h;function h(){return(this.red?""}var d=["","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"],p=[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],f=[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];function y(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],s=0|t.words[0],a=i*s,o=67108863&a,c=a/67108864|0;n.words[0]=o;for(var u=1;u>>26,h=67108863&c,d=Math.min(u,t.length-1),p=Math.max(0,u-e.length+1);p<=d;p++){var f=u-p|0;l+=(a=(i=0|e.words[f])*(s=0|t.words[p])+h)/67108864|0,h=67108863&a}n.words[u]=0|h,c=0|l}return 0!==c?n.words[u]=0|c:n.length--,n._strip()}s.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,s=0,a=0;a>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),n=0!==s||a!==this.length-1?d[6-c.length]+c+n:c+n}for(0!==s&&(n=s.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=p[e],l=f[e];n="";var h=this.clone();for(h.negative=0;!h.isZero();){var y=h.modrn(l).toString(e);n=(h=h.idivn(l)).isZero()?y+n:d[u-y.length]+y+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},s.prototype.toJSON=function(){return this.toString(16,2)},a&&(s.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),s.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},s.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),s=n||Math.max(1,i);r(i<=s,"byte array longer than desired length"),r(s>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,s);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},s.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,s=0;i>8&255),n>16&255),6===s?(n>24&255),r=0,s=0):(r=a>>>24,s+=2)}if(n=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===s?(n>=0&&(e[n--]=a>>24&255),r=0,s=0):(r=a>>>24,s+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?s.prototype._countBits=function(e){return 32-Math.clz32(e)}:s.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},s.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},s.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},s.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},s.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},s.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},s.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},s.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},s.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},s.prototype.notn=function(e){return this.clone().inotn(e)},s.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,s=0;s>>26;for(;0!==i&&s>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;se.length?this.clone().iadd(e):e.clone().iadd(this)},s.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var s=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==s&&a>26,this.words[a]=67108863&t;if(0===s&&a>>13,p=0|a[1],f=8191&p,y=p>>>13,m=0|a[2],g=8191&m,b=m>>>13,v=0|a[3],w=8191&v,x=v>>>13,S=0|a[4],P=8191&S,T=S>>>13,k=0|a[5],M=8191&k,A=k>>>13,V=0|a[6],N=8191&V,E=V>>>13,I=0|a[7],H=8191&I,O=I>>>13,C=0|a[8],L=8191&C,U=C>>>13,B=0|a[9],z=8191&B,R=B>>>13,j=0|o[0],D=8191&j,X=j>>>13,F=0|o[1],q=8191&F,W=F>>>13,Z=0|o[2],K=8191&Z,G=Z>>>13,Y=0|o[3],J=8191&Y,Q=Y>>>13,_=0|o[4],$=8191&_,ee=_>>>13,te=0|o[5],ne=8191&te,re=te>>>13,ie=0|o[6],se=8191&ie,ae=ie>>>13,oe=0|o[7],ce=8191&oe,ue=oe>>>13,le=0|o[8],he=8191&le,de=le>>>13,pe=0|o[9],fe=8191&pe,ye=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var me=(u+(r=Math.imul(h,D))|0)+((8191&(i=(i=Math.imul(h,X))+Math.imul(d,D)|0))<<13)|0;u=((s=Math.imul(d,X))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(f,D),i=(i=Math.imul(f,X))+Math.imul(y,D)|0,s=Math.imul(y,X);var ge=(u+(r=r+Math.imul(h,q)|0)|0)+((8191&(i=(i=i+Math.imul(h,W)|0)+Math.imul(d,q)|0))<<13)|0;u=((s=s+Math.imul(d,W)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,D),i=(i=Math.imul(g,X))+Math.imul(b,D)|0,s=Math.imul(b,X),r=r+Math.imul(f,q)|0,i=(i=i+Math.imul(f,W)|0)+Math.imul(y,q)|0,s=s+Math.imul(y,W)|0;var be=(u+(r=r+Math.imul(h,K)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(d,K)|0))<<13)|0;u=((s=s+Math.imul(d,G)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(w,D),i=(i=Math.imul(w,X))+Math.imul(x,D)|0,s=Math.imul(x,X),r=r+Math.imul(g,q)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(b,q)|0,s=s+Math.imul(b,W)|0,r=r+Math.imul(f,K)|0,i=(i=i+Math.imul(f,G)|0)+Math.imul(y,K)|0,s=s+Math.imul(y,G)|0;var ve=(u+(r=r+Math.imul(h,J)|0)|0)+((8191&(i=(i=i+Math.imul(h,Q)|0)+Math.imul(d,J)|0))<<13)|0;u=((s=s+Math.imul(d,Q)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(P,D),i=(i=Math.imul(P,X))+Math.imul(T,D)|0,s=Math.imul(T,X),r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(x,q)|0,s=s+Math.imul(x,W)|0,r=r+Math.imul(g,K)|0,i=(i=i+Math.imul(g,G)|0)+Math.imul(b,K)|0,s=s+Math.imul(b,G)|0,r=r+Math.imul(f,J)|0,i=(i=i+Math.imul(f,Q)|0)+Math.imul(y,J)|0,s=s+Math.imul(y,Q)|0;var we=(u+(r=r+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(d,$)|0))<<13)|0;u=((s=s+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(M,D),i=(i=Math.imul(M,X))+Math.imul(A,D)|0,s=Math.imul(A,X),r=r+Math.imul(P,q)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(T,q)|0,s=s+Math.imul(T,W)|0,r=r+Math.imul(w,K)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(x,K)|0,s=s+Math.imul(x,G)|0,r=r+Math.imul(g,J)|0,i=(i=i+Math.imul(g,Q)|0)+Math.imul(b,J)|0,s=s+Math.imul(b,Q)|0,r=r+Math.imul(f,$)|0,i=(i=i+Math.imul(f,ee)|0)+Math.imul(y,$)|0,s=s+Math.imul(y,ee)|0;var xe=(u+(r=r+Math.imul(h,ne)|0)|0)+((8191&(i=(i=i+Math.imul(h,re)|0)+Math.imul(d,ne)|0))<<13)|0;u=((s=s+Math.imul(d,re)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(N,D),i=(i=Math.imul(N,X))+Math.imul(E,D)|0,s=Math.imul(E,X),r=r+Math.imul(M,q)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(A,q)|0,s=s+Math.imul(A,W)|0,r=r+Math.imul(P,K)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(T,K)|0,s=s+Math.imul(T,G)|0,r=r+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(x,J)|0,s=s+Math.imul(x,Q)|0,r=r+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(b,$)|0,s=s+Math.imul(b,ee)|0,r=r+Math.imul(f,ne)|0,i=(i=i+Math.imul(f,re)|0)+Math.imul(y,ne)|0,s=s+Math.imul(y,re)|0;var Se=(u+(r=r+Math.imul(h,se)|0)|0)+((8191&(i=(i=i+Math.imul(h,ae)|0)+Math.imul(d,se)|0))<<13)|0;u=((s=s+Math.imul(d,ae)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(H,D),i=(i=Math.imul(H,X))+Math.imul(O,D)|0,s=Math.imul(O,X),r=r+Math.imul(N,q)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(E,q)|0,s=s+Math.imul(E,W)|0,r=r+Math.imul(M,K)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(A,K)|0,s=s+Math.imul(A,G)|0,r=r+Math.imul(P,J)|0,i=(i=i+Math.imul(P,Q)|0)+Math.imul(T,J)|0,s=s+Math.imul(T,Q)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(x,$)|0,s=s+Math.imul(x,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(b,ne)|0,s=s+Math.imul(b,re)|0,r=r+Math.imul(f,se)|0,i=(i=i+Math.imul(f,ae)|0)+Math.imul(y,se)|0,s=s+Math.imul(y,ae)|0;var Pe=(u+(r=r+Math.imul(h,ce)|0)|0)+((8191&(i=(i=i+Math.imul(h,ue)|0)+Math.imul(d,ce)|0))<<13)|0;u=((s=s+Math.imul(d,ue)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(L,D),i=(i=Math.imul(L,X))+Math.imul(U,D)|0,s=Math.imul(U,X),r=r+Math.imul(H,q)|0,i=(i=i+Math.imul(H,W)|0)+Math.imul(O,q)|0,s=s+Math.imul(O,W)|0,r=r+Math.imul(N,K)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(E,K)|0,s=s+Math.imul(E,G)|0,r=r+Math.imul(M,J)|0,i=(i=i+Math.imul(M,Q)|0)+Math.imul(A,J)|0,s=s+Math.imul(A,Q)|0,r=r+Math.imul(P,$)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(T,$)|0,s=s+Math.imul(T,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(x,ne)|0,s=s+Math.imul(x,re)|0,r=r+Math.imul(g,se)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(b,se)|0,s=s+Math.imul(b,ae)|0,r=r+Math.imul(f,ce)|0,i=(i=i+Math.imul(f,ue)|0)+Math.imul(y,ce)|0,s=s+Math.imul(y,ue)|0;var Te=(u+(r=r+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,de)|0)+Math.imul(d,he)|0))<<13)|0;u=((s=s+Math.imul(d,de)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(z,D),i=(i=Math.imul(z,X))+Math.imul(R,D)|0,s=Math.imul(R,X),r=r+Math.imul(L,q)|0,i=(i=i+Math.imul(L,W)|0)+Math.imul(U,q)|0,s=s+Math.imul(U,W)|0,r=r+Math.imul(H,K)|0,i=(i=i+Math.imul(H,G)|0)+Math.imul(O,K)|0,s=s+Math.imul(O,G)|0,r=r+Math.imul(N,J)|0,i=(i=i+Math.imul(N,Q)|0)+Math.imul(E,J)|0,s=s+Math.imul(E,Q)|0,r=r+Math.imul(M,$)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(A,$)|0,s=s+Math.imul(A,ee)|0,r=r+Math.imul(P,ne)|0,i=(i=i+Math.imul(P,re)|0)+Math.imul(T,ne)|0,s=s+Math.imul(T,re)|0,r=r+Math.imul(w,se)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(x,se)|0,s=s+Math.imul(x,ae)|0,r=r+Math.imul(g,ce)|0,i=(i=i+Math.imul(g,ue)|0)+Math.imul(b,ce)|0,s=s+Math.imul(b,ue)|0,r=r+Math.imul(f,he)|0,i=(i=i+Math.imul(f,de)|0)+Math.imul(y,he)|0,s=s+Math.imul(y,de)|0;var ke=(u+(r=r+Math.imul(h,fe)|0)|0)+((8191&(i=(i=i+Math.imul(h,ye)|0)+Math.imul(d,fe)|0))<<13)|0;u=((s=s+Math.imul(d,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(z,q),i=(i=Math.imul(z,W))+Math.imul(R,q)|0,s=Math.imul(R,W),r=r+Math.imul(L,K)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(U,K)|0,s=s+Math.imul(U,G)|0,r=r+Math.imul(H,J)|0,i=(i=i+Math.imul(H,Q)|0)+Math.imul(O,J)|0,s=s+Math.imul(O,Q)|0,r=r+Math.imul(N,$)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(E,$)|0,s=s+Math.imul(E,ee)|0,r=r+Math.imul(M,ne)|0,i=(i=i+Math.imul(M,re)|0)+Math.imul(A,ne)|0,s=s+Math.imul(A,re)|0,r=r+Math.imul(P,se)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(T,se)|0,s=s+Math.imul(T,ae)|0,r=r+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(x,ce)|0,s=s+Math.imul(x,ue)|0,r=r+Math.imul(g,he)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(b,he)|0,s=s+Math.imul(b,de)|0;var Me=(u+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ye)|0)+Math.imul(y,fe)|0))<<13)|0;u=((s=s+Math.imul(y,ye)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(z,K),i=(i=Math.imul(z,G))+Math.imul(R,K)|0,s=Math.imul(R,G),r=r+Math.imul(L,J)|0,i=(i=i+Math.imul(L,Q)|0)+Math.imul(U,J)|0,s=s+Math.imul(U,Q)|0,r=r+Math.imul(H,$)|0,i=(i=i+Math.imul(H,ee)|0)+Math.imul(O,$)|0,s=s+Math.imul(O,ee)|0,r=r+Math.imul(N,ne)|0,i=(i=i+Math.imul(N,re)|0)+Math.imul(E,ne)|0,s=s+Math.imul(E,re)|0,r=r+Math.imul(M,se)|0,i=(i=i+Math.imul(M,ae)|0)+Math.imul(A,se)|0,s=s+Math.imul(A,ae)|0,r=r+Math.imul(P,ce)|0,i=(i=i+Math.imul(P,ue)|0)+Math.imul(T,ce)|0,s=s+Math.imul(T,ue)|0,r=r+Math.imul(w,he)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(x,he)|0,s=s+Math.imul(x,de)|0;var Ae=(u+(r=r+Math.imul(g,fe)|0)|0)+((8191&(i=(i=i+Math.imul(g,ye)|0)+Math.imul(b,fe)|0))<<13)|0;u=((s=s+Math.imul(b,ye)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(z,J),i=(i=Math.imul(z,Q))+Math.imul(R,J)|0,s=Math.imul(R,Q),r=r+Math.imul(L,$)|0,i=(i=i+Math.imul(L,ee)|0)+Math.imul(U,$)|0,s=s+Math.imul(U,ee)|0,r=r+Math.imul(H,ne)|0,i=(i=i+Math.imul(H,re)|0)+Math.imul(O,ne)|0,s=s+Math.imul(O,re)|0,r=r+Math.imul(N,se)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(E,se)|0,s=s+Math.imul(E,ae)|0,r=r+Math.imul(M,ce)|0,i=(i=i+Math.imul(M,ue)|0)+Math.imul(A,ce)|0,s=s+Math.imul(A,ue)|0,r=r+Math.imul(P,he)|0,i=(i=i+Math.imul(P,de)|0)+Math.imul(T,he)|0,s=s+Math.imul(T,de)|0;var Ve=(u+(r=r+Math.imul(w,fe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(x,fe)|0))<<13)|0;u=((s=s+Math.imul(x,ye)|0)+(i>>>13)|0)+(Ve>>>26)|0,Ve&=67108863,r=Math.imul(z,$),i=(i=Math.imul(z,ee))+Math.imul(R,$)|0,s=Math.imul(R,ee),r=r+Math.imul(L,ne)|0,i=(i=i+Math.imul(L,re)|0)+Math.imul(U,ne)|0,s=s+Math.imul(U,re)|0,r=r+Math.imul(H,se)|0,i=(i=i+Math.imul(H,ae)|0)+Math.imul(O,se)|0,s=s+Math.imul(O,ae)|0,r=r+Math.imul(N,ce)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(E,ce)|0,s=s+Math.imul(E,ue)|0,r=r+Math.imul(M,he)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(A,he)|0,s=s+Math.imul(A,de)|0;var Ne=(u+(r=r+Math.imul(P,fe)|0)|0)+((8191&(i=(i=i+Math.imul(P,ye)|0)+Math.imul(T,fe)|0))<<13)|0;u=((s=s+Math.imul(T,ye)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(z,ne),i=(i=Math.imul(z,re))+Math.imul(R,ne)|0,s=Math.imul(R,re),r=r+Math.imul(L,se)|0,i=(i=i+Math.imul(L,ae)|0)+Math.imul(U,se)|0,s=s+Math.imul(U,ae)|0,r=r+Math.imul(H,ce)|0,i=(i=i+Math.imul(H,ue)|0)+Math.imul(O,ce)|0,s=s+Math.imul(O,ue)|0,r=r+Math.imul(N,he)|0,i=(i=i+Math.imul(N,de)|0)+Math.imul(E,he)|0,s=s+Math.imul(E,de)|0;var Ee=(u+(r=r+Math.imul(M,fe)|0)|0)+((8191&(i=(i=i+Math.imul(M,ye)|0)+Math.imul(A,fe)|0))<<13)|0;u=((s=s+Math.imul(A,ye)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(z,se),i=(i=Math.imul(z,ae))+Math.imul(R,se)|0,s=Math.imul(R,ae),r=r+Math.imul(L,ce)|0,i=(i=i+Math.imul(L,ue)|0)+Math.imul(U,ce)|0,s=s+Math.imul(U,ue)|0,r=r+Math.imul(H,he)|0,i=(i=i+Math.imul(H,de)|0)+Math.imul(O,he)|0,s=s+Math.imul(O,de)|0;var Ie=(u+(r=r+Math.imul(N,fe)|0)|0)+((8191&(i=(i=i+Math.imul(N,ye)|0)+Math.imul(E,fe)|0))<<13)|0;u=((s=s+Math.imul(E,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(z,ce),i=(i=Math.imul(z,ue))+Math.imul(R,ce)|0,s=Math.imul(R,ue),r=r+Math.imul(L,he)|0,i=(i=i+Math.imul(L,de)|0)+Math.imul(U,he)|0,s=s+Math.imul(U,de)|0;var He=(u+(r=r+Math.imul(H,fe)|0)|0)+((8191&(i=(i=i+Math.imul(H,ye)|0)+Math.imul(O,fe)|0))<<13)|0;u=((s=s+Math.imul(O,ye)|0)+(i>>>13)|0)+(He>>>26)|0,He&=67108863,r=Math.imul(z,he),i=(i=Math.imul(z,de))+Math.imul(R,he)|0,s=Math.imul(R,de);var Oe=(u+(r=r+Math.imul(L,fe)|0)|0)+((8191&(i=(i=i+Math.imul(L,ye)|0)+Math.imul(U,fe)|0))<<13)|0;u=((s=s+Math.imul(U,ye)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var Ce=(u+(r=Math.imul(z,fe))|0)+((8191&(i=(i=Math.imul(z,ye))+Math.imul(R,fe)|0))<<13)|0;return u=((s=Math.imul(R,ye))+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c[0]=me,c[1]=ge,c[2]=be,c[3]=ve,c[4]=we,c[5]=xe,c[6]=Se,c[7]=Pe,c[8]=Te,c[9]=ke,c[10]=Me,c[11]=Ae,c[12]=Ve,c[13]=Ne,c[14]=Ee,c[15]=Ie,c[16]=He,c[17]=Oe,c[18]=Ce,0!==u&&(c[19]=u,n.length++),n};function g(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,s=0;s>>26)|0)>>>26,a&=67108863}n.words[s]=o,r=a,a=i}return 0!==r?n.words[s]=r:n.length--,n._strip()}function b(e,t,n){return g(e,t,n)}function v(e,t){this.x=e,this.y=t}Math.imul||(m=y),s.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):n<63?y(this,e,t):n<1024?g(this,e,t):b(this,e,t)},v.prototype.makeRBT=function(e){for(var t=new Array(e),n=s.prototype._countBits(e)-1,r=0;r>=1;return r},v.prototype.permute=function(e,t,n,r,i,s){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&s,s>>>=13;for(a=2*t;a>=26,n+=s/67108864|0,n+=a>>>26,this.words[i]=67108863&a}return 0!==n&&(this.words[i]=n,this.length++),t?this.ineg():this},s.prototype.muln=function(e){return this.clone().imuln(e)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(0===t.length)return new s(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,s=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var s=e%26,a=Math.min((e-s)/26,this.length),o=67108863^67108863>>>s<a)for(this.length-=a,u=0;u=0&&(0!==l||u>=i);u--){var h=0|this.words[u];this.words[u]=l<<26-s|h>>>s,l=h&o}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},s.prototype.shln=function(e){return this.clone().ishln(e)},s.prototype.ushln=function(e){return this.clone().iushln(e)},s.prototype.shrn=function(e){return this.clone().ishrn(e)},s.prototype.ushrn=function(e){return this.clone().iushrn(e)},s.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},s.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&s}for(;i>26,this.words[i+n]=67108863&s;if(0===o)return this._strip();for(r(-1===o),o=0,i=0;i>26,this.words[i]=67108863&s;return this.negative=1,this._strip()},s.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,a=0|i.words[i.length-1];0!=(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var o,c=r.length-i.length;if("mod"!==t){(o=new s(null)).length=c+1,o.words=new Array(o.length);for(var u=0;u=0;h--){var d=67108864*(0|r.words[i.length+h])+(0|r.words[i.length+h-1]);for(d=Math.min(d/a|0,67108863),r._ishlnsubmul(i,d,h);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(i,1,h),r.isZero()||(r.negative^=1);o&&(o.words[h]=d)}return o&&o._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:o||null,mod:r}},s.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(i=o.div.neg()),"div"!==t&&(a=o.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(i=o.div.neg()),{div:i,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(a=o.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:o.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new s(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new s(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new s(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,a,o},s.prototype.div=function(e){return this.divmod(e,"div",!1).div},s.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},s.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},s.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),s=n.cmp(r);return s<0||1===i&&0===s?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},s.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,i=0,s=this.length-1;s>=0;s--)i=(n*i+(0|this.words[s]))%e;return t?-i:i},s.prototype.modn=function(e){return this.modrn(e)},s.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var s=(0|this.words[i])+67108864*n;this.words[i]=s/e|0,n=s%e}return this._strip(),t?this.ineg():this},s.prototype.divn=function(e){return this.clone().idivn(e)},s.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new s(1),a=new s(0),o=new s(0),c=new s(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var l=n.clone(),h=t.clone();!t.isZero();){for(var d=0,p=1;0==(t.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(l),a.isub(h)),i.iushrn(1),a.iushrn(1);for(var f=0,y=1;0==(n.words[0]&y)&&f<26;++f,y<<=1);if(f>0)for(n.iushrn(f);f-- >0;)(o.isOdd()||c.isOdd())&&(o.iadd(l),c.isub(h)),o.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(o),a.isub(c)):(n.isub(t),o.isub(i),c.isub(a))}return{a:o,b:c,gcd:n.iushln(u)}},s.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new s(1),o=new s(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,l=1;0==(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var h=0,d=1;0==(n.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(n.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(o)):(n.isub(t),o.isub(a))}return(i=0===t.cmpn(1)?a:o).cmpn(0)<0&&i.iadd(e),i},s.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var s=t;t=n,n=s}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},s.prototype.invm=function(e){return this.egcd(e).a.umod(e)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(e){return this.words[0]&e},s.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,o&=67108863,this.words[a]=o}return 0!==s&&(this.words[a]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},s.prototype.gtn=function(e){return 1===this.cmpn(e)},s.prototype.gt=function(e){return 1===this.cmp(e)},s.prototype.gten=function(e){return this.cmpn(e)>=0},s.prototype.gte=function(e){return this.cmp(e)>=0},s.prototype.ltn=function(e){return-1===this.cmpn(e)},s.prototype.lt=function(e){return-1===this.cmp(e)},s.prototype.lten=function(e){return this.cmpn(e)<=0},s.prototype.lte=function(e){return this.cmp(e)<=0},s.prototype.eqn=function(e){return 0===this.cmpn(e)},s.prototype.eq=function(e){return 0===this.cmp(e)},s.red=function(e){return new M(e)},s.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},s.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(e){return this.red=e,this},s.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},s.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},s.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},s.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},s.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},s.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},s.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},s.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},s.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function x(e,t){this.name=e,this.p=new s(t,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function S(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function T(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=s._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){M.call(this,e),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)}x.prototype._tmp=function(){var e=new s(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},x.prototype.split=function(e,t){e.iushrn(this.n,0,t)},x.prototype.imulK=function(e){return e.imul(this.k)},i(S,x),S.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,s=a}s>>>=22,e.words[i-10]=s,0===s&&e.length>10?e.length-=10:e.length-=9},S.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},s._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new S;else if("p224"===e)t=new P;else if("p192"===e)t=new T;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new k}return w[e]=t,t},M.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},M.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new s(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);r(!i.isZero());var o=new s(1).toRed(this),c=o.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var h=this.pow(l,i),d=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),f=a;0!==p.cmp(o);){for(var y=p,m=0;0!==y.cmp(o);m++)y=y.redSqr();r(m=0;r--){for(var u=t.words[r],l=c-1;l>=0;l--){var h=u>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==h||0!==a?(a<<=1,a|=h,(4==++o||0===r&&0===l)&&(i=this.mul(i,n[a]),o=0,a=0)):o=0}c=26}return i},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},s.mont=function(e){return new A(e)},i(A,M),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},A.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},A.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new s(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},A.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=n.nmd(e),this)},822:(e,t)=>{"use strict";function n(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function r(...e){const t=(e,t)=>n=>e(t(n));return{encode:Array.from(e).reverse().reduce(((e,n)=>e?t(e,n.encode):n.encode),void 0),decode:e.reduce(((e,n)=>e?t(e,n.decode):n.decode),void 0)}}function i(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("alphabet.encode input should be an array of numbers");return t.map((t=>{if(n(t),t<0||t>=e.length)throw new Error(`Digit index outside alphabet: ${t} (alphabet: ${e.length})`);return e[t]}))},decode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("alphabet.decode input should be array of strings");return t.map((t=>{if("string"!=typeof t)throw new Error(`alphabet.decode: not string element=${t}`);const n=e.indexOf(t);if(-1===n)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return n}))}}}function s(e=""){if("string"!=typeof e)throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("join.encode input should be array of strings");for(let e of t)if("string"!=typeof e)throw new Error(`join.encode: non-string input=${e}`);return t.join(e)},decode:t=>{if("string"!=typeof t)throw new Error("join.decode input should be string");return t.split(e)}}}function a(e,t="="){if(n(e),"string"!=typeof t)throw new Error("padding chr should be string");return{encode(n){if(!Array.isArray(n)||n.length&&"string"!=typeof n[0])throw new Error("padding.encode input should be array of strings");for(let e of n)if("string"!=typeof e)throw new Error(`padding.encode: non-string input=${e}`);for(;n.length*e%8;)n.push(t);return n},decode(n){if(!Array.isArray(n)||n.length&&"string"!=typeof n[0])throw new Error("padding.encode input should be array of strings");for(let e of n)if("string"!=typeof e)throw new Error(`padding.decode: non-string input=${e}`);let r=n.length;if(r*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;r>0&&n[r-1]===t;r--)if(!((r-1)*e%8))throw new Error("Invalid padding: string has too much padding");return n.slice(0,r)}}}function o(e){if("function"!=typeof e)throw new Error("normalize fn should be function");return{encode:e=>e,decode:t=>e(t)}}function c(e,t,r){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: wrong to=${r}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let i=0;const s=[],a=Array.from(e);for(a.forEach((e=>{if(n(e),e<0||e>=t)throw new Error(`Wrong integer: ${e}`)}));;){let e=0,n=!0;for(let s=i;st?u(t,e%t):e,l=(e,t)=>e+(t-u(e,t));function h(e,t,r,i){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(r<=0||r>32)throw new Error(`convertRadix2: wrong to=${r}`);if(l(t,r)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${l(t,r)}`);let s=0,a=0;const o=2**r-1,c=[];for(const i of e){if(n(i),i>=2**t)throw new Error(`convertRadix2: invalid data word=${i} from=${t}`);if(s=s<32)throw new Error(`convertRadix2: carry overflow pos=${a} from=${t}`);for(a+=t;a>=r;a-=r)c.push((s>>a-r&o)>>>0);s&=2**a-1}if(s=s<=t)throw new Error("Excess padding");if(!i&&s)throw new Error(`Non-zero padding: ${s}`);return i&&a>0&&c.push(s>>>0),c}function d(e,t=!1){if(n(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(l(8,e)>32||l(e,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!(n instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return h(Array.from(n),8,e,!t)},decode:n=>{if(!Array.isArray(n)||n.length&&"number"!=typeof n[0])throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(h(n,e,8,t))}}}function p(e){if("function"!=typeof e)throw new Error("unsafeWrapper fn should be function");return function(...t){try{return e.apply(null,t)}catch(e){}}}t.YU=r(d(4),i("0123456789ABCDEF"),s("")),t.pJ=r(d(5),i("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),a(5),s("")),r(d(5),i("0123456789ABCDEFGHIJKLMNOPQRSTUV"),a(5),s("")),r(d(5),i("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),s(""),o((e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")))),t.US=r(d(6),i("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),a(6),s("")),t.tH=r(d(6),i("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),a(6),s(""));const f=e=>{return r((n(t=58),{encode:e=>{if(!(e instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return c(Array.from(e),256,t)},decode:e=>{if(!Array.isArray(e)||e.length&&"number"!=typeof e[0])throw new Error("radix.decode input should be array of strings");return Uint8Array.from(c(e,t,256))}}),i(e),s(""));var t};t.Jq=f("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),f("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),f("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const y=[0,2,3,5,6,7,9,10,11];t.S_={encode(e){let n="";for(let r=0;r>25;let n=(33554431&e)<<5;for(let e=0;e>e&1)&&(n^=g[e]);return n}function v(e,t,n=1){const r=e.length;let i=1;for(let t=0;t126)throw new Error(`Invalid prefix (${e})`);i=b(i)^n>>5}i=b(i);for(let t=0;tn)throw new TypeError(`Wrong string length: ${e.length} (${e}). Expected (8..${n})`);const r=e.toLowerCase();if(e!==r&&e!==e.toUpperCase())throw new Error("String must be lowercase or uppercase");const i=(e=r).lastIndexOf("1");if(0===i||-1===i)throw new Error('Letter "1" must be present between prefix and data only');const[s,a]=[e.slice(0,i),e.slice(i+1)];if(a.length<6)throw new Error("Data must be at least 6 characters long");const o=m.decode(a).slice(0,-6),c=v(s,o,t);if(!a.endsWith(c))throw new Error(`Invalid checksum in ${e}: expected "${c}"`);return{prefix:s,words:o}}return{encode:function(e,n,r=90){if("string"!=typeof e)throw new Error("bech32.encode prefix should be string, not "+typeof e);if(!Array.isArray(n)||n.length&&"number"!=typeof n[0])throw new Error("bech32.encode words should be array of numbers, not "+typeof n);const i=e.length+7+n.length;if(!1!==r&&i>r)throw new TypeError(`Length ${i} exceeds limit ${r}`);return`${e=e.toLowerCase()}1${m.encode(n)}${v(e,n,t)}`},decode:a,decodeToBytes:function(e){const{prefix:t,words:n}=a(e,!1);return{prefix:t,words:n,bytes:r(n)}},decodeUnsafe:p(a),fromWords:r,fromWordsUnsafe:s,toWords:i}}w("bech32"),w("bech32m"),t.KA={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)},t.$v=r(d(4),i("0123456789abcdef"),s(""),o((e=>{if("string"!=typeof e||e.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()})));const x={utf8:t.KA,hex:t.$v,base16:t.YU,base32:t.pJ,base64:t.US,base64url:t.tH,base58:t.Jq,base58xmr:t.S_},S=`Invalid encoding type. Available types: ${Object.keys(x).join(", ")}`;t.d3=(e,t)=>{if("string"!=typeof e||!x.hasOwnProperty(e))throw new TypeError(S);if(!(t instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return x[e].encode(t)},t.d3,t.qX=(e,t)=>{if(!x.hasOwnProperty(e))throw new TypeError(S);if("string"!=typeof t)throw new TypeError("stringToBytes() expects string");return x[e].decode(t)},t.qX},766:(e,t)=>{"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,s=c(e),a=s[0],o=s[1],u=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,o)),l=0,h=o>0?a-4:a;for(n=0;n>16&255,u[l++]=t>>8&255,u[l++]=255&t;return 2===o&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,u[l++]=255&t),1===o&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t),u},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,s=[],a=16383,o=0,c=r-i;oc?c:o+a));return 1===i?(t=e[r-1],s.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],s.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),s.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,o=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,r){for(var i,s,a=[],o=t;o>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},834:(e,t,n)=>{"use strict";const r=n(766),i=n(333),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=function(e){return+e!=e&&(e=0),c.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function o(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return u(e,t,n)}function u(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|y(e,t);let r=o(n);const i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Y(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Y(e,ArrayBuffer)||e&&Y(e.buffer,ArrayBuffer))return p(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(Y(e,SharedArrayBuffer)||e&&Y(e.buffer,SharedArrayBuffer)))return p(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return c.from(r,t,n);const i=function(e){if(c.isBuffer(e)){const t=0|f(e.length),n=o(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||J(e.length)?o(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return l(e),o(e<0?0:0|f(e))}function d(e){const t=e.length<0?0:0|f(e.length),n=o(t);for(let r=0;r=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function y(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Y(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return Z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return K(e).length;default:if(i)return r?-1:Z(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return E(this,t,n);case"utf8":case"utf-8":return M(this,t,n);case"ascii":return V(this,t,n);case"latin1":case"binary":return N(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),J(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,i){let s,a=1,o=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,o/=2,c/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let r=-1;for(s=n;so&&(n=o-c),s=n;s>=0;s--){let n=!0;for(let r=0;ri&&(r=i):r=i;const s=t.length;let a;for(r>s/2&&(r=s/2),a=0;a>8,i=n%256,s.push(i),s.push(r);return s}(t,e.length-n),e,n,r)}function k(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function M(e,t,n){n=Math.min(e.length,n);const r=[];let i=t;for(;i239?4:t>223?3:t>191?2:1;if(i+a<=n){let n,r,o,c;switch(a){case 1:t<128&&(s=t);break;case 2:n=e[i+1],128==(192&n)&&(c=(31&t)<<6|63&n,c>127&&(s=c));break;case 3:n=e[i+1],r=e[i+2],128==(192&n)&&128==(192&r)&&(c=(15&t)<<12|(63&n)<<6|63&r,c>2047&&(c<55296||c>57343)&&(s=c));break;case 4:n=e[i+1],r=e[i+2],o=e[i+3],128==(192&n)&&128==(192&r)&&128==(192&o)&&(c=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&o,c>65535&&c<1114112&&(s=c))}}null===s?(s=65533,a=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),i+=a}return function(e){const t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);let n="",r=0;for(;rr.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,i)}i+=t.length}return r},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tn&&(e+=" ... "),""},s&&(c.prototype[s]=c.prototype.inspect),c.prototype.compare=function(e,t,n,r,i){if(Y(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;let s=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0);const o=Math.min(s,a),u=this.slice(r,i),l=e.slice(t,n);for(let e=0;e>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let s=!1;for(;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return x(this,e,t,n);case"ascii":case"latin1":case"binary":return S(this,e,t,n);case"base64":return P(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const A=4096;function V(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;ir)&&(n=r);let i="";for(let r=t;rn)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,n,r,i,s){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function C(e,t,n,r,i){X(t,r,i,e,n,7);let s=Number(t&BigInt(4294967295));e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function L(e,t,n,r,i){X(t,r,i,e,n,7);let s=Number(t&BigInt(4294967295));e[n+7]=s,s>>=8,e[n+6]=s,s>>=8,e[n+5]=s,s>>=8,e[n+4]=s;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function U(e,t,n,r,i,s){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function B(e,t,n,r,s){return t=+t,n>>>=0,s||U(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function z(e,t,n,r,s){return t=+t,n>>>=0,s||U(e,0,n,8),i.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||H(e,t,this.length);let r=this[e],i=1,s=0;for(;++s>>=0,t>>>=0,n||H(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||H(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||H(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||H(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||H(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||H(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=_((function(e){F(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||q(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(i)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||q(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<>>=0,t>>>=0,n||H(e,t,this.length);let r=this[e],i=1,s=0;for(;++s=i&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||H(e,t,this.length);let r=t,i=1,s=this[e+--r];for(;r>0&&(i*=256);)s+=this[e+--r]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*t)),s},c.prototype.readInt8=function(e,t){return e>>>=0,t||H(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||H(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){e>>>=0,t||H(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||H(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||H(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=_((function(e){F(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||q(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||q(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<>>=0,t||H(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||H(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||H(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||H(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||O(this,e,t,n,Math.pow(2,8*n)-1,0);let i=1,s=0;for(this[t]=255&e;++s>>=0,n>>>=0,r||O(this,e,t,n,Math.pow(2,8*n)-1,0);let i=n-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=_((function(e,t=0){return C(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=_((function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);O(this,e,t,n,r-1,-r)}let i=0,s=1,a=0;for(this[t]=255&e;++i>0)-a&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);O(this,e,t,n,r-1,-r)}let i=n-1,s=1,a=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/s>>0)-a&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=_((function(e,t=0){return C(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=_((function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,n){return B(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return B(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return z(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return z(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function X(e,t,n,r,i,s){if(e>n||e3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(s+1)}${r}`:`>= -(2${r} ** ${8*(s+1)-1}${r}) and < 2 ** ${8*(s+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new R.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,n){F(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||q(t,e.length-(n+1))}(r,i,s)}function F(e,t){if("number"!=typeof e)throw new R.ERR_INVALID_ARG_TYPE(t,"number",e)}function q(e,t,n){if(Math.floor(e)!==e)throw F(e,n),new R.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new R.ERR_BUFFER_OUT_OF_BOUNDS;throw new R.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}j("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),j("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),j("ERR_OUT_OF_RANGE",(function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=D(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=D(i)),i+="n"),r+=` It must be ${t}. Received ${i}`,r}),RangeError);const W=/[^+/0-9A-Za-z-_]/g;function Z(e,t){let n;t=t||1/0;const r=e.length;let i=null;const s=[];for(let a=0;a55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&s.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function K(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,n,r){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Y(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const Q=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function _(e){return"undefined"==typeof BigInt?$:e}function $(){throw new Error("BigInt not supported")}},559:function(e,t,n){!function(t,r){"use strict";e.exports?e.exports=r(n(873)):t.ed2curve=r(t.nacl)}(this,(function(e){"use strict";if(!e)throw new Error("tweetnacl not loaded");var t=function(e){var t,n=new Float64Array(16);if(e)for(t=0;t>16&1),c[r-1]&=65535;c[15]=u[15]-32767-(c[14]>>16&1),s=c[15]>>16&1,c[14]&=65535,o(u,c,1-s)}for(r=0;r<16;r++)e[2*r]=255&u[r],e[2*r+1]=u[r]>>8}function p(e,t){var n=new Uint8Array(32),r=new Uint8Array(32);return d(n,e),d(r,t),function(e,t,n,r,i){var s,a=0;for(s=0;s<32;s++)a|=e[0+s]^n[0+s];return(1&a-1>>>8)-1}(n,0,r)}function f(e){var a=new Uint8Array(32),o=[t(),t(),t(),t()],f=t(),y=t();if(function(e,a){var o,f,y=t(),m=t(),g=t(),b=t(),v=t(),w=t(),x=t();return function(e,t){var n;for(n=0;n<16;n++)e[n]=0|t[n]}(e[2],r),function(e,t){var n;for(n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}(e[1],a),h(g,e[1]),l(b,g,i),u(g,g,e[2]),c(b,e[2],b),h(v,b),h(w,v),l(x,w,v),l(y,x,g),l(y,y,b),function(e,n){var r,i=t();for(r=0;r<16;r++)i[r]=n[r];for(r=250;r>=0;r--)h(i,i),1!==r&&l(i,i,n);for(r=0;r<16;r++)e[r]=i[r]}(y,y),l(y,y,g),l(y,y,b),l(y,y,b),l(e[0],y,b),h(m,e[0]),l(m,m,b),p(m,g)&&l(e[0],e[0],s),h(m,e[0]),l(m,m,b),p(m,g)?-1:(o=e[0],d(f=new Uint8Array(32),o),(1&f[0])==a[31]>>7&&u(e[0],n,e[0]),l(e[3],e[0],e[1]),0)}(o,e))return null;var m=o[1];return c(f,r,m),u(y,r,m),function(e,n){var r,i=t();for(r=0;r<16;r++)i[r]=n[r];for(r=253;r>=0;r--)h(i,i),2!==r&&4!==r&&l(i,i,n);for(r=0;r<16;r++)e[r]=i[r]}(y,y),l(f,f,y),d(a,f),a}function y(t){var n,r=new Uint8Array(64),i=new Uint8Array(32);for(e.lowlevel.crypto_hash(r,t,32),r[0]&=248,r[31]&=127,r[31]|=64,n=0;n<32;n++)i[n]=r[n];for(n=0;n<64;n++)r[n]=0;return i}return{convertPublicKey:f,convertSecretKey:y,convertKeyPair:function(e){var t=f(e.publicKey);return t?{publicKey:t,secretKey:y(e.secretKey)}:null}}}))},873:(e,t,n)=>{!function(e){"use strict";var t=function(e){var t,n=new Float64Array(16);if(e)for(t=0;t>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n,e[t+4]=r>>24&255,e[t+5]=r>>16&255,e[t+6]=r>>8&255,e[t+7]=255&r}function y(e,t,n,r,i){var s,a=0;for(s=0;s>>8)-1}function m(e,t,n,r){return y(e,t,n,r,16)}function g(e,t,n,r){return y(e,t,n,r,32)}function b(e,t,n,r){!function(e,t,n,r){for(var i,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,o=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,c=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,u=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,l=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,h=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,p=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,f=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,y=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,m=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,g=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,v=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,w=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,x=s,S=a,P=o,T=c,k=u,M=l,A=h,V=d,N=p,E=f,I=y,H=m,O=g,C=b,L=v,U=w,B=0;B<20;B+=2)x^=(i=(O^=(i=(N^=(i=(k^=(i=x+O|0)<<7|i>>>25)+x|0)<<9|i>>>23)+k|0)<<13|i>>>19)+N|0)<<18|i>>>14,M^=(i=(S^=(i=(C^=(i=(E^=(i=M+S|0)<<7|i>>>25)+M|0)<<9|i>>>23)+E|0)<<13|i>>>19)+C|0)<<18|i>>>14,I^=(i=(A^=(i=(P^=(i=(L^=(i=I+A|0)<<7|i>>>25)+I|0)<<9|i>>>23)+L|0)<<13|i>>>19)+P|0)<<18|i>>>14,U^=(i=(H^=(i=(V^=(i=(T^=(i=U+H|0)<<7|i>>>25)+U|0)<<9|i>>>23)+T|0)<<13|i>>>19)+V|0)<<18|i>>>14,x^=(i=(T^=(i=(P^=(i=(S^=(i=x+T|0)<<7|i>>>25)+x|0)<<9|i>>>23)+S|0)<<13|i>>>19)+P|0)<<18|i>>>14,M^=(i=(k^=(i=(V^=(i=(A^=(i=M+k|0)<<7|i>>>25)+M|0)<<9|i>>>23)+A|0)<<13|i>>>19)+V|0)<<18|i>>>14,I^=(i=(E^=(i=(N^=(i=(H^=(i=I+E|0)<<7|i>>>25)+I|0)<<9|i>>>23)+H|0)<<13|i>>>19)+N|0)<<18|i>>>14,U^=(i=(L^=(i=(C^=(i=(O^=(i=U+L|0)<<7|i>>>25)+U|0)<<9|i>>>23)+O|0)<<13|i>>>19)+C|0)<<18|i>>>14;x=x+s|0,S=S+a|0,P=P+o|0,T=T+c|0,k=k+u|0,M=M+l|0,A=A+h|0,V=V+d|0,N=N+p|0,E=E+f|0,I=I+y|0,H=H+m|0,O=O+g|0,C=C+b|0,L=L+v|0,U=U+w|0,e[0]=x>>>0&255,e[1]=x>>>8&255,e[2]=x>>>16&255,e[3]=x>>>24&255,e[4]=S>>>0&255,e[5]=S>>>8&255,e[6]=S>>>16&255,e[7]=S>>>24&255,e[8]=P>>>0&255,e[9]=P>>>8&255,e[10]=P>>>16&255,e[11]=P>>>24&255,e[12]=T>>>0&255,e[13]=T>>>8&255,e[14]=T>>>16&255,e[15]=T>>>24&255,e[16]=k>>>0&255,e[17]=k>>>8&255,e[18]=k>>>16&255,e[19]=k>>>24&255,e[20]=M>>>0&255,e[21]=M>>>8&255,e[22]=M>>>16&255,e[23]=M>>>24&255,e[24]=A>>>0&255,e[25]=A>>>8&255,e[26]=A>>>16&255,e[27]=A>>>24&255,e[28]=V>>>0&255,e[29]=V>>>8&255,e[30]=V>>>16&255,e[31]=V>>>24&255,e[32]=N>>>0&255,e[33]=N>>>8&255,e[34]=N>>>16&255,e[35]=N>>>24&255,e[36]=E>>>0&255,e[37]=E>>>8&255,e[38]=E>>>16&255,e[39]=E>>>24&255,e[40]=I>>>0&255,e[41]=I>>>8&255,e[42]=I>>>16&255,e[43]=I>>>24&255,e[44]=H>>>0&255,e[45]=H>>>8&255,e[46]=H>>>16&255,e[47]=H>>>24&255,e[48]=O>>>0&255,e[49]=O>>>8&255,e[50]=O>>>16&255,e[51]=O>>>24&255,e[52]=C>>>0&255,e[53]=C>>>8&255,e[54]=C>>>16&255,e[55]=C>>>24&255,e[56]=L>>>0&255,e[57]=L>>>8&255,e[58]=L>>>16&255,e[59]=L>>>24&255,e[60]=U>>>0&255,e[61]=U>>>8&255,e[62]=U>>>16&255,e[63]=U>>>24&255}(e,t,n,r)}function v(e,t,n,r){!function(e,t,n,r){for(var i,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,o=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,c=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,u=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,l=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,h=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,p=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,f=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,y=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,m=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,g=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,v=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,w=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,x=0;x<20;x+=2)s^=(i=(g^=(i=(p^=(i=(u^=(i=s+g|0)<<7|i>>>25)+s|0)<<9|i>>>23)+u|0)<<13|i>>>19)+p|0)<<18|i>>>14,l^=(i=(a^=(i=(b^=(i=(f^=(i=l+a|0)<<7|i>>>25)+l|0)<<9|i>>>23)+f|0)<<13|i>>>19)+b|0)<<18|i>>>14,y^=(i=(h^=(i=(o^=(i=(v^=(i=y+h|0)<<7|i>>>25)+y|0)<<9|i>>>23)+v|0)<<13|i>>>19)+o|0)<<18|i>>>14,w^=(i=(m^=(i=(d^=(i=(c^=(i=w+m|0)<<7|i>>>25)+w|0)<<9|i>>>23)+c|0)<<13|i>>>19)+d|0)<<18|i>>>14,s^=(i=(c^=(i=(o^=(i=(a^=(i=s+c|0)<<7|i>>>25)+s|0)<<9|i>>>23)+a|0)<<13|i>>>19)+o|0)<<18|i>>>14,l^=(i=(u^=(i=(d^=(i=(h^=(i=l+u|0)<<7|i>>>25)+l|0)<<9|i>>>23)+h|0)<<13|i>>>19)+d|0)<<18|i>>>14,y^=(i=(f^=(i=(p^=(i=(m^=(i=y+f|0)<<7|i>>>25)+y|0)<<9|i>>>23)+m|0)<<13|i>>>19)+p|0)<<18|i>>>14,w^=(i=(v^=(i=(b^=(i=(g^=(i=w+v|0)<<7|i>>>25)+w|0)<<9|i>>>23)+g|0)<<13|i>>>19)+b|0)<<18|i>>>14;e[0]=s>>>0&255,e[1]=s>>>8&255,e[2]=s>>>16&255,e[3]=s>>>24&255,e[4]=l>>>0&255,e[5]=l>>>8&255,e[6]=l>>>16&255,e[7]=l>>>24&255,e[8]=y>>>0&255,e[9]=y>>>8&255,e[10]=y>>>16&255,e[11]=y>>>24&255,e[12]=w>>>0&255,e[13]=w>>>8&255,e[14]=w>>>16&255,e[15]=w>>>24&255,e[16]=h>>>0&255,e[17]=h>>>8&255,e[18]=h>>>16&255,e[19]=h>>>24&255,e[20]=d>>>0&255,e[21]=d>>>8&255,e[22]=d>>>16&255,e[23]=d>>>24&255,e[24]=p>>>0&255,e[25]=p>>>8&255,e[26]=p>>>16&255,e[27]=p>>>24&255,e[28]=f>>>0&255,e[29]=f>>>8&255,e[30]=f>>>16&255,e[31]=f>>>24&255}(e,t,n,r)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function x(e,t,n,r,i,s,a){var o,c,u=new Uint8Array(16),l=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=s[c];for(;i>=64;){for(b(l,u,a,w),c=0;c<64;c++)e[t+c]=n[r+c]^l[c];for(o=1,c=8;c<16;c++)o=o+(255&u[c])|0,u[c]=255&o,o>>>=8;i-=64,t+=64,r+=64}if(i>0)for(b(l,u,a,w),c=0;c=64;){for(b(c,o,i,w),a=0;a<64;a++)e[t+a]=c[a];for(s=1,a=8;a<16;a++)s=s+(255&o[a])|0,o[a]=255&s,s>>>=8;n-=64,t+=64}if(n>0)for(b(c,o,i,w),a=0;a>>13|n<<3),r=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(n>>>10|r<<6),i=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(r>>>7|i<<9),s=255&e[8]|(255&e[9])<<8,this.r[4]=255&(i>>>4|s<<12),this.r[5]=s>>>1&8190,a=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(s>>>14|a<<2),o=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(a>>>11|o<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(o>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function M(e,t,n,r,i,s){var a=new k(s);return a.update(n,r,i),a.finish(e,t),0}function A(e,t,n,r,i,s){var a=new Uint8Array(16);return M(a,0,n,r,i,s),m(e,t,a,0)}function V(e,t,n,r,i){var s;if(n<32)return-1;for(T(e,0,t,0,n,r,i),M(e,16,e,32,n-32,e),s=0;s<16;s++)e[s]=0;return 0}function N(e,t,n,r,i){var s,a=new Uint8Array(32);if(n<32)return-1;if(P(a,0,32,r,i),0!==A(t,16,t,32,n-32,a))return-1;for(T(e,0,t,0,n,r,i),s=0;s<32;s++)e[s]=0;return 0}function E(e,t){var n;for(n=0;n<16;n++)e[n]=0|t[n]}function I(e){var t,n,r=1;for(t=0;t<16;t++)n=e[t]+r+65535,r=Math.floor(n/65536),e[t]=n-65536*r;e[0]+=r-1+37*(r-1)}function H(e,t,n){for(var r,i=~(n-1),s=0;s<16;s++)r=i&(e[s]^t[s]),e[s]^=r,t[s]^=r}function O(e,n){var r,i,s,a=t(),o=t();for(r=0;r<16;r++)o[r]=n[r];for(I(o),I(o),I(o),i=0;i<2;i++){for(a[0]=o[0]-65517,r=1;r<15;r++)a[r]=o[r]-65535-(a[r-1]>>16&1),a[r-1]&=65535;a[15]=o[15]-32767-(a[14]>>16&1),s=a[15]>>16&1,a[14]&=65535,H(o,a,1-s)}for(r=0;r<16;r++)e[2*r]=255&o[r],e[2*r+1]=o[r]>>8}function C(e,t){var n=new Uint8Array(32),r=new Uint8Array(32);return O(n,e),O(r,t),g(n,0,r,0)}function L(e){var t=new Uint8Array(32);return O(t,e),1&t[0]}function U(e,t){var n;for(n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function B(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]+n[r]}function z(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]-n[r]}function R(e,t,n){var r,i,s=0,a=0,o=0,c=0,u=0,l=0,h=0,d=0,p=0,f=0,y=0,m=0,g=0,b=0,v=0,w=0,x=0,S=0,P=0,T=0,k=0,M=0,A=0,V=0,N=0,E=0,I=0,H=0,O=0,C=0,L=0,U=n[0],B=n[1],z=n[2],R=n[3],j=n[4],D=n[5],X=n[6],F=n[7],q=n[8],W=n[9],Z=n[10],K=n[11],G=n[12],Y=n[13],J=n[14],Q=n[15];s+=(r=t[0])*U,a+=r*B,o+=r*z,c+=r*R,u+=r*j,l+=r*D,h+=r*X,d+=r*F,p+=r*q,f+=r*W,y+=r*Z,m+=r*K,g+=r*G,b+=r*Y,v+=r*J,w+=r*Q,a+=(r=t[1])*U,o+=r*B,c+=r*z,u+=r*R,l+=r*j,h+=r*D,d+=r*X,p+=r*F,f+=r*q,y+=r*W,m+=r*Z,g+=r*K,b+=r*G,v+=r*Y,w+=r*J,x+=r*Q,o+=(r=t[2])*U,c+=r*B,u+=r*z,l+=r*R,h+=r*j,d+=r*D,p+=r*X,f+=r*F,y+=r*q,m+=r*W,g+=r*Z,b+=r*K,v+=r*G,w+=r*Y,x+=r*J,S+=r*Q,c+=(r=t[3])*U,u+=r*B,l+=r*z,h+=r*R,d+=r*j,p+=r*D,f+=r*X,y+=r*F,m+=r*q,g+=r*W,b+=r*Z,v+=r*K,w+=r*G,x+=r*Y,S+=r*J,P+=r*Q,u+=(r=t[4])*U,l+=r*B,h+=r*z,d+=r*R,p+=r*j,f+=r*D,y+=r*X,m+=r*F,g+=r*q,b+=r*W,v+=r*Z,w+=r*K,x+=r*G,S+=r*Y,P+=r*J,T+=r*Q,l+=(r=t[5])*U,h+=r*B,d+=r*z,p+=r*R,f+=r*j,y+=r*D,m+=r*X,g+=r*F,b+=r*q,v+=r*W,w+=r*Z,x+=r*K,S+=r*G,P+=r*Y,T+=r*J,k+=r*Q,h+=(r=t[6])*U,d+=r*B,p+=r*z,f+=r*R,y+=r*j,m+=r*D,g+=r*X,b+=r*F,v+=r*q,w+=r*W,x+=r*Z,S+=r*K,P+=r*G,T+=r*Y,k+=r*J,M+=r*Q,d+=(r=t[7])*U,p+=r*B,f+=r*z,y+=r*R,m+=r*j,g+=r*D,b+=r*X,v+=r*F,w+=r*q,x+=r*W,S+=r*Z,P+=r*K,T+=r*G,k+=r*Y,M+=r*J,A+=r*Q,p+=(r=t[8])*U,f+=r*B,y+=r*z,m+=r*R,g+=r*j,b+=r*D,v+=r*X,w+=r*F,x+=r*q,S+=r*W,P+=r*Z,T+=r*K,k+=r*G,M+=r*Y,A+=r*J,V+=r*Q,f+=(r=t[9])*U,y+=r*B,m+=r*z,g+=r*R,b+=r*j,v+=r*D,w+=r*X,x+=r*F,S+=r*q,P+=r*W,T+=r*Z,k+=r*K,M+=r*G,A+=r*Y,V+=r*J,N+=r*Q,y+=(r=t[10])*U,m+=r*B,g+=r*z,b+=r*R,v+=r*j,w+=r*D,x+=r*X,S+=r*F,P+=r*q,T+=r*W,k+=r*Z,M+=r*K,A+=r*G,V+=r*Y,N+=r*J,E+=r*Q,m+=(r=t[11])*U,g+=r*B,b+=r*z,v+=r*R,w+=r*j,x+=r*D,S+=r*X,P+=r*F,T+=r*q,k+=r*W,M+=r*Z,A+=r*K,V+=r*G,N+=r*Y,E+=r*J,I+=r*Q,g+=(r=t[12])*U,b+=r*B,v+=r*z,w+=r*R,x+=r*j,S+=r*D,P+=r*X,T+=r*F,k+=r*q,M+=r*W,A+=r*Z,V+=r*K,N+=r*G,E+=r*Y,I+=r*J,H+=r*Q,b+=(r=t[13])*U,v+=r*B,w+=r*z,x+=r*R,S+=r*j,P+=r*D,T+=r*X,k+=r*F,M+=r*q,A+=r*W,V+=r*Z,N+=r*K,E+=r*G,I+=r*Y,H+=r*J,O+=r*Q,v+=(r=t[14])*U,w+=r*B,x+=r*z,S+=r*R,P+=r*j,T+=r*D,k+=r*X,M+=r*F,A+=r*q,V+=r*W,N+=r*Z,E+=r*K,I+=r*G,H+=r*Y,O+=r*J,C+=r*Q,w+=(r=t[15])*U,a+=38*(S+=r*z),o+=38*(P+=r*R),c+=38*(T+=r*j),u+=38*(k+=r*D),l+=38*(M+=r*X),h+=38*(A+=r*F),d+=38*(V+=r*q),p+=38*(N+=r*W),f+=38*(E+=r*Z),y+=38*(I+=r*K),m+=38*(H+=r*G),g+=38*(O+=r*Y),b+=38*(C+=r*J),v+=38*(L+=r*Q),s=(r=(s+=38*(x+=r*B))+(i=1)+65535)-65536*(i=Math.floor(r/65536)),a=(r=a+i+65535)-65536*(i=Math.floor(r/65536)),o=(r=o+i+65535)-65536*(i=Math.floor(r/65536)),c=(r=c+i+65535)-65536*(i=Math.floor(r/65536)),u=(r=u+i+65535)-65536*(i=Math.floor(r/65536)),l=(r=l+i+65535)-65536*(i=Math.floor(r/65536)),h=(r=h+i+65535)-65536*(i=Math.floor(r/65536)),d=(r=d+i+65535)-65536*(i=Math.floor(r/65536)),p=(r=p+i+65535)-65536*(i=Math.floor(r/65536)),f=(r=f+i+65535)-65536*(i=Math.floor(r/65536)),y=(r=y+i+65535)-65536*(i=Math.floor(r/65536)),m=(r=m+i+65535)-65536*(i=Math.floor(r/65536)),g=(r=g+i+65535)-65536*(i=Math.floor(r/65536)),b=(r=b+i+65535)-65536*(i=Math.floor(r/65536)),v=(r=v+i+65535)-65536*(i=Math.floor(r/65536)),w=(r=w+i+65535)-65536*(i=Math.floor(r/65536)),s=(r=(s+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(r/65536)),a=(r=a+i+65535)-65536*(i=Math.floor(r/65536)),o=(r=o+i+65535)-65536*(i=Math.floor(r/65536)),c=(r=c+i+65535)-65536*(i=Math.floor(r/65536)),u=(r=u+i+65535)-65536*(i=Math.floor(r/65536)),l=(r=l+i+65535)-65536*(i=Math.floor(r/65536)),h=(r=h+i+65535)-65536*(i=Math.floor(r/65536)),d=(r=d+i+65535)-65536*(i=Math.floor(r/65536)),p=(r=p+i+65535)-65536*(i=Math.floor(r/65536)),f=(r=f+i+65535)-65536*(i=Math.floor(r/65536)),y=(r=y+i+65535)-65536*(i=Math.floor(r/65536)),m=(r=m+i+65535)-65536*(i=Math.floor(r/65536)),g=(r=g+i+65535)-65536*(i=Math.floor(r/65536)),b=(r=b+i+65535)-65536*(i=Math.floor(r/65536)),v=(r=v+i+65535)-65536*(i=Math.floor(r/65536)),w=(r=w+i+65535)-65536*(i=Math.floor(r/65536)),s+=i-1+37*(i-1),e[0]=s,e[1]=a,e[2]=o,e[3]=c,e[4]=u,e[5]=l,e[6]=h,e[7]=d,e[8]=p,e[9]=f,e[10]=y,e[11]=m,e[12]=g,e[13]=b,e[14]=v,e[15]=w}function j(e,t){R(e,t,t)}function D(e,n){var r,i=t();for(r=0;r<16;r++)i[r]=n[r];for(r=253;r>=0;r--)j(i,i),2!==r&&4!==r&&R(i,i,n);for(r=0;r<16;r++)e[r]=i[r]}function X(e,n){var r,i=t();for(r=0;r<16;r++)i[r]=n[r];for(r=250;r>=0;r--)j(i,i),1!==r&&R(i,i,n);for(r=0;r<16;r++)e[r]=i[r]}function F(e,n,r){var i,s,a=new Uint8Array(32),o=new Float64Array(80),u=t(),l=t(),h=t(),d=t(),p=t(),f=t();for(s=0;s<31;s++)a[s]=n[s];for(a[31]=127&n[31]|64,a[0]&=248,U(o,r),s=0;s<16;s++)l[s]=o[s],d[s]=u[s]=h[s]=0;for(u[0]=d[0]=1,s=254;s>=0;--s)H(u,l,i=a[s>>>3]>>>(7&s)&1),H(h,d,i),B(p,u,h),z(u,u,h),B(h,l,d),z(l,l,d),j(d,p),j(f,u),R(u,h,u),R(h,l,p),B(p,u,h),z(u,u,h),j(l,u),z(h,d,f),R(u,h,c),B(u,u,d),R(h,h,u),R(u,d,f),R(d,l,o),j(l,p),H(u,l,i),H(h,d,i);for(s=0;s<16;s++)o[s+16]=u[s],o[s+32]=h[s],o[s+48]=l[s],o[s+64]=d[s];var y=o.subarray(32),m=o.subarray(16);return D(y,y),R(m,m,y),O(e,m),0}function q(e,t){return F(e,t,s)}function W(e,t){return r(t,32),q(e,t)}function Z(e,t,n){var r=new Uint8Array(32);return F(r,n,t),v(e,i,r,w)}k.prototype.blocks=function(e,t,n){for(var r,i,s,a,o,c,u,l,h,d,p,f,y,m,g,b,v,w,x,S=this.fin?0:2048,P=this.h[0],T=this.h[1],k=this.h[2],M=this.h[3],A=this.h[4],V=this.h[5],N=this.h[6],E=this.h[7],I=this.h[8],H=this.h[9],O=this.r[0],C=this.r[1],L=this.r[2],U=this.r[3],B=this.r[4],z=this.r[5],R=this.r[6],j=this.r[7],D=this.r[8],X=this.r[9];n>=16;)d=h=0,d+=(P+=8191&(r=255&e[t+0]|(255&e[t+1])<<8))*O,d+=(T+=8191&(r>>>13|(i=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*X),d+=(k+=8191&(i>>>10|(s=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*D),d+=(M+=8191&(s>>>7|(a=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*j),h=(d+=(A+=8191&(a>>>4|(o=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*R))>>>13,d&=8191,d+=(V+=o>>>1&8191)*(5*z),d+=(N+=8191&(o>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*B),d+=(E+=8191&(c>>>11|(u=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*U),d+=(I+=8191&(u>>>8|(l=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*L),p=h+=(d+=(H+=l>>>5|S)*(5*C))>>>13,p+=P*C,p+=T*O,p+=k*(5*X),p+=M*(5*D),h=(p+=A*(5*j))>>>13,p&=8191,p+=V*(5*R),p+=N*(5*z),p+=E*(5*B),p+=I*(5*U),h+=(p+=H*(5*L))>>>13,p&=8191,f=h,f+=P*L,f+=T*C,f+=k*O,f+=M*(5*X),h=(f+=A*(5*D))>>>13,f&=8191,f+=V*(5*j),f+=N*(5*R),f+=E*(5*z),f+=I*(5*B),y=h+=(f+=H*(5*U))>>>13,y+=P*U,y+=T*L,y+=k*C,y+=M*O,h=(y+=A*(5*X))>>>13,y&=8191,y+=V*(5*D),y+=N*(5*j),y+=E*(5*R),y+=I*(5*z),m=h+=(y+=H*(5*B))>>>13,m+=P*B,m+=T*U,m+=k*L,m+=M*C,h=(m+=A*O)>>>13,m&=8191,m+=V*(5*X),m+=N*(5*D),m+=E*(5*j),m+=I*(5*R),g=h+=(m+=H*(5*z))>>>13,g+=P*z,g+=T*B,g+=k*U,g+=M*L,h=(g+=A*C)>>>13,g&=8191,g+=V*O,g+=N*(5*X),g+=E*(5*D),g+=I*(5*j),b=h+=(g+=H*(5*R))>>>13,b+=P*R,b+=T*z,b+=k*B,b+=M*U,h=(b+=A*L)>>>13,b&=8191,b+=V*C,b+=N*O,b+=E*(5*X),b+=I*(5*D),v=h+=(b+=H*(5*j))>>>13,v+=P*j,v+=T*R,v+=k*z,v+=M*B,h=(v+=A*U)>>>13,v&=8191,v+=V*L,v+=N*C,v+=E*O,v+=I*(5*X),w=h+=(v+=H*(5*D))>>>13,w+=P*D,w+=T*j,w+=k*R,w+=M*z,h=(w+=A*B)>>>13,w&=8191,w+=V*U,w+=N*L,w+=E*C,w+=I*O,x=h+=(w+=H*(5*X))>>>13,x+=P*X,x+=T*D,x+=k*j,x+=M*R,h=(x+=A*z)>>>13,x&=8191,x+=V*B,x+=N*U,x+=E*L,x+=I*C,P=d=8191&(h=(h=((h+=(x+=H*O)>>>13)<<2)+h|0)+(d&=8191)|0),T=p+=h>>>=13,k=f&=8191,M=y&=8191,A=m&=8191,V=g&=8191,N=b&=8191,E=v&=8191,I=w&=8191,H=x&=8191,t+=16,n-=16;this.h[0]=P,this.h[1]=T,this.h[2]=k,this.h[3]=M,this.h[4]=A,this.h[5]=V,this.h[6]=N,this.h[7]=E,this.h[8]=I,this.h[9]=H},k.prototype.finish=function(e,t){var n,r,i,s,a=new Uint16Array(10);if(this.leftover){for(s=this.leftover,this.buffer[s++]=1;s<16;s++)this.buffer[s]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,s=2;s<10;s++)this.h[s]+=n,n=this.h[s]>>>13,this.h[s]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,a[0]=this.h[0]+5,n=a[0]>>>13,a[0]&=8191,s=1;s<10;s++)a[s]=this.h[s]+n,n=a[s]>>>13,a[s]&=8191;for(a[9]-=8192,r=(1^n)-1,s=0;s<10;s++)a[s]&=r;for(r=~r,s=0;s<10;s++)this.h[s]=this.h[s]&r|a[s];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),i=this.h[0]+this.pad[0],this.h[0]=65535&i,s=1;s<8;s++)i=(this.h[s]+this.pad[s]|0)+(i>>>16)|0,this.h[s]=65535&i;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},k.prototype.update=function(e,t,n){var r,i;if(this.leftover){for((i=16-this.leftover)>n&&(i=n),r=0;r=16&&(i=n-n%16,this.blocks(e,t,i),t+=i,n-=i),n){for(r=0;r=128;){for(S=0;S<16;S++)P=8*S+G,E[S]=n[P+0]<<24|n[P+1]<<16|n[P+2]<<8|n[P+3],I[S]=n[P+4]<<24|n[P+5]<<16|n[P+6]<<8|n[P+7];for(S=0;S<80;S++)if(i=H,s=O,a=C,o=L,c=U,u=B,l=z,d=j,p=D,f=X,y=F,m=q,g=W,b=Z,M=65535&(k=K),A=k>>>16,V=65535&(T=R),N=T>>>16,M+=65535&(k=(q>>>14|U<<18)^(q>>>18|U<<14)^(U>>>9|q<<23)),A+=k>>>16,V+=65535&(T=(U>>>14|q<<18)^(U>>>18|q<<14)^(q>>>9|U<<23)),N+=T>>>16,M+=65535&(k=q&W^~q&Z),A+=k>>>16,V+=65535&(T=U&B^~U&z),N+=T>>>16,M+=65535&(k=Y[2*S+1]),A+=k>>>16,V+=65535&(T=Y[2*S]),N+=T>>>16,T=E[S%16],A+=(k=I[S%16])>>>16,V+=65535&T,N+=T>>>16,V+=(A+=(M+=65535&k)>>>16)>>>16,M=65535&(k=x=65535&M|A<<16),A=k>>>16,V=65535&(T=w=65535&V|(N+=V>>>16)<<16),N=T>>>16,M+=65535&(k=(j>>>28|H<<4)^(H>>>2|j<<30)^(H>>>7|j<<25)),A+=k>>>16,V+=65535&(T=(H>>>28|j<<4)^(j>>>2|H<<30)^(j>>>7|H<<25)),N+=T>>>16,A+=(k=j&D^j&X^D&X)>>>16,V+=65535&(T=H&O^H&C^O&C),N+=T>>>16,h=65535&(V+=(A+=(M+=65535&k)>>>16)>>>16)|(N+=V>>>16)<<16,v=65535&M|A<<16,M=65535&(k=y),A=k>>>16,V=65535&(T=o),N=T>>>16,A+=(k=x)>>>16,V+=65535&(T=w),N+=T>>>16,O=i,C=s,L=a,U=o=65535&(V+=(A+=(M+=65535&k)>>>16)>>>16)|(N+=V>>>16)<<16,B=c,z=u,R=l,H=h,D=d,X=p,F=f,q=y=65535&M|A<<16,W=m,Z=g,K=b,j=v,S%16==15)for(P=0;P<16;P++)T=E[P],M=65535&(k=I[P]),A=k>>>16,V=65535&T,N=T>>>16,T=E[(P+9)%16],M+=65535&(k=I[(P+9)%16]),A+=k>>>16,V+=65535&T,N+=T>>>16,w=E[(P+1)%16],M+=65535&(k=((x=I[(P+1)%16])>>>1|w<<31)^(x>>>8|w<<24)^(x>>>7|w<<25)),A+=k>>>16,V+=65535&(T=(w>>>1|x<<31)^(w>>>8|x<<24)^w>>>7),N+=T>>>16,w=E[(P+14)%16],A+=(k=((x=I[(P+14)%16])>>>19|w<<13)^(w>>>29|x<<3)^(x>>>6|w<<26))>>>16,V+=65535&(T=(w>>>19|x<<13)^(x>>>29|w<<3)^w>>>6),N+=T>>>16,N+=(V+=(A+=(M+=65535&k)>>>16)>>>16)>>>16,E[P]=65535&V|N<<16,I[P]=65535&M|A<<16;M=65535&(k=j),A=k>>>16,V=65535&(T=H),N=T>>>16,T=e[0],A+=(k=t[0])>>>16,V+=65535&T,N+=T>>>16,N+=(V+=(A+=(M+=65535&k)>>>16)>>>16)>>>16,e[0]=H=65535&V|N<<16,t[0]=j=65535&M|A<<16,M=65535&(k=D),A=k>>>16,V=65535&(T=O),N=T>>>16,T=e[1],A+=(k=t[1])>>>16,V+=65535&T,N+=T>>>16,N+=(V+=(A+=(M+=65535&k)>>>16)>>>16)>>>16,e[1]=O=65535&V|N<<16,t[1]=D=65535&M|A<<16,M=65535&(k=X),A=k>>>16,V=65535&(T=C),N=T>>>16,T=e[2],A+=(k=t[2])>>>16,V+=65535&T,N+=T>>>16,N+=(V+=(A+=(M+=65535&k)>>>16)>>>16)>>>16,e[2]=C=65535&V|N<<16,t[2]=X=65535&M|A<<16,M=65535&(k=F),A=k>>>16,V=65535&(T=L),N=T>>>16,T=e[3],A+=(k=t[3])>>>16,V+=65535&T,N+=T>>>16,N+=(V+=(A+=(M+=65535&k)>>>16)>>>16)>>>16,e[3]=L=65535&V|N<<16,t[3]=F=65535&M|A<<16,M=65535&(k=q),A=k>>>16,V=65535&(T=U),N=T>>>16,T=e[4],A+=(k=t[4])>>>16,V+=65535&T,N+=T>>>16,N+=(V+=(A+=(M+=65535&k)>>>16)>>>16)>>>16,e[4]=U=65535&V|N<<16,t[4]=q=65535&M|A<<16,M=65535&(k=W),A=k>>>16,V=65535&(T=B),N=T>>>16,T=e[5],A+=(k=t[5])>>>16,V+=65535&T,N+=T>>>16,N+=(V+=(A+=(M+=65535&k)>>>16)>>>16)>>>16,e[5]=B=65535&V|N<<16,t[5]=W=65535&M|A<<16,M=65535&(k=Z),A=k>>>16,V=65535&(T=z),N=T>>>16,T=e[6],A+=(k=t[6])>>>16,V+=65535&T,N+=T>>>16,N+=(V+=(A+=(M+=65535&k)>>>16)>>>16)>>>16,e[6]=z=65535&V|N<<16,t[6]=Z=65535&M|A<<16,M=65535&(k=K),A=k>>>16,V=65535&(T=R),N=T>>>16,T=e[7],A+=(k=t[7])>>>16,V+=65535&T,N+=T>>>16,N+=(V+=(A+=(M+=65535&k)>>>16)>>>16)>>>16,e[7]=R=65535&V|N<<16,t[7]=K=65535&M|A<<16,G+=128,r-=128}return r}function Q(e,t,n){var r,i=new Int32Array(8),s=new Int32Array(8),a=new Uint8Array(256),o=n;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,s[0]=4089235720,s[1]=2227873595,s[2]=4271175723,s[3]=1595750129,s[4]=2917565137,s[5]=725511199,s[6]=4215389547,s[7]=327033209,J(i,s,t,n),n%=128,r=0;r=0;--i)$(e,t,r=n[i/8|0]>>(7&i)&1),_(t,e),_(e,e),$(e,t,r)}function ne(e,n){var r=[t(),t(),t(),t()];E(r[0],h),E(r[1],d),E(r[2],o),R(r[3],h,d),te(e,r,n)}function re(e,n,i){var s,a=new Uint8Array(64),o=[t(),t(),t(),t()];for(i||r(n,32),Q(a,n,32),a[0]&=248,a[31]&=127,a[31]|=64,ne(o,a),ee(e,o),s=0;s<32;s++)n[s+32]=e[s];return 0}var ie=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 se(e,t){var n,r,i,s;for(r=63;r>=32;--r){for(n=0,i=r-32,s=r-12;i>4)*ie[i],n=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=n*ie[i];for(r=0;r<32;r++)t[r+1]+=t[r]>>8,e[r]=255&t[r]}function ae(e){var t,n=new Float64Array(64);for(t=0;t<64;t++)n[t]=e[t];for(t=0;t<64;t++)e[t]=0;se(e,n)}function oe(e,n,r,i){var s,a,o=new Uint8Array(64),c=new Uint8Array(64),u=new Uint8Array(64),l=new Float64Array(64),h=[t(),t(),t(),t()];Q(o,i,32),o[0]&=248,o[31]&=127,o[31]|=64;var d=r+64;for(s=0;s>7&&z(e[0],a,e[0]),R(e[3],e[0],e[1]),0)}(d,i))return-1;for(s=0;s=0},e.sign.keyPair=function(){var e=new Uint8Array(he),t=new Uint8Array(de);return re(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(fe(e),e.length!==de)throw new Error("bad secret key size");for(var t=new Uint8Array(he),n=0;n{"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(e,t,r,s,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var o=new i(r,s||e,a),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],o]:e._events[c].push(o):(e._events[c]=o,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function o(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),o.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},o.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,s=r.length,a=new Array(s);i{t.read=function(e,t,n,r,i){var s,a,o=8*i-r-1,c=(1<>1,l=-7,h=n?i-1:0,d=n?-1:1,p=e[t+h];for(h+=d,s=p&(1<<-l)-1,p>>=-l,l+=o;l>0;s=256*s+e[t+h],h+=d,l-=8);for(a=s&(1<<-l)-1,s>>=-l,l+=r;l>0;a=256*a+e[t+h],h+=d,l-=8);if(0===s)s=1-u;else{if(s===c)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),s-=u}return(p?-1:1)*a*Math.pow(2,s-r)},t.write=function(e,t,n,r,i,s){var a,o,c,u=8*s-i-1,l=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:s-1,f=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+h>=1?d/c:d*Math.pow(2,1-h))*c>=2&&(a++,c/=2),a+h>=l?(o=0,a=l):a+h>=1?(o=(t*c-1)*Math.pow(2,i),a+=h):(o=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[n+p]=255&o,p+=f,o/=256,i-=8);for(a=a<0;e[n+p]=255&a,p+=f,a/=256,u-=8);e[n+p-f]|=128*y}},406:e=>{var t,n,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var o,c=[],u=!1,l=-1;function h(){u&&o&&(u=!1,o.length?c=o.concat(c):l=-1,c.length&&d())}function d(){if(!u){var e=a(h);u=!0;for(var t=c.length;t;){for(o=c,c=[];++l1)for(var n=1;n{var r=n(595),i=n(120),s=[n(225)];e.exports=r.createStore(i,s)},225:(e,t,n)=>{e.exports=function(){return n(414),{}}},414:()=>{"object"!=typeof JSON&&(JSON={}),function(){"use strict";var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta,rep;function f(e){return e<10?"0"+e:e}function this_value(){return this.valueOf()}function quote(e){return rx_escapable.lastIndex=0,rx_escapable.test(e)?'"'+e.replace(rx_escapable,(function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}function str(e,t){var n,r,i,s,a,o=gap,c=t[e];switch(c&&"object"==typeof c&&"function"==typeof c.toJSON&&(c=c.toJSON(e)),"function"==typeof rep&&(c=rep.call(t,e,c)),typeof c){case"string":return quote(c);case"number":return isFinite(c)?String(c):"null";case"boolean":case"null":return String(c);case"object":if(!c)return"null";if(gap+=indent,a=[],"[object Array]"===Object.prototype.toString.apply(c)){for(s=c.length,n=0;n{var r=n(511),i=r.slice,s=r.pluck,a=r.each,o=r.bind,c=r.create,u=r.isList,l=r.isFunction,h=r.isObject;e.exports={createStore:p};var d={version:"2.0.12",enabled:!1,get:function(e,t){var n=this.storage.read(this._namespacePrefix+e);return this._deserialize(n,t)},set:function(e,t){return void 0===t?this.remove(e):(this.storage.write(this._namespacePrefix+e,this._serialize(t)),t)},remove:function(e){this.storage.remove(this._namespacePrefix+e)},each:function(e){var t=this;this.storage.each((function(n,r){e.call(t,t._deserialize(n),(r||"").replace(t._namespaceRegexp,""))}))},clearAll:function(){this.storage.clearAll()},hasNamespace:function(e){return this._namespacePrefix=="__storejs_"+e+"_"},createStore:function(){return p.apply(this,arguments)},addPlugin:function(e){this._addPlugin(e)},namespace:function(e){return p(this.storage,this.plugins,e)}};function p(e,t,n){n||(n=""),e&&!u(e)&&(e=[e]),t&&!u(t)&&(t=[t]);var r=n?"__storejs_"+n+"_":"",p=n?new RegExp("^"+r):null;if(!/^[a-zA-Z0-9_\-]*$/.test(n))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var f=c({_namespacePrefix:r,_namespaceRegexp:p,_testStorage:function(e){try{var t="__storejs__test__";e.write(t,t);var n=e.read(t)===t;return e.remove(t),n}catch(e){return!1}},_assignPluginFnProp:function(e,t){var n=this[t];this[t]=function(){var t=i(arguments,0),r=this;function s(){if(n)return a(arguments,(function(e,n){t[n]=e})),n.apply(r,t)}var o=[s].concat(t);return e.apply(r,o)}},_serialize:function(e){return JSON.stringify(e)},_deserialize:function(e,t){if(!e)return t;var n="";try{n=JSON.parse(e)}catch(t){n=e}return void 0!==n?n:t},_addStorage:function(e){this.enabled||this._testStorage(e)&&(this.storage=e,this.enabled=!0)},_addPlugin:function(e){var t=this;if(u(e))a(e,(function(e){t._addPlugin(e)}));else if(!s(this.plugins,(function(t){return e===t}))){if(this.plugins.push(e),!l(e))throw new Error("Plugins must be function values that return objects");var n=e.call(this);if(!h(n))throw new Error("Plugins must return an object of function properties");a(n,(function(n,r){if(!l(n))throw new Error("Bad plugin property: "+r+" from plugin "+e.name+". Plugins should only return functions.");t._assignPluginFnProp(n,r)}))}},addStorage:function(e){!function(){var e="undefined"==typeof console?null:console;e&&(e.warn?e.warn:e.log).apply(e,arguments)}("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(e)}},d,{plugins:[]});return f.raw={},a(f,(function(e,t){l(e)&&(f.raw[t]=o(f,e))})),a(e,(function(e){f._addStorage(e)})),a(t,(function(e){f._addPlugin(e)})),f}},511:(e,t,n)=>{var r=Object.assign?Object.assign:function(e,t,n,r){for(var i=1;i{e.exports=[n(367),n(26),n(240),n(362),n(109),n(884)]},362:(e,t,n)=>{var r=n(511),i=r.Global,s=r.trim;e.exports={name:"cookieStorage",read:function(e){if(!e||!u(e))return null;var t="(?:^|.*;\\s*)"+escape(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(a.cookie.replace(new RegExp(t),"$1"))},write:function(e,t){e&&(a.cookie=escape(e)+"="+escape(t)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/")},each:o,remove:c,clearAll:function(){o((function(e,t){c(t)}))}};var a=i.document;function o(e){for(var t=a.cookie.split(/; ?/g),n=t.length-1;n>=0;n--)if(s(t[n])){var r=t[n].split("="),i=unescape(r[0]);e(unescape(r[1]),i)}}function c(e){e&&u(e)&&(a.cookie=escape(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function u(e){return new RegExp("(?:^|;\\s*)"+escape(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(a.cookie)}},367:(e,t,n)=>{var r=n(511).Global;function i(){return r.localStorage}function s(e){return i().getItem(e)}e.exports={name:"localStorage",read:s,write:function(e,t){return i().setItem(e,t)},each:function(e){for(var t=i().length-1;t>=0;t--){var n=i().key(t);e(s(n),n)}},remove:function(e){return i().removeItem(e)},clearAll:function(){return i().clear()}}},884:e=>{e.exports={name:"memoryStorage",read:function(e){return t[e]},write:function(e,n){t[e]=n},each:function(e){for(var n in t)t.hasOwnProperty(n)&&e(t[n],n)},remove:function(e){delete t[e]},clearAll:function(e){t={}}};var t={}},26:(e,t,n)=>{var r=n(511).Global;e.exports={name:"oldFF-globalStorage",read:function(e){return i[e]},write:function(e,t){i[e]=t},each:s,remove:function(e){return i.removeItem(e)},clearAll:function(){s((function(e,t){delete i[e]}))}};var i=r.globalStorage;function s(e){for(var t=i.length-1;t>=0;t--){var n=i.key(t);e(i[n],n)}}},240:(e,t,n)=>{var r=n(511).Global;e.exports={name:"oldIE-userDataStorage",write:function(e,t){if(!o){var n=u(e);a((function(e){e.setAttribute(n,t),e.save(i)}))}},read:function(e){if(!o){var t=u(e),n=null;return a((function(e){n=e.getAttribute(t)})),n}},each:function(e){a((function(t){for(var n=t.XMLDocument.documentElement.attributes,r=n.length-1;r>=0;r--){var i=n[r];e(t.getAttribute(i.name),i.name)}}))},remove:function(e){var t=u(e);a((function(e){e.removeAttribute(t),e.save(i)}))},clearAll:function(){a((function(e){var t=e.XMLDocument.documentElement.attributes;e.load(i);for(var n=t.length-1;n>=0;n--)e.removeAttribute(t[n].name);e.save(i)}))}};var i="storejs",s=r.document,a=function(){if(!s||!s.documentElement||!s.documentElement.addBehavior)return null;var e,t,n;try{(t=new ActiveXObject("htmlfile")).open(),t.write(' diff --git a/tests/polkadot_wallet/packageDetect.d.ts b/tests/polkadot_wallet/packageDetect.d.ts new file mode 100644 index 000000000..cb0ff5c3b --- /dev/null +++ b/tests/polkadot_wallet/packageDetect.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/tests/polkadot_wallet/packageInfo.d.ts b/tests/polkadot_wallet/packageInfo.d.ts index 1b6c408be..eecb50194 100644 --- a/tests/polkadot_wallet/packageInfo.d.ts +++ b/tests/polkadot_wallet/packageInfo.d.ts @@ -1,6 +1,6 @@ export declare const packageInfo: { - name: string; - path: string; - type: string; - version: string; + name: string; + path: string; + type: string; + version: string; }; diff --git a/tests/polkadot_wallet/page.js b/tests/polkadot_wallet/page.js index 05a3b36fd..a1c7fbfd4 100644 --- a/tests/polkadot_wallet/page.js +++ b/tests/polkadot_wallet/page.js @@ -1,2 +1 @@ -/*! For license information please see page.js.LICENSE.txt */ -(()=>{var t={801:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(983).Buffer}catch(t){}function h(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void i(!1,"Invalid character in "+t)}function u(t,e,r){var i=h(t,r);return r-1>=e&&(i|=h(t,r-1)<<4),i}function a(t,e,r,n){for(var o=0,s=0,h=Math.min(t.length,r),u=e;u=49?a-49+10:a>=17?a-17+10:a,i(a>=0&&s0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-h&67108863,(h+=24)>=26&&(h-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-h&67108863,(h+=24)>=26&&(h-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=2)n=u(t,e,i)<=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,h=Math.min(o,o-s)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(t){o.prototype.inspect=l}else o.prototype.inspect=l;function l(){return(this.red?""}var c=["","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"],p=[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],d=[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];function m(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,h=67108863&s,u=s/67108864|0;r.words[0]=h;for(var a=1;a>>26,l=67108863&u,c=Math.min(a,e.length-1),p=Math.max(0,a-t.length+1);p<=c;p++){var d=a-p|0;f+=(s=(n=0|t.words[d])*(o=0|e.words[p])+l)/67108864|0,l=67108863&s}r.words[a]=0|l,u=0|f}return 0!==u?r.words[a]=0|u:r.length--,r._strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),r=0!==o||s!==this.length-1?c[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var a=p[t],f=d[t];r="";var l=this.clone();for(l.negative=0;!l.isZero();){var m=l.modrn(f).toString(t);r=(l=l.idivn(f)).isZero()?m+r:c[a-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){this._strip();var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,n),s},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,i=0,n=0,o=0;n>8&255),r>16&255),6===o?(r>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r>=0)for(t[r--]=i;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,p=0|s[1],d=8191&p,m=p>>>13,g=0|s[2],y=8191&g,v=g>>>13,w=0|s[3],M=8191&w,b=w>>>13,_=0|s[4],B=8191&_,E=_>>>13,A=0|s[5],I=8191&A,U=A>>>13,x=0|s[6],S=8191&x,R=x>>>13,T=0|s[7],L=8191&T,k=T>>>13,O=0|s[8],N=8191&O,$=O>>>13,C=0|s[9],P=8191&C,j=C>>>13,q=0|h[0],Z=8191&q,F=q>>>13,D=0|h[1],z=8191&D,W=D>>>13,Y=0|h[2],G=8191&Y,V=Y>>>13,X=0|h[3],K=8191&X,H=X>>>13,J=0|h[4],Q=8191&J,tt=J>>>13,et=0|h[5],rt=8191&et,it=et>>>13,nt=0|h[6],ot=8191&nt,st=nt>>>13,ht=0|h[7],ut=8191&ht,at=ht>>>13,ft=0|h[8],lt=8191&ft,ct=ft>>>13,pt=0|h[9],dt=8191&pt,mt=pt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(a+(i=Math.imul(l,Z))|0)+((8191&(n=(n=Math.imul(l,F))+Math.imul(c,Z)|0))<<13)|0;a=((o=Math.imul(c,F))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(d,Z),n=(n=Math.imul(d,F))+Math.imul(m,Z)|0,o=Math.imul(m,F);var yt=(a+(i=i+Math.imul(l,z)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,z)|0))<<13)|0;a=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(y,Z),n=(n=Math.imul(y,F))+Math.imul(v,Z)|0,o=Math.imul(v,F),i=i+Math.imul(d,z)|0,n=(n=n+Math.imul(d,W)|0)+Math.imul(m,z)|0,o=o+Math.imul(m,W)|0;var vt=(a+(i=i+Math.imul(l,G)|0)|0)+((8191&(n=(n=n+Math.imul(l,V)|0)+Math.imul(c,G)|0))<<13)|0;a=((o=o+Math.imul(c,V)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(M,Z),n=(n=Math.imul(M,F))+Math.imul(b,Z)|0,o=Math.imul(b,F),i=i+Math.imul(y,z)|0,n=(n=n+Math.imul(y,W)|0)+Math.imul(v,z)|0,o=o+Math.imul(v,W)|0,i=i+Math.imul(d,G)|0,n=(n=n+Math.imul(d,V)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,V)|0;var wt=(a+(i=i+Math.imul(l,K)|0)|0)+((8191&(n=(n=n+Math.imul(l,H)|0)+Math.imul(c,K)|0))<<13)|0;a=((o=o+Math.imul(c,H)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(B,Z),n=(n=Math.imul(B,F))+Math.imul(E,Z)|0,o=Math.imul(E,F),i=i+Math.imul(M,z)|0,n=(n=n+Math.imul(M,W)|0)+Math.imul(b,z)|0,o=o+Math.imul(b,W)|0,i=i+Math.imul(y,G)|0,n=(n=n+Math.imul(y,V)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,V)|0,i=i+Math.imul(d,K)|0,n=(n=n+Math.imul(d,H)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,H)|0;var Mt=(a+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,Q)|0))<<13)|0;a=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(I,Z),n=(n=Math.imul(I,F))+Math.imul(U,Z)|0,o=Math.imul(U,F),i=i+Math.imul(B,z)|0,n=(n=n+Math.imul(B,W)|0)+Math.imul(E,z)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(M,G)|0,n=(n=n+Math.imul(M,V)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,V)|0,i=i+Math.imul(y,K)|0,n=(n=n+Math.imul(y,H)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,H)|0,i=i+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var bt=(a+(i=i+Math.imul(l,rt)|0)|0)+((8191&(n=(n=n+Math.imul(l,it)|0)+Math.imul(c,rt)|0))<<13)|0;a=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(S,Z),n=(n=Math.imul(S,F))+Math.imul(R,Z)|0,o=Math.imul(R,F),i=i+Math.imul(I,z)|0,n=(n=n+Math.imul(I,W)|0)+Math.imul(U,z)|0,o=o+Math.imul(U,W)|0,i=i+Math.imul(B,G)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,V)|0,i=i+Math.imul(M,K)|0,n=(n=n+Math.imul(M,H)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,H)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,i=i+Math.imul(d,rt)|0,n=(n=n+Math.imul(d,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(a+(i=i+Math.imul(l,ot)|0)|0)+((8191&(n=(n=n+Math.imul(l,st)|0)+Math.imul(c,ot)|0))<<13)|0;a=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(L,Z),n=(n=Math.imul(L,F))+Math.imul(k,Z)|0,o=Math.imul(k,F),i=i+Math.imul(S,z)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(R,z)|0,o=o+Math.imul(R,W)|0,i=i+Math.imul(I,G)|0,n=(n=n+Math.imul(I,V)|0)+Math.imul(U,G)|0,o=o+Math.imul(U,V)|0,i=i+Math.imul(B,K)|0,n=(n=n+Math.imul(B,H)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,H)|0,i=i+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0,i=i+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,it)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,it)|0,i=i+Math.imul(d,ot)|0,n=(n=n+Math.imul(d,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Bt=(a+(i=i+Math.imul(l,ut)|0)|0)+((8191&(n=(n=n+Math.imul(l,at)|0)+Math.imul(c,ut)|0))<<13)|0;a=((o=o+Math.imul(c,at)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(N,Z),n=(n=Math.imul(N,F))+Math.imul($,Z)|0,o=Math.imul($,F),i=i+Math.imul(L,z)|0,n=(n=n+Math.imul(L,W)|0)+Math.imul(k,z)|0,o=o+Math.imul(k,W)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,V)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,V)|0,i=i+Math.imul(I,K)|0,n=(n=n+Math.imul(I,H)|0)+Math.imul(U,K)|0,o=o+Math.imul(U,H)|0,i=i+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(M,rt)|0,n=(n=n+Math.imul(M,it)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,it)|0,i=i+Math.imul(y,ot)|0,n=(n=n+Math.imul(y,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,i=i+Math.imul(d,ut)|0,n=(n=n+Math.imul(d,at)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,at)|0;var Et=(a+(i=i+Math.imul(l,lt)|0)|0)+((8191&(n=(n=n+Math.imul(l,ct)|0)+Math.imul(c,lt)|0))<<13)|0;a=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(P,Z),n=(n=Math.imul(P,F))+Math.imul(j,Z)|0,o=Math.imul(j,F),i=i+Math.imul(N,z)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul($,z)|0,o=o+Math.imul($,W)|0,i=i+Math.imul(L,G)|0,n=(n=n+Math.imul(L,V)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,V)|0,i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,H)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,H)|0,i=i+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(U,Q)|0,o=o+Math.imul(U,tt)|0,i=i+Math.imul(B,rt)|0,n=(n=n+Math.imul(B,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(M,ot)|0,n=(n=n+Math.imul(M,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0,i=i+Math.imul(y,ut)|0,n=(n=n+Math.imul(y,at)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,at)|0,i=i+Math.imul(d,lt)|0,n=(n=n+Math.imul(d,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var At=(a+(i=i+Math.imul(l,dt)|0)|0)+((8191&(n=(n=n+Math.imul(l,mt)|0)+Math.imul(c,dt)|0))<<13)|0;a=((o=o+Math.imul(c,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(P,z),n=(n=Math.imul(P,W))+Math.imul(j,z)|0,o=Math.imul(j,W),i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,V)|0)+Math.imul($,G)|0,o=o+Math.imul($,V)|0,i=i+Math.imul(L,K)|0,n=(n=n+Math.imul(L,H)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,H)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(I,rt)|0,n=(n=n+Math.imul(I,it)|0)+Math.imul(U,rt)|0,o=o+Math.imul(U,it)|0,i=i+Math.imul(B,ot)|0,n=(n=n+Math.imul(B,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(M,ut)|0,n=(n=n+Math.imul(M,at)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,at)|0,i=i+Math.imul(y,lt)|0,n=(n=n+Math.imul(y,ct)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,ct)|0;var It=(a+(i=i+Math.imul(d,dt)|0)|0)+((8191&(n=(n=n+Math.imul(d,mt)|0)+Math.imul(m,dt)|0))<<13)|0;a=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(P,G),n=(n=Math.imul(P,V))+Math.imul(j,G)|0,o=Math.imul(j,V),i=i+Math.imul(N,K)|0,n=(n=n+Math.imul(N,H)|0)+Math.imul($,K)|0,o=o+Math.imul($,H)|0,i=i+Math.imul(L,Q)|0,n=(n=n+Math.imul(L,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(I,ot)|0,n=(n=n+Math.imul(I,st)|0)+Math.imul(U,ot)|0,o=o+Math.imul(U,st)|0,i=i+Math.imul(B,ut)|0,n=(n=n+Math.imul(B,at)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,at)|0,i=i+Math.imul(M,lt)|0,n=(n=n+Math.imul(M,ct)|0)+Math.imul(b,lt)|0,o=o+Math.imul(b,ct)|0;var Ut=(a+(i=i+Math.imul(y,dt)|0)|0)+((8191&(n=(n=n+Math.imul(y,mt)|0)+Math.imul(v,dt)|0))<<13)|0;a=((o=o+Math.imul(v,mt)|0)+(n>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,i=Math.imul(P,K),n=(n=Math.imul(P,H))+Math.imul(j,K)|0,o=Math.imul(j,H),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul($,Q)|0,o=o+Math.imul($,tt)|0,i=i+Math.imul(L,rt)|0,n=(n=n+Math.imul(L,it)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(I,ut)|0,n=(n=n+Math.imul(I,at)|0)+Math.imul(U,ut)|0,o=o+Math.imul(U,at)|0,i=i+Math.imul(B,lt)|0,n=(n=n+Math.imul(B,ct)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ct)|0;var xt=(a+(i=i+Math.imul(M,dt)|0)|0)+((8191&(n=(n=n+Math.imul(M,mt)|0)+Math.imul(b,dt)|0))<<13)|0;a=((o=o+Math.imul(b,mt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(P,Q),n=(n=Math.imul(P,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul($,rt)|0,o=o+Math.imul($,it)|0,i=i+Math.imul(L,ot)|0,n=(n=n+Math.imul(L,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,i=i+Math.imul(S,ut)|0,n=(n=n+Math.imul(S,at)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,at)|0,i=i+Math.imul(I,lt)|0,n=(n=n+Math.imul(I,ct)|0)+Math.imul(U,lt)|0,o=o+Math.imul(U,ct)|0;var St=(a+(i=i+Math.imul(B,dt)|0)|0)+((8191&(n=(n=n+Math.imul(B,mt)|0)+Math.imul(E,dt)|0))<<13)|0;a=((o=o+Math.imul(E,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(P,rt),n=(n=Math.imul(P,it))+Math.imul(j,rt)|0,o=Math.imul(j,it),i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul($,ot)|0,o=o+Math.imul($,st)|0,i=i+Math.imul(L,ut)|0,n=(n=n+Math.imul(L,at)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,at)|0,i=i+Math.imul(S,lt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0;var Rt=(a+(i=i+Math.imul(I,dt)|0)|0)+((8191&(n=(n=n+Math.imul(I,mt)|0)+Math.imul(U,dt)|0))<<13)|0;a=((o=o+Math.imul(U,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(P,ot),n=(n=Math.imul(P,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),i=i+Math.imul(N,ut)|0,n=(n=n+Math.imul(N,at)|0)+Math.imul($,ut)|0,o=o+Math.imul($,at)|0,i=i+Math.imul(L,lt)|0,n=(n=n+Math.imul(L,ct)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,ct)|0;var Tt=(a+(i=i+Math.imul(S,dt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(R,dt)|0))<<13)|0;a=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(P,ut),n=(n=Math.imul(P,at))+Math.imul(j,ut)|0,o=Math.imul(j,at),i=i+Math.imul(N,lt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul($,lt)|0,o=o+Math.imul($,ct)|0;var Lt=(a+(i=i+Math.imul(L,dt)|0)|0)+((8191&(n=(n=n+Math.imul(L,mt)|0)+Math.imul(k,dt)|0))<<13)|0;a=((o=o+Math.imul(k,mt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,i=Math.imul(P,lt),n=(n=Math.imul(P,ct))+Math.imul(j,lt)|0,o=Math.imul(j,ct);var kt=(a+(i=i+Math.imul(N,dt)|0)|0)+((8191&(n=(n=n+Math.imul(N,mt)|0)+Math.imul($,dt)|0))<<13)|0;a=((o=o+Math.imul($,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863;var Ot=(a+(i=Math.imul(P,dt))|0)+((8191&(n=(n=Math.imul(P,mt))+Math.imul(j,dt)|0))<<13)|0;return a=((o=Math.imul(j,mt))+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=gt,u[1]=yt,u[2]=vt,u[3]=wt,u[4]=Mt,u[5]=bt,u[6]=_t,u[7]=Bt,u[8]=Et,u[9]=At,u[10]=It,u[11]=Ut,u[12]=xt,u[13]=St,u[14]=Rt,u[15]=Tt,u[16]=Lt,u[17]=kt,u[18]=Ot,0!==a&&(u[19]=a,r.length++),r};function y(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=h,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r._strip()}function v(t,e,r){return y(t,e,r)}function w(t,e){this.x=t,this.y=e}Math.imul||(g=m),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):r<63?m(this,t,e):r<1024?y(this,t,e):v(this,t,e)},w.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},w.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,r+=o/67108864|0,r+=s>>>26,this.words[n]=67108863&s}return 0!==r&&(this.words[n]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),h=67108863^67108863>>>o<s)for(this.length-=s,a=0;a=0&&(0!==f||a>=n);a--){var l=0|this.words[a];this.words[a]=f<<26-o|l>>>o,f=l&h}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===h)return this._strip();for(i(-1===h),h=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var h,u=i.length-n.length;if("mod"!==e){(h=new o(null)).length=u+1,h.words=new Array(h.length);for(var a=0;a=0;l--){var c=67108864*(0|i.words[n.length+l])+(0|i.words[n.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,l),i.isZero()||(i.negative^=1);h&&(h.words[l]=c)}return h&&h._strip(),i._strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:h||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(h=this.neg().divmod(t,e),"mod"!==e&&(n=h.div.neg()),"div"!==e&&(s=h.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(h=this.divmod(t.neg(),e),"mod"!==e&&(n=h.div.neg()),{div:n,mod:h.mod}):0!=(this.negative&t.negative)?(h=this.neg().divmod(t.neg(),e),"div"!==e&&(s=h.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:h.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var n,s,h},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=(1<<26)%t,n=0,o=this.length-1;o>=0;o--)n=(r*n+(0|this.words[o]))%t;return e?-n:n},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*r;this.words[n]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),h=new o(0),u=new o(1),a=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++a;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var c=0,p=1;0==(e.words[0]&p)&&c<26;++c,p<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(f),s.isub(l)),n.iushrn(1),s.iushrn(1);for(var d=0,m=1;0==(r.words[0]&m)&&d<26;++d,m<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(h.isOdd()||u.isOdd())&&(h.iadd(f),u.isub(l)),h.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(h),s.isub(u)):(r.isub(e),h.isub(n),u.isub(s))}return{a:h,b:u,gcd:r.iushln(a)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),h=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var a=0,f=1;0==(e.words[0]&f)&&a<26;++a,f<<=1);if(a>0)for(e.iushrn(a);a-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)h.isOdd()&&h.iadd(u),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(h)):(r.isub(e),h.isub(s))}return(n=0===e.cmpn(1)?s:h).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,h&=67108863,this.words[s]=h}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new I(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var M={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function B(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function I(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function U(t){I.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}b.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},n(_,b),_.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},_.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(M[t])return M[t];var e;if("k256"===t)e=new _;else if("p224"===t)e=new B;else if("p192"===t)e=new E;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new A}return M[t]=e,e},I.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},I.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},I.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(f(t,t.umod(this.m)._forceRed(this)),t)},I.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},I.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},I.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},I.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},I.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},I.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},I.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},I.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},I.prototype.isqr=function(t){return this.imul(t,t.clone())},I.prototype.sqr=function(t){return this.mul(t,t)},I.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var h=new o(1).toRed(this),u=h.redNeg(),a=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,a).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,n),c=this.pow(t,n.addn(1).iushrn(1)),p=this.pow(t,n),d=s;0!==p.cmp(h);){for(var m=p,g=0;0!==m.cmp(h);g++)m=m.redSqr();i(g=0;i--){for(var a=e.words[i],f=u-1;f>=0;f--){var l=a>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==s?(s<<=1,s|=l,(4==++h||0===i&&0===f)&&(n=this.mul(n,r[s]),h=0,s=0)):h=0}u=26}return n},I.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},I.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new U(t)},n(U,I),U.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},U.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},U.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},U.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},U.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},766:(t,e)=>{"use strict";e.byteLength=function(t){var e=u(t),r=e[0],i=e[1];return 3*(r+i)/4-i},e.toByteArray=function(t){var e,r,o=u(t),s=o[0],h=o[1],a=new n(function(t,e,r){return 3*(e+r)/4-r}(0,s,h)),f=0,l=h>0?s-4:s;for(r=0;r>16&255,a[f++]=e>>8&255,a[f++]=255&e;return 2===h&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,a[f++]=255&e),1===h&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,a[f++]=e>>8&255,a[f++]=255&e),a},e.fromByteArray=function(t){for(var e,i=t.length,n=i%3,o=[],s=16383,h=0,u=i-n;hu?u:h+s));return 1===n?(e=t[i-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===n&&(e=(t[i-2]<<8)+t[i-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],i=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,h=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function a(t,e,i){for(var n,o,s=[],h=e;h>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},834:(t,e,r)=>{"use strict";const i=r(766),n=r(333),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=function(t){return+t!=t&&(t=0),u.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;function h(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return a(t,e,r)}function a(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|m(t,e);let i=h(r);const n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}(t,e);if(ArrayBuffer.isView(t))return function(t){if(X(t,Uint8Array)){const e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return c(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(X(t,ArrayBuffer)||t&&X(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(X(t,SharedArrayBuffer)||t&&X(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=t.valueOf&&t.valueOf();if(null!=i&&i!==t)return u.from(i,e,r);const n=function(t){if(u.isBuffer(t)){const e=0|d(t.length),r=h(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||K(t.length)?h(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return f(t),h(t<0?0:0|d(t))}function c(t){const e=t.length<0?0:0|d(t.length),r=h(e);for(let i=0;i=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function m(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||X(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Y(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(t).length;default:if(n)return i?-1:Y(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){let i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return I(this,e,r);case"ascii":return x(this,e,r);case"latin1":case"binary":return S(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function y(t,e,r){const i=t[e];t[e]=t[r],t[r]=i}function v(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),K(r=+r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=u.from(e,i)),u.isBuffer(e))return 0===e.length?-1:w(t,e,r,i,n);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):w(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function w(t,e,r,i,n){let o,s=1,h=t.length,u=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s=2,h/=2,u/=2,r/=2}function a(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(n){let i=-1;for(o=r;oh&&(r=h-u),o=r;o>=0;o--){let r=!0;for(let i=0;in&&(i=n):i=n;const o=e.length;let s;for(i>o/2&&(i=o/2),s=0;s>8,n=r%256,o.push(n),o.push(i);return o}(e,t.length-r),t,r,i)}function A(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function I(t,e,r){r=Math.min(t.length,r);const i=[];let n=e;for(;n239?4:e>223?3:e>191?2:1;if(n+s<=r){let r,i,h,u;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[n+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[n+1],i=t[n+2],128==(192&r)&&128==(192&i)&&(u=(15&e)<<12|(63&r)<<6|63&i,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[n+1],i=t[n+2],h=t[n+3],128==(192&r)&&128==(192&i)&&128==(192&h)&&(u=(15&e)<<18|(63&r)<<12|(63&i)<<6|63&h,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|1023&o),i.push(o),n+=s}return function(t){const e=t.length;if(e<=U)return String.fromCharCode.apply(String,t);let r="",i=0;for(;ii.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(i,n)):Uint8Array.prototype.set.call(i,e,n);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(i,n)}n+=e.length}return i},u.byteLength=m,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;er&&(t+=" ... "),""},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,i,n){if(X(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(n>>>=0)-(i>>>=0),s=(r>>>=0)-(e>>>=0);const h=Math.min(o,s),a=this.slice(i,n),f=t.slice(e,r);for(let t=0;t>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}const n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return M(this,t,e,r);case"utf8":case"utf-8":return b(this,t,e,r);case"ascii":case"latin1":case"binary":return _(this,t,e,r);case"base64":return B(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const U=4096;function x(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;ni)&&(r=i);let n="";for(let i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function k(t,e,r,i,n,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}function O(t,e,r,i,n){F(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function N(t,e,r,i,n){F(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function $(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function C(t,e,r,i,o){return e=+e,r>>>=0,o||$(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function P(t,e,r,i,o){return e=+e,r>>>=0,o||$(t,0,r,8),n.write(t,e,r,i,52,8),r+8}u.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||L(t,e,this.length);let i=this[t],n=1,o=0;for(;++o>>=0,e>>>=0,r||L(t,e,this.length);let i=this[t+--e],n=1;for(;e>0&&(n*=256);)i+=this[t+--e]*n;return i},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=J((function(t){D(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const i=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,n=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(i)+(BigInt(n)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const i=e*2**24+65536*this[++t]+256*this[++t]+this[++t],n=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(i)<>>=0,e>>>=0,r||L(t,e,this.length);let i=this[t],n=1,o=0;for(;++o=n&&(i-=Math.pow(2,8*e)),i},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);let i=e,n=1,o=this[t+--i];for(;i>0&&(n*=256);)o+=this[t+--i]*n;return n*=128,o>=n&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||L(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||L(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=J((function(t){D(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const i=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(i)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const i=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(i)<>>=0,e||L(t,4,this.length),n.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||L(t,4,this.length),n.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||L(t,8,this.length),n.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||L(t,8,this.length),n.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||k(this,t,e,r,Math.pow(2,8*r)-1,0);let n=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,i||k(this,t,e,r,Math.pow(2,8*r)-1,0);let n=r-1,o=1;for(this[e+n]=255&t;--n>=0&&(o*=256);)this[e+n]=t/o&255;return e+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigUInt64LE=J((function(t,e=0){return O(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=J((function(t,e=0){return N(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e>>>=0,!i){const i=Math.pow(2,8*r-1);k(this,t,e,r,i-1,-i)}let n=0,o=1,s=0;for(this[e]=255&t;++n>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e>>>=0,!i){const i=Math.pow(2,8*r-1);k(this,t,e,r,i-1,-i)}let n=r-1,o=1,s=0;for(this[e+n]=255&t;--n>=0&&(o*=256);)t<0&&0===s&&0!==this[e+n+1]&&(s=1),this[e+n]=(t/o>>0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigInt64LE=J((function(t,e=0){return O(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=J((function(t,e=0){return N(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,r){return C(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return C(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return P(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return P(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,i){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(n=e;n=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function F(t,e,r,i,n,o){if(t>r||t3?0===e||e===BigInt(0)?`>= 0${i} and < 2${i} ** ${8*(o+1)}${i}`:`>= -(2${i} ** ${8*(o+1)-1}${i}) and < 2 ** ${8*(o+1)-1}${i}`:`>= ${e}${i} and <= ${r}${i}`,new j.ERR_OUT_OF_RANGE("value",n,t)}!function(t,e,r){D(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||z(e,t.length-(r+1))}(i,n,o)}function D(t,e){if("number"!=typeof t)throw new j.ERR_INVALID_ARG_TYPE(e,"number",t)}function z(t,e,r){if(Math.floor(t)!==t)throw D(t,r),new j.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}q("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),q("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),q("ERR_OUT_OF_RANGE",(function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=Z(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=Z(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i}),RangeError);const W=/[^+/0-9A-Za-z-_]/g;function Y(t,e){let r;e=e||1/0;const i=t.length;let n=null;const o=[];for(let s=0;s55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function V(t,e,r,i){let n;for(n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function X(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function K(t){return t!=t}const H=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const i=16*r;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function J(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},161:t=>{"use strict";var e=Object.prototype.hasOwnProperty,r="~";function i(){}function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,i,o,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var h=new n(i,o||t,s),u=r?r+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],h]:t._events[u].push(h):(t._events[u]=h,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function h(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),h.prototype.eventNames=function(){var t,i,n=[];if(0===this._eventsCount)return n;for(i in t=this._events)e.call(t,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},h.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,s=new Array(o);n{e.read=function(t,e,r,i,n){var o,s,h=8*n-i-1,u=(1<>1,f=-7,l=r?n-1:0,c=r?-1:1,p=t[e+l];for(l+=c,o=p&(1<<-f)-1,p>>=-f,f+=h;f>0;o=256*o+t[e+l],l+=c,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=i;f>0;s=256*s+t[e+l],l+=c,f-=8);if(0===o)o=1-a;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,i),o-=a}return(p?-1:1)*s*Math.pow(2,o-i)},e.write=function(t,e,r,i,n,o){var s,h,u,a=8*o-n-1,f=(1<>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:o-1,d=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(h=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+l>=1?c/u:c*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(h=0,s=f):s+l>=1?(h=(e*u-1)*Math.pow(2,n),s+=l):(h=e*Math.pow(2,l-1)*Math.pow(2,n),s=0));n>=8;t[r+p]=255&h,p+=d,h/=256,n-=8);for(s=s<0;t[r+p]=255&s,p+=d,s/=256,a-=8);t[r+p-d]|=128*m}},406:t=>{var e,r,i=t.exports={};function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(e===setTimeout)return setTimeout(t,0);if((e===n||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:n}catch(t){e=n}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var h,u=[],a=!1,f=-1;function l(){a&&h&&(a=!1,h.length?u=h.concat(u):f=-1,u.length&&c())}function c(){if(!a){var t=s(l);a=!0;for(var e=u.length;e;){for(h=u,u=[];++f1)for(var r=1;r{}},e={};function r(i){var n=e[i];if(void 0!==n)return n.exports;var o=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{"use strict";const t={NODE_ENV:"production"}.EXTENSION_PREFIX||"",e=`${t}page`,i=`${t}content`;let n,o,s=0;class h{constructor(t){n=t}get(t){return n("pub(accounts.list)",{anyType:t})}subscribe(t){return n("pub(accounts.subscribe)",null,t).catch((t=>console.error(t))),()=>{}}}class u{constructor(t){o=t}get(){return o("pub(metadata.list)")}provide(t){return o("pub(metadata.provide)",t)}}var a=r(161),f=r.n(a);function l(t){return t.toString().padStart(2,"0")}var c=r(801);const p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this"),d="function"==typeof p.BigInt&&"function"==typeof p.BigInt.asIntN?p.BigInt:()=>Number.NaN;var m=r(834).Buffer,g=r(406);"function"==typeof d&&d.asIntN;const y=void 0!==m,v="object"==typeof g;function w(t){return"function"==typeof t}var M=r(834).Buffer;function b(t){return y&&w(t&&t.readDoubleLE)&&M.isBuffer(t)}function _(t){return(t&&t.constructor)===Uint8Array||t instanceof Uint8Array}const B=new Array(256),E=new Array(65536),A={},I={};for(let t=0;t<256;t++){const e=t.toString(16).padStart(2,"0");B[t]=e,A[e]=t}for(let t=0;t<256;t++)for(let e=0;e<256;e++){const r=B[t]+B[e],i=t<<8|e;E[i]=r,I[r]=i}function U(t){const e=t.length%2,r=t.length-e,i=new DataView(t.buffer,t.byteOffset);let n="";for(let t=0;ti?n-i:0,h=new DataView(o.buffer,s),u=(n-s)%2,a=n-s-u;for(let t=0;t0&&t.length>i?`${U(t.subarray(0,i/2))}…${U(t.subarray(t.length-i/2))}`:U(t):""}`}(k(t)):function(t){if(t&&function(t){return!!t&&"object"==typeof t}(t)&&t.constructor===Object){const e={};for(const r of Object.keys(t))e[r]=$(t[r]);return e}return t}(t)}function C(t,e,r,i=-1){if(1===r.length&&w(r[0])){const n=r[0]();return C(t,e,Array.isArray(n)?n:[n],i)}var n,o;console[N[t]](`${(o=new Date).getFullYear().toString()}-${l(o.getMonth()+1)}-${l(o.getDate())} ${l(o.getHours())}:${l(o.getMinutes())}:${l(o.getSeconds())}`,e,...r.map($).map((n=i,t=>{if(n<=0)return t;const e=`${t}`;return e.lengthC("debug",e,t,i):P,error:(...t)=>C("error",e,t),log:(...t)=>C("log",e,t),noop:P,warn:(...t)=>C("warn",e,t)}}("PostMessageProvider");let D,z;class W{#eventemitter;#isConnected=!1;#subscriptions={};constructor(t){this.#eventemitter=new(f()),D=t}clone(){return new W(D)}async connect(){console.error("PostMessageProvider.disconnect() is not implemented.")}async disconnect(){console.error("PostMessageProvider.disconnect() is not implemented.")}get hasSubscriptions(){return!0}get isConnected(){return this.#isConnected}listProviders(){return D("pub(rpc.listProviders)",void 0)}on(t,e){return this.#eventemitter.on(t,e),()=>{this.#eventemitter.removeListener(t,e)}}async send(t,e,r,i){if(i){const{callback:r,type:n}=i,o=await D("pub(rpc.subscribe)",{method:t,params:e,type:n},(t=>{i.callback(null,t)}));return this.#subscriptions[`${n}::${o}`]=r,o}return D("pub(rpc.send)",{method:t,params:e})}async startProvider(t){this.#isConnected=!1,this.#eventemitter.emit("disconnected");const e=await D("pub(rpc.startProvider)",t);return D("pub(rpc.subscribeConnected)",null,(t=>(this.#isConnected=t,t?this.#eventemitter.emit("connected"):this.#eventemitter.emit("disconnected"),!0))),e}subscribe(t,e,r,i){return this.send(e,r,!1,{callback:i,type:t})}async unsubscribe(t,e,r){const i=`${t}::${r}`;return void 0===this.#subscriptions[i]?(F.debug((()=>`Unable to find active subscription=${i}`)),!1):(delete this.#subscriptions[i],this.send(e,[r]))}}let Y=0;class G{constructor(t){z=t}async signPayload(t){const e=++Y;return{...await z("pub(extrinsic.sign)",t),id:e}}async signRaw(t){const e=++Y;return{...await z("pub(bytes.sign)",t),id:e}}}const V={};function X(r,i,n){return new Promise(((o,h)=>{const u=`${t}.${Date.now()}.${++s}`;V[u]={reject:h,resolve:o,subscriber:n};const a={id:u,message:r,origin:e,request:i||null};window.postMessage(a,"*")}))}async function K(t){return await X("pub(authorize.tab)",{origin:t}),new class{constructor(t){this.accounts=new h(t),this.metadata=new u(t),this.provider=new W(t),this.signer=new G(t)}}(X)}function H(){!function(t,{name:e,version:r}){const i=window;i.injectedWeb3=i.injectedWeb3||{},i.injectedWeb3[e]={enable:e=>t(e),version:r}}(K,{name:"polkadot-js",version:"0.44.1"})}window.addEventListener("message",(({data:t,source:e})=>{e===window&&t.origin===i&&(t.id?function(t){const e=V[t.id];e?(e.subscriber||delete V[t.id],t.subscription?e.subscriber(t.subscription):t.error?e.reject(new Error(t.error)):e.resolve(t.response)):console.error(`Unknown response: ${JSON.stringify(t)}`)}(t):console.error("Missing id for response."))})),async function(){return await X("pub(phishing.redirectIfDenied)")}().then((t=>{t||H()})).catch((t=>{console.warn(`Unable to determine if the site is in the phishing list: ${t.message}`),H()}))})()})(); \ No newline at end of file +(()=>{var t={48801:function(t,i,r){!function(t,i){"use strict";function e(t,i){if(!t)throw new Error(i||"Assertion failed")}function n(t,i){t.super_=i;var r=function(){};r.prototype=i.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,i,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==i&&"be"!==i||(r=i,i=10),this._init(t||0,i||10,r||"be"))}var s;"object"==typeof t?t.exports=o:i.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(18983).Buffer}catch(t){}function h(t,i){var r=t.charCodeAt(i);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void e(!1,"Invalid character in "+t)}function u(t,i,r){var e=h(t,r);return r-1>=i&&(e|=h(t,r-1)<<4),e}function a(t,i,r,n){for(var o=0,s=0,h=Math.min(t.length,r),u=i;u=49?a-49+10:a>=17?a-17+10:a,e(a>=0&&s0?t:i},o.min=function(t,i){return t.cmp(i)<0?t:i},o.prototype._init=function(t,i,r){if("number"==typeof t)return this._initNumber(t,i,r);if("object"==typeof t)return this._initArray(t,i,r);"hex"===i&&(i=16),e(i===(0|i)&&i>=2&&i<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-h&67108863,(h+=24)>=26&&(h-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-h&67108863,(h+=24)>=26&&(h-=26,o++);return this._strip()},o.prototype._parseHex=function(t,i,r){this.length=Math.ceil((t.length-i)/6),this.words=new Array(this.length);for(var e=0;e=i;e-=2)n=u(t,i,e)<=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(e=(t.length-i)%2==0?i+1:i;e=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,i,r){this.words=[0],this.length=1;for(var e=0,n=1;n<=67108863;n*=i)e++;e--,n=n/i|0;for(var o=t.length-r,s=o%e,h=Math.min(o,o-s)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(t){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?""}var m=["","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"],d=[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],c=[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];function p(t,i,r){r.negative=i.negative^t.negative;var e=t.length+i.length|0;r.length=e,e=e-1|0;var n=0|t.words[0],o=0|i.words[0],s=n*o,h=67108863&s,u=s/67108864|0;r.words[0]=h;for(var a=1;a>>26,f=67108863&u,m=Math.min(a,i.length-1),d=Math.max(0,a-t.length+1);d<=m;d++){var c=a-d|0;l+=(s=(n=0|t.words[c])*(o=0|i.words[d])+f)/67108864|0,f=67108863&s}r.words[a]=0|f,u=0|l}return 0!==u?r.words[a]=0|u:r.length--,r._strip()}o.prototype.toString=function(t,i){var r;if(i=0|i||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),r=0!==o||s!==this.length-1?m[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%i!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var a=d[t],l=c[t];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var p=f.modrn(l).toString(t);r=(f=f.idivn(l)).isZero()?p+r:m[a-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%i!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}e(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&e(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(t,i){return this.toArrayLike(s,t,i)}),o.prototype.toArray=function(t,i){return this.toArrayLike(Array,t,i)},o.prototype.toArrayLike=function(t,i,r){this._strip();var n=this.byteLength(),o=r||Math.max(1,n);e(n<=o,"byte array longer than desired length"),e(o>0,"Requested array length <= 0");var s=function(t,i){return t.allocUnsafe?t.allocUnsafe(i):new t(i)}(t,o);return this["_toArrayLike"+("le"===i?"LE":"BE")](s,n),s},o.prototype._toArrayLikeLE=function(t,i){for(var r=0,e=0,n=0,o=0;n>8&255),r>16&255),6===o?(r>24&255),e=0,o=0):(e=s>>>24,o+=2)}if(r=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),e=0,o=0):(e=s>>>24,o+=2)}if(r>=0)for(t[r--]=e;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var i=t,r=0;return i>=4096&&(r+=13,i>>>=13),i>=64&&(r+=7,i>>>=7),i>=8&&(r+=4,i>>>=4),i>=2&&(r+=2,i>>>=2),r+i},o.prototype._zeroBits=function(t){if(0===t)return 26;var i=t,r=0;return 0==(8191&i)&&(r+=13,i>>>=13),0==(127&i)&&(r+=7,i>>>=7),0==(15&i)&&(r+=4,i>>>=4),0==(3&i)&&(r+=2,i>>>=2),0==(1&i)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],i=this._countBits(t);return 26*(this.length-1)+i},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,i=0;it.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var i;i=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var i,r;this.length>t.length?(i=this,r=t):(i=t,r=this);for(var e=0;et.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){e("number"==typeof t&&t>=0);var i=0|Math.ceil(t/26),r=t%26;this._expand(i),r>0&&i--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,i){e("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=i?this.words[r]|1<t.length?(r=this,e=t):(r=t,e=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var i=this.iadd(t);return t.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,e,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,e=t):(r=t,e=this);for(var o=0,s=0;s>26,this.words[s]=67108863&i;for(;0!==o&&s>26,this.words[s]=67108863&i;if(0===o&&s>>13,d=0|s[1],c=8191&d,p=d>>>13,v=0|s[2],g=8191&v,M=v>>>13,w=0|s[3],y=8191&w,b=w>>>13,_=0|s[4],A=8191&_,x=_>>>13,k=0|s[5],S=8191&k,B=k>>>13,L=0|s[6],N=8191&L,$=L>>>13,R=0|s[7],q=8191&R,C=R>>>13,j=0|s[8],E=8191&j,Z=j>>>13,P=0|s[9],U=8191&P,I=P>>>13,O=0|h[0],T=8191&O,z=O>>>13,D=0|h[1],W=8191&D,F=D>>>13,K=0|h[2],H=8191&K,G=K>>>13,J=0|h[3],X=8191&J,Y=J>>>13,Q=0|h[4],V=8191&Q,tt=Q>>>13,it=0|h[5],rt=8191&it,et=it>>>13,nt=0|h[6],ot=8191&nt,st=nt>>>13,ht=0|h[7],ut=8191&ht,at=ht>>>13,lt=0|h[8],ft=8191<,mt=lt>>>13,dt=0|h[9],ct=8191&dt,pt=dt>>>13;r.negative=t.negative^i.negative,r.length=19;var vt=(a+(e=Math.imul(f,T))|0)+((8191&(n=(n=Math.imul(f,z))+Math.imul(m,T)|0))<<13)|0;a=((o=Math.imul(m,z))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,e=Math.imul(c,T),n=(n=Math.imul(c,z))+Math.imul(p,T)|0,o=Math.imul(p,z);var gt=(a+(e=e+Math.imul(f,W)|0)|0)+((8191&(n=(n=n+Math.imul(f,F)|0)+Math.imul(m,W)|0))<<13)|0;a=((o=o+Math.imul(m,F)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,e=Math.imul(g,T),n=(n=Math.imul(g,z))+Math.imul(M,T)|0,o=Math.imul(M,z),e=e+Math.imul(c,W)|0,n=(n=n+Math.imul(c,F)|0)+Math.imul(p,W)|0,o=o+Math.imul(p,F)|0;var Mt=(a+(e=e+Math.imul(f,H)|0)|0)+((8191&(n=(n=n+Math.imul(f,G)|0)+Math.imul(m,H)|0))<<13)|0;a=((o=o+Math.imul(m,G)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,e=Math.imul(y,T),n=(n=Math.imul(y,z))+Math.imul(b,T)|0,o=Math.imul(b,z),e=e+Math.imul(g,W)|0,n=(n=n+Math.imul(g,F)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,F)|0,e=e+Math.imul(c,H)|0,n=(n=n+Math.imul(c,G)|0)+Math.imul(p,H)|0,o=o+Math.imul(p,G)|0;var wt=(a+(e=e+Math.imul(f,X)|0)|0)+((8191&(n=(n=n+Math.imul(f,Y)|0)+Math.imul(m,X)|0))<<13)|0;a=((o=o+Math.imul(m,Y)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,e=Math.imul(A,T),n=(n=Math.imul(A,z))+Math.imul(x,T)|0,o=Math.imul(x,z),e=e+Math.imul(y,W)|0,n=(n=n+Math.imul(y,F)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,F)|0,e=e+Math.imul(g,H)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(M,H)|0,o=o+Math.imul(M,G)|0,e=e+Math.imul(c,X)|0,n=(n=n+Math.imul(c,Y)|0)+Math.imul(p,X)|0,o=o+Math.imul(p,Y)|0;var yt=(a+(e=e+Math.imul(f,V)|0)|0)+((8191&(n=(n=n+Math.imul(f,tt)|0)+Math.imul(m,V)|0))<<13)|0;a=((o=o+Math.imul(m,tt)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,e=Math.imul(S,T),n=(n=Math.imul(S,z))+Math.imul(B,T)|0,o=Math.imul(B,z),e=e+Math.imul(A,W)|0,n=(n=n+Math.imul(A,F)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,F)|0,e=e+Math.imul(y,H)|0,n=(n=n+Math.imul(y,G)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,G)|0,e=e+Math.imul(g,X)|0,n=(n=n+Math.imul(g,Y)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,Y)|0,e=e+Math.imul(c,V)|0,n=(n=n+Math.imul(c,tt)|0)+Math.imul(p,V)|0,o=o+Math.imul(p,tt)|0;var bt=(a+(e=e+Math.imul(f,rt)|0)|0)+((8191&(n=(n=n+Math.imul(f,et)|0)+Math.imul(m,rt)|0))<<13)|0;a=((o=o+Math.imul(m,et)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,e=Math.imul(N,T),n=(n=Math.imul(N,z))+Math.imul($,T)|0,o=Math.imul($,z),e=e+Math.imul(S,W)|0,n=(n=n+Math.imul(S,F)|0)+Math.imul(B,W)|0,o=o+Math.imul(B,F)|0,e=e+Math.imul(A,H)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(x,H)|0,o=o+Math.imul(x,G)|0,e=e+Math.imul(y,X)|0,n=(n=n+Math.imul(y,Y)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,Y)|0,e=e+Math.imul(g,V)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,tt)|0,e=e+Math.imul(c,rt)|0,n=(n=n+Math.imul(c,et)|0)+Math.imul(p,rt)|0,o=o+Math.imul(p,et)|0;var _t=(a+(e=e+Math.imul(f,ot)|0)|0)+((8191&(n=(n=n+Math.imul(f,st)|0)+Math.imul(m,ot)|0))<<13)|0;a=((o=o+Math.imul(m,st)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,e=Math.imul(q,T),n=(n=Math.imul(q,z))+Math.imul(C,T)|0,o=Math.imul(C,z),e=e+Math.imul(N,W)|0,n=(n=n+Math.imul(N,F)|0)+Math.imul($,W)|0,o=o+Math.imul($,F)|0,e=e+Math.imul(S,H)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(B,H)|0,o=o+Math.imul(B,G)|0,e=e+Math.imul(A,X)|0,n=(n=n+Math.imul(A,Y)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,Y)|0,e=e+Math.imul(y,V)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,tt)|0,e=e+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,et)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,et)|0,e=e+Math.imul(c,ot)|0,n=(n=n+Math.imul(c,st)|0)+Math.imul(p,ot)|0,o=o+Math.imul(p,st)|0;var At=(a+(e=e+Math.imul(f,ut)|0)|0)+((8191&(n=(n=n+Math.imul(f,at)|0)+Math.imul(m,ut)|0))<<13)|0;a=((o=o+Math.imul(m,at)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,e=Math.imul(E,T),n=(n=Math.imul(E,z))+Math.imul(Z,T)|0,o=Math.imul(Z,z),e=e+Math.imul(q,W)|0,n=(n=n+Math.imul(q,F)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,F)|0,e=e+Math.imul(N,H)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul($,H)|0,o=o+Math.imul($,G)|0,e=e+Math.imul(S,X)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,Y)|0,e=e+Math.imul(A,V)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,tt)|0,e=e+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,et)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,et)|0,e=e+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,e=e+Math.imul(c,ut)|0,n=(n=n+Math.imul(c,at)|0)+Math.imul(p,ut)|0,o=o+Math.imul(p,at)|0;var xt=(a+(e=e+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,mt)|0)+Math.imul(m,ft)|0))<<13)|0;a=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,e=Math.imul(U,T),n=(n=Math.imul(U,z))+Math.imul(I,T)|0,o=Math.imul(I,z),e=e+Math.imul(E,W)|0,n=(n=n+Math.imul(E,F)|0)+Math.imul(Z,W)|0,o=o+Math.imul(Z,F)|0,e=e+Math.imul(q,H)|0,n=(n=n+Math.imul(q,G)|0)+Math.imul(C,H)|0,o=o+Math.imul(C,G)|0,e=e+Math.imul(N,X)|0,n=(n=n+Math.imul(N,Y)|0)+Math.imul($,X)|0,o=o+Math.imul($,Y)|0,e=e+Math.imul(S,V)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(B,V)|0,o=o+Math.imul(B,tt)|0,e=e+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,et)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,et)|0,e=e+Math.imul(y,ot)|0,n=(n=n+Math.imul(y,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0,e=e+Math.imul(g,ut)|0,n=(n=n+Math.imul(g,at)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,at)|0,e=e+Math.imul(c,ft)|0,n=(n=n+Math.imul(c,mt)|0)+Math.imul(p,ft)|0,o=o+Math.imul(p,mt)|0;var kt=(a+(e=e+Math.imul(f,ct)|0)|0)+((8191&(n=(n=n+Math.imul(f,pt)|0)+Math.imul(m,ct)|0))<<13)|0;a=((o=o+Math.imul(m,pt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,e=Math.imul(U,W),n=(n=Math.imul(U,F))+Math.imul(I,W)|0,o=Math.imul(I,F),e=e+Math.imul(E,H)|0,n=(n=n+Math.imul(E,G)|0)+Math.imul(Z,H)|0,o=o+Math.imul(Z,G)|0,e=e+Math.imul(q,X)|0,n=(n=n+Math.imul(q,Y)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,Y)|0,e=e+Math.imul(N,V)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul($,V)|0,o=o+Math.imul($,tt)|0,e=e+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,et)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,et)|0,e=e+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,e=e+Math.imul(y,ut)|0,n=(n=n+Math.imul(y,at)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,at)|0,e=e+Math.imul(g,ft)|0,n=(n=n+Math.imul(g,mt)|0)+Math.imul(M,ft)|0,o=o+Math.imul(M,mt)|0;var St=(a+(e=e+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,pt)|0)+Math.imul(p,ct)|0))<<13)|0;a=((o=o+Math.imul(p,pt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,e=Math.imul(U,H),n=(n=Math.imul(U,G))+Math.imul(I,H)|0,o=Math.imul(I,G),e=e+Math.imul(E,X)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(Z,X)|0,o=o+Math.imul(Z,Y)|0,e=e+Math.imul(q,V)|0,n=(n=n+Math.imul(q,tt)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,tt)|0,e=e+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,et)|0)+Math.imul($,rt)|0,o=o+Math.imul($,et)|0,e=e+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,st)|0,e=e+Math.imul(A,ut)|0,n=(n=n+Math.imul(A,at)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,at)|0,e=e+Math.imul(y,ft)|0,n=(n=n+Math.imul(y,mt)|0)+Math.imul(b,ft)|0,o=o+Math.imul(b,mt)|0;var Bt=(a+(e=e+Math.imul(g,ct)|0)|0)+((8191&(n=(n=n+Math.imul(g,pt)|0)+Math.imul(M,ct)|0))<<13)|0;a=((o=o+Math.imul(M,pt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,e=Math.imul(U,X),n=(n=Math.imul(U,Y))+Math.imul(I,X)|0,o=Math.imul(I,Y),e=e+Math.imul(E,V)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(Z,V)|0,o=o+Math.imul(Z,tt)|0,e=e+Math.imul(q,rt)|0,n=(n=n+Math.imul(q,et)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,et)|0,e=e+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul($,ot)|0,o=o+Math.imul($,st)|0,e=e+Math.imul(S,ut)|0,n=(n=n+Math.imul(S,at)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,at)|0,e=e+Math.imul(A,ft)|0,n=(n=n+Math.imul(A,mt)|0)+Math.imul(x,ft)|0,o=o+Math.imul(x,mt)|0;var Lt=(a+(e=e+Math.imul(y,ct)|0)|0)+((8191&(n=(n=n+Math.imul(y,pt)|0)+Math.imul(b,ct)|0))<<13)|0;a=((o=o+Math.imul(b,pt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,e=Math.imul(U,V),n=(n=Math.imul(U,tt))+Math.imul(I,V)|0,o=Math.imul(I,tt),e=e+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,et)|0)+Math.imul(Z,rt)|0,o=o+Math.imul(Z,et)|0,e=e+Math.imul(q,ot)|0,n=(n=n+Math.imul(q,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,e=e+Math.imul(N,ut)|0,n=(n=n+Math.imul(N,at)|0)+Math.imul($,ut)|0,o=o+Math.imul($,at)|0,e=e+Math.imul(S,ft)|0,n=(n=n+Math.imul(S,mt)|0)+Math.imul(B,ft)|0,o=o+Math.imul(B,mt)|0;var Nt=(a+(e=e+Math.imul(A,ct)|0)|0)+((8191&(n=(n=n+Math.imul(A,pt)|0)+Math.imul(x,ct)|0))<<13)|0;a=((o=o+Math.imul(x,pt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,e=Math.imul(U,rt),n=(n=Math.imul(U,et))+Math.imul(I,rt)|0,o=Math.imul(I,et),e=e+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(Z,ot)|0,o=o+Math.imul(Z,st)|0,e=e+Math.imul(q,ut)|0,n=(n=n+Math.imul(q,at)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,at)|0,e=e+Math.imul(N,ft)|0,n=(n=n+Math.imul(N,mt)|0)+Math.imul($,ft)|0,o=o+Math.imul($,mt)|0;var $t=(a+(e=e+Math.imul(S,ct)|0)|0)+((8191&(n=(n=n+Math.imul(S,pt)|0)+Math.imul(B,ct)|0))<<13)|0;a=((o=o+Math.imul(B,pt)|0)+(n>>>13)|0)+($t>>>26)|0,$t&=67108863,e=Math.imul(U,ot),n=(n=Math.imul(U,st))+Math.imul(I,ot)|0,o=Math.imul(I,st),e=e+Math.imul(E,ut)|0,n=(n=n+Math.imul(E,at)|0)+Math.imul(Z,ut)|0,o=o+Math.imul(Z,at)|0,e=e+Math.imul(q,ft)|0,n=(n=n+Math.imul(q,mt)|0)+Math.imul(C,ft)|0,o=o+Math.imul(C,mt)|0;var Rt=(a+(e=e+Math.imul(N,ct)|0)|0)+((8191&(n=(n=n+Math.imul(N,pt)|0)+Math.imul($,ct)|0))<<13)|0;a=((o=o+Math.imul($,pt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,e=Math.imul(U,ut),n=(n=Math.imul(U,at))+Math.imul(I,ut)|0,o=Math.imul(I,at),e=e+Math.imul(E,ft)|0,n=(n=n+Math.imul(E,mt)|0)+Math.imul(Z,ft)|0,o=o+Math.imul(Z,mt)|0;var qt=(a+(e=e+Math.imul(q,ct)|0)|0)+((8191&(n=(n=n+Math.imul(q,pt)|0)+Math.imul(C,ct)|0))<<13)|0;a=((o=o+Math.imul(C,pt)|0)+(n>>>13)|0)+(qt>>>26)|0,qt&=67108863,e=Math.imul(U,ft),n=(n=Math.imul(U,mt))+Math.imul(I,ft)|0,o=Math.imul(I,mt);var Ct=(a+(e=e+Math.imul(E,ct)|0)|0)+((8191&(n=(n=n+Math.imul(E,pt)|0)+Math.imul(Z,ct)|0))<<13)|0;a=((o=o+Math.imul(Z,pt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863;var jt=(a+(e=Math.imul(U,ct))|0)+((8191&(n=(n=Math.imul(U,pt))+Math.imul(I,ct)|0))<<13)|0;return a=((o=Math.imul(I,pt))+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863,u[0]=vt,u[1]=gt,u[2]=Mt,u[3]=wt,u[4]=yt,u[5]=bt,u[6]=_t,u[7]=At,u[8]=xt,u[9]=kt,u[10]=St,u[11]=Bt,u[12]=Lt,u[13]=Nt,u[14]=$t,u[15]=Rt,u[16]=qt,u[17]=Ct,u[18]=jt,0!==a&&(u[19]=a,r.length++),r};function g(t,i,r){r.negative=i.negative^t.negative,r.length=t.length+i.length;for(var e=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=h,e=s,s=n}return 0!==e?r.words[o]=e:r.length--,r._strip()}function M(t,i,r){return g(t,i,r)}function w(t,i){this.x=t,this.y=i}Math.imul||(v=p),o.prototype.mulTo=function(t,i){var r=this.length+t.length;return 10===this.length&&10===t.length?v(this,t,i):r<63?p(this,t,i):r<1024?g(this,t,i):M(this,t,i)},w.prototype.makeRBT=function(t){for(var i=new Array(t),r=o.prototype._countBits(t)-1,e=0;e>=1;return e},w.prototype.permute=function(t,i,r,e,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*i;s>=26,r+=o/67108864|0,r+=s>>>26,this.words[n]=67108863&s}return 0!==r&&(this.words[n]=r,this.length++),i?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var i=function(t){for(var i=new Array(t.bitLength()),r=0;r>>n&1}return i}(t);if(0===i.length)return new o(1);for(var r=this,e=0;e=0);var i,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(i=0;i>>26-r}s&&(this.words[i]=s,this.length++)}if(0!==n){for(i=this.length-1;i>=0;i--)this.words[i+n]=this.words[i];for(i=0;i=0),n=i?(i-i%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),h=67108863^67108863>>>o<s)for(this.length-=s,a=0;a=0&&(0!==l||a>=n);a--){var f=0|this.words[a];this.words[a]=l<<26-o|f>>>o,l=f&h}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,i,r){return e(0===this.negative),this.iushrn(t,i,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){e("number"==typeof t&&t>=0);var i=t%26,r=(t-i)/26,n=1<=0);var i=t%26,r=(t-i)/26;if(e(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==i&&r++,this.length=Math.min(r,this.length),0!==i){var n=67108863^67108863>>>i<=67108864;i++)this.words[i]-=67108864,i===this.length-1?this.words[i+1]=1:this.words[i+1]++;return this.length=Math.max(this.length,i+1),this},o.prototype.isubn=function(t){if(e("number"==typeof t),e(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var i=0;i>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===h)return this._strip();for(e(-1===h),h=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,i){var r=(this.length,t.length),e=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),e.iushln(r),s=0|n.words[n.length-1]);var h,u=e.length-n.length;if("mod"!==i){(h=new o(null)).length=u+1,h.words=new Array(h.length);for(var a=0;a=0;f--){var m=67108864*(0|e.words[n.length+f])+(0|e.words[n.length+f-1]);for(m=Math.min(m/s|0,67108863),e._ishlnsubmul(n,m,f);0!==e.negative;)m--,e.negative=0,e._ishlnsubmul(n,1,f),e.isZero()||(e.negative^=1);h&&(h.words[f]=m)}return h&&h._strip(),e._strip(),"div"!==i&&0!==r&&e.iushrn(r),{div:h||null,mod:e}},o.prototype.divmod=function(t,i,r){return e(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(h=this.neg().divmod(t,i),"mod"!==i&&(n=h.div.neg()),"div"!==i&&(s=h.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(h=this.divmod(t.neg(),i),"mod"!==i&&(n=h.div.neg()),{div:n,mod:h.mod}):0!=(this.negative&t.negative)?(h=this.neg().divmod(t.neg(),i),"div"!==i&&(s=h.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:h.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===i?{div:this.divn(t.words[0]),mod:null}:"mod"===i?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,i);var n,s,h},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var i=this.divmod(t);if(i.mod.isZero())return i.div;var r=0!==i.div.negative?i.mod.isub(t):i.mod,e=t.ushrn(1),n=t.andln(1),o=r.cmp(e);return o<0||1===n&&0===o?i.div:0!==i.div.negative?i.div.isubn(1):i.div.iaddn(1)},o.prototype.modrn=function(t){var i=t<0;i&&(t=-t),e(t<=67108863);for(var r=(1<<26)%t,n=0,o=this.length-1;o>=0;o--)n=(r*n+(0|this.words[o]))%t;return i?-n:n},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var i=t<0;i&&(t=-t),e(t<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*r;this.words[n]=o/t|0,r=o%t}return this._strip(),i?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){e(0===t.negative),e(!t.isZero());var i=this,r=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var n=new o(1),s=new o(0),h=new o(0),u=new o(1),a=0;i.isEven()&&r.isEven();)i.iushrn(1),r.iushrn(1),++a;for(var l=r.clone(),f=i.clone();!i.isZero();){for(var m=0,d=1;0==(i.words[0]&d)&&m<26;++m,d<<=1);if(m>0)for(i.iushrn(m);m-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(l),s.isub(f)),n.iushrn(1),s.iushrn(1);for(var c=0,p=1;0==(r.words[0]&p)&&c<26;++c,p<<=1);if(c>0)for(r.iushrn(c);c-- >0;)(h.isOdd()||u.isOdd())&&(h.iadd(l),u.isub(f)),h.iushrn(1),u.iushrn(1);i.cmp(r)>=0?(i.isub(r),n.isub(h),s.isub(u)):(r.isub(i),h.isub(n),u.isub(s))}return{a:h,b:u,gcd:r.iushln(a)}},o.prototype._invmp=function(t){e(0===t.negative),e(!t.isZero());var i=this,r=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var n,s=new o(1),h=new o(0),u=r.clone();i.cmpn(1)>0&&r.cmpn(1)>0;){for(var a=0,l=1;0==(i.words[0]&l)&&a<26;++a,l<<=1);if(a>0)for(i.iushrn(a);a-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,m=1;0==(r.words[0]&m)&&f<26;++f,m<<=1);if(f>0)for(r.iushrn(f);f-- >0;)h.isOdd()&&h.iadd(u),h.iushrn(1);i.cmp(r)>=0?(i.isub(r),s.isub(h)):(r.isub(i),h.isub(s))}return(n=0===i.cmpn(1)?s:h).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var i=this.clone(),r=t.clone();i.negative=0,r.negative=0;for(var e=0;i.isEven()&&r.isEven();e++)i.iushrn(1),r.iushrn(1);for(;;){for(;i.isEven();)i.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=i.cmp(r);if(n<0){var o=i;i=r,r=o}else if(0===n||0===r.cmpn(1))break;i.isub(r)}return r.iushln(e)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){e("number"==typeof t);var i=t%26,r=(t-i)/26,n=1<>>26,h&=67108863,this.words[s]=h}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var i,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)i=1;else{r&&(t=-t),e(t<=67108863,"Number is too big");var n=0|this.words[0];i=n===t?0:nt.length)return 1;if(this.length=0;r--){var e=0|this.words[r],n=0|t.words[r];if(e!==n){en&&(i=1);break}}return i},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return e(!this.red,"Already a number in reduction context"),e(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return e(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return e(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return e(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return e(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return e(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return e(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return e(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return e(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return e(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return e(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return e(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return e(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return e(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return e(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return e(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function b(t,i){this.name=t,this.p=new o(i,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var i=o._prime(t);this.m=i.p,this.prime=i}else e(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function B(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}b.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var i,r=t;do{this.split(r,this.tmp),i=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(i>this.n);var e=i0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(t,i){t.iushrn(this.n,0,i)},b.prototype.imulK=function(t){return t.imul(this.k)},n(_,b),_.prototype.split=function(t,i){for(var r=4194303,e=Math.min(t.length,9),n=0;n>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},_.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var i=0,r=0;r>>=26,t.words[r]=n,i=e}return 0!==i&&(t.words[t.length++]=i),t},o._prime=function(t){if(y[t])return y[t];var i;if("k256"===t)i=new _;else if("p224"===t)i=new A;else if("p192"===t)i=new x;else{if("p25519"!==t)throw new Error("Unknown prime "+t);i=new k}return y[t]=i,i},S.prototype._verify1=function(t){e(0===t.negative,"red works only with positives"),e(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,i){e(0==(t.negative|i.negative),"red works only with positives"),e(t.red&&t.red===i.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,i){this._verify2(t,i);var r=t.add(i);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,i){this._verify2(t,i);var r=t.iadd(i);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,i){this._verify2(t,i);var r=t.sub(i);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,i){this._verify2(t,i);var r=t.isub(i);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,i){return this._verify1(t),this.imod(t.ushln(i))},S.prototype.imul=function(t,i){return this._verify2(t,i),this.imod(t.imul(i))},S.prototype.mul=function(t,i){return this._verify2(t,i),this.imod(t.mul(i))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var i=this.m.andln(3);if(e(i%2==1),3===i){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);e(!n.isZero());var h=new o(1).toRed(this),u=h.redNeg(),a=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,a).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,n),m=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),c=s;0!==d.cmp(h);){for(var p=d,v=0;0!==p.cmp(h);v++)p=p.redSqr();e(v=0;e--){for(var a=i.words[e],l=u-1;l>=0;l--){var f=a>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==f||0!==s?(s<<=1,s|=f,(4==++h||0===e&&0===l)&&(n=this.mul(n,r[s]),h=0,s=0)):h=0}u=26}return n},S.prototype.convertTo=function(t){var i=t.umod(this.m);return i===t?i.clone():i},S.prototype.convertFrom=function(t){var i=t.clone();return i.red=null,i},o.mont=function(t){return new B(t)},n(B,S),B.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},B.prototype.convertFrom=function(t){var i=this.imod(t.mul(this.rinv));return i.red=null,i},B.prototype.imul=function(t,i){if(t.isZero()||i.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(i),e=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(e).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},B.prototype.mul=function(t,i){if(t.isZero()||i.isZero())return new o(0)._forceRed(this);var r=t.mul(i),e=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(e).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},B.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},10161:t=>{"use strict";var i=Object.prototype.hasOwnProperty,r="~";function e(){}function n(t,i,r){this.fn=t,this.context=i,this.once=r||!1}function o(t,i,e,o,s){if("function"!=typeof e)throw new TypeError("The listener must be a function");var h=new n(e,o||t,s),u=r?r+i:i;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],h]:t._events[u].push(h):(t._events[u]=h,t._eventsCount++),t}function s(t,i){0==--t._eventsCount?t._events=new e:delete t._events[i]}function h(){this._events=new e,this._eventsCount=0}Object.create&&(e.prototype=Object.create(null),(new e).__proto__||(r=!1)),h.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)i.call(t,e)&&n.push(r?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},h.prototype.listeners=function(t){var i=r?r+t:t,e=this._events[i];if(!e)return[];if(e.fn)return[e.fn];for(var n=0,o=e.length,s=new Array(o);n{}},i={};function r(e){var n=i[e];if(void 0!==n)return n.exports;var o=i[e]={id:e,loaded:!1,exports:{}};return t[e].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{"use strict";const t="polkadot{.js}",i=`${t||"unknown"}-0x6e10e163a1550e8d`,e=`${i}-page`,n=`${i}-content`;let o,s,h=0;class u{constructor(t){o=t}get(t){return o("pub(accounts.list)",{anyType:t})}subscribe(t){let i=null;return o("pub(accounts.subscribe)",null,t).then((t=>{i=t})).catch(console.error),()=>{i&&o("pub(accounts.unsubscribe)",{id:i}).catch(console.error)}}}class a{constructor(t){s=t}get(){return s("pub(metadata.list)")}provide(t){return s("pub(metadata.provide)",t)}}var l=r(10161);const f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this");function m(t,i){return void 0===f[t]?i:f[t]}function d(t){return t.toString().padStart(2,"0")}var c=r(48801);function p(){return Number.NaN}const v=m("BigInt",p),g=("function"==typeof v&&v.asIntN,"function"==typeof f.Buffer&&"function"==typeof f.Buffer.isBuffer);function M(t){return"function"==typeof t}function w(t){return g&&!!t&&M(t.readDoubleLE)&&f.Buffer.isBuffer(t)}function y(t){return(t&&t.constructor)===Uint8Array||t instanceof Uint8Array}f.process;const b=new Array(256),_=new Array(65536);for(let t=0;t<256;t++)b[t]=t.toString(16).padStart(2,"0");for(let t=0;t<256;t++){const i=t<<8;for(let r=0;r<256;r++)_[i|r]=b[t]+b[r]}function A(t,i){const r=t.length%2|0,e=t.length-r|0;for(let r=0;r9&&(k[0|x[t].toUpperCase().charCodeAt(0)]=0|t);for(let t=0;t<256;t++){const i=t<<8;for(let r=0;r<256;r++)S[i|r]=k[t]<<4|k[r]}const B=/^0x[\da-fA-F]+$/;class L{encode(t){const i=t.length,r=new Uint8Array(i);for(let e=0;e0){const r=Math.ceil(i/8);if(t.length>r)return`${A(t.subarray(0,r/2),e)}…${A(t.subarray(t.length-r/2),"")}`}return A(t,e)}(function(t){return y(t)?w(t)?new Uint8Array(t):t:function(t,i=-1,r){return"string"==typeof t&&("0x"===t||B.test(t))&&(-1===i?r||t.length%2==0:t.length===2+Math.ceil(i/4))}(t)?function(t,i=-1){if(!t)return new Uint8Array;let r=t.startsWith("0x")?2:0;const e=Math.ceil((t.length-r)/2),n=Math.ceil(-1===i?e:i/8),o=new Uint8Array(n);for(let i=n>e?n-e:0;i{if(n<=0)return t;const i=`${t}`;return i.lengthC("debug",i,t,e):$,error:(...t)=>C("error",i,t),log:(...t)=>C("log",i,t),noop:$,warn:(...t)=>C("warn",i,t)}}("PostMessageProvider");let U,I;class O{#t;#i=!1;#r={};constructor(t){this.#t=new l,U=t}get isClonable(){return!0}clone(){return new O(U)}async connect(){console.error("PostMessageProvider.disconnect() is not implemented.")}async disconnect(){console.error("PostMessageProvider.disconnect() is not implemented.")}get hasSubscriptions(){return!0}get isConnected(){return this.#i}listProviders(){return U("pub(rpc.listProviders)",void 0)}on(t,i){return this.#t.on(t,i),()=>{this.#t.removeListener(t,i)}}async send(t,i,r,e){if(e){const{callback:r,type:n}=e,o=await U("pub(rpc.subscribe)",{method:t,params:i,type:n},(t=>{e.callback(null,t)}));return this.#r[`${n}::${o}`]=r,o}return U("pub(rpc.send)",{method:t,params:i})}async startProvider(t){this.#i=!1,this.#t.emit("disconnected");const i=await U("pub(rpc.startProvider)",t);return U("pub(rpc.subscribeConnected)",null,(t=>(this.#i=t,t?this.#t.emit("connected"):this.#t.emit("disconnected"),!0))),i}subscribe(t,i,r,e){return this.send(i,r,!1,{callback:e,type:t})}async unsubscribe(t,i,r){const e=`${t}::${r}`;return void 0===this.#r[e]?(P.debug((()=>`Unable to find active subscription=${e}`)),!1):(delete this.#r[e],this.send(i,[r]))}}let T=0;class z{constructor(t){I=t}async signPayload(t){const i=++T;return{...await I("pub(extrinsic.sign)",t),id:i}}async signRaw(t){const i=++T;return{...await I("pub(bytes.sign)",t),id:i}}}const D=class{accounts;metadata;provider;signer;constructor(t){this.accounts=new u(t),this.metadata=new a(t),this.provider=new O(t),this.signer=new z(t),setInterval((()=>{t("pub(ping)",null).catch((()=>{console.error("Extension unavailable, ping failed")}))}),5e3+Math.floor(5e3*Math.random()))}},W={};function F(i,r,n){return new Promise(((o,s)=>{const u=`${t}.${Date.now()}.${++h}`;W[u]={reject:s,resolve:o,subscriber:n};const a={id:u,message:i,origin:e,request:r||null};window.postMessage(a,"*")}))}async function K(t){return await F("pub(authorize.tab)",{origin:t}),new D(F)}const H=!1;function G(){!function(t,{name:i,version:r}){const e=window;e.injectedWeb3=e.injectedWeb3||{},H?e.injectedWeb3[function(t,i=Date.now()){let r=3735928559^i,e=1103547991^i;for(let i=0,n=t.length;i>>16,2246822507)^Math.imul(e^e>>>13,3266489909),e=Math.imul(e^e>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),(e>>>0).toString(16).padStart(8,"0")+(r>>>0).toString(16).padStart(8,"0")}(`${i}/${r}`)]={connect:e=>t(e).then((({accounts:t,metadata:e,provider:n,signer:o})=>({accounts:t,metadata:e,name:i,provider:n,signer:o,version:r}))),enable:()=>Promise.reject(new Error("This extension does not have support for enable(...), rather is only supports the new connect(...) variant (no extension name/version metadata without specific user-approval)"))}:e.injectedWeb3[i]={enable:i=>t(i),version:r}}(K,{name:"polkadot-js",version:"0.52.2"})}window.addEventListener("message",(({data:t,source:i})=>{i===window&&t.origin===n&&(t.id?function(t){const i=W[t.id];i?(i.subscriber||delete W[t.id],t.subscription?i.subscriber(t.subscription):t.error?i.reject(new Error(t.error)):i.resolve(t.response)):console.error(`Unknown response: ${JSON.stringify(t)}`)}(t):console.error("Missing id for response."))})),async function(){return await F("pub(phishing.redirectIfDenied)")}().then((t=>{t||G()})).catch((t=>{console.warn(`Unable to determine if the site is in the phishing list: ${t.message}`),G()}))})()})(); \ No newline at end of file diff --git a/tests/polkadot_wallet/theme.css b/tests/polkadot_wallet/theme.css new file mode 100644 index 000000000..e0ec803f0 --- /dev/null +++ b/tests/polkadot_wallet/theme.css @@ -0,0 +1,92 @@ +body { + margin: 0; + overflow-x: hidden; + text-align: center; +} + +div#root { + box-sizing: border-box; + height: calc(100vh - 2px); + margin: 0 auto; + max-width: 100%; + padding: 0; + text-align: left; + width: 560px; +} + +:root { + /* general items */ + --borderRadius: 4px; + --boxLineHeight: 1rem; + --boxMargin: 0.75rem 0; + --boxPadding: 0 0.25rem; + --fontFamily: Nunito, sans-serif; + --fontSize: 16px; + --inputLabelFontSize: 10px; + --labelFontSize: 13px; + --labelLineHeight: 18px; + --lineHeight: 26px; + /* shared colors */ + --accountDotsIconColor: #8E8E8E; + --buttonBackground: #E86F00; + --buttonBackgroundDangerHover: #D93B3B; + --buttonBackgroundHover: #ED9329; + --buttonTextColor: #FFFFFF; + --connectedDotColor: seagreen; + --errorColor: #E42F2F; + --iconWarningColor: #FF7D01; + --identiconBackground: #F4F5F8; + --primaryColor: #FF7D01; +} + +[data-theme="dark"] { + --addAccountImageBackground: #1A1B20; + --backButtonBackground: #3A3B41; + --backButtonBackgroundHover: #3a3b41ad; + --backButtonTextColor: #FFFFFF; + --background: #26272C; + --bodyColor: #20222A; + --boxBackground: #1A1B20; + --boxBorderColor: #303030; + --boxShadow: rgba(0, 0, 0, 0.86); + --buttonBackgroundDanger: #AF1111; + --errorBorderColor: #7E3530; + --highlightedAreaBackground: #212226; + --iconDangerColor: #AF1111; + --iconNeutralColor: #8E8E8E; + --inputBackground: #111218; + --inputBorderColor: #43444B; + --labelColor: #9F9E99; + --parentLabelColor: #4A7463; + --popupBackground: #38393F; + --readonlyInputBackground: #1A1B20; + --subTextColor: #DDD; + --textColor: #FFFFFF; + --textColorDanger: #FF8686; +} + +[data-theme="light"] { + --addAccountImageBackground: #FFF; + --backButtonBackground: #D7D7D7; + --backButtonBackgroundHover: #d7d7d7ad; + --backButtonTextColor: #454545; + --background: #FAFAFA; + --bodyColor: #FFFFFF; + --boxBackground: #FFFFFF; + --boxBorderColor: #DADFEA; + --boxShadow: rgba(0, 0, 0, 0.3); + --buttonBackgroundDanger: #DC2222; + --errorBorderColor: #E42F2F; + --highlightedAreaBackground: #EFEFEF; + --iconDangerColor: #DC2222; + --iconNeutralColor: #939CB1; + --inputBackground: #FFFFFF; + --inputBorderColor: #DDE1EB; + --labelColor: #333333; + --parentLabelColor: #215B4F; + --popupBackground: #FFFFFF; + --readonlyInputBackground: #FFF; + --subTextColor: #454545; + --textColor: #242529; + --textColorDanger: #F24A4A; +} diff --git a/tests/test_specs/assets-evm.spec.ts b/tests/test_specs/assets-evm.spec.ts index 8d12c4577..9df58dc90 100644 --- a/tests/test_specs/assets-evm.spec.ts +++ b/tests/test_specs/assets-evm.spec.ts @@ -1,5 +1,4 @@ -import { Page, expect } from '@playwright/test'; -import { ApiPromise } from '@polkadot/api'; +import { expect } from '@playwright/test'; import { clickDisclaimerButton } from 'src/modules/playwright'; import { changeNetworkOnEVM, @@ -7,42 +6,32 @@ import { createMetamaskAccount, signInMetamask, } from '../common'; -import { getApi } from '../common-api'; -import { getWindow, test } from '../fixtures'; +import { test } from '../fixtures'; -let api: ApiPromise; -test.beforeAll(async () => { - api = await getApi(); -}); - -test.afterAll(async () => { - await api.disconnect(); -}); - -test.beforeEach(async ({ page, context, browser }) => { - await page.goto('/astar/assets'); +test.describe('account panel', () => { + test.beforeEach(async ({ page, context }) => { + await page.goto('/astar/assets'); - // memo Metamask tabs gots focus, switch to the portal tab - page.bringToFront(); + // memo Metamask tabs gots focus, switch to the portal tab + page.bringToFront(); - await clickDisclaimerButton(page); - await createMetamaskAccount( - page, - 'bottom drive obey lake curtain smoke basket hold race lonely fit walk', - 'Test' - ); - await signInMetamask(page, context); - await page.goto('/astar/assets'); - await page.locator('.btn--connect').click(); - await page.getByText('MetaMask').click(); - const metamaskWindow = await connectWithEVM(page, context); - await changeNetworkOnEVM(page, context, metamaskWindow); + await clickDisclaimerButton(page); + await createMetamaskAccount( + page, + 'bottom drive obey lake curtain smoke basket hold race lonely fit walk', + 'Test' + ); + await signInMetamask(page, context); + await page.goto('/astar/assets'); + await page.locator('.btn--connect').click(); + await page.getByText('MetaMask').click(); + const metamaskWindow = await connectWithEVM(page, context); + await changeNetworkOnEVM(page, context, metamaskWindow); - await page.waitForSelector('.modal-close', { state: 'hidden' }); - await expect(page.getByText('Select a Wallet')).toBeHidden(); -}); + await page.waitForSelector('.modal-close', { state: 'hidden' }); + await expect(page.getByText('Select a Wallet')).toBeHidden(); + }); -test.describe('account panel', () => { test('Display EVM native token', async ({ page, context }) => { const ui = page.getByTestId('evm-native-token'); await expect(ui).toBeVisible(); diff --git a/tests/test_specs/assets-transactions-evm.spec.ts b/tests/test_specs/assets-transactions-evm.spec.ts new file mode 100644 index 000000000..82f0eda55 --- /dev/null +++ b/tests/test_specs/assets-transactions-evm.spec.ts @@ -0,0 +1,121 @@ +// import { clickDisclaimerButton } from 'src/modules/playwright'; +// import { BrowserContext, Page, expect } from '@playwright/test'; +// import { test } from '../fixtures'; +// import { +// ALICE_ACCOUNT_NAME, +// ALICE_ACCOUNT_SEED, +// ALICE_EVM_ADDRESS, +// BOB_ACCOUNT_NAME, +// BOB_ACCOUNT_SEED, +// BOB_ADDRESS, +// closePolkadotWelcomePopup, +// connectToNetwork, +// createAccount, +// createMetamaskAccount, +// selectAccount, +// signInMetamask, +// signTransaction, +// connectWithEVM, +// changeNetworkOnEVM, +// } from '../common'; +// import { ApiPromise } from '@polkadot/api'; +// import { getApi, getBalance } from '../common-api'; + +// let api: ApiPromise; +// test.beforeAll(async () => { +// api = await getApi(); +// }); + +// test.afterAll(async () => { +// await api.disconnect(); +// }); + +// test.beforeEach(async ({ page, context }: { page: Page; context: BrowserContext }) => { +// await page.goto('/astar/assets'); +// await clickDisclaimerButton(page); +// const walletTab = page.getByTestId('select-wallet-tab'); +// await walletTab.click(); +// await page.getByTestId('Polkadot.js').click(); + +// await closePolkadotWelcomePopup(context); +// await createAccount(page, ALICE_ACCOUNT_SEED, ALICE_ACCOUNT_NAME); +// await createAccount(page, BOB_ACCOUNT_SEED, BOB_ACCOUNT_NAME); +// await createMetamaskAccount( +// page, +// 'bottom drive obey lake curtain smoke basket hold race lonely fit walk', +// 'Test' +// ); +// await page.goto('/astar/assets'); +// await connectToNetwork(page); +// await selectAccount(page, ALICE_ACCOUNT_NAME, context); +// }); + +// test.describe('account panel', () => { +// // Test case: AS002 +// test('should transfer tokens from Alice to Bob on EVM account', async ({ +// page, +// context, +// }: { +// page: Page; +// context: BrowserContext; +// }) => { +// // transfer test (from native to evm) :: need to testing +// // page.getByTestId('transfer-link-button').click(); +// // const faucetAmount = BigInt(200); +// // await page.getByPlaceholder('Destination Address').fill(ALICE_EVM_ADDRESS); +// // await page.getByPlaceholder('0').fill(faucetAmount.toString()); +// // await page.locator('.box--warning label').check(); +// // await page.getByRole('button', { name: 'Confirm' }).click(); +// // await signTransaction(context); +// // await page.waitForSelector('.four', { state: 'hidden' }); +// // await expect(page.getByText('Success')).toBeVisible(); + +// //metamask setup +// await page.getByTestId('select-account').click(); +// // await page.locator('.wrapper--modal-drawer .modal-close').first().click(); +// await page.getByText('MetaMask').click(); +// await signInMetamask(page, context); + +// //transfer test (from evm to native) +// await page.goto('/custom-node/assets/transfer?token=astr&mode=local'); +// await page.getByTestId('select-account').click(); +// await page.getByText('MetaMask').click(); +// const metamaskWindow = await connectWithEVM(page, context); +// await changeNetworkOnEVM(page, context, metamaskWindow); +// await page.waitForSelector('.modal-close', { state: 'hidden' }); +// await expect(page.getByText('Select a Wallet')).toBeHidden(); + +// const baseTransferAmount = BigInt(10); +// //BOB_ADDRESS > ALICE_EVM_ADDRESS +// const bobBalanceBeforeTransaction = await getBalance(BOB_ADDRESS); +// const overTransferAmount = bobBalanceBeforeTransaction + baseTransferAmount; +// await page.getByPlaceholder('Destination Address').fill(BOB_ADDRESS); +// await page.getByPlaceholder('0').fill(overTransferAmount.toString()); +// await expect(page.getByText('the funds will likely be lost')).toBeVisible(); +// await expect(page.getByText('Insufficient')).toBeVisible(); + +// // Invalid destination address +// await page.getByPlaceholder('Destination Address').fill('invalid address'); +// await page.getByPlaceholder('0').fill('0'); +// await expect(page.getByText('Inputted invalid destination address')).toBeVisible(); + +// // transfer alice_evm to native +// await page.getByPlaceholder('Destination Address').fill(BOB_ADDRESS); +// await page.getByPlaceholder('0').fill(baseTransferAmount.toString()); +// await page.locator('.box--warning label').check(); +// await expect(page.getByRole('button', { name: 'Confirm' })).toBeDisabled(); + +// // MEMO: There's an issue where the balance between from and to of metamask is different, so this should be solved in another PR. +// // await page.getByRole('button', { name: 'Confirm' }).click(); + +// // send transaction +// // await signTransaction(context); +// // await page.waitForSelector('.four', { state: 'hidden' }); + +// // await expect(page.getByText('Success')).toBeVisible(); +// // const bobBalanceAfterTransaction = await getBalance(BOB_ADDRESS); +// // expect(bobBalanceAfterTransaction - bobBalanceBeforeTransaction).toEqual( +// // transferAmount * BigInt(Math.pow(10, chainDecimals)) +// // ); +// }); +// }); diff --git a/tests/test_specs/assets-transactions.spec.ts b/tests/test_specs/assets-transactions.spec.ts index 9e515f2cd..8789a4656 100644 --- a/tests/test_specs/assets-transactions.spec.ts +++ b/tests/test_specs/assets-transactions.spec.ts @@ -17,43 +17,32 @@ import { selectMultisigAccount, signTransaction, } from '../common'; -import { ApiPromise } from '@polkadot/api'; -import { chainDecimals, getApi, getBalance } from '../common-api'; -import { wait } from '@astar-network/astar-sdk-core'; - -let api: ApiPromise; -test.beforeAll(async () => { - api = await getApi(); -}); - -test.afterAll(async () => { - await api.disconnect(); -}); - -test.beforeEach(async ({ page, context }: { page: Page; context: BrowserContext }) => { - // TODO consider moving this into beforeAll - await page.goto('/astar/assets'); - await clickDisclaimerButton(page); - const walletTab = page.getByTestId('select-wallet-tab'); - await walletTab.click(); - const polkadotJsButton = page.getByText('Polkadot.js'); - await polkadotJsButton.click(); - - await closePolkadotWelcomePopup(context); - await createAccount(page, ALICE_ACCOUNT_SEED, ALICE_ACCOUNT_NAME); - await createAccount(page, BOB_ACCOUNT_SEED, BOB_ACCOUNT_NAME); - await page.goto('/astar/assets'); - await connectToNetwork(page); - await selectAccount(page, ALICE_ACCOUNT_NAME); -}); +import { chainDecimals, getBalance } from '../common-api'; test.describe('account panel', () => { + test.beforeEach(async ({ page, context }: { page: Page; context: BrowserContext }) => { + // TODO consider moving this into beforeAll + await page.goto('/astar/assets'); + await clickDisclaimerButton(page); + const walletTab = page.getByTestId('select-wallet-tab'); + await walletTab.click(); + const polkadotJsButton = page.getByTestId('Polkadot.js'); + await polkadotJsButton.click(); + + await closePolkadotWelcomePopup(context); + await createAccount(page, ALICE_ACCOUNT_SEED, ALICE_ACCOUNT_NAME); + await createAccount(page, BOB_ACCOUNT_SEED, BOB_ACCOUNT_NAME); + await page.goto('/astar/assets'); + await connectToNetwork(page); + await selectAccount(page, ALICE_ACCOUNT_NAME, context); + }); + // Test case: AS001 - test('should transfer tokens from Alice to Bob', async ({ page, context }) => { + test('should transfer native tokens from Alice to Bob', async ({ page, context }) => { const transferAmount = BigInt(1000); - page.getByTestId('transfer-link-button').click(); + await page.getByTestId('transfer-link-button').click(); await page.getByPlaceholder('Destination Address').fill(BOB_ADDRESS); - await page.getByPlaceholder('0.0').fill(transferAmount.toString()); + await page.getByPlaceholder('0').fill(transferAmount.toString()); await page.getByRole('button', { name: 'Confirm' }).click(); const bobBalanceBeforeTransaction = await getBalance(BOB_ADDRESS); @@ -67,13 +56,13 @@ test.describe('account panel', () => { ); }); - test('should transfer tokens from Multisig account to Bob', async ({ page, context }) => { + test('should transfer native tokens from Multisig account to Bob', async ({ page, context }) => { await selectMultisigAccount(page, context, false); // Memo: PolkaSafe SDK will check the balance of the Multisig account on mainnet before sending the transaction (the SDK through an error if the balance is not enough) const transferAmount = BigInt(1); - page.getByTestId('transfer-link-button').click(); + await page.getByTestId('transfer-link-button').click(); await page.getByPlaceholder('Destination Address').fill(BOB_ADDRESS); - await page.getByPlaceholder('0.0').fill(transferAmount.toString()); + await page.getByPlaceholder('0').fill(transferAmount.toString()); await page.getByRole('button', { name: 'Confirm' }).click(); const isMultisigTxSignButtonVisible = await checkIsMultisigTxSignButtonVisible(context); expect(isMultisigTxSignButtonVisible).toBe(true); @@ -83,9 +72,9 @@ test.describe('account panel', () => { await selectMultisigAccount(page, context, true); // Memo: PolkaSafe SDK will check the balance of the Multisig account on mainnet before sending the transaction (the SDK through an error if the balance is not enough) const transferAmount = BigInt(1); - page.getByTestId('transfer-link-button').click(); + await page.getByTestId('transfer-link-button').click(); await page.getByPlaceholder('Destination Address').fill(BOB_ADDRESS); - await page.getByPlaceholder('0.0').fill(transferAmount.toString()); + await page.getByPlaceholder('0').fill(transferAmount.toString()); await page.getByRole('button', { name: 'Confirm' }).click(); const isMultisigTxSignButtonVisible = await checkIsMultisigTxSignButtonVisible(context); expect(isMultisigTxSignButtonVisible).toBe(true); @@ -98,24 +87,24 @@ test.describe('account panel', () => { page: Page; }) => { const baseTransferAmount = BigInt(1000); - page.getByTestId('transfer-link-button').click(); + await page.getByTestId('transfer-link-button').click(); const aliceBalanceBeforeTransaction = await getBalance(ALICE_ADDRESS); await page.getByPlaceholder('Destination Address').fill(BOB_ADDRESS); // Insufficient balance const transferAmount = aliceBalanceBeforeTransaction + baseTransferAmount; - await page.getByPlaceholder('0.0').fill(transferAmount.toString()); + await page.getByPlaceholder('0').fill(transferAmount.toString()); await expect(page.getByText('Insufficient')).toBeVisible(); // Invalid destination address await page.getByPlaceholder('Destination Address').fill('invalid address'); - await page.getByPlaceholder('0.0').fill(baseTransferAmount.toString()); + await page.getByPlaceholder('0').fill(baseTransferAmount.toString()); await expect(page.getByText('Inputted invalid destination address')).toBeVisible(); // Send to exchanges warning is shown on Native const TEST_EVM_ADDRESS = '0xEf1c6E67703c7BD7107eed8303Fbe6EC2554BF6B'; await page.getByPlaceholder('Destination Address').fill(TEST_EVM_ADDRESS); - await page.getByPlaceholder('0.0').fill(baseTransferAmount.toString()); + await page.getByPlaceholder('0').fill(baseTransferAmount.toString()); await expect(page.getByText('the funds will likely be lost')).toBeVisible(); }); @@ -127,10 +116,10 @@ test.describe('account panel', () => { page: Page; context: BrowserContext; }) => { - page.getByTestId('transfer-link-button').click(); + await page.getByTestId('transfer-link-button').click(); const faucetAmount = BigInt(200); await page.getByPlaceholder('Destination Address').fill(ALICE_EVM_ADDRESS); - await page.getByPlaceholder('0.0').fill(faucetAmount.toString()); + await page.getByPlaceholder('0').fill(faucetAmount.toString()); await page.locator('.box--warning label').check(); await page.getByRole('button', { name: 'Confirm' }).click(); await signTransaction(context); @@ -144,18 +133,21 @@ test.describe('account panel', () => { }: { page: Page; }) => { - await page.goto('/astar/assets/transfer?token=astr&from=astar&to=acala&mode=xcm'); + await page.getByTestId('transfer-link-button').click(); + await page.getByText('Cross-chain Transfer').click(); + await page.locator('#app--main').getByRole('button').nth(3).click(); + const baseTransferAmount = BigInt(5); const lowerTransferAmount = BigInt(3); const aliceBalanceBeforeTransaction = await getBalance(ALICE_ADDRESS); // Insufficient balance const transferAmount = aliceBalanceBeforeTransaction + baseTransferAmount; - await page.getByPlaceholder('0.0').fill(transferAmount.toString()); + await page.getByPlaceholder('0').fill(transferAmount.toString()); await expect(page.getByText('Insufficient')).toBeVisible(); // Invalid minimum transfer amount - await page.getByPlaceholder('0.0').fill(lowerTransferAmount.toString()); + await page.getByPlaceholder('0').fill(lowerTransferAmount.toString()); await expect(page.getByText('Minimum transfer amount')).toBeVisible(); }); }); diff --git a/tests/test_specs/assets.spec.ts b/tests/test_specs/assets.spec.ts index 44d50068d..309909c1d 100644 --- a/tests/test_specs/assets.spec.ts +++ b/tests/test_specs/assets.spec.ts @@ -1,6 +1,5 @@ import { clickDisclaimerButton } from 'src/modules/playwright'; import { expect } from '@playwright/test'; -import { ApiPromise } from '@polkadot/api'; import { ALICE_ACCOUNT_NAME, ALICE_ACCOUNT_SEED, @@ -12,18 +11,7 @@ import { selectAccount, selectMultisigAccount, } from '../common'; -import { getApi } from '../common-api'; import { test } from '../fixtures'; -import { wait } from '@astar-network/astar-sdk-core'; - -let api: ApiPromise; -test.beforeAll(async () => { - api = await getApi(); -}); - -test.afterAll(async () => { - await api.disconnect(); -}); test.beforeEach(async ({ page, context }) => { // TODO consider moving this into beforeAll @@ -40,7 +28,7 @@ test.beforeEach(async ({ page, context }) => { await createAccount(page, BOB_ACCOUNT_SEED, BOB_ACCOUNT_NAME); await page.goto('/astar/assets'); await connectToNetwork(page); - await selectAccount(page, ALICE_ACCOUNT_NAME); + await selectAccount(page, ALICE_ACCOUNT_NAME, context); }); test.describe('account panel', () => { diff --git a/tests/test_specs/dappstaking-register.spec.ts b/tests/test_specs/dappstaking-register.spec.ts index e0676800f..02416e81e 100644 --- a/tests/test_specs/dappstaking-register.spec.ts +++ b/tests/test_specs/dappstaking-register.spec.ts @@ -2,6 +2,8 @@ import { clickDisclaimerButton } from 'src/modules/playwright'; import { BrowserContext, Page, expect } from '@playwright/test'; import { test } from '../fixtures'; import { + ALICE_ACCOUNT_NAME, + ALICE_ACCOUNT_SEED, BOB_ACCOUNT_NAME, BOB_ACCOUNT_SEED, closePolkadotWelcomePopup, @@ -9,18 +11,6 @@ import { createAccount, selectAccount, } from '../common'; -import { ApiPromise } from '@polkadot/api'; -import { getApi } from '../common-api'; -import { wait } from '@astar-network/astar-sdk-core'; - -let api: ApiPromise; -test.beforeAll(async () => { - api = await getApi(); -}); - -test.afterAll(async () => { - await api.disconnect(); -}); test.beforeEach(async ({ page, context }: { page: Page; context: BrowserContext }) => { await page.goto('/astar/dapp-staking/discover'); @@ -33,20 +23,17 @@ test.beforeEach(async ({ page, context }: { page: Page; context: BrowserContext await polkadotJsButton.click(); await closePolkadotWelcomePopup(context); + await createAccount(page, ALICE_ACCOUNT_SEED, ALICE_ACCOUNT_NAME); await createAccount(page, BOB_ACCOUNT_SEED, BOB_ACCOUNT_NAME); - await page.goto('/astar/dapp-staking/discover'); + await page.goto('/astar/assets'); await connectToNetwork(page); await page.waitForSelector('.four', { state: 'hidden' }); // Wait for the page to load - await selectAccount(page, BOB_ACCOUNT_NAME); + await selectAccount(page, BOB_ACCOUNT_NAME, context); }); test.describe('register dApp page', () => { test('validate builder image size', async ({ page }) => { - await page - .getByRole('link', { - name: '🎉 Congrats!! your contract is approved. Please submit the details Register now', - }) - .click(); + await page.getByTestId('register-dapp-banner').click(); await page .locator('.builders--container > .card > .card--image > .slot > .card-new-item') .click(); diff --git a/tests/test_specs/dappstaking.spec.ts b/tests/test_specs/dappstaking.spec.ts index 47f16e48f..72672754f 100644 --- a/tests/test_specs/dappstaking.spec.ts +++ b/tests/test_specs/dappstaking.spec.ts @@ -1,85 +1,68 @@ -import { test, expect } from '@playwright/test'; -import { clickDisclaimerButton, checkInjectedWeb3 } from 'src/modules/playwright'; +// import { test, expect } from '@playwright/test'; +// import { clickDisclaimerButton, checkInjectedWeb3 } from 'src/modules/playwright'; -test.beforeEach(async ({ page }) => { - await page.goto('/astar/dapp-staking/discover'); -}); +// test.beforeEach(async ({ page }) => { +// await page.goto('/astar/dapp-staking/discover'); +// }); -test.describe('init screen', () => { - test('should wallet is opened', async ({ page }) => { - const walletWrapper = page.getByText('Select a Wallet'); - await expect(walletWrapper).toBeVisible(); - }); - test('should wallet is closed', async ({ page }) => { - const walletWrapper = page.getByText('Select a Wallet'); - const closeButton = page.locator('.modal-close'); - await closeButton.click(); - await expect(walletWrapper).toBeHidden(); - }); +// test.describe('init screen', () => { +// test.beforeEach(async ({ page }) => { +// await clickDisclaimerButton(page); +// }); - test('should display the connect button', async ({ page }) => { - await expect(page.getByRole('button', { name: 'box icon Connect' })).toBeVisible(); - }); +// test('check if wallet modal is opened', async ({ page }) => { +// await page.getByRole('button', { name: 'Select Wallet' }).click(); +// const walletWrapper = page.getByTestId('wallet-select'); +// await expect(walletWrapper).toBeVisible(); +// }); - test('should display the Astar button', async ({ page }) => { - await expect(page.getByRole('button', { name: 'Astar' })).toBeVisible(); - }); +// test('check if wallet modal is closed after close button is clicked', async ({ page }) => { +// await page.getByRole('button', { name: 'Select Wallet' }).click(); +// const walletWrapper = page.getByTestId('wallet-select'); +// const closeButton = page.locator('.modal-close'); +// await closeButton.click(); +// await expect(walletWrapper).toBeHidden(); +// }); - test('should display install extension popup when click Talisman button', async ({ page }) => { - await checkInjectedWeb3(page); - const button = page.locator('div').filter({ hasText: 'Talisman' }).first(); - await expect(button).toBeVisible(); - await button.click(); - }); -}); +// // test('should display the connect button', async ({ page }) => { +// // await expect(page.getByRole('button', { name: 'box icon Connect' })).toBeVisible(); +// // }); -test.describe('on dapp staking screen', () => { - test('has title', async ({ page }) => { - await expect(page).toHaveTitle(/Discover dApps/); - }); +// // test('should display the Astar button', async ({ page }) => { +// // await expect(page.getByRole('button', { name: 'Astar' })).toBeVisible(); +// // }); - test('should clickable the banner after loading is complete', async ({ page }) => { - await clickDisclaimerButton(page); - const closeButton = page.locator('.modal-close'); - await closeButton.click(); - const bannerCard = page.locator('.wrapper--banners .card:first-child'); - await expect(bannerCard).toBeVisible(); - await page.waitForSelector('.loader', { state: 'hidden' }); - await bannerCard.click(); - }); +// test('should display install extension popup when click Talisman button', async ({ page }) => { +// await checkInjectedWeb3(page); +// const button = page.locator('div').filter({ hasText: 'Talisman' }).first(); +// await expect(button).toBeVisible(); +// await button.click(); +// }); +// }); - test('should redirect to dapp page when click the dapp card', async ({ page }) => { - await clickDisclaimerButton(page); - const closeButton = page.locator('.modal-close'); - await closeButton.click(); - await page.waitForSelector('.loader', { state: 'hidden' }); - const dappCard = page.locator('.wrapper--list .card:first-child').first(); - await expect(dappCard).toBeVisible(); - await dappCard.click(); - await page.waitForURL('**/astar/dapp-staking/dapp?dapp=*'); - }); +// test.describe('on dapp staking screen', () => { +// test('has title', async ({ page }) => { +// await expect(page).toHaveTitle(/Astar Portal - Astar & Shiden Network/); +// }); - test('should display staking button when over the dapp card', async ({ page }) => { - await clickDisclaimerButton(page); - const closeButton = page.locator('.modal-close'); - await closeButton.click(); - await page.waitForSelector('.loader', { state: 'hidden' }); - const dappCard = page.locator('.wrapper--list .card:first-child').first(); - await expect(dappCard).toBeVisible(); - await dappCard.hover(); - const stakeButton = page.getByRole('button', { name: 'Stake Now' }); - await expect(stakeButton).toBeVisible(); - }); +// test('should have a clickable banner after loading is complete', async ({ page }) => { +// await clickDisclaimerButton(page); +// const closeButton = page.locator('.modal-close'); +// await closeButton.click(); +// const bannerCard = page.getByTestId('staking-banner-card').first(); +// await expect(bannerCard).toBeVisible(); +// await page.waitForSelector('.loader', { state: 'hidden' }); +// await bannerCard.click(); +// }); - test('should clickable item on the on chain data after loading is complete', async ({ page }) => { - await clickDisclaimerButton(page); - const closeButton = page.locator('.modal-close'); - await closeButton.click(); - await page.waitForSelector('.loader', { state: 'hidden' }); - const onChainCard = page - .locator('.wrapper--onchain-data .column--dapp-name:first-child') - .first(); - await expect(onChainCard).toBeVisible(); - await onChainCard.click(); - }); -}); +// test('should redirect to dapp page when click the dapp card', async ({ page }) => { +// await clickDisclaimerButton(page); +// const closeButton = page.locator('.modal-close'); +// await closeButton.click(); +// await page.waitForSelector('.loader', { state: 'hidden' }); +// const dappCard = page.getByTestId('single-dapp').first(); +// await expect(dappCard).toBeVisible(); +// await dappCard.click(); +// await page.waitForURL('**/astar/dapp-staking/dapp?dapp=*'); +// }); +// }); diff --git a/tests/test_specs/dashboard.spec.ts b/tests/test_specs/dashboard.spec.ts index 688f19cb8..071d2e28a 100644 --- a/tests/test_specs/dashboard.spec.ts +++ b/tests/test_specs/dashboard.spec.ts @@ -18,12 +18,12 @@ test.describe('on dashboard screen', () => { await expect(page).toHaveTitle(/Dashboard/); }); test('DocsBot AI answers inputted questions', async ({ page }) => { - const widget = page.locator('.docsbot-chat-container'); + const widget = page.locator('.docsbot-chat-message-container'); const botButton = page.locator('.floating-button'); await botButton.click(); - await page.getByPlaceholder('Send a message...').fill('What is the decimals of ASTR token?'); + await page.getByPlaceholder('Send a message...').fill('What is your name?'); await page.locator('.docsbot-chat-btn-send').click(); - await expect(widget.getByText('18')).toBeVisible(); + await expect(widget.getByText('Astari')).toBeVisible(); }); test('Endpoint has been selected randomly', async ({ page }) => { const selectedEndpointObj: string = (await page.evaluate(() => { @@ -44,8 +44,13 @@ test.describe('on dashboard screen', () => { await expect(ui).toBeVisible(); }); - test('display collators panel', async ({ page }) => { - const ui = page.getByTestId('collators-panel'); - await expect(ui).toBeVisible(); - }); + // test('display inflation rate chart', async ({ page }) => { + // const ui = page.getByTestId('inflation-rate-chart'); + // await expect(ui).toBeVisible(); + // }); + + // test('display inflation rate panel', async ({ page }) => { + // const ui = page.getByTestId('inflation-panel'); + // await expect(ui).toBeVisible(); + // }); }); diff --git a/tests/test_specs/reserve-transfer-asset-xcm.spec.ts b/tests/test_specs/reserve-transfer-asset-xcm.spec.ts index 138e4e0d4..2218a8a7c 100644 --- a/tests/test_specs/reserve-transfer-asset-xcm.spec.ts +++ b/tests/test_specs/reserve-transfer-asset-xcm.spec.ts @@ -5,25 +5,17 @@ import { ALICE_ACCOUNT_NAME, ALICE_ACCOUNT_SEED, ALICE_ADDRESS, + BOB_ACCOUNT_NAME, + BOB_ACCOUNT_SEED, closePolkadotWelcomePopup, connectToNetwork, createAccount, selectAccount, signTransaction, } from '../common'; -import { ApiPromise } from '@polkadot/api'; -import { chainDecimals, getApi, getBalance, roundUpAndTruncateBigInt } from '../common-api'; +import { chainDecimals, getBalance, roundUpAndTruncateBigInt } from '../common-api'; import { wait } from '@astar-network/astar-sdk-core'; -let api: ApiPromise; -test.beforeAll(async () => { - api = await getApi(); -}); - -test.afterAll(async () => { - await api.disconnect(); -}); - test.beforeEach(async ({ page, context }) => { // TODO consider moving this into beforeAll await page.goto('/astar/assets'); @@ -35,23 +27,22 @@ test.beforeEach(async ({ page, context }) => { await closePolkadotWelcomePopup(context); await createAccount(page, ALICE_ACCOUNT_SEED, ALICE_ACCOUNT_NAME); + await createAccount(page, BOB_ACCOUNT_SEED, BOB_ACCOUNT_NAME); await page.goto('/astar/assets'); await connectToNetwork(page); - await selectAccount(page, ALICE_ACCOUNT_NAME); - // Memo: wait for the page to be reloaded - await page.waitForNavigation(); + await selectAccount(page, ALICE_ACCOUNT_NAME, context); }); test.describe('Test case: XCM006', () => { test('should transfer Alice ASTR tokens from Astar to Acala', async ({ page, context }) => { + const aliceBalanceBeforeTransaction = await getBalance(ALICE_ADDRESS); const transferAmount = BigInt(1000); - page.getByTestId('transfer-link-button').click(); + + await page.getByTestId('transfer-link-button').click(); await page.getByText('Cross-chain Transfer').click(); await page.getByRole('main').getByRole('button').first().click(); await page.locator('#amount').fill(transferAmount.toString()); await page.getByRole('button', { name: 'Confirm' }).click(); - - const aliceBalanceBeforeTransaction = await getBalance(ALICE_ADDRESS); await signTransaction(context); await page.waitForSelector('.four', { state: 'hidden' }); @@ -67,8 +58,10 @@ test.describe('Test case: XCM006', () => { test.describe('Test case: XCM003', () => { test('should transfer Alice ASTR tokens from Acala to Astar', async ({ page, context }) => { - const transferAmount = BigInt(900); - page.getByTestId('transfer-link-button').click(); + const transferAmount = BigInt(9); + const aliceBalanceBeforeTransaction = await getBalance(ALICE_ADDRESS); + + await page.getByTestId('transfer-link-button').click(); await page.getByText('Cross-chain Transfer').click(); // memo wait for from/to values to switch on UI, because if switch happens after amount is entered, the amount would be cleared @@ -76,12 +69,12 @@ test.describe('Test case: XCM003', () => { await page.locator('#amount').fill(transferAmount.toString()); await page.getByRole('button', { name: 'Confirm' }).click(); - - const aliceBalanceBeforeTransaction = await getBalance(ALICE_ADDRESS); await signTransaction(context); await page.waitForSelector('.four', { state: 'hidden' }); await expect(page.getByText('Success')).toBeVisible(); + // getBalance happens to early. + await wait(5000); const aliceBalanceAfterTransaction = await getBalance(ALICE_ADDRESS); const difference = await roundUpAndTruncateBigInt( aliceBalanceAfterTransaction - aliceBalanceBeforeTransaction, @@ -94,8 +87,8 @@ test.describe('Test case: XCM003', () => { test.describe('Test case: XCM004', () => { test('should transfer Alice ACA tokens from Astar to Acala', async ({ page, context }) => { const assetId = '18446744073709551616'; - const transferAmount = BigInt(1000); - page.getByTestId('transfer-link-button').click(); + const transferAmount = BigInt(10); + await page.getByTestId('transfer-link-button').click(); await page.getByText('Cross-chain Transfer').click(); await page.getByRole('main').getByRole('button').first().click(); @@ -125,8 +118,8 @@ test.describe('Test case: XCM004', () => { test.describe('Test case: XCM001', () => { test('should transfer Alice ACA tokens from Acala to Astar', async ({ page, context }) => { const assetId = '18446744073709551616'; - const transferAmount = BigInt(900); - page.getByTestId('transfer-link-button').click(); + const transferAmount = BigInt(9); + await page.getByTestId('transfer-link-button').click(); await page.getByText('Cross-chain Transfer').click(); await page @@ -143,6 +136,8 @@ test.describe('Test case: XCM001', () => { await page.waitForSelector('.four', { state: 'hidden' }); await expect(page.getByText('Success')).toBeVisible(); + // getBalance happens to early. + await wait(5000); const aliceBalanceAfterTransaction = await getBalance(ALICE_ADDRESS, assetId); const difference = await roundUpAndTruncateBigInt( aliceBalanceAfterTransaction - aliceBalanceBeforeTransaction, @@ -156,7 +151,7 @@ test.describe('Test case: XCM001-1', () => { test('should transfer Alice DOT tokens from Polkadot to Astar', async ({ page, context }) => { const assetId = '340282366920938463463374607431768211455'; const transferAmount = BigInt(100); - page.getByTestId('transfer-link-button').click(); + await page.getByTestId('transfer-link-button').click(); await page.getByText('Cross-chain Transfer').click(); await page.locator('div:nth-child(3) > .wrapper--select-chain').click(); @@ -186,7 +181,7 @@ test.describe('Test case: XCM004-1', () => { test('should transfer Alice DOT tokens from Astar to Polkadot', async ({ page, context }) => { const assetId = '340282366920938463463374607431768211455'; const transferAmount = BigInt(100); - page.getByTestId('transfer-link-button').click(); + await page.getByTestId('transfer-link-button').click(); await page.getByText('Cross-chain Transfer').click(); await page.getByRole('main').getByRole('button').first().click(); @@ -213,50 +208,19 @@ test.describe('Test case: XCM004-1', () => { }); }); -test.describe('Test case: XCM001-2', () => { - test('should transfer Alice USDT tokens from Statemint to Astar', async ({ page, context }) => { - const assetId = '4294969280'; - const transferAmount = BigInt(10000); - page.getByTestId('transfer-link-button').click(); - await page.getByText('Cross-chain Transfer').click(); - - await page.locator('div:nth-child(3) > .wrapper--select-chain').click(); - await page - .locator('div') - .filter({ hasText: /^Statemint$/ }) - .nth(1) - .click(); - await page.locator('#amount').fill(transferAmount.toString()); - await page.getByRole('button', { name: 'Confirm' }).click(); - - const aliceBalanceBeforeTransaction = await getBalance(ALICE_ADDRESS, assetId); - await signTransaction(context); - await page.waitForSelector('.four', { state: 'hidden' }); - - await expect(page.getByText('Success')).toBeVisible(); - const aliceBalanceAfterTransaction = await getBalance(ALICE_ADDRESS, assetId); - const difference = await roundUpAndTruncateBigInt( - aliceBalanceBeforeTransaction - aliceBalanceAfterTransaction, - 6 - ); - expect(difference).toEqual(transferAmount); - }); -}); - test.describe('Test case: XCM004-2', () => { - test('should transfer Alice USDT tokens from Astar to Statemint', async ({ page, context }) => { + test('should transfer Alice USDT tokens from Astar to Asset hub', async ({ page, context }) => { const assetId = '4294969280'; const transferAmount = BigInt(10000); - page.getByTestId('transfer-link-button').click(); + await page.getByTestId('transfer-link-button').click(); await page.getByText('Cross-chain Transfer').click(); await page.getByRole('main').getByRole('button').first().click(); await page.locator('div:nth-child(3) > .wrapper--select-chain').click(); - await page - .locator('div') - .filter({ hasText: /^Statemint$/ }) - .nth(1) - .click(); + await page.getByText('Asset Hub').click(); + + // memo wait for from/to values to switch on UI, because if switch happens after amount is entered, the amount would be cleared + page.waitForTimeout(2000); await page.locator('#amount').fill(transferAmount.toString()); await page.getByRole('button', { name: 'Confirm' }).click(); @@ -273,3 +237,31 @@ test.describe('Test case: XCM004-2', () => { expect(difference).toEqual(transferAmount); }); }); + +// Getting bad proof error. Disabled for now. +// test.describe('Test case: XCM001-2', () => { +// test('should transfer Alice USDT tokens from Asset Hub to Astar', async ({ page, context }) => { +// const assetId = '4294969280'; +// const transferAmount = BigInt(9000); +// const aliceBalanceBeforeTransaction = await getBalance(ALICE_ADDRESS, assetId); + +// await page.getByTestId('transfer-link-button').click(); +// await page.getByText('Cross-chain Transfer').click(); +// await page.getByTestId('xcm-select-from-chain').click(); +// await page.getByText('Asset Hub').click(); +// // memo wait for from/to values to switch on UI, because if switch happens after amount is entered, the amount would be cleared +// page.waitForTimeout(2000); +// await page.locator('#amount').fill(transferAmount.toString()); +// await page.getByRole('button', { name: 'Confirm' }).click(); +// await signTransaction(context); +// await page.waitForSelector('.four', { state: 'hidden' }); + +// await expect(page.getByText('Success')).toBeVisible(); +// const aliceBalanceAfterTransaction = await getBalance(ALICE_ADDRESS, assetId); +// const difference = await roundUpAndTruncateBigInt( +// aliceBalanceBeforeTransaction - aliceBalanceAfterTransaction, +// 6 +// ); +// expect(difference).toEqual(transferAmount); +// }); +// }); diff --git a/tests/test_specs/sidebar.spec.ts b/tests/test_specs/sidebar.spec.ts index dc627e4e9..e2aa92636 100644 --- a/tests/test_specs/sidebar.spec.ts +++ b/tests/test_specs/sidebar.spec.ts @@ -1,11 +1,11 @@ import { test, expect } from '@playwright/test'; import { clickDisclaimerButton } from 'src/modules/playwright'; -test.beforeEach(async ({ page }) => { - await page.goto('/astar/assets'); -}); - test.describe('init screen', () => { + test.beforeEach(async ({ page }) => { + await page.goto('/astar/assets'); + }); + test('click the dapp staking page', async ({ page }) => { const dappStakingButton = page.getByTestId('dapp-staking'); await dappStakingButton.click(); diff --git a/yarn.lock b/yarn.lock index 9c73e0dfc..0fdd9e853 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,6 +7,22 @@ resolved "https://registry.yarnpkg.com/@acala-network/type-definitions/-/type-definitions-5.1.2.tgz#533b7e65e166f56607eb084a1efb44ca2bae6e98" integrity sha512-di3HH8Zn8i1jkQkQiwc44A8ovN9MvK5HwcNV3ngvW3TeF0dHbpHBQHdElJYpVge5IaEyhQ0kWihIEnVqpw4G9A== +"@actions/core@^1.10.1": + version "1.10.1" + resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.10.1.tgz#61108e7ac40acae95ee36da074fa5850ca4ced8a" + integrity sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g== + dependencies: + "@actions/http-client" "^2.0.1" + uuid "^8.3.2" + +"@actions/http-client@^2.0.1": + version "2.2.3" + resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-2.2.3.tgz#31fc0b25c0e665754ed39a9f19a8611fc6dab674" + integrity sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA== + dependencies: + tunnel "^0.0.6" + undici "^5.25.4" + "@ampproject/remapping@^2.2.0": version "2.2.1" resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630" @@ -2340,6 +2356,11 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/strings" "^5.7.0" +"@fastify/busboy@^2.0.0": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.1.tgz#b9da6a878a371829a0502c9b6c1c143ef6663f4d" + integrity sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA== + "@fragnova/api-augment@0.1.0-spec-1.0.4-mainnet": version "0.1.0-spec-1.0.4-mainnet" resolved "https://registry.yarnpkg.com/@fragnova/api-augment/-/api-augment-0.1.0-spec-1.0.4-mainnet.tgz#4244b59a5e3b5809aa95e74d8c77a2ca86056292" @@ -3399,13 +3420,13 @@ resolved "https://registry.yarnpkg.com/@phala/typedefs/-/typedefs-0.2.33.tgz#6f18d73b5104db6a594d08be571954385b3e509b" integrity sha512-CaRzIGfU6CUIKLPswYtOw/xbtTttqmJZpr3fhkxLvkBQMXIH14iISD763OFXtWui7DrAMBKo/bHawvFNgWGKTg== -"@playwright/test@^1.31.0": - version "1.32.3" - resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.32.3.tgz#75be8346d4ef289896835e1d2a86fdbe3d9be92a" - integrity sha512-BvWNvK0RfBriindxhLVabi8BRe3X0J9EVjKlcmhxjg4giWBD/xleLcg2dz7Tx0agu28rczjNIPQWznwzDwVsZQ== +"@playwright/test@1.31.2": + version "1.31.2" + resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.31.2.tgz#426d8545143a97a6fed250a2a27aa1c8e5e2548e" + integrity sha512-BYVutxDI4JeZKV1+ups6dt5WiqKhjBtIYowyZIJ3kBDmJgsuPKsqqKNIMFbUePLSCmp2cZu+BDL427RcNKTRYw== dependencies: "@types/node" "*" - playwright-core "1.32.3" + playwright-core "1.31.2" optionalDependencies: fsevents "2.3.2" @@ -16846,10 +16867,10 @@ pkg-up@^3.1.0: dependencies: find-up "^3.0.0" -playwright-core@1.32.3: - version "1.32.3" - resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.32.3.tgz#e6dc7db0b49e9b6c0b8073c4a2d789a96f519c48" - integrity sha512-SB+cdrnu74ZIn5Ogh/8278ngEh9NEEV0vR4sJFmK04h2iZpybfbqBY0bX6+BLYWVdV12JLLI+JEFtSnYgR+mWg== +playwright-core@1.31.2: + version "1.31.2" + resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.31.2.tgz#debf4b215d14cb619adb7e511c164d068075b2ed" + integrity sha512-a1dFgCNQw4vCsG7bnojZjDnPewZcw7tZUNFN0ZkcLYKj+mPmXvg4MpaaKZ5SgqPsOmqIf2YsVRkgqiRDxD+fDQ== pngjs@^5.0.0: version "5.0.0" @@ -19730,6 +19751,11 @@ tunnel-agent@^0.6.0: dependencies: safe-buffer "^5.0.1" +tunnel@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c" + integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg== + tweetnacl@1.x.x, tweetnacl@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" @@ -19876,6 +19902,13 @@ uncrypto@^0.1.3: resolved "https://registry.yarnpkg.com/uncrypto/-/uncrypto-0.1.3.tgz#e1288d609226f2d02d8d69ee861fa20d8348ef2b" integrity sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q== +undici@^5.25.4: + version "5.28.4" + resolved "https://registry.yarnpkg.com/undici/-/undici-5.28.4.tgz#6b280408edb6a1a604a9b20340f45b422e373068" + integrity sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g== + dependencies: + "@fastify/busboy" "^2.0.0" + unenv@^1.9.0: version "1.9.0" resolved "https://registry.yarnpkg.com/unenv/-/unenv-1.9.0.tgz#469502ae85be1bd3a6aa60f810972b1a904ca312"