const e=require("../_util/type.js"),t=require("../_util/classNames.js"),n=require("../_util/props-util/initDefaultProps.js"),r=require("../_util/props-util/index.js"),i=require("../config-provider/hooks/useConfigInject.js"),a=require("../_util/vue-types/index.js"),o=require("./TimelineItem.js"),s=require("./style/index.js");let c=require("vue"),l=require("@antsoo-lib/icons");var u=()=>({prefixCls:String,pending:a.default.any,pendingDot:a.default.any,reverse:e.booleanType(),mode:a.default.oneOf(e.tuple(`left`,`alternate`,`right`,``))}),d=(0,c.defineComponent)({compatConfig:{MODE:3},name:`ATimeline`,inheritAttrs:!1,props:n.default(u(),{reverse:!1,mode:``}),slots:Object,setup(e,{slots:n,attrs:a}){let{prefixCls:u,direction:d}=i.default(`timeline`,e),[f,p]=s.default(u),m=(t,n)=>{let r=t.props||{};return e.mode===`alternate`?r.position===`right`?`${u.value}-item-right`:r.position===`left`||n%2==0?`${u.value}-item-left`:`${u.value}-item-right`:e.mode===`left`?`${u.value}-item-left`:e.mode===`right`||r.position===`right`?`${u.value}-item-right`:``};return()=>{let{pending:i=n.pending?.(),pendingDot:s=n.pendingDot?.(),reverse:h,mode:g}=e,_=typeof i==`boolean`?null:i,v=r.filterEmpty(n.default?.()),y=i?(0,c.createVNode)(o.default,{pending:!!i,dot:s||(0,c.createVNode)(l.LoadingOutlined,null,null)},{default:()=>[_]}):null;y&&v.push(y);let b=h?v.reverse():v,x=b.length,S=`${u.value}-item-last`,C=b.map((e,n)=>{let r=n===x-2?S:``,a=n===x-1?S:``;return(0,c.cloneVNode)(e,{class:t.default([!h&&i?r:a,m(e,n)])})}),w=b.some(e=>!!(e.props?.label||e.children?.label)),T=t.default(u.value,{[`${u.value}-pending`]:!!i,[`${u.value}-reverse`]:!!h,[`${u.value}-${g}`]:!!g&&!w,[`${u.value}-label`]:w,[`${u.value}-rtl`]:d.value===`rtl`},a.class,p.value);return f((0,c.createVNode)(`ul`,{...a,class:T},[C]))}}});exports.default=d,exports.timelineProps=u;