import{o as e}from"./chunk.DuxOD-Sk.js";import{r as t}from"./emotion-is-prop-valid.esm.DV_OErv-.js";import{c as n,l as r,t as i}from"./emotion-styled.browser.esm.BPUx6WuE.js";import{Gt as a,St as o}from"./src.sR_9Xh2m.js";import{t as s}from"./DynamicIcon.BDXbm0Of.js";var c=e(t()),l=e(a()),u=i(`div`,{target:`e1l5y6pi0`})(({theme:e,cache:t})=>({...t?{paddingBottom:e.spacing.lg,background:`linear-gradient(to bottom, ${e.colors.bgColor} 0%, ${e.colors.bgColor} 80%, transparent 100%)`}:null})),d=i(`div`,{target:`e1l5y6pi1`})(({theme:e})=>({display:`flex`,alignItems:`center`,width:`100%`,gap:e.spacing.sm})),f=i(`div`,{target:`e1l5y6pi2`})(({theme:e})=>({display:`flex`,gap:e.spacing.sm,alignItems:`baseline`})),p=i(`span`,{target:`e1l5y6pi3`})(({theme:e})=>({opacity:.6,fontSize:e.fontSizes.sm,lineHeight:e.lineHeights.none,whiteSpace:`nowrap`})),m=e=>{let t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=e%60;return t===0&&n===0?`(${r.toFixed(1)} seconds)`:t===0?`(${`${n} minute${n===1?``:`s`}`}${r===0?``:`, ${r.toFixed(1)} seconds`})`:`(${`${t} hour${t===1?``:`s`}`}${n===0?``:`, ${n} minute${n===1?``:`s`}`}${r===0?``:`, ${r.toFixed(1)} seconds`})`};function h({element:e}){let{cache:t,showTime:i}=e,[a,h]=(0,c.useState)(0),g=(0,c.useRef)(null);return(0,c.useEffect)(()=>{if(!i)return;g.current=Date.now();let e=()=>{g.current!==null&&h((Date.now()-g.current)/1e3)};e();let t=setInterval(e,100);return()=>clearInterval(t)},[i]),n(u,{className:(0,l.default)({stSpinner:!0,stCacheSpinner:t}),"data-testid":`stSpinner`,cache:t,children:r(d,{children:[n(s,{size:`lg`,iconValue:`spinner`}),r(f,{children:[n(o,{source:e.text,allowHTML:!1}),i&&n(p,{children:m(a)})]})]})})}var g=(0,c.memo)(h);export{g as default};