import{o as e}from"./rolldown-runtime.C0FnF6B9.js";import{r as t}from"./emotion-is-prop-valid.esm.CuYlOKOk.js";import{a as n,i as r,t as i}from"./emotion-styled.browser.esm.BYv_Qzcq.js";import{r as a}from"./StreamlitMarkdown.BYA62LKI.js";import{t as o}from"./classnames.CRvvUuc_.js";import{t as s}from"./DynamicIcon.qdIiJ9dI.js";var c=e(t(),1),l=e(o(),1),u=i(`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=i(`div`,{target:`e1dfnxdh1`})(({theme:e})=>({display:`flex`,alignItems:`center`,width:`100%`,gap:e.spacing.sm})),f=i(`div`,{target:`e1dfnxdh2`})(({theme:e})=>({display:`flex`,gap:e.spacing.sm,alignItems:`baseline`})),p=i(`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:e}){let{cache:t,showTime:i}=e,[o,h]=(0,c.useState)(0),g=(0,c.useRef)(null);return(0,c.useEffect)(()=>{if(!i)return;g.current=Date.now();let e=()=>{if(g.current!==null){let e=(Date.now()-g.current)/1e3;h(e)}};e();let t=setInterval(e,100);return()=>clearInterval(t)},[i]),r(u,{className:(0,l.default)({stSpinner:!0,stCacheSpinner:t}),"data-testid":`stSpinner`,cache:t,children:n(d,{children:[r(s,{size:`lg`,iconValue:`spinner`}),n(f,{children:[r(a,{source:e.text,allowHTML:!1}),i&&r(p,{children:m(o)})]})]})})}var g=(0,c.memo)(h);export{g as default};