import{o as e}from"./rolldown-runtime.C0FnF6B9.js";import{r as t}from"./emotion-is-prop-valid.esm.CuYlOKOk.js";import{i as n,r}from"./emotion-styled.browser.esm.BYv_Qzcq.js";import"./protobuf.Ckf-kxfD.js";import{n as i}from"./types.cZoyy9Y-.js";import{t as a}from"./useEmotionTheme.Dmt_qJ4x.js";import{t as o}from"./toastQueue.CeWtco9l.js";import{a as s}from"./ErrorElement.Bn6KKjq6.js";import{t as c}from"./AlertElement.jnyaBsKJ.js";var l=e(t(),1);function u({element:e,toastId:t}){let{body:u,icon:d,duration:f}=e,p=a();(0,l.useEffect)(()=>{if(p.inSidebar||o.visibleToasts.some(e=>e.content.toastId===t))return;let e=i(f)?f===0?void 0:f*1e3:4e3;o.add({body:u,icon:d||void 0,toastId:t},{timeout:e})},[]);let m=n(c,{kind:s.ERROR,body:"Streamlit API Error: `st.toast` cannot be called directly on the sidebar with `st.sidebar.toast`. See our `st.toast` API [docs](https://docs.streamlit.io/develop/api-reference/status/st.toast) for more information."});return n(r,{children:p.inSidebar&&m})}var d=(0,l.memo)(u);export{d as default};