const e=require("../_util/transition.js"),t=require("../_util/collapseMotion.js"),n=require("./context.js"),r=require("./style/index.js");let i=require("vue");var a=(0,i.defineComponent)({compatConfig:{MODE:3},name:`ErrorList`,inheritAttrs:!1,props:[`errors`,`help`,`onErrorVisibleChanged`,`helpStatus`,`warnings`],setup(a,{attrs:o}){let{prefixCls:s,status:c}=n.useInjectFormItemPrefix(),l=(0,i.computed)(()=>`${s.value}-item-explain`),u=(0,i.computed)(()=>!!(a.errors&&a.errors.length)),d=(0,i.ref)(c.value),[,f]=r.default(s);return(0,i.watch)([u,c],()=>{u.value&&(d.value=c.value)}),()=>{let n=t.default(`${s.value}-show-help-item`),r=e.getTransitionGroupProps(`${s.value}-show-help-item`,n);return r.role=`alert`,r.class=[f.value,l.value,o.class,`${s.value}-show-help`],(0,i.createVNode)(i.Transition,{...e.getTransitionProps(`${s.value}-show-help`),onAfterEnter:()=>a.onErrorVisibleChanged(!0),onAfterLeave:()=>a.onErrorVisibleChanged(!1)},{default:()=>[(0,i.withDirectives)((0,i.createVNode)(i.TransitionGroup,{...r,tag:`div`},{default:()=>[a.errors?.map((e,t)=>(0,i.createVNode)(`div`,{key:t,class:d.value?`${l.value}-${d.value}`:``},[e]))]}),[[i.vShow,!!a.errors?.length]])]})}}});exports.default=a;