streamlit-nightly 1.53.2.dev20260128__py3-none-any.whl → 1.53.2.dev20260131__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 (222) hide show
  1. streamlit/config.py +3 -2
  2. streamlit/config_util.py +63 -8
  3. streamlit/elements/deck_gl_json_chart.py +5 -1
  4. streamlit/elements/lib/built_in_chart_utils.py +24 -4
  5. streamlit/elements/lib/color_util.py +20 -1
  6. streamlit/elements/vega_charts.py +24 -4
  7. streamlit/proto/Alert_pb2.py +2 -3
  8. streamlit/proto/AppPage_pb2.py +2 -3
  9. streamlit/proto/ArrowData_pb2.py +2 -3
  10. streamlit/proto/ArrowNamedDataSet_pb2.py +2 -3
  11. streamlit/proto/ArrowVegaLiteChart_pb2.py +2 -3
  12. streamlit/proto/Arrow_pb2.py +11 -18
  13. streamlit/proto/Arrow_pb2.pyi +1 -42
  14. streamlit/proto/AudioInput_pb2.py +2 -3
  15. streamlit/proto/Audio_pb2.py +2 -3
  16. streamlit/proto/AuthRedirect_pb2.py +2 -3
  17. streamlit/proto/AutoRerun_pb2.py +2 -3
  18. streamlit/proto/BackMsg_pb2.py +2 -3
  19. streamlit/proto/Balloons_pb2.py +2 -3
  20. streamlit/proto/BidiComponent_pb2.py +2 -3
  21. streamlit/proto/Block_pb2.py +36 -43
  22. streamlit/proto/Block_pb2.pyi +3 -48
  23. streamlit/proto/BokehChart_pb2.py +2 -3
  24. streamlit/proto/ButtonGroup_pb2.py +2 -3
  25. streamlit/proto/ButtonLikeIconPosition_pb2.py +2 -3
  26. streamlit/proto/Button_pb2.py +3 -6
  27. streamlit/proto/Button_pb2.pyi +1 -18
  28. streamlit/proto/CameraInput_pb2.py +2 -3
  29. streamlit/proto/ChatInput_pb2.py +5 -8
  30. streamlit/proto/ChatInput_pb2.pyi +1 -17
  31. streamlit/proto/Checkbox_pb2.py +2 -3
  32. streamlit/proto/ClientState_pb2.py +2 -3
  33. streamlit/proto/Code_pb2.py +3 -6
  34. streamlit/proto/Code_pb2.pyi +1 -18
  35. streamlit/proto/ColorPicker_pb2.py +2 -3
  36. streamlit/proto/Common_pb2.py +7 -8
  37. streamlit/proto/Common_pb2.pyi +2 -10
  38. streamlit/proto/Components_pb2.py +2 -3
  39. streamlit/proto/DateInput_pb2.py +2 -3
  40. streamlit/proto/DateTimeInput_pb2.py +2 -3
  41. streamlit/proto/DeckGlJsonChart_pb2.py +5 -12
  42. streamlit/proto/DeckGlJsonChart_pb2.pyi +1 -54
  43. streamlit/proto/Delta_pb2.py +4 -6
  44. streamlit/proto/Delta_pb2.pyi +5 -14
  45. streamlit/proto/DocString_pb2.py +2 -3
  46. streamlit/proto/DownloadButton_pb2.py +2 -3
  47. streamlit/proto/Element_pb2.py +4 -7
  48. streamlit/proto/Element_pb2.pyi +3 -23
  49. streamlit/proto/Empty_pb2.py +2 -3
  50. streamlit/proto/Exception_pb2.py +2 -3
  51. streamlit/proto/Favicon_pb2.py +2 -3
  52. streamlit/proto/FileUploader_pb2.py +2 -3
  53. streamlit/proto/ForwardMsg_pb2.py +12 -18
  54. streamlit/proto/ForwardMsg_pb2.pyi +4 -48
  55. streamlit/proto/GapSize_pb2.py +2 -3
  56. streamlit/proto/GitInfo_pb2.py +2 -3
  57. streamlit/proto/GraphVizChart_pb2.py +3 -6
  58. streamlit/proto/GraphVizChart_pb2.pyi +1 -18
  59. streamlit/proto/Heading_pb2.py +2 -3
  60. streamlit/proto/HeightConfig_pb2.py +2 -3
  61. streamlit/proto/Html_pb2.py +2 -3
  62. streamlit/proto/IFrame_pb2.py +3 -10
  63. streamlit/proto/IFrame_pb2.pyi +1 -42
  64. streamlit/proto/Image_pb2.py +3 -6
  65. streamlit/proto/Image_pb2.pyi +1 -18
  66. streamlit/proto/Json_pb2.py +2 -3
  67. streamlit/proto/LabelVisibilityMessage_pb2.py +2 -3
  68. streamlit/proto/LinkButton_pb2.py +2 -3
  69. streamlit/proto/Logo_pb2.py +2 -3
  70. streamlit/proto/Markdown_pb2.py +2 -3
  71. streamlit/proto/Metric_pb2.py +2 -3
  72. streamlit/proto/MetricsEvent_pb2.py +2 -3
  73. streamlit/proto/MultiSelect_pb2.py +3 -6
  74. streamlit/proto/MultiSelect_pb2.pyi +1 -11
  75. streamlit/proto/Navigation_pb2.py +2 -3
  76. streamlit/proto/NewSession_pb2.py +27 -28
  77. streamlit/proto/NewSession_pb2.pyi +2 -12
  78. streamlit/proto/NumberInput_pb2.py +2 -3
  79. streamlit/proto/PageConfig_pb2.py +2 -3
  80. streamlit/proto/PageInfo_pb2.py +2 -3
  81. streamlit/proto/PageLink_pb2.py +2 -3
  82. streamlit/proto/PageNotFound_pb2.py +2 -3
  83. streamlit/proto/PageProfile_pb2.py +2 -3
  84. streamlit/proto/ParentMessage_pb2.py +2 -3
  85. streamlit/proto/PlotlyChart_pb2.py +5 -10
  86. streamlit/proto/PlotlyChart_pb2.pyi +1 -58
  87. streamlit/proto/Progress_pb2.py +2 -3
  88. streamlit/proto/Radio_pb2.py +3 -6
  89. streamlit/proto/Radio_pb2.pyi +2 -19
  90. streamlit/proto/RootContainer_pb2.py +2 -3
  91. streamlit/proto/Selectbox_pb2.py +3 -6
  92. streamlit/proto/Selectbox_pb2.pyi +2 -19
  93. streamlit/proto/SessionEvent_pb2.py +2 -3
  94. streamlit/proto/SessionStatus_pb2.py +2 -3
  95. streamlit/proto/Skeleton_pb2.py +2 -3
  96. streamlit/proto/Slider_pb2.py +2 -3
  97. streamlit/proto/Snow_pb2.py +2 -3
  98. streamlit/proto/Space_pb2.py +2 -3
  99. streamlit/proto/Spinner_pb2.py +2 -3
  100. streamlit/proto/TextAlignmentConfig_pb2.py +2 -3
  101. streamlit/proto/TextArea_pb2.py +3 -6
  102. streamlit/proto/TextArea_pb2.pyi +1 -18
  103. streamlit/proto/TextInput_pb2.py +2 -3
  104. streamlit/proto/Text_pb2.py +2 -3
  105. streamlit/proto/TimeInput_pb2.py +2 -3
  106. streamlit/proto/Toast_pb2.py +2 -3
  107. streamlit/proto/Transient_pb2.py +2 -3
  108. streamlit/proto/Video_pb2.py +2 -3
  109. streamlit/proto/WidgetStates_pb2.py +2 -3
  110. streamlit/proto/WidthConfig_pb2.py +2 -3
  111. streamlit/proto/openmetrics_data_model_pb2.py +2 -3
  112. streamlit/runtime/runtime.py +0 -4
  113. streamlit/static/index.html +1 -1
  114. streamlit/static/manifest.json +295 -295
  115. streamlit/static/static/js/{ErrorOutline.esm.D71F8ziR.js → ErrorOutline.esm.DC6KVDKK.js} +1 -1
  116. streamlit/static/static/js/{FileDownload.esm.yTkppsJy.js → FileDownload.esm.Z9hRQIHi.js} +1 -1
  117. streamlit/static/static/js/{FileHelper.hUOqtbwa.js → FileHelper.DqvW90pm.js} +1 -1
  118. streamlit/static/static/js/{FormClearHelper.DN8D_YXO.js → FormClearHelper.DTFnX0js.js} +1 -1
  119. streamlit/static/static/js/{InputInstructions.DbssY6d4.js → InputInstructions.CdzsN_Va.js} +1 -1
  120. streamlit/static/static/js/{Particles.BznyVdfo.js → Particles.12xFSjcn.js} +1 -1
  121. streamlit/static/static/js/{ProgressBar.C5uBOtcx.js → ProgressBar.Dg-oMbWg.js} +1 -1
  122. streamlit/static/static/js/{StreamlitSyntaxHighlighter.Nf1895x-.js → StreamlitSyntaxHighlighter.rbzmcipw.js} +1 -1
  123. streamlit/static/static/js/{TableChart.esm.DHKzVs3a.js → TableChart.esm.CzJtGIR-.js} +1 -1
  124. streamlit/static/static/js/{Toolbar.CQsWYXer.js → Toolbar.COH7NaOE.js} +1 -1
  125. streamlit/static/static/js/{WidgetLabelHelpIconInline.6xCU76OE.js → WidgetLabelHelpIconInline.Dlc8f0Ji.js} +1 -1
  126. streamlit/static/static/js/{base-input.Cs-E6S71.js → base-input.Q-zJLgRK.js} +4 -4
  127. streamlit/static/static/js/{checkbox.OTGupu18.js → checkbox.BKgWNdeI.js} +1 -1
  128. streamlit/static/static/js/{createDownloadLinkElement.DnBEQQbK.js → createDownloadLinkElement.6oO-YlYv.js} +1 -1
  129. streamlit/static/static/js/{data-grid-overlay-editor.COiiMi5r.js → data-grid-overlay-editor.CO0xdNiG.js} +1 -1
  130. streamlit/static/static/js/{downloader.K0GUNeuj.js → downloader.BBXcXdX1.js} +1 -1
  131. streamlit/static/static/js/{embed.o8HvK3mH.js → embed.CJzOXYBF.js} +1 -1
  132. streamlit/static/static/js/{es6.BHy5pqTP.js → es6.CdxPQzwJ.js} +2 -2
  133. streamlit/static/static/js/{formatNumber.BK7h0k2z.js → formatNumber.DB5irY8c.js} +1 -1
  134. streamlit/static/static/js/{iconPosition.2YynQUxu.js → iconPosition.BVScIr6G.js} +1 -1
  135. streamlit/static/static/js/{iframeResizer.contentWindow.D5h3hQuU.js → iframeResizer.contentWindow.D_QHVqPM.js} +1 -1
  136. streamlit/static/static/js/{index.cfuZ69LI.js → index.6DFY6LUF.js} +1 -1
  137. streamlit/static/static/js/{index.Dh3PJIlq.js → index.B80gSxrS.js} +1 -1
  138. streamlit/static/static/js/{index.DxfYCrPp.js → index.BDtN2n7T.js} +1 -1
  139. streamlit/static/static/js/{index.DLUSo6de.js → index.BED2_zc7.js} +1 -1
  140. streamlit/static/static/js/{index.CxWzt6oi.js → index.BQnLeHnr.js} +1 -1
  141. streamlit/static/static/js/{index.Cb03y5I8.js → index.BSYebegS.js} +1 -1
  142. streamlit/static/static/js/{index.BtuskCwg.js → index.BSpYHDvk.js} +1 -1
  143. streamlit/static/static/js/{index.q0ceUXt6.js → index.BiCbrx53.js} +1 -1
  144. streamlit/static/static/js/{index.CgVv04GM.js → index.Biyf9aUg.js} +1 -1
  145. streamlit/static/static/js/{index.BPdmXoYW.js → index.BqbKiDp2.js} +1 -1
  146. streamlit/static/static/js/{index.COh5V_89.js → index.BqxwnMem.js} +1 -1
  147. streamlit/static/static/js/{index.DVRCyxMp.js → index.BtOoVQt7.js} +1 -1
  148. streamlit/static/static/js/{index.C7wst9Tm.js → index.BxMkW82k.js} +1 -1
  149. streamlit/static/static/js/{index.5zqfJ-in.js → index.BxQxTpWl.js} +1 -1
  150. streamlit/static/static/js/{index.BtRWcqZV.js → index.C5oqIM3a.js} +1 -1
  151. streamlit/static/static/js/{index.iUV9rb8C.js → index.CBE2cIbj.js} +1 -1
  152. streamlit/static/static/js/{index.DcngUOyD.js → index.CE2WIFD1.js} +1 -1
  153. streamlit/static/static/js/{index.aCorc3Yt.js → index.CPc_uZux.js} +48 -48
  154. streamlit/static/static/js/{index.Bqmx23jK.js → index.CUYi3FrD.js} +1 -1
  155. streamlit/static/static/js/index.Cpu2p5bH.js +1 -0
  156. streamlit/static/static/js/{index.Bfo1cXfC.js → index.CrY1BsL3.js} +1 -1
  157. streamlit/static/static/js/{index.Dc5-tFdw.js → index.CtbETWQK.js} +1 -1
  158. streamlit/static/static/js/{index.CUkhn-vu.js → index.CvtybR-u.js} +1 -1
  159. streamlit/static/static/js/{index.BZ-GJVxB.js → index.CxoREvnF.js} +1 -1
  160. streamlit/static/static/js/{index.C6wyTXhz.js → index.D6OexhdL.js} +1 -1
  161. streamlit/static/static/js/{index.HmRK3HyC.js → index.D9v2Y8Gk.js} +1 -1
  162. streamlit/static/static/js/{index.8MlRyIxN.js → index.DAfIQKfP.js} +1 -1
  163. streamlit/static/static/js/index.DAnczAW2.js +2 -0
  164. streamlit/static/static/js/{index.TjMWsKSH.js → index.DAyGxxdm.js} +1 -1
  165. streamlit/static/static/js/{index.6c-qDsD7.js → index.DCe7fo-m.js} +1 -1
  166. streamlit/static/static/js/{index.CX0KdFyR.js → index.DNfyKqhQ.js} +1 -1
  167. streamlit/static/static/js/{index.DJfMW0Gy.js → index.DRoJNzFX.js} +1 -1
  168. streamlit/static/static/js/{index.DBPWUJsj.js → index.DU68jVpM.js} +54 -54
  169. streamlit/static/static/js/{index.BfMPq234.js → index.DZmBuE3z.js} +2 -2
  170. streamlit/static/static/js/{index.CYhhEdja.js → index.DhRAGiPR.js} +1 -1
  171. streamlit/static/static/js/{index.DlgcEr0f.js → index.DrcbvB2t.js} +1 -1
  172. streamlit/static/static/js/{index.DxGXuhh6.js → index.Dud7RRHc.js} +1 -1
  173. streamlit/static/static/js/{index.C2EoeVjP.js → index.DyXcT2tD.js} +1 -1
  174. streamlit/static/static/js/{index.Bgf49D1Z.js → index.DyfvmNCy.js} +222 -222
  175. streamlit/static/static/js/{index.CZf7Go1Z.js → index.GieKl4BG.js} +1 -1
  176. streamlit/static/static/js/{index.C65jHNhe.js → index.YULCxEtm.js} +1 -1
  177. streamlit/static/static/js/{index.DL_yE83J.js → index._1zqETQ9.js} +2 -2
  178. streamlit/static/static/js/{index.CwtpGPHA.js → index.bQJYmJ2T.js} +1 -1
  179. streamlit/static/static/js/{index.hlAfdSqC.js → index.iXh5nbLZ.js} +1 -1
  180. streamlit/static/static/js/index.mSdC1FV6.js +1 -0
  181. streamlit/static/static/js/{index.BIqcOZ_u.js → index.nL1fkE1D.js} +1 -1
  182. streamlit/static/static/js/{index.VwDKazgt.js → index.tuFFlbxa.js} +1 -1
  183. streamlit/static/static/js/{index.BzTVI_BY.js → index.y-pa6LIX.js} +1 -1
  184. streamlit/static/static/js/{input.CXGIJ7D6.js → input.BcC6sPE_.js} +1 -1
  185. streamlit/static/static/js/{main.CCVkbuxC.js → main.TU5_aabd.js} +1 -1
  186. streamlit/static/static/js/{memory.CNbnYs2A.js → memory.By_OTlI4.js} +1 -1
  187. streamlit/static/static/js/{number-overlay-editor.CvI6wkld.js → number-overlay-editor.FSRaRpbU.js} +1 -1
  188. streamlit/static/static/js/{pandasStylerUtils.CFSReOTm.js → pandasStylerUtils.3IiIKU9-.js} +1 -1
  189. streamlit/static/static/js/{sandbox.Bld0L3us.js → sandbox.DnxTbWzV.js} +1 -1
  190. streamlit/static/static/js/{styled-components.BoUHK6TA.js → styled-components.BeEcZ0vW.js} +1 -1
  191. streamlit/static/static/js/{throttle.ByDFm7WV.js → throttle.emUyC44c.js} +1 -1
  192. streamlit/static/static/js/{timepicker.CN6CUZEL.js → timepicker.DZ_ZufYF.js} +1 -1
  193. streamlit/static/static/js/{toConsumableArray.DwMycSpg.js → toConsumableArray.DDV1bN1-.js} +1 -1
  194. streamlit/static/static/js/uniqueId.DTwvAE-J.js +1 -0
  195. streamlit/static/static/js/{useBasicWidgetState.Bg0ZMUt5.js → useBasicWidgetState.DvpdEDYZ.js} +1 -1
  196. streamlit/static/static/js/{useIntlLocale.DgBUDcPA.js → useIntlLocale.BBDLbTq9.js} +1 -1
  197. streamlit/static/static/js/{useTextInputAutoExpand.DDBezxks.js → useTextInputAutoExpand.BIApLJKn.js} +1 -1
  198. streamlit/static/static/js/{useUpdateUiValue.Df1h6fXC.js → useUpdateUiValue.DQ4RuJNC.js} +1 -1
  199. streamlit/static/static/js/{useWaveformController.DbWw5MEk.js → useWaveformController.B0olyXLQ.js} +1 -1
  200. streamlit/static/static/js/{withCalculatedWidth.YaK0HIIP.js → withCalculatedWidth.DYeqePuh.js} +1 -1
  201. streamlit/static/static/js/{withFullScreenWrapper.CcWCKoY8.js → withFullScreenWrapper.DtkUCO_d.js} +1 -1
  202. streamlit/testing/v1/element_tree.py +16 -2
  203. streamlit/web/server/server.py +0 -1
  204. streamlit/web/server/starlette/starlette_app.py +0 -1
  205. {streamlit_nightly-1.53.2.dev20260128.dist-info → streamlit_nightly-1.53.2.dev20260131.dist-info}/METADATA +10 -25
  206. {streamlit_nightly-1.53.2.dev20260128.dist-info → streamlit_nightly-1.53.2.dev20260131.dist-info}/RECORD +209 -218
  207. streamlit/proto/DataFrame_pb2.py +0 -56
  208. streamlit/proto/DataFrame_pb2.pyi +0 -430
  209. streamlit/proto/NamedDataSet_pb2.py +0 -28
  210. streamlit/proto/NamedDataSet_pb2.pyi +0 -67
  211. streamlit/proto/PagesChanged_pb2.py +0 -28
  212. streamlit/proto/PagesChanged_pb2.pyi +0 -55
  213. streamlit/proto/VegaLiteChart_pb2.py +0 -29
  214. streamlit/proto/VegaLiteChart_pb2.pyi +0 -79
  215. streamlit/static/static/js/index.CSPY26T2.js +0 -1
  216. streamlit/static/static/js/index.CdsyTabv.js +0 -1
  217. streamlit/static/static/js/index.CjRU8O1O.js +0 -2
  218. streamlit/static/static/js/uniqueId.DcCWa2cf.js +0 -1
  219. streamlit_nightly-1.53.2.dev20260128.data/scripts/streamlit.cmd +0 -16
  220. {streamlit_nightly-1.53.2.dev20260128.dist-info → streamlit_nightly-1.53.2.dev20260131.dist-info}/WHEEL +0 -0
  221. {streamlit_nightly-1.53.2.dev20260128.dist-info → streamlit_nightly-1.53.2.dev20260131.dist-info}/entry_points.txt +0 -0
  222. {streamlit_nightly-1.53.2.dev20260128.dist-info → streamlit_nightly-1.53.2.dev20260131.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
1
- import{r as t,E as L,_ as D,L as ze,e as ue,n as F,aL as se,bW as Le,bQ as De,bP as Be,z as p,j as n,Y as Ve,o as x,B as We,ax as Me,b as Ne,l as Oe,aa as He,p as $e,ab as je,P as _e,ac as Xe}from"./index.aCorc3Yt.js";import{u as Ge}from"./useWaveformController.DbWw5MEk.js";import{T as qe,a as ce}from"./Toolbar.CQsWYXer.js";import{u as Ke,F as Qe}from"./FormClearHelper.DN8D_YXO.js";import{c as Ye}from"./createDownloadLinkElement.DnBEQQbK.js";import{E as Je}from"./urls.BwSlolu9.js";import{F as Ze,D as et}from"./FileDownload.esm.yTkppsJy.js";var fe=t.forwardRef(function(e,r){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return t.createElement(L,D({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),t.createElement("g",{fill:"none"},t.createElement("rect",{width:24,height:24}),t.createElement("rect",{width:24,height:24}),t.createElement("rect",{width:24,height:24})),t.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),t.createElement("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});fe.displayName="Mic";var pe=t.forwardRef(function(e,r){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return t.createElement(L,D({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),t.createElement("rect",{width:24,height:24,fill:"none"}),t.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))});pe.displayName="Pause";var me=t.forwardRef(function(e,r){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return t.createElement(L,D({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),t.createElement("rect",{width:24,height:24,fill:"none"}),t.createElement("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 000-1.69L9.54 5.98A.998.998 0 008 6.82z"}))});me.displayName="PlayArrow";var ge=t.forwardRef(function(e,r){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return t.createElement(L,D({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),t.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),t.createElement("path",{d:"M17.65 6.35a7.95 7.95 0 00-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 007.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 01-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0112 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z"}))});ge.displayName="Refresh";var he=t.forwardRef(function(e,r){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return t.createElement(L,D({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),t.createElement("g",{fill:"none"},t.createElement("rect",{width:24,height:24}),t.createElement("rect",{width:24,height:24})),t.createElement("path",{fillRule:"evenodd",d:"M9 16h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}))});he.displayName="StopCircle";const tt=(e,r)=>{const{enforceDownloadInNewTab:o=!1}=t.useContext(ze);return t.useCallback(()=>{if(!e)return;const l=Ye({enforceDownloadInNewTab:o,url:e,filename:r});l.style.display="none",document.body.appendChild(l),l.click(),document.body.removeChild(l)},[e,o,r])},j=({widgetMgr:e,id:r,formId:o,key:i,defaultValue:l})=>{t.useEffect(()=>{const s=e.getElementState(r,i);ue(s)&&F(l)&&e.setElementState(r,i,l)},[e,r,i,l]);const[R,g]=t.useState(e.getElementState(r,i)??l),c=t.useCallback(s=>{e.setElementState(r,i,s),g(s)},[e,r,i]),v=t.useMemo(()=>({formId:o||""}),[o]),E=t.useCallback(()=>c(l),[l,c]);return Ke({element:v,widgetMgr:e,onFormCleared:E}),[R,c]},rt=async({files:e,uploadClient:r,widgetMgr:o,widgetInfo:i,fragmentId:l,signal:R})=>{let g=[];try{g=await r.fetchFileURLs(e)}catch(s){return{successfulUploads:[],failedUploads:e.map(d=>({file:d,error:se(s)}))}}const c=Le(e,g),v=[],E=[];return await Promise.all(c.map(async([s,d])=>{if(!s||!d?.uploadUrl||!d.fileId)return{file:s,fileUrl:d,error:new Error("No upload URL found")};try{await r.uploadFile({id:d.fileId,formId:i.formId||""},d.uploadUrl,s,void 0,R),v.push({fileUrl:d,file:s})}catch(h){const O=se(h);E.push({file:s,error:O})}})),o.setFileUploaderStateValue(i,new De({uploadedFileInfo:v.map(({file:s,fileUrl:d})=>new Be({fileId:d.fileId,fileUrls:d,name:s.webkitRelativePath||s.name,size:s.size}))}),{fromUi:!0},l),{successfulUploads:v,failedUploads:E}},ot=p("div",{target:"e18uw4vz0"})(),de=p("div",{target:"e18uw4vz1"})(({theme:e,disabled:r})=>({height:e.sizes.largestElementHeight,width:"100%",background:e.colors.secondaryBg,borderRadius:e.radii.default,marginBottom:e.spacing.twoXS,display:"flex",alignItems:"center",position:"relative",paddingLeft:e.spacing.xs,paddingRight:e.spacing.sm,border:e.colors.widgetBorderColor?`${e.sizes.borderWidth} solid ${e.colors.widgetBorderColor}`:void 0,cursor:r?"not-allowed":"auto",overflow:"hidden"})),nt=p("div",{target:"e18uw4vz2"})({flex:1}),at=p("div",{target:"e18uw4vz3"})(({show:e,theme:r})=>({display:e?"block":"none",position:"relative",height:r.sizes.largestElementHeight,"& > div":{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center"}})),lt=p("span",{target:"e18uw4vz4"})(({theme:e,isPlayingOrRecording:r,disabled:o})=>({margin:e.spacing.sm,fontFamily:e.fonts.monospace,color:o?e.colors.fadedText40:r?e.colors.bodyText:e.colors.fadedText60,backgroundColor:e.colors.secondaryBg,fontSize:e.fontSizes.sm})),be=p("div",{target:"e18uw4vz5"})({width:"100%",textAlign:"center",overflow:"hidden"}),ve=p("span",{target:"e18uw4vz6"})(({theme:e})=>({color:e.colors.bodyText})),it=p("a",{target:"e18uw4vz7"})(({theme:e})=>({color:e.colors.link,textDecoration:e.linkUnderline?"underline":"none"})),st=p("div",{target:"e18uw4vz8"})(({theme:e})=>({flex:1,height:e.sizes.largestElementHeight,display:"flex",justifyContent:"center",alignItems:"center"})),ct=p("div",{target:"e18uw4vz9"})(({theme:e})=>{const r="0.625em";return{opacity:.2,width:"100%",height:r,backgroundSize:r,backgroundImage:`radial-gradient(${e.colors.fadedText10} 40%, transparent 40%)`,backgroundRepeat:"repeat"}}),dt=p("span",{target:"e18uw4vz10"})(({theme:e})=>({"& > button":{color:e.colors.primary,padding:e.spacing.threeXS},"& > button:hover, & > button:focus":{color:e.colors.redColor}})),ut=p("span",{target:"e18uw4vz11"})(({theme:e})=>({"& > button":{padding:e.spacing.threeXS,color:e.colors.fadedText60},"& > button:hover, & > button:focus":{color:e.colors.bodyText}})),ye=p("span",{target:"e18uw4vz12"})(({theme:e})=>({"& > button":{padding:e.spacing.threeXS,color:e.colors.fadedText60},"& > button:hover, & > button:focus":{color:e.colors.bodyText}})),_=p("div",{target:"e18uw4vz13"})(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",flexGrow:0,flexShrink:1,padding:e.spacing.xs,gap:e.spacing.twoXS,marginRight:e.spacing.twoXS})),z=({onClick:e,disabled:r,ariaLabel:o,iconContent:i})=>n(Ne,{kind:We.BORDERLESS_ICON,onClick:e,disabled:r,"aria-label":o,containerWidth:!0,"data-testid":"stAudioInputActionButton",children:n(Me,{content:i,size:"lg",color:"inherit"})}),ft=({disabled:e,stopRecording:r})=>n(dt,{children:n(z,{onClick:r,disabled:e,ariaLabel:"Stop recording",iconContent:he})}),pt=({disabled:e,isPlaying:r,onClickPlayPause:o})=>n(ye,{children:r?n(z,{onClick:o,disabled:e,ariaLabel:"Pause",iconContent:pe}):n(z,{onClick:o,disabled:e,ariaLabel:"Play",iconContent:me})}),mt=({disabled:e,startRecording:r})=>n(ut,{children:n(z,{onClick:r,disabled:e,ariaLabel:"Record",iconContent:fe})}),gt=({onClick:e})=>n(ye,{children:n(z,{disabled:!1,onClick:e,ariaLabel:"Reset",iconContent:ge})}),ht=({disabled:e,isRecording:r,isPlaying:o,isUploading:i,isError:l,recordingUrlExists:R,startRecording:g,stopRecording:c,onClickPlayPause:v,onClear:E})=>l?n(_,{children:n(gt,{onClick:E})}):i?n(_,{children:n(Ve,{size:"base",iconValue:"spinner"})}):x(_,{children:[r?n(ft,{disabled:e,stopRecording:c}):n(mt,{disabled:e,startRecording:g}),R&&n(pt,{disabled:e,isPlaying:o,onClickPlayPause:v})]}),bt=t.memo(ht),vt=()=>n(be,{children:n(ve,{children:"An error has occurred, please try again."})}),yt=t.memo(vt),C="00:00",A=e=>{const r=Math.floor(e/1e3),o=Math.floor(r/60),i=Math.floor(o/60),l=r%60,R=o%60,g=l.toString().padStart(2,"0"),c=R.toString().padStart(2,"0"),v=i.toString().padStart(2,"0");return o<60?`${c}:${g}`:`${v}:${c}:${g}`},wt=()=>x(be,{children:[n(ve,{children:"This app would like to use your microphone."})," ",n(it,{href:Je,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]}),St=t.memo(wt),Ct=()=>n(st,{children:n(ct,{})}),Rt=t.memo(Ct),Et=({element:e,uploadClient:r,widgetMgr:o,fragmentId:i,disabled:l})=>{const R=Oe(),g=t.useRef(null),[c,v]=t.useState(!1),[E,s]=t.useState(!1),[d,h]=t.useState(!1),[O,b]=t.useState(C),[B,V]=j({widgetMgr:o,id:e.id,key:"deleteFileUrl",defaultValue:null}),[m,W]=j({widgetMgr:o,id:e.id,key:"recordingUrl",defaultValue:null}),[H,I]=j({widgetMgr:o,id:e.id,formId:e.formId,key:"recordingTime",defaultValue:C}),U=t.useRef(null),w=t.useRef(null),u=t.useRef(null),X=e.id,S=e.formId,we=t.useCallback(async a=>{U.current&&U.current.abort();const y=new AbortController;U.current=y;try{if(s(!0),F(S)&&o.setFormsWithUploadsInProgress(new Set([S])),y.signal.aborted)return;let f;try{f=URL.createObjectURL(a),w.current&&w.current!==f&&URL.revokeObjectURL(w.current),w.current=f}catch{h(!0),s(!1),F(S)&&o.setFormsWithUploadsInProgress(new Set);return}if(y.signal.aborted){URL.revokeObjectURL(f),w.current=null;return}W(f);const Pe=new Date().toISOString().slice(0,16).replace(/:/g,"-"),Fe=new File([a],`${Pe}_audio.wav`,{type:a.type});try{const{successfulUploads:xe,failedUploads:Te}=await rt({files:[Fe],uploadClient:r,widgetMgr:o,widgetInfo:{id:X,formId:S},fragmentId:i,signal:y.signal});if(y.signal.aborted)return;if(Te.length>0){h(!0);return}h(!1);const ie=xe[0];ie?.fileUrl?.deleteUrl&&V(ie.fileUrl.deleteUrl)}catch{y.signal.aborted||h(!0)}finally{F(S)&&o.setFormsWithUploadsInProgress(new Set),y.signal.aborted||s(!1)}}catch{y.signal.aborted||(h(!0),s(!1)),F(S)&&o.setFormsWithUploadsInProgress(new Set)}},[r,o,X,S,i,V,W]),M=t.useRef(null),G=Ge({containerRef:g,sampleRate:e.sampleRate??void 0,waveformPadding:He(R.spacing.twoXS),events:{onPermissionDenied:()=>{v(!0)},onError:()=>{h(!0)},onRecordStart:()=>{I(C),b(C)},onRecordReady:()=>{const a=A(M.current?.playback.getDurationMs()??0);I(a),b(a)},onApprove:we,onCancel:()=>{I(C),b(C)},onProgressMs:a=>{I(A(a))},onPlaybackPause:()=>{b(A(M.current?.playback.getCurrentTimeMs()??0))},onPlaybackFinish:()=>{b(A(M.current?.playback.getDurationMs()??0))}}});M.current=G;const{state:N,isPlaybackPlaying:P,start:q,stop:K,approve:Q,cancel:Y,playback:{play:J,pause:Z,load:ee,getCurrentTimeMs:T,getDurationMs:te}}=G,k=t.useCallback(async({updateWidgetManager:a,deleteFile:y})=>{const f=m;if(f&&w.current===f&&(URL.revokeObjectURL(f),w.current=null),u.current&&(cancelAnimationFrame(u.current),u.current=null),W(null),V(null),b(C),I(C),Y(),a&&o.setFileUploaderStateValue(e,{},{fromUi:!0},i),y&&B)try{await r.deleteFile(B)}catch{}F(f)&&URL.revokeObjectURL(f)},[B,m,r,Y,e,o,i,I,V,W]);t.useEffect(()=>{const a=()=>{P&&(b(A(T())),u.current=requestAnimationFrame(a))};return P?u.current=requestAnimationFrame(a):u.current&&(cancelAnimationFrame(u.current),u.current=null),()=>{u.current&&(cancelAnimationFrame(u.current),u.current=null)}},[P,T]),t.useEffect(()=>{if(!m)return;let a=!1;return b(H),(async()=>{try{if(await ee(m),a)return;const f=te();f>0&&b(A(f))}catch{a||h(!0)}})(),()=>{a=!0}},[m,H,ee,te]),t.useEffect(()=>{if(ue(S))return;const a=new Qe;return a.manageFormClearListener(o,S,()=>{k({updateWidgetManager:!0,deleteFile:!1})}),()=>a.disconnect()},[S,k,o]),t.useEffect(()=>()=>{U.current&&(U.current.abort(),U.current=null),u.current&&(cancelAnimationFrame(u.current),u.current=null),w.current&&(URL.revokeObjectURL(w.current),w.current=null)},[]);const Se=t.useCallback(async()=>{try{if(P){const a=T();Z(),b(A(a))}else N==="idle"&&m&&(T()<=100&&b(C),await J())}catch{h(!0)}},[P,T,Z,J,m,N]),re=t.useCallback(async()=>{m&&await k({updateWidgetManager:!1,deleteFile:!0});try{b(C),await q()}catch{}},[k,m,q]),oe=t.useCallback(async()=>{try{const{blob:a}=await K();await Q(a)}catch{h(!0)}},[Q,K]),ne=tt(m,"recording.wav"),Ce=t.useCallback(()=>{re()},[re]),Re=t.useCallback(()=>{oe()},[oe]),Ee=t.useCallback(()=>{k({updateWidgetManager:!1,deleteFile:!0}),h(!1)},[k]),ke=t.useCallback(()=>{ne()},[ne]),Ae=t.useCallback(()=>{k({updateWidgetManager:!0,deleteFile:!0})},[k]),$=N==="recording",ae=P,Ie=$?H:O,le=N==="idle"&&!c&&!m,Ue=c||le||d;return x(ot,{className:"stAudioInput","data-testid":"stAudioInput",children:[n(Xe,{label:e.label,disabled:l,labelVisibility:$e(e.labelVisibility?.value),children:e.help&&n(je,{content:e.help,placement:_e.TOP,label:e.label})}),x(de,{disabled:l,children:[x(qe,{isFullScreen:!1,disableFullscreenMode:!0,target:de,children:[m&&n(ce,{label:"Download as WAV",icon:Ze,onClick:ke}),B&&n(ce,{label:"Clear recording",icon:et,onClick:Ae})]}),n(bt,{isRecording:$,isPlaying:ae,isUploading:E,isError:d,recordingUrlExists:!!m,startRecording:Ce,stopRecording:Re,onClickPlayPause:()=>{Se()},onClear:Ee,disabled:l||c}),x(nt,{children:[d&&n(yt,{}),le&&n(Rt,{}),c&&n(St,{}),n(at,{"data-testid":"stAudioInputWaveSurfer",ref:g,show:!Ue})]}),n(lt,{isPlayingOrRecording:$||ae,disabled:l,"data-testid":"stAudioInputWaveformTimeCode",children:Ie})]})]})},Tt=t.memo(Et);export{Tt as default};
1
+ import{r as t,E as L,_ as D,L as ze,e as ue,n as F,aL as se,bY as Le,bS as De,bR as Be,z as p,j as n,Y as Ve,o as x,B as We,ax as Me,b as Ne,l as Oe,aa as He,p as $e,ab as je,P as _e,ac as Xe}from"./index.CPc_uZux.js";import{u as Ge}from"./useWaveformController.B0olyXLQ.js";import{T as qe,a as ce}from"./Toolbar.COH7NaOE.js";import{u as Ye,F as Ke}from"./FormClearHelper.DTFnX0js.js";import{c as Je}from"./createDownloadLinkElement.6oO-YlYv.js";import{E as Qe}from"./urls.BwSlolu9.js";import{F as Ze,D as et}from"./FileDownload.esm.Z9hRQIHi.js";var fe=t.forwardRef(function(e,r){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return t.createElement(L,D({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),t.createElement("g",{fill:"none"},t.createElement("rect",{width:24,height:24}),t.createElement("rect",{width:24,height:24}),t.createElement("rect",{width:24,height:24})),t.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),t.createElement("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});fe.displayName="Mic";var pe=t.forwardRef(function(e,r){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return t.createElement(L,D({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),t.createElement("rect",{width:24,height:24,fill:"none"}),t.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))});pe.displayName="Pause";var me=t.forwardRef(function(e,r){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return t.createElement(L,D({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),t.createElement("rect",{width:24,height:24,fill:"none"}),t.createElement("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 000-1.69L9.54 5.98A.998.998 0 008 6.82z"}))});me.displayName="PlayArrow";var ge=t.forwardRef(function(e,r){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return t.createElement(L,D({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),t.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),t.createElement("path",{d:"M17.65 6.35a7.95 7.95 0 00-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 007.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 01-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0112 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z"}))});ge.displayName="Refresh";var he=t.forwardRef(function(e,r){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return t.createElement(L,D({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),t.createElement("g",{fill:"none"},t.createElement("rect",{width:24,height:24}),t.createElement("rect",{width:24,height:24})),t.createElement("path",{fillRule:"evenodd",d:"M9 16h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}))});he.displayName="StopCircle";const tt=(e,r)=>{const{enforceDownloadInNewTab:o=!1}=t.useContext(ze);return t.useCallback(()=>{if(!e)return;const l=Je({enforceDownloadInNewTab:o,url:e,filename:r});l.style.display="none",document.body.appendChild(l),l.click(),document.body.removeChild(l)},[e,o,r])},j=({widgetMgr:e,id:r,formId:o,key:i,defaultValue:l})=>{t.useEffect(()=>{const s=e.getElementState(r,i);ue(s)&&F(l)&&e.setElementState(r,i,l)},[e,r,i,l]);const[R,g]=t.useState(e.getElementState(r,i)??l),c=t.useCallback(s=>{e.setElementState(r,i,s),g(s)},[e,r,i]),v=t.useMemo(()=>({formId:o||""}),[o]),E=t.useCallback(()=>c(l),[l,c]);return Ye({element:v,widgetMgr:e,onFormCleared:E}),[R,c]},rt=async({files:e,uploadClient:r,widgetMgr:o,widgetInfo:i,fragmentId:l,signal:R})=>{let g=[];try{g=await r.fetchFileURLs(e)}catch(s){return{successfulUploads:[],failedUploads:e.map(d=>({file:d,error:se(s)}))}}const c=Le(e,g),v=[],E=[];return await Promise.all(c.map(async([s,d])=>{if(!s||!d?.uploadUrl||!d.fileId)return{file:s,fileUrl:d,error:new Error("No upload URL found")};try{await r.uploadFile({id:d.fileId,formId:i.formId||""},d.uploadUrl,s,void 0,R),v.push({fileUrl:d,file:s})}catch(h){const O=se(h);E.push({file:s,error:O})}})),o.setFileUploaderStateValue(i,new De({uploadedFileInfo:v.map(({file:s,fileUrl:d})=>new Be({fileId:d.fileId,fileUrls:d,name:s.webkitRelativePath||s.name,size:s.size}))}),{fromUi:!0},l),{successfulUploads:v,failedUploads:E}},ot=p("div",{target:"e18uw4vz0"})(),de=p("div",{target:"e18uw4vz1"})(({theme:e,disabled:r})=>({height:e.sizes.largestElementHeight,width:"100%",background:e.colors.secondaryBg,borderRadius:e.radii.default,marginBottom:e.spacing.twoXS,display:"flex",alignItems:"center",position:"relative",paddingLeft:e.spacing.xs,paddingRight:e.spacing.sm,border:e.colors.widgetBorderColor?`${e.sizes.borderWidth} solid ${e.colors.widgetBorderColor}`:void 0,cursor:r?"not-allowed":"auto",overflow:"hidden"})),nt=p("div",{target:"e18uw4vz2"})({flex:1}),at=p("div",{target:"e18uw4vz3"})(({show:e,theme:r})=>({display:e?"block":"none",position:"relative",height:r.sizes.largestElementHeight,"& > div":{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center"}})),lt=p("span",{target:"e18uw4vz4"})(({theme:e,isPlayingOrRecording:r,disabled:o})=>({margin:e.spacing.sm,fontFamily:e.fonts.monospace,color:o?e.colors.fadedText40:r?e.colors.bodyText:e.colors.fadedText60,backgroundColor:e.colors.secondaryBg,fontSize:e.fontSizes.sm})),be=p("div",{target:"e18uw4vz5"})({width:"100%",textAlign:"center",overflow:"hidden"}),ve=p("span",{target:"e18uw4vz6"})(({theme:e})=>({color:e.colors.bodyText})),it=p("a",{target:"e18uw4vz7"})(({theme:e})=>({color:e.colors.link,textDecoration:e.linkUnderline?"underline":"none"})),st=p("div",{target:"e18uw4vz8"})(({theme:e})=>({flex:1,height:e.sizes.largestElementHeight,display:"flex",justifyContent:"center",alignItems:"center"})),ct=p("div",{target:"e18uw4vz9"})(({theme:e})=>{const r="0.625em";return{opacity:.2,width:"100%",height:r,backgroundSize:r,backgroundImage:`radial-gradient(${e.colors.fadedText10} 40%, transparent 40%)`,backgroundRepeat:"repeat"}}),dt=p("span",{target:"e18uw4vz10"})(({theme:e})=>({"& > button":{color:e.colors.primary,padding:e.spacing.threeXS},"& > button:hover, & > button:focus":{color:e.colors.redColor}})),ut=p("span",{target:"e18uw4vz11"})(({theme:e})=>({"& > button":{padding:e.spacing.threeXS,color:e.colors.fadedText60},"& > button:hover, & > button:focus":{color:e.colors.bodyText}})),ye=p("span",{target:"e18uw4vz12"})(({theme:e})=>({"& > button":{padding:e.spacing.threeXS,color:e.colors.fadedText60},"& > button:hover, & > button:focus":{color:e.colors.bodyText}})),_=p("div",{target:"e18uw4vz13"})(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",flexGrow:0,flexShrink:1,padding:e.spacing.xs,gap:e.spacing.twoXS,marginRight:e.spacing.twoXS})),z=({onClick:e,disabled:r,ariaLabel:o,iconContent:i})=>n(Ne,{kind:We.BORDERLESS_ICON,onClick:e,disabled:r,"aria-label":o,containerWidth:!0,"data-testid":"stAudioInputActionButton",children:n(Me,{content:i,size:"lg",color:"inherit"})}),ft=({disabled:e,stopRecording:r})=>n(dt,{children:n(z,{onClick:r,disabled:e,ariaLabel:"Stop recording",iconContent:he})}),pt=({disabled:e,isPlaying:r,onClickPlayPause:o})=>n(ye,{children:r?n(z,{onClick:o,disabled:e,ariaLabel:"Pause",iconContent:pe}):n(z,{onClick:o,disabled:e,ariaLabel:"Play",iconContent:me})}),mt=({disabled:e,startRecording:r})=>n(ut,{children:n(z,{onClick:r,disabled:e,ariaLabel:"Record",iconContent:fe})}),gt=({onClick:e})=>n(ye,{children:n(z,{disabled:!1,onClick:e,ariaLabel:"Reset",iconContent:ge})}),ht=({disabled:e,isRecording:r,isPlaying:o,isUploading:i,isError:l,recordingUrlExists:R,startRecording:g,stopRecording:c,onClickPlayPause:v,onClear:E})=>l?n(_,{children:n(gt,{onClick:E})}):i?n(_,{children:n(Ve,{size:"base",iconValue:"spinner"})}):x(_,{children:[r?n(ft,{disabled:e,stopRecording:c}):n(mt,{disabled:e,startRecording:g}),R&&n(pt,{disabled:e,isPlaying:o,onClickPlayPause:v})]}),bt=t.memo(ht),vt=()=>n(be,{children:n(ve,{children:"An error has occurred, please try again."})}),yt=t.memo(vt),C="00:00",A=e=>{const r=Math.floor(e/1e3),o=Math.floor(r/60),i=Math.floor(o/60),l=r%60,R=o%60,g=l.toString().padStart(2,"0"),c=R.toString().padStart(2,"0"),v=i.toString().padStart(2,"0");return o<60?`${c}:${g}`:`${v}:${c}:${g}`},wt=()=>x(be,{children:[n(ve,{children:"This app would like to use your microphone."})," ",n(it,{href:Qe,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]}),St=t.memo(wt),Ct=()=>n(st,{children:n(ct,{})}),Rt=t.memo(Ct),Et=({element:e,uploadClient:r,widgetMgr:o,fragmentId:i,disabled:l})=>{const R=Oe(),g=t.useRef(null),[c,v]=t.useState(!1),[E,s]=t.useState(!1),[d,h]=t.useState(!1),[O,b]=t.useState(C),[B,V]=j({widgetMgr:o,id:e.id,key:"deleteFileUrl",defaultValue:null}),[m,W]=j({widgetMgr:o,id:e.id,key:"recordingUrl",defaultValue:null}),[H,I]=j({widgetMgr:o,id:e.id,formId:e.formId,key:"recordingTime",defaultValue:C}),U=t.useRef(null),w=t.useRef(null),u=t.useRef(null),X=e.id,S=e.formId,we=t.useCallback(async a=>{U.current&&U.current.abort();const y=new AbortController;U.current=y;try{if(s(!0),F(S)&&o.setFormsWithUploadsInProgress(new Set([S])),y.signal.aborted)return;let f;try{f=URL.createObjectURL(a),w.current&&w.current!==f&&URL.revokeObjectURL(w.current),w.current=f}catch{h(!0),s(!1),F(S)&&o.setFormsWithUploadsInProgress(new Set);return}if(y.signal.aborted){URL.revokeObjectURL(f),w.current=null;return}W(f);const Pe=new Date().toISOString().slice(0,16).replace(/:/g,"-"),Fe=new File([a],`${Pe}_audio.wav`,{type:a.type});try{const{successfulUploads:xe,failedUploads:Te}=await rt({files:[Fe],uploadClient:r,widgetMgr:o,widgetInfo:{id:X,formId:S},fragmentId:i,signal:y.signal});if(y.signal.aborted)return;if(Te.length>0){h(!0);return}h(!1);const ie=xe[0];ie?.fileUrl?.deleteUrl&&V(ie.fileUrl.deleteUrl)}catch{y.signal.aborted||h(!0)}finally{F(S)&&o.setFormsWithUploadsInProgress(new Set),y.signal.aborted||s(!1)}}catch{y.signal.aborted||(h(!0),s(!1)),F(S)&&o.setFormsWithUploadsInProgress(new Set)}},[r,o,X,S,i,V,W]),M=t.useRef(null),G=Ge({containerRef:g,sampleRate:e.sampleRate??void 0,waveformPadding:He(R.spacing.twoXS),events:{onPermissionDenied:()=>{v(!0)},onError:()=>{h(!0)},onRecordStart:()=>{I(C),b(C)},onRecordReady:()=>{const a=A(M.current?.playback.getDurationMs()??0);I(a),b(a)},onApprove:we,onCancel:()=>{I(C),b(C)},onProgressMs:a=>{I(A(a))},onPlaybackPause:()=>{b(A(M.current?.playback.getCurrentTimeMs()??0))},onPlaybackFinish:()=>{b(A(M.current?.playback.getDurationMs()??0))}}});M.current=G;const{state:N,isPlaybackPlaying:P,start:q,stop:Y,approve:K,cancel:J,playback:{play:Q,pause:Z,load:ee,getCurrentTimeMs:T,getDurationMs:te}}=G,k=t.useCallback(async({updateWidgetManager:a,deleteFile:y})=>{const f=m;if(f&&w.current===f&&(URL.revokeObjectURL(f),w.current=null),u.current&&(cancelAnimationFrame(u.current),u.current=null),W(null),V(null),b(C),I(C),J(),a&&o.setFileUploaderStateValue(e,{},{fromUi:!0},i),y&&B)try{await r.deleteFile(B)}catch{}F(f)&&URL.revokeObjectURL(f)},[B,m,r,J,e,o,i,I,V,W]);t.useEffect(()=>{const a=()=>{P&&(b(A(T())),u.current=requestAnimationFrame(a))};return P?u.current=requestAnimationFrame(a):u.current&&(cancelAnimationFrame(u.current),u.current=null),()=>{u.current&&(cancelAnimationFrame(u.current),u.current=null)}},[P,T]),t.useEffect(()=>{if(!m)return;let a=!1;return b(H),(async()=>{try{if(await ee(m),a)return;const f=te();f>0&&b(A(f))}catch{a||h(!0)}})(),()=>{a=!0}},[m,H,ee,te]),t.useEffect(()=>{if(ue(S))return;const a=new Ke;return a.manageFormClearListener(o,S,()=>{k({updateWidgetManager:!0,deleteFile:!1})}),()=>a.disconnect()},[S,k,o]),t.useEffect(()=>()=>{U.current&&(U.current.abort(),U.current=null),u.current&&(cancelAnimationFrame(u.current),u.current=null),w.current&&(URL.revokeObjectURL(w.current),w.current=null)},[]);const Se=t.useCallback(async()=>{try{if(P){const a=T();Z(),b(A(a))}else N==="idle"&&m&&(T()<=100&&b(C),await Q())}catch{h(!0)}},[P,T,Z,Q,m,N]),re=t.useCallback(async()=>{m&&await k({updateWidgetManager:!1,deleteFile:!0});try{b(C),await q()}catch{}},[k,m,q]),oe=t.useCallback(async()=>{try{const{blob:a}=await Y();await K(a)}catch{h(!0)}},[K,Y]),ne=tt(m,"recording.wav"),Ce=t.useCallback(()=>{re()},[re]),Re=t.useCallback(()=>{oe()},[oe]),Ee=t.useCallback(()=>{k({updateWidgetManager:!1,deleteFile:!0}),h(!1)},[k]),ke=t.useCallback(()=>{ne()},[ne]),Ae=t.useCallback(()=>{k({updateWidgetManager:!0,deleteFile:!0})},[k]),$=N==="recording",ae=P,Ie=$?H:O,le=N==="idle"&&!c&&!m,Ue=c||le||d;return x(ot,{className:"stAudioInput","data-testid":"stAudioInput",children:[n(Xe,{label:e.label,disabled:l,labelVisibility:$e(e.labelVisibility?.value),children:e.help&&n(je,{content:e.help,placement:_e.TOP,label:e.label})}),x(de,{disabled:l,children:[x(qe,{isFullScreen:!1,disableFullscreenMode:!0,target:de,children:[m&&n(ce,{label:"Download as WAV",icon:Ze,onClick:ke}),B&&n(ce,{label:"Clear recording",icon:et,onClick:Ae})]}),n(bt,{isRecording:$,isPlaying:ae,isUploading:E,isError:d,recordingUrlExists:!!m,startRecording:Ce,stopRecording:Re,onClickPlayPause:()=>{Se()},onClear:Ee,disabled:l||c}),x(nt,{children:[d&&n(yt,{}),le&&n(Rt,{}),c&&n(St,{}),n(at,{"data-testid":"stAudioInputWaveSurfer",ref:g,show:!Ue})]}),n(lt,{isPlayingOrRecording:$||ae,disabled:l,"data-testid":"stAudioInputWaveformTimeCode",children:Ie})]})]})},Tt=t.memo(Et);export{Tt as default};
@@ -1 +1 @@
1
- import{z as T,r as i,R as b,a2 as L,j as p,V as N}from"./index.aCorc3Yt.js";const R=T("iframe",{target:"e655cq30"})(({theme:r})=>({colorScheme:"normal",border:"none",padding:r.spacing.none,margin:r.spacing.none,width:"100%",aspectRatio:"16 / 9"})),U=N.getLogger("Video"),A={width:"100%"};function O({element:r,endpoints:s,elementMgr:f}){const n=i.useRef(null),{type:v,url:c,startTime:a,subtitles:l,endTime:o,loop:d,autoplay:m,muted:E}=r;let y=b(c);const S=i.useMemo(()=>{if(!r.id)return!0;const e=f.getElementState(r.id,"preventAutoplay");return e||f.setElementState(r.id,"preventAutoplay",!0),e??!1},[r.id,f]),g=i.useMemo(()=>JSON.stringify(l?l.map(e=>s.buildMediaURL(`${e.url}`)):[]),[l,s]);i.useEffect(()=>{const e=JSON.parse(g);e.length!==0&&e.forEach(t=>{s.checkSourceUrlResponse(t,"Video Subtitle")})},[g,s]),i.useEffect(()=>{n.current&&(n.current.currentTime=a)},[a]),i.useEffect(()=>{const e=n.current,t=()=>{e&&(e.currentTime=r.startTime)};return e&&e.addEventListener("loadedmetadata",t),()=>{e&&e.removeEventListener("loadedmetadata",t)}},[r]),i.useEffect(()=>{const e=n.current;if(!e)return;let t=!1;const u=()=>{o>0&&e.currentTime>=o&&(d?(e.currentTime=a||0,e.play()):t||(t=!0,e.pause()))};return o>0&&e.addEventListener("timeupdate",u),()=>{e&&o>0&&e.removeEventListener("timeupdate",u)}},[o,d,a]),i.useEffect(()=>{const e=n.current;if(!e)return;const t=()=>{d&&(e.currentTime=a||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}},[d,a]);const V=e=>{const t=new URL(e);if(a&&!isNaN(a)&&t.searchParams.append("start",a.toString()),o&&!isNaN(o)&&t.searchParams.append("end",o.toString()),d){t.searchParams.append("loop","1");const u=t.pathname.split("/").pop();u&&t.searchParams.append("playlist",u)}return m&&t.searchParams.append("autoplay","1"),E&&t.searchParams.append("mute","1"),t.toString()};if(v===L.Type.YOUTUBE_IFRAME)return p(R,{className:"stVideo","data-testid":"stVideo",title:c,src:V(c),allow:"autoplay; encrypted-media",allowFullScreen:!0});const h=e=>{const t=e.currentTarget.src;U.error(`Client Error: Video source error - ${t}`),s.sendClientErrorToHost("Video","Video source failed to load","onerror triggered",t)};return p("video",{className:"stVideo","data-testid":"stVideo",ref:n,controls:!0,muted:E,autoPlay:m&&!S,src:s.buildMediaURL(c),style:A,crossOrigin:y,onError:h,children:l?.map((e,t)=>p("track",{kind:"captions",src:s.buildMediaURL(`${e.url}`),label:`${e.label}`,default:t===0,"data-testid":"stVideoSubtitle"},t))})}const $=i.memo(O);export{$ as default};
1
+ import{z as T,r as i,R as b,a2 as L,j as p,V as N}from"./index.CPc_uZux.js";const R=T("iframe",{target:"e655cq30"})(({theme:r})=>({colorScheme:"normal",border:"none",padding:r.spacing.none,margin:r.spacing.none,width:"100%",aspectRatio:"16 / 9"})),U=N.getLogger("Video"),A={width:"100%"};function O({element:r,endpoints:s,elementMgr:f}){const n=i.useRef(null),{type:v,url:c,startTime:a,subtitles:l,endTime:o,loop:d,autoplay:m,muted:E}=r;let y=b(c);const S=i.useMemo(()=>{if(!r.id)return!0;const e=f.getElementState(r.id,"preventAutoplay");return e||f.setElementState(r.id,"preventAutoplay",!0),e??!1},[r.id,f]),g=i.useMemo(()=>JSON.stringify(l?l.map(e=>s.buildMediaURL(`${e.url}`)):[]),[l,s]);i.useEffect(()=>{const e=JSON.parse(g);e.length!==0&&e.forEach(t=>{s.checkSourceUrlResponse(t,"Video Subtitle")})},[g,s]),i.useEffect(()=>{n.current&&(n.current.currentTime=a)},[a]),i.useEffect(()=>{const e=n.current,t=()=>{e&&(e.currentTime=r.startTime)};return e&&e.addEventListener("loadedmetadata",t),()=>{e&&e.removeEventListener("loadedmetadata",t)}},[r]),i.useEffect(()=>{const e=n.current;if(!e)return;let t=!1;const u=()=>{o>0&&e.currentTime>=o&&(d?(e.currentTime=a||0,e.play()):t||(t=!0,e.pause()))};return o>0&&e.addEventListener("timeupdate",u),()=>{e&&o>0&&e.removeEventListener("timeupdate",u)}},[o,d,a]),i.useEffect(()=>{const e=n.current;if(!e)return;const t=()=>{d&&(e.currentTime=a||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}},[d,a]);const V=e=>{const t=new URL(e);if(a&&!isNaN(a)&&t.searchParams.append("start",a.toString()),o&&!isNaN(o)&&t.searchParams.append("end",o.toString()),d){t.searchParams.append("loop","1");const u=t.pathname.split("/").pop();u&&t.searchParams.append("playlist",u)}return m&&t.searchParams.append("autoplay","1"),E&&t.searchParams.append("mute","1"),t.toString()};if(v===L.Type.YOUTUBE_IFRAME)return p(R,{className:"stVideo","data-testid":"stVideo",title:c,src:V(c),allow:"autoplay; encrypted-media",allowFullScreen:!0});const h=e=>{const t=e.currentTarget.src;U.error(`Client Error: Video source error - ${t}`),s.sendClientErrorToHost("Video","Video source failed to load","onerror triggered",t)};return p("video",{className:"stVideo","data-testid":"stVideo",ref:n,controls:!0,muted:E,autoPlay:m&&!S,src:s.buildMediaURL(c),style:A,crossOrigin:y,onError:h,children:l?.map((e,t)=>p("track",{kind:"captions",src:s.buildMediaURL(`${e.url}`),label:`${e.label}`,default:t===0,"data-testid":"stVideoSubtitle"},t))})}const $=i.memo(O);export{$ as default};
@@ -1,4 +1,4 @@
1
- import{V as Q,e as Z,bu as me,bv as ge,z as he,r as d,l as ye,bw as k,aj as _,j as A,aM as pe,bx as H,by as Ee,a0 as be,a1 as Fe,o as Ce,$ as we,aL as Se,n as Ne,S as Oe}from"./index.aCorc3Yt.js";import{bz as nr}from"./index.aCorc3Yt.js";import{w as Ae}from"./withCalculatedWidth.YaK0HIIP.js";import{C as W,a as Y}from"./urls.BwSlolu9.js";import{D as Re,a as Ie}from"./IFrameUtil.DefezniK.js";const v="%[a-f0-9]{2}",G=new RegExp("("+v+")|([^%]+?)","gi"),B=new RegExp("("+v+")+","gi");function T(e,r){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;r=r||1;const t=e.slice(0,r),n=e.slice(r);return Array.prototype.concat.call([],T(t),T(n))}function _e(e){try{return decodeURIComponent(e)}catch{let r=e.match(G)||[];for(let t=1;t<r.length;t++)e=T(r,t).join(""),r=e.match(G)||[];return e}}function Te(e){const r={"%FE%FF":"��","%FF%FE":"��"};let t=B.exec(e);for(;t;){try{r[t[0]]=decodeURIComponent(t[0])}catch{const a=_e(t[0]);a!==t[0]&&(r[t[0]]=a)}t=B.exec(e)}r["%C2"]="�";const n=Object.keys(r);for(const a of n)e=e.replace(new RegExp(a,"g"),r[a]);return e}function xe(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return Te(e)}}function Ue(e,r){const t={};if(Array.isArray(r))for(const n of r){const a=Object.getOwnPropertyDescriptor(e,n);a?.enumerable&&Object.defineProperty(t,n,a)}else for(const n of Reflect.ownKeys(e)){const a=Object.getOwnPropertyDescriptor(e,n);if(a.enumerable){const s=e[n];r(n,s,e)&&Object.defineProperty(t,n,a)}}return t}function ee(e,r){if(!(typeof e=="string"&&typeof r=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e===""||r==="")return[];const t=e.indexOf(r);return t===-1?[]:[e.slice(0,t),e.slice(t+r.length)]}const $e=e=>e==null,Me=e=>encodeURIComponent(e).replaceAll(/[!'()*]/g,r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`),x=Symbol("encodeFragmentIdentifier");function Le(e){switch(e.arrayFormat){case"index":return r=>(t,n)=>{const a=t.length;return n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,[c(r,e),"[",a,"]"].join("")]:[...t,[c(r,e),"[",c(a,e),"]=",c(n,e)].join("")]};case"bracket":return r=>(t,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,[c(r,e),"[]"].join("")]:[...t,[c(r,e),"[]=",c(n,e)].join("")];case"colon-list-separator":return r=>(t,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,[c(r,e),":list="].join("")]:[...t,[c(r,e),":list=",c(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{const r=e.arrayFormat==="bracket-separator"?"[]=":"=";return t=>(n,a)=>a===void 0||e.skipNull&&a===null||e.skipEmptyString&&a===""?n:(a=a===null?"":a,n.length===0?[[c(t,e),r,c(a,e)].join("")]:[[n,c(a,e)].join(e.arrayFormatSeparator)])}default:return r=>(t,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,c(r,e)]:[...t,[c(r,e),"=",c(n,e)].join("")]}}function je(e){let r;switch(e.arrayFormat){case"index":return(t,n,a)=>{if(r=/\[(\d*)]$/.exec(t),t=t.replace(/\[\d*]$/,""),!r){a[t]=n;return}a[t]===void 0&&(a[t]={}),a[t][r[1]]=n};case"bracket":return(t,n,a)=>{if(r=/(\[])$/.exec(t),t=t.replace(/\[]$/,""),!r){a[t]=n;return}if(a[t]===void 0){a[t]=[n];return}a[t]=[...a[t],n]};case"colon-list-separator":return(t,n,a)=>{if(r=/(:list)$/.exec(t),t=t.replace(/:list$/,""),!r){a[t]=n;return}if(a[t]===void 0){a[t]=[n];return}a[t]=[...a[t],n]};case"comma":case"separator":return(t,n,a)=>{const o=typeof n=="string"&&n.includes(e.arrayFormatSeparator)?n.split(e.arrayFormatSeparator).map(i=>h(i,e)):n===null?n:h(n,e);a[t]=o};case"bracket-separator":return(t,n,a)=>{const s=/(\[])$/.test(t);if(t=t.replace(/\[]$/,""),!s){a[t]=n&&h(n,e);return}const o=n===null?[]:h(n,e).split(e.arrayFormatSeparator);if(a[t]===void 0){a[t]=o;return}a[t]=[...a[t],...o]};default:return(t,n,a)=>{if(a[t]===void 0){a[t]=n;return}a[t]=[...[a[t]].flat(),n]}}}function re(e){if(typeof e!="string"||e.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function c(e,r){return r.encode?r.strict?Me(e):encodeURIComponent(e):e}function h(e,r){return r.decode?xe(e):e}function te(e){return Array.isArray(e)?e.sort():typeof e=="object"?te(Object.keys(e)).sort((r,t)=>Number(r)-Number(t)).map(r=>e[r]):e}function ne(e){const r=e.indexOf("#");return r!==-1&&(e=e.slice(0,r)),e}function De(e){let r="";const t=e.indexOf("#");return t!==-1&&(r=e.slice(t)),r}function q(e,r,t){return t==="string"&&typeof e=="string"?e:typeof t=="function"&&typeof e=="string"?t(e):t==="boolean"&&e===null?!0:t==="boolean"&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")?e.toLowerCase()==="true":t==="boolean"&&e!==null&&(e.toLowerCase()==="1"||e.toLowerCase()==="0")?e.toLowerCase()==="1":t==="string[]"&&r.arrayFormat!=="none"&&typeof e=="string"?[e]:t==="number[]"&&r.arrayFormat!=="none"&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?[Number(e)]:t==="number"&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?Number(e):r.parseBooleans&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")?e.toLowerCase()==="true":r.parseNumbers&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?Number(e):e}function U(e){e=ne(e);const r=e.indexOf("?");return r===-1?"":e.slice(r+1)}function $(e,r){r={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,types:Object.create(null),...r},re(r.arrayFormatSeparator);const t=je(r),n=Object.create(null);if(typeof e!="string"||(e=e.trim().replace(/^[?#&]/,""),!e))return n;for(const a of e.split("&")){if(a==="")continue;const s=r.decode?a.replaceAll("+"," "):a;let[o,i]=ee(s,"=");o===void 0&&(o=s),i=i===void 0?null:["comma","separator","bracket-separator"].includes(r.arrayFormat)?i:h(i,r),t(h(o,r),i,n)}for(const[a,s]of Object.entries(n))if(typeof s=="object"&&s!==null&&r.types[a]!=="string")for(const[o,i]of Object.entries(s)){const l=r.types[a],f=typeof l=="function"?l:l?l.replace("[]",""):void 0;s[o]=q(i,r,f)}else typeof s=="object"&&s!==null&&r.types[a]==="string"?n[a]=Object.values(s).join(r.arrayFormatSeparator):n[a]=q(s,r,r.types[a]);return r.sort===!1?n:(r.sort===!0?Object.keys(n).sort():Object.keys(n).sort(r.sort)).reduce((a,s)=>{const o=n[s];return a[s]=o&&typeof o=="object"&&!Array.isArray(o)?te(o):o,a},Object.create(null))}function ae(e,r){if(!e)return"";r={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...r},re(r.arrayFormatSeparator);const t=o=>r.skipNull&&$e(e[o])||r.skipEmptyString&&e[o]==="",n=Le(r),a={};for(const[o,i]of Object.entries(e))t(o)||(a[o]=i);const s=Object.keys(a);return r.sort!==!1&&s.sort(r.sort),s.map(o=>{let i=e[o];if(r.replacer&&(i=r.replacer(o,i),i===void 0)||i===void 0)return"";if(i===null)return c(o,r);if(Array.isArray(i)){if(i.length===0&&r.arrayFormat==="bracket-separator")return c(o,r)+"[]";let l=i;return r.replacer&&(l=i.map((f,u)=>r.replacer(`${o}[${u}]`,f)).filter(f=>f!==void 0)),l.reduce(n(o),[]).join("&")}return c(o,r)+"="+c(i,r)}).filter(o=>o.length>0).join("&")}function se(e,r){r={decode:!0,...r};let[t,n]=ee(e,"#");return t===void 0&&(t=e),{url:t?.split("?")?.[0]??"",query:$(U(e),r),...r&&r.parseFragmentIdentifier&&n?{fragmentIdentifier:h(n,r)}:{}}}function oe(e,r){r={encode:!0,strict:!0,[x]:!0,...r};const t=ne(e.url).split("?")[0]||"",n=U(e.url),a={...$(n,{sort:!1,...r}),...e.query};let s=ae(a,r);s&&=`?${s}`;let o=De(e.url);if(typeof e.fragmentIdentifier=="string"){const i=new URL(t);i.hash=e.fragmentIdentifier,o=r[x]?i.hash:`#${e.fragmentIdentifier}`}return`${t}${s}${o}`}function ie(e,r,t){t={parseFragmentIdentifier:!0,[x]:!1,...t};const{url:n,query:a,fragmentIdentifier:s}=se(e,t);return oe({url:n,query:Ue(a,r),fragmentIdentifier:s},t)}function Pe(e,r,t){const n=Array.isArray(r)?a=>!r.includes(a):(a,s)=>!r(a,s);return ie(e,n,t)}const Ve=Object.freeze(Object.defineProperty({__proto__:null,exclude:Pe,extract:U,parse:$,parseUrl:se,pick:ie,stringify:ae,stringifyUrl:oe},Symbol.toStringTag,{value:"Module"}));var S=(function(e){return e.COMPONENT_READY="streamlit:componentReady",e.SET_COMPONENT_VALUE="streamlit:setComponentValue",e.SET_FRAME_HEIGHT="streamlit:setFrameHeight",e})({}),ke=(function(e){return e.RENDER="streamlit:render",e})({});const He=1,F=Q.getLogger("componentUtils");function We(e){return(r,t)=>{if(!e.current)return;const{isReady:n,element:a,widgetMgr:s,setComponentError:o,componentReadyCallback:i,frameHeightCallback:l,fragmentId:f}=e.current,u=n();switch(r){case S.COMPONENT_READY:{const{apiVersion:y}=t;y!==He?o(new Error(`Unrecognized component API version: '${y}'`)):i();break}case S.SET_COMPONENT_VALUE:u?Ge(K(t,"value"),t.dataType,{fromUi:!0},a,s,f):F.warn(`Got ${r} before ${S.COMPONENT_READY}!`);break;case S.SET_FRAME_HEIGHT:u?l(K(t,"height")):F.warn(`Got ${r} before ${S.COMPONENT_READY}!`);break;default:F.warn(`Unrecognized ComponentBackMsgType: ${r}`)}}}function Ye(e,r){const t=JSON.parse(e),n=[];for(const a of r){const{key:s}=a;switch(a.value?.toLowerCase()){case"arrowdataframe":n.push({key:s,value:ge.toObject(a.arrowDataframe)});break;case"bytes":t[s]=a.bytes;break;default:throw new Error(`Unrecognized SpecialArg type: ${a.value}`)}}return[t,n]}function z(e,r,t,n,a){if(!a){F.warn("Can't send ForwardMsg; missing our iframe!");return}if(Z(a.contentWindow)){F.warn("Can't send ForwardMsg; iframe has no contentWindow!");return}a.contentWindow.postMessage({type:ke.RENDER,args:e,dfs:r,disabled:t,theme:{...me(n),font:n.genericFonts.bodyFont}},"*")}function Ge(e,r,t,n,a,s){if(e===void 0){F.warn("handleSetComponentValue: missing 'value' prop");return}switch(r){case"dataframe":a.setArrowValue(n,e,t,s);break;case"bytes":a.setBytesValue(n,e,t,s);break;default:a.setJsonValue(n,e,t,s)}}function K(e,r,t=void 0){return Object.hasOwn(e,r)?e[r]:t}const Be=he("iframe",{target:"edxyb2x0"})(({theme:e,componentReady:r})=>({colorScheme:"normal",border:"none",padding:e.spacing.none,margin:e.spacing.none,display:r?"initial":"none"})),R=Q.getLogger("ComponentInstance"),J=6e4;function qe(e,r,t){let n;Ne(t)&&t!==""?n=t:n=r.getComponentURL(e,"index.html");const a=Oe.CUSTOM_COMPONENT_CLIENT_ID,s=new URL(window.location.href);return n=Ve.stringifyUrl({url:n,query:{streamlitUrl:s.origin+s.pathname,...a&&{__streamlit_parent_client_id:a}}}),n}function X(e,r){let t;return r&&r!==""?t=`Your app is having trouble loading the **${e}** component.
1
+ import{V as Q,e as Z,bw as me,bx as ge,z as he,r as d,l as ye,by as k,aj as _,j as A,aM as pe,bz as H,bA as Ee,a0 as be,a1 as Fe,o as Ce,$ as we,aL as Se,n as Ne,S as Oe}from"./index.CPc_uZux.js";import{bB as nr}from"./index.CPc_uZux.js";import{w as Ae}from"./withCalculatedWidth.DYeqePuh.js";import{C as W,a as Y}from"./urls.BwSlolu9.js";import{D as Re,a as Ie}from"./IFrameUtil.DefezniK.js";const v="%[a-f0-9]{2}",G=new RegExp("("+v+")|([^%]+?)","gi"),B=new RegExp("("+v+")+","gi");function T(e,r){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;r=r||1;const t=e.slice(0,r),n=e.slice(r);return Array.prototype.concat.call([],T(t),T(n))}function _e(e){try{return decodeURIComponent(e)}catch{let r=e.match(G)||[];for(let t=1;t<r.length;t++)e=T(r,t).join(""),r=e.match(G)||[];return e}}function Te(e){const r={"%FE%FF":"��","%FF%FE":"��"};let t=B.exec(e);for(;t;){try{r[t[0]]=decodeURIComponent(t[0])}catch{const a=_e(t[0]);a!==t[0]&&(r[t[0]]=a)}t=B.exec(e)}r["%C2"]="�";const n=Object.keys(r);for(const a of n)e=e.replace(new RegExp(a,"g"),r[a]);return e}function xe(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return Te(e)}}function Ue(e,r){const t={};if(Array.isArray(r))for(const n of r){const a=Object.getOwnPropertyDescriptor(e,n);a?.enumerable&&Object.defineProperty(t,n,a)}else for(const n of Reflect.ownKeys(e)){const a=Object.getOwnPropertyDescriptor(e,n);if(a.enumerable){const s=e[n];r(n,s,e)&&Object.defineProperty(t,n,a)}}return t}function ee(e,r){if(!(typeof e=="string"&&typeof r=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e===""||r==="")return[];const t=e.indexOf(r);return t===-1?[]:[e.slice(0,t),e.slice(t+r.length)]}const $e=e=>e==null,Me=e=>encodeURIComponent(e).replaceAll(/[!'()*]/g,r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`),x=Symbol("encodeFragmentIdentifier");function Le(e){switch(e.arrayFormat){case"index":return r=>(t,n)=>{const a=t.length;return n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,[c(r,e),"[",a,"]"].join("")]:[...t,[c(r,e),"[",c(a,e),"]=",c(n,e)].join("")]};case"bracket":return r=>(t,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,[c(r,e),"[]"].join("")]:[...t,[c(r,e),"[]=",c(n,e)].join("")];case"colon-list-separator":return r=>(t,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,[c(r,e),":list="].join("")]:[...t,[c(r,e),":list=",c(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{const r=e.arrayFormat==="bracket-separator"?"[]=":"=";return t=>(n,a)=>a===void 0||e.skipNull&&a===null||e.skipEmptyString&&a===""?n:(a=a===null?"":a,n.length===0?[[c(t,e),r,c(a,e)].join("")]:[[n,c(a,e)].join(e.arrayFormatSeparator)])}default:return r=>(t,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,c(r,e)]:[...t,[c(r,e),"=",c(n,e)].join("")]}}function je(e){let r;switch(e.arrayFormat){case"index":return(t,n,a)=>{if(r=/\[(\d*)]$/.exec(t),t=t.replace(/\[\d*]$/,""),!r){a[t]=n;return}a[t]===void 0&&(a[t]={}),a[t][r[1]]=n};case"bracket":return(t,n,a)=>{if(r=/(\[])$/.exec(t),t=t.replace(/\[]$/,""),!r){a[t]=n;return}if(a[t]===void 0){a[t]=[n];return}a[t]=[...a[t],n]};case"colon-list-separator":return(t,n,a)=>{if(r=/(:list)$/.exec(t),t=t.replace(/:list$/,""),!r){a[t]=n;return}if(a[t]===void 0){a[t]=[n];return}a[t]=[...a[t],n]};case"comma":case"separator":return(t,n,a)=>{const o=typeof n=="string"&&n.includes(e.arrayFormatSeparator)?n.split(e.arrayFormatSeparator).map(i=>h(i,e)):n===null?n:h(n,e);a[t]=o};case"bracket-separator":return(t,n,a)=>{const s=/(\[])$/.test(t);if(t=t.replace(/\[]$/,""),!s){a[t]=n&&h(n,e);return}const o=n===null?[]:h(n,e).split(e.arrayFormatSeparator);if(a[t]===void 0){a[t]=o;return}a[t]=[...a[t],...o]};default:return(t,n,a)=>{if(a[t]===void 0){a[t]=n;return}a[t]=[...[a[t]].flat(),n]}}}function re(e){if(typeof e!="string"||e.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function c(e,r){return r.encode?r.strict?Me(e):encodeURIComponent(e):e}function h(e,r){return r.decode?xe(e):e}function te(e){return Array.isArray(e)?e.sort():typeof e=="object"?te(Object.keys(e)).sort((r,t)=>Number(r)-Number(t)).map(r=>e[r]):e}function ne(e){const r=e.indexOf("#");return r!==-1&&(e=e.slice(0,r)),e}function De(e){let r="";const t=e.indexOf("#");return t!==-1&&(r=e.slice(t)),r}function q(e,r,t){return t==="string"&&typeof e=="string"?e:typeof t=="function"&&typeof e=="string"?t(e):t==="boolean"&&e===null?!0:t==="boolean"&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")?e.toLowerCase()==="true":t==="boolean"&&e!==null&&(e.toLowerCase()==="1"||e.toLowerCase()==="0")?e.toLowerCase()==="1":t==="string[]"&&r.arrayFormat!=="none"&&typeof e=="string"?[e]:t==="number[]"&&r.arrayFormat!=="none"&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?[Number(e)]:t==="number"&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?Number(e):r.parseBooleans&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")?e.toLowerCase()==="true":r.parseNumbers&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?Number(e):e}function U(e){e=ne(e);const r=e.indexOf("?");return r===-1?"":e.slice(r+1)}function $(e,r){r={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,types:Object.create(null),...r},re(r.arrayFormatSeparator);const t=je(r),n=Object.create(null);if(typeof e!="string"||(e=e.trim().replace(/^[?#&]/,""),!e))return n;for(const a of e.split("&")){if(a==="")continue;const s=r.decode?a.replaceAll("+"," "):a;let[o,i]=ee(s,"=");o===void 0&&(o=s),i=i===void 0?null:["comma","separator","bracket-separator"].includes(r.arrayFormat)?i:h(i,r),t(h(o,r),i,n)}for(const[a,s]of Object.entries(n))if(typeof s=="object"&&s!==null&&r.types[a]!=="string")for(const[o,i]of Object.entries(s)){const l=r.types[a],f=typeof l=="function"?l:l?l.replace("[]",""):void 0;s[o]=q(i,r,f)}else typeof s=="object"&&s!==null&&r.types[a]==="string"?n[a]=Object.values(s).join(r.arrayFormatSeparator):n[a]=q(s,r,r.types[a]);return r.sort===!1?n:(r.sort===!0?Object.keys(n).sort():Object.keys(n).sort(r.sort)).reduce((a,s)=>{const o=n[s];return a[s]=o&&typeof o=="object"&&!Array.isArray(o)?te(o):o,a},Object.create(null))}function ae(e,r){if(!e)return"";r={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...r},re(r.arrayFormatSeparator);const t=o=>r.skipNull&&$e(e[o])||r.skipEmptyString&&e[o]==="",n=Le(r),a={};for(const[o,i]of Object.entries(e))t(o)||(a[o]=i);const s=Object.keys(a);return r.sort!==!1&&s.sort(r.sort),s.map(o=>{let i=e[o];if(r.replacer&&(i=r.replacer(o,i),i===void 0)||i===void 0)return"";if(i===null)return c(o,r);if(Array.isArray(i)){if(i.length===0&&r.arrayFormat==="bracket-separator")return c(o,r)+"[]";let l=i;return r.replacer&&(l=i.map((f,u)=>r.replacer(`${o}[${u}]`,f)).filter(f=>f!==void 0)),l.reduce(n(o),[]).join("&")}return c(o,r)+"="+c(i,r)}).filter(o=>o.length>0).join("&")}function se(e,r){r={decode:!0,...r};let[t,n]=ee(e,"#");return t===void 0&&(t=e),{url:t?.split("?")?.[0]??"",query:$(U(e),r),...r&&r.parseFragmentIdentifier&&n?{fragmentIdentifier:h(n,r)}:{}}}function oe(e,r){r={encode:!0,strict:!0,[x]:!0,...r};const t=ne(e.url).split("?")[0]||"",n=U(e.url),a={...$(n,{sort:!1,...r}),...e.query};let s=ae(a,r);s&&=`?${s}`;let o=De(e.url);if(typeof e.fragmentIdentifier=="string"){const i=new URL(t);i.hash=e.fragmentIdentifier,o=r[x]?i.hash:`#${e.fragmentIdentifier}`}return`${t}${s}${o}`}function ie(e,r,t){t={parseFragmentIdentifier:!0,[x]:!1,...t};const{url:n,query:a,fragmentIdentifier:s}=se(e,t);return oe({url:n,query:Ue(a,r),fragmentIdentifier:s},t)}function Pe(e,r,t){const n=Array.isArray(r)?a=>!r.includes(a):(a,s)=>!r(a,s);return ie(e,n,t)}const Ve=Object.freeze(Object.defineProperty({__proto__:null,exclude:Pe,extract:U,parse:$,parseUrl:se,pick:ie,stringify:ae,stringifyUrl:oe},Symbol.toStringTag,{value:"Module"}));var S=(function(e){return e.COMPONENT_READY="streamlit:componentReady",e.SET_COMPONENT_VALUE="streamlit:setComponentValue",e.SET_FRAME_HEIGHT="streamlit:setFrameHeight",e})({}),ke=(function(e){return e.RENDER="streamlit:render",e})({});const He=1,F=Q.getLogger("componentUtils");function We(e){return(r,t)=>{if(!e.current)return;const{isReady:n,element:a,widgetMgr:s,setComponentError:o,componentReadyCallback:i,frameHeightCallback:l,fragmentId:f}=e.current,u=n();switch(r){case S.COMPONENT_READY:{const{apiVersion:y}=t;y!==He?o(new Error(`Unrecognized component API version: '${y}'`)):i();break}case S.SET_COMPONENT_VALUE:u?Ge(K(t,"value"),t.dataType,{fromUi:!0},a,s,f):F.warn(`Got ${r} before ${S.COMPONENT_READY}!`);break;case S.SET_FRAME_HEIGHT:u?l(K(t,"height")):F.warn(`Got ${r} before ${S.COMPONENT_READY}!`);break;default:F.warn(`Unrecognized ComponentBackMsgType: ${r}`)}}}function Ye(e,r){const t=JSON.parse(e),n=[];for(const a of r){const{key:s}=a;switch(a.value?.toLowerCase()){case"arrowdataframe":n.push({key:s,value:ge.toObject(a.arrowDataframe)});break;case"bytes":t[s]=a.bytes;break;default:throw new Error(`Unrecognized SpecialArg type: ${a.value}`)}}return[t,n]}function z(e,r,t,n,a){if(!a){F.warn("Can't send ForwardMsg; missing our iframe!");return}if(Z(a.contentWindow)){F.warn("Can't send ForwardMsg; iframe has no contentWindow!");return}a.contentWindow.postMessage({type:ke.RENDER,args:e,dfs:r,disabled:t,theme:{...me(n),font:n.genericFonts.bodyFont}},"*")}function Ge(e,r,t,n,a,s){if(e===void 0){F.warn("handleSetComponentValue: missing 'value' prop");return}switch(r){case"dataframe":a.setArrowValue(n,e,t,s);break;case"bytes":a.setBytesValue(n,e,t,s);break;default:a.setJsonValue(n,e,t,s)}}function K(e,r,t=void 0){return Object.hasOwn(e,r)?e[r]:t}const Be=he("iframe",{target:"edxyb2x0"})(({theme:e,componentReady:r})=>({colorScheme:"normal",border:"none",padding:e.spacing.none,margin:e.spacing.none,display:r?"initial":"none"})),R=Q.getLogger("ComponentInstance"),J=6e4;function qe(e,r,t){let n;Ne(t)&&t!==""?n=t:n=r.getComponentURL(e,"index.html");const a=Oe.CUSTOM_COMPONENT_CLIENT_ID,s=new URL(window.location.href);return n=Ve.stringifyUrl({url:n,query:{streamlitUrl:s.origin+s.pathname,...a&&{__streamlit_parent_client_id:a}}}),n}function X(e,r){let t;return r&&r!==""?t=`Your app is having trouble loading the **${e}** component.
2
2
  The app is attempting to load the component from **${r}**,
3
3
  and hasn't received its \`Streamlit.setComponentReady()\` message.
4
4