streamlit-nightly 1.53.1.dev20260114__py3-none-any.whl → 1.53.1.dev20260115__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 +0 -26
- streamlit/config.py +29 -0
- streamlit/elements/lib/streamlit_plotly_theme.py +9 -11
- streamlit/proto/NewSession_pb2.py +18 -18
- streamlit/proto/NewSession_pb2.pyi +5 -1
- streamlit/runtime/app_session.py +78 -58
- streamlit/runtime/scriptrunner_utils/script_run_context.py +0 -21
- streamlit/runtime/state/query_params.py +0 -19
- streamlit/static/index.html +1 -1
- streamlit/static/manifest.json +299 -299
- streamlit/static/static/js/{ErrorOutline.esm.BAZUU4id.js → ErrorOutline.esm.CiSfK8ht.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.C6tTTniR.js → FileDownload.esm.ItNjcEfs.js} +1 -1
- streamlit/static/static/js/{FileHelper.BOHlwlc9.js → FileHelper.xS7f19FE.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.D4lty7rT.js → FormClearHelper.N8_BCinn.js} +1 -1
- streamlit/static/static/js/{InputInstructions.BWw9lhud.js → InputInstructions.CrsdK7CQ.js} +1 -1
- streamlit/static/static/js/Particles.BDlTHC3I.js +1 -0
- streamlit/static/static/js/{ProgressBar.DCHh4N3P.js → ProgressBar.Bk2qeHfS.js} +2 -2
- streamlit/static/static/js/{StreamlitSyntaxHighlighter.BRydQwEj.js → StreamlitSyntaxHighlighter.BcuPrPcw.js} +1 -1
- streamlit/static/static/js/{TableChart.esm.7KFX5I_G.js → TableChart.esm.CP7XPz8I.js} +1 -1
- streamlit/static/static/js/Toolbar.DCJcLwve.js +1 -0
- streamlit/static/static/js/{WidgetLabelHelpIconInline.CzodezAH.js → WidgetLabelHelpIconInline.BPqxu1b-.js} +1 -1
- streamlit/static/static/js/{base-input.Cg7NpsfS.js → base-input.x4muJJ13.js} +4 -4
- streamlit/static/static/js/{checkbox.Bs20OTna.js → checkbox.C5r4AIaH.js} +1 -1
- streamlit/static/static/js/{createDownloadLinkElement.DSqCyu38.js → createDownloadLinkElement.C83kkEeT.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.Ch4SqNfY.js → data-grid-overlay-editor.0sOWm4IB.js} +1 -1
- streamlit/static/static/js/{downloader.Oj5CTGJA.js → downloader.C_6FfoEv.js} +1 -1
- streamlit/static/static/js/{embed.CqzzUq73.js → embed.BnJ6-SK4.js} +14 -14
- streamlit/static/static/js/{es6.CYrlw0Vn.js → es6.44_BWfFd.js} +2 -2
- streamlit/static/static/js/{formatNumber.CT_v8e75.js → formatNumber.DhHZAosz.js} +1 -1
- streamlit/static/static/js/{iconPosition.DPAvXTmd.js → iconPosition.shOoQuRR.js} +1 -1
- streamlit/static/static/js/{iframeResizer.contentWindow.T4DvQsIf.js → iframeResizer.contentWindow.savEE5Vs.js} +1 -1
- streamlit/static/static/js/{index.BoWBzl6h.js → index.AdijUi9Z.js} +1 -1
- streamlit/static/static/js/{index.Dtd5z2rM.js → index.B5HlOnvq.js} +1 -1
- streamlit/static/static/js/{index.MtwRNvlS.js → index.B6ewTTej.js} +1 -1
- streamlit/static/static/js/{index.D7KbBAWb.js → index.B8Of3XXR.js} +1 -1
- streamlit/static/static/js/{index.xCV2qwtw.js → index.BCaCSVj6.js} +1 -1
- streamlit/static/static/js/index.BE7Rhig1.js +1 -0
- streamlit/static/static/js/{index.DL_Ooizi.js → index.BHpLZ7X6.js} +2 -2
- streamlit/static/static/js/{index.BPxuKK0S.js → index.BNvP8E5Q.js} +1 -1
- streamlit/static/static/js/{index.LOA31DFn.js → index.BNzuyXeN.js} +2 -2
- streamlit/static/static/js/{index.Cfe-tCQJ.js → index.BT7o4A9V.js} +1 -1
- streamlit/static/static/js/{index.BZ8xp-w9.js → index.BYY3iuVE.js} +1 -1
- streamlit/static/static/js/index.BZI7jTDf.js +1 -0
- streamlit/static/static/js/{index.CGRIbGGV.js → index.BZXk3Qxq.js} +1 -1
- streamlit/static/static/js/{index.CVXiBeDI.js → index.BhQvq6YD.js} +1 -1
- streamlit/static/static/js/{index.CnXxoVEM.js → index.BkIReLGJ.js} +3 -3
- streamlit/static/static/js/{index.AGYZDQZm.js → index.Bl7SMZUw.js} +1 -1
- streamlit/static/static/js/{index.b-MrPulo.js → index.BqtgAGnG.js} +2 -2
- streamlit/static/static/js/{index.B3HdcUdo.js → index.BwnLQnAk.js} +1 -1
- streamlit/static/static/js/index.C1coXTgf.js +2 -0
- streamlit/static/static/js/{index.DXRGd--0.js → index.C6uOmY9O.js} +1 -1
- streamlit/static/static/js/index.CF88nImM.js +1 -0
- streamlit/static/static/js/{index.B9Oowxt8.js → index.CFlGfFvq.js} +1 -1
- streamlit/static/static/js/{index.wngeYhKj.js → index.CQgiNpC7.js} +1 -1
- streamlit/static/static/js/{index.D84XHt50.js → index.CZJkiRFm.js} +1 -1
- streamlit/static/static/js/index.Ch1TdQMG.js +1 -0
- streamlit/static/static/js/{index.Yj6vcyFD.js → index.Ck2mQvBi.js} +1 -1
- streamlit/static/static/js/{index.DPlPEuq6.js → index.CrD2lwZG.js} +1 -1
- streamlit/static/static/js/index.CySNwKoN.js +2 -0
- streamlit/static/static/js/index.D3LEkXqN.js +1 -0
- streamlit/static/static/js/{index.BTA0d5oq.js → index.D8BQH06Z.js} +1 -1
- streamlit/static/static/js/{index.B8ZZdPqF.js → index.DBtWixG1.js} +1 -1
- streamlit/static/static/js/{index.CVKk1nkB.js → index.DIsNrJpC.js} +1 -1
- streamlit/static/static/js/{index.CPYB1awG.js → index.DO3HICut.js} +1 -1
- streamlit/static/static/js/{index.D6HCANv6.js → index.D_ziFad8.js} +1 -1
- streamlit/static/static/js/{index.BTqav7_K.js → index.Dblsdn8d.js} +1 -1
- streamlit/static/static/js/{index.Dg9k4R8B.js → index.DcdD0ROn.js} +2 -2
- streamlit/static/static/js/{index.tLZuZM89.js → index.DfHm3P22.js} +51 -51
- streamlit/static/static/js/{index.CXVpBAvU.js → index.DiwhD0Ic.js} +46 -46
- streamlit/static/static/js/index.DvZDNiBV.js +11 -0
- streamlit/static/static/js/{index.DQzRwgrT.js → index.HjydQ4bj.js} +1 -1
- streamlit/static/static/js/{index.XHtvnZ0-.js → index.HsxzYHNf.js} +1 -1
- streamlit/static/static/js/{index.DesNeXSA.js → index.SVJGpnpy.js} +1 -1
- streamlit/static/static/js/index.SjKkVSL7.js +1 -0
- streamlit/static/static/js/index.hX8_3tMP.js +1 -0
- streamlit/static/static/js/{index.BEzgNZOm.js → index.jZin0w6_.js} +1 -1
- streamlit/static/static/js/{index.DzldU3Hy.js → index.pQvPlPcA.js} +4 -4
- streamlit/static/static/js/index.pzQTLx9j.js +1 -0
- streamlit/static/static/js/{index.ClFk8x0U.js → index.s44_OVd6.js} +33 -33
- streamlit/static/static/js/{input.CYXuTqoa.js → input.jAD-v9D6.js} +2 -2
- streamlit/static/static/js/{main.BE-siVKv.js → main.Cas0fuOs.js} +1 -1
- streamlit/static/static/js/{memory.V554ztRg.js → memory.ENruL8Qk.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.BiUTOXIl.js → number-overlay-editor.DAOTdulh.js} +2 -2
- streamlit/static/static/js/{pandasStylerUtils.Dej3Tstq.js → pandasStylerUtils.DChYgcPq.js} +1 -1
- streamlit/static/static/js/{sandbox.gpd7KGMo.js → sandbox.DWZYRCm0.js} +1 -1
- streamlit/static/static/js/{styled-components.Coj4dr6D.js → styled-components.3lwVqgRW.js} +1 -1
- streamlit/static/static/js/{throttle.gZUdtYp7.js → throttle.DfOW1Cns.js} +1 -1
- streamlit/static/static/js/{timepicker.B-Y4aU15.js → timepicker.CXHgL5f9.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.CcKcKvEd.js → toConsumableArray.DiW0GSDV.js} +1 -1
- streamlit/static/static/js/uniqueId.Dfi3SGKZ.js +1 -0
- streamlit/static/static/js/{useBasicWidgetState.D-fc_aIL.js → useBasicWidgetState.DnPEt_f3.js} +1 -1
- streamlit/static/static/js/{useIntlLocale.CY32IeNt.js → useIntlLocale.BZEGSOVD.js} +8 -8
- streamlit/static/static/js/{useTextInputAutoExpand.C0jK7TwF.js → useTextInputAutoExpand.MGVZMqyt.js} +1 -1
- streamlit/static/static/js/useUpdateUiValue.CPl6CEx3.js +1 -0
- streamlit/static/static/js/{useWaveformController.BLEIAIDo.js → useWaveformController.DOpzDyZu.js} +1 -1
- streamlit/static/static/js/{withCalculatedWidth.B3oSlRC0.js → withCalculatedWidth.DgKFTeif.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.Cw_ebNmr.js → withFullScreenWrapper.K1jkwhPu.js} +1 -1
- {streamlit_nightly-1.53.1.dev20260114.dist-info → streamlit_nightly-1.53.1.dev20260115.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.53.1.dev20260114.dist-info → streamlit_nightly-1.53.1.dev20260115.dist-info}/RECORD +103 -104
- streamlit/commands/experimental_query_params.py +0 -169
- streamlit/static/static/js/Particles.BDi7fIn-.js +0 -1
- streamlit/static/static/js/Toolbar.guIuiwEF.js +0 -1
- streamlit/static/static/js/index.BJnWg9Jq.js +0 -1
- streamlit/static/static/js/index.Bqgt60FU.js +0 -1
- streamlit/static/static/js/index.BsYYrijt.js +0 -11
- streamlit/static/static/js/index.CJQq5LcR.js +0 -2
- streamlit/static/static/js/index.Cw4eSvJ7.js +0 -1
- streamlit/static/static/js/index.DNyw7S7Z.js +0 -1
- streamlit/static/static/js/index.DZDt5hYD.js +0 -1
- streamlit/static/static/js/index.Do9A7QCt.js +0 -1
- streamlit/static/static/js/index.DrSH3pK3.js +0 -2
- streamlit/static/static/js/index.GZi6GTJa.js +0 -1
- streamlit/static/static/js/index.hcUYvTqs.js +0 -1
- streamlit/static/static/js/uniqueId.PRn3V1WU.js +0 -1
- streamlit/static/static/js/useUpdateUiValue.CDQloDgB.js +0 -1
- {streamlit_nightly-1.53.1.dev20260114.data → streamlit_nightly-1.53.1.dev20260115.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.53.1.dev20260114.dist-info → streamlit_nightly-1.53.1.dev20260115.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.53.1.dev20260114.dist-info → streamlit_nightly-1.53.1.dev20260115.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.53.1.dev20260114.dist-info → streamlit_nightly-1.53.1.dev20260115.dist-info}/top_level.txt +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,E as S,_ as z,W as dt,F as m,aj as Re,cw as b,cu as Me,o as A,j as a,P as ue,az as V,aA as pe,a0 as K,b as ut,B as pt,Z as Te,bX as gt,l as ft,k as ht,b8 as mt,cx as wt,e as ie,bS as Ve,bT as vt,ab as Ct}from"./index.CXVpBAvU.js";import{u as ke,I as yt,g as Ae,F as G,E as ce,b as xt,s as bt,a as Fe}from"./FileHelper.BOHlwlc9.js";import{u as St}from"./useWaveformController.BLEIAIDo.js";import{I as zt}from"./InputInstructions.BWw9lhud.js";import{u as Et,T as It}from"./useTextInputAutoExpand.C0jK7TwF.js";import{i as Rt}from"./inputUtils.CptNuJwn.js";import{T as Vt}from"./TableChart.esm.7KFX5I_G.js";import{E as At}from"./ErrorOutline.esm.BAZUU4id.js";import{U as De}from"./UploadFileInfo.Dr-zDST7.js";import"./base-input.Cg7NpsfS.js";var Ue=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("rect",{width:24,height:24,fill:"none"}),r.createElement("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),r.createElement("path",{d:"M14 17H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"}))});Ue.displayName="Article";var He=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"}))});He.displayName="Code";var Le=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"}))});Le.displayName="Description";var Be=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M9.17 6l2 2H20v10H4V6h5.17M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"}))});Be.displayName="Folder";var Ne=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86l-3 3.87L9 13.14 6 17h12l-3.86-5.14z"}))});Ne.displayName="Image";var We=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M12 3l.01 10.55c-.59-.34-1.27-.55-2-.55a4.001 4.001 0 100 8c2.22 0 3.99-1.79 3.99-4V7h4V3h-6zm-1.99 16c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"}))});We.displayName="MusicNote";var Pe=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.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 3zm-1-9c0-.55.45-1 1-1s1 .45 1 1v6c0 .55-.45 1-1 1s-1-.45-1-1V5zm6 6c0 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"}))});Pe.displayName="MicNone";var Oe=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M15 8v8H5V8h10m1-2H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4V7c0-.55-.45-1-1-1z"}))});Oe.displayName="Videocam";var $e=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("rect",{width:24,height:24,fill:"none"}),r.createElement("path",{d:"M18 13h-5v5c0 .55-.45 1-1 1s-1-.45-1-1v-5H6c-.55 0-1-.45-1-1s.45-1 1-1h5V6c0-.55.45-1 1-1s1 .45 1 1v5h5c.55 0 1 .45 1 1s-.45 1-1 1z"}))});$e.displayName="Add";var Xe=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M13 19V7.83l4.88 4.88c.39.39 1.03.39 1.42 0a.996.996 0 000-1.41l-6.59-6.59a.996.996 0 00-1.41 0l-6.6 6.58a.996.996 0 101.41 1.41L11 7.83V19c0 .55.45 1 1 1s1-.45 1-1z"}))});Xe.displayName="ArrowUpward";var je=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm4.29 12.89a.996.996 0 11-1.41 1.41L12 13.41 9.11 16.3a.996.996 0 11-1.41-1.41L10.59 12 7.71 9.11A.996.996 0 119.12 7.7L12 10.59l2.89-2.89a.996.996 0 111.41 1.41L13.41 12l2.88 2.89z"}))});je.displayName="Cancel";var _e=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M18 6.7l-8.48 8.48-3.54-3.54a.996.996 0 10-1.41 1.41l4.24 4.24c.39.39 1.02.39 1.41 0l9.18-9.18a.999.999 0 00-.01-1.42c-.37-.38-1-.38-1.39.01z"}))});_e.displayName="Check";var Ke=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),r.createElement("path",{d:"M18.3 5.71a.996.996 0 00-1.41 0L12 10.59 7.11 5.7A.996.996 0 105.7 7.11L10.59 12 5.7 16.89a.996.996 0 101.41 1.41L12 13.41l4.89 4.89a.996.996 0 101.41-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z"}))});Ke.displayName="Close";var Ge=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(S,z({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("rect",{width:24,height:24,fill:"none"}),r.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 11c-.55 0-1-.45-1-1V8c0-.55.45-1 1-1s1 .45 1 1v4c0 .55-.45 1-1 1zm0 4c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z"}))});Ge.displayName="ErrorOutline";const _=dt.getLogger("ChatInput"),Ft=m("div",{target:"e5ztmp70"})({position:"relative",display:"flex",flexDirection:"column"}),Mt=m("div",{target:"e5ztmp71"})(({theme:e})=>({backgroundColor:e.colors.secondaryBg,border:`${e.sizes.borderWidth} solid`,borderColor:e.colors.widgetBorderColor??e.colors.transparent,position:"relative",display:"flex",flexDirection:"column",alignItems:"stretch",flex:1,paddingTop:e.spacing.md,paddingBottom:e.spacing.md,paddingLeft:e.spacing.lg,paddingRight:e.spacing.lg,gap:e.spacing.sm,borderRadius:e.radii.default,boxSizing:"border-box",":focus-within":{borderColor:e.colors.primary}})),Tt=m("div",{target:"e5ztmp72"})(({theme:e})=>({display:"flex",flexWrap:"wrap",gap:e.spacing.sm})),kt=m("div",{target:"e5ztmp73"})(({theme:e,isStacked:t})=>({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"100%",gap:e.spacing.sm,flexWrap:t?"wrap":"nowrap"})),Dt=m("div",{target:"e5ztmp74"})(({isStacked:e})=>({flex:e?"none":1,width:e?"100%":"auto",order:e?-1:0,display:"flex",alignItems:"center",minWidth:0})),Ut=m("div",{target:"e5ztmp75"})(({theme:e})=>({display:"flex",flexDirection:"row",flexShrink:0,gap:e.spacing.sm,alignItems:"center"})),Ht=m("div",{target:"e5ztmp76"})(({theme:e})=>({display:"flex",flexDirection:"row",gap:e.spacing.sm,alignItems:"center"})),Lt=m("div",{target:"e5ztmp77"})(({theme:e})=>({position:"absolute",top:e.spacing.twoXS,right:e.spacing.lg,color:e.colors.fadedText60,fontSize:e.fontSizes.twoSm,textAlign:"right",whiteSpace:"nowrap",pointerEvents:"auto",cursor:"text",zIndex:e.zIndices.priority,"& .stChatInputInstructions":{position:"static"}})),T=m("button",{target:"e5ztmp78"})(({theme:e,disabled:t,hasError:o,primary:p})=>{if(p)return{border:"none",backgroundColor:t?e.colors.darkenedBgMix15:e.colors.primary,borderRadius:e.radii.button,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:e.lineHeights.none,margin:e.spacing.none,padding:e.spacing.xs,width:e.sizes.chatInputPrimaryButtonSize,height:e.sizes.chatInputPrimaryButtonSize,color:t?e.colors.fadedText40:e.colors.white,cursor:t?"not-allowed":"pointer",transition:"background-color 200ms ease","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{boxShadow:Re(e)},"&:hover":{backgroundColor:t?e.colors.darkenedBgMix15:e.colors.primary}};const l=()=>o?e.colors.redTextColor:t?e.colors.fadedText40:e.colors.fadedText60;return{border:"none",backgroundColor:e.colors.transparent,borderRadius:e.radii.default,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:e.lineHeights.none,margin:e.spacing.none,padding:e.spacing.none,color:l(),pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{boxShadow:Re(e)},"&:hover":{color:o?e.colors.redColor:e.colors.bodyText},"&:active":{color:e.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:e.colors.transparent,borderColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed"},"& svg":{width:e.iconSizes.lg,height:e.iconSizes.lg}}}),Bt=m("div",{target:"e5ztmp79"})(({isRecording:e})=>({display:e?"flex":"none",flex:1,alignItems:"center",minWidth:0})),Nt=m("div",{target:"e5ztmp710"})(({theme:e})=>({position:"relative",width:"100%",height:e.sizes.chatInputPrimaryButtonSize,borderRadius:e.radii.default,overflow:"hidden","& > div":{position:"absolute",inset:0}})),Ye=(e,t)=>t===b.Directory?{...e,webkitdirectory:"",multiple:!0}:e,Wt=(e,t)=>{if(!t||t.length===0)return!0;const o=e.name.toLowerCase(),p=o.lastIndexOf(".");if(p===-1||p===o.length-1)return t.some(d=>d===""||d===".");const l=o.substring(p),w=o.substring(p+1);return t.some(d=>{const v=d.toLowerCase();return v.startsWith(".")?l===v:w===v})},Pt=(e,t)=>Wt(e,t)?{isValid:!0}:{isValid:!1,errorMessage:`${e.type||"This type of"} files are not allowed.`},de=e=>{switch(e){case b.None:return"a file";case b.Single:return"a file";case b.Multiple:return"files";case b.Directory:return"a directory";default:return Me(e),"a file"}},Ot=m("div",{target:"e1lsn30a0"})(({theme:e})=>({backgroundColor:e.colors.transparent,position:"absolute",inset:0,zIndex:e.zIndices.priority,borderRadius:e.radii.chatInput})),$t=m("div",{target:"e1lsn30a1"})(({theme:e})=>({position:"absolute",inset:0,border:`${e.sizes.borderWidth} solid`,borderColor:e.colors.primary,borderRadius:e.radii.chatInput,backgroundColor:e.colors.secondaryBg,color:e.colors.primary,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:e.fontWeights.bold,pointerEvents:"none",zIndex:e.zIndices.priority})),Xt=m("div",{target:"e1lsn30a2"})(({disabled:e})=>({pointerEvents:e?"none":"auto"})),jt=m("div",{target:"e1lsn30a3"})(({theme:e})=>({lineHeight:e.lineHeights.tight})),_t=m("div",{target:"e1lsn30a4"})(({theme:e})=>({display:"flex",flexWrap:"wrap",gap:e.spacing.sm})),Kt=m("div",{target:"e1lsn30a5"})({flex:"0 0 auto",maxWidth:"100%"}),Gt=m("div",{target:"e1lsn30a6"})(({theme:e,isError:t,isClickable:o})=>({position:"relative",display:"inline-flex",alignItems:"center",width:"fit-content",minWidth:"9rem",maxWidth:"100%",backgroundColor:t?e.colors.redBackgroundColor:e.colors.bgColor,padding:e.spacing.twoXS,paddingRight:e.spacing.twoXL,borderRadius:e.radii.default,gap:e.spacing.sm,cursor:o?"pointer":"default"})),Yt=m("div",{target:"e1lsn30a7"})({display:"flex",flexDirection:"column",minWidth:0}),qt=m("div",{target:"e1lsn30a8"})(({theme:e,fileStatus:t})=>({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:e.radii.default,width:e.sizes.chatInputFileIconSize,height:e.sizes.chatInputFileIconSize,flexShrink:0,overflow:"hidden",...t==="uploaded"&&{backgroundColor:e.colors.bodyText,color:e.colors.bgColor},...t==="uploading"&&{backgroundColor:e.colors.fadedText10,color:e.colors.fadedText60},...t==="error"&&{backgroundColor:e.colors.redBackgroundColor,color:e.colors.redTextColor}})),Zt=m("img",{target:"e1lsn30a9"})({width:"100%",height:"100%",objectFit:"cover"}),Jt=m("div",{target:"e1lsn30a10"})(({theme:e,fileStatus:t})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:t.type==="uploading"?e.colors.fadedText60:e.colors.bodyText})),Qt=m("div",{target:"e1lsn30a11"})(({theme:e})=>({color:e.colors.fadedText60,fontSize:e.fontSizes.sm})),er=m("small",{target:"e1lsn30a12"})(({theme:e,isError:t})=>({position:"absolute",top:e.spacing.twoXS,right:e.spacing.twoXS,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:0,"& button":{display:"flex",alignItems:"center",justifyContent:"center",width:"fit-content",height:"fit-content",minHeight:"unset",minWidth:"unset",maxHeight:"unset",maxWidth:"unset",borderRadius:"50%",backgroundColor:"transparent",color:t?e.colors.redTextColor:e.colors.fadedText60,padding:0,overflow:"hidden",boxSizing:"border-box",lineHeight:0,"&:hover":{backgroundColor:"transparent",color:t?e.colors.redColor:e.colors.bodyText}}})),tr=m("span",{target:"e1lsn30a13"})({position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}),rr=({onDrop:e,multiple:t,accept:o,maxSize:p,acceptFile:l,disabled:w})=>{const{getRootProps:d,getInputProps:v}=ke({onDrop:e,multiple:t,accept:o,maxSize:p,useFsAccessApi:!1}),C=Ye(v(),l),c=d({tabIndex:-1});return A(Xt,{"data-testid":"stChatInputFileUploadButton",disabled:w,...c,children:[a("input",{...C}),a(pe,{content:`Upload or drag and drop ${de(l)}`,placement:ue.TOP,onMouseEnterDelay:500,children:a(T,{type:"button",disabled:w,"aria-label":`Upload ${de(l)}`,children:a(V,{content:$e,size:"xl",color:"inherit"})})})]})},or=r.memo(rr),nr=({getRootProps:e,getInputProps:t,acceptFile:o})=>{const p=Ye(t(),o);return A(K,{children:[a(Ot,{...e(),children:a("input",{...p})}),a($t,{children:`Drag and drop ${de(o)} here`})]})},ar=r.memo(nr),qe=new Set(["jpg","jpeg","png","gif","webp","svg","bmp"]),ir=new Set(["pdf"]),sr=new Set(["csv","tsv","xlsx","xls"]),lr=new Set(["txt","md","json","xml","yaml","yml"]),cr=new Set(["py","js","ts","jsx","tsx","css","html","java","cpp","c","go","rs","rb","php","swift","kt","scala","sh","bash","sql"]),dr=new Set(["mp3","wav","m4a","ogg","flac","aac"]),ur=new Set(["mp4","webm","mov","avi","mkv","wmv"]),pr=new Set(["zip","tar","gz","rar","7z","bz2"]);function Ze(e){const t=e.lastIndexOf(".");return t===-1||t===e.length-1?"":e.slice(t+1).toLowerCase()}function gr(e){const t=Ze(e);return qe.has(t)?Ne:ir.has(t)?Ue:sr.has(t)?Vt:lr.has(t)?Le:cr.has(t)?He:dr.has(t)?We:ur.has(t)?Oe:pr.has(t)?Be:yt}function fr(e){const t=Ze(e);return qe.has(t)}const hr=20;function mr(e,t=hr){if(e.length<=t)return e;const o=e.lastIndexOf(".");if(!(o>0&&o<e.length-1)){const f=Math.floor((t-3)/2),g=f>0?e.slice(-f):"";return`${e.slice(0,f)}...${g}`}const l=e.slice(o),w=e.slice(0,o),d=t-l.length-3;if(d<=0){const f=Math.floor((t-3)/2),g=f>0?e.slice(-f):"";return`${e.slice(0,f)}...${g}`}const v=Math.ceil(d/2),C=Math.floor(d/2),c=C>0?w.slice(-C):"";return`${w.slice(0,v)}...${c}${l}`}function wr(e,t){const o=r.useMemo(()=>!e||!fr(t)?null:URL.createObjectURL(e),[e,t]);return r.useEffect(()=>()=>{o&&URL.revokeObjectURL(o)},[o]),o}const vr=({fileInfo:e,imagePreviewUrl:t})=>{const{type:o}=e.status;switch(o){case"uploading":return a(Te,{iconValue:"spinner",testid:"stChatInputFileIconSpinner",size:"lg"});case"error":return a(V,{content:At,size:"lg",testid:"stChatInputFileIconError"});case"uploaded":return t?a(Zt,{src:t,alt:e.name,"data-testid":"stChatInputFileImagePreview"}):a(V,{content:gr(e.name),size:"lg"});default:return Me(o),null}},Cr=({fileInfo:e,onDelete:t,onRetry:o})=>{const p=e.status.type,l=p==="error",w=p==="uploading",d=l&&o!==void 0&&e.file!==void 0,v=r.useId(),C=wr(e.file,e.name),c=e.status.type==="error"?e.status.errorMessage:"Upload failed",f=r.useCallback(()=>{d&&o(e)},[d,o,e]),g=r.useCallback(y=>{d&&(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),o(e))},[d,o,e]),h=r.useCallback(y=>{y.stopPropagation(),t(e.id)},[t,e.id]),k=w?`Cancel upload of ${e.name}`:`Remove ${e.name}`,Y=Ae(e.size,G.Byte),W=`${e.name}, ${Y}`,D=A(Gt,{className:"stChatInputFile","data-testid":"stChatInputFile",isError:l,isClickable:d,onClick:d?f:void 0,onKeyDown:d?g:void 0,title:d?"Click to retry upload":void 0,role:d?"button":void 0,tabIndex:d?0:void 0,"aria-label":W,"aria-invalid":l||void 0,"aria-describedby":l?v:void 0,children:[a(qt,{fileStatus:p,children:a(vr,{fileInfo:e,imagePreviewUrl:C})}),A(Yt,{children:[a(Jt,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:e.name,fileStatus:e.status,children:mr(e.name)}),a(Qt,{children:Ae(e.size,G.Byte)})]}),a(er,{"data-testid":"stChatInputDeleteBtn",isError:l,children:a(ut,{onClick:h,kind:pt.MINIMAL,"aria-label":k,children:a(V,{content:je,size:"md"})})}),l&&A(tr,{id:v,role:"alert",children:["Error: ",c]})]});return l?a(pe,{content:c,placement:ue.TOP,error:!0,children:D}):D},yr=r.memo(Cr),xr=({items:e,onDelete:t,onRetry:o})=>a(jt,{"data-testid":"stChatUploadedFiles",children:a(_t,{children:e.map(p=>a(Kt,{children:a(yr,{fileInfo:p,onDelete:t,onRetry:o})},p.id))})}),br=r.memo(xr),Sr=(e,t,o)=>{const p=[],l=[];return e.forEach(w=>{if(w.size>o){l.push({file:w,errors:[{code:ce.FileTooLarge,message:`File is too large. Maximum size is ${o} bytes.`}]});return}const d=Pt(w,t.fileType);if(!d.isValid){l.push({file:w,errors:[{code:ce.FileInvalidType,message:d.errorMessage||"File type not allowed."}]});return}p.push(w)}),{accepted:p,rejected:l}},zr=({acceptMultipleFiles:e,maxFileSize:t,uploadClient:o,uploadFile:p,addFiles:l,getNextLocalFileId:w,deleteExistingFiles:d,onUploadComplete:v,element:C})=>(c,f)=>{if(c.length>0){const{accepted:g,rejected:h}=Sr(c,C,t);c=g,f=[...f,...h]}if(!e&&c.length===0&&f.length>1){const g=f.findIndex(h=>h.errors?.[0].code===ce.TooManyFiles);g>=0&&(c.push(f[g].file),f.splice(g,1))}if(!e&&c.length>0&&d(),o.fetchFileURLs(c).then(g=>{gt(g,c).forEach(([h,k])=>{p(h,k)})}).catch(g=>{l(c.map(h=>new De(h.name,h.size,w(),{type:"error",errorMessage:g},h)))}),f.length>0){const g=f.map(h=>xt(h,w(),t));l(g)}v()},Er=({getNextLocalFileId:e,addFiles:t,updateFile:o,uploadClient:p,element:l,onUploadProgress:w,onUploadComplete:d})=>(v,C)=>{const c=C.webkitRelativePath||C.name,f=new AbortController,g=new De(c,C.size,e(),{type:"uploading",abortController:f,progress:1},C);t([g]),p.uploadFile({formId:"",...l},v.uploadUrl,C,h=>w(h,g.id),f.signal).then(()=>d(g.id,v)).catch(h=>{h instanceof DOMException&&h.name==="AbortError"||o(g.id,g.setStatus({type:"error",errorMessage:h?h.toString():"Unknown error"}))})};function Ir(e,t,o){return{Root:{style:{minHeight:e.sizes.chatInputTextareaMinHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0",borderTopLeftRadius:"0",borderTopRightRadius:"0",borderBottomRightRadius:"0",borderBottomLeftRadius:"0",...o}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{fontWeight:e.fontWeights.normal,lineHeight:e.lineHeights.inputWidget,"::placeholder":{color:e.colors.fadedText60},height:t.isExtended?t.height:"auto",maxHeight:t.maxHeight,overflowY:"auto",paddingLeft:e.spacing.none,paddingRight:e.spacing.none,paddingBottom:e.spacing.twoXS,paddingTop:e.spacing.twoXS,width:"100%"}}}}const se=(e,t,o)=>o.map(p=>p.id===e?t:p),le=(e,t)=>t.find(o=>o.id===e);function Rr({disabled:e,element:t,widgetMgr:o,fragmentId:p,uploadClient:l}){const w=ft(),{placeholder:d,maxChars:v}=t,C=r.useRef(0),c=r.useRef(null),f=r.useRef(!1),g=r.useRef(null),h=r.useRef(null),{width:k,elementRef:Y}=ht(),{innerWidth:W,innerHeight:D}=mt(),[y,q]=r.useState(t.default),[I,F]=r.useState([]),[U,Z]=r.useState(!1),[H,ge]=r.useState(!1),[J,L]=r.useState(null),[M,Q]=r.useState(!1),[Je,fe]=r.useState(0),ee=t.acceptAudio??!1;r.useEffect(()=>()=>{h.current&&h.current.abort()},[]);const P=Et({textareaRef:c,dependencies:[d,M]}),O=r.useRef(""),$=r.useRef(0),te=r.useRef(null),he=r.useRef(null),B=r.useCallback(n=>{const i=getComputedStyle(n);O.current=`${i.fontWeight} ${i.fontSize} ${i.fontFamily}`;const u=parseFloat(i.paddingLeft)||0,s=parseFloat(i.paddingRight)||0;$.current=n.clientWidth-u-s},[]);r.useLayoutEffect(()=>{const n=c.current;if(!n)return;B(n);const i=new ResizeObserver(()=>B(n));return i.observe(n),()=>i.disconnect()},[B,M]),r.useEffect(()=>{if(y===""){Q(!1);return}if(M)return;const n=c.current;if(!n||(($.current<=0||!O.current)&&B(n),$.current<=0||!O.current))return;te.current||(te.current=document.createElement("canvas"),he.current=te.current.getContext("2d"));const i=he.current;i&&(i.font=O.current,i.measureText(y).width>$.current-10&&Q(!0))},[y,M,B]);const X=r.useMemo(()=>I.some(n=>n.status.type==="uploading")?!1:y!==""||I.length>0,[I,y]),E=wt(t.acceptFile),re=bt(t.maxUploadSizeMb,G.Megabyte,G.Byte),me=r.useCallback(n=>F(i=>[...i,...n]),[]),we=r.useCallback(n=>{n.status.type==="uploading"&&n.status.abortController.abort(),n.status.type==="uploaded"&&n.status.fileUrls.deleteUrl&&l.deleteFile(n.status.fileUrls.deleteUrl).catch(i=>{_.error("Failed to delete file from server:",i)})},[l]),ve=r.useCallback(n=>{F(i=>{const u=le(n,i);if(ie(u))return i;we(u);const s=i.filter(x=>x.id!==n);return s.length===0&&fe(x=>x+1),s})},[we]),oe=r.useRef(null),Qe=r.useCallback(n=>{!n.file||n.status.type!=="error"||(F(i=>i.filter(u=>u.id!==n.id)),oe.current&&oe.current([n.file],[]))},[]),Ce=r.useCallback(()=>{const n=I.filter(i=>i.status.type==="uploaded").map(i=>{const{name:u,size:s,status:x}=i,{fileId:ae,fileUrls:ct}=x;return new Ve({fileId:ae,fileUrls:ct,name:u,size:s})});return new vt({uploadedFileInfo:n})},[I]),ye=()=>C.current++,ne=zr({acceptMultipleFiles:E===b.Multiple||E===b.Directory,maxFileSize:re,uploadClient:l,uploadFile:Er({getNextLocalFileId:ye,addFiles:me,updateFile:(n,i)=>{F(u=>se(n,i,u))},uploadClient:l,element:t,onUploadProgress:(n,i)=>{F(u=>{const s=le(i,u);if(ie(s)||s.status.type!=="uploading")return u;const x=Math.round(n.loaded*100/n.total);return s.status.progress===x?u:se(i,s.setStatus({type:"uploading",abortController:s.status.abortController,progress:x}),u)})},onUploadComplete:(n,i)=>{F(u=>{const s=le(n,u);return ie(s)||s.status.type!=="uploading"?u:se(s.id,s.setStatus({type:"uploaded",fileId:i.fileId,fileUrls:i}),u)})}}),addFiles:me,getNextLocalFileId:ye,deleteExistingFiles:()=>I.forEach(n=>ve(n.id)),onUploadComplete:()=>{c.current&&c.current.focus()},element:t});oe.current=ne;const{getRootProps:et,getInputProps:tt}=ke({onDrop:ne,multiple:E===b.Multiple||E===b.Directory,accept:Fe(t.fileType),maxSize:re,useFsAccessApi:!1}),j=r.useCallback(n=>{if(c.current&&c.current.focus(),!X&&!n||e)return;const i=Ce(),u={data:y,fileUploaderState:i,audioFileInfo:n};o.setChatInputValue(t,u,{fromUi:!0},p),I.length>0&&fe(s=>s+1),F([]),q(""),Q(!1),P.clearScrollHeight()},[X,e,y,I.length,Ce,o,t,p,P]),xe=r.useCallback(async n=>{const i=new Date().toISOString().replace(/[:.]/g,"-"),u=new File([n],`audio-${i}.wav`,{type:"audio/wav"});try{ge(!0);const s=await l.fetchFileURLs([u]);if(s.length===0)throw new Error("Failed to get upload URL for audio file");const x=s[0];h.current=new AbortController,await l.uploadFile({formId:"",...t},x.uploadUrl,u,()=>{},h.current.signal);const ae=new Ve({fileId:x.fileId,fileUrls:x,name:u.name,size:u.size});j(ae)}catch(s){const x="Recording failed";_.error("Audio upload failed:",s),L(x),c.current&&c.current.focus()}finally{ge(!1)}},[l,t,j]),rt=r.useMemo(()=>({onApprove:xe,onPermissionDenied:()=>{const n="Microphone access denied";L(n),_.error("Permission denied:",n)},onError:n=>{L("Recording failed"),_.error("Recording error:",n)},onRecordStart:()=>{L(null)}}),[xe]),R=St({containerRef:g,sampleRate:t.audioSampleRate??void 0,events:rt}),be=r.useCallback(()=>{j()},[j]),ot=n=>{const{metaKey:i,ctrlKey:u,shiftKey:s}=n;Rt(n)&&!s&&!u&&!i&&(n.preventDefault(),be())},nt=n=>{const{value:i}=n.target;v!==0&&i.length>v||(q(i),P.updateScrollHeight(),J&&L(null))},Se=r.useCallback(async n=>{n.preventDefault(),n.stopPropagation(),!(!ee||e||R.state==="recording")&&await R.start()},[ee,e,R]),at=r.useCallback(()=>{R.cancel(),c.current&&c.current.focus()},[R]),ze=r.useCallback(async()=>{const{blob:n}=await R.stop();await R.approve(n)},[R]),Ee=r.useCallback(n=>{Se(n)},[Se]),it=r.useCallback(()=>{ze()},[ze]),st=r.useCallback(()=>{c.current&&c.current.focus()},[]);r.useEffect(()=>{if(t.setValue&&!f.current){f.current=!0;const n=t.value||"";q(n)}},[t.setValue,t.value]),r.useEffect(()=>{f.current=!1},[t]),r.useEffect(()=>{const n=s=>{s.preventDefault(),s.stopPropagation(),!U&&s.dataTransfer?.types.includes("Files")&&Z(!0)},i=s=>{s.preventDefault(),s.stopPropagation(),U&&(s.clientX<=0&&s.clientY<=0||s.clientX>=W&&s.clientY>=D)&&Z(!1)},u=s=>{s.preventDefault(),s.stopPropagation(),U&&Z(!1)};return window.addEventListener("dragover",n),window.addEventListener("drop",u),window.addEventListener("dragleave",i),()=>{window.removeEventListener("dragover",n),window.removeEventListener("drop",u),window.removeEventListener("dragleave",i)}},[U,W,D]);const lt=E!==b.None&&U,N=R.state==="recording",Ie=!N&&k>Ct(w.breakpoints.hideWidgetDetails)&&v>0;return a(Ft,{className:"stChatInput","data-testid":"stChatInput",ref:Y,children:A(Mt,{children:[Ie&&a(Lt,{onClick:st,id:"stChatInputInstructions",children:a(zt,{dirty:X,value:y,maxLength:v,type:"chat",inForm:!1,className:"stChatInputInstructions"})}),lt&&a(ar,{getRootProps:et,getInputProps:tt,acceptFile:E}),E!==b.None&&I.length>0&&a(Tt,{children:a(br,{items:[...I],onDelete:ve,onRetry:Qe})}),A(kt,{isStacked:M,children:[a(Ut,{children:E!==b.None&&!N&&a(or,{onDrop:ne,multiple:E===b.Multiple||E===b.Directory,accept:Fe(t.fileType),maxSize:re,acceptFile:E,disabled:e},Je)}),a(Bt,{isRecording:N,children:a(Nt,{ref:g})}),!N&&a(Dt,{isStacked:M,children:a(It,{inputRef:c,value:y,placeholder:d,onChange:nt,onKeyDown:ot,"aria-label":d,disabled:e,rows:1,"aria-describedby":Ie?"stChatInputInstructions":void 0,overrides:Ir(w,P,{width:"100%"})})}),a(Ht,{children:N?A(K,{children:[a(T,{onClick:at,disabled:e,"data-testid":"stChatInputCancelButton","aria-label":"Cancel recording",children:a(V,{content:Ke,size:"lg",color:"inherit"})}),a(T,{onClick:it,disabled:e||H,"data-testid":"stChatInputApproveButton","aria-label":"Submit recording",children:H?a(Te,{size:"lg",iconValue:"spinner"}):a(V,{content:_e,size:"lg",color:"inherit"})})]}):A(K,{children:[ee&&a(K,{children:J?a(pe,{content:J,placement:ue.TOP,error:!0,children:a(T,{onClick:Ee,disabled:e||H,hasError:!0,"data-testid":"stChatInputMicButton","aria-label":"Start recording",children:a(V,{content:Ge,size:"xl",color:"inherit"})})}):a(T,{onClick:Ee,disabled:e||H,"data-testid":"stChatInputMicButton","aria-label":"Start recording",children:a(V,{content:Pe,size:"xl",color:"inherit"})})}),a(T,{onClick:be,disabled:!X||e||H,"data-testid":"stChatInputSubmitButton","aria-label":"Send message",primary:!0,children:a(V,{content:Xe,size:"lg",color:"inherit"})})]})})]})]})})}const Br=r.memo(Rr);export{Br as default};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{W as Q,e as Z,bw as me,bx as ge,F as he,r as d,l as ye,by as V,al as _,j as A,aO as pe,bz as H,bA as Ee,a1 as be,a2 as Fe,o as Ce,a0 as we,aN as Se,n as Ne,S as Oe}from"./index.CXVpBAvU.js";import{bB as nr}from"./index.CXVpBAvU.js";import{w as Ae}from"./withCalculatedWidth.B3oSlRC0.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 ke=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})({}),Ve=(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:Ve.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=ke.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
|
-
The app is attempting to load the component from **${r}**,
|
|
3
|
-
and hasn't received its \`Streamlit.setComponentReady()\` message.
|
|
4
|
-
|
|
5
|
-
If this is a development build, have you started the dev server?
|
|
6
|
-
|
|
7
|
-
For more troubleshooting help, please see the [Streamlit Component docs](${W}) or visit our [forums](${Y}).`:t=`Your app is having trouble loading the **${e}** component.
|
|
8
|
-
|
|
9
|
-
If this is an installed component that works locally, the app may be having trouble accessing the component frontend assets due to network latency or proxy settings in your app deployment.
|
|
10
|
-
|
|
11
|
-
For more troubleshooting help, please see the [Streamlit Component docs](${W}) or visit our [forums](${Y}).`,t}function ze(e,r,t,n){if(!n)try{return Ye(e,r)}catch(a){const s=Se(a);t(s)}return[{},[]]}function Ke(e,r){return e===r||e.length===r.length&&e.every((t,n)=>{const a=r[n];return t.key===a.key&&t.value===a.value})}function Je(e){const r=ye(),[t,n]=d.useState(),{disabled:a,element:s,widgetMgr:o,width:i,fragmentId:l,componentRegistry:f}=e,{componentName:u,jsonArgs:y,specialArgs:ce,url:N}=s,[I,M]=ze(y,ce,n,t),C=d.useMemo(()=>qe(u,f,N),[u,f,N]),m=d.useRef({args:{},dataframeArgs:[]}),L=Ke(m.current.dataframeArgs,M);m.current.args=I,m.current.dataframeArgs=M;const[w,j]=d.useState(),[p,fe]=d.useState(()=>isNaN(I.height)?void 0:I.height),g=d.useRef(!1),E=d.useRef(null),D=d.useRef(),{clear:P}=V(()=>R.warn(X(u,N)),J/4),{clear:k}=V(()=>{_.flushSync(()=>{j(!0)})},J);if(d.useEffect(()=>{f.checkSourceUrlResponse(C,u)},[C,u,f]),d.useEffect(()=>{w&&!g.current&&(R.error(`Client Error: Custom Component ${u} timeout error`),f.sendTimeoutError(C,u))},[w,C,u,f]),d.useEffect(()=>{g.current&&z(m.current.args,m.current.dataframeArgs,a,r,E.current??void 0)},[a,p,L,y,r,i]),d.useEffect(()=>{const b=O=>{if(O===void 0){R.warn("handleSetFrameHeight: missing 'height' prop");return}if(O!==p){if(Z(E.current)){R.warn("handleSetFrameHeight: missing our iframeRef!");return}E.current.height=O.toString(),_.flushSync(()=>{fe(O)})}},le=()=>{z(m.current.args,m.current.dataframeArgs,a,r,E.current??void 0),P(),k(),g.current=!0,_.flushSync(()=>{j(!1)})};D.current={isReady:()=>g.current,element:s,widgetMgr:o,setComponentError:n,componentReadyCallback:le,frameHeightCallback:b,fragmentId:l}},[u,a,s,p,L,w,y,r,o,k,P,l]),d.useEffect(()=>{const b=E.current?.contentWindow??void 0;if(b)return f.registerListener(b,We(D)),()=>{b&&f.deregisterListener(b)}},[f,u]),t)return A(pe,{name:t.name,message:t.message});const ue=!g.current&&!w&&p!==0&&A(Ee,{element:H.create({height:p,style:H.SkeletonStyle.ELEMENT})}),de=!g.current&&w?A(Fe,{body:X(u,N),kind:be.WARNING}):null;return Ce(we,{children:[ue,de,A(Be,{className:"stCustomComponentV1","data-testid":"stCustomComponentV1",allow:Ie,ref:E,src:C,width:i,height:p??0,scrolling:"no",sandbox:Re,title:u,componentReady:g.current,tabIndex:s.tabIndex??void 0})]})}const er=Ae(d.memo(Je));export{er as ComponentInstance,nr as ComponentRegistry};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{an as Ze,ao as Q,r as _,bU as vt,ap as mt,x as J,bq as bt,br as yt,F as oe,aj as Ne,l as Tt,bV as kt,j as Z,q as Ie,o as xe,p as Ot,ac as wt,ad as Rt,bW as de}from"./index.CXVpBAvU.js";import{h as St}from"./moment.C7qA8nIE.js";import{w as Mt}from"./withCalculatedWidth.B3oSlRC0.js";import{u as $t}from"./useBasicWidgetState.D-fc_aIL.js";import{f as _t}from"./formatMoment.C6Hwn6X5.js";import{f as Et}from"./formatNumber.CT_v8e75.js";import"./FormClearHelper.D4lty7rT.js";import"./numbro.B9_PXfzp.js";import"./sprintf.DpPCfzXw.js";var ue={},H={},ce={},le={},Ue;function De(){if(Ue)return le;Ue=1,Object.defineProperty(le,"__esModule",{value:!0}),le.Direction=void 0;var e;return(function(r){r.Right="to right",r.Left="to left",r.Down="to bottom",r.Up="to top"})(e||(le.Direction=e={})),le}var He;function Ge(){return He||(He=1,(function(e){var r=ce&&ce.__spreadArray||function(i,o,u){if(u||arguments.length===2)for(var g=0,m=o.length,p;g<m;g++)(p||!(g in o))&&(p||(p=Array.prototype.slice.call(o,0,g)),p[g]=o[g]);return i.concat(p||Array.prototype.slice.call(o))};Object.defineProperty(e,"__esModule",{value:!0}),e.isIOS=e.useThumbOverlap=e.assertUnreachable=e.voidFn=e.getTrackBackground=e.replaceAt=e.schd=e.translate=e.getClosestThumbIndex=e.translateThumbs=e.getPaddingAndBorder=e.getMargin=e.checkInitialOverlap=e.checkValuesAgainstBoundaries=e.checkBoundaries=e.isVertical=e.relativeValue=e.normalizeValue=e.isStepDivisible=e.isTouchEvent=e.getStepDecimals=void 0;var n=Ze(),s=De(),v=function(i){var o=i.toString().split(".")[1];return o?o.length:0};e.getStepDecimals=v;function S(i){return i.touches&&i.touches.length||i.changedTouches&&i.changedTouches.length}e.isTouchEvent=S;function l(i,o,u){var g=(o-i)/u,m=8,p=Number(g.toFixed(m));return parseInt(p.toString(),10)===p}e.isStepDivisible=l;function h(i,o,u,g,m,p,b){var $=1e11;if(i=Math.round(i*$)/$,!p){var D=b[o-1],E=b[o+1];if(D&&D>i)return D;if(E&&E<i)return E}if(i>g)return g;if(i<u)return u;var U=Math.floor(i*$-u*$)%Math.floor(m*$),z=Math.floor(i*$-Math.abs(U)),W=U===0?i:z/$,L=Math.abs(U/$)<m/2?W:W+m,A=(0,e.getStepDecimals)(m);return parseFloat(L.toFixed(A))}e.normalizeValue=h;function F(i,o,u){return(i-o)/(u-o)}e.relativeValue=F;function j(i){return i===s.Direction.Up||i===s.Direction.Down}e.isVertical=j;function V(i,o,u){if(o>=u)throw new RangeError("min (".concat(o,") is equal/bigger than max (").concat(u,")"));if(i<o)throw new RangeError("value (".concat(i,") is smaller than min (").concat(o,")"));if(i>u)throw new RangeError("value (".concat(i,") is bigger than max (").concat(u,")"))}e.checkBoundaries=V;function I(i,o,u){return i<o?o:i>u?u:i}e.checkValuesAgainstBoundaries=I;function T(i){if(!(i.length<2)&&!i.slice(1).every(function(o,u){return i[u]<=o}))throw new RangeError("values={[".concat(i,"]} needs to be sorted when allowOverlap={false}"))}e.checkInitialOverlap=T;function d(i){var o=window.getComputedStyle(i);return{top:parseInt(o["margin-top"],10),bottom:parseInt(o["margin-bottom"],10),left:parseInt(o["margin-left"],10),right:parseInt(o["margin-right"],10)}}e.getMargin=d;function t(i){var o=window.getComputedStyle(i);return{top:parseInt(o["padding-top"],10)+parseInt(o["border-top-width"],10),bottom:parseInt(o["padding-bottom"],10)+parseInt(o["border-bottom-width"],10),left:parseInt(o["padding-left"],10)+parseInt(o["border-left-width"],10),right:parseInt(o["padding-right"],10)+parseInt(o["border-right-width"],10)}}e.getPaddingAndBorder=t;function a(i,o,u){var g=u?-1:1;i.forEach(function(m,p){return f(m,g*o[p].x,o[p].y)})}e.translateThumbs=a;function c(i,o,u,g){for(var m=0,p=B(i[0],o,u,g),b=1;b<i.length;b++){var $=B(i[b],o,u,g);$<p&&(p=$,m=b)}return m}e.getClosestThumbIndex=c;function f(i,o,u){i.style.transform="translate(".concat(o,"px, ").concat(u,"px)")}e.translate=f;var y=function(i){var o=[],u=null,g=function(){for(var m=[],p=0;p<arguments.length;p++)m[p]=arguments[p];o=m,!u&&(u=requestAnimationFrame(function(){u=null,i.apply(void 0,o)}))};return g};e.schd=y;function k(i,o,u){var g=i.slice(0);return g[o]=u,g}e.replaceAt=k;function x(i){var o=i.values,u=i.colors,g=i.min,m=i.max,p=i.direction,b=p===void 0?s.Direction.Right:p,$=i.rtl,D=$===void 0?!1:$;D&&b===s.Direction.Right?b=s.Direction.Left:D&&s.Direction.Left&&(b=s.Direction.Right);var E=o.slice(0).sort(function(z,W){return z-W}).map(function(z){return(z-g)/(m-g)*100}),U=E.reduce(function(z,W,L){return"".concat(z,", ").concat(u[L]," ").concat(W,"%, ").concat(u[L+1]," ").concat(W,"%")},"");return"linear-gradient(".concat(b,", ").concat(u[0]," 0%").concat(U,", ").concat(u[u.length-1]," 100%)")}e.getTrackBackground=x;function O(){}e.voidFn=O;function w(i){throw new Error("Didn't expect to get here")}e.assertUnreachable=w;var M=function(i,o,u,g,m){m===void 0&&(m=function(b){return b});var p=Math.ceil(r([i],Array.from(i.children),!0).reduce(function(b,$){var D=Math.ceil($.getBoundingClientRect().width);if($.innerText&&$.innerText.includes(u)&&$.childElementCount===0){var E=$.cloneNode(!0);E.innerHTML=m(o.toFixed(g)),E.style.visibility="hidden",document.body.appendChild(E),D=Math.ceil(E.getBoundingClientRect().width),document.body.removeChild(E)}return D>b?D:b},i.getBoundingClientRect().width));return p},P=function(i,o,u,g,m,p,b){b===void 0&&(b=function(E){return E});var $=[],D=function(E){var U=M(u[E],g[E],m,p,b),z=o[E].x;o.forEach(function(W,L){var A=W.x,G=M(u[L],g[L],m,p,b);E!==L&&(z>=A&&z<=A+G||z+U>=A&&z+U<=A+G)&&($.includes(L)||($.push(E),$.push(L),$=r(r([],$,!0),[E,L],!1),D(L)))})};return D(i),Array.from(new Set($.sort()))},R=function(i,o,u,g,m,p){g===void 0&&(g=.1),m===void 0&&(m=" - "),p===void 0&&(p=function(L){return L});var b=(0,e.getStepDecimals)(g),$=(0,n.useState)({}),D=$[0],E=$[1],U=(0,n.useState)(p(o[u].toFixed(b))),z=U[0],W=U[1];return(0,n.useEffect)(function(){if(i){var L=i.getThumbs();if(L.length<1)return;var A={},G=i.getOffsets(),ne=P(u,G,L,o,m,b,p),he=p(o[u].toFixed(b));if(ne.length){var ee=ne.reduce(function(te,se,me,be){return te.length?r(r([],te,!0),[G[be[me]].x],!1):[G[be[me]].x]},[]);if(Math.min.apply(Math,ee)===G[u].x){var ge=[];ne.forEach(function(te){ge.push(o[te].toFixed(b))}),he=Array.from(new Set(ge.sort(function(te,se){return parseFloat(te)-parseFloat(se)}))).map(p).join(m);var pe=Math.min.apply(Math,ee),ve=Math.max.apply(Math,ee),Ee=L[ne[ee.indexOf(ve)]].getBoundingClientRect().width;A.left="".concat(Math.abs(pe-(ve+Ee))/2,"px"),A.transform="translate(-50%, 0)"}else A.visibility="hidden"}W(he),E(A)}},[i,o]),[z,D]};e.useThumbOverlap=R;function B(i,o,u,g){var m=i.getBoundingClientRect(),p=m.left,b=m.top,$=m.width,D=m.height;return j(g)?Math.abs(u-(b+D/2)):Math.abs(o-(p+$/2))}var C=function(){var i,o=((i=navigator.userAgentData)===null||i===void 0?void 0:i.platform)||navigator.platform;return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(o)||navigator.userAgent.includes("Mac")&&"ontouchend"in document};e.isIOS=C})(ce)),ce}var We;function It(){if(We)return H;We=1;var e=H&&H.__extends||(function(){var I=function(T,d){return I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,a){t.__proto__=a}||function(t,a){for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(t[c]=a[c])},I(T,d)};return function(T,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");I(T,d);function t(){this.constructor=T}T.prototype=d===null?Object.create(d):(t.prototype=d.prototype,new t)}})(),r=H&&H.__createBinding||(Object.create?(function(I,T,d,t){t===void 0&&(t=d);var a=Object.getOwnPropertyDescriptor(T,d);(!a||("get"in a?!T.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return T[d]}}),Object.defineProperty(I,t,a)}):(function(I,T,d,t){t===void 0&&(t=d),I[t]=T[d]})),n=H&&H.__setModuleDefault||(Object.create?(function(I,T){Object.defineProperty(I,"default",{enumerable:!0,value:T})}):function(I,T){I.default=T}),s=H&&H.__importStar||function(I){if(I&&I.__esModule)return I;var T={};if(I!=null)for(var d in I)d!=="default"&&Object.prototype.hasOwnProperty.call(I,d)&&r(T,I,d);return n(T,I),T},v=H&&H.__spreadArray||function(I,T,d){if(d||arguments.length===2)for(var t=0,a=T.length,c;t<a;t++)(c||!(t in T))&&(c||(c=Array.prototype.slice.call(T,0,t)),c[t]=T[t]);return I.concat(c||Array.prototype.slice.call(T))};Object.defineProperty(H,"__esModule",{value:!0});var S=s(Ze()),l=Ge(),h=De(),F=["ArrowRight","ArrowUp","k","PageUp"],j=["ArrowLeft","ArrowDown","j","PageDown"],V=(function(I){e(T,I);function T(d){var t=I.call(this,d)||this;if(t.trackRef=S.createRef(),t.thumbRefs=[],t.state={draggedTrackPos:[-1,-1],draggedThumbIndex:-1,thumbZIndexes:new Array(t.props.values.length).fill(0).map(function(a,c){return c}),isChanged:!1,markOffsets:[]},t.getOffsets=function(){var a=t.props,c=a.direction,f=a.values,y=a.min,k=a.max,x=t.trackRef.current;if(!x)return console.warn("No track element found."),[];var O=x.getBoundingClientRect(),w=(0,l.getPaddingAndBorder)(x);return t.getThumbs().map(function(M,P){var R={x:0,y:0},B=M.getBoundingClientRect(),C=(0,l.getMargin)(M);switch(c){case h.Direction.Right:return R.x=(C.left+w.left)*-1,R.y=((B.height-O.height)/2+w.top)*-1,R.x+=O.width*(0,l.relativeValue)(f[P],y,k)-B.width/2,R;case h.Direction.Left:return R.x=(C.right+w.right)*-1,R.y=((B.height-O.height)/2+w.top)*-1,R.x+=O.width-O.width*(0,l.relativeValue)(f[P],y,k)-B.width/2,R;case h.Direction.Up:return R.x=((B.width-O.width)/2+C.left+w.left)*-1,R.y=-w.left,R.y+=O.height-O.height*(0,l.relativeValue)(f[P],y,k)-B.height/2,R;case h.Direction.Down:return R.x=((B.width-O.width)/2+C.left+w.left)*-1,R.y=-w.left,R.y+=O.height*(0,l.relativeValue)(f[P],y,k)-B.height/2,R;default:return(0,l.assertUnreachable)(c)}})},t.getThumbs=function(){return t.trackRef&&t.trackRef.current?Array.from(t.trackRef.current.children).filter(function(a){return a.hasAttribute("aria-valuenow")}):(console.warn("No thumbs found in the track container. Did you forget to pass & spread the `props` param in renderTrack?"),[])},t.getTargetIndex=function(a){return t.getThumbs().findIndex(function(c){return c===a.target||c.contains(a.target)})},t.addTouchEvents=function(a){document.addEventListener("touchmove",t.schdOnTouchMove,{passive:!1}),document.addEventListener("touchend",t.schdOnEnd,{passive:!1}),document.addEventListener("touchcancel",t.schdOnEnd,{passive:!1})},t.addMouseEvents=function(a){document.addEventListener("mousemove",t.schdOnMouseMove),document.addEventListener("mouseup",t.schdOnEnd)},t.onMouseDownTrack=function(a){var c;if(!(a.button!==0||(0,l.isIOS)()))if(a.persist(),a.preventDefault(),t.addMouseEvents(a.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(y){var k;return(k=y.current)===null||k===void 0?void 0:k.contains(a.target)}))return;t.setState({draggedTrackPos:[a.clientX,a.clientY]},function(){return t.onMove(a.clientX,a.clientY)})}else{var f=(0,l.getClosestThumbIndex)(t.thumbRefs.map(function(y){return y.current}),a.clientX,a.clientY,t.props.direction);(c=t.thumbRefs[f].current)===null||c===void 0||c.focus(),t.setState({draggedThumbIndex:f},function(){return t.onMove(a.clientX,a.clientY)})}},t.onResize=function(){(0,l.translateThumbs)(t.getThumbs(),t.getOffsets(),t.props.rtl),t.calculateMarkOffsets()},t.onTouchStartTrack=function(a){var c;if(a.persist(),t.addTouchEvents(a.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(y){var k;return(k=y.current)===null||k===void 0?void 0:k.contains(a.target)}))return;t.setState({draggedTrackPos:[a.touches[0].clientX,a.touches[0].clientY]},function(){return t.onMove(a.touches[0].clientX,a.touches[0].clientY)})}else{var f=(0,l.getClosestThumbIndex)(t.thumbRefs.map(function(y){return y.current}),a.touches[0].clientX,a.touches[0].clientY,t.props.direction);(c=t.thumbRefs[f].current)===null||c===void 0||c.focus(),t.setState({draggedThumbIndex:f},function(){return t.onMove(a.touches[0].clientX,a.touches[0].clientY)})}},t.onMouseOrTouchStart=function(a){if(!t.props.disabled){var c=(0,l.isTouchEvent)(a);if(!(!c&&a.button!==0)){var f=t.getTargetIndex(a);f!==-1&&(c?t.addTouchEvents(a):t.addMouseEvents(a),t.setState({draggedThumbIndex:f,thumbZIndexes:t.state.thumbZIndexes.map(function(y,k){return k===f?Math.max.apply(Math,t.state.thumbZIndexes):y<=t.state.thumbZIndexes[f]?y:y-1})}))}}},t.onMouseMove=function(a){a.preventDefault(),t.onMove(a.clientX,a.clientY)},t.onTouchMove=function(a){a.preventDefault(),t.onMove(a.touches[0].clientX,a.touches[0].clientY)},t.onKeyDown=function(a){var c=t.props,f=c.values,y=c.onChange,k=c.step,x=c.rtl,O=c.direction,w=t.state.isChanged,M=t.getTargetIndex(a.nativeEvent),P=x||O===h.Direction.Left||O===h.Direction.Down?-1:1;M!==-1&&(F.includes(a.key)?(a.preventDefault(),t.setState({draggedThumbIndex:M,isChanged:!0}),y((0,l.replaceAt)(f,M,t.normalizeValue(f[M]+P*(a.key==="PageUp"?k*10:k),M)))):j.includes(a.key)?(a.preventDefault(),t.setState({draggedThumbIndex:M,isChanged:!0}),y((0,l.replaceAt)(f,M,t.normalizeValue(f[M]-P*(a.key==="PageDown"?k*10:k),M)))):a.key==="Tab"?t.setState({draggedThumbIndex:-1},function(){w&&t.fireOnFinalChange()}):w&&t.fireOnFinalChange())},t.onKeyUp=function(a){var c=t.state.isChanged;t.setState({draggedThumbIndex:-1},function(){c&&t.fireOnFinalChange()})},t.onMove=function(a,c){var f=t.state,y=f.draggedThumbIndex,k=f.draggedTrackPos,x=t.props,O=x.direction,w=x.min,M=x.max,P=x.onChange,R=x.values,B=x.step,C=x.rtl;if(y===-1&&k[0]===-1&&k[1]===-1)return null;var i=t.trackRef.current;if(!i)return null;var o=i.getBoundingClientRect(),u=(0,l.isVertical)(O)?o.height:o.width;if(k[0]!==-1&&k[1]!==-1){var g=a-k[0],m=c-k[1],p=0;switch(O){case h.Direction.Right:case h.Direction.Left:p=g/u*(M-w);break;case h.Direction.Down:case h.Direction.Up:p=m/u*(M-w);break;default:(0,l.assertUnreachable)(O)}if(C&&(p*=-1),Math.abs(p)>=B/2){for(var b=0;b<t.thumbRefs.length;b++){if(R[b]===M&&Math.sign(p)===1||R[b]===w&&Math.sign(p)===-1)return;var $=R[b]+p;$>M?p=M-R[b]:$<w&&(p=w-R[b])}for(var D=R.slice(0),b=0;b<t.thumbRefs.length;b++)D=(0,l.replaceAt)(D,b,t.normalizeValue(R[b]+p,b));t.setState({draggedTrackPos:[a,c]}),P(D)}}else{var E=0;switch(O){case h.Direction.Right:E=(a-o.left)/u*(M-w)+w;break;case h.Direction.Left:E=(u-(a-o.left))/u*(M-w)+w;break;case h.Direction.Down:E=(c-o.top)/u*(M-w)+w;break;case h.Direction.Up:E=(u-(c-o.top))/u*(M-w)+w;break;default:(0,l.assertUnreachable)(O)}C&&(E=M+w-E),Math.abs(R[y]-E)>=B/2&&P((0,l.replaceAt)(R,y,t.normalizeValue(E,y)))}},t.normalizeValue=function(a,c){var f=t.props,y=f.min,k=f.max,x=f.step,O=f.allowOverlap,w=f.values;return(0,l.normalizeValue)(a,c,y,k,x,O,w)},t.onEnd=function(a){if(a.preventDefault(),document.removeEventListener("mousemove",t.schdOnMouseMove),document.removeEventListener("touchmove",t.schdOnTouchMove),document.removeEventListener("mouseup",t.schdOnEnd),document.removeEventListener("touchend",t.schdOnEnd),document.removeEventListener("touchcancel",t.schdOnEnd),t.state.draggedThumbIndex===-1&&t.state.draggedTrackPos[0]===-1&&t.state.draggedTrackPos[1]===-1)return null;t.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){t.fireOnFinalChange()})},t.fireOnFinalChange=function(){t.setState({isChanged:!1});var a=t.props,c=a.onFinalChange,f=a.values;c&&c(f)},t.updateMarkRefs=function(a){if(!a.renderMark){t.numOfMarks=void 0,t.markRefs=void 0;return}t.numOfMarks=(a.max-a.min)/t.props.step,t.markRefs=[];for(var c=0;c<t.numOfMarks+1;c++)t.markRefs[c]=S.createRef()},t.calculateMarkOffsets=function(){if(!(!t.props.renderMark||!t.trackRef||!t.numOfMarks||!t.markRefs||t.trackRef.current===null)){for(var a=window.getComputedStyle(t.trackRef.current),c=parseInt(a.width,10),f=parseInt(a.height,10),y=parseInt(a.paddingLeft,10),k=parseInt(a.paddingTop,10),x=[],O=0;O<t.numOfMarks+1;O++){var w=9999,M=9999;if(t.markRefs[O].current){var P=t.markRefs[O].current.getBoundingClientRect();w=P.height,M=P.width}t.props.direction===h.Direction.Left||t.props.direction===h.Direction.Right?x.push([Math.round(c/t.numOfMarks*O+y-M/2),-Math.round((w-f)/2)]):x.push([Math.round(f/t.numOfMarks*O+k-w/2),-Math.round((M-c)/2)])}t.setState({markOffsets:x})}},d.step===0)throw new Error('"step" property should be a positive number');return t.schdOnMouseMove=(0,l.schd)(t.onMouseMove),t.schdOnTouchMove=(0,l.schd)(t.onTouchMove),t.schdOnEnd=(0,l.schd)(t.onEnd),t.thumbRefs=d.values.map(function(){return S.createRef()}),t.updateMarkRefs(d),t}return T.prototype.componentDidMount=function(){var d=this,t=this.props,a=t.values,c=t.min,f=t.step;this.resizeObserver=window.ResizeObserver?new window.ResizeObserver(this.onResize):{observe:function(){return window.addEventListener("resize",d.onResize)},unobserve:function(){return window.removeEventListener("resize",d.onResize)}},document.addEventListener("touchstart",this.onMouseOrTouchStart,{passive:!1}),document.addEventListener("mousedown",this.onMouseOrTouchStart,{passive:!1}),!this.props.allowOverlap&&(0,l.checkInitialOverlap)(this.props.values),this.props.values.forEach(function(y){return(0,l.checkBoundaries)(y,d.props.min,d.props.max)}),this.resizeObserver.observe(this.trackRef.current),(0,l.translateThumbs)(this.getThumbs(),this.getOffsets(),this.props.rtl),this.calculateMarkOffsets(),a.forEach(function(y){(0,l.isStepDivisible)(c,y,f)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")})},T.prototype.componentDidUpdate=function(d,t){var a=this.props,c=a.max,f=a.min,y=a.step,k=a.values,x=a.rtl;(d.max!==c||d.min!==f||d.step!==y)&&this.updateMarkRefs(this.props),(0,l.translateThumbs)(this.getThumbs(),this.getOffsets(),x),(d.max!==c||d.min!==f||d.step!==y||t.markOffsets.length!==this.state.markOffsets.length)&&(this.calculateMarkOffsets(),k.forEach(function(O){(0,l.isStepDivisible)(f,O,y)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")}))},T.prototype.componentWillUnmount=function(){var d={passive:!1};document.removeEventListener("mousedown",this.onMouseOrTouchStart,d),document.removeEventListener("mousemove",this.schdOnMouseMove),document.removeEventListener("touchmove",this.schdOnTouchMove),document.removeEventListener("touchstart",this.onMouseOrTouchStart),document.removeEventListener("mouseup",this.schdOnEnd),document.removeEventListener("touchend",this.schdOnEnd),this.resizeObserver.unobserve(this.trackRef.current)},T.prototype.render=function(){var d=this,t=this.props,a=t.label,c=t.labelledBy,f=t.renderTrack,y=t.renderThumb,k=t.renderMark,x=k===void 0?function(){return null}:k,O=t.values,w=t.min,M=t.max,P=t.allowOverlap,R=t.disabled,B=this.state,C=B.draggedThumbIndex,i=B.thumbZIndexes,o=B.markOffsets;return f({props:{style:{transform:"scale(1)",cursor:C>-1?"grabbing":this.props.draggableTrack?(0,l.isVertical)(this.props.direction)?"ns-resize":"ew-resize":O.length===1&&!R?"pointer":"inherit"},onMouseDown:R?l.voidFn:this.onMouseDownTrack,onTouchStart:R?l.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:R,children:v(v([],o.map(function(u,g,m){return x({props:{style:d.props.direction===h.Direction.Left||d.props.direction===h.Direction.Right?{position:"absolute",left:"".concat(u[0],"px"),marginTop:"".concat(u[1],"px")}:{position:"absolute",top:"".concat(u[0],"px"),marginLeft:"".concat(u[1],"px")},key:"mark".concat(g),ref:d.markRefs[g]},index:g})}),!0),O.map(function(u,g){var m=d.state.draggedThumbIndex===g;return y({index:g,value:u,isDragged:m,props:{style:{position:"absolute",zIndex:i[g],cursor:R?"inherit":m?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:g,tabIndex:R?void 0:0,"aria-valuemax":P?M:O[g+1]||M,"aria-valuemin":P?w:O[g-1]||w,"aria-valuenow":u,draggable:!1,ref:d.thumbRefs[g],"aria-label":a,"aria-labelledby":c,role:"slider",onKeyDown:R?l.voidFn:d.onKeyDown,onKeyUp:R?l.voidFn:d.onKeyUp}})}),!0)})},T.defaultProps={label:"Accessibility label",labelledBy:null,step:1,direction:h.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},T})(S.Component);return H.default=V,H}var qe;function xt(){return qe||(qe=1,(function(e){var r=ue&&ue.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.checkValuesAgainstBoundaries=e.relativeValue=e.useThumbOverlap=e.Direction=e.getTrackBackground=e.Range=void 0;var n=r(It());e.Range=n.default;var s=Ge();Object.defineProperty(e,"getTrackBackground",{enumerable:!0,get:function(){return s.getTrackBackground}}),Object.defineProperty(e,"useThumbOverlap",{enumerable:!0,get:function(){return s.useThumbOverlap}}),Object.defineProperty(e,"relativeValue",{enumerable:!0,get:function(){return s.relativeValue}}),Object.defineProperty(e,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return s.checkValuesAgainstBoundaries}});var v=De();Object.defineProperty(e,"Direction",{enumerable:!0,get:function(){return v.Direction}})})(ue)),ue}var Je=xt();function Ke(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);r&&(s=s.filter(function(v){return Object.getOwnPropertyDescriptor(e,v).enumerable})),n.push.apply(n,s)}return n}function Te(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Ke(Object(n),!0).forEach(function(s){Dt(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ke(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function Dt(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var ke=Q("div",{position:"relative",width:"100%"});ke.displayName="Root";ke.displayName="Root";ke.displayName="StyledRoot";var Oe=Q("div",function(e){var r=e.$theme,n=e.$value,s=n===void 0?[]:n,v=e.$disabled,S=e.$isDragged,l=r.sizing,h="inherit";return v?h="not-allowed":S?h="grabbing":s.length===1&&(h="pointer"),{paddingTop:l.scale600,paddingBottom:l.scale600,paddingRight:l.scale600,paddingLeft:l.scale600,display:"flex",cursor:h,backgroundColor:r.colors.sliderTrackFill}});Oe.displayName="Track";Oe.displayName="Track";Oe.displayName="StyledTrack";var fe=Q("div",function(e){var r=e.$theme,n=e.$value,s=n===void 0?[]:n,v=e.$min,S=e.$max,l=e.$disabled,h=r.colors,F=r.borders,j=r.direction,V=r.borders.useRoundedCorners?F.radius100:0;return{borderTopLeftRadius:V,borderTopRightRadius:V,borderBottomRightRadius:V,borderBottomLeftRadius:V,background:Je.getTrackBackground({values:s,colors:s.length===1?[l?h.borderOpaque:h.primary,l?h.backgroundSecondary:h.borderOpaque]:[l?h.backgroundSecondary:h.borderOpaque,l?h.borderOpaque:h.primary,l?h.backgroundSecondary:h.borderOpaque],min:v||0,max:S||0,rtl:j==="rtl"}),height:"2px",width:"100%",alignSelf:"center",cursor:l?"not-allowed":"inherit"}});fe.displayName="InnerTrack";fe.displayName="InnerTrack";fe.displayName="StyledInnerTrack";var we=Q("div",function(e){return{width:"4px",height:"2px",backgroundColor:e.$theme.colors.backgroundPrimary,marginLeft:"16px"}});we.displayName="Mark";we.displayName="Mark";we.displayName="StyledMark";var Re=Q("div",function(e){return Te(Te({},e.$theme.typography.font200),{},{color:e.$theme.colors.contentPrimary})});Re.displayName="Tick";Re.displayName="Tick";Re.displayName="StyledTick";var Se=Q("div",function(e){var r=e.$theme,n=r.sizing;return{display:"flex",justifyContent:"space-between",alignItems:"center",paddingRight:n.scale600,paddingLeft:n.scale600,paddingBottom:n.scale400}});Se.displayName="TickBar";Se.displayName="TickBar";Se.displayName="StyledTickBar";var Me=Q("div",function(e){var r=e.$theme,n=e.$value,s=n===void 0?[]:n,v=e.$thumbIndex,S=e.$disabled,l=s.length===2&&v===0,h=s.length===2&&v===1;return r.direction==="rtl"&&(h||l)&&(l=!l,h=!h),{height:"24px",width:"24px",borderTopLeftRadius:"24px",borderTopRightRadius:"24px",borderBottomLeftRadius:"24px",borderBottomRightRadius:"24px",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:S?r.colors.sliderHandleFillDisabled:r.colors.sliderHandleFill,outline:"none",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(r.colors.accent):"0 1px 4px rgba(0, 0, 0, 0.12)",cursor:S?"not-allowed":"inherit"}});Me.displayName="Thumb";Me.displayName="Thumb";Me.displayName="StyledThumb";var $e=Q("div",function(e){var r=e.$disabled,n=e.$theme;return{position:"absolute",top:"-16px",width:"4px",height:"20px",backgroundColor:r?n.colors.sliderHandleFillDisabled:n.colors.sliderHandleInnerFill}});$e.displayName="InnerThumb";$e.displayName="InnerThumb";$e.displayName="StyledInnerThumb";var _e=Q("div",function(e){var r=e.$disabled,n=e.$theme;return Te(Te({position:"absolute",top:"-".concat(n.sizing.scale1400)},n.typography.font200),{},{backgroundColor:r?n.colors.sliderHandleFillDisabled:n.colors.sliderHandleInnerFill,color:n.colors.contentInversePrimary,paddingLeft:n.sizing.scale600,paddingRight:n.sizing.scale600,paddingTop:n.sizing.scale500,paddingBottom:n.sizing.scale500,borderBottomLeftRadius:"48px",borderBottomRightRadius:"48px",borderTopLeftRadius:"48px",borderTopRightRadius:"48px",whiteSpace:"nowrap"})});_e.displayName="ThumbValue";_e.displayName="ThumbValue";_e.displayName="StyledThumbValue";function Xe(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);r&&(s=s.filter(function(v){return Object.getOwnPropertyDescriptor(e,v).enumerable})),n.push.apply(n,s)}return n}function Ct(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Xe(Object(n),!0).forEach(function(s){Pt(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xe(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function Pt(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function X(){return X=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},X.apply(this,arguments)}function K(e,r){return Ft(e)||At(e,r)||Lt(e,r)||Bt()}function Bt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lt(e,r){if(e){if(typeof e=="string")return Ye(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ye(e,r)}}function Ye(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,s=new Array(r);n<r;n++)s[n]=e[n];return s}function At(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var s=[],v=!0,S=!1,l,h;try{for(n=n.call(e);!(v=(l=n.next()).done)&&(s.push(l.value),!(r&&s.length===r));v=!0);}catch(F){S=!0,h=F}finally{try{!v&&n.return!=null&&n.return()}finally{if(S)throw h}}return s}}function Ft(e){if(Array.isArray(e))return e}var jt=function(r){if(r.length>2||r.length===0)throw new Error("the value prop represents positions of thumbs, so its length can be only one or two");return r};function Vt(e){var r=e.overrides,n=r===void 0?{}:r,s=e.disabled,v=s===void 0?!1:s,S=e.marks,l=S===void 0?!1:S,h=e.onChange,F=h===void 0?function(){}:h,j=e.onFinalChange,V=j===void 0?function(){}:j,I=e.min,T=I===void 0?0:I,d=e.max,t=d===void 0?100:d,a=e.step,c=a===void 0?1:a,f=e.persistentThumb,y=f===void 0?!1:f,k=e.valueToLabel,x=k===void 0?function(Y){return Y}:k,O=e.value,w=_.useContext(vt),M=_.useState(!1),P=K(M,2),R=P[0],B=P[1],C=_.useState(!1),i=K(C,2),o=i[0],u=i[1],g=_.useState(!1),m=K(g,2),p=m[0],b=m[1],$=_.useState(-1),D=K($,2),E=D[0],U=D[1],z=_.useCallback(function(Y){mt(Y)&&b(!0);var N=Y.target.parentNode.firstChild===Y.target?0:1;U(N)},[]),W=_.useCallback(function(Y){p!==!1&&b(!1),U(-1)},[]),L=jt(O),A={$disabled:v,$step:c,$min:T,$max:t,$marks:l,$value:L,$isFocusVisible:p},G=J(n.Root,ke),ne=K(G,2),he=ne[0],ee=ne[1],ge=J(n.Track,Oe),pe=K(ge,2),ve=pe[0],Ee=pe[1],te=J(n.InnerTrack,fe),se=K(te,2),me=se[0],be=se[1],Qe=J(n.Thumb,Me),Ce=K(Qe,2),et=Ce[0],tt=Ce[1],rt=J(n.InnerThumb,$e),Pe=K(rt,2),nt=Pe[0],at=Pe[1],it=J(n.ThumbValue,_e),Be=K(it,2),ot=Be[0],st=Be[1],ut=J(n.Tick,Re),Le=K(ut,2),Ae=Le[0],Fe=Le[1],ct=J(n.TickBar,Se),je=K(ct,2),lt=je[0],dt=je[1],ft=J(n.Mark,we),Ve=K(ft,2),ht=Ve[0],gt=Ve[1];return _.createElement(he,X({"data-baseweb":"slider"},A,ee,{onFocus:yt(ee,z),onBlur:bt(ee,W)}),_.createElement(Je.Range,X({step:c,min:T,max:t,values:L,disabled:v,onChange:function(N){return F({value:N})},onFinalChange:function(N){return V({value:N})},rtl:w.direction==="rtl",renderTrack:function(N){var re=N.props,q=N.children,ae=N.isDragged;return _.createElement(ve,X({onMouseDown:re.onMouseDown,onTouchStart:re.onTouchStart,$isDragged:ae},A,Ee),_.createElement(me,X({$isDragged:ae,ref:re.ref},A,be),q))},renderThumb:function(N){var re=N.props,q=N.index,ae=N.isDragged,ze=y||(!!q&&o||!q&&R||ae)&&!v;return _.createElement(et,X({},re,{onMouseEnter:function(){q===0?B(!0):u(!0)},onMouseLeave:function(){q===0?B(!1):u(!1)},$thumbIndex:q,$isDragged:ae,style:Ct({},re.style)},A,tt,{$isFocusVisible:p&&E===q}),ze&&_.createElement(ot,X({$thumbIndex:q,$isDragged:ae},A,st),x(L[q])),ze&&_.createElement(nt,X({$thumbIndex:q,$isDragged:ae},A,at)))}},l?{renderMark:function(N){var re=N.props,q=N.index;return _.createElement(ht,X({$markIndex:q},re,A,gt))}}:{})),_.createElement(lt,X({},A,dt),_.createElement(Ae,X({},A,Fe),x(T)),_.createElement(Ae,X({},A,Fe),x(t))))}const zt=oe("div",{target:"e19ax2tf0"})({position:"relative",":focus-within:has(:focus-visible)":{"--slider-focused":1}}),Nt=oe("div",{target:"e19ax2tf1"})(({disabled:e,theme:r,isDragged:n})=>({alignItems:"center",backgroundColor:e?r.colors.gray60:r.colors.primary,borderTopLeftRadius:"100%",borderTopRightRadius:"100%",borderBottomLeftRadius:"100%",borderBottomRightRadius:"100%",borderTopStyle:"none",borderBottomStyle:"none",borderRightStyle:"none",borderLeftStyle:"none",display:"flex",justifyContent:"center",height:r.sizes.sliderThumb,width:r.sizes.sliderThumb,boxShadow:n?Ne(r):"none",":focus":{outline:"none"},":focus-visible":{boxShadow:Ne(r)}})),Ut=oe("div",{target:"e19ax2tf2"})(({disabled:e,theme:r})=>({fontFamily:r.genericFonts.bodyFont,fontSize:r.fontSizes.sm,color:e?r.colors.gray60:r.colors.primary,top:"-1.6em",position:"absolute",whiteSpace:"nowrap",backgroundColor:r.colors.transparent,lineHeight:r.lineHeights.base,fontWeight:r.fontWeights.normal,pointerEvents:"none"})),Ht=oe("div",{target:"e19ax2tf3"})({flex:1}),Wt=oe("div",{target:"e19ax2tf4"})(({theme:e})=>({position:"absolute",height:e.spacing.twoXS,left:`calc(${e.sizes.sliderThumb} / 2)`,right:`calc(${e.sizes.sliderThumb} / 2)`})),qt=oe("div",{target:"e19ax2tf5"})(({theme:e,isHovered:r,isDisabled:n})=>({position:"absolute",left:0,right:0,top:"100%",display:"flex",justifyContent:"space-between",pointerEvents:"none",marginTop:`-${e.spacing.md}`,fontSize:e.fontSizes.sm,lineHeight:e.lineHeights.base,fontWeight:e.fontWeights.normal,color:n?e.colors.fadedText40:e.colors.fadedText60,opacity:r?1:"var(--slider-focused, 0)",transition:r?"none":"opacity 300ms 200ms"}));function Kt({minLabel:e,maxLabel:r,isHovered:n,isDisabled:s}){return xe(qt,{"data-testid":"stSliderTickBar",isHovered:n,isDisabled:s,children:[Z(Ie,{source:e,allowHTML:!1,inheritFont:!0,isLabel:!0}),Z(Ie,{source:r,allowHTML:!1,inheritFont:!0,isLabel:!0})]})}function Xt({disabled:e,element:r,widgetMgr:n,fragmentId:s}){const[v,S]=$t({getStateFromWidgetMgr:Yt,getDefaultStateFromProto:Zt,getCurrStateFromProto:Gt,updateWidgetMgrState:Jt,element:r,widgetMgr:n,fragmentId:s}),[l,h]=_.useState(v),[F,j]=_.useState(!1),[V,I]=_.useState(!1),T=_.useCallback(()=>j(!0),[]),d=_.useCallback(()=>j(!1),[]),t=_.useRef(null),[a]=_.useState([]),[c]=_.useState([]),f=Tt(),y=_.useRef(r);y.current=r;const k=l.map(C=>ye(C,r)),x=ye(r.min,r),O=ye(r.max,r);_.useEffect(()=>{h(v)},[v]);const w=_.useCallback(({value:C})=>{S({value:C,fromUi:!0}),I(!1)},[S]),M=_.useCallback(({value:C})=>{h(C),I(!0)},[]),P=_.useCallback(_.forwardRef(function(i,o){const{$thumbIndex:u,$value:g}=i,m=u||0;a[m]=o,c[m]||=_.createRef();const p=kt(i,["role","style","aria-valuemax","aria-valuemin","aria-valuenow","tabIndex","onKeyUp","onKeyDown","onMouseEnter","onMouseLeave","draggable"]),b=y.current,D=(g??[b.min])[m]??b.min,E=ye(D,b);return Z(Nt,{...p,disabled:i.$disabled===!0,isDragged:i.$isDragged===!0,ref:a[m],"aria-valuetext":E,"aria-label":b.label,children:Z(Ut,{"data-testid":"stSliderThumbValue",disabled:i.$disabled===!0,ref:c[m],children:Z(Ie,{source:E,allowHTML:!1,inheritFont:!0,isLabel:!0})})})}),[]);_.useLayoutEffect(()=>{a.forEach((m,p)=>{m.current&&m.current.setAttribute("aria-valuetext",k[p])});const C=t.current??null,i=a[0].current,o=a[1]?.current,u=c[0].current,g=c[1]?.current;rr(C,i,o,u,g)});const R=_.useCallback(({$disabled:C})=>({height:f.spacing.twoXS,...C?{background:f.colors.darkenedBgMix25}:{}}),[f.colors.darkenedBgMix25,f.spacing.twoXS]),B=_.useCallback(_.forwardRef(function(i,o){const{children:u,...g}=i;return xe(Ht,{children:[Z(Wt,{ref:o,children:u}),Z(fe,{...g,style:R({$disabled:i.$disabled})})]})}),[]);return xe(zt,{ref:t,className:"stSlider","data-testid":"stSlider",onMouseEnter:T,onMouseLeave:d,children:[Z(Rt,{label:r.label,disabled:e,labelVisibility:Ot(r.labelVisibility?.value),children:r.help&&Z(wt,{content:r.help,label:r.label})}),Z(Vt,{min:r.min,max:r.max,step:r.step,value:tr(l,r),onChange:M,onFinalChange:w,disabled:e,overrides:{Thumb:P,Track:{style:{backgroundColor:"none !important",paddingLeft:f.spacing.none,paddingRight:f.spacing.none,paddingTop:`calc((${f.sizes.minElementHeight} - ${f.spacing.twoXS}) / 2)`,paddingBottom:`calc((${f.sizes.minElementHeight} - ${f.spacing.twoXS}) / 2)`}},InnerTrack:B,TickBar:{component:Kt,props:{minLabel:x,maxLabel:O,isHovered:F||V,isDisabled:e}}}})]})}function Yt(e,r){return e.getDoubleArrayValue(r)}function Zt(e){return e.default}function Gt(e){return e.value}function Jt(e,r,n,s){r.setDoubleArrayValue(e,n.value,{fromUi:n.fromUi},s)}function Qt(e){const{dataType:r}=e;return r===de.DataType.DATETIME||r===de.DataType.DATE||r===de.DataType.TIME}function er(e){const{dataType:r}=e;return r===de.DataType.DATE?"date":r===de.DataType.TIME?"time":"datetime"}function ye(e,r){const{format:n,options:s}=r;if(s.length>0)return s[e]??"";if(Qt(r)){const v=St.utc(e/1e3);return _t(v,n,er(r))}return Et(e,n)}function tr(e,r){const{min:n,max:s}=r;let v=e[0],S=e.length>1?e[1]:e[0];return v>S&&(v=S),v<n&&(v=n),v>s&&(v=s),S<n&&(S=n),S>s&&(S=s),e.length>1?[v,S]:[v]}function rr(e,r,n,s,v){!e||!r||!s||(ie(e,r,s),n&&v&&(ie(e,n,v),nr(e,r,n,s,v)))}function ie(e,r,n){const s=e.getBoundingClientRect(),v=r.getBoundingClientRect(),S=n.getBoundingClientRect(),l=v.left+v.width/2,h=l-S.width/2<s.left,F=l+S.width/2>s.right;n.style.left=h?"0":"",n.style.right=F?"0":""}function nr(e,r,n,s,v){const l=e.getBoundingClientRect(),h=r.getBoundingClientRect(),F=n.getBoundingClientRect(),j=s.getBoundingClientRect(),V=v.getBoundingClientRect(),I=l.left+l.width/2,T=h.left+h.width/2,d=F.left+F.width/2,t=T-j.width/2>=l.left,a=d+V.width/2<=l.right,c=h.left-j.width>=l.left,f=F.right+V.width<=l.right,y=t?j.width/2:j.width,k=a?V.width/2:V.width,x=T+y;if(d-k-x>24){ie(e,r,s),ie(e,n,v);return}if(c&&f){s.style.left="",s.style.right=`${Math.round(h.width)}px`,v.style.left=`${Math.round(F.width)}px`,v.style.right="";return}T<I?(ie(e,r,s),v.style.left=`${Math.round(T+y+24-d)}px`,v.style.right=""):(ie(e,n,v),s.style.left="",s.style.right=`${-Math.round(d-k-24-T)}px`)}const hr=Mt(_.memo(Xt));export{hr as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n,E as H,_ as D,F as _,aj as he,o as O,j as U,aA as ge,P as ve,b as me,B as Se,az as q,bQ as re,an as be,ah as ye,bi as Ce,l as Ue,bR as we,k as Me,al as Ee,e as L,W as xe,bj as Ie,p as Fe,ac as Re,ad as _e,a0 as Pe,bS as Oe,bT as ke}from"./index.CXVpBAvU.js";import{U as ie}from"./UploadFileInfo.Dr-zDST7.js";import{u as Te}from"./FormClearHelper.D4lty7rT.js";import{P as We,S as Le}from"./ProgressBar.DCHh4N3P.js";import{b as je}from"./urls.BwSlolu9.js";var oe=n.forwardRef(function(e,a){var d={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return n.createElement(H,D({iconAttrs:d,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:a}),n.createElement("rect",{width:24,height:24,fill:"none"}),n.createElement("path",{d:"M20 5h-3.17l-1.24-1.35A1.99 1.99 0 0014.12 3H9.88c-.56 0-1.1.24-1.48.65L7.17 5H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-1.35 8.35l-2.79 2.79c-.32.32-.86.1-.86-.35v-1.75H9v1.75c0 .45-.54.67-.85.35l-2.79-2.79c-.2-.2-.2-.51 0-.71l2.79-2.79a.5.5 0 01.85.36v1.83h6v-1.83c0-.45.54-.67.85-.35l2.79 2.79c.2.19.2.51.01.7z"}))});oe.displayName="SwitchCamera";var ne=n.forwardRef(function(e,a){var d={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return n.createElement(H,D({iconAttrs:d,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:a}),n.createElement("path",{d:"M.5 1c-.28 0-.5.23-.5.5v4c0 .28.23.5.5.5h5c.28 0 .5-.22.5-.5V4l1 1h1V2H7L6 3V1.5c0-.28-.22-.5-.5-.5h-5z"}))});ne.displayName="Video";var ae=n.forwardRef(function(e,a){var d={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return n.createElement(H,D({iconAttrs:d,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:a}),n.createElement("path",{d:"M1.41 0L0 1.41l.72.72L2.5 3.94.72 5.72 0 6.41l1.41 1.44.72-.72 1.81-1.81 1.78 1.81.69.72 1.44-1.44-.72-.69-1.81-1.78 1.81-1.81.72-.72L6.41 0l-.69.72L3.94 2.5 2.13.72 1.41 0z"}))});ae.displayName="X";function Be(e,a){switch(e){case"xsmall":return{padding:`${a.spacing.twoXS} ${a.spacing.sm}`,fontSize:a.fontSizes.sm};case"small":return{padding:`${a.spacing.twoXS} ${a.spacing.md}`};case"large":return{padding:`${a.spacing.md} ${a.spacing.md}`};default:return{padding:`${a.spacing.xs} ${a.spacing.md}`}}}const se=_("div",{target:"e1dr6u8s0"})({position:"relative",overflow:"hidden",width:"100%",objectFit:"contain"}),G=_("div",{target:"e1dr6u8s1"})(({theme:e,width:a})=>({backgroundColor:e.colors.secondaryBg,borderRadius:`${e.radii.default} ${e.radii.default} 0 0`,width:"100%",height:a*9/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"})),Ve=_("p",{target:"e1dr6u8s2"})(({theme:e})=>({marginTop:e.spacing.sm,textAlign:"center"})),Ae=_("img",{target:"e1dr6u8s3"})(({theme:e,opacity:a})=>({borderRadius:`${e.radii.default} ${e.radii.default} 0 0`,objectFit:"contain",opacity:a})),ze=_("a",{target:"e1dr6u8s4"})(({theme:e})=>({color:e.colors.link,textDecoration:e.linkUnderline?"underline":"none",display:"block"})),$e=_("span",{target:"e1dr6u8s5"})({display:"flex",alignItems:"center"}),Ne=_("div",{target:"e1dr6u8s6"})(({theme:e})=>({position:"absolute",top:e.spacing.lg,right:e.spacing.lg,zIndex:e.zIndices.priority,color:e.colors.fadedText40,mixBlendMode:"difference",opacity:.6})),He=_("div",{target:"e1dr6u8s8"})({height:"fit-content",width:"100%",position:"absolute",bottom:0}),De=_("button",{target:"e1dr6u8s9"})(({theme:e})=>({position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:e.colors.lightenedBg05,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:`0 0 ${e.radii.default} ${e.radii.default}`,"&:hover":{borderColor:e.colors.primary,color:e.colors.primary},"&:active":{color:e.colors.white,borderColor:e.colors.primary,backgroundColor:e.colors.primary},"&:focus:not(:active)":{borderColor:e.colors.primary,color:e.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:e.colors.fadedText40,borderColor:e.colors.borderColor,backgroundColor:e.colors.lightenedBg05,cursor:"not-allowed"},fontWeight:e.fontWeights.normal,padding:`${e.spacing.xs} ${e.spacing.md}`,margin:e.spacing.none,lineHeight:e.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:he(e)},...Be("medium",e)}));function qe({disabled:e,onClick:a,children:d,progress:g}){return O(De,{disabled:e||!1,onClick:a||(()=>{}),progress:g||null,"data-testid":"stCameraInputButton",children:[d,g?U(He,{children:U(We,{value:g,size:Le.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarProgress:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarContainer:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}}}})}):null]})}const le=n.memo(qe);var V=(function(e){return e.USER="user",e.ENVIRONMENT="environment",e})({});const Ge=({switchFacingMode:e})=>U(Ne,{"data-testid":"stCameraInputSwitchButton",children:U(ge,{content:"Switch camera",placement:ve.TOP_RIGHT,children:U(me,{kind:Se.MINIMAL,onClick:e,children:U(q,{content:oe,size:"twoXL",color:re.white})})})}),Xe=n.memo(Ge);var A={exports:{}},Qe=A.exports,te;function Je(){return te||(te=1,(function(e,a){(function(g,v){e.exports=v(be())})(Qe,function(d){return(function(g){var v={};function p(o){if(v[o])return v[o].exports;var f=v[o]={i:o,l:!1,exports:{}};return g[o].call(f.exports,f,f.exports,p),f.l=!0,f.exports}return p.m=g,p.c=v,p.d=function(o,f,m){p.o(o,f)||Object.defineProperty(o,f,{enumerable:!0,get:m})},p.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},p.t=function(o,f){if(f&1&&(o=p(o)),f&8||f&4&&typeof o=="object"&&o&&o.__esModule)return o;var m=Object.create(null);if(p.r(m),Object.defineProperty(m,"default",{enumerable:!0,value:o}),f&2&&typeof o!="string")for(var F in o)p.d(m,F,(function(I){return o[I]}).bind(null,F));return m},p.n=function(o){var f=o&&o.__esModule?function(){return o.default}:function(){return o};return p.d(f,"a",f),f},p.o=function(o,f){return Object.prototype.hasOwnProperty.call(o,f)},p.p="",p(p.s="./src/react-webcam.tsx")})({"./src/react-webcam.tsx":(function(g,v,p){p.r(v);var o=p("react"),f=(function(){var b=function(i,t){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var l in s)s.hasOwnProperty(l)&&(r[l]=s[l])},b(i,t)};return function(i,t){b(i,t);function r(){this.constructor=i}i.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),m=function(){return m=Object.assign||function(b){for(var i,t=1,r=arguments.length;t<r;t++){i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(b[s]=i[s])}return b},m.apply(this,arguments)},F=function(b,i){var t={};for(var r in b)Object.prototype.hasOwnProperty.call(b,r)&&i.indexOf(r)<0&&(t[r]=b[r]);if(b!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(b);s<r.length;s++)i.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(b,r[s])&&(t[r[s]]=b[r[s]]);return t};(function(){typeof window>"u"||(navigator.mediaDevices===void 0&&(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia===void 0&&(navigator.mediaDevices.getUserMedia=function(i){var t=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;return t?new Promise(function(r,s){t.call(navigator,i,r,s)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}))})();function I(){return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}var R=(function(b){f(i,b);function i(t){var r=b.call(this,t)||this;return r.canvas=null,r.ctx=null,r.requestUserMediaId=0,r.unmounted=!1,r.state={hasUserMedia:!1},r}return i.prototype.componentDidMount=function(){var t=this,r=t.state,s=t.props;if(this.unmounted=!1,!I()){s.onUserMediaError("getUserMedia not supported");return}r.hasUserMedia||this.requestUserMedia(),s.children&&typeof s.children!="function"&&console.warn("children must be a function")},i.prototype.componentDidUpdate=function(t){var r=this.props;if(!I()){r.onUserMediaError("getUserMedia not supported");return}var s=JSON.stringify(t.audioConstraints)!==JSON.stringify(r.audioConstraints),l=JSON.stringify(t.videoConstraints)!==JSON.stringify(r.videoConstraints),M=t.minScreenshotWidth!==r.minScreenshotWidth,y=t.minScreenshotHeight!==r.minScreenshotHeight;(l||M||y)&&(this.canvas=null,this.ctx=null),(s||l)&&(this.stopAndCleanup(),this.requestUserMedia())},i.prototype.componentWillUnmount=function(){this.unmounted=!0,this.stopAndCleanup()},i.stopMediaStream=function(t){t&&(t.getVideoTracks&&t.getAudioTracks?(t.getVideoTracks().map(function(r){t.removeTrack(r),r.stop()}),t.getAudioTracks().map(function(r){t.removeTrack(r),r.stop()})):t.stop())},i.prototype.stopAndCleanup=function(){var t=this.state;t.hasUserMedia&&(i.stopMediaStream(this.stream),t.src&&window.URL.revokeObjectURL(t.src))},i.prototype.getScreenshot=function(t){var r=this,s=r.state,l=r.props;if(!s.hasUserMedia)return null;var M=this.getCanvas(t);return M&&M.toDataURL(l.screenshotFormat,l.screenshotQuality)},i.prototype.getCanvas=function(t){var r=this,s=r.state,l=r.props;if(!this.video||!s.hasUserMedia||!this.video.videoHeight)return null;if(!this.ctx){var M=this.video.videoWidth,y=this.video.videoHeight;if(!this.props.forceScreenshotSourceSize){var C=M/y;M=l.minScreenshotWidth||this.video.clientWidth,y=M/C,l.minScreenshotHeight&&y<l.minScreenshotHeight&&(y=l.minScreenshotHeight,M=y*C)}this.canvas=document.createElement("canvas"),this.canvas.width=t?.width||M,this.canvas.height=t?.height||y,this.ctx=this.canvas.getContext("2d")}var x=this,w=x.ctx,S=x.canvas;return w&&S&&(S.width=t?.width||S.width,S.height=t?.height||S.height,l.mirrored&&(w.translate(S.width,0),w.scale(-1,1)),w.imageSmoothingEnabled=l.imageSmoothing,w.drawImage(this.video,0,0,t?.width||S.width,t?.height||S.height),l.mirrored&&(w.scale(-1,1),w.translate(-S.width,0))),S},i.prototype.requestUserMedia=function(){var t=this,r=this.props,s=function(y,C){var x={video:typeof C<"u"?C:!0};r.audio&&(x.audio=typeof y<"u"?y:!0),t.requestUserMediaId++;var w=t.requestUserMediaId;navigator.mediaDevices.getUserMedia(x).then(function(S){t.unmounted||w!==t.requestUserMediaId?i.stopMediaStream(S):t.handleUserMedia(null,S)}).catch(function(S){t.handleUserMedia(S)})};if("mediaDevices"in navigator)s(r.audioConstraints,r.videoConstraints);else{var l=function(y){return{optional:[{sourceId:y}]}},M=function(y){var C=y.deviceId;return typeof C=="string"?C:Array.isArray(C)&&C.length>0?C[0]:typeof C=="object"&&C.ideal?C.ideal:null};MediaStreamTrack.getSources(function(y){var C=null,x=null;y.forEach(function(P){P.kind==="audio"?C=P.id:P.kind==="video"&&(x=P.id)});var w=M(r.audioConstraints);w&&(C=w);var S=M(r.videoConstraints);S&&(x=S),s(l(C),l(x))})}},i.prototype.handleUserMedia=function(t,r){var s=this.props;if(t||!r){this.setState({hasUserMedia:!1}),s.onUserMediaError(t);return}this.stream=r;try{this.video&&(this.video.srcObject=r),this.setState({hasUserMedia:!0})}catch{this.setState({hasUserMedia:!0,src:window.URL.createObjectURL(r)})}s.onUserMedia(r)},i.prototype.render=function(){var t=this,r=this,s=r.state,l=r.props,M=l.audio;l.forceScreenshotSourceSize;var y=l.disablePictureInPicture;l.onUserMedia,l.onUserMediaError,l.screenshotFormat,l.screenshotQuality,l.minScreenshotWidth,l.minScreenshotHeight,l.audioConstraints,l.videoConstraints,l.imageSmoothing;var C=l.mirrored,x=l.style,w=x===void 0?{}:x,S=l.children,P=F(l,["audio","forceScreenshotSourceSize","disablePictureInPicture","onUserMedia","onUserMediaError","screenshotFormat","screenshotQuality","minScreenshotWidth","minScreenshotHeight","audioConstraints","videoConstraints","imageSmoothing","mirrored","style","children"]),z=C?m(m({},w),{transform:(w.transform||"")+" scaleX(-1)"}):w,j={getScreenshot:this.getScreenshot.bind(this)};return o.createElement(o.Fragment,null,o.createElement("video",m({autoPlay:!0,disablePictureInPicture:y,src:s.src,muted:!M,playsInline:!0,ref:function(B){t.video=B},style:z},P)),S&&S(j))},i.defaultProps={audio:!1,disablePictureInPicture:!1,forceScreenshotSourceSize:!1,imageSmoothing:!0,mirrored:!1,onUserMedia:function(){},onUserMediaError:function(){},screenshotFormat:"image/webp",screenshotQuality:.92},i})(o.Component);v.default=R}),react:(function(g,v){g.exports=d})}).default})})(A)),A.exports}var Ke=Je();const Ye=ye(Ke),Ze=({width:e})=>O(G,{width:e,children:[U(q,{size:"threeXL",color:re.gray60,content:ne}),O(Ve,{children:["This app would like to use your camera.",U(ze,{href:je,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]}),et=({handleCapture:e,width:a,disabled:d,clearPhotoInProgress:g,setClearPhotoInProgress:v,facingMode:p,setFacingMode:o,testOverride:f})=>{const[m,F]=n.useState(f||"pending"),I=n.useRef(null),[R,b]=n.useState(a),i=n.useCallback(Ce(1e3,b),[]);n.useEffect(()=>{i(a)},[a,i]);function t(){if(I.current!==null){const s=I.current.getScreenshot();e(s)}}const r=Ue();return O(se,{"data-testid":"stCameraInputWebcamComponent",children:[m!=="success"&&!d&&!g?U(Ze,{width:R}):we()&&U(Xe,{switchFacingMode:o}),U(G,{"data-testid":"stCameraInputWebcamStyledBox",hidden:m!=="success"&&!d&&!g,width:R,children:!d&&U(Ye,{audio:!1,ref:I,screenshotFormat:"image/jpeg",screenshotQuality:1,width:R,height:R*9/16,style:{borderRadius:`${r.radii.default} ${r.radii.default} 0 0`},onUserMediaError:()=>{F("error")},onUserMedia:()=>{F("success"),v(!1)},videoConstraints:{width:{ideal:R},facingMode:p}})}),U(le,{onClick:t,disabled:m!=="success"||d||g,children:"Take Photo"})]})},tt=n.memo(et),ce="RESTORED_FROM_WIDGET",rt=150,it=xe.getLogger("CameraInput"),N=e=>{const a=e.filter(d=>d.status.type==="uploaded").map(d=>{const{name:g,size:v,status:p}=d,{fileId:o,fileUrls:f}=p;return new Oe({fileId:o,fileUrls:f,name:g,size:v})});return new ke({uploadedFileInfo:a})},ot=(e,a)=>{const d=a.getFileUploaderStateValue(e);if(L(d))return{files:[],nextLocalId:1,imgSrc:null};const{uploadedFileInfo:g}=d;if(L(g)||g.length===0)return{files:[],nextLocalId:1,imgSrc:null};let v=1;const p=g.map(o=>{const f=o.name,m=o.size,F=o.fileId,I=o.fileUrls,R=new ie(f,m,v,{type:"uploaded",fileId:F,fileUrls:I});return v+=1,R});return{files:p,nextLocalId:v,imgSrc:p.length>0?ce:null}};function nt(e,a){return fetch(e).then(d=>d.arrayBuffer()).then(d=>new File([d],a,{type:"image/jpeg"}))}const at=({element:e,widgetMgr:a,uploadClient:d,disabled:g,fragmentId:v,testOverride:p})=>{const{width:o,elementRef:f}=Me(),m=n.useRef(null);m.current===null&&(m.current=ot(e,a));const{files:F,nextLocalId:I,imgSrc:R}=m.current,b=n.useRef(I),[i,t]=n.useState(()=>F),r=n.useRef(i);n.useLayoutEffect(()=>{r.current=i},[i]);const[s,l]=n.useState(()=>R),[M,y]=n.useState(!1),[C,x]=n.useState(!0),[w,S]=n.useState(!1),[P,z]=n.useState(V.USER),j=n.useCallback(()=>{const c=b.current;return b.current+=1,c},[]),B=n.useMemo(()=>{const c=u=>u.status.type==="uploading";return i.some(c)?"updating":"ready"},[i]),$=n.useMemo(()=>{if(i.length>0&&i[i.length-1].status.type==="uploading")return i[i.length-1].status.progress},[i]),de=n.useCallback(()=>{z(c=>c===V.USER?V.ENVIRONMENT:V.USER)},[]),k=n.useCallback(c=>r.current.find(u=>u.id===c),[]),X=n.useCallback(c=>{Ee.flushSync(()=>{t(u=>[...u,c])})},[]),Q=n.useCallback(c=>{t(u=>u.filter(h=>h.id!==c))},[]),T=n.useCallback((c,u)=>{t(h=>h.map(E=>E.id===c?u:E))},[]),J=n.useCallback((c,u)=>{y(!1);const h=k(c);L(h)||h.status.type!=="uploading"||T(h.id,h.setStatus({type:"uploaded",fileId:u.fileId,fileUrls:u}))},[k,T]),K=n.useCallback((c,u)=>{const h=k(u);if(L(h)||h.status.type!=="uploading")return;const E=Math.round(c.loaded*100/c.total);h.status.progress!==E&&T(u,h.setStatus({type:"uploading",abortController:h.status.abortController,progress:E}))},[k,T]),Y=n.useCallback((c,u)=>{const h=new AbortController,E=new ie(u.name,u.size,j(),{type:"uploading",abortController:h,progress:1});X(E),d.uploadFile(e,c.uploadUrl,u,W=>K(W,E.id),h.signal).then(()=>J(E.id,c)).catch(W=>{W instanceof DOMException&&W.name==="AbortError"||T(E.id,E.setStatus({type:"error",errorMessage:W?W.toString():"Unknown error"}))})},[X,e,j,J,K,T,d]),Z=n.useCallback(c=>{const u=k(c);L(u)||(u.status.type==="uploading"&&u.status.abortController.abort(),u.status.type==="uploaded"&&u.status.fileUrls.deleteUrl&&d.deleteFile(u.status.fileUrls.deleteUrl),Q(c))},[k,Q,d]),ee=n.useCallback(c=>{if(c===null)return Promise.resolve();l(c),y(!0),x(!1);const u=h=>new Promise(E=>setTimeout(E,h));return nt(c,`camera-input-${new Date().toISOString().replace(/:/g,"_")}.jpg`).then(h=>d.fetchFileURLs([h]).then(E=>({file:h,fileUrls:E[0]}))).then(({file:h,fileUrls:E})=>Y(E,h)).then(()=>u(rt)).then(()=>{x(!0)}).catch(h=>{it.error(h)})},[d,Y]),ue=n.useCallback(c=>{ee(c)},[ee]),fe=n.useCallback(()=>{i.length!==0&&(i.forEach(c=>Z(c.id)),l(null),S(!0))},[i,Z]);n.useEffect(()=>{a.getFileUploaderStateValue(e)===void 0&&a.setFileUploaderStateValue(e,N(i),{fromUi:!1},v)},[]),n.useEffect(()=>{if(B!=="ready")return;const c=N(i),u=a.getFileUploaderStateValue(e);Ie(c,u)||a.setFileUploaderStateValue(e,c,{fromUi:!0},v)},[B,i,a,e,v]);const pe=n.useCallback(()=>{t([]),l(null);const c=N([]);a.setFileUploaderStateValue(e,c,{fromUi:!0},v)},[e,v,a]);return Te({element:e,widgetMgr:a,onFormCleared:pe}),O(se,{className:"stCameraInput","data-testid":"stCameraInput",ref:f,children:[U(_e,{label:e.label,disabled:g,labelVisibility:Fe(e.labelVisibility?.value),children:e.help&&U(Re,{content:e.help,label:e.label})}),s?O(Pe,{children:[U(G,{width:o,children:s!==ce&&U(Ae,{src:s,alt:"Snapshot",opacity:M||!C?"50%":"100%",width:o,height:o*9/16})}),U(le,{onClick:fe,progress:$,disabled:!!$||g,children:$?"Uploading...":O($e,{children:[U(q,{content:ae,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):U(tt,{handleCapture:ue,width:o,disabled:g,clearPhotoInProgress:w,setClearPhotoInProgress:S,facingMode:P,setFacingMode:de,testOverride:p})]})},ft=n.memo(at);export{ft as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,E as L,_ as k,F as p,ab as Ue,o as S,j as l,az as I,b as V,c as ve,B as M,h as ze,a0 as be,k as Ce,al as ee,bj as Ie,e as D,bX as Ee,p as Be,ac as De,ad as Le,bS as ke,bT as Ve}from"./index.CXVpBAvU.js";import{u as Me}from"./FormClearHelper.D4lty7rT.js";import{g as oe,F as R,a as Re,D as Ae,I as Pe,s as Ne,b as Te}from"./FileHelper.BOHlwlc9.js";import{S as qe,P as We}from"./ProgressBar.DCHh4N3P.js";import{U as $}from"./UploadFileInfo.Dr-zDST7.js";const He=e=>{const t=o.useRef();return o.useEffect(()=>{t.current=e},[e]),t.current};var ne=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(L,k({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z"}))});ne.displayName="ChevronLeft";var re=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(L,k({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z"}))});re.displayName="ChevronRight";var ae=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(L,k({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}))});ae.displayName="Clear";var le=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(L,k({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),o.createElement("path",{d:"M19.35 10.04A7.49 7.49 0 0012 4C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 000 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95A5.469 5.469 0 0112 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11A2.98 2.98 0 0122 15c0 1.65-1.35 3-3 3zM8 13h2.55v3h2.9v-3H16l-4-4z"}))});le.displayName="CloudUpload";var se=o.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(L,k({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),o.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}))});se.displayName="Error";const ie=p("section",{target:"e7fhruq0"})(({isDisabled:e,theme:t})=>({display:"flex",gap:t.spacing.lg,alignItems:"center",padding:t.spacing.lg,backgroundColor:t.colors.secondaryBg,borderRadius:t.radii.default,border:t.colors.widgetBorderColor?`${t.sizes.borderWidth} solid ${t.colors.widgetBorderColor}`:void 0,height:t.sizes.largestElementHeight,":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 1px ${t.colors.primary}`},cursor:e?"not-allowed":"pointer"})),$e=p("div",{target:"e7fhruq1"})(({theme:e})=>({marginRight:"auto",alignItems:"center",display:"flex",gap:e.spacing.lg,minWidth:0,width:"100%"})),ce=p("span",{target:"e7fhruq2"})(({theme:e})=>({color:e.colors.darkenedBgMix100})),de=p("span",{target:"e7fhruq3"})(({theme:e,disabled:t})=>({color:t?e.colors.fadedText40:e.colors.bodyText})),je=p("span",{target:"e7fhruq4"})(({theme:e,disabled:t})=>({fontSize:e.fontSizes.sm,color:t?e.colors.fadedText40:e.colors.fadedText60,display:"block",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",maxWidth:"100%"})),Xe=p("div",{target:"e7fhruq5"})({display:"flex",flexDirection:"column",minWidth:0,maxWidth:"100%"}),Oe=p("span",{target:"e7fhruq6"})({whiteSpace:"nowrap"}),pe=p("div",{target:"e7fhruq7"})(({theme:e})=>({left:0,right:0,lineHeight:e.lineHeights.tight,paddingTop:e.spacing.md,paddingLeft:e.spacing.lg,paddingRight:e.spacing.lg})),_e=p("ul",{target:"e7fhruq8"})(({theme:e})=>({listStyleType:"none",margin:e.spacing.none,padding:e.spacing.none})),ue=p("li",{target:"e7fhruq9"})(({theme:e})=>({margin:e.spacing.none,padding:e.spacing.none})),ge=p("div",{target:"e7fhruq10"})(({theme:e})=>({display:"flex",alignItems:"baseline",flex:1,paddingLeft:e.spacing.lg,overflow:"hidden"})),fe=p("div",{target:"e7fhruq11"})(({theme:e,disabled:t})=>({marginRight:e.spacing.sm,marginBottom:e.spacing.twoXS,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:t?e.colors.fadedText40:e.colors.bodyText})),he=p("div",{target:"e7fhruq12"})(({theme:e})=>({display:"flex",alignItems:"center",marginBottom:e.spacing.twoXS})),Ke=p("span",{target:"e7fhruq13"})(({theme:e})=>({marginRight:e.spacing.twoXS})),Ye=p("div",{target:"e7fhruq14"})(({theme:e,disabled:t})=>({display:"flex",padding:e.spacing.twoXS,color:t?e.colors.fadedText40:e.colors.darkenedBgMix100})),Fe=p("small",{target:"e7fhruq15"})(({theme:e})=>({color:e.colors.redTextColor,fontSize:e.fontSizes.sm,height:e.fontSizes.sm,lineHeight:e.fontSizes.sm,display:"flex",alignItems:"center",whiteSpace:"nowrap"})),me=p("span",{target:"e7fhruq16"})({}),Ge=e=>({[ie]:{display:"flex",flexDirection:"column",alignItems:"flex-start",height:"auto",gap:e.spacing.sm},[ce]:{display:"none"},[de]:{marginBottom:e.spacing.twoXS},[pe]:{paddingRight:e.spacing.lg},[he]:{maxWidth:"inherit",flex:1,alignItems:"flex-start",marginBottom:e.spacing.sm},[fe]:{width:e.sizes.full},[ge]:{flexDirection:"column"},[Fe]:{height:"auto",whiteSpace:"initial"},[me]:{display:"none"},[ue]:{margin:e.spacing.none,padding:e.spacing.none}}),Je=p("div",{target:"e7fhruq17"})(({theme:e,width:t})=>{if(t<Ue("23rem"))return Ge(e)}),Qe=({multiple:e,acceptedExtensions:t,maxSizeBytes:n,acceptDirectory:s=!1,disabled:d})=>{const x=()=>s?"directories":e?"files":"file",c=()=>t.length?` • ${t.map(y=>y.replace(/^\./,"").toUpperCase()).join(", ")}`:null,F=()=>`Limit ${oe(n,R.Byte,0)} per file`;return S($e,{"data-testid":"stFileUploaderDropzoneInstructions",children:[l(ce,{children:l(I,{content:le,size:"threeXL"})}),S(Xe,{children:[S(de,{disabled:d,children:["Drag and drop ",x()," here"]}),S(je,{disabled:d,children:[F(),c()]})]})]})},Ze=o.memo(Qe),et=({onDrop:e,multiple:t,acceptedExtensions:n,maxSizeBytes:s,disabled:d,label:x,acceptDirectory:c=!1})=>l(Ae,{onDrop:e,multiple:t,accept:Re(n),maxSize:s,disabled:d,useFsAccessApi:!1,children:({getRootProps:F,getInputProps:y})=>{const v=y({multiple:t||!!c});return S(ie,{...F(),"data-testid":"stFileUploaderDropzone",isDisabled:d,"aria-label":x,"aria-disabled":d,children:[l("input",{"data-testid":"stFileUploaderDropzoneInput",...v,...c&&{webkitdirectory:""}}),l(Ze,{multiple:t,acceptedExtensions:n,maxSizeBytes:s,acceptDirectory:c,disabled:d}),l(Oe,{children:l(V,{kind:M.SECONDARY,disabled:d,size:ve.SMALL,children:c?"Browse directories":"Browse files"})})]})}}),tt=o.memo(et),ye=p("small",{target:"e1xq3mgd0"})(({kind:e,disabled:t,theme:n})=>{const{redTextColor:s,fadedText60:d,fadedText40:x}=n.colors;let c=d;return t&&(c=x),e==="danger"&&(c=s),{color:c,fontSize:n.fontSizes.sm,lineHeight:n.lineHeights.tight}}),ot=({fileInfo:e,disabled:t})=>e.status.type==="uploading"?l(We,{value:e.status.progress,size:qe.SMALL}):e.status.type==="error"?S(Fe,{children:[l(Ke,{"data-testid":"stFileUploaderFileErrorMessage",children:e.status.errorMessage}),l(me,{children:l(I,{content:se,size:"lg"})})]}):e.status.type==="uploaded"?l(ye,{disabled:t,children:oe(e.size,R.Byte)}):null,nt=({fileInfo:e,onDelete:t,disabled:n})=>S(he,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[l(Ye,{disabled:n,children:l(I,{content:Pe,size:"twoXL"})}),S(ge,{className:"stFileUploaderFileData",children:[l(fe,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:e.name,disabled:n,children:e.name}),l(ot,{fileInfo:e,disabled:n})]}),l("div",{"data-testid":"stFileUploaderDeleteBtn",children:l(V,{onClick:()=>t(e.id),kind:M.MINIMAL,disabled:n,"aria-label":`Remove ${e.name}`,children:l(I,{content:ae,size:"lg"})})})]}),rt=o.memo(nt),at=p("div",{target:"e1o0u1j0"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:e.spacing.twoXS,marginBottom:e.spacing.twoXS})),lt=p("div",{target:"e1o0u1j1"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",color:e.colors.fadedText40})),st=({currentPage:e,totalPages:t,onNext:n,onPrevious:s})=>S(at,{"data-testid":"stFileUploaderPagination",children:[l(ye,{children:`Showing page ${e} of ${t}`}),S(lt,{children:[l(V,{onClick:s,kind:M.MINIMAL,children:l(I,{content:ne,size:"xl"})}),l(V,{onClick:n,kind:M.MINIMAL,children:l(I,{content:re,size:"xl"})})]})]}),it=o.memo(st),te=(e,t)=>Math.ceil(e.length/t),ct=e=>ze(({pageSize:n,items:s,resetOnAdd:d,...x})=>{const[c,F]=o.useState(0),[y,v]=o.useState(()=>te(s,n)),u=He(s);o.useEffect(()=>{u&&u.length!==s.length&&v(te(s,n)),u&&u.length<s.length?d&&F(0):c+1>=y&&F(y-1)},[s,c,n,u,d,y]);const E=()=>{F(Math.min(c+1,y-1))},z=()=>{F(Math.max(0,c-1))},A=s.slice(c*n,c*n+n);return S(be,{children:[l(e,{items:A,...x}),s.length>n?l(it,{pageSize:n,totalPages:y,currentPage:c+1,onNext:E,onPrevious:z}):null]})},e),dt=({items:e,onDelete:t,disabled:n})=>l(_e,{children:e.map(s=>l(ue,{children:l(rt,{fileInfo:s,onDelete:t,disabled:n})},s.id))}),pt=ct(dt),ut=e=>l(pe,{children:l(pt,{...e})}),gt=o.memo(ut),ft=(e,t)=>{const n=t.getFileUploaderStateValue(e);if(D(n))return{files:[],nextLocalId:1};const{uploadedFileInfo:s}=n;if(D(s)||s.length===0)return{files:[],nextLocalId:1};let d=1;return{files:s.map(c=>{const F=c.name,y=c.size,v=c.fileId,u=c.fileUrls,E=new $(F,y,d,{type:"uploaded",fileId:v,fileUrls:u});return d+=1,E}),nextLocalId:d}},H=e=>{const t=e.filter(n=>n.status.type==="uploaded").map(n=>{const{name:s,size:d,status:x}=n,{fileId:c,fileUrls:F}=x;return new ke({fileId:c,fileUrls:F,name:s,size:d})});return new Ve({uploadedFileInfo:t})},ht=({disabled:e,element:t,widgetMgr:n,uploadClient:s,fragmentId:d})=>{const{width:x,elementRef:c}=Ce(),{files:F,nextLocalId:y}=o.useMemo(()=>ft(t,n),[t,n]),v=o.useRef(y),[u,E]=o.useState(()=>F),z=o.useRef(u);o.useEffect(()=>{z.current=u},[u]);const[A,j]=o.useState(!1),B=o.useCallback(()=>{const r=v.current;return v.current+=1,r},[]),P=o.useMemo(()=>{const r=t.maxUploadSizeMb;return Ne(r,R.Megabyte,R.Byte)},[t.maxUploadSizeMb]),U=o.useCallback(r=>{ee.flushSync(()=>{E(a=>{const i=typeof r=="function"?r(a):r;return z.current=i,i})})},[]),N=o.useCallback(r=>{ee.flushSync(()=>{j(r)})},[j]),X=o.useCallback(r=>{U(a=>[...a,r])},[U]),T=o.useCallback(r=>{r.length!==0&&U(a=>[...a,...r])},[U]),O=o.useCallback(r=>{U(a=>a.filter(i=>i.id!==r))},[U]),b=o.useCallback((r,a)=>{U(i=>i.map(g=>g.id===r?a:g))},[U]),C=o.useCallback(r=>z.current.find(a=>a.id===r),[]),_=u.some(r=>r.status.type==="uploading")||A?"updating":"ready";o.useEffect(()=>{n.getFileUploaderStateValue(t)===void 0&&n.setFileUploaderStateValue(t,H(z.current),{fromUi:!1},d)},[n,t,d]),o.useEffect(()=>{if(_!=="ready")return;const r=H(u),a=n.getFileUploaderStateValue(t);Ie(r,a)||n.setFileUploaderStateValue(t,r,{fromUi:!0},d)},[_,u,n,t,d]);const xe=o.useCallback(()=>{U(()=>[]);const r=H([]);n.setFileUploaderStateValue(t,r,{fromUi:!0},d)},[t,d,U,n]);Me({element:t,widgetMgr:n,onFormCleared:xe});const K=o.useCallback(r=>{const a=t.type;if(!a||a.length===0)return!0;const i=r.name.toLowerCase();return a.some(g=>i.endsWith(g.toLowerCase()))},[t.type]),Y=o.useCallback(r=>{const a=[],i=[];return r.forEach(g=>{K(g)?a.push(g):i.push({file:g,errors:[{code:"file-invalid-type",message:`${g.type} files are not allowed.`}]})}),{accepted:a,rejected:i}},[K]),G=o.useCallback((r,a)=>{const i=C(r);D(i)||i.status.type!=="uploading"||b(i.id,i.setStatus({type:"uploaded",fileId:a.fileId,fileUrls:a}))},[C,b]),J=o.useCallback((r,a)=>{const i=C(a);if(D(i)||i.status.type!=="uploading")return;const g=Math.round(r.loaded*100/r.total);i.status.progress!==g&&b(a,i.setStatus({type:"uploading",abortController:i.status.abortController,progress:g}))},[C,b]),Q=o.useCallback((r,a)=>{const i=new AbortController,g=a.webkitRelativePath||a.name,f=new $(g,a.size,B(),{type:"uploading",abortController:i,progress:1});X(f),s.uploadFile(t,r.uploadUrl,a,h=>J(h,f.id),i.signal).then(()=>G(f.id,r)).catch(h=>{h instanceof DOMException&&h.name==="AbortError"||b(f.id,f.setStatus({type:"error",errorMessage:h?h.toString():"Unknown error"}))})},[X,t,B,G,J,b,s]),q=o.useCallback(r=>{if(e)return;const a=C(r);D(a)||(a.status.type==="uploading"&&a.status.abortController.abort(),a.status.type==="uploaded"&&a.status.fileUrls.deleteUrl&&s.deleteFile(a.status.fileUrls.deleteUrl),O(r))},[e,C,O,s]),Se=o.useCallback((r,a)=>{const{multipleFiles:i}=t,g=!!t.acceptDirectory;let f=[...r],h=[...a];if(g&&f.length>0){const{accepted:w,rejected:m}=Y(f);f=w,h=[...h,...m]}if(!i&&f.length===0&&h.length>1){const w=h.findIndex(m=>m.errors.length===1&&m.errors[0].code==="too-many-files");w>=0&&(f.push(h[w].file),h.splice(w,1))}if(s.fetchFileURLs(f).then(w=>{if(!i&&f.length>0){const m=z.current.find(W=>W.status.type!=="error");if(m){N(!0);try{q(m.id)}finally{N(!1)}}}Ee(w,f).forEach(([m,W])=>{Q(m,W)})}).catch(w=>{T(f.map(m=>new $(m.name,m.size,B(),{type:"error",errorMessage:w})))}),h.length>0){const w=h.map(m=>Te(m,B(),P));T(w)}},[T,q,t,Y,P,B,s,Q,N]),Z=o.useMemo(()=>u.slice().reverse(),[u]),we=t.type;return S(Je,{className:"stFileUploader","data-testid":"stFileUploader",width:x,ref:c,children:[l(Le,{label:t.label,disabled:e,labelVisibility:Be(t.labelVisibility?.value),children:t.help&&l(De,{content:t.help,label:t.label})}),l(tt,{onDrop:Se,multiple:t.multipleFiles,acceptedExtensions:we,maxSizeBytes:P,label:t.label,disabled:e,acceptDirectory:!!t.acceptDirectory}),Z.length>0&&l(gt,{items:Z,pageSize:3,onDelete:q,resetOnAdd:!0,disabled:e})]})},wt=o.memo(ht);export{wt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as c,ai as d,aj as C,c as t,r as a,B as l,j as n,u as x,a as S,D as L,d as $}from"./index.CXVpBAvU.js";import{m as R}from"./iconPosition.DPAvXTmd.js";function T(o,r){switch(o){case t.XSMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.sm}`,fontSize:r.fontSizes.sm};case t.SMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.md}`};case t.LARGE:return{padding:`${r.spacing.md} ${r.spacing.md}`};default:return{padding:`${r.spacing.xs} ${r.spacing.md}`}}}const f=c("a",{target:"e8hm1sp0"})(({containerWidth:o,size:r,theme:i})=>({display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:i.fontWeights.normal,padding:`${i.spacing.xs} ${i.spacing.md}`,borderRadius:i.radii.button,minHeight:i.sizes.minElementHeight,margin:0,lineHeight:i.lineHeights.base,color:i.colors.primary,textDecoration:"none",width:o?"100%":"auto",userSelect:"none","&:visited":{color:i.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:C(i)},"&:hover":{textDecoration:"none"},"&:active":{textDecoration:"none"},...T(r,i)})),w=c(f,{target:"e8hm1sp1"})(({theme:o})=>({backgroundColor:o.colors.primary,color:o.colors.white,border:`${o.sizes.borderWidth} solid ${o.colors.primary}`,"&:hover, &:focus-visible":{backgroundColor:d(o.colors.primary,.15),borderColor:d(o.colors.primary,.15)},"&:active":{backgroundColor:o.colors.primary,borderColor:d(o.colors.primary,.15)},"&:visited:not(:active)":{color:o.colors.white},"&[disabled], &[disabled]:hover, &[disabled]:active, &[disabled]:visited":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),A=c(f,{target:"e8hm1sp2"})(({theme:o})=>({backgroundColor:o.colors.lightenedBg05,color:o.colors.bodyText,border:`${o.sizes.borderWidth} solid ${o.colors.borderColor}`,"&:visited":{color:o.colors.bodyText},"&:hover, &:focus-visible":{backgroundColor:o.colors.darkenedBgMix15},"&:active":{backgroundColor:o.colors.darkenedBgMix25},"&[disabled], &[disabled]:hover, &[disabled]:active":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),z=c(f,{target:"e8hm1sp3"})(({theme:o})=>({padding:o.spacing.none,backgroundColor:o.colors.transparent,color:o.colors.bodyText,border:"none","&:visited":{color:o.colors.bodyText},"&:hover, &:focus-visible":{color:o.colors.primary},"&:hover:not([disabled]), &:focus-visible:not([disabled])":{"span.stMarkdownColoredText":{color:"inherit !important"}},"&:active":{color:d(o.colors.primary,.25)},"&[disabled], &[disabled]:hover, &[disabled]:active":{backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),y=a.forwardRef(function({kind:r,size:i,disabled:s,children:e,autoFocus:u,href:b,rel:p,target:B,onClick:k},v){let g=w;return r===l.SECONDARY?g=A:r===l.TERTIARY&&(g=z),n(g,{ref:v,kind:r,size:i||t.MEDIUM,containerWidth:!0,disabled:s||!1,autoFocus:u||!1,href:b,target:B,rel:p,onClick:k,tabIndex:s?-1:0,"data-testid":`stBaseLinkButton-${r}`,children:e})});y.displayName="BaseLinkButton";const D=a.memo(y);function M(o){const{element:r}=o,i=r.shortcut?r.shortcut:void 0;let s=l.SECONDARY;r.type==="primary"?s=l.PRIMARY:r.type==="tertiary"&&(s=l.TERTIARY);const e=a.useRef(null),u=a.useCallback(()=>{r.disabled||e.current?.click()},[r.disabled]),b=a.useCallback(p=>{r.disabled&&p.preventDefault()},[r.disabled]);return x({shortcut:i,disabled:r.disabled,onActivate:u}),n($,{className:"stLinkButton","data-testid":"stLinkButton",children:n(S,{help:r.help,containerWidth:!0,children:n(D,{ref:e,kind:s,size:t.SMALL,disabled:r.disabled,onClick:b,href:r.url,target:"_blank",rel:"noreferrer","aria-disabled":r.disabled,children:n(L,{icon:r.icon,iconPosition:R(r.iconPosition),label:r.label,shortcut:i})})})})}const P=a.memo(M);export{P as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,E as B,_ as X,l as $,e as L,R as Q,Q as K,bf as j,bg as z,bh as Y,bi as Z,n as k,bj as M,W as P,X as q,k as ee,ba as te,bk as ne,j as A,o as re,b3 as se}from"./index.CXVpBAvU.js";import{w as oe,E as ae}from"./withFullScreenWrapper.Cw_ebNmr.js";import{a as _,S as H,T as ce}from"./Toolbar.guIuiwEF.js";import{R as ie}from"./index.tLZuZM89.js";import{a as J,c as le,b as ue,e as fe,t as de,S as me,d as pe}from"./embed.CqzzUq73.js";import{u as he}from"./FormClearHelper.D4lty7rT.js";import{T as ge}from"./TableChart.esm.7KFX5I_G.js";import"./moment.C7qA8nIE.js";import"./pandasStylerUtils.Dej3Tstq.js";import"./numbro.B9_PXfzp.js";import"./_baseIndexOf.BTknn6Gb.js";import"./index.8HslT92O.js";import"./main.BE-siVKv.js";import"./throttle.gZUdtYp7.js";import"./formatNumber.CT_v8e75.js";import"./sprintf.DpPCfzXw.js";import"./formatMoment.C6Hwn6X5.js";import"./checkbox.Bs20OTna.js";import"./createDownloadLinkElement.DSqCyu38.js";import"./toConsumableArray.CcKcKvEd.js";import"./FileDownload.esm.C6tTTniR.js";import"./_arrayIncludes.B19Iyn2B.js";import"./threshold.CUNQbqMA.js";import"./value.DaKxGC7O.js";import"./timer.BZio6gjG.js";var U=a.forwardRef(function(n,e){var s={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(B,X({iconAttrs:s,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:e}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM7 10h2v7H7zm4-3h2v10h-2zm4 6h2v4h-2z"}))});U.displayName="InsertChart";const Se=20;function ye(n){"params"in n&&"encoding"in n&&n.params.forEach(e=>{"select"in e&&(["interval","point"].includes(e.select)&&(e.select={type:e.select}),"type"in e.select&&e.select.type==="point"&&!("encodings"in e.select)&&L(e.select.encodings)&&(e.select.encodings=Object.keys(n.encoding)))})}const be=(n,e,s,r,u,l,f,p)=>{const t=JSON.parse(n);if(r==="streamlit"?t.config=J(t.config,l):t.usermeta?.embedOptions?.theme==="streamlit"?(t.config=J(t.config,l),t.usermeta.embedOptions.theme=void 0):t.config=le(t.config,l),t.title&&(typeof t.title=="string"&&(t.title={text:t.title}),t.title.limit=t.title.limit??Math.max(f-40,0)),s&&(t.height=p),e&&(t.width=f,"vconcat"in t&&t.vconcat.forEach(o=>{o===null||typeof o!="object"||"hconcat"in o||"vconcat"in o||"concat"in o||"layer"in o||(o.width=f)})),t.padding||(t.padding={}),L(t.padding.bottom)&&(t.padding.bottom=Se),t.datasets)throw new Error("Datasets should not be passed as part of the spec");return u.length>0&&ye(t),t},we=(n,e,s,r,u)=>{const l=$(),{id:f,formId:p,spec:t,data:o,datasets:c,vegaLiteTheme:d,selectionMode:i}=n,h=a.useMemo(()=>i,[JSON.stringify(i)]),S=a.useMemo(()=>be(t,r,u,d,h,l,e,s),[t,r,u,d,h,l,e,s]);return{id:f,formId:p,vegaLiteTheme:d,spec:S,selectionMode:h,data:o,datasets:c,useContainerWidth:r}},Ce={DATAFRAME_INDEX:"(index)"};function Ee(n){return!n||n.dimensions.numDataRows===0?null:F(n)}function Ne(n){const e=I(n);if(L(e))return null;const s={};for(const[r,u]of Object.entries(e))s[r]=F(u);return s}function I(n){if(n?.length===0)return null;const e={};return n.forEach(s=>{if(!s)return;const r=s.hasName?s.name:null;e[r]=s.data}),e}function F(n,e=0){if(n.dimensions.numDataRows===0)return[];const s=[],{numDataRows:r,numDataColumns:u,numIndexColumns:l}=n.dimensions,f=n.columnTypes[0]??void 0,p=f?.type===Q.INDEX&&(K(f)||j(f)||z(f));for(let t=e;t<r;t++){const o={};if(p){const{content:c}=n.getCell(t,0);o[Ce.DATAFRAME_INDEX]=typeof c=="bigint"?Number(c):c}for(let c=0;c<u;c++){const d=c+l,{content:i,contentType:h}=n.getCell(t,d);if((i instanceof Date||typeof i=="number"&&Number.isFinite(i))&&(j(h)||z(h))&&!Y(h)){const S=new Date(i).getTimezoneOffset()*60*1e3;o[n.columnNames[0][d]]=i.valueOf()+S}else o[n.columnNames[0][d]]=typeof i=="bigint"?Number(i):i}s.push(o)}return s}const De=150,Ve=P.getLogger("useVegaLiteSelections"),Oe=(n,e,s)=>{const{id:r,formId:u,selectionMode:l}=n,f=a.useCallback(t=>{l.forEach(c=>{t.addSignalListener(c,Z(De,(d,i)=>{const h=t.getState({data:(E,v)=>l.some(g=>`${g}_store`===E),recurse:!1});k(h)&&e.setElementState(r,"viewState",h);let S=i;"vlPoint"in i&&"or"in i.vlPoint&&(S=i.vlPoint.or);const V={id:r,formId:u},N=JSON.parse(e.getStringValue(V)||"{}"),D={selection:{...N?.selection||{},[d]:S||{}}};M(N,D)||e.setStringValue(V,JSON.stringify(D),{fromUi:!0},s)}))});const o=e.getElementState(r,"viewState");if(k(o))try{return t.setState(o)}catch(c){Ve.warn("Failed to restore view state",c)}return t},[r,l,e,u,s]),p=a.useCallback(()=>{const t={selection:{}};l.forEach(i=>{t.selection[i]={}});const o={id:r,formId:u},c=e.getStringValue(o),d=c?JSON.parse(c):t;M(d,t)||e.setStringValue(o,JSON.stringify(t),{fromUi:!0},s)},[r,u,s,l,e]);return{maybeConfigureSelections:f,onFormCleared:p}},W="source",Te=P.getLogger("useVegaEmbed");function ve(n,e,s){const r=a.useRef(null),u=a.useRef(null),l=a.useRef(W),f=a.useRef(null),p=a.useRef([]),t=a.useRef(null),o=a.useRef([]),[c,d]=a.useState(!1),{maybeConfigureSelections:i,onFormCleared:h}=Oe(n,e,s);he({widgetMgr:e,element:n,onFormCleared:h});const{data:S,datasets:V}=n;a.useEffect(()=>{t.current=S,o.current=V,r.current===null&&(f.current=S,p.current=V)},[S,V]);const N=a.useCallback(()=>{u.current&&u.current(),u.current=null,r.current=null},[]),D=a.useCallback(async(g,b)=>{if(g.current===null)throw new Error("Element missing.");d(!0);try{N();const w={ast:!0,expr:ue,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,forceActionsMenu:!0},{vgSpec:y,view:R,finalize:T}=await fe(g.current,b,w);r.current=i(R),u.current=T;const m=Ne(o.current),C=m?Object.keys(m):[];if(C.length===1){const[x]=C;l.current=x}else C.length===0&&y.data&&(l.current=W);const O=Ee(t.current);if(O&&r.current.insert(l.current,O),m)for(const[x,G]of Object.entries(m))r.current.insert(x,G);return await r.current.runAsync(),await r.current.resize().runAsync(),f.current=t.current,p.current=o.current,r.current}finally{d(!1)}},[N,i]),E=a.useCallback((g,b,w,y)=>{if(!y||y.dimensions.numDataRows===0){try{g.remove(b,de)}catch{}return}if(!w||w.dimensions.numDataRows===0){g.insert(b,F(y));return}y.hash!==w.hash&&(g.data(b,F(y)),Te.info(`Had to clear the ${b} dataset before inserting data through Vega view.`))},[]),v=a.useCallback(async(g,b)=>{if(r.current===null||c)return null;const w=f.current,y=p.current;(w||g)&&E(r.current,l.current,w,g);const R=I(y)??{},T=I(b)??{};for(const[m,C]of Object.entries(T)){const O=m||l.current,x=R[O];E(r.current,O,x,C)}for(const m of Object.keys(R))!Object.hasOwn(T,m)&&m!==l.current&&E(r.current,m,null,null);return await r.current?.resize().runAsync(),f.current=g,p.current=b,r.current},[E,c]);return{createView:D,updateView:v,finalizeView:N}}function Re(n){try{const e=typeof n=="string"?JSON.parse(n):n;return!!(e.facet||e.encoding?.row||e.encoding?.column||e.encoding?.facet)}catch{return!1}}function Ae(n){try{const e=typeof n=="string"?JSON.parse(n):n;return!("vconcat"in e)||!Array.isArray(e.vconcat)?!1:e.vconcat.some(s=>s!==null&&typeof s=="object"&&("hconcat"in s||"vconcat"in s||"concat"in s||"layer"in s))}catch{return!1}}const xe=({disableFullscreenMode:n,element:e,fragmentId:s,widgetMgr:r,widthConfig:u,heightConfig:l})=>{const[f,p]=a.useState(!1),[t,o]=a.useState(!1),{expanded:c,height:d,width:i,expand:h,collapse:S}=q(ae),{width:V,height:N,elementRef:D}=ee([f],0),E=te(u)||e.useContainerWidth,v=ne(l),g=Re(e.spec),b=Ae(e.spec),w=we(e,g?i??0:V,(c?d:N)??0,c&&!b?!0:E,c?!0:v),{createView:y,updateView:R,finalizeView:T}=ve(w,r,s),{data:m,datasets:C,spec:O}=w;return a.useLayoutEffect(()=>(D.current!==null&&y(D,O),T),[y,T,O,i,d,f,D]),a.useEffect(()=>{R(m,C)},[m,C]),a.useEffect(()=>{m||C?.[0]?.data?o(!0):o(!1)},[m,C]),f?A(ie,{data:m??C[0]?.data,height:d??N??void 0,width:u??void 0,customToolbarActions:[A(_,{label:"Show chart",icon:U,onClick:()=>{p(!1)}},"show-chart")]}):re(H,{height:v?c?d:"100%":d,useContainerWidth:c?!0:E,children:[A(ce,{target:H,isFullScreen:c,onExpand:h,onCollapse:S,disableFullscreenMode:n,children:t&&A(_,{label:"Show data",icon:ge,onClick:()=>{p(!0)}})}),A(se,{styles:[me]}),A(pe,{"data-testid":"stVegaLiteChart",className:"stVegaLiteChart",useContainerWidth:E,useContainerHeight:v,ref:D})]})},Fe=oe(xe),st=a.memo(Fe);export{me as StyledVegaLiteChartTooltips,J as applyStreamlitTheme,st as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{F as f,aj as S,r as s,l as b,aK as y,j as l,aL as x,ay as R,o as h,m as T,Z as v,aM as B,aN as E,aO as j}from"./index.CXVpBAvU.js";import{l as k}from"./index.8HslT92O.js";import{R as J}from"./main.BE-siVKv.js";const w=f("div",{target:"e1l93qjt0"})(({theme:o})=>({overflowY:"auto",position:"relative",".react-json-view .copy-icon svg":{fontSize:"1em !important",marginRight:`${o.spacing.threeXS} !important`,verticalAlign:"middle !important"}})),L=f("div",{target:"e1l93qjt1"})(({theme:o})=>({display:"flex",alignItems:"center",gap:o.spacing.sm,padding:o.spacing.sm,paddingLeft:o.spacing.md,fontFamily:o.genericFonts.codeFont,fontSize:o.fontSizes.twoSm,color:o.colors.bodyText,maxWidth:"90vw",wordBreak:"break-all"})),P=f("button",{target:"e1l93qjt2"})(({theme:o})=>({display:"flex",alignItems:"center",justifyContent:"center",padding:o.spacing.threeXS,backgroundColor:"transparent",border:"none",borderRadius:o.radii.md,cursor:"pointer",color:o.colors.fadedText60,transition:"color 0.15s ease, background-color 0.15s ease","&:hover":{backgroundColor:o.colors.darkenedBgMix15,color:o.colors.bodyText},"&:active":{backgroundColor:o.colors.darkenedBgMix25},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:S(o)}})),$=f("div",{target:"e1l93qjt3"})(({top:o,left:e})=>({position:"fixed",top:o,left:e}));function I({top:o,left:e,path:t,clearTooltip:d}){const[p,n]=s.useState(!0),r=b(),{colors:i,radii:a}=r,{isCopied:c,copyToClipboard:u,label:m}=y(),g=s.useCallback(()=>{n(!1),d()},[d]),C=s.useCallback(()=>{u(t)},[u,t]);return l(B,{content:h(L,{"data-testid":"stJsonPathTooltip",children:[l("code",{children:t}),l(P,{onClick:C,title:m,"aria-label":m,autoFocus:!0,children:l(v,{size:"sm",iconValue:c?":material/check:":":material/content_copy:"})})]}),placement:R.top,accessibilityType:x.tooltip,showArrow:!1,popoverMargin:15,onClickOutside:g,onEsc:g,overrides:{Body:{style:{borderTopLeftRadius:a.default,borderTopRightRadius:a.default,borderBottomLeftRadius:a.default,borderBottomRightRadius:a.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:T(r)?i.bgColor:i.secondaryBg,color:i.bodyText,borderTopLeftRadius:a.default,borderTopRightRadius:a.default,borderBottomLeftRadius:a.default,borderBottomRightRadius:a.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:p,children:l($,{"data-testid":"stJsonPathTooltipTarget",top:o,left:e})})}const F=s.memo(I);function z(o){return o.length===0?"$":o.reduce((e,t,d)=>{if(t===null)return e;if(/^\d+$/.test(t))return`${e}[${t}]`;if(t===""||/[^a-zA-Z0-9_$]/.test(t)||/^\d/.test(t)){const r=t.replace(/\\/g,"\\\\").replace(/"/g,'\\"');return`${e}["${r}"]`}return d===0||e===""?t:`${e}.${t}`},"")}function O(){const[o,e]=s.useState(null),t=s.useRef({x:0,y:0});s.useEffect(()=>{const n=r=>{t.current={x:r.clientX,y:r.clientY}};return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[]);const d=s.useCallback(n=>{const{x:r,y:i}=t.current,a=[...n.namespace,n.name],c=z(a);e({path:c,x:r,y:i})},[]),p=s.useCallback(()=>{e(null)},[]);return{tooltip:o,handleSelect:d,clearTooltip:p}}function A({element:o}){const e=b(),{tooltip:t,handleSelect:d,clearTooltip:p}=O(),{copyToClipboard:n}=y(),r=s.useCallback(c=>{n(JSON.stringify(c.src))},[n]);let i;try{i=JSON.parse(o.body)}catch(c){const u=E(c);try{i=k.parse(o.body)}catch{const g=parseInt(u.message.replace(/[^0-9]/g,""),10);return u.message+=`
|
|
2
|
-
${o.body.substring(0,g+1)} ← here`,l(j,{name:"Json Parse Error",message:u.message})}}const a=T(e)?"rjv-default":"monokai";return h(w,{className:"stJson","data-testid":"stJson",children:[l(J,{src:i,collapsed:o.maxExpandDepth??!o.expanded,displayDataTypes:!1,displayObjectSize:!1,name:!1,theme:a,enableClipboard:r,onSelect:d,style:{fontFamily:e.genericFonts.codeFont,fontSize:e.fontSizes.codeFontSize,fontWeight:e.fontWeights.code,backgroundColor:e.colors.bgColor,whiteSpace:"pre-wrap"}}),t&&l(F,{top:t.y,left:t.x,path:t.path,clearTooltip:p})]})}const D=s.memo(A);export{D as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as m,l as x,m as C,j as s,o as T,p as y,q as S,P as L,t as W,v as B,C as w,w as R}from"./index.CXVpBAvU.js";import{W as E}from"./WidgetLabelHelpIconInline.CzodezAH.js";import{u as P}from"./useBasicWidgetState.D-fc_aIL.js";import{S as v,L as $,a as u}from"./checkbox.Bs20OTna.js";import"./FormClearHelper.D4lty7rT.js";function M({element:o,disabled:a,widgetMgr:n,fragmentId:d}){const[p,g]=P({getStateFromWidgetMgr:X,getDefaultStateFromProto:H,getCurrStateFromProto:V,updateWidgetMgrState:F,element:o,widgetMgr:n,fragmentId:d}),f=m.useCallback(i=>{g({value:i.target.checked,fromUi:!0})},[g]),t=x(),{colors:e,spacing:h,sizes:r}=t,b=C(t),k=a?e.fadedText40:e.bodyText;return s(R,{className:"row-widget stCheckbox","data-testid":"stCheckbox",children:s(v,{checked:p,disabled:a,onChange:f,"aria-label":o.label,checkmarkType:o.type===w.StyleType.TOGGLE?u.toggle:u.default,labelPlacement:$.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:h.none,marginTop:h.none,backgroundColor:i?e.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Toggle:{style:({$checked:i})=>{let c=b?e.bgColor:e.bodyText;return a&&(c=b?e.gray70:e.gray90),{width:`calc(${r.checkbox} - ${t.spacing.twoXS})`,height:`calc(${r.checkbox} - ${t.spacing.twoXS})`,transform:i?`translateX(${r.checkbox})`:"",backgroundColor:c,boxShadow:""}}},ToggleTrack:{style:({$checked:i,$isHovered:c})=>{let l=e.borderColor;return c&&!a&&(l=e.darkenedBgMix15),i&&!a&&(l=e.primary),{marginRight:0,marginLeft:0,marginBottom:0,marginTop:t.spacing.twoXS,paddingLeft:t.spacing.threeXS,paddingRight:t.spacing.threeXS,width:`calc(2 * ${r.checkbox})`,minWidth:`calc(2 * ${r.checkbox})`,height:r.checkbox,minHeight:r.checkbox,borderBottomLeftRadius:t.radii.full,borderTopLeftRadius:t.radii.full,borderBottomRightRadius:t.radii.full,borderTopRightRadius:t.radii.full,backgroundColor:l}}},Checkmark:{style:({$isFocusVisible:i,$checked:c})=>{const l=c&&!a?e.primary:e.borderColor;return{outline:0,width:r.checkbox,height:r.checkbox,marginTop:t.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&c?B(e.primary):"",borderLeftWidth:r.borderWidth,borderRightWidth:r.borderWidth,borderTopWidth:r.borderWidth,borderBottomWidth:r.borderWidth,borderLeftColor:l,borderRightColor:l,borderTopColor:l,borderBottomColor:l}}},Label:{style:{lineHeight:t.lineHeights.small,paddingLeft:t.spacing.sm,position:"relative",color:k}}},children:T(W,{visibility:y(o.labelVisibility?.value),"data-testid":"stWidgetLabel",children:[s(S,{source:o.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),o.help&&s(E,{content:o.help,placement:L.TOP_RIGHT,label:o.label})]})})})}function X(o,a){return o.getBoolValue(a)}function H(o){return o.default??null}function V(o){return o.value??null}function F(o,a,n,d){a.setBoolValue(o,n.value,{fromUi:n.fromUi},d)}const A=m.memo(M);export{A as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as p,N as o,r as C,O as N,o as g,j as s,Q as u,q as T,R as m}from"./index.CXVpBAvU.js";import{g as A,a as L,f as w}from"./pandasStylerUtils.Dej3Tstq.js";import"./moment.C7qA8nIE.js";import"./numbro.B9_PXfzp.js";import"./_baseIndexOf.BTknn6Gb.js";const x=p("div",{target:"e10e2fxn0"})(({theme:e})=>({fontSize:e.fontSizes.md,fontFamily:e.genericFonts.bodyFont,lineHeight:e.lineHeights.small,captionSide:"bottom"})),h=p("div",{target:"e10e2fxn1"})(({theme:e})=>({fontFamily:e.genericFonts.bodyFont,fontSize:e.fontSizes.sm,paddingTop:e.spacing.sm,paddingBottom:0,color:e.colors.fadedText60,textAlign:"left",wordWrap:"break-word",display:"inline-block"})),M=p("div",{target:"e10e2fxn2"})(({theme:e,borderMode:t})=>({border:t===o.BorderMode.ALL?`${e.sizes.borderWidth} solid ${e.colors.dataframeBorderColor}`:"none",borderRadius:e.radii.default,overflow:"auto"})),O=p("table",{target:"e10e2fxn3"})(({theme:e})=>({width:e.sizes.full,color:e.colors.bodyText,borderSpacing:0})),S=(e,t=o.BorderMode.ALL)=>({borderBottom:t!==o.BorderMode.NONE?`${e.sizes.borderWidth} solid ${e.colors.dataframeBorderColor}`:"none","tbody tr:last-child &":{borderBottom:t===o.BorderMode.ALL||t===o.BorderMode.HORIZONTAL?"none":void 0},borderRight:t===o.BorderMode.ALL?`${e.sizes.borderWidth} solid ${e.colors.dataframeBorderColor}`:"none","&:last-child":{borderRight:t===o.BorderMode.ALL?"none":void 0,paddingRight:t===o.BorderMode.NONE?"0":e.spacing.xs},verticalAlign:"middle",padding:`${e.spacing.twoXS} ${e.spacing.xs}`,"&:not(:first-of-type)":{paddingLeft:t===o.BorderMode.NONE||t===o.BorderMode.HORIZONTAL?e.spacing.lg:e.spacing.xs},"&:first-of-type":{paddingLeft:t===o.BorderMode.NONE?"0":e.spacing.xs},fontWeight:e.fontWeights.normal}),b=p("td",{target:"e10e2fxn4"})(({theme:e,borderMode:t})=>S(e,t)),B=p("th",{target:"e10e2fxn5"})(({theme:e,borderMode:t})=>({...S(e,t),textAlign:"inherit",color:e.colors.fadedText60,"&:first-of-type":{paddingLeft:t===o.BorderMode.NONE?"0":e.spacing.sm},"&:not(:first-of-type)":{paddingLeft:t===o.BorderMode.NONE||t===o.BorderMode.HORIZONTAL?e.spacing.lg:e.spacing.sm}})),R=p(b,{target:"e10e2fxn6"})(({theme:e})=>({color:e.colors.gray70,fontStyle:"italic",fontSize:e.fontSizes.md,textAlign:"center"}));function H(e){const t=e.data,{cssId:l,cssStyles:r,caption:d}=t.styler??{},{numHeaderRows:f,numDataRows:c,numColumns:a}=t.dimensions,n=N(c),i=e.element.borderMode;return g(x,{className:"stTable","data-testid":"stTable",children:[r&&s("style",{children:r}),s(M,{borderMode:i,children:g(O,{id:l,"data-testid":"stTableStyledTable",children:[f>0&&E(t,i),s("tbody",{children:n.length===0?s("tr",{children:s(R,{"data-testid":"stTableStyledEmptyTableCell",colSpan:a||1,borderMode:i,children:"empty"})}):n.map(y=>$(t,y,a,i))})]})}),d&&s(h,{children:d})]})}function E(e,t){const l=t===o.BorderMode.NONE||t===o.BorderMode.HORIZONTAL;return s("thead",{children:A(e).map((r,d)=>s("tr",{children:r.map((f,c)=>{let a="inherit";if(l&&e.dimensions.numDataRows>0){const{contentType:n}=e.getCell(0,c);a=u(n)?"right":"left"}return s(B,{className:f.cssClass,scope:"col",borderMode:t,style:{textAlign:a},children:s(T,{source:f.name||" ",allowHTML:!1})},c)})},d))})}function $(e,t,l,r){return s("tr",{children:N(l).map(d=>z(e,t,d,r))},t)}function z(e,t,l,r){const{type:d,content:f,contentType:c}=e.getCell(t,l),a=L(e,t,l);let n=a?.displayContent||w(f,c),i=!1;const y={textAlign:u(c)?"right":"left"};switch(n?.endsWith('<span class="pd-t"></span>')&&(n=n.replace(/<span class="pd-t"><\/span>$/,""),i=!0),d){case m.INDEX:return g(B,{scope:"row",id:a?.cssId,className:a?.cssClass,borderMode:r,children:[i&&s("span",{className:"pd-t"}),s(T,{source:n||" ",allowHTML:!1})]},l);case m.DATA:return g(b,{id:a?.cssId,className:a?.cssClass,style:y,borderMode:r,children:[i&&s("span",{className:"pd-t"}),s(T,{source:n||" ",allowHTML:!1})]},l);default:throw new Error(`Cannot parse type "${d}".`)}}const j=C.memo(H);export{j as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{K as i}from"./index.CXVpBAvU.js";var n=0;function u(r){var t=++n;return i(r)+t}export{u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,aa as p}from"./index.CXVpBAvU.js";import{i as b}from"./inputUtils.CptNuJwn.js";function i({formId:r,maxChars:s,setDirty:n,setUiValue:e,setValueWithSource:f,additionalAction:t}){return o.useCallback(u=>{const{value:a}=u.target;s!==0&&a.length>s||(n(!0),e(a),p({formId:r})&&f({value:a,fromUi:!0}),t&&t())},[r,s,n,e,f,t])}function F(r,s,n,e,f,t=!1){return o.useCallback(u=>{const a=t?u.metaKey||u.ctrlKey:!0;!b(u)||!a||(u.preventDefault(),n&&s(),e.allowFormEnterToSubmit(r)&&e.submitForm(r,f))},[r,f,n,s,e,t])}function K(r,s,n,e){o.useEffect(()=>{e||r!==s&&n(r)},[r,s,e,n])}export{i as a,F as b,K as u};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|