import*as Common from'../common/common.js';import*as Components from'../components/components.js';import*as MobileThrottling from'../mobile_throttling/mobile_throttling.js';import*as SDK from'../sdk/sdk.js';export class WorkerMainImpl extends Common.ObjectWrapper.ObjectWrapper{run(){SDK.Connections.initMainConnection(()=>{self.SDK.targetManager.createTarget('main',ls`Main`,SDK.SDKModel.Type.ServiceWorker,null);},Components.TargetDetachedDialog.TargetDetachedDialog.webSocketConnectionLost);new MobileThrottling.NetworkPanelIndicator.NetworkPanelIndicator();}}
SDK.ChildTargetManager.ChildTargetManager.install(async({target,waitingForDebugger})=>{if(target.parentTarget()||target.type()!==SDK.SDKModel.Type.ServiceWorker||!waitingForDebugger){return;}
const debuggerModel=target.model(SDK.DebuggerModel.DebuggerModel);if(!debuggerModel){return;}
if(!debuggerModel.isReadyToPause()){await debuggerModel.once(SDK.DebuggerModel.Events.DebuggerIsReadyToPause);}
debuggerModel.pause();});