streamlit-nightly 1.38.1.dev20240911__py2.py3-none-any.whl → 1.38.1.dev20240913__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. streamlit/dataframe_util.py +1 -1
  2. streamlit/elements/doc_string.py +1 -9
  3. streamlit/elements/vega_charts.py +8 -3
  4. streamlit/runtime/app_session.py +5 -7
  5. streamlit/runtime/credentials.py +2 -2
  6. streamlit/runtime/forward_msg_queue.py +28 -1
  7. streamlit/runtime/scriptrunner/magic.py +2 -20
  8. streamlit/runtime/scriptrunner/script_runner.py +2 -12
  9. streamlit/static/asset-manifest.json +8 -8
  10. streamlit/static/index.html +1 -1
  11. streamlit/static/static/js/1086.b7ec1344.chunk.js +5 -0
  12. streamlit/static/static/js/1260.eaaa4e75.chunk.js +5 -0
  13. streamlit/static/static/js/5618.f7838309.chunk.js +5 -0
  14. streamlit/static/static/js/{5711.3d376a33.chunk.js → 5711.229cb7d0.chunk.js} +1 -1
  15. streamlit/static/static/js/7612.39e7938b.chunk.js +2 -0
  16. streamlit/static/static/js/954.88cae675.chunk.js +5 -0
  17. streamlit/static/static/js/{main.e270cec5.js → main.8721af5a.js} +3 -3
  18. streamlit/watcher/event_based_path_watcher.py +11 -2
  19. streamlit/watcher/folder_black_list.py +1 -0
  20. streamlit/watcher/path_watcher.py +5 -0
  21. streamlit/web/server/app_static_file_handler.py +1 -1
  22. {streamlit_nightly-1.38.1.dev20240911.dist-info → streamlit_nightly-1.38.1.dev20240913.dist-info}/METADATA +1 -1
  23. {streamlit_nightly-1.38.1.dev20240911.dist-info → streamlit_nightly-1.38.1.dev20240913.dist-info}/RECORD +29 -29
  24. streamlit/static/static/js/1086.1bb52316.chunk.js +0 -5
  25. streamlit/static/static/js/1260.4017a70f.chunk.js +0 -5
  26. streamlit/static/static/js/2266.f3886a78.chunk.js +0 -2
  27. streamlit/static/static/js/5618.08be9e66.chunk.js +0 -5
  28. streamlit/static/static/js/954.3cc76210.chunk.js +0 -5
  29. /streamlit/static/static/js/{2266.f3886a78.chunk.js.LICENSE.txt → 7612.39e7938b.chunk.js.LICENSE.txt} +0 -0
  30. /streamlit/static/static/js/{main.e270cec5.js.LICENSE.txt → main.8721af5a.js.LICENSE.txt} +0 -0
  31. {streamlit_nightly-1.38.1.dev20240911.data → streamlit_nightly-1.38.1.dev20240913.data}/scripts/streamlit.cmd +0 -0
  32. {streamlit_nightly-1.38.1.dev20240911.dist-info → streamlit_nightly-1.38.1.dev20240913.dist-info}/WHEEL +0 -0
  33. {streamlit_nightly-1.38.1.dev20240911.dist-info → streamlit_nightly-1.38.1.dev20240913.dist-info}/entry_points.txt +0 -0
  34. {streamlit_nightly-1.38.1.dev20240911.dist-info → streamlit_nightly-1.38.1.dev20240913.dist-info}/top_level.txt +0 -0
@@ -1262,7 +1262,7 @@ def _unify_missing_values(df: DataFrame) -> DataFrame:
1262
1262
  """
1263
1263
  import numpy as np
1264
1264
 
1265
- return df.fillna(np.nan).replace([np.nan], [None])
1265
+ return df.fillna(np.nan).replace([np.nan], [None]).infer_objects()
1266
1266
 
1267
1267
 
1268
1268
  def _pandas_df_to_series(df: DataFrame) -> Series[Any]:
@@ -291,15 +291,7 @@ def _get_variable_name_from_code_str(code):
291
291
 
292
292
  # If constant, there's no variable name.
293
293
  # E.g. st.help("foo") or st.help(123) should give you None.
294
- elif type(arg_node) in (
295
- ast.Constant,
296
- # Python 3.7 support:
297
- ast.Num,
298
- ast.Str,
299
- ast.Bytes,
300
- ast.NameConstant,
301
- ast.Ellipsis,
302
- ):
294
+ elif type(arg_node) is ast.Constant:
303
295
  return None
304
296
 
305
297
  # Otherwise, return whatever is inside st.help(<-- here -->)
@@ -951,9 +951,14 @@ class VegaChartsMixin:
951
951
  "https://docs.streamlit.io/develop/api-reference/charts/st.area_chart",
952
952
  )
953
953
 
954
- # st.area_chart's stack=False option translates to a "layered" area chart for vega. We reserve stack=False for
955
- # grouped/non-stacked bar charts, so we need to translate False to "layered" here.
956
- if stack is False:
954
+ # st.area_chart's stack=False option translates to a "layered" area chart for
955
+ # vega. We reserve stack=False for
956
+ # grouped/non-stacked bar charts, so we need to translate False to "layered"
957
+ # here. The default stack type was changed in vega-lite 5.14.1:
958
+ # https://github.com/vega/vega-lite/issues/9337
959
+ # To get the old behavior, we also need to set stack to layered as the
960
+ # default (if stack is None)
961
+ if stack is False or stack is None:
957
962
  stack = "layered"
958
963
 
959
964
  chart, add_rows_metadata = generate_chart(
@@ -468,8 +468,10 @@ class AppSession:
468
468
  if self._local_sources_watcher is not None:
469
469
  self._local_sources_watcher.update_watched_pages()
470
470
 
471
- def _clear_queue(self) -> None:
472
- self._browser_queue.clear(retain_lifecycle_msgs=True)
471
+ def _clear_queue(self, fragment_ids_this_run: list[str] | None = None) -> None:
472
+ self._browser_queue.clear(
473
+ retain_lifecycle_msgs=True, fragment_ids_this_run=fragment_ids_this_run
474
+ )
473
475
 
474
476
  def _on_scriptrunner_event(
475
477
  self,
@@ -481,7 +483,6 @@ class AppSession:
481
483
  page_script_hash: str | None = None,
482
484
  fragment_ids_this_run: list[str] | None = None,
483
485
  pages: dict[PageHash, PageInfo] | None = None,
484
- clear_forward_msg_queue: bool = True,
485
486
  ) -> None:
486
487
  """Called when our ScriptRunner emits an event.
487
488
 
@@ -499,7 +500,6 @@ class AppSession:
499
500
  page_script_hash,
500
501
  fragment_ids_this_run,
501
502
  pages,
502
- clear_forward_msg_queue,
503
503
  )
504
504
  )
505
505
 
@@ -513,7 +513,6 @@ class AppSession:
513
513
  page_script_hash: str | None = None,
514
514
  fragment_ids_this_run: list[str] | None = None,
515
515
  pages: dict[PageHash, PageInfo] | None = None,
516
- clear_forward_msg_queue: bool = True,
517
516
  ) -> None:
518
517
  """Handle a ScriptRunner event.
519
518
 
@@ -585,8 +584,7 @@ class AppSession:
585
584
  if page_script_hash != self._client_state.page_script_hash:
586
585
  self._client_state.page_script_hash = page_script_hash
587
586
 
588
- if clear_forward_msg_queue:
589
- self._clear_queue()
587
+ self._clear_queue(fragment_ids_this_run)
590
588
 
591
589
  self._enqueue_forward_msg(
592
590
  self._create_new_session_message(
@@ -20,7 +20,7 @@ import json
20
20
  import os
21
21
  import sys
22
22
  import textwrap
23
- from datetime import datetime
23
+ from datetime import datetime, timezone
24
24
  from typing import Final, NamedTuple, NoReturn
25
25
  from uuid import uuid4
26
26
 
@@ -82,7 +82,7 @@ def _send_email(email: str) -> None:
82
82
  "referer": "localhost:8501/",
83
83
  }
84
84
 
85
- dt = datetime.utcnow().isoformat() + "+00:00"
85
+ dt = f"{datetime.now(timezone.utc).isoformat()}+00:00"
86
86
 
87
87
  data = {
88
88
  "anonymous_id": None,
@@ -81,7 +81,11 @@ class ForwardMsgQueue:
81
81
  self._delta_index_map[delta_key] = len(self._queue)
82
82
  self._queue.append(msg)
83
83
 
84
- def clear(self, retain_lifecycle_msgs: bool = False) -> None:
84
+ def clear(
85
+ self,
86
+ retain_lifecycle_msgs: bool = False,
87
+ fragment_ids_this_run: list[str] | None = None,
88
+ ) -> None:
85
89
  """Clear the queue, potentially retaining lifecycle messages.
86
90
 
87
91
  The retain_lifecycle_msgs argument exists because in some cases (in particular
@@ -89,7 +93,12 @@ class ForwardMsgQueue:
89
93
  to remove certain messages from the queue as doing so may cause the client to
90
94
  not hear about important script lifecycle events (such as the script being
91
95
  stopped early in order to be rerun).
96
+
97
+ If fragment_ids_this_run is provided, delta messages not belonging to any
98
+ fragment or belonging to a fragment not in fragment_ids_this_run will be
99
+ preserved to prevent clearing messages unrelated to the running fragments.
92
100
  """
101
+
93
102
  if not retain_lifecycle_msgs:
94
103
  self._queue = []
95
104
  else:
@@ -103,6 +112,24 @@ class ForwardMsgQueue:
103
112
  "session_status_changed",
104
113
  "parent_message",
105
114
  }
115
+ or (
116
+ # preserve all messages if this is a fragment rerun and...
117
+ fragment_ids_this_run is not None
118
+ and (
119
+ # the message is not a delta message
120
+ # (not associated with a fragment) or...
121
+ msg.delta is None
122
+ or (
123
+ # it is a delta but not associated with any of the passed
124
+ # fragments
125
+ msg.delta is not None
126
+ and (
127
+ msg.delta.fragment_id is None
128
+ or msg.delta.fragment_id not in fragment_ids_this_run
129
+ )
130
+ )
131
+ )
132
+ )
106
133
  ]
107
134
 
108
135
  self._delta_index_map = {}
@@ -219,26 +219,8 @@ def _get_st_write_from_expr(
219
219
  # If tuple, call st.write(*the_tuple). This allows us to add a comma at the end of a
220
220
  # statement to turn it into an expression that should be st-written. Ex:
221
221
  # "np.random.randn(1000, 2),"
222
- if type(node.value) is ast.Tuple:
223
- args = node.value.elts
224
- st_write = _build_st_write_call(args)
225
-
226
- # st.write all strings.
227
- elif type(node.value) is ast.Str:
228
- args = [node.value]
229
- st_write = _build_st_write_call(args)
230
-
231
- # st.write all variables.
232
- elif type(node.value) is ast.Name:
233
- args = [node.value]
234
- st_write = _build_st_write_call(args)
235
-
236
- # st.write everything else
237
- else:
238
- args = [node.value]
239
- st_write = _build_st_write_call(args)
240
-
241
- return st_write
222
+ args = node.value.elts if type(node.value) is ast.Tuple else [node.value]
223
+ return _build_st_write_call(args)
242
224
 
243
225
 
244
226
  def _is_string_constant_node(node) -> bool:
@@ -439,8 +439,6 @@ class ScriptRunner:
439
439
  else main_page_info["page_script_hash"]
440
440
  )
441
441
 
442
- fragment_ids_this_run = list(rerun_data.fragment_id_queue)
443
-
444
442
  ctx = self._get_script_run_ctx()
445
443
  # Clear widget state on page change. This normally happens implicitly
446
444
  # in the script run cleanup steps, but doing it explicitly ensures
@@ -462,6 +460,8 @@ class ScriptRunner:
462
460
  widget_ids = {w.id for w in rerun_data.widget_states.widgets}
463
461
  self._session_state.on_script_finished(widget_ids)
464
462
 
463
+ fragment_ids_this_run = list(rerun_data.fragment_id_queue)
464
+
465
465
  ctx.reset(
466
466
  query_string=rerun_data.query_string,
467
467
  page_script_hash=page_script_hash,
@@ -469,22 +469,12 @@ class ScriptRunner:
469
469
  )
470
470
  self._pages_manager.reset_active_script_hash()
471
471
 
472
- # We want to clear the forward_msg_queue during full script runs and
473
- # fragment-scoped fragment reruns. For normal fragment runs, clearing the
474
- # forward_msg_queue may cause us to drop messages either corresponding to
475
- # other, unrelated fragments or that this fragment run depends on.
476
- fragment_ids_this_run = rerun_data.fragment_id_queue
477
- clear_forward_msg_queue = (
478
- not fragment_ids_this_run or rerun_data.is_fragment_scoped_rerun
479
- )
480
-
481
472
  self.on_event.send(
482
473
  self,
483
474
  event=ScriptRunnerEvent.SCRIPT_STARTED,
484
475
  page_script_hash=page_script_hash,
485
476
  fragment_ids_this_run=fragment_ids_this_run,
486
477
  pages=self._pages_manager.get_pages(),
487
- clear_forward_msg_queue=clear_forward_msg_queue,
488
478
  )
489
479
 
490
480
  # Compile the script. Any errors thrown here will be surfaced
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "files": {
3
3
  "main.css": "./static/css/main.5513bd04.css",
4
- "main.js": "./static/js/main.e270cec5.js",
4
+ "main.js": "./static/js/main.8721af5a.js",
5
5
  "static/js/6679.265ca09c.chunk.js": "./static/js/6679.265ca09c.chunk.js",
6
6
  "static/js/9464.7e9a3c0a.chunk.js": "./static/js/9464.7e9a3c0a.chunk.js",
7
7
  "static/js/9077.e0a8db2a.chunk.js": "./static/js/9077.e0a8db2a.chunk.js",
@@ -9,7 +9,7 @@
9
9
  "static/css/3156.93909c7e.chunk.css": "./static/css/3156.93909c7e.chunk.css",
10
10
  "static/js/3156.002c6ee0.chunk.js": "./static/js/3156.002c6ee0.chunk.js",
11
11
  "static/css/5711.c24b25fa.chunk.css": "./static/css/5711.c24b25fa.chunk.css",
12
- "static/js/5711.3d376a33.chunk.js": "./static/js/5711.3d376a33.chunk.js",
12
+ "static/js/5711.229cb7d0.chunk.js": "./static/js/5711.229cb7d0.chunk.js",
13
13
  "static/js/3861.0dedcd19.chunk.js": "./static/js/3861.0dedcd19.chunk.js",
14
14
  "static/js/8642.dfef7dcb.chunk.js": "./static/js/8642.dfef7dcb.chunk.js",
15
15
  "static/js/7493.95e79b96.chunk.js": "./static/js/7493.95e79b96.chunk.js",
@@ -24,7 +24,7 @@
24
24
  "static/js/5625.3a8dc81f.chunk.js": "./static/js/5625.3a8dc81f.chunk.js",
25
25
  "static/js/6141.43a8fda3.chunk.js": "./static/js/6141.43a8fda3.chunk.js",
26
26
  "static/js/4103.d863052a.chunk.js": "./static/js/4103.d863052a.chunk.js",
27
- "static/js/1086.1bb52316.chunk.js": "./static/js/1086.1bb52316.chunk.js",
27
+ "static/js/1086.b7ec1344.chunk.js": "./static/js/1086.b7ec1344.chunk.js",
28
28
  "static/js/245.68a062da.chunk.js": "./static/js/245.68a062da.chunk.js",
29
29
  "static/js/7193.2594a18c.chunk.js": "./static/js/7193.2594a18c.chunk.js",
30
30
  "static/js/6360.6d7cfa35.chunk.js": "./static/js/6360.6d7cfa35.chunk.js",
@@ -36,10 +36,10 @@
36
36
  "static/js/8166.11abccb8.chunk.js": "./static/js/8166.11abccb8.chunk.js",
37
37
  "static/js/9114.1ee3d4dd.chunk.js": "./static/js/9114.1ee3d4dd.chunk.js",
38
38
  "static/js/5180.e826dd46.chunk.js": "./static/js/5180.e826dd46.chunk.js",
39
- "static/js/5618.08be9e66.chunk.js": "./static/js/5618.08be9e66.chunk.js",
40
- "static/js/1260.4017a70f.chunk.js": "./static/js/1260.4017a70f.chunk.js",
39
+ "static/js/5618.f7838309.chunk.js": "./static/js/5618.f7838309.chunk.js",
40
+ "static/js/1260.eaaa4e75.chunk.js": "./static/js/1260.eaaa4e75.chunk.js",
41
41
  "static/js/3560.ce031236.chunk.js": "./static/js/3560.ce031236.chunk.js",
42
- "static/js/954.3cc76210.chunk.js": "./static/js/954.3cc76210.chunk.js",
42
+ "static/js/954.88cae675.chunk.js": "./static/js/954.88cae675.chunk.js",
43
43
  "static/js/3966.e0686958.chunk.js": "./static/js/3966.e0686958.chunk.js",
44
44
  "static/js/8161.9b75f98a.chunk.js": "./static/js/8161.9b75f98a.chunk.js",
45
45
  "static/js/6817.6adfea98.chunk.js": "./static/js/6817.6adfea98.chunk.js",
@@ -53,7 +53,7 @@
53
53
  "static/js/5544.2769497c.chunk.js": "./static/js/5544.2769497c.chunk.js",
54
54
  "static/css/7077.81b3d18f.chunk.css": "./static/css/7077.81b3d18f.chunk.css",
55
55
  "static/js/7077.e21833ae.chunk.js": "./static/js/7077.e21833ae.chunk.js",
56
- "static/js/2266.f3886a78.chunk.js": "./static/js/2266.f3886a78.chunk.js",
56
+ "static/js/7612.39e7938b.chunk.js": "./static/js/7612.39e7938b.chunk.js",
57
57
  "static/js/3389.71902a75.chunk.js": "./static/js/3389.71902a75.chunk.js",
58
58
  "static/js/4297.3afbdd03.chunk.js": "./static/js/4297.3afbdd03.chunk.js",
59
59
  "static/js/4942.e4db7877.chunk.js": "./static/js/4942.e4db7877.chunk.js",
@@ -153,6 +153,6 @@
153
153
  },
154
154
  "entrypoints": [
155
155
  "static/css/main.5513bd04.css",
156
- "static/js/main.e270cec5.js"
156
+ "static/js/main.8721af5a.js"
157
157
  ]
158
158
  }
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.e270cec5.js"></script><link href="./static/css/main.5513bd04.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.8721af5a.js"></script><link href="./static/css/main.5513bd04.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
@@ -0,0 +1,5 @@
1
+ "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[1086],{68035:(e,t,r)=>{r.d(t,{A:()=>c});r(58878);var n=r(25571),o=r(78286),i=r(89653);const a=r(60667).i7`
2
+ 50% {
3
+ color: rgba(0, 0, 0, 0);
4
+ }
5
+ `,s=(0,i.A)("span",{target:"edlqvik0"})((e=>{let{includeDot:t,shouldBlink:r,theme:n}=e;return{...t?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:n.colors.gray,margin:"0 5px"}}:{},...r?{color:n.colors.red,animationName:`${a}`,animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var l=r(90782);const c=e=>{let{dirty:t,value:r,inForm:i,maxLength:a,className:c,type:u="single",allowSubmitOnEnter:d=!0}=e;const p=[],f=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];p.push((0,l.jsx)(s,{includeDot:p.length>0,shouldBlink:t,children:e},p.length))};if(t&&d){const e=i?"submit form":"apply";if("multiline"===u){f(`Press ${(0,n.u_)()?"\u2318":"Ctrl"}+Enter to ${e}`)}else"single"===u&&f(`Press Enter to ${e}`)}return a&&("chat"!==u||t)&&f(`${r.length}/${a}`,t&&r.length>=a),(0,l.jsx)(o.tp,{"data-testid":"InputInstructions",className:c,children:p})}},1086:(e,t,r)=>{r.r(t),r.d(t,{default:()=>v});var n=r(58878),o=r(8151),i=r(68102),a=r(68622),s=n.forwardRef((function(e,t){return n.createElement(a.I,(0,i.A)({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),n.createElement("rect",{width:24,height:24,fill:"none"}),n.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))}));s.displayName="Send";var l=r(94928),c=r(64611),u=r(68035),d=r(58144),p=r(89653);const f=(0,p.A)("div",{target:"e1d2x3se4"})((e=>{var t;let{theme:r,width:n}=e;return{borderRadius:r.radii.default,display:"flex",backgroundColor:null!==(t=r.colors.widgetBackgroundColor)&&void 0!==t?t:r.colors.secondaryBg,width:`${n}px`}}),""),h=(0,p.A)("div",{target:"e1d2x3se3"})((e=>{let{theme:t}=e;return{backgroundColor:t.colors.transparent,position:"relative",flexGrow:1,borderRadius:t.radii.default,display:"flex",alignItems:"center"}}),""),y=(0,p.A)("button",{target:"e1d2x3se2"})((e=>{let{theme:t,disabled:r,extended:n}=e;const o=(0,d.iq)(t),[i,a]=o?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:n?t.radii.none:t.radii.default,borderTopLeftRadius:n?t.radii.default:t.radii.none,borderBottomRightRadius:t.radii.default,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:t.lineHeights.none,margin:t.spacing.none,padding:t.spacing.sm,color:r?i:a,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:o?t.colors.gray10:t.colors.gray90},"&:hover":{backgroundColor:t.colors.primary,color:t.colors.white},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray}}}),""),g=(0,p.A)("div",{target:"e1d2x3se1"})((()=>({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:"0px",pointerEvents:"none"})),""),b=(0,p.A)("div",{target:"e1d2x3se0"})({name:"1lm6gnd",styles:"position:absolute;bottom:0px;right:3rem"});var m=r(90782);const v=function(e){let{width:t,element:r,widgetMgr:i,fragmentId:a}=e;const p=(0,o.u)(),[v,x]=(0,n.useState)(!1),[w,O]=(0,n.useState)(r.default),[j,C]=(0,n.useState)(0),S=(0,n.useRef)(null),A=(0,n.useRef)({minHeight:0,maxHeight:0}),k=()=>{S.current&&S.current.focus(),w&&(i.setStringTriggerValue(r,w,{fromUi:!0},a),x(!1),O(""),C(0))};(0,n.useEffect)((()=>{if(r.setValue){r.setValue=!1;const e=r.value||"";O(e),x(""!==e)}}),[r]),(0,n.useEffect)((()=>{if(S.current){const{offsetHeight:e}=S.current;A.current.minHeight=e,A.current.maxHeight=6.5*e}}),[S]);const{disabled:P,placeholder:R,maxChars:E}=r,I=(0,d.iq)(p),{minHeight:$,maxHeight:T}=A.current,B=I?p.colors.gray70:p.colors.gray80,z=!!(j>0&&S.current)&&Math.abs(j-$)>1;return(0,m.jsx)(f,{className:"stChatInput","data-testid":"stChatInput",width:t,children:(0,m.jsxs)(h,{children:[(0,m.jsx)(l.A,{inputRef:S,value:w,placeholder:R,onChange:e=>{const{value:t}=e.target,{maxChars:n}=r;0!==n&&t.length>n||(x(""!==t),O(t),C((()=>{let e=0;const{current:t}=S;if(t){const r=t.placeholder;t.placeholder="",t.style.height="auto",e=t.scrollHeight,t.placeholder=r,t.style.height=""}return e})()))},onKeyDown:e=>{const{metaKey:t,ctrlKey:r,shiftKey:n}=e;(e=>{var t;const{keyCode:r,key:n}=e;return("Enter"===n||13===r||10===r)&&!(!0===(null===(t=e.nativeEvent)||void 0===t?void 0:t.isComposing))})(e)&&!n&&!r&&!t&&(e.preventDefault(),k())},"aria-label":R,disabled:P,rows:1,overrides:{Root:{style:{minHeight:p.sizes.minElementHeight,outline:"none",backgroundColor:p.colors.transparent,borderLeftWidth:p.sizes.borderWidth,borderRightWidth:p.sizes.borderWidth,borderTopWidth:p.sizes.borderWidth,borderBottomWidth:p.sizes.borderWidth,width:`${t}px`}},InputContainer:{style:{backgroundColor:p.colors.transparent}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:p.lineHeights.inputWidget,backgroundColor:p.colors.transparent,"::placeholder":{color:B},height:z?`${j+1}px`:"auto",maxHeight:T?`${T}px`:"none",paddingRight:"3rem",paddingLeft:p.spacing.sm,paddingBottom:p.spacing.sm,paddingTop:p.spacing.sm}}}}),t>p.breakpoints.hideWidgetDetails&&(0,m.jsx)(b,{children:(0,m.jsx)(u.A,{dirty:v,value:w,maxLength:E,type:"chat",inForm:!1})}),(0,m.jsx)(g,{children:(0,m.jsx)(y,{onClick:k,disabled:!v||P,extended:z,"data-testid":"stChatInputSubmitButton",children:(0,m.jsx)(c.A,{content:s,size:"xl",color:"inherit"})})})]})})}},94928:(e,t,r)=>{r.d(t,{A:()=>A});var n=r(58878),o=r(35331),i=r(18648),a=r(92850),s=r(57224),l=r(81301);function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var p=(0,s.I4)("div",(function(e){return u(u({},(0,l.vt)(u(u({$positive:!1},e),{},{$hasIconTrailing:!1}))),{},{width:e.$resize?"fit-content":"100%"})}));p.displayName="StyledTextAreaRoot",p.displayName="StyledTextAreaRoot";var f=(0,s.I4)("div",(function(e){return(0,l.EO)(u({$positive:!1},e))}));f.displayName="StyledTextareaContainer",f.displayName="StyledTextareaContainer";var h=(0,s.I4)("textarea",(function(e){return u(u({},(0,l.n)(e)),{},{resize:e.$resize||"none"})}));function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},g.apply(this,arguments)}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(l){s=!0,o=l}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function v(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function x(e,t){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x(e,t)}function w(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=j(e);if(t){var o=j(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===y(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return O(e)}(this,r)}}function O(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function j(e){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},j(e)}function C(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}h.displayName="StyledTextarea",h.displayName="StyledTextarea";var S=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}(c,e);var t,r,s,l=w(c);function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return C(O(e=l.call.apply(l,[this].concat(r))),"state",{isFocused:e.props.autoFocus||!1}),C(O(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t)})),C(O(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t)})),e}return t=c,(r=[{key:"render",value:function(){var e=this.props.overrides,t=void 0===e?{}:e,r=b((0,o._O)(t.Root,p),2),s=r[0],l=r[1],c=(0,o.Qp)({Input:{component:h},InputContainer:{component:f}},t);return n.createElement(s,g({"data-baseweb":"textarea",$isFocused:this.state.isFocused,$isReadOnly:this.props.readOnly,$disabled:this.props.disabled,$error:this.props.error,$positive:this.props.positive,$required:this.props.required,$resize:this.props.resize},l),n.createElement(i.A,g({},this.props,{type:a.GT.textarea,overrides:c,onFocus:this.onFocus,onBlur:this.onBlur,resize:this.props.resize})))}}])&&v(t.prototype,r),s&&v(t,s),Object.defineProperty(t,"prototype",{writable:!1}),c}(n.Component);C(S,"defaultProps",{autoFocus:!1,disabled:!1,readOnly:!1,error:!1,name:"",onBlur:function(){},onChange:function(){},onKeyDown:function(){},onKeyPress:function(){},onKeyUp:function(){},onFocus:function(){},overrides:{},placeholder:"",required:!1,rows:3,size:a.SK.default});const A=S}}]);
@@ -0,0 +1,5 @@
1
+ (self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[1260],{68035:(t,e,r)=>{"use strict";r.d(e,{A:()=>u});r(58878);var n=r(25571),o=r(78286),i=r(89653);const s=r(60667).i7`
2
+ 50% {
3
+ color: rgba(0, 0, 0, 0);
4
+ }
5
+ `,a=(0,i.A)("span",{target:"edlqvik0"})((t=>{let{includeDot:e,shouldBlink:r,theme:n}=t;return{...e?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:n.colors.gray,margin:"0 5px"}}:{},...r?{color:n.colors.red,animationName:`${s}`,animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var l=r(90782);const u=t=>{let{dirty:e,value:r,inForm:i,maxLength:s,className:u,type:c="single",allowSubmitOnEnter:d=!0}=t;const p=[],h=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];p.push((0,l.jsx)(a,{includeDot:p.length>0,shouldBlink:e,children:t},p.length))};if(e&&d){const t=i?"submit form":"apply";if("multiline"===c){h(`Press ${(0,n.u_)()?"\u2318":"Ctrl"}+Enter to ${t}`)}else"single"===c&&h(`Press Enter to ${t}`)}return s&&("chat"!==c||e)&&h(`${r.length}/${s}`,e&&r.length>=s),(0,l.jsx)(o.tp,{"data-testid":"InputInstructions",className:u,children:p})}},34752:(t,e,r)=>{"use strict";r.d(e,{X:()=>s,o:()=>i});var n=r(58878),o=r(25571);class i{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(t,e,r){(0,o.se)(this.formClearListener)&&this.lastWidgetMgr===t&&this.lastFormId===e||(this.disconnect(),(0,o._L)(e)&&(this.formClearListener=t.addFormClearedListener(e,r),this.lastWidgetMgr=t,this.lastFormId=e))}disconnect(){var t;null===(t=this.formClearListener)||void 0===t||t.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}function s(t){let{element:e,widgetMgr:r,onFormCleared:i}=t;(0,n.useEffect)((()=>{if(!(0,o._L)(e.formId))return;const t=r.addFormClearedListener(e.formId,i);return()=>{t.disconnect()}}),[e,r,i])}},81260:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>v});var n=r(58878),o=r(32698),i=r.n(o),s=r(59095),a=r(8151),l=r(29669),u=r(34752),c=r(68035),d=r(70474),p=r(78286),h=r(93480),f=r(997),m=r(25571);const y=(0,r(89653).A)("div",{target:"e11y4ecf0"})((t=>{let{width:e}=t;return{position:"relative",width:e}}),"");var b=r(90782);class g extends n.PureComponent{constructor(t){var e;super(t),e=this,this.formClearHelper=new u.o,this.id=void 0,this.state={dirty:!1,value:this.initialValue},this.commitWidgetValue=function(t){let r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{widgetMgr:n,element:o,fragmentId:i}=e.props;n.setStringValue(o,e.state.value,t,i),r&&e.setState({dirty:!1})},this.onFormCleared=()=>{this.setState(((t,e)=>{var r;return{value:null!==(r=e.element.default)&&void 0!==r?r:null}}),(()=>this.commitWidgetValue({fromUi:!0})))},this.onBlur=()=>{this.state.dirty&&this.commitWidgetValue({fromUi:!0})},this.onChange=t=>{const{value:e}=t.target,{element:r}=this.props,{maxChars:n}=r;0!==n&&e.length>n||((0,m.Ml)(this.props.element)?this.setState({dirty:!0,value:e},(()=>{this.commitWidgetValue({fromUi:!0},!1)})):this.setState({dirty:!0,value:e}))},this.onKeyPress=t=>{const{element:e,widgetMgr:r,fragmentId:n}=this.props,{formId:o}=e,i=r.allowFormSubmitOnEnter(o);"Enter"===t.key&&(this.state.dirty&&this.commitWidgetValue({fromUi:!0}),i&&r.submitForm(o,n))},this.id=i()("text_input_")}get initialValue(){var t;const e=this.props.widgetMgr.getStringValue(this.props.element);return null!==(t=null!==e&&void 0!==e?e:this.props.element.default)&&void 0!==t?t:null}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:t}=this.props.element;t&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:t}=this.props.element;this.props.element.setValue=!1,this.setState({value:null!==t&&void 0!==t?t:null},(()=>{this.commitWidgetValue({fromUi:!1})}))}getTypeString(){return this.props.element.type===l.ks.Type.PASSWORD?"password":"text"}render(){var t;const{dirty:e,value:r}=this.state,{element:n,width:o,disabled:i,widgetMgr:a,theme:l}=this.props,{placeholder:u,formId:g}=n,v=a.allowFormSubmitOnEnter(g)||!(0,m.Ml)({formId:g});return this.formClearHelper.manageFormClearListener(a,g,this.onFormCleared),(0,b.jsxs)(y,{className:"stTextInput","data-testid":"stTextInput",width:o,children:[(0,b.jsx)(d.L,{label:n.label,disabled:i,labelVisibility:(0,m.yv)(null===(t=n.labelVisibility)||void 0===t?void 0:t.value),htmlFor:this.id,children:n.help&&(0,b.jsx)(p.j,{children:(0,b.jsx)(h.A,{content:n.help,placement:f.W.TOP_RIGHT})})}),(0,b.jsx)(s.A,{value:null!==r&&void 0!==r?r:"",placeholder:u,onBlur:this.onBlur,onChange:this.onChange,onKeyPress:this.onKeyPress,"aria-label":n.label,disabled:i,id:this.id,type:this.getTypeString(),autoComplete:n.autocomplete,overrides:{Input:{style:{minWidth:0,"::placeholder":{opacity:"0.7"},lineHeight:l.lineHeights.inputWidget,paddingRight:l.spacing.sm,paddingLeft:l.spacing.sm,paddingBottom:l.spacing.sm,paddingTop:l.spacing.sm}},Root:{props:{"data-testid":"stTextInputRootElement"},style:{height:l.sizes.minElementHeight,borderLeftWidth:l.sizes.borderWidth,borderRightWidth:l.sizes.borderWidth,borderTopWidth:l.sizes.borderWidth,borderBottomWidth:l.sizes.borderWidth}}}}),o>l.breakpoints.hideWidgetDetails&&(0,b.jsx)(c.A,{dirty:e,value:null!==r&&void 0!==r?r:"",maxLength:n.maxChars,inForm:(0,m.Ml)({formId:g}),allowSubmitOnEnter:v})]})}}const v=(0,a.b)(g)},59095:(t,e,r)=>{"use strict";r.d(e,{A:()=>F});var n=r(58878),o=r(35331),i=r(4842),s=r(18648),a=r(81301),l=r(92850);function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}var c=["Root","StartEnhancer","EndEnhancer"],d=["startEnhancer","endEnhancer","overrides"];function p(){return p=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},p.apply(this,arguments)}function h(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],s=!0,a=!1;try{for(r=r.call(t);!(s=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);s=!0);}catch(l){a=!0,o=l}finally{try{s||null==r.return||r.return()}finally{if(a)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"===typeof t)return f(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function m(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function y(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function b(t,e){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},b(t,e)}function g(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=w(t);if(e){var o=w(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===u(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return v(t)}(this,r)}}function v(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function w(t){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},w(t)}function O(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var j=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&b(t,e)}(w,t);var e,r,u,f=g(w);function w(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,w);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return O(v(t=f.call.apply(f,[this].concat(r))),"state",{isFocused:t.props.autoFocus||!1}),O(v(t),"onFocus",(function(e){t.setState({isFocused:!0}),t.props.onFocus(e)})),O(v(t),"onBlur",(function(e){t.setState({isFocused:!1}),t.props.onBlur(e)})),t}return e=w,(r=[{key:"render",value:function(){var t=this.props,e=t.startEnhancer,r=t.endEnhancer,u=t.overrides,f=u.Root,y=u.StartEnhancer,b=u.EndEnhancer,g=m(u,c),v=m(t,d),w=h((0,o._O)(f,a.bL),2),O=w[0],j=w[1],F=h((0,o._O)(y,a.P2),2),C=F[0],P=F[1],x=h((0,o._O)(b,a.P2),2),I=x[0],W=x[1],_=(0,i.e)(this.props,this.state);return n.createElement(O,p({"data-baseweb":"input"},_,j,{$adjoined:S(e,r),$hasIconTrailing:this.props.clearable||"password"==this.props.type}),E(e)&&n.createElement(C,p({},_,P,{$position:l.vN.start}),"function"===typeof e?e(_):e),n.createElement(s.A,p({},v,{overrides:g,adjoined:S(e,r),onFocus:this.onFocus,onBlur:this.onBlur})),E(r)&&n.createElement(I,p({},_,W,{$position:l.vN.end}),"function"===typeof r?r(_):r))}}])&&y(e.prototype,r),u&&y(e,u),Object.defineProperty(e,"prototype",{writable:!1}),w}(n.Component);function S(t,e){return E(t)&&E(e)?l.fb.both:E(t)?l.fb.left:E(e)?l.fb.right:l.fb.none}function E(t){return Boolean(t||0===t)}O(j,"defaultProps",{autoComplete:"on",autoFocus:!1,disabled:!1,name:"",onBlur:function(){},onFocus:function(){},overrides:{},required:!1,size:l.SK.default,startEnhancer:null,endEnhancer:null,clearable:!1,type:"text",readOnly:!1});const F=j},32698:(t,e,r)=>{var n=r(30136),o=0;t.exports=function(t){var e=++o;return n(t)+e}}}]);
@@ -0,0 +1,5 @@
1
+ (self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[5618],{68035:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});r(58878);var n=r(25571),o=r(78286),i=r(89653);const s=r(60667).i7`
2
+ 50% {
3
+ color: rgba(0, 0, 0, 0);
4
+ }
5
+ `,a=(0,i.A)("span",{target:"edlqvik0"})((e=>{let{includeDot:t,shouldBlink:r,theme:n}=e;return{...t?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:n.colors.gray,margin:"0 5px"}}:{},...r?{color:n.colors.red,animationName:`${s}`,animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var l=r(90782);const u=e=>{let{dirty:t,value:r,inForm:i,maxLength:s,className:u,type:c="single",allowSubmitOnEnter:d=!0}=e;const p=[],f=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];p.push((0,l.jsx)(a,{includeDot:p.length>0,shouldBlink:t,children:e},p.length))};if(t&&d){const e=i?"submit form":"apply";if("multiline"===c){f(`Press ${(0,n.u_)()?"\u2318":"Ctrl"}+Enter to ${e}`)}else"single"===c&&f(`Press Enter to ${e}`)}return s&&("chat"!==c||t)&&f(`${r.length}/${s}`,t&&r.length>=s),(0,l.jsx)(o.tp,{"data-testid":"InputInstructions",className:u,children:p})}},34752:(e,t,r)=>{"use strict";r.d(t,{X:()=>s,o:()=>i});var n=r(58878),o=r(25571);class i{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,r){(0,o.se)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,o._L)(t)&&(this.formClearListener=e.addFormClearedListener(t,r),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}function s(e){let{element:t,widgetMgr:r,onFormCleared:i}=e;(0,n.useEffect)((()=>{if(!(0,o._L)(t.formId))return;const e=r.addFormClearedListener(t.formId,i);return()=>{e.disconnect()}}),[t,r,i])}},25618:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>b});var n=r(58878),o=r(94928),i=r(8151),s=r(32698),a=r.n(s),l=r(34752),u=r(68035),c=r(70474),d=r(78286),p=r(93480),f=r(997),h=r(25571),m=r(90782);class y extends n.PureComponent{get initialValue(){var e;const t=this.props.widgetMgr.getStringValue(this.props.element);return null!==(e=null!==t&&void 0!==t?t:this.props.element.default)&&void 0!==e?e:null}constructor(e){super(e),this.formClearHelper=new l.o,this.id=void 0,this.state={dirty:!1,value:this.initialValue},this.commitWidgetValue=e=>{const{widgetMgr:t,element:r,fragmentId:n}=this.props;t.setStringValue(r,this.state.value,e,n),this.setState({dirty:!1})},this.onFormCleared=()=>{this.setState(((e,t)=>{var r;return{value:null!==(r=t.element.default)&&void 0!==r?r:null}}),(()=>this.commitWidgetValue({fromUi:!0})))},this.onBlur=()=>{this.state.dirty&&this.commitWidgetValue({fromUi:!0})},this.onChange=e=>{const{value:t}=e.target,{element:r}=this.props,{maxChars:n}=r;0!==n&&t.length>n||this.setState({dirty:!0,value:t})},this.isEnterKeyPressed=e=>{var t;const{keyCode:r,key:n}=e;return("Enter"===n||13===r||10===r)&&!(!0===(null===(t=e.nativeEvent)||void 0===t?void 0:t.isComposing))},this.onKeyDown=e=>{const{metaKey:t,ctrlKey:r}=e,{dirty:n}=this.state,{element:o,widgetMgr:i,fragmentId:s}=this.props,{formId:a}=o,l=i.allowFormSubmitOnEnter(a);this.isEnterKeyPressed(e)&&(r||t)&&n&&(e.preventDefault(),this.commitWidgetValue({fromUi:!0}),l&&i.submitForm(a,s))},this.id=a()("text_area_")}componentDidMount(){this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1,this.setState({value:null!==e&&void 0!==e?e:null},(()=>{this.commitWidgetValue({fromUi:!1})}))}render(){var e;const{element:t,disabled:r,width:n,widgetMgr:i,theme:s}=this.props,{value:a,dirty:l}=this.state,y={width:n},{height:b,placeholder:g,formId:v}=t,O=i.allowFormSubmitOnEnter(v)||!(0,h.Ml)({formId:v});return this.formClearHelper.manageFormClearListener(i,v,this.onFormCleared),(0,m.jsxs)("div",{className:"stTextArea","data-testid":"stTextArea",style:y,children:[(0,m.jsx)(c.L,{label:t.label,disabled:r,labelVisibility:(0,h.yv)(null===(e=t.labelVisibility)||void 0===e?void 0:e.value),htmlFor:this.id,children:t.help&&(0,m.jsx)(d.j,{children:(0,m.jsx)(p.A,{content:t.help,placement:f.W.TOP_RIGHT})})}),(0,m.jsx)(o.A,{value:null!==a&&void 0!==a?a:"",placeholder:g,onBlur:this.onBlur,onChange:this.onChange,onKeyDown:this.onKeyDown,"aria-label":t.label,disabled:r,id:this.id,overrides:{Input:{style:{lineHeight:s.lineHeights.inputWidget,height:b?`${b}px`:"",minHeight:"95px",resize:"vertical","::placeholder":{opacity:"0.7"},paddingRight:s.spacing.lg,paddingLeft:s.spacing.lg,paddingBottom:s.spacing.lg,paddingTop:s.spacing.lg}},Root:{props:{"data-testid":"stTextAreaRootElement"},style:{borderLeftWidth:s.sizes.borderWidth,borderRightWidth:s.sizes.borderWidth,borderTopWidth:s.sizes.borderWidth,borderBottomWidth:s.sizes.borderWidth}}}}),n>s.breakpoints.hideWidgetDetails&&(0,m.jsx)(u.A,{dirty:l,value:null!==a&&void 0!==a?a:"",maxLength:t.maxChars,type:"multiline",inForm:(0,h.Ml)({formId:v}),allowSubmitOnEnter:O})]})}}const b=(0,i.b)(y)},94928:(e,t,r)=>{"use strict";r.d(t,{A:()=>P});var n=r(58878),o=r(35331),i=r(18648),s=r(92850),a=r(57224),l=r(81301);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var p=(0,a.I4)("div",(function(e){return c(c({},(0,l.vt)(c(c({$positive:!1},e),{},{$hasIconTrailing:!1}))),{},{width:e.$resize?"fit-content":"100%"})}));p.displayName="StyledTextAreaRoot",p.displayName="StyledTextAreaRoot";var f=(0,a.I4)("div",(function(e){return(0,l.EO)(c({$positive:!1},e))}));f.displayName="StyledTextareaContainer",f.displayName="StyledTextareaContainer";var h=(0,a.I4)("textarea",(function(e){return c(c({},(0,l.n)(e)),{},{resize:e.$resize||"none"})}));function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},y.apply(this,arguments)}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],s=!0,a=!1;try{for(r=r.call(e);!(s=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);s=!0);}catch(l){a=!0,o=l}finally{try{s||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return g(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function v(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function O(e,t){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},O(e,t)}function w(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=C(e);if(t){var o=C(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===m(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return j(e)}(this,r)}}function j(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function C(e){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},C(e)}function F(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}h.displayName="StyledTextarea",h.displayName="StyledTextarea";var x=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&O(e,t)}(u,e);var t,r,a,l=w(u);function u(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return F(j(e=l.call.apply(l,[this].concat(r))),"state",{isFocused:e.props.autoFocus||!1}),F(j(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t)})),F(j(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t)})),e}return t=u,(r=[{key:"render",value:function(){var e=this.props.overrides,t=void 0===e?{}:e,r=b((0,o._O)(t.Root,p),2),a=r[0],l=r[1],u=(0,o.Qp)({Input:{component:h},InputContainer:{component:f}},t);return n.createElement(a,y({"data-baseweb":"textarea",$isFocused:this.state.isFocused,$isReadOnly:this.props.readOnly,$disabled:this.props.disabled,$error:this.props.error,$positive:this.props.positive,$required:this.props.required,$resize:this.props.resize},l),n.createElement(i.A,y({},this.props,{type:s.GT.textarea,overrides:u,onFocus:this.onFocus,onBlur:this.onBlur,resize:this.props.resize})))}}])&&v(t.prototype,r),a&&v(t,a),Object.defineProperty(t,"prototype",{writable:!1}),u}(n.Component);F(x,"defaultProps",{autoFocus:!1,disabled:!1,readOnly:!1,error:!1,name:"",onBlur:function(){},onChange:function(){},onKeyDown:function(){},onKeyPress:function(){},onKeyUp:function(){},onFocus:function(){},overrides:{},placeholder:"",required:!1,rows:3,size:s.SK.default});const P=x},32698:(e,t,r)=>{var n=r(30136),o=0;e.exports=function(e){var t=++o;return n(e)+t}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[5711],{45711:(e,t,o)=>{o.r(t),o.d(t,{default:()=>P});var n=o(58878),i=o(8151),s=o(77099),a=o(59237),r=o(28430),l=o(71034),d=o.n(l),c=o(25571),h=o(84996),m=o(22044),u=o(67253),g=o(34752),p=o(85729);const f={DATAFRAME_INDEX:"(index)"},v=new Set([p.sj.DatetimeIndex,p.sj.Float64Index,p.sj.Int64Index,p.sj.RangeIndex,p.sj.UInt64Index]);function b(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.D0.getTypeName(e.types.index[0]),a=v.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.D0.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 x=o(37638),y=o.n(x),S=o(42274),F=o.n(S),C=o(58144);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.lH)(t),titleFontStyle:"normal",labelFontSize:t.fontSizes.twoSmPx,labelFontWeight:t.fontWeights.normal,labelColor:(0,C.lH)(t),labelFontStyle:"normal"},axis:{labelFontSize:t.fontSizes.twoSmPx,labelFontWeight:t.fontWeights.normal,labelColor:(0,C.lH)(t),labelFontStyle:"normal",titleFontWeight:t.fontWeights.normal,titleFontSize:t.fontSizes.smPx,titleColor:(0,C.lH)(t),titleFontStyle:"normal",ticks:!1,gridColor:(0,C.V9)(t),domain:!1,domainWidth:1,domainColor:(0,C.V9)(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.lH)(t),titleFontSize:t.fontSizes.smPx,titleFontWeight:t.fontWeights.normal,titleFontStyle:"normal",titleColor:(0,C.lH)(t),titlePadding:5,labelPadding:t.spacing.lgPx,columnPadding:t.spacing.smPx,rowPadding:t.spacing.twoXSPx,padding:7,symbolStrokeWidth:4},range:{category:(0,C.c6)(t),diverging:(0,C.vk)(t),ramp:(0,C.rp)(t),heatmap:(0,C.rp)(t)},view:{columns:1,strokeWidth:0,stroke:"transparent",continuousHeight:350,continuousWidth:400},concat:{columns:1},facet:{columns:1},mark:{tooltip:!0,...(0,C.iq)(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 V=(0,o(89653).A)("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:`${t.sizes.borderWidth} solid ${t.colors.fadedText10}`,a:{fontFamily:t.genericFonts.bodyFont,fontWeight:t.fontWeights.normal,fontSize:t.fontSizes.md,margin:0,padding:`${t.spacing.twoXS} ${t.spacing.twoXL}`,color:t.colors.bodyText},"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 W=o(90782);const D="source";class I extends n.PureComponent{constructor(){super(...arguments),this.vegaView=void 0,this.vegaFinalizer=void 0,this.defaultDataName=D,this.element=null,this.formClearHelper=new g.o,this.state={error:void 0},this.finalizeView=()=>{this.vegaFinalizer&&this.vegaFinalizer(),this.vegaFinalizer=void 0,this.vegaView=void 0},this.generateSpec=()=>{var e,t;const{element: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.V9)(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.V9)(t),continuousHeight:350,continuousWidth:400},mark:{tooltip:!0}};return e?y()({},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={}),(0,c.hX)(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.hX)(t.select.encodings)&&(t.select.encodings=Object.keys(e.encoding)))}))}(r),r},this.maybeConfigureSelections=()=>{if(void 0===this.vegaView)return;const{widgetMgr:e,element:t}=this.props;if(null===t||void 0===t||!t.id||0===t.selectionMode.length)return;const o=e.getElementState(this.props.element.id,"viewState");if((0,c.se)(o))try{this.vegaView=this.vegaView.setState(o)}catch(i){(0,h.FF)("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.sg)(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=>`${t}_store`===e)),recurse:!1});(0,c.se)(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,u.$)(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.OG)("Vega spec changed.");try{await this.createView()}catch(g){const e=(0,u.$)(g);this.setState({error:e})}return}const r=t.data,{data:l}=n;(r||l)&&this.updateData(this.defaultDataName,r,l);const c=b(t)||{},m=b(n)||{};for(const[d,h]of Object.entries(m)){const e=d||this.defaultDataName,t=c[e];this.updateData(e,t,h)}for(const d of Object.keys(c))m.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.OG)(`Had to clear the ${e} dataset before inserting data through Vega view.`)):n<s&&this.vegaView.insert(e,w(o,n))}async createView(){if((0,h.OG)("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.P,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,forceActionsMenu:!0},{vgSpec:n,view:i,finalize:a}=await(0,s.Ay)(this.element,t,o);this.vegaView=i,this.maybeConfigureSelections(),this.vegaFinalizer=a;const l=function(e){const t=b(e);if((0,c.hX)(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=D);const m=function(e){const t=e.data;return t&&0!==t.data.numRows?w(t):null}(e);if(m&&i.insert(this.defaultDataName,m),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,W.jsx)(V,{"data-testid":"stVegaLiteChart",className:"stVegaLiteChart",useContainerWidth:this.props.element.useContainerWidth,isFullScreen:this.props.isFullScreen,ref:e=>{this.element=e}})}}const P=(0,i.b)((0,m.A)(I))},22044:(e,t,o)=>{o.d(t,{A:()=>v});var n=o(58878),i=o(53124),s=o.n(i),a=o(8151),r=o(41514),l=o(67214),d=o(64611),c=o(84152),h=o(89653);const m=(0,h.A)("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"}}}),""),u=(0,h.A)("div",{target:"e1vs0wn30"})((e=>{let{theme:t,isExpanded:o}=e;return{"&:hover":{[m]:{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:t.sizes.fullScreenHeaderHeight,overflow:["auto","overlay"],display:"flex",alignItems:"center",justifyContent:"center"}:{}}}),"");var g=o(90782);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(this.props.theme.sizes.fullScreenHeaderHeight);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.u,h=this.zoomIn,p="View fullscreen";return e&&(c=l.Q,h=this.zoomOut,p="Exit fullscreen"),(0,g.jsxs)(u,{isExpanded:e,"data-testid":"stFullScreenFrame",children:[!a&&(0,g.jsx)(m,{"data-testid":"StyledFullScreenButton",onClick:h,title:p,isExpanded:e,children:(0,g.jsx)(d.A,{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.n;const f=(0,a.b)(p);const v=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(${e.displayName||e.name})`,s()(o,e)}},34752:(e,t,o)=>{o.d(t,{X:()=>a,o:()=>s});var n=o(58878),i=o(25571);class s{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,o){(0,i.se)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,i._L)(t)&&(this.formClearListener=e.addFormClearedListener(t,o),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}function a(e){let{element:t,widgetMgr:o,onFormCleared:s}=e;(0,n.useEffect)((()=>{if(!(0,i._L)(t.formId))return;const e=o.addFormClearedListener(t.formId,s);return()=>{e.disconnect()}}),[t,o,s])}}}]);
1
+ "use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[5711],{45711:(e,t,o)=>{o.r(t),o.d(t,{default:()=>P});var n=o(58878),i=o(8151),s=o(72037),a=o(59237),r=o(28430),l=o(71034),d=o.n(l),c=o(25571),h=o(84996),m=o(22044),u=o(67253),g=o(34752),p=o(85729);const f={DATAFRAME_INDEX:"(index)"},v=new Set([p.sj.DatetimeIndex,p.sj.Float64Index,p.sj.Int64Index,p.sj.RangeIndex,p.sj.UInt64Index]);function b(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.D0.getTypeName(e.types.index[0]),a=v.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.D0.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 x=o(37638),y=o.n(x),S=o(42274),F=o.n(S),C=o(58144);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.lH)(t),titleFontStyle:"normal",labelFontSize:t.fontSizes.twoSmPx,labelFontWeight:t.fontWeights.normal,labelColor:(0,C.lH)(t),labelFontStyle:"normal"},axis:{labelFontSize:t.fontSizes.twoSmPx,labelFontWeight:t.fontWeights.normal,labelColor:(0,C.lH)(t),labelFontStyle:"normal",titleFontWeight:t.fontWeights.normal,titleFontSize:t.fontSizes.smPx,titleColor:(0,C.lH)(t),titleFontStyle:"normal",ticks:!1,gridColor:(0,C.V9)(t),domain:!1,domainWidth:1,domainColor:(0,C.V9)(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.lH)(t),titleFontSize:t.fontSizes.smPx,titleFontWeight:t.fontWeights.normal,titleFontStyle:"normal",titleColor:(0,C.lH)(t),titlePadding:5,labelPadding:t.spacing.lgPx,columnPadding:t.spacing.smPx,rowPadding:t.spacing.twoXSPx,padding:7,symbolStrokeWidth:4},range:{category:(0,C.c6)(t),diverging:(0,C.vk)(t),ramp:(0,C.rp)(t),heatmap:(0,C.rp)(t)},view:{columns:1,strokeWidth:0,stroke:"transparent",continuousHeight:350,continuousWidth:400},concat:{columns:1},facet:{columns:1},mark:{tooltip:!0,...(0,C.iq)(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 V=(0,o(89653).A)("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:`${t.sizes.borderWidth} solid ${t.colors.fadedText10}`,a:{fontFamily:t.genericFonts.bodyFont,fontWeight:t.fontWeights.normal,fontSize:t.fontSizes.md,margin:0,padding:`${t.spacing.twoXS} ${t.spacing.twoXL}`,color:t.colors.bodyText},"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 W=o(90782);const D="source";class I extends n.PureComponent{constructor(){super(...arguments),this.vegaView=void 0,this.vegaFinalizer=void 0,this.defaultDataName=D,this.element=null,this.formClearHelper=new g.o,this.state={error:void 0},this.finalizeView=()=>{this.vegaFinalizer&&this.vegaFinalizer(),this.vegaFinalizer=void 0,this.vegaView=void 0},this.generateSpec=()=>{var e,t;const{element: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.V9)(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.V9)(t),continuousHeight:350,continuousWidth:400},mark:{tooltip:!0}};return e?y()({},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={}),(0,c.hX)(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.hX)(t.select.encodings)&&(t.select.encodings=Object.keys(e.encoding)))}))}(r),r},this.maybeConfigureSelections=()=>{if(void 0===this.vegaView)return;const{widgetMgr:e,element:t}=this.props;if(null===t||void 0===t||!t.id||0===t.selectionMode.length)return;const o=e.getElementState(this.props.element.id,"viewState");if((0,c.se)(o))try{this.vegaView=this.vegaView.setState(o)}catch(i){(0,h.FF)("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.sg)(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=>`${t}_store`===e)),recurse:!1});(0,c.se)(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,u.$)(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.OG)("Vega spec changed.");try{await this.createView()}catch(g){const e=(0,u.$)(g);this.setState({error:e})}return}const r=t.data,{data:l}=n;(r||l)&&this.updateData(this.defaultDataName,r,l);const c=b(t)||{},m=b(n)||{};for(const[d,h]of Object.entries(m)){const e=d||this.defaultDataName,t=c[e];this.updateData(e,t,h)}for(const d of Object.keys(c))m.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.OG)(`Had to clear the ${e} dataset before inserting data through Vega view.`)):n<s&&this.vegaView.insert(e,w(o,n))}async createView(){if((0,h.OG)("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.P,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,forceActionsMenu:!0},{vgSpec:n,view:i,finalize:a}=await(0,s.Ay)(this.element,t,o);this.vegaView=i,this.maybeConfigureSelections(),this.vegaFinalizer=a;const l=function(e){const t=b(e);if((0,c.hX)(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=D);const m=function(e){const t=e.data;return t&&0!==t.data.numRows?w(t):null}(e);if(m&&i.insert(this.defaultDataName,m),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,W.jsx)(V,{"data-testid":"stVegaLiteChart",className:"stVegaLiteChart",useContainerWidth:this.props.element.useContainerWidth,isFullScreen:this.props.isFullScreen,ref:e=>{this.element=e}})}}const P=(0,i.b)((0,m.A)(I))},22044:(e,t,o)=>{o.d(t,{A:()=>v});var n=o(58878),i=o(53124),s=o.n(i),a=o(8151),r=o(41514),l=o(67214),d=o(64611),c=o(84152),h=o(89653);const m=(0,h.A)("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"}}}),""),u=(0,h.A)("div",{target:"e1vs0wn30"})((e=>{let{theme:t,isExpanded:o}=e;return{"&:hover":{[m]:{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:t.sizes.fullScreenHeaderHeight,overflow:["auto","overlay"],display:"flex",alignItems:"center",justifyContent:"center"}:{}}}),"");var g=o(90782);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(this.props.theme.sizes.fullScreenHeaderHeight);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.u,h=this.zoomIn,p="View fullscreen";return e&&(c=l.Q,h=this.zoomOut,p="Exit fullscreen"),(0,g.jsxs)(u,{isExpanded:e,"data-testid":"stFullScreenFrame",children:[!a&&(0,g.jsx)(m,{"data-testid":"StyledFullScreenButton",onClick:h,title:p,isExpanded:e,children:(0,g.jsx)(d.A,{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.n;const f=(0,a.b)(p);const v=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(${e.displayName||e.name})`,s()(o,e)}},34752:(e,t,o)=>{o.d(t,{X:()=>a,o:()=>s});var n=o(58878),i=o(25571);class s{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,o){(0,i.se)(this.formClearListener)&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,i._L)(t)&&(this.formClearListener=e.addFormClearedListener(t,o),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}function a(e){let{element:t,widgetMgr:o,onFormCleared:s}=e;(0,n.useEffect)((()=>{if(!(0,i._L)(t.formId))return;const e=o.addFormClearedListener(t.formId,s);return()=>{e.disconnect()}}),[t,o,s])}}}]);