import{g as p,p as b,r as v,u as y,a as F,x as V,n as h,b as R}from"./index-C5GbdPxY.js";import{e as P,f as k}from"./VTextField-DxEUpn3-.js";import{f as C}from"./forwardRefs-CB8NoG9r.js";const S=b({...F(),...k()},"VForm"),D=p()({name:"VForm",props:S(),emits:{"update:modelValue":o=>!0,submit:o=>!0},setup(o,i){let{slots:s,emit:f}=i;const r=P(o),n=v();function l(t){t.preventDefault(),r.reset()}function u(t){const a=t,e=r.validate();a.then=e.then.bind(e),a.catch=e.catch.bind(e),a.finally=e.finally.bind(e),f("submit",a),a.defaultPrevented||e.then(c=>{var m;let{valid:d}=c;d&&((m=n.value)==null||m.submit())}),a.preventDefault()}return y(()=>{var t;return V("form",{ref:n,class:R(["v-form",o.class]),style:h(o.style),novalidate:!0,onReset:l,onSubmit:u},[(t=s.default)==null?void 0:t.call(s,r)])}),C(r,n)}});export{D as V};
