"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),C=require("../_util/classNames.js"),R=require("../_util/hooks/useFlexGapSupport.js"),l=require("../_util/responsiveObserve.js"),f=require("../_util/type.js"),T=require("../config-provider/hooks/useConfigInject.js"),k=require("./context.js"),B=require("./style/index.js"),j=()=>({align:f.someType([String,Object]),justify:f.someType([String,Object]),prefixCls:String,gutter:f.someType([Number,Array,Object],0),wrap:{type:Boolean,default:void 0}}),M=n.defineComponent({compatConfig:{MODE:3},name:"ARow",inheritAttrs:!1,props:j(),setup(u,{slots:S,attrs:a}){const{prefixCls:o,direction:$}=T.default("row",u),[h,q]=B.useRowStyle(o);let d;const v=l.default(),p=n.ref({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}),y=n.ref({xs:!1,sm:!1,md:!1,lg:!1,xl:!1,xxl:!1}),m=t=>n.computed(()=>{if(typeof u[t]=="string")return u[t];if(typeof u[t]!="object")return"";for(let e=0;e<l.responsiveArray.length;e++){const s=l.responsiveArray[e];if(!y.value[s])continue;const r=u[t][s];if(r!==void 0)return r}return""}),g=m("align"),b=m("justify"),x=R.default();n.onMounted(()=>{d=v.value.subscribe(t=>{y.value=t;const e=u.gutter||0;(!Array.isArray(e)&&typeof e=="object"||Array.isArray(e)&&(typeof e[0]=="object"||typeof e[1]=="object"))&&(p.value=t)})}),n.onBeforeUnmount(()=>{v.value.unsubscribe(d)});const A=n.computed(()=>{const t=[void 0,void 0],{gutter:e=0}=u;return(Array.isArray(e)?e:[e,void 0]).forEach((r,w)=>{if(typeof r=="object")for(let i=0;i<l.responsiveArray.length;i++){const c=l.responsiveArray[i];if(p.value[c]&&r[c]!==void 0){t[w]=r[c];break}}else t[w]=r}),t});k.default({gutter:A,supportFlexGap:x,wrap:n.computed(()=>u.wrap)});const G=n.computed(()=>C.default(o.value,{[`${o.value}-no-wrap`]:u.wrap===!1,[`${o.value}-${b.value}`]:b.value,[`${o.value}-${g.value}`]:g.value,[`${o.value}-rtl`]:$.value==="rtl"},a.class,q.value)),O=n.computed(()=>{const t=A.value,e={},s=t[0]!=null&&t[0]>0?`${t[0]/-2}px`:void 0,r=t[1]!=null&&t[1]>0?`${t[1]/-2}px`:void 0;return s&&(e.marginLeft=s,e.marginRight=s),x.value?e.rowGap=`${t[1]}px`:r&&(e.marginTop=r,e.marginBottom=r),e});return()=>h(n.createVNode("div",{...a,class:G.value,style:{...O.value,...a.style}},[S.default?.()]))}});exports.default=M;exports.rowProps=j;
