import*as Host from"../host/host.js";import{Context}from"./Context.js";import{KeyboardShortcut}from"./KeyboardShortcut.js";import{ForwardedShortcut,ShortcutRegistry}from"./ShortcutRegistry.js";export class ForwardedInputEventHandler{constructor(){Host.InspectorFrontendHost.InspectorFrontendHostInstance.events.addEventListener(Host.InspectorFrontendHostAPI.Events.KeyEventUnhandled,this._onKeyEventUnhandled,this)}_onKeyEventUnhandled(t){const e=t.data,o=e.type,r=e.key,n=e.keyCode,s=e.modifiers;if("keydown"!==o)return;const d=Context.instance(),a=ShortcutRegistry.instance();d.setFlavor(ForwardedShortcut,ForwardedShortcut.instance),a.handleKey(KeyboardShortcut.makeKey(n,s),r),d.setFlavor(ForwardedShortcut,null)}}new ForwardedInputEventHandler;