streamlit-nightly 1.52.3.dev20260110__py3-none-any.whl → 1.52.3.dev20260111__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 (97) hide show
  1. streamlit/static/index.html +1 -1
  2. streamlit/static/manifest.json +296 -296
  3. streamlit/static/static/js/{ErrorOutline.esm.BcqUpfNe.js → ErrorOutline.esm.D0HiUB0L.js} +1 -1
  4. streamlit/static/static/js/{FileDownload.esm.CtJWBuub.js → FileDownload.esm.BuUS-pfi.js} +1 -1
  5. streamlit/static/static/js/{FileHelper.D0dQPhOs.js → FileHelper.Pf8URFng.js} +5 -5
  6. streamlit/static/static/js/{FormClearHelper.Cm3GDSk6.js → FormClearHelper.By4vKj6A.js} +1 -1
  7. streamlit/static/static/js/{InputInstructions.D7Hxdzwv.js → InputInstructions.BiaGyIXk.js} +1 -1
  8. streamlit/static/static/js/{Particles.vAUDtAR8.js → Particles.2-EdjYhR.js} +1 -1
  9. streamlit/static/static/js/{ProgressBar.Dp2CGRba.js → ProgressBar.Dgbh0B0d.js} +1 -1
  10. streamlit/static/static/js/{StreamlitSyntaxHighlighter.DC0000nJ.js → StreamlitSyntaxHighlighter.DSl8Wr3R.js} +1 -1
  11. streamlit/static/static/js/{TableChart.esm.DDVoSKOT.js → TableChart.esm.MOwyTUPh.js} +1 -1
  12. streamlit/static/static/js/{Toolbar.CuMH-Gqe.js → Toolbar.CowuXIFr.js} +1 -1
  13. streamlit/static/static/js/{WidgetLabelHelpIconInline.WAReecol.js → WidgetLabelHelpIconInline.BdGIJQe4.js} +1 -1
  14. streamlit/static/static/js/{base-input.BX9Jll5o.js → base-input.CHPo5oJ1.js} +1 -1
  15. streamlit/static/static/js/{checkbox.BzMHUSz1.js → checkbox.Dkt2TQVS.js} +1 -1
  16. streamlit/static/static/js/{createDownloadLinkElement.CviG5BQx.js → createDownloadLinkElement.BaE-_v8I.js} +1 -1
  17. streamlit/static/static/js/{data-grid-overlay-editor.Dzo9A4l6.js → data-grid-overlay-editor.C1ncL-Nr.js} +1 -1
  18. streamlit/static/static/js/{downloader.DIDvj0d5.js → downloader.yaq2AzD9.js} +1 -1
  19. streamlit/static/static/js/{embed.C8qeQ38b.js → embed.DJJvCVz2.js} +1 -1
  20. streamlit/static/static/js/{es6.Dpcc-U7U.js → es6.D2jK98VU.js} +2 -2
  21. streamlit/static/static/js/{formatNumber.CPvuaBa8.js → formatNumber.Cxr2q_Sk.js} +1 -1
  22. streamlit/static/static/js/{iconPosition.y0q-Rqem.js → iconPosition.5dHEZYw2.js} +1 -1
  23. streamlit/static/static/js/{iframeResizer.contentWindow.DblExdXF.js → iframeResizer.contentWindow.Cedt4qbc.js} +1 -1
  24. streamlit/static/static/js/{index.BZBWLU1C.js → index.01VsD2h1.js} +4 -4
  25. streamlit/static/static/js/{index.BDb0PRvK.js → index.1djeb6e0.js} +1 -1
  26. streamlit/static/static/js/{index.BXYgO5B8.js → index.6_D2Y2jA.js} +1 -1
  27. streamlit/static/static/js/{index.gr6yGiCL.js → index.B0GsKOuI.js} +1 -1
  28. streamlit/static/static/js/{index.BVN9cI-k.js → index.B2TDaHdI.js} +1 -1
  29. streamlit/static/static/js/{index.DaU1ayM7.js → index.B4x2O71H.js} +1 -1
  30. streamlit/static/static/js/{index.DppScppA.js → index.B6EliwN_.js} +1 -1
  31. streamlit/static/static/js/{index.DB4MbQ40.js → index.B6Uhb_NP.js} +1 -1
  32. streamlit/static/static/js/{index.BfZdZpv-.js → index.B7EzT2pL.js} +1 -1
  33. streamlit/static/static/js/{index.DTK-btqV.js → index.B9DrCSR6.js} +1 -1
  34. streamlit/static/static/js/{index.kKkHk9Mc.js → index.BCCeRfnu.js} +1 -1
  35. streamlit/static/static/js/{index.pMvzHC7z.js → index.BFopzcDu.js} +1 -1
  36. streamlit/static/static/js/{index.D42y-GeO.js → index.BHMoYAbd.js} +1 -1
  37. streamlit/static/static/js/{index.B6vCS66f.js → index.BMPclSge.js} +5 -5
  38. streamlit/static/static/js/{index.CCDejIvL.js → index.BVit6ClT.js} +1 -1
  39. streamlit/static/static/js/{index.BItU4jMo.js → index.BXCQzqUL.js} +1 -1
  40. streamlit/static/static/js/{index.u2AvcQQT.js → index.Ba6hzYdl.js} +1 -1
  41. streamlit/static/static/js/{index.DmQqT9OM.js → index.Bb9kjc_v.js} +1 -1
  42. streamlit/static/static/js/{index.VSsf6tsu.js → index.BgVtKHgk.js} +1 -1
  43. streamlit/static/static/js/{index.DZEQ0G7H.js → index.BkDplL5I.js} +1 -1
  44. streamlit/static/static/js/{index.BWOP7HFT.js → index.C8PH2B2k.js} +1 -1
  45. streamlit/static/static/js/{index.RRAKXgBZ.js → index.CAobVzMK.js} +1 -1
  46. streamlit/static/static/js/{index.BPMqWDef.js → index.CD8IIWcc.js} +1 -1
  47. streamlit/static/static/js/{index.C1ElSZEy.js → index.CIlqaESj.js} +1 -1
  48. streamlit/static/static/js/{index.BTHi5W25.js → index.CT9jvPcD.js} +1 -1
  49. streamlit/static/static/js/{index.D69ULFWq.js → index.CcHnYd9w.js} +1 -1
  50. streamlit/static/static/js/{index.C7lwRBvF.js → index.CcJEaOpw.js} +1 -1
  51. streamlit/static/static/js/{index.B-g6lwYa.js → index.CjQo7CUO.js} +1 -1
  52. streamlit/static/static/js/{index.DRFJgBf-.js → index.D2EVLt1U.js} +1 -1
  53. streamlit/static/static/js/{index.F-NmmwfK.js → index.D2v1x0i_.js} +1 -1
  54. streamlit/static/static/js/{index.DvQ7-afx.js → index.D6ea3OJl.js} +1 -1
  55. streamlit/static/static/js/{index.eweE9HKU.js → index.DKUtJ1wC.js} +1 -1
  56. streamlit/static/static/js/{index.w2_VrtVw.js → index.DLB_Wwth.js} +1 -1
  57. streamlit/static/static/js/{index.aEeM0ekc.js → index.DaITTdfQ.js} +1 -1
  58. streamlit/static/static/js/{index.Dr8b3Vn6.js → index.DbTMA1_Q.js} +1 -1
  59. streamlit/static/static/js/{index.Dla9XiNe.js → index.DcKOiCiE.js} +1 -1
  60. streamlit/static/static/js/{index.C26ZOVFL.js → index.DeGjj5Xy.js} +1 -1
  61. streamlit/static/static/js/{index.B10MmI2m.js → index.Dewn3Ni9.js} +1 -1
  62. streamlit/static/static/js/{index.wv1DYVsn.js → index.DozBVd6-.js} +1 -1
  63. streamlit/static/static/js/{index.x4j6nnNb.js → index.DredtYc0.js} +1 -1
  64. streamlit/static/static/js/{index.CcMmNHAq.js → index.Dt0Psatx.js} +1 -1
  65. streamlit/static/static/js/{index.B9TG5Ah8.js → index.DtGneC7j.js} +1 -1
  66. streamlit/static/static/js/{index.pgifwCIr.js → index.P-CMMGUY.js} +1 -1
  67. streamlit/static/static/js/{index.BGufEmCz.js → index.TO9vodwr.js} +1 -1
  68. streamlit/static/static/js/{index.Bxe7fKbw.js → index._nL4Yjdr.js} +1 -1
  69. streamlit/static/static/js/index.i_eQw7NS.js +1 -0
  70. streamlit/static/static/js/{index.C93QGPyk.js → index.qzz9PjCO.js} +1 -1
  71. streamlit/static/static/js/{index.MKI8t7l2.js → index.wLJVkoPD.js} +1 -1
  72. streamlit/static/static/js/{input.BoJqOS7a.js → input.27t-DftI.js} +1 -1
  73. streamlit/static/static/js/{main.B5XmUwmQ.js → main.BEfv2Y8-.js} +1 -1
  74. streamlit/static/static/js/{memory.9izgq54V.js → memory.CaZBVQ_1.js} +1 -1
  75. streamlit/static/static/js/{number-overlay-editor.PqOGQcLn.js → number-overlay-editor.CAIp-3oo.js} +1 -1
  76. streamlit/static/static/js/{pandasStylerUtils.DUtF2t3R.js → pandasStylerUtils.BY9qaz81.js} +1 -1
  77. streamlit/static/static/js/{sandbox.DgKTHPLO.js → sandbox.BJUaaWFJ.js} +1 -1
  78. streamlit/static/static/js/{styled-components.D4x8jmOI.js → styled-components.DQsMkvXn.js} +1 -1
  79. streamlit/static/static/js/{throttle.DxEHIIp7.js → throttle.DSR3q89S.js} +1 -1
  80. streamlit/static/static/js/{timepicker.CDks5DWI.js → timepicker.gie5YwtP.js} +1 -1
  81. streamlit/static/static/js/{toConsumableArray.CvTQRsV-.js → toConsumableArray.C9lVwnAo.js} +1 -1
  82. streamlit/static/static/js/uniqueId.BdEQNrWF.js +1 -0
  83. streamlit/static/static/js/{useBasicWidgetState.D6_b0IqA.js → useBasicWidgetState.DrTKs46R.js} +1 -1
  84. streamlit/static/static/js/{useIntlLocale.Ctz17A7g.js → useIntlLocale.CmSionuT.js} +1 -1
  85. streamlit/static/static/js/{useTextInputAutoExpand.PAFB5o1T.js → useTextInputAutoExpand.D7lViJSu.js} +1 -1
  86. streamlit/static/static/js/{useUpdateUiValue.CcTvmGlb.js → useUpdateUiValue.Ct3CJQBQ.js} +1 -1
  87. streamlit/static/static/js/{useWaveformController.vLi36Ir4.js → useWaveformController.D-KQLpLI.js} +1 -1
  88. streamlit/static/static/js/{withCalculatedWidth.BtA2jL5-.js → withCalculatedWidth.CD0pPoZr.js} +1 -1
  89. streamlit/static/static/js/{withFullScreenWrapper.CeeoYBpc.js → withFullScreenWrapper.Ch22PgdD.js} +1 -1
  90. {streamlit_nightly-1.52.3.dev20260110.dist-info → streamlit_nightly-1.52.3.dev20260111.dist-info}/METADATA +1 -1
  91. {streamlit_nightly-1.52.3.dev20260110.dist-info → streamlit_nightly-1.52.3.dev20260111.dist-info}/RECORD +95 -95
  92. streamlit/static/static/js/index.q83b8_8b.js +0 -1
  93. streamlit/static/static/js/uniqueId.RScLN3St.js +0 -1
  94. {streamlit_nightly-1.52.3.dev20260110.data → streamlit_nightly-1.52.3.dev20260111.data}/scripts/streamlit.cmd +0 -0
  95. {streamlit_nightly-1.52.3.dev20260110.dist-info → streamlit_nightly-1.52.3.dev20260111.dist-info}/WHEEL +0 -0
  96. {streamlit_nightly-1.52.3.dev20260110.dist-info → streamlit_nightly-1.52.3.dev20260111.dist-info}/entry_points.txt +0 -0
  97. {streamlit_nightly-1.52.3.dev20260110.dist-info → streamlit_nightly-1.52.3.dev20260111.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
1
- import{r as l,e as s,j as m,p as V,U as x}from"./index.BZBWLU1C.js";import{u as U}from"./useBasicWidgetState.D6_b0IqA.js";import"./FormClearHelper.Cm3GDSk6.js";const h=(t,e)=>t.getStringValue(e),v=t=>t.options.length===0||s(t.default)?null:t.options[t.default],w=t=>t.rawValue??null,y=(t,e,o,a)=>{e.setStringValue(t,o.value,{fromUi:o.fromUi},a)},C=({disabled:t,element:e,widgetMgr:o,fragmentId:a})=>{const{options:i,help:u,label:n,labelVisibility:c,placeholder:p,acceptNewOptions:f}=e,[g,r]=U({getStateFromWidgetMgr:h,getDefaultStateFromProto:v,getCurrStateFromProto:w,updateWidgetMgrState:y,element:e,widgetMgr:o,fragmentId:a}),b=l.useCallback(d=>{r({value:d,fromUi:!0})},[r]),S=s(e.default)&&!t;return m(x,{label:n,labelVisibility:V(c?.value),options:i,disabled:t,onChange:b,value:g,help:u,placeholder:p,clearable:S,acceptNewOptions:f??!1})},P=l.memo(C);export{P as default};
1
+ import{r as l,e as s,j as m,p as V,U as x}from"./index.01VsD2h1.js";import{u as U}from"./useBasicWidgetState.DrTKs46R.js";import"./FormClearHelper.By4vKj6A.js";const h=(t,e)=>t.getStringValue(e),v=t=>t.options.length===0||s(t.default)?null:t.options[t.default],w=t=>t.rawValue??null,y=(t,e,o,a)=>{e.setStringValue(t,o.value,{fromUi:o.fromUi},a)},C=({disabled:t,element:e,widgetMgr:o,fragmentId:a})=>{const{options:i,help:u,label:n,labelVisibility:c,placeholder:p,acceptNewOptions:f}=e,[g,r]=U({getStateFromWidgetMgr:h,getDefaultStateFromProto:v,getCurrStateFromProto:w,updateWidgetMgrState:y,element:e,widgetMgr:o,fragmentId:a}),b=l.useCallback(d=>{r({value:d,fromUi:!0})},[r]),S=s(e.default)&&!t;return m(x,{label:n,labelVisibility:V(c?.value),options:i,disabled:t,onChange:b,value:g,help:u,placeholder:p,clearable:S,acceptNewOptions:f??!1})},P=l.memo(C);export{P as default};
@@ -1 +1 @@
1
- import{F as p,N as o,r as C,O as N,o as g,j as s,Q as u,q as T,R as m}from"./index.BZBWLU1C.js";import{g as A,a as L,f as w}from"./pandasStylerUtils.DUtF2t3R.js";import"./moment.C7qA8nIE.js";import"./numbro.B9_PXfzp.js";import"./_baseIndexOf.BTknn6Gb.js";const x=p("div",{target:"e10e2fxn0"})(({theme:e})=>({fontSize:e.fontSizes.md,fontFamily:e.genericFonts.bodyFont,lineHeight:e.lineHeights.small,captionSide:"bottom"})),h=p("div",{target:"e10e2fxn1"})(({theme:e})=>({fontFamily:e.genericFonts.bodyFont,fontSize:e.fontSizes.sm,paddingTop:e.spacing.sm,paddingBottom:0,color:e.colors.fadedText60,textAlign:"left",wordWrap:"break-word",display:"inline-block"})),M=p("div",{target:"e10e2fxn2"})(({theme:e,borderMode:t})=>({border:t===o.BorderMode.ALL?`${e.sizes.borderWidth} solid ${e.colors.dataframeBorderColor}`:"none",borderRadius:e.radii.default,overflow:"auto"})),O=p("table",{target:"e10e2fxn3"})(({theme:e})=>({width:e.sizes.full,color:e.colors.bodyText,borderSpacing:0})),S=(e,t=o.BorderMode.ALL)=>({borderBottom:t!==o.BorderMode.NONE?`${e.sizes.borderWidth} solid ${e.colors.dataframeBorderColor}`:"none","tbody tr:last-child &":{borderBottom:t===o.BorderMode.ALL||t===o.BorderMode.HORIZONTAL?"none":void 0},borderRight:t===o.BorderMode.ALL?`${e.sizes.borderWidth} solid ${e.colors.dataframeBorderColor}`:"none","&:last-child":{borderRight:t===o.BorderMode.ALL?"none":void 0,paddingRight:t===o.BorderMode.NONE?"0":e.spacing.xs},verticalAlign:"middle",padding:`${e.spacing.twoXS} ${e.spacing.xs}`,"&:not(:first-of-type)":{paddingLeft:t===o.BorderMode.NONE||t===o.BorderMode.HORIZONTAL?e.spacing.lg:e.spacing.xs},"&:first-of-type":{paddingLeft:t===o.BorderMode.NONE?"0":e.spacing.xs},fontWeight:e.fontWeights.normal}),b=p("td",{target:"e10e2fxn4"})(({theme:e,borderMode:t})=>S(e,t)),B=p("th",{target:"e10e2fxn5"})(({theme:e,borderMode:t})=>({...S(e,t),textAlign:"inherit",color:e.colors.fadedText60,"&:first-of-type":{paddingLeft:t===o.BorderMode.NONE?"0":e.spacing.sm},"&:not(:first-of-type)":{paddingLeft:t===o.BorderMode.NONE||t===o.BorderMode.HORIZONTAL?e.spacing.lg:e.spacing.sm}})),R=p(b,{target:"e10e2fxn6"})(({theme:e})=>({color:e.colors.gray70,fontStyle:"italic",fontSize:e.fontSizes.md,textAlign:"center"}));function H(e){const t=e.data,{cssId:l,cssStyles:r,caption:d}=t.styler??{},{numHeaderRows:f,numDataRows:c,numColumns:a}=t.dimensions,n=N(c),i=e.element.borderMode;return g(x,{className:"stTable","data-testid":"stTable",children:[r&&s("style",{children:r}),s(M,{borderMode:i,children:g(O,{id:l,"data-testid":"stTableStyledTable",children:[f>0&&E(t,i),s("tbody",{children:n.length===0?s("tr",{children:s(R,{"data-testid":"stTableStyledEmptyTableCell",colSpan:a||1,borderMode:i,children:"empty"})}):n.map(y=>$(t,y,a,i))})]})}),d&&s(h,{children:d})]})}function E(e,t){const l=t===o.BorderMode.NONE||t===o.BorderMode.HORIZONTAL;return s("thead",{children:A(e).map((r,d)=>s("tr",{children:r.map((f,c)=>{let a="inherit";if(l&&e.dimensions.numDataRows>0){const{contentType:n}=e.getCell(0,c);a=u(n)?"right":"left"}return s(B,{className:f.cssClass,scope:"col",borderMode:t,style:{textAlign:a},children:s(T,{source:f.name||" ",allowHTML:!1})},c)})},d))})}function $(e,t,l,r){return s("tr",{children:N(l).map(d=>z(e,t,d,r))},t)}function z(e,t,l,r){const{type:d,content:f,contentType:c}=e.getCell(t,l),a=L(e,t,l);let n=a?.displayContent||w(f,c),i=!1;const y={textAlign:u(c)?"right":"left"};switch(n?.endsWith('<span class="pd-t"></span>')&&(n=n.replace(/<span class="pd-t"><\/span>$/,""),i=!0),d){case m.INDEX:return g(B,{scope:"row",id:a?.cssId,className:a?.cssClass,borderMode:r,children:[i&&s("span",{className:"pd-t"}),s(T,{source:n||" ",allowHTML:!1})]},l);case m.DATA:return g(b,{id:a?.cssId,className:a?.cssClass,style:y,borderMode:r,children:[i&&s("span",{className:"pd-t"}),s(T,{source:n||" ",allowHTML:!1})]},l);default:throw new Error(`Cannot parse type "${d}".`)}}const j=C.memo(H);export{j as default};
1
+ import{F as p,N as o,r as C,O as N,o as g,j as s,Q as u,q as T,R as m}from"./index.01VsD2h1.js";import{g as A,a as L,f as w}from"./pandasStylerUtils.BY9qaz81.js";import"./moment.C7qA8nIE.js";import"./numbro.B9_PXfzp.js";import"./_baseIndexOf.BTknn6Gb.js";const x=p("div",{target:"e10e2fxn0"})(({theme:e})=>({fontSize:e.fontSizes.md,fontFamily:e.genericFonts.bodyFont,lineHeight:e.lineHeights.small,captionSide:"bottom"})),h=p("div",{target:"e10e2fxn1"})(({theme:e})=>({fontFamily:e.genericFonts.bodyFont,fontSize:e.fontSizes.sm,paddingTop:e.spacing.sm,paddingBottom:0,color:e.colors.fadedText60,textAlign:"left",wordWrap:"break-word",display:"inline-block"})),M=p("div",{target:"e10e2fxn2"})(({theme:e,borderMode:t})=>({border:t===o.BorderMode.ALL?`${e.sizes.borderWidth} solid ${e.colors.dataframeBorderColor}`:"none",borderRadius:e.radii.default,overflow:"auto"})),O=p("table",{target:"e10e2fxn3"})(({theme:e})=>({width:e.sizes.full,color:e.colors.bodyText,borderSpacing:0})),S=(e,t=o.BorderMode.ALL)=>({borderBottom:t!==o.BorderMode.NONE?`${e.sizes.borderWidth} solid ${e.colors.dataframeBorderColor}`:"none","tbody tr:last-child &":{borderBottom:t===o.BorderMode.ALL||t===o.BorderMode.HORIZONTAL?"none":void 0},borderRight:t===o.BorderMode.ALL?`${e.sizes.borderWidth} solid ${e.colors.dataframeBorderColor}`:"none","&:last-child":{borderRight:t===o.BorderMode.ALL?"none":void 0,paddingRight:t===o.BorderMode.NONE?"0":e.spacing.xs},verticalAlign:"middle",padding:`${e.spacing.twoXS} ${e.spacing.xs}`,"&:not(:first-of-type)":{paddingLeft:t===o.BorderMode.NONE||t===o.BorderMode.HORIZONTAL?e.spacing.lg:e.spacing.xs},"&:first-of-type":{paddingLeft:t===o.BorderMode.NONE?"0":e.spacing.xs},fontWeight:e.fontWeights.normal}),b=p("td",{target:"e10e2fxn4"})(({theme:e,borderMode:t})=>S(e,t)),B=p("th",{target:"e10e2fxn5"})(({theme:e,borderMode:t})=>({...S(e,t),textAlign:"inherit",color:e.colors.fadedText60,"&:first-of-type":{paddingLeft:t===o.BorderMode.NONE?"0":e.spacing.sm},"&:not(:first-of-type)":{paddingLeft:t===o.BorderMode.NONE||t===o.BorderMode.HORIZONTAL?e.spacing.lg:e.spacing.sm}})),R=p(b,{target:"e10e2fxn6"})(({theme:e})=>({color:e.colors.gray70,fontStyle:"italic",fontSize:e.fontSizes.md,textAlign:"center"}));function H(e){const t=e.data,{cssId:l,cssStyles:r,caption:d}=t.styler??{},{numHeaderRows:f,numDataRows:c,numColumns:a}=t.dimensions,n=N(c),i=e.element.borderMode;return g(x,{className:"stTable","data-testid":"stTable",children:[r&&s("style",{children:r}),s(M,{borderMode:i,children:g(O,{id:l,"data-testid":"stTableStyledTable",children:[f>0&&E(t,i),s("tbody",{children:n.length===0?s("tr",{children:s(R,{"data-testid":"stTableStyledEmptyTableCell",colSpan:a||1,borderMode:i,children:"empty"})}):n.map(y=>$(t,y,a,i))})]})}),d&&s(h,{children:d})]})}function E(e,t){const l=t===o.BorderMode.NONE||t===o.BorderMode.HORIZONTAL;return s("thead",{children:A(e).map((r,d)=>s("tr",{children:r.map((f,c)=>{let a="inherit";if(l&&e.dimensions.numDataRows>0){const{contentType:n}=e.getCell(0,c);a=u(n)?"right":"left"}return s(B,{className:f.cssClass,scope:"col",borderMode:t,style:{textAlign:a},children:s(T,{source:f.name||" ",allowHTML:!1})},c)})},d))})}function $(e,t,l,r){return s("tr",{children:N(l).map(d=>z(e,t,d,r))},t)}function z(e,t,l,r){const{type:d,content:f,contentType:c}=e.getCell(t,l),a=L(e,t,l);let n=a?.displayContent||w(f,c),i=!1;const y={textAlign:u(c)?"right":"left"};switch(n?.endsWith('<span class="pd-t"></span>')&&(n=n.replace(/<span class="pd-t"><\/span>$/,""),i=!0),d){case m.INDEX:return g(B,{scope:"row",id:a?.cssId,className:a?.cssClass,borderMode:r,children:[i&&s("span",{className:"pd-t"}),s(T,{source:n||" ",allowHTML:!1})]},l);case m.DATA:return g(b,{id:a?.cssId,className:a?.cssClass,style:y,borderMode:r,children:[i&&s("span",{className:"pd-t"}),s(T,{source:n||" ",allowHTML:!1})]},l);default:throw new Error(`Cannot parse type "${d}".`)}}const j=C.memo(H);export{j as default};
@@ -1 +1 @@
1
- import{F as c,r as a,j as o,o as u,am as g,Z as f,q as S}from"./index.BZBWLU1C.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{F as c,r as a,j as o,o as u,am as g,Z as f,q as S}from"./index.01VsD2h1.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,4 +1,4 @@
1
- import{cI as Rt,cJ as _t,cK as Ot,cL as _e,cM as Mt,cN as Ft,cO as Pt,cP as Bt,cQ as Ht,cR as At,ca as fe,cS as Tt,cT as $t,an as Ee,ah as Oe,aD as s,r as C,bD as g,bG as _,F as ge,l as Dt,cU as Nt,o as qe,j as T,P as jt,ad as Lt,cV as zt,p as Gt}from"./index.BZBWLU1C.js";import{u as Wt}from"./useBasicWidgetState.D6_b0IqA.js";import{t as Ut,d as It}from"./throttle.DxEHIIp7.js";import{W as Vt}from"./WidgetLabelHelpIconInline.WAReecol.js";import"./FormClearHelper.Cm3GDSk6.js";function xt(r){return typeof r=="function"?r:Rt}function qt(r,e){var t=_e(r)?_t:Ot;return t(r,xt(e))}function $(r,e){var t=_e(r)?Mt:Ft;return t(r,Pt(e))}const Xt=Object.freeze(Object.defineProperty({__proto__:null,default:$},Symbol.toStringTag,{value:"Module"}));function Yt(r,e){return r&&Bt(r,xt(e))}const Kt=Object.freeze(Object.defineProperty({__proto__:null,default:Yt},Symbol.toStringTag,{value:"Module"}));var Zt="[object String]";function Jt(r){return typeof r=="string"||!_e(r)&&Ht(r)&&At(r)==Zt}const Qt=Object.freeze(Object.defineProperty({__proto__:null,default:Jt},Symbol.toStringTag,{value:"Module"}));function Xe(r){return r===void 0}var R={},j={};const er=fe(Qt),Me=fe(Kt),tr=fe(Tt),rr=fe(Xt);var Ye;function nr(){if(Ye)return j;Ye=1,Object.defineProperty(j,"__esModule",{value:!0}),j.flattenNames=void 0;var r=er,e=h(r),t=Me,n=h(t),a=tr,i=h(a),o=rr,l=h(o);function h(p){return p&&p.__esModule?p:{default:p}}var c=j.flattenNames=function p(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=[];return(0,l.default)(u,function(f){Array.isArray(f)?p(f).map(function(v){return d.push(v)}):(0,i.default)(f)?(0,n.default)(f,function(v,b){v===!0&&d.push(b),d.push(b+"-"+v)}):(0,e.default)(f)&&d.push(f)}),d};return j.default=c,j}var L={};const ar=fe($t);var Ke;function ir(){if(Ke)return L;Ke=1,Object.defineProperty(L,"__esModule",{value:!0}),L.mergeClasses=void 0;var r=Me,e=i(r),t=ar,n=i(t),a=Object.assign||function(l){for(var h=1;h<arguments.length;h++){var c=arguments[h];for(var p in c)Object.prototype.hasOwnProperty.call(c,p)&&(l[p]=c[p])}return l};function i(l){return l&&l.__esModule?l:{default:l}}var o=L.mergeClasses=function(h){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],p=h.default&&(0,n.default)(h.default)||{};return c.map(function(u){var d=h[u];return d&&(0,e.default)(d,function(f,v){p[v]||(p[v]={}),p[v]=a({},p[v],d[v])}),u}),p};return L.default=o,L}var z={},Ze;function or(){if(Ze)return z;Ze=1,Object.defineProperty(z,"__esModule",{value:!0}),z.autoprefix=void 0;var r=Me,e=n(r),t=Object.assign||function(o){for(var l=1;l<arguments.length;l++){var h=arguments[l];for(var c in h)Object.prototype.hasOwnProperty.call(h,c)&&(o[c]=h[c])}return o};function n(o){return o&&o.__esModule?o:{default:o}}var a={borderRadius:function(l){return{msBorderRadius:l,MozBorderRadius:l,OBorderRadius:l,WebkitBorderRadius:l,borderRadius:l}},boxShadow:function(l){return{msBoxShadow:l,MozBoxShadow:l,OBoxShadow:l,WebkitBoxShadow:l,boxShadow:l}},userSelect:function(l){return{WebkitTouchCallout:l,KhtmlUserSelect:l,MozUserSelect:l,msUserSelect:l,WebkitUserSelect:l,userSelect:l}},flex:function(l){return{WebkitBoxFlex:l,MozBoxFlex:l,WebkitFlex:l,msFlex:l,flex:l}},flexBasis:function(l){return{WebkitFlexBasis:l,flexBasis:l}},justifyContent:function(l){return{WebkitJustifyContent:l,justifyContent:l}},transition:function(l){return{msTransition:l,MozTransition:l,OTransition:l,WebkitTransition:l,transition:l}},transform:function(l){return{msTransform:l,MozTransform:l,OTransform:l,WebkitTransform:l,transform:l}},absolute:function(l){var h=l&&l.split(" ");return{position:"absolute",top:h&&h[0],right:h&&h[1],bottom:h&&h[2],left:h&&h[3]}},extend:function(l,h){var c=h[l];return c||{extend:l}}},i=z.autoprefix=function(l){var h={};return(0,e.default)(l,function(c,p){var u={};(0,e.default)(c,function(d,f){var v=a[f];v?u=t({},u,v(d)):u[f]=d}),h[p]=u}),h};return z.default=i,z}var G={},Je;function lr(){if(Je)return G;Je=1,Object.defineProperty(G,"__esModule",{value:!0}),G.hover=void 0;var r=Object.assign||function(h){for(var c=1;c<arguments.length;c++){var p=arguments[c];for(var u in p)Object.prototype.hasOwnProperty.call(p,u)&&(h[u]=p[u])}return h},e=Ee(),t=n(e);function n(h){return h&&h.__esModule?h:{default:h}}function a(h,c){if(!(h instanceof c))throw new TypeError("Cannot call a class as a function")}function i(h,c){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:h}function o(h,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);h.prototype=Object.create(c&&c.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(h,c):h.__proto__=c)}var l=G.hover=function(c){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return(function(u){o(d,u);function d(){var f,v,b,m;a(this,d);for(var E=arguments.length,M=Array(E),k=0;k<E;k++)M[k]=arguments[k];return m=(v=(b=i(this,(f=d.__proto__||Object.getPrototypeOf(d)).call.apply(f,[this].concat(M))),b),b.state={hover:!1},b.handleMouseOver=function(){return b.setState({hover:!0})},b.handleMouseOut=function(){return b.setState({hover:!1})},b.render=function(){return t.default.createElement(p,{onMouseOver:b.handleMouseOver,onMouseOut:b.handleMouseOut},t.default.createElement(c,r({},b.props,b.state)))},v),i(b,m)}return d})(t.default.Component)};return G.default=l,G}var W={},Qe;function sr(){if(Qe)return W;Qe=1,Object.defineProperty(W,"__esModule",{value:!0}),W.active=void 0;var r=Object.assign||function(h){for(var c=1;c<arguments.length;c++){var p=arguments[c];for(var u in p)Object.prototype.hasOwnProperty.call(p,u)&&(h[u]=p[u])}return h},e=Ee(),t=n(e);function n(h){return h&&h.__esModule?h:{default:h}}function a(h,c){if(!(h instanceof c))throw new TypeError("Cannot call a class as a function")}function i(h,c){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:h}function o(h,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);h.prototype=Object.create(c&&c.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(h,c):h.__proto__=c)}var l=W.active=function(c){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return(function(u){o(d,u);function d(){var f,v,b,m;a(this,d);for(var E=arguments.length,M=Array(E),k=0;k<E;k++)M[k]=arguments[k];return m=(v=(b=i(this,(f=d.__proto__||Object.getPrototypeOf(d)).call.apply(f,[this].concat(M))),b),b.state={active:!1},b.handleMouseDown=function(){return b.setState({active:!0})},b.handleMouseUp=function(){return b.setState({active:!1})},b.render=function(){return t.default.createElement(p,{onMouseDown:b.handleMouseDown,onMouseUp:b.handleMouseUp},t.default.createElement(c,r({},b.props,b.state)))},v),i(b,m)}return d})(t.default.Component)};return W.default=l,W}var xe={},et;function hr(){if(et)return xe;et=1,Object.defineProperty(xe,"__esModule",{value:!0});var r=function(t,n){var a={},i=function(l){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;a[l]=h};return t===0&&i("first-child"),t===n-1&&i("last-child"),(t===0||t%2===0)&&i("even"),Math.abs(t%2)===1&&i("odd"),i("nth-child",t),a};return xe.default=r,xe}var tt;function cr(){if(tt)return R;tt=1,Object.defineProperty(R,"__esModule",{value:!0}),R.ReactCSS=R.loop=R.handleActive=R.handleHover=R.hover=void 0;var r=nr(),e=d(r),t=ir(),n=d(t),a=or(),i=d(a),o=lr(),l=d(o),h=sr(),c=d(h),p=hr(),u=d(p);function d(v){return v&&v.__esModule?v:{default:v}}R.hover=l.default,R.handleHover=l.default,R.handleActive=c.default,R.loop=u.default;var f=R.ReactCSS=function(b){for(var m=arguments.length,E=Array(m>1?m-1:0),M=1;M<m;M++)E[M-1]=arguments[M];var k=(0,e.default)(E),A=(0,n.default)(b,k);return(0,i.default)(A)};return R.default=f,R}var Fe=cr();const y=Oe(Fe);var pr=function(e,t,n,a,i){var o=i.clientWidth,l=i.clientHeight,h=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,c=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,p=h-(i.getBoundingClientRect().left+window.pageXOffset),u=c-(i.getBoundingClientRect().top+window.pageYOffset);if(n==="vertical"){var d=void 0;if(u<0?d=0:u>l?d=1:d=Math.round(u*100/l)/100,t.a!==d)return{h:t.h,s:t.s,l:t.l,a:d,source:"rgb"}}else{var f=void 0;if(p<0?f=0:p>o?f=1:f=Math.round(p*100/o)/100,a!==f)return{h:t.h,s:t.s,l:t.l,a:f,source:"rgb"}}return null},Ce={},ur=function(e,t,n,a){if(typeof document>"u"&&!a)return null;var i=a?new a:document.createElement("canvas");i.width=n*2,i.height=n*2;var o=i.getContext("2d");return o?(o.fillStyle=e,o.fillRect(0,0,i.width,i.height),o.fillStyle=t,o.fillRect(0,0,n,n),o.translate(n,n),o.fillRect(0,0,n,n),i.toDataURL()):null},dr=function(e,t,n,a){var i=e+"-"+t+"-"+n+(a?"-server":"");if(Ce[i])return Ce[i];var o=ur(e,t,n,a);return Ce[i]=o,o},rt=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},le=function(e){var t=e.white,n=e.grey,a=e.size,i=e.renderers,o=e.borderRadius,l=e.boxShadow,h=e.children,c=y({default:{grid:{borderRadius:o,boxShadow:l,absolute:"0px 0px 0px 0px",background:"url("+dr(t,n,a,i.canvas)+") center left"}}});return C.isValidElement(h)?s.cloneElement(h,rt({},h.props,{style:rt({},h.props.style,c.grid)})):s.createElement("div",{style:c.grid})};le.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var fr=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},gr=(function(){function r(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}})();function br(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function nt(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function vr(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var Pe=(function(r){vr(e,r);function e(){var t,n,a,i;br(this,e);for(var o=arguments.length,l=Array(o),h=0;h<o;h++)l[h]=arguments[h];return i=(n=(a=nt(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(l))),a),a.handleChange=function(c){var p=pr(c,a.props.hsl,a.props.direction,a.props.a,a.container);p&&typeof a.props.onChange=="function"&&a.props.onChange(p,c)},a.handleMouseDown=function(c){a.handleChange(c),window.addEventListener("mousemove",a.handleChange),window.addEventListener("mouseup",a.handleMouseUp)},a.handleMouseUp=function(){a.unbindEventListeners()},a.unbindEventListeners=function(){window.removeEventListener("mousemove",a.handleChange),window.removeEventListener("mouseup",a.handleMouseUp)},n),nt(a,i)}return gr(e,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var n=this,a=this.props.rgb,i=y({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+a.r+","+a.g+","+a.b+`, 0) 0%,
1
+ import{cI as Rt,cJ as _t,cK as Ot,cL as _e,cM as Mt,cN as Ft,cO as Pt,cP as Bt,cQ as Ht,cR as At,ca as fe,cS as Tt,cT as $t,an as Ee,ah as Oe,aD as s,r as C,bD as g,bG as _,F as ge,l as Dt,cU as Nt,o as qe,j as T,P as jt,ad as Lt,cV as zt,p as Gt}from"./index.01VsD2h1.js";import{u as Wt}from"./useBasicWidgetState.DrTKs46R.js";import{t as Ut,d as It}from"./throttle.DSR3q89S.js";import{W as Vt}from"./WidgetLabelHelpIconInline.BdGIJQe4.js";import"./FormClearHelper.By4vKj6A.js";function xt(r){return typeof r=="function"?r:Rt}function qt(r,e){var t=_e(r)?_t:Ot;return t(r,xt(e))}function $(r,e){var t=_e(r)?Mt:Ft;return t(r,Pt(e))}const Xt=Object.freeze(Object.defineProperty({__proto__:null,default:$},Symbol.toStringTag,{value:"Module"}));function Yt(r,e){return r&&Bt(r,xt(e))}const Kt=Object.freeze(Object.defineProperty({__proto__:null,default:Yt},Symbol.toStringTag,{value:"Module"}));var Zt="[object String]";function Jt(r){return typeof r=="string"||!_e(r)&&Ht(r)&&At(r)==Zt}const Qt=Object.freeze(Object.defineProperty({__proto__:null,default:Jt},Symbol.toStringTag,{value:"Module"}));function Xe(r){return r===void 0}var R={},j={};const er=fe(Qt),Me=fe(Kt),tr=fe(Tt),rr=fe(Xt);var Ye;function nr(){if(Ye)return j;Ye=1,Object.defineProperty(j,"__esModule",{value:!0}),j.flattenNames=void 0;var r=er,e=h(r),t=Me,n=h(t),a=tr,i=h(a),o=rr,l=h(o);function h(p){return p&&p.__esModule?p:{default:p}}var c=j.flattenNames=function p(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=[];return(0,l.default)(u,function(f){Array.isArray(f)?p(f).map(function(v){return d.push(v)}):(0,i.default)(f)?(0,n.default)(f,function(v,b){v===!0&&d.push(b),d.push(b+"-"+v)}):(0,e.default)(f)&&d.push(f)}),d};return j.default=c,j}var L={};const ar=fe($t);var Ke;function ir(){if(Ke)return L;Ke=1,Object.defineProperty(L,"__esModule",{value:!0}),L.mergeClasses=void 0;var r=Me,e=i(r),t=ar,n=i(t),a=Object.assign||function(l){for(var h=1;h<arguments.length;h++){var c=arguments[h];for(var p in c)Object.prototype.hasOwnProperty.call(c,p)&&(l[p]=c[p])}return l};function i(l){return l&&l.__esModule?l:{default:l}}var o=L.mergeClasses=function(h){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],p=h.default&&(0,n.default)(h.default)||{};return c.map(function(u){var d=h[u];return d&&(0,e.default)(d,function(f,v){p[v]||(p[v]={}),p[v]=a({},p[v],d[v])}),u}),p};return L.default=o,L}var z={},Ze;function or(){if(Ze)return z;Ze=1,Object.defineProperty(z,"__esModule",{value:!0}),z.autoprefix=void 0;var r=Me,e=n(r),t=Object.assign||function(o){for(var l=1;l<arguments.length;l++){var h=arguments[l];for(var c in h)Object.prototype.hasOwnProperty.call(h,c)&&(o[c]=h[c])}return o};function n(o){return o&&o.__esModule?o:{default:o}}var a={borderRadius:function(l){return{msBorderRadius:l,MozBorderRadius:l,OBorderRadius:l,WebkitBorderRadius:l,borderRadius:l}},boxShadow:function(l){return{msBoxShadow:l,MozBoxShadow:l,OBoxShadow:l,WebkitBoxShadow:l,boxShadow:l}},userSelect:function(l){return{WebkitTouchCallout:l,KhtmlUserSelect:l,MozUserSelect:l,msUserSelect:l,WebkitUserSelect:l,userSelect:l}},flex:function(l){return{WebkitBoxFlex:l,MozBoxFlex:l,WebkitFlex:l,msFlex:l,flex:l}},flexBasis:function(l){return{WebkitFlexBasis:l,flexBasis:l}},justifyContent:function(l){return{WebkitJustifyContent:l,justifyContent:l}},transition:function(l){return{msTransition:l,MozTransition:l,OTransition:l,WebkitTransition:l,transition:l}},transform:function(l){return{msTransform:l,MozTransform:l,OTransform:l,WebkitTransform:l,transform:l}},absolute:function(l){var h=l&&l.split(" ");return{position:"absolute",top:h&&h[0],right:h&&h[1],bottom:h&&h[2],left:h&&h[3]}},extend:function(l,h){var c=h[l];return c||{extend:l}}},i=z.autoprefix=function(l){var h={};return(0,e.default)(l,function(c,p){var u={};(0,e.default)(c,function(d,f){var v=a[f];v?u=t({},u,v(d)):u[f]=d}),h[p]=u}),h};return z.default=i,z}var G={},Je;function lr(){if(Je)return G;Je=1,Object.defineProperty(G,"__esModule",{value:!0}),G.hover=void 0;var r=Object.assign||function(h){for(var c=1;c<arguments.length;c++){var p=arguments[c];for(var u in p)Object.prototype.hasOwnProperty.call(p,u)&&(h[u]=p[u])}return h},e=Ee(),t=n(e);function n(h){return h&&h.__esModule?h:{default:h}}function a(h,c){if(!(h instanceof c))throw new TypeError("Cannot call a class as a function")}function i(h,c){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:h}function o(h,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);h.prototype=Object.create(c&&c.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(h,c):h.__proto__=c)}var l=G.hover=function(c){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return(function(u){o(d,u);function d(){var f,v,b,m;a(this,d);for(var E=arguments.length,M=Array(E),k=0;k<E;k++)M[k]=arguments[k];return m=(v=(b=i(this,(f=d.__proto__||Object.getPrototypeOf(d)).call.apply(f,[this].concat(M))),b),b.state={hover:!1},b.handleMouseOver=function(){return b.setState({hover:!0})},b.handleMouseOut=function(){return b.setState({hover:!1})},b.render=function(){return t.default.createElement(p,{onMouseOver:b.handleMouseOver,onMouseOut:b.handleMouseOut},t.default.createElement(c,r({},b.props,b.state)))},v),i(b,m)}return d})(t.default.Component)};return G.default=l,G}var W={},Qe;function sr(){if(Qe)return W;Qe=1,Object.defineProperty(W,"__esModule",{value:!0}),W.active=void 0;var r=Object.assign||function(h){for(var c=1;c<arguments.length;c++){var p=arguments[c];for(var u in p)Object.prototype.hasOwnProperty.call(p,u)&&(h[u]=p[u])}return h},e=Ee(),t=n(e);function n(h){return h&&h.__esModule?h:{default:h}}function a(h,c){if(!(h instanceof c))throw new TypeError("Cannot call a class as a function")}function i(h,c){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:h}function o(h,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);h.prototype=Object.create(c&&c.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(h,c):h.__proto__=c)}var l=W.active=function(c){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return(function(u){o(d,u);function d(){var f,v,b,m;a(this,d);for(var E=arguments.length,M=Array(E),k=0;k<E;k++)M[k]=arguments[k];return m=(v=(b=i(this,(f=d.__proto__||Object.getPrototypeOf(d)).call.apply(f,[this].concat(M))),b),b.state={active:!1},b.handleMouseDown=function(){return b.setState({active:!0})},b.handleMouseUp=function(){return b.setState({active:!1})},b.render=function(){return t.default.createElement(p,{onMouseDown:b.handleMouseDown,onMouseUp:b.handleMouseUp},t.default.createElement(c,r({},b.props,b.state)))},v),i(b,m)}return d})(t.default.Component)};return W.default=l,W}var xe={},et;function hr(){if(et)return xe;et=1,Object.defineProperty(xe,"__esModule",{value:!0});var r=function(t,n){var a={},i=function(l){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;a[l]=h};return t===0&&i("first-child"),t===n-1&&i("last-child"),(t===0||t%2===0)&&i("even"),Math.abs(t%2)===1&&i("odd"),i("nth-child",t),a};return xe.default=r,xe}var tt;function cr(){if(tt)return R;tt=1,Object.defineProperty(R,"__esModule",{value:!0}),R.ReactCSS=R.loop=R.handleActive=R.handleHover=R.hover=void 0;var r=nr(),e=d(r),t=ir(),n=d(t),a=or(),i=d(a),o=lr(),l=d(o),h=sr(),c=d(h),p=hr(),u=d(p);function d(v){return v&&v.__esModule?v:{default:v}}R.hover=l.default,R.handleHover=l.default,R.handleActive=c.default,R.loop=u.default;var f=R.ReactCSS=function(b){for(var m=arguments.length,E=Array(m>1?m-1:0),M=1;M<m;M++)E[M-1]=arguments[M];var k=(0,e.default)(E),A=(0,n.default)(b,k);return(0,i.default)(A)};return R.default=f,R}var Fe=cr();const y=Oe(Fe);var pr=function(e,t,n,a,i){var o=i.clientWidth,l=i.clientHeight,h=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,c=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,p=h-(i.getBoundingClientRect().left+window.pageXOffset),u=c-(i.getBoundingClientRect().top+window.pageYOffset);if(n==="vertical"){var d=void 0;if(u<0?d=0:u>l?d=1:d=Math.round(u*100/l)/100,t.a!==d)return{h:t.h,s:t.s,l:t.l,a:d,source:"rgb"}}else{var f=void 0;if(p<0?f=0:p>o?f=1:f=Math.round(p*100/o)/100,a!==f)return{h:t.h,s:t.s,l:t.l,a:f,source:"rgb"}}return null},Ce={},ur=function(e,t,n,a){if(typeof document>"u"&&!a)return null;var i=a?new a:document.createElement("canvas");i.width=n*2,i.height=n*2;var o=i.getContext("2d");return o?(o.fillStyle=e,o.fillRect(0,0,i.width,i.height),o.fillStyle=t,o.fillRect(0,0,n,n),o.translate(n,n),o.fillRect(0,0,n,n),i.toDataURL()):null},dr=function(e,t,n,a){var i=e+"-"+t+"-"+n+(a?"-server":"");if(Ce[i])return Ce[i];var o=ur(e,t,n,a);return Ce[i]=o,o},rt=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},le=function(e){var t=e.white,n=e.grey,a=e.size,i=e.renderers,o=e.borderRadius,l=e.boxShadow,h=e.children,c=y({default:{grid:{borderRadius:o,boxShadow:l,absolute:"0px 0px 0px 0px",background:"url("+dr(t,n,a,i.canvas)+") center left"}}});return C.isValidElement(h)?s.cloneElement(h,rt({},h.props,{style:rt({},h.props.style,c.grid)})):s.createElement("div",{style:c.grid})};le.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var fr=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},gr=(function(){function r(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}})();function br(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function nt(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function vr(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var Pe=(function(r){vr(e,r);function e(){var t,n,a,i;br(this,e);for(var o=arguments.length,l=Array(o),h=0;h<o;h++)l[h]=arguments[h];return i=(n=(a=nt(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(l))),a),a.handleChange=function(c){var p=pr(c,a.props.hsl,a.props.direction,a.props.a,a.container);p&&typeof a.props.onChange=="function"&&a.props.onChange(p,c)},a.handleMouseDown=function(c){a.handleChange(c),window.addEventListener("mousemove",a.handleChange),window.addEventListener("mouseup",a.handleMouseUp)},a.handleMouseUp=function(){a.unbindEventListeners()},a.unbindEventListeners=function(){window.removeEventListener("mousemove",a.handleChange),window.removeEventListener("mouseup",a.handleMouseUp)},n),nt(a,i)}return gr(e,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var n=this,a=this.props.rgb,i=y({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+a.r+","+a.g+","+a.b+`, 0) 0%,
2
2
  rgba(`+a.r+","+a.g+","+a.b+", 1) 100%)",boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:"relative",height:"100%",margin:"0 3px"},pointer:{position:"absolute",left:a.a*100+"%"},slider:{width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",marginTop:"1px",transform:"translateX(-2px)"}},vertical:{gradient:{background:"linear-gradient(to bottom, rgba("+a.r+","+a.g+","+a.b+`, 0) 0%,
3
3
  rgba(`+a.r+","+a.g+","+a.b+", 1) 100%)"},pointer:{left:0,top:a.a*100+"%"}},overwrite:fr({},this.props.style)},{vertical:this.props.direction==="vertical",overwrite:!0});return s.createElement("div",{style:i.alpha},s.createElement("div",{style:i.checkboard},s.createElement(le,{renderers:this.props.renderers})),s.createElement("div",{style:i.gradient}),s.createElement("div",{style:i.container,ref:function(l){return n.container=l},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},s.createElement("div",{style:i.pointer},this.props.pointer?s.createElement(this.props.pointer,this.props):s.createElement("div",{style:i.slider}))))}}]),e})(C.PureComponent||C.Component),xr=(function(){function r(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}})();function mr(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function yr(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function wr(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function Er(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var Sr=1,mt=38,Cr=40,kr=[mt,Cr],Rr=function(e){return kr.indexOf(e)>-1},_r=function(e){return Number(String(e).replace(/%/g,""))},Or=1,w=(function(r){Er(e,r);function e(t){yr(this,e);var n=wr(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.handleBlur=function(){n.state.blurValue&&n.setState({value:n.state.blurValue,blurValue:null})},n.handleChange=function(a){n.setUpdatedValue(a.target.value,a)},n.handleKeyDown=function(a){var i=_r(a.target.value);if(!isNaN(i)&&Rr(a.keyCode)){var o=n.getArrowOffset(),l=a.keyCode===mt?i+o:i-o;n.setUpdatedValue(l,a)}},n.handleDrag=function(a){if(n.props.dragLabel){var i=Math.round(n.props.value+a.movementX);i>=0&&i<=n.props.dragMax&&n.props.onChange&&n.props.onChange(n.getValueObjectWithLabel(i),a)}},n.handleMouseDown=function(a){n.props.dragLabel&&(a.preventDefault(),n.handleDrag(a),window.addEventListener("mousemove",n.handleDrag),window.addEventListener("mouseup",n.handleMouseUp))},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener("mousemove",n.handleDrag),window.removeEventListener("mouseup",n.handleMouseUp)},n.state={value:String(t.value).toUpperCase(),blurValue:String(t.value).toUpperCase()},n.inputId="rc-editable-input-"+Or++,n}return xr(e,[{key:"componentDidUpdate",value:function(n,a){this.props.value!==this.state.value&&(n.value!==this.props.value||a.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(n){return mr({},this.props.label,n)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||Sr}},{key:"setUpdatedValue",value:function(n,a){var i=this.props.label?this.getValueObjectWithLabel(n):n;this.props.onChange&&this.props.onChange(i,a),this.setState({value:n})}},{key:"render",value:function(){var n=this,a=y({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return s.createElement("div",{style:a.wrap},s.createElement("input",{id:this.inputId,style:a.input,ref:function(o){return n.input=o},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?s.createElement("label",{htmlFor:this.inputId,style:a.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),e})(C.PureComponent||C.Component),Mr=function(e,t,n,a){var i=a.clientWidth,o=a.clientHeight,l=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,h=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,c=l-(a.getBoundingClientRect().left+window.pageXOffset),p=h-(a.getBoundingClientRect().top+window.pageYOffset);if(t==="vertical"){var u=void 0;if(p<0)u=359;else if(p>o)u=0;else{var d=-(p*100/o)+100;u=360*d/100}if(n.h!==u)return{h:u,s:n.s,l:n.l,a:n.a,source:"hsl"}}else{var f=void 0;if(c<0)f=0;else if(c>i)f=359;else{var v=c*100/i;f=360*v/100}if(n.h!==f)return{h:f,s:n.s,l:n.l,a:n.a,source:"hsl"}}return null},Fr=(function(){function r(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}})();function Pr(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function at(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function Br(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var se=(function(r){Br(e,r);function e(){var t,n,a,i;Pr(this,e);for(var o=arguments.length,l=Array(o),h=0;h<o;h++)l[h]=arguments[h];return i=(n=(a=at(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(l))),a),a.handleChange=function(c){var p=Mr(c,a.props.direction,a.props.hsl,a.container);p&&typeof a.props.onChange=="function"&&a.props.onChange(p,c)},a.handleMouseDown=function(c){a.handleChange(c),window.addEventListener("mousemove",a.handleChange),window.addEventListener("mouseup",a.handleMouseUp)},a.handleMouseUp=function(){a.unbindEventListeners()},n),at(a,i)}return Fr(e,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"unbindEventListeners",value:function(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var n=this,a=this.props.direction,i=a===void 0?"horizontal":a,o=y({default:{hue:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius,boxShadow:this.props.shadow},container:{padding:"0 2px",position:"relative",height:"100%",borderRadius:this.props.radius},pointer:{position:"absolute",left:this.props.hsl.h*100/360+"%"},slider:{marginTop:"1px",width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",transform:"translateX(-2px)"}},vertical:{pointer:{left:"0px",top:-(this.props.hsl.h*100/360)+100+"%"}}},{vertical:i==="vertical"});return s.createElement("div",{style:o.hue},s.createElement("div",{className:"hue-"+i,style:o.container,ref:function(h){return n.container=h},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},s.createElement("style",null,`
4
4
  .hue-horizontal {
@@ -1,2 +1,2 @@
1
- import{K as _,r as u,W as ao,cw as W,cu as co,aN as io,l as lo,j as m,X as U,V as fo,cx as go,F as D,aO as V}from"./index.BZBWLU1C.js";function Co(o,e,r,n){for(var t=-1,s=o==null?0:o.length;++t<s;)r=e(r,o[t],t,o);return r}function xo(o){return function(e){return o?.[e]}}var po={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},ho=xo(po),mo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bo="\\u0300-\\u036f",So="\\ufe20-\\ufe2f",yo="\\u20d0-\\u20ff",Ro=bo+So+yo,Eo="["+Ro+"]",Fo=RegExp(Eo,"g");function wo(o){return o=_(o),o&&o.replace(mo,ho).replace(Fo,"")}var vo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function ko(o){return o.match(vo)||[]}var Bo=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function To(o){return Bo.test(o)}var H="\\ud800-\\udfff",zo="\\u0300-\\u036f",Ao="\\ufe20-\\ufe2f",Uo="\\u20d0-\\u20ff",Io=zo+Ao+Uo,J="\\u2700-\\u27bf",Z="a-z\\xdf-\\xf6\\xf8-\\xff",Oo="\\xac\\xb1\\xd7\\xf7",Wo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Lo="\\u2000-\\u206f",Mo=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",G="A-Z\\xc0-\\xd6\\xd8-\\xde",jo="\\ufe0e\\ufe0f",K=Oo+Wo+Lo+Mo,Y="['’]",L="["+K+"]",$o="["+Io+"]",q="\\d+",No="["+J+"]",X="["+Z+"]",Q="[^"+H+K+q+J+Z+G+"]",Po="\\ud83c[\\udffb-\\udfff]",_o="(?:"+$o+"|"+Po+")",Do="[^"+H+"]",oo="(?:\\ud83c[\\udde6-\\uddff]){2}",eo="[\\ud800-\\udbff][\\udc00-\\udfff]",w="["+G+"]",Vo="\\u200d",M="(?:"+X+"|"+Q+")",Ho="(?:"+w+"|"+Q+")",j="(?:"+Y+"(?:d|ll|m|re|s|t|ve))?",$="(?:"+Y+"(?:D|LL|M|RE|S|T|VE))?",ro=_o+"?",to="["+jo+"]?",Jo="(?:"+Vo+"(?:"+[Do,oo,eo].join("|")+")"+to+ro+")*",Zo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Go="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ko=to+ro+Jo,Yo="(?:"+[No,oo,eo].join("|")+")"+Ko,qo=RegExp([w+"?"+X+"+"+j+"(?="+[L,w,"$"].join("|")+")",Ho+"+"+$+"(?="+[L,w+M,"$"].join("|")+")",w+"?"+M+"+"+j,w+"+"+$,Go,Zo,q,Yo].join("|"),"g");function Xo(o){return o.match(qo)||[]}function Qo(o,e,r){return o=_(o),e=e,e===void 0?To(o)?Xo(o):ko(o):o.match(e)||[]}var oe="['’]",ee=RegExp(oe,"g");function re(o){return function(e){return Co(Qo(wo(e).replace(ee,"")),o,"")}}var te=re(function(o,e,r){return o+(r?"-":"")+e.toLowerCase()});const k=u.createContext(null);k.displayName="BidiComponentContext";const v=ao.getLogger("BidiComponent"),N="__",z="__streamlit_arrow_ref__",ne="$$STREAMLIT_INTERNAL_KEY",se=(o,e)=>{if(o&&typeof o=="object"&&!Array.isArray(o)){if(typeof o[z]=="string"){const n=o[z],t=e[n];if(t)try{return W(t)}catch{return null}return null}const r={};for(const[n,t]of Object.entries(o))if(t&&typeof t=="object"&&!Array.isArray(t)&&typeof t[z]=="string"){const s=t[z],a=e[s];if(a)try{r[n]=W(a)}catch{r[n]=null}else r[n]=null}else r[n]=t;return r}return o},ue=({arrowBlobs:o,arrowData:e,bytes:r,data:n,json:t,mixedJson:s})=>{switch(n){case"json":return t?JSON.parse(t):null;case"arrowData":return e??null;case"bytes":return r??null;case"mixed":{if(s&&o){const a=JSON.parse(s),i={};return Object.entries(o).forEach(([l,d])=>{d?.data&&(i[l]=d.data)}),se(a,i)}return null}case"any":case void 0:return null;default:co(n)}},ae=(o,e="--st")=>{const r={};return Object.entries(o).forEach(([n,t])=>{const s=te(n),a=`${e}-${s}`;if(typeof t=="boolean"){r[a]=t?"1":"0";return}if(t==null){r[a]="unset";return}if(Array.isArray(t)){r[a]=t.join(",");return}if(typeof t=="number"||typeof t=="string"){r[a]=String(t);return}r[a]="unset"}),r},ce=o=>{const e=[o.fontSizes.h1FontSize,o.fontSizes.h2FontSize,o.fontSizes.h3FontSize,o.fontSizes.h4FontSize,o.fontSizes.h5FontSize,o.fontSizes.h6FontSize],r=[o.fontWeights.h1FontWeight,o.fontWeights.h2FontWeight,o.fontWeights.h3FontWeight,o.fontWeights.h4FontWeight,o.fontWeights.h5FontWeight,o.fontWeights.h6FontWeight];return{primaryColor:o.colors.primary,backgroundColor:o.colors.bgColor,secondaryBackgroundColor:o.colors.secondaryBg,textColor:o.colors.bodyText,linkColor:o.colors.link,linkUnderline:o.linkUnderline,headingFont:o.genericFonts.headingFont,codeFont:o.genericFonts.codeFont,baseRadius:o.radii.default,buttonRadius:o.radii.button,baseFontSize:typeof o.fontSizes.baseFontSize=="number"?`${o.fontSizes.baseFontSize}px`:String(o.fontSizes.baseFontSize),baseFontWeight:o.fontWeights.normal,codeFontWeight:o.fontWeights.code,codeFontSize:o.fontSizes.codeFontSize,headingFontSizes:e,headingFontSize1:e[0],headingFontSize2:e[1],headingFontSize3:e[2],headingFontSize4:e[3],headingFontSize5:e[4],headingFontSize6:e[5],headingFontWeights:r,headingFontWeight1:r[0],headingFontWeight2:r[1],headingFontWeight3:r[2],headingFontWeight4:r[3],headingFontWeight5:r[4],headingFontWeight6:r[5],borderColor:o.colors.borderColor,dataframeBorderColor:o.colors.dataframeBorderColor,dataframeHeaderBackgroundColor:o.colors.dataframeHeaderBackgroundColor,codeBackgroundColor:o.colors.codeBackgroundColor,font:o.genericFonts.bodyFont,chartCategoricalColors:o.colors.chartCategoricalColors,chartSequentialColors:o.colors.chartSequentialColors,headingColor:o.colors.headingColor,borderColorLight:o.colors.borderColorLight,codeTextColor:o.colors.codeTextColor,widgetBorderColor:o.colors.widgetBorderColor||"transparent",redColor:o.colors.redColor,orangeColor:o.colors.orangeColor,yellowColor:o.colors.yellowColor,blueColor:o.colors.blueColor,greenColor:o.colors.greenColor,violetColor:o.colors.violetColor,grayColor:o.colors.grayColor,redBackgroundColor:o.colors.redBackgroundColor,orangeBackgroundColor:o.colors.orangeBackgroundColor,yellowBackgroundColor:o.colors.yellowBackgroundColor,blueBackgroundColor:o.colors.blueBackgroundColor,greenBackgroundColor:o.colors.greenBackgroundColor,violetBackgroundColor:o.colors.violetBackgroundColor,grayBackgroundColor:o.colors.grayBackgroundColor,redTextColor:o.colors.redTextColor,orangeTextColor:o.colors.orangeTextColor,yellowTextColor:o.colors.yellowTextColor,blueTextColor:o.colors.blueTextColor,greenTextColor:o.colors.greenTextColor,violetTextColor:o.colors.violetTextColor,grayTextColor:o.colors.grayTextColor}},ie=u.memo(({element:o,children:e,widgetMgr:r,fragmentId:n,componentRegistry:t})=>{const{arrowData:s,bytes:a,componentName:i,cssContent:l,cssSourcePath:d,data:f,htmlContent:g,id:c,jsContent:b,json:p,jsSourcePath:h,mixed:C}=o,R=u.useMemo(()=>({id:o.id,formId:o.formId}),[o.id,o.formId]),B=u.useCallback(()=>{const F=r.getJsonValue(R);if(!F)return{};try{return JSON.parse(F)}catch(I){const y=io(I);return v.warn("Failed to parse widget JSON value; returning empty object.",{widgetId:R.id,formId:R.formId,error:y.message}),{}}},[R,r]),T=u.useMemo(()=>ue({arrowBlobs:C?.arrowBlobs||void 0,arrowData:s?.data||void 0,bytes:a,data:f,json:p,mixedJson:C?.json||void 0}),[f,p,s?.data,a,C?.json,C?.arrowBlobs]),S=lo(),E=u.useMemo(()=>ce(S),[S]),x=u.useMemo(()=>({componentName:i,componentRegistry:t,cssContent:l?.trim(),cssSourcePath:d||void 0,data:T,fragmentId:n,getWidgetValue:B,htmlContent:g?.trim(),id:c,formId:o.formId||void 0,jsContent:b||void 0,jsSourcePath:h||void 0,theme:E,widgetMgr:r}),[i,t,l,d,n,B,g,c,o.formId,b,h,T,E,r]);return m(k.Provider,{value:x,children:e})}),no=(o,e)=>{if(o instanceof Error)return o;const r=e?`${e}: ${String(o)}`:String(o);return new Error(r)},A=(o,e,r)=>{const n=no(o,r);v.error(`BidiComponent Error: ${n.message}`,o),e(n)},de=(o,e)=>{try{const n=document.createRange().createContextualFragment(o);e.appendChild(n)}catch(r){v.warn("createContextualFragment failed, falling back to innerHTML",r),e.innerHTML=o}},so=({containerRef:o,setError:e,skip:r=!1})=>{const n=u.useRef(null),{htmlContent:t,cssContent:s,cssSourcePath:a,componentName:i,componentRegistry:{getBidiComponentURL:l}}=U(k),d=u.useMemo(()=>{if(a)return l(i,a)},[i,a,l]),f=fo(d);return u.useEffect(()=>{if(r)return;const g=o.current;if(g)try{if(n.current?.parentNode===g&&g.removeChild(n.current),n.current=document.createElement("div"),t){const c=document.createElement("div");de(t,c),n.current.appendChild(c)}if(s){const c=document.createElement("style");c.textContent=s,n.current.appendChild(c)}else if(d){const c=document.createElement("link");c.href=d,c.rel="stylesheet",f&&(c.crossOrigin=f),c.onerror=()=>{A(new Error(`Failed to load CSS from ${d}`),e)},n.current.appendChild(c)}g.appendChild(n.current)}catch(c){A(c,e,"Failed to process HTML/CSS content")}},[t,s,o,f,d,e,r]),n};class le{constructor(){this.hashSeed=2166136261,this.hashPrime=16777619,this.cache=new Map}computeHash(e){let r=this.hashSeed;for(let n=0;n<e.length;n++)r^=e.charCodeAt(n),r=Math.imul(r>>>0,this.hashPrime)>>>0;return(r>>>0).toString(16)}getOrCreateUrlForJs(e,r){const n=this.computeHash(e),t=this.cache.get(n);if(t)return{url:t,hash:n};const s=`${e}
1
+ import{K as _,r as u,W as ao,cw as W,cu as co,aN as io,l as lo,j as m,X as U,V as fo,cx as go,F as D,aO as V}from"./index.01VsD2h1.js";function Co(o,e,r,n){for(var t=-1,s=o==null?0:o.length;++t<s;)r=e(r,o[t],t,o);return r}function xo(o){return function(e){return o?.[e]}}var po={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},ho=xo(po),mo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bo="\\u0300-\\u036f",So="\\ufe20-\\ufe2f",yo="\\u20d0-\\u20ff",Ro=bo+So+yo,Eo="["+Ro+"]",Fo=RegExp(Eo,"g");function wo(o){return o=_(o),o&&o.replace(mo,ho).replace(Fo,"")}var vo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function ko(o){return o.match(vo)||[]}var Bo=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function To(o){return Bo.test(o)}var H="\\ud800-\\udfff",zo="\\u0300-\\u036f",Ao="\\ufe20-\\ufe2f",Uo="\\u20d0-\\u20ff",Io=zo+Ao+Uo,J="\\u2700-\\u27bf",Z="a-z\\xdf-\\xf6\\xf8-\\xff",Oo="\\xac\\xb1\\xd7\\xf7",Wo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Lo="\\u2000-\\u206f",Mo=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",G="A-Z\\xc0-\\xd6\\xd8-\\xde",jo="\\ufe0e\\ufe0f",K=Oo+Wo+Lo+Mo,Y="['’]",L="["+K+"]",$o="["+Io+"]",q="\\d+",No="["+J+"]",X="["+Z+"]",Q="[^"+H+K+q+J+Z+G+"]",Po="\\ud83c[\\udffb-\\udfff]",_o="(?:"+$o+"|"+Po+")",Do="[^"+H+"]",oo="(?:\\ud83c[\\udde6-\\uddff]){2}",eo="[\\ud800-\\udbff][\\udc00-\\udfff]",w="["+G+"]",Vo="\\u200d",M="(?:"+X+"|"+Q+")",Ho="(?:"+w+"|"+Q+")",j="(?:"+Y+"(?:d|ll|m|re|s|t|ve))?",$="(?:"+Y+"(?:D|LL|M|RE|S|T|VE))?",ro=_o+"?",to="["+jo+"]?",Jo="(?:"+Vo+"(?:"+[Do,oo,eo].join("|")+")"+to+ro+")*",Zo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Go="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ko=to+ro+Jo,Yo="(?:"+[No,oo,eo].join("|")+")"+Ko,qo=RegExp([w+"?"+X+"+"+j+"(?="+[L,w,"$"].join("|")+")",Ho+"+"+$+"(?="+[L,w+M,"$"].join("|")+")",w+"?"+M+"+"+j,w+"+"+$,Go,Zo,q,Yo].join("|"),"g");function Xo(o){return o.match(qo)||[]}function Qo(o,e,r){return o=_(o),e=e,e===void 0?To(o)?Xo(o):ko(o):o.match(e)||[]}var oe="['’]",ee=RegExp(oe,"g");function re(o){return function(e){return Co(Qo(wo(e).replace(ee,"")),o,"")}}var te=re(function(o,e,r){return o+(r?"-":"")+e.toLowerCase()});const k=u.createContext(null);k.displayName="BidiComponentContext";const v=ao.getLogger("BidiComponent"),N="__",z="__streamlit_arrow_ref__",ne="$$STREAMLIT_INTERNAL_KEY",se=(o,e)=>{if(o&&typeof o=="object"&&!Array.isArray(o)){if(typeof o[z]=="string"){const n=o[z],t=e[n];if(t)try{return W(t)}catch{return null}return null}const r={};for(const[n,t]of Object.entries(o))if(t&&typeof t=="object"&&!Array.isArray(t)&&typeof t[z]=="string"){const s=t[z],a=e[s];if(a)try{r[n]=W(a)}catch{r[n]=null}else r[n]=null}else r[n]=t;return r}return o},ue=({arrowBlobs:o,arrowData:e,bytes:r,data:n,json:t,mixedJson:s})=>{switch(n){case"json":return t?JSON.parse(t):null;case"arrowData":return e??null;case"bytes":return r??null;case"mixed":{if(s&&o){const a=JSON.parse(s),i={};return Object.entries(o).forEach(([l,d])=>{d?.data&&(i[l]=d.data)}),se(a,i)}return null}case"any":case void 0:return null;default:co(n)}},ae=(o,e="--st")=>{const r={};return Object.entries(o).forEach(([n,t])=>{const s=te(n),a=`${e}-${s}`;if(typeof t=="boolean"){r[a]=t?"1":"0";return}if(t==null){r[a]="unset";return}if(Array.isArray(t)){r[a]=t.join(",");return}if(typeof t=="number"||typeof t=="string"){r[a]=String(t);return}r[a]="unset"}),r},ce=o=>{const e=[o.fontSizes.h1FontSize,o.fontSizes.h2FontSize,o.fontSizes.h3FontSize,o.fontSizes.h4FontSize,o.fontSizes.h5FontSize,o.fontSizes.h6FontSize],r=[o.fontWeights.h1FontWeight,o.fontWeights.h2FontWeight,o.fontWeights.h3FontWeight,o.fontWeights.h4FontWeight,o.fontWeights.h5FontWeight,o.fontWeights.h6FontWeight];return{primaryColor:o.colors.primary,backgroundColor:o.colors.bgColor,secondaryBackgroundColor:o.colors.secondaryBg,textColor:o.colors.bodyText,linkColor:o.colors.link,linkUnderline:o.linkUnderline,headingFont:o.genericFonts.headingFont,codeFont:o.genericFonts.codeFont,baseRadius:o.radii.default,buttonRadius:o.radii.button,baseFontSize:typeof o.fontSizes.baseFontSize=="number"?`${o.fontSizes.baseFontSize}px`:String(o.fontSizes.baseFontSize),baseFontWeight:o.fontWeights.normal,codeFontWeight:o.fontWeights.code,codeFontSize:o.fontSizes.codeFontSize,headingFontSizes:e,headingFontSize1:e[0],headingFontSize2:e[1],headingFontSize3:e[2],headingFontSize4:e[3],headingFontSize5:e[4],headingFontSize6:e[5],headingFontWeights:r,headingFontWeight1:r[0],headingFontWeight2:r[1],headingFontWeight3:r[2],headingFontWeight4:r[3],headingFontWeight5:r[4],headingFontWeight6:r[5],borderColor:o.colors.borderColor,dataframeBorderColor:o.colors.dataframeBorderColor,dataframeHeaderBackgroundColor:o.colors.dataframeHeaderBackgroundColor,codeBackgroundColor:o.colors.codeBackgroundColor,font:o.genericFonts.bodyFont,chartCategoricalColors:o.colors.chartCategoricalColors,chartSequentialColors:o.colors.chartSequentialColors,headingColor:o.colors.headingColor,borderColorLight:o.colors.borderColorLight,codeTextColor:o.colors.codeTextColor,widgetBorderColor:o.colors.widgetBorderColor||"transparent",redColor:o.colors.redColor,orangeColor:o.colors.orangeColor,yellowColor:o.colors.yellowColor,blueColor:o.colors.blueColor,greenColor:o.colors.greenColor,violetColor:o.colors.violetColor,grayColor:o.colors.grayColor,redBackgroundColor:o.colors.redBackgroundColor,orangeBackgroundColor:o.colors.orangeBackgroundColor,yellowBackgroundColor:o.colors.yellowBackgroundColor,blueBackgroundColor:o.colors.blueBackgroundColor,greenBackgroundColor:o.colors.greenBackgroundColor,violetBackgroundColor:o.colors.violetBackgroundColor,grayBackgroundColor:o.colors.grayBackgroundColor,redTextColor:o.colors.redTextColor,orangeTextColor:o.colors.orangeTextColor,yellowTextColor:o.colors.yellowTextColor,blueTextColor:o.colors.blueTextColor,greenTextColor:o.colors.greenTextColor,violetTextColor:o.colors.violetTextColor,grayTextColor:o.colors.grayTextColor}},ie=u.memo(({element:o,children:e,widgetMgr:r,fragmentId:n,componentRegistry:t})=>{const{arrowData:s,bytes:a,componentName:i,cssContent:l,cssSourcePath:d,data:f,htmlContent:g,id:c,jsContent:b,json:p,jsSourcePath:h,mixed:C}=o,R=u.useMemo(()=>({id:o.id,formId:o.formId}),[o.id,o.formId]),B=u.useCallback(()=>{const F=r.getJsonValue(R);if(!F)return{};try{return JSON.parse(F)}catch(I){const y=io(I);return v.warn("Failed to parse widget JSON value; returning empty object.",{widgetId:R.id,formId:R.formId,error:y.message}),{}}},[R,r]),T=u.useMemo(()=>ue({arrowBlobs:C?.arrowBlobs||void 0,arrowData:s?.data||void 0,bytes:a,data:f,json:p,mixedJson:C?.json||void 0}),[f,p,s?.data,a,C?.json,C?.arrowBlobs]),S=lo(),E=u.useMemo(()=>ce(S),[S]),x=u.useMemo(()=>({componentName:i,componentRegistry:t,cssContent:l?.trim(),cssSourcePath:d||void 0,data:T,fragmentId:n,getWidgetValue:B,htmlContent:g?.trim(),id:c,formId:o.formId||void 0,jsContent:b||void 0,jsSourcePath:h||void 0,theme:E,widgetMgr:r}),[i,t,l,d,n,B,g,c,o.formId,b,h,T,E,r]);return m(k.Provider,{value:x,children:e})}),no=(o,e)=>{if(o instanceof Error)return o;const r=e?`${e}: ${String(o)}`:String(o);return new Error(r)},A=(o,e,r)=>{const n=no(o,r);v.error(`BidiComponent Error: ${n.message}`,o),e(n)},de=(o,e)=>{try{const n=document.createRange().createContextualFragment(o);e.appendChild(n)}catch(r){v.warn("createContextualFragment failed, falling back to innerHTML",r),e.innerHTML=o}},so=({containerRef:o,setError:e,skip:r=!1})=>{const n=u.useRef(null),{htmlContent:t,cssContent:s,cssSourcePath:a,componentName:i,componentRegistry:{getBidiComponentURL:l}}=U(k),d=u.useMemo(()=>{if(a)return l(i,a)},[i,a,l]),f=fo(d);return u.useEffect(()=>{if(r)return;const g=o.current;if(g)try{if(n.current?.parentNode===g&&g.removeChild(n.current),n.current=document.createElement("div"),t){const c=document.createElement("div");de(t,c),n.current.appendChild(c)}if(s){const c=document.createElement("style");c.textContent=s,n.current.appendChild(c)}else if(d){const c=document.createElement("link");c.href=d,c.rel="stylesheet",f&&(c.crossOrigin=f),c.onerror=()=>{A(new Error(`Failed to load CSS from ${d}`),e)},n.current.appendChild(c)}g.appendChild(n.current)}catch(c){A(c,e,"Failed to process HTML/CSS content")}},[t,s,o,f,d,e,r]),n};class le{constructor(){this.hashSeed=2166136261,this.hashPrime=16777619,this.cache=new Map}computeHash(e){let r=this.hashSeed;for(let n=0;n<e.length;n++)r^=e.charCodeAt(n),r=Math.imul(r>>>0,this.hashPrime)>>>0;return(r>>>0).toString(16)}getOrCreateUrlForJs(e,r){const n=this.computeHash(e),t=this.cache.get(n);if(t)return{url:t,hash:n};const s=`${e}
2
2
  //# sourceURL=${r}-${n}.js`,a=new Blob([s],{type:"text/javascript"}),i=URL.createObjectURL(a);return this.cache.set(n,i),{url:i,hash:n}}}const fe=new le,ge="events";function Ce(o){if(o.includes(N))throw new Error("Base component id must not contain the delimiter sequence");return`${ne}_${o}${N}${ge}`}const P=async({componentId:o,componentIdForWidgetMgr:e,componentName:r,data:n,formId:t,fragmentId:s,getWidgetValue:a,moduleUrl:i,parentElement:l,widgetMgr:d})=>{const f=await import(i);if(!f)throw new Error("JS module does not exist.");if(!f.default||typeof f.default!="function")throw new Error("JS module does not have a default export function.");const g=(b,p)=>{let h={};try{h={...a(),[b]:p}}catch(C){v.error(`Failed to get existing value for ${b}`,C),h={[b]:p}}d.setJsonValue({id:e,formId:t},h,{fromUi:!0},s)},c=(b,p)=>{if(t){v.warn("BidiComponent: setTriggerValue ignored inside st.form. Triggers are not allowed in forms; use setStateValue and form submit instead.");return}const h=Ce(e);d.setTriggerValue({id:h,formId:t},{fromUi:!0},s,{event:b,value:p})};return f.default({name:r,data:n,key:o,parentElement:l,setStateValue:g,setTriggerValue:c})},uo=({containerRef:o,setError:e,skip:r=!1})=>{const t=`st-bidi-component-${u.useMemo(()=>go(),[])}`,{componentName:s,data:a,formId:i,fragmentId:l,getWidgetValue:d,id:f,jsContent:g,jsSourcePath:c,theme:b,widgetMgr:p,componentRegistry:{getBidiComponentURL:h}}=U(k),C=u.useMemo(()=>{if(c)return h(s,c)},[s,c,h]),R=u.useRef(),B=u.useRef(),T=u.useRef(!1);u.useEffect(()=>{const{current:S}=o;if(r||!g&&!C||!S)return;(async()=>{try{if(g){const{url:x}=fe.getOrCreateUrlForJs(g,`st-bidi-${s}`);R.current=await P({componentId:t,componentIdForWidgetMgr:f,componentName:s,data:a,formId:i,fragmentId:l,getWidgetValue:d,moduleUrl:x,parentElement:S,widgetMgr:p})}else if(C){const x=C;try{await new Promise((F,I)=>{const y=document.createElement("script");y.type="module",y.src=x,y.async=!0,y.onload=()=>F(),y.onerror=()=>I(new Error(`Failed to load script from ${C}`)),document.head.appendChild(y),B.current=y}),R.current=await P({componentId:t,componentIdForWidgetMgr:f,componentName:s,data:a,formId:i,fragmentId:l,getWidgetValue:d,moduleUrl:x,parentElement:S,widgetMgr:p})}catch(F){throw no(F,`Failed to load or execute script from ${C}`)}}}catch(x){T.current||A(x,e)}})()},[t,s,o,a,i,l,d,f,g,C,e,r,p,b]),u.useEffect(()=>()=>{T.current=!0;const S=R.current;S&&Promise.resolve(S).then(x=>{x?.()}).catch(x=>{v.error("Failed to run custom component cleanup",x)});const E=B.current;E?.parentNode&&E.parentNode.removeChild(E)},[])},xe=D("div",{target:"epzkg1s0"})(({cssCustomProperties:o})=>({...o,display:"contents"})),O=D("div",{target:"epzkg1s1"})({width:"100%",height:"100%"}),pe=u.memo(()=>{const o=u.useRef(null),e=u.useRef(null),[r,n]=u.useState(!1),[t,s]=u.useState(null),{id:a}=U(k);u.useEffect(()=>{if(o.current)try{if(o.current.shadowRoot){e.current=o.current.shadowRoot,n(!0);return}e.current=o.current.attachShadow({mode:"open"}),n(!0)}catch(l){A(l,s,"Failed to create shadow DOM")}},[a]);const i=!r||!!t;return so({containerRef:e,setError:s,skip:i}),uo({containerRef:e,setError:s,skip:i}),t?m(V,{name:"BidiComponent Error",message:t.message,stack:t.stack}):m(O,{ref:o,"data-testid":"stBidiComponentIsolated"})}),he=u.memo(()=>{const o=u.useRef(null),[e,r]=u.useState(null),n=!!e;return so({containerRef:o,setError:r,skip:n}),uo({containerRef:o,setError:r,skip:n}),e?m(V,{name:"BidiComponent Error",message:e.message,stack:e.stack}):m(O,{ref:o,"data-testid":"stBidiComponentRegular"})}),me=({children:o})=>{const{theme:e}=U(k),r=u.useMemo(()=>ae(e),[e]);return m(xe,{cssCustomProperties:r,children:o})},be=({element:o,widgetMgr:e,fragmentId:r,componentRegistry:n})=>{const{isolateStyles:t}=o;return m(ie,{element:o,widgetMgr:e,fragmentId:r,componentRegistry:n,children:m(O,{className:"stBidiComponent",children:m(me,{children:t?m(pe,{}):m(he,{})})})})},ye=u.memo(be);export{k as BidiComponentContext,ye as default};
@@ -1 +1 @@
1
- import{r as h,l as $,aB as ht,L as gt,e as tt,o as mt,j as T,p as wt,ac as bt,ad as pt,ay as yt,af as Dt,aA as Ot,P as xt,az as kt,q as St,m as Tt}from"./index.BZBWLU1C.js";import{h as P}from"./moment.C7qA8nIE.js";import{u as Mt}from"./useBasicWidgetState.D6_b0IqA.js";import{e as Ct,u as Yt,D as Wt,a as Et}from"./useIntlLocale.Ctz17A7g.js";import{E as Pt}from"./ErrorOutline.esm.BcqUpfNe.js";import"./FormClearHelper.Cm3GDSk6.js";import"./timepicker.CDks5DWI.js";import"./input.BoJqOS7a.js";import"./base-input.BX9Jll5o.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"})}},At=(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))},$t={p:at,P:At},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=$t[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=$(),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}=$(),{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]),A=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(A(W)),f({value:E,fromUi:!0}),y(!E)},[f,A,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 $,aB as ht,L as gt,e as tt,o as mt,j as T,p as wt,ac as bt,ad as pt,ay as yt,af as Dt,aA as Ot,P as xt,az as kt,q as St,m as Tt}from"./index.01VsD2h1.js";import{h as P}from"./moment.C7qA8nIE.js";import{u as Mt}from"./useBasicWidgetState.DrTKs46R.js";import{e as Ct,u as Yt,D as Wt,a as Et}from"./useIntlLocale.CmSionuT.js";import{E as Pt}from"./ErrorOutline.esm.D0HiUB0L.js";import"./FormClearHelper.By4vKj6A.js";import"./timepicker.gie5YwtP.js";import"./input.27t-DftI.js";import"./base-input.CHPo5oJ1.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"})}},At=(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))},$t={p:at,P:At},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=$t[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=$(),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}=$(),{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]),A=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(A(W)),f({value:E,fromUi:!0}),y(!E)},[f,A,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{F as i,a4 as m,r as c,j as n,b4 as p}from"./index.BZBWLU1C.js";import{P as d,R as f}from"./Particles.vAUDtAR8.js";const g=""+new URL("../media/balloon-0.Czj7AKwE.png",import.meta.url).href,B=""+new URL("../media/balloon-1.CNvFFrND.png",import.meta.url).href,h=""+new URL("../media/balloon-2.DTvC6B1t.png",import.meta.url).href,L=""+new URL("../media/balloon-3.CgSk4tbL.png",import.meta.url).href,u=""+new URL("../media/balloon-4.mbtFrzxf.png",import.meta.url).href,x=""+new URL("../media/balloon-5.CSwkUfRA.png",import.meta.url).href,t=300,e=121,s=20,A=80,_=1e3,b=m("from{transform:translateY(calc(100vh + ",t,"px));}to{transform:translateY(0);}"),I=i("img",{target:"e19msdho0"})(({theme:o})=>({position:"fixed",top:`${-t}px`,marginLeft:`${-e/2}px`,zIndex:o.zIndices.balloons,left:`${Math.random()*(A-s)+s}vw`,animationDelay:`${Math.random()*_}ms`,height:`${t}px`,width:`${e}px`,pointerEvents:"none",animationDuration:"750ms",animationName:b,animationTimingFunction:"ease-in",animationDirection:"normal",animationIterationCount:1,opacity:1})),M=30,l=[g,B,h,L,u,x],w=l.length,E=({particleType:o,resourceCrossOriginMode:r})=>{const a=l[o];return n(I,{src:a,crossOrigin:p(r,a)})},N=({scriptRunId:o})=>n(f,{children:n(d,{className:"stBalloons","data-testid":"stBalloons",scriptRunId:o,numParticleTypes:w,numParticles:M,ParticleComponent:E})}),P=c.memo(N);export{M as NUM_BALLOONS,P as default};
1
+ import{F as i,a4 as m,r as c,j as n,b4 as p}from"./index.01VsD2h1.js";import{P as d,R as f}from"./Particles.2-EdjYhR.js";const g=""+new URL("../media/balloon-0.Czj7AKwE.png",import.meta.url).href,B=""+new URL("../media/balloon-1.CNvFFrND.png",import.meta.url).href,h=""+new URL("../media/balloon-2.DTvC6B1t.png",import.meta.url).href,L=""+new URL("../media/balloon-3.CgSk4tbL.png",import.meta.url).href,u=""+new URL("../media/balloon-4.mbtFrzxf.png",import.meta.url).href,x=""+new URL("../media/balloon-5.CSwkUfRA.png",import.meta.url).href,t=300,e=121,s=20,A=80,_=1e3,b=m("from{transform:translateY(calc(100vh + ",t,"px));}to{transform:translateY(0);}"),I=i("img",{target:"e19msdho0"})(({theme:o})=>({position:"fixed",top:`${-t}px`,marginLeft:`${-e/2}px`,zIndex:o.zIndices.balloons,left:`${Math.random()*(A-s)+s}vw`,animationDelay:`${Math.random()*_}ms`,height:`${t}px`,width:`${e}px`,pointerEvents:"none",animationDuration:"750ms",animationName:b,animationTimingFunction:"ease-in",animationDirection:"normal",animationIterationCount:1,opacity:1})),M=30,l=[g,B,h,L,u,x],w=l.length,E=({particleType:o,resourceCrossOriginMode:r})=>{const a=l[o];return n(I,{src:a,crossOrigin:p(r,a)})},N=({scriptRunId:o})=>n(f,{children:n(d,{className:"stBalloons","data-testid":"stBalloons",scriptRunId:o,numParticleTypes:w,numParticles:M,ParticleComponent:E})}),P=c.memo(N);export{M as NUM_BALLOONS,P as default};
@@ -1 +1 @@
1
- import{r as t,E as L,_ as D,L as ze,e as ue,n as F,aN as se,bX as Le,bT as De,bS as Be,F as p,j as n,Z as Ve,o as x,B as We,az as Ne,b as Me,l as Oe,ab as He,p as $e,ac as je,P as _e,ad as Xe}from"./index.BZBWLU1C.js";import{u as Ge}from"./useWaveformController.vLi36Ir4.js";import{T as qe,a as ce}from"./Toolbar.CuMH-Gqe.js";import{u as Ke,F as Ze}from"./FormClearHelper.Cm3GDSk6.js";import{c as Je}from"./createDownloadLinkElement.CviG5BQx.js";import{E as Qe}from"./urls.BwSlolu9.js";import{F as Ye,D as et}from"./FileDownload.esm.CtJWBuub.js";var fe=t.forwardRef(function(e,r){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return t.createElement(L,D({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),t.createElement("g",{fill:"none"},t.createElement("rect",{width:24,height:24}),t.createElement("rect",{width:24,height:24}),t.createElement("rect",{width:24,height:24})),t.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),t.createElement("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});fe.displayName="Mic";var pe=t.forwardRef(function(e,r){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return t.createElement(L,D({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),t.createElement("rect",{width:24,height:24,fill:"none"}),t.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))});pe.displayName="Pause";var me=t.forwardRef(function(e,r){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return t.createElement(L,D({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),t.createElement("rect",{width:24,height:24,fill:"none"}),t.createElement("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 000-1.69L9.54 5.98A.998.998 0 008 6.82z"}))});me.displayName="PlayArrow";var ge=t.forwardRef(function(e,r){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return t.createElement(L,D({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),t.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),t.createElement("path",{d:"M17.65 6.35a7.95 7.95 0 00-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 007.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 01-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0112 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z"}))});ge.displayName="Refresh";var he=t.forwardRef(function(e,r){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return t.createElement(L,D({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),t.createElement("g",{fill:"none"},t.createElement("rect",{width:24,height:24}),t.createElement("rect",{width:24,height:24})),t.createElement("path",{fillRule:"evenodd",d:"M9 16h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}))});he.displayName="StopCircle";const tt=(e,r)=>{const{enforceDownloadInNewTab:o=!1}=t.useContext(ze);return t.useCallback(()=>{if(!e)return;const l=Je({enforceDownloadInNewTab:o,url:e,filename:r});l.style.display="none",document.body.appendChild(l),l.click(),document.body.removeChild(l)},[e,o,r])},j=({widgetMgr:e,id:r,formId:o,key:i,defaultValue:l})=>{t.useEffect(()=>{const s=e.getElementState(r,i);ue(s)&&F(l)&&e.setElementState(r,i,l)},[e,r,i,l]);const[R,g]=t.useState(e.getElementState(r,i)??l),c=t.useCallback(s=>{e.setElementState(r,i,s),g(s)},[e,r,i]),v=t.useMemo(()=>({formId:o||""}),[o]),E=t.useCallback(()=>c(l),[l,c]);return Ke({element:v,widgetMgr:e,onFormCleared:E}),[R,c]},rt=async({files:e,uploadClient:r,widgetMgr:o,widgetInfo:i,fragmentId:l,signal:R})=>{let g=[];try{g=await r.fetchFileURLs(e)}catch(s){return{successfulUploads:[],failedUploads:e.map(d=>({file:d,error:se(s)}))}}const c=Le(e,g),v=[],E=[];return await Promise.all(c.map(async([s,d])=>{if(!s||!d?.uploadUrl||!d.fileId)return{file:s,fileUrl:d,error:new Error("No upload URL found")};try{await r.uploadFile({id:d.fileId,formId:i.formId||""},d.uploadUrl,s,void 0,R),v.push({fileUrl:d,file:s})}catch(h){const O=se(h);E.push({file:s,error:O})}})),o.setFileUploaderStateValue(i,new De({uploadedFileInfo:v.map(({file:s,fileUrl:d})=>new Be({fileId:d.fileId,fileUrls:d,name:s.webkitRelativePath||s.name,size:s.size}))}),{fromUi:!0},l),{successfulUploads:v,failedUploads:E}},ot=p("div",{target:"e18uw4vz0"})(),de=p("div",{target:"e18uw4vz1"})(({theme:e,disabled:r})=>({height:e.sizes.largestElementHeight,width:"100%",background:e.colors.secondaryBg,borderRadius:e.radii.default,marginBottom:e.spacing.twoXS,display:"flex",alignItems:"center",position:"relative",paddingLeft:e.spacing.xs,paddingRight:e.spacing.sm,border:e.colors.widgetBorderColor?`${e.sizes.borderWidth} solid ${e.colors.widgetBorderColor}`:void 0,cursor:r?"not-allowed":"auto",overflow:"hidden"})),nt=p("div",{target:"e18uw4vz2"})({flex:1}),at=p("div",{target:"e18uw4vz3"})(({show:e,theme:r})=>({display:e?"block":"none",position:"relative",height:r.sizes.largestElementHeight,"& > div":{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center"}})),lt=p("span",{target:"e18uw4vz4"})(({theme:e,isPlayingOrRecording:r,disabled:o})=>({margin:e.spacing.sm,fontFamily:e.fonts.monospace,color:o?e.colors.fadedText40:r?e.colors.bodyText:e.colors.fadedText60,backgroundColor:e.colors.secondaryBg,fontSize:e.fontSizes.sm})),be=p("div",{target:"e18uw4vz5"})({width:"100%",textAlign:"center",overflow:"hidden"}),ve=p("span",{target:"e18uw4vz6"})(({theme:e})=>({color:e.colors.bodyText})),it=p("a",{target:"e18uw4vz7"})(({theme:e})=>({color:e.colors.link,textDecoration:e.linkUnderline?"underline":"none"})),st=p("div",{target:"e18uw4vz8"})(({theme:e})=>({flex:1,height:e.sizes.largestElementHeight,display:"flex",justifyContent:"center",alignItems:"center"})),ct=p("div",{target:"e18uw4vz9"})(({theme:e})=>{const r="0.625em";return{opacity:.2,width:"100%",height:r,backgroundSize:r,backgroundImage:`radial-gradient(${e.colors.fadedText10} 40%, transparent 40%)`,backgroundRepeat:"repeat"}}),dt=p("span",{target:"e18uw4vz10"})(({theme:e})=>({"& > button":{color:e.colors.primary,padding:e.spacing.threeXS},"& > button:hover, & > button:focus":{color:e.colors.redColor}})),ut=p("span",{target:"e18uw4vz11"})(({theme:e})=>({"& > button":{padding:e.spacing.threeXS,color:e.colors.fadedText60},"& > button:hover, & > button:focus":{color:e.colors.bodyText}})),ye=p("span",{target:"e18uw4vz12"})(({theme:e})=>({"& > button":{padding:e.spacing.threeXS,color:e.colors.fadedText60},"& > button:hover, & > button:focus":{color:e.colors.bodyText}})),_=p("div",{target:"e18uw4vz13"})(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",flexGrow:0,flexShrink:1,padding:e.spacing.xs,gap:e.spacing.twoXS,marginRight:e.spacing.twoXS})),z=({onClick:e,disabled:r,ariaLabel:o,iconContent:i})=>n(Me,{kind:We.BORDERLESS_ICON,onClick:e,disabled:r,"aria-label":o,containerWidth:!0,"data-testid":"stAudioInputActionButton",children:n(Ne,{content:i,size:"lg",color:"inherit"})}),ft=({disabled:e,stopRecording:r})=>n(dt,{children:n(z,{onClick:r,disabled:e,ariaLabel:"Stop recording",iconContent:he})}),pt=({disabled:e,isPlaying:r,onClickPlayPause:o})=>n(ye,{children:r?n(z,{onClick:o,disabled:e,ariaLabel:"Pause",iconContent:pe}):n(z,{onClick:o,disabled:e,ariaLabel:"Play",iconContent:me})}),mt=({disabled:e,startRecording:r})=>n(ut,{children:n(z,{onClick:r,disabled:e,ariaLabel:"Record",iconContent:fe})}),gt=({onClick:e})=>n(ye,{children:n(z,{disabled:!1,onClick:e,ariaLabel:"Reset",iconContent:ge})}),ht=({disabled:e,isRecording:r,isPlaying:o,isUploading:i,isError:l,recordingUrlExists:R,startRecording:g,stopRecording:c,onClickPlayPause:v,onClear:E})=>l?n(_,{children:n(gt,{onClick:E})}):i?n(_,{children:n(Ve,{size:"base",iconValue:"spinner"})}):x(_,{children:[r?n(ft,{disabled:e,stopRecording:c}):n(mt,{disabled:e,startRecording:g}),R&&n(pt,{disabled:e,isPlaying:o,onClickPlayPause:v})]}),bt=t.memo(ht),vt=()=>n(be,{children:n(ve,{children:"An error has occurred, please try again."})}),yt=t.memo(vt),C="00:00",A=e=>{const r=Math.floor(e/1e3),o=Math.floor(r/60),i=Math.floor(o/60),l=r%60,R=o%60,g=l.toString().padStart(2,"0"),c=R.toString().padStart(2,"0"),v=i.toString().padStart(2,"0");return o<60?`${c}:${g}`:`${v}:${c}:${g}`},wt=()=>x(be,{children:[n(ve,{children:"This app would like to use your microphone."})," ",n(it,{href:Qe,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]}),St=t.memo(wt),Ct=()=>n(st,{children:n(ct,{})}),Rt=t.memo(Ct),Et=({element:e,uploadClient:r,widgetMgr:o,fragmentId:i,disabled:l})=>{const R=Oe(),g=t.useRef(null),[c,v]=t.useState(!1),[E,s]=t.useState(!1),[d,h]=t.useState(!1),[O,b]=t.useState(C),[B,V]=j({widgetMgr:o,id:e.id,key:"deleteFileUrl",defaultValue:null}),[m,W]=j({widgetMgr:o,id:e.id,key:"recordingUrl",defaultValue:null}),[H,I]=j({widgetMgr:o,id:e.id,formId:e.formId,key:"recordingTime",defaultValue:C}),U=t.useRef(null),w=t.useRef(null),u=t.useRef(null),X=e.id,S=e.formId,we=t.useCallback(async a=>{U.current&&U.current.abort();const y=new AbortController;U.current=y;try{if(s(!0),F(S)&&o.setFormsWithUploadsInProgress(new Set([S])),y.signal.aborted)return;let f;try{f=URL.createObjectURL(a),w.current&&w.current!==f&&URL.revokeObjectURL(w.current),w.current=f}catch{h(!0),s(!1),F(S)&&o.setFormsWithUploadsInProgress(new Set);return}if(y.signal.aborted){URL.revokeObjectURL(f),w.current=null;return}W(f);const Pe=new Date().toISOString().slice(0,16).replace(/:/g,"-"),Fe=new File([a],`${Pe}_audio.wav`,{type:a.type});try{const{successfulUploads:xe,failedUploads:Te}=await rt({files:[Fe],uploadClient:r,widgetMgr:o,widgetInfo:{id:X,formId:S},fragmentId:i,signal:y.signal});if(y.signal.aborted)return;if(Te.length>0){h(!0);return}h(!1);const ie=xe[0];ie?.fileUrl?.deleteUrl&&V(ie.fileUrl.deleteUrl)}catch{y.signal.aborted||h(!0)}finally{F(S)&&o.setFormsWithUploadsInProgress(new Set),y.signal.aborted||s(!1)}}catch{y.signal.aborted||(h(!0),s(!1)),F(S)&&o.setFormsWithUploadsInProgress(new Set)}},[r,o,X,S,i,V,W]),N=t.useRef(null),G=Ge({containerRef:g,sampleRate:e.sampleRate??void 0,waveformPadding:He(R.spacing.twoXS),events:{onPermissionDenied:()=>{v(!0)},onError:()=>{h(!0)},onRecordStart:()=>{I(C),b(C)},onRecordReady:()=>{const a=A(N.current?.playback.getDurationMs()??0);I(a),b(a)},onApprove:we,onCancel:()=>{I(C),b(C)},onProgressMs:a=>{I(A(a))},onPlaybackPause:()=>{b(A(N.current?.playback.getCurrentTimeMs()??0))},onPlaybackFinish:()=>{b(A(N.current?.playback.getDurationMs()??0))}}});N.current=G;const{state:M,isPlaybackPlaying:P,start:q,stop:K,approve:Z,cancel:J,playback:{play:Q,pause:Y,load:ee,getCurrentTimeMs:T,getDurationMs:te}}=G,k=t.useCallback(async({updateWidgetManager:a,deleteFile:y})=>{const f=m;if(f&&w.current===f&&(URL.revokeObjectURL(f),w.current=null),u.current&&(cancelAnimationFrame(u.current),u.current=null),W(null),V(null),b(C),I(C),J(),a&&o.setFileUploaderStateValue(e,{},{fromUi:!0},i),y&&B)try{await r.deleteFile(B)}catch{}F(f)&&URL.revokeObjectURL(f)},[B,m,r,J,e,o,i,I,V,W]);t.useEffect(()=>{const a=()=>{P&&(b(A(T())),u.current=requestAnimationFrame(a))};return P?u.current=requestAnimationFrame(a):u.current&&(cancelAnimationFrame(u.current),u.current=null),()=>{u.current&&(cancelAnimationFrame(u.current),u.current=null)}},[P,T]),t.useEffect(()=>{if(!m)return;let a=!1;return b(H),(async()=>{try{if(await ee(m),a)return;const f=te();f>0&&b(A(f))}catch{a||h(!0)}})(),()=>{a=!0}},[m,H,ee,te]),t.useEffect(()=>{if(ue(S))return;const a=new Ze;return a.manageFormClearListener(o,S,()=>{k({updateWidgetManager:!0,deleteFile:!1})}),()=>a.disconnect()},[S,k,o]),t.useEffect(()=>()=>{U.current&&(U.current.abort(),U.current=null),u.current&&(cancelAnimationFrame(u.current),u.current=null),w.current&&(URL.revokeObjectURL(w.current),w.current=null)},[]);const Se=t.useCallback(async()=>{try{if(P){const a=T();Y(),b(A(a))}else M==="idle"&&m&&(T()<=100&&b(C),await Q())}catch{h(!0)}},[P,T,Y,Q,m,M]),re=t.useCallback(async()=>{m&&await k({updateWidgetManager:!1,deleteFile:!0});try{b(C),await q()}catch{}},[k,m,q]),oe=t.useCallback(async()=>{try{const{blob:a}=await K();await Z(a)}catch{h(!0)}},[Z,K]),ne=tt(m,"recording.wav"),Ce=t.useCallback(()=>{re()},[re]),Re=t.useCallback(()=>{oe()},[oe]),Ee=t.useCallback(()=>{k({updateWidgetManager:!1,deleteFile:!0}),h(!1)},[k]),ke=t.useCallback(()=>{ne()},[ne]),Ae=t.useCallback(()=>{k({updateWidgetManager:!0,deleteFile:!0})},[k]),$=M==="recording",ae=P,Ie=$?H:O,le=M==="idle"&&!c&&!m,Ue=c||le||d;return x(ot,{className:"stAudioInput","data-testid":"stAudioInput",children:[n(Xe,{label:e.label,disabled:l,labelVisibility:$e(e.labelVisibility?.value),children:e.help&&n(je,{content:e.help,placement:_e.TOP,label:e.label})}),x(de,{disabled:l,children:[x(qe,{isFullScreen:!1,disableFullscreenMode:!0,target:de,children:[m&&n(ce,{label:"Download as WAV",icon:Ye,onClick:ke}),B&&n(ce,{label:"Clear recording",icon:et,onClick:Ae})]}),n(bt,{isRecording:$,isPlaying:ae,isUploading:E,isError:d,recordingUrlExists:!!m,startRecording:Ce,stopRecording:Re,onClickPlayPause:()=>{Se()},onClear:Ee,disabled:l||c}),x(nt,{children:[d&&n(yt,{}),le&&n(Rt,{}),c&&n(St,{}),n(at,{"data-testid":"stAudioInputWaveSurfer",ref:g,show:!Ue})]}),n(lt,{isPlayingOrRecording:$||ae,disabled:l,"data-testid":"stAudioInputWaveformTimeCode",children:Ie})]})]})},Tt=t.memo(Et);export{Tt as default};
1
+ import{r as t,E as L,_ as D,L as ze,e as ue,n as F,aN as se,bX as Le,bT as De,bS as Be,F as p,j as n,Z as Ve,o as x,B as We,az as Ne,b as Me,l as Oe,ab as He,p as $e,ac as je,P as _e,ad as Xe}from"./index.01VsD2h1.js";import{u as Ge}from"./useWaveformController.D-KQLpLI.js";import{T as qe,a as ce}from"./Toolbar.CowuXIFr.js";import{u as Ke,F as Ze}from"./FormClearHelper.By4vKj6A.js";import{c as Je}from"./createDownloadLinkElement.BaE-_v8I.js";import{E as Qe}from"./urls.BwSlolu9.js";import{F as Ye,D as et}from"./FileDownload.esm.BuUS-pfi.js";var fe=t.forwardRef(function(e,r){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return t.createElement(L,D({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),t.createElement("g",{fill:"none"},t.createElement("rect",{width:24,height:24}),t.createElement("rect",{width:24,height:24}),t.createElement("rect",{width:24,height:24})),t.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),t.createElement("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});fe.displayName="Mic";var pe=t.forwardRef(function(e,r){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return t.createElement(L,D({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),t.createElement("rect",{width:24,height:24,fill:"none"}),t.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))});pe.displayName="Pause";var me=t.forwardRef(function(e,r){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return t.createElement(L,D({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),t.createElement("rect",{width:24,height:24,fill:"none"}),t.createElement("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 000-1.69L9.54 5.98A.998.998 0 008 6.82z"}))});me.displayName="PlayArrow";var ge=t.forwardRef(function(e,r){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return t.createElement(L,D({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),t.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),t.createElement("path",{d:"M17.65 6.35a7.95 7.95 0 00-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 007.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 01-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0112 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z"}))});ge.displayName="Refresh";var he=t.forwardRef(function(e,r){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return t.createElement(L,D({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),t.createElement("g",{fill:"none"},t.createElement("rect",{width:24,height:24}),t.createElement("rect",{width:24,height:24})),t.createElement("path",{fillRule:"evenodd",d:"M9 16h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}))});he.displayName="StopCircle";const tt=(e,r)=>{const{enforceDownloadInNewTab:o=!1}=t.useContext(ze);return t.useCallback(()=>{if(!e)return;const l=Je({enforceDownloadInNewTab:o,url:e,filename:r});l.style.display="none",document.body.appendChild(l),l.click(),document.body.removeChild(l)},[e,o,r])},j=({widgetMgr:e,id:r,formId:o,key:i,defaultValue:l})=>{t.useEffect(()=>{const s=e.getElementState(r,i);ue(s)&&F(l)&&e.setElementState(r,i,l)},[e,r,i,l]);const[R,g]=t.useState(e.getElementState(r,i)??l),c=t.useCallback(s=>{e.setElementState(r,i,s),g(s)},[e,r,i]),v=t.useMemo(()=>({formId:o||""}),[o]),E=t.useCallback(()=>c(l),[l,c]);return Ke({element:v,widgetMgr:e,onFormCleared:E}),[R,c]},rt=async({files:e,uploadClient:r,widgetMgr:o,widgetInfo:i,fragmentId:l,signal:R})=>{let g=[];try{g=await r.fetchFileURLs(e)}catch(s){return{successfulUploads:[],failedUploads:e.map(d=>({file:d,error:se(s)}))}}const c=Le(e,g),v=[],E=[];return await Promise.all(c.map(async([s,d])=>{if(!s||!d?.uploadUrl||!d.fileId)return{file:s,fileUrl:d,error:new Error("No upload URL found")};try{await r.uploadFile({id:d.fileId,formId:i.formId||""},d.uploadUrl,s,void 0,R),v.push({fileUrl:d,file:s})}catch(h){const O=se(h);E.push({file:s,error:O})}})),o.setFileUploaderStateValue(i,new De({uploadedFileInfo:v.map(({file:s,fileUrl:d})=>new Be({fileId:d.fileId,fileUrls:d,name:s.webkitRelativePath||s.name,size:s.size}))}),{fromUi:!0},l),{successfulUploads:v,failedUploads:E}},ot=p("div",{target:"e18uw4vz0"})(),de=p("div",{target:"e18uw4vz1"})(({theme:e,disabled:r})=>({height:e.sizes.largestElementHeight,width:"100%",background:e.colors.secondaryBg,borderRadius:e.radii.default,marginBottom:e.spacing.twoXS,display:"flex",alignItems:"center",position:"relative",paddingLeft:e.spacing.xs,paddingRight:e.spacing.sm,border:e.colors.widgetBorderColor?`${e.sizes.borderWidth} solid ${e.colors.widgetBorderColor}`:void 0,cursor:r?"not-allowed":"auto",overflow:"hidden"})),nt=p("div",{target:"e18uw4vz2"})({flex:1}),at=p("div",{target:"e18uw4vz3"})(({show:e,theme:r})=>({display:e?"block":"none",position:"relative",height:r.sizes.largestElementHeight,"& > div":{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center"}})),lt=p("span",{target:"e18uw4vz4"})(({theme:e,isPlayingOrRecording:r,disabled:o})=>({margin:e.spacing.sm,fontFamily:e.fonts.monospace,color:o?e.colors.fadedText40:r?e.colors.bodyText:e.colors.fadedText60,backgroundColor:e.colors.secondaryBg,fontSize:e.fontSizes.sm})),be=p("div",{target:"e18uw4vz5"})({width:"100%",textAlign:"center",overflow:"hidden"}),ve=p("span",{target:"e18uw4vz6"})(({theme:e})=>({color:e.colors.bodyText})),it=p("a",{target:"e18uw4vz7"})(({theme:e})=>({color:e.colors.link,textDecoration:e.linkUnderline?"underline":"none"})),st=p("div",{target:"e18uw4vz8"})(({theme:e})=>({flex:1,height:e.sizes.largestElementHeight,display:"flex",justifyContent:"center",alignItems:"center"})),ct=p("div",{target:"e18uw4vz9"})(({theme:e})=>{const r="0.625em";return{opacity:.2,width:"100%",height:r,backgroundSize:r,backgroundImage:`radial-gradient(${e.colors.fadedText10} 40%, transparent 40%)`,backgroundRepeat:"repeat"}}),dt=p("span",{target:"e18uw4vz10"})(({theme:e})=>({"& > button":{color:e.colors.primary,padding:e.spacing.threeXS},"& > button:hover, & > button:focus":{color:e.colors.redColor}})),ut=p("span",{target:"e18uw4vz11"})(({theme:e})=>({"& > button":{padding:e.spacing.threeXS,color:e.colors.fadedText60},"& > button:hover, & > button:focus":{color:e.colors.bodyText}})),ye=p("span",{target:"e18uw4vz12"})(({theme:e})=>({"& > button":{padding:e.spacing.threeXS,color:e.colors.fadedText60},"& > button:hover, & > button:focus":{color:e.colors.bodyText}})),_=p("div",{target:"e18uw4vz13"})(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",flexGrow:0,flexShrink:1,padding:e.spacing.xs,gap:e.spacing.twoXS,marginRight:e.spacing.twoXS})),z=({onClick:e,disabled:r,ariaLabel:o,iconContent:i})=>n(Me,{kind:We.BORDERLESS_ICON,onClick:e,disabled:r,"aria-label":o,containerWidth:!0,"data-testid":"stAudioInputActionButton",children:n(Ne,{content:i,size:"lg",color:"inherit"})}),ft=({disabled:e,stopRecording:r})=>n(dt,{children:n(z,{onClick:r,disabled:e,ariaLabel:"Stop recording",iconContent:he})}),pt=({disabled:e,isPlaying:r,onClickPlayPause:o})=>n(ye,{children:r?n(z,{onClick:o,disabled:e,ariaLabel:"Pause",iconContent:pe}):n(z,{onClick:o,disabled:e,ariaLabel:"Play",iconContent:me})}),mt=({disabled:e,startRecording:r})=>n(ut,{children:n(z,{onClick:r,disabled:e,ariaLabel:"Record",iconContent:fe})}),gt=({onClick:e})=>n(ye,{children:n(z,{disabled:!1,onClick:e,ariaLabel:"Reset",iconContent:ge})}),ht=({disabled:e,isRecording:r,isPlaying:o,isUploading:i,isError:l,recordingUrlExists:R,startRecording:g,stopRecording:c,onClickPlayPause:v,onClear:E})=>l?n(_,{children:n(gt,{onClick:E})}):i?n(_,{children:n(Ve,{size:"base",iconValue:"spinner"})}):x(_,{children:[r?n(ft,{disabled:e,stopRecording:c}):n(mt,{disabled:e,startRecording:g}),R&&n(pt,{disabled:e,isPlaying:o,onClickPlayPause:v})]}),bt=t.memo(ht),vt=()=>n(be,{children:n(ve,{children:"An error has occurred, please try again."})}),yt=t.memo(vt),C="00:00",A=e=>{const r=Math.floor(e/1e3),o=Math.floor(r/60),i=Math.floor(o/60),l=r%60,R=o%60,g=l.toString().padStart(2,"0"),c=R.toString().padStart(2,"0"),v=i.toString().padStart(2,"0");return o<60?`${c}:${g}`:`${v}:${c}:${g}`},wt=()=>x(be,{children:[n(ve,{children:"This app would like to use your microphone."})," ",n(it,{href:Qe,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]}),St=t.memo(wt),Ct=()=>n(st,{children:n(ct,{})}),Rt=t.memo(Ct),Et=({element:e,uploadClient:r,widgetMgr:o,fragmentId:i,disabled:l})=>{const R=Oe(),g=t.useRef(null),[c,v]=t.useState(!1),[E,s]=t.useState(!1),[d,h]=t.useState(!1),[O,b]=t.useState(C),[B,V]=j({widgetMgr:o,id:e.id,key:"deleteFileUrl",defaultValue:null}),[m,W]=j({widgetMgr:o,id:e.id,key:"recordingUrl",defaultValue:null}),[H,I]=j({widgetMgr:o,id:e.id,formId:e.formId,key:"recordingTime",defaultValue:C}),U=t.useRef(null),w=t.useRef(null),u=t.useRef(null),X=e.id,S=e.formId,we=t.useCallback(async a=>{U.current&&U.current.abort();const y=new AbortController;U.current=y;try{if(s(!0),F(S)&&o.setFormsWithUploadsInProgress(new Set([S])),y.signal.aborted)return;let f;try{f=URL.createObjectURL(a),w.current&&w.current!==f&&URL.revokeObjectURL(w.current),w.current=f}catch{h(!0),s(!1),F(S)&&o.setFormsWithUploadsInProgress(new Set);return}if(y.signal.aborted){URL.revokeObjectURL(f),w.current=null;return}W(f);const Pe=new Date().toISOString().slice(0,16).replace(/:/g,"-"),Fe=new File([a],`${Pe}_audio.wav`,{type:a.type});try{const{successfulUploads:xe,failedUploads:Te}=await rt({files:[Fe],uploadClient:r,widgetMgr:o,widgetInfo:{id:X,formId:S},fragmentId:i,signal:y.signal});if(y.signal.aborted)return;if(Te.length>0){h(!0);return}h(!1);const ie=xe[0];ie?.fileUrl?.deleteUrl&&V(ie.fileUrl.deleteUrl)}catch{y.signal.aborted||h(!0)}finally{F(S)&&o.setFormsWithUploadsInProgress(new Set),y.signal.aborted||s(!1)}}catch{y.signal.aborted||(h(!0),s(!1)),F(S)&&o.setFormsWithUploadsInProgress(new Set)}},[r,o,X,S,i,V,W]),N=t.useRef(null),G=Ge({containerRef:g,sampleRate:e.sampleRate??void 0,waveformPadding:He(R.spacing.twoXS),events:{onPermissionDenied:()=>{v(!0)},onError:()=>{h(!0)},onRecordStart:()=>{I(C),b(C)},onRecordReady:()=>{const a=A(N.current?.playback.getDurationMs()??0);I(a),b(a)},onApprove:we,onCancel:()=>{I(C),b(C)},onProgressMs:a=>{I(A(a))},onPlaybackPause:()=>{b(A(N.current?.playback.getCurrentTimeMs()??0))},onPlaybackFinish:()=>{b(A(N.current?.playback.getDurationMs()??0))}}});N.current=G;const{state:M,isPlaybackPlaying:P,start:q,stop:K,approve:Z,cancel:J,playback:{play:Q,pause:Y,load:ee,getCurrentTimeMs:T,getDurationMs:te}}=G,k=t.useCallback(async({updateWidgetManager:a,deleteFile:y})=>{const f=m;if(f&&w.current===f&&(URL.revokeObjectURL(f),w.current=null),u.current&&(cancelAnimationFrame(u.current),u.current=null),W(null),V(null),b(C),I(C),J(),a&&o.setFileUploaderStateValue(e,{},{fromUi:!0},i),y&&B)try{await r.deleteFile(B)}catch{}F(f)&&URL.revokeObjectURL(f)},[B,m,r,J,e,o,i,I,V,W]);t.useEffect(()=>{const a=()=>{P&&(b(A(T())),u.current=requestAnimationFrame(a))};return P?u.current=requestAnimationFrame(a):u.current&&(cancelAnimationFrame(u.current),u.current=null),()=>{u.current&&(cancelAnimationFrame(u.current),u.current=null)}},[P,T]),t.useEffect(()=>{if(!m)return;let a=!1;return b(H),(async()=>{try{if(await ee(m),a)return;const f=te();f>0&&b(A(f))}catch{a||h(!0)}})(),()=>{a=!0}},[m,H,ee,te]),t.useEffect(()=>{if(ue(S))return;const a=new Ze;return a.manageFormClearListener(o,S,()=>{k({updateWidgetManager:!0,deleteFile:!1})}),()=>a.disconnect()},[S,k,o]),t.useEffect(()=>()=>{U.current&&(U.current.abort(),U.current=null),u.current&&(cancelAnimationFrame(u.current),u.current=null),w.current&&(URL.revokeObjectURL(w.current),w.current=null)},[]);const Se=t.useCallback(async()=>{try{if(P){const a=T();Y(),b(A(a))}else M==="idle"&&m&&(T()<=100&&b(C),await Q())}catch{h(!0)}},[P,T,Y,Q,m,M]),re=t.useCallback(async()=>{m&&await k({updateWidgetManager:!1,deleteFile:!0});try{b(C),await q()}catch{}},[k,m,q]),oe=t.useCallback(async()=>{try{const{blob:a}=await K();await Z(a)}catch{h(!0)}},[Z,K]),ne=tt(m,"recording.wav"),Ce=t.useCallback(()=>{re()},[re]),Re=t.useCallback(()=>{oe()},[oe]),Ee=t.useCallback(()=>{k({updateWidgetManager:!1,deleteFile:!0}),h(!1)},[k]),ke=t.useCallback(()=>{ne()},[ne]),Ae=t.useCallback(()=>{k({updateWidgetManager:!0,deleteFile:!0})},[k]),$=M==="recording",ae=P,Ie=$?H:O,le=M==="idle"&&!c&&!m,Ue=c||le||d;return x(ot,{className:"stAudioInput","data-testid":"stAudioInput",children:[n(Xe,{label:e.label,disabled:l,labelVisibility:$e(e.labelVisibility?.value),children:e.help&&n(je,{content:e.help,placement:_e.TOP,label:e.label})}),x(de,{disabled:l,children:[x(qe,{isFullScreen:!1,disableFullscreenMode:!0,target:de,children:[m&&n(ce,{label:"Download as WAV",icon:Ye,onClick:ke}),B&&n(ce,{label:"Clear recording",icon:et,onClick:Ae})]}),n(bt,{isRecording:$,isPlaying:ae,isUploading:E,isError:d,recordingUrlExists:!!m,startRecording:Ce,stopRecording:Re,onClickPlayPause:()=>{Se()},onClear:Ee,disabled:l||c}),x(nt,{children:[d&&n(yt,{}),le&&n(Rt,{}),c&&n(St,{}),n(at,{"data-testid":"stAudioInputWaveSurfer",ref:g,show:!Ue})]}),n(lt,{isPlayingOrRecording:$||ae,disabled:l,"data-testid":"stAudioInputWaveformTimeCode",children:Ie})]})]})},Tt=t.memo(Et);export{Tt as default};
@@ -1 +1 @@
1
- import{r as a,E as S,_ as A,b0 as o,m as D,b1 as j,F as c,b2 as H,aC as v,l as P,k as G,o as f,j as l,p as F,q as b,P as q,az as U,b3 as X,ab as Y}from"./index.BZBWLU1C.js";import{e as J,S as K,a as Q,b as Z}from"./embed.C8qeQ38b.js";import{W as ee}from"./WidgetLabelHelpIconInline.WAReecol.js";import{i as L,f as re}from"./formatNumber.CPvuaBa8.js";import"./threshold.CUNQbqMA.js";import"./value.DaKxGC7O.js";import"./timer.BZio6gjG.js";import"./numbro.B9_PXfzp.js";import"./sprintf.DpPCfzXw.js";var z=a.forwardRef(function(e,r){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(S,A({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}))});z.displayName="ArrowDownward";var h=a.forwardRef(function(e,r){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(S,A({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}))});h.displayName="ArrowUpward";function k(e,r){switch(r){case o.MetricColor.RED:return e.colors.redColor;case o.MetricColor.GREEN:return e.colors.greenColor;case o.MetricColor.ORANGE:return e.colors.orangeColor;case o.MetricColor.YELLOW:return e.colors.yellowColor;case o.MetricColor.BLUE:return e.colors.blueColor;case o.MetricColor.VIOLET:return e.colors.violetColor;case o.MetricColor.PRIMARY:return e.colors.primary;default:return e.colors.grayColor}}function V(e,r){const t=D(e);switch(r){case o.MetricColor.RED:return e.colors.redBackgroundColor;case o.MetricColor.GREEN:return e.colors.greenBackgroundColor;case o.MetricColor.ORANGE:return e.colors.orangeBackgroundColor;case o.MetricColor.YELLOW:return e.colors.yellowBackgroundColor;case o.MetricColor.BLUE:return e.colors.blueBackgroundColor;case o.MetricColor.VIOLET:return e.colors.violetBackgroundColor;case o.MetricColor.PRIMARY:return j(e.colors.primary,t?.9:.7);default:return e.colors.grayBackgroundColor}}function oe(e,r){switch(r){case o.MetricColor.RED:return e.colors.redTextColor;case o.MetricColor.GREEN:return e.colors.greenTextColor;case o.MetricColor.ORANGE:return e.colors.orangeTextColor;case o.MetricColor.YELLOW:return e.colors.yellowTextColor;case o.MetricColor.BLUE:return e.colors.blueTextColor;case o.MetricColor.VIOLET:return e.colors.violetTextColor;case o.MetricColor.PRIMARY:return e.colors.primary;default:return e.colors.grayTextColor}}const te=c("div",{target:"e132k71j0"})(({theme:e,showBorder:r})=>({height:"100%",...r&&{border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.default,overflow:"hidden"}})),ie=c("div",{target:"e132k71j1"})(({theme:e,showBorder:r})=>({...r&&{padding:`calc(${e.spacing.lg} - ${e.sizes.borderWidth})`}})),le=c("div",{target:"e132k71j2"})(({theme:e,showBorder:r})=>({marginTop:r?void 0:e.spacing.lg,marginBottom:r?e.spacing.twoXL:void 0})),x=c("div",{target:"e132k71j3"})(({theme:e})=>({overflowWrap:"normal",textOverflow:"ellipsis",width:"100%",overflow:"hidden",whiteSpace:"nowrap",fontFamily:e.genericFonts.bodyFont,lineHeight:"normal",verticalAlign:"middle","& > div":{overflow:"hidden","& > p":{textOverflow:"ellipsis",overflow:"hidden"}}})),ae=c(H,{target:"e132k71j4"})(({visibility:e})=>({marginBottom:0,display:e===v.Collapsed?"none":"grid",gridTemplateColumns:e===v.Collapsed?"initial":"auto 1fr",visibility:e===v.Hidden?"hidden":"visible"})),ne=c("div",{target:"e132k71j5"})(({theme:e})=>({fontSize:e.fontSizes.threeXL,color:e.colors.bodyText,paddingBottom:e.spacing.twoXS})),se=c("div",{target:"e132k71j6"})(({theme:e,metricColor:r,showArrow:t})=>({color:oe(e,r),backgroundColor:V(e,r),fontSize:e.fontSizes.sm,display:"inline-flex",flexDirection:"row",alignItems:"center",fontWeight:e.fontWeights.normal,borderRadius:e.radii.full,maxWidth:"100%",padding:`${e.spacing.threeXS} ${e.spacing.xs} ${e.spacing.threeXS} ${e.spacing.xs}`,...t&&{paddingLeft:e.spacing.twoXS}})),ce=1e3;function R(e,r){try{return re(Number(e),r)}catch{return e}}function de(e,r,t,i,p){const n=`metric_chart_${Math.random().toString(36).slice(2,10)}`,m=e.length===1?[e[0],e[0]]:e,s={$schema:"https://vega.github.io/schema/vega-lite/v5.json",width:Math.round(t),height:Math.round(Y("3.5rem")),data:{values:m.map((M,g)=>({x:g,y:M}))},layer:[{name:`${n}_mark`,mark:{type:"line",...r===o.ChartType.LINE&&{type:"line",strokeCap:"round",strokeWidth:i.sizes.metricStrokeWidth},...r===o.ChartType.BAR&&{type:"bar",cornerRadius:parseFloat(i.radii.full)},...r===o.ChartType.AREA&&{type:"area",color:V(i,p),opacity:1,line:{color:k(i,p),opacity:1,strokeWidth:i.sizes.metricStrokeWidth,strokeCap:"round"}}},encoding:{x:{field:"x",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}},y:{field:"y",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}}}},{name:`${n}_points`,mark:{type:"point",opacity:0},encoding:{x:{field:"x",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}},y:{field:"y",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}}},params:[{name:`${n}_hover_selection`,select:{type:"point",encodings:["x"],nearest:!0,on:e.length>ce?"mousemove{16}":"mousemove",clear:"mouseleave"}}]},{name:`${n}_highlighted_points`,transform:[{filter:{param:`${n}_hover_selection`,empty:!1}}],mark:{type:"point",filled:!0,size:65,tooltip:!0},encoding:{x:{field:"x",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}},y:{field:"y",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}}}}],config:{view:{stroke:null},padding:{left:-3,right:-3,top:2,bottom:2},...r===o.ChartType.BAR&&{padding:{left:0,right:0,top:2,bottom:2}},mark:{tooltip:{content:"encoding"},color:k(i,p)}}};return s.config=Q(s.config,i),s}function ue({element:e}){const r=P(),t=a.useRef(null),{width:i,elementRef:p}=G(),{MetricDirection:C}=o,{body:n,label:m,delta:s,direction:M,color:g,labelVisibility:B,help:E,showBorder:w,chartData:d,chartType:T,format:y}=e,N=y&&L(n)?R(n,y):n,I=y&&s&&L(s)?R(s,y):s;let u=null;switch(M){case C.DOWN:u=z;break;case C.UP:u=h;break;case C.NONE:break}const W="0 threeXS 0 0",$=s!=="";return a.useEffect(()=>{if(d&&d.length>0&&t.current&&i>0){const O=de(d,T,i,r,g);J(t.current,O,{actions:!1,renderer:"svg",ast:!0,expr:Z,tooltip:{theme:"custom",formatTooltip:_=>`${_.y}`}})}},[d,g,r,i,T,t]),f(te,{className:"stMetric","data-testid":"stMetric",showBorder:w,children:[f(ie,{showBorder:w,children:[f(ae,{"data-testid":"stMetricLabel",visibility:F(B?.value),children:[l(x,{children:l(b,{source:m,allowHTML:!1,isLabel:!0})}),E&&l(ee,{content:E,placement:q.TOP_RIGHT,label:m})]}),l(ne,{"data-testid":"stMetricValue",children:l(x,{children:l(b,{source:N,allowHTML:!1,isLabel:!0,inheritFont:!0})})}),$&&f(se,{"data-testid":"stMetricDelta",metricColor:g,showArrow:u!==null,children:[u&&l(U,{testid:u===h?"stMetricDeltaIcon-Up":"stMetricDeltaIcon-Down",content:u,size:"md",margin:W}),l(x,{children:l(b,{source:I,allowHTML:!1,isLabel:!0,inheritFont:!0})})]})]}),d&&d.length>0&&f("div",{ref:p,children:[l(X,{styles:[K]}),l(le,{ref:t,"data-testid":"stMetricChart",showBorder:w})]})]})}const be=a.memo(ue);export{be as default};
1
+ import{r as a,E as S,_ as A,b0 as o,m as D,b1 as j,F as c,b2 as H,aC as v,l as P,k as G,o as f,j as l,p as F,q as b,P as q,az as U,b3 as X,ab as Y}from"./index.01VsD2h1.js";import{e as J,S as K,a as Q,b as Z}from"./embed.DJJvCVz2.js";import{W as ee}from"./WidgetLabelHelpIconInline.BdGIJQe4.js";import{i as L,f as re}from"./formatNumber.Cxr2q_Sk.js";import"./threshold.CUNQbqMA.js";import"./value.DaKxGC7O.js";import"./timer.BZio6gjG.js";import"./numbro.B9_PXfzp.js";import"./sprintf.DpPCfzXw.js";var z=a.forwardRef(function(e,r){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(S,A({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}))});z.displayName="ArrowDownward";var h=a.forwardRef(function(e,r){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(S,A({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}))});h.displayName="ArrowUpward";function k(e,r){switch(r){case o.MetricColor.RED:return e.colors.redColor;case o.MetricColor.GREEN:return e.colors.greenColor;case o.MetricColor.ORANGE:return e.colors.orangeColor;case o.MetricColor.YELLOW:return e.colors.yellowColor;case o.MetricColor.BLUE:return e.colors.blueColor;case o.MetricColor.VIOLET:return e.colors.violetColor;case o.MetricColor.PRIMARY:return e.colors.primary;default:return e.colors.grayColor}}function V(e,r){const t=D(e);switch(r){case o.MetricColor.RED:return e.colors.redBackgroundColor;case o.MetricColor.GREEN:return e.colors.greenBackgroundColor;case o.MetricColor.ORANGE:return e.colors.orangeBackgroundColor;case o.MetricColor.YELLOW:return e.colors.yellowBackgroundColor;case o.MetricColor.BLUE:return e.colors.blueBackgroundColor;case o.MetricColor.VIOLET:return e.colors.violetBackgroundColor;case o.MetricColor.PRIMARY:return j(e.colors.primary,t?.9:.7);default:return e.colors.grayBackgroundColor}}function oe(e,r){switch(r){case o.MetricColor.RED:return e.colors.redTextColor;case o.MetricColor.GREEN:return e.colors.greenTextColor;case o.MetricColor.ORANGE:return e.colors.orangeTextColor;case o.MetricColor.YELLOW:return e.colors.yellowTextColor;case o.MetricColor.BLUE:return e.colors.blueTextColor;case o.MetricColor.VIOLET:return e.colors.violetTextColor;case o.MetricColor.PRIMARY:return e.colors.primary;default:return e.colors.grayTextColor}}const te=c("div",{target:"e132k71j0"})(({theme:e,showBorder:r})=>({height:"100%",...r&&{border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.default,overflow:"hidden"}})),ie=c("div",{target:"e132k71j1"})(({theme:e,showBorder:r})=>({...r&&{padding:`calc(${e.spacing.lg} - ${e.sizes.borderWidth})`}})),le=c("div",{target:"e132k71j2"})(({theme:e,showBorder:r})=>({marginTop:r?void 0:e.spacing.lg,marginBottom:r?e.spacing.twoXL:void 0})),x=c("div",{target:"e132k71j3"})(({theme:e})=>({overflowWrap:"normal",textOverflow:"ellipsis",width:"100%",overflow:"hidden",whiteSpace:"nowrap",fontFamily:e.genericFonts.bodyFont,lineHeight:"normal",verticalAlign:"middle","& > div":{overflow:"hidden","& > p":{textOverflow:"ellipsis",overflow:"hidden"}}})),ae=c(H,{target:"e132k71j4"})(({visibility:e})=>({marginBottom:0,display:e===v.Collapsed?"none":"grid",gridTemplateColumns:e===v.Collapsed?"initial":"auto 1fr",visibility:e===v.Hidden?"hidden":"visible"})),ne=c("div",{target:"e132k71j5"})(({theme:e})=>({fontSize:e.fontSizes.threeXL,color:e.colors.bodyText,paddingBottom:e.spacing.twoXS})),se=c("div",{target:"e132k71j6"})(({theme:e,metricColor:r,showArrow:t})=>({color:oe(e,r),backgroundColor:V(e,r),fontSize:e.fontSizes.sm,display:"inline-flex",flexDirection:"row",alignItems:"center",fontWeight:e.fontWeights.normal,borderRadius:e.radii.full,maxWidth:"100%",padding:`${e.spacing.threeXS} ${e.spacing.xs} ${e.spacing.threeXS} ${e.spacing.xs}`,...t&&{paddingLeft:e.spacing.twoXS}})),ce=1e3;function R(e,r){try{return re(Number(e),r)}catch{return e}}function de(e,r,t,i,p){const n=`metric_chart_${Math.random().toString(36).slice(2,10)}`,m=e.length===1?[e[0],e[0]]:e,s={$schema:"https://vega.github.io/schema/vega-lite/v5.json",width:Math.round(t),height:Math.round(Y("3.5rem")),data:{values:m.map((M,g)=>({x:g,y:M}))},layer:[{name:`${n}_mark`,mark:{type:"line",...r===o.ChartType.LINE&&{type:"line",strokeCap:"round",strokeWidth:i.sizes.metricStrokeWidth},...r===o.ChartType.BAR&&{type:"bar",cornerRadius:parseFloat(i.radii.full)},...r===o.ChartType.AREA&&{type:"area",color:V(i,p),opacity:1,line:{color:k(i,p),opacity:1,strokeWidth:i.sizes.metricStrokeWidth,strokeCap:"round"}}},encoding:{x:{field:"x",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}},y:{field:"y",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}}}},{name:`${n}_points`,mark:{type:"point",opacity:0},encoding:{x:{field:"x",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}},y:{field:"y",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}}},params:[{name:`${n}_hover_selection`,select:{type:"point",encodings:["x"],nearest:!0,on:e.length>ce?"mousemove{16}":"mousemove",clear:"mouseleave"}}]},{name:`${n}_highlighted_points`,transform:[{filter:{param:`${n}_hover_selection`,empty:!1}}],mark:{type:"point",filled:!0,size:65,tooltip:!0},encoding:{x:{field:"x",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}},y:{field:"y",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}}}}],config:{view:{stroke:null},padding:{left:-3,right:-3,top:2,bottom:2},...r===o.ChartType.BAR&&{padding:{left:0,right:0,top:2,bottom:2}},mark:{tooltip:{content:"encoding"},color:k(i,p)}}};return s.config=Q(s.config,i),s}function ue({element:e}){const r=P(),t=a.useRef(null),{width:i,elementRef:p}=G(),{MetricDirection:C}=o,{body:n,label:m,delta:s,direction:M,color:g,labelVisibility:B,help:E,showBorder:w,chartData:d,chartType:T,format:y}=e,N=y&&L(n)?R(n,y):n,I=y&&s&&L(s)?R(s,y):s;let u=null;switch(M){case C.DOWN:u=z;break;case C.UP:u=h;break;case C.NONE:break}const W="0 threeXS 0 0",$=s!=="";return a.useEffect(()=>{if(d&&d.length>0&&t.current&&i>0){const O=de(d,T,i,r,g);J(t.current,O,{actions:!1,renderer:"svg",ast:!0,expr:Z,tooltip:{theme:"custom",formatTooltip:_=>`${_.y}`}})}},[d,g,r,i,T,t]),f(te,{className:"stMetric","data-testid":"stMetric",showBorder:w,children:[f(ie,{showBorder:w,children:[f(ae,{"data-testid":"stMetricLabel",visibility:F(B?.value),children:[l(x,{children:l(b,{source:m,allowHTML:!1,isLabel:!0})}),E&&l(ee,{content:E,placement:q.TOP_RIGHT,label:m})]}),l(ne,{"data-testid":"stMetricValue",children:l(x,{children:l(b,{source:N,allowHTML:!1,isLabel:!0,inheritFont:!0})})}),$&&f(se,{"data-testid":"stMetricDelta",metricColor:g,showArrow:u!==null,children:[u&&l(U,{testid:u===h?"stMetricDeltaIcon-Up":"stMetricDeltaIcon-Down",content:u,size:"md",margin:W}),l(x,{children:l(b,{source:I,allowHTML:!1,isLabel:!0,inheritFont:!0})})]})]}),d&&d.length>0&&f("div",{ref:p,children:[l(X,{styles:[K]}),l(le,{ref:t,"data-testid":"stMetricChart",showBorder:w})]})]})}const be=a.memo(ue);export{be as default};