import{k as G,d as R,aP as E,aQ as j,q as w,bE as P,T,U as C,a6 as I,m as M,X as A,bF as F,B as S,bG as L}from"./index-Ci_yf8On.js";let h;function N(){if(!G)return!0;if(h===void 0){const e=document.createElement("div");e.style.display="flex",e.style.flexDirection="column",e.style.rowGap="1px",e.appendChild(document.createElement("div")),e.appendChild(document.createElement("div")),document.body.appendChild(e);const a=e.scrollHeight===1;return document.body.removeChild(e),h=a}return h}const O=Object.assign(Object.assign({},C.props),{align:String,justify:{type:String,default:"start"},inline:Boolean,vertical:Boolean,reverse:Boolean,size:{type:[String,Number,Array],default:"medium"},wrapItem:{type:Boolean,default:!0},itemClass:String,itemStyle:[String,Object],wrap:{type:Boolean,default:!0},internalUseGap:{type:Boolean,default:void 0}}),W=R({name:"Space",props:O,setup(e){const{mergedClsPrefixRef:a,mergedRtlRef:u}=T(e),d=C("Space","-space",void 0,L,e,a),t=I("Space",u,a);return{useGap:N(),rtlEnabled:t,mergedClsPrefix:a,margin:M(()=>{const{size:n}=e;if(Array.isArray(n))return{horizontal:n[0],vertical:n[1]};if(typeof n=="number")return{horizontal:n,vertical:n};const{self:{[A("gap",n)]:f}}=d.value,{row:r,col:g}=F(f);return{horizontal:S(g),vertical:S(r)}})}},render(){const{vertical:e,reverse:a,align:u,inline:d,justify:t,itemClass:n,itemStyle:f,margin:r,wrap:g,mergedClsPrefix:v,rtlEnabled:x,useGap:l,wrapItem:B,internalUseGap:$}=this,p=E(j(this),!1);if(!p.length)return null;const b=`${r.horizontal}px`,c=`${r.horizontal/2}px`,z=`${r.vertical}px`,i=`${r.vertical/2}px`,o=p.length-1,m=t.startsWith("space-");return w("div",{role:"none",class:[`${v}-space`,x&&`${v}-space--rtl`],style:{display:d?"inline-flex":"flex",flexDirection:e&&!a?"column":e&&a?"column-reverse":!e&&a?"row-reverse":"row",justifyContent:["start","end"].includes(t)?`flex-${t}`:t,flexWrap:!g||e?"nowrap":"wrap",marginTop:l||e?"":`-${i}`,marginBottom:l||e?"":`-${i}`,alignItems:u,gap:l?`${r.vertical}px ${r.horizontal}px`:""}},!B&&(l||$)?p:p.map((y,s)=>y.type===P?y:w("div",{role:"none",class:n,style:[f,{maxWidth:"100%"},l?"":e?{marginBottom:s!==o?z:""}:x?{marginLeft:m?t==="space-between"&&s===o?"":c:s!==o?b:"",marginRight:m?t==="space-between"&&s===0?"":c:"",paddingTop:i,paddingBottom:i}:{marginRight:m?t==="space-between"&&s===o?"":c:s!==o?b:"",marginLeft:m?t==="space-between"&&s===0?"":c:"",paddingTop:i,paddingBottom:i}]},y)))}});export{W as N};
