"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("../_util/props-util/index.js"),S=require("../_util/vnode.js"),q=require("../config-provider/hooks/useConfigInject.js"),$=require("../popover/index.js"),N=require("./Avatar.js"),b=require("./AvatarContext.js"),A=require("./style/index.js"),f=()=>({prefixCls:String,maxCount:Number,maxStyle:{type:Object,default:void 0},maxPopoverPlacement:{type:String,default:"top"},maxPopoverTrigger:String,size:{type:[Number,String,Object],default:"default"},shape:{type:String,default:"circle"}}),O=e.defineComponent({compatConfig:{MODE:3},name:"AAvatarGroup",inheritAttrs:!1,props:f(),setup(r,{slots:m,attrs:t}){const{prefixCls:i,direction:g}=q.default("avatar",r),l=e.computed(()=>`${i.value}-group`),[d,h]=A.default(i);return e.watchEffect(()=>{const s={size:r.size,shape:r.shape};b.useAvatarProviderContext(s)}),()=>{const{maxPopoverPlacement:s="top",maxCount:o,maxStyle:x,maxPopoverTrigger:y="hover",shape:C}=r,p={[l.value]:!0,[`${l.value}-rtl`]:g.value==="rtl",[`${t.class}`]:!!t.class,[h.value]:!0},P=v.getPropsSlot(m,r),a=v.flattenChildren(P).map((n,c)=>S.cloneElement(n,{key:`avatar-key-${c}`})),u=a.length;if(o&&o<u){const n=a.slice(0,o),c=a.slice(o,u);return n.push(e.createVNode($.default,{key:"avatar-popover-key",content:c,trigger:y,placement:s,overlayClassName:`${l.value}-popover`},{default:()=>[e.createVNode(N.default,{style:x,shape:C},{default:()=>[`+${u-o}`]})]})),d(e.createVNode("div",{...t,class:p,style:t.style},[n]))}return d(e.createVNode("div",{...t,class:p,style:t.style},[a]))}}});exports.default=O;exports.groupProps=f;
