import{F as c,r as o,j as a,o as u,al as g,Z as f,q as S}from"./index.CS3tpmQq.js";const x=c("div",{target:"et5wpae0"})(({theme:e,cache:n})=>({...n?{paddingBottom:e.spacing.lg,background:`linear-gradient(to bottom, ${e.colors.bgColor} 0%, ${e.colors.bgColor} 80%, transparent 100%)`}:null})),T=c("div",{target:"et5wpae1"})(({theme:e})=>({display:"flex",alignItems:"center",width:"100%",gap:e.spacing.sm})),$=c("div",{target:"et5wpae2"})(({theme:e})=>({display:"flex",gap:e.spacing.sm,alignItems:"baseline"})),h=c("span",{target:"et5wpae3"})(({theme:e})=>({opacity:.6,fontSize:e.fontSizes.sm,lineHeight:e.lineHeights.none,whiteSpace:"nowrap"})),w=e=>{const n=Math.floor(e/3600),t=Math.floor(e%3600/60),s=e%60;if(n===0&&t===0)return`(${s.toFixed(1)} seconds)`;if(n===0){const p=`${t} minute${t===1?"":"s"}`,d=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${p}${d})`}const l=`${n} hour${n===1?"":"s"}`,r=t===0?"":`, ${t} minute${t===1?"":"s"}`,i=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${l}${r}${i})`};function y({element:e}){const{cache:n,showTime:t}=e,[s,l]=o.useState(0),r=o.useRef(null);return o.useEffect(()=>{if(!t)return;r.current=Date.now();const i=()=>{if(r.current!==null){const m=(Date.now()-r.current)/1e3;l(m)}};i();const p=setInterval(i,100);return()=>clearInterval(p)},[t]),a(x,{className:g({stSpinner:!0,stCacheSpinner:n}),"data-testid":"stSpinner",cache:n,children:u(T,{children:[a(f,{size:"lg",iconValue:"spinner"}),u($,{children:[a(S,{source:e.text,allowHTML:!1}),t&&a(h,{children:w(s)})]})]})})}const v=o.memo(y);export{v as default};
