streamlit 1.50.0__py3-none-any.whl → 1.52.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit/__init__.py +5 -1
- streamlit/commands/execution_control.py +89 -14
- streamlit/commands/navigation.py +4 -6
- streamlit/commands/page_config.py +4 -6
- streamlit/components/v1/component_arrow.py +7 -7
- streamlit/components/v2/__init__.py +514 -0
- streamlit/components/v2/bidi_component/__init__.py +20 -0
- streamlit/components/v2/bidi_component/constants.py +29 -0
- streamlit/components/v2/bidi_component/main.py +534 -0
- streamlit/components/v2/bidi_component/serialization.py +272 -0
- streamlit/components/v2/bidi_component/state.py +92 -0
- streamlit/components/v2/component_definition_resolver.py +143 -0
- streamlit/components/v2/component_file_watcher.py +403 -0
- streamlit/components/v2/component_manager.py +439 -0
- streamlit/components/v2/component_manifest_handler.py +122 -0
- streamlit/components/v2/component_path_utils.py +245 -0
- streamlit/components/v2/component_registry.py +426 -0
- streamlit/components/v2/get_bidi_component_manager.py +51 -0
- streamlit/components/v2/manifest_scanner.py +615 -0
- streamlit/components/v2/presentation.py +198 -0
- streamlit/components/v2/types.py +324 -0
- streamlit/config.py +456 -53
- streamlit/config_option.py +4 -1
- streamlit/config_util.py +650 -1
- streamlit/connections/snowflake_connection.py +1 -1
- streamlit/connections/snowpark_connection.py +1 -1
- streamlit/dataframe_util.py +33 -26
- streamlit/delta_generator.py +13 -4
- streamlit/delta_generator_singletons.py +11 -15
- streamlit/deprecation_util.py +17 -6
- streamlit/elements/alert.py +16 -0
- streamlit/elements/arrow.py +68 -10
- streamlit/elements/bokeh_chart.py +10 -78
- streamlit/elements/code.py +2 -2
- streamlit/elements/deck_gl_json_chart.py +98 -40
- streamlit/elements/dialog_decorator.py +2 -1
- streamlit/elements/exception.py +4 -2
- streamlit/elements/form.py +27 -0
- streamlit/elements/graphviz_chart.py +1 -3
- streamlit/elements/heading.py +63 -10
- streamlit/elements/html.py +13 -2
- streamlit/elements/image.py +3 -5
- streamlit/elements/layouts.py +59 -33
- streamlit/elements/lib/built_in_chart_utils.py +50 -19
- streamlit/elements/lib/color_util.py +9 -19
- streamlit/elements/lib/column_config_utils.py +9 -12
- streamlit/elements/lib/column_types.py +40 -12
- streamlit/elements/lib/dialog.py +2 -2
- streamlit/elements/lib/image_utils.py +3 -5
- streamlit/elements/lib/layout_utils.py +100 -13
- streamlit/elements/lib/mutable_status_container.py +2 -2
- streamlit/elements/lib/options_selector_utils.py +2 -2
- streamlit/elements/lib/pandas_styler_utils.py +17 -9
- streamlit/elements/lib/shortcut_utils.py +152 -0
- streamlit/elements/lib/utils.py +4 -4
- streamlit/elements/map.py +80 -37
- streamlit/elements/markdown.py +50 -3
- streamlit/elements/media.py +5 -7
- streamlit/elements/metric.py +34 -6
- streamlit/elements/pdf.py +2 -4
- streamlit/elements/plotly_chart.py +197 -20
- streamlit/elements/progress.py +2 -4
- streamlit/elements/space.py +113 -0
- streamlit/elements/spinner.py +1 -1
- streamlit/elements/text.py +20 -3
- streamlit/elements/toast.py +2 -0
- streamlit/elements/vega_charts.py +356 -149
- streamlit/elements/widgets/audio_input.py +12 -11
- streamlit/elements/widgets/button.py +280 -43
- streamlit/elements/widgets/button_group.py +60 -9
- streamlit/elements/widgets/camera_input.py +3 -5
- streamlit/elements/widgets/chat.py +307 -43
- streamlit/elements/widgets/color_picker.py +8 -1
- streamlit/elements/widgets/data_editor.py +88 -44
- streamlit/elements/widgets/file_uploader.py +9 -11
- streamlit/elements/widgets/multiselect.py +4 -3
- streamlit/elements/widgets/number_input.py +4 -4
- streamlit/elements/widgets/radio.py +10 -3
- streamlit/elements/widgets/select_slider.py +8 -5
- streamlit/elements/widgets/selectbox.py +6 -3
- streamlit/elements/widgets/slider.py +38 -42
- streamlit/elements/widgets/text_widgets.py +2 -0
- streamlit/elements/widgets/time_widgets.py +587 -21
- streamlit/elements/write.py +27 -6
- streamlit/emojis.py +1 -1
- streamlit/errors.py +137 -0
- streamlit/git_util.py +1 -1
- streamlit/hello/hello.py +8 -0
- streamlit/hello/utils.py +2 -1
- streamlit/material_icon_names.py +1 -1
- streamlit/navigation/page.py +11 -1
- streamlit/net_util.py +2 -2
- streamlit/proto/Alert_pb2.pyi +3 -3
- streamlit/proto/AppPage_pb2.pyi +7 -1
- streamlit/proto/ArrowData_pb2.py +27 -0
- streamlit/proto/ArrowData_pb2.pyi +52 -0
- streamlit/proto/ArrowNamedDataSet_pb2.pyi +7 -1
- streamlit/proto/ArrowVegaLiteChart_pb2.pyi +7 -1
- streamlit/proto/Arrow_pb2.py +10 -10
- streamlit/proto/Arrow_pb2.pyi +19 -12
- streamlit/proto/AudioInput_pb2.pyi +7 -1
- streamlit/proto/Audio_pb2.pyi +7 -1
- streamlit/proto/AuthRedirect_pb2.pyi +7 -1
- streamlit/proto/AutoRerun_pb2.pyi +7 -1
- streamlit/proto/BackMsg_pb2.py +4 -2
- streamlit/proto/BackMsg_pb2.pyi +34 -4
- streamlit/proto/Balloons_pb2.pyi +7 -1
- streamlit/proto/BidiComponent_pb2.py +34 -0
- streamlit/proto/BidiComponent_pb2.pyi +159 -0
- streamlit/proto/Block_pb2.py +7 -7
- streamlit/proto/Block_pb2.pyi +39 -36
- streamlit/proto/BokehChart_pb2.pyi +7 -1
- streamlit/proto/ButtonGroup_pb2.pyi +9 -9
- streamlit/proto/Button_pb2.py +2 -2
- streamlit/proto/Button_pb2.pyi +11 -2
- streamlit/proto/CameraInput_pb2.pyi +7 -1
- streamlit/proto/ChatInput_pb2.py +6 -6
- streamlit/proto/ChatInput_pb2.pyi +18 -6
- streamlit/proto/Checkbox_pb2.pyi +3 -3
- streamlit/proto/ClientState_pb2.pyi +10 -4
- streamlit/proto/Code_pb2.pyi +7 -1
- streamlit/proto/ColorPicker_pb2.pyi +7 -1
- streamlit/proto/Common_pb2.py +3 -3
- streamlit/proto/Common_pb2.pyi +35 -23
- streamlit/proto/Components_pb2.pyi +19 -13
- streamlit/proto/DataFrame_pb2.pyi +55 -49
- streamlit/proto/DateInput_pb2.pyi +7 -1
- streamlit/proto/DateTimeInput_pb2.py +28 -0
- streamlit/proto/DateTimeInput_pb2.pyi +92 -0
- streamlit/proto/DeckGlJsonChart_pb2.py +10 -4
- streamlit/proto/DeckGlJsonChart_pb2.pyi +12 -6
- streamlit/proto/Delta_pb2.pyi +7 -1
- streamlit/proto/DocString_pb2.pyi +10 -4
- streamlit/proto/DownloadButton_pb2.py +2 -2
- streamlit/proto/DownloadButton_pb2.pyi +16 -2
- streamlit/proto/Element_pb2.py +7 -3
- streamlit/proto/Element_pb2.pyi +33 -5
- streamlit/proto/Empty_pb2.pyi +7 -1
- streamlit/proto/Exception_pb2.pyi +7 -1
- streamlit/proto/Favicon_pb2.pyi +7 -1
- streamlit/proto/FileUploader_pb2.pyi +7 -1
- streamlit/proto/ForwardMsg_pb2.py +12 -10
- streamlit/proto/ForwardMsg_pb2.pyi +42 -15
- streamlit/proto/GapSize_pb2.pyi +4 -4
- streamlit/proto/GitInfo_pb2.pyi +3 -3
- streamlit/proto/GraphVizChart_pb2.pyi +7 -1
- streamlit/proto/Heading_pb2.pyi +7 -1
- streamlit/proto/HeightConfig_pb2.py +2 -2
- streamlit/proto/HeightConfig_pb2.pyi +13 -4
- streamlit/proto/Html_pb2.py +2 -2
- streamlit/proto/Html_pb2.pyi +11 -2
- streamlit/proto/IFrame_pb2.pyi +7 -1
- streamlit/proto/Image_pb2.pyi +10 -4
- streamlit/proto/Json_pb2.pyi +7 -1
- streamlit/proto/LabelVisibilityMessage_pb2.pyi +3 -3
- streamlit/proto/LinkButton_pb2.py +2 -2
- streamlit/proto/LinkButton_pb2.pyi +15 -2
- streamlit/proto/Logo_pb2.pyi +7 -1
- streamlit/proto/Markdown_pb2.pyi +3 -3
- streamlit/proto/Metric_pb2.pyi +7 -7
- streamlit/proto/MetricsEvent_pb2.pyi +10 -4
- streamlit/proto/MultiSelect_pb2.pyi +7 -1
- streamlit/proto/NamedDataSet_pb2.pyi +7 -1
- streamlit/proto/Navigation_pb2.pyi +3 -3
- streamlit/proto/NewSession_pb2.py +18 -18
- streamlit/proto/NewSession_pb2.pyi +59 -40
- streamlit/proto/NumberInput_pb2.pyi +3 -3
- streamlit/proto/PageConfig_pb2.pyi +7 -7
- streamlit/proto/PageInfo_pb2.pyi +7 -1
- streamlit/proto/PageLink_pb2.py +2 -2
- streamlit/proto/PageLink_pb2.pyi +11 -2
- streamlit/proto/PageNotFound_pb2.pyi +7 -1
- streamlit/proto/PageProfile_pb2.pyi +13 -7
- streamlit/proto/PagesChanged_pb2.pyi +7 -1
- streamlit/proto/ParentMessage_pb2.pyi +7 -1
- streamlit/proto/PlotlyChart_pb2.py +8 -6
- streamlit/proto/PlotlyChart_pb2.pyi +9 -7
- streamlit/proto/Progress_pb2.pyi +7 -1
- streamlit/proto/Radio_pb2.pyi +7 -1
- streamlit/proto/RootContainer_pb2.pyi +1 -1
- streamlit/proto/Selectbox_pb2.pyi +7 -1
- streamlit/proto/SessionEvent_pb2.pyi +7 -1
- streamlit/proto/SessionStatus_pb2.pyi +7 -1
- streamlit/proto/Skeleton_pb2.pyi +3 -3
- streamlit/proto/Slider_pb2.pyi +5 -5
- streamlit/proto/Snow_pb2.pyi +7 -1
- streamlit/proto/Space_pb2.py +27 -0
- streamlit/proto/Space_pb2.pyi +48 -0
- streamlit/proto/Spinner_pb2.pyi +7 -1
- streamlit/proto/TextAlignmentConfig_pb2.py +29 -0
- streamlit/proto/TextAlignmentConfig_pb2.pyi +68 -0
- streamlit/proto/TextArea_pb2.pyi +7 -1
- streamlit/proto/TextInput_pb2.pyi +3 -3
- streamlit/proto/Text_pb2.pyi +7 -1
- streamlit/proto/TimeInput_pb2.pyi +7 -1
- streamlit/proto/Toast_pb2.pyi +7 -1
- streamlit/proto/VegaLiteChart_pb2.pyi +7 -1
- streamlit/proto/Video_pb2.pyi +6 -6
- streamlit/proto/WidgetStates_pb2.py +2 -2
- streamlit/proto/WidgetStates_pb2.pyi +23 -7
- streamlit/proto/WidthConfig_pb2.py +2 -2
- streamlit/proto/WidthConfig_pb2.pyi +13 -4
- streamlit/proto/openmetrics_data_model_pb2.pyi +52 -52
- streamlit/runtime/app_session.py +65 -2
- streamlit/runtime/caching/cache_data_api.py +5 -5
- streamlit/runtime/caching/cache_errors.py +4 -1
- streamlit/runtime/caching/cache_resource_api.py +5 -4
- streamlit/runtime/caching/cache_utils.py +3 -2
- streamlit/runtime/caching/cached_message_replay.py +3 -3
- streamlit/runtime/caching/hashing.py +4 -5
- streamlit/runtime/caching/legacy_cache_api.py +2 -1
- streamlit/runtime/connection_factory.py +1 -3
- streamlit/runtime/download_data_util.py +53 -0
- streamlit/runtime/forward_msg_queue.py +5 -1
- streamlit/runtime/fragment.py +2 -1
- streamlit/runtime/media_file_manager.py +178 -2
- streamlit/runtime/memory_media_file_storage.py +1 -1
- streamlit/runtime/metrics_util.py +91 -3
- streamlit/runtime/runtime.py +14 -0
- streamlit/runtime/scriptrunner/exec_code.py +2 -1
- streamlit/runtime/scriptrunner/script_runner.py +5 -3
- streamlit/runtime/scriptrunner_utils/script_run_context.py +3 -6
- streamlit/runtime/secrets.py +2 -4
- streamlit/runtime/session_manager.py +3 -1
- streamlit/runtime/state/common.py +30 -5
- streamlit/runtime/state/presentation.py +85 -0
- streamlit/runtime/state/query_params.py +80 -29
- streamlit/runtime/state/safe_session_state.py +2 -2
- streamlit/runtime/state/session_state.py +221 -17
- streamlit/runtime/state/widgets.py +19 -3
- streamlit/runtime/websocket_session_manager.py +3 -1
- streamlit/source_util.py +2 -2
- streamlit/static/index.html +2 -2
- streamlit/static/manifest.json +557 -239
- streamlit/static/static/css/{index.CIiu7Ygf.css → index.BpABIXK9.css} +1 -1
- streamlit/static/static/css/index.DgR7E2CV.css +1 -0
- streamlit/static/static/js/{ErrorOutline.esm.DUpR0_Ka.js → ErrorOutline.esm.ZJDbmVTx.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.CN4j9-1w.js → FileDownload.esm.Dx0vI3vH.js} +1 -1
- streamlit/static/static/js/{FileHelper.CaIUKG91.js → FileHelper.B7Ero7qQ.js} +3 -3
- streamlit/static/static/js/{FormClearHelper.DTcdrasw.js → FormClearHelper.CG2XN1_g.js} +1 -1
- streamlit/static/static/js/IFrameUtil.DefezniK.js +1 -0
- streamlit/static/static/js/InputInstructions.Cj5-1zf6.js +1 -0
- streamlit/static/static/js/Particles.BfWfv0Aw.js +1 -0
- streamlit/static/static/js/{ProgressBar.DetlP5aY.js → ProgressBar.CGQ8OgfO.js} +2 -2
- streamlit/static/static/js/StreamlitSyntaxHighlighter.DTKLpwhl.js +20 -0
- streamlit/static/static/js/{Toolbar.C77ar7rq.js → Toolbar.B2qFUmd9.js} +1 -1
- streamlit/static/static/js/_arrayIncludes.B19Iyn2B.js +1 -0
- streamlit/static/static/js/_baseIndexOf.BTknn6Gb.js +1 -0
- streamlit/static/static/js/{base-input.BQft14La.js → base-input.o9tL8MDP.js} +4 -4
- streamlit/static/static/js/{checkbox.yZOfXCeX.js → checkbox.0BeV1IBL.js} +1 -1
- streamlit/static/static/js/{createSuper.Dh9w1cs8.js → createSuper.RBO59fEm.js} +1 -1
- streamlit/static/static/js/data-grid-overlay-editor.CiTkUy0t.js +1 -0
- streamlit/static/static/js/{downloader.MeHtkq8r.js → downloader.DwNZg3Mw.js} +1 -1
- streamlit/static/static/js/embed.XT9xNd3F.js +195 -0
- streamlit/static/static/js/{es6.VpBPGCnM.js → es6.x9KsYQg-.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.yMw_ARIL.js → iframeResizer.contentWindow.ZVXpMPi0.js} +1 -1
- streamlit/static/static/js/index.5VPOamri.js +1 -0
- streamlit/static/static/js/index.8HslT92O.js +14 -0
- streamlit/static/static/js/index.AnXMIBz3.js +7 -0
- streamlit/static/static/js/index.B0yp3bM1.js +6 -0
- streamlit/static/static/js/index.B1fRb5wF.js +1 -0
- streamlit/static/static/js/index.B527JZdO.js +3 -0
- streamlit/static/static/js/index.BHgV-yW4.js +1 -0
- streamlit/static/static/js/index.BQr-XwGV.js +1 -0
- streamlit/static/static/js/index.BTtmaLDB.js +1 -0
- streamlit/static/static/js/index.BWB_91TA.js +1 -0
- streamlit/static/static/js/index.BfEKaEmw.js +1 -0
- streamlit/static/static/js/index.BfXjTO8b.js +1 -0
- streamlit/static/static/js/index.Bjy4NRu9.js +3 -0
- streamlit/static/static/js/index.Bu5JWpT_.js +1 -0
- streamlit/static/static/js/index.BuCx76ZV.js +1 -0
- streamlit/static/static/js/index.BxjzhVUb.js +2 -0
- streamlit/static/static/js/index.By55VdPY.js +1 -0
- streamlit/static/static/js/index.CF5MxTbK.js +1 -0
- streamlit/static/static/js/index.CLmq_z9K.js +1 -0
- streamlit/static/static/js/index.CNH4rdSz.js +1 -0
- streamlit/static/static/js/{index.B0H9IXUJ.js → index.CTgm_-jO.js} +10 -41
- streamlit/static/static/js/index.C_rK-Swb.js +188 -0
- streamlit/static/static/js/index.CjozwSzS.js +1 -0
- streamlit/static/static/js/{index.CH1tqnSs.js → index.CkGVt6-G.js} +1 -1
- streamlit/static/static/js/index.CuvXOyER.js +2 -0
- streamlit/static/static/js/{index.FFOzOWzC.js → index.CyUHWoCC.js} +2 -2
- streamlit/static/static/js/index.CyroQtI4.js +2 -0
- streamlit/static/static/js/index.D6HmkoDm.js +263 -0
- streamlit/static/static/js/index.DAqCNvsO.js +1 -0
- streamlit/static/static/js/index.DB_w_CZQ.js +1 -0
- streamlit/static/static/js/index.DBalctjj.js +2 -0
- streamlit/static/static/js/index.DK0RFJUG.js +11 -0
- streamlit/static/static/js/index.DMxc2XFp.js +151 -0
- streamlit/static/static/js/index.DO5utP74.js +2 -0
- streamlit/static/static/js/index.DS7lf09n.js +1 -0
- streamlit/static/static/js/index.DWexTVLY.js +1 -0
- streamlit/static/static/js/index.DXxnU5ej.js +1 -0
- streamlit/static/static/js/index.DcU3uDvB.js +2 -0
- streamlit/static/static/js/index.DlltaH7J.js +1 -0
- streamlit/static/static/js/index.DpNTZz82.js +27 -0
- streamlit/static/static/js/index.Dr9HIhQw.js +1 -0
- streamlit/static/static/js/index.DsgAU5lc.js +1 -0
- streamlit/static/static/js/{index.64ejlaaT.js → index.KfXqjDYy.js} +1 -1
- streamlit/static/static/js/index.PaidgjCs.js +1 -0
- streamlit/static/static/js/index.RJZuWCGA.js +1 -0
- streamlit/static/static/js/{index.Ctn27_AE.js → index.hbeqcRTn.js} +53 -122
- streamlit/static/static/js/index.q5hIQwAY.js +1 -0
- streamlit/static/static/js/index.rORSX6IW.js +1 -0
- streamlit/static/static/js/index.uSX757_v.js +1 -0
- streamlit/static/static/js/index.x_QRaLMd.js +1 -0
- streamlit/static/static/js/{input.s6pjQ49A.js → input.D5oh9-aB.js} +2 -2
- streamlit/static/static/js/main.q9oGOg0H.js +13 -0
- streamlit/static/static/js/{memory.Cuvsdfrl.js → memory.5kCSFUJS.js} +1 -1
- streamlit/static/static/js/moment.C3j7ZXd7.js +4 -0
- streamlit/static/static/js/number-overlay-editor.Cn_LsK8N.js +9 -0
- streamlit/static/static/js/pandasStylerUtils.BqhXt51_.js +1 -0
- streamlit/static/static/js/{possibleConstructorReturn.CqidKeei.js → possibleConstructorReturn.DD9NK1Z8.js} +1 -1
- streamlit/static/static/js/record.B-tDciZb.js +1 -0
- streamlit/static/static/js/{sandbox.CCQREcJx.js → sandbox.DACSyz29.js} +1 -1
- streamlit/static/static/js/styled-components.C3R090At.js +1 -0
- streamlit/static/static/js/threshold.Q1mXg5rX.js +1 -0
- streamlit/static/static/js/throttle.B0GR3Iyz.js +1 -0
- streamlit/static/static/js/{timepicker.mkJF97Bb.js → timepicker.BdhzPxrv.js} +1 -1
- streamlit/static/static/js/timer.C2hYhUse.js +1 -0
- streamlit/static/static/js/{toConsumableArray.De7I7KVR.js → toConsumableArray.Db2pdqM2.js} +1 -1
- streamlit/static/static/js/uniqueId.CtqIr-Yh.js +1 -0
- streamlit/static/static/js/urls.BwSlolu9.js +1 -0
- streamlit/static/static/js/{useBasicWidgetState.CedkNjUW.js → useBasicWidgetState.Bfp6TnSw.js} +1 -1
- streamlit/static/static/js/useIntlLocale.hRV75Xgj.js +12 -0
- streamlit/static/static/js/{useTextInputAutoExpand.Ca7w8dVs.js → useTextInputAutoExpand.QepX7n8Y.js} +1 -1
- streamlit/static/static/js/useUpdateUiValue.DHx8TzX6.js +1 -0
- streamlit/static/static/js/useWaveformController.WxVzpzEX.js +1 -0
- streamlit/static/static/js/value.B4vHRSi7.js +1 -0
- streamlit/static/static/js/wavesurfer.esm.vI8Eid4k.js +73 -0
- streamlit/static/static/js/withCalculatedWidth.DcKeRSWJ.js +1 -0
- streamlit/static/static/js/withFullScreenWrapper.CrHddARq.js +1 -0
- streamlit/static/static/media/MaterialSymbols-Rounded.C7IFxh57.woff2 +0 -0
- streamlit/string_util.py +9 -4
- streamlit/testing/v1/app_test.py +17 -2
- streamlit/testing/v1/element_tree.py +85 -9
- streamlit/testing/v1/util.py +2 -2
- streamlit/type_util.py +3 -4
- streamlit/url_util.py +1 -3
- streamlit/user_info.py +1 -2
- streamlit/util.py +3 -1
- streamlit/watcher/event_based_path_watcher.py +23 -12
- streamlit/watcher/local_sources_watcher.py +11 -1
- streamlit/watcher/path_watcher.py +9 -6
- streamlit/watcher/polling_path_watcher.py +4 -1
- streamlit/watcher/util.py +2 -2
- streamlit/web/bootstrap.py +24 -0
- streamlit/web/cli.py +51 -22
- streamlit/web/server/bidi_component_request_handler.py +193 -0
- streamlit/web/server/component_file_utils.py +97 -0
- streamlit/web/server/component_request_handler.py +8 -21
- streamlit/web/server/oauth_authlib_routes.py +5 -2
- streamlit/web/server/oidc_mixin.py +3 -1
- streamlit/web/server/routes.py +2 -2
- streamlit/web/server/server.py +9 -0
- streamlit/web/server/server_util.py +3 -1
- streamlit/web/server/upload_file_request_handler.py +19 -1
- {streamlit-1.50.0.dist-info → streamlit-1.52.0.dist-info}/METADATA +10 -7
- streamlit-1.52.0.dist-info/RECORD +620 -0
- streamlit/static/static/css/index.CHEnSPGk.css +0 -1
- streamlit/static/static/js/Hooks.BRba_Own.js +0 -1
- streamlit/static/static/js/InputInstructions.xnSDuYeQ.js +0 -1
- streamlit/static/static/js/Particles.CElH0XX2.js +0 -1
- streamlit/static/static/js/data-grid-overlay-editor.DcuHuCyW.js +0 -1
- streamlit/static/static/js/index.6xX1278W.js +0 -975
- streamlit/static/static/js/index.B-hiXRzw.js +0 -1
- streamlit/static/static/js/index.B4cAbHP6.js +0 -1
- streamlit/static/static/js/index.B4dUQfni.js +0 -1
- streamlit/static/static/js/index.BPQo7BKk.js +0 -1
- streamlit/static/static/js/index.Baqa90pe.js +0 -2
- streamlit/static/static/js/index.Bj9JgOEC.js +0 -1
- streamlit/static/static/js/index.BjCwMzj4.js +0 -3
- streamlit/static/static/js/index.Bm3VbPB5.js +0 -1
- streamlit/static/static/js/index.Bxz2yX3P.js +0 -1
- streamlit/static/static/js/index.BycLveZ4.js +0 -1
- streamlit/static/static/js/index.C9BdUqTi.js +0 -1
- streamlit/static/static/js/index.CFMf5_ez.js +0 -197
- streamlit/static/static/js/index.CGYqqs6j.js +0 -1
- streamlit/static/static/js/index.CMItVsFA.js +0 -1
- streamlit/static/static/js/index.CTBk8Vk2.js +0 -1
- streamlit/static/static/js/index.CiAQIz1H.js +0 -7
- streamlit/static/static/js/index.Cj7DSzVR.js +0 -73
- streamlit/static/static/js/index.Ck8rQ9OL.js +0 -1
- streamlit/static/static/js/index.ClELlchS.js +0 -1617
- streamlit/static/static/js/index.Cnpi3o3E.js +0 -1
- streamlit/static/static/js/index.D2QEXQq_.js +0 -1
- streamlit/static/static/js/index.DH71Ezyj.js +0 -1
- streamlit/static/static/js/index.DHh-U0dK.js +0 -3
- streamlit/static/static/js/index.DK7hD7_w.js +0 -1
- streamlit/static/static/js/index.DKv_lNO7.js +0 -2
- streamlit/static/static/js/index.DNLrMXgm.js +0 -12
- streamlit/static/static/js/index.DW0Grddz.js +0 -1
- streamlit/static/static/js/index.Dbe-Q3C-.js +0 -2
- streamlit/static/static/js/index.DcPNYEUo.js +0 -1
- streamlit/static/static/js/index.DuxqVQpd.js +0 -1
- streamlit/static/static/js/index.GRUzrudl.js +0 -1
- streamlit/static/static/js/number-overlay-editor.DdgVR5m3.js +0 -9
- streamlit/static/static/js/uniqueId.RI1LJdtz.js +0 -1
- streamlit/static/static/js/useUpdateUiValue.DeXelfRH.js +0 -1
- streamlit/static/static/js/withFullScreenWrapper.C3561XxJ.js +0 -1
- streamlit/static/static/media/MaterialSymbols-Rounded.DeCZgS-4.woff2 +0 -0
- streamlit-1.50.0.dist-info/RECORD +0 -557
- {streamlit-1.50.0.data → streamlit-1.52.0.data}/scripts/streamlit.cmd +0 -0
- {streamlit-1.50.0.dist-info → streamlit-1.52.0.dist-info}/WHEEL +0 -0
- {streamlit-1.50.0.dist-info → streamlit-1.52.0.dist-info}/entry_points.txt +0 -0
- {streamlit-1.50.0.dist-info → streamlit-1.52.0.dist-info}/top_level.txt +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,E as M,_ as Q,v as E,ax as T,m as h,o as J,x as ft,u as mt,a4 as bt,a5 as gt,ay as X,e as W,j as u,l as ht,Q as yt,T as It,P as Tt,W as Ct,y as wt,am as G}from"./index.6xX1278W.js";import{u as St}from"./uniqueId.RI1LJdtz.js";import{I as vt}from"./InputInstructions.xnSDuYeQ.js";import{u as Vt}from"./FormClearHelper.DTcdrasw.js";import{s as xt}from"./sprintf.D7DtBTRn.js";import{I as kt}from"./input.s6pjQ49A.js";import"./base-input.BQft14La.js";var Y=r.forwardRef(function(t,e){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(M,Q({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),r.createElement("path",{d:"M0 3v2h8V3H0z"}))});Y.displayName="Minus";var Z=r.forwardRef(function(t,e){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(M,Q({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),r.createElement("path",{d:"M3 0v3H0v2h3v3h2V5h3V3H5V0H3z"}))});Z.displayName="Plus";const Dt=E("div",{target:"eaba2yi0"})(({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:t.sizes.minElementHeight,borderWidth:t.sizes.borderWidth,borderStyle:"solid",borderColor:t.colors.widgetBorderColor??t.colors.secondaryBg,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:t.radii.default,overflow:"hidden","&.focused":{borderColor:t.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:t.spacing.none}}})),Et=E("div",{target:"eaba2yi1"})({display:"flex",flexDirection:"row",alignSelf:"stretch"}),K=E("button",{target:"eaba2yi2"})(({theme:t})=>({margin:t.spacing.none,border:"none",height:t.sizes.full,display:"flex",alignItems:"center",width:t.sizes.numberInputControlsWidth,justifyContent:"center",color:t.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:t.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:t.colors.white,backgroundColor:t.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:disabled":{cursor:"not-allowed",color:t.colors.fadedText40}})),Rt=E("div",{target:"eaba2yi3"})(({theme:t,clearable:e})=>({position:"absolute",marginRight:t.spacing.twoXS,left:0,right:`calc(${t.sizes.numberInputControlsWidth} * 2 + ${e?"1em":"0em"})`})),Nt=ft.getLogger("NumberInput");function Ft(t){return h(t)||t===""?void 0:t}const D=({value:t,format:e,step:a,dataType:m})=>{if(h(t))return null;let o=Ft(e);if(h(o)&&J(a)){const i=a.toString();m===T.DataType.FLOAT&&a!==0&&i.includes(".")&&(o=`%0.${i.split(".")[1].length}f`)}if(h(o))return t.toString();try{return xt.sprintf(o,t)}catch(i){return Nt.warn(`Error in sprintf(${o}, ${t}): ${i}`),String(t)}},zt=(t,e,a)=>h(t)?!1:t-e>=a,Wt=(t,e,a)=>h(t)?!1:t+e<=a,Lt=t=>(t.element.dataType===T.DataType.INT?t.widgetMgr.getIntValue(t.element):t.widgetMgr.getDoubleValue(t.element))??t.element.default??null,q=({step:t,dataType:e})=>t||(e===T.DataType.INT?1:.01),Bt=({disabled:t,element:e,widgetMgr:a,fragmentId:m})=>{const o=mt(),{dataType:i,id:v,formId:f,default:L,format:b,icon:R,min:y,max:I}=e,{width:B,elementRef:tt}=bt(),[s,et]=r.useState(()=>q(e)),P=Lt({element:e,widgetMgr:a}),[g,C]=r.useState(!1),[l,w]=r.useState(P),[U,H]=r.useState(!1),V=r.useRef(null),A=r.useRef(St("number_input_")),[$,S]=r.useState(()=>D({value:P,dataType:i,format:b,step:s})),x=zt(l,s,y),k=Wt(l,s,I),O=gt({formId:f}),ot=O?a.allowFormEnterToSubmit(f):g,rt=U&&B>o.breakpoints.hideWidgetDetails;r.useEffect(()=>{et(q({step:e.step,dataType:e.dataType}))},[e.dataType,e.step]),r.useEffect(()=>{g||S(D({value:l,dataType:i,format:b,step:s}))},[i,b,s]);const d=r.useCallback(({value:n,source:c})=>{if(J(n)&&(y>n||n>I))V.current?.reportValidity();else{const p=n??L??null;switch(i){case T.DataType.INT:a.setIntValue({id:v,formId:f},p,c,m);break;case T.DataType.FLOAT:a.setDoubleValue({id:v,formId:f},p,c,m);break;default:throw new Error("Invalid data type")}C(!1),w(p),S(D({value:p,dataType:i,format:b,step:s}))}},[y,I,V,a,m,s,i,v,f,L,b]),nt=r.useCallback(()=>{g&&d({value:l,source:{fromUi:!0}}),H(!1)},[g,l,d]),at=r.useCallback(()=>{H(!0)},[]),j=r.useCallback(()=>{const{value:n}=e;e.setValue=!1,w(n??null),S(D({value:n??null,dataType:i,format:b,step:s})),d({value:n??null,source:{fromUi:!1}})},[e,s,d,i,b]);r.useEffect(()=>{e.setValue?j():d({value:l,source:{fromUi:!1}});const n=V.current;if(n){const c=p=>{p.preventDefault()};return n.addEventListener("wheel",c),()=>{n.removeEventListener("wheel",c)}}},[]),e.setValue&&j();const N=h(e.default)&&!t,st=r.useCallback(()=>{const n=e.default??null;w(n),d({value:n,source:{fromUi:!0}})},[e]);Vt({element:e,widgetMgr:a,onFormCleared:st});const it=n=>{const{value:c}=n.target;if(c==="")C(!0),w(null),S(null);else{let p;e.dataType===T.DataType.INT?p=parseInt(c,10):p=parseFloat(c),C(!0),w(p),S(c)}},F=r.useCallback(()=>{k&&(C(!0),d({value:(l??y)+s,source:{fromUi:!0}}))},[l,y,s,k]),z=r.useCallback(()=>{x&&(C(!0),d({value:(l??I)-s,source:{fromUi:!0}}))},[l,I,s,x]),lt=r.useCallback(n=>{const{key:c}=n;switch(c){case"ArrowUp":n.preventDefault(),F();break;case"ArrowDown":n.preventDefault(),z();break}},[F,z]),ct=r.useCallback(n=>{n.key==="Enter"&&(g&&d({value:l,source:{fromUi:!0}}),a.allowFormEnterToSubmit(f)&&a.submitForm(f,m))},[g,l,d,a,f,m]),_=R?.startsWith(":material"),ut=_?"lg":"base",dt=X(o.iconSizes.lg)+2*X(o.spacing.twoXS),pt=R?o.breakpoints.hideNumberInputControls+dt:o.breakpoints.hideNumberInputControls;return W("div",{className:"stNumberInput","data-testid":"stNumberInput",ref:tt,children:[u(Ct,{label:e.label,disabled:t,labelVisibility:ht(e.labelVisibility?.value),htmlFor:A.current,children:e.help&&u(yt,{children:u(It,{content:e.help,placement:Tt.TOP_RIGHT})})}),W(Dt,{className:U?"focused":"","data-testid":"stNumberInputContainer",children:[u(kt,{type:"number",inputRef:V,value:$??"",placeholder:e.placeholder,onBlur:nt,onFocus:at,onChange:it,onKeyPress:ct,onKeyDown:lt,clearable:N,clearOnEscape:N,disabled:t,"aria-label":e.label,startEnhancer:e.icon&&u(wt,{"data-testid":"stNumberInputIcon",iconValue:e.icon,size:ut}),id:A.current,overrides:{ClearIconContainer:{style:{padding:0}},ClearIcon:{props:{overrides:{Svg:{style:{color:o.colors.grayTextColor,padding:o.spacing.threeXS,height:o.sizes.clearIconSize,width:o.sizes.clearIconSize,":hover":{fill:o.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInputField",step:s,min:y,max:I,type:"number",inputMode:""},style:{fontWeight:o.fontWeights.normal,lineHeight:o.lineHeights.inputWidget,paddingRight:o.spacing.sm,paddingLeft:o.spacing.md,paddingBottom:o.spacing.sm,paddingTop:o.spacing.sm,"::placeholder":{color:o.colors.fadedText60}}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:{borderTopRightRadius:0,borderBottomRightRadius:0,borderTopLeftRadius:0,borderBottomLeftRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingRight:0,paddingLeft:R?o.spacing.sm:0}},StartEnhancer:{style:{paddingLeft:0,paddingRight:0,minWidth:o.iconSizes.lg,color:_?o.colors.fadedText60:"inherit"}}}}),B>pt&&W(Et,{children:[u(K,{"data-testid":"stNumberInputStepDown",onClick:z,disabled:!x||t,tabIndex:-1,children:u(G,{content:Y,size:"xs",color:x?"inherit":o.colors.fadedText40})}),u(K,{"data-testid":"stNumberInputStepUp",onClick:F,disabled:!k||t,tabIndex:-1,children:u(G,{content:Z,size:"xs",color:k?"inherit":o.colors.fadedText40})})]})]}),rt&&u(Rt,{clearable:N,children:u(vt,{dirty:g,value:$??"",inForm:O,allowEnterToSubmit:ot})})]})},_t=r.memo(Bt);export{_t as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{v as c,r as a,j as o,e as u,af as f,ag as S,S as g}from"./index.6xX1278W.js";const x=c("div",{target:"e8cs83k0"})(({theme:e,cache:n})=>({...n?{paddingBottom:e.spacing.lg,background:`linear-gradient(to bottom, ${e.colors.bgColor} 0%, ${e.colors.bgColor} 80%, transparent 100%)`}:null})),T=c("div",{target:"e8cs83k1"})({display:"flex",alignItems:"center",width:"100%"}),$=c("div",{target:"e8cs83k2"})(({theme:e})=>({display:"flex",gap:e.spacing.sm,alignItems:"baseline"})),h=c("div",{target:"e8cs83k3"})(({theme:e})=>({opacity:.6,fontSize:e.fontSizes.sm})),y=e=>{const n=Math.floor(e/3600),t=Math.floor(e%3600/60),s=e%60;if(n===0&&t===0)return`(${s.toFixed(1)} seconds)`;if(n===0){const d=`${t} minute${t===1?"":"s"}`,m=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${d}${m})`}const l=`${n} hour${n===1?"":"s"}`,r=t===0?"":`, ${t} minute${t===1?"":"s"}`,i=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${l}${r}${i})`};function v({element:e}){const{cache:n,showTime:t}=e,[s,l]=a.useState(0),r=a.useRef(null);return a.useEffect(()=>{if(!t)return;r.current=Date.now();const i=()=>{if(r.current!==null){const p=(Date.now()-r.current)/1e3;l(p)}};i();const d=setInterval(i,100);return()=>clearInterval(d)},[t]),o(x,{className:f({stSpinner:!0,stCacheSpinner:n}),"data-testid":"stSpinner",cache:n,children:u(T,{children:[o(S,{size:"base",margin:"0 md 0 0",padding:"0"}),u($,{children:[o(g,{source:e.text,allowHTML:!1}),t&&o(h,{children:y(s)})]})]})})}const k=a.memo(v);export{k as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{v as l,r as d,L as p,u,j as a,a as f,P as x,e as b,y as k,S as L}from"./index.6xX1278W.js";const v=l("div",{target:"e11lneww0"})({display:"flex",flexDirection:"column",width:"100%"}),w=l("a",{target:"e11lneww1"})(({disabled:n,isCurrentPage:e,theme:o})=>({textDecoration:"none",width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:o.spacing.sm,borderRadius:o.radii.default,paddingLeft:o.spacing.sm,paddingRight:o.spacing.sm,marginTop:o.spacing.threeXS,marginBottom:o.spacing.threeXS,lineHeight:o.lineHeights.menuItem,backgroundColor:e?o.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:e?o.colors.darkenedBgMix25:o.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:o.colors.darkenedBgMix15},"@media print":{paddingLeft:o.spacing.none},...n?{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed","&:hover":{color:o.colors.fadedText40,backgroundColor:o.colors.transparent}}:{}})),C=l("span",{target:"e11lneww2"})(({disabled:n,theme:e})=>({color:e.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...n?{borderColor:e.colors.borderColor,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed"}:{}}));function T(n){const{onPageChange:e,currentPageScriptHash:o}=d.useContext(p),{colors:i}=u(),{disabled:t,element:r}=n,s=o===r.pageScriptHash,g=c=>{r.external?t&&c.preventDefault():(c.preventDefault(),t||e(r.pageScriptHash))};return a("div",{className:"stPageLink","data-testid":"stPageLink",children:a(f,{help:r.help,placement:x.TOP_RIGHT,containerWidth:!0,children:a(v,{children:b(w,{"data-testid":"stPageLink-NavLink",disabled:t,isCurrentPage:s,href:r.page,target:r.external?"_blank":"",rel:"noreferrer",onClick:g,children:[r.icon&&a(k,{size:"lg",color:t?i.fadedText40:i.bodyText,iconValue:r.icon}),a(C,{disabled:t,children:a(L,{source:r.label,allowHTML:!1,isLabel:!0,boldLabel:s,largerLabel:!0,disableLinks:!0})})]})})})})}const S=d.memo(T);export{S as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{v as c,$ as l,r as i,j as a,ap as p}from"./index.6xX1278W.js";import{P as d,R as f}from"./Particles.CElH0XX2.js";const g=""+new URL("../media/flake-0.DgWaVvm5.png",import.meta.url).href,u=""+new URL("../media/flake-1.B2r5AHMK.png",import.meta.url).href,E=""+new URL("../media/flake-2.BnWSExPC.png",import.meta.url).href,o=150,s=150,S=10,x=90,_=4e3,e=(t,n=0)=>Math.random()*(t-n)+n,w=()=>l(`from{transform:translateY(0)
|
|
2
|
-
rotateX(`,e(360),`deg)
|
|
3
|
-
rotateY(`,e(360),`deg)
|
|
4
|
-
rotateZ(`,e(360),"deg);}to{transform:translateY(calc(100vh + ",o,`px))
|
|
5
|
-
rotateX(0)
|
|
6
|
-
rotateY(0)
|
|
7
|
-
rotateZ(0);}`),A=c("img",{target:"es7rdur0"})(({theme:t})=>({position:"fixed",top:`${-o}px`,marginLeft:`${-s/2}px`,zIndex:t.zIndices.balloons,left:`${e(x,S)}vw`,animationDelay:`${e(_)}ms`,height:`${o}px`,width:`${s}px`,pointerEvents:"none",animationDuration:"3000ms",animationName:w(),animationTimingFunction:"ease-in",animationDirection:"normal",animationIterationCount:1,opacity:1})),I=100,m=[g,u,E],M=m.length,h=i.memo(({particleType:t,resourceCrossOriginMode:n})=>{const r=m[t];return a(A,{src:r,crossOrigin:p(n,r)})}),P=function({scriptRunId:n}){return a(f,{children:a(d,{className:"stSnow","data-testid":"stSnow",scriptRunId:n,numParticleTypes:M,numParticles:I,ParticleComponent:h})})},L=i.memo(P);export{I as NUM_FLAKES,L as default};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import{r as u,E as X,_ as Y,L as qt,m as ht,o as z,b1 as Et,bo as Gt,bi as Xt,bh as Yt,v as A,j as b,ag as Zt,e as H,B as Kt,am as Jt,b as Qt,x as te,bu as ee,u as ie,bv as Q,ay as re,aP as se,l as ne,T as oe,P as ae,W as le}from"./index.6xX1278W.js";import{T as ce,a as Pt}from"./Toolbar.C77ar7rq.js";import{u as de,F as ue}from"./FormClearHelper.DTcdrasw.js";import{c as he}from"./createDownloadLinkElement.ZaXNnPK4.js";import{u as pe}from"./Hooks.BRba_Own.js";import{F as fe,D as me}from"./FileDownload.esm.CN4j9-1w.js";var Dt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(X,Y({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("g",{fill:"none"},u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24})),u.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"}),u.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"}))});Dt.displayName="Mic";var At=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(X,Y({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("rect",{width:24,height:24,fill:"none"}),u.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"}))});At.displayName="Pause";var kt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(X,Y({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("rect",{width:24,height:24,fill:"none"}),u.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"}))});kt.displayName="PlayArrow";var Wt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(X,Y({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),u.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"}))});Wt.displayName="Refresh";var Mt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(X,Y({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("g",{fill:"none"},u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24})),u.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"}))});Mt.displayName="StopCircle";function x(s,t,e,i){return new(e||(e=Promise))(function(r,n){function o(c){try{d(i.next(c))}catch(l){n(l)}}function a(c){try{d(i.throw(c))}catch(l){n(l)}}function d(c){var l;c.done?r(c.value):(l=c.value,l instanceof e?l:new e(function(h){h(l)})).then(o,a)}d((i=i.apply(s,t||[])).next())})}let Z=class{constructor(){this.listeners={}}on(t,e,i){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(e),i?.once){const r=()=>{this.un(t,r),this.un(t,e)};return this.on(t,r),r}return()=>this.un(t,e)}un(t,e){var i;(i=this.listeners[t])===null||i===void 0||i.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach(i=>i(...e))}};const tt={decode:function(s,t){return x(this,void 0,void 0,function*(){const e=new AudioContext({sampleRate:t});return e.decodeAudioData(s).finally(()=>e.close())})},createBuffer:function(s,t){return typeof s[0]=="number"&&(s=[s]),function(e){const i=e[0];if(i.some(r=>r>1||r<-1)){const r=i.length;let n=0;for(let o=0;o<r;o++){const a=Math.abs(i[o]);a>n&&(n=a)}for(const o of e)for(let a=0;a<r;a++)o[a]/=n}}(s),{duration:t,length:s[0].length,sampleRate:s[0].length/t,numberOfChannels:s.length,getChannelData:e=>s?.[e],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function Ot(s,t){const e=t.xmlns?document.createElementNS(t.xmlns,s):document.createElement(s);for(const[i,r]of Object.entries(t))if(i==="children"&&r)for(const[n,o]of Object.entries(r))o instanceof Node?e.appendChild(o):typeof o=="string"?e.appendChild(document.createTextNode(o)):e.appendChild(Ot(n,o));else i==="style"?Object.assign(e.style,r):i==="textContent"?e.textContent=r:e.setAttribute(i,r.toString());return e}function xt(s,t,e){const i=Ot(s,t||{});return e?.appendChild(i),i}var ge=Object.freeze({__proto__:null,createElement:xt,default:xt});const ve={fetchBlob:function(s,t,e){return x(this,void 0,void 0,function*(){const i=yield fetch(s,e);if(i.status>=400)throw new Error(`Failed to fetch ${s}: ${i.status} (${i.statusText})`);return function(r,n){x(this,void 0,void 0,function*(){if(!r.body||!r.headers)return;const o=r.body.getReader(),a=Number(r.headers.get("Content-Length"))||0;let d=0;const c=h=>x(this,void 0,void 0,function*(){d+=h?.length||0;const f=Math.round(d/a*100);n(f)}),l=()=>x(this,void 0,void 0,function*(){let h;try{h=yield o.read()}catch{return}h.done||(c(h.value),yield l())});l()})}(i.clone(),t),i.blob()})}};class be extends Z{constructor(t){super(),this.isExternalMedia=!1,t.media?(this.media=t.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),t.mediaControls&&(this.media.controls=!0),t.autoplay&&(this.media.autoplay=!0),t.playbackRate!=null&&this.onMediaEvent("canplay",()=>{t.playbackRate!=null&&(this.media.playbackRate=t.playbackRate)},{once:!0})}onMediaEvent(t,e,i){return this.media.addEventListener(t,e,i),()=>this.media.removeEventListener(t,e,i)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const t=this.getSrc();t.startsWith("blob:")&&URL.revokeObjectURL(t)}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,e){const i=this.getSrc();if(t&&i===t)return;this.revokeSrc();const r=e instanceof Blob&&(this.canPlayType(e.type)||!t)?URL.createObjectURL(e):t;if(i&&this.media.removeAttribute("src"),r||t)try{this.media.src=r}catch{this.media.src=t}}destroy(){this.isExternalMedia||(this.media.pause(),this.media.remove(),this.revokeSrc(),this.media.removeAttribute("src"),this.media.load())}setMediaElement(t){this.media=t}play(){return x(this,void 0,void 0,function*(){try{return yield this.media.play()}catch(t){if(t instanceof DOMException&&t.name==="AbortError")return;throw t}})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=Math.max(0,Math.min(t,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,e){e!=null&&(this.media.preservesPitch=e),this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){return this.media.setSinkId(t)}}class V extends Z{constructor(t,e){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.unsubscribeOnScroll=[],this.subscriptions=[],this.options=t;const i=this.parentFromOptionsContainer(t.container);this.parent=i;const[r,n]=this.initHtml();i.appendChild(r),this.container=r,this.scrollContainer=n.querySelector(".scroll"),this.wrapper=n.querySelector(".wrapper"),this.canvasWrapper=n.querySelector(".canvases"),this.progressWrapper=n.querySelector(".progress"),this.cursor=n.querySelector(".cursor"),e&&n.appendChild(e),this.initEvents()}parentFromOptionsContainer(t){let e;if(typeof t=="string"?e=document.querySelector(t):t instanceof HTMLElement&&(e=t),!e)throw new Error("Container not found");return e}initEvents(){const t=e=>{const i=this.wrapper.getBoundingClientRect(),r=e.clientX-i.left,n=e.clientY-i.top;return[r/i.width,n/i.height]};if(this.wrapper.addEventListener("click",e=>{const[i,r]=t(e);this.emit("click",i,r)}),this.wrapper.addEventListener("dblclick",e=>{const[i,r]=t(e);this.emit("dblclick",i,r)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:e,scrollWidth:i,clientWidth:r}=this.scrollContainer,n=e/i,o=(e+r)/i;this.emit("scroll",n,o,e,e+r)}),typeof ResizeObserver=="function"){const e=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{e().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;t===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=t,this.reRender())}initDrag(){this.subscriptions.push(function(t,e,i,r,n=3,o=0,a=100){if(!t)return()=>{};const d=matchMedia("(pointer: coarse)").matches;let c=()=>{};const l=h=>{if(h.button!==o)return;h.preventDefault(),h.stopPropagation();let f=h.clientX,p=h.clientY,m=!1;const w=Date.now(),g=y=>{if(y.preventDefault(),y.stopPropagation(),d&&Date.now()-w<a)return;const k=y.clientX,D=y.clientY,W=k-f,B=D-p;if(m||Math.abs(W)>n||Math.abs(B)>n){const U=t.getBoundingClientRect(),{left:K,top:N}=U;m||(i?.(f-K,p-N),m=!0),e(W,B,k-K,D-N),f=k,p=D}},C=y=>{if(m){const k=y.clientX,D=y.clientY,W=t.getBoundingClientRect(),{left:B,top:U}=W;r?.(k-B,D-U)}c()},S=y=>{y.relatedTarget&&y.relatedTarget!==document.documentElement||C(y)},M=y=>{m&&(y.stopPropagation(),y.preventDefault())},R=y=>{m&&y.preventDefault()};document.addEventListener("pointermove",g),document.addEventListener("pointerup",C),document.addEventListener("pointerout",S),document.addEventListener("pointercancel",S),document.addEventListener("touchmove",R,{passive:!1}),document.addEventListener("click",M,{capture:!0}),c=()=>{document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",C),document.removeEventListener("pointerout",S),document.removeEventListener("pointercancel",S),document.removeEventListener("touchmove",R),setTimeout(()=>{document.removeEventListener("click",M,{capture:!0})},10)}};return t.addEventListener("pointerdown",l),()=>{c(),t.removeEventListener("pointerdown",l)}}(this.wrapper,(t,e,i)=>{this.emit("drag",Math.max(0,Math.min(1,i/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))}))}getHeight(t,e){var i;const r=((i=this.audioData)===null||i===void 0?void 0:i.numberOfChannels)||1;if(t==null)return 128;if(!isNaN(Number(t)))return Number(t);if(t==="auto"){const n=this.parent.clientHeight||128;return e?.every(o=>!o.overlay)?n/r:n}return 128}initHtml(){const t=document.createElement("div"),e=t.attachShadow({mode:"open"}),i=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return e.innerHTML=`
|
|
2
|
-
<style${i?` nonce="${i}"`:""}>
|
|
3
|
-
:host {
|
|
4
|
-
user-select: none;
|
|
5
|
-
min-width: 1px;
|
|
6
|
-
}
|
|
7
|
-
:host audio {
|
|
8
|
-
display: block;
|
|
9
|
-
width: 100%;
|
|
10
|
-
}
|
|
11
|
-
:host .scroll {
|
|
12
|
-
overflow-x: auto;
|
|
13
|
-
overflow-y: hidden;
|
|
14
|
-
width: 100%;
|
|
15
|
-
position: relative;
|
|
16
|
-
}
|
|
17
|
-
:host .noScrollbar {
|
|
18
|
-
scrollbar-color: transparent;
|
|
19
|
-
scrollbar-width: none;
|
|
20
|
-
}
|
|
21
|
-
:host .noScrollbar::-webkit-scrollbar {
|
|
22
|
-
display: none;
|
|
23
|
-
-webkit-appearance: none;
|
|
24
|
-
}
|
|
25
|
-
:host .wrapper {
|
|
26
|
-
position: relative;
|
|
27
|
-
overflow: visible;
|
|
28
|
-
z-index: 2;
|
|
29
|
-
}
|
|
30
|
-
:host .canvases {
|
|
31
|
-
min-height: ${this.getHeight(this.options.height,this.options.splitChannels)}px;
|
|
32
|
-
}
|
|
33
|
-
:host .canvases > div {
|
|
34
|
-
position: relative;
|
|
35
|
-
}
|
|
36
|
-
:host canvas {
|
|
37
|
-
display: block;
|
|
38
|
-
position: absolute;
|
|
39
|
-
top: 0;
|
|
40
|
-
image-rendering: pixelated;
|
|
41
|
-
}
|
|
42
|
-
:host .progress {
|
|
43
|
-
pointer-events: none;
|
|
44
|
-
position: absolute;
|
|
45
|
-
z-index: 2;
|
|
46
|
-
top: 0;
|
|
47
|
-
left: 0;
|
|
48
|
-
width: 0;
|
|
49
|
-
height: 100%;
|
|
50
|
-
overflow: hidden;
|
|
51
|
-
}
|
|
52
|
-
:host .progress > div {
|
|
53
|
-
position: relative;
|
|
54
|
-
}
|
|
55
|
-
:host .cursor {
|
|
56
|
-
pointer-events: none;
|
|
57
|
-
position: absolute;
|
|
58
|
-
z-index: 5;
|
|
59
|
-
top: 0;
|
|
60
|
-
left: 0;
|
|
61
|
-
height: 100%;
|
|
62
|
-
border-radius: 2px;
|
|
63
|
-
}
|
|
64
|
-
</style>
|
|
65
|
-
|
|
66
|
-
<div class="scroll" part="scroll">
|
|
67
|
-
<div class="wrapper" part="wrapper">
|
|
68
|
-
<div class="canvases" part="canvases"></div>
|
|
69
|
-
<div class="progress" part="progress"></div>
|
|
70
|
-
<div class="cursor" part="cursor"></div>
|
|
71
|
-
</div>
|
|
72
|
-
</div>
|
|
73
|
-
`,[t,e]}setOptions(t){if(this.options.container!==t.container){const e=this.parentFromOptionsContainer(t.container);e.appendChild(this.container),this.parent=e}t.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.options=t,this.reRender()}getWrapper(){return this.wrapper}getWidth(){return this.scrollContainer.clientWidth}getScroll(){return this.scrollContainer.scrollLeft}setScroll(t){this.scrollContainer.scrollLeft=t}setScrollPercentage(t){const{scrollWidth:e}=this.scrollContainer,i=e*t;this.setScroll(i)}destroy(){var t,e;this.subscriptions.forEach(i=>i()),this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(e=this.unsubscribeOnScroll)===null||e===void 0||e.forEach(i=>i()),this.unsubscribeOnScroll=[]}createDelay(t=10){let e,i;const r=()=>{e&&clearTimeout(e),i&&i()};return this.timeouts.push(r),()=>new Promise((n,o)=>{r(),i=o,e=setTimeout(()=>{e=void 0,i=void 0,n()},t)})}convertColorValues(t){if(!Array.isArray(t))return t||"";if(t.length<2)return t[0]||"";const e=document.createElement("canvas"),i=e.getContext("2d"),r=e.height*(window.devicePixelRatio||1),n=i.createLinearGradient(0,0,0,r),o=1/(t.length-1);return t.forEach((a,d)=>{const c=d*o;n.addColorStop(c,a)}),n}getPixelRatio(){return Math.max(1,window.devicePixelRatio||1)}renderBarWaveform(t,e,i,r){const n=t[0],o=t[1]||t[0],a=n.length,{width:d,height:c}=i.canvas,l=c/2,h=this.getPixelRatio(),f=e.barWidth?e.barWidth*h:1,p=e.barGap?e.barGap*h:e.barWidth?f/2:0,m=e.barRadius||0,w=d/(f+p)/a,g=m&&"roundRect"in i?"roundRect":"rect";i.beginPath();let C=0,S=0,M=0;for(let R=0;R<=a;R++){const y=Math.round(R*w);if(y>C){const W=Math.round(S*l*r),B=W+Math.round(M*l*r)||1;let U=l-W;e.barAlign==="top"?U=0:e.barAlign==="bottom"&&(U=c-B),i[g](C*(f+p),U,f,B,m),C=y,S=0,M=0}const k=Math.abs(n[R]||0),D=Math.abs(o[R]||0);k>S&&(S=k),D>M&&(M=D)}i.fill(),i.closePath()}renderLineWaveform(t,e,i,r){const n=o=>{const a=t[o]||t[0],d=a.length,{height:c}=i.canvas,l=c/2,h=i.canvas.width/d;i.moveTo(0,l);let f=0,p=0;for(let m=0;m<=d;m++){const w=Math.round(m*h);if(w>f){const C=l+(Math.round(p*l*r)||1)*(o===0?-1:1);i.lineTo(f,C),f=w,p=0}const g=Math.abs(a[m]||0);g>p&&(p=g)}i.lineTo(f,l)};i.beginPath(),n(0),n(1),i.fill(),i.closePath()}renderWaveform(t,e,i){if(i.fillStyle=this.convertColorValues(e.waveColor),e.renderFunction)return void e.renderFunction(t,i);let r=e.barHeight||1;if(e.normalize){const n=Array.from(t[0]).reduce((o,a)=>Math.max(o,Math.abs(a)),0);r=n?1/n:1}e.barWidth||e.barGap||e.barAlign?this.renderBarWaveform(t,e,i,r):this.renderLineWaveform(t,e,i,r)}renderSingleCanvas(t,e,i,r,n,o,a){const d=this.getPixelRatio(),c=document.createElement("canvas");c.width=Math.round(i*d),c.height=Math.round(r*d),c.style.width=`${i}px`,c.style.height=`${r}px`,c.style.left=`${Math.round(n)}px`,o.appendChild(c);const l=c.getContext("2d");if(this.renderWaveform(t,e,l),c.width>0&&c.height>0){const h=c.cloneNode(),f=h.getContext("2d");f.drawImage(c,0,0),f.globalCompositeOperation="source-in",f.fillStyle=this.convertColorValues(e.progressColor),f.fillRect(0,0,c.width,c.height),a.appendChild(h)}}renderMultiCanvas(t,e,i,r,n,o){const a=this.getPixelRatio(),{clientWidth:d}=this.scrollContainer,c=i/a;let l=Math.min(V.MAX_CANVAS_WIDTH,d,c),h={};if(e.barWidth||e.barGap){const g=e.barWidth||.5,C=g+(e.barGap||g/2);l%C!=0&&(l=Math.floor(l/C)*C)}if(l===0)return;const f=g=>{if(g<0||g>=p||h[g])return;h[g]=!0;const C=g*l;let S=Math.min(c-C,l);if(e.barWidth||e.barGap){const R=e.barWidth||.5,y=R+(e.barGap||R/2);S=Math.floor(S/y)*y}if(S<=0)return;const M=t.map(R=>{const y=Math.floor(C/c*R.length),k=Math.floor((C+S)/c*R.length);return R.slice(y,k)});this.renderSingleCanvas(M,e,S,r,C,n,o)},p=Math.ceil(c/l);if(!this.isScrollable){for(let g=0;g<p;g++)f(g);return}const m=this.scrollContainer.scrollLeft/c,w=Math.floor(m*p);if(f(w-1),f(w),f(w+1),p>1){const g=this.on("scroll",()=>{const{scrollLeft:C}=this.scrollContainer,S=Math.floor(C/c*p);Object.keys(h).length>V.MAX_NODES&&(n.innerHTML="",o.innerHTML="",h={}),f(S-1),f(S),f(S+1)});this.unsubscribeOnScroll.push(g)}}renderChannel(t,e,i,r){var{overlay:n}=e,o=function(l,h){var f={};for(var p in l)Object.prototype.hasOwnProperty.call(l,p)&&h.indexOf(p)<0&&(f[p]=l[p]);if(l!=null&&typeof Object.getOwnPropertySymbols=="function"){var m=0;for(p=Object.getOwnPropertySymbols(l);m<p.length;m++)h.indexOf(p[m])<0&&Object.prototype.propertyIsEnumerable.call(l,p[m])&&(f[p[m]]=l[p[m]])}return f}(e,["overlay"]);const a=document.createElement("div"),d=this.getHeight(o.height,o.splitChannels);a.style.height=`${d}px`,n&&r>0&&(a.style.marginTop=`-${d}px`),this.canvasWrapper.style.minHeight=`${d}px`,this.canvasWrapper.appendChild(a);const c=a.cloneNode();this.progressWrapper.appendChild(c),this.renderMultiCanvas(t,o,i,d,a,c)}render(t){return x(this,void 0,void 0,function*(){var e;this.timeouts.forEach(d=>d()),this.timeouts=[],this.canvasWrapper.innerHTML="",this.progressWrapper.innerHTML="",this.options.width!=null&&(this.scrollContainer.style.width=typeof this.options.width=="number"?`${this.options.width}px`:this.options.width);const i=this.getPixelRatio(),r=this.scrollContainer.clientWidth,n=Math.ceil(t.duration*(this.options.minPxPerSec||0));this.isScrollable=n>r;const o=this.options.fillParent&&!this.isScrollable,a=(o?r:n)*i;if(this.wrapper.style.width=o?"100%":`${n}px`,this.scrollContainer.style.overflowX=this.isScrollable?"auto":"hidden",this.scrollContainer.classList.toggle("noScrollbar",!!this.options.hideScrollbar),this.cursor.style.backgroundColor=`${this.options.cursorColor||this.options.progressColor}`,this.cursor.style.width=`${this.options.cursorWidth}px`,this.audioData=t,this.emit("render"),this.options.splitChannels)for(let d=0;d<t.numberOfChannels;d++){const c=Object.assign(Object.assign({},this.options),(e=this.options.splitChannels)===null||e===void 0?void 0:e[d]);this.renderChannel([t.getChannelData(d)],c,a,d)}else{const d=[t.getChannelData(0)];t.numberOfChannels>1&&d.push(t.getChannelData(1)),this.renderChannel(d,this.options,a,0)}Promise.resolve().then(()=>this.emit("rendered"))})}reRender(){if(this.unsubscribeOnScroll.forEach(i=>i()),this.unsubscribeOnScroll=[],!this.audioData)return;const{scrollWidth:t}=this.scrollContainer,{right:e}=this.progressWrapper.getBoundingClientRect();if(this.render(this.audioData),this.isScrollable&&t!==this.scrollContainer.scrollWidth){const{right:i}=this.progressWrapper.getBoundingClientRect();let r=i-e;r*=2,r=r<0?Math.floor(r):Math.ceil(r),r/=2,this.scrollContainer.scrollLeft+=r}}zoom(t){this.options.minPxPerSec=t,this.reRender()}scrollIntoView(t,e=!1){const{scrollLeft:i,scrollWidth:r,clientWidth:n}=this.scrollContainer,o=t*r,a=i,d=i+n,c=n/2;if(this.isDragging)o+30>d?this.scrollContainer.scrollLeft+=30:o-30<a&&(this.scrollContainer.scrollLeft-=30);else{(o<a||o>d)&&(this.scrollContainer.scrollLeft=o-(this.options.autoCenter?c:0));const l=o-i-c;e&&this.options.autoCenter&&l>0&&(this.scrollContainer.scrollLeft+=Math.min(l,10))}{const l=this.scrollContainer.scrollLeft,h=l/r,f=(l+n)/r;this.emit("scroll",h,f,l,l+n)}}renderProgress(t,e){if(isNaN(t))return;const i=100*t;this.canvasWrapper.style.clipPath=`polygon(${i}% 0%, 100% 0%, 100% 100%, ${i}% 100%)`,this.progressWrapper.style.width=`${i}%`,this.cursor.style.left=`${i}%`,this.cursor.style.transform=this.options.cursorWidth?`translateX(-${t*this.options.cursorWidth}px)`:"",this.isScrollable&&this.options.autoScroll&&this.scrollIntoView(t,e)}exportImage(t,e,i){return x(this,void 0,void 0,function*(){const r=this.canvasWrapper.querySelectorAll("canvas");if(!r.length)throw new Error("No waveform data");if(i==="dataURL"){const n=Array.from(r).map(o=>o.toDataURL(t,e));return Promise.resolve(n)}return Promise.all(Array.from(r).map(n=>new Promise((o,a)=>{n.toBlob(d=>{d?o(d):a(new Error("Could not export image"))},t,e)})))})}}V.MAX_CANVAS_WIDTH=8e3,V.MAX_NODES=10;class ye extends Z{constructor(){super(...arguments),this.unsubscribe=()=>{}}start(){this.unsubscribe=this.on("tick",()=>{requestAnimationFrame(()=>{this.emit("tick")})}),this.emit("tick")}stop(){this.unsubscribe()}destroy(){this.unsubscribe()}}class at extends Z{constructor(t=new AudioContext){super(),this.bufferNode=null,this.playStartTime=0,this.playedDuration=0,this._muted=!1,this._playbackRate=1,this._duration=void 0,this.buffer=null,this.currentSrc="",this.paused=!0,this.crossOrigin=null,this.seeking=!1,this.autoplay=!1,this.addEventListener=this.on,this.removeEventListener=this.un,this.audioContext=t,this.gainNode=this.audioContext.createGain(),this.gainNode.connect(this.audioContext.destination)}load(){return x(this,void 0,void 0,function*(){})}get src(){return this.currentSrc}set src(t){if(this.currentSrc=t,this._duration=void 0,!t)return this.buffer=null,void this.emit("emptied");fetch(t).then(e=>{if(e.status>=400)throw new Error(`Failed to fetch ${t}: ${e.status} (${e.statusText})`);return e.arrayBuffer()}).then(e=>this.currentSrc!==t?null:this.audioContext.decodeAudioData(e)).then(e=>{this.currentSrc===t&&(this.buffer=e,this.emit("loadedmetadata"),this.emit("canplay"),this.autoplay&&this.play())})}_play(){var t;if(!this.paused)return;this.paused=!1,(t=this.bufferNode)===null||t===void 0||t.disconnect(),this.bufferNode=this.audioContext.createBufferSource(),this.buffer&&(this.bufferNode.buffer=this.buffer),this.bufferNode.playbackRate.value=this._playbackRate,this.bufferNode.connect(this.gainNode);let e=this.playedDuration*this._playbackRate;(e>=this.duration||e<0)&&(e=0,this.playedDuration=0),this.bufferNode.start(this.audioContext.currentTime,e),this.playStartTime=this.audioContext.currentTime,this.bufferNode.onended=()=>{this.currentTime>=this.duration&&(this.pause(),this.emit("ended"))}}_pause(){var t;this.paused=!0,(t=this.bufferNode)===null||t===void 0||t.stop(),this.playedDuration+=this.audioContext.currentTime-this.playStartTime}play(){return x(this,void 0,void 0,function*(){this.paused&&(this._play(),this.emit("play"))})}pause(){this.paused||(this._pause(),this.emit("pause"))}stopAt(t){const e=t-this.currentTime,i=this.bufferNode;i?.stop(this.audioContext.currentTime+e),i?.addEventListener("ended",()=>{i===this.bufferNode&&(this.bufferNode=null,this.pause())},{once:!0})}setSinkId(t){return x(this,void 0,void 0,function*(){return this.audioContext.setSinkId(t)})}get playbackRate(){return this._playbackRate}set playbackRate(t){this._playbackRate=t,this.bufferNode&&(this.bufferNode.playbackRate.value=t)}get currentTime(){return(this.paused?this.playedDuration:this.playedDuration+(this.audioContext.currentTime-this.playStartTime))*this._playbackRate}set currentTime(t){const e=!this.paused;e&&this._pause(),this.playedDuration=t/this._playbackRate,e&&this._play(),this.emit("seeking"),this.emit("timeupdate")}get duration(){var t,e;return(t=this._duration)!==null&&t!==void 0?t:((e=this.buffer)===null||e===void 0?void 0:e.duration)||0}set duration(t){this._duration=t}get volume(){return this.gainNode.gain.value}set volume(t){this.gainNode.gain.value=t,this.emit("volumechange")}get muted(){return this._muted}set muted(t){this._muted!==t&&(this._muted=t,this._muted?this.gainNode.disconnect():this.gainNode.connect(this.audioContext.destination))}canPlayType(t){return/^(audio|video)\//.test(t)}getGainNode(){return this.gainNode}getChannelData(){const t=[];if(!this.buffer)return t;const e=this.buffer.numberOfChannels;for(let i=0;i<e;i++)t.push(this.buffer.getChannelData(i));return t}removeAttribute(t){switch(t){case"src":this.src="";break;case"playbackRate":this.playbackRate=0;break;case"currentTime":this.currentTime=0;break;case"duration":this.duration=0;break;case"volume":this.volume=0;break;case"muted":this.muted=!1}}}const we={waveColor:"#999",progressColor:"#555",cursorWidth:1,minPxPerSec:0,fillParent:!0,interact:!0,dragToSeek:!1,autoScroll:!0,autoCenter:!0,sampleRate:8e3};class q extends be{static create(t){return new q(t)}constructor(t){const e=t.media||(t.backend==="WebAudio"?new at:void 0);super({media:e,mediaControls:t.mediaControls,autoplay:t.autoplay,playbackRate:t.audioRate}),this.plugins=[],this.decodedData=null,this.stopAtPosition=null,this.subscriptions=[],this.mediaSubscriptions=[],this.abortController=null,this.options=Object.assign({},we,t),this.timer=new ye;const i=e?void 0:this.getMediaElement();this.renderer=new V(this.options,i),this.initPlayerEvents(),this.initRendererEvents(),this.initTimerEvents(),this.initPlugins();const r=this.options.url||this.getSrc()||"";Promise.resolve().then(()=>{this.emit("init");const{peaks:n,duration:o}=this.options;(r||n&&o)&&this.load(r,n,o).catch(()=>null)})}updateProgress(t=this.getCurrentTime()){return this.renderer.renderProgress(t/this.getDuration(),this.isPlaying()),t}initTimerEvents(){this.subscriptions.push(this.timer.on("tick",()=>{if(!this.isSeeking()){const t=this.updateProgress();this.emit("timeupdate",t),this.emit("audioprocess",t),this.stopAtPosition!=null&&this.isPlaying()&&t>=this.stopAtPosition&&this.pause()}}))}initPlayerEvents(){this.isPlaying()&&(this.emit("play"),this.timer.start()),this.mediaSubscriptions.push(this.onMediaEvent("timeupdate",()=>{const t=this.updateProgress();this.emit("timeupdate",t)}),this.onMediaEvent("play",()=>{this.emit("play"),this.timer.start()}),this.onMediaEvent("pause",()=>{this.emit("pause"),this.timer.stop(),this.stopAtPosition=null}),this.onMediaEvent("emptied",()=>{this.timer.stop(),this.stopAtPosition=null}),this.onMediaEvent("ended",()=>{this.emit("timeupdate",this.getDuration()),this.emit("finish"),this.stopAtPosition=null}),this.onMediaEvent("seeking",()=>{this.emit("seeking",this.getCurrentTime())}),this.onMediaEvent("error",()=>{var t;this.emit("error",(t=this.getMediaElement().error)!==null&&t!==void 0?t:new Error("Media error")),this.stopAtPosition=null}))}initRendererEvents(){this.subscriptions.push(this.renderer.on("click",(t,e)=>{this.options.interact&&(this.seekTo(t),this.emit("interaction",t*this.getDuration()),this.emit("click",t,e))}),this.renderer.on("dblclick",(t,e)=>{this.emit("dblclick",t,e)}),this.renderer.on("scroll",(t,e,i,r)=>{const n=this.getDuration();this.emit("scroll",t*n,e*n,i,r)}),this.renderer.on("render",()=>{this.emit("redraw")}),this.renderer.on("rendered",()=>{this.emit("redrawcomplete")}),this.renderer.on("dragstart",t=>{this.emit("dragstart",t)}),this.renderer.on("dragend",t=>{this.emit("dragend",t)}));{let t;this.subscriptions.push(this.renderer.on("drag",e=>{if(!this.options.interact)return;let i;this.renderer.renderProgress(e),clearTimeout(t),this.isPlaying()?i=0:this.options.dragToSeek===!0?i=200:typeof this.options.dragToSeek=="object"&&this.options.dragToSeek!==void 0&&(i=this.options.dragToSeek.debounceTime),t=setTimeout(()=>{this.seekTo(e)},i),this.emit("interaction",e*this.getDuration()),this.emit("drag",e)}))}}initPlugins(){var t;!((t=this.options.plugins)===null||t===void 0)&&t.length&&this.options.plugins.forEach(e=>{this.registerPlugin(e)})}unsubscribePlayerEvents(){this.mediaSubscriptions.forEach(t=>t()),this.mediaSubscriptions=[]}setOptions(t){this.options=Object.assign({},this.options,t),t.duration&&!t.peaks&&(this.decodedData=tt.createBuffer(this.exportPeaks(),t.duration)),t.peaks&&t.duration&&(this.decodedData=tt.createBuffer(t.peaks,t.duration)),this.renderer.setOptions(this.options),t.audioRate&&this.setPlaybackRate(t.audioRate),t.mediaControls!=null&&(this.getMediaElement().controls=t.mediaControls)}registerPlugin(t){if(this.plugins.includes(t))return t;t._init(this),this.plugins.push(t);const e=t.once("destroy",()=>{this.plugins=this.plugins.filter(i=>i!==t),this.subscriptions=this.subscriptions.filter(i=>i!==e)});return this.subscriptions.push(e),t}unregisterPlugin(t){this.plugins=this.plugins.filter(e=>e!==t),t.destroy()}getWrapper(){return this.renderer.getWrapper()}getWidth(){return this.renderer.getWidth()}getScroll(){return this.renderer.getScroll()}setScroll(t){return this.renderer.setScroll(t)}setScrollTime(t){const e=t/this.getDuration();this.renderer.setScrollPercentage(e)}getActivePlugins(){return this.plugins}loadAudio(t,e,i,r){return x(this,void 0,void 0,function*(){var n;if(this.emit("load",t),!this.options.media&&this.isPlaying()&&this.pause(),this.decodedData=null,this.stopAtPosition=null,!e&&!i){const a=this.options.fetchParams||{};window.AbortController&&!a.signal&&(this.abortController=new AbortController,a.signal=(n=this.abortController)===null||n===void 0?void 0:n.signal);const d=l=>this.emit("loading",l);e=yield ve.fetchBlob(t,d,a);const c=this.options.blobMimeType;c&&(e=new Blob([e],{type:c}))}this.setSrc(t,e);const o=yield new Promise(a=>{const d=r||this.getDuration();d?a(d):this.mediaSubscriptions.push(this.onMediaEvent("loadedmetadata",()=>a(this.getDuration()),{once:!0}))});if(!t&&!e){const a=this.getMediaElement();a instanceof at&&(a.duration=o)}if(i)this.decodedData=tt.createBuffer(i,o||0);else if(e){const a=yield e.arrayBuffer();this.decodedData=yield tt.decode(a,this.options.sampleRate)}this.decodedData&&(this.emit("decode",this.getDuration()),this.renderer.render(this.decodedData)),this.emit("ready",this.getDuration())})}load(t,e,i){return x(this,void 0,void 0,function*(){try{return yield this.loadAudio(t,void 0,e,i)}catch(r){throw this.emit("error",r),r}})}loadBlob(t,e,i){return x(this,void 0,void 0,function*(){try{return yield this.loadAudio("",t,e,i)}catch(r){throw this.emit("error",r),r}})}zoom(t){if(!this.decodedData)throw new Error("No audio loaded");this.renderer.zoom(t),this.emit("zoom",t)}getDecodedData(){return this.decodedData}exportPeaks({channels:t=2,maxLength:e=8e3,precision:i=1e4}={}){if(!this.decodedData)throw new Error("The audio has not been decoded yet");const r=Math.min(t,this.decodedData.numberOfChannels),n=[];for(let o=0;o<r;o++){const a=this.decodedData.getChannelData(o),d=[],c=a.length/e;for(let l=0;l<e;l++){const h=a.slice(Math.floor(l*c),Math.ceil((l+1)*c));let f=0;for(let p=0;p<h.length;p++){const m=h[p];Math.abs(m)>Math.abs(f)&&(f=m)}d.push(Math.round(f*i)/i)}n.push(d)}return n}getDuration(){let t=super.getDuration()||0;return t!==0&&t!==1/0||!this.decodedData||(t=this.decodedData.duration),t}toggleInteraction(t){this.options.interact=t}setTime(t){this.stopAtPosition=null,super.setTime(t),this.updateProgress(t),this.emit("timeupdate",t)}seekTo(t){const e=this.getDuration()*t;this.setTime(e)}play(t,e){const i=Object.create(null,{play:{get:()=>super.play}});return x(this,void 0,void 0,function*(){t!=null&&this.setTime(t);const r=yield i.play.call(this);return e!=null&&(this.media instanceof at?this.media.stopAt(e):this.stopAtPosition=e),r})}playPause(){return x(this,void 0,void 0,function*(){return this.isPlaying()?this.pause():this.play()})}stop(){this.pause(),this.setTime(0)}skip(t){this.setTime(this.getCurrentTime()+t)}empty(){this.load("",[[0]],.001)}setMediaElement(t){this.unsubscribePlayerEvents(),super.setMediaElement(t),this.initPlayerEvents()}exportImage(){return x(this,arguments,void 0,function*(t="image/png",e=1,i="dataURL"){return this.renderer.exportImage(t,e,i)})}destroy(){var t;this.emit("destroy"),(t=this.abortController)===null||t===void 0||t.abort(),this.plugins.forEach(e=>e.destroy()),this.subscriptions.forEach(e=>e()),this.unsubscribePlayerEvents(),this.timer.destroy(),this.renderer.destroy(),super.destroy()}}q.BasePlugin=class extends Z{constructor(s){super(),this.subscriptions=[],this.isDestroyed=!1,this.options=s}onInit(){}_init(s){this.isDestroyed&&(this.subscriptions=[],this.isDestroyed=!1),this.wavesurfer=s,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(s=>s()),this.subscriptions=[],this.isDestroyed=!0,this.wavesurfer=void 0}},q.dom=ge;function lt(s,t,e,i){return new(e||(e=Promise))(function(r,n){function o(c){try{d(i.next(c))}catch(l){n(l)}}function a(c){try{d(i.throw(c))}catch(l){n(l)}}function d(c){var l;c.done?r(c.value):(l=c.value,l instanceof e?l:new e(function(h){h(l)})).then(o,a)}d((i=i.apply(s,[])).next())})}class It{constructor(){this.listeners={}}on(t,e,i){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(e),i?.once){const r=()=>{this.un(t,r),this.un(t,e)};return this.on(t,r),r}return()=>this.un(t,e)}un(t,e){var i;(i=this.listeners[t])===null||i===void 0||i.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach(i=>i(...e))}}class Ce extends It{constructor(t){super(),this.subscriptions=[],this.isDestroyed=!1,this.options=t}onInit(){}_init(t){this.isDestroyed&&(this.subscriptions=[],this.isDestroyed=!1),this.wavesurfer=t,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(t=>t()),this.subscriptions=[],this.isDestroyed=!0,this.wavesurfer=void 0}}class Se extends It{constructor(){super(...arguments),this.unsubscribe=()=>{}}start(){this.unsubscribe=this.on("tick",()=>{requestAnimationFrame(()=>{this.emit("tick")})}),this.emit("tick")}stop(){this.unsubscribe()}destroy(){this.unsubscribe()}}const Re=["audio/webm","audio/wav","audio/mpeg","audio/mp4","audio/mp3"];class pt extends Ce{constructor(t){var e,i,r,n,o,a;super(Object.assign(Object.assign({},t),{audioBitsPerSecond:(e=t.audioBitsPerSecond)!==null&&e!==void 0?e:128e3,scrollingWaveform:(i=t.scrollingWaveform)!==null&&i!==void 0&&i,scrollingWaveformWindow:(r=t.scrollingWaveformWindow)!==null&&r!==void 0?r:5,continuousWaveform:(n=t.continuousWaveform)!==null&&n!==void 0&&n,renderRecordedAudio:(o=t.renderRecordedAudio)===null||o===void 0||o,mediaRecorderTimeslice:(a=t.mediaRecorderTimeslice)!==null&&a!==void 0?a:void 0})),this.stream=null,this.mediaRecorder=null,this.dataWindow=null,this.isWaveformPaused=!1,this.lastStartTime=0,this.lastDuration=0,this.duration=0,this.timer=new Se,this.subscriptions.push(this.timer.on("tick",()=>{const d=performance.now()-this.lastStartTime;this.duration=this.isPaused()?this.duration:this.lastDuration+d,this.emit("record-progress",this.duration)}))}static create(t){return new pt(t||{})}renderMicStream(t){var e;const i=new AudioContext,r=i.createMediaStreamSource(t),n=i.createAnalyser();r.connect(n),this.options.continuousWaveform&&(n.fftSize=32);const o=n.frequencyBinCount,a=new Float32Array(o);let d=0;this.wavesurfer&&((e=this.originalOptions)!==null&&e!==void 0||(this.originalOptions=Object.assign({},this.wavesurfer.options)),this.wavesurfer.options.interact=!1,this.options.scrollingWaveform&&(this.wavesurfer.options.cursorWidth=0));const c=setInterval(()=>{var l,h,f,p;if(!this.isWaveformPaused){if(n.getFloatTimeDomainData(a),this.options.scrollingWaveform){const m=Math.floor((this.options.scrollingWaveformWindow||0)*i.sampleRate),w=Math.min(m,this.dataWindow?this.dataWindow.length+o:o),g=new Float32Array(m);if(this.dataWindow){const C=Math.max(0,m-this.dataWindow.length);g.set(this.dataWindow.slice(-w+o),C)}g.set(a,m-o),this.dataWindow=g}else if(this.options.continuousWaveform){if(!this.dataWindow){const w=this.options.continuousWaveformDuration?Math.round(100*this.options.continuousWaveformDuration):((h=(l=this.wavesurfer)===null||l===void 0?void 0:l.getWidth())!==null&&h!==void 0?h:0)*window.devicePixelRatio;this.dataWindow=new Float32Array(w)}let m=0;for(let w=0;w<o;w++){const g=Math.abs(a[w]);g>m&&(m=g)}if(d+1>this.dataWindow.length){const w=new Float32Array(2*this.dataWindow.length);w.set(this.dataWindow,0),this.dataWindow=w}this.dataWindow[d]=m,d++}else this.dataWindow=a;if(this.wavesurfer){const m=((p=(f=this.dataWindow)===null||f===void 0?void 0:f.length)!==null&&p!==void 0?p:0)/100;this.wavesurfer.load("",[this.dataWindow],this.options.scrollingWaveform?this.options.scrollingWaveformWindow:m).then(()=>{this.wavesurfer&&this.options.continuousWaveform&&(this.wavesurfer.setTime(this.getDuration()/1e3),this.wavesurfer.options.minPxPerSec||this.wavesurfer.setOptions({minPxPerSec:this.wavesurfer.getWidth()/this.wavesurfer.getDuration()}))}).catch(w=>{console.error("Error rendering real-time recording data:",w)})}}},10);return{onDestroy:()=>{clearInterval(c),r?.disconnect(),i?.close()},onEnd:()=>{this.isWaveformPaused=!0,clearInterval(c),this.stopMic()}}}startMic(t){return lt(this,void 0,void 0,function*(){let e;try{e=yield navigator.mediaDevices.getUserMedia({audio:t==null||t})}catch(n){throw new Error("Error accessing the microphone: "+n.message)}const{onDestroy:i,onEnd:r}=this.renderMicStream(e);return this.subscriptions.push(this.once("destroy",i)),this.subscriptions.push(this.once("record-end",r)),this.stream=e,e})}stopMic(){this.stream&&(this.stream.getTracks().forEach(t=>t.stop()),this.stream=null,this.mediaRecorder=null)}startRecording(t){return lt(this,void 0,void 0,function*(){const e=this.stream||(yield this.startMic(t));this.dataWindow=null;const i=this.mediaRecorder||new MediaRecorder(e,{mimeType:this.options.mimeType||Re.find(o=>MediaRecorder.isTypeSupported(o)),audioBitsPerSecond:this.options.audioBitsPerSecond});this.mediaRecorder=i,this.stopRecording();const r=[];i.ondataavailable=o=>{o.data.size>0&&r.push(o.data),this.emit("record-data-available",o.data)};const n=o=>{var a;const d=new Blob(r,{type:i.mimeType});this.emit(o,d),this.options.renderRecordedAudio&&(this.applyOriginalOptionsIfNeeded(),(a=this.wavesurfer)===null||a===void 0||a.load(URL.createObjectURL(d)))};i.onpause=()=>n("record-pause"),i.onstop=()=>n("record-end"),i.start(this.options.mediaRecorderTimeslice),this.lastStartTime=performance.now(),this.lastDuration=0,this.duration=0,this.isWaveformPaused=!1,this.timer.start(),this.emit("record-start")})}getDuration(){return this.duration}isRecording(){var t;return((t=this.mediaRecorder)===null||t===void 0?void 0:t.state)==="recording"}isPaused(){var t;return((t=this.mediaRecorder)===null||t===void 0?void 0:t.state)==="paused"}isActive(){var t;return((t=this.mediaRecorder)===null||t===void 0?void 0:t.state)!=="inactive"}stopRecording(){var t;this.isActive()&&((t=this.mediaRecorder)===null||t===void 0||t.stop(),this.timer.stop())}pauseRecording(){var t,e;this.isRecording()&&(this.isWaveformPaused=!0,(t=this.mediaRecorder)===null||t===void 0||t.requestData(),(e=this.mediaRecorder)===null||e===void 0||e.pause(),this.timer.stop(),this.lastDuration=this.duration)}resumeRecording(){var t;this.isPaused()&&(this.isWaveformPaused=!1,(t=this.mediaRecorder)===null||t===void 0||t.resume(),this.timer.start(),this.lastStartTime=performance.now(),this.emit("record-resume"))}static getAvailableAudioDevices(){return lt(this,void 0,void 0,function*(){return navigator.mediaDevices.enumerateDevices().then(t=>t.filter(e=>e.kind==="audioinput"))})}destroy(){this.applyOriginalOptionsIfNeeded(),super.destroy(),this.stopRecording(),this.stopMic()}applyOriginalOptionsIfNeeded(){this.wavesurfer&&this.originalOptions&&(this.wavesurfer.setOptions(this.originalOptions),delete this.originalOptions)}}const Ee=(s,t)=>{const{libConfig:{enforceDownloadInNewTab:e=!1}}=u.useContext(qt);return u.useCallback(()=>{if(!s)return;const r=he({enforceDownloadInNewTab:e,url:s,filename:t});r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r)},[s,e,t])},ct=({widgetMgr:s,id:t,formId:e,key:i,defaultValue:r})=>{u.useEffect(()=>{const l=s.getElementState(t,i);ht(l)&&z(r)&&s.setElementState(t,i,r)},[s,t,i,r]);const[n,o]=u.useState(s.getElementState(t,i)??r),a=u.useCallback(l=>{s.setElementState(t,i,l),o(l)},[s,t,i]),d=u.useMemo(()=>({formId:e||""}),[e]),c=u.useCallback(()=>a(r),[r,a]);return de({element:d,widgetMgr:s,onFormCleared:c}),[n,a]},Pe=async({files:s,uploadClient:t,widgetMgr:e,widgetInfo:i,fragmentId:r})=>{let n=[];try{n=await t.fetchFileURLs(s)}catch(c){return{successfulUploads:[],failedUploads:s.map(l=>({file:l,error:Et(c)}))}}const o=Gt(s,n),a=[],d=[];return await Promise.all(o.map(async([c,l])=>{if(!c||!l?.uploadUrl||!l.fileId)return{file:c,fileUrl:l,error:new Error("No upload URL found")};try{await t.uploadFile({id:l.fileId,formId:i.formId||""},l.uploadUrl,c),a.push({fileUrl:l,file:c})}catch(h){const f=Et(h);d.push({file:c,error:f})}})),e.setFileUploaderStateValue(i,new Xt({uploadedFileInfo:a.map(({file:c,fileUrl:l})=>new Yt({fileId:l.fileId,fileUrls:l,name:c.webkitRelativePath||c.name,size:c.size}))}),{fromUi:!0},r),{successfulUploads:a,failedUploads:d}},xe=A("div",{target:"e15cf08q0"})(),Tt=A("div",{target:"e15cf08q1"})(({theme:s,disabled:t})=>({height:s.sizes.largestElementHeight,width:"100%",background:s.colors.secondaryBg,borderRadius:s.radii.default,marginBottom:s.spacing.twoXS,display:"flex",alignItems:"center",position:"relative",paddingLeft:s.spacing.xs,paddingRight:s.spacing.sm,border:s.colors.widgetBorderColor?`${s.sizes.borderWidth} solid ${s.colors.widgetBorderColor}`:void 0,cursor:t?"not-allowed":"auto"})),Te=A("div",{target:"e15cf08q2"})({flex:1}),De=A("div",{target:"e15cf08q3"})(({show:s})=>({display:s?"block":"none"})),Ae=A("span",{target:"e15cf08q4"})(({theme:s,isPlayingOrRecording:t,disabled:e})=>({margin:s.spacing.sm,fontFamily:s.fonts.monospace,color:e?s.colors.fadedText40:t?s.colors.bodyText:s.colors.fadedText60,backgroundColor:s.colors.secondaryBg,fontSize:s.fontSizes.sm})),Lt=A("div",{target:"e15cf08q5"})({width:"100%",textAlign:"center",overflow:"hidden"}),Bt=A("span",{target:"e15cf08q6"})(({theme:s})=>({color:s.colors.bodyText})),ke=A("a",{target:"e15cf08q7"})(({theme:s})=>({color:s.colors.link,textDecoration:s.linkUnderline?"underline":"none"})),We=A("div",{target:"e15cf08q8"})(({theme:s})=>({height:s.sizes.largestElementHeight,display:"flex",justifyContent:"center",alignItems:"center"})),Me=A("div",{target:"e15cf08q9"})(({theme:s})=>{const t="0.625em";return{opacity:.2,width:"100%",height:t,backgroundSize:t,backgroundImage:`radial-gradient(${s.colors.fadedText10} 40%, transparent 40%)`,backgroundRepeat:"repeat"}}),Oe=A("span",{target:"e15cf08q10"})(({theme:s})=>({"& > button":{color:s.colors.primary,padding:s.spacing.threeXS},"& > button:hover, & > button:focus":{color:s.colors.redColor}})),Ie=A("span",{target:"e15cf08q11"})(({theme:s})=>({"& > button":{padding:s.spacing.threeXS,color:s.colors.fadedText60},"& > button:hover, & > button:focus":{color:s.colors.bodyText}})),Ut=A("span",{target:"e15cf08q12"})(({theme:s})=>({"& > button":{padding:s.spacing.threeXS,color:s.colors.fadedText60},"& > button:hover, & > button:focus":{color:s.colors.bodyText}})),dt=A("div",{target:"e15cf08q13"})(({theme:s})=>({display:"flex",justifyContent:"center",alignItems:"center",flexGrow:0,flexShrink:1,padding:s.spacing.xs,gap:s.spacing.twoXS,marginRight:s.spacing.twoXS})),Le=A("div",{target:"e15cf08q14"})(({theme:s})=>({marginLeft:s.spacing.sm})),G=({onClick:s,disabled:t,ariaLabel:e,iconContent:i})=>b(Qt,{kind:Kt.BORDERLESS_ICON,onClick:s,disabled:t,"aria-label":e,containerWidth:!0,"data-testid":"stAudioInputActionButton",children:b(Jt,{content:i,size:"lg",color:"inherit"})}),Be=({disabled:s,stopRecording:t})=>b(Oe,{children:b(G,{onClick:t,disabled:s,ariaLabel:"Stop recording",iconContent:Mt})}),Ue=({disabled:s,isPlaying:t,onClickPlayPause:e})=>b(Ut,{children:t?b(G,{onClick:e,disabled:s,ariaLabel:"Pause",iconContent:At}):b(G,{onClick:e,disabled:s,ariaLabel:"Play",iconContent:kt})}),Ne=({disabled:s,startRecording:t})=>b(Ie,{children:b(G,{onClick:t,disabled:s,ariaLabel:"Record",iconContent:Dt})}),Fe=({onClick:s})=>b(Ut,{children:b(G,{disabled:!1,onClick:s,ariaLabel:"Reset",iconContent:Wt})}),_e=({disabled:s,isRecording:t,isPlaying:e,isUploading:i,isError:r,recordingUrlExists:n,startRecording:o,stopRecording:a,onClickPlayPause:d,onClear:c})=>r?b(dt,{children:b(Fe,{onClick:c})}):i?b(dt,{children:b(Zt,{"aria-label":"Uploading",size:"base",margin:"0",padding:"0"})}):H(dt,{children:[t?b(Be,{disabled:s,stopRecording:a}):b(Ne,{disabled:s,startRecording:o}),n&&b(Ue,{disabled:s,isPlaying:e,onClickPlayPause:d})]}),ze=u.memo(_e),$e=()=>b(Lt,{children:b(Bt,{children:"An error has occurred, please try again."})}),He=u.memo($e),Ve=4,je=4,qe=4,Ge=8,Xe=0,et="00:00",_=te.getLogger("convertAudioToWav");async function Ye(s,t){if(!s||s.size===0){_.error("Invalid or empty blob provided");return}if(!window.AudioContext){_.error("AudioContext not supported in this browser");return}const e=new AudioContext;let i;try{i=await s.arrayBuffer()}catch(h){_.error("Failed to read blob as ArrayBuffer",h),e.close();return}let r;try{r=await e.decodeAudioData(i)}catch(h){_.error("Failed to decode audio data",h),e.close();return}finally{e.close()}const n=t||r.sampleRate;if(n===r.sampleRate)return _.debug(`No resampling needed, sample rate is already ${n}Hz`),it(r,n);_.debug(`Resampling from ${r.sampleRate}Hz to ${n}Hz`);const{duration:o,numberOfChannels:a}=r,d=Math.ceil(o*n);if(!window.OfflineAudioContext)return _.error("OfflineAudioContext not supported, falling back to no resampling"),it(r,r.sampleRate);const c=new OfflineAudioContext(a,d,n),l=c.createBufferSource();l.buffer=r,l.connect(c.destination),l.start(0);try{const h=await c.startRendering();return it(h,n)}catch(h){return _.error("Failed to resample audio using OfflineAudioContext",h),it(r,r.sampleRate)}}function it(s,t){const i=s.numberOfChannels,r=s.length*i*2+44,n=new ArrayBuffer(r),o=new DataView(n),a=(c,l)=>{for(let h=0;h<l.length;h++)o.setUint8(c+h,l.charCodeAt(h))};a(0,"RIFF"),o.setUint32(4,r-8,!0),a(8,"WAVE"),a(12,"fmt "),o.setUint32(16,16,!0),o.setUint16(20,1,!0),o.setUint16(22,i,!0),o.setUint32(24,t,!0),o.setUint32(28,t*i*2,!0),o.setUint16(32,i*2,!0),o.setUint16(34,16,!0),a(36,"data"),o.setUint32(40,r-44,!0);let d=44;for(let c=0;c<s.length;c++)for(let l=0;l<i;l++){const h=Math.max(-1,Math.min(1,s.getChannelData(l)[c]));o.setInt16(d,h*32767,!0),d+=2}return new Blob([n],{type:"audio/wav"})}const ut=s=>{const t=Math.floor(s/1e3),e=Math.floor(t/60),i=Math.floor(e/60),r=t%60,n=e%60,o=r.toString().padStart(2,"0"),a=n.toString().padStart(2,"0"),d=i.toString().padStart(2,"0");return e<60?`${a}:${o}`:`${d}:${a}:${o}`},Ze=()=>H(Lt,{children:[b(Bt,{children:"This app would like to use your microphone."})," ",b(ke,{href:ee,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]}),Ke=u.memo(Ze),Je=()=>b(We,{children:b(Me,{})}),Qe=u.memo(Je),ti=({element:s,uploadClient:t,widgetMgr:e,fragmentId:i,disabled:r})=>{const n=ie(),o=pe(n),[a,d]=u.useState(null),c=u.useRef(null),l=u.useRef(null),[h,f]=ct({widgetMgr:e,id:s.id,key:"deleteFileUrl",defaultValue:null}),[p,m]=ct({widgetMgr:e,id:s.id,key:"recordingUrl",defaultValue:null}),[,w]=u.useState(0),g=u.useCallback(()=>{w(v=>v+1)},[]),[C,S]=u.useState(et),[M,R]=ct({widgetMgr:e,id:s.id,formId:s.formId,key:"recordingTime",defaultValue:et}),[y,k]=u.useState(!1),[D,W]=u.useState(!1),[B,U]=u.useState(!1),[K,N]=u.useState(!1),[rt,O]=u.useState(!1),ft=s.id,I=s.formId,j=s.sampleRate||null,L=u.useRef(null),st=u.useRef({}),mt=u.useCallback(async v=>{try{N(!0),z(I)&&e.setFormsWithUploadsInProgress(new Set([I]));let E;if(v.type==="audio/wav"?E=v:E=await Ye(v,j||void 0),!E){O(!0),N(!1),z(I)&&e.setFormsWithUploadsInProgress(new Set);return}let T;try{T=URL.createObjectURL(E),l.current&&l.current!==T&&URL.revokeObjectURL(l.current),l.current=T}catch{O(!0),N(!1),z(I)&&e.setFormsWithUploadsInProgress(new Set);return}m(T),a&&(a.load(T),a.setOptions({interact:!0,waveColor:Q(n.colors.fadedText40,n.colors.secondaryBg),progressColor:n.colors.bodyText}));const $=new Date().toISOString().slice(0,16).replace(/:/g,"-"),P=new File([E],`${$}_audio.wav`,{type:E.type});try{const{successfulUploads:J,failedUploads:ot}=await Pe({files:[P],uploadClient:t,widgetMgr:e,widgetInfo:{id:ft,formId:I},fragmentId:i});if(ot.length>0){O(!0);return}O(!1);const Rt=J[0];Rt?.fileUrl?.deleteUrl&&f(Rt.fileUrl.deleteUrl)}catch{O(!0)}finally{z(I)&&e.setFormsWithUploadsInProgress(new Set),N(!1)}}catch{O(!0),N(!1),z(I)&&e.setFormsWithUploadsInProgress(new Set)}},[t,e,a,ft,I,i,f,j,m,n.colors.fadedText40,n.colors.secondaryBg,n.colors.bodyText]),F=u.useCallback(async({updateWidgetManager:v,deleteFile:E})=>{if(ht(a))return;const T=p;if(T&&l.current===T&&(URL.revokeObjectURL(T),l.current=null),m(null),f(null),S(et),R(et),k(!1),a.empty(),v&&e.setFileUploaderStateValue(s,{},{fromUi:!0},i),E&&h)try{await t.deleteFile(h)}catch{}z(T)&&URL.revokeObjectURL(T)},[h,p,t,a,s,e,i,R,f,m]);u.useEffect(()=>{if(ht(I))return;const v=new ue;return v.manageFormClearListener(e,I,()=>{F({updateWidgetManager:!0,deleteFile:!1})}),()=>v.disconnect()},[I,F,e]);const gt=u.useCallback(()=>{if(c.current===null)return;const v=q.create({container:c.current,waveColor:p?Q(n.colors.fadedText40,n.colors.secondaryBg):n.colors.primary,progressColor:n.colors.bodyText,height:re(n.sizes.largestElementHeight)-2*Ve,barWidth:je,barGap:qe,barRadius:Ge,cursorWidth:Xe,interact:!0}),E=P=>{S(ut(P*1e3))},T=()=>{g()};v.on("timeupdate",E),v.on("pause",T),d(v),p&&(v.load(p),v.setOptions({interact:!0}));const $={renderRecordedAudio:!1,scrollingWaveform:!1,mimeType:"audio/webm"};try{const P=v.registerPlugin(pt.create($));L.current=P;const J=ot=>{R(ut(ot))};P.on("record-progress",J),st.current={handleRecordProgress:J}}catch(P){P instanceof Error&&(P.name==="NotAllowedError"||P.name==="PermissionDeniedError")&&W(!0)}return()=>{if(L.current){L.current.isRecording()&&L.current.stopRecording();const P=st.current;P.handleRecordProgress&&L.current.un("record-progress",P.handleRecordProgress),L.current.destroy(),L.current=null,st.current={}}v&&(v.un("timeupdate",E),v.un("pause",T),v.destroy())}},[n,S,g,p,R,W]);u.useEffect(()=>gt(),[gt]),u.useEffect(()=>{se(o,n)||a?.setOptions({waveColor:p?Q(n.colors.fadedText40,n.colors.secondaryBg):n.colors.primary,progressColor:n.colors.bodyText,interact:!0})},[n,o,p,a]);const Nt=u.useCallback(()=>{if(!a)return;(async()=>{try{await a.playPause()}catch{O(!0)}k(!0),g()})()},[a,g]),vt=u.useCallback(async()=>{if(!B){U(!0);let v=null;try{v=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{W(!0);return}finally{v&&v.getTracks().forEach(E=>E.stop())}}if(p&&await F({updateWidgetManager:!1,deleteFile:!0}),L.current&&a){a.setOptions({waveColor:n.colors.primary});const v=j?{sampleRate:{ideal:j}}:{};try{await L.current.startRecording(v),R(ut(0)),g()}catch(E){E instanceof Error&&(E.name==="NotAllowedError"||E.name==="PermissionDeniedError")?W(!0):O(!0)}}else D||O(!0)},[B,R,D,j,a,n.colors.primary,g,p,F]),bt=u.useCallback(v=>new Promise((E,T)=>{const $=P=>{v.un("record-end",$),P&&P instanceof Blob&&P.size>0?E(P):T(new Error("Invalid or empty recording blob"))};v.on("record-end",$),v.stopRecording()}),[]),yt=u.useCallback(async()=>{const v=L.current;if(v?.isRecording())try{const E=await bt(v);await mt(E),a&&a.setOptions({waveColor:Q(n.colors.fadedText40,n.colors.secondaryBg),progressColor:n.colors.bodyText})}catch{O(!0)}},[mt,a,n,bt]),wt=Ee(p,"recording.wav"),nt=L.current?.isRecording()||!1,Ct=!!a?.isPlaying(),Ft=nt||Ct,St=!nt&&!p&&!D,_t=D||St||rt,zt=u.useCallback(()=>{vt()},[vt]),$t=u.useCallback(()=>{yt()},[yt]),Ht=u.useCallback(()=>{F({updateWidgetManager:!1,deleteFile:!0}),O(!1)},[F]),Vt=u.useCallback(()=>{wt()},[wt]),jt=u.useCallback(()=>{F({updateWidgetManager:!0,deleteFile:!0})},[F]);return H(xe,{className:"stAudioInput","data-testid":"stAudioInput",children:[b(le,{label:s.label,disabled:r,labelVisibility:ne(s.labelVisibility?.value),children:s.help&&b(Le,{children:b(oe,{content:s.help,placement:ae.TOP})})}),H(Tt,{disabled:r,children:[H(ce,{isFullScreen:!1,disableFullscreenMode:!0,target:Tt,children:[p&&b(Pt,{label:"Download as WAV",icon:fe,onClick:Vt}),h&&b(Pt,{label:"Clear recording",icon:me,onClick:jt})]}),b(ze,{isRecording:nt,isPlaying:Ct,isUploading:K,isError:rt,recordingUrlExists:!!p,startRecording:zt,stopRecording:$t,onClickPlayPause:Nt,onClear:Ht,disabled:r||D}),H(Te,{children:[rt&&b(He,{}),St&&b(Qe,{}),D&&b(Ke,{}),b(De,{"data-testid":"stAudioInputWaveSurfer",ref:c,show:!_t})]}),b(Ae,{isPlayingOrRecording:Ft,disabled:r,"data-testid":"stAudioInputWaveformTimeCode",children:y?C:M})]})]})},li=u.memo(ti);export{li as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{v as i,$ as m,r as c,j as n,ap as p}from"./index.6xX1278W.js";import{P as f,R as d}from"./Particles.CElH0XX2.js";const g=""+new URL("../media/balloon-0.Czj7AKwE.png",import.meta.url).href,B=""+new URL("../media/balloon-1.CNvFFrND.png",import.meta.url).href,L=""+new URL("../media/balloon-2.DTvC6B1t.png",import.meta.url).href,h=""+new URL("../media/balloon-3.CgSk4tbL.png",import.meta.url).href,u=""+new URL("../media/balloon-4.mbtFrzxf.png",import.meta.url).href,x=""+new URL("../media/balloon-5.CSwkUfRA.png",import.meta.url).href,t=300,e=121,s=20,A=80,_=1e3,I=m("from{transform:translateY(calc(100vh + ",t,"px));}to{transform:translateY(0);}"),M=i("img",{target:"eosrfo90"})(({theme:o})=>({position:"fixed",top:`${-t}px`,marginLeft:`${-e/2}px`,zIndex:o.zIndices.balloons,left:`${Math.random()*(A-s)+s}vw`,animationDelay:`${Math.random()*_}ms`,height:`${t}px`,width:`${e}px`,pointerEvents:"none",animationDuration:"750ms",animationName:I,animationTimingFunction:"ease-in",animationDirection:"normal",animationIterationCount:1,opacity:1})),b=30,l=[g,B,L,h,u,x],w=l.length,E=({particleType:o,resourceCrossOriginMode:r})=>{const a=l[o];return n(M,{src:a,crossOrigin:p(r,a)})},N=({scriptRunId:o})=>n(d,{children:n(f,{className:"stBalloons","data-testid":"stBalloons",scriptRunId:o,numParticleTypes:w,numParticles:b,ParticleComponent:E})}),P=c.memo(N);export{b as NUM_BALLOONS,P as default};
|