streamlit-nightly 1.53.2.dev20260125__py3-none-any.whl → 1.53.2.dev20260127__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 (119) hide show
  1. streamlit/commands/logo.py +81 -25
  2. streamlit/deprecation_util.py +19 -1
  3. streamlit/elements/arrow.py +2 -1
  4. streamlit/elements/lib/built_in_chart_utils.py +2 -2
  5. streamlit/elements/lib/options_selector_utils.py +72 -22
  6. streamlit/elements/widgets/select_slider.py +123 -37
  7. streamlit/hello/plotting_demo.py +19 -12
  8. streamlit/proto/Logo_pb2.py +5 -3
  9. streamlit/proto/Logo_pb2.pyi +25 -1
  10. streamlit/proto/Slider_pb2.py +6 -6
  11. streamlit/proto/Slider_pb2.pyi +9 -1
  12. streamlit/runtime/scriptrunner/script_runner.py +17 -0
  13. streamlit/runtime/scriptrunner_utils/script_run_context.py +13 -10
  14. streamlit/runtime/state/__init__.py +7 -1
  15. streamlit/runtime/state/common.py +13 -0
  16. streamlit/runtime/state/query_params.py +494 -6
  17. streamlit/runtime/state/session_state.py +178 -3
  18. streamlit/runtime/state/widgets.py +26 -1
  19. streamlit/static/index.html +1 -1
  20. streamlit/static/manifest.json +304 -304
  21. streamlit/static/static/js/{ErrorOutline.esm.CIFYUdwC.js → ErrorOutline.esm.DiaGWPsE.js} +1 -1
  22. streamlit/static/static/js/{FileDownload.esm.DWVTnTHm.js → FileDownload.esm.D-Qgpk5d.js} +1 -1
  23. streamlit/static/static/js/{FileHelper.BPYQIPd1.js → FileHelper.DmtDDGp0.js} +1 -1
  24. streamlit/static/static/js/{FormClearHelper.CypmvhYZ.js → FormClearHelper.BM3uDLnU.js} +1 -1
  25. streamlit/static/static/js/{InputInstructions.Bi62hDTQ.js → InputInstructions.B2YZ5Lle.js} +1 -1
  26. streamlit/static/static/js/{Particles.yebG0VuV.js → Particles.BzfZrl-0.js} +1 -1
  27. streamlit/static/static/js/{ProgressBar.Dy9CI6w4.js → ProgressBar.DWErD3j3.js} +1 -1
  28. streamlit/static/static/js/{StreamlitSyntaxHighlighter.Btk92CPv.js → StreamlitSyntaxHighlighter.DB31rUPf.js} +1 -1
  29. streamlit/static/static/js/{TableChart.esm.DBeVaFNt.js → TableChart.esm.D3oUYYYd.js} +1 -1
  30. streamlit/static/static/js/{Toolbar.DC2Tp-qb.js → Toolbar.CPyjMABY.js} +1 -1
  31. streamlit/static/static/js/{WidgetLabelHelpIconInline.3DnEd9BK.js → WidgetLabelHelpIconInline.C1NBCx-y.js} +1 -1
  32. streamlit/static/static/js/{base-input.7Sj6pVk0.js → base-input.C_CrNgNd.js} +1 -1
  33. streamlit/static/static/js/{checkbox.CcUx3XuQ.js → checkbox.S6O8DPFl.js} +1 -1
  34. streamlit/static/static/js/{createDownloadLinkElement.DZuwkCqy.js → createDownloadLinkElement.B-5tIJBw.js} +1 -1
  35. streamlit/static/static/js/{data-grid-overlay-editor.Dw-AewlN.js → data-grid-overlay-editor.BW5aAEJN.js} +1 -1
  36. streamlit/static/static/js/{downloader.Bsx5M2Du.js → downloader.BswLlj7p.js} +1 -1
  37. streamlit/static/static/js/embed.QjYZXbaW.js +193 -0
  38. streamlit/static/static/js/{es6.BpAqZaR_.js → es6.Dm_kl6Cp.js} +2 -2
  39. streamlit/static/static/js/{formatNumber.DjehVPVS.js → formatNumber.CH39oSMw.js} +1 -1
  40. streamlit/static/static/js/{iconPosition.D02OPE-d.js → iconPosition.Dp9f2jam.js} +1 -1
  41. streamlit/static/static/js/{iframeResizer.contentWindow.xtstqPd7.js → iframeResizer.contentWindow.DOprY46-.js} +1 -1
  42. streamlit/static/static/js/{index.S-mjkUeF.js → index.-7yn3zqE.js} +1 -1
  43. streamlit/static/static/js/{index.Bri1T2TS.js → index.4QSKV4yi.js} +1 -1
  44. streamlit/static/static/js/{index.ZIA43eTF.js → index.6OwBTJdz.js} +1 -1
  45. streamlit/static/static/js/{index.x1B588Xu.js → index.6UQ__fP7.js} +1 -1
  46. streamlit/static/static/js/{index.CEwnDCn9.js → index.6iOQDEVC.js} +1 -1
  47. streamlit/static/static/js/index.B0Wcvg8a.js +2 -0
  48. streamlit/static/static/js/{index.DO2T-QzF.js → index.B6Sk5Jwr.js} +1 -1
  49. streamlit/static/static/js/{index.D_TIyPF4.js → index.B9XI6y3j.js} +1 -1
  50. streamlit/static/static/js/{index.B9gbSNsw.js → index.BBVcEzWu.js} +1 -1
  51. streamlit/static/static/js/{index.CA0RmxJF.js → index.BFxjXeYb.js} +1 -1
  52. streamlit/static/static/js/{index.B5tD5YeV.js → index.BNsCI-Q1.js} +1 -1
  53. streamlit/static/static/js/{index.DJjSqPAx.js → index.BQu5Qf_i.js} +1 -1
  54. streamlit/static/static/js/{index.BvZbnSMC.js → index.BUOjbZl6.js} +1 -1
  55. streamlit/static/static/js/{index.XFMDBL5n.js → index.BUbgW8RJ.js} +1 -1
  56. streamlit/static/static/js/{index.BOkpEbJS.js → index.BYjec3-R.js} +1 -1
  57. streamlit/static/static/js/{index.D6Z9hKJY.js → index.BaKZ4ira.js} +1 -1
  58. streamlit/static/static/js/{index.BIcJe97b.js → index.BcUwq6kI.js} +1 -1
  59. streamlit/static/static/js/{index.C9v49R-a.js → index.BlchQrZL.js} +1 -1
  60. streamlit/static/static/js/{index.D9RL5sRp.js → index.BlgpfTUq.js} +1 -1
  61. streamlit/static/static/js/{index.BV6XgCij.js → index.Bwaj-9Zv.js} +1 -1
  62. streamlit/static/static/js/{index.DDu_qTm0.js → index.BxtweGcn.js} +1 -1
  63. streamlit/static/static/js/{index.CGbvkEtg.js → index.C57ViuAX.js} +1 -1
  64. streamlit/static/static/js/{index.CdRwiHPm.js → index.CAzk7fUP.js} +1 -1
  65. streamlit/static/static/js/{index.BK9S5qug.js → index.CDZffl1q.js} +1 -1
  66. streamlit/static/static/js/{index.JL0uGAeJ.js → index.CYxcFtYt.js} +1 -1
  67. streamlit/static/static/js/index.Cb7V19H9.js +2 -0
  68. streamlit/static/static/js/{index.CgARjn28.js → index.CfXTal6g.js} +1 -1
  69. streamlit/static/static/js/{index.CyDHwK5P.js → index.Ci3x7GcT.js} +1 -1
  70. streamlit/static/static/js/{index.BVhVdVeE.js → index.CivdhE_9.js} +1 -1
  71. streamlit/static/static/js/{index.m3dn5Bai.js → index.CkSzTTpO.js} +5 -5
  72. streamlit/static/static/js/{index.8FPw0_gD.js → index.CuJ82OKQ.js} +1 -1
  73. streamlit/static/static/js/{index.BDlI2pRp.js → index.Cw5Xlisw.js} +1 -1
  74. streamlit/static/static/js/{index.DdxofXV8.js → index.D1tkD8Lg.js} +3 -3
  75. streamlit/static/static/js/{index.iXzAofuY.js → index.DK9Im19R.js} +2 -2
  76. streamlit/static/static/js/{index.iF5zYERg.js → index.DMwRlpNi.js} +1 -1
  77. streamlit/static/static/js/index.DTUAvbJ0.js +1 -0
  78. streamlit/static/static/js/{index.DSSapl3Q.js → index.DoRYpzHm.js} +1 -1
  79. streamlit/static/static/js/{index.D6J2UPzF.js → index.DsZNm1_D.js} +1 -1
  80. streamlit/static/static/js/{index.5H98WqjT.js → index.DypwtfIh.js} +1 -1
  81. streamlit/static/static/js/{index.DgLRJfs3.js → index.JKOtpaMf.js} +1 -1
  82. streamlit/static/static/js/{index.B8-HOwf1.js → index.OI2eh_me.js} +1 -1
  83. streamlit/static/static/js/{index.CKUBdVQ9.js → index.TTO_Lb69.js} +1 -1
  84. streamlit/static/static/js/{index.-faJDV20.js → index.X1r5cenD.js} +1 -1
  85. streamlit/static/static/js/{index.BqfJJr3c.js → index.gsc49XzN.js} +1 -1
  86. streamlit/static/static/js/{index.BB_iwaVr.js → index.lMhsw-5K.js} +32 -32
  87. streamlit/static/static/js/{index.DZv5AoR1.js → index.s9zpEF8P.js} +1 -1
  88. streamlit/static/static/js/{index.BGTMh3Uu.js → index.tjRGlTlQ.js} +1 -1
  89. streamlit/static/static/js/{index.Bo1ztye0.js → index.wKGUZfH4.js} +1 -1
  90. streamlit/static/static/js/{input.VYKyGuhi.js → input.CIKqvWjB.js} +1 -1
  91. streamlit/static/static/js/{main.u5Bb3MY7.js → main.BkNqoTrd.js} +1 -1
  92. streamlit/static/static/js/{memory.BOMt4yAV.js → memory.DNcbFok2.js} +1 -1
  93. streamlit/static/static/js/{number-overlay-editor.CihlAHgl.js → number-overlay-editor.DwjiYKav.js} +1 -1
  94. streamlit/static/static/js/{pandasStylerUtils.BuqSgXpk.js → pandasStylerUtils.BSc50we3.js} +1 -1
  95. streamlit/static/static/js/{sandbox.COGR4pqz.js → sandbox.DJL9Gdcf.js} +1 -1
  96. streamlit/static/static/js/{styled-components.BEf3c4IJ.js → styled-components.D4jE1G9j.js} +1 -1
  97. streamlit/static/static/js/{throttle.Bl-XsA9N.js → throttle.dHeXiPIK.js} +1 -1
  98. streamlit/static/static/js/{timepicker.B-HgBYlK.js → timepicker.CIpoSUyW.js} +1 -1
  99. streamlit/static/static/js/{toConsumableArray.BrQebwtE.js → toConsumableArray.AOXQx2YY.js} +1 -1
  100. streamlit/static/static/js/uniqueId.DRPc21MO.js +1 -0
  101. streamlit/static/static/js/{useBasicWidgetState.8WwISl9r.js → useBasicWidgetState.BwQxG7iA.js} +1 -1
  102. streamlit/static/static/js/{useIntlLocale.D37LWdCR.js → useIntlLocale.JXPZPWaJ.js} +1 -1
  103. streamlit/static/static/js/{useTextInputAutoExpand.Bb_KqJvq.js → useTextInputAutoExpand.CD_nhoE_.js} +1 -1
  104. streamlit/static/static/js/{useUpdateUiValue.D1BLS5t7.js → useUpdateUiValue.Cl1Y22Ao.js} +1 -1
  105. streamlit/static/static/js/{useWaveformController.Ce0-qTws.js → useWaveformController.DJhScSDn.js} +1 -1
  106. streamlit/static/static/js/{withCalculatedWidth.BX2K3UVv.js → withCalculatedWidth.CrAfFzO9.js} +1 -1
  107. streamlit/static/static/js/{withFullScreenWrapper.CqfGs8T2.js → withFullScreenWrapper.EdE3zOz5.js} +1 -1
  108. streamlit/testing/v1/element_tree.py +23 -8
  109. {streamlit_nightly-1.53.2.dev20260125.dist-info → streamlit_nightly-1.53.2.dev20260127.dist-info}/METADATA +1 -1
  110. {streamlit_nightly-1.53.2.dev20260125.dist-info → streamlit_nightly-1.53.2.dev20260127.dist-info}/RECORD +114 -114
  111. streamlit/static/static/js/embed.C7by6AoE.js +0 -195
  112. streamlit/static/static/js/index.Bhy8EBYI.js +0 -2
  113. streamlit/static/static/js/index.C5ehUqNt.js +0 -2
  114. streamlit/static/static/js/index.m4WkwGMu.js +0 -1
  115. streamlit/static/static/js/uniqueId.8R4hbkYl.js +0 -1
  116. {streamlit_nightly-1.53.2.dev20260125.data → streamlit_nightly-1.53.2.dev20260127.data}/scripts/streamlit.cmd +0 -0
  117. {streamlit_nightly-1.53.2.dev20260125.dist-info → streamlit_nightly-1.53.2.dev20260127.dist-info}/WHEEL +0 -0
  118. {streamlit_nightly-1.53.2.dev20260125.dist-info → streamlit_nightly-1.53.2.dev20260127.dist-info}/entry_points.txt +0 -0
  119. {streamlit_nightly-1.53.2.dev20260125.dist-info → streamlit_nightly-1.53.2.dev20260127.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
1
- import{V as Q,e as Z,bu as me,bv as ge,z as he,r as d,l as ye,bw as k,aj as _,j as A,aM as pe,bx as H,by as Ee,a0 as be,a1 as Fe,o as Ce,$ as we,aL as Se,n as Ne,S as Oe}from"./index.BB_iwaVr.js";import{bz as nr}from"./index.BB_iwaVr.js";import{w as Ae}from"./withCalculatedWidth.BX2K3UVv.js";import{C as W,a as Y}from"./urls.BwSlolu9.js";import{D as Re,a as Ie}from"./IFrameUtil.DefezniK.js";const v="%[a-f0-9]{2}",G=new RegExp("("+v+")|([^%]+?)","gi"),B=new RegExp("("+v+")+","gi");function T(e,r){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;r=r||1;const t=e.slice(0,r),n=e.slice(r);return Array.prototype.concat.call([],T(t),T(n))}function _e(e){try{return decodeURIComponent(e)}catch{let r=e.match(G)||[];for(let t=1;t<r.length;t++)e=T(r,t).join(""),r=e.match(G)||[];return e}}function Te(e){const r={"%FE%FF":"��","%FF%FE":"��"};let t=B.exec(e);for(;t;){try{r[t[0]]=decodeURIComponent(t[0])}catch{const a=_e(t[0]);a!==t[0]&&(r[t[0]]=a)}t=B.exec(e)}r["%C2"]="�";const n=Object.keys(r);for(const a of n)e=e.replace(new RegExp(a,"g"),r[a]);return e}function xe(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return Te(e)}}function Ue(e,r){const t={};if(Array.isArray(r))for(const n of r){const a=Object.getOwnPropertyDescriptor(e,n);a?.enumerable&&Object.defineProperty(t,n,a)}else for(const n of Reflect.ownKeys(e)){const a=Object.getOwnPropertyDescriptor(e,n);if(a.enumerable){const s=e[n];r(n,s,e)&&Object.defineProperty(t,n,a)}}return t}function ee(e,r){if(!(typeof e=="string"&&typeof r=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e===""||r==="")return[];const t=e.indexOf(r);return t===-1?[]:[e.slice(0,t),e.slice(t+r.length)]}const $e=e=>e==null,Me=e=>encodeURIComponent(e).replaceAll(/[!'()*]/g,r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`),x=Symbol("encodeFragmentIdentifier");function Le(e){switch(e.arrayFormat){case"index":return r=>(t,n)=>{const a=t.length;return n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,[c(r,e),"[",a,"]"].join("")]:[...t,[c(r,e),"[",c(a,e),"]=",c(n,e)].join("")]};case"bracket":return r=>(t,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,[c(r,e),"[]"].join("")]:[...t,[c(r,e),"[]=",c(n,e)].join("")];case"colon-list-separator":return r=>(t,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,[c(r,e),":list="].join("")]:[...t,[c(r,e),":list=",c(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{const r=e.arrayFormat==="bracket-separator"?"[]=":"=";return t=>(n,a)=>a===void 0||e.skipNull&&a===null||e.skipEmptyString&&a===""?n:(a=a===null?"":a,n.length===0?[[c(t,e),r,c(a,e)].join("")]:[[n,c(a,e)].join(e.arrayFormatSeparator)])}default:return r=>(t,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,c(r,e)]:[...t,[c(r,e),"=",c(n,e)].join("")]}}function je(e){let r;switch(e.arrayFormat){case"index":return(t,n,a)=>{if(r=/\[(\d*)]$/.exec(t),t=t.replace(/\[\d*]$/,""),!r){a[t]=n;return}a[t]===void 0&&(a[t]={}),a[t][r[1]]=n};case"bracket":return(t,n,a)=>{if(r=/(\[])$/.exec(t),t=t.replace(/\[]$/,""),!r){a[t]=n;return}if(a[t]===void 0){a[t]=[n];return}a[t]=[...a[t],n]};case"colon-list-separator":return(t,n,a)=>{if(r=/(:list)$/.exec(t),t=t.replace(/:list$/,""),!r){a[t]=n;return}if(a[t]===void 0){a[t]=[n];return}a[t]=[...a[t],n]};case"comma":case"separator":return(t,n,a)=>{const o=typeof n=="string"&&n.includes(e.arrayFormatSeparator)?n.split(e.arrayFormatSeparator).map(i=>h(i,e)):n===null?n:h(n,e);a[t]=o};case"bracket-separator":return(t,n,a)=>{const s=/(\[])$/.test(t);if(t=t.replace(/\[]$/,""),!s){a[t]=n&&h(n,e);return}const o=n===null?[]:h(n,e).split(e.arrayFormatSeparator);if(a[t]===void 0){a[t]=o;return}a[t]=[...a[t],...o]};default:return(t,n,a)=>{if(a[t]===void 0){a[t]=n;return}a[t]=[...[a[t]].flat(),n]}}}function re(e){if(typeof e!="string"||e.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function c(e,r){return r.encode?r.strict?Me(e):encodeURIComponent(e):e}function h(e,r){return r.decode?xe(e):e}function te(e){return Array.isArray(e)?e.sort():typeof e=="object"?te(Object.keys(e)).sort((r,t)=>Number(r)-Number(t)).map(r=>e[r]):e}function ne(e){const r=e.indexOf("#");return r!==-1&&(e=e.slice(0,r)),e}function De(e){let r="";const t=e.indexOf("#");return t!==-1&&(r=e.slice(t)),r}function q(e,r,t){return t==="string"&&typeof e=="string"?e:typeof t=="function"&&typeof e=="string"?t(e):t==="boolean"&&e===null?!0:t==="boolean"&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")?e.toLowerCase()==="true":t==="boolean"&&e!==null&&(e.toLowerCase()==="1"||e.toLowerCase()==="0")?e.toLowerCase()==="1":t==="string[]"&&r.arrayFormat!=="none"&&typeof e=="string"?[e]:t==="number[]"&&r.arrayFormat!=="none"&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?[Number(e)]:t==="number"&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?Number(e):r.parseBooleans&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")?e.toLowerCase()==="true":r.parseNumbers&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?Number(e):e}function U(e){e=ne(e);const r=e.indexOf("?");return r===-1?"":e.slice(r+1)}function $(e,r){r={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,types:Object.create(null),...r},re(r.arrayFormatSeparator);const t=je(r),n=Object.create(null);if(typeof e!="string"||(e=e.trim().replace(/^[?#&]/,""),!e))return n;for(const a of e.split("&")){if(a==="")continue;const s=r.decode?a.replaceAll("+"," "):a;let[o,i]=ee(s,"=");o===void 0&&(o=s),i=i===void 0?null:["comma","separator","bracket-separator"].includes(r.arrayFormat)?i:h(i,r),t(h(o,r),i,n)}for(const[a,s]of Object.entries(n))if(typeof s=="object"&&s!==null&&r.types[a]!=="string")for(const[o,i]of Object.entries(s)){const l=r.types[a],f=typeof l=="function"?l:l?l.replace("[]",""):void 0;s[o]=q(i,r,f)}else typeof s=="object"&&s!==null&&r.types[a]==="string"?n[a]=Object.values(s).join(r.arrayFormatSeparator):n[a]=q(s,r,r.types[a]);return r.sort===!1?n:(r.sort===!0?Object.keys(n).sort():Object.keys(n).sort(r.sort)).reduce((a,s)=>{const o=n[s];return a[s]=o&&typeof o=="object"&&!Array.isArray(o)?te(o):o,a},Object.create(null))}function ae(e,r){if(!e)return"";r={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...r},re(r.arrayFormatSeparator);const t=o=>r.skipNull&&$e(e[o])||r.skipEmptyString&&e[o]==="",n=Le(r),a={};for(const[o,i]of Object.entries(e))t(o)||(a[o]=i);const s=Object.keys(a);return r.sort!==!1&&s.sort(r.sort),s.map(o=>{let i=e[o];if(r.replacer&&(i=r.replacer(o,i),i===void 0)||i===void 0)return"";if(i===null)return c(o,r);if(Array.isArray(i)){if(i.length===0&&r.arrayFormat==="bracket-separator")return c(o,r)+"[]";let l=i;return r.replacer&&(l=i.map((f,u)=>r.replacer(`${o}[${u}]`,f)).filter(f=>f!==void 0)),l.reduce(n(o),[]).join("&")}return c(o,r)+"="+c(i,r)}).filter(o=>o.length>0).join("&")}function se(e,r){r={decode:!0,...r};let[t,n]=ee(e,"#");return t===void 0&&(t=e),{url:t?.split("?")?.[0]??"",query:$(U(e),r),...r&&r.parseFragmentIdentifier&&n?{fragmentIdentifier:h(n,r)}:{}}}function oe(e,r){r={encode:!0,strict:!0,[x]:!0,...r};const t=ne(e.url).split("?")[0]||"",n=U(e.url),a={...$(n,{sort:!1,...r}),...e.query};let s=ae(a,r);s&&=`?${s}`;let o=De(e.url);if(typeof e.fragmentIdentifier=="string"){const i=new URL(t);i.hash=e.fragmentIdentifier,o=r[x]?i.hash:`#${e.fragmentIdentifier}`}return`${t}${s}${o}`}function ie(e,r,t){t={parseFragmentIdentifier:!0,[x]:!1,...t};const{url:n,query:a,fragmentIdentifier:s}=se(e,t);return oe({url:n,query:Ue(a,r),fragmentIdentifier:s},t)}function Pe(e,r,t){const n=Array.isArray(r)?a=>!r.includes(a):(a,s)=>!r(a,s);return ie(e,n,t)}const Ve=Object.freeze(Object.defineProperty({__proto__:null,exclude:Pe,extract:U,parse:$,parseUrl:se,pick:ie,stringify:ae,stringifyUrl:oe},Symbol.toStringTag,{value:"Module"}));var S=(function(e){return e.COMPONENT_READY="streamlit:componentReady",e.SET_COMPONENT_VALUE="streamlit:setComponentValue",e.SET_FRAME_HEIGHT="streamlit:setFrameHeight",e})({}),ke=(function(e){return e.RENDER="streamlit:render",e})({});const He=1,F=Q.getLogger("componentUtils");function We(e){return(r,t)=>{if(!e.current)return;const{isReady:n,element:a,widgetMgr:s,setComponentError:o,componentReadyCallback:i,frameHeightCallback:l,fragmentId:f}=e.current,u=n();switch(r){case S.COMPONENT_READY:{const{apiVersion:y}=t;y!==He?o(new Error(`Unrecognized component API version: '${y}'`)):i();break}case S.SET_COMPONENT_VALUE:u?Ge(K(t,"value"),t.dataType,{fromUi:!0},a,s,f):F.warn(`Got ${r} before ${S.COMPONENT_READY}!`);break;case S.SET_FRAME_HEIGHT:u?l(K(t,"height")):F.warn(`Got ${r} before ${S.COMPONENT_READY}!`);break;default:F.warn(`Unrecognized ComponentBackMsgType: ${r}`)}}}function Ye(e,r){const t=JSON.parse(e),n=[];for(const a of r){const{key:s}=a;switch(a.value?.toLowerCase()){case"arrowdataframe":n.push({key:s,value:ge.toObject(a.arrowDataframe)});break;case"bytes":t[s]=a.bytes;break;default:throw new Error(`Unrecognized SpecialArg type: ${a.value}`)}}return[t,n]}function z(e,r,t,n,a){if(!a){F.warn("Can't send ForwardMsg; missing our iframe!");return}if(Z(a.contentWindow)){F.warn("Can't send ForwardMsg; iframe has no contentWindow!");return}a.contentWindow.postMessage({type:ke.RENDER,args:e,dfs:r,disabled:t,theme:{...me(n),font:n.genericFonts.bodyFont}},"*")}function Ge(e,r,t,n,a,s){if(e===void 0){F.warn("handleSetComponentValue: missing 'value' prop");return}switch(r){case"dataframe":a.setArrowValue(n,e,t,s);break;case"bytes":a.setBytesValue(n,e,t,s);break;default:a.setJsonValue(n,e,t,s)}}function K(e,r,t=void 0){return Object.hasOwn(e,r)?e[r]:t}const Be=he("iframe",{target:"edxyb2x0"})(({theme:e,componentReady:r})=>({colorScheme:"normal",border:"none",padding:e.spacing.none,margin:e.spacing.none,display:r?"initial":"none"})),R=Q.getLogger("ComponentInstance"),J=6e4;function qe(e,r,t){let n;Ne(t)&&t!==""?n=t:n=r.getComponentURL(e,"index.html");const a=Oe.CUSTOM_COMPONENT_CLIENT_ID,s=new URL(window.location.href);return n=Ve.stringifyUrl({url:n,query:{streamlitUrl:s.origin+s.pathname,...a&&{__streamlit_parent_client_id:a}}}),n}function X(e,r){let t;return r&&r!==""?t=`Your app is having trouble loading the **${e}** component.
1
+ import{V as Q,e as Z,bu as me,bv as ge,z as he,r as d,l as ye,bw as k,aj as _,j as A,aM as pe,bx as H,by as Ee,a0 as be,a1 as Fe,o as Ce,$ as we,aL as Se,n as Ne,S as Oe}from"./index.lMhsw-5K.js";import{bz as nr}from"./index.lMhsw-5K.js";import{w as Ae}from"./withCalculatedWidth.CrAfFzO9.js";import{C as W,a as Y}from"./urls.BwSlolu9.js";import{D as Re,a as Ie}from"./IFrameUtil.DefezniK.js";const v="%[a-f0-9]{2}",G=new RegExp("("+v+")|([^%]+?)","gi"),B=new RegExp("("+v+")+","gi");function T(e,r){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;r=r||1;const t=e.slice(0,r),n=e.slice(r);return Array.prototype.concat.call([],T(t),T(n))}function _e(e){try{return decodeURIComponent(e)}catch{let r=e.match(G)||[];for(let t=1;t<r.length;t++)e=T(r,t).join(""),r=e.match(G)||[];return e}}function Te(e){const r={"%FE%FF":"��","%FF%FE":"��"};let t=B.exec(e);for(;t;){try{r[t[0]]=decodeURIComponent(t[0])}catch{const a=_e(t[0]);a!==t[0]&&(r[t[0]]=a)}t=B.exec(e)}r["%C2"]="�";const n=Object.keys(r);for(const a of n)e=e.replace(new RegExp(a,"g"),r[a]);return e}function xe(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return Te(e)}}function Ue(e,r){const t={};if(Array.isArray(r))for(const n of r){const a=Object.getOwnPropertyDescriptor(e,n);a?.enumerable&&Object.defineProperty(t,n,a)}else for(const n of Reflect.ownKeys(e)){const a=Object.getOwnPropertyDescriptor(e,n);if(a.enumerable){const s=e[n];r(n,s,e)&&Object.defineProperty(t,n,a)}}return t}function ee(e,r){if(!(typeof e=="string"&&typeof r=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e===""||r==="")return[];const t=e.indexOf(r);return t===-1?[]:[e.slice(0,t),e.slice(t+r.length)]}const $e=e=>e==null,Me=e=>encodeURIComponent(e).replaceAll(/[!'()*]/g,r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`),x=Symbol("encodeFragmentIdentifier");function Le(e){switch(e.arrayFormat){case"index":return r=>(t,n)=>{const a=t.length;return n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,[c(r,e),"[",a,"]"].join("")]:[...t,[c(r,e),"[",c(a,e),"]=",c(n,e)].join("")]};case"bracket":return r=>(t,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,[c(r,e),"[]"].join("")]:[...t,[c(r,e),"[]=",c(n,e)].join("")];case"colon-list-separator":return r=>(t,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,[c(r,e),":list="].join("")]:[...t,[c(r,e),":list=",c(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{const r=e.arrayFormat==="bracket-separator"?"[]=":"=";return t=>(n,a)=>a===void 0||e.skipNull&&a===null||e.skipEmptyString&&a===""?n:(a=a===null?"":a,n.length===0?[[c(t,e),r,c(a,e)].join("")]:[[n,c(a,e)].join(e.arrayFormatSeparator)])}default:return r=>(t,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?t:n===null?[...t,c(r,e)]:[...t,[c(r,e),"=",c(n,e)].join("")]}}function je(e){let r;switch(e.arrayFormat){case"index":return(t,n,a)=>{if(r=/\[(\d*)]$/.exec(t),t=t.replace(/\[\d*]$/,""),!r){a[t]=n;return}a[t]===void 0&&(a[t]={}),a[t][r[1]]=n};case"bracket":return(t,n,a)=>{if(r=/(\[])$/.exec(t),t=t.replace(/\[]$/,""),!r){a[t]=n;return}if(a[t]===void 0){a[t]=[n];return}a[t]=[...a[t],n]};case"colon-list-separator":return(t,n,a)=>{if(r=/(:list)$/.exec(t),t=t.replace(/:list$/,""),!r){a[t]=n;return}if(a[t]===void 0){a[t]=[n];return}a[t]=[...a[t],n]};case"comma":case"separator":return(t,n,a)=>{const o=typeof n=="string"&&n.includes(e.arrayFormatSeparator)?n.split(e.arrayFormatSeparator).map(i=>h(i,e)):n===null?n:h(n,e);a[t]=o};case"bracket-separator":return(t,n,a)=>{const s=/(\[])$/.test(t);if(t=t.replace(/\[]$/,""),!s){a[t]=n&&h(n,e);return}const o=n===null?[]:h(n,e).split(e.arrayFormatSeparator);if(a[t]===void 0){a[t]=o;return}a[t]=[...a[t],...o]};default:return(t,n,a)=>{if(a[t]===void 0){a[t]=n;return}a[t]=[...[a[t]].flat(),n]}}}function re(e){if(typeof e!="string"||e.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function c(e,r){return r.encode?r.strict?Me(e):encodeURIComponent(e):e}function h(e,r){return r.decode?xe(e):e}function te(e){return Array.isArray(e)?e.sort():typeof e=="object"?te(Object.keys(e)).sort((r,t)=>Number(r)-Number(t)).map(r=>e[r]):e}function ne(e){const r=e.indexOf("#");return r!==-1&&(e=e.slice(0,r)),e}function De(e){let r="";const t=e.indexOf("#");return t!==-1&&(r=e.slice(t)),r}function q(e,r,t){return t==="string"&&typeof e=="string"?e:typeof t=="function"&&typeof e=="string"?t(e):t==="boolean"&&e===null?!0:t==="boolean"&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")?e.toLowerCase()==="true":t==="boolean"&&e!==null&&(e.toLowerCase()==="1"||e.toLowerCase()==="0")?e.toLowerCase()==="1":t==="string[]"&&r.arrayFormat!=="none"&&typeof e=="string"?[e]:t==="number[]"&&r.arrayFormat!=="none"&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?[Number(e)]:t==="number"&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?Number(e):r.parseBooleans&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")?e.toLowerCase()==="true":r.parseNumbers&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?Number(e):e}function U(e){e=ne(e);const r=e.indexOf("?");return r===-1?"":e.slice(r+1)}function $(e,r){r={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,types:Object.create(null),...r},re(r.arrayFormatSeparator);const t=je(r),n=Object.create(null);if(typeof e!="string"||(e=e.trim().replace(/^[?#&]/,""),!e))return n;for(const a of e.split("&")){if(a==="")continue;const s=r.decode?a.replaceAll("+"," "):a;let[o,i]=ee(s,"=");o===void 0&&(o=s),i=i===void 0?null:["comma","separator","bracket-separator"].includes(r.arrayFormat)?i:h(i,r),t(h(o,r),i,n)}for(const[a,s]of Object.entries(n))if(typeof s=="object"&&s!==null&&r.types[a]!=="string")for(const[o,i]of Object.entries(s)){const l=r.types[a],f=typeof l=="function"?l:l?l.replace("[]",""):void 0;s[o]=q(i,r,f)}else typeof s=="object"&&s!==null&&r.types[a]==="string"?n[a]=Object.values(s).join(r.arrayFormatSeparator):n[a]=q(s,r,r.types[a]);return r.sort===!1?n:(r.sort===!0?Object.keys(n).sort():Object.keys(n).sort(r.sort)).reduce((a,s)=>{const o=n[s];return a[s]=o&&typeof o=="object"&&!Array.isArray(o)?te(o):o,a},Object.create(null))}function ae(e,r){if(!e)return"";r={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...r},re(r.arrayFormatSeparator);const t=o=>r.skipNull&&$e(e[o])||r.skipEmptyString&&e[o]==="",n=Le(r),a={};for(const[o,i]of Object.entries(e))t(o)||(a[o]=i);const s=Object.keys(a);return r.sort!==!1&&s.sort(r.sort),s.map(o=>{let i=e[o];if(r.replacer&&(i=r.replacer(o,i),i===void 0)||i===void 0)return"";if(i===null)return c(o,r);if(Array.isArray(i)){if(i.length===0&&r.arrayFormat==="bracket-separator")return c(o,r)+"[]";let l=i;return r.replacer&&(l=i.map((f,u)=>r.replacer(`${o}[${u}]`,f)).filter(f=>f!==void 0)),l.reduce(n(o),[]).join("&")}return c(o,r)+"="+c(i,r)}).filter(o=>o.length>0).join("&")}function se(e,r){r={decode:!0,...r};let[t,n]=ee(e,"#");return t===void 0&&(t=e),{url:t?.split("?")?.[0]??"",query:$(U(e),r),...r&&r.parseFragmentIdentifier&&n?{fragmentIdentifier:h(n,r)}:{}}}function oe(e,r){r={encode:!0,strict:!0,[x]:!0,...r};const t=ne(e.url).split("?")[0]||"",n=U(e.url),a={...$(n,{sort:!1,...r}),...e.query};let s=ae(a,r);s&&=`?${s}`;let o=De(e.url);if(typeof e.fragmentIdentifier=="string"){const i=new URL(t);i.hash=e.fragmentIdentifier,o=r[x]?i.hash:`#${e.fragmentIdentifier}`}return`${t}${s}${o}`}function ie(e,r,t){t={parseFragmentIdentifier:!0,[x]:!1,...t};const{url:n,query:a,fragmentIdentifier:s}=se(e,t);return oe({url:n,query:Ue(a,r),fragmentIdentifier:s},t)}function Pe(e,r,t){const n=Array.isArray(r)?a=>!r.includes(a):(a,s)=>!r(a,s);return ie(e,n,t)}const Ve=Object.freeze(Object.defineProperty({__proto__:null,exclude:Pe,extract:U,parse:$,parseUrl:se,pick:ie,stringify:ae,stringifyUrl:oe},Symbol.toStringTag,{value:"Module"}));var S=(function(e){return e.COMPONENT_READY="streamlit:componentReady",e.SET_COMPONENT_VALUE="streamlit:setComponentValue",e.SET_FRAME_HEIGHT="streamlit:setFrameHeight",e})({}),ke=(function(e){return e.RENDER="streamlit:render",e})({});const He=1,F=Q.getLogger("componentUtils");function We(e){return(r,t)=>{if(!e.current)return;const{isReady:n,element:a,widgetMgr:s,setComponentError:o,componentReadyCallback:i,frameHeightCallback:l,fragmentId:f}=e.current,u=n();switch(r){case S.COMPONENT_READY:{const{apiVersion:y}=t;y!==He?o(new Error(`Unrecognized component API version: '${y}'`)):i();break}case S.SET_COMPONENT_VALUE:u?Ge(K(t,"value"),t.dataType,{fromUi:!0},a,s,f):F.warn(`Got ${r} before ${S.COMPONENT_READY}!`);break;case S.SET_FRAME_HEIGHT:u?l(K(t,"height")):F.warn(`Got ${r} before ${S.COMPONENT_READY}!`);break;default:F.warn(`Unrecognized ComponentBackMsgType: ${r}`)}}}function Ye(e,r){const t=JSON.parse(e),n=[];for(const a of r){const{key:s}=a;switch(a.value?.toLowerCase()){case"arrowdataframe":n.push({key:s,value:ge.toObject(a.arrowDataframe)});break;case"bytes":t[s]=a.bytes;break;default:throw new Error(`Unrecognized SpecialArg type: ${a.value}`)}}return[t,n]}function z(e,r,t,n,a){if(!a){F.warn("Can't send ForwardMsg; missing our iframe!");return}if(Z(a.contentWindow)){F.warn("Can't send ForwardMsg; iframe has no contentWindow!");return}a.contentWindow.postMessage({type:ke.RENDER,args:e,dfs:r,disabled:t,theme:{...me(n),font:n.genericFonts.bodyFont}},"*")}function Ge(e,r,t,n,a,s){if(e===void 0){F.warn("handleSetComponentValue: missing 'value' prop");return}switch(r){case"dataframe":a.setArrowValue(n,e,t,s);break;case"bytes":a.setBytesValue(n,e,t,s);break;default:a.setJsonValue(n,e,t,s)}}function K(e,r,t=void 0){return Object.hasOwn(e,r)?e[r]:t}const Be=he("iframe",{target:"edxyb2x0"})(({theme:e,componentReady:r})=>({colorScheme:"normal",border:"none",padding:e.spacing.none,margin:e.spacing.none,display:r?"initial":"none"})),R=Q.getLogger("ComponentInstance"),J=6e4;function qe(e,r,t){let n;Ne(t)&&t!==""?n=t:n=r.getComponentURL(e,"index.html");const a=Oe.CUSTOM_COMPONENT_CLIENT_ID,s=new URL(window.location.href);return n=Ve.stringifyUrl({url:n,query:{streamlitUrl:s.origin+s.pathname,...a&&{__streamlit_parent_client_id:a}}}),n}function X(e,r){let t;return r&&r!==""?t=`Your app is having trouble loading the **${e}** component.
2
2
  The app is attempting to load the component from **${r}**,
3
3
  and hasn't received its \`Streamlit.setComponentReady()\` message.
4
4
 
@@ -1 +1 @@
1
- import{r as m,l as x,m as C,j as s,o as T,p as y,q as L,P as S,t as W,C as B,v as w}from"./index.BB_iwaVr.js";import{W as R}from"./WidgetLabelHelpIconInline.3DnEd9BK.js";import{u as E}from"./useBasicWidgetState.8WwISl9r.js";import{S as P,L as v,a as u}from"./checkbox.CcUx3XuQ.js";import"./FormClearHelper.CypmvhYZ.js";function $({element:o,disabled:a,widgetMgr:n,fragmentId:d}){const[p,g]=E({getStateFromWidgetMgr:M,getDefaultStateFromProto:X,getCurrStateFromProto:H,updateWidgetMgrState:V,element:o,widgetMgr:n,fragmentId:d}),f=m.useCallback(i=>{g({value:i.target.checked,fromUi:!0})},[g]),t=x(),{colors:r,spacing:h,sizes:e}=t,b=C(t),k=a?r.fadedText40:r.bodyText;return s(w,{className:"row-widget stCheckbox","data-testid":"stCheckbox",children:s(P,{checked:p,disabled:a,onChange:f,"aria-label":o.label,checkmarkType:o.type===B.StyleType.TOGGLE?u.toggle:u.default,labelPlacement:v.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:h.none,marginTop:h.none,backgroundColor:i?r.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Toggle:{style:({$checked:i})=>{let c=b?r.bgColor:r.bodyText;return a&&(c=b?r.gray70:r.gray90),{width:`calc(${e.checkbox} - ${t.spacing.twoXS})`,height:`calc(${e.checkbox} - ${t.spacing.twoXS})`,transform:i?`translateX(${e.checkbox})`:"",backgroundColor:c,boxShadow:""}}},ToggleTrack:{style:({$checked:i,$isHovered:c})=>{let l=r.borderColor;return c&&!a&&(l=r.darkenedBgMix15),i&&!a&&(l=r.primary),{marginRight:0,marginLeft:0,marginBottom:0,marginTop:t.spacing.twoXS,paddingLeft:t.spacing.threeXS,paddingRight:t.spacing.threeXS,width:`calc(2 * ${e.checkbox})`,minWidth:`calc(2 * ${e.checkbox})`,height:e.checkbox,minHeight:e.checkbox,borderBottomLeftRadius:t.radii.full,borderTopLeftRadius:t.radii.full,borderBottomRightRadius:t.radii.full,borderTopRightRadius:t.radii.full,backgroundColor:l}}},Checkmark:{style:({$isFocusVisible:i,$checked:c})=>{const l=c&&!a?r.primary:r.borderColor;return{outline:0,width:e.checkbox,height:e.checkbox,marginTop:t.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&c?t.shadows.focusRing:"",borderLeftWidth:e.borderWidth,borderRightWidth:e.borderWidth,borderTopWidth:e.borderWidth,borderBottomWidth:e.borderWidth,borderLeftColor:l,borderRightColor:l,borderTopColor:l,borderBottomColor:l}}},Label:{style:{lineHeight:t.lineHeights.small,paddingLeft:t.spacing.sm,position:"relative",color:k}}},children:T(W,{visibility:y(o.labelVisibility?.value),"data-testid":"stWidgetLabel",children:[s(L,{source:o.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),o.help&&s(R,{content:o.help,placement:S.TOP_RIGHT,label:o.label})]})})})}function M(o,a){return o.getBoolValue(a)}function X(o){return o.default??null}function H(o){return o.value??null}function V(o,a,n,d){a.setBoolValue(o,n.value,{fromUi:n.fromUi},d)}const _=m.memo($);export{_ as default};
1
+ import{r as m,l as x,m as C,j as s,o as T,p as y,q as L,P as S,t as W,C as B,v as w}from"./index.lMhsw-5K.js";import{W as R}from"./WidgetLabelHelpIconInline.C1NBCx-y.js";import{u as E}from"./useBasicWidgetState.BwQxG7iA.js";import{S as P,L as v,a as u}from"./checkbox.S6O8DPFl.js";import"./FormClearHelper.BM3uDLnU.js";function $({element:o,disabled:a,widgetMgr:n,fragmentId:d}){const[p,g]=E({getStateFromWidgetMgr:M,getDefaultStateFromProto:X,getCurrStateFromProto:H,updateWidgetMgrState:V,element:o,widgetMgr:n,fragmentId:d}),f=m.useCallback(i=>{g({value:i.target.checked,fromUi:!0})},[g]),t=x(),{colors:r,spacing:h,sizes:e}=t,b=C(t),k=a?r.fadedText40:r.bodyText;return s(w,{className:"row-widget stCheckbox","data-testid":"stCheckbox",children:s(P,{checked:p,disabled:a,onChange:f,"aria-label":o.label,checkmarkType:o.type===B.StyleType.TOGGLE?u.toggle:u.default,labelPlacement:v.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:h.none,marginTop:h.none,backgroundColor:i?r.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Toggle:{style:({$checked:i})=>{let c=b?r.bgColor:r.bodyText;return a&&(c=b?r.gray70:r.gray90),{width:`calc(${e.checkbox} - ${t.spacing.twoXS})`,height:`calc(${e.checkbox} - ${t.spacing.twoXS})`,transform:i?`translateX(${e.checkbox})`:"",backgroundColor:c,boxShadow:""}}},ToggleTrack:{style:({$checked:i,$isHovered:c})=>{let l=r.borderColor;return c&&!a&&(l=r.darkenedBgMix15),i&&!a&&(l=r.primary),{marginRight:0,marginLeft:0,marginBottom:0,marginTop:t.spacing.twoXS,paddingLeft:t.spacing.threeXS,paddingRight:t.spacing.threeXS,width:`calc(2 * ${e.checkbox})`,minWidth:`calc(2 * ${e.checkbox})`,height:e.checkbox,minHeight:e.checkbox,borderBottomLeftRadius:t.radii.full,borderTopLeftRadius:t.radii.full,borderBottomRightRadius:t.radii.full,borderTopRightRadius:t.radii.full,backgroundColor:l}}},Checkmark:{style:({$isFocusVisible:i,$checked:c})=>{const l=c&&!a?r.primary:r.borderColor;return{outline:0,width:e.checkbox,height:e.checkbox,marginTop:t.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&c?t.shadows.focusRing:"",borderLeftWidth:e.borderWidth,borderRightWidth:e.borderWidth,borderTopWidth:e.borderWidth,borderBottomWidth:e.borderWidth,borderLeftColor:l,borderRightColor:l,borderTopColor:l,borderBottomColor:l}}},Label:{style:{lineHeight:t.lineHeights.small,paddingLeft:t.spacing.sm,position:"relative",color:k}}},children:T(W,{visibility:y(o.labelVisibility?.value),"data-testid":"stWidgetLabel",children:[s(L,{source:o.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),o.help&&s(R,{content:o.help,placement:S.TOP_RIGHT,label:o.label})]})})})}function M(o,a){return o.getBoolValue(a)}function X(o){return o.default??null}function H(o){return o.value??null}function V(o,a,n,d){a.setBoolValue(o,n.value,{fromUi:n.fromUi},d)}const _=m.memo($);export{_ as default};
@@ -1 +1 @@
1
- import{z as f,r as s,l as v,o as x,j as i,Y as m,q as L,Z as r,$ as R,m as C,n as k,a0 as z,a1 as B}from"./index.BB_iwaVr.js";const E=f("button",{target:"e1a81sb30"})(({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}})),H=f("div",{target:"e1a81sb31"})(({theme:o})=>({display:"flex",flexDirection:"row",gap:o.spacing.lg,"> span":{marginTop:o.spacing.twoXS}})),D=f("div",{target:"e1a81sb32"})(({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 M(o){const a=C(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:o.colors.bgColor,filter:a?"brightness(0.98)":"brightness(1.2)",color:o.colors.bodyText,boxShadow:o.shadows.popover}},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 I(o){if(o.length>104){let t=o.replace(/^(.{104}[^\s]*).*/,"$1");return t.length>104&&(t=t.substring(0,104).split(" ").slice(0,-1).join(" ")),t.trim()}return o}function j({element:o}){const{body:a,icon:t,duration:d}=o,n=v(),c=I(a),l=a!==c,[e,T]=s.useState(!l),[b,w]=s.useState(0),y=s.useCallback(()=>{T(!e)},[e]),g=s.useMemo(()=>M(n),[n]),p=s.useMemo(()=>x(H,{expanded:e,children:[t&&i(m,{iconValue:t,size:"xl",testid:"stToastDynamicIcon"}),x(D,{children:[i(L,{source:e?a:c,allowHTML:!1,isToast:!0}),l&&i(E,{"data-testid":"stToastViewButton",onClick:y,children:e?"view less":"view more"})]})]}),[l,e,a,t,c,y]);s.useEffect(()=>{if(n.inSidebar)return;const h=k(d)?d===0?0:d*1e3:4e3,u=r.info(p,{overrides:{...g},autoHideDuration:h});return w(u),()=>{r.update(u,{overrides:{Body:{style:{display:"none"}}}}),r.clear(u)}},[]),s.useEffect(()=>{r.update(b,{children:p,overrides:{...g}})},[b,p,g]);const S=i(B,{kind:z.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."});return i(R,{children:n.inSidebar&&S})}const O=s.memo(j);export{O as default};
1
+ import{z as f,r as s,l as v,o as x,j as i,Y as m,q as L,Z as r,$ as R,m as C,n as k,a0 as z,a1 as B}from"./index.lMhsw-5K.js";const E=f("button",{target:"e1a81sb30"})(({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}})),H=f("div",{target:"e1a81sb31"})(({theme:o})=>({display:"flex",flexDirection:"row",gap:o.spacing.lg,"> span":{marginTop:o.spacing.twoXS}})),D=f("div",{target:"e1a81sb32"})(({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 M(o){const a=C(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:o.colors.bgColor,filter:a?"brightness(0.98)":"brightness(1.2)",color:o.colors.bodyText,boxShadow:o.shadows.popover}},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 I(o){if(o.length>104){let t=o.replace(/^(.{104}[^\s]*).*/,"$1");return t.length>104&&(t=t.substring(0,104).split(" ").slice(0,-1).join(" ")),t.trim()}return o}function j({element:o}){const{body:a,icon:t,duration:d}=o,n=v(),c=I(a),l=a!==c,[e,T]=s.useState(!l),[b,w]=s.useState(0),y=s.useCallback(()=>{T(!e)},[e]),g=s.useMemo(()=>M(n),[n]),p=s.useMemo(()=>x(H,{expanded:e,children:[t&&i(m,{iconValue:t,size:"xl",testid:"stToastDynamicIcon"}),x(D,{children:[i(L,{source:e?a:c,allowHTML:!1,isToast:!0}),l&&i(E,{"data-testid":"stToastViewButton",onClick:y,children:e?"view less":"view more"})]})]}),[l,e,a,t,c,y]);s.useEffect(()=>{if(n.inSidebar)return;const h=k(d)?d===0?0:d*1e3:4e3,u=r.info(p,{overrides:{...g},autoHideDuration:h});return w(u),()=>{r.update(u,{overrides:{Body:{style:{display:"none"}}}}),r.clear(u)}},[]),s.useEffect(()=>{r.update(b,{children:p,overrides:{...g}})},[b,p,g]);const S=i(B,{kind:z.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."});return i(R,{children:n.inSidebar&&S})}const O=s.memo(j);export{O as default};
@@ -1 +1 @@
1
- import{z as e,r as a,o as t,j as r,q as o}from"./index.BB_iwaVr.js";import{P as i}from"./ProgressBar.Dy9CI6w4.js";const l=e("div",{target:"e1jwj65h0"})(({theme:s})=>({paddingBottom:s.spacing.sm,lineHeight:"normal"}));function n({element:s}){return t("div",{className:"stProgress","data-testid":"stProgress",children:[r(l,{children:r(o,{source:s.text,allowHTML:!1,isLabel:!0})}),r(i,{value:s.value})]})}const m=a.memo(n);export{m as default};
1
+ import{z as e,r as a,o as t,j as r,q as o}from"./index.lMhsw-5K.js";import{P as i}from"./ProgressBar.DWErD3j3.js";const l=e("div",{target:"e1jwj65h0"})(({theme:s})=>({paddingBottom:s.spacing.sm,lineHeight:"normal"}));function n({element:s}){return t("div",{className:"stProgress","data-testid":"stProgress",children:[r(l,{children:r(o,{source:s.text,allowHTML:!1,isLabel:!0})}),r(i,{value:s.value})]})}const m=a.memo(n);export{m as default};
@@ -1,2 +1,2 @@
1
- import{z as f,r,l as b,aI as y,j as c,aJ as S,aw as x,o as h,m as T,Y as R,aK as v,aL as B,aM as E}from"./index.BB_iwaVr.js";import{l as J}from"./index.8HslT92O.js";import{R as k}from"./main.u5Bb3MY7.js";const w=f("div",{target:"eem6pay0"})(({theme:o})=>({overflowY:"auto",position:"relative",".react-json-view .copy-icon svg":{fontSize:"1em !important",marginRight:`${o.spacing.threeXS} !important`,verticalAlign:"middle !important"}})),L=f("div",{target:"eem6pay1"})(({theme:o})=>({display:"flex",alignItems:"center",gap:o.spacing.sm,padding:o.spacing.sm,paddingLeft:o.spacing.md,fontFamily:o.genericFonts.codeFont,fontSize:o.fontSizes.twoSm,color:o.colors.bodyText,maxWidth:"90vw",wordBreak:"break-all"})),$=f("button",{target:"eem6pay2"})(({theme:o})=>({display:"flex",alignItems:"center",justifyContent:"center",padding:o.spacing.threeXS,backgroundColor:"transparent",border:"none",borderRadius:o.radii.md,cursor:"pointer",color:o.colors.fadedText60,transition:"color 0.15s ease, background-color 0.15s ease","&:hover":{backgroundColor:o.colors.darkenedBgMix15,color:o.colors.bodyText},"&:active":{backgroundColor:o.colors.darkenedBgMix25},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:o.shadows.focusRing}})),I=f("div",{target:"eem6pay3"})(({top:o,left:e})=>({position:"fixed",top:o,left:e}));function P({top:o,left:e,path:t,clearTooltip:d}){const[p,n]=r.useState(!0),s=b(),{colors:i,radii:a}=s,{isCopied:l,copyToClipboard:u,label:m}=y(),g=r.useCallback(()=>{n(!1),d()},[d]),C=r.useCallback(()=>{u(t)},[u,t]);return c(v,{content:h(L,{"data-testid":"stJsonPathTooltip",children:[c("code",{children:t}),c($,{onClick:C,title:m,"aria-label":m,autoFocus:!0,children:c(R,{size:"sm",iconValue:l?":material/check:":":material/content_copy:"})})]}),placement:x.top,accessibilityType:S.tooltip,showArrow:!1,popoverMargin:15,onClickOutside:g,onEsc:g,overrides:{Body:{style:{borderTopLeftRadius:a.default,borderTopRightRadius:a.default,borderBottomLeftRadius:a.default,borderBottomRightRadius:a.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:T(s)?i.bgColor:i.secondaryBg,color:i.bodyText,borderTopLeftRadius:a.default,borderTopRightRadius:a.default,borderBottomLeftRadius:a.default,borderBottomRightRadius:a.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:p,children:c(I,{"data-testid":"stJsonPathTooltipTarget",top:o,left:e})})}const j=r.memo(P);function z(o){return o.length===0?"$":o.reduce((e,t,d)=>{if(t===null)return e;if(/^\d+$/.test(t))return`${e}[${t}]`;if(t===""||/[^a-zA-Z0-9_$]/.test(t)||/^\d/.test(t)){const s=t.replace(/\\/g,"\\\\").replace(/"/g,'\\"');return`${e}["${s}"]`}return d===0||e===""?t:`${e}.${t}`},"")}function F(){const[o,e]=r.useState(null),t=r.useRef({x:0,y:0});r.useEffect(()=>{const n=s=>{t.current={x:s.clientX,y:s.clientY}};return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[]);const d=r.useCallback(n=>{const{x:s,y:i}=t.current,a=[...n.namespace,n.name],l=z(a);e({path:l,x:s,y:i})},[]),p=r.useCallback(()=>{e(null)},[]);return{tooltip:o,handleSelect:d,clearTooltip:p}}function A({element:o}){const e=b(),{tooltip:t,handleSelect:d,clearTooltip:p}=F(),{copyToClipboard:n}=y(),s=r.useCallback(l=>{n(JSON.stringify(l.src))},[n]);let i;try{i=JSON.parse(o.body)}catch(l){const u=B(l);try{i=J.parse(o.body)}catch{const g=parseInt(u.message.replace(/[^0-9]/g,""),10);return u.message+=`
1
+ import{z as f,r,l as b,aI as y,j as c,aJ as S,aw as x,o as h,m as T,Y as R,aK as v,aL as B,aM as E}from"./index.lMhsw-5K.js";import{l as J}from"./index.8HslT92O.js";import{R as k}from"./main.BkNqoTrd.js";const w=f("div",{target:"eem6pay0"})(({theme:o})=>({overflowY:"auto",position:"relative",".react-json-view .copy-icon svg":{fontSize:"1em !important",marginRight:`${o.spacing.threeXS} !important`,verticalAlign:"middle !important"}})),L=f("div",{target:"eem6pay1"})(({theme:o})=>({display:"flex",alignItems:"center",gap:o.spacing.sm,padding:o.spacing.sm,paddingLeft:o.spacing.md,fontFamily:o.genericFonts.codeFont,fontSize:o.fontSizes.twoSm,color:o.colors.bodyText,maxWidth:"90vw",wordBreak:"break-all"})),$=f("button",{target:"eem6pay2"})(({theme:o})=>({display:"flex",alignItems:"center",justifyContent:"center",padding:o.spacing.threeXS,backgroundColor:"transparent",border:"none",borderRadius:o.radii.md,cursor:"pointer",color:o.colors.fadedText60,transition:"color 0.15s ease, background-color 0.15s ease","&:hover":{backgroundColor:o.colors.darkenedBgMix15,color:o.colors.bodyText},"&:active":{backgroundColor:o.colors.darkenedBgMix25},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:o.shadows.focusRing}})),I=f("div",{target:"eem6pay3"})(({top:o,left:e})=>({position:"fixed",top:o,left:e}));function P({top:o,left:e,path:t,clearTooltip:d}){const[p,n]=r.useState(!0),s=b(),{colors:i,radii:a}=s,{isCopied:l,copyToClipboard:u,label:m}=y(),g=r.useCallback(()=>{n(!1),d()},[d]),C=r.useCallback(()=>{u(t)},[u,t]);return c(v,{content:h(L,{"data-testid":"stJsonPathTooltip",children:[c("code",{children:t}),c($,{onClick:C,title:m,"aria-label":m,autoFocus:!0,children:c(R,{size:"sm",iconValue:l?":material/check:":":material/content_copy:"})})]}),placement:x.top,accessibilityType:S.tooltip,showArrow:!1,popoverMargin:15,onClickOutside:g,onEsc:g,overrides:{Body:{style:{borderTopLeftRadius:a.default,borderTopRightRadius:a.default,borderBottomLeftRadius:a.default,borderBottomRightRadius:a.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:T(s)?i.bgColor:i.secondaryBg,color:i.bodyText,borderTopLeftRadius:a.default,borderTopRightRadius:a.default,borderBottomLeftRadius:a.default,borderBottomRightRadius:a.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:p,children:c(I,{"data-testid":"stJsonPathTooltipTarget",top:o,left:e})})}const j=r.memo(P);function z(o){return o.length===0?"$":o.reduce((e,t,d)=>{if(t===null)return e;if(/^\d+$/.test(t))return`${e}[${t}]`;if(t===""||/[^a-zA-Z0-9_$]/.test(t)||/^\d/.test(t)){const s=t.replace(/\\/g,"\\\\").replace(/"/g,'\\"');return`${e}["${s}"]`}return d===0||e===""?t:`${e}.${t}`},"")}function F(){const[o,e]=r.useState(null),t=r.useRef({x:0,y:0});r.useEffect(()=>{const n=s=>{t.current={x:s.clientX,y:s.clientY}};return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[]);const d=r.useCallback(n=>{const{x:s,y:i}=t.current,a=[...n.namespace,n.name],l=z(a);e({path:l,x:s,y:i})},[]),p=r.useCallback(()=>{e(null)},[]);return{tooltip:o,handleSelect:d,clearTooltip:p}}function A({element:o}){const e=b(),{tooltip:t,handleSelect:d,clearTooltip:p}=F(),{copyToClipboard:n}=y(),s=r.useCallback(l=>{n(JSON.stringify(l.src))},[n]);let i;try{i=JSON.parse(o.body)}catch(l){const u=B(l);try{i=J.parse(o.body)}catch{const g=parseInt(u.message.replace(/[^0-9]/g,""),10);return u.message+=`
2
2
  ${o.body.substring(0,g+1)} ← here`,c(E,{name:"Json Parse Error",message:u.message})}}const a=T(e)?"rjv-default":"monokai";return h(w,{className:"stJson","data-testid":"stJson",children:[c(k,{src:i,collapsed:o.maxExpandDepth??!o.expanded,displayDataTypes:!1,displayObjectSize:!1,name:!1,theme:a,enableClipboard:s,onSelect:d,style:{fontFamily:e.genericFonts.codeFont,fontSize:e.fontSizes.codeFontSize,fontWeight:e.fontWeights.code,backgroundColor:e.colors.bgColor,whiteSpace:"pre-wrap"}}),t&&c(j,{top:t.y,left:t.x,path:t.path,clearTooltip:p})]})}const Y=r.memo(A);export{Y as default};
@@ -0,0 +1,2 @@
1
+ import{al as Ge,am as Q,r as _,bR as mt,an as bt,w as J,bo as yt,bp as Tt,z as se,l as kt,bS as Ot,bT as wt,bU as Rt,j as Z,q as De,o as xe,p as St,ab as Mt,ac as $t,bV as oe}from"./index.lMhsw-5K.js";import{h as _t}from"./moment.C7qA8nIE.js";import{w as Et}from"./withCalculatedWidth.CrAfFzO9.js";import{u as It}from"./useBasicWidgetState.BwQxG7iA.js";import{f as Dt}from"./formatMoment.C6Hwn6X5.js";import{f as xt}from"./formatNumber.CH39oSMw.js";import"./FormClearHelper.BM3uDLnU.js";import"./numbro.B9_PXfzp.js";import"./sprintf.DpPCfzXw.js";var ce={},H={},le={},de={},He;function Ce(){if(He)return de;He=1,Object.defineProperty(de,"__esModule",{value:!0}),de.Direction=void 0;var e;return(function(r){r.Right="to right",r.Left="to left",r.Down="to bottom",r.Up="to top"})(e||(de.Direction=e={})),de}var We;function Je(){return We||(We=1,(function(e){var r=le&&le.__spreadArray||function(i,s,u){if(u||arguments.length===2)for(var p=0,m=s.length,v;p<m;p++)(v||!(p in s))&&(v||(v=Array.prototype.slice.call(s,0,p)),v[p]=s[p]);return i.concat(v||Array.prototype.slice.call(s))};Object.defineProperty(e,"__esModule",{value:!0}),e.isIOS=e.useThumbOverlap=e.assertUnreachable=e.voidFn=e.getTrackBackground=e.replaceAt=e.schd=e.translate=e.getClosestThumbIndex=e.translateThumbs=e.getPaddingAndBorder=e.getMargin=e.checkInitialOverlap=e.checkValuesAgainstBoundaries=e.checkBoundaries=e.isVertical=e.relativeValue=e.normalizeValue=e.isStepDivisible=e.isTouchEvent=e.getStepDecimals=void 0;var n=Ge(),o=Ce(),h=function(i){var s=i.toString().split(".")[1];return s?s.length:0};e.getStepDecimals=h;function O(i){return i.touches&&i.touches.length||i.changedTouches&&i.changedTouches.length}e.isTouchEvent=O;function l(i,s,u){var p=(s-i)/u,m=8,v=Number(p.toFixed(m));return parseInt(v.toString(),10)===v}e.isStepDivisible=l;function g(i,s,u,p,m,v,b){var $=1e11;if(i=Math.round(i*$)/$,!v){var C=b[s-1],E=b[s+1];if(C&&C>i)return C;if(E&&E<i)return E}if(i>p)return p;if(i<u)return u;var U=Math.floor(i*$-u*$)%Math.floor(m*$),z=Math.floor(i*$-Math.abs(U)),W=U===0?i:z/$,A=Math.abs(U/$)<m/2?W:W+m,B=(0,e.getStepDecimals)(m);return parseFloat(A.toFixed(B))}e.normalizeValue=g;function F(i,s,u){return(i-s)/(u-s)}e.relativeValue=F;function V(i){return i===o.Direction.Up||i===o.Direction.Down}e.isVertical=V;function j(i,s,u){if(s>=u)throw new RangeError("min (".concat(s,") is equal/bigger than max (").concat(u,")"));if(i<s)throw new RangeError("value (".concat(i,") is smaller than min (").concat(s,")"));if(i>u)throw new RangeError("value (".concat(i,") is bigger than max (").concat(u,")"))}e.checkBoundaries=j;function I(i,s,u){return i<s?s:i>u?u:i}e.checkValuesAgainstBoundaries=I;function T(i){if(!(i.length<2)&&!i.slice(1).every(function(s,u){return i[u]<=s}))throw new RangeError("values={[".concat(i,"]} needs to be sorted when allowOverlap={false}"))}e.checkInitialOverlap=T;function d(i){var s=window.getComputedStyle(i);return{top:parseInt(s["margin-top"],10),bottom:parseInt(s["margin-bottom"],10),left:parseInt(s["margin-left"],10),right:parseInt(s["margin-right"],10)}}e.getMargin=d;function t(i){var s=window.getComputedStyle(i);return{top:parseInt(s["padding-top"],10)+parseInt(s["border-top-width"],10),bottom:parseInt(s["padding-bottom"],10)+parseInt(s["border-bottom-width"],10),left:parseInt(s["padding-left"],10)+parseInt(s["border-left-width"],10),right:parseInt(s["padding-right"],10)+parseInt(s["border-right-width"],10)}}e.getPaddingAndBorder=t;function a(i,s,u){var p=u?-1:1;i.forEach(function(m,v){return f(m,p*s[v].x,s[v].y)})}e.translateThumbs=a;function c(i,s,u,p){for(var m=0,v=L(i[0],s,u,p),b=1;b<i.length;b++){var $=L(i[b],s,u,p);$<v&&(v=$,m=b)}return m}e.getClosestThumbIndex=c;function f(i,s,u){i.style.transform="translate(".concat(s,"px, ").concat(u,"px)")}e.translate=f;var y=function(i){var s=[],u=null,p=function(){for(var m=[],v=0;v<arguments.length;v++)m[v]=arguments[v];s=m,!u&&(u=requestAnimationFrame(function(){u=null,i.apply(void 0,s)}))};return p};e.schd=y;function k(i,s,u){var p=i.slice(0);return p[s]=u,p}e.replaceAt=k;function D(i){var s=i.values,u=i.colors,p=i.min,m=i.max,v=i.direction,b=v===void 0?o.Direction.Right:v,$=i.rtl,C=$===void 0?!1:$;C&&b===o.Direction.Right?b=o.Direction.Left:C&&o.Direction.Left&&(b=o.Direction.Right);var E=s.slice(0).sort(function(z,W){return z-W}).map(function(z){return(z-p)/(m-p)*100}),U=E.reduce(function(z,W,A){return"".concat(z,", ").concat(u[A]," ").concat(W,"%, ").concat(u[A+1]," ").concat(W,"%")},"");return"linear-gradient(".concat(b,", ").concat(u[0]," 0%").concat(U,", ").concat(u[u.length-1]," 100%)")}e.getTrackBackground=D;function w(){}e.voidFn=w;function R(i){throw new Error("Didn't expect to get here")}e.assertUnreachable=R;var M=function(i,s,u,p,m){m===void 0&&(m=function(b){return b});var v=Math.ceil(r([i],Array.from(i.children),!0).reduce(function(b,$){var C=Math.ceil($.getBoundingClientRect().width);if($.innerText&&$.innerText.includes(u)&&$.childElementCount===0){var E=$.cloneNode(!0);E.innerHTML=m(s.toFixed(p)),E.style.visibility="hidden",document.body.appendChild(E),C=Math.ceil(E.getBoundingClientRect().width),document.body.removeChild(E)}return C>b?C:b},i.getBoundingClientRect().width));return v},P=function(i,s,u,p,m,v,b){b===void 0&&(b=function(E){return E});var $=[],C=function(E){var U=M(u[E],p[E],m,v,b),z=s[E].x;s.forEach(function(W,A){var B=W.x,G=M(u[A],p[A],m,v,b);E!==A&&(z>=B&&z<=B+G||z+U>=B&&z+U<=B+G)&&($.includes(A)||($.push(E),$.push(A),$=r(r([],$,!0),[E,A],!1),C(A)))})};return C(i),Array.from(new Set($.sort()))},S=function(i,s,u,p,m,v){p===void 0&&(p=.1),m===void 0&&(m=" - "),v===void 0&&(v=function(A){return A});var b=(0,e.getStepDecimals)(p),$=(0,n.useState)({}),C=$[0],E=$[1],U=(0,n.useState)(v(s[u].toFixed(b))),z=U[0],W=U[1];return(0,n.useEffect)(function(){if(i){var A=i.getThumbs();if(A.length<1)return;var B={},G=i.getOffsets(),ne=P(u,G,A,s,m,b,v),he=v(s[u].toFixed(b));if(ne.length){var ee=ne.reduce(function(te,ue,me,be){return te.length?r(r([],te,!0),[G[be[me]].x],!1):[G[be[me]].x]},[]);if(Math.min.apply(Math,ee)===G[u].x){var ge=[];ne.forEach(function(te){ge.push(s[te].toFixed(b))}),he=Array.from(new Set(ge.sort(function(te,ue){return parseFloat(te)-parseFloat(ue)}))).map(v).join(m);var pe=Math.min.apply(Math,ee),ve=Math.max.apply(Math,ee),Ie=A[ne[ee.indexOf(ve)]].getBoundingClientRect().width;B.left="".concat(Math.abs(pe-(ve+Ie))/2,"px"),B.transform="translate(-50%, 0)"}else B.visibility="hidden"}W(he),E(B)}},[i,s]),[z,C]};e.useThumbOverlap=S;function L(i,s,u,p){var m=i.getBoundingClientRect(),v=m.left,b=m.top,$=m.width,C=m.height;return V(p)?Math.abs(u-(b+C/2)):Math.abs(s-(v+$/2))}var x=function(){var i,s=((i=navigator.userAgentData)===null||i===void 0?void 0:i.platform)||navigator.platform;return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(s)||navigator.userAgent.includes("Mac")&&"ontouchend"in document};e.isIOS=x})(le)),le}var qe;function Ct(){if(qe)return H;qe=1;var e=H&&H.__extends||(function(){var I=function(T,d){return I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,a){t.__proto__=a}||function(t,a){for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(t[c]=a[c])},I(T,d)};return function(T,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");I(T,d);function t(){this.constructor=T}T.prototype=d===null?Object.create(d):(t.prototype=d.prototype,new t)}})(),r=H&&H.__createBinding||(Object.create?(function(I,T,d,t){t===void 0&&(t=d);var a=Object.getOwnPropertyDescriptor(T,d);(!a||("get"in a?!T.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return T[d]}}),Object.defineProperty(I,t,a)}):(function(I,T,d,t){t===void 0&&(t=d),I[t]=T[d]})),n=H&&H.__setModuleDefault||(Object.create?(function(I,T){Object.defineProperty(I,"default",{enumerable:!0,value:T})}):function(I,T){I.default=T}),o=H&&H.__importStar||function(I){if(I&&I.__esModule)return I;var T={};if(I!=null)for(var d in I)d!=="default"&&Object.prototype.hasOwnProperty.call(I,d)&&r(T,I,d);return n(T,I),T},h=H&&H.__spreadArray||function(I,T,d){if(d||arguments.length===2)for(var t=0,a=T.length,c;t<a;t++)(c||!(t in T))&&(c||(c=Array.prototype.slice.call(T,0,t)),c[t]=T[t]);return I.concat(c||Array.prototype.slice.call(T))};Object.defineProperty(H,"__esModule",{value:!0});var O=o(Ge()),l=Je(),g=Ce(),F=["ArrowRight","ArrowUp","k","PageUp"],V=["ArrowLeft","ArrowDown","j","PageDown"],j=(function(I){e(T,I);function T(d){var t=I.call(this,d)||this;if(t.trackRef=O.createRef(),t.thumbRefs=[],t.state={draggedTrackPos:[-1,-1],draggedThumbIndex:-1,thumbZIndexes:new Array(t.props.values.length).fill(0).map(function(a,c){return c}),isChanged:!1,markOffsets:[]},t.getOffsets=function(){var a=t.props,c=a.direction,f=a.values,y=a.min,k=a.max,D=t.trackRef.current;if(!D)return console.warn("No track element found."),[];var w=D.getBoundingClientRect(),R=(0,l.getPaddingAndBorder)(D);return t.getThumbs().map(function(M,P){var S={x:0,y:0},L=M.getBoundingClientRect(),x=(0,l.getMargin)(M);switch(c){case g.Direction.Right:return S.x=(x.left+R.left)*-1,S.y=((L.height-w.height)/2+R.top)*-1,S.x+=w.width*(0,l.relativeValue)(f[P],y,k)-L.width/2,S;case g.Direction.Left:return S.x=(x.right+R.right)*-1,S.y=((L.height-w.height)/2+R.top)*-1,S.x+=w.width-w.width*(0,l.relativeValue)(f[P],y,k)-L.width/2,S;case g.Direction.Up:return S.x=((L.width-w.width)/2+x.left+R.left)*-1,S.y=-R.left,S.y+=w.height-w.height*(0,l.relativeValue)(f[P],y,k)-L.height/2,S;case g.Direction.Down:return S.x=((L.width-w.width)/2+x.left+R.left)*-1,S.y=-R.left,S.y+=w.height*(0,l.relativeValue)(f[P],y,k)-L.height/2,S;default:return(0,l.assertUnreachable)(c)}})},t.getThumbs=function(){return t.trackRef&&t.trackRef.current?Array.from(t.trackRef.current.children).filter(function(a){return a.hasAttribute("aria-valuenow")}):(console.warn("No thumbs found in the track container. Did you forget to pass & spread the `props` param in renderTrack?"),[])},t.getTargetIndex=function(a){return t.getThumbs().findIndex(function(c){return c===a.target||c.contains(a.target)})},t.addTouchEvents=function(a){document.addEventListener("touchmove",t.schdOnTouchMove,{passive:!1}),document.addEventListener("touchend",t.schdOnEnd,{passive:!1}),document.addEventListener("touchcancel",t.schdOnEnd,{passive:!1})},t.addMouseEvents=function(a){document.addEventListener("mousemove",t.schdOnMouseMove),document.addEventListener("mouseup",t.schdOnEnd)},t.onMouseDownTrack=function(a){var c;if(!(a.button!==0||(0,l.isIOS)()))if(a.persist(),a.preventDefault(),t.addMouseEvents(a.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(y){var k;return(k=y.current)===null||k===void 0?void 0:k.contains(a.target)}))return;t.setState({draggedTrackPos:[a.clientX,a.clientY]},function(){return t.onMove(a.clientX,a.clientY)})}else{var f=(0,l.getClosestThumbIndex)(t.thumbRefs.map(function(y){return y.current}),a.clientX,a.clientY,t.props.direction);(c=t.thumbRefs[f].current)===null||c===void 0||c.focus(),t.setState({draggedThumbIndex:f},function(){return t.onMove(a.clientX,a.clientY)})}},t.onResize=function(){(0,l.translateThumbs)(t.getThumbs(),t.getOffsets(),t.props.rtl),t.calculateMarkOffsets()},t.onTouchStartTrack=function(a){var c;if(a.persist(),t.addTouchEvents(a.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(y){var k;return(k=y.current)===null||k===void 0?void 0:k.contains(a.target)}))return;t.setState({draggedTrackPos:[a.touches[0].clientX,a.touches[0].clientY]},function(){return t.onMove(a.touches[0].clientX,a.touches[0].clientY)})}else{var f=(0,l.getClosestThumbIndex)(t.thumbRefs.map(function(y){return y.current}),a.touches[0].clientX,a.touches[0].clientY,t.props.direction);(c=t.thumbRefs[f].current)===null||c===void 0||c.focus(),t.setState({draggedThumbIndex:f},function(){return t.onMove(a.touches[0].clientX,a.touches[0].clientY)})}},t.onMouseOrTouchStart=function(a){if(!t.props.disabled){var c=(0,l.isTouchEvent)(a);if(!(!c&&a.button!==0)){var f=t.getTargetIndex(a);f!==-1&&(c?t.addTouchEvents(a):t.addMouseEvents(a),t.setState({draggedThumbIndex:f,thumbZIndexes:t.state.thumbZIndexes.map(function(y,k){return k===f?Math.max.apply(Math,t.state.thumbZIndexes):y<=t.state.thumbZIndexes[f]?y:y-1})}))}}},t.onMouseMove=function(a){a.preventDefault(),t.onMove(a.clientX,a.clientY)},t.onTouchMove=function(a){a.preventDefault(),t.onMove(a.touches[0].clientX,a.touches[0].clientY)},t.onKeyDown=function(a){var c=t.props,f=c.values,y=c.onChange,k=c.step,D=c.rtl,w=c.direction,R=t.state.isChanged,M=t.getTargetIndex(a.nativeEvent),P=D||w===g.Direction.Left||w===g.Direction.Down?-1:1;M!==-1&&(F.includes(a.key)?(a.preventDefault(),t.setState({draggedThumbIndex:M,isChanged:!0}),y((0,l.replaceAt)(f,M,t.normalizeValue(f[M]+P*(a.key==="PageUp"?k*10:k),M)))):V.includes(a.key)?(a.preventDefault(),t.setState({draggedThumbIndex:M,isChanged:!0}),y((0,l.replaceAt)(f,M,t.normalizeValue(f[M]-P*(a.key==="PageDown"?k*10:k),M)))):a.key==="Tab"?t.setState({draggedThumbIndex:-1},function(){R&&t.fireOnFinalChange()}):R&&t.fireOnFinalChange())},t.onKeyUp=function(a){var c=t.state.isChanged;t.setState({draggedThumbIndex:-1},function(){c&&t.fireOnFinalChange()})},t.onMove=function(a,c){var f=t.state,y=f.draggedThumbIndex,k=f.draggedTrackPos,D=t.props,w=D.direction,R=D.min,M=D.max,P=D.onChange,S=D.values,L=D.step,x=D.rtl;if(y===-1&&k[0]===-1&&k[1]===-1)return null;var i=t.trackRef.current;if(!i)return null;var s=i.getBoundingClientRect(),u=(0,l.isVertical)(w)?s.height:s.width;if(k[0]!==-1&&k[1]!==-1){var p=a-k[0],m=c-k[1],v=0;switch(w){case g.Direction.Right:case g.Direction.Left:v=p/u*(M-R);break;case g.Direction.Down:case g.Direction.Up:v=m/u*(M-R);break;default:(0,l.assertUnreachable)(w)}if(x&&(v*=-1),Math.abs(v)>=L/2){for(var b=0;b<t.thumbRefs.length;b++){if(S[b]===M&&Math.sign(v)===1||S[b]===R&&Math.sign(v)===-1)return;var $=S[b]+v;$>M?v=M-S[b]:$<R&&(v=R-S[b])}for(var C=S.slice(0),b=0;b<t.thumbRefs.length;b++)C=(0,l.replaceAt)(C,b,t.normalizeValue(S[b]+v,b));t.setState({draggedTrackPos:[a,c]}),P(C)}}else{var E=0;switch(w){case g.Direction.Right:E=(a-s.left)/u*(M-R)+R;break;case g.Direction.Left:E=(u-(a-s.left))/u*(M-R)+R;break;case g.Direction.Down:E=(c-s.top)/u*(M-R)+R;break;case g.Direction.Up:E=(u-(c-s.top))/u*(M-R)+R;break;default:(0,l.assertUnreachable)(w)}x&&(E=M+R-E),Math.abs(S[y]-E)>=L/2&&P((0,l.replaceAt)(S,y,t.normalizeValue(E,y)))}},t.normalizeValue=function(a,c){var f=t.props,y=f.min,k=f.max,D=f.step,w=f.allowOverlap,R=f.values;return(0,l.normalizeValue)(a,c,y,k,D,w,R)},t.onEnd=function(a){if(a.preventDefault(),document.removeEventListener("mousemove",t.schdOnMouseMove),document.removeEventListener("touchmove",t.schdOnTouchMove),document.removeEventListener("mouseup",t.schdOnEnd),document.removeEventListener("touchend",t.schdOnEnd),document.removeEventListener("touchcancel",t.schdOnEnd),t.state.draggedThumbIndex===-1&&t.state.draggedTrackPos[0]===-1&&t.state.draggedTrackPos[1]===-1)return null;t.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){t.fireOnFinalChange()})},t.fireOnFinalChange=function(){t.setState({isChanged:!1});var a=t.props,c=a.onFinalChange,f=a.values;c&&c(f)},t.updateMarkRefs=function(a){if(!a.renderMark){t.numOfMarks=void 0,t.markRefs=void 0;return}t.numOfMarks=(a.max-a.min)/t.props.step,t.markRefs=[];for(var c=0;c<t.numOfMarks+1;c++)t.markRefs[c]=O.createRef()},t.calculateMarkOffsets=function(){if(!(!t.props.renderMark||!t.trackRef||!t.numOfMarks||!t.markRefs||t.trackRef.current===null)){for(var a=window.getComputedStyle(t.trackRef.current),c=parseInt(a.width,10),f=parseInt(a.height,10),y=parseInt(a.paddingLeft,10),k=parseInt(a.paddingTop,10),D=[],w=0;w<t.numOfMarks+1;w++){var R=9999,M=9999;if(t.markRefs[w].current){var P=t.markRefs[w].current.getBoundingClientRect();R=P.height,M=P.width}t.props.direction===g.Direction.Left||t.props.direction===g.Direction.Right?D.push([Math.round(c/t.numOfMarks*w+y-M/2),-Math.round((R-f)/2)]):D.push([Math.round(f/t.numOfMarks*w+k-R/2),-Math.round((M-c)/2)])}t.setState({markOffsets:D})}},d.step===0)throw new Error('"step" property should be a positive number');return t.schdOnMouseMove=(0,l.schd)(t.onMouseMove),t.schdOnTouchMove=(0,l.schd)(t.onTouchMove),t.schdOnEnd=(0,l.schd)(t.onEnd),t.thumbRefs=d.values.map(function(){return O.createRef()}),t.updateMarkRefs(d),t}return T.prototype.componentDidMount=function(){var d=this,t=this.props,a=t.values,c=t.min,f=t.step;this.resizeObserver=window.ResizeObserver?new window.ResizeObserver(this.onResize):{observe:function(){return window.addEventListener("resize",d.onResize)},unobserve:function(){return window.removeEventListener("resize",d.onResize)}},document.addEventListener("touchstart",this.onMouseOrTouchStart,{passive:!1}),document.addEventListener("mousedown",this.onMouseOrTouchStart,{passive:!1}),!this.props.allowOverlap&&(0,l.checkInitialOverlap)(this.props.values),this.props.values.forEach(function(y){return(0,l.checkBoundaries)(y,d.props.min,d.props.max)}),this.resizeObserver.observe(this.trackRef.current),(0,l.translateThumbs)(this.getThumbs(),this.getOffsets(),this.props.rtl),this.calculateMarkOffsets(),a.forEach(function(y){(0,l.isStepDivisible)(c,y,f)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")})},T.prototype.componentDidUpdate=function(d,t){var a=this.props,c=a.max,f=a.min,y=a.step,k=a.values,D=a.rtl;(d.max!==c||d.min!==f||d.step!==y)&&this.updateMarkRefs(this.props),(0,l.translateThumbs)(this.getThumbs(),this.getOffsets(),D),(d.max!==c||d.min!==f||d.step!==y||t.markOffsets.length!==this.state.markOffsets.length)&&(this.calculateMarkOffsets(),k.forEach(function(w){(0,l.isStepDivisible)(f,w,y)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")}))},T.prototype.componentWillUnmount=function(){var d={passive:!1};document.removeEventListener("mousedown",this.onMouseOrTouchStart,d),document.removeEventListener("mousemove",this.schdOnMouseMove),document.removeEventListener("touchmove",this.schdOnTouchMove),document.removeEventListener("touchstart",this.onMouseOrTouchStart),document.removeEventListener("mouseup",this.schdOnEnd),document.removeEventListener("touchend",this.schdOnEnd),this.resizeObserver.unobserve(this.trackRef.current)},T.prototype.render=function(){var d=this,t=this.props,a=t.label,c=t.labelledBy,f=t.renderTrack,y=t.renderThumb,k=t.renderMark,D=k===void 0?function(){return null}:k,w=t.values,R=t.min,M=t.max,P=t.allowOverlap,S=t.disabled,L=this.state,x=L.draggedThumbIndex,i=L.thumbZIndexes,s=L.markOffsets;return f({props:{style:{transform:"scale(1)",cursor:x>-1?"grabbing":this.props.draggableTrack?(0,l.isVertical)(this.props.direction)?"ns-resize":"ew-resize":w.length===1&&!S?"pointer":"inherit"},onMouseDown:S?l.voidFn:this.onMouseDownTrack,onTouchStart:S?l.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:S,children:h(h([],s.map(function(u,p,m){return D({props:{style:d.props.direction===g.Direction.Left||d.props.direction===g.Direction.Right?{position:"absolute",left:"".concat(u[0],"px"),marginTop:"".concat(u[1],"px")}:{position:"absolute",top:"".concat(u[0],"px"),marginLeft:"".concat(u[1],"px")},key:"mark".concat(p),ref:d.markRefs[p]},index:p})}),!0),w.map(function(u,p){var m=d.state.draggedThumbIndex===p;return y({index:p,value:u,isDragged:m,props:{style:{position:"absolute",zIndex:i[p],cursor:S?"inherit":m?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:p,tabIndex:S?void 0:0,"aria-valuemax":P?M:w[p+1]||M,"aria-valuemin":P?R:w[p-1]||R,"aria-valuenow":u,draggable:!1,ref:d.thumbRefs[p],"aria-label":a,"aria-labelledby":c,role:"slider",onKeyDown:S?l.voidFn:d.onKeyDown,onKeyUp:S?l.voidFn:d.onKeyUp}})}),!0)})},T.defaultProps={label:"Accessibility label",labelledBy:null,step:1,direction:g.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},T})(O.Component);return H.default=j,H}var Ke;function Pt(){return Ke||(Ke=1,(function(e){var r=ce&&ce.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(e,"__esModule",{value:!0}),e.checkValuesAgainstBoundaries=e.relativeValue=e.useThumbOverlap=e.Direction=e.getTrackBackground=e.Range=void 0;var n=r(Ct());e.Range=n.default;var o=Je();Object.defineProperty(e,"getTrackBackground",{enumerable:!0,get:function(){return o.getTrackBackground}}),Object.defineProperty(e,"useThumbOverlap",{enumerable:!0,get:function(){return o.useThumbOverlap}}),Object.defineProperty(e,"relativeValue",{enumerable:!0,get:function(){return o.relativeValue}}),Object.defineProperty(e,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return o.checkValuesAgainstBoundaries}});var h=Ce();Object.defineProperty(e,"Direction",{enumerable:!0,get:function(){return h.Direction}})})(ce)),ce}var Qe=Pt();function Xe(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(h){return Object.getOwnPropertyDescriptor(e,h).enumerable})),n.push.apply(n,o)}return n}function Te(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Xe(Object(n),!0).forEach(function(o){Lt(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xe(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Lt(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var ke=Q("div",{position:"relative",width:"100%"});ke.displayName="Root";ke.displayName="Root";ke.displayName="StyledRoot";var Oe=Q("div",function(e){var r=e.$theme,n=e.$value,o=n===void 0?[]:n,h=e.$disabled,O=e.$isDragged,l=r.sizing,g="inherit";return h?g="not-allowed":O?g="grabbing":o.length===1&&(g="pointer"),{paddingTop:l.scale600,paddingBottom:l.scale600,paddingRight:l.scale600,paddingLeft:l.scale600,display:"flex",cursor:g,backgroundColor:r.colors.sliderTrackFill}});Oe.displayName="Track";Oe.displayName="Track";Oe.displayName="StyledTrack";var fe=Q("div",function(e){var r=e.$theme,n=e.$value,o=n===void 0?[]:n,h=e.$min,O=e.$max,l=e.$disabled,g=r.colors,F=r.borders,V=r.direction,j=r.borders.useRoundedCorners?F.radius100:0;return{borderTopLeftRadius:j,borderTopRightRadius:j,borderBottomRightRadius:j,borderBottomLeftRadius:j,background:Qe.getTrackBackground({values:o,colors:o.length===1?[l?g.borderOpaque:g.primary,l?g.backgroundSecondary:g.borderOpaque]:[l?g.backgroundSecondary:g.borderOpaque,l?g.borderOpaque:g.primary,l?g.backgroundSecondary:g.borderOpaque],min:h||0,max:O||0,rtl:V==="rtl"}),height:"2px",width:"100%",alignSelf:"center",cursor:l?"not-allowed":"inherit"}});fe.displayName="InnerTrack";fe.displayName="InnerTrack";fe.displayName="StyledInnerTrack";var we=Q("div",function(e){return{width:"4px",height:"2px",backgroundColor:e.$theme.colors.backgroundPrimary,marginLeft:"16px"}});we.displayName="Mark";we.displayName="Mark";we.displayName="StyledMark";var Re=Q("div",function(e){return Te(Te({},e.$theme.typography.font200),{},{color:e.$theme.colors.contentPrimary})});Re.displayName="Tick";Re.displayName="Tick";Re.displayName="StyledTick";var Se=Q("div",function(e){var r=e.$theme,n=r.sizing;return{display:"flex",justifyContent:"space-between",alignItems:"center",paddingRight:n.scale600,paddingLeft:n.scale600,paddingBottom:n.scale400}});Se.displayName="TickBar";Se.displayName="TickBar";Se.displayName="StyledTickBar";var Me=Q("div",function(e){var r=e.$theme,n=e.$value,o=n===void 0?[]:n,h=e.$thumbIndex,O=e.$disabled,l=o.length===2&&h===0,g=o.length===2&&h===1;return r.direction==="rtl"&&(g||l)&&(l=!l,g=!g),{height:"24px",width:"24px",borderTopLeftRadius:"24px",borderTopRightRadius:"24px",borderBottomLeftRadius:"24px",borderBottomRightRadius:"24px",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:O?r.colors.sliderHandleFillDisabled:r.colors.sliderHandleFill,outline:"none",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(r.colors.accent):"0 1px 4px rgba(0, 0, 0, 0.12)",cursor:O?"not-allowed":"inherit"}});Me.displayName="Thumb";Me.displayName="Thumb";Me.displayName="StyledThumb";var $e=Q("div",function(e){var r=e.$disabled,n=e.$theme;return{position:"absolute",top:"-16px",width:"4px",height:"20px",backgroundColor:r?n.colors.sliderHandleFillDisabled:n.colors.sliderHandleInnerFill}});$e.displayName="InnerThumb";$e.displayName="InnerThumb";$e.displayName="StyledInnerThumb";var _e=Q("div",function(e){var r=e.$disabled,n=e.$theme;return Te(Te({position:"absolute",top:"-".concat(n.sizing.scale1400)},n.typography.font200),{},{backgroundColor:r?n.colors.sliderHandleFillDisabled:n.colors.sliderHandleInnerFill,color:n.colors.contentInversePrimary,paddingLeft:n.sizing.scale600,paddingRight:n.sizing.scale600,paddingTop:n.sizing.scale500,paddingBottom:n.sizing.scale500,borderBottomLeftRadius:"48px",borderBottomRightRadius:"48px",borderTopLeftRadius:"48px",borderTopRightRadius:"48px",whiteSpace:"nowrap"})});_e.displayName="ThumbValue";_e.displayName="ThumbValue";_e.displayName="StyledThumbValue";function Ye(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(h){return Object.getOwnPropertyDescriptor(e,h).enumerable})),n.push.apply(n,o)}return n}function At(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Ye(Object(n),!0).forEach(function(o){Bt(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ye(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Bt(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function X(){return X=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},X.apply(this,arguments)}function K(e,r){return zt(e)||jt(e,r)||Vt(e,r)||Ft()}function Ft(){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 Vt(e,r){if(e){if(typeof e=="string")return Ze(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ze(e,r)}}function Ze(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,o=new Array(r);n<r;n++)o[n]=e[n];return o}function jt(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o=[],h=!0,O=!1,l,g;try{for(n=n.call(e);!(h=(l=n.next()).done)&&(o.push(l.value),!(r&&o.length===r));h=!0);}catch(F){O=!0,g=F}finally{try{!h&&n.return!=null&&n.return()}finally{if(O)throw g}}return o}}function zt(e){if(Array.isArray(e))return e}var Nt=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 Ut(e){var r=e.overrides,n=r===void 0?{}:r,o=e.disabled,h=o===void 0?!1:o,O=e.marks,l=O===void 0?!1:O,g=e.onChange,F=g===void 0?function(){}:g,V=e.onFinalChange,j=V===void 0?function(){}:V,I=e.min,T=I===void 0?0:I,d=e.max,t=d===void 0?100:d,a=e.step,c=a===void 0?1:a,f=e.persistentThumb,y=f===void 0?!1:f,k=e.valueToLabel,D=k===void 0?function(Y){return Y}:k,w=e.value,R=_.useContext(mt),M=_.useState(!1),P=K(M,2),S=P[0],L=P[1],x=_.useState(!1),i=K(x,2),s=i[0],u=i[1],p=_.useState(!1),m=K(p,2),v=m[0],b=m[1],$=_.useState(-1),C=K($,2),E=C[0],U=C[1],z=_.useCallback(function(Y){bt(Y)&&b(!0);var N=Y.target.parentNode.firstChild===Y.target?0:1;U(N)},[]),W=_.useCallback(function(Y){v!==!1&&b(!1),U(-1)},[]),A=Nt(w),B={$disabled:h,$step:c,$min:T,$max:t,$marks:l,$value:A,$isFocusVisible:v},G=J(n.Root,ke),ne=K(G,2),he=ne[0],ee=ne[1],ge=J(n.Track,Oe),pe=K(ge,2),ve=pe[0],Ie=pe[1],te=J(n.InnerTrack,fe),ue=K(te,2),me=ue[0],be=ue[1],et=J(n.Thumb,Me),Le=K(et,2),tt=Le[0],rt=Le[1],nt=J(n.InnerThumb,$e),Ae=K(nt,2),at=Ae[0],it=Ae[1],ot=J(n.ThumbValue,_e),Be=K(ot,2),st=Be[0],ut=Be[1],ct=J(n.Tick,Re),Fe=K(ct,2),Ve=Fe[0],je=Fe[1],lt=J(n.TickBar,Se),ze=K(lt,2),dt=ze[0],ft=ze[1],ht=J(n.Mark,we),Ne=K(ht,2),gt=Ne[0],pt=Ne[1];return _.createElement(he,X({"data-baseweb":"slider"},B,ee,{onFocus:Tt(ee,z),onBlur:yt(ee,W)}),_.createElement(Qe.Range,X({step:c,min:T,max:t,values:A,disabled:h,onChange:function(N){return F({value:N})},onFinalChange:function(N){return j({value:N})},rtl:R.direction==="rtl",renderTrack:function(N){var re=N.props,q=N.children,ae=N.isDragged;return _.createElement(ve,X({onMouseDown:re.onMouseDown,onTouchStart:re.onTouchStart,$isDragged:ae},B,Ie),_.createElement(me,X({$isDragged:ae,ref:re.ref},B,be),q))},renderThumb:function(N){var re=N.props,q=N.index,ae=N.isDragged,Ue=y||(!!q&&s||!q&&S||ae)&&!h;return _.createElement(tt,X({},re,{onMouseEnter:function(){q===0?L(!0):u(!0)},onMouseLeave:function(){q===0?L(!1):u(!1)},$thumbIndex:q,$isDragged:ae,style:At({},re.style)},B,rt,{$isFocusVisible:v&&E===q}),Ue&&_.createElement(st,X({$thumbIndex:q,$isDragged:ae},B,ut),D(A[q])),Ue&&_.createElement(at,X({$thumbIndex:q,$isDragged:ae},B,it)))}},l?{renderMark:function(N){var re=N.props,q=N.index;return _.createElement(gt,X({$markIndex:q},re,B,pt))}}:{})),_.createElement(dt,X({},B,ft),_.createElement(Ve,X({},B,je),D(T)),_.createElement(Ve,X({},B,je),D(t))))}const Ht=se("div",{target:"e16ozfla0"})({position:"relative",":focus-within:has(:focus-visible)":{"--slider-focused":1}}),Wt=se("div",{target:"e16ozfla1"})(({disabled:e,theme:r,isDragged:n})=>({alignItems:"center",backgroundColor:e?r.colors.gray60:r.colors.primary,borderTopLeftRadius:"100%",borderTopRightRadius:"100%",borderBottomLeftRadius:"100%",borderBottomRightRadius:"100%",borderTopStyle:"none",borderBottomStyle:"none",borderRightStyle:"none",borderLeftStyle:"none",display:"flex",justifyContent:"center",height:r.sizes.sliderThumb,width:r.sizes.sliderThumb,boxShadow:n?r.shadows.focusRing:r.shadows.none,":focus":{outline:"none"},":focus-visible":{boxShadow:r.shadows.focusRing}})),qt=se("div",{target:"e16ozfla2"})(({disabled:e,theme:r})=>({fontFamily:r.genericFonts.bodyFont,fontSize:r.fontSizes.sm,color:e?r.colors.gray60:r.colors.primary,top:"-1.6em",position:"absolute",whiteSpace:"nowrap",backgroundColor:r.colors.transparent,lineHeight:r.lineHeights.base,fontWeight:r.fontWeights.normal,pointerEvents:"none"})),Kt=se("div",{target:"e16ozfla3"})({flex:1}),Xt=se("div",{target:"e16ozfla4"})(({theme:e})=>({position:"absolute",height:e.spacing.twoXS,left:`calc(${e.sizes.sliderThumb} / 2)`,right:`calc(${e.sizes.sliderThumb} / 2)`})),Yt=se("div",{target:"e16ozfla5"})(({theme:e,isHovered:r,isDisabled:n})=>({position:"absolute",left:0,right:0,top:"100%",display:"flex",justifyContent:"space-between",pointerEvents:"none",marginTop:`-${e.spacing.md}`,fontSize:e.fontSizes.sm,lineHeight:e.lineHeights.base,fontWeight:e.fontWeights.normal,color:n?e.colors.fadedText40:e.colors.fadedText60,opacity:r?1:"var(--slider-focused, 0)",transition:r?"none":"opacity 300ms 200ms"}));function Zt({minLabel:e,maxLabel:r,isHovered:n,isDisabled:o}){return xe(Yt,{"data-testid":"stSliderTickBar",isHovered:n,isDisabled:o,children:[Z(De,{source:e,allowHTML:!1,inheritFont:!0,isLabel:!0}),Z(De,{source:r,allowHTML:!1,inheritFont:!0,isLabel:!0})]})}function Ee(e){return e.type===oe.Type.SELECT_SLIDER}function Pe(e,r,n){return e.map((o,h)=>{const O=r.indexOf(o);return O>=0?O:n[h]??0})}function Gt(e,r){return e.map(n=>r[n]??"")}function Jt({disabled:e,element:r,widgetMgr:n,fragmentId:o}){const[h,O]=It({getStateFromWidgetMgr:Qt,getDefaultStateFromProto:er,getCurrStateFromProto:tr,updateWidgetMgrState:rr,element:r,widgetMgr:n,fragmentId:o}),[l,g]=_.useState(h),[F,V]=_.useState(!1),[j,I]=_.useState(!1),T=_.useCallback(()=>V(!0),[]),d=_.useCallback(()=>V(!1),[]),t=_.useRef(null),[a]=_.useState([]),[c]=_.useState([]),f=kt(),y=_.useRef(r);y.current=r;const k=l.map(x=>ye(x,r)),D=ye(r.min,r),w=ye(r.max,r);_.useEffect(()=>{g(h)},[h]),Ot(()=>{if(!Ee(r))return;const x=n.getStringArrayValue(r);if(x===void 0)return;const i=Pe(x,r.options,r.default);g(i)},[r.options],(x,i)=>wt(x[0],i[0]));const R=_.useCallback(({value:x})=>{O({value:x,fromUi:!0}),I(!1)},[O]),M=_.useCallback(({value:x})=>{g(x),I(!0)},[]),P=_.useCallback(_.forwardRef(function(i,s){const{$thumbIndex:u,$value:p}=i,m=u||0;a[m]=s,c[m]||=_.createRef();const v=Rt(i,["role","style","aria-valuemax","aria-valuemin","aria-valuenow","tabIndex","onKeyUp","onKeyDown","onMouseEnter","onMouseLeave","draggable"]),b=y.current,C=(p??[b.min])[m]??b.min,E=ye(C,b);return Z(Wt,{...v,disabled:i.$disabled===!0,isDragged:i.$isDragged===!0,ref:a[m],"aria-valuetext":E,"aria-label":b.label,children:Z(qt,{"data-testid":"stSliderThumbValue",disabled:i.$disabled===!0,ref:c[m],children:Z(De,{source:E,allowHTML:!1,inheritFont:!0,isLabel:!0})})})}),[]);_.useLayoutEffect(()=>{a.forEach((m,v)=>{m.current&&m.current.setAttribute("aria-valuetext",k[v])});const x=t.current??null,i=a[0].current,s=a[1]?.current,u=c[0].current,p=c[1]?.current;or(x,i,s,u,p)});const S=_.useCallback(({$disabled:x})=>({height:f.spacing.twoXS,...x?{background:f.colors.darkenedBgMix25}:{}}),[f.colors.darkenedBgMix25,f.spacing.twoXS]),L=_.useCallback(_.forwardRef(function(i,s){const{children:u,...p}=i;return xe(Kt,{children:[Z(Xt,{ref:s,children:u}),Z(fe,{...p,style:S({$disabled:i.$disabled})})]})}),[]);return xe(Ht,{ref:t,className:"stSlider","data-testid":"stSlider",onMouseEnter:T,onMouseLeave:d,children:[Z($t,{label:r.label,disabled:e,labelVisibility:St(r.labelVisibility?.value),children:r.help&&Z(Mt,{content:r.help,label:r.label})}),Z(Ut,{min:r.min,max:r.max,step:r.step,value:ir(l,r),onChange:M,onFinalChange:R,disabled:e,overrides:{Thumb:P,Track:{style:{backgroundColor:"none !important",paddingLeft:f.spacing.none,paddingRight:f.spacing.none,paddingTop:`calc((${f.sizes.minElementHeight} - ${f.spacing.twoXS}) / 2)`,paddingBottom:`calc((${f.sizes.minElementHeight} - ${f.spacing.twoXS}) / 2)`}},InnerTrack:L,TickBar:{component:Zt,props:{minLabel:D,maxLabel:w,isHovered:F||j,isDisabled:e}}}})]})}function Qt(e,r){if(Ee(r)){const n=e.getStringArrayValue(r);return n===void 0?void 0:Pe(n,r.options,r.default)}return e.getDoubleArrayValue(r)}function er(e){return e.default}function tr(e){if(Ee(e)){const r=e.rawValue;return r&&r.length>0?Pe(r,e.options,e.default):e.default}return e.value}function rr(e,r,n,o){if(Ee(e)){const h=Gt(n.value,e.options);r.setStringArrayValue(e,h,{fromUi:n.fromUi},o)}else r.setDoubleArrayValue(e,n.value,{fromUi:n.fromUi},o)}function nr(e){const{dataType:r}=e;return r===oe.DataType.DATETIME||r===oe.DataType.DATE||r===oe.DataType.TIME}function ar(e){const{dataType:r}=e;return r===oe.DataType.DATE?"date":r===oe.DataType.TIME?"time":"datetime"}function ye(e,r){const{format:n,options:o}=r;if(o.length>0)return o[e]??"";if(nr(r)){const h=_t.utc(e/1e3);return Dt(h,n,ar(r))}return xt(e,n)}function ir(e,r){const{min:n,max:o}=r;let h=e[0],O=e.length>1?e[1]:e[0];return h>O&&(h=O),h<n&&(h=n),h>o&&(h=o),O<n&&(O=n),O>o&&(O=o),e.length>1?[h,O]:[h]}function or(e,r,n,o,h){!e||!r||!o||(ie(e,r,o),n&&h&&(ie(e,n,h),sr(e,r,n,o,h)))}function ie(e,r,n){const o=e.getBoundingClientRect(),h=r.getBoundingClientRect(),O=n.getBoundingClientRect(),l=h.left+h.width/2,g=l-O.width/2<o.left,F=l+O.width/2>o.right;n.style.left=g?"0":"",n.style.right=F?"0":""}function sr(e,r,n,o,h){const l=e.getBoundingClientRect(),g=r.getBoundingClientRect(),F=n.getBoundingClientRect(),V=o.getBoundingClientRect(),j=h.getBoundingClientRect(),I=l.left+l.width/2,T=g.left+g.width/2,d=F.left+F.width/2,t=T-V.width/2>=l.left,a=d+j.width/2<=l.right,c=g.left-V.width>=l.left,f=F.right+j.width<=l.right,y=t?V.width/2:V.width,k=a?j.width/2:j.width,D=T+y;if(d-k-D>24){ie(e,r,o),ie(e,n,h);return}if(c&&f){o.style.left="",o.style.right=`${Math.round(g.width)}px`,h.style.left=`${Math.round(F.width)}px`,h.style.right="";return}T<I?(ie(e,r,o),h.style.left=`${Math.round(T+y+24-d)}px`,h.style.right=""):(ie(e,n,h),o.style.left="",o.style.right=`${-Math.round(d-k-24-T)}px`)}const mr=Et(_.memo(Jt));export{mr as default};
@@ -1 +1 @@
1
- import{z as c,r as a,j as o,o as u,ak as g,Y as f,q as S}from"./index.BB_iwaVr.js";const x=c("div",{target:"e1l5y6pi0"})(({theme:e,cache:n})=>({...n?{paddingBottom:e.spacing.lg,background:`linear-gradient(to bottom, ${e.colors.bgColor} 0%, ${e.colors.bgColor} 80%, transparent 100%)`}:null})),T=c("div",{target:"e1l5y6pi1"})(({theme:e})=>({display:"flex",alignItems:"center",width:"100%",gap:e.spacing.sm})),$=c("div",{target:"e1l5y6pi2"})(({theme:e})=>({display:"flex",gap:e.spacing.sm,alignItems:"baseline"})),h=c("span",{target:"e1l5y6pi3"})(({theme:e})=>({opacity:.6,fontSize:e.fontSizes.sm,lineHeight:e.lineHeights.none,whiteSpace:"nowrap"})),y=e=>{const n=Math.floor(e/3600),t=Math.floor(e%3600/60),s=e%60;if(n===0&&t===0)return`(${s.toFixed(1)} seconds)`;if(n===0){const p=`${t} minute${t===1?"":"s"}`,d=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${p}${d})`}const l=`${n} hour${n===1?"":"s"}`,i=t===0?"":`, ${t} minute${t===1?"":"s"}`,r=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${l}${i}${r})`};function w({element:e}){const{cache:n,showTime:t}=e,[s,l]=a.useState(0),i=a.useRef(null);return a.useEffect(()=>{if(!t)return;i.current=Date.now();const r=()=>{if(i.current!==null){const m=(Date.now()-i.current)/1e3;l(m)}};r();const p=setInterval(r,100);return()=>clearInterval(p)},[t]),o(x,{className:g({stSpinner:!0,stCacheSpinner:n}),"data-testid":"stSpinner",cache:n,children:u(T,{children:[o(f,{size:"lg",iconValue:"spinner"}),u($,{children:[o(S,{source:e.text,allowHTML:!1}),t&&o(h,{children:y(s)})]})]})})}const v=a.memo(w);export{v as default};
1
+ import{z as c,r as a,j as o,o as u,ak as g,Y as f,q as S}from"./index.lMhsw-5K.js";const x=c("div",{target:"e1l5y6pi0"})(({theme:e,cache:n})=>({...n?{paddingBottom:e.spacing.lg,background:`linear-gradient(to bottom, ${e.colors.bgColor} 0%, ${e.colors.bgColor} 80%, transparent 100%)`}:null})),T=c("div",{target:"e1l5y6pi1"})(({theme:e})=>({display:"flex",alignItems:"center",width:"100%",gap:e.spacing.sm})),$=c("div",{target:"e1l5y6pi2"})(({theme:e})=>({display:"flex",gap:e.spacing.sm,alignItems:"baseline"})),h=c("span",{target:"e1l5y6pi3"})(({theme:e})=>({opacity:.6,fontSize:e.fontSizes.sm,lineHeight:e.lineHeights.none,whiteSpace:"nowrap"})),y=e=>{const n=Math.floor(e/3600),t=Math.floor(e%3600/60),s=e%60;if(n===0&&t===0)return`(${s.toFixed(1)} seconds)`;if(n===0){const p=`${t} minute${t===1?"":"s"}`,d=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${p}${d})`}const l=`${n} hour${n===1?"":"s"}`,i=t===0?"":`, ${t} minute${t===1?"":"s"}`,r=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${l}${i}${r})`};function w({element:e}){const{cache:n,showTime:t}=e,[s,l]=a.useState(0),i=a.useRef(null);return a.useEffect(()=>{if(!t)return;i.current=Date.now();const r=()=>{if(i.current!==null){const m=(Date.now()-i.current)/1e3;l(m)}};r();const p=setInterval(r,100);return()=>clearInterval(p)},[t]),o(x,{className:g({stSpinner:!0,stCacheSpinner:n}),"data-testid":"stSpinner",cache:n,children:u(T,{children:[o(f,{size:"lg",iconValue:"spinner"}),u($,{children:[o(S,{source:e.text,allowHTML:!1}),t&&o(h,{children:y(s)})]})]})})}const v=a.memo(w);export{v as default};
@@ -1 +1 @@
1
- import{r as h,l as A,az as ht,L as gt,e as tt,o as mt,j as T,p as wt,ab as bt,ac as pt,aw as yt,ae as Dt,ay as Ot,P as xt,ax as kt,q as St,m as Tt}from"./index.BB_iwaVr.js";import{h as P}from"./moment.C7qA8nIE.js";import{u as Mt}from"./useBasicWidgetState.8WwISl9r.js";import{e as Ct,u as Yt,D as Wt,a as Et}from"./useIntlLocale.D37LWdCR.js";import{E as Pt}from"./ErrorOutline.esm.CIFYUdwC.js";import"./FormClearHelper.CypmvhYZ.js";import"./timepicker.B-HgBYlK.js";import"./input.VYKyGuhi.js";import"./base-input.7Sj6pVk0.js";const et=6048e5,vt=864e5,X=Symbol.for("constructDateFrom");function O(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&X in e?e[X](t):e instanceof Date?new e.constructor(t):new Date(t)}function p(e,t){return O(t||e,e)}let Ft={};function I(){return Ft}function v(e,t){const r=I(),n=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=p(e,t?.in),o=a.getDay(),i=(o<n?7:0)+o-n;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function F(e,t){return v(e,{...t,weekStartsOn:1})}function rt(e,t){const r=p(e,t?.in),n=r.getFullYear(),a=O(r,0);a.setFullYear(n+1,0,4),a.setHours(0,0,0,0);const o=F(a),i=O(r,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const f=F(i);return r.getTime()>=o.getTime()?n+1:r.getTime()>=f.getTime()?n:n-1}function V(e){const t=p(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function It(e,...t){const r=O.bind(null,t.find(n=>typeof n=="object"));return t.map(r)}function j(e,t){const r=p(e,t?.in);return r.setHours(0,0,0,0),r}function Bt(e,t,r){const[n,a]=It(r?.in,e,t),o=j(n),i=j(a),f=+o-V(o),g=+i-V(i);return Math.round((f-g)/vt)}function Ht(e,t){const r=rt(e,t),n=O(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),F(n)}function qt(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Lt(e){return!(!qt(e)&&typeof e!="number"||isNaN(+p(e)))}function Nt(e,t){const r=p(e,t?.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}function Rt(e,t){const r=p(e,t?.in);return Bt(r,Nt(r))+1}function _t(e,t){const r=p(e,t?.in),n=+F(r)-+Ht(r);return Math.round(n/et)+1}function nt(e,t){const r=p(e,t?.in),n=r.getFullYear(),a=I(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,i=O(t?.in||e,0);i.setFullYear(n+1,0,o),i.setHours(0,0,0,0);const f=v(i,t),g=O(t?.in||e,0);g.setFullYear(n,0,o),g.setHours(0,0,0,0);const y=v(g,t);return+r>=+f?n+1:+r>=+y?n:n-1}function Gt(e,t){const r=I(),n=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=nt(e,t),o=O(t?.in||e,0);return o.setFullYear(a,0,n),o.setHours(0,0,0,0),v(o,t)}function Qt(e,t){const r=p(e,t?.in),n=+v(r,t)-+Gt(r,t);return Math.round(n/et)+1}function s(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const D={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return s(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):s(r+1,2)},d(e,t){return s(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return s(e.getHours()%12||12,t.length)},H(e,t){return s(e.getHours(),t.length)},m(e,t){return s(e.getMinutes(),t.length)},s(e,t){return s(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),a=Math.trunc(n*Math.pow(10,r-3));return s(a,t.length)}},M={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},z={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),a=n>0?n:1-n;return r.ordinalNumber(a,{unit:"year"})}return D.y(e,t)},Y:function(e,t,r,n){const a=nt(e,n),o=a>0?a:1-a;if(t==="YY"){const i=o%100;return s(i,2)}return t==="Yo"?r.ordinalNumber(o,{unit:"year"}):s(o,t.length)},R:function(e,t){const r=rt(e);return s(r,t.length)},u:function(e,t){const r=e.getFullYear();return s(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return s(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return s(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return D.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return s(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const a=Qt(e,n);return t==="wo"?r.ordinalNumber(a,{unit:"week"}):s(a,t.length)},I:function(e,t,r){const n=_t(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):s(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):D.d(e,t)},D:function(e,t,r){const n=Rt(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):s(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const a=e.getDay(),o=(a-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return s(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"});case"eeee":default:return r.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const a=e.getDay(),o=(a-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return s(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"});case"cccc":default:return r.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),a=n===0?7:n;switch(t){case"i":return String(a);case"ii":return s(a,t.length);case"io":return r.ordinalNumber(a,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let a;switch(n===12?a=M.noon:n===0?a=M.midnight:a=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let a;switch(n>=17?a=M.evening:n>=12?a=M.afternoon:n>=4?a=M.morning:a=M.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return D.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):D.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):s(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):s(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):D.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):D.s(e,t)},S:function(e,t){return D.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return Z(n);case"XXXX":case"XX":return k(n);case"XXXXX":case"XXX":default:return k(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return Z(n);case"xxxx":case"xx":return k(n);case"xxxxx":case"xxx":default:return k(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+U(n,":");case"OOOO":default:return"GMT"+k(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+U(n,":");case"zzzz":default:return"GMT"+k(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return s(n,t.length)},T:function(e,t,r){return s(+e,t.length)}};function U(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),a=Math.trunc(n/60),o=n%60;return o===0?r+String(a):r+String(a)+t+s(o,2)}function Z(e,t){return e%60===0?(e>0?"-":"+")+s(Math.abs(e)/60,2):k(e,t)}function k(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),a=s(Math.trunc(n/60),2),o=s(n%60,2);return r+a+t+o}const J=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},at=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},$t=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],a=r[2];if(!a)return J(e,t);let o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",J(n,t)).replace("{{time}}",at(a,t))},At={p:at,P:$t},Xt=/^D+$/,Vt=/^Y+$/,jt=["D","DD","YY","YYYY"];function zt(e){return Xt.test(e)}function Ut(e){return Vt.test(e)}function Zt(e,t,r){const n=Jt(e,t,r);if(console.warn(n),jt.includes(e))throw new RangeError(n)}function Jt(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Kt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,te=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ee=/^'([^]*?)'?$/,re=/''/g,ne=/[a-zA-Z]/;function K(e,t,r){const n=I(),a=r?.locale??n.locale??Ct,o=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,f=p(e,r?.in);if(!Lt(f))throw new RangeError("Invalid time value");let g=t.match(te).map(u=>{const d=u[0];if(d==="p"||d==="P"){const c=At[d];return c(u,a.formatLong)}return u}).join("").match(Kt).map(u=>{if(u==="''")return{isToken:!1,value:"'"};const d=u[0];if(d==="'")return{isToken:!1,value:ae(u)};if(z[d])return{isToken:!0,value:u};if(d.match(ne))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:u}});a.localize.preprocessor&&(g=a.localize.preprocessor(f,g));const y={firstWeekContainsDate:o,weekStartsOn:i,locale:a};return g.map(u=>{if(!u.isToken)return u.value;const d=u.value;(!r?.useAdditionalWeekYearTokens&&Ut(d)||!r?.useAdditionalDayOfYearTokens&&zt(d))&&Zt(d,t,String(e));const c=z[d[0]];return c(f,d,a.localize,y)}).join("")}function ae(e){const t=e.match(ee);return t?t[1].replace(re,"'"):e}const B="YYYY/MM/DD";function H(e){return e.map(t=>new Date(t))}function oe(e){return e?e.map(t=>P(t).format(B)):[]}function se({disabled:e,element:t,widgetMgr:r,fragmentId:n}){const a=A(),o=h.useContext(ht),[i,f]=Mt({getStateFromWidgetMgr:ie,getDefaultStateFromProto:ce,getCurrStateFromProto:ue,updateWidgetMgrState:de,element:t,widgetMgr:r,fragmentId:n}),[g,y]=h.useState(!1),[u,d]=h.useState(null),{colors:c,fontSizes:q,fontWeights:it,lineHeights:Q,spacing:m,sizes:w}=A(),{locale:ct}=h.useContext(gt),C=Yt(ct),x=h.useMemo(()=>P(t.min,B).toDate(),[t.min]),S=h.useMemo(()=>st(t),[t]),ut=h.useMemo(()=>{if(!t.isRange)return!1;const l=P().subtract(2,"years").toDate();return x<l},[t.isRange,x]),dt=t.default.length===0&&!e,L=h.useMemo(()=>t.format.replaceAll(/[a-zA-Z]/g,"9"),[t.format]),Y=h.useMemo(()=>t.format.replaceAll("Y","y").replaceAll("D","d"),[t.format]),N=h.useMemo(()=>K(x,Y,{locale:C}),[x,Y,C]),R=h.useMemo(()=>S?K(S,Y,{locale:C}):"",[S,Y,C]),$=h.useCallback(l=>{if(!l)return null;if(t.isRange){const b=l==="End"?`before ${R}`:`after ${N}`;return`**Error**: ${l} date set outside allowed range. Please select a date ${b}.`}return`**Error**: Date set outside allowed range. Please select a date between ${N} and ${R}.`},[t.isRange,R,N]),ft=h.useCallback(({date:l})=>{if(d(null),tt(l)){f({value:[],fromUi:!0}),y(!0);return}const b=Array.isArray(l)?l.filter(_=>!!_).map(_=>G(_)):G(l),{errorType:W,newDates:E}=ot(b,x,S);W&&d($(W)),f({value:E,fromUi:!0}),y(!E)},[f,$,d,x,S]),lt=h.useCallback(()=>{if(!g)return;const l=H(t.default);f({value:l,fromUi:!0}),y(!l)},[g,t,f]);return mt("div",{className:"stDateInput","data-testid":"stDateInput",children:[T(pt,{label:t.label,disabled:e,labelVisibility:wt(t.labelVisibility?.value),children:t.help&&T(bt,{content:t.help,label:t.label})}),T(Et,{locale:C,density:Wt.high,formatString:Y,mask:t.isRange?`${L} – ${L}`:L,placeholder:t.isRange?`${t.format} – ${t.format}`:t.format,disabled:e,onChange:ft,onClose:lt,quickSelect:ut,overrides:{Popover:{props:{ignoreBoundary:o,placement:yt.bottomLeft,overrides:{Body:{style:{marginTop:m.px}}}}},CalendarContainer:{style:{fontSize:q.sm,paddingRight:m.sm,paddingLeft:m.sm,paddingBottom:m.sm,paddingTop:m.sm}},Week:{style:{fontSize:q.sm}},Day:{style:({$pseudoHighlighted:l,$pseudoSelected:b,$selected:W,$isHovered:E})=>({fontSize:q.sm,lineHeight:Q.base,"::before":{backgroundColor:W||b||l||E?`${c.darkenedBgMix15} !important`:c.transparent},"::after":{borderColor:c.transparent},...Tt(a)&&E&&b&&!W?{color:c.secondaryBg}:{}})},PrevButton:{style:()=>({display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:c.transparent},":focus":{backgroundColor:c.transparent,outline:0}})},NextButton:{style:{display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:c.transparent},":focus":{backgroundColor:c.transparent,outline:0}}},Input:{props:{maskChar:null,endEnhancer:u&&T(Ot,{content:T(St,{source:u,allowHTML:!1}),placement:xt.TOP_RIGHT,error:!0,children:T(kt,{content:Pt,size:"lg"})}),overrides:{EndEnhancer:{style:{color:c.redTextColor,backgroundColor:c.transparent}},Root:{style:({$isFocused:l})=>{const b=Dt(c,l);return{borderLeftWidth:w.borderWidth,borderRightWidth:w.borderWidth,borderTopWidth:w.borderWidth,borderBottomWidth:w.borderWidth,paddingRight:m.twoXS,borderTopColor:b,borderRightColor:b,borderBottomColor:b,borderLeftColor:b,...u&&{backgroundColor:c.redBackgroundColor}}}},ClearIcon:{props:{overrides:{Svg:{style:{color:c.grayTextColor,padding:m.threeXS,height:w.clearIconSize,width:w.clearIconSize,":hover":{fill:c.bodyText}}}}}},InputContainer:{style:{backgroundColor:"transparent"}},Input:{style:{fontWeight:it.normal,paddingRight:m.sm,paddingLeft:m.md,paddingBottom:m.sm,paddingTop:m.sm,lineHeight:Q.inputWidget,"::placeholder":{color:c.fadedText60},...u&&{color:c.redTextColor}},props:{"data-testid":"stDateInputField"}}}}},QuickSelect:{props:{overrides:{ControlContainer:{style:{height:w.minElementHeight,borderLeftWidth:w.borderWidth,borderRightWidth:w.borderWidth,borderTopWidth:w.borderWidth,borderBottomWidth:w.borderWidth}}}}}},value:i,minDate:x,maxDate:S,range:t.isRange,clearable:dt})]})}function ie(e,t){const r=e.getStringArrayValue(t),n=r!==void 0?r:t.default||[];return H(n)}function ce(e){return H(e.default)??[]}function ue(e){return H(e.value)??[]}function de(e,t,r,n){const a=P(e.min,B).toDate(),o=st(e);let i=!0;const f=(r.value||[]).map(y=>G(y)),{errorType:g}=ot(f,a,o);g&&(i=!1),i&&t.setStringArrayValue(e,oe(r.value),{fromUi:r.fromUi},n)}function ot(e,t,r){const n=[];let a=null;return tt(e)?{errorType:null,newDates:[]}:(Array.isArray(e)?e.forEach(o=>{o&&(r&&o>r?a="End":o<t&&(a="Start"),n.push(o))}):e&&(r&&e>r?a="End":e<t&&(a="Start"),n.push(e)),{errorType:a,newDates:n})}function st(e){const t=e.max;return t&&t.length>0?P(t,B).toDate():void 0}function G(e){const t=new Date(e.getTime());return t.setHours(0,0,0,0),t}const De=h.memo(se);export{De as default};
1
+ import{r as h,l as A,az as ht,L as gt,e as tt,o as mt,j as T,p as wt,ab as bt,ac as pt,aw as yt,ae as Dt,ay as Ot,P as xt,ax as kt,q as St,m as Tt}from"./index.lMhsw-5K.js";import{h as P}from"./moment.C7qA8nIE.js";import{u as Mt}from"./useBasicWidgetState.BwQxG7iA.js";import{e as Ct,u as Yt,D as Wt,a as Et}from"./useIntlLocale.JXPZPWaJ.js";import{E as Pt}from"./ErrorOutline.esm.DiaGWPsE.js";import"./FormClearHelper.BM3uDLnU.js";import"./timepicker.CIpoSUyW.js";import"./input.CIKqvWjB.js";import"./base-input.C_CrNgNd.js";const et=6048e5,vt=864e5,X=Symbol.for("constructDateFrom");function O(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&X in e?e[X](t):e instanceof Date?new e.constructor(t):new Date(t)}function p(e,t){return O(t||e,e)}let Ft={};function I(){return Ft}function v(e,t){const r=I(),n=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=p(e,t?.in),o=a.getDay(),i=(o<n?7:0)+o-n;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function F(e,t){return v(e,{...t,weekStartsOn:1})}function rt(e,t){const r=p(e,t?.in),n=r.getFullYear(),a=O(r,0);a.setFullYear(n+1,0,4),a.setHours(0,0,0,0);const o=F(a),i=O(r,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const f=F(i);return r.getTime()>=o.getTime()?n+1:r.getTime()>=f.getTime()?n:n-1}function V(e){const t=p(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function It(e,...t){const r=O.bind(null,t.find(n=>typeof n=="object"));return t.map(r)}function j(e,t){const r=p(e,t?.in);return r.setHours(0,0,0,0),r}function Bt(e,t,r){const[n,a]=It(r?.in,e,t),o=j(n),i=j(a),f=+o-V(o),g=+i-V(i);return Math.round((f-g)/vt)}function Ht(e,t){const r=rt(e,t),n=O(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),F(n)}function qt(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Lt(e){return!(!qt(e)&&typeof e!="number"||isNaN(+p(e)))}function Nt(e,t){const r=p(e,t?.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}function Rt(e,t){const r=p(e,t?.in);return Bt(r,Nt(r))+1}function _t(e,t){const r=p(e,t?.in),n=+F(r)-+Ht(r);return Math.round(n/et)+1}function nt(e,t){const r=p(e,t?.in),n=r.getFullYear(),a=I(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,i=O(t?.in||e,0);i.setFullYear(n+1,0,o),i.setHours(0,0,0,0);const f=v(i,t),g=O(t?.in||e,0);g.setFullYear(n,0,o),g.setHours(0,0,0,0);const y=v(g,t);return+r>=+f?n+1:+r>=+y?n:n-1}function Gt(e,t){const r=I(),n=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=nt(e,t),o=O(t?.in||e,0);return o.setFullYear(a,0,n),o.setHours(0,0,0,0),v(o,t)}function Qt(e,t){const r=p(e,t?.in),n=+v(r,t)-+Gt(r,t);return Math.round(n/et)+1}function s(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const D={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return s(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):s(r+1,2)},d(e,t){return s(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return s(e.getHours()%12||12,t.length)},H(e,t){return s(e.getHours(),t.length)},m(e,t){return s(e.getMinutes(),t.length)},s(e,t){return s(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),a=Math.trunc(n*Math.pow(10,r-3));return s(a,t.length)}},M={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},z={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),a=n>0?n:1-n;return r.ordinalNumber(a,{unit:"year"})}return D.y(e,t)},Y:function(e,t,r,n){const a=nt(e,n),o=a>0?a:1-a;if(t==="YY"){const i=o%100;return s(i,2)}return t==="Yo"?r.ordinalNumber(o,{unit:"year"}):s(o,t.length)},R:function(e,t){const r=rt(e);return s(r,t.length)},u:function(e,t){const r=e.getFullYear();return s(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return s(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return s(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return D.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return s(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const a=Qt(e,n);return t==="wo"?r.ordinalNumber(a,{unit:"week"}):s(a,t.length)},I:function(e,t,r){const n=_t(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):s(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):D.d(e,t)},D:function(e,t,r){const n=Rt(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):s(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const a=e.getDay(),o=(a-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return s(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"});case"eeee":default:return r.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const a=e.getDay(),o=(a-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return s(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"});case"cccc":default:return r.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),a=n===0?7:n;switch(t){case"i":return String(a);case"ii":return s(a,t.length);case"io":return r.ordinalNumber(a,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let a;switch(n===12?a=M.noon:n===0?a=M.midnight:a=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let a;switch(n>=17?a=M.evening:n>=12?a=M.afternoon:n>=4?a=M.morning:a=M.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return D.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):D.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):s(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):s(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):D.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):D.s(e,t)},S:function(e,t){return D.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return Z(n);case"XXXX":case"XX":return k(n);case"XXXXX":case"XXX":default:return k(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return Z(n);case"xxxx":case"xx":return k(n);case"xxxxx":case"xxx":default:return k(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+U(n,":");case"OOOO":default:return"GMT"+k(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+U(n,":");case"zzzz":default:return"GMT"+k(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return s(n,t.length)},T:function(e,t,r){return s(+e,t.length)}};function U(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),a=Math.trunc(n/60),o=n%60;return o===0?r+String(a):r+String(a)+t+s(o,2)}function Z(e,t){return e%60===0?(e>0?"-":"+")+s(Math.abs(e)/60,2):k(e,t)}function k(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),a=s(Math.trunc(n/60),2),o=s(n%60,2);return r+a+t+o}const J=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},at=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},$t=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],a=r[2];if(!a)return J(e,t);let o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",J(n,t)).replace("{{time}}",at(a,t))},At={p:at,P:$t},Xt=/^D+$/,Vt=/^Y+$/,jt=["D","DD","YY","YYYY"];function zt(e){return Xt.test(e)}function Ut(e){return Vt.test(e)}function Zt(e,t,r){const n=Jt(e,t,r);if(console.warn(n),jt.includes(e))throw new RangeError(n)}function Jt(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Kt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,te=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ee=/^'([^]*?)'?$/,re=/''/g,ne=/[a-zA-Z]/;function K(e,t,r){const n=I(),a=r?.locale??n.locale??Ct,o=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,f=p(e,r?.in);if(!Lt(f))throw new RangeError("Invalid time value");let g=t.match(te).map(u=>{const d=u[0];if(d==="p"||d==="P"){const c=At[d];return c(u,a.formatLong)}return u}).join("").match(Kt).map(u=>{if(u==="''")return{isToken:!1,value:"'"};const d=u[0];if(d==="'")return{isToken:!1,value:ae(u)};if(z[d])return{isToken:!0,value:u};if(d.match(ne))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:u}});a.localize.preprocessor&&(g=a.localize.preprocessor(f,g));const y={firstWeekContainsDate:o,weekStartsOn:i,locale:a};return g.map(u=>{if(!u.isToken)return u.value;const d=u.value;(!r?.useAdditionalWeekYearTokens&&Ut(d)||!r?.useAdditionalDayOfYearTokens&&zt(d))&&Zt(d,t,String(e));const c=z[d[0]];return c(f,d,a.localize,y)}).join("")}function ae(e){const t=e.match(ee);return t?t[1].replace(re,"'"):e}const B="YYYY/MM/DD";function H(e){return e.map(t=>new Date(t))}function oe(e){return e?e.map(t=>P(t).format(B)):[]}function se({disabled:e,element:t,widgetMgr:r,fragmentId:n}){const a=A(),o=h.useContext(ht),[i,f]=Mt({getStateFromWidgetMgr:ie,getDefaultStateFromProto:ce,getCurrStateFromProto:ue,updateWidgetMgrState:de,element:t,widgetMgr:r,fragmentId:n}),[g,y]=h.useState(!1),[u,d]=h.useState(null),{colors:c,fontSizes:q,fontWeights:it,lineHeights:Q,spacing:m,sizes:w}=A(),{locale:ct}=h.useContext(gt),C=Yt(ct),x=h.useMemo(()=>P(t.min,B).toDate(),[t.min]),S=h.useMemo(()=>st(t),[t]),ut=h.useMemo(()=>{if(!t.isRange)return!1;const l=P().subtract(2,"years").toDate();return x<l},[t.isRange,x]),dt=t.default.length===0&&!e,L=h.useMemo(()=>t.format.replaceAll(/[a-zA-Z]/g,"9"),[t.format]),Y=h.useMemo(()=>t.format.replaceAll("Y","y").replaceAll("D","d"),[t.format]),N=h.useMemo(()=>K(x,Y,{locale:C}),[x,Y,C]),R=h.useMemo(()=>S?K(S,Y,{locale:C}):"",[S,Y,C]),$=h.useCallback(l=>{if(!l)return null;if(t.isRange){const b=l==="End"?`before ${R}`:`after ${N}`;return`**Error**: ${l} date set outside allowed range. Please select a date ${b}.`}return`**Error**: Date set outside allowed range. Please select a date between ${N} and ${R}.`},[t.isRange,R,N]),ft=h.useCallback(({date:l})=>{if(d(null),tt(l)){f({value:[],fromUi:!0}),y(!0);return}const b=Array.isArray(l)?l.filter(_=>!!_).map(_=>G(_)):G(l),{errorType:W,newDates:E}=ot(b,x,S);W&&d($(W)),f({value:E,fromUi:!0}),y(!E)},[f,$,d,x,S]),lt=h.useCallback(()=>{if(!g)return;const l=H(t.default);f({value:l,fromUi:!0}),y(!l)},[g,t,f]);return mt("div",{className:"stDateInput","data-testid":"stDateInput",children:[T(pt,{label:t.label,disabled:e,labelVisibility:wt(t.labelVisibility?.value),children:t.help&&T(bt,{content:t.help,label:t.label})}),T(Et,{locale:C,density:Wt.high,formatString:Y,mask:t.isRange?`${L} – ${L}`:L,placeholder:t.isRange?`${t.format} – ${t.format}`:t.format,disabled:e,onChange:ft,onClose:lt,quickSelect:ut,overrides:{Popover:{props:{ignoreBoundary:o,placement:yt.bottomLeft,overrides:{Body:{style:{marginTop:m.px}}}}},CalendarContainer:{style:{fontSize:q.sm,paddingRight:m.sm,paddingLeft:m.sm,paddingBottom:m.sm,paddingTop:m.sm}},Week:{style:{fontSize:q.sm}},Day:{style:({$pseudoHighlighted:l,$pseudoSelected:b,$selected:W,$isHovered:E})=>({fontSize:q.sm,lineHeight:Q.base,"::before":{backgroundColor:W||b||l||E?`${c.darkenedBgMix15} !important`:c.transparent},"::after":{borderColor:c.transparent},...Tt(a)&&E&&b&&!W?{color:c.secondaryBg}:{}})},PrevButton:{style:()=>({display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:c.transparent},":focus":{backgroundColor:c.transparent,outline:0}})},NextButton:{style:{display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:c.transparent},":focus":{backgroundColor:c.transparent,outline:0}}},Input:{props:{maskChar:null,endEnhancer:u&&T(Ot,{content:T(St,{source:u,allowHTML:!1}),placement:xt.TOP_RIGHT,error:!0,children:T(kt,{content:Pt,size:"lg"})}),overrides:{EndEnhancer:{style:{color:c.redTextColor,backgroundColor:c.transparent}},Root:{style:({$isFocused:l})=>{const b=Dt(c,l);return{borderLeftWidth:w.borderWidth,borderRightWidth:w.borderWidth,borderTopWidth:w.borderWidth,borderBottomWidth:w.borderWidth,paddingRight:m.twoXS,borderTopColor:b,borderRightColor:b,borderBottomColor:b,borderLeftColor:b,...u&&{backgroundColor:c.redBackgroundColor}}}},ClearIcon:{props:{overrides:{Svg:{style:{color:c.grayTextColor,padding:m.threeXS,height:w.clearIconSize,width:w.clearIconSize,":hover":{fill:c.bodyText}}}}}},InputContainer:{style:{backgroundColor:"transparent"}},Input:{style:{fontWeight:it.normal,paddingRight:m.sm,paddingLeft:m.md,paddingBottom:m.sm,paddingTop:m.sm,lineHeight:Q.inputWidget,"::placeholder":{color:c.fadedText60},...u&&{color:c.redTextColor}},props:{"data-testid":"stDateInputField"}}}}},QuickSelect:{props:{overrides:{ControlContainer:{style:{height:w.minElementHeight,borderLeftWidth:w.borderWidth,borderRightWidth:w.borderWidth,borderTopWidth:w.borderWidth,borderBottomWidth:w.borderWidth}}}}}},value:i,minDate:x,maxDate:S,range:t.isRange,clearable:dt})]})}function ie(e,t){const r=e.getStringArrayValue(t),n=r!==void 0?r:t.default||[];return H(n)}function ce(e){return H(e.default)??[]}function ue(e){return H(e.value)??[]}function de(e,t,r,n){const a=P(e.min,B).toDate(),o=st(e);let i=!0;const f=(r.value||[]).map(y=>G(y)),{errorType:g}=ot(f,a,o);g&&(i=!1),i&&t.setStringArrayValue(e,oe(r.value),{fromUi:r.fromUi},n)}function ot(e,t,r){const n=[];let a=null;return tt(e)?{errorType:null,newDates:[]}:(Array.isArray(e)?e.forEach(o=>{o&&(r&&o>r?a="End":o<t&&(a="Start"),n.push(o))}):e&&(r&&e>r?a="End":e<t&&(a="Start"),n.push(e)),{errorType:a,newDates:n})}function st(e){const t=e.max;return t&&t.length>0?P(t,B).toDate():void 0}function G(e){const t=new Date(e.getTime());return t.setHours(0,0,0,0),t}const De=h.memo(se);export{De as default};
@@ -1 +1 @@
1
- import{z as u,r as L,W as C,o as x,j as i,R as E,q as b,V as v}from"./index.BB_iwaVr.js";import{w as y,E as W}from"./withFullScreenWrapper.CqfGs8T2.js";import{S as p,T}from"./Toolbar.DC2Tp-qb.js";const F=u("div",{target:"e1xt4yf90"})(({theme:e,shouldStretch:t})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:e.spacing.lg,maxWidth:"100%",width:t?"100%":"fit-content"})),R=u("div",{target:"e1xt4yf91"})(({theme:e,shouldStretch:t})=>({display:"flex",flexDirection:"column",alignItems:"stretch",width:t?"100%":"auto",flexGrow:t?1:0,">img":{borderRadius:e.radii.default}})),j=u("div",{target:"e1xt4yf92"})(({theme:e})=>({textAlign:"center",marginTop:e.spacing.xs,wordWrap:"break-word",padding:e.spacing.threeXS})),H=v.getLogger("ImageList");function M(e,t,r){if(e){if(e.useStretch)return r;if(e.useContent)return;if(e.pixelWidth)return e.pixelWidth}if(t!=null)switch(t){case-1:case-3:case-4:return;case-2:case-5:return r;default:return t>0?t:void 0}}const G=({itemKey:e,image:t,imgStyle:r,buildMediaURL:l,handleImageError:s,shouldStretch:d})=>{const o=E(t.url);return x(R,{"data-testid":"stImageContainer",shouldStretch:d,children:[i("img",{style:r,src:l(t.url),alt:e,onError:s,crossOrigin:o}),t.caption&&i(j,{"data-testid":"stImageCaption",style:r,children:i(b,{source:t.caption,allowHTML:!1,isCaption:!0,isLabel:!0})})]})};function O({element:e,endpoints:t,widthConfig:r,disableFullscreenMode:l}){const{expanded:s,width:d,height:o,expand:f,collapse:h}=C(W),g=d||0,I=M(r,e.width,g),m=r?.useStretch||e.width===-5,a={};o&&s?(a.maxHeight=o,a.objectFit="contain",a.width="100%"):(a.width=I??"100%",a.maxWidth="100%");const w=c=>{const n=c.currentTarget.src;H.error(`Client Error: Image source error - ${n}`),t.sendClientErrorToHost("Image","Image source failed to load","onerror triggered",n)};return x(p,{width:g,height:o,useContainerWidth:s,topCentered:!0,children:[i(T,{target:p,isFullScreen:s,onExpand:f,onCollapse:h,disableFullscreenMode:l}),i(F,{className:"stImage","data-testid":"stImage",shouldStretch:m,children:e.imgs.map((c,n)=>i(G,{itemKey:n.toString(),image:c,imgStyle:a,buildMediaURL:S=>t.buildMediaURL(S),handleImageError:w,shouldStretch:m},n))})]})}const U=y(O),D=L.memo(U);export{D as default};
1
+ import{z as u,r as L,W as C,o as x,j as i,R as E,q as b,V as v}from"./index.lMhsw-5K.js";import{w as y,E as W}from"./withFullScreenWrapper.EdE3zOz5.js";import{S as p,T}from"./Toolbar.CPyjMABY.js";const F=u("div",{target:"e1xt4yf90"})(({theme:e,shouldStretch:t})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:e.spacing.lg,maxWidth:"100%",width:t?"100%":"fit-content"})),R=u("div",{target:"e1xt4yf91"})(({theme:e,shouldStretch:t})=>({display:"flex",flexDirection:"column",alignItems:"stretch",width:t?"100%":"auto",flexGrow:t?1:0,">img":{borderRadius:e.radii.default}})),j=u("div",{target:"e1xt4yf92"})(({theme:e})=>({textAlign:"center",marginTop:e.spacing.xs,wordWrap:"break-word",padding:e.spacing.threeXS})),H=v.getLogger("ImageList");function M(e,t,r){if(e){if(e.useStretch)return r;if(e.useContent)return;if(e.pixelWidth)return e.pixelWidth}if(t!=null)switch(t){case-1:case-3:case-4:return;case-2:case-5:return r;default:return t>0?t:void 0}}const G=({itemKey:e,image:t,imgStyle:r,buildMediaURL:l,handleImageError:s,shouldStretch:d})=>{const o=E(t.url);return x(R,{"data-testid":"stImageContainer",shouldStretch:d,children:[i("img",{style:r,src:l(t.url),alt:e,onError:s,crossOrigin:o}),t.caption&&i(j,{"data-testid":"stImageCaption",style:r,children:i(b,{source:t.caption,allowHTML:!1,isCaption:!0,isLabel:!0})})]})};function O({element:e,endpoints:t,widthConfig:r,disableFullscreenMode:l}){const{expanded:s,width:d,height:o,expand:f,collapse:h}=C(W),g=d||0,I=M(r,e.width,g),m=r?.useStretch||e.width===-5,a={};o&&s?(a.maxHeight=o,a.objectFit="contain",a.width="100%"):(a.width=I??"100%",a.maxWidth="100%");const w=c=>{const n=c.currentTarget.src;H.error(`Client Error: Image source error - ${n}`),t.sendClientErrorToHost("Image","Image source failed to load","onerror triggered",n)};return x(p,{width:g,height:o,useContainerWidth:s,topCentered:!0,children:[i(T,{target:p,isFullScreen:s,onExpand:f,onCollapse:h,disableFullscreenMode:l}),i(F,{className:"stImage","data-testid":"stImage",shouldStretch:m,children:e.imgs.map((c,n)=>i(G,{itemKey:n.toString(),image:c,imgStyle:a,buildMediaURL:S=>t.buildMediaURL(S),handleImageError:w,shouldStretch:m},n))})]})}const U=y(O),D=L.memo(U);export{D as default};