"use strict";(self.webpackChunkdami=self.webpackChunkdami||[]).push([[1548],{71548:(t,i,a)=>{a.r(i),a.d(i,{default:()=>c});var e=a(93150),s=a.n(e),d=a(31263),r=a(31791);const c=async function({id:t,data:i}){if(this.windowId)try{await s().windows.get(this.windowId)}catch(t){this.windowId=null}if(!/^https?/.test(i.url)){const t=new Error((0,d.cb)(i.url)?"url-empty":"invalid-active-tab");throw t.data={url:i.url},t}let a=null;if(a=i.updatePrevTab&&this.activeTab.id?await s().tabs.update(this.activeTab.id,{url:i.url,active:i.active}):await s().tabs.create({url:i.url,active:i.active,windowId:this.windowId}),this.activeTab.url=i.url,a&&((this.settings.debugMode||i.customUserAgent)&&(await(0,r.xq)(a.id,this.activeTab.id),this.debugAttached=!0,i.customUserAgent&&(await(0,r.k)(a.id,"Network.setUserAgentOverride",{userAgent:i.userAgent}),await s().tabs.reload(a.id),await(0,d._v)(1e3))),this.activeTab.id=a.id,this.windowId=a.windowId),i.inGroup&&!i.updatePrevTab){const t={groupId:this.activeTab.groupId,tabIds:this.activeTab.id};this.activeTab.groupId||(t.createProperties={windowId:this.windowId}),chrome.tabs.group(t,(t=>{this.activeTab.groupId=t}))}return this.activeTab.frameId=0,!this.settings.debugMode&&i.customUserAgent&&chrome.debugger.detach({tabId:a.id}),this.preloadScripts.length>0&&(this.engine.isMV2?await this._sendMessageToTab({isPreloadScripts:!0,label:"javascript-code",data:{scripts:this.preloadScripts}}):await(0,r.SR)({scripts:this.preloadScripts,frameSelector:this.frameSelector,target:{tabId:this.activeTab.id,frameIds:[this.activeTab.frameId||0]}})),i.waitTabLoaded&&await(0,r.Hh)({listenError:!0,tabId:this.activeTab.id,ms:this.settings?.tabLoadTimeout??3e4}),await s().windows.update(a.windowId,{focused:!0}),{data:i.url,nextBlockId:this.getBlockConnections(t)}}}}]);