streamlit-nightly 1.35.1.dev20240605__py2.py3-none-any.whl → 1.35.1.dev20240607__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/version.py CHANGED
@@ -12,105 +12,7 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- """Streamlit version utilities."""
16
-
17
- from __future__ import annotations
18
-
19
- import random
20
15
  from importlib.metadata import version as _version
21
- from typing import TYPE_CHECKING, Final
22
-
23
- import streamlit.logger as logger
24
-
25
- if TYPE_CHECKING:
26
- from packaging.version import Version
27
-
28
-
29
- _LOGGER: Final = logger.get_logger(__name__)
30
-
31
- PYPI_STREAMLIT_URL = "https://pypi.org/pypi/streamlit/json"
32
-
33
- # Probability that we'll make a network call to PyPI to check
34
- # the latest version of streamlit. This is used each time
35
- # should_show_new_version_notice() is called.
36
- CHECK_PYPI_PROBABILITY = 0.10
16
+ from typing import Final
37
17
 
38
18
  STREAMLIT_VERSION_STRING: Final[str] = _version("streamlit-nightly")
39
-
40
-
41
- def _version_str_to_obj(version_str: str) -> Version:
42
- from packaging.version import Version
43
-
44
- return Version(version_str)
45
-
46
-
47
- def _get_installed_streamlit_version() -> Version:
48
- """Return the streamlit version string from setup.py.
49
-
50
- Returns
51
- -------
52
- str
53
- The version string specified in setup.py.
54
-
55
- """
56
- return _version_str_to_obj(STREAMLIT_VERSION_STRING)
57
-
58
-
59
- def _get_latest_streamlit_version(timeout: float | None = None) -> Version:
60
- """Request the latest streamlit version string from PyPI.
61
-
62
- NB: this involves a network call, so it could raise an error
63
- or take a long time.
64
-
65
- Parameters
66
- ----------
67
- timeout : float or None
68
- The request timeout.
69
-
70
- Returns
71
- -------
72
- str
73
- The version string for the latest version of streamlit
74
- on PyPI.
75
-
76
- """
77
- import requests
78
-
79
- rsp = requests.get(PYPI_STREAMLIT_URL, timeout=timeout)
80
- try:
81
- version_str = rsp.json()["info"]["version"]
82
- except Exception as e:
83
- raise RuntimeError("Got unexpected response from PyPI", e)
84
- return _version_str_to_obj(version_str)
85
-
86
-
87
- def should_show_new_version_notice() -> bool:
88
- """True if streamlit should show a 'new version!' notice to the user.
89
-
90
- We need to make a network call to PyPI to determine the latest streamlit
91
- version. Since we don't want to do this every time streamlit is run,
92
- we'll only perform the check ~5% of the time.
93
-
94
- If we do make the request to PyPI and there's any sort of error,
95
- we log it and return False.
96
-
97
- Returns
98
- -------
99
- bool
100
- True if we should tell the user that their streamlit is out of date.
101
-
102
- """
103
- if random.random() >= CHECK_PYPI_PROBABILITY:
104
- # We don't check PyPI every time this function is called.
105
- _LOGGER.debug("Skipping PyPI version check")
106
- return False
107
-
108
- try:
109
- installed_version = _get_installed_streamlit_version()
110
- latest_version = _get_latest_streamlit_version(timeout=1)
111
- except Exception as ex:
112
- # Log this as a debug. We don't care if the user sees it.
113
- _LOGGER.debug("Failed PyPI version check.", exc_info=ex)
114
- return False
115
-
116
- return latest_version > installed_version
@@ -20,16 +20,7 @@ import signal
20
20
  import sys
21
21
  from typing import Any, Final
22
22
 
23
- from streamlit import (
24
- cli_util,
25
- config,
26
- env_util,
27
- file_util,
28
- net_util,
29
- secrets,
30
- util,
31
- version,
32
- )
23
+ from streamlit import cli_util, config, env_util, file_util, net_util, secrets, util
33
24
  from streamlit.config import CONFIG_FILENAMES
34
25
  from streamlit.git_util import MIN_GIT_VERSION, GitRepo
35
26
  from streamlit.logger import get_logger
@@ -115,7 +106,6 @@ def _on_server_start(server: Server) -> None:
115
106
  _maybe_print_static_folder_warning(server.main_script_path)
116
107
  _print_url(server.is_running_hello)
117
108
  report_watchdog_availability()
118
- _print_new_version_message()
119
109
 
120
110
  # Load secrets.toml if it exists. If the file doesn't exist, this
121
111
  # function will return without raising an exception. We catch any parse
@@ -177,27 +167,6 @@ def _fix_pydantic_duplicate_validators_error():
177
167
  pass
178
168
 
179
169
 
180
- def _print_new_version_message() -> None:
181
- if version.should_show_new_version_notice():
182
- NEW_VERSION_TEXT: Final = """
183
- %(new_version)s
184
-
185
- See what's new at https://discuss.streamlit.io/c/announcements
186
-
187
- Enter the following command to upgrade:
188
- %(prompt)s %(command)s
189
- """ % {
190
- "new_version": cli_util.style_for_cli(
191
- "A new version of Streamlit is available.", fg="blue", bold=True
192
- ),
193
- "prompt": cli_util.style_for_cli("$", fg="blue"),
194
- "command": cli_util.style_for_cli(
195
- "pip install streamlit --upgrade", bold=True
196
- ),
197
- }
198
- cli_util.print_to_cli(NEW_VERSION_TEXT)
199
-
200
-
201
170
  def _maybe_print_static_folder_warning(main_script_path: str) -> None:
202
171
  """Prints a warning if the static folder is misconfigured."""
203
172
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: streamlit-nightly
3
- Version: 1.35.1.dev20240605
3
+ Version: 1.35.1.dev20240607
4
4
  Summary: A faster way to build and share data apps
5
5
  Home-page: https://streamlit.io
6
6
  Author: Snowflake Inc
@@ -35,12 +35,12 @@ streamlit/type_util.py,sha256=5374ScbHXZBGkk5SRPFASjdJGqCvPy3Kf05COj8keKM,48623
35
35
  streamlit/url_util.py,sha256=iU1lpZhzW4ZjhjBhSdw39OzixnThIsxhXpDP-ZIgUT8,3019
36
36
  streamlit/user_info.py,sha256=dqNEEanUVJDLhn4cTmeFG1iUfSQFDWuMQjjQHmDtE6I,3472
37
37
  streamlit/util.py,sha256=5fna6hGM_WBZugMjzIXqqFD41JrFL3QBicfcAmjyefw,6379
38
- streamlit/version.py,sha256=pXGa4A8rovFisSPMpfTkw8U85VIhnxriooj6bHVjTfY,3478
38
+ streamlit/version.py,sha256=dAqFbNh-ln7p47GRRDVHuqag-JZUYpMe47uqFxVb7Tw,763
39
39
  streamlit/commands/__init__.py,sha256=Vrf1yVMOcTyhUPnYvsfyeL96Vpd5z8KoSV5ZzTcTQgU,616
40
40
  streamlit/commands/execution_control.py,sha256=H2Xb9ou_9nXmusEcK0ZuE0ct8StuE50Hse9Tm0T1r-I,5711
41
41
  streamlit/commands/experimental_query_params.py,sha256=hMWuWJPIlebWhlEZbrwPSLtAfSx3gSke8_nU39-EKIc,5042
42
42
  streamlit/commands/logo.py,sha256=4ORzbCGwo7Vm3qnHU4ZoofAy7z1o6JHGzfM4yAUrNMQ,5733
43
- streamlit/commands/navigation.py,sha256=IXRmXbds7s_U9ydQwCOQeDfaKNSiss6Oy_qeC0Nx2yQ,6809
43
+ streamlit/commands/navigation.py,sha256=1OR7hptjOZzkZiDuVi0_6D9F2fByVjylo8X7a5jXKDE,6969
44
44
  streamlit/commands/page_config.py,sha256=FJXZ4MvNlgeVC3QUmE9vagHSfTvHaXoBxuXTuJrVSog,12997
45
45
  streamlit/components/__init__.py,sha256=Vrf1yVMOcTyhUPnYvsfyeL96Vpd5z8KoSV5ZzTcTQgU,616
46
46
  streamlit/components/lib/__init__.py,sha256=Vrf1yVMOcTyhUPnYvsfyeL96Vpd5z8KoSV5ZzTcTQgU,616
@@ -122,7 +122,7 @@ streamlit/elements/widgets/text_widgets.py,sha256=U-YI4KFisa8gHQx0-CPP0Qf3IVPP2S
122
122
  streamlit/elements/widgets/time_widgets.py,sha256=-UT4HSWuBdjLf6QxQpsUmnvA4wGG2G-05siOOMkHWJQ,30210
123
123
  streamlit/external/__init__.py,sha256=Vrf1yVMOcTyhUPnYvsfyeL96Vpd5z8KoSV5ZzTcTQgU,616
124
124
  streamlit/external/langchain/__init__.py,sha256=sAzaNf4Cje3cJikPBVvF7pj1sEdEvUfKIEY_Z6Zk8cA,814
125
- streamlit/external/langchain/streamlit_callback_handler.py,sha256=kKrusABDJ__KaA_mPnTxumSSYKQjYExaQsoMlELZZGI,15280
125
+ streamlit/external/langchain/streamlit_callback_handler.py,sha256=Q4RRYmYOj4zJjvM7aP8OCqSM7w9SHwfHP7dg9S0QGmA,15301
126
126
  streamlit/hello/Animation_Demo.py,sha256=mPOpPBO1Qf--5XewoZjsaQAp_0xnzjJLKxrgZQw8QjI,2956
127
127
  streamlit/hello/Dataframe_Demo.py,sha256=G0c3h04Kk8sHcY63AIKHcCWLSqoZiHTFgjGGRAOGCN8,2527
128
128
  streamlit/hello/Hello.py,sha256=dNr74BkA5j_nTDd0ikgPmKHuWGuTN2eB-4Q2_TiaO6k,1528
@@ -298,8 +298,8 @@ streamlit/runtime/media_file_storage.py,sha256=hQkMC__XRjshEUD73QCSrX3vrfOOO0U7V
298
298
  streamlit/runtime/memory_media_file_storage.py,sha256=voiscKQAwKdhIExlsnCaZDRKrKso2yU7KlA92Cgqu2M,6331
299
299
  streamlit/runtime/memory_session_storage.py,sha256=Tx-_3oUg6i9UokpBUIWvqhpWE0WmjtX764KdOzNvDMs,2940
300
300
  streamlit/runtime/memory_uploaded_file_manager.py,sha256=rCLvdZv2nPlWeCiHnwV8phcVV43mUCgW7BaWkmEXgpM,4422
301
- streamlit/runtime/metrics_util.py,sha256=FduQ5SReNI9-QK02rRPs4SAPI3usMsiG3QIAf2qmI-Q,14329
302
- streamlit/runtime/pages_manager.py,sha256=O5R5HHHj5bqa2SlzI1tX6hlI9YKZrX_zP9e9ltUDpPs,14053
301
+ streamlit/runtime/metrics_util.py,sha256=RZc2L3vLXCJspt6TOwoE7hc2kmI5Rm60w6DgZo06M_Y,15187
302
+ streamlit/runtime/pages_manager.py,sha256=pNzWS-PharoPg_d6XlS2IHWO7OXdH10yBjzyQ3gN5DI,14229
303
303
  streamlit/runtime/runtime.py,sha256=WXVV-rFTrtCNXYK_7Kv78jY2LQYc_0NrKC-cm6yYoxM,29318
304
304
  streamlit/runtime/runtime_util.py,sha256=FxOnGmLQWA9eEIWbNe1_l69XZrDGI51swJ4K_vekY9w,4192
305
305
  streamlit/runtime/script_data.py,sha256=-sBITUF0U7DIDL5LE_nFpXAvjnEfiJ9J3HAnnqML9ds,1749
@@ -328,18 +328,18 @@ streamlit/runtime/scriptrunner/magic_funcs.py,sha256=_npS_w-0riPNr1-dPyOSjqrwTXo
328
328
  streamlit/runtime/scriptrunner/script_cache.py,sha256=ZpaB4T50_GYfhMc2dajSMXWCmS3kaUJ_tPHNVt_flBg,2856
329
329
  streamlit/runtime/scriptrunner/script_requests.py,sha256=oGSvQ12To4eWX3Rp5edbBkWTFcyxKTIa0HPQnh_m-bw,8027
330
330
  streamlit/runtime/scriptrunner/script_run_context.py,sha256=QMLDZzKLXBacUfsTyYsqMl7dYT18DWqs3v-ScPvX9-U,9256
331
- streamlit/runtime/scriptrunner/script_runner.py,sha256=p6OdHmCj71LhgZqrBL94rXpl3FsYA9juSpTjh3UW4qU,29067
331
+ streamlit/runtime/scriptrunner/script_runner.py,sha256=-_Drfvyi6rAohVH6uuBevoERXphRssMFMszjVtvKJ_A,29512
332
332
  streamlit/runtime/state/__init__.py,sha256=UpfNfPrWJ6rVdD-qc0IP_bwZ4MrcNUjyU9wEKDK-eWM,1528
333
333
  streamlit/runtime/state/common.py,sha256=LtbQPRCz1ZOuomX_tjvz-rgiMxQKQO22wN4JBcc8b98,8171
334
334
  streamlit/runtime/state/query_params.py,sha256=cESFE1Jq4oN6YpgocUsX0f1sSHMyGRoupbxm9X6v3NM,7477
335
335
  streamlit/runtime/state/query_params_proxy.py,sha256=gRv8cXDQkKT2IJ5xQ_uSecDOkcsI_Y7VcudCxnO2BEg,7192
336
336
  streamlit/runtime/state/safe_session_state.py,sha256=StGh9V-tm7MCfohgw5FFfwz8tDwwHLeucXAN-lLLObg,5169
337
- streamlit/runtime/state/session_state.py,sha256=jOIrZD94Cn1wrLdPZIcMYPxiGK1gbus1pD4FXSYp4Q4,27500
337
+ streamlit/runtime/state/session_state.py,sha256=JOV9Nb-_nMJ4c6Av5ZeVFAy2qgN_ja00x_TJPSMMhy4,27399
338
338
  streamlit/runtime/state/session_state_proxy.py,sha256=vg1w054kfdO77fZUgPcHz4A47ghy6hZdp_c6A4ExNIs,5469
339
339
  streamlit/runtime/state/widgets.py,sha256=8uRQgUNZILuL9VNLs_ttdaMggVznj9Yw7Zc0Nva8Xt8,11343
340
- streamlit/static/asset-manifest.json,sha256=LOrkXXDD1a7B16ou1hio3YJQwqxgfYw28-KyimX8KbA,14353
340
+ streamlit/static/asset-manifest.json,sha256=pc3OgiFYGnqoDmdxPf8-qnUlZbc4l8bZe1AN5ABnYjo,14353
341
341
  streamlit/static/favicon.png,sha256=if5cVgw7azxKOvV5FpGixga7JLn23rfnHcy1CdWI1-E,1019
342
- streamlit/static/index.html,sha256=-qXgOBfbtC2EWT-J2BRpM7gwE8x97TYhiYqd5X21B9Y,891
342
+ streamlit/static/index.html,sha256=ufj1aJfeJTVftPJqOatAqGPbK8XOcn3aqmUIYGMQxb4,891
343
343
  streamlit/static/static/css/3466.8b8f33d6.chunk.css,sha256=4m2lbj1eVFXSaGCRBHZNhqyRz-4Ce9KogjJPxIq6On8,33275
344
344
  streamlit/static/static/css/5441.e3b876c5.chunk.css,sha256=XExLUUHInaWJp_m8TtBWhQ88SUuxZl6Jnnw5NA6rwI4,2633
345
345
  streamlit/static/static/css/8148.49dfd2ce.chunk.css,sha256=LjBHDWjz8Hi0dr3DH9ujdlw4E2llc0xdDQHR64H4NQ8,12090
@@ -376,7 +376,7 @@ streamlit/static/static/js/474.7eb0c6cd.chunk.js,sha256=dLMpCe2EfprzI2KdcoJtsKN5
376
376
  streamlit/static/static/js/5106.44f0ff51.chunk.js,sha256=aAGpqRrzVOlFHqBopYM2GLt9qcZ9h3fRxgFcuJ16nZw,7161
377
377
  streamlit/static/static/js/5249.f2f4070d.chunk.js,sha256=UYr_sBnftyILGh3k5zbw6FTT48T2_TJmiz2jVYFUAmg,2263616
378
378
  streamlit/static/static/js/5345.73d26e5d.chunk.js,sha256=22lINwDLHPN_xtCEcBrOh89IC2S2Jzz-3JIFVw1Pu-8,15117
379
- streamlit/static/static/js/5441.87f335e6.chunk.js,sha256=JMBSESXN1cS7yKsWHQe6QxY4IKSvghse8sDTYvsbKv8,14566
379
+ streamlit/static/static/js/5441.324eb9ab.chunk.js,sha256=8S7ayNcijFPRZoOMP6XjA2LbA8JSaKtsYSu1MmOXWFs,14480
380
380
  streamlit/static/static/js/5791.9a42fb4b.chunk.js,sha256=6j7S1fDfB321ibbChH0lWkP3W2iNCCdJEPhtC-S9STM,107585
381
381
  streamlit/static/static/js/6013.f6083314.chunk.js,sha256=3NackSU4ICPBBIsSvwl37sRET8hsC5vOYRfieHgsjB8,11602
382
382
  streamlit/static/static/js/6405.ac5a6f23.chunk.js,sha256=u7b4I7WVspIbm8eKcgMs2L0aTG3f414AHrJtDsHfwSU,13239
@@ -407,8 +407,8 @@ streamlit/static/static/js/9656.8c935274.chunk.js,sha256=3VB6NT0EQErJUX2SYLQpmNA
407
407
  streamlit/static/static/js/9865.fd93213d.chunk.js,sha256=Ul2N951ZrAXpJOWo4SV4AKlymjMMNPJxpea3uRt8B_Y,4011
408
408
  streamlit/static/static/js/9945.47d54f35.chunk.js,sha256=hhr3CT-A7_nboARJ6yPmoB69w1mljn8GzMnsyu-moZg,398776
409
409
  streamlit/static/static/js/9945.47d54f35.chunk.js.LICENSE.txt,sha256=6s4mSSf8NHGJqUCFAj3VgMXZuNYyAzshKRhvxYZTQoU,281
410
- streamlit/static/static/js/main.343fe878.js,sha256=0GuPvdSiNi5JQZNKXHlYyOfXHIiLnCoyo7L_FqvAWEQ,4422043
411
- streamlit/static/static/js/main.343fe878.js.LICENSE.txt,sha256=YTeqT7R6idssTgnyi3gf0tRiq18-LiPeDOpsWcnbi34,3184
410
+ streamlit/static/static/js/main.dc75074b.js,sha256=AjuivZRoHndC50M8fLxV_4cZ7hF1-NxpCeWGZ3f0oFY,4422045
411
+ streamlit/static/static/js/main.dc75074b.js.LICENSE.txt,sha256=YTeqT7R6idssTgnyi3gf0tRiq18-LiPeDOpsWcnbi34,3184
412
412
  streamlit/static/static/media/KaTeX_AMS-Regular.73ea273a72f4aca30ca5.woff2,sha256=DN04fJWQoan5eUVgAi27WWVKfYbxh6oMgUla1C06cwg,28076
413
413
  streamlit/static/static/media/KaTeX_AMS-Regular.853be92419a6c3766b9a.ttf,sha256=aFNIQLz90r_7bw6N60hoTdAefwTqKBMmdXevuQbeHRM,63632
414
414
  streamlit/static/static/media/KaTeX_AMS-Regular.d562e886c52f12660a41.woff,sha256=MNqR6EyJP4deJSaJ-uvcWQsocRReitx_mp1NvYzgslE,33516
@@ -513,7 +513,7 @@ streamlit/watcher/path_watcher.py,sha256=hFc_6FhLHsdbgVRFNJiyelJX3bX_rPvN-PQcgEZ
513
513
  streamlit/watcher/polling_path_watcher.py,sha256=VwQ06abbvHSIuvR66YpFDx9ANhrzTmoQylKqSjUosFE,3822
514
514
  streamlit/watcher/util.py,sha256=uDsWPxQ8WLNQ4U_MCqWm38H7BEjSrBpPsIZj1ySK8KM,5203
515
515
  streamlit/web/__init__.py,sha256=Vrf1yVMOcTyhUPnYvsfyeL96Vpd5z8KoSV5ZzTcTQgU,616
516
- streamlit/web/bootstrap.py,sha256=Pr9wj1WKdkqqwwgwpLROuvPc4kIcotOM0I1wqehAbWc,13715
516
+ streamlit/web/bootstrap.py,sha256=WfGaWDF_fVodx0guHkkiPW5I2kjCgTInDRe6gwJ9aqU,12955
517
517
  streamlit/web/cache_storage_manager_config.py,sha256=0Zr3Kzkj5m5ggzGijZnW50ffo9rTiEdpbqCco_F9kCo,1158
518
518
  streamlit/web/cli.py,sha256=b_COETlDfiTTFPZI24DD_0qLsEj7qvPYy6dqKdaQBaM,11050
519
519
  streamlit/web/server/__init__.py,sha256=w4TFcV0OjM5zx8ej7oThRIyB6gq3kqdt45XBk1zkRWo,1080
@@ -527,9 +527,9 @@ streamlit/web/server/server_util.py,sha256=FptUF-CjFh78VjeTQDi3R78m7E64MDe3wcklg
527
527
  streamlit/web/server/stats_request_handler.py,sha256=cL__KbJFIhdhf1Zt6skbLehUqT-jo56x1HARxogZDOI,3680
528
528
  streamlit/web/server/upload_file_request_handler.py,sha256=YPDmKWUnaGH9d4QNcMEsY5k1YIz_q-xW1K5fmgHaDzc,4966
529
529
  streamlit/web/server/websocket_headers.py,sha256=07SkWLcOxbyldl7UcBzrMKY9ZojypCQACiKoh5FcH7Y,1870
530
- streamlit_nightly-1.35.1.dev20240605.data/scripts/streamlit.cmd,sha256=ZEYM3vBJSp-k7vwSJ3ba5NzEk9-qHdSeLvGYAAe1mMw,676
531
- streamlit_nightly-1.35.1.dev20240605.dist-info/METADATA,sha256=53XKCSDma-muLYfknMJ0zmGhcvs6_0mdQZPxngTz9jM,8527
532
- streamlit_nightly-1.35.1.dev20240605.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
533
- streamlit_nightly-1.35.1.dev20240605.dist-info/entry_points.txt,sha256=uNJ4DwGNXEhOK0USwSNanjkYyR-Bk7eYQbJFDrWyOgY,53
534
- streamlit_nightly-1.35.1.dev20240605.dist-info/top_level.txt,sha256=V3FhKbm7G2LnR0s4SytavrjIPNIhvcsAGXfYHAwtQzw,10
535
- streamlit_nightly-1.35.1.dev20240605.dist-info/RECORD,,
530
+ streamlit_nightly-1.35.1.dev20240607.data/scripts/streamlit.cmd,sha256=ZEYM3vBJSp-k7vwSJ3ba5NzEk9-qHdSeLvGYAAe1mMw,676
531
+ streamlit_nightly-1.35.1.dev20240607.dist-info/METADATA,sha256=XaNX_4tJn_JF06SvhgbfoWD-uZJvphhR6Pd5AsdOp1U,8527
532
+ streamlit_nightly-1.35.1.dev20240607.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
533
+ streamlit_nightly-1.35.1.dev20240607.dist-info/entry_points.txt,sha256=uNJ4DwGNXEhOK0USwSNanjkYyR-Bk7eYQbJFDrWyOgY,53
534
+ streamlit_nightly-1.35.1.dev20240607.dist-info/top_level.txt,sha256=V3FhKbm7G2LnR0s4SytavrjIPNIhvcsAGXfYHAwtQzw,10
535
+ streamlit_nightly-1.35.1.dev20240607.dist-info/RECORD,,
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[5441],{5441:(e,t,o)=>{o.r(t),o.d(t,{default:()=>P});var n=o(66845),i=o(25621),s=o(72965),a=o(94206),r=o(60784),l=o(62813),d=o.n(l),c=o(50641),h=o(23849),u=o(23593),m=o(63765),g=o(87814),p=o(91191);const f={DATAFRAME_INDEX:"(index)"},b=new Set([p.GI.DatetimeIndex,p.GI.Float64Index,p.GI.Int64Index,p.GI.RangeIndex,p.GI.UInt64Index]);function v(e){var t;if(0===(null===(t=e.datasets)||void 0===t?void 0:t.length))return null;const o={};return e.datasets.forEach((e=>{if(!e)return;const t=e.hasName?e.name:null;o[t]=e.data})),o}function w(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e.isEmpty())return[];const o=[],{dataRows:n,dataColumns:i}=e.dimensions,s=p.fu.getTypeName(e.types.index[0]),a=b.has(s);for(let r=t;r<n;r++){const t={};if(a){const o=e.getIndexValue(r,0);t[f.DATAFRAME_INDEX]="bigint"===typeof o?Number(o):o}for(let o=0;o<i;o++){const n=e.getDataValue(r,o),i=e.types.data[o],s=p.fu.getTypeName(i);if("datetimetz"!==s&&(n instanceof Date||Number.isFinite(n))&&(s.startsWith("datetime")||"date"===s)){const i=60*new Date(n).getTimezoneOffset()*1e3;t[e.columns[0][o]]=n.valueOf()+i}else t[e.columns[0][o]]="bigint"===typeof n?Number(n):n}o.push(t)}return o}var y=o(96825),x=o.n(y),S=o(99394),F=o.n(S),C=o(27466);function z(e,t){const o={font:t.genericFonts.bodyFont,background:t.colors.bgColor,fieldTitle:"verbal",autosize:{type:"fit",contains:"padding"},title:{align:"left",anchor:"start",color:t.colors.headingColor,titleFontStyle:"normal",fontWeight:t.fontWeights.bold,fontSize:t.fontSizes.smPx+2,orient:"top",offset:26},header:{titleFontWeight:t.fontWeights.normal,titleFontSize:t.fontSizes.mdPx,titleColor:(0,C.Xy)(t),titleFontStyle:"normal",labelFontSize:t.fontSizes.twoSmPx,labelFontWeight:t.fontWeights.normal,labelColor:(0,C.Xy)(t),labelFontStyle:"normal"},axis:{labelFontSize:t.fontSizes.twoSmPx,labelFontWeight:t.fontWeights.normal,labelColor:(0,C.Xy)(t),labelFontStyle:"normal",titleFontWeight:t.fontWeights.normal,titleFontSize:t.fontSizes.smPx,titleColor:(0,C.Xy)(t),titleFontStyle:"normal",ticks:!1,gridColor:(0,C.ny)(t),domain:!1,domainWidth:1,domainColor:(0,C.ny)(t),labelFlush:!0,labelFlushOffset:1,labelBound:!1,labelLimit:100,titlePadding:t.spacing.lgPx,labelPadding:t.spacing.lgPx,labelSeparation:t.spacing.twoXSPx,labelOverlap:!0},legend:{labelFontSize:t.fontSizes.smPx,labelFontWeight:t.fontWeights.normal,labelColor:(0,C.Xy)(t),titleFontSize:t.fontSizes.smPx,titleFontWeight:t.fontWeights.normal,titleFontStyle:"normal",titleColor:(0,C.Xy)(t),titlePadding:5,labelPadding:t.spacing.lgPx,columnPadding:t.spacing.smPx,rowPadding:t.spacing.twoXSPx,padding:7,symbolStrokeWidth:4},range:{category:(0,C.iY)(t),diverging:(0,C.ru)(t),ramp:(0,C.Gy)(t),heatmap:(0,C.Gy)(t)},view:{columns:1,strokeWidth:0,stroke:"transparent",continuousHeight:350,continuousWidth:400,discreteHeight:350,discreteWidth:{step:20}},concat:{columns:1},facet:{columns:1},mark:{tooltip:!0,...(0,C.Iy)(t)?{color:"#0068C9"}:{color:"#83C9FF"}},bar:{binSpacing:t.spacing.twoXSPx,discreteBandSize:{band:.85}},axisDiscrete:{grid:!1},axisXPoint:{grid:!1},axisTemporal:{grid:!1},axisXBand:{grid:!1}};return e?F()({},o,e,((e,t)=>Array.isArray(t)?t:void 0)):o}const W=(0,o(1515).Z)("div",{target:"egd2k5h0"})((e=>{let{theme:t,useContainerWidth:o,isFullScreen:n}=e;return{width:o||n?"100%":"auto",height:n?"100%":"auto","&.vega-embed":{"&:hover summary, .vega-embed:focus summary":{background:"transparent"},"&.has-actions":{paddingRight:0},".vega-actions":{zIndex:t.zIndices.popupMenu,backgroundColor:t.colors.bgColor,boxShadow:"rgb(0 0 0 / 16%) 0px 4px 16px",border:"".concat(t.sizes.borderWidth," solid ").concat(t.colors.fadedText10),a:{fontFamily:t.genericFonts.bodyFont,fontWeight:t.fontWeights.normal,fontSize:t.fontSizes.md,margin:0,padding:"".concat(t.spacing.twoXS," ").concat(t.spacing.twoXL),color:t.colors.bodyText},"a:hover":{backgroundColor:t.colors.secondaryBg,color:t.colors.bodyText},":before":{content:"none"},":after":{content:"none"}},summary:{opacity:0,height:"auto",zIndex:t.zIndices.menuButton,border:"none",boxShadow:"none",borderRadius:t.radii.default,color:t.colors.fadedText10,backgroundColor:"transparent",transition:"opacity 300ms 150ms,transform 300ms 150ms","&:active, &:focus-visible, &:hover":{border:"none",boxShadow:"none",color:t.colors.bodyText,opacity:"1 !important",background:t.colors.darkenedBgMix25}}}}}),"");var V=o(40864);const I="source";class D extends n.PureComponent{constructor(){super(...arguments),this.vegaView=void 0,this.vegaFinalizer=void 0,this.defaultDataName=I,this.element=null,this.formClearHelper=new g.K,this.state={error:void 0},this.finalizeView=()=>{this.vegaFinalizer&&this.vegaFinalizer(),this.vegaFinalizer=void 0,this.vegaView=void 0},this.generateSpec=()=>{var e,t;const{element:o,theme:n,isFullScreen:i,width:s,height:a}=this.props,r=JSON.parse(o.spec),{useContainerWidth:l}=o;if("streamlit"===o.vegaLiteTheme?r.config=z(r.config,n):"streamlit"===(null===(e=r.usermeta)||void 0===e||null===(t=e.embedOptions)||void 0===t?void 0:t.theme)?(r.config=z(r.config,n),r.usermeta.embedOptions.theme=void 0):r.config=function(e,t){const{colors:o,fontSizes:n,genericFonts:i}=t,s={labelFont:i.bodyFont,titleFont:i.bodyFont,labelFontSize:n.twoSmPx,titleFontSize:n.twoSmPx},a={background:o.bgColor,axis:{labelColor:o.bodyText,titleColor:o.bodyText,gridColor:(0,C.ny)(t),...s},legend:{labelColor:o.bodyText,titleColor:o.bodyText,...s},title:{color:o.bodyText,subtitleColor:o.bodyText,...s},header:{labelColor:o.bodyText,titleColor:o.bodyText,...s},view:{stroke:(0,C.ny)(t),continuousHeight:350,continuousWidth:400,discreteHeight:350,discreteWidth:{step:20}},mark:{tooltip:!0}};return e?x()({},a,e):a}(r.config,n),i?(r.width=s,r.height=a,"vconcat"in r&&r.vconcat.forEach((e=>{e.width=s}))):l&&(r.width=s,"vconcat"in r&&r.vconcat.forEach((e=>{e.width=s}))),r.padding||(r.padding={}),null==r.padding.bottom&&(r.padding.bottom=20),r.datasets)throw new Error("Datasets should not be passed as part of the spec");return o.selectionMode.length>0&&function(e){"params"in e&&"encoding"in e&&e.params.forEach((t=>{"select"in t&&(["interval","point"].includes(t.select)&&(t.select={type:t.select}),"type"in t.select&&"point"===t.select.type&&!("encodings"in t.select)&&(0,c.le)(t.select.encodings)&&(t.select.encodings=Object.keys(e.encoding)))}))}(r),r},this.maybeConfigureSelections=()=>{if(void 0===this.vegaView)return;const{widgetMgr:e,element:t}=this.props;if(null===t||void 0===t||!t.id||0===t.selectionMode.length)return;const o=e.getElementState(this.props.element.id,"viewState");if((0,c.bb)(o))try{this.vegaView=this.vegaView.setState(o)}catch(i){(0,h.KE)("Failed to restore view state",i)}t.selectionMode.forEach(((o,n)=>{var i;null===(i=this.vegaView)||void 0===i||i.addSignalListener(o,(0,c.Ds)(150,((o,n)=>{var i;const s=null===(i=this.vegaView)||void 0===i?void 0:i.getState({data:(e,o)=>t.selectionMode.some((t=>"".concat(t,"_store")===e)),recurse:!1});(0,c.bb)(s)&&e.setElementState(t.id,"viewState",s);let a=n;"vlPoint"in n&&"or"in n.vlPoint&&(a=n.vlPoint.or);const r=JSON.parse(e.getStringValue(t)||"{}"),l={selection:{...(null===r||void 0===r?void 0:r.selection)||{},[o]:a||{}}};d()(r,l)||e.setStringValue(t,JSON.stringify(l),{fromUi:!0},this.props.fragmentId)})))}));const n=()=>{const o={selection:{}};this.props.element.selectionMode.forEach((e=>{o.selection[e]={}}));const n=e.getStringValue(t),i=n?JSON.parse(n):o;var s;d()(i,o)||(null===(s=this.props.widgetMgr)||void 0===s||s.setStringValue(this.props.element,JSON.stringify(o),{fromUi:!0},this.props.fragmentId))};this.props.element.formId&&this.formClearHelper.manageFormClearListener(this.props.widgetMgr,this.props.element.formId,n)}}async componentDidMount(){try{await this.createView()}catch(e){const t=(0,m.b)(e);this.setState({error:t})}}componentWillUnmount(){this.finalizeView()}async componentDidUpdate(e){const{element:t,theme:o}=e,{element:n,theme:i}=this.props,s=t.spec,{spec:a}=n;if(!this.vegaView||s!==a||o!==i||e.width!==this.props.width||e.height!==this.props.height||e.element.vegaLiteTheme!==this.props.element.vegaLiteTheme||!d()(e.element.selectionMode,this.props.element.selectionMode)){(0,h.ji)("Vega spec changed.");try{await this.createView()}catch(g){const e=(0,m.b)(g);this.setState({error:e})}return}const r=t.data,{data:l}=n;(r||l)&&this.updateData(this.defaultDataName,r,l);const c=v(t)||{},u=v(n)||{};for(const[d,h]of Object.entries(u)){const e=d||this.defaultDataName,t=c[e];this.updateData(e,t,h)}for(const d of Object.keys(c))u.hasOwnProperty(d)||d===this.defaultDataName||this.updateData(d,null,null);this.vegaView.resize().runAsync()}updateData(e,t,o){if(!this.vegaView)throw new Error("Chart has not been drawn yet");if(!o||0===o.data.numRows)try{this.vegaView.remove(e,a.truthy)}finally{return}if(!t||0===t.data.numRows)return void this.vegaView.insert(e,w(o));const{dataRows:n,dataColumns:i}=t.dimensions,{dataRows:s,dataColumns:r}=o.dimensions;!function(e,t,o,n,i,s){if(o!==s)return!1;if(t>=i)return!1;if(0===t)return!1;const a=s-1,r=t-1;return e.getDataValue(0,a)===n.getDataValue(0,a)&&e.getDataValue(r,a)===n.getDataValue(r,a)}(t,n,i,o,s,r)?(this.vegaView.data(e,w(o)),(0,h.ji)("Had to clear the ".concat(e," dataset before inserting data through Vega view."))):n<s&&this.vegaView.insert(e,w(o,n))}async createView(){if((0,h.ji)("Creating a new Vega view."),!this.element)throw Error("Element missing.");this.finalizeView();const{element:e}=this.props,t=this.generateSpec(),o={ast:!0,expr:r.N,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,forceActionsMenu:!0},{vgSpec:n,view:i,finalize:a}=await(0,s.ZP)(this.element,t,o);this.vegaView=i,this.maybeConfigureSelections(),this.vegaFinalizer=a;const l=function(e){const t=v(e);if(null==t)return null;const o={};for(const[n,i]of Object.entries(t))o[n]=w(i);return o}(e),d=l?Object.keys(l):[];if(1===d.length){const[e]=d;this.defaultDataName=e}else 0===d.length&&n.data&&(this.defaultDataName=I);const c=function(e){const t=e.data;return t&&0!==t.data.numRows?w(t):null}(e);if(c&&i.insert(this.defaultDataName,c),l)for(const[s,r]of Object.entries(l))i.insert(s,r);await i.runAsync(),this.vegaView.resize().runAsync()}render(){if(this.state.error)throw this.state.error;return(0,V.jsx)(W,{"data-testid":"stArrowVegaLiteChart",useContainerWidth:this.props.element.useContainerWidth,isFullScreen:this.props.isFullScreen,ref:e=>{this.element=e}})}}const P=(0,i.b)((0,u.Z)(D))},23593:(e,t,o)=>{o.d(t,{Z:()=>b});var n=o(66845),i=o(13005),s=o.n(i),a=o(25621),r=o(82218),l=o(97781),d=o(46927),c=o(66694),h=o(1515);const u=(0,h.Z)("button",{target:"e1vs0wn31"})((e=>{let{isExpanded:t,theme:o}=e;const n=t?{right:"0.4rem",top:"0.5rem",backgroundColor:"transparent"}:{right:"-3.0rem",top:"-0.375rem",opacity:0,transform:"scale(0)",backgroundColor:o.colors.lightenedBg05};return{position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",zIndex:o.zIndices.sidebar+1,height:"2.5rem",width:"2.5rem",transition:"opacity 300ms 150ms, transform 300ms 150ms",border:"none",color:o.colors.fadedText60,borderRadius:"50%",...n,"&:focus":{outline:"none"},"&:active, &:focus-visible, &:hover":{opacity:1,outline:"none",transform:"scale(1)",color:o.colors.bodyText,transition:"none"}}}),""),m=(0,h.Z)("div",{target:"e1vs0wn30"})((e=>{let{theme:t,isExpanded:o}=e;return{"&:hover":{[u]:{opacity:1,transform:"scale(1)",transition:"none"}},...o?{position:"fixed",top:0,left:0,bottom:0,right:0,background:t.colors.bgColor,zIndex:t.zIndices.fullscreenWrapper,padding:t.spacing.md,paddingTop:"2.875rem",overflow:["auto","overlay"],display:"flex",alignItems:"center",justifyContent:"center"}:{}}}),"");var g=o(40864);class p extends n.PureComponent{constructor(e){super(e),this.context=void 0,this.controlKeys=e=>{const{expanded:t}=this.state;27===e.keyCode&&t&&this.zoomOut()},this.zoomIn=()=>{document.body.style.overflow="hidden",this.context.setFullScreen(!0),this.setState({expanded:!0})},this.zoomOut=()=>{document.body.style.overflow="unset",this.context.setFullScreen(!1),this.setState({expanded:!1})},this.convertScssRemValueToPixels=e=>parseFloat(e)*parseFloat(getComputedStyle(document.documentElement).fontSize),this.getWindowDimensions=()=>{const e=this.convertScssRemValueToPixels(this.props.theme.spacing.md),t=this.convertScssRemValueToPixels("2.875rem");return{fullWidth:window.innerWidth-2*e,fullHeight:window.innerHeight-(e+t)}},this.updateWindowDimensions=()=>{this.setState(this.getWindowDimensions())},this.state={expanded:!1,...this.getWindowDimensions()}}componentDidMount(){window.addEventListener("resize",this.updateWindowDimensions),document.addEventListener("keydown",this.controlKeys,!1)}componentWillUnmount(){window.removeEventListener("resize",this.updateWindowDimensions),document.removeEventListener("keydown",this.controlKeys,!1)}render(){const{expanded:e,fullWidth:t,fullHeight:o}=this.state,{children:n,width:i,height:s,disableFullscreenMode:a}=this.props;let c=r.d,h=this.zoomIn,p="View fullscreen";return e&&(c=l.m,h=this.zoomOut,p="Exit fullscreen"),(0,g.jsxs)(m,{isExpanded:e,"data-testid":"stFullScreenFrame",children:[!a&&(0,g.jsx)(u,{"data-testid":"StyledFullScreenButton",onClick:h,title:p,isExpanded:e,children:(0,g.jsx)(d.Z,{content:c})}),n(e?{width:t,height:o,expanded:e,expand:this.zoomIn,collapse:this.zoomOut}:{width:i,height:s,expanded:e,expand:this.zoomIn,collapse:this.zoomOut})]})}}p.contextType=c.E;const f=(0,a.b)(p);const b=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];class o extends n.PureComponent{constructor(){super(...arguments),this.render=()=>{const{width:o,height:n,disableFullscreenMode:i}=this.props;return(0,g.jsx)(f,{width:o,height:n,disableFullscreenMode:t||i,children:t=>{let{width:o,height:n,expanded:i,expand:s,collapse:a}=t;return(0,g.jsx)(e,{...this.props,width:o,height:n,isFullScreen:i,expand:s,collapse:a})}})}}}return o.displayName="withFullScreenWrapper(".concat(e.displayName||e.name,")"),s()(o,e)}},87814:(e,t,o)=>{o.d(t,{K:()=>i});var n=o(50641);class i{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,o){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,n.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,o),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}}}]);