streamlit-nightly 1.53.2.dev20260125__py3-none-any.whl → 1.53.2.dev20260127__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 (119) hide show
  1. streamlit/commands/logo.py +81 -25
  2. streamlit/deprecation_util.py +19 -1
  3. streamlit/elements/arrow.py +2 -1
  4. streamlit/elements/lib/built_in_chart_utils.py +2 -2
  5. streamlit/elements/lib/options_selector_utils.py +72 -22
  6. streamlit/elements/widgets/select_slider.py +123 -37
  7. streamlit/hello/plotting_demo.py +19 -12
  8. streamlit/proto/Logo_pb2.py +5 -3
  9. streamlit/proto/Logo_pb2.pyi +25 -1
  10. streamlit/proto/Slider_pb2.py +6 -6
  11. streamlit/proto/Slider_pb2.pyi +9 -1
  12. streamlit/runtime/scriptrunner/script_runner.py +17 -0
  13. streamlit/runtime/scriptrunner_utils/script_run_context.py +13 -10
  14. streamlit/runtime/state/__init__.py +7 -1
  15. streamlit/runtime/state/common.py +13 -0
  16. streamlit/runtime/state/query_params.py +494 -6
  17. streamlit/runtime/state/session_state.py +178 -3
  18. streamlit/runtime/state/widgets.py +26 -1
  19. streamlit/static/index.html +1 -1
  20. streamlit/static/manifest.json +304 -304
  21. streamlit/static/static/js/{ErrorOutline.esm.CIFYUdwC.js → ErrorOutline.esm.DiaGWPsE.js} +1 -1
  22. streamlit/static/static/js/{FileDownload.esm.DWVTnTHm.js → FileDownload.esm.D-Qgpk5d.js} +1 -1
  23. streamlit/static/static/js/{FileHelper.BPYQIPd1.js → FileHelper.DmtDDGp0.js} +1 -1
  24. streamlit/static/static/js/{FormClearHelper.CypmvhYZ.js → FormClearHelper.BM3uDLnU.js} +1 -1
  25. streamlit/static/static/js/{InputInstructions.Bi62hDTQ.js → InputInstructions.B2YZ5Lle.js} +1 -1
  26. streamlit/static/static/js/{Particles.yebG0VuV.js → Particles.BzfZrl-0.js} +1 -1
  27. streamlit/static/static/js/{ProgressBar.Dy9CI6w4.js → ProgressBar.DWErD3j3.js} +1 -1
  28. streamlit/static/static/js/{StreamlitSyntaxHighlighter.Btk92CPv.js → StreamlitSyntaxHighlighter.DB31rUPf.js} +1 -1
  29. streamlit/static/static/js/{TableChart.esm.DBeVaFNt.js → TableChart.esm.D3oUYYYd.js} +1 -1
  30. streamlit/static/static/js/{Toolbar.DC2Tp-qb.js → Toolbar.CPyjMABY.js} +1 -1
  31. streamlit/static/static/js/{WidgetLabelHelpIconInline.3DnEd9BK.js → WidgetLabelHelpIconInline.C1NBCx-y.js} +1 -1
  32. streamlit/static/static/js/{base-input.7Sj6pVk0.js → base-input.C_CrNgNd.js} +1 -1
  33. streamlit/static/static/js/{checkbox.CcUx3XuQ.js → checkbox.S6O8DPFl.js} +1 -1
  34. streamlit/static/static/js/{createDownloadLinkElement.DZuwkCqy.js → createDownloadLinkElement.B-5tIJBw.js} +1 -1
  35. streamlit/static/static/js/{data-grid-overlay-editor.Dw-AewlN.js → data-grid-overlay-editor.BW5aAEJN.js} +1 -1
  36. streamlit/static/static/js/{downloader.Bsx5M2Du.js → downloader.BswLlj7p.js} +1 -1
  37. streamlit/static/static/js/embed.QjYZXbaW.js +193 -0
  38. streamlit/static/static/js/{es6.BpAqZaR_.js → es6.Dm_kl6Cp.js} +2 -2
  39. streamlit/static/static/js/{formatNumber.DjehVPVS.js → formatNumber.CH39oSMw.js} +1 -1
  40. streamlit/static/static/js/{iconPosition.D02OPE-d.js → iconPosition.Dp9f2jam.js} +1 -1
  41. streamlit/static/static/js/{iframeResizer.contentWindow.xtstqPd7.js → iframeResizer.contentWindow.DOprY46-.js} +1 -1
  42. streamlit/static/static/js/{index.S-mjkUeF.js → index.-7yn3zqE.js} +1 -1
  43. streamlit/static/static/js/{index.Bri1T2TS.js → index.4QSKV4yi.js} +1 -1
  44. streamlit/static/static/js/{index.ZIA43eTF.js → index.6OwBTJdz.js} +1 -1
  45. streamlit/static/static/js/{index.x1B588Xu.js → index.6UQ__fP7.js} +1 -1
  46. streamlit/static/static/js/{index.CEwnDCn9.js → index.6iOQDEVC.js} +1 -1
  47. streamlit/static/static/js/index.B0Wcvg8a.js +2 -0
  48. streamlit/static/static/js/{index.DO2T-QzF.js → index.B6Sk5Jwr.js} +1 -1
  49. streamlit/static/static/js/{index.D_TIyPF4.js → index.B9XI6y3j.js} +1 -1
  50. streamlit/static/static/js/{index.B9gbSNsw.js → index.BBVcEzWu.js} +1 -1
  51. streamlit/static/static/js/{index.CA0RmxJF.js → index.BFxjXeYb.js} +1 -1
  52. streamlit/static/static/js/{index.B5tD5YeV.js → index.BNsCI-Q1.js} +1 -1
  53. streamlit/static/static/js/{index.DJjSqPAx.js → index.BQu5Qf_i.js} +1 -1
  54. streamlit/static/static/js/{index.BvZbnSMC.js → index.BUOjbZl6.js} +1 -1
  55. streamlit/static/static/js/{index.XFMDBL5n.js → index.BUbgW8RJ.js} +1 -1
  56. streamlit/static/static/js/{index.BOkpEbJS.js → index.BYjec3-R.js} +1 -1
  57. streamlit/static/static/js/{index.D6Z9hKJY.js → index.BaKZ4ira.js} +1 -1
  58. streamlit/static/static/js/{index.BIcJe97b.js → index.BcUwq6kI.js} +1 -1
  59. streamlit/static/static/js/{index.C9v49R-a.js → index.BlchQrZL.js} +1 -1
  60. streamlit/static/static/js/{index.D9RL5sRp.js → index.BlgpfTUq.js} +1 -1
  61. streamlit/static/static/js/{index.BV6XgCij.js → index.Bwaj-9Zv.js} +1 -1
  62. streamlit/static/static/js/{index.DDu_qTm0.js → index.BxtweGcn.js} +1 -1
  63. streamlit/static/static/js/{index.CGbvkEtg.js → index.C57ViuAX.js} +1 -1
  64. streamlit/static/static/js/{index.CdRwiHPm.js → index.CAzk7fUP.js} +1 -1
  65. streamlit/static/static/js/{index.BK9S5qug.js → index.CDZffl1q.js} +1 -1
  66. streamlit/static/static/js/{index.JL0uGAeJ.js → index.CYxcFtYt.js} +1 -1
  67. streamlit/static/static/js/index.Cb7V19H9.js +2 -0
  68. streamlit/static/static/js/{index.CgARjn28.js → index.CfXTal6g.js} +1 -1
  69. streamlit/static/static/js/{index.CyDHwK5P.js → index.Ci3x7GcT.js} +1 -1
  70. streamlit/static/static/js/{index.BVhVdVeE.js → index.CivdhE_9.js} +1 -1
  71. streamlit/static/static/js/{index.m3dn5Bai.js → index.CkSzTTpO.js} +5 -5
  72. streamlit/static/static/js/{index.8FPw0_gD.js → index.CuJ82OKQ.js} +1 -1
  73. streamlit/static/static/js/{index.BDlI2pRp.js → index.Cw5Xlisw.js} +1 -1
  74. streamlit/static/static/js/{index.DdxofXV8.js → index.D1tkD8Lg.js} +3 -3
  75. streamlit/static/static/js/{index.iXzAofuY.js → index.DK9Im19R.js} +2 -2
  76. streamlit/static/static/js/{index.iF5zYERg.js → index.DMwRlpNi.js} +1 -1
  77. streamlit/static/static/js/index.DTUAvbJ0.js +1 -0
  78. streamlit/static/static/js/{index.DSSapl3Q.js → index.DoRYpzHm.js} +1 -1
  79. streamlit/static/static/js/{index.D6J2UPzF.js → index.DsZNm1_D.js} +1 -1
  80. streamlit/static/static/js/{index.5H98WqjT.js → index.DypwtfIh.js} +1 -1
  81. streamlit/static/static/js/{index.DgLRJfs3.js → index.JKOtpaMf.js} +1 -1
  82. streamlit/static/static/js/{index.B8-HOwf1.js → index.OI2eh_me.js} +1 -1
  83. streamlit/static/static/js/{index.CKUBdVQ9.js → index.TTO_Lb69.js} +1 -1
  84. streamlit/static/static/js/{index.-faJDV20.js → index.X1r5cenD.js} +1 -1
  85. streamlit/static/static/js/{index.BqfJJr3c.js → index.gsc49XzN.js} +1 -1
  86. streamlit/static/static/js/{index.BB_iwaVr.js → index.lMhsw-5K.js} +32 -32
  87. streamlit/static/static/js/{index.DZv5AoR1.js → index.s9zpEF8P.js} +1 -1
  88. streamlit/static/static/js/{index.BGTMh3Uu.js → index.tjRGlTlQ.js} +1 -1
  89. streamlit/static/static/js/{index.Bo1ztye0.js → index.wKGUZfH4.js} +1 -1
  90. streamlit/static/static/js/{input.VYKyGuhi.js → input.CIKqvWjB.js} +1 -1
  91. streamlit/static/static/js/{main.u5Bb3MY7.js → main.BkNqoTrd.js} +1 -1
  92. streamlit/static/static/js/{memory.BOMt4yAV.js → memory.DNcbFok2.js} +1 -1
  93. streamlit/static/static/js/{number-overlay-editor.CihlAHgl.js → number-overlay-editor.DwjiYKav.js} +1 -1
  94. streamlit/static/static/js/{pandasStylerUtils.BuqSgXpk.js → pandasStylerUtils.BSc50we3.js} +1 -1
  95. streamlit/static/static/js/{sandbox.COGR4pqz.js → sandbox.DJL9Gdcf.js} +1 -1
  96. streamlit/static/static/js/{styled-components.BEf3c4IJ.js → styled-components.D4jE1G9j.js} +1 -1
  97. streamlit/static/static/js/{throttle.Bl-XsA9N.js → throttle.dHeXiPIK.js} +1 -1
  98. streamlit/static/static/js/{timepicker.B-HgBYlK.js → timepicker.CIpoSUyW.js} +1 -1
  99. streamlit/static/static/js/{toConsumableArray.BrQebwtE.js → toConsumableArray.AOXQx2YY.js} +1 -1
  100. streamlit/static/static/js/uniqueId.DRPc21MO.js +1 -0
  101. streamlit/static/static/js/{useBasicWidgetState.8WwISl9r.js → useBasicWidgetState.BwQxG7iA.js} +1 -1
  102. streamlit/static/static/js/{useIntlLocale.D37LWdCR.js → useIntlLocale.JXPZPWaJ.js} +1 -1
  103. streamlit/static/static/js/{useTextInputAutoExpand.Bb_KqJvq.js → useTextInputAutoExpand.CD_nhoE_.js} +1 -1
  104. streamlit/static/static/js/{useUpdateUiValue.D1BLS5t7.js → useUpdateUiValue.Cl1Y22Ao.js} +1 -1
  105. streamlit/static/static/js/{useWaveformController.Ce0-qTws.js → useWaveformController.DJhScSDn.js} +1 -1
  106. streamlit/static/static/js/{withCalculatedWidth.BX2K3UVv.js → withCalculatedWidth.CrAfFzO9.js} +1 -1
  107. streamlit/static/static/js/{withFullScreenWrapper.CqfGs8T2.js → withFullScreenWrapper.EdE3zOz5.js} +1 -1
  108. streamlit/testing/v1/element_tree.py +23 -8
  109. {streamlit_nightly-1.53.2.dev20260125.dist-info → streamlit_nightly-1.53.2.dev20260127.dist-info}/METADATA +1 -1
  110. {streamlit_nightly-1.53.2.dev20260125.dist-info → streamlit_nightly-1.53.2.dev20260127.dist-info}/RECORD +114 -114
  111. streamlit/static/static/js/embed.C7by6AoE.js +0 -195
  112. streamlit/static/static/js/index.Bhy8EBYI.js +0 -2
  113. streamlit/static/static/js/index.C5ehUqNt.js +0 -2
  114. streamlit/static/static/js/index.m4WkwGMu.js +0 -1
  115. streamlit/static/static/js/uniqueId.8R4hbkYl.js +0 -1
  116. {streamlit_nightly-1.53.2.dev20260125.data → streamlit_nightly-1.53.2.dev20260127.data}/scripts/streamlit.cmd +0 -0
  117. {streamlit_nightly-1.53.2.dev20260125.dist-info → streamlit_nightly-1.53.2.dev20260127.dist-info}/WHEEL +0 -0
  118. {streamlit_nightly-1.53.2.dev20260125.dist-info → streamlit_nightly-1.53.2.dev20260127.dist-info}/entry_points.txt +0 -0
  119. {streamlit_nightly-1.53.2.dev20260125.dist-info → streamlit_nightly-1.53.2.dev20260127.dist-info}/top_level.txt +0 -0
@@ -1,3 +1,3 @@
1
- import{am as _,an as ye,w as O,r as u,l as $e,o as ne,j as M,P as Oe,ac as Re,q as oe,aa as ie,bq as ae,p as _e,e as Se}from"./index.BB_iwaVr.js";import{W as Pe}from"./WidgetLabelHelpIconInline.3DnEd9BK.js";import{u as we}from"./useBasicWidgetState.8WwISl9r.js";import"./FormClearHelper.CypmvhYZ.js";var se={vertical:"vertical",horizontal:"horizontal"};function le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function D(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?le(Object(n),!0).forEach(function(r){R(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):le(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function R(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var E=0,L=1,T=2;function z(e){return e.$isActive?T:e.$isHovered?L:E}function Me(e){var t=e.$theme.colors,n=e.$disabled,r=e.$checked,o=e.$isFocusVisible,i=e.$error;if(n)return t.tickFillDisabled;if(r)if(i)switch(z(e)){case E:return t.tickFillErrorSelected;case L:return t.tickFillErrorSelectedHover;case T:return t.tickFillErrorSelectedHoverActive}else switch(z(e)){case E:return t.tickFillSelected;case L:return t.tickFillSelectedHover;case T:return t.tickFillSelectedHoverActive}else return o?t.borderSelected:i?t.tickBorderError:t.tickBorder;return null}function ke(e){var t=e.$theme.colors;if(e.$disabled)return t.tickMarkFillDisabled;if(e.$checked)return t.tickMarkFill;if(e.$error)switch(z(e)){case E:return t.tickFillError;case L:return t.tickFillErrorHover;case T:return t.tickFillErrorHoverActive}else switch(z(e)){case E:return t.tickFill;case L:return t.tickFillHover;case T:return t.tickFillActive}}function Fe(e){var t=e.$labelPlacement,n=t===void 0?"":t,r=e.$theme,o;switch(n){case"top":o="Bottom";break;case"bottom":o="Top";break;case"left":o=r.direction==="rtl"?"Left":"Right";break;default:case"right":o=r.direction==="rtl"?"Right":"Left";break}var i=r.sizing,s=i.scale300;return R({},"padding".concat(o),s)}function Ie(e){var t=e.$disabled,n=e.$theme,r=n.colors;return t?r.contentSecondary:r.contentPrimary}var q=_("div",function(e){var t=e.$disabled,n=e.$align;return{display:"flex",flexWrap:"wrap",flexDirection:n==="horizontal"?"row":"column",alignItems:n==="horizontal"?"center":"flex-start",cursor:t?"not-allowed":"pointer","-webkit-tap-highlight-color":"transparent"}});q.displayName="RadioGroupRoot";q.displayName="RadioGroupRoot";var X=_("label",function(e){var t,n=e.$disabled,r=e.$hasDescription,o=e.$labelPlacement,i=e.$theme,s=e.$align,a=i.sizing,c=s==="horizontal",p=i.direction==="rtl"?"Left":"Right";return t={flexDirection:o==="top"||o==="bottom"?"column":"row",display:"flex",alignItems:"center",cursor:n?"not-allowed":"pointer",marginTop:a.scale200},R(t,"margin".concat(p),c?a.scale200:null),R(t,"marginBottom",r&&!c?null:a.scale200),t});X.displayName="Root";X.displayName="Root";var K=_("div",function(e){var t=e.$theme,n=t.animation,r=t.sizing;return{backgroundColor:ke(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",height:e.$checked?r.scale200:r.scale550,transitionDuration:n.timing200,transitionTimingFunction:n.easeOutCurve,width:e.$checked?r.scale200:r.scale550}});K.displayName="RadioMarkInner";K.displayName="RadioMarkInner";var J=_("div",function(e){var t=e.$theme,n=t.animation,r=t.sizing;return{alignItems:"center",backgroundColor:Me(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:r.scale700,justifyContent:"center",marginTop:r.scale0,marginRight:r.scale0,marginBottom:r.scale0,marginLeft:r.scale0,outline:"none",verticalAlign:"middle",width:r.scale700,flexShrink:0,transitionDuration:n.timing200,transitionTimingFunction:n.easeOutCurve}});J.displayName="RadioMarkOuter";J.displayName="RadioMarkOuter";var Q=_("div",function(e){var t=e.$theme.typography;return D(D({verticalAlign:"middle"},Fe(e)),{},{color:Ie(e)},t.LabelMedium)});Q.displayName="Label";Q.displayName="Label";var Y=_("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"});Y.displayName="Input";Y.displayName="Input";var Z=_("div",function(e){var t,n=e.$theme,r=e.$align,o=r==="horizontal",i=n.direction==="rtl"?"Right":"Left",s=n.direction==="rtl"?"Left":"Right";return D(D({},n.typography.ParagraphSmall),{},(t={color:n.colors.contentSecondary,cursor:"auto"},R(t,"margin".concat(i),r==="horizontal"?null:n.sizing.scale900),R(t,"margin".concat(s),o?n.sizing.scale200:null),R(t,"maxWidth","240px"),t))});Z.displayName="Description";Z.displayName="Description";function N(e){"@babel/helpers - typeof";return N=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},N(e)}function V(){return V=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},V.apply(this,arguments)}function Ee(e,t){return Ae(e)||xe(e,t)||Te(e,t)||Le()}function Le(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{am as _,an as ye,w as O,r as u,l as $e,o as ne,j as M,P as Oe,ac as Re,q as oe,aa as ie,bq as ae,p as _e,e as Se}from"./index.lMhsw-5K.js";import{W as Pe}from"./WidgetLabelHelpIconInline.C1NBCx-y.js";import{u as we}from"./useBasicWidgetState.BwQxG7iA.js";import"./FormClearHelper.BM3uDLnU.js";var se={vertical:"vertical",horizontal:"horizontal"};function le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function D(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?le(Object(n),!0).forEach(function(r){R(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):le(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function R(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var E=0,L=1,T=2;function z(e){return e.$isActive?T:e.$isHovered?L:E}function Me(e){var t=e.$theme.colors,n=e.$disabled,r=e.$checked,o=e.$isFocusVisible,i=e.$error;if(n)return t.tickFillDisabled;if(r)if(i)switch(z(e)){case E:return t.tickFillErrorSelected;case L:return t.tickFillErrorSelectedHover;case T:return t.tickFillErrorSelectedHoverActive}else switch(z(e)){case E:return t.tickFillSelected;case L:return t.tickFillSelectedHover;case T:return t.tickFillSelectedHoverActive}else return o?t.borderSelected:i?t.tickBorderError:t.tickBorder;return null}function ke(e){var t=e.$theme.colors;if(e.$disabled)return t.tickMarkFillDisabled;if(e.$checked)return t.tickMarkFill;if(e.$error)switch(z(e)){case E:return t.tickFillError;case L:return t.tickFillErrorHover;case T:return t.tickFillErrorHoverActive}else switch(z(e)){case E:return t.tickFill;case L:return t.tickFillHover;case T:return t.tickFillActive}}function Fe(e){var t=e.$labelPlacement,n=t===void 0?"":t,r=e.$theme,o;switch(n){case"top":o="Bottom";break;case"bottom":o="Top";break;case"left":o=r.direction==="rtl"?"Left":"Right";break;default:case"right":o=r.direction==="rtl"?"Right":"Left";break}var i=r.sizing,s=i.scale300;return R({},"padding".concat(o),s)}function Ie(e){var t=e.$disabled,n=e.$theme,r=n.colors;return t?r.contentSecondary:r.contentPrimary}var q=_("div",function(e){var t=e.$disabled,n=e.$align;return{display:"flex",flexWrap:"wrap",flexDirection:n==="horizontal"?"row":"column",alignItems:n==="horizontal"?"center":"flex-start",cursor:t?"not-allowed":"pointer","-webkit-tap-highlight-color":"transparent"}});q.displayName="RadioGroupRoot";q.displayName="RadioGroupRoot";var X=_("label",function(e){var t,n=e.$disabled,r=e.$hasDescription,o=e.$labelPlacement,i=e.$theme,s=e.$align,a=i.sizing,c=s==="horizontal",p=i.direction==="rtl"?"Left":"Right";return t={flexDirection:o==="top"||o==="bottom"?"column":"row",display:"flex",alignItems:"center",cursor:n?"not-allowed":"pointer",marginTop:a.scale200},R(t,"margin".concat(p),c?a.scale200:null),R(t,"marginBottom",r&&!c?null:a.scale200),t});X.displayName="Root";X.displayName="Root";var K=_("div",function(e){var t=e.$theme,n=t.animation,r=t.sizing;return{backgroundColor:ke(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",height:e.$checked?r.scale200:r.scale550,transitionDuration:n.timing200,transitionTimingFunction:n.easeOutCurve,width:e.$checked?r.scale200:r.scale550}});K.displayName="RadioMarkInner";K.displayName="RadioMarkInner";var J=_("div",function(e){var t=e.$theme,n=t.animation,r=t.sizing;return{alignItems:"center",backgroundColor:Me(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:r.scale700,justifyContent:"center",marginTop:r.scale0,marginRight:r.scale0,marginBottom:r.scale0,marginLeft:r.scale0,outline:"none",verticalAlign:"middle",width:r.scale700,flexShrink:0,transitionDuration:n.timing200,transitionTimingFunction:n.easeOutCurve}});J.displayName="RadioMarkOuter";J.displayName="RadioMarkOuter";var Q=_("div",function(e){var t=e.$theme.typography;return D(D({verticalAlign:"middle"},Fe(e)),{},{color:Ie(e)},t.LabelMedium)});Q.displayName="Label";Q.displayName="Label";var Y=_("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"});Y.displayName="Input";Y.displayName="Input";var Z=_("div",function(e){var t,n=e.$theme,r=e.$align,o=r==="horizontal",i=n.direction==="rtl"?"Right":"Left",s=n.direction==="rtl"?"Left":"Right";return D(D({},n.typography.ParagraphSmall),{},(t={color:n.colors.contentSecondary,cursor:"auto"},R(t,"margin".concat(i),r==="horizontal"?null:n.sizing.scale900),R(t,"margin".concat(s),o?n.sizing.scale200:null),R(t,"maxWidth","240px"),t))});Z.displayName="Description";Z.displayName="Description";function N(e){"@babel/helpers - typeof";return N=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},N(e)}function V(){return V=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},V.apply(this,arguments)}function Ee(e,t){return Ae(e)||xe(e,t)||Te(e,t)||Le()}function Le(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Te(e,t){if(e){if(typeof e=="string")return ue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ue(e,t)}}function ue(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,i=!1,s,a;try{for(n=n.call(e);!(o=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));o=!0);}catch(c){i=!0,a=c}finally{try{!o&&n.return!=null&&n.return()}finally{if(i)throw a}}return r}}function Ae(e){if(Array.isArray(e))return e}function je(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function De(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ze(e,t,n){return t&&De(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Be(e,t){if(typeof t!="function"&&t!==null)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&&U(e,t)}function U(e,t){return U=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},U(e,t)}function Ce(e){var t=Ne();return function(){var r=B(e),o;if(t){var i=B(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return He(this,o)}}function He(e,t){if(t&&(N(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return A(e)}function A(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ne(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function B(e){return B=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},B(e)}function j(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var pe=(function(e){Be(n,e);var t=Ce(n);function n(){var r;je(this,n);for(var o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),j(A(r),"state",{isFocusVisible:!1,focusedRadioIndex:-1}),j(A(r),"handleFocus",function(a,c){ye(a)&&r.setState({isFocusVisible:!0}),r.setState({focusedRadioIndex:c}),r.props.onFocus&&r.props.onFocus(a)}),j(A(r),"handleBlur",function(a,c){r.state.isFocusVisible!==!1&&r.setState({isFocusVisible:!1}),r.setState({focusedRadioIndex:-1}),r.props.onBlur&&r.props.onBlur(a)}),r}return ze(n,[{key:"render",value:function(){var o=this,i=this.props.overrides,s=i===void 0?{}:i,a=O(s.RadioGroupRoot,q),c=Ee(a,2),p=c[0],m=c[1];return u.createElement(p,V({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},m),u.Children.map(this.props.children,function(f,l){if(!u.isValidElement(f))return null;var d=o.props.value===f.props.value;return u.cloneElement(f,{align:o.props.align,autoFocus:o.props.autoFocus,checked:d,disabled:o.props.disabled||f.props.disabled,error:o.props.error,isFocused:o.state.focusedRadioIndex===l,isFocusVisible:o.state.isFocusVisible,tabIndex:l===0&&!o.props.value||d?"0":"-1",labelPlacement:o.props.labelPlacement,name:o.props.name,onBlur:function(g){return o.handleBlur(g,l)},onFocus:function(g){return o.handleFocus(g,l)},onChange:o.props.onChange,onMouseEnter:o.props.onMouseEnter,onMouseLeave:o.props.onMouseLeave})}))}}]),n})(u.Component);j(pe,"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:{}});function G(e){"@babel/helpers - typeof";return G=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},G(e)}function $(){return $=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$.apply(this,arguments)}function w(e,t){return We(e)||Ge(e,t)||Ue(e,t)||Ve()}function Ve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ue(e,t){if(e){if(typeof e=="string")return ce(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ce(e,t)}}function ce(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ge(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,i=!1,s,a;try{for(n=n.call(e);!(o=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));o=!0);}catch(c){i=!0,a=c}finally{try{!o&&n.return!=null&&n.return()}finally{if(i)throw a}}return r}}function We(e){if(Array.isArray(e))return e}function qe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ke(e,t,n){return t&&Xe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Je(e,t){if(typeof t!="function"&&t!==null)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)}function W(e,t){return W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},W(e,t)}function Qe(e){var t=Ze();return function(){var r=C(e),o;if(t){var i=C(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Ye(this,o)}}function Ye(e,t){if(t&&(G(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return k(e)}function k(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ze(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function C(e){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},C(e)}function F(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function et(e){return e==="top"||e==="left"}function tt(e){return e==="bottom"||e==="right"}var rt=function(t){return t.stopPropagation()},fe=(function(e){Je(n,e);var t=Qe(n);function n(){var r;qe(this,n);for(var o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),F(k(r),"state",{isActive:!1,isHovered:!1}),F(k(r),"onMouseEnter",function(a){r.setState({isHovered:!0}),r.props.onMouseEnter&&r.props.onMouseEnter(a)}),F(k(r),"onMouseLeave",function(a){r.setState({isHovered:!1}),r.props.onMouseLeave&&r.props.onMouseLeave(a)}),F(k(r),"onMouseDown",function(a){r.setState({isActive:!0}),r.props.onMouseDown&&r.props.onMouseDown(a)}),F(k(r),"onMouseUp",function(a){r.setState({isActive:!1}),r.props.onMouseUp&&r.props.onMouseUp(a)}),r}return Ke(n,[{key:"componentDidMount",value:function(){var o;this.props.autoFocus&&(o=this.props.inputRef)!==null&&o!==void 0&&o.current&&this.props.inputRef.current.focus()}},{key:"render",value:function(){var o=this.props.overrides,i=o===void 0?{}:o,s=O(i.Root,X),a=w(s,2),c=a[0],p=a[1],m=O(i.Label,Q),f=w(m,2),l=f[0],d=f[1],h=O(i.Input,Y),g=w(h,2),S=g[0],H=g[1],x=O(i.Description,Z),I=w(x,2),v=I[0],b=I[1],y=O(i.RadioMarkInner,K),ee=w(y,2),de=ee[0],he=ee[1],ge=O(i.RadioMarkOuter,J),te=w(ge,2),be=te[0],me=te[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},re=u.createElement(l,$({},P,d),this.props.containsInteractiveElement?u.createElement("div",{onClick:function(ve){return ve.preventDefault()}},this.props.children):this.props.children);return u.createElement(u.Fragment,null,u.createElement(c,$({"data-baseweb":"radio",onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},P,p),et(this.props.labelPlacement)&&re,u.createElement(be,$({},P,me),u.createElement(de,$({},P,he))),u.createElement(S,$({"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:rt,onChange:this.props.onChange,ref:this.props.inputRef,required:this.props.required,tabIndex:this.props.tabIndex,type:"radio",value:this.props.value},P,H)),tt(this.props.labelPlacement)&&re),!!this.props.description&&u.createElement(v,$({},P,b),this.props.description))}}]),n})(u.Component);F(fe,"defaultProps",{overrides:{},containsInteractiveElement:!1,checked:!1,disabled:!1,autoFocus:!1,inputRef:u.createRef(),align:"vertical",error:!1,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});function nt(e){const t=parseFloat(e.sizes.checkbox),n=parseFloat(e.spacing.threeXS),r=ie(t.toString()),o=Math.round(r*.375);let i=Math.round(ie((t-n).toString()));return i>=r&&(i-=1),[ae(o,"px"),ae(i,"px")]}function ot({disabled:e,horizontal:t,value:n,onChange:r,options:o,captions:i,label:s,labelVisibility:a,help:c}){const[p,m]=u.useState(n??null);u.useEffect(()=>{n!==p&&m(n??null)},[n]);const f=u.useCallback(v=>{const b=parseInt(v.target.value,10);m(b),r(b)},[r]),l=$e(),d=i.length>0,h=o.length>0,g=h?o:["No options to select."],S=e||!h,H=v=>v==""&&t&&d?"&nbsp;":v,[x,I]=nt(l);return ne("div",{className:"stRadio","data-testid":"stRadio",children:[M(Re,{label:s,disabled:S,labelVisibility:a,children:c&&M(Pe,{content:c,placement:Oe.TOP_RIGHT,label:s})}),M(pe,{onChange:f,value:p!==null?p.toString():void 0,disabled:S,align:t?se.horizontal:se.vertical,"aria-label":s,"data-testid":"stRadioGroup",overrides:{RadioGroupRoot:{style:{gap:d?l.spacing.sm:l.spacing.none,minHeight:l.sizes.minElementHeight}}},children:g.map((v,b)=>ne(fe,{value:b.toString(),overrides:{Root:{style:({$isFocusVisible:y})=>({marginBottom:l.spacing.none,marginTop:l.spacing.none,marginRight:d?l.spacing.sm:l.spacing.lg,paddingLeft:l.spacing.none,alignItems:"start",paddingRight:l.spacing.threeXS,backgroundColor:y?l.colors.darkenedBgMix25:""})},RadioMarkOuter:{style:({$checked:y})=>({width:l.sizes.checkbox,height:l.sizes.checkbox,marginTop:"0.35rem",marginRight:l.spacing.none,marginLeft:l.spacing.none,backgroundColor:y&&!S?l.colors.primary:l.colors.borderColor})},RadioMarkInner:{style:({$checked:y})=>({height:y?x:I,width:y?x:I})},Label:{style:{color:S?l.colors.fadedText40:l.colors.bodyText,position:"relative",top:l.spacing.px}}},children:[M(oe,{source:v,allowHTML:!1,isLabel:!0,largerLabel:!0}),d&&M(oe,{source:H(i[b]),allowHTML:!1,isCaption:!0,isLabel:!0})]},b))})]})}const it=u.memo(ot);function at({disabled:e,element:t,widgetMgr:n,fragmentId:r}){const[o,i]=we({getStateFromWidgetMgr:st,getDefaultStateFromProto:lt,getCurrStateFromProto:ut,updateWidgetMgrState:ct,element:t,widgetMgr:n,fragmentId:r}),{horizontal:s,options:a,captions:c,label:p,labelVisibility:m,help:f}=t,l=u.useCallback(h=>{const g=a[h]??null;i({value:g,fromUi:!0})},[i,a]),d=u.useMemo(()=>{if(o===null)return null;const h=a.indexOf(o);return h>=0?h:null},[o,a]);return M(it,{label:p,onChange:l,options:a,captions:c,disabled:e,horizontal:s,labelVisibility:_e(m?.value),value:d,help:f})}function st(e,t){return e.getStringValue(t)}function lt(e){return e.options.length===0||Se(e.default)?null:e.options[e.default]}function ut(e){return e.rawValue??null}function ct(e,t,n,r){t.setStringValue(e,n.value,{fromUi:n.fromUi},r)}const bt=u.memo(at);export{bt as default};
@@ -0,0 +1 @@
1
+ import{r as a,E as B,_ as $,l as X,e as L,Q,O as K,bd as z,be as j,bf as Y,bg as Z,n as k,bh as M,V as U,W as q,k as ee,b8 as te,bi as ne,j as x,o as se,b1 as re}from"./index.lMhsw-5K.js";import{w as oe,E as ae}from"./withFullScreenWrapper.EdE3zOz5.js";import{a as _,S as H,T as ie}from"./Toolbar.CPyjMABY.js";import{R as ce}from"./index.CkSzTTpO.js";import{a as J,c as le,b as ue,e as fe,t as de,S as me,d as pe}from"./embed.QjYZXbaW.js";import{u as he}from"./FormClearHelper.BM3uDLnU.js";import{T as ge}from"./TableChart.esm.D3oUYYYd.js";import"./moment.C7qA8nIE.js";import"./pandasStylerUtils.BSc50we3.js";import"./numbro.B9_PXfzp.js";import"./_baseIndexOf.BTknn6Gb.js";import"./index.8HslT92O.js";import"./main.BkNqoTrd.js";import"./throttle.dHeXiPIK.js";import"./toConsumableArray.AOXQx2YY.js";import"./formatNumber.CH39oSMw.js";import"./sprintf.DpPCfzXw.js";import"./formatMoment.C6Hwn6X5.js";import"./checkbox.S6O8DPFl.js";import"./createDownloadLinkElement.B-5tIJBw.js";import"./FileDownload.esm.D-Qgpk5d.js";import"./_arrayIncludes.B19Iyn2B.js";import"./threshold.CUNQbqMA.js";import"./value.DaKxGC7O.js";import"./timer.BZio6gjG.js";var W=a.forwardRef(function(n,t){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(B,$({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM7 10h2v7H7zm4-3h2v10h-2zm4 6h2v4h-2z"}))});W.displayName="InsertChart";const Se=20;function ye(n){"params"in n&&"encoding"in n&&n.params.forEach(t=>{"select"in t&&(["interval","point"].includes(t.select)&&(t.select={type:t.select}),"type"in t.select&&t.select.type==="point"&&!("encodings"in t.select)&&L(t.select.encodings)&&(t.select.encodings=Object.keys(n.encoding)))})}const be=(n,t,r,s,f,l,u,m)=>{const e=JSON.parse(n);if(typeof e.height=="number"&&e.height<=0&&delete e.height,typeof e.width=="number"&&e.width<=0&&delete e.width,s==="streamlit"?e.config=J(e.config,l):e.usermeta?.embedOptions?.theme==="streamlit"?(e.config=J(e.config,l),e.usermeta.embedOptions.theme=void 0):e.config=le(e.config,l),e.title&&(typeof e.title=="string"&&(e.title={text:e.title}),e.title.limit=e.title.limit??Math.max(u-40,0)),r&&m&&m>0&&(e.height=m),t&&u&&u>0&&(e.width=u,"vconcat"in e&&e.vconcat.forEach(o=>{o===null||typeof o!="object"||"hconcat"in o||"vconcat"in o||"concat"in o||"layer"in o||(o.width=u)})),e.padding||(e.padding={}),L(e.padding.bottom)&&(e.padding.bottom=Se),e.datasets)throw new Error("Datasets should not be passed as part of the spec");return f.length>0&&ye(e),e},we=(n,t,r,s,f)=>{const l=X(),{id:u,formId:m,spec:e,data:o,datasets:i,vegaLiteTheme:d,selectionMode:c}=n,h=a.useMemo(()=>c,[JSON.stringify(c)]),S=a.useMemo(()=>be(e,s,f,d,h,l,t,r),[e,s,f,d,h,l,t,r]);return{id:u,formId:m,vegaLiteTheme:d,spec:S,selectionMode:h,data:o,datasets:i,useContainerWidth:s}},Ce={DATAFRAME_INDEX:"(index)"};function Ee(n){return!n||n.dimensions.numDataRows===0?null:F(n)}function Ne(n){const t=I(n);if(L(t))return null;const r={};for(const[s,f]of Object.entries(t))r[s]=F(f);return r}function I(n){if(n?.length===0)return null;const t={};return n.forEach(r=>{if(!r)return;const s=r.hasName?r.name:null;t[s]=r.data}),t}function F(n,t=0){if(n.dimensions.numDataRows===0)return[];const r=[],{numDataRows:s,numDataColumns:f,numIndexColumns:l}=n.dimensions,u=n.columnTypes[0]??void 0,m=u?.type===Q.INDEX&&(K(u)||z(u)||j(u));for(let e=t;e<s;e++){const o={};if(m){const{content:i}=n.getCell(e,0);o[Ce.DATAFRAME_INDEX]=typeof i=="bigint"?Number(i):i}for(let i=0;i<f;i++){const d=i+l,{content:c,contentType:h}=n.getCell(e,d);if((c instanceof Date||typeof c=="number"&&Number.isFinite(c))&&(z(h)||j(h))&&!Y(h)){const S=new Date(c).getTimezoneOffset()*60*1e3;o[n.columnNames[0][d]]=c.valueOf()+S}else o[n.columnNames[0][d]]=typeof c=="bigint"?Number(c):c}r.push(o)}return r}const Ve=150,De=U.getLogger("useVegaLiteSelections"),Oe=(n,t,r)=>{const{id:s,formId:f,selectionMode:l}=n,u=a.useCallback(e=>{l.forEach(i=>{e.addSignalListener(i,Z(Ve,(d,c)=>{const h=e.getState({data:(N,A)=>l.some(g=>`${g}_store`===N),recurse:!1});k(h)&&t.setElementState(s,"viewState",h);let S=c;"vlPoint"in c&&"or"in c.vlPoint&&(S=c.vlPoint.or);const D={id:s,formId:f},E=JSON.parse(t.getStringValue(D)||"{}"),V={selection:{...E?.selection||{},[d]:S||{}}};M(E,V)||t.setStringValue(D,JSON.stringify(V),{fromUi:!0},r)}))});const o=t.getElementState(s,"viewState");if(k(o))try{return e.setState(o)}catch(i){De.warn("Failed to restore view state",i)}return e},[s,l,t,f,r]),m=a.useCallback(()=>{const e={selection:{}};l.forEach(c=>{e.selection[c]={}});const o={id:s,formId:f},i=t.getStringValue(o),d=i?JSON.parse(i):e;M(d,e)||t.setStringValue(o,JSON.stringify(e),{fromUi:!0},r)},[s,f,r,l,t]);return{maybeConfigureSelections:u,onFormCleared:m}},P="source",Te=U.getLogger("useVegaEmbed");function ve(n,t,r){const s=a.useRef(null),f=a.useRef(null),l=a.useRef(P),u=a.useRef(null),m=a.useRef([]),e=a.useRef(null),o=a.useRef([]),[i,d]=a.useState(!1),{maybeConfigureSelections:c,onFormCleared:h}=Oe(n,t,r);he({widgetMgr:t,element:n,onFormCleared:h});const{data:S,datasets:D}=n;a.useEffect(()=>{e.current=S,o.current=D,s.current===null&&(u.current=S,m.current=D)},[S,D]);const E=a.useCallback(()=>{f.current&&f.current(),f.current=null,s.current=null},[]),V=a.useCallback(async(g,b)=>{if(g.current===null)throw new Error("Element missing.");d(!0);try{E();const w={ast:!0,expr:ue,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,forceActionsMenu:!0},{vgSpec:y,view:R,finalize:T}=await fe(g.current,b,w);s.current=c(R),f.current=T;const p=Ne(o.current),C=p?Object.keys(p):[];if(C.length===1){const[v]=C;l.current=v}else C.length===0&&y.data&&(l.current=P);const O=Ee(e.current);if(O&&s.current.insert(l.current,O),p)for(const[v,G]of Object.entries(p))s.current.insert(v,G);return await s.current.runAsync(),await s.current.resize().runAsync(),u.current=e.current,m.current=o.current,s.current}finally{d(!1)}},[E,c]),N=a.useCallback((g,b,w,y)=>{if(!y||y.dimensions.numDataRows===0){try{g.remove(b,de)}catch{}return}if(!w||w.dimensions.numDataRows===0){g.insert(b,F(y));return}y.hash!==w.hash&&(g.data(b,F(y)),Te.info(`Had to clear the ${b} dataset before inserting data through Vega view.`))},[]),A=a.useCallback(async(g,b)=>{if(s.current===null||i)return null;const w=u.current,y=m.current;(w||g)&&N(s.current,l.current,w,g);const R=I(y)??{},T=I(b)??{};for(const[p,C]of Object.entries(T)){const O=p||l.current,v=R[O];N(s.current,O,v,C)}for(const p of Object.keys(R))!Object.hasOwn(T,p)&&p!==l.current&&N(s.current,p,null,null);return await s.current?.resize().runAsync(),u.current=g,m.current=b,s.current},[N,i]);return{createView:V,updateView:A,finalizeView:E}}function Ae(n){try{const t=typeof n=="string"?JSON.parse(n):n;return!!(t.facet||t.encoding?.row||t.encoding?.column||t.encoding?.facet)}catch{return!1}}function Re(n){try{const t=typeof n=="string"?JSON.parse(n):n;return!("vconcat"in t)||!Array.isArray(t.vconcat)?!1:t.vconcat.some(r=>r!==null&&typeof r=="object"&&("hconcat"in r||"vconcat"in r||"concat"in r||"layer"in r))}catch{return!1}}const xe=({disableFullscreenMode:n,element:t,fragmentId:r,widgetMgr:s,widthConfig:f,heightConfig:l})=>{const[u,m]=a.useState(!1),[e,o]=a.useState(!1),{expanded:i,height:d,width:c,expand:h,collapse:S}=q(ae),{width:D,height:E,elementRef:V}=ee([u]),N=te(f)||t.useContainerWidth,A=ne(l),g=Ae(t.spec),b=Re(t.spec),w=we(t,g?c??0:D,(i?d:E)??0,i&&!b?!0:N,i?!0:A),{createView:y,updateView:R,finalizeView:T}=ve(w,s,r),{data:p,datasets:C,spec:O}=w;if(a.useLayoutEffect(()=>(V.current!==null&&y(V,O),T),[y,T,O,c,d,u,V]),a.useEffect(()=>{R(p,C)},[p,C]),a.useEffect(()=>{p||C?.[0]?.data?o(!0):o(!1)},[p,C]),u){const v=d??(E>0?E:void 0);return x(ce,{data:p??C[0]?.data,height:v,width:f??void 0,customToolbarActions:[x(_,{label:"Show chart",icon:W,onClick:()=>{m(!1)}},"show-chart")]})}return se(H,{height:A?i?d:"100%":d,useContainerWidth:i?!0:N,children:[x(ie,{target:H,isFullScreen:i,onExpand:h,onCollapse:S,disableFullscreenMode:n,children:e&&x(_,{label:"Show data",icon:ge,onClick:()=>{m(!0)}})}),x(re,{styles:[me]}),x(pe,{"data-testid":"stVegaLiteChart",className:"stVegaLiteChart",useContainerWidth:N,useContainerHeight:A,ref:V})]})},Fe=oe(xe),rt=a.memo(Fe);export{me as StyledVegaLiteChartTooltips,J as applyStreamlitTheme,rt as default};