streamlit-nightly 1.41.2.dev20250120__py2.py3-none-any.whl → 1.41.2.dev20250123__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 (93) hide show
  1. streamlit/elements/vega_charts.py +19 -5
  2. streamlit/static/index.html +2 -2
  3. streamlit/static/static/js/{FileDownload.esm.DW9qPsuf.js → FileDownload.esm.t1Hil-y4.js} +1 -1
  4. streamlit/static/static/js/{FormClearHelper.BP4f-wKq.js → FormClearHelper.rBcBHx-q.js} +1 -1
  5. streamlit/static/static/js/{Hooks.DNhdjC_E.js → Hooks.B8TnuVtR.js} +1 -1
  6. streamlit/static/static/js/{InputInstructions.6chqAOMM.js → InputInstructions.CopSVRMj.js} +1 -1
  7. streamlit/static/static/js/ProgressBar.CH2O9ehW.js +2 -0
  8. streamlit/static/static/js/{RenderInPortalIfExists.cTCR1GXI.js → RenderInPortalIfExists.MRfetJYl.js} +1 -1
  9. streamlit/static/static/js/Toolbar.CDCMZRKs.js +1 -0
  10. streamlit/static/static/js/{base-input.DIQMGXMv.js → base-input.D6xvdW3E.js} +1 -1
  11. streamlit/static/static/js/{createSuper.Do1oR0VE.js → createSuper.DoZ28Bia.js} +1 -1
  12. streamlit/static/static/js/{data-grid-overlay-editor.0VbWmjRF.js → data-grid-overlay-editor.DXCddEab.js} +1 -1
  13. streamlit/static/static/js/{downloader.DFiVHqec.js → downloader.C0cVY44J.js} +1 -1
  14. streamlit/static/static/js/{es6.zKs-XsJ1.js → es6.BLqxZgqS.js} +2 -2
  15. streamlit/static/static/js/{getPrototypeOf.B4u2uvgs.js → getPrototypeOf.kzwmebxc.js} +1 -1
  16. streamlit/static/static/js/{iframeResizer.contentWindow.Cfik70yz.js → iframeResizer.contentWindow.DD6xL-U3.js} +1 -1
  17. streamlit/static/static/js/{index.CTVIegXx.js → index.2GeiiWrC.js} +2 -2
  18. streamlit/static/static/js/{index.CEyo-K3a.js → index.8xFDRnWS.js} +1 -1
  19. streamlit/static/static/js/index.B1sQCRIs.js +1 -0
  20. streamlit/static/static/js/index.B7TeUVfZ.js +1 -0
  21. streamlit/static/static/js/{index.DZ31yuLl.js → index.BXD6MmFg.js} +1 -1
  22. streamlit/static/static/js/index.B_czjYL4.js +197 -0
  23. streamlit/static/static/js/index.Bbg2PQIH.js +3 -0
  24. streamlit/static/static/js/{index.BTG890If.js → index.BcaoSc9o.js} +13 -13
  25. streamlit/static/static/js/index.BgLhUQOc.js +1 -0
  26. streamlit/static/static/js/index.BiBAL3w8.js +1 -0
  27. streamlit/static/static/js/index.BiI5Rn5J.js +1 -0
  28. streamlit/static/static/js/{index.Cf3IO5h3.js → index.C5Aw0Bsm.js} +2 -2
  29. streamlit/static/static/js/index.CBPL_Qdc.js +2 -0
  30. streamlit/static/static/js/{index.DOO7x26L.js → index.CC_Xa8j8.js} +1 -1
  31. streamlit/static/static/js/{index.DrXNN7P-.js → index.CDOn4Mmb.js} +1 -1
  32. streamlit/static/static/js/index.CGJeU1TE.js +1 -0
  33. streamlit/static/static/js/index.C_RLZUid.js +1 -0
  34. streamlit/static/static/js/{index.BST23kXB.js → index.CbzQ6_1A.js} +1 -1
  35. streamlit/static/static/js/{index.CAOOu98T.js → index.CfbgQbfG.js} +1 -1
  36. streamlit/static/static/js/{index.Ca6320CT.js → index.Co72ELt_.js} +57 -57
  37. streamlit/static/static/js/{index.CBzV6LFM.js → index.CxXOHy-q.js} +1 -1
  38. streamlit/static/static/js/index.DCzHBbe3.js +4 -0
  39. streamlit/static/static/js/{index.D1gCIQ1C.js → index.DDG-Feum.js} +3 -3
  40. streamlit/static/static/js/{index.DwhO3jNA.js → index.DDQotaI-.js} +2 -2
  41. streamlit/static/static/js/{index.DqoGamDV.js → index.DDTpwEXp.js} +2 -2
  42. streamlit/static/static/js/{index.CRt7DW67.js → index.DM6381fy.js} +1 -1
  43. streamlit/static/static/js/{index.B-nmc5wO.js → index.DMsfllEz.js} +1 -1
  44. streamlit/static/static/js/{index.Bht8Ku38.js → index.DVTjGtXy.js} +1 -1
  45. streamlit/static/static/js/index.DY7yFBFm.js +1 -0
  46. streamlit/static/static/js/{index.B94PZPeI.js → index.DZLrzThj.js} +1 -1
  47. streamlit/static/static/js/{index.BMaqPVq6.js → index.DdbxtRVV.js} +1 -1
  48. streamlit/static/static/js/{index.5idohwqh.js → index.DiFAEZZx.js} +1 -1
  49. streamlit/static/static/js/index.Dlgg4mQO.js +1 -0
  50. streamlit/static/static/js/index.Dn_JS5iX.js +1 -0
  51. streamlit/static/static/js/index.R_5wwEBR.js +1 -0
  52. streamlit/static/static/js/{index.BsLun9mO.js → index.cBacy4AZ.js} +2 -2
  53. streamlit/static/static/js/{index.DuwDNwdn.js → index.d7tjiBmt.js} +1 -1
  54. streamlit/static/static/js/{input.hHglMwJu.js → input.uD0SWj1g.js} +1 -1
  55. streamlit/static/static/js/{memory.BotKhGox.js → memory.DPlzjnEG.js} +1 -1
  56. streamlit/static/static/js/{mergeWith.dOmek2Nz.js → mergeWith.BtOxrWSG.js} +1 -1
  57. streamlit/static/static/js/{number-overlay-editor.DIhHlsX3.js → number-overlay-editor.B6hW-IjG.js} +1 -1
  58. streamlit/static/static/js/{sandbox.BlY_yl1S.js → sandbox.-4pm4kKk.js} +1 -1
  59. streamlit/static/static/js/{slicedToArray.xYln54_I.js → slicedToArray.CNy95D8Y.js} +1 -1
  60. streamlit/static/static/js/{textarea.B9cq_go8.js → textarea.CcFxFL7j.js} +1 -1
  61. streamlit/static/static/js/{timepicker.R8Q_Yl7H.js → timepicker.Char5nqs.js} +1 -1
  62. streamlit/static/static/js/{uniqueId.CKxaEvFc.js → uniqueId.CNOVHTVB.js} +1 -1
  63. streamlit/static/static/js/{useBasicWidgetState.DY0Kwuur.js → useBasicWidgetState.Bu8UvcoI.js} +1 -1
  64. streamlit/static/static/js/{useOnInputChange.CAEw-Xl5.js → useOnInputChange.CF_fWusY.js} +1 -1
  65. streamlit/static/static/js/withFullScreenWrapper.bEPeWQAF.js +1 -0
  66. streamlit/user_info.py +364 -11
  67. {streamlit_nightly-1.41.2.dev20250120.dist-info → streamlit_nightly-1.41.2.dev20250123.dist-info}/METADATA +1 -1
  68. {streamlit_nightly-1.41.2.dev20250120.dist-info → streamlit_nightly-1.41.2.dev20250123.dist-info}/RECORD +75 -75
  69. streamlit/static/static/js/ProgressBar.D-DmAAiN.js +0 -2
  70. streamlit/static/static/js/Toolbar.IB7xmaQ3.js +0 -1
  71. streamlit/static/static/js/index.3XcxQYzA.js +0 -1
  72. streamlit/static/static/js/index.9Tcn_7uz.js +0 -1
  73. streamlit/static/static/js/index.BBGa9-EC.js +0 -1
  74. streamlit/static/static/js/index.BCrCxn8x.js +0 -1
  75. streamlit/static/static/js/index.BVS_Npso.js +0 -2
  76. streamlit/static/static/js/index.BuQ40cTc.js +0 -1
  77. streamlit/static/static/js/index.C2x7lWrn.js +0 -3
  78. streamlit/static/static/js/index.CLEzQJ1l.js +0 -1
  79. streamlit/static/static/js/index.Ci9WPusu.js +0 -1
  80. streamlit/static/static/js/index.CkJysN98.js +0 -1
  81. streamlit/static/static/js/index.CkgGJqBi.js +0 -197
  82. streamlit/static/static/js/index.DfqbHOMy.js +0 -1
  83. streamlit/static/static/js/index.DkCDzK1i.js +0 -4
  84. streamlit/static/static/js/index.IHJq2nuU.js +0 -1
  85. streamlit/static/static/js/index.VSTrmYr_.js +0 -1
  86. streamlit/static/static/js/withFullScreenWrapper.Def4ZoAl.js +0 -1
  87. /streamlit/static/static/css/{index.B26BQfSF.css → index.Bmkmz40k.css} +0 -0
  88. /streamlit/static/static/css/{index.BWGEWL3m.css → index.DBTu7gXp.css} +0 -0
  89. /streamlit/static/static/css/{index.CG16XVnL.css → index.DzuxGC_t.css} +0 -0
  90. {streamlit_nightly-1.41.2.dev20250120.data → streamlit_nightly-1.41.2.dev20250123.data}/scripts/streamlit.cmd +0 -0
  91. {streamlit_nightly-1.41.2.dev20250120.dist-info → streamlit_nightly-1.41.2.dev20250123.dist-info}/WHEEL +0 -0
  92. {streamlit_nightly-1.41.2.dev20250120.dist-info → streamlit_nightly-1.41.2.dev20250123.dist-info}/entry_points.txt +0 -0
  93. {streamlit_nightly-1.41.2.dev20250120.dist-info → streamlit_nightly-1.41.2.dev20250123.dist-info}/top_level.txt +0 -0
@@ -1,2 +0,0 @@
1
- import{bu as g,c5 as Le,c6 as A,R as C,r as d,bv as O,ae as xe,aA as Te,b$ as ke,j as ze,bR as Ee}from"./index.Ca6320CT.js";var y={small:"small",medium:"medium",large:"large"},_;function L(){return L=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},L.apply(this,arguments)}function ae(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);r&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,a)}return t}function P(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?ae(Object(t),!0).forEach(function(a){b(e,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ae(Object(t)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(t,a))})}return e}function b(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function se(e){var r;return(r={},b(r,y.small,"2px"),b(r,y.medium,"4px"),b(r,y.large,"8px"),r)[e]}var I=g("div",function(e){return{width:"100%"}});I.displayName="StyledRoot";I.displayName="StyledRoot";var M=g("div",function(e){var r=e.$theme,t=r.sizing;return{display:"flex",marginLeft:t.scale500,marginRight:t.scale500,marginTop:t.scale500,marginBottom:t.scale500}});M.displayName="StyledBarContainer";M.displayName="StyledBarContainer";var D=g("div",function(e){var r=e.$theme,t=e.$size,a=e.$steps,n=r.colors,o=r.sizing,i=r.borders,s=i.useRoundedCorners?o.scale0:0;return P({borderTopLeftRadius:s,borderTopRightRadius:s,borderBottomRightRadius:s,borderBottomLeftRadius:s,backgroundColor:Le(n.progressbarTrackFill,"0.16"),height:se(t),flex:1,overflow:"hidden"},a<2?{}:{marginLeft:o.scale300,":first-child":{marginLeft:"0"}})});D.displayName="StyledBar";D.displayName="StyledBar";var H=g("div",function(e){var r=e.$theme,t=e.$value,a=e.$successValue,n=e.$steps,o=e.$index,i=e.$maxValue,s=e.$minValue,l=s===void 0?0:s,u=i||a,R=r.colors,B=r.sizing,$=r.borders,x="".concat(100-(t-l)*100/(u-l),"%"),m={default:"default",awaits:"awaits",inProgress:"inProgress",completed:"completed"},c=m.default;if(n>1){var T=(u-l)/n,j=(t-l)/(u-l)*100,k=Math.floor(j/T);o<k?c=m.completed:o===k?c=m.inProgress:c=m.awaits}var S=$.useRoundedCorners?B.scale0:0,h={transform:"translateX(-".concat(x,")")},N=c===m.inProgress?{animationDuration:"2.1s",animationIterationCount:"infinite",animationTimingFunction:r.animation.linearCurve,animationName:{"0%":{transform:"translateX(-102%)",opacity:1},"50%":{transform:"translateX(0%)",opacity:1},"100%":{transform:"translateX(0%)",opacity:0}}}:c===m.completed?{transform:"translateX(0%)"}:{transform:"translateX(-102%)"};return P({borderTopLeftRadius:S,borderTopRightRadius:S,borderBottomRightRadius:S,borderBottomLeftRadius:S,backgroundColor:R.accent,height:"100%",width:"100%",transform:"translateX(-102%)",transition:"transform 0.5s"},n>1?N:h)});H.displayName="StyledBarProgress";H.displayName="StyledBarProgress";var W=g("div",function(e){var r=e.$theme,t=e.$isLeft,a=t===void 0?!1:t,n=e.$size,o=n===void 0?y.medium:n,i=r.colors,s=r.sizing,l=r.borders,u=l.useRoundedCorners?s.scale0:0,R=se(o),B={display:"inline-block",flex:1,marginLeft:"auto",marginRight:"auto",transitionProperty:"background-position",animationDuration:"1.5s",animationIterationCount:"infinite",animationTimingFunction:r.animation.linearCurve,backgroundSize:"300% auto",backgroundRepeat:"no-repeat",backgroundPositionX:a?"-50%":"150%",backgroundImage:"linear-gradient(".concat(a?"90":"270","deg, transparent 0%, ").concat(i.accent," 25%, ").concat(i.accent," 75%, transparent 100%)"),animationName:a?{"0%":{backgroundPositionX:"-50%"},"33%":{backgroundPositionX:"50%"},"66%":{backgroundPositionX:"50%"},"100%":{backgroundPositionX:"150%"}}:{"0%":{backgroundPositionX:"150%"},"33%":{backgroundPositionX:"50%"},"66%":{backgroundPositionX:"50%"},"100%":{backgroundPositionX:"-50%"}}};return P(P({},a?{borderTopLeftRadius:u,borderBottomLeftRadius:u}:{borderTopRightRadius:u,borderBottomRightRadius:u}),{},{height:R},B)});W.displayName="StyledInfiniteBar";W.displayName="StyledInfiniteBar";var F=g("div",function(e){return P(P({textAlign:"center"},e.$theme.typography.font150),{},{color:e.$theme.colors.contentTertiary})});F.displayName="StyledLabel";F.displayName="StyledLabel";var f=(_={},b(_,y.large,{d:"M47.5 4H71.5529C82.2933 4 91 12.9543 91 24C91 35.0457 82.2933 44 71.5529 44H23.4471C12.7067 44 4 35.0457 4 24C4 12.9543 12.7067 4 23.4471 4H47.5195",width:95,height:48,strokeWidth:8,typography:"LabelLarge"}),b(_,y.medium,{d:"M39 2H60.5833C69.0977 2 76 9.16344 76 18C76 26.8366 69.0977 34 60.5833 34H17.4167C8.90228 34 2 26.8366 2 18C2 9.16344 8.90228 2 17.4167 2H39.0195",width:78,height:36,strokeWidth:4,typography:"LabelMedium"}),b(_,y.small,{d:"M32 1H51.6271C57.9082 1 63 6.37258 63 13C63 19.6274 57.9082 25 51.6271 25H12.3729C6.09181 25 1 19.6274 1 13C1 6.37258 6.09181 1 12.3729 1H32.0195",width:64,height:26,strokeWidth:2,typography:"LabelSmall"}),_),le=g("div",function(e){var r=e.$size,t=e.$inline;return{width:f[r].width+"px",height:f[r].height+"px",position:"relative",display:t?"inline-flex":"flex",alignItems:"center",justifyContent:"center"}});le.displayName="StyledProgressBarRoundedRoot";le.displayName="StyledProgressBarRoundedRoot";var G=g("svg",function(e){var r=e.$size;return{width:f[r].width+"px",height:f[r].height+"px",position:"absolute",fill:"none"}});G.displayName="_StyledProgressBarRoundedSvg";G.displayName="_StyledProgressBarRoundedSvg";A(G,function(e){return function(t){return C.createElement(e,L({viewBox:"0 0 ".concat(f[t.$size].width," ").concat(f[t.$size].height),xmlns:"http://www.w3.org/2000/svg"},t))}});var U=g("path",function(e){var r=e.$theme,t=e.$size;return{stroke:r.colors.backgroundTertiary,strokeWidth:f[t].strokeWidth+"px"}});U.displayName="_StyledProgressBarRoundedTrackBackground";U.displayName="_StyledProgressBarRoundedTrackBackground";A(U,function(e){return function(t){return C.createElement(e,L({d:f[t.$size].d},t))}});var Z=g("path",function(e){var r=e.$theme,t=e.$size,a=e.$visible,n=e.$pathLength,o=e.$pathProgress;return{visibility:a?"visible":"hidden",stroke:r.colors.borderAccent,strokeWidth:f[t].strokeWidth+"px",strokeDasharray:n,strokeDashoffset:n*(1-o)+""}});Z.displayName="_StyledProgressBarRoundedTrackForeground";Z.displayName="_StyledProgressBarRoundedTrackForeground";A(Z,function(e){return function(t){return C.createElement(e,L({d:f[t.$size].d},t))}});var ue=g("div",function(e){var r=e.$theme,t=e.$size;return P({color:r.colors.contentPrimary},r.typography[f[t].typography])});ue.displayName="StyledProgressBarRoundedText";ue.displayName="StyledProgressBarRoundedText";function X(e){"@babel/helpers - typeof";return X=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},X(e)}var Ce=["overrides","getProgressLabel","value","size","steps","successValue","minValue","maxValue","showLabel","infinite","errorMessage","forwardedRef"];function p(){return p=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},p.apply(this,arguments)}function w(e,r){return Ve(e)||Xe(e,r)||Ne(e,r)||je()}function je(){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 Ne(e,r){if(e){if(typeof e=="string")return oe(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return oe(e,r)}}function oe(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,a=new Array(r);t<r;t++)a[t]=e[t];return a}function Xe(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var a=[],n=!0,o=!1,i,s;try{for(t=t.call(e);!(n=(i=t.next()).done)&&(a.push(i.value),!(r&&a.length===r));n=!0);}catch(l){o=!0,s=l}finally{try{!n&&t.return!=null&&t.return()}finally{if(o)throw s}}return a}}function Ve(e){if(Array.isArray(e))return e}function Ae(e,r){if(e==null)return{};var t=Ie(e,r),a,n;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)a=o[n],!(r.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(t[a]=e[a])}return t}function Ie(e,r){if(e==null)return{};var t={},a=Object.keys(e),n,o;for(o=0;o<a.length;o++)n=a[o],!(r.indexOf(n)>=0)&&(t[n]=e[n]);return t}function Me(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function De(e,r){for(var t=0;t<r.length;t++){var a=r[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function He(e,r,t){return r&&De(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function We(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&V(e,r)}function V(e,r){return V=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,n){return a.__proto__=n,a},V(e,r)}function Fe(e){var r=Ze();return function(){var a=E(e),n;if(r){var o=E(this).constructor;n=Reflect.construct(a,arguments,o)}else n=a.apply(this,arguments);return Ge(this,n)}}function Ge(e,r){if(r&&(X(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ue(e)}function Ue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ze(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},E(e)}function Ke(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var de=function(e){We(t,e);var r=Fe(t);function t(){return Me(this,t),r.apply(this,arguments)}return He(t,[{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var n=this.props,o=n.overrides,i=o===void 0?{}:o,s=n.getProgressLabel,l=n.value,u=n.size,R=n.steps,B=n.successValue,$=n.minValue,x=n.maxValue,m=n.showLabel,c=n.infinite,T=n.errorMessage,j=n.forwardedRef,k=Ae(n,Ce),S=this.props["aria-label"]||this.props.ariaLabel,h=x!==100?x:B,N=O(i.Root,I),K=w(N,2),fe=K[0],ge=K[1],pe=O(i.BarContainer,M),q=w(pe,2),me=q[0],ye=q[1],he=O(i.Bar,D),J=w(he,2),ve=J[0],be=J[1],Pe=O(i.BarProgress,H),Q=w(Pe,2),Re=Q[0],$e=Q[1],Se=O(i.Label,F),Y=w(Se,2),Oe=Y[0],we=Y[1],Be=O(i.InfiniteBar,W),ee=w(Be,2),re=ee[0],te=ee[1],v={$infinite:c,$size:u,$steps:R,$successValue:h,$minValue:$,$maxValue:h,$value:l};function _e(){for(var ne=[],z=0;z<R;z++)ne.push(d.createElement(ve,p({key:z},v,be),d.createElement(Re,p({$index:z},v,$e))));return ne}return d.createElement(fe,p({ref:j,"data-baseweb":"progress-bar",role:"progressbar","aria-label":S||s(l,h,$),"aria-valuenow":c?null:l,"aria-valuemin":c?null:$,"aria-valuemax":c?null:h,"aria-invalid":T?!0:null,"aria-errormessage":T},k,v,ge),d.createElement(me,p({},v,ye),c?d.createElement(d.Fragment,null,d.createElement(re,p({$isLeft:!0,$size:v.$size},te)),d.createElement(re,p({$size:v.$size},te))):_e()),m&&d.createElement(Oe,p({},v,we),s(l,h,$)))}}]),t}(d.Component);Ke(de,"defaultProps",{getProgressLabel:function(r,t,a){return"".concat(Math.round((r-a)/(t-a)*100),"% Loaded")},infinite:!1,overrides:{},showLabel:!1,size:y.medium,steps:1,successValue:100,minValue:0,maxValue:100,value:0});var ce=d.forwardRef(function(e,r){return d.createElement(de,p({forwardedRef:r},e))});ce.displayName="ProgressBar";var ie;(function(e){e.EXTRASMALL="xs",e.SMALL="sm",e.MEDIUM="md",e.LARGE="lg",e.EXTRALARGE="xl"})(ie||(ie={}));function Je({value:e,width:r,size:t="sm",overrides:a}){const n=xe(),o={xs:n.spacing.twoXS,sm:n.spacing.sm,md:n.spacing.lg,lg:n.spacing.xl,xl:n.spacing.twoXL},{activeTheme:i}=C.useContext(Te),s=!ke(i),l={BarContainer:{style:{marginTop:n.spacing.none,marginBottom:n.spacing.none,marginRight:n.spacing.none,marginLeft:n.spacing.none}},Bar:{style:({$theme:u})=>({width:r?r.toString():void 0,marginTop:n.spacing.none,marginBottom:n.spacing.none,marginRight:n.spacing.none,marginLeft:n.spacing.none,height:o[t],backgroundColor:u.colors.progressbarTrackFill,borderTopLeftRadius:n.spacing.twoXS,borderTopRightRadius:n.spacing.twoXS,borderBottomLeftRadius:n.spacing.twoXS,borderBottomRightRadius:n.spacing.twoXS})},BarProgress:{style:()=>({backgroundColor:s?n.colors.primary:n.colors.blue70,borderTopLeftRadius:n.spacing.twoXS,borderTopRightRadius:n.spacing.twoXS,borderBottomLeftRadius:n.spacing.twoXS,borderBottomRightRadius:n.spacing.twoXS})}};return ze(ce,{value:e,overrides:Ee(l,a)})}export{Je as P,ie as S};
@@ -1 +0,0 @@
1
- import{r as a,E as m,_ as p,n as d,ay as b,ae as x,j as n,bt as g,av as y,ba as E,aB as h,b6 as T,bn as w,bo as z}from"./index.Ca6320CT.js";var f=a.forwardRef(function(t,o){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(m,p({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:o}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}))});f.displayName="Fullscreen";var u=a.forwardRef(function(t,o){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(m,p({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:o}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}))});u.displayName="FullscreenExit";const c="-2.4rem",B=d("div",{target:"esvuqrb0"})(({theme:t,locked:o,target:e})=>({padding:`${t.spacing.sm} 0 ${t.spacing.sm} ${t.spacing.sm}`,position:"absolute",top:o?c:"-1rem",right:t.spacing.none,transition:"none",...!o&&{opacity:0,"&:active, &:focus-visible, &:hover":{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:c},...e&&{[`${e}:hover &, ${e}:active &, ${e}:focus-visible &`]:{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:c}}}})),V=d("div",{target:"esvuqrb1"})(({theme:t})=>({color:b(t)?t.colors.fadedText60:t.colors.bodyText,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end",boxShadow:"1px 2px 8px rgba(0, 0, 0, 0.08)",borderRadius:t.radii.default,backgroundColor:t.colors.lightenedBg05,width:"fit-content",zIndex:t.zIndices.sidebar+1})),H=d("div",{target:"esvuqrb2"})(({width:t,height:o,useContainerWidth:e,topCentered:s})=>({position:"relative",height:e&&o?o:"fit-content",width:e?t:"fit-content",maxWidth:"100%",...s?{display:"flex",justifyContent:"center"}:{}}));function v({label:t,show_label:o,icon:e,onClick:s}){const l=x(),i=o?t:"";return n("div",{"data-testid":"stElementToolbarButton",children:n(g,{content:n(y,{source:t,allowHTML:!1,style:{fontSize:l.fontSizes.sm}}),placement:E.TOP,onMouseEnterDelay:1e3,inline:!0,children:h(z,{onClick:r=>{s&&s(),r.stopPropagation()},kind:T.ELEMENT_TOOLBAR,"aria-label":t,children:[e&&n(w,{content:e,size:"md",testid:"stElementToolbarButtonIcon"}),i&&n("span",{children:i})]})})})}const M=({onExpand:t,onCollapse:o,isFullScreen:e,locked:s,children:l,target:i,disableFullscreenMode:r})=>n(B,{className:"stElementToolbar","data-testid":"stElementToolbar",locked:s||e,target:i,children:h(V,{children:[l,t&&!r&&!e&&n(v,{label:"Fullscreen",icon:f,onClick:()=>t()}),o&&!r&&e&&n(v,{label:"Close fullscreen",icon:u,onClick:()=>o()})]})});export{H as S,M as T,v as a};
@@ -1 +0,0 @@
1
- import{n as a,bl as S,i as x,R as p,aA as f,b$ as g,j as i,c0 as m,aB as $,av as T}from"./index.Ca6320CT.js";const b=a(S,{shouldForwardProp:x,target:"e1ira7tx0"})(({theme:e,usingCustomTheme:s})=>({fontSize:e.fontSizes.sm,width:e.sizes.spinnerSize,height:e.sizes.spinnerSize,borderWidth:e.sizes.spinnerThickness,radius:e.radii.md,justifyContents:"center",padding:e.spacing.none,margin:e.spacing.none,borderColor:e.colors.borderColor,borderTopColor:s?e.colors.primary:e.colors.blue70,flexGrow:0,flexShrink:0})),h=a("div",{target:"e1ira7tx1"})(({theme:e,width:s,cache:t})=>({width:s,...t?{paddingBottom:e.spacing.lg,background:`linear-gradient(to bottom, ${e.colors.bgColor} 0%, ${e.colors.bgColor} 80%, transparent 100%)`}:null})),C=a("div",{target:"e1ira7tx2"})(({theme:e})=>({opacity:.6,fontSize:e.fontSizes.sm})),y=a("div",{target:"e1ira7tx3"})(({theme:e})=>({display:"flex",gap:e.spacing.sm,alignItems:"center",width:"100%"})),z=e=>{const s=Math.floor(e/3600),t=Math.floor(e%3600/60),n=e%60;if(s===0&&t===0)return`(${n.toFixed(1)} seconds)`;if(s===0){const l=`${t} minute${t===1?"":"s"}`,d=n===0?"":`, ${n.toFixed(1)} seconds`;return`(${l}${d})`}const o=`${s} hour${s===1?"":"s"}`,r=t===0?"":`, ${t} minute${t===1?"":"s"}`,c=n===0?"":`, ${n.toFixed(1)} seconds`;return`(${o}${r}${c})`};function v({width:e,element:s}){const{activeTheme:t}=p.useContext(f),n=!g(t),{cache:o,showTime:r}=s,[c,l]=p.useState(0);return p.useEffect(()=>{if(!r)return;const d=setInterval(()=>{l(u=>u+.1)},100);return()=>clearInterval(d)},[r]),i(h,{className:m({stSpinner:!0,stCacheSpinner:o}),"data-testid":"stSpinner",width:e,cache:o,children:$(y,{children:[i(b,{usingCustomTheme:n}),i(T,{source:s.text,allowHTML:!1}),r&&i(C,{children:z(c)})]})})}export{v as default};
@@ -1 +0,0 @@
1
- import{n as L,r as i,ae as V,bX as O,bY as k,ap as H,aB as $,j as l,bq as N,bD as E,br as A,ba as D,bs as F,bW as U,bZ as j,bS as G,bB as K,b_ as Y}from"./index.Ca6320CT.js";import{a as _}from"./useBasicWidgetState.DY0Kwuur.js";import"./FormClearHelper.BP4f-wKq.js";const X=L("div",{target:"euzcfsp0"})(({theme:n})=>({"span[aria-disabled='true']":{background:n.colors.fadedText05}})),q=(n,t)=>n.getIntArrayValue(t),Z=n=>n.default??null,J=n=>n.value??null,Q=(n,t,a,u)=>{t.setIntArrayValue(n,a.value,{fromUi:a.fromUi},u)},ee=n=>{var y;const{element:t,widgetMgr:a,width:u,fragmentId:v}=n,e=V(),[o,g]=_({getStateFromWidgetMgr:q,getDefaultStateFromProto:Z,getCurrStateFromProto:J,updateWidgetMgrState:Q,element:t,widgetMgr:a,fragmentId:v}),m=t.maxSelections>0&&o.length>=t.maxSelections,x=i.useMemo(()=>{if(t.maxSelections===0)return"No results";if(o.length===t.maxSelections){const s=t.maxSelections!==1?"options":"option";return`You can only select up to ${t.maxSelections} ${s}. Remove an option first.`}return"No results"},[t.maxSelections,o.length]),z=i.useMemo(()=>o.map(s=>{const r=t.options[s];return{value:s.toString(),label:r}}),[t.options,o]),h=i.useCallback(s=>{const r=()=>{var d;const p=(d=s.option)==null?void 0:d.value;return parseInt(p,10)};switch(s.type){case"remove":return O(o,r());case"clear":return[];case"select":return o.concat([r()]);default:throw new Error(`State transition is unknown: ${s.type}`)}},[o]),w=i.useCallback(s=>{t.maxSelections&&s.type==="select"&&o.length>=t.maxSelections||g({value:h(s),fromUi:!0})},[t.maxSelections,h,g,o.length]),I=i.useCallback((s,r)=>{if(m)return[];const p=s.filter(d=>!o.includes(Number(d.value)));return k(p,r)},[m,o]),R={width:u},{options:c}=t,b=c.length===0?!0:n.disabled,M=c.length===0?"No options to select.":t.placeholder,T=c.map((s,r)=>({label:s,value:r.toString()})),W=c.length>10,[S,P]=i.useState(0),[f,C]=i.useState(!1),B=i.useCallback(()=>f?S:!o||o.length===0?0:o[o.length-1]*H(e.sizes.dropdownItemHeight),[o,f,S,e.sizes.dropdownItemHeight]);return $("div",{className:"stMultiSelect","data-testid":"stMultiSelect",style:R,children:[l(F,{label:t.label,disabled:b,labelVisibility:N((y=t.labelVisibility)==null?void 0:y.value),children:t.help&&l(E,{children:l(A,{content:t.help,placement:D.TOP_RIGHT})})}),l(X,{children:l(U,{options:T,labelKey:"label",valueKey:"value","aria-label":t.label,placeholder:M,type:j.select,multi:!0,onChange:w,value:z,disabled:b,size:"compact",noResultsMsg:x,filterOptions:I,closeOnSelect:!1,overrides:{Popover:{props:{overrides:{Body:{style:()=>({marginTop:e.spacing.px})}}}},SelectArrow:{component:G,props:{overrides:{Svg:{style:()=>({width:e.iconSizes.xl,height:e.iconSizes.xl})}}}},IconsContainer:{style:()=>({paddingRight:e.spacing.sm})},ControlContainer:{style:{minHeight:e.sizes.minElementHeight,borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth}},Placeholder:{style:()=>({flex:"inherit",opacity:"0.7"})},ValueContainer:{style:()=>({paddingLeft:e.spacing.sm,paddingTop:e.spacing.none,paddingBottom:e.spacing.none,paddingRight:e.spacing.none})},ClearIcon:{props:{overrides:{Svg:{style:{color:e.colors.darkGray,padding:e.spacing.threeXS,height:e.sizes.clearIconSize,width:e.sizes.clearIconSize,cursor:"pointer",":hover":{fill:e.colors.bodyText}}}}}},SearchIcon:{style:{color:e.colors.darkGray}},Tag:{props:{overrides:{Root:{style:{borderTopLeftRadius:e.radii.md,borderTopRightRadius:e.radii.md,borderBottomRightRadius:e.radii.md,borderBottomLeftRadius:e.radii.md,fontSize:e.fontSizes.md,paddingLeft:e.spacing.sm,marginLeft:e.spacing.none,marginRight:e.spacing.sm,height:`calc(${e.sizes.minElementHeight} - 2 * ${e.spacing.xs})`,maxWidth:`calc(100% - ${e.spacing.lg})`,cursor:"default !important"}},Action:{style:{paddingLeft:0}},ActionIcon:{props:{overrides:{Svg:{style:{width:"0.625em",height:"0.625em"}}}}}}}},MultiValue:{props:{overrides:{Root:{style:{fontSize:e.fontSizes.sm}}}}},Input:{props:{readOnly:K&&W===!1?"readonly":null}},Dropdown:{component:Y,props:{$menuListProps:{initialScrollOffset:B(),onScroll:s=>{C(!0),P(s)}}}}}})})]})},ne=i.memo(ee);export{ne as default};
@@ -1 +0,0 @@
1
- import{r as s,E as W,_ as $,n as d,ay as L,ae as V,j as a,aB as D,bn as K}from"./index.Ca6320CT.js";import{I as N}from"./InputInstructions.6chqAOMM.js";import{i as _}from"./inputUtils.CQWz5UKz.js";import{T as q}from"./textarea.B9cq_go8.js";import"./base-input.DIQMGXMv.js";var w=s.forwardRef(function(t,e){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:e}),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 j=d("div",{target:"e1qzcwc60"})(({theme:t,width:e})=>({borderRadius:t.radii.xxxl,display:"flex",backgroundColor:t.colors.widgetBackgroundColor??t.colors.secondaryBg,width:`${e}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:e,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:e?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:e,widgetMgr:l,fragmentId:u}){const o=V(),[g,h]=s.useState(!1),[p,f]=s.useState(e.default),[x,y]=s.useState(0),i=s.useRef(null),b=s.useRef({minHeight:0,maxHeight:0}),R=()=>{let r=0;const{current:n}=i;if(n){const c=n.placeholder;n.placeholder="",n.style.height="auto",r=n.scrollHeight,n.placeholder=c,n.style.height=""}return r},C=()=>{i.current&&i.current.focus(),p&&(l.setStringTriggerValue(e,p,{fromUi:!0},u),h(!1),f(""),y(0))},E=r=>{const{metaKey:n,ctrlKey:c,shiftKey:T}=r;_(r)&&!T&&!c&&!n&&(r.preventDefault(),C())},z=r=>{const{value:n}=r.target,{maxChars:c}=e;c!==0&&n.length>c||(h(n!==""),f(n),y(R()))};s.useEffect(()=>{if(e.setValue){e.setValue=!1;const r=e.value||"";f(r),h(r!=="")}},[e]),s.useEffect(()=>{if(i.current){const{offsetHeight:r}=i.current;b.current.minHeight=r,b.current.maxHeight=r*U}},[i]);const{disabled:I,placeholder:m,maxChars:B}=e,{minHeight:k,maxHeight:S}=b.current,v=x>0&&i.current?Math.abs(x-k)>H:!1;return a(j,{className:"stChatInput","data-testid":"stChatInput",width:t,children:D(A,{children:[a(q,{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:B,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 +0,0 @@
1
- import{n as p,aN as T,r as s,aB as x,j as r,aO as v,av as h,aP as e,aQ as k,aR as R,F as z,ay as L}from"./index.Ca6320CT.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=L(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 D(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 H({theme:o,body:t,icon:a,width:y}){const n=D(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(R,{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 M=T(H);export{M as default};
@@ -1,2 +0,0 @@
1
- import{d as U,r as w,bu as ee,bT as pt,bE as vt,bv as Q,bU as mt,bV as bt,n as be,ao as yt,ae as Tt,aJ as kt,aB as Ue,j as ae,R as He,cf as Ot,bq as wt,bD as Rt,br as St,ba as Mt,bs as _t,G as $t,cg as Ee}from"./index.Ca6320CT.js";import{s as We}from"./sprintf.C-r3gIuM.js";import{a as Et}from"./useBasicWidgetState.DY0Kwuur.js";import"./FormClearHelper.BP4f-wKq.js";var Ce={},De={},xe={},ce={};Object.defineProperty(ce,"__esModule",{value:!0});ce.Direction=void 0;var Ke;(function(t){t.Right="to right",t.Left="to left",t.Down="to bottom",t.Up="to top"})(Ke||(ce.Direction=Ke={}));(function(t){var r=U&&U.__spreadArray||function(o,u,l){if(l||arguments.length===2)for(var p=0,b=u.length,g;p<b;p++)(g||!(p in u))&&(g||(g=Array.prototype.slice.call(u,0,p)),g[p]=u[p]);return o.concat(g||Array.prototype.slice.call(u))};Object.defineProperty(t,"__esModule",{value:!0}),t.isIOS=t.useThumbOverlap=t.assertUnreachable=t.voidFn=t.getTrackBackground=t.replaceAt=t.schd=t.translate=t.getClosestThumbIndex=t.translateThumbs=t.getPaddingAndBorder=t.getMargin=t.checkInitialOverlap=t.checkValuesAgainstBoundaries=t.checkBoundaries=t.isVertical=t.relativeValue=t.normalizeValue=t.isStepDivisible=t.isTouchEvent=t.getStepDecimals=void 0;var n=w,e=ce,a=function(o){var u=o.toString().split(".")[1];return u?u.length:0};t.getStepDecimals=a;function i(o){return o.touches&&o.touches.length||o.changedTouches&&o.changedTouches.length}t.isTouchEvent=i;function s(o,u,l){var p=(u-o)/l,b=8,g=Number(p.toFixed(b));return parseInt(g.toString(),10)===g}t.isStepDivisible=s;function c(o,u,l,p,b,g,T){var k=1e11;if(o=Math.round(o*k)/k,!g){var D=T[u-1],_=T[u+1];if(D&&D>o)return D;if(_&&_<o)return _}if(o>p)return p;if(o<l)return l;var N=Math.floor(o*k-l*k)%Math.floor(b*k),j=Math.floor(o*k-Math.abs(N)),W=N===0?o:j/k,E=Math.abs(N/k)<b/2?W:W+b,I=(0,t.getStepDecimals)(b);return parseFloat(E.toFixed(I))}t.normalizeValue=c;function f(o,u,l){return(o-u)/(l-u)}t.relativeValue=f;function y(o){return o===e.Direction.Up||o===e.Direction.Down}t.isVertical=y;function d(o,u,l){if(u>=l)throw new RangeError("min (".concat(u,") is equal/bigger than max (").concat(l,")"));if(o<u)throw new RangeError("value (".concat(o,") is smaller than min (").concat(u,")"));if(o>l)throw new RangeError("value (".concat(o,") is bigger than max (").concat(l,")"))}t.checkBoundaries=d;function h(o,u,l){return o<u?u:o>l?l:o}t.checkValuesAgainstBoundaries=h;function v(o){if(!(o.length<2)&&!o.slice(1).every(function(u,l){return o[l]<=u}))throw new RangeError("values={[".concat(o,"]} needs to be sorted when allowOverlap={false}"))}t.checkInitialOverlap=v;function R(o){var u=window.getComputedStyle(o);return{top:parseInt(u["margin-top"],10),bottom:parseInt(u["margin-bottom"],10),left:parseInt(u["margin-left"],10),right:parseInt(u["margin-right"],10)}}t.getMargin=R;function m(o){var u=window.getComputedStyle(o);return{top:parseInt(u["padding-top"],10)+parseInt(u["border-top-width"],10),bottom:parseInt(u["padding-bottom"],10)+parseInt(u["border-bottom-width"],10),left:parseInt(u["padding-left"],10)+parseInt(u["border-left-width"],10),right:parseInt(u["padding-right"],10)+parseInt(u["border-right-width"],10)}}t.getPaddingAndBorder=m;function S(o,u,l){var p=l?-1:1;o.forEach(function(b,g){return L(b,p*u[g].x,u[g].y)})}t.translateThumbs=S;function B(o,u,l,p){for(var b=0,g=F(o[0],u,l,p),T=1;T<o.length;T++){var k=F(o[T],u,l,p);k<g&&(g=k,b=T)}return b}t.getClosestThumbIndex=B;function L(o,u,l){o.style.transform="translate(".concat(u,"px, ").concat(l,"px)")}t.translate=L;var x=function(o){var u=[],l=null,p=function(){for(var b=[],g=0;g<arguments.length;g++)b[g]=arguments[g];u=b,!l&&(l=requestAnimationFrame(function(){l=null,o.apply(void 0,u)}))};return p};t.schd=x;function M(o,u,l){var p=o.slice(0);return p[u]=l,p}t.replaceAt=M;function $(o){var u=o.values,l=o.colors,p=o.min,b=o.max,g=o.direction,T=g===void 0?e.Direction.Right:g,k=o.rtl,D=k===void 0?!1:k;D&&T===e.Direction.Right?T=e.Direction.Left:D&&e.Direction.Left&&(T=e.Direction.Right);var _=u.slice(0).sort(function(j,W){return j-W}).map(function(j){return(j-p)/(b-p)*100}),N=_.reduce(function(j,W,E){return"".concat(j,", ").concat(l[E]," ").concat(W,"%, ").concat(l[E+1]," ").concat(W,"%")},"");return"linear-gradient(".concat(T,", ").concat(l[0]," 0%").concat(N,", ").concat(l[l.length-1]," 100%)")}t.getTrackBackground=$;function H(){}t.voidFn=H;function A(o){throw new Error("Didn't expect to get here")}t.assertUnreachable=A;var C=function(o,u,l,p,b){b===void 0&&(b=function(T){return T});var g=Math.ceil(r([o],Array.from(o.children),!0).reduce(function(T,k){var D=Math.ceil(k.getBoundingClientRect().width);if(k.innerText&&k.innerText.includes(l)&&k.childElementCount===0){var _=k.cloneNode(!0);_.innerHTML=b(u.toFixed(p)),_.style.visibility="hidden",document.body.appendChild(_),D=Math.ceil(_.getBoundingClientRect().width),document.body.removeChild(_)}return D>T?D:T},o.getBoundingClientRect().width));return g},X=function(o,u,l,p,b,g,T){T===void 0&&(T=function(_){return _});var k=[],D=function(_){var N=C(l[_],p[_],b,g,T),j=u[_].x;u.forEach(function(W,E){var I=W.x,J=C(l[E],p[E],b,g,T);_!==E&&(j>=I&&j<=I+J||j+N>=I&&j+N<=I+J)&&(k.includes(E)||(k.push(_),k.push(E),k=r(r([],k,!0),[_,E],!1),D(E)))})};return D(o),Array.from(new Set(k.sort()))},Z=function(o,u,l,p,b,g){p===void 0&&(p=.1),b===void 0&&(b=" - "),g===void 0&&(g=function(E){return E});var T=(0,t.getStepDecimals)(p),k=(0,n.useState)({}),D=k[0],_=k[1],N=(0,n.useState)(g(u[l].toFixed(T))),j=N[0],W=N[1];return(0,n.useEffect)(function(){if(o){var E=o.getThumbs();if(E.length<1)return;var I={},J=o.getOffsets(),ie=X(l,J,E,u,b,T,g),le=g(u[l].toFixed(T));if(ie.length){var te=ie.reduce(function(re,ue,ge,pe){return re.length?r(r([],re,!0),[J[pe[ge]].x],!1):[J[pe[ge]].x]},[]);if(Math.min.apply(Math,te)===J[l].x){var de=[];ie.forEach(function(re){de.push(u[re].toFixed(T))}),le=Array.from(new Set(de.sort(function(re,ue){return parseFloat(re)-parseFloat(ue)}))).map(g).join(b);var fe=Math.min.apply(Math,te),he=Math.max.apply(Math,te),$e=E[ie[te.indexOf(he)]].getBoundingClientRect().width;I.left="".concat(Math.abs(fe-(he+$e))/2,"px"),I.transform="translate(-50%, 0)"}else I.visibility="hidden"}W(le),_(I)}},[o,u]),[j,D]};t.useThumbOverlap=Z;function F(o,u,l,p){var b=o.getBoundingClientRect(),g=b.left,T=b.top,k=b.width,D=b.height;return y(p)?Math.abs(l-(T+D/2)):Math.abs(u-(g+k/2))}var z=function(){var o,u=((o=navigator.userAgentData)===null||o===void 0?void 0:o.platform)||navigator.platform;return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(u)||navigator.userAgent.includes("Mac")&&"ontouchend"in document};t.isIOS=z})(xe);var It=U&&U.__extends||function(){var t=function(r,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,a){e.__proto__=a}||function(e,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(e[i]=a[i])},t(r,n)};return function(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(r,n);function e(){this.constructor=r}r.prototype=n===null?Object.create(n):(e.prototype=n.prototype,new e)}}(),Ct=U&&U.__createBinding||(Object.create?function(t,r,n,e){e===void 0&&(e=n);var a=Object.getOwnPropertyDescriptor(r,n);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(t,e,a)}:function(t,r,n,e){e===void 0&&(e=n),t[e]=r[n]}),Dt=U&&U.__setModuleDefault||(Object.create?function(t,r){Object.defineProperty(t,"default",{enumerable:!0,value:r})}:function(t,r){t.default=r}),xt=U&&U.__importStar||function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Ct(r,t,n);return Dt(r,t),r},qe=U&&U.__spreadArray||function(t,r,n){if(n||arguments.length===2)for(var e=0,a=r.length,i;e<a;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return t.concat(i||Array.prototype.slice.call(r))};Object.defineProperty(De,"__esModule",{value:!0});var ve=xt(w),O=xe,P=ce,Pt=["ArrowRight","ArrowUp","k","PageUp"],Bt=["ArrowLeft","ArrowDown","j","PageDown"],At=function(t){It(r,t);function r(n){var e=t.call(this,n)||this;if(e.trackRef=ve.createRef(),e.thumbRefs=[],e.state={draggedTrackPos:[-1,-1],draggedThumbIndex:-1,thumbZIndexes:new Array(e.props.values.length).fill(0).map(function(a,i){return i}),isChanged:!1,markOffsets:[]},e.getOffsets=function(){var a=e.props,i=a.direction,s=a.values,c=a.min,f=a.max,y=e.trackRef.current;if(!y)return console.warn("No track element found."),[];var d=y.getBoundingClientRect(),h=(0,O.getPaddingAndBorder)(y);return e.getThumbs().map(function(v,R){var m={x:0,y:0},S=v.getBoundingClientRect(),B=(0,O.getMargin)(v);switch(i){case P.Direction.Right:return m.x=(B.left+h.left)*-1,m.y=((S.height-d.height)/2+h.top)*-1,m.x+=d.width*(0,O.relativeValue)(s[R],c,f)-S.width/2,m;case P.Direction.Left:return m.x=(B.right+h.right)*-1,m.y=((S.height-d.height)/2+h.top)*-1,m.x+=d.width-d.width*(0,O.relativeValue)(s[R],c,f)-S.width/2,m;case P.Direction.Up:return m.x=((S.width-d.width)/2+B.left+h.left)*-1,m.y=-h.left,m.y+=d.height-d.height*(0,O.relativeValue)(s[R],c,f)-S.height/2,m;case P.Direction.Down:return m.x=((S.width-d.width)/2+B.left+h.left)*-1,m.y=-h.left,m.y+=d.height*(0,O.relativeValue)(s[R],c,f)-S.height/2,m;default:return(0,O.assertUnreachable)(i)}})},e.getThumbs=function(){return e.trackRef&&e.trackRef.current?Array.from(e.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?"),[])},e.getTargetIndex=function(a){return e.getThumbs().findIndex(function(i){return i===a.target||i.contains(a.target)})},e.addTouchEvents=function(a){document.addEventListener("touchmove",e.schdOnTouchMove,{passive:!1}),document.addEventListener("touchend",e.schdOnEnd,{passive:!1}),document.addEventListener("touchcancel",e.schdOnEnd,{passive:!1})},e.addMouseEvents=function(a){document.addEventListener("mousemove",e.schdOnMouseMove),document.addEventListener("mouseup",e.schdOnEnd)},e.onMouseDownTrack=function(a){var i;if(!(a.button!==0||(0,O.isIOS)()))if(a.persist(),a.preventDefault(),e.addMouseEvents(a.nativeEvent),e.props.values.length>1&&e.props.draggableTrack){if(e.thumbRefs.some(function(c){var f;return(f=c.current)===null||f===void 0?void 0:f.contains(a.target)}))return;e.setState({draggedTrackPos:[a.clientX,a.clientY]},function(){return e.onMove(a.clientX,a.clientY)})}else{var s=(0,O.getClosestThumbIndex)(e.thumbRefs.map(function(c){return c.current}),a.clientX,a.clientY,e.props.direction);(i=e.thumbRefs[s].current)===null||i===void 0||i.focus(),e.setState({draggedThumbIndex:s},function(){return e.onMove(a.clientX,a.clientY)})}},e.onResize=function(){(0,O.translateThumbs)(e.getThumbs(),e.getOffsets(),e.props.rtl),e.calculateMarkOffsets()},e.onTouchStartTrack=function(a){var i;if(a.persist(),e.addTouchEvents(a.nativeEvent),e.props.values.length>1&&e.props.draggableTrack){if(e.thumbRefs.some(function(c){var f;return(f=c.current)===null||f===void 0?void 0:f.contains(a.target)}))return;e.setState({draggedTrackPos:[a.touches[0].clientX,a.touches[0].clientY]},function(){return e.onMove(a.touches[0].clientX,a.touches[0].clientY)})}else{var s=(0,O.getClosestThumbIndex)(e.thumbRefs.map(function(c){return c.current}),a.touches[0].clientX,a.touches[0].clientY,e.props.direction);(i=e.thumbRefs[s].current)===null||i===void 0||i.focus(),e.setState({draggedThumbIndex:s},function(){return e.onMove(a.touches[0].clientX,a.touches[0].clientY)})}},e.onMouseOrTouchStart=function(a){if(!e.props.disabled){var i=(0,O.isTouchEvent)(a);if(!(!i&&a.button!==0)){var s=e.getTargetIndex(a);s!==-1&&(i?e.addTouchEvents(a):e.addMouseEvents(a),e.setState({draggedThumbIndex:s,thumbZIndexes:e.state.thumbZIndexes.map(function(c,f){return f===s?Math.max.apply(Math,e.state.thumbZIndexes):c<=e.state.thumbZIndexes[s]?c:c-1})}))}}},e.onMouseMove=function(a){a.preventDefault(),e.onMove(a.clientX,a.clientY)},e.onTouchMove=function(a){a.preventDefault(),e.onMove(a.touches[0].clientX,a.touches[0].clientY)},e.onKeyDown=function(a){var i=e.props,s=i.values,c=i.onChange,f=i.step,y=i.rtl,d=i.direction,h=e.state.isChanged,v=e.getTargetIndex(a.nativeEvent),R=y||d===P.Direction.Left||d===P.Direction.Down?-1:1;v!==-1&&(Pt.includes(a.key)?(a.preventDefault(),e.setState({draggedThumbIndex:v,isChanged:!0}),c((0,O.replaceAt)(s,v,e.normalizeValue(s[v]+R*(a.key==="PageUp"?f*10:f),v)))):Bt.includes(a.key)?(a.preventDefault(),e.setState({draggedThumbIndex:v,isChanged:!0}),c((0,O.replaceAt)(s,v,e.normalizeValue(s[v]-R*(a.key==="PageDown"?f*10:f),v)))):a.key==="Tab"?e.setState({draggedThumbIndex:-1},function(){h&&e.fireOnFinalChange()}):h&&e.fireOnFinalChange())},e.onKeyUp=function(a){var i=e.state.isChanged;e.setState({draggedThumbIndex:-1},function(){i&&e.fireOnFinalChange()})},e.onMove=function(a,i){var s=e.state,c=s.draggedThumbIndex,f=s.draggedTrackPos,y=e.props,d=y.direction,h=y.min,v=y.max,R=y.onChange,m=y.values,S=y.step,B=y.rtl;if(c===-1&&f[0]===-1&&f[1]===-1)return null;var L=e.trackRef.current;if(!L)return null;var x=L.getBoundingClientRect(),M=(0,O.isVertical)(d)?x.height:x.width;if(f[0]!==-1&&f[1]!==-1){var $=a-f[0],H=i-f[1],A=0;switch(d){case P.Direction.Right:case P.Direction.Left:A=$/M*(v-h);break;case P.Direction.Down:case P.Direction.Up:A=H/M*(v-h);break;default:(0,O.assertUnreachable)(d)}if(B&&(A*=-1),Math.abs(A)>=S/2){for(var C=0;C<e.thumbRefs.length;C++){if(m[C]===v&&Math.sign(A)===1||m[C]===h&&Math.sign(A)===-1)return;var X=m[C]+A;X>v?A=v-m[C]:X<h&&(A=h-m[C])}for(var Z=m.slice(0),C=0;C<e.thumbRefs.length;C++)Z=(0,O.replaceAt)(Z,C,e.normalizeValue(m[C]+A,C));e.setState({draggedTrackPos:[a,i]}),R(Z)}}else{var F=0;switch(d){case P.Direction.Right:F=(a-x.left)/M*(v-h)+h;break;case P.Direction.Left:F=(M-(a-x.left))/M*(v-h)+h;break;case P.Direction.Down:F=(i-x.top)/M*(v-h)+h;break;case P.Direction.Up:F=(M-(i-x.top))/M*(v-h)+h;break;default:(0,O.assertUnreachable)(d)}B&&(F=v+h-F),Math.abs(m[c]-F)>=S/2&&R((0,O.replaceAt)(m,c,e.normalizeValue(F,c)))}},e.normalizeValue=function(a,i){var s=e.props,c=s.min,f=s.max,y=s.step,d=s.allowOverlap,h=s.values;return(0,O.normalizeValue)(a,i,c,f,y,d,h)},e.onEnd=function(a){if(a.preventDefault(),document.removeEventListener("mousemove",e.schdOnMouseMove),document.removeEventListener("touchmove",e.schdOnTouchMove),document.removeEventListener("mouseup",e.schdOnEnd),document.removeEventListener("touchend",e.schdOnEnd),document.removeEventListener("touchcancel",e.schdOnEnd),e.state.draggedThumbIndex===-1&&e.state.draggedTrackPos[0]===-1&&e.state.draggedTrackPos[1]===-1)return null;e.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){e.fireOnFinalChange()})},e.fireOnFinalChange=function(){e.setState({isChanged:!1});var a=e.props,i=a.onFinalChange,s=a.values;i&&i(s)},e.updateMarkRefs=function(a){if(!a.renderMark){e.numOfMarks=void 0,e.markRefs=void 0;return}e.numOfMarks=(a.max-a.min)/e.props.step,e.markRefs=[];for(var i=0;i<e.numOfMarks+1;i++)e.markRefs[i]=ve.createRef()},e.calculateMarkOffsets=function(){if(!(!e.props.renderMark||!e.trackRef||!e.numOfMarks||!e.markRefs||e.trackRef.current===null)){for(var a=window.getComputedStyle(e.trackRef.current),i=parseInt(a.width,10),s=parseInt(a.height,10),c=parseInt(a.paddingLeft,10),f=parseInt(a.paddingTop,10),y=[],d=0;d<e.numOfMarks+1;d++){var h=9999,v=9999;if(e.markRefs[d].current){var R=e.markRefs[d].current.getBoundingClientRect();h=R.height,v=R.width}e.props.direction===P.Direction.Left||e.props.direction===P.Direction.Right?y.push([Math.round(i/e.numOfMarks*d+c-v/2),-Math.round((h-s)/2)]):y.push([Math.round(s/e.numOfMarks*d+f-h/2),-Math.round((v-i)/2)])}e.setState({markOffsets:y})}},n.step===0)throw new Error('"step" property should be a positive number');return e.schdOnMouseMove=(0,O.schd)(e.onMouseMove),e.schdOnTouchMove=(0,O.schd)(e.onTouchMove),e.schdOnEnd=(0,O.schd)(e.onEnd),e.thumbRefs=n.values.map(function(){return ve.createRef()}),e.updateMarkRefs(n),e}return r.prototype.componentDidMount=function(){var n=this,e=this.props,a=e.values,i=e.min,s=e.step;this.resizeObserver=window.ResizeObserver?new window.ResizeObserver(this.onResize):{observe:function(){return window.addEventListener("resize",n.onResize)},unobserve:function(){return window.removeEventListener("resize",n.onResize)}},document.addEventListener("touchstart",this.onMouseOrTouchStart,{passive:!1}),document.addEventListener("mousedown",this.onMouseOrTouchStart,{passive:!1}),!this.props.allowOverlap&&(0,O.checkInitialOverlap)(this.props.values),this.props.values.forEach(function(c){return(0,O.checkBoundaries)(c,n.props.min,n.props.max)}),this.resizeObserver.observe(this.trackRef.current),(0,O.translateThumbs)(this.getThumbs(),this.getOffsets(),this.props.rtl),this.calculateMarkOffsets(),a.forEach(function(c){(0,O.isStepDivisible)(i,c,s)||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.")})},r.prototype.componentDidUpdate=function(n,e){var a=this.props,i=a.max,s=a.min,c=a.step,f=a.values,y=a.rtl;(n.max!==i||n.min!==s||n.step!==c)&&this.updateMarkRefs(this.props),(0,O.translateThumbs)(this.getThumbs(),this.getOffsets(),y),(n.max!==i||n.min!==s||n.step!==c||e.markOffsets.length!==this.state.markOffsets.length)&&(this.calculateMarkOffsets(),f.forEach(function(d){(0,O.isStepDivisible)(s,d,c)||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.")}))},r.prototype.componentWillUnmount=function(){var n={passive:!1};document.removeEventListener("mousedown",this.onMouseOrTouchStart,n),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)},r.prototype.render=function(){var n=this,e=this.props,a=e.label,i=e.labelledBy,s=e.renderTrack,c=e.renderThumb,f=e.renderMark,y=f===void 0?function(){return null}:f,d=e.values,h=e.min,v=e.max,R=e.allowOverlap,m=e.disabled,S=this.state,B=S.draggedThumbIndex,L=S.thumbZIndexes,x=S.markOffsets;return s({props:{style:{transform:"scale(1)",cursor:B>-1?"grabbing":this.props.draggableTrack?(0,O.isVertical)(this.props.direction)?"ns-resize":"ew-resize":d.length===1&&!m?"pointer":"inherit"},onMouseDown:m?O.voidFn:this.onMouseDownTrack,onTouchStart:m?O.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:m,children:qe(qe([],x.map(function(M,$,H){return y({props:{style:n.props.direction===P.Direction.Left||n.props.direction===P.Direction.Right?{position:"absolute",left:"".concat(M[0],"px"),marginTop:"".concat(M[1],"px")}:{position:"absolute",top:"".concat(M[0],"px"),marginLeft:"".concat(M[1],"px")},key:"mark".concat($),ref:n.markRefs[$]},index:$})}),!0),d.map(function(M,$){var H=n.state.draggedThumbIndex===$;return c({index:$,value:M,isDragged:H,props:{style:{position:"absolute",zIndex:L[$],cursor:m?"inherit":H?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:$,tabIndex:m?void 0:0,"aria-valuemax":R?v:d[$+1]||v,"aria-valuemin":R?h:d[$-1]||h,"aria-valuenow":M,draggable:!1,ref:n.thumbRefs[$],"aria-label":a,"aria-labelledby":i,role:"slider",onKeyDown:m?O.voidFn:n.onKeyDown,onKeyUp:m?O.voidFn:n.onKeyUp}})}),!0)})},r.defaultProps={label:"Accessibility label",labelledBy:null,step:1,direction:P.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},r}(ve.Component);De.default=At;(function(t){var r=U&&U.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(t,"__esModule",{value:!0}),t.checkValuesAgainstBoundaries=t.relativeValue=t.useThumbOverlap=t.Direction=t.getTrackBackground=t.Range=void 0;var n=r(De);t.Range=n.default;var e=xe;Object.defineProperty(t,"getTrackBackground",{enumerable:!0,get:function(){return e.getTrackBackground}}),Object.defineProperty(t,"useThumbOverlap",{enumerable:!0,get:function(){return e.useThumbOverlap}}),Object.defineProperty(t,"relativeValue",{enumerable:!0,get:function(){return e.relativeValue}}),Object.defineProperty(t,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return e.checkValuesAgainstBoundaries}});var a=ce;Object.defineProperty(t,"Direction",{enumerable:!0,get:function(){return a.Direction}})})(Ce);function Ge(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);r&&(e=e.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),n.push.apply(n,e)}return n}function me(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Ge(Object(n),!0).forEach(function(e){Ft(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ge(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Ft(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var ye=ee("div",{position:"relative",width:"100%"});ye.displayName="Root";ye.displayName="Root";ye.displayName="StyledRoot";var Te=ee("div",function(t){var r=t.$theme,n=t.$value,e=n===void 0?[]:n,a=t.$disabled,i=t.$isDragged,s=r.sizing,c="inherit";return a?c="not-allowed":i?c="grabbing":e.length===1&&(c="pointer"),{paddingTop:s.scale600,paddingBottom:s.scale600,paddingRight:s.scale600,paddingLeft:s.scale600,display:"flex",cursor:c,backgroundColor:r.colors.sliderTrackFill}});Te.displayName="Track";Te.displayName="Track";Te.displayName="StyledTrack";var ke=ee("div",function(t){var r=t.$theme,n=t.$value,e=n===void 0?[]:n,a=t.$min,i=t.$max,s=t.$disabled,c=r.colors,f=r.borders,y=r.direction,d=r.borders.useRoundedCorners?f.radius100:0;return{borderTopLeftRadius:d,borderTopRightRadius:d,borderBottomRightRadius:d,borderBottomLeftRadius:d,background:Ce.getTrackBackground({values:e,colors:e.length===1?[s?c.borderOpaque:c.primary,s?c.backgroundSecondary:c.borderOpaque]:[s?c.backgroundSecondary:c.borderOpaque,s?c.borderOpaque:c.primary,s?c.backgroundSecondary:c.borderOpaque],min:a||0,max:i||0,rtl:y==="rtl"}),height:"2px",width:"100%",alignSelf:"center",cursor:s?"not-allowed":"inherit"}});ke.displayName="InnerTrack";ke.displayName="InnerTrack";ke.displayName="StyledInnerTrack";var Oe=ee("div",function(t){return{width:"4px",height:"2px",backgroundColor:t.$theme.colors.backgroundPrimary,marginLeft:"16px"}});Oe.displayName="Mark";Oe.displayName="Mark";Oe.displayName="StyledMark";var we=ee("div",function(t){return me(me({},t.$theme.typography.font200),{},{color:t.$theme.colors.contentPrimary})});we.displayName="Tick";we.displayName="Tick";we.displayName="StyledTick";var Re=ee("div",function(t){var r=t.$theme,n=r.sizing;return{display:"flex",justifyContent:"space-between",alignItems:"center",paddingRight:n.scale600,paddingLeft:n.scale600,paddingBottom:n.scale400}});Re.displayName="TickBar";Re.displayName="TickBar";Re.displayName="StyledTickBar";var Se=ee("div",function(t){var r=t.$theme,n=t.$value,e=n===void 0?[]:n,a=t.$thumbIndex,i=t.$disabled,s=e.length===2&&a===0,c=e.length===2&&a===1;return r.direction==="rtl"&&(c||s)&&(s=!s,c=!c),{height:"24px",width:"24px",borderTopLeftRadius:"24px",borderTopRightRadius:"24px",borderBottomLeftRadius:"24px",borderBottomRightRadius:"24px",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:i?r.colors.sliderHandleFillDisabled:r.colors.sliderHandleFill,outline:"none",boxShadow:t.$isFocusVisible?"0 0 0 3px ".concat(r.colors.accent):"0 1px 4px rgba(0, 0, 0, 0.12)",cursor:i?"not-allowed":"inherit"}});Se.displayName="Thumb";Se.displayName="Thumb";Se.displayName="StyledThumb";var Me=ee("div",function(t){var r=t.$disabled,n=t.$theme;return{position:"absolute",top:"-16px",width:"4px",height:"20px",backgroundColor:r?n.colors.sliderHandleFillDisabled:n.colors.sliderHandleInnerFill}});Me.displayName="InnerThumb";Me.displayName="InnerThumb";Me.displayName="StyledInnerThumb";var _e=ee("div",function(t){var r=t.$disabled,n=t.$theme;return me(me({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 Ye(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);r&&(e=e.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),n.push.apply(n,e)}return n}function Lt(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Ye(Object(n),!0).forEach(function(e){jt(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ye(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function jt(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function G(){return G=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])}return t},G.apply(this,arguments)}function q(t,r){return Ut(t)||Nt(t,r)||zt(t,r)||Vt()}function Vt(){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 zt(t,r){if(t){if(typeof t=="string")return Xe(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xe(t,r)}}function Xe(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,e=new Array(r);n<r;n++)e[n]=t[n];return e}function Nt(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var e=[],a=!0,i=!1,s,c;try{for(n=n.call(t);!(a=(s=n.next()).done)&&(e.push(s.value),!(r&&e.length===r));a=!0);}catch(f){i=!0,c=f}finally{try{!a&&n.return!=null&&n.return()}finally{if(i)throw c}}return e}}function Ut(t){if(Array.isArray(t))return t}var Ht=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 Wt(t){var r=t.overrides,n=r===void 0?{}:r,e=t.disabled,a=e===void 0?!1:e,i=t.marks,s=i===void 0?!1:i,c=t.onChange,f=c===void 0?function(){}:c,y=t.onFinalChange,d=y===void 0?function(){}:y,h=t.min,v=h===void 0?0:h,R=t.max,m=R===void 0?100:R,S=t.step,B=S===void 0?1:S,L=t.persistentThumb,x=L===void 0?!1:L,M=t.valueToLabel,$=M===void 0?function(Y){return Y}:M,H=t.value,A=w.useContext(pt),C=w.useState(!1),X=q(C,2),Z=X[0],F=X[1],z=w.useState(!1),o=q(z,2),u=o[0],l=o[1],p=w.useState(!1),b=q(p,2),g=b[0],T=b[1],k=w.useState(-1),D=q(k,2),_=D[0],N=D[1],j=w.useCallback(function(Y){vt(Y)&&T(!0);var V=Y.target.parentNode.firstChild===Y.target?0:1;N(V)},[]),W=w.useCallback(function(Y){g!==!1&&T(!1),N(-1)},[]),E=Ht(H),I={$disabled:a,$step:B,$min:v,$max:m,$marks:s,$value:E,$isFocusVisible:g},J=Q(n.Root,ye),ie=q(J,2),le=ie[0],te=ie[1],de=Q(n.Track,Te),fe=q(de,2),he=fe[0],$e=fe[1],re=Q(n.InnerTrack,ke),ue=q(re,2),ge=ue[0],pe=ue[1],Je=Q(n.Thumb,Se),Pe=q(Je,2),Qe=Pe[0],et=Pe[1],tt=Q(n.InnerThumb,Me),Be=q(tt,2),rt=Be[0],nt=Be[1],at=Q(n.ThumbValue,_e),Ae=q(at,2),it=Ae[0],ot=Ae[1],st=Q(n.Tick,we),Fe=q(st,2),Le=Fe[0],je=Fe[1],ct=Q(n.TickBar,Re),Ve=q(ct,2),ut=Ve[0],lt=Ve[1],dt=Q(n.Mark,Oe),ze=q(dt,2),ft=ze[0],ht=ze[1];return w.createElement(le,G({"data-baseweb":"slider"},I,te,{onFocus:mt(te,j),onBlur:bt(te,W)}),w.createElement(Ce.Range,G({step:B,min:v,max:m,values:E,disabled:a,onChange:function(V){return f({value:V})},onFinalChange:function(V){return d({value:V})},rtl:A.direction==="rtl",renderTrack:function(V){var ne=V.props,K=V.children,oe=V.isDragged;return w.createElement(he,G({onMouseDown:ne.onMouseDown,onTouchStart:ne.onTouchStart,$isDragged:oe},I,$e),w.createElement(ge,G({$isDragged:oe,ref:ne.ref},I,pe),K))},renderThumb:function(V){var ne=V.props,K=V.index,oe=V.isDragged,Ne=x||(!!K&&u||!K&&Z||oe)&&!a;return w.createElement(Qe,G({},ne,{onMouseEnter:function(){K===0?F(!0):l(!0)},onMouseLeave:function(){K===0?F(!1):l(!1)},$thumbIndex:K,$isDragged:oe,style:Lt({},ne.style)},I,et,{$isFocusVisible:g&&_===K}),Ne&&w.createElement(it,G({$thumbIndex:K,$isDragged:oe},I,ot),$(E[K])),Ne&&w.createElement(rt,G({$thumbIndex:K,$isDragged:oe},I,nt)))}},s?{renderMark:function(V){var ne=V.props,K=V.index;return w.createElement(ft,G({$markIndex:K},ne,I,ht))}}:{})),w.createElement(ut,G({},I,lt),w.createElement(Le,G({},I,je),$(v)),w.createElement(Le,G({},I,je),$(m))))}const Kt=be("div",{target:"e8lt0n70"})(({disabled:t,theme:r})=>({alignItems:"center",backgroundColor:t?r.colors.gray:r.colors.primary,borderTopLeftRadius:"100%",borderTopRightRadius:"100%",borderBottomLeftRadius:"100%",borderBottomRightRadius:"100%",borderTopStyle:"none",borderBottomStyle:"none",borderRightStyle:"none",borderLeftStyle:"none",boxShadow:"none",display:"flex",justifyContent:"center",height:r.sizes.sliderThumb,width:r.sizes.sliderThumb,":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 0.2rem ${yt(r.colors.primary,.5)}`}})),qt=be("div",{target:"e8lt0n71"})(({disabled:t,theme:r})=>({fontFamily:r.genericFonts.codeFont,fontSize:r.fontSizes.sm,color:t?r.colors.gray:r.colors.primary,top:"-1.6em",position:"absolute",whiteSpace:"nowrap",backgroundColor:r.colors.transparent,lineHeight:r.lineHeights.base,fontWeight:r.fontWeights.normal,pointerEvents:"none"})),Gt=be("div",{target:"e8lt0n72"})(({theme:t})=>({fontSize:t.fontSizes.sm,paddingBottom:t.spacing.none,paddingLeft:t.spacing.none,paddingRight:t.spacing.none,paddingTop:"0.65em",justifyContent:"space-between",alignItems:"center",display:"flex"})),Ze=be("div",{target:"e8lt0n73"})(({disabled:t,theme:r})=>({lineHeight:r.lineHeights.base,fontWeight:r.fontWeights.normal,fontFamily:r.genericFonts.codeFont,color:t?r.colors.fadedText40:"inherit"})),Yt=200;function Xt({disabled:t,element:r,widgetMgr:n,width:e,fragmentId:a}){var F;const[i,s]=Et({getStateFromWidgetMgr:Zt,getDefaultStateFromProto:Jt,getCurrStateFromProto:Qt,updateWidgetMgrState:er,element:r,widgetMgr:n,fragmentId:a}),[c,f]=w.useState(i),y=w.useRef(null),[d]=w.useState([]),[h]=w.useState([]),{colors:v,fonts:R,fontSizes:m,spacing:S}=Tt(),B={width:e},L=c.map(z=>Ie(z,r)),x=Ie(r.min,r),M=Ie(r.max,r),$=r.label;w.useEffect(()=>{f(i)},[i]);const H=w.useCallback(kt(Yt,z=>{s({value:z,fromUi:!0})}),[]),A=w.useCallback(({value:z})=>{f(z),H(z)},[H]),C=w.useCallback(()=>Ue(Gt,{"data-testid":"stSliderTickBar",children:[ae(Ze,{disabled:t,"data-testid":"stSliderTickBarMin",children:x}),ae(Ze,{disabled:t,"data-testid":"stSliderTickBarMax",children:M})]}),[x,M,t]),X=w.useCallback(He.forwardRef(function(o,u){const{$thumbIndex:l}=o,p=l||0;d[p]=u,h[p]||(h[p]=He.createRef());const b=Ot(o,["role","style","aria-valuemax","aria-valuemin","aria-valuenow","tabIndex","onKeyUp","onKeyDown","onMouseEnter","onMouseLeave","draggable"]),g=L[p];return ae(Kt,{...b,disabled:o.$disabled===!0,ref:d[p],"aria-valuetext":g,"aria-label":$,children:ae(qt,{"data-testid":"stSliderThumbValue",disabled:o.$disabled===!0,ref:h[p],children:g})})}),[]);w.useEffect(()=>{var b,g;h.map((T,k)=>{T.current&&(T.current.innerText=L[k])}),d.map((T,k)=>{T.current&&T.current.setAttribute("aria-valuetext",L[k])});const z=y.current??null,o=d[0].current,u=(b=d[1])==null?void 0:b.current,l=h[0].current,p=(g=h[1])==null?void 0:g.current;nr(z,o,u,l,p)});const Z=w.useCallback(({$disabled:z})=>({height:S.twoXS,...z?{background:v.darkenedBgMix25}:{}}),[v,S]);return Ue("div",{ref:y,className:"stSlider","data-testid":"stSlider",style:B,children:[ae(_t,{label:r.label,disabled:t,labelVisibility:wt((F=r.labelVisibility)==null?void 0:F.value),children:r.help&&ae(Rt,{children:ae(St,{content:r.help,placement:Mt.TOP_RIGHT})})}),ae(Wt,{min:r.min,max:r.max,step:r.step,value:rr(c,r),onChange:A,disabled:t,overrides:{Thumb:X,Tick:{style:{fontFamily:R.monospace}},Track:{style:{backgroundColor:"none !important",paddingBottom:S.none,paddingLeft:S.none,paddingRight:S.none,paddingTop:`calc(${m.sm} * 1.35)`}},InnerTrack:{style:Z},TickBar:C}})]})}function Zt(t,r){return t.getDoubleArrayValue(r)}function Jt(t){return t.default}function Qt(t){return t.value}function er(t,r,n,e){r.setDoubleArrayValue(t,n.value,{fromUi:n.fromUi},e)}function tr(t){const{dataType:r}=t;return r===Ee.DataType.DATETIME||r===Ee.DataType.DATE||r===Ee.DataType.TIME}function Ie(t,r){const{format:n,options:e}=r;return tr(r)?$t.utc(t/1e3).format(n):e.length>0?We.sprintf(n,e[t]):We.sprintf(n,t)}function rr(t,r){const{min:n,max:e}=r;let a=t[0],i=t.length>1?t[1]:t[0];return a>i&&(a=i),a<n&&(a=n),a>e&&(a=e),i<n&&(i=n),i>e&&(i=e),t.length>1?[a,i]:[a]}function nr(t,r,n,e,a){!t||!r||!e||(se(t,r,e),n&&a&&(se(t,n,a),ar(t,r,n,e,a)))}function se(t,r,n){const e=t.getBoundingClientRect(),a=r.getBoundingClientRect(),i=n.getBoundingClientRect(),s=a.left+a.width/2,c=s-i.width/2<e.left,f=s+i.width/2>e.right;n.style.left=c?"0":"",n.style.right=f?"0":""}function ar(t,r,n,e,a){const s=t.getBoundingClientRect(),c=r.getBoundingClientRect(),f=n.getBoundingClientRect(),y=e.getBoundingClientRect(),d=a.getBoundingClientRect(),h=s.left+s.width/2,v=c.left+c.width/2,R=f.left+f.width/2,m=v-y.width/2>=s.left,S=R+d.width/2<=s.right,B=c.left-y.width>=s.left,L=f.right+d.width<=s.right,x=m?y.width/2:y.width,M=S?d.width/2:d.width,$=v+x;if(R-M-$>24){se(t,r,e),se(t,n,a);return}if(B&&L){e.style.left="",e.style.right=`${Math.round(c.width)}px`,a.style.left=`${Math.round(f.width)}px`,a.style.right="";return}v<h?(se(t,r,e),a.style.left=`${Math.round(v+x+24-R)}px`,a.style.right=""):(se(t,n,a),e.style.left="",e.style.right=`${-Math.round(R-M-24-v)}px`)}const ur=w.memo(Xt);export{ur as default};
@@ -1 +0,0 @@
1
- import{r as o,E as M,_ as X,n as x,aN as lt,co as ut,D as J,cz as I,A as f,aB as z,j as u,bq as ct,bD as dt,br as pt,ba as ft,bs as bt,bn as q}from"./index.Ca6320CT.js";import{s as mt}from"./sprintf.C-r3gIuM.js";import{u as gt}from"./uniqueId.CKxaEvFc.js";import{u as yt}from"./FormClearHelper.BP4f-wKq.js";import{I as It}from"./InputInstructions.6chqAOMM.js";import{I as ht}from"./input.hHglMwJu.js";import"./base-input.DIQMGXMv.js";var Q=o.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(M,X({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(M,X({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"}),G=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 St(t){return f(t)||t===""?void 0:t}const Vt=t=>(t.element.dataType===I.DataType.INT?t.widgetMgr.getIntValue(t.element):t.widgetMgr.getDoubleValue(t.element))??t.element.default??null,K=({step:t,dataType:e})=>t||(e===I.DataType.INT?1:.01),B=({value:t,format:e,step:r,dataType:h})=>{if(f(t))return null;let a=St(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 j;const{dataType:T,id:D,formId:p,default:W,format:A}=e,b=e.hasMin?e.min:-1/0,m=e.hasMax?e.max:1/0,[i,Z]=o.useState(K(e)),U=Vt({element:e,widgetMgr:r}),[g,w]=o.useState(!1),[s,C]=o.useState(U),[H,S]=o.useState(B({value:U,...e,step:i})),[P,L]=o.useState(!1),R=o.useRef(null),O=o.useRef(gt("number_input_")),V=vt(s,i,b),v=kt(s,i,m),_=ut({formId:p}),tt=_?r.allowFormEnterToSubmit(p):g,et=P&&h>a.breakpoints.hideWidgetDetails;o.useEffect(()=>{Z(K({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??W??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),S(B({value:k,dataType:T,format:A,step:i}))}},[b,m,R,r,c,i,T,D,p,W,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),S(B({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),S(null);else{let y;e.dataType===I.DataType.INT?y=parseInt(d,10):y=parseFloat(d),w(!0),C(y),S(d)}},F=o.useCallback(()=>{v&&(w(!0),l({value:(s??b)+i,source:{fromUi:!0}}))},[s,b,i,v]),E=o.useCallback(()=>{V&&(w(!0),l({value:(s??m)-i,source:{fromUi:!0}}))},[s,m,i,V]),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((j=e.labelVisibility)==null?void 0:j.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(G,{"data-testid":"stNumberInputStepDown",onClick:E,disabled:!V||t,tabIndex:-1,children:u(q,{content:Q,size:"xs",color:V?"inherit":"disabled"})}),u(G,{"data-testid":"stNumberInputStepUp",onClick:F,disabled:!v||t,tabIndex:-1,children:u(q,{content:Y,size:"xs",color:v?"inherit":"disabled"})})]})]}),et&&u(Tt,{clearable:N,children:u(It,{dirty:g,value:H??"",inForm:_,allowEnterToSubmit:tt})})]})},Wt=lt(xt);export{Wt as default};