import{d as f,az as g,j as x,o as b,i,k as d,aA as w,aB as y,p as c,q as B,h as C,bu as V,H as m,bC as u,r as k,g as _,_ as A,c as D,A as $,bB as z,m as E}from"./index-BX34W763.js";import{A as K}from"./DocumentMobileHeader.vue-CXp3gXuT.js";const P={class:"flex gap-2"},M={class:"flex max-h-8 flex-1"},j=f({__name:"CommandActionForm",props:{loading:{},disabled:{type:Boolean,default:!1}},emits:["submit","cancel","back"],setup(p){const{cx:l}=g();return(t,a)=>(b(),x("form",{class:"flex w-full flex-col gap-3",onKeydown:a[0]||(a[0]=u(m(()=>{},["stop"]),["enter"])),onSubmit:a[1]||(a[1]=m(n=>t.$emit("submit"),["prevent","stop"]))},[i("div",w(y(c(l)("relative flex min-h-20 flex-col rounded"))),[d(t.$slots,"default")],16),i("div",P,[i("div",M,[d(t.$slots,"options")]),B(c(K),{class:"max-h-8 p-0 px-3 text-xs",disabled:t.disabled,loading:t.loading,type:"submit"},{default:C(()=>[d(t.$slots,"submit",{},()=>[a[2]||(a[2]=V("Continue"))])]),_:3},8,["disabled","loading"])])],32))}}),N=["placeholder"],q=f({inheritAttrs:!1,__name:"CommandActionInput",props:{modelValue:{},placeholder:{},autofocus:{type:Boolean}},emits:["update:modelValue","onDelete"],setup(p,{emit:l}){const t=p,a=l,n=k(null);_(()=>A(()=>{t.autofocus||n.value?.focus()}));const r=D({get:()=>t.modelValue??"",set:e=>a("update:modelValue",e)});function h(e){if(e.shiftKey||!e.target)return;e.preventDefault();const o=e.target,s=new Event("submit",{cancelable:!0});o.form?.dispatchEvent(s)}function v(e){r.value===""&&(e.preventDefault(),e.stopPropagation(),a("onDelete",e))}return(e,o)=>$((b(),x("textarea",E({id:"command-action-input",ref_key:"input",ref:n,"onUpdate:modelValue":o[0]||(o[0]=s=>r.value=s),class:"min-h-8 w-full flex-1 resize-none border border-transparent py-1.5 pl-8.5 text-sm outline-none focus:border-b-1",placeholder:t.placeholder??"",wrap:"hard"},e.$attrs,{onKeydown:[o[1]||(o[1]=u(s=>v(s),["delete"])),o[2]||(o[2]=u(s=>h(s),["enter"]))]}),null,16,N)),[[z,r.value]])}});export{q as E,j as h};
