import{Ja as e,Qa as t,Ya as n,fr as r,io as i,mi as a,mn as o,vr as s}from"./index.dkY5s53S.js";var c=i(t(),1),l=i(a(),1),u=s(`div`,{target:`e1dfnxdh0`})(({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=s(`div`,{target:`e1dfnxdh1`})(({theme:e})=>({display:`flex`,alignItems:`center`,width:`100%`,gap:e.spacing.sm})),f=s(`div`,{target:`e1dfnxdh2`})(({theme:e})=>({display:`flex`,gap:e.spacing.sm,alignItems:`baseline`})),p=s(`span`,{target:`e1dfnxdh3`})(({theme:e})=>({opacity:e.opacities.secondary,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:t}){let{cache:i,showTime:a}=t,[s,h]=(0,c.useState)(0),g=(0,c.useRef)(null);return(0,c.useEffect)(()=>{if(!a)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)},[a]),e(u,{className:(0,l.default)({stSpinner:!0,stCacheSpinner:i}),"data-testid":`stSpinner`,cache:i,children:n(d,{children:[e(r,{size:`lg`,iconValue:`spinner`}),n(f,{children:[e(o,{source:t.text,allowHTML:!1}),a&&e(p,{children:m(s)})]})]})})}var g=(0,c.memo)(h);export{g as default};