streamlit-nightly 1.39.1.dev20241018__py2.py3-none-any.whl → 1.39.1.dev20241021__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. streamlit/__init__.py +1 -0
  2. streamlit/elements/arrow.py +1 -1
  3. streamlit/elements/widgets/button_group.py +246 -51
  4. streamlit/proto/ButtonGroup_pb2.py +3 -3
  5. streamlit/proto/ButtonGroup_pb2.pyi +2 -2
  6. streamlit/static/asset-manifest.json +19 -17
  7. streamlit/static/index.html +1 -1
  8. streamlit/static/static/js/1086.93ecee4c.chunk.js +5 -0
  9. streamlit/static/static/js/{223.8bd97055.chunk.js → 223.ad5699f4.chunk.js} +1 -1
  10. streamlit/static/static/js/{245.1eea9c21.chunk.js → 245.f99a075b.chunk.js} +1 -1
  11. streamlit/static/static/js/3224.86a6ba35.chunk.js +1 -0
  12. streamlit/static/static/js/3861.867f8617.chunk.js +1 -0
  13. streamlit/static/static/js/4827.bf6d34b0.chunk.js +1 -0
  14. streamlit/static/static/js/5625.a2d9a416.chunk.js +1 -0
  15. streamlit/static/static/js/{6088.125b23a1.chunk.js → 6088.cf24e25c.chunk.js} +1 -1
  16. streamlit/static/static/js/7809.4b5ac1e5.chunk.js +1 -0
  17. streamlit/static/static/js/8237.9d947ccb.chunk.js +1 -0
  18. streamlit/static/static/js/8460.38082ffb.chunk.js +1 -0
  19. streamlit/static/static/js/9114.37a044b5.chunk.js +1 -0
  20. streamlit/static/static/js/9528.a58c0ad2.chunk.js +1 -0
  21. streamlit/static/static/js/9943.54dc52f7.chunk.js +1 -0
  22. streamlit/static/static/js/main.62a02ffe.js +28 -0
  23. streamlit/static/static/media/rocket.add69fb2c850b62fa60077e3a5a06d28.svg +5 -0
  24. streamlit/static/static/media/snowflake.187cb4ca5fd443488e5b4bfc9c4d2b52.svg +11 -0
  25. streamlit/static/static/media/streamlit-mark-color.e5952193e5f735a3afb01a78a4dd4b41.svg +5 -0
  26. {streamlit_nightly-1.39.1.dev20241018.dist-info → streamlit_nightly-1.39.1.dev20241021.dist-info}/METADATA +1 -1
  27. {streamlit_nightly-1.39.1.dev20241018.dist-info → streamlit_nightly-1.39.1.dev20241021.dist-info}/RECORD +32 -30
  28. streamlit/static/static/js/1086.fba3f8f8.chunk.js +0 -5
  29. streamlit/static/static/js/3224.fb4ce2a4.chunk.js +0 -1
  30. streamlit/static/static/js/3861.5aea56b8.chunk.js +0 -1
  31. streamlit/static/static/js/4827.70332470.chunk.js +0 -1
  32. streamlit/static/static/js/5625.c56e64cd.chunk.js +0 -1
  33. streamlit/static/static/js/7809.304e2c99.chunk.js +0 -1
  34. streamlit/static/static/js/8237.72e42692.chunk.js +0 -1
  35. streamlit/static/static/js/8460.05092ce1.chunk.js +0 -1
  36. streamlit/static/static/js/9114.11dd8c48.chunk.js +0 -1
  37. streamlit/static/static/js/9528.746f7a0e.chunk.js +0 -1
  38. streamlit/static/static/js/9943.0d8cd50b.chunk.js +0 -1
  39. streamlit/static/static/js/main.f85d22ce.js +0 -28
  40. streamlit/static/static/media/rocket.b75b17d2b0a063c6cea230d1a9d77f1e.svg +0 -9
  41. /streamlit/static/static/js/{main.f85d22ce.js.LICENSE.txt → main.62a02ffe.js.LICENSE.txt} +0 -0
  42. {streamlit_nightly-1.39.1.dev20241018.data → streamlit_nightly-1.39.1.dev20241021.data}/scripts/streamlit.cmd +0 -0
  43. {streamlit_nightly-1.39.1.dev20241018.dist-info → streamlit_nightly-1.39.1.dev20241021.dist-info}/WHEEL +0 -0
  44. {streamlit_nightly-1.39.1.dev20241018.dist-info → streamlit_nightly-1.39.1.dev20241021.dist-info}/entry_points.txt +0 -0
  45. {streamlit_nightly-1.39.1.dev20241018.dist-info → streamlit_nightly-1.39.1.dev20241021.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[223],{40223:(e,t,o)=>{o.r(t),o.d(t,{default:()=>Se});var i=o(58878),n=o(86411),r=o(83614),l=o(34679),s=o(93594),a=o(78477),c=o(8151),d=o(68994),h=o(58144),u=o(29669);var g=o(85850),m=o(59323),p=o(4494),f=o(53124),b=o.n(f),v=o(32782),x=o(67253),y=o(1780),C=o(84152),w=o(6240),S=o(90782);const j=e=>{let{error:t,width:o,deltaType:i}=e;return t instanceof k?(0,S.jsx)(w.A,{width:o,name:"No Mapbox token provided",message:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)("p",{children:["To use ",(0,S.jsxs)("code",{children:["st.",i]})," or ",(0,S.jsx)("code",{children:"st.map"})," you need to set up a Mapbox access token."]}),(0,S.jsxs)("p",{children:["To get a token, create an account at"," ",(0,S.jsx)("a",{href:"https://mapbox.com",children:"https://mapbox.com"}),". It's free for moderate usage levels!"]}),(0,S.jsxs)("p",{children:["Once you have a token, just set it using the Streamlit config option ",(0,S.jsx)("code",{children:"mapbox.token"})," and don't forget to restart your Streamlit server at this point if it's still running, then reload this tab."]}),(0,S.jsxs)("p",{children:["See"," ",(0,S.jsx)("a",{href:"https://docs.streamlit.io/develop/api-reference/configuration/config.toml",children:"our documentation"})," ","for more info on how to set config options."]})]})}):t instanceof F?(0,S.jsx)(w.A,{width:o,name:"Error fetching Streamlit Mapbox token",message:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("p",{children:"This app requires an internet connection."}),(0,S.jsx)("p",{children:"Please check your connection and try again."}),(0,S.jsxs)("p",{children:["If you think this is a bug, please file bug report"," ",(0,S.jsx)("a",{href:"https://github.com/streamlit/streamlit/issues/new/choose",children:"here"}),"."]})]})}):(0,S.jsx)(w.A,{width:o,name:"Error fetching Streamlit Mapbox token",message:t.message})};class k extends Error{}class F extends Error{}const A="https://data.streamlit.io/tokens.json",M="mapbox",T=e=>t=>{class o extends i.PureComponent{constructor(o){super(o),this.context=void 0,this.initMapboxToken=async()=>{try{const e=await v.A.get(A),{[M]:t}=e.data;if(!t)throw new Error(`Missing token ${M}`);this.setState({mapboxToken:t,isFetching:!1})}catch(e){const t=(0,x.$)(e);throw this.setState({mapboxTokenError:t,isFetching:!1}),new F(`${t.message} (${A})`)}},this.render=()=>{const{mapboxToken:o,mapboxTokenError:i,isFetching:n}=this.state,{width:r}=this.props;return i?(0,S.jsx)(j,{width:r,error:i,deltaType:e}):n?(0,S.jsx)(y.E,{element:u.EA.create({style:u.EA.SkeletonStyle.ELEMENT})}):(0,S.jsx)(t,{...this.props,mapboxToken:o,width:r})},this.state={isFetching:!0,mapboxToken:void 0,mapboxTokenError:void 0}}componentDidMount(){const e=this.props.element.mapboxToken||this.context.libConfig.mapboxToken;e?this.setState({mapboxToken:e,isFetching:!1}):this.initMapboxToken()}}return o.displayName=`withMapboxToken(${t.displayName||t.name})`,o.contextType=C.n,b()(o,t)};var E=o(89653);const I=(0,E.A)("div",{target:"e1az0zs51"})((e=>{let{width:t,height:o}=e;return{position:"relative",height:o,width:t}}),""),N=(0,E.A)("div",{target:"e1az0zs50"})((e=>{let{theme:t}=e;return{position:"absolute",right:"2.625rem",top:t.spacing.md,zIndex:t.zIndices.priority,".mapboxgl-ctrl.mapboxgl-ctrl-group":{overflow:"hidden",background:t.colors.bgColor},"button:not(:disabled)":{background:t.colors.bgColor,"& + button":{borderTopColor:t.colors.secondaryBg},"&.mapboxgl-ctrl-icon:hover":{backgroundColor:t.colors.darkenedBgMix25},"& span":{filter:(0,h.iq)(t)?"":"invert(100%)"}}}}),"");var O=o(21640),L=o(71034),$=o.n(L),W=o(32735);var z=o(3101),V=o(71279),_=o(95237),D=o(19507),B=o(89428),P=o(28246),U=o(54340),J=o(66643);const X={classes:{...P,...o(43539),...J,...o(41260),...V.bE},functions:{colorBins:_.A,colorCategories:D.A,colorContinuous:B.A}},q=new U.A({configuration:X});var G=o(39017),K=o(86044),R=o(94514),Z=o(10623),H=o(55296),Q=o(97091),Y=o(25479),ee=o(16249),te=o(46909),oe=o(56605),ie=o(48754),ne=o(16389),re=o(57741),le=o(82111),se=o(40973),ae=o(34632),ce=o(34895),de=o(77277),he=o(39481),ue=o(47605);const ge={[ne.A.layerName]:["getFillColor"],[re.A.layerName]:["getFillColor"],[le.A.layerName]:["getFillColor"],[se.A.layerName]:["getFillColor"],[ae.A.layerName]:["getFillColor"],[ce.A.layerName]:["getFillColor"],[de.A.layerName]:["getColor"],[G.A.layerName]:["getTargetColor","getSourceColor"],[K.A.layerName]:["getFillColor"],[R.A.layerName]:["getFillColor"],[Z.A.layerName]:["getColor"],[H.A.layerName]:["getColor"],[Q.A.layerName]:["getColor"],[Y.A.layerName]:["getColor"],[ee.A.layerName]:["getFillColor"],[te.A.layerName]:["getFillColor","getColor","getLineColor"],[oe.A.layerName]:["getFillColor"],[ie.A.layerName]:["getColor"],[he.A.layerName]:["getColor"],[ue.A.layerName]:["getColor"]},me=e=>{let{isSelected:t,object:o,objectInfo:i,opacity:n,originalFillFunction:r}=e;const l=(e=>{let{object:t,objectInfo:o,originalFillFunction:i}=e;const n="function"===typeof i?i(t,o):i;if(Array.isArray(n))return[n[0]||0,n[1]||0,n[2]||0,n[3]||255];if("string"===typeof n&&n.startsWith("@@=")){const e=q.convert({originalColor:n}).originalColor(t);return[e[0]||0,e[1]||0,e[2]||0,e[3]||255]}return null})({object:o,objectInfo:i,originalFillFunction:r});if(!l)return null;let s=0;return s=t?Math.max("number"===typeof l[3]?l[3]:n,n):Math.min("number"===typeof l[3]?l[3]:n,n),[l[0]||0,l[1]||0,l[2]||0,s]},pe={selection:{indices:{},objects:{}}},fe=(e,t)=>{const o=t.match(/{(.*?)}/g);return o&&o.forEach((o=>{const i=o.substring(1,o.length-1);e.object.hasOwnProperty(i)?t=t.replace(o,e.object[i]):e.object.hasOwnProperty("properties")&&e.object.properties.hasOwnProperty(i)&&(t=t.replace(o,e.object.properties[i]))})),t};function be(e,t){if(!t.id)return pe;const o=e.getElementState(t.id,"selection");return null!==o&&void 0!==o?o:pe}function ve(e,t){if(!t.id)return pe;const o=e.getStringValue(t),i=o?O.A.parse(o):null;return null!==i&&void 0!==i?i:pe}function xe(e,t,o,i){e.id&&t.setStringValue(e,JSON.stringify(o.value),{fromUi:o.fromUi},i)}const ye=e=>{var t;const{height:o,width:n,expanded:r}=(0,m.i)(p.T),{element:l,fragmentId:s,isLightTheme:a,theme:c,widgetMgr:d}=e,{selectionMode:h,tooltip:u,useContainerWidth:g}=l,f=null!==r&&void 0!==r&&r,[b,v]=(0,z._)({element:l,getDefaultState:be,getStateFromWidgetMgr:ve,updateWidgetMgrState:xe,widgetMgr:d,fragmentId:s}),[x,y]=(0,i.useState)({bearing:0,pitch:0,zoom:11}),{height:C,width:w}=(e=>{let{container:t,element:o,heightFallback:n="auto",isFullScreen:r,shouldUseContainerWidth:l,widthFallback:s="auto"}=e;return{width:(0,i.useMemo)((()=>l||r?"100%":o.width||t.width||s),[t.width,o.width,r,l,s]),height:(0,i.useMemo)((()=>r&&t.height?t.height:o.height||t.height||n),[r,o.height,t.height,n])}})({element:l,isFullScreen:f,shouldUseContainerWidth:g,container:{height:o,width:n},heightFallback:(null===(t=x.initialViewState)||void 0===t?void 0:t.height)||500}),[S,j]=(0,i.useState)({}),k=h[0],F=void 0!==k,A=F&&Object.keys(b.selection.indices).length>0,M=(0,i.useMemo)((()=>Object.freeze(O.A.parse(l.json))),[f,a,l.json]),T=(0,i.useMemo)((()=>{const e={...M};if(e.mapStyle||(e.mapStyle=`mapbox://styles/mapbox/${a?"light":"dark"}-v9`),e.layers){const t=Object.values(b.selection.indices).some((e=>null===e||void 0===e?void 0:e.length)),o=e.layers.some((e=>Object.hasOwn(e,"pickable")));e.layers=e.layers.map((e=>{var i,n;if(!e||Array.isArray(e)||!F)return e;o||(e.pickable=!0);const r=`${e.id||null}`,l=(null===b||void 0===b||null===(i=b.selection)||void 0===i||null===(n=i.indices)||void 0===n?void 0:n[r])||[],s=ge[e["@@type"]];if(!s)return e;const a={...e};return s.forEach((o=>{var i;a.updateTriggers={[o]:[...(null===(i=a.updateTriggers)||void 0===i?void 0:i[o])||[],l,t]};const n=!t,r=e[o];if(n||!r)return a;const s=Math.floor(102),d=(0,W.Du)(c.colors.primary),h=[d[0],d[1],d[2],255],u=(0,W.Du)(c.colors.gray20),g=[u[0],u[1],u[2],s];a[o]=(e,t)=>(e=>{let{isSelected:t,object:o,objectInfo:i,originalFillFunction:n,selectedColor:r,selectedOpacity:l=255,unselectedColor:s,unselectedOpacity:a=Math.floor(102)}=e;return t?me({opacity:l,isSelected:!0,object:o,objectInfo:i,originalFillFunction:n})||r:me({opacity:a,isSelected:!1,object:o,objectInfo:i,originalFillFunction:n})||s})({isSelected:l.includes(t.index),object:e,objectInfo:t,originalFillFunction:r,selectedColor:h,unselectedColor:g,selectedOpacity:255,unselectedOpacity:s})})),a}))}return null===e||void 0===e||delete e.views,q.convert(e)}),[b.selection.indices,a,F,M,c.colors.gray20,c.colors.primary]);(0,i.useEffect)((()=>{if(!$()(T.initialViewState,S)){const e=Object.keys(T.initialViewState).reduce(((e,t)=>T.initialViewState[t]===S[t]?e:{...e,[t]:T.initialViewState[t]}),{});y({...x,...e}),j(T.initialViewState)}}),[T.initialViewState,S,x]);const E=(0,i.useCallback)((e=>{if(!e||!e.object||!u)return null;const t=O.A.parse(u);return t.html?t.html=fe(e,t.html):t.text=fe(e,t.text),t}),[u]),I=(0,i.useCallback)((e=>{let{viewState:t}=e;y(t)}),[y]);return{createTooltip:E,data:b,deck:T,hasActiveSelection:A,height:C,isSelectionModeActivated:F,onViewStateChange:I,selectionMode:k,setSelection:v,viewState:x,width:w}};o(93298);(0,a.mk)([l.y,s.B]);const Ce=pe.selection,we=[],Se=T("st.pydeck_chart")((e=>{const{disabled:t,disableFullscreenMode:o,element:l,fragmentId:s,mapboxToken:a,widgetMgr:f}=e,{mapboxToken:b}=l,v=(0,c.u)(),{expanded:x,expand:y,collapse:C}=(0,m.i)(p.T),{createTooltip:w,data:j,deck:k,hasActiveSelection:F,height:A,isSelectionModeActivated:M,onViewStateChange:T,selectionMode:E,setSelection:O,viewState:L,width:$}=ye({element:l,fragmentId:s,isLightTheme:(0,h.iq)(v),theme:v,widgetMgr:f}),[W,z]=(0,i.useState)(!1);(0,i.useEffect)((()=>{z(!0)}),[]);const V=(0,i.useCallback)((e=>{var t;if(void 0===E)return;const{index:o,object:i}=e,n=`${(null===(t=e.layer)||void 0===t?void 0:t.id)||null}`,r=j,l=-1===o,s=(()=>{if(l)return Ce;switch(E){case u.Xw.SelectionMode.SINGLE_OBJECT:var e;return(null===(e=r.selection.indices[n])||void 0===e?void 0:e[0])===o?Ce:{indices:{[`${n}`]:[o]},objects:{[`${n}`]:[i]}};case u.Xw.SelectionMode.MULTI_OBJECT:{const e=new Map(((null===r||void 0===r||null===(t=r.selection)||void 0===t||null===(s=t.indices)||void 0===s?void 0:s[n])||[]).map(((e,t)=>{var o,i,l;return[e,null===(o=r.selection)||void 0===o||null===(i=o.objects)||void 0===i||null===(l=i[n])||void 0===l?void 0:l[t]]})));if(e.has(o)?e.delete(o):e.set(o,i),0===e.size){const{[n]:e,...t}=r.selection.indices,{[n]:o,...i}=r.selection.objects;return{indices:t,objects:i}}return{indices:{...r.selection.indices,[`${n}`]:Array.from(e.keys())},objects:{...r.selection.objects,[`${n}`]:Array.from(e.values())}}}default:throw(e=>{throw new Error(`Reached a branch with non-exhaustive item: ${e}`)})(E),new Error("Invalid selection mode")}var t,s})();JSON.stringify(s)!==JSON.stringify(r.selection)&&O({fromUi:!0,value:{selection:s}})}),[E,j,O]),_=(0,i.useCallback)((()=>{O({value:{selection:Ce},fromUi:!0})}),[O]);return(0,S.jsxs)(I,{className:"stDeckGlJsonChart","data-testid":"stDeckGlJsonChart",width:$,height:A,children:[(0,S.jsx)(g.A,{isFullScreen:x,disableFullscreenMode:o,onExpand:y,onCollapse:C,target:I,locked:!(!F||t)||void 0,children:F&&!t&&(0,S.jsx)(g.K,{label:"Clear selection",onClick:_,icon:d.b})}),(0,S.jsxs)(n.A,{viewState:L,onViewStateChange:T,height:A,width:$,layers:W?k.layers:we,getTooltip:w,ContextProvider:r.wZ.Provider,controller:!0,onClick:M&&!t?V:void 0,children:[(0,S.jsx)(r.b,{height:A,width:$,mapStyle:k.mapStyle&&("string"===typeof k.mapStyle?k.mapStyle:k.mapStyle[0]),mapboxApiAccessToken:b||a}),(0,S.jsx)(N,{children:(0,S.jsx)(r.ov,{"data-testid":"stDeckGlJsonChartZoomButton",showCompass:!1})})]})]})}))},85850:(e,t,o)=>{o.d(t,{K:()=>b,A:()=>v});o(58878);var i=o(8151),n=o(12274),r=o(63186),l=o(34914),s=o(997),a=o(36459),c=o(84720),d=o(64611),h=o(89653),u=o(58144);const g="-2.4rem",m=(0,h.A)("div",{target:"e2wxzia1"})((e=>{let{theme:t,locked:o,target:i}=e;return{padding:`${t.spacing.sm} 0 ${t.spacing.sm} ${t.spacing.sm}`,position:"absolute",top:o?g:"-1rem",right:t.spacing.none,transition:"none",...!o&&{opacity:0,"&:active, &:focus-visible, &:hover":{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:g},...i&&{[`${i}:hover &, ${i}:active &, ${i}:focus-visible &`]:{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:g}}}}}),""),p=(0,h.A)("div",{target:"e2wxzia0"})((e=>{let{theme:t}=e;return{color:(0,u.iq)(t)?t.colors.fadedText60:t.colors.bodyText,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end",boxShadow:"1px 2px 8px rgba(0, 0, 0, 0.08)",borderRadius:t.radii.default,backgroundColor:t.colors.lightenedBg05,width:"fit-content",zIndex:t.zIndices.sidebar+1}}),"");var f=o(90782);function b(e){let{label:t,show_label:o,icon:n,onClick:r}=e;const h=(0,i.u)(),u=o?t:"";return(0,f.jsx)("div",{"data-testid":"stElementToolbarButton",children:(0,f.jsx)(s.A,{content:(0,f.jsx)(l.Ay,{source:t,allowHTML:!1,style:{fontSize:h.fontSizes.sm}}),placement:s.W.TOP,onMouseEnterDelay:1e3,inline:!0,children:(0,f.jsxs)(a.Ay,{onClick:e=>{r&&r(),e.stopPropagation()},kind:c.KX.ELEMENT_TOOLBAR,"aria-label":t,children:[n&&(0,f.jsx)(d.A,{content:n,size:"md",testid:"stElementToolbarButtonIcon"}),u&&(0,f.jsx)("span",{children:u})]})})})}const v=e=>{let{onExpand:t,onCollapse:o,isFullScreen:i,locked:l,children:s,target:a,disableFullscreenMode:c}=e;return(0,f.jsx)(m,{className:"stElementToolbar","data-testid":"stElementToolbar",locked:l||i,target:a,children:(0,f.jsxs)(p,{children:[s,t&&!c&&!i&&(0,f.jsx)(b,{label:"Fullscreen",icon:n.g,onClick:()=>t()}),o&&!c&&i&&(0,f.jsx)(b,{label:"Close fullscreen",icon:r.Q,onClick:()=>o()})]})})}},34752:(e,t,o)=>{o.d(t,{X:()=>l,o:()=>r});var i=o(58878),n=o(25571);class r{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,o){(0,n.se)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,n._L)(t)&&(this.formClearListener=e.addFormClearedListener(t,o),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}function l(e){let{element:t,widgetMgr:o,onFormCleared:r}=e;(0,i.useEffect)((()=>{if(!(0,n._L)(t.formId))return;const e=o.addFormClearedListener(t.formId,r);return()=>{e.disconnect()}}),[t,o,r])}},3101:(e,t,o)=>{o.d(t,{_:()=>l,t:()=>s});var i=o(58878),n=o(34752),r=o(25571);function l(e){let{getStateFromWidgetMgr:t,getDefaultState:o,updateWidgetMgrState:l,element:s,widgetMgr:a,fragmentId:c,onFormCleared:d}=e;const[h,u]=(0,i.useState)((()=>{var e;return null!==(e=t(a,s))&&void 0!==e?e:o(a,s)})),[g,m]=(0,i.useState)({value:h,fromUi:!1});(0,i.useEffect)((()=>{(0,r.hX)(g)||(m(null),u(g.value),l(s,a,g,c))}),[g,l,s,a,c]);const p=(0,i.useCallback)((()=>{m({value:o(a,s),fromUi:!0}),null===d||void 0===d||d()}),[m,s,o,a,d]);return(0,n.X)({widgetMgr:a,element:s,onFormCleared:p}),[h,m]}function s(e){let{getStateFromWidgetMgr:t,getDefaultStateFromProto:o,getCurrStateFromProto:n,updateWidgetMgrState:r,element:s,widgetMgr:a,fragmentId:c,onFormCleared:d}=e;const h=(0,i.useCallback)(((e,t)=>o(t)),[o]),[u,g]=l({getStateFromWidgetMgr:t,getDefaultState:h,updateWidgetMgrState:r,element:s,widgetMgr:a,fragmentId:c,onFormCleared:d});return(0,i.useEffect)((()=>{s.setValue&&(s.setValue=!1,g({value:n(s),fromUi:!1}))}),[s,n,g]),[u,g]}}}]);
1
+ "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[223],{40223:(e,t,o)=>{o.r(t),o.d(t,{default:()=>Se});var i=o(58878),n=o(86411),r=o(83614),l=o(34679),s=o(93594),a=o(78477),c=o(8151),d=o(68994),h=o(16795),u=o(29669);var g=o(85850),m=o(59323),p=o(4494),f=o(53124),b=o.n(f),v=o(32782),x=o(67253),y=o(1780),C=o(84152),w=o(6240),S=o(90782);const j=e=>{let{error:t,width:o,deltaType:i}=e;return t instanceof k?(0,S.jsx)(w.A,{width:o,name:"No Mapbox token provided",message:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)("p",{children:["To use ",(0,S.jsxs)("code",{children:["st.",i]})," or ",(0,S.jsx)("code",{children:"st.map"})," you need to set up a Mapbox access token."]}),(0,S.jsxs)("p",{children:["To get a token, create an account at"," ",(0,S.jsx)("a",{href:"https://mapbox.com",children:"https://mapbox.com"}),". It's free for moderate usage levels!"]}),(0,S.jsxs)("p",{children:["Once you have a token, just set it using the Streamlit config option ",(0,S.jsx)("code",{children:"mapbox.token"})," and don't forget to restart your Streamlit server at this point if it's still running, then reload this tab."]}),(0,S.jsxs)("p",{children:["See"," ",(0,S.jsx)("a",{href:"https://docs.streamlit.io/develop/api-reference/configuration/config.toml",children:"our documentation"})," ","for more info on how to set config options."]})]})}):t instanceof F?(0,S.jsx)(w.A,{width:o,name:"Error fetching Streamlit Mapbox token",message:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("p",{children:"This app requires an internet connection."}),(0,S.jsx)("p",{children:"Please check your connection and try again."}),(0,S.jsxs)("p",{children:["If you think this is a bug, please file bug report"," ",(0,S.jsx)("a",{href:"https://github.com/streamlit/streamlit/issues/new/choose",children:"here"}),"."]})]})}):(0,S.jsx)(w.A,{width:o,name:"Error fetching Streamlit Mapbox token",message:t.message})};class k extends Error{}class F extends Error{}const A="https://data.streamlit.io/tokens.json",M="mapbox",T=e=>t=>{class o extends i.PureComponent{constructor(o){super(o),this.context=void 0,this.initMapboxToken=async()=>{try{const e=await v.A.get(A),{[M]:t}=e.data;if(!t)throw new Error(`Missing token ${M}`);this.setState({mapboxToken:t,isFetching:!1})}catch(e){const t=(0,x.$)(e);throw this.setState({mapboxTokenError:t,isFetching:!1}),new F(`${t.message} (${A})`)}},this.render=()=>{const{mapboxToken:o,mapboxTokenError:i,isFetching:n}=this.state,{width:r}=this.props;return i?(0,S.jsx)(j,{width:r,error:i,deltaType:e}):n?(0,S.jsx)(y.E,{element:u.EA.create({style:u.EA.SkeletonStyle.ELEMENT})}):(0,S.jsx)(t,{...this.props,mapboxToken:o,width:r})},this.state={isFetching:!0,mapboxToken:void 0,mapboxTokenError:void 0}}componentDidMount(){const e=this.props.element.mapboxToken||this.context.libConfig.mapboxToken;e?this.setState({mapboxToken:e,isFetching:!1}):this.initMapboxToken()}}return o.displayName=`withMapboxToken(${t.displayName||t.name})`,o.contextType=C.n,b()(o,t)};var E=o(89653);const I=(0,E.A)("div",{target:"e1az0zs51"})((e=>{let{width:t,height:o}=e;return{position:"relative",height:o,width:t}}),""),N=(0,E.A)("div",{target:"e1az0zs50"})((e=>{let{theme:t}=e;return{position:"absolute",right:"2.625rem",top:t.spacing.md,zIndex:t.zIndices.priority,".mapboxgl-ctrl.mapboxgl-ctrl-group":{overflow:"hidden",background:t.colors.bgColor},"button:not(:disabled)":{background:t.colors.bgColor,"& + button":{borderTopColor:t.colors.secondaryBg},"&.mapboxgl-ctrl-icon:hover":{backgroundColor:t.colors.darkenedBgMix25},"& span":{filter:(0,h.iq)(t)?"":"invert(100%)"}}}}),"");var O=o(21640),L=o(71034),$=o.n(L),W=o(32735);var z=o(3101),V=o(71279),_=o(95237),D=o(19507),B=o(89428),P=o(28246),U=o(54340),J=o(66643);const X={classes:{...P,...o(43539),...J,...o(41260),...V.bE},functions:{colorBins:_.A,colorCategories:D.A,colorContinuous:B.A}},q=new U.A({configuration:X});var G=o(39017),K=o(86044),R=o(94514),Z=o(10623),H=o(55296),Q=o(97091),Y=o(25479),ee=o(16249),te=o(46909),oe=o(56605),ie=o(48754),ne=o(16389),re=o(57741),le=o(82111),se=o(40973),ae=o(34632),ce=o(34895),de=o(77277),he=o(39481),ue=o(47605);const ge={[ne.A.layerName]:["getFillColor"],[re.A.layerName]:["getFillColor"],[le.A.layerName]:["getFillColor"],[se.A.layerName]:["getFillColor"],[ae.A.layerName]:["getFillColor"],[ce.A.layerName]:["getFillColor"],[de.A.layerName]:["getColor"],[G.A.layerName]:["getTargetColor","getSourceColor"],[K.A.layerName]:["getFillColor"],[R.A.layerName]:["getFillColor"],[Z.A.layerName]:["getColor"],[H.A.layerName]:["getColor"],[Q.A.layerName]:["getColor"],[Y.A.layerName]:["getColor"],[ee.A.layerName]:["getFillColor"],[te.A.layerName]:["getFillColor","getColor","getLineColor"],[oe.A.layerName]:["getFillColor"],[ie.A.layerName]:["getColor"],[he.A.layerName]:["getColor"],[ue.A.layerName]:["getColor"]},me=e=>{let{isSelected:t,object:o,objectInfo:i,opacity:n,originalFillFunction:r}=e;const l=(e=>{let{object:t,objectInfo:o,originalFillFunction:i}=e;const n="function"===typeof i?i(t,o):i;if(Array.isArray(n))return[n[0]||0,n[1]||0,n[2]||0,n[3]||255];if("string"===typeof n&&n.startsWith("@@=")){const e=q.convert({originalColor:n}).originalColor(t);return[e[0]||0,e[1]||0,e[2]||0,e[3]||255]}return null})({object:o,objectInfo:i,originalFillFunction:r});if(!l)return null;let s=0;return s=t?Math.max("number"===typeof l[3]?l[3]:n,n):Math.min("number"===typeof l[3]?l[3]:n,n),[l[0]||0,l[1]||0,l[2]||0,s]},pe={selection:{indices:{},objects:{}}},fe=(e,t)=>{const o=t.match(/{(.*?)}/g);return o&&o.forEach((o=>{const i=o.substring(1,o.length-1);e.object.hasOwnProperty(i)?t=t.replace(o,e.object[i]):e.object.hasOwnProperty("properties")&&e.object.properties.hasOwnProperty(i)&&(t=t.replace(o,e.object.properties[i]))})),t};function be(e,t){if(!t.id)return pe;const o=e.getElementState(t.id,"selection");return null!==o&&void 0!==o?o:pe}function ve(e,t){if(!t.id)return pe;const o=e.getStringValue(t),i=o?O.A.parse(o):null;return null!==i&&void 0!==i?i:pe}function xe(e,t,o,i){e.id&&t.setStringValue(e,JSON.stringify(o.value),{fromUi:o.fromUi},i)}const ye=e=>{var t;const{height:o,width:n,expanded:r}=(0,m.i)(p.T),{element:l,fragmentId:s,isLightTheme:a,theme:c,widgetMgr:d}=e,{selectionMode:h,tooltip:u,useContainerWidth:g}=l,f=null!==r&&void 0!==r&&r,[b,v]=(0,z._)({element:l,getDefaultState:be,getStateFromWidgetMgr:ve,updateWidgetMgrState:xe,widgetMgr:d,fragmentId:s}),[x,y]=(0,i.useState)({bearing:0,pitch:0,zoom:11}),{height:C,width:w}=(e=>{let{container:t,element:o,heightFallback:n="auto",isFullScreen:r,shouldUseContainerWidth:l,widthFallback:s="auto"}=e;return{width:(0,i.useMemo)((()=>l||r?"100%":o.width||t.width||s),[t.width,o.width,r,l,s]),height:(0,i.useMemo)((()=>r&&t.height?t.height:o.height||t.height||n),[r,o.height,t.height,n])}})({element:l,isFullScreen:f,shouldUseContainerWidth:g,container:{height:o,width:n},heightFallback:(null===(t=x.initialViewState)||void 0===t?void 0:t.height)||500}),[S,j]=(0,i.useState)({}),k=h[0],F=void 0!==k,A=F&&Object.keys(b.selection.indices).length>0,M=(0,i.useMemo)((()=>Object.freeze(O.A.parse(l.json))),[f,a,l.json]),T=(0,i.useMemo)((()=>{const e={...M};if(e.mapStyle||(e.mapStyle=`mapbox://styles/mapbox/${a?"light":"dark"}-v9`),e.layers){const t=Object.values(b.selection.indices).some((e=>null===e||void 0===e?void 0:e.length)),o=e.layers.some((e=>Object.hasOwn(e,"pickable")));e.layers=e.layers.map((e=>{var i,n;if(!e||Array.isArray(e)||!F)return e;o||(e.pickable=!0);const r=`${e.id||null}`,l=(null===b||void 0===b||null===(i=b.selection)||void 0===i||null===(n=i.indices)||void 0===n?void 0:n[r])||[],s=ge[e["@@type"]];if(!s)return e;const a={...e};return s.forEach((o=>{var i;a.updateTriggers={[o]:[...(null===(i=a.updateTriggers)||void 0===i?void 0:i[o])||[],l,t]};const n=!t,r=e[o];if(n||!r)return a;const s=Math.floor(102),d=(0,W.Du)(c.colors.primary),h=[d[0],d[1],d[2],255],u=(0,W.Du)(c.colors.gray20),g=[u[0],u[1],u[2],s];a[o]=(e,t)=>(e=>{let{isSelected:t,object:o,objectInfo:i,originalFillFunction:n,selectedColor:r,selectedOpacity:l=255,unselectedColor:s,unselectedOpacity:a=Math.floor(102)}=e;return t?me({opacity:l,isSelected:!0,object:o,objectInfo:i,originalFillFunction:n})||r:me({opacity:a,isSelected:!1,object:o,objectInfo:i,originalFillFunction:n})||s})({isSelected:l.includes(t.index),object:e,objectInfo:t,originalFillFunction:r,selectedColor:h,unselectedColor:g,selectedOpacity:255,unselectedOpacity:s})})),a}))}return null===e||void 0===e||delete e.views,q.convert(e)}),[b.selection.indices,a,F,M,c.colors.gray20,c.colors.primary]);(0,i.useEffect)((()=>{if(!$()(T.initialViewState,S)){const e=Object.keys(T.initialViewState).reduce(((e,t)=>T.initialViewState[t]===S[t]?e:{...e,[t]:T.initialViewState[t]}),{});y({...x,...e}),j(T.initialViewState)}}),[T.initialViewState,S,x]);const E=(0,i.useCallback)((e=>{if(!e||!e.object||!u)return null;const t=O.A.parse(u);return t.html?t.html=fe(e,t.html):t.text=fe(e,t.text),t}),[u]),I=(0,i.useCallback)((e=>{let{viewState:t}=e;y(t)}),[y]);return{createTooltip:E,data:b,deck:T,hasActiveSelection:A,height:C,isSelectionModeActivated:F,onViewStateChange:I,selectionMode:k,setSelection:v,viewState:x,width:w}};o(93298);(0,a.mk)([l.y,s.B]);const Ce=pe.selection,we=[],Se=T("st.pydeck_chart")((e=>{const{disabled:t,disableFullscreenMode:o,element:l,fragmentId:s,mapboxToken:a,widgetMgr:f}=e,{mapboxToken:b}=l,v=(0,c.u)(),{expanded:x,expand:y,collapse:C}=(0,m.i)(p.T),{createTooltip:w,data:j,deck:k,hasActiveSelection:F,height:A,isSelectionModeActivated:M,onViewStateChange:T,selectionMode:E,setSelection:O,viewState:L,width:$}=ye({element:l,fragmentId:s,isLightTheme:(0,h.iq)(v),theme:v,widgetMgr:f}),[W,z]=(0,i.useState)(!1);(0,i.useEffect)((()=>{z(!0)}),[]);const V=(0,i.useCallback)((e=>{var t;if(void 0===E)return;const{index:o,object:i}=e,n=`${(null===(t=e.layer)||void 0===t?void 0:t.id)||null}`,r=j,l=-1===o,s=(()=>{if(l)return Ce;switch(E){case u.Xw.SelectionMode.SINGLE_OBJECT:var e;return(null===(e=r.selection.indices[n])||void 0===e?void 0:e[0])===o?Ce:{indices:{[`${n}`]:[o]},objects:{[`${n}`]:[i]}};case u.Xw.SelectionMode.MULTI_OBJECT:{const e=new Map(((null===r||void 0===r||null===(t=r.selection)||void 0===t||null===(s=t.indices)||void 0===s?void 0:s[n])||[]).map(((e,t)=>{var o,i,l;return[e,null===(o=r.selection)||void 0===o||null===(i=o.objects)||void 0===i||null===(l=i[n])||void 0===l?void 0:l[t]]})));if(e.has(o)?e.delete(o):e.set(o,i),0===e.size){const{[n]:e,...t}=r.selection.indices,{[n]:o,...i}=r.selection.objects;return{indices:t,objects:i}}return{indices:{...r.selection.indices,[`${n}`]:Array.from(e.keys())},objects:{...r.selection.objects,[`${n}`]:Array.from(e.values())}}}default:throw(e=>{throw new Error(`Reached a branch with non-exhaustive item: ${e}`)})(E),new Error("Invalid selection mode")}var t,s})();JSON.stringify(s)!==JSON.stringify(r.selection)&&O({fromUi:!0,value:{selection:s}})}),[E,j,O]),_=(0,i.useCallback)((()=>{O({value:{selection:Ce},fromUi:!0})}),[O]);return(0,S.jsxs)(I,{className:"stDeckGlJsonChart","data-testid":"stDeckGlJsonChart",width:$,height:A,children:[(0,S.jsx)(g.A,{isFullScreen:x,disableFullscreenMode:o,onExpand:y,onCollapse:C,target:I,locked:!(!F||t)||void 0,children:F&&!t&&(0,S.jsx)(g.K,{label:"Clear selection",onClick:_,icon:d.b})}),(0,S.jsxs)(n.A,{viewState:L,onViewStateChange:T,height:A,width:$,layers:W?k.layers:we,getTooltip:w,ContextProvider:r.wZ.Provider,controller:!0,onClick:M&&!t?V:void 0,children:[(0,S.jsx)(r.b,{height:A,width:$,mapStyle:k.mapStyle&&("string"===typeof k.mapStyle?k.mapStyle:k.mapStyle[0]),mapboxApiAccessToken:b||a}),(0,S.jsx)(N,{children:(0,S.jsx)(r.ov,{"data-testid":"stDeckGlJsonChartZoomButton",showCompass:!1})})]})]})}))},85850:(e,t,o)=>{o.d(t,{K:()=>b,A:()=>v});o(58878);var i=o(8151),n=o(12274),r=o(63186),l=o(4629),s=o(997),a=o(36459),c=o(84720),d=o(64611),h=o(89653),u=o(16795);const g="-2.4rem",m=(0,h.A)("div",{target:"e2wxzia1"})((e=>{let{theme:t,locked:o,target:i}=e;return{padding:`${t.spacing.sm} 0 ${t.spacing.sm} ${t.spacing.sm}`,position:"absolute",top:o?g:"-1rem",right:t.spacing.none,transition:"none",...!o&&{opacity:0,"&:active, &:focus-visible, &:hover":{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:g},...i&&{[`${i}:hover &, ${i}:active &, ${i}:focus-visible &`]:{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:g}}}}}),""),p=(0,h.A)("div",{target:"e2wxzia0"})((e=>{let{theme:t}=e;return{color:(0,u.iq)(t)?t.colors.fadedText60:t.colors.bodyText,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end",boxShadow:"1px 2px 8px rgba(0, 0, 0, 0.08)",borderRadius:t.radii.default,backgroundColor:t.colors.lightenedBg05,width:"fit-content",zIndex:t.zIndices.sidebar+1}}),"");var f=o(90782);function b(e){let{label:t,show_label:o,icon:n,onClick:r}=e;const h=(0,i.u)(),u=o?t:"";return(0,f.jsx)("div",{"data-testid":"stElementToolbarButton",children:(0,f.jsx)(s.A,{content:(0,f.jsx)(l.Ay,{source:t,allowHTML:!1,style:{fontSize:h.fontSizes.sm}}),placement:s.W.TOP,onMouseEnterDelay:1e3,inline:!0,children:(0,f.jsxs)(a.Ay,{onClick:e=>{r&&r(),e.stopPropagation()},kind:c.KX.ELEMENT_TOOLBAR,"aria-label":t,children:[n&&(0,f.jsx)(d.A,{content:n,size:"md",testid:"stElementToolbarButtonIcon"}),u&&(0,f.jsx)("span",{children:u})]})})})}const v=e=>{let{onExpand:t,onCollapse:o,isFullScreen:i,locked:l,children:s,target:a,disableFullscreenMode:c}=e;return(0,f.jsx)(m,{className:"stElementToolbar","data-testid":"stElementToolbar",locked:l||i,target:a,children:(0,f.jsxs)(p,{children:[s,t&&!c&&!i&&(0,f.jsx)(b,{label:"Fullscreen",icon:n.g,onClick:()=>t()}),o&&!c&&i&&(0,f.jsx)(b,{label:"Close fullscreen",icon:r.Q,onClick:()=>o()})]})})}},34752:(e,t,o)=>{o.d(t,{X:()=>l,o:()=>r});var i=o(58878),n=o(25571);class r{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,o){(0,n.se)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,n._L)(t)&&(this.formClearListener=e.addFormClearedListener(t,o),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}function l(e){let{element:t,widgetMgr:o,onFormCleared:r}=e;(0,i.useEffect)((()=>{if(!(0,n._L)(t.formId))return;const e=o.addFormClearedListener(t.formId,r);return()=>{e.disconnect()}}),[t,o,r])}},3101:(e,t,o)=>{o.d(t,{_:()=>l,t:()=>s});var i=o(58878),n=o(34752),r=o(25571);function l(e){let{getStateFromWidgetMgr:t,getDefaultState:o,updateWidgetMgrState:l,element:s,widgetMgr:a,fragmentId:c,onFormCleared:d}=e;const[h,u]=(0,i.useState)((()=>{var e;return null!==(e=t(a,s))&&void 0!==e?e:o(a,s)})),[g,m]=(0,i.useState)({value:h,fromUi:!1});(0,i.useEffect)((()=>{(0,r.hX)(g)||(m(null),u(g.value),l(s,a,g,c))}),[g,l,s,a,c]);const p=(0,i.useCallback)((()=>{m({value:o(a,s),fromUi:!0}),null===d||void 0===d||d()}),[m,s,o,a,d]);return(0,n.X)({widgetMgr:a,element:s,onFormCleared:p}),[h,m]}function s(e){let{getStateFromWidgetMgr:t,getDefaultStateFromProto:o,getCurrStateFromProto:n,updateWidgetMgrState:r,element:s,widgetMgr:a,fragmentId:c,onFormCleared:d}=e;const h=(0,i.useCallback)(((e,t)=>o(t)),[o]),[u,g]=l({getStateFromWidgetMgr:t,getDefaultState:h,updateWidgetMgrState:r,element:s,widgetMgr:a,fragmentId:c,onFormCleared:d});return(0,i.useEffect)((()=>{s.setValue&&(s.setValue=!1,g({value:n(s),fromUi:!1}))}),[s,n,g]),[u,g]}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[245],{245:(e,t,r)=>{r.r(t),r.d(t,{default:()=>G});var o=r(58878),i=r(8151),n=r(35331),a=r(57224);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e){var t=e.$disabled,r=e.$checked,o=e.$isIndeterminate,i=e.$error,n=e.$isHovered,a=e.$isActive,l=e.$theme.colors;return t?r||o?l.tickFillDisabled:l.tickFill:i&&(o||r)?a?l.tickFillErrorSelectedHoverActive:n?l.tickFillErrorSelectedHover:l.tickFillErrorSelected:i?a?l.tickFillErrorHoverActive:n?l.tickFillErrorHover:l.tickFillError:o||r?a?l.tickFillSelectedHoverActive:n?l.tickFillSelectedHover:l.tickFillSelected:a?l.tickFillActive:n?l.tickFillHover:l.tickFill}function u(e){var t=e.$disabled,r=e.$theme.colors;return t?r.contentSecondary:r.contentPrimary}var g=(0,a.I4)("label",(function(e){var t=e.$disabled,r=e.$labelPlacement;return{flexDirection:"top"===r||"bottom"===r?"column":"row",display:"flex",alignItems:"top"===r||"bottom"===r?"center":"flex-start",cursor:t?"not-allowed":"pointer",userSelect:"none"}}));g.displayName="Root",g.displayName="Root";var p=(0,a.I4)("span",(function(e){var t=e.$checked,r=e.$disabled,o=e.$error,i=e.$isIndeterminate,n=e.$theme,a=e.$isFocusVisible,l=n.sizing,c=n.animation,s=r?n.colors.tickMarkFillDisabled:o?n.colors.tickMarkFillError:n.colors.tickMarkFill,u=encodeURIComponent('\n <svg width="14" height="4" viewBox="0 0 14 4" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M14 0.5H0V3.5H14V0.5Z" fill="'.concat(s,'"/>\n </svg>\n ')),g=encodeURIComponent('\n <svg width="17" height="13" viewBox="0 0 17 13" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M6.50002 12.6L0.400024 6.60002L2.60002 4.40002L6.50002 8.40002L13.9 0.900024L16.1 3.10002L6.50002 12.6Z" fill="'.concat(s,'"/>\n </svg>\n ')),p=n.borders.checkboxBorderRadius,h=function(e){var t=e.$disabled,r=e.$checked,o=e.$error,i=e.$isIndeterminate,n=e.$theme,a=e.$isFocusVisible,l=n.colors;return t?l.tickFillDisabled:r||i?"transparent":o?l.borderNegative:a?l.borderSelected:l.tickBorder}(e);return{flex:"0 0 auto",transitionDuration:c.timing200,transitionTimingFunction:c.easeOutCurve,transitionProperty:"background-image, border-color, background-color",width:l.scale700,height:l.scale700,left:"4px",top:"4px",boxSizing:"border-box",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderLeftWidth:"3px",borderRightWidth:"3px",borderTopWidth:"3px",borderBottomWidth:"3px",borderLeftColor:h,borderRightColor:h,borderTopColor:h,borderBottomColor:h,borderTopLeftRadius:p,borderTopRightRadius:p,borderBottomRightRadius:p,borderBottomLeftRadius:p,outline:a&&t?"3px solid ".concat(n.colors.accent):"none",display:"inline-block",verticalAlign:"middle",backgroundImage:i?"url('data:image/svg+xml,".concat(u,"');"):t?"url('data:image/svg+xml,".concat(g,"');"):null,backgroundColor:d(e),backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"contain",marginTop:n.sizing.scale0,marginBottom:n.sizing.scale0,marginLeft:n.sizing.scale0,marginRight:n.sizing.scale0}}));p.displayName="Checkmark",p.displayName="Checkmark";var h=(0,a.I4)("div",(function(e){var t=e.$theme.typography;return c(c(c({verticalAlign:"middle"},function(e){var t,r=e.$labelPlacement,o=void 0===r?"":r,i=e.$theme,n=i.sizing.scale300;switch(o){case"top":t="Bottom";break;case"bottom":t="Top";break;case"left":t="Right";break;default:t="Left"}return"rtl"===i.direction&&"Left"===t?t="Right":"rtl"===i.direction&&"Right"===t&&(t="Left"),s({},"padding".concat(t),n)}(e)),{},{color:u(e)},t.LabelMedium),{},{lineHeight:"24px"})}));h.displayName="Label",h.displayName="Label";var m=(0,a.I4)("input",{opacity:0,width:0,height:0,overflow:"hidden",margin:0,padding:0,position:"absolute"});m.displayName="Input",m.displayName="Input";var b=(0,a.I4)("div",(function(e){var t=e.$theme.colors.toggleFill;return e.$disabled?t=e.$theme.colors.toggleFillDisabled:e.$checked&&e.$error?t=e.$theme.colors.tickFillErrorSelected:e.$checked&&(t=e.$theme.colors.toggleFillChecked),{backgroundColor:t,borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(e.$theme.colors.accent):e.$isHovered&&!e.$disabled?e.$theme.lighting.shadow500:e.$theme.lighting.shadow400,outline:"none",height:e.$theme.sizing.scale700,width:e.$theme.sizing.scale700,transform:e.$checked?"translateX(".concat("rtl"===e.$theme.direction?"-100%":"100%",")"):null,transition:"transform ".concat(e.$theme.animation.timing200)}}));b.displayName="Toggle",b.displayName="Toggle";var f=(0,a.I4)("div",(function(e){var t=e.$theme.colors.toggleTrackFill;return e.$disabled?t=e.$theme.colors.toggleTrackFillDisabled:e.$error&&e.$checked&&(t=e.$theme.colors.tickFillError),{alignItems:"center",backgroundColor:t,borderTopLeftRadius:"7px",borderTopRightRadius:"7px",borderBottomRightRadius:"7px",borderBottomLeftRadius:"7px",display:"flex",height:e.$theme.sizing.scale550,marginTop:e.$theme.sizing.scale200,marginBottom:e.$theme.sizing.scale100,marginLeft:e.$theme.sizing.scale200,marginRight:e.$theme.sizing.scale100,width:e.$theme.sizing.scale1000}}));f.displayName="ToggleTrack",f.displayName="ToggleTrack";var v=Object.freeze({default:"default",toggle:"toggle",toggle_round:"toggle"}),y=Object.freeze({top:"top",right:"right",bottom:"bottom",left:"left"}),k=r(56498);function $(e){return $="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$(e)}function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},w.apply(this,arguments)}function F(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function x(e,t){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x(e,t)}function C(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=R(e);if(t){var i=R(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return function(e,t){if(t&&("object"===$(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return S(e)}(this,r)}}function S(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R(e){return R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},R(e)}function L(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var T=function(e){return e.stopPropagation()},M=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}(l,e);var t,r,i,a=C(l);function l(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return L(S(e=a.call.apply(a,[this].concat(r))),"state",{isFocused:e.props.autoFocus||!1,isFocusVisible:!1,isHovered:!1,isActive:!1}),L(S(e),"onMouseEnter",(function(t){e.setState({isHovered:!0}),e.props.onMouseEnter(t)})),L(S(e),"onMouseLeave",(function(t){e.setState({isHovered:!1,isActive:!1}),e.props.onMouseLeave(t)})),L(S(e),"onMouseDown",(function(t){e.setState({isActive:!0}),e.props.onMouseDown(t)})),L(S(e),"onMouseUp",(function(t){e.setState({isActive:!1}),e.props.onMouseUp(t)})),L(S(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t),(0,k.pP)(t)&&e.setState({isFocusVisible:!0})})),L(S(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t),!1!==e.state.isFocusVisible&&e.setState({isFocusVisible:!1})})),e}return t=l,(r=[{key:"componentDidMount",value:function(){var e=this.props,t=e.autoFocus,r=e.inputRef;t&&r.current&&r.current.focus()}},{key:"render",value:function(){var e=this.props,t=e.overrides,r=void 0===t?{}:t,i=e.onChange,a=e.labelPlacement,l=void 0===a?this.props.checkmarkType===v.toggle?"left":"right":a,c=e.inputRef,s=e.isIndeterminate,d=e.error,u=e.disabled,y=e.value,k=e.name,$=e.type,F=e.checked,x=e.children,C=e.required,S=e.title,R=r.Root,L=r.Checkmark,M=r.Label,O=r.Input,P=r.Toggle,j=r.ToggleTrack,I=(0,n.De)(R)||g,B=(0,n.De)(L)||p,E=(0,n.De)(M)||h,D=(0,n.De)(O)||m,W=(0,n.De)(P)||b,H=(0,n.De)(j)||f,z={onChange:i,onFocus:this.onFocus,onBlur:this.onBlur},V={onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},_={$isFocused:this.state.isFocused,$isFocusVisible:this.state.isFocusVisible,$isHovered:this.state.isHovered,$isActive:this.state.isActive,$error:d,$checked:F,$isIndeterminate:s,$required:C,$disabled:u,$value:y},A=x&&o.createElement(E,w({$labelPlacement:l},_,(0,n.PC)(M)),this.props.containsInteractiveElement?o.createElement("div",{onClick:function(e){return e.preventDefault()}},x):x);return o.createElement(I,w({"data-baseweb":"checkbox",title:S||null,$labelPlacement:l},_,V,(0,n.PC)(R)),("top"===l||"left"===l)&&A,this.props.checkmarkType===v.toggle?o.createElement(H,w({},_,(0,n.PC)(j)),o.createElement(W,w({},_,(0,n.PC)(P)))):o.createElement(B,w({},_,(0,n.PC)(L))),o.createElement(D,w({value:y,name:k,checked:F,required:C,"aria-label":this.props["aria-label"]||this.props.ariaLabel,"aria-checked":s?"mixed":F,"aria-describedby":this.props["aria-describedby"],"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":d||null,"aria-required":C||null,disabled:u,type:$,ref:c,onClick:T},_,z,(0,n.PC)(O))),("bottom"===l||"right"===l)&&A)}}])&&F(t.prototype,r),i&&F(t,i),Object.defineProperty(t,"prototype",{writable:!1}),l}(o.Component);L(M,"defaultProps",{overrides:{},checked:!1,containsInteractiveElement:!1,disabled:!1,autoFocus:!1,isIndeterminate:!1,inputRef:o.createRef(),error:!1,type:"checkbox",checkmarkType:v.default,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});const O=M;var P=r(32735),j=r(25571),I=r(29669),B=r(3101),E=r(58144),D=r(93480),W=r(997),H=r(78286),z=r(34914),V=r(90114),_=r(90782);function A(e){var t;let{width:r,element:n,disabled:a,widgetMgr:l,fragmentId:c}=e;const[s,d]=(0,B.t)({getStateFromWidgetMgr:N,getDefaultStateFromProto:U,getCurrStateFromProto:X,updateWidgetMgrState:q,element:n,widgetMgr:l,fragmentId:c}),u=(0,o.useCallback)((e=>{d({value:e.target.checked,fromUi:!0})}),[d]),g=(0,i.u)(),{colors:p,spacing:h,sizes:m}=g,b=(0,E.iq)(g),f=a?p.fadedText40:p.bodyText;return(0,_.jsx)(V.p,{className:"row-widget stCheckbox","data-testid":"stCheckbox",width:r,children:(0,_.jsx)(O,{checked:s,disabled:a,onChange:u,"aria-label":n.label,checkmarkType:n.type===I.Sc.StyleType.TOGGLE?v.toggle:v.default,labelPlacement:y.right,overrides:{Root:{style:e=>{let{$isFocusVisible:t}=e;return{marginBottom:h.none,marginTop:h.none,paddingRight:h.twoThirdsSmFont,backgroundColor:t?p.darkenedBgMix25:"",display:"flex",alignItems:"start"}}},Toggle:{style:e=>{let{$checked:t}=e,r=b?p.bgColor:p.bodyText;return a&&(r=b?p.gray70:p.gray90),{width:`calc(${m.checkbox} - ${g.spacing.twoXS})`,height:`calc(${m.checkbox} - ${g.spacing.twoXS})`,transform:t?`translateX(${m.checkbox})`:"",backgroundColor:r,boxShadow:""}}},ToggleTrack:{style:e=>{let{$checked:t,$isHovered:r}=e,o=p.fadedText40;return r&&!a&&(o=p.fadedText20),t&&!a&&(o=p.primary),{marginRight:0,marginLeft:0,marginBottom:0,marginTop:g.spacing.twoXS,paddingLeft:g.spacing.threeXS,paddingRight:g.spacing.threeXS,width:`calc(2 * ${m.checkbox})`,minWidth:`calc(2 * ${m.checkbox})`,height:m.checkbox,minHeight:m.checkbox,borderBottomLeftRadius:g.radii.lg,borderTopLeftRadius:g.radii.lg,borderBottomRightRadius:g.radii.lg,borderTopRightRadius:g.radii.lg,backgroundColor:o}}},Checkmark:{style:e=>{let{$isFocusVisible:t,$checked:r}=e;const o=r&&!a?p.primary:p.fadedText40;return{outline:0,width:m.checkbox,height:m.checkbox,marginTop:g.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:t&&r?`0 0 0 0.2rem ${(0,P.No)(p.primary,.5)}`:"",borderLeftWidth:m.borderWidth,borderRightWidth:m.borderWidth,borderTopWidth:m.borderWidth,borderBottomWidth:m.borderWidth,borderLeftColor:o,borderRightColor:o,borderTopColor:o,borderBottomColor:o}}},Label:{style:{position:"relative",color:f}}},children:(0,_.jsxs)(V.x,{visibility:(0,j.yv)(null===(t=n.labelVisibility)||void 0===t?void 0:t.value),"data-testid":"stWidgetLabel",children:[(0,_.jsx)(z.Ay,{source:n.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),n.help&&(0,_.jsx)(H.Cl,{color:f,children:(0,_.jsx)(D.A,{content:n.help,placement:W.W.TOP_RIGHT})})]})})})}function N(e,t){return e.getBoolValue(t)}function U(e){var t;return null!==(t=e.default)&&void 0!==t?t:null}function X(e){var t;return null!==(t=e.value)&&void 0!==t?t:null}function q(e,t,r,o){t.setBoolValue(e,r.value,{fromUi:r.fromUi},o)}const G=(0,o.memo)(A)},34752:(e,t,r)=>{r.d(t,{X:()=>a,o:()=>n});var o=r(58878),i=r(25571);class n{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,r){(0,i.se)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,i._L)(t)&&(this.formClearListener=e.addFormClearedListener(t,r),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}function a(e){let{element:t,widgetMgr:r,onFormCleared:n}=e;(0,o.useEffect)((()=>{if(!(0,i._L)(t.formId))return;const e=r.addFormClearedListener(t.formId,n);return()=>{e.disconnect()}}),[t,r,n])}},3101:(e,t,r)=>{r.d(t,{_:()=>a,t:()=>l});var o=r(58878),i=r(34752),n=r(25571);function a(e){let{getStateFromWidgetMgr:t,getDefaultState:r,updateWidgetMgrState:a,element:l,widgetMgr:c,fragmentId:s,onFormCleared:d}=e;const[u,g]=(0,o.useState)((()=>{var e;return null!==(e=t(c,l))&&void 0!==e?e:r(c,l)})),[p,h]=(0,o.useState)({value:u,fromUi:!1});(0,o.useEffect)((()=>{(0,n.hX)(p)||(h(null),g(p.value),a(l,c,p,s))}),[p,a,l,c,s]);const m=(0,o.useCallback)((()=>{h({value:r(c,l),fromUi:!0}),null===d||void 0===d||d()}),[h,l,r,c,d]);return(0,i.X)({widgetMgr:c,element:l,onFormCleared:m}),[u,h]}function l(e){let{getStateFromWidgetMgr:t,getDefaultStateFromProto:r,getCurrStateFromProto:i,updateWidgetMgrState:n,element:l,widgetMgr:c,fragmentId:s,onFormCleared:d}=e;const u=(0,o.useCallback)(((e,t)=>r(t)),[r]),[g,p]=a({getStateFromWidgetMgr:t,getDefaultState:u,updateWidgetMgrState:n,element:l,widgetMgr:c,fragmentId:s,onFormCleared:d});return(0,o.useEffect)((()=>{l.setValue&&(l.setValue=!1,p({value:i(l),fromUi:!1}))}),[l,i,p]),[g,p]}}}]);
1
+ "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[245],{245:(e,t,r)=>{r.r(t),r.d(t,{default:()=>G});var o=r(58878),i=r(8151),n=r(35331),a=r(57224);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e){var t=e.$disabled,r=e.$checked,o=e.$isIndeterminate,i=e.$error,n=e.$isHovered,a=e.$isActive,l=e.$theme.colors;return t?r||o?l.tickFillDisabled:l.tickFill:i&&(o||r)?a?l.tickFillErrorSelectedHoverActive:n?l.tickFillErrorSelectedHover:l.tickFillErrorSelected:i?a?l.tickFillErrorHoverActive:n?l.tickFillErrorHover:l.tickFillError:o||r?a?l.tickFillSelectedHoverActive:n?l.tickFillSelectedHover:l.tickFillSelected:a?l.tickFillActive:n?l.tickFillHover:l.tickFill}function u(e){var t=e.$disabled,r=e.$theme.colors;return t?r.contentSecondary:r.contentPrimary}var g=(0,a.I4)("label",(function(e){var t=e.$disabled,r=e.$labelPlacement;return{flexDirection:"top"===r||"bottom"===r?"column":"row",display:"flex",alignItems:"top"===r||"bottom"===r?"center":"flex-start",cursor:t?"not-allowed":"pointer",userSelect:"none"}}));g.displayName="Root",g.displayName="Root";var p=(0,a.I4)("span",(function(e){var t=e.$checked,r=e.$disabled,o=e.$error,i=e.$isIndeterminate,n=e.$theme,a=e.$isFocusVisible,l=n.sizing,c=n.animation,s=r?n.colors.tickMarkFillDisabled:o?n.colors.tickMarkFillError:n.colors.tickMarkFill,u=encodeURIComponent('\n <svg width="14" height="4" viewBox="0 0 14 4" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M14 0.5H0V3.5H14V0.5Z" fill="'.concat(s,'"/>\n </svg>\n ')),g=encodeURIComponent('\n <svg width="17" height="13" viewBox="0 0 17 13" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M6.50002 12.6L0.400024 6.60002L2.60002 4.40002L6.50002 8.40002L13.9 0.900024L16.1 3.10002L6.50002 12.6Z" fill="'.concat(s,'"/>\n </svg>\n ')),p=n.borders.checkboxBorderRadius,h=function(e){var t=e.$disabled,r=e.$checked,o=e.$error,i=e.$isIndeterminate,n=e.$theme,a=e.$isFocusVisible,l=n.colors;return t?l.tickFillDisabled:r||i?"transparent":o?l.borderNegative:a?l.borderSelected:l.tickBorder}(e);return{flex:"0 0 auto",transitionDuration:c.timing200,transitionTimingFunction:c.easeOutCurve,transitionProperty:"background-image, border-color, background-color",width:l.scale700,height:l.scale700,left:"4px",top:"4px",boxSizing:"border-box",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderLeftWidth:"3px",borderRightWidth:"3px",borderTopWidth:"3px",borderBottomWidth:"3px",borderLeftColor:h,borderRightColor:h,borderTopColor:h,borderBottomColor:h,borderTopLeftRadius:p,borderTopRightRadius:p,borderBottomRightRadius:p,borderBottomLeftRadius:p,outline:a&&t?"3px solid ".concat(n.colors.accent):"none",display:"inline-block",verticalAlign:"middle",backgroundImage:i?"url('data:image/svg+xml,".concat(u,"');"):t?"url('data:image/svg+xml,".concat(g,"');"):null,backgroundColor:d(e),backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"contain",marginTop:n.sizing.scale0,marginBottom:n.sizing.scale0,marginLeft:n.sizing.scale0,marginRight:n.sizing.scale0}}));p.displayName="Checkmark",p.displayName="Checkmark";var h=(0,a.I4)("div",(function(e){var t=e.$theme.typography;return c(c(c({verticalAlign:"middle"},function(e){var t,r=e.$labelPlacement,o=void 0===r?"":r,i=e.$theme,n=i.sizing.scale300;switch(o){case"top":t="Bottom";break;case"bottom":t="Top";break;case"left":t="Right";break;default:t="Left"}return"rtl"===i.direction&&"Left"===t?t="Right":"rtl"===i.direction&&"Right"===t&&(t="Left"),s({},"padding".concat(t),n)}(e)),{},{color:u(e)},t.LabelMedium),{},{lineHeight:"24px"})}));h.displayName="Label",h.displayName="Label";var f=(0,a.I4)("input",{opacity:0,width:0,height:0,overflow:"hidden",margin:0,padding:0,position:"absolute"});f.displayName="Input",f.displayName="Input";var m=(0,a.I4)("div",(function(e){var t=e.$theme.colors.toggleFill;return e.$disabled?t=e.$theme.colors.toggleFillDisabled:e.$checked&&e.$error?t=e.$theme.colors.tickFillErrorSelected:e.$checked&&(t=e.$theme.colors.toggleFillChecked),{backgroundColor:t,borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(e.$theme.colors.accent):e.$isHovered&&!e.$disabled?e.$theme.lighting.shadow500:e.$theme.lighting.shadow400,outline:"none",height:e.$theme.sizing.scale700,width:e.$theme.sizing.scale700,transform:e.$checked?"translateX(".concat("rtl"===e.$theme.direction?"-100%":"100%",")"):null,transition:"transform ".concat(e.$theme.animation.timing200)}}));m.displayName="Toggle",m.displayName="Toggle";var b=(0,a.I4)("div",(function(e){var t=e.$theme.colors.toggleTrackFill;return e.$disabled?t=e.$theme.colors.toggleTrackFillDisabled:e.$error&&e.$checked&&(t=e.$theme.colors.tickFillError),{alignItems:"center",backgroundColor:t,borderTopLeftRadius:"7px",borderTopRightRadius:"7px",borderBottomRightRadius:"7px",borderBottomLeftRadius:"7px",display:"flex",height:e.$theme.sizing.scale550,marginTop:e.$theme.sizing.scale200,marginBottom:e.$theme.sizing.scale100,marginLeft:e.$theme.sizing.scale200,marginRight:e.$theme.sizing.scale100,width:e.$theme.sizing.scale1000}}));b.displayName="ToggleTrack",b.displayName="ToggleTrack";var v=Object.freeze({default:"default",toggle:"toggle",toggle_round:"toggle"}),y=Object.freeze({top:"top",right:"right",bottom:"bottom",left:"left"}),k=r(56498);function $(e){return $="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$(e)}function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},w.apply(this,arguments)}function F(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function x(e,t){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x(e,t)}function C(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=R(e);if(t){var i=R(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return function(e,t){if(t&&("object"===$(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return S(e)}(this,r)}}function S(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R(e){return R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},R(e)}function L(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var T=function(e){return e.stopPropagation()},M=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}(l,e);var t,r,i,a=C(l);function l(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return L(S(e=a.call.apply(a,[this].concat(r))),"state",{isFocused:e.props.autoFocus||!1,isFocusVisible:!1,isHovered:!1,isActive:!1}),L(S(e),"onMouseEnter",(function(t){e.setState({isHovered:!0}),e.props.onMouseEnter(t)})),L(S(e),"onMouseLeave",(function(t){e.setState({isHovered:!1,isActive:!1}),e.props.onMouseLeave(t)})),L(S(e),"onMouseDown",(function(t){e.setState({isActive:!0}),e.props.onMouseDown(t)})),L(S(e),"onMouseUp",(function(t){e.setState({isActive:!1}),e.props.onMouseUp(t)})),L(S(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t),(0,k.pP)(t)&&e.setState({isFocusVisible:!0})})),L(S(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t),!1!==e.state.isFocusVisible&&e.setState({isFocusVisible:!1})})),e}return t=l,(r=[{key:"componentDidMount",value:function(){var e=this.props,t=e.autoFocus,r=e.inputRef;t&&r.current&&r.current.focus()}},{key:"render",value:function(){var e=this.props,t=e.overrides,r=void 0===t?{}:t,i=e.onChange,a=e.labelPlacement,l=void 0===a?this.props.checkmarkType===v.toggle?"left":"right":a,c=e.inputRef,s=e.isIndeterminate,d=e.error,u=e.disabled,y=e.value,k=e.name,$=e.type,F=e.checked,x=e.children,C=e.required,S=e.title,R=r.Root,L=r.Checkmark,M=r.Label,O=r.Input,P=r.Toggle,j=r.ToggleTrack,I=(0,n.De)(R)||g,B=(0,n.De)(L)||p,E=(0,n.De)(M)||h,D=(0,n.De)(O)||f,W=(0,n.De)(P)||m,H=(0,n.De)(j)||b,z={onChange:i,onFocus:this.onFocus,onBlur:this.onBlur},V={onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},_={$isFocused:this.state.isFocused,$isFocusVisible:this.state.isFocusVisible,$isHovered:this.state.isHovered,$isActive:this.state.isActive,$error:d,$checked:F,$isIndeterminate:s,$required:C,$disabled:u,$value:y},A=x&&o.createElement(E,w({$labelPlacement:l},_,(0,n.PC)(M)),this.props.containsInteractiveElement?o.createElement("div",{onClick:function(e){return e.preventDefault()}},x):x);return o.createElement(I,w({"data-baseweb":"checkbox",title:S||null,$labelPlacement:l},_,V,(0,n.PC)(R)),("top"===l||"left"===l)&&A,this.props.checkmarkType===v.toggle?o.createElement(H,w({},_,(0,n.PC)(j)),o.createElement(W,w({},_,(0,n.PC)(P)))):o.createElement(B,w({},_,(0,n.PC)(L))),o.createElement(D,w({value:y,name:k,checked:F,required:C,"aria-label":this.props["aria-label"]||this.props.ariaLabel,"aria-checked":s?"mixed":F,"aria-describedby":this.props["aria-describedby"],"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":d||null,"aria-required":C||null,disabled:u,type:$,ref:c,onClick:T},_,z,(0,n.PC)(O))),("bottom"===l||"right"===l)&&A)}}])&&F(t.prototype,r),i&&F(t,i),Object.defineProperty(t,"prototype",{writable:!1}),l}(o.Component);L(M,"defaultProps",{overrides:{},checked:!1,containsInteractiveElement:!1,disabled:!1,autoFocus:!1,isIndeterminate:!1,inputRef:o.createRef(),error:!1,type:"checkbox",checkmarkType:v.default,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});const O=M;var P=r(32735),j=r(25571),I=r(29669),B=r(3101),E=r(16795),D=r(93480),W=r(997),H=r(78286),z=r(4629),V=r(90114),_=r(90782);function A(e){var t;let{width:r,element:n,disabled:a,widgetMgr:l,fragmentId:c}=e;const[s,d]=(0,B.t)({getStateFromWidgetMgr:N,getDefaultStateFromProto:U,getCurrStateFromProto:X,updateWidgetMgrState:q,element:n,widgetMgr:l,fragmentId:c}),u=(0,o.useCallback)((e=>{d({value:e.target.checked,fromUi:!0})}),[d]),g=(0,i.u)(),{colors:p,spacing:h,sizes:f}=g,m=(0,E.iq)(g),b=a?p.fadedText40:p.bodyText;return(0,_.jsx)(V.p,{className:"row-widget stCheckbox","data-testid":"stCheckbox",width:r,children:(0,_.jsx)(O,{checked:s,disabled:a,onChange:u,"aria-label":n.label,checkmarkType:n.type===I.Sc.StyleType.TOGGLE?v.toggle:v.default,labelPlacement:y.right,overrides:{Root:{style:e=>{let{$isFocusVisible:t}=e;return{marginBottom:h.none,marginTop:h.none,backgroundColor:t?p.darkenedBgMix25:"",display:"flex",alignItems:"start"}}},Toggle:{style:e=>{let{$checked:t}=e,r=m?p.bgColor:p.bodyText;return a&&(r=m?p.gray70:p.gray90),{width:`calc(${f.checkbox} - ${g.spacing.twoXS})`,height:`calc(${f.checkbox} - ${g.spacing.twoXS})`,transform:t?`translateX(${f.checkbox})`:"",backgroundColor:r,boxShadow:""}}},ToggleTrack:{style:e=>{let{$checked:t,$isHovered:r}=e,o=p.fadedText40;return r&&!a&&(o=p.fadedText20),t&&!a&&(o=p.primary),{marginRight:0,marginLeft:0,marginBottom:0,marginTop:g.spacing.twoXS,paddingLeft:g.spacing.threeXS,paddingRight:g.spacing.threeXS,width:`calc(2 * ${f.checkbox})`,minWidth:`calc(2 * ${f.checkbox})`,height:f.checkbox,minHeight:f.checkbox,borderBottomLeftRadius:g.radii.full,borderTopLeftRadius:g.radii.full,borderBottomRightRadius:g.radii.full,borderTopRightRadius:g.radii.full,backgroundColor:o}}},Checkmark:{style:e=>{let{$isFocusVisible:t,$checked:r}=e;const o=r&&!a?p.primary:p.fadedText40;return{outline:0,width:f.checkbox,height:f.checkbox,marginTop:g.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:t&&r?`0 0 0 0.2rem ${(0,P.No)(p.primary,.5)}`:"",borderLeftWidth:f.borderWidth,borderRightWidth:f.borderWidth,borderTopWidth:f.borderWidth,borderBottomWidth:f.borderWidth,borderLeftColor:o,borderRightColor:o,borderTopColor:o,borderBottomColor:o}}},Label:{style:{position:"relative",color:b}}},children:(0,_.jsxs)(V.x,{visibility:(0,j.yv)(null===(t=n.labelVisibility)||void 0===t?void 0:t.value),"data-testid":"stWidgetLabel",children:[(0,_.jsx)(z.Ay,{source:n.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),n.help&&(0,_.jsx)(H.Cl,{color:b,children:(0,_.jsx)(D.A,{content:n.help,placement:W.W.TOP_RIGHT})})]})})})}function N(e,t){return e.getBoolValue(t)}function U(e){var t;return null!==(t=e.default)&&void 0!==t?t:null}function X(e){var t;return null!==(t=e.value)&&void 0!==t?t:null}function q(e,t,r,o){t.setBoolValue(e,r.value,{fromUi:r.fromUi},o)}const G=(0,o.memo)(A)},34752:(e,t,r)=>{r.d(t,{X:()=>a,o:()=>n});var o=r(58878),i=r(25571);class n{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,r){(0,i.se)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,i._L)(t)&&(this.formClearListener=e.addFormClearedListener(t,r),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}function a(e){let{element:t,widgetMgr:r,onFormCleared:n}=e;(0,o.useEffect)((()=>{if(!(0,i._L)(t.formId))return;const e=r.addFormClearedListener(t.formId,n);return()=>{e.disconnect()}}),[t,r,n])}},3101:(e,t,r)=>{r.d(t,{_:()=>a,t:()=>l});var o=r(58878),i=r(34752),n=r(25571);function a(e){let{getStateFromWidgetMgr:t,getDefaultState:r,updateWidgetMgrState:a,element:l,widgetMgr:c,fragmentId:s,onFormCleared:d}=e;const[u,g]=(0,o.useState)((()=>{var e;return null!==(e=t(c,l))&&void 0!==e?e:r(c,l)})),[p,h]=(0,o.useState)({value:u,fromUi:!1});(0,o.useEffect)((()=>{(0,n.hX)(p)||(h(null),g(p.value),a(l,c,p,s))}),[p,a,l,c,s]);const f=(0,o.useCallback)((()=>{h({value:r(c,l),fromUi:!0}),null===d||void 0===d||d()}),[h,l,r,c,d]);return(0,i.X)({widgetMgr:c,element:l,onFormCleared:f}),[u,h]}function l(e){let{getStateFromWidgetMgr:t,getDefaultStateFromProto:r,getCurrStateFromProto:i,updateWidgetMgrState:n,element:l,widgetMgr:c,fragmentId:s,onFormCleared:d}=e;const u=(0,o.useCallback)(((e,t)=>r(t)),[r]),[g,p]=a({getStateFromWidgetMgr:t,getDefaultState:u,updateWidgetMgrState:n,element:l,widgetMgr:c,fragmentId:s,onFormCleared:d});return(0,o.useEffect)((()=>{l.setValue&&(l.setValue=!1,p({value:i(l),fromUi:!1}))}),[l,i,p]),[g,p]}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[3224],{85850:(e,t,n)=>{n.d(t,{K:()=>b,A:()=>y});n(58878);var r=n(8151),i=n(12274),o=n(63186),a=n(4629),l=n(997),s=n(36459),d=n(84720),c=n(64611),u=n(89653),g=n(16795);const p="-2.4rem",f=(0,u.A)("div",{target:"e2wxzia1"})((e=>{let{theme:t,locked:n,target:r}=e;return{padding:`${t.spacing.sm} 0 ${t.spacing.sm} ${t.spacing.sm}`,position:"absolute",top:n?p:"-1rem",right:t.spacing.none,transition:"none",...!n&&{opacity:0,"&:active, &:focus-visible, &:hover":{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:p},...r&&{[`${r}:hover &, ${r}:active &, ${r}:focus-visible &`]:{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:p}}}}}),""),m=(0,u.A)("div",{target:"e2wxzia0"})((e=>{let{theme:t}=e;return{color:(0,g.iq)(t)?t.colors.fadedText60:t.colors.bodyText,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end",boxShadow:"1px 2px 8px rgba(0, 0, 0, 0.08)",borderRadius:t.radii.default,backgroundColor:t.colors.lightenedBg05,width:"fit-content",zIndex:t.zIndices.sidebar+1}}),"");var h=n(90782);function b(e){let{label:t,show_label:n,icon:i,onClick:o}=e;const u=(0,r.u)(),g=n?t:"";return(0,h.jsx)("div",{"data-testid":"stElementToolbarButton",children:(0,h.jsx)(l.A,{content:(0,h.jsx)(a.Ay,{source:t,allowHTML:!1,style:{fontSize:u.fontSizes.sm}}),placement:l.W.TOP,onMouseEnterDelay:1e3,inline:!0,children:(0,h.jsxs)(s.Ay,{onClick:e=>{o&&o(),e.stopPropagation()},kind:d.KX.ELEMENT_TOOLBAR,"aria-label":t,children:[i&&(0,h.jsx)(c.A,{content:i,size:"md",testid:"stElementToolbarButtonIcon"}),g&&(0,h.jsx)("span",{children:g})]})})})}const y=e=>{let{onExpand:t,onCollapse:n,isFullScreen:r,locked:a,children:l,target:s,disableFullscreenMode:d}=e;return(0,h.jsx)(f,{className:"stElementToolbar","data-testid":"stElementToolbar",locked:a||r,target:s,children:(0,h.jsxs)(m,{children:[l,t&&!d&&!r&&(0,h.jsx)(b,{label:"Fullscreen",icon:i.g,onClick:()=>t()}),n&&!d&&r&&(0,h.jsx)(b,{label:"Close fullscreen",icon:o.Q,onClick:()=>n()})]})})}},53224:(e,t,n)=>{n.r(t),n.d(t,{default:()=>be});var r=n(58878),i=n(8151),o=n(19613),a=n(56146),l=n(50248),s=n(95241),d=n(71034),c=n.n(d),u=n(34752),g=n(85850),p=n(25571),f=n(58144),m=n(50609),h=n.n(m),b=n(29669),y=n(67253);var v=n(93480),x=n(997),w=n(70474),C=n(35526);const j=e=>{var t;let{widgetMgr:n,id:i,formId:o,key:a,defaultValue:l}=e;(0,r.useEffect)((()=>{const e=n.getElementState(i,a);(0,p.hX)(e)&&(0,p.se)(l)&&n.setElementState(i,a,l)}),[n,i,a,l]);const[s,d]=(0,r.useState)(null!==(t=n.getElementState(i,a))&&void 0!==t?t:l),c=(0,r.useCallback)((e=>{n.setElementState(i,a,e),d(e)}),[n,i,a]),g=(0,r.useMemo)((()=>({formId:o||""})),[o]),f=(0,r.useCallback)((()=>c(l)),[l,c]);return(0,u.X)({element:g,widgetMgr:n,onFormCleared:f}),[s,c]};var k=n(84152),A=n(55562);const I=(e,t)=>{const{libConfig:{enforceDownloadInNewTab:n=!1}}=r.useContext(k.n);return(0,r.useCallback)((()=>{if(!e)return;const r=(0,A.A)({enforceDownloadInNewTab:n,url:e,filename:t});r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r)}),[e,n,t])};var S=n(89653),U=n(37888);const R=(0,S.A)("div",{target:"e12wn80j15"})(""),L=(0,S.A)("div",{target:"e12wn80j14"})((e=>{let{theme:t}=e;return{height:t.sizes.largestElementHeight,width:"100%",background:t.colors.secondaryBg,borderRadius:t.radii.default,marginBottom:t.spacing.twoXS,display:"flex",alignItems:"center",position:"relative",paddingLeft:t.spacing.xs,paddingRight:t.spacing.sm}}),""),E=(0,S.A)("div",{target:"e12wn80j13"})({name:"82a6rk",styles:"flex:1"}),T=(0,S.A)("div",{target:"e12wn80j12"})((e=>{let{show:t}=e;return{display:t?"block":"none"}}),""),F=(0,S.A)("span",{target:"e12wn80j11"})((e=>{let{theme:t,isPlayingOrRecording:n}=e;return{margin:t.spacing.sm,fontFamily:t.fonts.monospace,color:n?t.colors.bodyText:t.colors.fadedText60,backgroundColor:t.colors.secondaryBg,fontSize:t.fontSizes.sm}}),""),M=(0,S.A)("div",{target:"e12wn80j10"})({name:"1kyw74z",styles:"width:100%;text-align:center;overflow:hidden"}),P=(0,S.A)("span",{target:"e12wn80j9"})((e=>{let{theme:t}=e;return{color:t.colors.bodyText}}),""),z=(0,S.A)("a",{target:"e12wn80j8"})(""),W=(0,S.A)("div",{target:"e12wn80j7"})((e=>{let{theme:t}=e;return{height:t.sizes.largestElementHeight,display:"flex",justifyContent:"center",alignItems:"center"}}),""),B=(0,S.A)("div",{target:"e12wn80j6"})((e=>{let{theme:t}=e;const n="0.625em";return{opacity:.2,width:"100%",height:n,backgroundSize:n,backgroundImage:`radial-gradient(${t.colors.fadedText10} 40%, transparent 40%)`,backgroundRepeat:"repeat"}}),""),X=(0,S.A)("span",{target:"e12wn80j5"})((e=>{let{theme:t}=e;return{"& > button":{color:t.colors.primary,padding:t.spacing.threeXS},"& > button:hover, & > button:focus":{color:t.colors.red}}}),""),O=(0,S.A)("span",{target:"e12wn80j4"})((e=>{let{theme:t}=e;return{"& > button":{padding:t.spacing.threeXS,color:t.colors.fadedText40},"& > button:hover, & > button:focus":{color:t.colors.primary}}}),""),D=(0,S.A)("span",{target:"e12wn80j3"})((e=>{let{theme:t}=e;return{"& > button":{padding:t.spacing.threeXS,color:t.colors.fadedText60},"& > button:hover, & > button:focus":{color:t.colors.bodyText}}}),""),V=(0,S.A)("div",{target:"e12wn80j2"})((e=>{let{theme:t}=e;return{display:"flex",justifyContent:"center",alignItems:"center",flexGrow:0,flexShrink:1,padding:t.spacing.xs,gap:t.spacing.twoXS,marginRight:t.spacing.twoXS}}),""),_=(0,S.A)("div",{target:"e12wn80j1"})((e=>{let{theme:t}=e;return{marginLeft:t.spacing.sm}}),""),$=(0,S.A)(U.x,{target:"e12wn80j0"})((e=>{let{theme:t}=e;return{fontSize:t.fontSizes.sm,width:t.sizes.spinnerSize,height:t.sizes.spinnerSize,borderWidth:t.sizes.spinnerThickness,radius:t.radii.md,justifyContents:"center",padding:t.spacing.none,margin:t.spacing.none,borderColor:t.colors.borderColor,borderTopColor:t.colors.primary,flexGrow:0,flexShrink:0}}),"");var N=n(39095),H=n(90782);const K=()=>(0,H.jsxs)(M,{children:[(0,H.jsx)(P,{children:"This app would like to use your microphone."})," ",(0,H.jsx)(z,{href:N.ML,children:"Learn how to allow access."})]}),G=()=>(0,H.jsx)(W,{children:(0,H.jsx)(B,{})}),q="00:00",Y=e=>new Date(e).toLocaleTimeString(void 0,{minute:"2-digit",second:"2-digit"});var Z=n(96626),Q=n(34783),J=n(37789),ee=n(14757),te=n(88685),ne=n(36459),re=n(84720),ie=n(64611);const oe=e=>{let{onClick:t,disabled:n,ariaLabel:r,iconContent:i}=e;return(0,H.jsx)(ne.Ay,{kind:re.KX.BORDERLESS_ICON,onClick:t,disabled:n,"aria-label":r,fluidWidth:!0,"data-testid":"stAudioInputActionButton",children:(0,H.jsx)(ie.A,{content:i,size:"lg",color:"inherit"})})},ae=e=>{let{disabled:t,stopRecording:n}=e;return(0,H.jsx)(X,{children:(0,H.jsx)(oe,{onClick:n,disabled:t,ariaLabel:"Stop recording",iconContent:Q.X})})},le=e=>{let{disabled:t,isPlaying:n,onClickPlayPause:r}=e;return(0,H.jsx)(D,{children:n?(0,H.jsx)(oe,{onClick:r,disabled:t,ariaLabel:"Pause",iconContent:J.v}):(0,H.jsx)(oe,{onClick:r,disabled:t,ariaLabel:"Play",iconContent:ee.S})})},se=e=>{let{disabled:t,startRecording:n}=e;return(0,H.jsx)(O,{children:(0,H.jsx)(oe,{onClick:n,disabled:t,ariaLabel:"Record",iconContent:Z.G})})},de=e=>{let{onClick:t}=e;return(0,H.jsx)(D,{children:(0,H.jsx)(oe,{disabled:!1,onClick:t,ariaLabel:"Reset",iconContent:te.C})})},ce=e=>{let{disabled:t,isRecording:n,isPlaying:r,isUploading:i,isError:o,recordingUrlExists:a,startRecording:l,stopRecording:s,onClickPlayPause:d,onClear:c}=e;return o?(0,H.jsx)(V,{children:(0,H.jsx)(de,{onClick:c})}):i?(0,H.jsx)(V,{children:(0,H.jsx)($,{"aria-label":"Uploading"})}):(0,H.jsxs)(V,{children:[n?(0,H.jsx)(ae,{disabled:t,stopRecording:s}):(0,H.jsx)(se,{disabled:t,startRecording:l}),a&&(0,H.jsx)(le,{disabled:t,isPlaying:r,onClickPlayPause:d})]})},ue=(0,r.memo)(ce);var ge=n(84996);function pe(e,t,n){for(let r=0;r<n.length;r++,t+=2){const i=Math.max(-1,Math.min(1,n[r]));e.setInt16(t,i<0?32768*i:32767*i,!0)}}const fe=async function(e){const t=new window.AudioContext,n=await e.arrayBuffer();let r;try{r=await t.decodeAudioData(n)}catch(u){return void(0,ge.vV)(u)}const i=r.numberOfChannels,o=r.sampleRate,a=r.length*i*2+44,l=new ArrayBuffer(a),s=new DataView(l),d={0:{type:"string",value:"RIFF"},4:{type:"uint32",value:36+2*r.length*i},8:{type:"string",value:"WAVE"},12:{type:"string",value:"fmt "},16:{type:"uint32",value:16},20:{type:"uint16",value:1},22:{type:"uint16",value:i},24:{type:"uint32",value:o},28:{type:"uint32",value:o*i*2},32:{type:"uint16",value:2*i},34:{type:"uint16",value:16},36:{type:"string",value:"data"},40:{type:"uint32",value:r.length*i*2}};Object.entries(d).forEach((e=>{let[t,{type:n,value:r}]=e;const i=parseInt(t,10);"string"===n?function(e,t,n){for(let r=0;r<n.length;r++)e.setUint8(t+r,n.charCodeAt(r))}(s,i,r):"uint32"===n?s.setUint32(i,r,!0):"uint16"===n&&s.setUint16(i,r,!0)}));for(let g=0;g<i;g++)pe(s,44+g*r.length*2,r.getChannelData(g));const c=new Uint8Array(l);return new Blob([c],{type:"audio/wav"})},me=()=>(0,H.jsx)(M,{children:(0,H.jsx)(P,{children:"An error has occurred, please try again."})}),he=e=>{var t;let{element:n,uploadClient:d,widgetMgr:m,fragmentId:k,disabled:A}=e;const S=(0,i.u)(),U=(0,C.Z)(S),[M,P]=(0,r.useState)(null),z=r.useRef(null),[W,B]=j({widgetMgr:m,id:n.id,key:"deleteFileUrl",defaultValue:null}),[X,O]=(0,r.useState)(null),[D,V]=(0,r.useState)([]),[$,N]=(0,r.useState)(null),[Z,Q]=j({widgetMgr:m,id:n.id,key:"recordingUrl",defaultValue:null}),[,J]=(0,r.useState)(0),ee=()=>{J((e=>e+1))},[te,ne]=(0,r.useState)(q),[re,ie]=j({widgetMgr:m,id:n.id,formId:n.formId,key:"recordingTime",defaultValue:q}),[oe,ae]=(0,r.useState)(!1),[le,se]=(0,r.useState)(!1),[de,ce]=(0,r.useState)(!1),[ge,pe]=(0,r.useState)(!1),[he,be]=(0,r.useState)(!1),ye=n.id,ve=n.formId,xe=(0,r.useCallback)((async e=>{let t;if(pe(!0),(0,p.se)(ve)&&m.setFormsWithUploadsInProgress(new Set([ve])),t="audio/wav"===e.type?e:await fe(e),!t)return void be(!0);const n=URL.createObjectURL(t),r=new File([t],"audio.wav",{type:t.type});Q(n),(async e=>{let{files:t,uploadClient:n,widgetMgr:r,widgetInfo:i,fragmentId:o}=e,a=[];try{a=await n.fetchFileURLs(t)}catch(c){return{successfulUploads:[],failedUploads:t.map((e=>({file:e,error:(0,y.$)(c)})))}}const l=h()(t,a),s=[],d=[];return await Promise.all(l.map((async e=>{let[t,r]=e;if(!t||!r||!r.uploadUrl||!r.fileId)return{file:t,fileUrl:r,error:new Error("No upload URL found")};try{await n.uploadFile({id:r.fileId,formId:i.formId||""},r.uploadUrl,t),s.push({fileUrl:r,file:t})}catch(c){const n=(0,y.$)(c);d.push({file:t,error:n})}}))),r.setFileUploaderStateValue(i,new b.qX({uploadedFileInfo:s.map((e=>{let{file:t,fileUrl:n}=e;return new b.HY({fileId:n.fileId,fileUrls:n,name:t.name,size:t.size})}))}),{fromUi:!0},o),{successfulUploads:s,failedUploads:d}})({files:[r],uploadClient:d,widgetMgr:m,widgetInfo:{id:ye,formId:ve},fragmentId:k}).then((e=>{let{successfulUploads:t,failedUploads:n}=e;if(n.length>0)return void be(!0);const r=t[0];r&&r.fileUrl.deleteUrl&&B(r.fileUrl.deleteUrl)})).finally((()=>{(0,p.se)(ve)&&m.setFormsWithUploadsInProgress(new Set),pe(!1)}))}),[Q,d,m,ye,ve,k,B]),we=(0,r.useCallback)((e=>{let{updateWidgetManager:t}=e;(0,p.hX)(M)||(0,p.hX)(W)||(Q(null),M.empty(),d.deleteFile(W),ne(q),ie(q),B(null),t&&m.setFileUploaderStateValue(n,{},{fromUi:!0},k),ae(!1),(0,p.se)(Z)&&URL.revokeObjectURL(Z))}),[W,Z,d,M,n,m,k,ie,Q,B]);(0,r.useEffect)((()=>{if((0,p.hX)(ve))return;const e=new u.o;return e.manageFormClearListener(m,ve,(()=>{we({updateWidgetManager:!0})})),()=>e.disconnect()}),[ve,we,m]);const Ce=(0,r.useCallback)((()=>{if(null===z.current)return;const e=o.A.create({container:z.current,waveColor:Z?(0,f.au)(S.colors.fadedText40,S.colors.secondaryBg):S.colors.primary,progressColor:S.colors.bodyText,height:(0,f.BY)(S.sizes.largestElementHeight)-8,barWidth:4,barGap:4,barRadius:8,cursorWidth:0,url:null!==Z&&void 0!==Z?Z:void 0});e.on("timeupdate",(e=>{ne(Y(1e3*e))})),e.on("pause",(()=>{ee()}));const t=e.registerPlugin(a.A.create({scrollingWaveform:!1,renderRecordedAudio:!0}));return t.on("record-end",(async e=>{xe(e)})),t.on("record-progress",(e=>{ie(Y(e))})),P(e),O(t),()=>{e&&e.destroy(),t&&t.destroy()}}),[xe]);(0,r.useEffect)((()=>Ce()),[Ce]),(0,r.useEffect)((()=>{c()(U,S)||null===M||void 0===M||M.setOptions({waveColor:Z?(0,f.au)(S.colors.fadedText40,S.colors.secondaryBg):S.colors.primary,progressColor:S.colors.bodyText})}),[S,U,Z,M]);const je=(0,r.useCallback)((()=>{M&&(M.playPause(),ae(!0),ee())}),[M]),ke=(0,r.useCallback)((async()=>{let e=$;de||(await navigator.mediaDevices.getUserMedia({audio:!0}).then((()=>a.A.getAvailableAudioDevices().then((t=>{if(V(t),t.length>0){const{deviceId:n}=t[0];N(n),e=n}})))).catch((e=>{se(!0)})),ce(!0)),X&&e&&M&&(M.setOptions({waveColor:S.colors.primary}),Z&&we({updateWidgetManager:!1}),X.startRecording({deviceId:e}).then((()=>{ee()})))}),[$,X,S,M,Z,we,de]),Ae=(0,r.useCallback)((()=>{X&&(X.stopRecording(),null===M||void 0===M||M.setOptions({waveColor:(0,f.au)(S.colors.fadedText40,S.colors.secondaryBg)}))}),[X,M,S]),Ie=I(Z,"recording.wav"),Se=Boolean(null===X||void 0===X?void 0:X.isRecording()),Ue=Boolean(null===M||void 0===M?void 0:M.isPlaying()),Re=Se||Ue,Le=!Se&&!Z&&!le,Ee=le||Le||he,Te=A||le;return(0,H.jsxs)(R,{className:"stAudioInput","data-testid":"stAudioInput",children:[(0,H.jsx)(w.L,{label:n.label,disabled:Te,labelVisibility:(0,p.yv)(null===(t=n.labelVisibility)||void 0===t?void 0:t.value),children:n.help&&(0,H.jsx)(_,{children:(0,H.jsx)(v.A,{content:n.help,placement:x.W.TOP})})}),(0,H.jsxs)(L,{children:[(0,H.jsxs)(g.A,{isFullScreen:!1,disableFullscreenMode:!0,target:L,children:[Z&&(0,H.jsx)(g.K,{label:"Download recording",icon:l.f,onClick:()=>Ie()}),W&&(0,H.jsx)(g.K,{label:"Clear recording",icon:s.e,onClick:()=>we({updateWidgetManager:!0})})]}),(0,H.jsx)(ue,{isRecording:Se,isPlaying:Ue,isUploading:ge,isError:he,recordingUrlExists:Boolean(Z),startRecording:ke,stopRecording:Ae,onClickPlayPause:je,onClear:()=>{we({updateWidgetManager:!1}),be(!1)},disabled:Te}),(0,H.jsxs)(E,{children:[he&&(0,H.jsx)(me,{}),Le&&(0,H.jsx)(G,{}),le&&(0,H.jsx)(K,{}),(0,H.jsx)(T,{"data-testid":"stAudioInputWaveSurfer",ref:z,show:!Ee})]}),(0,H.jsx)(F,{isPlayingOrRecording:Re,"data-testid":"stAudioInputWaveformTimeCode",children:oe?te:re})]})]})},be=(0,r.memo)(he)},34752:(e,t,n)=>{n.d(t,{X:()=>a,o:()=>o});var r=n(58878),i=n(25571);class o{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,n){(0,i.se)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,i._L)(t)&&(this.formClearListener=e.addFormClearedListener(t,n),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}function a(e){let{element:t,widgetMgr:n,onFormCleared:o}=e;(0,r.useEffect)((()=>{if(!(0,i._L)(t.formId))return;const e=n.addFormClearedListener(t.formId,o);return()=>{e.disconnect()}}),[t,n,o])}},35526:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(58878);const i=e=>{const t=(0,r.useRef)();return(0,r.useEffect)((()=>{t.current=e}),[e]),t.current}},55562:(e,t,n)=>{n.d(t,{A:()=>r});const r=e=>{let{enforceDownloadInNewTab:t,url:n,filename:r}=e;const i=document.createElement("a");return i.setAttribute("href",n),t?i.setAttribute("target","_blank"):i.setAttribute("target","_self"),i.setAttribute("download",r),i}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[3861],{53861:(e,t,o)=>{o.r(t),o.d(t,{default:()=>b});var i=o(58878),s=o(8151),r=o(59900),a=o(16795),n=o(4629),l=o(3257),d=o(75577),c=o(94426),p=o(89653);const g=(0,p.A)("button",{target:"elibz2u3"})((e=>{let{theme:t}=e;return{fontSize:t.fontSizes.sm,lineHeight:t.lineHeights.base,color:t.colors.fadedText60,backgroundColor:t.colors.transparent,border:"none",boxShadow:"none",padding:t.spacing.none,"&:hover, &:active, &:focus":{border:"none",outline:"none",boxShadow:"none"},"&:hover":{color:t.colors.primary}}}),""),u=(0,p.A)("div",{target:"elibz2u2"})((e=>{let{theme:t}=e;return{display:"flex",flexDirection:"row",gap:t.spacing.lg,"> span":{marginTop:t.spacing.twoXS}}}),""),f=(0,p.A)("div",{target:"elibz2u0"})((e=>{let{theme:t}=e;return{display:"flex",flexDirection:"column",gap:t.spacing.sm,alignItems:"start",justifyContent:"center",overflow:"hidden",minHeight:"100%",fontSize:t.fontSizes.sm,lineHeight:t.lineHeights.base}}),"");var h=o(90782);const b=(0,s.b)((function(e){let{theme:t,body:o,icon:s,width:p}=e;const b=function(e){if(e.length>104){let t=e.replace(/^(.{104}[^\s]*).*/,"$1");return t.length>104&&(t=t.substring(0,104).split(" ").slice(0,-1).join(" ")),t.trim()}return e}(o),m=o!==b,[x,w]=(0,i.useState)(!m),[y,S]=(0,i.useState)(0),v=(0,i.useCallback)((()=>{w(!x)}),[x]),T=(0,i.useMemo)((()=>function(e){const t=(0,a.iq)(e);return{Body:{props:{"data-testid":"stToast",className:"stToast"},style:{display:"flex",flexDirection:"row",gap:e.spacing.md,width:e.sizes.toastWidth,marginTop:e.spacing.sm,borderTopLeftRadius:e.radii.default,borderTopRightRadius:e.radii.default,borderBottomLeftRadius:e.radii.default,borderBottomRightRadius:e.radii.default,paddingTop:e.spacing.lg,paddingBottom:e.spacing.lg,paddingLeft:e.spacing.twoXL,paddingRight:e.spacing.twoXL,backgroundColor:t?e.colors.gray10:e.colors.gray90,color:e.colors.bodyText,boxShadow:t?"0px 4px 16px rgba(0, 0, 0, 0.16)":"0px 4px 16px rgba(0, 0, 0, 0.7)"}},CloseIcon:{style:{color:e.colors.fadedText40,width:e.fontSizes.lg,height:e.fontSizes.lg,marginRight:`calc(-1 * ${e.spacing.lg} / 2)`,":hover":{color:e.colors.bodyText}}}}}(t)),[t]),z=(0,i.useMemo)((()=>(0,h.jsxs)(u,{expanded:x,children:[s&&(0,h.jsx)(c.$,{iconValue:s,size:"xl",testid:"stToastDynamicIcon"}),(0,h.jsxs)(f,{children:[(0,h.jsx)(n.Ay,{source:x?o:b,allowHTML:!1,isToast:!0}),m&&(0,h.jsx)(g,{"data-testid":"stToastViewButton",onClick:v,children:x?"view less":"view more"})]})]})),[m,x,o,s,b,v]);(0,i.useEffect)((()=>{if(t.inSidebar)return;const e=r.A.info(z,{overrides:{...T}});return S(e),()=>{r.A.update(e,{overrides:{Body:{style:{transitionDuration:0}}}}),r.A.clear(e)}}),[]),(0,i.useEffect)((()=>{r.A.update(y,{children:z,overrides:{...T}})}),[y,z,T]);const A=(0,h.jsx)(d.A,{kind:l.b.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.",width:p});return(0,h.jsx)(h.Fragment,{children:t.inSidebar&&A})}))}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[4827],{74827:(e,r,o)=>{o.r(r),o.d(r,{default:()=>f});var t=o(58878),a=o(8151),n=o(94426),l=o(997),i=o(98350),s=o(4629),d=o(84152),c=o(42333),p=o(89653);const g=(0,p.A)("div",{target:"e11k5jya2"})({name:"1fttcpj",styles:"display:flex;flex-direction:column"}),u=(0,p.A)("a",{target:"e11k5jya1"})((e=>{let{disabled:r,isCurrentPage:o,fluidWidth:t,theme:a}=e;return{textDecoration:"none",width:"number"==typeof t?`${t}px`:"fit-content",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:a.spacing.sm,borderRadius:a.radii.default,paddingLeft:a.spacing.sm,paddingRight:a.spacing.sm,marginTop:a.spacing.threeXS,marginBottom:a.spacing.threeXS,lineHeight:a.lineHeights.menuItem,backgroundColor:o?a.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:o?a.colors.darkenedBgMix25:a.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:a.colors.darkenedBgMix15},"@media print":{paddingLeft:a.spacing.none},...r?{borderColor:a.colors.borderColor,backgroundColor:a.colors.transparent,color:a.colors.fadedText40,cursor:"not-allowed","&:hover":{color:a.colors.fadedText40,backgroundColor:a.colors.transparent}}:{}}}),""),h=(0,p.A)("span",{target:"e11k5jya0"})((e=>{let{disabled:r,theme:o}=e;return{color:o.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...r?{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}:{}}}),"");var b=o(90782);const f=function(e){const{onPageChange:r,currentPageScriptHash:o}=t.useContext(d.n),p=t.useContext(c.A),{colors:f}=(0,a.u)(),{disabled:x,element:k,width:m}=e,C={width:m},v=function(e,r){return!(null!==e||!r)||!(null===e&&!r)&&!0===e}(k.useContainerWidth,p),w=o===k.pageScriptHash;return(0,b.jsx)("div",{className:"stPageLink","data-testid":"stPageLink",style:C,children:(0,b.jsx)(i.F,{help:k.help,placement:l.W.TOP_RIGHT,children:(0,b.jsx)(g,{children:(0,b.jsxs)(u,{"data-testid":"stPageLink-NavLink",disabled:x,isCurrentPage:w,fluidWidth:!!v&&m,href:k.page,target:k.external?"_blank":"",rel:"noreferrer",onClick:e=>{k.external?x&&e.preventDefault():(e.preventDefault(),x||r(k.pageScriptHash))},children:[k.icon&&(0,b.jsx)(n.$,{size:"lg",color:f.bodyText,iconValue:k.icon}),(0,b.jsx)(h,{disabled:x,children:(0,b.jsx)(s.Ay,{source:k.label,allowHTML:!1,isLabel:!0,boldLabel:w,largerLabel:!0,disableLinks:!0})})]})})})})}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[5625],{15625:(e,t,r)=>{r.r(t),r.d(t,{default:()=>G});var n=r(58878),o=r(8151),i=Object.freeze({radio:"radio",checkbox:"checkbox"}),l=(Object.freeze({change:"change"}),"default"),a=r(35331),c=r(65266),u=(0,r(57224).I4)("div",(function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=1===r?void 0:t!==l?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}}));function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},f.apply(this,arguments)}function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){O(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],l=!0,a=!1;try{for(r=r.call(e);!(l=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);l=!0);}catch(c){a=!0,o=c}finally{try{l||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return y(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return y(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function g(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function b(e,t){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},b(e,t)}function h(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=S(e);if(t){var o=S(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===s(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return v(e)}(this,r)}}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S(e){return S=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},S(e)}function O(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}u.displayName="StyledRoot",u.displayName="StyledRoot";var C=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b(e,t)}(d,e);var t,r,o,s=h(d);function d(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return O(v(e=s.call.apply(s,[this].concat(r))),"childRefs",{}),e}return t=d,r=[{key:"render",value:function(){var e=this,t=this.props,r=t.overrides,o=void 0===r?{}:r,s=t.mode,d=void 0===s?i.checkbox:s,y=t.children,g=t.selected,b=t.disabled,h=t.onClick,v=t.kind,S=t.shape,O=t.size,C=m((0,a._O)(o.Root,u),2),w=C[0],L=C[1],E=this.props["aria-label"]||this.props.ariaLabel,j=d===i.radio,k=n.Children.count(y);return n.createElement(c.U.Consumer,null,(function(t){return n.createElement(w,f({"aria-label":E||t.buttongroup.ariaLabel,"data-baseweb":"button-group",role:j?"radiogroup":"group",$shape:S,$length:y.length},L),n.Children.map(y,(function(t,r){if(!n.isValidElement(t))return null;var o=t.props.isSelected?t.props.isSelected:function(e,t){return!(!Array.isArray(e)&&"number"!==typeof e)&&(Array.isArray(e)?e.includes(t):e===t)}(g,r);return j&&(e.childRefs[r]=n.createRef()),n.cloneElement(t,{disabled:b||t.props.disabled,isSelected:o,ref:j?e.childRefs[r]:void 0,tabIndex:!j||o||j&&(!g||-1===g)&&0===r?0:-1,onKeyDown:function(t){if(j){var r=Number(g)?Number(g):0;if("ArrowUp"===t.key||"ArrowLeft"===t.key){t.preventDefault&&t.preventDefault();var n=r-1<0?k-1:r-1;h&&h(t,n),e.childRefs[n].current&&e.childRefs[n].current.focus()}if("ArrowDown"===t.key||"ArrowRight"===t.key){t.preventDefault&&t.preventDefault();var o=r+1>k-1?0:r+1;h&&h(t,o),e.childRefs[o].current&&e.childRefs[o].current.focus()}}},kind:v,onClick:function(e){b||(t.props.onClick&&t.props.onClick(e),h&&h(e,r))},shape:S,size:O,overrides:p({BaseButton:{style:function(e){var t=e.$theme;return 1===y.length?{}:S!==l?{marginLeft:t.sizing.scale100,marginRight:t.sizing.scale100}:{marginLeft:"0.5px",marginRight:"0.5px"}},props:{"aria-checked":o,role:j?"radio":"checkbox"}}},t.props.overrides)})})))}))}}],r&&g(t.prototype,r),o&&g(t,o),Object.defineProperty(t,"prototype",{writable:!1}),d}(n.Component);O(C,"defaultProps",{disabled:!1,onClick:function(){},shape:l,size:"default",kind:"secondary"});var w=r(4629),L=r(84720),E=r(36459),j=r(94426),k=r(29669),M=r(70474),R=r(78286),I=r(93480),P=r(997),x=r(25571),_=r(3101),D=r(90782);function A(e,t,r,n){t.setIntArrayValue(e,r.value,{fromUi:r.fromUi},n)}function F(e,t,r,o,i,l){const a=function(e,t,r,n){return r.indexOf(n)>-1||t===k.e2.ClickMode.SINGLE_SELECT&&e===k.e2.SelectionVisualization.ALL_UP_TO_SELECTED&&r.length>0&&n<r[0]}(r,o,i,t);let c=e.content,u=e.contentIcon;return a&&(c=e.selectedContent?e.selectedContent:c,u=e.selectedContentIcon?e.selectedContentIcon:u),(0,n.forwardRef)((function(t,r){var n,o;const{element:i,kind:s,size:f}=function(e,t,r){const n=r===k.e2.Style.PILLS?L.KX.PILLS:r===k.e2.Style.BORDERLESS?L.KX.BORDERLESS_ICON:L.KX.SEGMENTED_CONTROL,o=r===k.e2.Style.BORDERLESS?L.Pj.XSMALL:L.Pj.MEDIUM,i=r===k.e2.Style.BORDERLESS?"lg":"base";return{element:(0,D.jsxs)(D.Fragment,{children:[t&&(0,D.jsx)(j.$,{size:i,iconValue:t}),e&&(0,D.jsx)(w.Ay,{source:e,allowHTML:!1})]}),kind:n,size:o}}(null!==(n=c)&&void 0!==n?n:"",null!==(o=u)&&void 0!==o?o:void 0,l),d=function(e,t){return e&&(t=`${t}Active`),t}(!(!a||e.selectedContent||e.selectedContentIcon),s);return(0,D.jsx)(E.Ay,{...t,size:f,kind:d,children:i})}))}function T(e,t){return e.getIntArrayValue(t)}function W(e){var t;return null!==(t=e.default)&&void 0!==t?t:null}function z(e){var t;return null!==(t=e.value)&&void 0!==t?t:null}function U(e){var t;const{disabled:r,element:l,fragmentId:a,widgetMgr:c}=e,{clickMode:u,options:s,selectionVisualization:f,style:d,label:p,labelVisibility:m,help:y}=l,g=(0,o.u)(),[b,h]=(0,_.t)({getStateFromWidgetMgr:T,getDefaultStateFromProto:W,getCurrStateFromProto:z,updateWidgetMgrState:A,element:l,widgetMgr:c,fragmentId:a});let v;u===k.e2.ClickMode.SINGLE_SELECT?v=i.radio:u===k.e2.ClickMode.MULTI_SELECT&&(v=i.checkbox);const S=(0,n.useMemo)((()=>s.map(((e,t)=>{const r=F(e,t,f,u,b,d);return(0,D.jsx)(r,{},`${e.content}-${t}`)}))),[u,s,f,d,b]);return(0,D.jsxs)("div",{className:"stButtonGroup","data-testid":"stButtonGroup",children:[(0,D.jsx)(M.L,{label:p,disabled:r,labelVisibility:(0,x.yv)(null!==(t=null===m||void 0===m?void 0:m.value)&&void 0!==t?t:k.Qx.LabelVisibilityOptions.COLLAPSED),children:y&&(0,D.jsx)(R.Cl,{children:(0,D.jsx)(I.A,{content:y,placement:P.W.TOP})})}),(0,D.jsx)(C,{disabled:r,mode:v,onClick:(e,t)=>{const r=function(e,t,r){return e==k.e2.ClickMode.MULTI_SELECT?function(e,t){return t.includes(e)?t.filter((t=>t!==e)):[...t,e]}(t,null!==r&&void 0!==r?r:[]):null!==r&&void 0!==r&&r.includes(t)?[]:[t]}(u,t,b);h({value:r,fromUi:!0})},selected:u===k.e2.ClickMode.MULTI_SELECT?b:(O=b,0===O.length?-1:O[0]),overrides:{Root:{style:(0,n.useCallback)((()=>function(e,t){const r={flexWrap:"wrap",maxWidth:"fit-content"};switch(e){case k.e2.Style.BORDERLESS:return{...r,columnGap:t.threeXS,rowGap:t.threeXS};case k.e2.Style.PILLS:return{...r,columnGap:t.twoXS,rowGap:t.twoXS};case k.e2.Style.SEGMENTED_CONTROL:return{...r,columnGap:t.none,rowGap:t.twoXS,"::after":{content:"''",flex:1e4}};default:return r}}(d,g.spacing)),[d,g.spacing])}},children:S})]});var O}const G=(0,n.memo)(U)},34752:(e,t,r)=>{r.d(t,{X:()=>l,o:()=>i});var n=r(58878),o=r(25571);class i{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,r){(0,o.se)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,o._L)(t)&&(this.formClearListener=e.addFormClearedListener(t,r),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}function l(e){let{element:t,widgetMgr:r,onFormCleared:i}=e;(0,n.useEffect)((()=>{if(!(0,o._L)(t.formId))return;const e=r.addFormClearedListener(t.formId,i);return()=>{e.disconnect()}}),[t,r,i])}},3101:(e,t,r)=>{r.d(t,{_:()=>l,t:()=>a});var n=r(58878),o=r(34752),i=r(25571);function l(e){let{getStateFromWidgetMgr:t,getDefaultState:r,updateWidgetMgrState:l,element:a,widgetMgr:c,fragmentId:u,onFormCleared:s}=e;const[f,d]=(0,n.useState)((()=>{var e;return null!==(e=t(c,a))&&void 0!==e?e:r(c,a)})),[p,m]=(0,n.useState)({value:f,fromUi:!1});(0,n.useEffect)((()=>{(0,i.hX)(p)||(m(null),d(p.value),l(a,c,p,u))}),[p,l,a,c,u]);const y=(0,n.useCallback)((()=>{m({value:r(c,a),fromUi:!0}),null===s||void 0===s||s()}),[m,a,r,c,s]);return(0,o.X)({widgetMgr:c,element:a,onFormCleared:y}),[f,m]}function a(e){let{getStateFromWidgetMgr:t,getDefaultStateFromProto:r,getCurrStateFromProto:o,updateWidgetMgrState:i,element:a,widgetMgr:c,fragmentId:u,onFormCleared:s}=e;const f=(0,n.useCallback)(((e,t)=>r(t)),[r]),[d,p]=l({getStateFromWidgetMgr:t,getDefaultState:f,updateWidgetMgrState:i,element:a,widgetMgr:c,fragmentId:u,onFormCleared:s});return(0,n.useEffect)((()=>{a.setValue&&(a.setValue=!1,p({value:o(a),fromUi:!1}))}),[a,o,p]),[d,p]}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[6088],{34752:(e,t,r)=>{r.d(t,{X:()=>a,o:()=>i});var o=r(58878),n=r(25571);class i{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,r){(0,n.se)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,n._L)(t)&&(this.formClearListener=e.addFormClearedListener(t,r),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}function a(e){let{element:t,widgetMgr:r,onFormCleared:i}=e;(0,o.useEffect)((()=>{if(!(0,n._L)(t.formId))return;const e=r.addFormClearedListener(t.formId,i);return()=>{e.disconnect()}}),[t,r,i])}},76088:(e,t,r)=>{r.r(t),r.d(t,{default:()=>fe});var o=r(58878),n=r(8151),i=r(35331),a=r(57224);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){c(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var u=0,p=1,d=2;function f(e){return e.$isActive?d:e.$isHovered?p:u}function h(e){var t=e.$theme.colors,r=e.$disabled,o=e.$checked,n=e.$isFocusVisible,i=e.$error;if(r)return t.tickFillDisabled;if(!o)return n?t.borderSelected:i?t.tickBorderError:t.tickBorder;if(i)switch(f(e)){case u:return t.tickFillErrorSelected;case p:return t.tickFillErrorSelectedHover;case d:return t.tickFillErrorSelectedHoverActive}else switch(f(e)){case u:return t.tickFillSelected;case p:return t.tickFillSelectedHover;case d:return t.tickFillSelectedHoverActive}return null}function b(e){var t=e.$theme.colors;if(e.$disabled)return t.tickMarkFillDisabled;if(e.$checked)return t.tickMarkFill;if(e.$error)switch(f(e)){case u:return t.tickFillError;case p:return t.tickFillErrorHover;case d:return t.tickFillErrorHoverActive}else switch(f(e)){case u:return t.tickFill;case p:return t.tickFillHover;case d:return t.tickFillActive}}function m(e){var t=e.$disabled,r=e.$theme.colors;return t?r.contentSecondary:r.contentPrimary}var g=(0,a.I4)("div",(function(e){var t=e.$disabled,r=e.$align;return{display:"flex",flexWrap:"wrap",flexDirection:"horizontal"===r?"row":"column",alignItems:"horizontal"===r?"center":"flex-start",cursor:t?"not-allowed":"pointer","-webkit-tap-highlight-color":"transparent"}}));g.displayName="RadioGroupRoot",g.displayName="RadioGroupRoot";var v=(0,a.I4)("label",(function(e){var t,r=e.$disabled,o=e.$hasDescription,n=e.$labelPlacement,i=e.$theme,a=e.$align,s=i.sizing,l="horizontal"===a,u="rtl"===i.direction?"Left":"Right";return c(t={flexDirection:"top"===n||"bottom"===n?"column":"row",display:"flex",alignItems:"center",cursor:r?"not-allowed":"pointer",marginTop:s.scale200},"margin".concat(u),l?s.scale200:null),c(t,"marginBottom",o&&!l?null:s.scale200),t}));v.displayName="Root",v.displayName="Root";var y=(0,a.I4)("div",(function(e){var t=e.$theme,r=t.animation,o=t.sizing;return{backgroundColor:b(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",height:e.$checked?o.scale200:o.scale550,transitionDuration:r.timing200,transitionTimingFunction:r.easeOutCurve,width:e.$checked?o.scale200:o.scale550}}));y.displayName="RadioMarkInner",y.displayName="RadioMarkInner";var w=(0,a.I4)("div",(function(e){var t=e.$theme,r=t.animation,o=t.sizing;return{alignItems:"center",backgroundColor:h(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",boxShadow:e.$isFocusVisible&&e.$checked?"0 0 0 3px ".concat(e.$theme.colors.accent):"none",display:"flex",height:o.scale700,justifyContent:"center",marginTop:o.scale0,marginRight:o.scale0,marginBottom:o.scale0,marginLeft:o.scale0,outline:"none",verticalAlign:"middle",width:o.scale700,flexShrink:0,transitionDuration:r.timing200,transitionTimingFunction:r.easeOutCurve}}));w.displayName="RadioMarkOuter",w.displayName="RadioMarkOuter";var O=(0,a.I4)("div",(function(e){var t=e.$theme.typography;return l(l({verticalAlign:"middle"},function(e){var t,r=e.$labelPlacement,o=void 0===r?"":r,n=e.$theme;switch(o){case"top":t="Bottom";break;case"bottom":t="Top";break;case"left":t="rtl"===n.direction?"Left":"Right";break;default:t="rtl"===n.direction?"Right":"Left"}var i=n.sizing.scale300;return c({},"padding".concat(t),i)}(e)),{},{color:m(e)},t.LabelMedium)}));O.displayName="Label",O.displayName="Label";var R=(0,a.I4)("input",{width:0,height:0,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,clip:"rect(0 0 0 0)",position:"absolute"});R.displayName="Input",R.displayName="Input";var k=(0,a.I4)("div",(function(e){var t,r=e.$theme,o=e.$align,n="horizontal"===o,i="rtl"===r.direction?"Right":"Left",a="rtl"===r.direction?"Left":"Right";return l(l({},r.typography.ParagraphSmall),{},(c(t={color:r.colors.contentSecondary,cursor:"auto"},"margin".concat(i),"horizontal"===o?null:r.sizing.scale900),c(t,"margin".concat(a),n?r.sizing.scale200:null),c(t,"maxWidth","240px"),t))}));k.displayName="Description",k.displayName="Description";var F=r(56498);function M(e){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M(e)}function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},S.apply(this,arguments)}function j(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var o,n,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(o=r.next()).done)&&(i.push(o.value),!t||i.length!==t);a=!0);}catch(l){s=!0,n=l}finally{try{a||null==r.return||r.return()}finally{if(s)throw n}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return $(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function P(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function C(e,t){return C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},C(e,t)}function I(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=L(e);if(t){var n=L(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return function(e,t){if(t&&("object"===M(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return E(e)}(this,r)}}function E(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L(e){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},L(e)}function x(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&C(e,t)}(s,e);var t,r,n,a=I(s);function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return x(E(e=a.call.apply(a,[this].concat(r))),"state",{isFocusVisible:!1,focusedRadioIndex:-1}),x(E(e),"handleFocus",(function(t,r){(0,F.pP)(t)&&e.setState({isFocusVisible:!0}),e.setState({focusedRadioIndex:r}),e.props.onFocus&&e.props.onFocus(t)})),x(E(e),"handleBlur",(function(t,r){!1!==e.state.isFocusVisible&&e.setState({isFocusVisible:!1}),e.setState({focusedRadioIndex:-1}),e.props.onBlur&&e.props.onBlur(t)})),e}return t=s,(r=[{key:"render",value:function(){var e=this,t=this.props.overrides,r=void 0===t?{}:t,n=j((0,i._O)(r.RadioGroupRoot,g),2),a=n[0],s=n[1];return o.createElement(a,S({id:this.props.id,role:"radiogroup","aria-describedby":this.props["aria-describedby"],"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props.error||null,"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],$align:this.props.align,$disabled:this.props.disabled,$error:this.props.error,$required:this.props.required},s),o.Children.map(this.props.children,(function(t,r){if(!o.isValidElement(t))return null;var n=e.props.value===t.props.value;return o.cloneElement(t,{align:e.props.align,autoFocus:e.props.autoFocus,checked:n,disabled:e.props.disabled||t.props.disabled,error:e.props.error,isFocused:e.state.focusedRadioIndex===r,isFocusVisible:e.state.isFocusVisible,tabIndex:0===r&&!e.props.value||n?"0":"-1",labelPlacement:e.props.labelPlacement,name:e.props.name,onBlur:function(t){return e.handleBlur(t,r)},onFocus:function(t){return e.handleFocus(t,r)},onChange:e.props.onChange,onMouseEnter:e.props.onMouseEnter,onMouseLeave:e.props.onMouseLeave})})))}}])&&P(t.prototype,r),n&&P(t,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.Component);x(_,"defaultProps",{name:"",value:"",disabled:!1,autoFocus:!1,labelPlacement:"right",align:"vertical",error:!1,required:!1,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onFocus:function(){},onBlur:function(){},overrides:{}});const T=_;var A="vertical",D="horizontal";function B(e){return B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B(e)}function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},z.apply(this,arguments)}function V(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var o,n,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(o=r.next()).done)&&(i.push(o.value),!t||i.length!==t);a=!0);}catch(l){s=!0,n=l}finally{try{a||null==r.return||r.return()}finally{if(s)throw n}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return H(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return H(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function N(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function W(e,t){return W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},W(e,t)}function U(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=G(e);if(t){var n=G(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return function(e,t){if(t&&("object"===B(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return q(e)}(this,r)}}function q(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function G(e){return G=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},G(e)}function X(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var J=function(e){return e.stopPropagation()},K=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&W(e,t)}(s,e);var t,r,n,a=U(s);function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return X(q(e=a.call.apply(a,[this].concat(r))),"state",{isActive:!1,isHovered:!1}),X(q(e),"onMouseEnter",(function(t){e.setState({isHovered:!0}),e.props.onMouseEnter&&e.props.onMouseEnter(t)})),X(q(e),"onMouseLeave",(function(t){e.setState({isHovered:!1}),e.props.onMouseLeave&&e.props.onMouseLeave(t)})),X(q(e),"onMouseDown",(function(t){e.setState({isActive:!0}),e.props.onMouseDown&&e.props.onMouseDown(t)})),X(q(e),"onMouseUp",(function(t){e.setState({isActive:!1}),e.props.onMouseUp&&e.props.onMouseUp(t)})),e}return t=s,(r=[{key:"componentDidMount",value:function(){var e;this.props.autoFocus&&null!==(e=this.props.inputRef)&&void 0!==e&&e.current&&this.props.inputRef.current.focus()}},{key:"render",value:function(){var e,t=this.props.overrides,r=void 0===t?{}:t,n=V((0,i._O)(r.Root,v),2),a=n[0],s=n[1],l=V((0,i._O)(r.Label,O),2),c=l[0],u=l[1],p=V((0,i._O)(r.Input,R),2),d=p[0],f=p[1],h=V((0,i._O)(r.Description,k),2),b=h[0],m=h[1],g=V((0,i._O)(r.RadioMarkInner,y),2),F=g[0],M=g[1],S=V((0,i._O)(r.RadioMarkOuter,w),2),j=S[0],$=S[1],P={$align:this.props.align,$checked:this.props.checked,$disabled:this.props.disabled,$hasDescription:!!this.props.description,$isActive:this.state.isActive,$error:this.props.error,$isFocused:this.props.isFocused,$isFocusVisible:this.props.isFocused&&this.props.isFocusVisible,$isHovered:this.state.isHovered,$labelPlacement:this.props.labelPlacement,$required:this.props.required,$value:this.props.value},C=o.createElement(c,z({},P,u),this.props.containsInteractiveElement?o.createElement("div",{onClick:function(e){return e.preventDefault()}},this.props.children):this.props.children);return o.createElement(o.Fragment,null,o.createElement(a,z({"data-baseweb":"radio",onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},P,s),("top"===(e=this.props.labelPlacement)||"left"===e)&&C,o.createElement(j,z({},P,$),o.createElement(F,z({},P,M))),o.createElement(d,z({"aria-invalid":this.props.error||null,checked:this.props.checked,disabled:this.props.disabled,name:this.props.name,onBlur:this.props.onBlur,onFocus:this.props.onFocus,onClick:J,onChange:this.props.onChange,ref:this.props.inputRef,required:this.props.required,tabIndex:this.props.tabIndex,type:"radio",value:this.props.value},P,f)),function(e){return"bottom"===e||"right"===e}(this.props.labelPlacement)&&C),!!this.props.description&&o.createElement(b,z({},P,m),this.props.description))}}])&&N(t.prototype,r),n&&N(t,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.Component);X(K,"defaultProps",{overrides:{},containsInteractiveElement:!1,checked:!1,disabled:!1,autoFocus:!1,inputRef:o.createRef(),align:"vertical",error:!1,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});const Q=K;var Y=r(70474),Z=r(78286),ee=r(93480),te=r(997),re=r(34914),oe=r(90782);function ne(e){let{disabled:t,horizontal:r,width:i,value:a,onChange:s,options:l,captions:c,label:u,labelVisibility:p,help:d}=e;const[f,h]=(0,o.useState)(null!==a&&void 0!==a?a:null);(0,o.useEffect)((()=>{a!==f&&h(null!==a&&void 0!==a?a:null)}),[a]);const b=(0,o.useCallback)((e=>{const t=parseInt(e.target.value,10);h(t),s(t)}),[s]),m=(0,n.u)(),{colors:g,radii:v}=m,y={width:i},w=c.length>0,O=l.length>0,R=O?l:["No options to select."],k=t||!O;return(0,oe.jsxs)("div",{className:"stRadio","data-testid":"stRadio",style:y,children:[(0,oe.jsx)(Y.L,{label:u,disabled:k,labelVisibility:p,children:d&&(0,oe.jsx)(Z.Cl,{children:(0,oe.jsx)(ee.A,{content:d,placement:te.W.TOP_RIGHT})})}),(0,oe.jsx)(T,{onChange:b,value:null!==f?f.toString():void 0,disabled:k,align:r?D:A,"aria-label":u,"data-testid":"stRadioGroup",overrides:{RadioGroupRoot:{style:{gap:w?m.spacing.sm:m.spacing.none,minHeight:m.sizes.minElementHeight}}},children:R.map(((e,t)=>{return(0,oe.jsxs)(Q,{value:t.toString(),overrides:{Root:{style:e=>{let{$isFocusVisible:t}=e;return{marginBottom:m.spacing.none,marginTop:m.spacing.none,marginRight:w?m.spacing.sm:m.spacing.lg,paddingLeft:m.spacing.none,alignItems:"start",paddingRight:m.spacing.threeXS,backgroundColor:t?g.darkenedBgMix25:"",borderTopLeftRadius:v.md,borderTopRightRadius:v.md,borderBottomLeftRadius:v.md,borderBottomRightRadius:v.md}}},RadioMarkOuter:{style:e=>{let{$checked:t}=e;return{width:m.sizes.checkbox,height:m.sizes.checkbox,marginTop:"0.35rem",marginRight:m.spacing.none,marginLeft:m.spacing.none,backgroundColor:t&&!k?g.primary:g.fadedText40}}},RadioMarkInner:{style:e=>{let{$checked:t}=e;return{height:t?"6px":`calc(${m.sizes.checkbox} - ${m.spacing.threeXS})`,width:t?"6px":`calc(${m.sizes.checkbox} - ${m.spacing.threeXS})`}}},Label:{style:{color:k?g.fadedText40:g.bodyText,position:"relative",top:m.spacing.px}}},children:[(0,oe.jsx)(re.Ay,{source:e,allowHTML:!1,isLabel:!0,largerLabel:!0}),w&&(0,oe.jsx)(re.Ay,{source:(o=c[t],""==o&&r&&w?"&nbsp;":o),allowHTML:!1,isCaption:!0,isLabel:!0})]},t);var o}))})]})}const ie=(0,o.memo)(ne);var ae=r(3101),se=r(25571);function le(e){let{disabled:t,element:r,widgetMgr:n,width:i,fragmentId:a}=e;const[s,l]=(0,ae.t)({getStateFromWidgetMgr:ce,getDefaultStateFromProto:ue,getCurrStateFromProto:pe,updateWidgetMgrState:de,element:r,widgetMgr:n,fragmentId:a}),c=(0,o.useCallback)((e=>{l({value:e,fromUi:!0})}),[l]),{horizontal:u,options:p,captions:d,label:f,labelVisibility:h,help:b}=r;return(0,oe.jsx)(ie,{label:f,onChange:c,options:p,captions:d,width:i,disabled:t,horizontal:u,labelVisibility:(0,se.yv)(null===h||void 0===h?void 0:h.value),value:null!==s&&void 0!==s?s:null,help:b})}function ce(e,t){return e.getIntValue(t)}function ue(e){var t;return null!==(t=e.default)&&void 0!==t?t:null}function pe(e){var t;return null!==(t=e.value)&&void 0!==t?t:null}function de(e,t,r,o){var n;t.setIntValue(e,null!==(n=r.value)&&void 0!==n?n:null,{fromUi:r.fromUi},o)}const fe=(0,o.memo)(le)},3101:(e,t,r)=>{r.d(t,{_:()=>a,t:()=>s});var o=r(58878),n=r(34752),i=r(25571);function a(e){let{getStateFromWidgetMgr:t,getDefaultState:r,updateWidgetMgrState:a,element:s,widgetMgr:l,fragmentId:c,onFormCleared:u}=e;const[p,d]=(0,o.useState)((()=>{var e;return null!==(e=t(l,s))&&void 0!==e?e:r(l,s)})),[f,h]=(0,o.useState)({value:p,fromUi:!1});(0,o.useEffect)((()=>{(0,i.hX)(f)||(h(null),d(f.value),a(s,l,f,c))}),[f,a,s,l,c]);const b=(0,o.useCallback)((()=>{h({value:r(l,s),fromUi:!0}),null===u||void 0===u||u()}),[h,s,r,l,u]);return(0,n.X)({widgetMgr:l,element:s,onFormCleared:b}),[p,h]}function s(e){let{getStateFromWidgetMgr:t,getDefaultStateFromProto:r,getCurrStateFromProto:n,updateWidgetMgrState:i,element:s,widgetMgr:l,fragmentId:c,onFormCleared:u}=e;const p=(0,o.useCallback)(((e,t)=>r(t)),[r]),[d,f]=a({getStateFromWidgetMgr:t,getDefaultState:p,updateWidgetMgrState:i,element:s,widgetMgr:l,fragmentId:c,onFormCleared:u});return(0,o.useEffect)((()=>{s.setValue&&(s.setValue=!1,f({value:n(s),fromUi:!1}))}),[s,n,f]),[d,f]}}}]);
1
+ "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[6088],{34752:(e,t,r)=>{r.d(t,{X:()=>a,o:()=>i});var o=r(58878),n=r(25571);class i{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,r){(0,n.se)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,n._L)(t)&&(this.formClearListener=e.addFormClearedListener(t,r),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}function a(e){let{element:t,widgetMgr:r,onFormCleared:i}=e;(0,o.useEffect)((()=>{if(!(0,n._L)(t.formId))return;const e=r.addFormClearedListener(t.formId,i);return()=>{e.disconnect()}}),[t,r,i])}},76088:(e,t,r)=>{r.r(t),r.d(t,{default:()=>fe});var o=r(58878),n=r(8151),i=r(35331),a=r(57224);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){c(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var u=0,p=1,d=2;function f(e){return e.$isActive?d:e.$isHovered?p:u}function h(e){var t=e.$theme.colors,r=e.$disabled,o=e.$checked,n=e.$isFocusVisible,i=e.$error;if(r)return t.tickFillDisabled;if(!o)return n?t.borderSelected:i?t.tickBorderError:t.tickBorder;if(i)switch(f(e)){case u:return t.tickFillErrorSelected;case p:return t.tickFillErrorSelectedHover;case d:return t.tickFillErrorSelectedHoverActive}else switch(f(e)){case u:return t.tickFillSelected;case p:return t.tickFillSelectedHover;case d:return t.tickFillSelectedHoverActive}return null}function b(e){var t=e.$theme.colors;if(e.$disabled)return t.tickMarkFillDisabled;if(e.$checked)return t.tickMarkFill;if(e.$error)switch(f(e)){case u:return t.tickFillError;case p:return t.tickFillErrorHover;case d:return t.tickFillErrorHoverActive}else switch(f(e)){case u:return t.tickFill;case p:return t.tickFillHover;case d:return t.tickFillActive}}function m(e){var t=e.$disabled,r=e.$theme.colors;return t?r.contentSecondary:r.contentPrimary}var g=(0,a.I4)("div",(function(e){var t=e.$disabled,r=e.$align;return{display:"flex",flexWrap:"wrap",flexDirection:"horizontal"===r?"row":"column",alignItems:"horizontal"===r?"center":"flex-start",cursor:t?"not-allowed":"pointer","-webkit-tap-highlight-color":"transparent"}}));g.displayName="RadioGroupRoot",g.displayName="RadioGroupRoot";var v=(0,a.I4)("label",(function(e){var t,r=e.$disabled,o=e.$hasDescription,n=e.$labelPlacement,i=e.$theme,a=e.$align,s=i.sizing,l="horizontal"===a,u="rtl"===i.direction?"Left":"Right";return c(t={flexDirection:"top"===n||"bottom"===n?"column":"row",display:"flex",alignItems:"center",cursor:r?"not-allowed":"pointer",marginTop:s.scale200},"margin".concat(u),l?s.scale200:null),c(t,"marginBottom",o&&!l?null:s.scale200),t}));v.displayName="Root",v.displayName="Root";var y=(0,a.I4)("div",(function(e){var t=e.$theme,r=t.animation,o=t.sizing;return{backgroundColor:b(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",height:e.$checked?o.scale200:o.scale550,transitionDuration:r.timing200,transitionTimingFunction:r.easeOutCurve,width:e.$checked?o.scale200:o.scale550}}));y.displayName="RadioMarkInner",y.displayName="RadioMarkInner";var w=(0,a.I4)("div",(function(e){var t=e.$theme,r=t.animation,o=t.sizing;return{alignItems:"center",backgroundColor:h(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",boxShadow:e.$isFocusVisible&&e.$checked?"0 0 0 3px ".concat(e.$theme.colors.accent):"none",display:"flex",height:o.scale700,justifyContent:"center",marginTop:o.scale0,marginRight:o.scale0,marginBottom:o.scale0,marginLeft:o.scale0,outline:"none",verticalAlign:"middle",width:o.scale700,flexShrink:0,transitionDuration:r.timing200,transitionTimingFunction:r.easeOutCurve}}));w.displayName="RadioMarkOuter",w.displayName="RadioMarkOuter";var O=(0,a.I4)("div",(function(e){var t=e.$theme.typography;return l(l({verticalAlign:"middle"},function(e){var t,r=e.$labelPlacement,o=void 0===r?"":r,n=e.$theme;switch(o){case"top":t="Bottom";break;case"bottom":t="Top";break;case"left":t="rtl"===n.direction?"Left":"Right";break;default:t="rtl"===n.direction?"Right":"Left"}var i=n.sizing.scale300;return c({},"padding".concat(t),i)}(e)),{},{color:m(e)},t.LabelMedium)}));O.displayName="Label",O.displayName="Label";var R=(0,a.I4)("input",{width:0,height:0,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,clip:"rect(0 0 0 0)",position:"absolute"});R.displayName="Input",R.displayName="Input";var k=(0,a.I4)("div",(function(e){var t,r=e.$theme,o=e.$align,n="horizontal"===o,i="rtl"===r.direction?"Right":"Left",a="rtl"===r.direction?"Left":"Right";return l(l({},r.typography.ParagraphSmall),{},(c(t={color:r.colors.contentSecondary,cursor:"auto"},"margin".concat(i),"horizontal"===o?null:r.sizing.scale900),c(t,"margin".concat(a),n?r.sizing.scale200:null),c(t,"maxWidth","240px"),t))}));k.displayName="Description",k.displayName="Description";var F=r(56498);function M(e){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M(e)}function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},S.apply(this,arguments)}function j(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var o,n,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(o=r.next()).done)&&(i.push(o.value),!t||i.length!==t);a=!0);}catch(l){s=!0,n=l}finally{try{a||null==r.return||r.return()}finally{if(s)throw n}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return $(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function P(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function C(e,t){return C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},C(e,t)}function I(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=L(e);if(t){var n=L(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return function(e,t){if(t&&("object"===M(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return E(e)}(this,r)}}function E(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L(e){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},L(e)}function x(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&C(e,t)}(s,e);var t,r,n,a=I(s);function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return x(E(e=a.call.apply(a,[this].concat(r))),"state",{isFocusVisible:!1,focusedRadioIndex:-1}),x(E(e),"handleFocus",(function(t,r){(0,F.pP)(t)&&e.setState({isFocusVisible:!0}),e.setState({focusedRadioIndex:r}),e.props.onFocus&&e.props.onFocus(t)})),x(E(e),"handleBlur",(function(t,r){!1!==e.state.isFocusVisible&&e.setState({isFocusVisible:!1}),e.setState({focusedRadioIndex:-1}),e.props.onBlur&&e.props.onBlur(t)})),e}return t=s,(r=[{key:"render",value:function(){var e=this,t=this.props.overrides,r=void 0===t?{}:t,n=j((0,i._O)(r.RadioGroupRoot,g),2),a=n[0],s=n[1];return o.createElement(a,S({id:this.props.id,role:"radiogroup","aria-describedby":this.props["aria-describedby"],"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props.error||null,"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],$align:this.props.align,$disabled:this.props.disabled,$error:this.props.error,$required:this.props.required},s),o.Children.map(this.props.children,(function(t,r){if(!o.isValidElement(t))return null;var n=e.props.value===t.props.value;return o.cloneElement(t,{align:e.props.align,autoFocus:e.props.autoFocus,checked:n,disabled:e.props.disabled||t.props.disabled,error:e.props.error,isFocused:e.state.focusedRadioIndex===r,isFocusVisible:e.state.isFocusVisible,tabIndex:0===r&&!e.props.value||n?"0":"-1",labelPlacement:e.props.labelPlacement,name:e.props.name,onBlur:function(t){return e.handleBlur(t,r)},onFocus:function(t){return e.handleFocus(t,r)},onChange:e.props.onChange,onMouseEnter:e.props.onMouseEnter,onMouseLeave:e.props.onMouseLeave})})))}}])&&P(t.prototype,r),n&&P(t,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.Component);x(_,"defaultProps",{name:"",value:"",disabled:!1,autoFocus:!1,labelPlacement:"right",align:"vertical",error:!1,required:!1,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onFocus:function(){},onBlur:function(){},overrides:{}});const T=_;var A="vertical",D="horizontal";function B(e){return B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B(e)}function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},z.apply(this,arguments)}function V(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var o,n,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(o=r.next()).done)&&(i.push(o.value),!t||i.length!==t);a=!0);}catch(l){s=!0,n=l}finally{try{a||null==r.return||r.return()}finally{if(s)throw n}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return H(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return H(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function N(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function W(e,t){return W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},W(e,t)}function U(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=G(e);if(t){var n=G(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return function(e,t){if(t&&("object"===B(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return q(e)}(this,r)}}function q(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function G(e){return G=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},G(e)}function X(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var J=function(e){return e.stopPropagation()},K=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&W(e,t)}(s,e);var t,r,n,a=U(s);function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return X(q(e=a.call.apply(a,[this].concat(r))),"state",{isActive:!1,isHovered:!1}),X(q(e),"onMouseEnter",(function(t){e.setState({isHovered:!0}),e.props.onMouseEnter&&e.props.onMouseEnter(t)})),X(q(e),"onMouseLeave",(function(t){e.setState({isHovered:!1}),e.props.onMouseLeave&&e.props.onMouseLeave(t)})),X(q(e),"onMouseDown",(function(t){e.setState({isActive:!0}),e.props.onMouseDown&&e.props.onMouseDown(t)})),X(q(e),"onMouseUp",(function(t){e.setState({isActive:!1}),e.props.onMouseUp&&e.props.onMouseUp(t)})),e}return t=s,(r=[{key:"componentDidMount",value:function(){var e;this.props.autoFocus&&null!==(e=this.props.inputRef)&&void 0!==e&&e.current&&this.props.inputRef.current.focus()}},{key:"render",value:function(){var e,t=this.props.overrides,r=void 0===t?{}:t,n=V((0,i._O)(r.Root,v),2),a=n[0],s=n[1],l=V((0,i._O)(r.Label,O),2),c=l[0],u=l[1],p=V((0,i._O)(r.Input,R),2),d=p[0],f=p[1],h=V((0,i._O)(r.Description,k),2),b=h[0],m=h[1],g=V((0,i._O)(r.RadioMarkInner,y),2),F=g[0],M=g[1],S=V((0,i._O)(r.RadioMarkOuter,w),2),j=S[0],$=S[1],P={$align:this.props.align,$checked:this.props.checked,$disabled:this.props.disabled,$hasDescription:!!this.props.description,$isActive:this.state.isActive,$error:this.props.error,$isFocused:this.props.isFocused,$isFocusVisible:this.props.isFocused&&this.props.isFocusVisible,$isHovered:this.state.isHovered,$labelPlacement:this.props.labelPlacement,$required:this.props.required,$value:this.props.value},C=o.createElement(c,z({},P,u),this.props.containsInteractiveElement?o.createElement("div",{onClick:function(e){return e.preventDefault()}},this.props.children):this.props.children);return o.createElement(o.Fragment,null,o.createElement(a,z({"data-baseweb":"radio",onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},P,s),("top"===(e=this.props.labelPlacement)||"left"===e)&&C,o.createElement(j,z({},P,$),o.createElement(F,z({},P,M))),o.createElement(d,z({"aria-invalid":this.props.error||null,checked:this.props.checked,disabled:this.props.disabled,name:this.props.name,onBlur:this.props.onBlur,onFocus:this.props.onFocus,onClick:J,onChange:this.props.onChange,ref:this.props.inputRef,required:this.props.required,tabIndex:this.props.tabIndex,type:"radio",value:this.props.value},P,f)),function(e){return"bottom"===e||"right"===e}(this.props.labelPlacement)&&C),!!this.props.description&&o.createElement(b,z({},P,m),this.props.description))}}])&&N(t.prototype,r),n&&N(t,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.Component);X(K,"defaultProps",{overrides:{},containsInteractiveElement:!1,checked:!1,disabled:!1,autoFocus:!1,inputRef:o.createRef(),align:"vertical",error:!1,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});const Q=K;var Y=r(70474),Z=r(78286),ee=r(93480),te=r(997),re=r(4629),oe=r(90782);function ne(e){let{disabled:t,horizontal:r,width:i,value:a,onChange:s,options:l,captions:c,label:u,labelVisibility:p,help:d}=e;const[f,h]=(0,o.useState)(null!==a&&void 0!==a?a:null);(0,o.useEffect)((()=>{a!==f&&h(null!==a&&void 0!==a?a:null)}),[a]);const b=(0,o.useCallback)((e=>{const t=parseInt(e.target.value,10);h(t),s(t)}),[s]),m=(0,n.u)(),{colors:g,radii:v}=m,y={width:i},w=c.length>0,O=l.length>0,R=O?l:["No options to select."],k=t||!O;return(0,oe.jsxs)("div",{className:"stRadio","data-testid":"stRadio",style:y,children:[(0,oe.jsx)(Y.L,{label:u,disabled:k,labelVisibility:p,children:d&&(0,oe.jsx)(Z.Cl,{children:(0,oe.jsx)(ee.A,{content:d,placement:te.W.TOP_RIGHT})})}),(0,oe.jsx)(T,{onChange:b,value:null!==f?f.toString():void 0,disabled:k,align:r?D:A,"aria-label":u,"data-testid":"stRadioGroup",overrides:{RadioGroupRoot:{style:{gap:w?m.spacing.sm:m.spacing.none,minHeight:m.sizes.minElementHeight}}},children:R.map(((e,t)=>{return(0,oe.jsxs)(Q,{value:t.toString(),overrides:{Root:{style:e=>{let{$isFocusVisible:t}=e;return{marginBottom:m.spacing.none,marginTop:m.spacing.none,marginRight:w?m.spacing.sm:m.spacing.lg,paddingLeft:m.spacing.none,alignItems:"start",paddingRight:m.spacing.threeXS,backgroundColor:t?g.darkenedBgMix25:"",borderTopLeftRadius:v.md,borderTopRightRadius:v.md,borderBottomLeftRadius:v.md,borderBottomRightRadius:v.md}}},RadioMarkOuter:{style:e=>{let{$checked:t}=e;return{width:m.sizes.checkbox,height:m.sizes.checkbox,marginTop:"0.35rem",marginRight:m.spacing.none,marginLeft:m.spacing.none,backgroundColor:t&&!k?g.primary:g.fadedText40}}},RadioMarkInner:{style:e=>{let{$checked:t}=e;return{height:t?"37.5%":`calc(${m.sizes.checkbox} - ${m.spacing.threeXS})`,width:t?"37.5%":`calc(${m.sizes.checkbox} - ${m.spacing.threeXS})`}}},Label:{style:{color:k?g.fadedText40:g.bodyText,position:"relative",top:m.spacing.px}}},children:[(0,oe.jsx)(re.Ay,{source:e,allowHTML:!1,isLabel:!0,largerLabel:!0}),w&&(0,oe.jsx)(re.Ay,{source:(o=c[t],""==o&&r&&w?"&nbsp;":o),allowHTML:!1,isCaption:!0,isLabel:!0})]},t);var o}))})]})}const ie=(0,o.memo)(ne);var ae=r(3101),se=r(25571);function le(e){let{disabled:t,element:r,widgetMgr:n,width:i,fragmentId:a}=e;const[s,l]=(0,ae.t)({getStateFromWidgetMgr:ce,getDefaultStateFromProto:ue,getCurrStateFromProto:pe,updateWidgetMgrState:de,element:r,widgetMgr:n,fragmentId:a}),c=(0,o.useCallback)((e=>{l({value:e,fromUi:!0})}),[l]),{horizontal:u,options:p,captions:d,label:f,labelVisibility:h,help:b}=r;return(0,oe.jsx)(ie,{label:f,onChange:c,options:p,captions:d,width:i,disabled:t,horizontal:u,labelVisibility:(0,se.yv)(null===h||void 0===h?void 0:h.value),value:null!==s&&void 0!==s?s:null,help:b})}function ce(e,t){return e.getIntValue(t)}function ue(e){var t;return null!==(t=e.default)&&void 0!==t?t:null}function pe(e){var t;return null!==(t=e.value)&&void 0!==t?t:null}function de(e,t,r,o){var n;t.setIntValue(e,null!==(n=r.value)&&void 0!==n?n:null,{fromUi:r.fromUi},o)}const fe=(0,o.memo)(le)},3101:(e,t,r)=>{r.d(t,{_:()=>a,t:()=>s});var o=r(58878),n=r(34752),i=r(25571);function a(e){let{getStateFromWidgetMgr:t,getDefaultState:r,updateWidgetMgrState:a,element:s,widgetMgr:l,fragmentId:c,onFormCleared:u}=e;const[p,d]=(0,o.useState)((()=>{var e;return null!==(e=t(l,s))&&void 0!==e?e:r(l,s)})),[f,h]=(0,o.useState)({value:p,fromUi:!1});(0,o.useEffect)((()=>{(0,i.hX)(f)||(h(null),d(f.value),a(s,l,f,c))}),[f,a,s,l,c]);const b=(0,o.useCallback)((()=>{h({value:r(l,s),fromUi:!0}),null===u||void 0===u||u()}),[h,s,r,l,u]);return(0,n.X)({widgetMgr:l,element:s,onFormCleared:b}),[p,h]}function s(e){let{getStateFromWidgetMgr:t,getDefaultStateFromProto:r,getCurrStateFromProto:n,updateWidgetMgrState:i,element:s,widgetMgr:l,fragmentId:c,onFormCleared:u}=e;const p=(0,o.useCallback)(((e,t)=>r(t)),[r]),[d,f]=a({getStateFromWidgetMgr:t,getDefaultState:p,updateWidgetMgrState:i,element:s,widgetMgr:l,fragmentId:c,onFormCleared:u});return(0,o.useEffect)((()=>{s.setValue&&(s.setValue=!1,f({value:n(s),fromUi:!1}))}),[s,n,f]),[d,f]}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[7809],{97809:(e,t,r)=>{r.r(t),r.d(t,{default:()=>C});var s=r(58878),n=r(9887),i=r.n(n),o=r(58144),a=r(4629),l=r(84152),c=r(89653),d=r(74829),h=r(37888);const p=(0,c.A)(h.x,{shouldForwardProp:d.A,target:"e1se5lgy2"})((e=>{let{theme:t,usingCustomTheme:r}=e;return{fontSize:t.fontSizes.sm,width:t.sizes.spinnerSize,height:t.sizes.spinnerSize,borderWidth:t.sizes.spinnerThickness,radius:t.radii.md,justifyContents:"center",padding:t.spacing.none,margin:t.spacing.none,borderColor:t.colors.borderColor,borderTopColor:r?t.colors.primary:t.colors.blue70,flexGrow:0,flexShrink:0}}),""),g=(0,c.A)("div",{target:"e1se5lgy1"})((e=>{let{theme:t,width:r,cache:s}=e;return{width:r,...s?{paddingBottom:t.spacing.lg,background:`linear-gradient(to bottom, ${t.colors.bgColor} 0%, ${t.colors.bgColor} 80%, transparent 100%)`}:null}}),""),u=(0,c.A)("div",{target:"e1se5lgy0"})((e=>{let{theme:t}=e;return{display:"flex",gap:t.spacing.sm,alignItems:"center",width:"100%"}}),"");var m=r(90782);const C=function(e){let{width:t,element:r}=e;const{activeTheme:n}=s.useContext(l.n),c=!(0,o.tl)(n),{cache:d}=r;return(0,m.jsx)(g,{className:i()({stSpinner:!0,stCacheSpinner:d}),"data-testid":"stSpinner",width:t,cache:d,children:(0,m.jsxs)(u,{children:[(0,m.jsx)(p,{usingCustomTheme:c}),(0,m.jsx)(a.Ay,{source:r.text,allowHTML:!1})]})})}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[8237],{78237:(e,l,o)=>{o.r(l),o.d(l,{default:()=>w});var t=o(58878),r=o(8151),i=o(43978),c=o(29669),n=o(55516),a=o(25571),s=o(34752),d=o(37638),p=o.n(d),u=o(16795),f=o(58144),h=o(67253),m=o(84996);function g(e,l,o){return e=function(e,l){return(e=(e=(e=(e=(e=(e=(e=(e=e.replaceAll("#000032",(0,u.$E)(l))).replaceAll("#000033",(0,u.pf)(l))).replaceAll("#000034",(0,u.h7)(l))).replaceAll("#000035",(0,u.V9)(l))).replaceAll("#000036",(0,u.lH)(l))).replaceAll("#000037",(0,u.ZA)(l))).replaceAll("#000038",l.colors.bgColor)).replaceAll("#000039",l.colors.fadedText05)).replaceAll("#000040",l.colors.bgMix)}(e,l),e=function(e,l,o){const t="#000001",r="#000002",i="#000003",c="#000004",n="#000005",a="#000006",s="#000007",d="#000008",p="#000009",f="#000010";if("streamlit"===o){const o=(0,u.c6)(l);e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replaceAll(t,o[0])).replaceAll(r,o[1])).replaceAll(i,o[2])).replaceAll(c,o[3])).replaceAll(n,o[4])).replaceAll(a,o[5])).replaceAll(s,o[6])).replaceAll(d,o[7])).replaceAll(p,o[8])).replaceAll(f,o[9])}else e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replaceAll(t,"#636efa")).replaceAll(r,"#EF553B")).replaceAll(i,"#00cc96")).replaceAll(c,"#ab63fa")).replaceAll(n,"#FFA15A")).replaceAll(a,"#19d3f3")).replaceAll(s,"#FF6692")).replaceAll(d,"#B6E880")).replaceAll(p,"#FF97FF")).replaceAll(f,"#FECB52");return e}(e,l,o),e=function(e,l,o){const t="#000011",r="#000012",i="#000013",c="#000014",n="#000015",a="#000016",s="#000017",d="#000018",p="#000019",f="#000020";if("streamlit"===o){const o=(0,u.rp)(l);e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replaceAll(t,o[0])).replaceAll(r,o[1])).replaceAll(i,o[2])).replaceAll(c,o[3])).replaceAll(n,o[4])).replaceAll(a,o[5])).replaceAll(s,o[6])).replaceAll(d,o[7])).replaceAll(p,o[8])).replaceAll(f,o[9])}else e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replaceAll(t,"#0d0887")).replaceAll(r,"#46039f")).replaceAll(i,"#7201a8")).replaceAll(c,"#9c179e")).replaceAll(n,"#bd3786")).replaceAll(a,"#d8576b")).replaceAll(s,"#ed7953")).replaceAll(d,"#fb9f3a")).replaceAll(p,"#fdca26")).replaceAll(f,"#f0f921");return e}(e,l,o),e=function(e,l,o){const t="#000021",r="#000022",i="#000023",c="#000024",n="#000025",a="#000026",s="#000027",d="#000028",p="#000029",f="#000030",h="#000031";if("streamlit"===o){const o=(0,u.vk)(l);e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replaceAll(t,o[0])).replaceAll(r,o[1])).replaceAll(i,o[2])).replaceAll(c,o[3])).replaceAll(n,o[4])).replaceAll(a,o[5])).replaceAll(s,o[6])).replaceAll(d,o[7])).replaceAll(p,o[8])).replaceAll(f,o[9])).replaceAll(h,o[10])}else e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replaceAll(t,"#8e0152")).replaceAll(r,"#c51b7d")).replaceAll(i,"#de77ae")).replaceAll(c,"#f1b6da")).replaceAll(n,"#fde0ef")).replaceAll(a,"#f7f7f7")).replaceAll(s,"#e6f5d0")).replaceAll(d,"#b8e186")).replaceAll(p,"#7fbc41")).replaceAll(f,"#4d9221")).replaceAll(h,"#276419");return e}(e,l,o),e}function y(e,l){try{!function(e,l){const{genericFonts:o,colors:t,fontSizes:r}=l,i={font:{color:(0,u.lH)(l),family:o.bodyFont,size:r.twoSmPx},title:{color:t.headingColor,subtitleColor:t.bodyText,font:{family:o.headingFont,size:(0,f.BY)(r.md),color:t.headingColor},pad:{l:(0,f.BY)(l.spacing.twoXS)},xanchor:"left",x:0},legend:{title:{font:{size:r.twoSmPx,color:(0,u.lH)(l)},side:"top"},valign:"top",bordercolor:t.transparent,borderwidth:0,font:{size:r.twoSmPx,color:(0,u.ZA)(l)}},paper_bgcolor:t.bgColor,plot_bgcolor:t.bgColor,yaxis:{ticklabelposition:"outside",zerolinecolor:(0,u.V9)(l),title:{font:{color:(0,u.lH)(l),size:r.smPx},standoff:(0,f.BY)(l.spacing.twoXL)},tickcolor:(0,u.V9)(l),tickfont:{color:(0,u.lH)(l),size:r.twoSmPx},gridcolor:(0,u.V9)(l),minor:{gridcolor:(0,u.V9)(l)},automargin:!0},xaxis:{zerolinecolor:(0,u.V9)(l),gridcolor:(0,u.V9)(l),showgrid:!1,tickfont:{color:(0,u.lH)(l),size:r.twoSmPx},tickcolor:(0,u.V9)(l),title:{font:{color:(0,u.lH)(l),size:r.smPx},standoff:(0,f.BY)(l.spacing.xl)},minor:{gridcolor:(0,u.V9)(l)},zeroline:!1,automargin:!0,rangeselector:{bgcolor:t.bgColor,bordercolor:(0,u.V9)(l),borderwidth:1,x:0}},margin:{pad:(0,f.BY)(l.spacing.sm),r:0,l:0},hoverlabel:{bgcolor:t.bgColor,bordercolor:t.borderColor,font:{color:(0,u.lH)(l),family:o.bodyFont,size:r.twoSmPx}},coloraxis:{colorbar:{thickness:16,xpad:(0,f.BY)(l.spacing.twoXL),ticklabelposition:"outside",outlinecolor:t.transparent,outlinewidth:8,len:.75,y:.5745,title:{font:{color:(0,u.lH)(l),size:r.smPx}},tickfont:{color:(0,u.lH)(l),size:r.twoSmPx}}},ternary:{gridcolor:(0,u.lH)(l),bgcolor:t.bgColor,title:{font:{family:o.bodyFont,size:r.smPx}},color:(0,u.lH)(l),aaxis:{gridcolor:(0,u.lH)(l),linecolor:(0,u.lH)(l),tickfont:{family:o.bodyFont,size:r.twoSmPx}},baxis:{linecolor:(0,u.lH)(l),gridcolor:(0,u.lH)(l),tickfont:{family:o.bodyFont,size:r.twoSmPx}},caxis:{linecolor:(0,u.lH)(l),gridcolor:(0,u.lH)(l),tickfont:{family:o.bodyFont,size:r.twoSmPx}}}};p()(e,i)}(e.layout.template.layout,l)}catch(o){const e=(0,h.$)(o);(0,m.vV)(e)}"title"in e.layout&&(e.layout.title=p()(e.layout.title,{text:`<b>${e.layout.title.text}</b>`}))}var A=o(90782);const x={width:600,height:470,name:"fullscreen-expand",path:"M32 32C14.3 32 0 46.3 0 64v96c0 17.7 14.3 32 32 32s32-14.3 32-32V96h64c17.7 0 32-14.3 32-32s-14.3-32-32-32H32zM64 352c0-17.7-14.3-32-32-32s-32 14.3-32 32v96c0 17.7 14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H64V352zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32h64v64c0 17.7 14.3 32 32 32s32-14.3 32-32V64c0-17.7-14.3-32-32-32H320zM448 352c0-17.7-14.3-32-32-32s-32 14.3-32 32v64H320c-17.7 0-32 14.3-32 32s14.3 32 32 32h96c17.7 0 32-14.3 32-32V352z"},b={width:600,height:470,name:"fullscreen-collapse",path:"M160 64c0-17.7-14.3-32-32-32s-32 14.3-32 32v64H32c-17.7 0-32 14.3-32 32s14.3 32 32 32h96c17.7 0 32-14.3 32-32V64zM32 320c-17.7 0-32 14.3-32 32s14.3 32 32 32H96v64c0 17.7 14.3 32 32 32s32-14.3 32-32V352c0-17.7-14.3-32-32-32H32zM352 64c0-17.7-14.3-32-32-32s-32 14.3-32 32v96c0 17.7 14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H352V64zM320 320c-17.7 0-32 14.3-32 32v96c0 17.7 14.3 32 32 32s32-14.3 32-32V384h64c17.7 0 32-14.3 32-32s-14.3-32-32-32H320z"};function v(e,l,o){const t=JSON.parse(g(JSON.stringify(e),o,l));return"streamlit"===l?y(t,o):t.layout=function(e,l){const{colors:o,genericFonts:t}=l,r={font:{color:o.bodyText,family:t.bodyFont},paper_bgcolor:o.bgColor,plot_bgcolor:o.secondaryBg};return{...e,font:{...r.font,...e.font},paper_bgcolor:e.paper_bgcolor||r.paper_bgcolor,plot_bgcolor:e.plot_bgcolor||r.plot_bgcolor}}(t.layout,o),t}function S(e,l,o,t){if(!e)return;const r={selection:{points:[],point_indices:[],box:[],lasso:[]}},i=new Set,n=[],s=[],d=[],{selections:p,points:u}=e;if(u&&u.forEach((function(e){d.push({...e,legendgroup:e.data.legendgroup||void 0,data:void 0,fullData:void 0}),(0,a.se)(e.pointIndex)&&i.add(e.pointIndex),(0,a.se)(e.pointIndices)&&e.pointIndices.length>0&&e.pointIndices.forEach((e=>i.add(e)))})),p&&p.forEach((e=>{if("rect"===e.type){const l=function(e){return"x0"in e&&"x1"in e&&"y0"in e&&"y1"in e?{x:[e.x0,e.x1],y:[e.y0,e.y1]}:{x:[],y:[]}}(e),o={xref:e.xref,yref:e.yref,x:l.x,y:l.y};n.push(o)}if("path"===e.type){const l=function(e){if(""===e)return{x:[],y:[]};const l=e.replace("M","").replace("Z","").split("L"),o=[],t=[];return l.forEach((e=>{const[l,r]=e.split(",").map(Number);o.push(l),t.push(r)})),{x:o,y:t}}(e.path),o={xref:e.xref,yref:e.yref,x:l.x,y:l.y};s.push(o)}})),r.selection.point_indices=Array.from(i),r.selection.points=d.map((e=>(0,a.wJ)(e))),r.selection.box=n,r.selection.lasso=s,r.selection.box.length>0&&!o.selectionMode.includes(c.P_.SelectionMode.BOX))return;if(r.selection.lasso.length>0&&!o.selectionMode.includes(c.P_.SelectionMode.LASSO))return;const f=l.getStringValue(o),h=JSON.stringify(r);f!==h&&l.setStringValue(o,h,{fromUi:!0},t)}const w=(0,n.A)((function(e){var l,o,n,a,d;let{element:p,width:u,height:f,widgetMgr:h,disabled:m,fragmentId:g,isFullScreen:y,expand:w,collapse:F,disableFullscreenMode:M}=e;const C=(0,r.u)(),z=(0,t.useMemo)((()=>p.spec?JSON.parse(p.spec):{layout:{},data:[],frames:void 0}),[p.id,p.spec]),[H,k]=(0,t.useState)((()=>{const e=h.getElementState(p.id,"figure");return e||v(z,p.theme,C)})),V=p.selectionMode.length>0&&!m,_=V&&p.selectionMode.includes(c.P_.SelectionMode.LASSO),P=V&&p.selectionMode.includes(c.P_.SelectionMode.BOX),B=V&&p.selectionMode.includes(c.P_.SelectionMode.POINTS),E=(0,t.useMemo)((()=>{if(!p.config)return{};const e=JSON.parse(p.config);var l;M||(e.modeBarButtonsToAdd=[{name:y?"Close fullscreen":"Fullscreen",icon:y?b:x,click:()=>{y&&F?F():w&&w()}},...null!==(l=e.modeBarButtonsToAdd)&&void 0!==l?l:[]]);if(!e.modeBarButtonsToRemove){e.displaylogo=!1;const l=["sendDataToCloud"];V?(_||l.push("lasso2d"),P||l.push("select2d")):l.push("lasso2d","select2d"),e.modeBarButtonsToRemove=l}return e}),[p.id,p.config,y,M,V,_,P,F,w]);(0,t.useEffect)((()=>{k((e=>v(e,p.theme,C)))}),[p.id,C,p.theme]),(0,t.useEffect)((()=>{let e=z.layout.clickmode,l=z.layout.hovermode,o=z.layout.dragmode;m?(e="none",o="pan"):V&&(z.layout.clickmode||(e=B?"event+select":"none"),z.layout.hovermode||(l="closest"),z.layout.dragmode||(o=B?"pan":P?"select":_?"lasso":"pan")),k((t=>t.layout.clickmode===e&&t.layout.hovermode===l&&t.layout.dragmode===o?t:{...t,layout:{...t.layout,clickmode:e,hovermode:l,dragmode:o}}))}),[p.id,V,B,P,_,m]);let I=-1===u?null===(l=H.layout)||void 0===l?void 0:l.width:Math.max(p.useContainerWidth?u:Math.min(null!==(o=z.layout.width)&&void 0!==o?o:u,u),150),L=z.layout.height;y&&(I=u,L=f),H.layout.height===L&&H.layout.width===I||k((e=>({...e,layout:{...e.layout,height:L,width:I}})));const O=(0,t.useCallback)((e=>{S(e,h,p,g)}),[p.id,h,g]),N=(0,t.useCallback)((function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];!function(e,l,o){const t=e.getStringValue(l),r=JSON.stringify({selection:{points:[],point_indices:[],box:[],lasso:[]}});t!==r&&e.setStringValue(l,r,{fromUi:!0},o)}(h,p,g),e&&setTimeout((()=>{k((e=>({...e,data:e.data.map((e=>({...e,selectedpoints:null}))),layout:{...e.layout,selections:[]}})))}),50)}),[p.id,h,g]);return(0,t.useEffect)((()=>{if(!p.formId||!V)return;const e=new s.o;return e.manageFormClearListener(h,p.formId,N),()=>{e.disconnect()}}),[p.formId,h,V,N]),(0,t.useEffect)((()=>{var e,l,o;if(!V)return;let t;t="select"===(null===(e=H.layout)||void 0===e?void 0:e.dragmode)||"lasso"===(null===(l=H.layout)||void 0===l?void 0:l.dragmode)?"event":B?"event+select":"none",(null===(o=H.layout)||void 0===o?void 0:o.clickmode)!==t&&k((e=>({...e,layout:{...e.layout,clickmode:t}})))}),[null===(n=H.layout)||void 0===n?void 0:n.dragmode]),(0,A.jsx)("div",{className:"stPlotlyChart","data-testid":"stPlotlyChart",children:(0,A.jsx)(i.A,{data:H.data,layout:H.layout,config:E,frames:null!==(a=H.frames)&&void 0!==a?a:void 0,style:{visibility:void 0===(null===(d=H.layout)||void 0===d?void 0:d.width)?"hidden":void 0},onSelected:V?O:()=>{},onDoubleClick:V?()=>N():void 0,onDeselect:V?()=>{N(!1)}:void 0,onInitialized:e=>{h.setElementState(p.id,"figure",e)},onUpdate:e=>{h.setElementState(p.id,"figure",e),k(e)}},y?"fullscreen":"original")})}),!0)},55516:(e,l,o)=>{o.d(l,{A:()=>u});o(58878);var t=o(53124),r=o.n(t),i=o(41514),c=o(67214),n=o(64611),a=o(98226),s=o(4883),d=o(90782);const p=e=>{let{children:l,width:o,height:t,disableFullscreenMode:r}=e;const{expanded:p,fullHeight:u,fullWidth:f,zoomIn:h,zoomOut:m}=(0,a.H)();let g=i.u,y=h,A="View fullscreen";return p&&(g=c.Q,y=m,A="Exit fullscreen"),(0,d.jsxs)(s.g,{isExpanded:p,"data-testid":"stFullScreenFrame",children:[!r&&(0,d.jsx)(s.j,{"data-testid":"StyledFullScreenButton",onClick:y,title:A,isExpanded:p,children:(0,d.jsx)(n.A,{content:g})}),l({width:p?f:o,height:p?u:t,expanded:p,expand:h,collapse:m})]})};const u=function(e){let l=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const o=o=>{const{width:t,height:r,disableFullscreenMode:i}=o;return(0,d.jsx)(p,{width:t,height:r,disableFullscreenMode:l||i,children:l=>{let{width:t,height:r,expanded:i,expand:c,collapse:n}=l;return(0,d.jsx)(e,{...o,width:t,height:r,isFullScreen:i,expand:c,collapse:n})}})};return o.displayName=`withFullScreenWrapper(${e.displayName||e.name})`,r()(o,e)}},34752:(e,l,o)=>{o.d(l,{X:()=>c,o:()=>i});var t=o(58878),r=o(25571);class i{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,l,o){(0,r.se)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===l||(this.disconnect(),(0,r._L)(l)&&(this.formClearListener=e.addFormClearedListener(l,o),this.lastWidgetMgr=e,this.lastFormId=l))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}function c(e){let{element:l,widgetMgr:o,onFormCleared:i}=e;(0,t.useEffect)((()=>{if(!(0,r._L)(l.formId))return;const e=o.addFormClearedListener(l.formId,i);return()=>{e.disconnect()}}),[l,o,i])}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[8460],{78460:(e,t,i)=>{i.r(t),i.d(t,{default:()=>P});var o=i(58878),n=i(60667),a=i(8151),s=i(72037),r=i(14716),l=i(28430),d=i(71034),c=i.n(d),h=i(25571),g=i(84996),m=i(55516),p=i(67253),u=i(34752),f=i(85729);const b={DATAFRAME_INDEX:"(index)"},v=new Set([f.sj.DatetimeIndex,f.sj.Float64Index,f.sj.Int64Index,f.sj.RangeIndex,f.sj.UInt64Index]);function w(e){var t;if(0===(null===(t=e.datasets)||void 0===t?void 0:t.length))return null;const i={};return e.datasets.forEach((e=>{if(!e)return;const t=e.hasName?e.name:null;i[t]=e.data})),i}function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e.isEmpty())return[];const i=[],{dataRows:o,dataColumns:n}=e.dimensions,a=f.D0.getTypeName(e.types.index[0]),s=v.has(a);for(let r=t;r<o;r++){const t={};if(s){const i=e.getIndexValue(r,0);t[b.DATAFRAME_INDEX]="bigint"===typeof i?Number(i):i}for(let i=0;i<n;i++){const o=e.getDataValue(r,i),n=e.types.data[i],a=f.D0.getTypeName(n);if("datetimetz"!==a&&(o instanceof Date||Number.isFinite(o))&&(a.startsWith("datetime")||"date"===a)){const n=60*new Date(o).getTimezoneOffset()*1e3;t[e.columns[0][i]]=o.valueOf()+n}else t[e.columns[0][i]]="bigint"===typeof o?Number(o):o}i.push(t)}return i}var x=i(37638),S=i.n(x),F=i(42274),C=i.n(F),z=i(16795),W=i(58144);function V(e,t){const i={font:t.genericFonts.bodyFont,background:t.colors.bgColor,fieldTitle:"verbal",autosize:{type:"fit",contains:"padding"},title:{align:"left",anchor:"start",color:t.colors.headingColor,titleFontStyle:"normal",fontWeight:t.fontWeights.bold,fontSize:t.fontSizes.mdPx,orient:"top",offset:26},header:{titleFontWeight:t.fontWeights.normal,titleFontSize:t.fontSizes.mdPx,titleColor:(0,z.lH)(t),titleFontStyle:"normal",labelFontSize:t.fontSizes.twoSmPx,labelFontWeight:t.fontWeights.normal,labelColor:(0,z.lH)(t),labelFontStyle:"normal"},axis:{labelFontSize:t.fontSizes.twoSmPx,labelFontWeight:t.fontWeights.normal,labelColor:(0,z.lH)(t),labelFontStyle:"normal",titleFontWeight:t.fontWeights.normal,titleFontSize:t.fontSizes.smPx,titleColor:(0,z.lH)(t),titleFontStyle:"normal",ticks:!1,gridColor:(0,z.V9)(t),domain:!1,domainWidth:1,domainColor:(0,z.V9)(t),labelFlush:!0,labelFlushOffset:1,labelBound:!1,labelLimit:100,titlePadding:(0,W.BY)(t.spacing.lg),labelPadding:(0,W.BY)(t.spacing.lg),labelSeparation:(0,W.BY)(t.spacing.twoXS),labelOverlap:!0},legend:{labelFontSize:t.fontSizes.smPx,labelFontWeight:t.fontWeights.normal,labelColor:(0,z.lH)(t),titleFontSize:t.fontSizes.smPx,titleFontWeight:t.fontWeights.normal,titleFontStyle:"normal",titleColor:(0,z.lH)(t),titlePadding:5,labelPadding:(0,W.BY)(t.spacing.lg),columnPadding:(0,W.BY)(t.spacing.sm),rowPadding:(0,W.BY)(t.spacing.twoXS),padding:7,symbolStrokeWidth:4},range:{category:(0,z.c6)(t),diverging:(0,z.vk)(t),ramp:(0,z.rp)(t),heatmap:(0,z.rp)(t)},view:{columns:1,strokeWidth:0,stroke:"transparent",continuousHeight:350,continuousWidth:400},concat:{columns:1},facet:{columns:1},mark:{tooltip:!0,color:(0,z.h7)(t)},bar:{binSpacing:(0,W.BY)(t.spacing.twoXS),discreteBandSize:{band:.85}},axisDiscrete:{grid:!1},axisXPoint:{grid:!1},axisTemporal:{grid:!1},axisXBand:{grid:!1}};return e?C()({},i,e,((e,t)=>Array.isArray(t)?t:void 0)):i}var k=i(89653),D=i(32735);const T=e=>({"#vg-tooltip-element":{visibility:"hidden",position:"fixed",fontFamily:e.genericFonts.bodyFont,color:e.colors.bodyText,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,backgroundColor:(0,D.No)(e.colors.bgColor,.05),fontSize:e.fontSizes.twoSm,boxShadow:"rgb(0 0 0 / 16%) 0px 1px 4px",maxWidth:e.sizes.maxChartTooltipWidth,padding:`${e.spacing.xs} ${e.spacing.md}`,borderRadius:e.radii.default,zIndex:e.zIndices.vegaTooltips,"&.visible":{visibility:"visible"},h2:{marginTop:e.spacing.none,marginBottom:e.spacing.sm,fontSize:e.fontSizes.sm},td:{border:"none"},table:{borderSpacing:0,tr:{border:"none",td:{overflow:"hidden",textOverflow:"ellipsis",paddingTop:e.spacing.threeXS,paddingBottom:e.spacing.threeXS},"td.key":{maxWidth:`calc((${e.sizes.maxChartTooltipWidth} - 2 * ${e.spacing.md}) * 0.4)`,textAlign:"right",color:e.colors.fadedText60,whiteSpace:"nowrap",paddingRight:e.spacing.twoXS},"td.value":{maxWidth:`calc((${e.sizes.maxChartTooltipWidth} - 2 * ${e.spacing.md}) * 0.6)`,textAlign:"left",display:"-webkit-box",WebkitLineClamp:"5",WebkitBoxOrient:"vertical",lineClamp:"5",wordWrap:"break-word"}}}}}),I=(0,k.A)("div",{target:"egd2k5h0"})((e=>{let{theme:t,useContainerWidth:i,isFullScreen:o}=e;return{width:i||o?"100%":"auto",height:o?"100%":"auto","&.vega-embed":{position:"relative",display:"inline-block",boxSizing:"border-box","details:not([open]) > :not(summary)":{display:"none !important"},"details[open] summary":{opacity:.7},"&:hover summary, .vega-embed:focus summary":{background:"transparent"},"&:hover summary, &:focus-within summary":{opacity:"1 !important",transition:"opacity 0.2s ease"},"&.has-actions":{paddingRight:0},".vega-actions":{position:"absolute",display:"flex",flexDirection:"column",paddingBottom:t.spacing.sm,paddingTop:t.spacing.sm,zIndex:t.zIndices.popupMenu,top:`calc(${t.iconSizes.md} + 2 * ${t.spacing.xs} + ${t.spacing.xs})`,right:0,backgroundColor:t.colors.bgColor,boxShadow:"rgb(0 0 0 / 16%) 0px 4px 16px",border:`${t.sizes.borderWidth} solid ${t.colors.fadedText10}`,animationDuration:"0.15s",animationName:"scale-in",animationTimingFunction:"cubic-bezier(0.2, 0, 0.13, 1.5)",textAlign:"left",borderRadius:t.radii.default,a:{fontFamily:t.genericFonts.bodyFont,fontWeight:t.fontWeights.normal,fontSize:t.fontSizes.md,margin:0,padding:`${t.spacing.twoXS} ${t.spacing.twoXL}`,color:t.colors.bodyText,whiteSpace:"nowrap",textDecoration:"none"},"a:hover, a:focus":{backgroundColor:t.colors.secondaryBg,color:t.colors.bodyText},":before":{content:"none"},":after":{content:"none"}},"@keyframes scale-in":{from:{opacity:0,transform:"scale(0.6)"},to:{opacity:1,transform:"scale(1)"}},".chart-wrapper":{"&.fit-x":{width:"100%"},"&.fit-y":{height:"100%"}},summary:{position:"absolute",top:0,right:0,opacity:0,listStyle:"none",padding:t.spacing.xs,height:"auto",zIndex:t.zIndices.menuButton,border:"none",boxShadow:"none",borderRadius:t.radii.default,color:t.colors.fadedText10,backgroundColor:"transparent",transition:"opacity 300ms 150ms,transform 300ms 150ms",cursor:"pointer",lineHeight:0,"&::-webkit-details-marker":{display:"none"},"&:active, &:focus-visible, &:hover":{border:"none",boxShadow:"none",color:t.colors.bodyText,opacity:"1 !important",background:t.colors.darkenedBgMix25},svg:{width:t.iconSizes.md,height:t.iconSizes.md}}}}}),"");var N=i(90782);const M="source";class O extends o.PureComponent{constructor(){super(...arguments),this.vegaView=void 0,this.vegaFinalizer=void 0,this.defaultDataName=M,this.element=null,this.formClearHelper=new u.o,this.state={error:void 0},this.finalizeView=()=>{this.vegaFinalizer&&this.vegaFinalizer(),this.vegaFinalizer=void 0,this.vegaView=void 0},this.generateSpec=()=>{var e,t;const{element:i,theme:o,isFullScreen:n,width:a,height:s}=this.props,r=JSON.parse(i.spec),{useContainerWidth:l}=i;if("streamlit"===i.vegaLiteTheme?r.config=V(r.config,o):"streamlit"===(null===(e=r.usermeta)||void 0===e||null===(t=e.embedOptions)||void 0===t?void 0:t.theme)?(r.config=V(r.config,o),r.usermeta.embedOptions.theme=void 0):r.config=function(e,t){const{colors:i,fontSizes:o,genericFonts:n}=t,a={labelFont:n.bodyFont,titleFont:n.bodyFont,labelFontSize:o.twoSmPx,titleFontSize:o.twoSmPx},s={background:i.bgColor,axis:{labelColor:i.bodyText,titleColor:i.bodyText,gridColor:(0,z.V9)(t),...a},legend:{labelColor:i.bodyText,titleColor:i.bodyText,...a},title:{color:i.bodyText,subtitleColor:i.bodyText,...a},header:{labelColor:i.bodyText,titleColor:i.bodyText,...a},view:{stroke:(0,z.V9)(t),continuousHeight:350,continuousWidth:400},mark:{tooltip:!0}};return e?S()({},s,e):s}(r.config,o),n?(r.width=a,r.height=s,"vconcat"in r&&r.vconcat.forEach((e=>{e.width=a}))):l&&(r.width=a,"vconcat"in r&&r.vconcat.forEach((e=>{e.width=a}))),r.padding||(r.padding={}),(0,h.hX)(r.padding.bottom)&&(r.padding.bottom=20),r.datasets)throw new Error("Datasets should not be passed as part of the spec");return i.selectionMode.length>0&&function(e){"params"in e&&"encoding"in e&&e.params.forEach((t=>{"select"in t&&(["interval","point"].includes(t.select)&&(t.select={type:t.select}),"type"in t.select&&"point"===t.select.type&&!("encodings"in t.select)&&(0,h.hX)(t.select.encodings)&&(t.select.encodings=Object.keys(e.encoding)))}))}(r),r},this.maybeConfigureSelections=()=>{if(void 0===this.vegaView)return;const{widgetMgr:e,element:t}=this.props;if(null===t||void 0===t||!t.id||0===t.selectionMode.length)return;const i=e.getElementState(this.props.element.id,"viewState");if((0,h.se)(i))try{this.vegaView=this.vegaView.setState(i)}catch(n){(0,g.FF)("Failed to restore view state",n)}t.selectionMode.forEach(((i,o)=>{var n;null===(n=this.vegaView)||void 0===n||n.addSignalListener(i,(0,h.sg)(150,((i,o)=>{var n;const a=null===(n=this.vegaView)||void 0===n?void 0:n.getState({data:(e,i)=>t.selectionMode.some((t=>`${t}_store`===e)),recurse:!1});(0,h.se)(a)&&e.setElementState(t.id,"viewState",a);let s=o;"vlPoint"in o&&"or"in o.vlPoint&&(s=o.vlPoint.or);const r=JSON.parse(e.getStringValue(t)||"{}"),l={selection:{...(null===r||void 0===r?void 0:r.selection)||{},[i]:s||{}}};c()(r,l)||e.setStringValue(t,JSON.stringify(l),{fromUi:!0},this.props.fragmentId)})))}));const o=()=>{const i={selection:{}};this.props.element.selectionMode.forEach((e=>{i.selection[e]={}}));const o=e.getStringValue(t),n=o?JSON.parse(o):i;var a;c()(n,i)||(null===(a=this.props.widgetMgr)||void 0===a||a.setStringValue(this.props.element,JSON.stringify(i),{fromUi:!0},this.props.fragmentId))};this.props.element.formId&&this.formClearHelper.manageFormClearListener(this.props.widgetMgr,this.props.element.formId,o)}}async componentDidMount(){try{await this.createView()}catch(e){const t=(0,p.$)(e);this.setState({error:t})}}componentWillUnmount(){this.finalizeView()}async componentDidUpdate(e){const{element:t,theme:i}=e,{element:o,theme:n}=this.props,a=t.spec,{spec:s}=o;if(!this.vegaView||a!==s||i!==n||e.width!==this.props.width||e.height!==this.props.height||e.element.vegaLiteTheme!==this.props.element.vegaLiteTheme||!c()(e.element.selectionMode,this.props.element.selectionMode)){(0,g.OG)("Vega spec changed.");try{await this.createView()}catch(m){const e=(0,p.$)(m);this.setState({error:e})}return}const r=t.data,{data:l}=o;(r||l)&&this.updateData(this.defaultDataName,r,l);const d=w(t)||{},h=w(o)||{};for(const[c,g]of Object.entries(h)){const e=c||this.defaultDataName,t=d[e];this.updateData(e,t,g)}for(const c of Object.keys(d))h.hasOwnProperty(c)||c===this.defaultDataName||this.updateData(c,null,null);this.vegaView.resize().runAsync()}updateData(e,t,i){if(!this.vegaView)throw new Error("Chart has not been drawn yet");if(!i||0===i.data.numRows)try{this.vegaView.remove(e,r.truthy)}finally{return}if(!t||0===t.data.numRows)return void this.vegaView.insert(e,y(i));const{dataRows:o,dataColumns:n}=t.dimensions,{dataRows:a,dataColumns:s}=i.dimensions;!function(e,t,i,o,n,a){if(i!==a)return!1;if(t>=n)return!1;if(0===t)return!1;const s=a-1,r=t-1;return e.getDataValue(0,s)===o.getDataValue(0,s)&&e.getDataValue(r,s)===o.getDataValue(r,s)}(t,o,n,i,a,s)?(this.vegaView.data(e,y(i)),(0,g.OG)(`Had to clear the ${e} dataset before inserting data through Vega view.`)):o<a&&this.vegaView.insert(e,y(i,o))}async createView(){if((0,g.OG)("Creating a new Vega view."),!this.element)throw Error("Element missing.");this.finalizeView();const{element:e}=this.props,t=this.generateSpec(),i={ast:!0,expr:l.P,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,forceActionsMenu:!0},{vgSpec:o,view:n,finalize:a}=await(0,s.Ay)(this.element,t,i);this.vegaView=n,this.maybeConfigureSelections(),this.vegaFinalizer=a;const r=function(e){const t=w(e);if((0,h.hX)(t))return null;const i={};for(const[o,n]of Object.entries(t))i[o]=y(n);return i}(e),d=r?Object.keys(r):[];if(1===d.length){const[e]=d;this.defaultDataName=e}else 0===d.length&&o.data&&(this.defaultDataName=M);const c=function(e){const t=e.data;return t&&0!==t.data.numRows?y(t):null}(e);if(c&&n.insert(this.defaultDataName,c),r)for(const[s,l]of Object.entries(r))n.insert(s,l);await n.runAsync(),this.vegaView.resize().runAsync()}render(){if(this.state.error)throw this.state.error;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(n.mL,{styles:T}),(0,N.jsx)(I,{"data-testid":"stVegaLiteChart",className:"stVegaLiteChart",useContainerWidth:this.props.element.useContainerWidth,isFullScreen:this.props.isFullScreen,ref:e=>{this.element=e}})]})}}const P=(0,a.b)((0,m.A)(O))},55516:(e,t,i)=>{i.d(t,{A:()=>g});i(58878);var o=i(53124),n=i.n(o),a=i(41514),s=i(67214),r=i(64611),l=i(98226),d=i(4883),c=i(90782);const h=e=>{let{children:t,width:i,height:o,disableFullscreenMode:n}=e;const{expanded:h,fullHeight:g,fullWidth:m,zoomIn:p,zoomOut:u}=(0,l.H)();let f=a.u,b=p,v="View fullscreen";return h&&(f=s.Q,b=u,v="Exit fullscreen"),(0,c.jsxs)(d.g,{isExpanded:h,"data-testid":"stFullScreenFrame",children:[!n&&(0,c.jsx)(d.j,{"data-testid":"StyledFullScreenButton",onClick:b,title:v,isExpanded:h,children:(0,c.jsx)(r.A,{content:f})}),t({width:h?m:i,height:h?g:o,expanded:h,expand:p,collapse:u})]})};const g=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=i=>{const{width:o,height:n,disableFullscreenMode:a}=i;return(0,c.jsx)(h,{width:o,height:n,disableFullscreenMode:t||a,children:t=>{let{width:o,height:n,expanded:a,expand:s,collapse:r}=t;return(0,c.jsx)(e,{...i,width:o,height:n,isFullScreen:a,expand:s,collapse:r})}})};return i.displayName=`withFullScreenWrapper(${e.displayName||e.name})`,n()(i,e)}},34752:(e,t,i)=>{i.d(t,{X:()=>s,o:()=>a});var o=i(58878),n=i(25571);class a{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,i){(0,n.se)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,n._L)(t)&&(this.formClearListener=e.addFormClearedListener(t,i),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}function s(e){let{element:t,widgetMgr:i,onFormCleared:a}=e;(0,o.useEffect)((()=>{if(!(0,n._L)(t.formId))return;const e=i.addFormClearedListener(t.formId,a);return()=>{e.disconnect()}}),[t,i,a])}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[9114],{34752:(e,t,i)=>{i.d(t,{X:()=>o,o:()=>r});var s=i(58878),n=i(25571);class r{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,i){(0,n.se)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,n._L)(t)&&(this.formClearListener=e.addFormClearedListener(t,i),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}function o(e){let{element:t,widgetMgr:i,onFormCleared:r}=e;(0,s.useEffect)((()=>{if(!(0,n._L)(t.formId))return;const e=i.addFormClearedListener(t.formId,r);return()=>{e.disconnect()}}),[t,i,r])}},79114:(e,t,i)=>{i.r(t),i.d(t,{default:()=>F});var s=i(58878),n=i(97757),r=i.n(n),o=i(90847),a=i(8151),l=i(34694),d=i(17643),h=i.n(d),m=i(34752),u=i(29669),c=i(25571),g=i(70474),p=i(78286),f=i(93480),b=i(997),v=i(89653),y=i(32735);const T=(0,v.A)("div",{target:"ew7r33m3"})((e=>{let{disabled:t,theme:i}=e;return{alignItems:"center",backgroundColor:t?i.colors.gray:i.colors.primary,borderTopLeftRadius:"100%",borderTopRightRadius:"100%",borderBottomLeftRadius:"100%",borderBottomRightRadius:"100%",borderTopStyle:"none",borderBottomStyle:"none",borderRightStyle:"none",borderLeftStyle:"none",boxShadow:"none",display:"flex",justifyContent:"center",height:i.sizes.sliderThumb,width:i.sizes.sliderThumb,":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 0.2rem ${(0,y.No)(i.colors.primary,.5)}`}}}),""),C=(0,v.A)("div",{target:"ew7r33m2"})((e=>{let{disabled:t,theme:i}=e;return{fontFamily:i.genericFonts.codeFont,fontSize:i.fontSizes.sm,color:t?i.colors.gray:i.colors.primary,top:"-1.6em",position:"absolute",whiteSpace:"nowrap",backgroundColor:i.colors.transparent,lineHeight:i.lineHeights.base,fontWeight:i.fontWeights.normal}}),""),R=(0,v.A)("div",{target:"ew7r33m1"})((e=>{let{theme:t}=e;return{fontSize:t.fontSizes.sm,paddingBottom:t.spacing.none,paddingLeft:t.spacing.none,paddingRight:t.spacing.none,paddingTop:"0.65em",justifyContent:"space-between",alignItems:"center",display:"flex"}}),""),V=(0,v.A)("div",{target:"ew7r33m0"})((e=>{let{disabled:t,theme:i}=e;return{lineHeight:i.lineHeights.base,fontWeight:i.fontWeights.normal,fontFamily:i.genericFonts.codeFont,color:t?i.colors.fadedText40:"inherit"}}),"");var w=i(90782);class x extends s.PureComponent{constructor(e){super(e),this.formClearHelper=new m.o,this.state=void 0,this.sliderRef=s.createRef(),this.thumbRef=[],this.thumbValueRef=[],this.commitWidgetValueDebounced=void 0,this.commitWidgetValue=e=>{const{widgetMgr:t,element:i,fragmentId:s}=this.props;t.setDoubleArrayValue(i,this.state.value,e,s)},this.onFormCleared=()=>{this.setState(((e,t)=>({value:t.element.default})),(()=>this.commitWidgetValue({fromUi:!0})))},this.handleChange=e=>{let{value:t}=e;this.setState({value:t},(()=>this.commitWidgetValueDebounced({fromUi:!0})))},this.renderThumb=s.forwardRef(((e,t)=>{const{$value:i,$thumbIndex:n}=e,o=n||0;this.thumbRef[o]=t,this.thumbValueRef[o]||=s.createRef();const a=i?this.formatValue(i[n]):"",l=r()(e,["role","style","aria-valuemax","aria-valuemin","aria-valuenow","tabIndex","onKeyUp","onKeyDown","onMouseEnter","onMouseLeave","draggable"]),d={};return(this.props.element.options.length>0||this.isDateTimeType())&&(d["aria-valuetext"]=a),(0,w.jsx)(T,{...l,disabled:!0===e.$disabled,ref:this.thumbRef[o],"aria-valuetext":a,"aria-label":this.props.element.label,children:(0,w.jsx)(C,{"data-testid":"stSliderThumbValue",disabled:!0===e.$disabled,ref:this.thumbValueRef[o],children:a})})})),this.renderTickBar=()=>{const{disabled:e,element:t}=this.props,{max:i,min:s}=t;return(0,w.jsxs)(R,{"data-testid":"stSliderTickBar",children:[(0,w.jsx)(V,{disabled:e,"data-testid":"stSliderTickBarMin",children:this.formatValue(s)}),(0,w.jsx)(V,{disabled:e,"data-testid":"stSliderTickBarMax",children:this.formatValue(i)})]})},this.commitWidgetValueDebounced=(0,c.sg)(200,this.commitWidgetValue.bind(this)),this.state={value:this.initialValue}}get initialValue(){const e=this.props.widgetMgr.getDoubleArrayValue(this.props.element);return void 0!==e?e:this.props.element.default}componentDidMount(){setTimeout((()=>{this.thumbValueAlignment()}),0),this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1,this.setState({value:e},(()=>{this.commitWidgetValue({fromUi:!1})}))}get value(){const{min:e,max:t}=this.props.element,{value:i}=this.state;let s=i[0],n=i.length>1?i[1]:i[0];return s>n&&(s=n),s<e&&(s=e),s>t&&(s=t),n<e&&(n=e),n>t&&(n=t),i.length>1?[s,n]:[s]}isDateTimeType(){const{dataType:e}=this.props.element;return e===u.Ap.DataType.DATETIME||e===u.Ap.DataType.DATE||e===u.Ap.DataType.TIME}formatValue(e){const{format:t,options:i}=this.props.element;return this.isDateTimeType()?h().utc(e/1e3).format(t):i.length>0?(0,l.sprintf)(t,i[e]):(0,l.sprintf)(t,e)}alignValueOnThumb(e,t,i){if(e&&t&&i){const s=e.getBoundingClientRect(),n=t.getBoundingClientRect(),r=i.getBoundingClientRect(),o=n.left+n.width/2,a=o-r.width/2<s.left,l=o+r.width/2>s.right;i.style.left=a?"0":"",i.style.right=l?"0":""}}thumbValueAlignment(){var e,t,i,s;const n=this.sliderRef.current,r=null===(e=this.thumbRef[0])||void 0===e?void 0:e.current,o=null===(t=this.thumbRef[1])||void 0===t?void 0:t.current,a=null===(i=this.thumbValueRef[0])||void 0===i?void 0:i.current,l=null===(s=this.thumbValueRef[1])||void 0===s?void 0:s.current;if(this.alignValueOnThumb(n,r,a),this.alignValueOnThumb(n,o,l),n&&r&&o&&a&&l){const e=n.getBoundingClientRect(),t=r.getBoundingClientRect(),i=o.getBoundingClientRect(),s=a.getBoundingClientRect(),d=l.getBoundingClientRect();if(s.right+16>d.left){d.left-16-s.width>e.left?a.style.right=d.width+16-(i.right-t.right)+"px":l.style.left=s.width+16-(i.left-t.left)+"px"}}}render(){var e;const{disabled:t,element:i,theme:s,width:n,widgetMgr:r}=this.props,{colors:a,fonts:l,fontSizes:d,spacing:h}=s,m={width:n};return this.formClearHelper.manageFormClearListener(r,i.formId,this.onFormCleared),this.thumbValueAlignment(),(0,w.jsxs)("div",{ref:this.sliderRef,className:"stSlider","data-testid":"stSlider",style:m,children:[(0,w.jsx)(g.L,{label:i.label,disabled:t,labelVisibility:(0,c.yv)(null===(e=i.labelVisibility)||void 0===e?void 0:e.value),children:i.help&&(0,w.jsx)(p.j,{children:(0,w.jsx)(f.A,{content:i.help,placement:b.W.TOP_RIGHT})})}),(0,w.jsx)(o.A,{min:i.min,max:i.max,step:i.step,value:this.value,onChange:this.handleChange,disabled:t,overrides:{Thumb:this.renderThumb,Tick:{style:{fontFamily:l.monospace}},Track:{style:{backgroundColor:"none !important",paddingBottom:h.none,paddingLeft:h.none,paddingRight:h.none,paddingTop:`calc(${d.sm} * 1.35)`}},InnerTrack:{style:e=>{let{$disabled:t}=e;return{height:h.twoXS,...t?{background:a.darkenedBgMix25}:{}}}},TickBar:this.renderTickBar}})]})}}const F=(0,a.b)(x)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[9528],{19528:(t,e,o)=>{o.r(e),o.d(e,{default:()=>c});o(58878);var s=o(3727),n=o(89653),r=o(16795);const i=(0,n.A)("div",{target:"e18r7x300"})((t=>{let{theme:e}=t;return{paddingBottom:e.spacing.sm,lineHeight:"normal",color:(0,r.ZA)(e)}}),"");var a=o(4629),g=o(90782);const c=function(t){let{element:e,width:o}=t;return(0,g.jsxs)("div",{className:"stProgress","data-testid":"stProgress",children:[(0,g.jsx)(i,{children:(0,g.jsx)(a.Ay,{source:e.text,allowHTML:!1,isLabel:!0})}),(0,g.jsx)(s.A,{value:e.value,width:o})]})}},3727:(t,e,o)=>{o.d(e,{A:()=>p,o:()=>l});var s=o(58878),n=o(8151),r=o(70766),i=o(35331),a=o(58144),g=o(84152),c=o(90782);let l;!function(t){t.EXTRASMALL="xs",t.SMALL="sm",t.MEDIUM="md",t.LARGE="lg",t.EXTRALARGE="xl"}(l||(l={}));const p=function(t){let{value:e,width:o,size:p=l.SMALL,overrides:d}=t;const m=(0,n.u)(),u={xs:m.spacing.twoXS,sm:m.spacing.sm,md:m.spacing.lg,lg:m.spacing.xl,xl:m.spacing.twoXL},{activeTheme:h}=s.useContext(g.n),R=!(0,a.tl)(h),w={BarContainer:{style:{marginTop:m.spacing.none,marginBottom:m.spacing.none,marginRight:m.spacing.none,marginLeft:m.spacing.none}},Bar:{style:t=>{let{$theme:e}=t;return{width:o?o.toString():void 0,marginTop:m.spacing.none,marginBottom:m.spacing.none,marginRight:m.spacing.none,marginLeft:m.spacing.none,height:u[p],backgroundColor:e.colors.progressbarTrackFill,borderTopLeftRadius:m.spacing.twoXS,borderTopRightRadius:m.spacing.twoXS,borderBottomLeftRadius:m.spacing.twoXS,borderBottomRightRadius:m.spacing.twoXS}}},BarProgress:{style:()=>({backgroundColor:R?m.colors.primary:m.colors.blue70,borderTopLeftRadius:m.spacing.twoXS,borderTopRightRadius:m.spacing.twoXS,borderBottomLeftRadius:m.spacing.twoXS,borderBottomRightRadius:m.spacing.twoXS})}};return(0,c.jsx)(r.A,{value:e,overrides:(0,i.Qp)(w,d)})}}}]);