streamlit-nightly 1.41.2.dev20250106__py2.py3-none-any.whl → 1.41.2.dev20250108__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.
- streamlit/__init__.py +11 -2
- streamlit/__main__.py +1 -1
- streamlit/auth_util.py +209 -0
- streamlit/cli_util.py +1 -1
- streamlit/column_config.py +1 -1
- streamlit/commands/__init__.py +1 -1
- streamlit/commands/echo.py +1 -1
- streamlit/commands/execution_control.py +1 -1
- streamlit/commands/experimental_query_params.py +1 -1
- streamlit/commands/logo.py +1 -1
- streamlit/commands/navigation.py +1 -1
- streamlit/commands/page_config.py +1 -1
- streamlit/components/__init__.py +1 -1
- streamlit/components/lib/__init__.py +1 -1
- streamlit/components/lib/local_component_registry.py +1 -1
- streamlit/components/types/__init__.py +1 -1
- streamlit/components/types/base_component_registry.py +1 -1
- streamlit/components/types/base_custom_component.py +1 -1
- streamlit/components/v1/__init__.py +1 -1
- streamlit/components/v1/component_arrow.py +1 -1
- streamlit/components/v1/component_registry.py +1 -1
- streamlit/components/v1/components.py +1 -1
- streamlit/components/v1/custom_component.py +1 -1
- streamlit/config.py +1 -1
- streamlit/config_option.py +1 -1
- streamlit/config_util.py +1 -1
- streamlit/connections/__init__.py +1 -1
- streamlit/connections/base_connection.py +1 -1
- streamlit/connections/snowflake_connection.py +1 -1
- streamlit/connections/snowpark_connection.py +1 -1
- streamlit/connections/sql_connection.py +1 -1
- streamlit/connections/util.py +1 -1
- streamlit/cursor.py +1 -1
- streamlit/dataframe_util.py +1 -1
- streamlit/delta_generator.py +1 -1
- streamlit/delta_generator_singletons.py +1 -1
- streamlit/deprecation_util.py +1 -1
- streamlit/development.py +1 -1
- streamlit/elements/__init__.py +1 -1
- streamlit/elements/alert.py +1 -1
- streamlit/elements/arrow.py +1 -1
- streamlit/elements/balloons.py +1 -1
- streamlit/elements/bokeh_chart.py +1 -1
- streamlit/elements/code.py +1 -1
- streamlit/elements/deck_gl_json_chart.py +1 -1
- streamlit/elements/dialog_decorator.py +1 -1
- streamlit/elements/doc_string.py +1 -1
- streamlit/elements/empty.py +1 -1
- streamlit/elements/exception.py +1 -1
- streamlit/elements/form.py +1 -1
- streamlit/elements/graphviz_chart.py +1 -1
- streamlit/elements/heading.py +1 -1
- streamlit/elements/html.py +1 -1
- streamlit/elements/iframe.py +1 -1
- streamlit/elements/image.py +1 -1
- streamlit/elements/json.py +1 -1
- streamlit/elements/layouts.py +1 -1
- streamlit/elements/lib/__init__.py +1 -1
- streamlit/elements/lib/built_in_chart_utils.py +1 -1
- streamlit/elements/lib/color_util.py +1 -1
- streamlit/elements/lib/column_config_utils.py +1 -1
- streamlit/elements/lib/column_types.py +1 -1
- streamlit/elements/lib/dialog.py +1 -1
- streamlit/elements/lib/dicttools.py +1 -1
- streamlit/elements/lib/event_utils.py +1 -1
- streamlit/elements/lib/file_uploader_utils.py +1 -1
- streamlit/elements/lib/form_utils.py +1 -1
- streamlit/elements/lib/image_utils.py +1 -1
- streamlit/elements/lib/js_number.py +1 -1
- streamlit/elements/lib/mutable_status_container.py +1 -1
- streamlit/elements/lib/options_selector_utils.py +1 -1
- streamlit/elements/lib/pandas_styler_utils.py +1 -1
- streamlit/elements/lib/policies.py +1 -1
- streamlit/elements/lib/streamlit_plotly_theme.py +1 -1
- streamlit/elements/lib/subtitle_utils.py +1 -1
- streamlit/elements/lib/utils.py +1 -1
- streamlit/elements/map.py +1 -1
- streamlit/elements/markdown.py +3 -3
- streamlit/elements/media.py +1 -1
- streamlit/elements/metric.py +1 -1
- streamlit/elements/plotly_chart.py +1 -1
- streamlit/elements/progress.py +1 -1
- streamlit/elements/pyplot.py +1 -1
- streamlit/elements/snow.py +1 -1
- streamlit/elements/spinner.py +14 -7
- streamlit/elements/text.py +1 -1
- streamlit/elements/toast.py +1 -1
- streamlit/elements/vega_charts.py +1 -1
- streamlit/elements/widgets/__init__.py +1 -1
- streamlit/elements/widgets/audio_input.py +1 -1
- streamlit/elements/widgets/button.py +1 -1
- streamlit/elements/widgets/button_group.py +1 -1
- streamlit/elements/widgets/camera_input.py +1 -1
- streamlit/elements/widgets/chat.py +1 -1
- streamlit/elements/widgets/checkbox.py +1 -1
- streamlit/elements/widgets/color_picker.py +1 -1
- streamlit/elements/widgets/data_editor.py +1 -1
- streamlit/elements/widgets/file_uploader.py +1 -1
- streamlit/elements/widgets/multiselect.py +1 -1
- streamlit/elements/widgets/number_input.py +1 -1
- streamlit/elements/widgets/radio.py +1 -1
- streamlit/elements/widgets/select_slider.py +1 -1
- streamlit/elements/widgets/selectbox.py +1 -1
- streamlit/elements/widgets/slider.py +1 -1
- streamlit/elements/widgets/text_widgets.py +1 -1
- streamlit/elements/widgets/time_widgets.py +1 -1
- streamlit/elements/write.py +2 -2
- streamlit/emojis.py +1 -1
- streamlit/env_util.py +1 -1
- streamlit/error_util.py +1 -1
- streamlit/errors.py +5 -1
- streamlit/external/__init__.py +1 -1
- streamlit/external/langchain/__init__.py +1 -1
- streamlit/external/langchain/streamlit_callback_handler.py +1 -1
- streamlit/file_util.py +1 -1
- streamlit/git_util.py +1 -1
- streamlit/hello/__init__.py +1 -1
- streamlit/hello/animation_demo.py +1 -1
- streamlit/hello/dataframe_demo.py +1 -1
- streamlit/hello/hello.py +1 -1
- streamlit/hello/mapping_demo.py +1 -1
- streamlit/hello/plotting_demo.py +1 -1
- streamlit/hello/streamlit_app.py +1 -1
- streamlit/hello/utils.py +1 -1
- streamlit/logger.py +1 -1
- streamlit/material_icon_names.py +1 -1
- streamlit/navigation/__init__.py +1 -1
- streamlit/navigation/page.py +1 -1
- streamlit/net_util.py +1 -1
- streamlit/platform.py +1 -1
- streamlit/proto/Alert_pb2.pyi +1 -1
- streamlit/proto/AppPage_pb2.pyi +1 -1
- streamlit/proto/ArrowNamedDataSet_pb2.pyi +1 -1
- streamlit/proto/ArrowVegaLiteChart_pb2.pyi +1 -1
- streamlit/proto/Arrow_pb2.pyi +1 -1
- streamlit/proto/AudioInput_pb2.pyi +1 -1
- streamlit/proto/Audio_pb2.pyi +1 -1
- streamlit/proto/AuthRedirect_pb2.py +27 -0
- streamlit/proto/AuthRedirect_pb2.pyi +41 -0
- streamlit/proto/AutoRerun_pb2.pyi +1 -1
- streamlit/proto/BackMsg_pb2.pyi +1 -1
- streamlit/proto/Balloons_pb2.pyi +1 -1
- streamlit/proto/Block_pb2.pyi +1 -1
- streamlit/proto/BokehChart_pb2.pyi +1 -1
- streamlit/proto/ButtonGroup_pb2.pyi +1 -1
- streamlit/proto/Button_pb2.pyi +1 -1
- streamlit/proto/CameraInput_pb2.pyi +1 -1
- streamlit/proto/ChatInput_pb2.pyi +1 -1
- streamlit/proto/Checkbox_pb2.pyi +1 -1
- streamlit/proto/ClientState_pb2.pyi +1 -1
- streamlit/proto/Code_pb2.pyi +1 -1
- streamlit/proto/ColorPicker_pb2.pyi +1 -1
- streamlit/proto/Common_pb2.pyi +1 -1
- streamlit/proto/Components_pb2.pyi +1 -1
- streamlit/proto/DataFrame_pb2.pyi +1 -1
- streamlit/proto/DateInput_pb2.pyi +1 -1
- streamlit/proto/DeckGlJsonChart_pb2.pyi +1 -1
- streamlit/proto/Delta_pb2.pyi +1 -1
- streamlit/proto/DocString_pb2.pyi +1 -1
- streamlit/proto/DownloadButton_pb2.pyi +1 -1
- streamlit/proto/Element_pb2.pyi +1 -1
- streamlit/proto/Empty_pb2.pyi +1 -1
- streamlit/proto/Exception_pb2.pyi +1 -1
- streamlit/proto/Favicon_pb2.pyi +1 -1
- streamlit/proto/FileUploader_pb2.pyi +1 -1
- streamlit/proto/ForwardMsg_pb2.py +10 -9
- streamlit/proto/ForwardMsg_pb2.pyi +11 -4
- streamlit/proto/GitInfo_pb2.pyi +1 -1
- streamlit/proto/GraphVizChart_pb2.pyi +1 -1
- streamlit/proto/Heading_pb2.pyi +1 -1
- streamlit/proto/Html_pb2.pyi +1 -1
- streamlit/proto/IFrame_pb2.pyi +1 -1
- streamlit/proto/Image_pb2.pyi +1 -1
- streamlit/proto/Json_pb2.pyi +1 -1
- streamlit/proto/LabelVisibilityMessage_pb2.pyi +1 -1
- streamlit/proto/LinkButton_pb2.pyi +1 -1
- streamlit/proto/Logo_pb2.pyi +1 -1
- streamlit/proto/Markdown_pb2.pyi +1 -1
- streamlit/proto/Metric_pb2.pyi +1 -1
- streamlit/proto/MetricsEvent_pb2.pyi +1 -1
- streamlit/proto/MultiSelect_pb2.pyi +1 -1
- streamlit/proto/NamedDataSet_pb2.pyi +1 -1
- streamlit/proto/Navigation_pb2.pyi +1 -1
- streamlit/proto/NewSession_pb2.pyi +1 -1
- streamlit/proto/NumberInput_pb2.pyi +1 -1
- streamlit/proto/PageConfig_pb2.pyi +1 -1
- streamlit/proto/PageInfo_pb2.pyi +1 -1
- streamlit/proto/PageLink_pb2.pyi +1 -1
- streamlit/proto/PageNotFound_pb2.pyi +1 -1
- streamlit/proto/PageProfile_pb2.pyi +1 -1
- streamlit/proto/PagesChanged_pb2.pyi +1 -1
- streamlit/proto/ParentMessage_pb2.pyi +1 -1
- streamlit/proto/PlotlyChart_pb2.pyi +1 -1
- streamlit/proto/Progress_pb2.pyi +1 -1
- streamlit/proto/Radio_pb2.pyi +1 -1
- streamlit/proto/RootContainer_pb2.pyi +1 -1
- streamlit/proto/Selectbox_pb2.pyi +1 -1
- streamlit/proto/SessionEvent_pb2.pyi +1 -1
- streamlit/proto/SessionStatus_pb2.pyi +1 -1
- streamlit/proto/Skeleton_pb2.pyi +1 -1
- streamlit/proto/Slider_pb2.pyi +1 -1
- streamlit/proto/Snow_pb2.pyi +1 -1
- streamlit/proto/Spinner_pb2.py +2 -2
- streamlit/proto/Spinner_pb2.pyi +6 -2
- streamlit/proto/TextArea_pb2.pyi +1 -1
- streamlit/proto/TextInput_pb2.pyi +1 -1
- streamlit/proto/Text_pb2.pyi +1 -1
- streamlit/proto/TimeInput_pb2.pyi +1 -1
- streamlit/proto/Toast_pb2.pyi +1 -1
- streamlit/proto/VegaLiteChart_pb2.pyi +1 -1
- streamlit/proto/Video_pb2.pyi +1 -1
- streamlit/proto/WidgetStates_pb2.pyi +1 -1
- streamlit/proto/__init__.py +1 -1
- streamlit/runtime/__init__.py +1 -1
- streamlit/runtime/app_session.py +6 -2
- streamlit/runtime/caching/__init__.py +1 -1
- streamlit/runtime/caching/cache_data_api.py +1 -1
- streamlit/runtime/caching/cache_errors.py +1 -1
- streamlit/runtime/caching/cache_resource_api.py +1 -1
- streamlit/runtime/caching/cache_type.py +1 -1
- streamlit/runtime/caching/cache_utils.py +1 -1
- streamlit/runtime/caching/cached_message_replay.py +1 -1
- streamlit/runtime/caching/hashing.py +1 -1
- streamlit/runtime/caching/legacy_cache_api.py +1 -1
- streamlit/runtime/caching/storage/__init__.py +1 -1
- streamlit/runtime/caching/storage/cache_storage_protocol.py +1 -1
- streamlit/runtime/caching/storage/dummy_cache_storage.py +1 -1
- streamlit/runtime/caching/storage/in_memory_cache_storage_wrapper.py +1 -1
- streamlit/runtime/caching/storage/local_disk_cache_storage.py +1 -1
- streamlit/runtime/connection_factory.py +1 -1
- streamlit/runtime/context.py +1 -1
- streamlit/runtime/credentials.py +1 -1
- streamlit/runtime/forward_msg_cache.py +1 -1
- streamlit/runtime/forward_msg_queue.py +1 -1
- streamlit/runtime/fragment.py +1 -1
- streamlit/runtime/media_file_manager.py +1 -1
- streamlit/runtime/media_file_storage.py +1 -1
- streamlit/runtime/memory_media_file_storage.py +1 -1
- streamlit/runtime/memory_session_storage.py +1 -1
- streamlit/runtime/memory_uploaded_file_manager.py +1 -1
- streamlit/runtime/metrics_util.py +2 -1
- streamlit/runtime/pages_manager.py +1 -1
- streamlit/runtime/runtime.py +14 -3
- streamlit/runtime/runtime_util.py +1 -1
- streamlit/runtime/script_data.py +1 -1
- streamlit/runtime/scriptrunner/__init__.py +1 -1
- streamlit/runtime/scriptrunner/exec_code.py +1 -1
- streamlit/runtime/scriptrunner/magic.py +1 -1
- streamlit/runtime/scriptrunner/magic_funcs.py +1 -1
- streamlit/runtime/scriptrunner/script_cache.py +1 -1
- streamlit/runtime/scriptrunner/script_runner.py +18 -9
- streamlit/runtime/scriptrunner_utils/__init__.py +1 -1
- streamlit/runtime/scriptrunner_utils/exceptions.py +1 -1
- streamlit/runtime/scriptrunner_utils/script_requests.py +1 -1
- streamlit/runtime/scriptrunner_utils/script_run_context.py +2 -2
- streamlit/runtime/secrets.py +1 -1
- streamlit/runtime/session_manager.py +2 -2
- streamlit/runtime/state/__init__.py +1 -1
- streamlit/runtime/state/common.py +1 -1
- streamlit/runtime/state/query_params.py +1 -1
- streamlit/runtime/state/query_params_proxy.py +1 -1
- streamlit/runtime/state/safe_session_state.py +1 -1
- streamlit/runtime/state/session_state.py +1 -1
- streamlit/runtime/state/session_state_proxy.py +1 -1
- streamlit/runtime/state/widgets.py +1 -1
- streamlit/runtime/stats.py +1 -1
- streamlit/runtime/uploaded_file_manager.py +1 -1
- streamlit/runtime/websocket_session_manager.py +2 -2
- streamlit/source_util.py +1 -1
- streamlit/static/index.html +2 -2
- streamlit/static/static/js/{FileDownload.esm.BfiuyXfu.js → FileDownload.esm.CXWFIN7B.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.BIe6FN2Y.js → FormClearHelper.dauERNYc.js} +1 -1
- streamlit/static/static/js/{Hooks.CHslqKt4.js → Hooks.CqBCxxzg.js} +1 -1
- streamlit/static/static/js/{InputInstructions.BMT8dg5S.js → InputInstructions.Dm8zppD9.js} +1 -1
- streamlit/static/static/js/ProgressBar.CQTs8xxT.js +2 -0
- streamlit/static/static/js/RenderInPortalIfExists.BIVWPcSk.js +1 -0
- streamlit/static/static/js/Toolbar.D_9Mp69H.js +1 -0
- streamlit/static/static/js/{base-input.B1a61Ojd.js → base-input.JrivAGt5.js} +4 -4
- streamlit/static/static/js/{createSuper.DuLZrute.js → createSuper.BLkfEjg8.js} +1 -1
- streamlit/static/static/js/data-grid-overlay-editor.4d_NBoKr.js +1 -0
- streamlit/static/static/js/{downloader.BVrmPJui.js → downloader.i394ggfM.js} +1 -1
- streamlit/static/static/js/{es6.44cVHEXS.js → es6.BPf5kpFH.js} +2 -2
- streamlit/static/static/js/getPrototypeOf.DcAVjrh9.js +1 -0
- streamlit/static/static/js/{iframeResizer.contentWindow.Bd3a4rtP.js → iframeResizer.contentWindow.YDN8GVx9.js} +1 -1
- streamlit/static/static/js/index.57g5CAPC.js +1 -0
- streamlit/static/static/js/{index.C9YRT0fo.js → index.B3dyGG7q.js} +3 -3
- streamlit/static/static/js/index.B6GM885g.js +1 -0
- streamlit/static/static/js/{index.Q2CKSyfz.js → index.BB2p9KgS.js} +1 -1
- streamlit/static/static/js/index.BOBIcAmK.js +1 -0
- streamlit/static/static/js/index.B_o9A-oO.js +1 -0
- streamlit/static/static/js/index.BfABFd7-.js +3 -0
- streamlit/static/static/js/{index.D_cUCQty.js → index.BidgRpd5.js} +1 -1
- streamlit/static/static/js/index.Bj7LBigw.js +197 -0
- streamlit/static/static/js/{index.CIMJL36S.js → index.C-TBipT2.js} +2 -2
- streamlit/static/static/js/{index.0AR3jk4J.js → index.C4muCvfN.js} +1 -1
- streamlit/static/static/js/{index.CmHLY_aM.js → index.CAZAG6f3.js} +2 -2
- streamlit/static/static/js/index.CJlBME-_.js +1 -0
- streamlit/static/static/js/{index.6ZeP-L28.js → index.CMAjN-j5.js} +2 -2
- streamlit/static/static/js/index.CSmBE6cg.js +1 -0
- streamlit/static/static/js/index.CgkfCbvP.js +1 -0
- streamlit/static/static/js/index.D1CJOG3s.js +1 -0
- streamlit/static/static/js/index.D1qR2sOA.js +1 -0
- streamlit/static/static/js/index.D7EG5vd0.js +2 -0
- streamlit/static/static/js/index.DE-FOSSU.js +1 -0
- streamlit/static/static/js/{index.lvhOjMEi.js → index.DWU1GWqY.js} +1 -1
- streamlit/static/static/js/{index.BRjwQabs.js → index.D_bHPQ8s.js} +1 -1
- streamlit/static/static/js/{index.CkxcnfCr.js → index.DalTq5GL.js} +1 -1
- streamlit/static/static/js/index.Df7nX4KF.js +1 -0
- streamlit/static/static/js/index.DgOwxLz5.js +4 -0
- streamlit/static/static/js/{index.BfjxH33Q.js → index.DmHQeMtj.js} +1 -1
- streamlit/static/static/js/index.DsKBnIk-.js +201 -0
- streamlit/static/static/js/{index.3p3iyxFl.js → index.DxsOgtLc.js} +11 -11
- streamlit/static/static/js/index.DyNkf5tM.js +1 -0
- streamlit/static/static/js/{index.C-fIpagH.js → index.Dz6VQ3qN.js} +2 -2
- streamlit/static/static/js/{index.vp4vsBFK.js → index.HktO7F0v.js} +112 -112
- streamlit/static/static/js/{index.CzhhqwJO.js → index.PriAkdhw.js} +1 -1
- streamlit/static/static/js/{index.PqkLl1t0.js → index.SKaK1lYU.js} +2 -2
- streamlit/static/static/js/index.V5OLP0n7.js +1 -0
- streamlit/static/static/js/index.YfuWGKrN.js +1 -0
- streamlit/static/static/js/index.g_BxiUns.js +1 -0
- streamlit/static/static/js/{index.3qE-vjOX.js → index.kc3Ycvjj.js} +34 -34
- streamlit/static/static/js/{input.mrdmFJfU.js → input.CqdNsSbL.js} +2 -2
- streamlit/static/static/js/{memory.BjfNr0ig.js → memory.Bkvk-eRa.js} +1 -1
- streamlit/static/static/js/mergeWith.DtsbyD6H.js +1 -0
- streamlit/static/static/js/number-overlay-editor.CR4D4kK1.js +9 -0
- streamlit/static/static/js/{sandbox.oLnJKv78.js → sandbox.C5M8yw5Z.js} +1 -1
- streamlit/static/static/js/{slicedToArray.BzQ82qu6.js → slicedToArray.BL5-s74J.js} +1 -1
- streamlit/static/static/js/{textarea.Da3YV5aR.js → textarea.DrGlWUDC.js} +2 -2
- streamlit/static/static/js/threshold.B8r8f5kt.js +1 -0
- streamlit/static/static/js/{timepicker.BAT5exrW.js → timepicker.Bdf2lGHx.js} +1 -1
- streamlit/static/static/js/timer.RueuYoQV.js +1 -0
- streamlit/static/static/js/{uniqueId.C8z92sBf.js → uniqueId.LGvQ35eR.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.CH5oDGQl.js → useBasicWidgetState.TTzKcGCs.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.Bo325HzD.js → useOnInputChange.ChvkrwHU.js} +1 -1
- streamlit/static/static/js/value.iufjd77T.js +1 -0
- streamlit/static/static/js/withFullScreenWrapper.ChQqb1TZ.js +1 -0
- streamlit/string_util.py +1 -1
- streamlit/temporary_directory.py +1 -1
- streamlit/testing/__init__.py +1 -1
- streamlit/testing/v1/__init__.py +1 -1
- streamlit/testing/v1/app_test.py +1 -1
- streamlit/testing/v1/element_tree.py +1 -1
- streamlit/testing/v1/local_script_runner.py +1 -1
- streamlit/testing/v1/util.py +1 -1
- streamlit/time_util.py +1 -1
- streamlit/type_util.py +2 -2
- streamlit/url_util.py +24 -1
- streamlit/user_info.py +94 -27
- streamlit/util.py +1 -1
- streamlit/version.py +1 -1
- streamlit/watcher/__init__.py +1 -1
- streamlit/watcher/event_based_path_watcher.py +1 -1
- streamlit/watcher/folder_black_list.py +1 -1
- streamlit/watcher/local_sources_watcher.py +1 -1
- streamlit/watcher/path_watcher.py +1 -1
- streamlit/watcher/polling_path_watcher.py +1 -1
- streamlit/watcher/util.py +1 -1
- streamlit/web/__init__.py +1 -1
- streamlit/web/bootstrap.py +1 -1
- streamlit/web/cache_storage_manager_config.py +1 -1
- streamlit/web/cli.py +1 -1
- streamlit/web/server/__init__.py +1 -1
- streamlit/web/server/app_static_file_handler.py +1 -1
- streamlit/web/server/authlib_tornado_integration.py +58 -0
- streamlit/web/server/browser_websocket_handler.py +72 -6
- streamlit/web/server/component_request_handler.py +1 -1
- streamlit/web/server/media_file_handler.py +1 -1
- streamlit/web/server/oauth_authlib_routes.py +176 -0
- streamlit/web/server/oidc_mixin.py +108 -0
- streamlit/web/server/routes.py +6 -4
- streamlit/web/server/server.py +41 -4
- streamlit/web/server/server_util.py +25 -1
- streamlit/web/server/stats_request_handler.py +1 -1
- streamlit/web/server/upload_file_request_handler.py +3 -2
- streamlit/web/server/websocket_headers.py +1 -1
- {streamlit_nightly-1.41.2.dev20250106.data → streamlit_nightly-1.41.2.dev20250108.data}/scripts/streamlit.cmd +1 -1
- {streamlit_nightly-1.41.2.dev20250106.dist-info → streamlit_nightly-1.41.2.dev20250108.dist-info}/METADATA +14 -2
- streamlit_nightly-1.41.2.dev20250108.dist-info/RECORD +562 -0
- {streamlit_nightly-1.41.2.dev20250106.dist-info → streamlit_nightly-1.41.2.dev20250108.dist-info}/WHEEL +1 -1
- streamlit/static/static/js/ProgressBar.VmrIzSqo.js +0 -2
- streamlit/static/static/js/RenderInPortalIfExists.B2NAzO0r.js +0 -1
- streamlit/static/static/js/Toolbar.DbmFapWn.js +0 -1
- streamlit/static/static/js/_commonjs-dynamic-modules.TDtrdbi3.js +0 -1
- streamlit/static/static/js/data-grid-overlay-editor.BkcxIt6O.js +0 -1
- streamlit/static/static/js/getPrototypeOf.bvOEi7fo.js +0 -1
- streamlit/static/static/js/index.1fq50cer.js +0 -4
- streamlit/static/static/js/index.75EUE6su.js +0 -1
- streamlit/static/static/js/index.8Bq56lcM.js +0 -1
- streamlit/static/static/js/index.BF04V0db.js +0 -1
- streamlit/static/static/js/index.BSgVnwxN.js +0 -1
- streamlit/static/static/js/index.B_nF-WE5.js +0 -1
- streamlit/static/static/js/index.BdfmpndH.js +0 -1
- streamlit/static/static/js/index.C3rcPpxm.js +0 -2
- streamlit/static/static/js/index.CgSymxeL.js +0 -201
- streamlit/static/static/js/index.D277ro6Y.js +0 -1
- streamlit/static/static/js/index.D6WGxtqm.js +0 -1
- streamlit/static/static/js/index.DaJKYvsa.js +0 -197
- streamlit/static/static/js/index.GNEDK2sZ.js +0 -1
- streamlit/static/static/js/index.KOla1gMY.js +0 -1
- streamlit/static/static/js/index.KmZ5vhVN.js +0 -32
- streamlit/static/static/js/index.KnCHOP8N.js +0 -1
- streamlit/static/static/js/index.SOQTU-r_.js +0 -1
- streamlit/static/static/js/index.WrhWPW-4.js +0 -1
- streamlit/static/static/js/index.dgKFPPrX.js +0 -1
- streamlit/static/static/js/index.drbticTq.js +0 -1
- streamlit/static/static/js/number-overlay-editor.WosTCRC_.js +0 -9
- streamlit/static/static/js/string.Bl9OLDCw.js +0 -1
- streamlit/static/static/js/threshold.skajmqVB.js +0 -1
- streamlit/static/static/js/timer.DwZfkapc.js +0 -1
- streamlit/static/static/js/withFullScreenWrapper.C7zDWu4g.js +0 -1
- streamlit_nightly-1.41.2.dev20250106.dist-info/RECORD +0 -556
- {streamlit_nightly-1.41.2.dev20250106.dist-info → streamlit_nightly-1.41.2.dev20250108.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.41.2.dev20250106.dist-info → streamlit_nightly-1.41.2.dev20250108.dist-info}/top_level.txt +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
function qn(n){return Math.abs(n=Math.round(n))>=1e21?n.toLocaleString("en").replace(/,/g,""):n.toString(10)}function T(n,e){if((r=(n=e?n.toExponential(e-1):n.toExponential()).indexOf("e"))<0)return null;var r,t=n.slice(0,r);return[t.length>1?t[0]+t.slice(2):t,+n.slice(r+1)]}function zn(n){return n=T(Math.abs(n)),n?n[1]:NaN}function Cn(n,e){return function(r,t){for(var i=r.length,a=[],f=0,o=n[0],u=0;i>0&&o>0&&(u+o+1>t&&(o=Math.max(1,t-u)),a.push(r.substring(i-=o,i+o)),!((u+=o+1)>t));)o=n[f=(f+1)%n.length];return a.reverse().join(e)}}function In(n){return function(e){return e.replace(/[0-9]/g,function(r){return n[+r]})}}var _n=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Z(n){if(!(e=_n.exec(n)))throw new Error("invalid format: "+n);var e;return new Q({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Z.prototype=Q.prototype;function Q(n){this.fill=n.fill===void 0?" ":n.fill+"",this.align=n.align===void 0?">":n.align+"",this.sign=n.sign===void 0?"-":n.sign+"",this.symbol=n.symbol===void 0?"":n.symbol+"",this.zero=!!n.zero,this.width=n.width===void 0?void 0:+n.width,this.comma=!!n.comma,this.precision=n.precision===void 0?void 0:+n.precision,this.trim=!!n.trim,this.type=n.type===void 0?"":n.type+""}Q.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Dn(n){n:for(var e=n.length,r=1,t=-1,i;r<e;++r)switch(n[r]){case".":t=i=r;break;case"0":t===0&&(t=r),i=r;break;default:if(!+n[r])break n;t>0&&(t=0);break}return t>0?n.slice(0,t)+n.slice(i+1):n}var yn;function Ln(n,e){var r=T(n,e);if(!r)return n+"";var t=r[0],i=r[1],a=i-(yn=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,f=t.length;return a===f?t:a>f?t+new Array(a-f+1).join("0"):a>0?t.slice(0,a)+"."+t.slice(a):"0."+new Array(1-a).join("0")+T(n,Math.max(0,e+a-1))[0]}function fn(n,e){var r=T(n,e);if(!r)return n+"";var t=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+t:t.length>i+1?t.slice(0,i+1)+"."+t.slice(i+1):t+new Array(i-t.length+2).join("0")}const an={"%":(n,e)=>(n*100).toFixed(e),b:n=>Math.round(n).toString(2),c:n=>n+"",d:qn,e:(n,e)=>n.toExponential(e),f:(n,e)=>n.toFixed(e),g:(n,e)=>n.toPrecision(e),o:n=>Math.round(n).toString(8),p:(n,e)=>fn(n*100,e),r:fn,s:Ln,X:n=>Math.round(n).toString(16).toUpperCase(),x:n=>Math.round(n).toString(16)};function on(n){return n}var sn=Array.prototype.map,un=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function On(n){var e=n.grouping===void 0||n.thousands===void 0?on:Cn(sn.call(n.grouping,Number),n.thousands+""),r=n.currency===void 0?"":n.currency[0]+"",t=n.currency===void 0?"":n.currency[1]+"",i=n.decimal===void 0?".":n.decimal+"",a=n.numerals===void 0?on:In(sn.call(n.numerals,String)),f=n.percent===void 0?"%":n.percent+"",o=n.minus===void 0?"−":n.minus+"",u=n.nan===void 0?"NaN":n.nan+"";function N(c){c=Z(c);var R=c.fill,S=c.align,m=c.sign,H=c.symbol,k=c.zero,E=c.width,X=c.comma,y=c.precision,nn=c.trim,x=c.type;x==="n"?(X=!0,x="g"):an[x]||(y===void 0&&(y=12),nn=!0,x="g"),(k||R==="0"&&S==="=")&&(k=!0,R="0",S="=");var En=H==="$"?r:H==="#"&&/[boxX]/.test(x)?"0"+x.toLowerCase():"",Pn=H==="$"?t:/[%p]/.test(x)?f:"",en=an[x],jn=/[defgprs%]/.test(x);y=y===void 0?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y));function rn(s){var w=En,d=Pn,v,tn,C;if(x==="c")d=en(s)+d,s="";else{s=+s;var I=s<0||1/s<0;if(s=isNaN(s)?u:en(Math.abs(s),y),nn&&(s=Dn(s)),I&&+s==0&&m!=="+"&&(I=!1),w=(I?m==="("?m:o:m==="-"||m==="("?"":m)+w,d=(x==="s"?un[8+yn/3]:"")+d+(I&&m==="("?")":""),jn){for(v=-1,tn=s.length;++v<tn;)if(C=s.charCodeAt(v),48>C||C>57){d=(C===46?i+s.slice(v+1):s.slice(v))+d,s=s.slice(0,v);break}}}X&&!k&&(s=e(s,1/0));var _=w.length+s.length+d.length,p=_<E?new Array(E-_+1).join(R):"";switch(X&&k&&(s=e(p+s,p.length?E-d.length:1/0),p=""),S){case"<":s=w+s+d+p;break;case"=":s=w+p+s+d;break;case"^":s=p.slice(0,_=p.length>>1)+w+s+d+p.slice(_);break;default:s=p+w+s+d;break}return a(s)}return rn.toString=function(){return c+""},rn}function g(c,R){var S=N((c=Z(c),c.type="f",c)),m=Math.max(-8,Math.min(8,Math.floor(zn(R)/3)))*3,H=Math.pow(10,-m),k=un[8+m/3];return function(E){return S(H*E)+k}}return{format:N,formatPrefix:g}}var D,Tn,Bn;Fn({thousands:",",grouping:[3],currency:["$",""]});function Fn(n){return D=On(n),Tn=D.format,Bn=D.formatPrefix,D}function W(n,e,r){n.prototype=e.prototype=r,r.constructor=n}function wn(n,e){var r=Object.create(n.prototype);for(var t in e)r[t]=e[t];return r}function z(){}var P=.7,B=1/P,A="\\s*([+-]?\\d+)\\s*",j="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",b="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Gn=/^#([0-9a-f]{3,8})$/,Vn=new RegExp(`^rgb\\(${A},${A},${A}\\)$`),Xn=new RegExp(`^rgb\\(${b},${b},${b}\\)$`),Un=new RegExp(`^rgba\\(${A},${A},${A},${j}\\)$`),Yn=new RegExp(`^rgba\\(${b},${b},${b},${j}\\)$`),Zn=new RegExp(`^hsl\\(${j},${b},${b}\\)$`),Jn=new RegExp(`^hsla\\(${j},${b},${b},${j}\\)$`),cn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};W(z,q,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:hn,formatHex:hn,formatHex8:Kn,formatHsl:Qn,formatRgb:xn,toString:xn});function hn(){return this.rgb().formatHex()}function Kn(){return this.rgb().formatHex8()}function Qn(){return $n(this).formatHsl()}function xn(){return this.rgb().formatRgb()}function q(n){var e,r;return n=(n+"").trim().toLowerCase(),(e=Gn.exec(n))?(r=e[1].length,e=parseInt(e[1],16),r===6?dn(e):r===3?new h(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?L(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?L(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Vn.exec(n))?new h(e[1],e[2],e[3],1):(e=Xn.exec(n))?new h(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Un.exec(n))?L(e[1],e[2],e[3],e[4]):(e=Yn.exec(n))?L(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Zn.exec(n))?mn(e[1],e[2]/100,e[3]/100,1):(e=Jn.exec(n))?mn(e[1],e[2]/100,e[3]/100,e[4]):cn.hasOwnProperty(n)?dn(cn[n]):n==="transparent"?new h(NaN,NaN,NaN,0):null}function dn(n){return new h(n>>16&255,n>>8&255,n&255,1)}function L(n,e,r,t){return t<=0&&(n=e=r=NaN),new h(n,e,r,t)}function Wn(n){return n instanceof z||(n=q(n)),n?(n=n.rgb(),new h(n.r,n.g,n.b,n.opacity)):new h}function F(n,e,r,t){return arguments.length===1?Wn(n):new h(n,e,r,t??1)}function h(n,e,r,t){this.r=+n,this.g=+e,this.b=+r,this.opacity=+t}W(h,F,wn(z,{brighter(n){return n=n==null?B:Math.pow(B,n),new h(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?P:Math.pow(P,n),new h(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new h(M(this.r),M(this.g),M(this.b),G(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ln,formatHex:ln,formatHex8:ne,formatRgb:gn,toString:gn}));function ln(){return`#${$(this.r)}${$(this.g)}${$(this.b)}`}function ne(){return`#${$(this.r)}${$(this.g)}${$(this.b)}${$((isNaN(this.opacity)?1:this.opacity)*255)}`}function gn(){const n=G(this.opacity);return`${n===1?"rgb(":"rgba("}${M(this.r)}, ${M(this.g)}, ${M(this.b)}${n===1?")":`, ${n})`}`}function G(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function M(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function $(n){return n=M(n),(n<16?"0":"")+n.toString(16)}function mn(n,e,r,t){return t<=0?n=e=r=NaN:r<=0||r>=1?n=e=NaN:e<=0&&(n=NaN),new l(n,e,r,t)}function $n(n){if(n instanceof l)return new l(n.h,n.s,n.l,n.opacity);if(n instanceof z||(n=q(n)),!n)return new l;if(n instanceof l)return n;n=n.rgb();var e=n.r/255,r=n.g/255,t=n.b/255,i=Math.min(e,r,t),a=Math.max(e,r,t),f=NaN,o=a-i,u=(a+i)/2;return o?(e===a?f=(r-t)/o+(r<t)*6:r===a?f=(t-e)/o+2:f=(e-r)/o+4,o/=u<.5?a+i:2-a-i,f*=60):o=u>0&&u<1?0:f,new l(f,o,u,n.opacity)}function ee(n,e,r,t){return arguments.length===1?$n(n):new l(n,e,r,t??1)}function l(n,e,r,t){this.h=+n,this.s=+e,this.l=+r,this.opacity=+t}W(l,ee,wn(z,{brighter(n){return n=n==null?B:Math.pow(B,n),new l(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?P:Math.pow(P,n),new l(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,e=isNaN(n)||isNaN(this.s)?0:this.s,r=this.l,t=r+(r<.5?r:1-r)*e,i=2*r-t;return new h(U(n>=240?n-240:n+120,i,t),U(n,i,t),U(n<120?n+240:n-120,i,t),this.opacity)},clamp(){return new l(bn(this.h),O(this.s),O(this.l),G(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const n=G(this.opacity);return`${n===1?"hsl(":"hsla("}${bn(this.h)}, ${O(this.s)*100}%, ${O(this.l)*100}%${n===1?")":`, ${n})`}`}}));function bn(n){return n=(n||0)%360,n<0?n+360:n}function O(n){return Math.max(0,Math.min(1,n||0))}function U(n,e,r){return(n<60?e+(r-e)*n/60:n<180?r:n<240?e+(r-e)*(240-n)/60:e)*255}function Mn(n,e,r,t,i){var a=n*n,f=a*n;return((1-3*n+3*a-f)*e+(4-6*a+3*f)*r+(1+3*n+3*a-3*f)*t+f*i)/6}function re(n){var e=n.length-1;return function(r){var t=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),i=n[t],a=n[t+1],f=t>0?n[t-1]:2*i-a,o=t<e-1?n[t+2]:2*a-i;return Mn((r-t/e)*e,f,i,a,o)}}function te(n){var e=n.length;return function(r){var t=Math.floor(((r%=1)<0?++r:r)*e),i=n[(t+e-1)%e],a=n[t%e],f=n[(t+1)%e],o=n[(t+2)%e];return Mn((r-t/e)*e,i,a,f,o)}}const V=n=>()=>n;function Nn(n,e){return function(r){return n+r*e}}function ie(n,e,r){return n=Math.pow(n,r),e=Math.pow(e,r)-n,r=1/r,function(t){return Math.pow(n+t*e,r)}}function he(n,e){var r=e-n;return r?Nn(n,r>180||r<-180?r-360*Math.round(r/360):r):V(isNaN(n)?e:n)}function fe(n){return(n=+n)==1?kn:function(e,r){return r-e?ie(e,r,n):V(isNaN(e)?r:e)}}function kn(n,e){var r=e-n;return r?Nn(n,r):V(isNaN(n)?e:n)}const pn=function n(e){var r=fe(e);function t(i,a){var f=r((i=F(i)).r,(a=F(a)).r),o=r(i.g,a.g),u=r(i.b,a.b),N=kn(i.opacity,a.opacity);return function(g){return i.r=f(g),i.g=o(g),i.b=u(g),i.opacity=N(g),i+""}}return t.gamma=n,t}(1);function vn(n){return function(e){var r=e.length,t=new Array(r),i=new Array(r),a=new Array(r),f,o;for(f=0;f<r;++f)o=F(e[f]),t[f]=o.r||0,i[f]=o.g||0,a[f]=o.b||0;return t=n(t),i=n(i),a=n(a),o.opacity=1,function(u){return o.r=t(u),o.g=i(u),o.b=a(u),o+""}}}var xe=vn(re),de=vn(te);function An(n,e){e||(e=[]);var r=n?Math.min(e.length,n.length):0,t=e.slice(),i;return function(a){for(i=0;i<r;++i)t[i]=n[i]*(1-a)+e[i]*a;return t}}function Rn(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function le(n,e){return(Rn(e)?An:Sn)(n,e)}function Sn(n,e){var r=e?e.length:0,t=n?Math.min(r,n.length):0,i=new Array(t),a=new Array(r),f;for(f=0;f<t;++f)i[f]=Hn(n[f],e[f]);for(;f<r;++f)a[f]=e[f];return function(o){for(f=0;f<t;++f)a[f]=i[f](o);return a}}function ae(n,e){var r=new Date;return n=+n,e=+e,function(t){return r.setTime(n*(1-t)+e*t),r}}function J(n,e){return n=+n,e=+e,function(r){return n*(1-r)+e*r}}function oe(n,e){var r={},t={},i;(n===null||typeof n!="object")&&(n={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in n?r[i]=Hn(n[i],e[i]):t[i]=e[i];return function(a){for(i in r)t[i]=r[i](a);return t}}var K=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Y=new RegExp(K.source,"g");function se(n){return function(){return n}}function ue(n){return function(e){return n(e)+""}}function ce(n,e){var r=K.lastIndex=Y.lastIndex=0,t,i,a,f=-1,o=[],u=[];for(n=n+"",e=e+"";(t=K.exec(n))&&(i=Y.exec(e));)(a=i.index)>r&&(a=e.slice(r,a),o[f]?o[f]+=a:o[++f]=a),(t=t[0])===(i=i[0])?o[f]?o[f]+=i:o[++f]=i:(o[++f]=null,u.push({i:f,x:J(t,i)})),r=Y.lastIndex;return r<e.length&&(a=e.slice(r),o[f]?o[f]+=a:o[++f]=a),o.length<2?u[0]?ue(u[0].x):se(e):(e=u.length,function(N){for(var g=0,c;g<e;++g)o[(c=u[g]).i]=c.x(N);return o.join("")})}function Hn(n,e){var r=typeof e,t;return e==null||r==="boolean"?V(e):(r==="number"?J:r==="string"?(t=q(e))?(e=t,pn):ce:e instanceof q?pn:e instanceof Date?ae:Rn(e)?An:Array.isArray(e)?Sn:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?oe:J)(n,e)}export{q as A,z as C,h as R,Z as a,Tn as b,Bn as c,W as d,wn as e,On as f,B as g,P as h,he as i,ee as j,Hn as k,le as l,re as m,kn as n,te as o,ae as p,J as q,Wn as r,An as s,oe as t,pn as u,xe as v,de as w,ce as x,F as y,zn as z};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{n as m,r as n,al as x,b2 as p,a0 as y,j as i,aK as C}from"./index.kc3Ycvjj.js";const h=m("div",{target:"e16xbog60"})(({theme:e,isExpanded:t})=>({...t?{position:"fixed",top:0,left:0,bottom:0,right:0,background:e.colors.bgColor,zIndex:e.zIndices.fullscreenWrapper,padding:e.spacing.md,paddingTop:e.sizes.fullScreenHeaderHeight,overflow:["auto","overlay"],display:"flex",alignItems:"center",justifyContent:"center"}:{}})),f=n.createContext(null);f.displayName="ElementFullscreenContext";const w=e=>{const t=n.useContext(e);if(t==null)throw new Error(`useRequiredContext: ${e.displayName??"context"} not found`);return t},b=()=>{const{setFullScreen:e}=n.useContext(x),[t,s]=n.useState(!1),{fullHeight:d,fullWidth:o}=w(p),l=n.useCallback(u=>{s(u),e(u)},[e]),c=n.useCallback(()=>{document.body.style.overflow="hidden",l(!0)},[l]),r=n.useCallback(()=>{document.body.style.overflow="unset",l(!1)},[l]),a=n.useCallback(u=>{u.keyCode===27&&t&&r()},[r,t]);return n.useEffect(()=>(document.addEventListener("keydown",a,!1),()=>{document.removeEventListener("keydown",a,!1)}),[a]),n.useMemo(()=>({expanded:t,zoomIn:c,zoomOut:r,fullHeight:d,fullWidth:o}),[t,c,r,d,o])},g=({children:e,height:t,width:s})=>{const d=y(),{expanded:o,fullHeight:l,fullWidth:c,zoomIn:r,zoomOut:a}=b(),u=n.useMemo(()=>({width:o?c:s,height:o?l:t,expanded:o,expand:r,collapse:a}),[o,l,c,t,s,r,a]);return i(f.Provider,{value:u,children:i(h,{isExpanded:o,"data-testid":"stFullScreenFrame",theme:d,children:e})})};function S(e){const t=s=>i(g,{width:s.width,children:i(e,{...s})});return t.displayName=`withFullScreenWrapper(${e.displayName||e.name})`,C(t,e)}export{f as E,w as u,S as w};
|
streamlit/string_util.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
streamlit/temporary_directory.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
streamlit/testing/__init__.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
streamlit/testing/v1/__init__.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
streamlit/testing/v1/app_test.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
streamlit/testing/v1/util.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
streamlit/time_util.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
streamlit/type_util.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -167,7 +167,7 @@ def to_bytes(obj: BytesLike) -> bytes:
|
|
167
167
|
_SYMPY_RE: Final = re.compile(r"^sympy.*$")
|
168
168
|
|
169
169
|
|
170
|
-
def
|
170
|
+
def is_sympy_expression(obj: object) -> TypeGuard[sympy.Expr]:
|
171
171
|
"""True if input is a SymPy expression."""
|
172
172
|
if not is_type(obj, _SYMPY_RE):
|
173
173
|
return False
|
streamlit/url_util.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -97,3 +97,26 @@ def is_url(
|
|
97
97
|
except ValueError:
|
98
98
|
return False
|
99
99
|
return False
|
100
|
+
|
101
|
+
|
102
|
+
def make_url_path(base_url: str, path: str) -> str:
|
103
|
+
"""Make a URL from a base URL and a path.
|
104
|
+
|
105
|
+
Parameters
|
106
|
+
----------
|
107
|
+
base_url : str
|
108
|
+
The base URL.
|
109
|
+
path : str
|
110
|
+
The path to append to the base URL.
|
111
|
+
|
112
|
+
Returns
|
113
|
+
-------
|
114
|
+
str
|
115
|
+
The resulting URL.
|
116
|
+
"""
|
117
|
+
base_url = base_url.strip("/")
|
118
|
+
if base_url:
|
119
|
+
base_url = "/" + base_url
|
120
|
+
|
121
|
+
path = path.lstrip("/")
|
122
|
+
return f"{base_url}/{path}"
|
streamlit/user_info.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -14,62 +14,129 @@
|
|
14
14
|
|
15
15
|
from __future__ import annotations
|
16
16
|
|
17
|
-
from typing import
|
17
|
+
from typing import (
|
18
|
+
TYPE_CHECKING,
|
19
|
+
Final,
|
20
|
+
Iterator,
|
21
|
+
Mapping,
|
22
|
+
NoReturn,
|
23
|
+
Union,
|
24
|
+
)
|
18
25
|
|
19
|
-
from streamlit
|
26
|
+
from streamlit import config, runtime
|
27
|
+
from streamlit.auth_util import (
|
28
|
+
encode_provider_token,
|
29
|
+
get_secrets_auth_section,
|
30
|
+
is_authlib_installed,
|
31
|
+
validate_auth_credentials,
|
32
|
+
)
|
33
|
+
from streamlit.errors import StreamlitAPIException, StreamlitAuthError
|
34
|
+
from streamlit.proto.ForwardMsg_pb2 import ForwardMsg
|
35
|
+
from streamlit.runtime.metrics_util import gather_metrics
|
20
36
|
from streamlit.runtime.scriptrunner_utils.script_run_context import (
|
21
37
|
get_script_run_ctx as _get_script_run_ctx,
|
22
38
|
)
|
39
|
+
from streamlit.url_util import make_url_path
|
23
40
|
|
24
41
|
if TYPE_CHECKING:
|
25
42
|
from streamlit.runtime.scriptrunner_utils.script_run_context import UserInfo
|
26
43
|
|
27
44
|
|
45
|
+
AUTH_LOGIN_ENDPOINT: Final = "/auth/login"
|
46
|
+
AUTH_LOGOUT_ENDPOINT: Final = "/auth/logout"
|
47
|
+
|
48
|
+
|
49
|
+
@gather_metrics("login")
|
50
|
+
def login(provider: str | None = None) -> None:
|
51
|
+
"""Initiate the login for the given provider.
|
52
|
+
|
53
|
+
Parameters
|
54
|
+
----------
|
55
|
+
provider : str or None
|
56
|
+
The provider to use for login. This value must match the name of a
|
57
|
+
provider configured in the app's auth section of ``secrets.toml`` file.
|
58
|
+
If None, the default provider in the auth section will be used.
|
59
|
+
"""
|
60
|
+
if provider is None:
|
61
|
+
provider = "default"
|
62
|
+
|
63
|
+
context = _get_script_run_ctx()
|
64
|
+
if context is not None:
|
65
|
+
if not is_authlib_installed():
|
66
|
+
raise StreamlitAuthError(
|
67
|
+
"""To use authentication features, you need to install """
|
68
|
+
"""Authlib>=1.3.2, e.g. via `pip install Authlib`."""
|
69
|
+
)
|
70
|
+
validate_auth_credentials(provider)
|
71
|
+
fwd_msg = ForwardMsg()
|
72
|
+
fwd_msg.auth_redirect.url = generate_login_redirect_url(provider)
|
73
|
+
context.enqueue(fwd_msg)
|
74
|
+
|
75
|
+
|
76
|
+
@gather_metrics("logout")
|
77
|
+
def logout() -> None:
|
78
|
+
"""Logout the current user."""
|
79
|
+
context = _get_script_run_ctx()
|
80
|
+
if context is not None:
|
81
|
+
context.user_info.clear()
|
82
|
+
session_id = context.session_id
|
83
|
+
|
84
|
+
if runtime.exists():
|
85
|
+
instance = runtime.get_instance()
|
86
|
+
instance.clear_user_info_for_session(session_id)
|
87
|
+
|
88
|
+
base_path = config.get_option("server.baseUrlPath")
|
89
|
+
|
90
|
+
fwd_msg = ForwardMsg()
|
91
|
+
fwd_msg.auth_redirect.url = make_url_path(base_path, AUTH_LOGOUT_ENDPOINT)
|
92
|
+
context.enqueue(fwd_msg)
|
93
|
+
|
94
|
+
|
95
|
+
def generate_login_redirect_url(provider: str) -> str:
|
96
|
+
"""Generate the login redirect URL for the given provider."""
|
97
|
+
provider_token = encode_provider_token(provider)
|
98
|
+
base_path = config.get_option("server.baseUrlPath")
|
99
|
+
login_path = make_url_path(base_path, AUTH_LOGIN_ENDPOINT)
|
100
|
+
return f"{login_path}?provider={provider_token}"
|
101
|
+
|
102
|
+
|
28
103
|
def _get_user_info() -> UserInfo:
|
29
104
|
ctx = _get_script_run_ctx()
|
30
105
|
if ctx is None:
|
31
106
|
# TODO: Add appropriate warnings when ctx is missing
|
32
107
|
return {}
|
33
|
-
|
108
|
+
context_user_info = ctx.user_info.copy()
|
109
|
+
|
110
|
+
auth_section_exists = get_secrets_auth_section()
|
111
|
+
if "is_logged_in" not in context_user_info and auth_section_exists:
|
112
|
+
context_user_info["is_logged_in"] = False
|
113
|
+
return context_user_info
|
34
114
|
|
35
115
|
|
36
|
-
class UserInfoProxy(Mapping[str, Union[str, None]]):
|
116
|
+
class UserInfoProxy(Mapping[str, Union[str, bool, None]]):
|
37
117
|
"""
|
38
118
|
A read-only, dict-like object for accessing information about current user.
|
39
119
|
|
40
|
-
``st.experimental_user`` is
|
120
|
+
``st.experimental_user`` is dependent on the host platform running the
|
41
121
|
Streamlit app. If the host platform has not configured the function, it
|
42
122
|
will behave as it does in a locally running app.
|
43
123
|
|
44
|
-
Properties can
|
124
|
+
Properties can be accessed via key or attribute notation. For example,
|
45
125
|
``st.experimental_user["email"]`` or ``st.experimental_user.email``.
|
46
126
|
|
47
|
-
Attributes
|
48
|
-
----------
|
49
|
-
email : str
|
50
|
-
If running locally, this property returns the string literal
|
51
|
-
``"test@example.com"``.
|
52
|
-
|
53
|
-
If running on Streamlit Community Cloud, this
|
54
|
-
property returns one of two values:
|
55
|
-
|
56
|
-
- ``None`` if the user is not logged in or not a member of the app's\
|
57
|
-
workspace. Such users appear under anonymous pseudonyms in the app's\
|
58
|
-
analytics.
|
59
|
-
- The user's email if the the user is logged in and a member of the\
|
60
|
-
app's workspace. Such users are identified by their email in the app's\
|
61
|
-
analytics.
|
62
|
-
|
63
127
|
"""
|
64
128
|
|
65
|
-
def __getitem__(self, key: str) -> str | None:
|
66
|
-
|
129
|
+
def __getitem__(self, key: str) -> str | bool | None:
|
130
|
+
try:
|
131
|
+
return _get_user_info()[key]
|
132
|
+
except KeyError:
|
133
|
+
raise KeyError(f'st.experimental_user has no key "{key}".')
|
67
134
|
|
68
|
-
def __getattr__(self, key: str) -> str | None:
|
135
|
+
def __getattr__(self, key: str) -> str | bool | None:
|
69
136
|
try:
|
70
137
|
return _get_user_info()[key]
|
71
138
|
except KeyError:
|
72
|
-
raise AttributeError
|
139
|
+
raise AttributeError(f'st.experimental_user has no attribute "{key}".')
|
73
140
|
|
74
141
|
def __setattr__(self, name: str, value: str | None) -> NoReturn:
|
75
142
|
raise StreamlitAPIException("st.experimental_user cannot be modified")
|
streamlit/util.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
streamlit/version.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
streamlit/watcher/__init__.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
streamlit/watcher/util.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
streamlit/web/__init__.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
streamlit/web/bootstrap.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
streamlit/web/cli.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
streamlit/web/server/__init__.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
|
17
|
+
from typing import TYPE_CHECKING, Any, Sequence
|
18
|
+
|
19
|
+
from authlib.integrations.base_client import ( # type: ignore[import-untyped]
|
20
|
+
FrameworkIntegration,
|
21
|
+
)
|
22
|
+
|
23
|
+
from streamlit.runtime.secrets import AttrDict
|
24
|
+
|
25
|
+
if TYPE_CHECKING:
|
26
|
+
from streamlit.web.server.oidc_mixin import TornadoOAuth
|
27
|
+
|
28
|
+
|
29
|
+
class TornadoIntegration(FrameworkIntegration): # type: ignore[misc]
|
30
|
+
def update_token(self, token, refresh_token=None, access_token=None):
|
31
|
+
"""We do not support access token refresh, since we obtain and operate only on
|
32
|
+
identity tokens. We override this method explicitly to implement all abstract
|
33
|
+
methods of base class.
|
34
|
+
"""
|
35
|
+
|
36
|
+
@staticmethod
|
37
|
+
def load_config(
|
38
|
+
oauth: TornadoOAuth, name: str, params: Sequence[str]
|
39
|
+
) -> dict[str, Any]:
|
40
|
+
"""Configure Authlib integration with provider parameters
|
41
|
+
specified in secrets.toml
|
42
|
+
"""
|
43
|
+
|
44
|
+
# oauth.config here is an auth section from secrets.toml
|
45
|
+
# We parse it here to transform nested AttrDict (for client_kwargs value)
|
46
|
+
# to dict so Authlib can work with it under the hood.
|
47
|
+
if not oauth.config:
|
48
|
+
return {}
|
49
|
+
|
50
|
+
prepared_config = {}
|
51
|
+
for key in params:
|
52
|
+
value = oauth.config.get(name, {}).get(key, None)
|
53
|
+
if isinstance(value, AttrDict):
|
54
|
+
# We want to modify client_kwargs further after loading server metadata
|
55
|
+
value = value.to_dict()
|
56
|
+
if value is not None:
|
57
|
+
prepared_config[key] = value
|
58
|
+
return prepared_config
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -16,14 +16,17 @@ from __future__ import annotations
|
|
16
16
|
|
17
17
|
import base64
|
18
18
|
import binascii
|
19
|
+
import hmac
|
19
20
|
import json
|
20
21
|
from typing import TYPE_CHECKING, Any, Awaitable, Final
|
22
|
+
from urllib.parse import urlparse
|
21
23
|
|
22
24
|
import tornado.concurrent
|
23
25
|
import tornado.locks
|
24
26
|
import tornado.netutil
|
25
27
|
import tornado.web
|
26
28
|
import tornado.websocket
|
29
|
+
from tornado.escape import utf8
|
27
30
|
from tornado.websocket import WebSocketHandler
|
28
31
|
|
29
32
|
from streamlit import config
|
@@ -31,7 +34,11 @@ from streamlit.logger import get_logger
|
|
31
34
|
from streamlit.proto.BackMsg_pb2 import BackMsg
|
32
35
|
from streamlit.runtime import Runtime, SessionClient, SessionClientDisconnectedError
|
33
36
|
from streamlit.runtime.runtime_util import serialize_forward_msg
|
34
|
-
from streamlit.web.server.server_util import
|
37
|
+
from streamlit.web.server.server_util import (
|
38
|
+
AUTH_COOKIE_NAME,
|
39
|
+
is_url_from_allowed_origins,
|
40
|
+
is_xsrf_enabled,
|
41
|
+
)
|
35
42
|
|
36
43
|
if TYPE_CHECKING:
|
37
44
|
from streamlit.proto.ForwardMsg_pb2 import ForwardMsg
|
@@ -50,13 +57,63 @@ class BrowserWebSocketHandler(WebSocketHandler, SessionClient):
|
|
50
57
|
# need to read the self.xsrf_token manually to set the cookie as a side
|
51
58
|
# effect. See https://www.tornadoweb.org/en/stable/guide/security.html#cross-site-request-forgery-protection
|
52
59
|
# for more details.
|
53
|
-
if
|
60
|
+
if is_xsrf_enabled():
|
54
61
|
_ = self.xsrf_token
|
55
62
|
|
63
|
+
def get_signed_cookie(
|
64
|
+
self,
|
65
|
+
name: str,
|
66
|
+
value: str | None = None,
|
67
|
+
max_age_days: float = 31,
|
68
|
+
min_version: int | None = None,
|
69
|
+
) -> bytes | None:
|
70
|
+
"""Get a signed cookie from the request. Added for compatibility with
|
71
|
+
Tornado < 6.3.0.
|
72
|
+
See release notes: https://www.tornadoweb.org/en/stable/releases/v6.3.0.html#deprecation-notices
|
73
|
+
"""
|
74
|
+
try:
|
75
|
+
return super().get_signed_cookie(name, value, max_age_days, min_version)
|
76
|
+
except AttributeError:
|
77
|
+
return super().get_secure_cookie(name, value, max_age_days, min_version)
|
78
|
+
|
56
79
|
def check_origin(self, origin: str) -> bool:
|
57
80
|
"""Set up CORS."""
|
58
81
|
return super().check_origin(origin) or is_url_from_allowed_origins(origin)
|
59
82
|
|
83
|
+
def _validate_xsrf_token(self, supplied_token: str) -> bool:
|
84
|
+
"""Inspired by tornado.web.RequestHandler.check_xsrf_cookie method,
|
85
|
+
to check the XSRF token passed in Websocket connection header.
|
86
|
+
"""
|
87
|
+
_, token, _ = self._decode_xsrf_token(supplied_token)
|
88
|
+
_, expected_token, _ = self._get_raw_xsrf_token()
|
89
|
+
|
90
|
+
decoded_token = utf8(token)
|
91
|
+
decoded_expected_token = utf8(expected_token)
|
92
|
+
|
93
|
+
if not decoded_token or not decoded_expected_token:
|
94
|
+
return False
|
95
|
+
return hmac.compare_digest(decoded_token, decoded_expected_token)
|
96
|
+
|
97
|
+
def _parse_user_cookie(self, raw_cookie_value: bytes, email: str) -> dict[str, Any]:
|
98
|
+
"""Process the user cookie and extract the user info after
|
99
|
+
validating the origin. Origin is validated for security reasons.
|
100
|
+
"""
|
101
|
+
cookie_value = json.loads(raw_cookie_value)
|
102
|
+
user_info = {}
|
103
|
+
|
104
|
+
cookie_value_origin = cookie_value.get("origin", None)
|
105
|
+
parsed_origin_from_header = urlparse(self.request.headers["Origin"])
|
106
|
+
expected_origin_value = (
|
107
|
+
parsed_origin_from_header.scheme + "://" + parsed_origin_from_header.netloc
|
108
|
+
)
|
109
|
+
if cookie_value_origin == expected_origin_value:
|
110
|
+
user_info["is_logged_in"] = cookie_value.get("is_logged_in", False)
|
111
|
+
del cookie_value["origin"]
|
112
|
+
del cookie_value["is_logged_in"]
|
113
|
+
user_info.update(cookie_value)
|
114
|
+
|
115
|
+
return user_info
|
116
|
+
|
60
117
|
def write_forward_msg(self, msg: ForwardMsg) -> None:
|
61
118
|
"""Send a ForwardMsg to the browser."""
|
62
119
|
try:
|
@@ -102,11 +159,13 @@ class BrowserWebSocketHandler(WebSocketHandler, SessionClient):
|
|
102
159
|
is_public_cloud_app = user_obj["isPublicCloudApp"]
|
103
160
|
except (KeyError, binascii.Error, json.decoder.JSONDecodeError):
|
104
161
|
email = "test@example.com"
|
105
|
-
|
106
|
-
|
107
|
-
"email": None if is_public_cloud_app else email
|
162
|
+
user_info: dict[str, str | bool | None] = {
|
163
|
+
"email": None if is_public_cloud_app else email,
|
108
164
|
}
|
109
165
|
|
166
|
+
if is_public_cloud_app or email == "test@example.com":
|
167
|
+
user_info.pop("email", None)
|
168
|
+
|
110
169
|
existing_session_id = None
|
111
170
|
try:
|
112
171
|
ws_protocols = [
|
@@ -114,6 +173,13 @@ class BrowserWebSocketHandler(WebSocketHandler, SessionClient):
|
|
114
173
|
for p in self.request.headers["Sec-Websocket-Protocol"].split(",")
|
115
174
|
]
|
116
175
|
|
176
|
+
raw_cookie_value = self.get_signed_cookie(AUTH_COOKIE_NAME)
|
177
|
+
if is_xsrf_enabled() and raw_cookie_value:
|
178
|
+
csrf_protocol_value = ws_protocols[1]
|
179
|
+
|
180
|
+
if self._validate_xsrf_token(csrf_protocol_value):
|
181
|
+
user_info.update(self._parse_user_cookie(raw_cookie_value, email))
|
182
|
+
|
117
183
|
if len(ws_protocols) >= 3:
|
118
184
|
# See the NOTE in the docstring of the `select_subprotocol` method above
|
119
185
|
# for a detailed explanation of why this is done.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-
|
1
|
+
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|