"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[8427],{18427:function(e,t,o){o.r(t),o.d(t,{default:function(){return g}});var r=o(50189),n=o(11026),i=o(66845),a=o(25621),s=o(69021),d=o(27466),c=o(21e3),l=o(59033),u=o(36989),h=o(1515),p=(0,h.Z)("button",{target:"elibz2u1"})((function(e){var t=e.theme;return{fontSize:t.fontSizes.sm,lineHeight:"1.4rem",color:t.colors.gray60,backgroundColor:t.colors.transparent,border:"none",boxShadow:"none",padding:"0px","&:hover, &:active, &:focus":{border:"none",outline:"none",boxShadow:"none"},"&:hover":{color:t.colors.primary}}}),""),f=(0,h.Z)("div",{target:"elibz2u0"})((function(e){var t=e.theme;return{maxHeight:e.expanded?"none":t.breakpoints.toast}}),""),b=o(40864);var g=(0,a.b)((function(e){var t=e.theme,o=e.body,a=e.icon,h=e.width,g=a?"".concat(a,"&ensp;").concat(o):o,m=function(e){if(e.length>114){var t=e.replace(/^(.{114}[^\s]*).*/,"$1");return t.length>114&&(t=t.split(" ").slice(0,-1).join(" ")),t}return e}(g),x=g!==m,v=(0,i.useState)(!x),y=(0,n.Z)(v,2),w=y[0],S=y[1],Z=(0,i.useState)(0),k=(0,n.Z)(Z,2),R=k[0],C=k[1],T=(0,i.useCallback)((function(){S(!w)}),[w]),j=(0,i.useMemo)((function(){return function(e,t){var o=(0,d.Iy)(t);return{Body:{props:{"data-testid":"stToast"},style:{width:"288px",marginTop:"8px",borderTopLeftRadius:t.radii.lg,borderTopRightRadius:t.radii.lg,borderBottomLeftRadius:t.radii.lg,borderBottomRightRadius:t.radii.lg,backgroundColor:o?t.colors.gray10:t.colors.gray90,color:t.colors.bodyText,boxShadow:o?"0px 4px 16px rgba(0, 0, 0, 0.16)":"0px 4px 16px rgba(0, 0, 0, 0.7)"}},InnerContainer:{style:{maxHeight:e?"none":"88px",overflow:"hidden",fontSize:t.fontSizes.sm,lineHeight:"1.4rem"}},CloseIcon:{style:{color:t.colors.bodyText,marginRight:"-5px",width:"1.2rem",height:"1.2rem"}}}}(w,t)}),[w,t]),z=(0,i.useMemo)((function(){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(f,{expanded:w,children:(0,b.jsx)(c.ZP,{source:w?g:m,allowHTML:!1,isToast:!0})}),x&&(0,b.jsx)(p,{className:"toastViewButton",onClick:T,children:w?"view less":"view more"})]})}),[x,w,g,m,T]);(0,i.useEffect)((function(){if(!t.inSidebar){var e=s.Z.info(z,{overrides:(0,r.Z)({},j)});return C(e),function(){s.Z.update(e,{overrides:{Body:{style:{transitionDuration:0}}}}),s.Z.clear(e)}}}),[]),(0,i.useEffect)((function(){s.Z.update(R,{children:z,overrides:(0,r.Z)({},j)})}),[R,z,j]);var B=(0,b.jsx)(u.Z,{kind:l.h.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/library/api-reference/status/st.toast) for more information.",width:h});return(0,b.jsx)(b.Fragment,{children:t.inSidebar&&B})}))}}]);