import{c as i,r as c,j as r,cK as u,bW as m,bc as f}from"./index-DCNLpqIv.js";const h=i("div",{target:"e1se5lgy3"})(({theme:e,cache:s})=>({...s?{paddingBottom:e.spacing.lg,background:`linear-gradient(to bottom, ${e.colors.bgColor} 0%, ${e.colors.bgColor} 80%, transparent 100%)`}:null}),""),$=i("div",{target:"e1se5lgy2"})({name:"1x17g94",styles:"display:flex;align-items:center;width:100%"}),p=i("div",{target:"e1se5lgy1"})(({theme:e})=>({display:"flex",gap:e.spacing.sm,alignItems:"baseline"}),""),x=i("div",{target:"e1se5lgy0"})(({theme:e})=>({opacity:.6,fontSize:e.fontSizes.sm}),""),y=e=>{const s=Math.floor(e/3600),t=Math.floor(e%3600/60),n=e%60;if(s===0&&t===0)return`(${n.toFixed(1)} seconds)`;if(s===0){const d=`${t} minute${t===1?"":"s"}`,g=n===0?"":`, ${n.toFixed(1)} seconds`;return`(${d}${g})`}const l=`${s} hour${s===1?"":"s"}`,o=t===0?"":`, ${t} minute${t===1?"":"s"}`,a=n===0?"":`, ${n.toFixed(1)} seconds`;return`(${l}${o}${a})`};function b({element:e}){const{cache:s,showTime:t}=e,[n,l]=c.useState(0),o=c.useRef(null);return c.useEffect(()=>{if(!t)return;o.current=Date.now();const a=()=>{if(o.current!==null){const g=(Date.now()-o.current)/1e3;l(g)}};a();const d=setInterval(a,100);return()=>clearInterval(d)},[t]),r.jsx(h,{className:u({stSpinner:!0,stCacheSpinner:s}),"data-testid":"stSpinner",cache:s,children:r.jsxs($,{children:[r.jsx(m,{size:"base",margin:"0 md 0 0",padding:"0"}),r.jsxs(p,{children:[r.jsx(f,{source:e.text,allowHTML:!1}),t&&r.jsx(x,{children:y(n)})]})]})})}const j=c.memo(b);export{j as default};
