From 9e3763ba2f78d1260b17e960bb305c947c2e4f0e Mon Sep 17 00:00:00 2001 From: Adam Lessey Date: Thu, 6 Feb 2025 13:35:18 -0500 Subject: [PATCH 1/3] poc: minikit --- create-onchain/src/cli.ts | 254 +++++- .../src/manifest/assets/browser-0t0YC0rb.js | 1 + .../src/manifest/assets/ccip-K_PoQNED.js | 1 + .../manifest/assets/hooks.module-DVREuRDX.js | 1 + .../src/manifest/assets/index-BB3bVYbY.js | 3 + .../src/manifest/assets/index-BSvUHPor.js | 12 + .../src/manifest/assets/index-TwqOwjr2.js | 272 +++++++ .../src/manifest/assets/index-zcObCFmf.css | 1 + .../manifest/assets/metamask-sdk-DfnqKdXK.js | 542 +++++++++++++ create-onchain/src/manifest/index.html | 14 + .../templates/minikit/.eslintrc.json | 3 + create-onchain/templates/minikit/.yarnrc.yml | 2 + create-onchain/templates/minikit/README.md | 39 + create-onchain/templates/minikit/_gitignore | 36 + .../app/.well-known/farcaster.json/route.ts | 22 + .../templates/minikit/app/api/notify/route.ts | 34 + .../templates/minikit/app/api/scores/route.ts | 19 + .../minikit/app/api/webhook/route.ts | 115 +++ .../minikit/app/components/Sammy.tsx | 756 ++++++++++++++++++ .../templates/minikit/app/globals.css | 27 + .../templates/minikit/app/layout.tsx | 47 ++ create-onchain/templates/minikit/app/page.tsx | 84 ++ .../templates/minikit/app/providers.tsx | 23 + .../templates/minikit/app/svg/ArrowSvg.tsx | 18 + .../templates/minikit/app/svg/MiniKitLogo.tsx | 103 +++ .../minikit/lib/notification-client.ts | 62 ++ .../templates/minikit/lib/notification.ts | 29 + create-onchain/templates/minikit/lib/redis.ts | 14 + .../templates/minikit/lib/scores-client.ts | 22 + .../templates/minikit/lib/scores.ts | 64 ++ .../templates/minikit/next.config.mjs | 12 + create-onchain/templates/minikit/package.json | 37 + .../templates/minikit/postcss.config.mjs | 8 + .../templates/minikit/public/minikit.png | Bin 0 -> 65686 bytes .../scripts/generateAccountAssociation.mjs | 156 ++++ .../scripts/validateAccountAssociation.mjs | 113 +++ .../templates/minikit/tailwind.config.ts | 22 + .../templates/minikit/tsconfig.json | 26 + package.json | 6 + src/minikit/hooks/useAddFrame.test.tsx | 76 ++ src/minikit/hooks/useAddFrame.ts | 20 + src/minikit/hooks/useAuthenticate.test.tsx | 106 +++ src/minikit/hooks/useAuthenticate.ts | 52 ++ src/minikit/hooks/useClose.test.tsx | 30 + src/minikit/hooks/useClose.ts | 8 + src/minikit/hooks/useMiniKit.test.tsx | 68 ++ src/minikit/hooks/useMiniKit.ts | 25 + src/minikit/hooks/useNotification.test.tsx | 106 +++ src/minikit/hooks/useNotification.ts | 41 + src/minikit/hooks/useOpenUrl.test.tsx | 56 ++ src/minikit/hooks/useOpenUrl.ts | 18 + src/minikit/hooks/usePrimaryButton.test.tsx | 43 + src/minikit/hooks/usePrimaryButton.ts | 16 + src/minikit/hooks/useViewProfile.test.tsx | 64 ++ src/minikit/hooks/useViewProfile.ts | 20 + src/minikit/index.ts | 8 + 56 files changed, 3747 insertions(+), 10 deletions(-) create mode 100644 create-onchain/src/manifest/assets/browser-0t0YC0rb.js create mode 100644 create-onchain/src/manifest/assets/ccip-K_PoQNED.js create mode 100644 create-onchain/src/manifest/assets/hooks.module-DVREuRDX.js create mode 100644 create-onchain/src/manifest/assets/index-BB3bVYbY.js create mode 100644 create-onchain/src/manifest/assets/index-BSvUHPor.js create mode 100644 create-onchain/src/manifest/assets/index-TwqOwjr2.js create mode 100644 create-onchain/src/manifest/assets/index-zcObCFmf.css create mode 100644 create-onchain/src/manifest/assets/metamask-sdk-DfnqKdXK.js create mode 100644 create-onchain/src/manifest/index.html create mode 100644 create-onchain/templates/minikit/.eslintrc.json create mode 100644 create-onchain/templates/minikit/.yarnrc.yml create mode 100644 create-onchain/templates/minikit/README.md create mode 100644 create-onchain/templates/minikit/_gitignore create mode 100644 create-onchain/templates/minikit/app/.well-known/farcaster.json/route.ts create mode 100644 create-onchain/templates/minikit/app/api/notify/route.ts create mode 100644 create-onchain/templates/minikit/app/api/scores/route.ts create mode 100644 create-onchain/templates/minikit/app/api/webhook/route.ts create mode 100644 create-onchain/templates/minikit/app/components/Sammy.tsx create mode 100644 create-onchain/templates/minikit/app/globals.css create mode 100644 create-onchain/templates/minikit/app/layout.tsx create mode 100644 create-onchain/templates/minikit/app/page.tsx create mode 100644 create-onchain/templates/minikit/app/providers.tsx create mode 100644 create-onchain/templates/minikit/app/svg/ArrowSvg.tsx create mode 100644 create-onchain/templates/minikit/app/svg/MiniKitLogo.tsx create mode 100644 create-onchain/templates/minikit/lib/notification-client.ts create mode 100644 create-onchain/templates/minikit/lib/notification.ts create mode 100644 create-onchain/templates/minikit/lib/redis.ts create mode 100644 create-onchain/templates/minikit/lib/scores-client.ts create mode 100644 create-onchain/templates/minikit/lib/scores.ts create mode 100644 create-onchain/templates/minikit/next.config.mjs create mode 100644 create-onchain/templates/minikit/package.json create mode 100644 create-onchain/templates/minikit/postcss.config.mjs create mode 100644 create-onchain/templates/minikit/public/minikit.png create mode 100644 create-onchain/templates/minikit/scripts/generateAccountAssociation.mjs create mode 100644 create-onchain/templates/minikit/scripts/validateAccountAssociation.mjs create mode 100644 create-onchain/templates/minikit/tailwind.config.ts create mode 100644 create-onchain/templates/minikit/tsconfig.json create mode 100644 src/minikit/hooks/useAddFrame.test.tsx create mode 100644 src/minikit/hooks/useAddFrame.ts create mode 100644 src/minikit/hooks/useAuthenticate.test.tsx create mode 100644 src/minikit/hooks/useAuthenticate.ts create mode 100644 src/minikit/hooks/useClose.test.tsx create mode 100644 src/minikit/hooks/useClose.ts create mode 100644 src/minikit/hooks/useMiniKit.test.tsx create mode 100644 src/minikit/hooks/useMiniKit.ts create mode 100644 src/minikit/hooks/useNotification.test.tsx create mode 100644 src/minikit/hooks/useNotification.ts create mode 100644 src/minikit/hooks/useOpenUrl.test.tsx create mode 100644 src/minikit/hooks/useOpenUrl.ts create mode 100644 src/minikit/hooks/usePrimaryButton.test.tsx create mode 100644 src/minikit/hooks/usePrimaryButton.ts create mode 100644 src/minikit/hooks/useViewProfile.test.tsx create mode 100644 src/minikit/hooks/useViewProfile.ts diff --git a/create-onchain/src/cli.ts b/create-onchain/src/cli.ts index 5bc37564e8..1d723c704b 100644 --- a/create-onchain/src/cli.ts +++ b/create-onchain/src/cli.ts @@ -7,16 +7,11 @@ import pc from 'picocolors'; import ora from 'ora'; import { createClickableLink, - detectPackageManager, isValidPackageName, toValidPackageName, optimizedCopy, } from './utils.js'; - -const sourceDir = path.resolve( - fileURLToPath(import.meta.url), - '../../../templates/next' -); +import { spawn } from 'child_process'; const renameFiles: Record = { _gitignore: '.gitignore', @@ -46,7 +41,205 @@ async function copyDir(src: string, dest: string) { } } -async function init() { +async function createMiniKitTemplate() { + console.log( + `${pc.greenBright(` + ///////////////////////////////////////////////////////////////////////////////////////////////// + // // + // ::: ::: ::::::::::: :::: ::: ::::::::::: ::: ::: ::::::::::: ::::::::::: // + // :+:+: :+:+: :+: :+:+: :+: :+: :+: :+: :+: :+: // + // +:+ +:+:+ +:+ +:+ :+:+:+ +:+ +:+ +:+ +:+ +:+ +:+ // + // +#+ +:+ +#+ +#+ +#+ +:+ +#+ +#+ +#++:++ +#+ +#+ // + // +#+ +#+ +#+ +#+ +#+#+# +#+ +#+ +#+ +#+ +#+ // + // #+# #+# #+# #+# #+#+# #+# #+# #+# #+# #+# // + // ### ### ######## ### #### ######## ### ### ######## ### // + // // + // Powered by OnchainKit // + /////////////////////////////////////////////////////////////////////////////////////////////////`)}\n\n` + ); + + const defaultProjectName = 'my-minikit-app'; + + let result: prompts.Answers< + 'projectName' | 'packageName' | 'clientKey' + >; + + try { + result = await prompts( + [ + { + type: 'text', + name: 'projectName', + message: pc.reset('Project name:'), + initial: defaultProjectName, + onState: (state) => { + state.value = state.value.trim(); + }, + validate: (value) => { + const targetDir = path.join(process.cwd(), value); + if ( + fs.existsSync(targetDir) && + fs.readdirSync(targetDir).length > 0 + ) { + return 'Directory already exists and is not empty. Please choose a different name.'; + } + return true; + }, + }, + { + type: (_, { projectName }: { projectName: string }) => + isValidPackageName(projectName) ? null : 'text', + name: 'packageName', + message: pc.reset('Package name:'), + initial: (_, { projectName }: { projectName: string }) => + toValidPackageName(projectName), + validate: (dir) => + isValidPackageName(dir) || 'Invalid package.json name', + }, + { + type: 'password', + name: 'clientKey', + message: pc.reset( + `Enter your ${createClickableLink( + 'Coinbase Developer Platform Client API Key:', + 'https://portal.cdp.coinbase.com/products/onchainkit' + )} (optional)` + ), + }, + ], + { + onCancel: () => { + console.log('\nProject creation cancelled.'); + process.exit(0); + }, + } + ); + } catch (cancelled: any) { + console.log(cancelled.message); + process.exit(1); + } + + const { projectName, packageName, clientKey } = result; + const root = path.join(process.cwd(), projectName); + + const spinner = ora(`Creating ${projectName}...`).start(); + + const sourceDir = path.resolve( + fileURLToPath(import.meta.url), + '../../../templates/minikit' + ); + + await copyDir(sourceDir, root); + const pkgPath = path.join(root, 'package.json'); + const pkg = JSON.parse(await fs.promises.readFile(pkgPath, 'utf-8')); + pkg.name = packageName || toValidPackageName(projectName); + await fs.promises.writeFile(pkgPath, JSON.stringify(pkg, null, 2)); + + // Create .env file + const envPath = path.join(root, '.env'); + await fs.promises.writeFile( + envPath, + `NEXT_PUBLIC_ONCHAINKIT_PROJECT_NAME=${projectName} +NEXT_PUBLIC_ONCHAINKIT_API_KEY=${clientKey} +NEXT_PUBLIC_URL= +NEXT_PUBLIC_SPLASH_IMAGE_URL=$NEXT_PUBLIC_URL/minikit.png +NEXT_PUBLIC_SPLASH_BACKGROUND_COLOR=FFFFFF +NEXT_PUBLIC_IMAGE_URL=$NEXT_PUBLIC_URL/minikit.png +NEXT_PUBLIC_ICON_URL=https://onchainkit.xyz/favicon/48x48.png +NEXT_PUBLIC_VERSION=next +REDIS_URL= +REDIS_TOKEN=` + ); + + spinner.succeed(); + + console.log(`\n${pc.magenta(`Created new MiniKit project in ${root}`)}`); + + console.log('\nWould you like to set up your Frames Account Association now?'); + console.log(pc.blue('* You can set this up later by running `npm run generate-account-association` or updating your `.env` file manually.\n')); + + let setUpFrameResult: prompts.Answers<'setUpFrame'>; + try { + setUpFrameResult = await prompts( + [ + { + type: 'toggle', + name: 'setUpFrame', + message: pc.reset('Set up Frame integration now?'), + initial: true, + active: 'yes', + inactive: 'no', + } + ], + { + onCancel: () => { + console.log('\nSetup frame cancelled.'); + process.exit(1); + }, + } + ); + } catch (cancelled: any) { + console.log(cancelled.message); + process.exit(1); + } + + const { setUpFrame } = setUpFrameResult; + if (setUpFrame) { + const scriptPath = path.resolve( + fileURLToPath(import.meta.url), + '../../../templates/minikit/scripts/generateAccountAssociation.mjs' + ); + + // spawn the generate-account-association command + const generateAccountAssociation = spawn('node', [scriptPath, root], { + stdio: 'inherit', + cwd: process.cwd(), + shell: true + }); + + generateAccountAssociation.on('close', (code: number) => { + if (code === 0) { + logMiniKitSetupSummary(projectName, root, clientKey); + } else { + console.error('Failed to generate account association'); + logMiniKitSetupSummary(projectName, root, clientKey); + } + }); + } else { + logMiniKitSetupSummary(projectName, root, clientKey); + } +} + +function logMiniKitSetupSummary(projectName: string, root: string, clientKey: string) { + console.log(`\nIntegrations:`); + + console.log(`${pc.greenBright('\u2713')} ${pc.blueBright(`MiniKit`)}`); + console.log(`${pc.greenBright('\u2713')} ${pc.blueBright(`OnchainKit`)}`); + console.log(`${pc.greenBright('\u2713')} ${pc.blueBright(`Base`)}`); + if (clientKey) { + console.log(`${pc.greenBright('\u2713')} ${pc.blueBright(`Coinbase Developer Platform`)}`); + console.log(`${pc.greenBright('\u2713')} ${pc.blueBright(`Paymaster`)}`); + } + + console.log(`\nFrameworks:`); + console.log(`${pc.cyan('- Wagmi')}`); + console.log(`${pc.cyan('- React')}`); + console.log(`${pc.cyan('- Next.js')}`); + console.log(`${pc.cyan('- Tailwind CSS')}`); + console.log(`${pc.cyan('- ESLint')}`); + console.log(`${pc.cyan('- Upstash Redis')}`); + + console.log(`\nTo get started with ${pc.green(projectName)}, run the following commands:\n`); + if (root !== process.cwd()) { + console.log(` - cd ${path.relative(process.cwd(), root)}`); + } + console.log(' - npm install'); + console.log(' - npm run dev'); + + console.log(pc.blue('\n* Don\'t forget to update the environment variables for your project in the `.env` file.')); +} + +async function createOnchainKitTemplate() { console.log( `${pc.greenBright(` ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -62,6 +255,7 @@ async function init() { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////`)}\n\n` ); + const defaultProjectName = 'my-onchainkit-app'; let result: prompts.Answers< @@ -117,7 +311,7 @@ async function init() { initial: true, active: 'yes', inactive: 'no', - }, + } ], { onCancel: () => { @@ -136,8 +330,12 @@ async function init() { const spinner = ora(`Creating ${projectName}...`).start(); + const sourceDir = path.resolve( + fileURLToPath(import.meta.url), + '../../../templates/next' + ); + await copyDir(sourceDir, root); - const pkgPath = path.join(root, 'package.json'); const pkg = JSON.parse(await fs.promises.readFile(pkgPath, 'utf-8')); pkg.name = packageName || toValidPackageName(projectName); @@ -151,7 +349,7 @@ async function init() { smartWallet ? 'smartWalletOnly' : 'all' }` ); - + spinner.succeed(); console.log(`\n${pc.magenta(`Created new OnchainKit project in ${root}`)}`); @@ -192,6 +390,42 @@ async function init() { console.log(' - npm run dev'); } +async function init() { + const isHelp = process.argv.some(arg => ['--help', '-h'].includes(arg)); + const isVersion = process.argv.some(arg => ['--version', '-v'].includes(arg)); + const isMinikit = process.argv.some(arg => ['--mini', '-m'].includes(arg)); + + if (isHelp) { + console.log( +`${pc.greenBright(` +Usage: +npm create-onchain [options] + +Creates an OnchainKit project based on nextJs. + +Options: +--version, -v: Show version +--mini, -m: Create a MiniKit project +--help, -h: Show help +`)}` + ); + process.exit(0); + } + + if (isVersion) { + const packageJsonContent = fs.readFileSync('./package.json', 'utf8'); + const packageJson = JSON.parse(packageJsonContent); + console.log(`${pc.greenBright(`v${packageJson.version}`)}`); + process.exit(0); + } + + if (isMinikit) { + await createMiniKitTemplate(); + } else { + await createOnchainKitTemplate(); + } +} + init().catch((e) => { console.error(e); }); diff --git a/create-onchain/src/manifest/assets/browser-0t0YC0rb.js b/create-onchain/src/manifest/assets/browser-0t0YC0rb.js new file mode 100644 index 0000000000..ca1584f17f --- /dev/null +++ b/create-onchain/src/manifest/assets/browser-0t0YC0rb.js @@ -0,0 +1 @@ +var b={exports:{}},A,x;function S(){if(x)return A;x=1;var u=1e3,i=u*60,C=i*60,r=C*24,h=r*7,m=r*365.25;A=function(t,e){e=e||{};var n=typeof t;if(n==="string"&&t.length>0)return d(t);if(n==="number"&&isFinite(t))return e.long?p(t):g(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function d(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),s=(e[2]||"ms").toLowerCase();switch(s){case"years":case"year":case"yrs":case"yr":case"y":return n*m;case"weeks":case"week":case"w":return n*h;case"days":case"day":case"d":return n*r;case"hours":case"hour":case"hrs":case"hr":case"h":return n*C;case"minutes":case"minute":case"mins":case"min":case"m":return n*i;case"seconds":case"second":case"secs":case"sec":case"s":return n*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function g(t){var e=Math.abs(t);return e>=r?Math.round(t/r)+"d":e>=C?Math.round(t/C)+"h":e>=i?Math.round(t/i)+"m":e>=u?Math.round(t/u)+"s":t+"ms"}function p(t){var e=Math.abs(t);return e>=r?o(t,e,r,"day"):e>=C?o(t,e,C,"hour"):e>=i?o(t,e,i,"minute"):e>=u?o(t,e,u,"second"):t+" ms"}function o(t,e,n,s){var a=e>=n*1.5;return Math.round(t/n)+" "+s+(a?"s":"")}return A}var k,M;function L(){if(M)return k;M=1;function u(i){r.debug=r,r.default=r,r.coerce=o,r.disable=g,r.enable=m,r.enabled=p,r.humanize=S(),r.destroy=t,Object.keys(i).forEach(e=>{r[e]=i[e]}),r.names=[],r.skips=[],r.formatters={};function C(e){let n=0;for(let s=0;s{if(v==="%%")return"%";w++;const I=r.formatters[O];if(typeof I=="function"){const q=l[w];v=I.call(f,q),l.splice(w,1),w--}return v}),r.formatArgs.call(f,l),(f.log||r.log).apply(f,l)}return c.namespace=e,c.useColors=r.useColors(),c.color=r.selectColor(e),c.extend=h,c.destroy=r.destroy,Object.defineProperty(c,"enabled",{enumerable:!0,configurable:!1,get:()=>s!==null?s:(a!==r.namespaces&&(a=r.namespaces,F=r.enabled(e)),F),set:l=>{s=l}}),typeof r.init=="function"&&r.init(c),c}function h(e,n){const s=r(this.namespace+(typeof n>"u"?":":n)+e);return s.log=this.log,s}function m(e){r.save(e),r.namespaces=e,r.names=[],r.skips=[];const n=(typeof e=="string"?e:"").trim().replace(" ",",").split(",").filter(Boolean);for(const s of n)s[0]==="-"?r.skips.push(s.slice(1)):r.names.push(s)}function d(e,n){let s=0,a=0,F=-1,c=0;for(;s"-"+n)].join(",");return r.enable(""),e}function p(e){for(const n of r.skips)if(d(e,n))return!1;for(const n of r.names)if(d(e,n))return!0;return!1}function o(e){return e instanceof Error?e.stack||e.message:e}function t(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}return k=u,k}var E;function z(){return E||(E=1,function(u,i){var C={};i.formatArgs=h,i.save=m,i.load=d,i.useColors=r,i.storage=g(),i.destroy=(()=>{let o=!1;return()=>{o||(o=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),i.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let o;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(o=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(o[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function h(o){if(o[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+o[0]+(this.useColors?"%c ":" ")+"+"+u.exports.humanize(this.diff),!this.useColors)return;const t="color: "+this.color;o.splice(1,0,t,"color: inherit");let e=0,n=0;o[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(e++,s==="%c"&&(n=e))}),o.splice(n,0,t)}i.log=console.debug||console.log||(()=>{});function m(o){try{o?i.storage.setItem("debug",o):i.storage.removeItem("debug")}catch{}}function d(){let o;try{o=i.storage.getItem("debug")}catch{}return!o&&typeof process<"u"&&"env"in process&&(o=C.DEBUG),o}function g(){try{return localStorage}catch{}}u.exports=L()(i);const{formatters:p}=u.exports;p.j=function(o){try{return JSON.stringify(o)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}(b,b.exports)),b.exports}export{z as r}; diff --git a/create-onchain/src/manifest/assets/ccip-K_PoQNED.js b/create-onchain/src/manifest/assets/ccip-K_PoQNED.js new file mode 100644 index 0000000000..97c80376ed --- /dev/null +++ b/create-onchain/src/manifest/assets/ccip-K_PoQNED.js @@ -0,0 +1 @@ +import{B as p,d as m,e as y,f as k,i as b,h as O,j as E,k as L,H as h,l as x}from"./index-TwqOwjr2.js";class M extends p{constructor({callbackSelector:r,cause:a,data:o,extraData:i,sender:d,urls:t}){var n;super(a.shortMessage||"An error occurred while fetching for an offchain result.",{cause:a,metaMessages:[...a.metaMessages||[],(n=a.metaMessages)!=null&&n.length?"":[],"Offchain Gateway Call:",t&&[" Gateway URL(s):",...t.map(f=>` ${m(f)}`)],` Sender: ${d}`,` Data: ${o}`,` Callback selector: ${r}`,` Extra data: ${i}`].flat(),name:"OffchainLookupError"})}}class R extends p{constructor({result:r,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${m(a)}`,`Response: ${y(r)}`],name:"OffchainLookupResponseMalformedError"})}}class S extends p{constructor({sender:r,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${a}`,`OffchainLookup sender address: ${r}`],name:"OffchainLookupSenderMismatchError"})}}const A="0x556f1830",$={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function C(c,{blockNumber:r,blockTag:a,data:o,to:i}){const{args:d}=k({data:o,abi:[$]}),[t,n,f,u,s]=d,{ccipRead:e}=c,w=e&&typeof(e==null?void 0:e.request)=="function"?e.request:T;try{if(!b(i,t))throw new S({sender:t,to:i});const l=await w({data:f,sender:t,urls:n}),{data:g}=await O(c,{blockNumber:r,blockTag:a,data:E([u,L([{type:"bytes"},{type:"bytes"}],[l,s])]),to:i});return g}catch(l){throw new M({callbackSelector:u,cause:l,data:o,extraData:s,sender:t,urls:n})}}async function T({data:c,sender:r,urls:a}){var i;let o=new Error("An unknown error occurred.");for(let d=0;d2&&(i.children=arguments.length>3?L.call(arguments,2):t),typeof e=="function"&&e.defaultProps!=null)for(r in e.defaultProps)i[r]===void 0&&(i[r]=e.defaultProps[r]);return M(e,i,n,u,null)}function M(e,_,t,n,u){var r={type:e,props:_,key:t,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:u??++v_,__i:-1,__u:0};return u==null&&m.vnode!=null&&m.vnode(r),r}function W_(){return{current:null}}function j(e){return e.children}function A(e,_){this.props=e,this.context=_}function S(e,_){if(_==null)return e.__?S(e.__,e.__i+1):null;for(var t;_c&&H.sort(g_),e=H.shift(),c=H.length,e.__d&&(t=void 0,u=(n=(_=e).__v).__e,r=[],i=[],_.__P&&((t=w({},n)).__v=n.__v+1,m.vnode&&m.vnode(t),__(_.__P,t,n,_.__n,_.__P.namespaceURI,32&n.__u?[u]:null,r,u??S(n),!!(32&n.__u),i),t.__v=n.__v,t.__.__k[t.__i]=t,P_(r,t,i),t.__e!=u&&w_(t)));B.__r=0}function C_(e,_,t,n,u,r,i,c,f,l,a){var o,p,s,g,k,b,d=n&&n.__k||$_,v=_.length;for(f=j_(t,_,d,f,v),o=0;o0?M(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=e,i.__b=e.__b+1,c=null,(l=i.__i=I_(i,t,f,o))!==-1&&(o--,(c=t[l])&&(c.__u|=2)),c==null||c.__v===null?(l==-1&&(u>a?p--:uf?p--:p++,i.__u|=4))):e.__k[r]=null;if(o)for(r=0;r(f!=null&&(2&f.__u)==0?1:0))for(u=t-1,r=t+1;u>=0||r<_.length;){if(u>=0){if((f=_[u])&&(2&f.__u)==0&&i==f.key&&c===f.type)return u;u--}if(r<_.length){if((f=_[r])&&(2&f.__u)==0&&i==f.key&&c===f.type)return r;r++}}return-1}function u_(e,_,t){_[0]=="-"?e.setProperty(_,t??""):e[_]=t==null?"":typeof t!="number"||L_.test(_)?t:t+"px"}function O(e,_,t,n,u){var r;_:if(_=="style")if(typeof t=="string")e.style.cssText=t;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(_ in n)t&&_ in t||u_(e.style,_,"");if(t)for(_ in t)n&&t[_]===n[_]||u_(e.style,_,t[_])}else if(_[0]=="o"&&_[1]=="n")r=_!=(_=_.replace(b_,"$1")),_=_.toLowerCase()in e||_=="onFocusOut"||_=="onFocusIn"?_.toLowerCase().slice(2):_.slice(2),e.l||(e.l={}),e.l[_+r]=t,t?n?t.t=n.t:(t.t=Y,e.addEventListener(_,r?J:G,r)):e.removeEventListener(_,r?J:G,r);else{if(u=="http://www.w3.org/2000/svg")_=_.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(_!="width"&&_!="height"&&_!="href"&&_!="list"&&_!="form"&&_!="tabIndex"&&_!="download"&&_!="rowSpan"&&_!="colSpan"&&_!="role"&&_!="popover"&&_ in e)try{e[_]=t??"";break _}catch{}typeof t=="function"||(t==null||t===!1&&_[4]!="-"?e.removeAttribute(_):e.setAttribute(_,_=="popover"&&t==1?"":t))}}function i_(e){return function(_){if(this.l){var t=this.l[_.type+e];if(_.u==null)_.u=Y++;else if(_.u2&&(c.children=arguments.length>3?L.call(arguments,2):t),M(e.type,c,n||e.key,u||e.ref,null)}function B_(e){function _(t){var n,u;return this.getChildContext||(n=new Set,(u={})[_.__c]=this,this.getChildContext=function(){return u},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(r){this.props.value!==r.value&&n.forEach(function(i){i.__e=!0,Q(i)})},this.sub=function(r){n.add(r);var i=r.componentWillUnmount;r.componentWillUnmount=function(){n&&n.delete(r),i&&i.call(r)}}),t.children}return _.__c="__cC"+k_++,_.__=e,_.Provider=_.__l=(_.Consumer=function(t,n){return t.children(n)}).contextType=_,_}L=$_.slice,m={__e:function(e,_,t,n){for(var u,r,i;_=_.__;)if((u=_.__c)&&!u.__)try{if((r=u.constructor)&&r.getDerivedStateFromError!=null&&(u.setState(r.getDerivedStateFromError(e)),i=u.__d),u.componentDidCatch!=null&&(u.componentDidCatch(e,n||{}),i=u.__d),i)return u.__E=u}catch(c){e=c}throw e}},v_=0,m_=function(e){return e!=null&&e.constructor==null},A.prototype.setState=function(e,_){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=w({},this.state),typeof e=="function"&&(e=e(w({},t),this.props)),e&&w(t,e),e!=null&&this.__v&&(_&&this._sb.push(_),Q(this))},A.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Q(this))},A.prototype.render=j,H=[],y_=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,g_=function(e,_){return e.__v.__b-_.__v.__b},B.__r=0,b_=/(PointerCapture)$|Capture$/i,Y=0,G=i_(!1),J=i_(!0),k_=0;const ee=Object.freeze(Object.defineProperty({__proto__:null,Component:A,Fragment:j,cloneElement:q_,createContext:B_,createElement:K,createRef:W_,h:K,hydrate:U_,get isValidElement(){return m_},get options(){return m},render:T_,toChildArray:H_},Symbol.toStringTag,{value:"Module"}));var C,h,z,l_,E=0,N_=[],y=m,c_=y.__b,f_=y.__r,s_=y.diffed,a_=y.__c,p_=y.unmount,h_=y.__;function P(e,_){y.__h&&y.__h(h,e,E||_),E=0;var t=h.__H||(h.__H={__:[],__h:[]});return e>=t.__.length&&t.__.push({}),t.__[e]}function D_(e){return E=1,M_(F_,e)}function M_(e,_,t){var n=P(C++,2);if(n.t=e,!n.__c&&(n.__=[t?t(_):F_(void 0,_),function(c){var f=n.__N?n.__N[0]:n.__[0],l=n.t(f,c);f!==l&&(n.__N=[l,n.__[1]],n.__c.setState({}))}],n.__c=h,!h.__f)){var u=function(c,f,l){if(!n.__c.__H)return!0;var a=n.__c.__H.__.filter(function(p){return!!p.__c});if(a.every(function(p){return!p.__N}))return!r||r.call(this,c,f,l);var o=n.__c.props!==c;return a.forEach(function(p){if(p.__N){var s=p.__[0];p.__=p.__N,p.__N=void 0,s!==p.__[0]&&(o=!0)}}),r&&r.call(this,c,f,l)||o};h.__f=!0;var r=h.shouldComponentUpdate,i=h.componentWillUpdate;h.componentWillUpdate=function(c,f,l){if(this.__e){var a=r;r=void 0,u(c,f,l),r=a}i&&i.call(this,c,f,l)},h.shouldComponentUpdate=u}return n.__N||n.__}function V_(e,_){var t=P(C++,3);!y.__s&&n_(t.__H,_)&&(t.__=e,t.u=_,h.__H.__h.push(t))}function A_(e,_){var t=P(C++,4);!y.__s&&n_(t.__H,_)&&(t.__=e,t.u=_,h.__h.push(t))}function z_(e){return E=5,t_(function(){return{current:e}},[])}function G_(e,_,t){E=6,A_(function(){if(typeof e=="function"){var n=e(_());return function(){e(null),n&&typeof n=="function"&&n()}}if(e)return e.current=_(),function(){return e.current=null}},t==null?t:t.concat(e))}function t_(e,_){var t=P(C++,7);return n_(t.__H,_)&&(t.__=e(),t.__H=_,t.__h=e),t.__}function J_(e,_){return E=8,t_(function(){return e},_)}function K_(e){var _=h.context[e.__c],t=P(C++,9);return t.c=e,_?(t.__==null&&(t.__=!0,_.sub(h)),_.props.value):e.__}function Q_(e,_){y.useDebugValue&&y.useDebugValue(_?_(e):e)}function X_(e){var _=P(C++,10),t=D_();return _.__=e,h.componentDidCatch||(h.componentDidCatch=function(n,u){_.__&&_.__(n,u),t[1](n)}),[t[0],function(){t[1](void 0)}]}function Y_(){var e=P(C++,11);if(!e.__){for(var _=h.__v;_!==null&&!_.__m&&_.__!==null;)_=_.__;var t=_.__m||(_.__m=[0,0]);e.__="P"+t[0]+"-"+t[1]++}return e.__}function Z_(){for(var e;e=N_.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(q),e.__H.__h.forEach(X),e.__H.__h=[]}catch(_){e.__H.__h=[],y.__e(_,e.__v)}}y.__b=function(e){h=null,c_&&c_(e)},y.__=function(e,_){e&&_.__k&&_.__k.__m&&(e.__m=_.__k.__m),h_&&h_(e,_)},y.__r=function(e){f_&&f_(e),C=0;var _=(h=e.__c).__H;_&&(z===h?(_.__h=[],h.__h=[],_.__.forEach(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(_.__h.forEach(q),_.__h.forEach(X),_.__h=[],C=0)),z=h},y.diffed=function(e){s_&&s_(e);var _=e.__c;_&&_.__H&&(_.__H.__h.length&&(N_.push(_)!==1&&l_===y.requestAnimationFrame||((l_=y.requestAnimationFrame)||_e)(Z_)),_.__H.__.forEach(function(t){t.u&&(t.__H=t.u),t.u=void 0})),z=h=null},y.__c=function(e,_){_.some(function(t){try{t.__h.forEach(q),t.__h=t.__h.filter(function(n){return!n.__||X(n)})}catch(n){_.some(function(u){u.__h&&(u.__h=[])}),_=[],y.__e(n,t.__v)}}),a_&&a_(e,_)},y.unmount=function(e){p_&&p_(e);var _,t=e.__c;t&&t.__H&&(t.__H.__.forEach(function(n){try{q(n)}catch(u){_=u}}),t.__H=void 0,_&&y.__e(_,t.__v))};var d_=typeof requestAnimationFrame=="function";function _e(e){var _,t=function(){clearTimeout(n),d_&&cancelAnimationFrame(_),setTimeout(e)},n=setTimeout(t,100);d_&&(_=requestAnimationFrame(t))}function q(e){var _=h,t=e.__c;typeof t=="function"&&(e.__c=void 0,t()),h=_}function X(e){var _=h;e.__c=e.__(),h=_}function n_(e,_){return!e||e.length!==_.length||_.some(function(t,n){return t!==e[n]})}function F_(e,_){return typeof _=="function"?_(e):_}const te=Object.freeze(Object.defineProperty({__proto__:null,useCallback:J_,useContext:K_,useDebugValue:Q_,useEffect:V_,useErrorBoundary:X_,useId:Y_,useImperativeHandle:G_,useLayoutEffect:A_,useMemo:t_,useReducer:M_,useRef:z_,useState:D_},Symbol.toStringTag,{value:"Module"}));export{T_ as E,K as _,D_ as d,te as h,ee as p,V_ as y}; diff --git a/create-onchain/src/manifest/assets/index-BB3bVYbY.js b/create-onchain/src/manifest/assets/index-BB3bVYbY.js new file mode 100644 index 0000000000..1eda52d071 --- /dev/null +++ b/create-onchain/src/manifest/assets/index-BB3bVYbY.js @@ -0,0 +1,3 @@ +import{g as Et,b as It,s as St,E as _t}from"./index-TwqOwjr2.js";import{E as be,_ as R,d as Le,y as Ct}from"./hooks.module-DVREuRDX.js";class q{constructor(e,n){this.scope=e,this.module=n}storeObject(e,n){this.setItem(e,JSON.stringify(n))}loadObject(e){const n=this.getItem(e);return n?JSON.parse(n):void 0}setItem(e,n){localStorage.setItem(this.scopedKey(e),n)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),n=[];for(let s=0;slocalStorage.removeItem(s))}scopedKey(e){return`-${this.scope}${this.module?`:${this.module}`:""}:${e}`}static clearAll(){new q("CBWSDK").clear(),new q("walletlink").clear()}}const D={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}},we={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}},Xe="Unspecified error message.",At="Unspecified server error.";function ve(t,e=Xe){if(t&&Number.isInteger(t)){const n=t.toString();if(me(we,n))return we[n].message;if(et(t))return At}return e}function Lt(t){if(!Number.isInteger(t))return!1;const e=t.toString();return!!(we[e]||et(t))}function xt(t,{shouldIncludeStack:e=!1}={}){const n={};if(t&&typeof t=="object"&&!Array.isArray(t)&&me(t,"code")&&Lt(t.code)){const s=t;n.code=s.code,s.message&&typeof s.message=="string"?(n.message=s.message,me(s,"data")&&(n.data=s.data)):(n.message=ve(n.code),n.data={originalError:xe(t)})}else n.code=D.rpc.internal,n.message=Me(t,"message")?t.message:Xe,n.data={originalError:xe(t)};return e&&(n.stack=Me(t,"stack")?t.stack:void 0),n}function et(t){return t>=-32099&&t<=-32e3}function xe(t){return t&&typeof t=="object"&&!Array.isArray(t)?Object.assign({},t):t}function me(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Me(t,e){return typeof t=="object"&&t!==null&&e in t&&typeof t[e]=="string"}const A={rpc:{parse:t=>B(D.rpc.parse,t),invalidRequest:t=>B(D.rpc.invalidRequest,t),invalidParams:t=>B(D.rpc.invalidParams,t),methodNotFound:t=>B(D.rpc.methodNotFound,t),internal:t=>B(D.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return B(e,t)},invalidInput:t=>B(D.rpc.invalidInput,t),resourceNotFound:t=>B(D.rpc.resourceNotFound,t),resourceUnavailable:t=>B(D.rpc.resourceUnavailable,t),transactionRejected:t=>B(D.rpc.transactionRejected,t),methodNotSupported:t=>B(D.rpc.methodNotSupported,t),limitExceeded:t=>B(D.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>J(D.provider.userRejectedRequest,t),unauthorized:t=>J(D.provider.unauthorized,t),unsupportedMethod:t=>J(D.provider.unsupportedMethod,t),disconnected:t=>J(D.provider.disconnected,t),chainDisconnected:t=>J(D.provider.chainDisconnected,t),unsupportedChain:t=>J(D.provider.unsupportedChain,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:n,data:s}=t;if(!n||typeof n!="string")throw new Error('"message" must be a nonempty string');return new st(e,n,s)}}};function B(t,e){const[n,s]=tt(e);return new nt(t,n||ve(t),s)}function J(t,e){const[n,s]=tt(e);return new st(t,n||ve(t),s)}function tt(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:n}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,n]}}return[]}class nt extends Error{constructor(e,n,s){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!n||typeof n!="string")throw new Error('"message" must be a nonempty string.');super(n),this.code=e,s!==void 0&&(this.data=s)}}class st extends nt{constructor(e,n,s){if(!Mt(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,n,s)}}function Mt(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}function Ee(){return t=>t}const se=Ee(),Rt=Ee(),Pt=Ee();function K(t){return Math.floor(t)}const it=/^[0-9]*$/,rt=/^[a-f0-9]*$/;function V(t){return Ie(crypto.getRandomValues(new Uint8Array(t)))}function Ie(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}function ae(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>Number.parseInt(e,16)))}function ee(t,e=!1){const n=t.toString("hex");return se(e?`0x${n}`:n)}function ce(t){return ee(ye(t),!0)}function W(t){return Pt(t.toString(10))}function Y(t){return se(`0x${BigInt(t).toString(16)}`)}function at(t){return t.startsWith("0x")||t.startsWith("0X")}function Se(t){return at(t)?t.slice(2):t}function ot(t){return at(t)?`0x${t.slice(2)}`:`0x${t}`}function oe(t){if(typeof t!="string")return!1;const e=Se(t).toLowerCase();return rt.test(e)}function Tt(t,e=!1){if(typeof t=="string"){const n=Se(t).toLowerCase();if(rt.test(n))return se(e?`0x${n}`:n)}throw A.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}function _e(t,e=!1){let n=Tt(t,!1);return n.length%2===1&&(n=se(`0${n}`)),e?se(`0x${n}`):n}function F(t){if(typeof t=="string"){const e=Se(t).toLowerCase();if(oe(e)&&e.length===40)return Rt(ot(e))}throw A.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}function ye(t){if(Buffer.isBuffer(t))return t;if(typeof t=="string"){if(oe(t)){const e=_e(t,!1);return Buffer.from(e,"hex")}return Buffer.from(t,"utf8")}throw A.rpc.invalidParams(`Not binary data: ${String(t)}`)}function te(t){if(typeof t=="number"&&Number.isInteger(t))return K(t);if(typeof t=="string"){if(it.test(t))return K(Number(t));if(oe(t))return K(Number(BigInt(_e(t,!0))))}throw A.rpc.invalidParams(`Not an integer: ${String(t)}`)}function Z(t){if(t!==null&&(typeof t=="bigint"||Nt(t)))return BigInt(t.toString(10));if(typeof t=="number")return BigInt(te(t));if(typeof t=="string"){if(it.test(t))return BigInt(t);if(oe(t))return BigInt(_e(t,!0))}throw A.rpc.invalidParams(`Not an integer: ${String(t)}`)}function Ot(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw A.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}function Nt(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}async function Dt(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}async function jt(t,e){return crypto.subtle.deriveKey({name:"ECDH",public:e},t,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function Ut(t,e){const n=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.encrypt({name:"AES-GCM",iv:n},t,new TextEncoder().encode(e));return{iv:n,cipherText:s}}async function Bt(t,{iv:e,cipherText:n}){const s=await crypto.subtle.decrypt({name:"AES-GCM",iv:e},t,n);return new TextDecoder().decode(s)}function ct(t){switch(t){case"public":return"spki";case"private":return"pkcs8"}}async function dt(t,e){const n=ct(t),s=await crypto.subtle.exportKey(n,e);return Ie(new Uint8Array(s))}async function lt(t,e){const n=ct(t),s=ae(e).buffer;return await crypto.subtle.importKey(n,new Uint8Array(s),{name:"ECDH",namedCurve:"P-256"},!0,t==="private"?["deriveKey"]:[])}async function Wt(t,e){const n=JSON.stringify(t,(s,r)=>{if(!(r instanceof Error))return r;const i=r;return Object.assign(Object.assign({},i.code?{code:i.code}:{}),{message:i.message})});return Ut(e,n)}async function qt(t,e){return JSON.parse(await Bt(e,t))}const de={storageKey:"ownPrivateKey",keyType:"private"},le={storageKey:"ownPublicKey",keyType:"public"},ue={storageKey:"peerPublicKey",keyType:"public"};class Kt{constructor(){this.storage=new q("CBWSDK","SCWKeyManager"),this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null}async getOwnPublicKey(){return await this.loadKeysIfNeeded(),this.ownPublicKey}async getSharedSecret(){return await this.loadKeysIfNeeded(),this.sharedSecret}async setPeerPublicKey(e){this.sharedSecret=null,this.peerPublicKey=e,await this.storeKey(ue,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(le.storageKey),this.storage.removeItem(de.storageKey),this.storage.removeItem(ue.storageKey)}async generateKeyPair(){const e=await Dt();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(de,e.privateKey),await this.storeKey(le,e.publicKey)}async loadKeysIfNeeded(){if(this.ownPrivateKey===null&&(this.ownPrivateKey=await this.loadKey(de)),this.ownPublicKey===null&&(this.ownPublicKey=await this.loadKey(le)),(this.ownPrivateKey===null||this.ownPublicKey===null)&&await this.generateKeyPair(),this.peerPublicKey===null&&(this.peerPublicKey=await this.loadKey(ue)),this.sharedSecret===null){if(this.ownPrivateKey===null||this.peerPublicKey===null)return;this.sharedSecret=await jt(this.ownPrivateKey,this.peerPublicKey)}}async loadKey(e){const n=this.storage.getItem(e.storageKey);return n?lt(e.keyType,n):null}async storeKey(e,n){const s=await dt(e.keyType,n);this.storage.setItem(e.storageKey,s)}}const ie="4.3.0",ut="@coinbase/wallet-sdk";async function Ce(t,e){const n=Object.assign(Object.assign({},t),{jsonrpc:"2.0",id:crypto.randomUUID()}),s=await window.fetch(e,{method:"POST",body:JSON.stringify(n),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":ie,"X-Cbw-Sdk-Platform":ut}}),{result:r,error:i}=await s.json();if(i)throw i;return r}function Ht(){return globalThis.coinbaseWalletExtension}function zt(){var t,e;try{const n=globalThis;return(t=n.ethereum)!==null&&t!==void 0?t:(e=n.top)===null||e===void 0?void 0:e.ethereum}catch{return}}function Ft({metadata:t,preference:e}){var n,s;const{appName:r,appLogoUrl:i,appChainIds:a}=t;if(e.options!=="smartWalletOnly"){const u=Ht();if(u)return(n=u.setAppInfo)===null||n===void 0||n.call(u,r,i,a,e),u}const d=zt();if(d!=null&&d.isCoinbaseBrowser)return(s=d.setAppInfo)===null||s===void 0||s.call(d,r,i,a,e),d}function Gt(t){if(!t||typeof t!="object"||Array.isArray(t))throw A.rpc.invalidParams({message:"Expected a single, non-array, object argument.",data:t});const{method:e,params:n}=t;if(typeof e!="string"||e.length===0)throw A.rpc.invalidParams({message:"'args.method' must be a non-empty string.",data:t});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw A.rpc.invalidParams({message:"'args.params' must be an object or array if provided.",data:t});switch(e){case"eth_sign":case"eth_signTypedData_v2":case"eth_subscribe":case"eth_unsubscribe":throw A.provider.unsupportedMethod()}}const Re="accounts",Pe="activeChain",Te="availableChains",Oe="walletCapabilities";class Yt{constructor(e){var n,s,r;this.metadata=e.metadata,this.communicator=e.communicator,this.callback=e.callback,this.keyManager=new Kt,this.storage=new q("CBWSDK","SCWStateManager"),this.accounts=(n=this.storage.loadObject(Re))!==null&&n!==void 0?n:[],this.chain=this.storage.loadObject(Pe)||{id:(r=(s=e.metadata.appChainIds)===null||s===void 0?void 0:s[0])!==null&&r!==void 0?r:1},this.handshake=this.handshake.bind(this),this.request=this.request.bind(this),this.createRequestMessage=this.createRequestMessage.bind(this),this.decryptResponseMessage=this.decryptResponseMessage.bind(this)}async handshake(e){var n,s,r,i;await((s=(n=this.communicator).waitForPopupLoaded)===null||s===void 0?void 0:s.call(n));const a=await this.createRequestMessage({handshake:{method:e.method,params:Object.assign({},this.metadata,(r=e.params)!==null&&r!==void 0?r:{})}}),d=await this.communicator.postRequestAndWaitForResponse(a);if("failure"in d.content)throw d.content.failure;const u=await lt("public",d.sender);await this.keyManager.setPeerPublicKey(u);const m=(await this.decryptResponseMessage(d)).result;if("error"in m)throw m.error;switch(e.method){case"eth_requestAccounts":{const k=m.value;this.accounts=k,this.storage.storeObject(Re,k),(i=this.callback)===null||i===void 0||i.call(this,"accountsChanged",k);break}}}async request(e){var n;if(this.accounts.length===0)switch(e.method){case"wallet_sendCalls":return this.sendRequestToPopup(e);default:throw A.provider.unauthorized()}switch(e.method){case"eth_requestAccounts":return(n=this.callback)===null||n===void 0||n.call(this,"connect",{chainId:Y(this.chain.id)}),this.accounts;case"eth_accounts":return this.accounts;case"eth_coinbase":return this.accounts[0];case"net_version":return this.chain.id;case"eth_chainId":return Y(this.chain.id);case"wallet_getCapabilities":return this.storage.loadObject(Oe);case"wallet_switchEthereumChain":return this.handleSwitchChainRequest(e);case"eth_ecRecover":case"personal_sign":case"wallet_sign":case"personal_ecRecover":case"eth_signTransaction":case"eth_sendTransaction":case"eth_signTypedData_v1":case"eth_signTypedData_v3":case"eth_signTypedData_v4":case"eth_signTypedData":case"wallet_addEthereumChain":case"wallet_watchAsset":case"wallet_sendCalls":case"wallet_showCallsStatus":case"wallet_grantPermissions":return this.sendRequestToPopup(e);default:if(!this.chain.rpcUrl)throw A.rpc.internal("No RPC URL set for chain");return Ce(e,this.chain.rpcUrl)}}async sendRequestToPopup(e){var n,s;await((s=(n=this.communicator).waitForPopupLoaded)===null||s===void 0?void 0:s.call(n));const r=await this.sendEncryptedRequest(e),a=(await this.decryptResponseMessage(r)).result;if("error"in a)throw a.error;return a.value}async cleanup(){var e,n;this.storage.clear(),await this.keyManager.clear(),this.accounts=[],this.chain={id:(n=(e=this.metadata.appChainIds)===null||e===void 0?void 0:e[0])!==null&&n!==void 0?n:1}}async handleSwitchChainRequest(e){var n;const s=e.params;if(!s||!(!((n=s[0])===null||n===void 0)&&n.chainId))throw A.rpc.invalidParams();const r=te(s[0].chainId);if(this.updateChain(r))return null;const a=await this.sendRequestToPopup(e);return a===null&&this.updateChain(r),a}async sendEncryptedRequest(e){const n=await this.keyManager.getSharedSecret();if(!n)throw A.provider.unauthorized("No valid session found, try requestAccounts before other methods");const s=await Wt({action:e,chainId:this.chain.id},n),r=await this.createRequestMessage({encrypted:s});return this.communicator.postRequestAndWaitForResponse(r)}async createRequestMessage(e){const n=await dt("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:n,content:e,timestamp:new Date}}async decryptResponseMessage(e){var n,s;const r=e.content;if("failure"in r)throw r.failure;const i=await this.keyManager.getSharedSecret();if(!i)throw A.provider.unauthorized("Invalid session");const a=await qt(r.encrypted,i),d=(n=a.data)===null||n===void 0?void 0:n.chains;if(d){const p=Object.entries(d).map(([m,k])=>({id:Number(m),rpcUrl:k}));this.storage.storeObject(Te,p),this.updateChain(this.chain.id,p)}const u=(s=a.data)===null||s===void 0?void 0:s.capabilities;return u&&this.storage.storeObject(Oe,u),a}updateChain(e,n){var s;const r=n??this.storage.loadObject(Te),i=r==null?void 0:r.find(a=>a.id===e);return i?(i!==this.chain&&(this.chain=i,this.storage.storeObject(Pe,i),(s=this.callback)===null||s===void 0||s.call(this,"chainChanged",Y(i.id))),!0):!1}}var O={},G={},Ne;function ht(){if(Ne)return G;Ne=1,Object.defineProperty(G,"__esModule",{value:!0}),G.anumber=t,G.abytes=n,G.ahash=s,G.aexists=r,G.aoutput=i;function t(a){if(!Number.isSafeInteger(a)||a<0)throw new Error("positive integer expected, got "+a)}function e(a){return a instanceof Uint8Array||ArrayBuffer.isView(a)&&a.constructor.name==="Uint8Array"}function n(a,...d){if(!e(a))throw new Error("Uint8Array expected");if(d.length>0&&!d.includes(a.length))throw new Error("Uint8Array expected of length "+d+", got length="+a.length)}function s(a){if(typeof a!="function"||typeof a.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");t(a.outputLen),t(a.blockLen)}function r(a,d=!0){if(a.destroyed)throw new Error("Hash instance has been destroyed");if(d&&a.finished)throw new Error("Hash#digest() has already been called")}function i(a,d){n(a);const u=d.outputLen;if(a.length>e&t)}:{h:Number(g>>e&t)|0,l:Number(g&t)|0}}function s(g,f=!1){let o=new Uint32Array(g.length),b=new Uint32Array(g.length);for(let S=0;SBigInt(g>>>0)<>>0);E.toBig=r;const i=(g,f,o)=>g>>>o;E.shrSH=i;const a=(g,f,o)=>g<<32-o|f>>>o;E.shrSL=a;const d=(g,f,o)=>g>>>o|f<<32-o;E.rotrSH=d;const u=(g,f,o)=>g<<32-o|f>>>o;E.rotrSL=u;const p=(g,f,o)=>g<<64-o|f>>>o-32;E.rotrBH=p;const m=(g,f,o)=>g>>>o-32|f<<64-o;E.rotrBL=m;const k=(g,f)=>f;E.rotr32H=k;const l=(g,f)=>g;E.rotr32L=l;const c=(g,f,o)=>g<>>32-o;E.rotlSH=c;const h=(g,f,o)=>f<>>32-o;E.rotlSL=h;const _=(g,f,o)=>f<>>64-o;E.rotlBH=_;const v=(g,f,o)=>g<>>64-o;E.rotlBL=v;function L(g,f,o,b){const S=(f>>>0)+(b>>>0);return{h:g+o+(S/2**32|0)|0,l:S|0}}const x=(g,f,o)=>(g>>>0)+(f>>>0)+(o>>>0);E.add3L=x;const P=(g,f,o,b)=>f+o+b+(g/2**32|0)|0;E.add3H=P;const y=(g,f,o,b)=>(g>>>0)+(f>>>0)+(o>>>0)+(b>>>0);E.add4L=y;const w=(g,f,o,b,S)=>f+o+b+S+(g/2**32|0)|0;E.add4H=w;const I=(g,f,o,b,S)=>(g>>>0)+(f>>>0)+(o>>>0)+(b>>>0)+(S>>>0);E.add5L=I;const M=(g,f,o,b,S,C)=>f+o+b+S+C+(g/2**32|0)|0;E.add5H=M;const T={fromBig:n,split:s,toBig:r,shrSH:i,shrSL:a,rotrSH:d,rotrSL:u,rotrBH:p,rotrBL:m,rotr32H:k,rotr32L:l,rotlSH:c,rotlSL:h,rotlBH:_,rotlBL:v,add:L,add3L:x,add3H:P,add4L:y,add4H:w,add5H:M,add5L:I};return E.default=T,E}var he={},X={},je;function Vt(){return je||(je=1,Object.defineProperty(X,"__esModule",{value:!0}),X.crypto=void 0,X.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),X}var Ue;function Jt(){return Ue||(Ue=1,function(t){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esModule",{value:!0}),t.Hash=t.nextTick=t.byteSwapIfBE=t.isLE=void 0,t.isBytes=s,t.u8=r,t.u32=i,t.createView=a,t.rotr=d,t.rotl=u,t.byteSwap=p,t.byteSwap32=m,t.bytesToHex=l,t.hexToBytes=_,t.asyncLoop=L,t.utf8ToBytes=x,t.toBytes=P,t.concatBytes=y,t.checkOpts=I,t.wrapConstructor=M,t.wrapConstructorWithOpts=T,t.wrapXOFConstructorWithOpts=g,t.randomBytes=f;const e=Vt(),n=ht();function s(o){return o instanceof Uint8Array||ArrayBuffer.isView(o)&&o.constructor.name==="Uint8Array"}function r(o){return new Uint8Array(o.buffer,o.byteOffset,o.byteLength)}function i(o){return new Uint32Array(o.buffer,o.byteOffset,Math.floor(o.byteLength/4))}function a(o){return new DataView(o.buffer,o.byteOffset,o.byteLength)}function d(o,b){return o<<32-b|o>>>b}function u(o,b){return o<>>32-b>>>0}t.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function p(o){return o<<24&4278190080|o<<8&16711680|o>>>8&65280|o>>>24&255}t.byteSwapIfBE=t.isLE?o=>o:o=>p(o);function m(o){for(let b=0;bb.toString(16).padStart(2,"0"));function l(o){(0,n.abytes)(o);let b="";for(let S=0;S=c._0&&o<=c._9)return o-c._0;if(o>=c.A&&o<=c.F)return o-(c.A-10);if(o>=c.a&&o<=c.f)return o-(c.a-10)}function _(o){if(typeof o!="string")throw new Error("hex string expected, got "+typeof o);const b=o.length,S=b/2;if(b%2)throw new Error("hex string expected, got unpadded hex of length "+b);const C=new Uint8Array(S);for(let N=0,U=0;N{};t.nextTick=v;async function L(o,b,S){let C=Date.now();for(let N=0;N=0&&Uo().update(P(C)).digest(),S=o();return b.outputLen=S.outputLen,b.blockLen=S.blockLen,b.create=()=>o(),b}function T(o){const b=(C,N)=>o(N).update(P(C)).digest(),S=o({});return b.outputLen=S.outputLen,b.blockLen=S.blockLen,b.create=C=>o(C),b}function g(o){const b=(C,N)=>o(N).update(P(C)).digest(),S=o({});return b.outputLen=S.outputLen,b.blockLen=S.blockLen,b.create=C=>o(C),b}function f(o=32){if(e.crypto&&typeof e.crypto.getRandomValues=="function")return e.crypto.getRandomValues(new Uint8Array(o));if(e.crypto&&typeof e.crypto.randomBytes=="function")return e.crypto.randomBytes(o);throw new Error("crypto.getRandomValues must be defined")}}(he)),he}var Be;function Qt(){if(Be)return O;Be=1,Object.defineProperty(O,"__esModule",{value:!0}),O.shake256=O.shake128=O.keccak_512=O.keccak_384=O.keccak_256=O.keccak_224=O.sha3_512=O.sha3_384=O.sha3_256=O.sha3_224=O.Keccak=void 0,O.keccakP=v;const t=ht(),e=$t(),n=Jt(),s=[],r=[],i=[],a=BigInt(0),d=BigInt(1),u=BigInt(2),p=BigInt(7),m=BigInt(256),k=BigInt(113);for(let y=0,w=d,I=1,M=0;y<24;y++){[I,M]=[M,(2*I+3*M)%5],s.push(2*(5*M+I)),r.push((y+1)*(y+2)/2%64);let T=a;for(let g=0;g<7;g++)w=(w<>p)*k)%m,w&u&&(T^=d<<(d<I>32?(0,e.rotlBH)(y,w,I):(0,e.rotlSH)(y,w,I),_=(y,w,I)=>I>32?(0,e.rotlBL)(y,w,I):(0,e.rotlSL)(y,w,I);function v(y,w=24){const I=new Uint32Array(10);for(let M=24-w;M<24;M++){for(let f=0;f<10;f++)I[f]=y[f]^y[f+10]^y[f+20]^y[f+30]^y[f+40];for(let f=0;f<10;f+=2){const o=(f+8)%10,b=(f+2)%10,S=I[b],C=I[b+1],N=h(S,C,1)^I[o],U=_(S,C,1)^I[o+1];for(let $=0;$<50;$+=10)y[f+$]^=N,y[f+$+1]^=U}let T=y[2],g=y[3];for(let f=0;f<24;f++){const o=r[f],b=h(T,g,o),S=_(T,g,o),C=s[f];T=y[C],g=y[C+1],y[C]=b,y[C+1]=S}for(let f=0;f<50;f+=10){for(let o=0;o<10;o++)I[o]=y[f+o];for(let o=0;o<10;o++)y[f+o]^=~I[(o+2)%10]&I[(o+4)%10]}y[0]^=l[M],y[1]^=c[M]}I.fill(0)}class L extends n.Hash{constructor(w,I,M,T=!1,g=24){if(super(),this.blockLen=w,this.suffix=I,this.outputLen=M,this.enableXOF=T,this.rounds=g,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,t.anumber)(M),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,n.u32)(this.state)}keccak(){n.isLE||(0,n.byteSwap32)(this.state32),v(this.state32,this.rounds),n.isLE||(0,n.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(w){(0,t.aexists)(this);const{blockLen:I,state:M}=this;w=(0,n.toBytes)(w);const T=w.length;for(let g=0;g=M&&this.keccak();const f=Math.min(M-this.posOut,g-T);w.set(I.subarray(this.posOut,this.posOut+f),T),this.posOut+=f,T+=f}return w}xofInto(w){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(w)}xof(w){return(0,t.anumber)(w),this.xofInto(new Uint8Array(w))}digestInto(w){if((0,t.aoutput)(w,this),this.finished)throw new Error("digest() was already called");return this.writeInto(w),this.destroy(),w}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(w){const{blockLen:I,suffix:M,outputLen:T,rounds:g,enableXOF:f}=this;return w||(w=new L(I,M,T,f,g)),w.state32.set(this.state32),w.pos=this.pos,w.posOut=this.posOut,w.finished=this.finished,w.rounds=g,w.suffix=M,w.outputLen=T,w.enableXOF=f,w.destroyed=this.destroyed,w}}O.Keccak=L;const x=(y,w,I)=>(0,n.wrapConstructor)(()=>new L(w,y,I));O.sha3_224=x(6,144,224/8),O.sha3_256=x(6,136,256/8),O.sha3_384=x(6,104,384/8),O.sha3_512=x(6,72,512/8),O.keccak_224=x(1,144,224/8),O.keccak_256=x(1,136,256/8),O.keccak_384=x(1,104,384/8),O.keccak_512=x(1,72,512/8);const P=(y,w,I)=>(0,n.wrapXOFConstructorWithOpts)((M={})=>new L(w,y,M.dkLen===void 0?I:M.dkLen,!0));return O.shake128=P(31,168,128/8),O.shake256=P(31,136,256/8),O}var fe,We;function ft(){if(We)return fe;We=1;const{keccak_256:t}=Qt();function e(c){return Buffer.allocUnsafe(c).fill(0)}function n(c){return c.toString(2).length}function s(c,h){let _=c.toString(16);_.length%2!==0&&(_="0"+_);const v=_.match(/.{1,2}/g).map(L=>parseInt(L,16));for(;v.length"u")throw new Error("Not an array?");if(h=r(l),h!=="dynamic"&&h!==0&&c.length>h)throw new Error("Elements exceed array size: "+h);v=[],l=l.slice(0,l.lastIndexOf("[")),typeof c=="string"&&(c=JSON.parse(c));for(L in c)v.push(a(l,c[L]));if(h==="dynamic"){var x=a("uint256",c.length);v.unshift(x)}return Buffer.concat(v)}else{if(l==="bytes")return c=new Buffer(c),v=Buffer.concat([a("uint256",c.length),c]),c.length%32!==0&&(v=Buffer.concat([v,t.zeros(32-c.length%32)])),v;if(l.startsWith("bytes")){if(h=n(l),h<1||h>32)throw new Error("Invalid bytes width: "+h);return t.setLengthRight(c,32)}else if(l.startsWith("uint")){if(h=n(l),h%8||h<8||h>256)throw new Error("Invalid uint width: "+h);_=i(c);const P=t.bitLengthFromBigInt(_);if(P>h)throw new Error("Supplied uint exceeds width: "+h+" vs "+P);if(_<0)throw new Error("Supplied uint is negative");return t.bufferBEFromBigInt(_,32)}else if(l.startsWith("int")){if(h=n(l),h%8||h<8||h>256)throw new Error("Invalid int width: "+h);_=i(c);const P=t.bitLengthFromBigInt(_);if(P>h)throw new Error("Supplied int exceeds width: "+h+" vs "+P);const y=t.twosFromBigInt(_,256);return t.bufferBEFromBigInt(y,32)}else if(l.startsWith("ufixed")){if(h=s(l),_=i(c),_<0)throw new Error("Supplied ufixed is negative");return a("uint256",_*BigInt(2)**BigInt(h[1]))}else if(l.startsWith("fixed"))return h=s(l),a("int256",i(c)*BigInt(2)**BigInt(h[1]))}throw new Error("Unsupported or invalid type: "+l)}function d(l){return l==="string"||l==="bytes"||r(l)==="dynamic"}function u(l){return l.lastIndexOf("]")===l.length-1}function p(l,c){var h=[],_=[],v=32*l.length;for(var L in l){var x=e(l[L]),P=c[L],y=a(x,P);d(x)?(h.push(a("uint256",v)),_.push(y),v+=y.length):h.push(y)}return Buffer.concat(h.concat(_))}function m(l,c){if(l.length!==c.length)throw new Error("Number of types are not matching the values");for(var h,_,v=[],L=0;L32)throw new Error("Invalid bytes width: "+h);v.push(t.setLengthRight(P,h))}else if(x.startsWith("uint")){if(h=n(x),h%8||h<8||h>256)throw new Error("Invalid uint width: "+h);_=i(P);const y=t.bitLengthFromBigInt(_);if(y>h)throw new Error("Supplied uint exceeds width: "+h+" vs "+y);v.push(t.bufferBEFromBigInt(_,h/8))}else if(x.startsWith("int")){if(h=n(x),h%8||h<8||h>256)throw new Error("Invalid int width: "+h);_=i(P);const y=t.bitLengthFromBigInt(_);if(y>h)throw new Error("Supplied int exceeds width: "+h+" vs "+y);const w=t.twosFromBigInt(_,h);v.push(t.bufferBEFromBigInt(w,h/8))}else throw new Error("Unsupported or invalid type: "+x)}return Buffer.concat(v)}function k(l,c){return t.keccak(m(l,c))}return pe={rawEncode:p,solidityPack:m,soliditySHA3:k},pe}var ge,Ke;function Xt(){if(Ke)return ge;Ke=1;const t=ft(),e=Zt(),n={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},s={encodeData(i,a,d,u=!0){const p=["bytes32"],m=[this.hashType(i,d)];if(u){const k=(l,c,h)=>{if(d[c]!==void 0)return["bytes32",h==null?"0x0000000000000000000000000000000000000000000000000000000000000000":t.keccak(this.encodeData(c,h,d,u))];if(h===void 0)throw new Error(`missing value for field ${l} of type ${c}`);if(c==="bytes")return["bytes32",t.keccak(h)];if(c==="string")return typeof h=="string"&&(h=Buffer.from(h,"utf8")),["bytes32",t.keccak(h)];if(c.lastIndexOf("]")===c.length-1){const _=c.slice(0,c.lastIndexOf("[")),v=h.map(L=>k(l,_,L));return["bytes32",t.keccak(e.rawEncode(v.map(([L])=>L),v.map(([,L])=>L)))]}return[c,h]};for(const l of d[i]){const[c,h]=k(l.name,l.type,a[l.name]);p.push(c),m.push(h)}}else for(const k of d[i]){let l=a[k.name];if(l!==void 0)if(k.type==="bytes")p.push("bytes32"),l=t.keccak(l),m.push(l);else if(k.type==="string")p.push("bytes32"),typeof l=="string"&&(l=Buffer.from(l,"utf8")),l=t.keccak(l),m.push(l);else if(d[k.type]!==void 0)p.push("bytes32"),l=t.keccak(this.encodeData(k.type,l,d,u)),m.push(l);else{if(k.type.lastIndexOf("]")===k.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");p.push(k.type),m.push(l)}}return e.rawEncode(p,m)},encodeType(i,a){let d="",u=this.findTypeDependencies(i,a).filter(p=>p!==i);u=[i].concat(u.sort());for(const p of u){if(!a[p])throw new Error("No type definition specified: "+p);d+=p+"("+a[p].map(({name:k,type:l})=>l+" "+k).join(",")+")"}return d},findTypeDependencies(i,a,d=[]){if(i=i.match(/^\w*/)[0],d.includes(i)||a[i]===void 0)return d;d.push(i);for(const u of a[i])for(const p of this.findTypeDependencies(u.type,a,d))!d.includes(p)&&d.push(p);return d},hashStruct(i,a,d,u=!0){return t.keccak(this.encodeData(i,a,d,u))},hashType(i,a){return t.keccak(this.encodeType(i,a))},sanitizeData(i){const a={};for(const d in n.properties)i[d]&&(a[d]=i[d]);return a.types&&(a.types=Object.assign({EIP712Domain:[]},a.types)),a},hash(i,a=!0){const d=this.sanitizeData(i),u=[Buffer.from("1901","hex")];return u.push(this.hashStruct("EIP712Domain",d.domain,d.types,a)),d.primaryType!=="EIP712Domain"&&u.push(this.hashStruct(d.primaryType,d.message,d.types,a)),t.keccak(Buffer.concat(u))}};ge={TYPED_MESSAGE_SCHEMA:n,TypedDataUtils:s,hashForSignTypedDataLegacy:function(i){return r(i.data)},hashForSignTypedData_v3:function(i){return s.hash(i.data,!1)},hashForSignTypedData_v4:function(i){return s.hash(i.data)}};function r(i){const a=new Error("Expect argument to be non-empty array");if(typeof i!="object"||!i.length)throw a;const d=i.map(function(m){return m.type==="bytes"?t.toBuffer(m.value):m.value}),u=i.map(function(m){return m.type}),p=i.map(function(m){if(!m.name)throw a;return m.type+" "+m.name});return e.soliditySHA3(["bytes32","bytes32"],[e.soliditySHA3(new Array(i.length).fill("string"),p),e.soliditySHA3(u,d)])}return ge}var en=Xt();const re=Et(en),tn="walletUsername",ke="Addresses",nn="AppVersion";function j(t){return t.errorMessage!==void 0}class sn{constructor(e){this.secret=e}async encrypt(e){const n=this.secret;if(n.length!==64)throw Error("secret must be 256 bits");const s=crypto.getRandomValues(new Uint8Array(12)),r=await crypto.subtle.importKey("raw",ae(n),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:s},r,i.encode(e)),d=16,u=a.slice(a.byteLength-d),p=a.slice(0,a.byteLength-d),m=new Uint8Array(u),k=new Uint8Array(p),l=new Uint8Array([...s,...m,...k]);return Ie(l)}async decrypt(e){const n=this.secret;if(n.length!==64)throw Error("secret must be 256 bits");return new Promise((s,r)=>{(async function(){const i=await crypto.subtle.importKey("raw",ae(n),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=ae(e),d=a.slice(0,12),u=a.slice(12,28),p=a.slice(28),m=new Uint8Array([...p,...u]),k={name:"AES-GCM",iv:new Uint8Array(d)};try{const l=await window.crypto.subtle.decrypt(k,i,m),c=new TextDecoder;s(c.decode(l))}catch(l){r(l)}})()})}}class rn{constructor(e,n,s){this.linkAPIUrl=e,this.sessionId=n;const r=`${n}:${s}`;this.auth=`Basic ${btoa(r)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(n=>fetch(`${this.linkAPIUrl}/events/${n.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(n=>console.error("Unabled to mark event as failed:",n))}async fetchUnseenEvents(){var e;const n=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(n.ok){const{events:s,error:r}=await n.json();if(r)throw new Error(`Check unseen events failed: ${r}`);const i=(e=s==null?void 0:s.filter(a=>a.event==="Web3Response").map(a=>({type:"Event",sessionId:this.sessionId,eventId:a.id,event:a.event,data:a.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(i),i}throw new Error(`Check unseen events failed: ${n.status}`)}}var z;(function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"})(z||(z={}));class an{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,n=WebSocket){this.WebSocketClass=n,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((e,n)=>{var s;let r;try{this.webSocket=r=new this.WebSocketClass(this.url)}catch(i){n(i);return}(s=this.connectionStateListener)===null||s===void 0||s.call(this,z.CONNECTING),r.onclose=i=>{var a;this.clearWebSocket(),n(new Error(`websocket error ${i.code}: ${i.reason}`)),(a=this.connectionStateListener)===null||a===void 0||a.call(this,z.DISCONNECTED)},r.onopen=i=>{var a;e(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,z.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(u=>this.sendData(u)),this.pendingData=[])},r.onmessage=i=>{var a,d;if(i.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const u=JSON.parse(i.data);(d=this.incomingDataListener)===null||d===void 0||d.call(this,u)}catch{}}})}disconnect(){var e;const{webSocket:n}=this;if(n){this.clearWebSocket(),(e=this.connectionStateListener)===null||e===void 0||e.call(this,z.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{n.close()}catch{}}}sendData(e){const{webSocket:n}=this;if(!n){this.pendingData.push(e),this.connect();return}n.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}const He=1e4,on=6e4;class cn{constructor({session:e,linkAPIUrl:n,listener:s}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=K(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=i=>{if(!i)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",d=>i.JsonRpcUrl&&this.handleChainUpdated(d,i.JsonRpcUrl)]]).forEach((d,u)=>{const p=i[u];p!==void 0&&d(p)})},this.handleDestroyed=i=>{var a;i==="1"&&((a=this.listener)===null||a===void 0||a.resetAndReload())},this.handleAccountUpdated=async i=>{var a;const d=await this.cipher.decrypt(i);(a=this.listener)===null||a===void 0||a.accountUpdated(d)},this.handleMetadataUpdated=async(i,a)=>{var d;const u=await this.cipher.decrypt(a);(d=this.listener)===null||d===void 0||d.metadataUpdated(i,u)},this.handleWalletUsernameUpdated=async i=>{this.handleMetadataUpdated(tn,i)},this.handleAppVersionUpdated=async i=>{this.handleMetadataUpdated(nn,i)},this.handleChainUpdated=async(i,a)=>{var d;const u=await this.cipher.decrypt(i),p=await this.cipher.decrypt(a);(d=this.listener)===null||d===void 0||d.chainUpdated(u,p)},this.session=e,this.cipher=new sn(e.secret),this.listener=s;const r=new an(`${n}/rpc`,WebSocket);r.setConnectionStateListener(async i=>{let a=!1;switch(i){case z.DISCONNECTED:if(!this.destroyed){const d=async()=>{await new Promise(u=>setTimeout(u,5e3)),this.destroyed||r.connect().catch(()=>{d()})};d()}break;case z.CONNECTED:a=await this.handleConnected(),this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},He),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case z.CONNECTING:break}this.connected!==a&&(this.connected=a)}),r.setIncomingDataListener(i=>{var a;switch(i.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const d=i.type==="IsLinkedOK"?i.linked:void 0;this.linked=d||i.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{this.handleSessionMetadataUpdated(i.metadata);break}case"Event":{this.handleIncomingEvent(i);break}}i.id!==void 0&&((a=this.requestResolutions.get(i.id))===null||a===void 0||a(i))}),this.ws=r,this.http=new rn(n,e.id,e.key)}connect(){if(this.destroyed)throw new Error("instance is destroyed");this.ws.connect()}async destroy(){this.destroyed||(await this.makeRequest({type:"SetSessionConfig",id:K(this.nextReqId++),sessionId:this.session.id,metadata:{__destroyed:"1"}},{timeout:1e3}),this.destroyed=!0,this.ws.disconnect(),this.listener=void 0)}get connected(){return this._connected}set connected(e){this._connected=e}get linked(){return this._linked}set linked(e){var n,s;this._linked=e,e&&((n=this.onceLinked)===null||n===void 0||n.call(this)),(s=this.listener)===null||s===void 0||s.linkedUpdated(e)}setOnceLinked(e){return new Promise(n=>{this.linked?e().then(n):this.onceLinked=()=>{e().then(n),this.onceLinked=void 0}})}async handleIncomingEvent(e){var n;if(e.type!=="Event"||e.event!=="Web3Response")return;const s=await this.cipher.decrypt(e.data),r=JSON.parse(s);if(r.type!=="WEB3_RESPONSE")return;const{id:i,response:a}=r;(n=this.listener)===null||n===void 0||n.handleWeb3ResponseMessage(i,a)}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(n=>this.handleIncomingEvent(n))}async publishEvent(e,n,s=!1){const r=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},n),{origin:location.origin,location:location.href,relaySource:"coinbaseWalletExtension"in window&&window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),i={type:"PublishEvent",id:K(this.nextReqId++),sessionId:this.session.id,event:e,data:r,callWebhook:s};return this.setOnceLinked(async()=>{const a=await this.makeRequest(i);if(a.type==="Fail")throw new Error(a.error||"failed to publish event");return a.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>He*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,n={timeout:on}){const s=e.id;this.sendData(e);let r;return Promise.race([new Promise((i,a)=>{r=window.setTimeout(()=>{a(new Error(`request ${s} timed out`))},n.timeout)}),new Promise(i=>{this.requestResolutions.set(s,a=>{clearTimeout(r),i(a),this.requestResolutions.delete(s)})})])}async handleConnected(){return(await this.makeRequest({type:"HostSession",id:K(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key})).type==="Fail"?!1:(this.sendData({type:"IsLinked",id:K(this.nextReqId++),sessionId:this.session.id}),this.sendData({type:"GetSessionConfig",id:K(this.nextReqId++),sessionId:this.session.id}),!0)}}class dn{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,n=ot(e.toString(16));return this.callbacks.get(n)&&this.callbacks.delete(n),e}}const ze="session:id",Fe="session:secret",Ge="session:linked";class Q{constructor(e,n,s,r=!1){this.storage=e,this.id=n,this.secret=s,this.key=It(St(`${n}, ${s} WalletLink`)),this._linked=!!r}static create(e){const n=V(16),s=V(32);return new Q(e,n,s).save()}static load(e){const n=e.getItem(ze),s=e.getItem(Ge),r=e.getItem(Fe);return n&&r?new Q(e,n,r,s==="1"):null}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this.storage.setItem(ze,this.id),this.storage.setItem(Fe,this.secret),this.persistLinked(),this}persistLinked(){this.storage.setItem(Ge,this._linked?"1":"0")}}function ln(){try{return window.frameElement!==null}catch{return!1}}function un(){try{return ln()&&window.top?window.top.location:window.location}catch{return window.location}}function hn(){var t;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((t=window==null?void 0:window.navigator)===null||t===void 0?void 0:t.userAgent)}function pt(){var t,e;return(e=(t=window==null?void 0:window.matchMedia)===null||t===void 0?void 0:t.call(window,"(prefers-color-scheme: dark)").matches)!==null&&e!==void 0?e:!1}const fn='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';function gt(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(fn)),document.documentElement.appendChild(t)}function bt(t){var e,n,s="";if(typeof t=="string"||typeof t=="number")s+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e{this.items.delete(n),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&be(R("div",null,R(wt,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([e,n])=>R(mn,Object.assign({},n,{key:e}))))),this.root)}}const wt=t=>R("div",{class:ne("-cbwsdk-snackbar-container")},R("style",null,pn),R("div",{class:"-cbwsdk-snackbar"},t.children)),mn=({autoExpand:t,message:e,menuItems:n})=>{const[s,r]=Le(!0),[i,a]=Le(t??!1);Ct(()=>{const u=[window.setTimeout(()=>{r(!1)},1),window.setTimeout(()=>{a(!0)},1e4)];return()=>{u.forEach(window.clearTimeout)}});const d=()=>{a(!i)};return R("div",{class:ne("-cbwsdk-snackbar-instance",s&&"-cbwsdk-snackbar-instance-hidden",i&&"-cbwsdk-snackbar-instance-expanded")},R("div",{class:"-cbwsdk-snackbar-instance-header",onClick:d},R("img",{src:gn,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",R("div",{class:"-cbwsdk-snackbar-instance-header-message"},e),R("div",{class:"-gear-container"},!i&&R("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},R("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),R("img",{src:bn,class:"-gear-icon",title:"Expand"}))),n&&n.length>0&&R("div",{class:"-cbwsdk-snackbar-instance-menu"},n.map((u,p)=>R("div",{class:ne("-cbwsdk-snackbar-instance-menu-item",u.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:u.onClick,key:p},R("svg",{width:u.svgWidth,height:u.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},R("path",{"fill-rule":u.defaultFillRule,"clip-rule":u.defaultClipRule,d:u.path,fill:"#AAAAAA"})),R("span",{class:ne("-cbwsdk-snackbar-instance-menu-item-info",u.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},u.info)))))};class yn{constructor(){this.attached=!1,this.snackbar=new wn}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,n=document.createElement("div");n.className="-cbwsdk-css-reset",e.appendChild(n),this.snackbar.attach(n),this.attached=!0,gt()}showConnecting(e){let n;return e.isUnlinkedErrorState?n={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:n={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(n)}}const kn=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";class vn{constructor(){this.root=null,this.darkMode=pt()}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),gt()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&(be(null,this.root),e&&be(R(En,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}}const En=({title:t,buttonText:e,darkMode:n,onButtonClick:s,onDismiss:r})=>{const i=n?"dark":"light";return R(wt,{darkMode:n},R("div",{class:"-cbwsdk-redirect-dialog"},R("style",null,kn),R("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:r}),R("div",{class:ne("-cbwsdk-redirect-dialog-box",i)},R("p",null,t),R("button",{onClick:s},e))))},In="https://keys.coinbase.com/connect",Sn="http://rpc.wallet.coinbase.com",Ye="https://www.walletlink.org",_n="https://go.cb-w.com/walletlink";class $e{constructor(){this.attached=!1,this.redirectDialog=new vn}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}redirectToCoinbaseWallet(e){const n=new URL(_n);n.searchParams.append("redirect_url",un().href),e&&n.searchParams.append("wl_url",e);const s=document.createElement("a");s.target="cbw-opener",s.href=n.href,s.rel="noreferrer noopener",s.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}}class H{constructor(e){this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.isMobileWeb=hn(),this.linkedUpdated=i=>{this.isLinked=i;const a=this.storage.getItem(ke);if(i&&(this._session.linked=i),this.isUnlinkedErrorState=!1,a){const d=a.split(" "),u=this.storage.getItem("IsStandaloneSigning")==="true";d[0]!==""&&!i&&this._session.linked&&!u&&(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(i,a)=>{this.storage.setItem(i,a)},this.chainUpdated=(i,a)=>{this.chainCallbackParams.chainId===i&&this.chainCallbackParams.jsonRpcUrl===a||(this.chainCallbackParams={chainId:i,jsonRpcUrl:a},this.chainCallback&&this.chainCallback(a,Number.parseInt(i,10)))},this.accountUpdated=i=>{this.accountsCallback&&this.accountsCallback([i]),H.accountRequestCallbackIds.size>0&&(Array.from(H.accountRequestCallbackIds.values()).forEach(a=>{this.invokeCallback(a,{method:"requestEthereumAccounts",result:[i]})}),H.accountRequestCallbackIds.clear())},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.metadata=e.metadata,this.accountsCallback=e.accountsCallback,this.chainCallback=e.chainCallback;const{session:n,ui:s,connection:r}=this.subscribe();this._session=n,this.connection=r,this.relayEventManager=new dn,this.ui=s,this.ui.attach()}subscribe(){const e=Q.load(this.storage)||Q.create(this.storage),{linkAPIUrl:n}=this,s=new cn({session:e,linkAPIUrl:n,listener:this}),r=this.isMobileWeb?new $e:new yn;return s.connect(),{session:e,ui:r,connection:s}}resetAndReload(){this.connection.destroy().then(()=>{const e=Q.load(this.storage);(e==null?void 0:e.id)===this._session.id&&q.clearAll(),document.location.reload()}).catch(e=>{})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:W(e.weiValue),data:ee(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?W(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?W(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?W(e.gasPriceInWei):null,gasLimit:e.gasLimit?W(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:W(e.weiValue),data:ee(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?W(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?W(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?W(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?W(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,n){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:ee(e,!0),chainId:n}})}getWalletLinkSession(){return this._session}sendRequest(e){let n=null;const s=V(8),r=i=>{this.publishWeb3RequestCanceledEvent(s),this.handleErrorResponse(s,e.method,i),n==null||n()};return new Promise((i,a)=>{n=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:r,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(s,d=>{if(n==null||n(),j(d))return a(new Error(d.errorMessage));i(d)}),this.publishWeb3RequestEvent(s,e)})}publishWeb3RequestEvent(e,n){const s={type:"WEB3_REQUEST",id:e,request:n};this.publishEvent("Web3Request",s,!0).then(r=>{}).catch(r=>{this.handleWeb3ResponseMessage(s.id,{method:n.method,errorMessage:r.message})}),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(n.method)}openCoinbaseWalletDeeplink(e){if(this.ui instanceof $e)switch(e){case"requestEthereumAccounts":case"switchEthereumChain":return;default:window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0}),this.ui.openCoinbaseWalletDeeplink();break}}publishWeb3RequestCanceledEvent(e){const n={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",n,!1).then()}publishEvent(e,n,s){return this.connection.publishEvent(e,n,s)}handleWeb3ResponseMessage(e,n){if(n.method==="requestEthereumAccounts"){H.accountRequestCallbackIds.forEach(s=>this.invokeCallback(s,n)),H.accountRequestCallbackIds.clear();return}this.invokeCallback(e,n)}handleErrorResponse(e,n,s){var r;const i=(r=s==null?void 0:s.message)!==null&&r!==void 0?r:"Unspecified error message.";this.handleWeb3ResponseMessage(e,{method:n,errorMessage:i})}invokeCallback(e,n){const s=this.relayEventManager.callbacks.get(e);s&&(s(n),this.relayEventManager.callbacks.delete(e))}requestEthereumAccounts(){const{appName:e,appLogoUrl:n}=this.metadata,s={method:"requestEthereumAccounts",params:{appName:e,appLogoUrl:n}},r=V(8);return new Promise((i,a)=>{this.relayEventManager.callbacks.set(r,d=>{if(j(d))return a(new Error(d.errorMessage));i(d)}),H.accountRequestCallbackIds.add(r),this.publishWeb3RequestEvent(r,s)})}watchAsset(e,n,s,r,i,a){const d={method:"watchAsset",params:{type:e,options:{address:n,symbol:s,decimals:r,image:i},chainId:a}};let u=null;const p=V(8),m=k=>{this.publishWeb3RequestCanceledEvent(p),this.handleErrorResponse(p,d.method,k),u==null||u()};return u=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:m,onResetConnection:this.resetAndReload}),new Promise((k,l)=>{this.relayEventManager.callbacks.set(p,c=>{if(u==null||u(),j(c))return l(new Error(c.errorMessage));k(c)}),this.publishWeb3RequestEvent(p,d)})}addEthereumChain(e,n,s,r,i,a){const d={method:"addEthereumChain",params:{chainId:e,rpcUrls:n,blockExplorerUrls:r,chainName:i,iconUrls:s,nativeCurrency:a}};let u=null;const p=V(8),m=k=>{this.publishWeb3RequestCanceledEvent(p),this.handleErrorResponse(p,d.method,k),u==null||u()};return u=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:m,onResetConnection:this.resetAndReload}),new Promise((k,l)=>{this.relayEventManager.callbacks.set(p,c=>{if(u==null||u(),j(c))return l(new Error(c.errorMessage));k(c)}),this.publishWeb3RequestEvent(p,d)})}switchEthereumChain(e,n){const s={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:n})};let r=null;const i=V(8),a=d=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,s.method,d),r==null||r()};return r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:a,onResetConnection:this.resetAndReload}),new Promise((d,u)=>{this.relayEventManager.callbacks.set(i,p=>{if(r==null||r(),j(p)&&p.errorCode)return u(A.provider.custom({code:p.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if(j(p))return u(new Error(p.errorMessage));d(p)}),this.publishWeb3RequestEvent(i,s)})}}H.accountRequestCallbackIds=new Set;const Ve="DefaultChainId",Je="DefaultJsonRpcUrl";class mt{constructor(e){this._relay=null,this._addresses=[],this.metadata=e.metadata,this._storage=new q("walletlink",Ye),this.callback=e.callback||null;const n=this._storage.getItem(ke);if(n){const s=n.split(" ");s[0]!==""&&(this._addresses=s.map(r=>F(r)))}this.initializeRelay()}getSession(){const e=this.initializeRelay(),{id:n,secret:s}=e.getWalletLinkSession();return{id:n,secret:s}}async handshake(){await this._eth_requestAccounts()}get selectedAddress(){return this._addresses[0]||void 0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(Je))!==null&&e!==void 0?e:void 0}set jsonRpcUrl(e){this._storage.setItem(Je,e)}updateProviderInfo(e,n){var s;this.jsonRpcUrl=e;const r=this.getChainId();this._storage.setItem(Ve,n.toString(10)),te(n)!==r&&((s=this.callback)===null||s===void 0||s.call(this,"chainChanged",Y(n)))}async watchAsset(e){const n=Array.isArray(e)?e[0]:e;if(!n.type)throw A.rpc.invalidParams("Type is required");if((n==null?void 0:n.type)!=="ERC20")throw A.rpc.invalidParams(`Asset of type '${n.type}' is not supported`);if(!(n!=null&&n.options))throw A.rpc.invalidParams("Options are required");if(!(n!=null&&n.options.address))throw A.rpc.invalidParams("Address is required");const s=this.getChainId(),{address:r,symbol:i,image:a,decimals:d}=n.options,p=await this.initializeRelay().watchAsset(n.type,r,i,d,a,s==null?void 0:s.toString());return j(p)?!1:!!p.result}async addEthereumChain(e){var n,s;const r=e[0];if(((n=r.rpcUrls)===null||n===void 0?void 0:n.length)===0)throw A.rpc.invalidParams("please pass in at least 1 rpcUrl");if(!r.chainName||r.chainName.trim()==="")throw A.rpc.invalidParams("chainName is a required field");if(!r.nativeCurrency)throw A.rpc.invalidParams("nativeCurrency is a required field");const i=Number.parseInt(r.chainId,16);if(i===this.getChainId())return!1;const a=this.initializeRelay(),{rpcUrls:d=[],blockExplorerUrls:u=[],chainName:p,iconUrls:m=[],nativeCurrency:k}=r,l=await a.addEthereumChain(i.toString(),d,m,u,p,k);if(j(l))return!1;if(((s=l.result)===null||s===void 0?void 0:s.isApproved)===!0)return this.updateProviderInfo(d[0],i),null;throw A.rpc.internal("unable to add ethereum chain")}async switchEthereumChain(e){const n=e[0],s=Number.parseInt(n.chainId,16),i=await this.initializeRelay().switchEthereumChain(s.toString(10),this.selectedAddress||void 0);if(j(i))throw i;const a=i.result;return a.isApproved&&a.rpcUrl.length>0&&this.updateProviderInfo(a.rpcUrl,s),null}async cleanup(){this.callback=null,this._relay&&this._relay.resetAndReload(),this._storage.clear()}_setAddresses(e,n){var s;if(!Array.isArray(e))throw new Error("addresses is not an array");const r=e.map(i=>F(i));JSON.stringify(r)!==JSON.stringify(this._addresses)&&(this._addresses=r,(s=this.callback)===null||s===void 0||s.call(this,"accountsChanged",r),this._storage.setItem(ke,r.join(" ")))}async request(e){const n=e.params||[];switch(e.method){case"eth_accounts":return[...this._addresses];case"eth_coinbase":return this.selectedAddress||null;case"net_version":return this.getChainId().toString(10);case"eth_chainId":return Y(this.getChainId());case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_ecRecover":case"personal_ecRecover":return this.ecRecover(e);case"personal_sign":return this.personalSign(e);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":case"eth_signTypedData_v3":case"eth_signTypedData_v4":case"eth_signTypedData":return this.signTypedData(e);case"wallet_addEthereumChain":return this.addEthereumChain(n);case"wallet_switchEthereumChain":return this.switchEthereumChain(n);case"wallet_watchAsset":return this.watchAsset(n);default:if(!this.jsonRpcUrl)throw A.rpc.internal("No RPC URL set for chain");return Ce(e,this.jsonRpcUrl)}}_ensureKnownAddress(e){const n=F(e);if(!this._addresses.map(r=>F(r)).includes(n))throw new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const n=e.from?F(e.from):this.selectedAddress;if(!n)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(n);const s=e.to?F(e.to):null,r=e.value!=null?Z(e.value):BigInt(0),i=e.data?ye(e.data):Buffer.alloc(0),a=e.nonce!=null?te(e.nonce):null,d=e.gasPrice!=null?Z(e.gasPrice):null,u=e.maxFeePerGas!=null?Z(e.maxFeePerGas):null,p=e.maxPriorityFeePerGas!=null?Z(e.maxPriorityFeePerGas):null,m=e.gas!=null?Z(e.gas):null,k=e.chainId?te(e.chainId):this.getChainId();return{fromAddress:n,toAddress:s,weiValue:r,data:i,nonce:a,gasPriceInWei:d,maxFeePerGas:u,maxPriorityFeePerGas:p,gasLimit:m,chainId:k}}async ecRecover(e){const{method:n,params:s}=e;if(!Array.isArray(s))throw A.rpc.invalidParams();const i=await this.initializeRelay().sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:ce(s[0]),signature:ce(s[1]),addPrefix:n==="personal_ecRecover"}});if(j(i))throw i;return i.result}getChainId(){var e;return Number.parseInt((e=this._storage.getItem(Ve))!==null&&e!==void 0?e:"1",10)}async _eth_requestAccounts(){var e,n;if(this._addresses.length>0)return(e=this.callback)===null||e===void 0||e.call(this,"connect",{chainId:Y(this.getChainId())}),this._addresses;const r=await this.initializeRelay().requestEthereumAccounts();if(j(r))throw r;if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),(n=this.callback)===null||n===void 0||n.call(this,"connect",{chainId:Y(this.getChainId())}),this._addresses}async personalSign({params:e}){if(!Array.isArray(e))throw A.rpc.invalidParams();const n=e[1],s=e[0];this._ensureKnownAddress(n);const i=await this.initializeRelay().sendRequest({method:"signEthereumMessage",params:{address:F(n),message:ce(s),addPrefix:!0,typedDataJson:null}});if(j(i))throw i;return i.result}async _eth_signTransaction(e){const n=this._prepareTransactionParams(e[0]||{}),r=await this.initializeRelay().signEthereumTransaction(n);if(j(r))throw r;return r.result}async _eth_sendRawTransaction(e){const n=ye(e[0]),r=await this.initializeRelay().submitEthereumTransaction(n,this.getChainId());if(j(r))throw r;return r.result}async _eth_sendTransaction(e){const n=this._prepareTransactionParams(e[0]||{}),r=await this.initializeRelay().signAndSubmitEthereumTransaction(n);if(j(r))throw r;return r.result}async signTypedData(e){const{method:n,params:s}=e;if(!Array.isArray(s))throw A.rpc.invalidParams();const r=p=>{const m={eth_signTypedData_v1:re.hashForSignTypedDataLegacy,eth_signTypedData_v3:re.hashForSignTypedData_v3,eth_signTypedData_v4:re.hashForSignTypedData_v4,eth_signTypedData:re.hashForSignTypedData_v4};return ee(m[n]({data:Ot(p)}),!0)},i=s[n==="eth_signTypedData_v1"?1:0],a=s[n==="eth_signTypedData_v1"?0:1];this._ensureKnownAddress(i);const u=await this.initializeRelay().sendRequest({method:"signEthereumMessage",params:{address:F(i),message:r(a),typedDataJson:JSON.stringify(a,null,2),addPrefix:!1}});if(j(u))throw u;return u.result}initializeRelay(){return this._relay||(this._relay=new H({linkAPIUrl:Ye,storage:this._storage,metadata:this.metadata,accountsCallback:this._setAddresses.bind(this),chainCallback:this.updateProviderInfo.bind(this)})),this._relay}}const yt="SignerType",kt=new q("CBWSDK","SignerConfigurator");function Cn(){return kt.getItem(yt)}function An(t){kt.setItem(yt,t)}async function Ln(t){const{communicator:e,metadata:n,handshakeRequest:s,callback:r}=t;Mn(e,n,r).catch(()=>{});const i={id:crypto.randomUUID(),event:"selectSignerType",data:Object.assign(Object.assign({},t.preference),{handshakeRequest:s})},{data:a}=await e.postRequestAndWaitForResponse(i);return a}function xn(t){const{signerType:e,metadata:n,communicator:s,callback:r}=t;switch(e){case"scw":return new Yt({metadata:n,callback:r,communicator:s});case"walletlink":return new mt({metadata:n,callback:r})}}async function Mn(t,e,n){await t.onMessage(({event:r})=>r==="WalletLinkSessionRequest");const s=new mt({metadata:e,callback:n});t.postMessage({event:"WalletLinkUpdate",data:{session:s.getSession()}}),await s.handshake(),t.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})}const Rn=`Coinbase Wallet SDK requires the Cross-Origin-Opener-Policy header to not be set to 'same-origin'. This is to ensure that the SDK can communicate with the Coinbase Smart Wallet app. + +Please see https://www.smartwallet.dev/guides/tips/popup-tips#cross-origin-opener-policy for more information.`,Pn=()=>{let t;return{getCrossOriginOpenerPolicy:()=>t===void 0?"undefined":t,checkCrossOriginOpenerPolicy:async()=>{if(typeof window>"u"){t="non-browser-env";return}try{const e=`${window.location.origin}${window.location.pathname}`,n=await fetch(e,{method:"HEAD"});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);const s=n.headers.get("Cross-Origin-Opener-Policy");t=s??"null",t==="same-origin"&&console.error(Rn)}catch(e){console.error("Error checking Cross-Origin-Opener-Policy:",e.message),t="error"}}}},{checkCrossOriginOpenerPolicy:Tn,getCrossOriginOpenerPolicy:On}=Pn(),Qe=420,Ze=540;function Nn(t){const e=(window.innerWidth-Qe)/2+window.screenX,n=(window.innerHeight-Ze)/2+window.screenY;jn(t);const s=`wallet_${crypto.randomUUID()}`,r=window.open(t,s,`width=${Qe}, height=${Ze}, left=${e}, top=${n}`);if(r==null||r.focus(),!r)throw A.rpc.internal("Pop up window failed to open");return r}function Dn(t){t&&!t.closed&&t.close()}function jn(t){const e={sdkName:ut,sdkVersion:ie,origin:window.location.origin,coop:On()};for(const[n,s]of Object.entries(e))t.searchParams.append(n,s.toString())}class Un{constructor({url:e=In,metadata:n,preference:s}){this.popup=null,this.listeners=new Map,this.postMessage=async r=>{(await this.waitForPopupLoaded()).postMessage(r,this.url.origin)},this.postRequestAndWaitForResponse=async r=>{const i=this.onMessage(({requestId:a})=>a===r.id);return this.postMessage(r),await i},this.onMessage=async r=>new Promise((i,a)=>{const d=u=>{if(u.origin!==this.url.origin)return;const p=u.data;r(p)&&(i(p),window.removeEventListener("message",d),this.listeners.delete(d))};window.addEventListener("message",d),this.listeners.set(d,{reject:a})}),this.disconnect=()=>{Dn(this.popup),this.popup=null,this.listeners.forEach(({reject:r},i)=>{r(A.provider.userRejectedRequest("Request rejected")),window.removeEventListener("message",i)}),this.listeners.clear()},this.waitForPopupLoaded=async()=>this.popup&&!this.popup.closed?(this.popup.focus(),this.popup):(this.popup=Nn(this.url),this.onMessage(({event:r})=>r==="PopupUnload").then(this.disconnect).catch(()=>{}),this.onMessage(({event:r})=>r==="PopupLoaded").then(r=>{this.postMessage({requestId:r.id,data:{version:ie,metadata:this.metadata,preference:this.preference,location:window.location.toString()}})}).then(()=>{if(!this.popup)throw A.rpc.internal();return this.popup})),this.url=new URL(e),this.metadata=n,this.preference=s}}function Bn(t){const e=xt(Wn(t),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");return n.searchParams.set("version",ie),n.searchParams.set("code",e.code.toString()),n.searchParams.set("message",e.message),Object.assign(Object.assign({},e),{docUrl:n.href})}function Wn(t){var e;if(typeof t=="string")return{message:t,code:D.rpc.internal};if(j(t)){const n=t.errorMessage,s=(e=t.errorCode)!==null&&e!==void 0?e:n.match(/(denied|rejected)/i)?D.provider.userRejectedRequest:void 0;return Object.assign(Object.assign({},t),{message:n,code:s,data:{method:t.method}})}return t}class qn extends _t{}var Kn=function(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(t);r(r||(r=Fn(s)),r)}}export{Vn as createCoinbaseWalletSDK}; diff --git a/create-onchain/src/manifest/assets/index-BSvUHPor.js b/create-onchain/src/manifest/assets/index-BSvUHPor.js new file mode 100644 index 0000000000..719e3de22c --- /dev/null +++ b/create-onchain/src/manifest/assets/index-BSvUHPor.js @@ -0,0 +1,12 @@ +import{a as rr,c as Xt,r as lh,g as hh}from"./index-TwqOwjr2.js";import{p as fh,h as dh}from"./hooks.module-DVREuRDX.js";import{r as ph}from"./browser-0t0YC0rb.js";var Nn={},ar={},cr={},fo;function gh(){if(fo)return cr;fo=1,Object.defineProperty(cr,"__esModule",{value:!0}),cr.walletLogo=void 0;const e=(r,n)=>{let t;switch(r){case"standard":return t=n,`data:image/svg+xml,%3Csvg width='${n}' height='${t}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return t=n,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${n}' height='${t}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return t=(.1*n).toFixed(2),`data:image/svg+xml,%3Csvg width='${n}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return t=(.25*n).toFixed(2),`data:image/svg+xml,%3Csvg width='${n}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return t=(.1*n).toFixed(2),`data:image/svg+xml,%3Csvg width='${n}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return t=(.25*n).toFixed(2),`data:image/svg+xml,%3Csvg width='${n}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return t=n,`data:image/svg+xml,%3Csvg width='${n}' height='${t}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};return cr.walletLogo=e,cr}var ur={},po;function mh(){return po||(po=1,Object.defineProperty(ur,"__esModule",{value:!0}),ur.LINK_API_URL=void 0,ur.LINK_API_URL="https://www.walletlink.org"),ur}var ne={},dn={exports:{}};const vh={},yh=Object.freeze(Object.defineProperty({__proto__:null,default:vh},Symbol.toStringTag,{value:"Module"})),js=rr(yh);var wh=dn.exports,go;function mn(){return go||(go=1,function(e){(function(r,n){function t(q,h){if(!q)throw new Error(h||"Assertion failed")}function l(q,h){q.super_=h;var E=function(){};E.prototype=h.prototype,q.prototype=new E,q.prototype.constructor=q}function i(q,h,E){if(i.isBN(q))return q;this.negative=0,this.words=null,this.length=0,this.red=null,q!==null&&((h==="le"||h==="be")&&(E=h,h=10),this._init(q||0,h||10,E||"be"))}typeof r=="object"?r.exports=i:n.BN=i,i.BN=i,i.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=js.Buffer}catch{}i.isBN=function(h){return h instanceof i?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===i.wordSize&&Array.isArray(h.words)},i.max=function(h,E){return h.cmp(E)>0?h:E},i.min=function(h,E){return h.cmp(E)<0?h:E},i.prototype._init=function(h,E,M){if(typeof h=="number")return this._initNumber(h,E,M);if(typeof h=="object")return this._initArray(h,E,M);E==="hex"&&(E=16),t(E===(E|0)&&E>=2&&E<=36),h=h.toString().replace(/\s+/g,"");var I=0;h[0]==="-"&&(I++,this.negative=1),I=0;I-=3)O=h[I]|h[I-1]<<8|h[I-2]<<16,this.words[A]|=O<<$&67108863,this.words[A+1]=O>>>26-$&67108863,$+=24,$>=26&&($-=26,A++);else if(M==="le")for(I=0,A=0;I>>26-$&67108863,$+=24,$>=26&&($-=26,A++);return this._strip()};function a(q,h){var E=q.charCodeAt(h);if(E>=48&&E<=57)return E-48;if(E>=65&&E<=70)return E-55;if(E>=97&&E<=102)return E-87;t(!1,"Invalid character in "+q)}function d(q,h,E){var M=a(q,E);return E-1>=h&&(M|=a(q,E-1)<<4),M}i.prototype._parseHex=function(h,E,M){this.length=Math.ceil((h.length-E)/6),this.words=new Array(this.length);for(var I=0;I=E;I-=2)$=d(h,E,I)<=18?(A-=18,O+=1,this.words[O]|=$>>>26):A+=8;else{var L=h.length-E;for(I=L%2===0?E+1:E;I=18?(A-=18,O+=1,this.words[O]|=$>>>26):A+=8}this._strip()};function g(q,h,E,M){for(var I=0,A=0,O=Math.min(q.length,E),$=h;$=49?A=L-49+10:L>=17?A=L-17+10:A=L,t(L>=0&&A1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=u}catch{i.prototype.inspect=u}else i.prototype.inspect=u;function u(){return(this.red?""}var f=["","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"],s=[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],p=[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];i.prototype.toString=function(h,E){h=h||10,E=E|0||1;var M;if(h===16||h==="hex"){M="";for(var I=0,A=0,O=0;O>>24-I&16777215,I+=2,I>=26&&(I-=26,O--),A!==0||O!==this.length-1?M=f[6-L.length]+L+M:M=L+M}for(A!==0&&(M=A.toString(16)+M);M.length%E!==0;)M="0"+M;return this.negative!==0&&(M="-"+M),M}if(h===(h|0)&&h>=2&&h<=36){var b=s[h],P=p[h];M="";var te=this.clone();for(te.negative=0;!te.isZero();){var Y=te.modrn(P).toString(h);te=te.idivn(P),te.isZero()?M=Y+M:M=f[b-Y.length]+Y+M}for(this.isZero()&&(M="0"+M);M.length%E!==0;)M="0"+M;return this.negative!==0&&(M="-"+M),M}t(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var h=this.words[0];return this.length===2?h+=this.words[1]*67108864:this.length===3&&this.words[2]===1?h+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(h,E){return this.toArrayLike(o,h,E)}),i.prototype.toArray=function(h,E){return this.toArrayLike(Array,h,E)};var y=function(h,E){return h.allocUnsafe?h.allocUnsafe(E):new h(E)};i.prototype.toArrayLike=function(h,E,M){this._strip();var I=this.byteLength(),A=M||Math.max(1,I);t(I<=A,"byte array longer than desired length"),t(A>0,"Requested array length <= 0");var O=y(h,A),$=E==="le"?"LE":"BE";return this["_toArrayLike"+$](O,I),O},i.prototype._toArrayLikeLE=function(h,E){for(var M=0,I=0,A=0,O=0;A>8&255),M>16&255),O===6?(M>24&255),I=0,O=0):(I=$>>>24,O+=2)}if(M=0&&(h[M--]=$>>8&255),M>=0&&(h[M--]=$>>16&255),O===6?(M>=0&&(h[M--]=$>>24&255),I=0,O=0):(I=$>>>24,O+=2)}if(M>=0)for(h[M--]=I;M>=0;)h[M--]=0},Math.clz32?i.prototype._countBits=function(h){return 32-Math.clz32(h)}:i.prototype._countBits=function(h){var E=h,M=0;return E>=4096&&(M+=13,E>>>=13),E>=64&&(M+=7,E>>>=7),E>=8&&(M+=4,E>>>=4),E>=2&&(M+=2,E>>>=2),M+E},i.prototype._zeroBits=function(h){if(h===0)return 26;var E=h,M=0;return(E&8191)===0&&(M+=13,E>>>=13),(E&127)===0&&(M+=7,E>>>=7),(E&15)===0&&(M+=4,E>>>=4),(E&3)===0&&(M+=2,E>>>=2),(E&1)===0&&M++,M},i.prototype.bitLength=function(){var h=this.words[this.length-1],E=this._countBits(h);return(this.length-1)*26+E};function w(q){for(var h=new Array(q.bitLength()),E=0;E>>I&1}return h}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var h=0,E=0;Eh.length?this.clone().ior(h):h.clone().ior(this)},i.prototype.uor=function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},i.prototype.iuand=function(h){var E;this.length>h.length?E=h:E=this;for(var M=0;Mh.length?this.clone().iand(h):h.clone().iand(this)},i.prototype.uand=function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},i.prototype.iuxor=function(h){var E,M;this.length>h.length?(E=this,M=h):(E=h,M=this);for(var I=0;Ih.length?this.clone().ixor(h):h.clone().ixor(this)},i.prototype.uxor=function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},i.prototype.inotn=function(h){t(typeof h=="number"&&h>=0);var E=Math.ceil(h/26)|0,M=h%26;this._expand(E),M>0&&E--;for(var I=0;I0&&(this.words[I]=~this.words[I]&67108863>>26-M),this._strip()},i.prototype.notn=function(h){return this.clone().inotn(h)},i.prototype.setn=function(h,E){t(typeof h=="number"&&h>=0);var M=h/26|0,I=h%26;return this._expand(M+1),E?this.words[M]=this.words[M]|1<h.length?(M=this,I=h):(M=h,I=this);for(var A=0,O=0;O>>26;for(;A!==0&&O>>26;if(this.length=M.length,A!==0)this.words[this.length]=A,this.length++;else if(M!==this)for(;Oh.length?this.clone().iadd(h):h.clone().iadd(this)},i.prototype.isub=function(h){if(h.negative!==0){h.negative=0;var E=this.iadd(h);return h.negative=1,E._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var M=this.cmp(h);if(M===0)return this.negative=0,this.length=1,this.words[0]=0,this;var I,A;M>0?(I=this,A=h):(I=h,A=this);for(var O=0,$=0;$>26,this.words[$]=E&67108863;for(;O!==0&&$>26,this.words[$]=E&67108863;if(O===0&&$>>26,te=L&67108863,Y=Math.min(b,h.length-1),U=Math.max(0,b-q.length+1);U<=Y;U++){var W=b-U|0;I=q.words[W]|0,A=h.words[U]|0,O=I*A+te,P+=O/67108864|0,te=O&67108863}E.words[b]=te|0,L=P|0}return L!==0?E.words[b]=L|0:E.length--,E._strip()}var R=function(h,E,M){var I=h.words,A=E.words,O=M.words,$=0,L,b,P,te=I[0]|0,Y=te&8191,U=te>>>13,W=I[1]|0,G=W&8191,ee=W>>>13,oe=I[2]|0,F=oe&8191,D=oe>>>13,K=I[3]|0,X=K&8191,ae=K>>>13,le=I[4]|0,ie=le&8191,de=le>>>13,He=I[5]|0,me=He&8191,he=He>>>13,be=I[6]|0,pe=be&8191,ve=be>>>13,je=I[7]|0,ye=je&8191,x=je>>>13,v=I[8]|0,_=v&8191,B=v>>>13,H=I[9]|0,V=H&8191,J=H>>>13,fe=A[0]|0,ue=fe&8191,ce=fe>>>13,we=A[1]|0,se=we&8191,_e=we>>>13,Vt=A[2]|0,Ee=Vt&8191,Re=Vt>>>13,zt=A[3]|0,Se=zt&8191,Me=zt>>>13,Jt=A[4]|0,ke=Jt&8191,Ce=Jt>>>13,Gt=A[5]|0,Ie=Gt&8191,xe=Gt>>>13,Zt=A[6]|0,Ae=Zt&8191,Le=Zt>>>13,Kt=A[7]|0,Te=Kt&8191,Be=Kt>>>13,Qt=A[8]|0,Ne=Qt&8191,Oe=Qt>>>13,Yt=A[9]|0,Pe=Yt&8191,Fe=Yt>>>13;M.negative=h.negative^E.negative,M.length=19,L=Math.imul(Y,ue),b=Math.imul(Y,ce),b=b+Math.imul(U,ue)|0,P=Math.imul(U,ce);var at=($+L|0)+((b&8191)<<13)|0;$=(P+(b>>>13)|0)+(at>>>26)|0,at&=67108863,L=Math.imul(G,ue),b=Math.imul(G,ce),b=b+Math.imul(ee,ue)|0,P=Math.imul(ee,ce),L=L+Math.imul(Y,se)|0,b=b+Math.imul(Y,_e)|0,b=b+Math.imul(U,se)|0,P=P+Math.imul(U,_e)|0;var ct=($+L|0)+((b&8191)<<13)|0;$=(P+(b>>>13)|0)+(ct>>>26)|0,ct&=67108863,L=Math.imul(F,ue),b=Math.imul(F,ce),b=b+Math.imul(D,ue)|0,P=Math.imul(D,ce),L=L+Math.imul(G,se)|0,b=b+Math.imul(G,_e)|0,b=b+Math.imul(ee,se)|0,P=P+Math.imul(ee,_e)|0,L=L+Math.imul(Y,Ee)|0,b=b+Math.imul(Y,Re)|0,b=b+Math.imul(U,Ee)|0,P=P+Math.imul(U,Re)|0;var ut=($+L|0)+((b&8191)<<13)|0;$=(P+(b>>>13)|0)+(ut>>>26)|0,ut&=67108863,L=Math.imul(X,ue),b=Math.imul(X,ce),b=b+Math.imul(ae,ue)|0,P=Math.imul(ae,ce),L=L+Math.imul(F,se)|0,b=b+Math.imul(F,_e)|0,b=b+Math.imul(D,se)|0,P=P+Math.imul(D,_e)|0,L=L+Math.imul(G,Ee)|0,b=b+Math.imul(G,Re)|0,b=b+Math.imul(ee,Ee)|0,P=P+Math.imul(ee,Re)|0,L=L+Math.imul(Y,Se)|0,b=b+Math.imul(Y,Me)|0,b=b+Math.imul(U,Se)|0,P=P+Math.imul(U,Me)|0;var lt=($+L|0)+((b&8191)<<13)|0;$=(P+(b>>>13)|0)+(lt>>>26)|0,lt&=67108863,L=Math.imul(ie,ue),b=Math.imul(ie,ce),b=b+Math.imul(de,ue)|0,P=Math.imul(de,ce),L=L+Math.imul(X,se)|0,b=b+Math.imul(X,_e)|0,b=b+Math.imul(ae,se)|0,P=P+Math.imul(ae,_e)|0,L=L+Math.imul(F,Ee)|0,b=b+Math.imul(F,Re)|0,b=b+Math.imul(D,Ee)|0,P=P+Math.imul(D,Re)|0,L=L+Math.imul(G,Se)|0,b=b+Math.imul(G,Me)|0,b=b+Math.imul(ee,Se)|0,P=P+Math.imul(ee,Me)|0,L=L+Math.imul(Y,ke)|0,b=b+Math.imul(Y,Ce)|0,b=b+Math.imul(U,ke)|0,P=P+Math.imul(U,Ce)|0;var ht=($+L|0)+((b&8191)<<13)|0;$=(P+(b>>>13)|0)+(ht>>>26)|0,ht&=67108863,L=Math.imul(me,ue),b=Math.imul(me,ce),b=b+Math.imul(he,ue)|0,P=Math.imul(he,ce),L=L+Math.imul(ie,se)|0,b=b+Math.imul(ie,_e)|0,b=b+Math.imul(de,se)|0,P=P+Math.imul(de,_e)|0,L=L+Math.imul(X,Ee)|0,b=b+Math.imul(X,Re)|0,b=b+Math.imul(ae,Ee)|0,P=P+Math.imul(ae,Re)|0,L=L+Math.imul(F,Se)|0,b=b+Math.imul(F,Me)|0,b=b+Math.imul(D,Se)|0,P=P+Math.imul(D,Me)|0,L=L+Math.imul(G,ke)|0,b=b+Math.imul(G,Ce)|0,b=b+Math.imul(ee,ke)|0,P=P+Math.imul(ee,Ce)|0,L=L+Math.imul(Y,Ie)|0,b=b+Math.imul(Y,xe)|0,b=b+Math.imul(U,Ie)|0,P=P+Math.imul(U,xe)|0;var ft=($+L|0)+((b&8191)<<13)|0;$=(P+(b>>>13)|0)+(ft>>>26)|0,ft&=67108863,L=Math.imul(pe,ue),b=Math.imul(pe,ce),b=b+Math.imul(ve,ue)|0,P=Math.imul(ve,ce),L=L+Math.imul(me,se)|0,b=b+Math.imul(me,_e)|0,b=b+Math.imul(he,se)|0,P=P+Math.imul(he,_e)|0,L=L+Math.imul(ie,Ee)|0,b=b+Math.imul(ie,Re)|0,b=b+Math.imul(de,Ee)|0,P=P+Math.imul(de,Re)|0,L=L+Math.imul(X,Se)|0,b=b+Math.imul(X,Me)|0,b=b+Math.imul(ae,Se)|0,P=P+Math.imul(ae,Me)|0,L=L+Math.imul(F,ke)|0,b=b+Math.imul(F,Ce)|0,b=b+Math.imul(D,ke)|0,P=P+Math.imul(D,Ce)|0,L=L+Math.imul(G,Ie)|0,b=b+Math.imul(G,xe)|0,b=b+Math.imul(ee,Ie)|0,P=P+Math.imul(ee,xe)|0,L=L+Math.imul(Y,Ae)|0,b=b+Math.imul(Y,Le)|0,b=b+Math.imul(U,Ae)|0,P=P+Math.imul(U,Le)|0;var dt=($+L|0)+((b&8191)<<13)|0;$=(P+(b>>>13)|0)+(dt>>>26)|0,dt&=67108863,L=Math.imul(ye,ue),b=Math.imul(ye,ce),b=b+Math.imul(x,ue)|0,P=Math.imul(x,ce),L=L+Math.imul(pe,se)|0,b=b+Math.imul(pe,_e)|0,b=b+Math.imul(ve,se)|0,P=P+Math.imul(ve,_e)|0,L=L+Math.imul(me,Ee)|0,b=b+Math.imul(me,Re)|0,b=b+Math.imul(he,Ee)|0,P=P+Math.imul(he,Re)|0,L=L+Math.imul(ie,Se)|0,b=b+Math.imul(ie,Me)|0,b=b+Math.imul(de,Se)|0,P=P+Math.imul(de,Me)|0,L=L+Math.imul(X,ke)|0,b=b+Math.imul(X,Ce)|0,b=b+Math.imul(ae,ke)|0,P=P+Math.imul(ae,Ce)|0,L=L+Math.imul(F,Ie)|0,b=b+Math.imul(F,xe)|0,b=b+Math.imul(D,Ie)|0,P=P+Math.imul(D,xe)|0,L=L+Math.imul(G,Ae)|0,b=b+Math.imul(G,Le)|0,b=b+Math.imul(ee,Ae)|0,P=P+Math.imul(ee,Le)|0,L=L+Math.imul(Y,Te)|0,b=b+Math.imul(Y,Be)|0,b=b+Math.imul(U,Te)|0,P=P+Math.imul(U,Be)|0;var pt=($+L|0)+((b&8191)<<13)|0;$=(P+(b>>>13)|0)+(pt>>>26)|0,pt&=67108863,L=Math.imul(_,ue),b=Math.imul(_,ce),b=b+Math.imul(B,ue)|0,P=Math.imul(B,ce),L=L+Math.imul(ye,se)|0,b=b+Math.imul(ye,_e)|0,b=b+Math.imul(x,se)|0,P=P+Math.imul(x,_e)|0,L=L+Math.imul(pe,Ee)|0,b=b+Math.imul(pe,Re)|0,b=b+Math.imul(ve,Ee)|0,P=P+Math.imul(ve,Re)|0,L=L+Math.imul(me,Se)|0,b=b+Math.imul(me,Me)|0,b=b+Math.imul(he,Se)|0,P=P+Math.imul(he,Me)|0,L=L+Math.imul(ie,ke)|0,b=b+Math.imul(ie,Ce)|0,b=b+Math.imul(de,ke)|0,P=P+Math.imul(de,Ce)|0,L=L+Math.imul(X,Ie)|0,b=b+Math.imul(X,xe)|0,b=b+Math.imul(ae,Ie)|0,P=P+Math.imul(ae,xe)|0,L=L+Math.imul(F,Ae)|0,b=b+Math.imul(F,Le)|0,b=b+Math.imul(D,Ae)|0,P=P+Math.imul(D,Le)|0,L=L+Math.imul(G,Te)|0,b=b+Math.imul(G,Be)|0,b=b+Math.imul(ee,Te)|0,P=P+Math.imul(ee,Be)|0,L=L+Math.imul(Y,Ne)|0,b=b+Math.imul(Y,Oe)|0,b=b+Math.imul(U,Ne)|0,P=P+Math.imul(U,Oe)|0;var gt=($+L|0)+((b&8191)<<13)|0;$=(P+(b>>>13)|0)+(gt>>>26)|0,gt&=67108863,L=Math.imul(V,ue),b=Math.imul(V,ce),b=b+Math.imul(J,ue)|0,P=Math.imul(J,ce),L=L+Math.imul(_,se)|0,b=b+Math.imul(_,_e)|0,b=b+Math.imul(B,se)|0,P=P+Math.imul(B,_e)|0,L=L+Math.imul(ye,Ee)|0,b=b+Math.imul(ye,Re)|0,b=b+Math.imul(x,Ee)|0,P=P+Math.imul(x,Re)|0,L=L+Math.imul(pe,Se)|0,b=b+Math.imul(pe,Me)|0,b=b+Math.imul(ve,Se)|0,P=P+Math.imul(ve,Me)|0,L=L+Math.imul(me,ke)|0,b=b+Math.imul(me,Ce)|0,b=b+Math.imul(he,ke)|0,P=P+Math.imul(he,Ce)|0,L=L+Math.imul(ie,Ie)|0,b=b+Math.imul(ie,xe)|0,b=b+Math.imul(de,Ie)|0,P=P+Math.imul(de,xe)|0,L=L+Math.imul(X,Ae)|0,b=b+Math.imul(X,Le)|0,b=b+Math.imul(ae,Ae)|0,P=P+Math.imul(ae,Le)|0,L=L+Math.imul(F,Te)|0,b=b+Math.imul(F,Be)|0,b=b+Math.imul(D,Te)|0,P=P+Math.imul(D,Be)|0,L=L+Math.imul(G,Ne)|0,b=b+Math.imul(G,Oe)|0,b=b+Math.imul(ee,Ne)|0,P=P+Math.imul(ee,Oe)|0,L=L+Math.imul(Y,Pe)|0,b=b+Math.imul(Y,Fe)|0,b=b+Math.imul(U,Pe)|0,P=P+Math.imul(U,Fe)|0;var mt=($+L|0)+((b&8191)<<13)|0;$=(P+(b>>>13)|0)+(mt>>>26)|0,mt&=67108863,L=Math.imul(V,se),b=Math.imul(V,_e),b=b+Math.imul(J,se)|0,P=Math.imul(J,_e),L=L+Math.imul(_,Ee)|0,b=b+Math.imul(_,Re)|0,b=b+Math.imul(B,Ee)|0,P=P+Math.imul(B,Re)|0,L=L+Math.imul(ye,Se)|0,b=b+Math.imul(ye,Me)|0,b=b+Math.imul(x,Se)|0,P=P+Math.imul(x,Me)|0,L=L+Math.imul(pe,ke)|0,b=b+Math.imul(pe,Ce)|0,b=b+Math.imul(ve,ke)|0,P=P+Math.imul(ve,Ce)|0,L=L+Math.imul(me,Ie)|0,b=b+Math.imul(me,xe)|0,b=b+Math.imul(he,Ie)|0,P=P+Math.imul(he,xe)|0,L=L+Math.imul(ie,Ae)|0,b=b+Math.imul(ie,Le)|0,b=b+Math.imul(de,Ae)|0,P=P+Math.imul(de,Le)|0,L=L+Math.imul(X,Te)|0,b=b+Math.imul(X,Be)|0,b=b+Math.imul(ae,Te)|0,P=P+Math.imul(ae,Be)|0,L=L+Math.imul(F,Ne)|0,b=b+Math.imul(F,Oe)|0,b=b+Math.imul(D,Ne)|0,P=P+Math.imul(D,Oe)|0,L=L+Math.imul(G,Pe)|0,b=b+Math.imul(G,Fe)|0,b=b+Math.imul(ee,Pe)|0,P=P+Math.imul(ee,Fe)|0;var vt=($+L|0)+((b&8191)<<13)|0;$=(P+(b>>>13)|0)+(vt>>>26)|0,vt&=67108863,L=Math.imul(V,Ee),b=Math.imul(V,Re),b=b+Math.imul(J,Ee)|0,P=Math.imul(J,Re),L=L+Math.imul(_,Se)|0,b=b+Math.imul(_,Me)|0,b=b+Math.imul(B,Se)|0,P=P+Math.imul(B,Me)|0,L=L+Math.imul(ye,ke)|0,b=b+Math.imul(ye,Ce)|0,b=b+Math.imul(x,ke)|0,P=P+Math.imul(x,Ce)|0,L=L+Math.imul(pe,Ie)|0,b=b+Math.imul(pe,xe)|0,b=b+Math.imul(ve,Ie)|0,P=P+Math.imul(ve,xe)|0,L=L+Math.imul(me,Ae)|0,b=b+Math.imul(me,Le)|0,b=b+Math.imul(he,Ae)|0,P=P+Math.imul(he,Le)|0,L=L+Math.imul(ie,Te)|0,b=b+Math.imul(ie,Be)|0,b=b+Math.imul(de,Te)|0,P=P+Math.imul(de,Be)|0,L=L+Math.imul(X,Ne)|0,b=b+Math.imul(X,Oe)|0,b=b+Math.imul(ae,Ne)|0,P=P+Math.imul(ae,Oe)|0,L=L+Math.imul(F,Pe)|0,b=b+Math.imul(F,Fe)|0,b=b+Math.imul(D,Pe)|0,P=P+Math.imul(D,Fe)|0;var yt=($+L|0)+((b&8191)<<13)|0;$=(P+(b>>>13)|0)+(yt>>>26)|0,yt&=67108863,L=Math.imul(V,Se),b=Math.imul(V,Me),b=b+Math.imul(J,Se)|0,P=Math.imul(J,Me),L=L+Math.imul(_,ke)|0,b=b+Math.imul(_,Ce)|0,b=b+Math.imul(B,ke)|0,P=P+Math.imul(B,Ce)|0,L=L+Math.imul(ye,Ie)|0,b=b+Math.imul(ye,xe)|0,b=b+Math.imul(x,Ie)|0,P=P+Math.imul(x,xe)|0,L=L+Math.imul(pe,Ae)|0,b=b+Math.imul(pe,Le)|0,b=b+Math.imul(ve,Ae)|0,P=P+Math.imul(ve,Le)|0,L=L+Math.imul(me,Te)|0,b=b+Math.imul(me,Be)|0,b=b+Math.imul(he,Te)|0,P=P+Math.imul(he,Be)|0,L=L+Math.imul(ie,Ne)|0,b=b+Math.imul(ie,Oe)|0,b=b+Math.imul(de,Ne)|0,P=P+Math.imul(de,Oe)|0,L=L+Math.imul(X,Pe)|0,b=b+Math.imul(X,Fe)|0,b=b+Math.imul(ae,Pe)|0,P=P+Math.imul(ae,Fe)|0;var wt=($+L|0)+((b&8191)<<13)|0;$=(P+(b>>>13)|0)+(wt>>>26)|0,wt&=67108863,L=Math.imul(V,ke),b=Math.imul(V,Ce),b=b+Math.imul(J,ke)|0,P=Math.imul(J,Ce),L=L+Math.imul(_,Ie)|0,b=b+Math.imul(_,xe)|0,b=b+Math.imul(B,Ie)|0,P=P+Math.imul(B,xe)|0,L=L+Math.imul(ye,Ae)|0,b=b+Math.imul(ye,Le)|0,b=b+Math.imul(x,Ae)|0,P=P+Math.imul(x,Le)|0,L=L+Math.imul(pe,Te)|0,b=b+Math.imul(pe,Be)|0,b=b+Math.imul(ve,Te)|0,P=P+Math.imul(ve,Be)|0,L=L+Math.imul(me,Ne)|0,b=b+Math.imul(me,Oe)|0,b=b+Math.imul(he,Ne)|0,P=P+Math.imul(he,Oe)|0,L=L+Math.imul(ie,Pe)|0,b=b+Math.imul(ie,Fe)|0,b=b+Math.imul(de,Pe)|0,P=P+Math.imul(de,Fe)|0;var bt=($+L|0)+((b&8191)<<13)|0;$=(P+(b>>>13)|0)+(bt>>>26)|0,bt&=67108863,L=Math.imul(V,Ie),b=Math.imul(V,xe),b=b+Math.imul(J,Ie)|0,P=Math.imul(J,xe),L=L+Math.imul(_,Ae)|0,b=b+Math.imul(_,Le)|0,b=b+Math.imul(B,Ae)|0,P=P+Math.imul(B,Le)|0,L=L+Math.imul(ye,Te)|0,b=b+Math.imul(ye,Be)|0,b=b+Math.imul(x,Te)|0,P=P+Math.imul(x,Be)|0,L=L+Math.imul(pe,Ne)|0,b=b+Math.imul(pe,Oe)|0,b=b+Math.imul(ve,Ne)|0,P=P+Math.imul(ve,Oe)|0,L=L+Math.imul(me,Pe)|0,b=b+Math.imul(me,Fe)|0,b=b+Math.imul(he,Pe)|0,P=P+Math.imul(he,Fe)|0;var _t=($+L|0)+((b&8191)<<13)|0;$=(P+(b>>>13)|0)+(_t>>>26)|0,_t&=67108863,L=Math.imul(V,Ae),b=Math.imul(V,Le),b=b+Math.imul(J,Ae)|0,P=Math.imul(J,Le),L=L+Math.imul(_,Te)|0,b=b+Math.imul(_,Be)|0,b=b+Math.imul(B,Te)|0,P=P+Math.imul(B,Be)|0,L=L+Math.imul(ye,Ne)|0,b=b+Math.imul(ye,Oe)|0,b=b+Math.imul(x,Ne)|0,P=P+Math.imul(x,Oe)|0,L=L+Math.imul(pe,Pe)|0,b=b+Math.imul(pe,Fe)|0,b=b+Math.imul(ve,Pe)|0,P=P+Math.imul(ve,Fe)|0;var An=($+L|0)+((b&8191)<<13)|0;$=(P+(b>>>13)|0)+(An>>>26)|0,An&=67108863,L=Math.imul(V,Te),b=Math.imul(V,Be),b=b+Math.imul(J,Te)|0,P=Math.imul(J,Be),L=L+Math.imul(_,Ne)|0,b=b+Math.imul(_,Oe)|0,b=b+Math.imul(B,Ne)|0,P=P+Math.imul(B,Oe)|0,L=L+Math.imul(ye,Pe)|0,b=b+Math.imul(ye,Fe)|0,b=b+Math.imul(x,Pe)|0,P=P+Math.imul(x,Fe)|0;var Ln=($+L|0)+((b&8191)<<13)|0;$=(P+(b>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,L=Math.imul(V,Ne),b=Math.imul(V,Oe),b=b+Math.imul(J,Ne)|0,P=Math.imul(J,Oe),L=L+Math.imul(_,Pe)|0,b=b+Math.imul(_,Fe)|0,b=b+Math.imul(B,Pe)|0,P=P+Math.imul(B,Fe)|0;var Tn=($+L|0)+((b&8191)<<13)|0;$=(P+(b>>>13)|0)+(Tn>>>26)|0,Tn&=67108863,L=Math.imul(V,Pe),b=Math.imul(V,Fe),b=b+Math.imul(J,Pe)|0,P=Math.imul(J,Fe);var Bn=($+L|0)+((b&8191)<<13)|0;return $=(P+(b>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,O[0]=at,O[1]=ct,O[2]=ut,O[3]=lt,O[4]=ht,O[5]=ft,O[6]=dt,O[7]=pt,O[8]=gt,O[9]=mt,O[10]=vt,O[11]=yt,O[12]=wt,O[13]=bt,O[14]=_t,O[15]=An,O[16]=Ln,O[17]=Tn,O[18]=Bn,$!==0&&(O[19]=$,M.length++),M};Math.imul||(R=c);function S(q,h,E){E.negative=h.negative^q.negative,E.length=q.length+h.length;for(var M=0,I=0,A=0;A>>26)|0,I+=O>>>26,O&=67108863}E.words[A]=$,M=O,O=I}return M!==0?E.words[A]=M:E.length--,E._strip()}function k(q,h,E){return S(q,h,E)}i.prototype.mulTo=function(h,E){var M,I=this.length+h.length;return this.length===10&&h.length===10?M=R(this,h,E):I<63?M=c(this,h,E):I<1024?M=S(this,h,E):M=k(this,h,E),M},i.prototype.mul=function(h){var E=new i(null);return E.words=new Array(this.length+h.length),this.mulTo(h,E)},i.prototype.mulf=function(h){var E=new i(null);return E.words=new Array(this.length+h.length),k(this,h,E)},i.prototype.imul=function(h){return this.clone().mulTo(h,this)},i.prototype.imuln=function(h){var E=h<0;E&&(h=-h),t(typeof h=="number"),t(h<67108864);for(var M=0,I=0;I>=26,M+=A/67108864|0,M+=O>>>26,this.words[I]=O&67108863}return M!==0&&(this.words[I]=M,this.length++),E?this.ineg():this},i.prototype.muln=function(h){return this.clone().imuln(h)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(h){var E=w(h);if(E.length===0)return new i(1);for(var M=this,I=0;I=0);var E=h%26,M=(h-E)/26,I=67108863>>>26-E<<26-E,A;if(E!==0){var O=0;for(A=0;A>>26-E}O&&(this.words[A]=O,this.length++)}if(M!==0){for(A=this.length-1;A>=0;A--)this.words[A+M]=this.words[A];for(A=0;A=0);var I;E?I=(E-E%26)/26:I=0;var A=h%26,O=Math.min((h-A)/26,this.length),$=67108863^67108863>>>A<O)for(this.length-=O,b=0;b=0&&(P!==0||b>=I);b--){var te=this.words[b]|0;this.words[b]=P<<26-A|te>>>A,P=te&$}return L&&P!==0&&(L.words[L.length++]=P),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(h,E,M){return t(this.negative===0),this.iushrn(h,E,M)},i.prototype.shln=function(h){return this.clone().ishln(h)},i.prototype.ushln=function(h){return this.clone().iushln(h)},i.prototype.shrn=function(h){return this.clone().ishrn(h)},i.prototype.ushrn=function(h){return this.clone().iushrn(h)},i.prototype.testn=function(h){t(typeof h=="number"&&h>=0);var E=h%26,M=(h-E)/26,I=1<=0);var E=h%26,M=(h-E)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=M)return this;if(E!==0&&M++,this.length=Math.min(M,this.length),E!==0){var I=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},i.prototype.isubn=function(h){if(t(typeof h=="number"),t(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var E=0;E>26)-(L/67108864|0),this.words[A+M]=O&67108863}for(;A>26,this.words[A+M]=O&67108863;if($===0)return this._strip();for(t($===-1),$=0,A=0;A>26,this.words[A]=O&67108863;return this.negative=1,this._strip()},i.prototype._wordDiv=function(h,E){var M=this.length-h.length,I=this.clone(),A=h,O=A.words[A.length-1]|0,$=this._countBits(O);M=26-$,M!==0&&(A=A.ushln(M),I.iushln(M),O=A.words[A.length-1]|0);var L=I.length-A.length,b;if(E!=="mod"){b=new i(null),b.length=L+1,b.words=new Array(b.length);for(var P=0;P=0;Y--){var U=(I.words[A.length+Y]|0)*67108864+(I.words[A.length+Y-1]|0);for(U=Math.min(U/O|0,67108863),I._ishlnsubmul(A,U,Y);I.negative!==0;)U--,I.negative=0,I._ishlnsubmul(A,1,Y),I.isZero()||(I.negative^=1);b&&(b.words[Y]=U)}return b&&b._strip(),I._strip(),E!=="div"&&M!==0&&I.iushrn(M),{div:b||null,mod:I}},i.prototype.divmod=function(h,E,M){if(t(!h.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var I,A,O;return this.negative!==0&&h.negative===0?(O=this.neg().divmod(h,E),E!=="mod"&&(I=O.div.neg()),E!=="div"&&(A=O.mod.neg(),M&&A.negative!==0&&A.iadd(h)),{div:I,mod:A}):this.negative===0&&h.negative!==0?(O=this.divmod(h.neg(),E),E!=="mod"&&(I=O.div.neg()),{div:I,mod:O.mod}):(this.negative&h.negative)!==0?(O=this.neg().divmod(h.neg(),E),E!=="div"&&(A=O.mod.neg(),M&&A.negative!==0&&A.isub(h)),{div:O.div,mod:A}):h.length>this.length||this.cmp(h)<0?{div:new i(0),mod:this}:h.length===1?E==="div"?{div:this.divn(h.words[0]),mod:null}:E==="mod"?{div:null,mod:new i(this.modrn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new i(this.modrn(h.words[0]))}:this._wordDiv(h,E)},i.prototype.div=function(h){return this.divmod(h,"div",!1).div},i.prototype.mod=function(h){return this.divmod(h,"mod",!1).mod},i.prototype.umod=function(h){return this.divmod(h,"mod",!0).mod},i.prototype.divRound=function(h){var E=this.divmod(h);if(E.mod.isZero())return E.div;var M=E.div.negative!==0?E.mod.isub(h):E.mod,I=h.ushrn(1),A=h.andln(1),O=M.cmp(I);return O<0||A===1&&O===0?E.div:E.div.negative!==0?E.div.isubn(1):E.div.iaddn(1)},i.prototype.modrn=function(h){var E=h<0;E&&(h=-h),t(h<=67108863);for(var M=(1<<26)%h,I=0,A=this.length-1;A>=0;A--)I=(M*I+(this.words[A]|0))%h;return E?-I:I},i.prototype.modn=function(h){return this.modrn(h)},i.prototype.idivn=function(h){var E=h<0;E&&(h=-h),t(h<=67108863);for(var M=0,I=this.length-1;I>=0;I--){var A=(this.words[I]|0)+M*67108864;this.words[I]=A/h|0,M=A%h}return this._strip(),E?this.ineg():this},i.prototype.divn=function(h){return this.clone().idivn(h)},i.prototype.egcd=function(h){t(h.negative===0),t(!h.isZero());var E=this,M=h.clone();E.negative!==0?E=E.umod(h):E=E.clone();for(var I=new i(1),A=new i(0),O=new i(0),$=new i(1),L=0;E.isEven()&&M.isEven();)E.iushrn(1),M.iushrn(1),++L;for(var b=M.clone(),P=E.clone();!E.isZero();){for(var te=0,Y=1;(E.words[0]&Y)===0&&te<26;++te,Y<<=1);if(te>0)for(E.iushrn(te);te-- >0;)(I.isOdd()||A.isOdd())&&(I.iadd(b),A.isub(P)),I.iushrn(1),A.iushrn(1);for(var U=0,W=1;(M.words[0]&W)===0&&U<26;++U,W<<=1);if(U>0)for(M.iushrn(U);U-- >0;)(O.isOdd()||$.isOdd())&&(O.iadd(b),$.isub(P)),O.iushrn(1),$.iushrn(1);E.cmp(M)>=0?(E.isub(M),I.isub(O),A.isub($)):(M.isub(E),O.isub(I),$.isub(A))}return{a:O,b:$,gcd:M.iushln(L)}},i.prototype._invmp=function(h){t(h.negative===0),t(!h.isZero());var E=this,M=h.clone();E.negative!==0?E=E.umod(h):E=E.clone();for(var I=new i(1),A=new i(0),O=M.clone();E.cmpn(1)>0&&M.cmpn(1)>0;){for(var $=0,L=1;(E.words[0]&L)===0&&$<26;++$,L<<=1);if($>0)for(E.iushrn($);$-- >0;)I.isOdd()&&I.iadd(O),I.iushrn(1);for(var b=0,P=1;(M.words[0]&P)===0&&b<26;++b,P<<=1);if(b>0)for(M.iushrn(b);b-- >0;)A.isOdd()&&A.iadd(O),A.iushrn(1);E.cmp(M)>=0?(E.isub(M),I.isub(A)):(M.isub(E),A.isub(I))}var te;return E.cmpn(1)===0?te=I:te=A,te.cmpn(0)<0&&te.iadd(h),te},i.prototype.gcd=function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var E=this.clone(),M=h.clone();E.negative=0,M.negative=0;for(var I=0;E.isEven()&&M.isEven();I++)E.iushrn(1),M.iushrn(1);do{for(;E.isEven();)E.iushrn(1);for(;M.isEven();)M.iushrn(1);var A=E.cmp(M);if(A<0){var O=E;E=M,M=O}else if(A===0||M.cmpn(1)===0)break;E.isub(M)}while(!0);return M.iushln(I)},i.prototype.invm=function(h){return this.egcd(h).a.umod(h)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(h){return this.words[0]&h},i.prototype.bincn=function(h){t(typeof h=="number");var E=h%26,M=(h-E)/26,I=1<>>26,$&=67108863,this.words[O]=$}return A!==0&&(this.words[O]=A,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(h){var E=h<0;if(this.negative!==0&&!E)return-1;if(this.negative===0&&E)return 1;this._strip();var M;if(this.length>1)M=1;else{E&&(h=-h),t(h<=67108863,"Number is too big");var I=this.words[0]|0;M=I===h?0:Ih.length)return 1;if(this.length=0;M--){var I=this.words[M]|0,A=h.words[M]|0;if(I!==A){IA&&(E=1);break}}return E},i.prototype.gtn=function(h){return this.cmpn(h)===1},i.prototype.gt=function(h){return this.cmp(h)===1},i.prototype.gten=function(h){return this.cmpn(h)>=0},i.prototype.gte=function(h){return this.cmp(h)>=0},i.prototype.ltn=function(h){return this.cmpn(h)===-1},i.prototype.lt=function(h){return this.cmp(h)===-1},i.prototype.lten=function(h){return this.cmpn(h)<=0},i.prototype.lte=function(h){return this.cmp(h)<=0},i.prototype.eqn=function(h){return this.cmpn(h)===0},i.prototype.eq=function(h){return this.cmp(h)===0},i.red=function(h){return new Q(h)},i.prototype.toRed=function(h){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},i.prototype.fromRed=function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(h){return this.red=h,this},i.prototype.forceRed=function(h){return t(!this.red,"Already a number in reduction context"),this._forceRed(h)},i.prototype.redAdd=function(h){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},i.prototype.redIAdd=function(h){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},i.prototype.redSub=function(h){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},i.prototype.redISub=function(h){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},i.prototype.redShl=function(h){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},i.prototype.redMul=function(h){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},i.prototype.redIMul=function(h){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},i.prototype.redSqr=function(){return t(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return t(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return t(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return t(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return t(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(h){return t(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)};var C={k256:null,p224:null,p192:null,p25519:null};function T(q,h){this.name=q,this.p=new i(h,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}T.prototype._tmp=function(){var h=new i(null);return h.words=new Array(Math.ceil(this.n/13)),h},T.prototype.ireduce=function(h){var E=h,M;do this.split(E,this.tmp),E=this.imulK(E),E=E.iadd(this.tmp),M=E.bitLength();while(M>this.n);var I=M0?E.isub(this.p):E.strip!==void 0?E.strip():E._strip(),E},T.prototype.split=function(h,E){h.iushrn(this.n,0,E)},T.prototype.imulK=function(h){return h.imul(this.k)};function N(){T.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}l(N,T),N.prototype.split=function(h,E){for(var M=4194303,I=Math.min(h.length,9),A=0;A>>22,O=$}O>>>=22,h.words[A-10]=O,O===0&&h.length>10?h.length-=10:h.length-=9},N.prototype.imulK=function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var E=0,M=0;M>>=26,h.words[M]=A,E=I}return E!==0&&(h.words[h.length++]=E),h},i._prime=function(h){if(C[h])return C[h];var E;if(h==="k256")E=new N;else if(h==="p224")E=new j;else if(h==="p192")E=new z;else if(h==="p25519")E=new Z;else throw new Error("Unknown prime "+h);return C[h]=E,E};function Q(q){if(typeof q=="string"){var h=i._prime(q);this.m=h.p,this.prime=h}else t(q.gtn(1),"modulus must be greater than 1"),this.m=q,this.prime=null}Q.prototype._verify1=function(h){t(h.negative===0,"red works only with positives"),t(h.red,"red works only with red numbers")},Q.prototype._verify2=function(h,E){t((h.negative|E.negative)===0,"red works only with positives"),t(h.red&&h.red===E.red,"red works only with red numbers")},Q.prototype.imod=function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):(m(h,h.umod(this.m)._forceRed(this)),h)},Q.prototype.neg=function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},Q.prototype.add=function(h,E){this._verify2(h,E);var M=h.add(E);return M.cmp(this.m)>=0&&M.isub(this.m),M._forceRed(this)},Q.prototype.iadd=function(h,E){this._verify2(h,E);var M=h.iadd(E);return M.cmp(this.m)>=0&&M.isub(this.m),M},Q.prototype.sub=function(h,E){this._verify2(h,E);var M=h.sub(E);return M.cmpn(0)<0&&M.iadd(this.m),M._forceRed(this)},Q.prototype.isub=function(h,E){this._verify2(h,E);var M=h.isub(E);return M.cmpn(0)<0&&M.iadd(this.m),M},Q.prototype.shl=function(h,E){return this._verify1(h),this.imod(h.ushln(E))},Q.prototype.imul=function(h,E){return this._verify2(h,E),this.imod(h.imul(E))},Q.prototype.mul=function(h,E){return this._verify2(h,E),this.imod(h.mul(E))},Q.prototype.isqr=function(h){return this.imul(h,h.clone())},Q.prototype.sqr=function(h){return this.mul(h,h)},Q.prototype.sqrt=function(h){if(h.isZero())return h.clone();var E=this.m.andln(3);if(t(E%2===1),E===3){var M=this.m.add(new i(1)).iushrn(2);return this.pow(h,M)}for(var I=this.m.subn(1),A=0;!I.isZero()&&I.andln(1)===0;)A++,I.iushrn(1);t(!I.isZero());var O=new i(1).toRed(this),$=O.redNeg(),L=this.m.subn(1).iushrn(1),b=this.m.bitLength();for(b=new i(2*b*b).toRed(this);this.pow(b,L).cmp($)!==0;)b.redIAdd($);for(var P=this.pow(b,I),te=this.pow(h,I.addn(1).iushrn(1)),Y=this.pow(h,I),U=A;Y.cmp(O)!==0;){for(var W=Y,G=0;W.cmp(O)!==0;G++)W=W.redSqr();t(G=0;A--){for(var P=E.words[A],te=b-1;te>=0;te--){var Y=P>>te&1;if(O!==I[0]&&(O=this.sqr(O)),Y===0&&$===0){L=0;continue}$<<=1,$|=Y,L++,!(L!==M&&(A!==0||te!==0))&&(O=this.mul(O,I[$]),L=0,$=0)}b=26}return O},Q.prototype.convertTo=function(h){var E=h.umod(this.m);return E===h?E.clone():E},Q.prototype.convertFrom=function(h){var E=h.clone();return E.red=null,E},i.mont=function(h){return new re(h)};function re(q){Q.call(this,q),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}l(re,Q),re.prototype.convertTo=function(h){return this.imod(h.ushln(this.shift))},re.prototype.convertFrom=function(h){var E=this.imod(h.mul(this.rinv));return E.red=null,E},re.prototype.imul=function(h,E){if(h.isZero()||E.isZero())return h.words[0]=0,h.length=1,h;var M=h.imul(E),I=M.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=M.isub(I).iushrn(this.shift),O=A;return A.cmp(this.m)>=0?O=A.isub(this.m):A.cmpn(0)<0&&(O=A.iadd(this.m)),O._forceRed(this)},re.prototype.mul=function(h,E){if(h.isZero()||E.isZero())return new i(0)._forceRed(this);var M=h.mul(E),I=M.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=M.isub(I).iushrn(this.shift),O=A;return A.cmp(this.m)>=0?O=A.isub(this.m):A.cmpn(0)<0&&(O=A.iadd(this.m)),O._forceRed(this)},re.prototype.invm=function(h){var E=this.imod(h._invmp(this.m).mul(this.r2));return E._forceRed(this)}})(e,wh)}(dn)),dn.exports}var On={},Et={},mo;function vn(){return mo||(mo=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.errorValues=Et.standardErrorCodes=void 0,Et.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}},Et.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}}),Et}var lr={},Pn={},vo;function $s(){return vo||(vo=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const r=vn(),n="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function t(f,s=n){if(f&&Number.isInteger(f)){const p=f.toString();if(m(r.errorValues,p))return r.errorValues[p].message;if(d(f))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return s}e.getMessageFromCode=t;function l(f){if(!Number.isInteger(f))return!1;const s=f.toString();return!!(r.errorValues[s]||d(f))}e.isValidCode=l;function i(f){var s;if(typeof f=="number")return f;if(o(f))return(s=f.code)!==null&&s!==void 0?s:f.errorCode}e.getErrorCode=i;function o(f){return typeof f=="object"&&f!==null&&(typeof f.code=="number"||typeof f.errorCode=="number")}function a(f,{shouldIncludeStack:s=!1}={}){const p={};if(f&&typeof f=="object"&&!Array.isArray(f)&&m(f,"code")&&l(f.code)){const y=f;p.code=y.code,y.message&&typeof y.message=="string"?(p.message=y.message,m(y,"data")&&(p.data=y.data)):(p.message=t(p.code),p.data={originalError:g(f)})}else p.code=r.standardErrorCodes.rpc.internal,p.message=u(f,"message")?f.message:n,p.data={originalError:g(f)};return s&&(p.stack=u(f,"stack")?f.stack:void 0),p}e.serialize=a;function d(f){return f>=-32099&&f<=-32e3}function g(f){return f&&typeof f=="object"&&!Array.isArray(f)?Object.assign({},f):f}function m(f,s){return Object.prototype.hasOwnProperty.call(f,s)}function u(f,s){return typeof f=="object"&&f!==null&&s in f&&typeof f[s]=="string"}}(Pn)),Pn}var yo;function bh(){if(yo)return lr;yo=1,Object.defineProperty(lr,"__esModule",{value:!0}),lr.standardErrors=void 0;const e=vn(),r=$s();lr.standardErrors={rpc:{parse:d=>n(e.standardErrorCodes.rpc.parse,d),invalidRequest:d=>n(e.standardErrorCodes.rpc.invalidRequest,d),invalidParams:d=>n(e.standardErrorCodes.rpc.invalidParams,d),methodNotFound:d=>n(e.standardErrorCodes.rpc.methodNotFound,d),internal:d=>n(e.standardErrorCodes.rpc.internal,d),server:d=>{if(!d||typeof d!="object"||Array.isArray(d))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:g}=d;if(!Number.isInteger(g)||g>-32005||g<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return n(g,d)},invalidInput:d=>n(e.standardErrorCodes.rpc.invalidInput,d),resourceNotFound:d=>n(e.standardErrorCodes.rpc.resourceNotFound,d),resourceUnavailable:d=>n(e.standardErrorCodes.rpc.resourceUnavailable,d),transactionRejected:d=>n(e.standardErrorCodes.rpc.transactionRejected,d),methodNotSupported:d=>n(e.standardErrorCodes.rpc.methodNotSupported,d),limitExceeded:d=>n(e.standardErrorCodes.rpc.limitExceeded,d)},provider:{userRejectedRequest:d=>t(e.standardErrorCodes.provider.userRejectedRequest,d),unauthorized:d=>t(e.standardErrorCodes.provider.unauthorized,d),unsupportedMethod:d=>t(e.standardErrorCodes.provider.unsupportedMethod,d),disconnected:d=>t(e.standardErrorCodes.provider.disconnected,d),chainDisconnected:d=>t(e.standardErrorCodes.provider.chainDisconnected,d),unsupportedChain:d=>t(e.standardErrorCodes.provider.unsupportedChain,d),custom:d=>{if(!d||typeof d!="object"||Array.isArray(d))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:g,message:m,data:u}=d;if(!m||typeof m!="string")throw new Error('"message" must be a nonempty string');return new o(g,m,u)}}};function n(d,g){const[m,u]=l(g);return new i(d,m||(0,r.getMessageFromCode)(d),u)}function t(d,g){const[m,u]=l(g);return new o(d,m||(0,r.getMessageFromCode)(d),u)}function l(d){if(d){if(typeof d=="string")return[d];if(typeof d=="object"&&!Array.isArray(d)){const{message:g,data:m}=d;if(g&&typeof g!="string")throw new Error("Must specify string message.");return[g||void 0,m]}}return[]}class i extends Error{constructor(g,m,u){if(!Number.isInteger(g))throw new Error('"code" must be an integer.');if(!m||typeof m!="string")throw new Error('"message" must be a nonempty string.');super(m),this.code=g,u!==void 0&&(this.data=u)}}class o extends i{constructor(g,m,u){if(!a(g))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(g,m,u)}}function a(d){return Number.isInteger(d)&&d>=1e3&&d<=4999}return lr}var hr={},fr={},wo;function Us(){if(wo)return fr;wo=1,Object.defineProperty(fr,"__esModule",{value:!0}),fr.isErrorResponse=void 0;function e(r){return r.errorMessage!==void 0}return fr.isErrorResponse=e,fr}var dr={},bo;function Hs(){return bo||(bo=1,Object.defineProperty(dr,"__esModule",{value:!0}),dr.LIB_VERSION=void 0,dr.LIB_VERSION="3.9.3"),dr}var _o;function _h(){if(_o)return hr;_o=1,Object.defineProperty(hr,"__esModule",{value:!0}),hr.serializeError=void 0;const e=Us(),r=Hs(),n=vn(),t=$s();function l(a,d){const g=(0,t.serialize)(i(a),{shouldIncludeStack:!0}),m=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");m.searchParams.set("version",r.LIB_VERSION),m.searchParams.set("code",g.code.toString());const u=o(g.data,d);return u&&m.searchParams.set("method",u),m.searchParams.set("message",g.message),Object.assign(Object.assign({},g),{docUrl:m.href})}hr.serializeError=l;function i(a){return typeof a=="string"?{message:a,code:n.standardErrorCodes.rpc.internal}:(0,e.isErrorResponse)(a)?Object.assign(Object.assign({},a),{message:a.errorMessage,code:a.errorCode,data:{method:a.method}}):a}function o(a,d){const g=a==null?void 0:a.method;if(g)return g;if(d!==void 0){if(typeof d=="string")return d;if(Array.isArray(d)){if(d.length>0)return d[0].method}else return d.method}}return hr}var Eo;function yn(){return Eo||(Eo=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const r=vn();Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return r.standardErrorCodes}});const n=bh();Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return n.standardErrors}});const t=_h();Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return t.serializeError}});const l=$s();Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return l.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return l.getMessageFromCode}})}(On)),On}var $e={},Ro;function wn(){if(Ro)return $e;Ro=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.ProviderType=$e.RegExpString=$e.IntNumber=$e.BigIntString=$e.AddressString=$e.HexString=$e.OpaqueType=void 0;function e(){return t=>t}$e.OpaqueType=e,$e.HexString=e(),$e.AddressString=e(),$e.BigIntString=e();function r(t){return Math.floor(t)}$e.IntNumber=r,$e.RegExpString=e();var n;return function(t){t.CoinbaseWallet="CoinbaseWallet",t.MetaMask="MetaMask",t.Unselected=""}(n||($e.ProviderType=n={})),$e}var So;function nt(){if(So)return ne;So=1;var e=ne&&ne.__importDefault||function(M){return M&&M.__esModule?M:{default:M}};Object.defineProperty(ne,"__esModule",{value:!0}),ne.isMobileWeb=ne.getLocation=ne.isInIFrame=ne.createQrUrl=ne.getFavicon=ne.range=ne.isBigNumber=ne.ensureParsedJSONObject=ne.ensureBN=ne.ensureRegExpString=ne.ensureIntNumber=ne.ensureBuffer=ne.ensureAddressString=ne.ensureEvenLengthHexString=ne.ensureHexString=ne.isHexString=ne.prepend0x=ne.strip0x=ne.has0xPrefix=ne.hexStringFromIntNumber=ne.intNumberFromHexString=ne.bigIntStringFromBN=ne.hexStringFromBuffer=ne.hexStringToUint8Array=ne.uint8ArrayToHex=ne.randomBytesHex=void 0;const r=e(mn()),n=yn(),t=wn(),l=/^[0-9]*$/,i=/^[a-f0-9]*$/;function o(M){return a(crypto.getRandomValues(new Uint8Array(M)))}ne.randomBytesHex=o;function a(M){return[...M].map(I=>I.toString(16).padStart(2,"0")).join("")}ne.uint8ArrayToHex=a;function d(M){return new Uint8Array(M.match(/.{1,2}/g).map(I=>parseInt(I,16)))}ne.hexStringToUint8Array=d;function g(M,I=!1){const A=M.toString("hex");return(0,t.HexString)(I?`0x${A}`:A)}ne.hexStringFromBuffer=g;function m(M){return(0,t.BigIntString)(M.toString(10))}ne.bigIntStringFromBN=m;function u(M){return(0,t.IntNumber)(new r.default(R(M,!1),16).toNumber())}ne.intNumberFromHexString=u;function f(M){return(0,t.HexString)(`0x${new r.default(M).toString(16)}`)}ne.hexStringFromIntNumber=f;function s(M){return M.startsWith("0x")||M.startsWith("0X")}ne.has0xPrefix=s;function p(M){return s(M)?M.slice(2):M}ne.strip0x=p;function y(M){return s(M)?`0x${M.slice(2)}`:`0x${M}`}ne.prepend0x=y;function w(M){if(typeof M!="string")return!1;const I=p(M).toLowerCase();return i.test(I)}ne.isHexString=w;function c(M,I=!1){if(typeof M=="string"){const A=p(M).toLowerCase();if(i.test(A))return(0,t.HexString)(I?`0x${A}`:A)}throw n.standardErrors.rpc.invalidParams(`"${String(M)}" is not a hexadecimal string`)}ne.ensureHexString=c;function R(M,I=!1){let A=c(M,!1);return A.length%2===1&&(A=(0,t.HexString)(`0${A}`)),I?(0,t.HexString)(`0x${A}`):A}ne.ensureEvenLengthHexString=R;function S(M){if(typeof M=="string"){const I=p(M).toLowerCase();if(w(I)&&I.length===40)return(0,t.AddressString)(y(I))}throw n.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(M)}`)}ne.ensureAddressString=S;function k(M){if(Buffer.isBuffer(M))return M;if(typeof M=="string"){if(w(M)){const I=R(M,!1);return Buffer.from(I,"hex")}return Buffer.from(M,"utf8")}throw n.standardErrors.rpc.invalidParams(`Not binary data: ${String(M)}`)}ne.ensureBuffer=k;function C(M){if(typeof M=="number"&&Number.isInteger(M))return(0,t.IntNumber)(M);if(typeof M=="string"){if(l.test(M))return(0,t.IntNumber)(Number(M));if(w(M))return(0,t.IntNumber)(new r.default(R(M,!1),16).toNumber())}throw n.standardErrors.rpc.invalidParams(`Not an integer: ${String(M)}`)}ne.ensureIntNumber=C;function T(M){if(M instanceof RegExp)return(0,t.RegExpString)(M.toString());throw n.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(M)}`)}ne.ensureRegExpString=T;function N(M){if(M!==null&&(r.default.isBN(M)||z(M)))return new r.default(M.toString(10),10);if(typeof M=="number")return new r.default(C(M));if(typeof M=="string"){if(l.test(M))return new r.default(M,10);if(w(M))return new r.default(R(M,!1),16)}throw n.standardErrors.rpc.invalidParams(`Not an integer: ${String(M)}`)}ne.ensureBN=N;function j(M){if(typeof M=="string")return JSON.parse(M);if(typeof M=="object")return M;throw n.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(M)}`)}ne.ensureParsedJSONObject=j;function z(M){if(M==null||typeof M.constructor!="function")return!1;const{constructor:I}=M;return typeof I.config=="function"&&typeof I.EUCLID=="number"}ne.isBigNumber=z;function Z(M,I){return Array.from({length:I-M},(A,O)=>M+O)}ne.range=Z;function Q(){const M=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:I,host:A}=document.location,O=M?M.getAttribute("href"):null;return!O||O.startsWith("javascript:")||O.startsWith("vbscript:")?null:O.startsWith("http://")||O.startsWith("https://")||O.startsWith("data:")?O:O.startsWith("//")?I+O:`${I}//${A}${O}`}ne.getFavicon=Q;function re(M,I,A,O,$,L){const b=O?"parent-id":"id",P=new URLSearchParams({[b]:M,secret:I,server:A,v:$,chainId:L.toString()}).toString();return`${A}/#/link?${P}`}ne.createQrUrl=re;function q(){try{return window.frameElement!==null}catch{return!1}}ne.isInIFrame=q;function h(){try{return q()&&window.top?window.top.location:window.location}catch{return window.location}}ne.getLocation=h;function E(){var M;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((M=window==null?void 0:window.navigator)===null||M===void 0?void 0:M.userAgent)}return ne.isMobileWeb=E,ne}var pr={},Mo;function Eh(){if(Mo)return pr;Mo=1,Object.defineProperty(pr,"__esModule",{value:!0}),pr.ScopedLocalStorage=void 0;let e=class{constructor(n){this.scope=n}setItem(n,t){localStorage.setItem(this.scopedKey(n),t)}getItem(n){return localStorage.getItem(this.scopedKey(n))}removeItem(n){localStorage.removeItem(this.scopedKey(n))}clear(){const n=this.scopedKey(""),t=[];for(let l=0;llocalStorage.removeItem(l))}scopedKey(n){return`${this.scope}:${n}`}};return pr.ScopedLocalStorage=e,pr}var Rt={},gr={},mr={},vr={},ko;function Ws(){return ko||(ko=1,Object.defineProperty(vr,"__esModule",{value:!0}),vr.EVENTS=void 0,vr.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"}),vr}var Je={},Co;function Vs(){if(Co)return Je;Co=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.RelayAbstract=Je.APP_VERSION_KEY=Je.LOCAL_STORAGE_ADDRESSES_KEY=Je.WALLET_USER_NAME_KEY=void 0;const e=yn();Je.WALLET_USER_NAME_KEY="walletUsername",Je.LOCAL_STORAGE_ADDRESSES_KEY="Addresses",Je.APP_VERSION_KEY="AppVersion";let r=class{async makeEthereumJSONRPCRequest(t,l){if(!l)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(l,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(i=>i.json()).then(i=>{if(!i)throw e.standardErrors.rpc.parse({});const o=i,{error:a}=o;if(a)throw(0,e.serializeError)(a,t.method);return o})}};return Je.RelayAbstract=r,Je}var yr={},Fn={exports:{}},Zr={exports:{}},Io;function Ye(){return Io||(Io=1,typeof Object.create=="function"?Zr.exports=function(r,n){n&&(r.super_=n,r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:Zr.exports=function(r,n){if(n){r.super_=n;var t=function(){};t.prototype=n.prototype,r.prototype=new t,r.prototype.constructor=r}}),Zr.exports}var Kr={exports:{}},Dn={},wr={},xo;function Rh(){if(xo)return wr;xo=1,wr.byteLength=a,wr.toByteArray=g,wr.fromByteArray=f;for(var e=[],r=[],n=typeof Uint8Array<"u"?Uint8Array:Array,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,i=t.length;l0)throw new Error("Invalid string. Length must be a multiple of 4");var y=s.indexOf("=");y===-1&&(y=p);var w=y===p?0:4-y%4;return[y,w]}function a(s){var p=o(s),y=p[0],w=p[1];return(y+w)*3/4-w}function d(s,p,y){return(p+y)*3/4-y}function g(s){var p,y=o(s),w=y[0],c=y[1],R=new n(d(s,w,c)),S=0,k=c>0?w-4:w,C;for(C=0;C>16&255,R[S++]=p>>8&255,R[S++]=p&255;return c===2&&(p=r[s.charCodeAt(C)]<<2|r[s.charCodeAt(C+1)]>>4,R[S++]=p&255),c===1&&(p=r[s.charCodeAt(C)]<<10|r[s.charCodeAt(C+1)]<<4|r[s.charCodeAt(C+2)]>>2,R[S++]=p>>8&255,R[S++]=p&255),R}function m(s){return e[s>>18&63]+e[s>>12&63]+e[s>>6&63]+e[s&63]}function u(s,p,y){for(var w,c=[],R=p;Rk?k:S+R));return w===1?(p=s[y-1],c.push(e[p>>2]+e[p<<4&63]+"==")):w===2&&(p=(s[y-2]<<8)+s[y-1],c.push(e[p>>10]+e[p>>4&63]+e[p<<2&63]+"=")),c.join("")}return wr}var Qr={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */var Ao;function Sh(){return Ao||(Ao=1,Qr.read=function(e,r,n,t,l){var i,o,a=l*8-t-1,d=(1<>1,m=-7,u=n?l-1:0,f=n?-1:1,s=e[r+u];for(u+=f,i=s&(1<<-m)-1,s>>=-m,m+=a;m>0;i=i*256+e[r+u],u+=f,m-=8);for(o=i&(1<<-m)-1,i>>=-m,m+=t;m>0;o=o*256+e[r+u],u+=f,m-=8);if(i===0)i=1-g;else{if(i===d)return o?NaN:(s?-1:1)*(1/0);o=o+Math.pow(2,t),i=i-g}return(s?-1:1)*o*Math.pow(2,i-t)},Qr.write=function(e,r,n,t,l,i){var o,a,d,g=i*8-l-1,m=(1<>1,f=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,s=t?0:i-1,p=t?1:-1,y=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,o=m):(o=Math.floor(Math.log(r)/Math.LN2),r*(d=Math.pow(2,-o))<1&&(o--,d*=2),o+u>=1?r+=f/d:r+=f*Math.pow(2,1-u),r*d>=2&&(o++,d/=2),o+u>=m?(a=0,o=m):o+u>=1?(a=(r*d-1)*Math.pow(2,l),o=o+u):(a=r*Math.pow(2,u-1)*Math.pow(2,l),o=0));l>=8;e[n+s]=a&255,s+=p,a/=256,l-=8);for(o=o<0;e[n+s]=o&255,s+=p,o/=256,g-=8);e[n+s-p]|=y*128}),Qr}/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */var Lo;function bn(){return Lo||(Lo=1,function(e){const r=Rh(),n=Sh(),t=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=R,e.INSPECT_MAX_BYTES=50;const l=2147483647;e.kMaxLength=l,a.TYPED_ARRAY_SUPPORT=i(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{const x=new Uint8Array(1),v={foo:function(){return 42}};return Object.setPrototypeOf(v,Uint8Array.prototype),Object.setPrototypeOf(x,v),x.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function o(x){if(x>l)throw new RangeError('The value "'+x+'" is invalid for option "size"');const v=new Uint8Array(x);return Object.setPrototypeOf(v,a.prototype),v}function a(x,v,_){if(typeof x=="number"){if(typeof v=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return u(x)}return d(x,v,_)}a.poolSize=8192;function d(x,v,_){if(typeof x=="string")return f(x,v);if(ArrayBuffer.isView(x))return p(x);if(x==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof x);if(be(x,ArrayBuffer)||x&&be(x.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(be(x,SharedArrayBuffer)||x&&be(x.buffer,SharedArrayBuffer)))return y(x,v,_);if(typeof x=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const B=x.valueOf&&x.valueOf();if(B!=null&&B!==x)return a.from(B,v,_);const H=w(x);if(H)return H;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof x[Symbol.toPrimitive]=="function")return a.from(x[Symbol.toPrimitive]("string"),v,_);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof x)}a.from=function(x,v,_){return d(x,v,_)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function g(x){if(typeof x!="number")throw new TypeError('"size" argument must be of type number');if(x<0)throw new RangeError('The value "'+x+'" is invalid for option "size"')}function m(x,v,_){return g(x),x<=0?o(x):v!==void 0?typeof _=="string"?o(x).fill(v,_):o(x).fill(v):o(x)}a.alloc=function(x,v,_){return m(x,v,_)};function u(x){return g(x),o(x<0?0:c(x)|0)}a.allocUnsafe=function(x){return u(x)},a.allocUnsafeSlow=function(x){return u(x)};function f(x,v){if((typeof v!="string"||v==="")&&(v="utf8"),!a.isEncoding(v))throw new TypeError("Unknown encoding: "+v);const _=S(x,v)|0;let B=o(_);const H=B.write(x,v);return H!==_&&(B=B.slice(0,H)),B}function s(x){const v=x.length<0?0:c(x.length)|0,_=o(v);for(let B=0;B=l)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l.toString(16)+" bytes");return x|0}function R(x){return+x!=x&&(x=0),a.alloc(+x)}a.isBuffer=function(v){return v!=null&&v._isBuffer===!0&&v!==a.prototype},a.compare=function(v,_){if(be(v,Uint8Array)&&(v=a.from(v,v.offset,v.byteLength)),be(_,Uint8Array)&&(_=a.from(_,_.offset,_.byteLength)),!a.isBuffer(v)||!a.isBuffer(_))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(v===_)return 0;let B=v.length,H=_.length;for(let V=0,J=Math.min(B,H);VH.length?(a.isBuffer(J)||(J=a.from(J)),J.copy(H,V)):Uint8Array.prototype.set.call(H,J,V);else if(a.isBuffer(J))J.copy(H,V);else throw new TypeError('"list" argument must be an Array of Buffers');V+=J.length}return H};function S(x,v){if(a.isBuffer(x))return x.length;if(ArrayBuffer.isView(x)||be(x,ArrayBuffer))return x.byteLength;if(typeof x!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof x);const _=x.length,B=arguments.length>2&&arguments[2]===!0;if(!B&&_===0)return 0;let H=!1;for(;;)switch(v){case"ascii":case"latin1":case"binary":return _;case"utf8":case"utf-8":return ie(x).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _*2;case"hex":return _>>>1;case"base64":return me(x).length;default:if(H)return B?-1:ie(x).length;v=(""+v).toLowerCase(),H=!0}}a.byteLength=S;function k(x,v,_){let B=!1;if((v===void 0||v<0)&&(v=0),v>this.length||((_===void 0||_>this.length)&&(_=this.length),_<=0)||(_>>>=0,v>>>=0,_<=v))return"";for(x||(x="utf8");;)switch(x){case"hex":return O(this,v,_);case"utf8":case"utf-8":return h(this,v,_);case"ascii":return I(this,v,_);case"latin1":case"binary":return A(this,v,_);case"base64":return q(this,v,_);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $(this,v,_);default:if(B)throw new TypeError("Unknown encoding: "+x);x=(x+"").toLowerCase(),B=!0}}a.prototype._isBuffer=!0;function C(x,v,_){const B=x[v];x[v]=x[_],x[_]=B}a.prototype.swap16=function(){const v=this.length;if(v%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let _=0;__&&(v+=" ... "),""},t&&(a.prototype[t]=a.prototype.inspect),a.prototype.compare=function(v,_,B,H,V){if(be(v,Uint8Array)&&(v=a.from(v,v.offset,v.byteLength)),!a.isBuffer(v))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof v);if(_===void 0&&(_=0),B===void 0&&(B=v?v.length:0),H===void 0&&(H=0),V===void 0&&(V=this.length),_<0||B>v.length||H<0||V>this.length)throw new RangeError("out of range index");if(H>=V&&_>=B)return 0;if(H>=V)return-1;if(_>=B)return 1;if(_>>>=0,B>>>=0,H>>>=0,V>>>=0,this===v)return 0;let J=V-H,fe=B-_;const ue=Math.min(J,fe),ce=this.slice(H,V),we=v.slice(_,B);for(let se=0;se2147483647?_=2147483647:_<-2147483648&&(_=-2147483648),_=+_,pe(_)&&(_=H?0:x.length-1),_<0&&(_=x.length+_),_>=x.length){if(H)return-1;_=x.length-1}else if(_<0)if(H)_=0;else return-1;if(typeof v=="string"&&(v=a.from(v,B)),a.isBuffer(v))return v.length===0?-1:N(x,v,_,B,H);if(typeof v=="number")return v=v&255,typeof Uint8Array.prototype.indexOf=="function"?H?Uint8Array.prototype.indexOf.call(x,v,_):Uint8Array.prototype.lastIndexOf.call(x,v,_):N(x,[v],_,B,H);throw new TypeError("val must be string, number or Buffer")}function N(x,v,_,B,H){let V=1,J=x.length,fe=v.length;if(B!==void 0&&(B=String(B).toLowerCase(),B==="ucs2"||B==="ucs-2"||B==="utf16le"||B==="utf-16le")){if(x.length<2||v.length<2)return-1;V=2,J/=2,fe/=2,_/=2}function ue(we,se){return V===1?we[se]:we.readUInt16BE(se*V)}let ce;if(H){let we=-1;for(ce=_;ceJ&&(_=J-fe),ce=_;ce>=0;ce--){let we=!0;for(let se=0;seH&&(B=H)):B=H;const V=v.length;B>V/2&&(B=V/2);let J;for(J=0;J>>0,isFinite(B)?(B=B>>>0,H===void 0&&(H="utf8")):(H=B,B=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const V=this.length-_;if((B===void 0||B>V)&&(B=V),v.length>0&&(B<0||_<0)||_>this.length)throw new RangeError("Attempt to write outside buffer bounds");H||(H="utf8");let J=!1;for(;;)switch(H){case"hex":return j(this,v,_,B);case"utf8":case"utf-8":return z(this,v,_,B);case"ascii":case"latin1":case"binary":return Z(this,v,_,B);case"base64":return Q(this,v,_,B);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return re(this,v,_,B);default:if(J)throw new TypeError("Unknown encoding: "+H);H=(""+H).toLowerCase(),J=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function q(x,v,_){return v===0&&_===x.length?r.fromByteArray(x):r.fromByteArray(x.slice(v,_))}function h(x,v,_){_=Math.min(x.length,_);const B=[];let H=v;for(;H<_;){const V=x[H];let J=null,fe=V>239?4:V>223?3:V>191?2:1;if(H+fe<=_){let ue,ce,we,se;switch(fe){case 1:V<128&&(J=V);break;case 2:ue=x[H+1],(ue&192)===128&&(se=(V&31)<<6|ue&63,se>127&&(J=se));break;case 3:ue=x[H+1],ce=x[H+2],(ue&192)===128&&(ce&192)===128&&(se=(V&15)<<12|(ue&63)<<6|ce&63,se>2047&&(se<55296||se>57343)&&(J=se));break;case 4:ue=x[H+1],ce=x[H+2],we=x[H+3],(ue&192)===128&&(ce&192)===128&&(we&192)===128&&(se=(V&15)<<18|(ue&63)<<12|(ce&63)<<6|we&63,se>65535&&se<1114112&&(J=se))}}J===null?(J=65533,fe=1):J>65535&&(J-=65536,B.push(J>>>10&1023|55296),J=56320|J&1023),B.push(J),H+=fe}return M(B)}const E=4096;function M(x){const v=x.length;if(v<=E)return String.fromCharCode.apply(String,x);let _="",B=0;for(;BB)&&(_=B);let H="";for(let V=v;V<_;++V)H+=ve[x[V]];return H}function $(x,v,_){const B=x.slice(v,_);let H="";for(let V=0;VB&&(v=B),_<0?(_+=B,_<0&&(_=0)):_>B&&(_=B),__)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(v,_,B){v=v>>>0,_=_>>>0,B||L(v,_,this.length);let H=this[v],V=1,J=0;for(;++J<_&&(V*=256);)H+=this[v+J]*V;return H},a.prototype.readUintBE=a.prototype.readUIntBE=function(v,_,B){v=v>>>0,_=_>>>0,B||L(v,_,this.length);let H=this[v+--_],V=1;for(;_>0&&(V*=256);)H+=this[v+--_]*V;return H},a.prototype.readUint8=a.prototype.readUInt8=function(v,_){return v=v>>>0,_||L(v,1,this.length),this[v]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(v,_){return v=v>>>0,_||L(v,2,this.length),this[v]|this[v+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(v,_){return v=v>>>0,_||L(v,2,this.length),this[v]<<8|this[v+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(v,_){return v=v>>>0,_||L(v,4,this.length),(this[v]|this[v+1]<<8|this[v+2]<<16)+this[v+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(v,_){return v=v>>>0,_||L(v,4,this.length),this[v]*16777216+(this[v+1]<<16|this[v+2]<<8|this[v+3])},a.prototype.readBigUInt64LE=je(function(v){v=v>>>0,K(v,"offset");const _=this[v],B=this[v+7];(_===void 0||B===void 0)&&X(v,this.length-8);const H=_+this[++v]*2**8+this[++v]*2**16+this[++v]*2**24,V=this[++v]+this[++v]*2**8+this[++v]*2**16+B*2**24;return BigInt(H)+(BigInt(V)<>>0,K(v,"offset");const _=this[v],B=this[v+7];(_===void 0||B===void 0)&&X(v,this.length-8);const H=_*2**24+this[++v]*2**16+this[++v]*2**8+this[++v],V=this[++v]*2**24+this[++v]*2**16+this[++v]*2**8+B;return(BigInt(H)<>>0,_=_>>>0,B||L(v,_,this.length);let H=this[v],V=1,J=0;for(;++J<_&&(V*=256);)H+=this[v+J]*V;return V*=128,H>=V&&(H-=Math.pow(2,8*_)),H},a.prototype.readIntBE=function(v,_,B){v=v>>>0,_=_>>>0,B||L(v,_,this.length);let H=_,V=1,J=this[v+--H];for(;H>0&&(V*=256);)J+=this[v+--H]*V;return V*=128,J>=V&&(J-=Math.pow(2,8*_)),J},a.prototype.readInt8=function(v,_){return v=v>>>0,_||L(v,1,this.length),this[v]&128?(255-this[v]+1)*-1:this[v]},a.prototype.readInt16LE=function(v,_){v=v>>>0,_||L(v,2,this.length);const B=this[v]|this[v+1]<<8;return B&32768?B|4294901760:B},a.prototype.readInt16BE=function(v,_){v=v>>>0,_||L(v,2,this.length);const B=this[v+1]|this[v]<<8;return B&32768?B|4294901760:B},a.prototype.readInt32LE=function(v,_){return v=v>>>0,_||L(v,4,this.length),this[v]|this[v+1]<<8|this[v+2]<<16|this[v+3]<<24},a.prototype.readInt32BE=function(v,_){return v=v>>>0,_||L(v,4,this.length),this[v]<<24|this[v+1]<<16|this[v+2]<<8|this[v+3]},a.prototype.readBigInt64LE=je(function(v){v=v>>>0,K(v,"offset");const _=this[v],B=this[v+7];(_===void 0||B===void 0)&&X(v,this.length-8);const H=this[v+4]+this[v+5]*2**8+this[v+6]*2**16+(B<<24);return(BigInt(H)<>>0,K(v,"offset");const _=this[v],B=this[v+7];(_===void 0||B===void 0)&&X(v,this.length-8);const H=(_<<24)+this[++v]*2**16+this[++v]*2**8+this[++v];return(BigInt(H)<>>0,_||L(v,4,this.length),n.read(this,v,!0,23,4)},a.prototype.readFloatBE=function(v,_){return v=v>>>0,_||L(v,4,this.length),n.read(this,v,!1,23,4)},a.prototype.readDoubleLE=function(v,_){return v=v>>>0,_||L(v,8,this.length),n.read(this,v,!0,52,8)},a.prototype.readDoubleBE=function(v,_){return v=v>>>0,_||L(v,8,this.length),n.read(this,v,!1,52,8)};function b(x,v,_,B,H,V){if(!a.isBuffer(x))throw new TypeError('"buffer" argument must be a Buffer instance');if(v>H||vx.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(v,_,B,H){if(v=+v,_=_>>>0,B=B>>>0,!H){const fe=Math.pow(2,8*B)-1;b(this,v,_,B,fe,0)}let V=1,J=0;for(this[_]=v&255;++J>>0,B=B>>>0,!H){const fe=Math.pow(2,8*B)-1;b(this,v,_,B,fe,0)}let V=B-1,J=1;for(this[_+V]=v&255;--V>=0&&(J*=256);)this[_+V]=v/J&255;return _+B},a.prototype.writeUint8=a.prototype.writeUInt8=function(v,_,B){return v=+v,_=_>>>0,B||b(this,v,_,1,255,0),this[_]=v&255,_+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(v,_,B){return v=+v,_=_>>>0,B||b(this,v,_,2,65535,0),this[_]=v&255,this[_+1]=v>>>8,_+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(v,_,B){return v=+v,_=_>>>0,B||b(this,v,_,2,65535,0),this[_]=v>>>8,this[_+1]=v&255,_+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(v,_,B){return v=+v,_=_>>>0,B||b(this,v,_,4,4294967295,0),this[_+3]=v>>>24,this[_+2]=v>>>16,this[_+1]=v>>>8,this[_]=v&255,_+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(v,_,B){return v=+v,_=_>>>0,B||b(this,v,_,4,4294967295,0),this[_]=v>>>24,this[_+1]=v>>>16,this[_+2]=v>>>8,this[_+3]=v&255,_+4};function P(x,v,_,B,H){D(v,B,H,x,_,7);let V=Number(v&BigInt(4294967295));x[_++]=V,V=V>>8,x[_++]=V,V=V>>8,x[_++]=V,V=V>>8,x[_++]=V;let J=Number(v>>BigInt(32)&BigInt(4294967295));return x[_++]=J,J=J>>8,x[_++]=J,J=J>>8,x[_++]=J,J=J>>8,x[_++]=J,_}function te(x,v,_,B,H){D(v,B,H,x,_,7);let V=Number(v&BigInt(4294967295));x[_+7]=V,V=V>>8,x[_+6]=V,V=V>>8,x[_+5]=V,V=V>>8,x[_+4]=V;let J=Number(v>>BigInt(32)&BigInt(4294967295));return x[_+3]=J,J=J>>8,x[_+2]=J,J=J>>8,x[_+1]=J,J=J>>8,x[_]=J,_+8}a.prototype.writeBigUInt64LE=je(function(v,_=0){return P(this,v,_,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=je(function(v,_=0){return te(this,v,_,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(v,_,B,H){if(v=+v,_=_>>>0,!H){const ue=Math.pow(2,8*B-1);b(this,v,_,B,ue-1,-ue)}let V=0,J=1,fe=0;for(this[_]=v&255;++V>0)-fe&255;return _+B},a.prototype.writeIntBE=function(v,_,B,H){if(v=+v,_=_>>>0,!H){const ue=Math.pow(2,8*B-1);b(this,v,_,B,ue-1,-ue)}let V=B-1,J=1,fe=0;for(this[_+V]=v&255;--V>=0&&(J*=256);)v<0&&fe===0&&this[_+V+1]!==0&&(fe=1),this[_+V]=(v/J>>0)-fe&255;return _+B},a.prototype.writeInt8=function(v,_,B){return v=+v,_=_>>>0,B||b(this,v,_,1,127,-128),v<0&&(v=255+v+1),this[_]=v&255,_+1},a.prototype.writeInt16LE=function(v,_,B){return v=+v,_=_>>>0,B||b(this,v,_,2,32767,-32768),this[_]=v&255,this[_+1]=v>>>8,_+2},a.prototype.writeInt16BE=function(v,_,B){return v=+v,_=_>>>0,B||b(this,v,_,2,32767,-32768),this[_]=v>>>8,this[_+1]=v&255,_+2},a.prototype.writeInt32LE=function(v,_,B){return v=+v,_=_>>>0,B||b(this,v,_,4,2147483647,-2147483648),this[_]=v&255,this[_+1]=v>>>8,this[_+2]=v>>>16,this[_+3]=v>>>24,_+4},a.prototype.writeInt32BE=function(v,_,B){return v=+v,_=_>>>0,B||b(this,v,_,4,2147483647,-2147483648),v<0&&(v=4294967295+v+1),this[_]=v>>>24,this[_+1]=v>>>16,this[_+2]=v>>>8,this[_+3]=v&255,_+4},a.prototype.writeBigInt64LE=je(function(v,_=0){return P(this,v,_,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=je(function(v,_=0){return te(this,v,_,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Y(x,v,_,B,H,V){if(_+B>x.length)throw new RangeError("Index out of range");if(_<0)throw new RangeError("Index out of range")}function U(x,v,_,B,H){return v=+v,_=_>>>0,H||Y(x,v,_,4),n.write(x,v,_,B,23,4),_+4}a.prototype.writeFloatLE=function(v,_,B){return U(this,v,_,!0,B)},a.prototype.writeFloatBE=function(v,_,B){return U(this,v,_,!1,B)};function W(x,v,_,B,H){return v=+v,_=_>>>0,H||Y(x,v,_,8),n.write(x,v,_,B,52,8),_+8}a.prototype.writeDoubleLE=function(v,_,B){return W(this,v,_,!0,B)},a.prototype.writeDoubleBE=function(v,_,B){return W(this,v,_,!1,B)},a.prototype.copy=function(v,_,B,H){if(!a.isBuffer(v))throw new TypeError("argument should be a Buffer");if(B||(B=0),!H&&H!==0&&(H=this.length),_>=v.length&&(_=v.length),_||(_=0),H>0&&H=this.length)throw new RangeError("Index out of range");if(H<0)throw new RangeError("sourceEnd out of bounds");H>this.length&&(H=this.length),v.length-_>>0,B=B===void 0?this.length:B>>>0,v||(v=0);let V;if(typeof v=="number")for(V=_;V2**32?H=oe(String(_)):typeof _=="bigint"&&(H=String(_),(_>BigInt(2)**BigInt(32)||_<-(BigInt(2)**BigInt(32)))&&(H=oe(H)),H+="n"),B+=` It must be ${v}. Received ${H}`,B},RangeError);function oe(x){let v="",_=x.length;const B=x[0]==="-"?1:0;for(;_>=B+4;_-=3)v=`_${x.slice(_-3,_)}${v}`;return`${x.slice(0,_)}${v}`}function F(x,v,_){K(v,"offset"),(x[v]===void 0||x[v+_]===void 0)&&X(v,x.length-(_+1))}function D(x,v,_,B,H,V){if(x>_||x= 0${J} and < 2${J} ** ${(V+1)*8}${J}`:fe=`>= -(2${J} ** ${(V+1)*8-1}${J}) and < 2 ** ${(V+1)*8-1}${J}`,new G.ERR_OUT_OF_RANGE("value",fe,x)}F(B,H,V)}function K(x,v){if(typeof x!="number")throw new G.ERR_INVALID_ARG_TYPE(v,"number",x)}function X(x,v,_){throw Math.floor(x)!==x?(K(x,_),new G.ERR_OUT_OF_RANGE("offset","an integer",x)):v<0?new G.ERR_BUFFER_OUT_OF_BOUNDS:new G.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${v}`,x)}const ae=/[^+/0-9A-Za-z-_]/g;function le(x){if(x=x.split("=")[0],x=x.trim().replace(ae,""),x.length<2)return"";for(;x.length%4!==0;)x=x+"=";return x}function ie(x,v){v=v||1/0;let _;const B=x.length;let H=null;const V=[];for(let J=0;J55295&&_<57344){if(!H){if(_>56319){(v-=3)>-1&&V.push(239,191,189);continue}else if(J+1===B){(v-=3)>-1&&V.push(239,191,189);continue}H=_;continue}if(_<56320){(v-=3)>-1&&V.push(239,191,189),H=_;continue}_=(H-55296<<10|_-56320)+65536}else H&&(v-=3)>-1&&V.push(239,191,189);if(H=null,_<128){if((v-=1)<0)break;V.push(_)}else if(_<2048){if((v-=2)<0)break;V.push(_>>6|192,_&63|128)}else if(_<65536){if((v-=3)<0)break;V.push(_>>12|224,_>>6&63|128,_&63|128)}else if(_<1114112){if((v-=4)<0)break;V.push(_>>18|240,_>>12&63|128,_>>6&63|128,_&63|128)}else throw new Error("Invalid code point")}return V}function de(x){const v=[];for(let _=0;_>8,H=_%256,V.push(H),V.push(B);return V}function me(x){return r.toByteArray(le(x))}function he(x,v,_,B){let H;for(H=0;H=v.length||H>=x.length);++H)v[H+_]=x[H];return H}function be(x,v){return x instanceof v||x!=null&&x.constructor!=null&&x.constructor.name!=null&&x.constructor.name===v.name}function pe(x){return x!==x}const ve=function(){const x="0123456789abcdef",v=new Array(256);for(let _=0;_<16;++_){const B=_*16;for(let H=0;H<16;++H)v[B+H]=x[_]+x[H]}return v}();function je(x){return typeof BigInt>"u"?ye:x}function ye(){throw new Error("BigInt not supported")}}(Dn)),Dn}/*! safe-buffer. MIT License. Feross Aboukhadijeh */var To;function st(){return To||(To=1,function(e,r){var n=bn(),t=n.Buffer;function l(o,a){for(var d in o)a[d]=o[d]}t.from&&t.alloc&&t.allocUnsafe&&t.allocUnsafeSlow?e.exports=n:(l(n,r),r.Buffer=i);function i(o,a,d){return t(o,a,d)}i.prototype=Object.create(t.prototype),l(t,i),i.from=function(o,a,d){if(typeof o=="number")throw new TypeError("Argument must not be a number");return t(o,a,d)},i.alloc=function(o,a,d){if(typeof o!="number")throw new TypeError("Argument must be a number");var g=t(o);return a!==void 0?typeof d=="string"?g.fill(a,d):g.fill(a):g.fill(0),g},i.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return t(o)},i.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(o)}}(Kr,Kr.exports)),Kr.exports}var qn,Bo;function nr(){if(Bo)return qn;Bo=1;var e=st().Buffer;function r(n,t){this._block=e.alloc(n),this._finalSize=t,this._blockSize=n,this._len=0}return r.prototype.update=function(n,t){typeof n=="string"&&(t=t||"utf8",n=e.from(n,t));for(var l=this._block,i=this._blockSize,o=n.length,a=this._len,d=0;d=this._finalSize&&(this._update(this._block),this._block.fill(0));var l=this._len*8;if(l<=4294967295)this._block.writeUInt32BE(l,this._blockSize-4);else{var i=(l&4294967295)>>>0,o=(l-i)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var a=this._hash();return n?a.toString(n):a},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},qn=r,qn}var jn,No;function Mh(){if(No)return jn;No=1;var e=Ye(),r=nr(),n=st().Buffer,t=[1518500249,1859775393,-1894007588,-899497514],l=new Array(80);function i(){this.init(),this._w=l,r.call(this,64,56)}e(i,r),i.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function o(g){return g<<5|g>>>27}function a(g){return g<<30|g>>>2}function d(g,m,u,f){return g===0?m&u|~m&f:g===2?m&u|m&f|u&f:m^u^f}return i.prototype._update=function(g){for(var m=this._w,u=this._a|0,f=this._b|0,s=this._c|0,p=this._d|0,y=this._e|0,w=0;w<16;++w)m[w]=g.readInt32BE(w*4);for(;w<80;++w)m[w]=m[w-3]^m[w-8]^m[w-14]^m[w-16];for(var c=0;c<80;++c){var R=~~(c/20),S=o(u)+d(R,f,s,p)+y+m[c]+t[R]|0;y=p,p=s,s=a(f),f=u,u=S}this._a=u+this._a|0,this._b=f+this._b|0,this._c=s+this._c|0,this._d=p+this._d|0,this._e=y+this._e|0},i.prototype._hash=function(){var g=n.allocUnsafe(20);return g.writeInt32BE(this._a|0,0),g.writeInt32BE(this._b|0,4),g.writeInt32BE(this._c|0,8),g.writeInt32BE(this._d|0,12),g.writeInt32BE(this._e|0,16),g},jn=i,jn}var $n,Oo;function kh(){if(Oo)return $n;Oo=1;var e=Ye(),r=nr(),n=st().Buffer,t=[1518500249,1859775393,-1894007588,-899497514],l=new Array(80);function i(){this.init(),this._w=l,r.call(this,64,56)}e(i,r),i.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function o(m){return m<<1|m>>>31}function a(m){return m<<5|m>>>27}function d(m){return m<<30|m>>>2}function g(m,u,f,s){return m===0?u&f|~u&s:m===2?u&f|u&s|f&s:u^f^s}return i.prototype._update=function(m){for(var u=this._w,f=this._a|0,s=this._b|0,p=this._c|0,y=this._d|0,w=this._e|0,c=0;c<16;++c)u[c]=m.readInt32BE(c*4);for(;c<80;++c)u[c]=o(u[c-3]^u[c-8]^u[c-14]^u[c-16]);for(var R=0;R<80;++R){var S=~~(R/20),k=a(f)+g(S,s,p,y)+w+u[R]+t[S]|0;w=y,y=p,p=d(s),s=f,f=k}this._a=f+this._a|0,this._b=s+this._b|0,this._c=p+this._c|0,this._d=y+this._d|0,this._e=w+this._e|0},i.prototype._hash=function(){var m=n.allocUnsafe(20);return m.writeInt32BE(this._a|0,0),m.writeInt32BE(this._b|0,4),m.writeInt32BE(this._c|0,8),m.writeInt32BE(this._d|0,12),m.writeInt32BE(this._e|0,16),m},$n=i,$n}var Un,Po;function Ku(){if(Po)return Un;Po=1;var e=Ye(),r=nr(),n=st().Buffer,t=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],l=new Array(64);function i(){this.init(),this._w=l,r.call(this,64,56)}e(i,r),i.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function o(f,s,p){return p^f&(s^p)}function a(f,s,p){return f&s|p&(f|s)}function d(f){return(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10)}function g(f){return(f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7)}function m(f){return(f>>>7|f<<25)^(f>>>18|f<<14)^f>>>3}function u(f){return(f>>>17|f<<15)^(f>>>19|f<<13)^f>>>10}return i.prototype._update=function(f){for(var s=this._w,p=this._a|0,y=this._b|0,w=this._c|0,c=this._d|0,R=this._e|0,S=this._f|0,k=this._g|0,C=this._h|0,T=0;T<16;++T)s[T]=f.readInt32BE(T*4);for(;T<64;++T)s[T]=u(s[T-2])+s[T-7]+m(s[T-15])+s[T-16]|0;for(var N=0;N<64;++N){var j=C+g(R)+o(R,S,k)+t[N]+s[N]|0,z=d(p)+a(p,y,w)|0;C=k,k=S,S=R,R=c+j|0,c=w,w=y,y=p,p=j+z|0}this._a=p+this._a|0,this._b=y+this._b|0,this._c=w+this._c|0,this._d=c+this._d|0,this._e=R+this._e|0,this._f=S+this._f|0,this._g=k+this._g|0,this._h=C+this._h|0},i.prototype._hash=function(){var f=n.allocUnsafe(32);return f.writeInt32BE(this._a,0),f.writeInt32BE(this._b,4),f.writeInt32BE(this._c,8),f.writeInt32BE(this._d,12),f.writeInt32BE(this._e,16),f.writeInt32BE(this._f,20),f.writeInt32BE(this._g,24),f.writeInt32BE(this._h,28),f},Un=i,Un}var Hn,Fo;function Ch(){if(Fo)return Hn;Fo=1;var e=Ye(),r=Ku(),n=nr(),t=st().Buffer,l=new Array(64);function i(){this.init(),this._w=l,n.call(this,64,56)}return e(i,r),i.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},i.prototype._hash=function(){var o=t.allocUnsafe(28);return o.writeInt32BE(this._a,0),o.writeInt32BE(this._b,4),o.writeInt32BE(this._c,8),o.writeInt32BE(this._d,12),o.writeInt32BE(this._e,16),o.writeInt32BE(this._f,20),o.writeInt32BE(this._g,24),o},Hn=i,Hn}var Wn,Do;function Qu(){if(Do)return Wn;Do=1;var e=Ye(),r=nr(),n=st().Buffer,t=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],l=new Array(160);function i(){this.init(),this._w=l,r.call(this,128,112)}e(i,r),i.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function o(y,w,c){return c^y&(w^c)}function a(y,w,c){return y&w|c&(y|w)}function d(y,w){return(y>>>28|w<<4)^(w>>>2|y<<30)^(w>>>7|y<<25)}function g(y,w){return(y>>>14|w<<18)^(y>>>18|w<<14)^(w>>>9|y<<23)}function m(y,w){return(y>>>1|w<<31)^(y>>>8|w<<24)^y>>>7}function u(y,w){return(y>>>1|w<<31)^(y>>>8|w<<24)^(y>>>7|w<<25)}function f(y,w){return(y>>>19|w<<13)^(w>>>29|y<<3)^y>>>6}function s(y,w){return(y>>>19|w<<13)^(w>>>29|y<<3)^(y>>>6|w<<26)}function p(y,w){return y>>>0>>0?1:0}return i.prototype._update=function(y){for(var w=this._w,c=this._ah|0,R=this._bh|0,S=this._ch|0,k=this._dh|0,C=this._eh|0,T=this._fh|0,N=this._gh|0,j=this._hh|0,z=this._al|0,Z=this._bl|0,Q=this._cl|0,re=this._dl|0,q=this._el|0,h=this._fl|0,E=this._gl|0,M=this._hl|0,I=0;I<32;I+=2)w[I]=y.readInt32BE(I*4),w[I+1]=y.readInt32BE(I*4+4);for(;I<160;I+=2){var A=w[I-30],O=w[I-15*2+1],$=m(A,O),L=u(O,A);A=w[I-2*2],O=w[I-2*2+1];var b=f(A,O),P=s(O,A),te=w[I-7*2],Y=w[I-7*2+1],U=w[I-16*2],W=w[I-16*2+1],G=L+Y|0,ee=$+te+p(G,L)|0;G=G+P|0,ee=ee+b+p(G,P)|0,G=G+W|0,ee=ee+U+p(G,W)|0,w[I]=ee,w[I+1]=G}for(var oe=0;oe<160;oe+=2){ee=w[oe],G=w[oe+1];var F=a(c,R,S),D=a(z,Z,Q),K=d(c,z),X=d(z,c),ae=g(C,q),le=g(q,C),ie=t[oe],de=t[oe+1],He=o(C,T,N),me=o(q,h,E),he=M+le|0,be=j+ae+p(he,M)|0;he=he+me|0,be=be+He+p(he,me)|0,he=he+de|0,be=be+ie+p(he,de)|0,he=he+G|0,be=be+ee+p(he,G)|0;var pe=X+D|0,ve=K+F+p(pe,X)|0;j=N,M=E,N=T,E=h,T=C,h=q,q=re+he|0,C=k+be+p(q,re)|0,k=S,re=Q,S=R,Q=Z,R=c,Z=z,z=he+pe|0,c=be+ve+p(z,he)|0}this._al=this._al+z|0,this._bl=this._bl+Z|0,this._cl=this._cl+Q|0,this._dl=this._dl+re|0,this._el=this._el+q|0,this._fl=this._fl+h|0,this._gl=this._gl+E|0,this._hl=this._hl+M|0,this._ah=this._ah+c+p(this._al,z)|0,this._bh=this._bh+R+p(this._bl,Z)|0,this._ch=this._ch+S+p(this._cl,Q)|0,this._dh=this._dh+k+p(this._dl,re)|0,this._eh=this._eh+C+p(this._el,q)|0,this._fh=this._fh+T+p(this._fl,h)|0,this._gh=this._gh+N+p(this._gl,E)|0,this._hh=this._hh+j+p(this._hl,M)|0},i.prototype._hash=function(){var y=n.allocUnsafe(64);function w(c,R,S){y.writeInt32BE(c,S),y.writeInt32BE(R,S+4)}return w(this._ah,this._al,0),w(this._bh,this._bl,8),w(this._ch,this._cl,16),w(this._dh,this._dl,24),w(this._eh,this._el,32),w(this._fh,this._fl,40),w(this._gh,this._gl,48),w(this._hh,this._hl,56),y},Wn=i,Wn}var Vn,qo;function Ih(){if(qo)return Vn;qo=1;var e=Ye(),r=Qu(),n=nr(),t=st().Buffer,l=new Array(160);function i(){this.init(),this._w=l,n.call(this,128,112)}return e(i,r),i.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},i.prototype._hash=function(){var o=t.allocUnsafe(48);function a(d,g,m){o.writeInt32BE(d,m),o.writeInt32BE(g,m+4)}return a(this._ah,this._al,0),a(this._bh,this._bl,8),a(this._ch,this._cl,16),a(this._dh,this._dl,24),a(this._eh,this._el,32),a(this._fh,this._fl,40),o},Vn=i,Vn}var jo;function xh(){if(jo)return Fn.exports;jo=1;var e=Fn.exports=function(n){n=n.toLowerCase();var t=e[n];if(!t)throw new Error(n+" is not supported (we accept pull requests)");return new t};return e.sha=Mh(),e.sha1=kh(),e.sha224=Ch(),e.sha256=Ku(),e.sha384=Ih(),e.sha512=Qu(),Fn.exports}var $o;function zs(){if($o)return yr;$o=1,Object.defineProperty(yr,"__esModule",{value:!0}),yr.Session=void 0;const e=xh(),r=nt(),n="session:id",t="session:secret",l="session:linked";let i=class Yu{constructor(a,d,g,m){this._storage=a,this._id=d||(0,r.randomBytesHex)(16),this._secret=g||(0,r.randomBytesHex)(32),this._key=new e.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!m}static load(a){const d=a.getItem(n),g=a.getItem(l),m=a.getItem(t);return d&&m?new Yu(a,d,m,g==="1"):null}static hash(a){return new e.sha256().update(a).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(a){this._linked=a,this.persistLinked()}save(){return this._storage.setItem(n,this._id),this._storage.setItem(t,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(l,this._linked?"1":"0")}};return yr.Session=i,yr}var br={},_r={},Uo;function Ah(){if(Uo)return _r;Uo=1,Object.defineProperty(_r,"__esModule",{value:!0}),_r.Cipher=void 0;const e=nt();let r=class{constructor(t){this.secret=t}async encrypt(t){const l=this.secret;if(l.length!==64)throw Error("secret must be 256 bits");const i=crypto.getRandomValues(new Uint8Array(12)),o=await crypto.subtle.importKey("raw",(0,e.hexStringToUint8Array)(l),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=new TextEncoder,d=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:i},o,a.encode(t)),g=16,m=d.slice(d.byteLength-g),u=d.slice(0,d.byteLength-g),f=new Uint8Array(m),s=new Uint8Array(u),p=new Uint8Array([...i,...f,...s]);return(0,e.uint8ArrayToHex)(p)}async decrypt(t){const l=this.secret;if(l.length!==64)throw Error("secret must be 256 bits");return new Promise((i,o)=>{(async function(){const a=await crypto.subtle.importKey("raw",(0,e.hexStringToUint8Array)(l),{name:"aes-gcm"},!1,["encrypt","decrypt"]),d=(0,e.hexStringToUint8Array)(t),g=d.slice(0,12),m=d.slice(12,28),u=d.slice(28),f=new Uint8Array([...u,...m]),s={name:"AES-GCM",iv:new Uint8Array(g)};try{const p=await window.crypto.subtle.decrypt(s,a,f),y=new TextDecoder;i(y.decode(p))}catch(p){o(p)}})()})}};return _r.Cipher=r,_r}var Er={},Ho;function Lh(){if(Ho)return Er;Ho=1,Object.defineProperty(Er,"__esModule",{value:!0}),Er.WalletLinkHTTP=void 0;let e=class{constructor(n,t,l){this.linkAPIUrl=n,this.sessionId=t;const i=`${t}:${l}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(n){return Promise.all(n.map(t=>fetch(`${this.linkAPIUrl}/events/${t.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(t=>console.error("Unabled to mark event as failed:",t))}async fetchUnseenEvents(){var n;const t=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(t.ok){const{events:l,error:i}=await t.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const o=(n=l==null?void 0:l.filter(a=>a.event==="Web3Response").map(a=>({type:"Event",sessionId:this.sessionId,eventId:a.id,event:a.event,data:a.data})))!==null&&n!==void 0?n:[];return this.markUnseenEventsAsSeen(o),o}throw new Error(`Check unseen events failed: ${t.status}`)}};return Er.WalletLinkHTTP=e,Er}var St={},Wo;function Th(){if(Wo)return St;Wo=1,Object.defineProperty(St,"__esModule",{value:!0}),St.WalletLinkWebSocket=St.ConnectionState=void 0;var e;(function(n){n[n.DISCONNECTED=0]="DISCONNECTED",n[n.CONNECTING=1]="CONNECTING",n[n.CONNECTED=2]="CONNECTED"})(e||(St.ConnectionState=e={}));let r=class{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,l=WebSocket){this.WebSocketClass=l,this.webSocket=null,this.pendingData=[],this.url=t.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((t,l)=>{var i;let o;try{this.webSocket=o=new this.WebSocketClass(this.url)}catch(a){l(a);return}(i=this.connectionStateListener)===null||i===void 0||i.call(this,e.CONNECTING),o.onclose=a=>{var d;this.clearWebSocket(),l(new Error(`websocket error ${a.code}: ${a.reason}`)),(d=this.connectionStateListener)===null||d===void 0||d.call(this,e.DISCONNECTED)},o.onopen=a=>{var d;t(),(d=this.connectionStateListener)===null||d===void 0||d.call(this,e.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(m=>this.sendData(m)),this.pendingData=[])},o.onmessage=a=>{var d,g;if(a.data==="h")(d=this.incomingDataListener)===null||d===void 0||d.call(this,{type:"Heartbeat"});else try{const m=JSON.parse(a.data);(g=this.incomingDataListener)===null||g===void 0||g.call(this,m)}catch{}}})}disconnect(){var t;const{webSocket:l}=this;if(l){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,e.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{l.close()}catch{}}}sendData(t){const{webSocket:l}=this;if(!l){this.pendingData.push(t),this.connect();return}l.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}};return St.WalletLinkWebSocket=r,St}var Vo;function Bh(){if(Vo)return br;Vo=1,Object.defineProperty(br,"__esModule",{value:!0}),br.WalletLinkConnection=void 0;const e=wn(),r=Ah(),n=Ws(),t=Vs(),l=zs(),i=Lh(),o=Th(),a=1e4,d=6e4;let g=class{constructor({session:u,linkAPIUrl:f,listener:s,diagnostic:p,WebSocketClass:y=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,e.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=c=>{if(!c)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",S=>c.JsonRpcUrl&&this.handleChainUpdated(S,c.JsonRpcUrl)]]).forEach((S,k)=>{const C=c[k];C!==void 0&&S(C)})},this.handleDestroyed=c=>{var R,S;c==="1"&&((R=this.listener)===null||R===void 0||R.resetAndReload(),(S=this.diagnostic)===null||S===void 0||S.log(n.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:l.Session.hash(this.session.id)}))},this.handleAccountUpdated=async c=>{var R,S;try{const k=await this.cipher.decrypt(c);(R=this.listener)===null||R===void 0||R.accountUpdated(k)}catch{(S=this.diagnostic)===null||S===void 0||S.log(n.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(c,R)=>{var S,k;try{const C=await this.cipher.decrypt(R);(S=this.listener)===null||S===void 0||S.metadataUpdated(c,C)}catch{(k=this.diagnostic)===null||k===void 0||k.log(n.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:c})}},this.handleWalletUsernameUpdated=async c=>{this.handleMetadataUpdated(t.WALLET_USER_NAME_KEY,c)},this.handleAppVersionUpdated=async c=>{this.handleMetadataUpdated(t.APP_VERSION_KEY,c)},this.handleChainUpdated=async(c,R)=>{var S,k;try{const C=await this.cipher.decrypt(c),T=await this.cipher.decrypt(R);(S=this.listener)===null||S===void 0||S.chainUpdated(C,T)}catch{(k=this.diagnostic)===null||k===void 0||k.log(n.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=u,this.cipher=new r.Cipher(u.secret),this.diagnostic=p,this.listener=s;const w=new o.WalletLinkWebSocket(`${f}/rpc`,y);w.setConnectionStateListener(async c=>{var R;(R=this.diagnostic)===null||R===void 0||R.log(n.EVENTS.CONNECTED_STATE_CHANGE,{state:c,sessionIdHash:l.Session.hash(u.id)});let S=!1;switch(c){case o.ConnectionState.DISCONNECTED:if(!this.destroyed){const k=async()=>{await new Promise(C=>setTimeout(C,5e3)),this.destroyed||w.connect().catch(()=>{k()})};k()}break;case o.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),S=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},a),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case o.ConnectionState.CONNECTING:break}this.connected!==S&&(this.connected=S)}),w.setIncomingDataListener(c=>{var R,S,k;switch(c.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const C=c.type==="IsLinkedOK"?c.linked:void 0;(R=this.diagnostic)===null||R===void 0||R.log(n.EVENTS.LINKED,{sessionIdHash:l.Session.hash(u.id),linked:C,type:c.type,onlineGuests:c.onlineGuests}),this.linked=C||c.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(S=this.diagnostic)===null||S===void 0||S.log(n.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:l.Session.hash(u.id),metadata_keys:c&&c.metadata?Object.keys(c.metadata):void 0}),this.handleSessionMetadataUpdated(c.metadata);break}case"Event":{this.handleIncomingEvent(c);break}}c.id!==void 0&&((k=this.requestResolutions.get(c.id))===null||k===void 0||k(c))}),this.ws=w,this.http=new i.WalletLinkHTTP(f,u.id,u.key)}connect(){var u;if(this.destroyed)throw new Error("instance is destroyed");(u=this.diagnostic)===null||u===void 0||u.log(n.EVENTS.STARTED_CONNECTING,{sessionIdHash:l.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var u;this.destroyed=!0,this.ws.disconnect(),(u=this.diagnostic)===null||u===void 0||u.log(n.EVENTS.DISCONNECTED,{sessionIdHash:l.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(u){var f,s;this._connected=u,u&&((f=this.onceConnected)===null||f===void 0||f.call(this)),(s=this.listener)===null||s===void 0||s.connectedUpdated(u)}setOnceConnected(u){return new Promise(f=>{this.connected?u().then(f):this.onceConnected=()=>{u().then(f),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(u){var f,s;this._linked=u,u&&((f=this.onceLinked)===null||f===void 0||f.call(this)),(s=this.listener)===null||s===void 0||s.linkedUpdated(u)}setOnceLinked(u){return new Promise(f=>{this.linked?u().then(f):this.onceLinked=()=>{u().then(f),this.onceLinked=void 0}})}async handleIncomingEvent(u){var f,s;if(!(u.type!=="Event"||u.event!=="Web3Response"))try{const p=await this.cipher.decrypt(u.data),y=JSON.parse(p);if(y.type!=="WEB3_RESPONSE")return;(f=this.listener)===null||f===void 0||f.handleWeb3ResponseMessage(y)}catch{(s=this.diagnostic)===null||s===void 0||s.log(n.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(u=>setTimeout(u,250));try{await this.fetchUnseenEventsAPI()}catch(u){console.error("Unable to check for unseen events",u)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(f=>this.handleIncomingEvent(f))}async setSessionMetadata(u,f){const s={type:"SetSessionConfig",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[u]:f}};return this.setOnceConnected(async()=>{const p=await this.makeRequest(s);if(p.type==="Fail")throw new Error(p.error||"failed to set session metadata")})}async publishEvent(u,f,s=!1){const p=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},f),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),y={type:"PublishEvent",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:u,data:p,callWebhook:s};return this.setOnceLinked(async()=>{const w=await this.makeRequest(y);if(w.type==="Fail")throw new Error(w.error||"failed to publish event");return w.eventId})}sendData(u){this.ws.sendData(JSON.stringify(u))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>a*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(u,f=d){const s=u.id;this.sendData(u);let p;return Promise.race([new Promise((y,w)=>{p=window.setTimeout(()=>{w(new Error(`request ${s} timed out`))},f)}),new Promise(y=>{this.requestResolutions.set(s,w=>{clearTimeout(p),y(w),this.requestResolutions.delete(s)})})])}async authenticate(){const u={type:"HostSession",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},f=await this.makeRequest(u);if(f.type==="Fail")throw new Error(f.error||"failed to authentcate")}sendIsLinked(){const u={type:"IsLinked",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(u)}sendGetSessionConfig(){const u={type:"GetSessionConfig",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(u)}};return br.WalletLinkConnection=g,br}var Rr={},Mt={},Yr={},zo;function Nh(){return zo||(zo=1,Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}'),Yr}var Jo;function Xu(){if(Jo)return Mt;Jo=1;var e=Mt&&Mt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.injectCssReset=void 0;const r=e(Nh());function n(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(r.default)),document.documentElement.appendChild(t)}return Mt.injectCssReset=n,Mt}var Sr={};const We=rr(fh);var kt={};function el(e){var r,n,t="";if(typeof e=="string"||typeof e=="number")t+=e;else if(typeof e=="object")if(Array.isArray(e))for(r=0;r65536?(w[0]=240|(c&1835008)>>>18,w[1]=128|(c&258048)>>>12,w[2]=128|(c&4032)>>>6,w[3]=128|c&63):c>2048?(w[0]=224|(c&61440)>>>12,w[1]=128|(c&4032)>>>6,w[2]=128|c&63):c>128?(w[0]=192|(c&1984)>>>6,w[1]=128|c&63):w[0]=c,this.parsedData.push(w)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}e.prototype={getLength:function(s){return this.parsedData.length},write:function(s){for(var p=0,y=this.parsedData.length;p=7&&this.setupTypeNumber(s),this.dataCache==null&&(this.dataCache=r.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,p)},setupPositionProbePattern:function(s,p){for(var y=-1;y<=7;y++)if(!(s+y<=-1||this.moduleCount<=s+y))for(var w=-1;w<=7;w++)p+w<=-1||this.moduleCount<=p+w||(0<=y&&y<=6&&(w==0||w==6)||0<=w&&w<=6&&(y==0||y==6)||2<=y&&y<=4&&2<=w&&w<=4?this.modules[s+y][p+w]=!0:this.modules[s+y][p+w]=!1)},getBestMaskPattern:function(){for(var s=0,p=0,y=0;y<8;y++){this.makeImpl(!0,y);var w=i.getLostPoint(this);(y==0||s>w)&&(s=w,p=y)}return p},createMovieClip:function(s,p,y){var w=s.createEmptyMovieClip(p,y),c=1;this.make();for(var R=0;R>y&1)==1;this.modules[Math.floor(y/3)][y%3+this.moduleCount-8-3]=w}for(var y=0;y<18;y++){var w=!s&&(p>>y&1)==1;this.modules[y%3+this.moduleCount-8-3][Math.floor(y/3)]=w}},setupTypeInfo:function(s,p){for(var y=this.errorCorrectLevel<<3|p,w=i.getBCHTypeInfo(y),c=0;c<15;c++){var R=!s&&(w>>c&1)==1;c<6?this.modules[c][8]=R:c<8?this.modules[c+1][8]=R:this.modules[this.moduleCount-15+c][8]=R}for(var c=0;c<15;c++){var R=!s&&(w>>c&1)==1;c<8?this.modules[8][this.moduleCount-c-1]=R:c<9?this.modules[8][15-c-1+1]=R:this.modules[8][15-c-1]=R}this.modules[this.moduleCount-8][8]=!s},mapData:function(s,p){for(var y=-1,w=this.moduleCount-1,c=7,R=0,S=this.moduleCount-1;S>0;S-=2)for(S==6&&S--;;){for(var k=0;k<2;k++)if(this.modules[w][S-k]==null){var C=!1;R>>c&1)==1);var T=i.getMask(p,w,S-k);T&&(C=!C),this.modules[w][S-k]=C,c--,c==-1&&(R++,c=7)}if(w+=y,w<0||this.moduleCount<=w){w-=y,y=-y;break}}}},r.PAD0=236,r.PAD1=17,r.createData=function(s,p,y){for(var w=g.getRSBlocks(s,p),c=new m,R=0;Rk*8)throw new Error("code length overflow. ("+c.getLengthInBits()+">"+k*8+")");for(c.getLengthInBits()+4<=k*8&&c.put(0,4);c.getLengthInBits()%8!=0;)c.putBit(!1);for(;!(c.getLengthInBits()>=k*8||(c.put(r.PAD0,8),c.getLengthInBits()>=k*8));)c.put(r.PAD1,8);return r.createBytes(c,w)},r.createBytes=function(s,p){for(var y=0,w=0,c=0,R=new Array(p.length),S=new Array(p.length),k=0;k=0?Z.get(Q):0}}for(var re=0,N=0;N=0;)p^=i.G15<=0;)p^=i.G18<>>=1;return p},getPatternPosition:function(s){return i.PATTERN_POSITION_TABLE[s-1]},getMask:function(s,p,y){switch(s){case l.PATTERN000:return(p+y)%2==0;case l.PATTERN001:return p%2==0;case l.PATTERN010:return y%3==0;case l.PATTERN011:return(p+y)%3==0;case l.PATTERN100:return(Math.floor(p/2)+Math.floor(y/3))%2==0;case l.PATTERN101:return p*y%2+p*y%3==0;case l.PATTERN110:return(p*y%2+p*y%3)%2==0;case l.PATTERN111:return(p*y%3+(p+y)%2)%2==0;default:throw new Error("bad maskPattern:"+s)}},getErrorCorrectPolynomial:function(s){for(var p=new d([1],0),y=0;y5&&(y+=3+R-5)}for(var w=0;w=256;)s-=255;return o.EXP_TABLE[s]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},a=0;a<8;a++)o.EXP_TABLE[a]=1<>>7-s%8&1)==1},put:function(s,p){for(var y=0;y>>p-y-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(s){var p=Math.floor(this.length/8);this.buffer.length<=p&&this.buffer.push(0),s&&(this.buffer[p]|=128>>>this.length%8),this.length++}};var u=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function f(s){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof s=="string"&&(s={content:s}),s)for(var p in s)this.options[p]=s[p];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function y(C){switch(C){case"L":return t.L;case"M":return t.M;case"Q":return t.Q;case"H":return t.H;default:throw new Error("Unknwon error correction level: "+C)}}function w(C,T){for(var N=c(C),j=1,z=0,Z=0,Q=u.length;Z<=Q;Z++){var re=u[Z];if(!re)throw new Error("Content too long: expected "+z+" but got "+N);switch(T){case"L":z=re[0];break;case"M":z=re[1];break;case"Q":z=re[2];break;case"H":z=re[3];break;default:throw new Error("Unknwon error correction level: "+T)}if(N<=z)break;j++}if(j>u.length)throw new Error("Content too long");return j}function c(C){var T=encodeURI(C).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return T.length+(T.length!=C?3:0)}var R=this.options.content,S=w(R,this.options.ecl),k=y(this.options.ecl);this.qrcode=new r(S,k),this.qrcode.addData(R),this.qrcode.make()}return f.prototype.svg=function(s){var p=this.options||{},y=this.qrcode.modules;typeof s>"u"&&(s={container:p.container||"svg"});for(var w=typeof p.pretty<"u"?!!p.pretty:!0,c=w?" ":"",R=w?`\r +`:"",S=p.width,k=p.height,C=y.length,T=S/(C+2*p.padding),N=k/(C+2*p.padding),j=typeof p.join<"u"?!!p.join:!1,z=typeof p.swap<"u"?!!p.swap:!1,Z=typeof p.xmlDeclaration<"u"?!!p.xmlDeclaration:!0,Q=typeof p.predefined<"u"?!!p.predefined:!1,re=Q?c+''+R:"",q=c+''+R,h="",E="",M=0;M'+R:h+=c+''+R}}j&&(h=c+'');let te="";if(this.options.image!==void 0&&this.options.image.svg){const U=S*this.options.image.width/100,W=k*this.options.image.height/100,G=S/2-U/2,ee=k/2-W/2;te+=``,te+=this.options.image.svg+R,te+=""}var Y="";switch(s.container){case"svg":Z&&(Y+=''+R),Y+=''+R,Y+=re+q+h,Y+=te,Y+="";break;case"svg-viewbox":Z&&(Y+=''+R),Y+=''+R,Y+=re+q+h,Y+=te,Y+="";break;case"g":Y+=''+R,Y+=re+q+h,Y+=te,Y+="";break;default:Y+=(re+q+h+te).replace(/^\s+/,"");break}return Y},zn=f,zn}var Xo;function jh(){if(Xo)return Ct;Xo=1;var e=Ct&&Ct.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.QRCode=void 0;const r=We,n=_n,t=e(qh()),l=i=>{const[o,a]=(0,n.useState)("");return(0,n.useEffect)(()=>{var d,g;const m=new t.default({content:i.content,background:i.bgColor||"#ffffff",color:i.fgColor||"#000000",container:"svg",ecl:"M",width:(d=i.width)!==null&&d!==void 0?d:256,height:(g=i.height)!==null&&g!==void 0?g:256,padding:0,image:i.image}),u=Buffer.from(m.svg(),"utf8").toString("base64");a(`data:image/svg+xml;base64,${u}`)},[i.bgColor,i.content,i.fgColor,i.height,i.image,i.width]),o?(0,r.h)("img",{src:o,alt:"QR Code"}):null};return Ct.QRCode=l,Ct}var It={},Xr={},ea;function $h(){return ea||(ea=1,Object.defineProperty(Xr,"__esModule",{value:!0}),Xr.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}"),Xr}var ta;function Uh(){if(ta)return It;ta=1;var e=It&&It.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(It,"__esModule",{value:!0}),It.Spinner=void 0;const r=We,n=e($h()),t=l=>{var i;const o=(i=l.size)!==null&&i!==void 0?i:64,a=l.color||"#000";return(0,r.h)("div",{class:"-cbwsdk-spinner"},(0,r.h)("style",null,n.default),(0,r.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:o,height:o}},(0,r.h)("circle",{style:{cx:50,cy:50,r:45,stroke:a}})))};return It.Spinner=t,It}var en={},ra;function Hh(){return ra||(ra=1,Object.defineProperty(en,"__esModule",{value:!0}),en.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer;border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}"),en}var na;function Wh(){if(na)return tt;na=1;var e=tt&&tt.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(tt,"__esModule",{value:!0}),tt.CoinbaseWalletSteps=tt.ConnectContent=void 0;const r=e(Wr),n=We,t=nt(),l=Hs(),i=Ph(),o=Fh(),a=Dh(),d=jh(),g=Uh(),m=e(Hh()),u={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:y},f=w=>w==="light"?"#FFFFFF":"#0A0B0D";function s(w){const{theme:c}=w,R=(0,t.createQrUrl)(w.sessionId,w.sessionSecret,w.linkAPIUrl,w.isParentConnection,w.version,w.chainId),S=u.steps;return(0,n.h)("div",{"data-testid":"connect-content",className:(0,r.default)("-cbwsdk-connect-content",c)},(0,n.h)("style",null,m.default),(0,n.h)("div",{className:"-cbwsdk-connect-content-header"},(0,n.h)("h2",{className:(0,r.default)("-cbwsdk-connect-content-heading",c)},"Scan to connect with our mobile app"),w.onCancel&&(0,n.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:w.onCancel},(0,n.h)(i.CloseIcon,{fill:c==="light"?"#0A0B0D":"#FFFFFF"}))),(0,n.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,n.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,n.h)(p,{title:u.title,description:u.description,theme:c})),(0,n.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,n.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,n.h)(d.QRCode,{content:R,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,n.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:l.LIB_VERSION}),(0,n.h)("input",{type:"hidden",value:R})),(0,n.h)(S,{theme:c}),!w.isConnected&&(0,n.h)("div",{"data-testid":"connecting-spinner",className:(0,r.default)("-cbwsdk-connect-content-qr-connecting",c)},(0,n.h)(g.Spinner,{size:36,color:c==="dark"?"#FFF":"#000"}),(0,n.h)("p",null,"Connecting...")))))}tt.ConnectContent=s;function p({title:w,description:c,theme:R}){return(0,n.h)("div",{className:(0,r.default)("-cbwsdk-connect-item",R)},(0,n.h)("div",null,(0,n.h)(o.CoinbaseWalletRound,null)),(0,n.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,n.h)("h3",{className:"-cbwsdk-connect-item-title"},w),(0,n.h)("p",{className:"-cbwsdk-connect-item-description"},c)))}function y({theme:w}){return(0,n.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,n.h)("li",{className:(0,r.default)("-cbwsdk-wallet-steps-item",w)},(0,n.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,n.h)("li",{className:(0,r.default)("-cbwsdk-wallet-steps-item",w)},(0,n.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,n.h)("span",null,"Tap ",(0,n.h)("strong",null,"Scan")," "),(0,n.h)("span",{className:(0,r.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",w)},(0,n.h)(a.QRCodeIcon,{fill:f(w)})))))}return tt.CoinbaseWalletSteps=y,tt}var xt={},Ir={},ia;function Vh(){if(ia)return Ir;ia=1,Object.defineProperty(Ir,"__esModule",{value:!0}),Ir.ArrowLeftIcon=void 0;const e=We;function r(n){return(0,e.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},n),(0,e.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}return Ir.ArrowLeftIcon=r,Ir}var xr={},sa;function zh(){if(sa)return xr;sa=1,Object.defineProperty(xr,"__esModule",{value:!0}),xr.LaptopIcon=void 0;const e=We;function r(n){return(0,e.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},n),(0,e.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,e.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}return xr.LaptopIcon=r,xr}var Ar={},oa;function Jh(){if(oa)return Ar;oa=1,Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.SafeIcon=void 0;const e=We;function r(n){return(0,e.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},n),(0,e.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}return Ar.SafeIcon=r,Ar}var tn={},aa;function Gh(){return aa||(aa=1,Object.defineProperty(tn,"__esModule",{value:!0}),tn.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}"),tn}var ca;function Zh(){if(ca)return xt;ca=1;var e=xt&&xt.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(xt,"__esModule",{value:!0}),xt.TryExtensionContent=void 0;const r=e(Wr),n=We,t=_n,l=Vh(),i=zh(),o=Jh(),a=e(Gh());function d({theme:g}){const[m,u]=(0,t.useState)(!1),f=(0,t.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),s=(0,t.useCallback)(()=>{m?window.location.reload():(f(),u(!0))},[f,m]);return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-try-extension",g)},(0,n.h)("style",null,a.default),(0,n.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,n.h)("h3",{class:(0,r.default)("-cbwsdk-try-extension-heading",g)},"Or try the Coinbase Wallet browser extension"),(0,n.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,n.h)("button",{class:(0,r.default)("-cbwsdk-try-extension-cta",g),onClick:s},m?"Refresh":"Install"),(0,n.h)("div",null,!m&&(0,n.h)(l.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:g==="light"?"#0052FF":"#588AF5"})))),(0,n.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,n.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,n.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,n.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,n.h)("span",{class:(0,r.default)("-cbwsdk-try-extension-list-item-icon",g)},(0,n.h)(i.LaptopIcon,{fill:g==="light"?"#0A0B0D":"#FFFFFF"}))),(0,n.h)("div",{class:(0,r.default)("-cbwsdk-try-extension-list-item-copy",g)},"Connect with dapps with just one click on your desktop browser")),(0,n.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,n.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,n.h)("span",{class:(0,r.default)("-cbwsdk-try-extension-list-item-icon",g)},(0,n.h)(o.SafeIcon,{fill:g==="light"?"#0A0B0D":"#FFFFFF"}))),(0,n.h)("div",{class:(0,r.default)("-cbwsdk-try-extension-list-item-copy",g)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}return xt.TryExtensionContent=d,xt}var rn={},ua;function Kh(){return ua||(ua=1,Object.defineProperty(rn,"__esModule",{value:!0}),rn.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}"),rn}var la;function Qh(){if(la)return kt;la=1;var e=kt&&kt.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(kt,"__esModule",{value:!0}),kt.ConnectDialog=void 0;const r=e(Wr),n=We,t=_n,l=Wh(),i=Zh(),o=e(Kh()),a=d=>{const{isOpen:g,darkMode:m}=d,[u,f]=(0,t.useState)(!g),[s,p]=(0,t.useState)(!g);(0,t.useEffect)(()=>{const w=[window.setTimeout(()=>{p(!g)},10)];return g?f(!1):w.push(window.setTimeout(()=>{f(!0)},360)),()=>{w.forEach(window.clearTimeout)}},[g]);const y=m?"dark":"light";return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-connect-dialog-container",u&&"-cbwsdk-connect-dialog-container-hidden")},(0,n.h)("style",null,o.default),(0,n.h)("div",{class:(0,r.default)("-cbwsdk-connect-dialog-backdrop",y,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,n.h)("div",{class:"-cbwsdk-connect-dialog"},(0,n.h)("div",{class:(0,r.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},d.connectDisabled?null:(0,n.h)(l.ConnectContent,{theme:y,version:d.version,sessionId:d.sessionId,sessionSecret:d.sessionSecret,linkAPIUrl:d.linkAPIUrl,isConnected:d.isConnected,isParentConnection:d.isParentConnection,chainId:d.chainId,onCancel:d.onCancel}),(0,n.h)(i.TryExtensionContent,{theme:y}))))};return kt.ConnectDialog=a,kt}var ha;function Yh(){if(ha)return Sr;ha=1,Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.LinkFlow=void 0;const e=We,r=Qh();let n=class{constructor(l){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=l.darkMode,this.version=l.version,this.sessionId=l.sessionId,this.sessionSecret=l.sessionSecret,this.linkAPIUrl=l.linkAPIUrl,this.isParentConnection=l.isParentConnection}attach(l){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",l.appendChild(this.root),this.render()}setConnected(l){this.connected!==l&&(this.connected=l,this.render())}setChainId(l){this.chainId!==l&&(this.chainId=l,this.render())}detach(){var l;this.root&&((0,e.render)(null,this.root),(l=this.root.parentElement)===null||l===void 0||l.removeChild(this.root))}setConnectDisabled(l){this.connectDisabled=l}open(l){this.isOpen=!0,this.onCancel=l.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,e.render)((0,e.h)(r.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.connected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)}};return Sr.LinkFlow=n,Sr}var Lr={},nn={},fa;function Xh(){return fa||(fa=1,Object.defineProperty(nn,"__esModule",{value:!0}),nn.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}"),nn}var da;function tl(){return da||(da=1,function(e){var r=Lr&&Lr.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const n=r(Wr),t=We,l=_n,i=r(Xh()),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class d{constructor(f){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=f.darkMode}attach(f){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",f.appendChild(this.root),this.render()}presentItem(f){const s=this.nextItemKey++;return this.items.set(s,f),this.render(),()=>{this.items.delete(s),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,t.render)((0,t.h)("div",null,(0,t.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([f,s])=>(0,t.h)(e.SnackbarInstance,Object.assign({},s,{key:f}))))),this.root)}}e.Snackbar=d;const g=u=>(0,t.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-container")},(0,t.h)("style",null,i.default),(0,t.h)("div",{class:"-cbwsdk-snackbar"},u.children));e.SnackbarContainer=g;const m=({autoExpand:u,message:f,menuItems:s})=>{const[p,y]=(0,l.useState)(!0),[w,c]=(0,l.useState)(u??!1);(0,l.useEffect)(()=>{const S=[window.setTimeout(()=>{y(!1)},1),window.setTimeout(()=>{c(!0)},1e4)];return()=>{S.forEach(window.clearTimeout)}});const R=()=>{c(!w)};return(0,t.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-instance",p&&"-cbwsdk-snackbar-instance-hidden",w&&"-cbwsdk-snackbar-instance-expanded")},(0,t.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:R},(0,t.h)("img",{src:o,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,t.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},f),(0,t.h)("div",{class:"-gear-container"},!w&&(0,t.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,t.h)("img",{src:a,class:"-gear-icon",title:"Expand"}))),s&&s.length>0&&(0,t.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},s.map((S,k)=>(0,t.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-instance-menu-item",S.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:S.onClick,key:k},(0,t.h)("svg",{width:S.svgWidth,height:S.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.h)("path",{"fill-rule":S.defaultFillRule,"clip-rule":S.defaultClipRule,d:S.path,fill:"#AAAAAA"})),(0,t.h)("span",{class:(0,n.default)("-cbwsdk-snackbar-instance-menu-item-info",S.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},S.info)))))};e.SnackbarInstance=m}(Lr)),Lr}var pa;function rl(){if(pa)return Rr;pa=1,Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.WalletLinkRelayUI=void 0;const e=Xu(),r=Yh(),n=tl();let t=class{constructor(i){this.standalone=null,this.attached=!1,this.snackbar=new n.Snackbar({darkMode:i.darkMode}),this.linkFlow=new r.LinkFlow({darkMode:i.darkMode,version:i.version,sessionId:i.session.id,sessionSecret:i.session.secret,linkAPIUrl:i.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const i=document.documentElement,o=document.createElement("div");o.className="-cbwsdk-css-reset",i.appendChild(o),this.linkFlow.attach(o),this.snackbar.attach(o),this.attached=!0,(0,e.injectCssReset)()}setConnected(i){this.linkFlow.setConnected(i)}setChainId(i){this.linkFlow.setChainId(i)}setConnectDisabled(i){this.linkFlow.setConnectDisabled(i)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(i){this.linkFlow.open({onCancel:i.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(i){let o;return i.isUnlinkedErrorState?o={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:i.onResetConnection}]}:o={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:i.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:i.onResetConnection}]},this.snackbar.presentItem(o)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(i){this.standalone=i}isStandalone(){var i;return(i=this.standalone)!==null&&i!==void 0?i:!1}};return Rr.WalletLinkRelayUI=t,Rr}var ga;function nl(){if(ga)return mr;ga=1,Object.defineProperty(mr,"__esModule",{value:!0}),mr.WalletLinkRelay=void 0;const e=yn(),r=wn(),n=nt(),t=Ws(),l=Vs(),i=zs(),o=Bh(),a=Us(),d=rl();let g=class Ut extends l.RelayAbstract{constructor(u){var f;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=w=>{var c;this.isLinked=w;const R=this.storage.getItem(l.LOCAL_STORAGE_ADDRESSES_KEY);if(w&&(this.session.linked=w),this.isUnlinkedErrorState=!1,R){const S=R.split(" "),k=this.storage.getItem("IsStandaloneSigning")==="true";if(S[0]!==""&&!w&&this.session.linked&&!k){this.isUnlinkedErrorState=!0;const C=this.getSessionIdHash();(c=this.diagnostic)===null||c===void 0||c.log(t.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:C})}}},this.metadataUpdated=(w,c)=>{this.storage.setItem(w,c)},this.chainUpdated=(w,c)=>{this.chainCallbackParams.chainId===w&&this.chainCallbackParams.jsonRpcUrl===c||(this.chainCallbackParams={chainId:w,jsonRpcUrl:c},this.chainCallback&&this.chainCallback(w,c))},this.accountUpdated=w=>{this.accountsCallback&&this.accountsCallback([w]),Ut.accountRequestCallbackIds.size>0&&(Array.from(Ut.accountRequestCallbackIds.values()).forEach(c=>{const R={type:"WEB3_RESPONSE",id:c,response:{method:"requestEthereumAccounts",result:[w]}};this.invokeCallback(Object.assign(Object.assign({},R),{id:c}))}),Ut.accountRequestCallbackIds.clear())},this.connectedUpdated=w=>{this.ui.setConnected(w)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=u.linkAPIUrl,this.storage=u.storage,this.options=u;const{session:s,ui:p,connection:y}=this.subscribe();this._session=s,this.connection=y,this.relayEventManager=u.relayEventManager,this.diagnostic=u.diagnosticLogger,this._reloadOnDisconnect=(f=u.reloadOnDisconnect)!==null&&f!==void 0?f:!0,this.ui=p}subscribe(){const u=i.Session.load(this.storage)||new i.Session(this.storage).save(),{linkAPIUrl:f,diagnostic:s}=this,p=new o.WalletLinkConnection({session:u,linkAPIUrl:f,diagnostic:s,listener:this}),{version:y,darkMode:w}=this.options,c=this.options.uiConstructor({linkAPIUrl:f,version:y,darkMode:w,session:u});return p.connect(),{session:u,ui:c,connection:p}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(u=>setTimeout(()=>u(null),1e3))]).then(()=>{var u,f;const s=this.ui.isStandalone();(u=this.diagnostic)===null||u===void 0||u.log(t.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const p=i.Session.load(this.storage);if((p==null?void 0:p.id)===this._session.id?this.storage.clear():p&&((f=this.diagnostic)===null||f===void 0||f.log(t.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i.Session.hash(p.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:y,ui:w,connection:c}=this.subscribe();this._session=y,this.connection=c,this.ui=w,s&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(u=>{var f;(f=this.diagnostic)===null||f===void 0||f.log(t.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${u}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(u,f){this.appName=u,this.appLogoUrl=f}getStorageItem(u){return this.storage.getItem(u)}get session(){return this._session}setStorageItem(u,f){this.storage.setItem(u,f)}signEthereumMessage(u,f,s,p){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,n.hexStringFromBuffer)(u,!0),address:f,addPrefix:s,typedDataJson:p||null}})}ethereumAddressFromSignedMessage(u,f,s){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,n.hexStringFromBuffer)(u,!0),signature:(0,n.hexStringFromBuffer)(f,!0),addPrefix:s}})}signEthereumTransaction(u){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:u.fromAddress,toAddress:u.toAddress,weiValue:(0,n.bigIntStringFromBN)(u.weiValue),data:(0,n.hexStringFromBuffer)(u.data,!0),nonce:u.nonce,gasPriceInWei:u.gasPriceInWei?(0,n.bigIntStringFromBN)(u.gasPriceInWei):null,maxFeePerGas:u.gasPriceInWei?(0,n.bigIntStringFromBN)(u.gasPriceInWei):null,maxPriorityFeePerGas:u.gasPriceInWei?(0,n.bigIntStringFromBN)(u.gasPriceInWei):null,gasLimit:u.gasLimit?(0,n.bigIntStringFromBN)(u.gasLimit):null,chainId:u.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(u){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:u.fromAddress,toAddress:u.toAddress,weiValue:(0,n.bigIntStringFromBN)(u.weiValue),data:(0,n.hexStringFromBuffer)(u.data,!0),nonce:u.nonce,gasPriceInWei:u.gasPriceInWei?(0,n.bigIntStringFromBN)(u.gasPriceInWei):null,maxFeePerGas:u.maxFeePerGas?(0,n.bigIntStringFromBN)(u.maxFeePerGas):null,maxPriorityFeePerGas:u.maxPriorityFeePerGas?(0,n.bigIntStringFromBN)(u.maxPriorityFeePerGas):null,gasLimit:u.gasLimit?(0,n.bigIntStringFromBN)(u.gasLimit):null,chainId:u.chainId,shouldSubmit:!0}})}submitEthereumTransaction(u,f){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,n.hexStringFromBuffer)(u,!0),chainId:f}})}scanQRCode(u){return this.sendRequest({method:"scanQRCode",params:{regExp:u}})}getQRCodeUrl(){return(0,n.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(u,f){return this.sendRequest({method:"generic",params:{action:f,data:u}})}sendGenericMessage(u){return this.sendRequest(u)}sendRequest(u){let f=null;const s=(0,n.randomBytesHex)(8),p=w=>{this.publishWeb3RequestCanceledEvent(s),this.handleErrorResponse(s,u.method,w),f==null||f()};return{promise:new Promise((w,c)=>{this.ui.isStandalone()||(f=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(s,R=>{if(f==null||f(),(0,a.isErrorResponse)(R))return c(new Error(R.errorMessage));w(R)}),this.ui.isStandalone()?this.sendRequestStandalone(s,u):this.publishWeb3RequestEvent(s,u)}),cancel:p}}setConnectDisabled(u){this.ui.setConnectDisabled(u)}setAccountsCallback(u){this.accountsCallback=u}setChainCallback(u){this.chainCallback=u}setDappDefaultChainCallback(u){this.dappDefaultChain=u,this.ui instanceof d.WalletLinkRelayUI&&this.ui.setChainId(u)}publishWeb3RequestEvent(u,f){var s;const p={type:"WEB3_REQUEST",id:u,request:f},y=i.Session.load(this.storage);(s=this.diagnostic)===null||s===void 0||s.log(t.EVENTS.WEB3_REQUEST,{eventId:p.id,method:`relay::${f.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:y?i.Session.hash(y.id):"",isSessionMismatched:((y==null?void 0:y.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",p,!0).then(w=>{var c;(c=this.diagnostic)===null||c===void 0||c.log(t.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:p.id,method:`relay::${f.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:y?i.Session.hash(y.id):"",isSessionMismatched:((y==null?void 0:y.id)!==this._session.id).toString()})}).catch(w=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:p.id,response:{method:f.method,errorMessage:w.message}})})}publishWeb3RequestCanceledEvent(u){const f={type:"WEB3_REQUEST_CANCELED",id:u};this.publishEvent("Web3RequestCanceled",f,!1).then()}publishEvent(u,f,s){return this.connection.publishEvent(u,f,s)}handleWeb3ResponseMessage(u){var f;const{response:s}=u;if((f=this.diagnostic)===null||f===void 0||f.log(t.EVENTS.WEB3_RESPONSE,{eventId:u.id,method:`relay::${s.method}`,sessionIdHash:this.getSessionIdHash()}),s.method==="requestEthereumAccounts"){Ut.accountRequestCallbackIds.forEach(p=>this.invokeCallback(Object.assign(Object.assign({},u),{id:p}))),Ut.accountRequestCallbackIds.clear();return}this.invokeCallback(u)}handleErrorResponse(u,f,s,p){var y;const w=(y=s==null?void 0:s.message)!==null&&y!==void 0?y:(0,e.getMessageFromCode)(p);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:f,errorMessage:w,errorCode:p}})}invokeCallback(u){const f=this.relayEventManager.callbacks.get(u.id);f&&(f(u.response),this.relayEventManager.callbacks.delete(u.id))}requestEthereumAccounts(){const u={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},f=(0,n.randomBytesHex)(8),s=y=>{this.publishWeb3RequestCanceledEvent(f),this.handleErrorResponse(f,u.method,y)};return{promise:new Promise((y,w)=>{if(this.relayEventManager.callbacks.set(f,c=>{if(this.ui.hideRequestEthereumAccounts(),(0,a.isErrorResponse)(c))return w(new Error(c.errorMessage));y(c)}),this.ui.inlineAccountsResponse()){const c=R=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:f,response:{method:"requestEthereumAccounts",result:R}})};this.ui.requestEthereumAccounts({onCancel:s,onAccounts:c})}else{const c=e.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>s(c)})}Ut.accountRequestCallbackIds.add(f),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(f,u)}),cancel:s}}selectProvider(u){const f={method:"selectProvider"},s=(0,n.randomBytesHex)(8),p=w=>{this.publishWeb3RequestCanceledEvent(s),this.handleErrorResponse(s,f.method,w)},y=new Promise((w,c)=>{this.relayEventManager.callbacks.set(s,k=>{if((0,a.isErrorResponse)(k))return c(new Error(k.errorMessage));w(k)});const R=k=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:"selectProvider",result:r.ProviderType.Unselected}})},S=k=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:"selectProvider",result:k}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:S,onCancel:R,providerOptions:u})});return{cancel:p,promise:y}}watchAsset(u,f,s,p,y,w){const c={method:"watchAsset",params:{type:u,options:{address:f,symbol:s,decimals:p,image:y},chainId:w}};let R=null;const S=(0,n.randomBytesHex)(8),k=T=>{this.publishWeb3RequestCanceledEvent(S),this.handleErrorResponse(S,c.method,T),R==null||R()};this.ui.inlineWatchAsset()||(R=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:k,onResetConnection:this.resetAndReload}));const C=new Promise((T,N)=>{this.relayEventManager.callbacks.set(S,Z=>{if(R==null||R(),(0,a.isErrorResponse)(Z))return N(new Error(Z.errorMessage));T(Z)});const j=Z=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:S,response:{method:"watchAsset",result:!1}})},z=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:S,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:z,onCancel:j,type:u,address:f,symbol:s,decimals:p,image:y,chainId:w}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(S,c)});return{cancel:k,promise:C}}addEthereumChain(u,f,s,p,y,w){const c={method:"addEthereumChain",params:{chainId:u,rpcUrls:f,blockExplorerUrls:p,chainName:y,iconUrls:s,nativeCurrency:w}};let R=null;const S=(0,n.randomBytesHex)(8),k=T=>{this.publishWeb3RequestCanceledEvent(S),this.handleErrorResponse(S,c.method,T),R==null||R()};return this.ui.inlineAddEthereumChain(u)||(R=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:k,onResetConnection:this.resetAndReload})),{promise:new Promise((T,N)=>{this.relayEventManager.callbacks.set(S,Z=>{if(R==null||R(),(0,a.isErrorResponse)(Z))return N(new Error(Z.errorMessage));T(Z)});const j=Z=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:S,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},z=Z=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:S,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:Z}}})};this.ui.inlineAddEthereumChain(u)&&this.ui.addEthereumChain({onCancel:j,onApprove:z,chainId:c.params.chainId,rpcUrls:c.params.rpcUrls,blockExplorerUrls:c.params.blockExplorerUrls,chainName:c.params.chainName,iconUrls:c.params.iconUrls,nativeCurrency:c.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(u)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(S,c)}),cancel:k}}switchEthereumChain(u,f){const s={method:"switchEthereumChain",params:Object.assign({chainId:u},{address:f})},p=(0,n.randomBytesHex)(8),y=c=>{this.publishWeb3RequestCanceledEvent(p),this.handleErrorResponse(p,s.method,c)};return{promise:new Promise((c,R)=>{this.relayEventManager.callbacks.set(p,C=>{if((0,a.isErrorResponse)(C)&&C.errorCode)return R(e.standardErrors.provider.custom({code:C.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,a.isErrorResponse)(C))return R(new Error(C.errorMessage));c(C)});const S=C=>{var T;if(C){const N=(T=(0,e.getErrorCode)(C))!==null&&T!==void 0?T:e.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(p,"switchEthereumChain",C instanceof Error?C:e.standardErrors.provider.unsupportedChain(u),N)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:p,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},k=C=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:p,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:C}}})};this.ui.switchEthereumChain({onCancel:S,onApprove:k,chainId:s.params.chainId,address:s.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(p,s)}),cancel:y}}inlineAddEthereumChain(u){return this.ui.inlineAddEthereumChain(u)}getSessionIdHash(){return i.Session.hash(this._session.id)}sendRequestStandalone(u,f){const s=y=>{this.handleErrorResponse(u,f.method,y)},p=y=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:y})};switch(f.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:f,onSuccess:p,onCancel:s});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:f,onSuccess:p,onCancel:s});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:f,onSuccess:p,onCancel:s});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:f,onSuccess:p});break;default:s();break}}};return mr.WalletLinkRelay=g,g.accountRequestCallbackIds=new Set,mr}var Tr={},At={},Lt={},ma;function ef(){return ma||(ma=1,function(e){var r=Lt&&Lt.__createBinding||(Object.create?function(t,l,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(l,i);(!a||("get"in a?!l.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return l[i]}}),Object.defineProperty(t,o,a)}:function(t,l,i,o){o===void 0&&(o=i),t[o]=l[i]}),n=Lt&&Lt.__exportStar||function(t,l){for(var i in t)i!=="default"&&!Object.prototype.hasOwnProperty.call(l,i)&&r(l,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(tl(),e)}(Lt)),Lt}var sn={},va;function tf(){return va||(va=1,Object.defineProperty(sn,"__esModule",{value:!0}),sn.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}"),sn}var ya;function rf(){if(ya)return At;ya=1;var e=At&&At.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(At,"__esModule",{value:!0}),At.RedirectDialog=void 0;const r=e(Wr),n=We,t=Xu(),l=ef(),i=e(tf());let o=class{constructor(){this.root=null}attach(){const g=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",g.appendChild(this.root),(0,t.injectCssReset)()}present(g){this.render(g)}clear(){this.render(null)}render(g){this.root&&((0,n.render)(null,this.root),g&&(0,n.render)((0,n.h)(a,Object.assign({},g,{onDismiss:()=>{this.clear()}})),this.root))}};At.RedirectDialog=o;const a=({title:d,buttonText:g,darkMode:m,onButtonClick:u,onDismiss:f})=>{const s=m?"dark":"light";return(0,n.h)(l.SnackbarContainer,{darkMode:m},(0,n.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,n.h)("style",null,i.default),(0,n.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:f}),(0,n.h)("div",{class:(0,r.default)("-cbwsdk-redirect-dialog-box",s)},(0,n.h)("p",null,d),(0,n.h)("button",{onClick:u},g))))};return At}var wa;function il(){if(wa)return Tr;wa=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.MobileRelayUI=void 0;const e=rf();let r=class{constructor(t){this.attached=!1,this.darkMode=!1,this.redirectDialog=new e.RedirectDialog,this.darkMode=t.darkMode}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(t){}redirectToCoinbaseWallet(t){const l=new URL("https://go.cb-w.com/walletlink");l.searchParams.append("redirect_url",window.location.href),t&&l.searchParams.append("wl_url",t);const i=document.createElement("a");i.target="cbw-opener",i.href=l.href,i.rel="noreferrer noopener",i.click()}openCoinbaseWalletDeeplink(t){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(t)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(t)},99)}showConnecting(t){return()=>{this.redirectDialog.clear()}}hideRequestEthereumAccounts(){this.redirectDialog.clear()}requestEthereumAccounts(){}addEthereumChain(){}watchAsset(){}selectProvider(){}switchEthereumChain(){}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}reloadUI(){}setStandalone(){}setConnectDisabled(){}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}isStandalone(){return!1}};return Tr.MobileRelayUI=r,Tr}var ba;function sl(){if(ba)return gr;ba=1,Object.defineProperty(gr,"__esModule",{value:!0}),gr.MobileRelay=void 0;const e=nt(),r=nl(),n=il();let t=class extends r.WalletLinkRelay{constructor(i){var o;super(i),this._enableMobileWalletLink=(o=i.enableMobileWalletLink)!==null&&o!==void 0?o:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const i=(0,e.getLocation)();i.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(i.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(i,o){if(super.publishWeb3RequestEvent(i,o),!(this._enableMobileWalletLink&&this.ui instanceof n.MobileRelayUI))return;let a=!1;switch(o.method){case"requestEthereumAccounts":case"connectAndSignIn":a=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:a=!0,this.ui.openCoinbaseWalletDeeplink();break}a&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(i){super.handleWeb3ResponseMessage(i)}connectAndSignIn(i){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:i.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:i.statement,resources:i.resources}})}};return gr.MobileRelay=t,gr}var on={exports:{}},an={exports:{}},_a;function En(){if(_a)return an.exports;_a=1;var e=typeof Reflect=="object"?Reflect:null,r=e&&typeof e.apply=="function"?e.apply:function(C,T,N){return Function.prototype.apply.call(C,T,N)},n;e&&typeof e.ownKeys=="function"?n=e.ownKeys:Object.getOwnPropertySymbols?n=function(C){return Object.getOwnPropertyNames(C).concat(Object.getOwnPropertySymbols(C))}:n=function(C){return Object.getOwnPropertyNames(C)};function t(k){console&&console.warn&&console.warn(k)}var l=Number.isNaN||function(C){return C!==C};function i(){i.init.call(this)}an.exports=i,an.exports.once=c,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var o=10;function a(k){if(typeof k!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof k)}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(k){if(typeof k!="number"||k<0||l(k))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+k+".");o=k}}),i.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(C){if(typeof C!="number"||C<0||l(C))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+C+".");return this._maxListeners=C,this};function d(k){return k._maxListeners===void 0?i.defaultMaxListeners:k._maxListeners}i.prototype.getMaxListeners=function(){return d(this)},i.prototype.emit=function(C){for(var T=[],N=1;N0&&(Z=T[0]),Z instanceof Error)throw Z;var Q=new Error("Unhandled error."+(Z?" ("+Z.message+")":""));throw Q.context=Z,Q}var re=z[C];if(re===void 0)return!1;if(typeof re=="function")r(re,this,T);else for(var q=re.length,h=p(re,q),N=0;N0&&Z.length>j&&!Z.warned){Z.warned=!0;var Q=new Error("Possible EventEmitter memory leak detected. "+Z.length+" "+String(C)+" listeners added. Use emitter.setMaxListeners() to increase limit");Q.name="MaxListenersExceededWarning",Q.emitter=k,Q.type=C,Q.count=Z.length,t(Q)}return k}i.prototype.addListener=function(C,T){return g(this,C,T,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(C,T){return g(this,C,T,!0)};function m(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(k,C,T){var N={fired:!1,wrapFn:void 0,target:k,type:C,listener:T},j=m.bind(N);return j.listener=T,N.wrapFn=j,j}i.prototype.once=function(C,T){return a(T),this.on(C,u(this,C,T)),this},i.prototype.prependOnceListener=function(C,T){return a(T),this.prependListener(C,u(this,C,T)),this},i.prototype.removeListener=function(C,T){var N,j,z,Z,Q;if(a(T),j=this._events,j===void 0)return this;if(N=j[C],N===void 0)return this;if(N===T||N.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete j[C],j.removeListener&&this.emit("removeListener",C,N.listener||T));else if(typeof N!="function"){for(z=-1,Z=N.length-1;Z>=0;Z--)if(N[Z]===T||N[Z].listener===T){Q=N[Z].listener,z=Z;break}if(z<0)return this;z===0?N.shift():y(N,z),N.length===1&&(j[C]=N[0]),j.removeListener!==void 0&&this.emit("removeListener",C,Q||T)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(C){var T,N,j;if(N=this._events,N===void 0)return this;if(N.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):N[C]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete N[C]),this;if(arguments.length===0){var z=Object.keys(N),Z;for(j=0;j=0;j--)this.removeListener(C,T[j]);return this};function f(k,C,T){var N=k._events;if(N===void 0)return[];var j=N[C];return j===void 0?[]:typeof j=="function"?T?[j.listener||j]:[j]:T?w(j):p(j,j.length)}i.prototype.listeners=function(C){return f(this,C,!0)},i.prototype.rawListeners=function(C){return f(this,C,!1)},i.listenerCount=function(k,C){return typeof k.listenerCount=="function"?k.listenerCount(C):s.call(k,C)},i.prototype.listenerCount=s;function s(k){var C=this._events;if(C!==void 0){var T=C[k];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function p(k,C){for(var T=new Array(C),N=0;N0?this.tail.next=c:this.head=c,this.tail=c,++this.length}},{key:"unshift",value:function(w){var c={data:w,next:this.head};this.length===0&&(this.tail=c),this.head=c,++this.length}},{key:"shift",value:function(){if(this.length!==0){var w=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,w}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(w){if(this.length===0)return"";for(var c=this.head,R=""+c.data;c=c.next;)R+=w+c.data;return R}},{key:"concat",value:function(w){if(this.length===0)return g.alloc(0);for(var c=g.allocUnsafe(w>>>0),R=this.head,S=0;R;)s(R.data,c,S),S+=R.data.length,R=R.next;return c}},{key:"consume",value:function(w,c){var R;return wk.length?k.length:w;if(C===k.length?S+=k:S+=k.slice(0,w),w-=C,w===0){C===k.length?(++R,c.next?this.head=c.next:this.head=this.tail=null):(this.head=c,c.data=k.slice(C));break}++R}return this.length-=R,S}},{key:"_getBuffer",value:function(w){var c=g.allocUnsafe(w),R=this.head,S=1;for(R.data.copy(c),w-=R.data.length;R=R.next;){var k=R.data,C=w>k.length?k.length:w;if(k.copy(c,c.length-w,0,C),w-=C,w===0){C===k.length?(++S,R.next?this.head=R.next:this.head=this.tail=null):(this.head=R,R.data=k.slice(C));break}++S}return this.length-=S,c}},{key:f,value:function(w,c){return u(this,r(r({},c),{},{depth:0,customInspect:!1}))}}]),p}(),Gn}var Zn,Sa;function al(){if(Sa)return Zn;Sa=1;function e(o,a){var d=this,g=this._readableState&&this._readableState.destroyed,m=this._writableState&&this._writableState.destroyed;return g||m?(a?a(o):o&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(l,this,o)):process.nextTick(l,this,o)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(o||null,function(u){!a&&u?d._writableState?d._writableState.errorEmitted?process.nextTick(n,d):(d._writableState.errorEmitted=!0,process.nextTick(r,d,u)):process.nextTick(r,d,u):a?(process.nextTick(n,d),a(u)):process.nextTick(n,d)}),this)}function r(o,a){l(o,a),n(o)}function n(o){o._writableState&&!o._writableState.emitClose||o._readableState&&!o._readableState.emitClose||o.emit("close")}function t(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function l(o,a){o.emit("error",a)}function i(o,a){var d=o._readableState,g=o._writableState;d&&d.autoDestroy||g&&g.autoDestroy?o.destroy(a):o.emit("error",a)}return Zn={destroy:e,undestroy:t,errorOrDestroy:i},Zn}var Kn={},Ma;function ir(){if(Ma)return Kn;Ma=1;function e(a,d){a.prototype=Object.create(d.prototype),a.prototype.constructor=a,a.__proto__=d}var r={};function n(a,d,g){g||(g=Error);function m(f,s,p){return typeof d=="string"?d:d(f,s,p)}var u=function(f){e(s,f);function s(p,y,w){return f.call(this,m(p,y,w))||this}return s}(g);u.prototype.name=g.name,u.prototype.code=a,r[a]=u}function t(a,d){if(Array.isArray(a)){var g=a.length;return a=a.map(function(m){return String(m)}),g>2?"one of ".concat(d," ").concat(a.slice(0,g-1).join(", "),", or ")+a[g-1]:g===2?"one of ".concat(d," ").concat(a[0]," or ").concat(a[1]):"of ".concat(d," ").concat(a[0])}else return"of ".concat(d," ").concat(String(a))}function l(a,d,g){return a.substr(0,d.length)===d}function i(a,d,g){return(g===void 0||g>a.length)&&(g=a.length),a.substring(g-d.length,g)===d}function o(a,d,g){return typeof g!="number"&&(g=0),g+d.length>a.length?!1:a.indexOf(d,g)!==-1}return n("ERR_INVALID_OPT_VALUE",function(a,d){return'The value "'+d+'" is invalid for option "'+a+'"'},TypeError),n("ERR_INVALID_ARG_TYPE",function(a,d,g){var m;typeof d=="string"&&l(d,"not ")?(m="must not be",d=d.replace(/^not /,"")):m="must be";var u;if(i(a," argument"))u="The ".concat(a," ").concat(m," ").concat(t(d,"type"));else{var f=o(a,".")?"property":"argument";u='The "'.concat(a,'" ').concat(f," ").concat(m," ").concat(t(d,"type"))}return u+=". Received type ".concat(typeof g),u},TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",function(a){return"The "+a+" method is not implemented"}),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",function(a){return"Cannot call "+a+" after a stream was destroyed"}),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",function(a){return"Unknown encoding: "+a},TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Kn.codes=r,Kn}var Qn,ka;function cl(){if(ka)return Qn;ka=1;var e=ir().codes.ERR_INVALID_OPT_VALUE;function r(t,l,i){return t.highWaterMark!=null?t.highWaterMark:l?t[i]:null}function n(t,l,i,o){var a=r(l,o,i);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var d=o?i:"highWaterMark";throw new e(d,a)}return Math.floor(a)}return t.objectMode?16:16*1024}return Qn={getHighWaterMark:n},Qn}var Yn,Ca;function sf(){if(Ca)return Yn;Ca=1,Yn=e;function e(n,t){if(r("noDeprecation"))return n;var l=!1;function i(){if(!l){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),l=!0}return n.apply(this,arguments)}return i}function r(n){try{if(!Xt.localStorage)return!1}catch{return!1}var t=Xt.localStorage[n];return t==null?!1:String(t).toLowerCase()==="true"}return Yn}var Xn,Ia;function ul(){if(Ia)return Xn;Ia=1,Xn=j;function e(U){var W=this;this.next=null,this.entry=null,this.finish=function(){Y(W,U)}}var r;j.WritableState=T;var n={deprecate:sf()},t=ol(),l=bn().Buffer,i=(typeof Xt<"u"?Xt:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(U){return l.from(U)}function a(U){return l.isBuffer(U)||U instanceof i}var d=al(),g=cl(),m=g.getHighWaterMark,u=ir().codes,f=u.ERR_INVALID_ARG_TYPE,s=u.ERR_METHOD_NOT_IMPLEMENTED,p=u.ERR_MULTIPLE_CALLBACK,y=u.ERR_STREAM_CANNOT_PIPE,w=u.ERR_STREAM_DESTROYED,c=u.ERR_STREAM_NULL_VALUES,R=u.ERR_STREAM_WRITE_AFTER_END,S=u.ERR_UNKNOWN_ENCODING,k=d.errorOrDestroy;Ye()(j,t);function C(){}function T(U,W,G){r=r||er(),U=U||{},typeof G!="boolean"&&(G=W instanceof r),this.objectMode=!!U.objectMode,G&&(this.objectMode=this.objectMode||!!U.writableObjectMode),this.highWaterMark=m(this,U,"writableHighWaterMark",G),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var ee=U.decodeStrings===!1;this.decodeStrings=!ee,this.defaultEncoding=U.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(oe){M(W,oe)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=U.emitClose!==!1,this.autoDestroy=!!U.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}T.prototype.getBuffer=function(){for(var W=this.bufferedRequest,G=[];W;)G.push(W),W=W.next;return G},function(){try{Object.defineProperty(T.prototype,"buffer",{get:n.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var N;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(N=Function.prototype[Symbol.hasInstance],Object.defineProperty(j,Symbol.hasInstance,{value:function(W){return N.call(this,W)?!0:this!==j?!1:W&&W._writableState instanceof T}})):N=function(W){return W instanceof this};function j(U){r=r||er();var W=this instanceof r;if(!W&&!N.call(j,this))return new j(U);this._writableState=new T(U,this,W),this.writable=!0,U&&(typeof U.write=="function"&&(this._write=U.write),typeof U.writev=="function"&&(this._writev=U.writev),typeof U.destroy=="function"&&(this._destroy=U.destroy),typeof U.final=="function"&&(this._final=U.final)),t.call(this)}j.prototype.pipe=function(){k(this,new y)};function z(U,W){var G=new R;k(U,G),process.nextTick(W,G)}function Z(U,W,G,ee){var oe;return G===null?oe=new c:typeof G!="string"&&!W.objectMode&&(oe=new f("chunk",["string","Buffer"],G)),oe?(k(U,oe),process.nextTick(ee,oe),!1):!0}j.prototype.write=function(U,W,G){var ee=this._writableState,oe=!1,F=!ee.objectMode&&a(U);return F&&!l.isBuffer(U)&&(U=o(U)),typeof W=="function"&&(G=W,W=null),F?W="buffer":W||(W=ee.defaultEncoding),typeof G!="function"&&(G=C),ee.ending?z(this,G):(F||Z(this,ee,U,G))&&(ee.pendingcb++,oe=re(this,ee,F,U,W,G)),oe},j.prototype.cork=function(){this._writableState.corked++},j.prototype.uncork=function(){var U=this._writableState;U.corked&&(U.corked--,!U.writing&&!U.corked&&!U.bufferProcessing&&U.bufferedRequest&&O(this,U))},j.prototype.setDefaultEncoding=function(W){if(typeof W=="string"&&(W=W.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((W+"").toLowerCase())>-1))throw new S(W);return this._writableState.defaultEncoding=W,this},Object.defineProperty(j.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Q(U,W,G){return!U.objectMode&&U.decodeStrings!==!1&&typeof W=="string"&&(W=l.from(W,G)),W}Object.defineProperty(j.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function re(U,W,G,ee,oe,F){if(!G){var D=Q(W,ee,oe);ee!==D&&(G=!0,oe="buffer",ee=D)}var K=W.objectMode?1:ee.length;W.length+=K;var X=W.length>5===6?2:c>>4===14?3:c>>3===30?4:c>>6===2?-1:-2}function o(c,R,S){var k=R.length-1;if(k=0?(C>0&&(c.lastNeed=C-1),C):--k=0?(C>0&&(c.lastNeed=C-2),C):--k=0?(C>0&&(C===2?C=0:c.lastNeed=C-3),C):0))}function a(c,R,S){if((R[0]&192)!==128)return c.lastNeed=0,"�";if(c.lastNeed>1&&R.length>1){if((R[1]&192)!==128)return c.lastNeed=1,"�";if(c.lastNeed>2&&R.length>2&&(R[2]&192)!==128)return c.lastNeed=2,"�"}}function d(c){var R=this.lastTotal-this.lastNeed,S=a(this,c);if(S!==void 0)return S;if(this.lastNeed<=c.length)return c.copy(this.lastChar,R,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);c.copy(this.lastChar,R,0,c.length),this.lastNeed-=c.length}function g(c,R){var S=o(this,c,R);if(!this.lastNeed)return c.toString("utf8",R);this.lastTotal=S;var k=c.length-(S-this.lastNeed);return c.copy(this.lastChar,0,k),c.toString("utf8",R,k)}function m(c){var R=c&&c.length?this.write(c):"";return this.lastNeed?R+"�":R}function u(c,R){if((c.length-R)%2===0){var S=c.toString("utf16le",R);if(S){var k=S.charCodeAt(S.length-1);if(k>=55296&&k<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=c[c.length-2],this.lastChar[1]=c[c.length-1],S.slice(0,-1)}return S}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=c[c.length-1],c.toString("utf16le",R,c.length-1)}function f(c){var R=c&&c.length?this.write(c):"";if(this.lastNeed){var S=this.lastTotal-this.lastNeed;return R+this.lastChar.toString("utf16le",0,S)}return R}function s(c,R){var S=(c.length-R)%3;return S===0?c.toString("base64",R):(this.lastNeed=3-S,this.lastTotal=3,S===1?this.lastChar[0]=c[c.length-1]:(this.lastChar[0]=c[c.length-2],this.lastChar[1]=c[c.length-1]),c.toString("base64",R,c.length-S))}function p(c){var R=c&&c.length?this.write(c):"";return this.lastNeed?R+this.lastChar.toString("base64",0,3-this.lastNeed):R}function y(c){return c.toString(this.encoding)}function w(c){return c&&c.length?this.write(c):""}return ti}var ri,Ta;function Js(){if(Ta)return ri;Ta=1;var e=ir().codes.ERR_STREAM_PREMATURE_CLOSE;function r(i){var o=!1;return function(){if(!o){o=!0;for(var a=arguments.length,d=new Array(a),g=0;g0)if(typeof D!="string"&&!le.objectMode&&Object.getPrototypeOf(D)!==t.prototype&&(D=i(D)),X)le.endEmitted?C(F,new c):Q(F,le,D,!0);else if(le.ended)C(F,new y);else{if(le.destroyed)return!1;le.reading=!1,le.decoder&&!K?(D=le.decoder.write(D),le.objectMode||D.length!==0?Q(F,le,D,!1):O(F,le)):Q(F,le,D,!1)}else X||(le.reading=!1,O(F,le))}return!le.ended&&(le.length=q?F=q:(F--,F|=F>>>1,F|=F>>>2,F|=F>>>4,F|=F>>>8,F|=F>>>16,F++),F}function E(F,D){return F<=0||D.length===0&&D.ended?0:D.objectMode?1:F!==F?D.flowing&&D.length?D.buffer.head.data.length:D.length:(F>D.highWaterMark&&(D.highWaterMark=h(F)),F<=D.length?F:D.ended?D.length:(D.needReadable=!0,0))}z.prototype.read=function(F){d("read",F),F=parseInt(F,10);var D=this._readableState,K=F;if(F!==0&&(D.emittedReadable=!1),F===0&&D.needReadable&&((D.highWaterMark!==0?D.length>=D.highWaterMark:D.length>0)||D.ended))return d("read: emitReadable",D.length,D.ended),D.length===0&&D.ended?G(this):I(this),null;if(F=E(F,D),F===0&&D.ended)return D.length===0&&G(this),null;var X=D.needReadable;d("need readable",X),(D.length===0||D.length-F0?ae=W(F,D):ae=null,ae===null?(D.needReadable=D.length<=D.highWaterMark,F=0):(D.length-=F,D.awaitDrain=0),D.length===0&&(D.ended||(D.needReadable=!0),K!==F&&D.ended&&G(this)),ae!==null&&this.emit("data",ae),ae};function M(F,D){if(d("onEofChunk"),!D.ended){if(D.decoder){var K=D.decoder.end();K&&K.length&&(D.buffer.push(K),D.length+=D.objectMode?1:K.length)}D.ended=!0,D.sync?I(F):(D.needReadable=!1,D.emittedReadable||(D.emittedReadable=!0,A(F)))}}function I(F){var D=F._readableState;d("emitReadable",D.needReadable,D.emittedReadable),D.needReadable=!1,D.emittedReadable||(d("emitReadable",D.flowing),D.emittedReadable=!0,process.nextTick(A,F))}function A(F){var D=F._readableState;d("emitReadable_",D.destroyed,D.length,D.ended),!D.destroyed&&(D.length||D.ended)&&(F.emit("readable"),D.emittedReadable=!1),D.needReadable=!D.flowing&&!D.ended&&D.length<=D.highWaterMark,U(F)}function O(F,D){D.readingMore||(D.readingMore=!0,process.nextTick($,F,D))}function $(F,D){for(;!D.reading&&!D.ended&&(D.length1&&oe(X.pipes,F)!==-1)&&!me&&(d("false write response, pause",X.awaitDrain),X.awaitDrain++),K.pause())}function pe(x){d("onerror",x),ye(),F.removeListener("error",pe),r(F,"error")===0&&C(F,x)}N(F,"error",pe);function ve(){F.removeListener("finish",je),ye()}F.once("close",ve);function je(){d("onfinish"),F.removeListener("close",ve),ye()}F.once("finish",je);function ye(){d("unpipe"),K.unpipe(F)}return F.emit("pipe",K),X.flowing||(d("pipe resume"),K.resume()),F};function L(F){return function(){var K=F._readableState;d("pipeOnDrain",K.awaitDrain),K.awaitDrain&&K.awaitDrain--,K.awaitDrain===0&&r(F,"data")&&(K.flowing=!0,U(F))}}z.prototype.unpipe=function(F){var D=this._readableState,K={hasUnpiped:!1};if(D.pipesCount===0)return this;if(D.pipesCount===1)return F&&F!==D.pipes?this:(F||(F=D.pipes),D.pipes=null,D.pipesCount=0,D.flowing=!1,F&&F.emit("unpipe",this,K),this);if(!F){var X=D.pipes,ae=D.pipesCount;D.pipes=null,D.pipesCount=0,D.flowing=!1;for(var le=0;le0,X.flowing!==!1&&this.resume()):F==="readable"&&!X.endEmitted&&!X.readableListening&&(X.readableListening=X.needReadable=!0,X.flowing=!1,X.emittedReadable=!1,d("on readable",X.length,X.reading),X.length?I(this):X.reading||process.nextTick(P,this)),K},z.prototype.addListener=z.prototype.on,z.prototype.removeListener=function(F,D){var K=n.prototype.removeListener.call(this,F,D);return F==="readable"&&process.nextTick(b,this),K},z.prototype.removeAllListeners=function(F){var D=n.prototype.removeAllListeners.apply(this,arguments);return(F==="readable"||F===void 0)&&process.nextTick(b,this),D};function b(F){var D=F._readableState;D.readableListening=F.listenerCount("readable")>0,D.resumeScheduled&&!D.paused?D.flowing=!0:F.listenerCount("data")>0&&F.resume()}function P(F){d("readable nexttick read 0"),F.read(0)}z.prototype.resume=function(){var F=this._readableState;return F.flowing||(d("resume"),F.flowing=!F.readableListening,te(this,F)),F.paused=!1,this};function te(F,D){D.resumeScheduled||(D.resumeScheduled=!0,process.nextTick(Y,F,D))}function Y(F,D){d("resume",D.reading),D.reading||F.read(0),D.resumeScheduled=!1,F.emit("resume"),U(F),D.flowing&&!D.reading&&F.read(0)}z.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function U(F){var D=F._readableState;for(d("flow",D.flowing);D.flowing&&F.read()!==null;);}z.prototype.wrap=function(F){var D=this,K=this._readableState,X=!1;F.on("end",function(){if(d("wrapped end"),K.decoder&&!K.ended){var ie=K.decoder.end();ie&&ie.length&&D.push(ie)}D.push(null)}),F.on("data",function(ie){if(d("wrapped data"),K.decoder&&(ie=K.decoder.write(ie)),!(K.objectMode&&ie==null)&&!(!K.objectMode&&(!ie||!ie.length))){var de=D.push(ie);de||(X=!0,F.pause())}});for(var ae in F)this[ae]===void 0&&typeof F[ae]=="function"&&(this[ae]=function(de){return function(){return F[de].apply(F,arguments)}}(ae));for(var le=0;le=D.length?(D.decoder?K=D.buffer.join(""):D.buffer.length===1?K=D.buffer.first():K=D.buffer.concat(D.length),D.buffer.clear()):K=D.buffer.consume(F,D.decoder),K}function G(F){var D=F._readableState;d("endReadable",D.endEmitted),D.endEmitted||(D.ended=!0,process.nextTick(ee,D,F))}function ee(F,D){if(d("endReadableNT",F.endEmitted,F.length),!F.endEmitted&&F.length===0&&(F.endEmitted=!0,D.readable=!1,D.emit("end"),F.autoDestroy)){var K=D._writableState;(!K||K.autoDestroy&&K.finished)&&D.destroy()}}typeof Symbol=="function"&&(z.from=function(F,D){return k===void 0&&(k=af()),k(z,F,D)});function oe(F,D){for(var K=0,X=F.length;K0;return a(R,k,C,function(T){w||(w=T),T&&c.forEach(d),!k&&(c.forEach(d),y(w))})});return s.reduce(g)}return ci=u,ci}var qa;function fl(){return qa||(qa=1,function(e,r){r=e.exports=ll(),r.Stream=r,r.Readable=r,r.Writable=ul(),r.Duplex=er(),r.Transform=hl(),r.PassThrough=cf(),r.finished=Js(),r.pipeline=uf()}(on,on.exports)),on.exports}var ui,ja;function lf(){if(ja)return ui;ja=1;const{Transform:e}=fl();return ui=r=>class dl extends e{constructor(t,l,i,o,a){super(a),this._rate=t,this._capacity=l,this._delimitedSuffix=i,this._hashBitLength=o,this._options=a,this._state=new r,this._state.initialize(t,l),this._finalized=!1}_transform(t,l,i){let o=null;try{this.update(t,l)}catch(a){o=a}i(o)}_flush(t){let l=null;try{this.push(this.digest())}catch(i){l=i}t(l)}update(t,l){if(!Buffer.isBuffer(t)&&typeof t!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(t)||(t=Buffer.from(t,l)),this._state.absorb(t),this}digest(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let l=this._state.squeeze(this._hashBitLength/8);return t!==void 0&&(l=l.toString(t)),this._resetState(),l}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const t=new dl(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}},ui}var li,$a;function hf(){if($a)return li;$a=1;const{Transform:e}=fl();return li=r=>class pl extends e{constructor(t,l,i,o){super(o),this._rate=t,this._capacity=l,this._delimitedSuffix=i,this._options=o,this._state=new r,this._state.initialize(t,l),this._finalized=!1}_transform(t,l,i){let o=null;try{this.update(t,l)}catch(a){o=a}i(o)}_flush(){}_read(t){this.push(this.squeeze(t))}update(t,l){if(!Buffer.isBuffer(t)&&typeof t!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(t)||(t=Buffer.from(t,l)),this._state.absorb(t),this}squeeze(t,l){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(t);return l!==void 0&&(i=i.toString(l)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const t=new pl(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}},li}var hi,Ua;function ff(){if(Ua)return hi;Ua=1;const e=lf(),r=hf();return hi=function(n){const t=e(n),l=r(n);return function(i,o){switch(typeof i=="string"?i.toLowerCase():i){case"keccak224":return new t(1152,448,null,224,o);case"keccak256":return new t(1088,512,null,256,o);case"keccak384":return new t(832,768,null,384,o);case"keccak512":return new t(576,1024,null,512,o);case"sha3-224":return new t(1152,448,6,224,o);case"sha3-256":return new t(1088,512,6,256,o);case"sha3-384":return new t(832,768,6,384,o);case"sha3-512":return new t(576,1024,6,512,o);case"shake128":return new l(1344,256,31,o);case"shake256":return new l(1088,512,31,o);default:throw new Error("Invald algorithm: "+i)}}},hi}var fi={},Ha;function df(){if(Ha)return fi;Ha=1;const e=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];return fi.p1600=function(r){for(let n=0;n<24;++n){const t=r[0]^r[10]^r[20]^r[30]^r[40],l=r[1]^r[11]^r[21]^r[31]^r[41],i=r[2]^r[12]^r[22]^r[32]^r[42],o=r[3]^r[13]^r[23]^r[33]^r[43],a=r[4]^r[14]^r[24]^r[34]^r[44],d=r[5]^r[15]^r[25]^r[35]^r[45],g=r[6]^r[16]^r[26]^r[36]^r[46],m=r[7]^r[17]^r[27]^r[37]^r[47],u=r[8]^r[18]^r[28]^r[38]^r[48],f=r[9]^r[19]^r[29]^r[39]^r[49];let s=u^(i<<1|o>>>31),p=f^(o<<1|i>>>31);const y=r[0]^s,w=r[1]^p,c=r[10]^s,R=r[11]^p,S=r[20]^s,k=r[21]^p,C=r[30]^s,T=r[31]^p,N=r[40]^s,j=r[41]^p;s=t^(a<<1|d>>>31),p=l^(d<<1|a>>>31);const z=r[2]^s,Z=r[3]^p,Q=r[12]^s,re=r[13]^p,q=r[22]^s,h=r[23]^p,E=r[32]^s,M=r[33]^p,I=r[42]^s,A=r[43]^p;s=i^(g<<1|m>>>31),p=o^(m<<1|g>>>31);const O=r[4]^s,$=r[5]^p,L=r[14]^s,b=r[15]^p,P=r[24]^s,te=r[25]^p,Y=r[34]^s,U=r[35]^p,W=r[44]^s,G=r[45]^p;s=a^(u<<1|f>>>31),p=d^(f<<1|u>>>31);const ee=r[6]^s,oe=r[7]^p,F=r[16]^s,D=r[17]^p,K=r[26]^s,X=r[27]^p,ae=r[36]^s,le=r[37]^p,ie=r[46]^s,de=r[47]^p;s=g^(t<<1|l>>>31),p=m^(l<<1|t>>>31);const He=r[8]^s,me=r[9]^p,he=r[18]^s,be=r[19]^p,pe=r[28]^s,ve=r[29]^p,je=r[38]^s,ye=r[39]^p,x=r[48]^s,v=r[49]^p,_=y,B=w,H=R<<4|c>>>28,V=c<<4|R>>>28,J=S<<3|k>>>29,fe=k<<3|S>>>29,ue=T<<9|C>>>23,ce=C<<9|T>>>23,we=N<<18|j>>>14,se=j<<18|N>>>14,_e=z<<1|Z>>>31,Vt=Z<<1|z>>>31,Ee=re<<12|Q>>>20,Re=Q<<12|re>>>20,zt=q<<10|h>>>22,Se=h<<10|q>>>22,Me=M<<13|E>>>19,Jt=E<<13|M>>>19,ke=I<<2|A>>>30,Ce=A<<2|I>>>30,Gt=$<<30|O>>>2,Ie=O<<30|$>>>2,xe=L<<6|b>>>26,Zt=b<<6|L>>>26,Ae=te<<11|P>>>21,Le=P<<11|te>>>21,Kt=Y<<15|U>>>17,Te=U<<15|Y>>>17,Be=G<<29|W>>>3,Qt=W<<29|G>>>3,Ne=ee<<28|oe>>>4,Oe=oe<<28|ee>>>4,Yt=D<<23|F>>>9,Pe=F<<23|D>>>9,Fe=K<<25|X>>>7,at=X<<25|K>>>7,ct=ae<<21|le>>>11,ut=le<<21|ae>>>11,lt=de<<24|ie>>>8,ht=ie<<24|de>>>8,ft=He<<27|me>>>5,dt=me<<27|He>>>5,pt=he<<20|be>>>12,gt=be<<20|he>>>12,mt=ve<<7|pe>>>25,vt=pe<<7|ve>>>25,yt=je<<8|ye>>>24,wt=ye<<8|je>>>24,bt=x<<14|v>>>18,_t=v<<14|x>>>18;r[0]=_^~Ee&Ae,r[1]=B^~Re&Le,r[10]=Ne^~pt&J,r[11]=Oe^~gt&fe,r[20]=_e^~xe&Fe,r[21]=Vt^~Zt&at,r[30]=ft^~H&zt,r[31]=dt^~V&Se,r[40]=Gt^~Yt&mt,r[41]=Ie^~Pe&vt,r[2]=Ee^~Ae&ct,r[3]=Re^~Le&ut,r[12]=pt^~J&Me,r[13]=gt^~fe&Jt,r[22]=xe^~Fe&yt,r[23]=Zt^~at&wt,r[32]=H^~zt&Kt,r[33]=V^~Se&Te,r[42]=Yt^~mt&ue,r[43]=Pe^~vt&ce,r[4]=Ae^~ct&bt,r[5]=Le^~ut&_t,r[14]=J^~Me&Be,r[15]=fe^~Jt&Qt,r[24]=Fe^~yt&we,r[25]=at^~wt&se,r[34]=zt^~Kt<,r[35]=Se^~Te&ht,r[44]=mt^~ue&ke,r[45]=vt^~ce&Ce,r[6]=ct^~bt&_,r[7]=ut^~_t&B,r[16]=Me^~Be&Ne,r[17]=Jt^~Qt&Oe,r[26]=yt^~we&_e,r[27]=wt^~se&Vt,r[36]=Kt^~lt&ft,r[37]=Te^~ht&dt,r[46]=ue^~ke&Gt,r[47]=ce^~Ce&Ie,r[8]=bt^~_&Ee,r[9]=_t^~B&Re,r[18]=Be^~Ne&pt,r[19]=Qt^~Oe>,r[28]=we^~_e&xe,r[29]=se^~Vt&Zt,r[38]=lt^~ft&H,r[39]=ht^~dt&V,r[48]=ke^~Gt&Yt,r[49]=Ce^~Ie&Pe,r[0]^=e[n*2],r[1]^=e[n*2+1]}},fi}var di,Wa;function pf(){if(Wa)return di;Wa=1;const e=df();function r(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}return r.prototype.initialize=function(n,t){for(let l=0;l<50;++l)this.state[l]=0;this.blockSize=n/8,this.count=0,this.squeezing=!1},r.prototype.absorb=function(n){for(let t=0;t>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(e.p1600(this.state),this.count=0);return t},r.prototype.copy=function(n){for(let t=0;t<50;++t)n.state[t]=this.state[t];n.blockSize=this.blockSize,n.count=this.count,n.squeezing=this.squeezing},di=r,di}var pi,Va;function gf(){return Va||(Va=1,pi=ff()(pf())),pi}var gi,za;function gl(){if(za)return gi;za=1;const e=gf(),r=mn();function n(u){return Buffer.allocUnsafe(u).fill(0)}function t(u,f,s){const p=n(f);return u=i(u),s?u.length"u")throw new Error("Not an array?");if(y=i(s),y!=="dynamic"&&y!==0&&p.length>y)throw new Error("Elements exceed array size: "+y);c=[],s=s.slice(0,s.lastIndexOf("[")),typeof p=="string"&&(p=JSON.parse(p));for(R in p)c.push(a(s,p[R]));if(y==="dynamic"){var S=a("uint256",p.length);c.unshift(S)}return Buffer.concat(c)}else{if(s==="bytes")return p=new Buffer(p),c=Buffer.concat([a("uint256",p.length),p]),p.length%32!==0&&(c=Buffer.concat([c,e.zeros(32-p.length%32)])),c;if(s.startsWith("bytes")){if(y=t(s),y<1||y>32)throw new Error("Invalid bytes width: "+y);return e.setLengthRight(p,32)}else if(s.startsWith("uint")){if(y=t(s),y%8||y<8||y>256)throw new Error("Invalid uint width: "+y);if(w=o(p),w.bitLength()>y)throw new Error("Supplied uint exceeds width: "+y+" vs "+w.bitLength());if(w<0)throw new Error("Supplied uint is negative");return w.toArrayLike(Buffer,"be",32)}else if(s.startsWith("int")){if(y=t(s),y%8||y<8||y>256)throw new Error("Invalid int width: "+y);if(w=o(p),w.bitLength()>y)throw new Error("Supplied int exceeds width: "+y+" vs "+w.bitLength());return w.toTwos(256).toArrayLike(Buffer,"be",32)}else if(s.startsWith("ufixed")){if(y=l(s),w=o(p),w<0)throw new Error("Supplied ufixed is negative");return a("uint256",w.mul(new r(2).pow(new r(y[1]))))}else if(s.startsWith("fixed"))return y=l(s),a("int256",o(p).mul(new r(2).pow(new r(y[1]))))}throw new Error("Unsupported or invalid type: "+s)}function d(s){return s==="string"||s==="bytes"||i(s)==="dynamic"}function g(s){return s.lastIndexOf("]")===s.length-1}function m(s,p){var y=[],w=[],c=32*s.length;for(var R in s){var S=n(s[R]),k=p[R],C=a(S,k);d(S)?(y.push(a("uint256",c)),w.push(C),c+=C.length):y.push(C)}return Buffer.concat(y.concat(w))}function u(s,p){if(s.length!==p.length)throw new Error("Number of types are not matching the values");for(var y,w,c=[],R=0;R32)throw new Error("Invalid bytes width: "+y);c.push(e.setLengthRight(k,y))}else if(S.startsWith("uint")){if(y=t(S),y%8||y<8||y>256)throw new Error("Invalid uint width: "+y);if(w=o(k),w.bitLength()>y)throw new Error("Supplied uint exceeds width: "+y+" vs "+w.bitLength());c.push(w.toArrayLike(Buffer,"be",y/8))}else if(S.startsWith("int")){if(y=t(S),y%8||y<8||y>256)throw new Error("Invalid int width: "+y);if(w=o(k),w.bitLength()>y)throw new Error("Supplied int exceeds width: "+y+" vs "+w.bitLength());c.push(w.toTwos(y).toArrayLike(Buffer,"be",y/8))}else throw new Error("Unsupported or invalid type: "+S)}return Buffer.concat(c)}function f(s,p){return e.keccak(u(s,p))}return mi={rawEncode:m,solidityPack:u,soliditySHA3:f},mi}var vi,Ga;function vf(){if(Ga)return vi;Ga=1;const e=gl(),r=mf(),n={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},t={encodeData(i,o,a,d=!0){const g=["bytes32"],m=[this.hashType(i,a)];if(d){const u=(f,s,p)=>{if(a[s]!==void 0)return["bytes32",p==null?"0x0000000000000000000000000000000000000000000000000000000000000000":e.keccak(this.encodeData(s,p,a,d))];if(p===void 0)throw new Error(`missing value for field ${f} of type ${s}`);if(s==="bytes")return["bytes32",e.keccak(p)];if(s==="string")return typeof p=="string"&&(p=Buffer.from(p,"utf8")),["bytes32",e.keccak(p)];if(s.lastIndexOf("]")===s.length-1){const y=s.slice(0,s.lastIndexOf("[")),w=p.map(c=>u(f,y,c));return["bytes32",e.keccak(r.rawEncode(w.map(([c])=>c),w.map(([,c])=>c)))]}return[s,p]};for(const f of a[i]){const[s,p]=u(f.name,f.type,o[f.name]);g.push(s),m.push(p)}}else for(const u of a[i]){let f=o[u.name];if(f!==void 0)if(u.type==="bytes")g.push("bytes32"),f=e.keccak(f),m.push(f);else if(u.type==="string")g.push("bytes32"),typeof f=="string"&&(f=Buffer.from(f,"utf8")),f=e.keccak(f),m.push(f);else if(a[u.type]!==void 0)g.push("bytes32"),f=e.keccak(this.encodeData(u.type,f,a,d)),m.push(f);else{if(u.type.lastIndexOf("]")===u.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");g.push(u.type),m.push(f)}}return r.rawEncode(g,m)},encodeType(i,o){let a="",d=this.findTypeDependencies(i,o).filter(g=>g!==i);d=[i].concat(d.sort());for(const g of d){if(!o[g])throw new Error("No type definition specified: "+g);a+=g+"("+o[g].map(({name:u,type:f})=>f+" "+u).join(",")+")"}return a},findTypeDependencies(i,o,a=[]){if(i=i.match(/^\w*/)[0],a.includes(i)||o[i]===void 0)return a;a.push(i);for(const d of o[i])for(const g of this.findTypeDependencies(d.type,o,a))!a.includes(g)&&a.push(g);return a},hashStruct(i,o,a,d=!0){return e.keccak(this.encodeData(i,o,a,d))},hashType(i,o){return e.keccak(this.encodeType(i,o))},sanitizeData(i){const o={};for(const a in n.properties)i[a]&&(o[a]=i[a]);return o.types&&(o.types=Object.assign({EIP712Domain:[]},o.types)),o},hash(i,o=!0){const a=this.sanitizeData(i),d=[Buffer.from("1901","hex")];return d.push(this.hashStruct("EIP712Domain",a.domain,a.types,o)),a.primaryType!=="EIP712Domain"&&d.push(this.hashStruct(a.primaryType,a.message,a.types,o)),e.keccak(Buffer.concat(d))}};vi={TYPED_MESSAGE_SCHEMA:n,TypedDataUtils:t,hashForSignTypedDataLegacy:function(i){return l(i.data)},hashForSignTypedData_v3:function(i){return t.hash(i.data,!1)},hashForSignTypedData_v4:function(i){return t.hash(i.data)}};function l(i){const o=new Error("Expect argument to be non-empty array");if(typeof i!="object"||!i.length)throw o;const a=i.map(function(m){return m.type==="bytes"?e.toBuffer(m.value):m.value}),d=i.map(function(m){return m.type}),g=i.map(function(m){if(!m.name)throw o;return m.type+" "+m.name});return r.soliditySHA3(["bytes32","bytes32"],[r.soliditySHA3(new Array(i.length).fill("string"),g),r.soliditySHA3(d,a)])}return vi}var Tt={},Za;function yf(){if(Za)return Tt;Za=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.filterFromParam=Tt.FilterPolyfill=void 0;const e=wn(),r=nt(),n=5*60*1e3,t={jsonrpc:"2.0",id:0};let l=class{constructor(f){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,e.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=f}async newFilter(f){const s=i(f),p=this.makeFilterId(),y=await this.setInitialCursorPosition(p,s.fromBlock);return console.info(`Installing new log filter(${p}):`,s,"initial cursor position:",y),this.logFilters.set(p,s),this.setFilterTimeout(p),(0,r.hexStringFromIntNumber)(p)}async newBlockFilter(){const f=this.makeFilterId(),s=await this.setInitialCursorPosition(f,"latest");return console.info(`Installing new block filter (${f}) with initial cursor position:`,s),this.blockFilters.add(f),this.setFilterTimeout(f),(0,r.hexStringFromIntNumber)(f)}async newPendingTransactionFilter(){const f=this.makeFilterId(),s=await this.setInitialCursorPosition(f,"latest");return console.info(`Installing new block filter (${f}) with initial cursor position:`,s),this.pendingTransactionFilters.add(f),this.setFilterTimeout(f),(0,r.hexStringFromIntNumber)(f)}uninstallFilter(f){const s=(0,r.intNumberFromHexString)(f);return console.info(`Uninstalling filter (${s})`),this.deleteFilter(s),!0}getFilterChanges(f){const s=(0,r.intNumberFromHexString)(f);return this.timeouts.has(s)&&this.setFilterTimeout(s),this.logFilters.has(s)?this.getLogFilterChanges(s):this.blockFilters.has(s)?this.getBlockFilterChanges(s):this.pendingTransactionFilters.has(s)?this.getPendingTransactionFilterChanges(s):Promise.resolve(g())}async getFilterLogs(f){const s=(0,r.intNumberFromHexString)(f),p=this.logFilters.get(s);return p?this.sendAsyncPromise(Object.assign(Object.assign({},t),{method:"eth_getLogs",params:[o(p)]})):g()}makeFilterId(){return(0,e.IntNumber)(++this.nextFilterId)}sendAsyncPromise(f){return new Promise((s,p)=>{this.provider.sendAsync(f,(y,w)=>{if(y)return p(y);if(Array.isArray(w)||w==null)return p(new Error(`unexpected response received: ${JSON.stringify(w)}`));s(w)})})}deleteFilter(f){console.info(`Deleting filter (${f})`),this.logFilters.delete(f),this.blockFilters.delete(f),this.pendingTransactionFilters.delete(f),this.cursors.delete(f),this.timeouts.delete(f)}async getLogFilterChanges(f){const s=this.logFilters.get(f),p=this.cursors.get(f);if(!p||!s)return g();const y=await this.getCurrentBlockHeight(),w=s.toBlock==="latest"?y:s.toBlock;if(p>y||p>Number(s.toBlock))return m();console.info(`Fetching logs from ${p} to ${w} for filter ${f}`);const c=await this.sendAsyncPromise(Object.assign(Object.assign({},t),{method:"eth_getLogs",params:[o(Object.assign(Object.assign({},s),{fromBlock:p,toBlock:w}))]}));if(Array.isArray(c.result)){const R=c.result.map(k=>(0,r.intNumberFromHexString)(k.blockNumber||"0x0")),S=Math.max(...R);if(S&&S>p){const k=(0,e.IntNumber)(S+1);console.info(`Moving cursor position for filter (${f}) from ${p} to ${k}`),this.cursors.set(f,k)}}return c}async getBlockFilterChanges(f){const s=this.cursors.get(f);if(!s)return g();const p=await this.getCurrentBlockHeight();if(s>p)return m();console.info(`Fetching blocks from ${s} to ${p} for filter (${f})`);const y=(await Promise.all((0,r.range)(s,p+1).map(c=>this.getBlockHashByNumber((0,e.IntNumber)(c))))).filter(c=>!!c),w=(0,e.IntNumber)(s+y.length);return console.info(`Moving cursor position for filter (${f}) from ${s} to ${w}`),this.cursors.set(f,w),Object.assign(Object.assign({},t),{result:y})}async getPendingTransactionFilterChanges(f){return Promise.resolve(m())}async setInitialCursorPosition(f,s){const p=await this.getCurrentBlockHeight(),y=typeof s=="number"&&s>p?s:p;return this.cursors.set(f,y),y}setFilterTimeout(f){const s=this.timeouts.get(f);s&&window.clearTimeout(s);const p=window.setTimeout(()=>{console.info(`Filter (${f}) timed out`),this.deleteFilter(f)},n);this.timeouts.set(f,p)}async getCurrentBlockHeight(){const f=new Date;if(f.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=f;const s=await this._getCurrentBlockHeight();this.currentBlockHeight=s,this.resolvers.forEach(p=>p(s)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(s=>this.resolvers.push(s))}async _getCurrentBlockHeight(){const{result:f}=await this.sendAsyncPromise(Object.assign(Object.assign({},t),{method:"eth_blockNumber",params:[]}));return(0,r.intNumberFromHexString)((0,r.ensureHexString)(f))}async getBlockHashByNumber(f){const s=await this.sendAsyncPromise(Object.assign(Object.assign({},t),{method:"eth_getBlockByNumber",params:[(0,r.hexStringFromIntNumber)(f),!1]}));return s.result&&typeof s.result.hash=="string"?(0,r.ensureHexString)(s.result.hash):null}};Tt.FilterPolyfill=l;function i(u){return{fromBlock:a(u.fromBlock),toBlock:a(u.toBlock),addresses:u.address===void 0?null:Array.isArray(u.address)?u.address:[u.address],topics:u.topics||[]}}Tt.filterFromParam=i;function o(u){const f={fromBlock:d(u.fromBlock),toBlock:d(u.toBlock),topics:u.topics};return u.addresses!==null&&(f.address=u.addresses),f}function a(u){if(u===void 0||u==="latest"||u==="pending")return"latest";if(u==="earliest")return(0,e.IntNumber)(0);if((0,r.isHexString)(u))return(0,r.intNumberFromHexString)(u);throw new Error(`Invalid block option: ${String(u)}`)}function d(u){return u==="latest"?u:(0,r.hexStringFromIntNumber)(u)}function g(){return Object.assign(Object.assign({},t),{error:{code:-32e3,message:"filter not found"}})}function m(){return Object.assign(Object.assign({},t),{result:[]})}return Tt}var Br={},Bt={},Nt={},yi,Ka;function Gs(){if(Ka)return yi;Ka=1,yi=e;function e(r){r=r||{};var n=r.max||Number.MAX_SAFE_INTEGER,t=typeof r.start<"u"?r.start:Math.floor(Math.random()*n);return function(){return t=t%n,t++}}return yi}var wi,Qa;function wf(){if(Qa)return wi;Qa=1;const e=(r,n)=>function(){const t=n.promiseModule,l=new Array(arguments.length);for(let i=0;i{n.errorFirst?l.push(function(a,d){if(n.multiArgs){const g=new Array(arguments.length-1);for(let m=1;m{n=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},n);const t=i=>{const o=a=>typeof a=="string"?i===a:a.test(i);return n.include?n.include.some(o):!n.exclude.some(o)};let l;typeof r=="function"?l=function(){return n.excludeMain?r.apply(this,arguments):e(r,n).apply(this,arguments)}:l=Object.create(Object.getPrototypeOf(r));for(const i in r){const o=r[i];l[i]=typeof o=="function"&&t(i)?e(o,n):o}return l},wi}var Ot={},cn={},Ya;function Zs(){if(Ya)return cn;Ya=1,Object.defineProperty(cn,"__esModule",{value:!0});const e=En();function r(l,i,o){try{Reflect.apply(l,i,o)}catch(a){setTimeout(()=>{throw a})}}function n(l){const i=l.length,o=new Array(i);for(let a=0;a0&&([m]=o),m instanceof Error)throw m;const u=new Error(`Unhandled error.${m?` (${m.message})`:""}`);throw u.context=m,u}const g=d[i];if(g===void 0)return!1;if(typeof g=="function")r(g,this,o);else{const m=g.length,u=n(g);for(let f=0;fa+d,l=["sync","latest"];let i=class extends r.default{constructor(d){super(),this._blockResetDuration=d.blockResetDuration||20*n,this._usePastBlocks=d.usePastBlocks||!1,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(g=>this.once("latest",g))}removeAllListeners(d){return d?super.removeAllListeners(d):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(d){l.includes(d)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return l.map(d=>this.listenerCount(d)).reduce(t)}_shouldUseNewBlock(d){const g=this._currentBlock;if(!g)return!0;const m=o(d),u=o(g);return this._usePastBlocks&&mu}_newPotentialLatest(d){this._shouldUseNewBlock(d)&&this._setCurrentBlock(d)}_setCurrentBlock(d){const g=this._currentBlock;this._currentBlock=d,this.emit("latest",d),this.emit("sync",{oldBlock:g,newBlock:d})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}};Ot.BaseBlockTracker=i;function o(a){return Number.parseInt(a,16)}return Ot}var bi={},Pt={},Ge={};class vl extends TypeError{constructor(r,n){let t;const{message:l,explanation:i,...o}=r,{path:a}=r,d=a.length===0?l:`At path: ${a.join(".")} -- ${l}`;super(i??d),i!=null&&(this.cause=d),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>t??(t=[r,...n()])}}function bf(e){return ze(e)&&typeof e[Symbol.iterator]=="function"}function ze(e){return typeof e=="object"&&e!=null}function ec(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const r=Object.getPrototypeOf(e);return r===null||r===Object.prototype}function qe(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function _f(e){const{done:r,value:n}=e.next();return r?void 0:n}function Ef(e,r,n,t){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:l,branch:i}=r,{type:o}=n,{refinement:a,message:d=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${qe(t)}\``}=e;return{value:t,type:o,refinement:a,key:l[l.length-1],path:l,branch:i,...e,message:d}}function*Ps(e,r,n,t){bf(e)||(e=[e]);for(const l of e){const i=Ef(l,r,n,t);i&&(yield i)}}function*Ks(e,r,n={}){const{path:t=[],branch:l=[e],coerce:i=!1,mask:o=!1}=n,a={path:t,branch:l};if(i&&(e=r.coercer(e,a),o&&r.type!=="type"&&ze(r.schema)&&ze(e)&&!Array.isArray(e)))for(const g in e)r.schema[g]===void 0&&delete e[g];let d="valid";for(const g of r.validator(e,a))g.explanation=n.message,d="not_valid",yield[g,void 0];for(let[g,m,u]of r.entries(e,a)){const f=Ks(m,u,{path:g===void 0?t:[...t,g],branch:g===void 0?l:[...l,m],coerce:i,mask:o,message:n.message});for(const s of f)s[0]?(d=s[0].refinement!=null?"not_refined":"not_valid",yield[s[0],void 0]):i&&(m=s[1],g===void 0?e=m:e instanceof Map?e.set(g,m):e instanceof Set?e.add(m):ze(e)&&(m!==void 0||g in e)&&(e[g]=m))}if(d!=="not_valid")for(const g of r.refiner(e,a))g.explanation=n.message,d="not_refined",yield[g,void 0];d==="valid"&&(yield[void 0,e])}class De{constructor(r){const{type:n,schema:t,validator:l,refiner:i,coercer:o=d=>d,entries:a=function*(){}}=r;this.type=n,this.schema=t,this.entries=a,this.coercer=o,l?this.validator=(d,g)=>{const m=l(d,g);return Ps(m,g,this,d)}:this.validator=()=>[],i?this.refiner=(d,g)=>{const m=i(d,g);return Ps(m,g,this,d)}:this.refiner=()=>[]}assert(r,n){return yl(r,this,n)}create(r,n){return wl(r,this,n)}is(r){return Qs(r,this)}mask(r,n){return bl(r,this,n)}validate(r,n={}){return sr(r,this,n)}}function yl(e,r,n){const t=sr(e,r,{message:n});if(t[0])throw t[0]}function wl(e,r,n){const t=sr(e,r,{coerce:!0,message:n});if(t[0])throw t[0];return t[1]}function bl(e,r,n){const t=sr(e,r,{coerce:!0,mask:!0,message:n});if(t[0])throw t[0];return t[1]}function Qs(e,r){return!sr(e,r)[0]}function sr(e,r,n={}){const t=Ks(e,r,n),l=_f(t);return l[0]?[new vl(l[0],function*(){for(const o of t)o[0]&&(yield o[0])}),void 0]:[void 0,l[1]]}function Rf(...e){const r=e[0].type==="type",n=e.map(l=>l.schema),t=Object.assign({},...n);return r?zr(t):Vr(t)}function Ve(e,r){return new De({type:e,schema:null,validator:r})}function Sf(e,r){return new De({...e,refiner:(n,t)=>n===void 0||e.refiner(n,t),validator(n,t){return n===void 0?!0:(r(n,t),e.validator(n,t))}})}function Mf(e){return new De({type:"dynamic",schema:null,*entries(r,n){yield*e(r,n).entries(r,n)},validator(r,n){return e(r,n).validator(r,n)},coercer(r,n){return e(r,n).coercer(r,n)},refiner(r,n){return e(r,n).refiner(r,n)}})}function kf(e){let r;return new De({type:"lazy",schema:null,*entries(n,t){r??(r=e()),yield*r.entries(n,t)},validator(n,t){return r??(r=e()),r.validator(n,t)},coercer(n,t){return r??(r=e()),r.coercer(n,t)},refiner(n,t){return r??(r=e()),r.refiner(n,t)}})}function Cf(e,r){const{schema:n}=e,t={...n};for(const l of r)delete t[l];switch(e.type){case"type":return zr(t);default:return Vr(t)}}function If(e){const r=e instanceof De,n=r?{...e.schema}:{...e};for(const t in n)n[t]=_l(n[t]);return r&&e.type==="type"?zr(n):Vr(n)}function xf(e,r){const{schema:n}=e,t={};for(const l of r)t[l]=n[l];switch(e.type){case"type":return zr(t);default:return Vr(t)}}function Af(e,r){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Ve(e,r)}function Lf(){return Ve("any",()=>!0)}function Tf(e){return new De({type:"array",schema:e,*entries(r){if(e&&Array.isArray(r))for(const[n,t]of r.entries())yield[n,t,e]},coercer(r){return Array.isArray(r)?r.slice():r},validator(r){return Array.isArray(r)||`Expected an array value, but received: ${qe(r)}`}})}function Bf(){return Ve("bigint",e=>typeof e=="bigint")}function Nf(){return Ve("boolean",e=>typeof e=="boolean")}function Of(){return Ve("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${qe(e)}`)}function Pf(e){const r={},n=e.map(t=>qe(t)).join();for(const t of e)r[t]=t;return new De({type:"enums",schema:r,validator(t){return e.includes(t)||`Expected one of \`${n}\`, but received: ${qe(t)}`}})}function Ff(){return Ve("func",e=>typeof e=="function"||`Expected a function, but received: ${qe(e)}`)}function Df(e){return Ve("instance",r=>r instanceof e||`Expected a \`${e.name}\` instance, but received: ${qe(r)}`)}function qf(){return Ve("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${qe(e)}`)}function jf(e){return new De({type:"intersection",schema:null,*entries(r,n){for(const t of e)yield*t.entries(r,n)},*validator(r,n){for(const t of e)yield*t.validator(r,n)},*refiner(r,n){for(const t of e)yield*t.refiner(r,n)}})}function $f(e){const r=qe(e),n=typeof e;return new De({type:"literal",schema:n==="string"||n==="number"||n==="boolean"?e:null,validator(t){return t===e||`Expected the literal \`${r}\`, but received: ${qe(t)}`}})}function Uf(e,r){return new De({type:"map",schema:null,*entries(n){if(e&&r&&n instanceof Map)for(const[t,l]of n.entries())yield[t,t,e],yield[t,l,r]},coercer(n){return n instanceof Map?new Map(n):n},validator(n){return n instanceof Map||`Expected a \`Map\` object, but received: ${qe(n)}`}})}function Ys(){return Ve("never",()=>!1)}function Hf(e){return new De({...e,validator:(r,n)=>r===null||e.validator(r,n),refiner:(r,n)=>r===null||e.refiner(r,n)})}function Wf(){return Ve("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${qe(e)}`)}function Vr(e){const r=e?Object.keys(e):[],n=Ys();return new De({type:"object",schema:e||null,*entries(t){if(e&&ze(t)){const l=new Set(Object.keys(t));for(const i of r)l.delete(i),yield[i,t[i],e[i]];for(const i of l)yield[i,t[i],n]}},validator(t){return ze(t)||`Expected an object, but received: ${qe(t)}`},coercer(t){return ze(t)?{...t}:t}})}function _l(e){return new De({...e,validator:(r,n)=>r===void 0||e.validator(r,n),refiner:(r,n)=>r===void 0||e.refiner(r,n)})}function Vf(e,r){return new De({type:"record",schema:null,*entries(n){if(ze(n))for(const t in n){const l=n[t];yield[t,t,e],yield[t,l,r]}},validator(n){return ze(n)||`Expected an object, but received: ${qe(n)}`}})}function zf(){return Ve("regexp",e=>e instanceof RegExp)}function Jf(e){return new De({type:"set",schema:null,*entries(r){if(e&&r instanceof Set)for(const n of r)yield[n,n,e]},coercer(r){return r instanceof Set?new Set(r):r},validator(r){return r instanceof Set||`Expected a \`Set\` object, but received: ${qe(r)}`}})}function El(){return Ve("string",e=>typeof e=="string"||`Expected a string, but received: ${qe(e)}`)}function Gf(e){const r=Ys();return new De({type:"tuple",schema:null,*entries(n){if(Array.isArray(n)){const t=Math.max(e.length,n.length);for(let l=0;ln.type).join(" | ");return new De({type:"union",schema:null,coercer(n){for(const t of e){const[l,i]=t.validate(n,{coerce:!0});if(!l)return i}return n},validator(n,t){const l=[];for(const i of e){const[...o]=Ks(n,i,t),[a]=o;if(a[0])for(const[d]of o)d&&l.push(d);else return[]}return[`Expected the value to satisfy a union of \`${r}\`, but received: ${qe(n)}`,...l]}})}function Rl(){return Ve("unknown",()=>!0)}function Xs(e,r,n){return new De({...e,coercer:(t,l)=>Qs(t,r)?e.coercer(n(t,l),l):e.coercer(t,l)})}function Kf(e,r,n={}){return Xs(e,Rl(),t=>{const l=typeof r=="function"?r():r;if(t===void 0)return l;if(!n.strict&&ec(t)&&ec(l)){const i={...t};let o=!1;for(const a in l)i[a]===void 0&&(i[a]=l[a],o=!0);if(o)return i}return t})}function Qf(e){return Xs(e,El(),r=>r.trim())}function Yf(e){return Ht(e,"empty",r=>{const n=Sl(r);return n===0||`Expected an empty ${e.type} but received one with a size of \`${n}\``})}function Sl(e){return e instanceof Map||e instanceof Set?e.size:e.length}function Xf(e,r,n={}){const{exclusive:t}=n;return Ht(e,"max",l=>t?lt?l>r:l>=r||`Expected a ${e.type} greater than ${t?"":"or equal to "}${r} but received \`${l}\``)}function td(e){return Ht(e,"nonempty",r=>Sl(r)>0||`Expected a nonempty ${e.type} but received an empty one`)}function rd(e,r){return Ht(e,"pattern",n=>r.test(n)||`Expected a ${e.type} matching \`/${r.source}/\` but received "${n}"`)}function nd(e,r,n=r){const t=`Expected a ${e.type}`,l=r===n?`of \`${r}\``:`between \`${r}\` and \`${n}\``;return Ht(e,"size",i=>{if(typeof i=="number"||i instanceof Date)return r<=i&&i<=n||`${t} ${l} but received \`${i}\``;if(i instanceof Map||i instanceof Set){const{size:o}=i;return r<=o&&o<=n||`${t} with a size ${l} but received one with a size of \`${o}\``}else{const{length:o}=i;return r<=o&&o<=n||`${t} with a length ${l} but received one with a length of \`${o}\``}})}function Ht(e,r,n){return new De({...e,*refiner(t,l){yield*e.refiner(t,l);const i=n(t,l),o=Ps(i,l,e,t);for(const a of o)yield{...a,refinement:r}}})}const id=Object.freeze(Object.defineProperty({__proto__:null,Struct:De,StructError:vl,any:Lf,array:Tf,assert:yl,assign:Rf,bigint:Bf,boolean:Nf,coerce:Xs,create:wl,date:Of,defaulted:Kf,define:Ve,deprecated:Sf,dynamic:Mf,empty:Yf,enums:Pf,func:Ff,instance:Df,integer:qf,intersection:jf,is:Qs,lazy:kf,literal:$f,map:Uf,mask:bl,max:Xf,min:ed,never:Ys,nonempty:td,nullable:Hf,number:Wf,object:Vr,omit:Cf,optional:_l,partial:If,pattern:rd,pick:xf,record:Vf,refine:Ht,regexp:zf,set:Jf,size:nd,string:El,struct:Af,trimmed:Qf,tuple:Gf,type:zr,union:Zf,unknown:Rl,validate:sr},Symbol.toStringTag,{value:"Module"})),Wt=rr(id);var tc;function ot(){if(tc)return Ge;tc=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.assertExhaustive=Ge.assertStruct=Ge.assert=Ge.AssertionError=void 0;const e=Wt;function r(g){return typeof g=="object"&&g!==null&&"message"in g}function n(g){var m,u;return typeof((u=(m=g==null?void 0:g.prototype)===null||m===void 0?void 0:m.constructor)===null||u===void 0?void 0:u.name)=="string"}function t(g){const m=r(g)?g.message:String(g);return m.endsWith(".")?m.slice(0,-1):m}function l(g,m){return n(g)?new g({message:m}):g({message:m})}class i extends Error{constructor(m){super(m.message),this.code="ERR_ASSERTION"}}Ge.AssertionError=i;function o(g,m="Assertion failed.",u=i){if(!g)throw m instanceof Error?m:l(u,m)}Ge.assert=o;function a(g,m,u="Assertion failed",f=i){try{(0,e.assert)(g,m)}catch(s){throw l(f,`${u}: ${t(s)}.`)}}Ge.assertStruct=a;function d(g){throw new Error("Invalid branch reached. Should be detected during compilation.")}return Ge.assertExhaustive=d,Ge}var Nr={},rc;function Ml(){if(rc)return Nr;rc=1,Object.defineProperty(Nr,"__esModule",{value:!0}),Nr.base64=void 0;const e=Wt,r=ot(),n=(t,l={})=>{var i,o;const a=(i=l.paddingRequired)!==null&&i!==void 0?i:!1,d=(o=l.characterSet)!==null&&o!==void 0?o:"base64";let g;d==="base64"?g=String.raw`[A-Za-z0-9+\/]`:((0,r.assert)(d==="base64url"),g=String.raw`[-_A-Za-z0-9]`);let m;return a?m=new RegExp(`^(?:${g}{4})*(?:${g}{3}=|${g}{2}==)?$`,"u"):m=new RegExp(`^(?:${g}{4})*(?:${g}{2,3}|${g}{3}=|${g}{2}==)?$`,"u"),(0,e.pattern)(t,m)};return Nr.base64=n,Nr}var ge={},_i={},nc;function Rn(){return nc||(nc=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const r=Wt,n=ot();e.HexStruct=(0,r.pattern)((0,r.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,r.pattern)((0,r.string)(),/^0x[0-9a-f]+$/iu);function t(g){return(0,r.is)(g,e.HexStruct)}e.isHexString=t;function l(g){return(0,r.is)(g,e.StrictHexStruct)}e.isStrictHexString=l;function i(g){(0,n.assert)(t(g),"Value must be a hexadecimal string.")}e.assertIsHexString=i;function o(g){(0,n.assert)(l(g),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=o;function a(g){return g.startsWith("0x")?g:g.startsWith("0X")?`0x${g.substring(2)}`:`0x${g}`}e.add0x=a;function d(g){return g.startsWith("0x")||g.startsWith("0X")?g.substring(2):g}e.remove0x=d}(_i)),_i}var ic;function kl(){if(ic)return ge;ic=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.createDataView=ge.concatBytes=ge.valueToBytes=ge.stringToBytes=ge.numberToBytes=ge.signedBigIntToBytes=ge.bigIntToBytes=ge.hexToBytes=ge.bytesToString=ge.bytesToNumber=ge.bytesToSignedBigInt=ge.bytesToBigInt=ge.bytesToHex=ge.assertIsBytes=ge.isBytes=void 0;const e=ot(),r=Rn(),n=48,t=58,l=87;function i(){const N=[];return()=>{if(N.length===0)for(let j=0;j<256;j++)N.push(j.toString(16).padStart(2,"0"));return N}}const o=i();function a(N){return N instanceof Uint8Array}ge.isBytes=a;function d(N){(0,e.assert)(a(N),"Value must be a Uint8Array.")}ge.assertIsBytes=d;function g(N){if(d(N),N.length===0)return"0x";const j=o(),z=new Array(N.length);for(let Z=0;Z=BigInt(0),"Value must be a non-negative bigint.");const j=N.toString(16);return p(j)}ge.bigIntToBytes=y;function w(N,j){(0,e.assert)(j>0);const z=N>>BigInt(31);return!((~N&z)+(N&~z)>>BigInt(j*8+-1))}function c(N,j){(0,e.assert)(typeof N=="bigint","Value must be a bigint."),(0,e.assert)(typeof j=="number","Byte length must be a number."),(0,e.assert)(j>0,"Byte length must be greater than 0."),(0,e.assert)(w(N,j),"Byte length is too small to represent the given value.");let z=N;const Z=new Uint8Array(j);for(let Q=0;Q>=BigInt(8);return Z.reverse()}ge.signedBigIntToBytes=c;function R(N){(0,e.assert)(typeof N=="number","Value must be a number."),(0,e.assert)(N>=0,"Value must be a non-negative number."),(0,e.assert)(Number.isSafeInteger(N),"Value is not a safe integer. Use `bigIntToBytes` instead.");const j=N.toString(16);return p(j)}ge.numberToBytes=R;function S(N){return(0,e.assert)(typeof N=="string","Value must be a string."),new TextEncoder().encode(N)}ge.stringToBytes=S;function k(N){if(typeof N=="bigint")return y(N);if(typeof N=="number")return R(N);if(typeof N=="string")return N.startsWith("0x")?p(N):S(N);if(a(N))return N;throw new TypeError(`Unsupported value type: "${typeof N}".`)}ge.valueToBytes=k;function C(N){const j=new Array(N.length);let z=0;for(let Q=0;Qa.call(d,g,m,this))}get(a){return r(this,n,"f").get(a)}has(a){return r(this,n,"f").has(a)}keys(){return r(this,n,"f").keys()}values(){return r(this,n,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([a,d])=>`${String(a)} => ${String(d)}`).join(", ")} `:""}}`}}Ke.FrozenMap=l;class i{constructor(a){t.set(this,void 0),e(this,t,new Set(a),"f"),Object.freeze(this)}get size(){return r(this,t,"f").size}[(t=new WeakMap,Symbol.iterator)](){return r(this,t,"f")[Symbol.iterator]()}entries(){return r(this,t,"f").entries()}forEach(a,d){return r(this,t,"f").forEach((g,m,u)=>a.call(d,g,m,this))}has(a){return r(this,t,"f").has(a)}keys(){return r(this,t,"f").keys()}values(){return r(this,t,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(a=>String(a)).join(", ")} `:""}}`}}return Ke.FrozenSet=i,Object.freeze(l),Object.freeze(l.prototype),Object.freeze(i),Object.freeze(i.prototype),Ke}var Ei={},cc;function cd(){return cc||(cc=1,Object.defineProperty(Ei,"__esModule",{value:!0})),Ei}var Ri={},uc;function ud(){return uc||(uc=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=void 0;const r=Wt,n=ot(),t=()=>(0,r.define)("finite number",C=>(0,r.is)(C,(0,r.number)())&&Number.isFinite(C));e.UnsafeJsonStruct=(0,r.union)([(0,r.literal)(null),(0,r.boolean)(),t(),(0,r.string)(),(0,r.array)((0,r.lazy)(()=>e.UnsafeJsonStruct)),(0,r.record)((0,r.string)(),(0,r.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,r.define)("Json",(C,T)=>{function N(j,z){const Q=[...z.validator(j,T)];return Q.length>0?Q:!0}try{const j=N(C,e.UnsafeJsonStruct);return j!==!0?j:N(JSON.parse(JSON.stringify(C)),e.UnsafeJsonStruct)}catch(j){return j instanceof RangeError?"Circular reference detected":!1}});function l(C){return(0,r.is)(C,e.JsonStruct)}e.isValidJson=l;function i(C){(0,n.assertStruct)(C,e.JsonStruct,"Invalid JSON value");const T=JSON.stringify(C);return new TextEncoder().encode(T).byteLength}e.getJsonSize=i,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,r.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,r.nullable)((0,r.union)([(0,r.number)(),(0,r.string)()])),e.JsonRpcErrorStruct=(0,r.object)({code:(0,r.integer)(),message:(0,r.string)(),data:(0,r.optional)(e.JsonStruct),stack:(0,r.optional)((0,r.string)())}),e.JsonRpcParamsStruct=(0,r.optional)((0,r.union)([(0,r.record)((0,r.string)(),e.JsonStruct),(0,r.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,r.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,r.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,r.omit)(e.JsonRpcRequestStruct,["id"]);function o(C){return(0,r.is)(C,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=o;function a(C,T){(0,n.assertStruct)(C,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",T)}e.assertIsJsonRpcNotification=a;function d(C){return(0,r.is)(C,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=d;function g(C,T){(0,n.assertStruct)(C,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",T)}e.assertIsJsonRpcRequest=g,e.PendingJsonRpcResponseStruct=(0,r.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,r.optional)((0,r.unknown)()),error:(0,r.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,r.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,r.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,r.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function m(C){return(0,r.is)(C,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=m;function u(C,T){(0,n.assertStruct)(C,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",T)}e.assertIsPendingJsonRpcResponse=u;function f(C){return(0,r.is)(C,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=f;function s(C,T){(0,n.assertStruct)(C,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",T)}e.assertIsJsonRpcResponse=s;function p(C){return(0,r.is)(C,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=p;function y(C,T){(0,n.assertStruct)(C,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",T)}e.assertIsJsonRpcSuccess=y;function w(C){return(0,r.is)(C,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=w;function c(C,T){(0,n.assertStruct)(C,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",T)}e.assertIsJsonRpcFailure=c;function R(C){return(0,r.is)(C,e.JsonRpcErrorStruct)}e.isJsonRpcError=R;function S(C,T){(0,n.assertStruct)(C,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",T)}e.assertIsJsonRpcError=S;function k(C){const{permitEmptyString:T,permitFractions:N,permitNull:j}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},C);return Z=>!!(typeof Z=="number"&&(N||Number.isInteger(Z))||typeof Z=="string"&&(T||Z.length>0)||j&&Z===null)}e.getJsonRpcIdValidator=k}(Ri)),Ri}var Si={},lc;function ld(){return lc||(lc=1,Object.defineProperty(Si,"__esModule",{value:!0})),Si}var rt={},hc;function hd(){if(hc)return rt;hc=1;var e=rt&&rt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(rt,"__esModule",{value:!0}),rt.createModuleLogger=rt.createProjectLogger=void 0;const n=(0,e(ph()).default)("metamask");function t(i){return n.extend(i)}rt.createProjectLogger=t;function l(i,o){return i.extend(o)}return rt.createModuleLogger=l,rt}var Mi={},fc;function fd(){return fc||(fc=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0;function r(g){return Array.isArray(g)&&g.length>0}e.isNonEmptyArray=r;function n(g){return g==null}e.isNullOrUndefined=n;function t(g){return!!g&&typeof g=="object"&&!Array.isArray(g)}e.isObject=t;const l=(g,m)=>Object.hasOwnProperty.call(g,m);e.hasProperty=l,function(g){g[g.Null=4]="Null",g[g.Comma=1]="Comma",g[g.Wrapper=1]="Wrapper",g[g.True=4]="True",g[g.False=5]="False",g[g.Quote=1]="Quote",g[g.Colon=1]="Colon",g[g.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function i(g){if(typeof g!="object"||g===null)return!1;try{let m=g;for(;Object.getPrototypeOf(m)!==null;)m=Object.getPrototypeOf(m);return Object.getPrototypeOf(g)===m}catch{return!1}}e.isPlainObject=i;function o(g){return g.charCodeAt(0)<=127}e.isASCII=o;function a(g){var m;return g.split("").reduce((f,s)=>o(s)?f+1:f+2,0)+((m=g.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&m!==void 0?m:[]).length}e.calculateStringSize=a;function d(g){return g.toString().length}e.calculateNumberSize=d}(Mi)),Mi}var Qe={},dc;function dd(){if(dc)return Qe;dc=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.hexToBigInt=Qe.hexToNumber=Qe.bigIntToHex=Qe.numberToHex=void 0;const e=ot(),r=Rn(),n=o=>((0,e.assert)(typeof o=="number","Value must be a number."),(0,e.assert)(o>=0,"Value must be a non-negative number."),(0,e.assert)(Number.isSafeInteger(o),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,r.add0x)(o.toString(16)));Qe.numberToHex=n;const t=o=>((0,e.assert)(typeof o=="bigint","Value must be a bigint."),(0,e.assert)(o>=0,"Value must be a non-negative bigint."),(0,r.add0x)(o.toString(16)));Qe.bigIntToHex=t;const l=o=>{(0,r.assertIsHexString)(o);const a=parseInt(o,16);return(0,e.assert)(Number.isSafeInteger(a),"Value is not a safe integer. Use `hexToBigInt` instead."),a};Qe.hexToNumber=l;const i=o=>((0,r.assertIsHexString)(o),BigInt((0,r.add0x)(o)));return Qe.hexToBigInt=i,Qe}var ki={},pc;function pd(){return pc||(pc=1,Object.defineProperty(ki,"__esModule",{value:!0})),ki}var Ci={},gc;function gd(){return gc||(gc=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(i){i[i.Millisecond=1]="Millisecond",i[i.Second=1e3]="Second",i[i.Minute=6e4]="Minute",i[i.Hour=36e5]="Hour",i[i.Day=864e5]="Day",i[i.Week=6048e5]="Week",i[i.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const r=i=>Number.isInteger(i)&&i>=0,n=(i,o)=>{if(!r(i))throw new Error(`"${o}" must be a non-negative integer. Received: "${i}".`)};function t(i,o){return n(i,"count"),i*o}e.inMilliseconds=t;function l(i){return n(i,"timestamp"),Date.now()-i}e.timeSince=l}(Ci)),Ci}var Ii={},mc;function md(){return mc||(mc=1,Object.defineProperty(Ii,"__esModule",{value:!0})),Ii}var xi={},un={exports:{}},Ai,vc;function Sn(){if(vc)return Ai;vc=1;const e="2.0.0",r=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,t=16,l=r-6;return Ai={MAX_LENGTH:r,MAX_SAFE_COMPONENT_LENGTH:t,MAX_SAFE_BUILD_LENGTH:l,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Ai}var Li,yc;function Mn(){if(yc)return Li;yc=1;var e={};return Li=typeof process=="object"&&e&&e.NODE_DEBUG&&/\bsemver\b/i.test(e.NODE_DEBUG)?(...n)=>console.error("SEMVER",...n):()=>{},Li}var wc;function Jr(){return wc||(wc=1,function(e,r){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:t,MAX_LENGTH:l}=Sn(),i=Mn();r=e.exports={};const o=r.re=[],a=r.safeRe=[],d=r.src=[],g=r.safeSrc=[],m=r.t={};let u=0;const f="[a-zA-Z0-9-]",s=[["\\s",1],["\\d",l],[f,t]],p=w=>{for(const[c,R]of s)w=w.split(`${c}*`).join(`${c}{0,${R}}`).split(`${c}+`).join(`${c}{1,${R}}`);return w},y=(w,c,R)=>{const S=p(c),k=u++;i(w,k,c),m[w]=k,d[k]=c,g[k]=S,o[k]=new RegExp(c,R?"g":void 0),a[k]=new RegExp(S,R?"g":void 0)};y("NUMERICIDENTIFIER","0|[1-9]\\d*"),y("NUMERICIDENTIFIERLOOSE","\\d+"),y("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),y("MAINVERSION",`(${d[m.NUMERICIDENTIFIER]})\\.(${d[m.NUMERICIDENTIFIER]})\\.(${d[m.NUMERICIDENTIFIER]})`),y("MAINVERSIONLOOSE",`(${d[m.NUMERICIDENTIFIERLOOSE]})\\.(${d[m.NUMERICIDENTIFIERLOOSE]})\\.(${d[m.NUMERICIDENTIFIERLOOSE]})`),y("PRERELEASEIDENTIFIER",`(?:${d[m.NUMERICIDENTIFIER]}|${d[m.NONNUMERICIDENTIFIER]})`),y("PRERELEASEIDENTIFIERLOOSE",`(?:${d[m.NUMERICIDENTIFIERLOOSE]}|${d[m.NONNUMERICIDENTIFIER]})`),y("PRERELEASE",`(?:-(${d[m.PRERELEASEIDENTIFIER]}(?:\\.${d[m.PRERELEASEIDENTIFIER]})*))`),y("PRERELEASELOOSE",`(?:-?(${d[m.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${d[m.PRERELEASEIDENTIFIERLOOSE]})*))`),y("BUILDIDENTIFIER",`${f}+`),y("BUILD",`(?:\\+(${d[m.BUILDIDENTIFIER]}(?:\\.${d[m.BUILDIDENTIFIER]})*))`),y("FULLPLAIN",`v?${d[m.MAINVERSION]}${d[m.PRERELEASE]}?${d[m.BUILD]}?`),y("FULL",`^${d[m.FULLPLAIN]}$`),y("LOOSEPLAIN",`[v=\\s]*${d[m.MAINVERSIONLOOSE]}${d[m.PRERELEASELOOSE]}?${d[m.BUILD]}?`),y("LOOSE",`^${d[m.LOOSEPLAIN]}$`),y("GTLT","((?:<|>)?=?)"),y("XRANGEIDENTIFIERLOOSE",`${d[m.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),y("XRANGEIDENTIFIER",`${d[m.NUMERICIDENTIFIER]}|x|X|\\*`),y("XRANGEPLAIN",`[v=\\s]*(${d[m.XRANGEIDENTIFIER]})(?:\\.(${d[m.XRANGEIDENTIFIER]})(?:\\.(${d[m.XRANGEIDENTIFIER]})(?:${d[m.PRERELEASE]})?${d[m.BUILD]}?)?)?`),y("XRANGEPLAINLOOSE",`[v=\\s]*(${d[m.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[m.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[m.XRANGEIDENTIFIERLOOSE]})(?:${d[m.PRERELEASELOOSE]})?${d[m.BUILD]}?)?)?`),y("XRANGE",`^${d[m.GTLT]}\\s*${d[m.XRANGEPLAIN]}$`),y("XRANGELOOSE",`^${d[m.GTLT]}\\s*${d[m.XRANGEPLAINLOOSE]}$`),y("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),y("COERCE",`${d[m.COERCEPLAIN]}(?:$|[^\\d])`),y("COERCEFULL",d[m.COERCEPLAIN]+`(?:${d[m.PRERELEASE]})?(?:${d[m.BUILD]})?(?:$|[^\\d])`),y("COERCERTL",d[m.COERCE],!0),y("COERCERTLFULL",d[m.COERCEFULL],!0),y("LONETILDE","(?:~>?)"),y("TILDETRIM",`(\\s*)${d[m.LONETILDE]}\\s+`,!0),r.tildeTrimReplace="$1~",y("TILDE",`^${d[m.LONETILDE]}${d[m.XRANGEPLAIN]}$`),y("TILDELOOSE",`^${d[m.LONETILDE]}${d[m.XRANGEPLAINLOOSE]}$`),y("LONECARET","(?:\\^)"),y("CARETTRIM",`(\\s*)${d[m.LONECARET]}\\s+`,!0),r.caretTrimReplace="$1^",y("CARET",`^${d[m.LONECARET]}${d[m.XRANGEPLAIN]}$`),y("CARETLOOSE",`^${d[m.LONECARET]}${d[m.XRANGEPLAINLOOSE]}$`),y("COMPARATORLOOSE",`^${d[m.GTLT]}\\s*(${d[m.LOOSEPLAIN]})$|^$`),y("COMPARATOR",`^${d[m.GTLT]}\\s*(${d[m.FULLPLAIN]})$|^$`),y("COMPARATORTRIM",`(\\s*)${d[m.GTLT]}\\s*(${d[m.LOOSEPLAIN]}|${d[m.XRANGEPLAIN]})`,!0),r.comparatorTrimReplace="$1$2$3",y("HYPHENRANGE",`^\\s*(${d[m.XRANGEPLAIN]})\\s+-\\s+(${d[m.XRANGEPLAIN]})\\s*$`),y("HYPHENRANGELOOSE",`^\\s*(${d[m.XRANGEPLAINLOOSE]})\\s+-\\s+(${d[m.XRANGEPLAINLOOSE]})\\s*$`),y("STAR","(<|>)?=?\\s*\\*"),y("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),y("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(un,un.exports)),un.exports}var Ti,bc;function eo(){if(bc)return Ti;bc=1;const e=Object.freeze({loose:!0}),r=Object.freeze({});return Ti=t=>t?typeof t!="object"?e:t:r,Ti}var Bi,_c;function Cl(){if(_c)return Bi;_c=1;const e=/^[0-9]+$/,r=(t,l)=>{const i=e.test(t),o=e.test(l);return i&&o&&(t=+t,l=+l),t===l?0:i&&!o?-1:o&&!i?1:tr(l,t)},Bi}var Ni,Ec;function Ue(){if(Ec)return Ni;Ec=1;const e=Mn(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:n}=Sn(),{safeRe:t,safeSrc:l,t:i}=Jr(),o=eo(),{compareIdentifiers:a}=Cl();class d{constructor(m,u){if(u=o(u),m instanceof d){if(m.loose===!!u.loose&&m.includePrerelease===!!u.includePrerelease)return m;m=m.version}else if(typeof m!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof m}".`);if(m.length>r)throw new TypeError(`version is longer than ${r} characters`);e("SemVer",m,u),this.options=u,this.loose=!!u.loose,this.includePrerelease=!!u.includePrerelease;const f=m.trim().match(u.loose?t[i.LOOSE]:t[i.FULL]);if(!f)throw new TypeError(`Invalid Version: ${m}`);if(this.raw=m,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){const p=+s;if(p>=0&&p=0;)typeof this.prerelease[p]=="number"&&(this.prerelease[p]++,p=-2);if(p===-1){if(u===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(u){let p=[u,s];f===!1&&(p=[u]),a(this.prerelease[0],u)===0?isNaN(this.prerelease[1])&&(this.prerelease=p):this.prerelease=p}break}default:throw new Error(`invalid increment argument: ${m}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Ni=d,Ni}var Oi,Rc;function or(){if(Rc)return Oi;Rc=1;const e=Ue();return Oi=(n,t,l=!1)=>{if(n instanceof e)return n;try{return new e(n,t)}catch(i){if(!l)return null;throw i}},Oi}var Pi,Sc;function vd(){if(Sc)return Pi;Sc=1;const e=or();return Pi=(n,t)=>{const l=e(n,t);return l?l.version:null},Pi}var Fi,Mc;function yd(){if(Mc)return Fi;Mc=1;const e=or();return Fi=(n,t)=>{const l=e(n.trim().replace(/^[=v]+/,""),t);return l?l.version:null},Fi}var Di,kc;function wd(){if(kc)return Di;kc=1;const e=Ue();return Di=(n,t,l,i,o)=>{typeof l=="string"&&(o=i,i=l,l=void 0);try{return new e(n instanceof e?n.version:n,l).inc(t,i,o).version}catch{return null}},Di}var qi,Cc;function bd(){if(Cc)return qi;Cc=1;const e=or();return qi=(n,t)=>{const l=e(n,null,!0),i=e(t,null,!0),o=l.compare(i);if(o===0)return null;const a=o>0,d=a?l:i,g=a?i:l,m=!!d.prerelease.length;if(!!g.prerelease.length&&!m){if(!g.patch&&!g.minor)return"major";if(g.compareMain(d)===0)return g.minor&&!g.patch?"minor":"patch"}const f=m?"pre":"";return l.major!==i.major?f+"major":l.minor!==i.minor?f+"minor":l.patch!==i.patch?f+"patch":"prerelease"},qi}var ji,Ic;function _d(){if(Ic)return ji;Ic=1;const e=Ue();return ji=(n,t)=>new e(n,t).major,ji}var $i,xc;function Ed(){if(xc)return $i;xc=1;const e=Ue();return $i=(n,t)=>new e(n,t).minor,$i}var Ui,Ac;function Rd(){if(Ac)return Ui;Ac=1;const e=Ue();return Ui=(n,t)=>new e(n,t).patch,Ui}var Hi,Lc;function Sd(){if(Lc)return Hi;Lc=1;const e=or();return Hi=(n,t)=>{const l=e(n,t);return l&&l.prerelease.length?l.prerelease:null},Hi}var Wi,Tc;function Xe(){if(Tc)return Wi;Tc=1;const e=Ue();return Wi=(n,t,l)=>new e(n,l).compare(new e(t,l)),Wi}var Vi,Bc;function Md(){if(Bc)return Vi;Bc=1;const e=Xe();return Vi=(n,t,l)=>e(t,n,l),Vi}var zi,Nc;function kd(){if(Nc)return zi;Nc=1;const e=Xe();return zi=(n,t)=>e(n,t,!0),zi}var Ji,Oc;function to(){if(Oc)return Ji;Oc=1;const e=Ue();return Ji=(n,t,l)=>{const i=new e(n,l),o=new e(t,l);return i.compare(o)||i.compareBuild(o)},Ji}var Gi,Pc;function Cd(){if(Pc)return Gi;Pc=1;const e=to();return Gi=(n,t)=>n.sort((l,i)=>e(l,i,t)),Gi}var Zi,Fc;function Id(){if(Fc)return Zi;Fc=1;const e=to();return Zi=(n,t)=>n.sort((l,i)=>e(i,l,t)),Zi}var Ki,Dc;function kn(){if(Dc)return Ki;Dc=1;const e=Xe();return Ki=(n,t,l)=>e(n,t,l)>0,Ki}var Qi,qc;function ro(){if(qc)return Qi;qc=1;const e=Xe();return Qi=(n,t,l)=>e(n,t,l)<0,Qi}var Yi,jc;function Il(){if(jc)return Yi;jc=1;const e=Xe();return Yi=(n,t,l)=>e(n,t,l)===0,Yi}var Xi,$c;function xl(){if($c)return Xi;$c=1;const e=Xe();return Xi=(n,t,l)=>e(n,t,l)!==0,Xi}var es,Uc;function no(){if(Uc)return es;Uc=1;const e=Xe();return es=(n,t,l)=>e(n,t,l)>=0,es}var ts,Hc;function io(){if(Hc)return ts;Hc=1;const e=Xe();return ts=(n,t,l)=>e(n,t,l)<=0,ts}var rs,Wc;function Al(){if(Wc)return rs;Wc=1;const e=Il(),r=xl(),n=kn(),t=no(),l=ro(),i=io();return rs=(a,d,g,m)=>{switch(d){case"===":return typeof a=="object"&&(a=a.version),typeof g=="object"&&(g=g.version),a===g;case"!==":return typeof a=="object"&&(a=a.version),typeof g=="object"&&(g=g.version),a!==g;case"":case"=":case"==":return e(a,g,m);case"!=":return r(a,g,m);case">":return n(a,g,m);case">=":return t(a,g,m);case"<":return l(a,g,m);case"<=":return i(a,g,m);default:throw new TypeError(`Invalid operator: ${d}`)}},rs}var ns,Vc;function xd(){if(Vc)return ns;Vc=1;const e=Ue(),r=or(),{safeRe:n,t}=Jr();return ns=(i,o)=>{if(i instanceof e)return i;if(typeof i=="number"&&(i=String(i)),typeof i!="string")return null;o=o||{};let a=null;if(!o.rtl)a=i.match(o.includePrerelease?n[t.COERCEFULL]:n[t.COERCE]);else{const s=o.includePrerelease?n[t.COERCERTLFULL]:n[t.COERCERTL];let p;for(;(p=s.exec(i))&&(!a||a.index+a[0].length!==i.length);)(!a||p.index+p[0].length!==a.index+a[0].length)&&(a=p),s.lastIndex=p.index+p[1].length+p[2].length;s.lastIndex=-1}if(a===null)return null;const d=a[2],g=a[3]||"0",m=a[4]||"0",u=o.includePrerelease&&a[5]?`-${a[5]}`:"",f=o.includePrerelease&&a[6]?`+${a[6]}`:"";return r(`${d}.${g}.${m}${u}${f}`,o)},ns}var is,zc;function Ad(){if(zc)return is;zc=1;class e{constructor(){this.max=1e3,this.map=new Map}get(n){const t=this.map.get(n);if(t!==void 0)return this.map.delete(n),this.map.set(n,t),t}delete(n){return this.map.delete(n)}set(n,t){if(!this.delete(n)&&t!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(n,t)}return this}}return is=e,is}var ss,Jc;function et(){if(Jc)return ss;Jc=1;const e=/\s+/g;class r{constructor(E,M){if(M=l(M),E instanceof r)return E.loose===!!M.loose&&E.includePrerelease===!!M.includePrerelease?E:new r(E.raw,M);if(E instanceof i)return this.raw=E.value,this.set=[[E]],this.formatted=void 0,this;if(this.options=M,this.loose=!!M.loose,this.includePrerelease=!!M.includePrerelease,this.raw=E.trim().replace(e," "),this.set=this.raw.split("||").map(I=>this.parseRange(I.trim())).filter(I=>I.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const I=this.set[0];if(this.set=this.set.filter(A=>!y(A[0])),this.set.length===0)this.set=[I];else if(this.set.length>1){for(const A of this.set)if(A.length===1&&w(A[0])){this.set=[A];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let E=0;E0&&(this.formatted+="||");const M=this.set[E];for(let I=0;I0&&(this.formatted+=" "),this.formatted+=M[I].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(E){const I=((this.options.includePrerelease&&s)|(this.options.loose&&p))+":"+E,A=t.get(I);if(A)return A;const O=this.options.loose,$=O?d[g.HYPHENRANGELOOSE]:d[g.HYPHENRANGE];E=E.replace($,re(this.options.includePrerelease)),o("hyphen replace",E),E=E.replace(d[g.COMPARATORTRIM],m),o("comparator trim",E),E=E.replace(d[g.TILDETRIM],u),o("tilde trim",E),E=E.replace(d[g.CARETTRIM],f),o("caret trim",E);let L=E.split(" ").map(Y=>R(Y,this.options)).join(" ").split(/\s+/).map(Y=>Q(Y,this.options));O&&(L=L.filter(Y=>(o("loose invalid filter",Y,this.options),!!Y.match(d[g.COMPARATORLOOSE])))),o("range list",L);const b=new Map,P=L.map(Y=>new i(Y,this.options));for(const Y of P){if(y(Y))return[Y];b.set(Y.value,Y)}b.size>1&&b.has("")&&b.delete("");const te=[...b.values()];return t.set(I,te),te}intersects(E,M){if(!(E instanceof r))throw new TypeError("a Range is required");return this.set.some(I=>c(I,M)&&E.set.some(A=>c(A,M)&&I.every(O=>A.every($=>O.intersects($,M)))))}test(E){if(!E)return!1;if(typeof E=="string")try{E=new a(E,this.options)}catch{return!1}for(let M=0;Mh.value==="<0.0.0-0",w=h=>h.value==="",c=(h,E)=>{let M=!0;const I=h.slice();let A=I.pop();for(;M&&I.length;)M=I.every(O=>A.intersects(O,E)),A=I.pop();return M},R=(h,E)=>(o("comp",h,E),h=T(h,E),o("caret",h),h=k(h,E),o("tildes",h),h=j(h,E),o("xrange",h),h=Z(h,E),o("stars",h),h),S=h=>!h||h.toLowerCase()==="x"||h==="*",k=(h,E)=>h.trim().split(/\s+/).map(M=>C(M,E)).join(" "),C=(h,E)=>{const M=E.loose?d[g.TILDELOOSE]:d[g.TILDE];return h.replace(M,(I,A,O,$,L)=>{o("tilde",h,I,A,O,$,L);let b;return S(A)?b="":S(O)?b=`>=${A}.0.0 <${+A+1}.0.0-0`:S($)?b=`>=${A}.${O}.0 <${A}.${+O+1}.0-0`:L?(o("replaceTilde pr",L),b=`>=${A}.${O}.${$}-${L} <${A}.${+O+1}.0-0`):b=`>=${A}.${O}.${$} <${A}.${+O+1}.0-0`,o("tilde return",b),b})},T=(h,E)=>h.trim().split(/\s+/).map(M=>N(M,E)).join(" "),N=(h,E)=>{o("caret",h,E);const M=E.loose?d[g.CARETLOOSE]:d[g.CARET],I=E.includePrerelease?"-0":"";return h.replace(M,(A,O,$,L,b)=>{o("caret",h,A,O,$,L,b);let P;return S(O)?P="":S($)?P=`>=${O}.0.0${I} <${+O+1}.0.0-0`:S(L)?O==="0"?P=`>=${O}.${$}.0${I} <${O}.${+$+1}.0-0`:P=`>=${O}.${$}.0${I} <${+O+1}.0.0-0`:b?(o("replaceCaret pr",b),O==="0"?$==="0"?P=`>=${O}.${$}.${L}-${b} <${O}.${$}.${+L+1}-0`:P=`>=${O}.${$}.${L}-${b} <${O}.${+$+1}.0-0`:P=`>=${O}.${$}.${L}-${b} <${+O+1}.0.0-0`):(o("no pr"),O==="0"?$==="0"?P=`>=${O}.${$}.${L}${I} <${O}.${$}.${+L+1}-0`:P=`>=${O}.${$}.${L}${I} <${O}.${+$+1}.0-0`:P=`>=${O}.${$}.${L} <${+O+1}.0.0-0`),o("caret return",P),P})},j=(h,E)=>(o("replaceXRanges",h,E),h.split(/\s+/).map(M=>z(M,E)).join(" ")),z=(h,E)=>{h=h.trim();const M=E.loose?d[g.XRANGELOOSE]:d[g.XRANGE];return h.replace(M,(I,A,O,$,L,b)=>{o("xRange",h,I,A,O,$,L,b);const P=S(O),te=P||S($),Y=te||S(L),U=Y;return A==="="&&U&&(A=""),b=E.includePrerelease?"-0":"",P?A===">"||A==="<"?I="<0.0.0-0":I="*":A&&U?(te&&($=0),L=0,A===">"?(A=">=",te?(O=+O+1,$=0,L=0):($=+$+1,L=0)):A==="<="&&(A="<",te?O=+O+1:$=+$+1),A==="<"&&(b="-0"),I=`${A+O}.${$}.${L}${b}`):te?I=`>=${O}.0.0${b} <${+O+1}.0.0-0`:Y&&(I=`>=${O}.${$}.0${b} <${O}.${+$+1}.0-0`),o("xRange return",I),I})},Z=(h,E)=>(o("replaceStars",h,E),h.trim().replace(d[g.STAR],"")),Q=(h,E)=>(o("replaceGTE0",h,E),h.trim().replace(d[E.includePrerelease?g.GTE0PRE:g.GTE0],"")),re=h=>(E,M,I,A,O,$,L,b,P,te,Y,U)=>(S(I)?M="":S(A)?M=`>=${I}.0.0${h?"-0":""}`:S(O)?M=`>=${I}.${A}.0${h?"-0":""}`:$?M=`>=${M}`:M=`>=${M}${h?"-0":""}`,S(P)?b="":S(te)?b=`<${+P+1}.0.0-0`:S(Y)?b=`<${P}.${+te+1}.0-0`:U?b=`<=${P}.${te}.${Y}-${U}`:h?b=`<${P}.${te}.${+Y+1}-0`:b=`<=${b}`,`${M} ${b}`.trim()),q=(h,E,M)=>{for(let I=0;I0){const A=h[I].semver;if(A.major===E.major&&A.minor===E.minor&&A.patch===E.patch)return!0}return!1}return!0};return ss}var os,Gc;function Cn(){if(Gc)return os;Gc=1;const e=Symbol("SemVer ANY");class r{static get ANY(){return e}constructor(m,u){if(u=n(u),m instanceof r){if(m.loose===!!u.loose)return m;m=m.value}m=m.trim().split(/\s+/).join(" "),o("comparator",m,u),this.options=u,this.loose=!!u.loose,this.parse(m),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(m){const u=this.options.loose?t[l.COMPARATORLOOSE]:t[l.COMPARATOR],f=m.match(u);if(!f)throw new TypeError(`Invalid comparator: ${m}`);this.operator=f[1]!==void 0?f[1]:"",this.operator==="="&&(this.operator=""),f[2]?this.semver=new a(f[2],this.options.loose):this.semver=e}toString(){return this.value}test(m){if(o("Comparator.test",m,this.options.loose),this.semver===e||m===e)return!0;if(typeof m=="string")try{m=new a(m,this.options)}catch{return!1}return i(m,this.operator,this.semver,this.options)}intersects(m,u){if(!(m instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new d(m.value,u).test(this.value):m.operator===""?m.value===""?!0:new d(this.value,u).test(m.semver):(u=n(u),u.includePrerelease&&(this.value==="<0.0.0-0"||m.value==="<0.0.0-0")||!u.includePrerelease&&(this.value.startsWith("<0.0.0")||m.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&m.operator.startsWith(">")||this.operator.startsWith("<")&&m.operator.startsWith("<")||this.semver.version===m.semver.version&&this.operator.includes("=")&&m.operator.includes("=")||i(this.semver,"<",m.semver,u)&&this.operator.startsWith(">")&&m.operator.startsWith("<")||i(this.semver,">",m.semver,u)&&this.operator.startsWith("<")&&m.operator.startsWith(">")))}}os=r;const n=eo(),{safeRe:t,t:l}=Jr(),i=Al(),o=Mn(),a=Ue(),d=et();return os}var as,Zc;function In(){if(Zc)return as;Zc=1;const e=et();return as=(n,t,l)=>{try{t=new e(t,l)}catch{return!1}return t.test(n)},as}var cs,Kc;function Ld(){if(Kc)return cs;Kc=1;const e=et();return cs=(n,t)=>new e(n,t).set.map(l=>l.map(i=>i.value).join(" ").trim().split(" ")),cs}var us,Qc;function Td(){if(Qc)return us;Qc=1;const e=Ue(),r=et();return us=(t,l,i)=>{let o=null,a=null,d=null;try{d=new r(l,i)}catch{return null}return t.forEach(g=>{d.test(g)&&(!o||a.compare(g)===-1)&&(o=g,a=new e(o,i))}),o},us}var ls,Yc;function Bd(){if(Yc)return ls;Yc=1;const e=Ue(),r=et();return ls=(t,l,i)=>{let o=null,a=null,d=null;try{d=new r(l,i)}catch{return null}return t.forEach(g=>{d.test(g)&&(!o||a.compare(g)===1)&&(o=g,a=new e(o,i))}),o},ls}var hs,Xc;function Nd(){if(Xc)return hs;Xc=1;const e=Ue(),r=et(),n=kn();return hs=(l,i)=>{l=new r(l,i);let o=new e("0.0.0");if(l.test(o)||(o=new e("0.0.0-0"),l.test(o)))return o;o=null;for(let a=0;a{const u=new e(m.semver.version);switch(m.operator){case">":u.prerelease.length===0?u.patch++:u.prerelease.push(0),u.raw=u.format();case"":case">=":(!g||n(u,g))&&(g=u);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${m.operator}`)}}),g&&(!o||n(o,g))&&(o=g)}return o&&l.test(o)?o:null},hs}var fs,eu;function Od(){if(eu)return fs;eu=1;const e=et();return fs=(n,t)=>{try{return new e(n,t).range||"*"}catch{return null}},fs}var ds,tu;function so(){if(tu)return ds;tu=1;const e=Ue(),r=Cn(),{ANY:n}=r,t=et(),l=In(),i=kn(),o=ro(),a=io(),d=no();return ds=(m,u,f,s)=>{m=new e(m,s),u=new t(u,s);let p,y,w,c,R;switch(f){case">":p=i,y=a,w=o,c=">",R=">=";break;case"<":p=o,y=d,w=i,c="<",R="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(l(m,u,s))return!1;for(let S=0;S{N.semver===n&&(N=new r(">=0.0.0")),C=C||N,T=T||N,p(N.semver,C.semver,s)?C=N:w(N.semver,T.semver,s)&&(T=N)}),C.operator===c||C.operator===R||(!T.operator||T.operator===c)&&y(m,T.semver))return!1;if(T.operator===R&&w(m,T.semver))return!1}return!0},ds}var ps,ru;function Pd(){if(ru)return ps;ru=1;const e=so();return ps=(n,t,l)=>e(n,t,">",l),ps}var gs,nu;function Fd(){if(nu)return gs;nu=1;const e=so();return gs=(n,t,l)=>e(n,t,"<",l),gs}var ms,iu;function Dd(){if(iu)return ms;iu=1;const e=et();return ms=(n,t,l)=>(n=new e(n,l),t=new e(t,l),n.intersects(t,l)),ms}var vs,su;function qd(){if(su)return vs;su=1;const e=In(),r=Xe();return vs=(n,t,l)=>{const i=[];let o=null,a=null;const d=n.sort((f,s)=>r(f,s,l));for(const f of d)e(f,t,l)?(a=f,o||(o=f)):(a&&i.push([o,a]),a=null,o=null);o&&i.push([o,null]);const g=[];for(const[f,s]of i)f===s?g.push(f):!s&&f===d[0]?g.push("*"):s?f===d[0]?g.push(`<=${s}`):g.push(`${f} - ${s}`):g.push(`>=${f}`);const m=g.join(" || "),u=typeof t.raw=="string"?t.raw:String(t);return m.length{if(u===f)return!0;u=new e(u,s),f=new e(f,s);let p=!1;e:for(const y of u.set){for(const w of f.set){const c=d(y,w,s);if(p=p||c!==null,c)continue e}if(p)return!1}return!0},o=[new r(">=0.0.0-0")],a=[new r(">=0.0.0")],d=(u,f,s)=>{if(u===f)return!0;if(u.length===1&&u[0].semver===n){if(f.length===1&&f[0].semver===n)return!0;s.includePrerelease?u=o:u=a}if(f.length===1&&f[0].semver===n){if(s.includePrerelease)return!0;f=a}const p=new Set;let y,w;for(const j of u)j.operator===">"||j.operator===">="?y=g(y,j,s):j.operator==="<"||j.operator==="<="?w=m(w,j,s):p.add(j.semver);if(p.size>1)return null;let c;if(y&&w){if(c=l(y.semver,w.semver,s),c>0)return null;if(c===0&&(y.operator!==">="||w.operator!=="<="))return null}for(const j of p){if(y&&!t(j,String(y),s)||w&&!t(j,String(w),s))return null;for(const z of f)if(!t(j,String(z),s))return!1;return!0}let R,S,k,C,T=w&&!s.includePrerelease&&w.semver.prerelease.length?w.semver:!1,N=y&&!s.includePrerelease&&y.semver.prerelease.length?y.semver:!1;T&&T.prerelease.length===1&&w.operator==="<"&&T.prerelease[0]===0&&(T=!1);for(const j of f){if(C=C||j.operator===">"||j.operator===">=",k=k||j.operator==="<"||j.operator==="<=",y){if(N&&j.semver.prerelease&&j.semver.prerelease.length&&j.semver.major===N.major&&j.semver.minor===N.minor&&j.semver.patch===N.patch&&(N=!1),j.operator===">"||j.operator===">="){if(R=g(y,j,s),R===j&&R!==y)return!1}else if(y.operator===">="&&!t(y.semver,String(j),s))return!1}if(w){if(T&&j.semver.prerelease&&j.semver.prerelease.length&&j.semver.major===T.major&&j.semver.minor===T.minor&&j.semver.patch===T.patch&&(T=!1),j.operator==="<"||j.operator==="<="){if(S=m(w,j,s),S===j&&S!==w)return!1}else if(w.operator==="<="&&!t(w.semver,String(j),s))return!1}if(!j.operator&&(w||y)&&c!==0)return!1}return!(y&&k&&!w&&c!==0||w&&C&&!y&&c!==0||N||T)},g=(u,f,s)=>{if(!u)return f;const p=l(u.semver,f.semver,s);return p>0?u:p<0||f.operator===">"&&u.operator===">="?f:u},m=(u,f,s)=>{if(!u)return f;const p=l(u.semver,f.semver,s);return p<0?u:p>0||f.operator==="<"&&u.operator==="<="?f:u};return ys=i,ys}var ws,au;function $d(){if(au)return ws;au=1;const e=Jr(),r=Sn(),n=Ue(),t=Cl(),l=or(),i=vd(),o=yd(),a=wd(),d=bd(),g=_d(),m=Ed(),u=Rd(),f=Sd(),s=Xe(),p=Md(),y=kd(),w=to(),c=Cd(),R=Id(),S=kn(),k=ro(),C=Il(),T=xl(),N=no(),j=io(),z=Al(),Z=xd(),Q=Cn(),re=et(),q=In(),h=Ld(),E=Td(),M=Bd(),I=Nd(),A=Od(),O=so(),$=Pd(),L=Fd(),b=Dd(),P=qd(),te=jd();return ws={parse:l,valid:i,clean:o,inc:a,diff:d,major:g,minor:m,patch:u,prerelease:f,compare:s,rcompare:p,compareLoose:y,compareBuild:w,sort:c,rsort:R,gt:S,lt:k,eq:C,neq:T,gte:N,lte:j,cmp:z,coerce:Z,Comparator:Q,Range:re,satisfies:q,toComparators:h,maxSatisfying:E,minSatisfying:M,minVersion:I,validRange:A,outside:O,gtr:$,ltr:L,intersects:b,simplifyRange:P,subset:te,SemVer:n,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:t.compareIdentifiers,rcompareIdentifiers:t.rcompareIdentifiers},ws}var cu;function Ud(){return cu||(cu=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const r=$d(),n=Wt,t=ot();e.VersionStruct=(0,n.refine)((0,n.string)(),"Version",u=>(0,r.valid)(u)===null?`Expected SemVer version, got "${u}"`:!0),e.VersionRangeStruct=(0,n.refine)((0,n.string)(),"Version range",u=>(0,r.validRange)(u)===null?`Expected SemVer range, got "${u}"`:!0);function l(u){return(0,n.is)(u,e.VersionStruct)}e.isValidSemVerVersion=l;function i(u){return(0,n.is)(u,e.VersionRangeStruct)}e.isValidSemVerRange=i;function o(u){(0,t.assertStruct)(u,e.VersionStruct)}e.assertIsSemVerVersion=o;function a(u){(0,t.assertStruct)(u,e.VersionRangeStruct)}e.assertIsSemVerRange=a;function d(u,f){return(0,r.gt)(u,f)}e.gtVersion=d;function g(u,f){return(0,r.gtr)(u,f)}e.gtRange=g;function m(u,f){return(0,r.satisfies)(u,f,{includePrerelease:!0})}e.satisfiesVersionRange=m}(xi)),xi}var uu;function Hd(){return uu||(uu=1,function(e){var r=Pt&&Pt.__createBinding||(Object.create?function(t,l,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(l,i);(!a||("get"in a?!l.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return l[i]}}),Object.defineProperty(t,o,a)}:function(t,l,i,o){o===void 0&&(o=i),t[o]=l[i]}),n=Pt&&Pt.__exportStar||function(t,l){for(var i in t)i!=="default"&&!Object.prototype.hasOwnProperty.call(l,i)&&r(l,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(ot(),e),n(Ml(),e),n(kl(),e),n(sd(),e),n(od(),e),n(ad(),e),n(cd(),e),n(Rn(),e),n(ud(),e),n(ld(),e),n(hd(),e),n(fd(),e),n(dd(),e),n(pd(),e),n(gd(),e),n(md(),e),n(Ud(),e)}(Pt)),Pt}var lu;function Wd(){return lu||(lu=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const r=Hd();Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return r.createModuleLogger}}),e.projectLogger=(0,r.createProjectLogger)("eth-block-tracker")}(bi)),bi}var hu;function Vd(){if(hu)return Nt;hu=1;var e=Nt&&Nt.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.PollingBlockTracker=void 0;const r=e(Gs()),n=e(wf()),t=ml(),l=Wd(),i=(0,l.createModuleLogger)(l.projectLogger,"polling-block-tracker"),o=(0,r.default)(),a=1e3;let d=class extends t.BaseBlockTracker{constructor(u={}){var f;if(!u.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},u),{blockResetDuration:(f=u.blockResetDuration)!==null&&f!==void 0?f:u.pollingInterval})),this._provider=u.provider,this._pollingInterval=u.pollingInterval||20*a,this._retryTimeout=u.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=u.keepEventLoopActive===void 0?!0:u.keepEventLoopActive,this._setSkipCacheFlag=u.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var u;this._isRunning;)try{await this._updateLatestBlock();const f=g(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await f}catch(f){const s=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block: +${(u=f.stack)!==null&&u!==void 0?u:f}`);try{this.emit("error",s)}catch{console.error(s)}const p=g(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await p}}async _updateLatestBlock(){const u=await this._fetchLatestBlock();this._newPotentialLatest(u)}async _fetchLatestBlock(){const u={jsonrpc:"2.0",id:o(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(u.skipCache=!0),i("Making request",u);const f=await(0,n.default)(s=>this._provider.sendAsync(u,s))();if(i("Got response",f),f.error)throw new Error(`PollingBlockTracker - encountered error fetching block: +${f.error.message}`);return f.result}};Nt.PollingBlockTracker=d;function g(m,u){return new Promise(f=>{const s=setTimeout(f,m);s.unref&&u&&s.unref()})}return Nt}var Ft={},fu;function zd(){if(fu)return Ft;fu=1;var e=Ft&&Ft.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.SubscribeBlockTracker=void 0;const r=e(Gs()),n=ml(),t=(0,r.default)();let l=class extends n.BaseBlockTracker{constructor(o={}){if(!o.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(o),this._provider=o.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const o=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(o)}catch(o){this.emit("error",o)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(o){this.emit("error",o)}}_call(o,...a){return new Promise((d,g)=>{this._provider.sendAsync({id:t(),method:o,params:a,jsonrpc:"2.0"},(m,u)=>{m?g(m):d(u.result)})})}_handleSubData(o,a){var d;a.method==="eth_subscription"&&((d=a.params)===null||d===void 0?void 0:d.subscription)===this._subscriptionId&&this._newPotentialLatest(a.params.result.number)}};return Ft.SubscribeBlockTracker=l,Ft}var du;function Jd(){return du||(du=1,function(e){var r=Bt&&Bt.__createBinding||(Object.create?function(t,l,i,o){o===void 0&&(o=i),Object.defineProperty(t,o,{enumerable:!0,get:function(){return l[i]}})}:function(t,l,i,o){o===void 0&&(o=i),t[o]=l[i]}),n=Bt&&Bt.__exportStar||function(t,l){for(var i in t)i!=="default"&&!Object.prototype.hasOwnProperty.call(l,i)&&r(l,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(Vd(),e),n(zd(),e)}(Bt)),Bt}var Dt={},Pr={},Fr={},pu;function Ll(){if(pu)return Fr;pu=1,Object.defineProperty(Fr,"__esModule",{value:!0}),Fr.getUniqueId=void 0;const e=4294967295;let r=Math.floor(Math.random()*e);function n(){return r=(r+1)%e,r}return Fr.getUniqueId=n,Fr}var gu;function Gd(){if(gu)return Pr;gu=1,Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.createIdRemapMiddleware=void 0;const e=Ll();function r(){return(n,t,l,i)=>{const o=n.id,a=e.getUniqueId();n.id=a,t.id=a,l(d=>{n.id=o,t.id=o,d()})}}return Pr.createIdRemapMiddleware=r,Pr}var Dr={},mu;function Zd(){if(mu)return Dr;mu=1,Object.defineProperty(Dr,"__esModule",{value:!0}),Dr.createAsyncMiddleware=void 0;function e(r){return async(n,t,l,i)=>{let o;const a=new Promise(u=>{o=u});let d=null,g=!1;const m=async()=>{g=!0,l(u=>{d=u,o()}),await a};try{await r(n,t,m),g?(await a,d(null)):i(null)}catch(u){d?d(u):i(u)}}}return Dr.createAsyncMiddleware=e,Dr}var qr={},vu;function Kd(){if(vu)return qr;vu=1,Object.defineProperty(qr,"__esModule",{value:!0}),qr.createScaffoldMiddleware=void 0;function e(r){return(n,t,l,i)=>{const o=r[n.method];return o===void 0?l():typeof o=="function"?o(n,t,l,i):(t.result=o,i())}}return qr.createScaffoldMiddleware=e,qr}var qt={},ln={},yu;function Qd(){if(yu)return ln;yu=1,Object.defineProperty(ln,"__esModule",{value:!0});const e=En();function r(l,i,o){try{Reflect.apply(l,i,o)}catch(a){setTimeout(()=>{throw a})}}function n(l){const i=l.length,o=new Array(i);for(let a=0;a0&&([m]=o),m instanceof Error)throw m;const u=new Error(`Unhandled error.${m?` (${m.message})`:""}`);throw u.context=m,u}const g=d[i];if(g===void 0)return!1;if(typeof g=="function")r(g,this,o);else{const m=g.length,u=n(g);for(let f=0;f"u"&&(y=l()),a(f,"",0,[],void 0,0,y);var w;try{t.length===0?w=JSON.stringify(f,s,p):w=JSON.stringify(f,u(s),p)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;n.length!==0;){var c=n.pop();c.length===4?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return w}function o(f,s,p,y){var w=Object.getOwnPropertyDescriptor(y,p);w.get!==void 0?w.configurable?(Object.defineProperty(y,p,{value:f}),n.push([y,p,s,w])):t.push([s,p,f]):(y[p]=f,n.push([y,p,s]))}function a(f,s,p,y,w,c,R){c+=1;var S;if(typeof f=="object"&&f!==null){for(S=0;SR.depthLimit){o(e,f,s,w);return}if(typeof R.edgesLimit<"u"&&p+1>R.edgesLimit){o(e,f,s,w);return}if(y.push(f),Array.isArray(f))for(S=0;Ss?1:0}function g(f,s,p,y){typeof y>"u"&&(y=l());var w=m(f,"",0,[],void 0,0,y)||f,c;try{t.length===0?c=JSON.stringify(w,s,p):c=JSON.stringify(w,u(s),p)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;n.length!==0;){var R=n.pop();R.length===4?Object.defineProperty(R[0],R[1],R[3]):R[0][R[1]]=R[2]}}return c}function m(f,s,p,y,w,c,R){c+=1;var S;if(typeof f=="object"&&f!==null){for(S=0;SR.depthLimit){o(e,f,s,w);return}if(typeof R.edgesLimit<"u"&&p+1>R.edgesLimit){o(e,f,s,w);return}if(y.push(f),Array.isArray(f))for(S=0;S0)for(var y=0;y=1e3&&i<=4999}function l(i,o){if(o!=="[Circular]")return o}return jt}var Es={},$t={},_u;function ao(){return _u||(_u=1,Object.defineProperty($t,"__esModule",{value:!0}),$t.errorValues=$t.errorCodes=void 0,$t.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},$t.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}),$t}var Eu;function Tl(){return Eu||(Eu=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const r=ao(),n=oo(),t=r.errorCodes.rpc.internal,l="Unspecified error message. This is a bug, please report it.",i={code:t,message:o(t)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(f,s=l){if(Number.isInteger(f)){const p=f.toString();if(u(r.errorValues,p))return r.errorValues[p].message;if(g(f))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return s}e.getMessageFromCode=o;function a(f){if(!Number.isInteger(f))return!1;const s=f.toString();return!!(r.errorValues[s]||g(f))}e.isValidCode=a;function d(f,{fallbackError:s=i,shouldIncludeStack:p=!1}={}){var y,w;if(!s||!Number.isInteger(s.code)||typeof s.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(f instanceof n.EthereumRpcError)return f.serialize();const c={};if(f&&typeof f=="object"&&!Array.isArray(f)&&u(f,"code")&&a(f.code)){const S=f;c.code=S.code,S.message&&typeof S.message=="string"?(c.message=S.message,u(S,"data")&&(c.data=S.data)):(c.message=o(c.code),c.data={originalError:m(f)})}else{c.code=s.code;const S=(y=f)===null||y===void 0?void 0:y.message;c.message=S&&typeof S=="string"?S:s.message,c.data={originalError:m(f)}}const R=(w=f)===null||w===void 0?void 0:w.stack;return p&&f&&R&&typeof R=="string"&&(c.stack=R),c}e.serializeError=d;function g(f){return f>=-32099&&f<=-32e3}function m(f){return f&&typeof f=="object"&&!Array.isArray(f)?Object.assign({},f):f}function u(f,s){return Object.prototype.hasOwnProperty.call(f,s)}}(Es)),Es}var jr={},Ru;function Xd(){if(Ru)return jr;Ru=1,Object.defineProperty(jr,"__esModule",{value:!0}),jr.ethErrors=void 0;const e=oo(),r=Tl(),n=ao();jr.ethErrors={rpc:{parse:o=>t(n.errorCodes.rpc.parse,o),invalidRequest:o=>t(n.errorCodes.rpc.invalidRequest,o),invalidParams:o=>t(n.errorCodes.rpc.invalidParams,o),methodNotFound:o=>t(n.errorCodes.rpc.methodNotFound,o),internal:o=>t(n.errorCodes.rpc.internal,o),server:o=>{if(!o||typeof o!="object"||Array.isArray(o))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:a}=o;if(!Number.isInteger(a)||a>-32005||a<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return t(a,o)},invalidInput:o=>t(n.errorCodes.rpc.invalidInput,o),resourceNotFound:o=>t(n.errorCodes.rpc.resourceNotFound,o),resourceUnavailable:o=>t(n.errorCodes.rpc.resourceUnavailable,o),transactionRejected:o=>t(n.errorCodes.rpc.transactionRejected,o),methodNotSupported:o=>t(n.errorCodes.rpc.methodNotSupported,o),limitExceeded:o=>t(n.errorCodes.rpc.limitExceeded,o)},provider:{userRejectedRequest:o=>l(n.errorCodes.provider.userRejectedRequest,o),unauthorized:o=>l(n.errorCodes.provider.unauthorized,o),unsupportedMethod:o=>l(n.errorCodes.provider.unsupportedMethod,o),disconnected:o=>l(n.errorCodes.provider.disconnected,o),chainDisconnected:o=>l(n.errorCodes.provider.chainDisconnected,o),custom:o=>{if(!o||typeof o!="object"||Array.isArray(o))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:a,message:d,data:g}=o;if(!d||typeof d!="string")throw new Error('"message" must be a nonempty string');return new e.EthereumProviderError(a,d,g)}}};function t(o,a){const[d,g]=i(a);return new e.EthereumRpcError(o,d||r.getMessageFromCode(o),g)}function l(o,a){const[d,g]=i(a);return new e.EthereumProviderError(o,d||r.getMessageFromCode(o),g)}function i(o){if(o){if(typeof o=="string")return[o];if(typeof o=="object"&&!Array.isArray(o)){const{message:a,data:d}=o;if(a&&typeof a!="string")throw new Error("Must specify string message.");return[a||void 0,d]}}return[]}return jr}var Su;function e0(){return Su||(Su=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const r=oo();Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return r.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return r.EthereumProviderError}});const n=Tl();Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return n.getMessageFromCode}});const t=Xd();Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return t.ethErrors}});const l=ao();Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return l.errorCodes}})}(bs)),bs}var Mu;function Bl(){if(Mu)return qt;Mu=1;var e=qt&&qt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(qt,"__esModule",{value:!0}),qt.JsonRpcEngine=void 0;const r=e(Qd()),n=e0();let t=class it extends r.default{constructor(){super(),this._middleware=[]}push(o){this._middleware.push(o)}handle(o,a){if(a&&typeof a!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(o)?a?this._handleBatch(o,a):this._handleBatch(o):a?this._handle(o,a):this._promiseHandle(o)}asMiddleware(){return async(o,a,d,g)=>{try{const[m,u,f]=await it._runAllMiddleware(o,a,this._middleware);return u?(await it._runReturnHandlers(f),g(m)):d(async s=>{try{await it._runReturnHandlers(f)}catch(p){return s(p)}return s()})}catch(m){return g(m)}}}async _handleBatch(o,a){try{const d=await Promise.all(o.map(this._promiseHandle.bind(this)));return a?a(null,d):d}catch(d){if(a)return a(d);throw d}}_promiseHandle(o){return new Promise(a=>{this._handle(o,(d,g)=>{a(g)})})}async _handle(o,a){if(!o||Array.isArray(o)||typeof o!="object"){const u=new n.EthereumRpcError(n.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof o}`,{request:o});return a(u,{id:void 0,jsonrpc:"2.0",error:u})}if(typeof o.method!="string"){const u=new n.EthereumRpcError(n.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof o.method}`,{request:o});return a(u,{id:o.id,jsonrpc:"2.0",error:u})}const d=Object.assign({},o),g={id:d.id,jsonrpc:d.jsonrpc};let m=null;try{await this._processRequest(d,g)}catch(u){m=u}return m&&(delete g.result,g.error||(g.error=n.serializeError(m))),a(m,g)}async _processRequest(o,a){const[d,g,m]=await it._runAllMiddleware(o,a,this._middleware);if(it._checkForCompletion(o,a,g),await it._runReturnHandlers(m),d)throw d}static async _runAllMiddleware(o,a,d){const g=[];let m=null,u=!1;for(const f of d)if([m,u]=await it._runMiddleware(o,a,f,g),u)break;return[m,u,g.reverse()]}static _runMiddleware(o,a,d,g){return new Promise(m=>{const u=s=>{const p=s||a.error;p&&(a.error=n.serializeError(p)),m([p,!0])},f=s=>{a.error?u(a.error):(s&&(typeof s!="function"&&u(new n.EthereumRpcError(n.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof s}" for request: +${l(o)}`,{request:o})),g.push(s)),m([null,!1]))};try{d(o,a,f,u)}catch(s){u(s)}})}static async _runReturnHandlers(o){for(const a of o)await new Promise((d,g)=>{a(m=>m?g(m):d())})}static _checkForCompletion(o,a,d){if(!("result"in a)&&!("error"in a))throw new n.EthereumRpcError(n.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request: +${l(o)}`,{request:o});if(!d)throw new n.EthereumRpcError(n.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request: +${l(o)}`,{request:o})}};qt.JsonRpcEngine=t;function l(i){return JSON.stringify(i,null,2)}return qt}var $r={},ku;function t0(){if(ku)return $r;ku=1,Object.defineProperty($r,"__esModule",{value:!0}),$r.mergeMiddleware=void 0;const e=Bl();function r(n){const t=new e.JsonRpcEngine;return n.forEach(l=>t.push(l)),t.asMiddleware()}return $r.mergeMiddleware=r,$r}var Cu;function Nl(){return Cu||(Cu=1,function(e){var r=Dt&&Dt.__createBinding||(Object.create?function(t,l,i,o){o===void 0&&(o=i),Object.defineProperty(t,o,{enumerable:!0,get:function(){return l[i]}})}:function(t,l,i,o){o===void 0&&(o=i),t[o]=l[i]}),n=Dt&&Dt.__exportStar||function(t,l){for(var i in t)i!=="default"&&!Object.prototype.hasOwnProperty.call(l,i)&&r(l,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(Gd(),e),n(Zd(),e),n(Kd(),e),n(Ll(),e),n(Bl(),e),n(t0(),e)}(Dt)),Dt}var Rs={},hn={},Fs=function(e,r){return Fs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&(n[l]=t[l])},Fs(e,r)};function Ol(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");Fs(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}var pn=function(){return pn=Object.assign||function(r){for(var n,t=1,l=arguments.length;t=0;a--)(o=e[a])&&(i=(l<3?o(i):l>3?o(r,n,i):o(r,n))||i);return l>3&&i&&Object.defineProperty(r,n,i),i}function Dl(e,r){return function(n,t){r(n,t,e)}}function ql(e,r,n,t,l,i){function o(c){if(c!==void 0&&typeof c!="function")throw new TypeError("Function expected");return c}for(var a=t.kind,d=a==="getter"?"get":a==="setter"?"set":"value",g=!r&&e?t.static?e:e.prototype:null,m=r||(g?Object.getOwnPropertyDescriptor(g,t.name):{}),u,f=!1,s=n.length-1;s>=0;s--){var p={};for(var y in t)p[y]=y==="access"?{}:t[y];for(var y in t.access)p.access[y]=t.access[y];p.addInitializer=function(c){if(f)throw new TypeError("Cannot add initializers after decoration has completed");i.push(o(c||null))};var w=(0,n[s])(a==="accessor"?{get:m.get,set:m.set}:m[d],p);if(a==="accessor"){if(w===void 0)continue;if(w===null||typeof w!="object")throw new TypeError("Object expected");(u=o(w.get))&&(m.get=u),(u=o(w.set))&&(m.set=u),(u=o(w.init))&&l.unshift(u)}else(u=o(w))&&(a==="field"?l.unshift(u):m[d]=u)}g&&Object.defineProperty(g,t.name,m),f=!0}function jl(e,r,n){for(var t=arguments.length>2,l=0;l0&&i[i.length-1])&&(g[0]===6||g[0]===2)){n=0;continue}if(g[0]===3&&(!i||g[1]>i[0]&&g[1]=e.length&&(e=void 0),{value:e&&e[t++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function co(e,r){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var t=n.call(e),l,i=[],o;try{for(;(r===void 0||r-- >0)&&!(l=t.next()).done;)i.push(l.value)}catch(a){o={error:a}}finally{try{l&&!l.done&&(n=t.return)&&n.call(t)}finally{if(o)throw o.error}}return i}function Jl(){for(var e=[],r=0;r1||d(s,y)})},p&&(l[s]=p(l[s])))}function d(s,p){try{g(t[s](p))}catch(y){f(i[0][3],y)}}function g(s){s.value instanceof tr?Promise.resolve(s.value.v).then(m,u):f(i[0][2],s)}function m(s){d("next",s)}function u(s){d("throw",s)}function f(s,p){s(p),i.shift(),i.length&&d(i[0][0],i[0][1])}}function Ql(e){var r,n;return r={},t("next"),t("throw",function(l){throw l}),t("return"),r[Symbol.iterator]=function(){return this},r;function t(l,i){r[l]=e[l]?function(o){return(n=!n)?{value:tr(e[l](o)),done:!1}:i?i(o):o}:i}}function Yl(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=e[Symbol.asyncIterator],n;return r?r.call(e):(e=typeof gn=="function"?gn(e):e[Symbol.iterator](),n={},t("next"),t("throw"),t("return"),n[Symbol.asyncIterator]=function(){return this},n);function t(i){n[i]=e[i]&&function(o){return new Promise(function(a,d){o=e[i](o),l(a,d,o.done,o.value)})}}function l(i,o,a,d){Promise.resolve(d).then(function(g){i({value:g,done:a})},o)}}function Xl(e,r){return Object.defineProperty?Object.defineProperty(e,"raw",{value:r}):e.raw=r,e}var r0=Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r},Ds=function(e){return Ds=Object.getOwnPropertyNames||function(r){var n=[];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(n[n.length]=t);return n},Ds(e)};function eh(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=Ds(e),t=0;t1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var t=this._currentReleaser;this._currentReleaser=void 0,t()}},n.prototype._dispatch=function(){var t=this,l=this._queue.shift();if(l){var i=!1;this._currentReleaser=function(){i||(i=!0,t._value++,t._dispatch())},l([this._value--,this._currentReleaser])}},n}();return fn.default=r,fn}var xu;function o0(){if(xu)return hn;xu=1,Object.defineProperty(hn,"__esModule",{value:!0});var e=uo,r=ch(),n=function(){function t(){this._semaphore=new r.default(1)}return t.prototype.acquire=function(){return e.__awaiter(this,void 0,void 0,function(){var l,i;return e.__generator(this,function(o){switch(o.label){case 0:return[4,this._semaphore.acquire()];case 1:return l=o.sent(),i=l[1],[2,i]}})})},t.prototype.runExclusive=function(l){return this._semaphore.runExclusive(function(){return l()})},t.prototype.isLocked=function(){return this._semaphore.isLocked()},t.prototype.release=function(){this._semaphore.release()},t}();return hn.default=n,hn}var Ur={},Au;function a0(){if(Au)return Ur;Au=1,Object.defineProperty(Ur,"__esModule",{value:!0}),Ur.withTimeout=void 0;var e=uo;function r(n,t,l){var i=this;return l===void 0&&(l=new Error("timeout")),{acquire:function(){return new Promise(function(o,a){return e.__awaiter(i,void 0,void 0,function(){var d,g,m;return e.__generator(this,function(u){switch(u.label){case 0:return d=!1,setTimeout(function(){d=!0,a(l)},t),[4,n.acquire()];case 1:return g=u.sent(),d?(m=Array.isArray(g)?g[1]:g,m()):o(g),[2]}})})})},runExclusive:function(o){return e.__awaiter(this,void 0,void 0,function(){var a,d;return e.__generator(this,function(g){switch(g.label){case 0:a=function(){},g.label=1;case 1:return g.trys.push([1,,7,8]),[4,this.acquire()];case 2:return d=g.sent(),Array.isArray(d)?(a=d[1],[4,o(d[0])]):[3,4];case 3:return[2,g.sent()];case 4:return a=d,[4,o()];case 5:return[2,g.sent()];case 6:return[3,8];case 7:return a(),[7];case 8:return[2]}})})},release:function(){n.release()},isLocked:function(){return n.isLocked()}}}return Ur.withTimeout=r,Ur}var Lu;function c0(){return Lu||(Lu=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=e.Semaphore=e.Mutex=void 0;var r=o0();Object.defineProperty(e,"Mutex",{enumerable:!0,get:function(){return r.default}});var n=ch();Object.defineProperty(e,"Semaphore",{enumerable:!0,get:function(){return n.default}});var t=a0();Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return t.withTimeout}})}(Rs)),Rs}var Ss,Tu;function u0(){if(Tu)return Ss;Tu=1,Ss=r;var e=Object.prototype.hasOwnProperty;function r(){for(var n={},t=0;tfunction(...o){const a=t.promiseModule;return new a((d,g)=>{t.multiArgs?o.push((...u)=>{t.errorFirst?u[0]?g(u):(u.shift(),d(u)):d(u)}):t.errorFirst?o.push((u,f)=>{u?g(u):d(f)}):o.push(d),Reflect.apply(n,this===l?i:this,o)})},r=new WeakMap;return ks=(n,t)=>{t={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...t};const l=typeof n;if(!(n!==null&&(l==="object"||l==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${n===null?"null":l}\``);const i=(d,g)=>{let m=r.get(d);if(m||(m={},r.set(d,m)),g in m)return m[g];const u=w=>typeof w=="string"||typeof g=="symbol"?g===w:w.test(g),f=Reflect.getOwnPropertyDescriptor(d,g),s=f===void 0||f.writable||f.configurable,y=(t.include?t.include.some(u):!t.exclude.some(u))&&s;return m[g]=y,y},o=new WeakMap,a=new Proxy(n,{apply(d,g,m){const u=o.get(d);if(u)return Reflect.apply(u,g,m);const f=t.excludeMain?d:e(d,t,a,d);return o.set(d,f),Reflect.apply(f,g,m)},get(d,g){const m=d[g];if(!i(d,g)||m===Function.prototype[g])return m;const u=o.get(m);if(u)return u;if(typeof m=="function"){const f=e(m,t,a,d);return o.set(m,f),f}return m}});return a},ks}var Cs,Ou;function lo(){if(Ou)return Cs;Ou=1;const e=Zs().default;class r extends e{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(t){this.updates=this.updates.concat(t),t.forEach(l=>this.emit("update",l))}addInitialResults(t){}getChangesAndClear(){const t=this.updates;return this.updates=[],t}}return Cs=r,Cs}var Is,Pu;function f0(){if(Pu)return Is;Pu=1;const e=lo();class r extends e{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(t){this.allResults=this.allResults.concat(t),super.addResults(t)}addInitialResults(t){this.allResults=this.allResults.concat(t),super.addInitialResults(t)}getAllResults(){return this.allResults}}return Is=r,Is}var xs,Fu;function Gr(){if(Fu)return xs;Fu=1,xs={minBlockRef:e,maxBlockRef:r,sortBlockRefs:n,bnToHex:t,blockRefIsNumber:l,hexToInt:i,incrementHexInt:o,intToHex:a,unsafeRandomBytes:d};function e(...m){return n(m)[0]}function r(...m){const u=n(m);return u[u.length-1]}function n(m){return m.sort((u,f)=>u==="latest"||f==="earliest"?1:f==="latest"||u==="earliest"?-1:i(u)-i(f))}function t(m){return"0x"+m.toString(16)}function l(m){return m&&!["earliest","latest","pending"].includes(m)}function i(m){return m==null?m:Number.parseInt(m,16)}function o(m){if(m==null)return m;const u=i(m);return a(u+1)}function a(m){if(m==null)return m;let u=m.toString(16);return u.length%2&&(u="0"+u),"0x"+u}function d(m){let u="0x";for(let f=0;ff.toLowerCase()))}async initialize({currentBlock:m}){let u=this.params.fromBlock;["latest","pending"].includes(u)&&(u=m),u==="earliest"&&(u="0x0"),this.params.fromBlock=u;const f=o(this.params.toBlock,m),s=Object.assign({},this.params,{toBlock:f}),p=await this._fetchLogs(s);this.addInitialResults(p)}async update({oldBlock:m,newBlock:u}){const f=u;let s;m?s=i(m):s=u;const p=Object.assign({},this.params,{fromBlock:s,toBlock:f}),w=(await this._fetchLogs(p)).filter(c=>this.matchLog(c));this.addResults(w)}async _fetchLogs(m){return await r(f=>this.ethQuery.getLogs(m,f))()}matchLog(m){if(l(this.params.fromBlock)>=l(m.blockNumber)||a(this.params.toBlock)&&l(this.params.toBlock)<=l(m.blockNumber))return!1;const u=m.address&&m.address.toLowerCase();return this.params.address&&u&&!this.params.address.includes(u)?!1:this.params.topics.every((s,p)=>{let y=m.topics[p];if(!y)return!1;y=y.toLowerCase();let w=Array.isArray(s)?s:[s];return w.includes(null)?!0:(w=w.map(S=>S.toLowerCase()),w.includes(y))})}}return As=d,As}var Ls,qu;function ho(){if(qu)return Ls;qu=1,Ls=e;async function e({provider:i,fromBlock:o,toBlock:a}){o||(o=a);const d=r(o),m=r(a)-d+1,u=Array(m).fill().map((s,p)=>d+p).map(n);let f=await Promise.all(u.map(s=>l(i,"eth_getBlockByNumber",[s,!1])));return f=f.filter(s=>s!==null),f}function r(i){return i==null?i:Number.parseInt(i,16)}function n(i){return i==null?i:"0x"+i.toString(16)}function t(i,o){return new Promise((a,d)=>{i.sendAsync(o,(g,m)=>{g?d(g):m.error?d(m.error):m.result?a(m.result):d(new Error("Result was empty"))})})}async function l(i,o,a){for(let d=0;d<3;d++)try{return await t(i,{id:1,jsonrpc:"2.0",method:o,params:a})}catch(g){console.error(`provider.sendAsync failed: ${g.stack||g.message||g}`)}return null}return Ls}var Ts,ju;function p0(){if(ju)return Ts;ju=1;const e=lo(),r=ho(),{incrementHexInt:n}=Gr();class t extends e{constructor({provider:i,params:o}){super(),this.type="block",this.provider=i}async update({oldBlock:i,newBlock:o}){const a=o,d=n(i),m=(await r({provider:this.provider,fromBlock:d,toBlock:a})).map(u=>u.hash);this.addResults(m)}}return Ts=t,Ts}var Bs,$u;function g0(){if($u)return Bs;$u=1;const e=lo(),r=ho(),{incrementHexInt:n}=Gr();class t extends e{constructor({provider:i}){super(),this.type="tx",this.provider=i}async update({oldBlock:i}){const o=i,a=n(i),d=await r({provider:this.provider,fromBlock:a,toBlock:o}),g=[];for(const m of d)g.push(...m.transactions);this.addResults(g)}}return Bs=t,Bs}var Ns,Uu;function m0(){if(Uu)return Ns;Uu=1;const e=c0().Mutex,{createAsyncMiddleware:r,createScaffoldMiddleware:n}=Nl(),t=d0(),l=p0(),i=g0(),{intToHex:o,hexToInt:a}=Gr();Ns=d;function d({blockTracker:s,provider:p}){let y=0,w={};const c=new e,R=u({mutex:c}),S=n({eth_newFilter:R(g(C)),eth_newBlockFilter:R(g(T)),eth_newPendingTransactionFilter:R(g(N)),eth_uninstallFilter:R(m(Z)),eth_getFilterChanges:R(m(j)),eth_getFilterLogs:R(m(z))}),k=async({oldBlock:E,newBlock:M})=>{if(w.length===0)return;const I=await c.acquire();try{await Promise.all(f(w).map(async A=>{try{await A.update({oldBlock:E,newBlock:M})}catch(O){console.error(O)}}))}catch(A){console.error(A)}I()};return S.newLogFilter=C,S.newBlockFilter=T,S.newPendingTransactionFilter=N,S.uninstallFilter=Z,S.getFilterChanges=j,S.getFilterLogs=z,S.destroy=()=>{q()},S;async function C(E){const M=new t({provider:p,params:E});return await Q(M),M}async function T(){const E=new l({provider:p});return await Q(E),E}async function N(){const E=new i({provider:p});return await Q(E),E}async function j(E){const M=a(E),I=w[M];if(!I)throw new Error(`No filter for index "${M}"`);return I.getChangesAndClear()}async function z(E){const M=a(E),I=w[M];if(!I)throw new Error(`No filter for index "${M}"`);let A=[];return I.type==="log"&&(A=I.getAllResults()),A}async function Z(E){const M=a(E),A=!!w[M];return A&&await re(M),A}async function Q(E){const M=f(w).length,I=await s.getLatestBlock();await E.initialize({currentBlock:I}),y++,w[y]=E,E.id=y,E.idHex=o(y);const A=f(w).length;return h({prevFilterCount:M,newFilterCount:A}),y}async function re(E){const M=f(w).length;delete w[E];const I=f(w).length;h({prevFilterCount:M,newFilterCount:I})}async function q(){const E=f(w).length;w={},h({prevFilterCount:E,newFilterCount:0})}function h({prevFilterCount:E,newFilterCount:M}){if(E===0&&M>0){s.on("sync",k);return}if(E>0&&M===0){s.removeListener("sync",k);return}}}function g(s){return m(async(...p)=>{const y=await s(...p);return o(y.id)})}function m(s){return r(async(p,y)=>{const w=await s.apply(null,p.params);y.result=w})}function u({mutex:s}){return p=>async(y,w,c,R)=>{(await s.acquire())(),p(y,w,c,R)}}function f(s,p){const y=[];for(let w in s)y.push(s[w]);return y}return Ns}var Os,Hu;function v0(){if(Hu)return Os;Hu=1;const e=Zs().default,{createAsyncMiddleware:r,createScaffoldMiddleware:n}=Nl(),t=m0(),{unsafeRandomBytes:l,incrementHexInt:i}=Gr(),o=ho();Os=a;function a({blockTracker:g,provider:m}){const u={},f=t({blockTracker:g,provider:m});let s=!1;const p=new e,y=n({eth_subscribe:r(w),eth_unsubscribe:r(c)});return y.destroy=S,{events:p,middleware:y};async function w(k,C){if(s)throw new Error("SubscriptionManager - attempting to use after destroying");const T=k.params[0],N=l(16);let j;switch(T){case"newHeads":j=z({subId:N});break;case"logs":const Q=k.params[1],re=await f.newLogFilter(Q);j=Z({subId:N,filter:re});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${T}"`)}u[N]=j,C.result=N;return;function z({subId:Q}){const re={type:T,destroy:async()=>{g.removeListener("sync",re.update)},update:async({oldBlock:q,newBlock:h})=>{const E=h,M=i(q);(await o({provider:m,fromBlock:M,toBlock:E})).map(d).filter(O=>O!==null).forEach(O=>{R(Q,O)})}};return g.on("sync",re.update),re}function Z({subId:Q,filter:re}){return re.on("update",h=>R(Q,h)),{type:T,destroy:async()=>await f.uninstallFilter(re.idHex)}}}async function c(k,C){if(s)throw new Error("SubscriptionManager - attempting to use after destroying");const T=k.params[0],N=u[T];if(!N){C.result=!1;return}delete u[T],await N.destroy(),C.result=!0}function R(k,C){p.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:k,result:C}})}function S(){p.removeAllListeners();for(const k in u)u[k].destroy(),delete u[k];s=!0}}function d(g){return g==null?null:{hash:g.hash,parentHash:g.parentHash,sha3Uncles:g.sha3Uncles,miner:g.miner,stateRoot:g.stateRoot,transactionsRoot:g.transactionsRoot,receiptsRoot:g.receiptsRoot,logsBloom:g.logsBloom,difficulty:g.difficulty,number:g.number,gasLimit:g.gasLimit,gasUsed:g.gasUsed,nonce:g.nonce,mixHash:g.mixHash,timestamp:g.timestamp,extraData:g.extraData}}return Os}var Wu;function y0(){if(Wu)return Br;Wu=1,Object.defineProperty(Br,"__esModule",{value:!0}),Br.SubscriptionManager=void 0;const e=Jd(),r=v0(),n=()=>{};let t=class{constructor(i){const o=new e.PollingBlockTracker({provider:i,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:a,middleware:d}=r({blockTracker:o,provider:i});this.events=a,this.subscriptionMiddleware=d}async handleRequest(i){const o={};return await this.subscriptionMiddleware(i,o,n,n),o}destroy(){this.subscriptionMiddleware.destroy()}};return Br.SubscriptionManager=t,Br}var Vu;function qs(){if(Vu)return Rt;Vu=1;var e=Rt&&Rt.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.CoinbaseWalletProvider=void 0;const r=e(mn()),n=lh(),t=yn(),l=nt(),i=sl(),o=Vs(),a=zs(),d=Us(),g=e(vf()),m=Ws(),u=yf(),f=y0(),s="DefaultChainId",p="DefaultJsonRpcUrl";let y=class extends n.EventEmitter{constructor(c){var R,S;super(),this._filterPolyfill=new u.FilterPolyfill(this),this._subscriptionManager=new f.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=c.chainId,this._jsonRpcUrlFromOpts=c.jsonRpcUrl,this._overrideIsMetaMask=c.overrideIsMetaMask,this._relayProvider=c.relayProvider,this._storage=c.storage,this._relayEventManager=c.relayEventManager,this.diagnostic=c.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(R=c.overrideIsCoinbaseWallet)!==null&&R!==void 0?R:!0,this.isCoinbaseBrowser=(S=c.overrideIsCoinbaseBrowser)!==null&&S!==void 0?S:!1,this.qrUrl=c.qrUrl;const k=this.getChainId(),C=(0,l.prepend0x)(k.toString(16));this.emit("connect",{chainIdStr:C});const T=this._storage.getItem(o.LOCAL_STORAGE_ADDRESSES_KEY);if(T){const N=T.split(" ");N[0]!==""&&(this._addresses=N.map(j=>(0,l.ensureAddressString)(j)),this.emit("accountsChanged",N))}this._subscriptionManager.events.on("notification",N=>{this.emit("message",{type:N.method,data:N.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",N=>{var j;if(!(N.origin!==location.origin||N.source!==window)&&N.data.type==="walletLinkMessage"&&N.data.data.action==="dappChainSwitched"){const z=N.data.data.chainId,Z=(j=N.data.data.jsonRpcUrl)!==null&&j!==void 0?j:this.jsonRpcUrl;this.updateProviderInfo(Z,Number(z))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,l.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var c;return(c=this._storage.getItem(p))!==null&&c!==void 0?c:this._jsonRpcUrlFromOpts}set jsonRpcUrl(c){this._storage.setItem(p,c)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(c,R){this.isCoinbaseBrowser||(this._chainIdFromOpts=R,this._jsonRpcUrlFromOpts=c),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(c,R){this.jsonRpcUrl=c;const S=this.getChainId();this._storage.setItem(s,R.toString(10)),((0,l.ensureIntNumber)(R)!==S||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(c,R,S,k,C,T){const j=await(await this.initializeRelay()).watchAsset(c,R,S,k,C,T==null?void 0:T.toString()).promise;return(0,d.isErrorResponse)(j)?!1:!!j.result}async addEthereumChain(c,R,S,k,C,T){var N,j;if((0,l.ensureIntNumber)(c)===this.getChainId())return!1;const z=await this.initializeRelay(),Z=z.inlineAddEthereumChain(c.toString());!this._isAuthorized()&&!Z&&await z.requestEthereumAccounts().promise;const Q=await z.addEthereumChain(c.toString(),R,C,S,k,T).promise;return(0,d.isErrorResponse)(Q)?!1:(((N=Q.result)===null||N===void 0?void 0:N.isApproved)===!0&&this.updateProviderInfo(R[0],c),((j=Q.result)===null||j===void 0?void 0:j.isApproved)===!0)}async switchEthereumChain(c){const S=await(await this.initializeRelay()).switchEthereumChain(c.toString(10),this.selectedAddress||void 0).promise;if((0,d.isErrorResponse)(S)){if(!S.errorCode)return;throw S.errorCode===t.standardErrorCodes.provider.unsupportedChain?t.standardErrors.provider.unsupportedChain():t.standardErrors.provider.custom({message:S.errorMessage,code:S.errorCode})}const k=S.result;k.isApproved&&k.rpcUrl.length>0&&this.updateProviderInfo(k.rpcUrl,c)}setAppInfo(c,R){this.initializeRelay().then(S=>S.setAppInfo(c,R))}async enable(){var c;return(c=this.diagnostic)===null||c===void 0||c.log(m.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?a.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(c,R){try{const S=this._send(c,R);if(S instanceof Promise)return S.catch(k=>{throw(0,t.serializeError)(k,c)})}catch(S){throw(0,t.serializeError)(S,c)}}_send(c,R){if(typeof c=="string"){const k=c,C=Array.isArray(R)?R:R!==void 0?[R]:[],T={jsonrpc:"2.0",id:0,method:k,params:C};return this._sendRequestAsync(T).then(N=>N.result)}if(typeof R=="function"){const k=c,C=R;return this._sendAsync(k,C)}if(Array.isArray(c))return c.map(C=>this._sendRequest(C));const S=c;return this._sendRequest(S)}async sendAsync(c,R){try{return this._sendAsync(c,R).catch(S=>{throw(0,t.serializeError)(S,c)})}catch(S){return Promise.reject((0,t.serializeError)(S,c))}}async _sendAsync(c,R){if(typeof R!="function")throw new Error("callback is required");if(Array.isArray(c)){const k=R;this._sendMultipleRequestsAsync(c).then(C=>k(null,C)).catch(C=>k(C,null));return}const S=R;return this._sendRequestAsync(c).then(k=>S(null,k)).catch(k=>S(k,null))}async request(c){try{return this._request(c).catch(R=>{throw(0,t.serializeError)(R,c.method)})}catch(R){return Promise.reject((0,t.serializeError)(R,c.method))}}async _request(c){if(!c||typeof c!="object"||Array.isArray(c))throw t.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:c});const{method:R,params:S}=c;if(typeof R!="string"||R.length===0)throw t.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:c});if(S!==void 0&&!Array.isArray(S)&&(typeof S!="object"||S===null))throw t.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:c});const k=S===void 0?[]:S,C=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:R,params:k,jsonrpc:"2.0",id:C})).result}async scanQRCode(c){const S=await(await this.initializeRelay()).scanQRCode((0,l.ensureRegExpString)(c)).promise;if((0,d.isErrorResponse)(S))throw(0,t.serializeError)(S.errorMessage,"scanQRCode");if(typeof S.result!="string")throw(0,t.serializeError)("result was not a string","scanQRCode");return S.result}async genericRequest(c,R){const k=await(await this.initializeRelay()).genericRequest(c,R).promise;if((0,d.isErrorResponse)(k))throw(0,t.serializeError)(k.errorMessage,"generic");if(typeof k.result!="string")throw(0,t.serializeError)("result was not a string","generic");return k.result}async connectAndSignIn(c){var R;(R=this.diagnostic)===null||R===void 0||R.log(m.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?a.Session.hash(this._relay.session.id):void 0});let S;try{const C=await this.initializeRelay();if(!(C instanceof i.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(S=await C.connectAndSignIn(c).promise,(0,d.isErrorResponse)(S))throw new Error(S.errorMessage)}catch(C){throw typeof C.message=="string"&&C.message.match(/(denied|rejected)/i)?t.standardErrors.provider.userRejectedRequest("User denied account authorization"):C}if(!S.result)throw new Error("accounts received is empty");const{accounts:k}=S.result;return this._setAddresses(k),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),S.result}async selectProvider(c){const S=await(await this.initializeRelay()).selectProvider(c).promise;if((0,d.isErrorResponse)(S))throw(0,t.serializeError)(S.errorMessage,"selectProvider");if(typeof S.result!="string")throw(0,t.serializeError)("result was not a string","selectProvider");return S.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(c){const R={jsonrpc:"2.0",id:c.id},{method:S}=c;if(R.result=this._handleSynchronousMethods(c),R.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${S} synchronously without a callback. Please provide a callback parameter to call ${S} asynchronously.`);return R}_setAddresses(c,R){if(!Array.isArray(c))throw new Error("addresses is not an array");const S=c.map(k=>(0,l.ensureAddressString)(k));JSON.stringify(S)!==JSON.stringify(this._addresses)&&(this._addresses=S,this.emit("accountsChanged",this._addresses),this._storage.setItem(o.LOCAL_STORAGE_ADDRESSES_KEY,S.join(" ")))}_sendRequestAsync(c){return new Promise((R,S)=>{try{const k=this._handleSynchronousMethods(c);if(k!==void 0)return R({jsonrpc:"2.0",id:c.id,result:k});const C=this._handleAsynchronousFilterMethods(c);if(C!==void 0){C.then(N=>R(Object.assign(Object.assign({},N),{id:c.id}))).catch(N=>S(N));return}const T=this._handleSubscriptionMethods(c);if(T!==void 0){T.then(N=>R({jsonrpc:"2.0",id:c.id,result:N.result})).catch(N=>S(N));return}}catch(k){return S(k)}this._handleAsynchronousMethods(c).then(k=>k&&R(Object.assign(Object.assign({},k),{id:c.id}))).catch(k=>S(k))})}_sendMultipleRequestsAsync(c){return Promise.all(c.map(R=>this._sendRequestAsync(R)))}_handleSynchronousMethods(c){const{method:R}=c,S=c.params||[];switch(R){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(S);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(c){const{method:R}=c,S=c.params||[];switch(R){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(S);case"eth_ecRecover":return this._eth_ecRecover(S);case"personal_sign":return this._personal_sign(S);case"personal_ecRecover":return this._personal_ecRecover(S);case"eth_signTransaction":return this._eth_signTransaction(S);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(S);case"eth_sendTransaction":return this._eth_sendTransaction(S);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(S);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(S);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(S);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(S);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(S);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(S);case"wallet_watchAsset":return this._wallet_watchAsset(S)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(c,this.jsonRpcUrl).catch(C=>{var T;throw(C.code===t.standardErrorCodes.rpc.methodNotFound||C.code===t.standardErrorCodes.rpc.methodNotSupported)&&((T=this.diagnostic)===null||T===void 0||T.log(m.EVENTS.METHOD_NOT_IMPLEMENTED,{method:c.method,sessionIdHash:this._relay?a.Session.hash(this._relay.session.id):void 0})),C})}_handleAsynchronousFilterMethods(c){const{method:R}=c,S=c.params||[];switch(R){case"eth_newFilter":return this._eth_newFilter(S);case"eth_newBlockFilter":return this._eth_newBlockFilter();case"eth_newPendingTransactionFilter":return this._eth_newPendingTransactionFilter();case"eth_getFilterChanges":return this._eth_getFilterChanges(S);case"eth_getFilterLogs":return this._eth_getFilterLogs(S)}}_handleSubscriptionMethods(c){switch(c.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(c)}}_isKnownAddress(c){try{const R=(0,l.ensureAddressString)(c);return this._addresses.map(k=>(0,l.ensureAddressString)(k)).includes(R)}catch{}return!1}_ensureKnownAddress(c){var R;if(!this._isKnownAddress(c))throw(R=this.diagnostic)===null||R===void 0||R.log(m.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(c){const R=c.from?(0,l.ensureAddressString)(c.from):this.selectedAddress;if(!R)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(R);const S=c.to?(0,l.ensureAddressString)(c.to):null,k=c.value!=null?(0,l.ensureBN)(c.value):new r.default(0),C=c.data?(0,l.ensureBuffer)(c.data):Buffer.alloc(0),T=c.nonce!=null?(0,l.ensureIntNumber)(c.nonce):null,N=c.gasPrice!=null?(0,l.ensureBN)(c.gasPrice):null,j=c.maxFeePerGas!=null?(0,l.ensureBN)(c.maxFeePerGas):null,z=c.maxPriorityFeePerGas!=null?(0,l.ensureBN)(c.maxPriorityFeePerGas):null,Z=c.gas!=null?(0,l.ensureBN)(c.gas):null,Q=c.chainId?(0,l.ensureIntNumber)(c.chainId):this.getChainId();return{fromAddress:R,toAddress:S,weiValue:k,data:C,nonce:T,gasPriceInWei:N,maxFeePerGas:j,maxPriorityFeePerGas:z,gasLimit:Z,chainId:Q}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw t.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw t.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(c,R,S,k){this._ensureKnownAddress(R);try{const T=await(await this.initializeRelay()).signEthereumMessage(c,R,S,k).promise;if((0,d.isErrorResponse)(T))throw new Error(T.errorMessage);return{jsonrpc:"2.0",id:0,result:T.result}}catch(C){throw typeof C.message=="string"&&C.message.match(/(denied|rejected)/i)?t.standardErrors.provider.userRejectedRequest("User denied message signature"):C}}async _ethereumAddressFromSignedMessage(c,R,S){const C=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(c,R,S).promise;if((0,d.isErrorResponse)(C))throw new Error(C.errorMessage);return{jsonrpc:"2.0",id:0,result:C.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,l.hexStringFromIntNumber)(this.getChainId())}getChainId(){const c=this._storage.getItem(s);if(!c)return(0,l.ensureIntNumber)(this._chainIdFromOpts);const R=parseInt(c,10);return(0,l.ensureIntNumber)(R)}async _eth_requestAccounts(){var c;if((c=this.diagnostic)===null||c===void 0||c.log(m.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?a.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let R;try{if(R=await(await this.initializeRelay()).requestEthereumAccounts().promise,(0,d.isErrorResponse)(R))throw new Error(R.errorMessage)}catch(S){throw typeof S.message=="string"&&S.message.match(/(denied|rejected)/i)?t.standardErrors.provider.userRejectedRequest("User denied account authorization"):S}if(!R.result)throw new Error("accounts received is empty");return this._setAddresses(R.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(c){this._requireAuthorization();const R=(0,l.ensureAddressString)(c[0]),S=(0,l.ensureBuffer)(c[1]);return this._signEthereumMessage(S,R,!1)}_eth_ecRecover(c){const R=(0,l.ensureBuffer)(c[0]),S=(0,l.ensureBuffer)(c[1]);return this._ethereumAddressFromSignedMessage(R,S,!1)}_personal_sign(c){this._requireAuthorization();const R=(0,l.ensureBuffer)(c[0]),S=(0,l.ensureAddressString)(c[1]);return this._signEthereumMessage(R,S,!0)}_personal_ecRecover(c){const R=(0,l.ensureBuffer)(c[0]),S=(0,l.ensureBuffer)(c[1]);return this._ethereumAddressFromSignedMessage(R,S,!0)}async _eth_signTransaction(c){this._requireAuthorization();const R=this._prepareTransactionParams(c[0]||{});try{const k=await(await this.initializeRelay()).signEthereumTransaction(R).promise;if((0,d.isErrorResponse)(k))throw new Error(k.errorMessage);return{jsonrpc:"2.0",id:0,result:k.result}}catch(S){throw typeof S.message=="string"&&S.message.match(/(denied|rejected)/i)?t.standardErrors.provider.userRejectedRequest("User denied transaction signature"):S}}async _eth_sendRawTransaction(c){const R=(0,l.ensureBuffer)(c[0]),k=await(await this.initializeRelay()).submitEthereumTransaction(R,this.getChainId()).promise;if((0,d.isErrorResponse)(k))throw new Error(k.errorMessage);return{jsonrpc:"2.0",id:0,result:k.result}}async _eth_sendTransaction(c){this._requireAuthorization();const R=this._prepareTransactionParams(c[0]||{});try{const k=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(R).promise;if((0,d.isErrorResponse)(k))throw new Error(k.errorMessage);return{jsonrpc:"2.0",id:0,result:k.result}}catch(S){throw typeof S.message=="string"&&S.message.match(/(denied|rejected)/i)?t.standardErrors.provider.userRejectedRequest("User denied transaction signature"):S}}async _eth_signTypedData_v1(c){this._requireAuthorization();const R=(0,l.ensureParsedJSONObject)(c[0]),S=(0,l.ensureAddressString)(c[1]);this._ensureKnownAddress(S);const k=g.default.hashForSignTypedDataLegacy({data:R}),C=JSON.stringify(R,null,2);return this._signEthereumMessage(k,S,!1,C)}async _eth_signTypedData_v3(c){this._requireAuthorization();const R=(0,l.ensureAddressString)(c[0]),S=(0,l.ensureParsedJSONObject)(c[1]);this._ensureKnownAddress(R);const k=g.default.hashForSignTypedData_v3({data:S}),C=JSON.stringify(S,null,2);return this._signEthereumMessage(k,R,!1,C)}async _eth_signTypedData_v4(c){this._requireAuthorization();const R=(0,l.ensureAddressString)(c[0]),S=(0,l.ensureParsedJSONObject)(c[1]);this._ensureKnownAddress(R);const k=g.default.hashForSignTypedData_v4({data:S}),C=JSON.stringify(S,null,2);return this._signEthereumMessage(k,R,!1,C)}async _cbwallet_arbitrary(c){const R=c[0],S=c[1];if(typeof S!="string")throw new Error("parameter must be a string");if(typeof R!="object"||R===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(R,S)}}async _wallet_addEthereumChain(c){var R,S,k,C;const T=c[0];if(((R=T.rpcUrls)===null||R===void 0?void 0:R.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!T.chainName||T.chainName.trim()==="")throw t.standardErrors.rpc.invalidParams("chainName is a required field");if(!T.nativeCurrency)throw t.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const N=parseInt(T.chainId,16);return await this.addEthereumChain(N,(S=T.rpcUrls)!==null&&S!==void 0?S:[],(k=T.blockExplorerUrls)!==null&&k!==void 0?k:[],T.chainName,(C=T.iconUrls)!==null&&C!==void 0?C:[],T.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(c){const R=c[0];return await this.switchEthereumChain(parseInt(R.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(c){const R=Array.isArray(c)?c[0]:c;if(!R.type)throw t.standardErrors.rpc.invalidParams("Type is required");if((R==null?void 0:R.type)!=="ERC20")throw t.standardErrors.rpc.invalidParams(`Asset of type '${R.type}' is not supported`);if(!(R!=null&&R.options))throw t.standardErrors.rpc.invalidParams("Options are required");if(!(R!=null&&R.options.address))throw t.standardErrors.rpc.invalidParams("Address is required");const S=this.getChainId(),{address:k,symbol:C,image:T,decimals:N}=R.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(R.type,k,C,N,T,S)}}_eth_uninstallFilter(c){const R=(0,l.ensureHexString)(c[0]);return this._filterPolyfill.uninstallFilter(R)}async _eth_newFilter(c){const R=c[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(R)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(c){const R=(0,l.ensureHexString)(c[0]);return this._filterPolyfill.getFilterChanges(R)}_eth_getFilterLogs(c){const R=(0,l.ensureHexString)(c[0]);return this._filterPolyfill.getFilterLogs(R)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(c=>(c.setAccountsCallback((R,S)=>this._setAddresses(R,S)),c.setChainCallback((R,S)=>{this.updateProviderInfo(S,parseInt(R,10))}),c.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=c,c))}};return Rt.CoinbaseWalletProvider=y,Rt}var Hr={},zu;function w0(){if(zu)return Hr;zu=1,Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.RelayEventManager=void 0;const e=nt();let r=class{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,l=(0,e.prepend0x)(t.toString(16));return this.callbacks.get(l)&&this.callbacks.delete(l),t}};return Hr.RelayEventManager=r,Hr}var Ju;function Gu(){if(Ju)return ar;Ju=1,Object.defineProperty(ar,"__esModule",{value:!0}),ar.CoinbaseWalletSDK=void 0;const e=gh(),r=mh(),n=nt(),t=Eh(),l=qs(),i=sl(),o=il(),a=w0(),d=rl(),g=nl(),m=Hs();let u=class uh{constructor(s){var p,y,w;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const c=s.linkAPIUrl||r.LINK_API_URL;typeof s.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=s.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(p=s.overrideIsCoinbaseWallet)!==null&&p!==void 0?p:!0,this._overrideIsCoinbaseBrowser=(y=s.overrideIsCoinbaseBrowser)!==null&&y!==void 0?y:!1,this._diagnosticLogger=s.diagnosticLogger,this._reloadOnDisconnect=(w=s.reloadOnDisconnect)!==null&&w!==void 0?w:!0;const R=new URL(c),S=`${R.protocol}//${R.host}`;if(this._storage=new t.ScopedLocalStorage(`-walletlink:${S}`),this._storage.setItem("version",uh.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new a.RelayEventManager;const k=(0,n.isMobileWeb)(),C=s.uiConstructor||(N=>k?new o.MobileRelayUI(N):new d.WalletLinkRelayUI(N)),T={linkAPIUrl:c,version:m.LIB_VERSION,darkMode:!!s.darkMode,headlessMode:!!s.headlessMode,uiConstructor:C,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:s.enableMobileWalletLink};this._relay=k?new i.MobileRelay(T):new g.WalletLinkRelay(T),this.setAppInfo(s.appName,s.appLogoUrl),!s.headlessMode&&this._relay.attachUI()}makeWeb3Provider(s="",p=1){const y=this.walletExtension;if(y)return this.isCipherProvider(y)||y.setProviderInfo(s,p),this._reloadOnDisconnect===!1&&typeof y.disableReloadOnDisconnect=="function"&&y.disableReloadOnDisconnect(),y;const w=this.coinbaseBrowser;if(w)return w;const c=this._relay;if(!c||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return s||c.setConnectDisabled(!0),new l.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(c),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:s,chainId:p,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(s,p){var y;this._appName=s||"DApp",this._appLogoUrl=p||(0,n.getFavicon)();const w=this.walletExtension;w?this.isCipherProvider(w)||w.setAppInfo(this._appName,this._appLogoUrl):(y=this._relay)===null||y===void 0||y.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var s;const p=this===null||this===void 0?void 0:this.walletExtension;p?p.close():(s=this._relay)===null||s===void 0||s.resetAndReload()}getQrUrl(){var s,p;return(p=(s=this._relay)===null||s===void 0?void 0:s.getQRCodeUrl())!==null&&p!==void 0?p:null}getCoinbaseWalletLogo(s,p=240){return(0,e.walletLogo)(s,p)}get walletExtension(){var s;return(s=window.coinbaseWalletExtension)!==null&&s!==void 0?s:window.walletLinkExtension}get coinbaseBrowser(){var s,p;try{const y=(s=window.ethereum)!==null&&s!==void 0?s:(p=window.top)===null||p===void 0?void 0:p.ethereum;return y&&"isCoinbaseBrowser"in y&&y.isCoinbaseBrowser?y:void 0}catch{return}}isCipherProvider(s){return typeof s.isCipher=="boolean"&&s.isCipher}};return ar.CoinbaseWalletSDK=u,u.VERSION=m.LIB_VERSION,ar}var Zu;function b0(){return Zu||(Zu=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletProvider=e.CoinbaseWalletSDK=void 0;const r=Gu(),n=qs();var t=Gu();Object.defineProperty(e,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return t.CoinbaseWalletSDK}});var l=qs();Object.defineProperty(e,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return l.CoinbaseWalletProvider}}),e.default=r.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=r.CoinbaseWalletSDK,window.CoinbaseWalletProvider=n.CoinbaseWalletProvider,window.WalletLink=r.CoinbaseWalletSDK,window.WalletLinkProvider=n.CoinbaseWalletProvider)}(Nn)),Nn}var _0=b0();const E0=hh(_0),V0=Object.freeze(Object.defineProperty({__proto__:null,default:E0},Symbol.toStringTag,{value:"Module"}));export{V0 as i}; diff --git a/create-onchain/src/manifest/assets/index-TwqOwjr2.js b/create-onchain/src/manifest/assets/index-TwqOwjr2.js new file mode 100644 index 0000000000..386dd1cc92 --- /dev/null +++ b/create-onchain/src/manifest/assets/index-TwqOwjr2.js @@ -0,0 +1,272 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BB3bVYbY.js","assets/hooks.module-DVREuRDX.js","assets/index-BSvUHPor.js","assets/browser-0t0YC0rb.js","assets/metamask-sdk-DfnqKdXK.js"])))=>i.map(i=>d[i]); +var Lw=e=>{throw TypeError(e)};var bp=(e,t,n)=>t.has(e)||Lw("Cannot "+n);var ne=(e,t,n)=>(bp(e,t,"read from private field"),n?n.call(e):t.get(e)),$e=(e,t,n)=>t.has(e)?Lw("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ze=(e,t,n,i)=>(bp(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n),wt=(e,t,n)=>(bp(e,t,"access private method"),n);var q1=(e,t,n,i)=>({set _(s){ze(e,t,s,n)},get _(){return ne(e,t,i)}});function xE(e,t){for(var n=0;ni[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&i(c)}).observe(document,{childList:!0,subtree:!0});function n(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=n(s);fetch(s.href,l)}})();var J1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function e1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function xz(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function i(){return this instanceof i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:function(){return e[i]}})}),n}var mp={exports:{}},e0={};/** + * @license React + * react-jsx-runtime.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Uw;function EE(){if(Uw)return e0;Uw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(i,s,l){var c=null;if(l!==void 0&&(c=""+l),s.key!==void 0&&(c=""+s.key),"key"in s){l={};for(var f in s)f!=="key"&&(l[f]=s[f])}else l=s;return s=l.ref,{$$typeof:e,type:i,key:c,ref:s!==void 0?s:null,props:l}}return e0.Fragment=t,e0.jsx=n,e0.jsxs=n,e0}var Fw;function CE(){return Fw||(Fw=1,mp.exports=EE()),mp.exports}var D=CE(),vp={exports:{}},gt={};/** + * @license React + * react.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var zw;function SE(){if(zw)return gt;zw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),w=Symbol.iterator;function x(P){return P===null||typeof P!="object"?null:(P=w&&P[w]||P["@@iterator"],typeof P=="function"?P:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,T={};function R(P,Z,Ie){this.props=P,this.context=Z,this.refs=T,this.updater=Ie||S}R.prototype.isReactComponent={},R.prototype.setState=function(P,Z){if(typeof P!="object"&&typeof P!="function"&&P!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,P,Z,"setState")},R.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function k(){}k.prototype=R.prototype;function F(P,Z,Ie){this.props=P,this.context=Z,this.refs=T,this.updater=Ie||S}var U=F.prototype=new k;U.constructor=F,O(U,R.prototype),U.isPureReactComponent=!0;var j=Array.isArray,z={H:null,A:null,T:null,S:null},H=Object.prototype.hasOwnProperty;function V(P,Z,Ie,De,we,Pe){return Ie=Pe.ref,{$$typeof:e,type:P,key:Z,ref:Ie!==void 0?Ie:null,props:Pe}}function K(P,Z){return V(P.type,Z,void 0,void 0,void 0,P.props)}function Q(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function le(P){var Z={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(Ie){return Z[Ie]})}var ue=/\/+/g;function ae(P,Z){return typeof P=="object"&&P!==null&&P.key!=null?le(""+P.key):Z.toString(36)}function me(){}function ce(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(me,me):(P.status="pending",P.then(function(Z){P.status==="pending"&&(P.status="fulfilled",P.value=Z)},function(Z){P.status==="pending"&&(P.status="rejected",P.reason=Z)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function W(P,Z,Ie,De,we){var Pe=typeof P;(Pe==="undefined"||Pe==="boolean")&&(P=null);var Fe=!1;if(P===null)Fe=!0;else switch(Pe){case"bigint":case"string":case"number":Fe=!0;break;case"object":switch(P.$$typeof){case e:case t:Fe=!0;break;case m:return Fe=P._init,W(Fe(P._payload),Z,Ie,De,we)}}if(Fe)return we=we(P),Fe=De===""?"."+ae(P,0):De,j(we)?(Ie="",Fe!=null&&(Ie=Fe.replace(ue,"$&/")+"/"),W(we,Z,Ie,"",function(ut){return ut})):we!=null&&(Q(we)&&(we=K(we,Ie+(we.key==null||P&&P.key===we.key?"":(""+we.key).replace(ue,"$&/")+"/")+Fe)),Z.push(we)),1;Fe=0;var bt=De===""?".":De+":";if(j(P))for(var Xe=0;Xe>>1,P=L[pe];if(0>>1;pes(De,ge))wes(Pe,De)?(L[pe]=Pe,L[we]=ge,pe=we):(L[pe]=De,L[Ie]=ge,pe=Ie);else if(wes(Pe,ge))L[pe]=Pe,L[we]=ge,pe=we;else break e}}return te}function s(L,te){var ge=L.sortIndex-te.sortIndex;return ge!==0?ge:L.id-te.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var d=[],h=[],m=1,w=null,x=3,S=!1,O=!1,T=!1,R=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,F=typeof setImmediate<"u"?setImmediate:null;function U(L){for(var te=n(h);te!==null;){if(te.callback===null)i(h);else if(te.startTime<=L)i(h),te.sortIndex=te.expirationTime,t(d,te);else break;te=n(h)}}function j(L){if(T=!1,U(L),!O)if(n(d)!==null)O=!0,ce();else{var te=n(h);te!==null&&W(j,te.startTime-L)}}var z=!1,H=-1,V=5,K=-1;function Q(){return!(e.unstable_now()-KL&&Q());){var pe=w.callback;if(typeof pe=="function"){w.callback=null,x=w.priorityLevel;var P=pe(w.expirationTime<=L);if(L=e.unstable_now(),typeof P=="function"){w.callback=P,U(L),te=!0;break t}w===n(d)&&i(d),U(L)}else i(d);w=n(d)}if(w!==null)te=!0;else{var Z=n(h);Z!==null&&W(j,Z.startTime-L),te=!1}}break e}finally{w=null,x=ge,S=!1}te=void 0}}finally{te?ue():z=!1}}}var ue;if(typeof F=="function")ue=function(){F(le)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,me=ae.port2;ae.port1.onmessage=le,ue=function(){me.postMessage(null)}}else ue=function(){R(le,0)};function ce(){z||(z=!0,ue())}function W(L,te){H=R(function(){L(e.unstable_now())},te)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_continueExecution=function(){O||S||(O=!0,ce())},e.unstable_forceFrameRate=function(L){0>L||125pe?(L.sortIndex=ge,t(h,L),n(d)===null&&L===n(h)&&(T?(k(H),H=-1):T=!0,W(j,ge-pe))):(L.sortIndex=P,t(d,L),O||S||(O=!0,ce())),L},e.unstable_shouldYield=Q,e.unstable_wrapCallback=function(L){var te=x;return function(){var ge=x;x=te;try{return L.apply(this,arguments)}finally{x=ge}}}}(xp)),xp}var Qw;function RE(){return Qw||(Qw=1,Ap.exports=OE()),Ap.exports}var Ep={exports:{}},ni={};/** + * @license React + * react-dom.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var jw;function ME(){if(jw)return ni;jw=1;var e=uf();function t(d){var h="https://react.dev/errors/"+d;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ep.exports=ME(),Ep.exports}/** + * @license React + * react-dom-client.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Yw;function _E(){if(Yw)return t0;Yw=1;var e=RE(),t=uf(),n=Uy();function i(r){var a="https://react.dev/errors/"+r;if(1)":-1p||q[u]!==oe[p]){var Ee=` +`+q[u].replace(" at new "," at ");return r.displayName&&Ee.includes("")&&(Ee=Ee.replace("",r.displayName)),Ee}while(1<=u&&0<=p);break}}}finally{ce=!1,Error.prepareStackTrace=o}return(o=r?r.displayName||r.name:"")?me(o):""}function L(r){switch(r.tag){case 26:case 27:case 5:return me(r.type);case 16:return me("Lazy");case 13:return me("Suspense");case 19:return me("SuspenseList");case 0:case 15:return r=W(r.type,!1),r;case 11:return r=W(r.type.render,!1),r;case 1:return r=W(r.type,!0),r;default:return""}}function te(r){try{var a="";do a+=L(r),r=r.return;while(r);return a}catch(o){return` +Error generating stack: `+o.message+` +`+o.stack}}function ge(r){var a=r,o=r;if(r.alternate)for(;a.return;)a=a.return;else{r=a;do a=r,(a.flags&4098)!==0&&(o=a.return),r=a.return;while(r)}return a.tag===3?o:null}function pe(r){if(r.tag===13){var a=r.memoizedState;if(a===null&&(r=r.alternate,r!==null&&(a=r.memoizedState)),a!==null)return a.dehydrated}return null}function P(r){if(ge(r)!==r)throw Error(i(188))}function Z(r){var a=r.alternate;if(!a){if(a=ge(r),a===null)throw Error(i(188));return a!==r?null:r}for(var o=r,u=a;;){var p=o.return;if(p===null)break;var A=p.alternate;if(A===null){if(u=p.return,u!==null){o=u;continue}break}if(p.child===A.child){for(A=p.child;A;){if(A===o)return P(p),r;if(A===u)return P(p),a;A=A.sibling}throw Error(i(188))}if(o.return!==u.return)o=p,u=A;else{for(var N=!1,G=p.child;G;){if(G===o){N=!0,o=p,u=A;break}if(G===u){N=!0,u=p,o=A;break}G=G.sibling}if(!N){for(G=A.child;G;){if(G===o){N=!0,o=A,u=p;break}if(G===u){N=!0,u=A,o=p;break}G=G.sibling}if(!N)throw Error(i(189))}}if(o.alternate!==u)throw Error(i(190))}if(o.tag!==3)throw Error(i(188));return o.stateNode.current===o?r:a}function Ie(r){var a=r.tag;if(a===5||a===26||a===27||a===6)return r;for(r=r.child;r!==null;){if(a=Ie(r),a!==null)return a;r=r.sibling}return null}var De=Array.isArray,we=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Pe={pending:!1,data:null,method:null,action:null},Fe=[],bt=-1;function Xe(r){return{current:r}}function ut(r){0>bt||(r.current=Fe[bt],Fe[bt]=null,bt--)}function et(r,a){bt++,Fe[bt]=r.current,r.current=a}var vn=Xe(null),We=Xe(null),Ln=Xe(null),nr=Xe(null);function Dt(r,a){switch(et(Ln,a),et(We,r),et(vn,null),r=a.nodeType,r){case 9:case 11:a=(a=a.documentElement)&&(a=a.namespaceURI)?dw(a):0;break;default:if(r=r===8?a.parentNode:a,a=r.tagName,r=r.namespaceURI)r=dw(r),a=hw(r,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}ut(vn),et(vn,a)}function Bt(){ut(vn),ut(We),ut(Ln)}function Ct(r){r.memoizedState!==null&&et(nr,r);var a=vn.current,o=hw(a,r.type);a!==o&&(et(We,r),et(vn,o))}function oi(r){We.current===r&&(ut(vn),ut(We)),nr.current===r&&(ut(nr),Wh._currentValue=Pe)}var Zi=Object.prototype.hasOwnProperty,wn=e.unstable_scheduleCallback,Ke=e.unstable_cancelCallback,Vn=e.unstable_shouldYield,wi=e.unstable_requestPaint,Yn=e.unstable_now,Zn=e.unstable_getCurrentPriorityLevel,Sl=e.unstable_ImmediatePriority,Tl=e.unstable_UserBlockingPriority,Ai=e.unstable_NormalPriority,Yc=e.unstable_LowPriority,Wa=e.unstable_IdlePriority,Ka=e.log,rh=e.unstable_setDisableYieldValue,vs=null,Ot=null;function bf(r){if(Ot&&typeof Ot.onCommitFiberRoot=="function")try{Ot.onCommitFiberRoot(vs,r,void 0,(r.current.flags&128)===128)}catch{}}function Kt(r){if(typeof Ka=="function"&&rh(r),Ot&&typeof Ot.setStrictMode=="function")try{Ot.setStrictMode(vs,r)}catch{}}var yn=Math.clz32?Math.clz32:mf,Zc=Math.log,xi=Math.LN2;function mf(r){return r>>>=0,r===0?32:31-(Zc(r)/xi|0)|0}var yo=128,Ol=4194304;function pa(r){var a=r&42;if(a!==0)return a;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Rl(r,a){var o=r.pendingLanes;if(o===0)return 0;var u=0,p=r.suspendedLanes,A=r.pingedLanes,N=r.warmLanes;r=r.finishedLanes!==0;var G=o&134217727;return G!==0?(o=G&~p,o!==0?u=pa(o):(A&=G,A!==0?u=pa(A):r||(N=G&~N,N!==0&&(u=pa(N))))):(G=o&~p,G!==0?u=pa(G):A!==0?u=pa(A):r||(N=o&~N,N!==0&&(u=pa(N)))),u===0?0:a!==0&&a!==u&&(a&p)===0&&(p=u&-u,N=a&-a,p>=N||p===32&&(N&4194176)!==0)?a:u}function Ei(r,a){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&a)===0}function _n(r,a){switch(r){case 1:case 2:case 4:case 8:return a+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function rr(){var r=yo;return yo<<=1,(yo&4194176)===0&&(yo=128),r}function gr(){var r=Ol;return Ol<<=1,(Ol&62914560)===0&&(Ol=4194304),r}function go(r){for(var a=[],o=0;31>o;o++)a.push(r);return a}function ba(r,a){r.pendingLanes|=a,a!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Ft(r,a,o,u,p,A){var N=r.pendingLanes;r.pendingLanes=o,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=o,r.entangledLanes&=o,r.errorRecoveryDisabledLanes&=o,r.shellSuspendCounter=0;var G=r.entanglements,q=r.expirationTimes,oe=r.hiddenUpdates;for(o=N&~o;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_l=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),An={},Af={};function Nl(r){return Zi.call(Af,r)?!0:Zi.call(An,r)?!1:_l.test(r)?Af[r]=!0:(An[r]=!0,!1)}function xs(r,a,o){if(Nl(a))if(o===null)r.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":r.removeAttribute(a);return;case"boolean":var u=a.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){r.removeAttribute(a);return}}r.setAttribute(a,""+o)}}function Xn(r,a,o){if(o===null)r.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(a);return}r.setAttribute(a,""+o)}}function Or(r,a,o,u){if(u===null)r.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(o);return}r.setAttributeNS(a,o,""+u)}}function Rr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Jc(r){var a=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function xf(r){var a=Jc(r)?"checked":"value",o=Object.getOwnPropertyDescriptor(r.constructor.prototype,a),u=""+r[a];if(!r.hasOwnProperty(a)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var p=o.get,A=o.set;return Object.defineProperty(r,a,{configurable:!0,get:function(){return p.call(this)},set:function(N){u=""+N,A.call(this,N)}}),Object.defineProperty(r,a,{enumerable:o.enumerable}),{getValue:function(){return u},setValue:function(N){u=""+N},stopTracking:function(){r._valueTracker=null,delete r[a]}}}}function bo(r){r._valueTracker||(r._valueTracker=xf(r))}function Ki(r){if(!r)return!1;var a=r._valueTracker;if(!a)return!0;var o=a.getValue(),u="";return r&&(u=Jc(r)?r.checked?"true":"false":r.value),r=u,r!==o?(a.setValue(r),!0):!1}function mo(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var ah=/[\n"\\]/g;function br(r){return r.replace(ah,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function Es(r,a,o,u,p,A,N,G){r.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?r.type=N:r.removeAttribute("type"),a!=null?N==="number"?(a===0&&r.value===""||r.value!=a)&&(r.value=""+Rr(a)):r.value!==""+Rr(a)&&(r.value=""+Rr(a)):N!=="submit"&&N!=="reset"||r.removeAttribute("value"),a!=null?$c(r,N,Rr(a)):o!=null?$c(r,N,Rr(o)):u!=null&&r.removeAttribute("value"),p==null&&A!=null&&(r.defaultChecked=!!A),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),G!=null&&typeof G!="function"&&typeof G!="symbol"&&typeof G!="boolean"?r.name=""+Rr(G):r.removeAttribute("name")}function Ef(r,a,o,u,p,A,N,G){if(A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(r.type=A),a!=null||o!=null){if(!(A!=="submit"&&A!=="reset"||a!=null))return;o=o!=null?""+Rr(o):"",a=a!=null?""+Rr(a):o,G||a===r.value||(r.value=a),r.defaultValue=a}u=u??p,u=typeof u!="function"&&typeof u!="symbol"&&!!u,r.checked=G?r.checked:!!u,r.defaultChecked=!!u,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(r.name=N)}function $c(r,a,o){a==="number"&&mo(r.ownerDocument)===r||r.defaultValue===""+o||(r.defaultValue=""+o)}function qa(r,a,o,u){if(r=r.options,a){a={};for(var p=0;p=Ea),ou=" ",qr=!1;function lu(r,a){switch(r){case"keyup":return Kr.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Us(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var es=!1;function cu(r,a){switch(r){case"compositionend":return Us(a);case"keypress":return a.which!==32?null:(qr=!0,ou);case"textInput":return r=a.data,r===ou&&qr?null:r;default:return null}}function uu(r,a){if(es)return r==="compositionend"||!Ls&&lu(r,a)?(r=nu(),Xr=Ms=ir=null,es=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1=a)return{node:o,offset:a-r};r=u}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=ee(o)}}function ye(r,a){return r&&a?r===a?!0:r&&r.nodeType===3?!1:a&&a.nodeType===3?ye(r,a.parentNode):"contains"in r?r.contains(a):r.compareDocumentPosition?!!(r.compareDocumentPosition(a)&16):!1:!1}function Ce(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var a=mo(r.document);a instanceof r.HTMLIFrameElement;){try{var o=typeof a.contentWindow.location.href=="string"}catch{o=!1}if(o)r=a.contentWindow;else break;a=mo(r.document)}return a}function Le(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a&&(a==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||a==="textarea"||r.contentEditable==="true")}function Be(r,a){var o=Ce(a);a=r.focusedElem;var u=r.selectionRange;if(o!==a&&a&&a.ownerDocument&&ye(a.ownerDocument.documentElement,a)){if(u!==null&&Le(a)){if(r=u.start,o=u.end,o===void 0&&(o=r),"selectionStart"in a)a.selectionStart=r,a.selectionEnd=Math.min(o,a.value.length);else if(o=(r=a.ownerDocument||document)&&r.defaultView||window,o.getSelection){o=o.getSelection();var p=a.textContent.length,A=Math.min(u.start,p);u=u.end===void 0?A:Math.min(u.end,p),!o.extend&&A>u&&(p=u,u=A,A=p),p=de(a,A);var N=de(a,u);p&&N&&(o.rangeCount!==1||o.anchorNode!==p.node||o.anchorOffset!==p.offset||o.focusNode!==N.node||o.focusOffset!==N.offset)&&(r=r.createRange(),r.setStart(p.node,p.offset),o.removeAllRanges(),A>u?(o.addRange(r),o.extend(N.node,N.offset)):(r.setEnd(N.node,N.offset),o.addRange(r)))}}for(r=[],o=a;o=o.parentNode;)o.nodeType===1&&r.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a=document.documentMode,lt=null,He=null,Je=null,Lt=!1;function ht(r,a,o){var u=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Lt||lt==null||lt!==mo(u)||(u=lt,"selectionStart"in u&&Le(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Je&&X(Je,u)||(Je=u,u=P1(He,"onSelect"),0>=N,p-=N,gn=1<<32-yn(a)+p|o<tt?(Er=qe,qe=null):Er=qe.sibling;var Pt=be(fe,qe,he[tt],Se);if(Pt===null){qe===null&&(qe=Er);break}r&&qe&&Pt.alternate===null&&a(fe,qe),ie=A(Pt,ie,tt),Et===null?je=Pt:Et.sibling=Pt,Et=Pt,qe=Er}if(tt===he.length)return o(fe,qe),vt&&Bi(fe,tt),je;if(qe===null){for(;tttt?(Er=qe,qe=null):Er=qe.sibling;var Ac=be(fe,qe,Pt.value,Se);if(Ac===null){qe===null&&(qe=Er);break}r&&qe&&Ac.alternate===null&&a(fe,qe),ie=A(Ac,ie,tt),Et===null?je=Ac:Et.sibling=Ac,Et=Ac,qe=Er}if(Pt.done)return o(fe,qe),vt&&Bi(fe,tt),je;if(qe===null){for(;!Pt.done;tt++,Pt=he.next())Pt=_e(fe,Pt.value,Se),Pt!==null&&(ie=A(Pt,ie,tt),Et===null?je=Pt:Et.sibling=Pt,Et=Pt);return vt&&Bi(fe,tt),je}for(qe=u(qe);!Pt.done;tt++,Pt=he.next())Pt=Ae(qe,fe,tt,Pt.value,Se),Pt!==null&&(r&&Pt.alternate!==null&&qe.delete(Pt.key===null?tt:Pt.key),ie=A(Pt,ie,tt),Et===null?je=Pt:Et.sibling=Pt,Et=Pt);return r&&qe.forEach(function(AE){return a(fe,AE)}),vt&&Bi(fe,tt),je}function In(fe,ie,he,Se){if(typeof he=="object"&&he!==null&&he.type===d&&he.key===null&&(he=he.props.children),typeof he=="object"&&he!==null){switch(he.$$typeof){case c:e:{for(var je=he.key;ie!==null;){if(ie.key===je){if(je=he.type,je===d){if(ie.tag===7){o(fe,ie.sibling),Se=p(ie,he.props.children),Se.return=fe,fe=Se;break e}}else if(ie.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===F&&Io(je)===ie.type){o(fe,ie.sibling),Se=p(ie,he.props),Ui(Se,he),Se.return=fe,fe=Se;break e}o(fe,ie);break}else a(fe,ie);ie=ie.sibling}he.type===d?(Se=Mu(he.props.children,fe.mode,Se,he.key),Se.return=fe,fe=Se):(Se=T1(he.type,he.key,he.props,null,fe.mode,Se),Ui(Se,he),Se.return=fe,fe=Se)}return N(fe);case f:e:{for(je=he.key;ie!==null;){if(ie.key===je)if(ie.tag===4&&ie.stateNode.containerInfo===he.containerInfo&&ie.stateNode.implementation===he.implementation){o(fe,ie.sibling),Se=p(ie,he.children||[]),Se.return=fe,fe=Se;break e}else{o(fe,ie);break}else a(fe,ie);ie=ie.sibling}Se=Ig(he,fe.mode,Se),Se.return=fe,fe=Se}return N(fe);case F:return je=he._init,he=je(he._payload),In(fe,ie,he,Se)}if(De(he))return Ye(fe,ie,he,Se);if(H(he)){if(je=H(he),typeof je!="function")throw Error(i(150));return he=je.call(he),ft(fe,ie,he,Se)}if(typeof he.then=="function")return In(fe,ie,di(he),Se);if(he.$$typeof===S)return In(fe,ie,E1(fe,he),Se);aa(fe,he)}return typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint"?(he=""+he,ie!==null&&ie.tag===6?(o(fe,ie.sibling),Se=p(ie,he),Se.return=fe,fe=Se):(o(fe,ie),Se=Bg(he,fe.mode,Se),Se.return=fe,fe=Se),N(fe)):o(fe,ie)}return function(fe,ie,he,Se){try{bn=0;var je=In(fe,ie,he,Se);return fi=null,je}catch(qe){if(qe===Pi)throw qe;var Et=La(29,qe,null,fe.mode);return Et.lanes=Se,Et.return=fe,Et}finally{}}}var En=jl(!0),du=jl(!1),Lr=Xe(null),Ta=Xe(0);function ko(r,a){r=nl,et(Ta,r),et(Lr,a),nl=r|a.baseLanes}function Oa(){et(Ta,nl),et(Lr,Lr.current)}function Ra(){nl=Ta.current,ut(Lr),ut(Ta)}var Hn=Xe(null),Ur=null;function Fr(r){var a=r.alternate;et(Yt,Yt.current&1),et(Hn,r),Ur===null&&(a===null||Lr.current!==null||a.memoizedState!==null)&&(Ur=r)}function hi(r){if(r.tag===22){if(et(Yt,Yt.current),et(Hn,r),Ur===null){var a=r.alternate;a!==null&&a.memoizedState!==null&&(Ur=r)}}else qn()}function qn(){et(Yt,Yt.current),et(Hn,Hn.current)}function $r(r){ut(Hn),Ur===r&&(Ur=null),ut(Yt)}var Yt=Xe(0);function Ma(r){for(var a=r;a!==null;){if(a.tag===13){var o=a.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||o.data==="$!"))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var _a=typeof AbortController<"u"?AbortController:function(){var r=[],a=this.signal={aborted:!1,addEventListener:function(o,u){r.push(u)}};this.abort=function(){a.aborted=!0,r.forEach(function(o){return o()})}},hu=e.unstable_scheduleCallback,zr=e.unstable_NormalPriority,un={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Hr(){return{controller:new _a,data:new Map,refCount:0}}function ls(r){r.refCount--,r.refCount===0&&hu(zr,function(){r.controller.abort()})}var y=null,b=0,E=0,M=null;function I(r,a){if(y===null){var o=y=[];b=0,E=Wg(),M={status:"pending",value:void 0,then:function(u){o.push(u)}}}return b++,a.then(Y,Y),a}function Y(){if(--b===0&&y!==null){M!==null&&(M.status="fulfilled");var r=y;y=null,E=0,M=null;for(var a=0;aA?A:8;var N=Q.T,G={};Q.T=G,Lf(r,!1,a,o);try{var q=p(),oe=Q.S;if(oe!==null&&oe(G,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var Ee=$(q,u);Zs(r,a,Ee,da(r))}else Zs(r,a,u,da(r))}catch(_e){Zs(r,a,{then:function(){},status:"rejected",reason:_e},da())}finally{we.p=A,Q.T=N}}function kf(){}function zo(r,a,o,u){if(r.tag!==5)throw Error(i(476));var p=Ho(r).queue;cs(r,p,a,Pe,o===null?kf:function(){return wu(r),o(u)})}function Ho(r){var a=r.memoizedState;if(a!==null)return a;a={memoizedState:Pe,baseState:Pe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:Pe},next:null};var o={};return a.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:o},next:null},r.memoizedState=a,r=r.alternate,r!==null&&(r.memoizedState=a),a}function wu(r){var a=Ho(r).next.queue;Zs(r,a,{},da())}function rc(){return ti(Wh)}function Pf(){return Sn().memoizedState}function xh(){return Sn().memoizedState}function Eh(r){for(var a=r.return;a!==null;){switch(a.tag){case 24:case 3:var o=da();r=cc(o);var u=uc(a,r,o);u!==null&&(pi(u,a,o),Dh(u,a,o)),a={cache:Hr()},r.payload=a;return}a=a.return}}function A1(r,a,o){var u=da();o={lane:u,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null},Go(r)?Uf(a,o):(o=is(r,a,o,u),o!==null&&(pi(o,r,u),Ch(o,a,u)))}function Au(r,a,o){var u=da();Zs(r,a,o,u)}function Zs(r,a,o,u){var p={lane:u,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null};if(Go(r))Uf(a,p);else{var A=r.alternate;if(r.lanes===0&&(A===null||A.lanes===0)&&(A=a.lastRenderedReducer,A!==null))try{var N=a.lastRenderedState,G=A(N,o);if(p.hasEagerState=!0,p.eagerState=G,B(G,N))return rs(r,a,p,0),sn===null&&Ir(),!1}catch{}finally{}if(o=is(r,a,p,u),o!==null)return pi(o,r,u),Ch(o,a,u),!0}return!1}function Lf(r,a,o,u){if(u={lane:2,revertLane:Wg(),action:u,hasEagerState:!1,eagerState:null,next:null},Go(r)){if(a)throw Error(i(479))}else a=is(r,o,u,2),a!==null&&pi(a,r,2)}function Go(r){var a=r.alternate;return r===ke||a!==null&&a===ke}function Uf(r,a){$t=Jt=!0;var o=r.pending;o===null?a.next=a:(a.next=o.next,o.next=a),r.pending=a}function Ch(r,a,o){if((o&4194176)!==0){var u=a.lanes;u&=r.pendingLanes,o|=u,a.lanes=o,Xc(r,o)}}var oa={readContext:ti,use:gu,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useLayoutEffect:yt,useInsertionEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useSyncExternalStore:yt,useId:yt};oa.useCacheRefresh=yt,oa.useMemoCache=yt,oa.useHostTransitionStatus=yt,oa.useFormState=yt,oa.useActionState=yt,oa.useOptimistic=yt;var Ba={readContext:ti,use:gu,useCallback:function(r,a){return Gr().memoizedState=[r,a===void 0?null:a],r},useContext:ti,useEffect:bh,useImperativeHandle:function(r,a,o){o=o!=null?o.concat([r]):null,$l(4194308,4,vh.bind(null,a,r),o)},useLayoutEffect:function(r,a){return $l(4194308,4,r,a)},useInsertionEffect:function(r,a){$l(4,2,r,a)},useMemo:function(r,a){var o=Gr();a=a===void 0?null:a;var u=r();if(fn){Kt(!0);try{r()}finally{Kt(!1)}}return o.memoizedState=[u,a],u},useReducer:function(r,a,o){var u=Gr();if(o!==void 0){var p=o(a);if(fn){Kt(!0);try{o(a)}finally{Kt(!1)}}}else p=a;return u.memoizedState=u.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},u.queue=r,r=r.dispatch=A1.bind(null,ke,r),[u.memoizedState,r]},useRef:function(r){var a=Gr();return r={current:r},a.memoizedState=r},useState:function(r){r=Df(r);var a=r.queue,o=Au.bind(null,ke,a);return a.dispatch=o,[r.memoizedState,o]},useDebugValue:Fo,useDeferredValue:function(r,a){var o=Gr();return vu(o,r,a)},useTransition:function(){var r=Df(!1);return r=cs.bind(null,ke,r.queue,!0,!1),Gr().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,a,o){var u=ke,p=Gr();if(vt){if(o===void 0)throw Error(i(407));o=o()}else{if(o=a(),sn===null)throw Error(i(349));(Nt&60)!==0||uh(u,a,o)}p.memoizedState=o;var A={value:o,getSnapshot:a};return p.queue=A,bh(fh.bind(null,u,A,r),[r]),u.flags|=2048,yi(9,Zl.bind(null,u,A,o,a),{destroy:void 0},null),o},useId:function(){var r=Gr(),a=sn.identifierPrefix;if(vt){var o=Di,u=gn;o=(u&~(1<<32-yn(u)-1)).toString(32)+o,a=":"+a+"R"+o,o=Gt++,0 title"))),Qr(A,u,o),A[st]=r,Ht(A),u=A;break e;case"link":var N=Ew("link","href",p).get(u+(o.href||""));if(N){for(var G=0;G<\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof u.is=="string"?p.createElement("select",{is:u.is}):p.createElement("select"),u.multiple?r.multiple=!0:u.size&&(r.size=u.size);break;default:r=typeof u.is=="string"?p.createElement(o,{is:u.is}):p.createElement(o)}}r[st]=a,r[It]=u;e:for(p=a.child;p!==null;){if(p.tag===5||p.tag===6)r.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===a)break e;for(;p.sibling===null;){if(p.return===null||p.return===a)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}a.stateNode=r;e:switch(Qr(r,o,u),o){case"button":case"input":case"select":case"textarea":r=!!u.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&el(a)}}return On(a),a.flags&=-16777217,null;case 6:if(r&&a.stateNode!=null)r.memoizedProps!==u&&el(a);else{if(typeof u!="string"&&a.stateNode===null)throw Error(i(166));if(r=Ln.current,Ii(a)){if(r=a.stateNode,o=a.memoizedProps,u=null,p=nn,p!==null)switch(p.tag){case 27:case 5:u=p.memoizedProps}r[st]=a,r=!!(r.nodeValue===o||u!==null&&u.suppressHydrationWarning===!0||fw(r.nodeValue,o)),r||na(a)}else r=U1(r).createTextNode(u),r[st]=a,a.stateNode=r}return On(a),null;case 13:if(u=a.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=Ii(a),u!==null&&u.dehydrated!==null){if(r===null){if(!p)throw Error(i(318));if(p=a.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(i(317));p[st]=a}else ra(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;On(a),p=!1}else pn!==null&&(Gg(pn),pn=null),p=!0;if(!p)return a.flags&256?($r(a),a):($r(a),null)}if($r(a),(a.flags&128)!==0)return a.lanes=o,a;if(o=u!==null,r=r!==null&&r.memoizedState!==null,o){u=a.child,p=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(p=u.alternate.memoizedState.cachePool.pool);var A=null;u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(A=u.memoizedState.cachePool.pool),A!==p&&(u.flags|=2048)}return o!==r&&o&&(a.child.flags|=8192),O1(a,a.updateQueue),On(a),null;case 4:return Bt(),r===null&&$g(a.stateNode.containerInfo),On(a),null;case 10:return Ko(a.type),On(a),null;case 19:if(ut(Yt),p=a.memoizedState,p===null)return On(a),null;if(u=(a.flags&128)!==0,A=p.rendering,A===null)if(u)Fh(p,!1);else{if(Bn!==0||r!==null&&(r.flags&128)!==0)for(r=a.child;r!==null;){if(A=Ma(r),A!==null){for(a.flags|=128,Fh(p,!1),r=A.updateQueue,a.updateQueue=r,O1(a,r),a.subtreeFlags=0,r=o,o=a.child;o!==null;)Fv(o,r),o=o.sibling;return et(Yt,Yt.current&1|2),a.child}r=r.sibling}p.tail!==null&&Yn()>R1&&(a.flags|=128,u=!0,Fh(p,!1),a.lanes=4194304)}else{if(!u)if(r=Ma(A),r!==null){if(a.flags|=128,u=!0,r=r.updateQueue,a.updateQueue=r,O1(a,r),Fh(p,!0),p.tail===null&&p.tailMode==="hidden"&&!A.alternate&&!vt)return On(a),null}else 2*Yn()-p.renderingStartTime>R1&&o!==536870912&&(a.flags|=128,u=!0,Fh(p,!1),a.lanes=4194304);p.isBackwards?(A.sibling=a.child,a.child=A):(r=p.last,r!==null?r.sibling=A:a.child=A,p.last=A)}return p.tail!==null?(a=p.tail,p.rendering=a,p.tail=a.sibling,p.renderingStartTime=Yn(),a.sibling=null,r=Yt.current,et(Yt,u?r&1|2:r&1),a):(On(a),null);case 22:case 23:return $r(a),Ra(),u=a.memoizedState!==null,r!==null?r.memoizedState!==null!==u&&(a.flags|=8192):u&&(a.flags|=8192),u?(o&536870912)!==0&&(a.flags&128)===0&&(On(a),a.subtreeFlags&6&&(a.flags|=8192)):On(a),o=a.updateQueue,o!==null&&O1(a,o.retryQueue),o=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==o&&(a.flags|=2048),r!==null&&ut(re),null;case 24:return o=null,r!==null&&(o=r.memoizedState.cache),a.memoizedState.cache!==o&&(a.flags|=2048),Ko(un),On(a),null;case 25:return null}throw Error(i(156,a.tag))}function T7(r,a){switch(ui(a),a.tag){case 1:return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 3:return Ko(un),Bt(),r=a.flags,(r&65536)!==0&&(r&128)===0?(a.flags=r&-65537|128,a):null;case 26:case 27:case 5:return oi(a),null;case 13:if($r(a),r=a.memoizedState,r!==null&&r.dehydrated!==null){if(a.alternate===null)throw Error(i(340));ra()}return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 19:return ut(Yt),null;case 4:return Bt(),null;case 10:return Ko(a.type),null;case 22:case 23:return $r(a),Ra(),r!==null&&ut(re),r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 24:return Ko(un),null;case 25:return null;default:return null}}function Gv(r,a){switch(ui(a),a.tag){case 3:Ko(un),Bt();break;case 26:case 27:case 5:oi(a);break;case 4:Bt();break;case 13:$r(a);break;case 19:ut(Yt);break;case 10:Ko(a.type);break;case 22:case 23:$r(a),Ra(),r!==null&&ut(re);break;case 24:Ko(un)}}var O7={getCacheForType:function(r){var a=ti(un),o=a.data.get(r);return o===void 0&&(o=r(),a.data.set(r,o)),o}},R7=typeof WeakMap=="function"?WeakMap:Map,Rn=0,sn=null,St=null,Nt=0,on=0,fa=null,tl=!1,Wf=!1,kg=!1,nl=0,Bn=0,gc=0,_u=0,Pg=0,Ua=0,Kf=0,zh=null,qs=null,Lg=!1,Ug=0,R1=1/0,M1=null,pc=null,_1=!1,Nu=null,Hh=0,Fg=0,zg=null,Gh=0,Hg=null;function da(){if((Rn&2)!==0&&Nt!==0)return Nt&-Nt;if(Q.T!==null){var r=E;return r!==0?r:Wg()}return Wc()}function Qv(){Ua===0&&(Ua=(Nt&536870912)===0||vt?rr():536870912);var r=Hn.current;return r!==null&&(r.flags|=32),Ua}function pi(r,a,o){(r===sn&&on===2||r.cancelPendingCommit!==null)&&(qf(r,0),rl(r,Nt,Ua,!1)),ba(r,o),((Rn&2)===0||r!==sn)&&(r===sn&&((Rn&2)===0&&(_u|=o),Bn===4&&rl(r,Nt,Ua,!1)),Js(r))}function jv(r,a,o){if((Rn&6)!==0)throw Error(i(327));var u=!o&&(a&60)===0&&(a&r.expiredLanes)===0||Ei(r,a),p=u?N7(r,a):Vg(r,a,!0),A=u;do{if(p===0){Wf&&!u&&rl(r,a,0,!1);break}else if(p===6)rl(r,a,0,!tl);else{if(o=r.current.alternate,A&&!M7(o)){p=Vg(r,a,!1),A=!1;continue}if(p===2){if(A=a,r.errorRecoveryDisabledLanes&A)var N=0;else N=r.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){a=N;e:{var G=r;p=zh;var q=G.current.memoizedState.isDehydrated;if(q&&(qf(G,N).flags|=256),N=Vg(G,N,!1),N!==2){if(kg&&!q){G.errorRecoveryDisabledLanes|=A,_u|=A,p=4;break e}A=qs,qs=p,A!==null&&Gg(A)}p=N}if(A=!1,p!==2)continue}}if(p===1){qf(r,0),rl(r,a,0,!0);break}e:{switch(u=r,p){case 0:case 1:throw Error(i(345));case 4:if((a&4194176)===a){rl(u,a,Ua,!tl);break e}break;case 2:qs=null;break;case 3:case 5:break;default:throw Error(i(329))}if(u.finishedWork=o,u.finishedLanes=a,(a&62914560)===a&&(A=Ug+300-Yn(),10o?32:o,Q.T=null,Nu===null)var A=!1;else{o=zg,zg=null;var N=Nu,G=Hh;if(Nu=null,Hh=0,(Rn&6)!==0)throw Error(i(331));var q=Rn;if(Rn|=4,Lv(N.current),Iv(N,N.current,G,o),Rn=q,Qh(0,!1),Ot&&typeof Ot.onPostCommitFiberRoot=="function")try{Ot.onPostCommitFiberRoot(vs,N)}catch{}A=!0}return A}finally{we.p=p,Q.T=u,$v(r,a)}}return!1}function ew(r,a,o){a=Kn(o,a),a=Yo(r.stateNode,a,2),r=uc(r,a,2),r!==null&&(ba(r,2),Js(r))}function en(r,a,o){if(r.tag===3)ew(r,r,o);else for(;a!==null;){if(a.tag===3){ew(a,r,o);break}else if(a.tag===1){var u=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(pc===null||!pc.has(u))){r=Kn(o,r),o=Oh(2),u=uc(a,o,2),u!==null&&(ac(o,u,a,r),ba(u,2),Js(u));break}}a=a.return}}function Yg(r,a,o){var u=r.pingCache;if(u===null){u=r.pingCache=new R7;var p=new Set;u.set(a,p)}else p=u.get(a),p===void 0&&(p=new Set,u.set(a,p));p.has(o)||(kg=!0,p.add(o),r=I7.bind(null,r,a,o),a.then(r,r))}function I7(r,a,o){var u=r.pingCache;u!==null&&u.delete(a),r.pingedLanes|=r.suspendedLanes&o,r.warmLanes&=~o,sn===r&&(Nt&o)===o&&(Bn===4||Bn===3&&(Nt&62914560)===Nt&&300>Yn()-Ug?(Rn&2)===0&&qf(r,0):Pg|=o,Kf===Nt&&(Kf=0)),Js(r)}function tw(r,a){a===0&&(a=gr()),r=lr(r,a),r!==null&&(ba(r,a),Js(r))}function k7(r){var a=r.memoizedState,o=0;a!==null&&(o=a.retryLane),tw(r,o)}function P7(r,a){var o=0;switch(r.tag){case 13:var u=r.stateNode,p=r.memoizedState;p!==null&&(o=p.retryLane);break;case 19:u=r.stateNode;break;case 22:u=r.stateNode._retryCache;break;default:throw Error(i(314))}u!==null&&u.delete(a),tw(r,o)}function L7(r,a){return wn(r,a)}var B1=null,ed=null,Zg=!1,I1=!1,Xg=!1,Du=0;function Js(r){r!==ed&&r.next===null&&(ed===null?B1=ed=r:ed=ed.next=r),I1=!0,Zg||(Zg=!0,F7(U7))}function Qh(r,a){if(!Xg&&I1){Xg=!0;do for(var o=!1,u=B1;u!==null;){if(r!==0){var p=u.pendingLanes;if(p===0)var A=0;else{var N=u.suspendedLanes,G=u.pingedLanes;A=(1<<31-yn(42|r)+1)-1,A&=p&~(N&~G),A=A&201326677?A&201326677|1:A?A|2:0}A!==0&&(o=!0,iw(u,A))}else A=Nt,A=Rl(u,u===sn?A:0),(A&3)===0||Ei(u,A)||(o=!0,iw(u,A));u=u.next}while(o);Xg=!1}}function U7(){I1=Zg=!1;var r=0;Du!==0&&(Z7()&&(r=Du),Du=0);for(var a=Yn(),o=null,u=B1;u!==null;){var p=u.next,A=nw(u,a);A===0?(u.next=null,o===null?B1=p:o.next=p,p===null&&(ed=o)):(o=u,(r!==0||(A&3)!==0)&&(I1=!0)),u=p}Qh(r)}function nw(r,a){for(var o=r.suspendedLanes,u=r.pingedLanes,p=r.expirationTimes,A=r.pendingLanes&-62914561;0"u"?null:document;function vw(r,a,o){var u=nd;if(u&&typeof a=="string"&&a){var p=br(a);p='link[rel="'+r+'"][href="'+p+'"]',typeof o=="string"&&(p+='[crossorigin="'+o+'"]'),mw.has(p)||(mw.add(p),r={rel:r,crossOrigin:o,href:a},u.querySelector(p)===null&&(a=u.createElement("link"),Qr(a,"link",r),Ht(a),u.head.appendChild(a)))}}function tE(r){il.D(r),vw("dns-prefetch",r,null)}function nE(r,a){il.C(r,a),vw("preconnect",r,a)}function rE(r,a,o){il.L(r,a,o);var u=nd;if(u&&r&&a){var p='link[rel="preload"][as="'+br(a)+'"]';a==="image"&&o&&o.imageSrcSet?(p+='[imagesrcset="'+br(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(p+='[imagesizes="'+br(o.imageSizes)+'"]')):p+='[href="'+br(r)+'"]';var A=p;switch(a){case"style":A=rd(r);break;case"script":A=id(r)}Fa.has(A)||(r=le({rel:"preload",href:a==="image"&&o&&o.imageSrcSet?void 0:r,as:a},o),Fa.set(A,r),u.querySelector(p)!==null||a==="style"&&u.querySelector(Yh(A))||a==="script"&&u.querySelector(Zh(A))||(a=u.createElement("link"),Qr(a,"link",r),Ht(a),u.head.appendChild(a)))}}function iE(r,a){il.m(r,a);var o=nd;if(o&&r){var u=a&&typeof a.as=="string"?a.as:"script",p='link[rel="modulepreload"][as="'+br(u)+'"][href="'+br(r)+'"]',A=p;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":A=id(r)}if(!Fa.has(A)&&(r=le({rel:"modulepreload",href:r},a),Fa.set(A,r),o.querySelector(p)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Zh(A)))return}u=o.createElement("link"),Qr(u,"link",r),Ht(u),o.head.appendChild(u)}}}function aE(r,a,o){il.S(r,a,o);var u=nd;if(u&&r){var p=Wi(u).hoistableStyles,A=rd(r);a=a||"default";var N=p.get(A);if(!N){var G={loading:0,preload:null};if(N=u.querySelector(Yh(A)))G.loading=5;else{r=le({rel:"stylesheet",href:r,"data-precedence":a},o),(o=Fa.get(A))&&lp(r,o);var q=N=u.createElement("link");Ht(q),Qr(q,"link",r),q._p=new Promise(function(oe,Ee){q.onload=oe,q.onerror=Ee}),q.addEventListener("load",function(){G.loading|=1}),q.addEventListener("error",function(){G.loading|=2}),G.loading|=4,z1(N,a,u)}N={type:"stylesheet",instance:N,count:1,state:G},p.set(A,N)}}}function sE(r,a){il.X(r,a);var o=nd;if(o&&r){var u=Wi(o).hoistableScripts,p=id(r),A=u.get(p);A||(A=o.querySelector(Zh(p)),A||(r=le({src:r,async:!0},a),(a=Fa.get(p))&&cp(r,a),A=o.createElement("script"),Ht(A),Qr(A,"link",r),o.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},u.set(p,A))}}function oE(r,a){il.M(r,a);var o=nd;if(o&&r){var u=Wi(o).hoistableScripts,p=id(r),A=u.get(p);A||(A=o.querySelector(Zh(p)),A||(r=le({src:r,async:!0,type:"module"},a),(a=Fa.get(p))&&cp(r,a),A=o.createElement("script"),Ht(A),Qr(A,"link",r),o.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},u.set(p,A))}}function ww(r,a,o,u){var p=(p=Ln.current)?F1(p):null;if(!p)throw Error(i(446));switch(r){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(a=rd(o.href),o=Wi(p).hoistableStyles,u=o.get(a),u||(u={type:"style",instance:null,count:0,state:null},o.set(a,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){r=rd(o.href);var A=Wi(p).hoistableStyles,N=A.get(r);if(N||(p=p.ownerDocument||p,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},A.set(r,N),(A=p.querySelector(Yh(r)))&&!A._p&&(N.instance=A,N.state.loading=5),Fa.has(r)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Fa.set(r,o),A||lE(p,r,o,N.state))),a&&u===null)throw Error(i(528,""));return N}if(a&&u!==null)throw Error(i(529,""));return null;case"script":return a=o.async,o=o.src,typeof o=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=id(o),o=Wi(p).hoistableScripts,u=o.get(a),u||(u={type:"script",instance:null,count:0,state:null},o.set(a,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,r))}}function rd(r){return'href="'+br(r)+'"'}function Yh(r){return'link[rel="stylesheet"]['+r+"]"}function Aw(r){return le({},r,{"data-precedence":r.precedence,precedence:null})}function lE(r,a,o,u){r.querySelector('link[rel="preload"][as="style"]['+a+"]")?u.loading=1:(a=r.createElement("link"),u.preload=a,a.addEventListener("load",function(){return u.loading|=1}),a.addEventListener("error",function(){return u.loading|=2}),Qr(a,"link",o),Ht(a),r.head.appendChild(a))}function id(r){return'[src="'+br(r)+'"]'}function Zh(r){return"script[async]"+r}function xw(r,a,o){if(a.count++,a.instance===null)switch(a.type){case"style":var u=r.querySelector('style[data-href~="'+br(o.href)+'"]');if(u)return a.instance=u,Ht(u),u;var p=le({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return u=(r.ownerDocument||r).createElement("style"),Ht(u),Qr(u,"style",p),z1(u,o.precedence,r),a.instance=u;case"stylesheet":p=rd(o.href);var A=r.querySelector(Yh(p));if(A)return a.state.loading|=4,a.instance=A,Ht(A),A;u=Aw(o),(p=Fa.get(p))&&lp(u,p),A=(r.ownerDocument||r).createElement("link"),Ht(A);var N=A;return N._p=new Promise(function(G,q){N.onload=G,N.onerror=q}),Qr(A,"link",u),a.state.loading|=4,z1(A,o.precedence,r),a.instance=A;case"script":return A=id(o.src),(p=r.querySelector(Zh(A)))?(a.instance=p,Ht(p),p):(u=o,(p=Fa.get(A))&&(u=le({},o),cp(u,p)),r=r.ownerDocument||r,p=r.createElement("script"),Ht(p),Qr(p,"link",u),r.head.appendChild(p),a.instance=p);case"void":return null;default:throw Error(i(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(u=a.instance,a.state.loading|=4,z1(u,o.precedence,r));return a.instance}function z1(r,a,o){for(var u=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=u.length?u[u.length-1]:null,A=p,N=0;N title"):null)}function cE(r,a,o){if(o===1||a.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return r=a.disabled,typeof a.precedence=="string"&&r==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function Sw(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}var Xh=null;function uE(){}function fE(r,a,o){if(Xh===null)throw Error(i(475));var u=Xh;if(a.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var p=rd(o.href),A=r.querySelector(Yh(p));if(A){r=A._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(u.count++,u=G1.bind(u),r.then(u,u)),a.state.loading|=4,a.instance=A,Ht(A);return}A=r.ownerDocument||r,o=Aw(o),(p=Fa.get(p))&&lp(o,p),A=A.createElement("link"),Ht(A);var N=A;N._p=new Promise(function(G,q){N.onload=G,N.onerror=q}),Qr(A,"link",o),a.instance=A}u.stylesheets===null&&(u.stylesheets=new Map),u.stylesheets.set(a,r),(r=a.state.preload)&&(a.state.loading&3)===0&&(u.count++,a=G1.bind(u),r.addEventListener("load",a),r.addEventListener("error",a))}}function dE(){if(Xh===null)throw Error(i(475));var r=Xh;return r.stylesheets&&r.count===0&&up(r,r.stylesheets),0"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),wp.exports=_E(),wp.exports}var DE=NE();function fo(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}const y4="2.23.6";let n0={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${y4}`},Me=class Ib extends Error{constructor(t,n={}){var f;const i=(()=>{var d;return n.cause instanceof Ib?n.cause.details:(d=n.cause)!=null&&d.message?n.cause.message:n.details})(),s=n.cause instanceof Ib&&n.cause.docsPath||n.docsPath,l=(f=n0.getDocsUrl)==null?void 0:f.call(n0,{...n,docsPath:s}),c=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...l?[`Docs: ${l}`]:[],...i?[`Details: ${i}`]:[],...n0.version?[`Version: ${n0.version}`]:[]].join(` +`);super(c,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=i,this.docsPath=s,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=y4}walk(t){return g4(this,t)}};function g4(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?g4(e.cause,t):t?null:e}let p4=class extends Me{constructor({max:t,min:n,signed:i,size:s,value:l}){super(`Number "${l}" is not in safe ${s?`${s*8}-bit ${i?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}};class BE extends Me{constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class IE extends Me{constructor(t){super(`Hex value "${t}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}let kE=class extends Me{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}};function lo(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function Pn(e){return lo(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function ya(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,i=0;for(let s=0;sn*2)throw new m4({size:Math.ceil(i.length/2),targetSize:n,type:"hex"});return`0x${i[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function PE(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new m4({size:e.length,targetSize:n,type:"bytes"});const i=new Uint8Array(n);for(let s=0;st.toString(16).padStart(2,"0"));function rt(e,t={}){return typeof e=="number"||typeof e=="bigint"?Ze(e,t):typeof e=="string"?qu(e,t):typeof e=="boolean"?Ym(e,t):tr(e,t)}function Ym(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(Ya(n,{size:t.size}),yl(n,{size:t.size})):n}function tr(e,t={}){let n="";for(let s=0;sl||s=al.zero&&e<=al.nine)return e-al.zero;if(e>=al.A&&e<=al.F)return e-(al.A-10);if(e>=al.a&&e<=al.f)return e-(al.a-10)}function Qa(e,t={}){let n=e;t.size&&(Ya(n,{size:t.size}),n=yl(n,{dir:"right",size:t.size}));let i=n.slice(2);i.length%2&&(i=`0${i}`);const s=i.length/2,l=new Uint8Array(s);for(let c=0,f=0;ct)throw new kE({givenSize:Pn(e),maxSize:t})}function jr(e,t={}){const{signed:n}=t;t.size&&Ya(e,{size:t.size});const i=BigInt(e);if(!n)return i;const s=(e.length-2)/2,l=(1n<({exclude:n,format:s=>{const l=t(s);if(n)for(const c of n)delete l[c];return{...l,...i(s)}},type:e})}const w4={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function Fy(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?ms(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?ms(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?w4[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(t.authorizationList=jE(e.authorizationList)),t.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof t.v=="bigint"){if(t.v===0n||t.v===27n)return 0;if(t.v===1n||t.v===28n)return 1;if(t.v>=35n)return t.v%2n===0n?1:0}})(),t.type==="legacy"&&(delete t.accessList,delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,delete t.yParity),t.type==="eip2930"&&(delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),t.type==="eip1559"&&delete t.maxFeePerBlobGas,t}const QE=Zm("transaction",Fy);function jE(e){return e.map(t=>({contractAddress:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function Xm(e){const t=(e.transactions??[]).map(n=>typeof n=="string"?n:Fy(n));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:t,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const VE=Zm("block",Xm);function bl(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}const A4={"0x0":"reverted","0x1":"success"};function x4(e){const t={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(n=>bl(n)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?ms(e.transactionIndex):null,status:e.status?A4[e.status]:null,type:e.type?w4[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t}const YE=Zm("transactionReceipt",x4),ZE={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function t1(e){const t={};return typeof e.authorizationList<"u"&&(t.authorizationList=XE(e.authorizationList)),typeof e.accessList<"u"&&(t.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(t.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?t.blobs=e.blobs.map(n=>tr(n)):t.blobs=e.blobs),typeof e.data<"u"&&(t.data=e.data),typeof e.from<"u"&&(t.from=e.from),typeof e.gas<"u"&&(t.gas=Ze(e.gas)),typeof e.gasPrice<"u"&&(t.gasPrice=Ze(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(t.maxFeePerBlobGas=Ze(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(t.maxFeePerGas=Ze(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(t.maxPriorityFeePerGas=Ze(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(t.nonce=Ze(e.nonce)),typeof e.to<"u"&&(t.to=e.to),typeof e.type<"u"&&(t.type=ZE[e.type]),typeof e.value<"u"&&(t.value=Ze(e.value)),t}function XE(e){return e.map(t=>({address:t.contractAddress,r:t.r,s:t.s,chainId:Ze(t.chainId),nonce:Ze(t.nonce),...typeof t.yParity<"u"?{yParity:Ze(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:Ze(t.v)}:{}}))}const zy=2n**256n-1n;function ml(e){return typeof e[0]=="string"?Za(e):WE(e)}function WE(e){let t=0;for(const s of e)t+=s.length;const n=new Uint8Array(t);let i=0;for(const s of e)n.set(s,i),i+=s.length;return n}function Za(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}class Kw extends Me{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class E4 extends Me{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}}class KE extends Me{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}}const qE={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new KE({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new E4({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Kw({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new Kw({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function Wm(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(qE);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function Hc(e,t="hex"){const n=C4(e),i=Wm(new Uint8Array(n.length));return n.encode(i),t==="hex"?tr(i.bytes):i.bytes}function C4(e){return Array.isArray(e)?JE(e.map(t=>C4(t))):$E(e)}function JE(e){const t=e.reduce((s,l)=>s+l.length,0),n=S4(t);return{length:t<=55?1+t:1+n+t,encode(s){t<=55?s.pushByte(192+t):(s.pushByte(247+n),n===1?s.pushUint8(t):n===2?s.pushUint16(t):n===3?s.pushUint24(t):s.pushUint32(t));for(const{encode:l}of e)l(s)}}}function $E(e){const t=typeof e=="string"?Qa(e):e,n=S4(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(s){t.length===1&&t[0]<128?s.pushBytes(t):t.length<=55?(s.pushByte(128+t.length),s.pushBytes(t)):(s.pushByte(183+n),n===1?s.pushUint8(t.length):n===2?s.pushUint16(t.length):n===3?s.pushUint24(t.length):s.pushUint32(t.length),s.pushBytes(t))}}}function S4(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new Me("Length is too large.")}const e9={gwei:9,wei:18},t9={ether:-9,wei:9},n9={ether:-18,gwei:-9};function jd(e,t){let n=e.toString();const i=n.startsWith("-");i&&(n=n.slice(1)),n=n.padStart(t,"0");let[s,l]=[n.slice(0,n.length-t),n.slice(n.length-t)];return l=l.replace(/(0+)$/,""),`${i?"-":""}${s||"0"}${l?`.${l}`:""}`}function Km(e,t="wei"){return jd(e,e9[t])}function ji(e,t="wei"){return jd(e,t9[t])}function n1(e){const t=Object.entries(e).map(([i,s])=>s===void 0||s===!1?null:[i,s]).filter(Boolean),n=t.reduce((i,[s])=>Math.max(i,s.length),0);return t.map(([i,s])=>` ${`${i}:`.padEnd(n+1)} ${s}`).join(` +`)}class r9 extends Me{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(` +`),{name:"FeeConflictError"})}}class i9 extends Me{constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class a9 extends Me{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",n1(t),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class s9 extends Me{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${Math.floor((t.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}class o9 extends Me{constructor(t,{account:n,docsPath:i,chain:s,data:l,gas:c,gasPrice:f,maxFeePerGas:d,maxPriorityFeePerGas:h,nonce:m,to:w,value:x}){var O;const S=n1({chain:s&&`${s==null?void 0:s.name} (id: ${s==null?void 0:s.id})`,from:n==null?void 0:n.address,to:w,value:typeof x<"u"&&`${Km(x)} ${((O=s==null?void 0:s.nativeCurrency)==null?void 0:O.symbol)||"ETH"}`,data:l,gas:c,gasPrice:typeof f<"u"&&`${ji(f)} gwei`,maxFeePerGas:typeof d<"u"&&`${ji(d)} gwei`,maxPriorityFeePerGas:typeof h<"u"&&`${ji(h)} gwei`,nonce:m});super(t.shortMessage,{cause:t,docsPath:i,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",S].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class T4 extends Me{constructor({blockHash:t,blockNumber:n,blockTag:i,hash:s,index:l}){let c="Transaction";i&&l!==void 0&&(c=`Transaction at block time "${i}" at index "${l}"`),t&&l!==void 0&&(c=`Transaction at block hash "${t}" at index "${l}"`),n&&l!==void 0&&(c=`Transaction at block number "${n}" at index "${l}"`),s&&(c=`Transaction with hash "${s}"`),super(`${c} could not be found.`,{name:"TransactionNotFoundError"})}}class O4 extends Me{constructor({hash:t}){super(`Transaction receipt with hash "${t}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class l9 extends Me{constructor({hash:t}){super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}function qm(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),i=typeof e.blobs[0]=="string"?e.blobs.map(l=>Qa(l)):e.blobs,s=[];for(const l of i)s.push(Uint8Array.from(t.blobToKzgCommitment(l)));return n==="bytes"?s:s.map(l=>tr(l))}function Jm(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),i=typeof e.blobs[0]=="string"?e.blobs.map(c=>Qa(c)):e.blobs,s=typeof e.commitments[0]=="string"?e.commitments.map(c=>Qa(c)):e.commitments,l=[];for(let c=0;ctr(c))}function Ty(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function c9(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Vd(e,...t){if(!c9(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function u9(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Ty(e.outputLen),Ty(e.blockLen)}function Dd(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function R4(e,t){Vd(e);const n=t.outputLen;if(e.length>>t}const qw=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function d9(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function Jw(e){for(let t=0;tt.toString(16).padStart(2,"0"));function Oz(e){Vd(e);let t="";for(let n=0;ne().update(Hy(i)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function p9(e=32){if(ad&&typeof ad.getRandomValues=="function")return ad.getRandomValues(new Uint8Array(e));if(ad&&typeof ad.randomBytes=="function")return ad.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}function b9(e,t,n,i){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,i);const s=BigInt(32),l=BigInt(4294967295),c=Number(n>>s&l),f=Number(n&l),d=i?4:0,h=i?0:4;e.setUint32(t+d,c,i),e.setUint32(t+h,f,i)}function m9(e,t,n){return e&t^~e&n}function v9(e,t,n){return e&t^e&n^t&n}class w9 extends $m{constructor(t,n,i,s){super(),this.blockLen=t,this.outputLen=n,this.padOffset=i,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Cp(this.buffer)}update(t){Dd(this);const{view:n,buffer:i,blockLen:s}=this;t=Hy(t);const l=t.length;for(let c=0;cs-c&&(this.process(i,0),c=0);for(let w=c;wm.length)throw new Error("_sha2: outputLen bigger than state");for(let w=0;w>>3,T=$s(S,17)^$s(S,19)^S>>>10;Ec[w]=T+Ec[w-7]+O+Ec[w-16]|0}let{A:i,B:s,C:l,D:c,E:f,F:d,G:h,H:m}=this;for(let w=0;w<64;w++){const x=$s(f,6)^$s(f,11)^$s(f,25),S=m+x+m9(f,d,h)+A9[w]+Ec[w]|0,T=($s(i,2)^$s(i,13)^$s(i,22))+v9(i,s,l)|0;m=h,h=d,d=f,f=c+S|0,c=l,l=s,s=i,i=S+T|0}i=i+this.A|0,s=s+this.B|0,l=l+this.C|0,c=c+this.D|0,f=f+this.E|0,d=d+this.F|0,h=h+this.G|0,m=m+this.H|0,this.set(i,s,l,c,f,d,h,m)}roundClean(){Ec.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const _4=M4(()=>new x9);function N4(e,t){const n=t||"hex",i=_4(lo(e,{strict:!1})?Qd(e):e);return n==="bytes"?i:rt(i)}function E9(e){const{commitment:t,version:n=1}=e,i=e.to??(typeof t=="string"?"hex":"bytes"),s=N4(t,"bytes");return s.set([n],0),i==="bytes"?s:tr(s)}function D4(e){const{commitments:t,version:n}=e,i=e.to??(typeof t[0]=="string"?"hex":"bytes"),s=[];for(const l of t)s.push(E9({commitment:l,to:i,version:n}));return s}const $w=6,B4=32,e2=4096,I4=B4*e2,e6=I4*$w-1-1*e2*$w,k4=1;class C9 extends Me{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class P4 extends Me{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class S9 extends Me{constructor({hash:t,size:n}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${n}`],name:"InvalidVersionedHashSizeError"})}}class T9 extends Me{constructor({hash:t,version:n}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:[`Expected: ${k4}`,`Received: ${n}`],name:"InvalidVersionedHashVersionError"})}}function O9(e){const t=e.to??(typeof e.data=="string"?"hex":"bytes"),n=typeof e.data=="string"?Qa(e.data):e.data,i=Pn(n);if(!i)throw new P4;if(i>e6)throw new C9({maxSize:e6,size:i});const s=[];let l=!0,c=0;for(;l;){const f=Wm(new Uint8Array(I4));let d=0;for(;df.bytes):s.map(f=>tr(f.bytes))}function L4(e){const{data:t,kzg:n,to:i}=e,s=e.blobs??O9({data:t,to:i}),l=e.commitments??qm({blobs:s,kzg:n,to:i}),c=e.proofs??Jm({blobs:s,commitments:l,kzg:n,to:i}),f=[];for(let d=0;dt?[`- The contract "${i.name}" was not deployed until block ${i.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${i.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class M9 extends Me{constructor({chain:t,currentChainId:n}){super(`The current chain of the wallet (id: ${n}) does not match the target chain for the transaction (id: ${t.id} – ${t.name}).`,{metaMessages:[`Current Chain ID: ${n}`,`Expected Chain ID: ${t.id} – ${t.name}`],name:"ChainMismatchError"})}}class _9 extends Me{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(` +`),{name:"ChainNotFoundError"})}}class U4 extends Me{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}class Gy extends Me{constructor({chainId:t}){super(typeof t=="number"?`Chain ID "${t}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}class ud extends Me{constructor({cause:t,message:n}={}){var s;const i=(s=n==null?void 0:n.replace("execution reverted: ",""))==null?void 0:s.replace("execution reverted","");super(`Execution reverted ${i?`with reason: ${i}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty(ud,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(ud,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class Ju extends Me{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${ji(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(Ju,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class Pb extends Me{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${ji(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(Pb,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class Lb extends Me{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}}Object.defineProperty(Lb,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class Ub extends Me{constructor({cause:t,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(` +`),{cause:t,name:"NonceTooLowError"})}}Object.defineProperty(Ub,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class Fb extends Me{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}}Object.defineProperty(Fb,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class zb extends Me{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` +`),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(zb,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class Hb extends Me{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(Hb,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class Gb extends Me{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(Gb,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class Qb extends Me{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(Qb,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class T0 extends Me{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:i}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${ji(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${i?` = ${ji(i)} gwei`:""}).`].join(` +`),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(T0,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class r1 extends Me{constructor({cause:t}){super(`An error occurred while executing: ${t==null?void 0:t.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}let Qy=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const i=this.keys().next().value;i&&this.delete(i)}return this}};const $1=BigInt(2**32-1),t6=BigInt(32);function N9(e,t=!1){return t?{h:Number(e&$1),l:Number(e>>t6&$1)}:{h:Number(e>>t6&$1)|0,l:Number(e&$1)|0}}function D9(e,t=!1){let n=new Uint32Array(e.length),i=new Uint32Array(e.length);for(let s=0;se<>>32-n,I9=(e,t,n)=>t<>>32-n,k9=(e,t,n)=>t<>>64-n,P9=(e,t,n)=>e<>>64-n,F4=[],z4=[],H4=[],L9=BigInt(0),r0=BigInt(1),U9=BigInt(2),F9=BigInt(7),z9=BigInt(256),H9=BigInt(113);for(let e=0,t=r0,n=1,i=0;e<24;e++){[n,i]=[i,(2*n+3*i)%5],F4.push(2*(5*i+n)),z4.push((e+1)*(e+2)/2%64);let s=L9;for(let l=0;l<7;l++)t=(t<>F9)*H9)%z9,t&U9&&(s^=r0<<(r0<n>32?k9(e,t,n):B9(e,t,n),r6=(e,t,n)=>n>32?P9(e,t,n):I9(e,t,n);function j9(e,t=24){const n=new Uint32Array(10);for(let i=24-t;i<24;i++){for(let c=0;c<10;c++)n[c]=e[c]^e[c+10]^e[c+20]^e[c+30]^e[c+40];for(let c=0;c<10;c+=2){const f=(c+8)%10,d=(c+2)%10,h=n[d],m=n[d+1],w=n6(h,m,1)^n[f],x=r6(h,m,1)^n[f+1];for(let S=0;S<50;S+=10)e[c+S]^=w,e[c+S+1]^=x}let s=e[2],l=e[3];for(let c=0;c<24;c++){const f=z4[c],d=n6(s,l,f),h=r6(s,l,f),m=F4[c];s=e[m],l=e[m+1],e[m]=d,e[m+1]=h}for(let c=0;c<50;c+=10){for(let f=0;f<10;f++)n[f]=e[c+f];for(let f=0;f<10;f++)e[c+f]^=~n[(f+2)%10]&n[(f+4)%10]}e[0]^=G9[i],e[1]^=Q9[i]}n.fill(0)}class t2 extends $m{constructor(t,n,i,s=!1,l=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=i,this.enableXOF=s,this.rounds=l,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Ty(i),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=f9(this.state)}keccak(){qw||Jw(this.state32),j9(this.state32,this.rounds),qw||Jw(this.state32),this.posOut=0,this.pos=0}update(t){Dd(this);const{blockLen:n,state:i}=this;t=Hy(t);const s=t.length;for(let l=0;l=i&&this.keccak();const c=Math.min(i-this.posOut,l-s);t.set(n.subarray(this.posOut,this.posOut+c),s),this.posOut+=c,s+=c}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Ty(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(R4(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:i,outputLen:s,rounds:l,enableXOF:c}=this;return t||(t=new t2(n,i,s,c,l)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=l,t.suffix=i,t.outputLen=s,t.enableXOF=c,t.destroyed=this.destroyed,t}}const V9=(e,t,n)=>M4(()=>new t2(t,e,n)),G4=V9(1,136,256/8);function hr(e,t){const n=t||"hex",i=G4(lo(e,{strict:!1})?Qd(e):e);return n==="bytes"?i:rt(i)}const Sp=new Qy(8192);function jy(e,t){if(Sp.has(`${e}.${t}`))return Sp.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),i=hr(Xu(n),"bytes"),s=n.split("");for(let c=0;c<40;c+=2)i[c>>1]>>4>=8&&s[c]&&(s[c]=s[c].toUpperCase()),(i[c>>1]&15)>=8&&s[c+1]&&(s[c+1]=s[c+1].toUpperCase());const l=`0x${s.join("")}`;return Sp.set(`${e}.${t}`,l),l}function ii(e,t){if(!yr(e,{strict:!1}))throw new ai({address:e});return jy(e,t)}const Y9=/^0x[a-fA-F0-9]{40}$/,Tp=new Qy(8192);function yr(e,t){const{strict:n=!0}=t??{},i=`${e}.${n}`;if(Tp.has(i))return Tp.get(i);const s=Y9.test(e)?e.toLowerCase()===e?!0:n?jy(e)===e:!0:!1;return Tp.set(i,s),s}function O0(e,t,n,{strict:i}={}){return lo(e,{strict:!1})?Y4(e,t,n,{strict:i}):V4(e,t,n,{strict:i})}function Q4(e,t){if(typeof t=="number"&&t>0&&t>Pn(e)-1)throw new b4({offset:t,position:"start",size:Pn(e)})}function j4(e,t,n){if(typeof t=="number"&&typeof n=="number"&&Pn(e)!==n-t)throw new b4({offset:n,position:"end",size:Pn(e)})}function V4(e,t,n,{strict:i}={}){Q4(e,t);const s=e.slice(t,n);return i&&j4(s,t,n),s}function Y4(e,t,n,{strict:i}={}){Q4(e,t);const s=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return i&&j4(s,t,n),s}function Z9(e){const{authorizationList:t}=e;if(t)for(const n of t){const{contractAddress:i,chainId:s}=n;if(!yr(i))throw new ai({address:i});if(s<0)throw new Gy({chainId:s})}n2(e)}function X9(e){const{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new P4;for(const n of t){const i=Pn(n),s=ms(O0(n,0,1));if(i!==32)throw new S9({hash:n,size:i});if(s!==k4)throw new T9({hash:n,version:s})}}n2(e)}function n2(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:i,to:s}=e;if(t<=0)throw new Gy({chainId:t});if(s&&!yr(s))throw new ai({address:s});if(i&&i>zy)throw new Ju({maxFeePerGas:i});if(n&&i&&n>i)throw new T0({maxFeePerGas:i,maxPriorityFeePerGas:n})}function W9(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:i,maxFeePerGas:s,to:l}=e;if(t<=0)throw new Gy({chainId:t});if(l&&!yr(l))throw new ai({address:l});if(n||s)throw new Me("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(i&&i>zy)throw new Ju({maxFeePerGas:i})}function K9(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:i,maxFeePerGas:s,to:l}=e;if(l&&!yr(l))throw new ai({address:l});if(typeof t<"u"&&t<=0)throw new Gy({chainId:t});if(n||s)throw new Me("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(i&&i>zy)throw new Ju({maxFeePerGas:i})}function Z4(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new a9({transaction:e})}function Vy(e){if(!e||e.length===0)return[];const t=[];for(let n=0;n"u"||typeof S>"u")){const U=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(H=>tr(H)),j=e.kzg,z=qm({blobs:U,kzg:j});if(typeof x>"u"&&(x=D4({commitments:z})),typeof S>"u"){const H=Jm({blobs:U,commitments:z,kzg:j});S=L4({blobs:U,commitments:z,proofs:H})}}const O=Vy(m),T=[rt(n),s?rt(s):"0x",h?rt(h):"0x",d?rt(d):"0x",i?rt(i):"0x",l??"0x",c?rt(c):"0x",w??"0x",O,f?rt(f):"0x",x??[],...i1(e,t)],R=[],k=[],F=[];if(S)for(let U=0;U{if(t.v>=35n)return(t.v-35n)/2n>0?t.v:27n+(t.v===35n?0n:1n);if(n>0)return BigInt(n*2)+BigInt(35n+t.v-27n);const S=27n+(t.v===27n?0n:1n);if(t.v!==S)throw new i9({v:t.v});return S})(),w=ya(t.r),x=ya(t.s);h=[...h,rt(m),w==="0x00"?"0x":w,x==="0x00"?"0x":x]}else n>0&&(h=[...h,rt(n),"0x","0x"]);return Hc(h)}function i1(e,t){const n=t??e,{v:i,yParity:s}=n;if(typeof n.r>"u")return[];if(typeof n.s>"u")return[];if(typeof i>"u"&&typeof s>"u")return[];const l=ya(n.r),c=ya(n.s);return[typeof s=="number"?s?rt(1):"0x":i===0n?"0x":i===1n?rt(1):i===27n?"0x":rt(1),l==="0x00"?"0x":l,c==="0x00"?"0x":c]}const rC={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},iC={block:VE({format(e){var n;return{transactions:(n=e.transactions)==null?void 0:n.map(i=>{if(typeof i=="string")return i;const s=Fy(i);return s.typeHex==="0x7e"&&(s.isSystemTx=i.isSystemTx,s.mint=i.mint?jr(i.mint):void 0,s.sourceHash=i.sourceHash,s.type="deposit"),s}),stateRoot:e.stateRoot}}}),transaction:QE({format(e){const t={};return e.type==="0x7e"&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?jr(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:YE({format(e){return{l1GasPrice:e.l1GasPrice?jr(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?jr(e.l1GasUsed):null,l1Fee:e.l1Fee?jr(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null}}})};function aC(e,t){return lC(e)?oC(e):q9(e,t)}const sC={transaction:aC};function oC(e){cC(e);const{sourceHash:t,data:n,from:i,gas:s,isSystemTx:l,mint:c,to:f,value:d}=e,h=[t,i,f??"0x",c?rt(c):"0x",d?rt(d):"0x",s?rt(s):"0x",l?"0x1":"0x",n??"0x"];return Za(["0x7e",Hc(h)])}function lC(e){return e.type==="deposit"||typeof e.sourceHash<"u"}function cC(e){const{from:t,to:n}=e;if(t&&!yr(t))throw new ai({address:t});if(n&&!yr(n))throw new ai({address:n})}const Gc={contracts:rC,formatters:iC,serializers:sC},uC=fo({id:42161,name:"Arbitrum One",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://arbiscan.io",apiUrl:"https://api.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}}),fC=fo({id:421614,name:"Arbitrum Sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://sepolia.arbiscan.io",apiUrl:"https://api-sepolia.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:81930}},testnet:!0}),i0=1,Qn=fo({...Gc,id:8453,name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://basescan.org",apiUrl:"https://api.basescan.org/api"}},contracts:{...Gc.contracts,disputeGameFactory:{[i0]:{address:"0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e"}},l2OutputOracle:{[i0]:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{[i0]:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{[i0]:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:i0}),a0=11155111,vl=fo({...Gc,id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://sepolia.basescan.org",apiUrl:"https://api-sepolia.basescan.org/api"}},contracts:{...Gc.contracts,disputeGameFactory:{[a0]:{address:"0xd6E6dBf4F7EA0ac412fD8b65ED297e64BB7a06E1"}},l2OutputOracle:{[a0]:{address:"0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254"}},portal:{[a0]:{address:"0x49f53e41452c74589e85ca1677426ba426459e85",blockCreated:4446677}},l1StandardBridge:{[a0]:{address:"0xfd0Bf71F60660E2f608ed56e1659C450eB113120",blockCreated:4446677}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1059647}},testnet:!0,sourceId:a0});async function i6(e,{address:t,blockNumber:n,blockTag:i="latest"}){const s=n!==void 0?Ze(n):void 0,l=await e.request({method:"eth_getCode",params:[t,s||i]},{dedupe:!!s});if(l!=="0x")return l}function dC({chain:e,currentChainId:t}){if(!e)throw new _9;if(t!==e.id)throw new M9({chain:e,currentChainId:t})}function Yd({blockNumber:e,chain:t,contract:n}){var s;const i=(s=t==null?void 0:t.contracts)==null?void 0:s[n];if(!i)throw new kb({chain:t,contract:{name:n}});if(e&&i.blockCreated&&i.blockCreated>e)throw new kb({blockNumber:e,chain:t,contract:{name:n,blockCreated:i.blockCreated}});return i.address}function si(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}class Yy extends Me{constructor({docsPath:t}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(` +`),{docsPath:t,docsSlug:"account",name:"AccountNotFoundError"})}}class Op extends Me{constructor({docsPath:t,metaMessages:n,type:i}){super(`Account type "${i}" is not supported.`,{docsPath:t,metaMessages:n,name:"AccountTypeNotSupportedError"})}}const X4={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},hC={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},yC={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function wl(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new SC(e.type);return`${e.name}(${Zy(e.inputs,{includeName:t})})`}function Zy(e,{includeName:t=!1}={}){return e?e.map(n=>gC(n,{includeName:t})).join(t?", ":","):""}function gC(e,{includeName:t}){return e.type.startsWith("tuple")?`(${Zy(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}class pC extends Me{constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(` +`),{docsPath:t,name:"AbiConstructorNotFoundError"})}}class a6 extends Me{constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(` +`),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}}class W4 extends Me{constructor({data:t,params:n,size:i}){super([`Data size of ${i} bytes is too small for given parameters.`].join(` +`),{metaMessages:[`Params: (${Zy(n,{includeName:!0})})`,`Data: ${t} (${i} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t,this.params=n,this.size=i}}class a1 extends Me{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class bC extends Me{constructor({expectedLength:t,givenLength:n,type:i}){super([`ABI encoding array length mismatch for type ${i}.`,`Expected length: ${t}`,`Given length: ${n}`].join(` +`),{name:"AbiEncodingArrayLengthMismatchError"})}}class mC extends Me{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${Pn(n)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class K4 extends Me{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${n}`].join(` +`),{name:"AbiEncodingLengthMismatchError"})}}class q4 extends Me{constructor(t,{docsPath:n}){super([`Encoded error signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${t}.`].join(` +`),{docsPath:n,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}}class vC extends Me{constructor({docsPath:t}){super("Cannot extract event signature from empty topics.",{docsPath:t,name:"AbiEventSignatureEmptyTopicsError"})}}class J4 extends Me{constructor(t,{docsPath:n}){super([`Encoded event signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${t}.`].join(` +`),{docsPath:n,name:"AbiEventSignatureNotFoundError"})}}class s6 extends Me{constructor(t,{docsPath:n}={}){super([`Event ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(` +`),{docsPath:n,name:"AbiEventNotFoundError"})}}class Oy extends Me{constructor(t,{docsPath:n}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(` +`),{docsPath:n,name:"AbiFunctionNotFoundError"})}}class wC extends Me{constructor(t,{docsPath:n}){super([`Function "${t}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(` +`),{docsPath:n,name:"AbiFunctionOutputsNotFoundError"})}}class AC extends Me{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${wl(t.abiItem)}\`, and`,`\`${n.type}\` in \`${wl(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}let $4=class extends Me{constructor({expectedSize:t,givenSize:n}){super(`Expected bytes${t}, got bytes${n}.`,{name:"BytesSizeMismatchError"})}};class R0 extends Me{constructor({abiItem:t,data:n,params:i,size:s}){super([`Data size of ${s} bytes is too small for non-indexed event parameters.`].join(` +`),{metaMessages:[`Params: (${Zy(i,{includeName:!0})})`,`Data: ${n} (${s} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t,this.data=n,this.params=i,this.size=s}}class Xy extends Me{constructor({abiItem:t,param:n}){super([`Expected a topic for indexed event parameter${n.name?` "${n.name}"`:""} on event "${wl(t,{includeName:!0})}".`].join(` +`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t}}class xC extends Me{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` +`),{docsPath:n,name:"InvalidAbiEncodingType"})}}class EC extends Me{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` +`),{docsPath:n,name:"InvalidAbiDecodingType"})}}let CC=class extends Me{constructor(t){super([`Value "${t}" is not a valid array.`].join(` +`),{name:"InvalidArrayError"})}};class SC extends Me{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` +`),{name:"InvalidDefinitionTypeError"})}}class TC extends Me{constructor(t){super(`Type "${t}" is not supported for packed encoding.`,{name:"UnsupportedPackedAbiType"})}}const OC=e=>hr(Qd(e));function RC(e){return OC(e)}const MC="1.0.8";let ga=class jb extends Error{constructor(t,n={}){var c;const i=n.cause instanceof jb?n.cause.details:(c=n.cause)!=null&&c.message?n.cause.message:n.details,s=n.cause instanceof jb&&n.cause.docsPath||n.docsPath,l=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: https://abitype.dev${s}`]:[],...i?[`Details: ${i}`]:[],`Version: abitype@${MC}`].join(` +`);super(l),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=i,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=t}};function El(e,t){const n=e.exec(t);return n==null?void 0:n.groups}const eA=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,tA=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,nA=/^\(.+?\).*?$/,o6=/^tuple(?(\[(\d*)\])*)$/;function Vb(e){let t=e.type;if(o6.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let s=0;s[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function _C(e){return rA.test(e)}function NC(e){return El(rA,e)}const iA=/^event (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function DC(e){return iA.test(e)}function BC(e){return El(iA,e)}const aA=/^function (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)(?: (?external|public{1}))?(?: (?pure|view|nonpayable|payable{1}))?(?: returns\s?\((?.*?)\))?$/;function IC(e){return aA.test(e)}function kC(e){return El(aA,e)}const sA=/^struct (?[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?.*?)\}$/;function r2(e){return sA.test(e)}function PC(e){return El(sA,e)}const oA=/^constructor\((?.*?)\)(?:\s(?payable{1}))?$/;function LC(e){return oA.test(e)}function UC(e){return El(oA,e)}const lA=/^fallback\(\) external(?:\s(?payable{1}))?$/;function FC(e){return lA.test(e)}function zC(e){return El(lA,e)}const HC=/^receive\(\) external payable$/;function GC(e){return HC.test(e)}const QC=new Set(["indexed"]),Yb=new Set(["calldata","memory","storage"]);class jC extends ga{constructor({signature:t}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class VC extends ga{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class YC extends ga{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class ZC extends ga{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class XC extends ga{constructor({param:t,name:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${n}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class WC extends ga{constructor({param:t,type:n,modifier:i}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${i}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class KC extends ga{constructor({param:t,type:n,modifier:i}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${i}" not allowed${n?` in "${n}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${i}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class qC extends ga{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class Zd extends ga{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class JC extends ga{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class $C extends ga{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class eS extends ga{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class tS extends ga{constructor({current:t,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${n>0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function nS(e,t,n){let i="";if(n)for(const s of Object.entries(n)){if(!s)continue;let l="";for(const c of s[1])l+=`[${c.type}${c.name?`:${c.name}`:""}]`;i+=`(${s[0]}{${l}})`}return t?`${t}:${e}${i}`:e}const Rp=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function Zb(e,t={}){if(IC(e))return rS(e,t);if(DC(e))return iS(e,t);if(_C(e))return aS(e,t);if(LC(e))return sS(e,t);if(FC(e))return oS(e);if(GC(e))return{type:"receive",stateMutability:"payable"};throw new JC({signature:e})}function rS(e,t={}){const n=kC(e);if(!n)throw new Zd({signature:e,type:"function"});const i=bs(n.parameters),s=[],l=i.length;for(let f=0;f[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,cS=/^\((?.+?)\)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,uS=/^u?int$/;function $u(e,t){var w,x;const n=nS(e,t==null?void 0:t.type,t==null?void 0:t.structs);if(Rp.has(n))return Rp.get(n);const i=nA.test(e),s=El(i?cS:lS,e);if(!s)throw new ZC({param:e});if(s.name&&dS(s.name))throw new XC({param:e,name:s.name});const l=s.name?{name:s.name}:{},c=s.modifier==="indexed"?{indexed:!0}:{},f=(t==null?void 0:t.structs)??{};let d,h={};if(i){d="tuple";const S=bs(s.type),O=[],T=S.length;for(let R=0;R[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?$/;function fA(e,t,n=new Set){const i=[],s=e.length;for(let l=0;l{const t=typeof e=="string"?e:Ry(e);return gS(t)};function dA(e){return RC(pS(e))}const a2=e=>O0(dA(e),0,4);function bS(e,t={}){typeof t.size<"u"&&Ya(e,{size:t.size});const n=tr(e,t);return jr(n,t)}function mS(e,t={}){let n=e;if(typeof t.size<"u"&&(Ya(n,{size:t.size}),n=ya(n)),n.length>1||n[0]>1)throw new BE(n);return!!n[0]}function gl(e,t={}){typeof t.size<"u"&&Ya(e,{size:t.size});const n=tr(e,t);return ms(n,t)}function vS(e,t={}){let n=e;return typeof t.size<"u"&&(Ya(n,{size:t.size}),n=ya(n,{dir:"right"})),new TextDecoder().decode(n)}const wS=/^(.*)\[([0-9]*)\]$/,hA=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,s2=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function Xd(e,t){if(e.length!==t.length)throw new K4({expectedLength:e.length,givenLength:t.length});const n=AS({params:e,values:t}),i=l2(n);return i.length===0?"0x":i}function AS({params:e,values:t}){const n=[];for(let i=0;i0?ml([f,c]):f}}if(s)return{dynamic:!0,encoded:c}}return{dynamic:!1,encoded:ml(l.map(({encoded:c})=>c))}}function CS(e,{param:t}){const[,n]=t.type.split("bytes"),i=Pn(e);if(!n){let s=e;return i%32!==0&&(s=Fc(s,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:ml([Fc(Ze(i,{size:32})),s])}}if(i!==Number.parseInt(n))throw new mC({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:Fc(e,{dir:"right"})}}function SS(e){if(typeof e!="boolean")throw new Me(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Fc(Ym(e))}}function TS(e,{signed:t,size:n=256}){if(typeof n=="number"){const i=2n**(BigInt(n)-(t?1n:0n))-1n,s=t?-i-1n:0n;if(e>i||es))}}function c2(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function Wy(e,t){const n=typeof t=="string"?Qa(t):t,i=Wm(n);if(Pn(n)===0&&e.length>0)throw new a1;if(Pn(t)&&Pn(t)<32)throw new W4({data:typeof t=="string"?t:tr(t),params:e,size:Pn(t)});let s=0;const l=[];for(let c=0;c48?bS(s,{signed:n}):gl(s,{signed:n}),32]}function IS(e,t,{staticPosition:n}){const i=t.components.length===0||t.components.some(({name:c})=>!c),s=i?[]:{};let l=0;if(M0(t)){const c=gl(e.readBytes(Xb)),f=n+c;for(let d=0;dc.type==="error"&&i===a2(wl(c)));if(!l)throw new q4(i,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:l,args:"inputs"in l&&l.inputs&&l.inputs.length>0?Wy(l.inputs,O0(n,4)):void 0,errorName:l.name}}const Vr=(e,t,n)=>JSON.stringify(e,(i,s)=>typeof s=="bigint"?s.toString():s,n);function yA({abiItem:e,args:t,includeFunctionName:n=!0,includeName:i=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map((s,l)=>`${i&&s.name?`${s.name}: `:""}${typeof t[l]=="object"?Vr(t[l]):t[l]}`).join(", ")})`}const Ky=dA;function s1(e){const{abi:t,args:n=[],name:i}=e,s=lo(i,{strict:!1}),l=t.filter(f=>s?f.type==="function"?a2(f)===i:f.type==="event"?Ky(f)===i:!1:"name"in f&&f.name===i);if(l.length===0)return;if(l.length===1)return l[0];let c;for(const f of l){if(!("inputs"in f))continue;if(!n||n.length===0){if(!f.inputs||f.inputs.length===0)return f;continue}if(!f.inputs||f.inputs.length===0||f.inputs.length!==n.length)continue;if(n.every((h,m)=>{const w="inputs"in f&&f.inputs[m];return w?Wb(h,w):!1})){if(c&&"inputs"in c&&c.inputs){const h=gA(f.inputs,c.inputs,n);if(h)throw new AC({abiItem:f,type:h[0]},{abiItem:c,type:h[1]})}c=f}}return c||l[0]}function Wb(e,t){const n=typeof e,i=t.type;switch(i){case"address":return yr(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return i==="tuple"&&"components"in t?Object.values(t.components).every((s,l)=>Wb(Object.values(e)[l],s)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(i)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(i)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(i)?Array.isArray(e)&&e.every(s=>Wb(s,{...t,type:i.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function gA(e,t,n){for(const i in e){const s=e[i],l=t[i];if(s.type==="tuple"&&l.type==="tuple"&&"components"in s&&"components"in l)return gA(s.components,l.components,n[i]);const c=[s.type,l.type];if(c.includes("address")&&c.includes("bytes20")?!0:c.includes("address")&&c.includes("string")?yr(n[i],{strict:!1}):c.includes("address")&&c.includes("bytes")?yr(n[i],{strict:!1}):!1)return c}}class LS extends Me{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}}class US extends Me{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function u6(e){return e.reduce((t,{slot:n,value:i})=>`${t} ${n}: ${i} +`,"")}function FS(e){return e.reduce((t,{address:n,...i})=>{let s=`${t} ${n}: +`;return i.nonce&&(s+=` nonce: ${i.nonce} +`),i.balance&&(s+=` balance: ${i.balance} +`),i.code&&(s+=` code: ${i.code} +`),i.state&&(s+=` state: +`,s+=u6(i.state)),i.stateDiff&&(s+=` stateDiff: +`,s+=u6(i.stateDiff)),s},` State Override: +`).slice(0,-1)}const zS=e=>e,u2=e=>e;class pA extends Me{constructor(t,{account:n,docsPath:i,chain:s,data:l,gas:c,gasPrice:f,maxFeePerGas:d,maxPriorityFeePerGas:h,nonce:m,to:w,value:x,stateOverride:S}){var R;const O=n?si(n):void 0;let T=n1({from:O==null?void 0:O.address,to:w,value:typeof x<"u"&&`${Km(x)} ${((R=s==null?void 0:s.nativeCurrency)==null?void 0:R.symbol)||"ETH"}`,data:l,gas:c,gasPrice:typeof f<"u"&&`${ji(f)} gwei`,maxFeePerGas:typeof d<"u"&&`${ji(d)} gwei`,maxPriorityFeePerGas:typeof h<"u"&&`${ji(h)} gwei`,nonce:m});S&&(T+=` +${FS(S)}`),super(t.shortMessage,{cause:t,docsPath:i,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",T].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class bA extends Me{constructor(t,{abi:n,args:i,contractAddress:s,docsPath:l,functionName:c,sender:f}){const d=s1({abi:n,args:i,name:c}),h=d?yA({abiItem:d,args:i,includeFunctionName:!1,includeName:!1}):void 0,m=d?wl(d,{includeName:!0}):void 0,w=n1({address:s&&zS(s),function:m,args:h&&h!=="()"&&`${[...Array((c==null?void 0:c.length)??0).keys()].map(()=>" ").join("")}${h}`,sender:f});super(t.shortMessage||`An unknown error occurred while executing the contract function "${c}".`,{cause:t,docsPath:l,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],w&&"Contract Call:",w].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=n,this.args=i,this.cause=t,this.contractAddress=s,this.functionName=c,this.sender=f}}class Kb extends Me{constructor({abi:t,data:n,functionName:i,message:s}){let l,c,f,d;if(n&&n!=="0x")try{c=PS({abi:t,data:n});const{abiItem:m,errorName:w,args:x}=c;if(w==="Error")d=x[0];else if(w==="Panic"){const[S]=x;d=X4[S]}else{const S=m?wl(m,{includeName:!0}):void 0,O=m&&x?yA({abiItem:m,args:x,includeFunctionName:!1,includeName:!1}):void 0;f=[S?`Error: ${S}`:"",O&&O!=="()"?` ${[...Array((w==null?void 0:w.length)??0).keys()].map(()=>" ").join("")}${O}`:""]}}catch(m){l=m}else s&&(d=s);let h;l instanceof q4&&(h=l.signature,f=[`Unable to decode signature "${h}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${h}.`]),super(d&&d!=="execution reverted"||h?[`The contract function "${i}" reverted with the following ${h?"signature":"reason"}:`,d||h].join(` +`):`The contract function "${i}" reverted.`,{cause:l,metaMessages:f,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=c,this.raw=n,this.reason=d,this.signature=h}}class HS extends Me{constructor({functionName:t}){super(`The contract function "${t}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${t}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class GS extends Me{constructor({factory:t}){super(`Deployment for counterfactual contract call failed${t?` for factory "${t}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class qy extends Me{constructor({data:t,message:n}){super(n||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t}}class w0 extends Me{constructor({body:t,cause:n,details:i,headers:s,status:l,url:c}){super("HTTP request failed.",{cause:n,details:i,metaMessages:[l&&`Status: ${l}`,`URL: ${u2(c)}`,t&&`Request body: ${Vr(t)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=t,this.headers=s,this.status=l,this.url=c}}class f2 extends Me{constructor({body:t,error:n,url:i}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${u2(i)}`,`Request body: ${Vr(t)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=n.code,this.data=n.data}}class f6 extends Me{constructor({body:t,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${u2(n)}`,`Request body: ${Vr(t)}`],name:"TimeoutError"})}}const QS=-1;class Yi extends Me{constructor(t,{code:n,docsPath:i,metaMessages:s,name:l,shortMessage:c}){super(c,{cause:t,docsPath:i,metaMessages:s||(t==null?void 0:t.metaMessages),name:l||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=l||t.name,this.code=t instanceof f2?t.code:n??QS}}class Wd extends Yi{constructor(t,n){super(t,n),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}}class _0 extends Yi{constructor(t){super(t,{code:_0.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(_0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class N0 extends Yi{constructor(t){super(t,{code:N0.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(N0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class D0 extends Yi{constructor(t,{method:n}={}){super(t,{code:D0.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`})}}Object.defineProperty(D0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class B0 extends Yi{constructor(t){super(t,{code:B0.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` +`)})}}Object.defineProperty(B0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class ef extends Yi{constructor(t){super(t,{code:ef.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(ef,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class tf extends Yi{constructor(t){super(t,{code:tf.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` +`)})}}Object.defineProperty(tf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class I0 extends Yi{constructor(t){super(t,{code:I0.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(I0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class oo extends Yi{constructor(t){super(t,{code:oo.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(oo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class k0 extends Yi{constructor(t){super(t,{code:k0.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(k0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Uu extends Yi{constructor(t,{method:n}={}){super(t,{code:Uu.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`})}}Object.defineProperty(Uu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class Bd extends Yi{constructor(t){super(t,{code:Bd.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(Bd,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class P0 extends Yi{constructor(t){super(t,{code:P0.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(P0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class Wt extends Wd{constructor(t){super(t,{code:Wt.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(Wt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class L0 extends Wd{constructor(t){super(t,{code:L0.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(L0,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class U0 extends Wd{constructor(t,{method:n}={}){super(t,{code:U0.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}}Object.defineProperty(U0,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class F0 extends Wd{constructor(t){super(t,{code:F0.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(F0,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class z0 extends Wd{constructor(t){super(t,{code:z0.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(z0,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class Vi extends Wd{constructor(t){super(t,{code:Vi.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(Vi,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class jS extends Yi{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}function Jy(e,t){const n=(e.details||"").toLowerCase(),i=e instanceof Me?e.walk(s=>(s==null?void 0:s.code)===ud.code):e;return i instanceof Me?new ud({cause:e,message:i.details}):ud.nodeMessage.test(n)?new ud({cause:e,message:e.details}):Ju.nodeMessage.test(n)?new Ju({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):Pb.nodeMessage.test(n)?new Pb({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):Lb.nodeMessage.test(n)?new Lb({cause:e,nonce:t==null?void 0:t.nonce}):Ub.nodeMessage.test(n)?new Ub({cause:e,nonce:t==null?void 0:t.nonce}):Fb.nodeMessage.test(n)?new Fb({cause:e,nonce:t==null?void 0:t.nonce}):zb.nodeMessage.test(n)?new zb({cause:e}):Hb.nodeMessage.test(n)?new Hb({cause:e,gas:t==null?void 0:t.gas}):Gb.nodeMessage.test(n)?new Gb({cause:e,gas:t==null?void 0:t.gas}):Qb.nodeMessage.test(n)?new Qb({cause:e}):T0.nodeMessage.test(n)?new T0({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new r1({cause:e})}function mA(e,{docsPath:t,...n}){const i=(()=>{const s=Jy(e,n);return s instanceof r1?e:s})();return new pA(i,{docsPath:t,...n})}function $y(e,{format:t}){if(!t)return{};const n={};function i(l){const c=Object.keys(l);for(const f of c)f in e&&(n[f]=e[f]),l[f]&&typeof l[f]=="object"&&!Array.isArray(l[f])&&i(l[f])}const s=t(e||{});return i(s),n}function Kd(e){const{account:t,gasPrice:n,maxFeePerGas:i,maxPriorityFeePerGas:s,to:l}=e,c=t?si(t):void 0;if(c&&!yr(c.address))throw new ai({address:c.address});if(l&&!yr(l))throw new ai({address:l});if(typeof n<"u"&&(typeof i<"u"||typeof s<"u"))throw new r9;if(i&&i>zy)throw new Ju({maxFeePerGas:i});if(s&&i&&s>i)throw new T0({maxFeePerGas:i,maxPriorityFeePerGas:s})}const ja=fo({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),o0=1,d2=fo({...Gc,id:10,name:"OP Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.optimism.io"]}},blockExplorers:{default:{name:"Optimism Explorer",url:"https://optimistic.etherscan.io",apiUrl:"https://api-optimistic.etherscan.io/api"}},contracts:{...Gc.contracts,disputeGameFactory:{[o0]:{address:"0xe5965Ab5962eDc7477C8520243A95517CD252fA9"}},l2OutputOracle:{[o0]:{address:"0xdfe97868233d1aa22e815a266982f2cf17685a27"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263},portal:{[o0]:{address:"0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"}},l1StandardBridge:{[o0]:{address:"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"}}},sourceId:o0}),l0=11155111,VS=fo({...Gc,id:11155420,name:"OP Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.optimism.io"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com",apiUrl:"https://optimism-sepolia.blockscout.com/api"}},contracts:{...Gc.contracts,disputeGameFactory:{[l0]:{address:"0x05F9613aDB30026FFd634f38e5C4dFd30a197Fa1"}},l2OutputOracle:{[l0]:{address:"0x90E9c4f8a994a250F6aEfd61CAFb4F2e895D458F"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1620204},portal:{[l0]:{address:"0x16Fc5058F25648194471939df75CF27A2fdC48BC"}},l1StandardBridge:{[l0]:{address:"0xFBb0621E0B23b5478B630BD55a5f21f67730B0F1"}}},testnet:!0,sourceId:l0}),YS=fo({id:137,name:"Polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.polygonscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}}),ZS=fo({id:80001,name:"Polygon Mumbai",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://rpc.ankr.com/polygon_mumbai"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com",apiUrl:"https://api-testnet.polygonscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}},testnet:!0}),vA=fo({id:11155111,name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.drpc.org"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.etherscan.io",apiUrl:"https://api-sepolia.etherscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",blockCreated:5317080}},testnet:!0});function h2({chainId:e,isMainnetOnly:t=!1}){return!!(t&&e===Qn.id||!t&&(e===vl.id||e===Qn.id))}function y2({chainId:e,isMainnetOnly:t=!1}){return!!(t&&e===ja.id||!t&&(e===vA.id||e===ja.id))}const Mc={address:null,apiKey:null,chain:vl,config:{analytics:!0,analyticsUrl:null,appearance:{name:null,logo:null,mode:null,theme:null},paymaster:null,wallet:{display:null,termsUrl:null,privacyUrl:null}},rpcUrl:null,schemaId:null,projectId:null,sessionId:null},A0=e=>Mc[e],XS=e=>(Object.assign(Mc,e),A0);var qd=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},nf=typeof window>"u"||"Deno"in globalThis;function Ga(){}function WS(e,t){return typeof e=="function"?e(t):e}function qb(e){return typeof e=="number"&&e>=0&&e!==1/0}function wA(e,t){return Math.max(e+(t||0)-Date.now(),0)}function pd(e,t){return typeof e=="function"?e(t):e}function ps(e,t){return typeof e=="function"?e(t):e}function d6(e,t){const{type:n="all",exact:i,fetchStatus:s,predicate:l,queryKey:c,stale:f}=e;if(c){if(i){if(t.queryHash!==g2(c,t.options))return!1}else if(!H0(t.queryKey,c))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||s&&s!==t.state.fetchStatus||l&&!l(t))}function h6(e,t){const{exact:n,status:i,predicate:s,mutationKey:l}=e;if(l){if(!t.options.mutationKey)return!1;if(n){if(rf(t.options.mutationKey)!==rf(l))return!1}else if(!H0(t.options.mutationKey,l))return!1}return!(i&&t.state.status!==i||s&&!s(t))}function g2(e,t){return((t==null?void 0:t.queryKeyHashFn)||rf)(e)}function rf(e){return JSON.stringify(e,(t,n)=>Jb(n)?Object.keys(n).sort().reduce((i,s)=>(i[s]=n[s],i),{}):n)}function H0(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!H0(e[n],t[n])):!1}function p2(e,t){if(e===t)return e;const n=y6(e)&&y6(t);if(n||Jb(e)&&Jb(t)){const i=n?e:Object.keys(e),s=i.length,l=n?t:Object.keys(t),c=l.length,f=n?[]:{};let d=0;for(let h=0;h{setTimeout(t,e)})}function $b(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?p2(e,t):t}function qS(e,t,n=0){const i=[...e,t];return n&&i.length>n?i.slice(1):i}function JS(e,t,n=0){const i=[t,...e];return n&&i.length>n?i.slice(0,-1):i}var b2=Symbol();function AA(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===b2?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var zu,_c,vd,i4,$S=(i4=class extends qd{constructor(){super();$e(this,zu);$e(this,_c);$e(this,vd);ze(this,vd,t=>{if(!nf&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ne(this,_c)||this.setEventListener(ne(this,vd))}onUnsubscribe(){var t;this.hasListeners()||((t=ne(this,_c))==null||t.call(this),ze(this,_c,void 0))}setEventListener(t){var n;ze(this,vd,t),(n=ne(this,_c))==null||n.call(this),ze(this,_c,t(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(t){ne(this,zu)!==t&&(ze(this,zu,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof ne(this,zu)=="boolean"?ne(this,zu):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},zu=new WeakMap,_c=new WeakMap,vd=new WeakMap,i4),m2=new $S,wd,Nc,Ad,a4,eT=(a4=class extends qd{constructor(){super();$e(this,wd,!0);$e(this,Nc);$e(this,Ad);ze(this,Ad,t=>{if(!nf&&window.addEventListener){const n=()=>t(!0),i=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",i)}}})}onSubscribe(){ne(this,Nc)||this.setEventListener(ne(this,Ad))}onUnsubscribe(){var t;this.hasListeners()||((t=ne(this,Nc))==null||t.call(this),ze(this,Nc,void 0))}setEventListener(t){var n;ze(this,Ad,t),(n=ne(this,Nc))==null||n.call(this),ze(this,Nc,t(this.setOnline.bind(this)))}setOnline(t){ne(this,wd)!==t&&(ze(this,wd,t),this.listeners.forEach(i=>{i(t)}))}isOnline(){return ne(this,wd)}},wd=new WeakMap,Nc=new WeakMap,Ad=new WeakMap,a4),_y=new eT;function em(){let e,t;const n=new Promise((s,l)=>{e=s,t=l});n.status="pending",n.catch(()=>{});function i(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{i({status:"fulfilled",value:s}),e(s)},n.reject=s=>{i({status:"rejected",reason:s}),t(s)},n}function tT(e){return Math.min(1e3*2**e,3e4)}function xA(e){return(e??"online")==="online"?_y.isOnline():!0}var EA=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Mp(e){return e instanceof EA}function CA(e){let t=!1,n=0,i=!1,s;const l=em(),c=T=>{var R;i||(x(new EA(T)),(R=e.abort)==null||R.call(e))},f=()=>{t=!0},d=()=>{t=!1},h=()=>m2.isFocused()&&(e.networkMode==="always"||_y.isOnline())&&e.canRun(),m=()=>xA(e.networkMode)&&e.canRun(),w=T=>{var R;i||(i=!0,(R=e.onSuccess)==null||R.call(e,T),s==null||s(),l.resolve(T))},x=T=>{var R;i||(i=!0,(R=e.onError)==null||R.call(e,T),s==null||s(),l.reject(T))},S=()=>new Promise(T=>{var R;s=k=>{(i||h())&&T(k)},(R=e.onPause)==null||R.call(e)}).then(()=>{var T;s=void 0,i||(T=e.onContinue)==null||T.call(e)}),O=()=>{if(i)return;let T;const R=n===0?e.initialPromise:void 0;try{T=R??e.fn()}catch(k){T=Promise.reject(k)}Promise.resolve(T).then(w).catch(k=>{var H;if(i)return;const F=e.retry??(nf?0:3),U=e.retryDelay??tT,j=typeof U=="function"?U(n,k):U,z=F===!0||typeof F=="number"&&nh()?void 0:S()).then(()=>{t?x(k):O()})})};return{promise:l,cancel:c,continue:()=>(s==null||s(),l),cancelRetry:f,continueRetry:d,canStart:m,start:()=>(m()?O():S().then(O),l)}}function nT(){let e=[],t=0,n=f=>{f()},i=f=>{f()},s=f=>setTimeout(f,0);const l=f=>{t?e.push(f):s(()=>{n(f)})},c=()=>{const f=e;e=[],f.length&&s(()=>{i(()=>{f.forEach(d=>{n(d)})})})};return{batch:f=>{let d;t++;try{d=f()}finally{t--,t||c()}return d},batchCalls:f=>(...d)=>{l(()=>{f(...d)})},schedule:l,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{i=f},setScheduler:f=>{s=f}}}var dr=nT(),Hu,s4,SA=(s4=class{constructor(){$e(this,Hu)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),qb(this.gcTime)&&ze(this,Hu,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(nf?1/0:5*60*1e3))}clearGcTimeout(){ne(this,Hu)&&(clearTimeout(ne(this,Hu)),ze(this,Hu,void 0))}},Hu=new WeakMap,s4),xd,Ed,Ha,Gu,ri,K0,Qu,ys,cl,o4,rT=(o4=class extends SA{constructor(t){super();$e(this,ys);$e(this,xd);$e(this,Ed);$e(this,Ha);$e(this,Gu);$e(this,ri);$e(this,K0);$e(this,Qu);ze(this,Qu,!1),ze(this,K0,t.defaultOptions),this.setOptions(t.options),this.observers=[],ze(this,Gu,t.client),ze(this,Ha,ne(this,Gu).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ze(this,xd,iT(this.options)),this.state=t.state??ne(this,xd),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=ne(this,ri))==null?void 0:t.promise}setOptions(t){this.options={...ne(this,K0),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ne(this,Ha).remove(this)}setData(t,n){const i=$b(this.state.data,t,this.options);return wt(this,ys,cl).call(this,{data:i,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),i}setState(t,n){wt(this,ys,cl).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var i,s;const n=(i=ne(this,ri))==null?void 0:i.promise;return(s=ne(this,ri))==null||s.cancel(t),n?n.then(Ga).catch(Ga):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ne(this,xd))}isActive(){return this.observers.some(t=>ps(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===b2||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!wA(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(i=>i.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=ne(this,ri))==null||n.continue()}onOnline(){var n;const t=this.observers.find(i=>i.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=ne(this,ri))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),ne(this,Ha).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(ne(this,ri)&&(ne(this,Qu)?ne(this,ri).cancel({revert:!0}):ne(this,ri).cancelRetry()),this.scheduleGc()),ne(this,Ha).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||wt(this,ys,cl).call(this,{type:"invalidate"})}fetch(t,n){var d,h,m;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ne(this,ri))return ne(this,ri).continueRetry(),ne(this,ri).promise}if(t&&this.setOptions(t),!this.options.queryFn){const w=this.observers.find(x=>x.options.queryFn);w&&this.setOptions(w.options)}const i=new AbortController,s=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(ze(this,Qu,!0),i.signal)})},l=()=>{const w=AA(this.options,n),x={client:ne(this,Gu),queryKey:this.queryKey,meta:this.meta};return s(x),ze(this,Qu,!1),this.options.persister?this.options.persister(w,x,this):w(x)},c={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:ne(this,Gu),state:this.state,fetchFn:l};s(c),(d=this.options.behavior)==null||d.onFetch(c,this),ze(this,Ed,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=c.fetchOptions)==null?void 0:h.meta))&&wt(this,ys,cl).call(this,{type:"fetch",meta:(m=c.fetchOptions)==null?void 0:m.meta});const f=w=>{var x,S,O,T;Mp(w)&&w.silent||wt(this,ys,cl).call(this,{type:"error",error:w}),Mp(w)||((S=(x=ne(this,Ha).config).onError)==null||S.call(x,w,this),(T=(O=ne(this,Ha).config).onSettled)==null||T.call(O,this.state.data,w,this)),this.scheduleGc()};return ze(this,ri,CA({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,abort:i.abort.bind(i),onSuccess:w=>{var x,S,O,T;if(w===void 0){f(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(w)}catch(R){f(R);return}(S=(x=ne(this,Ha).config).onSuccess)==null||S.call(x,w,this),(T=(O=ne(this,Ha).config).onSettled)==null||T.call(O,w,this.state.error,this),this.scheduleGc()},onError:f,onFail:(w,x)=>{wt(this,ys,cl).call(this,{type:"failed",failureCount:w,error:x})},onPause:()=>{wt(this,ys,cl).call(this,{type:"pause"})},onContinue:()=>{wt(this,ys,cl).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0})),ne(this,ri).start()}},xd=new WeakMap,Ed=new WeakMap,Ha=new WeakMap,Gu=new WeakMap,ri=new WeakMap,K0=new WeakMap,Qu=new WeakMap,ys=new WeakSet,cl=function(t){const n=i=>{switch(t.type){case"failed":return{...i,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...TA(i.data,this.options),fetchMeta:t.meta??null};case"success":return{...i,data:t.data,dataUpdateCount:i.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return Mp(s)&&s.revert&&ne(this,Ed)?{...ne(this,Ed),fetchStatus:"idle"}:{...i,error:s,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...t.state}}};this.state=n(this.state),dr.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),ne(this,Ha).notify({query:this,type:"updated",action:t})})},o4);function TA(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:xA(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function iT(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,i=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var no,l4,aT=(l4=class extends qd{constructor(t={}){super();$e(this,no);this.config=t,ze(this,no,new Map)}build(t,n,i){const s=n.queryKey,l=n.queryHash??g2(s,n);let c=this.get(l);return c||(c=new rT({client:t,queryKey:s,queryHash:l,options:t.defaultQueryOptions(n),state:i,defaultOptions:t.getQueryDefaults(s)}),this.add(c)),c}add(t){ne(this,no).has(t.queryHash)||(ne(this,no).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=ne(this,no).get(t.queryHash);n&&(t.destroy(),n===t&&ne(this,no).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){dr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ne(this,no).get(t)}getAll(){return[...ne(this,no).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(i=>d6(n,i))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(i=>d6(t,i)):n}notify(t){dr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){dr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){dr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},no=new WeakMap,l4),ro,bi,ju,io,Rc,c4,sT=(c4=class extends SA{constructor(t){super();$e(this,io);$e(this,ro);$e(this,bi);$e(this,ju);this.mutationId=t.mutationId,ze(this,bi,t.mutationCache),ze(this,ro,[]),this.state=t.state||OA(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ne(this,ro).includes(t)||(ne(this,ro).push(t),this.clearGcTimeout(),ne(this,bi).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ze(this,ro,ne(this,ro).filter(n=>n!==t)),this.scheduleGc(),ne(this,bi).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ne(this,ro).length||(this.state.status==="pending"?this.scheduleGc():ne(this,bi).remove(this))}continue(){var t;return((t=ne(this,ju))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,l,c,f,d,h,m,w,x,S,O,T,R,k,F,U,j,z,H,V;ze(this,ju,CA({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(K,Q)=>{wt(this,io,Rc).call(this,{type:"failed",failureCount:K,error:Q})},onPause:()=>{wt(this,io,Rc).call(this,{type:"pause"})},onContinue:()=>{wt(this,io,Rc).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ne(this,bi).canRun(this)}));const n=this.state.status==="pending",i=!ne(this,ju).canStart();try{if(!n){wt(this,io,Rc).call(this,{type:"pending",variables:t,isPaused:i}),await((l=(s=ne(this,bi).config).onMutate)==null?void 0:l.call(s,t,this));const Q=await((f=(c=this.options).onMutate)==null?void 0:f.call(c,t));Q!==this.state.context&&wt(this,io,Rc).call(this,{type:"pending",context:Q,variables:t,isPaused:i})}const K=await ne(this,ju).start();return await((h=(d=ne(this,bi).config).onSuccess)==null?void 0:h.call(d,K,t,this.state.context,this)),await((w=(m=this.options).onSuccess)==null?void 0:w.call(m,K,t,this.state.context)),await((S=(x=ne(this,bi).config).onSettled)==null?void 0:S.call(x,K,null,this.state.variables,this.state.context,this)),await((T=(O=this.options).onSettled)==null?void 0:T.call(O,K,null,t,this.state.context)),wt(this,io,Rc).call(this,{type:"success",data:K}),K}catch(K){try{throw await((k=(R=ne(this,bi).config).onError)==null?void 0:k.call(R,K,t,this.state.context,this)),await((U=(F=this.options).onError)==null?void 0:U.call(F,K,t,this.state.context)),await((z=(j=ne(this,bi).config).onSettled)==null?void 0:z.call(j,void 0,K,this.state.variables,this.state.context,this)),await((V=(H=this.options).onSettled)==null?void 0:V.call(H,void 0,K,t,this.state.context)),K}finally{wt(this,io,Rc).call(this,{type:"error",error:K})}}finally{ne(this,bi).runNext(this)}}},ro=new WeakMap,bi=new WeakMap,ju=new WeakMap,io=new WeakSet,Rc=function(t){const n=i=>{switch(t.type){case"failed":return{...i,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...i,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:t.error,failureCount:i.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),dr.batch(()=>{ne(this,ro).forEach(i=>{i.onMutationUpdate(t)}),ne(this,bi).notify({mutation:this,type:"updated",action:t})})},c4);function OA(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var fl,gs,q0,u4,oT=(u4=class extends qd{constructor(t={}){super();$e(this,fl);$e(this,gs);$e(this,q0);this.config=t,ze(this,fl,new Set),ze(this,gs,new Map),ze(this,q0,0)}build(t,n,i){const s=new sT({mutationCache:this,mutationId:++q1(this,q0)._,options:t.defaultMutationOptions(n),state:i});return this.add(s),s}add(t){ne(this,fl).add(t);const n=ey(t);if(typeof n=="string"){const i=ne(this,gs).get(n);i?i.push(t):ne(this,gs).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(ne(this,fl).delete(t)){const n=ey(t);if(typeof n=="string"){const i=ne(this,gs).get(n);if(i)if(i.length>1){const s=i.indexOf(t);s!==-1&&i.splice(s,1)}else i[0]===t&&ne(this,gs).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=ey(t);if(typeof n=="string"){const i=ne(this,gs).get(n),s=i==null?void 0:i.find(l=>l.state.status==="pending");return!s||s===t}else return!0}runNext(t){var i;const n=ey(t);if(typeof n=="string"){const s=(i=ne(this,gs).get(n))==null?void 0:i.find(l=>l!==t&&l.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){dr.batch(()=>{ne(this,fl).forEach(t=>{this.notify({type:"removed",mutation:t})}),ne(this,fl).clear(),ne(this,gs).clear()})}getAll(){return Array.from(ne(this,fl))}find(t){const n={exact:!0,...t};return this.getAll().find(i=>h6(n,i))}findAll(t={}){return this.getAll().filter(n=>h6(t,n))}notify(t){dr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return dr.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ga))))}},fl=new WeakMap,gs=new WeakMap,q0=new WeakMap,u4);function ey(e){var t;return(t=e.options.scope)==null?void 0:t.id}function p6(e){return{onFetch:(t,n)=>{var m,w,x,S,O;const i=t.options,s=(x=(w=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:w.fetchMore)==null?void 0:x.direction,l=((S=t.state.data)==null?void 0:S.pages)||[],c=((O=t.state.data)==null?void 0:O.pageParams)||[];let f={pages:[],pageParams:[]},d=0;const h=async()=>{let T=!1;const R=U=>{Object.defineProperty(U,"signal",{enumerable:!0,get:()=>(t.signal.aborted?T=!0:t.signal.addEventListener("abort",()=>{T=!0}),t.signal)})},k=AA(t.options,t.fetchOptions),F=async(U,j,z)=>{if(T)return Promise.reject();if(j==null&&U.pages.length)return Promise.resolve(U);const H={client:t.client,queryKey:t.queryKey,pageParam:j,direction:z?"backward":"forward",meta:t.options.meta};R(H);const V=await k(H),{maxPages:K}=t.options,Q=z?JS:qS;return{pages:Q(U.pages,V,K),pageParams:Q(U.pageParams,j,K)}};if(s&&l.length){const U=s==="backward",j=U?lT:b6,z={pages:l,pageParams:c},H=j(i,z);f=await F(z,H,U)}else{const U=e??l.length;do{const j=d===0?c[0]??i.initialPageParam:b6(i,f);if(d>0&&j==null)break;f=await F(f,j),d++}while(d{var T,R;return(R=(T=t.options).persister)==null?void 0:R.call(T,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function b6(e,{pages:t,pageParams:n}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,n[i],n):void 0}function lT(e,{pages:t,pageParams:n}){var i;return t.length>0?(i=e.getPreviousPageParam)==null?void 0:i.call(e,t[0],t,n[0],n):void 0}var kn,Dc,Bc,Cd,Sd,Ic,Td,Od,f4,cT=(f4=class{constructor(e={}){$e(this,kn);$e(this,Dc);$e(this,Bc);$e(this,Cd);$e(this,Sd);$e(this,Ic);$e(this,Td);$e(this,Od);ze(this,kn,e.queryCache||new aT),ze(this,Dc,e.mutationCache||new oT),ze(this,Bc,e.defaultOptions||{}),ze(this,Cd,new Map),ze(this,Sd,new Map),ze(this,Ic,0)}mount(){q1(this,Ic)._++,ne(this,Ic)===1&&(ze(this,Td,m2.subscribe(async e=>{e&&(await this.resumePausedMutations(),ne(this,kn).onFocus())})),ze(this,Od,_y.subscribe(async e=>{e&&(await this.resumePausedMutations(),ne(this,kn).onOnline())})))}unmount(){var e,t;q1(this,Ic)._--,ne(this,Ic)===0&&((e=ne(this,Td))==null||e.call(this),ze(this,Td,void 0),(t=ne(this,Od))==null||t.call(this),ze(this,Od,void 0))}isFetching(e){return ne(this,kn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ne(this,Dc).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ne(this,kn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=ne(this,kn).build(this,t),i=n.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(pd(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return ne(this,kn).findAll(e).map(({queryKey:t,state:n})=>{const i=n.data;return[t,i]})}setQueryData(e,t,n){const i=this.defaultQueryOptions({queryKey:e}),s=ne(this,kn).get(i.queryHash),l=s==null?void 0:s.state.data,c=WS(t,l);if(c!==void 0)return ne(this,kn).build(this,i).setData(c,{...n,manual:!0})}setQueriesData(e,t,n){return dr.batch(()=>ne(this,kn).findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ne(this,kn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=ne(this,kn);dr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=ne(this,kn);return dr.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},i=dr.batch(()=>ne(this,kn).findAll(e).map(s=>s.cancel(n)));return Promise.all(i).then(Ga).catch(Ga)}invalidateQueries(e,t={}){return dr.batch(()=>(ne(this,kn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},i=dr.batch(()=>ne(this,kn).findAll(e).filter(s=>!s.isDisabled()).map(s=>{let l=s.fetch(void 0,n);return n.throwOnError||(l=l.catch(Ga)),s.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(i).then(Ga)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=ne(this,kn).build(this,t);return n.isStaleByTime(pd(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ga).catch(Ga)}fetchInfiniteQuery(e){return e.behavior=p6(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ga).catch(Ga)}ensureInfiniteQueryData(e){return e.behavior=p6(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return _y.isOnline()?ne(this,Dc).resumePausedMutations():Promise.resolve()}getQueryCache(){return ne(this,kn)}getMutationCache(){return ne(this,Dc)}getDefaultOptions(){return ne(this,Bc)}setDefaultOptions(e){ze(this,Bc,e)}setQueryDefaults(e,t){ne(this,Cd).set(rf(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ne(this,Cd).values()],n={};return t.forEach(i=>{H0(e,i.queryKey)&&Object.assign(n,i.defaultOptions)}),n}setMutationDefaults(e,t){ne(this,Sd).set(rf(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ne(this,Sd).values()],n={};return t.forEach(i=>{H0(e,i.mutationKey)&&Object.assign(n,i.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...ne(this,Bc).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=g2(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===b2&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ne(this,Bc).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ne(this,kn).clear(),ne(this,Dc).clear()}},kn=new WeakMap,Dc=new WeakMap,Bc=new WeakMap,Cd=new WeakMap,Sd=new WeakMap,Ic=new WeakMap,Td=new WeakMap,Od=new WeakMap,f4),Hi,_t,J0,mi,Vu,Rd,kc,ao,$0,Md,_d,Yu,Zu,Pc,Nd,zt,p0,tm,nm,rm,im,am,sm,om,RA,d4,uT=(d4=class extends qd{constructor(t,n){super();$e(this,zt);$e(this,Hi);$e(this,_t);$e(this,J0);$e(this,mi);$e(this,Vu);$e(this,Rd);$e(this,kc);$e(this,ao);$e(this,$0);$e(this,Md);$e(this,_d);$e(this,Yu);$e(this,Zu);$e(this,Pc);$e(this,Nd,new Set);this.options=n,ze(this,Hi,t),ze(this,ao,null),ze(this,kc,em()),this.options.experimental_prefetchInRender||ne(this,kc).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ne(this,_t).addObserver(this),m6(ne(this,_t),this.options)?wt(this,zt,p0).call(this):this.updateResult(),wt(this,zt,im).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return lm(ne(this,_t),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return lm(ne(this,_t),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,wt(this,zt,am).call(this),wt(this,zt,sm).call(this),ne(this,_t).removeObserver(this)}setOptions(t,n){const i=this.options,s=ne(this,_t);if(this.options=ne(this,Hi).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ps(this.options.enabled,ne(this,_t))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");wt(this,zt,om).call(this),ne(this,_t).setOptions(this.options),i._defaulted&&!My(this.options,i)&&ne(this,Hi).getQueryCache().notify({type:"observerOptionsUpdated",query:ne(this,_t),observer:this});const l=this.hasListeners();l&&v6(ne(this,_t),s,this.options,i)&&wt(this,zt,p0).call(this),this.updateResult(n),l&&(ne(this,_t)!==s||ps(this.options.enabled,ne(this,_t))!==ps(i.enabled,ne(this,_t))||pd(this.options.staleTime,ne(this,_t))!==pd(i.staleTime,ne(this,_t)))&&wt(this,zt,tm).call(this);const c=wt(this,zt,nm).call(this);l&&(ne(this,_t)!==s||ps(this.options.enabled,ne(this,_t))!==ps(i.enabled,ne(this,_t))||c!==ne(this,Pc))&&wt(this,zt,rm).call(this,c)}getOptimisticResult(t){const n=ne(this,Hi).getQueryCache().build(ne(this,Hi),t),i=this.createResult(n,t);return dT(this,i)&&(ze(this,mi,i),ze(this,Rd,this.options),ze(this,Vu,ne(this,_t).state)),i}getCurrentResult(){return ne(this,mi)}trackResult(t,n){const i={};return Object.keys(t).forEach(s=>{Object.defineProperty(i,s,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(s),n==null||n(s),t[s])})}),i}trackProp(t){ne(this,Nd).add(t)}getCurrentQuery(){return ne(this,_t)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=ne(this,Hi).defaultQueryOptions(t),i=ne(this,Hi).getQueryCache().build(ne(this,Hi),n);return i.fetch().then(()=>this.createResult(i,n))}fetch(t){return wt(this,zt,p0).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),ne(this,mi)))}createResult(t,n){var K;const i=ne(this,_t),s=this.options,l=ne(this,mi),c=ne(this,Vu),f=ne(this,Rd),h=t!==i?t.state:ne(this,J0),{state:m}=t;let w={...m},x=!1,S;if(n._optimisticResults){const Q=this.hasListeners(),le=!Q&&m6(t,n),ue=Q&&v6(t,i,n,s);(le||ue)&&(w={...w,...TA(m.data,t.options)}),n._optimisticResults==="isRestoring"&&(w.fetchStatus="idle")}let{error:O,errorUpdatedAt:T,status:R}=w;if(n.select&&w.data!==void 0)if(l&&w.data===(c==null?void 0:c.data)&&n.select===ne(this,$0))S=ne(this,Md);else try{ze(this,$0,n.select),S=n.select(w.data),S=$b(l==null?void 0:l.data,S,n),ze(this,Md,S),ze(this,ao,null)}catch(Q){ze(this,ao,Q)}else S=w.data;if(n.placeholderData!==void 0&&S===void 0&&R==="pending"){let Q;if(l!=null&&l.isPlaceholderData&&n.placeholderData===(f==null?void 0:f.placeholderData))Q=l.data;else if(Q=typeof n.placeholderData=="function"?n.placeholderData((K=ne(this,_d))==null?void 0:K.state.data,ne(this,_d)):n.placeholderData,n.select&&Q!==void 0)try{Q=n.select(Q),ze(this,ao,null)}catch(le){ze(this,ao,le)}Q!==void 0&&(R="success",S=$b(l==null?void 0:l.data,Q,n),x=!0)}ne(this,ao)&&(O=ne(this,ao),S=ne(this,Md),T=Date.now(),R="error");const k=w.fetchStatus==="fetching",F=R==="pending",U=R==="error",j=F&&k,z=S!==void 0,V={status:R,fetchStatus:w.fetchStatus,isPending:F,isSuccess:R==="success",isError:U,isInitialLoading:j,isLoading:j,data:S,dataUpdatedAt:w.dataUpdatedAt,error:O,errorUpdatedAt:T,failureCount:w.fetchFailureCount,failureReason:w.fetchFailureReason,errorUpdateCount:w.errorUpdateCount,isFetched:w.dataUpdateCount>0||w.errorUpdateCount>0,isFetchedAfterMount:w.dataUpdateCount>h.dataUpdateCount||w.errorUpdateCount>h.errorUpdateCount,isFetching:k,isRefetching:k&&!F,isLoadingError:U&&!z,isPaused:w.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:U&&z,isStale:v2(t,n),refetch:this.refetch,promise:ne(this,kc)};if(this.options.experimental_prefetchInRender){const Q=ae=>{V.status==="error"?ae.reject(V.error):V.data!==void 0&&ae.resolve(V.data)},le=()=>{const ae=ze(this,kc,V.promise=em());Q(ae)},ue=ne(this,kc);switch(ue.status){case"pending":t.queryHash===i.queryHash&&Q(ue);break;case"fulfilled":(V.status==="error"||V.data!==ue.value)&&le();break;case"rejected":(V.status!=="error"||V.error!==ue.reason)&&le();break}}return V}updateResult(t){const n=ne(this,mi),i=this.createResult(ne(this,_t),this.options);if(ze(this,Vu,ne(this,_t).state),ze(this,Rd,this.options),ne(this,Vu).data!==void 0&&ze(this,_d,ne(this,_t)),My(i,n))return;ze(this,mi,i);const s={},l=()=>{if(!n)return!0;const{notifyOnChangeProps:c}=this.options,f=typeof c=="function"?c():c;if(f==="all"||!f&&!ne(this,Nd).size)return!0;const d=new Set(f??ne(this,Nd));return this.options.throwOnError&&d.add("error"),Object.keys(ne(this,mi)).some(h=>{const m=h;return ne(this,mi)[m]!==n[m]&&d.has(m)})};(t==null?void 0:t.listeners)!==!1&&l()&&(s.listeners=!0),wt(this,zt,RA).call(this,{...s,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&wt(this,zt,im).call(this)}},Hi=new WeakMap,_t=new WeakMap,J0=new WeakMap,mi=new WeakMap,Vu=new WeakMap,Rd=new WeakMap,kc=new WeakMap,ao=new WeakMap,$0=new WeakMap,Md=new WeakMap,_d=new WeakMap,Yu=new WeakMap,Zu=new WeakMap,Pc=new WeakMap,Nd=new WeakMap,zt=new WeakSet,p0=function(t){wt(this,zt,om).call(this);let n=ne(this,_t).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ga)),n},tm=function(){wt(this,zt,am).call(this);const t=pd(this.options.staleTime,ne(this,_t));if(nf||ne(this,mi).isStale||!qb(t))return;const i=wA(ne(this,mi).dataUpdatedAt,t)+1;ze(this,Yu,setTimeout(()=>{ne(this,mi).isStale||this.updateResult()},i))},nm=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ne(this,_t)):this.options.refetchInterval)??!1},rm=function(t){wt(this,zt,sm).call(this),ze(this,Pc,t),!(nf||ps(this.options.enabled,ne(this,_t))===!1||!qb(ne(this,Pc))||ne(this,Pc)===0)&&ze(this,Zu,setInterval(()=>{(this.options.refetchIntervalInBackground||m2.isFocused())&&wt(this,zt,p0).call(this)},ne(this,Pc)))},im=function(){wt(this,zt,tm).call(this),wt(this,zt,rm).call(this,wt(this,zt,nm).call(this))},am=function(){ne(this,Yu)&&(clearTimeout(ne(this,Yu)),ze(this,Yu,void 0))},sm=function(){ne(this,Zu)&&(clearInterval(ne(this,Zu)),ze(this,Zu,void 0))},om=function(){const t=ne(this,Hi).getQueryCache().build(ne(this,Hi),this.options);if(t===ne(this,_t))return;const n=ne(this,_t);ze(this,_t,t),ze(this,J0,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},RA=function(t){dr.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(ne(this,mi))}),ne(this,Hi).getQueryCache().notify({query:ne(this,_t),type:"observerResultsUpdated"})})},d4);function fT(e,t){return ps(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function m6(e,t){return fT(e,t)||e.state.data!==void 0&&lm(e,t,t.refetchOnMount)}function lm(e,t,n){if(ps(t.enabled,e)!==!1){const i=typeof n=="function"?n(e):n;return i==="always"||i!==!1&&v2(e,t)}return!1}function v6(e,t,n,i){return(e!==t||ps(i.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&v2(e,n)}function v2(e,t){return ps(t.enabled,e)!==!1&&e.isStaleByTime(pd(t.staleTime,e))}function dT(e,t){return!My(e.getCurrentResult(),t)}var Lc,Uc,Gi,dl,pl,my,cm,h4,hT=(h4=class extends qd{constructor(n,i){super();$e(this,pl);$e(this,Lc);$e(this,Uc);$e(this,Gi);$e(this,dl);ze(this,Lc,n),this.setOptions(i),this.bindMethods(),wt(this,pl,my).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const i=this.options;this.options=ne(this,Lc).defaultMutationOptions(n),My(this.options,i)||ne(this,Lc).getMutationCache().notify({type:"observerOptionsUpdated",mutation:ne(this,Gi),observer:this}),i!=null&&i.mutationKey&&this.options.mutationKey&&rf(i.mutationKey)!==rf(this.options.mutationKey)?this.reset():((s=ne(this,Gi))==null?void 0:s.state.status)==="pending"&&ne(this,Gi).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=ne(this,Gi))==null||n.removeObserver(this)}onMutationUpdate(n){wt(this,pl,my).call(this),wt(this,pl,cm).call(this,n)}getCurrentResult(){return ne(this,Uc)}reset(){var n;(n=ne(this,Gi))==null||n.removeObserver(this),ze(this,Gi,void 0),wt(this,pl,my).call(this),wt(this,pl,cm).call(this)}mutate(n,i){var s;return ze(this,dl,i),(s=ne(this,Gi))==null||s.removeObserver(this),ze(this,Gi,ne(this,Lc).getMutationCache().build(ne(this,Lc),this.options)),ne(this,Gi).addObserver(this),ne(this,Gi).execute(n)}},Lc=new WeakMap,Uc=new WeakMap,Gi=new WeakMap,dl=new WeakMap,pl=new WeakSet,my=function(){var i;const n=((i=ne(this,Gi))==null?void 0:i.state)??OA();ze(this,Uc,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},cm=function(n){dr.batch(()=>{var i,s,l,c,f,d,h,m;if(ne(this,dl)&&this.hasListeners()){const w=ne(this,Uc).variables,x=ne(this,Uc).context;(n==null?void 0:n.type)==="success"?((s=(i=ne(this,dl)).onSuccess)==null||s.call(i,n.data,w,x),(c=(l=ne(this,dl)).onSettled)==null||c.call(l,n.data,null,w,x)):(n==null?void 0:n.type)==="error"&&((d=(f=ne(this,dl)).onError)==null||d.call(f,n.error,w,x),(m=(h=ne(this,dl)).onSettled)==null||m.call(h,void 0,n.error,w,x))}this.listeners.forEach(w=>{w(ne(this,Uc))})})},h4),MA=J.createContext(void 0),w2=e=>{const t=J.useContext(MA);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},yT=({client:e,children:t})=>(J.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),D.jsx(MA.Provider,{value:e,children:t})),_A=J.createContext(!1),gT=()=>J.useContext(_A);_A.Provider;function pT(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var bT=J.createContext(pT()),mT=()=>J.useContext(bT);function NA(e,t){return typeof e=="function"?e(...t):!!e}function um(){}var vT=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},wT=e=>{J.useEffect(()=>{e.clearReset()},[e])},AT=({result:e,errorResetBoundary:t,throwOnError:n,query:i,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(s&&e.data===void 0||NA(n,[e.error,i])),xT=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},ET=(e,t)=>e.isLoading&&e.isFetching&&!t,CT=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,w6=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ST(e,t,n){var w,x,S,O,T;const i=w2(),s=gT(),l=mT(),c=i.defaultQueryOptions(e);(x=(w=i.getDefaultOptions().queries)==null?void 0:w._experimental_beforeQuery)==null||x.call(w,c),c._optimisticResults=s?"isRestoring":"optimistic",xT(c),vT(c,l),wT(l);const f=!i.getQueryCache().get(c.queryHash),[d]=J.useState(()=>new t(i,c)),h=d.getOptimisticResult(c),m=!s&&e.subscribed!==!1;if(J.useSyncExternalStore(J.useCallback(R=>{const k=m?d.subscribe(dr.batchCalls(R)):um;return d.updateResult(),k},[d,m]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),J.useEffect(()=>{d.setOptions(c,{listeners:!1})},[c,d]),CT(c,h))throw w6(c,d,l);if(AT({result:h,errorResetBoundary:l,throwOnError:c.throwOnError,query:i.getQueryCache().get(c.queryHash),suspense:c.suspense}))throw h.error;if((O=(S=i.getDefaultOptions().queries)==null?void 0:S._experimental_afterQuery)==null||O.call(S,c,h),c.experimental_prefetchInRender&&!nf&&ET(h,s)){const R=f?w6(c,d,l):(T=i.getQueryCache().get(c.queryHash))==null?void 0:T.promise;R==null||R.catch(um).finally(()=>{d.updateResult()})}return c.notifyOnChangeProps?h:d.trackResult(h)}function o1(e,t){return ST(e,uT)}function Jd(e,t){const n=w2(),[i]=J.useState(()=>new hT(n,e));J.useEffect(()=>{i.setOptions(e)},[i,e]);const s=J.useSyncExternalStore(J.useCallback(c=>i.subscribe(dr.batchCalls(c)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),l=J.useCallback((c,f)=>{i.mutate(c,f).catch(um)},[i]);if(s.error&&NA(i.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:l,mutateAsync:s.mutate}}const _p="/docs/contract/encodeDeployData";function A2(e){const{abi:t,args:n,bytecode:i}=e;if(!n||n.length===0)return i;const s=t.find(c=>"type"in c&&c.type==="constructor");if(!s)throw new pC({docsPath:_p});if(!("inputs"in s))throw new a6({docsPath:_p});if(!s.inputs||s.inputs.length===0)throw new a6({docsPath:_p});const l=Xd(s.inputs,n);return Za([i,l])}function TT(e){const t=hr(`0x${e.substring(4)}`).substring(26);return jy(`0x${t}`)}const OT="modulepreload",RT=function(e){return"/"+e},A6={},l1=function(t,n,i){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),f=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));s=Promise.allSettled(n.map(d=>{if(d=RT(d),d in A6)return;A6[d]=!0;const h=d.endsWith(".css"),m=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${m}`))return;const w=document.createElement("link");if(w.rel=h?"stylesheet":OT,h||(w.as="script"),w.crossOrigin="",w.href=d,f&&w.setAttribute("nonce",f),document.head.appendChild(w),h)return new Promise((x,S)=>{w.addEventListener("load",x),w.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${d}`)))})}))}function l(c){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=c,window.dispatchEvent(f),!f.defaultPrevented)throw c}return s.then(c=>{for(const f of c||[])f.status==="rejected"&&l(f.reason);return t().catch(l)})};async function MT({hash:e,signature:t}){const n=lo(e)?e:rt(e),{secp256k1:i}=await l1(async()=>{const{secp256k1:c}=await Promise.resolve().then(()=>jM);return{secp256k1:c}},void 0);return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){const{r:h,s:m,v:w,yParity:x}=t,S=Number(x??w),O=x6(S);return new i.Signature(jr(h),jr(m)).addRecoveryBit(O)}const c=lo(t)?t:rt(t),f=ms(`0x${c.slice(130)}`),d=x6(f);return i.Signature.fromCompact(c.substring(2,130)).addRecoveryBit(d)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function x6(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}async function DA({hash:e,signature:t}){return TT(await MT({hash:e,signature:t}))}function _T(e){const{chainId:t,contractAddress:n,nonce:i,to:s}=e,l=hr(Za(["0x05",Hc([t?Ze(t):"0x",n,i?Ze(i):"0x"])]));return s==="bytes"?Qa(l):l}async function BA(e){const{authorization:t,signature:n}=e;return DA({hash:_T(t),signature:n??t})}function IA(e,{docsPath:t,...n}){const i=(()=>{const s=Jy(e,n);return s instanceof r1?e:s})();return new o9(i,{docsPath:t,...n})}function it(e,t,n){const i=e[t.name];if(typeof i=="function")return i;const s=e[n];return typeof s=="function"?s:l=>t(e,l)}async function x2(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return ms(t)}class NT extends Me{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class E2 extends Me{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class DT extends Me{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${ji(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class kA extends Me{constructor({blockHash:t,blockNumber:n}){let i="Block";t&&(i=`Block at hash "${t}"`),n&&(i=`Block at number "${n}"`),super(`${i} could not be found.`,{name:"BlockNotFoundError"})}}async function so(e,{blockHash:t,blockNumber:n,blockTag:i,includeTransactions:s}={}){var m,w,x;const l=i??"latest",c=s??!1,f=n!==void 0?Ze(n):void 0;let d=null;if(t?d=await e.request({method:"eth_getBlockByHash",params:[t,c]},{dedupe:!0}):d=await e.request({method:"eth_getBlockByNumber",params:[f||l,c]},{dedupe:!!f}),!d)throw new kA({blockHash:t,blockNumber:n});return(((x=(w=(m=e.chain)==null?void 0:m.formatters)==null?void 0:w.block)==null?void 0:x.format)||Xm)(d)}async function C2(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function BT(e,t){return PA(e,t)}async function PA(e,t){var l,c;const{block:n,chain:i=e.chain,request:s}=t||{};try{const f=((l=i==null?void 0:i.fees)==null?void 0:l.maxPriorityFeePerGas)??((c=i==null?void 0:i.fees)==null?void 0:c.defaultPriorityFee);if(typeof f=="function"){const h=n||await it(e,so,"getBlock")({}),m=await f({block:h,client:e,request:s});if(m===null)throw new Error;return m}if(typeof f<"u")return f;const d=await e.request({method:"eth_maxPriorityFeePerGas"});return jr(d)}catch{const[f,d]=await Promise.all([n?Promise.resolve(n):it(e,so,"getBlock")({}),it(e,C2,"getGasPrice")({})]);if(typeof f.baseFeePerGas!="bigint")throw new E2;const h=d-f.baseFeePerGas;return h<0n?0n:h}}async function IT(e,t){return fm(e,t)}async function fm(e,t){var x,S;const{block:n,chain:i=e.chain,request:s,type:l="eip1559"}=t||{},c=await(async()=>{var O,T;return typeof((O=i==null?void 0:i.fees)==null?void 0:O.baseFeeMultiplier)=="function"?i.fees.baseFeeMultiplier({block:n,client:e,request:s}):((T=i==null?void 0:i.fees)==null?void 0:T.baseFeeMultiplier)??1.2})();if(c<1)throw new NT;const d=10**(((x=c.toString().split(".")[1])==null?void 0:x.length)??0),h=O=>O*BigInt(Math.ceil(c*d))/BigInt(d),m=n||await it(e,so,"getBlock")({});if(typeof((S=i==null?void 0:i.fees)==null?void 0:S.estimateFeesPerGas)=="function"){const O=await i.fees.estimateFeesPerGas({block:n,client:e,multiply:h,request:s,type:l});if(O!==null)return O}if(l==="eip1559"){if(typeof m.baseFeePerGas!="bigint")throw new E2;const O=typeof(s==null?void 0:s.maxPriorityFeePerGas)=="bigint"?s.maxPriorityFeePerGas:await PA(e,{block:m,chain:i,request:s}),T=h(m.baseFeePerGas);return{maxFeePerGas:(s==null?void 0:s.maxFeePerGas)??T+O,maxPriorityFeePerGas:O}}return{gasPrice:(s==null?void 0:s.gasPrice)??h(await it(e,C2,"getGasPrice")({}))}}class kT extends Me{constructor(t,{account:n,docsPath:i,chain:s,data:l,gas:c,gasPrice:f,maxFeePerGas:d,maxPriorityFeePerGas:h,nonce:m,to:w,value:x}){var O;const S=n1({from:n==null?void 0:n.address,to:w,value:typeof x<"u"&&`${Km(x)} ${((O=s==null?void 0:s.nativeCurrency)==null?void 0:O.symbol)||"ETH"}`,data:l,gas:c,gasPrice:typeof f<"u"&&`${ji(f)} gwei`,maxFeePerGas:typeof d<"u"&&`${ji(d)} gwei`,maxPriorityFeePerGas:typeof h<"u"&&`${ji(h)} gwei`,nonce:m});super(t.shortMessage,{cause:t,docsPath:i,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",S].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}function PT(e,{docsPath:t,...n}){const i=(()=>{const s=Jy(e,n);return s instanceof r1?e:s})();return new kT(i,{docsPath:t,...n})}function E6(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:i})=>{if(n.length!==66)throw new Xw({size:n.length,targetSize:66,type:"hex"});if(i.length!==66)throw new Xw({size:i.length,targetSize:66,type:"hex"});return t[n]=i,t},{})}function LT(e){const{balance:t,nonce:n,state:i,stateDiff:s,code:l}=e,c={};if(l!==void 0&&(c.code=l),t!==void 0&&(c.balance=Ze(t)),n!==void 0&&(c.nonce=Ze(n)),i!==void 0&&(c.state=E6(i)),s!==void 0){if(c.state)throw new US;c.stateDiff=E6(s)}return c}function S2(e){if(!e)return;const t={};for(const{address:n,...i}of e){if(!yr(n,{strict:!1}))throw new ai({address:n});if(t[n])throw new LS({address:n});t[n]=LT(i)}return t}async function T2(e,{address:t,blockNumber:n,blockTag:i="latest"}){const s=n?Ze(n):void 0,l=await e.request({method:"eth_getBalance",params:[t,s||i]});return BigInt(l)}async function O2(e,t){var s,l,c;const{account:n=e.account}=t,i=n?si(n):void 0;try{let ce=function(L){const{block:te,request:ge,rpcStateOverride:pe}=L;return e.request({method:"eth_estimateGas",params:pe?[ge,te??"latest",pe]:te?[ge,te]:[ge]})};const{accessList:f,authorizationList:d,blobs:h,blobVersionedHashes:m,blockNumber:w,blockTag:x,data:S,gas:O,gasPrice:T,maxFeePerBlobGas:R,maxFeePerGas:k,maxPriorityFeePerGas:F,nonce:U,value:j,stateOverride:z,...H}=await R2(e,{...t,parameters:(i==null?void 0:i.type)==="local"?void 0:["blobVersionedHashes"]}),K=(w?Ze(w):void 0)||x,Q=S2(z),le=await(async()=>{if(H.to)return H.to;if(d&&d.length>0)return await BA({authorization:d[0]}).catch(()=>{throw new Me("`to` is required. Could not infer from `authorizationList`")})})();Kd(t);const ue=(c=(l=(s=e.chain)==null?void 0:s.formatters)==null?void 0:l.transactionRequest)==null?void 0:c.format,me=(ue||t1)({...$y(H,{format:ue}),from:i==null?void 0:i.address,accessList:f,authorizationList:d,blobs:h,blobVersionedHashes:m,data:S,gas:O,gasPrice:T,maxFeePerBlobGas:R,maxFeePerGas:k,maxPriorityFeePerGas:F,nonce:U,to:le,value:j});let W=BigInt(await ce({block:K,request:me,rpcStateOverride:Q}));if(d){const L=await T2(e,{address:me.from}),te=await Promise.all(d.map(async ge=>{const{contractAddress:pe}=ge,P=await ce({block:K,request:{authorizationList:void 0,data:S,from:i==null?void 0:i.address,to:pe,value:Ze(L)},rpcStateOverride:Q}).catch(()=>100000n);return 2n*BigInt(P)}));W+=te.reduce((ge,pe)=>ge+pe,0n)}return W}catch(f){throw PT(f,{...t,account:i,chain:e.chain})}}async function LA(e,{address:t,blockTag:n="latest",blockNumber:i}){const s=await e.request({method:"eth_getTransactionCount",params:[t,i?Ze(i):n]},{dedupe:!!i});return ms(s)}const UA=["blobVersionedHashes","chainId","fees","gas","nonce","type"],C6=new Map;async function R2(e,t){const{account:n=e.account,blobs:i,chain:s,gas:l,kzg:c,nonce:f,nonceManager:d,parameters:h=UA,type:m}=t,w=n&&si(n),x={...t,...w?{from:w==null?void 0:w.address}:{}};let S;async function O(){return S||(S=await it(e,so,"getBlock")({blockTag:"latest"}),S)}let T;async function R(){return T||(s?s.id:typeof t.chainId<"u"?t.chainId:(T=await it(e,x2,"getChainId")({}),T))}if(h.includes("nonce")&&typeof f>"u"&&w)if(d){const k=await R();x.nonce=await d.consume({address:w.address,chainId:k,client:e})}else x.nonce=await it(e,LA,"getTransactionCount")({address:w.address,blockTag:"pending"});if((h.includes("blobVersionedHashes")||h.includes("sidecars"))&&i&&c){const k=qm({blobs:i,kzg:c});if(h.includes("blobVersionedHashes")){const F=D4({commitments:k,to:"hex"});x.blobVersionedHashes=F}if(h.includes("sidecars")){const F=Jm({blobs:i,commitments:k,kzg:c}),U=L4({blobs:i,commitments:k,proofs:F,to:"hex"});x.sidecars=U}}if(h.includes("chainId")&&(x.chainId=await R()),(h.includes("fees")||h.includes("type"))&&typeof m>"u")try{x.type=Z4(x)}catch{let k=C6.get(e.uid);if(typeof k>"u"){const F=await O();k=typeof(F==null?void 0:F.baseFeePerGas)=="bigint",C6.set(e.uid,k)}x.type=k?"eip1559":"legacy"}if(h.includes("fees"))if(x.type!=="legacy"&&x.type!=="eip2930"){if(typeof x.maxFeePerGas>"u"||typeof x.maxPriorityFeePerGas>"u"){const k=await O(),{maxFeePerGas:F,maxPriorityFeePerGas:U}=await fm(e,{block:k,chain:s,request:x});if(typeof t.maxPriorityFeePerGas>"u"&&t.maxFeePerGas&&t.maxFeePerGas"u"){const k=await O(),{gasPrice:F}=await fm(e,{block:k,chain:s,request:x,type:"legacy"});x.gasPrice=F}}return h.includes("gas")&&typeof l>"u"&&(x.gas=await it(e,O2,"estimateGas")({...x,account:w&&{address:w.address,type:"json-rpc"}})),Kd(x),delete x.parameters,x}async function FA(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}const Np=new Qy(128);async function UT(e,t){var k,F,U,j;const{account:n=e.account,chain:i=e.chain,accessList:s,authorizationList:l,blobs:c,data:f,gas:d,gasPrice:h,maxFeePerBlobGas:m,maxFeePerGas:w,maxPriorityFeePerGas:x,nonce:S,value:O,...T}=t;if(typeof n>"u")throw new Yy({docsPath:"/docs/actions/wallet/sendTransaction"});const R=n?si(n):null;try{Kd(t);const z=await(async()=>{if(t.to)return t.to;if(l&&l.length>0)return await BA({authorization:l[0]}).catch(()=>{throw new Me("`to` is required. Could not infer from `authorizationList`.")})})();if((R==null?void 0:R.type)==="json-rpc"||R===null){let H;i!==null&&(H=await it(e,x2,"getChainId")({}),dC({currentChainId:H,chain:i}));const V=(U=(F=(k=e.chain)==null?void 0:k.formatters)==null?void 0:F.transactionRequest)==null?void 0:U.format,Q=(V||t1)({...$y(T,{format:V}),accessList:s,authorizationList:l,blobs:c,chainId:H,data:f,from:R==null?void 0:R.address,gas:d,gasPrice:h,maxFeePerBlobGas:m,maxFeePerGas:w,maxPriorityFeePerGas:x,nonce:S,to:z,value:O}),le=Np.get(e.uid),ue=le?"wallet_sendTransaction":"eth_sendTransaction";try{return await e.request({method:ue,params:[Q]},{retryCount:0})}catch(ae){if(le===!1)throw ae;const me=ae;if(me.name==="InvalidInputRpcError"||me.name==="InvalidParamsRpcError"||me.name==="MethodNotFoundRpcError"||me.name==="MethodNotSupportedRpcError")return await e.request({method:"wallet_sendTransaction",params:[Q]},{retryCount:0}).then(ce=>(Np.set(e.uid,!0),ce)).catch(ce=>{const W=ce;throw W.name==="MethodNotFoundRpcError"||W.name==="MethodNotSupportedRpcError"?(Np.set(e.uid,!1),me):W});throw me}}if((R==null?void 0:R.type)==="local"){const H=await it(e,R2,"prepareTransactionRequest")({account:R,accessList:s,authorizationList:l,blobs:c,chain:i,data:f,gas:d,gasPrice:h,maxFeePerBlobGas:m,maxFeePerGas:w,maxPriorityFeePerGas:x,nonce:S,nonceManager:R.nonceManager,parameters:[...UA,"sidecars"],value:O,...T,to:z}),V=(j=i==null?void 0:i.serializers)==null?void 0:j.transaction,K=await R.signTransaction(H,{serializer:V});return await it(e,FA,"sendRawTransaction")({serializedTransaction:K})}throw(R==null?void 0:R.type)==="smart"?new Op({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new Op({docsPath:"/docs/actions/wallet/sendTransaction",type:R==null?void 0:R.type})}catch(z){throw z instanceof Op?z:IA(z,{...t,account:R,chain:t.chain||void 0})}}const dm=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],zA=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],HA=[...zA,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],FT=[...zA,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],S6=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],T6=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],O6=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}],zT=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],Dp="/docs/contract/decodeFunctionResult";function ff(e){const{abi:t,args:n,functionName:i,data:s}=e;let l=t[0];if(i){const f=s1({abi:t,args:n,name:i});if(!f)throw new Oy(i,{docsPath:Dp});l=f}if(l.type!=="function")throw new Oy(void 0,{docsPath:Dp});if(!l.outputs)throw new wC(l.name,{docsPath:Dp});const c=Wy(l.outputs,s);if(c&&c.length>1)return c;if(c&&c.length===1)return c[0]}const R6="/docs/contract/encodeFunctionData";function HT(e){const{abi:t,args:n,functionName:i}=e;let s=t[0];if(i){const l=s1({abi:t,args:n,name:i});if(!l)throw new Oy(i,{docsPath:R6});s=l}if(s.type!=="function")throw new Oy(void 0,{docsPath:R6});return{abi:[s],functionName:a2(wl(s))}}function Xa(e){const{args:t}=e,{abi:n,functionName:i}=(()=>{var f;return e.abi.length===1&&((f=e.functionName)!=null&&f.startsWith("0x"))?e:HT(e)})(),s=n[0],l=i,c="inputs"in s&&s.inputs?Xd(s.inputs,t??[]):void 0;return Za([l,c??"0x"])}function M2(e,t){var i,s,l,c,f,d;if(!(e instanceof Me))return!1;const n=e.walk(h=>h instanceof Kb);return n instanceof Kb?!!(((i=n.data)==null?void 0:i.errorName)==="ResolverNotFound"||((s=n.data)==null?void 0:s.errorName)==="ResolverWildcardNotSupported"||((l=n.data)==null?void 0:l.errorName)==="ResolverNotContract"||((c=n.data)==null?void 0:c.errorName)==="ResolverError"||((f=n.data)==null?void 0:f.errorName)==="HttpError"||(d=n.reason)!=null&&d.includes("Wildcard on non-extended resolvers is not supported")||t==="reverse"&&n.reason===X4[50]):!1}function GA(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return lo(t)?t:null}function x0(e){let t=new Uint8Array(32).fill(0);if(!e)return tr(t);const n=e.split(".");for(let i=n.length-1;i>=0;i-=1){const s=GA(n[i]),l=s?Qd(s):hr(Xu(n[i]),"bytes");t=hr(ml([t,l]),"bytes")}return tr(t)}function GT(e){return`[${e.slice(2)}]`}function QT(e){const t=new Uint8Array(32).fill(0);return e?GA(e)||hr(Xu(e)):tr(t)}function eg(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const n=new Uint8Array(Xu(t).byteLength+2);let i=0;const s=t.split(".");for(let l=0;l255&&(c=Xu(GT(QT(s[l])))),n[i]=c.length,n.set(c,i+1),i+=c.length+1}return n.byteLength!==i+1?n.slice(0,i+1):n}const jT=3;function Id(e,{abi:t,address:n,args:i,docsPath:s,functionName:l,sender:c}){const f=e instanceof qy?e:e instanceof Me?e.walk(O=>"data"in O)||e.walk():{},{code:d,data:h,details:m,message:w,shortMessage:x}=f,S=e instanceof a1?new HS({functionName:l}):[jT,ef.code].includes(d)&&(h||m||w||x)?new Kb({abi:t,data:typeof h=="object"?h.data:h,functionName:l,message:f instanceof f2?m:x??w}):e;return new bA(S,{abi:t,args:i,contractAddress:n,docsPath:s,functionName:l,sender:c})}const VT="0x82ad56cb",QA="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",YT="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",ZT="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";function jA(){let e=()=>{},t=()=>{};return{promise:new Promise((i,s)=>{e=i,t=s}),resolve:e,reject:t}}const Bp=new Map;function VA({fn:e,id:t,shouldSplitBatch:n,wait:i=0,sort:s}){const l=async()=>{const m=d();c();const w=m.map(({args:x})=>x);w.length!==0&&e(w).then(x=>{s&&Array.isArray(x)&&x.sort(s);for(let S=0;S{for(let S=0;SBp.delete(t),f=()=>d().map(({args:m})=>m),d=()=>Bp.get(t)||[],h=m=>Bp.set(t,[...d(),m]);return{flush:c,async schedule(m){const{promise:w,resolve:x,reject:S}=jA();return(n==null?void 0:n([...f(),m]))&&l(),d().length>0?(h({args:m,resolve:x,reject:S}),w):(h({args:m,resolve:x,reject:S}),setTimeout(l,i),w)}}}async function c1(e,t){var ue,ae,me,ce;const{account:n=e.account,batch:i=!!((ue=e.batch)!=null&&ue.multicall),blockNumber:s,blockTag:l="latest",accessList:c,blobs:f,code:d,data:h,factory:m,factoryData:w,gas:x,gasPrice:S,maxFeePerBlobGas:O,maxFeePerGas:T,maxPriorityFeePerGas:R,nonce:k,to:F,value:U,stateOverride:j,...z}=t,H=n?si(n):void 0;if(d&&(m||w))throw new Me("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(d&&F)throw new Me("Cannot provide both `code` & `to` as parameters.");const V=d&&h,K=m&&w&&F&&h,Q=V||K,le=V?KT({code:d,data:h}):K?qT({data:h,factory:m,factoryData:w,to:F}):h;try{Kd(t);const L=(s?Ze(s):void 0)||l,te=S2(j),ge=(ce=(me=(ae=e.chain)==null?void 0:ae.formatters)==null?void 0:me.transactionRequest)==null?void 0:ce.format,P=(ge||t1)({...$y(z,{format:ge}),from:H==null?void 0:H.address,accessList:c,blobs:f,data:le,gas:x,gasPrice:S,maxFeePerBlobGas:O,maxFeePerGas:T,maxPriorityFeePerGas:R,nonce:k,to:Q?void 0:F,value:U});if(i&&XT({request:P})&&!te)try{return await WT(e,{...P,blockNumber:s,blockTag:l})}catch(Ie){if(!(Ie instanceof U4)&&!(Ie instanceof kb))throw Ie}const Z=await e.request({method:"eth_call",params:te?[P,L,te]:[P,L]});return Z==="0x"?{data:void 0}:{data:Z}}catch(W){const L=JT(W),{offchainLookup:te,offchainLookupSignature:ge}=await l1(async()=>{const{offchainLookup:pe,offchainLookupSignature:P}=await import("./ccip-K_PoQNED.js");return{offchainLookup:pe,offchainLookupSignature:P}},[]);if(e.ccipRead!==!1&&(L==null?void 0:L.slice(0,10))===ge&&F)return{data:await te(e,{data:L,to:F})};throw Q&&(L==null?void 0:L.slice(0,10))==="0x101bb98d"?new GS({factory:m}):mA(W,{...t,account:H,chain:e.chain})}}function XT({request:e}){const{data:t,to:n,...i}=e;return!(!t||t.startsWith(VT)||!n||Object.values(i).filter(s=>typeof s<"u").length>0)}async function WT(e,t){var T;const{batchSize:n=1024,wait:i=0}=typeof((T=e.batch)==null?void 0:T.multicall)=="object"?e.batch.multicall:{},{blockNumber:s,blockTag:l="latest",data:c,multicallAddress:f,to:d}=t;let h=f;if(!h){if(!e.chain)throw new U4;h=Yd({blockNumber:s,chain:e.chain,contract:"multicall3"})}const w=(s?Ze(s):void 0)||l,{schedule:x}=VA({id:`${e.uid}.${w}`,wait:i,shouldSplitBatch(R){return R.reduce((F,{data:U})=>F+(U.length-2),0)>n*2},fn:async R=>{const k=R.map(j=>({allowFailure:!0,callData:j.data,target:j.to})),F=Xa({abi:dm,args:[k],functionName:"aggregate3"}),U=await e.request({method:"eth_call",params:[{data:F,to:h},w]});return ff({abi:dm,args:[k],functionName:"aggregate3",data:U||"0x"})}}),[{returnData:S,success:O}]=await x({data:c,to:d});if(!O)throw new qy({data:S});return S==="0x"?{data:void 0}:{data:S}}function KT(e){const{code:t,data:n}=e;return A2({abi:i2(["constructor(bytes, bytes)"]),bytecode:QA,args:[t,n]})}function qT(e){const{data:t,factory:n,factoryData:i,to:s}=e;return A2({abi:i2(["constructor(address, bytes, address, bytes)"]),bytecode:YT,args:[s,t,n,i]})}function JT(e){var n;if(!(e instanceof Me))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(n=t.data)==null?void 0:n.data:t.data}async function co(e,t){const{abi:n,address:i,args:s,functionName:l,...c}=t,f=Xa({abi:n,args:s,functionName:l});try{const{data:d}=await it(e,c1,"call")({...c,data:f,to:i});return ff({abi:n,args:s,functionName:l,data:d||"0x"})}catch(d){throw Id(d,{abi:n,address:i,args:s,docsPath:"/docs/contract/readContract",functionName:l})}}async function $T(e,{blockNumber:t,blockTag:n,coinType:i,name:s,gatewayUrls:l,strict:c,universalResolverAddress:f}){let d=f;if(!d){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");d=Yd({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const h=Xa({abi:T6,functionName:"addr",...i!=null?{args:[x0(s),BigInt(i)]}:{args:[x0(s)]}}),m={address:d,abi:HA,functionName:"resolve",args:[rt(eg(s)),h],blockNumber:t,blockTag:n},w=it(e,co,"readContract"),x=l?await w({...m,args:[...m.args,l]}):await w(m);if(x[0]==="0x")return null;const S=ff({abi:T6,args:i!=null?[x0(s),BigInt(i)]:void 0,functionName:"addr",data:x[0]});return S==="0x"||ya(S)==="0x00"?null:S}catch(h){if(c)throw h;if(M2(h,"resolve"))return null;throw h}}class eO extends Me{constructor({data:t}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(t)}`],name:"EnsAvatarInvalidMetadataError"})}}class c0 extends Me{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class _2 extends Me{constructor({uri:t}){super(`Unable to resolve ENS avatar URI "${t}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class tO extends Me{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const nO=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,rO=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,iO=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,aO=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function sO(e){try{const t=await fetch(e,{method:"HEAD"});if(t.status===200){const n=t.headers.get("content-type");return n==null?void 0:n.startsWith("image/")}return!1}catch(t){return typeof t=="object"&&typeof t.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(n=>{const i=new Image;i.onload=()=>{n(!0)},i.onerror=()=>{n(!1)},i.src=e})}}function M6(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function YA({uri:e,gatewayUrls:t}){const n=iO.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const i=M6(t==null?void 0:t.ipfs,"https://ipfs.io"),s=M6(t==null?void 0:t.arweave,"https://arweave.net"),l=e.match(nO),{protocol:c,subpath:f,target:d,subtarget:h=""}=(l==null?void 0:l.groups)||{},m=c==="ipns:/"||f==="ipns/",w=c==="ipfs:/"||f==="ipfs/"||rO.test(e);if(e.startsWith("http")&&!m&&!w){let S=e;return t!=null&&t.arweave&&(S=e.replace(/https:\/\/arweave.net/g,t==null?void 0:t.arweave)),{uri:S,isOnChain:!1,isEncoded:!1}}if((m||w)&&d)return{uri:`${i}/${m?"ipns":"ipfs"}/${d}${h}`,isOnChain:!1,isEncoded:!1};if(c==="ar:/"&&d)return{uri:`${s}/${d}${h||""}`,isOnChain:!1,isEncoded:!1};let x=e.replace(aO,"");if(x.startsWith("s.json());return await N2({gatewayUrls:e,uri:ZA(n)})}catch{throw new _2({uri:t})}}async function N2({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:i}=YA({uri:t,gatewayUrls:e});if(i||await sO(n))return n;throw new _2({uri:t})}function lO(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,i,s]=t.split("/"),[l,c]=n.split(":"),[f,d]=i.split(":");if(!l||l.toLowerCase()!=="eip155")throw new c0({reason:"Only EIP-155 supported"});if(!c)throw new c0({reason:"Chain ID not found"});if(!d)throw new c0({reason:"Contract address not found"});if(!s)throw new c0({reason:"Token ID not found"});if(!f)throw new c0({reason:"ERC namespace not found"});return{chainID:Number.parseInt(c),namespace:f.toLowerCase(),contractAddress:d,tokenID:s}}async function cO(e,{nft:t}){if(t.namespace==="erc721")return co(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if(t.namespace==="erc1155")return co(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new tO({namespace:t.namespace})}async function uO(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?fO(e,{gatewayUrls:t,record:n}):N2({uri:n,gatewayUrls:t})}async function fO(e,{gatewayUrls:t,record:n}){const i=lO(n),s=await cO(e,{nft:i}),{uri:l,isOnChain:c,isEncoded:f}=YA({uri:s,gatewayUrls:t});if(c&&(l.includes("data:application/json;base64,")||l.startsWith("{"))){const h=f?atob(l.replace("data:application/json;base64,","")):l,m=JSON.parse(h);return N2({uri:ZA(m),gatewayUrls:t})}let d=i.tokenID;return i.namespace==="erc1155"&&(d=d.replace("0x","").padStart(64,"0")),oO({gatewayUrls:t,uri:l.replace(/(?:0x)?{id}/,d)})}async function XA(e,{blockNumber:t,blockTag:n,name:i,key:s,gatewayUrls:l,strict:c,universalResolverAddress:f}){let d=f;if(!d){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");d=Yd({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const h={address:d,abi:HA,functionName:"resolve",args:[rt(eg(i)),Xa({abi:S6,functionName:"text",args:[x0(i),s]})],blockNumber:t,blockTag:n},m=it(e,co,"readContract"),w=l?await m({...h,args:[...h.args,l]}):await m(h);if(w[0]==="0x")return null;const x=ff({abi:S6,functionName:"text",data:w[0]});return x===""?null:x}catch(h){if(c)throw h;if(M2(h,"resolve"))return null;throw h}}async function dO(e,{blockNumber:t,blockTag:n,assetGatewayUrls:i,name:s,gatewayUrls:l,strict:c,universalResolverAddress:f}){const d=await it(e,XA,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:s,universalResolverAddress:f,gatewayUrls:l,strict:c});if(!d)return null;try{return await uO(e,{record:d,gatewayUrls:i})}catch{return null}}async function hO(e,{address:t,blockNumber:n,blockTag:i,gatewayUrls:s,strict:l,universalResolverAddress:c}){let f=c;if(!f){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");f=Yd({blockNumber:n,chain:e.chain,contract:"ensUniversalResolver"})}const d=`${t.toLowerCase().substring(2)}.addr.reverse`;try{const h={address:f,abi:FT,functionName:"reverse",args:[rt(eg(d))],blockNumber:n,blockTag:i},m=it(e,co,"readContract"),[w,x]=s?await m({...h,args:[...h.args,s]}):await m(h);return t.toLowerCase()!==x.toLowerCase()?null:w}catch(h){if(l)throw h;if(M2(h,"reverse"))return null;throw h}}async function yO(e,{blockNumber:t,blockTag:n,name:i,universalResolverAddress:s}){let l=s;if(!l){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");l=Yd({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}const[c]=await it(e,co,"readContract")({address:l,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[rt(eg(i))],blockNumber:t,blockTag:n});return c}async function WA(e,t){var R,k,F;const{account:n=e.account,blockNumber:i,blockTag:s="latest",blobs:l,data:c,gas:f,gasPrice:d,maxFeePerBlobGas:h,maxFeePerGas:m,maxPriorityFeePerGas:w,to:x,value:S,...O}=t,T=n?si(n):void 0;try{Kd(t);const j=(i?Ze(i):void 0)||s,z=(F=(k=(R=e.chain)==null?void 0:R.formatters)==null?void 0:k.transactionRequest)==null?void 0:F.format,V=(z||t1)({...$y(O,{format:z}),from:T==null?void 0:T.address,blobs:l,data:c,gas:f,gasPrice:d,maxFeePerBlobGas:h,maxFeePerGas:m,maxPriorityFeePerGas:w,to:x,value:S}),K=await e.request({method:"eth_createAccessList",params:[V,j]});return{accessList:K.accessList,gasUsed:BigInt(K.gasUsed)}}catch(U){throw mA(U,{...t,account:T,chain:e.chain})}}function tg(e,{method:t}){var i,s;const n={};return e.transport.type==="fallback"&&((s=(i=e.transport).onResponse)==null||s.call(i,({method:l,response:c,status:f,transport:d})=>{f==="success"&&t===l&&(n[c]=d.request)})),l=>n[l]||e.request}async function gO(e){const t=tg(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}class pO extends Me{constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}const _6="/docs/contract/encodeEventTopics";function u1(e){var d;const{abi:t,eventName:n,args:i}=e;let s=t[0];if(n){const h=s1({abi:t,name:n});if(!h)throw new s6(n,{docsPath:_6});s=h}if(s.type!=="event")throw new s6(void 0,{docsPath:_6});const l=wl(s),c=Ky(l);let f=[];if(i&&"inputs"in s){const h=(d=s.inputs)==null?void 0:d.filter(w=>"indexed"in w&&w.indexed),m=Array.isArray(i)?i:Object.values(i).length>0?(h==null?void 0:h.map(w=>i[w.name]))??[]:[];m.length>0&&(f=(h==null?void 0:h.map((w,x)=>Array.isArray(m[x])?m[x].map((S,O)=>N6({param:w,value:m[x][O]})):typeof m[x]<"u"&&m[x]!==null?N6({param:w,value:m[x]}):null))??[])}return[c,...f]}function N6({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return hr(Qd(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new pO(e.type);return Xd([e],[t])}async function KA(e,t){const{address:n,abi:i,args:s,eventName:l,fromBlock:c,strict:f,toBlock:d}=t,h=tg(e,{method:"eth_newFilter"}),m=l?u1({abi:i,args:s,eventName:l}):void 0,w=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof c=="bigint"?Ze(c):c,toBlock:typeof d=="bigint"?Ze(d):d,topics:m}]});return{abi:i,args:s,eventName:l,id:w,request:h(w),strict:!!f,type:"event"}}async function qA(e,{address:t,args:n,event:i,events:s,fromBlock:l,strict:c,toBlock:f}={}){const d=s??(i?[i]:void 0),h=tg(e,{method:"eth_newFilter"});let m=[];d&&(m=[d.flatMap(S=>u1({abi:[S],eventName:S.name,args:n}))],i&&(m=m[0]));const w=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof l=="bigint"?Ze(l):l,toBlock:typeof f=="bigint"?Ze(f):f,...m.length?{topics:m}:{}}]});return{abi:d,args:n,eventName:i?i.name:void 0,fromBlock:l,id:w,request:h(w),strict:!!c,toBlock:f,type:"event"}}async function JA(e){const t=tg(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function bO(e,t){const{abi:n,address:i,args:s,functionName:l,dataSuffix:c,...f}=t,d=Xa({abi:n,args:s,functionName:l});try{return await it(e,O2,"estimateGas")({data:`${d}${c?c.replace("0x",""):""}`,to:i,...f})}catch(h){const m=f.account?si(f.account):void 0;throw Id(h,{abi:n,address:i,args:s,docsPath:"/docs/contract/estimateContractGas",functionName:l,sender:m==null?void 0:m.address})}}async function mO(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}const vO=new Map,wO=new Map;function AO(e){const t=(s,l)=>({clear:()=>l.delete(s),get:()=>l.get(s),set:c=>l.set(s,c)}),n=t(e,vO),i=t(e,wO);return{clear:()=>{n.clear(),i.clear()},promise:n,response:i}}async function xO(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const i=AO(t),s=i.response.get();if(s&&n>0&&new Date().getTime()-s.created.getTime()`blockNumber.${e}`;async function f1(e,{cacheTime:t=e.cacheTime}={}){const n=await xO(()=>e.request({method:"eth_blockNumber"}),{cacheKey:EO(e.uid),cacheTime:t});return BigInt(n)}async function CO(e,{blockHash:t,blockNumber:n,blockTag:i="latest"}={}){const s=n!==void 0?Ze(n):void 0;let l;return t?l=await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):l=await e.request({method:"eth_getBlockTransactionCountByNumber",params:[s||i]},{dedupe:!!s}),ms(l)}function D2(e,t){if(!yr(e,{strict:!1}))throw new ai({address:e});if(!yr(t,{strict:!1}))throw new ai({address:t});return e.toLowerCase()===t.toLowerCase()}const D6="/docs/contract/decodeEventLog";function B2(e){const{abi:t,data:n,strict:i,topics:s}=e,l=i??!0,[c,...f]=s;if(!c)throw new vC({docsPath:D6});const d=t.length===1?t[0]:t.find(T=>T.type==="event"&&c===Ky(wl(T)));if(!(d&&"name"in d)||d.type!=="event")throw new J4(c,{docsPath:D6});const{name:h,inputs:m}=d,w=m==null?void 0:m.some(T=>!("name"in T&&T.name));let x=w?[]:{};const S=m.filter(T=>"indexed"in T&&T.indexed);for(let T=0;T!("indexed"in T&&T.indexed));if(O.length>0){if(n&&n!=="0x")try{const T=Wy(O,n);if(T)if(w)x=[...x,...T];else for(let R=0;R0?x:void 0}}function SO({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(Wy([e],t)||[])[0]}function I2(e){const{abi:t,args:n,logs:i,strict:s=!0}=e,l=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})();return i.map(c=>{var f;try{const d=t.find(m=>m.type==="event"&&c.topics[0]===Ky(m));if(!d)return null;const h=B2({...c,abi:[d],strict:s});return l&&!l.includes(h.eventName)||!TO({args:h.args,inputs:d.inputs,matchArgs:n})?null:{...h,...c}}catch(d){let h,m;if(d instanceof J4)return null;if(d instanceof R0||d instanceof Xy){if(s)return null;h=d.abiItem.name,m=(f=d.abiItem.inputs)==null?void 0:f.some(w=>!("name"in w&&w.name))}return{...c,args:m?[]:{},eventName:h}}}).filter(Boolean)}function TO(e){const{args:t,inputs:n,matchArgs:i}=e;if(!i)return!0;if(!t)return!1;function s(l,c,f){try{return l.type==="address"?D2(c,f):l.type==="string"||l.type==="bytes"?hr(Qd(c))===f:c===f}catch{return!1}}return Array.isArray(t)&&Array.isArray(i)?i.every((l,c)=>{if(l==null)return!0;const f=n[c];return f?(Array.isArray(l)?l:[l]).some(h=>s(f,h,t[c])):!1}):typeof t=="object"&&!Array.isArray(t)&&typeof i=="object"&&!Array.isArray(i)?Object.entries(i).every(([l,c])=>{if(c==null)return!0;const f=n.find(h=>h.name===l);return f?(Array.isArray(c)?c:[c]).some(h=>s(f,h,t[l])):!1}):!1}async function k2(e,{address:t,blockHash:n,fromBlock:i,toBlock:s,event:l,events:c,args:f,strict:d}={}){const h=d??!1,m=c??(l?[l]:void 0);let w=[];m&&(w=[m.flatMap(T=>u1({abi:[T],eventName:T.name,args:c?void 0:f}))],l&&(w=w[0]));let x;n?x=await e.request({method:"eth_getLogs",params:[{address:t,topics:w,blockHash:n}]}):x=await e.request({method:"eth_getLogs",params:[{address:t,topics:w,fromBlock:typeof i=="bigint"?Ze(i):i,toBlock:typeof s=="bigint"?Ze(s):s}]});const S=x.map(O=>bl(O));return m?I2({abi:m,args:f,logs:S,strict:h}):S}async function $A(e,t){const{abi:n,address:i,args:s,blockHash:l,eventName:c,fromBlock:f,toBlock:d,strict:h}=t,m=c?s1({abi:n,name:c}):void 0,w=m?void 0:n.filter(x=>x.type==="event");return it(e,k2,"getLogs")({address:i,args:s,blockHash:l,event:m,events:w,fromBlock:f,toBlock:d,strict:h})}class OO extends Me{constructor({address:t}){super(`No EIP-712 domain found on contract "${t}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${t}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function RO(e,t){const{address:n,factory:i,factoryData:s}=t;try{const[l,c,f,d,h,m,w]=await it(e,co,"readContract")({abi:MO,address:n,functionName:"eip712Domain",factory:i,factoryData:s});return{domain:{name:c,version:f,chainId:Number(d),verifyingContract:h,salt:m},extensions:w,fields:l}}catch(l){const c=l;throw c.name==="ContractFunctionExecutionError"&&c.cause.name==="ContractFunctionZeroDataError"?new OO({address:n}):c}}const MO=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];function _O(e){var t;return{baseFeePerGas:e.baseFeePerGas.map(n=>BigInt(n)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:(t=e.reward)==null?void 0:t.map(n=>n.map(i=>BigInt(i)))}}async function NO(e,{blockCount:t,blockNumber:n,blockTag:i="latest",rewardPercentiles:s}){const l=n?Ze(n):void 0,c=await e.request({method:"eth_feeHistory",params:[Ze(t),l||i,s]},{dedupe:!!l});return _O(c)}async function ng(e,{filter:t}){const n="strict"in t&&t.strict,i=await t.request({method:"eth_getFilterChanges",params:[t.id]});if(typeof i[0]=="string")return i;const s=i.map(l=>bl(l));return!("abi"in t)||!t.abi?s:I2({abi:t.abi,logs:s,strict:n})}async function DO(e,{filter:t}){const n=t.strict??!1,s=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(l=>bl(l));return t.abi?I2({abi:t.abi,logs:s,strict:n}):s}async function BO(e,{address:t,blockNumber:n,blockTag:i="latest",slot:s}){const l=n!==void 0?Ze(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,s,l||i]})}async function rg(e,{blockHash:t,blockNumber:n,blockTag:i,hash:s,index:l}){var m,w,x;const c=i||"latest",f=n!==void 0?Ze(n):void 0;let d=null;if(s?d=await e.request({method:"eth_getTransactionByHash",params:[s]},{dedupe:!0}):t?d=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,Ze(l)]},{dedupe:!0}):d=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[f||c,Ze(l)]},{dedupe:!!f}),!d)throw new T4({blockHash:t,blockNumber:n,blockTag:c,hash:s,index:l});return(((x=(w=(m=e.chain)==null?void 0:m.formatters)==null?void 0:w.transaction)==null?void 0:x.format)||Fy)(d)}async function IO(e,{hash:t,transactionReceipt:n}){const[i,s]=await Promise.all([it(e,f1,"getBlockNumber")({}),t?it(e,rg,"getTransaction")({hash:t}):void 0]),l=(n==null?void 0:n.blockNumber)||(s==null?void 0:s.blockNumber);return l?i-l+1n:0n}async function hm(e,{hash:t}){var s,l,c;const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new O4({hash:t});return(((c=(l=(s=e.chain)==null?void 0:s.formatters)==null?void 0:l.transactionReceipt)==null?void 0:c.format)||x4)(n)}async function e8(e,t){var R;const{allowFailure:n=!0,batchSize:i,blockNumber:s,blockTag:l,multicallAddress:c,stateOverride:f}=t,d=t.contracts,h=i??(typeof((R=e.batch)==null?void 0:R.multicall)=="object"&&e.batch.multicall.batchSize||1024);let m=c;if(!m){if(!e.chain)throw new Error("client chain not configured. multicallAddress is required.");m=Yd({blockNumber:s,chain:e.chain,contract:"multicall3"})}const w=[[]];let x=0,S=0;for(let k=0;k0&&S>h&&w[x].length>0&&(x++,S=(H.length-2)/2,w[x]=[]),w[x]=[...w[x],{allowFailure:!0,callData:H,target:U}]}catch(H){const V=Id(H,{abi:F,address:U,args:j,docsPath:"/docs/contract/multicall",functionName:z});if(!n)throw V;w[x]=[...w[x],{allowFailure:!0,callData:"0x",target:U}]}}const O=await Promise.allSettled(w.map(k=>it(e,co,"readContract")({abi:dm,address:m,args:[k],blockNumber:s,blockTag:l,functionName:"aggregate3",stateOverride:f}))),T=[];for(let k=0;kt.toString(16).padStart(2,"0"));function Pd(e){d1(e);let t="";for(let n=0;n=sl._0&&e<=sl._9)return e-sl._0;if(e>=sl.A&&e<=sl.F)return e-(sl.A-10);if(e>=sl.a&&e<=sl.f)return e-(sl.a-10)}function Ld(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const i=new Uint8Array(n);for(let s=0,l=0;stypeof e=="bigint"&&ig<=e;function sg(e,t,n){return Ip(e)&&Ip(t)&&Ip(n)&&t<=e&&eig;e>>=ag,t+=1);return t}function zO(e,t){return e>>BigInt(t)&ag}function HO(e,t,n){return e|(n?ag:ig)<(kO<new Uint8Array(e),I6=e=>Uint8Array.from(e);function n8(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let i=kp(e),s=kp(e),l=0;const c=()=>{i.fill(1),s.fill(0),l=0},f=(...w)=>n(s,i,...w),d=(w=kp())=>{s=f(I6([0]),w),i=f(),w.length!==0&&(s=f(I6([1]),w),i=f())},h=()=>{if(l++>=1e3)throw new Error("drbg: tried 1000 values");let w=0;const x=[];for(;w{c(),d(w);let S;for(;!(S=x(h()));)d();return c(),S}}const GO={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||af(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function h1(e,t,n={}){const i=(s,l,c)=>{const f=GO[l];if(typeof f!="function")throw new Error("invalid validator function");const d=e[s];if(!(c&&d===void 0)&&!f(d,e))throw new Error("param "+String(s)+" is invalid. Expected "+l+", got "+d)};for(const[s,l]of Object.entries(t))i(s,l,!1);for(const[s,l]of Object.entries(n))i(s,l,!0);return e}const QO=()=>{throw new Error("not implemented")};function ym(e){const t=new WeakMap;return(n,...i)=>{const s=t.get(n);if(s!==void 0)return s;const l=e(n,...i);return t.set(n,l),l}}const jO=Object.freeze(Object.defineProperty({__proto__:null,aInRange:Ku,abool:kd,abytes:d1,bitGet:zO,bitLen:t8,bitMask:F2,bitSet:HO,bytesToHex:Pd,bytesToNumberBE:Wu,bytesToNumberLE:L2,concatBytes:G0,createHmacDrbg:n8,ensureBytes:hs,equalBytes:UO,hexToBytes:Ld,hexToNumber:P2,inRange:sg,isBytes:af,memoized:ym,notImplemented:QO,numberToBytesBE:Ud,numberToBytesLE:U2,numberToHexUnpadded:fd,numberToVarBytesBE:LO,utf8ToBytes:FO,validateObject:h1},Symbol.toStringTag,{value:"Module"})),VO="0.1.1";function YO(){return VO}let jn=class gm extends Error{constructor(t,n={}){const i=(()=>{var d;if(n.cause instanceof gm){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return(d=n.cause)!=null&&d.message?n.cause.message:n.details})(),s=n.cause instanceof gm&&n.cause.docsPath||n.docsPath,c=`https://oxlib.sh${s??""}`,f=[t||"An error occurred.",...n.metaMessages?["",...n.metaMessages]:[],...i||s?["",i?`Details: ${i}`:void 0,s?`See: ${c}`:void 0]:[]].filter(d=>typeof d=="string").join(` +`);super(f,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${YO()}`}),this.cause=n.cause,this.details=i,this.docs=c,this.docsPath=s,this.shortMessage=t}walk(t){return r8(this,t)}};function r8(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?r8(e.cause,t):t?null:e}const ZO="#__bigint";function XO(e,t,n){return JSON.stringify(e,(i,s)=>typeof s=="bigint"?s.toString()+ZO:s,n)}function WO(e,t){if(P6(e)>t)throw new aR({givenSize:P6(e),maxSize:t})}const ol={zero:48,nine:57,A:65,F:70,a:97,f:102};function k6(e){if(e>=ol.zero&&e<=ol.nine)return e-ol.zero;if(e>=ol.A&&e<=ol.F)return e-(ol.A-10);if(e>=ol.a&&e<=ol.f)return e-(ol.a-10)}function KO(e,t={}){const{dir:n,size:i=32}=t;if(i===0)return e;if(e.length>i)throw new sR({size:e.length,targetSize:i,type:"Bytes"});const s=new Uint8Array(i);for(let l=0;lt)throw new fR({givenSize:Va(e),maxSize:t})}function qO(e,t){if(typeof t=="number"&&t>0&&t>Va(e)-1)throw new l8({offset:t,position:"start",size:Va(e)})}function JO(e,t,n){if(typeof t=="number"&&typeof n=="number"&&Va(e)!==n-t)throw new l8({offset:n,position:"end",size:Va(e)})}function i8(e,t={}){const{dir:n,size:i=32}=t;if(i===0)return e;const s=e.replace("0x","");if(s.length>i*2)throw new dR({size:Math.ceil(s.length/2),targetSize:i,type:"Hex"});return`0x${s[n==="right"?"padEnd":"padStart"](i*2,"0")}`}const $O=new TextEncoder;function eR(e){return e instanceof Uint8Array?e:typeof e=="string"?nR(e):tR(e)}function tR(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function nR(e,t={}){const{size:n}=t;let i=e;n&&(z2(e,n),i=of(e,n));let s=i.slice(2);s.length%2&&(s=`0${s}`);const l=s.length/2,c=new Uint8Array(l);for(let f=0,d=0;ft.toString(16).padStart(2,"0"));function cR(e,t={}){const{strict:n=!1}=t;if(!e)throw new L6(e);if(typeof e!="string")throw new L6(e);if(n&&!/^0x[0-9a-fA-F]*$/.test(e))throw new U6(e);if(!e.startsWith("0x"))throw new U6(e)}function uo(...e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function a8(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(z2(n,t.size),sf(n,t.size)):n}function s8(e,t={}){let n="";for(let s=0;sl||s{const k=R,F=k.account?si(k.account):void 0,U={...k,data:k.abi?Xa(k):k.data,from:k.from??(F==null?void 0:F.address)};return Kd(U),t1(U)}),T=x.stateOverrides?S2(x.stateOverrides):void 0;d.push({blockOverrides:S,calls:O,stateOverrides:T})}const m=(n?Ze(n):void 0)||i;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:d,returnFullTransactions:l,traceTransfers:c,validation:f},m]})).map((x,S)=>({...Xm(x),calls:x.calls.map((O,T)=>{var le,ue;const{abi:R,args:k,functionName:F,to:U}=s[S].calls[T],j=((le=O.error)==null?void 0:le.data)??O.returnData,z=BigInt(O.gasUsed),H=(ue=O.logs)==null?void 0:ue.map(ae=>bl(ae)),V=O.status==="0x1"?"success":"failure",K=R&&V==="success"?ff({abi:R,data:j,functionName:F}):null,Q=(()=>{var me;if(V==="success")return;let ae;if(((me=O.error)==null?void 0:me.data)==="0x"?ae=new a1:O.error&&(ae=new qy(O.error)),!!ae)return Id(ae,{abi:R??[],address:U,args:k,functionName:F??""})})();return{data:j,gasUsed:z,logs:H,status:V,...V==="success"?{result:K}:{error:Q}}})}))}catch(d){const h=d,m=Jy(h,{});throw m instanceof r1?h:m}}function c8(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,i=G4(eR(e));return n==="Bytes"?i:s8(i)}class gR extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const i=this.keys().next().value;i&&this.delete(i)}return this}}const pR={checksum:new gR(8192)},Pp=pR.checksum,bR=/^0x[a-fA-F0-9]{40}$/;function og(e,t={}){const{strict:n=!0}=t;if(!bR.test(e))throw new F6({address:e,cause:new vR});if(n){if(e.toLowerCase()===e)return;if(mR(e)!==e)throw new F6({address:e,cause:new wR})}}function mR(e){if(Pp.has(e))return Pp.get(e);og(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=c8(rR(t),{as:"Bytes"}),i=t.split("");for(let l=0;l<40;l+=2)n[l>>1]>>4>=8&&i[l]&&(i[l]=i[l].toUpperCase()),(n[l>>1]&15)>=8&&i[l+1]&&(i[l+1]=i[l+1].toUpperCase());const s=`0x${i.join("")}`;return Pp.set(e,s),s}function bm(e,t={}){const{strict:n=!0}=t??{};try{return og(e,{strict:n}),!0}catch{return!1}}class F6 extends jn{constructor({address:t,cause:n}){super(`Address "${t}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class vR extends jn{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class wR extends jn{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}function mm(e){let t=!0,n="",i=0,s="",l=!1;for(let c=0;cvm(Object.values(e)[l],s)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(i)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(i)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(i)?Array.isArray(e)&&e.every(s=>vm(s,{...t,type:i.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function u8(e,t,n){for(const i in e){const s=e[i],l=t[i];if(s.type==="tuple"&&l.type==="tuple"&&"components"in s&&"components"in l)return u8(s.components,l.components,n[i]);const c=[s.type,l.type];if(c.includes("address")&&c.includes("bytes20")?!0:c.includes("address")&&c.includes("string")?bm(n[i],{strict:!1}):c.includes("address")&&c.includes("bytes")?bm(n[i],{strict:!1}):!1)return c}}function f8(e,t={}){const{prepare:n=!0}=t,i=Array.isArray(e)||typeof e=="string"?l6(e):e;return{...i,...n?{hash:dd(i)}:{}}}function AR(e,t,n){const{args:i=[],prepare:s=!0}=n??{},l=uR(t,{strict:!1}),c=e.filter(h=>l?h.type==="function"||h.type==="error"?d8(h)===G2(t,0,4):h.type==="event"?dd(h)===t:!1:"name"in h&&h.name===t);if(c.length===0)throw new wm({name:t});if(c.length===1)return{...c[0],...s?{hash:dd(c[0])}:{}};let f;for(const h of c){if(!("inputs"in h))continue;if(!i||i.length===0){if(!h.inputs||h.inputs.length===0)return{...h,...s?{hash:dd(h)}:{}};continue}if(!h.inputs||h.inputs.length===0||h.inputs.length!==i.length)continue;if(i.every((w,x)=>{const S="inputs"in h&&h.inputs[x];return S?vm(w,S):!1})){if(f&&"inputs"in f&&f.inputs){const w=u8(h.inputs,f.inputs,i);if(w)throw new ER({abiItem:h,type:w[0]},{abiItem:f,type:w[1]})}f=h}}const d=(()=>{if(f)return f;const[h,...m]=c;return{...h,overloads:m}})();if(!d)throw new wm({name:t});return{...d,...s?{hash:dd(d)}:{}}}function d8(e){return G2(dd(e),0,4)}function xR(e){const t=typeof e=="string"?e:Ry(e);return mm(t)}function dd(e){return typeof e!="string"&&"hash"in e&&e.hash?e.hash:c8(H2(xR(e)))}class ER extends jn{constructor(t,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${mm(Ry(t.abiItem))}\`, and`,`\`${n.type}\` in \`${mm(Ry(n.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class wm extends jn{constructor({name:t,data:n,type:i="item"}){const s=t?` with name "${t}"`:n?` with data "${n}"`:"";super(`ABI ${i}${s} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}const CR=/^(.*)\[([0-9]*)\]$/,SR=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,h8=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function TR({checksumAddress:e,parameters:t,values:n}){const i=[];for(let s=0;s0?uo(h,d):h}}if(c)return{dynamic:!0,encoded:d}}return{dynamic:!1,encoded:uo(...f.map(({encoded:d})=>d))}}function MR(e,{type:t}){const[,n]=t.split("bytes"),i=Va(e);if(!n){let s=e;return i%32!==0&&(s=of(s,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:uo(sf(vi(i,{size:32})),s)}}if(i!==Number.parseInt(n))throw new g8({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:of(e)}}function _R(e){if(typeof e!="boolean")throw new jn(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:sf(a8(e))}}function NR(e,{signed:t,size:n}){if(typeof n=="number"){const i=2n**(BigInt(n)-(t?1n:0n))-1n,s=t?-i-1n:0n;if(e>i||ec))}}function IR(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function y8(e,t,n){const{checksumAddress:i=!1}={};if(e.length!==t.length)throw new p8({expectedLength:e.length,givenLength:t.length});const s=TR({checksumAddress:i,parameters:e,values:t}),l=j2(s);return l.length===0?"0x":l}function Am(e,t){if(e.length!==t.length)throw new p8({expectedLength:e.length,givenLength:t.length});const n=[];for(let i=0;i0?y8(i.inputs,t[0]):void 0;return l?uo(s,l):s}function sd(e,t={}){return f8(e,t)}function zR(e,t,n){const i=AR(e,t,n);if(i.type!=="function")throw new wm({name:t,type:"function"});return i}function HR(e){return d8(e)}const GR="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",eo="0x0000000000000000000000000000000000000000",ty=new Qy(8192);function QR(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(ty.get(n))return ty.get(n);const i=e().finally(()=>ty.delete(n));return ty.set(n,i),i}async function xm(e){return new Promise(t=>setTimeout(t,e))}function Fd(e,{delay:t=100,retryCount:n=2,shouldRetry:i=()=>!0}={}){return new Promise((s,l)=>{const c=async({count:f=0}={})=>{const d=async({error:h})=>{const m=typeof t=="function"?t({count:f,error:h}):t;m&&await xm(m),c({count:f+1})};try{const h=await e();s(h)}catch(h){if(f{var w;const{dedupe:s=!1,methods:l,retryDelay:c=150,retryCount:f=3,uid:d}={...t,...i},{method:h}=n;if((w=l==null?void 0:l.exclude)!=null&&w.includes(h))throw new Uu(new Error("method not supported"),{method:h});if(l!=null&&l.include&&!l.include.includes(h))throw new Uu(new Error("method not supported"),{method:h});const m=s?qu(`${d}.${Vr(n)}`):void 0;return QR(()=>Fd(async()=>{try{return await e(n)}catch(x){const S=x;switch(S.code){case _0.code:throw new _0(S);case N0.code:throw new N0(S);case D0.code:throw new D0(S,{method:n.method});case B0.code:throw new B0(S);case ef.code:throw new ef(S);case tf.code:throw new tf(S);case I0.code:throw new I0(S);case oo.code:throw new oo(S);case k0.code:throw new k0(S);case Uu.code:throw new Uu(S,{method:n.method});case Bd.code:throw new Bd(S);case P0.code:throw new P0(S);case Wt.code:throw new Wt(S);case L0.code:throw new L0(S);case U0.code:throw new U0(S);case F0.code:throw new F0(S);case z0.code:throw new z0(S);case Vi.code:throw new Vi(S);case 5e3:throw new Wt(S);default:throw x instanceof Me?x:new jS(S)}}},{delay:({count:x,error:S})=>{var O;if(S&&S instanceof w0){const T=(O=S==null?void 0:S.headers)==null?void 0:O.get("Retry-After");if(T!=null&&T.match(/\d/))return Number.parseInt(T)*1e3}return~~(1<VR(x)}),{enabled:s,id:m})}}function VR(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===Bd.code||e.code===ef.code:e instanceof w0&&e.status?e.status===403||e.status===408||e.status===413||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:!0}function V2(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:i}){return new Promise((s,l)=>{(async()=>{let c;try{const f=new AbortController;n>0&&(c=setTimeout(()=>{i?f.abort():l(t)},n)),s(await e({signal:(f==null?void 0:f.signal)||null}))}catch(f){(f==null?void 0:f.name)==="AbortError"&&l(t),l(f)}finally{clearTimeout(c)}})()})}function YR(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const z6=YR();function ZR(e,t={}){return{async request(n){var w;const{body:i,onRequest:s=t.onRequest,onResponse:l=t.onResponse,timeout:c=t.timeout??1e4}=n,f={...t.fetchOptions??{},...n.fetchOptions??{}},{headers:d,method:h,signal:m}=f;try{const x=await V2(async({signal:O})=>{const T={...f,body:Array.isArray(i)?Vr(i.map(U=>({jsonrpc:"2.0",id:U.id??z6.take(),...U}))):Vr({jsonrpc:"2.0",id:i.id??z6.take(),...i}),headers:{"Content-Type":"application/json",...d},method:h||"POST",signal:m||(c>0?O:null)},R=new Request(e,T),k=await(s==null?void 0:s(R,T))??{...T,url:e};return await fetch(k.url??e,k)},{errorInstance:new f6({body:i,url:e}),timeout:c,signal:!0});l&&await l(x);let S;if((w=x.headers.get("Content-Type"))!=null&&w.startsWith("application/json"))S=await x.json();else{S=await x.text();try{S=JSON.parse(S||"{}")}catch(O){if(x.ok)throw O;S={error:S}}}if(!x.ok)throw new w0({body:i,details:Vr(S.error)||x.statusText,headers:x.headers,status:x.status,url:e});return S}catch(x){throw x instanceof w0||x instanceof f6?x:new w0({body:i,cause:x,url:e})}}}}class XR extends Me{constructor({domain:t}){super(`Invalid domain "${Vr(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class WR extends Me{constructor({primaryType:t,types:n}){super(`Invalid primary type \`${t}\` must be one of \`${JSON.stringify(Object.keys(n))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class KR extends Me{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function qR(e){const{domain:t={},message:n,primaryType:i}=e,s={EIP712Domain:nM({domain:t}),...e.types};tM({domain:t,message:n,primaryType:i,types:s});const l=["0x1901"];return t&&l.push(JR({domain:t,types:s})),i!=="EIP712Domain"&&l.push(m8({data:n,primaryType:i,types:s})),hr(ml(l))}function JR({domain:e,types:t}){return m8({data:e,primaryType:"EIP712Domain",types:t})}function m8({data:e,primaryType:t,types:n}){const i=v8({data:e,primaryType:t,types:n});return hr(i)}function v8({data:e,primaryType:t,types:n}){const i=[{type:"bytes32"}],s=[$R({primaryType:t,types:n})];for(const l of n[t]){const[c,f]=A8({types:n,name:l.name,type:l.type,value:e[l.name]});i.push(c),s.push(f)}return Xd(i,s)}function $R({primaryType:e,types:t}){const n=rt(eM({primaryType:e,types:t}));return hr(n)}function eM({primaryType:e,types:t}){let n="";const i=w8({primaryType:e,types:t});i.delete(e);const s=[e,...Array.from(i).sort()];for(const l of s)n+=`${l}(${t[l].map(({name:c,type:f})=>`${f} ${c}`).join(",")})`;return n}function w8({primaryType:e,types:t},n=new Set){const i=e.match(/^\w*/u),s=i==null?void 0:i[0];if(n.has(s)||t[s]===void 0)return n;n.add(s);for(const l of t[s])w8({primaryType:l.type,types:t},n);return n}function A8({types:e,name:t,type:n,value:i}){if(e[n]!==void 0)return[{type:"bytes32"},hr(v8({data:i,primaryType:n,types:e}))];if(n==="bytes")return i=`0x${(i.length%2?"0":"")+i.slice(2)}`,[{type:"bytes32"},hr(i)];if(n==="string")return[{type:"bytes32"},hr(rt(i))];if(n.lastIndexOf("]")===n.length-1){const s=n.slice(0,n.lastIndexOf("[")),l=i.map(c=>A8({name:t,type:s,types:e,value:c}));return[{type:"bytes32"},hr(Xd(l.map(([c])=>c),l.map(([,c])=>c)))]}return[{type:n},i]}function tM(e){const{domain:t,message:n,primaryType:i,types:s}=e,l=(c,f)=>{for(const d of c){const{name:h,type:m}=d,w=f[h],x=m.match(s2);if(x&&(typeof w=="number"||typeof w=="bigint")){const[T,R,k]=x;Ze(w,{signed:R==="int",size:Number.parseInt(k)/8})}if(m==="address"&&typeof w=="string"&&!yr(w))throw new ai({address:w});const S=m.match(hA);if(S){const[T,R]=S;if(R&&Pn(w)!==Number.parseInt(R))throw new $4({expectedSize:Number.parseInt(R),givenSize:Pn(w)})}const O=s[m];O&&(rM(m),l(O,w))}};if(s.EIP712Domain&&t){if(typeof t!="object")throw new XR({domain:t});l(s.EIP712Domain,t)}if(i!=="EIP712Domain")if(s[i])l(s[i],n);else throw new WR({primaryType:i,types:s})}function nM({domain:e}){return[typeof(e==null?void 0:e.name)=="string"&&{name:"name",type:"string"},(e==null?void 0:e.version)&&{name:"version",type:"string"},(typeof(e==null?void 0:e.chainId)=="number"||typeof(e==null?void 0:e.chainId)=="bigint")&&{name:"chainId",type:"uint256"},(e==null?void 0:e.verifyingContract)&&{name:"verifyingContract",type:"address"},(e==null?void 0:e.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function rM(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new KR({type:e})}function iM(e,t){if(e.length!==t.length)throw new K4({expectedLength:e.length,givenLength:t.length});const n=[];for(let i=0;i{if(!pe.data&&!pe.abi)return;const{accessList:P}=await WA(e,{account:h.address,...pe,data:pe.abi?Xa(pe):pe.data});return P.map(({address:Z,storageKeys:Ie})=>Ie.length>0?Z:null)})).then(pe=>pe.flat().filter(Boolean)):[],x=l==null?void 0:l.map(pe=>pe.address===(h==null?void 0:h.address)?{...pe,nonce:0}:pe),S=await pm(e,{blockNumber:n,blockTag:i,blocks:[...c?[{calls:[{data:m}],stateOverrides:l},{calls:w.map((pe,P)=>({abi:[sd("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[h.address],to:pe,from:eo,nonce:P})),stateOverrides:[{address:eo,nonce:0}]}]:[],{calls:[...s,{}].map((pe,P)=>({...pe,from:h==null?void 0:h.address,nonce:P})),stateOverrides:x},...c?[{calls:[{data:m}]},{calls:w.map((pe,P)=>({abi:[sd("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[h.address],to:pe,from:eo,nonce:P})),stateOverrides:[{address:eo,nonce:0}]},{calls:w.map((pe,P)=>({to:pe,abi:[sd("function decimals() returns (uint256)")],functionName:"decimals",from:eo,nonce:P})),stateOverrides:[{address:eo,nonce:0}]},{calls:w.map((pe,P)=>({to:pe,abi:[sd("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:eo,nonce:P})),stateOverrides:[{address:eo,nonce:0}]},{calls:w.map((pe,P)=>({to:pe,abi:[sd("function symbol() returns (string)")],functionName:"symbol",from:eo,nonce:P})),stateOverrides:[{address:eo,nonce:0}]}]:[]],traceTransfers:f,validation:d}),O=c?S[2]:S[0],[T,R,,k,F,U,j,z]=c?S:[],{calls:H,...V}=O,K=H.slice(0,-1)??[],Q=(T==null?void 0:T.calls)??[],le=(R==null?void 0:R.calls)??[],ue=[...Q,...le].map(pe=>pe.status==="success"?jr(pe.data):null),ae=(k==null?void 0:k.calls)??[],me=(F==null?void 0:F.calls)??[],ce=[...ae,...me].map(pe=>pe.status==="success"?jr(pe.data):null),W=((U==null?void 0:U.calls)??[]).map(pe=>pe.status==="success"?pe.result:null),L=((z==null?void 0:z.calls)??[]).map(pe=>pe.status==="success"?pe.result:null),te=((j==null?void 0:j.calls)??[]).map(pe=>pe.status==="success"?pe.result:null),ge=[];for(const[pe,P]of ce.entries()){const Z=ue[pe];if(typeof P!="bigint"||typeof Z!="bigint")continue;const Ie=W[pe-1],De=L[pe-1],we=te[pe-1],Pe=pe===0?{address:GR,decimals:18,symbol:"ETH"}:{address:w[pe-1],decimals:we||Ie?Number(Ie??1):void 0,symbol:De??void 0};ge.some(Fe=>Fe.token.address===Pe.address)||ge.push({token:Pe,value:{pre:Z,post:P,diff:P-Z}})}return{assetChanges:ge,block:V,results:K}}const Lp=new Map,H6=new Map;let fM=0;function Qc(e,t,n){const i=++fM,s=()=>Lp.get(e)||[],l=()=>{const m=s();Lp.set(e,m.filter(w=>w.id!==i))},c=()=>{const m=s();if(!m.some(x=>x.id===i))return;const w=H6.get(e);m.length===1&&w&&w(),l()},f=s();if(Lp.set(e,[...f,{id:i,fns:t}]),f&&f.length>0)return c;const d={};for(const m in t)d[m]=(...w)=>{var S,O;const x=s();if(x.length!==0)for(const T of x)(O=(S=T.fns)[m])==null||O.call(S,...w)};const h=n(d);return typeof h=="function"&&H6.set(e,h),c}function y1(e,{emitOnBegin:t,initialWaitTime:n,interval:i}){let s=!0;const l=()=>s=!1;return(async()=>{let f;t&&(f=await e({unpoll:l}));const d=await(n==null?void 0:n(f))??i;await xm(d);const h=async()=>{s&&(await e({unpoll:l}),await xm(i),h())};h()})(),l}function dM(e,{blockTag:t="latest",emitMissed:n=!1,emitOnBegin:i=!1,onBlock:s,onError:l,includeTransactions:c,poll:f,pollingInterval:d=e.pollingInterval}){const h=typeof f<"u"?f:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket"),m=c??!1;let w;return h?(()=>{const O=Vr(["watchBlocks",e.uid,t,n,i,m,d]);return Qc(O,{onBlock:s,onError:l},T=>y1(async()=>{var R;try{const k=await it(e,so,"getBlock")({blockTag:t,includeTransactions:m});if(k.number&&(w!=null&&w.number)){if(k.number===w.number)return;if(k.number-w.number>1&&n)for(let F=(w==null?void 0:w.number)+1n;Fw.number)&&(T.onBlock(k,w),w=k)}catch(k){(R=T.onError)==null||R.call(T,k)}},{emitOnBegin:i,interval:d}))})():(()=>{let O=!0,T=!0,R=()=>O=!1;return(async()=>{try{i&&it(e,so,"getBlock")({blockTag:t,includeTransactions:m}).then(U=>{O&&T&&(s(U,void 0),T=!1)});const k=(()=>{if(e.transport.type==="fallback"){const U=e.transport.transports.find(j=>j.config.type==="webSocket");return U?U.value:e.transport}return e.transport})(),{unsubscribe:F}=await k.subscribe({params:["newHeads"],async onData(U){if(!O)return;const j=await it(e,so,"getBlock")({blockNumber:U.blockNumber,includeTransactions:m}).catch(()=>{});O&&(s(j,w),T=!1,w=j)},onError(U){l==null||l(U)}});R=F,O||R()}catch(k){l==null||l(k)}})(),()=>R()})()}function S8(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:i,onError:s,poll:l,pollingInterval:c=e.pollingInterval}){const f=typeof l<"u"?l:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket");let d;return f?(()=>{const w=Vr(["watchBlockNumber",e.uid,t,n,c]);return Qc(w,{onBlockNumber:i,onError:s},x=>y1(async()=>{var S;try{const O=await it(e,f1,"getBlockNumber")({cacheTime:0});if(d){if(O===d)return;if(O-d>1&&n)for(let T=d+1n;Td)&&(x.onBlockNumber(O,d),d=O)}catch(O){(S=x.onError)==null||S.call(x,O)}},{emitOnBegin:t,interval:c}))})():(()=>{const w=Vr(["watchBlockNumber",e.uid,t,n]);return Qc(w,{onBlockNumber:i,onError:s},x=>{let S=!0,O=()=>S=!1;return(async()=>{try{const T=(()=>{if(e.transport.type==="fallback"){const k=e.transport.transports.find(F=>F.config.type==="webSocket");return k?k.value:e.transport}return e.transport})(),{unsubscribe:R}=await T.subscribe({params:["newHeads"],onData(k){var U;if(!S)return;const F=jr((U=k.result)==null?void 0:U.number);x.onBlockNumber(F,d),d=F},onError(k){var F;(F=x.onError)==null||F.call(x,k)}});O=R,S||O()}catch(T){s==null||s(T)}})(),()=>O()})})()}async function lg(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function hM(e,{address:t,args:n,batch:i=!0,event:s,events:l,fromBlock:c,onError:f,onLogs:d,poll:h,pollingInterval:m=e.pollingInterval,strict:w}){const x=typeof h<"u"?h:typeof c=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket"),S=w??!1;return x?(()=>{const R=Vr(["watchEvent",t,n,i,e.uid,s,m,c]);return Qc(R,{onLogs:d,onError:f},k=>{let F;c!==void 0&&(F=c-1n);let U,j=!1;const z=y1(async()=>{var H;if(!j){try{U=await it(e,qA,"createEventFilter")({address:t,args:n,event:s,events:l,strict:S,fromBlock:c})}catch{}j=!0;return}try{let V;if(U)V=await it(e,ng,"getFilterChanges")({filter:U});else{const K=await it(e,f1,"getBlockNumber")({});F&&F!==K?V=await it(e,k2,"getLogs")({address:t,args:n,event:s,events:l,fromBlock:F+1n,toBlock:K}):V=[],F=K}if(V.length===0)return;if(i)k.onLogs(V);else for(const K of V)k.onLogs([K])}catch(V){U&&V instanceof tf&&(j=!1),(H=k.onError)==null||H.call(k,V)}},{emitOnBegin:!0,interval:m});return async()=>{U&&await it(e,lg,"uninstallFilter")({filter:U}),z()}})})():(()=>{let R=!0,k=()=>R=!1;return(async()=>{try{const F=(()=>{if(e.transport.type==="fallback"){const H=e.transport.transports.find(V=>V.config.type==="webSocket");return H?H.value:e.transport}return e.transport})(),U=l??(s?[s]:void 0);let j=[];U&&(j=[U.flatMap(V=>u1({abi:[V],eventName:V.name,args:n}))],s&&(j=j[0]));const{unsubscribe:z}=await F.subscribe({params:["logs",{address:t,topics:j}],onData(H){var K;if(!R)return;const V=H.result;try{const{eventName:Q,args:le}=B2({abi:U??[],data:V.data,topics:V.topics,strict:S}),ue=bl(V,{args:le,eventName:Q});d([ue])}catch(Q){let le,ue;if(Q instanceof R0||Q instanceof Xy){if(w)return;le=Q.abiItem.name,ue=(K=Q.abiItem.inputs)==null?void 0:K.some(me=>!("name"in me&&me.name))}const ae=bl(V,{args:ue?[]:{},eventName:le});d([ae])}},onError(H){f==null||f(H)}});k=z,R||k()}catch(F){f==null||f(F)}})(),()=>k()})()}function yM(e,{batch:t=!0,onError:n,onTransactions:i,poll:s,pollingInterval:l=e.pollingInterval}){return(typeof s<"u"?s:e.transport.type!=="webSocket")?(()=>{const h=Vr(["watchPendingTransactions",e.uid,t,l]);return Qc(h,{onTransactions:i,onError:n},m=>{let w;const x=y1(async()=>{var S;try{if(!w)try{w=await it(e,JA,"createPendingTransactionFilter")({});return}catch(T){throw x(),T}const O=await it(e,ng,"getFilterChanges")({filter:w});if(O.length===0)return;if(t)m.onTransactions(O);else for(const T of O)m.onTransactions([T])}catch(O){(S=m.onError)==null||S.call(m,O)}},{emitOnBegin:!0,interval:l});return async()=>{w&&await it(e,lg,"uninstallFilter")({filter:w}),x()}})})():(()=>{let h=!0,m=()=>h=!1;return(async()=>{try{const{unsubscribe:w}=await e.transport.subscribe({params:["newPendingTransactions"],onData(x){if(!h)return;const S=x.result;i([S])},onError(x){n==null||n(x)}});m=w,h||m()}catch(w){n==null||n(w)}})(),()=>m()})()}function gM(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function pM(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?ms(e.nonce):void 0,storageProof:e.storageProof?gM(e.storageProof):void 0}}async function bM(e,{address:t,blockNumber:n,blockTag:i,storageKeys:s}){const l=i??"latest",c=n!==void 0?Ze(n):void 0,f=await e.request({method:"eth_getProof",params:[t,s,c||l]});return pM(f)}async function T8(e,{confirmations:t=1,hash:n,onReplaced:i,pollingInterval:s=e.pollingInterval,retryCount:l=6,retryDelay:c=({count:d})=>~~(1<T(new l9({hash:n})),f):void 0,k=Qc(d,{onReplaced:i,resolve:O,reject:T},F=>{const U=it(e,S8,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:s,async onBlockNumber(j){const z=V=>{clearTimeout(R),U(),V(),k()};let H=j;if(!x)try{if(w){if(t>1&&(!w.blockNumber||H-w.blockNumber+1nF.resolve(w));return}if(h||(x=!0,await Fd(async()=>{h=await it(e,rg,"getTransaction")({hash:n}),h.blockNumber&&(H=h.blockNumber)},{delay:c,retryCount:l}),x=!1),w=await it(e,hm,"getTransactionReceipt")({hash:n}),t>1&&(!w.blockNumber||H-w.blockNumber+1nF.resolve(w))}catch(V){if(V instanceof T4||V instanceof O4){if(!h){x=!1;return}try{m=h,x=!0;const K=await Fd(()=>it(e,so,"getBlock")({blockNumber:H,includeTransactions:!0}),{delay:c,retryCount:l,shouldRetry:({error:ue})=>ue instanceof kA});x=!1;const Q=K.transactions.find(({from:ue,nonce:ae})=>ue===m.from&&ae===m.nonce);if(!Q||(w=await it(e,hm,"getTransactionReceipt")({hash:Q.hash}),t>1&&(!w.blockNumber||H-w.blockNumber+1n{var ue;(ue=F.onReplaced)==null||ue.call(F,{reason:le,replacedTransaction:m,transaction:Q,transactionReceipt:w}),F.resolve(w)})}catch(K){z(()=>F.reject(K))}}else z(()=>F.reject(V))}}})});return S}async function mM(e,{account:t=e.account,message:n}){if(!t)throw new Yy({docsPath:"/docs/actions/wallet/signMessage"});const i=si(t);if(i.signMessage)return i.signMessage({message:n});const s=typeof n=="string"?qu(n):n.raw instanceof Uint8Array?rt(n.raw):n.raw;return e.request({method:"personal_sign",params:[s,i.address]},{retryCount:0})}async function vM(e,t){const{abi:n,address:i,args:s,dataSuffix:l,functionName:c,...f}=t,d=f.account?si(f.account):e.account,h=Xa({abi:n,args:s,functionName:c});try{const{data:m}=await it(e,c1,"call")({batch:!1,data:`${h}${l?l.replace("0x",""):""}`,to:i,...f,account:d}),w=ff({abi:n,args:s,functionName:c,data:m||"0x"}),x=n.filter(S=>"name"in S&&S.name===t.functionName);return{result:w,request:{abi:x,address:i,args:s,dataSuffix:l,functionName:c,...f,account:d}}}catch(m){throw Id(m,{abi:n,address:i,args:s,docsPath:"/docs/contract/simulateContract",functionName:c,sender:d==null?void 0:d.address})}}class O8 extends $m{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,u9(t);const i=Hy(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,l=new Uint8Array(s);l.set(i.length>s?t.create().update(i).digest():i);for(let c=0;cnew O8(e,t).update(n).digest();R8.create=(e,t)=>new O8(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Tr=BigInt(0),Gn=BigInt(1),Lu=BigInt(2),wM=BigInt(3),Em=BigInt(4),G6=BigInt(5),Q6=BigInt(8);function Qi(e,t){const n=e%t;return n>=Tr?n:t+n}function AM(e,t,n){if(tTr;)t&Gn&&(i=i*e%n),e=e*e%n,t>>=Gn;return i}function za(e,t,n){let i=e;for(;t-- >Tr;)i*=i,i%=n;return i}function Cm(e,t){if(e===Tr)throw new Error("invert: expected non-zero number");if(t<=Tr)throw new Error("invert: expected positive modulus, got "+t);let n=Qi(e,t),i=t,s=Tr,l=Gn;for(;n!==Tr;){const f=i/n,d=i%n,h=s-l*f;i=n,n=d,s=l,l=h}if(i!==Gn)throw new Error("invert: does not exist");return Qi(s,t)}function xM(e){const t=(e-Gn)/Lu;let n,i,s;for(n=e-Gn,i=0;n%Lu===Tr;n/=Lu,i++);for(s=Lu;s1e3)throw new Error("Cannot find square root: likely non-prime P");if(i===1){const c=(e+Gn)/Em;return function(d,h){const m=d.pow(h,c);if(!d.eql(d.sqr(m),h))throw new Error("Cannot find square root");return m}}const l=(n+Gn)/Lu;return function(f,d){if(f.pow(d,t)===f.neg(f.ONE))throw new Error("Cannot find square root");let h=i,m=f.pow(f.mul(f.ONE,s),n),w=f.pow(d,l),x=f.pow(d,n);for(;!f.eql(x,f.ONE);){if(f.eql(x,f.ZERO))return f.ZERO;let S=1;for(let T=f.sqr(x);S(i[s]="function",i),t);return h1(e,n)}function TM(e,t,n){if(nTr;)n&Gn&&(i=e.mul(i,s)),s=e.sqr(s),n>>=Gn;return i}function OM(e,t){const n=new Array(t.length),i=t.reduce((l,c,f)=>e.is0(c)?l:(n[f]=l,e.mul(l,c)),e.ONE),s=e.inv(i);return t.reduceRight((l,c,f)=>e.is0(c)?l:(n[f]=e.mul(l,n[f]),e.mul(l,c)),s),n}function M8(e,t){const n=t!==void 0?t:e.toString(2).length,i=Math.ceil(n/8);return{nBitLength:n,nByteLength:i}}function _8(e,t,n=!1,i={}){if(e<=Tr)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:s,nByteLength:l}=M8(e,t);if(l>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let c;const f=Object.freeze({ORDER:e,isLE:n,BITS:s,BYTES:l,MASK:F2(s),ZERO:Tr,ONE:Gn,create:d=>Qi(d,e),isValid:d=>{if(typeof d!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof d);return Tr<=d&&dd===Tr,isOdd:d=>(d&Gn)===Gn,neg:d=>Qi(-d,e),eql:(d,h)=>d===h,sqr:d=>Qi(d*d,e),add:(d,h)=>Qi(d+h,e),sub:(d,h)=>Qi(d-h,e),mul:(d,h)=>Qi(d*h,e),pow:(d,h)=>TM(f,d,h),div:(d,h)=>Qi(d*Cm(h,e),e),sqrN:d=>d*d,addN:(d,h)=>d+h,subN:(d,h)=>d-h,mulN:(d,h)=>d*h,inv:d=>Cm(d,e),sqrt:i.sqrt||(d=>(c||(c=EM(e)),c(f,d))),invertBatch:d=>OM(f,d),cmov:(d,h,m)=>m?h:d,toBytes:d=>n?U2(d,l):Ud(d,l),fromBytes:d=>{if(d.length!==l)throw new Error("Field.fromBytes: expected "+l+" bytes, got "+d.length);return n?L2(d):Wu(d)}});return Object.freeze(f)}function N8(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function D8(e){const t=N8(e);return t+Math.ceil(t/2)}function RM(e,t,n=!1){const i=e.length,s=N8(t),l=D8(t);if(i<16||i1024)throw new Error("expected "+l+"-1024 bytes of input, got "+i);const c=n?L2(e):Wu(e),f=Qi(c,t-Gn)+Gn;return n?U2(f,s):Ud(f,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const j6=BigInt(0),ny=BigInt(1);function Up(e,t){const n=t.negate();return e?n:t}function B8(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function Fp(e,t){B8(e,t);const n=Math.ceil(t/e)+1,i=2**(e-1);return{windows:n,windowSize:i}}function MM(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((n,i)=>{if(!(n instanceof t))throw new Error("invalid point at index "+i)})}function _M(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((n,i)=>{if(!t.isValid(n))throw new Error("invalid scalar at index "+i)})}const zp=new WeakMap,I8=new WeakMap;function Hp(e){return I8.get(e)||1}function NM(e,t){return{constTimeNegate:Up,hasPrecomputes(n){return Hp(n)!==1},unsafeLadder(n,i,s=e.ZERO){let l=n;for(;i>j6;)i&ny&&(s=s.add(l)),l=l.double(),i>>=ny;return s},precomputeWindow(n,i){const{windows:s,windowSize:l}=Fp(i,t),c=[];let f=n,d=f;for(let h=0;h>=w,O>c&&(O-=m,s+=ny);const T=S,R=S+Math.abs(O)-1,k=x%2!==0,F=O<0;O===0?d=d.add(Up(k,i[T])):f=f.add(Up(F,i[R]))}return{p:f,f:d}},wNAFUnsafe(n,i,s,l=e.ZERO){const{windows:c,windowSize:f}=Fp(n,t),d=BigInt(2**n-1),h=2**n,m=BigInt(n);for(let w=0;w>=m,S>f&&(S-=h,s+=ny),S===0)continue;let O=i[x+Math.abs(S)-1];S<0&&(O=O.negate()),l=l.add(O)}return l},getPrecomputes(n,i,s){let l=zp.get(i);return l||(l=this.precomputeWindow(i,n),n!==1&&zp.set(i,s(l))),l},wNAFCached(n,i,s){const l=Hp(n);return this.wNAF(l,this.getPrecomputes(l,n,s),i)},wNAFCachedUnsafe(n,i,s,l){const c=Hp(n);return c===1?this.unsafeLadder(n,i,l):this.wNAFUnsafe(c,this.getPrecomputes(c,n,s),i,l)},setWindowSize(n,i){B8(i,t),I8.set(n,i),zp.delete(n)}}}function DM(e,t,n,i){if(MM(n,e),_M(i,t),n.length!==i.length)throw new Error("arrays of points and scalars must have equal length");const s=e.ZERO,l=t8(BigInt(n.length)),c=l>12?l-3:l>4?l-2:l?2:1,f=(1<=0;w-=c){d.fill(s);for(let S=0;S>BigInt(w)&BigInt(f));d[T]=d[T].add(n[S])}let x=s;for(let S=d.length-1,O=s;S>0;S--)O=O.add(d[S]),x=x.add(O);if(m=m.add(x),w!==0)for(let S=0;S{const{Err:n}=ul;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length&1)throw new n("tlv.encode: unpadded data");const i=t.length/2,s=fd(i);if(s.length/2&128)throw new n("tlv.encode: long form length too big");const l=i>127?fd(s.length/2|128):"";return fd(e)+l+s+t},decode(e,t){const{Err:n}=ul;let i=0;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length<2||t[i++]!==e)throw new n("tlv.decode: wrong tlv");const s=t[i++],l=!!(s&128);let c=0;if(!l)c=s;else{const d=s&127;if(!d)throw new n("tlv.decode(long): indefinite length not supported");if(d>4)throw new n("tlv.decode(long): byte length is too big");const h=t.subarray(i,i+d);if(h.length!==d)throw new n("tlv.decode: length bytes not complete");if(h[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const m of h)c=c<<8|m;if(i+=d,c<128)throw new n("tlv.decode(long): not minimal encoding")}const f=t.subarray(i,i+c);if(f.length!==c)throw new n("tlv.decode: wrong value length");return{v:f,l:t.subarray(i+c)}}},_int:{encode(e){const{Err:t}=ul;if(e{const F=R.toAffine();return G0(Uint8Array.from([4]),n.toBytes(F.x),n.toBytes(F.y))}),l=t.fromBytes||(T=>{const R=T.subarray(1),k=n.fromBytes(R.subarray(0,n.BYTES)),F=n.fromBytes(R.subarray(n.BYTES,2*n.BYTES));return{x:k,y:F}});function c(T){const{a:R,b:k}=t,F=n.sqr(T),U=n.mul(F,T);return n.add(n.add(U,n.mul(T,R)),k)}if(!n.eql(n.sqr(t.Gy),c(t.Gx)))throw new Error("bad generator point: equation left != right");function f(T){return sg(T,Cr,t.n)}function d(T){const{allowedPrivateKeyLengths:R,nByteLength:k,wrapPrivateKey:F,n:U}=t;if(R&&typeof T!="bigint"){if(af(T)&&(T=Pd(T)),typeof T!="string"||!R.includes(T.length))throw new Error("invalid private key");T=T.padStart(k*2,"0")}let j;try{j=typeof T=="bigint"?T:Wu(hs("private key",T,k))}catch{throw new Error("invalid private key, expected hex or "+k+" bytes, got "+typeof T)}return F&&(j=Qi(j,U)),Ku("private key",j,Cr,U),j}function h(T){if(!(T instanceof x))throw new Error("ProjectivePoint expected")}const m=ym((T,R)=>{const{px:k,py:F,pz:U}=T;if(n.eql(U,n.ONE))return{x:k,y:F};const j=T.is0();R==null&&(R=j?n.ONE:n.inv(U));const z=n.mul(k,R),H=n.mul(F,R),V=n.mul(U,R);if(j)return{x:n.ZERO,y:n.ZERO};if(!n.eql(V,n.ONE))throw new Error("invZ was invalid");return{x:z,y:H}}),w=ym(T=>{if(T.is0()){if(t.allowInfinityPoint&&!n.is0(T.py))return;throw new Error("bad point: ZERO")}const{x:R,y:k}=T.toAffine();if(!n.isValid(R)||!n.isValid(k))throw new Error("bad point: x or y not FE");const F=n.sqr(k),U=c(R);if(!n.eql(F,U))throw new Error("bad point: equation left != right");if(!T.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class x{constructor(R,k,F){if(this.px=R,this.py=k,this.pz=F,R==null||!n.isValid(R))throw new Error("x required");if(k==null||!n.isValid(k))throw new Error("y required");if(F==null||!n.isValid(F))throw new Error("z required");Object.freeze(this)}static fromAffine(R){const{x:k,y:F}=R||{};if(!R||!n.isValid(k)||!n.isValid(F))throw new Error("invalid affine point");if(R instanceof x)throw new Error("projective point not allowed");const U=j=>n.eql(j,n.ZERO);return U(k)&&U(F)?x.ZERO:new x(k,F,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(R){const k=n.invertBatch(R.map(F=>F.pz));return R.map((F,U)=>F.toAffine(k[U])).map(x.fromAffine)}static fromHex(R){const k=x.fromAffine(l(hs("pointHex",R)));return k.assertValidity(),k}static fromPrivateKey(R){return x.BASE.multiply(d(R))}static msm(R,k){return DM(x,i,R,k)}_setWindowSize(R){O.setWindowSize(this,R)}assertValidity(){w(this)}hasEvenY(){const{y:R}=this.toAffine();if(n.isOdd)return!n.isOdd(R);throw new Error("Field doesn't support isOdd")}equals(R){h(R);const{px:k,py:F,pz:U}=this,{px:j,py:z,pz:H}=R,V=n.eql(n.mul(k,H),n.mul(j,U)),K=n.eql(n.mul(F,H),n.mul(z,U));return V&&K}negate(){return new x(this.px,n.neg(this.py),this.pz)}double(){const{a:R,b:k}=t,F=n.mul(k,Y6),{px:U,py:j,pz:z}=this;let H=n.ZERO,V=n.ZERO,K=n.ZERO,Q=n.mul(U,U),le=n.mul(j,j),ue=n.mul(z,z),ae=n.mul(U,j);return ae=n.add(ae,ae),K=n.mul(U,z),K=n.add(K,K),H=n.mul(R,K),V=n.mul(F,ue),V=n.add(H,V),H=n.sub(le,V),V=n.add(le,V),V=n.mul(H,V),H=n.mul(ae,H),K=n.mul(F,K),ue=n.mul(R,ue),ae=n.sub(Q,ue),ae=n.mul(R,ae),ae=n.add(ae,K),K=n.add(Q,Q),Q=n.add(K,Q),Q=n.add(Q,ue),Q=n.mul(Q,ae),V=n.add(V,Q),ue=n.mul(j,z),ue=n.add(ue,ue),Q=n.mul(ue,ae),H=n.sub(H,Q),K=n.mul(ue,le),K=n.add(K,K),K=n.add(K,K),new x(H,V,K)}add(R){h(R);const{px:k,py:F,pz:U}=this,{px:j,py:z,pz:H}=R;let V=n.ZERO,K=n.ZERO,Q=n.ZERO;const le=t.a,ue=n.mul(t.b,Y6);let ae=n.mul(k,j),me=n.mul(F,z),ce=n.mul(U,H),W=n.add(k,F),L=n.add(j,z);W=n.mul(W,L),L=n.add(ae,me),W=n.sub(W,L),L=n.add(k,U);let te=n.add(j,H);return L=n.mul(L,te),te=n.add(ae,ce),L=n.sub(L,te),te=n.add(F,U),V=n.add(z,H),te=n.mul(te,V),V=n.add(me,ce),te=n.sub(te,V),Q=n.mul(le,L),V=n.mul(ue,ce),Q=n.add(V,Q),V=n.sub(me,Q),Q=n.add(me,Q),K=n.mul(V,Q),me=n.add(ae,ae),me=n.add(me,ae),ce=n.mul(le,ce),L=n.mul(ue,L),me=n.add(me,ce),ce=n.sub(ae,ce),ce=n.mul(le,ce),L=n.add(L,ce),ae=n.mul(me,L),K=n.add(K,ae),ae=n.mul(te,L),V=n.mul(W,V),V=n.sub(V,ae),ae=n.mul(W,me),Q=n.mul(te,Q),Q=n.add(Q,ae),new x(V,K,Q)}subtract(R){return this.add(R.negate())}is0(){return this.equals(x.ZERO)}wNAF(R){return O.wNAFCached(this,R,x.normalizeZ)}multiplyUnsafe(R){const{endo:k,n:F}=t;Ku("scalar",R,hl,F);const U=x.ZERO;if(R===hl)return U;if(this.is0()||R===Cr)return this;if(!k||O.hasPrecomputes(this))return O.wNAFCachedUnsafe(this,R,x.normalizeZ);let{k1neg:j,k1:z,k2neg:H,k2:V}=k.splitScalar(R),K=U,Q=U,le=this;for(;z>hl||V>hl;)z&Cr&&(K=K.add(le)),V&Cr&&(Q=Q.add(le)),le=le.double(),z>>=Cr,V>>=Cr;return j&&(K=K.negate()),H&&(Q=Q.negate()),Q=new x(n.mul(Q.px,k.beta),Q.py,Q.pz),K.add(Q)}multiply(R){const{endo:k,n:F}=t;Ku("scalar",R,Cr,F);let U,j;if(k){const{k1neg:z,k1:H,k2neg:V,k2:K}=k.splitScalar(R);let{p:Q,f:le}=this.wNAF(H),{p:ue,f:ae}=this.wNAF(K);Q=O.constTimeNegate(z,Q),ue=O.constTimeNegate(V,ue),ue=new x(n.mul(ue.px,k.beta),ue.py,ue.pz),U=Q.add(ue),j=le.add(ae)}else{const{p:z,f:H}=this.wNAF(R);U=z,j=H}return x.normalizeZ([U,j])[0]}multiplyAndAddUnsafe(R,k,F){const U=x.BASE,j=(H,V)=>V===hl||V===Cr||!H.equals(U)?H.multiplyUnsafe(V):H.multiply(V),z=j(this,k).add(j(R,F));return z.is0()?void 0:z}toAffine(R){return m(this,R)}isTorsionFree(){const{h:R,isTorsionFree:k}=t;if(R===Cr)return!0;if(k)return k(x,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:R,clearCofactor:k}=t;return R===Cr?this:k?k(x,this):this.multiplyUnsafe(t.h)}toRawBytes(R=!0){return kd("isCompressed",R),this.assertValidity(),s(x,this,R)}toHex(R=!0){return kd("isCompressed",R),Pd(this.toRawBytes(R))}}x.BASE=new x(t.Gx,t.Gy,n.ONE),x.ZERO=new x(n.ZERO,n.ONE,n.ZERO);const S=t.nBitLength,O=NM(x,t.endo?Math.ceil(S/2):S);return{CURVE:t,ProjectivePoint:x,normPrivateKeyToScalar:d,weierstrassEquation:c,isWithinCurveOrder:f}}function UM(e){const t=k8(e);return h1(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function FM(e){const t=UM(e),{Fp:n,n:i}=t,s=n.BYTES+1,l=2*n.BYTES+1;function c(ce){return Qi(ce,i)}function f(ce){return Cm(ce,i)}const{ProjectivePoint:d,normPrivateKeyToScalar:h,weierstrassEquation:m,isWithinCurveOrder:w}=LM({...t,toBytes(ce,W,L){const te=W.toAffine(),ge=n.toBytes(te.x),pe=G0;return kd("isCompressed",L),L?pe(Uint8Array.from([W.hasEvenY()?2:3]),ge):pe(Uint8Array.from([4]),ge,n.toBytes(te.y))},fromBytes(ce){const W=ce.length,L=ce[0],te=ce.subarray(1);if(W===s&&(L===2||L===3)){const ge=Wu(te);if(!sg(ge,Cr,n.ORDER))throw new Error("Point is not on curve");const pe=m(ge);let P;try{P=n.sqrt(pe)}catch(De){const we=De instanceof Error?": "+De.message:"";throw new Error("Point is not on curve"+we)}const Z=(P&Cr)===Cr;return(L&1)===1!==Z&&(P=n.neg(P)),{x:ge,y:P}}else if(W===l&&L===4){const ge=n.fromBytes(te.subarray(0,n.BYTES)),pe=n.fromBytes(te.subarray(n.BYTES,2*n.BYTES));return{x:ge,y:pe}}else{const ge=s,pe=l;throw new Error("invalid Point, expected length of "+ge+", or uncompressed "+pe+", got "+W)}}}),x=ce=>Pd(Ud(ce,t.nByteLength));function S(ce){const W=i>>Cr;return ce>W}function O(ce){return S(ce)?c(-ce):ce}const T=(ce,W,L)=>Wu(ce.slice(W,L));class R{constructor(W,L,te){this.r=W,this.s=L,this.recovery=te,this.assertValidity()}static fromCompact(W){const L=t.nByteLength;return W=hs("compactSignature",W,L*2),new R(T(W,0,L),T(W,L,2*L))}static fromDER(W){const{r:L,s:te}=ul.toSig(hs("DER",W));return new R(L,te)}assertValidity(){Ku("r",this.r,Cr,i),Ku("s",this.s,Cr,i)}addRecoveryBit(W){return new R(this.r,this.s,W)}recoverPublicKey(W){const{r:L,s:te,recovery:ge}=this,pe=H(hs("msgHash",W));if(ge==null||![0,1,2,3].includes(ge))throw new Error("recovery id invalid");const P=ge===2||ge===3?L+t.n:L;if(P>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const Z=(ge&1)===0?"02":"03",Ie=d.fromHex(Z+x(P)),De=f(P),we=c(-pe*De),Pe=c(te*De),Fe=d.BASE.multiplyAndAddUnsafe(Ie,we,Pe);if(!Fe)throw new Error("point at infinify");return Fe.assertValidity(),Fe}hasHighS(){return S(this.s)}normalizeS(){return this.hasHighS()?new R(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return Ld(this.toDERHex())}toDERHex(){return ul.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Ld(this.toCompactHex())}toCompactHex(){return x(this.r)+x(this.s)}}const k={isValidPrivateKey(ce){try{return h(ce),!0}catch{return!1}},normPrivateKeyToScalar:h,randomPrivateKey:()=>{const ce=D8(t.n);return RM(t.randomBytes(ce),t.n)},precompute(ce=8,W=d.BASE){return W._setWindowSize(ce),W.multiply(BigInt(3)),W}};function F(ce,W=!0){return d.fromPrivateKey(ce).toRawBytes(W)}function U(ce){const W=af(ce),L=typeof ce=="string",te=(W||L)&&ce.length;return W?te===s||te===l:L?te===2*s||te===2*l:ce instanceof d}function j(ce,W,L=!0){if(U(ce))throw new Error("first arg must be private key");if(!U(W))throw new Error("second arg must be public key");return d.fromHex(W).multiply(h(ce)).toRawBytes(L)}const z=t.bits2int||function(ce){if(ce.length>8192)throw new Error("input is too large");const W=Wu(ce),L=ce.length*8-t.nBitLength;return L>0?W>>BigInt(L):W},H=t.bits2int_modN||function(ce){return c(z(ce))},V=F2(t.nBitLength);function K(ce){return Ku("num < 2^"+t.nBitLength,ce,hl,V),Ud(ce,t.nByteLength)}function Q(ce,W,L=le){if(["recovered","canonical"].some(Xe=>Xe in L))throw new Error("sign() legacy options not supported");const{hash:te,randomBytes:ge}=t;let{lowS:pe,prehash:P,extraEntropy:Z}=L;pe==null&&(pe=!0),ce=hs("msgHash",ce),V6(L),P&&(ce=hs("prehashed msgHash",te(ce)));const Ie=H(ce),De=h(W),we=[K(De),K(Ie)];if(Z!=null&&Z!==!1){const Xe=Z===!0?ge(n.BYTES):Z;we.push(hs("extraEntropy",Xe))}const Pe=G0(...we),Fe=Ie;function bt(Xe){const ut=z(Xe);if(!w(ut))return;const et=f(ut),vn=d.BASE.multiply(ut).toAffine(),We=c(vn.x);if(We===hl)return;const Ln=c(et*c(Fe+We*De));if(Ln===hl)return;let nr=(vn.x===We?0:2)|Number(vn.y&Cr),Dt=Ln;return pe&&S(Ln)&&(Dt=O(Ln),nr^=1),new R(We,Dt,nr)}return{seed:Pe,k2sig:bt}}const le={lowS:t.lowS,prehash:!1},ue={lowS:t.lowS,prehash:!1};function ae(ce,W,L=le){const{seed:te,k2sig:ge}=Q(ce,W,L),pe=t;return n8(pe.hash.outputLen,pe.nByteLength,pe.hmac)(te,ge)}d.BASE._setWindowSize(8);function me(ce,W,L,te=ue){var nr;const ge=ce;W=hs("msgHash",W),L=hs("publicKey",L);const{lowS:pe,prehash:P,format:Z}=te;if(V6(te),"strict"in te)throw new Error("options.strict was renamed to lowS");if(Z!==void 0&&Z!=="compact"&&Z!=="der")throw new Error("format must be compact or der");const Ie=typeof ge=="string"||af(ge),De=!Ie&&!Z&&typeof ge=="object"&&ge!==null&&typeof ge.r=="bigint"&&typeof ge.s=="bigint";if(!Ie&&!De)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let we,Pe;try{if(De&&(we=new R(ge.r,ge.s)),Ie){try{Z!=="compact"&&(we=R.fromDER(ge))}catch(Dt){if(!(Dt instanceof ul.Err))throw Dt}!we&&Z!=="der"&&(we=R.fromCompact(ge))}Pe=d.fromHex(L)}catch{return!1}if(!we||pe&&we.hasHighS())return!1;P&&(W=t.hash(W));const{r:Fe,s:bt}=we,Xe=H(W),ut=f(bt),et=c(Xe*ut),vn=c(Fe*ut),We=(nr=d.BASE.multiplyAndAddUnsafe(Pe,et,vn))==null?void 0:nr.toAffine();return We?c(We.x)===Fe:!1}return{CURVE:t,getPublicKey:F,getSharedSecret:j,sign:ae,verify:me,ProjectivePoint:d,Signature:R,utils:k}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function zM(e){return{hash:e,hmac:(t,...n)=>R8(e,t,g9(...n)),randomBytes:p9}}function HM(e,t){const n=i=>FM({...e,...zM(i)});return{...n(t),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const P8=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Z6=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),GM=BigInt(1),Sm=BigInt(2),X6=(e,t)=>(e+t/Sm)/t;function QM(e){const t=P8,n=BigInt(3),i=BigInt(6),s=BigInt(11),l=BigInt(22),c=BigInt(23),f=BigInt(44),d=BigInt(88),h=e*e*e%t,m=h*h*e%t,w=za(m,n,t)*m%t,x=za(w,n,t)*m%t,S=za(x,Sm,t)*h%t,O=za(S,s,t)*S%t,T=za(O,l,t)*O%t,R=za(T,f,t)*T%t,k=za(R,d,t)*R%t,F=za(k,f,t)*T%t,U=za(F,n,t)*m%t,j=za(U,c,t)*O%t,z=za(j,i,t)*h%t,H=za(z,Sm,t);if(!Tm.eql(Tm.sqr(H),e))throw new Error("Cannot find square root");return H}const Tm=_8(P8,void 0,void 0,{sqrt:QM}),Y2=HM({a:BigInt(0),b:BigInt(7),Fp:Tm,n:Z6,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Z6,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),i=-GM*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),l=n,c=BigInt("0x100000000000000000000000000000000"),f=X6(l*e,t),d=X6(-i*e,t);let h=Qi(e-f*n-d*s,t),m=Qi(-f*i-d*l,t);const w=h>c,x=m>c;if(w&&(h=t-h),x&&(m=t-m),h>c||m>c)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:w,k1:h,k2neg:x,k2:m}}}},_4);BigInt(0);Y2.ProjectivePoint;const jM=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:Y2},Symbol.toStringTag,{value:"Module"}));function VM({r:e,s:t,to:n="hex",v:i,yParity:s}){const l=(()=>{if(s===0||s===1)return s;if(i&&(i===27n||i===28n||i>=35n))return i%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),c=`0x${new Y2.Signature(jr(e),jr(t)).toCompactHex()}${l===0?"1b":"1c"}`;return n==="hex"?c:Qa(c)}async function Z2(e,t){var w,x,S;const{address:n,factory:i,factoryData:s,hash:l,signature:c,universalSignatureVerifierAddress:f=(S=(x=(w=e.chain)==null?void 0:w.contracts)==null?void 0:x.universalSignatureVerifier)==null?void 0:S.address,...d}=t,h=lo(c)?c:typeof c=="object"&&"r"in c&&"s"in c?VM(c):tr(c),m=await(async()=>!i&&!s||oM(h)?h:lM({address:i,data:s,signature:h}))();try{const O=f?{to:f,data:Xa({abi:O6,functionName:"isValidSig",args:[n,l,m]}),...d}:{data:A2({abi:O6,args:[n,l,m],bytecode:ZT}),...d},{data:T}=await it(e,c1,"call")(O);return GE(T??"0x0")}catch(O){try{if(D2(ii(n),await DA({hash:l,signature:c})))return!0}catch{}if(O instanceof pA)return!1;throw O}}async function YM(e,{address:t,message:n,factory:i,factoryData:s,signature:l,...c}){const f=E8(n);return Z2(e,{address:t,factory:i,factoryData:s,hash:f,signature:l,...c})}async function ZM(e,t){const{address:n,factory:i,factoryData:s,signature:l,message:c,primaryType:f,types:d,domain:h,...m}=t,w=qR({message:c,primaryType:f,types:d,domain:h});return Z2(e,{address:n,factory:i,factoryData:s,hash:w,signature:l,...m})}function XM(e,t){const{abi:n,address:i,args:s,batch:l=!0,eventName:c,fromBlock:f,onError:d,onLogs:h,poll:m,pollingInterval:w=e.pollingInterval,strict:x}=t;return(typeof m<"u"?m:typeof f=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket"))?(()=>{const R=x??!1,k=Vr(["watchContractEvent",i,s,l,e.uid,c,w,R,f]);return Qc(k,{onLogs:h,onError:d},F=>{let U;f!==void 0&&(U=f-1n);let j,z=!1;const H=y1(async()=>{var V;if(!z){try{j=await it(e,KA,"createContractEventFilter")({abi:n,address:i,args:s,eventName:c,strict:R,fromBlock:f})}catch{}z=!0;return}try{let K;if(j)K=await it(e,ng,"getFilterChanges")({filter:j});else{const Q=await it(e,f1,"getBlockNumber")({});U&&U{j&&await it(e,lg,"uninstallFilter")({filter:j}),H()}})})():(()=>{const R=x??!1,k=Vr(["watchContractEvent",i,s,l,e.uid,c,w,R]);let F=!0,U=()=>F=!1;return Qc(k,{onLogs:h,onError:d},j=>((async()=>{try{const z=(()=>{if(e.transport.type==="fallback"){const K=e.transport.transports.find(Q=>Q.config.type==="webSocket");return K?K.value:e.transport}return e.transport})(),H=c?u1({abi:n,eventName:c,args:s}):[],{unsubscribe:V}=await z.subscribe({params:["logs",{address:i,topics:H}],onData(K){var le;if(!F)return;const Q=K.result;try{const{eventName:ue,args:ae}=B2({abi:n,data:Q.data,topics:Q.topics,strict:x}),me=bl(Q,{args:ae,eventName:ue});j.onLogs([me])}catch(ue){let ae,me;if(ue instanceof R0||ue instanceof Xy){if(x)return;ae=ue.abiItem.name,me=(le=ue.abiItem.inputs)==null?void 0:le.some(W=>!("name"in W&&W.name))}const ce=bl(Q,{args:me?[]:{},eventName:ae});j.onLogs([ce])}},onError(K){var Q;(Q=j.onError)==null||Q.call(j,K)}});U=V,F||U()}catch(z){d==null||d(z)}})(),()=>U()))})()}function zc(e,t,n){const i=e[t.name];if(typeof i=="function")return i;const s=e[n];return typeof s=="function"?s:l=>t(e,l)}const vy="2.16.5",WM=()=>`@wagmi/core@${vy}`;var L8=function(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)},Ny,U8;let Cl=class Om extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return WM()}constructor(t,n={}){var l;super(),Ny.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const i=n.cause instanceof Om?n.cause.details:(l=n.cause)!=null&&l.message?n.cause.message:n.details,s=n.cause instanceof Om&&n.cause.docsPath||n.docsPath;this.message=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${this.docsBaseUrl}${s}.html${n.docsSlug?`#${n.docsSlug}`:""}`]:[],...i?[`Details: ${i}`]:[],`Version: ${this.version}`].join(` +`),n.cause&&(this.cause=n.cause),this.details=i,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=t}walk(t){return L8(this,Ny,"m",U8).call(this,this,t)}};Ny=new WeakSet,U8=function e(t,n){return n!=null&&n(t)?t:t.cause?L8(this,Ny,"m",e).call(this,t.cause,n):t};class lf extends Cl{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class KM extends Cl{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class X2 extends Cl{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class qM extends Cl{constructor({address:t,connector:n}){super(`Account "${t}" not found for connector "${n.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class JM extends Cl{constructor({connectionChainId:t,connectorChainId:n}){super(`The current chain of the connector (id: ${n}) does not match the connection's chain (id: ${t}).`,{metaMessages:[`Current Chain ID: ${n}`,`Expected Chain ID: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorChainMismatchError"})}}class $M extends Cl{constructor({connector:t}){super(`Connector "${t.name}" unavailable while reconnecting.`,{details:["During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uid`.","All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored.","This error commonly occurs for connectors that asynchronously inject after reconnection has already started."].join(" ")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorUnavailableReconnectingError"})}}async function e_(e,t){var i;let n;if(typeof t.connector=="function"?n=e._internal.connectors.setup(t.connector):n=t.connector,n.uid===e.state.current)throw new KM;try{e.setState(d=>({...d,status:"connecting"})),n.emitter.emit("message",{type:"connecting"});const{connector:s,...l}=t,c=await n.connect(l),f=c.accounts;return n.emitter.off("connect",e._internal.events.connect),n.emitter.on("change",e._internal.events.change),n.emitter.on("disconnect",e._internal.events.disconnect),await((i=e.storage)==null?void 0:i.setItem("recentConnectorId",n.id)),e.setState(d=>({...d,connections:new Map(d.connections).set(n.uid,{accounts:f,chainId:c.chainId,connector:n}),current:n.uid,status:"connected"})),{accounts:f,chainId:c.chainId}}catch(s){throw e.setState(l=>({...l,status:l.current?"connected":"disconnected"})),s}}const Rm=256;let ry=Rm,iy;function F8(e=11){if(!iy||ry+e>Rm*2){iy="",ry=0;for(let t=0;t{const F=k(R);for(const j in O)delete F[j];const U={...R,...F};return Object.assign(U,{extend:T(U)})}}return Object.assign(O,{extend:T(O)})}function z8({key:e,methods:t,name:n,request:i,retryCount:s=3,retryDelay:l=150,timeout:c,type:f},d){const h=F8();return{config:{key:e,methods:t,name:n,request:i,retryCount:s,retryDelay:l,timeout:c,type:f},request:jR(i,{methods:t,retryCount:s,retryDelay:l,uid:h}),value:d}}function t_(e,t={}){const{key:n="custom",methods:i,name:s="Custom Provider",retryDelay:l}=t;return({retryCount:c})=>z8({key:n,methods:i,name:s,request:e.request.bind(e),retryCount:t.retryCount??c,retryDelay:l,type:"custom"})}class n_ extends Me{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function hd(e,t={}){const{batch:n,fetchOptions:i,key:s="http",methods:l,name:c="HTTP JSON-RPC",onFetchRequest:f,onFetchResponse:d,retryDelay:h,raw:m}=t;return({chain:w,retryCount:x,timeout:S})=>{const{batchSize:O=1e3,wait:T=0}=typeof n=="object"?n:{},R=t.retryCount??x,k=S??t.timeout??1e4,F=e||(w==null?void 0:w.rpcUrls.default.http[0]);if(!F)throw new n_;const U=ZR(F,{fetchOptions:i,onRequest:f,onResponse:d,timeout:k});return z8({key:s,methods:l,name:c,async request({method:j,params:z}){const H={method:j,params:z},{schedule:V}=VA({id:F,wait:T,shouldSplitBatch(ue){return ue.length>O},fn:ue=>U.request({body:ue}),sort:(ue,ae)=>ue.id-ae.id}),K=async ue=>n?V(ue):[await U.request({body:ue})],[{error:Q,result:le}]=await K(H);if(m)return{error:Q,result:le};if(Q)throw new f2({body:H,error:Q,url:F});return le},retryCount:R,retryDelay:h,timeout:k,type:"http"},{fetchOptions:i,url:F})}}function r_(e){var w,x,S;const{scheme:t,statement:n,...i}=((w=e.match(i_))==null?void 0:w.groups)??{},{chainId:s,expirationTime:l,issuedAt:c,notBefore:f,requestId:d,...h}=((x=e.match(a_))==null?void 0:x.groups)??{},m=(S=e.split("Resources:")[1])==null?void 0:S.split(` +- `).slice(1);return{...i,...h,...s?{chainId:Number(s)}:{},...l?{expirationTime:new Date(l)}:{},...c?{issuedAt:new Date(c)}:{},...f?{notBefore:new Date(f)}:{},...d?{requestId:d}:{},...m?{resources:m}:{},...t?{scheme:t}:{},...n?{statement:n}:{}}}const i_=/^(?:(?[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?
0x[a-fA-F0-9]{40})\n\n(?:(?.*)\n\n)?/,a_=/(?:URI: (?.+))\n(?:Version: (?.+))\n(?:Chain ID: (?\d+))\n(?:Nonce: (?[a-zA-Z0-9]+))\n(?:Issued At: (?.+))(?:\nExpiration Time: (?.+))?(?:\nNot Before: (?.+))?(?:\nRequest ID: (?.+))?/;function s_(e){const{address:t,domain:n,message:i,nonce:s,scheme:l,time:c=new Date}=e;if(n&&i.domain!==n||s&&i.nonce!==s||l&&i.scheme!==l||i.expirationTime&&c>=i.expirationTime||i.notBefore&&cc1(e,t),createAccessList:t=>WA(e,t),createBlockFilter:()=>gO(e),createContractEventFilter:t=>KA(e,t),createEventFilter:t=>qA(e,t),createPendingTransactionFilter:()=>JA(e),estimateContractGas:t=>bO(e,t),estimateGas:t=>O2(e,t),getBalance:t=>T2(e,t),getBlobBaseFee:()=>mO(e),getBlock:t=>so(e,t),getBlockNumber:t=>f1(e,t),getBlockTransactionCount:t=>CO(e,t),getBytecode:t=>i6(e,t),getChainId:()=>x2(e),getCode:t=>i6(e,t),getContractEvents:t=>$A(e,t),getEip712Domain:t=>RO(e,t),getEnsAddress:t=>$T(e,t),getEnsAvatar:t=>dO(e,t),getEnsName:t=>hO(e,t),getEnsResolver:t=>yO(e,t),getEnsText:t=>XA(e,t),getFeeHistory:t=>NO(e,t),estimateFeesPerGas:t=>IT(e,t),getFilterChanges:t=>ng(e,t),getFilterLogs:t=>DO(e,t),getGasPrice:()=>C2(e),getLogs:t=>k2(e,t),getProof:t=>bM(e,t),estimateMaxPriorityFeePerGas:t=>BT(e,t),getStorageAt:t=>BO(e,t),getTransaction:t=>rg(e,t),getTransactionConfirmations:t=>IO(e,t),getTransactionCount:t=>LA(e,t),getTransactionReceipt:t=>hm(e,t),multicall:t=>e8(e,t),prepareTransactionRequest:t=>R2(e,t),readContract:t=>co(e,t),sendRawTransaction:t=>FA(e,t),simulate:t=>pm(e,t),simulateBlocks:t=>pm(e,t),simulateCalls:t=>uM(e,t),simulateContract:t=>vM(e,t),verifyMessage:t=>YM(e,t),verifySiweMessage:t=>o_(e,t),verifyTypedData:t=>ZM(e,t),uninstallFilter:t=>lg(e,t),waitForTransactionReceipt:t=>T8(e,t),watchBlocks:t=>dM(e,t),watchBlockNumber:t=>S8(e,t),watchContractEvent:t=>XM(e,t),watchEvent:t=>hM(e,t),watchPendingTransactions:t=>yM(e,t)}}function H8(e){const{key:t="public",name:n="Public Client"}=e;return W2({...e,key:t,name:n,type:"publicClient"}).extend(l_)}async function g1(e,t={}){let n;if(t.connector){const{connector:h}=t;if(e.state.status==="reconnecting"&&!h.getAccounts&&!h.getChainId)throw new $M({connector:h});const[m,w]=await Promise.all([h.getAccounts().catch(x=>{if(t.account===null)return[];throw x}),h.getChainId()]);n={accounts:m,chainId:w,connector:h}}else n=e.state.connections.get(e.state.current);if(!n)throw new X2;const i=t.chainId??n.chainId,s=await n.connector.getChainId();if(s!==n.chainId)throw new JM({connectionChainId:n.chainId,connectorChainId:s});const l=n.connector;if(l.getClient)return l.getClient({chainId:i});const c=si(t.account??n.accounts[0]);if(c&&(c.address=ii(c.address)),t.account&&!n.accounts.some(h=>h.toLowerCase()===c.address.toLowerCase()))throw new qM({address:c.address,connector:l});const f=e.chains.find(h=>h.id===i),d=await n.connector.getProvider({chainId:i});return W2({account:c,chain:f,name:"Connector Client",transport:h=>t_(d)({...h,retryCount:0})})}async function c_(e,t={}){var s,l;let n;if(t.connector)n=t.connector;else{const{connections:c,current:f}=e.state,d=c.get(f);n=d==null?void 0:d.connector}const i=e.state.connections;n&&(await n.disconnect(),n.emitter.off("change",e._internal.events.change),n.emitter.off("disconnect",e._internal.events.disconnect),n.emitter.on("connect",e._internal.events.connect),i.delete(n.uid)),e.setState(c=>{if(i.size===0)return{...c,connections:new Map,current:null,status:"disconnected"};const f=i.values().next().value;return{...c,connections:new Map(i),current:f.connector.uid}});{const c=e.state.current;if(!c)return;const f=(s=e.state.connections.get(c))==null?void 0:s.connector;if(!f)return;await((l=e.storage)==null?void 0:l.setItem("recentConnectorId",f.id))}}function G8(e){return typeof e=="number"?e:e==="wei"?0:Math.abs(n9[e])}function Q8(e){const t=e.state.current,n=e.state.connections.get(t),i=n==null?void 0:n.accounts,s=i==null?void 0:i[0],l=e.chains.find(f=>f.id===(n==null?void 0:n.chainId)),c=e.state.status;switch(c){case"connected":return{address:s,addresses:i,chain:l,chainId:n==null?void 0:n.chainId,connector:n==null?void 0:n.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:c};case"reconnecting":return{address:s,addresses:i,chain:l,chainId:n==null?void 0:n.chainId,connector:n==null?void 0:n.connector,isConnected:!!s,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:c};case"connecting":return{address:s,addresses:i,chain:l,chainId:n==null?void 0:n.chainId,connector:n==null?void 0:n.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:c};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:c}}}async function u_(e,t){const{allowFailure:n=!0,chainId:i,contracts:s,...l}=t,c=e.getClient({chainId:i});return zc(c,e8,"multicall")({allowFailure:n,contracts:s,...l})}function j8(e,t){const{chainId:n,...i}=t,s=e.getClient({chainId:n});return zc(s,co,"readContract")(i)}async function f_(e,t){var f;const{allowFailure:n=!0,blockNumber:i,blockTag:s,...l}=t,c=t.contracts;try{const d={};for(const[x,S]of c.entries()){const O=S.chainId??e.state.chainId;d[O]||(d[O]=[]),(f=d[O])==null||f.push({contract:S,index:x})}const h=()=>Object.entries(d).map(([x,S])=>u_(e,{...l,allowFailure:n,blockNumber:i,blockTag:s,chainId:Number.parseInt(x),contracts:S.map(({contract:O})=>O)})),m=(await Promise.all(h())).flat(),w=Object.values(d).flatMap(x=>x.map(({index:S})=>S));return m.reduce((x,S,O)=>(x&&(x[w[O]]=S),x),[])}catch(d){if(d instanceof bA)throw d;const h=()=>c.map(m=>j8(e,{...m,blockNumber:i,blockTag:s}));return n?(await Promise.allSettled(h())).map(m=>m.status==="fulfilled"?{result:m.value,status:"success"}:{error:m.reason,result:void 0,status:"failure"}):await Promise.all(h())}}async function d_(e,t){const{address:n,blockNumber:i,blockTag:s,chainId:l,token:c,unit:f="ether"}=t;if(c)try{return await W6(e,{balanceAddress:n,chainId:l,symbolType:"string",tokenAddress:c})}catch(x){if(x.name==="ContractFunctionExecutionError"){const S=await W6(e,{balanceAddress:n,chainId:l,symbolType:"bytes32",tokenAddress:c}),O=v4(ya(S.symbol,{dir:"right"}));return{...S,symbol:O}}throw x}const d=e.getClient({chainId:l}),m=await zc(d,T2,"getBalance")(i?{address:n,blockNumber:i}:{address:n,blockTag:s}),w=e.chains.find(x=>x.id===l)??d.chain;return{decimals:w.nativeCurrency.decimals,formatted:jd(m,G8(f)),symbol:w.nativeCurrency.symbol,value:m}}async function W6(e,t){const{balanceAddress:n,chainId:i,symbolType:s,tokenAddress:l,unit:c}=t,f={abi:[{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:s}]}],address:l},[d,h,m]=await f_(e,{allowFailure:!1,contracts:[{...f,functionName:"balanceOf",args:[n],chainId:i},{...f,functionName:"decimals",chainId:i},{...f,functionName:"symbol",chainId:i}]}),w=jd(d??"0",G8(c??h));return{decimals:h,formatted:w,symbol:m,value:d}}function K6(e){return e.state.chainId}function jc(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let n,i;if(Array.isArray(e)&&Array.isArray(t)){if(n=e.length,n!==t.length)return!1;for(i=n;i--!==0;)if(!jc(e[i],t[i]))return!1;return!0}if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const s=Object.keys(e);if(n=s.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[i]))return!1;for(i=n;i--!==0;){const l=s[i];if(l&&!jc(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}let Gp=[];function q6(e){const t=e.chains;return jc(Gp,t)?Gp:(Gp=t,t)}let ay=[];function Mm(e){const t=[...e.state.connections.values()];return e.state.status==="reconnecting"||jc(ay,t)?ay:(ay=t,t)}let Qp=[];function J6(e){const t=e.connectors;return jc(Qp,t)?Qp:(Qp=t,t)}let jp=!1;async function h_(e,t={}){var h,m;if(jp)return[];jp=!0,e.setState(w=>({...w,status:w.current?"reconnecting":"connecting"}));const n=[];if((h=t.connectors)!=null&&h.length)for(const w of t.connectors){let x;typeof w=="function"?x=e._internal.connectors.setup(w):x=w,n.push(x)}else n.push(...e.connectors);let i;try{i=await((m=e.storage)==null?void 0:m.getItem("recentConnectorId"))}catch{}const s={};for(const[,w]of e.state.connections)s[w.connector.id]=1;i&&(s[i]=0);const l=Object.keys(s).length>0?[...n].sort((w,x)=>(s[w.id]??10)-(s[x.id]??10)):n;let c=!1;const f=[],d=[];for(const w of l){const x=await w.getProvider().catch(()=>{});if(!x||d.some(T=>T===x)||!await w.isAuthorized())continue;const O=await w.connect({isReconnecting:!0}).catch(()=>null);O&&(w.emitter.off("connect",e._internal.events.connect),w.emitter.on("change",e._internal.events.change),w.emitter.on("disconnect",e._internal.events.disconnect),e.setState(T=>{const R=new Map(c?T.connections:new Map).set(w.uid,{accounts:O.accounts,chainId:O.chainId,connector:w});return{...T,current:c?T.current:w.uid,connections:R}}),f.push({accounts:O.accounts,chainId:O.chainId,connector:w}),d.push(x),c=!0)}return(e.state.status==="reconnecting"||e.state.status==="connecting")&&(c?e.setState(w=>({...w,status:"connected"})):e.setState(w=>({...w,connections:new Map,current:null,status:"disconnected"}))),jp=!1,f}async function y_(e,t){const{account:n,chainId:i,connector:s,...l}=t;let c;return typeof n=="object"&&(n==null?void 0:n.type)==="local"?c=e.getClient({chainId:i}):c=await g1(e,{account:n??void 0,chainId:i,connector:s}),await zc(c,UT,"sendTransaction")({...l,...n?{account:n}:{},chain:i?{id:i}:null,gas:l.gas??void 0})}async function g_(e,t){const{account:n,connector:i,...s}=t;let l;return typeof n=="object"&&n.type==="local"?l=e.getClient():l=await g1(e,{account:n,connector:i}),zc(l,mM,"signMessage")({...s,...n?{account:n}:{}})}class ku extends Cl{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class p_ extends Cl{constructor({connector:t}){super(`"${t.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}async function b_(e,t){var c;const{addEthereumChainParameter:n,chainId:i}=t,s=e.state.connections.get(((c=t.connector)==null?void 0:c.uid)??e.state.current);if(s){const f=s.connector;if(!f.switchChain)throw new p_({connector:f});return await f.switchChain({addEthereumChainParameter:n,chainId:i})}const l=e.chains.find(f=>f.id===i);if(!l)throw new lf;return e.setState(f=>({...f,chainId:i})),l}function m_(e,t){const{onChange:n}=t;return e.subscribe(()=>Q8(e),n,{equalityFn(i,s){const{connector:l,...c}=i,{connector:f,...d}=s;return jc(c,d)&&(l==null?void 0:l.id)===(f==null?void 0:f.id)&&(l==null?void 0:l.uid)===(f==null?void 0:f.uid)}})}function v_(e,t){const{onChange:n}=t;return e.subscribe(i=>i.chainId,n)}function w_(e,t){const{onChange:n}=t;return e.subscribe(()=>Mm(e),n,{equalityFn:jc})}function A_(e,t){const{onChange:n}=t;return e._internal.connectors.subscribe((i,s)=>{n(Object.values(i),s)})}async function V8(e,t){const{chainId:n,timeout:i=0,...s}=t,l=e.getClient({chainId:n}),f=await zc(l,T8,"waitForTransactionReceipt")({...s,timeout:i});if(f.status==="reverted"){const h=await zc(l,rg,"getTransaction")({hash:f.transactionHash}),w=await zc(l,c1,"call")({...h,data:h.input,gasPrice:h.type!=="eip1559"?h.gasPrice:void 0,maxFeePerGas:h.type==="eip1559"?h.maxFeePerGas:void 0,maxPriorityFeePerGas:h.type==="eip1559"?h.maxPriorityFeePerGas:void 0}),x=w!=null&&w.data?v4(`0x${w.data.substring(138)}`):"unknown reason";throw new Error(x)}return{...f,chainId:l.chain.id}}cg.type="injected";function cg(e={}){const{shimDisconnect:t=!0,unstable_shimAsyncInject:n}=e;function i(){const d=e.target;if(typeof d=="function"){const h=d();if(h)return h}return typeof d=="object"?d:typeof d=="string"?{...x_[d]??{id:d,name:`${d[0].toUpperCase()}${d.slice(1)}`,provider:`is${d[0].toUpperCase()}${d.slice(1)}`}}:{id:"injected",name:"Injected",provider(h){return h==null?void 0:h.ethereum}}}let s,l,c,f;return d=>({get icon(){return i().icon},get id(){return i().id},get name(){return i().name},get supportsSimulation(){return!0},type:cg.type,async setup(){const h=await this.getProvider();h!=null&&h.on&&e.target&&(c||(c=this.onConnect.bind(this),h.on("connect",c)),s||(s=this.onAccountsChanged.bind(this),h.on("accountsChanged",s)))},async connect({chainId:h,isReconnecting:m}={}){var S,O,T,R,k,F;const w=await this.getProvider();if(!w)throw new ku;let x=[];if(m)x=await this.getAccounts().catch(()=>[]);else if(t)try{x=(R=(T=(O=(S=(await w.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:S.caveats)==null?void 0:O[0])==null?void 0:T.value)==null?void 0:R.map(j=>ii(j)),x.length>0&&(x=await this.getAccounts())}catch(U){const j=U;if(j.code===Wt.code)throw new Wt(j);if(j.code===oo.code)throw j}try{!(x!=null&&x.length)&&!m&&(x=(await w.request({method:"eth_requestAccounts"})).map(z=>ii(z))),c&&(w.removeListener("connect",c),c=void 0),s||(s=this.onAccountsChanged.bind(this),w.on("accountsChanged",s)),l||(l=this.onChainChanged.bind(this),w.on("chainChanged",l)),f||(f=this.onDisconnect.bind(this),w.on("disconnect",f));let U=await this.getChainId();if(h&&U!==h){const j=await this.switchChain({chainId:h}).catch(z=>{if(z.code===Wt.code)throw z;return{id:U}});U=(j==null?void 0:j.id)??U}return t&&await((k=d.storage)==null?void 0:k.removeItem(`${this.id}.disconnected`)),e.target||await((F=d.storage)==null?void 0:F.setItem("injected.connected",!0)),{accounts:x,chainId:U}}catch(U){const j=U;throw j.code===Wt.code?new Wt(j):j.code===oo.code?new oo(j):j}},async disconnect(){var m,w;const h=await this.getProvider();if(!h)throw new ku;l&&(h.removeListener("chainChanged",l),l=void 0),f&&(h.removeListener("disconnect",f),f=void 0),c||(c=this.onConnect.bind(this),h.on("connect",c));try{await V2(()=>h.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}t&&await((m=d.storage)==null?void 0:m.setItem(`${this.id}.disconnected`,!0)),e.target||await((w=d.storage)==null?void 0:w.removeItem("injected.connected"))},async getAccounts(){const h=await this.getProvider();if(!h)throw new ku;return(await h.request({method:"eth_accounts"})).map(w=>ii(w))},async getChainId(){const h=await this.getProvider();if(!h)throw new ku;const m=await h.request({method:"eth_chainId"});return Number(m)},async getProvider(){if(typeof window>"u")return;let h;const m=i();return typeof m.provider=="function"?h=m.provider(window):typeof m.provider=="string"?h=wy(window,m.provider):h=m.provider,h&&!h.removeListener&&("off"in h&&typeof h.off=="function"?h.removeListener=h.off:h.removeListener=()=>{}),h},async isAuthorized(){var h,m;try{if(t&&await((h=d.storage)==null?void 0:h.getItem(`${this.id}.disconnected`))||!e.target&&!await((m=d.storage)==null?void 0:m.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(n!==void 0&&n!==!1){const O=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",O),!!await this.getProvider()),T=typeof n=="number"?n:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(k=>window.addEventListener("ethereum#initialized",()=>k(O()),{once:!0}))]:[],new Promise(k=>setTimeout(()=>k(O()),T))]))return!0}throw new ku}return!!(await Fd(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:h,chainId:m}){var O,T,R,k;const w=await this.getProvider();if(!w)throw new ku;const x=d.chains.find(F=>F.id===m);if(!x)throw new Vi(new lf);const S=new Promise(F=>{const U=j=>{"chainId"in j&&j.chainId===m&&(d.emitter.off("change",U),F())};d.emitter.on("change",U)});try{return await Promise.all([w.request({method:"wallet_switchEthereumChain",params:[{chainId:Ze(m)}]}).then(async()=>{await this.getChainId()===m&&d.emitter.emit("change",{chainId:m})}),S]),x}catch(F){const U=F;if(U.code===4902||((T=(O=U==null?void 0:U.data)==null?void 0:O.originalError)==null?void 0:T.code)===4902)try{const{default:j,...z}=x.blockExplorers??{};let H;h!=null&&h.blockExplorerUrls?H=h.blockExplorerUrls:j&&(H=[j.url,...Object.values(z).map(Q=>Q.url)]);let V;(R=h==null?void 0:h.rpcUrls)!=null&&R.length?V=h.rpcUrls:V=[((k=x.rpcUrls.default)==null?void 0:k.http[0])??""];const K={blockExplorerUrls:H,chainId:Ze(m),chainName:(h==null?void 0:h.chainName)??x.name,iconUrls:h==null?void 0:h.iconUrls,nativeCurrency:(h==null?void 0:h.nativeCurrency)??x.nativeCurrency,rpcUrls:V};return await Promise.all([w.request({method:"wallet_addEthereumChain",params:[K]}).then(async()=>{if(await this.getChainId()===m)d.emitter.emit("change",{chainId:m});else throw new Wt(new Error("User rejected switch after adding network."))}),S]),x}catch(j){throw new Wt(j)}throw U.code===Wt.code?new Wt(U):new Vi(U)}},async onAccountsChanged(h){var m;if(h.length===0)this.onDisconnect();else if(d.emitter.listenerCount("connect")){const w=(await this.getChainId()).toString();this.onConnect({chainId:w}),t&&await((m=d.storage)==null?void 0:m.removeItem(`${this.id}.disconnected`))}else d.emitter.emit("change",{accounts:h.map(w=>ii(w))})},onChainChanged(h){const m=Number(h);d.emitter.emit("change",{chainId:m})},async onConnect(h){const m=await this.getAccounts();if(m.length===0)return;const w=Number(h.chainId);d.emitter.emit("connect",{accounts:m,chainId:w});const x=await this.getProvider();x&&(c&&(x.removeListener("connect",c),c=void 0),s||(s=this.onAccountsChanged.bind(this),x.on("accountsChanged",s)),l||(l=this.onChainChanged.bind(this),x.on("chainChanged",l)),f||(f=this.onDisconnect.bind(this),x.on("disconnect",f)))},async onDisconnect(h){const m=await this.getProvider();h&&h.code===1013&&m&&(await this.getAccounts()).length||(d.emitter.emit("disconnect"),m&&(l&&(m.removeListener("chainChanged",l),l=void 0),f&&(m.removeListener("disconnect",f),f=void 0),c||(c=this.onConnect.bind(this),m.on("connect",c))))}})}const x_={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(e){return e!=null&&e.coinbaseWalletExtension?e.coinbaseWalletExtension:wy(e,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(e){return wy(e,t=>{if(!t.isMetaMask||t.isBraveWallet&&!t._events&&!t._state)return!1;const n=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPhantom","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"];for(const i of n)if(t[i])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(e){var t,n;return(t=e==null?void 0:e.phantom)!=null&&t.ethereum?(n=e.phantom)==null?void 0:n.ethereum:wy(e,"isPhantom")}}};function wy(e,t){function n(s){return typeof t=="function"?t(s):typeof t=="string"?s[t]:!0}const i=e.ethereum;if(i!=null&&i.providers)return i.providers.find(s=>n(s));if(i&&n(i))return i}function E_(e){if(typeof window>"u")return;const t=n=>e(n.detail);return window.addEventListener("eip6963:announceProvider",t),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",t)}function C_(){const e=new Set;let t=[];const n=()=>E_(s=>{t.some(({info:l})=>l.uuid===s.info.uuid)||(t=[...t,s],e.forEach(l=>l(t,{added:[s]})))});let i=n();return{_listeners(){return e},clear(){e.forEach(s=>s([],{removed:[...t]})),t=[]},destroy(){this.clear(),e.clear(),i==null||i()},findProvider({rdns:s}){return t.find(l=>l.info.rdns===s)},getProviders(){return t},reset(){this.clear(),i==null||i(),i=n()},subscribe(s,{emitImmediately:l}={}){return e.add(s),l&&s(t,{added:t}),()=>e.delete(s)}}}const S_=e=>(t,n,i)=>{const s=i.subscribe;return i.subscribe=(c,f,d)=>{let h=c;if(f){const m=(d==null?void 0:d.equalityFn)||Object.is;let w=c(i.getState());h=x=>{const S=c(x);if(!m(w,S)){const O=w;f(w=S,O)}},d!=null&&d.fireImmediately&&f(w,w)}return s(h)},e(t,n,i)},T_=S_;function O_(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var l;const c=d=>d===null?null:JSON.parse(d,void 0),f=(l=n.getItem(s))!=null?l:null;return f instanceof Promise?f.then(c):c(f)},setItem:(s,l)=>n.setItem(s,JSON.stringify(l,void 0)),removeItem:s=>n.removeItem(s)}}const _m=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(i){return _m(i)(n)},catch(i){return this}}}catch(n){return{then(i){return this},catch(i){return _m(i)(n)}}}},R_=(e,t)=>(n,i,s)=>{let l={storage:O_(()=>localStorage),partialize:T=>T,version:0,merge:(T,R)=>({...R,...T}),...t},c=!1;const f=new Set,d=new Set;let h=l.storage;if(!h)return e((...T)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),n(...T)},i,s);const m=()=>{const T=l.partialize({...i()});return h.setItem(l.name,{state:T,version:l.version})},w=s.setState;s.setState=(T,R)=>{w(T,R),m()};const x=e((...T)=>{n(...T),m()},i,s);s.getInitialState=()=>x;let S;const O=()=>{var T,R;if(!h)return;c=!1,f.forEach(F=>{var U;return F((U=i())!=null?U:x)});const k=((R=l.onRehydrateStorage)==null?void 0:R.call(l,(T=i())!=null?T:x))||void 0;return _m(h.getItem.bind(h))(l.name).then(F=>{if(F)if(typeof F.version=="number"&&F.version!==l.version){if(l.migrate)return[!0,l.migrate(F.state,F.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,F.state];return[!1,void 0]}).then(F=>{var U;const[j,z]=F;if(S=l.merge(z,(U=i())!=null?U:x),n(S,!0),j)return m()}).then(()=>{k==null||k(S,void 0),S=i(),c=!0,d.forEach(F=>F(S))}).catch(F=>{k==null||k(void 0,F)})};return s.persist={setOptions:T=>{l={...l,...T},T.storage&&(h=T.storage)},clearStorage:()=>{h==null||h.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>O(),hasHydrated:()=>c,onHydrate:T=>(f.add(T),()=>{f.delete(T)}),onFinishHydration:T=>(d.add(T),()=>{d.delete(T)})},l.skipHydration||O(),S||x},M_=R_,$6=e=>{let t;const n=new Set,i=(h,m)=>{const w=typeof h=="function"?h(t):h;if(!Object.is(w,t)){const x=t;t=m??(typeof w!="object"||w===null)?w:Object.assign({},t,w),n.forEach(S=>S(t,x))}},s=()=>t,f={setState:i,getState:s,getInitialState:()=>d,subscribe:h=>(n.add(h),()=>n.delete(h))},d=t=e(i,s,f);return f},Vp=e=>e?$6(e):$6;var Yp={exports:{}},e3;function __(){return e3||(e3=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(n=!1));function s(d,h,m){this.fn=d,this.context=h,this.once=m||!1}function l(d,h,m,w,x){if(typeof m!="function")throw new TypeError("The listener must be a function");var S=new s(m,w||d,x),O=n?n+h:h;return d._events[O]?d._events[O].fn?d._events[O]=[d._events[O],S]:d._events[O].push(S):(d._events[O]=S,d._eventsCount++),d}function c(d,h){--d._eventsCount===0?d._events=new i:delete d._events[h]}function f(){this._events=new i,this._eventsCount=0}f.prototype.eventNames=function(){var h=[],m,w;if(this._eventsCount===0)return h;for(w in m=this._events)t.call(m,w)&&h.push(n?w.slice(1):w);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(m)):h},f.prototype.listeners=function(h){var m=n?n+h:h,w=this._events[m];if(!w)return[];if(w.fn)return[w.fn];for(var x=0,S=w.length,O=new Array(S);x{let s=i;return(s==null?void 0:s.__type)==="bigint"&&(s=BigInt(s.value)),(s==null?void 0:s.__type)==="Map"&&(s=new Map(s.value)),(t==null?void 0:t(n,s))??s})}function t3(e,t){return e.slice(0,t).join(".")||"."}function n3(e,t){const{length:n}=e;for(let i=0;i{let c=l;return typeof c=="bigint"&&(c={__type:"bigint",value:l.toString()}),c instanceof Map&&(c={__type:"Map",value:Array.from(l.entries())}),(t==null?void 0:t(s,c))??c},i),n??void 0)}function Y8(e){const{deserialize:t=k_,key:n="wagmi",serialize:i=L_,storage:s=Z8}=e;function l(c){return c instanceof Promise?c.then(f=>f).catch(()=>null):c}return{...s,key:n,async getItem(c,f){const d=s.getItem(`${n}.${c}`),h=await l(d);return h?t(h)??null:f??null},async setItem(c,f){const d=`${n}.${c}`;f===null?await l(s.removeItem(d)):await l(s.setItem(d,i(f)))},async removeItem(c){await l(s.removeItem(`${n}.${c}`))}}}const Z8={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function U_(){const e=typeof window<"u"&&window.localStorage?window.localStorage:Z8;return{getItem(t){return e.getItem(t)},removeItem(t){e.removeItem(t)},setItem(t,n){try{e.setItem(t,n)}catch{}}}}const Nm=256;let sy=Nm,oy;function F_(e=11){if(!oy||sy+e>Nm*2){oy="",sy=0;for(let t=0;tl.chains),d=Vp(()=>{const z=[],H=new Set;for(const V of l.connectors??[]){const K=h(V);if(z.push(K),!s&&K.rdns){const Q=typeof K.rdns=="string"?[K.rdns]:K.rdns;for(const le of Q)H.add(le)}}if(!s&&c){const V=c.getProviders();for(const K of V)H.has(K.info.rdns)||z.push(h(m(K)))}return z});function h(z){var K;const H=I_(F_()),V={...z({emitter:H,chains:f.getState(),storage:n,transports:l.transports}),emitter:H,uid:H.uid};return H.on("connect",U),(K=V.setup)==null||K.call(V),V}function m(z){const{info:H}=z,V=z.provider;return cg({target:{...H,id:H.rdns,provider:V}})}const w=new Map;function x(z={}){const H=z.chainId??R.getState().chainId,V=f.getState().find(Q=>Q.id===H);if(z.chainId&&!V)throw new lf;{const Q=w.get(R.getState().chainId);if(Q&&!V)return Q;if(!V)throw new lf}{const Q=w.get(H);if(Q)return Q}let K;if(l.client)K=l.client({chain:V});else{const Q=V.id,le=f.getState().map(me=>me.id),ue={},ae=Object.entries(l);for(const[me,ce]of ae)if(!(me==="chains"||me==="client"||me==="connectors"||me==="transports"))if(typeof ce=="object")if(Q in ce)ue[me]=ce[Q];else{if(le.some(L=>L in ce))continue;ue[me]=ce}else ue[me]=ce;K=W2({...ue,chain:V,batch:ue.batch??{multicall:!0},transport:me=>l.transports[Q]({...me,connectors:d})})}return w.set(H,K),K}function S(){return{chainId:f.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let O;const T="0.0.0-canary-";vy.startsWith(T)?O=Number.parseInt(vy.replace(T,"")):O=Number.parseInt(vy.split(".")[0]??"0");const R=Vp(T_(n?M_(S,{migrate(z,H){if(H===O)return z;const V=S(),K=k(z,V.chainId);return{...V,chainId:K}},name:"store",partialize(z){return{connections:{__type:"Map",value:Array.from(z.connections.entries()).map(([H,V])=>{const{id:K,name:Q,type:le,uid:ue}=V.connector;return[H,{...V,connector:{id:K,name:Q,type:le,uid:ue}}]})},chainId:z.chainId,current:z.current}},merge(z,H){typeof z=="object"&&z&&"status"in z&&delete z.status;const V=k(z,H.chainId);return{...H,...z,chainId:V}},skipHydration:s,storage:n,version:O}):S));R.setState(S());function k(z,H){return z&&typeof z=="object"&&"chainId"in z&&typeof z.chainId=="number"&&f.getState().some(V=>V.id===z.chainId)?z.chainId:H}i&&R.subscribe(({connections:z,current:H})=>{var V;return H?(V=z.get(H))==null?void 0:V.chainId:void 0},z=>{if(f.getState().some(V=>V.id===z))return R.setState(V=>({...V,chainId:z??V.chainId}))}),c==null||c.subscribe(z=>{const H=new Set,V=new Set;for(const Q of d.getState())if(H.add(Q.id),Q.rdns){const le=typeof Q.rdns=="string"?[Q.rdns]:Q.rdns;for(const ue of le)V.add(ue)}const K=[];for(const Q of z){if(V.has(Q.info.rdns))continue;const le=h(m(Q));H.has(le.id)||K.push(le)}n&&!R.persist.hasHydrated()||d.setState(Q=>[...Q,...K],!0)});function F(z){R.setState(H=>{const V=H.connections.get(z.uid);return V?{...H,connections:new Map(H.connections).set(z.uid,{accounts:z.accounts??V.accounts,chainId:z.chainId??V.chainId,connector:V.connector})}:H})}function U(z){R.getState().status==="connecting"||R.getState().status==="reconnecting"||R.setState(H=>{const V=d.getState().find(K=>K.uid===z.uid);return V?(V.emitter.listenerCount("connect")&&V.emitter.off("connect",F),V.emitter.listenerCount("change")||V.emitter.on("change",F),V.emitter.listenerCount("disconnect")||V.emitter.on("disconnect",j),{...H,connections:new Map(H.connections).set(z.uid,{accounts:z.accounts,chainId:z.chainId,connector:V}),current:z.uid,status:"connected"}):H})}function j(z){R.setState(H=>{const V=H.connections.get(z.uid);if(V){const Q=V.connector;Q.emitter.listenerCount("change")&&V.connector.emitter.off("change",F),Q.emitter.listenerCount("disconnect")&&V.connector.emitter.off("disconnect",j),Q.emitter.listenerCount("connect")||V.connector.emitter.on("connect",U)}if(H.connections.delete(z.uid),H.connections.size===0)return{...H,connections:new Map,current:null,status:"disconnected"};const K=H.connections.values().next().value;return{...H,connections:new Map(H.connections),current:K.connector.uid}})}return{get chains(){return f.getState()},get connectors(){return d.getState()},storage:n,getClient:x,get state(){return R.getState()},setState(z){let H;typeof z=="function"?H=z(R.getState()):H=z;const V=S();typeof H!="object"&&(H=V),Object.keys(V).some(Q=>!(Q in H))&&(H=V),R.setState(H,!0)},subscribe(z,H,V){return R.subscribe(z,H,V?{...V,fireImmediately:V.emitImmediately}:void 0)},_internal:{mipd:c,store:R,ssr:!!s,syncConnectedChain:i,transports:l.transports,chains:{setState(z){const H=typeof z=="function"?z(f.getState()):z;if(H.length!==0)return f.setState(H,!0)},subscribe(z){return f.subscribe(z)}},connectors:{providerDetailToConnector:m,setup:h,setState(z){return d.setState(typeof z=="function"?z(d.getState()):z,!0)},subscribe(z){return d.subscribe(z)}},events:{change:F,connect:U,disconnect:j}}}}function H_(e,t){const{initialState:n,reconnectOnMount:i}=t;return n&&!e._internal.store.persist.hasHydrated()&&e.setState({...n,chainId:e.chains.some(s=>s.id===n.chainId)?n.chainId:e.chains[0].id,connections:i?n.connections:new Map,status:i?"reconnecting":"disconnected"}),{async onMount(){e._internal.ssr&&(await e._internal.store.persist.rehydrate(),e._internal.mipd&&e._internal.connectors.setState(s=>{var d;const l=new Set;for(const h of s??[])if(h.rdns){const m=Array.isArray(h.rdns)?h.rdns:[h.rdns];for(const w of m)l.add(w)}const c=[],f=((d=e._internal.mipd)==null?void 0:d.getProviders())??[];for(const h of f){if(l.has(h.info.rdns))continue;const m=e._internal.connectors.providerDetailToConnector(h),w=e._internal.connectors.setup(m);c.push(w)}return[...s,...c]})),i?h_(e):e.storage&&e.setState(s=>({...s,connections:new Map}))}}}const G_={getItem(e){return typeof window>"u"?null:Q_(document.cookie,e)??null},setItem(e,t){typeof window>"u"||(document.cookie=`${e}=${t};path=/;samesite=Lax`)},removeItem(e){typeof window>"u"||(document.cookie=`${e}=;max-age=-1;path=/`)}};function Q_(e,t){const n=e.split("; ").find(i=>i.startsWith(`${t}=`));if(n)return n.substring(t.length+1)}function j_(e){var l,c,f;const{chain:t}=e,n=t.rpcUrls.default.http[0];if(!e.transports)return[n];const i=(c=(l=e.transports)==null?void 0:l[t.id])==null?void 0:c.call(l,{chain:t});return(((f=i==null?void 0:i.value)==null?void 0:f.transports)||[i]).map(({value:d})=>(d==null?void 0:d.url)||n)}function V_(e){const{children:t,config:n,initialState:i,reconnectOnMount:s=!0}=e,{onMount:l}=H_(n,{initialState:i,reconnectOnMount:s});n._internal.ssr||l();const c=J.useRef(!0);return J.useEffect(()=>{if(c.current&&n._internal.ssr)return l(),()=>{c.current=!1}},[]),t}const X8=J.createContext(void 0);function Y_(e){const{children:t,config:n}=e,i={value:n};return J.createElement(V_,e,J.createElement(X8.Provider,i,t))}const Z_="2.14.12",X_=()=>`wagmi@${Z_}`;class W_ extends Cl{constructor(){super(...arguments),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiError"})}get docsBaseUrl(){return"https://wagmi.sh/react"}get version(){return X_()}}class W8 extends W_{constructor(){super("`useConfig` must be used within `WagmiProvider`.",{docsPath:"/api/WagmiProvider"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiProviderNotFoundError"})}}function Yr(e={}){const t=e.config??J.useContext(X8);if(!t)throw new W8;return t}function K_(e,t){const{onChange:n}=t;return e._internal.chains.subscribe((i,s)=>{n(i,s)})}var Zp={exports:{}},Xp={},Wp={exports:{}},Kp={};/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var r3;function q_(){if(r3)return Kp;r3=1;var e=uf();function t(w,x){return w===x&&(w!==0||1/w===1/x)||w!==w&&x!==x}var n=typeof Object.is=="function"?Object.is:t,i=e.useState,s=e.useEffect,l=e.useLayoutEffect,c=e.useDebugValue;function f(w,x){var S=x(),O=i({inst:{value:S,getSnapshot:x}}),T=O[0].inst,R=O[1];return l(function(){T.value=S,T.getSnapshot=x,d(T)&&R({inst:T})},[w,S,x]),s(function(){return d(T)&&R({inst:T}),w(function(){d(T)&&R({inst:T})})},[w]),c(S),S}function d(w){var x=w.getSnapshot;w=w.value;try{var S=x();return!n(w,S)}catch{return!0}}function h(w,x){return x()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:f;return Kp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Kp}var i3;function J_(){return i3||(i3=1,Wp.exports=q_()),Wp.exports}/** + * @license React + * use-sync-external-store-shim/with-selector.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var a3;function $_(){if(a3)return Xp;a3=1;var e=uf(),t=J_();function n(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}var i=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,l=e.useRef,c=e.useEffect,f=e.useMemo,d=e.useDebugValue;return Xp.useSyncExternalStoreWithSelector=function(h,m,w,x,S){var O=l(null);if(O.current===null){var T={hasValue:!1,value:null};O.current=T}else T=O.current;O=f(function(){function k(H){if(!F){if(F=!0,U=H,H=x(H),S!==void 0&&T.hasValue){var V=T.value;if(S(V,H))return j=V}return j=H}if(V=j,i(U,H))return V;var K=x(H);return S!==void 0&&S(V,K)?(U=H,V):(U=H,j=K)}var F=!1,U,j,z=w===void 0?null:w;return[function(){return k(m())},z===null?void 0:function(){return k(z())}]},[m,w,x,S]);var R=s(h,O[0],O[1]);return c(function(){T.hasValue=!0,T.value=R},[R]),d(R),R},Xp}var s3;function eN(){return s3||(s3=1,Zp.exports=$_()),Zp.exports}var tN=eN();const qp=e=>typeof e=="object"&&!Array.isArray(e);function nN(e,t,n=t,i=jc){const s=J.useRef([]),l=tN.useSyncExternalStoreWithSelector(e,t,n,c=>c,(c,f)=>{if(qp(c)&&qp(f)&&s.current.length){for(const d of s.current)if(!i(c[d],f[d]))return!1;return!0}return i(c,f)});return J.useMemo(()=>{if(qp(l)){const c={...l};let f={};for(const[d,h]of Object.entries(c))f={...f,[d]:{configurable:!1,enumerable:!0,get:()=>(s.current.includes(d)||s.current.push(d),h)}};return Object.defineProperties(c,f),c}return l},[l])}function df(e={}){const t=Yr(e);return nN(n=>m_(t,{onChange:n}),()=>Q8(t))}function rN(e,t){return p2(e,t)}function iN(e){return JSON.stringify(e,(t,n)=>aN(n)?Object.keys(n).sort().reduce((i,s)=>(i[s]=n[s],i),{}):typeof n=="bigint"?n.toString():n)}function aN(e){if(!o3(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!o3(n)||!n.hasOwnProperty("isPrototypeOf"))}function o3(e){return Object.prototype.toString.call(e)==="[object Object]"}function ug(e){const{_defaulted:t,behavior:n,gcTime:i,initialData:s,initialDataUpdatedAt:l,maxPages:c,meta:f,networkMode:d,queryFn:h,queryHash:m,queryKey:w,queryKeyHashFn:x,retry:S,retryDelay:O,structuralSharing:T,getPreviousPageParam:R,getNextPageParam:k,initialPageParam:F,_optimisticResults:U,enabled:j,notifyOnChangeProps:z,placeholderData:H,refetchInterval:V,refetchIntervalInBackground:K,refetchOnMount:Q,refetchOnReconnect:le,refetchOnWindowFocus:ue,retryOnMount:ae,select:me,staleTime:ce,suspense:W,throwOnError:L,config:te,connector:ge,query:pe,...P}=e;return P}function sN(e){return{mutationFn(t){return e_(e,t)},mutationKey:["connect"]}}function oN(e){return{mutationFn(t){return c_(e,t)},mutationKey:["disconnect"]}}function lN(e,t={}){return{async queryFn({queryKey:n}){const{address:i,scopeKey:s,...l}=n[1];if(!i)throw new Error("address is required");return await d_(e,{...l,address:i})??null},queryKey:cN(t)}}function cN(e={}){return["balance",ug(e)]}function uN(e,t={}){return{async queryFn({queryKey:n}){const i=t.abi;if(!i)throw new Error("abi is required");const{functionName:s,scopeKey:l,...c}=n[1],f=(()=>{const d=n[1];if(d.address)return{address:d.address};if(d.code)return{code:d.code};throw new Error("address or code is required")})();if(!s)throw new Error("functionName is required");return j8(e,{abi:i,functionName:s,args:c.args,...f,...c})},queryKey:fN(t)}}function fN(e={}){const{abi:t,...n}=e;return["readContract",ug(n)]}function dN(e){return{mutationFn(t){return y_(e,t)},mutationKey:["sendTransaction"]}}function hN(e){return{mutationFn(t){return g_(e,t)},mutationKey:["signMessage"]}}function yN(e){return{mutationFn(t){return b_(e,t)},mutationKey:["switchChain"]}}function fg(e){const t=o1({...e,queryKeyHashFn:iN});return t.queryKey=e.queryKey,t}function K8(e={}){const t=Yr(e);return J.useSyncExternalStore(n=>v_(t,{onChange:n}),()=>K6(t),()=>K6(t))}function gN(e={}){const{address:t,query:n={}}=e,i=Yr(e),s=K8({config:i}),l=lN(i,{...e,chainId:e.chainId??s}),c=!!(t&&(n.enabled??!0));return fg({...n,...l,enabled:c})}function pN(e={}){const t=Yr(e);return J.useSyncExternalStore(n=>K_(t,{onChange:n}),()=>q6(t),()=>q6(t))}function bN(e={}){const t=Yr(e);return J.useSyncExternalStore(n=>A_(t,{onChange:n}),()=>J6(t),()=>J6(t))}function q8(e={}){const{mutation:t}=e,n=Yr(e),i=sN(n),{mutate:s,mutateAsync:l,...c}=Jd({...t,...i});return J.useEffect(()=>n.subscribe(({status:f})=>f,(f,d)=>{d==="connected"&&f==="disconnected"&&c.reset()}),[n,c.reset]),{...c,connect:s,connectAsync:l,connectors:bN({config:n})}}function mN(e={}){const t=Yr(e);return J.useSyncExternalStore(n=>w_(t,{onChange:n}),()=>Mm(t),()=>Mm(t))}function vN(e={}){const{mutation:t}=e,n=Yr(e),i=oN(n),{mutate:s,mutateAsync:l,...c}=Jd({...t,...i});return{...c,connectors:mN({config:n}).map(f=>f.connector),disconnect:s,disconnectAsync:l}}function wN(e={}){const{abi:t,address:n,functionName:i,query:s={}}=e,l=e.code,c=Yr(e),f=K8({config:c}),d=uN(c,{...e,chainId:e.chainId??f}),h=!!((n||l)&&t&&i&&(s.enabled??!0));return fg({...s,...d,enabled:h,structuralSharing:s.structuralSharing??rN})}function AN(e={}){const{mutation:t}=e,n=Yr(e),i=dN(n),{mutate:s,mutateAsync:l,...c}=Jd({...t,...i});return{...c,sendTransaction:s,sendTransactionAsync:l}}function xN(e={}){const{mutation:t}=e,n=Yr(e),i=hN(n),{mutate:s,mutateAsync:l,...c}=Jd({...t,...i});return{...c,signMessage:s,signMessageAsync:l}}function EN(e={}){const{mutation:t}=e,n=Yr(e),i=yN(n),{mutate:s,mutateAsync:l,...c}=Jd({...t,...i});return{...c,chains:pN({config:n}),switchChain:s,switchChainAsync:l}}const CN="https://api.developer.coinbase.com/analytics",SN="0.37.5",TN="POST",Ay={"Content-Type":"application/json","OnchainKit-Version":SN},l3="OnchainKit-Context",ON="2.0";let Al=function(e){return e.API="api",e.Buy="buy",e.Checkout="checkout",e.Hook="hook",e.NFT="nft",e.Swap="swap",e.Wallet="wallet",e}({});function c3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function u3(e){for(var t=1;t{try{await fetch(e.url,{method:"POST",headers:u3(u3({},Ay),e.headers),body:JSON.stringify(e.body)})}catch{}},DN=(e,t)=>{const n=A0("config");return{url:(n==null?void 0:n.analyticsUrl)??CN,headers:{"OnchainKit-App-Name":document.title},body:{apiKey:A0("apiKey")??"undefined",sessionId:A0("sessionId")??"undefined",timestamp:Date.now(),eventType:e,data:t,origin:window.location.origin}}};function J8(e,t){const n=A0("config");if(!(n!=null&&n.analytics))return;const i=DN(e,t);NN(i)}const dg=()=>J.useMemo(()=>({sendAnalytics:J8}),[]);let Jp=function(e){return e.ConnectError="walletConnectError",e.ConnectInitiated="walletConnectInitiated",e.ConnectSuccess="walletConnectSuccess",e.Disconnect="walletDisconnect",e.OptionSelected="walletOptionSelected",e.ConnectCanceled="walletConnectCanceled",e}({}),E0=function(e){return e.SlippageChanged="swapSlippageChanged",e.TokenSelected="swapTokenSelected",e.SwapSuccess="swapSuccess",e.SwapInitiated="swapInitiated",e.SwapFailure="swapFailure",e.SwapCanceled="swapCanceled",e}({}),BN=function(e){return e.ComponentError="componentError",e}({});class f3 extends J.Component{constructor(...t){super(...t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){console.error("Uncaught error:",t,n),J8(BN.ComponentError,{component:"OnchainKitProviderBoundary",error:t.message,metadata:{message:t.message,stack:n.componentStack}})}render(){if(this.state.error){if(this.props.fallback){const t=this.props.fallback;return D.jsx(t,{error:this.state.error})}return D.jsx("h1",{children:"Sorry, we had an unhandled error"})}return this.props.children}}let IN=function(e){return e.AtomicBatch="atomicBatch",e.AuxiliaryFunds="auxiliaryFunds",e.PaymasterService="paymasterService",e}({});const kN="https://base.org/privacy-policy",PN="https://base.org/terms-of-service";p1.type="coinbaseWallet";function p1(e={}){return e.version==="3"||e.headlessMode?UN(e):LN(e)}function LN(e){let t,n,i,s;return l=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",rdns:"com.coinbase.wallet",type:p1.type,async connect({chainId:c,...f}={}){try{const d=await this.getProvider(),h=(await d.request({method:"eth_requestAccounts",params:"instantOnboarding"in f&&f.instantOnboarding?[{onboarding:"instant"}]:[]})).map(w=>ii(w));n||(n=this.onAccountsChanged.bind(this),d.on("accountsChanged",n)),i||(i=this.onChainChanged.bind(this),d.on("chainChanged",i)),s||(s=this.onDisconnect.bind(this),d.on("disconnect",s));let m=await this.getChainId();if(c&&m!==c){const w=await this.switchChain({chainId:c}).catch(x=>{if(x.code===Wt.code)throw x;return{id:m}});m=(w==null?void 0:w.id)??m}return{accounts:h,chainId:m}}catch(d){throw/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(d.message)?new Wt(d):d}},async disconnect(){var f;const c=await this.getProvider();n&&(c.removeListener("accountsChanged",n),n=void 0),i&&(c.removeListener("chainChanged",i),i=void 0),s&&(c.removeListener("disconnect",s),s=void 0),c.disconnect(),(f=c.close)==null||f.call(c)},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(f=>ii(f))},async getChainId(){const f=await(await this.getProvider()).request({method:"eth_chainId"});return Number(f)},async getProvider(){if(!t){const c=(()=>{var h;return typeof e.preference=="string"?{options:e.preference}:{...e.preference,options:((h=e.preference)==null?void 0:h.options)??"all"}})(),{createCoinbaseWalletSDK:f}=await l1(async()=>{const{createCoinbaseWalletSDK:h}=await import("./index-BB3bVYbY.js");return{createCoinbaseWalletSDK:h}},__vite__mapDeps([0,1]));t=f({...e,appChainIds:l.chains.map(h=>h.id),preference:c}).getProvider()}return t},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:c,chainId:f}){var m,w,x,S;const d=l.chains.find(O=>O.id===f);if(!d)throw new Vi(new lf);const h=await this.getProvider();try{return await h.request({method:"wallet_switchEthereumChain",params:[{chainId:Ze(d.id)}]}),d}catch(O){if(O.code===4902)try{let T;c!=null&&c.blockExplorerUrls?T=c.blockExplorerUrls:T=(m=d.blockExplorers)!=null&&m.default.url?[(w=d.blockExplorers)==null?void 0:w.default.url]:[];let R;(x=c==null?void 0:c.rpcUrls)!=null&&x.length?R=c.rpcUrls:R=[((S=d.rpcUrls.default)==null?void 0:S.http[0])??""];const k={blockExplorerUrls:T,chainId:Ze(f),chainName:(c==null?void 0:c.chainName)??d.name,iconUrls:c==null?void 0:c.iconUrls,nativeCurrency:(c==null?void 0:c.nativeCurrency)??d.nativeCurrency,rpcUrls:R};return await h.request({method:"wallet_addEthereumChain",params:[k]}),d}catch(T){throw new Wt(T)}throw new Vi(O)}},onAccountsChanged(c){c.length===0?this.onDisconnect():l.emitter.emit("change",{accounts:c.map(f=>ii(f))})},onChainChanged(c){const f=Number(c);l.emitter.emit("change",{chainId:f})},async onDisconnect(c){l.emitter.emit("disconnect");const f=await this.getProvider();n&&(f.removeListener("accountsChanged",n),n=void 0),i&&(f.removeListener("chainChanged",i),i=void 0),s&&(f.removeListener("disconnect",s),s=void 0)}})}function UN(e){let n,i,s,l,c;return f=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",type:p1.type,async connect({chainId:d}={}){try{const h=await this.getProvider(),m=(await h.request({method:"eth_requestAccounts"})).map(x=>ii(x));s||(s=this.onAccountsChanged.bind(this),h.on("accountsChanged",s)),l||(l=this.onChainChanged.bind(this),h.on("chainChanged",l)),c||(c=this.onDisconnect.bind(this),h.on("disconnect",c));let w=await this.getChainId();if(d&&w!==d){const x=await this.switchChain({chainId:d}).catch(S=>{if(S.code===Wt.code)throw S;return{id:w}});w=(x==null?void 0:x.id)??w}return{accounts:m,chainId:w}}catch(h){throw/(user closed modal|accounts received is empty|user denied account)/i.test(h.message)?new Wt(h):h}},async disconnect(){const d=await this.getProvider();s&&(d.removeListener("accountsChanged",s),s=void 0),l&&(d.removeListener("chainChanged",l),l=void 0),c&&(d.removeListener("disconnect",c),c=void 0),d.disconnect(),d.close()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(h=>ii(h))},async getChainId(){const h=await(await this.getProvider()).request({method:"eth_chainId"});return Number(h)},async getProvider(){var d;if(!i){const h=await(async()=>{const{default:O}=await l1(async()=>{const{default:T}=await import("./index-BSvUHPor.js").then(R=>R.i);return{default:T}},__vite__mapDeps([2,1,3]));return typeof O!="function"&&typeof O.default=="function"?O.default:O})();n=new h({...e,reloadOnDisconnect:!1});const m=(d=n.walletExtension)==null?void 0:d.getChainId(),w=f.chains.find(O=>e.chainId?O.id===e.chainId:O.id===m)||f.chains[0],x=e.chainId||(w==null?void 0:w.id),S=e.jsonRpcUrl||(w==null?void 0:w.rpcUrls.default.http[0]);i=n.makeWeb3Provider(S,x)}return i},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:d,chainId:h}){var x,S,O,T;const m=f.chains.find(R=>R.id===h);if(!m)throw new Vi(new lf);const w=await this.getProvider();try{return await w.request({method:"wallet_switchEthereumChain",params:[{chainId:Ze(m.id)}]}),m}catch(R){if(R.code===4902)try{let k;d!=null&&d.blockExplorerUrls?k=d.blockExplorerUrls:k=(x=m.blockExplorers)!=null&&x.default.url?[(S=m.blockExplorers)==null?void 0:S.default.url]:[];let F;(O=d==null?void 0:d.rpcUrls)!=null&&O.length?F=d.rpcUrls:F=[((T=m.rpcUrls.default)==null?void 0:T.http[0])??""];const U={blockExplorerUrls:k,chainId:Ze(h),chainName:(d==null?void 0:d.chainName)??m.name,iconUrls:d==null?void 0:d.iconUrls,nativeCurrency:(d==null?void 0:d.nativeCurrency)??m.nativeCurrency,rpcUrls:F};return await w.request({method:"wallet_addEthereumChain",params:[U]}),m}catch(k){throw new Wt(k)}throw new Vi(R)}},onAccountsChanged(d){d.length===0?this.onDisconnect():f.emitter.emit("change",{accounts:d.map(h=>ii(h))})},onChainChanged(d){const h=Number(d);f.emitter.emit("change",{chainId:h})},async onDisconnect(d){f.emitter.emit("disconnect");const h=await this.getProvider();s&&(h.removeListener("accountsChanged",s),s=void 0),l&&(h.removeListener("chainChanged",l),l=void 0),c&&(h.removeListener("disconnect",c),c=void 0)}})}K2.type="metaMask";function K2(e={}){let t,n,i,s,l,c,f,d;return h=>({id:"metaMaskSDK",name:"MetaMask",rdns:["io.metamask","io.metamask.mobile"],type:K2.type,async setup(){const m=await this.getProvider();m!=null&&m.on&&(c||(c=this.onConnect.bind(this),m.on("connect",c)),s||(s=this.onAccountsChanged.bind(this),m.on("accountsChanged",s)))},async connect({chainId:m,isReconnecting:w}={}){const x=await this.getProvider();f||(f=this.onDisplayUri,x.on("display_uri",f));let S=[];w&&(S=await this.getAccounts().catch(()=>[]));try{let O,T;S!=null&&S.length||(e.connectAndSign||e.connectWith?(e.connectAndSign?O=await t.connectAndSign({msg:e.connectAndSign}):e.connectWith&&(T=await t.connectWith({method:e.connectWith.method,params:e.connectWith.params})),S=await this.getAccounts()):S=(await t.connect()).map(F=>ii(F)));let R=await this.getChainId();if(m&&R!==m){const k=await this.switchChain({chainId:m}).catch(F=>{if(F.code===Wt.code)throw F;return{id:R}});R=(k==null?void 0:k.id)??R}return f&&(x.removeListener("display_uri",f),f=void 0),O?x.emit("connectAndSign",{accounts:S,chainId:R,signResponse:O}):T&&x.emit("connectWith",{accounts:S,chainId:R,connectWithResponse:T}),c&&(x.removeListener("connect",c),c=void 0),s||(s=this.onAccountsChanged.bind(this),x.on("accountsChanged",s)),l||(l=this.onChainChanged.bind(this),x.on("chainChanged",l)),d||(d=this.onDisconnect.bind(this),x.on("disconnect",d)),{accounts:S,chainId:R}}catch(O){const T=O;throw T.code===Wt.code?new Wt(T):T.code===oo.code?new oo(T):T}},async disconnect(){const m=await this.getProvider();l&&(m.removeListener("chainChanged",l),l=void 0),d&&(m.removeListener("disconnect",d),d=void 0),c||(c=this.onConnect.bind(this),m.on("connect",c)),await t.terminate()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(x=>ii(x))},async getChainId(){const m=await this.getProvider(),w=m.getChainId()||await(m==null?void 0:m.request({method:"eth_chainId"}));return Number(w)},async getProvider(){async function m(){var T,R,k,F,U;const w=await(async()=>{const{default:j}=await l1(async()=>{const{default:z}=await import("./metamask-sdk-DfnqKdXK.js");return{default:z}},__vite__mapDeps([4,3]));return typeof j!="function"&&typeof j.default=="function"?j.default:j})(),x={};for(const j of h.chains)x[Ze(j.id)]=(T=j_({chain:j,transports:h.transports}))==null?void 0:T[0];t=new w({_source:"wagmi",forceDeleteProvider:!1,forceInjectProvider:!1,injectProvider:!1,...e,readonlyRPCMap:x,dappMetadata:{...e.dappMetadata,name:(R=e.dappMetadata)!=null&&R.name?(k=e.dappMetadata)==null?void 0:k.name:"wagmi",url:(F=e.dappMetadata)!=null&&F.url?(U=e.dappMetadata)==null?void 0:U.url:typeof window<"u"?window.location.origin:"https://wagmi.sh"},useDeeplink:e.useDeeplink??!0});const S=await t.init(),O=S!=null&&S.activeProvider?S.activeProvider:t.getProvider();if(!O)throw new ku;return O}return n||(i||(i=m()),n=await i),n},async isAuthorized(){try{return!!(await Fd(()=>V2(()=>this.getAccounts(),{timeout:200}),{delay:201,retryCount:3})).length}catch{return!1}},async switchChain({addEthereumChainParameter:m,chainId:w}){var R,k;const x=await this.getProvider(),S=h.chains.find(F=>F.id===w);if(!S)throw new Vi(new lf);try{return await x.request({method:"wallet_switchEthereumChain",params:[{chainId:Ze(w)}]}),await O(),await T(w),S}catch(F){const U=F;if(U.code===Wt.code)throw new Wt(U);if(U.code===4902||((k=(R=U==null?void 0:U.data)==null?void 0:R.originalError)==null?void 0:k.code)===4902)try{return await x.request({method:"wallet_addEthereumChain",params:[{blockExplorerUrls:(()=>{const{default:j,...z}=S.blockExplorers??{};if(m!=null&&m.blockExplorerUrls)return m.blockExplorerUrls;if(j)return[j.url,...Object.values(z).map(H=>H.url)]})(),chainId:Ze(w),chainName:(m==null?void 0:m.chainName)??S.name,iconUrls:m==null?void 0:m.iconUrls,nativeCurrency:(m==null?void 0:m.nativeCurrency)??S.nativeCurrency,rpcUrls:(()=>{var j,z;return(j=m==null?void 0:m.rpcUrls)!=null&&j.length?m.rpcUrls:[((z=S.rpcUrls.default)==null?void 0:z.http[0])??""]})()}]}),await O(),await T(w),S}catch(j){const z=j;throw z.code===Wt.code?new Wt(z):new Vi(z)}throw new Vi(U)}async function O(){await Fd(async()=>{const F=ms(await x.request({method:"eth_chainId"}));if(F!==w)throw new Error("User rejected switch after adding network.");return F},{delay:50,retryCount:20})}async function T(F){await new Promise(U=>{const j=z=>{"chainId"in z&&z.chainId===F&&(h.emitter.off("change",j),U())};h.emitter.on("change",j),h.emitter.emit("change",{chainId:F})})}},async onAccountsChanged(m){if(m.length===0)if(t.isExtensionActive())this.onDisconnect();else return;else if(h.emitter.listenerCount("connect")){const w=(await this.getChainId()).toString();this.onConnect({chainId:w})}else h.emitter.emit("change",{accounts:m.map(w=>ii(w))})},onChainChanged(m){const w=Number(m);h.emitter.emit("change",{chainId:w})},async onConnect(m){const w=await this.getAccounts();if(w.length===0)return;const x=Number(m.chainId);h.emitter.emit("connect",{accounts:w,chainId:x});const S=await this.getProvider();c&&(S.removeListener("connect",c),c=void 0),s||(s=this.onAccountsChanged.bind(this),S.on("accountsChanged",s)),l||(l=this.onChainChanged.bind(this),S.on("chainChanged",l)),d||(d=this.onDisconnect.bind(this),S.on("disconnect",d))},async onDisconnect(m){const w=await this.getProvider();m&&m.code===1013&&w&&(await this.getAccounts()).length||(h.emitter.emit("disconnect"),l&&(w.removeListener("chainChanged",l),l=void 0),d&&(w.removeListener("disconnect",d),d=void 0),c||(c=this.onConnect.bind(this),w.on("connect",c)))},onDisplayUri(m){h.emitter.emit("message",{type:"display_uri",data:m})}})}const FN=({apiKey:e,appName:t,appLogoUrl:n})=>z_({chains:[Qn,vl],connectors:[p1({appName:t,appLogoUrl:n,preference:"all"})],storage:Y8({storage:G_}),ssr:!0,transports:{[Qn.id]:e?hd(`https://api.developer.coinbase.com/rpc/v1/base/${e}`):hd(),[vl.id]:e?hd(`https://api.developer.coinbase.com/rpc/v1/base-sepolia/${e}`):hd()}}),q2={[vl.id]:"0x6533C94869D28fAA8dF77cc63f9e2b2D6Cf77eBA",[Qn.id]:"0xC6d566A56A1aFf6508b41f6c90ff131615583BCD"},zN='',HN='',GN='',QN='',jN='',VN='',YN='',d3=[zN,HN,GN,QN,jN,VN,YN],ZN="0xf8b05c79f090979bf4a80270aba232dff11a10d9ca55c4f88de95317970f0de9";function XN(){let e=null,t=null;try{e=Yr()}catch(n){n instanceof W8||console.error("Error fetching WagmiProvider, using default:",n)}try{t=w2()}catch(n){n.message!=="No QueryClient set, use QueryClientProvider to set one"&&console.error("Error fetching QueryClient, using default:",n)}return J.useMemo(()=>({providedWagmiConfig:e,providedQueryClient:t}),[e,t])}function WN(e,t){return new RegExp(`^0x[a-fA-F0-9]{${t}}$`).test(e)}const Dm=J.createContext(Mc);function KN({address:e,analytics:t,apiKey:n,chain:i,children:s,config:l,projectId:c,rpcUrl:f,schemaId:d}){if(d&&!WN(d,64))throw Error('EAS schemaId must be 64 characters prefixed with "0x"');const h=J.useMemo(()=>crypto.randomUUID(),[]),m=J.useMemo(()=>{var F,U,j,z,H,V,K;const R=n?`https://api.developer.coinbase.com/rpc/v1/${i.name.replace(" ","-").toLowerCase()}/${n}`:null,k={address:e??null,apiKey:n??null,chain:i,config:{analytics:t??!0,analyticsUrl:(l==null?void 0:l.analyticsUrl)??null,appearance:{name:((F=l==null?void 0:l.appearance)==null?void 0:F.name)??"Dapp",logo:((U=l==null?void 0:l.appearance)==null?void 0:U.logo)??"",mode:((j=l==null?void 0:l.appearance)==null?void 0:j.mode)??"auto",theme:((z=l==null?void 0:l.appearance)==null?void 0:z.theme)??"default"},paymaster:(l==null?void 0:l.paymaster)||R,wallet:{display:((H=l==null?void 0:l.wallet)==null?void 0:H.display)??"classic",termsUrl:((V=l==null?void 0:l.wallet)==null?void 0:V.termsUrl)||PN,privacyUrl:((K=l==null?void 0:l.wallet)==null?void 0:K.privacyUrl)||kN}},projectId:c??null,rpcUrl:f??null,schemaId:d??ZN,sessionId:h};return XS(k),k},[e,t,n,i,l,c,f,d,h]),w=XN(),x=w.providedWagmiConfig,S=w.providedQueryClient,O=J.useMemo(()=>x||FN({apiKey:n,appName:m.config.appearance.name,appLogoUrl:m.config.appearance.logo}),[n,x,m.config.appearance.name,m.config.appearance.logo]),T=J.useMemo(()=>S||new cT,[S]);return!x&&!S?D.jsx(Y_,{config:O,children:D.jsx(yT,{client:T,children:D.jsx(Dm.Provider,{value:m,children:D.jsx(f3,{children:s})})})}):D.jsx(Dm.Provider,{value:m,children:D.jsx(f3,{children:s})})}function Vc(){return J.useContext(Dm)}async function $8({copyValue:e,onSuccess:t,onError:n}){try{await navigator.clipboard.writeText(e),t==null||t()}catch(i){n==null||n(i)}}function ex(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t{const t=eD(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:c=>{const f=c.split(J2);return f[0]===""&&f.length!==1&&f.shift(),tx(f,t)||$N(c)},getConflictingClassGroupIds:(c,f)=>{const d=n[c]||[];return f&&i[c]?[...d,...i[c]]:d}}},tx=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const n=e[0],i=t.nextPart.get(n),s=i?tx(e.slice(1),i):void 0;if(s)return s;if(t.validators.length===0)return;const l=e.join(J2);return(c=t.validators.find(({validator:f})=>f(l)))==null?void 0:c.classGroupId},h3=/^\[(.+)\]$/,$N=e=>{if(h3.test(e)){const t=h3.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},eD=e=>{const{theme:t,prefix:n}=e,i={nextPart:new Map,validators:[]};return nD(Object.entries(e.classGroups),n).forEach(([l,c])=>{Bm(c,i,l,t)}),i},Bm=(e,t,n,i)=>{e.forEach(s=>{if(typeof s=="string"){const l=s===""?t:y3(t,s);l.classGroupId=n;return}if(typeof s=="function"){if(tD(s)){Bm(s(i),t,n,i);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([l,c])=>{Bm(c,y3(t,l),n,i)})})},y3=(e,t)=>{let n=e;return t.split(J2).forEach(i=>{n.nextPart.has(i)||n.nextPart.set(i,{nextPart:new Map,validators:[]}),n=n.nextPart.get(i)}),n},tD=e=>e.isThemeGetter,nD=(e,t)=>t?e.map(([n,i])=>{const s=i.map(l=>typeof l=="string"?t+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([c,f])=>[t+c,f])):l);return[n,s]}):e,rD=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,i=new Map;const s=(l,c)=>{n.set(l,c),t++,t>e&&(t=0,i=n,n=new Map)};return{get(l){let c=n.get(l);if(c!==void 0)return c;if((c=i.get(l))!==void 0)return s(l,c),c},set(l,c){n.has(l)?n.set(l,c):s(l,c)}}},nx="!",iD=e=>{const{separator:t,experimentalParseClassName:n}=e,i=t.length===1,s=t[0],l=t.length,c=f=>{const d=[];let h=0,m=0,w;for(let R=0;Rm?w-m:void 0;return{modifiers:d,hasImportantModifier:S,baseClassName:O,maybePostfixModifierPosition:T}};return n?f=>n({className:f,parseClassName:c}):c},aD=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(i=>{i[0]==="["?(t.push(...n.sort(),i),n=[]):n.push(i)}),t.push(...n.sort()),t},sD=e=>({cache:rD(e.cacheSize),parseClassName:iD(e),...JN(e)}),oD=/\s+/,lD=(e,t)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:s}=t,l=[],c=e.trim().split(oD);let f="";for(let d=c.length-1;d>=0;d-=1){const h=c[d],{modifiers:m,hasImportantModifier:w,baseClassName:x,maybePostfixModifierPosition:S}=n(h);let O=!!S,T=i(O?x.substring(0,S):x);if(!T){if(!O){f=h+(f.length>0?" "+f:f);continue}if(T=i(x),!T){f=h+(f.length>0?" "+f:f);continue}O=!1}const R=aD(m).join(":"),k=w?R+nx:R,F=k+T;if(l.includes(F))continue;l.push(F);const U=s(T,O);for(let j=0;j0?" "+f:f)}return f};function cD(){let e=0,t,n,i="";for(;e{if(typeof e=="string")return e;let t,n="";for(let i=0;iw(m),e());return n=sD(h),i=n.cache.get,s=n.cache.set,l=f,f(d)}function f(d){const h=i(d);if(h)return h;const m=lD(d,n);return s(d,m),m}return function(){return l(cD.apply(null,arguments))}}const hn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},ix=/^\[(?:([a-z-]+):)?(.+)\]$/i,fD=/^\d+\/\d+$/,dD=new Set(["px","full","screen"]),hD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,yD=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,gD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,pD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,bD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ll=e=>bd(e)||dD.has(e)||fD.test(e),Cc=e=>$d(e,"length",SD),bd=e=>!!e&&!Number.isNaN(Number(e)),$p=e=>$d(e,"number",bd),u0=e=>!!e&&Number.isInteger(Number(e)),mD=e=>e.endsWith("%")&&bd(e.slice(0,-1)),pt=e=>ix.test(e),Sc=e=>hD.test(e),vD=new Set(["length","size","percentage"]),wD=e=>$d(e,vD,ax),AD=e=>$d(e,"position",ax),xD=new Set(["image","url"]),ED=e=>$d(e,xD,OD),CD=e=>$d(e,"",TD),f0=()=>!0,$d=(e,t,n)=>{const i=ix.exec(e);return i?i[1]?typeof t=="string"?i[1]===t:t.has(i[1]):n(i[2]):!1},SD=e=>yD.test(e)&&!gD.test(e),ax=()=>!1,TD=e=>pD.test(e),OD=e=>bD.test(e),RD=()=>{const e=hn("colors"),t=hn("spacing"),n=hn("blur"),i=hn("brightness"),s=hn("borderColor"),l=hn("borderRadius"),c=hn("borderSpacing"),f=hn("borderWidth"),d=hn("contrast"),h=hn("grayscale"),m=hn("hueRotate"),w=hn("invert"),x=hn("gap"),S=hn("gradientColorStops"),O=hn("gradientColorStopPositions"),T=hn("inset"),R=hn("margin"),k=hn("opacity"),F=hn("padding"),U=hn("saturate"),j=hn("scale"),z=hn("sepia"),H=hn("skew"),V=hn("space"),K=hn("translate"),Q=()=>["auto","contain","none"],le=()=>["auto","hidden","clip","visible","scroll"],ue=()=>["auto",pt,t],ae=()=>[pt,t],me=()=>["",ll,Cc],ce=()=>["auto",bd,pt],W=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],L=()=>["solid","dashed","dotted","double","none"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ge=()=>["start","end","center","between","around","evenly","stretch"],pe=()=>["","0",pt],P=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Z=()=>[bd,pt];return{cacheSize:500,separator:":",theme:{colors:[f0],spacing:[ll,Cc],blur:["none","",Sc,pt],brightness:Z(),borderColor:[e],borderRadius:["none","","full",Sc,pt],borderSpacing:ae(),borderWidth:me(),contrast:Z(),grayscale:pe(),hueRotate:Z(),invert:pe(),gap:ae(),gradientColorStops:[e],gradientColorStopPositions:[mD,Cc],inset:ue(),margin:ue(),opacity:Z(),padding:ae(),saturate:Z(),scale:Z(),sepia:pe(),skew:Z(),space:ae(),translate:ae()},classGroups:{aspect:[{aspect:["auto","square","video",pt]}],container:["container"],columns:[{columns:[Sc]}],"break-after":[{"break-after":P()}],"break-before":[{"break-before":P()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...W(),pt]}],overflow:[{overflow:le()}],"overflow-x":[{"overflow-x":le()}],"overflow-y":[{"overflow-y":le()}],overscroll:[{overscroll:Q()}],"overscroll-x":[{"overscroll-x":Q()}],"overscroll-y":[{"overscroll-y":Q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[T]}],"inset-x":[{"inset-x":[T]}],"inset-y":[{"inset-y":[T]}],start:[{start:[T]}],end:[{end:[T]}],top:[{top:[T]}],right:[{right:[T]}],bottom:[{bottom:[T]}],left:[{left:[T]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",u0,pt]}],basis:[{basis:ue()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",pt]}],grow:[{grow:pe()}],shrink:[{shrink:pe()}],order:[{order:["first","last","none",u0,pt]}],"grid-cols":[{"grid-cols":[f0]}],"col-start-end":[{col:["auto",{span:["full",u0,pt]},pt]}],"col-start":[{"col-start":ce()}],"col-end":[{"col-end":ce()}],"grid-rows":[{"grid-rows":[f0]}],"row-start-end":[{row:["auto",{span:[u0,pt]},pt]}],"row-start":[{"row-start":ce()}],"row-end":[{"row-end":ce()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",pt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",pt]}],gap:[{gap:[x]}],"gap-x":[{"gap-x":[x]}],"gap-y":[{"gap-y":[x]}],"justify-content":[{justify:["normal",...ge()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ge(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ge(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[F]}],px:[{px:[F]}],py:[{py:[F]}],ps:[{ps:[F]}],pe:[{pe:[F]}],pt:[{pt:[F]}],pr:[{pr:[F]}],pb:[{pb:[F]}],pl:[{pl:[F]}],m:[{m:[R]}],mx:[{mx:[R]}],my:[{my:[R]}],ms:[{ms:[R]}],me:[{me:[R]}],mt:[{mt:[R]}],mr:[{mr:[R]}],mb:[{mb:[R]}],ml:[{ml:[R]}],"space-x":[{"space-x":[V]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[V]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",pt,t]}],"min-w":[{"min-w":[pt,t,"min","max","fit"]}],"max-w":[{"max-w":[pt,t,"none","full","min","max","fit","prose",{screen:[Sc]},Sc]}],h:[{h:[pt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[pt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[pt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[pt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Sc,Cc]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",$p]}],"font-family":[{font:[f0]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",pt]}],"line-clamp":[{"line-clamp":["none",bd,$p]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ll,pt]}],"list-image":[{"list-image":["none",pt]}],"list-style-type":[{list:["none","disc","decimal",pt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[k]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[k]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...L(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ll,Cc]}],"underline-offset":[{"underline-offset":["auto",ll,pt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ae()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",pt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[k]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...W(),AD]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",wD]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ED]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[O]}],"gradient-via-pos":[{via:[O]}],"gradient-to-pos":[{to:[O]}],"gradient-from":[{from:[S]}],"gradient-via":[{via:[S]}],"gradient-to":[{to:[S]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[f]}],"border-w-x":[{"border-x":[f]}],"border-w-y":[{"border-y":[f]}],"border-w-s":[{"border-s":[f]}],"border-w-e":[{"border-e":[f]}],"border-w-t":[{"border-t":[f]}],"border-w-r":[{"border-r":[f]}],"border-w-b":[{"border-b":[f]}],"border-w-l":[{"border-l":[f]}],"border-opacity":[{"border-opacity":[k]}],"border-style":[{border:[...L(),"hidden"]}],"divide-x":[{"divide-x":[f]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[f]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[k]}],"divide-style":[{divide:L()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...L()]}],"outline-offset":[{"outline-offset":[ll,pt]}],"outline-w":[{outline:[ll,Cc]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:me()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[ll,Cc]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Sc,CD]}],"shadow-color":[{shadow:[f0]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[...te(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":te()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[i]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",Sc,pt]}],grayscale:[{grayscale:[h]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[w]}],saturate:[{saturate:[U]}],sepia:[{sepia:[z]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[i]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[h]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[w]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[U]}],"backdrop-sepia":[{"backdrop-sepia":[z]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",pt]}],duration:[{duration:Z()}],ease:[{ease:["linear","in","out","in-out",pt]}],delay:[{delay:Z()}],animate:[{animate:["none","spin","ping","pulse","bounce",pt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[u0,pt]}],"translate-x":[{"translate-x":[K]}],"translate-y":[{"translate-y":[K]}],"skew-x":[{"skew-x":[H]}],"skew-y":[{"skew-y":[H]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",pt]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",pt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ae()}],"scroll-mx":[{"scroll-mx":ae()}],"scroll-my":[{"scroll-my":ae()}],"scroll-ms":[{"scroll-ms":ae()}],"scroll-me":[{"scroll-me":ae()}],"scroll-mt":[{"scroll-mt":ae()}],"scroll-mr":[{"scroll-mr":ae()}],"scroll-mb":[{"scroll-mb":ae()}],"scroll-ml":[{"scroll-ml":ae()}],"scroll-p":[{"scroll-p":ae()}],"scroll-px":[{"scroll-px":ae()}],"scroll-py":[{"scroll-py":ae()}],"scroll-ps":[{"scroll-ps":ae()}],"scroll-pe":[{"scroll-pe":ae()}],"scroll-pt":[{"scroll-pt":ae()}],"scroll-pr":[{"scroll-pr":ae()}],"scroll-pb":[{"scroll-pb":ae()}],"scroll-pl":[{"scroll-pl":ae()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",pt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ll,Cc,$p]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},MD=uD(RD);function Oe(...e){return MD(qN(e))}const dt={body:"ock-font-family font-normal text-base",headline:"ock-font-family font-semibold",label1:"ock-font-family font-semibold text-sm",label2:"ock-font-family text-sm",legal:"ock-font-family text-xs",title3:"ock-font-family font-semibold text-xl"},Ut={default:"cursor-pointer ock-bg-default active:bg-[var(--ock-bg-default-active)] hover:bg-[var(--ock-bg-default-hover)]",alternate:"cursor-pointer ock-bg-alternate active:bg-[var(--ock-bg-alternate-active)] hover:bg-[var(--ock-bg-alternate-hover)]",inverse:"cursor-pointer ock-bg-inverse active:bg-[var(--ock-bg-inverse-active)] hover:bg-[var(--ock-bg-inverse-hover)]",primary:"cursor-pointer ock-bg-primary active:bg-[var(--ock-bg-primary-active)] hover:bg-[var(--ock-bg-primary-hover)]",secondary:"cursor-pointer ock-bg-secondary active:bg-[var(--ock-bg-secondary-active)] hover:bg-[var(--ock-bg-secondary-hover)]",shadow:"ock-shadow-default",disabled:"opacity-[0.38] pointer-events-none"},tn={default:"ock-bg-default",alternate:"ock-bg-alternate",inverse:"ock-bg-inverse",primary:"ock-bg-primary",secondary:"ock-bg-secondary"},at={inverse:"ock-text-inverse",foreground:"ock-text-foreground",foregroundMuted:"ock-text-foreground-muted",error:"ock-text-error",primary:"ock-text-primary"},ot={default:"ock-border-default",defaultActive:"ock-border-default-active",lineDefault:"ock-border-line-default border",radius:"ock-border-radius",radiusInner:"ock-border-radius-inner"},ln={foreground:"ock-icon-color-foreground",inverse:"ock-icon-color-inverse"},sx=e=>`${e.slice(0,6)}...${e.slice(-4)}`;function xl(e){return J.useMemo(()=>e,[e])}const _D={},ox=J.createContext(_D);function eh(){return J.useContext(ox)}function lx(e){const t=Vc(),n=t.chain,i=e.chain??n,s=xl({address:e.address||"",chain:i,schemaId:e.schemaId});return D.jsx(ox.Provider,{value:s,children:e.children})}function ND(e,t){return kD(e)||ID(e,t)||BD(e,t)||DD()}function DD(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BD(e,t){if(e){if(typeof e=="string")return g3(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g3(e,t):void 0}}function g3(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n{await $8({copyValue:m,onSuccess:()=>{f("Copied"),setTimeout(()=>f("Copy"),2e3)},onError:O=>{console.error("Failed to copy address:",O),f("Failed to copy"),setTimeout(()=>f("Copy"),2e3)}})},S=O=>{(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),x())};return D.jsxs("span",{"data-testid":"ockAddress",className:Oe(at.foregroundMuted,dt.label2,t,"group relative cursor-pointer"),onClick:x,onKeyDown:S,tabIndex:0,role:"button","aria-label":`Copy address ${m}`,children:[w,D.jsx("button",{type:"button",className:Oe(Ut.alternate,dt.legal,at.foreground,ot.default,ot.radius,"absolute top-full left-[0%] z-10 mt-0.5 px-1.5 py-0.5 opacity-0 transition-opacity group-hover:opacity-100"),"aria-live":"polite",children:c})]})}function Q0(e){return H8({chain:e,transport:hd()})}var PD="AEkU4AngDVgB0QKRAQYBOwDqATEAnwDbAIUApABsAOAAbwCRAEYAiQBPAHYAPgA+ACsANwAlAGMAHwAvACsAJQAWAC8AGwAiACIALwAUACsAEQAiAAsAGwARABcAGAA6ACkALAAsADUAFgAsABEAHQAhAA8AGwAdABUAFgAZAA0ADQAXABAAGQAUABIEqgYJAR4UFjfDBdMAsQCuPwFnAKUBA10jAK5/Ly8vLwE/pwUJ6/0HPwbkMQVXBVgAPSs5APa2EQbIwQuUCkEDyJ4zAsUKLwKOoQKG2D+Ob4kCxcsCg/IBH98JAPKtAUECLY0KP48A4wDiChUAF9S5yAwLPZ0EG3cA/QI5GL0P6wkGKekFBIFnDRsHLQCrAGmR76WcfwBbBpMjBukAGwA7DJMAWxVbqfu75wzbIM8IuykDsRQ7APcta6MAoX0YABcEJdcWAR0AuRnNBPoJIEw3CZcJiB4bVllM44NCABMADAAVAA5rVAAhAA4AR+4V2D3zOVjKleYuChAdX01YPewAEwAMABUADmsgXECXAMPrABsAOQzFABsVW6n7Adq4HB0FWwXiAtCfAsSwCkwcpGUUcxptTPUAuw1nAuEACy00iRfJkQKBewETGwC9DWcC4QALLQFIUCWRTAoDLfsFMgnXaRetAddDAEkrEncCMRYhAusnuTdrADnhAfUlAMcOy7UBG2OBALEFAAUAitNJBRvDHwcXAKgn0QGhKy0DmwBnAQoZPu03dAQYFwCqAccCIQDTKxJzOvNQsAWQOncnNUgF+icFWQVYr7gFaTtdQhI6WEGXe5NmX6H4CxMDxQcl8XcjBKNLAlNTAnUbqycBj6OlNVsDRRcEg2EJANEGqz8vIwcpAjldAGsBYR9xAIMdGQCVAUm3ACdpFwGvxQM3LSFDUwFvWQZlAmUA8UkXAykBBQBJQQCrAF0AcwArtQYH8+8ZjX8ACSEAKQCzG0cB0QHbBwsxl3iB6AAKABEANAA9ADgzd3nTwBBfEFwBTQlMbDoVCwKsD6YL5REVDNEqy9PYADSpB+sDUwfrA1MDUwfrB+sDUwfrA1MDUwNTA1McCvAa08AQXw9IBG0FjgWLBNYIgyZJEYEHKAjSVA10HhxHA0UA/CMlSRw7kzMLJUJMDE0DB/w2QmynfTgDRzGrVPWQogPLMk85bAEecRKgACoPcxw1tU5+ekdxoApLT661f0liTmcCvjqoP/gKIQmTb7t3TgY9EBcnoRDzDC8BsQE3DelL1ATtBjcExR95GRUPyZWYCKEt2QzpJt8unYBWI/EqfwXpS/A82QtJUWQPVQthCd86X4FKAx0BCSKHCtkNNQhpEO8KxWcN4RFBBzUD0UmWAKEG/QsNHTEVsSYMYqgLBTlzBvca8guLJqsTJXr4Bc8aHQZJASUa+wDLLuOFrFotXBhPWwX/CyEjwxSkUBwNIUCzeEQaFwcRJaUCjUNsSoNRMh6PIfI8OQ1iLg9ReAfxPAEZSwt9PJpGp0UKEc4+iT1EIkVMKAQxeywrJ4cJyw+BDLV8bgFVCR0JrQxtEy0REzfBCDUHFSmXICcRCB1GkWCWBPObA+8TzQMHBTsJPQcPA7EcKRMqFSUFCYEg0wLvNtEurwKLVnwBEwXHDyEf2xBMR9wO5QiXAmEDfyXnACkVHQATIpcIP18AW4/UUwEuxwjDamgjcANjFONdEW8HjQ5TB6McLxW7HN1wxF4HhgQon6sJVwFxCZUBWwTfCAU1V4ycID1nT4tUGJcgXUE7XfgCLQxhFZtEuYd0AocPZxIXATEBbwc1DP0CcxHpEWcQkQjnhgA1sTP0OiEESyF/IA0KIwNLbMoLIyb1DPRlAZ8SXgMINDl36menYLIgF/kHFTLBQVwh7QuOT8kMmBq9GD5UKhngB7sD7xrvJ+ZBUwX7A58POkkz6gS5C2UIhwk7AEUOnxMH0xhmCm2MzAEthwGzlQNTjX8Ca4sGMwcHAGMHgwV14QAZAqMInwABAMsDUwA1AqkHmQAVAIE9ATkDIysBHeECiwOPCC3HAZErAe8lBBe/DBEA8zNuRgLDrQKAZmaeBdlUAooCRTEBSSEEAUpDTQOrbd0A1wBHBg/bQwERp0bHFt8/AdtrJwDDAPcAATEHAT0ByQHvaQCzAVsLLQmer7EBSeUlAH8AEWcB0wKFANkAMQB77QFPAEkFVfUFzwJLRQENLRQnU10BtwMbAS8BCQB1BseJocUDGwRpB88CEBcV3QLvKgexAyLbE8lCwQK92lEAMhIKNAq1CrQfX/NcLwItbj1MAAofpD7DP0oFTTtPO1Q7TztUO087VDtPO1Q7TztUA5O73rveCmhfQWHnDKIN0ETEOkUT12BNYC4TxC2zFL0VyiVSGTkauCcBJeBVBQ8ALc9mLAgoNHEXuAA7KWSDPWOCHiwKRxzjU41U9C0XAK1LnjOrDagbEUQ8BUN16WImFgoKHgJkfQJiPldJq1c3HAKh8wJolAJmBQKfgDgXBwJmNwJmIgRqBHsDfw8Dfo45AjlzEzl+Oh8fAmwZAjIyOAYCbcMCbarrhi9jQScBYwDaAN0ARgEHlAyJAPoHvgAJsQJ3KwJ2njsCeUc/Ani2GVjXRapG0wJ8OwJ6xAJ9BQJ87AVVBRxH/Eh5XyAAJxFJVEpXERNKyALQ/QLQyEsjA4hLA4fiRMGRLgLynVz/AwOqS8pMKSHLTUhNqwKLOwKK1L0XAxk/YwGzAo4zAo5YPJN9Ao7VAo5YdFGwUzEGUtBUgQKT9wKTCADlABhVGlWrVcwCLBcpkYIy3XhiRTc1ApebAu+uWB2kAFUhApaLApZ4mAClWahaBX1JADcClrEClkpcQFzNApnHAplgXMZdAxUCnJc5vjqZApwSAp+XAp60hgAZCy0mCwKd7QKejgCxOWEwYesCns8CoGoBpQKemxsCnkqhY8RkIyEnAierAiZ6AqD3AqBIAqLZAqHAAqYrAqXKAqf7AHkCp+5oeGit/0VqGGrNAqzfAqyqAq1jAqz+AlcZAlXYArHd0wMfSmyTArK5CQKy5BNs3G1fbURbAyXJArZYNztujAMpQQK4WgK5QxECuSZzcDJw3QK9FQK71nCSAzINAr6Ecf4DM20CvhZzHnNLAsPHAsMAc350RzFBdNwDPKMDPJYDPbsCxXgCxkMCxgyFAshlTQLIQALJSwLJKgJkmQLdznh1XXiqeSFLzAMYn2b+AmHwGe+VIHsHXo5etw0Cz2cCz2grR0/O7w+bAMKpAs9vASXmA04OfkcBAtwjAtuGAtJLA1JYA1NbAP0DVYiAhTvHEulcQYIYgs+CyoOJAtrDAtnahAyERac4A4ahACsDZAqGbVX1AFEC32EC3rRvcwLiK+0QAfMsIwH0lwHyzoMC6+8C6Wx1Aur1AurgAPVDAbUC7oUC65iWppb/Au47A4XcmHVw3HGdAvL/AGUDjhKZjwL3DwORagOSgwL3lAL51QL4YpoYmqe3M5saA51/Av72ARcANZ8Yn68DBYkDpmYDptUAzcEDBmahhKIBBQMMRQELARsHaQZdtWMBALcEZ7sNhx6vCQATcTUAHwMvEkkDhXsBXyMdAIzrAB0A5p8Dm40IswYbn8EApwURu+kdPT4WeAVoNz5AK0IhQrRfcRFfvACWxQUyAJBMGZu5OyZgMhG6zw4vGMYYicn2BVcFWAVXBVgFYwVYBVcFWAVXBVgFVwVYBVcFWEYVCNeFZwICAgpkXukrBMkDsQYvu7sAuwSnuwDnQCkWsgVGPmk+cEI/QrZfdTdf6ABYETOrAIz+zGvL/KbnRno9JiMEKxYnNjV+bd9qwfEZwixpAWvXbjAXBV8FasnBybgIz0lbAAAACnxefYu+ADM/gQADFtEG5a0jBQCMwwsDAQ0A5WUdPSQfSkKxQrxBOCNfJ2A2JzgjCcE9CkQ/Qz54PoE+cD5xAolCvElCO1/LTk9qTQosa1QvagtuH1/gMzobCWebCmIjKzwdJkKrQrwrzAHL/F/JDh8uCQgJIn6d32o6LUoXyavJrAllwcvMCmBBXw/lEKMRAJONHUVCJRupbTnOOAozP0M+cEI/HAcKHUxHbFssLVrhvBIKfe0dK0I/HF0ISgkOM1RDQjcEO0OcLAqBGy1CPxv1CFMiIxgwMQAFj2HwXgpxZMlgC2AtI25DYBk5AhseYLMGAmsQZU5gTREBZOdgFWCVYH1gs2BLYJFoFhcGtQ7cVam8WgtDFqsBuyvNwQIfFQAcAx4BeQJsLzCVUoABigq4RxoA5CN0jgrKDaZN6gGbAoecTwVAXwD39wkANBZXDAulDCQfuq9HAE8MNAAVE58rggh6AtILS2URGwDYTgZ1BAoeWgAxALa4AZonCxZvqyQ4nxkBWwGGCfwD2e0PBqoGSga5AB3LValaCbthE4kLLT8OuwG7ASICR1ooKCggHh8hLBImBiEMjQBUAm5XkEmVAW4fD3FHAdN1D85RIBmpsE3qBxEFTF8A9/cKAHoGJGwKKwulODAtx69WDQsAX7wLAGNAlQh6AOpN7yIbvwAxALa4AZonLTsOzgKQGHtQu1jIdHKO16WbDvWZFT0b7AEpEFwSBg8bAccJOhCTBRArDDYLABEAs84BAgCkAOEAmIIABWtXLwAUAFsbxi5sdioNwRACOyQz0+EcHgsbfQJ7Ls6hHATBCqrxbAA3OS0Opge7CQAQOi7OERkAfavaHA+7GkcczaF3HgE9Kl8cAuugCAHCAULz5B9lAb4Jtwz6CDwKPgAFwAs9AksNuwi8DTwKvC7OoSoJPA67BZgBG2sKD4sa4QHDARELuxY7AKALOxC7BBige9wAO2sMPAACpgm8BRvQ9QUBvgH6bsoGewAHuwG7D00RErwBAQDqAQAAdBVbBhbLFPxvF7sYOwAuuwLrDlaouwAeuwJVICp/AAG7AALjAAg7FTwVuwAbuwG9KOClWw6/xAD0AGj7L7ZtvgNIo7vIqDsDAbuVJ0sAAlsACrsEAOfdGbsIGnsIoQUK/3AA37unuxjbGruji3lyBvupm4MAErsGGwsBvAAAhgBtuwYAC7unOwEaO7oIoZzKAbsL7QfAqTsA4XsBvwAA5QAVuwAG+wAJuwBpiwAauwAOuwIYu45pFfsAAVsADmsALkseAAa7ABe7CCEADUoBwgC3ryYBwAAAtAAOmwG+J+QAsloAHBsBv/7hCqEABcYLFRXbAAebAEK7AQIAabsAC3sAHbsACLsJoQAFygBunxnVAJEIIQAFygABOwAH2wAdmwghAAaaAAl7ABsrAG0bAOa7gAAIWwAUuwkhAAbKAOOLAAk7C6EOxPtfAAc7AG6cQEgARwADOwAJrQM3AAcbABl7Abv/Aab7AAobAAo7AAn7p+sGuwAJGwADCwAQOwAAFDsAEWsAD4sADesADbsAGQsGFhsAFTsAbpsWswG7ALoAEzsDAGkrCgDhSwACOwAEUgAXewUbAAbQABi7AAv7AF+7AGv7AOSLAbsAF3YBvAABcguhAAVKHgF7KFIAOUUA/gcNDHIAKCpwAaQFCF4BvF4jDAkHb0tsXyqJHzwUYi02A6EKtAHYABYC0QNuAXZyR1IUIQNPAhU+ASwGA3NGvHtSekAAKQAxAfsAUwrbAHuQLAErAHblDREyRgFKAFcFAAFQAQeKzAB4OwQgpQBaANYVAJVoNx+LAM1rsQDP1BYIwnVzGxhWHQnRAYiQqyJTU01IEjzCifkAfxw3QCkr4BGXTwByASksMClCGQ8DMFUE98XuAEtl3ABqAnECPxF6Osd4LjXVBgUAEBsdCggMKgQfHSlOU04IuboAChLNACYAARoAhgCJAI41AO4AtADgAJ08ALsAqwCmAKEA8gCfANMAnADrAQwBBwDAAHkAWgDLAM0BBwDXAOsAiACiATUA4wDYANUDAQcqM9TU1NS2wNzN0M5DMhcBTQFXL0cBVQFkAWMBVgFHS0NFaA0BThUHCAMyNgwHACINJCYpLDg6Oj09PT4/DkAeUVFRUVNTUlMpVFVXVlYcXWFhYGJhI2ZocG9ycnJycnJ0dHR0dHR0dHR0dHZ2d3Z1WwBA7ABFAJYAdAAuAGLyAIoAUwBTADMCc+kAh//y8gBgAI/sAJsASwBeAGD5+aoAgQCBAGUAUgCtAB4AsgB/AjwCPwD4AOMA+gD6AOQA+wDlAOUA5ADiACkCdwFNATwBOgFQAToBOgE6ATUBNAE0ATQBGAFUDwArCAAATRcKFgMVFg4AigCSAKIASwBkGAItAHAAaQCRAxIDJCoDHkE+RykAiwJLAMMCUwKgALoCkgKSApICkgKSApIChwKSApICkgKSApICkgKRApEClAKcApMCkgKSApACkAKQApACjgKRAnEB0AKTApsCkgKSApEWeQsA+gUDpwJdAjYXAVAQNQLeEQorEwFKNxNNkQF3pDwBZVkA/wM9RwEAAJMpHhiPagApYABpAC4AiQOUzIvwroRaBborDsIRAZ3VdCoLBCMxbAEzWmwBsgDdfoB/foB+gYKCfoOGhH6FiIaAh4KIgol+in6LfoyKjX6Ofo+CkH6RfpJ+k36Ug5WIloKXftoC2WzhAtdsAIJsJGygAINsbARCBD8EQQREBEIESARFBEAERgRIBEcEQwRFBEgAlmZsAKMDh2wAtGYBBWwAyVFsbADPbAIMbAD2WmwA9gEZAPYA9AD0APUA9AN8XmzUhCNlvwD2APQA9AD1APQcbGwAiVpsAPYAiQEZAPYAiQLsAPYAiQN8XmzUhCNlvxxsAPdabAEZAPYA9gD0APQA9QD0APcA9AD0APUA9AN8XmzUhCNlvxxsbACJWmwBGQD2AIkA9gCJAuwA9gCJA3xebNSEI2W/HGwCQwE2bAJKATlsAkvBbGwCV2xsA54C7AOeA54DnwOfA58DnwN8XmzUhCNlvxxsbACJWmwBGQOeAIkDngCJAuwDngCJA3xebNSEI2W/HGwEN2wAiQQ4AIkGjTFtIC9s1m4DJmwA/QDGWgJsbABVWv4UMgJsbACJAmwAVAEAuV5sAmxebGwAiV5sAmxebD3YAEls1gJsbEZFNiJ9FGVAe8xvEZKvxVfKZszAVTBzYBH2d1iyUXEHH7twNw7eZF5JJRHI5EgaRr5D20/3dfONrFLSq5qSrrgd2CEUq722WBQ/LzpA+bx1oREI5xy4BDSZNun0ZWORUJqInZSyMaioyvfSI0l5uFDzbWaQ28/zdB0hwR4OQZ0/jn9ALSLNikjFYGfqR389qtFlhD3a6KdIh97rhZYpywuLc7o8ql5/X8KCbPU3L/QlmCowhRXhsGDvg6wUNprA9bM/49uxlAj7ZVy3ouEY/BgFXBNyK0TLrSjZWeJm/T4nz6QGLT3cJNtWRZVZTvIdtaxMMJRHgig9+S11LjBh7Inr06ykoch1U097Rw0hvgmOrydQyaWcEQDg0RavuMuT0zYabUZl1e33HNSK1oNUCS03eh+9C2EvF3fq9h+XBaAMFuoWeZf+mfZgL4HzyiKDIUtfNU4oFu0aE9qt3VA3U4D3fOSrAcYVnjG3cSkp1vhXZnp3JQm4JknKdBitO2NVnGCYQwU3YMWHWB87NEd+4AHuOKI8BSIH92reW0pfs+kWCTJxDCbRjFv8Cfc4/DSBYJScJYTeAEgg9wTEvcwd/QuHRHqGzAQ4fXf5FUI1lPrO+fvEcPl4JInM1z9AtBT2bL4QYEREe7KiSnnxTwtmAFjn8lqT3mND8qTktX2F16Ae9cakqJ6/pEQsHURqyqWlRMCzKXRKfCHT7sYHWx9/T/ugYTFY6iVN3Btm58ATJR5alYZybKMWojwOw3HbFn23NFyeLl7+Er82RchyYuBoGQ3j7SAWNxiYvp5U+Fq/DEzB9cG5DlJWsqkosRze92OVlCtQEYo1S1lF72Z8xWc4ld/+fFcfTEDTFb9d8tJGQ75dpJEvcWyGmGBiTbiWDdGOcw93Dmxq5ISUrmasygONfHLvhgo83HQZenbdBtSzBkvYrCEQ/xEDMhMZsN6gqplx5jGG9mSQLhM81UEdEeJ59sdNJDAFy/gPyJoKlwPZgB/MkC/kICLiCB8va+nCdO2ry4aDfkmPFpF/H/SGQ3LJ6aAv9dtJ8DniHtLOckZix0BVb0iR5V3LAp521LBSIi6AtV7r2ZB/hQEvAw54EFNOQcFnl1xGUIc67tqK1INNwD2n/RbwgzO9h45LM6VMuN8V1ZNIQ6t+Xy3lTqyVCD5kqLy/t3/b8MLbgDg8JIWDkSZ+LrGhhr+gYpH+pr1TnCUnZPjpUdw6bSL6MWVXoDDciQDWECwU2e6VEpfrcOBbrSOijqGkEIoJPbpmeJLkcwbvA0yWIixQVjo0HnYh7fji+Dfdq1mtV1lG2Zz9R7eFMHS+FK7nybutu2fwzDpFldO2pZBshsHJWaltn3PWOoGJpCT2jE8EHOuC6FkejNWcfsWCqNqMLP9xTwcWArj2EiiI7D+EaDi7/2cqHL1gPiF6C/J7aUo7RQqogPZ11WqbyP97nsoMxPOC78wZMF7B1Y0g7JNXJV/nN1m4xx8hbqWz07KSaqr5hE4icB326DMR/vUKX9LoNjle/ZWtbUhrTAcsdgrLlG5Ne8aiR0bS/2ZhpNOVVxavWIZsEM/rd68EB4vjbbD13NkMK1qvMk74vGbSkL7ULO0sZ9R6APSCo6KH+Xn98wEdw1bCPAnDTaBsD6sidAGN58uiH4a3ovG1KyZAu2XtyGgF/vgWKGxw9R1lfAVcfuYE71DHuxtTzfGZnHaDpDGWmfEq0N4GawE7yIkaoz8jcmVmzJe1ydM8q0p08YIxFcY1YcqQc1djWBEoNETDFcgk5waRftEJasPREkrV++N/TOKkERF1fCLrXS8DFGYGRBeECMQRNEs0ES3FzUtXCcNxpYEM3Uei6XodZruXUIRnn+UXf2b/r7n1vQutoi6WoIbW7svDNWBbUWcDUc7F9SJK3bvSy9KIqhgyJHoW2Kpvv0J4ob14HFXGWWVsYXJzjwxS+SADShTgCRjhoDgjAYRGxwJ1Vonw+cpnCKhz8NQPrb0SFxHIRbmG95Q2hlC4mDxvPBRbkFa60cvWakd7f0kVBxxktzZ9agPJEWyA63RSHYVqt8cPrs2uFJ3rS3k9ETGKn5+A6F9IOrdZHfT1biEyUJKEvwzuscwshGCBJvd16TrefW03xVnJf4xvs72PdxrMidjJO8EiWyN/VWyB3fv9kc34YIuZTFtXGo9DuG3H1Uka5FgBMwDPEvRcSabi3WakNQkXFecJlFk6buLVk5YHpuKWTw6oF632FPPSVIVl5hgUAeHhj0t/sw/PEEvThLQDDFE34eCg/rLOyXT3r+L98oRKrlTO0MdALYQ3rRQqC7d822dJPGxF1K4J2TtfPSMFaCAg0n0NGk9yiaKKOJD1v2aBX9HUOIawjjfvwCmjHZJTR62R9c9x33JnBjWrN4QYEOmehy0oZMP9XM9Zyi6TYoe07PaLceRXcCWZiY/imRUWW6+mci7+wMxSdwMdbXckXtvhJH8sc4iQcTwm7yp+3f7CaesTTQB2qkgeXh+wFiSMXfMlH7Yil0OoZ2QTtRLTip2O0cLZ4SstqWHZ6H+8A2kZXhpm0kPbL9dUanTOvziqIUh6Ambwa3WrCb2eWbuCN3L1hgWUmjRC3JoL3dBhR3imSQI8xuCMfsszlji7cSShNSYdqCXPxEVwbqO9i5B6hf93YI7aeyI8jxgcVXK0I/klbvhSXjkjOIwZgPdVwmsFW7HGPLUAvDRuKm+itybRg7c8+Yqqjg824Qf+/NxsBSUNAK9KCoJpauFqK0XQULrWYj4FnxeKDuvr54iokpi+D57e6Y1zxRJJdsHnDR3JyraCUufHBRTKODWBVzthjm4k3/Hv+Q990XDVR+KW+TcJX045LW86EKhz/97aqj89A8ZvTk1//tczosU90loIPVaHuWegJU3wP//7XHcO7c0yQM2jM/IhQKrf8hiObHWiWDZManF8Uf/HzbmDfC2wT//aiZ4hGTv/xzgKwdb1sD6cGEkceow0s3b89/zg+3plyRm0HlZi886j5wUwFhdHiDTaBidZRo5cx/tMeLyguOATbzq17ydhzbrpxunuHx6lbFGiO97gsd4dk//7iCIo+Ew+hG2so5kvv+ITG4c1fzHPtu1Xn5QfUnqY3/uByVmB7gmnE/E+5zdm+6nDmoews5fr+NzThdSHzK4bBQOL9c4O8OI0xLSqjJ4lbniLJg1aFpQRLwaSMZmpkC9e/j6FOVrTQ6a/a4alGgfrl2ZL1sbHUQ3DOI7ntq9diHFfm3t1mul3rdJEJCHnlW/hlQntipMrpeMs7fUr6wK370D7VbXH0DUHzdYfRg/6Z11Ult1sffJS+heHbco15Sxy3+rDnPesqH1lajk0yu02hPUvEUqvcUXWXL7Ad0wNGMx5gOle4XJxq/r/YY0xdco2wRSEGwcT7YADlBrHc9ZbvzOL0QwyWCWWChB9Obg800v7tyBWaNvdwz+fL7Ph9i2irEeJkRgOzeEDw+JiD/V93vH9FgMEoFIJMoIuogmicZohf94SBuPn6hXaV9jP4VVVA/bu+Wg8S88GLtmEPSNRLdtlXx2XL/nuM8nKkhnlnjaropiKKLIH94pLIASci0pDBfj9Hi5BfaTSXQg5+PMjQX91Ktk4MOqK1K99l4BRPv5+vNovGZ3IxQv8ICvjV4/diThpoaM8uvd3D9d/DE477w3yAbW3IDm2i73pZ9aEj38JqS6h/s8/xgmUIVcuq2JTgefAyuoafzQxAuRASeg3NtG3ach/JEkyuX+JDt2PnDZTShUhyHHG3ttBg/6lhAchGjLJBtopj4e01MlCp2yqQRTr4sBBXru+lKaoanwYX8y2aWCJiR3KnhCOkYVFSvsO0oDRujUFOEptiNDTYrJoUbvOyvl4AhC9h3wORiTXK1MrpMfnvdnndnR/HRVSusMBgIxwrLdn3vq1VcncPiD0SquTx/kNmxeFyCT4uXVUd9AL+rSGmuq7OOCzDKeVPjiNWVaoP5KOFqYq5Xcuf/xW9S+u9eIq9GAtZWtQlgkRecjRtvG1NR4WXXpn+pwsTBTIy079Ikg8rSef1aVapIFcXCd6C2wHVjLXR+N0tw4Taw6x6H90BFRgNrtlq2up6hHKuV3inM5RJaQWZHd84e6RsKkk9po3dk9by54tpPw7cBkFas/G+GbHwuG+AwP55BZyXILTHCIVrPpXHEaUPYfL6nphJP1Rc10xG4UaCeY4IHCwuur8xmSQDgY4aVwhzWhjbtSHG8JO6P2i2nC9/0Bfx0zk6dYQq3aw7k5vIObD7SEKrxhz0fQ0+YTOfHW23CBNeZci1qNsUDhoeqmfyP6PvjoEjHk8QbrFyQVZPHVWijnb8YCM65iYNoEbvnchStZ/9cKg5Vd45j8KnB6UjzXl/bkyZx7VoD47ocUUi117WwgySSb4rXgLJ52Mv5XJbp3I+uBP81BUvOjy4Cacgi+GWWlC/8dwgqwiojjUBDnEOxyRyowwLQfytFra1OZS4XvRYr4uoamAfG3I/p2bA7G90yqKThH8Ke00Tqd+3l3dmJpaCZelBMYjGqNLVa3SM4+LQeL56gY6Bymy2LQPVOxjWfj5tq4o74swcxhyGJPynkS5xAjOXZP1/FAYcBT3u6qLoIkEfErwo4gozmyI1YCvM0oyI3ghjGPQSsof2sKUhq91WsKy9cYWN+4A2v4pG/Mxpdc6w6kI/HX7Xb0TuihmsiOy2wQIsrZbUmr3OBSUo6oDJNgQp+YqYkgTgYcWZDgawJw3DFfdzT//PhVUidgB2qa8uw/j9ToHBAS33iT8YLhhAfyXG0bQUFp7QmH7oQ3i6Flf4OTZLvJdh8pfuflmWu2ohm5pTiSg1pl3vq9uluTJwqXfh1hqy8e2iHoD+Y35gCIViTo6VOtK5dD8HYClucJucXASzwe2kPj4S4eYQtmkYHagXhAzp/F541xE8YFYqSPszDuz3soWzHy0p3E2jwZNQaIcGU9FNQwQxeDw0ZlK9dxXrj9IUHGUPTOyib8CqXmbZ7Ex54bn1rLx3qqAavu/gh6XjV0GmN1p+yyMK9HN5uYEvxgbAk43tsheREhyI+Q5WLIneKTGPmYiM/lxOp8fvqHy8YgXK0TlMiX0tliLI2JtfmWZP8eVV732sdYm+pcWzDzEmKLJZyeelyaZKkjPnnUO9keDwtgiLnmd5+t+Sr5y8brRnlvxcWEWfCqIALQYHvaXx6jTg4dAlye469uGwwOZVZCILLfGjaMg4LUCNMTtMSp1aC2y/3wR2t1v3w/iNBRQ+bNbtDqL2NAr7K4rUcyqbSpNrXZgAWXvjxBBtfYLK1uRYt3q2pfXJOAL0HtWcEwJLddOSJKV1SwvcvEuzg/4MPnA8MIUJOLqm3qI6wFyN99Ck6zYaV/zGSAzF/PGsaNa4vPLe5QnyuqVUnVQ6xELA6gbe53aGgeke+R/ycb2LJVyc7BhuzI90zA+c6wUDTb7NH//gdDSl2u/aW7lRJm8m1fLtPxcNuEM5JbkOCZKPM88HUsLRoC1pmKKlvWyeAXuxILbu0snpSxf8N+RgtLUSe5n2gdjOjoSTaN7mMZ7bF+cWk/MS8mFD4pcyl5UN7CbpFZH2a+Pm1VAnUTVfbw8qrmz1G9m5aKmRzY1SMhhPrlCn2t4uNUXNA3IFe6NOjSC1DEaAFZAfDlEkQCsbNhsZPj6NQPDSB3tLiTo0ZYoEbIeEIaKtU3Wk60rEszawTFuyHVd365LA/c/uarABN5M5rGq/dqTG3Ilye/5EKiYisisuzqNaZjmWv0z9TORc0CKbaTea214oNM9u2sXUZub/eqM3Pi/PjRSyQiOSwPWif2asTgu6hS6fb5UGosCWxdedMqdViIUUSSdIJx+qQ4KShfTT39VAWZbi+mB+iKICNwpt6cflY57Rcbs6d1kA26Iru73cuxYVlSvuJdcR5VfDYZRk8X0AXePROyw3Le6LaUdmTLzYsoNhhgQpd67xVNiHgk3pakmndeIAtTC4DCXy9oS6eU4CWxDdVmY53pKNbdAKmQsP37lrJZC6iDXMELGKcHjNuuZgcDyY8W/yv6ha3DX7OWm/35fpvhw55oitf4V+GULlcPWYyGGuVBdro19c8u0RDddDun40W7G5cSIzHLh/qZxb59R+EPY+wZ2XerkUim92hhXpKyW6WtAh6zQS97DrPyjCvKi3pCw96LeKynOpyjtsMQc2RmI/20zFOZcSa2AK++PoRcT6zeJyxlBZ7kk5mhqXGkLlM2hFKc+/T544xXP0Ua38Q6xdPTLTeG1PHnLMaOvksUQMrEFTB/lizCirmFQL8zYVU+OTeYQEFaITsBSMMYexS9HkajO2gGIf2micvntCZJsZQEwIH3/4JGJQGflBuH5rNXmnRRYXDQs3ZoEQoMtYDr1kFKUS/siiQSUxcTH9XYeBZiKDDFQoExREO9dddKQLO3BwMHvymCSTFyY+vxn3D27NDx6OlU092D5EDUwilttqVHpjJQDUceJYCLsK2swfXeNUVrBJT/w/sk+7si8rPtiMFis+oxvGdGQxirMBID700T39mULuNHzOyN+xBfcFACZcyngF1aSpv0JPkNUrAZTqfplv509cGXFUiEEm5dZb+OsP/blizqdK45/dSsIrufYTrCPY2lgJD6k6QljTfXVlHfYKSq+MsagyUcaMintyr95bD8kdTAeYNLNsMmo/Wdd8a2nStBP49ARIjqqpUHWY4q4mvO5Cq/CgCP+4/B+5zutGwX5pssgVLr1+fIM7WWLfiUQDk4c6ZdHZOWv5hG3g2dgQ5NXnpIY+BWwJpaouf25bXnjDzbHnQNofH/c6m+dEAS9Gs2h7pFRPKOBDnqswZ8KZjhId1ytHUTs533KwBoSiImoxKQUgZ7z6pA9QB3sZ8Cq0vwutJTTkfbX8AzCpm2cFXx/P22niUMHauU8IGc+78R6TsutoonoqFuoNA3l80t387YHMoL5KGAT1JO4zmx+vJ0LbLHlicHraSVYvJjnO9p++qnWgKw9OwFVVUagvZuf9qfiuum+hIicxP1q4zDnzkHsCNriLxBpxY9N+UOmqzdY1MunLMDgkMyi3uvnN3UBXJeZ8YLs5xr8QrOhimYoKuGBebZHAiBIkViv3DG8k2oNpp5OIgX6ulqaRN8V62QUPjn5tl1kPXhT9bcd8qIm8gi4or/FGbvQ6pgGSHmnayrugmf5E0upGxPRf/3xOtitGMaHLKJVm5zhglmVfI91o0yxhJZVS/5wQ8zfxK8Ylw0WmHXoGfRkoBRx9Hsnl/6sgTjAVwpmNuSeZtBwlX4qB8Bh8lxjqBDIuFGJ4I1wxN0XRlAAslzqMKwQfyA7OkuivCXfv+i+3XmhcBFM2n4jdT+NyUmBnQJPV3F2sZfKvJhUlXzSosFR4VevVVcOkFnnjdiRWc0TeSYxj41sJGYMbZTeLI3GvyZ8/gAAudQ1+4oFX+enX5V49MczGCYVBuoC4kHjp7ZVxj+clBwPr9k+v05SsezQK3enxLs1Nt/N7c7AImVUysjGou4iOohHo83Zs9/MI/OWB+OyXzOBD93NbApGHXrv8CVRHp2bwH+xB55cfNrdqFD35HSMx4iVmtzYAmSCIV8kXsHoq3DIb93riTWbubnjxbBW5zConVtbxLRStXHkIyAByaozME952Gc9aAdAbBpZSVCH88Uwb/4bPTVOVl+WoMYD7JIvK8VcMrJ8zHV4bbG0Dg7Kx17A4ej/ZcZ2Z5pVuVLUH1E/AccUTKm81SE+LQ6STTUDscUk0x2OWIbEORhg69tdoTGNkA1RfkGIRZHr5mCXOpLC55WWzCZoGPFUVtZRHwh0nq039CDdjEPo+JyaxSQAvDgR6Iqvxy0frrtEG1A385N81l05SSzN+IDm9bypF9m92EUqblnauZ5sjc37wRykOdl7w4o8WMgQsjii3EE/aJYDfHs1cH6DNBEujjcCc8qAefYFyIAURDcDnzun5UmkbBQsU4eu/W8I9nBE0qJKTdg2hwjq0+XV7a3TJ7R+alvJZCRia9lJ+grNB9dbrOmWEvUotMjvDhq4wV/kq4fvIBkzUGpDeYH74rne8uU3dgoNZdR9pUL6q9YDNRfOiF6Dyk+SYXQIghTjm9qR4tBHh0gnmF/9q3Qv22EzaLhSvDlDOxMrrCNRmLCl1jApzLrBCPn2mjn5zqK7OYK7VxOfQ5GfBfoPdyQwqFEgCVHkJ9oTnagRM3R0+rsuN5jQv9icCav/p1WqiEXSzCdLd/WEA6z6dDP7tPqPbeDYKAkVcz1lLGbFOC9b7cBd3MV0Ve8dZ89oR7OnxGS7uVpSry8banVZwpJg+nkH1jRBYa2BvBMY2xITH9ERXCjHzdZxs+ipdXP2DY7X+eWiBhtT2L0RRGTLPeazn5tpl4tu8iE2rWig731iuJDRbCHHy+g/Mb9+miAyVqfIpXT/iZeOxOxODO0hEpLM78I1+G2Z45yi3lS1K3m4WMQ559Lp4UML5vZUjYGJuxl+OPpUH5klpyBujkjprhei0TmUik10gjvNUp8mDkWlNKikmYspaVTqewbnOzJrmz8FLIpsT67EJLHIIfeDcWEfiP+DJrZ1jfxpoAb2abeMqLx+9RuZGzQoYtYVGgAWwEM9Kek2vPIeBNAKD6ao7nw6sgvfeLZPoXkbYO/tStHJdKzk+WFSFEU2NcALJAEP6S8pcnqqBBt57dwTrzQNCIdk2SocK4dLRbD/pu/VryKnm65ZYXiJCfHJk3mx9MRSl+nSK6OqEBSoGjz0/LADddwF/HqcfK3K3O+6YUGQcmj8pZL4PhZ6KrGkb8B38FmDvvLd3XQXbvS/FQmrXFTvJNkaN/FGo83KuS43BK1UfVnIqigGkCoP5fBda2MwAGTGNKX9K9t4Bx83pMFc5KSORmWKv+8VoVggWxoaBz3/9IBh6RwLd1tebwy89xvE5z6EEpXpDfrXWfRsMs6+ekUHH6idVosno55+xQ8Zqzelh0bxtJTgCcH3Z3/Cxlx9eNIS4JIFKOAVrDqbrXRszmY55a5+niJGHtkO3b6mnIDxLa1WXc7BAe33mt2KyM4Fbc3R6/WVTQN8QhlqAtave2WsQTqzWeSlKuGUVIJRqtObpv294rS0kDN1RKzdstZTXJebR2HlzsQ4P3NbMHUqFZMZw+/IKXnh4t+lY8qocp/B1oMszR03EFs3bPeND8QkItMvllObeCz3SZAjqZrobmLcrpFyQV7mwBjg3C3C8/bc5goQhv8j/IXMLGnt4mF7tybRDG5G0polxoUScQkPvmnga2/K+aapKeqSL0BTmo1Cm5g+booNOtdyKva2KoefRURaBk7113QKo3y+WTuFKtgETIK8HRluYS9DvlcciCDvnG8UaJRfZE2siZsiTHvRmN80xkUIInHeRZl5Re/+ATL6VhKFi8CZ/n/jbFV6T5pZ+Uoppvsi3qjacVFOJgWWfdlwVHKPW/TJO3na9hRM9bS2yo2rEsC6IBzRReVO6IesJU7PItzOamr+ROFfwGZmZ7ue8HNxAgLJKb7P3p8dMqk6Be5PJaT/5Rdc1deYVihWH9cjVKc9uz5EnfHqxLUkOO8iJUENBNVf5LyNy8zjLu/78k5WNTywiPfYeX3CPk7yc6CI3lum/CEZwfUaNpcI3KsPqfn2lmz3kd/acQjKA1ebkJaiuLD+epQ/Fc1llHXXMzofWzz/Kd29SNmOhcjMWw1jq1g3YfrXZ9rzXDYW4ZttfgfMi6oCUtBs0PkMVuxmq5lxEoCaSXPSqCJJ7MlKdRDidVt0AFlxk5cTdX++sBF2+E35mjwfm8ERVxH0FvuAQtsfA4V2G0TKTUxeyRGVjd/u6F1SvuAiU2/WaQjcNCU4Ep7VunXCYSbZj3U3wzu/LWM5MPlYuyQ3FOOCD/zt7K295hY2JhwF+ODDIZ676vGQFKveEQYkWj7lkK7rVmD7MhU0Y/tF8EcTTpo4/yqOufbd/zWIpMajnbDuWK2vn6OPPtz2rc9MIBNlPd8tt+yf+7SC4wqEPbozKMCwY5Bygx4JmoIEDsixWRDcdHd6S3/dZMHXOJAAv7+NIstl00crgSqHZKAEe4g3G4dzIV51EeZB01r7p8GNlfUnG/GjZgNGsqXZdYMBVtAtFNv3hJWPve4GvqZ2XxuiNkHTz5kxWgr0PjQdJlVywJ9Zf2ZvqeeTbolKtvK54re2Lq5BoyzfsRtvDfyao3kmyFzDQ88nM+qx83w74RDlkngtYiArI05Epre3GgBeSlMig0pE6RGQaFznKkGeb0SozLCyiOtxh7hgwZlbKbClzUUfC8ntMiHUOZE375RhTy9c4DA+oMLkUDkztSybZbdmP1xpaIbjUpPAHBq3cIq+CBFzbMlMMCCkUQ6d9LGV6GYCsYiEWZIy3nBnuxOYXeU4YTGDSin9e4/pCjPtQSHlg5LMEvIlF0ElthqrF129iK2RPBEWd3XWOl3SWV5uz5VUyZYp5kEFmz7QfP/B1W1BBzQ2iTGbSVT79lUHzcGXz3PJceSgz4uknETUwo0xffpr2KUvZF0i/r2sL3IFIClYx8CbIZE6Qt7MDJbOPB3xMScwaOcWG66IJfCnDkb0D2Mb+PHzX+oiCbxeTIogtyN+s2NJirNACk/OACSOTtV6vscwbzW4M168xqaI+RzR47S1nlV/rOoZnid87n/Ima2XYa3un3BuGAisNjb8eLMT9OnMtazQROFCuO1HiZXaOc0oUDbNC4eKLToOx8DzVhMgGA8XIAQ2x3b6I0uEyLssQjJX3QphcUMx4KsMgJ+72km4N2aqkBF2coKmUEt1eqIMGn+5txMT4kYVGd3ALO+y9Z4PP3d3l48JQK8s9ZZ/Qx/+NBKgBEJFlQ32psoJiihGO7FSYM5L81q72kaAYcilEFMG+ZK1BcMqELkflyCV7v8JEXLO4Rf/oZYNZHZVjJhfL6fnpP9Tio3Euue5uS7FMkfGOeRCTrBZ06Caev7tgufeTrX34Ur/Vvc+b8ksiIShNJtuF9WmYxOZ4xg8y6zTdy3KAB2y5kYkcRnXsptWwAFyKZ2I/QGySNeoQLkINUMloC+5L3WuMMx297Q1xUYLKqZ9XHavaobo6QQv4auMm+i84IhxRpPt9nUmcav9NcjCcP+TcMmxsQZ/F3mgeoA0fQgwvTsyXuuTaM3Sqtv2jaaajmaFQpK9W6uIbeqwvSDo34ZrY6elDUHwSCjHRRmlwmyy+eOra64Ssq0XSXYljMHtKY+FShcMkHsEUY/4Bw63dJ6KpwDaxmthlDdbdE+TvYF3v33cGSKqO+1H1pKYhJMvZD5ckQcHyNF8zrtiR5b0ko6NPGoRexUZTYP6VbUdn3zzxGBOi8Z0OqHjGqYxRXwN3mYi0GYEEZYq+Q3QvdKcEHILLLj8S+VFepSfErtmfZCdvxbfIifFSpEzKi+7VJsLMT+zEFeyp1OdwRC1VZrfTLIyR7xTPUcZFYPD9qI7D70uTb4hdpqPXsJIRNYbZtNwch1OI3trh3u2ScoQyM9POnInsUa+OovcwkUP1UfIzPb95n4BaF2ev57NHAej0+BVMF9/Cj9663HN2/JN3SQgslL914bKfiTTDFAz9PlQEL/dSv1H8xl3mtWxh1McFO9EJXlRDaKQDsyKO4vOJW90NFE6yw2tjbc2GeF95sbs0I9enAa6QwQVf/kJQhAD2BzUDKggOyjy1TEhED6sfk+418lQy3c/uj8aw8UEzZ6hIMCd8RohAkumMtIj9m73l2yPWoGHVTPaywkC7Yj9tBM1NxMgcrDwRtk4RO2WHT7Ql5kQCKdJj6kNuOTeyEBYBjLMhGz+O5/YGa84HEiTYEpZ6fFzy26GG2hWtTyteuYrhSyG56BjsT/wQeLRytpTY3D7sIMqZnJ9z1FDrfyjFlGl2TNw9BQysbaxOuwYYZs/7I6BANgkqCknWZC7/BBXvaeKwAmC959I+G39BUE9bExkNlbRoFRyEtNzv+NJ91FuisG3JCS6uYBeRnfv8AkAfKTeg9EYamqnsGfAV7d0f9DghHEQ5IsPGDIUhgoSj7obM4Bu5uhQ3/CYEDTHc92AsFvDK4XGrwUeGBWBHPlS+f4x+CxmmHz2sAGmSFNt65kwZC64mnaoWlu2310laYn8r62AqsR5dfjyK18MEdurdagldzfJtjFXlZs7St4QhdPiye6TPh2/ZAQLU/Fip5s7TDEM16KtRWrK9hmxnQ7bmfa/+7pa10Z8WDPK3NuJ+NN/RAbQ5vHx2uX0Lm7/w7cAEH/hvZA+mt7J7zGw7YtQYwnNN6dpgwkGjjrS3yQoeoYt1EnczmtmJfQZWzUlP3Hlg9Wzlr9IH23q3thGth+QNEANFettxKfskkGOlLk8AqoKJwDqOxAa6UzAx07plSSyNBJSGco9zjnC5gGbDoKvsMDuBR6bGRlGzJ+hFsGa/Izt78aI+WZ6dJlZKp4pGISuv9rV0sAS0MWEwCmfauO7oQZMiakHU35LBxiyJoOMddhUWgcZuC8r4Ksvn75TTcQXLJ7kWtYhGuGqPd9dZuFjBWQHNwosXY5snbHFQq72CvHXhIg+shQxycuLOuWYErwCLZeF24b7F78pO7xw4X6lIAR02hUOf5087Rl0nOaeb6CK4i/KA/EZv76ftOWZtjwxslNr0E/u8rWUmnf3amfg6UZmBAluuoj3Dd7UV+9IAJ6iYcDfSJlgmIImohjfIUMJ27z+opj50Ak9af2LCNrWrBJvMovA1OeNO+MF/MwZvnaCxTgG7Cw4QfSPF6AYCGFt21M8PySZFeV3t2Rqqs5JMzMYzGRgq4o+UaKRgBf9GHi/9X9HXA3wxkCsd/UhnHSh2zUVDiraio/6nP4y3XJqs8ABfALAtCYU7DHPMPRjgcM6Ad/HiSXDAbOdSMkvGZPAkHs8wuQTy6X2Ov/JFvcPuKfV3/r9Q28";const p3=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),b3=4;function LD(e){let t=0;function n(){return e[t++]<<8|e[t++]}let i=n(),s=1,l=[0,1];for(let z=1;z>--d&1}const w=31,x=2**w,S=x>>>1,O=S>>1,T=x-1;let R=0;for(let z=0;z1;){let le=H+V>>>1;z>>1|m(),K=K<<1^S,Q=(Q^S)<<1|S|1;F=K,U=1+Q-K}let j=i-4;return k.map(z=>{switch(z-j){case 3:return j+65792+(e[f++]<<16|e[f++]<<8|e[f++]);case 2:return j+256+(e[f++]<<8|e[f++]);case 1:return j+e[f++];default:return z-1}})}function UD(e){let t=0;return()=>e[t++]}function ux(e){return UD(LD(FD(e)))}function FD(e){let t=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((s,l)=>t[s.charCodeAt(0)]=l);let n=e.length,i=new Uint8Array(6*n>>3);for(let s=0,l=0,c=0,f=0;s=8&&(i[l++]=f>>(c-=8));return i}function zD(e){return e&1?~e>>1:e>>1}function HD(e,t){let n=Array(e);for(let i=0,s=0;i{let t=j0(e);if(t.length)return t})}function dx(e){let t=[];for(;;){let n=e();if(n==0)break;t.push(GD(n,e))}for(;;){let n=e()-1;if(n<0)break;t.push(QD(n,e))}return t.flat()}function V0(e){let t=[];for(;;){let n=e(t.length);if(!n)break;t.push(n)}return t}function hx(e,t,n){let i=Array(e).fill().map(()=>[]);for(let s=0;si[c].push(l));return i}function GD(e,t){let n=1+t(),i=t(),s=V0(t);return hx(s.length,1+e,t).flatMap((c,f)=>{let[d,...h]=c;return Array(s[f]).fill().map((m,w)=>{let x=w*i;return[d+w*n,h.map(S=>S+x)]})})}function QD(e,t){let n=1+t();return hx(n,1+e,t).map(s=>[s[0],s.slice(1)])}function jD(e){let t=[],n=j0(e);return s(i([]),[]),t;function i(l){let c=e(),f=V0(()=>{let d=j0(e).map(h=>n[h]);if(d.length)return i(d)});return{S:c,B:f,Q:l}}function s({S:l,B:c},f,d){if(!(l&4&&d===f[f.length-1])){l&2&&(d=f[f.length-1]),l&1&&t.push(f);for(let h of c)for(let m of h.Q)s(h,[...f,m],d)}}}function VD(e){return e.toString(16).toUpperCase().padStart(2,"0")}function yx(e){return`{${VD(e)}}`}function YD(e){let t=[];for(let n=0,i=e.length;n>24&255}function bx(e){return e&16777215}let Im,m3,km,xy;function eB(){let e=ux(XD);Im=new Map(fx(e).flatMap((t,n)=>t.map(i=>[i,n+1<<24]))),m3=new Set(j0(e)),km=new Map,xy=new Map;for(let[t,n]of dx(e)){if(!m3.has(t)&&n.length==2){let[i,s]=n,l=xy.get(i);l||(l=new Map,xy.set(i,l)),l.set(s,t)}km.set(t,n.reverse())}}function mx(e){return e>=Y0&&e=Dy&&e=By&&tIy&&t<$D&&(e-Y0)%Hd==0)return e+(t-Iy);{let n=xy.get(e);return n&&(n=n.get(t),n)?n:-1}}function vx(e){Im||eB();let t=[],n=[],i=!1;function s(l){let c=Im.get(l);c&&(i=!0,l|=c),t.push(l)}for(let l of e)for(;;){if(l<128)t.push(l);else if(mx(l)){let c=l-Y0,f=c/ky|0,d=c%ky/Hd|0,h=c%Hd;s(Dy+f),s(By+d),h>0&&s(Iy+h)}else{let c=km.get(l);c?n.push(...c):s(l)}if(!n.length)break;l=n.pop()}if(i&&t.length>1){let l=b0(t[0]);for(let c=1;c0&&s>=c)c==0?(t.push(i,...n),n.length=0,i=f):n.push(f),s=c;else{let d=tB(i,f);d>=0?i=d:s==0&&c==0?(t.push(i),i=f):(n.push(f),s=c)}}return i>=0&&t.push(i,...n),t}function wx(e){return vx(e).map(bx)}function rB(e){return nB(vx(e))}const v3=45,Ax=".",xx=65039,Ex=1,Py=e=>Array.from(e);function Z0(e,t){return e.P.has(t)||e.Q.has(t)}class iB extends Array{get is_emoji(){return!0}}let Pm,Cx,Fu,Lm,Sx,md,eb,cd,Pu,w3,Um;function $2(){if(Pm)return;let e=ux(PD);const t=()=>j0(e),n=()=>new Set(t()),i=(m,w)=>w.forEach(x=>m.add(x));Pm=new Map(dx(e)),Cx=n(),Fu=t(),Lm=new Set(t().map(m=>Fu[m])),Fu=new Set(Fu),Sx=n(),n();let s=fx(e),l=e();const c=()=>{let m=new Set;return t().forEach(w=>i(m,s[w])),i(m,t()),m};md=V0(m=>{let w=V0(e).map(x=>x+96);if(w.length){let x=m>=l;w[0]-=32,w=zd(w),x&&(w=`Restricted[${w}]`);let S=c(),O=c(),T=!e();return{N:w,P:S,Q:O,M:T,R:x}}}),eb=n(),cd=new Map;let f=t().concat(Py(eb)).sort((m,w)=>m-w);f.forEach((m,w)=>{let x=e(),S=f[w]=x?f[w-x]:{V:[],M:new Map};S.V.push(m),eb.has(m)||cd.set(m,S)});for(let{V:m,M:w}of new Set(cd.values())){let x=[];for(let O of m){let T=md.filter(k=>Z0(k,O)),R=x.find(({G:k})=>T.some(F=>k.has(F)));R||(R={G:new Set,V:[]},x.push(R)),R.V.push(O),i(R.G,T)}let S=x.flatMap(O=>Py(O.G));for(let{G:O,V:T}of x){let R=new Set(S.filter(k=>!O.has(k)));for(let k of T)w.set(k,R)}}Pu=new Set;let d=new Set;const h=m=>Pu.has(m)?d.add(m):Pu.add(m);for(let m of md){for(let w of m.P)h(w);for(let w of m.Q)h(w)}for(let m of Pu)!cd.has(m)&&!d.has(m)&&cd.set(m,Ex);i(Pu,wx(Pu)),w3=jD(e).map(m=>iB.from(m)).sort(ZD),Um=new Map;for(let m of w3){let w=[Um];for(let x of m){let S=w.map(O=>{let T=O.get(x);return T||(T=new Map,O.set(x,T)),T});x===xx?w.push(...S):w=S}for(let x of w)x.V=m}}function ev(e){return(Tx(e)?"":`${tv(hg([e]))} `)+yx(e)}function tv(e){return`"${e}"‎`}function aB(e){if(e.length>=4&&e[2]==v3&&e[3]==v3)throw new Error(`invalid label extension: "${zd(e.slice(0,4))}"`)}function sB(e){for(let n=e.lastIndexOf(95);n>0;)if(e[--n]!==95)throw new Error("underscore allowed only at start")}function oB(e){let t=e[0],n=p3.get(t);if(n)throw C0(`leading ${n}`);let i=e.length,s=-1;for(let l=1;lt&&(t>>=1,e=[...e.slice(0,t),8230,...e.slice(-t)]);let s=0,l=e.length;for(let c=0;c{let l=YD(s),c={input:l,offset:i};i+=l.length+1;try{let f=c.tokens=gB(l,t,n),d=f.length,h;if(!d)throw new Error("empty label");let m=c.output=f.flat();if(sB(m),!(c.emoji=d>1||f[0].is_emoji)&&m.every(x=>x<128))aB(m),h="ASCII";else{let x=f.flatMap(S=>S.is_emoji?[]:S);if(!x.length)h="Emoji";else{if(Fu.has(m[0]))throw C0("leading combining mark");for(let T=1;Tc.has(f)):Py(c),!n.length)return}else i.push(s)}if(n){for(let s of n)if(i.every(l=>Z0(s,l)))throw new Error(`whole-script confusable: ${e.N}/${s.N}`)}}function dB(e){let t=md;for(let n of e){let i=t.filter(s=>Z0(s,n));if(!i.length)throw md.some(s=>Z0(s,n))?Rx(t[0],n):Ox(n);if(t=i,i.length==1)break}return t}function hB(e){return e.map(({input:t,error:n,output:i})=>{if(n){let s=n.message;throw new Error(e.length==1?s:`Invalid label ${tv(hg(t,63))}: ${s}`)}return zd(i)}).join(Ax)}function Ox(e){return new Error(`disallowed character: ${ev(e)}`)}function Rx(e,t){let n=ev(t),i=md.find(s=>s.P.has(t));return i&&(n=`${i.N} ${n}`),new Error(`illegal mixture: ${e.N} + ${n}`)}function C0(e){return new Error(`illegal placement: ${e}`)}function yB(e,t){for(let n of t)if(!Z0(e,n))throw Rx(e,n);if(e.M){let n=wx(t);for(let i=1,s=n.length;ib3)throw new Error(`excessive non-spacing marks: ${tv(hg(n.slice(i-1,l)))} (${l-i}/${b3})`);i=l}}}function gB(e,t,n){let i=[],s=[];for(e=e.slice().reverse();e.length;){let l=bB(e);if(l)s.length&&(i.push(t(s)),s=[]),i.push(n(l));else{let c=e.pop();if(Pu.has(c))s.push(c);else{let f=Pm.get(c);if(f)s.push(...f);else if(!Cx.has(c))throw Ox(c)}}}return s.length&&i.push(t(s)),i}function pB(e){return e.filter(t=>t!=xx)}function bB(e,t){let n=Um,i,s=e.length;for(;s&&(n=n.get(e[--s]),!!n);){let{V:l}=n;l&&(i=l,e.length=s)}return i}function mB(e){return cB(e)}function Fm(e){return mB(e)}const vB=(e,t)=>{const n=Uint8Array.from(e.split("").map(f=>f.charCodeAt(0))),i=N4(n);return Number.parseInt(i,16)%t},wB=e=>{const t=vB(e,d3.length),n=d3[t];return`data:image/svg+xml;base64,${btoa(n)}`},AB=e=>!!(e.endsWith(".base.eth")||e.endsWith(".basetest.eth")),xB=async({ensName:e,chain:t=ja})=>{const n=h2({chainId:t.id}),s=y2({chainId:t.id})||n,l=AB(e);if(!s)return Promise.reject("ChainId not supported, avatar resolution is only supported on Ethereum and Base.");let c=Q0(t),f=null;if(n)try{if(f=await c.getEnsAvatar({name:Fm(e),universalResolverAddress:q2[t.id]}),f)return f}catch{}c=Q0(ja);const d=await c.getEnsAvatar({name:Fm(e)});return d||(l?wB(e):null)},EB=({ensName:e,chain:t=ja},n)=>{const i=n??{},s=i.enabled,l=s===void 0?!0:s,c=i.cacheTime;return o1({queryKey:["useAvatar",e,t.id],queryFn:async()=>xB({ensName:e,chain:t}),gcTime:c,enabled:l,refetchOnWindowFocus:!1})},CB=[{inputs:[{internalType:"contract ENS",name:"ens_",type:"address"},{internalType:"address",name:"registrarController_",type:"address"},{internalType:"address",name:"reverseRegistrar_",type:"address"},{internalType:"address",name:"owner_",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"AlreadyInitialized",type:"error"},{inputs:[],name:"CantSetSelfAsDelegate",type:"error"},{inputs:[],name:"CantSetSelfAsOperator",type:"error"},{inputs:[],name:"NewOwnerIsZeroAddress",type:"error"},{inputs:[],name:"NoHandoverRequest",type:"error"},{inputs:[],name:"Unauthorized",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"uint256",name:"contentType",type:"uint256"}],name:"ABIChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"a",type:"address"}],name:"AddrChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"coinType",type:"uint256"},{indexed:!1,internalType:"bytes",name:"newAddress",type:"bytes"}],name:"AddressChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"address",name:"delegate",type:"address"},{indexed:!0,internalType:"bool",name:"approved",type:"bool"}],name:"Approved",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"hash",type:"bytes"}],name:"ContenthashChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"name",type:"bytes"},{indexed:!1,internalType:"uint16",name:"resource",type:"uint16"},{indexed:!1,internalType:"bytes",name:"record",type:"bytes"}],name:"DNSRecordChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"name",type:"bytes"},{indexed:!1,internalType:"uint16",name:"resource",type:"uint16"}],name:"DNSRecordDeleted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"lastzonehash",type:"bytes"},{indexed:!1,internalType:"bytes",name:"zonehash",type:"bytes"}],name:"DNSZonehashChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"bytes4",name:"interfaceID",type:"bytes4"},{indexed:!1,internalType:"address",name:"implementer",type:"address"}],name:"InterfaceChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"string",name:"name",type:"string"}],name:"NameChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverRequested",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"x",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"y",type:"bytes32"}],name:"PubkeyChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newRegistrarController",type:"address"}],name:"RegistrarControllerUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newReverseRegistrar",type:"address"}],name:"ReverseRegistrarUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"string",name:"indexedKey",type:"string"},{indexed:!1,internalType:"string",name:"key",type:"string"},{indexed:!1,internalType:"string",name:"value",type:"string"}],name:"TextChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"uint64",name:"newVersion",type:"uint64"}],name:"VersionChanged",type:"event"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"contentTypes",type:"uint256"}],name:"ABI",outputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"addr",outputs:[{internalType:"address payable",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"coinType",type:"uint256"}],name:"addr",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"delegate",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"cancelOwnershipHandover",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"clearRecords",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"pendingOwner",type:"address"}],name:"completeOwnershipHandover",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"contenthash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"},{internalType:"uint16",name:"resource",type:"uint16"}],name:"dnsRecord",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[],name:"ens",outputs:[{internalType:"contract ENS",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"}],name:"hasDNSRecords",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"interfaceImplementer",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"delegate",type:"address"}],name:"isApprovedFor",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"nodehash",type:"bytes32"},{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicallWithNodeCheck",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"result",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"pendingOwner",type:"address"}],name:"ownershipHandoverExpiresAt",outputs:[{internalType:"uint256",name:"result",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"pubkey",outputs:[{internalType:"bytes32",name:"x",type:"bytes32"},{internalType:"bytes32",name:"y",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"recordVersions",outputs:[{internalType:"uint64",name:"",type:"uint64"}],stateMutability:"view",type:"function"},{inputs:[],name:"registrarController",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"requestOwnershipHandover",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes",name:"",type:"bytes"},{internalType:"bytes",name:"data",type:"bytes"}],name:"resolve",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[],name:"reverseRegistrar",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"contentType",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"setABI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"coinType",type:"uint256"},{internalType:"bytes",name:"a",type:"bytes"}],name:"setAddr",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"a",type:"address"}],name:"setAddr",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes",name:"hash",type:"bytes"}],name:"setContenthash",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes",name:"data",type:"bytes"}],name:"setDNSRecords",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes4",name:"interfaceID",type:"bytes4"},{internalType:"address",name:"implementer",type:"address"}],name:"setInterface",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"newName",type:"string"}],name:"setName",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"x",type:"bytes32"},{internalType:"bytes32",name:"y",type:"bytes32"}],name:"setPubkey",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"registrarController_",type:"address"}],name:"setRegistrarController",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"reverseRegistrar_",type:"address"}],name:"setReverseRegistrar",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"key",type:"string"},{internalType:"string",name:"value",type:"string"}],name:"setText",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes",name:"hash",type:"bytes"}],name:"setZonehash",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"key",type:"string"}],name:"text",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"zonehash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"}],SB=e=>e===ja.id?"addr":((2147483648|e)>>>0).toString(16).toLocaleUpperCase(),TB=(e,t)=>{const n=e.toLocaleLowerCase(),i=hr(n.substring(2)),s=SB(t),l=x0(`${s.toLocaleUpperCase()}.reverse`);return hr(iM(["bytes32","bytes32"],[l,i]))},OB=async({address:e,chain:t=ja})=>{const n=h2({chainId:t.id});if(!(y2({chainId:t.id})||n))return Promise.reject("ChainId not supported, name resolution is only supported on Ethereum and Base.");const l=Q0(t);if(n){const d=TB(e,Qn.id);try{const h=await l.readContract({abi:CB,address:q2[t.id],functionName:"name",args:[d]});if(h)return h}catch{}}return await Q0(ja).getEnsName({address:e})??null},nv=({address:e,chain:t=ja},n)=>{const i={},s=i.enabled,l=s===void 0?!0:s,c=i.cacheTime;return o1({queryKey:["useName",e,t.id],queryFn:async()=>await OB({address:e,chain:t}),gcTime:c,enabled:l,refetchOnWindowFocus:!1})};function Mn(e){return t=>{const n=t==null?void 0:t.type;return n&&typeof n=="object"&&"_payload"in n?n._payload.value[2]===e.name:J.isValidElement(t)&&t.type===e}}const Mx=D.jsx("svg",{"data-testid":"ock-defaultAvatarSVG",role:"img","aria-label":"ock-defaultAvatarSVG",width:"100%",height:"100%",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"h-full w-full",children:D.jsx("path",{d:"M20 40C8.9543 40 0 31.0457 0 20C0 8.9543 8.9543 0 20 0C31.0457 0 40 8.9543 40 20C40 31.0457 31.0457 40 20 40ZM25.6641 13.9974C25.6641 10.8692 23.1282 8.33333 20.0001 8.33333C16.8719 8.33333 14.336 10.8692 14.336 13.9974C14.336 17.1256 16.8719 19.6615 20.0001 19.6615C23.1282 19.6615 25.6641 17.1256 25.6641 13.9974ZM11.3453 23.362L9.53476 28.1875C12.2141 30.8475 15.9019 32.493 19.974 32.5H20.026C24.0981 32.493 27.7859 30.8475 30.4653 28.1874L28.6547 23.362C28.0052 21.625 26.3589 20.4771 24.5162 20.4318C24.4557 20.4771 22.462 21.9271 20 21.9271C17.538 21.9271 15.5443 20.4771 15.4839 20.4318C13.6412 20.462 11.9948 21.625 11.3453 23.362Z",className:ln.foreground})}),RB=D.jsx("svg",{"data-testid":"ock-defaultLoadingSVG",role:"img","aria-label":"ock-defaultLoadingSVG",width:"100%",height:"100%",viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",children:D.jsx("circle",{cx:"50",cy:"50",r:"45",stroke:"#333",fill:"none",strokeWidth:"10",strokeLinecap:"round",children:D.jsx("animateTransform",{attributeName:"transform",type:"rotate",from:"0 50 50",to:"360 50 50",dur:"1s",repeatCount:"indefinite"})})}),MB=D.jsx("svg",{role:"img","aria-label":"ock-badgeSvg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"h-full w-full",children:D.jsx("path",{d:"M8.12957 3.73002L5.11957 6.74002L3.77957 5.40002C3.49957 5.12002 3.04957 5.12002 2.76957 5.40002C2.48957 5.68002 2.48957 6.13002 2.76957 6.41002L4.10957 7.75002L4.59957 8.24002C4.90957 8.55002 5.41957 8.55002 5.72957 8.24002L9.17957 4.79002C9.45957 4.51002 9.45957 4.06002 9.17957 3.78002L9.12957 3.73002C8.84957 3.45002 8.39957 3.45002 8.11957 3.73002H8.12957Z","data-testid":"ock-badgeSvg",className:ln.inverse})});function _x({className:e}){const t="12px";return D.jsx("span",{className:Oe(tn.primary,"rounded-full border border-transparent",e),"data-testid":"ockBadge",style:{height:t,width:t,maxHeight:t,maxWidth:t},children:MB})}const rv=JSON,_B=e=>e.toUpperCase(),NB=e=>{const t={};return e.forEach((n,i)=>{t[i]=n}),t},DB=(e,t,n)=>e.document?e:{document:e,variables:t,requestHeaders:n,signal:void 0},BB=(e,t,n)=>e.query?e:{query:e,variables:t,requestHeaders:n,signal:void 0},IB=(e,t)=>e.documents?e:{documents:e,requestHeaders:t,signal:void 0};function Ey(e,t){if(!!!e)throw new Error(t)}function kB(e){return typeof e=="object"&&e!==null}function PB(e,t){if(!!!e)throw new Error("Unexpected invariant triggered.")}const LB=/\r\n|[\n\r]/g;function zm(e,t){let n=0,i=1;for(const s of e.body.matchAll(LB)){if(typeof s.index=="number"||PB(!1),s.index>=t)break;n=s.index+s[0].length,i+=1}return{line:i,column:t+1-n}}function UB(e){return Nx(e.source,zm(e.source,e.start))}function Nx(e,t){const n=e.locationOffset.column-1,i="".padStart(n)+e.body,s=t.line-1,l=e.locationOffset.line-1,c=t.line+l,f=t.line===1?n:0,d=t.column+f,h=`${e.name}:${c}:${d} +`,m=i.split(/\r\n|[\n\r]/g),w=m[s];if(w.length>120){const x=Math.floor(d/80),S=d%80,O=[];for(let T=0;T["|",T]),["|","^".padStart(S)],["|",O[x+1]]])}return h+A3([[`${c-1} |`,m[s-1]],[`${c} |`,w],["|","^".padStart(d)],[`${c+1} |`,m[s+1]]])}function A3(e){const t=e.filter(([i,s])=>s!==void 0),n=Math.max(...t.map(([i])=>i.length));return t.map(([i,s])=>i.padStart(n)+(s?" "+s:"")).join(` +`)}function FB(e){const t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}class iv extends Error{constructor(t,...n){var i,s,l;const{nodes:c,source:f,positions:d,path:h,originalError:m,extensions:w}=FB(n);super(t),this.name="GraphQLError",this.path=h??void 0,this.originalError=m??void 0,this.nodes=x3(Array.isArray(c)?c:c?[c]:void 0);const x=x3((i=this.nodes)===null||i===void 0?void 0:i.map(O=>O.loc).filter(O=>O!=null));this.source=f??(x==null||(s=x[0])===null||s===void 0?void 0:s.source),this.positions=d??(x==null?void 0:x.map(O=>O.start)),this.locations=d&&f?d.map(O=>zm(f,O)):x==null?void 0:x.map(O=>zm(O.source,O.start));const S=kB(m==null?void 0:m.extensions)?m==null?void 0:m.extensions:void 0;this.extensions=(l=w??S)!==null&&l!==void 0?l:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),m!=null&&m.stack?Object.defineProperty(this,"stack",{value:m.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,iv):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(t+=` + +`+UB(n.loc));else if(this.source&&this.locations)for(const n of this.locations)t+=` + +`+Nx(this.source,n);return t}toJSON(){const t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}}function x3(e){return e===void 0||e.length===0?void 0:e}function Sr(e,t,n){return new iv(`Syntax Error: ${n}`,{source:e,positions:[t]})}class zB{constructor(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Dx{constructor(t,n,i,s,l,c){this.kind=t,this.start=n,this.end=i,this.line=s,this.column=l,this.value=c,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const Bx={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},HB=new Set(Object.keys(Bx));function E3(e){const t=e==null?void 0:e.kind;return typeof t=="string"&&HB.has(t)}var yd;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(yd||(yd={}));var Hm;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(Hm||(Hm={}));var nt;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(nt||(nt={}));function Gm(e){return e===9||e===32}function X0(e){return e>=48&&e<=57}function Ix(e){return e>=97&&e<=122||e>=65&&e<=90}function kx(e){return Ix(e)||e===95}function GB(e){return Ix(e)||X0(e)||e===95}function QB(e){var t;let n=Number.MAX_SAFE_INTEGER,i=null,s=-1;for(let c=0;cf===0?c:c.slice(n)).slice((t=i)!==null&&t!==void 0?t:0,s+1)}function jB(e){let t=0;for(;t1&&i.slice(1).every(S=>S.length===0||Gm(S.charCodeAt(0))),c=n.endsWith('\\"""'),f=e.endsWith('"')&&!c,d=e.endsWith("\\"),h=f||d,m=!s||e.length>70||h||l||c;let w="";const x=s&&Gm(e.charCodeAt(0));return(m&&!x||l)&&(w+=` +`),w+=n,(m||h)&&(w+=` +`),'"""'+w+'"""'}var Te;(function(e){e.SOF="",e.EOF="",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(Te||(Te={}));class YB{constructor(t){const n=new Dx(Te.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==Te.EOF)do if(t.next)t=t.next;else{const n=XB(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===Te.COMMENT);return t}}function ZB(e){return e===Te.BANG||e===Te.DOLLAR||e===Te.AMP||e===Te.PAREN_L||e===Te.PAREN_R||e===Te.SPREAD||e===Te.COLON||e===Te.EQUALS||e===Te.AT||e===Te.BRACKET_L||e===Te.BRACKET_R||e===Te.BRACE_L||e===Te.PIPE||e===Te.BRACE_R}function th(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function yg(e,t){return Px(e.charCodeAt(t))&&Lx(e.charCodeAt(t+1))}function Px(e){return e>=55296&&e<=56319}function Lx(e){return e>=56320&&e<=57343}function cf(e,t){const n=e.source.body.codePointAt(t);if(n===void 0)return Te.EOF;if(n>=32&&n<=126){const i=String.fromCodePoint(n);return i==='"'?`'"'`:`"${i}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function er(e,t,n,i,s){const l=e.line,c=1+n-e.lineStart;return new Dx(t,n,i,l,c,s)}function XB(e,t){const n=e.source.body,i=n.length;let s=t;for(;s=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function eI(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:` +`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw Sr(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function tI(e,t){const n=e.source.body,i=n.length;let s=e.lineStart,l=t+3,c=l,f="";const d=[];for(;lUx?"["+lI(e)+"]":"{ "+n.map(([s,l])=>s+": "+gg(l,t)).join(", ")+" }"}function oI(e,t){if(e.length===0)return"[]";if(t.length>Ux)return"[Array]";const n=Math.min(rI,e.length),i=e.length-n,s=[];for(let l=0;l1&&s.push(`... ${i} more items`),"["+s.join(", ")+"]"}function lI(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){const n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}const cI=globalThis.process&&!0,uI=cI?function(t,n){return t instanceof n}:function(t,n){if(t instanceof n)return!0;if(typeof t=="object"&&t!==null){var i;const s=n.prototype[Symbol.toStringTag],l=Symbol.toStringTag in t?t[Symbol.toStringTag]:(i=t.constructor)===null||i===void 0?void 0:i.name;if(s===l){const c=av(t);throw new Error(`Cannot use ${s} "${c}" from another module or realm. + +Ensure that there is only one instance of "graphql" in the node_modules +directory. If different versions of "graphql" are the dependencies of other +relied on modules, use "resolutions" to ensure only one version is installed. + +https://yarnpkg.com/en/docs/selective-version-resolutions + +Duplicate "graphql" modules cannot be used at the same time since different +versions may have different capabilities and behavior. The data from one +version used in the function from another could produce confusing and +spurious results.`)}}return!1};class Fx{constructor(t,n="GraphQL request",i={line:1,column:1}){typeof t=="string"||Ey(!1,`Body must be a string. Received: ${av(t)}.`),this.body=t,this.name=n,this.locationOffset=i,this.locationOffset.line>0||Ey(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Ey(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function fI(e){return uI(e,Fx)}function dI(e,t){const n=new hI(e,t),i=n.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:n.tokenCount}),i}class hI{constructor(t,n={}){const i=fI(t)?t:new Fx(t);this._lexer=new YB(i),this._options=n,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const t=this.expectToken(Te.NAME);return this.node(t,{kind:nt.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:nt.DOCUMENT,definitions:this.many(Te.SOF,this.parseDefinition,Te.EOF)})}parseDefinition(){if(this.peek(Te.BRACE_L))return this.parseOperationDefinition();const t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(n.kind===Te.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(t)throw Sr(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){const t=this._lexer.token;if(this.peek(Te.BRACE_L))return this.node(t,{kind:nt.OPERATION_DEFINITION,operation:yd.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseOperationType();let i;return this.peek(Te.NAME)&&(i=this.parseName()),this.node(t,{kind:nt.OPERATION_DEFINITION,operation:n,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const t=this.expectToken(Te.NAME);switch(t.value){case"query":return yd.QUERY;case"mutation":return yd.MUTATION;case"subscription":return yd.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(Te.PAREN_L,this.parseVariableDefinition,Te.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:nt.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(Te.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(Te.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const t=this._lexer.token;return this.expectToken(Te.DOLLAR),this.node(t,{kind:nt.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:nt.SELECTION_SET,selections:this.many(Te.BRACE_L,this.parseSelection,Te.BRACE_R)})}parseSelection(){return this.peek(Te.SPREAD)?this.parseFragment():this.parseField()}parseField(){const t=this._lexer.token,n=this.parseName();let i,s;return this.expectOptionalToken(Te.COLON)?(i=n,s=this.parseName()):s=n,this.node(t,{kind:nt.FIELD,alias:i,name:s,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(Te.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){const n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(Te.PAREN_L,n,Te.PAREN_R)}parseArgument(t=!1){const n=this._lexer.token,i=this.parseName();return this.expectToken(Te.COLON),this.node(n,{kind:nt.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const t=this._lexer.token;this.expectToken(Te.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(Te.NAME)?this.node(t,{kind:nt.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:nt.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:nt.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:nt.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){const n=this._lexer.token;switch(n.kind){case Te.BRACKET_L:return this.parseList(t);case Te.BRACE_L:return this.parseObject(t);case Te.INT:return this.advanceLexer(),this.node(n,{kind:nt.INT,value:n.value});case Te.FLOAT:return this.advanceLexer(),this.node(n,{kind:nt.FLOAT,value:n.value});case Te.STRING:case Te.BLOCK_STRING:return this.parseStringLiteral();case Te.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:nt.BOOLEAN,value:!0});case"false":return this.node(n,{kind:nt.BOOLEAN,value:!1});case"null":return this.node(n,{kind:nt.NULL});default:return this.node(n,{kind:nt.ENUM,value:n.value})}case Te.DOLLAR:if(t)if(this.expectToken(Te.DOLLAR),this._lexer.token.kind===Te.NAME){const i=this._lexer.token.value;throw Sr(this._lexer.source,n.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:nt.STRING,value:t.value,block:t.kind===Te.BLOCK_STRING})}parseList(t){const n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:nt.LIST,values:this.any(Te.BRACKET_L,n,Te.BRACKET_R)})}parseObject(t){const n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:nt.OBJECT,fields:this.any(Te.BRACE_L,n,Te.BRACE_R)})}parseObjectField(t){const n=this._lexer.token,i=this.parseName();return this.expectToken(Te.COLON),this.node(n,{kind:nt.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(t){const n=[];for(;this.peek(Te.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){const n=this._lexer.token;return this.expectToken(Te.AT),this.node(n,{kind:nt.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){const t=this._lexer.token;let n;if(this.expectOptionalToken(Te.BRACKET_L)){const i=this.parseTypeReference();this.expectToken(Te.BRACKET_R),n=this.node(t,{kind:nt.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(Te.BANG)?this.node(t,{kind:nt.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:nt.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(Te.STRING)||this.peek(Te.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const i=this.parseConstDirectives(),s=this.many(Te.BRACE_L,this.parseOperationTypeDefinition,Te.BRACE_R);return this.node(t,{kind:nt.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:s})}parseOperationTypeDefinition(){const t=this._lexer.token,n=this.parseOperationType();this.expectToken(Te.COLON);const i=this.parseNamedType();return this.node(t,{kind:nt.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const i=this.parseName(),s=this.parseConstDirectives();return this.node(t,{kind:nt.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:s})}parseObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const i=this.parseName(),s=this.parseImplementsInterfaces(),l=this.parseConstDirectives(),c=this.parseFieldsDefinition();return this.node(t,{kind:nt.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:s,directives:l,fields:c})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(Te.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(Te.BRACE_L,this.parseFieldDefinition,Te.BRACE_R)}parseFieldDefinition(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),s=this.parseArgumentDefs();this.expectToken(Te.COLON);const l=this.parseTypeReference(),c=this.parseConstDirectives();return this.node(t,{kind:nt.FIELD_DEFINITION,description:n,name:i,arguments:s,type:l,directives:c})}parseArgumentDefs(){return this.optionalMany(Te.PAREN_L,this.parseInputValueDef,Te.PAREN_R)}parseInputValueDef(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(Te.COLON);const s=this.parseTypeReference();let l;this.expectOptionalToken(Te.EQUALS)&&(l=this.parseConstValueLiteral());const c=this.parseConstDirectives();return this.node(t,{kind:nt.INPUT_VALUE_DEFINITION,description:n,name:i,type:s,defaultValue:l,directives:c})}parseInterfaceTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const i=this.parseName(),s=this.parseImplementsInterfaces(),l=this.parseConstDirectives(),c=this.parseFieldsDefinition();return this.node(t,{kind:nt.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:s,directives:l,fields:c})}parseUnionTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const i=this.parseName(),s=this.parseConstDirectives(),l=this.parseUnionMemberTypes();return this.node(t,{kind:nt.UNION_TYPE_DEFINITION,description:n,name:i,directives:s,types:l})}parseUnionMemberTypes(){return this.expectOptionalToken(Te.EQUALS)?this.delimitedMany(Te.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const i=this.parseName(),s=this.parseConstDirectives(),l=this.parseEnumValuesDefinition();return this.node(t,{kind:nt.ENUM_TYPE_DEFINITION,description:n,name:i,directives:s,values:l})}parseEnumValuesDefinition(){return this.optionalMany(Te.BRACE_L,this.parseEnumValueDefinition,Te.BRACE_R)}parseEnumValueDefinition(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),s=this.parseConstDirectives();return this.node(t,{kind:nt.ENUM_VALUE_DEFINITION,description:n,name:i,directives:s})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw Sr(this._lexer.source,this._lexer.token.start,`${ly(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const i=this.parseName(),s=this.parseConstDirectives(),l=this.parseInputFieldsDefinition();return this.node(t,{kind:nt.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:s,fields:l})}parseInputFieldsDefinition(){return this.optionalMany(Te.BRACE_L,this.parseInputValueDef,Te.BRACE_R)}parseTypeSystemExtension(){const t=this._lexer.lookahead();if(t.kind===Te.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.optionalMany(Te.BRACE_L,this.parseOperationTypeDefinition,Te.BRACE_R);if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:nt.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();if(i.length===0)throw this.unexpected();return this.node(t,{kind:nt.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),l=this.parseFieldsDefinition();if(i.length===0&&s.length===0&&l.length===0)throw this.unexpected();return this.node(t,{kind:nt.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:s,fields:l})}parseInterfaceTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),l=this.parseFieldsDefinition();if(i.length===0&&s.length===0&&l.length===0)throw this.unexpected();return this.node(t,{kind:nt.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:s,fields:l})}parseUnionTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),s=this.parseUnionMemberTypes();if(i.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:nt.UNION_TYPE_EXTENSION,name:n,directives:i,types:s})}parseEnumTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();if(i.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:nt.ENUM_TYPE_EXTENSION,name:n,directives:i,values:s})}parseInputObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();if(i.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:nt.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:s})}parseDirectiveDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(Te.AT);const i=this.parseName(),s=this.parseArgumentDefs(),l=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const c=this.parseDirectiveLocations();return this.node(t,{kind:nt.DIRECTIVE_DEFINITION,description:n,name:i,arguments:s,repeatable:l,locations:c})}parseDirectiveLocations(){return this.delimitedMany(Te.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(Hm,n.value))return n;throw this.unexpected(t)}node(t,n){return this._options.noLocation!==!0&&(n.loc=new zB(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){const n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw Sr(this._lexer.source,n.start,`Expected ${zx(t)}, found ${ly(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){const n=this._lexer.token;if(n.kind===Te.NAME&&n.value===t)this.advanceLexer();else throw Sr(this._lexer.source,n.start,`Expected "${t}", found ${ly(n)}.`)}expectOptionalKeyword(t){const n=this._lexer.token;return n.kind===Te.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){const n=t??this._lexer.token;return Sr(this._lexer.source,n.start,`Unexpected ${ly(n)}.`)}any(t,n,i){this.expectToken(t);const s=[];for(;!this.expectOptionalToken(i);)s.push(n.call(this));return s}optionalMany(t,n,i){if(this.expectOptionalToken(t)){const s=[];do s.push(n.call(this));while(!this.expectOptionalToken(i));return s}return[]}many(t,n,i){this.expectToken(t);const s=[];do s.push(n.call(this));while(!this.expectOptionalToken(i));return s}delimitedMany(t,n){this.expectOptionalToken(t);const i=[];do i.push(n.call(this));while(this.expectOptionalToken(t));return i}advanceLexer(){const{maxTokens:t}=this._options,n=this._lexer.advance();if(n.kind!==Te.EOF&&(++this._tokenCounter,t!==void 0&&this._tokenCounter>t))throw Sr(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}}function ly(e){const t=e.value;return zx(e.kind)+(t!=null?` "${t}"`:"")}function zx(e){return ZB(e)?`"${e}"`:e}function yI(e){return`"${e.replace(gI,pI)}"`}const gI=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function pI(e){return bI[e.charCodeAt(0)]}const bI=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],mI=Object.freeze({});function vI(e,t,n=Bx){const i=new Map;for(const k of Object.values(nt))i.set(k,wI(t,k));let s,l=Array.isArray(e),c=[e],f=-1,d=[],h=e,m,w;const x=[],S=[];do{f++;const k=f===c.length,F=k&&d.length!==0;if(k){if(m=S.length===0?void 0:x[x.length-1],h=w,w=S.pop(),F)if(l){h=h.slice();let j=0;for(const[z,H]of d){const V=z-j;H===null?(h.splice(V,1),j++):h[V]=H}}else{h=Object.defineProperties({},Object.getOwnPropertyDescriptors(h));for(const[j,z]of d)h[j]=z}f=s.index,c=s.keys,d=s.edits,l=s.inArray,s=s.prev}else if(w){if(m=l?f:c[f],h=w[m],h==null)continue;x.push(m)}let U;if(!Array.isArray(h)){var O,T;E3(h)||Ey(!1,`Invalid AST Node: ${av(h)}.`);const j=k?(O=i.get(h.kind))===null||O===void 0?void 0:O.leave:(T=i.get(h.kind))===null||T===void 0?void 0:T.enter;if(U=j==null?void 0:j.call(t,h,m,w,x,S),U===mI)break;if(U===!1){if(!k){x.pop();continue}}else if(U!==void 0&&(d.push([m,U]),!k))if(E3(U))h=U;else{x.pop();continue}}if(U===void 0&&F&&d.push([m,h]),k)x.pop();else{var R;s={inArray:l,index:f,keys:c,edits:d,prev:s},l=Array.isArray(h),c=l?h:(R=n[h.kind])!==null&&R!==void 0?R:[],f=-1,d=[],w&&S.push(w),w=h}}while(s!==void 0);return d.length!==0?d[d.length-1][1]:e}function wI(e,t){const n=e[t];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function AI(e){return vI(e,EI)}const xI=80,EI={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>Ve(e.definitions,` + +`)},OperationDefinition:{leave(e){const t=Tt("(",Ve(e.variableDefinitions,", "),")"),n=Ve([e.operation,Ve([e.name,t]),Ve(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:i})=>e+": "+t+Tt(" = ",n)+Tt(" ",Ve(i," "))},SelectionSet:{leave:({selections:e})=>ds(e)},Field:{leave({alias:e,name:t,arguments:n,directives:i,selectionSet:s}){const l=Tt("",e,": ")+t;let c=l+Tt("(",Ve(n,", "),")");return c.length>xI&&(c=l+Tt(`( +`,Cy(Ve(n,` +`)),` +)`)),Ve([c,Ve(i," "),s]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+Tt(" ",Ve(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>Ve(["...",Tt("on ",e),Ve(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:i,selectionSet:s})=>`fragment ${e}${Tt("(",Ve(n,", "),")")} on ${t} ${Tt("",Ve(i," ")," ")}`+s},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?VB(e):yI(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+Ve(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+Ve(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+Tt("(",Ve(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>Tt("",e,` +`)+Ve(["schema",Ve(t," "),ds(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>Tt("",e,` +`)+Ve(["scalar",t,Ve(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:i,fields:s})=>Tt("",e,` +`)+Ve(["type",t,Tt("implements ",Ve(n," & ")),Ve(i," "),ds(s)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:i,directives:s})=>Tt("",e,` +`)+t+(S3(n)?Tt(`( +`,Cy(Ve(n,` +`)),` +)`):Tt("(",Ve(n,", "),")"))+": "+i+Tt(" ",Ve(s," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:i,directives:s})=>Tt("",e,` +`)+Ve([t+": "+n,Tt("= ",i),Ve(s," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:i,fields:s})=>Tt("",e,` +`)+Ve(["interface",t,Tt("implements ",Ve(n," & ")),Ve(i," "),ds(s)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:i})=>Tt("",e,` +`)+Ve(["union",t,Ve(n," "),Tt("= ",Ve(i," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:i})=>Tt("",e,` +`)+Ve(["enum",t,Ve(n," "),ds(i)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>Tt("",e,` +`)+Ve([t,Ve(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:i})=>Tt("",e,` +`)+Ve(["input",t,Ve(n," "),ds(i)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:i,locations:s})=>Tt("",e,` +`)+"directive @"+t+(S3(n)?Tt(`( +`,Cy(Ve(n,` +`)),` +)`):Tt("(",Ve(n,", "),")"))+(i?" repeatable":"")+" on "+Ve(s," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>Ve(["extend schema",Ve(e," "),ds(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>Ve(["extend scalar",e,Ve(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:i})=>Ve(["extend type",e,Tt("implements ",Ve(t," & ")),Ve(n," "),ds(i)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:i})=>Ve(["extend interface",e,Tt("implements ",Ve(t," & ")),Ve(n," "),ds(i)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>Ve(["extend union",e,Ve(t," "),Tt("= ",Ve(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>Ve(["extend enum",e,Ve(t," "),ds(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>Ve(["extend input",e,Ve(t," "),ds(n)]," ")}};function Ve(e,t=""){var n;return(n=e==null?void 0:e.filter(i=>i).join(t))!==null&&n!==void 0?n:""}function ds(e){return Tt(`{ +`,Cy(Ve(e,` +`)),` +}`)}function Tt(e,t,n=""){return t!=null&&t!==""?e+t+n:""}function Cy(e){return Tt(" ",e.replace(/\n/g,` + `))}function S3(e){var t;return(t=e==null?void 0:e.some(n=>n.includes(` +`)))!==null&&t!==void 0?t:!1}const T3=e=>{var i,s;let t;const n=e.definitions.filter(l=>l.kind==="OperationDefinition");return n.length===1&&(t=(s=(i=n[0])==null?void 0:i.name)==null?void 0:s.value),t},nb=e=>{if(typeof e=="string"){let n;try{const i=dI(e);n=T3(i)}catch{}return{query:e,operationName:n}}const t=T3(e);return{query:AI(e),operationName:t}};class S0 extends Error{constructor(t,n){const i=`${S0.extractMessage(t)}: ${JSON.stringify({response:t,request:n})}`;super(i),Object.setPrototypeOf(this,S0.prototype),this.response=t,this.request=n,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,S0)}static extractMessage(t){var n,i;return((i=(n=t.errors)==null?void 0:n[0])==null?void 0:i.message)??`GraphQL Error (Code: ${t.status})`}}var cy={exports:{}},O3;function CI(){return O3||(O3=1,function(e,t){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof J1<"u"&&J1,i=function(){function l(){this.fetch=!1,this.DOMException=n.DOMException}return l.prototype=n,new l}();(function(l){(function(c){var f=typeof l<"u"&&l||typeof self<"u"&&self||typeof J1<"u"&&J1||{},d={searchParams:"URLSearchParams"in f,iterable:"Symbol"in f&&"iterator"in Symbol,blob:"FileReader"in f&&"Blob"in f&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in f,arrayBuffer:"ArrayBuffer"in f};function h(W){return W&&DataView.prototype.isPrototypeOf(W)}if(d.arrayBuffer)var m=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],w=ArrayBuffer.isView||function(W){return W&&m.indexOf(Object.prototype.toString.call(W))>-1};function x(W){if(typeof W!="string"&&(W=String(W)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(W)||W==="")throw new TypeError('Invalid character in header field name: "'+W+'"');return W.toLowerCase()}function S(W){return typeof W!="string"&&(W=String(W)),W}function O(W){var L={next:function(){var te=W.shift();return{done:te===void 0,value:te}}};return d.iterable&&(L[Symbol.iterator]=function(){return L}),L}function T(W){this.map={},W instanceof T?W.forEach(function(L,te){this.append(te,L)},this):Array.isArray(W)?W.forEach(function(L){if(L.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+L.length);this.append(L[0],L[1])},this):W&&Object.getOwnPropertyNames(W).forEach(function(L){this.append(L,W[L])},this)}T.prototype.append=function(W,L){W=x(W),L=S(L);var te=this.map[W];this.map[W]=te?te+", "+L:L},T.prototype.delete=function(W){delete this.map[x(W)]},T.prototype.get=function(W){return W=x(W),this.has(W)?this.map[W]:null},T.prototype.has=function(W){return this.map.hasOwnProperty(x(W))},T.prototype.set=function(W,L){this.map[x(W)]=S(L)},T.prototype.forEach=function(W,L){for(var te in this.map)this.map.hasOwnProperty(te)&&W.call(L,this.map[te],te,this)},T.prototype.keys=function(){var W=[];return this.forEach(function(L,te){W.push(te)}),O(W)},T.prototype.values=function(){var W=[];return this.forEach(function(L){W.push(L)}),O(W)},T.prototype.entries=function(){var W=[];return this.forEach(function(L,te){W.push([te,L])}),O(W)},d.iterable&&(T.prototype[Symbol.iterator]=T.prototype.entries);function R(W){if(!W._noBody){if(W.bodyUsed)return Promise.reject(new TypeError("Already read"));W.bodyUsed=!0}}function k(W){return new Promise(function(L,te){W.onload=function(){L(W.result)},W.onerror=function(){te(W.error)}})}function F(W){var L=new FileReader,te=k(L);return L.readAsArrayBuffer(W),te}function U(W){var L=new FileReader,te=k(L),ge=/charset=([A-Za-z0-9_-]+)/.exec(W.type),pe=ge?ge[1]:"utf-8";return L.readAsText(W,pe),te}function j(W){for(var L=new Uint8Array(W),te=new Array(L.length),ge=0;ge-1?L:W}function Q(W,L){if(!(this instanceof Q))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');L=L||{};var te=L.body;if(W instanceof Q){if(W.bodyUsed)throw new TypeError("Already read");this.url=W.url,this.credentials=W.credentials,L.headers||(this.headers=new T(W.headers)),this.method=W.method,this.mode=W.mode,this.signal=W.signal,!te&&W._bodyInit!=null&&(te=W._bodyInit,W.bodyUsed=!0)}else this.url=String(W);if(this.credentials=L.credentials||this.credentials||"same-origin",(L.headers||!this.headers)&&(this.headers=new T(L.headers)),this.method=K(L.method||this.method||"GET"),this.mode=L.mode||this.mode||null,this.signal=L.signal||this.signal||function(){if("AbortController"in f){var P=new AbortController;return P.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&te)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(te),(this.method==="GET"||this.method==="HEAD")&&(L.cache==="no-store"||L.cache==="no-cache")){var ge=/([?&])_=[^&]*/;if(ge.test(this.url))this.url=this.url.replace(ge,"$1_="+new Date().getTime());else{var pe=/\?/;this.url+=(pe.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}Q.prototype.clone=function(){return new Q(this,{body:this._bodyInit})};function le(W){var L=new FormData;return W.trim().split("&").forEach(function(te){if(te){var ge=te.split("="),pe=ge.shift().replace(/\+/g," "),P=ge.join("=").replace(/\+/g," ");L.append(decodeURIComponent(pe),decodeURIComponent(P))}}),L}function ue(W){var L=new T,te=W.replace(/\r?\n[\t ]+/g," ");return te.split("\r").map(function(ge){return ge.indexOf(` +`)===0?ge.substr(1,ge.length):ge}).forEach(function(ge){var pe=ge.split(":"),P=pe.shift().trim();if(P){var Z=pe.join(":").trim();try{L.append(P,Z)}catch(Ie){console.warn("Response "+Ie.message)}}}),L}H.call(Q.prototype);function ae(W,L){if(!(this instanceof ae))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(L||(L={}),this.type="default",this.status=L.status===void 0?200:L.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=L.statusText===void 0?"":""+L.statusText,this.headers=new T(L.headers),this.url=L.url||"",this._initBody(W)}H.call(ae.prototype),ae.prototype.clone=function(){return new ae(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new T(this.headers),url:this.url})},ae.error=function(){var W=new ae(null,{status:200,statusText:""});return W.ok=!1,W.status=0,W.type="error",W};var me=[301,302,303,307,308];ae.redirect=function(W,L){if(me.indexOf(L)===-1)throw new RangeError("Invalid status code");return new ae(null,{status:L,headers:{location:W}})},c.DOMException=f.DOMException;try{new c.DOMException}catch{c.DOMException=function(L,te){this.message=L,this.name=te;var ge=Error(L);this.stack=ge.stack},c.DOMException.prototype=Object.create(Error.prototype),c.DOMException.prototype.constructor=c.DOMException}function ce(W,L){return new Promise(function(te,ge){var pe=new Q(W,L);if(pe.signal&&pe.signal.aborted)return ge(new c.DOMException("Aborted","AbortError"));var P=new XMLHttpRequest;function Z(){P.abort()}P.onload=function(){var we={statusText:P.statusText,headers:ue(P.getAllResponseHeaders()||"")};pe.url.indexOf("file://")===0&&(P.status<200||P.status>599)?we.status=200:we.status=P.status,we.url="responseURL"in P?P.responseURL:we.headers.get("X-Request-URL");var Pe="response"in P?P.response:P.responseText;setTimeout(function(){te(new ae(Pe,we))},0)},P.onerror=function(){setTimeout(function(){ge(new TypeError("Network request failed"))},0)},P.ontimeout=function(){setTimeout(function(){ge(new TypeError("Network request timed out"))},0)},P.onabort=function(){setTimeout(function(){ge(new c.DOMException("Aborted","AbortError"))},0)};function Ie(we){try{return we===""&&f.location.href?f.location.href:we}catch{return we}}if(P.open(pe.method,Ie(pe.url),!0),pe.credentials==="include"?P.withCredentials=!0:pe.credentials==="omit"&&(P.withCredentials=!1),"responseType"in P&&(d.blob?P.responseType="blob":d.arrayBuffer&&(P.responseType="arraybuffer")),L&&typeof L.headers=="object"&&!(L.headers instanceof T||f.Headers&&L.headers instanceof f.Headers)){var De=[];Object.getOwnPropertyNames(L.headers).forEach(function(we){De.push(x(we)),P.setRequestHeader(we,S(L.headers[we]))}),pe.headers.forEach(function(we,Pe){De.indexOf(Pe)===-1&&P.setRequestHeader(Pe,we)})}else pe.headers.forEach(function(we,Pe){P.setRequestHeader(Pe,we)});pe.signal&&(pe.signal.addEventListener("abort",Z),P.onreadystatechange=function(){P.readyState===4&&pe.signal.removeEventListener("abort",Z)}),P.send(typeof pe._bodyInit>"u"?null:pe._bodyInit)})}return ce.polyfill=!0,f.fetch||(f.fetch=ce,f.Headers=T,f.Request=Q,f.Response=ae),c.Headers=T,c.Request=Q,c.Response=ae,c.fetch=ce,Object.defineProperty(c,"__esModule",{value:!0}),c})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var s=n.fetch?n:i;t=s.fetch,t.default=s.fetch,t.fetch=s.fetch,t.Headers=s.Headers,t.Request=s.Request,t.Response=s.Response,e.exports=t}(cy,cy.exports)),cy.exports}var Ly=CI();const Sy=e1(Ly),SI=xE({__proto__:null,default:Sy},[Ly]),od=e=>{let t={};return e&&(typeof Headers<"u"&&e instanceof Headers||SI&&Ly.Headers&&e instanceof Ly.Headers?t=NB(e):Array.isArray(e)?e.forEach(([n,i])=>{n&&i!==void 0&&(t[n]=i)}):t=e),t},R3=e=>e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),TI=e=>{if(!Array.isArray(e.query)){const i=e,s=[`query=${encodeURIComponent(R3(i.query))}`];return e.variables&&s.push(`variables=${encodeURIComponent(i.jsonSerializer.stringify(i.variables))}`),i.operationName&&s.push(`operationName=${encodeURIComponent(i.operationName)}`),s.join("&")}if(typeof e.variables<"u"&&!Array.isArray(e.variables))throw new Error("Cannot create query with given variable type, array expected");const t=e,n=e.query.reduce((i,s,l)=>(i.push({query:R3(s),variables:t.variables?t.jsonSerializer.stringify(t.variables[l]):void 0}),i),[]);return`query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`},OI=e=>async t=>{const{url:n,query:i,variables:s,operationName:l,fetch:c,fetchOptions:f,middleware:d}=t,h={...t.headers};let m="",w;e==="POST"?(w=MI(i,s,l,f.jsonSerializer),typeof w=="string"&&(h["Content-Type"]="application/json")):m=TI({query:i,variables:s,operationName:l,jsonSerializer:f.jsonSerializer??rv});const x={method:e,headers:h,body:w,...f};let S=n,O=x;if(d){const T=await Promise.resolve(d({...x,url:n,operationName:l,variables:s})),{url:R,...k}=T;S=R,O=k}return m&&(S=`${S}?${m}`),await c(S,O)};class RI{constructor(t,n={}){this.url=t,this.requestConfig=n,this.rawRequest=async(...i)=>{const[s,l,c]=i,f=BB(s,l,c),{headers:d,fetch:h=Sy,method:m="POST",requestMiddleware:w,responseMiddleware:x,...S}=this.requestConfig,{url:O}=this;f.signal!==void 0&&(S.signal=f.signal);const{operationName:T}=nb(f.query);return rb({url:O,query:f.query,variables:f.variables,headers:{...od(ib(d)),...od(f.requestHeaders)},operationName:T,fetch:h,method:m,fetchOptions:S,middleware:w}).then(R=>(x&&x(R),R)).catch(R=>{throw x&&x(R),R})}}async request(t,...n){const[i,s]=n,l=DB(t,i,s),{headers:c,fetch:f=Sy,method:d="POST",requestMiddleware:h,responseMiddleware:m,...w}=this.requestConfig,{url:x}=this;l.signal!==void 0&&(w.signal=l.signal);const{query:S,operationName:O}=nb(l.document);return rb({url:x,query:S,variables:l.variables,headers:{...od(ib(c)),...od(l.requestHeaders)},operationName:O,fetch:f,method:d,fetchOptions:w,middleware:h}).then(T=>(m&&m(T),T.data)).catch(T=>{throw m&&m(T),T})}batchRequests(t,n){const i=IB(t,n),{headers:s,...l}=this.requestConfig;i.signal!==void 0&&(l.signal=i.signal);const c=i.documents.map(({document:d})=>nb(d).query),f=i.documents.map(({variables:d})=>d);return rb({url:this.url,query:c,variables:f,headers:{...od(ib(s)),...od(i.requestHeaders)},operationName:void 0,fetch:this.requestConfig.fetch??Sy,method:this.requestConfig.method||"POST",fetchOptions:l,middleware:this.requestConfig.requestMiddleware}).then(d=>(this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(d),d.data)).catch(d=>{throw this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(d),d})}setHeaders(t){return this.requestConfig.headers=t,this}setHeader(t,n){const{headers:i}=this.requestConfig;return i?i[t]=n:this.requestConfig.headers={[t]:n},this}setEndpoint(t){return this.url=t,this}}const rb=async e=>{const{query:t,variables:n,fetchOptions:i}=e,s=OI(_B(e.method??"post")),l=Array.isArray(e.query),c=await s(e),f=await _I(c,i.jsonSerializer??rv),d=Array.isArray(f)?!f.some(({data:m})=>!m):!!f.data,h=Array.isArray(f)||!f.errors||Array.isArray(f.errors)&&!f.errors.length||i.errorPolicy==="all"||i.errorPolicy==="ignore";if(c.ok&&h&&d){const{errors:m,...w}=(Array.isArray(f),f),x=i.errorPolicy==="ignore"?w:f;return{...l?{data:x}:x,headers:c.headers,status:c.status}}else{const m=typeof f=="string"?{error:f}:f;throw new S0({...m,status:c.status,headers:c.headers},{query:t,variables:n})}},MI=(e,t,n,i)=>{const s=i??rv;if(!Array.isArray(e))return s.stringify({query:e,variables:t,operationName:n});if(typeof t<"u"&&!Array.isArray(t))throw new Error("Cannot create request body with given variable type, array expected");const l=e.reduce((c,f,d)=>(c.push({query:f,variables:t?t[d]:void 0}),c),[]);return s.stringify(l)},_I=async(e,t)=>{let n;return e.headers.forEach((i,s)=>{s.toLowerCase()==="content-type"&&(n=i)}),n&&(n.toLowerCase().startsWith("application/json")||n.toLowerCase().startsWith("application/graphql+json")||n.toLowerCase().startsWith("application/graphql-response+json"))?t.parse(await e.text()):e.text()},ib=e=>typeof e=="function"?e():e,NI=(e,...t)=>e.reduce((n,i,s)=>`${n}${i}${s in t?String(t[s]):""}`,""),M3={id:Qn.id,easGraphqlAPI:"https://base.easscan.org/graphql",schemaUids:["0x1801901fabd0e6189356b4fb52bb0ab855276d84f7ec140839fbd1f6801ca065","0xf8b05c79f090979bf4a80270aba232dff11a10d9ca55c4f88de95317970f0de9"]},_3={id:vl.id,easGraphqlAPI:"https://base-sepolia.easscan.org/graphql",schemaUids:["0xef54ae90f47a187acc050ce631c55584fd4273c0ca9456ab21750921c3a84028","0x2f34a2ffe5f87b2f45fbc7c784896b768d77261e2f24f77341ae43751c765a69"]},N3={id:d2.id,easGraphqlAPI:"https://optimism.easscan.org/graphql",schemaUids:["0xac4c92fc5c7babed88f78a917cdbcdc1c496a8f4ab2d5b2ec29402736b2cf929","0x6ab5d34260fca0cfcf0e76e96d439cace6aa7c3c019d7c4580ed52c6845e9c89","0x401a80196f3805c57b00482ae2b575a9f270562b6b6de7711af9837f08fa0faf"]},Hx={[M3.id]:M3,[_3.id]:_3,[N3.id]:N3};function DI(e){return e.id in Hx}function BI(e){var t;return((t=Hx[e.id])==null?void 0:t.easGraphqlAPI)??""}function II(e){const t=BI(e);return new RI(t)}const kI=NI` + query AttestationsForUsers( + $where: AttestationWhereInput + $distinct: [AttestationScalarFieldEnum!] + $take: Int + ) { + attestations(where: $where, distinct: $distinct, take: $take) { + id + txid + schemaId + attester + recipient + revoked + revocationTime + expirationTime + time + timeCreated + decodedDataJson + } + } +`;function PI(e,t){const i={recipient:{equals:ii(e)},revoked:{equals:t.revoked}};return typeof t.expirationTime=="number"&&(i.OR=[{expirationTime:{equals:0}},{expirationTime:{gt:t.expirationTime}}]),t!=null&&t.schemas&&t.schemas.length>0&&(i.schemaId={in:t.schemas}),{where:{AND:[i]},distinct:["schemaId"],take:t.limit}}async function LI(e,t,n){const i=II(t),s=PI(e,n);return(await i.request(kI,s)).attestations}function D3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function B3(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,i=Array(t);n{(async()=>{const d=await HI(e,t,{schemas:[n]});c(d)})()},[e,t,n]),l}function Gx({children:e,address:t}){const n=Vc(),i=n.chain,s=n.schemaId,l=eh(),c=l.schemaId,f=l.address;if(!c&&!s)throw new Error("Name: a SchemaId must be provided to the OnchainKitProvider or Identity component.");return ZI({address:t??f,chain:i,schemaId:c??s}).length===0?null:e}const XI=["address","chain","className","defaultComponent","loadingComponent","children"];function k3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function WI(e){for(var t=1;tJ.Children.toArray(f).find(Mn(_x)),[f]),z=l||Mx,H=c||RB;if(R||U)return D.jsx("div",{className:Oe("h-8 w-8 overflow-hidden rounded-full",s),children:H});const V=T&&F;return D.jsxs("div",{className:"relative",children:[D.jsx("div",{"data-testid":"ockAvatar_ImageContainer",className:Oe("h-10 w-10 overflow-hidden rounded-full",s),children:V?D.jsx("img",WI({className:"min-h-full min-w-full object-cover","data-testid":"ockAvatar_Image",loading:"lazy",width:"100%",height:"100%",decoding:"async",src:F,alt:T},d)):D.jsx("div",{className:Oe(ot.default,"h-full w-full border"),children:z})}),j&&D.jsx(Gx,{address:x,children:D.jsx("div",{"data-testid":"ockAvatar_BadgeContainer",className:"-bottom-0.5 -right-0.5 absolute flex h-[15px] w-[15px] items-center justify-center rounded-full bg-transparent",children:D.jsx("div",{className:"flex h-3 w-3 items-center justify-center",children:j})})})]})}function W0(e,t){var s;if(e==="0")return e;const n=Number.parseFloat(e),i=(s=Number(n))==null?void 0:s.toFixed(t).replace(/0+$/,"");return n>0&&Number.parseFloat(i)===0?"0":i}const Qx=3,tk="SWAP_ERROR",nk="SWAP_QUOTE_ERROR",rk="SWAP_BALANCE_ERROR",jx="SWAP_QUOTE_LOW_LIQUIDITY_ERROR",ik="0x000000000022D473030F116dDEE9F6B43aC78BA3",Vx="TOO_MANY_REQUESTS_ERROR",ak="UNCAUGHT_SWAP_QUOTE_ERROR",sk="UNCAUGHT_SWAP_ERROR",ok="0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD",lk="USER_REJECTED",Yx="UNSUPPORTED_AMOUNT_REFERENCE_ERROR";let ha=function(e){return e.BALANCE_ERROR="Error fetching token balance",e.CONFIRM_IN_WALLET="Confirm in wallet",e.FETCHING_QUOTE="Fetching quote...",e.FETCHING_BALANCE="Fetching balance...",e.INCOMPLETE_FIELD="Complete the fields to continue",e.INSUFFICIENT_BALANCE="Insufficient balance",e.LOW_LIQUIDITY="Insufficient liquidity for this trade.",e.SWAP_IN_PROGRESS="Swap in progress...",e.TOO_MANY_REQUESTS="Too many requests. Please try again later.",e.USER_REJECTED="User rejected the transaction",e.UNSUPPORTED_AMOUNT_REFERENCE="useAggregator does not support amountReference: to, please use useAggregator: false",e}({});function Gd(e,t){return t===-32001?Vx:t===-32602?jx:e==="uncaught-swap"?sk:e==="uncaught-quote"?ak:e==="quote"?nk:e==="balance"?rk:tk}const ck=18;function Zx(e){const t=gN({address:e});return J.useMemo(()=>{var l,c,f,d;let n;if(t!=null&&t.error&&(n={code:Gd("balance"),error:(l=t==null?void 0:t.error)==null?void 0:l.message,message:""}),!((c=t==null?void 0:t.data)!=null&&c.value)&&((f=t==null?void 0:t.data)==null?void 0:f.value)!==0n)return{convertedBalance:"",error:n,response:t,roundedBalance:""};const i=jd((d=t==null?void 0:t.data)==null?void 0:d.value,ck),s=W0(i,8);return{convertedBalance:i,error:n,response:t,roundedBalance:s}},[t])}function Xx({address:e,className:t}){const n=eh(),i=n.address;if(!i&&!e)return console.error("Address: an Ethereum address must be provided to the Identity or EthBalance component."),null;const s=Zx(e??i),l=s.convertedBalance,c=s.error;return!l||c?null:D.jsxs("span",{"data-testid":"ockEthBalance",className:Oe(dt.label2,at.foregroundMuted,t),children:[W0(l,4)," ETH"]})}function uk(e,t){return yk(e)||hk(e,t)||dk(e,t)||fk()}function fk(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dk(e,t){if(e){if(typeof e=="string")return P3(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?P3(e,t):void 0}}function P3(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n{const s=window.matchMedia("(prefers-color-scheme: dark)");i(s.matches?"dark":"light");function l(c){i(c.matches?"dark":"light")}return s.addEventListener("change",l),()=>s.removeEventListener("change",l)},[]),n}function ho(){const e=gk(),t=Vc(),n=t.config,l=(n===void 0?{}:n).appearance||{},c=l.theme,f=c===void 0?"default":c,d=l.mode,h=d===void 0?"auto":d;if(f==="cyberpunk"||f==="base"||f==="hacker")return f;switch(h){case"auto":return`${f}-${e}`;case"dark":return`${f}-dark`;case"light":return`${f}-light`;default:return`${f}-${e}`}}const pk=["address","className","children","chain"];function L3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function U3(e){for(var t=1;tJ.Children.toArray(s).find(Mn(_x)),[s]);return O?D.jsx("span",{className:i}):D.jsxs("div",{className:"flex items-center gap-1",children:[D.jsx("span",U3(U3({"data-testid":"ockIdentity_Text",className:Oe(dt.headline,at.foreground,i)},c),{},{children:S||sx(m)})),T&&D.jsx(Gx,{address:m,children:T})]})}function xk(e,t){return Tk(e)||Sk(e,t)||Ck(e,t)||Ek()}function Ek(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ck(e,t){if(e){if(typeof e=="string")return F3(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?F3(e,t):void 0}}function F3(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n{const n=h2({chainId:t.id});if(!(y2({chainId:t.id})||n))return Promise.reject("ChainId not supported, socials resolution is only supported on Ethereum and Base.");const l=Q0(t),c=Fm(e),f=async O=>{try{return await l.getEnsText({name:c,key:O,universalResolverAddress:q2[t.id]})||null}catch(T){return console.warn(`Failed to fetch ENS text record for ${O}:`,T),null}},d=await Promise.all([f("com.twitter"),f("com.github"),f("xyz.farcaster"),f("url")]),h=xk(d,4),m=h[0],w=h[1],x=h[2],S=h[3];return{twitter:m,github:w,farcaster:x,website:S}},Rk=({ensName:e,chain:t=ja},n)=>{const i=n??{},s=i.enabled,l=s===void 0?!0:s,c=i.cacheTime;return o1({queryKey:["useSocials",e,t.id],queryFn:async()=>Ok({ensName:e,chain:t}),gcTime:c,enabled:l,refetchOnWindowFocus:!1})},Mk=D.jsx("svg",{"data-testid":"ock-githubSvg",role:"img","aria-label":"ock-githubSvg",width:"100%",height:"100%",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"none",className:"h-full w-full",children:D.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z",className:ln.foreground})}),_k=D.jsxs("svg",{"data-testid":"ock-twitterSvg",role:"img","aria-label":"ock-twitterSvg",width:"100%",height:"100%",viewBox:"-1 -1 14 14",xmlns:"http://www.w3.org/2000/svg",fill:"none",className:"h-full w-full",children:[D.jsx("g",{clipPath:"url(#clip0_6998_47)",children:D.jsx("path",{d:"M7.14163 5.07857L11.6089 0H10.5503L6.67137 4.40965L3.57328 0H0L4.68492 6.66817L0 11.9938H1.05866L5.15491 7.33709L8.42672 11.9938H12L7.14137 5.07857H7.14163ZM5.69165 6.72692L5.21697 6.06292L1.44011 0.779407H3.06615L6.11412 5.04337L6.5888 5.70737L10.5508 11.2499H8.92476L5.69165 6.72718V6.72692Z",className:ln.foreground})}),D.jsx("defs",{children:D.jsx("clipPath",{id:"clip0_6998_47",children:D.jsx("rect",{width:"12",height:"12",fill:"white"})})})]}),Nk=D.jsxs("svg",{"data-testid":"ock-warpcastSvg",role:"img","aria-label":"ock-warpcastSvg",width:"100%",height:"100%",viewBox:"0 0 13 12",xmlns:"http://www.w3.org/2000/svg",className:`h-full w-full ${ln.foreground}`,children:[D.jsx("path",{d:"M2.23071 0H10.6153V12H9.38451V6.50322H9.37245C9.23641 4.98404 7.96783 3.79353 6.42299 3.79353C4.87815 3.79353 3.60957 4.98404 3.47354 6.50322H3.46147V12H2.23071V0Z",className:ln.foreground}),D.jsx("path",{d:"M0 1.70312L0.499999 3.40635H0.923066V10.2967C0.71065 10.2967 0.538456 10.47 0.538456 10.6838V11.1483H0.461541C0.249125 11.1483 0.0769147 11.3216 0.0769147 11.5354V11.9999H4.38458V11.5354C4.38458 11.3216 4.21239 11.1483 3.99998 11.1483H3.92306V10.6838C3.92306 10.47 3.75085 10.2967 3.53843 10.2967H3.07691V1.70312H0Z",className:ln.foreground}),D.jsx("path",{d:"M9.46163 10.2967C9.24921 10.2967 9.077 10.47 9.077 10.6838V11.1483H9.00009C8.78767 11.1483 8.61548 11.3216 8.61548 11.5354V11.9999H12.9231V11.5354C12.9231 11.3216 12.7509 11.1483 12.5385 11.1483H12.4616V10.6838C12.4616 10.47 12.2894 10.2967 12.077 10.2967V3.40635H12.5001L13.0001 1.70312H9.92315V10.2967H9.46163Z",className:ln.foreground})]}),Dk=D.jsx("svg",{"data-testid":"ock-websiteSvg",role:"img","aria-label":"ock-websiteSvg",width:"100%",height:"100%",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",fill:"none",className:`h-full w-full ${ln.foreground}`,children:D.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 0C9.31356 0 12 2.68644 12 6C12 9.31356 9.31356 12 6 12C2.69689 12 0.0245556 9.35356 0 6C0.0244789 2.64689 2.69689 0 6 0ZM9.34844 9.97867C9.15053 9.88544 8.9422 9.80002 8.72553 9.72346C8.56251 10.0854 8.36772 10.4313 8.13856 10.7412C8.57762 10.5427 8.98439 10.2854 9.34844 9.97867ZM7.95156 9.49742C7.46353 9.38284 6.9427 9.30992 6.4 9.28597V11.1381C7.04791 10.9365 7.58233 10.2766 7.95156 9.49742ZM5.6 9.28597C5.05729 9.30993 4.53646 9.38284 4.04844 9.49742C4.41771 10.2766 4.95209 10.936 5.6 11.1375V9.28597ZM3.27456 9.72347C3.05737 9.80003 2.84956 9.88544 2.65164 9.97868C3.01571 10.2854 3.42248 10.5427 3.86153 10.7412C3.63237 10.4313 3.43758 10.0854 3.27456 9.72347ZM2.05267 9.38492C2.34486 9.2318 2.65736 9.09534 2.98809 8.97763C2.73913 8.21044 2.58288 7.33386 2.54799 6.40008H0.815211C0.901669 7.53597 1.35323 8.5703 2.05277 9.38497L2.05267 9.38492ZM3.75156 8.74742C4.33229 8.60263 4.95367 8.512 5.6 8.48545V6.4H3.34844C3.3823 7.25677 3.52553 8.05522 3.75157 8.74733L3.75156 8.74742ZM6.4 8.48545C7.04636 8.51201 7.66767 8.60263 8.24844 8.74794C8.47449 8.05523 8.61771 7.25728 8.65157 6.40061L6.40001 6.40009L6.4 8.48545ZM9.012 8.97763C9.34273 9.09534 9.65576 9.2318 9.94742 9.38492C10.6469 8.56982 11.0984 7.53603 11.185 6.40003H9.4522C9.4173 7.33389 9.26106 8.21048 9.0121 8.97759L9.012 8.97763ZM9.94742 2.61508C9.65523 2.7682 9.34273 2.90466 9.012 3.02237C9.26096 3.78956 9.41721 4.66614 9.4521 5.59992H11.1849C11.0984 4.46403 10.6469 3.4297 9.94732 2.61503L9.94742 2.61508ZM8.24853 3.25258C7.6678 3.39737 7.04642 3.488 6.40009 3.51456V5.6H8.65164C8.61779 4.74323 8.47456 3.94478 8.24852 3.25267L8.24853 3.25258ZM5.60009 3.51456C4.95373 3.48799 4.33242 3.39737 3.75164 3.25206C3.5256 3.94477 3.38238 4.74328 3.34852 5.59994H5.60008L5.60009 3.51456ZM2.98809 3.02237C2.65736 2.90466 2.34433 2.7682 2.05267 2.61508C1.35319 3.43018 0.901667 4.46397 0.815111 5.59997H2.54789C2.58278 4.66611 2.73903 3.78952 2.98799 3.02241L2.98809 3.02237ZM2.65163 2.02132C2.84954 2.11455 3.05788 2.19997 3.27454 2.27653C3.43757 1.91456 3.63236 1.56872 3.86152 1.25882C3.42246 1.45726 3.01569 1.71456 2.65163 2.02132ZM4.04852 2.50257C4.53654 2.61714 5.05738 2.69007 5.60008 2.71402V0.861911C4.95217 1.06348 4.41774 1.72337 4.04852 2.50258V2.50257ZM6.40008 2.71402C6.94279 2.69006 7.46362 2.61715 7.95163 2.50257C7.58237 1.7234 7.04747 1.06346 6.40008 0.8619V2.71402ZM8.72552 2.27652C8.94271 2.19996 9.15052 2.11454 9.34843 2.02131C8.98437 1.71454 8.5776 1.45724 8.13855 1.25881C8.36771 1.56923 8.5625 1.91454 8.72552 2.27652Z"})}),Bk={twitter:{href:e=>`https://x.com/${e}`,icon:_k},github:{href:e=>`https://github.com/${e}`,icon:Mk},farcaster:{href:e=>`https://warpcast.com/${e.split("/").pop()}`,icon:Nk},website:{href:e=>e,icon:Dk}};function Ik({platform:e,value:t}){const n=Bk[e];return D.jsxs("a",{href:n.href(t),target:"_blank",rel:"noopener noreferrer",className:Oe(Ut.default,ot.radius,ot.default,"flex items-center justify-center p-2"),"data-testid":`ockSocials_${e.charAt(0).toUpperCase()+e.slice(1)}`,children:[D.jsx("span",{className:"sr-only",children:e}),D.jsx("div",{className:Oe("flex h-4 w-4 items-center justify-center"),children:n.icon})]})}function kk({address:e,chain:t,className:n}){const i=eh(),s=i.address,l=i.chain,c=e??s,f=t??l;if(!c)return console.error("Socials: an Ethereum address must be provided to the Socials component."),null;const d=nv({address:c,chain:f}),h=d.data,m=d.isLoading,w=Rk({ensName:h??"",chain:f},{enabled:!!h}),x=w.data,S=w.isLoading;return m||S?D.jsx("span",{className:n}):!x||Object.values(x).every(O=>!O)?null:D.jsx("div",{className:Oe(ot.default,"mt-2 w-full pl-1",n),children:D.jsx("div",{className:"left-4 flex space-x-2",children:Object.entries(x).map(([O,T])=>T&&D.jsx(Ik,{platform:O,value:T},O))})})}function Pk({children:e,className:t,hasCopyAddressOnClick:n}){const i=ho(),s=J.useMemo(()=>{const m=J.Children.toArray(e),w=m.find(Mn(cx));return{avatar:m.find(Mn(Qm)),name:m.find(Mn(jm)),address:w?J.cloneElement(w,{hasCopyAddressOnClick:n}):void 0,ethBalance:m.find(Mn(Xx)),socials:m.find(Mn(kk))}},[e,n]),l=s.avatar,c=s.name,f=s.address,d=s.ethBalance,h=s.socials;return D.jsxs("div",{className:Oe(i,tn.default,"flex flex-col px-4 py-1",t),"data-testid":"ockIdentityLayout_container",children:[D.jsxs("div",{className:"flex items-center space-x-3",children:[D.jsx("div",{className:"flex-shrink-0",children:l}),D.jsxs("div",{className:"flex flex-col",children:[c,f&&!d&&f,!f&&d&&d,f&&d&&D.jsxs("div",{className:"flex items-center gap-1",children:[f,D.jsx("span",{className:at.foregroundMuted,children:"·"}),d]})]})]}),h]})}function sv({address:e,chain:t,children:n,className:i,hasCopyAddressOnClick:s,schemaId:l}){const c=Vc(),f=c.chain,d=t??f;return D.jsx(lx,{address:e,schemaId:l,chain:d,children:D.jsx(Pk,{className:i,hasCopyAddressOnClick:s,children:n})})}function Lk({draggableRef:e,position:t,minGapToEdge:n=10}){var d;const i=(d=e.current)==null?void 0:d.getBoundingClientRect();if(!i||typeof window>"u")return t;const s=window.innerWidth,l=window.innerHeight,c=Math.min(Math.max(n,t.x),s-i.width-n),f=Math.min(Math.max(n,t.y),l-i.height-n);return{x:c,y:f}}function Uk(e,t,n){const i=J.useCallback(c=>c.right<=window.innerWidth&&c.bottom<=window.innerHeight&&c.left>=0&&c.top>=0,[]),s=J.useCallback((c,f)=>{const d=window.innerWidth,h=window.innerHeight;let m,w;return c.right>d?m=d-c.width-10:c.left<0?m=10:m=f.x,c.bottom>h?w=h-c.height-10:c.top<0?w=10:w=f.y,{x:m,y:w}},[]),l=J.useCallback(()=>{if(!e.current)return;const f=e.current.getBoundingClientRect(),d=s(f,t);n(h=>i(f)?h:d)},[e,t,s,n,i]);J.useEffect(()=>(window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)),[l])}function uy(e,t){return Gk(e)||Hk(e,t)||zk(e,t)||Fk()}function Fk(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zk(e,t){if(e){if(typeof e=="string")return z3(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?z3(e,t):void 0}}function z3(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);nMath.round(K/t)*t,[t]),V=J.useCallback(K=>{s||(j(!0),R({x:K.clientX,y:K.clientY}),x({x:K.clientX-f.x,y:K.clientY-f.y}))},[f,s]);return J.useEffect(()=>{if(!U)return;const K=le=>{const ue=Lk({draggableRef:z,position:{x:le.clientX-w.x,y:le.clientY-w.y}});d(ue)},Q=le=>{if(Math.hypot(le.clientX-T.x,le.clientY-T.y)>2){le.preventDefault(),le.stopPropagation();const ae=me=>{me.preventDefault(),me.stopPropagation(),document.removeEventListener("click",ae,!0)};document.addEventListener("click",ae,!0)}d(ae=>({x:i?H(ae.x):ae.x,y:i?H(ae.y):ae.y})),j(!1)};return document.addEventListener("pointermove",K),document.addEventListener("pointerup",Q),()=>{document.removeEventListener("pointermove",K),document.removeEventListener("pointerup",Q)}},[U,w,i,H,T]),Uk(z,f,d),D.jsx("div",{ref:z,"data-testid":"ockDraggable",className:Oe("fixed touch-none select-none","cursor-grab active:cursor-grabbing"),style:{left:`${f.x}px`,top:`${f.y}px`},onPointerDown:V,children:e})}function jk(e,t){return Xk(e)||Zk(e,t)||Yk(e,t)||Vk()}function Vk(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yk(e,t){if(e){if(typeof e=="string")return H3(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?H3(e,t):void 0}}function H3(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n{i(!0)}),n}function Wk(e,t){const n=J.useCallback(i=>{var f;if(!e.current)return;const s=!e.current.contains(i.target),l=(f=i.composedPath)==null?void 0:f.call(i);!(l==null?void 0:l.some(d=>d instanceof HTMLElement&&d.hasAttribute("data-portal-origin")))&&s&&t()},[t,e]);J.useEffect(()=>(document.addEventListener("click",n,{capture:!0}),()=>{document.removeEventListener("click",n,{capture:!0})}),[n])}const G3=16,Q3=56;function Kk(){return typeof window>"u"?{x:100,y:100}:{x:window.innerWidth-Q3-G3,y:window.innerHeight-Q3-G3}}function qk({draggable:e,draggableStartingPosition:t}){return e?{draggable:e,draggableStartingPosition:t??Kk()}:{draggable:e}}function Kx({className:e}){return D.jsx("div",{className:"flex h-full items-center justify-center","data-testid":"ockSpinner",children:D.jsx("div",{className:Oe("animate-spin border-2 border-gray-200 border-t-3","rounded-full border-t-gray-400 px-2.5 py-2.5",e)})})}function j3({className:e,connectWalletText:t,onClick:n,text:i}){return D.jsx("button",{type:"button","data-testid":"ockConnectButton",className:Oe(Ut.primary,ot.radius,dt.headline,at.inverse,"inline-flex min-w-[153px] items-center justify-center px-4 py-3",e),onClick:n,children:t||D.jsx("span",{className:Oe(at.inverse),children:i})})}function V3({children:e,className:t}){return D.jsx("span",{className:Oe(dt.headline,at.inverse,t),children:e})}const hf={dropdown:"z-10",modal:"z-40"};var pg=Uy();function b1({children:e,disableEscapeKey:t=!1,disableOutsideClick:n=!1,onDismiss:i,triggerRef:s,preventTriggerEvents:l=!1}){const c=J.useRef(null);return J.useEffect(()=>{if(n&&t)return;const f=w=>{l&&(w.preventDefault(),w.stopPropagation())},d=w=>{var x;return(x=c.current)==null?void 0:x.contains(w)},h=w=>{var S;if(n||!(w.target instanceof Node))return;const x=w.target;if((S=s==null?void 0:s.current)!=null&&S.contains(x)){f(w);return}d(x)||i==null||i()},m=w=>{!t&&w.key==="Escape"&&(i==null||i())};return document.addEventListener("pointerdown",h,!0),document.addEventListener("keydown",m),()=>{document.removeEventListener("pointerdown",h,!0),document.removeEventListener("keydown",m)}},[n,t,i,s,l]),D.jsx("div",{"data-testid":"ockDismissableLayer",ref:c,children:e})}const Y3='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function m1({active:e=!0,children:t}){const n=J.useRef(null),i=J.useRef(null);J.useEffect(()=>{if(e){if(i.current=document.activeElement,n.current){const f=n.current.querySelector(Y3);f==null||f.focus()}return()=>{var f;(f=i.current)==null||f.focus()}}},[e]);const s=()=>{var f;return(f=n.current)==null?void 0:f.querySelectorAll(Y3)},l=(f,d)=>{const h=d[0],m=d[d.length-1],w=document.activeElement===h,x=document.activeElement===m;f.shiftKey&&w?(f.preventDefault(),m.focus()):!f.shiftKey&&x&&(f.preventDefault(),h.focus())},c=f=>{if(!e||f.key!=="Tab")return;const d=s();d!=null&&d.length&&l(f,d)};return D.jsx("div",{"data-testid":"ockFocusTrap",onKeyDown:c,ref:n,children:t})}function Jk({children:e,isOpen:t,modal:n=!0,onClose:i,"aria-label":s,"aria-labelledby":l,"aria-describedby":c}){const f=ho(),d=J.useRef(null);if(!t)return null;const h=D.jsx("div",{className:Oe(f,hf.modal,"fixed inset-0 flex items-center justify-center","bg-black/50 transition-opacity duration-200","fade-in animate-in duration-200"),"data-portal-origin":"true",children:D.jsx(m1,{active:t,children:D.jsx(b1,{onDismiss:i,children:D.jsx("div",{"aria-describedby":c,"aria-label":s,"aria-labelledby":l,"aria-modal":n,className:"zoom-in-95 animate-in duration-200","data-testid":"ockDialog",onClick:m=>m.stopPropagation(),onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&m.stopPropagation()},ref:d,role:"dialog",children:e})})})});return pg.createPortal(h,document.body)}function qx({className:e=ln.foreground}){return D.jsxs("svg",{"aria-label":"ock-closeSvg",width:"12",height:"12",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:e,children:[D.jsx("title",{children:"Close"}),D.jsx("path",{d:"M2.14921 1L1 2.1492L6.8508 8L1 13.8508L2.1492 15L8 9.1492L13.8508 15L15 13.8508L9.14921 8L15 2.1492L13.8508 1L8 6.8508L2.14921 1Z"})]})}const Jx=D.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 146 146",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Coinbase Wallet Logo",children:[D.jsx("title",{children:"Coinbase Wallet Logo"}),D.jsx("rect",{width:"146",height:"146",fill:"#0052FF"}),D.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21.9 73C21.9 102.053 45.1466 125.3 74.2 125.3C103.253 125.3 126.5 102.053 126.5 73C126.5 43.9466 103.253 20.7 74.2 20.7C45.1466 20.7 21.9 43.9466 21.9 73ZM60.5 54.75C58.5673 54.75 57 56.3173 57 58.25V87.75C57 89.6827 58.5673 91.25 60.5 91.25H87.9C89.8327 91.25 91.4 89.6827 91.4 87.75V58.25C91.4 56.3173 89.8327 54.75 87.9 54.75H60.5Z",fill:"white"})]}),$k=D.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",viewBox:"0 0 204.8 192.4",width:"100%",height:"100%",role:"img","aria-hidden":"true",children:[D.jsx("title",{children:"MetaMask Logo"}),D.jsx("style",{children:".st1{fill:#f5841f}.st2{fill:#e27625}.st3{fill:#d7c1b3}.st4{fill:#2f343b}.st5{fill:#cc6228}.st7{fill:#763e1a}"}),D.jsx("path",{id:"MM_Head_background__x28_Do_not_edit_x29_",d:"m167.4 96.1 6.9-8.1-3-2.2 4.8-4.4-3.7-2.8 4.8-3.6-3.1-2.4 5-24.4-7.6-22.6m0 0-48.8 18.1H82L33.2 25.6l.3.2-.3-.2-7.6 22.6 5.1 24.4-3.2 2.4 4.9 3.6-3.7 2.8 4.8 4.4-3 2.2 6.9 8.1-10.5 32.4 9.7 33.1 34.1-9.4v-.1.1l6.6 5.4 13.5 9.2h23.1l13.5-9.2 6.6-5.4 34.2 9.4 9.8-33.1-10.6-32.4m-96.7 56",className:"st1"}),D.jsxs("g",{id:"Logos",children:[D.jsx("path",{d:"m171.5 25.6-59.9 44.1 11.1-26zM33.2 25.6l59.4 44.5L82 43.7zM150 127.9l-16 24.2 34.2 9.4 9.8-33.1zM26.9 128.4l9.7 33.1 34.1-9.4-15.9-24.2z",className:"st2"}),D.jsx("path",{d:"m68.9 86.9-9.5 14.3 33.8 1.5-1.1-36.2zM135.9 86.9l-23.6-20.8-.7 36.6 33.8-1.5zM70.7 152.1l20.5-9.8-17.7-13.6zM113.6 142.3l20.4 9.8-2.8-23.4z",className:"st2"}),D.jsx("path",{d:"m134 152.1-20.4-9.8 1.7 13.2-.2 5.6zM70.7 152.1l19 9-.1-5.6 1.6-13.2z",className:"st3"}),D.jsx("path",{d:"M90 119.9 73.1 115l12-5.5zM114.7 119.9l5-10.4 12 5.5z",className:"st4"}),D.jsx("path",{d:"m70.7 152.1 3-24.2-18.9.5zM131.1 127.9l2.9 24.2 16-23.7zM145.4 101.2l-33.8 1.5 3.1 17.2 5-10.4 12 5.5zM73.1 115l12-5.5 4.9 10.4 3.2-17.2-33.8-1.5z",className:"st5"}),D.jsx("path",{d:"m59.4 101.2 14.1 27.5-.4-13.7zM131.7 115l-.5 13.7 14.2-27.5zM93.2 102.7 90 119.9l4 20.4.9-26.8zM111.6 102.7l-1.7 10.7.8 26.9 4-20.4z",className:"st2"}),D.jsx("path",{d:"m114.7 119.9-4 20.4 2.9 2 17.6-13.6.5-13.7zM73.1 115l.4 13.7 17.7 13.6 2.8-2-4-20.4z",className:"st1"}),D.jsx("path",{d:"m115.1 161.1.2-5.6-1.6-1.3H91l-1.4 1.3.1 5.6-19-9 6.6 5.4 13.5 9.3h23.1l13.5-9.3 6.6-5.4z",style:{fill:"#c0ad9e"}}),D.jsx("path",{d:"m113.6 142.3-2.9-2H94l-2.8 2-1.6 13.2 1.4-1.3h22.7l1.6 1.3z",className:"st4"}),D.jsx("path",{d:"m174.1 72.6 5-24.4-7.6-22.6-57.9 42.6 22.3 18.7 31.5 9.2 6.9-8.1-3-2.2 4.8-4.3-3.7-2.9 4.8-3.6zM25.6 48.2l5.1 24.4-3.2 2.4 4.8 3.7-3.7 2.8 4.8 4.3-3 2.2 7 8.1 31.5-9.2 22.3-18.7-58-42.6z",className:"st7"}),D.jsx("path",{d:"m167.4 96.1-31.5-9.2 9.5 14.3-14.2 27.5 18.8-.3h28zM68.9 86.9l-31.5 9.2-10.5 32.3h27.9l18.7.3-14.1-27.5zM111.6 102.7l2-34.5 9.1-24.5H82l9.2 24.5 2 34.5.8 10.8v26.8h16.7l.1-26.8z",className:"st1"})]})]}),eP=D.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 146 146",width:"100%",height:"100%",role:"img","aria-label":"Phantom Logo",children:[D.jsx("title",{children:"Phantom Logo"}),D.jsxs("g",{clipPath:"url(#clip0_phantom)",children:[D.jsx("rect",{width:"146",height:"146",rx:"31.3",fill:"#AB9FF2"}),D.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M62.92 94.85C57.19 103.66 47.58 114.75 34.79 114.75C28.76 114.75 22.95 112.28 22.95 101.45C22.95 73.97 60.51 31.37 95.38 31.37C115.19 31.37 123.11 45.13 123.11 60.77C123.11 80.81 110.11 103.74 97.15 103.74C93.05 103.74 91.06 101.45 91.06 97.91C91.06 96.98 91.21 95.98 91.52 94.85C87.11 102.41 78.57 109.41 70.6 109.41C64.75 109.41 61.83 105.85 61.83 100.63C61.83 98.77 62.22 96.82 62.92 94.85ZM110.03 60.23C110.03 64.75 107.36 67.03 104.37 67.03C101.31 67.03 98.65 64.75 98.65 60.23C98.65 55.66 101.31 53.38 104.37 53.38C107.36 53.38 110.03 55.66 110.03 60.23ZM92.96 60.23C92.96 64.75 90.29 67.03 87.3 67.03C84.24 67.03 81.58 64.75 81.58 60.23C81.58 55.66 84.24 53.38 87.3 53.38C90.29 53.38 92.96 55.66 92.96 60.23Z",fill:"#FFFDF8"})]}),D.jsx("defs",{children:D.jsx("clipPath",{id:"clip0_phantom",children:D.jsx("rect",{width:"146",height:"146",fill:"white"})})})]});function tP({className:e,isOpen:t,onClose:n,onError:i}){var T,R,k,F;const s=q8(),l=s.connect,c=Vc(),f=c.config,d=((T=f==null?void 0:f.appearance)==null?void 0:T.logo)??void 0,h=((R=f==null?void 0:f.appearance)==null?void 0:R.name)??void 0,m=((k=f==null?void 0:f.wallet)==null?void 0:k.privacyUrl)??void 0,w=((F=f==null?void 0:f.wallet)==null?void 0:F.termsUrl)??void 0,x=J.useCallback(()=>{try{const U=p1({preference:"all",appName:h,appLogoUrl:d});l({connector:U}),n()}catch(U){console.error("Coinbase Wallet connection error:",U),i&&i(U instanceof Error?U:new Error("Failed to connect wallet"))}},[h,d,l,n,i]),S=J.useCallback(()=>{try{const U=K2({dappMetadata:{name:h||"OnchainKit App",url:window.location.origin,iconUrl:d}});l({connector:U}),n()}catch(U){console.error("MetaMask connection error:",U),i==null||i(U instanceof Error?U:new Error("Failed to connect wallet"))}},[l,n,i,h,d]),O=J.useCallback(()=>{try{const U=cg({target:"phantom"});l({connector:U}),n()}catch(U){console.error("Phantom connection error:",U),i==null||i(U instanceof Error?U:new Error("Failed to connect wallet"))}},[l,n,i]);return D.jsx(Jk,{isOpen:t,onClose:n,"aria-label":"Connect Wallet",children:D.jsxs("div",{"data-testid":"ockModalOverlay",className:Oe(ot.lineDefault,ot.radius,tn.default,"w-[22rem] p-6 pb-4","relative flex flex-col items-center gap-4",e),children:[D.jsx("button",{type:"button",onClick:n,className:Oe(Ut.default,ot.radius,ot.default,"absolute top-4 right-4","flex items-center justify-center p-1","bg-current","transition-colors duration-200"),"aria-label":"Close modal",children:D.jsx("div",{className:Oe("flex h-4 w-4 items-center justify-center"),children:D.jsx(qx,{})})}),(d||h)&&D.jsxs("div",{className:"flex w-full flex-col items-center gap-2 py-3",children:[d&&D.jsx("div",{className:Oe(ot.radius,"h-14 w-14 overflow-hidden"),children:D.jsx("img",{src:d,alt:`${h||"App"} icon`,className:"h-full w-full object-cover"})}),h&&D.jsx("h2",{className:Oe(dt.headline,at.foreground,"text-center"),children:h})]}),D.jsxs("div",{className:"flex w-full flex-col gap-3",children:[D.jsxs("button",{type:"button",onClick:x,className:Oe(ot.radius,dt.body,Ut.alternate,at.foreground,"flex items-center justify-between px-4 py-3 text-left"),children:["Sign up",D.jsx("div",{className:"h-4 w-4",children:Mx})]}),D.jsxs("div",{className:"relative",children:[D.jsx("div",{className:"absolute inset-0 flex items-center",children:D.jsx("div",{className:Oe(ot.lineDefault,"w-full border-[0.5px]")})}),D.jsx("div",{className:"relative flex justify-center",children:D.jsx("span",{className:Oe(tn.default,at.foregroundMuted,dt.legal,"px-2"),children:"or continue with an existing wallet"})})]}),D.jsxs("button",{type:"button",onClick:x,className:Oe(ot.radius,tn.default,dt.body,Ut.alternate,at.foreground,"px-4 py-3","flex items-center justify-between text-left"),children:["Coinbase Wallet",D.jsx("div",{className:"h-4 w-4",children:Jx})]}),D.jsxs("button",{type:"button",onClick:S,className:Oe(ot.radius,tn.default,dt.body,Ut.alternate,at.foreground,"flex items-center justify-between px-4 py-3 text-left"),children:["MetaMask",D.jsx("div",{className:"-mr-0.5 flex h-5 w-5 items-center justify-center",children:$k})]}),D.jsxs("button",{type:"button",onClick:O,className:Oe(ot.radius,tn.default,dt.body,Ut.alternate,at.foreground,"flex items-center justify-between px-4 py-3 text-left"),children:["Phantom",D.jsx("div",{className:"-mr-0.5 flex h-4 w-4 items-center justify-center",children:eP})]})]}),D.jsxs("div",{className:Oe(at.foregroundMuted,dt.legal,"flex flex-col items-center justify-center gap-1 px-4","mt-4 text-center"),children:[D.jsx("span",{className:"font-normal text-[10px] leading-[13px]",children:"By connecting a wallet, you agree to our"}),D.jsxs("span",{className:"font-normal text-[10px] leading-[13px]",children:[w&&D.jsx("a",{href:w,className:Oe(at.primary,"hover:underline"),target:"_blank",rel:"noopener noreferrer",tabIndex:0,children:"Terms of Service"})," ",w&&m&&"and"," ",m&&D.jsx("a",{href:m,className:Oe(at.primary,"hover:underline"),target:"_blank",rel:"noopener noreferrer",tabIndex:0,children:"Privacy Policy"}),"."]})]})]})})}function Z3(e,t){return aP(e)||iP(e,t)||rP(e,t)||nP()}function nP(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rP(e,t){if(e){if(typeof e=="string")return X3(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?X3(e,t):void 0}}function X3(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n{const s=()=>{const c=Object.entries(sP);for(const d of c){var f=Z3(d,2);const h=f[0],m=f[1];if(window.matchMedia(m).matches)return h}return"md"};i(s());const l=()=>{i(s())};return window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[]),n}const oP={name:"ETH",address:"",symbol:"ETH",decimals:18,image:"https://wallet-api-production.s3.amazonaws.com/uploads/tokens/eth_288.png",chainId:Qn.id};vl.id;const lP={name:"USDC",address:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",symbol:"USDC",decimals:6,image:"https://d3r81g40ycuhqg.cloudfront.net/wallet/wais/44/2b/442b80bd16af0c0d9b22e03a16753823fe826e5bfd457292b55fa0ba8c1ba213-ZWUzYjJmZGUtMDYxNy00NDcyLTg0NjQtMWI4OGEwYjBiODE2",chainId:Qn.id};vl.id;Qn.id;Qn.id;Qn.id;Qn.id;Qn.id;Qn.id;Qn.id;const cP=400,uP=352,fP=[oP,lP];function dP(e){if(typeof window>"u")return{showAbove:!1,alignRight:!1};const t=window.innerHeight-e.bottom,n=window.innerWidth-e.left;return{showAbove:te.length)&&(t=e.length);for(var n=0,i=Array(t);n{h&&O(!0)},[h]);J.useEffect(()=>{if(h&&(V!=null&&V.current)){const me=V.current.getBoundingClientRect(),ce=dP(me);F(ce.showAbove),H(ce.alignRight)}},[h]);const ae=xl({address:Q,chain:n,breakpoint:le,isConnectModalOpen:l,setIsConnectModalOpen:c,isSubComponentOpen:h,setIsSubComponentOpen:m,isSubComponentClosing:S,setIsSubComponentClosing:O,handleClose:ue,connectRef:V,showSubComponentAbove:k,alignSubComponentRight:z});return D.jsx(e7.Provider,{value:ae,children:e})}function yf(){return J.useContext(e7)}function K3(e,t){return xP(e)||AP(e,t)||wP(e,t)||vP()}function vP(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wP(e,t){if(e){if(typeof e=="string")return q3(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?q3(e,t):void 0}}function q3(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n({connectWalletText:J.Children.toArray(e).find(Mn(V3))}),[e]),ce=me.connectWalletText,W=J.useMemo(()=>J.Children.map(e,Pe=>J.isValidElement(Pe)&&Pe.type===V3?null:Pe),[e]),L=R[0],te=F==="pending"||O==="connecting",ge=J.useCallback(()=>{h?w==null||w():m(!0)},[h,w,m]),pe=J.useCallback(()=>{ae(!1),d==null||d(!1)},[d]),P=J.useCallback(()=>{ae(!0),d==null||d(!0),K(!0)},[d]),Z=J.useCallback((Pe,Fe)=>{j(Jp.ConnectInitiated,{component:Fe,walletProvider:Pe})},[j]),Ie=J.useCallback((Pe,Fe)=>{j(Jp.ConnectSuccess,{address:Fe??"",walletProvider:Pe})},[j]),De=J.useCallback((Pe,Fe,bt)=>{j(Jp.ConnectError,{error:Fe,metadata:{connector:Pe,component:bt}})},[j]);return J.useEffect(()=>{V&&O==="connected"&&i&&(i(),K(!1))},[O,V,i]),J.useEffect(()=>{O==="connected"&&S&&L&&Ie(L.name,S)},[O,S,L,Ie]),O==="disconnected"?((we=c==null?void 0:c.wallet)==null?void 0:we.display)==="modal"?D.jsxs("div",{className:"flex","data-testid":"ockConnectWallet_Container",children:[D.jsx(j3,{className:t,connectWalletText:ce,onClick:()=>{P(),K(!0),Z(L.name,"ConnectWallet")},text:n}),D.jsx(tP,{isOpen:ue,onClose:pe})]}):D.jsx("div",{className:"flex","data-testid":"ockConnectWallet_Container",children:D.jsx(j3,{className:t,connectWalletText:ce,onClick:()=>{Z(L.name,"ConnectWallet"),k({connector:L},{onSuccess:()=>{i==null||i(),Ie(L.name,S)},onError:Pe=>{De(L.name,Pe.message,"ConnectWallet")}})},text:n})}):te?D.jsx("div",{className:"flex","data-testid":"ockConnectWallet_Container",children:D.jsx("button",{type:"button","data-testid":"ockConnectAccountButtonInner",className:Oe(Ut.primary,dt.headline,at.inverse,"inline-flex min-w-[153px] items-center justify-center rounded-xl px-4 py-3",Ut.disabled,t),disabled:!0,children:D.jsx(Kx,{})})}):D.jsx(lx,{address:S,children:D.jsx("div",{className:"flex gap-4","data-testid":"ockConnectWallet_Container",children:D.jsx("button",{type:"button","data-testid":"ockConnectWallet_Connected",className:Oe(Ut.secondary,ot.radius,at.foreground,"px-4 py-3",h&&"ock-bg-secondary-active hover:ock-bg-secondary-active",t),onClick:ge,children:D.jsx("div",{className:"flex items-center justify-center gap-2",children:W})})})})}function EP({children:e,className:t,isOpen:n,onClose:i,triggerRef:s,"aria-label":l,"aria-labelledby":c,"aria-describedby":f}){const d=ho();if(!n)return null;const h=D.jsx("div",{"data-portal-origin":"true",children:D.jsx(m1,{active:n,children:D.jsx(b1,{onDismiss:i,triggerRef:s,preventTriggerEvents:!!s,children:D.jsx("div",{"aria-describedby":f,"aria-label":l,"aria-labelledby":c,"data-testid":"ockBottomSheet",role:"dialog",className:Oe(d,tn.default,hf.modal,"fixed right-0 bottom-0 left-0","transform rounded-t-3xl p-2 transition-transform","fade-in slide-in-from-bottom-1/2 animate-in",t),children:e})})})});return pg.createPortal(h,document.body)}const CP="cdp_getTokensForAddresses",SP=()=>{if(!Mc.rpcUrl&&!Mc.apiKey)throw new Error("API Key Unset: You can use the Coinbase Developer Platform RPC by providing an API key in `OnchainKitProvider` or by manually calling `setOnchainKitConfig`: https://portal.cdp.coinbase.com/products/onchainkit");return Mc.rpcUrl||`https://api.developer.coinbase.com/rpc/v1/${Mc.chain.name.replace(" ","-").toLowerCase()}/${Mc.apiKey}`};function J3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function fy(e){for(var t=1;t{const n=await NP({addresses:[e]},t);if(DP(n))throw new Error(n.message);return n.portfolios.length===0?{address:e,portfolioBalanceUsd:0,tokenBalances:[]}:n.portfolios[0]},retry:!1,enabled:!!e,refetchOnWindowFocus:!0,staleTime:1e3*60*5,refetchOnMount:!0,refetchInterval:1e3*60*15,refetchIntervalInBackground:!0})}function dy(e,t){return LP(e)||PP(e,t)||kP(e,t)||IP()}function IP(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kP(e,t){if(e){if(typeof e=="string")return $3(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$3(e,t):void 0}}function $3(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n$8({copyValue:t,onSuccess:n,onError:i}),[t,n,i]);return D.jsx("button",{type:"button","data-testid":"ockCopyButton",className:s,onClick:c,onKeyDown:c,"aria-label":l,children:e})}function r7({children:e,className:t,onClick:n,ariaLabel:i}){return D.jsx("button",{type:"button",onClick:n,"data-testid":"ockPressableIconButton","aria-label":i,className:Oe(Ut.default,ot.radiusInner,ot.default,"flex items-center justify-center",t),children:e})}const zP=237,HP=50,GP=10,QP="#ffffff",e5={x:0,y:0},t5={x:1,y:0},n5={default:"blue",base:"baseBlue",cyberpunk:"pink",hacker:"black"},r5={default:"default",base:"blue",cyberpunk:"magenta",hacker:"black"},i5={blue:{startColor:"#266EFF",endColor:"#45E1E5"},pink:{startColor:"#EE5A67",endColor:"#CE46BD"},black:{startColor:"#a1a1aa",endColor:"#27272a"},baseBlue:{startColor:"#0052ff",endColor:"#b2cbff"}},jP={default:[["#0F27FF","39.06%"],["#6100FF","76.56%"],["#201F1D","100%"]],blue:[["#0F6FFF","39.06%"],["#0F27FF","76.56%"],["#201F1D","100%"]],magenta:[["#CF00F1","36.46%"],["#7900F1","68.58%"],["#201F1D","100%"]],black:[["#d4d4d8","36.46%"],["#201F1D","68.58%"],["#201F1D","100%"]]},sb=[[1,1,1,1,1,1,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,1,1,1,1,1,1]],ob=[[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]];function VP(e,t,n,i){return Math.sqrt((i-t)**2+(n-e)**2)}function YP(e,t,n){var i,s,l,c,f,d;return!!((i=sb[e])!=null&&i[t]||(s=sb[e-n+v0])!=null&&s[t]||(l=sb[e])!=null&&l[t-n+v0]||(c=ob[e])!=null&&c[t]||(f=ob[e-n+v0])!=null&&f[t]||(d=ob[e])!=null&&d[t-n+v0])}function ZP(e,t,{hasLogo:n,logoSize:i,logoMargin:s,logoBorderRadius:l,matrixLength:c,dotSize:f}){if(!n)return!1;const h=(i+s*2)/f,m=Math.floor(c/2);if(l>=i/2){const S=h/2;return VP(t,e,m,m)-.5<=S}const x=Math.ceil(h/2);return e<=m+x&&e>=m-x&&t<=m+x&&t>=m-x}function XP(e,t,n){return` + M ${e-n} ${t} + A ${n} ${n} 0 1 1 ${e+n} ${t} + A ${n} ${n} 0 1 1 ${e-n} ${t}`}const v0=7;function WP({matrix:e,size:t,logoSize:n,logoMargin:i,logoBorderRadius:s,hasLogo:l}){return J.useMemo(()=>{const f=t/e.length;let d="";const h=e.length,m=t/h;return e.forEach((w,x)=>{w.forEach((S,O)=>{if(!(YP(x,O,h)||ZP(x,O,{hasLogo:l,logoSize:n,logoMargin:i,logoBorderRadius:s,matrixLength:h,dotSize:m}))&&S){const T=f*O+f/2,R=f*x+f/2;d+=XP(T,R,f/2)}})}),d},[l,s,i,n,e,t])}function KP(e,t,n,i,s){const l=e/t,c=l*v0,f=l*2,d=l+1;return J.useMemo(()=>D.jsxs("g",{children:[D.jsx("rect",{x:0,y:0,rx:9.5,ry:9.5,width:c,height:c,fill:i,id:`Corner-top-left-${s}`}),D.jsx("rect",{x:0,y:e-c,rx:9.5,ry:9.5,width:c,height:c,fill:i,id:`Corner-bottom-left-${s}`}),D.jsx("rect",{x:e-c,y:0,rx:9.5,ry:9.5,width:c,height:c,fill:i,id:`Corner-top-right-${s}`}),D.jsx("circle",{cx:c/2,cy:c/2,r:f,stroke:n,strokeWidth:d,fill:"none"}),D.jsx("circle",{cx:c/2,cy:e-c/2,r:f,stroke:n,strokeWidth:d,fill:"none"}),D.jsx("circle",{cx:e-c/2,cy:c/2,r:f,stroke:n,strokeWidth:d,fill:"none"})]}),[n,f,d,i,c,e,s])}var Bu={},h0={};/** + * @license React + * react-dom-server-legacy.browser.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var a5;function qP(){if(a5)return h0;a5=1;var e=uf(),t=Uy();function n(g){var v="https://react.dev/errors/"+g;if(1>>16)&65535)<<16)&4294967295,X=X<<15|X>>>17,X=461845907*(X&65535)+((461845907*(X>>>16)&65535)<<16)&4294967295,B^=X,B=B<<13|B>>>19,B=5*(B&65535)+((5*(B>>>16)&65535)<<16)&4294967295,B=(B&65535)+27492+(((B>>>16)+58964&65535)<<16)}switch(X=0,C){case 3:X^=(g.charCodeAt(v+2)&255)<<16;case 2:X^=(g.charCodeAt(v+1)&255)<<8;case 1:X^=g.charCodeAt(v)&255,X=3432918353*(X&65535)+((3432918353*(X>>>16)&65535)<<16)&4294967295,X=X<<15|X>>>17,B^=461845907*(X&65535)+((461845907*(X>>>16)&65535)<<16)&4294967295}return B^=g.length,B^=B>>>16,B=2246822507*(B&65535)+((2246822507*(B>>>16)&65535)<<16)&4294967295,B^=B>>>13,B=3266489909*(B&65535)+((3266489909*(B>>>16)&65535)<<16)&4294967295,(B^B>>>16)>>>0}var K=Object.assign,Q=Object.prototype.hasOwnProperty,le=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),ue={},ae={};function me(g){return Q.call(ae,g)?!0:Q.call(ue,g)?!1:le.test(g)?ae[g]=!0:(ue[g]=!0,!1)}var ce=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" ")),W=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),L=/["'&<>]/;function te(g){if(typeof g=="boolean"||typeof g=="number"||typeof g=="bigint")return""+g;g=""+g;var v=L.exec(g);if(v){var C="",_,B=0;for(_=v.index;_")}function oi(g){if(typeof g!="string")throw Error(n(480))}function Zi(g,v){if(typeof v.$$FORM_ACTION=="function"){var C=g.nextFormID++;g=g.idPrefix+C;try{var _=v.$$FORM_ACTION(g);if(_){var B=_.data;B!=null&&B.forEach(oi)}return _}catch(X){if(typeof X=="object"&&X!==null&&typeof X.then=="function")throw X}}return null}function wn(g,v,C,_,B,X,ee,de){var ye=null;if(typeof _=="function"){var Ce=Zi(v,_);Ce!==null?(de=Ce.name,_=Ce.action||"",B=Ce.encType,X=Ce.method,ee=Ce.target,ye=Ce.data):(g.push(" ","formAction",'="',Bt,'"'),ee=X=B=_=de=null,Yn(v,C))}return de!=null&&Ke(g,"name",de),_!=null&&Ke(g,"formAction",_),B!=null&&Ke(g,"formEncType",B),X!=null&&Ke(g,"formMethod",X),ee!=null&&Ke(g,"formTarget",ee),ye}function Ke(g,v,C){switch(v){case"className":Dt(g,"class",C);break;case"tabIndex":Dt(g,"tabindex",C);break;case"dir":case"role":case"viewBox":case"width":case"height":Dt(g,v,C);break;case"style":Ln(g,C);break;case"src":case"href":if(C==="")break;case"action":case"formAction":if(C==null||typeof C=="function"||typeof C=="symbol"||typeof C=="boolean")break;C=Z(""+C),g.push(" ",v,'="',te(C),'"');break;case"defaultValue":case"defaultChecked":case"innerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":case"ref":break;case"autoFocus":case"multiple":case"muted":nr(g,v.toLowerCase(),C);break;case"xlinkHref":if(typeof C=="function"||typeof C=="symbol"||typeof C=="boolean")break;C=Z(""+C),g.push(" ","xlink:href",'="',te(C),'"');break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":typeof C!="function"&&typeof C!="symbol"&&g.push(" ",v,'="',te(C),'"');break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":C&&typeof C!="function"&&typeof C!="symbol"&&g.push(" ",v,'=""');break;case"capture":case"download":C===!0?g.push(" ",v,'=""'):C!==!1&&typeof C!="function"&&typeof C!="symbol"&&g.push(" ",v,'="',te(C),'"');break;case"cols":case"rows":case"size":case"span":typeof C!="function"&&typeof C!="symbol"&&!isNaN(C)&&1<=C&&g.push(" ",v,'="',te(C),'"');break;case"rowSpan":case"start":typeof C=="function"||typeof C=="symbol"||isNaN(C)||g.push(" ",v,'="',te(C),'"');break;case"xlinkActuate":Dt(g,"xlink:actuate",C);break;case"xlinkArcrole":Dt(g,"xlink:arcrole",C);break;case"xlinkRole":Dt(g,"xlink:role",C);break;case"xlinkShow":Dt(g,"xlink:show",C);break;case"xlinkTitle":Dt(g,"xlink:title",C);break;case"xlinkType":Dt(g,"xlink:type",C);break;case"xmlBase":Dt(g,"xml:base",C);break;case"xmlLang":Dt(g,"xml:lang",C);break;case"xmlSpace":Dt(g,"xml:space",C);break;default:if((!(2"))}function Zn(g,v){g.push(Ot("link"));for(var C in v)if(Q.call(v,C)){var _=v[C];if(_!=null)switch(C){case"children":case"dangerouslySetInnerHTML":throw Error(n(399,"link"));default:Ke(g,C,_)}}return g.push("/>"),null}var Sl=/(<\/|<)(s)(tyle)/gi;function Tl(g,v,C,_){return""+v+(C==="s"?"\\73 ":"\\53 ")+_}function Ai(g,v,C){g.push(Ot(C));for(var _ in v)if(Q.call(v,_)){var B=v[_];if(B!=null)switch(_){case"children":case"dangerouslySetInnerHTML":throw Error(n(399,C));default:Ke(g,_,B)}}return g.push("/>"),null}function Yc(g,v){g.push(Ot("title"));var C=null,_=null,B;for(B in v)if(Q.call(v,B)){var X=v[B];if(X!=null)switch(B){case"children":C=X;break;case"dangerouslySetInnerHTML":_=X;break;default:Ke(g,B,X)}}return g.push(">"),v=Array.isArray(C)?2>C.length?C[0]:null:C,typeof v!="function"&&typeof v!="symbol"&&v!==null&&v!==void 0&&g.push(te(""+v)),Vn(g,_,C),g.push(yn("title")),null}function Wa(g,v){g.push(Ot("script"));var C=null,_=null,B;for(B in v)if(Q.call(v,B)){var X=v[B];if(X!=null)switch(B){case"children":C=X;break;case"dangerouslySetInnerHTML":_=X;break;default:Ke(g,B,X)}}return g.push(">"),Vn(g,_,C),typeof C=="string"&&g.push((""+C).replace(bt,Xe)),g.push(yn("script")),null}function Ka(g,v,C){g.push(Ot(C));var _=C=null,B;for(B in v)if(Q.call(v,B)){var X=v[B];if(X!=null)switch(B){case"children":C=X;break;case"dangerouslySetInnerHTML":_=X;break;default:Ke(g,B,X)}}return g.push(">"),Vn(g,_,C),typeof C=="string"?(g.push(te(C)),null):C}var rh=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,vs=new Map;function Ot(g){var v=vs.get(g);if(v===void 0){if(!rh.test(g))throw Error(n(65,g));v="<"+g,vs.set(g,v)}return v}function bf(g,v,C,_,B,X,ee,de,ye){switch(v){case"div":case"span":case"svg":case"path":break;case"a":g.push(Ot("a"));var Ce=null,Le=null,Be;for(Be in C)if(Q.call(C,Be)){var Qe=C[Be];if(Qe!=null)switch(Be){case"children":Ce=Qe;break;case"dangerouslySetInnerHTML":Le=Qe;break;case"href":Qe===""?Dt(g,"href",""):Ke(g,Be,Qe);break;default:Ke(g,Be,Qe)}}if(g.push(">"),Vn(g,Le,Ce),typeof Ce=="string"){g.push(te(Ce));var lt=null}else lt=Ce;return lt;case"g":case"p":case"li":break;case"select":g.push(Ot("select"));var He=null,Je=null,Lt;for(Lt in C)if(Q.call(C,Lt)){var ht=C[Lt];if(ht!=null)switch(Lt){case"children":He=ht;break;case"dangerouslySetInnerHTML":Je=ht;break;case"defaultValue":case"value":break;default:Ke(g,Lt,ht)}}return g.push(">"),Vn(g,Je,He),He;case"option":var xt=ee.selectedValue;g.push(Ot("option"));var At=null,kt=null,mt=null,qt=null,Nr;for(Nr in C)if(Q.call(C,Nr)){var Dr=C[Nr];if(Dr!=null)switch(Nr){case"children":At=Dr;break;case"selected":mt=Dr;break;case"dangerouslySetInnerHTML":qt=Dr;break;case"value":kt=Dr;default:Ke(g,Nr,Dr)}}if(xt!=null){var jt=kt!==null?""+kt:wi(At);if(H(xt)){for(var ct=0;ct"),Vn(g,qt,At),At;case"textarea":g.push(Ot("textarea"));var cn=null,Ni=null,Wn=null,Br;for(Br in C)if(Q.call(C,Br)){var sr=C[Br];if(sr!=null)switch(Br){case"children":Wn=sr;break;case"value":cn=sr;break;case"defaultValue":Ni=sr;break;case"dangerouslySetInnerHTML":throw Error(n(91));default:Ke(g,Br,sr)}}if(cn===null&&Ni!==null&&(cn=Ni),g.push(">"),Wn!=null){if(cn!=null)throw Error(n(92));if(H(Wn)){if(1"),Gl!=null&&Gl.forEach(Ct,g),null;case"button":g.push(Ot("button"));var Kn=null,as=null,ss=null,Hs=null,Gs=null,kr=null,Fn=null,vr;for(vr in C)if(Q.call(C,vr)){var gn=C[vr];if(gn!=null)switch(vr){case"children":Kn=gn;break;case"dangerouslySetInnerHTML":as=gn;break;case"name":ss=gn;break;case"formAction":Hs=gn;break;case"formEncType":Gs=gn;break;case"formMethod":kr=gn;break;case"formTarget":Fn=gn;break;default:Ke(g,vr,gn)}}var Di=wn(g,_,B,Hs,Gs,kr,Fn,ss);if(g.push(">"),Di!=null&&Di.forEach(Ct,g),Vn(g,as,Kn),typeof Kn=="string"){g.push(te(Kn));var Bi=null}else Bi=Kn;return Bi;case"form":g.push(Ot("form"));var os=null,ta=null,ui=null,nn=null,rn=null,vt=null,pn;for(pn in C)if(Q.call(C,pn)){var zn=C[pn];if(zn!=null)switch(pn){case"children":os=zn;break;case"dangerouslySetInnerHTML":ta=zn;break;case"action":ui=zn;break;case"encType":nn=zn;break;case"method":rn=zn;break;case"target":vt=zn;break;default:Ke(g,pn,zn)}}var Qs=null,na=null;if(typeof ui=="function"){var Vt=Zi(_,ui);Vt!==null?(ui=Vt.action||"",nn=Vt.encType,rn=Vt.method,vt=Vt.target,Qs=Vt.data,na=Vt.name):(g.push(" ","action",'="',Bt,'"'),vt=rn=nn=ui=null,Yn(_,B))}if(ui!=null&&Ke(g,"action",ui),nn!=null&&Ke(g,"encType",nn),rn!=null&&Ke(g,"method",rn),vt!=null&&Ke(g,"target",vt),g.push(">"),na!==null&&(g.push('"),Qs!=null&&Qs.forEach(Ct,g)),Vn(g,ta,os),typeof os=="string"){g.push(te(os));var Ql=null}else Ql=os;return Ql;case"menuitem":g.push(Ot("menuitem"));for(var Ii in C)if(Q.call(C,Ii)){var ra=C[Ii];if(ra!=null)switch(Ii){case"children":case"dangerouslySetInnerHTML":throw Error(n(400));default:Ke(g,Ii,ra)}}return g.push(">"),null;case"object":g.push(Ot("object"));var ki=null,Pi=null,Li;for(Li in C)if(Q.call(C,Li)){var Pr=C[Li];if(Pr!=null)switch(Li){case"children":ki=Pr;break;case"dangerouslySetInnerHTML":Pi=Pr;break;case"data":var cr=Z(""+Pr);if(cr==="")break;g.push(" ","data",'="',te(cr),'"');break;default:Ke(g,Li,Pr)}}if(g.push(">"),Vn(g,Pi,ki),typeof ki=="string"){g.push(te(ki));var ia=null}else ia=ki;return ia;case"title":if(ee.insertionMode===3||ee.tagScope&1||C.itemProp!=null)var Bo=Yc(g,C);else ye?Bo=null:(Yc(B.hoistableChunks,C),Bo=void 0);return Bo;case"link":var js=C.rel,Jr=C.href,fi=C.precedence;if(ee.insertionMode===3||ee.tagScope&1||C.itemProp!=null||typeof js!="string"||typeof Jr!="string"||Jr===""){Zn(g,C);var bn=null}else if(C.rel==="stylesheet")if(typeof fi!="string"||C.disabled!=null||C.onLoad||C.onError)bn=Zn(g,C);else{var di=B.styles.get(fi),Ui=_.styleResources.hasOwnProperty(Jr)?_.styleResources[Jr]:void 0;if(Ui!==null){_.styleResources[Jr]=null,di||(di={precedence:te(fi),rules:[],hrefs:[],sheets:new Map},B.styles.set(fi,di));var aa={state:0,props:K({},C,{"data-precedence":C.precedence,precedence:null})};if(Ui){Ui.length===2&&li(aa.props,Ui);var Io=B.preloads.stylesheets.get(Jr);Io&&0"),bn=null}else C.onLoad||C.onError?bn=Zn(g,C):(de&&g.push(""),bn=ye?null:Zn(B.hoistableChunks,C));return bn;case"script":var En=C.async;if(typeof C.src!="string"||!C.src||!En||typeof En=="function"||typeof En=="symbol"||C.onLoad||C.onError||ee.insertionMode===3||ee.tagScope&1||C.itemProp!=null)var du=Wa(g,C);else{var Lr=C.src;if(C.type==="module")var Ta=_.moduleScriptResources,ko=B.preloads.moduleScripts;else Ta=_.scriptResources,ko=B.preloads.scripts;var Oa=Ta.hasOwnProperty(Lr)?Ta[Lr]:void 0;if(Oa!==null){Ta[Lr]=null;var Ra=C;if(Oa){Oa.length===2&&(Ra=K({},C),li(Ra,Oa));var Hn=ko.get(Lr);Hn&&(Hn.length=0)}var Ur=[];B.scripts.add(Ur),Wa(Ur,Ra)}de&&g.push(""),du=null}return du;case"style":var Fr=C.precedence,hi=C.href;if(ee.insertionMode===3||ee.tagScope&1||C.itemProp!=null||typeof Fr!="string"||typeof hi!="string"||hi===""){g.push(Ot("style"));var qn=null,$r=null,Yt;for(Yt in C)if(Q.call(C,Yt)){var Ma=C[Yt];if(Ma!=null)switch(Yt){case"children":qn=Ma;break;case"dangerouslySetInnerHTML":$r=Ma;break;default:Ke(g,Yt,Ma)}}g.push(">");var _a=Array.isArray(qn)?2>qn.length?qn[0]:null:qn;typeof _a!="function"&&typeof _a!="symbol"&&_a!==null&&_a!==void 0&&g.push((""+_a).replace(Sl,Tl)),Vn(g,$r,qn),g.push(yn("style"));var hu=null}else{var zr=B.styles.get(Fr);if((_.styleResources.hasOwnProperty(hi)?_.styleResources[hi]:void 0)!==null){_.styleResources[hi]=null,zr?zr.hrefs.push(te(hi)):(zr={precedence:te(Fr),rules:[],hrefs:[te(hi)],sheets:new Map},B.styles.set(Fr,zr));var un=zr.rules,Hr=null,ls=null,y;for(y in C)if(Q.call(C,y)){var b=C[y];if(b!=null)switch(y){case"children":Hr=b;break;case"dangerouslySetInnerHTML":ls=b}}var E=Array.isArray(Hr)?2>Hr.length?Hr[0]:null:Hr;typeof E!="function"&&typeof E!="symbol"&&E!==null&&E!==void 0&&un.push((""+E).replace(Sl,Tl)),Vn(un,ls,Hr)}zr&&X&&X.styles.add(zr),de&&g.push(""),hu=void 0}return hu;case"meta":if(ee.insertionMode===3||ee.tagScope&1||C.itemProp!=null)var M=Ai(g,C,"meta");else de&&g.push(""),M=ye?null:typeof C.charSet=="string"?Ai(B.charsetChunks,C,"meta"):C.name==="viewport"?Ai(B.viewportChunks,C,"meta"):Ai(B.hoistableChunks,C,"meta");return M;case"listing":case"pre":g.push(Ot(v));var I=null,Y=null,$;for($ in C)if(Q.call(C,$)){var se=C[$];if(se!=null)switch($){case"children":I=se;break;case"dangerouslySetInnerHTML":Y=se;break;default:Ke(g,$,se)}}if(g.push(">"),Y!=null){if(I!=null)throw Error(n(60));if(typeof Y!="object"||!("__html"in Y))throw Error(n(61));var re=Y.__html;re!=null&&(typeof re=="string"&&0B.highImagePreloads.size)&&(ke.delete(Ne),B.highImagePreloads.add(Ue));else if(!_.imageResources.hasOwnProperty(Ne)){_.imageResources[Ne]=Fe;var Ge=C.crossOrigin,Jt=typeof Ge=="string"?Ge==="use-credentials"?Ge:"":void 0,$t=B.headers,fn;$t&&0<$t.remainingCapacity&&(C.fetchPriority==="high"||500>$t.highImagePreloads.length)&&(fn=Qt(ve,"image",{imageSrcSet:C.srcSet,imageSizes:C.sizes,crossOrigin:Jt,integrity:C.integrity,nonce:C.nonce,type:C.type,fetchPriority:C.fetchPriority,referrerPolicy:C.refererPolicy}),0<=($t.remainingCapacity-=fn.length+2))?(B.resets.image[Ne]=Fe,$t.highImagePreloads&&($t.highImagePreloads+=", "),$t.highImagePreloads+=fn):(Ue=[],Zn(Ue,{rel:"preload",as:"image",href:Re?void 0:ve,imageSrcSet:Re,imageSizes:xe,crossOrigin:Jt,integrity:C.integrity,type:C.type,fetchPriority:C.fetchPriority,referrerPolicy:C.referrerPolicy}),C.fetchPriority==="high"||10>B.highImagePreloads.size?B.highImagePreloads.add(Ue):(B.bulkPreloads.add(Ue),ke.set(Ne,Ue)))}}return Ai(g,C,"img");case"base":case"area":case"br":case"col":case"embed":case"hr":case"keygen":case"param":case"source":case"track":case"wbr":return Ai(g,C,v);case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":break;case"head":if(2>ee.insertionMode&&B.headChunks===null){B.headChunks=[];var Gt=Ka(B.headChunks,C,"head")}else Gt=Ka(g,C,"head");return Gt;case"html":if(ee.insertionMode===0&&B.htmlChunks===null){B.htmlChunks=[""];var an=Ka(B.htmlChunks,C,"html")}else an=Ka(g,C,"html");return an;default:if(v.indexOf("-")!==-1){g.push(Ot(v));var mn=null,ur=null,yt;for(yt in C)if(Q.call(C,yt)){var Zt=C[yt];if(Zt!=null){var Cn=yt;switch(yt){case"children":mn=Zt;break;case"dangerouslySetInnerHTML":ur=Zt;break;case"style":Ln(g,Zt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"ref":break;case"className":Cn="class";default:if(me(yt)&&typeof Zt!="function"&&typeof Zt!="symbol"&&Zt!==!1){if(Zt===!0)Zt="";else if(typeof Zt=="object")continue;g.push(" ",Cn,'="',te(Zt),'"')}}}}return g.push(">"),Vn(g,ur,mn),mn}}return Ka(g,C,v)}var Kt=new Map;function yn(g){var v=Kt.get(g);return v===void 0&&(v="",Kt.set(g,v)),v}function Zc(g,v){v=v.bootstrapChunks;for(var C=0;C')}function mf(g,v,C,_){switch(C.insertionMode){case 0:case 1:case 2:return g.push('