@stlite/desktop 0.76.1 → 0.76.2
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.
- package/bin/dump_artifacts.js +16 -16
- package/build/assets/{FileDownload.esm--KUF2yhQ.js → FileDownload.esm-BP72wB_u.js} +1 -1
- package/build/assets/{FormClearHelper-D3yotkXf.js → FormClearHelper-BIZNCxvb.js} +1 -1
- package/build/assets/{Hooks-rnMPF1_I.js → Hooks-C30HoPXz.js} +1 -1
- package/build/assets/{InputInstructions-D1xaOoA_.js → InputInstructions-B9wXy3U4.js} +1 -1
- package/build/assets/{ProgressBar-TrtX1yYk.js → ProgressBar-BlPlcnwu.js} +1 -1
- package/build/assets/{RenderInPortalIfExists-F44RH20T.js → RenderInPortalIfExists-DSHuT3NO.js} +1 -1
- package/build/assets/{Toolbar-CfaA32cH.js → Toolbar-B1zMj-jg.js} +1 -1
- package/build/assets/{base-input-Bvc5b-2K.js → base-input-CMN1_Ew_.js} +1 -1
- package/build/assets/{createSuper-CxJ5Qet3.js → createSuper-D4gvBB5j.js} +1 -1
- package/build/assets/{data-grid-overlay-editor-Bhwq6yq9.js → data-grid-overlay-editor-CgsMGcDx.js} +1 -1
- package/build/assets/{downloader-Lbha8Mka.js → downloader-Dv4W7rem.js} +1 -1
- package/build/assets/{es6-CJjM6kbP.js → es6-R_bosjbV.js} +2 -2
- package/build/assets/{getPrototypeOf-Do3gT2Di.js → getPrototypeOf-CHt6AZp_.js} +1 -1
- package/build/assets/{iframeResizer.contentWindow-DknzVf8U.js → iframeResizer.contentWindow-9-Xlr32c.js} +1 -1
- package/build/assets/{index-pzpBn5Mj.js → index-8qq2hPcx.js} +1 -1
- package/build/assets/{index-j0a753Nr.js → index-B0CwOTPz.js} +1 -1
- package/build/assets/{index-Dtz56C3X.js → index-B1L1envm.js} +1 -1
- package/build/assets/{index-3jxc0CXG.js → index-B3bELqRU.js} +1 -1
- package/build/assets/{index-VISX5Zc0.js → index-B3quCHCi.js} +1 -1
- package/build/assets/{index-hQJE4Hk3.js → index-BB6FwCEX.js} +1 -1
- package/build/assets/{index-KMQVOp6a.js → index-BDNxxQ4v.js} +1 -1
- package/build/assets/{index-CKt_OoH9.js → index-BEeaeEPl.js} +1 -1
- package/build/assets/{index-BZtVxUC0.js → index-BKKZmTqZ.js} +1 -1
- package/build/assets/{index-VlvN4Fc-.js → index-BL2qQWaL.js} +1 -1
- package/build/assets/{index-DQW8WX8T.js → index-BLvsCvkf.js} +1 -1
- package/build/assets/{index-BHhK2I00.js → index-BZMvJ6Yf.js} +1 -1
- package/build/assets/{index-ohl-VCS7.js → index-Be0wHUx-.js} +1 -1
- package/build/assets/{index-DP9d5w-p.js → index-BkBgJKWs.js} +1 -1
- package/build/assets/{index-BJ35Ra3B.js → index-Bu07mO_x.js} +1 -1
- package/build/assets/{index-Bf-WIrdq.js → index-C9-3Tvo1.js} +1 -1
- package/build/assets/{index-C7BdVmrL.js → index-CMQsen11.js} +1 -1
- package/build/assets/{index-0dVGR9fp.js → index-CRKAbc7H.js} +1 -1
- package/build/assets/{index-DEVPgMwx.js → index-Cjn3IAUe.js} +1 -1
- package/build/assets/{index-CKkCIAau.js → index-CoumX680.js} +1 -1
- package/build/assets/{index-CQKm6Iu1.js → index-CxiUGvN5.js} +1 -1
- package/build/assets/{index-CXJQYh7L.js → index-D2caMYlF.js} +1 -1
- package/build/assets/{index-CMbTUrxn.js → index-D7beHGbk.js} +5 -5
- package/build/assets/{index-BewMEcPF.js → index-DBeV5cvz.js} +1 -1
- package/build/assets/{index-B_-cqmHC.js → index-DP9siobZ.js} +1 -1
- package/build/assets/{index-TNhAYJaK.js → index-D_ZpMtCx.js} +1 -1
- package/build/assets/{index-DBwYfcOH.js → index-DfPuZgVe.js} +1 -1
- package/build/assets/{index-B9g0kqq9.js → index-DgKoCzGM.js} +1 -1
- package/build/assets/{index-D_z1Z4Yp.js → index-DjNlghsG.js} +1 -1
- package/build/assets/{index-Dv0Prv3W.js → index-DmCDp6tz.js} +1 -1
- package/build/assets/{index-DUrta3it.js → index-DqEaj7EU.js} +1 -1
- package/build/assets/{index-EOIuoj4I.js → index-DuoBWGu3.js} +4 -4
- package/build/assets/{index-bFKuAFZe.js → index-DxHnoro7.js} +1 -1
- package/build/assets/{index-Dr_f2tyR.js → index-UQryvozB.js} +1 -1
- package/build/assets/{index-Dzngiwb-.js → index-W-TZSd1E.js} +1 -1
- package/build/assets/{index-BABCx9XF.js → index-bnfkOWdV.js} +1 -1
- package/build/assets/{index-DGh7Hb6h.js → index-dkm5JtmN.js} +1 -1
- package/build/assets/{input-5A8NzOK5.js → input-OLwqq6dJ.js} +1 -1
- package/build/assets/{memory-B_asHZdO.js → memory-K1u1sl9P.js} +1 -1
- package/build/assets/{number-overlay-editor-DH7XBeu0.js → number-overlay-editor-BPRtr2ZH.js} +1 -1
- package/build/assets/{sandbox-D_C1UB9w.js → sandbox-CuSVz6A0.js} +1 -1
- package/build/assets/{slicedToArray-DPmPM4Il.js → slicedToArray-CFP8r_hv.js} +1 -1
- package/build/assets/{textarea-D5BngIZU.js → textarea-BgOZDoS8.js} +1 -1
- package/build/assets/{timepicker-DDIjFLFG.js → timepicker-BD9p-9JQ.js} +1 -1
- package/build/assets/{uniqueId-CI1tp1qG.js → uniqueId-D81S8Chc.js} +1 -1
- package/build/assets/{useBasicWidgetState-C9ZYeVU1.js → useBasicWidgetState-DgnZoFWi.js} +1 -1
- package/build/assets/{useOnInputChange-7prOUvRG.js → useOnInputChange-DTjT_cKQ.js} +1 -1
- package/build/assets/{withFullScreenWrapper-B9gGgkei.js → withFullScreenWrapper-BzdPuFtI.js} +1 -1
- package/build/index.html +1 -1
- package/package.json +4 -4
- package/wheels/streamlit-1.41.0-cp312-none-any.whl +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as m,bk as Kt,bl as Xt,bm as Qt,bn as Zt,b as zr,g as Ur,b2 as x,be as ue,bf as ce,bo as qr,bd as Gt,b3 as E,a0 as Jt,bp as Kr,bq as er,br as tr,bs as Xr,b4 as pe,bt as Qr,bu as Zr,bv as Gr,a4 as Jr,a3 as rr,M as en,a6 as tn,G as Ne,B as rn,j as de,a_ as nn,a$ as on,bc as an,b0 as ln,aK as sn}from"./index-
|
|
1
|
+
import{r as m,bk as Kt,bl as Xt,bm as Qt,bn as Zt,b as zr,g as Ur,b2 as x,be as ue,bf as ce,bo as qr,bd as Gt,b3 as E,a0 as Jt,bp as Kr,bq as er,br as tr,bs as Xr,b4 as pe,bt as Qr,bu as Zr,bv as Gr,a4 as Jr,a3 as rr,M as en,a6 as tn,G as Ne,B as rn,j as de,a_ as nn,a$ as on,bc as an,b0 as ln,aK as sn}from"./index-DuoBWGu3.js";import{a as un}from"./useBasicWidgetState-DgnZoFWi.js";import{D as oe,a as ae,T as cn,l as Ve}from"./timepicker-BD9p-9JQ.js";import{I as pn}from"./input-OLwqq6dJ.js";import{I as dn}from"./base-input-CMN1_Ew_.js";import"./FormClearHelper-BIZNCxvb.js";import"./getPrototypeOf-CHt6AZp_.js";import"./createSuper-D4gvBB5j.js";var fn=["title","size","color","overrides"];function Ye(){return Ye=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},Ye.apply(this,arguments)}function hn(t,r){if(t==null)return{};var o=yn(t,r),n,e;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(e=0;e<a.length;e++)n=a[e],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function yn(t,r){if(t==null)return{};var o={},n=Object.keys(t),e,a;for(a=0;a<n.length;a++)e=n[a],!(r.indexOf(e)>=0)&&(o[e]=t[e]);return o}function gn(t,r){return Dn(t)||vn(t,r)||bn(t,r)||mn()}function mn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bn(t,r){if(t){if(typeof t=="string")return nr(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);if(o==="Object"&&t.constructor&&(o=t.constructor.name),o==="Map"||o==="Set")return Array.from(t);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return nr(t,r)}}function nr(t,r){(r==null||r>t.length)&&(r=t.length);for(var o=0,n=new Array(r);o<r;o++)n[o]=t[o];return n}function vn(t,r){var o=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(o!=null){var n=[],e=!0,a=!1,i,l;try{for(o=o.call(t);!(e=(i=o.next()).done)&&(n.push(i.value),!(r&&n.length===r));e=!0);}catch(u){a=!0,l=u}finally{try{!e&&o.return!=null&&o.return()}finally{if(a)throw l}}return n}}function Dn(t){if(Array.isArray(t))return t}function Sn(t,r){var o=Kt(),n=gn(o,2),e=n[1],a=t.title,i=a===void 0?"Left":a,l=t.size,u=t.color,s=t.overrides,y=s===void 0?{}:s,p=hn(t,fn),d=Xt({component:e.icons&&e.icons.ChevronLeft?e.icons.ChevronLeft:null},y&&y.Svg?Qt(y.Svg):{});return m.createElement(Zt,Ye({viewBox:"0 0 24 24",ref:r,title:i,size:l,color:u,overrides:{Svg:d}},p),m.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 12C9 12.2652 9.10536 12.5196 9.29289 12.7071L13.2929 16.7071C13.6834 17.0976 14.3166 17.0976 14.7071 16.7071C15.0976 16.3166 15.0976 15.6834 14.7071 15.2929L11.4142 12L14.7071 8.70711C15.0976 8.31658 15.0976 7.68342 14.7071 7.29289C14.3166 6.90237 13.6834 6.90237 13.2929 7.29289L9.29289 11.2929C9.10536 11.4804 9 11.7348 9 12Z"}))}const or=m.forwardRef(Sn);var On=["title","size","color","overrides"];function We(){return We=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},We.apply(this,arguments)}function wn(t,r){if(t==null)return{};var o=kn(t,r),n,e;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(e=0;e<a.length;e++)n=a[e],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function kn(t,r){if(t==null)return{};var o={},n=Object.keys(t),e,a;for(a=0;a<n.length;a++)e=n[a],!(r.indexOf(e)>=0)&&(o[e]=t[e]);return o}function Cn(t,r){return Pn(t)||Hn(t,r)||jn(t,r)||Mn()}function Mn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jn(t,r){if(t){if(typeof t=="string")return ar(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);if(o==="Object"&&t.constructor&&(o=t.constructor.name),o==="Map"||o==="Set")return Array.from(t);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return ar(t,r)}}function ar(t,r){(r==null||r>t.length)&&(r=t.length);for(var o=0,n=new Array(r);o<r;o++)n[o]=t[o];return n}function Hn(t,r){var o=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(o!=null){var n=[],e=!0,a=!1,i,l;try{for(o=o.call(t);!(e=(i=o.next()).done)&&(n.push(i.value),!(r&&n.length===r));e=!0);}catch(u){a=!0,l=u}finally{try{!e&&o.return!=null&&o.return()}finally{if(a)throw l}}return n}}function Pn(t){if(Array.isArray(t))return t}function En(t,r){var o=Kt(),n=Cn(o,2),e=n[1],a=t.title,i=a===void 0?"Right":a,l=t.size,u=t.color,s=t.overrides,y=s===void 0?{}:s,p=wn(t,On),d=Xt({component:e.icons&&e.icons.ChevronRight?e.icons.ChevronRight:null},y&&y.Svg?Qt(y.Svg):{});return m.createElement(Zt,We({viewBox:"0 0 24 24",ref:r,title:i,size:l,color:u,overrides:{Svg:d}},p),m.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.29289 7.29289C8.90237 7.68342 8.90237 8.31658 9.29289 8.70711L12.5858 12L9.29289 15.2929C8.90237 15.6834 8.90237 16.3166 9.29289 16.7071C9.68342 17.0976 10.3166 17.0976 10.7071 16.7071L14.7071 12.7071C14.8946 12.5196 15 12.2652 15 12C15 11.7348 14.8946 11.4804 14.7071 11.2929L10.7071 7.29289C10.3166 6.90237 9.68342 6.90237 9.29289 7.29289Z"}))}const ir=m.forwardRef(En);var lr={exports:{}};function An(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var _e=An(m),In=zr;function xn(t,r){for(var o=Object.getOwnPropertyNames(r),n=0;n<o.length;n++){var e=o[n],a=Object.getOwnPropertyDescriptor(r,e);a&&a.configurable&&t[e]===void 0&&Object.defineProperty(t,e,a)}return t}function ze(){return(ze=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t}).apply(this,arguments)}function Rn(t,r){t.prototype=Object.create(r.prototype),xn(t.prototype.constructor=t,r)}function Ln(t,r){if(t==null)return{};var o,n,e={},a=Object.keys(t);for(n=0;n<a.length;n++)o=a[n],0<=r.indexOf(o)||(e[o]=t[o]);return e}function ie(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var $n=function(t,r,o,n,e,a,i,l){if(!t){var u;if(r===void 0)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[o,n,e,a,i,l],y=0;(u=new Error(r.replace(/%s/g,function(){return s[y++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}},sr=$n;function ur(t,r,o){if("selectionStart"in t&&"selectionEnd"in t)t.selectionStart=r,t.selectionEnd=o;else{var n=t.createTextRange();n.collapse(!0),n.moveStart("character",r),n.moveEnd("character",o-r),n.select()}}function Bn(t){var r=0,o=0;if("selectionStart"in t&&"selectionEnd"in t)r=t.selectionStart,o=t.selectionEnd;else{var n=document.selection.createRange();n.parentElement()===t&&(r=-n.moveStart("character",-t.value.length),o=-n.moveEnd("character",-t.value.length))}return{start:r,end:o,length:o-r}}var Tn={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},Fn="_";function cr(t,r,o){var n="",e="",a=null,i=[];if(r===void 0&&(r=Fn),o==null&&(o=Tn),!t||typeof t!="string")return{maskChar:r,formatChars:o,mask:null,prefix:null,lastEditablePosition:null,permanents:[]};var l=!1;return t.split("").forEach(function(u){l=!l&&u==="\\"||(l||!o[u]?(i.push(n.length),n.length===i.length-1&&(e+=u)):a=n.length+1,n+=u,!1)}),{maskChar:r,formatChars:o,prefix:e,mask:n,lastEditablePosition:a,permanents:i}}function K(t,r){return t.permanents.indexOf(r)!==-1}function Oe(t,r,o){var n=t.mask,e=t.formatChars;if(!o)return!1;if(K(t,r))return n[r]===o;var a=e[n[r]];return new RegExp(a).test(o)}function pr(t,r){return r.split("").every(function(o,n){return K(t,n)||!Oe(t,n,o)})}function fe(t,r){var o=t.maskChar,n=t.prefix;if(!o){for(;r.length>n.length&&K(t,r.length-1);)r=r.slice(0,r.length-1);return r.length}for(var e=n.length,a=r.length;a>=n.length;a--){var i=r[a];if(!K(t,a)&&Oe(t,a,i)){e=a+1;break}}return e}function dr(t,r){return fe(t,r)===t.mask.length}function te(t,r){var o=t.maskChar,n=t.mask,e=t.prefix;if(!o){for((r=Ue(t,"",r,0)).length<e.length&&(r=e);r.length<n.length&&K(t,r.length);)r+=n[r.length];return r}if(r)return Ue(t,te(t,""),r,0);for(var a=0;a<n.length;a++)K(t,a)?r+=n[a]:r+=o;return r}function Nn(t,r,o,n){var e=o+n,a=t.maskChar,i=t.mask,l=t.prefix,u=r.split("");if(a)return u.map(function(y,p){return p<o||e<=p?y:K(t,p)?i[p]:a}).join("");for(var s=e;s<u.length;s++)K(t,s)&&(u[s]="");return o=Math.max(l.length,o),u.splice(o,e-o),r=u.join(""),te(t,r)}function Ue(t,r,o,n){var e=t.mask,a=t.maskChar,i=t.prefix,l=o.split(""),u=dr(t,r);return!a&&n>r.length&&(r+=e.slice(r.length,n)),l.every(function(s){for(;f=s,K(t,d=n)&&f!==e[d];){if(n>=r.length&&(r+=e[n]),y=s,p=n,a&&K(t,p)&&y===a)return!0;if(++n>=e.length)return!1}var y,p,d,f;return!Oe(t,n,s)&&s!==a||(n<r.length?r=a||u||n<i.length?r.slice(0,n)+s+r.slice(n+1):(r=r.slice(0,n)+s+r.slice(n),te(t,r)):a||(r+=s),++n<e.length)}),r}function Vn(t,r,o,n){var e=t.mask,a=t.maskChar,i=o.split(""),l=n;return i.every(function(u){for(;y=u,K(t,s=n)&&y!==e[s];)if(++n>=e.length)return!1;var s,y;return(Oe(t,n,u)||u===a)&&n++,n<e.length}),n-l}function Yn(t,r){for(var o=r;0<=o;--o)if(!K(t,o))return o;return null}function he(t,r){for(var o=t.mask,n=r;n<o.length;++n)if(!K(t,n))return n;return null}function qe(t){return t||t===0?t+"":""}function Wn(t,r,o,n,e){var a=t.mask,i=t.prefix,l=t.lastEditablePosition,u=r,s="",y=0,p=0,d=Math.min(e.start,o.start);return o.end>e.start?p=(y=Vn(t,n,s=u.slice(e.start,o.end),d))?e.length:0:u.length<n.length&&(p=n.length-u.length),u=n,p&&(p===1&&!e.length&&(d=e.start===o.start?he(t,o.start):Yn(t,o.start)),u=Nn(t,u,d,p)),u=Ue(t,u,s,d),(d+=y)>=a.length?d=a.length:d<i.length&&!y?d=i.length:d>=i.length&&d<l&&y&&(d=he(t,d)),s||(s=null),{value:u=te(t,u),enteredString:s,selection:{start:d,end:d}}}function _n(){var t=new RegExp("windows","i"),r=new RegExp("phone","i"),o=navigator.userAgent;return t.test(o)&&r.test(o)}function q(t){return typeof t=="function"}function zn(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame}function fr(){return window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame}function hr(t){return(fr()?zn():function(){return setTimeout(t,1e3/60)})(t)}function Ke(t){(fr()||clearTimeout)(t)}var Un=function(t){function r(n){var e=t.call(this,n)||this;e.focused=!1,e.mounted=!1,e.previousSelection=null,e.selectionDeferId=null,e.saveSelectionLoopDeferId=null,e.saveSelectionLoop=function(){e.previousSelection=e.getSelection(),e.saveSelectionLoopDeferId=hr(e.saveSelectionLoop)},e.runSaveSelectionLoop=function(){e.saveSelectionLoopDeferId===null&&e.saveSelectionLoop()},e.stopSaveSelectionLoop=function(){e.saveSelectionLoopDeferId!==null&&(Ke(e.saveSelectionLoopDeferId),e.saveSelectionLoopDeferId=null,e.previousSelection=null)},e.getInputDOMNode=function(){if(!e.mounted)return null;var c=In.findDOMNode(ie(ie(e))),h=typeof window<"u"&&c instanceof window.Element;if(c&&!h)return null;if(c.nodeName!=="INPUT"&&(c=c.querySelector("input")),!c)throw new Error("react-input-mask: inputComponent doesn't contain input node");return c},e.getInputValue=function(){var c=e.getInputDOMNode();return c?c.value:null},e.setInputValue=function(c){var h=e.getInputDOMNode();h&&(e.value=c,h.value=c)},e.setCursorToEnd=function(){var c=fe(e.maskOptions,e.value),h=he(e.maskOptions,c);h!==null&&e.setCursorPosition(h)},e.setSelection=function(c,h,g){g===void 0&&(g={});var b=e.getInputDOMNode(),v=e.isFocused();b&&v&&(g.deferred||ur(b,c,h),e.selectionDeferId!==null&&Ke(e.selectionDeferId),e.selectionDeferId=hr(function(){e.selectionDeferId=null,ur(b,c,h)}),e.previousSelection={start:c,end:h,length:Math.abs(h-c)})},e.getSelection=function(){return Bn(e.getInputDOMNode())},e.getCursorPosition=function(){return e.getSelection().start},e.setCursorPosition=function(c){e.setSelection(c,c)},e.isFocused=function(){return e.focused},e.getBeforeMaskedValueChangeConfig=function(){var c=e.maskOptions,h=c.mask,g=c.maskChar,b=c.permanents,v=c.formatChars;return{mask:h,maskChar:g,permanents:b,alwaysShowMask:!!e.props.alwaysShowMask,formatChars:v}},e.isInputAutofilled=function(c,h,g,b){var v=e.getInputDOMNode();try{if(v.matches(":-webkit-autofill"))return!0}catch{}return!e.focused||b.end<g.length&&h.end===c.length},e.onChange=function(c){var h=ie(ie(e)).beforePasteState,g=ie(ie(e)).previousSelection,b=e.props.beforeMaskedValueChange,v=e.getInputValue(),D=e.value,S=e.getSelection();e.isInputAutofilled(v,S,D,g)&&(D=te(e.maskOptions,""),g={start:0,end:0,length:0}),h&&(g=h.selection,D=h.value,S={start:g.start+v.length,end:g.start+v.length,length:0},v=D.slice(0,g.start)+v+D.slice(g.end),e.beforePasteState=null);var P=Wn(e.maskOptions,v,S,D,g),j=P.enteredString,k=P.selection,H=P.value;if(q(b)){var O=b({value:H,selection:k},{value:D,selection:g},j,e.getBeforeMaskedValueChangeConfig());H=O.value,k=O.selection}e.setInputValue(H),q(e.props.onChange)&&e.props.onChange(c),e.isWindowsPhoneBrowser?e.setSelection(k.start,k.end,{deferred:!0}):e.setSelection(k.start,k.end)},e.onFocus=function(c){var h=e.props.beforeMaskedValueChange,g=e.maskOptions,b=g.mask,v=g.prefix;if(e.focused=!0,e.mounted=!0,b){if(e.value)fe(e.maskOptions,e.value)<e.maskOptions.mask.length&&e.setCursorToEnd();else{var D=te(e.maskOptions,v),S=te(e.maskOptions,D),P=fe(e.maskOptions,S),j=he(e.maskOptions,P),k={start:j,end:j};if(q(h)){var H=h({value:S,selection:k},{value:e.value,selection:null},null,e.getBeforeMaskedValueChangeConfig());S=H.value,k=H.selection}var O=S!==e.getInputValue();O&&e.setInputValue(S),O&&q(e.props.onChange)&&e.props.onChange(c),e.setSelection(k.start,k.end)}e.runSaveSelectionLoop()}q(e.props.onFocus)&&e.props.onFocus(c)},e.onBlur=function(c){var h=e.props.beforeMaskedValueChange,g=e.maskOptions.mask;if(e.stopSaveSelectionLoop(),e.focused=!1,g&&!e.props.alwaysShowMask&&pr(e.maskOptions,e.value)){var b="";q(h)&&(b=h({value:b,selection:null},{value:e.value,selection:e.previousSelection},null,e.getBeforeMaskedValueChangeConfig()).value);var v=b!==e.getInputValue();v&&e.setInputValue(b),v&&q(e.props.onChange)&&e.props.onChange(c)}q(e.props.onBlur)&&e.props.onBlur(c)},e.onMouseDown=function(c){if(!e.focused&&document.addEventListener){e.mouseDownX=c.clientX,e.mouseDownY=c.clientY,e.mouseDownTime=new Date().getTime();var h=function g(b){if(document.removeEventListener("mouseup",g),e.focused){var v=Math.abs(b.clientX-e.mouseDownX),D=Math.abs(b.clientY-e.mouseDownY),S=Math.max(v,D),P=new Date().getTime()-e.mouseDownTime;(S<=10&&P<=200||S<=5&&P<=300)&&e.setCursorToEnd()}};document.addEventListener("mouseup",h)}q(e.props.onMouseDown)&&e.props.onMouseDown(c)},e.onPaste=function(c){q(e.props.onPaste)&&e.props.onPaste(c),c.defaultPrevented||(e.beforePasteState={value:e.getInputValue(),selection:e.getSelection()},e.setInputValue(""))},e.handleRef=function(c){e.props.children==null&&q(e.props.inputRef)&&e.props.inputRef(c)};var a=n.mask,i=n.maskChar,l=n.formatChars,u=n.alwaysShowMask,s=n.beforeMaskedValueChange,y=n.defaultValue,p=n.value;e.maskOptions=cr(a,i,l),y==null&&(y=""),p==null&&(p=y);var d=qe(p);if(e.maskOptions.mask&&(u||d)&&(d=te(e.maskOptions,d),q(s))){var f=n.value;n.value==null&&(f=y),d=s({value:d,selection:null},{value:f=qe(f),selection:null},null,e.getBeforeMaskedValueChangeConfig()).value}return e.value=d,e}Rn(r,t);var o=r.prototype;return o.componentDidMount=function(){this.mounted=!0,this.getInputDOMNode()&&(this.isWindowsPhoneBrowser=_n(),this.maskOptions.mask&&this.getInputValue()!==this.value&&this.setInputValue(this.value))},o.componentDidUpdate=function(){var n=this.previousSelection,e=this.props,a=e.beforeMaskedValueChange,i=e.alwaysShowMask,l=e.mask,u=e.maskChar,s=e.formatChars,y=this.maskOptions,p=i||this.isFocused(),d=this.props.value!=null,f=d?qe(this.props.value):this.value,c=n?n.start:null;if(this.maskOptions=cr(l,u,s),this.maskOptions.mask){!y.mask&&this.isFocused()&&this.runSaveSelectionLoop();var h=this.maskOptions.mask&&this.maskOptions.mask!==y.mask;if(y.mask||d||(f=this.getInputValue()),(h||this.maskOptions.mask&&(f||p))&&(f=te(this.maskOptions,f)),h){var g=fe(this.maskOptions,f);(c===null||g<c)&&(c=dr(this.maskOptions,f)?g:he(this.maskOptions,g))}!this.maskOptions.mask||!pr(this.maskOptions,f)||p||d&&this.props.value||(f="");var b={start:c,end:c};if(q(a)){var v=a({value:f,selection:b},{value:this.value,selection:this.previousSelection},null,this.getBeforeMaskedValueChangeConfig());f=v.value,b=v.selection}this.value=f;var D=this.getInputValue()!==this.value;D?(this.setInputValue(this.value),this.forceUpdate()):h&&this.forceUpdate();var S=!1;b.start!=null&&b.end!=null&&(S=!n||n.start!==b.start||n.end!==b.end),(S||D)&&this.setSelection(b.start,b.end)}else y.mask&&(this.stopSaveSelectionLoop(),this.forceUpdate())},o.componentWillUnmount=function(){this.mounted=!1,this.selectionDeferId!==null&&Ke(this.selectionDeferId),this.stopSaveSelectionLoop()},o.render=function(){var n,e=this.props,a=(e.mask,e.alwaysShowMask,e.maskChar,e.formatChars,e.inputRef,e.beforeMaskedValueChange,e.children),i=Ln(e,["mask","alwaysShowMask","maskChar","formatChars","inputRef","beforeMaskedValueChange","children"]);if(a){q(a)||sr(!1);var l=["onChange","onPaste","onMouseDown","onFocus","onBlur","value","disabled","readOnly"],u=ze({},i);l.forEach(function(y){return delete u[y]}),n=a(u),l.filter(function(y){return n.props[y]!=null&&n.props[y]!==i[y]}).length&&sr(!1)}else n=_e.createElement("input",ze({ref:this.handleRef},i));var s={onFocus:this.onFocus,onBlur:this.onBlur};return this.maskOptions.mask&&(i.disabled||i.readOnly||(s.onChange=this.onChange,s.onPaste=this.onPaste,s.onMouseDown=this.onMouseDown),i.value!=null&&(s.value=this.value)),n=_e.cloneElement(n,s)},r}(_e.Component),qn=Un;lr.exports=qn;var Kn=lr.exports;const Xn=Ur(Kn);var Qn=["startEnhancer","endEnhancer","error","positive","onChange","onFocus","onBlur","value","disabled","readOnly"],Zn=["Input"],Gn=["mask","maskChar","overrides"];function yr(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)}return o}function Xe(t){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{};r%2?yr(Object(o),!0).forEach(function(n){Jn(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):yr(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function Jn(t,r,o){return r in t?Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[r]=o,t}function we(t){"@babel/helpers - typeof";return we=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},we(t)}function ye(){return ye=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},ye.apply(this,arguments)}function Qe(t,r){if(t==null)return{};var o=eo(t,r),n,e;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(e=0;e<a.length;e++)n=a[e],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function eo(t,r){if(t==null)return{};var o={},n=Object.keys(t),e,a;for(a=0;a<n.length;a++)e=n[a],!(r.indexOf(e)>=0)&&(o[e]=t[e]);return o}var gr=m.forwardRef(function(t,r){t.startEnhancer,t.endEnhancer,t.error,t.positive;var o=t.onChange,n=t.onFocus,e=t.onBlur,a=t.value,i=t.disabled,l=t.readOnly,u=Qe(t,Qn);return m.createElement(Xn,ye({onChange:o,onFocus:n,onBlur:e,value:a,disabled:i,readOnly:l},u),function(s){return m.createElement(dn,ye({ref:r,onChange:o,onFocus:n,onBlur:e,value:a,disabled:i,readOnly:l},s))})});gr.displayName="MaskOverride";function mr(t){var r=t.mask,o=t.maskChar,n=t.overrides;n=n===void 0?{}:n;var e=n.Input,a=e===void 0?{}:e,i=Qe(n,Zn),l=Qe(t,Gn),u=gr,s={},y={};typeof a=="function"?u=a:we(a)==="object"&&(u=a.component||u,s=a.props||{},y=a.style||{}),we(s)==="object"&&(s=Xe(Xe({},s),{},{mask:s.mask||r,maskChar:s.maskChar||o}));var p=Xe({Input:{component:u,props:s,style:y}},i);return m.createElement(pn,ye({},l,{overrides:p}))}mr.defaultProps={maskChar:" "};var Ze=Object.freeze({horizontal:"horizontal",vertical:"vertical"}),br=[0,1,2,3,4,5,6],to=[0,1,2,3,4,5,6,7,8,9,10,11],T={high:"high",default:"default"},re={startDate:"startDate",endDate:"endDate"},ro={default:"default",locked:"locked"};function vr(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)}return o}function le(t){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{};r%2?vr(Object(o),!0).forEach(function(n){no(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):vr(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function no(t,r,o){return r in t?Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[r]=o,t}var Ge=x("label",function(t){var r=t.$disabled,o=t.$theme,n=o.colors,e=o.typography;return le(le({},e.font250),{},{width:"100%",color:r?n.contentSecondary:n.contentPrimary,display:"block",paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0})});Ge.displayName="Label",Ge.displayName="Label";var Je=x("span",function(t){var r=t.$theme.sizing;return{display:"flex",width:"100%",marginTop:r.scale300,marginRight:0,marginBottom:r.scale300,marginLeft:0}});Je.displayName="LabelContainer",Je.displayName="LabelContainer";var et=x("span",function(t){var r=t.$disabled,o=t.$counterError,n=t.$theme,e=n.colors,a=n.typography;return le(le({},a.font100),{},{flex:0,width:"100%",color:o?e.negative400:r?e.contentSecondary:e.contentPrimary})});et.displayName="LabelEndEnhancer",et.displayName="LabelEndEnhancer";var tt=x("div",function(t){var r=t.$error,o=t.$positive,n=t.$theme,e=n.colors,a=n.sizing,i=n.typography,l=e.contentSecondary;return r?l=e.negative400:o&&(l=e.positive400),le(le({},i.font100),{},{color:l,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,marginTop:a.scale300,marginRight:0,marginBottom:a.scale300,marginLeft:0})});tt.displayName="Caption",tt.displayName="Caption";var rt=x("div",function(t){var r=t.$theme.sizing;return{width:"100%",marginBottom:r.scale600}});rt.displayName="ControlContainer",rt.displayName="ControlContainer";function ne(){return ne=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},ne.apply(this,arguments)}function ke(t){"@babel/helpers - typeof";return ke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ke(t)}function oo(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function ao(t,r){for(var o=0;o<r.length;o++){var n=r[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function io(t,r,o){return ao(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function lo(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&nt(t,r)}function nt(t,r){return nt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,n){return o.__proto__=n,o},nt(t,r)}function so(t){var r=po();return function(){var o=Ce(t),n;if(r){var e=Ce(this).constructor;n=Reflect.construct(o,arguments,e)}else n=o.apply(this,arguments);return uo(this,n)}}function uo(t,r){if(r&&(ke(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return co(t)}function co(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function po(){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 Ce(t){return Ce=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ce(t)}function fo(t,r,o){return r in t?Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[r]=o,t}function ho(t,r,o,n){return r&&typeof r!="boolean"?typeof r=="function"?r(n):r:o&&typeof o!="boolean"?typeof o=="function"?o(n):o:t?typeof t=="function"?t(n):t:null}var ot=function(t){lo(o,t);var r=so(o);function o(){return oo(this,o),r.apply(this,arguments)}return io(o,[{key:"render",value:function(){var n=this.props,e=n.overrides,a=e.Label,i=e.LabelEndEnhancer,l=e.LabelContainer,u=e.Caption,s=e.ControlContainer,y=n.label,p=n.caption,d=n.disabled,f=n.error,c=n.positive,h=n.htmlFor,g=n.children,b=n.counter,v=m.Children.only(g).props,D={$disabled:!!d,$error:!!f,$positive:!!c},S=ue(a)||Ge,P=ue(i)||et,j=ue(l)||Je,k=ue(u)||tt,H=ue(s)||rt,O=ho(p,f,c,D),M=this.props.labelEndEnhancer;if(b){var C=null,w=null,I=null;ke(b)==="object"&&(w=b.length,C=b.maxLength,I=b.error),C=C||v.maxLength,w==null&&typeof v.value=="string"&&(w=v.value.length),w==null&&(w=0),D.$length=w,C==null?M||(M="".concat(w)):(D.$maxLength=w,M||(M="".concat(w,"/").concat(C)),w>C&&I==null&&(I=!0)),I&&(D.$error=!0,D.$counterError=!0)}return m.createElement(m.Fragment,null,y&&m.createElement(j,ne({},D,ce(l)),m.createElement(S,ne({"data-baseweb":"form-control-label",htmlFor:h||v.id},D,ce(a)),typeof y=="function"?y(D):y),!!M&&m.createElement(P,ne({},D,ce(i)),typeof M=="function"?M(D):M)),m.createElement(qr,null,function(G){return m.createElement(H,ne({"data-baseweb":"form-control-container"},D,ce(s)),m.Children.map(g,function(z,Se){if(z){var A=z.key||String(Se);return m.cloneElement(z,{key:A,"aria-errormessage":f?G:null,"aria-describedby":p||c?G:null,disabled:v.disabled||d,error:typeof v.error<"u"?v.error:D.$error,positive:typeof v.positive<"u"?v.positive:D.$positive})}}),(!!p||!!f||c)&&m.createElement(k,ne({"data-baseweb":"form-control-caption",id:G},D,ce(u)),O))}))}}]),o}(m.Component);fo(ot,"defaultProps",{overrides:{},label:null,caption:null,disabled:!1,counter:!1});function Dr(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)}return o}function Sr(t){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{};r%2?Dr(Object(o),!0).forEach(function(n){yo(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):Dr(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function yo(t,r,o){return r in t?Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[r]=o,t}var go=function(t){return to.map(function(r){return{id:r.toString(),label:t(r)}})},mo=function(t,r){return t.map(function(o){return r.includes(Number(o.id))?o:Sr(Sr({},o),{},{disabled:!0})})},bo=function(t){var r=t.filterMonthsList,o=t.formatMonthLabel,n=go(o);return r&&(n=mo(n,r)),n};function vo(t){var r=t.$range,o=r===void 0?!1:r,n=t.$disabled,e=n===void 0?!1:n,a=t.$isHighlighted,i=a===void 0?!1:a,l=t.$isHovered,u=l===void 0?!1:l,s=t.$selected,y=s===void 0?!1:s,p=t.$hasRangeSelected,d=p===void 0?!1:p,f=t.$startDate,c=f===void 0?!1:f,h=t.$endDate,g=h===void 0?!1:h,b=t.$pseudoSelected,v=b===void 0?!1:b,D=t.$hasRangeHighlighted,S=D===void 0?!1:D,P=t.$pseudoHighlighted,j=P===void 0?!1:P,k=t.$hasRangeOnRight,H=k===void 0?!1:k,O=t.$startOfMonth,M=O===void 0?!1:O,C=t.$endOfMonth,w=C===void 0?!1:C,I=t.$outsideMonth,G=I===void 0?!1:I;return"".concat(+o).concat(+e).concat(+(i||u)).concat(+y).concat(+d).concat(+c).concat(+g).concat(+v).concat(+S).concat(+j).concat(+(S&&!j&&H)).concat(+(S&&!j&&!H)).concat(+M).concat(+w).concat(+G)}function Do(t,r){return ko(t)||wo(t,r)||Oo(t,r)||So()}function So(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oo(t,r){if(t){if(typeof t=="string")return Or(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);if(o==="Object"&&t.constructor&&(o=t.constructor.name),o==="Map"||o==="Set")return Array.from(t);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return Or(t,r)}}function Or(t,r){(r==null||r>t.length)&&(r=t.length);for(var o=0,n=new Array(r);o<r;o++)n[o]=t[o];return n}function wo(t,r){var o=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(o!=null){var n=[],e=!0,a=!1,i,l;try{for(o=o.call(t);!(e=(i=o.next()).done)&&(n.push(i.value),!(r&&n.length===r));e=!0);}catch(u){a=!0,l=u}finally{try{!e&&o.return!=null&&o.return()}finally{if(a)throw l}}return n}}function ko(t){if(Array.isArray(t))return t}function wr(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)}return o}function B(t){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{};r%2?wr(Object(o),!0).forEach(function(n){ge(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):wr(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function ge(t,r,o){return r in t?Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[r]=o,t}var at=x("div",function(t){var r=t.$separateRangeInputs;return B({width:"100%"},r?{display:"flex",justifyContent:"center"}:{})});at.displayName="StyledInputWrapper",at.displayName="StyledInputWrapper";var it=x("div",function(t){var r=t.$theme;return B(B({},r.typography.LabelMedium),{},{marginBottom:r.sizing.scale300})});it.displayName="StyledInputLabel",it.displayName="StyledInputLabel";var lt=x("div",function(t){var r=t.$theme;return{width:"100%",marginRight:r.sizing.scale300}});lt.displayName="StyledStartDate",lt.displayName="StyledStartDate";var st=x("div",function(t){return t.$theme,{width:"100%"}});st.displayName="StyledEndDate",st.displayName="StyledEndDate";var ut=x("div",function(t){var r=t.$theme,o=r.typography,n=r.colors,e=r.borders;return B(B({},o.font200),{},{color:n.calendarForeground,backgroundColor:n.calendarBackground,textAlign:"center",borderTopLeftRadius:e.surfaceBorderRadius,borderTopRightRadius:e.surfaceBorderRadius,borderBottomRightRadius:e.surfaceBorderRadius,borderBottomLeftRadius:e.surfaceBorderRadius,display:"inline-block"})});ut.displayName="StyledRoot",ut.displayName="StyledRoot";var ct=x("div",function(t){var r=t.$orientation;return{display:"flex",flexDirection:r===Ze.vertical?"column":"row"}});ct.displayName="StyledMonthContainer",ct.displayName="StyledMonthContainer";var pt=x("div",function(t){var r=t.$theme.sizing,o=t.$density;return{paddingTop:r.scale300,paddingBottom:o===T.high?r.scale400:r.scale300,paddingLeft:r.scale500,paddingRight:r.scale500}});pt.displayName="StyledCalendarContainer",pt.displayName="StyledCalendarContainer";var Me=x("div",function(t){var r=t.$theme,o=r.direction==="rtl"?"right":"left";return{marginBottom:r.sizing.scale600,paddingLeft:r.sizing.scale600,paddingRight:r.sizing.scale600,textAlign:o}});Me.displayName="StyledSelectorContainer",Me.displayName="StyledSelectorContainer";var dt=x("div",function(t){var r=t.$theme,o=r.typography,n=r.borders,e=r.colors,a=r.sizing,i=t.$density;return B(B({},i===T.high?o.LabelMedium:o.LabelLarge),{},{color:e.calendarHeaderForeground,display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:a.scale600,paddingBottom:a.scale300,paddingLeft:a.scale600,paddingRight:a.scale600,backgroundColor:e.calendarHeaderBackground,borderTopLeftRadius:n.surfaceBorderRadius,borderTopRightRadius:n.surfaceBorderRadius,borderBottomRightRadius:0,borderBottomLeftRadius:0,minHeight:i===T.high?"calc(".concat(a.scale800," + ").concat(a.scale0,")"):a.scale950})});dt.displayName="StyledCalendarHeader",dt.displayName="StyledCalendarHeader";var ft=x("div",function(t){return{color:t.$theme.colors.calendarHeaderForeground,backgroundColor:t.$theme.colors.calendarHeaderBackground,whiteSpace:"nowrap"}});ft.displayName="StyledMonthHeader",ft.displayName="StyledMonthHeader";var ht=x("button",function(t){var r=t.$theme,o=r.typography,n=r.colors,e=t.$isFocusVisible,a=t.$density;return B(B({},a===T.high?o.LabelMedium:o.LabelLarge),{},{alignItems:"center",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,color:n.calendarHeaderForeground,cursor:"pointer",display:"flex",outline:"none",":focus":{boxShadow:e?"0 0 0 3px ".concat(n.accent):"none"}})});ht.displayName="StyledMonthYearSelectButton",ht.displayName="StyledMonthYearSelectButton";var yt=x("span",function(t){var r=t.$theme.direction==="rtl"?"marginRight":"marginLeft";return ge({alignItems:"center",display:"flex"},r,t.$theme.sizing.scale500)});yt.displayName="StyledMonthYearSelectIconContainer",yt.displayName="StyledMonthYearSelectIconContainer";function kr(t){var r=t.$theme,o=t.$disabled,n=t.$isFocusVisible;return{boxSizing:"border-box",display:"flex",color:o?r.colors.calendarHeaderForegroundDisabled:r.colors.calendarHeaderForeground,cursor:o?"default":"pointer",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingTop:"0",paddingBottom:"0",paddingLeft:"0",paddingRight:"0",marginBottom:0,marginTop:0,outline:"none",":focus":o?{}:{boxShadow:n?"0 0 0 3px ".concat(r.colors.accent):"none"}}}var gt=x("button",kr);gt.displayName="StyledPrevButton",gt.displayName="StyledPrevButton";var mt=x("button",kr);mt.displayName="StyledNextButton",mt.displayName="StyledNextButton";var bt=x("div",function(t){return{display:"inline-block"}});bt.displayName="StyledMonth",bt.displayName="StyledMonth";var vt=x("div",function(t){var r=t.$theme.sizing;return{whiteSpace:"nowrap",display:"flex",marginBottom:r.scale0}});vt.displayName="StyledWeek",vt.displayName="StyledWeek";function R(t,r){var o,n=t.substr(0,12)+"1"+t.substr(13),e=t.substr(0,13)+"1"+t.substr(14);return o={},ge(o,t,r),ge(o,n,r),ge(o,e,r),o}function Dt(t,r){var o=r.colors,n={":before":{content:null},":after":{content:null}},e=n,a={color:o.calendarForegroundDisabled,":before":{content:null},":after":{content:null}},i={color:o.calendarForegroundDisabled,":before":{borderTopStyle:"none",borderBottomStyle:"none",borderLeftStyle:"none",borderRightStyle:"none",backgroundColor:"transparent"},":after":{borderTopLeftRadius:"0%",borderTopRightRadius:"0%",borderBottomLeftRadius:"0%",borderBottomRightRadius:"0%",borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent",borderLeftColor:"transparent"}},l={":before":{content:null}},u=1;t&&t[u]==="1"&&(e=a);var s=Object.assign({},R("001000000000000",{color:o.calendarDayForegroundPseudoSelected}),R("000100000000000",{color:o.calendarDayForegroundSelected}),R("001100000000000",{color:o.calendarDayForegroundSelectedHighlighted}),{"010000000000000":{color:o.calendarForegroundDisabled,":after":{content:null}}},{"011000000000000":{color:o.calendarForegroundDisabled,":after":{content:null}}},R("000000000000001",i),R("101000000000000",l),R("101010000000000",l),R("100100000000000",{color:o.calendarDayForegroundSelected}),R("101100000000000",{color:o.calendarDayForegroundSelectedHighlighted,":before":{content:null}}),R("100111100000000",{color:o.calendarDayForegroundSelected,":before":{content:null}}),R("101111100000000",{color:o.calendarDayForegroundSelectedHighlighted,":before":{content:null}}),R("100111000000000",{color:o.calendarDayForegroundSelected}),R("100110100000000",{color:o.calendarDayForegroundSelected,":before":{left:null,right:"50%"}}),R("100100001010000",{color:o.calendarDayForegroundSelected}),R("100100001001000",{color:o.calendarDayForegroundSelected,":before":{left:null,right:"50%"}}),R("101000001010000",{":before":{left:null,right:"50%"}}),{"101000001001000":{}},{"101000001001100":{}},{"101000001001010":{}},R("100010010000000",{color:o.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}),{"101000001100000":{color:o.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}},R("100000001100000",{color:o.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}),R("101111000000000",{color:o.calendarDayForegroundSelectedHighlighted}),R("101110100000000",{color:o.calendarDayForegroundSelectedHighlighted,":before":{left:null,right:"50%"}}),R("101010010000000",{color:o.calendarDayForegroundPseudoSelectedHighlighted,":before":{left:"0",width:"100%"}}),R("100000000000001",i),R("100000001010001",i),R("100000001001001",i),R("100010000000001",i));return s[t]||e}var St=x("div",function(t){var r=t.$disabled,o=t.$isFocusVisible,n=t.$isHighlighted,e=t.$peekNextMonth,a=t.$pseudoSelected,i=t.$range,l=t.$selected,u=t.$outsideMonth,s=t.$outsideMonthWithinRange,y=t.$hasDateLabel,p=t.$density,d=t.$hasLockedBehavior,f=t.$selectedInput,c=t.$value,h=t.$theme,g=h.colors,b=h.typography,v=h.sizing,D=vo(t),S;y?p===T.high?S="60px":S="70px":p===T.high?S="40px":S="48px";var P=Array.isArray(c)?c:[c,null],j=Do(P,2),k=j[0],H=j[1],O=f===re.startDate?H!==null&&typeof H<"u":k!==null&&typeof k<"u",M=i&&!(d&&!O);return B(B(B({},p===T.high?b.ParagraphSmall:b.ParagraphMedium),{},{boxSizing:"border-box",position:"relative",cursor:r||!e&&u?"default":"pointer",color:g.calendarForeground,display:"inline-block",width:p===T.high?"42px":"50px",height:S,lineHeight:p===T.high?v.scale700:v.scale900,textAlign:"center",paddingTop:v.scale300,paddingBottom:v.scale300,paddingLeft:v.scale300,paddingRight:v.scale300,marginTop:0,marginBottom:0,marginLeft:0,marginRight:0,outline:"none",backgroundColor:"transparent",transform:"scale(1)"},Dt(D,t.$theme)),{},{":after":B(B({zIndex:-1,content:'""',boxSizing:"border-box",display:"inline-block",boxShadow:o&&(!u||e)?"0 0 0 3px ".concat(g.accent):"none",backgroundColor:l?g.calendarDayBackgroundSelectedHighlighted:a&&n?g.calendarDayBackgroundPseudoSelectedHighlighted:g.calendarBackground,height:y?"100%":p===T.high?"42px":"50px",width:"100%",position:"absolute",top:y?0:"-1px",left:0,paddingTop:v.scale200,paddingBottom:v.scale200,borderLeftWidth:"2px",borderRightWidth:"2px",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderTopColor:g.borderSelected,borderBottomColor:g.borderSelected,borderRightColor:g.borderSelected,borderLeftColor:g.borderSelected,borderTopLeftRadius:y?v.scale800:"100%",borderTopRightRadius:y?v.scale800:"100%",borderBottomLeftRadius:y?v.scale800:"100%",borderBottomRightRadius:y?v.scale800:"100%"},Dt(D,t.$theme)[":after"]||{}),s?{content:null}:{})},M?{":before":B(B({zIndex:-1,content:'""',boxSizing:"border-box",display:"inline-block",backgroundColor:g.mono300,position:"absolute",height:"100%",width:"50%",top:0,left:"50%",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftWidth:"0",borderRightWidth:"0",borderTopStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopColor:"transparent",borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},Dt(D,t.$theme)[":before"]||{}),s?{backgroundColor:g.mono300,left:"0",width:"100%",content:'""'}:{})}:{})});St.displayName="StyledDay",St.displayName="StyledDay";var Ot=x("div",function(t){var r=t.$theme,o=r.typography,n=r.colors,e=t.$selected;return B(B({},o.ParagraphXSmall),{},{color:e?n.contentInverseTertiary:n.contentTertiary})});Ot.displayName="StyledDayLabel",Ot.displayName="StyledDayLabel";var wt=x("div",function(t){var r=t.$theme,o=r.typography,n=r.colors,e=r.sizing,a=t.$density;return B(B({},o.LabelMedium),{},{color:n.contentTertiary,boxSizing:"border-box",position:"relative",cursor:"default",display:"inline-block",width:a===T.high?"42px":"50px",height:a===T.high?"40px":"48px",textAlign:"center",lineHeight:e.scale900,paddingTop:e.scale300,paddingBottom:e.scale300,paddingLeft:e.scale200,paddingRight:e.scale200,marginTop:0,marginBottom:0,marginLeft:0,marginRight:0,backgroundColor:"transparent"})});wt.displayName="StyledWeekdayHeader",wt.displayName="StyledWeekdayHeader";function kt(t){"@babel/helpers - typeof";return kt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},kt(t)}function U(){return U=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},U.apply(this,arguments)}function Q(t,r){return Ho(t)||jo(t,r)||Mo(t,r)||Co()}function Co(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as s,R as g,a6 as f,aJ as b,M as k,j as t,aH as m,aK as C,al as j,a2 as v}from"./index-
|
|
1
|
+
import{c as s,R as g,a6 as f,aJ as b,M as k,j as t,aH as m,aK as C,al as j,a2 as v}from"./index-DuoBWGu3.js";const y=s("div",{target:"e11k5jya2"})({name:"1fttcpj",styles:"display:flex;flex-direction:column"}),w=s("a",{target:"e11k5jya1"})(({disabled:a,isCurrentPage:r,fluidWidth:n,theme:e})=>({textDecoration:"none",width:typeof n=="number"?`${n}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:r?e.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:r?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}}:{}}),""),L=s("span",{target:"e11k5jya0"})(({disabled:a,theme:r})=>({color:r.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...a?{borderColor:r.colors.borderColor,backgroundColor:r.colors.transparent,color:r.colors.fadedText40,cursor:"not-allowed"}:{}}),"");function T(a,r){return a===null&&r?!0:a===null&&!r?!1:a===!0}function P(a){const{onPageChange:r,currentPageScriptHash:n}=g.useContext(f),e=g.useContext(b),{colors:p}=k(),{disabled:l,element:o,width:i}=a,u={width:i},h=T(o.useContainerWidth,e),d=n===o.pageScriptHash,x=c=>{o.external?l&&c.preventDefault():(c.preventDefault(),l||r(o.pageScriptHash))};return t.jsx("div",{className:"stPageLink","data-testid":"stPageLink",style:u,children:t.jsx(m,{help:o.help,placement:C.TOP_RIGHT,children:t.jsx(y,{children:t.jsxs(w,{"data-testid":"stPageLink-NavLink",disabled:l,isCurrentPage:d,fluidWidth:h?i:!1,href:o.page,target:o.external?"_blank":"",rel:"noreferrer",onClick:x,children:[o.icon&&t.jsx(j,{size:"lg",color:p.bodyText,iconValue:o.icon}),t.jsx(L,{disabled:l,children:t.jsx(v,{source:o.label,allowHTML:!1,isLabel:!0,boldLabel:d,largerLabel:!0,disableLinks:!0})})]})})})})}export{P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aG as i,j as t,aH as h,aX as u,aF as m,aI as p}from"./index-
|
|
1
|
+
import{aG as i,j as t,aH as h,aX as u,aF as m,aI as p}from"./index-DuoBWGu3.js";function f(l){const{disabled:d,element:e,widgetMgr:r,width:s,fragmentId:n}=l,o={width:s};let a=i.SECONDARY;e.type==="primary"?a=i.PRIMARY:e.type==="tertiary"&&(a=i.TERTIARY);const c=e.help?s:!0;return t.jsx("div",{className:"stButton","data-testid":"stButton",style:o,children:t.jsx(h,{help:e.help,children:t.jsx(u,{kind:a,size:m.SMALL,disabled:d,fluidWidth:e.useContainerWidth?c:!1,onClick:()=>r.setTriggerValue(e,{fromUi:!0},n),children:t.jsx(p,{icon:e.icon,label:e.label})})})})}export{f as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b2 as q,r as f,b3 as H,b4 as J,M as Q,b5 as l,j as d,a_ as Y,a$ as Z,b6 as ee,b7 as te,b0 as re,aK as ne,aX as oe,aG as _,aF as U,al as ie,a2 as ae}from"./index-
|
|
1
|
+
import{b2 as q,r as f,b3 as H,b4 as J,M as Q,b5 as l,j as d,a_ as Y,a$ as Z,b6 as ee,b7 as te,b0 as re,aK as ne,aX as oe,aG as _,aF as U,al as ie,a2 as ae}from"./index-DuoBWGu3.js";import{a as ce}from"./useBasicWidgetState-DgnZoFWi.js";import"./FormClearHelper-BIZNCxvb.js";var le={primary:"primary",secondary:"secondary",tertiary:"tertiary"},A={default:"default",pill:"pill",round:"round",circle:"circle",square:"square"},ue={mini:"mini",default:"default",compact:"compact",large:"large"},R=Object.freeze({radio:"radio",checkbox:"checkbox"}),T=q("div",function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=r===1?void 0:t!==A.default?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}});T.displayName="StyledRoot",T.displayName="StyledRoot";function G(e){"@babel/helpers - typeof";return G=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},G(e)}function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},z.apply(this,arguments)}function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function se(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?V(Object(r),!0).forEach(function(n){N(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fe(e,t){return be(e)||ye(e,t)||de(e,t)||pe()}function pe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function de(e,t){if(e){if(typeof e=="string")return X(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return X(e,t)}}function X(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ye(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,i=!1,a,u;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(s){i=!0,u=s}finally{try{!o&&r.return!=null&&r.return()}finally{if(i)throw u}}return n}}function be(e){if(Array.isArray(e))return e}function me(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function he(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ge(e,t,r){return he(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Se(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,n){return r.__proto__=n,r},B(e,t)}function ve(e){var t=Ee();return function(){var r=P(e),n;if(t){var o=P(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Oe(this,n)}}function Oe(e,t){if(t&&(G(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return F(e)}function F(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ee(){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 P(e){return P=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},P(e)}function N(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function we(e,t){return!Array.isArray(e)&&typeof e!="number"?!1:Array.isArray(e)?e.includes(t):e===t}var W=function(e){Se(r,e);var t=ve(r);function r(){var n;me(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),N(F(n),"childRefs",{}),n}return ge(r,[{key:"render",value:function(){var n=this,o=this.props,i=o.overrides,a=i===void 0?{}:i,u=o.mode,s=u===void 0?R.checkbox:u,m=o.children,y=o.selected,g=o.disabled,p=o.onClick,b=o.kind,S=o.shape,x=o.size,w=H(a.Root,T),k=fe(w,2),j=k[0],E=k[1],L=this.props["aria-label"]||this.props.ariaLabel,v=s===R.radio,$=f.Children.count(m);return f.createElement(J.Consumer,null,function(K){return f.createElement(j,z({"aria-label":L||K.buttongroup.ariaLabel,"data-baseweb":"button-group",role:v?"radiogroup":"group",$shape:S,$length:m.length},E),f.Children.map(m,function(h,C){if(!f.isValidElement(h))return null;var D=h.props.isSelected?h.props.isSelected:we(y,C);return v&&(n.childRefs[C]=f.createRef()),f.cloneElement(h,{disabled:g||h.props.disabled,isSelected:D,ref:v?n.childRefs[C]:void 0,tabIndex:!v||D||v&&(!y||y===-1)&&C===0?0:-1,onKeyDown:function(c){if(v){var O=Number(y)?Number(y):0;if(c.key==="ArrowUp"||c.key==="ArrowLeft"){c.preventDefault&&c.preventDefault();var I=O-1<0?$-1:O-1;p&&p(c,I),n.childRefs[I].current&&n.childRefs[I].current.focus()}if(c.key==="ArrowDown"||c.key==="ArrowRight"){c.preventDefault&&c.preventDefault();var M=O+1>$-1?0:O+1;p&&p(c,M),n.childRefs[M].current&&n.childRefs[M].current.focus()}}},kind:b,onClick:function(c){g||(h.props.onClick&&h.props.onClick(c),p&&p(c,C))},shape:S,size:x,overrides:se({BaseButton:{style:function(c){var O=c.$theme;return m.length===1?{}:S!==A.default?{marginLeft:O.sizing.scale100,marginRight:O.sizing.scale100}:{marginLeft:"0.5px",marginRight:"0.5px"}},props:{"aria-checked":D,role:v?"radio":"checkbox"}}},h.props.overrides)})}))})}}]),r}(f.Component);N(W,"defaultProps",{disabled:!1,onClick:function(){},shape:A.default,size:ue.default,kind:le.secondary});function je(e,t){return t.includes(e)?t.filter(r=>r!==e):[...t,e]}function Le(e,t,r){return e==l.ClickMode.MULTI_SELECT?je(t,r??[]):r!=null&&r.includes(t)?[]:[t]}function Ce(e){return e.length===0?-1:e[0]}function ke(e,t,r,n){t.setIntArrayValue(e,r.value,{fromUi:r.fromUi},n)}function Re(e,t,r){const n=r===l.Style.PILLS?_.PILLS:r===l.Style.BORDERLESS?_.BORDERLESS_ICON:_.SEGMENTED_CONTROL,o=r===l.Style.BORDERLESS?U.XSMALL:U.MEDIUM,i=r===l.Style.BORDERLESS?"lg":"base";return{element:d.jsxs(d.Fragment,{children:[t&&d.jsx(ie,{size:i,iconValue:t}),e&&d.jsx(ae,{source:e,allowHTML:!1})]}),kind:n,size:o}}function Pe(e,t,r,n){return r.indexOf(n)>-1?!0:t!==l.ClickMode.SINGLE_SELECT||e!==l.SelectionVisualization.ALL_UP_TO_SELECTED?!1:r.length>0&&n<r[0]}function xe(e,t){return e&&(t=`${t}Active`),t}function De(e,t){const r={flexWrap:"wrap",maxWidth:"fit-content"};switch(e){case l.Style.BORDERLESS:return{...r,columnGap:t.threeXS,rowGap:t.threeXS};case l.Style.PILLS:return{...r,columnGap:t.twoXS,rowGap:t.twoXS};case l.Style.SEGMENTED_CONTROL:return{...r,columnGap:t.none,rowGap:t.twoXS,"::after":{content:"''",flex:1e4}};default:return r}}function Ie(e,t,r,n,o,i){const a=Pe(r,n,o,t);let u=e.content,s=e.contentIcon;return a&&(u=e.selectedContent?e.selectedContent:u,s=e.selectedContentIcon?e.selectedContentIcon:s),f.forwardRef(function(m,y){const{element:g,kind:p,size:b}=Re(u??"",s??void 0,i),S=xe(!!(a&&!e.selectedContent&&!e.selectedContentIcon),p);return d.jsx(oe,{...m,size:b,kind:S,children:g})})}function Me(e,t){return e.getIntArrayValue(t)}function _e(e){return e.default??null}function Ae(e){return e.value??null}function Te(e){const{disabled:t,element:r,fragmentId:n,widgetMgr:o}=e,{clickMode:i,options:a,selectionVisualization:u,style:s,label:m,labelVisibility:y,help:g}=r,p=Q(),[b,S]=ce({getStateFromWidgetMgr:Me,getDefaultStateFromProto:_e,getCurrStateFromProto:Ae,updateWidgetMgrState:ke,element:r,widgetMgr:o,fragmentId:n}),x=(j,E)=>{const L=Le(i,E,b);S({value:L,fromUi:!0})};let w;i===l.ClickMode.SINGLE_SELECT?w=R.radio:i===l.ClickMode.MULTI_SELECT&&(w=R.checkbox);const k=f.useMemo(()=>a.map((j,E)=>{const L=Ie(j,E,u,i,b,s);return d.jsx(L,{},`${j.content}-${E}`)}),[i,a,u,s,b]);return d.jsxs("div",{className:"stButtonGroup","data-testid":"stButtonGroup",children:[d.jsx(Y,{label:m,disabled:t,labelVisibility:Z((y==null?void 0:y.value)??ee.LabelVisibilityOptions.COLLAPSED),children:g&&d.jsx(te,{children:d.jsx(re,{content:g,placement:ne.TOP})})}),d.jsx(W,{disabled:t,mode:w,onClick:x,selected:i===l.ClickMode.MULTI_SELECT?b:Ce(b),overrides:{Root:{style:f.useCallback(()=>De(s,p.spacing),[s,p.spacing])}},children:k})]})}const Ge=f.memo(Te);export{Ge as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as u,E as z,_ as B,aj as ht,aS as Vt,aT as _t,aU as $t,B as $,F as H,R as ut,a6 as Ht,c as R,aV as Xt,j as f,aW as Gt,aX as qt,aG as Yt,aY as Zt,O as Kt,M as Jt,aZ as J,S as Qt,$ as te,a_ as ee,a$ as ie,b0 as se,aK as re}from"./index-EOIuoj4I.js";import{u as ne,F as oe}from"./FormClearHelper-D3yotkXf.js";import{T as ae,a as pt}from"./Toolbar-CfaA32cH.js";import{u as le}from"./Hooks-rnMPF1_I.js";import{c as de}from"./createDownloadLinkElement-DZMwyjvU.js";import{F as ce,D as he}from"./FileDownload.esm--KUF2yhQ.js";var mt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(z,B({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("g",{fill:"none"},u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24})),u.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),u.createElement("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});mt.displayName="Mic";var gt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(z,B({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("rect",{width:24,height:24,fill:"none"}),u.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))});gt.displayName="Pause";var ft=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(z,B({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("rect",{width:24,height:24,fill:"none"}),u.createElement("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 000-1.69L9.54 5.98A.998.998 0 008 6.82z"}))});ft.displayName="PlayArrow";var vt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(z,B({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),u.createElement("path",{d:"M17.65 6.35a7.95 7.95 0 00-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 007.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 01-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0112 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z"}))});vt.displayName="Refresh";var bt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(z,B({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("g",{fill:"none"},u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24})),u.createElement("path",{fillRule:"evenodd",d:"M9 16h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}))});bt.displayName="StopCircle";function E(s,t,e,i){return new(e||(e=Promise))(function(n,r){function a(d){try{c(i.next(d))}catch(l){r(l)}}function o(d){try{c(i.throw(d))}catch(l){r(l)}}function c(d){var l;d.done?n(d.value):(l=d.value,l instanceof e?l:new e(function(p){p(l)})).then(a,o)}c((i=i.apply(s,t||[])).next())})}let F=class{constructor(){this.listeners={}}on(s,t,e){if(this.listeners[s]||(this.listeners[s]=new Set),this.listeners[s].add(t),e==null?void 0:e.once){const i=()=>{this.un(s,i),this.un(s,t)};return this.on(s,i),i}return()=>this.un(s,t)}un(s,t){var e;(e=this.listeners[s])===null||e===void 0||e.delete(t)}once(s,t){return this.on(s,t,{once:!0})}unAll(){this.listeners={}}emit(s,...t){this.listeners[s]&&this.listeners[s].forEach(e=>e(...t))}};const yt={decode:function(s,t){return E(this,void 0,void 0,function*(){const e=new AudioContext({sampleRate:t});return e.decodeAudioData(s).finally(()=>e.close())})},createBuffer:function(s,t){return typeof s[0]=="number"&&(s=[s]),function(e){const i=e[0];if(i.some(n=>n>1||n<-1)){const n=i.length;let r=0;for(let a=0;a<n;a++){const o=Math.abs(i[a]);o>r&&(r=o)}for(const a of e)for(let o=0;o<n;o++)a[o]/=r}}(s),{duration:t,length:s[0].length,sampleRate:s[0].length/t,numberOfChannels:s.length,getChannelData:e=>s==null?void 0:s[e],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function wt(s,t){const e=t.xmlns?document.createElementNS(t.xmlns,s):document.createElement(s);for(const[i,n]of Object.entries(t))if(i==="children")for(const[r,a]of Object.entries(t))typeof a=="string"?e.appendChild(document.createTextNode(a)):e.appendChild(wt(r,a));else i==="style"?Object.assign(e.style,n):i==="textContent"?e.textContent=n:e.setAttribute(i,n.toString());return e}function Ct(s,t,e){const i=wt(s,t||{});return e==null||e.appendChild(i),i}var ue=Object.freeze({__proto__:null,createElement:Ct,default:Ct});const pe={fetchBlob:function(s,t,e){return E(this,void 0,void 0,function*(){const i=yield fetch(s,e);if(i.status>=400)throw new Error(`Failed to fetch ${s}: ${i.status} (${i.statusText})`);return function(n,r){E(this,void 0,void 0,function*(){if(!n.body||!n.headers)return;const a=n.body.getReader(),o=Number(n.headers.get("Content-Length"))||0;let c=0;const d=p=>E(this,void 0,void 0,function*(){c+=(p==null?void 0:p.length)||0;const h=Math.round(c/o*100);r(h)}),l=()=>E(this,void 0,void 0,function*(){let p;try{p=yield a.read()}catch{return}p.done||(d(p.value),yield l())});l()})}(i.clone(),t),i.blob()})}};class me extends F{constructor(t){super(),this.isExternalMedia=!1,t.media?(this.media=t.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),t.mediaControls&&(this.media.controls=!0),t.autoplay&&(this.media.autoplay=!0),t.playbackRate!=null&&this.onMediaEvent("canplay",()=>{t.playbackRate!=null&&(this.media.playbackRate=t.playbackRate)},{once:!0})}onMediaEvent(t,e,i){return this.media.addEventListener(t,e,i),()=>this.media.removeEventListener(t,e,i)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const t=this.getSrc();t.startsWith("blob:")&&URL.revokeObjectURL(t)}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,e){const i=this.getSrc();if(t&&i===t)return;this.revokeSrc();const n=e instanceof Blob&&(this.canPlayType(e.type)||!t)?URL.createObjectURL(e):t;try{this.media.src=n}catch{this.media.src=t}}destroy(){this.media.pause(),this.isExternalMedia||(this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(t){this.media=t}play(){return E(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=t}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,e){e!=null&&(this.media.preservesPitch=e),this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){return this.media.setSinkId(t)}}class N extends F{constructor(t,e){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.subscriptions=[],this.options=t;const i=this.parentFromOptionsContainer(t.container);this.parent=i;const[n,r]=this.initHtml();i.appendChild(n),this.container=n,this.scrollContainer=r.querySelector(".scroll"),this.wrapper=r.querySelector(".wrapper"),this.canvasWrapper=r.querySelector(".canvases"),this.progressWrapper=r.querySelector(".progress"),this.cursor=r.querySelector(".cursor"),e&&r.appendChild(e),this.initEvents()}parentFromOptionsContainer(t){let e;if(typeof t=="string"?e=document.querySelector(t):t instanceof HTMLElement&&(e=t),!e)throw new Error("Container not found");return e}initEvents(){const t=e=>{const i=this.wrapper.getBoundingClientRect(),n=e.clientX-i.left,r=e.clientY-i.top;return[n/i.width,r/i.height]};if(this.wrapper.addEventListener("click",e=>{const[i,n]=t(e);this.emit("click",i,n)}),this.wrapper.addEventListener("dblclick",e=>{const[i,n]=t(e);this.emit("dblclick",i,n)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:e,scrollWidth:i,clientWidth:n}=this.scrollContainer,r=e/i,a=(e+n)/i;this.emit("scroll",r,a,e,e+n)}),typeof ResizeObserver=="function"){const e=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{e().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;t===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=t,this.reRender())}initDrag(){this.subscriptions.push(function(t,e,i,n,r=3,a=0,o=100){if(!t)return()=>{};const c=matchMedia("(pointer: coarse)").matches;let d=()=>{};const l=p=>{if(p.button!==a)return;p.preventDefault(),p.stopPropagation();let h=p.clientX,m=p.clientY,g=!1;const b=Date.now(),v=C=>{if(C.preventDefault(),C.stopPropagation(),c&&Date.now()-b<o)return;const P=C.clientX,W=C.clientY,j=P-h,T=W-m;if(g||Math.abs(j)>r||Math.abs(T)>r){const A=t.getBoundingClientRect(),{left:U,top:L}=A;g||(i==null||i(h-U,m-L),g=!0),e(j,T,P-U,W-L),h=P,m=W}},w=C=>{if(g){const P=C.clientX,W=C.clientY,j=t.getBoundingClientRect(),{left:T,top:A}=j;n==null||n(P-T,W-A)}d()},y=C=>{C.relatedTarget&&C.relatedTarget!==document.documentElement||w(C)},M=C=>{g&&(C.stopPropagation(),C.preventDefault())},k=C=>{g&&C.preventDefault()};document.addEventListener("pointermove",v),document.addEventListener("pointerup",w),document.addEventListener("pointerout",y),document.addEventListener("pointercancel",y),document.addEventListener("touchmove",k,{passive:!1}),document.addEventListener("click",M,{capture:!0}),d=()=>{document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",w),document.removeEventListener("pointerout",y),document.removeEventListener("pointercancel",y),document.removeEventListener("touchmove",k),setTimeout(()=>{document.removeEventListener("click",M,{capture:!0})},10)}};return t.addEventListener("pointerdown",l),()=>{d(),t.removeEventListener("pointerdown",l)}}(this.wrapper,(t,e,i)=>{this.emit("drag",Math.max(0,Math.min(1,i/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))}))}getHeight(t,e){var i;const n=((i=this.audioData)===null||i===void 0?void 0:i.numberOfChannels)||1;if(t==null)return 128;if(!isNaN(Number(t)))return Number(t);if(t==="auto"){const r=this.parent.clientHeight||128;return e!=null&&e.every(a=>!a.overlay)?r/n:r}return 128}initHtml(){const t=document.createElement("div"),e=t.attachShadow({mode:"open"}),i=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return e.innerHTML=`
|
|
1
|
+
import{r as u,E as z,_ as B,aj as ht,aS as Vt,aT as _t,aU as $t,B as $,F as H,R as ut,a6 as Ht,c as R,aV as Xt,j as f,aW as Gt,aX as qt,aG as Yt,aY as Zt,O as Kt,M as Jt,aZ as J,S as Qt,$ as te,a_ as ee,a$ as ie,b0 as se,aK as re}from"./index-DuoBWGu3.js";import{u as ne,F as oe}from"./FormClearHelper-BIZNCxvb.js";import{T as ae,a as pt}from"./Toolbar-B1zMj-jg.js";import{u as le}from"./Hooks-C30HoPXz.js";import{c as de}from"./createDownloadLinkElement-DZMwyjvU.js";import{F as ce,D as he}from"./FileDownload.esm-BP72wB_u.js";var mt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(z,B({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("g",{fill:"none"},u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24})),u.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),u.createElement("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});mt.displayName="Mic";var gt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(z,B({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("rect",{width:24,height:24,fill:"none"}),u.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))});gt.displayName="Pause";var ft=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(z,B({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("rect",{width:24,height:24,fill:"none"}),u.createElement("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 000-1.69L9.54 5.98A.998.998 0 008 6.82z"}))});ft.displayName="PlayArrow";var vt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(z,B({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),u.createElement("path",{d:"M17.65 6.35a7.95 7.95 0 00-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 007.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 01-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0112 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z"}))});vt.displayName="Refresh";var bt=u.forwardRef(function(s,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(z,B({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},s,{ref:t}),u.createElement("g",{fill:"none"},u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24})),u.createElement("path",{fillRule:"evenodd",d:"M9 16h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}))});bt.displayName="StopCircle";function E(s,t,e,i){return new(e||(e=Promise))(function(n,r){function a(d){try{c(i.next(d))}catch(l){r(l)}}function o(d){try{c(i.throw(d))}catch(l){r(l)}}function c(d){var l;d.done?n(d.value):(l=d.value,l instanceof e?l:new e(function(p){p(l)})).then(a,o)}c((i=i.apply(s,t||[])).next())})}let F=class{constructor(){this.listeners={}}on(s,t,e){if(this.listeners[s]||(this.listeners[s]=new Set),this.listeners[s].add(t),e==null?void 0:e.once){const i=()=>{this.un(s,i),this.un(s,t)};return this.on(s,i),i}return()=>this.un(s,t)}un(s,t){var e;(e=this.listeners[s])===null||e===void 0||e.delete(t)}once(s,t){return this.on(s,t,{once:!0})}unAll(){this.listeners={}}emit(s,...t){this.listeners[s]&&this.listeners[s].forEach(e=>e(...t))}};const yt={decode:function(s,t){return E(this,void 0,void 0,function*(){const e=new AudioContext({sampleRate:t});return e.decodeAudioData(s).finally(()=>e.close())})},createBuffer:function(s,t){return typeof s[0]=="number"&&(s=[s]),function(e){const i=e[0];if(i.some(n=>n>1||n<-1)){const n=i.length;let r=0;for(let a=0;a<n;a++){const o=Math.abs(i[a]);o>r&&(r=o)}for(const a of e)for(let o=0;o<n;o++)a[o]/=r}}(s),{duration:t,length:s[0].length,sampleRate:s[0].length/t,numberOfChannels:s.length,getChannelData:e=>s==null?void 0:s[e],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function wt(s,t){const e=t.xmlns?document.createElementNS(t.xmlns,s):document.createElement(s);for(const[i,n]of Object.entries(t))if(i==="children")for(const[r,a]of Object.entries(t))typeof a=="string"?e.appendChild(document.createTextNode(a)):e.appendChild(wt(r,a));else i==="style"?Object.assign(e.style,n):i==="textContent"?e.textContent=n:e.setAttribute(i,n.toString());return e}function Ct(s,t,e){const i=wt(s,t||{});return e==null||e.appendChild(i),i}var ue=Object.freeze({__proto__:null,createElement:Ct,default:Ct});const pe={fetchBlob:function(s,t,e){return E(this,void 0,void 0,function*(){const i=yield fetch(s,e);if(i.status>=400)throw new Error(`Failed to fetch ${s}: ${i.status} (${i.statusText})`);return function(n,r){E(this,void 0,void 0,function*(){if(!n.body||!n.headers)return;const a=n.body.getReader(),o=Number(n.headers.get("Content-Length"))||0;let c=0;const d=p=>E(this,void 0,void 0,function*(){c+=(p==null?void 0:p.length)||0;const h=Math.round(c/o*100);r(h)}),l=()=>E(this,void 0,void 0,function*(){let p;try{p=yield a.read()}catch{return}p.done||(d(p.value),yield l())});l()})}(i.clone(),t),i.blob()})}};class me extends F{constructor(t){super(),this.isExternalMedia=!1,t.media?(this.media=t.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),t.mediaControls&&(this.media.controls=!0),t.autoplay&&(this.media.autoplay=!0),t.playbackRate!=null&&this.onMediaEvent("canplay",()=>{t.playbackRate!=null&&(this.media.playbackRate=t.playbackRate)},{once:!0})}onMediaEvent(t,e,i){return this.media.addEventListener(t,e,i),()=>this.media.removeEventListener(t,e,i)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const t=this.getSrc();t.startsWith("blob:")&&URL.revokeObjectURL(t)}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,e){const i=this.getSrc();if(t&&i===t)return;this.revokeSrc();const n=e instanceof Blob&&(this.canPlayType(e.type)||!t)?URL.createObjectURL(e):t;try{this.media.src=n}catch{this.media.src=t}}destroy(){this.media.pause(),this.isExternalMedia||(this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(t){this.media=t}play(){return E(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=t}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,e){e!=null&&(this.media.preservesPitch=e),this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){return this.media.setSinkId(t)}}class N extends F{constructor(t,e){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.subscriptions=[],this.options=t;const i=this.parentFromOptionsContainer(t.container);this.parent=i;const[n,r]=this.initHtml();i.appendChild(n),this.container=n,this.scrollContainer=r.querySelector(".scroll"),this.wrapper=r.querySelector(".wrapper"),this.canvasWrapper=r.querySelector(".canvases"),this.progressWrapper=r.querySelector(".progress"),this.cursor=r.querySelector(".cursor"),e&&r.appendChild(e),this.initEvents()}parentFromOptionsContainer(t){let e;if(typeof t=="string"?e=document.querySelector(t):t instanceof HTMLElement&&(e=t),!e)throw new Error("Container not found");return e}initEvents(){const t=e=>{const i=this.wrapper.getBoundingClientRect(),n=e.clientX-i.left,r=e.clientY-i.top;return[n/i.width,r/i.height]};if(this.wrapper.addEventListener("click",e=>{const[i,n]=t(e);this.emit("click",i,n)}),this.wrapper.addEventListener("dblclick",e=>{const[i,n]=t(e);this.emit("dblclick",i,n)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:e,scrollWidth:i,clientWidth:n}=this.scrollContainer,r=e/i,a=(e+n)/i;this.emit("scroll",r,a,e,e+n)}),typeof ResizeObserver=="function"){const e=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{e().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;t===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=t,this.reRender())}initDrag(){this.subscriptions.push(function(t,e,i,n,r=3,a=0,o=100){if(!t)return()=>{};const c=matchMedia("(pointer: coarse)").matches;let d=()=>{};const l=p=>{if(p.button!==a)return;p.preventDefault(),p.stopPropagation();let h=p.clientX,m=p.clientY,g=!1;const b=Date.now(),v=C=>{if(C.preventDefault(),C.stopPropagation(),c&&Date.now()-b<o)return;const P=C.clientX,W=C.clientY,j=P-h,T=W-m;if(g||Math.abs(j)>r||Math.abs(T)>r){const A=t.getBoundingClientRect(),{left:U,top:L}=A;g||(i==null||i(h-U,m-L),g=!0),e(j,T,P-U,W-L),h=P,m=W}},w=C=>{if(g){const P=C.clientX,W=C.clientY,j=t.getBoundingClientRect(),{left:T,top:A}=j;n==null||n(P-T,W-A)}d()},y=C=>{C.relatedTarget&&C.relatedTarget!==document.documentElement||w(C)},M=C=>{g&&(C.stopPropagation(),C.preventDefault())},k=C=>{g&&C.preventDefault()};document.addEventListener("pointermove",v),document.addEventListener("pointerup",w),document.addEventListener("pointerout",y),document.addEventListener("pointercancel",y),document.addEventListener("touchmove",k,{passive:!1}),document.addEventListener("click",M,{capture:!0}),d=()=>{document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",w),document.removeEventListener("pointerout",y),document.removeEventListener("pointercancel",y),document.removeEventListener("touchmove",k),setTimeout(()=>{document.removeEventListener("click",M,{capture:!0})},10)}};return t.addEventListener("pointerdown",l),()=>{d(),t.removeEventListener("pointerdown",l)}}(this.wrapper,(t,e,i)=>{this.emit("drag",Math.max(0,Math.min(1,i/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))}))}getHeight(t,e){var i;const n=((i=this.audioData)===null||i===void 0?void 0:i.numberOfChannels)||1;if(t==null)return 128;if(!isNaN(Number(t)))return Number(t);if(t==="auto"){const r=this.parent.clientHeight||128;return e!=null&&e.every(a=>!a.overlay)?r/n:r}return 128}initHtml(){const t=document.createElement("div"),e=t.attachShadow({mode:"open"}),i=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return e.innerHTML=`
|
|
2
2
|
<style${i?` nonce="${i}"`:""}>
|
|
3
3
|
:host {
|
|
4
4
|
user-select: none;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,E as P,_ as $,c as R,ak as se,bZ as ne,F as K,c7 as y,B as m,j as l,a_ as de,a$ as ue,bc as ce,b0 as pe,aK as me,aY as G}from"./index-
|
|
1
|
+
import{r,E as P,_ as $,c as R,ak as se,bZ as ne,F as K,c7 as y,B as m,j as l,a_ as de,a$ as ue,bc as ce,b0 as pe,aK as me,aY as G}from"./index-DuoBWGu3.js";import{s as be}from"./sprintf-C-r3gIuM.js";import{u as ge}from"./uniqueId-D81S8Chc.js";import{u as fe}from"./FormClearHelper-BIZNCxvb.js";import{I as he}from"./InputInstructions-B9wXy3U4.js";import{I as ye}from"./input-OLwqq6dJ.js";import"./base-input-CMN1_Ew_.js";var X=r.forwardRef(function(e,t){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(P,$({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:t}),r.createElement("path",{d:"M0 3v2h8V3H0z"}))});X.displayName="Minus";var Y=r.forwardRef(function(e,t){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(P,$({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:t}),r.createElement("path",{d:"M3 0v3H0v2h3v3h2V5h3V3H5V0H3z"}))});Y.displayName="Plus";const we=R("div",{target:"e116k4er3"})(({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:e.sizes.minElementHeight,borderWidth:e.sizes.borderWidth,borderStyle:"solid",borderColor:e.colors.widgetBorderColor||e.colors.widgetBackgroundColor||e.colors.bgColor,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:e.radii.default,overflow:"hidden","&.focused":{borderColor:e.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:e.spacing.none}}}),""),ve=R("div",{target:"e116k4er2"})({name:"76z9jo",styles:"display:flex;flex-direction:row;align-self:stretch"}),Z=R("button",{target:"e116k4er1"})(({theme:e})=>({margin:e.spacing.none,border:"none",height:e.sizes.full,display:"flex",alignItems:"center",width:e.sizes.numberInputControlsWidth,justifyContent:"center",color:e.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:e.colors.widgetBackgroundColor||e.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:e.colors.white,backgroundColor:e.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:last-of-type":{borderTopRightRadius:e.radii.default,borderBottomRightRadius:e.radii.default},"&:disabled":{cursor:"not-allowed",color:e.colors.fadedText40}}),""),xe=R("div",{target:"e116k4er0"})(({theme:e,clearable:t})=>({position:"absolute",marginRight:e.spacing.twoXS,left:0,right:`calc(${e.sizes.numberInputControlsWidth} * 2 + ${t?"1em":"0em"})`}),"");function Ie(e){return m(e)||e===""?void 0:e}const Te=e=>(e.element.dataType===y.DataType.INT?e.widgetMgr.getIntValue(e.element):e.widgetMgr.getDoubleValue(e.element))??e.element.default??null,q=({step:e,dataType:t})=>e||(t===y.DataType.INT?1:.01),N=({value:e,format:t,step:a,dataType:w})=>{if(m(e))return null;let i=Ie(t);if(m(i)&&K(a)){const c=a.toString();w===y.DataType.FLOAT&&a!==0&&c.includes(".")&&(i=`%0.${c.split(".")[1].length}f`)}if(m(i))return e.toString();try{return be.sprintf(i,e)}catch{return String(e)}},ke=(e,t,a)=>m(e)?!1:e-t>=a,Ce=(e,t,a)=>m(e)?!1:e+t<=a,Re=({disabled:e,element:t,widgetMgr:a,width:w,theme:i,fragmentId:c})=>{var O;const{dataType:S,id:V,formId:p,default:B,format:F}=t,b=t.hasMin?t.min:-1/0,g=t.hasMax?t.max:1/0,[s,J]=r.useState(q(t)),M=Te({element:t,widgetMgr:a}),[f,v]=r.useState(!1),[n,x]=r.useState(M),[W,I]=r.useState(N({value:M,...t,step:s})),[A,U]=r.useState(!1),j=r.useRef(null),H=r.useRef(ge("number_input_")),T=ke(n,s,b),k=Ce(n,s,g),_=ne({formId:p}),Q=_?a.allowFormEnterToSubmit(p):f,ee=A&&w>i.breakpoints.hideWidgetDetails;r.useEffect(()=>{J(q({step:t.step,dataType:t.dataType}))},[t.dataType,t.step]);const d=r.useCallback(({value:o,source:u})=>{var h;if(K(o)&&(b>o||o>g))(h=j.current)==null||h.reportValidity();else{const C=o??B??null;switch(S){case y.DataType.INT:a.setIntValue({id:V,formId:p},C,u,c);break;case y.DataType.FLOAT:a.setDoubleValue({id:V,formId:p},C,u,c);break;default:throw new Error("Invalid data type")}v(!1),x(C),I(N({value:C,dataType:S,format:F,step:s}))}},[b,g,j,a,c,s,S,V,p,B,F]),te=r.useCallback(()=>{f&&d({value:n,source:{fromUi:!0}}),U(!1)},[f,n,d]),re=r.useCallback(()=>{U(!0)},[]),L=r.useCallback(()=>{const{value:o}=t;t.setValue=!1,x(o??null),I(N({value:o??null,...t,step:s})),d({value:o??null,source:{fromUi:!1}})},[t,s,d]);r.useEffect(()=>{t.setValue?L():d({value:n,source:{fromUi:!1}})},[]),t.setValue&&L();const z=m(t.default)&&!e,ae=r.useCallback(()=>{const o=t.default??null;x(o),d({value:o,source:{fromUi:!0}})},[t]);fe({element:t,widgetMgr:a,onFormCleared:ae});const oe=o=>{const{value:u}=o.target;if(u==="")v(!0),x(null),I(null);else{let h;t.dataType===y.DataType.INT?h=parseInt(u,10):h=parseFloat(u),v(!0),x(h),I(u)}},D=r.useCallback(()=>{k&&(v(!0),d({value:(n??b)+s,source:{fromUi:!0}}))},[n,b,s,k]),E=r.useCallback(()=>{T&&(v(!0),d({value:(n??g)-s,source:{fromUi:!0}}))},[n,g,s,T]),ie=r.useCallback(o=>{const{key:u}=o;switch(u){case"ArrowUp":o.preventDefault(),D();break;case"ArrowDown":o.preventDefault(),E();break}},[D,E]),le=r.useCallback(o=>{o.key==="Enter"&&(f&&d({value:n,source:{fromUi:!0}}),a.allowFormEnterToSubmit(p)&&a.submitForm(p,c))},[f,n,d,a,p,c]);return l.jsxs("div",{className:"stNumberInput","data-testid":"stNumberInput",style:{width:w},children:[l.jsx(de,{label:t.label,disabled:e,labelVisibility:ue((O=t.labelVisibility)==null?void 0:O.value),htmlFor:H.current,children:t.help&&l.jsx(ce,{children:l.jsx(pe,{content:t.help,placement:me.TOP_RIGHT})})}),l.jsxs(we,{className:A?"focused":"","data-testid":"stNumberInputContainer",children:[l.jsx(ye,{type:"number",inputRef:j,value:W??"",placeholder:t.placeholder,onBlur:te,onFocus:re,onChange:oe,onKeyPress:le,onKeyDown:ie,clearable:z,clearOnEscape:z,disabled:e,"aria-label":t.label,id:H.current,overrides:{ClearIconContainer:{style:{padding:0}},ClearIcon:{props:{overrides:{Svg:{style:{color:i.colors.darkGray,padding:i.spacing.threeXS,height:i.sizes.clearIconSize,width:i.sizes.clearIconSize,":hover":{fill:i.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInputField",step:s,min:b,max:g,type:"number",inputMode:""},style:{lineHeight:i.lineHeights.inputWidget,paddingRight:i.spacing.sm,paddingLeft:i.spacing.sm,paddingBottom:i.spacing.sm,paddingTop:i.spacing.sm}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:{borderTopRightRadius:0,borderBottomRightRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingRight:0}}}}),w>i.breakpoints.hideNumberInputControls&&l.jsxs(ve,{children:[l.jsx(Z,{"data-testid":"stNumberInputStepDown",onClick:E,disabled:!T||e,tabIndex:-1,children:l.jsx(G,{content:X,size:"xs",color:T?"inherit":"disabled"})}),l.jsx(Z,{"data-testid":"stNumberInputStepUp",onClick:D,disabled:!k||e,tabIndex:-1,children:l.jsx(G,{content:Y,size:"xs",color:k?"inherit":"disabled"})})]})]}),ee&&l.jsx(xe,{clearable:z,children:l.jsx(he,{dirty:f,value:W??"",inForm:_,allowEnterToSubmit:Q})})]})},Se=se(Re);export{Se as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var rN;import{g as vw,a9 as Zl,B as yg,J as bw,aa as oN,ab as aN,ac as ms,ad as Af,S as na,ae as sN,af as lN,ag as xw,ah as uN,C as cN,Q as fN,c as dN,M as hN,j as tu,r as pN,F as _w,a7 as mN,$ as vg,ai as gN,aj as ww}from"./index-
|
|
1
|
+
var rN;import{g as vw,a9 as Zl,B as yg,J as bw,aa as oN,ab as aN,ac as ms,ad as Af,S as na,ae as sN,af as lN,ag as xw,ah as uN,C as cN,Q as fN,c as dN,M as hN,j as tu,r as pN,F as _w,a7 as mN,$ as vg,ai as gN,aj as ww}from"./index-DuoBWGu3.js";import{a as eu,n as yN,b as vN,c as Cf,t as ia,f as bN,d as bg,p as xN,e as _N,g as wN,h as kw,i as kN,j as no,k as nu,l as EN,m as $N,o as SN,q as DN,r as Ff,s as Ew,u as gs,v as xg,w as Mf,x as $w,y as io,z as ys,A as AN,B as ro,C as CN,D as FN,E as MN,F as TN}from"./threshold-C19zgWBv.js";import{d as _g,e as wg,R as Tf,C as kg,r as Sw,b as Dw,a as Aw,h as Of,c as Eg,n as Me,f as ON,g as NN,i as zN,j as RN,k as LN,l as PN,m as BN,o as Nf}from"./string-Bl9OLDCw.js";import{i as jN,a as IN,n as UN,T as qN,t as WN}from"./timer-C68DGyYc.js";import{F as HN}from"./FormClearHelper-BIZNCxvb.js";import{S as Cw,T as VN}from"./Toolbar-B1zMj-jg.js";import{w as GN,u as YN,E as XN}from"./withFullScreenWrapper-BzdPuFtI.js";/*!
|
|
2
2
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
3
3
|
* (c) 2017-2022 Joachim Wester
|
|
4
4
|
* MIT licensed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as r,F as c,j as l,aB as d,aC as n,B as g}from"./index-
|
|
1
|
+
import{c as r,F as c,j as l,aB as d,aC as n,B as g}from"./index-DuoBWGu3.js";const h=r("iframe",{target:"e1u6k47s0"})(({theme:a,disableScrolling:e})=>({colorScheme:"normal",border:"none",padding:a.spacing.none,margin:a.spacing.none,overflow:e?"hidden":void 0}),"");function m({element:a,width:e}){const i=a.hasWidth?a.width:e,o=s(a.src),t=c(o)?void 0:s(a.srcdoc);return l.jsx(h,{className:"stIFrame","data-testid":"stIFrame",allow:d,disableScrolling:!a.scrolling,src:o,srcDoc:t,width:i,height:a.height,scrolling:a.scrolling?"auto":"no",sandbox:n,title:"st.iframe"})}function s(a){return g(a)||a===""?void 0:a}export{m as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b2 as w,r as p,bd as ne,be as x,bf as R,M as ae,a5 as le,j as F,bg as ce,bh as se,Q as de,bi as ue,a$ as ge,a2 as be,b7 as pe,b0 as he,aK as me}from"./index-
|
|
1
|
+
import{b2 as w,r as p,bd as ne,be as x,bf as R,M as ae,a5 as le,j as F,bg as ce,bh as se,Q as de,bi as ue,a$ as ge,a2 as be,b7 as pe,b0 as he,aK as me}from"./index-DuoBWGu3.js";import{a as fe}from"./useBasicWidgetState-DgnZoFWi.js";import"./FormClearHelper-BIZNCxvb.js";var T=Object.freeze({default:"default",toggle:"toggle",toggle_round:"toggle"}),ve=Object.freeze({top:"top",right:"right",bottom:"bottom",left:"left"});function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(c){return Object.getOwnPropertyDescriptor(e,c).enumerable})),r.push.apply(r,o)}return r}function j(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?X(Object(r),!0).forEach(function(o){q(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}function q(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ye(e){var t=e.$disabled,r=e.$checked,o=e.$error,c=e.$isIndeterminate,n=e.$theme,a=e.$isFocusVisible,l=n.colors;return t?l.tickFillDisabled:r||c?"transparent":o?l.borderNegative:a?l.borderSelected:l.tickBorder}function ke(e){var t=e.$labelPlacement,r=t===void 0?"":t,o=e.$theme,c=o.sizing,n=c.scale300,a;switch(r){case"top":a="Bottom";break;case"bottom":a="Top";break;case"left":a="Right";break;default:case"right":a="Left";break}return o.direction==="rtl"&&a==="Left"?a="Right":o.direction==="rtl"&&a==="Right"&&(a="Left"),q({},"padding".concat(a),n)}function $e(e){var t=e.$disabled,r=e.$checked,o=e.$isIndeterminate,c=e.$error,n=e.$isHovered,a=e.$isActive,l=e.$theme,i=l.colors;return t?r||o?i.tickFillDisabled:i.tickFill:c&&(o||r)?a?i.tickFillErrorSelectedHoverActive:n?i.tickFillErrorSelectedHover:i.tickFillErrorSelected:c?a?i.tickFillErrorHoverActive:n?i.tickFillErrorHover:i.tickFillError:o||r?a?i.tickFillSelectedHoverActive:n?i.tickFillSelectedHover:i.tickFillSelected:a?i.tickFillActive:n?i.tickFillHover:i.tickFill}function we(e){var t=e.$disabled,r=e.$theme,o=r.colors;return t?o.contentSecondary:o.contentPrimary}var C=w("label",function(e){var t=e.$disabled,r=e.$labelPlacement;return{flexDirection:r==="top"||r==="bottom"?"column":"row",display:"flex",alignItems:r==="top"||r==="bottom"?"center":"flex-start",cursor:t?"not-allowed":"pointer",userSelect:"none"}});C.displayName="Root",C.displayName="Root";var M=w("span",function(e){var t=e.$checked,r=e.$disabled,o=e.$error,c=e.$isIndeterminate,n=e.$theme,a=e.$isFocusVisible,l=n.sizing,i=n.animation,s=r?n.colors.tickMarkFillDisabled:o?n.colors.tickMarkFillError:n.colors.tickMarkFill,k=encodeURIComponent(`
|
|
2
2
|
<svg width="14" height="4" viewBox="0 0 14 4" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3
3
|
<path d="M14 0.5H0V3.5H14V0.5Z" fill="`.concat(s,`"/>
|
|
4
4
|
</svg>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as u,E as _,_ as q,bS as Mt,bT as k,bU as U,bV as Rt,R as We,bW as d,c as m,j as c,aY as P,aX as J,aG as Q,aF as Bt,bX as Lt,bY as Tt,av as Vt,$ as Ht,aS as Nt,as as Ge,B as M,aU as $t,aT as Kt,a_ as Xt,a$ as Wt,bc as Gt,b0 as Yt,aK as _t}from"./index-
|
|
1
|
+
import{r as u,E as _,_ as q,bS as Mt,bT as k,bU as U,bV as Rt,R as We,bW as d,c as m,j as c,aY as P,aX as J,aG as Q,aF as Bt,bX as Lt,bY as Tt,av as Vt,$ as Ht,aS as Nt,as as Ge,B as M,aU as $t,aT as Kt,a_ as Xt,a$ as Wt,bc as Gt,b0 as Yt,aK as _t}from"./index-DuoBWGu3.js";import{F as qt}from"./FormClearHelper-BIZNCxvb.js";import{P as Jt,S as Qt}from"./ProgressBar-BlPlcnwu.js";import{u as Zt}from"./Hooks-C30HoPXz.js";import{U as Z}from"./UploadFileInfo-C-jY39rj.js";var Ye=u.forwardRef(function(e,n){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(_,q({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:n}),u.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),u.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}))});Ye.displayName="Clear";var _e=u.forwardRef(function(e,n){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(_,q({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:n}),u.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),u.createElement("path",{d:"M19.35 10.04A7.49 7.49 0 0012 4C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 000 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95A5.469 5.469 0 0112 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11A2.98 2.98 0 0122 15c0 1.65-1.35 3-3 3zM8 13h2.55v3h2.9v-3H16l-4-4z"}))});_e.displayName="CloudUpload";var qe=u.forwardRef(function(e,n){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(_,q({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:n}),u.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}))});qe.displayName="Error";var Je=u.forwardRef(function(e,n){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(_,q({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:n}),u.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),u.createElement("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"}))});Je.displayName="InsertDriveFile";var R=(e=>(e.Gigabyte="gb",e.Megabyte="mb",e.Kilobyte="kb",e.Byte="b",e))(R||{});const Fe=Mt()?1024:1e3,ee=["gb","mb","kb","b"],te=(e,n,t=1)=>{if(n||(n="b"),t<0&&(t=0),e<0)throw new Error("Size must be greater than or equal to 0");const r=ee.indexOf(n),i=e/Fe;return r&&e>Fe/2?te(i,ee[r-1],t):`${e.toFixed(t)}${n.toUpperCase()}`},en=(e,n,t)=>{if(e<0)throw Error("Size must be 0 or greater");const r=ee.findIndex(s=>s===n),i=ee.findIndex(s=>s===t);if(r===-1||i===-1)throw Error("Unexpected byte unit provided");if(r===i)return e;const o=Math.abs(r-i),l=Fe**o;return r>i?e/l:e*l};var tn=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function T(e,n){var t=nn(e);if(typeof t.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(t,"path",{value:typeof n=="string"?n:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return t}function nn(e){var n=e.name,t=n&&n.lastIndexOf(".")!==-1;if(t&&!e.type){var r=n.split(".").pop().toLowerCase(),i=tn.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var rn=[".DS_Store","Thumbs.db"];function on(e){return k(this,void 0,void 0,function(){return U(this,function(n){return ne(e)&&an(e)?[2,un(e.dataTransfer,e.type)]:sn(e)?[2,ln(e)]:Array.isArray(e)&&e.every(function(t){return"getFile"in t&&typeof t.getFile=="function"})?[2,cn(e)]:[2,[]]})})}function an(e){return ne(e.dataTransfer)}function sn(e){return ne(e)&&ne(e.target)}function ne(e){return typeof e=="object"&&e!==null}function ln(e){return je(e.target.files).map(function(n){return T(n)})}function cn(e){return k(this,void 0,void 0,function(){var n;return U(this,function(t){switch(t.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return n=t.sent(),[2,n.map(function(r){return T(r)})]}})})}function un(e,n){return k(this,void 0,void 0,function(){var t,r;return U(this,function(i){switch(i.label){case 0:return e===null?[2,[]]:e.items?(t=je(e.items).filter(function(o){return o.kind==="file"}),n!=="drop"?[2,t]:[4,Promise.all(t.map(pn))]):[3,2];case 1:return r=i.sent(),[2,Qe(Ze(r))];case 2:return[2,Qe(je(e.files).map(function(o){return T(o)}))]}})})}function Qe(e){return e.filter(function(n){return rn.indexOf(n.name)===-1})}function je(e){if(e===null)return[];for(var n=[],t=0;t<e.length;t++){var r=e[t];n.push(r)}return n}function pn(e){if(typeof e.webkitGetAsEntry!="function")return et(e);var n=e.webkitGetAsEntry();return n&&n.isDirectory?tt(n):et(e)}function Ze(e){return e.reduce(function(n,t){return Rt(n,Array.isArray(t)?Ze(t):[t])},[])}function et(e){var n=e.getAsFile();if(!n)return Promise.reject(e+" is not a File");var t=T(n);return Promise.resolve(t)}function dn(e){return k(this,void 0,void 0,function(){return U(this,function(n){return[2,e.isDirectory?tt(e):fn(e)]})})}function tt(e){var n=e.createReader();return new Promise(function(t,r){var i=[];function o(){var l=this;n.readEntries(function(s){return k(l,void 0,void 0,function(){var f,h,w;return U(this,function(y){switch(y.label){case 0:if(s.length)return[3,5];y.label=1;case 1:return y.trys.push([1,3,,4]),[4,Promise.all(i)];case 2:return f=y.sent(),t(f),[3,4];case 3:return h=y.sent(),r(h),[3,4];case 4:return[3,6];case 5:w=Promise.all(s.map(dn)),i.push(w),o(),y.label=6;case 6:return[2]}})})},function(s){r(s)})}o()})}function fn(e){return k(this,void 0,void 0,function(){return U(this,function(n){return[2,new Promise(function(t,r){e.file(function(i){var o=T(i,e.fullPath);t(o)},function(i){r(i)})})]})})}var gn=function(e,n){if(e&&n){var t=Array.isArray(n)?n:n.split(","),r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return t.some(function(l){var s=l.trim().toLowerCase();return s.charAt(0)==="."?r.toLowerCase().endsWith(s):s.endsWith("/*")?o===s.replace(/\/.*$/,""):i===s})}return!0};function nt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,r)}return t}function rt(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?nt(Object(t),!0).forEach(function(r){it(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):nt(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function it(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function ot(e,n){return yn(e)||vn(e,n)||hn(e,n)||mn()}function mn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hn(e,n){if(e){if(typeof e=="string")return at(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return at(e,n)}}function at(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function vn(e,n){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var r=[],i=!0,o=!1,l,s;try{for(t=t.call(e);!(i=(l=t.next()).done)&&(r.push(l.value),!(n&&r.length===n));i=!0);}catch(f){o=!0,s=f}finally{try{!i&&t.return!=null&&t.return()}finally{if(o)throw s}}return r}}function yn(e){if(Array.isArray(e))return e}var bn="file-invalid-type",xn="file-too-large",wn="file-too-small",Fn="too-many-files",jn=function(e){e=Array.isArray(e)&&e.length===1?e[0]:e;var n=Array.isArray(e)?"one of ".concat(e.join(", ")):e;return{code:bn,message:"File type must be ".concat(n)}},st=function(e){return{code:xn,message:"File is larger than ".concat(e," ").concat(e===1?"byte":"bytes")}},lt=function(e){return{code:wn,message:"File is smaller than ".concat(e," ").concat(e===1?"byte":"bytes")}},Dn={code:Fn,message:"Too many files"};function ct(e,n){var t=e.type==="application/x-moz-file"||gn(e,n);return[t,t?null:jn(n)]}function ut(e,n,t){if(V(e.size))if(V(n)&&V(t)){if(e.size>t)return[!1,st(t)];if(e.size<n)return[!1,lt(n)]}else{if(V(n)&&e.size<n)return[!1,lt(n)];if(V(t)&&e.size>t)return[!1,st(t)]}return[!0,null]}function V(e){return e!=null}function Sn(e){var n=e.files,t=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,l=e.maxFiles;return!o&&n.length>1||o&&l>=1&&n.length>l?!1:n.every(function(s){var f=ct(s,t),h=ot(f,1),w=h[0],y=ut(s,r,i),z=ot(y,1),B=z[0];return w&&B})}function re(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function ie(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(n){return n==="Files"||n==="application/x-moz-file"}):!!e.target&&!!e.target.files}function pt(e){e.preventDefault()}function zn(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function An(e){return e.indexOf("Edge/")!==-1}function On(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return zn(e)||An(e)}function S(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),l=1;l<i;l++)o[l-1]=arguments[l];return n.some(function(s){return!re(r)&&s&&s.apply(void 0,[r].concat(o)),re(r)})}}function En(){return"showOpenFilePicker"in window}function Cn(e){return e=typeof e=="string"?e.split(","):e,[{description:"everything",accept:Array.isArray(e)?e.filter(function(n){return n==="audio/*"||n==="video/*"||n==="image/*"||n==="text/*"||/\w+\/[-+.\w]+/g.test(n)}).reduce(function(n,t){return rt(rt({},n),{},it({},t,[]))},{}):{}}]}function In(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function kn(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}var Un=["children"],Pn=["open"],Mn=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],Rn=["refKey","onChange","onClick"];function Bn(e){return Vn(e)||Tn(e)||dt(e)||Ln()}function Ln(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Vn(e){if(Array.isArray(e))return Se(e)}function De(e,n){return $n(e)||Nn(e,n)||dt(e,n)||Hn()}function Hn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dt(e,n){if(e){if(typeof e=="string")return Se(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Se(e,n)}}function Se(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function Nn(e,n){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var r=[],i=!0,o=!1,l,s;try{for(t=t.call(e);!(i=(l=t.next()).done)&&(r.push(l.value),!(n&&r.length===n));i=!0);}catch(f){o=!0,s=f}finally{try{!i&&t.return!=null&&t.return()}finally{if(o)throw s}}return r}}function $n(e){if(Array.isArray(e))return e}function ft(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,r)}return t}function g(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?ft(Object(t),!0).forEach(function(r){ze(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ft(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function ze(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function oe(e,n){if(e==null)return{};var t=Kn(e,n),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(t[r]=e[r])}return t}function Kn(e,n){if(e==null)return{};var t={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(n.indexOf(i)>=0)&&(t[i]=e[i]);return t}var ae=u.forwardRef(function(e,n){var t=e.children,r=oe(e,Un),i=Xn(r),o=i.open,l=oe(i,Pn);return u.useImperativeHandle(n,function(){return{open:o}},[o]),We.createElement(u.Fragment,null,t(g(g({},l),{},{open:o})))});ae.displayName="Dropzone";var gt={disabled:!1,getFilesFromEvent:on,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0};ae.defaultProps=gt,ae.propTypes={children:d.func,accept:d.oneOfType([d.string,d.arrayOf(d.string)]),multiple:d.bool,preventDropOnDocument:d.bool,noClick:d.bool,noKeyboard:d.bool,noDrag:d.bool,noDragEventsBubbling:d.bool,minSize:d.number,maxSize:d.number,maxFiles:d.number,disabled:d.bool,getFilesFromEvent:d.func,onFileDialogCancel:d.func,onFileDialogOpen:d.func,useFsAccessApi:d.bool,onDragEnter:d.func,onDragLeave:d.func,onDragOver:d.func,onDrop:d.func,onDropAccepted:d.func,onDropRejected:d.func,validator:d.func};var Ae={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function Xn(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=g(g({},gt),e),t=n.accept,r=n.disabled,i=n.getFilesFromEvent,o=n.maxSize,l=n.minSize,s=n.multiple,f=n.maxFiles,h=n.onDragEnter,w=n.onDragLeave,y=n.onDragOver,z=n.onDrop,B=n.onDropAccepted,se=n.onDropRejected,le=n.onFileDialogCancel,ce=n.onFileDialogOpen,Ee=n.useFsAccessApi,ue=n.preventDropOnDocument,Ce=n.noClick,pe=n.noKeyboard,Ie=n.noDrag,A=n.noDragEventsBubbling,de=n.validator,fe=u.useMemo(function(){return typeof ce=="function"?ce:mt},[ce]),H=u.useMemo(function(){return typeof le=="function"?le:mt},[le]),F=u.useRef(null),j=u.useRef(null),Ot=u.useReducer(Wn,Ae),ke=De(Ot,2),N=ke[0],x=ke[1],Et=N.isFocused,Ue=N.isFileDialogActive,Pe=N.draggedFiles,$=u.useRef(typeof window<"u"&&window.isSecureContext&&Ee&&En()),Me=function(){!$.current&&Ue&&setTimeout(function(){if(j.current){var a=j.current.files;a.length||(x({type:"closeDialog"}),H())}},300)};u.useEffect(function(){return window.addEventListener("focus",Me,!1),function(){window.removeEventListener("focus",Me,!1)}},[j,Ue,H,$]);var O=u.useRef([]),Re=function(a){F.current&&F.current.contains(a.target)||(a.preventDefault(),O.current=[])};u.useEffect(function(){return ue&&(document.addEventListener("dragover",pt,!1),document.addEventListener("drop",Re,!1)),function(){ue&&(document.removeEventListener("dragover",pt),document.removeEventListener("drop",Re))}},[F,ue]);var Be=u.useCallback(function(a){a.preventDefault(),a.persist(),G(a),O.current=[].concat(Bn(O.current),[a.target]),ie(a)&&Promise.resolve(i(a)).then(function(p){re(a)&&!A||(x({draggedFiles:p,isDragActive:!0,type:"setDraggedFiles"}),h&&h(a))})},[i,h,A]),Le=u.useCallback(function(a){a.preventDefault(),a.persist(),G(a);var p=ie(a);if(p&&a.dataTransfer)try{a.dataTransfer.dropEffect="copy"}catch{}return p&&y&&y(a),!1},[y,A]),Te=u.useCallback(function(a){a.preventDefault(),a.persist(),G(a);var p=O.current.filter(function(b){return F.current&&F.current.contains(b)}),v=p.indexOf(a.target);v!==-1&&p.splice(v,1),O.current=p,!(p.length>0)&&(x({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),ie(a)&&w&&w(a))},[F,w,A]),K=u.useCallback(function(a,p){var v=[],b=[];a.forEach(function(D){var L=ct(D,t),I=De(L,2),me=I[0],he=I[1],ve=ut(D,l,o),Y=De(ve,2),ye=Y[0],be=Y[1],xe=de?de(D):null;if(me&&ye&&!xe)v.push(D);else{var we=[he,be];xe&&(we=we.concat(xe)),b.push({file:D,errors:we.filter(function(Pt){return Pt})})}}),(!s&&v.length>1||s&&f>=1&&v.length>f)&&(v.forEach(function(D){b.push({file:D,errors:[Dn]})}),v.splice(0)),x({acceptedFiles:v,fileRejections:b,type:"setFiles"}),z&&z(v,b,p),b.length>0&&se&&se(b,p),v.length>0&&B&&B(v,p)},[x,s,t,l,o,f,z,B,se,de]),X=u.useCallback(function(a){a.preventDefault(),a.persist(),G(a),O.current=[],ie(a)&&Promise.resolve(i(a)).then(function(p){re(a)&&!A||K(p,a)}),x({type:"reset"})},[i,K,A]),E=u.useCallback(function(){if($.current){x({type:"openDialog"}),fe();var a={multiple:s,types:Cn(t)};window.showOpenFilePicker(a).then(function(p){return i(p)}).then(function(p){K(p,null),x({type:"closeDialog"})}).catch(function(p){In(p)?(H(p),x({type:"closeDialog"})):kn(p)&&($.current=!1,j.current&&(j.current.value=null,j.current.click()))});return}j.current&&(x({type:"openDialog"}),fe(),j.current.value=null,j.current.click())},[x,fe,H,Ee,K,t,s]),Ve=u.useCallback(function(a){!F.current||!F.current.isEqualNode(a.target)||(a.key===" "||a.key==="Enter"||a.keyCode===32||a.keyCode===13)&&(a.preventDefault(),E())},[F,E]),He=u.useCallback(function(){x({type:"focus"})},[]),Ne=u.useCallback(function(){x({type:"blur"})},[]),$e=u.useCallback(function(){Ce||(On()?setTimeout(E,0):E())},[Ce,E]),C=function(a){return r?null:a},ge=function(a){return pe?null:C(a)},W=function(a){return Ie?null:C(a)},G=function(a){A&&a.stopPropagation()},Ct=u.useMemo(function(){return function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},p=a.refKey,v=p===void 0?"ref":p,b=a.role,D=a.onKeyDown,L=a.onFocus,I=a.onBlur,me=a.onClick,he=a.onDragEnter,ve=a.onDragOver,Y=a.onDragLeave,ye=a.onDrop,be=oe(a,Mn);return g(g(ze({onKeyDown:ge(S(D,Ve)),onFocus:ge(S(L,He)),onBlur:ge(S(I,Ne)),onClick:C(S(me,$e)),onDragEnter:W(S(he,Be)),onDragOver:W(S(ve,Le)),onDragLeave:W(S(Y,Te)),onDrop:W(S(ye,X)),role:typeof b=="string"&&b!==""?b:"button"},v,F),!r&&!pe?{tabIndex:0}:{}),be)}},[F,Ve,He,Ne,$e,Be,Le,Te,X,pe,Ie,r]),It=u.useCallback(function(a){a.stopPropagation()},[]),kt=u.useMemo(function(){return function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},p=a.refKey,v=p===void 0?"ref":p,b=a.onChange,D=a.onClick,L=oe(a,Rn),I=ze({accept:t,multiple:s,type:"file",style:{display:"none"},onChange:C(S(b,X)),onClick:C(S(D,It)),tabIndex:-1},v,j);return g(g({},I),L)}},[j,t,s,X,r]),Ke=Pe.length,Xe=Ke>0&&Sn({files:Pe,accept:t,minSize:l,maxSize:o,multiple:s,maxFiles:f}),Ut=Ke>0&&!Xe;return g(g({},N),{},{isDragAccept:Xe,isDragReject:Ut,isFocused:Et&&!r,getRootProps:Ct,getInputProps:kt,rootRef:F,inputRef:j,open:C(E)})}function Wn(e,n){switch(n.type){case"focus":return g(g({},e),{},{isFocused:!0});case"blur":return g(g({},e),{},{isFocused:!1});case"openDialog":return g(g({},Ae),{},{isFileDialogActive:!0});case"closeDialog":return g(g({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":var t=n.isDragActive,r=n.draggedFiles;return g(g({},e),{},{draggedFiles:r,isDragActive:t});case"setFiles":return g(g({},e),{},{acceptedFiles:n.acceptedFiles,fileRejections:n.fileRejections});case"reset":return g({},Ae);default:return e}}function mt(){}const ht=m("section",{target:"e1b2p2ww15"})(({isDisabled:e,theme:n})=>({display:"flex",alignItems:"center",padding:n.spacing.lg,backgroundColor:n.colors.secondaryBg,borderRadius:n.radii.default,":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 1px ${n.colors.primary}`},color:e?n.colors.gray:n.colors.bodyText}),""),vt=m("div",{target:"e1b2p2ww14"})({name:"9xni5b",styles:"margin-right:auto;align-items:center;display:flex"}),yt=m("span",{target:"e1b2p2ww13"})(({theme:e})=>({color:e.colors.darkenedBgMix100,marginRight:e.spacing.lg}),""),Gn=m("span",{target:"e1b2p2ww12"})(({theme:e})=>({marginBottom:e.spacing.twoXS}),""),Yn=m("div",{target:"e1b2p2ww11"})({name:"1fttcpj",styles:"display:flex;flex-direction:column"}),bt=m("div",{target:"e1b2p2ww10"})(({theme:e})=>({left:0,right:0,lineHeight:e.lineHeights.tight,paddingTop:e.spacing.md,paddingLeft:e.spacing.lg,paddingRight:e.spacing.lg}),""),_n=m("ul",{target:"e1b2p2ww9"})(({theme:e})=>({listStyleType:"none",margin:e.spacing.none,padding:e.spacing.none}),""),xt=m("li",{target:"e1b2p2ww8"})(({theme:e})=>({margin:e.spacing.none,padding:e.spacing.none}),""),wt=m("div",{target:"e1b2p2ww7"})(({theme:e})=>({display:"flex",alignItems:"baseline",flex:1,paddingLeft:e.spacing.lg,overflow:"hidden"}),""),Ft=m("div",{target:"e1b2p2ww6"})(({theme:e})=>({marginRight:e.spacing.sm,marginBottom:e.spacing.twoXS,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),""),jt=m("div",{target:"e1b2p2ww5"})(({theme:e})=>({display:"flex",alignItems:"center",marginBottom:e.spacing.twoXS}),""),qn=m("span",{target:"e1b2p2ww4"})(({theme:e})=>({marginRight:e.spacing.twoXS}),""),Jn=m("div",{target:"e1b2p2ww3"})(({theme:e})=>({display:"flex",padding:e.spacing.twoXS,color:e.colors.darkenedBgMix100}),""),Dt=m("small",{target:"e1b2p2ww2"})(({theme:e})=>({color:e.colors.danger,fontSize:e.fontSizes.sm,height:e.fontSizes.sm,lineHeight:e.fontSizes.sm,display:"flex",alignItems:"center",whiteSpace:"nowrap"}),""),St=m("span",{target:"e1b2p2ww1"})({name:"0",styles:""}),zt=e=>({[ht]:{display:"flex",flexDirection:"column",alignItems:"flex-start"},[vt]:{marginBottom:e.spacing.lg},[yt]:{display:"none"},[bt]:{paddingRight:e.spacing.lg},[jt]:{maxWidth:"inherit",flex:1,alignItems:"flex-start",marginBottom:e.spacing.sm},[Ft]:{width:e.sizes.full},[wt]:{flexDirection:"column"},[Dt]:{height:"auto",whiteSpace:"initial"},[St]:{display:"none"},[xt]:{margin:e.spacing.none,padding:e.spacing.none}}),Qn=m("div",{target:"e1b2p2ww0"})(({theme:e})=>e.inSidebar?zt(e):{[`@media (max-width: ${e.breakpoints.sm})`]:zt(e)},""),Oe=m("small",{target:"e1bju1570"})(({kind:e,theme:n})=>{const{danger:t,fadedText60:r}=n.colors;return{color:e==="danger"?t:r,fontSize:n.fontSizes.sm,lineHeight:n.lineHeights.tight}},""),Zn=({multiple:e,acceptedExtensions:n,maxSizeBytes:t})=>c.jsxs(vt,{"data-testid":"stFileUploaderDropzoneInstructions",children:[c.jsx(yt,{children:c.jsx(P,{content:_e,size:"threeXL"})}),c.jsxs(Yn,{children:[c.jsxs(Gn,{children:["Drag and drop file",e?"s":""," here"]}),c.jsxs(Oe,{children:[`Limit ${te(t,R.Byte,0)} per file`,n.length?` \u2022 ${n.map(r=>r.replace(/^\./,"").toUpperCase()).join(", ")}`:null]})]})]}),er=({onDrop:e,multiple:n,acceptedExtensions:t,maxSizeBytes:r,disabled:i,label:o})=>c.jsx(ae,{onDrop:e,multiple:n,accept:t.length?t:void 0,maxSize:r,disabled:i,useFsAccessApi:!1,children:({getRootProps:l,getInputProps:s})=>c.jsxs(ht,{...l(),"data-testid":"stFileUploaderDropzone",isDisabled:i,"aria-label":o,children:[c.jsx("input",{"data-testid":"stFileUploaderDropzoneInput",...s()}),c.jsx(Zn,{multiple:n,acceptedExtensions:t,maxSizeBytes:r}),c.jsx(J,{kind:Q.SECONDARY,disabled:i,size:Bt.SMALL,children:"Browse files"})]})}),tr=m("div",{target:"e1nlpozb1"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:e.spacing.twoXS,marginBottom:e.spacing.twoXS}),""),nr=m("div",{target:"e1nlpozb0"})(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",color:e.colors.fadedText40}),""),rr=({currentPage:e,totalPages:n,onNext:t,onPrevious:r})=>c.jsxs(tr,{"data-testid":"stFileUploaderPagination",children:[c.jsx(Oe,{children:`Showing page ${e} of ${n}`}),c.jsxs(nr,{children:[c.jsx(J,{onClick:r,kind:Q.MINIMAL,children:c.jsx(P,{content:Lt,size:"xl"})}),c.jsx(J,{onClick:t,kind:Q.MINIMAL,children:c.jsx(P,{content:Tt,size:"xl"})})]})]}),At=(e,n)=>Math.ceil(e.length/n),ir=e=>Vt(({pageSize:n,items:t,resetOnAdd:r,...i})=>{const[o,l]=u.useState(0),[s,f]=u.useState(At(t,n)),h=Zt(t);u.useEffect(()=>{h&&h.length!==t.length&&f(At(t,n)),h&&h.length<t.length?r&&l(0):o+1>=s&&l(s-1)},[t,o,n,h,r,s]);const w=()=>{l(Math.min(o+1,s-1))},y=()=>{l(Math.max(0,o-1))},z=t.slice(o*n,o*n+n);return c.jsxs(c.Fragment,{children:[c.jsx(e,{items:z,...i}),t.length>n?c.jsx(rr,{pageSize:n,totalPages:s,currentPage:o+1,onNext:w,onPrevious:y}):null]})},e),or=({fileInfo:e})=>e.status.type==="uploading"?c.jsx(Jt,{value:e.status.progress,size:Qt.SMALL}):e.status.type==="error"?c.jsxs(Dt,{children:[c.jsx(qn,{"data-testid":"stFileUploaderFileErrorMessage",children:e.status.errorMessage}),c.jsx(St,{children:c.jsx(P,{content:qe,size:"lg"})})]}):e.status.type==="uploaded"?c.jsx(Oe,{children:te(e.size,R.Byte)}):null,ar=({fileInfo:e,onDelete:n})=>c.jsxs(jt,{className:"stFileUploaderFile","data-testid":"stFileUploaderFile",children:[c.jsx(Jn,{children:c.jsx(P,{content:Je,size:"twoXL"})}),c.jsxs(wt,{className:"stFileUploaderFileData",children:[c.jsx(Ft,{className:"stFileUploaderFileName","data-testid":"stFileUploaderFileName",title:e.name,children:e.name}),c.jsx(or,{fileInfo:e})]}),c.jsx("div",{"data-testid":"stFileUploaderDeleteBtn",children:c.jsx(J,{onClick:()=>n(e.id),kind:Q.MINIMAL,children:c.jsx(P,{content:Ye,size:"lg"})})})]}),sr=({items:e,onDelete:n})=>c.jsx(_n,{children:e.map(t=>c.jsx(xt,{children:c.jsx(ar,{fileInfo:t,onDelete:n})},t.id))}),lr=ir(sr),cr=e=>c.jsx(bt,{children:c.jsx(lr,{...e})});class ur extends We.PureComponent{constructor(n){super(n),this.formClearHelper=new qt,this.localFileIdCounter=1,this.forceUpdatingStatus=!1,this.componentDidUpdate=()=>{if(this.status!=="ready")return;const t=this.createWidgetValue(),{element:r,widgetMgr:i,fragmentId:o}=this.props,l=i.getFileUploaderStateValue(r);Ht(t,l)||i.setFileUploaderStateValue(r,t,{fromUi:!0},o)},this.reset=()=>{this.setState({files:[]})},this.dropHandler=(t,r)=>{const{element:i}=this.props,{multipleFiles:o}=i;if(!o&&t.length===0&&r.length>1){const l=r.findIndex(s=>s.errors.length===1&&s.errors[0].code==="too-many-files");l>=0&&(t.push(r[l].file),r.splice(l,1))}if(this.props.uploadClient.fetchFileURLs(t).then(l=>{if(!o&&t.length>0){const s=this.state.files.find(f=>f.status.type!=="error");s&&(this.forceUpdatingStatus=!0,this.deleteFile(s.id),this.forceUpdatingStatus=!1)}Nt(l,t).forEach(([s,f])=>{this.uploadFile(s,f)})}).catch(l=>{this.addFiles(t.map(s=>new Z(s.name,s.size,this.nextLocalFileId(),{type:"error",errorMessage:l})))}),r.length>0){const l=r.map(s=>{const{file:f}=s;return new Z(f.name,f.size,this.nextLocalFileId(),{type:"error",errorMessage:this.getErrorMessage(s.errors[0].code,s.file)})});this.addFiles(l)}},this.uploadFile=(t,r)=>{const i=Ge.CancelToken.source(),o=new Z(r.name,r.size,this.nextLocalFileId(),{type:"uploading",cancelToken:i,progress:1});this.addFile(o),this.props.uploadClient.uploadFile(this.props.element,t.uploadUrl,r,l=>this.onUploadProgress(l,o.id),i.token).then(()=>this.onUploadComplete(o.id,t)).catch(l=>{Ge.isCancel(l)||this.updateFile(o.id,o.setStatus({type:"error",errorMessage:l?l.toString():"Unknown error"}))})},this.onUploadComplete=(t,r)=>{const i=this.getFile(t);M(i)||i.status.type!=="uploading"||this.updateFile(i.id,i.setStatus({type:"uploaded",fileId:r.fileId,fileUrls:r}))},this.getErrorMessage=(t,r)=>{switch(t){case"file-too-large":return`File must be ${te(this.maxUploadSizeInBytes,R.Byte)} or smaller.`;case"file-invalid-type":return`${r.type} files are not allowed.`;case"file-too-small":return"File size is too small.";case"too-many-files":return"Only one file is allowed.";default:return"Unexpected error. Please try again."}},this.deleteFile=t=>{const r=this.getFile(t);M(r)||(r.status.type==="uploading"&&r.status.cancelToken.cancel(),r.status.type==="uploaded"&&r.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(r.status.fileUrls.deleteUrl),this.removeFile(t))},this.addFile=t=>{this.setState(r=>({files:[...r.files,t]}))},this.addFiles=t=>{this.setState(r=>({files:[...r.files,...t]}))},this.removeFile=t=>{this.setState(r=>({files:r.files.filter(i=>i.id!==t)}))},this.getFile=t=>this.state.files.find(r=>r.id===t),this.updateFile=(t,r)=>{this.setState(i=>({files:i.files.map(o=>o.id===t?r:o)}))},this.onUploadProgress=(t,r)=>{const i=this.getFile(r);if(M(i)||i.status.type!=="uploading")return;const o=Math.round(t.loaded*100/t.total);i.status.progress!==o&&this.updateFile(r,i.setStatus({type:"uploading",cancelToken:i.status.cancelToken,progress:o}))},this.onFormCleared=()=>{this.setState({files:[]},()=>{const t=this.createWidgetValue();if(M(t))return;const{widgetMgr:r,element:i,fragmentId:o}=this.props;r.setFileUploaderStateValue(i,t,{fromUi:!0},o)})},this.state=this.initialValue}get initialValue(){const n={files:[],newestServerFileId:0},{widgetMgr:t,element:r}=this.props,i=t.getFileUploaderStateValue(r);if(M(i))return n;const{uploadedFileInfo:o}=i;return M(o)||o.length===0?n:{files:o.map(l=>{const s=l.name,f=l.size,h=l.fileId,w=l.fileUrls;return new Z(s,f,this.nextLocalFileId(),{type:"uploaded",fileId:h,fileUrls:w})})}}componentWillUnmount(){this.formClearHelper.disconnect()}get maxUploadSizeInBytes(){const n=this.props.element.maxUploadSizeMb;return en(n,R.Megabyte,R.Byte)}get status(){const n=t=>t.status.type==="uploading";return this.state.files.some(n)||this.forceUpdatingStatus?"updating":"ready"}componentDidMount(){const n=this.createWidgetValue(),{element:t,widgetMgr:r,fragmentId:i}=this.props;r.getFileUploaderStateValue(t)===void 0&&r.setFileUploaderStateValue(t,n,{fromUi:!1},i)}createWidgetValue(){const n=this.state.files.filter(t=>t.status.type==="uploaded").map(t=>{const{name:r,size:i,status:o}=t,{fileId:l,fileUrls:s}=o;return new $t({fileId:l,fileUrls:s,name:r,size:i})});return new Kt({uploadedFileInfo:n})}render(){var s;const{files:n}=this.state,{element:t,disabled:r,widgetMgr:i}=this.props,o=t.type;this.formClearHelper.manageFormClearListener(i,t.formId,this.onFormCleared);const l=n.slice().reverse();return c.jsxs(Qn,{className:"stFileUploader","data-testid":"stFileUploader",children:[c.jsx(Xt,{label:t.label,disabled:r,labelVisibility:Wt((s=t.labelVisibility)==null?void 0:s.value),children:t.help&&c.jsx(Gt,{children:c.jsx(Yt,{content:t.help,placement:_t.TOP_RIGHT})})}),c.jsx(er,{onDrop:this.dropHandler,multiple:t.multipleFiles,acceptedExtensions:o,maxSizeBytes:this.maxUploadSizeInBytes,label:t.label,disabled:r}),l.length>0&&c.jsx(cr,{items:l,pageSize:3,onDelete:this.deleteFile,resetOnAdd:!0})]})}nextLocalFileId(){return this.localFileIdCounter++}}export{ur as default};
|