import{removeBloomQuickPanels as f}from"./panel.js-Sp61DuG0.js";import{createTradingPanel as r}from"./panel-new.js-BnOGaXq1.js";import"./utils.js-CCIONsCi.js";const i="solscan";window.platform=i;async function c(){const e=new URL(window.location.href);if(e.pathname.includes("/token/")){const t=e.pathname.split("/").pop();if(t)return t}const o=document.querySelector('a[href*="/token/"]')?.href.split("/").pop();return o||showToast("Token mint not found!","top-center","error")}window.getTokenMint=c;async function m(){return c()}window.getPoolId=m;let n,a;chrome.runtime.onMessage.addListener(async function(e){if(a=e.tabId,e.message==="txUpdate")return showSwapToast(e);e.shouldWarnAboutUpdate&&showToast("A new version of the Bloom Extension is available! Check out how to install it <a href='https://docs.bloombot.app/extension/setup/download-chrome/.zip-file' target='_blank' style='text-decoration: underline; color: #EEA7ED;'>here</a>","top-center","info");const o=(await chrome.storage.local.get("bloom.sitePreferences"))?.["bloom.sitePreferences"]||{};f(),o[i]!==!1&&(e.message==="solscan-token"||e.message==="reset"&&n==="solscan-token"?(n="solscan-token",window.__BLOOM_TAB_ID__=a,r()):e.message==="solscan-account"||e.message==="reset"&&n==="solscan-account"?(n="solscan-account",await u()?(window.__BLOOM_TAB_ID__=a,r()):n="other"):n="other")});async function u(e=5e3){for(let o=0;o<e/500;o++){const t=Array.from(document.querySelectorAll("h4")),l=Array.from(document.querySelectorAll("div.text-neutral5"));if(t.length)return!!(t.some(s=>s.textContent==="Token Account")&&l.some(s=>s.textContent==="SPL Token Name"));await new Promise(s=>setTimeout(s,500))}return!1}
