import{Settings as e}from"../common/common.js";import{i18n as o}from"../i18n/i18n.js";import{Runtime as t}from"../root/root.js";import{ViewManager as i,ActionRegistration as r}from"../ui/ui.js";let a;const n={memory:"Memory",liveHeapProfile:"Live Heap Profile",startRecordingHeapAllocations:"Start recording heap allocations",stopRecordingHeapAllocations:"Stop recording heap allocations",startRecordingHeapAllocationsAndReload:"Start recording heap allocations and reload the page",startStopRecording:"Start/stop recording",showNativeFunctions:"Show native functions in JS Profile",showMemory:"Show Memory",showLiveHeapProfile:"Show Live Heap Profile"},l=o.registerUIStrings("profiler/profiler-meta.ts",n),s=o.getLazilyComputedLocalizedString.bind(void 0,l);async function c(){return a||(await t.Runtime.instance().loadModulePromise("profiler"),a=await import("./profiler.js")),a}function g(e){return void 0===a?[]:e(a)}i.registerViewExtension({location:"panel",id:"heap_profiler",commandPrompt:s(n.showMemory),title:s(n.memory),order:60,loadView:async()=>(await c()).HeapProfilerPanel.HeapProfilerPanel.instance()}),i.registerViewExtension({location:"drawer-view",id:"live_heap_profile",commandPrompt:s(n.showLiveHeapProfile),title:s(n.liveHeapProfile),persistence:"closeable",order:100,loadView:async()=>(await c()).LiveHeapProfileView.LiveHeapProfileView.instance(),experiment:t.ExperimentName.LIVE_HEAP_PROFILE}),r.registerActionExtension({actionId:"live-heap-profile.toggle-recording",iconClass:"largeicon-start-recording",toggleable:!0,toggledIconClass:"largeicon-stop-recording",toggleWithRedColor:!0,loadActionDelegate:async()=>(await c()).LiveHeapProfileView.ActionDelegate.instance(),category:r.ActionCategory.MEMORY,experiment:t.ExperimentName.LIVE_HEAP_PROFILE,options:[{value:!0,title:s(n.startRecordingHeapAllocations)},{value:!1,title:s(n.stopRecordingHeapAllocations)}]}),r.registerActionExtension({actionId:"live-heap-profile.start-with-reload",iconClass:"largeicon-refresh",loadActionDelegate:async()=>(await c()).LiveHeapProfileView.ActionDelegate.instance(),category:r.ActionCategory.MEMORY,experiment:t.ExperimentName.LIVE_HEAP_PROFILE,title:s(n.startRecordingHeapAllocationsAndReload)}),r.registerActionExtension({actionId:"profiler.heap-toggle-recording",category:r.ActionCategory.MEMORY,iconClass:"largeicon-start-recording",title:s(n.startStopRecording),toggleable:!0,toggledIconClass:"largeicon-stop-recording",toggleWithRedColor:!0,contextTypes:()=>g((e=>[e.HeapProfilerPanel.HeapProfilerPanel])),loadActionDelegate:async()=>(await c()).HeapProfilerPanel.HeapProfilerPanel.instance(),bindings:[{platform:"windows,linux",shortcut:"Ctrl+E"},{platform:"mac",shortcut:"Meta+E"}]}),r.registerActionExtension({actionId:"profiler.js-toggle-recording",category:r.ActionCategory.JAVASCRIPT_PROFILER,title:s(n.startStopRecording),iconClass:"largeicon-start-recording",toggleable:!0,toggledIconClass:"largeicon-stop-recording",toggleWithRedColor:!0,contextTypes:()=>g((e=>[e.ProfilesPanel.JSProfilerPanel])),loadActionDelegate:async()=>(await c()).ProfilesPanel.JSProfilerPanel.instance(),bindings:[{platform:"windows,linux",shortcut:"Ctrl+E"},{platform:"mac",shortcut:"Meta+E"}]}),e.registerSettingExtension({category:e.SettingCategoryObject.PERFORMANCE,title:s(n.showNativeFunctions),settingName:"showNativeFunctionsInJSProfile",settingType:e.SettingTypeObject.BOOLEAN,defaultValue:!0});export{n as UIStrings};
