streamlit-nightly 1.42.1.dev20250216__py2.py3-none-any.whl → 1.42.2.dev20250218__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/elements/bokeh_chart.py +5 -4
- streamlit/elements/graphviz_chart.py +2 -3
- streamlit/elements/lib/column_types.py +97 -44
- streamlit/elements/lib/subtitle_utils.py +2 -2
- streamlit/elements/lib/utils.py +1 -2
- streamlit/elements/vega_charts.py +2 -5
- streamlit/runtime/caching/cache_utils.py +2 -3
- streamlit/runtime/caching/hashing.py +1 -2
- streamlit/runtime/forward_msg_cache.py +1 -5
- streamlit/runtime/fragment.py +3 -5
- streamlit/runtime/memory_media_file_storage.py +1 -2
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{FileDownload.esm.K0RIIaSL.js → FileDownload.esm.DU-1rCSB.js} +1 -1
- streamlit/static/static/js/{FileDropzone.DRcTUuNN.js → FileDropzone.BI3MGDdT.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.Dha_cfuU.js → FormClearHelper.DzU-mNjk.js} +1 -1
- streamlit/static/static/js/{Hooks.BrulV197.js → Hooks.qUbVZL-A.js} +1 -1
- streamlit/static/static/js/{InputInstructions.C_m6JNSV.js → InputInstructions.CpNPMMpX.js} +1 -1
- streamlit/static/static/js/{ProgressBar.CXgDz0lS.js → ProgressBar.4yIafGOA.js} +2 -2
- streamlit/static/static/js/{RenderInPortalIfExists.DbjYtj_E.js → RenderInPortalIfExists.31NYBozH.js} +1 -1
- streamlit/static/static/js/{Toolbar.B5RomQbU.js → Toolbar.lnT7wtEH.js} +1 -1
- streamlit/static/static/js/{base-input.B_U9Mij-.js → base-input.DYDwDBVN.js} +4 -4
- streamlit/static/static/js/{createSuper.DiPn7x2M.js → createSuper.CP_bqXkl.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.CxpMznuV.js → data-grid-overlay-editor.Bw6S-08j.js} +1 -1
- streamlit/static/static/js/{downloader.CMxfwi0g.js → downloader.DZpOwdni.js} +1 -1
- streamlit/static/static/js/{es6.CWDfc2yc.js → es6.D670kkuw.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.CyCMpBzy.js → iframeResizer.contentWindow.CBWvp4oS.js} +1 -1
- streamlit/static/static/js/{index.CLXysuIS.js → index.-wGNsvT9.js} +1 -1
- streamlit/static/static/js/{index.CmyE8x29.js → index.0jzSLI-x.js} +2 -2
- streamlit/static/static/js/index.8M0nMTyK.js +1 -0
- streamlit/static/static/js/index.B-Bz2NGO.js +1 -0
- streamlit/static/static/js/index.B6KnC7nW.js +1 -0
- streamlit/static/static/js/index.B9mk7o4G.js +3 -0
- streamlit/static/static/js/index.BCorV1AX.js +1 -0
- streamlit/static/static/js/index.BMlBBPxY.js +9 -0
- streamlit/static/static/js/index.BhTUDBBK.js +1 -0
- streamlit/static/static/js/index.Bif_gpeX.js +1 -0
- streamlit/static/static/js/index.BkURA4Nq.js +3 -0
- streamlit/static/static/js/index.Byj6qntv.js +2 -0
- streamlit/static/static/js/index.C0O8ISw8.js +1 -0
- streamlit/static/static/js/index.C5VAa8DZ.js +1 -0
- streamlit/static/static/js/{index.FVzOj77v.js → index.CA6bEd5D.js} +10 -10
- streamlit/static/static/js/{index.XB-MiuZp.js → index.CD53GuKN.js} +1 -1
- streamlit/static/static/js/index.CKT6gwZG.js +2 -0
- streamlit/static/static/js/{index.DeuQX1T6.js → index.CLsHMaqe.js} +17 -17
- streamlit/static/static/js/index.Ch1c3KR1.js +1 -0
- streamlit/static/static/js/{index.CnzapoES.js → index.ChIZFRw0.js} +1 -1
- streamlit/static/static/js/{index.68LnD3a5.js → index.CrYKK91g.js} +63 -63
- streamlit/static/static/js/index.Cvgj5_qB.js +1 -0
- streamlit/static/static/js/{index.Ctuil2Zq.js → index.D3VdaBwP.js} +1 -1
- streamlit/static/static/js/{index.BW9gD4O1.js → index.D6UL3iMZ.js} +82 -82
- streamlit/static/static/js/index.D8aCPmhr.js +1 -0
- streamlit/static/static/js/{index.B7-ka68B.js → index.DHBu5iL6.js} +2 -2
- streamlit/static/static/js/index.DJF89pFO.js +1 -0
- streamlit/static/static/js/{index.CxT-55oh.js → index.DNEGP5ih.js} +1 -1
- streamlit/static/static/js/index.DRJutLeV.js +1 -0
- streamlit/static/static/js/{index.CZjrVNQ3.js → index.DS38XxzV.js} +1 -1
- streamlit/static/static/js/index.DdeHhk74.js +1 -0
- streamlit/static/static/js/index.De5HitMn.js +1 -0
- streamlit/static/static/js/index.DsvnAu-2.js +1 -0
- streamlit/static/static/js/index.Du4f6P1i.js +1 -0
- streamlit/static/static/js/index.HCbHLWBq.js +1 -0
- streamlit/static/static/js/index.XAUdgEdp.js +1 -0
- streamlit/static/static/js/{index.vyj1usur.js → index.edlGQJ3v.js} +28 -28
- streamlit/static/static/js/{input.D-b9-dhW.js → input.e-37_Dj1.js} +1 -1
- streamlit/static/static/js/{memory.C27_0JRm.js → memory.B5p-2jga.js} +1 -1
- streamlit/static/static/js/{mergeWith.D8F46YVj.js → mergeWith.D8nk5iJa.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.CaHpEyvW.js → number-overlay-editor.DLD5-9zx.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.CnSJ4CFa.js → possibleConstructorReturn.eeV6HB6T.js} +1 -1
- streamlit/static/static/js/{sandbox.Cx5mAMmC.js → sandbox.ChKquq8J.js} +1 -1
- streamlit/static/static/js/{textarea.YeGMY3Ts.js → textarea.ZI_0MUsX.js} +1 -1
- streamlit/static/static/js/{timepicker.BSApuR_7.js → timepicker.C8N66VUc.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.DFJurSxu.js → toConsumableArray.DKg00cRh.js} +1 -1
- streamlit/static/static/js/{uniqueId.B4ugkryR.js → uniqueId.fc9w8X88.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.e9cw5rKa.js → useBasicWidgetState.CySX_BlM.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.CHDPgswc.js → useOnInputChange.BF6Trlh5.js} +1 -1
- streamlit/static/static/js/withFullScreenWrapper.x2WsM7iA.js +1 -0
- streamlit/testing/v1/app_test.py +2 -4
- streamlit/util.py +6 -9
- streamlit/watcher/util.py +2 -7
- streamlit/web/server/app_static_file_handler.py +17 -1
- {streamlit_nightly-1.42.1.dev20250216.dist-info → streamlit_nightly-1.42.2.dev20250218.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.42.1.dev20250216.dist-info → streamlit_nightly-1.42.2.dev20250218.dist-info}/RECORD +86 -86
- streamlit/static/static/js/index.11KmKkMp.js +0 -1
- streamlit/static/static/js/index.B5QCo4O8.js +0 -1
- streamlit/static/static/js/index.B9xlEQvM.js +0 -3
- streamlit/static/static/js/index.Bb_vborY.js +0 -1
- streamlit/static/static/js/index.BoLiyuG0.js +0 -1
- streamlit/static/static/js/index.CBswNuTs.js +0 -1
- streamlit/static/static/js/index.CGHmjGTj.js +0 -1
- streamlit/static/static/js/index.CMM3vxd_.js +0 -1
- streamlit/static/static/js/index.CTrIDSw5.js +0 -1
- streamlit/static/static/js/index.CrDkQv4h.js +0 -1
- streamlit/static/static/js/index.CxX3WJZV.js +0 -9
- streamlit/static/static/js/index.D4y-ZpWF.js +0 -3
- streamlit/static/static/js/index.DUqWz4q7.js +0 -1
- streamlit/static/static/js/index.DaR46enR.js +0 -1
- streamlit/static/static/js/index.DcCioSks.js +0 -2
- streamlit/static/static/js/index.Di8ddb5O.js +0 -1
- streamlit/static/static/js/index.Djk5RccG.js +0 -1
- streamlit/static/static/js/index.DsPUu3xS.js +0 -2
- streamlit/static/static/js/index.FjL8doTL.js +0 -1
- streamlit/static/static/js/index.OiKVkRzb.js +0 -1
- streamlit/static/static/js/index.YBzhCbWe.js +0 -1
- streamlit/static/static/js/index.ZlPieA63.js +0 -1
- streamlit/static/static/js/index.eP8uJaty.js +0 -1
- streamlit/static/static/js/index.fz6QTJde.js +0 -1
- streamlit/static/static/js/withFullScreenWrapper.BKBYrOn-.js +0 -1
- {streamlit_nightly-1.42.1.dev20250216.data → streamlit_nightly-1.42.2.dev20250218.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.42.1.dev20250216.dist-info → streamlit_nightly-1.42.2.dev20250218.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.42.1.dev20250216.dist-info → streamlit_nightly-1.42.2.dev20250218.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.42.1.dev20250216.dist-info → streamlit_nightly-1.42.2.dev20250218.dist-info}/top_level.txt +0 -0
@@ -1,9 +0,0 @@
|
|
1
|
-
import{bq as x,bD as ae,bE as T,r as g,bF as w,y as le,D as ce,j as S,C as se,bm as ue,ay as de,bu as fe,bn as ge,b6 as he,bG as be,at as me,bH as ve,bI as pe}from"./index.DeuQX1T6.js";import{a as ye}from"./useBasicWidgetState.e9cw5rKa.js";import"./FormClearHelper.Dha_cfuU.js";var F=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
|
-
<svg width="14" height="4" viewBox="0 0 14 4" fill="none" xmlns="http://www.w3.org/2000/svg">
|
3
|
-
<path d="M14 0.5H0V3.5H14V0.5Z" fill="`.concat(s,`"/>
|
4
|
-
</svg>
|
5
|
-
`)),u=encodeURIComponent(`
|
6
|
-
<svg width="17" height="13" viewBox="0 0 17 13" fill="none" xmlns="http://www.w3.org/2000/svg">
|
7
|
-
<path d="M6.50002 12.6L0.400024 6.60002L2.60002 4.40002L6.50002 8.40002L13.9 0.900024L16.1 3.10002L6.50002 12.6Z" fill="`.concat(s,`"/>
|
8
|
-
</svg>
|
9
|
-
`)),h=l.borders.checkboxBorderRadius,b=ke(e);return{flex:"0 0 auto",transitionDuration:a.timing200,transitionTimingFunction:a.easeOutCurve,transitionProperty:"background-image, border-color, background-color",width:c.scale700,height:c.scale700,left:"4px",top:"4px",boxSizing:"border-box",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderLeftWidth:"3px",borderRightWidth:"3px",borderTopWidth:"3px",borderBottomWidth:"3px",borderLeftColor:b,borderRightColor:b,borderTopColor:b,borderBottomColor:b,borderTopLeftRadius:h,borderTopRightRadius:h,borderBottomRightRadius:h,borderBottomLeftRadius:h,outline:n&&t?"3px solid ".concat(l.colors.accent):"none",display:"inline-block",verticalAlign:"middle",backgroundImage:i?"url('data:image/svg+xml,".concat($,"');"):t?"url('data:image/svg+xml,".concat(u,"');"):null,backgroundColor:we(e),backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"contain",marginTop:l.sizing.scale0,marginBottom:l.sizing.scale0,marginLeft:l.sizing.scale0,marginRight:l.sizing.scale0}});_.displayName="Checkmark";_.displayName="Checkmark";var I=x("div",function(e){var t=e.$theme,o=t.typography;return P(P(P({verticalAlign:"middle"},Te(e)),{},{color:xe(e)},o.LabelMedium),{},{lineHeight:"24px"})});I.displayName="Label";I.displayName="Label";var D=x("input",{opacity:0,width:0,height:0,overflow:"hidden",margin:0,padding:0,position:"absolute"});D.displayName="Input";D.displayName="Input";var H=x("div",function(e){var t=e.$theme.colors.toggleFill;return e.$disabled?t=e.$theme.colors.toggleFillDisabled:e.$checked&&e.$error?t=e.$theme.colors.tickFillErrorSelected:e.$checked&&(t=e.$theme.colors.toggleFillChecked),{backgroundColor:t,borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(e.$theme.colors.accent):e.$isHovered&&!e.$disabled?e.$theme.lighting.shadow500:e.$theme.lighting.shadow400,outline:"none",height:e.$theme.sizing.scale700,width:e.$theme.sizing.scale700,transform:e.$checked?"translateX(".concat(e.$theme.direction==="rtl"?"-100%":"100%",")"):null,transition:"transform ".concat(e.$theme.animation.timing200)}});H.displayName="Toggle";H.displayName="Toggle";var z=x("div",function(e){var t=e.$theme.colors.toggleTrackFill;return e.$disabled?t=e.$theme.colors.toggleTrackFillDisabled:e.$error&&e.$checked&&(t=e.$theme.colors.tickFillError),{alignItems:"center",backgroundColor:t,borderTopLeftRadius:"7px",borderTopRightRadius:"7px",borderBottomRightRadius:"7px",borderBottomLeftRadius:"7px",display:"flex",height:e.$theme.sizing.scale550,marginTop:e.$theme.sizing.scale200,marginBottom:e.$theme.sizing.scale100,marginLeft:e.$theme.sizing.scale200,marginRight:e.$theme.sizing.scale100,width:e.$theme.sizing.scale1000}});z.displayName="ToggleTrack";z.displayName="ToggleTrack";function E(e){"@babel/helpers - typeof";return E=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},E(e)}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},y.apply(this,arguments)}function Re(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Se(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Fe(e,t,o){return t&&Se(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ce(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&&B(e,t)}function B(e,t){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},B(e,t)}function Le(e){var t=Pe();return function(){var r=C(e),i;if(t){var l=C(this).constructor;i=Reflect.construct(r,arguments,l)}else i=r.apply(this,arguments);return Oe(this,i)}}function Oe(e,t){if(t&&(E(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return v(e)}function v(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Pe(){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(o){return o.__proto__||Object.getPrototypeOf(o)},C(e)}function p(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var Ee=function(t){return t.stopPropagation()},Y=function(e){Ce(o,e);var t=Le(o);function o(){var r;Re(this,o);for(var i=arguments.length,l=new Array(i),n=0;n<i;n++)l[n]=arguments[n];return r=t.call.apply(t,[this].concat(l)),p(v(r),"state",{isFocused:r.props.autoFocus||!1,isFocusVisible:!1,isHovered:!1,isActive:!1}),p(v(r),"onMouseEnter",function(c){r.setState({isHovered:!0}),r.props.onMouseEnter(c)}),p(v(r),"onMouseLeave",function(c){r.setState({isHovered:!1,isActive:!1}),r.props.onMouseLeave(c)}),p(v(r),"onMouseDown",function(c){r.setState({isActive:!0}),r.props.onMouseDown(c)}),p(v(r),"onMouseUp",function(c){r.setState({isActive:!1}),r.props.onMouseUp(c)}),p(v(r),"onFocus",function(c){r.setState({isFocused:!0}),r.props.onFocus(c),ae(c)&&r.setState({isFocusVisible:!0})}),p(v(r),"onBlur",function(c){r.setState({isFocused:!1}),r.props.onBlur(c),r.state.isFocusVisible!==!1&&r.setState({isFocusVisible:!1})}),r}return Fe(o,[{key:"componentDidMount",value:function(){var i=this.props,l=i.autoFocus,n=i.inputRef;l&&n.current&&n.current.focus()}},{key:"render",value:function(){var i=this.props,l=i.overrides,n=l===void 0?{}:l,c=i.onChange,a=i.labelPlacement,s=a===void 0?this.props.checkmarkType===F.toggle?"left":"right":a,$=i.inputRef,u=i.isIndeterminate,h=i.error,b=i.disabled,R=i.value,f=i.name,m=i.type,d=i.checked,L=i.children,O=i.required,Z=i.title,j=n.Root,V=n.Checkmark,W=n.Label,A=n.Input,N=n.Toggle,U=n.ToggleTrack,K=T(j)||M,J=T(V)||_,Q=T(W)||I,ee=T(A)||D,te=T(N)||H,re=T(U)||z,oe={onChange:c,onFocus:this.onFocus,onBlur:this.onBlur},ie={onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},k={$isFocused:this.state.isFocused,$isFocusVisible:this.state.isFocusVisible,$isHovered:this.state.isHovered,$isActive:this.state.isActive,$error:h,$checked:d,$isIndeterminate:u,$required:O,$disabled:b,$value:R},X=L&&g.createElement(Q,y({$labelPlacement:s},k,w(W)),this.props.containsInteractiveElement?g.createElement("div",{onClick:function(ne){return ne.preventDefault()}},L):L);return g.createElement(K,y({"data-baseweb":"checkbox",title:Z||null,$labelPlacement:s},k,ie,w(j)),(s==="top"||s==="left")&&X,this.props.checkmarkType===F.toggle?g.createElement(re,y({},k,w(U)),g.createElement(te,y({},k,w(N)))):g.createElement(J,y({},k,w(V))),g.createElement(ee,y({value:R,name:f,checked:d,required:O,"aria-label":this.props["aria-label"]||this.props.ariaLabel,"aria-checked":u?"mixed":d,"aria-describedby":this.props["aria-describedby"],"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":h||null,"aria-required":O||null,disabled:b,type:m,ref:$,onClick:Ee},k,oe,w(A))),(s==="bottom"||s==="right")&&X)}}]),o}(g.Component);p(Y,"defaultProps",{overrides:{},checked:!1,containsInteractiveElement:!1,disabled:!1,autoFocus:!1,isIndeterminate:!1,inputRef:g.createRef(),error:!1,type:"checkbox",checkmarkType:F.default,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});function Be({width:e,element:t,disabled:o,widgetMgr:r,fragmentId:i}){var R;const[l,n]=ye({getStateFromWidgetMgr:Me,getDefaultStateFromProto:_e,getCurrStateFromProto:Ie,updateWidgetMgrState:De,element:t,widgetMgr:r,fragmentId:i}),c=g.useCallback(f=>{n({value:f.target.checked,fromUi:!0})},[n]),a=le(),{colors:s,spacing:$,sizes:u}=a,h=ce(a),b=o?s.fadedText40:s.bodyText;return S(pe,{className:"row-widget stCheckbox","data-testid":"stCheckbox",width:e,children:S(Y,{checked:l,disabled:o,onChange:c,"aria-label":t.label,checkmarkType:t.type===ve.StyleType.TOGGLE?F.toggle:F.default,labelPlacement:$e.right,overrides:{Root:{style:({$isFocusVisible:f})=>({marginBottom:$.none,marginTop:$.none,backgroundColor:f?s.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Toggle:{style:({$checked:f})=>{let m=h?s.bgColor:s.bodyText;return o&&(m=h?s.gray70:s.gray90),{width:`calc(${u.checkbox} - ${a.spacing.twoXS})`,height:`calc(${u.checkbox} - ${a.spacing.twoXS})`,transform:f?`translateX(${u.checkbox})`:"",backgroundColor:m,boxShadow:""}}},ToggleTrack:{style:({$checked:f,$isHovered:m})=>{let d=s.fadedText40;return m&&!o&&(d=s.fadedText20),f&&!o&&(d=s.primary),{marginRight:0,marginLeft:0,marginBottom:0,marginTop:a.spacing.twoXS,paddingLeft:a.spacing.threeXS,paddingRight:a.spacing.threeXS,width:`calc(2 * ${u.checkbox})`,minWidth:`calc(2 * ${u.checkbox})`,height:u.checkbox,minHeight:u.checkbox,borderBottomLeftRadius:a.radii.full,borderTopLeftRadius:a.radii.full,borderBottomRightRadius:a.radii.full,borderTopRightRadius:a.radii.full,backgroundColor:d}}},Checkmark:{style:({$isFocusVisible:f,$checked:m})=>{const d=m&&!o?s.primary:s.fadedText40;return{outline:0,width:u.checkbox,height:u.checkbox,marginTop:a.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:f&&m?`0 0 0 0.2rem ${me(s.primary,.5)}`:"",borderLeftWidth:u.borderWidth,borderRightWidth:u.borderWidth,borderTopWidth:u.borderWidth,borderBottomWidth:u.borderWidth,borderLeftColor:d,borderRightColor:d,borderTopColor:d,borderBottomColor:d}}},Label:{style:{lineHeight:a.lineHeights.small,paddingLeft:a.spacing.sm,position:"relative",color:b}}},children:se(be,{visibility:ue((R=t.labelVisibility)==null?void 0:R.value),"data-testid":"stWidgetLabel",children:[S(de,{source:t.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),t.help&&S(fe,{color:b,children:S(ge,{content:t.help,placement:he.TOP_RIGHT})})]})})})}function Me(e,t){return e.getBoolValue(t)}function _e(e){return e.default??null}function Ie(e){return e.value??null}function De(e,t,o,r){t.setBoolValue(e,o.value,{fromUi:o.fromUi},r)}const We=g.memo(Be);export{We as default};
|
@@ -1,3 +0,0 @@
|
|
1
|
-
import{bT as de,cn as ce,co as pe,cp as fe,cq as ge,cr as ye,c4 as me,bq as ve,bK as be,cs as he,c5 as Se,ct as Oe,d as J,cu as Ce,n as Ie,r as K,K as U,y as Pe,C as $e,j as z,bm as _e,bz as Te,bn as Ee,b6 as Re,bo as we,bS as De}from"./index.DeuQX1T6.js";import{a as xe}from"./useBasicWidgetState.e9cw5rKa.js";import{T as Ae}from"./timepicker.BSApuR_7.js";import"./FormClearHelper.Dha_cfuU.js";import"./possibleConstructorReturn.CnSJ4CFa.js";import"./createSuper.DiPn7x2M.js";var We=de.Consumer;const Ne=Object.freeze(Object.defineProperty({__proto__:null,ThemeConsumer:We,ThemeProvider:ce,createThemedStyled:pe,createThemedUseStyletron:fe,createThemedWithStyle:ge,expandBorderStyles:ye,hexToRgb:me,styled:ve,useStyletron:be,withStyle:he,withWrapper:Se},Symbol.toStringTag,{value:"Module"}));var I={};const Y=Oe(Ne);var w={},X;function Be(){if(X)return w;X=1,Object.defineProperty(w,"__esModule",{value:!0}),w.STATE_CHANGE_TYPE=w.SIZE=w.ENHANCER_POSITION=w.CUSTOM_INPUT_TYPE=w.ADJOINED=void 0;var f={change:"change"};w.STATE_CHANGE_TYPE=f;var c={textarea:"textarea"};w.CUSTOM_INPUT_TYPE=c;var h={none:"none",left:"left",right:"right",both:"both"};w.ADJOINED=h;var m={mini:"mini",default:"default",compact:"compact",large:"large"};w.SIZE=m;var b={start:"start",end:"end"};return w.ENHANCER_POSITION=b,w}var q={},N={},k={},Q;function Me(){if(Q)return k;Q=1,Object.defineProperty(k,"__esModule",{value:!0}),k.default=c;function f(m){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},f(m)}function c(m){m=m||{};for(var b=arguments.length<=1?0:arguments.length-1,v,g,S=0;S<b;S++){v=(S+1<1||arguments.length<=S+1?void 0:arguments[S+1])||{};for(var O in v)f(v[O])!==void 0&&(g=v[O],h(g)?m[O]=c(m[O]||Array.isArray(g)&&[]||{},g):m[O]=g)}return m}function h(m){return Array.isArray(m)||{}.toString.call(m)=="[object Object]"}return k}var ee;function ae(){if(ee)return N;ee=1,Object.defineProperty(N,"__esModule",{value:!0}),N.getOverride=_,N.getOverrideProps=T,N.getOverrides=x,N.mergeConfigurationOverrides=L,N.mergeOverride=W,N.mergeOverrides=A,N.toObjectOverride=D,N.useOverrides=F;var f=v(J()),c=Ce(),h=m(Me());function m(i){return i&&i.__esModule?i:{default:i}}function b(i){if(typeof WeakMap!="function")return null;var t=new WeakMap,u=new WeakMap;return(b=function(r){return r?u:t})(i)}function v(i,t){if(i&&i.__esModule)return i;if(i===null||$(i)!=="object"&&typeof i!="function")return{default:i};var u=b(t);if(u&&u.has(i))return u.get(i);var s={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in i)if(a!=="default"&&Object.prototype.hasOwnProperty.call(i,a)){var l=r?Object.getOwnPropertyDescriptor(i,a):null;l&&(l.get||l.set)?Object.defineProperty(s,a,l):s[a]=i[a]}return s.default=i,u&&u.set(i,s),s}function g(){return g=Object.assign?Object.assign.bind():function(i){for(var t=1;t<arguments.length;t++){var u=arguments[t];for(var s in u)Object.prototype.hasOwnProperty.call(u,s)&&(i[s]=u[s])}return i},g.apply(this,arguments)}function S(i,t){var u=Object.keys(i);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);t&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),u.push.apply(u,s)}return u}function O(i){for(var t=1;t<arguments.length;t++){var u=arguments[t]!=null?arguments[t]:{};t%2?S(Object(u),!0).forEach(function(s){y(i,s,u[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(u)):S(Object(u)).forEach(function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(u,s))})}return i}function y(i,t,u){return t in i?Object.defineProperty(i,t,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[t]=u,i}function $(i){"@babel/helpers - typeof";return $=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},$(i)}function _(i){return(0,c.isValidElementType)(i)?i:i&&$(i)==="object"?i.component:i}function T(i){return i&&$(i)==="object"?$(i.props)==="object"?O(O({},i.props),{},{$style:i.style}):{$style:i.style}:{}}function D(i){return(0,c.isValidElementType)(i)?{component:i}:i||{}}function x(i,t){var u=_(i)||t;if(i&&$(i)==="object"&&typeof i.props=="function"){var s=f.forwardRef(function(a,l){var n=i.props(a),e=T(O(O({},i),{},{props:n}));return f.createElement(u,g({ref:l},e))});return s.displayName=u.displayName,[s,{}]}var r=T(i);return[u,r]}function A(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=Object.assign({},i,t),s=Object.keys(u);return s.reduce(function(r,a){return r[a]=W(D(i[a]),D(t[a])),r},{})}function W(i,t){var u=O(O({},i),t);return i.props&&t.props&&(u.props=L(i.props,t.props)),i.style&&t.style&&(u.style=L(i.style,t.style)),u}function L(i,t){return $(i)==="object"&&$(t)==="object"?(0,h.default)({},i,t):function(){return(0,h.default)({},typeof i=="function"?i.apply(void 0,arguments):i,typeof t=="function"?t.apply(void 0,arguments):t)}}function F(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return f.useMemo(function(){return Object.keys(i).reduce(function(u,s){return u[s]=x(t[s],i[s]),u},{})},[t])}return N}var j={},Z={},te;function Le(){if(te)return Z;te=1,Object.defineProperty(Z,"__esModule",{value:!0}),Z.Svg=void 0,Z.getSvgStyles=c;var f=Y;function c(m){var b=m.$theme,v=m.$size,g=m.$color,S=b.sizing.scale600;v&&(b.sizing[v]?S=b.sizing[v]:typeof v=="number"?S="".concat(v,"px"):S=v);var O="currentColor";return g&&(b.colors[g]?O=b.colors[g]:O=g),{display:"inline-block",fill:O,color:O,height:S,width:S}}var h=(0,f.styled)("svg",c);return Z.Svg=h,h.displayName="Svg",h.displayName="Svg",Z}var H={},re;function Fe(){if(re)return H;re=1,Object.defineProperty(H,"__esModule",{value:!0}),H.default=f;function f(c){var h={};for(var m in c)m[0]!=="$"&&(h[m]=c[m]);return h}return H}var ne;function ze(){if(ne)return j;ne=1;function f(r){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},f(r)}Object.defineProperty(j,"__esModule",{value:!0}),j.default=void 0;var c=O(J()),h=ae(),m=Le(),b=g(Fe()),v=["children","title","size","color","overrides"];function g(r){return r&&r.__esModule?r:{default:r}}function S(r){if(typeof WeakMap!="function")return null;var a=new WeakMap,l=new WeakMap;return(S=function(e){return e?l:a})(r)}function O(r,a){if(r&&r.__esModule)return r;if(r===null||f(r)!=="object"&&typeof r!="function")return{default:r};var l=S(a);if(l&&l.has(r))return l.get(r);var n={},e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in r)if(o!=="default"&&Object.prototype.hasOwnProperty.call(r,o)){var p=e?Object.getOwnPropertyDescriptor(r,o):null;p&&(p.get||p.set)?Object.defineProperty(n,o,p):n[o]=r[o]}return n.default=r,l&&l.set(r,n),n}function y(){return y=Object.assign?Object.assign.bind():function(r){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(r[n]=l[n])}return r},y.apply(this,arguments)}function $(r,a){var l=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);a&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),l.push.apply(l,n)}return l}function _(r){for(var a=1;a<arguments.length;a++){var l=arguments[a]!=null?arguments[a]:{};a%2?$(Object(l),!0).forEach(function(n){T(r,n,l[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(l)):$(Object(l)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(l,n))})}return r}function T(r,a,l){return a in r?Object.defineProperty(r,a,{value:l,enumerable:!0,configurable:!0,writable:!0}):r[a]=l,r}function D(r,a){return F(r)||L(r,a)||A(r,a)||x()}function x(){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 A(r,a){if(r){if(typeof r=="string")return W(r,a);var l=Object.prototype.toString.call(r).slice(8,-1);if(l==="Object"&&r.constructor&&(l=r.constructor.name),l==="Map"||l==="Set")return Array.from(r);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return W(r,a)}}function W(r,a){(a==null||a>r.length)&&(a=r.length);for(var l=0,n=new Array(a);l<a;l++)n[l]=r[l];return n}function L(r,a){var l=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(l!=null){var n=[],e=!0,o=!1,p,d;try{for(l=l.call(r);!(e=(p=l.next()).done)&&(n.push(p.value),!(a&&n.length===a));e=!0);}catch(C){o=!0,d=C}finally{try{!e&&l.return!=null&&l.return()}finally{if(o)throw d}}return n}}function F(r){if(Array.isArray(r))return r}function i(r,a){if(r==null)return{};var l=t(r,a),n,e;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(e=0;e<o.length;e++)n=o[e],!(a.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(l[n]=r[n])}return l}function t(r,a){if(r==null)return{};var l={},n=Object.keys(r),e,o;for(o=0;o<n.length;o++)e=n[o],!(a.indexOf(e)>=0)&&(l[e]=r[e]);return l}var u=function(a,l){var n=a.children,e=a.title,o=a.size,p=a.color,d=a.overrides,C=d===void 0?{}:d,P=i(a,v),R=(0,h.getOverrides)(C.Svg,m.Svg),B=D(R,2),E=B[0],M=B[1],V=E.__STYLETRON__?_(_({title:e,$color:p,$size:o},P),M):_(_({title:e,color:p,size:o},(0,b.default)(P)),(0,b.default)(M));return c.createElement(E,y({"data-baseweb":"icon",ref:l},V),e?c.createElement("title",null,e):null,n)},s=c.forwardRef(u);return j.default=s,j}var oe;function Ze(){if(oe)return q;oe=1;function f(t){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},f(t)}Object.defineProperty(q,"__esModule",{value:!0}),q.default=void 0;var c=O(J()),h=Y,m=ae(),b=g(ze()),v=["title","size","color","overrides"];function g(t){return t&&t.__esModule?t:{default:t}}function S(t){if(typeof WeakMap!="function")return null;var u=new WeakMap,s=new WeakMap;return(S=function(a){return a?s:u})(t)}function O(t,u){if(t&&t.__esModule)return t;if(t===null||f(t)!=="object"&&typeof t!="function")return{default:t};var s=S(u);if(s&&s.has(t))return s.get(t);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in t)if(l!=="default"&&Object.prototype.hasOwnProperty.call(t,l)){var n=a?Object.getOwnPropertyDescriptor(t,l):null;n&&(n.get||n.set)?Object.defineProperty(r,l,n):r[l]=t[l]}return r.default=t,s&&s.set(t,r),r}function y(){return y=Object.assign?Object.assign.bind():function(t){for(var u=1;u<arguments.length;u++){var s=arguments[u];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(t[r]=s[r])}return t},y.apply(this,arguments)}function $(t,u){if(t==null)return{};var s=_(t,u),r,a;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(a=0;a<l.length;a++)r=l[a],!(u.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function _(t,u){if(t==null)return{};var s={},r=Object.keys(t),a,l;for(l=0;l<r.length;l++)a=r[l],!(u.indexOf(a)>=0)&&(s[a]=t[a]);return s}function T(t,u){return L(t)||W(t,u)||x(t,u)||D()}function D(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x(t,u){if(t){if(typeof t=="string")return A(t,u);var s=Object.prototype.toString.call(t).slice(8,-1);if(s==="Object"&&t.constructor&&(s=t.constructor.name),s==="Map"||s==="Set")return Array.from(t);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return A(t,u)}}function A(t,u){(u==null||u>t.length)&&(u=t.length);for(var s=0,r=new Array(u);s<u;s++)r[s]=t[s];return r}function W(t,u){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var r=[],a=!0,l=!1,n,e;try{for(s=s.call(t);!(a=(n=s.next()).done)&&(r.push(n.value),!(u&&r.length===u));a=!0);}catch(o){l=!0,e=o}finally{try{!a&&s.return!=null&&s.return()}finally{if(l)throw e}}return r}}function L(t){if(Array.isArray(t))return t}function F(t,u){var s=(0,h.useStyletron)(),r=T(s,2),a=r[1],l=t.title,n=l===void 0?"Delete Alt":l,e=t.size,o=t.color,p=t.overrides,d=p===void 0?{}:p,C=$(t,v),P=(0,m.mergeOverride)({component:a.icons&&a.icons.DeleteAlt?a.icons.DeleteAlt:null},d&&d.Svg?(0,m.toObjectOverride)(d.Svg):{});return c.createElement(b.default,y({viewBox:"0 0 24 24",ref:u,title:n,size:e,color:o,overrides:{Svg:P}},C),c.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 20C16.4183 20 20 16.4183 20 12C20 7.58173 16.4183 4 12 4C7.58173 4 4 7.58173 4 12C4 16.4183 7.58173 20 12 20ZM10.0303 8.96967C9.73743 8.67679 9.26257 8.67679 8.96967 8.96967C8.67676 9.26257 8.67676 9.73743 8.96967 10.0303L10.9393 12L8.96967 13.9697C8.67676 14.2626 8.67676 14.7374 8.96967 15.0303C9.26257 15.3232 9.73743 15.3232 10.0303 15.0303L12 13.0607L13.9697 15.0303C14.2626 15.3232 14.7374 15.3232 15.0303 15.0303C15.3232 14.7374 15.3232 14.2626 15.0303 13.9697L13.0607 12L15.0303 10.0303C15.3232 9.73743 15.3232 9.26257 15.0303 8.96967C14.7374 8.67679 14.2626 8.67679 13.9697 8.96967L12 10.9393L10.0303 8.96967Z"}))}var i=c.forwardRef(F);return q.default=i,q}var ie;function qe(){if(ie)return I;ie=1,Object.defineProperty(I,"__esModule",{value:!0}),I.getRootStyles=I.getInputStyles=I.getInputContainerStyles=I.StyledMaskToggleButton=I.StyledClearIconContainer=I.StyledClearIcon=I.Root=I.InputEnhancer=I.InputContainer=I.Input=void 0;var f=Y,c=Be(),h=m(Ze());function m(n){return n&&n.__esModule?n:{default:n}}function b(n,e){var o=Object.keys(n);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(n);e&&(p=p.filter(function(d){return Object.getOwnPropertyDescriptor(n,d).enumerable})),o.push.apply(o,p)}return o}function v(n){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?b(Object(o),!0).forEach(function(p){g(n,p,o[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):b(Object(o)).forEach(function(p){Object.defineProperty(n,p,Object.getOwnPropertyDescriptor(o,p))})}return n}function g(n,e,o){return e in n?Object.defineProperty(n,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[e]=o,n}var S=(0,f.styled)("button",function(n){var e,o=n.$theme,p=n.$size,d=n.$isFocusVisible,C=(e={},g(e,c.SIZE.mini,o.sizing.scale400),g(e,c.SIZE.compact,o.sizing.scale400),g(e,c.SIZE.default,o.sizing.scale300),g(e,c.SIZE.large,o.sizing.scale200),e)[p];return{display:"flex",alignItems:"center",borderTopStyle:"none",borderBottomStyle:"none",borderLeftStyle:"none",borderRightStyle:"none",background:"none",paddingLeft:C,paddingRight:C,outline:d?"solid 3px ".concat(o.colors.accent):"none",color:o.colors.contentPrimary}});I.StyledMaskToggleButton=S,S.displayName="StyledMaskToggleButton",S.displayName="StyledMaskToggleButton";var O=(0,f.styled)("div",function(n){var e,o=n.$alignTop,p=o===void 0?!1:o,d=n.$size,C=n.$theme,P=(e={},g(e,c.SIZE.mini,C.sizing.scale200),g(e,c.SIZE.compact,C.sizing.scale200),g(e,c.SIZE.default,C.sizing.scale100),g(e,c.SIZE.large,C.sizing.scale0),e)[d];return{display:"flex",alignItems:p?"flex-start":"center",paddingLeft:P,paddingRight:P,paddingTop:p?C.sizing.scale500:"0px",color:C.colors.contentPrimary}});I.StyledClearIconContainer=O,O.displayName="StyledClearIconContainer",O.displayName="StyledClearIconContainer";var y=(0,f.styled)(h.default,function(n){var e=n.$theme,o=n.$isFocusVisible;return{cursor:"pointer",outline:o?"solid 3px ".concat(e.colors.accent):"none"}});I.StyledClearIcon=y,y.displayName="StyledClearIcon",y.displayName="StyledClearIcon";function $(n,e){var o;return(o={},g(o,c.SIZE.mini,{paddingTop:e.scale100,paddingBottom:e.scale100,paddingLeft:e.scale550,paddingRight:e.scale550}),g(o,c.SIZE.compact,{paddingTop:e.scale200,paddingBottom:e.scale200,paddingLeft:e.scale550,paddingRight:e.scale550}),g(o,c.SIZE.default,{paddingTop:e.scale400,paddingBottom:e.scale400,paddingLeft:e.scale550,paddingRight:e.scale550}),g(o,c.SIZE.large,{paddingTop:e.scale550,paddingBottom:e.scale550,paddingLeft:e.scale550,paddingRight:e.scale550}),o)[n]}function _(n,e,o,p,d){var C=n===c.ADJOINED.both||n===c.ADJOINED.left&&p!=="rtl"||n===c.ADJOINED.right&&p==="rtl"||d&&p==="rtl",P=n===c.ADJOINED.both||n===c.ADJOINED.right&&p!=="rtl"||n===c.ADJOINED.left&&p==="rtl"||d&&p!=="rtl";return{paddingLeft:C?o.scale550:"0px",paddingRight:P?o.scale550:"0px"}}function T(n,e){var o;return(o={},g(o,c.SIZE.mini,e.font100),g(o,c.SIZE.compact,e.font200),g(o,c.SIZE.default,e.font300),g(o,c.SIZE.large,e.font400),o)[n]}function D(n,e,o){var p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,d=arguments.length>4?arguments[4]:void 0;return n?{borderLeftColor:d.inputFillDisabled,borderRightColor:d.inputFillDisabled,borderTopColor:d.inputFillDisabled,borderBottomColor:d.inputFillDisabled,backgroundColor:d.inputFillDisabled}:e?{borderLeftColor:d.borderSelected,borderRightColor:d.borderSelected,borderTopColor:d.borderSelected,borderBottomColor:d.borderSelected,backgroundColor:d.inputFillActive}:o?{borderLeftColor:d.inputBorderError,borderRightColor:d.inputBorderError,borderTopColor:d.inputBorderError,borderBottomColor:d.inputBorderError,backgroundColor:d.inputFillError}:p?{borderLeftColor:d.inputBorderPositive,borderRightColor:d.inputBorderPositive,borderTopColor:d.inputBorderPositive,borderBottomColor:d.inputBorderPositive,backgroundColor:d.inputFillPositive}:{borderLeftColor:d.inputBorder,borderRightColor:d.inputBorder,borderTopColor:d.inputBorder,borderBottomColor:d.inputBorder,backgroundColor:d.inputFill}}function x(n,e){var o=e.inputBorderRadius;return n===c.SIZE.mini&&(o=e.inputBorderRadiusMini),{borderTopLeftRadius:o,borderBottomLeftRadius:o,borderTopRightRadius:o,borderBottomRightRadius:o}}var A=function(e){var o=e.$isFocused,p=e.$adjoined,d=e.$error,C=e.$disabled,P=e.$positive,R=e.$size,B=e.$theme,E=e.$theme,M=E.borders,V=E.colors,le=E.sizing,ue=E.typography,G=E.animation,se=e.$hasIconTrailing;return v(v(v(v({boxSizing:"border-box",display:"flex",overflow:"hidden",width:"100%",borderLeftWidth:"2px",borderRightWidth:"2px",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",transitionProperty:"border",transitionDuration:G.timing200,transitionTimingFunction:G.easeOutCurve},x(R,M)),T(R,ue)),D(C,o,d,P,V)),_(p,R,le,B.direction,se))};I.getRootStyles=A;var W=(0,f.styled)("div",A);I.Root=W,W.displayName="Root",W.displayName="Root";function L(n,e){var o;return(o={},g(o,c.SIZE.mini,{paddingRight:e.scale400,paddingLeft:e.scale400}),g(o,c.SIZE.compact,{paddingRight:e.scale400,paddingLeft:e.scale400}),g(o,c.SIZE.default,{paddingRight:e.scale300,paddingLeft:e.scale300}),g(o,c.SIZE.large,{paddingRight:e.scale200,paddingLeft:e.scale200}),o)[n]}function F(n,e,o,p,d){return n?{color:d.inputEnhancerTextDisabled,backgroundColor:d.inputFillDisabled}:e?{color:d.contentPrimary,backgroundColor:d.inputFillActive}:o?{color:d.contentPrimary,backgroundColor:d.inputFillError}:p?{color:d.contentPrimary,backgroundColor:d.inputFillPositive}:{color:d.contentPrimary,backgroundColor:d.inputFill}}var i=(0,f.styled)("div",function(n){var e=n.$size,o=n.$disabled,p=n.$isFocused,d=n.$error,C=n.$positive,P=n.$theme,R=P.colors,B=P.sizing,E=P.typography,M=P.animation;return v(v(v({display:"flex",alignItems:"center",justifyContent:"center",transitionProperty:"color, background-color",transitionDuration:M.timing200,transitionTimingFunction:M.easeOutCurve},T(e,E)),L(e,B)),F(o,p,d,C,R))});I.InputEnhancer=i,i.displayName="InputEnhancer",i.displayName="InputEnhancer";function t(n,e,o,p,d){return n?{color:d.inputTextDisabled,backgroundColor:d.inputFillDisabled}:e?{color:d.contentPrimary,backgroundColor:d.inputFillActive}:o?{color:d.contentPrimary,backgroundColor:d.inputFillError}:p?{color:d.contentPrimary,backgroundColor:d.inputFillPositive}:{color:d.contentPrimary,backgroundColor:d.inputFill}}var u=function(e){var o=e.$isFocused,p=e.$error,d=e.$disabled,C=e.$positive,P=e.$size,R=e.$theme,B=R.colors,E=R.typography,M=R.animation;return v(v({display:"flex",width:"100%",transitionProperty:"background-color",transitionDuration:M.timing200,transitionTimingFunction:M.easeOutCurve},T(P,E)),t(d,o,p,C,B))};I.getInputContainerStyles=u;var s=(0,f.styled)("div",u);I.InputContainer=s,s.displayName="InputContainer",s.displayName="InputContainer";function r(n,e,o,p){return n?{color:p.inputTextDisabled,"-webkit-text-fill-color":p.inputTextDisabled,caretColor:p.contentPrimary,"::placeholder":{color:p.inputPlaceholderDisabled}}:{color:p.contentPrimary,caretColor:p.contentPrimary,"::placeholder":{color:p.inputPlaceholder}}}var a=function(e){var o=e.$disabled,p=e.$isFocused,d=e.$error,C=e.$size,P=e.$theme,R=P.colors,B=P.sizing,E=P.typography;return v(v(v({boxSizing:"border-box",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,borderLeftStyle:"none",borderRightStyle:"none",borderTopStyle:"none",borderBottomStyle:"none",outline:"none",width:"100%",minWidth:0,maxWidth:"100%",cursor:o?"not-allowed":"text",margin:"0",paddingTop:"0",paddingBottom:"0",paddingLeft:"0",paddingRight:"0"},T(C,E)),$(C,B)),r(o,p,d,R))};I.getInputStyles=a;var l=(0,f.styled)("input",a);return I.Input=l,l.displayName="Input",l.displayName="Input",I}var je=qe();const ke=Ie("div",{target:"e1ybf61d0"})({position:"absolute",top:"50%",right:"2.05em"});function He({disabled:f,element:c,widgetMgr:h,width:m,fragmentId:b}){var D;const[v,g]=xe({getStateFromWidgetMgr:Ve,getDefaultStateFromProto:Ue,getCurrStateFromProto:Ke,updateWidgetMgrState:Je,element:c,widgetMgr:h,fragmentId:b}),S=U(c.default)&&!f,O={width:m},y=Pe(),$={Select:{props:{disabled:f,overrides:{ControlContainer:{style:{height:y.sizes.minElementHeight,borderLeftWidth:y.sizes.borderWidth,borderRightWidth:y.sizes.borderWidth,borderTopWidth:y.sizes.borderWidth,borderBottomWidth:y.sizes.borderWidth}},IconsContainer:{style:()=>({paddingRight:y.spacing.sm})},ValueContainer:{style:()=>({lineHeight:y.lineHeights.inputWidget,paddingRight:y.spacing.sm,paddingLeft:y.spacing.sm,paddingBottom:y.spacing.sm,paddingTop:y.spacing.sm})},SingleValue:{props:{"data-testid":"stTimeInputTimeDisplay"}},Dropdown:{style:()=>({paddingTop:y.spacing.none,paddingBottom:y.spacing.none,boxShadow:"none",maxHeight:y.sizes.maxDropdownHeight})},DropdownListItem:{style:()=>({paddingRight:y.spacing.lg,paddingLeft:y.spacing.lg,paddingTop:y.spacing.sm,paddingBottom:y.spacing.sm})},Popover:{props:{overrides:{Body:{style:()=>({marginTop:y.spacing.px})}}}},SelectArrow:{component:De,props:{overrides:{Svg:{style:()=>({width:y.iconSizes.xl,height:y.iconSizes.xl})}}}}}}}},_=K.useCallback(x=>{const A=x===null?null:Ye(x);g({value:A,fromUi:!0})},[g]),T=K.useCallback(()=>{_(null)},[_]);return $e("div",{className:"stTimeInput","data-testid":"stTimeInput",style:O,children:[z(we,{label:c.label,disabled:f,labelVisibility:_e((D=c.labelVisibility)==null?void 0:D.value),children:c.help&&z(Te,{children:z(Ee,{content:c.help,placement:Re.TOP_RIGHT})})}),z(Ae,{format:"24",step:c.step?Number(c.step):900,value:U(v)?void 0:Ge(v),onChange:_,overrides:$,nullable:S,creatable:!0,"aria-label":c.label}),S&&!U(v)&&z(ke,{onClick:T,"data-testid":"stTimeInputClearButton",children:z(je.StyledClearIcon,{overrides:{Svg:{style:{color:y.colors.darkGray,padding:y.spacing.threeXS,height:y.sizes.clearIconSize,width:y.sizes.clearIconSize,":hover":{fill:y.colors.bodyText}}}},$isFocusVisible:!1})})]})}function Ve(f,c){return f.getStringValue(c)??null}function Ue(f){return f.default??null}function Ke(f){return f.value??null}function Je(f,c,h,m){c.setStringValue(f,h.value,{fromUi:h.fromUi},m)}function Ye(f){const c=f.getHours().toString().padStart(2,"0"),h=f.getMinutes().toString().padStart(2,"0");return`${c}:${h}`}function Ge(f){if(f===null)return null;const[c,h]=f.split(":").map(Number),m=new Date;return m.setHours(c),m.setMinutes(h),m}const ot=K.memo(He);export{ot as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{n as o,r as S,C as m,j as i,ay as y}from"./index.DeuQX1T6.js";import{S as g,T as W}from"./Toolbar.B5RomQbU.js";import{w as b,u as M,E}from"./withFullScreenWrapper.BKBYrOn-.js";const L=o("div",{target:"evl31sl0"})(({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:t.spacing.lg,maxWidth:"100%",width:"fit-content"})),O=o("div",{target:"evl31sl1"})(({theme:t})=>({display:"flex",flexDirection:"column",alignItems:"stretch",width:"auto",flexGrow:0,">img":{borderRadius:t.radii.default}})),T=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 j({element:t,width:u,endpoints:x,disableFullscreenMode:f}){const{expanded:n,width:w,height:l,expand:C,collapse:h}=M(E),d=n?w:u;let r;const a=t.width;if([-1,-3,-4].includes(a))r=void 0;else if([-2,-5].includes(a))r=d;else if(a>0)r=a;else throw Error(`Invalid image width: ${a}`);const e={};return l&&n?(e.maxHeight=l,e.objectFit="contain"):(e.width=r,e.maxWidth="100%"),m(g,{width:d,height:l,useContainerWidth:n,topCentered:!0,children:[i(W,{target:g,isFullScreen:n,onExpand:C,onCollapse:h,disableFullscreenMode:f}),i(L,{className:"stImage","data-testid":"stImage",children:t.imgs.map((I,c)=>{const s=I;return m(O,{"data-testid":"stImageContainer",children:[i("img",{style:e,src:x.buildMediaURL(s.url),alt:c.toString()}),s.caption&&i(T,{"data-testid":"stImageCaption",style:e,children:i(y,{source:s.caption,allowHTML:!1,isCaption:!0,isLabel:!0})})]},c)})})]})}const k=S.memo(b(j));export{k as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as i,j as g,bm as m,bJ as b}from"./index.DeuQX1T6.js";import{a as f}from"./useBasicWidgetState.e9cw5rKa.js";import"./FormClearHelper.Dha_cfuU.js";const p=(t,e)=>t.getStringValue(e),C=t=>t.default??null,d=t=>t.value??null,S=(t,e,r,o)=>{e.setStringValue(t,r.value,{fromUi:r.fromUi},o)},V=({element:t,disabled:e,widgetMgr:r,width:o,fragmentId:s})=>{var l;const[u,a]=f({getStateFromWidgetMgr:p,getDefaultStateFromProto:C,getCurrStateFromProto:d,updateWidgetMgrState:S,element:t,widgetMgr:r,fragmentId:s}),n=i.useCallback(c=>{a({value:c,fromUi:!0})},[a]);return g(b,{label:t.label,labelVisibility:m((l=t.labelVisibility)==null?void 0:l.value),help:t.help,onChange:n,disabled:e,width:o,value:u})},v=i.memo(V);export{v as default};
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import{d as Ge,bq as J,r as x,bT as mt,bD as bt,br as G,bU as yt,bV as Tt,n as me,at as kt,y as Ot,aH as wt,C as Ve,j as re,R as ze,ch as Rt,bm as St,bz as Mt,bn as _t,b6 as $t,bo as Et,O as It,ci as $e}from"./index.DeuQX1T6.js";import{s as Ne}from"./sprintf.D7DtBTRn.js";import{a as xt}from"./useBasicWidgetState.e9cw5rKa.js";import"./FormClearHelper.Dha_cfuU.js";var se={},H={},ce={},ue={},Ue;function Ie(){if(Ue)return ue;Ue=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.Direction=void 0;var e;return function(r){r.Right="to right",r.Left="to left",r.Down="to bottom",r.Up="to top"}(e||(ue.Direction=e={})),ue}var He;function Je(){return He||(He=1,function(e){var r=ce&&ce.__spreadArray||function(i,o,c){if(c||arguments.length===2)for(var f=0,y=o.length,h;f<y;f++)(h||!(f in o))&&(h||(h=Array.prototype.slice.call(o,0,f)),h[f]=o[f]);return i.concat(h||Array.prototype.slice.call(o))};Object.defineProperty(e,"__esModule",{value:!0}),e.isIOS=e.useThumbOverlap=e.assertUnreachable=e.voidFn=e.getTrackBackground=e.replaceAt=e.schd=e.translate=e.getClosestThumbIndex=e.translateThumbs=e.getPaddingAndBorder=e.getMargin=e.checkInitialOverlap=e.checkValuesAgainstBoundaries=e.checkBoundaries=e.isVertical=e.relativeValue=e.normalizeValue=e.isStepDivisible=e.isTouchEvent=e.getStepDecimals=void 0;var a=Ge(),s=Ie(),m=function(i){var o=i.toString().split(".")[1];return o?o.length:0};e.getStepDecimals=m;function M(i){return i.touches&&i.touches.length||i.changedTouches&&i.changedTouches.length}e.isTouchEvent=M;function u(i,o,c){var f=(o-i)/c,y=8,h=Number(f.toFixed(y));return parseInt(h.toString(),10)===h}e.isStepDivisible=u;function g(i,o,c,f,y,h,v){var S=1e11;if(i=Math.round(i*S)/S,!h){var P=v[o-1],I=v[o+1];if(P&&P>i)return P;if(I&&I<i)return I}if(i>f)return f;if(i<c)return c;var U=Math.floor(i*S-c*S)%Math.floor(y*S),z=Math.floor(i*S-Math.abs(U)),q=U===0?i:z/S,A=Math.abs(U/S)<y/2?q:q+y,L=(0,e.getStepDecimals)(y);return parseFloat(A.toFixed(L))}e.normalizeValue=g;function j(i,o,c){return(i-o)/(c-o)}e.relativeValue=j;function V(i){return i===s.Direction.Up||i===s.Direction.Down}e.isVertical=V;function F(i,o,c){if(o>=c)throw new RangeError("min (".concat(o,") is equal/bigger than max (").concat(c,")"));if(i<o)throw new RangeError("value (".concat(i,") is smaller than min (").concat(o,")"));if(i>c)throw new RangeError("value (".concat(i,") is bigger than max (").concat(c,")"))}e.checkBoundaries=F;function _(i,o,c){return i<o?o:i>c?c:i}e.checkValuesAgainstBoundaries=_;function T(i){if(!(i.length<2)&&!i.slice(1).every(function(o,c){return i[c]<=o}))throw new RangeError("values={[".concat(i,"]} needs to be sorted when allowOverlap={false}"))}e.checkInitialOverlap=T;function d(i){var o=window.getComputedStyle(i);return{top:parseInt(o["margin-top"],10),bottom:parseInt(o["margin-bottom"],10),left:parseInt(o["margin-left"],10),right:parseInt(o["margin-right"],10)}}e.getMargin=d;function t(i){var o=window.getComputedStyle(i);return{top:parseInt(o["padding-top"],10)+parseInt(o["border-top-width"],10),bottom:parseInt(o["padding-bottom"],10)+parseInt(o["border-bottom-width"],10),left:parseInt(o["padding-left"],10)+parseInt(o["border-left-width"],10),right:parseInt(o["padding-right"],10)+parseInt(o["border-right-width"],10)}}e.getPaddingAndBorder=t;function n(i,o,c){var f=c?-1:1;i.forEach(function(y,h){return p(y,f*o[h].x,o[h].y)})}e.translateThumbs=n;function l(i,o,c,f){for(var y=0,h=D(i[0],o,c,f),v=1;v<i.length;v++){var S=D(i[v],o,c,f);S<h&&(h=S,y=v)}return y}e.getClosestThumbIndex=l;function p(i,o,c){i.style.transform="translate(".concat(o,"px, ").concat(c,"px)")}e.translate=p;var b=function(i){var o=[],c=null,f=function(){for(var y=[],h=0;h<arguments.length;h++)y[h]=arguments[h];o=y,!c&&(c=requestAnimationFrame(function(){c=null,i.apply(void 0,o)}))};return f};e.schd=b;function k(i,o,c){var f=i.slice(0);return f[o]=c,f}e.replaceAt=k;function E(i){var o=i.values,c=i.colors,f=i.min,y=i.max,h=i.direction,v=h===void 0?s.Direction.Right:h,S=i.rtl,P=S===void 0?!1:S;P&&v===s.Direction.Right?v=s.Direction.Left:P&&s.Direction.Left&&(v=s.Direction.Right);var I=o.slice(0).sort(function(z,q){return z-q}).map(function(z){return(z-f)/(y-f)*100}),U=I.reduce(function(z,q,A){return"".concat(z,", ").concat(c[A]," ").concat(q,"%, ").concat(c[A+1]," ").concat(q,"%")},"");return"linear-gradient(".concat(v,", ").concat(c[0]," 0%").concat(U,", ").concat(c[c.length-1]," 100%)")}e.getTrackBackground=E;function O(){}e.voidFn=O;function w(i){throw new Error("Didn't expect to get here")}e.assertUnreachable=w;var $=function(i,o,c,f,y){y===void 0&&(y=function(v){return v});var h=Math.ceil(r([i],Array.from(i.children),!0).reduce(function(v,S){var P=Math.ceil(S.getBoundingClientRect().width);if(S.innerText&&S.innerText.includes(c)&&S.childElementCount===0){var I=S.cloneNode(!0);I.innerHTML=y(o.toFixed(f)),I.style.visibility="hidden",document.body.appendChild(I),P=Math.ceil(I.getBoundingClientRect().width),document.body.removeChild(I)}return P>v?P:v},i.getBoundingClientRect().width));return h},B=function(i,o,c,f,y,h,v){v===void 0&&(v=function(I){return I});var S=[],P=function(I){var U=$(c[I],f[I],y,h,v),z=o[I].x;o.forEach(function(q,A){var L=q.x,Z=$(c[A],f[A],y,h,v);I!==A&&(z>=L&&z<=L+Z||z+U>=L&&z+U<=L+Z)&&(S.includes(A)||(S.push(I),S.push(A),S=r(r([],S,!0),[I,A],!1),P(A)))})};return P(i),Array.from(new Set(S.sort()))},R=function(i,o,c,f,y,h){f===void 0&&(f=.1),y===void 0&&(y=" - "),h===void 0&&(h=function(A){return A});var v=(0,e.getStepDecimals)(f),S=(0,a.useState)({}),P=S[0],I=S[1],U=(0,a.useState)(h(o[c].toFixed(v))),z=U[0],q=U[1];return(0,a.useEffect)(function(){if(i){var A=i.getThumbs();if(A.length<1)return;var L={},Z=i.getOffsets(),ne=B(c,Z,A,o,y,v,h),le=h(o[c].toFixed(v));if(ne.length){var Q=ne.reduce(function(ee,oe,ge,pe){return ee.length?r(r([],ee,!0),[Z[pe[ge]].x],!1):[Z[pe[ge]].x]},[]);if(Math.min.apply(Math,Q)===Z[c].x){var de=[];ne.forEach(function(ee){de.push(o[ee].toFixed(v))}),le=Array.from(new Set(de.sort(function(ee,oe){return parseFloat(ee)-parseFloat(oe)}))).map(h).join(y);var fe=Math.min.apply(Math,Q),he=Math.max.apply(Math,Q),_e=A[ne[Q.indexOf(he)]].getBoundingClientRect().width;L.left="".concat(Math.abs(fe-(he+_e))/2,"px"),L.transform="translate(-50%, 0)"}else L.visibility="hidden"}q(le),I(L)}},[i,o]),[z,P]};e.useThumbOverlap=R;function D(i,o,c,f){var y=i.getBoundingClientRect(),h=y.left,v=y.top,S=y.width,P=y.height;return V(f)?Math.abs(c-(v+P/2)):Math.abs(o-(h+S/2))}var C=function(){var i,o=((i=navigator.userAgentData)===null||i===void 0?void 0:i.platform)||navigator.platform;return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(o)||navigator.userAgent.includes("Mac")&&"ontouchend"in document};e.isIOS=C}(ce)),ce}var qe;function Ct(){if(qe)return H;qe=1;var e=H&&H.__extends||function(){var _=function(T,d){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])},_(T,d)};return function(T,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");_(T,d);function t(){this.constructor=T}T.prototype=d===null?Object.create(d):(t.prototype=d.prototype,new t)}}(),r=H&&H.__createBinding||(Object.create?function(_,T,d,t){t===void 0&&(t=d);var n=Object.getOwnPropertyDescriptor(T,d);(!n||("get"in n?!T.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return T[d]}}),Object.defineProperty(_,t,n)}:function(_,T,d,t){t===void 0&&(t=d),_[t]=T[d]}),a=H&&H.__setModuleDefault||(Object.create?function(_,T){Object.defineProperty(_,"default",{enumerable:!0,value:T})}:function(_,T){_.default=T}),s=H&&H.__importStar||function(_){if(_&&_.__esModule)return _;var T={};if(_!=null)for(var d in _)d!=="default"&&Object.prototype.hasOwnProperty.call(_,d)&&r(T,_,d);return a(T,_),T},m=H&&H.__spreadArray||function(_,T,d){if(d||arguments.length===2)for(var t=0,n=T.length,l;t<n;t++)(l||!(t in T))&&(l||(l=Array.prototype.slice.call(T,0,t)),l[t]=T[t]);return _.concat(l||Array.prototype.slice.call(T))};Object.defineProperty(H,"__esModule",{value:!0});var M=s(Ge()),u=Je(),g=Ie(),j=["ArrowRight","ArrowUp","k","PageUp"],V=["ArrowLeft","ArrowDown","j","PageDown"],F=function(_){e(T,_);function T(d){var t=_.call(this,d)||this;if(t.trackRef=M.createRef(),t.thumbRefs=[],t.state={draggedTrackPos:[-1,-1],draggedThumbIndex:-1,thumbZIndexes:new Array(t.props.values.length).fill(0).map(function(n,l){return l}),isChanged:!1,markOffsets:[]},t.getOffsets=function(){var n=t.props,l=n.direction,p=n.values,b=n.min,k=n.max,E=t.trackRef.current;if(!E)return console.warn("No track element found."),[];var O=E.getBoundingClientRect(),w=(0,u.getPaddingAndBorder)(E);return t.getThumbs().map(function($,B){var R={x:0,y:0},D=$.getBoundingClientRect(),C=(0,u.getMargin)($);switch(l){case g.Direction.Right:return R.x=(C.left+w.left)*-1,R.y=((D.height-O.height)/2+w.top)*-1,R.x+=O.width*(0,u.relativeValue)(p[B],b,k)-D.width/2,R;case g.Direction.Left:return R.x=(C.right+w.right)*-1,R.y=((D.height-O.height)/2+w.top)*-1,R.x+=O.width-O.width*(0,u.relativeValue)(p[B],b,k)-D.width/2,R;case g.Direction.Up:return R.x=((D.width-O.width)/2+C.left+w.left)*-1,R.y=-w.left,R.y+=O.height-O.height*(0,u.relativeValue)(p[B],b,k)-D.height/2,R;case g.Direction.Down:return R.x=((D.width-O.width)/2+C.left+w.left)*-1,R.y=-w.left,R.y+=O.height*(0,u.relativeValue)(p[B],b,k)-D.height/2,R;default:return(0,u.assertUnreachable)(l)}})},t.getThumbs=function(){return t.trackRef&&t.trackRef.current?Array.from(t.trackRef.current.children).filter(function(n){return n.hasAttribute("aria-valuenow")}):(console.warn("No thumbs found in the track container. Did you forget to pass & spread the `props` param in renderTrack?"),[])},t.getTargetIndex=function(n){return t.getThumbs().findIndex(function(l){return l===n.target||l.contains(n.target)})},t.addTouchEvents=function(n){document.addEventListener("touchmove",t.schdOnTouchMove,{passive:!1}),document.addEventListener("touchend",t.schdOnEnd,{passive:!1}),document.addEventListener("touchcancel",t.schdOnEnd,{passive:!1})},t.addMouseEvents=function(n){document.addEventListener("mousemove",t.schdOnMouseMove),document.addEventListener("mouseup",t.schdOnEnd)},t.onMouseDownTrack=function(n){var l;if(!(n.button!==0||(0,u.isIOS)()))if(n.persist(),n.preventDefault(),t.addMouseEvents(n.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(b){var k;return(k=b.current)===null||k===void 0?void 0:k.contains(n.target)}))return;t.setState({draggedTrackPos:[n.clientX,n.clientY]},function(){return t.onMove(n.clientX,n.clientY)})}else{var p=(0,u.getClosestThumbIndex)(t.thumbRefs.map(function(b){return b.current}),n.clientX,n.clientY,t.props.direction);(l=t.thumbRefs[p].current)===null||l===void 0||l.focus(),t.setState({draggedThumbIndex:p},function(){return t.onMove(n.clientX,n.clientY)})}},t.onResize=function(){(0,u.translateThumbs)(t.getThumbs(),t.getOffsets(),t.props.rtl),t.calculateMarkOffsets()},t.onTouchStartTrack=function(n){var l;if(n.persist(),t.addTouchEvents(n.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(b){var k;return(k=b.current)===null||k===void 0?void 0:k.contains(n.target)}))return;t.setState({draggedTrackPos:[n.touches[0].clientX,n.touches[0].clientY]},function(){return t.onMove(n.touches[0].clientX,n.touches[0].clientY)})}else{var p=(0,u.getClosestThumbIndex)(t.thumbRefs.map(function(b){return b.current}),n.touches[0].clientX,n.touches[0].clientY,t.props.direction);(l=t.thumbRefs[p].current)===null||l===void 0||l.focus(),t.setState({draggedThumbIndex:p},function(){return t.onMove(n.touches[0].clientX,n.touches[0].clientY)})}},t.onMouseOrTouchStart=function(n){if(!t.props.disabled){var l=(0,u.isTouchEvent)(n);if(!(!l&&n.button!==0)){var p=t.getTargetIndex(n);p!==-1&&(l?t.addTouchEvents(n):t.addMouseEvents(n),t.setState({draggedThumbIndex:p,thumbZIndexes:t.state.thumbZIndexes.map(function(b,k){return k===p?Math.max.apply(Math,t.state.thumbZIndexes):b<=t.state.thumbZIndexes[p]?b:b-1})}))}}},t.onMouseMove=function(n){n.preventDefault(),t.onMove(n.clientX,n.clientY)},t.onTouchMove=function(n){n.preventDefault(),t.onMove(n.touches[0].clientX,n.touches[0].clientY)},t.onKeyDown=function(n){var l=t.props,p=l.values,b=l.onChange,k=l.step,E=l.rtl,O=l.direction,w=t.state.isChanged,$=t.getTargetIndex(n.nativeEvent),B=E||O===g.Direction.Left||O===g.Direction.Down?-1:1;$!==-1&&(j.includes(n.key)?(n.preventDefault(),t.setState({draggedThumbIndex:$,isChanged:!0}),b((0,u.replaceAt)(p,$,t.normalizeValue(p[$]+B*(n.key==="PageUp"?k*10:k),$)))):V.includes(n.key)?(n.preventDefault(),t.setState({draggedThumbIndex:$,isChanged:!0}),b((0,u.replaceAt)(p,$,t.normalizeValue(p[$]-B*(n.key==="PageDown"?k*10:k),$)))):n.key==="Tab"?t.setState({draggedThumbIndex:-1},function(){w&&t.fireOnFinalChange()}):w&&t.fireOnFinalChange())},t.onKeyUp=function(n){var l=t.state.isChanged;t.setState({draggedThumbIndex:-1},function(){l&&t.fireOnFinalChange()})},t.onMove=function(n,l){var p=t.state,b=p.draggedThumbIndex,k=p.draggedTrackPos,E=t.props,O=E.direction,w=E.min,$=E.max,B=E.onChange,R=E.values,D=E.step,C=E.rtl;if(b===-1&&k[0]===-1&&k[1]===-1)return null;var i=t.trackRef.current;if(!i)return null;var o=i.getBoundingClientRect(),c=(0,u.isVertical)(O)?o.height:o.width;if(k[0]!==-1&&k[1]!==-1){var f=n-k[0],y=l-k[1],h=0;switch(O){case g.Direction.Right:case g.Direction.Left:h=f/c*($-w);break;case g.Direction.Down:case g.Direction.Up:h=y/c*($-w);break;default:(0,u.assertUnreachable)(O)}if(C&&(h*=-1),Math.abs(h)>=D/2){for(var v=0;v<t.thumbRefs.length;v++){if(R[v]===$&&Math.sign(h)===1||R[v]===w&&Math.sign(h)===-1)return;var S=R[v]+h;S>$?h=$-R[v]:S<w&&(h=w-R[v])}for(var P=R.slice(0),v=0;v<t.thumbRefs.length;v++)P=(0,u.replaceAt)(P,v,t.normalizeValue(R[v]+h,v));t.setState({draggedTrackPos:[n,l]}),B(P)}}else{var I=0;switch(O){case g.Direction.Right:I=(n-o.left)/c*($-w)+w;break;case g.Direction.Left:I=(c-(n-o.left))/c*($-w)+w;break;case g.Direction.Down:I=(l-o.top)/c*($-w)+w;break;case g.Direction.Up:I=(c-(l-o.top))/c*($-w)+w;break;default:(0,u.assertUnreachable)(O)}C&&(I=$+w-I),Math.abs(R[b]-I)>=D/2&&B((0,u.replaceAt)(R,b,t.normalizeValue(I,b)))}},t.normalizeValue=function(n,l){var p=t.props,b=p.min,k=p.max,E=p.step,O=p.allowOverlap,w=p.values;return(0,u.normalizeValue)(n,l,b,k,E,O,w)},t.onEnd=function(n){if(n.preventDefault(),document.removeEventListener("mousemove",t.schdOnMouseMove),document.removeEventListener("touchmove",t.schdOnTouchMove),document.removeEventListener("mouseup",t.schdOnEnd),document.removeEventListener("touchend",t.schdOnEnd),document.removeEventListener("touchcancel",t.schdOnEnd),t.state.draggedThumbIndex===-1&&t.state.draggedTrackPos[0]===-1&&t.state.draggedTrackPos[1]===-1)return null;t.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){t.fireOnFinalChange()})},t.fireOnFinalChange=function(){t.setState({isChanged:!1});var n=t.props,l=n.onFinalChange,p=n.values;l&&l(p)},t.updateMarkRefs=function(n){if(!n.renderMark){t.numOfMarks=void 0,t.markRefs=void 0;return}t.numOfMarks=(n.max-n.min)/t.props.step,t.markRefs=[];for(var l=0;l<t.numOfMarks+1;l++)t.markRefs[l]=M.createRef()},t.calculateMarkOffsets=function(){if(!(!t.props.renderMark||!t.trackRef||!t.numOfMarks||!t.markRefs||t.trackRef.current===null)){for(var n=window.getComputedStyle(t.trackRef.current),l=parseInt(n.width,10),p=parseInt(n.height,10),b=parseInt(n.paddingLeft,10),k=parseInt(n.paddingTop,10),E=[],O=0;O<t.numOfMarks+1;O++){var w=9999,$=9999;if(t.markRefs[O].current){var B=t.markRefs[O].current.getBoundingClientRect();w=B.height,$=B.width}t.props.direction===g.Direction.Left||t.props.direction===g.Direction.Right?E.push([Math.round(l/t.numOfMarks*O+b-$/2),-Math.round((w-p)/2)]):E.push([Math.round(p/t.numOfMarks*O+k-w/2),-Math.round(($-l)/2)])}t.setState({markOffsets:E})}},d.step===0)throw new Error('"step" property should be a positive number');return t.schdOnMouseMove=(0,u.schd)(t.onMouseMove),t.schdOnTouchMove=(0,u.schd)(t.onTouchMove),t.schdOnEnd=(0,u.schd)(t.onEnd),t.thumbRefs=d.values.map(function(){return M.createRef()}),t.updateMarkRefs(d),t}return T.prototype.componentDidMount=function(){var d=this,t=this.props,n=t.values,l=t.min,p=t.step;this.resizeObserver=window.ResizeObserver?new window.ResizeObserver(this.onResize):{observe:function(){return window.addEventListener("resize",d.onResize)},unobserve:function(){return window.removeEventListener("resize",d.onResize)}},document.addEventListener("touchstart",this.onMouseOrTouchStart,{passive:!1}),document.addEventListener("mousedown",this.onMouseOrTouchStart,{passive:!1}),!this.props.allowOverlap&&(0,u.checkInitialOverlap)(this.props.values),this.props.values.forEach(function(b){return(0,u.checkBoundaries)(b,d.props.min,d.props.max)}),this.resizeObserver.observe(this.trackRef.current),(0,u.translateThumbs)(this.getThumbs(),this.getOffsets(),this.props.rtl),this.calculateMarkOffsets(),n.forEach(function(b){(0,u.isStepDivisible)(l,b,p)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")})},T.prototype.componentDidUpdate=function(d,t){var n=this.props,l=n.max,p=n.min,b=n.step,k=n.values,E=n.rtl;(d.max!==l||d.min!==p||d.step!==b)&&this.updateMarkRefs(this.props),(0,u.translateThumbs)(this.getThumbs(),this.getOffsets(),E),(d.max!==l||d.min!==p||d.step!==b||t.markOffsets.length!==this.state.markOffsets.length)&&(this.calculateMarkOffsets(),k.forEach(function(O){(0,u.isStepDivisible)(p,O,b)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")}))},T.prototype.componentWillUnmount=function(){var d={passive:!1};document.removeEventListener("mousedown",this.onMouseOrTouchStart,d),document.removeEventListener("mousemove",this.schdOnMouseMove),document.removeEventListener("touchmove",this.schdOnTouchMove),document.removeEventListener("touchstart",this.onMouseOrTouchStart),document.removeEventListener("mouseup",this.schdOnEnd),document.removeEventListener("touchend",this.schdOnEnd),this.resizeObserver.unobserve(this.trackRef.current)},T.prototype.render=function(){var d=this,t=this.props,n=t.label,l=t.labelledBy,p=t.renderTrack,b=t.renderThumb,k=t.renderMark,E=k===void 0?function(){return null}:k,O=t.values,w=t.min,$=t.max,B=t.allowOverlap,R=t.disabled,D=this.state,C=D.draggedThumbIndex,i=D.thumbZIndexes,o=D.markOffsets;return p({props:{style:{transform:"scale(1)",cursor:C>-1?"grabbing":this.props.draggableTrack?(0,u.isVertical)(this.props.direction)?"ns-resize":"ew-resize":O.length===1&&!R?"pointer":"inherit"},onMouseDown:R?u.voidFn:this.onMouseDownTrack,onTouchStart:R?u.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:R,children:m(m([],o.map(function(c,f,y){return E({props:{style:d.props.direction===g.Direction.Left||d.props.direction===g.Direction.Right?{position:"absolute",left:"".concat(c[0],"px"),marginTop:"".concat(c[1],"px")}:{position:"absolute",top:"".concat(c[0],"px"),marginLeft:"".concat(c[1],"px")},key:"mark".concat(f),ref:d.markRefs[f]},index:f})}),!0),O.map(function(c,f){var y=d.state.draggedThumbIndex===f;return b({index:f,value:c,isDragged:y,props:{style:{position:"absolute",zIndex:i[f],cursor:R?"inherit":y?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:f,tabIndex:R?void 0:0,"aria-valuemax":B?$:O[f+1]||$,"aria-valuemin":B?w:O[f-1]||w,"aria-valuenow":c,draggable:!1,ref:d.thumbRefs[f],"aria-label":n,"aria-labelledby":l,role:"slider",onKeyDown:R?u.voidFn:d.onKeyDown,onKeyUp:R?u.voidFn:d.onKeyUp}})}),!0)})},T.defaultProps={label:"Accessibility label",labelledBy:null,step:1,direction:g.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},T}(M.Component);return H.default=F,H}var We;function Dt(){return We||(We=1,function(e){var r=se&&se.__importDefault||function(M){return M&&M.__esModule?M:{default:M}};Object.defineProperty(e,"__esModule",{value:!0}),e.checkValuesAgainstBoundaries=e.relativeValue=e.useThumbOverlap=e.Direction=e.getTrackBackground=e.Range=void 0;var a=r(Ct());e.Range=a.default;var s=Je();Object.defineProperty(e,"getTrackBackground",{enumerable:!0,get:function(){return s.getTrackBackground}}),Object.defineProperty(e,"useThumbOverlap",{enumerable:!0,get:function(){return s.useThumbOverlap}}),Object.defineProperty(e,"relativeValue",{enumerable:!0,get:function(){return s.relativeValue}}),Object.defineProperty(e,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return s.checkValuesAgainstBoundaries}});var m=Ie();Object.defineProperty(e,"Direction",{enumerable:!0,get:function(){return m.Direction}})}(se)),se}var Qe=Dt();function Ke(e,r){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);r&&(s=s.filter(function(m){return Object.getOwnPropertyDescriptor(e,m).enumerable})),a.push.apply(a,s)}return a}function ve(e){for(var r=1;r<arguments.length;r++){var a=arguments[r]!=null?arguments[r]:{};r%2?Ke(Object(a),!0).forEach(function(s){Pt(e,s,a[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Ke(Object(a)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(a,s))})}return e}function Pt(e,r,a){return r in e?Object.defineProperty(e,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[r]=a,e}var be=J("div",{position:"relative",width:"100%"});be.displayName="Root";be.displayName="Root";be.displayName="StyledRoot";var ye=J("div",function(e){var r=e.$theme,a=e.$value,s=a===void 0?[]:a,m=e.$disabled,M=e.$isDragged,u=r.sizing,g="inherit";return m?g="not-allowed":M?g="grabbing":s.length===1&&(g="pointer"),{paddingTop:u.scale600,paddingBottom:u.scale600,paddingRight:u.scale600,paddingLeft:u.scale600,display:"flex",cursor:g,backgroundColor:r.colors.sliderTrackFill}});ye.displayName="Track";ye.displayName="Track";ye.displayName="StyledTrack";var Te=J("div",function(e){var r=e.$theme,a=e.$value,s=a===void 0?[]:a,m=e.$min,M=e.$max,u=e.$disabled,g=r.colors,j=r.borders,V=r.direction,F=r.borders.useRoundedCorners?j.radius100:0;return{borderTopLeftRadius:F,borderTopRightRadius:F,borderBottomRightRadius:F,borderBottomLeftRadius:F,background:Qe.getTrackBackground({values:s,colors:s.length===1?[u?g.borderOpaque:g.primary,u?g.backgroundSecondary:g.borderOpaque]:[u?g.backgroundSecondary:g.borderOpaque,u?g.borderOpaque:g.primary,u?g.backgroundSecondary:g.borderOpaque],min:m||0,max:M||0,rtl:V==="rtl"}),height:"2px",width:"100%",alignSelf:"center",cursor:u?"not-allowed":"inherit"}});Te.displayName="InnerTrack";Te.displayName="InnerTrack";Te.displayName="StyledInnerTrack";var ke=J("div",function(e){return{width:"4px",height:"2px",backgroundColor:e.$theme.colors.backgroundPrimary,marginLeft:"16px"}});ke.displayName="Mark";ke.displayName="Mark";ke.displayName="StyledMark";var Oe=J("div",function(e){return ve(ve({},e.$theme.typography.font200),{},{color:e.$theme.colors.contentPrimary})});Oe.displayName="Tick";Oe.displayName="Tick";Oe.displayName="StyledTick";var we=J("div",function(e){var r=e.$theme,a=r.sizing;return{display:"flex",justifyContent:"space-between",alignItems:"center",paddingRight:a.scale600,paddingLeft:a.scale600,paddingBottom:a.scale400}});we.displayName="TickBar";we.displayName="TickBar";we.displayName="StyledTickBar";var Re=J("div",function(e){var r=e.$theme,a=e.$value,s=a===void 0?[]:a,m=e.$thumbIndex,M=e.$disabled,u=s.length===2&&m===0,g=s.length===2&&m===1;return r.direction==="rtl"&&(g||u)&&(u=!u,g=!g),{height:"24px",width:"24px",borderTopLeftRadius:"24px",borderTopRightRadius:"24px",borderBottomLeftRadius:"24px",borderBottomRightRadius:"24px",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:M?r.colors.sliderHandleFillDisabled:r.colors.sliderHandleFill,outline:"none",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(r.colors.accent):"0 1px 4px rgba(0, 0, 0, 0.12)",cursor:M?"not-allowed":"inherit"}});Re.displayName="Thumb";Re.displayName="Thumb";Re.displayName="StyledThumb";var Se=J("div",function(e){var r=e.$disabled,a=e.$theme;return{position:"absolute",top:"-16px",width:"4px",height:"20px",backgroundColor:r?a.colors.sliderHandleFillDisabled:a.colors.sliderHandleInnerFill}});Se.displayName="InnerThumb";Se.displayName="InnerThumb";Se.displayName="StyledInnerThumb";var Me=J("div",function(e){var r=e.$disabled,a=e.$theme;return ve(ve({position:"absolute",top:"-".concat(a.sizing.scale1400)},a.typography.font200),{},{backgroundColor:r?a.colors.sliderHandleFillDisabled:a.colors.sliderHandleInnerFill,color:a.colors.contentInversePrimary,paddingLeft:a.sizing.scale600,paddingRight:a.sizing.scale600,paddingTop:a.sizing.scale500,paddingBottom:a.sizing.scale500,borderBottomLeftRadius:"48px",borderBottomRightRadius:"48px",borderTopLeftRadius:"48px",borderTopRightRadius:"48px",whiteSpace:"nowrap"})});Me.displayName="ThumbValue";Me.displayName="ThumbValue";Me.displayName="StyledThumbValue";function Ye(e,r){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);r&&(s=s.filter(function(m){return Object.getOwnPropertyDescriptor(e,m).enumerable})),a.push.apply(a,s)}return a}function Bt(e){for(var r=1;r<arguments.length;r++){var a=arguments[r]!=null?arguments[r]:{};r%2?Ye(Object(a),!0).forEach(function(s){At(e,s,a[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Ye(Object(a)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(a,s))})}return e}function At(e,r,a){return r in e?Object.defineProperty(e,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[r]=a,e}function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var a=arguments[r];for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(e[s]=a[s])}return e},Y.apply(this,arguments)}function K(e,r){return Vt(e)||jt(e,r)||Ft(e,r)||Lt()}function Lt(){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 Ft(e,r){if(e){if(typeof e=="string")return Xe(e,r);var a=Object.prototype.toString.call(e).slice(8,-1);if(a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set")return Array.from(e);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return Xe(e,r)}}function Xe(e,r){(r==null||r>e.length)&&(r=e.length);for(var a=0,s=new Array(r);a<r;a++)s[a]=e[a];return s}function jt(e,r){var a=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(a!=null){var s=[],m=!0,M=!1,u,g;try{for(a=a.call(e);!(m=(u=a.next()).done)&&(s.push(u.value),!(r&&s.length===r));m=!0);}catch(j){M=!0,g=j}finally{try{!m&&a.return!=null&&a.return()}finally{if(M)throw g}}return s}}function Vt(e){if(Array.isArray(e))return e}var zt=function(r){if(r.length>2||r.length===0)throw new Error("the value prop represents positions of thumbs, so its length can be only one or two");return r};function Nt(e){var r=e.overrides,a=r===void 0?{}:r,s=e.disabled,m=s===void 0?!1:s,M=e.marks,u=M===void 0?!1:M,g=e.onChange,j=g===void 0?function(){}:g,V=e.onFinalChange,F=V===void 0?function(){}:V,_=e.min,T=_===void 0?0:_,d=e.max,t=d===void 0?100:d,n=e.step,l=n===void 0?1:n,p=e.persistentThumb,b=p===void 0?!1:p,k=e.valueToLabel,E=k===void 0?function(X){return X}:k,O=e.value,w=x.useContext(mt),$=x.useState(!1),B=K($,2),R=B[0],D=B[1],C=x.useState(!1),i=K(C,2),o=i[0],c=i[1],f=x.useState(!1),y=K(f,2),h=y[0],v=y[1],S=x.useState(-1),P=K(S,2),I=P[0],U=P[1],z=x.useCallback(function(X){bt(X)&&v(!0);var N=X.target.parentNode.firstChild===X.target?0:1;U(N)},[]),q=x.useCallback(function(X){h!==!1&&v(!1),U(-1)},[]),A=zt(O),L={$disabled:m,$step:l,$min:T,$max:t,$marks:u,$value:A,$isFocusVisible:h},Z=G(a.Root,be),ne=K(Z,2),le=ne[0],Q=ne[1],de=G(a.Track,ye),fe=K(de,2),he=fe[0],_e=fe[1],ee=G(a.InnerTrack,Te),oe=K(ee,2),ge=oe[0],pe=oe[1],et=G(a.Thumb,Re),xe=K(et,2),tt=xe[0],rt=xe[1],nt=G(a.InnerThumb,Se),Ce=K(nt,2),at=Ce[0],it=Ce[1],ot=G(a.ThumbValue,Me),De=K(ot,2),st=De[0],ct=De[1],ut=G(a.Tick,Oe),Pe=K(ut,2),Be=Pe[0],Ae=Pe[1],lt=G(a.TickBar,we),Le=K(lt,2),dt=Le[0],ft=Le[1],ht=G(a.Mark,ke),Fe=K(ht,2),gt=Fe[0],pt=Fe[1];return x.createElement(le,Y({"data-baseweb":"slider"},L,Q,{onFocus:Tt(Q,z),onBlur:yt(Q,q)}),x.createElement(Qe.Range,Y({step:l,min:T,max:t,values:A,disabled:m,onChange:function(N){return j({value:N})},onFinalChange:function(N){return F({value:N})},rtl:w.direction==="rtl",renderTrack:function(N){var te=N.props,W=N.children,ae=N.isDragged;return x.createElement(he,Y({onMouseDown:te.onMouseDown,onTouchStart:te.onTouchStart,$isDragged:ae},L,_e),x.createElement(ge,Y({$isDragged:ae,ref:te.ref},L,pe),W))},renderThumb:function(N){var te=N.props,W=N.index,ae=N.isDragged,je=b||(!!W&&o||!W&&R||ae)&&!m;return x.createElement(tt,Y({},te,{onMouseEnter:function(){W===0?D(!0):c(!0)},onMouseLeave:function(){W===0?D(!1):c(!1)},$thumbIndex:W,$isDragged:ae,style:Bt({},te.style)},L,rt,{$isFocusVisible:h&&I===W}),je&&x.createElement(st,Y({$thumbIndex:W,$isDragged:ae},L,ct),E(A[W])),je&&x.createElement(at,Y({$thumbIndex:W,$isDragged:ae},L,it)))}},u?{renderMark:function(N){var te=N.props,W=N.index;return x.createElement(gt,Y({$markIndex:W},te,L,pt))}}:{})),x.createElement(dt,Y({},L,ft),x.createElement(Be,Y({},L,Ae),E(T)),x.createElement(Be,Y({},L,Ae),E(t))))}const Ut=me("div",{target:"e8lt0n70"})(({disabled:e,theme:r})=>({alignItems:"center",backgroundColor:e?r.colors.gray:r.colors.primary,borderTopLeftRadius:"100%",borderTopRightRadius:"100%",borderBottomLeftRadius:"100%",borderBottomRightRadius:"100%",borderTopStyle:"none",borderBottomStyle:"none",borderRightStyle:"none",borderLeftStyle:"none",boxShadow:"none",display:"flex",justifyContent:"center",height:r.sizes.sliderThumb,width:r.sizes.sliderThumb,":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 0.2rem ${kt(r.colors.primary,.5)}`}})),Ht=me("div",{target:"e8lt0n71"})(({disabled:e,theme:r})=>({fontFamily:r.genericFonts.codeFont,fontSize:r.fontSizes.sm,color:e?r.colors.gray:r.colors.primary,top:"-1.6em",position:"absolute",whiteSpace:"nowrap",backgroundColor:r.colors.transparent,lineHeight:r.lineHeights.base,fontWeight:r.fontWeights.normal,pointerEvents:"none"})),qt=me("div",{target:"e8lt0n72"})(({theme:e})=>({fontSize:e.fontSizes.sm,paddingBottom:e.spacing.none,paddingLeft:e.spacing.none,paddingRight:e.spacing.none,paddingTop:"0.65em",justifyContent:"space-between",alignItems:"center",display:"flex"})),Ze=me("div",{target:"e8lt0n73"})(({disabled:e,theme:r})=>({lineHeight:r.lineHeights.base,fontWeight:r.fontWeights.normal,fontFamily:r.genericFonts.codeFont,color:e?r.colors.fadedText40:"inherit"})),Wt=200;function Kt({disabled:e,element:r,widgetMgr:a,width:s,fragmentId:m}){var D;const[M,u]=xt({getStateFromWidgetMgr:Yt,getDefaultStateFromProto:Xt,getCurrStateFromProto:Zt,updateWidgetMgrState:Gt,element:r,widgetMgr:a,fragmentId:m}),[g,j]=x.useState(M),V=x.useRef(null),[F]=x.useState([]),[_]=x.useState([]),{colors:T,fonts:d,fontSizes:t,spacing:n}=Ot(),l={width:s},p=g.map(C=>Ee(C,r)),b=Ee(r.min,r),k=Ee(r.max,r),E=r.label;x.useEffect(()=>{j(M)},[M]);const O=x.useCallback(wt(Wt,C=>{u({value:C,fromUi:!0})}),[]),w=x.useCallback(({value:C})=>{j(C),O(C)},[O]),$=x.useCallback(()=>Ve(qt,{"data-testid":"stSliderTickBar",children:[re(Ze,{disabled:e,"data-testid":"stSliderTickBarMin",children:b}),re(Ze,{disabled:e,"data-testid":"stSliderTickBarMax",children:k})]}),[b,k,e]),B=x.useCallback(ze.forwardRef(function(i,o){const{$thumbIndex:c}=i,f=c||0;F[f]=o,_[f]||(_[f]=ze.createRef());const y=Rt(i,["role","style","aria-valuemax","aria-valuemin","aria-valuenow","tabIndex","onKeyUp","onKeyDown","onMouseEnter","onMouseLeave","draggable"]),h=p[f];return re(Ut,{...y,disabled:i.$disabled===!0,ref:F[f],"aria-valuetext":h,"aria-label":E,children:re(Ht,{"data-testid":"stSliderThumbValue",disabled:i.$disabled===!0,ref:_[f],children:h})})}),[]);x.useEffect(()=>{var y,h;_.map((v,S)=>{v.current&&(v.current.innerText=p[S])}),F.map((v,S)=>{v.current&&v.current.setAttribute("aria-valuetext",p[S])});const C=V.current??null,i=F[0].current,o=(y=F[1])==null?void 0:y.current,c=_[0].current,f=(h=_[1])==null?void 0:h.current;er(C,i,o,c,f)});const R=x.useCallback(({$disabled:C})=>({height:n.twoXS,...C?{background:T.darkenedBgMix25}:{}}),[T,n]);return Ve("div",{ref:V,className:"stSlider","data-testid":"stSlider",style:l,children:[re(Et,{label:r.label,disabled:e,labelVisibility:St((D=r.labelVisibility)==null?void 0:D.value),children:r.help&&re(Mt,{children:re(_t,{content:r.help,placement:$t.TOP_RIGHT})})}),re(Nt,{min:r.min,max:r.max,step:r.step,value:Qt(g,r),onChange:w,disabled:e,overrides:{Thumb:B,Tick:{style:{fontFamily:d.monospace}},Track:{style:{backgroundColor:"none !important",paddingBottom:n.none,paddingLeft:n.none,paddingRight:n.none,paddingTop:`calc(${t.sm} * 1.35)`}},InnerTrack:{style:R},TickBar:$}})]})}function Yt(e,r){return e.getDoubleArrayValue(r)}function Xt(e){return e.default}function Zt(e){return e.value}function Gt(e,r,a,s){r.setDoubleArrayValue(e,a.value,{fromUi:a.fromUi},s)}function Jt(e){const{dataType:r}=e;return r===$e.DataType.DATETIME||r===$e.DataType.DATE||r===$e.DataType.TIME}function Ee(e,r){const{format:a,options:s}=r;return Jt(r)?It.utc(e/1e3).format(a):s.length>0?Ne.sprintf(a,s[e]):Ne.sprintf(a,e)}function Qt(e,r){const{min:a,max:s}=r;let m=e[0],M=e.length>1?e[1]:e[0];return m>M&&(m=M),m<a&&(m=a),m>s&&(m=s),M<a&&(M=a),M>s&&(M=s),e.length>1?[m,M]:[m]}function er(e,r,a,s,m){!e||!r||!s||(ie(e,r,s),a&&m&&(ie(e,a,m),tr(e,r,a,s,m)))}function ie(e,r,a){const s=e.getBoundingClientRect(),m=r.getBoundingClientRect(),M=a.getBoundingClientRect(),u=m.left+m.width/2,g=u-M.width/2<s.left,j=u+M.width/2>s.right;a.style.left=g?"0":"",a.style.right=j?"0":""}function tr(e,r,a,s,m){const u=e.getBoundingClientRect(),g=r.getBoundingClientRect(),j=a.getBoundingClientRect(),V=s.getBoundingClientRect(),F=m.getBoundingClientRect(),_=u.left+u.width/2,T=g.left+g.width/2,d=j.left+j.width/2,t=T-V.width/2>=u.left,n=d+F.width/2<=u.right,l=g.left-V.width>=u.left,p=j.right+F.width<=u.right,b=t?V.width/2:V.width,k=n?F.width/2:F.width,E=T+b;if(d-k-E>24){ie(e,r,s),ie(e,a,m);return}if(l&&p){s.style.left="",s.style.right=`${Math.round(g.width)}px`,m.style.left=`${Math.round(j.width)}px`,m.style.right="";return}T<_?(ie(e,r,s),m.style.left=`${Math.round(T+b+24-d)}px`,m.style.right=""):(ie(e,a,m),s.style.left="",s.style.right=`${-Math.round(d-k-24-T)}px`)}const or=x.memo(Kt);export{or as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{n as z,r as a,y as R,cl as I,C as U,j as u,bm as k,bz as H,bn as L,b6 as B,bo as D,cm as j}from"./index.DeuQX1T6.js";import{u as O}from"./uniqueId.B4ugkryR.js";import{u as _,a as K,b as $}from"./useOnInputChange.CHDPgswc.js";import{a as q}from"./useBasicWidgetState.e9cw5rKa.js";import{I as A}from"./InputInstructions.C_m6JNSV.js";import{I as G}from"./input.D-b9-dhW.js";import"./inputUtils.CQWz5UKz.js";import"./FormClearHelper.Dha_cfuU.js";import"./base-input.B_U9Mij-.js";const N=z("div",{target:"e1sommdr0"})(({width:e})=>({position:"relative",width:e}));function w({disabled:e,element:t,widgetMgr:s,width:n,fragmentId:m}){var g;const[r,l]=a.useState(S(s,t)??null),[i,d]=a.useState(!1),W=a.useCallback(()=>{l(t.default??null),d(!0)},[t.default]),[y,p]=q({getStateFromWidgetMgr:S,getDefaultStateFromProto:J,getCurrStateFromProto:Q,updateWidgetMgrState:X,element:t,widgetMgr:s,fragmentId:m,onFormCleared:W});_(y,r,l,i);const[T,h]=a.useState(!1),o=R(),[b]=a.useState(()=>O("text_input_")),{placeholder:x,formId:f}=t,c=a.useCallback(()=>{d(!1),p({value:r,fromUi:!0})},[r,p]),C=I({formId:f})?s.allowFormEnterToSubmit(f):i,V=T&&n>o.breakpoints.hideWidgetDetails,F=a.useCallback(()=>{i&&c(),h(!1)},[i,c]),v=a.useCallback(()=>{h(!0)},[]),E=K({formId:t.formId,maxChars:t.maxChars,setDirty:d,setUiValue:l,setValueWithSource:p}),P=$(t.formId,c,i,s,m);return U(N,{className:"stTextInput","data-testid":"stTextInput",width:n,children:[u(D,{label:t.label,disabled:e,labelVisibility:k((g=t.labelVisibility)==null?void 0:g.value),htmlFor:b,children:t.help&&u(H,{children:u(L,{content:t.help,placement:B.TOP_RIGHT})})}),u(G,{value:r??"",placeholder:x,onBlur:F,onFocus:v,onChange:E,onKeyPress:P,"aria-label":t.label,disabled:e,id:b,type:Y(t),autoComplete:t.autocomplete,overrides:{Input:{style:{minWidth:0,"::placeholder":{opacity:"0.7"},lineHeight:o.lineHeights.inputWidget,paddingRight:o.spacing.sm,paddingLeft:o.spacing.sm,paddingBottom:o.spacing.sm,paddingTop:o.spacing.sm}},Root:{props:{"data-testid":"stTextInputRootElement"},style:{height:o.sizes.minElementHeight,borderLeftWidth:o.sizes.borderWidth,borderRightWidth:o.sizes.borderWidth,borderTopWidth:o.sizes.borderWidth,borderBottomWidth:o.sizes.borderWidth}}}}),V&&u(A,{dirty:i,value:r??"",maxLength:t.maxChars,inForm:I({formId:t.formId}),allowEnterToSubmit:C})]})}function S(e,t){return e.getStringValue(t)??null}function J(e){return e.default??null}function Q(e){return e.value??null}function X(e,t,s,n){t.setStringValue(e,s.value,{fromUi:s.fromUi},n)}function Y(e){return e.type===j.Type.PASSWORD?"password":"text"}const ut=a.memo(w);export{ut as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{n as u,r as o,y as w,C as x,j as i,G as h,ay as v,aL as n,aM as m,aN as k,F as L,D as z}from"./index.DeuQX1T6.js";const R=u("button",{target:"e1rpgzpk0"})(({theme:t})=>({fontSize:t.fontSizes.sm,lineHeight:t.lineHeights.base,color:t.colors.fadedText60,backgroundColor:t.colors.transparent,fontFamily:"inherit",margin:t.spacing.none,border:"none",boxShadow:"none",padding:t.spacing.none,"&:hover, &:active, &:focus":{border:"none",outline:"none",boxShadow:"none"},"&:hover":{color:t.colors.primary}})),C=u("div",{target:"e1rpgzpk1"})(({theme:t})=>({display:"flex",flexDirection:"row",gap:t.spacing.lg,"> span":{marginTop:t.spacing.twoXS}})),B=u("div",{target:"e1rpgzpk3"})(({theme:t})=>({display:"flex",flexDirection:"column",gap:t.spacing.sm,alignItems:"start",justifyContent:"center",overflow:"hidden",minHeight:"100%",fontSize:t.fontSizes.sm,lineHeight:t.lineHeights.base,div:{display:"inline-flex"}}));function E(t){const s=z(t);return{Body:{props:{"data-testid":"stToast",className:"stToast"},style:{display:"flex",flexDirection:"row",gap:t.spacing.md,width:t.sizes.toastWidth,marginTop:t.spacing.sm,borderTopLeftRadius:t.radii.default,borderTopRightRadius:t.radii.default,borderBottomLeftRadius:t.radii.default,borderBottomRightRadius:t.radii.default,paddingTop:t.spacing.lg,paddingBottom:t.spacing.lg,paddingLeft:t.spacing.twoXL,paddingRight:t.spacing.twoXL,backgroundColor:s?t.colors.gray10:t.colors.gray90,color:t.colors.bodyText,boxShadow:s?"0px 4px 16px rgba(0, 0, 0, 0.16)":"0px 4px 16px rgba(0, 0, 0, 0.7)"}},CloseIcon:{style:{color:t.colors.fadedText40,width:t.fontSizes.lg,height:t.fontSizes.lg,marginRight:`calc(-1 * ${t.spacing.lg} / 2)`,":hover":{color:t.colors.bodyText}}}}}function D(t){if(t.length>104){let a=t.replace(/^(.{104}[^\s]*).*/,"$1");return a.length>104&&(a=a.substring(0,104).split(" ").slice(0,-1).join(" ")),a.trim()}return t}function M({body:t,icon:s,width:a}){const r=w(),d=D(t),c=t!==d,[e,b]=o.useState(!c),[f,S]=o.useState(0),y=o.useCallback(()=>{b(!e)},[e]),l=o.useMemo(()=>E(r),[r]),g=o.useMemo(()=>x(C,{expanded:e,children:[s&&i(h,{iconValue:s,size:"xl",testid:"stToastDynamicIcon"}),x(B,{children:[i(v,{source:e?t:d,allowHTML:!1,isToast:!0}),c&&i(R,{"data-testid":"stToastViewButton",onClick:y,children:e?"view less":"view more"})]})]}),[c,e,t,s,d,y]);o.useEffect(()=>{if(r.inSidebar)return;const p=n.info(g,{overrides:{...l}});return S(p),()=>{n.update(p,{overrides:{Body:{style:{transitionDuration:0}}}}),n.clear(p)}},[]),o.useEffect(()=>{n.update(f,{children:g,overrides:{...l}})},[f,g,l]);const T=i(k,{kind:m.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:a});return i(L,{children:r.inSidebar&&T})}const I=o.memo(M);export{I as default};
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import{r as Q,j as ct,F as Vt}from"./index.DeuQX1T6.js";/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */const{entries:At,setPrototypeOf:ft,isFrozen:$t,getPrototypeOf:qt,getOwnPropertyDescriptor:Kt}=Object;let{freeze:S,seal:y,create:ht}=Object,{apply:xe,construct:Pe}=typeof Reflect<"u"&&Reflect;S||(S=function(n){return n});y||(y=function(n){return n});xe||(xe=function(n,s,r){return n.apply(s,r)});Pe||(Pe=function(n,s){return new n(...s)});const ce=R(Array.prototype.forEach),Zt=R(Array.prototype.lastIndexOf),ut=R(Array.prototype.pop),$=R(Array.prototype.push),Jt=R(Array.prototype.splice),ue=R(String.prototype.toLowerCase),Ne=R(String.prototype.toString),mt=R(String.prototype.match),q=R(String.prototype.replace),Qt=R(String.prototype.indexOf),en=R(String.prototype.trim),b=R(Object.prototype.hasOwnProperty),h=R(RegExp.prototype.test),K=tn(TypeError);function R(a){return function(n){for(var s=arguments.length,r=new Array(s>1?s-1:0),u=1;u<s;u++)r[u-1]=arguments[u];return xe(a,n,r)}}function tn(a){return function(){for(var n=arguments.length,s=new Array(n),r=0;r<n;r++)s[r]=arguments[r];return Pe(a,s)}}function l(a,n){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ue;ft&&ft(a,null);let r=n.length;for(;r--;){let u=n[r];if(typeof u=="string"){const O=s(u);O!==u&&($t(n)||(n[r]=O),u=O)}a[u]=!0}return a}function nn(a){for(let n=0;n<a.length;n++)b(a,n)||(a[n]=null);return a}function x(a){const n=ht(null);for(const[s,r]of At(a))b(a,s)&&(Array.isArray(r)?n[s]=nn(r):r&&typeof r=="object"&&r.constructor===Object?n[s]=x(r):n[s]=r);return n}function Z(a,n){for(;a!==null;){const r=Kt(a,n);if(r){if(r.get)return R(r.get);if(typeof r.value=="function")return R(r.value)}a=qt(a)}function s(){return null}return s}const pt=S(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),De=S(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ie=S(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),on=S(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Me=S(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),an=S(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),dt=S(["#text"]),Tt=S(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ce=S(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Et=S(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),fe=S(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),rn=y(/\{\{[\w\W]*|[\w\W]*\}\}/gm),sn=y(/<%[\w\W]*|[\w\W]*%>/gm),ln=y(/\$\{[\w\W]*/gm),cn=y(/^data-[\-\w.\u00B7-\uFFFF]+$/),fn=y(/^aria-[\-\w]+$/),St=y(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),un=y(/^(?:\w+script|data):/i),mn=y(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Rt=y(/^html$/i),pn=y(/^[a-z][.\w]*(-[.\w]+)+$/i);var _t=Object.freeze({__proto__:null,ARIA_ATTR:fn,ATTR_WHITESPACE:mn,CUSTOM_ELEMENT:pn,DATA_ATTR:cn,DOCTYPE_NAME:Rt,ERB_EXPR:sn,IS_ALLOWED_URI:St,IS_SCRIPT_OR_DATA:un,MUSTACHE_EXPR:rn,TMPLIT_EXPR:ln});const J={element:1,text:3,progressingInstruction:7,comment:8,document:9},dn=function(){return typeof window>"u"?null:window},Tn=function(n,s){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let r=null;const u="data-tt-policy-suffix";s&&s.hasAttribute(u)&&(r=s.getAttribute(u));const O="dompurify"+(r?"#"+r:"");try{return n.createPolicy(O,{createHTML(I){return I},createScriptURL(I){return I}})}catch{return console.warn("TrustedTypes policy "+O+" could not be created."),null}},gt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ot(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:dn();const n=i=>Ot(i);if(n.version="3.2.4",n.removed=[],!a||!a.document||a.document.nodeType!==J.document||!a.Element)return n.isSupported=!1,n;let{document:s}=a;const r=s,u=r.currentScript,{DocumentFragment:O,HTMLTemplateElement:I,Node:P,Element:Ue,NodeFilter:G,NamedNodeMap:Lt=a.NamedNodeMap||a.MozNamedAttrMap,HTMLFormElement:yt,DOMParser:bt,trustedTypes:ee}=a,W=Ue.prototype,Nt=Z(W,"cloneNode"),Dt=Z(W,"remove"),It=Z(W,"nextSibling"),Mt=Z(W,"childNodes"),te=Z(W,"parentNode");if(typeof I=="function"){const i=s.createElement("template");i.content&&i.content.ownerDocument&&(s=i.content.ownerDocument)}let _,B="";const{implementation:me,createNodeIterator:Ct,createDocumentFragment:wt,getElementsByTagName:xt}=s,{importNode:Pt}=r;let g=gt();n.isSupported=typeof At=="function"&&typeof te=="function"&&me&&me.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:pe,ERB_EXPR:de,TMPLIT_EXPR:Te,DATA_ATTR:kt,ARIA_ATTR:vt,IS_SCRIPT_OR_DATA:Ut,ATTR_WHITESPACE:Fe,CUSTOM_ELEMENT:Ft}=_t;let{IS_ALLOWED_URI:He}=_t,m=null;const ze=l({},[...pt,...De,...Ie,...Me,...dt]);let d=null;const Ge=l({},[...Tt,...Ce,...Et,...fe]);let f=Object.seal(ht(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Y=null,Ee=null,We=!0,_e=!0,Be=!1,Ye=!0,k=!1,ge=!0,w=!1,Ae=!1,he=!1,v=!1,ne=!1,oe=!1,Xe=!0,je=!1;const Ht="user-content-";let Se=!0,X=!1,U={},F=null;const Ve=l({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let $e=null;const qe=l({},["audio","video","img","source","image","track"]);let Re=null;const Ke=l({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ie="http://www.w3.org/1998/Math/MathML",ae="http://www.w3.org/2000/svg",M="http://www.w3.org/1999/xhtml";let H=M,Oe=!1,Le=null;const zt=l({},[ie,ae,M],Ne);let re=l({},["mi","mo","mn","ms","mtext"]),se=l({},["annotation-xml"]);const Gt=l({},["title","style","font","a","script"]);let j=null;const Wt=["application/xhtml+xml","text/html"],Bt="text/html";let p=null,z=null;const Yt=s.createElement("form"),Ze=function(e){return e instanceof RegExp||e instanceof Function},ye=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(z&&z===e)){if((!e||typeof e!="object")&&(e={}),e=x(e),j=Wt.indexOf(e.PARSER_MEDIA_TYPE)===-1?Bt:e.PARSER_MEDIA_TYPE,p=j==="application/xhtml+xml"?Ne:ue,m=b(e,"ALLOWED_TAGS")?l({},e.ALLOWED_TAGS,p):ze,d=b(e,"ALLOWED_ATTR")?l({},e.ALLOWED_ATTR,p):Ge,Le=b(e,"ALLOWED_NAMESPACES")?l({},e.ALLOWED_NAMESPACES,Ne):zt,Re=b(e,"ADD_URI_SAFE_ATTR")?l(x(Ke),e.ADD_URI_SAFE_ATTR,p):Ke,$e=b(e,"ADD_DATA_URI_TAGS")?l(x(qe),e.ADD_DATA_URI_TAGS,p):qe,F=b(e,"FORBID_CONTENTS")?l({},e.FORBID_CONTENTS,p):Ve,Y=b(e,"FORBID_TAGS")?l({},e.FORBID_TAGS,p):{},Ee=b(e,"FORBID_ATTR")?l({},e.FORBID_ATTR,p):{},U=b(e,"USE_PROFILES")?e.USE_PROFILES:!1,We=e.ALLOW_ARIA_ATTR!==!1,_e=e.ALLOW_DATA_ATTR!==!1,Be=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ye=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,k=e.SAFE_FOR_TEMPLATES||!1,ge=e.SAFE_FOR_XML!==!1,w=e.WHOLE_DOCUMENT||!1,v=e.RETURN_DOM||!1,ne=e.RETURN_DOM_FRAGMENT||!1,oe=e.RETURN_TRUSTED_TYPE||!1,he=e.FORCE_BODY||!1,Xe=e.SANITIZE_DOM!==!1,je=e.SANITIZE_NAMED_PROPS||!1,Se=e.KEEP_CONTENT!==!1,X=e.IN_PLACE||!1,He=e.ALLOWED_URI_REGEXP||St,H=e.NAMESPACE||M,re=e.MATHML_TEXT_INTEGRATION_POINTS||re,se=e.HTML_INTEGRATION_POINTS||se,f=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ze(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(f.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ze(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(f.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(f.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),k&&(_e=!1),ne&&(v=!0),U&&(m=l({},dt),d=[],U.html===!0&&(l(m,pt),l(d,Tt)),U.svg===!0&&(l(m,De),l(d,Ce),l(d,fe)),U.svgFilters===!0&&(l(m,Ie),l(d,Ce),l(d,fe)),U.mathMl===!0&&(l(m,Me),l(d,Et),l(d,fe))),e.ADD_TAGS&&(m===ze&&(m=x(m)),l(m,e.ADD_TAGS,p)),e.ADD_ATTR&&(d===Ge&&(d=x(d)),l(d,e.ADD_ATTR,p)),e.ADD_URI_SAFE_ATTR&&l(Re,e.ADD_URI_SAFE_ATTR,p),e.FORBID_CONTENTS&&(F===Ve&&(F=x(F)),l(F,e.FORBID_CONTENTS,p)),Se&&(m["#text"]=!0),w&&l(m,["html","head","body"]),m.table&&(l(m,["tbody"]),delete Y.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw K('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw K('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');_=e.TRUSTED_TYPES_POLICY,B=_.createHTML("")}else _===void 0&&(_=Tn(ee,u)),_!==null&&typeof B=="string"&&(B=_.createHTML(""));S&&S(e),z=e}},Je=l({},[...De,...Ie,...on]),Qe=l({},[...Me,...an]),Xt=function(e){let t=te(e);(!t||!t.tagName)&&(t={namespaceURI:H,tagName:"template"});const o=ue(e.tagName),c=ue(t.tagName);return Le[e.namespaceURI]?e.namespaceURI===ae?t.namespaceURI===M?o==="svg":t.namespaceURI===ie?o==="svg"&&(c==="annotation-xml"||re[c]):!!Je[o]:e.namespaceURI===ie?t.namespaceURI===M?o==="math":t.namespaceURI===ae?o==="math"&&se[c]:!!Qe[o]:e.namespaceURI===M?t.namespaceURI===ae&&!se[c]||t.namespaceURI===ie&&!re[c]?!1:!Qe[o]&&(Gt[o]||!Je[o]):!!(j==="application/xhtml+xml"&&Le[e.namespaceURI]):!1},N=function(e){$(n.removed,{element:e});try{te(e).removeChild(e)}catch{Dt(e)}},le=function(e,t){try{$(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch{$(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e==="is")if(v||ne)try{N(t)}catch{}else try{t.setAttribute(e,"")}catch{}},et=function(e){let t=null,o=null;if(he)e="<remove></remove>"+e;else{const T=mt(e,/^[\r\n\t ]+/);o=T&&T[0]}j==="application/xhtml+xml"&&H===M&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const c=_?_.createHTML(e):e;if(H===M)try{t=new bt().parseFromString(c,j)}catch{}if(!t||!t.documentElement){t=me.createDocument(H,"template",null);try{t.documentElement.innerHTML=Oe?B:c}catch{}}const E=t.body||t.documentElement;return e&&o&&E.insertBefore(s.createTextNode(o),E.childNodes[0]||null),H===M?xt.call(t,w?"html":"body")[0]:w?t.documentElement:E},tt=function(e){return Ct.call(e.ownerDocument||e,e,G.SHOW_ELEMENT|G.SHOW_COMMENT|G.SHOW_TEXT|G.SHOW_PROCESSING_INSTRUCTION|G.SHOW_CDATA_SECTION,null)},be=function(e){return e instanceof yt&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof Lt)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},nt=function(e){return typeof P=="function"&&e instanceof P};function C(i,e,t){ce(i,o=>{o.call(n,e,t,z)})}const ot=function(e){let t=null;if(C(g.beforeSanitizeElements,e,null),be(e))return N(e),!0;const o=p(e.nodeName);if(C(g.uponSanitizeElement,e,{tagName:o,allowedTags:m}),e.hasChildNodes()&&!nt(e.firstElementChild)&&h(/<[/\w]/g,e.innerHTML)&&h(/<[/\w]/g,e.textContent)||e.nodeType===J.progressingInstruction||ge&&e.nodeType===J.comment&&h(/<[/\w]/g,e.data))return N(e),!0;if(!m[o]||Y[o]){if(!Y[o]&&at(o)&&(f.tagNameCheck instanceof RegExp&&h(f.tagNameCheck,o)||f.tagNameCheck instanceof Function&&f.tagNameCheck(o)))return!1;if(Se&&!F[o]){const c=te(e)||e.parentNode,E=Mt(e)||e.childNodes;if(E&&c){const T=E.length;for(let L=T-1;L>=0;--L){const D=Nt(E[L],!0);D.__removalCount=(e.__removalCount||0)+1,c.insertBefore(D,It(e))}}}return N(e),!0}return e instanceof Ue&&!Xt(e)||(o==="noscript"||o==="noembed"||o==="noframes")&&h(/<\/no(script|embed|frames)/i,e.innerHTML)?(N(e),!0):(k&&e.nodeType===J.text&&(t=e.textContent,ce([pe,de,Te],c=>{t=q(t,c," ")}),e.textContent!==t&&($(n.removed,{element:e.cloneNode()}),e.textContent=t)),C(g.afterSanitizeElements,e,null),!1)},it=function(e,t,o){if(Xe&&(t==="id"||t==="name")&&(o in s||o in Yt))return!1;if(!(_e&&!Ee[t]&&h(kt,t))){if(!(We&&h(vt,t))){if(!d[t]||Ee[t]){if(!(at(e)&&(f.tagNameCheck instanceof RegExp&&h(f.tagNameCheck,e)||f.tagNameCheck instanceof Function&&f.tagNameCheck(e))&&(f.attributeNameCheck instanceof RegExp&&h(f.attributeNameCheck,t)||f.attributeNameCheck instanceof Function&&f.attributeNameCheck(t))||t==="is"&&f.allowCustomizedBuiltInElements&&(f.tagNameCheck instanceof RegExp&&h(f.tagNameCheck,o)||f.tagNameCheck instanceof Function&&f.tagNameCheck(o))))return!1}else if(!Re[t]){if(!h(He,q(o,Fe,""))){if(!((t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&Qt(o,"data:")===0&&$e[e])){if(!(Be&&!h(Ut,q(o,Fe,"")))){if(o)return!1}}}}}}return!0},at=function(e){return e!=="annotation-xml"&&mt(e,Ft)},rt=function(e){C(g.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||be(e))return;const o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:d,forceKeepAttr:void 0};let c=t.length;for(;c--;){const E=t[c],{name:T,namespaceURI:L,value:D}=E,V=p(T);let A=T==="value"?D:en(D);if(o.attrName=V,o.attrValue=A,o.keepAttr=!0,o.forceKeepAttr=void 0,C(g.uponSanitizeAttribute,e,o),A=o.attrValue,je&&(V==="id"||V==="name")&&(le(T,e),A=Ht+A),ge&&h(/((--!?|])>)|<\/(style|title)/i,A)){le(T,e);continue}if(o.forceKeepAttr||(le(T,e),!o.keepAttr))continue;if(!Ye&&h(/\/>/i,A)){le(T,e);continue}k&&ce([pe,de,Te],lt=>{A=q(A,lt," ")});const st=p(e.nodeName);if(it(st,V,A)){if(_&&typeof ee=="object"&&typeof ee.getAttributeType=="function"&&!L)switch(ee.getAttributeType(st,V)){case"TrustedHTML":{A=_.createHTML(A);break}case"TrustedScriptURL":{A=_.createScriptURL(A);break}}try{L?e.setAttributeNS(L,T,A):e.setAttribute(T,A),be(e)?N(e):ut(n.removed)}catch{}}}C(g.afterSanitizeAttributes,e,null)},jt=function i(e){let t=null;const o=tt(e);for(C(g.beforeSanitizeShadowDOM,e,null);t=o.nextNode();)C(g.uponSanitizeShadowNode,t,null),ot(t),rt(t),t.content instanceof O&&i(t.content);C(g.afterSanitizeShadowDOM,e,null)};return n.sanitize=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,o=null,c=null,E=null;if(Oe=!i,Oe&&(i="<!-->"),typeof i!="string"&&!nt(i))if(typeof i.toString=="function"){if(i=i.toString(),typeof i!="string")throw K("dirty is not a string, aborting")}else throw K("toString is not a function");if(!n.isSupported)return i;if(Ae||ye(e),n.removed=[],typeof i=="string"&&(X=!1),X){if(i.nodeName){const D=p(i.nodeName);if(!m[D]||Y[D])throw K("root node is forbidden and cannot be sanitized in-place")}}else if(i instanceof P)t=et("<!---->"),o=t.ownerDocument.importNode(i,!0),o.nodeType===J.element&&o.nodeName==="BODY"||o.nodeName==="HTML"?t=o:t.appendChild(o);else{if(!v&&!k&&!w&&i.indexOf("<")===-1)return _&&oe?_.createHTML(i):i;if(t=et(i),!t)return v?null:oe?B:""}t&&he&&N(t.firstChild);const T=tt(X?i:t);for(;c=T.nextNode();)ot(c),rt(c),c.content instanceof O&&jt(c.content);if(X)return i;if(v){if(ne)for(E=wt.call(t.ownerDocument);t.firstChild;)E.appendChild(t.firstChild);else E=t;return(d.shadowroot||d.shadowrootmode)&&(E=Pt.call(r,E,!0)),E}let L=w?t.outerHTML:t.innerHTML;return w&&m["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&h(Rt,t.ownerDocument.doctype.name)&&(L="<!DOCTYPE "+t.ownerDocument.doctype.name+`>
|
2
|
-
`+L),k&&ce([pe,de,Te],D=>{L=q(L,D," ")}),_&&oe?_.createHTML(L):L},n.setConfig=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ye(i),Ae=!0},n.clearConfig=function(){z=null,Ae=!1},n.isValidAttribute=function(i,e,t){z||ye({});const o=p(i),c=p(e);return it(o,c,t)},n.addHook=function(i,e){typeof e=="function"&&$(g[i],e)},n.removeHook=function(i,e){if(e!==void 0){const t=Zt(g[i],e);return t===-1?void 0:Jt(g[i],t,1)[0]}return ut(g[i])},n.removeHooks=function(i){g[i]=[]},n.removeAllHooks=function(){g=gt()},n}var ve=Ot();const ke="data-temp-href-target";ve.addHook("beforeSanitizeAttributes",function(a){a instanceof HTMLElement&&a.hasAttribute("target")&&a.getAttribute("target")==="_blank"&&a.setAttribute(ke,"_blank")});ve.addHook("afterSanitizeAttributes",function(a){a instanceof HTMLElement&&a.hasAttribute(ke)&&(a.setAttribute("target","_blank"),a.setAttribute("rel","noopener noreferrer"),a.removeAttribute(ke))});const we=a=>{const n={USE_PROFILES:{html:!0},FORCE_BODY:!0};return ve.sanitize(a,n)};function En({element:a,width:n}){const{body:s}=a,[r,u]=Q.useState(we(s)),O=Q.useRef(null);return Q.useEffect(()=>{we(s)!==r&&u(we(s))},[s]),Q.useEffect(()=>{var I,P;((I=O.current)==null?void 0:I.clientHeight)===0&&((P=O.current.parentElement)==null?void 0:P.childElementCount)===1&&O.current.parentElement.classList.add("stHtml-empty")}),ct(Vt,{children:r&&ct("div",{className:"stHtml","data-testid":"stHtml",ref:O,style:{width:n},dangerouslySetInnerHTML:{__html:r}})})}const gn=Q.memo(En);export{gn as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{n as b,r as i,bd as U,j as l}from"./index.DeuQX1T6.js";const P=b("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 A({element:a,width:f,endpoints:m,elementMgr:c}){const n=i.useRef(null),{type:E,url:p,startTime:o,subtitles:y,endTime:d,loop:u,autoplay:T,muted:h}=a,S=i.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]);i.useEffect(()=>{n.current&&(n.current.currentTime=o)},[o]),i.useEffect(()=>{const e=n.current,t=()=>{e&&(e.currentTime=a.startTime)};return e&&e.addEventListener("loadedmetadata",t),()=>{e&&e.removeEventListener("loadedmetadata",t)}},[a]),i.useEffect(()=>{const e=n.current;if(!e)return;let t=!1;const s=()=>{d>0&&e.currentTime>=d&&(u?(e.currentTime=o||0,e.play()):t||(t=!0,e.pause()))};return d>0&&e.addEventListener("timeupdate",s),()=>{e&&d>0&&e.removeEventListener("timeupdate",s)}},[d,u,o]),i.useEffect(()=>{const e=n.current;if(!e)return;const t=()=>{u&&(e.currentTime=o||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}},[u,o]);const g=e=>{const{startTime:t,endTime:s,loop:L,autoplay:N,muted:V}=a,r=new URL(e);if(t&&!isNaN(t)&&r.searchParams.append("start",t.toString()),s&&!isNaN(s)&&r.searchParams.append("end",s.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"),V&&r.searchParams.append("mute","1"),r.toString()};return E===U.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:n,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))})}const I=i.memo(A);export{I as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{n as s,r as b,R as u,az as k,b5 as C,y as L,j as n,b3 as v,b6 as y,C as T,G as w,ay as S}from"./index.DeuQX1T6.js";const h=s("div",{target:"e1xmaixs0"})({display:"flex",flexDirection:"column"}),P=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}}:{}})),m=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 B(a,o){return a===null&&o?!0:a===null&&!o?!1:a===!0}function D(a){const{onPageChange:o,currentPageScriptHash:l}=u.useContext(k),e=u.useContext(C),{colors:i}=L(),{disabled:t,element:r,width:c}=a,p={width:c},f=B(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:y.TOP_RIGHT,children:n(h,{children:T(P,{"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(w,{size:"lg",color:t?i.fadedText40:i.bodyText,iconValue:r.icon}),n(m,{disabled:t,children:n(S,{source:r.label,allowHTML:!1,isLabel:!0,boldLabel:d,largerLabel:!0,disableLinks:!0})})]})})})})}const M=b.memo(D);export{M as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{n as c,b0 as v,at as y,b1 as l,b2 as t,j as s,r as C,b3 as k,b4 as B}from"./index.DeuQX1T6.js";function S(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"},...S(i,r)}}),x=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"}})),$=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"}})),L=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 w({kind:o,size:i,disabled:r,fluidWidth:a,children:d,autoFocus:n,href:e,rel:u,target:b,onClick:f}){let p=x;return o===t.SECONDARY?p=$:o===t.TERTIARY&&(p=L),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(k,{help:r.help,children:s(w,{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(B,{icon:r.icon,label:r.label})})})})}const z=C.memo(T);export{z as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{n as W,r,y as T,bX as C,bY as V,C as L,j as l,bm as O,bz as P,bn as k,b6 as E,bo as N,bW as $,bZ as B,bS as A,b_ as F,bx as H}from"./index.DeuQX1T6.js";import{a as D}from"./useBasicWidgetState.e9cw5rKa.js";import"./FormClearHelper.Dha_cfuU.js";const U=W("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,Y=(s,t,a,u)=>{t.setIntArrayValue(s,a.value,{fromUi:a.fromUi},u)},X=s=>{var S;const{element:t,widgetMgr:a,width:u,fragmentId:y}=s,e=T(),[n,g]=D({getStateFromWidgetMgr:j,getDefaultStateFromProto:G,getCurrStateFromProto:K,updateWidgetMgrState:Y,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(k,{content:t.help,placement:E.TOP_RIGHT})})}),l(U,{children:l($,{options:R,labelKey:"label",valueKey:"value","aria-label":t.label,placeholder:I,type:F.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:A,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:H.isMobile&&M===!1?"readonly":null}},Dropdown:{component:B}}})})]})},J=r.memo(X);export{J as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as s,K as S,j as d,bm as x,c0 as V}from"./index.DeuQX1T6.js";import{a as v}from"./useBasicWidgetState.e9cw5rKa.js";import"./FormClearHelper.Dha_cfuU.js";const U=(t,e)=>t.getIntValue(e),h=t=>t.default??null,C=t=>t.value??null,F=(t,e,o,a)=>{e.setIntValue(t,o.value,{fromUi:o.fromUi},a)},I=({disabled:t,element:e,widgetMgr:o,width:a,fragmentId:u})=>{const{options:n,help:c,label:i,labelVisibility:r,placeholder:m}=e,[g,l]=v({getStateFromWidgetMgr:U,getDefaultStateFromProto:h,getCurrStateFromProto:C,updateWidgetMgrState:F,element:e,widgetMgr:o,fragmentId:u}),f=s.useCallback(b=>{l({value:b,fromUi:!0})},[l]),p=S(e.default)&&!t;return d(V,{label:i,labelVisibility:x(r==null?void 0:r.value),options:n,disabled:t,width:a,onChange:f,value:g,help:c,placeholder:m,clearable:p})},E=s.memo(I);export{E as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as s,E as k,_ as M,n as g,D as ht,y as q,j as a,b6 as J,bp as ft,C as w,bk as Q,b2 as Z,bj as E,aY as mt,bA as yt,bB as S,bn as vt,be as Ct,bC as wt,K as B,F as X,bg as It,bf as bt}from"./index.DeuQX1T6.js";import{g as xt,F as St,C as Ft,I as Et,E as zt,u as Ut,a as Tt}from"./FileDropzone.DRcTUuNN.js";import{I as Ht}from"./InputInstructions.C_m6JNSV.js";import{i as Dt}from"./inputUtils.CQWz5UKz.js";import{a as G}from"./index.DW_MHI2K.js";import{U as V}from"./UploadFileInfo.C-jY39rj.js";import{T as Bt}from"./textarea.YeGMY3Ts.js";import"./base-input.B_U9Mij-.js";var tt=s.forwardRef(function(t,e){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(k,M({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),s.createElement("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5a2.5 2.5 0 015 0v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5a2.5 2.5 0 005 0V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"}))});tt.displayName="AttachFile";var et=s.forwardRef(function(t,e){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(k,M({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.createElement("path",{d:"M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))});et.displayName="ErrorOutline";var ot=s.forwardRef(function(t,e){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(k,M({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),s.createElement("rect",{width:24,height:24,fill:"none"}),s.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))});ot.displayName="Send";const Lt=g("div",{target:"e1w2ot2t0"})(({theme:t,width:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.widgetBorderColor??t.colors.transparent,borderRadius:t.radii.chatInput,display:"flex",backgroundColor:t.colors.secondaryBg,width:`${e}px`,overflow:"hidden",":focus-within":{borderColor:t.colors.primary},"&.dropzone":{borderColor:t.colors.primary,borderRadius:t.radii.full,height:t.sizes.emptyDropdownHeight}})),Rt=g("div",{target:"e1w2ot2t1"})(({theme:t})=>({position:"relative",flexGrow:1,display:"flex",alignItems:"center",paddingLeft:t.spacing.lg,gap:t.spacing.sm})),Vt=g("button",{target:"e1w2ot2t2"})(({theme:t,disabled:e,extended:l})=>{const f=ht(t),[y,p]=f?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:l?"0":t.radii.chatInput,borderTopLeftRadius:l?t.radii.default:"0",borderBottomRightRadius:t.radii.chatInput,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:t.lineHeights.none,margin:t.spacing.none,padding:t.spacing.sm,color:e?y:p,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:f?t.colors.gray10:t.colors.gray90},"&:hover":{color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray}}}),kt=g("div",{target:"e1w2ot2t3"})({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:0,pointerEvents:"none"}),Mt=g("div",{target:"e1w2ot2t4"})(({theme:t})=>({position:"absolute",bottom:"0px",right:`calc(${t.iconSizes.xl} + 2 * ${t.spacing.sm} + ${t.spacing.sm})`})),Nt=g("div",{target:"e12v7o8j0"})(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"center",margin:"auto",height:"100%",width:"100%",color:t.colors.primary,fontWeight:t.fontWeights.bold})),At=g("div",{target:"e12v7o8j1"})(({})=>({display:"flex",alignItems:"top",height:"100%"})),$t=g("div",{target:"e12v7o8j2"})(({theme:t})=>({marginTop:"0.625em",marginLeft:t.spacing.sm,height:t.spacing.xl,width:t.sizes.borderWidth,backgroundColor:t.colors.fadedText20})),Wt=g("div",{target:"e12v7o8j3"})(({theme:t})=>({left:0,right:0,border:`${t.sizes.borderWidth} solid ${t.colors.transparent}`,minHeight:t.sizes.minChatInputFileListHeight,lineHeight:t.lineHeights.tight,paddingLeft:t.spacing.sm,paddingRight:t.spacing.sm,overflowX:"auto"})),jt=g("div",{target:"e12v7o8j4"})(({})=>({display:"flex"})),Pt=g("div",{target:"e12v7o8j5"})(({})=>({flex:"0 0 auto"})),Kt=g("div",{target:"e12v7o8j6"})(({theme:t})=>({display:"flex",alignItems:"center",padding:t.spacing.sm,gap:t.spacing.twoXS})),Ot=g("div",{target:"e12v7o8j7"})(({theme:t})=>({color:t.colors.fadedText60})),_t=g("div",{target:"e12v7o8j8"})(({theme:t,fileStatus:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:e.type==="uploaded"?t.colors.bodyText:t.colors.fadedText60})),Xt=g("div",{target:"e12v7o8j9"})(({theme:t})=>({marginRight:t.spacing.md,color:t.colors.fadedText60})),Gt=g("small",{target:"e12v7o8j10"})(({theme:t})=>({display:"flex",alignItems:"center",maxHeight:t.sizes.smallElementHeight,color:t.colors.fadedText60,"& :hover":{color:t.colors.bodyText}}));function Yt({children:t,content:e}){const l=q();return a(ft,{content:e,placement:J.TOP,overrides:{Body:{style:{top:`-${l.sizes.minElementHeight}`}}},children:t})}const qt=({fileInfo:t})=>{const{type:e}=t.status;switch(e){case"uploading":return a(yt,{usingCustomTheme:!1,"data-testid":"stChatInputFileIconSpinner",size:"lg",margin:"0",padding:"0"});case"error":return a(Yt,{content:t.status.errorMessage,children:a(E,{content:et,size:"lg"})});case"uploaded":return a(E,{content:Et,size:"lg"});default:return mt(e),null}},Jt=({fileInfo:t,onDelete:e})=>w(Kt,{className:"stChatInputFile","data-testid":"stChatInputFile",children:[a(Ot,{children:a(qt,{fileInfo:t})}),a(_t,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:t.name,fileStatus:t.status,children:t.name}),a(Xt,{children:xt(t.size,St.Byte)}),a(Gt,{"data-testid":"stChatInputDeleteBtn",children:a(Q,{onClick:()=>e(t.id),kind:Z.MINIMAL,children:a(E,{content:Ft,size:"lg"})})})]}),Qt=({items:t,onDelete:e})=>a(Wt,{"data-testid":"stChatUploadedFiles",children:a(jt,{children:t.map(l=>a(Pt,{children:a(Jt,{fileInfo:l,onDelete:e})},l.id))})}),Zt=({getRootProps:t,getInputProps:e,acceptFile:l,showDropzone:f,disabled:y,theme:p})=>f?w(Nt,{...t(),children:[a("input",{...e()}),"Drag and drop files here"]}):w(At,{children:[w("div",{"data-testid":"stChatInputFileUploadButton",...t(),children:[a("input",{...e()}),a(vt,{content:`Upload or drag and drop ${l===S.Multiple?"files":"a file"}`,placement:J.TOP,children:a(Q,{kind:Z.MINIMAL,disabled:y,children:a(E,{content:tt,size:"lg",color:p.colors.fadedText60})})})]}),a($t,{})]}),te=({getNextLocalFileId:t,addFiles:e,updateFile:l,uploadClient:f,element:y,onUploadProgress:p,onUploadComplete:m})=>(v,h)=>{const u=G.CancelToken.source(),d=new V(h.name,h.size,t(),{type:"uploading",cancelToken:u,progress:1});e([d]),f.uploadFile({formId:"",...y},v.uploadUrl,h,c=>p(c,d.id),u.token).then(()=>m(d.id,v)).catch(c=>{G.isCancel(c)||l(d.id,d.setStatus({type:"error",errorMessage:c?c.toString():"Unknown error"}))})},ee=({acceptMultipleFiles:t,uploadClient:e,uploadFile:l,addFiles:f,getNextLocalFileId:y,deleteExistingFiles:p,onUploadComplete:m})=>(v,h)=>{if(!t&&v.length===0&&h.length>1){const u=h.findIndex(d=>{var c;return((c=d.errors)==null?void 0:c[0].code)===zt.TooManyFiles});u>=0&&(v.push(h[u].file),h.splice(u,1))}if(!t&&v.length>0&&p(),e.fetchFileURLs(v).then(u=>{Ct(u,v).forEach(([d,c])=>{l(d,c)})}).catch(u=>{f(v.map(d=>new V(d.name,d.size,y(),{type:"error",errorMessage:u})))}),h.length>0){const u=h.map(d=>new V(d.file.name,d.file.size,y(),{type:"error",errorMessage:d.errors.map(c=>c.message).filter(c=>!!c).join(", ")}));f(u)}m()},oe=6.5,Y=1,L=(t,e,l)=>l.map(f=>f.id===t?e:f),R=(t,e)=>e.find(l=>l.id===t);function ne({width:t,element:e,widgetMgr:l,fragmentId:f,uploadClient:y}){const p=q(),m=s.useRef(null),v=s.useRef(0),h=s.useRef({minHeight:0,maxHeight:0}),[u,d]=s.useState(!1),[c,U]=s.useState(e.default),[z,N]=s.useState(0),[A,nt]=s.useState(!1),[I,b]=s.useState([]),[F,T]=s.useState(!1),x=wt(e.acceptFile),$=s.useCallback(o=>b(n=>[...n,...o]),[]),W=s.useCallback(o=>{b(n=>{const i=R(o,n);return B(i)?n:(i.status.type==="uploading"&&i.status.cancelToken.cancel(),i.status.type==="uploaded"&&i.status.fileUrls.deleteUrl&&y.deleteFile(i.status.fileUrls.deleteUrl),n.filter(r=>r.id!==o))})},[y]),at=()=>{const o=I.filter(n=>n.status.type==="uploaded").map(n=>{const{name:i,size:r,status:C}=n,{fileId:ut,fileUrls:gt}=C;return new It({fileId:ut,fileUrls:gt,name:i,size:r})});return new bt({uploadedFileInfo:o})},j=()=>v.current++,rt=ee({acceptMultipleFiles:x===S.Multiple,uploadClient:y,uploadFile:te({getNextLocalFileId:j,addFiles:$,updateFile:(o,n)=>{b(i=>L(o,n,i))},uploadClient:y,element:e,onUploadProgress:(o,n)=>{b(i=>{const r=R(n,i);if(B(r)||r.status.type!=="uploading")return i;const C=Math.round(o.loaded*100/o.total);return r.status.progress===C?i:L(n,r.setStatus({type:"uploading",cancelToken:r.status.cancelToken,progress:C}),i)})},onUploadComplete:(o,n)=>{b(i=>{const r=R(o,i);return B(r)||r.status.type!=="uploading"?i:L(r.id,r.setStatus({type:"uploaded",fileId:n.fileId,fileUrls:n}),i)})}}),addFiles:$,getNextLocalFileId:j,deleteExistingFiles:()=>I.forEach(o=>W(o.id)),onUploadComplete:()=>{m.current&&m.current.focus()}}),{getRootProps:it,getInputProps:st}=Ut({onDrop:rt,multiple:x===S.Multiple,accept:Tt(e.fileType)}),lt=()=>{let o=0;const{current:n}=m;if(n){const i=n.placeholder;n.placeholder="",n.style.height="auto",o=n.scrollHeight,n.placeholder=i,n.style.height=""}return o},P=()=>{if(m.current&&m.current.focus(),!u||e.disabled)return;const o={data:c,fileUploaderState:at()};l.setChatInputValue(e,o,{fromUi:!0},f),d(!1),b([]),U(""),N(0)},dt=o=>{const{metaKey:n,ctrlKey:i,shiftKey:r}=o;Dt(o)&&!r&&!i&&!n&&(o.preventDefault(),P())},ct=o=>{const{value:n}=o.target,{maxChars:i}=e;i!==0&&n.length>i||(U(n),N(lt()))};s.useEffect(()=>I.some(o=>o.status.type==="uploading")?d(!1):d(c!==""||I.length>0),[I,c]),s.useEffect(()=>{if(e.setValue){e.setValue=!1;const o=e.value||"";U(o)}},[e]),s.useEffect(()=>{if(m.current){const{offsetHeight:o}=m.current;h.current.minHeight=o,h.current.maxHeight=o*oe}},[m]),s.useEffect(()=>{const o=r=>{var C;r.preventDefault(),r.stopPropagation(),!F&&((C=r.dataTransfer)!=null&&C.types.includes("Files"))&&T(!0)},n=r=>{r.preventDefault(),r.stopPropagation(),F&&(r.clientX<=0&&r.clientY<=0||r.clientX>=window.innerWidth&&r.clientY>=window.innerHeight)&&T(!1)},i=r=>{r.preventDefault(),r.stopPropagation(),F&&T(!1)};return window.addEventListener("dragover",o),window.addEventListener("drop",i),window.addEventListener("dragleave",n),()=>{window.removeEventListener("dragover",o),window.removeEventListener("drop",i),window.removeEventListener("dragleave",n)}},[F]),s.useEffect(()=>{const{minHeight:o}=h.current;nt(z>0&&m.current?Math.abs(z-o)>Y:!1)},[z]);const{disabled:H,placeholder:K,maxChars:pt}=e,{maxHeight:O}=h.current,D=x!==S.None&&F,_="stChatInput";return w(X,{children:[x===S.None?null:a(Qt,{items:[...I],onDelete:W}),a(Lt,{className:D?`${_} dropzone`:_,"data-testid":"stChatInput",width:t,children:w(Rt,{children:[x===S.None?null:a(Zt,{getRootProps:it,getInputProps:st,acceptFile:x,showDropzone:D,disabled:H,theme:p}),D?null:w(X,{children:[a(Bt,{inputRef:m,value:c,placeholder:K,onChange:ct,onKeyDown:dt,"aria-label":K,disabled:H,rows:1,overrides:{Root:{style:{minHeight:p.sizes.minElementHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0"}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:p.lineHeights.inputWidget,"::placeholder":{opacity:"0.7"},height:A?`${z+Y}px`:"auto",maxHeight:O?`${O}px`:"none",paddingLeft:p.spacing.none,paddingBottom:p.spacing.sm,paddingTop:p.spacing.sm,paddingRight:`calc(${p.iconSizes.xl} + 2 * ${p.spacing.sm} + ${p.spacing.sm})`}}}}),t>p.breakpoints.hideWidgetDetails&&a(Mt,{children:a(Ht,{dirty:u,value:c,maxLength:pt,type:"chat",inForm:!1})}),a(kt,{children:a(Vt,{onClick:P,disabled:!u||H,extended:A,"data-testid":"stChatInputSubmitButton",children:a(E,{content:ot,size:"xl",color:"inherit"})})})]})]})})]})}const ue=s.memo(ne);export{ue as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{n as m,r as n,az as x,bc as p,y,j as i,aV as C}from"./index.DeuQX1T6.js";const h=m("div",{target:"e16xbog60"})(({theme:e,isExpanded:t})=>({...t?{position:"fixed",top:0,left:0,bottom:0,right:0,background:e.colors.bgColor,zIndex:e.zIndices.fullscreenWrapper,padding:e.spacing.md,paddingTop:e.sizes.fullScreenHeaderHeight,overflow:["auto","overlay"],display:"flex",alignItems:"center",justifyContent:"center"}:{}})),f=n.createContext(null);f.displayName="ElementFullscreenContext";const w=e=>{const t=n.useContext(e);if(t==null)throw new Error(`useRequiredContext: ${e.displayName??"context"} not found`);return t},b=()=>{const{setFullScreen:e}=n.useContext(x),[t,s]=n.useState(!1),{fullHeight:d,fullWidth:o}=w(p),l=n.useCallback(u=>{s(u),e(u)},[e]),c=n.useCallback(()=>{document.body.style.overflow="hidden",l(!0)},[l]),r=n.useCallback(()=>{document.body.style.overflow="unset",l(!1)},[l]),a=n.useCallback(u=>{u.keyCode===27&&t&&r()},[r,t]);return n.useEffect(()=>(document.addEventListener("keydown",a,!1),()=>{document.removeEventListener("keydown",a,!1)}),[a]),n.useMemo(()=>({expanded:t,zoomIn:c,zoomOut:r,fullHeight:d,fullWidth:o}),[t,c,r,d,o])},g=({children:e,height:t,width:s})=>{const d=y(),{expanded:o,fullHeight:l,fullWidth:c,zoomIn:r,zoomOut:a}=b(),u=n.useMemo(()=>({width:o?c:s,height:o?l:t,expanded:o,expand:r,collapse:a}),[o,l,c,t,s,r,a]);return i(f.Provider,{value:u,children:i(h,{isExpanded:o,"data-testid":"stFullScreenFrame",theme:d,children:e})})};function S(e){const t=s=>i(g,{width:s.width,children:i(e,{...s})});return t.displayName=`withFullScreenWrapper(${e.displayName||e.name})`,C(t,e)}export{f as E,w as u,S as w};
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|