streamlit-nightly 1.41.2.dev20250112__py2.py3-none-any.whl → 1.41.2.dev20250114__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. streamlit/connections/snowflake_connection.py +30 -49
  2. streamlit/static/index.html +1 -1
  3. streamlit/static/static/js/{FileDownload.esm.DgMBFvxE.js → FileDownload.esm.xvAdcisp.js} +1 -1
  4. streamlit/static/static/js/{FormClearHelper.C-kz8EZa.js → FormClearHelper.Cwi_MzMn.js} +1 -1
  5. streamlit/static/static/js/{Hooks.BaEjlpBt.js → Hooks.ByXcZDtQ.js} +1 -1
  6. streamlit/static/static/js/{InputInstructions.2kJ3lLP5.js → InputInstructions.DQO_tWq8.js} +1 -1
  7. streamlit/static/static/js/{ProgressBar.BmX5Bd8z.js → ProgressBar.D2tsAzsU.js} +1 -1
  8. streamlit/static/static/js/{RenderInPortalIfExists.DvbHx6rz.js → RenderInPortalIfExists.Cb1iQZTk.js} +1 -1
  9. streamlit/static/static/js/{Toolbar.Cs7p2Lp9.js → Toolbar.FUQUVTZ-.js} +1 -1
  10. streamlit/static/static/js/{base-input.CmWUWSJc.js → base-input.WPHkbJPl.js} +1 -1
  11. streamlit/static/static/js/{createSuper.D46anxnG.js → createSuper.DjDIhar7.js} +1 -1
  12. streamlit/static/static/js/{data-grid-overlay-editor.BspRPTtu.js → data-grid-overlay-editor.SmXlJABI.js} +1 -1
  13. streamlit/static/static/js/{downloader.BX0QN5eD.js → downloader.CbRVsM5w.js} +1 -1
  14. streamlit/static/static/js/{es6.BlW--gnF.js → es6.C3ovyDQ0.js} +2 -2
  15. streamlit/static/static/js/{getPrototypeOf.BYTPPQIp.js → getPrototypeOf.CVYsgVl7.js} +1 -1
  16. streamlit/static/static/js/{iframeResizer.contentWindow.CNHQyyTg.js → iframeResizer.contentWindow.COP9ZNW_.js} +1 -1
  17. streamlit/static/static/js/{index.BX4DPcrq.js → index.BEVQJJoV.js} +1 -1
  18. streamlit/static/static/js/{index.BqCCfwZM.js → index.BGbkq72c.js} +1 -1
  19. streamlit/static/static/js/{index.B2lUWG_g.js → index.BH4vJGDU.js} +1 -1
  20. streamlit/static/static/js/{index.BSabhp-S.js → index.BMTeKekB.js} +1 -1
  21. streamlit/static/static/js/{index.DRm6hoq7.js → index.BPO6U_Ww.js} +1 -1
  22. streamlit/static/static/js/{index.CKhEFCMB.js → index.BbX6EljV.js} +1 -1
  23. streamlit/static/static/js/{index.7441r-sL.js → index.BfnKXy8f.js} +1 -1
  24. streamlit/static/static/js/{index.2kexLuIU.js → index.Br51_AlR.js} +5 -5
  25. streamlit/static/static/js/{index.D8V0ZERG.js → index.BvkVMkqn.js} +1 -1
  26. streamlit/static/static/js/{index.CdjxQOw-.js → index.CANLiXfL.js} +1 -1
  27. streamlit/static/static/js/{index.ClU6Toj3.js → index.CCIxkgVR.js} +1 -1
  28. streamlit/static/static/js/{index.BtaWfSZN.js → index.CDXWGWmT.js} +1 -1
  29. streamlit/static/static/js/{index.d1dU1FHw.js → index.CEaPpXYi.js} +1 -1
  30. streamlit/static/static/js/{index.B1RTO67W.js → index.CFwQY-KV.js} +1 -1
  31. streamlit/static/static/js/{index.DuEIfrbC.js → index.CMo3Hx0K.js} +1 -1
  32. streamlit/static/static/js/{index.CAmkSLgk.js → index.CNpCQb9b.js} +1 -1
  33. streamlit/static/static/js/{index.BHVs7_wn.js → index.Cg6FfZbb.js} +1 -1
  34. streamlit/static/static/js/{index.AzFWl1A_.js → index.CkiEGMvI.js} +1 -1
  35. streamlit/static/static/js/{index.-JIbeXZC.js → index.Cx7ma5cM.js} +12 -12
  36. streamlit/static/static/js/{index.a4u3c2yA.js → index.CzGQCrp7.js} +1 -1
  37. streamlit/static/static/js/{index.B3F-o9ex.js → index.D0lyWwCG.js} +1 -1
  38. streamlit/static/static/js/{index.DKFY5Ha1.js → index.D3tYsziH.js} +1 -1
  39. streamlit/static/static/js/{index.DGXjFinj.js → index.D99Ft0yx.js} +1 -1
  40. streamlit/static/static/js/{index.BBQgDj4i.js → index.DBsWPEgr.js} +1 -1
  41. streamlit/static/static/js/index.DFD0XSVm.js +1 -0
  42. streamlit/static/static/js/{index.y-VLJ65m.js → index.DFmc81Ae.js} +1 -1
  43. streamlit/static/static/js/{index.D4cEoG-b.js → index.DFwjNqMU.js} +3 -3
  44. streamlit/static/static/js/{index.Drqk1Tqs.js → index.DLx08-Iq.js} +1 -1
  45. streamlit/static/static/js/{index.BhQrqdv2.js → index.DQbNi2IT.js} +1 -1
  46. streamlit/static/static/js/{index.BhRQ3Irc.js → index.DTqVI4Zh.js} +1 -1
  47. streamlit/static/static/js/{index.tQ3BfkaX.js → index.DW-SfHSH.js} +1 -1
  48. streamlit/static/static/js/{index.BwvnBWfd.js → index.DWmj29sp.js} +1 -1
  49. streamlit/static/static/js/{index.D7zDVCSD.js → index.EqYXB49Q.js} +1 -1
  50. streamlit/static/static/js/{index.DhCGDinQ.js → index.JwwxmOA5.js} +1 -1
  51. streamlit/static/static/js/{index.5f81IBZP.js → index.MeMRgb28.js} +1 -1
  52. streamlit/static/static/js/{index.BRwmGBP4.js → index.V22boKfv.js} +12 -12
  53. streamlit/static/static/js/{index.BBK0SZBc.js → index.nDfHFYx0.js} +1 -1
  54. streamlit/static/static/js/{input.C7wSNGte.js → input.CKba1ugc.js} +1 -1
  55. streamlit/static/static/js/{memory.BF0Xc-rJ.js → memory.D29KuLLf.js} +1 -1
  56. streamlit/static/static/js/{mergeWith.CHIovAKI.js → mergeWith.Cp23ZfqA.js} +1 -1
  57. streamlit/static/static/js/{number-overlay-editor.DfAWep9y.js → number-overlay-editor.D2BUXr0s.js} +1 -1
  58. streamlit/static/static/js/{sandbox.CM0H2h0v.js → sandbox.hJRvf-68.js} +1 -1
  59. streamlit/static/static/js/{slicedToArray.BOBOh4VJ.js → slicedToArray.C2Uzm8dQ.js} +1 -1
  60. streamlit/static/static/js/{textarea.CINkGDSQ.js → textarea.DOCot5Dk.js} +1 -1
  61. streamlit/static/static/js/{timepicker.eZuQgQCF.js → timepicker.DzO-3wUS.js} +1 -1
  62. streamlit/static/static/js/{uniqueId.vdNgUDff.js → uniqueId.Drj6SPII.js} +1 -1
  63. streamlit/static/static/js/{useBasicWidgetState.De0NYf9Y.js → useBasicWidgetState.C2tMWgs5.js} +1 -1
  64. streamlit/static/static/js/{useOnInputChange.cRNtiNHf.js → useOnInputChange.9A5YfOzJ.js} +1 -1
  65. streamlit/static/static/js/{withFullScreenWrapper.D4HXFzaF.js → withFullScreenWrapper.CtPlgapz.js} +1 -1
  66. streamlit/watcher/util.py +86 -20
  67. {streamlit_nightly-1.41.2.dev20250112.dist-info → streamlit_nightly-1.41.2.dev20250114.dist-info}/METADATA +2 -2
  68. {streamlit_nightly-1.41.2.dev20250112.dist-info → streamlit_nightly-1.41.2.dev20250114.dist-info}/RECORD +72 -72
  69. streamlit/static/static/js/index.DAlH7XAu.js +0 -1
  70. {streamlit_nightly-1.41.2.dev20250112.data → streamlit_nightly-1.41.2.dev20250114.data}/scripts/streamlit.cmd +0 -0
  71. {streamlit_nightly-1.41.2.dev20250112.dist-info → streamlit_nightly-1.41.2.dev20250114.dist-info}/WHEEL +0 -0
  72. {streamlit_nightly-1.41.2.dev20250112.dist-info → streamlit_nightly-1.41.2.dev20250114.dist-info}/entry_points.txt +0 -0
  73. {streamlit_nightly-1.41.2.dev20250112.dist-info → streamlit_nightly-1.41.2.dev20250114.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
1
- import{r as reactExports,j as jsx}from"./index.BRwmGBP4.js";/*!
1
+ import{r as reactExports,j as jsx}from"./index.V22boKfv.js";/*!
2
2
  * Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors
3
3
  * All rights reserved.
4
4
  *
@@ -1 +1 @@
1
- import{r as s,A as d,j as S,bm as x,bZ as U}from"./index.BRwmGBP4.js";import{a as V}from"./useBasicWidgetState.De0NYf9Y.js";import"./FormClearHelper.C-kz8EZa.js";const v=(t,e)=>t.getIntValue(e),h=t=>t.default??null,C=t=>t.value??null,F=(t,e,o,a)=>{e.setIntValue(t,o.value,{fromUi:o.fromUi},a)},I=({disabled:t,element:e,widgetMgr:o,width:a,fragmentId:u})=>{const{options:n,help:c,label:i,labelVisibility:r,placeholder:m}=e,[f,l]=V({getStateFromWidgetMgr:v,getDefaultStateFromProto:h,getCurrStateFromProto:C,updateWidgetMgrState:F,element:e,widgetMgr:o,fragmentId:u}),g=s.useCallback(p=>{l({value:p,fromUi:!0})},[l]),b=d(e.default)&&!t;return S(U,{label:i,labelVisibility:x(r==null?void 0:r.value),options:n,disabled:t,width:a,onChange:g,value:f,help:c,placeholder:m,clearable:b})},E=s.memo(I);export{E as default};
1
+ import{r as s,A as d,j as S,bm as x,bZ as U}from"./index.V22boKfv.js";import{a as V}from"./useBasicWidgetState.C2tMWgs5.js";import"./FormClearHelper.Cwi_MzMn.js";const v=(t,e)=>t.getIntValue(e),h=t=>t.default??null,C=t=>t.value??null,F=(t,e,o,a)=>{e.setIntValue(t,o.value,{fromUi:o.fromUi},a)},I=({disabled:t,element:e,widgetMgr:o,width:a,fragmentId:u})=>{const{options:n,help:c,label:i,labelVisibility:r,placeholder:m}=e,[f,l]=V({getStateFromWidgetMgr:v,getDefaultStateFromProto:h,getCurrStateFromProto:C,updateWidgetMgrState:F,element:e,widgetMgr:o,fragmentId:u}),g=s.useCallback(p=>{l({value:p,fromUi:!0})},[l]),b=d(e.default)&&!t;return S(U,{label:i,labelVisibility:x(r==null?void 0:r.value),options:n,disabled:t,width:a,onChange:g,value:f,help:c,placeholder:m,clearable:b})},E=s.memo(I);export{E as default};
@@ -1 +1 @@
1
- import{n as k,r as a,ab as z,ck as I,ax as R,j as u,bm as U,bz as H,bn as L,b6 as B,bo as D,cm as j}from"./index.BRwmGBP4.js";import{u as O}from"./uniqueId.vdNgUDff.js";import{u as _,a as K,b as q}from"./useOnInputChange.cRNtiNHf.js";import{a as A}from"./useBasicWidgetState.De0NYf9Y.js";import{I as G}from"./InputInstructions.2kJ3lLP5.js";import{I as N}from"./input.C7wSNGte.js";import"./inputUtils.CQWz5UKz.js";import"./FormClearHelper.C-kz8EZa.js";import"./base-input.CmWUWSJc.js";const $=k("div",{target:"e1sommdr0"})(({width:e})=>({position:"relative",width:e}));function rt({disabled:e,element:t,widgetMgr:s,width:n,fragmentId:m}){var g;const[r,l]=a.useState(S(s,t)??null),[i,d]=a.useState(!1),W=a.useCallback(()=>{l(t.default??null),d(!0)},[t.default]),[x,p]=A({getStateFromWidgetMgr:S,getDefaultStateFromProto:w,getCurrStateFromProto:J,updateWidgetMgrState:Q,element:t,widgetMgr:s,fragmentId:m,onFormCleared:W});_(x,r,l,i);const[y,h]=a.useState(!1),o=z(),[b]=a.useState(()=>O("text_input_")),{placeholder:T,formId:f}=t,c=a.useCallback(()=>{d(!1),p({value:r,fromUi:!0})},[r,p]),C=I({formId:f})?s.allowFormEnterToSubmit(f):i,V=y&&n>o.breakpoints.hideWidgetDetails,F=a.useCallback(()=>{i&&c(),h(!1)},[i,c]),v=a.useCallback(()=>{h(!0)},[]),E=K({formId:t.formId,maxChars:t.maxChars,setDirty:d,setUiValue:l,setValueWithSource:p}),P=q(t.formId,c,i,s,m);return R($,{className:"stTextInput","data-testid":"stTextInput",width:n,children:[u(D,{label:t.label,disabled:e,labelVisibility:U((g=t.labelVisibility)==null?void 0:g.value),htmlFor:b,children:t.help&&u(H,{children:u(L,{content:t.help,placement:B.TOP_RIGHT})})}),u(N,{value:r??"",placeholder:T,onBlur:F,onFocus:v,onChange:E,onKeyPress:P,"aria-label":t.label,disabled:e,id:b,type:X(t),autoComplete:t.autocomplete,overrides:{Input:{style:{minWidth:0,"::placeholder":{opacity:"0.7"},lineHeight:o.lineHeights.inputWidget,paddingRight:o.spacing.sm,paddingLeft:o.spacing.sm,paddingBottom:o.spacing.sm,paddingTop:o.spacing.sm}},Root:{props:{"data-testid":"stTextInputRootElement"},style:{height:o.sizes.minElementHeight,borderLeftWidth:o.sizes.borderWidth,borderRightWidth:o.sizes.borderWidth,borderTopWidth:o.sizes.borderWidth,borderBottomWidth:o.sizes.borderWidth}}}}),V&&u(G,{dirty:i,value:r??"",maxLength:t.maxChars,inForm:I({formId:t.formId}),allowEnterToSubmit:C})]})}function S(e,t){return e.getStringValue(t)??null}function w(e){return e.default??null}function J(e){return e.value??null}function Q(e,t,s,n){t.setStringValue(e,s.value,{fromUi:s.fromUi},n)}function X(e){return e.type===j.Type.PASSWORD?"password":"text"}export{rt as default};
1
+ import{n as k,r as a,ab as z,ck as I,ax as R,j as u,bm as U,bz as H,bn as L,b6 as B,bo as D,cm as j}from"./index.V22boKfv.js";import{u as O}from"./uniqueId.Drj6SPII.js";import{u as _,a as K,b as q}from"./useOnInputChange.9A5YfOzJ.js";import{a as A}from"./useBasicWidgetState.C2tMWgs5.js";import{I as G}from"./InputInstructions.DQO_tWq8.js";import{I as N}from"./input.CKba1ugc.js";import"./inputUtils.CQWz5UKz.js";import"./FormClearHelper.Cwi_MzMn.js";import"./base-input.WPHkbJPl.js";const $=k("div",{target:"e1sommdr0"})(({width:e})=>({position:"relative",width:e}));function rt({disabled:e,element:t,widgetMgr:s,width:n,fragmentId:m}){var g;const[r,l]=a.useState(S(s,t)??null),[i,d]=a.useState(!1),W=a.useCallback(()=>{l(t.default??null),d(!0)},[t.default]),[x,p]=A({getStateFromWidgetMgr:S,getDefaultStateFromProto:w,getCurrStateFromProto:J,updateWidgetMgrState:Q,element:t,widgetMgr:s,fragmentId:m,onFormCleared:W});_(x,r,l,i);const[y,h]=a.useState(!1),o=z(),[b]=a.useState(()=>O("text_input_")),{placeholder:T,formId:f}=t,c=a.useCallback(()=>{d(!1),p({value:r,fromUi:!0})},[r,p]),C=I({formId:f})?s.allowFormEnterToSubmit(f):i,V=y&&n>o.breakpoints.hideWidgetDetails,F=a.useCallback(()=>{i&&c(),h(!1)},[i,c]),v=a.useCallback(()=>{h(!0)},[]),E=K({formId:t.formId,maxChars:t.maxChars,setDirty:d,setUiValue:l,setValueWithSource:p}),P=q(t.formId,c,i,s,m);return R($,{className:"stTextInput","data-testid":"stTextInput",width:n,children:[u(D,{label:t.label,disabled:e,labelVisibility:U((g=t.labelVisibility)==null?void 0:g.value),htmlFor:b,children:t.help&&u(H,{children:u(L,{content:t.help,placement:B.TOP_RIGHT})})}),u(N,{value:r??"",placeholder:T,onBlur:F,onFocus:v,onChange:E,onKeyPress:P,"aria-label":t.label,disabled:e,id:b,type:X(t),autoComplete:t.autocomplete,overrides:{Input:{style:{minWidth:0,"::placeholder":{opacity:"0.7"},lineHeight:o.lineHeights.inputWidget,paddingRight:o.spacing.sm,paddingLeft:o.spacing.sm,paddingBottom:o.spacing.sm,paddingTop:o.spacing.sm}},Root:{props:{"data-testid":"stTextInputRootElement"},style:{height:o.sizes.minElementHeight,borderLeftWidth:o.sizes.borderWidth,borderRightWidth:o.sizes.borderWidth,borderTopWidth:o.sizes.borderWidth,borderBottomWidth:o.sizes.borderWidth}}}}),V&&u(G,{dirty:i,value:r??"",maxLength:t.maxChars,inForm:I({formId:t.formId}),allowEnterToSubmit:C})]})}function S(e,t){return e.getStringValue(t)??null}function w(e){return e.default??null}function J(e){return e.value??null}function Q(e,t,s,n){t.setStringValue(e,s.value,{fromUi:s.fromUi},n)}function X(e){return e.type===j.Type.PASSWORD?"password":"text"}export{rt as default};
@@ -1 +1 @@
1
- import{r as a,j as E}from"./index.BRwmGBP4.js";function T({element:t,width:f,endpoints:c,elementMgr:o}){const i=a.useRef(null),{startTime:u,endTime:n,loop:d,autoplay:p}=t,l=a.useMemo(()=>{if(!t.id)return!0;const e=o.getElementState(t.id,"preventAutoplay");return e||o.setElementState(t.id,"preventAutoplay",!0),e??!1},[t.id,o]);a.useEffect(()=>{i.current&&(i.current.currentTime=u)},[u]),a.useEffect(()=>{const e=i.current,r=()=>{e&&(e.currentTime=t.startTime)};return e&&e.addEventListener("loadedmetadata",r),()=>{e&&e.removeEventListener("loadedmetadata",r)}},[t]),a.useEffect(()=>{const e=i.current;if(!e)return;let r=!1;const s=()=>{n>0&&e.currentTime>=n&&(d?(e.currentTime=u||0,e.play()):r||(r=!0,e.pause()))};return n>0&&e.addEventListener("timeupdate",s),()=>{e&&n>0&&e.removeEventListener("timeupdate",s)}},[n,d,u]),a.useEffect(()=>{const e=i.current;if(!e)return;const r=()=>{d&&(e.currentTime=u||0,e.play())};return e.addEventListener("ended",r),()=>{e&&e.removeEventListener("ended",r)}},[d,u]);const m=c.buildMediaURL(t.url);return E("audio",{className:"stAudio","data-testid":"stAudio",ref:i,controls:!0,autoPlay:p&&!l,src:m,style:{width:f}})}export{T as default};
1
+ import{r as a,j as E}from"./index.V22boKfv.js";function T({element:t,width:f,endpoints:c,elementMgr:o}){const i=a.useRef(null),{startTime:u,endTime:n,loop:d,autoplay:p}=t,l=a.useMemo(()=>{if(!t.id)return!0;const e=o.getElementState(t.id,"preventAutoplay");return e||o.setElementState(t.id,"preventAutoplay",!0),e??!1},[t.id,o]);a.useEffect(()=>{i.current&&(i.current.currentTime=u)},[u]),a.useEffect(()=>{const e=i.current,r=()=>{e&&(e.currentTime=t.startTime)};return e&&e.addEventListener("loadedmetadata",r),()=>{e&&e.removeEventListener("loadedmetadata",r)}},[t]),a.useEffect(()=>{const e=i.current;if(!e)return;let r=!1;const s=()=>{n>0&&e.currentTime>=n&&(d?(e.currentTime=u||0,e.play()):r||(r=!0,e.pause()))};return n>0&&e.addEventListener("timeupdate",s),()=>{e&&n>0&&e.removeEventListener("timeupdate",s)}},[n,d,u]),a.useEffect(()=>{const e=i.current;if(!e)return;const r=()=>{d&&(e.currentTime=u||0,e.play())};return e.addEventListener("ended",r),()=>{e&&e.removeEventListener("ended",r)}},[d,u]);const m=c.buildMediaURL(t.url);return E("audio",{className:"stAudio","data-testid":"stAudio",ref:i,controls:!0,autoPlay:p&&!l,src:m,style:{width:f}})}export{T as default};
@@ -1 +1 @@
1
- import{r as s,E as W,_ as $,n as d,au as L,ab as V,j as a,ax as D,bj as K}from"./index.BRwmGBP4.js";import{I as N}from"./InputInstructions.2kJ3lLP5.js";import{i as _}from"./inputUtils.CQWz5UKz.js";import{T as j}from"./textarea.CINkGDSQ.js";import"./base-input.CmWUWSJc.js";var w=s.forwardRef(function(t,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(W,$({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:r}),s.createElement("rect",{width:24,height:24,fill:"none"}),s.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))});w.displayName="Send";const q=d("div",{target:"e1qzcwc60"})(({theme:t,width:r})=>({borderRadius:t.radii.xxxl,display:"flex",backgroundColor:t.colors.widgetBackgroundColor??t.colors.secondaryBg,width:`${r}px`})),A=d("div",{target:"e1qzcwc61"})(({theme:t})=>({backgroundColor:t.colors.transparent,position:"relative",flexGrow:1,borderRadius:t.radii.xxxl,display:"flex",alignItems:"center"})),M=d("button",{target:"e1qzcwc62"})(({theme:t,disabled:r,extended:l})=>{const u=L(t),[o,g]=u?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:l?"0":t.radii.xxxl,borderTopLeftRadius:l?t.radii.default:"0",borderBottomRightRadius:t.radii.xxxl,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:t.lineHeights.none,margin:t.spacing.none,padding:t.spacing.sm,color:r?o:g,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:u?t.colors.gray10:t.colors.gray90},"&:hover":{color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray}}}),F=d("div",{target:"e1qzcwc63"})({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:0,pointerEvents:"none"}),G=d("div",{target:"e1qzcwc64"})(({theme:t})=>({position:"absolute",bottom:"0px",right:`calc(${t.iconSizes.xl} + 2 * ${t.spacing.sm} + ${t.spacing.sm})`})),U=6.5,H=1;function Z({width:t,element:r,widgetMgr:l,fragmentId:u}){const o=V(),[g,h]=s.useState(!1),[p,f]=s.useState(r.default),[x,y]=s.useState(0),i=s.useRef(null),b=s.useRef({minHeight:0,maxHeight:0}),R=()=>{let e=0;const{current:n}=i;if(n){const c=n.placeholder;n.placeholder="",n.style.height="auto",e=n.scrollHeight,n.placeholder=c,n.style.height=""}return e},C=()=>{i.current&&i.current.focus(),p&&(l.setStringTriggerValue(r,p,{fromUi:!0},u),h(!1),f(""),y(0))},E=e=>{const{metaKey:n,ctrlKey:c,shiftKey:T}=e;_(e)&&!T&&!c&&!n&&(e.preventDefault(),C())},z=e=>{const{value:n}=e.target,{maxChars:c}=r;c!==0&&n.length>c||(h(n!==""),f(n),y(R()))};s.useEffect(()=>{if(r.setValue){r.setValue=!1;const e=r.value||"";f(e),h(e!=="")}},[r]),s.useEffect(()=>{if(i.current){const{offsetHeight:e}=i.current;b.current.minHeight=e,b.current.maxHeight=e*U}},[i]);const{disabled:I,placeholder:m,maxChars:k}=r,{minHeight:B,maxHeight:S}=b.current,v=x>0&&i.current?Math.abs(x-B)>H:!1;return a(q,{className:"stChatInput","data-testid":"stChatInput",width:t,children:D(A,{children:[a(j,{inputRef:i,value:p,placeholder:m,onChange:z,onKeyDown:E,"aria-label":m,disabled:I,rows:1,overrides:{Root:{style:{minHeight:o.sizes.minElementHeight,outline:"none",backgroundColor:o.colors.transparent,borderRadius:o.radii.xxxl,borderLeftWidth:o.sizes.borderWidth,borderRightWidth:o.sizes.borderWidth,borderTopWidth:o.sizes.borderWidth,borderBottomWidth:o.sizes.borderWidth,width:`${t}px`}},InputContainer:{style:{backgroundColor:o.colors.transparent}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:o.lineHeights.inputWidget,backgroundColor:o.colors.transparent,resize:"none","::placeholder":{opacity:"0.7"},height:v?`${x+H}px`:"auto",maxHeight:S?`${S}px`:"none",paddingLeft:o.spacing.lg,paddingBottom:o.spacing.sm,paddingTop:o.spacing.sm,paddingRight:`calc(${o.iconSizes.xl} + 2 * ${o.spacing.sm} + ${o.spacing.sm})`}}}}),t>o.breakpoints.hideWidgetDetails&&a(G,{children:a(N,{dirty:g,value:p,maxLength:k,type:"chat",inForm:!1})}),a(F,{children:a(M,{onClick:C,disabled:!g||I,extended:v,"data-testid":"stChatInputSubmitButton",children:a(K,{content:w,size:"xl",color:"inherit"})})})]})})}export{Z as default};
1
+ import{r as s,E as W,_ as $,n as d,au as L,ab as V,j as a,ax as D,bj as K}from"./index.V22boKfv.js";import{I as N}from"./InputInstructions.DQO_tWq8.js";import{i as _}from"./inputUtils.CQWz5UKz.js";import{T as j}from"./textarea.DOCot5Dk.js";import"./base-input.WPHkbJPl.js";var w=s.forwardRef(function(t,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(W,$({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:r}),s.createElement("rect",{width:24,height:24,fill:"none"}),s.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))});w.displayName="Send";const q=d("div",{target:"e1qzcwc60"})(({theme:t,width:r})=>({borderRadius:t.radii.xxxl,display:"flex",backgroundColor:t.colors.widgetBackgroundColor??t.colors.secondaryBg,width:`${r}px`})),A=d("div",{target:"e1qzcwc61"})(({theme:t})=>({backgroundColor:t.colors.transparent,position:"relative",flexGrow:1,borderRadius:t.radii.xxxl,display:"flex",alignItems:"center"})),M=d("button",{target:"e1qzcwc62"})(({theme:t,disabled:r,extended:l})=>{const u=L(t),[o,g]=u?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:l?"0":t.radii.xxxl,borderTopLeftRadius:l?t.radii.default:"0",borderBottomRightRadius:t.radii.xxxl,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:t.lineHeights.none,margin:t.spacing.none,padding:t.spacing.sm,color:r?o:g,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:u?t.colors.gray10:t.colors.gray90},"&:hover":{color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray}}}),F=d("div",{target:"e1qzcwc63"})({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:0,pointerEvents:"none"}),G=d("div",{target:"e1qzcwc64"})(({theme:t})=>({position:"absolute",bottom:"0px",right:`calc(${t.iconSizes.xl} + 2 * ${t.spacing.sm} + ${t.spacing.sm})`})),U=6.5,H=1;function Z({width:t,element:r,widgetMgr:l,fragmentId:u}){const o=V(),[g,h]=s.useState(!1),[p,f]=s.useState(r.default),[x,y]=s.useState(0),i=s.useRef(null),b=s.useRef({minHeight:0,maxHeight:0}),R=()=>{let e=0;const{current:n}=i;if(n){const c=n.placeholder;n.placeholder="",n.style.height="auto",e=n.scrollHeight,n.placeholder=c,n.style.height=""}return e},C=()=>{i.current&&i.current.focus(),p&&(l.setStringTriggerValue(r,p,{fromUi:!0},u),h(!1),f(""),y(0))},E=e=>{const{metaKey:n,ctrlKey:c,shiftKey:T}=e;_(e)&&!T&&!c&&!n&&(e.preventDefault(),C())},z=e=>{const{value:n}=e.target,{maxChars:c}=r;c!==0&&n.length>c||(h(n!==""),f(n),y(R()))};s.useEffect(()=>{if(r.setValue){r.setValue=!1;const e=r.value||"";f(e),h(e!=="")}},[r]),s.useEffect(()=>{if(i.current){const{offsetHeight:e}=i.current;b.current.minHeight=e,b.current.maxHeight=e*U}},[i]);const{disabled:I,placeholder:m,maxChars:k}=r,{minHeight:B,maxHeight:S}=b.current,v=x>0&&i.current?Math.abs(x-B)>H:!1;return a(q,{className:"stChatInput","data-testid":"stChatInput",width:t,children:D(A,{children:[a(j,{inputRef:i,value:p,placeholder:m,onChange:z,onKeyDown:E,"aria-label":m,disabled:I,rows:1,overrides:{Root:{style:{minHeight:o.sizes.minElementHeight,outline:"none",backgroundColor:o.colors.transparent,borderRadius:o.radii.xxxl,borderLeftWidth:o.sizes.borderWidth,borderRightWidth:o.sizes.borderWidth,borderTopWidth:o.sizes.borderWidth,borderBottomWidth:o.sizes.borderWidth,width:`${t}px`}},InputContainer:{style:{backgroundColor:o.colors.transparent}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:o.lineHeights.inputWidget,backgroundColor:o.colors.transparent,resize:"none","::placeholder":{opacity:"0.7"},height:v?`${x+H}px`:"auto",maxHeight:S?`${S}px`:"none",paddingLeft:o.spacing.lg,paddingBottom:o.spacing.sm,paddingTop:o.spacing.sm,paddingRight:`calc(${o.iconSizes.xl} + 2 * ${o.spacing.sm} + ${o.spacing.sm})`}}}}),t>o.breakpoints.hideWidgetDetails&&a(G,{children:a(N,{dirty:g,value:p,maxLength:k,type:"chat",inForm:!1})}),a(F,{children:a(M,{onClick:C,disabled:!g||I,extended:v,"data-testid":"stChatInputSubmitButton",children:a(K,{content:w,size:"xl",color:"inherit"})})})]})})}export{Z as default};
@@ -1 +1 @@
1
- import{r as o,E as X,_ as q,n as x,aJ as lt,ck as ut,D as J,cv as I,A as f,ax as z,j as u,bm as ct,bz as dt,bn as pt,b6 as ft,bo as bt,bj as G}from"./index.BRwmGBP4.js";import{s as mt}from"./sprintf.C-r3gIuM.js";import{u as gt}from"./uniqueId.vdNgUDff.js";import{u as yt}from"./FormClearHelper.C-kz8EZa.js";import{I as It}from"./InputInstructions.2kJ3lLP5.js";import{I as ht}from"./input.C7wSNGte.js";import"./base-input.CmWUWSJc.js";var Q=o.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(X,q({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),o.createElement("path",{d:"M0 3v2h8V3H0z"}))});Q.displayName="Minus";var Y=o.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(X,q({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),o.createElement("path",{d:"M3 0v3H0v2h3v3h2V5h3V3H5V0H3z"}))});Y.displayName="Plus";const wt=x("div",{target:"eiawb8t0"})(({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:t.sizes.minElementHeight,borderWidth:t.sizes.borderWidth,borderStyle:"solid",borderColor:t.colors.widgetBorderColor||t.colors.widgetBackgroundColor||t.colors.bgColor,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:t.radii.default,overflow:"hidden","&.focused":{borderColor:t.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:t.spacing.none}}})),Ct=x("div",{target:"eiawb8t1"})({display:"flex",flexDirection:"row",alignSelf:"stretch"}),K=x("button",{target:"eiawb8t2"})(({theme:t})=>({margin:t.spacing.none,border:"none",height:t.sizes.full,display:"flex",alignItems:"center",width:t.sizes.numberInputControlsWidth,justifyContent:"center",color:t.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:t.colors.widgetBackgroundColor||t.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:t.colors.white,backgroundColor:t.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:last-of-type":{borderTopRightRadius:t.radii.default,borderBottomRightRadius:t.radii.default},"&:disabled":{cursor:"not-allowed",color:t.colors.fadedText40}})),Tt=x("div",{target:"eiawb8t3"})(({theme:t,clearable:e})=>({position:"absolute",marginRight:t.spacing.twoXS,left:0,right:`calc(${t.sizes.numberInputControlsWidth} * 2 + ${e?"1em":"0em"})`}));function vt(t){return f(t)||t===""?void 0:t}const St=t=>(t.element.dataType===I.DataType.INT?t.widgetMgr.getIntValue(t.element):t.widgetMgr.getDoubleValue(t.element))??t.element.default??null,M=({step:t,dataType:e})=>t||(e===I.DataType.INT?1:.01),W=({value:t,format:e,step:r,dataType:h})=>{if(f(t))return null;let a=vt(e);if(f(a)&&J(r)){const c=r.toString();h===I.DataType.FLOAT&&r!==0&&c.includes(".")&&(a=`%0.${c.split(".")[1].length}f`)}if(f(a))return t.toString();try{return mt.sprintf(a,t)}catch{return String(t)}},Vt=(t,e,r)=>f(t)?!1:t-e>=r,kt=(t,e,r)=>f(t)?!1:t+e<=r,xt=({disabled:t,element:e,widgetMgr:r,width:h,theme:a,fragmentId:c})=>{var $;const{dataType:T,id:D,formId:p,default:B,format:A}=e,b=e.hasMin?e.min:-1/0,m=e.hasMax?e.max:1/0,[i,Z]=o.useState(M(e)),U=St({element:e,widgetMgr:r}),[g,w]=o.useState(!1),[s,C]=o.useState(U),[H,v]=o.useState(W({value:U,...e,step:i})),[P,L]=o.useState(!1),R=o.useRef(null),O=o.useRef(gt("number_input_")),S=Vt(s,i,b),V=kt(s,i,m),j=ut({formId:p}),tt=j?r.allowFormEnterToSubmit(p):g,et=P&&h>a.breakpoints.hideWidgetDetails;o.useEffect(()=>{Z(M({step:e.step,dataType:e.dataType}))},[e.dataType,e.step]);const l=o.useCallback(({value:n,source:d})=>{var y;if(J(n)&&(b>n||n>m))(y=R.current)==null||y.reportValidity();else{const k=n??B??null;switch(T){case I.DataType.INT:r.setIntValue({id:D,formId:p},k,d,c);break;case I.DataType.FLOAT:r.setDoubleValue({id:D,formId:p},k,d,c);break;default:throw new Error("Invalid data type")}w(!1),C(k),v(W({value:k,dataType:T,format:A,step:i}))}},[b,m,R,r,c,i,T,D,p,B,A]),ot=o.useCallback(()=>{g&&l({value:s,source:{fromUi:!0}}),L(!1)},[g,s,l]),rt=o.useCallback(()=>{L(!0)},[]),_=o.useCallback(()=>{const{value:n}=e;e.setValue=!1,C(n??null),v(W({value:n??null,...e,step:i})),l({value:n??null,source:{fromUi:!1}})},[e,i,l]);o.useEffect(()=>{e.setValue?_():l({value:s,source:{fromUi:!1}})},[]),e.setValue&&_();const N=f(e.default)&&!t,nt=o.useCallback(()=>{const n=e.default??null;C(n),l({value:n,source:{fromUi:!0}})},[e]);yt({element:e,widgetMgr:r,onFormCleared:nt});const at=n=>{const{value:d}=n.target;if(d==="")w(!0),C(null),v(null);else{let y;e.dataType===I.DataType.INT?y=parseInt(d,10):y=parseFloat(d),w(!0),C(y),v(d)}},F=o.useCallback(()=>{V&&(w(!0),l({value:(s??b)+i,source:{fromUi:!0}}))},[s,b,i,V]),E=o.useCallback(()=>{S&&(w(!0),l({value:(s??m)-i,source:{fromUi:!0}}))},[s,m,i,S]),it=o.useCallback(n=>{const{key:d}=n;switch(d){case"ArrowUp":n.preventDefault(),F();break;case"ArrowDown":n.preventDefault(),E();break}},[F,E]),st=o.useCallback(n=>{n.key==="Enter"&&(g&&l({value:s,source:{fromUi:!0}}),r.allowFormEnterToSubmit(p)&&r.submitForm(p,c))},[g,s,l,r,p,c]);return z("div",{className:"stNumberInput","data-testid":"stNumberInput",style:{width:h},children:[u(bt,{label:e.label,disabled:t,labelVisibility:ct(($=e.labelVisibility)==null?void 0:$.value),htmlFor:O.current,children:e.help&&u(dt,{children:u(pt,{content:e.help,placement:ft.TOP_RIGHT})})}),z(wt,{className:P?"focused":"","data-testid":"stNumberInputContainer",children:[u(ht,{type:"number",inputRef:R,value:H??"",placeholder:e.placeholder,onBlur:ot,onFocus:rt,onChange:at,onKeyPress:st,onKeyDown:it,clearable:N,clearOnEscape:N,disabled:t,"aria-label":e.label,id:O.current,overrides:{ClearIconContainer:{style:{padding:0}},ClearIcon:{props:{overrides:{Svg:{style:{color:a.colors.darkGray,padding:a.spacing.threeXS,height:a.sizes.clearIconSize,width:a.sizes.clearIconSize,":hover":{fill:a.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInputField",step:i,min:b,max:m,type:"number",inputMode:""},style:{lineHeight:a.lineHeights.inputWidget,paddingRight:a.spacing.sm,paddingLeft:a.spacing.sm,paddingBottom:a.spacing.sm,paddingTop:a.spacing.sm}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:{borderTopRightRadius:0,borderBottomRightRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingRight:0}}}}),h>a.breakpoints.hideNumberInputControls&&z(Ct,{children:[u(K,{"data-testid":"stNumberInputStepDown",onClick:E,disabled:!S||t,tabIndex:-1,children:u(G,{content:Q,size:"xs",color:S?"inherit":"disabled"})}),u(K,{"data-testid":"stNumberInputStepUp",onClick:F,disabled:!V||t,tabIndex:-1,children:u(G,{content:Y,size:"xs",color:V?"inherit":"disabled"})})]})]}),et&&u(Tt,{clearable:N,children:u(It,{dirty:g,value:H??"",inForm:j,allowEnterToSubmit:tt})})]})},Bt=lt(xt);export{Bt as default};
1
+ import{r as o,E as X,_ as q,n as x,aJ as lt,ck as ut,D as J,cv as I,A as f,ax as z,j as u,bm as ct,bz as dt,bn as pt,b6 as ft,bo as bt,bj as G}from"./index.V22boKfv.js";import{s as mt}from"./sprintf.C-r3gIuM.js";import{u as gt}from"./uniqueId.Drj6SPII.js";import{u as yt}from"./FormClearHelper.Cwi_MzMn.js";import{I as It}from"./InputInstructions.DQO_tWq8.js";import{I as ht}from"./input.CKba1ugc.js";import"./base-input.WPHkbJPl.js";var Q=o.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(X,q({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),o.createElement("path",{d:"M0 3v2h8V3H0z"}))});Q.displayName="Minus";var Y=o.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(X,q({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),o.createElement("path",{d:"M3 0v3H0v2h3v3h2V5h3V3H5V0H3z"}))});Y.displayName="Plus";const wt=x("div",{target:"eiawb8t0"})(({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:t.sizes.minElementHeight,borderWidth:t.sizes.borderWidth,borderStyle:"solid",borderColor:t.colors.widgetBorderColor||t.colors.widgetBackgroundColor||t.colors.bgColor,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:t.radii.default,overflow:"hidden","&.focused":{borderColor:t.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:t.spacing.none}}})),Ct=x("div",{target:"eiawb8t1"})({display:"flex",flexDirection:"row",alignSelf:"stretch"}),K=x("button",{target:"eiawb8t2"})(({theme:t})=>({margin:t.spacing.none,border:"none",height:t.sizes.full,display:"flex",alignItems:"center",width:t.sizes.numberInputControlsWidth,justifyContent:"center",color:t.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:t.colors.widgetBackgroundColor||t.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:t.colors.white,backgroundColor:t.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:last-of-type":{borderTopRightRadius:t.radii.default,borderBottomRightRadius:t.radii.default},"&:disabled":{cursor:"not-allowed",color:t.colors.fadedText40}})),Tt=x("div",{target:"eiawb8t3"})(({theme:t,clearable:e})=>({position:"absolute",marginRight:t.spacing.twoXS,left:0,right:`calc(${t.sizes.numberInputControlsWidth} * 2 + ${e?"1em":"0em"})`}));function vt(t){return f(t)||t===""?void 0:t}const St=t=>(t.element.dataType===I.DataType.INT?t.widgetMgr.getIntValue(t.element):t.widgetMgr.getDoubleValue(t.element))??t.element.default??null,M=({step:t,dataType:e})=>t||(e===I.DataType.INT?1:.01),W=({value:t,format:e,step:r,dataType:h})=>{if(f(t))return null;let a=vt(e);if(f(a)&&J(r)){const c=r.toString();h===I.DataType.FLOAT&&r!==0&&c.includes(".")&&(a=`%0.${c.split(".")[1].length}f`)}if(f(a))return t.toString();try{return mt.sprintf(a,t)}catch{return String(t)}},Vt=(t,e,r)=>f(t)?!1:t-e>=r,kt=(t,e,r)=>f(t)?!1:t+e<=r,xt=({disabled:t,element:e,widgetMgr:r,width:h,theme:a,fragmentId:c})=>{var $;const{dataType:T,id:D,formId:p,default:B,format:A}=e,b=e.hasMin?e.min:-1/0,m=e.hasMax?e.max:1/0,[i,Z]=o.useState(M(e)),U=St({element:e,widgetMgr:r}),[g,w]=o.useState(!1),[s,C]=o.useState(U),[H,v]=o.useState(W({value:U,...e,step:i})),[P,L]=o.useState(!1),R=o.useRef(null),O=o.useRef(gt("number_input_")),S=Vt(s,i,b),V=kt(s,i,m),j=ut({formId:p}),tt=j?r.allowFormEnterToSubmit(p):g,et=P&&h>a.breakpoints.hideWidgetDetails;o.useEffect(()=>{Z(M({step:e.step,dataType:e.dataType}))},[e.dataType,e.step]);const l=o.useCallback(({value:n,source:d})=>{var y;if(J(n)&&(b>n||n>m))(y=R.current)==null||y.reportValidity();else{const k=n??B??null;switch(T){case I.DataType.INT:r.setIntValue({id:D,formId:p},k,d,c);break;case I.DataType.FLOAT:r.setDoubleValue({id:D,formId:p},k,d,c);break;default:throw new Error("Invalid data type")}w(!1),C(k),v(W({value:k,dataType:T,format:A,step:i}))}},[b,m,R,r,c,i,T,D,p,B,A]),ot=o.useCallback(()=>{g&&l({value:s,source:{fromUi:!0}}),L(!1)},[g,s,l]),rt=o.useCallback(()=>{L(!0)},[]),_=o.useCallback(()=>{const{value:n}=e;e.setValue=!1,C(n??null),v(W({value:n??null,...e,step:i})),l({value:n??null,source:{fromUi:!1}})},[e,i,l]);o.useEffect(()=>{e.setValue?_():l({value:s,source:{fromUi:!1}})},[]),e.setValue&&_();const N=f(e.default)&&!t,nt=o.useCallback(()=>{const n=e.default??null;C(n),l({value:n,source:{fromUi:!0}})},[e]);yt({element:e,widgetMgr:r,onFormCleared:nt});const at=n=>{const{value:d}=n.target;if(d==="")w(!0),C(null),v(null);else{let y;e.dataType===I.DataType.INT?y=parseInt(d,10):y=parseFloat(d),w(!0),C(y),v(d)}},F=o.useCallback(()=>{V&&(w(!0),l({value:(s??b)+i,source:{fromUi:!0}}))},[s,b,i,V]),E=o.useCallback(()=>{S&&(w(!0),l({value:(s??m)-i,source:{fromUi:!0}}))},[s,m,i,S]),it=o.useCallback(n=>{const{key:d}=n;switch(d){case"ArrowUp":n.preventDefault(),F();break;case"ArrowDown":n.preventDefault(),E();break}},[F,E]),st=o.useCallback(n=>{n.key==="Enter"&&(g&&l({value:s,source:{fromUi:!0}}),r.allowFormEnterToSubmit(p)&&r.submitForm(p,c))},[g,s,l,r,p,c]);return z("div",{className:"stNumberInput","data-testid":"stNumberInput",style:{width:h},children:[u(bt,{label:e.label,disabled:t,labelVisibility:ct(($=e.labelVisibility)==null?void 0:$.value),htmlFor:O.current,children:e.help&&u(dt,{children:u(pt,{content:e.help,placement:ft.TOP_RIGHT})})}),z(wt,{className:P?"focused":"","data-testid":"stNumberInputContainer",children:[u(ht,{type:"number",inputRef:R,value:H??"",placeholder:e.placeholder,onBlur:ot,onFocus:rt,onChange:at,onKeyPress:st,onKeyDown:it,clearable:N,clearOnEscape:N,disabled:t,"aria-label":e.label,id:O.current,overrides:{ClearIconContainer:{style:{padding:0}},ClearIcon:{props:{overrides:{Svg:{style:{color:a.colors.darkGray,padding:a.spacing.threeXS,height:a.sizes.clearIconSize,width:a.sizes.clearIconSize,":hover":{fill:a.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInputField",step:i,min:b,max:m,type:"number",inputMode:""},style:{lineHeight:a.lineHeights.inputWidget,paddingRight:a.spacing.sm,paddingLeft:a.spacing.sm,paddingBottom:a.spacing.sm,paddingTop:a.spacing.sm}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:{borderTopRightRadius:0,borderBottomRightRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingRight:0}}}}),h>a.breakpoints.hideNumberInputControls&&z(Ct,{children:[u(K,{"data-testid":"stNumberInputStepDown",onClick:E,disabled:!S||t,tabIndex:-1,children:u(G,{content:Q,size:"xs",color:S?"inherit":"disabled"})}),u(K,{"data-testid":"stNumberInputStepUp",onClick:F,disabled:!V||t,tabIndex:-1,children:u(G,{content:Y,size:"xs",color:V?"inherit":"disabled"})})]})]}),et&&u(Tt,{clearable:N,children:u(It,{dirty:g,value:H??"",inForm:j,allowEnterToSubmit:tt})})]})},Bt=lt(xt);export{Bt as default};
@@ -1,4 +1,4 @@
1
- import{n as i,k as m,r as c,j as e}from"./index.BRwmGBP4.js";import{P as l,R as p}from"./RenderInPortalIfExists.DvbHx6rz.js";const d=""+new URL("../media/flake-0.DgWaVvm5.png",import.meta.url).href,f=""+new URL("../media/flake-1.B2r5AHMK.png",import.meta.url).href,S=""+new URL("../media/flake-2.BnWSExPC.png",import.meta.url).href,o=150,r=150,g=10,E=90,u=4e3,n=(t,a=0)=>Math.random()*(t-a)+a,w=()=>m(`from{transform:translateY(0)
1
+ import{n as i,k as m,r as c,j as e}from"./index.V22boKfv.js";import{P as l,R as p}from"./RenderInPortalIfExists.Cb1iQZTk.js";const d=""+new URL("../media/flake-0.DgWaVvm5.png",import.meta.url).href,f=""+new URL("../media/flake-1.B2r5AHMK.png",import.meta.url).href,S=""+new URL("../media/flake-2.BnWSExPC.png",import.meta.url).href,o=150,r=150,g=10,E=90,u=4e3,n=(t,a=0)=>Math.random()*(t-a)+a,w=()=>m(`from{transform:translateY(0)
2
2
  rotateX(`,n(360),`deg)
3
3
  rotateY(`,n(360),`deg)
4
4
  rotateZ(`,n(360),"deg);}to{transform:translateY(calc(100vh + ",o,`px))
@@ -1 +1 @@
1
- import{n as p,aJ as T,r as s,ax as x,j as r,aK as v,ar as h,aL as e,aM as k,aN as L,F as z,au as R}from"./index.BRwmGBP4.js";const B=p("button",{target:"e1rpgzpk0"})(({theme:o})=>({fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,color:o.colors.fadedText60,backgroundColor:o.colors.transparent,fontFamily:"inherit",margin:o.spacing.none,border:"none",boxShadow:"none",padding:o.spacing.none,"&:hover, &:active, &:focus":{border:"none",outline:"none",boxShadow:"none"},"&:hover":{color:o.colors.primary}})),C=p("div",{target:"e1rpgzpk1"})(({theme:o})=>({display:"flex",flexDirection:"row",gap:o.spacing.lg,"> span":{marginTop:o.spacing.twoXS}})),m=p("div",{target:"e1rpgzpk3"})(({theme:o})=>({display:"flex",flexDirection:"column",gap:o.spacing.sm,alignItems:"start",justifyContent:"center",overflow:"hidden",minHeight:"100%",fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,div:{display:"inline-flex"}}));function E(o){const t=R(o);return{Body:{props:{"data-testid":"stToast",className:"stToast"},style:{display:"flex",flexDirection:"row",gap:o.spacing.md,width:o.sizes.toastWidth,marginTop:o.spacing.sm,borderTopLeftRadius:o.radii.default,borderTopRightRadius:o.radii.default,borderBottomLeftRadius:o.radii.default,borderBottomRightRadius:o.radii.default,paddingTop:o.spacing.lg,paddingBottom:o.spacing.lg,paddingLeft:o.spacing.twoXL,paddingRight:o.spacing.twoXL,backgroundColor:t?o.colors.gray10:o.colors.gray90,color:o.colors.bodyText,boxShadow:t?"0px 4px 16px rgba(0, 0, 0, 0.16)":"0px 4px 16px rgba(0, 0, 0, 0.7)"}},CloseIcon:{style:{color:o.colors.fadedText40,width:o.fontSizes.lg,height:o.fontSizes.lg,marginRight:`calc(-1 * ${o.spacing.lg} / 2)`,":hover":{color:o.colors.bodyText}}}}}function M(o){if(o.length>104){let a=o.replace(/^(.{104}[^\s]*).*/,"$1");return a.length>104&&(a=a.substring(0,104).split(" ").slice(0,-1).join(" ")),a.trim()}return o}function D({theme:o,body:t,icon:a,width:y}){const n=M(t),d=t!==n,[i,b]=s.useState(!d),[u,w]=s.useState(0),f=s.useCallback(()=>{b(!i)},[i]),c=s.useMemo(()=>E(o),[o]),l=s.useMemo(()=>x(C,{expanded:i,children:[a&&r(v,{iconValue:a,size:"xl",testid:"stToastDynamicIcon"}),x(m,{children:[r(h,{source:i?t:n,allowHTML:!1,isToast:!0}),d&&r(B,{"data-testid":"stToastViewButton",onClick:f,children:i?"view less":"view more"})]})]}),[d,i,t,a,n,f]);s.useEffect(()=>{if(o.inSidebar)return;const g=e.info(l,{overrides:{...c}});return w(g),()=>{e.update(g,{overrides:{Body:{style:{transitionDuration:0}}}}),e.clear(g)}},[]),s.useEffect(()=>{e.update(u,{children:l,overrides:{...c}})},[u,l,c]);const S=r(L,{kind:k.ERROR,body:"Streamlit API Error: `st.toast` cannot be called directly on the sidebar with `st.sidebar.toast`. See our `st.toast` API [docs](https://docs.streamlit.io/develop/api-reference/status/st.toast) for more information.",width:y});return r(z,{children:o.inSidebar&&S})}const I=T(D);export{I as default};
1
+ import{n as p,aJ as T,r as s,ax as x,j as r,aK as v,ar as h,aL as e,aM as k,aN as L,F as z,au as R}from"./index.V22boKfv.js";const B=p("button",{target:"e1rpgzpk0"})(({theme:o})=>({fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,color:o.colors.fadedText60,backgroundColor:o.colors.transparent,fontFamily:"inherit",margin:o.spacing.none,border:"none",boxShadow:"none",padding:o.spacing.none,"&:hover, &:active, &:focus":{border:"none",outline:"none",boxShadow:"none"},"&:hover":{color:o.colors.primary}})),C=p("div",{target:"e1rpgzpk1"})(({theme:o})=>({display:"flex",flexDirection:"row",gap:o.spacing.lg,"> span":{marginTop:o.spacing.twoXS}})),m=p("div",{target:"e1rpgzpk3"})(({theme:o})=>({display:"flex",flexDirection:"column",gap:o.spacing.sm,alignItems:"start",justifyContent:"center",overflow:"hidden",minHeight:"100%",fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,div:{display:"inline-flex"}}));function E(o){const t=R(o);return{Body:{props:{"data-testid":"stToast",className:"stToast"},style:{display:"flex",flexDirection:"row",gap:o.spacing.md,width:o.sizes.toastWidth,marginTop:o.spacing.sm,borderTopLeftRadius:o.radii.default,borderTopRightRadius:o.radii.default,borderBottomLeftRadius:o.radii.default,borderBottomRightRadius:o.radii.default,paddingTop:o.spacing.lg,paddingBottom:o.spacing.lg,paddingLeft:o.spacing.twoXL,paddingRight:o.spacing.twoXL,backgroundColor:t?o.colors.gray10:o.colors.gray90,color:o.colors.bodyText,boxShadow:t?"0px 4px 16px rgba(0, 0, 0, 0.16)":"0px 4px 16px rgba(0, 0, 0, 0.7)"}},CloseIcon:{style:{color:o.colors.fadedText40,width:o.fontSizes.lg,height:o.fontSizes.lg,marginRight:`calc(-1 * ${o.spacing.lg} / 2)`,":hover":{color:o.colors.bodyText}}}}}function M(o){if(o.length>104){let a=o.replace(/^(.{104}[^\s]*).*/,"$1");return a.length>104&&(a=a.substring(0,104).split(" ").slice(0,-1).join(" ")),a.trim()}return o}function D({theme:o,body:t,icon:a,width:y}){const n=M(t),d=t!==n,[i,b]=s.useState(!d),[u,w]=s.useState(0),f=s.useCallback(()=>{b(!i)},[i]),c=s.useMemo(()=>E(o),[o]),l=s.useMemo(()=>x(C,{expanded:i,children:[a&&r(v,{iconValue:a,size:"xl",testid:"stToastDynamicIcon"}),x(m,{children:[r(h,{source:i?t:n,allowHTML:!1,isToast:!0}),d&&r(B,{"data-testid":"stToastViewButton",onClick:f,children:i?"view less":"view more"})]})]}),[d,i,t,a,n,f]);s.useEffect(()=>{if(o.inSidebar)return;const g=e.info(l,{overrides:{...c}});return w(g),()=>{e.update(g,{overrides:{Body:{style:{transitionDuration:0}}}}),e.clear(g)}},[]),s.useEffect(()=>{e.update(u,{children:l,overrides:{...c}})},[u,l,c]);const S=r(L,{kind:k.ERROR,body:"Streamlit API Error: `st.toast` cannot be called directly on the sidebar with `st.sidebar.toast`. See our `st.toast` API [docs](https://docs.streamlit.io/develop/api-reference/status/st.toast) for more information.",width:y});return r(z,{children:o.inSidebar&&S})}const I=T(D);export{I as default};
@@ -1,4 +1,4 @@
1
- import{r as u,E as H,_ as V,aV as ut,be as Vt,bf as $t,bg as jt,A as G,D as X,R as yt,aw as Gt,n as x,bh as Xt,ax as N,j as v,bi as qt,b2 as Yt,bj as Kt,bk as Zt,ad as Jt,ab as Qt,bl as Q,am as te,ap as ee,bm as ie,bn as ne,b6 as se,bo as re}from"./index.BRwmGBP4.js";import{u as oe,F as ae}from"./FormClearHelper.C-kz8EZa.js";import{T as le,a as pt}from"./Toolbar.Cs7p2Lp9.js";import{u as ce}from"./Hooks.BaEjlpBt.js";import{c as de}from"./createDownloadLinkElement.DZMwyjvU.js";import{F as he,D as ue}from"./FileDownload.esm.DgMBFvxE.js";var wt=u.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(H,V({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),u.createElement("g",{fill:"none"},u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24})),u.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),u.createElement("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});wt.displayName="Mic";var Ct=u.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(H,V({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),u.createElement("rect",{width:24,height:24,fill:"none"}),u.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))});Ct.displayName="Pause";var St=u.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(H,V({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),u.createElement("rect",{width:24,height:24,fill:"none"}),u.createElement("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 000-1.69L9.54 5.98A.998.998 0 008 6.82z"}))});St.displayName="PlayArrow";var Rt=u.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(H,V({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),u.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),u.createElement("path",{d:"M17.65 6.35a7.95 7.95 0 00-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 007.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 01-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0112 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z"}))});Rt.displayName="Refresh";var Et=u.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(H,V({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),u.createElement("g",{fill:"none"},u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24})),u.createElement("path",{fillRule:"evenodd",d:"M9 16h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}))});Et.displayName="StopCircle";function E(n,t,e,i){return new(e||(e=Promise))(function(r,s){function a(c){try{d(i.next(c))}catch(l){s(l)}}function o(c){try{d(i.throw(c))}catch(l){s(l)}}function d(c){var l;c.done?r(c.value):(l=c.value,l instanceof e?l:new e(function(p){p(l)})).then(a,o)}d((i=i.apply(n,t||[])).next())})}let $=class{constructor(){this.listeners={}}on(t,e,i){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(e),i==null?void 0:i.once){const r=()=>{this.un(t,r),this.un(t,e)};return this.on(t,r),r}return()=>this.un(t,e)}un(t,e){var i;(i=this.listeners[t])===null||i===void 0||i.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach(i=>i(...e))}};const mt={decode:function(n,t){return E(this,void 0,void 0,function*(){const e=new AudioContext({sampleRate:t});return e.decodeAudioData(n).finally(()=>e.close())})},createBuffer:function(n,t){return typeof n[0]=="number"&&(n=[n]),function(e){const i=e[0];if(i.some(r=>r>1||r<-1)){const r=i.length;let s=0;for(let a=0;a<r;a++){const o=Math.abs(i[a]);o>s&&(s=o)}for(const a of e)for(let o=0;o<r;o++)a[o]/=s}}(n),{duration:t,length:n[0].length,sampleRate:n[0].length/t,numberOfChannels:n.length,getChannelData:e=>n==null?void 0:n[e],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function xt(n,t){const e=t.xmlns?document.createElementNS(t.xmlns,n):document.createElement(n);for(const[i,r]of Object.entries(t))if(i==="children")for(const[s,a]of Object.entries(t))typeof a=="string"?e.appendChild(document.createTextNode(a)):e.appendChild(xt(s,a));else i==="style"?Object.assign(e.style,r):i==="textContent"?e.textContent=r:e.setAttribute(i,r.toString());return e}function ft(n,t,e){const i=xt(n,t||{});return e==null||e.appendChild(i),i}var pe=Object.freeze({__proto__:null,createElement:ft,default:ft});const me={fetchBlob:function(n,t,e){return E(this,void 0,void 0,function*(){const i=yield fetch(n,e);if(i.status>=400)throw new Error(`Failed to fetch ${n}: ${i.status} (${i.statusText})`);return function(r,s){E(this,void 0,void 0,function*(){if(!r.body||!r.headers)return;const a=r.body.getReader(),o=Number(r.headers.get("Content-Length"))||0;let d=0;const c=p=>E(this,void 0,void 0,function*(){d+=(p==null?void 0:p.length)||0;const h=Math.round(d/o*100);s(h)}),l=()=>E(this,void 0,void 0,function*(){let p;try{p=yield a.read()}catch{return}p.done||(c(p.value),yield l())});l()})}(i.clone(),t),i.blob()})}};class fe extends ${constructor(t){super(),this.isExternalMedia=!1,t.media?(this.media=t.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),t.mediaControls&&(this.media.controls=!0),t.autoplay&&(this.media.autoplay=!0),t.playbackRate!=null&&this.onMediaEvent("canplay",()=>{t.playbackRate!=null&&(this.media.playbackRate=t.playbackRate)},{once:!0})}onMediaEvent(t,e,i){return this.media.addEventListener(t,e,i),()=>this.media.removeEventListener(t,e,i)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const t=this.getSrc();t.startsWith("blob:")&&URL.revokeObjectURL(t)}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,e){const i=this.getSrc();if(t&&i===t)return;this.revokeSrc();const r=e instanceof Blob&&(this.canPlayType(e.type)||!t)?URL.createObjectURL(e):t;try{this.media.src=r}catch{this.media.src=t}}destroy(){this.media.pause(),this.isExternalMedia||(this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(t){this.media=t}play(){return E(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=t}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,e){e!=null&&(this.media.preservesPitch=e),this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){return this.media.setSinkId(t)}}class U extends ${constructor(t,e){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.subscriptions=[],this.options=t;const i=this.parentFromOptionsContainer(t.container);this.parent=i;const[r,s]=this.initHtml();i.appendChild(r),this.container=r,this.scrollContainer=s.querySelector(".scroll"),this.wrapper=s.querySelector(".wrapper"),this.canvasWrapper=s.querySelector(".canvases"),this.progressWrapper=s.querySelector(".progress"),this.cursor=s.querySelector(".cursor"),e&&s.appendChild(e),this.initEvents()}parentFromOptionsContainer(t){let e;if(typeof t=="string"?e=document.querySelector(t):t instanceof HTMLElement&&(e=t),!e)throw new Error("Container not found");return e}initEvents(){const t=e=>{const i=this.wrapper.getBoundingClientRect(),r=e.clientX-i.left,s=e.clientY-i.top;return[r/i.width,s/i.height]};if(this.wrapper.addEventListener("click",e=>{const[i,r]=t(e);this.emit("click",i,r)}),this.wrapper.addEventListener("dblclick",e=>{const[i,r]=t(e);this.emit("dblclick",i,r)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:e,scrollWidth:i,clientWidth:r}=this.scrollContainer,s=e/i,a=(e+r)/i;this.emit("scroll",s,a,e,e+r)}),typeof ResizeObserver=="function"){const e=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{e().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;t===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=t,this.reRender())}initDrag(){this.subscriptions.push(function(t,e,i,r,s=3,a=0,o=100){if(!t)return()=>{};const d=matchMedia("(pointer: coarse)").matches;let c=()=>{};const l=p=>{if(p.button!==a)return;p.preventDefault(),p.stopPropagation();let h=p.clientX,m=p.clientY,f=!1;const b=Date.now(),g=C=>{if(C.preventDefault(),C.stopPropagation(),d&&Date.now()-b<o)return;const D=C.clientX,W=C.clientY,M=D-h,A=W-m;if(f||Math.abs(M)>s||Math.abs(A)>s){const I=t.getBoundingClientRect(),{left:F,top:L}=I;f||(i==null||i(h-F,m-L),f=!0),e(M,A,D-F,W-L),h=D,m=W}},w=C=>{if(f){const D=C.clientX,W=C.clientY,M=t.getBoundingClientRect(),{left:A,top:I}=M;r==null||r(D-A,W-I)}c()},y=C=>{C.relatedTarget&&C.relatedTarget!==document.documentElement||w(C)},P=C=>{f&&(C.stopPropagation(),C.preventDefault())},T=C=>{f&&C.preventDefault()};document.addEventListener("pointermove",g),document.addEventListener("pointerup",w),document.addEventListener("pointerout",y),document.addEventListener("pointercancel",y),document.addEventListener("touchmove",T,{passive:!1}),document.addEventListener("click",P,{capture:!0}),c=()=>{document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",w),document.removeEventListener("pointerout",y),document.removeEventListener("pointercancel",y),document.removeEventListener("touchmove",T),setTimeout(()=>{document.removeEventListener("click",P,{capture:!0})},10)}};return t.addEventListener("pointerdown",l),()=>{c(),t.removeEventListener("pointerdown",l)}}(this.wrapper,(t,e,i)=>{this.emit("drag",Math.max(0,Math.min(1,i/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))}))}getHeight(t,e){var i;const r=((i=this.audioData)===null||i===void 0?void 0:i.numberOfChannels)||1;if(t==null)return 128;if(!isNaN(Number(t)))return Number(t);if(t==="auto"){const s=this.parent.clientHeight||128;return e!=null&&e.every(a=>!a.overlay)?s/r:s}return 128}initHtml(){const t=document.createElement("div"),e=t.attachShadow({mode:"open"}),i=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return e.innerHTML=`
1
+ import{r as u,E as H,_ as V,aV as ut,be as Vt,bf as $t,bg as jt,A as G,D as X,R as yt,aw as Gt,n as x,bh as Xt,ax as N,j as v,bi as qt,b2 as Yt,bj as Kt,bk as Zt,ad as Jt,ab as Qt,bl as Q,am as te,ap as ee,bm as ie,bn as ne,b6 as se,bo as re}from"./index.V22boKfv.js";import{u as oe,F as ae}from"./FormClearHelper.Cwi_MzMn.js";import{T as le,a as pt}from"./Toolbar.FUQUVTZ-.js";import{u as ce}from"./Hooks.ByXcZDtQ.js";import{c as de}from"./createDownloadLinkElement.DZMwyjvU.js";import{F as he,D as ue}from"./FileDownload.esm.xvAdcisp.js";var wt=u.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(H,V({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),u.createElement("g",{fill:"none"},u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24})),u.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),u.createElement("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});wt.displayName="Mic";var Ct=u.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(H,V({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),u.createElement("rect",{width:24,height:24,fill:"none"}),u.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))});Ct.displayName="Pause";var St=u.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(H,V({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),u.createElement("rect",{width:24,height:24,fill:"none"}),u.createElement("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 000-1.69L9.54 5.98A.998.998 0 008 6.82z"}))});St.displayName="PlayArrow";var Rt=u.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(H,V({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),u.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),u.createElement("path",{d:"M17.65 6.35a7.95 7.95 0 00-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 007.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 01-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0112 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z"}))});Rt.displayName="Refresh";var Et=u.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(H,V({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),u.createElement("g",{fill:"none"},u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24})),u.createElement("path",{fillRule:"evenodd",d:"M9 16h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}))});Et.displayName="StopCircle";function E(n,t,e,i){return new(e||(e=Promise))(function(r,s){function a(c){try{d(i.next(c))}catch(l){s(l)}}function o(c){try{d(i.throw(c))}catch(l){s(l)}}function d(c){var l;c.done?r(c.value):(l=c.value,l instanceof e?l:new e(function(p){p(l)})).then(a,o)}d((i=i.apply(n,t||[])).next())})}let $=class{constructor(){this.listeners={}}on(t,e,i){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(e),i==null?void 0:i.once){const r=()=>{this.un(t,r),this.un(t,e)};return this.on(t,r),r}return()=>this.un(t,e)}un(t,e){var i;(i=this.listeners[t])===null||i===void 0||i.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach(i=>i(...e))}};const mt={decode:function(n,t){return E(this,void 0,void 0,function*(){const e=new AudioContext({sampleRate:t});return e.decodeAudioData(n).finally(()=>e.close())})},createBuffer:function(n,t){return typeof n[0]=="number"&&(n=[n]),function(e){const i=e[0];if(i.some(r=>r>1||r<-1)){const r=i.length;let s=0;for(let a=0;a<r;a++){const o=Math.abs(i[a]);o>s&&(s=o)}for(const a of e)for(let o=0;o<r;o++)a[o]/=s}}(n),{duration:t,length:n[0].length,sampleRate:n[0].length/t,numberOfChannels:n.length,getChannelData:e=>n==null?void 0:n[e],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function xt(n,t){const e=t.xmlns?document.createElementNS(t.xmlns,n):document.createElement(n);for(const[i,r]of Object.entries(t))if(i==="children")for(const[s,a]of Object.entries(t))typeof a=="string"?e.appendChild(document.createTextNode(a)):e.appendChild(xt(s,a));else i==="style"?Object.assign(e.style,r):i==="textContent"?e.textContent=r:e.setAttribute(i,r.toString());return e}function ft(n,t,e){const i=xt(n,t||{});return e==null||e.appendChild(i),i}var pe=Object.freeze({__proto__:null,createElement:ft,default:ft});const me={fetchBlob:function(n,t,e){return E(this,void 0,void 0,function*(){const i=yield fetch(n,e);if(i.status>=400)throw new Error(`Failed to fetch ${n}: ${i.status} (${i.statusText})`);return function(r,s){E(this,void 0,void 0,function*(){if(!r.body||!r.headers)return;const a=r.body.getReader(),o=Number(r.headers.get("Content-Length"))||0;let d=0;const c=p=>E(this,void 0,void 0,function*(){d+=(p==null?void 0:p.length)||0;const h=Math.round(d/o*100);s(h)}),l=()=>E(this,void 0,void 0,function*(){let p;try{p=yield a.read()}catch{return}p.done||(c(p.value),yield l())});l()})}(i.clone(),t),i.blob()})}};class fe extends ${constructor(t){super(),this.isExternalMedia=!1,t.media?(this.media=t.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),t.mediaControls&&(this.media.controls=!0),t.autoplay&&(this.media.autoplay=!0),t.playbackRate!=null&&this.onMediaEvent("canplay",()=>{t.playbackRate!=null&&(this.media.playbackRate=t.playbackRate)},{once:!0})}onMediaEvent(t,e,i){return this.media.addEventListener(t,e,i),()=>this.media.removeEventListener(t,e,i)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const t=this.getSrc();t.startsWith("blob:")&&URL.revokeObjectURL(t)}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,e){const i=this.getSrc();if(t&&i===t)return;this.revokeSrc();const r=e instanceof Blob&&(this.canPlayType(e.type)||!t)?URL.createObjectURL(e):t;try{this.media.src=r}catch{this.media.src=t}}destroy(){this.media.pause(),this.isExternalMedia||(this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(t){this.media=t}play(){return E(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=t}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,e){e!=null&&(this.media.preservesPitch=e),this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){return this.media.setSinkId(t)}}class U extends ${constructor(t,e){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.subscriptions=[],this.options=t;const i=this.parentFromOptionsContainer(t.container);this.parent=i;const[r,s]=this.initHtml();i.appendChild(r),this.container=r,this.scrollContainer=s.querySelector(".scroll"),this.wrapper=s.querySelector(".wrapper"),this.canvasWrapper=s.querySelector(".canvases"),this.progressWrapper=s.querySelector(".progress"),this.cursor=s.querySelector(".cursor"),e&&s.appendChild(e),this.initEvents()}parentFromOptionsContainer(t){let e;if(typeof t=="string"?e=document.querySelector(t):t instanceof HTMLElement&&(e=t),!e)throw new Error("Container not found");return e}initEvents(){const t=e=>{const i=this.wrapper.getBoundingClientRect(),r=e.clientX-i.left,s=e.clientY-i.top;return[r/i.width,s/i.height]};if(this.wrapper.addEventListener("click",e=>{const[i,r]=t(e);this.emit("click",i,r)}),this.wrapper.addEventListener("dblclick",e=>{const[i,r]=t(e);this.emit("dblclick",i,r)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:e,scrollWidth:i,clientWidth:r}=this.scrollContainer,s=e/i,a=(e+r)/i;this.emit("scroll",s,a,e,e+r)}),typeof ResizeObserver=="function"){const e=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{e().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;t===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=t,this.reRender())}initDrag(){this.subscriptions.push(function(t,e,i,r,s=3,a=0,o=100){if(!t)return()=>{};const d=matchMedia("(pointer: coarse)").matches;let c=()=>{};const l=p=>{if(p.button!==a)return;p.preventDefault(),p.stopPropagation();let h=p.clientX,m=p.clientY,f=!1;const b=Date.now(),g=C=>{if(C.preventDefault(),C.stopPropagation(),d&&Date.now()-b<o)return;const D=C.clientX,W=C.clientY,M=D-h,A=W-m;if(f||Math.abs(M)>s||Math.abs(A)>s){const I=t.getBoundingClientRect(),{left:F,top:L}=I;f||(i==null||i(h-F,m-L),f=!0),e(M,A,D-F,W-L),h=D,m=W}},w=C=>{if(f){const D=C.clientX,W=C.clientY,M=t.getBoundingClientRect(),{left:A,top:I}=M;r==null||r(D-A,W-I)}c()},y=C=>{C.relatedTarget&&C.relatedTarget!==document.documentElement||w(C)},P=C=>{f&&(C.stopPropagation(),C.preventDefault())},T=C=>{f&&C.preventDefault()};document.addEventListener("pointermove",g),document.addEventListener("pointerup",w),document.addEventListener("pointerout",y),document.addEventListener("pointercancel",y),document.addEventListener("touchmove",T,{passive:!1}),document.addEventListener("click",P,{capture:!0}),c=()=>{document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",w),document.removeEventListener("pointerout",y),document.removeEventListener("pointercancel",y),document.removeEventListener("touchmove",T),setTimeout(()=>{document.removeEventListener("click",P,{capture:!0})},10)}};return t.addEventListener("pointerdown",l),()=>{c(),t.removeEventListener("pointerdown",l)}}(this.wrapper,(t,e,i)=>{this.emit("drag",Math.max(0,Math.min(1,i/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))}))}getHeight(t,e){var i;const r=((i=this.audioData)===null||i===void 0?void 0:i.numberOfChannels)||1;if(t==null)return 128;if(!isNaN(Number(t)))return Number(t);if(t==="auto"){const s=this.parent.clientHeight||128;return e!=null&&e.every(a=>!a.overlay)?s/r:s}return 128}initHtml(){const t=document.createElement("div"),e=t.attachShadow({mode:"open"}),i=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return e.innerHTML=`
2
2
  <style${i?` nonce="${i}"`:""}>
3
3
  :host {
4
4
  user-select: none;