streamlit-nightly 1.42.1.dev20250204__py2.py3-none-any.whl → 1.42.1.dev20250205__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{FileDownload.esm.CuayiK6T.js → FileDownload.esm.ShSIWsKj.js} +1 -1
- streamlit/static/static/js/{FileDropzone.CvXoxIUm.js → FileDropzone.BFkJKygp.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.DpwWkrvV.js → FormClearHelper.Bue0QSIn.js} +1 -1
- streamlit/static/static/js/{Hooks.BQiFiHd5.js → Hooks.kV16_k1-.js} +1 -1
- streamlit/static/static/js/{InputInstructions.CypmdrYz.js → InputInstructions.DpG38kbY.js} +1 -1
- streamlit/static/static/js/{ProgressBar.DfR4HyQR.js → ProgressBar.B_WJAIyy.js} +1 -1
- streamlit/static/static/js/{RenderInPortalIfExists.D6u3szcn.js → RenderInPortalIfExists.CGAGPcQq.js} +1 -1
- streamlit/static/static/js/{Toolbar.D6p42Hno.js → Toolbar.DBtrI961.js} +1 -1
- streamlit/static/static/js/{base-input.B5AcLp6p.js → base-input.P8VGAZdC.js} +1 -1
- streamlit/static/static/js/{createSuper.DNzaJgi-.js → createSuper.GYQHnroV.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.CKACfVZL.js → data-grid-overlay-editor.B1sLTR3f.js} +1 -1
- streamlit/static/static/js/{downloader.D6HV3a60.js → downloader.y-Ssi2d3.js} +1 -1
- streamlit/static/static/js/{es6.UQDWlCyE.js → es6.DpUKmjxe.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.DQ-TFrBp.js → iframeResizer.contentWindow.BBjdpeP0.js} +1 -1
- streamlit/static/static/js/{index.C8zZSMvD.js → index.2bJmI0Ih.js} +1 -1
- streamlit/static/static/js/{index.BghvoEVe.js → index.3k422wEU.js} +1 -1
- streamlit/static/static/js/{index.DB_dBVfZ.js → index.B11A7C7I.js} +1 -1
- streamlit/static/static/js/{index.wW-pPvtW.js → index.B7AJyWjy.js} +1 -1
- streamlit/static/static/js/{index.D7BxtE4u.js → index.B7aeIxns.js} +1 -1
- streamlit/static/static/js/{index.CX9gqq2L.js → index.BRsob9Jp.js} +1 -1
- streamlit/static/static/js/{index.DMKXUbO6.js → index.BVkJfCWM.js} +1 -1
- streamlit/static/static/js/{index.DkV6k6Ng.js → index.BW_6EVtw.js} +1 -1
- streamlit/static/static/js/{index.DaoBv396.js → index.Bkk4sBLz.js} +1 -1
- streamlit/static/static/js/{index.DqZZoWyt.js → index.BqiT_qyM.js} +1 -1
- streamlit/static/static/js/{index.BXmBj7MJ.js → index.C-BkiutF.js} +1 -1
- streamlit/static/static/js/{index.BPmrb-47.js → index.C73Hi-mL.js} +1 -1
- streamlit/static/static/js/{index.BQEIBi4n.js → index.C8vyFGOc.js} +1 -1
- streamlit/static/static/js/{index.BdVr8Tta.js → index.CAQGqUJ5.js} +1 -1
- streamlit/static/static/js/{index.BUGQmWUV.js → index.CC_i5fnL.js} +1 -1
- streamlit/static/static/js/index.CIkzV9zP.js +2 -0
- streamlit/static/static/js/{index.BAFGiIHm.js → index.CIwUls4J.js} +1 -1
- streamlit/static/static/js/{index.CgVoYKAP.js → index.CUzW8sZB.js} +1 -1
- streamlit/static/static/js/{index.CSgG8OVN.js → index.CVIsVMt0.js} +1 -1
- streamlit/static/static/js/{index.BiybRa0I.js → index.CZFA90VV.js} +1 -1
- streamlit/static/static/js/{index.BY8YeKF1.js → index.Cd8_b4vi.js} +1 -1
- streamlit/static/static/js/{index.Epl2r08f.js → index.CoJayF2l.js} +1 -1
- streamlit/static/static/js/{index.D4SMJhY1.js → index.Cp60C2LQ.js} +1 -1
- streamlit/static/static/js/{index.BPNlEjgz.js → index.D-Qsohh0.js} +1 -1
- streamlit/static/static/js/{index.CAuJtYES.js → index.D2i6l9uv.js} +1 -1
- streamlit/static/static/js/{index.BuyK2IsW.js → index.D3PlNa4T.js} +1 -1
- streamlit/static/static/js/{index.BiMrOUpK.js → index.D7HtU_R4.js} +1 -1
- streamlit/static/static/js/{index.CKOdbWxq.js → index.DHOnt3Rd.js} +1 -1
- streamlit/static/static/js/{index.ByH1pn5_.js → index.DNKGONSt.js} +1 -1
- streamlit/static/static/js/{index.CEdHQ1ob.js → index.D_CViY1G.js} +1 -1
- streamlit/static/static/js/{index.ChrjN8GY.js → index.DdJR-Re7.js} +1 -1
- streamlit/static/static/js/{index.Bm7Vkuba.js → index.DdaoJ1WZ.js} +1 -1
- streamlit/static/static/js/{index.B96fHK2A.js → index.DsOZJLyF.js} +1 -1
- streamlit/static/static/js/{index.2EE80u0h.js → index.DuqdUleB.js} +5 -5
- streamlit/static/static/js/{index.CrMtUJsu.js → index.GZ99DH1Q.js} +5 -5
- streamlit/static/static/js/{index.ndVWhafL.js → index.OWYUy0bC.js} +1 -1
- streamlit/static/static/js/{index.Dr6DSYcq.js → index.USVf5VUT.js} +1 -1
- streamlit/static/static/js/{input.CxqdG-sh.js → input.BANuQoGH.js} +1 -1
- streamlit/static/static/js/{memory.DuSk7Eex.js → memory.DTxlMbK7.js} +1 -1
- streamlit/static/static/js/{mergeWith.DrxB1Sj4.js → mergeWith.CfihrnQo.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.DBc0yndt.js → number-overlay-editor.BHsEp8VL.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.ZdYWHeG3.js → possibleConstructorReturn.BErM7qST.js} +1 -1
- streamlit/static/static/js/{sandbox.D3L4CYjG.js → sandbox.BMuVLu80.js} +1 -1
- streamlit/static/static/js/{textarea.CSafh28v.js → textarea.CmSZv6UE.js} +1 -1
- streamlit/static/static/js/{timepicker.C-pwkiaT.js → timepicker.DsaAj0da.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.DyCVskz5.js → toConsumableArray.DJs7oxRq.js} +1 -1
- streamlit/static/static/js/{uniqueId.BODM2vTk.js → uniqueId.CVe3uxKs.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.DQUiM2dz.js → useBasicWidgetState.D572sX2t.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.Ccjd55xn.js → useOnInputChange.D9rTVyjn.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.CneUoXNE.js → withFullScreenWrapper.4QDrgZxA.js} +1 -1
- {streamlit_nightly-1.42.1.dev20250204.dist-info → streamlit_nightly-1.42.1.dev20250205.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.42.1.dev20250204.dist-info → streamlit_nightly-1.42.1.dev20250205.dist-info}/RECORD +71 -71
- streamlit/static/static/js/index.CJ-t5S6T.js +0 -2
- {streamlit_nightly-1.42.1.dev20250204.data → streamlit_nightly-1.42.1.dev20250205.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.42.1.dev20250204.dist-info → streamlit_nightly-1.42.1.dev20250205.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.42.1.dev20250204.dist-info → streamlit_nightly-1.42.1.dev20250205.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.42.1.dev20250204.dist-info → streamlit_nightly-1.42.1.dev20250205.dist-info}/top_level.txt +0 -0
@@ -1,3 +1,3 @@
|
|
1
|
-
import{bw as P,bJ as ve,bx as O,r as u,y as me,z as ne,j as R,bB as ye,bt as $e,bc as Oe,bu as Re,aE as oe,bs as _e}from"./index.
|
1
|
+
import{bw as P,bJ as ve,bx as O,r as u,y as me,z as ne,j as R,bB as ye,bt as $e,bc as Oe,bu as Re,aE as oe,bs as _e}from"./index.DuqdUleB.js";import{a as Pe}from"./useBasicWidgetState.D572sX2t.js";import"./FormClearHelper.Bue0QSIn.js";var ie={vertical:"vertical",horizontal:"horizontal"};function ae(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function D(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ae(Object(n),!0).forEach(function(r){_(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ae(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var E=0,I=1,L=2;function B(e){return e.$isActive?L:e.$isHovered?I:E}function we(e){var t=e.$theme.colors,n=e.$disabled,r=e.$checked,o=e.$isFocusVisible,i=e.$error;if(n)return t.tickFillDisabled;if(r)if(i)switch(B(e)){case E:return t.tickFillErrorSelected;case I:return t.tickFillErrorSelectedHover;case L:return t.tickFillErrorSelectedHoverActive}else switch(B(e)){case E:return t.tickFillSelected;case I:return t.tickFillSelectedHover;case L:return t.tickFillSelectedHoverActive}else return o?t.borderSelected:i?t.tickBorderError:t.tickBorder;return null}function Se(e){var t=e.$theme.colors;if(e.$disabled)return t.tickMarkFillDisabled;if(e.$checked)return t.tickMarkFill;if(e.$error)switch(B(e)){case E:return t.tickFillError;case I:return t.tickFillErrorHover;case L:return t.tickFillErrorHoverActive}else switch(B(e)){case E:return t.tickFill;case I:return t.tickFillHover;case L:return t.tickFillActive}}function Me(e){var t=e.$labelPlacement,n=t===void 0?"":t,r=e.$theme,o;switch(n){case"top":o="Bottom";break;case"bottom":o="Top";break;case"left":o=r.direction==="rtl"?"Left":"Right";break;default:case"right":o=r.direction==="rtl"?"Right":"Left";break}var i=r.sizing,s=i.scale300;return _({},"padding".concat(o),s)}function ke(e){var t=e.$disabled,n=e.$theme,r=n.colors;return t?r.contentSecondary:r.contentPrimary}var q=P("div",function(e){var t=e.$disabled,n=e.$align;return{display:"flex",flexWrap:"wrap",flexDirection:n==="horizontal"?"row":"column",alignItems:n==="horizontal"?"center":"flex-start",cursor:t?"not-allowed":"pointer","-webkit-tap-highlight-color":"transparent"}});q.displayName="RadioGroupRoot";q.displayName="RadioGroupRoot";var X=P("label",function(e){var t,n=e.$disabled,r=e.$hasDescription,o=e.$labelPlacement,i=e.$theme,s=e.$align,a=i.sizing,c=s==="horizontal",h=i.direction==="rtl"?"Left":"Right";return t={flexDirection:o==="top"||o==="bottom"?"column":"row",display:"flex",alignItems:"center",cursor:n?"not-allowed":"pointer",marginTop:a.scale200},_(t,"margin".concat(h),c?a.scale200:null),_(t,"marginBottom",r&&!c?null:a.scale200),t});X.displayName="Root";X.displayName="Root";var J=P("div",function(e){var t=e.$theme,n=t.animation,r=t.sizing;return{backgroundColor:Se(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",height:e.$checked?r.scale200:r.scale550,transitionDuration:n.timing200,transitionTimingFunction:n.easeOutCurve,width:e.$checked?r.scale200:r.scale550}});J.displayName="RadioMarkInner";J.displayName="RadioMarkInner";var K=P("div",function(e){var t=e.$theme,n=t.animation,r=t.sizing;return{alignItems:"center",backgroundColor:we(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",boxShadow:e.$isFocusVisible&&e.$checked?"0 0 0 3px ".concat(e.$theme.colors.accent):"none",display:"flex",height:r.scale700,justifyContent:"center",marginTop:r.scale0,marginRight:r.scale0,marginBottom:r.scale0,marginLeft:r.scale0,outline:"none",verticalAlign:"middle",width:r.scale700,flexShrink:0,transitionDuration:n.timing200,transitionTimingFunction:n.easeOutCurve}});K.displayName="RadioMarkOuter";K.displayName="RadioMarkOuter";var Q=P("div",function(e){var t=e.$theme.typography;return D(D({verticalAlign:"middle"},Me(e)),{},{color:ke(e)},t.LabelMedium)});Q.displayName="Label";Q.displayName="Label";var Y=P("input",{width:0,height:0,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,clip:"rect(0 0 0 0)",position:"absolute"});Y.displayName="Input";Y.displayName="Input";var Z=P("div",function(e){var t,n=e.$theme,r=e.$align,o=r==="horizontal",i=n.direction==="rtl"?"Right":"Left",s=n.direction==="rtl"?"Left":"Right";return D(D({},n.typography.ParagraphSmall),{},(t={color:n.colors.contentSecondary,cursor:"auto"},_(t,"margin".concat(i),r==="horizontal"?null:n.sizing.scale900),_(t,"margin".concat(s),o?n.sizing.scale200:null),_(t,"maxWidth","240px"),t))});Z.displayName="Description";Z.displayName="Description";function N(e){"@babel/helpers - typeof";return N=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},N(e)}function V(){return V=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},V.apply(this,arguments)}function Fe(e,t){return Te(e)||Le(e,t)||Ie(e,t)||Ee()}function Ee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ie(e,t){if(e){if(typeof e=="string")return se(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return se(e,t)}}function se(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Le(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,i=!1,s,a;try{for(n=n.call(e);!(o=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));o=!0);}catch(c){i=!0,a=c}finally{try{!o&&n.return!=null&&n.return()}finally{if(i)throw a}}return r}}function Te(e){if(Array.isArray(e))return e}function Ae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function je(e,t,n){return t&&xe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function De(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&U(e,t)}function U(e,t){return U=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},U(e,t)}function Be(e){var t=ze();return function(){var r=C(e),o;if(t){var i=C(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Ce(this,o)}}function Ce(e,t){if(t&&(N(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return x(e)}function x(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ze(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function C(e){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},C(e)}function j(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ue=function(e){De(n,e);var t=Be(n);function n(){var r;Ae(this,n);for(var o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),j(x(r),"state",{isFocusVisible:!1,focusedRadioIndex:-1}),j(x(r),"handleFocus",function(a,c){ve(a)&&r.setState({isFocusVisible:!0}),r.setState({focusedRadioIndex:c}),r.props.onFocus&&r.props.onFocus(a)}),j(x(r),"handleBlur",function(a,c){r.state.isFocusVisible!==!1&&r.setState({isFocusVisible:!1}),r.setState({focusedRadioIndex:-1}),r.props.onBlur&&r.props.onBlur(a)}),r}return je(n,[{key:"render",value:function(){var o=this,i=this.props.overrides,s=i===void 0?{}:i,a=O(s.RadioGroupRoot,q),c=Fe(a,2),h=c[0],b=c[1];return u.createElement(h,V({id:this.props.id,role:"radiogroup","aria-describedby":this.props["aria-describedby"],"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props.error||null,"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],$align:this.props.align,$disabled:this.props.disabled,$error:this.props.error,$required:this.props.required},b),u.Children.map(this.props.children,function(p,f){if(!u.isValidElement(p))return null;var l=o.props.value===p.props.value;return u.cloneElement(p,{align:o.props.align,autoFocus:o.props.autoFocus,checked:l,disabled:o.props.disabled||p.props.disabled,error:o.props.error,isFocused:o.state.focusedRadioIndex===f,isFocusVisible:o.state.isFocusVisible,tabIndex:f===0&&!o.props.value||l?"0":"-1",labelPlacement:o.props.labelPlacement,name:o.props.name,onBlur:function(d){return o.handleBlur(d,f)},onFocus:function(d){return o.handleFocus(d,f)},onChange:o.props.onChange,onMouseEnter:o.props.onMouseEnter,onMouseLeave:o.props.onMouseLeave})}))}}]),n}(u.Component);j(ue,"defaultProps",{name:"",value:"",disabled:!1,autoFocus:!1,labelPlacement:"right",align:"vertical",error:!1,required:!1,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onFocus:function(){},onBlur:function(){},overrides:{}});function G(e){"@babel/helpers - typeof";return G=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},G(e)}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},y.apply(this,arguments)}function M(e,t){return Ue(e)||Ve(e,t)||Ne(e,t)||He()}function He(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ne(e,t){if(e){if(typeof e=="string")return le(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return le(e,t)}}function le(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ve(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,i=!1,s,a;try{for(n=n.call(e);!(o=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));o=!0);}catch(c){i=!0,a=c}finally{try{!o&&n.return!=null&&n.return()}finally{if(i)throw a}}return r}}function Ue(e){if(Array.isArray(e))return e}function Ge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function We(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function qe(e,t,n){return t&&We(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&W(e,t)}function W(e,t){return W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},W(e,t)}function Je(e){var t=Qe();return function(){var r=z(e),o;if(t){var i=z(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Ke(this,o)}}function Ke(e,t){if(t&&(G(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return k(e)}function k(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Qe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function z(e){return z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},z(e)}function F(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ye(e){return e==="top"||e==="left"}function Ze(e){return e==="bottom"||e==="right"}var et=function(t){return t.stopPropagation()},ce=function(e){Xe(n,e);var t=Je(n);function n(){var r;Ge(this,n);for(var o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),F(k(r),"state",{isActive:!1,isHovered:!1}),F(k(r),"onMouseEnter",function(a){r.setState({isHovered:!0}),r.props.onMouseEnter&&r.props.onMouseEnter(a)}),F(k(r),"onMouseLeave",function(a){r.setState({isHovered:!1}),r.props.onMouseLeave&&r.props.onMouseLeave(a)}),F(k(r),"onMouseDown",function(a){r.setState({isActive:!0}),r.props.onMouseDown&&r.props.onMouseDown(a)}),F(k(r),"onMouseUp",function(a){r.setState({isActive:!1}),r.props.onMouseUp&&r.props.onMouseUp(a)}),r}return qe(n,[{key:"componentDidMount",value:function(){var o;this.props.autoFocus&&(o=this.props.inputRef)!==null&&o!==void 0&&o.current&&this.props.inputRef.current.focus()}},{key:"render",value:function(){var o=this.props.overrides,i=o===void 0?{}:o,s=O(i.Root,X),a=M(s,2),c=a[0],h=a[1],b=O(i.Label,Q),p=M(b,2),f=p[0],l=p[1],$=O(i.Input,Y),d=M($,2),T=d[0],H=d[1],w=O(i.Description,Z),A=M(w,2),v=A[0],g=A[1],m=O(i.RadioMarkInner,J),ee=M(m,2),pe=ee[0],fe=ee[1],de=O(i.RadioMarkOuter,K),te=M(de,2),he=te[0],be=te[1],S={$align:this.props.align,$checked:this.props.checked,$disabled:this.props.disabled,$hasDescription:!!this.props.description,$isActive:this.state.isActive,$error:this.props.error,$isFocused:this.props.isFocused,$isFocusVisible:this.props.isFocused&&this.props.isFocusVisible,$isHovered:this.state.isHovered,$labelPlacement:this.props.labelPlacement,$required:this.props.required,$value:this.props.value},re=u.createElement(f,y({},S,l),this.props.containsInteractiveElement?u.createElement("div",{onClick:function(ge){return ge.preventDefault()}},this.props.children):this.props.children);return u.createElement(u.Fragment,null,u.createElement(c,y({"data-baseweb":"radio",onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},S,h),Ye(this.props.labelPlacement)&&re,u.createElement(he,y({},S,be),u.createElement(pe,y({},S,fe))),u.createElement(T,y({"aria-invalid":this.props.error||null,checked:this.props.checked,disabled:this.props.disabled,name:this.props.name,onBlur:this.props.onBlur,onFocus:this.props.onFocus,onClick:et,onChange:this.props.onChange,ref:this.props.inputRef,required:this.props.required,tabIndex:this.props.tabIndex,type:"radio",value:this.props.value},S,H)),Ze(this.props.labelPlacement)&&re),!!this.props.description&&u.createElement(v,y({},S,g),this.props.description))}}]),n}(u.Component);F(ce,"defaultProps",{overrides:{},containsInteractiveElement:!1,checked:!1,disabled:!1,autoFocus:!1,inputRef:u.createRef(),align:"vertical",error:!1,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});function tt({disabled:e,horizontal:t,width:n,value:r,onChange:o,options:i,captions:s,label:a,labelVisibility:c,help:h}){const[b,p]=u.useState(r??null);u.useEffect(()=>{r!==b&&p(r??null)},[r]);const f=u.useCallback(v=>{const g=parseInt(v.target.value,10);p(g),o(g)},[o]),l=me(),$={width:n},d=s.length>0,T=i.length>0,H=T?i:["No options to select."],w=e||!T,A=v=>v==""&&t&&d?" ":v;return ne("div",{className:"stRadio","data-testid":"stRadio",style:$,children:[R(Re,{label:a,disabled:w,labelVisibility:c,children:h&&R(ye,{children:R($e,{content:h,placement:Oe.TOP_RIGHT})})}),R(ue,{onChange:f,value:b!==null?b.toString():void 0,disabled:w,align:t?ie.horizontal:ie.vertical,"aria-label":a,"data-testid":"stRadioGroup",overrides:{RadioGroupRoot:{style:{gap:d?l.spacing.sm:l.spacing.none,minHeight:l.sizes.minElementHeight}}},children:H.map((v,g)=>ne(ce,{value:g.toString(),overrides:{Root:{style:({$isFocusVisible:m})=>({marginBottom:l.spacing.none,marginTop:l.spacing.none,marginRight:d?l.spacing.sm:l.spacing.lg,paddingLeft:l.spacing.none,alignItems:"start",paddingRight:l.spacing.threeXS,backgroundColor:m?l.colors.darkenedBgMix25:""})},RadioMarkOuter:{style:({$checked:m})=>({width:l.sizes.checkbox,height:l.sizes.checkbox,marginTop:"0.35rem",marginRight:l.spacing.none,marginLeft:l.spacing.none,backgroundColor:m&&!w?l.colors.primary:l.colors.fadedText40})},RadioMarkInner:{style:({$checked:m})=>({height:m?"37.5%":`calc(${l.sizes.checkbox} - ${l.spacing.threeXS})`,width:m?"37.5%":`calc(${l.sizes.checkbox} - ${l.spacing.threeXS})`})},Label:{style:{color:w?l.colors.fadedText40:l.colors.bodyText,position:"relative",top:l.spacing.px}}},children:[R(oe,{source:v,allowHTML:!1,isLabel:!0,largerLabel:!0}),d&&R(oe,{source:A(s[g]),allowHTML:!1,isCaption:!0,isLabel:!0})]},g))})]})}const rt=u.memo(tt);function nt({disabled:e,element:t,widgetMgr:n,width:r,fragmentId:o}){const[i,s]=Pe({getStateFromWidgetMgr:ot,getDefaultStateFromProto:it,getCurrStateFromProto:at,updateWidgetMgrState:st,element:t,widgetMgr:n,fragmentId:o}),a=u.useCallback($=>{s({value:$,fromUi:!0})},[s]),{horizontal:c,options:h,captions:b,label:p,labelVisibility:f,help:l}=t;return R(rt,{label:p,onChange:a,options:h,captions:b,width:r,disabled:e,horizontal:c,labelVisibility:_e(f==null?void 0:f.value),value:i??null,help:l})}function ot(e,t){return e.getIntValue(t)}function it(e){return e.default??null}function at(e){return e.value??null}function st(e,t,n,r){t.setIntValue(e,n.value??null,{fromUi:n.fromUi},r)}const ft=u.memo(nt);export{ft as default};
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{bw as Z,bx as J,r as f,by as Q,y as Y,bz as s,j as v,z as ee,bs as te,bA as re,bB as ne,bt as oe,bc as ie,bu as ae,bq as ue,b8 as P,b7 as W,ba as le}from"./index.DuqdUleB.js";import{a as ce}from"./useBasicWidgetState.D572sX2t.js";import"./FormClearHelper.Bue0QSIn.js";var se={primary:"primary",secondary:"secondary",tertiary:"tertiary"},G={default:"default",pill:"pill",round:"round",circle:"circle",square:"square"},fe={mini:"mini",default:"default",compact:"compact",large:"large"},k=Object.freeze({radio:"radio",checkbox:"checkbox"}),z=Z("div",function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=r===1?void 0:t!==G.default?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}});z.displayName="StyledRoot";z.displayName="StyledRoot";function j(e){"@babel/helpers - typeof";return j=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j(e)}function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},M.apply(this,arguments)}function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function pe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?x(Object(r),!0).forEach(function(n){N(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function de(e,t){return he(e)||me(e,t)||be(e,t)||ye()}function ye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function be(e,t){if(e){if(typeof e=="string")return X(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return X(e,t)}}function X(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function me(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,i=!1,a,p;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){i=!0,p=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(i)throw p}}return n}}function he(e){if(Array.isArray(e))return e}function ge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Se(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ve(e,t,r){return t&&Se(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Oe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$(e,t)}function $(e,t){return $=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},$(e,t)}function Ee(e){var t=we();return function(){var n=A(e),o;if(t){var i=A(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return _e(this,o)}}function _e(e,t){if(t&&(j(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return K(e)}function K(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function we(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function A(e){return A=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},A(e)}function N(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Le(e,t){return!Array.isArray(e)&&typeof e!="number"?!1:Array.isArray(e)?e.includes(t):e===t}var F=function(e){Oe(r,e);var t=Ee(r);function r(){var n;ge(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),N(K(n),"childRefs",{}),n}return ve(r,[{key:"render",value:function(){var o=this,i=this.props,a=i.overrides,p=a===void 0?{}:a,c=i.mode,C=c===void 0?k.checkbox:c,d=i.children,y=i.selected,m=i.disabled,l=i.onClick,_=i.kind,h=i.shape,w=i.size,B=J(p.Root,z),O=de(B,2),E=O[0],L=O[1],q=this.props["aria-label"]||this.props.ariaLabel,g=C===k.radio,V=f.Children.count(d);return f.createElement(Q.Consumer,null,function(H){return f.createElement(E,M({"aria-label":q||H.buttongroup.ariaLabel,"data-baseweb":"button-group",role:g?"radiogroup":"group",$shape:h,$length:d.length},L),f.Children.map(d,function(b,R){if(!f.isValidElement(b))return null;var I=b.props.isSelected?b.props.isSelected:Le(y,R);return g&&(o.childRefs[R]=f.createRef()),f.cloneElement(b,{disabled:m||b.props.disabled,isSelected:I,ref:g?o.childRefs[R]:void 0,tabIndex:!g||I||g&&(!y||y===-1)&&R===0?0:-1,onKeyDown:function(u){if(g){var S=Number(y)?Number(y):0;if(u.key==="ArrowUp"||u.key==="ArrowLeft"){u.preventDefault&&u.preventDefault();var T=S-1<0?V-1:S-1;l&&l(u,T),o.childRefs[T].current&&o.childRefs[T].current.focus()}if(u.key==="ArrowDown"||u.key==="ArrowRight"){u.preventDefault&&u.preventDefault();var D=S+1>V-1?0:S+1;l&&l(u,D),o.childRefs[D].current&&o.childRefs[D].current.focus()}}},kind:_,onClick:function(u){m||(b.props.onClick&&b.props.onClick(u),l&&l(u,R))},shape:h,size:w,overrides:pe({BaseButton:{style:function(u){var S=u.$theme;return d.length===1?{}:h!==G.default?{marginLeft:S.sizing.scale100,marginRight:S.sizing.scale100}:{marginLeft:"0.5px",marginRight:"0.5px"}},props:{"aria-checked":I,role:g?"radio":"checkbox"}}},b.props.overrides)})}))})}}]),r}(f.Component);N(F,"defaultProps",{disabled:!1,onClick:function(){},shape:G.default,size:fe.default,kind:se.secondary});function Re(e,t){return t.includes(e)?t.filter(r=>r!==e):[...t,e]}function Pe(e,t,r){return e==s.ClickMode.MULTI_SELECT?Re(t,r??[]):r!=null&&r.includes(t)?[]:[t]}function Ce(e){return e.length===0?-1:e[0]}function ke(e,t,r,n){t.setIntArrayValue(e,r.value,{fromUi:r.fromUi},n)}function Ae(e,t,r){const n=r===s.Style.PILLS?P.PILLS:r===s.Style.BORDERLESS?P.BORDERLESS_ICON:P.SEGMENTED_CONTROL,o=r===s.Style.BORDERLESS?W.XSMALL:W.MEDIUM,i=n===P.PILLS||n===P.SEGMENTED_CONTROL,a=r===s.Style.BORDERLESS?"lg":"base";return{element:v(le,{icon:t,label:e,iconSize:a,useSmallerFont:i}),kind:n,size:o}}function Be(e,t,r,n){return r.indexOf(n)>-1?!0:t!==s.ClickMode.SINGLE_SELECT||e!==s.SelectionVisualization.ALL_UP_TO_SELECTED?!1:r.length>0&&n<r[0]}function Ie(e,t){return e&&(t=`${t}Active`),t}function Te(e,t){const r={flexWrap:"wrap",maxWidth:"fit-content"};switch(e){case s.Style.BORDERLESS:return{...r,columnGap:t.threeXS,rowGap:t.threeXS};case s.Style.PILLS:return{...r,columnGap:t.twoXS,rowGap:t.twoXS};case s.Style.SEGMENTED_CONTROL:return{...r,columnGap:t.none,rowGap:t.twoXS,"::after":{content:"''",flex:1e4}};default:return r}}function De(e,t,r,n,o,i){const a=Be(r,n,o,t);let p=e.content,c=e.contentIcon;return a&&(p=e.selectedContent?e.selectedContent:p,c=e.selectedContentIcon?e.selectedContentIcon:c),f.forwardRef(function(d,y){const{element:m,kind:l,size:_}=Ae(p??"",c??void 0,i),h=Ie(!!(a&&!e.selectedContent&&!e.selectedContentIcon),l);return v(ue,{...d,size:_,kind:h,children:m})})}function je(e,t){return e.getIntArrayValue(t)}function Me(e){return e.default??null}function $e(e){return e.value??null}function Ge(e){const{disabled:t,element:r,fragmentId:n,widgetMgr:o}=e,{clickMode:i,options:a,selectionVisualization:p,style:c,label:C,labelVisibility:d,help:y}=r,m=Y(),[l,_]=ce({getStateFromWidgetMgr:je,getDefaultStateFromProto:Me,getCurrStateFromProto:$e,updateWidgetMgrState:ke,element:r,widgetMgr:o,fragmentId:n}),h=(O,E)=>{const L=Pe(i,E,l);_({value:L,fromUi:!0})};let w;i===s.ClickMode.SINGLE_SELECT?w=k.radio:i===s.ClickMode.MULTI_SELECT&&(w=k.checkbox);const B=f.useMemo(()=>a.map((O,E)=>{const L=De(O,E,p,i,l,c);return v(L,{},`${O.content}-${E}`)}),[i,a,p,c,l]);return ee("div",{className:"stButtonGroup","data-testid":"stButtonGroup",children:[v(ae,{label:C,disabled:t,labelVisibility:te((d==null?void 0:d.value)??re.LabelVisibilityOptions.COLLAPSED),children:y&&v(ne,{children:v(oe,{content:y,placement:ie.TOP})})}),v(F,{disabled:t,mode:w,onClick:h,selected:i===s.ClickMode.MULTI_SELECT?l:Ce(l),overrides:{Root:{style:f.useCallback(()=>Te(c,m.spacing),[c,m.spacing])}},children:B})]})}const Ue=f.memo(Ge);export{Ue as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as o,E as K,_ as X,n as k,aR as lt,al as ut,cq as ct,M as J,cB as I,J as f,z as N,j as c,bs as dt,bF as pt,bt as ft,bc as bt,bu as mt,bp as M}from"./index.
|
1
|
+
import{r as o,E as K,_ as X,n as k,aR as lt,al as ut,cq as ct,M as J,cB as I,J as f,z as N,j as c,bs as dt,bF as pt,bt as ft,bc as bt,bu as mt,bp as M}from"./index.DuqdUleB.js";import{s as gt}from"./sprintf.C-r3gIuM.js";import{u as yt}from"./uniqueId.CVe3uxKs.js";import{u as It}from"./FormClearHelper.Bue0QSIn.js";import{I as ht}from"./InputInstructions.DpG38kbY.js";import{I as Tt}from"./input.BANuQoGH.js";import"./base-input.P8VGAZdC.js";var Q=o.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(K,X({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),o.createElement("path",{d:"M0 3v2h8V3H0z"}))});Q.displayName="Minus";var Y=o.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return o.createElement(K,X({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),o.createElement("path",{d:"M3 0v3H0v2h3v3h2V5h3V3H5V0H3z"}))});Y.displayName="Plus";const Ct=k("div",{target:"e1izef4y0"})(({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:t.sizes.minElementHeight,borderWidth:t.sizes.borderWidth,borderStyle:"solid",borderColor:t.colors.widgetBorderColor??t.colors.bgColor,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:t.radii.default,overflow:"hidden","&.focused":{borderColor:t.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:t.spacing.none}}})),wt=k("div",{target:"e1izef4y1"})({display:"flex",flexDirection:"row",alignSelf:"stretch"}),q=k("button",{target:"e1izef4y2"})(({theme:t})=>({margin:t.spacing.none,border:"none",height:t.sizes.full,display:"flex",alignItems:"center",width:t.sizes.numberInputControlsWidth,justifyContent:"center",color:t.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:t.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:t.colors.white,backgroundColor:t.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:last-of-type":{borderTopRightRadius:t.radii.default,borderBottomRightRadius:t.radii.default},"&:disabled":{cursor:"not-allowed",color:t.colors.fadedText40}})),St=k("div",{target:"e1izef4y3"})(({theme:t,clearable:e})=>({position:"absolute",marginRight:t.spacing.twoXS,left:0,right:`calc(${t.sizes.numberInputControlsWidth} * 2 + ${e?"1em":"0em"})`})),Vt=ut.getLogger("NumberInput");function vt(t){return f(t)||t===""?void 0:t}const xt=t=>(t.element.dataType===I.DataType.INT?t.widgetMgr.getIntValue(t.element):t.widgetMgr.getDoubleValue(t.element))??t.element.default??null,G=({step:t,dataType:e})=>t||(e===I.DataType.INT?1:.01),W=({value:t,format:e,step:r,dataType:h})=>{if(f(t))return null;let n=vt(e);if(f(n)&&J(r)){const l=r.toString();h===I.DataType.FLOAT&&r!==0&&l.includes(".")&&(n=`%0.${l.split(".")[1].length}f`)}if(f(n))return t.toString();try{return gt.sprintf(n,t)}catch(l){return Vt.warn(`Error in sprintf(${n}, ${t}): ${l}`),String(t)}},kt=(t,e,r)=>f(t)?!1:t-e>=r,Rt=(t,e,r)=>f(t)?!1:t+e<=r,Dt=({disabled:t,element:e,widgetMgr:r,width:h,theme:n,fragmentId:l})=>{var O;const{dataType:w,id:R,formId:p,default:B,format:A}=e,b=e.hasMin?e.min:-1/0,m=e.hasMax?e.max:1/0,[s,Z]=o.useState(G(e)),H=xt({element:e,widgetMgr:r}),[g,T]=o.useState(!1),[i,C]=o.useState(H),[P,S]=o.useState(W({value:H,...e,step:s})),[U,$]=o.useState(!1),D=o.useRef(null),L=o.useRef(yt("number_input_")),V=kt(i,s,b),v=Rt(i,s,m),_=ct({formId:p}),tt=_?r.allowFormEnterToSubmit(p):g,et=U&&h>n.breakpoints.hideWidgetDetails;o.useEffect(()=>{Z(G({step:e.step,dataType:e.dataType}))},[e.dataType,e.step]);const u=o.useCallback(({value:a,source:d})=>{var y;if(J(a)&&(b>a||a>m))(y=D.current)==null||y.reportValidity();else{const x=a??B??null;switch(w){case I.DataType.INT:r.setIntValue({id:R,formId:p},x,d,l);break;case I.DataType.FLOAT:r.setDoubleValue({id:R,formId:p},x,d,l);break;default:throw new Error("Invalid data type")}T(!1),C(x),S(W({value:x,dataType:w,format:A,step:s}))}},[b,m,D,r,l,s,w,R,p,B,A]),ot=o.useCallback(()=>{g&&u({value:i,source:{fromUi:!0}}),$(!1)},[g,i,u]),rt=o.useCallback(()=>{$(!0)},[]),j=o.useCallback(()=>{const{value:a}=e;e.setValue=!1,C(a??null),S(W({value:a??null,...e,step:s})),u({value:a??null,source:{fromUi:!1}})},[e,s,u]);o.useEffect(()=>{e.setValue?j():u({value:i,source:{fromUi:!1}})},[]),e.setValue&&j();const F=f(e.default)&&!t,nt=o.useCallback(()=>{const a=e.default??null;C(a),u({value:a,source:{fromUi:!0}})},[e]);It({element:e,widgetMgr:r,onFormCleared:nt});const at=a=>{const{value:d}=a.target;if(d==="")T(!0),C(null),S(null);else{let y;e.dataType===I.DataType.INT?y=parseInt(d,10):y=parseFloat(d),T(!0),C(y),S(d)}},z=o.useCallback(()=>{v&&(T(!0),u({value:(i??b)+s,source:{fromUi:!0}}))},[i,b,s,v]),E=o.useCallback(()=>{V&&(T(!0),u({value:(i??m)-s,source:{fromUi:!0}}))},[i,m,s,V]),st=o.useCallback(a=>{const{key:d}=a;switch(d){case"ArrowUp":a.preventDefault(),z();break;case"ArrowDown":a.preventDefault(),E();break}},[z,E]),it=o.useCallback(a=>{a.key==="Enter"&&(g&&u({value:i,source:{fromUi:!0}}),r.allowFormEnterToSubmit(p)&&r.submitForm(p,l))},[g,i,u,r,p,l]);return N("div",{className:"stNumberInput","data-testid":"stNumberInput",style:{width:h},children:[c(mt,{label:e.label,disabled:t,labelVisibility:dt((O=e.labelVisibility)==null?void 0:O.value),htmlFor:L.current,children:e.help&&c(pt,{children:c(ft,{content:e.help,placement:bt.TOP_RIGHT})})}),N(Ct,{className:U?"focused":"","data-testid":"stNumberInputContainer",children:[c(Tt,{type:"number",inputRef:D,value:P??"",placeholder:e.placeholder,onBlur:ot,onFocus:rt,onChange:at,onKeyPress:it,onKeyDown:st,clearable:F,clearOnEscape:F,disabled:t,"aria-label":e.label,id:L.current,overrides:{ClearIconContainer:{style:{padding:0}},ClearIcon:{props:{overrides:{Svg:{style:{color:n.colors.darkGray,padding:n.spacing.threeXS,height:n.sizes.clearIconSize,width:n.sizes.clearIconSize,":hover":{fill:n.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInputField",step:s,min:b,max:m,type:"number",inputMode:""},style:{lineHeight:n.lineHeights.inputWidget,paddingRight:n.spacing.sm,paddingLeft:n.spacing.sm,paddingBottom:n.spacing.sm,paddingTop:n.spacing.sm}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:{borderTopRightRadius:0,borderBottomRightRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingRight:0}}}}),h>n.breakpoints.hideNumberInputControls&&N(wt,{children:[c(q,{"data-testid":"stNumberInputStepDown",onClick:E,disabled:!V||t,tabIndex:-1,children:c(M,{content:Q,size:"xs",color:V?"inherit":n.colors.disabled})}),c(q,{"data-testid":"stNumberInputStepUp",onClick:z,disabled:!v||t,tabIndex:-1,children:c(M,{content:Y,size:"xs",color:v?"inherit":n.colors.disabled})})]})]}),et&&c(St,{clearable:F,children:c(ht,{dirty:g,value:P??"",inForm:_,allowEnterToSubmit:tt})})]})},Ht=lt(Dt);export{Ht as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{n as s,k as r,r as i,j as n}from"./index.
|
1
|
+
import{n as s,k as r,r as i,j as n}from"./index.DuqdUleB.js";import{P as m,R as c}from"./RenderInPortalIfExists.CGAGPcQq.js";const p=""+new URL("../media/balloon-0.Czj7AKwE.png",import.meta.url).href,f=""+new URL("../media/balloon-1.CNvFFrND.png",import.meta.url).href,d=""+new URL("../media/balloon-2.DTvC6B1t.png",import.meta.url).href,B=""+new URL("../media/balloon-3.CgSk4tbL.png",import.meta.url).href,L=""+new URL("../media/balloon-4.mbtFrzxf.png",import.meta.url).href,h=""+new URL("../media/balloon-5.CSwkUfRA.png",import.meta.url).href,t=300,a=121,e=20,g=80,u=1e3,x=r("from{transform:translateY(calc(100vh + ",t,"px));}to{transform:translateY(0);}"),_=s("img",{target:"eosrfo90"})(({theme:o})=>({position:"fixed",top:`${-t}px`,marginLeft:`${-a/2}px`,zIndex:o.zIndices.balloons,left:`${Math.random()*(g-e)+e}vw`,animationDelay:`${Math.random()*u}ms`,height:`${t}px`,width:`${a}px`,pointerEvents:"none",animationDuration:"750ms",animationName:x,animationTimingFunction:"ease-in",animationDirection:"normal",animationIterationCount:1,opacity:1})),w=30,l=[p,f,d,B,L,h],A=l.length,I=({particleType:o})=>n(_,{src:l[o]}),M=({scriptRunId:o})=>n(c,{children:n(m,{className:"stBalloons","data-testid":"stBalloons",scriptRunId:o,numParticleTypes:A,numParticles:w,ParticleComponent:I})}),S=i.memo(M);export{w as NUM_BALLOONS,S as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{n as r,bn as S,i as x,R as d,j as o,c4 as u,z as f,aE as g}from"./index.
|
1
|
+
import{n as r,bn as S,i as x,R as d,j as o,c4 as u,z as f,aE as g}from"./index.DuqdUleB.js";const $=r(S,{shouldForwardProp:x,target:"e1xotax90"})(({theme:e})=>({fontSize:e.fontSizes.sm,width:e.sizes.spinnerSize,height:e.sizes.spinnerSize,borderWidth:e.sizes.spinnerThickness,justifyContents:"center",padding:e.spacing.none,margin:e.spacing.none,borderColor:e.colors.borderColor,borderTopColor:e.colors.secondary,flexGrow:0,flexShrink:0})),m=r("div",{target:"e1xotax91"})(({theme:e,width:t,cache:n})=>({width:t,...n?{paddingBottom:e.spacing.lg,background:`linear-gradient(to bottom, ${e.colors.bgColor} 0%, ${e.colors.bgColor} 80%, transparent 100%)`}:null})),T=r("div",{target:"e1xotax92"})(({theme:e})=>({opacity:.6,fontSize:e.fontSizes.sm})),h=r("div",{target:"e1xotax93"})(({theme:e})=>({display:"flex",gap:e.spacing.sm,alignItems:"center",width:"100%"})),y=e=>{const t=Math.floor(e/3600),n=Math.floor(e%3600/60),s=e%60;if(t===0&&n===0)return`(${s.toFixed(1)} seconds)`;if(t===0){const l=`${n} minute${n===1?"":"s"}`,p=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${l}${p})`}const i=`${t} hour${t===1?"":"s"}`,a=n===0?"":`, ${n} minute${n===1?"":"s"}`,c=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${i}${a}${c})`};function b({width:e,element:t}){const{cache:n,showTime:s}=t,[i,a]=d.useState(0);return d.useEffect(()=>{if(!s)return;const c=setInterval(()=>{a(l=>l+.1)},100);return()=>clearInterval(c)},[s]),o(m,{className:u({stSpinner:!0,stCacheSpinner:n}),"data-testid":"stSpinner",width:e,cache:n,children:f(h,{children:[o($,{}),o(g,{source:t.text,allowHTML:!1}),s&&o(T,{children:y(i)})]})})}export{b as default};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import{bw as x,r as g,bJ as ae,bK as T,bL as w,y as le,C as ce,j as S,bM as se,ay as ue,z as de,bs as fe,aE as ge,bB as he,bt as be,bc as me,bN as ve,bO as pe}from"./index.
|
1
|
+
import{bw as x,r as g,bJ as ae,bK as T,bL as w,y as le,C as ce,j as S,bM as se,ay as ue,z as de,bs as fe,aE as ge,bB as he,bt as be,bc as me,bN as ve,bO as pe}from"./index.DuqdUleB.js";import{a as ye}from"./useBasicWidgetState.D572sX2t.js";import"./FormClearHelper.Bue0QSIn.js";var L=Object.freeze({default:"default",toggle:"toggle",toggle_round:"toggle"}),$e=Object.freeze({top:"top",right:"right",bottom:"bottom",left:"left"});function q(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),o.push.apply(o,r)}return o}function P(e){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?q(Object(o),!0).forEach(function(r){G(e,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):q(Object(o)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))})}return e}function G(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function ke(e){var t=e.$disabled,o=e.$checked,r=e.$error,i=e.$isIndeterminate,l=e.$theme,n=e.$isFocusVisible,c=l.colors;return t?c.tickFillDisabled:o||i?"transparent":r?c.borderNegative:n?c.borderSelected:c.tickBorder}function Te(e){var t=e.$labelPlacement,o=t===void 0?"":t,r=e.$theme,i=r.sizing,l=i.scale300,n;switch(o){case"top":n="Bottom";break;case"bottom":n="Top";break;case"left":n="Right";break;default:case"right":n="Left";break}return r.direction==="rtl"&&n==="Left"?n="Right":r.direction==="rtl"&&n==="Right"&&(n="Left"),G({},"padding".concat(n),l)}function we(e){var t=e.$disabled,o=e.$checked,r=e.$isIndeterminate,i=e.$error,l=e.$isHovered,n=e.$isActive,c=e.$theme,a=c.colors;return t?o||r?a.tickFillDisabled:a.tickFill:i&&(r||o)?n?a.tickFillErrorSelectedHoverActive:l?a.tickFillErrorSelectedHover:a.tickFillErrorSelected:i?n?a.tickFillErrorHoverActive:l?a.tickFillErrorHover:a.tickFillError:r||o?n?a.tickFillSelectedHoverActive:l?a.tickFillSelectedHover:a.tickFillSelected:n?a.tickFillActive:l?a.tickFillHover:a.tickFill}function xe(e){var t=e.$disabled,o=e.$theme,r=o.colors;return t?r.contentSecondary:r.contentPrimary}var M=x("label",function(e){var t=e.$disabled,o=e.$labelPlacement;return{flexDirection:o==="top"||o==="bottom"?"column":"row",display:"flex",alignItems:o==="top"||o==="bottom"?"center":"flex-start",cursor:t?"not-allowed":"pointer",userSelect:"none"}});M.displayName="Root";M.displayName="Root";var _=x("span",function(e){var t=e.$checked,o=e.$disabled,r=e.$error,i=e.$isIndeterminate,l=e.$theme,n=e.$isFocusVisible,c=l.sizing,a=l.animation,s=o?l.colors.tickMarkFillDisabled:r?l.colors.tickMarkFillError:l.colors.tickMarkFill,$=encodeURIComponent(`
|
2
2
|
<svg width="14" height="4" viewBox="0 0 14 4" fill="none" xmlns="http://www.w3.org/2000/svg">
|
3
3
|
<path d="M14 0.5H0V3.5H14V0.5Z" fill="`.concat(s,`"/>
|
4
4
|
</svg>
|
@@ -1 +1 @@
|
|
1
|
-
import{n as o,z as m,j as i,aE as S}from"./index.
|
1
|
+
import{n as o,z as m,j as i,aE as S}from"./index.DuqdUleB.js";import{S as g,T as y}from"./Toolbar.DBtrI961.js";import{w as W,u as b,E as M}from"./withFullScreenWrapper.4QDrgZxA.js";const E=o("div",{target:"evl31sl0"})(({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:t.spacing.lg,maxWidth:"100%",width:"fit-content"})),L=o("div",{target:"evl31sl1"})(({theme:t})=>({display:"flex",flexDirection:"column",alignItems:"stretch",width:"auto",flexGrow:0,">img":{borderRadius:t.radii.default}})),O=o("div",{target:"evl31sl2"})(({theme:t})=>({textAlign:"center",marginTop:t.spacing.xs,wordWrap:"break-word",padding:t.spacing.threeXS}));var p;(function(t){t[t.OriginalWidth=-1]="OriginalWidth",t[t.ColumnWidth=-2]="ColumnWidth",t[t.AutoWidth=-3]="AutoWidth",t[t.MinImageOrContainer=-4]="MinImageOrContainer",t[t.MaxImageOrContainer=-5]="MaxImageOrContainer"})(p||(p={}));function T({element:t,width:u,endpoints:f,disableFullscreenMode:x}){const{expanded:n,width:w,height:r,expand:C,collapse:h}=b(M),d=n?w:u;let l;const a=t.width;if([-1,-3,-4].includes(a))l=void 0;else if([-2,-5].includes(a))l=d;else if(a>0)l=a;else throw Error(`Invalid image width: ${a}`);const e={};return r&&n?(e.maxHeight=r,e.objectFit="contain"):(e.width=l,e.maxWidth="100%"),m(g,{width:d,height:r,useContainerWidth:n,topCentered:!0,children:[i(y,{target:g,isFullScreen:n,onExpand:C,onCollapse:h,disableFullscreenMode:x}),i(E,{className:"stImage","data-testid":"stImage",children:t.imgs.map((I,c)=>{const s=I;return m(L,{"data-testid":"stImageContainer",children:[i("img",{style:e,src:f.buildMediaURL(s.url),alt:c.toString()}),s.caption&&i(O,{"data-testid":"stImageCaption",style:e,children:i(S,{source:s.caption,allowHTML:!1,isCaption:!0,isLabel:!0})})]},c)})})]})}const R=W(T);export{R as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{n as p,aR as w,r as a,z as x,j as r,D as v,aE as h,aS as e,aT as k,aU as z,F as R,C as L}from"./index.
|
1
|
+
import{n as p,aR as w,r as a,z as x,j as r,D as v,aE as h,aS as e,aT as k,aU as z,F as R,C as L}from"./index.DuqdUleB.js";const C=p("button",{target:"e1rpgzpk0"})(({theme:o})=>({fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,color:o.colors.fadedText60,backgroundColor:o.colors.transparent,fontFamily:"inherit",margin:o.spacing.none,border:"none",boxShadow:"none",padding:o.spacing.none,"&:hover, &:active, &:focus":{border:"none",outline:"none",boxShadow:"none"},"&:hover":{color:o.colors.primary}})),B=p("div",{target:"e1rpgzpk1"})(({theme:o})=>({display:"flex",flexDirection:"row",gap:o.spacing.lg,"> span":{marginTop:o.spacing.twoXS}})),E=p("div",{target:"e1rpgzpk3"})(({theme:o})=>({display:"flex",flexDirection:"column",gap:o.spacing.sm,alignItems:"start",justifyContent:"center",overflow:"hidden",minHeight:"100%",fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,div:{display:"inline-flex"}}));function m(o){const t=L(o);return{Body:{props:{"data-testid":"stToast",className:"stToast"},style:{display:"flex",flexDirection:"row",gap:o.spacing.md,width:o.sizes.toastWidth,marginTop:o.spacing.sm,borderTopLeftRadius:o.radii.default,borderTopRightRadius:o.radii.default,borderBottomLeftRadius:o.radii.default,borderBottomRightRadius:o.radii.default,paddingTop:o.spacing.lg,paddingBottom:o.spacing.lg,paddingLeft:o.spacing.twoXL,paddingRight:o.spacing.twoXL,backgroundColor:t?o.colors.gray10:o.colors.gray90,color:o.colors.bodyText,boxShadow:t?"0px 4px 16px rgba(0, 0, 0, 0.16)":"0px 4px 16px rgba(0, 0, 0, 0.7)"}},CloseIcon:{style:{color:o.colors.fadedText40,width:o.fontSizes.lg,height:o.fontSizes.lg,marginRight:`calc(-1 * ${o.spacing.lg} / 2)`,":hover":{color:o.colors.bodyText}}}}}function D(o){if(o.length>104){let s=o.replace(/^(.{104}[^\s]*).*/,"$1");return s.length>104&&(s=s.substring(0,104).split(" ").slice(0,-1).join(" ")),s.trim()}return o}function H({theme:o,body:t,icon:s,width:y}){const n=D(t),d=t!==n,[i,b]=a.useState(!d),[u,S]=a.useState(0),f=a.useCallback(()=>{b(!i)},[i]),c=a.useMemo(()=>m(o),[o]),l=a.useMemo(()=>x(B,{expanded:i,children:[s&&r(v,{iconValue:s,size:"xl",testid:"stToastDynamicIcon"}),x(E,{children:[r(h,{source:i?t:n,allowHTML:!1,isToast:!0}),d&&r(C,{"data-testid":"stToastViewButton",onClick:f,children:i?"view less":"view more"})]})]}),[d,i,t,s,n,f]);a.useEffect(()=>{if(o.inSidebar)return;const g=e.info(l,{overrides:{...c}});return S(g),()=>{e.update(g,{overrides:{Body:{style:{transitionDuration:0}}}}),e.clear(g)}},[]),a.useEffect(()=>{e.update(u,{children:l,overrides:{...c}})},[u,l,c]);const T=r(z,{kind:k.ERROR,body:"Streamlit API Error: `st.toast` cannot be called directly on the sidebar with `st.sidebar.toast`. See our `st.toast` API [docs](https://docs.streamlit.io/develop/api-reference/status/st.toast) for more information.",width:y});return r(R,{children:o.inSidebar&&T})}const M=w(H);export{M as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{n as f,r as a,j as c}from"./index.
|
1
|
+
import{n as f,r as a,j as c}from"./index.DuqdUleB.js";const E=f("div",{target:"ea9qfvi0"})(()=>({lineHeight:0})),y=f("audio",{target:"ea9qfvi1"})(({theme:t})=>({width:"100%",height:t.sizes.minElementHeight,margin:0,padding:0}));function A({element:t,endpoints:l,elementMgr:o}){const i=a.useRef(null),{startTime:n,endTime:d,loop:u,autoplay:p}=t,m=a.useMemo(()=>{if(!t.id)return!0;const e=o.getElementState(t.id,"preventAutoplay");return e||o.setElementState(t.id,"preventAutoplay",!0),e??!1},[t.id,o]);a.useEffect(()=>{i.current&&(i.current.currentTime=n)},[n]),a.useEffect(()=>{const e=i.current,r=()=>{e&&(e.currentTime=t.startTime)};return e&&e.addEventListener("loadedmetadata",r),()=>{e&&e.removeEventListener("loadedmetadata",r)}},[t]),a.useEffect(()=>{const e=i.current;if(!e)return;let r=!1;const s=()=>{d>0&&e.currentTime>=d&&(u?(e.currentTime=n||0,e.play()):r||(r=!0,e.pause()))};return d>0&&e.addEventListener("timeupdate",s),()=>{e&&d>0&&e.removeEventListener("timeupdate",s)}},[d,u,n]),a.useEffect(()=>{const e=i.current;if(!e)return;const r=()=>{u&&(e.currentTime=n||0,e.play())};return e.addEventListener("ended",r),()=>{e&&e.removeEventListener("ended",r)}},[u,n]);const v=l.buildMediaURL(t.url);return c(E,{children:c(y,{className:"stAudio","data-testid":"stAudio",ref:i,controls:!0,autoPlay:p&&!m,src:v})})}export{A as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{n as e,z as t,j as r,aE as o}from"./index.
|
1
|
+
import{n as e,z as t,j as r,aE as o}from"./index.DuqdUleB.js";import{P as i}from"./ProgressBar.B_WJAIyy.js";const l=e("div",{target:"e1675qd10"})(({theme:s})=>({paddingBottom:s.spacing.sm,lineHeight:"normal"}));function g({element:s,width:a}){return t("div",{className:"stProgress","data-testid":"stProgress",children:[r(l,{children:r(o,{source:s.text,allowHTML:!1,isLabel:!0})}),r(i,{value:s.value,width:a})]})}export{g as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as h,E as V,_ as z,n as w,z as p,j as r,b8 as y,bp as g,co as E,bq as U,cp as L,a_ as B,F as k,R as N,aC as W,bk as T,J as u,bm as D,bl as H,bs as A,bF as R,bt as _,bc as $,bu as O}from"./index.
|
1
|
+
import{r as h,E as V,_ as z,n as w,z as p,j as r,b8 as y,bp as g,co as E,bq as U,cp as L,a_ as B,F as k,R as N,aC as W,bk as T,J as u,bm as D,bl as H,bs as A,bF as R,bt as _,bc as $,bu as O}from"./index.DuqdUleB.js";import{a as S}from"./axios.upsvKRUO.js";import{F as X}from"./FormClearHelper.Bue0QSIn.js";import{S as x,I as q,b as G,c as J,d as K,C as j,e as Q,f as Y,h as Z,i as ee,g as b,F as f,j as te,k as se,l as ie,s as le,m as ae,n as re}from"./FileDropzone.BFkJKygp.js";import{S as ne,P as oe}from"./ProgressBar.B_WJAIyy.js";import{u as de}from"./Hooks.kV16_k1-.js";import{U as m}from"./UploadFileInfo.C-jY39rj.js";var C=h.forwardRef(function(l,o){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(V,z({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},l,{ref:o}),h.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}))});C.displayName="Error";const ce=w("div",{target:"egc9vxm0"})(({theme:l})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:l.spacing.twoXS,marginBottom:l.spacing.twoXS})),pe=w("div",{target:"egc9vxm1"})(({theme:l})=>({display:"flex",alignItems:"center",justifyContent:"center",color:l.colors.fadedText40})),ue=({currentPage:l,totalPages:o,onNext:e,onPrevious:t})=>p(ce,{"data-testid":"stFileUploaderPagination",children:[r(x,{children:`Showing page ${l} of ${o}`}),p(pe,{children:[r(U,{onClick:t,kind:y.MINIMAL,children:r(g,{content:E,size:"xl"})}),r(U,{onClick:e,kind:y.MINIMAL,children:r(g,{content:L,size:"xl"})})]})]}),I=(l,o)=>Math.ceil(l.length/o),he=l=>B(({pageSize:e,items:t,resetOnAdd:s,...a})=>{const[i,n]=h.useState(0),[d,F]=h.useState(I(t,e)),c=de(t);h.useEffect(()=>{c&&c.length!==t.length&&F(I(t,e)),c&&c.length<t.length?s&&n(0):i+1>=d&&n(d-1)},[t,i,e,c,s,d]);const v=()=>{n(Math.min(i+1,d-1))},M=()=>{n(Math.max(0,i-1))},P=t.slice(i*e,i*e+e);return p(k,{children:[r(l,{items:P,...a}),t.length>e?r(ue,{pageSize:e,totalPages:d,currentPage:i+1,onNext:v,onPrevious:M}):null]})},l),ge=({fileInfo:l})=>l.status.type==="uploading"?r(oe,{value:l.status.progress,size:ne.SMALL}):l.status.type==="error"?p(ee,{children:[r(Y,{"data-testid":"stFileUploaderFileErrorMessage",children:l.status.errorMessage}),r(Z,{children:r(g,{content:C,size:"lg"})})]}):l.status.type==="uploaded"?r(x,{children:b(l.size,f.Byte)}):null,me=({fileInfo:l,onDelete:o})=>p(Q,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[r(G,{children:r(g,{content:q,size:"twoXL"})}),p(J,{className:"stFileUploaderFileData",children:[r(K,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:l.name,children:l.name}),r(ge,{fileInfo:l})]}),r("div",{"data-testid":"stFileUploaderDeleteBtn",children:r(U,{onClick:()=>o(l.id),kind:y.MINIMAL,children:r(g,{content:j,size:"lg"})})})]}),fe=({items:l,onDelete:o})=>r(ie,{children:l.map(e=>r(se,{children:r(me,{fileInfo:e,onDelete:o})},e.id))}),Fe=he(fe),ye=l=>r(te,{children:r(Fe,{...l})});class ve extends N.PureComponent{constructor(o){super(o),this.formClearHelper=new X,this.localFileIdCounter=1,this.forceUpdatingStatus=!1,this.componentDidUpdate=()=>{if(this.status!=="ready")return;const e=this.createWidgetValue(),{element:t,widgetMgr:s,fragmentId:a}=this.props,i=s.getFileUploaderStateValue(t);W(e,i)||s.setFileUploaderStateValue(t,e,{fromUi:!0},a)},this.reset=()=>{this.setState({files:[]})},this.dropHandler=(e,t)=>{const{element:s}=this.props,{multipleFiles:a}=s;if(!a&&e.length===0&&t.length>1){const i=t.findIndex(n=>n.errors.length===1&&n.errors[0].code==="too-many-files");i>=0&&(e.push(t[i].file),t.splice(i,1))}if(this.props.uploadClient.fetchFileURLs(e).then(i=>{if(!a&&e.length>0){const n=this.state.files.find(d=>d.status.type!=="error");n&&(this.forceUpdatingStatus=!0,this.deleteFile(n.id),this.forceUpdatingStatus=!1)}T(i,e).forEach(([n,d])=>{this.uploadFile(n,d)})}).catch(i=>{this.addFiles(e.map(n=>new m(n.name,n.size,this.nextLocalFileId(),{type:"error",errorMessage:i})))}),t.length>0){const i=t.map(n=>{const{file:d}=n;return new m(d.name,d.size,this.nextLocalFileId(),{type:"error",errorMessage:this.getErrorMessage(n.errors[0].code,n.file)})});this.addFiles(i)}},this.uploadFile=(e,t)=>{const s=S.CancelToken.source(),a=new m(t.name,t.size,this.nextLocalFileId(),{type:"uploading",cancelToken:s,progress:1});this.addFile(a),this.props.uploadClient.uploadFile(this.props.element,e.uploadUrl,t,i=>this.onUploadProgress(i,a.id),s.token).then(()=>this.onUploadComplete(a.id,e)).catch(i=>{S.isCancel(i)||this.updateFile(a.id,a.setStatus({type:"error",errorMessage:i?i.toString():"Unknown error"}))})},this.onUploadComplete=(e,t)=>{const s=this.getFile(e);u(s)||s.status.type!=="uploading"||this.updateFile(s.id,s.setStatus({type:"uploaded",fileId:t.fileId,fileUrls:t}))},this.getErrorMessage=(e,t)=>{switch(e){case"file-too-large":return`File must be ${b(this.maxUploadSizeInBytes,f.Byte)} or smaller.`;case"file-invalid-type":return`${t.type} files are not allowed.`;case"file-too-small":return"File size is too small.";case"too-many-files":return"Only one file is allowed.";default:return"Unexpected error. Please try again."}},this.deleteFile=e=>{const t=this.getFile(e);u(t)||(t.status.type==="uploading"&&t.status.cancelToken.cancel(),t.status.type==="uploaded"&&t.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(t.status.fileUrls.deleteUrl),this.removeFile(e))},this.addFile=e=>{this.setState(t=>({files:[...t.files,e]}))},this.addFiles=e=>{this.setState(t=>({files:[...t.files,...e]}))},this.removeFile=e=>{this.setState(t=>({files:t.files.filter(s=>s.id!==e)}))},this.getFile=e=>this.state.files.find(t=>t.id===e),this.updateFile=(e,t)=>{this.setState(s=>({files:s.files.map(a=>a.id===e?t:a)}))},this.onUploadProgress=(e,t)=>{const s=this.getFile(t);if(u(s)||s.status.type!=="uploading")return;const a=Math.round(e.loaded*100/e.total);s.status.progress!==a&&this.updateFile(t,s.setStatus({type:"uploading",cancelToken:s.status.cancelToken,progress:a}))},this.onFormCleared=()=>{this.setState({files:[]},()=>{const e=this.createWidgetValue();if(u(e))return;const{widgetMgr:t,element:s,fragmentId:a}=this.props;t.setFileUploaderStateValue(s,e,{fromUi:!0},a)})},this.state=this.initialValue}get initialValue(){const o={files:[],newestServerFileId:0},{widgetMgr:e,element:t}=this.props,s=e.getFileUploaderStateValue(t);if(u(s))return o;const{uploadedFileInfo:a}=s;return u(a)||a.length===0?o:{files:a.map(i=>{const n=i.name,d=i.size,F=i.fileId,c=i.fileUrls;return new m(n,d,this.nextLocalFileId(),{type:"uploaded",fileId:F,fileUrls:c})})}}componentWillUnmount(){this.formClearHelper.disconnect()}get maxUploadSizeInBytes(){const o=this.props.element.maxUploadSizeMb;return le(o,f.Megabyte,f.Byte)}get status(){const o=e=>e.status.type==="uploading";return this.state.files.some(o)||this.forceUpdatingStatus?"updating":"ready"}componentDidMount(){const o=this.createWidgetValue(),{element:e,widgetMgr:t,fragmentId:s}=this.props;t.getFileUploaderStateValue(e)===void 0&&t.setFileUploaderStateValue(e,o,{fromUi:!1},s)}createWidgetValue(){const o=this.state.files.filter(e=>e.status.type==="uploaded").map(e=>{const{name:t,size:s,status:a}=e,{fileId:i,fileUrls:n}=a;return new D({fileId:i,fileUrls:n,name:t,size:s})});return new H({uploadedFileInfo:o})}render(){var d;const{files:o}=this.state,{element:e,disabled:t,widgetMgr:s,width:a}=this.props,i=e.type;this.formClearHelper.manageFormClearListener(s,e.formId,this.onFormCleared);const n=o.slice().reverse();return p(re,{className:"stFileUploader","data-testid":"stFileUploader",width:a,children:[r(O,{label:e.label,disabled:t,labelVisibility:A((d=e.labelVisibility)==null?void 0:d.value),children:e.help&&r(R,{children:r(_,{content:e.help,placement:$.TOP_RIGHT})})}),r(ae,{onDrop:this.dropHandler,multiple:e.multipleFiles,acceptedExtensions:i,maxSizeBytes:this.maxUploadSizeInBytes,label:e.label,disabled:t}),n.length>0&&r(ye,{items:n,pageSize:3,onDelete:this.deleteFile,resetOnAdd:!0})]})}nextLocalFileId(){return this.localFileIdCounter++}}export{ve as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{n as T,r,y as W,c0 as C,c1 as V,z as L,j as l,bs as O,bF as P,bt as $,bc as k,bu as N,b$ as B,c2 as E,bX as F,bD as A,c3 as D}from"./index.
|
1
|
+
import{n as T,r,y as W,c0 as C,c1 as V,z as L,j as l,bs as O,bF as P,bt as $,bc as k,bu as N,b$ as B,c2 as E,bX as F,bD as A,c3 as D}from"./index.DuqdUleB.js";import{a as H}from"./useBasicWidgetState.D572sX2t.js";import"./FormClearHelper.Bue0QSIn.js";const U=T("div",{target:"euzcfsp0"})(({theme:s})=>({"span[aria-disabled='true']":{background:s.colors.fadedText05}})),j=(s,t)=>s.getIntArrayValue(t),G=s=>s.default??null,K=s=>s.value??null,X=(s,t,a,u)=>{t.setIntArrayValue(s,a.value,{fromUi:a.fromUi},u)},Y=s=>{var S;const{element:t,widgetMgr:a,width:u,fragmentId:y}=s,e=W(),[n,g]=H({getStateFromWidgetMgr:j,getDefaultStateFromProto:G,getCurrStateFromProto:K,updateWidgetMgrState:X,element:t,widgetMgr:a,fragmentId:y}),m=t.maxSelections>0&&n.length>=t.maxSelections,f=r.useMemo(()=>{if(t.maxSelections===0)return"No results";if(n.length===t.maxSelections){const o=t.maxSelections!==1?"options":"option";return`You can only select up to ${t.maxSelections} ${o}. Remove an option first.`}return"No results"},[t.maxSelections,n.length]),v=r.useMemo(()=>n.map(o=>{const i=t.options[o];return{value:o.toString(),label:i}}),[t.options,n]),h=r.useCallback(o=>{const i=()=>{var d;const p=(d=o.option)==null?void 0:d.value;return parseInt(p,10)};switch(o.type){case"remove":return C(n,i());case"clear":return[];case"select":return n.concat([i()]);default:throw new Error(`State transition is unknown: ${o.type}`)}},[n]),x=r.useCallback(o=>{t.maxSelections&&o.type==="select"&&n.length>=t.maxSelections||g({value:h(o),fromUi:!0})},[t.maxSelections,h,g,n.length]),z=r.useCallback((o,i)=>{if(m)return[];const p=o.filter(d=>!n.includes(Number(d.value)));return V(p,i)},[m,n]),w={width:u},{options:c}=t,b=c.length===0?!0:s.disabled,I=c.length===0?"No options to select.":t.placeholder,R=c.map((o,i)=>({label:o,value:i.toString()})),M=c.length>10;return L("div",{className:"stMultiSelect","data-testid":"stMultiSelect",style:w,children:[l(N,{label:t.label,disabled:b,labelVisibility:O((S=t.labelVisibility)==null?void 0:S.value),children:t.help&&l(P,{children:l($,{content:t.help,placement:k.TOP_RIGHT})})}),l(U,{children:l(B,{options:R,labelKey:"label",valueKey:"value","aria-label":t.label,placeholder:I,type:E.select,multi:!0,onChange:x,value:v,disabled:b,size:"compact",noResultsMsg:f,filterOptions:z,closeOnSelect:!1,overrides:{Popover:{props:{overrides:{Body:{style:()=>({marginTop:e.spacing.px})}}}},SelectArrow:{component:F,props:{overrides:{Svg:{style:()=>({width:e.iconSizes.xl,height:e.iconSizes.xl})}}}},IconsContainer:{style:()=>({paddingRight:e.spacing.sm})},ControlContainer:{style:{minHeight:e.sizes.minElementHeight,borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth}},Placeholder:{style:()=>({flex:"inherit",opacity:"0.7"})},ValueContainer:{style:()=>({paddingLeft:e.spacing.sm,paddingTop:e.spacing.none,paddingBottom:e.spacing.none,paddingRight:e.spacing.none})},ClearIcon:{props:{overrides:{Svg:{style:{color:e.colors.darkGray,padding:e.spacing.threeXS,height:e.sizes.clearIconSize,width:e.sizes.clearIconSize,cursor:"pointer",":hover":{fill:e.colors.bodyText}}}}}},SearchIcon:{style:{color:e.colors.darkGray}},Tag:{props:{overrides:{Root:{style:{borderTopLeftRadius:e.radii.md,borderTopRightRadius:e.radii.md,borderBottomRightRadius:e.radii.md,borderBottomLeftRadius:e.radii.md,fontSize:e.fontSizes.md,paddingLeft:e.spacing.sm,marginLeft:e.spacing.none,marginRight:e.spacing.sm,height:`calc(${e.sizes.minElementHeight} - 2 * ${e.spacing.xs})`,maxWidth:`calc(100% - ${e.spacing.lg})`,cursor:"default !important"}},Action:{style:{paddingLeft:0}},ActionIcon:{props:{overrides:{Svg:{style:{width:"0.625em",height:"0.625em"}}}}}}}},MultiValue:{props:{overrides:{Root:{style:{fontSize:e.fontSizes.sm}}}}},Input:{props:{readOnly:A&&M===!1?"readonly":null}},Dropdown:{component:D}}})})]})},Q=r.memo(Y);export{Q as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{n as c,b6 as v,ay as y,b7 as l,b8 as t,j as s,b9 as C,ba as S}from"./index.
|
1
|
+
import{n as c,b6 as v,ay as y,b7 as l,b8 as t,j as s,b9 as C,ba as S}from"./index.DuqdUleB.js";function k(o,i){switch(o){case l.XSMALL:return{padding:`${i.spacing.twoXS} ${i.spacing.sm}`,fontSize:i.fontSizes.sm};case l.SMALL:return{padding:`${i.spacing.twoXS} ${i.spacing.md}`};case l.LARGE:return{padding:`${i.spacing.md} ${i.spacing.md}`};default:return{padding:`${i.spacing.xs} ${i.spacing.md}`}}}const g=c("a",{target:"efj1jhq0"})(({fluidWidth:o,size:i,theme:r})=>{const a=typeof o=="number"?`${o}px`:"100%";return{display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:r.fontWeights.normal,padding:`${r.spacing.xs} ${r.spacing.md}`,borderRadius:r.radii.default,minHeight:r.sizes.minElementHeight,margin:0,lineHeight:r.lineHeights.base,color:r.colors.primary,textDecoration:"none",width:o?a:"auto",userSelect:"none","&:visited":{color:r.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${y(r.colors.primary,.5)}`},"&:hover":{textDecoration:"none"},"&:active":{textDecoration:"none"},...k(i,r)}}),B=c(g,{target:"efj1jhq1"})(({theme:o})=>({backgroundColor:o.colors.primary,color:o.colors.white,border:`${o.sizes.borderWidth} solid ${o.colors.primary}`,"&:hover":{backgroundColor:v(o.colors.primary,.05),color:o.colors.white},"&:active":{backgroundColor:"transparent",color:o.colors.primary},"&:visited:not(:active)":{color:o.colors.white},"&[disabled], &[disabled]:hover, &[disabled]:active, &[disabled]:visited":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),x=c(g,{target:"efj1jhq2"})(({theme:o})=>({backgroundColor:o.colors.lightenedBg05,color:o.colors.bodyText,border:`${o.sizes.borderWidth} solid ${o.colors.borderColor}`,"&:visited":{color:o.colors.bodyText},"&:hover":{borderColor:o.colors.primary,color:o.colors.primary},"&:active":{color:o.colors.white,borderColor:o.colors.primary,backgroundColor:o.colors.primary},"&:focus:not(:active)":{borderColor:o.colors.primary,color:o.colors.primary},"&[disabled], &[disabled]:hover, &[disabled]:active":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}})),$=c(g,{target:"efj1jhq3"})(({theme:o})=>({padding:o.spacing.none,backgroundColor:o.colors.transparent,color:o.colors.bodyText,border:"none","&:visited":{color:o.colors.bodyText},"&:hover":{color:o.colors.primary},"&:active":{color:o.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{color:o.colors.primary,boxShadow:`0 0 0 0.2rem ${y(o.colors.primary,.5)}`},"&[disabled], &[disabled]:hover, &[disabled]:active":{backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}}));function L({kind:o,size:i,disabled:r,fluidWidth:a,children:d,autoFocus:n,href:e,rel:u,target:b,onClick:f}){let p=B;return o===t.SECONDARY?p=x:o===t.TERTIARY&&(p=$),s(p,{kind:o,size:i||l.MEDIUM,fluidWidth:a||!1,disabled:r||!1,autoFocus:n||!1,href:e,target:b,rel:u,onClick:f,tabIndex:r?-1:0,"data-testid":`stBaseLinkButton-${o}`,children:d})}function T(o){const{disabled:i,element:r,width:a}=o,d={width:a};let n=t.SECONDARY;r.type==="primary"?n=t.PRIMARY:r.type==="tertiary"&&(n=t.TERTIARY);const e=r.help?a:!0,u=b=>{o.disabled&&b.preventDefault()};return s("div",{className:"stLinkButton","data-testid":"stLinkButton",style:d,children:s(C,{help:r.help,children:s(L,{kind:n,size:l.SMALL,disabled:i,onClick:u,fluidWidth:r.useContainerWidth?e:!1,href:r.url,target:"_blank",rel:"noreferrer","aria-disabled":i,children:s(S,{icon:r.icon,label:r.label})})})})}export{T as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{n as U,r as s,bj as V,j as l}from"./index.
|
1
|
+
import{n as U,r as s,bj as V,j as l}from"./index.DuqdUleB.js";const P=U("iframe",{target:"eymnmwl0"})(({theme:a})=>({colorScheme:"normal",border:"none",padding:a.spacing.none,margin:a.spacing.none,width:"100%",aspectRatio:"16 / 9"})),R=528;function w({element:a,width:f,endpoints:m,elementMgr:c}){const i=s.useRef(null),{type:E,url:p,startTime:n,subtitles:y,endTime:d,loop:u,autoplay:T,muted:h}=a,S=s.useMemo(()=>{if(!a.id)return!0;const e=c.getElementState(a.id,"preventAutoplay");return e||c.setElementState(a.id,"preventAutoplay",!0),e??!1},[a.id,c]);s.useEffect(()=>{i.current&&(i.current.currentTime=n)},[n]),s.useEffect(()=>{const e=i.current,t=()=>{e&&(e.currentTime=a.startTime)};return e&&e.addEventListener("loadedmetadata",t),()=>{e&&e.removeEventListener("loadedmetadata",t)}},[a]),s.useEffect(()=>{const e=i.current;if(!e)return;let t=!1;const o=()=>{d>0&&e.currentTime>=d&&(u?(e.currentTime=n||0,e.play()):t||(t=!0,e.pause()))};return d>0&&e.addEventListener("timeupdate",o),()=>{e&&d>0&&e.removeEventListener("timeupdate",o)}},[d,u,n]),s.useEffect(()=>{const e=i.current;if(!e)return;const t=()=>{u&&(e.currentTime=n||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}},[u,n]);const g=e=>{const{startTime:t,endTime:o,loop:L,autoplay:N,muted:b}=a,r=new URL(e);if(t&&!isNaN(t)&&r.searchParams.append("start",t.toString()),o&&!isNaN(o)&&r.searchParams.append("end",o.toString()),L){r.searchParams.append("loop","1");const v=r.pathname.split("/").pop();v&&r.searchParams.append("playlist",v)}return N&&r.searchParams.append("autoplay","1"),b&&r.searchParams.append("mute","1"),r.toString()};return E===V.Type.YOUTUBE_IFRAME?l(P,{className:"stVideo","data-testid":"stVideo",title:p,src:g(p),allow:"autoplay; encrypted-media",allowFullScreen:!0}):l("video",{className:"stVideo","data-testid":"stVideo",ref:i,controls:!0,muted:h,autoPlay:T&&!S,src:m.buildMediaURL(p),style:{width:f,height:f===0?R:void 0},crossOrigin:void 0,children:y&&y.map((e,t)=>l("track",{kind:"captions",src:m.buildMediaURL(`${e.url}`),label:`${e.label}`,default:t===0},t))})}export{w as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as i,j as g,bs as b,bP as m}from"./index.
|
1
|
+
import{r as i,j as g,bs as b,bP as m}from"./index.DuqdUleB.js";import{a as f}from"./useBasicWidgetState.D572sX2t.js";import"./FormClearHelper.Bue0QSIn.js";const p=(t,e)=>t.getStringValue(e),C=t=>t.default??null,d=t=>t.value??null,P=(t,e,r,o)=>{e.setStringValue(t,r.value,{fromUi:r.fromUi},o)},S=({element:t,disabled:e,widgetMgr:r,width:o,fragmentId:s})=>{var l;const[u,a]=f({getStateFromWidgetMgr:p,getDefaultStateFromProto:C,getCurrStateFromProto:d,updateWidgetMgrState:P,element:t,widgetMgr:r,fragmentId:s}),n=i.useCallback(c=>{a({value:c,fromUi:!0})},[a]);return g(m,{label:t.label,labelVisibility:b((l=t.labelVisibility)==null?void 0:l.value),help:t.help,onChange:n,disabled:e,width:o,value:u})},v=i.memo(S);export{v as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as s,y as U,cq as T,z as k,j as l,bs as A,bF as L,bt as P,bc as B,bu as D}from"./index.
|
1
|
+
import{r as s,y as U,cq as T,z as k,j as l,bs as A,bF as L,bt as P,bc as B,bu as D}from"./index.DuqdUleB.js";import{u as j}from"./uniqueId.CVe3uxKs.js";import{u as _,a as q,b as K}from"./useOnInputChange.D9rTVyjn.js";import{I as O}from"./InputInstructions.DpG38kbY.js";import{a as $}from"./useBasicWidgetState.D572sX2t.js";import{T as G}from"./textarea.CmSZv6UE.js";import"./inputUtils.CQWz5UKz.js";import"./FormClearHelper.Bue0QSIn.js";import"./base-input.P8VGAZdC.js";const W=(a,t)=>a.getStringValue(t)??t.default??null,N=a=>a.default??null,w=a=>a.value??null,J=(a,t,o,u)=>{t.setStringValue(a,o.value,{fromUi:o.fromUi},u)},Q=({disabled:a,element:t,widgetMgr:o,fragmentId:u,width:h})=>{var x;const b=s.useRef(j("text_area_")).current,[r,n]=s.useState(!1),[S,g]=s.useState(!1),[i,d]=s.useState(W(o,t)??null),y=s.useCallback(()=>{d(t.default??null),n(!0)},[t]),[I,c]=$({getStateFromWidgetMgr:W,getDefaultStateFromProto:N,getCurrStateFromProto:w,updateWidgetMgrState:J,element:t,widgetMgr:o,fragmentId:u,onFormCleared:y});_(I,i,d,r);const e=U(),p=s.useCallback(()=>{n(!1),c({value:i,fromUi:!0})},[i,c]),F=s.useCallback(()=>{r&&p(),g(!1)},[r,p]),V=s.useCallback(()=>{g(!0)},[]),C=q({formId:t.formId,maxChars:t.maxChars,setDirty:n,setUiValue:d,setValueWithSource:c}),v=K(t.formId,p,r,o,u,!0),z={width:h},{height:f,placeholder:E,formId:m}=t,H=T({formId:m})?o.allowFormEnterToSubmit(m):r,R=S&&h>e.breakpoints.hideWidgetDetails;return k("div",{className:"stTextArea","data-testid":"stTextArea",style:z,children:[l(D,{label:t.label,disabled:a,labelVisibility:A((x=t.labelVisibility)==null?void 0:x.value),htmlFor:b,children:t.help&&l(L,{children:l(P,{content:t.help,placement:B.TOP_RIGHT})})}),l(G,{value:i??"",placeholder:E,onBlur:F,onFocus:V,onChange:C,onKeyDown:v,"aria-label":t.label,disabled:a,id:b,overrides:{Input:{style:{lineHeight:e.lineHeights.inputWidget,height:f?`${f}px`:"",minHeight:e.sizes.largestElementHeight,resize:"vertical","::placeholder":{opacity:"0.7"},paddingRight:e.spacing.lg,paddingLeft:e.spacing.lg,paddingBottom:e.spacing.lg,paddingTop:e.spacing.lg}},Root:{props:{"data-testid":"stTextAreaRootElement"},style:{borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth}}}}),R&&l(O,{dirty:r,value:i??"",maxLength:t.maxChars,type:"multiline",inForm:T({formId:m}),allowEnterToSubmit:H})]})},rt=s.memo(Q);export{rt as default};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import{r as u,E as $,_ as H,a$ as ut,bk as Ht,bl as Vt,bm as jt,J as G,M as X,R as yt,aF as Gt,n as x,bn as Xt,z,j as v,bo as qt,b8 as Yt,bp as Jt,bq as Kt,al as Zt,y as Qt,br as Q,az as te,aC as ee,bs as ie,bt as se,bc as ne,bu as re}from"./index.2EE80u0h.js";import{u as oe,F as ae}from"./FormClearHelper.DpwWkrvV.js";import{T as le,a as pt}from"./Toolbar.D6p42Hno.js";import{u as ce}from"./Hooks.BQiFiHd5.js";import{c as de}from"./createDownloadLinkElement.DZMwyjvU.js";import{F as he,D as ue}from"./FileDownload.esm.CuayiK6T.js";var wt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("g",{fill:"none"},u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24})),u.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),u.createElement("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});wt.displayName="Mic";var Ct=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("rect",{width:24,height:24,fill:"none"}),u.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))});Ct.displayName="Pause";var St=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("rect",{width:24,height:24,fill:"none"}),u.createElement("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 000-1.69L9.54 5.98A.998.998 0 008 6.82z"}))});St.displayName="PlayArrow";var Rt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),u.createElement("path",{d:"M17.65 6.35a7.95 7.95 0 00-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 007.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 01-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0112 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z"}))});Rt.displayName="Refresh";var Et=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("g",{fill:"none"},u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24})),u.createElement("path",{fillRule:"evenodd",d:"M9 16h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}))});Et.displayName="StopCircle";function E(s,t,e,i){return new(e||(e=Promise))(function(r,n){function a(c){try{d(i.next(c))}catch(l){n(l)}}function o(c){try{d(i.throw(c))}catch(l){n(l)}}function d(c){var l;c.done?r(c.value):(l=c.value,l instanceof e?l:new e(function(p){p(l)})).then(a,o)}d((i=i.apply(s,t||[])).next())})}let V=class{constructor(){this.listeners={}}on(t,e,i){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(e),i==null?void 0:i.once){const r=()=>{this.un(t,r),this.un(t,e)};return this.on(t,r),r}return()=>this.un(t,e)}un(t,e){var i;(i=this.listeners[t])===null||i===void 0||i.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach(i=>i(...e))}};const mt={decode:function(s,t){return E(this,void 0,void 0,function*(){const e=new AudioContext({sampleRate:t});return e.decodeAudioData(s).finally(()=>e.close())})},createBuffer:function(s,t){return typeof s[0]=="number"&&(s=[s]),function(e){const i=e[0];if(i.some(r=>r>1||r<-1)){const r=i.length;let n=0;for(let a=0;a<r;a++){const o=Math.abs(i[a]);o>n&&(n=o)}for(const a of e)for(let o=0;o<r;o++)a[o]/=n}}(s),{duration:t,length:s[0].length,sampleRate:s[0].length/t,numberOfChannels:s.length,getChannelData:e=>s==null?void 0:s[e],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function xt(s,t){const e=t.xmlns?document.createElementNS(t.xmlns,s):document.createElement(s);for(const[i,r]of Object.entries(t))if(i==="children")for(const[n,a]of Object.entries(t))typeof a=="string"?e.appendChild(document.createTextNode(a)):e.appendChild(xt(n,a));else i==="style"?Object.assign(e.style,r):i==="textContent"?e.textContent=r:e.setAttribute(i,r.toString());return e}function ft(s,t,e){const i=xt(s,t||{});return e==null||e.appendChild(i),i}var pe=Object.freeze({__proto__:null,createElement:ft,default:ft});const me={fetchBlob:function(s,t,e){return E(this,void 0,void 0,function*(){const i=yield fetch(s,e);if(i.status>=400)throw new Error(`Failed to fetch ${s}: ${i.status} (${i.statusText})`);return function(r,n){E(this,void 0,void 0,function*(){if(!r.body||!r.headers)return;const a=r.body.getReader(),o=Number(r.headers.get("Content-Length"))||0;let d=0;const c=p=>E(this,void 0,void 0,function*(){d+=(p==null?void 0:p.length)||0;const h=Math.round(d/o*100);n(h)}),l=()=>E(this,void 0,void 0,function*(){let p;try{p=yield a.read()}catch{return}p.done||(c(p.value),yield l())});l()})}(i.clone(),t),i.blob()})}};class fe extends V{constructor(t){super(),this.isExternalMedia=!1,t.media?(this.media=t.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),t.mediaControls&&(this.media.controls=!0),t.autoplay&&(this.media.autoplay=!0),t.playbackRate!=null&&this.onMediaEvent("canplay",()=>{t.playbackRate!=null&&(this.media.playbackRate=t.playbackRate)},{once:!0})}onMediaEvent(t,e,i){return this.media.addEventListener(t,e,i),()=>this.media.removeEventListener(t,e,i)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const t=this.getSrc();t.startsWith("blob:")&&URL.revokeObjectURL(t)}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,e){const i=this.getSrc();if(t&&i===t)return;this.revokeSrc();const r=e instanceof Blob&&(this.canPlayType(e.type)||!t)?URL.createObjectURL(e):t;try{this.media.src=r}catch{this.media.src=t}}destroy(){this.media.pause(),this.isExternalMedia||(this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(t){this.media=t}play(){return E(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=t}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,e){e!=null&&(this.media.preservesPitch=e),this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){return this.media.setSinkId(t)}}class N extends V{constructor(t,e){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.subscriptions=[],this.options=t;const i=this.parentFromOptionsContainer(t.container);this.parent=i;const[r,n]=this.initHtml();i.appendChild(r),this.container=r,this.scrollContainer=n.querySelector(".scroll"),this.wrapper=n.querySelector(".wrapper"),this.canvasWrapper=n.querySelector(".canvases"),this.progressWrapper=n.querySelector(".progress"),this.cursor=n.querySelector(".cursor"),e&&n.appendChild(e),this.initEvents()}parentFromOptionsContainer(t){let e;if(typeof t=="string"?e=document.querySelector(t):t instanceof HTMLElement&&(e=t),!e)throw new Error("Container not found");return e}initEvents(){const t=e=>{const i=this.wrapper.getBoundingClientRect(),r=e.clientX-i.left,n=e.clientY-i.top;return[r/i.width,n/i.height]};if(this.wrapper.addEventListener("click",e=>{const[i,r]=t(e);this.emit("click",i,r)}),this.wrapper.addEventListener("dblclick",e=>{const[i,r]=t(e);this.emit("dblclick",i,r)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:e,scrollWidth:i,clientWidth:r}=this.scrollContainer,n=e/i,a=(e+r)/i;this.emit("scroll",n,a,e,e+r)}),typeof ResizeObserver=="function"){const e=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{e().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;t===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=t,this.reRender())}initDrag(){this.subscriptions.push(function(t,e,i,r,n=3,a=0,o=100){if(!t)return()=>{};const d=matchMedia("(pointer: coarse)").matches;let c=()=>{};const l=p=>{if(p.button!==a)return;p.preventDefault(),p.stopPropagation();let h=p.clientX,m=p.clientY,f=!1;const b=Date.now(),g=C=>{if(C.preventDefault(),C.stopPropagation(),d&&Date.now()-b<o)return;const D=C.clientX,W=C.clientY,M=D-h,A=W-m;if(f||Math.abs(M)>n||Math.abs(A)>n){const I=t.getBoundingClientRect(),{left:U,top:O}=I;f||(i==null||i(h-U,m-O),f=!0),e(M,A,D-U,W-O),h=D,m=W}},w=C=>{if(f){const D=C.clientX,W=C.clientY,M=t.getBoundingClientRect(),{left:A,top:I}=M;r==null||r(D-A,W-I)}c()},y=C=>{C.relatedTarget&&C.relatedTarget!==document.documentElement||w(C)},P=C=>{f&&(C.stopPropagation(),C.preventDefault())},T=C=>{f&&C.preventDefault()};document.addEventListener("pointermove",g),document.addEventListener("pointerup",w),document.addEventListener("pointerout",y),document.addEventListener("pointercancel",y),document.addEventListener("touchmove",T,{passive:!1}),document.addEventListener("click",P,{capture:!0}),c=()=>{document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",w),document.removeEventListener("pointerout",y),document.removeEventListener("pointercancel",y),document.removeEventListener("touchmove",T),setTimeout(()=>{document.removeEventListener("click",P,{capture:!0})},10)}};return t.addEventListener("pointerdown",l),()=>{c(),t.removeEventListener("pointerdown",l)}}(this.wrapper,(t,e,i)=>{this.emit("drag",Math.max(0,Math.min(1,i/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))}))}getHeight(t,e){var i;const r=((i=this.audioData)===null||i===void 0?void 0:i.numberOfChannels)||1;if(t==null)return 128;if(!isNaN(Number(t)))return Number(t);if(t==="auto"){const n=this.parent.clientHeight||128;return e!=null&&e.every(a=>!a.overlay)?n/r:n}return 128}initHtml(){const t=document.createElement("div"),e=t.attachShadow({mode:"open"}),i=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return e.innerHTML=`
|
1
|
+
import{r as u,E as $,_ as H,a$ as ut,bk as Ht,bl as Vt,bm as jt,J as G,M as X,R as yt,aF as Gt,n as x,bn as Xt,z,j as v,bo as qt,b8 as Yt,bp as Jt,bq as Kt,al as Zt,y as Qt,br as Q,az as te,aC as ee,bs as ie,bt as se,bc as ne,bu as re}from"./index.DuqdUleB.js";import{u as oe,F as ae}from"./FormClearHelper.Bue0QSIn.js";import{T as le,a as pt}from"./Toolbar.DBtrI961.js";import{u as ce}from"./Hooks.kV16_k1-.js";import{c as de}from"./createDownloadLinkElement.DZMwyjvU.js";import{F as he,D as ue}from"./FileDownload.esm.ShSIWsKj.js";var wt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("g",{fill:"none"},u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24})),u.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),u.createElement("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});wt.displayName="Mic";var Ct=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("rect",{width:24,height:24,fill:"none"}),u.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))});Ct.displayName="Pause";var St=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("rect",{width:24,height:24,fill:"none"}),u.createElement("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 000-1.69L9.54 5.98A.998.998 0 008 6.82z"}))});St.displayName="PlayArrow";var Rt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),u.createElement("path",{d:"M17.65 6.35a7.95 7.95 0 00-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 007.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 01-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0112 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z"}))});Rt.displayName="Refresh";var Et=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement($,H({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("g",{fill:"none"},u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24})),u.createElement("path",{fillRule:"evenodd",d:"M9 16h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}))});Et.displayName="StopCircle";function E(s,t,e,i){return new(e||(e=Promise))(function(r,n){function a(c){try{d(i.next(c))}catch(l){n(l)}}function o(c){try{d(i.throw(c))}catch(l){n(l)}}function d(c){var l;c.done?r(c.value):(l=c.value,l instanceof e?l:new e(function(p){p(l)})).then(a,o)}d((i=i.apply(s,t||[])).next())})}let V=class{constructor(){this.listeners={}}on(t,e,i){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(e),i==null?void 0:i.once){const r=()=>{this.un(t,r),this.un(t,e)};return this.on(t,r),r}return()=>this.un(t,e)}un(t,e){var i;(i=this.listeners[t])===null||i===void 0||i.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach(i=>i(...e))}};const mt={decode:function(s,t){return E(this,void 0,void 0,function*(){const e=new AudioContext({sampleRate:t});return e.decodeAudioData(s).finally(()=>e.close())})},createBuffer:function(s,t){return typeof s[0]=="number"&&(s=[s]),function(e){const i=e[0];if(i.some(r=>r>1||r<-1)){const r=i.length;let n=0;for(let a=0;a<r;a++){const o=Math.abs(i[a]);o>n&&(n=o)}for(const a of e)for(let o=0;o<r;o++)a[o]/=n}}(s),{duration:t,length:s[0].length,sampleRate:s[0].length/t,numberOfChannels:s.length,getChannelData:e=>s==null?void 0:s[e],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function xt(s,t){const e=t.xmlns?document.createElementNS(t.xmlns,s):document.createElement(s);for(const[i,r]of Object.entries(t))if(i==="children")for(const[n,a]of Object.entries(t))typeof a=="string"?e.appendChild(document.createTextNode(a)):e.appendChild(xt(n,a));else i==="style"?Object.assign(e.style,r):i==="textContent"?e.textContent=r:e.setAttribute(i,r.toString());return e}function ft(s,t,e){const i=xt(s,t||{});return e==null||e.appendChild(i),i}var pe=Object.freeze({__proto__:null,createElement:ft,default:ft});const me={fetchBlob:function(s,t,e){return E(this,void 0,void 0,function*(){const i=yield fetch(s,e);if(i.status>=400)throw new Error(`Failed to fetch ${s}: ${i.status} (${i.statusText})`);return function(r,n){E(this,void 0,void 0,function*(){if(!r.body||!r.headers)return;const a=r.body.getReader(),o=Number(r.headers.get("Content-Length"))||0;let d=0;const c=p=>E(this,void 0,void 0,function*(){d+=(p==null?void 0:p.length)||0;const h=Math.round(d/o*100);n(h)}),l=()=>E(this,void 0,void 0,function*(){let p;try{p=yield a.read()}catch{return}p.done||(c(p.value),yield l())});l()})}(i.clone(),t),i.blob()})}};class fe extends V{constructor(t){super(),this.isExternalMedia=!1,t.media?(this.media=t.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),t.mediaControls&&(this.media.controls=!0),t.autoplay&&(this.media.autoplay=!0),t.playbackRate!=null&&this.onMediaEvent("canplay",()=>{t.playbackRate!=null&&(this.media.playbackRate=t.playbackRate)},{once:!0})}onMediaEvent(t,e,i){return this.media.addEventListener(t,e,i),()=>this.media.removeEventListener(t,e,i)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const t=this.getSrc();t.startsWith("blob:")&&URL.revokeObjectURL(t)}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,e){const i=this.getSrc();if(t&&i===t)return;this.revokeSrc();const r=e instanceof Blob&&(this.canPlayType(e.type)||!t)?URL.createObjectURL(e):t;try{this.media.src=r}catch{this.media.src=t}}destroy(){this.media.pause(),this.isExternalMedia||(this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(t){this.media=t}play(){return E(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=t}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,e){e!=null&&(this.media.preservesPitch=e),this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){return this.media.setSinkId(t)}}class N extends V{constructor(t,e){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.subscriptions=[],this.options=t;const i=this.parentFromOptionsContainer(t.container);this.parent=i;const[r,n]=this.initHtml();i.appendChild(r),this.container=r,this.scrollContainer=n.querySelector(".scroll"),this.wrapper=n.querySelector(".wrapper"),this.canvasWrapper=n.querySelector(".canvases"),this.progressWrapper=n.querySelector(".progress"),this.cursor=n.querySelector(".cursor"),e&&n.appendChild(e),this.initEvents()}parentFromOptionsContainer(t){let e;if(typeof t=="string"?e=document.querySelector(t):t instanceof HTMLElement&&(e=t),!e)throw new Error("Container not found");return e}initEvents(){const t=e=>{const i=this.wrapper.getBoundingClientRect(),r=e.clientX-i.left,n=e.clientY-i.top;return[r/i.width,n/i.height]};if(this.wrapper.addEventListener("click",e=>{const[i,r]=t(e);this.emit("click",i,r)}),this.wrapper.addEventListener("dblclick",e=>{const[i,r]=t(e);this.emit("dblclick",i,r)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:e,scrollWidth:i,clientWidth:r}=this.scrollContainer,n=e/i,a=(e+r)/i;this.emit("scroll",n,a,e,e+r)}),typeof ResizeObserver=="function"){const e=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{e().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;t===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=t,this.reRender())}initDrag(){this.subscriptions.push(function(t,e,i,r,n=3,a=0,o=100){if(!t)return()=>{};const d=matchMedia("(pointer: coarse)").matches;let c=()=>{};const l=p=>{if(p.button!==a)return;p.preventDefault(),p.stopPropagation();let h=p.clientX,m=p.clientY,f=!1;const b=Date.now(),g=C=>{if(C.preventDefault(),C.stopPropagation(),d&&Date.now()-b<o)return;const D=C.clientX,W=C.clientY,M=D-h,A=W-m;if(f||Math.abs(M)>n||Math.abs(A)>n){const I=t.getBoundingClientRect(),{left:U,top:O}=I;f||(i==null||i(h-U,m-O),f=!0),e(M,A,D-U,W-O),h=D,m=W}},w=C=>{if(f){const D=C.clientX,W=C.clientY,M=t.getBoundingClientRect(),{left:A,top:I}=M;r==null||r(D-A,W-I)}c()},y=C=>{C.relatedTarget&&C.relatedTarget!==document.documentElement||w(C)},P=C=>{f&&(C.stopPropagation(),C.preventDefault())},T=C=>{f&&C.preventDefault()};document.addEventListener("pointermove",g),document.addEventListener("pointerup",w),document.addEventListener("pointerout",y),document.addEventListener("pointercancel",y),document.addEventListener("touchmove",T,{passive:!1}),document.addEventListener("click",P,{capture:!0}),c=()=>{document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",w),document.removeEventListener("pointerout",y),document.removeEventListener("pointercancel",y),document.removeEventListener("touchmove",T),setTimeout(()=>{document.removeEventListener("click",P,{capture:!0})},10)}};return t.addEventListener("pointerdown",l),()=>{c(),t.removeEventListener("pointerdown",l)}}(this.wrapper,(t,e,i)=>{this.emit("drag",Math.max(0,Math.min(1,i/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))}))}getHeight(t,e){var i;const r=((i=this.audioData)===null||i===void 0?void 0:i.numberOfChannels)||1;if(t==null)return 128;if(!isNaN(Number(t)))return Number(t);if(t==="auto"){const n=this.parent.clientHeight||128;return e!=null&&e.every(a=>!a.overlay)?n/r:n}return 128}initHtml(){const t=document.createElement("div"),e=t.attachShadow({mode:"open"}),i=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return e.innerHTML=`
|
2
2
|
<style${i?` nonce="${i}"`:""}>
|
3
3
|
:host {
|
4
4
|
user-select: none;
|
@@ -1 +1 @@
|
|
1
|
-
import{n as s,R as u,aF as b,bb as k,y as C,j as n,b9 as v,bc as L,z as y,D as T,aE as w}from"./index.
|
1
|
+
import{n as s,R as u,aF as b,bb as k,y as C,j as n,b9 as v,bc as L,z as y,D as T,aE as w}from"./index.DuqdUleB.js";const S=s("div",{target:"e1xmaixs0"})({display:"flex",flexDirection:"column"}),h=s("a",{target:"e1xmaixs1"})(({disabled:a,isCurrentPage:o,fluidWidth:l,theme:e})=>({textDecoration:"none",width:typeof l=="number"?`${l}px`:"fit-content",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,borderRadius:e.radii.default,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,marginTop:e.spacing.threeXS,marginBottom:e.spacing.threeXS,lineHeight:e.lineHeights.menuItem,backgroundColor:o?e.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:o?e.colors.darkenedBgMix25:e.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:e.colors.darkenedBgMix15},"@media print":{paddingLeft:e.spacing.none},...a?{borderColor:e.colors.borderColor,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed","&:hover":{color:e.colors.fadedText40,backgroundColor:e.colors.transparent}}:{}})),D=s("span",{target:"e1xmaixs2"})(({disabled:a,theme:o})=>({color:o.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...a?{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}:{}}));function P(a,o){return a===null&&o?!0:a===null&&!o?!1:a===!0}function H(a){const{onPageChange:o,currentPageScriptHash:l}=u.useContext(b),e=u.useContext(k),{colors:i}=C(),{disabled:t,element:r,width:c}=a,p={width:c},f=P(r.useContainerWidth,e),d=l===r.pageScriptHash,x=g=>{r.external?t&&g.preventDefault():(g.preventDefault(),t||o(r.pageScriptHash))};return n("div",{className:"stPageLink","data-testid":"stPageLink",style:p,children:n(v,{help:r.help,placement:L.TOP_RIGHT,children:n(S,{children:y(h,{"data-testid":"stPageLink-NavLink",disabled:t,isCurrentPage:d,fluidWidth:f?c:!1,href:r.page,target:r.external?"_blank":"",rel:"noreferrer",onClick:x,children:[r.icon&&n(T,{size:"lg",color:t?i.fadedText40:i.bodyText,iconValue:r.icon}),n(D,{disabled:t,children:n(w,{source:r.label,allowHTML:!1,isLabel:!0,boldLabel:d,largerLabel:!0,disableLinks:!0})})]})})})})}export{H as default};
|