"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),d=require("@antsoo-lib/icons"),b=require("../_util/props-util/initDefaultProps.js"),A=require("../config-provider/hooks/useConfigInject.js"),I=require("./Circle.js"),w=require("./Line.js"),O=require("./Steps.js"),p=require("./props.js"),j=require("./style/index.js"),a=require("./utils.js"),z=t.defineComponent({compatConfig:{MODE:3},name:"AProgress",inheritAttrs:!1,props:b.default(p.progressProps(),{type:"line",percent:0,showInfo:!0,trailColor:null,size:"default",strokeLinecap:"round"}),slots:Object,setup(e,{slots:v,attrs:k}){const{prefixCls:c,direction:C}=A.default("progress",e),[S,y]=j.default(c),g=t.computed(()=>Array.isArray(e.strokeColor)?e.strokeColor[0]:e.strokeColor),N=t.computed(()=>{const{percent:r=0}=e,o=a.getSuccessPercent(e);return Number.parseInt(o!==void 0?o.toString():r.toString(),10)}),u=t.computed(()=>{const{status:r}=e;return!p.progressStatuses.includes(r)&&N.value>=100?"success":r||"normal"}),h=t.computed(()=>{const{type:r,showInfo:o,size:n}=e,s=c.value;return{[s]:!0,[`${s}-inline-circle`]:r==="circle"&&a.getSize(n,"circle").width<=20,[`${s}-${r==="dashboard"&&"circle"||r}`]:!0,[`${s}-status-${u.value}`]:!0,[`${s}-show-info`]:o,[`${s}-${n}`]:n,[`${s}-rtl`]:C.value==="rtl",[y.value]:!0}}),P=t.computed(()=>typeof e.strokeColor=="string"||Array.isArray(e.strokeColor)?e.strokeColor:void 0),q=()=>{const{showInfo:r,format:o,type:n,percent:s,title:f}=e,i=a.getSuccessPercent(e);if(!r)return null;let l;const x=o||v?.format||(V=>`${V}%`),m=n==="line";return o||v?.format||u.value!=="exception"&&u.value!=="success"?l=x(a.validProgress(s),a.validProgress(i)):u.value==="exception"?l=m?t.createVNode(d.CloseCircleFilled,null,null):t.createVNode(d.CloseOutlined,null,null):u.value==="success"&&(l=m?t.createVNode(d.CheckCircleFilled,null,null):t.createVNode(d.CheckOutlined,null,null)),t.createVNode("span",{class:`${c.value}-text`,title:f===void 0&&typeof l=="string"?l:void 0},[l])};return()=>{const{type:r,steps:o,title:n}=e,{class:s,...f}=k,i=q();let l;return r==="line"?l=o?t.createVNode(O.default,{...e,strokeColor:P.value,prefixCls:c.value,steps:o},{default:()=>[i]}):t.createVNode(w.default,{...e,strokeColor:g.value,prefixCls:c.value,direction:C.value},{default:()=>[i]}):(r==="circle"||r==="dashboard")&&(l=t.createVNode(I.default,{...e,prefixCls:c.value,strokeColor:g.value,progressStatus:u.value},{default:()=>[i]})),S(t.createVNode("div",{role:"progressbar",...f,class:[h.value,s],title:n},[l]))}}});exports.default=z;
