import{o as e}from"./chunk-jRWAZmH_.js";import{n as t}from"./jsx-runtime-CEixWuwE.js";import{Bn as n,E as r,Et as i,G as a,Gt as o,Jt as s,Mn as c,Nn as l,Qt as u,Tt as d,Wt as f,Y as p,Zt as m,ir as h,qt as g,rr as _}from"./axios-DOscJEDN.js";import{n as v,t as y}from"./slicedToArray-BQ1tPSGY.js";import{n as b,t as x}from"./typeof-BUNGcdwP.js";import{i as S,r as C}from"./asyncToGenerator-DHhZBkop.js";import{l as w,u as T}from"./button-BMyidN73.js";import{i as E}from"./select-C47FfvhI.js";S();var D=e(n());w(),g();var O=e(t()),k={percent:0,prefixCls:`rc-progress`,strokeColor:`#2db7f5`,strokeLinecap:`round`,strokeWidth:1,trailColor:`#D9D9D9`,trailWidth:1,gapPosition:`bottom`},A=function(){var e=(0,O.useRef)([]),t=(0,O.useRef)(null);return(0,O.useEffect)(function(){var n=Date.now(),r=!1;e.current.forEach(function(e){if(e){r=!0;var i=e.style;i.transitionDuration=`.3s, .3s, .3s, .06s`,t.current&&n-t.current<100&&(i.transitionDuration=`0s, 0s`)}}),r&&(t.current=Date.now())}),e.current};b(),v(),o();var j=0,M=f();function N(){var e;return M?(e=j,j+=1):e=`TEST_OR_SSR`,e}var P=(function(e){var t=y(O.useState(),2),n=t[0],r=t[1];return O.useEffect(function(){r(`rc_progress_${N()}`)},[]),e||n});h(),l(),u();var F=[`id`,`prefixCls`,`steps`,`strokeWidth`,`trailWidth`,`gapDegree`,`gapPosition`,`trailColor`,`strokeLinecap`,`style`,`className`,`strokeColor`,`percent`];function I(e){return+e.replace(`%`,``)}function L(e){var t=e??[];return Array.isArray(t)?t:[t]}var R=100,z=function(e,t,n,r,i,a,o,s,c,l){var u=arguments.length>10&&arguments[10]!==void 0?arguments[10]:0,d=n/100*360*((360-a)/360),f=a===0?0:{bottom:0,top:180,left:90,right:-90}[o],p=(100-r)/100*t;return c===`round`&&r!==100&&(p+=l/2,p>=t&&(p=t-.01)),{stroke:typeof s==`string`?s:void 0,strokeDasharray:`${t}px ${e}`,strokeDashoffset:p+u,transform:`rotate(${i+d+f}deg)`,transformOrigin:`0 0`,transition:`stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s`,fillOpacity:0}},B=function(e){var t=c(c({},k),e),n=t.id,r=t.prefixCls,i=t.steps,a=t.strokeWidth,o=t.trailWidth,s=t.gapDegree,l=s===void 0?0:s,u=t.gapPosition,d=t.trailColor,f=t.strokeLinecap,p=t.style,h=t.className,g=t.strokeColor,v=t.percent,y=m(t,F),b=`${P(n)}-gradient`,S=R/2-a/2,C=Math.PI*2*S,w=l>0?90+l/2:-90,T=C*((360-l)/360),E=x(i)===`object`?i:{count:i,space:2},j=E.count,M=E.space,N=z(C,T,0,100,w,l,u,d,f,a),B=L(v),V=L(g),H=V.find(function(e){return e&&x(e)===`object`}),U=A();return O.createElement(`svg`,_({className:(0,D.default)(`${r}-circle`,h),viewBox:`${-R/2} ${-R/2} ${R} ${R}`,style:p,id:n,role:`presentation`},y),H&&O.createElement(`defs`,null,O.createElement(`linearGradient`,{id:b,x1:`100%`,y1:`0%`,x2:`0%`,y2:`0%`},Object.keys(H).sort(function(e,t){return I(e)-I(t)}).map(function(e,t){return O.createElement(`stop`,{key:t,offset:e,stopColor:H[e]})}))),!j&&O.createElement(`circle`,{className:`${r}-circle-trail`,r:S,cx:0,cy:0,stroke:d,strokeLinecap:f,strokeWidth:o||a,style:N}),j?function(){var e=Math.round(j*(B[0]/100)),t=100/j,n=0;return Array(j).fill(null).map(function(i,o){var s=o<=e-1?V[0]:d,c=s&&x(s)===`object`?`url(#${b})`:void 0,f=z(C,T,n,t,w,l,u,s,`butt`,a,M);return n+=(T-f.strokeDashoffset+M)*100/T,O.createElement(`circle`,{key:o,className:`${r}-circle-path`,r:S,cx:0,cy:0,stroke:c,strokeWidth:a,opacity:1,style:f,ref:function(e){U[o]=e}})})}():function(){var e=0;return B.map(function(t,n){var i=V[n]||V[V.length-1],o=i&&x(i)===`object`?`url(#${b})`:void 0,s=z(C,T,e,t,w,l,u,i,f,a);return e+=t,O.createElement(`circle`,{key:n,className:`${r}-circle-path`,r:S,cx:0,cy:0,stroke:o,strokeLinecap:f,strokeWidth:a,opacity:t===0?0:1,style:s,ref:function(e){U[n]=e}})}).reverse()}())};function V(e){return!e||e<0?0:e>100?100:e}function H(e){var t=e.success,n=e.successPercent;return t&&`progress`in t&&(n=t.progress),t&&`percent`in t&&(n=t.percent),n}function U(e){var t=e.percent,n=e.success,r=e.successPercent,i=V(H({success:n,successPercent:r}));return[i,V(V(t)-i)]}function W(e){var t=e.success,n=t===void 0?{}:t,r=e.strokeColor;return[n.strokeColor||s.green,r||null]}var G=function(e){var t=e.prefixCls,n=e.width,r=e.strokeWidth,i=e.trailColor,a=i===void 0?null:i,o=e.strokeLinecap,s=o===void 0?`round`:o,c=e.gapPosition,l=e.gapDegree,u=e.type,d=e.children,f=e.success,p=n||120,m={width:p,height:p,fontSize:p*.15+6},h=r||6,g=c||u===`dashboard`&&`bottom`||void 0,_=function(){if(l||l===0)return l;if(u===`dashboard`)return 75},v=Object.prototype.toString.call(e.strokeColor)===`[object Object]`,y=W({success:f,strokeColor:e.strokeColor}),b=(0,D.default)(`${t}-inner`,C({},`${t}-circle-gradient`,v));return O.createElement(`div`,{className:b,style:m},O.createElement(B,{percent:U(e),strokeWidth:h,trailWidth:h,strokeColor:y,strokeLinecap:s,trailColor:a,prefixCls:t,gapDegree:_(),gapPosition:g}),d)};h(),g();var K=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i=100?`success`:t||`normal`}function x(t,n){var r=e.format,a=H(e);if(!m)return null;var o,s=r||function(e){return`${e}%`},l=g===`line`;return r||n!==`exception`&&n!==`success`?o=s(V(c),V(a)):n===`exception`?o=l?O.createElement(d,null):O.createElement(p,null):n===`success`&&(o=l?O.createElement(i,null):O.createElement(E,null)),O.createElement(`span`,{className:`${t}-text`,title:typeof o==`string`?o:void 0},o)}var S=O.useContext(a),w=S.getPrefixCls,k=S.direction,A=w(`progress`,t),j=b(),M=x(A,j),N=Array.isArray(o)?o[0]:o,P=typeof o==`string`||Array.isArray(o)?o:void 0,F;g===`line`?F=r?O.createElement(X,_({},e,{strokeColor:P,prefixCls:A,steps:r}),M):O.createElement(Y,_({},e,{strokeColor:N,prefixCls:A,direction:k}),M):(g===`circle`||g===`dashboard`)&&(F=O.createElement(G,_({},e,{strokeColor:N,prefixCls:A,progressStatus:j}),M));var I=(0,D.default)(A,C(C(C(C(C({},`${A}-${g===`dashboard`&&`circle`||r&&`steps`||g}`,!0),`${A}-status-${j}`,!0),`${A}-show-info`,m),`${A}-${u}`,u),`${A}-rtl`,k===`rtl`),n);return O.createElement(`div`,_({},T(v,[`status`,`format`,`trailColor`,`strokeWidth`,`width`,`gapDegree`,`gapPosition`,`strokeLinecap`,`success`,`successPercent`]),{className:I,role:`progressbar`}),F)};export{$ as t};