import{d as g}from"./index-Df5zok-J.js";import{f as m,c as y,d as h,h as v,b as s,J as c,a8 as z,a9 as A}from"./index-CriPLLD7.js";m(g);const[u,w]=y("space"),S={align:String,direction:{type:String,default:"horizontal"},size:{type:[Number,String,Array],default:8},wrap:Boolean,fill:Boolean};function d(e=[]){const n=[];return e.forEach(t=>{Array.isArray(t)?n.push(...t):t.type===c?n.push(...d(t.children)):n.push(t)}),n.filter(t=>{var i;return!(t&&(t.type===z||t.type===c&&((i=t.children)==null?void 0:i.length)===0||t.type===A&&t.children.trim()===""))})}var $=h({name:u,props:S,setup(e,{slots:n}){const t=v(()=>{var a;return(a=e.align)!=null?a:e.direction==="horizontal"?"center":""}),i=a=>typeof a=="number"?a+"px":a,f=a=>{const r={},o=`${i(Array.isArray(e.size)?e.size[0]:e.size)}`,l=`${i(Array.isArray(e.size)?e.size[1]:e.size)}`;return a?e.wrap?{marginBottom:l}:{}:(e.direction==="horizontal"&&(r.marginRight=o),(e.direction==="vertical"||e.wrap)&&(r.marginBottom=l),r)};return()=>{var a;const r=d((a=n.default)==null?void 0:a.call(n));return s("div",{class:[w({[e.direction]:e.direction,[`align-${t.value}`]:t.value,wrap:e.wrap,fill:e.fill})]},[r.map((o,l)=>s("div",{key:`item-${l}`,class:`${u}-item`,style:f(l===r.length-1)},[o]))])}}});const B=m($);export{B as S};
