import{an as V,a as $,y as N,ae as B,C as D,f as c,r as F,a1 as E,ad as M,j as p,_ as d,M as x,F as R,a0 as W,L as k}from"./index.0d073eaa.js";import{u as q}from"./useFlexGapSupport.474c31b7.js";var H={small:8,middle:16,large:24},J=function(){return{prefixCls:String,size:{type:[String,Number,Array]},direction:N.oneOf(B("horizontal","vertical")).def("horizontal"),align:N.oneOf(B("start","end","center","baseline")),wrap:{type:Boolean,default:void 0}}};function K(i){return typeof i=="string"?H[i]:i||0}var Q=$({name:"ASpace",props:J(),slots:["split"],setup:function(t,G){var s=G.slots,f=D("space",t),l=f.prefixCls,I=f.space,S=f.direction,_=q(),r=c(function(){var a,e,n;return(n=(a=t.size)!==null&&a!==void 0?a:(e=I.value)===null||e===void 0?void 0:e.size)!==null&&n!==void 0?n:"small"}),m=F(),o=F();E(r,function(){var a=(Array.isArray(r.value)?r.value:[r.value,r.value]).map(function(n){return K(n)}),e=W(a,2);m.value=e[0],o.value=e[1]},{immediate:!0});var z=c(function(){return t.align===void 0&&t.direction==="horizontal"?"center":t.align}),P=c(function(){var a;return k(l.value,"".concat(l.value,"-").concat(t.direction),(a={},x(a,"".concat(l.value,"-rtl"),S.value==="rtl"),x(a,"".concat(l.value,"-align-").concat(z.value),z.value),a))}),j=c(function(){return S.value==="rtl"?"marginLeft":"marginRight"}),L=c(function(){var a={};return _.value&&(a.columnGap="".concat(m.value,"px"),a.rowGap="".concat(o.value,"px")),d(d({},a),t.wrap&&{flexWrap:"wrap",marginBottom:"".concat(-o.value,"px")})});return function(){var a,e,n=t.wrap,h=t.direction,O=h===void 0?"horizontal":h,C=M((a=s.default)===null||a===void 0?void 0:a.call(s)),w=C.length;if(w===0)return null;var u=(e=s.split)===null||e===void 0?void 0:e.call(s),b="".concat(l.value,"-item"),A=m.value,g=w-1;return p("div",{class:P.value,style:L.value},[C.map(function(T,y){var v={};return _.value||(O==="vertical"?y<g&&(v={marginBottom:"".concat(A/(u?2:1),"px")}):v=d(d({},y<g&&x({},j.value,"".concat(A/(u?2:1),"px"))),n&&{paddingBottom:"".concat(o.value,"px")})),p(R,null,[p("div",{class:b,style:v},[T]),y<g&&u&&p("span",{class:"".concat(b,"-split"),style:v},[u])])})])}}}),Y=V(Q);export{Y as S};
