import{FormView}from"../base.mjs";import{PromptInputView,NumberInputView,CheckboxInputView}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,e){super(t,e),this.shortcutSubmitCallbacks=[]}static autoSubmit=!0;static fieldSets={Prompts:{usePromptTravel:{label:"Use Prompt Travel",class:CheckboxInputView,config:{tooltip:"When enabled, you can change prompts throughout an animation using a timeline interface. When disabled, the same problem will be used throughout the entire animation."}},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()}}class PromptTravelFormView extends FormView{static autoSubmit=!0;static fieldSets={Prompts:{positive:{label:"Prompt",class:SubmitPromptInputView},negative:{label:"Negative Prompt",class:SubmitPromptInputView}},Weight:{weight:{class:NumberInputView,config:{min:.01,value:1,step:.01,tooltip:"The weight of this prompt. It is recommended to keep your highest-weight prompt at 1.0 and scale others relative to that, but this is unconstrained."}}}}}export{PromptsFormView,PromptTravelFormView};
