const e=require("../_util/type.js"),t=require("../_util/classNames.js"),n=require("../_util/omit.js"),r=require("../_util/vue-types/index.js");let i=require("vue");function a(e){return typeof e==`string`}function o(){}var s=()=>({prefixCls:String,itemWidth:String,active:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},status:e.stringType(),iconPrefix:String,icon:r.default.any,adjustMarginRight:String,stepNumber:Number,stepIndex:Number,description:r.default.any,title:r.default.any,subTitle:r.default.any,progressDot:r.withUndefined(r.default.oneOfType([r.default.looseBool,r.default.func])),tailContent:r.default.any,icons:r.default.shape({finish:r.default.any,error:r.default.any}).loose,onClick:e.functionType(),onStepClick:e.functionType(),stepIcon:e.functionType(),itemRender:e.functionType(),__legacy:e.booleanType()}),c=(0,i.defineComponent)({compatConfig:{MODE:3},name:`Step`,inheritAttrs:!1,props:s(),setup(e,{slots:r,emit:s,attrs:c}){let l=t=>{s(`click`,t),s(`stepClick`,e.stepIndex)},u=({icon:n,title:o,description:s})=>{let{prefixCls:c,stepNumber:l,status:u,iconPrefix:d,icons:f,progressDot:p=r.progressDot,stepIcon:m=r.stepIcon}=e,h,g=t.default(`${c}-icon`,`${d}icon`,{[`${d}icon-${n}`]:n&&a(n),[`${d}icon-check`]:!n&&u===`finish`&&(f&&!f.finish||!f),[`${d}icon-cross`]:!n&&u===`error`&&(f&&!f.error||!f)}),_=(0,i.createVNode)(`span`,{class:`${c}-icon-dot`},null);return h=p?typeof p==`function`?(0,i.createVNode)(`span`,{class:`${c}-icon`},[p({iconDot:_,index:l-1,status:u,title:o,description:s,prefixCls:c})]):(0,i.createVNode)(`span`,{class:`${c}-icon`},[_]):n&&!a(n)?(0,i.createVNode)(`span`,{class:`${c}-icon`},[n]):f&&f.finish&&u===`finish`?(0,i.createVNode)(`span`,{class:`${c}-icon`},[f.finish]):f&&f.error&&u===`error`?(0,i.createVNode)(`span`,{class:`${c}-icon`},[f.error]):n||u===`finish`||u===`error`?(0,i.createVNode)(`span`,{class:g},null):(0,i.createVNode)(`span`,{class:`${c}-icon`},[l]),m&&(h=m({index:l-1,status:u,title:o,description:s,node:h})),h};return()=>{let{prefixCls:a,itemWidth:s,active:d,status:f=`wait`,tailContent:p,adjustMarginRight:m,disabled:h,title:g=r.title?.(),description:_=r.description?.(),subTitle:v=r.subTitle?.(),icon:y=r.icon?.(),onClick:b,onStepClick:x}=e,S=f||`wait`,C=t.default(`${a}-item`,`${a}-item-${S}`,{[`${a}-item-custom`]:y,[`${a}-item-active`]:d,[`${a}-item-disabled`]:h===!0}),w={};s&&(w.width=s),m&&(w.marginRight=m);let T={onClick:b||o};x&&!h&&(T.role=`button`,T.tabindex=0,T.onClick=l);let E=(0,i.createVNode)(`div`,{...n.default(c,[`__legacy`]),class:[C,c.class],style:[c.style,w]},[(0,i.createVNode)(`div`,{...T,class:`${a}-item-container`},[(0,i.createVNode)(`div`,{class:`${a}-item-tail`},[p]),(0,i.createVNode)(`div`,{class:`${a}-item-icon`},[u({icon:y,title:g,description:_})]),(0,i.createVNode)(`div`,{class:`${a}-item-content`},[(0,i.createVNode)(`div`,{class:`${a}-item-title`},[g,v&&(0,i.createVNode)(`div`,{title:typeof v==`string`?v:void 0,class:`${a}-item-subtitle`},[v])]),_&&(0,i.createVNode)(`div`,{class:`${a}-item-description`},[_])])])]);return e.itemRender?e.itemRender(E):E}}});exports.VcStepProps=s,exports.default=c;