import{withInstall as e}from"../_util/type.mjs";import t from"../_util/omit.mjs";import{useConfigContextInject as n}from"../config-provider/context.mjs";import r from"../config-provider/hooks/useConfigInject.mjs";import{isPresetSize as i}from"../_util/gapSize.mjs";import{flexProps as a}from"./interface.mjs";import o from"./utils.mjs";import s from"./style/index.mjs";import{computed as c,createVNode as l,defineComponent as u}from"vue";var d=e(u({name:`AFlex`,inheritAttrs:!1,props:a(),setup(e,{slots:a,attrs:u}){let{flex:d,direction:f}=n(),{prefixCls:p}=r(`flex`,e),[m,h]=s(p),g=c(()=>[p.value,h.value,o(p.value,e),{[`${p.value}-rtl`]:f.value===`rtl`,[`${p.value}-gap-${e.gap}`]:i(e.gap),[`${p.value}-vertical`]:e.vertical??d?.value.vertical}]);return()=>{let{flex:n,gap:r,component:o=`div`,...s}=e,c={};return n&&(c.flex=n),r&&!i(r)&&(c.gap=`${r}px`),m(l(o,{class:[u.class,g.value],style:[u.style,c],...t(s,[`justify`,`wrap`,`align`,`vertical`])},{default:()=>[a.default?.()]}))}}}));export{d as default};