!function(){"use strict";"undefined"==typeof globalThis&&(window.globalThis=window),(()=>{if(!globalThis.browser&&globalThis.chrome){const e=globalThis.chrome;globalThis.__defineGetter__("browser",(()=>({action:{onClicked:{addListener:t=>e.action.onClicked.addListener(t)},setBadgeText:t=>e.action.setBadgeText(t),setBadgeBackgroundColor:t=>e.action.setBadgeBackgroundColor(t),setTitle:t=>e.action.setTitle(t),setIcon:t=>e.action.setIcon(t)},bookmarks:{get:t=>e.bookmarks.get(t),onCreated:{addListener:t=>e.bookmarks.onCreated.addListener(t),removeListener:t=>e.bookmarks.onCreated.removeListener(t)},onChanged:{addListener:t=>e.bookmarks.onChanged.addListener(t),removeListener:t=>e.bookmarks.onChanged.removeListener(t)},onMoved:{addListener:t=>e.bookmarks.onMoved.addListener(t),removeListener:t=>e.bookmarks.onMoved.removeListener(t)},update:(t,n)=>e.bookmarks.update(t,n)},commands:{onCommand:{addListener:t=>e.commands.onCommand.addListener(t)}},downloads:{download:t=>e.downloads.download(t),onChanged:{addListener:t=>e.downloads.onChanged.addListener(t),removeListener:t=>e.downloads.onChanged.removeListener(t)},search:t=>e.downloads.search(t)},i18n:{getUILanguage:()=>e.i18n.getUILanguage(),getMessage:(t,n)=>e.i18n.getMessage(t,n)},identity:{getRedirectURL:()=>e.identity.getRedirectURL(),getAuthToken:t=>e.identity.getAuthToken(t),launchWebAuthFlow:t=>e.identity.launchWebAuthFlow(t),removeCachedAuthToken:t=>e.identity.removeCachedAuthToken(t)},contextMenus:{onClicked:{addListener:t=>e.contextMenus.onClicked.addListener(t)},create:t=>e.contextMenus.create(t),update:(t,n)=>e.contextMenus.update(t,n),removeAll:()=>e.contextMenus.removeAll()},permissions:{request:t=>e.permissions.request(t),remove:t=>e.permissions.remove(t)},runtime:{id:e.runtime.id,sendNativeMessage:(t,n)=>new Promise(((r,o)=>{e.runtime.sendNativeMessage(t,n,(t=>{e.runtime.lastError?o(e.runtime.lastError):r(t)}))})),getManifest:()=>e.runtime.getManifest(),onMessage:{addListener:t=>e.runtime.onMessage.addListener(((e,n,r)=>{const o=t(e,n);if(o&&"function"==typeof o.then)return o.then((e=>{if(void 0!==e)try{r(e)}catch(e){}})),!0})),removeListener:t=>e.runtime.onMessage.removeListener(t)},onMessageExternal:{addListener:t=>e.runtime.onMessageExternal.addListener(((e,n,r)=>{const o=t(e,n);if(o&&"function"==typeof o.then)return o.then((e=>{if(void 0!==e)try{r(e)}catch(e){}})),!0}))},sendMessage:t=>new Promise(((n,r)=>{e.runtime.sendMessage(t,(t=>{e.runtime.lastError?r(e.runtime.lastError):n(t)})),e.runtime.lastError&&r(e.runtime.lastError)})),getURL:t=>e.runtime.getURL(t),getContexts:t=>e.runtime.getContexts(t),get lastError(){return e.runtime.lastError}},scripting:{executeScript:t=>e.scripting.executeScript(t)},storage:{local:{set:t=>e.storage.local.set(t),get:t=>e.storage.local.get(t),clear:()=>e.storage.local.clear(),remove:t=>e.storage.local.remove(t)},sync:{set:t=>e.storage.sync.set(t),get:t=>e.storage.sync.get(t),clear:()=>e.storage.sync.clear(),remove:t=>e.storage.sync.remove(t)}},tabs:{onCreated:{addListener:t=>e.tabs.onCreated.addListener(t)},onActivated:{addListener:t=>e.tabs.onActivated.addListener(t)},onUpdated:{addListener:t=>e.tabs.onUpdated.addListener(t),removeListener:t=>e.tabs.onUpdated.removeListener(t)},onRemoved:{addListener:t=>e.tabs.onRemoved.addListener(t),removeListener:t=>e.tabs.onRemoved.removeListener(t)},onReplaced:{addListener:t=>e.tabs.onReplaced.addListener(t),removeListener:t=>e.tabs.onReplaced.removeListener(t)},captureVisibleTab:(t,n)=>e.tabs.captureVisibleTab(t,n),sendMessage:(t,n,r={})=>new Promise(((o,s)=>{e.tabs.sendMessage(t,n,r,(t=>{e.runtime.lastError?s(e.runtime.lastError):o(t)})),e.runtime.lastError&&s(e.runtime.lastError)})),query:t=>e.tabs.query(t),create:t=>e.tabs.create(t),get:t=>e.tabs.get(t),remove:t=>e.tabs.remove(t),update:(t,n)=>e.tabs.update(t,n)},devtools:{inspectedWindow:{onResourceContentCommitted:{addListener:t=>e.devtools.inspectedWindow.onResourceContentCommitted.addListener(t)},get tabId(){return e.devtools.inspectedWindow.tabId}}},offscreen:{createDocument:t=>e.offscreen.createDocument(t)},declarativeNetRequest:{updateSessionRules:t=>e.declarativeNetRequest.updateSessionRules(t)}})))}})()}();
