import{ObjectWrapper as e}from"../common/common.js";import{TargetDetachedDialog as r}from"../components/components.js";import{NetworkPanelIndicator as o}from"../mobile_throttling/mobile_throttling.js";import{Connections as t,SDKModel as n,ChildTargetManager as a,DebuggerModel as i}from"../sdk/sdk.js";class s extends e.ObjectWrapper{async run(){t.initMainConnection(async()=>{n.TargetManager.instance().createTarget("main",ls`Main`,n.Type.ServiceWorker,null)},r.TargetDetachedDialog.webSocketConnectionLost),new o.NetworkPanelIndicator}}a.ChildTargetManager.install(async({target:e,waitingForDebugger:r})=>{if(e.parentTarget()||e.type()!==n.Type.ServiceWorker||!r)return;const o=e.model(i.DebuggerModel);o&&(o.isReadyToPause()||await o.once(i.Events.DebuggerIsReadyToPause),o.pause())});var c=Object.freeze({__proto__:null,WorkerMainImpl:s});export{c as WorkerMain};
