import{FormView}from"../base.mjs";import{PromptInputView}from"../input.mjs";class SubmitPromptInputView extends PromptInputView{async keyPressed(t){await super.keyPressed(t),"Enter"===t.code&&t.ctrlKey&&this.form.shortcutSubmit()}}class PromptsFormView extends FormView{constructor(t,s){super(t,s),this.shortcutSubmitCallbacks=[]}static autoSubmit=!0;static fieldSets={Prompts:{prompt:{label:"Prompt",class:SubmitPromptInputView},negativePrompt:{label:"Negative Prompt",class:SubmitPromptInputView}}};onShortcutSubmit(t){this.shortcutSubmitCallbacks.push(t)}async shortcutSubmit(){await this.submit();for(let t of this.shortcutSubmitCallbacks)await t()}}export{PromptsFormView};
