beesoft-components 0.8.0 → 0.9.0

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/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(J,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],d):(J=typeof globalThis<"u"?globalThis:J||self,d(J.BeeSoftComponents={},J.React,J.ReactDOM))})(this,function(J,d,Re){"use strict";var Rh=Object.defineProperty;var Lh=(J,d,Re)=>d in J?Rh(J,d,{enumerable:!0,configurable:!0,writable:!0,value:Re}):J[d]=Re;var m=(J,d,Re)=>(Lh(J,typeof d!="symbol"?d+"":d,Re),Re);function ya(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const Et=ya(d);function cn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yr={exports:{}},St={};/**
1
+ (function(K,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],d):(K=typeof globalThis<"u"?globalThis:K||self,d(K.BeeSoftComponents={},K.React,K.ReactDOM))})(this,function(K,d,$e){"use strict";var ap=Object.defineProperty;var op=(K,d,$e)=>d in K?ap(K,d,{enumerable:!0,configurable:!0,writable:!0,value:$e}):K[d]=$e;var b=(K,d,$e)=>(op(K,typeof d!="symbol"?d+"":d,$e),$e);function Na(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const _t=Na(d);function Or(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Nr={exports:{}},It={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var un;function va(){if(un)return St;un=1;var e=d,r=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function o(i,c,l){var h,b={},w=null,x=null;l!==void 0&&(w=""+l),c.key!==void 0&&(w=""+c.key),c.ref!==void 0&&(x=c.ref);for(h in c)n.call(c,h)&&!a.hasOwnProperty(h)&&(b[h]=c[h]);if(i&&i.defaultProps)for(h in c=i.defaultProps,c)b[h]===void 0&&(b[h]=c[h]);return{$$typeof:r,type:i,key:w,ref:x,props:b,_owner:s.current}}return St.Fragment=t,St.jsx=o,St.jsxs=o,St}var Ct={};/**
9
+ */var wn;function _a(){if(wn)return It;wn=1;var e=d,r=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function o(i,c,l){var h,m={},x=null,v=null;l!==void 0&&(x=""+l),c.key!==void 0&&(x=""+c.key),c.ref!==void 0&&(v=c.ref);for(h in c)n.call(c,h)&&!a.hasOwnProperty(h)&&(m[h]=c[h]);if(i&&i.defaultProps)for(h in c=i.defaultProps,c)m[h]===void 0&&(m[h]=c[h]);return{$$typeof:r,type:i,key:x,ref:v,props:m,_owner:s.current}}return It.Fragment=t,It.jsx=o,It.jsxs=o,It}var jt={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,37 +14,37 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var ln;function xa(){return ln||(ln=1,process.env.NODE_ENV!=="production"&&function(){var e=d,r=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),i=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),P=Symbol.iterator,D="@@iterator";function k(u){if(u===null||typeof u!="object")return null;var v=P&&u[P]||u[D];return typeof v=="function"?v:null}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function L(u){{for(var v=arguments.length,j=new Array(v>1?v-1:0),G=1;G<v;G++)j[G-1]=arguments[G];U("error",u,j)}}function U(u,v,j){{var G=E.ReactDebugCurrentFrame,ce=G.getStackAddendum();ce!==""&&(v+="%s",j=j.concat([ce]));var pe=j.map(function(ae){return String(ae)});pe.unshift("Warning: "+v),Function.prototype.apply.call(console[u],console,pe)}}var $=!1,y=!1,A=!1,O=!1,H=!1,F;F=Symbol.for("react.module.reference");function re(u){return!!(typeof u=="string"||typeof u=="function"||u===n||u===a||H||u===s||u===l||u===h||O||u===x||$||y||A||typeof u=="object"&&u!==null&&(u.$$typeof===w||u.$$typeof===b||u.$$typeof===o||u.$$typeof===i||u.$$typeof===c||u.$$typeof===F||u.getModuleId!==void 0))}function ee(u,v,j){var G=u.displayName;if(G)return G;var ce=v.displayName||v.name||"";return ce!==""?j+"("+ce+")":j}function q(u){return u.displayName||"Context"}function S(u){if(u==null)return null;if(typeof u.tag=="number"&&L("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case n:return"Fragment";case t:return"Portal";case a:return"Profiler";case s:return"StrictMode";case l:return"Suspense";case h:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case i:var v=u;return q(v)+".Consumer";case o:var j=u;return q(j._context)+".Provider";case c:return ee(u,u.render,"ForwardRef");case b:var G=u.displayName||null;return G!==null?G:S(u.type)||"Memo";case w:{var ce=u,pe=ce._payload,ae=ce._init;try{return S(ae(pe))}catch{return null}}}return null}var T=Object.assign,B=0,Y,se,M,he,g,C,z;function p(){}p.__reactDisabledLog=!0;function N(){{if(B===0){Y=console.log,se=console.info,M=console.warn,he=console.error,g=console.group,C=console.groupCollapsed,z=console.groupEnd;var u={configurable:!0,enumerable:!0,value:p,writable:!0};Object.defineProperties(console,{info:u,log:u,warn:u,error:u,group:u,groupCollapsed:u,groupEnd:u})}B++}}function V(){{if(B--,B===0){var u={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:T({},u,{value:Y}),info:T({},u,{value:se}),warn:T({},u,{value:M}),error:T({},u,{value:he}),group:T({},u,{value:g}),groupCollapsed:T({},u,{value:C}),groupEnd:T({},u,{value:z})})}B<0&&L("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var I=E.ReactCurrentDispatcher,R;function W(u,v,j){{if(R===void 0)try{throw Error()}catch(ce){var G=ce.stack.trim().match(/\n( *(at )?)/);R=G&&G[1]||""}return`
18
- `+R+u}}var Q=!1,Z;{var Se=typeof WeakMap=="function"?WeakMap:Map;Z=new Se}function _(u,v){if(!u||Q)return"";{var j=Z.get(u);if(j!==void 0)return j}var G;Q=!0;var ce=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var pe;pe=I.current,I.current=null,N();try{if(v){var ae=function(){throw Error()};if(Object.defineProperty(ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ae,[])}catch(Qe){G=Qe}Reflect.construct(u,[],ae)}else{try{ae.call()}catch(Qe){G=Qe}u.call(ae.prototype)}}else{try{throw Error()}catch(Qe){G=Qe}u()}}catch(Qe){if(Qe&&G&&typeof Qe.stack=="string"){for(var ne=Qe.stack.split(`
19
- `),_e=G.stack.split(`
20
- `),Ce=ne.length-1,De=_e.length-1;Ce>=1&&De>=0&&ne[Ce]!==_e[De];)De--;for(;Ce>=1&&De>=0;Ce--,De--)if(ne[Ce]!==_e[De]){if(Ce!==1||De!==1)do if(Ce--,De--,De<0||ne[Ce]!==_e[De]){var Me=`
21
- `+ne[Ce].replace(" at new "," at ");return u.displayName&&Me.includes("<anonymous>")&&(Me=Me.replace("<anonymous>",u.displayName)),typeof u=="function"&&Z.set(u,Me),Me}while(Ce>=1&&De>=0);break}}}finally{Q=!1,I.current=pe,V(),Error.prepareStackTrace=ce}var Pt=u?u.displayName||u.name:"",ga=Pt?W(Pt):"";return typeof u=="function"&&Z.set(u,ga),ga}function Ne(u,v,j){return _(u,!1)}function qe(u){var v=u.prototype;return!!(v&&v.isReactComponent)}function Ae(u,v,j){if(u==null)return"";if(typeof u=="function")return _(u,qe(u));if(typeof u=="string")return W(u);switch(u){case l:return W("Suspense");case h:return W("SuspenseList")}if(typeof u=="object")switch(u.$$typeof){case c:return Ne(u.render);case b:return Ae(u.type,v,j);case w:{var G=u,ce=G._payload,pe=G._init;try{return Ae(pe(ce),v,j)}catch{}}}return""}var it=Object.prototype.hasOwnProperty,Yt={},cr=E.ReactDebugCurrentFrame;function ze(u){if(u){var v=u._owner,j=Ae(u.type,u._source,v?v.type:null);cr.setExtraStackFrame(j)}else cr.setExtraStackFrame(null)}function vt(u,v,j,G,ce){{var pe=Function.call.bind(it);for(var ae in u)if(pe(u,ae)){var ne=void 0;try{if(typeof u[ae]!="function"){var _e=Error((G||"React class")+": "+j+" type `"+ae+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof u[ae]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw _e.name="Invariant Violation",_e}ne=u[ae](v,ae,G,j,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ce){ne=Ce}ne&&!(ne instanceof Error)&&(ze(ce),L("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",G||"React class",j,ae,typeof ne),ze(null)),ne instanceof Error&&!(ne.message in Yt)&&(Yt[ne.message]=!0,ze(ce),L("Failed %s type: %s",j,ne.message),ze(null))}}}var nn=Array.isArray;function Ge(u){return nn(u)}function ur(u){{var v=typeof Symbol=="function"&&Symbol.toStringTag,j=v&&u[Symbol.toStringTag]||u.constructor.name||"Object";return j}}function lr(u){try{return sn(u),!1}catch{return!0}}function sn(u){return""+u}function Ht(u){if(lr(u))return L("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ur(u)),sn(u)}var Ze=E.ReactCurrentOwner,K={key:!0,ref:!0,__self:!0,__source:!0},fe,Ie,xt;xt={};function fr(u){if(it.call(u,"ref")){var v=Object.getOwnPropertyDescriptor(u,"ref").get;if(v&&v.isReactWarning)return!1}return u.ref!==void 0}function dr(u){if(it.call(u,"key")){var v=Object.getOwnPropertyDescriptor(u,"key").get;if(v&&v.isReactWarning)return!1}return u.key!==void 0}function hr(u,v){if(typeof u.ref=="string"&&Ze.current&&v&&Ze.current.stateNode!==v){var j=S(Ze.current.type);xt[j]||(L('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',S(Ze.current.type),u.ref),xt[j]=!0)}}function pr(u,v){{var j=function(){fe||(fe=!0,L("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",v))};j.isReactWarning=!0,Object.defineProperty(u,"key",{get:j,configurable:!0})}}function mr(u,v){{var j=function(){Ie||(Ie=!0,L("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",v))};j.isReactWarning=!0,Object.defineProperty(u,"ref",{get:j,configurable:!0})}}var br=function(u,v,j,G,ce,pe,ae){var ne={$$typeof:r,type:u,key:v,ref:j,props:ae,_owner:pe};return ne._store={},Object.defineProperty(ne._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ne,"_self",{configurable:!1,enumerable:!1,writable:!1,value:G}),Object.defineProperty(ne,"_source",{configurable:!1,enumerable:!1,writable:!1,value:ce}),Object.freeze&&(Object.freeze(ne.props),Object.freeze(ne)),ne};function gr(u,v,j,G,ce){{var pe,ae={},ne=null,_e=null;j!==void 0&&(Ht(j),ne=""+j),dr(v)&&(Ht(v.key),ne=""+v.key),fr(v)&&(_e=v.ref,hr(v,ce));for(pe in v)it.call(v,pe)&&!K.hasOwnProperty(pe)&&(ae[pe]=v[pe]);if(u&&u.defaultProps){var Ce=u.defaultProps;for(pe in Ce)ae[pe]===void 0&&(ae[pe]=Ce[pe])}if(ne||_e){var De=typeof u=="function"?u.displayName||u.name||"Unknown":u;ne&&pr(ae,De),_e&&mr(ae,De)}return br(u,ne,_e,ce,G,Ze.current,ae)}}var wt=E.ReactCurrentOwner,Wt=E.ReactDebugCurrentFrame;function Tt(u){if(u){var v=u._owner,j=Ae(u.type,u._source,v?v.type:null);Wt.setExtraStackFrame(j)}else Wt.setExtraStackFrame(null)}var an;an=!1;function on(u){return typeof u=="object"&&u!==null&&u.$$typeof===r}function da(){{if(wt.current){var u=S(wt.current.type);if(u)return`
17
+ */var Tn;function Ia(){return Tn||(Tn=1,process.env.NODE_ENV!=="production"&&function(){var e=d,r=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),i=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),w=Symbol.iterator,D="@@iterator";function N(u){if(u===null||typeof u!="object")return null;var T=w&&u[w]||u[D];return typeof T=="function"?T:null}var S=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function A(u){{for(var T=arguments.length,R=new Array(T>1?T-1:0),Z=1;Z<T;Z++)R[Z-1]=arguments[Z];B("error",u,R)}}function B(u,T,R){{var Z=S.ReactDebugCurrentFrame,fe=Z.getStackAddendum();fe!==""&&(T+="%s",R=R.concat([fe]));var be=R.map(function(ie){return String(ie)});be.unshift("Warning: "+T),Function.prototype.apply.call(console[u],console,be)}}var F=!1,g=!1,$=!1,_=!1,W=!1,Y;Y=Symbol.for("react.module.reference");function re(u){return!!(typeof u=="string"||typeof u=="function"||u===n||u===a||W||u===s||u===l||u===h||_||u===v||F||g||$||typeof u=="object"&&u!==null&&(u.$$typeof===x||u.$$typeof===m||u.$$typeof===o||u.$$typeof===i||u.$$typeof===c||u.$$typeof===Y||u.getModuleId!==void 0))}function te(u,T,R){var Z=u.displayName;if(Z)return Z;var fe=T.displayName||T.name||"";return fe!==""?R+"("+fe+")":R}function U(u){return u.displayName||"Context"}function E(u){if(u==null)return null;if(typeof u.tag=="number"&&A("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case n:return"Fragment";case t:return"Portal";case a:return"Profiler";case s:return"StrictMode";case l:return"Suspense";case h:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case i:var T=u;return U(T)+".Consumer";case o:var R=u;return U(R._context)+".Provider";case c:return te(u,u.render,"ForwardRef");case m:var Z=u.displayName||null;return Z!==null?Z:E(u.type)||"Memo";case x:{var fe=u,be=fe._payload,ie=fe._init;try{return E(ie(be))}catch{return null}}}return null}var P=Object.assign,I=0,k,G,O,se,y,C,V;function p(){}p.__reactDisabledLog=!0;function j(){{if(I===0){k=console.log,G=console.info,O=console.warn,se=console.error,y=console.group,C=console.groupCollapsed,V=console.groupEnd;var u={configurable:!0,enumerable:!0,value:p,writable:!0};Object.defineProperties(console,{info:u,log:u,warn:u,error:u,group:u,groupCollapsed:u,groupEnd:u})}I++}}function q(){{if(I--,I===0){var u={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:P({},u,{value:k}),info:P({},u,{value:G}),warn:P({},u,{value:O}),error:P({},u,{value:se}),group:P({},u,{value:y}),groupCollapsed:P({},u,{value:C}),groupEnd:P({},u,{value:V})})}I<0&&A("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var L=S.ReactCurrentDispatcher,H;function z(u,T,R){{if(H===void 0)try{throw Error()}catch(fe){var Z=fe.stack.trim().match(/\n( *(at )?)/);H=Z&&Z[1]||""}return`
18
+ `+H+u}}var X=!1,Q;{var ke=typeof WeakMap=="function"?WeakMap:Map;Q=new ke}function M(u,T){if(!u||X)return"";{var R=Q.get(u);if(R!==void 0)return R}var Z;X=!0;var fe=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var be;be=L.current,L.current=null,j();try{if(T){var ie=function(){throw Error()};if(Object.defineProperty(ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ie,[])}catch(tt){Z=tt}Reflect.construct(u,[],ie)}else{try{ie.call()}catch(tt){Z=tt}u.call(ie.prototype)}}else{try{throw Error()}catch(tt){Z=tt}u()}}catch(tt){if(tt&&Z&&typeof tt.stack=="string"){for(var ae=tt.stack.split(`
19
+ `),je=Z.stack.split(`
20
+ `),Ce=ae.length-1,De=je.length-1;Ce>=1&&De>=0&&ae[Ce]!==je[De];)De--;for(;Ce>=1&&De>=0;Ce--,De--)if(ae[Ce]!==je[De]){if(Ce!==1||De!==1)do if(Ce--,De--,De<0||ae[Ce]!==je[De]){var Le=`
21
+ `+ae[Ce].replace(" at new "," at ");return u.displayName&&Le.includes("<anonymous>")&&(Le=Le.replace("<anonymous>",u.displayName)),typeof u=="function"&&Q.set(u,Le),Le}while(Ce>=1&&De>=0);break}}}finally{X=!1,L.current=be,q(),Error.prepareStackTrace=fe}var Nt=u?u.displayName||u.name:"",Oa=Nt?z(Nt):"";return typeof u=="function"&&Q.set(u,Oa),Oa}function Ie(u,T,R){return M(u,!1)}function Ke(u){var T=u.prototype;return!!(T&&T.isReactComponent)}function He(u,T,R){if(u==null)return"";if(typeof u=="function")return M(u,Ke(u));if(typeof u=="string")return z(u);switch(u){case l:return z("Suspense");case h:return z("SuspenseList")}if(typeof u=="object")switch(u.$$typeof){case c:return Ie(u.render);case m:return He(u.type,T,R);case x:{var Z=u,fe=Z._payload,be=Z._init;try{return He(be(fe),T,R)}catch{}}}return""}var dt=Object.prototype.hasOwnProperty,Zt={},vr=S.ReactDebugCurrentFrame;function Xe(u){if(u){var T=u._owner,R=He(u.type,u._source,T?T.type:null);vr.setExtraStackFrame(R)}else vr.setExtraStackFrame(null)}function kt(u,T,R,Z,fe){{var be=Function.call.bind(dt);for(var ie in u)if(be(u,ie)){var ae=void 0;try{if(typeof u[ie]!="function"){var je=Error((Z||"React class")+": "+R+" type `"+ie+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof u[ie]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw je.name="Invariant Violation",je}ae=u[ie](T,ie,Z,R,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ce){ae=Ce}ae&&!(ae instanceof Error)&&(Xe(fe),A("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Z||"React class",R,ie,typeof ae),Xe(null)),ae instanceof Error&&!(ae.message in Zt)&&(Zt[ae.message]=!0,Xe(fe),A("Failed %s type: %s",R,ae.message),Xe(null))}}}var gn=Array.isArray;function Je(u){return gn(u)}function xr(u){{var T=typeof Symbol=="function"&&Symbol.toStringTag,R=T&&u[Symbol.toStringTag]||u.constructor.name||"Object";return R}}function wr(u){try{return yn(u),!1}catch{return!0}}function yn(u){return""+u}function Qt(u){if(wr(u))return A("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",xr(u)),yn(u)}var et=S.ReactCurrentOwner,J={key:!0,ref:!0,__self:!0,__source:!0},pe,Ae,Ct;Ct={};function Tr(u){if(dt.call(u,"ref")){var T=Object.getOwnPropertyDescriptor(u,"ref").get;if(T&&T.isReactWarning)return!1}return u.ref!==void 0}function Sr(u){if(dt.call(u,"key")){var T=Object.getOwnPropertyDescriptor(u,"key").get;if(T&&T.isReactWarning)return!1}return u.key!==void 0}function Pr(u,T){if(typeof u.ref=="string"&&et.current&&T&&et.current.stateNode!==T){var R=E(et.current.type);Ct[R]||(A('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',E(et.current.type),u.ref),Ct[R]=!0)}}function Er(u,T){{var R=function(){pe||(pe=!0,A("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",T))};R.isReactWarning=!0,Object.defineProperty(u,"key",{get:R,configurable:!0})}}function kr(u,T){{var R=function(){Ae||(Ae=!0,A("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",T))};R.isReactWarning=!0,Object.defineProperty(u,"ref",{get:R,configurable:!0})}}var Cr=function(u,T,R,Z,fe,be,ie){var ae={$$typeof:r,type:u,key:T,ref:R,props:ie,_owner:be};return ae._store={},Object.defineProperty(ae._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ae,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Z}),Object.defineProperty(ae,"_source",{configurable:!1,enumerable:!1,writable:!1,value:fe}),Object.freeze&&(Object.freeze(ae.props),Object.freeze(ae)),ae};function Dr(u,T,R,Z,fe){{var be,ie={},ae=null,je=null;R!==void 0&&(Qt(R),ae=""+R),Sr(T)&&(Qt(T.key),ae=""+T.key),Tr(T)&&(je=T.ref,Pr(T,fe));for(be in T)dt.call(T,be)&&!J.hasOwnProperty(be)&&(ie[be]=T[be]);if(u&&u.defaultProps){var Ce=u.defaultProps;for(be in Ce)ie[be]===void 0&&(ie[be]=Ce[be])}if(ae||je){var De=typeof u=="function"?u.displayName||u.name||"Unknown":u;ae&&Er(ie,De),je&&kr(ie,De)}return Cr(u,ae,je,fe,Z,et.current,ie)}}var Dt=S.ReactCurrentOwner,Kt=S.ReactDebugCurrentFrame;function Ot(u){if(u){var T=u._owner,R=He(u.type,u._source,T?T.type:null);Kt.setExtraStackFrame(R)}else Kt.setExtraStackFrame(null)}var vn;vn=!1;function xn(u){return typeof u=="object"&&u!==null&&u.$$typeof===r}function Pa(){{if(Dt.current){var u=E(Dt.current.type);if(u)return`
22
22
 
23
- Check the render method of \``+u+"`."}return""}}function Dh(u){{if(u!==void 0){var v=u.fileName.replace(/^.*[\\\/]/,""),j=u.lineNumber;return`
23
+ Check the render method of \``+u+"`."}return""}}function Kh(u){{if(u!==void 0){var T=u.fileName.replace(/^.*[\\\/]/,""),R=u.lineNumber;return`
24
24
 
25
- Check your code at `+v+":"+j+"."}return""}}var ha={};function kh(u){{var v=da();if(!v){var j=typeof u=="string"?u:u.displayName||u.name;j&&(v=`
25
+ Check your code at `+T+":"+R+"."}return""}}var Ea={};function Xh(u){{var T=Pa();if(!T){var R=typeof u=="string"?u:u.displayName||u.name;R&&(T=`
26
26
 
27
- Check the top-level render call using <`+j+">.")}return v}}function pa(u,v){{if(!u._store||u._store.validated||u.key!=null)return;u._store.validated=!0;var j=kh(v);if(ha[j])return;ha[j]=!0;var G="";u&&u._owner&&u._owner!==wt.current&&(G=" It was passed a child from "+S(u._owner.type)+"."),Tt(u),L('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',j,G),Tt(null)}}function ma(u,v){{if(typeof u!="object")return;if(Ge(u))for(var j=0;j<u.length;j++){var G=u[j];on(G)&&pa(G,v)}else if(on(u))u._store&&(u._store.validated=!0);else if(u){var ce=k(u);if(typeof ce=="function"&&ce!==u.entries)for(var pe=ce.call(u),ae;!(ae=pe.next()).done;)on(ae.value)&&pa(ae.value,v)}}}function Oh(u){{var v=u.type;if(v==null||typeof v=="string")return;var j;if(typeof v=="function")j=v.propTypes;else if(typeof v=="object"&&(v.$$typeof===c||v.$$typeof===b))j=v.propTypes;else return;if(j){var G=S(v);vt(j,u.props,"prop",G,u)}else if(v.PropTypes!==void 0&&!an){an=!0;var ce=S(v);L("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",ce||"Unknown")}typeof v.getDefaultProps=="function"&&!v.getDefaultProps.isReactClassApproved&&L("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Nh(u){{for(var v=Object.keys(u.props),j=0;j<v.length;j++){var G=v[j];if(G!=="children"&&G!=="key"){Tt(u),L("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",G),Tt(null);break}}u.ref!==null&&(Tt(u),L("Invalid attribute `ref` supplied to `React.Fragment`."),Tt(null))}}function ba(u,v,j,G,ce,pe){{var ae=re(u);if(!ae){var ne="";(u===void 0||typeof u=="object"&&u!==null&&Object.keys(u).length===0)&&(ne+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var _e=Dh(ce);_e?ne+=_e:ne+=da();var Ce;u===null?Ce="null":Ge(u)?Ce="array":u!==void 0&&u.$$typeof===r?(Ce="<"+(S(u.type)||"Unknown")+" />",ne=" Did you accidentally export a JSX literal instead of a component?"):Ce=typeof u,L("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ce,ne)}var De=gr(u,v,j,ce,pe);if(De==null)return De;if(ae){var Me=v.children;if(Me!==void 0)if(G)if(Ge(Me)){for(var Pt=0;Pt<Me.length;Pt++)ma(Me[Pt],u);Object.freeze&&Object.freeze(Me)}else L("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ma(Me,u)}return u===n?Nh(De):Oh(De),De}}function _h(u,v,j){return ba(u,v,j,!0)}function jh(u,v,j){return ba(u,v,j,!1)}var Ih=jh,Mh=_h;Ct.Fragment=n,Ct.jsx=Ih,Ct.jsxs=Mh}()),Ct}process.env.NODE_ENV==="production"?yr.exports=va():yr.exports=xa();var f=yr.exports;const fn=d.createContext(void 0),dn=()=>d.useContext(fn),wa=({overlayKeepOnScreen:e=!0,useAnimations:r=!0,mobileMediaQuery:t,tabletMediaQuery:n,desktopMediaQuery:s,isValidScrollableElement:a,children:o})=>{const i={overlayKeepOnScreen:e,useAnimations:r,mobileMediaQuery:t,tabletMediaQuery:n,desktopMediaQuery:s,isValidScrollableElement:a};return f.jsx(fn.Provider,{value:i,children:o})};var Vt=(e=>(e[e.Vertical=0]="Vertical",e[e.Horizontal=1]="Horizontal",e))(Vt||{}),Je=(e=>(e[e.Right=0]="Right",e[e.Left=1]="Left",e))(Je||{}),hn={exports:{}};/*!
27
+ Check the top-level render call using <`+R+">.")}return T}}function ka(u,T){{if(!u._store||u._store.validated||u.key!=null)return;u._store.validated=!0;var R=Xh(T);if(Ea[R])return;Ea[R]=!0;var Z="";u&&u._owner&&u._owner!==Dt.current&&(Z=" It was passed a child from "+E(u._owner.type)+"."),Ot(u),A('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',R,Z),Ot(null)}}function Ca(u,T){{if(typeof u!="object")return;if(Je(u))for(var R=0;R<u.length;R++){var Z=u[R];xn(Z)&&ka(Z,T)}else if(xn(u))u._store&&(u._store.validated=!0);else if(u){var fe=N(u);if(typeof fe=="function"&&fe!==u.entries)for(var be=fe.call(u),ie;!(ie=be.next()).done;)xn(ie.value)&&ka(ie.value,T)}}}function Jh(u){{var T=u.type;if(T==null||typeof T=="string")return;var R;if(typeof T=="function")R=T.propTypes;else if(typeof T=="object"&&(T.$$typeof===c||T.$$typeof===m))R=T.propTypes;else return;if(R){var Z=E(T);kt(R,u.props,"prop",Z,u)}else if(T.PropTypes!==void 0&&!vn){vn=!0;var fe=E(T);A("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",fe||"Unknown")}typeof T.getDefaultProps=="function"&&!T.getDefaultProps.isReactClassApproved&&A("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ep(u){{for(var T=Object.keys(u.props),R=0;R<T.length;R++){var Z=T[R];if(Z!=="children"&&Z!=="key"){Ot(u),A("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Z),Ot(null);break}}u.ref!==null&&(Ot(u),A("Invalid attribute `ref` supplied to `React.Fragment`."),Ot(null))}}function Da(u,T,R,Z,fe,be){{var ie=re(u);if(!ie){var ae="";(u===void 0||typeof u=="object"&&u!==null&&Object.keys(u).length===0)&&(ae+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var je=Kh(fe);je?ae+=je:ae+=Pa();var Ce;u===null?Ce="null":Je(u)?Ce="array":u!==void 0&&u.$$typeof===r?(Ce="<"+(E(u.type)||"Unknown")+" />",ae=" Did you accidentally export a JSX literal instead of a component?"):Ce=typeof u,A("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ce,ae)}var De=Dr(u,T,R,fe,be);if(De==null)return De;if(ie){var Le=T.children;if(Le!==void 0)if(Z)if(Je(Le)){for(var Nt=0;Nt<Le.length;Nt++)Ca(Le[Nt],u);Object.freeze&&Object.freeze(Le)}else A("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ca(Le,u)}return u===n?ep(De):Jh(De),De}}function tp(u,T,R){return Da(u,T,R,!0)}function rp(u,T,R){return Da(u,T,R,!1)}var np=rp,sp=tp;jt.Fragment=n,jt.jsx=np,jt.jsxs=sp}()),jt}process.env.NODE_ENV==="production"?Nr.exports=_a():Nr.exports=Ia();var f=Nr.exports;const Sn=d.createContext(void 0),Pn=()=>d.useContext(Sn),ja=({overlayKeepOnScreen:e=!0,useAnimations:r=!0,mobileMediaQuery:t,tabletMediaQuery:n,desktopMediaQuery:s,isValidScrollableElement:a,children:o})=>{const i={overlayKeepOnScreen:e,useAnimations:r,mobileMediaQuery:t,tabletMediaQuery:n,desktopMediaQuery:s,isValidScrollableElement:a};return f.jsx(Sn.Provider,{value:i,children:o})};var Ne=(e=>(e[e.Vertical=0]="Vertical",e[e.Horizontal=1]="Horizontal",e))(Ne||{}),Me=(e=>(e[e.Right=0]="Right",e[e.Left=1]="Left",e))(Me||{}),En={exports:{}};/*!
28
28
  Copyright (c) 2018 Jed Watson.
29
29
  Licensed under the MIT License (MIT), see
30
30
  http://jedwatson.github.io/classnames
31
- */(function(e){(function(){var r={}.hasOwnProperty;function t(){for(var a="",o=0;o<arguments.length;o++){var i=arguments[o];i&&(a=s(a,n(i)))}return a}function n(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return t.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var o="";for(var i in a)r.call(a,i)&&a[i]&&(o=s(o,i));return o}function s(a,o){return o?a?a+" "+o:a+o:a}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(hn);var Ta=hn.exports;const ve=cn(Ta);var vr=(e=>(e[e.Focus=0]="Focus",e[e.FocusWithin=1]="FocusWithin",e))(vr||{});const pn=(e=1)=>d.useMemo(()=>ve("dark:bsc-ring-mono-light-2 dark:bsc-ring-offset-mono-dark-1",{"focus-within:bsc-ring focus-within:bsc-ring-offset-2 focus-within:bsc-ring-opacity-50":e===1,"focus:bsc-ring focus:bsc-ring-offset-2 focus:bsc-ring-opacity-50":e===0}),[e]),Pa=(e,r)=>{const t=d.useRef(null),{buttonType:n,buttonStyle:s="flat",type:a="button",disabled:o=!1,form:i,fullWidth:c=!1,onClick:l,className:h,children:b}=e,w=()=>{l==null||l()},x=()=>{var k;(k=t.current)==null||k.click()};d.useImperativeHandle(r,()=>({click:x}));const P=pn(vr.Focus),D=ve("bc-button max-sm:bsc-p-4 md:bsc-p-2 dark:bsc-bg-mono-light-1 dark:hover:bsc-bg-mono-light-2 dark:bsc-text-mono-dark-1",P,{"bsc-w-full":c,"bc-disabled bsc-bg-gray-3 bsc-text-gray-2 bsc-pointer-events-none":o,"bsc-bg-primary-1 bsc-text-white hover:bsc-bg-primary-2 focus:bsc-ring-primary-1":n==="primary","bsc-bg-primary-2 bsc-text-white hover:bsc-bg-primary-3 focus:bsc-ring-primary-2":n==="secondary","bsc-bg-info bsc-text-white focus:bsc-ring-info":n==="info","bsc-bg-success bsc-text-white focus:bsc-ring-success":n==="success","bsc-bg-warning bsc-text-white focus:bsc-ring-warning":n==="warning","bsc-bg-error bsc-text-white focus:bsc-ring-error":n==="error","bsc-rounded-md":s==="curved","bsc-rounded-full !bsc-px-4":s==="round"},h);return f.jsx("button",{ref:t,type:a,onClick:w,disabled:o,form:i,className:D,children:b})},$e=d.forwardRef(Pa),Bt=e=>e==null?!1:typeof e=="object",Ea=e=>Array.isArray(e)&&e.every(r=>Bt(r)),Sa=e=>e instanceof Date,Ca=e=>Array.isArray(e)&&e.every(r=>r instanceof Date),mn=e=>typeof e=="function",Da=e=>Array.isArray(e)&&e.every(r=>mn(r)),bn=e=>{const r=typeof e;return r==="string"||r==="number"||r==="boolean"||r==="bigint"},ka=e=>Array.isArray(e)&&e.every(r=>bn(r)),xr=e=>{if(!Bt(e))return e;const r={},t=Object.keys(e);for(let n=t.length;n--!==0;){const s=t[n],a=e[s];bn(a)||mn(a)?r[s]=a:Sa(a)?r[s]=new Date(a.getTime()):Array.isArray(a)?r[s]=gn(a):Bt(a)&&(r[s]=xr(a))}return r},Oa=e=>{let r=e.length;const t=new Array(r);for(;r--!==0;)t[r]=e[r];return t},Na=e=>{let r=e.length;const t=new Array(r);for(;r--!==0;)t[r]=new Date(e[r].getTime());return t},_a=e=>{let r=e.length;const t=new Array(r);for(;r--!==0;)t[r]=xr(e[r]);return t},gn=e=>{if(ka(e)||Da(e))return Oa(e);if(Ca(e))return Na(e);if(Ea(e))return _a(e);let r=e.length;const t=new Array(r);for(;r--!==0;)t[r]=e[r];return t},ja=e=>Bt(e)?Array.isArray(e)?gn(e):xr(e):e;function Ia(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ma=function e(r,t){if(r===t)return!0;if(r&&t&&typeof r=="object"&&typeof t=="object"){if(r.constructor!==t.constructor)return!1;var n,s,a;if(Array.isArray(r)){if(n=r.length,n!=t.length)return!1;for(s=n;s--!==0;)if(!e(r[s],t[s]))return!1;return!0}if(r.constructor===RegExp)return r.source===t.source&&r.flags===t.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===t.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===t.toString();if(a=Object.keys(r),n=a.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,a[s]))return!1;for(s=n;s--!==0;){var o=a[s];if(!e(r[o],t[o]))return!1}return!0}return r!==r&&t!==t};const yn=Ia(Ma),Ra=(e,r)=>{for(let t=e.length;t--!==0;)if(e[t]!==r[t]&&!yn(e[t],r[t]))return!0;return!1},La=(e,r)=>{const t=d.useRef([]),n=t.current.length>0&&t.current[0]&&Ra(t.current[0],r);return(t.current.length===0||n)&&(t.current=[ja(r),e()]),t.current[1]},vn=e=>{const r=d.useRef();let t=!1;r.current!==void 0&&(t=!yn(r.current,e));const n={changed:t,previousValue:r.current};return r.current=e,n},Aa=e=>typeof e=="function",$a=e=>{const[r,t]=d.useState({value:e,initial:!0}),n=d.useRef(e);return[r,s=>{if(!Aa(s))t({value:s,initial:!1});else{const a=s(n.current);n.current=a,t({value:a,initial:!1})}}]},Fa=e=>{const[r,t]=$a(e),n=d.useRef({value:e,initial:!0});return n.current!==r&&(n.current=r),[r,t,n]},Ya=e=>{const[r,t]=d.useState(!0),n=dn();return d.useEffect(()=>{e!==void 0?t(e):n&&n.useAnimations!==void 0&&t(n.useAnimations)},[n,e]),r},Ut=({label:e,htmlFor:r,readOnly:t=!1,className:n})=>{const s=ve("bc-label",{"bsc-text-black dark:bsc-text-mono-light-1":!t,"bc-read-only bsc-text-gray-4 dark:bsc-text-mono-light-3 bsc-pointer-events-none":t},n);return f.jsx("label",{htmlFor:r,className:s,children:e})},Ha=(e,r)=>{const{name:t,label:n,value:s,readOnly:a=!1,checked:o=!1,partial:i=!1,labelLocation:c=Je.Right,className:l,useAnimation:h,onChange:b}=e,[w,x,P]=Fa({checked:!1,partial:!1}),D=vn(o),k=vn(i),E=d.useId(),L=Ya(h);d.useEffect(()=>{if(w.initial)x({checked:i?!0:o,partial:i});else{const q=D.changed?o:w.value.checked,S=k.changed?i:w.value.partial;x({checked:S?!0:q,partial:S})}},[o,i]);const U=q=>{var T;const S=((T=P.current)==null?void 0:T.value.partial)===!0?!0:q.target.checked;x({checked:S,partial:!1}),b==null||b({originalEvent:q,name:t||q.target.name,value:s,checked:S})},$=q=>{var T;const S={checked:q?!0:((T=P.current)==null?void 0:T.value.checked)||!1,partial:q};x(S)},y=q=>{x({checked:q,partial:!1})};d.useImperativeHandle(r,()=>({setPartiallyChecked:$,setChecked:y}));const A=ve("bc-checkbox-wrapper bsc-flex bsc-items-center",{"bc-read-only bsc-pointer-events-none bsc-text-gray-2 dark:bsc-text-mono-light-3":a},l),O=ve("bc-checkbox-label bsc-cursor-pointer",{"bsc-ml-2":c===Je.Right,"bsc-mr-2":c===Je.Left}),H=pn(vr.FocusWithin),F=ve("bc-checkbox-outer bsc-relative bsc-rounded *:bsc-block *:bsc-size-[21px]",{"bsc-checkbox-animate":!a&&L,"bc-read-only bsc-checkbox-no-animate":a||!a&&!L},H),re=ve("bc-checkbox-inner bsc-relative bsc-m-0 bsc-cursor-pointer bsc-appearance-none bsc-rounded bsc-border-none bsc-bg-mono-light-1 bsc-p-0 bsc-outline-none dark:bsc-bg-mono-dark-1 dark:checked:bsc-bg-mono-light-1",{"[transition:box-shadow_0.3s]":L,"bsc-checkbox":!a,"bc-read-only bsc-checkbox-read-only":a}),ee=ve("bc-checkbox-svg bsc-pointer-events-none bsc-absolute bsc-left-0 bsc-top-0 bsc-stroke-mono-light-1 bsc-stroke-2 [stroke-linecap:round] [stroke-linejoin:round] [transform:scale(0)_translateZ(0)] dark:bsc-stroke-mono-dark-3",{"bsc-fill-primary-1 dark:bsc-fill-mono-light-1":!a,"bc-read-only bsc-fill-primary-4 dark:bsc-fill-mono-light-3":a});return f.jsxs("div",{className:A,children:[n&&c===Je.Left&&f.jsx(Ut,{label:n,htmlFor:E,readOnly:a,className:O}),f.jsxs("label",{className:F,children:[f.jsx("input",{id:E,name:t,type:"checkbox",checked:w.value.checked,onChange:U,className:re}),f.jsx("svg",{viewBox:"0 0 21 21",className:ee,children:w.value.partial?f.jsx("polyline",{points:"6 10.5 16 10.5"}):f.jsx("polyline",{points:"5 10.75 8.5 14.25 16 6"})})]}),n&&c===Je.Right&&f.jsx(Ut,{label:n,htmlFor:E,readOnly:a,className:O})]})},xn=d.forwardRef(Ha),Wa=({name:e,label:r,value:t,data:n,textField:s,valueField:a,readOnly:o=!1,orientation:i=Vt.Vertical,className:c,onChange:l})=>{const[h,b]=d.useState([]),w=La(()=>n,[n]);d.useEffect(()=>{b(t??[])},[t]);const x=L=>{const{value:U,checked:$}=L;let y;$?y=[...h,U]:y=h.filter(A=>A!==U),b(y),l==null||l({name:e,value:y})},P=(L,U)=>f.jsx(xn,{name:e,label:L[s],value:L[a],checked:h.some($=>$===L[a]),readOnly:o,onChange:$=>$&&x($),className:"bsc-mr-3"},`${e}_checkbox_${U}`),D=ve("bsc-flex bsc-flex-col bsc-gap-1",c),k=ve("bsc-flex bsc-gap-1",{"bsc-flex-col":i===Vt.Vertical}),E=L=>f.jsx("div",{className:k,children:L.map(P)});return f.jsxs("div",{className:D,children:[r&&f.jsx(Ut,{label:r,readOnly:o}),w&&E(w)]})};var Va=typeof global=="object"&&global&&global.Object===Object&&global;const wn=Va;var Ba=typeof self=="object"&&self&&self.Object===Object&&self,Ua=wn||Ba||Function("return this")();const Le=Ua;var qa=Le.Symbol;const ct=qa;var Tn=Object.prototype,za=Tn.hasOwnProperty,Ga=Tn.toString,Dt=ct?ct.toStringTag:void 0;function Za(e){var r=za.call(e,Dt),t=e[Dt];try{e[Dt]=void 0;var n=!0}catch{}var s=Ga.call(e);return n&&(r?e[Dt]=t:delete e[Dt]),s}var Qa=Object.prototype,Ka=Qa.toString;function Xa(e){return Ka.call(e)}var Ja="[object Null]",eo="[object Undefined]",Pn=ct?ct.toStringTag:void 0;function ut(e){return e==null?e===void 0?eo:Ja:Pn&&Pn in Object(e)?Za(e):Xa(e)}function lt(e){return e!=null&&typeof e=="object"}var to="[object Symbol]";function ro(e){return typeof e=="symbol"||lt(e)&&ut(e)==to}var no=Array.isArray;const wr=no;var so=/\s/;function ao(e){for(var r=e.length;r--&&so.test(e.charAt(r)););return r}var oo=/^\s+/;function io(e){return e&&e.slice(0,ao(e)+1).replace(oo,"")}function Ve(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var En=0/0,co=/^[-+]0x[0-9a-f]+$/i,uo=/^0b[01]+$/i,lo=/^0o[0-7]+$/i,fo=parseInt;function Sn(e){if(typeof e=="number")return e;if(ro(e))return En;if(Ve(e)){var r=typeof e.valueOf=="function"?e.valueOf():e;e=Ve(r)?r+"":r}if(typeof e!="string")return e===0?e:+e;e=io(e);var t=uo.test(e);return t||lo.test(e)?fo(e.slice(2),t?2:8):co.test(e)?En:+e}var ho="[object AsyncFunction]",po="[object Function]",mo="[object GeneratorFunction]",bo="[object Proxy]";function Cn(e){if(!Ve(e))return!1;var r=ut(e);return r==po||r==mo||r==ho||r==bo}var go=Le["__core-js_shared__"];const Tr=go;var Dn=function(){var e=/[^.]+$/.exec(Tr&&Tr.keys&&Tr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function yo(e){return!!Dn&&Dn in e}var vo=Function.prototype,xo=vo.toString;function et(e){if(e!=null){try{return xo.call(e)}catch{}try{return e+""}catch{}}return""}var wo=/[\\^$.*+?()[\]{}|]/g,To=/^\[object .+?Constructor\]$/,Po=Function.prototype,Eo=Object.prototype,So=Po.toString,Co=Eo.hasOwnProperty,Do=RegExp("^"+So.call(Co).replace(wo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ko(e){if(!Ve(e)||yo(e))return!1;var r=Cn(e)?Do:To;return r.test(et(e))}function Oo(e,r){return e==null?void 0:e[r]}function tt(e,r){var t=Oo(e,r);return ko(t)?t:void 0}var No=tt(Le,"WeakMap");const Pr=No;var kn=Object.create,_o=function(){function e(){}return function(r){if(!Ve(r))return{};if(kn)return kn(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}();const jo=_o;function Io(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r}var Mo=function(){try{var e=tt(Object,"defineProperty");return e({},"",{}),e}catch{}}();const On=Mo;function Ro(e,r){for(var t=-1,n=e==null?0:e.length;++t<n&&r(e[t],t,e)!==!1;);return e}var Lo=9007199254740991,Ao=/^(?:0|[1-9]\d*)$/;function $o(e,r){var t=typeof e;return r=r??Lo,!!r&&(t=="number"||t!="symbol"&&Ao.test(e))&&e>-1&&e%1==0&&e<r}function Nn(e,r,t){r=="__proto__"&&On?On(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}function _n(e,r){return e===r||e!==e&&r!==r}var Fo=Object.prototype,Yo=Fo.hasOwnProperty;function jn(e,r,t){var n=e[r];(!(Yo.call(e,r)&&_n(n,t))||t===void 0&&!(r in e))&&Nn(e,r,t)}function qt(e,r,t,n){var s=!t;t||(t={});for(var a=-1,o=r.length;++a<o;){var i=r[a],c=n?n(t[i],e[i],i,t,e):void 0;c===void 0&&(c=e[i]),s?Nn(t,i,c):jn(t,i,c)}return t}var Ho=9007199254740991;function In(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ho}function Mn(e){return e!=null&&In(e.length)&&!Cn(e)}var Wo=Object.prototype;function Er(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||Wo;return e===t}function Vo(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}var Bo="[object Arguments]";function Rn(e){return lt(e)&&ut(e)==Bo}var Ln=Object.prototype,Uo=Ln.hasOwnProperty,qo=Ln.propertyIsEnumerable,zo=Rn(function(){return arguments}())?Rn:function(e){return lt(e)&&Uo.call(e,"callee")&&!qo.call(e,"callee")};const Go=zo;function Zo(){return!1}var An=typeof J=="object"&&J&&!J.nodeType&&J,$n=An&&typeof module=="object"&&module&&!module.nodeType&&module,Qo=$n&&$n.exports===An,Fn=Qo?Le.Buffer:void 0,Ko=Fn?Fn.isBuffer:void 0,Xo=Ko||Zo;const Yn=Xo;var Jo="[object Arguments]",ei="[object Array]",ti="[object Boolean]",ri="[object Date]",ni="[object Error]",si="[object Function]",ai="[object Map]",oi="[object Number]",ii="[object Object]",ci="[object RegExp]",ui="[object Set]",li="[object String]",fi="[object WeakMap]",di="[object ArrayBuffer]",hi="[object DataView]",pi="[object Float32Array]",mi="[object Float64Array]",bi="[object Int8Array]",gi="[object Int16Array]",yi="[object Int32Array]",vi="[object Uint8Array]",xi="[object Uint8ClampedArray]",wi="[object Uint16Array]",Ti="[object Uint32Array]",ge={};ge[pi]=ge[mi]=ge[bi]=ge[gi]=ge[yi]=ge[vi]=ge[xi]=ge[wi]=ge[Ti]=!0,ge[Jo]=ge[ei]=ge[di]=ge[ti]=ge[hi]=ge[ri]=ge[ni]=ge[si]=ge[ai]=ge[oi]=ge[ii]=ge[ci]=ge[ui]=ge[li]=ge[fi]=!1;function Pi(e){return lt(e)&&In(e.length)&&!!ge[ut(e)]}function Sr(e){return function(r){return e(r)}}var Hn=typeof J=="object"&&J&&!J.nodeType&&J,kt=Hn&&typeof module=="object"&&module&&!module.nodeType&&module,Ei=kt&&kt.exports===Hn,Cr=Ei&&wn.process,Si=function(){try{var e=kt&&kt.require&&kt.require("util").types;return e||Cr&&Cr.binding&&Cr.binding("util")}catch{}}();const ft=Si;var Wn=ft&&ft.isTypedArray,Ci=Wn?Sr(Wn):Pi;const Di=Ci;var ki=Object.prototype,Oi=ki.hasOwnProperty;function Vn(e,r){var t=wr(e),n=!t&&Go(e),s=!t&&!n&&Yn(e),a=!t&&!n&&!s&&Di(e),o=t||n||s||a,i=o?Vo(e.length,String):[],c=i.length;for(var l in e)(r||Oi.call(e,l))&&!(o&&(l=="length"||s&&(l=="offset"||l=="parent")||a&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||$o(l,c)))&&i.push(l);return i}function Bn(e,r){return function(t){return e(r(t))}}var Ni=Bn(Object.keys,Object);const _i=Ni;var ji=Object.prototype,Ii=ji.hasOwnProperty;function Mi(e){if(!Er(e))return _i(e);var r=[];for(var t in Object(e))Ii.call(e,t)&&t!="constructor"&&r.push(t);return r}function Dr(e){return Mn(e)?Vn(e):Mi(e)}function Ri(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}var Li=Object.prototype,Ai=Li.hasOwnProperty;function $i(e){if(!Ve(e))return Ri(e);var r=Er(e),t=[];for(var n in e)n=="constructor"&&(r||!Ai.call(e,n))||t.push(n);return t}function kr(e){return Mn(e)?Vn(e,!0):$i(e)}var Fi=tt(Object,"create");const Ot=Fi;function Yi(){this.__data__=Ot?Ot(null):{},this.size=0}function Hi(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var Wi="__lodash_hash_undefined__",Vi=Object.prototype,Bi=Vi.hasOwnProperty;function Ui(e){var r=this.__data__;if(Ot){var t=r[e];return t===Wi?void 0:t}return Bi.call(r,e)?r[e]:void 0}var qi=Object.prototype,zi=qi.hasOwnProperty;function Gi(e){var r=this.__data__;return Ot?r[e]!==void 0:zi.call(r,e)}var Zi="__lodash_hash_undefined__";function Qi(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=Ot&&r===void 0?Zi:r,this}function rt(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}rt.prototype.clear=Yi,rt.prototype.delete=Hi,rt.prototype.get=Ui,rt.prototype.has=Gi,rt.prototype.set=Qi;function Ki(){this.__data__=[],this.size=0}function zt(e,r){for(var t=e.length;t--;)if(_n(e[t][0],r))return t;return-1}var Xi=Array.prototype,Ji=Xi.splice;function ec(e){var r=this.__data__,t=zt(r,e);if(t<0)return!1;var n=r.length-1;return t==n?r.pop():Ji.call(r,t,1),--this.size,!0}function tc(e){var r=this.__data__,t=zt(r,e);return t<0?void 0:r[t][1]}function rc(e){return zt(this.__data__,e)>-1}function nc(e,r){var t=this.__data__,n=zt(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this}function Be(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}Be.prototype.clear=Ki,Be.prototype.delete=ec,Be.prototype.get=tc,Be.prototype.has=rc,Be.prototype.set=nc;var sc=tt(Le,"Map");const Nt=sc;function ac(){this.size=0,this.__data__={hash:new rt,map:new(Nt||Be),string:new rt}}function oc(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}function Gt(e,r){var t=e.__data__;return oc(r)?t[typeof r=="string"?"string":"hash"]:t.map}function ic(e){var r=Gt(this,e).delete(e);return this.size-=r?1:0,r}function cc(e){return Gt(this,e).get(e)}function uc(e){return Gt(this,e).has(e)}function lc(e,r){var t=Gt(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}function dt(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}dt.prototype.clear=ac,dt.prototype.delete=ic,dt.prototype.get=cc,dt.prototype.has=uc,dt.prototype.set=lc;function Un(e,r){for(var t=-1,n=r.length,s=e.length;++t<n;)e[s+t]=r[t];return e}var fc=Bn(Object.getPrototypeOf,Object);const qn=fc;function dc(){this.__data__=new Be,this.size=0}function hc(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}function pc(e){return this.__data__.get(e)}function mc(e){return this.__data__.has(e)}var bc=200;function gc(e,r){var t=this.__data__;if(t instanceof Be){var n=t.__data__;if(!Nt||n.length<bc-1)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new dt(n)}return t.set(e,r),this.size=t.size,this}function ht(e){var r=this.__data__=new Be(e);this.size=r.size}ht.prototype.clear=dc,ht.prototype.delete=hc,ht.prototype.get=pc,ht.prototype.has=mc,ht.prototype.set=gc;function yc(e,r){return e&&qt(r,Dr(r),e)}function vc(e,r){return e&&qt(r,kr(r),e)}var zn=typeof J=="object"&&J&&!J.nodeType&&J,Gn=zn&&typeof module=="object"&&module&&!module.nodeType&&module,xc=Gn&&Gn.exports===zn,Zn=xc?Le.Buffer:void 0,Qn=Zn?Zn.allocUnsafe:void 0;function wc(e,r){if(r)return e.slice();var t=e.length,n=Qn?Qn(t):new e.constructor(t);return e.copy(n),n}function Tc(e,r){for(var t=-1,n=e==null?0:e.length,s=0,a=[];++t<n;){var o=e[t];r(o,t,e)&&(a[s++]=o)}return a}function Kn(){return[]}var Pc=Object.prototype,Ec=Pc.propertyIsEnumerable,Xn=Object.getOwnPropertySymbols,Sc=Xn?function(e){return e==null?[]:(e=Object(e),Tc(Xn(e),function(r){return Ec.call(e,r)}))}:Kn;const Or=Sc;function Cc(e,r){return qt(e,Or(e),r)}var Dc=Object.getOwnPropertySymbols,kc=Dc?function(e){for(var r=[];e;)Un(r,Or(e)),e=qn(e);return r}:Kn;const Jn=kc;function Oc(e,r){return qt(e,Jn(e),r)}function es(e,r,t){var n=r(e);return wr(e)?n:Un(n,t(e))}function Nc(e){return es(e,Dr,Or)}function _c(e){return es(e,kr,Jn)}var jc=tt(Le,"DataView");const Nr=jc;var Ic=tt(Le,"Promise");const _r=Ic;var Mc=tt(Le,"Set");const jr=Mc;var ts="[object Map]",Rc="[object Object]",rs="[object Promise]",ns="[object Set]",ss="[object WeakMap]",as="[object DataView]",Lc=et(Nr),Ac=et(Nt),$c=et(_r),Fc=et(jr),Yc=et(Pr),nt=ut;(Nr&&nt(new Nr(new ArrayBuffer(1)))!=as||Nt&&nt(new Nt)!=ts||_r&&nt(_r.resolve())!=rs||jr&&nt(new jr)!=ns||Pr&&nt(new Pr)!=ss)&&(nt=function(e){var r=ut(e),t=r==Rc?e.constructor:void 0,n=t?et(t):"";if(n)switch(n){case Lc:return as;case Ac:return ts;case $c:return rs;case Fc:return ns;case Yc:return ss}return r});const Ir=nt;var Hc=Object.prototype,Wc=Hc.hasOwnProperty;function Vc(e){var r=e.length,t=new e.constructor(r);return r&&typeof e[0]=="string"&&Wc.call(e,"index")&&(t.index=e.index,t.input=e.input),t}var Bc=Le.Uint8Array;const os=Bc;function Mr(e){var r=new e.constructor(e.byteLength);return new os(r).set(new os(e)),r}function Uc(e,r){var t=r?Mr(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}var qc=/\w*$/;function zc(e){var r=new e.constructor(e.source,qc.exec(e));return r.lastIndex=e.lastIndex,r}var is=ct?ct.prototype:void 0,cs=is?is.valueOf:void 0;function Gc(e){return cs?Object(cs.call(e)):{}}function Zc(e,r){var t=r?Mr(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}var Qc="[object Boolean]",Kc="[object Date]",Xc="[object Map]",Jc="[object Number]",eu="[object RegExp]",tu="[object Set]",ru="[object String]",nu="[object Symbol]",su="[object ArrayBuffer]",au="[object DataView]",ou="[object Float32Array]",iu="[object Float64Array]",cu="[object Int8Array]",uu="[object Int16Array]",lu="[object Int32Array]",fu="[object Uint8Array]",du="[object Uint8ClampedArray]",hu="[object Uint16Array]",pu="[object Uint32Array]";function mu(e,r,t){var n=e.constructor;switch(r){case su:return Mr(e);case Qc:case Kc:return new n(+e);case au:return Uc(e,t);case ou:case iu:case cu:case uu:case lu:case fu:case du:case hu:case pu:return Zc(e,t);case Xc:return new n;case Jc:case ru:return new n(e);case eu:return zc(e);case tu:return new n;case nu:return Gc(e)}}function bu(e){return typeof e.constructor=="function"&&!Er(e)?jo(qn(e)):{}}var gu="[object Map]";function yu(e){return lt(e)&&Ir(e)==gu}var us=ft&&ft.isMap,vu=us?Sr(us):yu;const xu=vu;var wu="[object Set]";function Tu(e){return lt(e)&&Ir(e)==wu}var ls=ft&&ft.isSet,Pu=ls?Sr(ls):Tu;const Eu=Pu;var Su=1,Cu=2,Du=4,fs="[object Arguments]",ku="[object Array]",Ou="[object Boolean]",Nu="[object Date]",_u="[object Error]",ds="[object Function]",ju="[object GeneratorFunction]",Iu="[object Map]",Mu="[object Number]",hs="[object Object]",Ru="[object RegExp]",Lu="[object Set]",Au="[object String]",$u="[object Symbol]",Fu="[object WeakMap]",Yu="[object ArrayBuffer]",Hu="[object DataView]",Wu="[object Float32Array]",Vu="[object Float64Array]",Bu="[object Int8Array]",Uu="[object Int16Array]",qu="[object Int32Array]",zu="[object Uint8Array]",Gu="[object Uint8ClampedArray]",Zu="[object Uint16Array]",Qu="[object Uint32Array]",me={};me[fs]=me[ku]=me[Yu]=me[Hu]=me[Ou]=me[Nu]=me[Wu]=me[Vu]=me[Bu]=me[Uu]=me[qu]=me[Iu]=me[Mu]=me[hs]=me[Ru]=me[Lu]=me[Au]=me[$u]=me[zu]=me[Gu]=me[Zu]=me[Qu]=!0,me[_u]=me[ds]=me[Fu]=!1;function Zt(e,r,t,n,s,a){var o,i=r&Su,c=r&Cu,l=r&Du;if(t&&(o=s?t(e,n,s,a):t(e)),o!==void 0)return o;if(!Ve(e))return e;var h=wr(e);if(h){if(o=Vc(e),!i)return Io(e,o)}else{var b=Ir(e),w=b==ds||b==ju;if(Yn(e))return wc(e,i);if(b==hs||b==fs||w&&!s){if(o=c||w?{}:bu(e),!i)return c?Oc(e,vc(o,e)):Cc(e,yc(o,e))}else{if(!me[b])return s?e:{};o=mu(e,b,i)}}a||(a=new ht);var x=a.get(e);if(x)return x;a.set(e,o),Eu(e)?e.forEach(function(k){o.add(Zt(k,r,t,k,e,a))}):xu(e)&&e.forEach(function(k,E){o.set(E,Zt(k,r,t,E,e,a))});var P=l?c?_c:Nc:c?kr:Dr,D=h?void 0:P(e);return Ro(D||e,function(k,E){D&&(E=k,k=e[E]),jn(o,E,Zt(k,r,t,E,e,a))}),o}var Ku=1,Xu=4;function Ju(e){return Zt(e,Ku|Xu)}var el=function(){return Le.Date.now()};const Rr=el;var tl="Expected a function",rl=Math.max,nl=Math.min;function _t(e,r,t){var n,s,a,o,i,c,l=0,h=!1,b=!1,w=!0;if(typeof e!="function")throw new TypeError(tl);r=Sn(r)||0,Ve(t)&&(h=!!t.leading,b="maxWait"in t,a=b?rl(Sn(t.maxWait)||0,r):a,w="trailing"in t?!!t.trailing:w);function x(A){var O=n,H=s;return n=s=void 0,l=A,o=e.apply(H,O),o}function P(A){return l=A,i=setTimeout(E,r),h?x(A):o}function D(A){var O=A-c,H=A-l,F=r-O;return b?nl(F,a-H):F}function k(A){var O=A-c,H=A-l;return c===void 0||O>=r||O<0||b&&H>=a}function E(){var A=Rr();if(k(A))return L(A);i=setTimeout(E,D(A))}function L(A){return i=void 0,w&&n?x(A):(n=s=void 0,o)}function U(){i!==void 0&&clearTimeout(i),l=0,n=c=s=i=void 0}function $(){return i===void 0?o:L(Rr())}function y(){var A=Rr(),O=k(A);if(n=arguments,s=this,c=A,O){if(i===void 0)return P(c);if(b)return clearTimeout(i),i=setTimeout(E,r),x(c)}return i===void 0&&(i=setTimeout(E,r)),o}return y.cancel=U,y.flush=$,y}var sl="Expected a function";function al(e,r,t){var n=!0,s=!0;if(typeof e!="function")throw new TypeError(sl);return Ve(t)&&(n="leading"in t?!!t.leading:n,s="trailing"in t?!!t.trailing:s),_t(e,r,{leading:n,maxWait:r,trailing:s})}const ol=(e,r)=>{const{value:t,readOnly:n=!1,debounceTime:s=800,fillContainer:a=!0,leftElement:o,rightElement:i,className:c,leftElementClassName:l,rightElementClassName:h,isSingleLine:b=!0,allowSingleLineScroll:w=!1,inputMode:x,placeholder:P,onFocus:D,onBlur:k,onInput:E,onInnerTextChange:L,onInnerHTMLChange:U,onElementCreate:$,onLeftElementClick:y,onRightElementClick:A}=e,O=d.useRef("bsc-flex-grow focus:bsc-outline-none"),H=d.useRef("bsc-text-gray-4"),F=d.useRef(),re=d.useCallback(p=>{const N=p.target,V=N.innerHTML;N.className=`${O.current}`,P&&V===P&&(N.innerHTML=""),D==null||D(p)},[P,D]),ee=d.useCallback(p=>{const N=p.target.innerHTML;if(P&&N===""){const V=p.target;V.innerHTML=P,V.className=`${O.current} ${H.current}`}k==null||k(p)},[P,k]),q=d.useCallback(p=>{var N,V;(N=F.current)==null||N.removeEventListener("focus",re),(V=F.current)==null||V.removeEventListener("blur",ee),P&&p&&p!==document.activeElement&&p.innerHTML===""&&(p.innerHTML=P,p.className=`${O.current} ${H.current}`),p.addEventListener("focus",re),p.addEventListener("blur",ee),F.current=p},[P]),S=d.useCallback(p=>{$==null||$(p)},[$]),T=p=>{y==null||y(p)},B=p=>{A==null||A(p)},Y=_t(p=>{E==null||E(p),L==null||L(p.target.innerText),U==null||U(p.target.innerHTML)},s),se=d.useCallback(p=>{F.current&&(F.current.innerText=p)},[]),M=d.useCallback(p=>{F.current&&(F.current.innerHTML=p)},[]),he=d.useCallback(()=>{var p;(p=F.current)==null||p.focus()},[]);d.useImperativeHandle(r,()=>({inputElement:F.current,setInnerText:se,setInnerHTML:M,focus:he}));const g=ve({"bsc-w-full ":a},"bsc-flex bsc-flex-row bsc-items-center bsc-shadow-sm bsc-border bsc-border-solid bsc-border-gray-3 dark:bsc-border-white dark:bsc-bg-mono-dark-1 dark:bsc-text-mono-light-1 bsc-rounded-md bsc-p-2",{"bsc-overflow-x-auto bsc-overflow-y-hidden bsc-whitespace-pre":b&&w,"bsc-overflow-hidden bsc-whitespace-pre":b&&!w},c),C=ve("bsc-flex-shrink",{"bsc-mr-2":o},l),z=ve("bsc-flex-shrink",{"bsc-ml-2":i},h);return f.jsxs("div",{className:g,ref:p=>p&&S(p),children:[o&&f.jsx("div",{className:C,onClick:T,children:o}),f.jsx("div",{ref:p=>p&&q(p),className:O.current,contentEditable:!n,suppressContentEditableWarning:!0,inputMode:x,onInput:Y,children:t}),i&&f.jsx("div",{className:z,onClick:B,children:i})]})},Qt=d.forwardRef(ol);function oe(e){const r=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&r==="[object Date]"?new e.constructor(+e):typeof e=="number"||r==="[object Number]"||typeof e=="string"||r==="[object String]"?new Date(e):new Date(NaN)}function be(e,r){return e instanceof Date?new e.constructor(r):new Date(r)}function pt(e,r){const t=oe(e);return isNaN(r)?be(e,NaN):(r&&t.setDate(t.getDate()+r),t)}function st(e,r){const t=oe(e);if(isNaN(r))return be(e,NaN);if(!r)return t;const n=t.getDate(),s=be(e,t.getTime());s.setMonth(t.getMonth()+r+1,0);const a=s.getDate();return n>=a?s:(t.setFullYear(s.getFullYear(),s.getMonth(),n),t)}const ps=6048e5,Lr=6e4,Ar=36e5,il=1e3;let cl={};function jt(){return cl}function Ke(e,r){var i,c,l,h;const t=jt(),n=(r==null?void 0:r.weekStartsOn)??((c=(i=r==null?void 0:r.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??t.weekStartsOn??((h=(l=t.locale)==null?void 0:l.options)==null?void 0:h.weekStartsOn)??0,s=oe(e),a=s.getDay(),o=(a<n?7:0)+a-n;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function mt(e){return Ke(e,{weekStartsOn:1})}function ul(e){const r=oe(e),t=r.getFullYear(),n=be(e,0);n.setFullYear(t+1,0,4),n.setHours(0,0,0,0);const s=mt(n),a=be(e,0);a.setFullYear(t,0,4),a.setHours(0,0,0,0);const o=mt(a);return r.getTime()>=s.getTime()?t+1:r.getTime()>=o.getTime()?t:t-1}function ms(e){const r=oe(e);return r.setHours(0,0,0,0),r}function bs(e){const r=oe(e),t=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return t.setUTCFullYear(r.getFullYear()),+e-+t}function ll(e){const r=ul(e),t=be(e,0);return t.setFullYear(r,0,4),t.setHours(0,0,0,0),mt(t)}function Kt(e,r){return st(e,r*12)}function gs(e,r){const t=ms(e),n=ms(r);return+t==+n}function fl(e){const r=oe(e),t=r.getMonth();return r.setFullYear(r.getFullYear(),t+1,0),r.setHours(23,59,59,999),r}function dl(e,r){const t=oe(e.start),n=oe(e.end);let s=+t>+n;const a=s?+t:+n,o=s?n:t;o.setHours(0,0,0,0);let i=(r==null?void 0:r.step)??1;if(!i)return[];i<0&&(i=-i,s=!s);const c=[];for(;+o<=a;)c.push(oe(o)),o.setDate(o.getDate()+i),o.setHours(0,0,0,0);return s?c.reverse():c}function ys(e){const r=oe(e);return r.setDate(1),r.setHours(0,0,0,0),r}function hl(e,r){const t=oe(e.start),n=oe(e.end);let s=+t>+n;const a=s?+t:+n,o=s?n:t;o.setHours(0,0,0,0),o.setMonth(0,1);let i=(r==null?void 0:r.step)??1;if(!i)return[];i<0&&(i=-i,s=!s);const c=[];for(;+o<=a;)c.push(oe(o)),o.setFullYear(o.getFullYear()+i);return s?c.reverse():c}const pl={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ml=(e,r,t)=>{let n;const s=pl[e];return typeof s=="string"?n=s:r===1?n=s.one:n=s.other.replace("{{count}}",r.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+n:n+" ago":n};function $r(e){return(r={})=>{const t=r.width?String(r.width):e.defaultWidth;return e.formats[t]||e.formats[e.defaultWidth]}}const bl={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},gl={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},yl={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},vl={date:$r({formats:bl,defaultWidth:"full"}),time:$r({formats:gl,defaultWidth:"full"}),dateTime:$r({formats:yl,defaultWidth:"full"})},xl={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},wl=(e,r,t,n)=>xl[e];function It(e){return(r,t)=>{const n=t!=null&&t.context?String(t.context):"standalone";let s;if(n==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,i=t!=null&&t.width?String(t.width):o;s=e.formattingValues[i]||e.formattingValues[o]}else{const o=e.defaultWidth,i=t!=null&&t.width?String(t.width):e.defaultWidth;s=e.values[i]||e.values[o]}const a=e.argumentCallback?e.argumentCallback(r):r;return s[a]}}const Tl={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Pl={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},El={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Sl={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Cl={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Dl={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},kl={ordinalNumber:(e,r)=>{const t=Number(e),n=t%100;if(n>20||n<10)switch(n%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},era:It({values:Tl,defaultWidth:"wide"}),quarter:It({values:Pl,defaultWidth:"wide",argumentCallback:e=>e-1}),month:It({values:El,defaultWidth:"wide"}),day:It({values:Sl,defaultWidth:"wide"}),dayPeriod:It({values:Cl,defaultWidth:"wide",formattingValues:Dl,defaultFormattingWidth:"wide"})};function Mt(e){return(r,t={})=>{const n=t.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=r.match(s);if(!a)return null;const o=a[0],i=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(i)?Nl(i,b=>b.test(o)):Ol(i,b=>b.test(o));let l;l=e.valueCallback?e.valueCallback(c):c,l=t.valueCallback?t.valueCallback(l):l;const h=r.slice(o.length);return{value:l,rest:h}}}function Ol(e,r){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&r(e[t]))return t}function Nl(e,r){for(let t=0;t<e.length;t++)if(r(e[t]))return t}function _l(e){return(r,t={})=>{const n=r.match(e.matchPattern);if(!n)return null;const s=n[0],a=r.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=t.valueCallback?t.valueCallback(o):o;const i=r.slice(s.length);return{value:o,rest:i}}}const jl=/^(\d+)(th|st|nd|rd)?/i,Il=/\d+/i,Ml={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Rl={any:[/^b/i,/^(a|c)/i]},Ll={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Al={any:[/1/i,/2/i,/3/i,/4/i]},$l={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Fl={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Yl={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Hl={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Wl={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Vl={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Bl={ordinalNumber:_l({matchPattern:jl,parsePattern:Il,valueCallback:e=>parseInt(e,10)}),era:Mt({matchPatterns:Ml,defaultMatchWidth:"wide",parsePatterns:Rl,defaultParseWidth:"any"}),quarter:Mt({matchPatterns:Ll,defaultMatchWidth:"wide",parsePatterns:Al,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Mt({matchPatterns:$l,defaultMatchWidth:"wide",parsePatterns:Fl,defaultParseWidth:"any"}),day:Mt({matchPatterns:Yl,defaultMatchWidth:"wide",parsePatterns:Hl,defaultParseWidth:"any"}),dayPeriod:Mt({matchPatterns:Wl,defaultMatchWidth:"any",parsePatterns:Vl,defaultParseWidth:"any"})},Ul={code:"en-US",formatDistance:ml,formatLong:vl,formatRelative:wl,localize:kl,match:Bl,options:{weekStartsOn:0,firstWeekContainsDate:1}};function ql(e){const r=oe(e),t=+mt(r)-+ll(r);return Math.round(t/ps)+1}function vs(e,r){var h,b,w,x;const t=oe(e),n=t.getFullYear(),s=jt(),a=(r==null?void 0:r.firstWeekContainsDate)??((b=(h=r==null?void 0:r.locale)==null?void 0:h.options)==null?void 0:b.firstWeekContainsDate)??s.firstWeekContainsDate??((x=(w=s.locale)==null?void 0:w.options)==null?void 0:x.firstWeekContainsDate)??1,o=be(e,0);o.setFullYear(n+1,0,a),o.setHours(0,0,0,0);const i=Ke(o,r),c=be(e,0);c.setFullYear(n,0,a),c.setHours(0,0,0,0);const l=Ke(c,r);return t.getTime()>=i.getTime()?n+1:t.getTime()>=l.getTime()?n:n-1}function zl(e,r){var i,c,l,h;const t=jt(),n=(r==null?void 0:r.firstWeekContainsDate)??((c=(i=r==null?void 0:r.locale)==null?void 0:i.options)==null?void 0:c.firstWeekContainsDate)??t.firstWeekContainsDate??((h=(l=t.locale)==null?void 0:l.options)==null?void 0:h.firstWeekContainsDate)??1,s=vs(e,r),a=be(e,0);return a.setFullYear(s,0,n),a.setHours(0,0,0,0),Ke(a,r)}function Gl(e,r){const t=oe(e),n=+Ke(t,r)-+zl(t,r);return Math.round(n/ps)+1}const xs=(e,r)=>{switch(e){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},ws=(e,r)=>{switch(e){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},Ts={p:ws,P:(e,r)=>{const t=e.match(/(P+)(p+)?/)||[],n=t[1],s=t[2];if(!s)return xs(e,r);let a;switch(n){case"P":a=r.dateTime({width:"short"});break;case"PP":a=r.dateTime({width:"medium"});break;case"PPP":a=r.dateTime({width:"long"});break;case"PPPP":default:a=r.dateTime({width:"full"});break}return a.replace("{{date}}",xs(n,r)).replace("{{time}}",ws(s,r))}},Zl=/^D+$/,Ql=/^Y+$/,Kl=["D","DD","YY","YYYY"];function Xl(e){return Zl.test(e)}function Jl(e){return Ql.test(e)}function Ps(e,r,t){const n=ef(e,r,t);if(console.warn(n),Kl.includes(e))throw new RangeError(n)}function ef(e,r,t){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${r}\`) for formatting ${n} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function Fr(e){return oe(e).getDay()}function Es(e){const r=oe(e),t=r.getFullYear(),n=r.getMonth(),s=be(e,0);return s.setFullYear(t,n+1,0),s.setHours(0,0,0,0),s.getDate()}function tf(){return Object.assign({},jt())}function rf(e){let t=oe(e).getDay();return t===0&&(t=7),t}function nf(e){const r=oe(e),t=r.getMonth();return r.setFullYear(r.getFullYear(),t+1,0),r.setHours(0,0,0,0),r}function sf(e,r){const t=oe(e),n=oe(r);return+t<+n}function af(e,r){const t=r instanceof Date?be(r,0):new r(0);return t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),t}const of=10;class Ss{constructor(){m(this,"subPriority",0)}validate(r,t){return!0}}class cf extends Ss{constructor(r,t,n,s,a){super(),this.value=r,this.validateValue=t,this.setValue=n,this.priority=s,a&&(this.subPriority=a)}validate(r,t){return this.validateValue(r,this.value,t)}set(r,t,n){return this.setValue(r,t,this.value,n)}}class uf extends Ss{constructor(){super(...arguments);m(this,"priority",of);m(this,"subPriority",-1)}set(t,n){return n.timestampIsSet?t:be(t,af(t,Date))}}class ie{run(r,t,n,s){const a=this.parse(r,t,n,s);return a?{setter:new cf(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(r,t,n){return!0}}class lf extends ie{constructor(){super(...arguments);m(this,"priority",140);m(this,"incompatibleTokens",["R","u","t","T"])}parse(t,n,s){switch(n){case"G":case"GG":case"GGG":return s.era(t,{width:"abbreviated"})||s.era(t,{width:"narrow"});case"GGGGG":return s.era(t,{width:"narrow"});case"GGGG":default:return s.era(t,{width:"wide"})||s.era(t,{width:"abbreviated"})||s.era(t,{width:"narrow"})}}set(t,n,s){return n.era=s,t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}const Pe={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Fe={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Ee(e,r){return e&&{value:r(e.value),rest:e.rest}}function xe(e,r){const t=r.match(e);return t?{value:parseInt(t[0],10),rest:r.slice(t[0].length)}:null}function Ye(e,r){const t=r.match(e);if(!t)return null;if(t[0]==="Z")return{value:0,rest:r.slice(1)};const n=t[1]==="+"?1:-1,s=t[2]?parseInt(t[2],10):0,a=t[3]?parseInt(t[3],10):0,o=t[5]?parseInt(t[5],10):0;return{value:n*(s*Ar+a*Lr+o*il),rest:r.slice(t[0].length)}}function Cs(e){return xe(Pe.anyDigitsSigned,e)}function we(e,r){switch(e){case 1:return xe(Pe.singleDigit,r);case 2:return xe(Pe.twoDigits,r);case 3:return xe(Pe.threeDigits,r);case 4:return xe(Pe.fourDigits,r);default:return xe(new RegExp("^\\d{1,"+e+"}"),r)}}function Xt(e,r){switch(e){case 1:return xe(Pe.singleDigitSigned,r);case 2:return xe(Pe.twoDigitsSigned,r);case 3:return xe(Pe.threeDigitsSigned,r);case 4:return xe(Pe.fourDigitsSigned,r);default:return xe(new RegExp("^-?\\d{1,"+e+"}"),r)}}function Yr(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Ds(e,r){const t=r>0,n=t?r:1-r;let s;if(n<=50)s=e||100;else{const a=n+50,o=Math.trunc(a/100)*100,i=e>=a%100;s=e+o-(i?100:0)}return t?s:1-s}function ks(e){return e%400===0||e%4===0&&e%100!==0}class ff extends ie{constructor(){super(...arguments);m(this,"priority",130);m(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(t,n,s){const a=o=>({year:o,isTwoDigitYear:n==="yy"});switch(n){case"y":return Ee(we(4,t),a);case"yo":return Ee(s.ordinalNumber(t,{unit:"year"}),a);default:return Ee(we(n.length,t),a)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,s){const a=t.getFullYear();if(s.isTwoDigitYear){const i=Ds(s.year,a);return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}const o=!("era"in n)||n.era===1?s.year:1-s.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}}class df extends ie{constructor(){super(...arguments);m(this,"priority",130);m(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(t,n,s){const a=o=>({year:o,isTwoDigitYear:n==="YY"});switch(n){case"Y":return Ee(we(4,t),a);case"Yo":return Ee(s.ordinalNumber(t,{unit:"year"}),a);default:return Ee(we(n.length,t),a)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,s,a){const o=vs(t,a);if(s.isTwoDigitYear){const c=Ds(s.year,o);return t.setFullYear(c,0,a.firstWeekContainsDate),t.setHours(0,0,0,0),Ke(t,a)}const i=!("era"in n)||n.era===1?s.year:1-s.year;return t.setFullYear(i,0,a.firstWeekContainsDate),t.setHours(0,0,0,0),Ke(t,a)}}class hf extends ie{constructor(){super(...arguments);m(this,"priority",130);m(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(t,n){return Xt(n==="R"?4:n.length,t)}set(t,n,s){const a=be(t,0);return a.setFullYear(s,0,4),a.setHours(0,0,0,0),mt(a)}}class pf extends ie{constructor(){super(...arguments);m(this,"priority",130);m(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(t,n){return Xt(n==="u"?4:n.length,t)}set(t,n,s){return t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}class mf extends ie{constructor(){super(...arguments);m(this,"priority",120);m(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,n,s){switch(n){case"Q":case"QQ":return we(n.length,t);case"Qo":return s.ordinalNumber(t,{unit:"quarter"});case"QQQ":return s.quarter(t,{width:"abbreviated",context:"formatting"})||s.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(t,{width:"wide",context:"formatting"})||s.quarter(t,{width:"abbreviated",context:"formatting"})||s.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=1&&n<=4}set(t,n,s){return t.setMonth((s-1)*3,1),t.setHours(0,0,0,0),t}}class bf extends ie{constructor(){super(...arguments);m(this,"priority",120);m(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,n,s){switch(n){case"q":case"qq":return we(n.length,t);case"qo":return s.ordinalNumber(t,{unit:"quarter"});case"qqq":return s.quarter(t,{width:"abbreviated",context:"standalone"})||s.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(t,{width:"wide",context:"standalone"})||s.quarter(t,{width:"abbreviated",context:"standalone"})||s.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=1&&n<=4}set(t,n,s){return t.setMonth((s-1)*3,1),t.setHours(0,0,0,0),t}}class gf extends ie{constructor(){super(...arguments);m(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);m(this,"priority",110)}parse(t,n,s){const a=o=>o-1;switch(n){case"M":return Ee(xe(Pe.month,t),a);case"MM":return Ee(we(2,t),a);case"Mo":return Ee(s.ordinalNumber(t,{unit:"month"}),a);case"MMM":return s.month(t,{width:"abbreviated",context:"formatting"})||s.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(t,{width:"wide",context:"formatting"})||s.month(t,{width:"abbreviated",context:"formatting"})||s.month(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=11}set(t,n,s){return t.setMonth(s,1),t.setHours(0,0,0,0),t}}class yf extends ie{constructor(){super(...arguments);m(this,"priority",110);m(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(t,n,s){const a=o=>o-1;switch(n){case"L":return Ee(xe(Pe.month,t),a);case"LL":return Ee(we(2,t),a);case"Lo":return Ee(s.ordinalNumber(t,{unit:"month"}),a);case"LLL":return s.month(t,{width:"abbreviated",context:"standalone"})||s.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(t,{width:"wide",context:"standalone"})||s.month(t,{width:"abbreviated",context:"standalone"})||s.month(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=11}set(t,n,s){return t.setMonth(s,1),t.setHours(0,0,0,0),t}}function vf(e,r,t){const n=oe(e),s=Gl(n,t)-r;return n.setDate(n.getDate()-s*7),n}class xf extends ie{constructor(){super(...arguments);m(this,"priority",100);m(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(t,n,s){switch(n){case"w":return xe(Pe.week,t);case"wo":return s.ordinalNumber(t,{unit:"week"});default:return we(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,s,a){return Ke(vf(t,s,a),a)}}function wf(e,r){const t=oe(e),n=ql(t)-r;return t.setDate(t.getDate()-n*7),t}class Tf extends ie{constructor(){super(...arguments);m(this,"priority",100);m(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(t,n,s){switch(n){case"I":return xe(Pe.week,t);case"Io":return s.ordinalNumber(t,{unit:"week"});default:return we(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,s){return mt(wf(t,s))}}const Pf=[31,28,31,30,31,30,31,31,30,31,30,31],Ef=[31,29,31,30,31,30,31,31,30,31,30,31];class Sf extends ie{constructor(){super(...arguments);m(this,"priority",90);m(this,"subPriority",1);m(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(t,n,s){switch(n){case"d":return xe(Pe.date,t);case"do":return s.ordinalNumber(t,{unit:"date"});default:return we(n.length,t)}}validate(t,n){const s=t.getFullYear(),a=ks(s),o=t.getMonth();return a?n>=1&&n<=Ef[o]:n>=1&&n<=Pf[o]}set(t,n,s){return t.setDate(s),t.setHours(0,0,0,0),t}}class Cf extends ie{constructor(){super(...arguments);m(this,"priority",90);m(this,"subpriority",1);m(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(t,n,s){switch(n){case"D":case"DD":return xe(Pe.dayOfYear,t);case"Do":return s.ordinalNumber(t,{unit:"date"});default:return we(n.length,t)}}validate(t,n){const s=t.getFullYear();return ks(s)?n>=1&&n<=366:n>=1&&n<=365}set(t,n,s){return t.setMonth(0,s),t.setHours(0,0,0,0),t}}function Hr(e,r,t){var b,w,x,P;const n=jt(),s=(t==null?void 0:t.weekStartsOn)??((w=(b=t==null?void 0:t.locale)==null?void 0:b.options)==null?void 0:w.weekStartsOn)??n.weekStartsOn??((P=(x=n.locale)==null?void 0:x.options)==null?void 0:P.weekStartsOn)??0,a=oe(e),o=a.getDay(),c=(r%7+7)%7,l=7-s,h=r<0||r>6?r-(o+l)%7:(c+l)%7-(o+l)%7;return pt(a,h)}class Df extends ie{constructor(){super(...arguments);m(this,"priority",90);m(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(t,n,s){switch(n){case"E":case"EE":case"EEE":return s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,s,a){return t=Hr(t,s,a),t.setHours(0,0,0,0),t}}class kf extends ie{constructor(){super(...arguments);m(this,"priority",90);m(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(t,n,s,a){const o=i=>{const c=Math.floor((i-1)/7)*7;return(i+a.weekStartsOn+6)%7+c};switch(n){case"e":case"ee":return Ee(we(n.length,t),o);case"eo":return Ee(s.ordinalNumber(t,{unit:"day"}),o);case"eee":return s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"eeeee":return s.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,s,a){return t=Hr(t,s,a),t.setHours(0,0,0,0),t}}class Of extends ie{constructor(){super(...arguments);m(this,"priority",90);m(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(t,n,s,a){const o=i=>{const c=Math.floor((i-1)/7)*7;return(i+a.weekStartsOn+6)%7+c};switch(n){case"c":case"cc":return Ee(we(n.length,t),o);case"co":return Ee(s.ordinalNumber(t,{unit:"day"}),o);case"ccc":return s.day(t,{width:"abbreviated",context:"standalone"})||s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"});case"ccccc":return s.day(t,{width:"narrow",context:"standalone"});case"cccccc":return s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(t,{width:"wide",context:"standalone"})||s.day(t,{width:"abbreviated",context:"standalone"})||s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=6}set(t,n,s,a){return t=Hr(t,s,a),t.setHours(0,0,0,0),t}}function Nf(e,r){const t=oe(e),n=rf(t),s=r-n;return pt(t,s)}class _f extends ie{constructor(){super(...arguments);m(this,"priority",90);m(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(t,n,s){const a=o=>o===0?7:o;switch(n){case"i":case"ii":return we(n.length,t);case"io":return s.ordinalNumber(t,{unit:"day"});case"iii":return Ee(s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),a);case"iiiii":return Ee(s.day(t,{width:"narrow",context:"formatting"}),a);case"iiiiii":return Ee(s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),a);case"iiii":default:return Ee(s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),a)}}validate(t,n){return n>=1&&n<=7}set(t,n,s){return t=Nf(t,s),t.setHours(0,0,0,0),t}}class jf extends ie{constructor(){super(...arguments);m(this,"priority",80);m(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(t,n,s){switch(n){case"a":case"aa":case"aaa":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,s){return t.setHours(Yr(s),0,0,0),t}}class If extends ie{constructor(){super(...arguments);m(this,"priority",80);m(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(t,n,s){switch(n){case"b":case"bb":case"bbb":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,s){return t.setHours(Yr(s),0,0,0),t}}class Mf extends ie{constructor(){super(...arguments);m(this,"priority",80);m(this,"incompatibleTokens",["a","b","t","T"])}parse(t,n,s){switch(n){case"B":case"BB":case"BBB":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,s){return t.setHours(Yr(s),0,0,0),t}}class Rf extends ie{constructor(){super(...arguments);m(this,"priority",70);m(this,"incompatibleTokens",["H","K","k","t","T"])}parse(t,n,s){switch(n){case"h":return xe(Pe.hour12h,t);case"ho":return s.ordinalNumber(t,{unit:"hour"});default:return we(n.length,t)}}validate(t,n){return n>=1&&n<=12}set(t,n,s){const a=t.getHours()>=12;return a&&s<12?t.setHours(s+12,0,0,0):!a&&s===12?t.setHours(0,0,0,0):t.setHours(s,0,0,0),t}}class Lf extends ie{constructor(){super(...arguments);m(this,"priority",70);m(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(t,n,s){switch(n){case"H":return xe(Pe.hour23h,t);case"Ho":return s.ordinalNumber(t,{unit:"hour"});default:return we(n.length,t)}}validate(t,n){return n>=0&&n<=23}set(t,n,s){return t.setHours(s,0,0,0),t}}class Af extends ie{constructor(){super(...arguments);m(this,"priority",70);m(this,"incompatibleTokens",["h","H","k","t","T"])}parse(t,n,s){switch(n){case"K":return xe(Pe.hour11h,t);case"Ko":return s.ordinalNumber(t,{unit:"hour"});default:return we(n.length,t)}}validate(t,n){return n>=0&&n<=11}set(t,n,s){return t.getHours()>=12&&s<12?t.setHours(s+12,0,0,0):t.setHours(s,0,0,0),t}}class $f extends ie{constructor(){super(...arguments);m(this,"priority",70);m(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(t,n,s){switch(n){case"k":return xe(Pe.hour24h,t);case"ko":return s.ordinalNumber(t,{unit:"hour"});default:return we(n.length,t)}}validate(t,n){return n>=1&&n<=24}set(t,n,s){const a=s<=24?s%24:s;return t.setHours(a,0,0,0),t}}class Ff extends ie{constructor(){super(...arguments);m(this,"priority",60);m(this,"incompatibleTokens",["t","T"])}parse(t,n,s){switch(n){case"m":return xe(Pe.minute,t);case"mo":return s.ordinalNumber(t,{unit:"minute"});default:return we(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,s){return t.setMinutes(s,0,0),t}}class Yf extends ie{constructor(){super(...arguments);m(this,"priority",50);m(this,"incompatibleTokens",["t","T"])}parse(t,n,s){switch(n){case"s":return xe(Pe.second,t);case"so":return s.ordinalNumber(t,{unit:"second"});default:return we(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,s){return t.setSeconds(s,0),t}}class Hf extends ie{constructor(){super(...arguments);m(this,"priority",30);m(this,"incompatibleTokens",["t","T"])}parse(t,n){const s=a=>Math.trunc(a*Math.pow(10,-n.length+3));return Ee(we(n.length,t),s)}set(t,n,s){return t.setMilliseconds(s),t}}class Wf extends ie{constructor(){super(...arguments);m(this,"priority",10);m(this,"incompatibleTokens",["t","T","x"])}parse(t,n){switch(n){case"X":return Ye(Fe.basicOptionalMinutes,t);case"XX":return Ye(Fe.basic,t);case"XXXX":return Ye(Fe.basicOptionalSeconds,t);case"XXXXX":return Ye(Fe.extendedOptionalSeconds,t);case"XXX":default:return Ye(Fe.extended,t)}}set(t,n,s){return n.timestampIsSet?t:be(t,t.getTime()-bs(t)-s)}}class Vf extends ie{constructor(){super(...arguments);m(this,"priority",10);m(this,"incompatibleTokens",["t","T","X"])}parse(t,n){switch(n){case"x":return Ye(Fe.basicOptionalMinutes,t);case"xx":return Ye(Fe.basic,t);case"xxxx":return Ye(Fe.basicOptionalSeconds,t);case"xxxxx":return Ye(Fe.extendedOptionalSeconds,t);case"xxx":default:return Ye(Fe.extended,t)}}set(t,n,s){return n.timestampIsSet?t:be(t,t.getTime()-bs(t)-s)}}class Bf extends ie{constructor(){super(...arguments);m(this,"priority",40);m(this,"incompatibleTokens","*")}parse(t){return Cs(t)}set(t,n,s){return[be(t,s*1e3),{timestampIsSet:!0}]}}class Uf extends ie{constructor(){super(...arguments);m(this,"priority",20);m(this,"incompatibleTokens","*")}parse(t){return Cs(t)}set(t,n,s){return[be(t,s),{timestampIsSet:!0}]}}const qf={G:new lf,y:new ff,Y:new df,R:new hf,u:new pf,Q:new mf,q:new bf,M:new gf,L:new yf,w:new xf,I:new Tf,d:new Sf,D:new Cf,E:new Df,e:new kf,c:new Of,i:new _f,a:new jf,b:new If,B:new Mf,h:new Rf,H:new Lf,K:new Af,k:new $f,m:new Ff,s:new Yf,S:new Hf,X:new Wf,x:new Vf,t:new Bf,T:new Uf},zf=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Gf=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Zf=/^'([^]*?)'?$/,Qf=/''/g,Kf=/\S/,Xf=/[a-zA-Z]/;function He(e,r,t,n){var D,k,E,L,U,$,y,A;const s=tf(),a=(n==null?void 0:n.locale)??s.locale??Ul,o=(n==null?void 0:n.firstWeekContainsDate)??((k=(D=n==null?void 0:n.locale)==null?void 0:D.options)==null?void 0:k.firstWeekContainsDate)??s.firstWeekContainsDate??((L=(E=s.locale)==null?void 0:E.options)==null?void 0:L.firstWeekContainsDate)??1,i=(n==null?void 0:n.weekStartsOn)??(($=(U=n==null?void 0:n.locale)==null?void 0:U.options)==null?void 0:$.weekStartsOn)??s.weekStartsOn??((A=(y=s.locale)==null?void 0:y.options)==null?void 0:A.weekStartsOn)??0;if(r==="")return e===""?oe(t):be(t,NaN);const c={firstWeekContainsDate:o,weekStartsOn:i,locale:a},l=[new uf],h=r.match(Gf).map(O=>{const H=O[0];if(H in Ts){const F=Ts[H];return F(O,a.formatLong)}return O}).join("").match(zf),b=[];for(let O of h){!(n!=null&&n.useAdditionalWeekYearTokens)&&Jl(O)&&Ps(O,r,e),!(n!=null&&n.useAdditionalDayOfYearTokens)&&Xl(O)&&Ps(O,r,e);const H=O[0],F=qf[H];if(F){const{incompatibleTokens:re}=F;if(Array.isArray(re)){const q=b.find(S=>re.includes(S.token)||S.token===H);if(q)throw new RangeError(`The format string mustn't contain \`${q.fullToken}\` and \`${O}\` at the same time`)}else if(F.incompatibleTokens==="*"&&b.length>0)throw new RangeError(`The format string mustn't contain \`${O}\` and any other token at the same time`);b.push({token:H,fullToken:O});const ee=F.run(e,O,a.match,c);if(!ee)return be(t,NaN);l.push(ee.setter),e=ee.rest}else{if(H.match(Xf))throw new RangeError("Format string contains an unescaped latin alphabet character `"+H+"`");if(O==="''"?O="'":H==="'"&&(O=Jf(O)),e.indexOf(O)===0)e=e.slice(O.length);else return be(t,NaN)}}if(e.length>0&&Kf.test(e))return be(t,NaN);const w=l.map(O=>O.priority).sort((O,H)=>H-O).filter((O,H,F)=>F.indexOf(O)===H).map(O=>l.filter(H=>H.priority===O).sort((H,F)=>F.subPriority-H.subPriority)).map(O=>O[0]);let x=oe(t);if(isNaN(x.getTime()))return be(t,NaN);const P={};for(const O of w){if(!O.validate(x,c))return be(t,NaN);const H=O.set(x,P,c);Array.isArray(H)?(x=H[0],Object.assign(P,H[1])):x=H}return be(t,x)}function Jf(e){return e.match(Zf)[1].replace(Qf,"'")}function ed(e){return gs(e,Date.now())}function td(e,r){return pt(e,-r)}function rd(e,r){let t=r-Fr(e);return t<=0&&(t+=7),pt(e,t)}function nd(e,r){const t=(r==null?void 0:r.additionalDigits)??2,n=id(e);let s;if(n.date){const c=cd(n.date,t);s=ud(c.restDateString,c.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);const a=s.getTime();let o=0,i;if(n.time&&(o=ld(n.time),isNaN(o)))return new Date(NaN);if(n.timezone){if(i=fd(n.timezone),isNaN(i))return new Date(NaN)}else{const c=new Date(a+o),l=new Date(0);return l.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),l.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),l}return new Date(a+o+i)}const Jt={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},sd=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ad=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,od=/^([+-])(\d{2})(?::?(\d{2}))?$/;function id(e){const r={},t=e.split(Jt.dateTimeDelimiter);let n;if(t.length>2)return r;if(/:/.test(t[0])?n=t[0]:(r.date=t[0],n=t[1],Jt.timeZoneDelimiter.test(r.date)&&(r.date=e.split(Jt.timeZoneDelimiter)[0],n=e.substr(r.date.length,e.length))),n){const s=Jt.timezone.exec(n);s?(r.time=n.replace(s[1],""),r.timezone=s[1]):r.time=n}return r}function cd(e,r){const t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+r)+"})|(\\d{2}|[+-]\\d{"+(2+r)+"})$)"),n=e.match(t);if(!n)return{year:NaN,restDateString:""};const s=n[1]?parseInt(n[1]):null,a=n[2]?parseInt(n[2]):null;return{year:a===null?s:a*100,restDateString:e.slice((n[1]||n[2]).length)}}function ud(e,r){if(r===null)return new Date(NaN);const t=e.match(sd);if(!t)return new Date(NaN);const n=!!t[4],s=Rt(t[1]),a=Rt(t[2])-1,o=Rt(t[3]),i=Rt(t[4]),c=Rt(t[5])-1;if(n)return bd(r,i,c)?dd(r,i,c):new Date(NaN);{const l=new Date(0);return!pd(r,a,o)||!md(r,s)?new Date(NaN):(l.setUTCFullYear(r,a,Math.max(s,o)),l)}}function Rt(e){return e?parseInt(e):1}function ld(e){const r=e.match(ad);if(!r)return NaN;const t=Wr(r[1]),n=Wr(r[2]),s=Wr(r[3]);return gd(t,n,s)?t*Ar+n*Lr+s*1e3:NaN}function Wr(e){return e&&parseFloat(e.replace(",","."))||0}function fd(e){if(e==="Z")return 0;const r=e.match(od);if(!r)return 0;const t=r[1]==="+"?-1:1,n=parseInt(r[2]),s=r[3]&&parseInt(r[3])||0;return yd(n,s)?t*(n*Ar+s*Lr):NaN}function dd(e,r,t){const n=new Date(0);n.setUTCFullYear(e,0,4);const s=n.getUTCDay()||7,a=(r-1)*7+t+1-s;return n.setUTCDate(n.getUTCDate()+a),n}const hd=[31,null,31,30,31,30,31,31,30,31,30,31];function Os(e){return e%400===0||e%4===0&&e%100!==0}function pd(e,r,t){return r>=0&&r<=11&&t>=1&&t<=(hd[r]||(Os(e)?29:28))}function md(e,r){return r>=1&&r<=(Os(e)?366:365)}function bd(e,r,t){return r>=1&&r<=53&&t>=0&&t<=6}function gd(e,r,t){return e===24?r===0&&t===0:t>=0&&t<60&&r>=0&&r<60&&e>=0&&e<25}function yd(e,r){return r>=0&&r<=59}function vd(e,r){const t=oe(e),n=t.getFullYear(),s=t.getDate(),a=be(e,0);a.setFullYear(n,r,15),a.setHours(0,0,0,0);const o=Es(a);return t.setMonth(r,Math.min(s,o)),t}function xd(e,r){const t=oe(e);return isNaN(+t)?be(e,NaN):(t.setFullYear(r),t)}function Ns(e,r){return st(e,-r)}function _s(e,r){return Kt(e,-r)}function js(){return window.navigator.languages?window.navigator.languages[0]:window.navigator.language}function wd(e,r,t){const n=[];for(let s=e;s<=r;s++)n.push(t?t(s):s);return n}function Td(e,r){const t=e.target;return t?!r.isSameNode(t)&&!r.contains(t):!1}function Pd(e,r){return e.isSameNode(r)||e.contains(r)}function Ed(e,r){const t=Object.entries(r),n=getComputedStyle(e);for(let s=0,a=t.length;s<a;s++){const[o,i]=t[s];if(typeof i=="string"&&i.indexOf(",")>-1){if(!i.split(",").map(l=>l.trim()).includes(n[o]))return!1}else if(n[o]!==i)return!1}return!0}function Sd(e,r){const t=Object.entries(r),n=getComputedStyle(e);for(let s=0,a=t.length;s<a;s++){const[o,i]=t[s];if(typeof i=="string"&&i.indexOf(",")>-1){if(i.split(",").map(l=>l.trim()).includes(n[o]))return!0}else if(n[o]===i)return!0}return!1}function Is(e,r,t=!1,n){if(t&&Ed(e,r)){if(!n||(n==null?void 0:n(e))===!0)return e}else if(!t&&Sd(e,r)&&(!n||(n==null?void 0:n(e))===!0))return e;return e.parentElement?Is(e.parentElement,r,t,n):e}function Ms(e,r){const t=Array.from(document.querySelectorAll("body *")),n=[];for(let s=0,a=t.length;s<a;s++){const o=getComputedStyle(t[s]);o[e]&&r(o[e])&&n.push(o[e])}return n}function Fh(e){return e}function Cd(e){const r=document.documentElement;Object.keys(e).forEach(t=>{r.style.setProperty(t,e[t])})}function Dd(e){return{"--theme-bsc-primary-1":e.primary1,"--theme-bsc-primary-2":e.primary2,"--theme-bsc-primary-3":e.primary3,"--theme-bsc-primary-4":e.primary4,"--theme-bsc-primary-5":e.primary5,"--theme-bsc-gray-1":e.gray1||"#303030","--theme-bsc-gray-2":e.gray2||"#5f5f5f","--theme-bsc-gray-3":e.gray3||"#8f8f8f","--theme-bsc-gray-4":e.gray4||"#bebebe","--theme-bsc-gray-5":e.gray5||"#eee","--theme-bsc-black":e.black||"#000","--theme-bsc-white":e.white||"#fff","--theme-bsc-mono-dark-1":e.monoDark1||"#222","--theme-bsc-mono-dark-2":e.monoDark2||"#3c3c3c","--theme-bsc-mono-dark-3":e.monoDark3||"#4e4e4e","--theme-bsc-mono-light-1":e.monoLight1||"#fefefe","--theme-bsc-mono-light-2":e.monoLight2||"#eee","--theme-bsc-mono-light-3":e.monoLight3||"#ccc","--theme-bsc-info":e.info||"#2e7ff8","--theme-bsc-success":e.success||"#53ae0c","--theme-bsc-warning":e.warning||"#ff6914","--theme-bsc-error":e.error||"#f01616"}}var Oe=(e=>(e[e.Regular=24]="Regular",e[e.Small=20]="Small",e))(Oe||{});const Rs=({className:e})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5m-9-6h.008v.008H12v-.008ZM12 15h.008v.008H12V15Zm0 2.25h.008v.008H12v-.008ZM9.75 15h.008v.008H9.75V15Zm0 2.25h.008v.008H9.75v-.008ZM7.5 15h.008v.008H7.5V15Zm0 2.25h.008v.008H7.5v-.008Zm6.75-4.5h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V15Zm0 2.25h.008v.008h-.008v-.008Zm2.25-4.5h.008v.008H16.5v-.008Zm0 2.25h.008v.008H16.5V15Z"})}),kd=({className:e})=>{const r=ve("bsc-h-6 bsc-w-6",e);return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:r,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})})},Od=({className:e})=>{const r=ve("bsc-h-6 bsc-w-6",e);return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:r,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5 8.25 12l7.5-7.5"})})},Nd=({className:e})=>{const r=ve("bsc-h-6 bsc-w-6",e);return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:r,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})})},_d=({className:e})=>{const r=ve("bsc-h-6 bsc-w-6",e);return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:r,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"})})},jd=({className:e})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})}),je=({icon:e,size:r=Oe.Regular,onClick:t,className:n})=>{const s=d.useRef({calendar:Rs,chevronDown:kd,chevronLeft:Od,chevronRight:Nd,chevronUp:_d,close:jd}),a=d.useMemo(()=>s.current[e]||Rs,[e]),o=ve({"bsc-h-[24px] bsc-w-[24px]":r===Oe.Regular,"bsc-h-[20px] bsc-w-[20px]":r===Oe.Small},n);return f.jsx("div",{onClick:t,children:f.jsx(a,{className:o})})},er=({template:e,props:r,children:t})=>e(r,t);function Id(e,r){if(r===e)return!1;const t=Object.values(r),n=Object.values(e);if(t.length!==n.length||t.some((a,o)=>a!==n[o]))return!0;const s=Object.keys(e);return Object.keys(r).some((a,o)=>a!==s[o])}function Md(e,r){return e.matches[r]=!1,e.mediaQueries[r]={},e}function Ls(e){const r=Object.keys(e);return typeof window>"u"?r.reduce(Md,{mediaQueries:{},matches:{}}):r.reduce((t,n)=>{const s=window.matchMedia(e[n]);return t.mediaQueries[n]=s,t.matches[n]=s.matches,t},{mediaQueries:{},matches:{}})}function Rd(e,r){function t(n,s){return n[s]=e.mediaQueries[s].matches,n}switch(r.type){case"updateMatches":return{matches:Object.keys(e.mediaQueries).reduce(t,{}),mediaQueries:e.mediaQueries};case"setQueries":return Ls(r.queries)}}function Ld(e){const r=Et.useRef(e),[t,n]=Et.useReducer(Rd,e,Ls);Et.useEffect(()=>{Id(e,r.current)&&(n({type:"setQueries",queries:e}),r.current=e)},[e]);function s(){return n({type:"updateMatches"})}function a(c){const l=s;return typeof c.addListener<"u"?c.addListener(l):c.addEventListener("change",l),l}Et.useEffect(()=>{const c=Object.values(t.mediaQueries),l=c.map(a);function h(b,w){typeof b.addListener<"u"?b.removeListener(l[w]):b.removeEventListener("change",l[w])}return()=>{c.forEach(h)}},[t.mediaQueries]);const{matches:o}=t,i=Et.useMemo(()=>Object.values(o),[o]);return{matches:o,matchesAny:i.some(Boolean),matchesAll:i.length>0&&i.every(Boolean)}}function tr(e){return Ld(Ad(e)).matchesAll}const Vr={};function Ad(e){return Vr[e]===void 0&&(Vr[e]={default:e}),Vr[e]}const Br=({mobileQuery:e="screen and (max-device-width: 40rem)",tabletQuery:r="screen and (min-device-width: 40.01rem) and (max-device-width: 63.9375rem)",desktopQuery:t="screen and (min-device-width: 64rem)",mobileMarkup:n,aboveMobileMarkup:s,tabletMarkup:a,desktopMarkup:o})=>{const i=tr(e),c=tr(r),l=tr(t);return(()=>i&&n?n:!i&&s?s:c&&a?a:l&&o?o:(console.error("Invalid media settings"),null))()};function As(e,r,t){const n=a=>{const o=a.target,i=e.style.display!=="hidden";e&&i&&!Pd(e,o)&&!s(t,o)&&r(!1),r(!0)},s=(a,o)=>{if(!a)return!1;for(let i=0,c=a.length;i<c;i++)if(a[i].isSameNode(o)||a[i].contains(o))return!0;return!1};return document.addEventListener("mousedown",n),n}function $s(e){document.removeEventListener("mousedown",e)}function $d(e,r){if(e==null)return{};var t={},n=Object.keys(e),s,a;for(a=0;a<n.length;a++)s=n[a],!(r.indexOf(s)>=0)&&(t[s]=e[s]);return t}function Ur(e,r){return Ur=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},Ur(e,r)}function Fd(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,Ur(e,r)}var qr={exports:{}},rr={exports:{}},ue={};/** @license React v16.13.1
31
+ */(function(e){(function(){var r={}.hasOwnProperty;function t(){for(var a="",o=0;o<arguments.length;o++){var i=arguments[o];i&&(a=s(a,n(i)))}return a}function n(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return t.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var o="";for(var i in a)r.call(a,i)&&a[i]&&(o=s(o,i));return o}function s(a,o){return o?a?a+" "+o:a+o:a}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(En);var Ma=En.exports;const ce=Or(Ma);var Mt=(e=>(e[e.Focus=0]="Focus",e[e.FocusWithin=1]="FocusWithin",e))(Mt||{});const Xt=(e=1)=>d.useMemo(()=>ce("dark:bsc-ring-mono-light-2 dark:bsc-ring-offset-mono-dark-1",{"focus-within:bsc-ring focus-within:bsc-ring-offset-2 focus-within:bsc-ring-opacity-50":e===1,"focus:bsc-ring focus:bsc-ring-offset-2 focus:bsc-ring-opacity-50":e===0}),[e]),Ra=(e,r)=>{const t=d.useRef(null),{buttonType:n,buttonStyle:s="flat",type:a="button",disabled:o=!1,form:i,fullWidth:c=!1,onClick:l,className:h,children:m}=e,x=()=>{l==null||l()},v=()=>{var N;(N=t.current)==null||N.click()};d.useImperativeHandle(r,()=>({click:v}));const w=Xt(Mt.Focus),D=ce("bc-button max-sm:bsc-p-4 md:bsc-p-2 dark:bsc-bg-mono-light-1 dark:hover:bsc-bg-mono-light-2 dark:bsc-text-mono-dark-1",w,{"bsc-w-full":c,"bc-disabled bsc-bg-gray-3 bsc-text-gray-2 bsc-pointer-events-none":o,"bsc-bg-primary-1 bsc-text-white hover:bsc-bg-primary-2 focus:bsc-ring-primary-1":n==="primary","bsc-bg-primary-2 bsc-text-white hover:bsc-bg-primary-3 focus:bsc-ring-primary-2":n==="secondary","bsc-bg-info bsc-text-white focus:bsc-ring-info":n==="info","bsc-bg-success bsc-text-white focus:bsc-ring-success":n==="success","bsc-bg-warning bsc-text-white focus:bsc-ring-warning":n==="warning","bsc-bg-error bsc-text-white focus:bsc-ring-error":n==="error","bsc-rounded-md":s==="curved","bsc-rounded-full !bsc-px-4":s==="round"},h);return f.jsx("button",{ref:t,type:a,onClick:x,disabled:o,form:i,className:D,children:m})},We=d.forwardRef(Ra),Jt=e=>e==null?!1:typeof e=="object",Aa=e=>Array.isArray(e)&&e.every(r=>Jt(r)),La=e=>e instanceof Date,$a=e=>Array.isArray(e)&&e.every(r=>r instanceof Date),kn=e=>typeof e=="function",Fa=e=>Array.isArray(e)&&e.every(r=>kn(r)),Cn=e=>{const r=typeof e;return r==="string"||r==="number"||r==="boolean"||r==="bigint"},Ya=e=>Array.isArray(e)&&e.every(r=>Cn(r)),_r=e=>{if(!Jt(e))return e;const r={},t=Object.keys(e);for(let n=t.length;n--!==0;){const s=t[n],a=e[s];Cn(a)||kn(a)?r[s]=a:La(a)?r[s]=new Date(a.getTime()):Array.isArray(a)?r[s]=Dn(a):Jt(a)&&(r[s]=_r(a))}return r},Ha=e=>{let r=e.length;const t=new Array(r);for(;r--!==0;)t[r]=e[r];return t},Wa=e=>{let r=e.length;const t=new Array(r);for(;r--!==0;)t[r]=new Date(e[r].getTime());return t},Va=e=>{let r=e.length;const t=new Array(r);for(;r--!==0;)t[r]=_r(e[r]);return t},Dn=e=>{if(Ya(e)||Fa(e))return Ha(e);if($a(e))return Wa(e);if(Aa(e))return Va(e);let r=e.length;const t=new Array(r);for(;r--!==0;)t[r]=e[r];return t},Ba=e=>Jt(e)?Array.isArray(e)?Dn(e):_r(e):e;function za(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ua=function e(r,t){if(r===t)return!0;if(r&&t&&typeof r=="object"&&typeof t=="object"){if(r.constructor!==t.constructor)return!1;var n,s,a;if(Array.isArray(r)){if(n=r.length,n!=t.length)return!1;for(s=n;s--!==0;)if(!e(r[s],t[s]))return!1;return!0}if(r.constructor===RegExp)return r.source===t.source&&r.flags===t.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===t.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===t.toString();if(a=Object.keys(r),n=a.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,a[s]))return!1;for(s=n;s--!==0;){var o=a[s];if(!e(r[o],t[o]))return!1}return!0}return r!==r&&t!==t};const On=za(Ua),qa=(e,r)=>{for(let t=e.length;t--!==0;)if(e[t]!==r[t]&&!On(e[t],r[t]))return!0;return!1},Ir=(e,r)=>{const t=d.useRef([]),n=t.current.length>0&&t.current[0]&&qa(t.current[0],r);return(t.current.length===0||n)&&(t.current=[Ba(r),e()]),t.current[1]},Nn=e=>{const r=d.useRef();let t=!1;r.current!==void 0&&(t=!On(r.current,e));const n={changed:t,previousValue:r.current};return r.current=e,n},Ga=e=>typeof e=="function",Za=e=>{const[r,t]=d.useState({value:e,initial:!0}),n=d.useRef(e);return[r,s=>{if(!Ga(s))t({value:s,initial:!1});else{const a=s(n.current);n.current=a,t({value:a,initial:!1})}}]},Qa=e=>{const[r,t]=Za(e),n=d.useRef({value:e,initial:!0});return n.current!==r&&(n.current=r),[r,t,n]},jr=e=>{const[r,t]=d.useState(!0),n=Pn();return d.useEffect(()=>{e!==void 0?t(e):n&&n.useAnimations!==void 0&&t(n.useAnimations)},[n,e]),r},qe=({label:e,htmlFor:r,readOnly:t=!1,className:n})=>{const s=ce("bc-label",{"bsc-text-black dark:bsc-text-mono-light-1":!t,"bc-read-only bsc-text-gray-4 dark:bsc-text-mono-light-3 bsc-pointer-events-none":t},n);return f.jsx("label",{htmlFor:r,className:s,children:e})},Ka=(e,r)=>{const{name:t,label:n,value:s,readOnly:a=!1,checked:o=!1,partial:i=!1,labelLocation:c=Me.Right,className:l,useAnimation:h,onChange:m}=e,[x,v,w]=Qa({checked:!1,partial:!1}),D=Nn(o),N=Nn(i),S=d.useId(),A=jr(h);d.useEffect(()=>{if(x.initial)v({checked:i?!0:o,partial:i});else{const U=D.changed?o:x.value.checked,E=N.changed?i:x.value.partial;v({checked:E?!0:U,partial:E})}},[o,i]);const B=U=>{var P;const E=((P=w.current)==null?void 0:P.value.partial)===!0?!0:U.target.checked;v({checked:E,partial:!1}),m==null||m({originalEvent:U,name:t||U.target.name,value:s,checked:E})},F=U=>{var P;const E={checked:U?!0:((P=w.current)==null?void 0:P.value.checked)||!1,partial:U};v(E)},g=U=>{v({checked:U,partial:!1})};d.useImperativeHandle(r,()=>({setPartiallyChecked:F,setChecked:g}));const $=ce("bc-checkbox-wrapper bsc-flex bsc-items-center",{"bc-read-only bsc-pointer-events-none bsc-text-gray-2 dark:bsc-text-mono-light-3":a},l),_=ce("bc-checkbox-label bsc-cursor-pointer",{"bsc-ml-2":c===Me.Right,"bsc-mr-2":c===Me.Left}),W=Xt(Mt.FocusWithin),Y=ce("bc-checkbox-outer bsc-relative bsc-rounded *:bsc-block *:bsc-size-[21px]",{"bsc-checkbox-animate":!a&&A,"bc-read-only bsc-checkbox-no-animate":a||!a&&!A},W),re=ce("bc-checkbox-inner bsc-relative bsc-m-0 bsc-cursor-pointer bsc-appearance-none bsc-rounded bsc-border-none bsc-bg-mono-light-1 bsc-p-0 bsc-outline-none dark:bsc-bg-mono-dark-1 dark:checked:bsc-bg-mono-light-1",{"[transition:box-shadow_0.3s]":A,"bsc-checkbox":!a,"bc-read-only bsc-checkbox-read-only":a}),te=ce("bc-checkbox-svg bsc-pointer-events-none bsc-absolute bsc-left-0 bsc-top-0 bsc-stroke-mono-light-1 bsc-stroke-2 [stroke-linecap:round] [stroke-linejoin:round] [transform:scale(0)_translateZ(0)] dark:bsc-stroke-mono-dark-3",{"bsc-fill-primary-1 dark:bsc-fill-mono-light-1":!a,"bc-read-only bsc-fill-primary-4 dark:bsc-fill-mono-light-3":a});return f.jsxs("div",{className:$,children:[n&&c===Me.Left&&f.jsx(qe,{label:n,htmlFor:S,readOnly:a,className:_}),f.jsxs("label",{className:Y,children:[f.jsx("input",{id:S,name:t,type:"checkbox",checked:x.value.checked,onChange:B,className:re}),f.jsx("svg",{viewBox:"0 0 21 21",className:te,children:x.value.partial?f.jsx("polyline",{points:"6 10.5 16 10.5"}):f.jsx("polyline",{points:"5 10.75 8.5 14.25 16 6"})})]}),n&&c===Me.Right&&f.jsx(qe,{label:n,htmlFor:S,readOnly:a,className:_})]})},_n=d.memo(d.forwardRef(Ka)),Xa=({name:e,label:r,value:t,data:n,textField:s,valueField:a,readOnly:o=!1,orientation:i=Ne.Vertical,className:c,onChange:l})=>{const[h,m]=d.useState([]),x=Ir(()=>n,[n]);d.useEffect(()=>{m(t??[])},[t]);const v=A=>{const{value:B,checked:F}=A;let g;F?g=[...h,B]:g=h.filter($=>$!==B),m(g),l==null||l({name:e,value:g})},w=(A,B)=>f.jsx(_n,{name:e,label:A[s],value:A[a],checked:h.some(F=>F===A[a]),readOnly:o,onChange:F=>F&&v(F),className:"bsc-mr-3"},`${e}_checkbox_${B}`),D=ce("bsc-flex bsc-flex-col bsc-gap-1",c),N=ce("bsc-flex bsc-gap-1",{"bsc-flex-col":i===Ne.Vertical}),S=A=>f.jsx("div",{className:N,children:A.map(w)});return f.jsxs("div",{className:D,children:[r&&f.jsx(qe,{label:r,readOnly:o}),x&&S(x)]})},Ja=d.memo(Xa);var eo=typeof global=="object"&&global&&global.Object===Object&&global;const In=eo;var to=typeof self=="object"&&self&&self.Object===Object&&self,ro=In||to||Function("return this")();const Fe=ro;var no=Fe.Symbol;const ht=no;var jn=Object.prototype,so=jn.hasOwnProperty,ao=jn.toString,Rt=ht?ht.toStringTag:void 0;function oo(e){var r=so.call(e,Rt),t=e[Rt];try{e[Rt]=void 0;var n=!0}catch{}var s=ao.call(e);return n&&(r?e[Rt]=t:delete e[Rt]),s}var io=Object.prototype,co=io.toString;function uo(e){return co.call(e)}var lo="[object Null]",fo="[object Undefined]",Mn=ht?ht.toStringTag:void 0;function pt(e){return e==null?e===void 0?fo:lo:Mn&&Mn in Object(e)?oo(e):uo(e)}function mt(e){return e!=null&&typeof e=="object"}var ho="[object Symbol]";function po(e){return typeof e=="symbol"||mt(e)&&pt(e)==ho}var mo=Array.isArray;const Mr=mo;var bo=/\s/;function go(e){for(var r=e.length;r--&&bo.test(e.charAt(r)););return r}var yo=/^\s+/;function vo(e){return e&&e.slice(0,go(e)+1).replace(yo,"")}function Ge(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var Rn=0/0,xo=/^[-+]0x[0-9a-f]+$/i,wo=/^0b[01]+$/i,To=/^0o[0-7]+$/i,So=parseInt;function An(e){if(typeof e=="number")return e;if(po(e))return Rn;if(Ge(e)){var r=typeof e.valueOf=="function"?e.valueOf():e;e=Ge(r)?r+"":r}if(typeof e!="string")return e===0?e:+e;e=vo(e);var t=wo.test(e);return t||To.test(e)?So(e.slice(2),t?2:8):xo.test(e)?Rn:+e}var Po="[object AsyncFunction]",Eo="[object Function]",ko="[object GeneratorFunction]",Co="[object Proxy]";function Ln(e){if(!Ge(e))return!1;var r=pt(e);return r==Eo||r==ko||r==Po||r==Co}var Do=Fe["__core-js_shared__"];const Rr=Do;var $n=function(){var e=/[^.]+$/.exec(Rr&&Rr.keys&&Rr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Oo(e){return!!$n&&$n in e}var No=Function.prototype,_o=No.toString;function st(e){if(e!=null){try{return _o.call(e)}catch{}try{return e+""}catch{}}return""}var Io=/[\\^$.*+?()[\]{}|]/g,jo=/^\[object .+?Constructor\]$/,Mo=Function.prototype,Ro=Object.prototype,Ao=Mo.toString,Lo=Ro.hasOwnProperty,$o=RegExp("^"+Ao.call(Lo).replace(Io,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Fo(e){if(!Ge(e)||Oo(e))return!1;var r=Ln(e)?$o:jo;return r.test(st(e))}function Yo(e,r){return e==null?void 0:e[r]}function at(e,r){var t=Yo(e,r);return Fo(t)?t:void 0}var Ho=at(Fe,"WeakMap");const Ar=Ho;var Fn=Object.create,Wo=function(){function e(){}return function(r){if(!Ge(r))return{};if(Fn)return Fn(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}();const Vo=Wo;function Bo(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r}var zo=function(){try{var e=at(Object,"defineProperty");return e({},"",{}),e}catch{}}();const Yn=zo;function Uo(e,r){for(var t=-1,n=e==null?0:e.length;++t<n&&r(e[t],t,e)!==!1;);return e}var qo=9007199254740991,Go=/^(?:0|[1-9]\d*)$/;function Zo(e,r){var t=typeof e;return r=r??qo,!!r&&(t=="number"||t!="symbol"&&Go.test(e))&&e>-1&&e%1==0&&e<r}function Hn(e,r,t){r=="__proto__"&&Yn?Yn(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}function Wn(e,r){return e===r||e!==e&&r!==r}var Qo=Object.prototype,Ko=Qo.hasOwnProperty;function Vn(e,r,t){var n=e[r];(!(Ko.call(e,r)&&Wn(n,t))||t===void 0&&!(r in e))&&Hn(e,r,t)}function er(e,r,t,n){var s=!t;t||(t={});for(var a=-1,o=r.length;++a<o;){var i=r[a],c=n?n(t[i],e[i],i,t,e):void 0;c===void 0&&(c=e[i]),s?Hn(t,i,c):Vn(t,i,c)}return t}var Xo=9007199254740991;function Bn(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Xo}function zn(e){return e!=null&&Bn(e.length)&&!Ln(e)}var Jo=Object.prototype;function Lr(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||Jo;return e===t}function ei(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}var ti="[object Arguments]";function Un(e){return mt(e)&&pt(e)==ti}var qn=Object.prototype,ri=qn.hasOwnProperty,ni=qn.propertyIsEnumerable,si=Un(function(){return arguments}())?Un:function(e){return mt(e)&&ri.call(e,"callee")&&!ni.call(e,"callee")};const ai=si;function oi(){return!1}var Gn=typeof K=="object"&&K&&!K.nodeType&&K,Zn=Gn&&typeof module=="object"&&module&&!module.nodeType&&module,ii=Zn&&Zn.exports===Gn,Qn=ii?Fe.Buffer:void 0,ci=Qn?Qn.isBuffer:void 0,ui=ci||oi;const Kn=ui;var li="[object Arguments]",fi="[object Array]",di="[object Boolean]",hi="[object Date]",pi="[object Error]",mi="[object Function]",bi="[object Map]",gi="[object Number]",yi="[object Object]",vi="[object RegExp]",xi="[object Set]",wi="[object String]",Ti="[object WeakMap]",Si="[object ArrayBuffer]",Pi="[object DataView]",Ei="[object Float32Array]",ki="[object Float64Array]",Ci="[object Int8Array]",Di="[object Int16Array]",Oi="[object Int32Array]",Ni="[object Uint8Array]",_i="[object Uint8ClampedArray]",Ii="[object Uint16Array]",ji="[object Uint32Array]",ve={};ve[Ei]=ve[ki]=ve[Ci]=ve[Di]=ve[Oi]=ve[Ni]=ve[_i]=ve[Ii]=ve[ji]=!0,ve[li]=ve[fi]=ve[Si]=ve[di]=ve[Pi]=ve[hi]=ve[pi]=ve[mi]=ve[bi]=ve[gi]=ve[yi]=ve[vi]=ve[xi]=ve[wi]=ve[Ti]=!1;function Mi(e){return mt(e)&&Bn(e.length)&&!!ve[pt(e)]}function $r(e){return function(r){return e(r)}}var Xn=typeof K=="object"&&K&&!K.nodeType&&K,At=Xn&&typeof module=="object"&&module&&!module.nodeType&&module,Ri=At&&At.exports===Xn,Fr=Ri&&In.process,Ai=function(){try{var e=At&&At.require&&At.require("util").types;return e||Fr&&Fr.binding&&Fr.binding("util")}catch{}}();const bt=Ai;var Jn=bt&&bt.isTypedArray,Li=Jn?$r(Jn):Mi;const $i=Li;var Fi=Object.prototype,Yi=Fi.hasOwnProperty;function es(e,r){var t=Mr(e),n=!t&&ai(e),s=!t&&!n&&Kn(e),a=!t&&!n&&!s&&$i(e),o=t||n||s||a,i=o?ei(e.length,String):[],c=i.length;for(var l in e)(r||Yi.call(e,l))&&!(o&&(l=="length"||s&&(l=="offset"||l=="parent")||a&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Zo(l,c)))&&i.push(l);return i}function ts(e,r){return function(t){return e(r(t))}}var Hi=ts(Object.keys,Object);const Wi=Hi;var Vi=Object.prototype,Bi=Vi.hasOwnProperty;function zi(e){if(!Lr(e))return Wi(e);var r=[];for(var t in Object(e))Bi.call(e,t)&&t!="constructor"&&r.push(t);return r}function Yr(e){return zn(e)?es(e):zi(e)}function Ui(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}var qi=Object.prototype,Gi=qi.hasOwnProperty;function Zi(e){if(!Ge(e))return Ui(e);var r=Lr(e),t=[];for(var n in e)n=="constructor"&&(r||!Gi.call(e,n))||t.push(n);return t}function Hr(e){return zn(e)?es(e,!0):Zi(e)}var Qi=at(Object,"create");const Lt=Qi;function Ki(){this.__data__=Lt?Lt(null):{},this.size=0}function Xi(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var Ji="__lodash_hash_undefined__",ec=Object.prototype,tc=ec.hasOwnProperty;function rc(e){var r=this.__data__;if(Lt){var t=r[e];return t===Ji?void 0:t}return tc.call(r,e)?r[e]:void 0}var nc=Object.prototype,sc=nc.hasOwnProperty;function ac(e){var r=this.__data__;return Lt?r[e]!==void 0:sc.call(r,e)}var oc="__lodash_hash_undefined__";function ic(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=Lt&&r===void 0?oc:r,this}function ot(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}ot.prototype.clear=Ki,ot.prototype.delete=Xi,ot.prototype.get=rc,ot.prototype.has=ac,ot.prototype.set=ic;function cc(){this.__data__=[],this.size=0}function tr(e,r){for(var t=e.length;t--;)if(Wn(e[t][0],r))return t;return-1}var uc=Array.prototype,lc=uc.splice;function fc(e){var r=this.__data__,t=tr(r,e);if(t<0)return!1;var n=r.length-1;return t==n?r.pop():lc.call(r,t,1),--this.size,!0}function dc(e){var r=this.__data__,t=tr(r,e);return t<0?void 0:r[t][1]}function hc(e){return tr(this.__data__,e)>-1}function pc(e,r){var t=this.__data__,n=tr(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this}function Ze(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}Ze.prototype.clear=cc,Ze.prototype.delete=fc,Ze.prototype.get=dc,Ze.prototype.has=hc,Ze.prototype.set=pc;var mc=at(Fe,"Map");const $t=mc;function bc(){this.size=0,this.__data__={hash:new ot,map:new($t||Ze),string:new ot}}function gc(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}function rr(e,r){var t=e.__data__;return gc(r)?t[typeof r=="string"?"string":"hash"]:t.map}function yc(e){var r=rr(this,e).delete(e);return this.size-=r?1:0,r}function vc(e){return rr(this,e).get(e)}function xc(e){return rr(this,e).has(e)}function wc(e,r){var t=rr(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}function gt(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}gt.prototype.clear=bc,gt.prototype.delete=yc,gt.prototype.get=vc,gt.prototype.has=xc,gt.prototype.set=wc;function rs(e,r){for(var t=-1,n=r.length,s=e.length;++t<n;)e[s+t]=r[t];return e}var Tc=ts(Object.getPrototypeOf,Object);const ns=Tc;function Sc(){this.__data__=new Ze,this.size=0}function Pc(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}function Ec(e){return this.__data__.get(e)}function kc(e){return this.__data__.has(e)}var Cc=200;function Dc(e,r){var t=this.__data__;if(t instanceof Ze){var n=t.__data__;if(!$t||n.length<Cc-1)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new gt(n)}return t.set(e,r),this.size=t.size,this}function yt(e){var r=this.__data__=new Ze(e);this.size=r.size}yt.prototype.clear=Sc,yt.prototype.delete=Pc,yt.prototype.get=Ec,yt.prototype.has=kc,yt.prototype.set=Dc;function Oc(e,r){return e&&er(r,Yr(r),e)}function Nc(e,r){return e&&er(r,Hr(r),e)}var ss=typeof K=="object"&&K&&!K.nodeType&&K,as=ss&&typeof module=="object"&&module&&!module.nodeType&&module,_c=as&&as.exports===ss,os=_c?Fe.Buffer:void 0,is=os?os.allocUnsafe:void 0;function Ic(e,r){if(r)return e.slice();var t=e.length,n=is?is(t):new e.constructor(t);return e.copy(n),n}function jc(e,r){for(var t=-1,n=e==null?0:e.length,s=0,a=[];++t<n;){var o=e[t];r(o,t,e)&&(a[s++]=o)}return a}function cs(){return[]}var Mc=Object.prototype,Rc=Mc.propertyIsEnumerable,us=Object.getOwnPropertySymbols,Ac=us?function(e){return e==null?[]:(e=Object(e),jc(us(e),function(r){return Rc.call(e,r)}))}:cs;const Wr=Ac;function Lc(e,r){return er(e,Wr(e),r)}var $c=Object.getOwnPropertySymbols,Fc=$c?function(e){for(var r=[];e;)rs(r,Wr(e)),e=ns(e);return r}:cs;const ls=Fc;function Yc(e,r){return er(e,ls(e),r)}function fs(e,r,t){var n=r(e);return Mr(e)?n:rs(n,t(e))}function Hc(e){return fs(e,Yr,Wr)}function Wc(e){return fs(e,Hr,ls)}var Vc=at(Fe,"DataView");const Vr=Vc;var Bc=at(Fe,"Promise");const Br=Bc;var zc=at(Fe,"Set");const zr=zc;var ds="[object Map]",Uc="[object Object]",hs="[object Promise]",ps="[object Set]",ms="[object WeakMap]",bs="[object DataView]",qc=st(Vr),Gc=st($t),Zc=st(Br),Qc=st(zr),Kc=st(Ar),it=pt;(Vr&&it(new Vr(new ArrayBuffer(1)))!=bs||$t&&it(new $t)!=ds||Br&&it(Br.resolve())!=hs||zr&&it(new zr)!=ps||Ar&&it(new Ar)!=ms)&&(it=function(e){var r=pt(e),t=r==Uc?e.constructor:void 0,n=t?st(t):"";if(n)switch(n){case qc:return bs;case Gc:return ds;case Zc:return hs;case Qc:return ps;case Kc:return ms}return r});const Ur=it;var Xc=Object.prototype,Jc=Xc.hasOwnProperty;function eu(e){var r=e.length,t=new e.constructor(r);return r&&typeof e[0]=="string"&&Jc.call(e,"index")&&(t.index=e.index,t.input=e.input),t}var tu=Fe.Uint8Array;const gs=tu;function qr(e){var r=new e.constructor(e.byteLength);return new gs(r).set(new gs(e)),r}function ru(e,r){var t=r?qr(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}var nu=/\w*$/;function su(e){var r=new e.constructor(e.source,nu.exec(e));return r.lastIndex=e.lastIndex,r}var ys=ht?ht.prototype:void 0,vs=ys?ys.valueOf:void 0;function au(e){return vs?Object(vs.call(e)):{}}function ou(e,r){var t=r?qr(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}var iu="[object Boolean]",cu="[object Date]",uu="[object Map]",lu="[object Number]",fu="[object RegExp]",du="[object Set]",hu="[object String]",pu="[object Symbol]",mu="[object ArrayBuffer]",bu="[object DataView]",gu="[object Float32Array]",yu="[object Float64Array]",vu="[object Int8Array]",xu="[object Int16Array]",wu="[object Int32Array]",Tu="[object Uint8Array]",Su="[object Uint8ClampedArray]",Pu="[object Uint16Array]",Eu="[object Uint32Array]";function ku(e,r,t){var n=e.constructor;switch(r){case mu:return qr(e);case iu:case cu:return new n(+e);case bu:return ru(e,t);case gu:case yu:case vu:case xu:case wu:case Tu:case Su:case Pu:case Eu:return ou(e,t);case uu:return new n;case lu:case hu:return new n(e);case fu:return su(e);case du:return new n;case pu:return au(e)}}function Cu(e){return typeof e.constructor=="function"&&!Lr(e)?Vo(ns(e)):{}}var Du="[object Map]";function Ou(e){return mt(e)&&Ur(e)==Du}var xs=bt&&bt.isMap,Nu=xs?$r(xs):Ou;const _u=Nu;var Iu="[object Set]";function ju(e){return mt(e)&&Ur(e)==Iu}var ws=bt&&bt.isSet,Mu=ws?$r(ws):ju;const Ru=Mu;var Au=1,Lu=2,$u=4,Ts="[object Arguments]",Fu="[object Array]",Yu="[object Boolean]",Hu="[object Date]",Wu="[object Error]",Ss="[object Function]",Vu="[object GeneratorFunction]",Bu="[object Map]",zu="[object Number]",Ps="[object Object]",Uu="[object RegExp]",qu="[object Set]",Gu="[object String]",Zu="[object Symbol]",Qu="[object WeakMap]",Ku="[object ArrayBuffer]",Xu="[object DataView]",Ju="[object Float32Array]",el="[object Float64Array]",tl="[object Int8Array]",rl="[object Int16Array]",nl="[object Int32Array]",sl="[object Uint8Array]",al="[object Uint8ClampedArray]",ol="[object Uint16Array]",il="[object Uint32Array]",ge={};ge[Ts]=ge[Fu]=ge[Ku]=ge[Xu]=ge[Yu]=ge[Hu]=ge[Ju]=ge[el]=ge[tl]=ge[rl]=ge[nl]=ge[Bu]=ge[zu]=ge[Ps]=ge[Uu]=ge[qu]=ge[Gu]=ge[Zu]=ge[sl]=ge[al]=ge[ol]=ge[il]=!0,ge[Wu]=ge[Ss]=ge[Qu]=!1;function nr(e,r,t,n,s,a){var o,i=r&Au,c=r&Lu,l=r&$u;if(t&&(o=s?t(e,n,s,a):t(e)),o!==void 0)return o;if(!Ge(e))return e;var h=Mr(e);if(h){if(o=eu(e),!i)return Bo(e,o)}else{var m=Ur(e),x=m==Ss||m==Vu;if(Kn(e))return Ic(e,i);if(m==Ps||m==Ts||x&&!s){if(o=c||x?{}:Cu(e),!i)return c?Yc(e,Nc(o,e)):Lc(e,Oc(o,e))}else{if(!ge[m])return s?e:{};o=ku(e,m,i)}}a||(a=new yt);var v=a.get(e);if(v)return v;a.set(e,o),Ru(e)?e.forEach(function(N){o.add(nr(N,r,t,N,e,a))}):_u(e)&&e.forEach(function(N,S){o.set(S,nr(N,r,t,S,e,a))});var w=l?c?Wc:Hc:c?Hr:Yr,D=h?void 0:w(e);return Uo(D||e,function(N,S){D&&(S=N,N=e[S]),Vn(o,S,nr(N,r,t,S,e,a))}),o}var cl=1,ul=4;function ll(e){return nr(e,cl|ul)}var fl=function(){return Fe.Date.now()};const Gr=fl;var dl="Expected a function",hl=Math.max,pl=Math.min;function Ft(e,r,t){var n,s,a,o,i,c,l=0,h=!1,m=!1,x=!0;if(typeof e!="function")throw new TypeError(dl);r=An(r)||0,Ge(t)&&(h=!!t.leading,m="maxWait"in t,a=m?hl(An(t.maxWait)||0,r):a,x="trailing"in t?!!t.trailing:x);function v($){var _=n,W=s;return n=s=void 0,l=$,o=e.apply(W,_),o}function w($){return l=$,i=setTimeout(S,r),h?v($):o}function D($){var _=$-c,W=$-l,Y=r-_;return m?pl(Y,a-W):Y}function N($){var _=$-c,W=$-l;return c===void 0||_>=r||_<0||m&&W>=a}function S(){var $=Gr();if(N($))return A($);i=setTimeout(S,D($))}function A($){return i=void 0,x&&n?v($):(n=s=void 0,o)}function B(){i!==void 0&&clearTimeout(i),l=0,n=c=s=i=void 0}function F(){return i===void 0?o:A(Gr())}function g(){var $=Gr(),_=N($);if(n=arguments,s=this,c=$,_){if(i===void 0)return w(c);if(m)return clearTimeout(i),i=setTimeout(S,r),v(c)}return i===void 0&&(i=setTimeout(S,r)),o}return g.cancel=B,g.flush=F,g}var ml="Expected a function";function bl(e,r,t){var n=!0,s=!0;if(typeof e!="function")throw new TypeError(ml);return Ge(t)&&(n="leading"in t?!!t.leading:n,s="trailing"in t?!!t.trailing:s),Ft(e,r,{leading:n,maxWait:r,trailing:s})}const gl=(e,r)=>{const{value:t,readOnly:n=!1,debounceTime:s=800,fillContainer:a=!0,leftElement:o,rightElement:i,className:c,leftElementClassName:l,rightElementClassName:h,isSingleLine:m=!0,allowSingleLineScroll:x=!1,inputMode:v,placeholder:w,onFocus:D,onBlur:N,onInput:S,onInnerTextChange:A,onInnerHTMLChange:B,onElementCreate:F,onLeftElementClick:g,onRightElementClick:$}=e,_=d.useRef("bsc-flex-grow focus:bsc-outline-none"),W=d.useRef("bsc-text-gray-4"),Y=d.useRef(),re=d.useCallback(p=>{const j=p.target,q=j.innerHTML;j.className=`${_.current}`,w&&q===w&&(j.innerHTML=""),D==null||D(p)},[w,D]),te=d.useCallback(p=>{const j=p.target.innerHTML;if(w&&j===""){const q=p.target;q.innerHTML=w,q.className=`${_.current} ${W.current}`}N==null||N(p)},[w,N]),U=d.useCallback(p=>{var j,q;(j=Y.current)==null||j.removeEventListener("focus",re),(q=Y.current)==null||q.removeEventListener("blur",te),w&&p&&p!==document.activeElement&&p.innerHTML===""&&(p.innerHTML=w,p.className=`${_.current} ${W.current}`),p.addEventListener("focus",re),p.addEventListener("blur",te),Y.current=p},[w]),E=d.useCallback(p=>{F==null||F(p)},[F]),P=p=>{g==null||g(p)},I=p=>{$==null||$(p)},k=Ft(p=>{S==null||S(p),A==null||A(p.target.innerText),B==null||B(p.target.innerHTML)},s),G=d.useCallback(p=>{Y.current&&(Y.current.innerText=p)},[]),O=d.useCallback(p=>{Y.current&&(Y.current.innerHTML=p)},[]),se=d.useCallback(()=>{var p;(p=Y.current)==null||p.focus()},[]);d.useImperativeHandle(r,()=>({inputElement:Y.current,setInnerText:G,setInnerHTML:O,focus:se}));const y=ce({"bsc-w-full ":a},"bsc-flex bsc-flex-row bsc-items-center bsc-shadow-sm bsc-border bsc-border-solid bsc-border-gray-3 dark:bsc-border-white dark:bsc-bg-mono-dark-1 dark:bsc-text-mono-light-1 bsc-rounded-md bsc-p-2",{"bsc-overflow-x-auto bsc-overflow-y-hidden bsc-whitespace-pre":m&&x,"bsc-overflow-hidden bsc-whitespace-pre":m&&!x},c),C=ce("bsc-flex-shrink",{"bsc-mr-2":o},l),V=ce("bsc-flex-shrink",{"bsc-ml-2":i},h);return f.jsxs("div",{className:y,ref:p=>p&&E(p),children:[o&&f.jsx("div",{className:C,onClick:P,children:o}),f.jsx("div",{ref:p=>p&&U(p),className:_.current,contentEditable:!n,suppressContentEditableWarning:!0,inputMode:v,onInput:k,children:t}),i&&f.jsx("div",{className:V,onClick:I,children:i})]})},sr=d.forwardRef(gl);function ue(e){const r=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&r==="[object Date]"?new e.constructor(+e):typeof e=="number"||r==="[object Number]"||typeof e=="string"||r==="[object String]"?new Date(e):new Date(NaN)}function ye(e,r){return e instanceof Date?new e.constructor(r):new Date(r)}function vt(e,r){const t=ue(e);return isNaN(r)?ye(e,NaN):(r&&t.setDate(t.getDate()+r),t)}function ct(e,r){const t=ue(e);if(isNaN(r))return ye(e,NaN);if(!r)return t;const n=t.getDate(),s=ye(e,t.getTime());s.setMonth(t.getMonth()+r+1,0);const a=s.getDate();return n>=a?s:(t.setFullYear(s.getFullYear(),s.getMonth(),n),t)}const Es=6048e5,Zr=6e4,Qr=36e5,yl=1e3;let vl={};function Yt(){return vl}function rt(e,r){var i,c,l,h;const t=Yt(),n=(r==null?void 0:r.weekStartsOn)??((c=(i=r==null?void 0:r.locale)==null?void 0:i.options)==null?void 0:c.weekStartsOn)??t.weekStartsOn??((h=(l=t.locale)==null?void 0:l.options)==null?void 0:h.weekStartsOn)??0,s=ue(e),a=s.getDay(),o=(a<n?7:0)+a-n;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function xt(e){return rt(e,{weekStartsOn:1})}function xl(e){const r=ue(e),t=r.getFullYear(),n=ye(e,0);n.setFullYear(t+1,0,4),n.setHours(0,0,0,0);const s=xt(n),a=ye(e,0);a.setFullYear(t,0,4),a.setHours(0,0,0,0);const o=xt(a);return r.getTime()>=s.getTime()?t+1:r.getTime()>=o.getTime()?t:t-1}function ks(e){const r=ue(e);return r.setHours(0,0,0,0),r}function Cs(e){const r=ue(e),t=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return t.setUTCFullYear(r.getFullYear()),+e-+t}function wl(e){const r=xl(e),t=ye(e,0);return t.setFullYear(r,0,4),t.setHours(0,0,0,0),xt(t)}function ar(e,r){return ct(e,r*12)}function Ds(e,r){const t=ks(e),n=ks(r);return+t==+n}function Tl(e){const r=ue(e),t=r.getMonth();return r.setFullYear(r.getFullYear(),t+1,0),r.setHours(23,59,59,999),r}function Sl(e,r){const t=ue(e.start),n=ue(e.end);let s=+t>+n;const a=s?+t:+n,o=s?n:t;o.setHours(0,0,0,0);let i=(r==null?void 0:r.step)??1;if(!i)return[];i<0&&(i=-i,s=!s);const c=[];for(;+o<=a;)c.push(ue(o)),o.setDate(o.getDate()+i),o.setHours(0,0,0,0);return s?c.reverse():c}function Os(e){const r=ue(e);return r.setDate(1),r.setHours(0,0,0,0),r}function Pl(e,r){const t=ue(e.start),n=ue(e.end);let s=+t>+n;const a=s?+t:+n,o=s?n:t;o.setHours(0,0,0,0),o.setMonth(0,1);let i=(r==null?void 0:r.step)??1;if(!i)return[];i<0&&(i=-i,s=!s);const c=[];for(;+o<=a;)c.push(ue(o)),o.setFullYear(o.getFullYear()+i);return s?c.reverse():c}const El={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},kl=(e,r,t)=>{let n;const s=El[e];return typeof s=="string"?n=s:r===1?n=s.one:n=s.other.replace("{{count}}",r.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+n:n+" ago":n};function Kr(e){return(r={})=>{const t=r.width?String(r.width):e.defaultWidth;return e.formats[t]||e.formats[e.defaultWidth]}}const Cl={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Dl={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ol={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Nl={date:Kr({formats:Cl,defaultWidth:"full"}),time:Kr({formats:Dl,defaultWidth:"full"}),dateTime:Kr({formats:Ol,defaultWidth:"full"})},_l={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Il=(e,r,t,n)=>_l[e];function Ht(e){return(r,t)=>{const n=t!=null&&t.context?String(t.context):"standalone";let s;if(n==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,i=t!=null&&t.width?String(t.width):o;s=e.formattingValues[i]||e.formattingValues[o]}else{const o=e.defaultWidth,i=t!=null&&t.width?String(t.width):e.defaultWidth;s=e.values[i]||e.values[o]}const a=e.argumentCallback?e.argumentCallback(r):r;return s[a]}}const jl={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ml={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Rl={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Al={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Ll={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},$l={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Fl={ordinalNumber:(e,r)=>{const t=Number(e),n=t%100;if(n>20||n<10)switch(n%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},era:Ht({values:jl,defaultWidth:"wide"}),quarter:Ht({values:Ml,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ht({values:Rl,defaultWidth:"wide"}),day:Ht({values:Al,defaultWidth:"wide"}),dayPeriod:Ht({values:Ll,defaultWidth:"wide",formattingValues:$l,defaultFormattingWidth:"wide"})};function Wt(e){return(r,t={})=>{const n=t.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=r.match(s);if(!a)return null;const o=a[0],i=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(i)?Hl(i,m=>m.test(o)):Yl(i,m=>m.test(o));let l;l=e.valueCallback?e.valueCallback(c):c,l=t.valueCallback?t.valueCallback(l):l;const h=r.slice(o.length);return{value:l,rest:h}}}function Yl(e,r){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&r(e[t]))return t}function Hl(e,r){for(let t=0;t<e.length;t++)if(r(e[t]))return t}function Wl(e){return(r,t={})=>{const n=r.match(e.matchPattern);if(!n)return null;const s=n[0],a=r.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=t.valueCallback?t.valueCallback(o):o;const i=r.slice(s.length);return{value:o,rest:i}}}const Vl=/^(\d+)(th|st|nd|rd)?/i,Bl=/\d+/i,zl={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Ul={any:[/^b/i,/^(a|c)/i]},ql={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Gl={any:[/1/i,/2/i,/3/i,/4/i]},Zl={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Ql={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Kl={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Xl={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Jl={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ef={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},tf={ordinalNumber:Wl({matchPattern:Vl,parsePattern:Bl,valueCallback:e=>parseInt(e,10)}),era:Wt({matchPatterns:zl,defaultMatchWidth:"wide",parsePatterns:Ul,defaultParseWidth:"any"}),quarter:Wt({matchPatterns:ql,defaultMatchWidth:"wide",parsePatterns:Gl,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Wt({matchPatterns:Zl,defaultMatchWidth:"wide",parsePatterns:Ql,defaultParseWidth:"any"}),day:Wt({matchPatterns:Kl,defaultMatchWidth:"wide",parsePatterns:Xl,defaultParseWidth:"any"}),dayPeriod:Wt({matchPatterns:Jl,defaultMatchWidth:"any",parsePatterns:ef,defaultParseWidth:"any"})},rf={code:"en-US",formatDistance:kl,formatLong:Nl,formatRelative:Il,localize:Fl,match:tf,options:{weekStartsOn:0,firstWeekContainsDate:1}};function nf(e){const r=ue(e),t=+xt(r)-+wl(r);return Math.round(t/Es)+1}function Ns(e,r){var h,m,x,v;const t=ue(e),n=t.getFullYear(),s=Yt(),a=(r==null?void 0:r.firstWeekContainsDate)??((m=(h=r==null?void 0:r.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??s.firstWeekContainsDate??((v=(x=s.locale)==null?void 0:x.options)==null?void 0:v.firstWeekContainsDate)??1,o=ye(e,0);o.setFullYear(n+1,0,a),o.setHours(0,0,0,0);const i=rt(o,r),c=ye(e,0);c.setFullYear(n,0,a),c.setHours(0,0,0,0);const l=rt(c,r);return t.getTime()>=i.getTime()?n+1:t.getTime()>=l.getTime()?n:n-1}function sf(e,r){var i,c,l,h;const t=Yt(),n=(r==null?void 0:r.firstWeekContainsDate)??((c=(i=r==null?void 0:r.locale)==null?void 0:i.options)==null?void 0:c.firstWeekContainsDate)??t.firstWeekContainsDate??((h=(l=t.locale)==null?void 0:l.options)==null?void 0:h.firstWeekContainsDate)??1,s=Ns(e,r),a=ye(e,0);return a.setFullYear(s,0,n),a.setHours(0,0,0,0),rt(a,r)}function af(e,r){const t=ue(e),n=+rt(t,r)-+sf(t,r);return Math.round(n/Es)+1}const _s=(e,r)=>{switch(e){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},Is=(e,r)=>{switch(e){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},js={p:Is,P:(e,r)=>{const t=e.match(/(P+)(p+)?/)||[],n=t[1],s=t[2];if(!s)return _s(e,r);let a;switch(n){case"P":a=r.dateTime({width:"short"});break;case"PP":a=r.dateTime({width:"medium"});break;case"PPP":a=r.dateTime({width:"long"});break;case"PPPP":default:a=r.dateTime({width:"full"});break}return a.replace("{{date}}",_s(n,r)).replace("{{time}}",Is(s,r))}},of=/^D+$/,cf=/^Y+$/,uf=["D","DD","YY","YYYY"];function lf(e){return of.test(e)}function ff(e){return cf.test(e)}function Ms(e,r,t){const n=df(e,r,t);if(console.warn(n),uf.includes(e))throw new RangeError(n)}function df(e,r,t){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${r}\`) for formatting ${n} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function Xr(e){return ue(e).getDay()}function Rs(e){const r=ue(e),t=r.getFullYear(),n=r.getMonth(),s=ye(e,0);return s.setFullYear(t,n+1,0),s.setHours(0,0,0,0),s.getDate()}function hf(){return Object.assign({},Yt())}function pf(e){let t=ue(e).getDay();return t===0&&(t=7),t}function mf(e){const r=ue(e),t=r.getMonth();return r.setFullYear(r.getFullYear(),t+1,0),r.setHours(0,0,0,0),r}function bf(e,r){const t=ue(e),n=ue(r);return+t<+n}function gf(e,r){const t=r instanceof Date?ye(r,0):new r(0);return t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),t}const yf=10;class As{constructor(){b(this,"subPriority",0)}validate(r,t){return!0}}class vf extends As{constructor(r,t,n,s,a){super(),this.value=r,this.validateValue=t,this.setValue=n,this.priority=s,a&&(this.subPriority=a)}validate(r,t){return this.validateValue(r,this.value,t)}set(r,t,n){return this.setValue(r,t,this.value,n)}}class xf extends As{constructor(){super(...arguments);b(this,"priority",yf);b(this,"subPriority",-1)}set(t,n){return n.timestampIsSet?t:ye(t,gf(t,Date))}}class le{run(r,t,n,s){const a=this.parse(r,t,n,s);return a?{setter:new vf(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(r,t,n){return!0}}class wf extends le{constructor(){super(...arguments);b(this,"priority",140);b(this,"incompatibleTokens",["R","u","t","T"])}parse(t,n,s){switch(n){case"G":case"GG":case"GGG":return s.era(t,{width:"abbreviated"})||s.era(t,{width:"narrow"});case"GGGGG":return s.era(t,{width:"narrow"});case"GGGG":default:return s.era(t,{width:"wide"})||s.era(t,{width:"abbreviated"})||s.era(t,{width:"narrow"})}}set(t,n,s){return n.era=s,t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}const Pe={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Ve={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Ee(e,r){return e&&{value:r(e.value),rest:e.rest}}function we(e,r){const t=r.match(e);return t?{value:parseInt(t[0],10),rest:r.slice(t[0].length)}:null}function Be(e,r){const t=r.match(e);if(!t)return null;if(t[0]==="Z")return{value:0,rest:r.slice(1)};const n=t[1]==="+"?1:-1,s=t[2]?parseInt(t[2],10):0,a=t[3]?parseInt(t[3],10):0,o=t[5]?parseInt(t[5],10):0;return{value:n*(s*Qr+a*Zr+o*yl),rest:r.slice(t[0].length)}}function Ls(e){return we(Pe.anyDigitsSigned,e)}function Te(e,r){switch(e){case 1:return we(Pe.singleDigit,r);case 2:return we(Pe.twoDigits,r);case 3:return we(Pe.threeDigits,r);case 4:return we(Pe.fourDigits,r);default:return we(new RegExp("^\\d{1,"+e+"}"),r)}}function or(e,r){switch(e){case 1:return we(Pe.singleDigitSigned,r);case 2:return we(Pe.twoDigitsSigned,r);case 3:return we(Pe.threeDigitsSigned,r);case 4:return we(Pe.fourDigitsSigned,r);default:return we(new RegExp("^-?\\d{1,"+e+"}"),r)}}function Jr(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function $s(e,r){const t=r>0,n=t?r:1-r;let s;if(n<=50)s=e||100;else{const a=n+50,o=Math.trunc(a/100)*100,i=e>=a%100;s=e+o-(i?100:0)}return t?s:1-s}function Fs(e){return e%400===0||e%4===0&&e%100!==0}class Tf extends le{constructor(){super(...arguments);b(this,"priority",130);b(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(t,n,s){const a=o=>({year:o,isTwoDigitYear:n==="yy"});switch(n){case"y":return Ee(Te(4,t),a);case"yo":return Ee(s.ordinalNumber(t,{unit:"year"}),a);default:return Ee(Te(n.length,t),a)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,s){const a=t.getFullYear();if(s.isTwoDigitYear){const i=$s(s.year,a);return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}const o=!("era"in n)||n.era===1?s.year:1-s.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}}class Sf extends le{constructor(){super(...arguments);b(this,"priority",130);b(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(t,n,s){const a=o=>({year:o,isTwoDigitYear:n==="YY"});switch(n){case"Y":return Ee(Te(4,t),a);case"Yo":return Ee(s.ordinalNumber(t,{unit:"year"}),a);default:return Ee(Te(n.length,t),a)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,s,a){const o=Ns(t,a);if(s.isTwoDigitYear){const c=$s(s.year,o);return t.setFullYear(c,0,a.firstWeekContainsDate),t.setHours(0,0,0,0),rt(t,a)}const i=!("era"in n)||n.era===1?s.year:1-s.year;return t.setFullYear(i,0,a.firstWeekContainsDate),t.setHours(0,0,0,0),rt(t,a)}}class Pf extends le{constructor(){super(...arguments);b(this,"priority",130);b(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(t,n){return or(n==="R"?4:n.length,t)}set(t,n,s){const a=ye(t,0);return a.setFullYear(s,0,4),a.setHours(0,0,0,0),xt(a)}}class Ef extends le{constructor(){super(...arguments);b(this,"priority",130);b(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(t,n){return or(n==="u"?4:n.length,t)}set(t,n,s){return t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}class kf extends le{constructor(){super(...arguments);b(this,"priority",120);b(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,n,s){switch(n){case"Q":case"QQ":return Te(n.length,t);case"Qo":return s.ordinalNumber(t,{unit:"quarter"});case"QQQ":return s.quarter(t,{width:"abbreviated",context:"formatting"})||s.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(t,{width:"wide",context:"formatting"})||s.quarter(t,{width:"abbreviated",context:"formatting"})||s.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=1&&n<=4}set(t,n,s){return t.setMonth((s-1)*3,1),t.setHours(0,0,0,0),t}}class Cf extends le{constructor(){super(...arguments);b(this,"priority",120);b(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,n,s){switch(n){case"q":case"qq":return Te(n.length,t);case"qo":return s.ordinalNumber(t,{unit:"quarter"});case"qqq":return s.quarter(t,{width:"abbreviated",context:"standalone"})||s.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(t,{width:"wide",context:"standalone"})||s.quarter(t,{width:"abbreviated",context:"standalone"})||s.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=1&&n<=4}set(t,n,s){return t.setMonth((s-1)*3,1),t.setHours(0,0,0,0),t}}class Df extends le{constructor(){super(...arguments);b(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);b(this,"priority",110)}parse(t,n,s){const a=o=>o-1;switch(n){case"M":return Ee(we(Pe.month,t),a);case"MM":return Ee(Te(2,t),a);case"Mo":return Ee(s.ordinalNumber(t,{unit:"month"}),a);case"MMM":return s.month(t,{width:"abbreviated",context:"formatting"})||s.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(t,{width:"wide",context:"formatting"})||s.month(t,{width:"abbreviated",context:"formatting"})||s.month(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=11}set(t,n,s){return t.setMonth(s,1),t.setHours(0,0,0,0),t}}class Of extends le{constructor(){super(...arguments);b(this,"priority",110);b(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(t,n,s){const a=o=>o-1;switch(n){case"L":return Ee(we(Pe.month,t),a);case"LL":return Ee(Te(2,t),a);case"Lo":return Ee(s.ordinalNumber(t,{unit:"month"}),a);case"LLL":return s.month(t,{width:"abbreviated",context:"standalone"})||s.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(t,{width:"wide",context:"standalone"})||s.month(t,{width:"abbreviated",context:"standalone"})||s.month(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=11}set(t,n,s){return t.setMonth(s,1),t.setHours(0,0,0,0),t}}function Nf(e,r,t){const n=ue(e),s=af(n,t)-r;return n.setDate(n.getDate()-s*7),n}class _f extends le{constructor(){super(...arguments);b(this,"priority",100);b(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(t,n,s){switch(n){case"w":return we(Pe.week,t);case"wo":return s.ordinalNumber(t,{unit:"week"});default:return Te(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,s,a){return rt(Nf(t,s,a),a)}}function If(e,r){const t=ue(e),n=nf(t)-r;return t.setDate(t.getDate()-n*7),t}class jf extends le{constructor(){super(...arguments);b(this,"priority",100);b(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(t,n,s){switch(n){case"I":return we(Pe.week,t);case"Io":return s.ordinalNumber(t,{unit:"week"});default:return Te(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,s){return xt(If(t,s))}}const Mf=[31,28,31,30,31,30,31,31,30,31,30,31],Rf=[31,29,31,30,31,30,31,31,30,31,30,31];class Af extends le{constructor(){super(...arguments);b(this,"priority",90);b(this,"subPriority",1);b(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(t,n,s){switch(n){case"d":return we(Pe.date,t);case"do":return s.ordinalNumber(t,{unit:"date"});default:return Te(n.length,t)}}validate(t,n){const s=t.getFullYear(),a=Fs(s),o=t.getMonth();return a?n>=1&&n<=Rf[o]:n>=1&&n<=Mf[o]}set(t,n,s){return t.setDate(s),t.setHours(0,0,0,0),t}}class Lf extends le{constructor(){super(...arguments);b(this,"priority",90);b(this,"subpriority",1);b(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(t,n,s){switch(n){case"D":case"DD":return we(Pe.dayOfYear,t);case"Do":return s.ordinalNumber(t,{unit:"date"});default:return Te(n.length,t)}}validate(t,n){const s=t.getFullYear();return Fs(s)?n>=1&&n<=366:n>=1&&n<=365}set(t,n,s){return t.setMonth(0,s),t.setHours(0,0,0,0),t}}function en(e,r,t){var m,x,v,w;const n=Yt(),s=(t==null?void 0:t.weekStartsOn)??((x=(m=t==null?void 0:t.locale)==null?void 0:m.options)==null?void 0:x.weekStartsOn)??n.weekStartsOn??((w=(v=n.locale)==null?void 0:v.options)==null?void 0:w.weekStartsOn)??0,a=ue(e),o=a.getDay(),c=(r%7+7)%7,l=7-s,h=r<0||r>6?r-(o+l)%7:(c+l)%7-(o+l)%7;return vt(a,h)}class $f extends le{constructor(){super(...arguments);b(this,"priority",90);b(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(t,n,s){switch(n){case"E":case"EE":case"EEE":return s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,s,a){return t=en(t,s,a),t.setHours(0,0,0,0),t}}class Ff extends le{constructor(){super(...arguments);b(this,"priority",90);b(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(t,n,s,a){const o=i=>{const c=Math.floor((i-1)/7)*7;return(i+a.weekStartsOn+6)%7+c};switch(n){case"e":case"ee":return Ee(Te(n.length,t),o);case"eo":return Ee(s.ordinalNumber(t,{unit:"day"}),o);case"eee":return s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"eeeee":return s.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,s,a){return t=en(t,s,a),t.setHours(0,0,0,0),t}}class Yf extends le{constructor(){super(...arguments);b(this,"priority",90);b(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(t,n,s,a){const o=i=>{const c=Math.floor((i-1)/7)*7;return(i+a.weekStartsOn+6)%7+c};switch(n){case"c":case"cc":return Ee(Te(n.length,t),o);case"co":return Ee(s.ordinalNumber(t,{unit:"day"}),o);case"ccc":return s.day(t,{width:"abbreviated",context:"standalone"})||s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"});case"ccccc":return s.day(t,{width:"narrow",context:"standalone"});case"cccccc":return s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(t,{width:"wide",context:"standalone"})||s.day(t,{width:"abbreviated",context:"standalone"})||s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=6}set(t,n,s,a){return t=en(t,s,a),t.setHours(0,0,0,0),t}}function Hf(e,r){const t=ue(e),n=pf(t),s=r-n;return vt(t,s)}class Wf extends le{constructor(){super(...arguments);b(this,"priority",90);b(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(t,n,s){const a=o=>o===0?7:o;switch(n){case"i":case"ii":return Te(n.length,t);case"io":return s.ordinalNumber(t,{unit:"day"});case"iii":return Ee(s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),a);case"iiiii":return Ee(s.day(t,{width:"narrow",context:"formatting"}),a);case"iiiiii":return Ee(s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),a);case"iiii":default:return Ee(s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),a)}}validate(t,n){return n>=1&&n<=7}set(t,n,s){return t=Hf(t,s),t.setHours(0,0,0,0),t}}class Vf extends le{constructor(){super(...arguments);b(this,"priority",80);b(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(t,n,s){switch(n){case"a":case"aa":case"aaa":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,s){return t.setHours(Jr(s),0,0,0),t}}class Bf extends le{constructor(){super(...arguments);b(this,"priority",80);b(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(t,n,s){switch(n){case"b":case"bb":case"bbb":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,s){return t.setHours(Jr(s),0,0,0),t}}class zf extends le{constructor(){super(...arguments);b(this,"priority",80);b(this,"incompatibleTokens",["a","b","t","T"])}parse(t,n,s){switch(n){case"B":case"BB":case"BBB":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,s){return t.setHours(Jr(s),0,0,0),t}}class Uf extends le{constructor(){super(...arguments);b(this,"priority",70);b(this,"incompatibleTokens",["H","K","k","t","T"])}parse(t,n,s){switch(n){case"h":return we(Pe.hour12h,t);case"ho":return s.ordinalNumber(t,{unit:"hour"});default:return Te(n.length,t)}}validate(t,n){return n>=1&&n<=12}set(t,n,s){const a=t.getHours()>=12;return a&&s<12?t.setHours(s+12,0,0,0):!a&&s===12?t.setHours(0,0,0,0):t.setHours(s,0,0,0),t}}class qf extends le{constructor(){super(...arguments);b(this,"priority",70);b(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(t,n,s){switch(n){case"H":return we(Pe.hour23h,t);case"Ho":return s.ordinalNumber(t,{unit:"hour"});default:return Te(n.length,t)}}validate(t,n){return n>=0&&n<=23}set(t,n,s){return t.setHours(s,0,0,0),t}}class Gf extends le{constructor(){super(...arguments);b(this,"priority",70);b(this,"incompatibleTokens",["h","H","k","t","T"])}parse(t,n,s){switch(n){case"K":return we(Pe.hour11h,t);case"Ko":return s.ordinalNumber(t,{unit:"hour"});default:return Te(n.length,t)}}validate(t,n){return n>=0&&n<=11}set(t,n,s){return t.getHours()>=12&&s<12?t.setHours(s+12,0,0,0):t.setHours(s,0,0,0),t}}class Zf extends le{constructor(){super(...arguments);b(this,"priority",70);b(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(t,n,s){switch(n){case"k":return we(Pe.hour24h,t);case"ko":return s.ordinalNumber(t,{unit:"hour"});default:return Te(n.length,t)}}validate(t,n){return n>=1&&n<=24}set(t,n,s){const a=s<=24?s%24:s;return t.setHours(a,0,0,0),t}}class Qf extends le{constructor(){super(...arguments);b(this,"priority",60);b(this,"incompatibleTokens",["t","T"])}parse(t,n,s){switch(n){case"m":return we(Pe.minute,t);case"mo":return s.ordinalNumber(t,{unit:"minute"});default:return Te(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,s){return t.setMinutes(s,0,0),t}}class Kf extends le{constructor(){super(...arguments);b(this,"priority",50);b(this,"incompatibleTokens",["t","T"])}parse(t,n,s){switch(n){case"s":return we(Pe.second,t);case"so":return s.ordinalNumber(t,{unit:"second"});default:return Te(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,s){return t.setSeconds(s,0),t}}class Xf extends le{constructor(){super(...arguments);b(this,"priority",30);b(this,"incompatibleTokens",["t","T"])}parse(t,n){const s=a=>Math.trunc(a*Math.pow(10,-n.length+3));return Ee(Te(n.length,t),s)}set(t,n,s){return t.setMilliseconds(s),t}}class Jf extends le{constructor(){super(...arguments);b(this,"priority",10);b(this,"incompatibleTokens",["t","T","x"])}parse(t,n){switch(n){case"X":return Be(Ve.basicOptionalMinutes,t);case"XX":return Be(Ve.basic,t);case"XXXX":return Be(Ve.basicOptionalSeconds,t);case"XXXXX":return Be(Ve.extendedOptionalSeconds,t);case"XXX":default:return Be(Ve.extended,t)}}set(t,n,s){return n.timestampIsSet?t:ye(t,t.getTime()-Cs(t)-s)}}class ed extends le{constructor(){super(...arguments);b(this,"priority",10);b(this,"incompatibleTokens",["t","T","X"])}parse(t,n){switch(n){case"x":return Be(Ve.basicOptionalMinutes,t);case"xx":return Be(Ve.basic,t);case"xxxx":return Be(Ve.basicOptionalSeconds,t);case"xxxxx":return Be(Ve.extendedOptionalSeconds,t);case"xxx":default:return Be(Ve.extended,t)}}set(t,n,s){return n.timestampIsSet?t:ye(t,t.getTime()-Cs(t)-s)}}class td extends le{constructor(){super(...arguments);b(this,"priority",40);b(this,"incompatibleTokens","*")}parse(t){return Ls(t)}set(t,n,s){return[ye(t,s*1e3),{timestampIsSet:!0}]}}class rd extends le{constructor(){super(...arguments);b(this,"priority",20);b(this,"incompatibleTokens","*")}parse(t){return Ls(t)}set(t,n,s){return[ye(t,s),{timestampIsSet:!0}]}}const nd={G:new wf,y:new Tf,Y:new Sf,R:new Pf,u:new Ef,Q:new kf,q:new Cf,M:new Df,L:new Of,w:new _f,I:new jf,d:new Af,D:new Lf,E:new $f,e:new Ff,c:new Yf,i:new Wf,a:new Vf,b:new Bf,B:new zf,h:new Uf,H:new qf,K:new Gf,k:new Zf,m:new Qf,s:new Kf,S:new Xf,X:new Jf,x:new ed,t:new td,T:new rd},sd=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ad=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,od=/^'([^]*?)'?$/,id=/''/g,cd=/\S/,ud=/[a-zA-Z]/;function ze(e,r,t,n){var D,N,S,A,B,F,g,$;const s=hf(),a=(n==null?void 0:n.locale)??s.locale??rf,o=(n==null?void 0:n.firstWeekContainsDate)??((N=(D=n==null?void 0:n.locale)==null?void 0:D.options)==null?void 0:N.firstWeekContainsDate)??s.firstWeekContainsDate??((A=(S=s.locale)==null?void 0:S.options)==null?void 0:A.firstWeekContainsDate)??1,i=(n==null?void 0:n.weekStartsOn)??((F=(B=n==null?void 0:n.locale)==null?void 0:B.options)==null?void 0:F.weekStartsOn)??s.weekStartsOn??(($=(g=s.locale)==null?void 0:g.options)==null?void 0:$.weekStartsOn)??0;if(r==="")return e===""?ue(t):ye(t,NaN);const c={firstWeekContainsDate:o,weekStartsOn:i,locale:a},l=[new xf],h=r.match(ad).map(_=>{const W=_[0];if(W in js){const Y=js[W];return Y(_,a.formatLong)}return _}).join("").match(sd),m=[];for(let _ of h){!(n!=null&&n.useAdditionalWeekYearTokens)&&ff(_)&&Ms(_,r,e),!(n!=null&&n.useAdditionalDayOfYearTokens)&&lf(_)&&Ms(_,r,e);const W=_[0],Y=nd[W];if(Y){const{incompatibleTokens:re}=Y;if(Array.isArray(re)){const U=m.find(E=>re.includes(E.token)||E.token===W);if(U)throw new RangeError(`The format string mustn't contain \`${U.fullToken}\` and \`${_}\` at the same time`)}else if(Y.incompatibleTokens==="*"&&m.length>0)throw new RangeError(`The format string mustn't contain \`${_}\` and any other token at the same time`);m.push({token:W,fullToken:_});const te=Y.run(e,_,a.match,c);if(!te)return ye(t,NaN);l.push(te.setter),e=te.rest}else{if(W.match(ud))throw new RangeError("Format string contains an unescaped latin alphabet character `"+W+"`");if(_==="''"?_="'":W==="'"&&(_=ld(_)),e.indexOf(_)===0)e=e.slice(_.length);else return ye(t,NaN)}}if(e.length>0&&cd.test(e))return ye(t,NaN);const x=l.map(_=>_.priority).sort((_,W)=>W-_).filter((_,W,Y)=>Y.indexOf(_)===W).map(_=>l.filter(W=>W.priority===_).sort((W,Y)=>Y.subPriority-W.subPriority)).map(_=>_[0]);let v=ue(t);if(isNaN(v.getTime()))return ye(t,NaN);const w={};for(const _ of x){if(!_.validate(v,c))return ye(t,NaN);const W=_.set(v,w,c);Array.isArray(W)?(v=W[0],Object.assign(w,W[1])):v=W}return ye(t,v)}function ld(e){return e.match(od)[1].replace(id,"'")}function fd(e){return Ds(e,Date.now())}function dd(e,r){return vt(e,-r)}function hd(e,r){let t=r-Xr(e);return t<=0&&(t+=7),vt(e,t)}function pd(e,r){const t=(r==null?void 0:r.additionalDigits)??2,n=yd(e);let s;if(n.date){const c=vd(n.date,t);s=xd(c.restDateString,c.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);const a=s.getTime();let o=0,i;if(n.time&&(o=wd(n.time),isNaN(o)))return new Date(NaN);if(n.timezone){if(i=Td(n.timezone),isNaN(i))return new Date(NaN)}else{const c=new Date(a+o),l=new Date(0);return l.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),l.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),l}return new Date(a+o+i)}const ir={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},md=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,bd=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,gd=/^([+-])(\d{2})(?::?(\d{2}))?$/;function yd(e){const r={},t=e.split(ir.dateTimeDelimiter);let n;if(t.length>2)return r;if(/:/.test(t[0])?n=t[0]:(r.date=t[0],n=t[1],ir.timeZoneDelimiter.test(r.date)&&(r.date=e.split(ir.timeZoneDelimiter)[0],n=e.substr(r.date.length,e.length))),n){const s=ir.timezone.exec(n);s?(r.time=n.replace(s[1],""),r.timezone=s[1]):r.time=n}return r}function vd(e,r){const t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+r)+"})|(\\d{2}|[+-]\\d{"+(2+r)+"})$)"),n=e.match(t);if(!n)return{year:NaN,restDateString:""};const s=n[1]?parseInt(n[1]):null,a=n[2]?parseInt(n[2]):null;return{year:a===null?s:a*100,restDateString:e.slice((n[1]||n[2]).length)}}function xd(e,r){if(r===null)return new Date(NaN);const t=e.match(md);if(!t)return new Date(NaN);const n=!!t[4],s=Vt(t[1]),a=Vt(t[2])-1,o=Vt(t[3]),i=Vt(t[4]),c=Vt(t[5])-1;if(n)return Cd(r,i,c)?Sd(r,i,c):new Date(NaN);{const l=new Date(0);return!Ed(r,a,o)||!kd(r,s)?new Date(NaN):(l.setUTCFullYear(r,a,Math.max(s,o)),l)}}function Vt(e){return e?parseInt(e):1}function wd(e){const r=e.match(bd);if(!r)return NaN;const t=tn(r[1]),n=tn(r[2]),s=tn(r[3]);return Dd(t,n,s)?t*Qr+n*Zr+s*1e3:NaN}function tn(e){return e&&parseFloat(e.replace(",","."))||0}function Td(e){if(e==="Z")return 0;const r=e.match(gd);if(!r)return 0;const t=r[1]==="+"?-1:1,n=parseInt(r[2]),s=r[3]&&parseInt(r[3])||0;return Od(n,s)?t*(n*Qr+s*Zr):NaN}function Sd(e,r,t){const n=new Date(0);n.setUTCFullYear(e,0,4);const s=n.getUTCDay()||7,a=(r-1)*7+t+1-s;return n.setUTCDate(n.getUTCDate()+a),n}const Pd=[31,null,31,30,31,30,31,31,30,31,30,31];function Ys(e){return e%400===0||e%4===0&&e%100!==0}function Ed(e,r,t){return r>=0&&r<=11&&t>=1&&t<=(Pd[r]||(Ys(e)?29:28))}function kd(e,r){return r>=1&&r<=(Ys(e)?366:365)}function Cd(e,r,t){return r>=1&&r<=53&&t>=0&&t<=6}function Dd(e,r,t){return e===24?r===0&&t===0:t>=0&&t<60&&r>=0&&r<60&&e>=0&&e<25}function Od(e,r){return r>=0&&r<=59}function Nd(e,r){const t=ue(e),n=t.getFullYear(),s=t.getDate(),a=ye(e,0);a.setFullYear(n,r,15),a.setHours(0,0,0,0);const o=Rs(a);return t.setMonth(r,Math.min(s,o)),t}function _d(e,r){const t=ue(e);return isNaN(+t)?ye(e,NaN):(t.setFullYear(r),t)}function Hs(e,r){return ct(e,-r)}function Ws(e,r){return ar(e,-r)}function Vs(){return window.navigator.languages?window.navigator.languages[0]:window.navigator.language}function Id(e,r,t){const n=[];for(let s=e;s<=r;s++)n.push(t?t(s):s);return n}function jd(e,r){const t=e.target;return t?!r.isSameNode(t)&&!r.contains(t):!1}function Md(e,r){return e.isSameNode(r)||e.contains(r)}function Rd(e,r){const t=Object.entries(r),n=getComputedStyle(e);for(let s=0,a=t.length;s<a;s++){const[o,i]=t[s];if(typeof i=="string"&&i.indexOf(",")>-1){if(!i.split(",").map(l=>l.trim()).includes(n[o]))return!1}else if(n[o]!==i)return!1}return!0}function Ad(e,r){const t=Object.entries(r),n=getComputedStyle(e);for(let s=0,a=t.length;s<a;s++){const[o,i]=t[s];if(typeof i=="string"&&i.indexOf(",")>-1){if(i.split(",").map(l=>l.trim()).includes(n[o]))return!0}else if(n[o]===i)return!0}return!1}function Bs(e,r,t=!1,n){if(t&&Rd(e,r)){if(!n||(n==null?void 0:n(e))===!0)return e}else if(!t&&Ad(e,r)&&(!n||(n==null?void 0:n(e))===!0))return e;return e.parentElement?Bs(e.parentElement,r,t,n):e}function zs(e,r){const t=Array.from(document.querySelectorAll("body *")),n=[];for(let s=0,a=t.length;s<a;s++){const o=getComputedStyle(t[s]);o[e]&&r(o[e])&&n.push(o[e])}return n}function up(e){return e}function Ld(e){const r=document.documentElement;Object.keys(e).forEach(t=>{r.style.setProperty(t,e[t])})}function $d(e){return{"--theme-bsc-primary-1":e.primary1,"--theme-bsc-primary-2":e.primary2,"--theme-bsc-primary-3":e.primary3,"--theme-bsc-primary-4":e.primary4,"--theme-bsc-primary-5":e.primary5,"--theme-bsc-gray-1":e.gray1||"#303030","--theme-bsc-gray-2":e.gray2||"#5f5f5f","--theme-bsc-gray-3":e.gray3||"#8f8f8f","--theme-bsc-gray-4":e.gray4||"#bebebe","--theme-bsc-gray-5":e.gray5||"#eee","--theme-bsc-black":e.black||"#000","--theme-bsc-white":e.white||"#fff","--theme-bsc-mono-dark-1":e.monoDark1||"#222","--theme-bsc-mono-dark-2":e.monoDark2||"#3c3c3c","--theme-bsc-mono-dark-3":e.monoDark3||"#4e4e4e","--theme-bsc-mono-light-1":e.monoLight1||"#fefefe","--theme-bsc-mono-light-2":e.monoLight2||"#eee","--theme-bsc-mono-light-3":e.monoLight3||"#ccc","--theme-bsc-info":e.info||"#2e7ff8","--theme-bsc-success":e.success||"#53ae0c","--theme-bsc-warning":e.warning||"#ff6914","--theme-bsc-error":e.error||"#f01616"}}var _e=(e=>(e[e.Regular=24]="Regular",e[e.Small=20]="Small",e))(_e||{});const Us=({className:e})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5m-9-6h.008v.008H12v-.008ZM12 15h.008v.008H12V15Zm0 2.25h.008v.008H12v-.008ZM9.75 15h.008v.008H9.75V15Zm0 2.25h.008v.008H9.75v-.008ZM7.5 15h.008v.008H7.5V15Zm0 2.25h.008v.008H7.5v-.008Zm6.75-4.5h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V15Zm0 2.25h.008v.008h-.008v-.008Zm2.25-4.5h.008v.008H16.5v-.008Zm0 2.25h.008v.008H16.5V15Z"})}),Fd=({className:e})=>{const r=ce("bsc-h-6 bsc-w-6",e);return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:r,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})})},Yd=({className:e})=>{const r=ce("bsc-h-6 bsc-w-6",e);return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:r,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5 8.25 12l7.5-7.5"})})},Hd=({className:e})=>{const r=ce("bsc-h-6 bsc-w-6",e);return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:r,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})})},Wd=({className:e})=>{const r=ce("bsc-h-6 bsc-w-6",e);return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:r,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"})})},Vd=({className:e})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})}),Re=({icon:e,size:r=_e.Regular,onClick:t,className:n})=>{const s=d.useRef({calendar:Us,chevronDown:Fd,chevronLeft:Yd,chevronRight:Hd,chevronUp:Wd,close:Vd}),a=d.useMemo(()=>s.current[e]||Us,[e]),o=ce({"bsc-h-[24px] bsc-w-[24px]":r===_e.Regular,"bsc-h-[20px] bsc-w-[20px]":r===_e.Small},n);return f.jsx("div",{onClick:t,children:f.jsx(a,{className:o})})},wt=({template:e,props:r,children:t})=>e(r,t);function Bd(e,r){if(r===e)return!1;const t=Object.values(r),n=Object.values(e);if(t.length!==n.length||t.some((a,o)=>a!==n[o]))return!0;const s=Object.keys(e);return Object.keys(r).some((a,o)=>a!==s[o])}function zd(e,r){return e.matches[r]=!1,e.mediaQueries[r]={},e}function qs(e){const r=Object.keys(e);return typeof window>"u"?r.reduce(zd,{mediaQueries:{},matches:{}}):r.reduce((t,n)=>{const s=window.matchMedia(e[n]);return t.mediaQueries[n]=s,t.matches[n]=s.matches,t},{mediaQueries:{},matches:{}})}function Ud(e,r){function t(n,s){return n[s]=e.mediaQueries[s].matches,n}switch(r.type){case"updateMatches":return{matches:Object.keys(e.mediaQueries).reduce(t,{}),mediaQueries:e.mediaQueries};case"setQueries":return qs(r.queries)}}function qd(e){const r=_t.useRef(e),[t,n]=_t.useReducer(Ud,e,qs);_t.useEffect(()=>{Bd(e,r.current)&&(n({type:"setQueries",queries:e}),r.current=e)},[e]);function s(){return n({type:"updateMatches"})}function a(c){const l=s;return typeof c.addListener<"u"?c.addListener(l):c.addEventListener("change",l),l}_t.useEffect(()=>{const c=Object.values(t.mediaQueries),l=c.map(a);function h(m,x){typeof m.addListener<"u"?m.removeListener(l[x]):m.removeEventListener("change",l[x])}return()=>{c.forEach(h)}},[t.mediaQueries]);const{matches:o}=t,i=_t.useMemo(()=>Object.values(o),[o]);return{matches:o,matchesAny:i.some(Boolean),matchesAll:i.length>0&&i.every(Boolean)}}function cr(e){return qd(Gd(e)).matchesAll}const rn={};function Gd(e){return rn[e]===void 0&&(rn[e]={default:e}),rn[e]}const nn=({mobileQuery:e="screen and (max-device-width: 40rem)",tabletQuery:r="screen and (min-device-width: 40.01rem) and (max-device-width: 63.9375rem)",desktopQuery:t="screen and (min-device-width: 64rem)",mobileMarkup:n,aboveMobileMarkup:s,tabletMarkup:a,desktopMarkup:o})=>{const i=cr(e),c=cr(r),l=cr(t);return(()=>i&&n?n:!i&&s?s:c&&a?a:l&&o?o:(console.error("Invalid media settings"),null))()};function Gs(e,r,t){const n=a=>{const o=a.target,i=e.style.display!=="hidden";e&&i&&!Md(e,o)&&!s(t,o)&&r(!1),r(!0)},s=(a,o)=>{if(!a)return!1;for(let i=0,c=a.length;i<c;i++)if(a[i].isSameNode(o)||a[i].contains(o))return!0;return!1};return document.addEventListener("mousedown",n),n}function Zs(e){document.removeEventListener("mousedown",e)}function Zd(e,r){if(e==null)return{};var t={},n=Object.keys(e),s,a;for(a=0;a<n.length;a++)s=n[a],!(r.indexOf(s)>=0)&&(t[s]=e[s]);return t}function sn(e,r){return sn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},sn(e,r)}function Qd(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,sn(e,r)}var an={exports:{}},ur={exports:{}},de={};/** @license React v16.13.1
32
32
  * react-is.production.min.js
33
33
  *
34
34
  * Copyright (c) Facebook, Inc. and its affiliates.
35
35
  *
36
36
  * This source code is licensed under the MIT license found in the
37
37
  * LICENSE file in the root directory of this source tree.
38
- */var Fs;function Yd(){if(Fs)return ue;Fs=1;var e=typeof Symbol=="function"&&Symbol.for,r=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,i=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,b=e?Symbol.for("react.suspense"):60113,w=e?Symbol.for("react.suspense_list"):60120,x=e?Symbol.for("react.memo"):60115,P=e?Symbol.for("react.lazy"):60116,D=e?Symbol.for("react.block"):60121,k=e?Symbol.for("react.fundamental"):60117,E=e?Symbol.for("react.responder"):60118,L=e?Symbol.for("react.scope"):60119;function U(y){if(typeof y=="object"&&y!==null){var A=y.$$typeof;switch(A){case r:switch(y=y.type,y){case c:case l:case n:case a:case s:case b:return y;default:switch(y=y&&y.$$typeof,y){case i:case h:case P:case x:case o:return y;default:return A}}case t:return A}}}function $(y){return U(y)===l}return ue.AsyncMode=c,ue.ConcurrentMode=l,ue.ContextConsumer=i,ue.ContextProvider=o,ue.Element=r,ue.ForwardRef=h,ue.Fragment=n,ue.Lazy=P,ue.Memo=x,ue.Portal=t,ue.Profiler=a,ue.StrictMode=s,ue.Suspense=b,ue.isAsyncMode=function(y){return $(y)||U(y)===c},ue.isConcurrentMode=$,ue.isContextConsumer=function(y){return U(y)===i},ue.isContextProvider=function(y){return U(y)===o},ue.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===r},ue.isForwardRef=function(y){return U(y)===h},ue.isFragment=function(y){return U(y)===n},ue.isLazy=function(y){return U(y)===P},ue.isMemo=function(y){return U(y)===x},ue.isPortal=function(y){return U(y)===t},ue.isProfiler=function(y){return U(y)===a},ue.isStrictMode=function(y){return U(y)===s},ue.isSuspense=function(y){return U(y)===b},ue.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===n||y===l||y===a||y===s||y===b||y===w||typeof y=="object"&&y!==null&&(y.$$typeof===P||y.$$typeof===x||y.$$typeof===o||y.$$typeof===i||y.$$typeof===h||y.$$typeof===k||y.$$typeof===E||y.$$typeof===L||y.$$typeof===D)},ue.typeOf=U,ue}var le={};/** @license React v16.13.1
38
+ */var Qs;function Kd(){if(Qs)return de;Qs=1;var e=typeof Symbol=="function"&&Symbol.for,r=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,i=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,x=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,w=e?Symbol.for("react.lazy"):60116,D=e?Symbol.for("react.block"):60121,N=e?Symbol.for("react.fundamental"):60117,S=e?Symbol.for("react.responder"):60118,A=e?Symbol.for("react.scope"):60119;function B(g){if(typeof g=="object"&&g!==null){var $=g.$$typeof;switch($){case r:switch(g=g.type,g){case c:case l:case n:case a:case s:case m:return g;default:switch(g=g&&g.$$typeof,g){case i:case h:case w:case v:case o:return g;default:return $}}case t:return $}}}function F(g){return B(g)===l}return de.AsyncMode=c,de.ConcurrentMode=l,de.ContextConsumer=i,de.ContextProvider=o,de.Element=r,de.ForwardRef=h,de.Fragment=n,de.Lazy=w,de.Memo=v,de.Portal=t,de.Profiler=a,de.StrictMode=s,de.Suspense=m,de.isAsyncMode=function(g){return F(g)||B(g)===c},de.isConcurrentMode=F,de.isContextConsumer=function(g){return B(g)===i},de.isContextProvider=function(g){return B(g)===o},de.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===r},de.isForwardRef=function(g){return B(g)===h},de.isFragment=function(g){return B(g)===n},de.isLazy=function(g){return B(g)===w},de.isMemo=function(g){return B(g)===v},de.isPortal=function(g){return B(g)===t},de.isProfiler=function(g){return B(g)===a},de.isStrictMode=function(g){return B(g)===s},de.isSuspense=function(g){return B(g)===m},de.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===n||g===l||g===a||g===s||g===m||g===x||typeof g=="object"&&g!==null&&(g.$$typeof===w||g.$$typeof===v||g.$$typeof===o||g.$$typeof===i||g.$$typeof===h||g.$$typeof===N||g.$$typeof===S||g.$$typeof===A||g.$$typeof===D)},de.typeOf=B,de}var he={};/** @license React v16.13.1
39
39
  * react-is.development.js
40
40
  *
41
41
  * Copyright (c) Facebook, Inc. and its affiliates.
42
42
  *
43
43
  * This source code is licensed under the MIT license found in the
44
44
  * LICENSE file in the root directory of this source tree.
45
- */var Ys;function Hd(){return Ys||(Ys=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,r=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,i=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,b=e?Symbol.for("react.suspense"):60113,w=e?Symbol.for("react.suspense_list"):60120,x=e?Symbol.for("react.memo"):60115,P=e?Symbol.for("react.lazy"):60116,D=e?Symbol.for("react.block"):60121,k=e?Symbol.for("react.fundamental"):60117,E=e?Symbol.for("react.responder"):60118,L=e?Symbol.for("react.scope"):60119;function U(_){return typeof _=="string"||typeof _=="function"||_===n||_===l||_===a||_===s||_===b||_===w||typeof _=="object"&&_!==null&&(_.$$typeof===P||_.$$typeof===x||_.$$typeof===o||_.$$typeof===i||_.$$typeof===h||_.$$typeof===k||_.$$typeof===E||_.$$typeof===L||_.$$typeof===D)}function $(_){if(typeof _=="object"&&_!==null){var Ne=_.$$typeof;switch(Ne){case r:var qe=_.type;switch(qe){case c:case l:case n:case a:case s:case b:return qe;default:var Ae=qe&&qe.$$typeof;switch(Ae){case i:case h:case P:case x:case o:return Ae;default:return Ne}}case t:return Ne}}}var y=c,A=l,O=i,H=o,F=r,re=h,ee=n,q=P,S=x,T=t,B=a,Y=s,se=b,M=!1;function he(_){return M||(M=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),g(_)||$(_)===c}function g(_){return $(_)===l}function C(_){return $(_)===i}function z(_){return $(_)===o}function p(_){return typeof _=="object"&&_!==null&&_.$$typeof===r}function N(_){return $(_)===h}function V(_){return $(_)===n}function I(_){return $(_)===P}function R(_){return $(_)===x}function W(_){return $(_)===t}function Q(_){return $(_)===a}function Z(_){return $(_)===s}function Se(_){return $(_)===b}le.AsyncMode=y,le.ConcurrentMode=A,le.ContextConsumer=O,le.ContextProvider=H,le.Element=F,le.ForwardRef=re,le.Fragment=ee,le.Lazy=q,le.Memo=S,le.Portal=T,le.Profiler=B,le.StrictMode=Y,le.Suspense=se,le.isAsyncMode=he,le.isConcurrentMode=g,le.isContextConsumer=C,le.isContextProvider=z,le.isElement=p,le.isForwardRef=N,le.isFragment=V,le.isLazy=I,le.isMemo=R,le.isPortal=W,le.isProfiler=Q,le.isStrictMode=Z,le.isSuspense=Se,le.isValidElementType=U,le.typeOf=$}()),le}var Hs;function Ws(){return Hs||(Hs=1,process.env.NODE_ENV==="production"?rr.exports=Yd():rr.exports=Hd()),rr.exports}/*
45
+ */var Ks;function Xd(){return Ks||(Ks=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,r=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,i=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,x=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,w=e?Symbol.for("react.lazy"):60116,D=e?Symbol.for("react.block"):60121,N=e?Symbol.for("react.fundamental"):60117,S=e?Symbol.for("react.responder"):60118,A=e?Symbol.for("react.scope"):60119;function B(M){return typeof M=="string"||typeof M=="function"||M===n||M===l||M===a||M===s||M===m||M===x||typeof M=="object"&&M!==null&&(M.$$typeof===w||M.$$typeof===v||M.$$typeof===o||M.$$typeof===i||M.$$typeof===h||M.$$typeof===N||M.$$typeof===S||M.$$typeof===A||M.$$typeof===D)}function F(M){if(typeof M=="object"&&M!==null){var Ie=M.$$typeof;switch(Ie){case r:var Ke=M.type;switch(Ke){case c:case l:case n:case a:case s:case m:return Ke;default:var He=Ke&&Ke.$$typeof;switch(He){case i:case h:case w:case v:case o:return He;default:return Ie}}case t:return Ie}}}var g=c,$=l,_=i,W=o,Y=r,re=h,te=n,U=w,E=v,P=t,I=a,k=s,G=m,O=!1;function se(M){return O||(O=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),y(M)||F(M)===c}function y(M){return F(M)===l}function C(M){return F(M)===i}function V(M){return F(M)===o}function p(M){return typeof M=="object"&&M!==null&&M.$$typeof===r}function j(M){return F(M)===h}function q(M){return F(M)===n}function L(M){return F(M)===w}function H(M){return F(M)===v}function z(M){return F(M)===t}function X(M){return F(M)===a}function Q(M){return F(M)===s}function ke(M){return F(M)===m}he.AsyncMode=g,he.ConcurrentMode=$,he.ContextConsumer=_,he.ContextProvider=W,he.Element=Y,he.ForwardRef=re,he.Fragment=te,he.Lazy=U,he.Memo=E,he.Portal=P,he.Profiler=I,he.StrictMode=k,he.Suspense=G,he.isAsyncMode=se,he.isConcurrentMode=y,he.isContextConsumer=C,he.isContextProvider=V,he.isElement=p,he.isForwardRef=j,he.isFragment=q,he.isLazy=L,he.isMemo=H,he.isPortal=z,he.isProfiler=X,he.isStrictMode=Q,he.isSuspense=ke,he.isValidElementType=B,he.typeOf=F}()),he}var Xs;function Js(){return Xs||(Xs=1,process.env.NODE_ENV==="production"?ur.exports=Kd():ur.exports=Xd()),ur.exports}/*
46
46
  object-assign
47
47
  (c) Sindre Sorhus
48
48
  @license MIT
49
- */var zr,Vs;function Wd(){if(Vs)return zr;Vs=1;var e=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function n(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function s(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var o={},i=0;i<10;i++)o["_"+String.fromCharCode(i)]=i;var c=Object.getOwnPropertyNames(o).map(function(h){return o[h]});if(c.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(h){l[h]=h}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return zr=s()?Object.assign:function(a,o){for(var i,c=n(a),l,h=1;h<arguments.length;h++){i=Object(arguments[h]);for(var b in i)r.call(i,b)&&(c[b]=i[b]);if(e){l=e(i);for(var w=0;w<l.length;w++)t.call(i,l[w])&&(c[l[w]]=i[l[w]])}}return c},zr}var Gr,Bs;function Zr(){if(Bs)return Gr;Bs=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Gr=e,Gr}var Qr,Us;function qs(){return Us||(Us=1,Qr=Function.call.bind(Object.prototype.hasOwnProperty)),Qr}var Kr,zs;function Vd(){if(zs)return Kr;zs=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var r=Zr(),t={},n=qs();e=function(a){var o="Warning: "+a;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function s(a,o,i,c,l){if(process.env.NODE_ENV!=="production"){for(var h in a)if(n(a,h)){var b;try{if(typeof a[h]!="function"){var w=Error((c||"React class")+": "+i+" type `"+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[h]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw w.name="Invariant Violation",w}b=a[h](o,h,c,i,null,r)}catch(P){b=P}if(b&&!(b instanceof Error)&&e((c||"React class")+": type specification of "+i+" `"+h+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof b+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),b instanceof Error&&!(b.message in t)){t[b.message]=!0;var x=l?l():"";e("Failed "+i+" type: "+b.message+(x??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},Kr=s,Kr}var Xr,Gs;function Bd(){if(Gs)return Xr;Gs=1;var e=Ws(),r=Wd(),t=Zr(),n=qs(),s=Vd(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(i){var c="Warning: "+i;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function o(){return null}return Xr=function(i,c){var l=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function b(g){var C=g&&(l&&g[l]||g[h]);if(typeof C=="function")return C}var w="<<anonymous>>",x={array:E("array"),bigint:E("bigint"),bool:E("boolean"),func:E("function"),number:E("number"),object:E("object"),string:E("string"),symbol:E("symbol"),any:L(),arrayOf:U,element:$(),elementType:y(),instanceOf:A,node:re(),objectOf:H,oneOf:O,oneOfType:F,shape:q,exact:S};function P(g,C){return g===C?g!==0||1/g===1/C:g!==g&&C!==C}function D(g,C){this.message=g,this.data=C&&typeof C=="object"?C:{},this.stack=""}D.prototype=Error.prototype;function k(g){if(process.env.NODE_ENV!=="production")var C={},z=0;function p(V,I,R,W,Q,Z,Se){if(W=W||w,Z=Z||R,Se!==t){if(c){var _=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw _.name="Invariant Violation",_}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Ne=W+":"+R;!C[Ne]&&z<3&&(a("You are manually calling a React.PropTypes validation function for the `"+Z+"` prop on `"+W+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),C[Ne]=!0,z++)}}return I[R]==null?V?I[R]===null?new D("The "+Q+" `"+Z+"` is marked as required "+("in `"+W+"`, but its value is `null`.")):new D("The "+Q+" `"+Z+"` is marked as required in "+("`"+W+"`, but its value is `undefined`.")):null:g(I,R,W,Q,Z)}var N=p.bind(null,!1);return N.isRequired=p.bind(null,!0),N}function E(g){function C(z,p,N,V,I,R){var W=z[p],Q=Y(W);if(Q!==g){var Z=se(W);return new D("Invalid "+V+" `"+I+"` of type "+("`"+Z+"` supplied to `"+N+"`, expected ")+("`"+g+"`."),{expectedType:g})}return null}return k(C)}function L(){return k(o)}function U(g){function C(z,p,N,V,I){if(typeof g!="function")return new D("Property `"+I+"` of component `"+N+"` has invalid PropType notation inside arrayOf.");var R=z[p];if(!Array.isArray(R)){var W=Y(R);return new D("Invalid "+V+" `"+I+"` of type "+("`"+W+"` supplied to `"+N+"`, expected an array."))}for(var Q=0;Q<R.length;Q++){var Z=g(R,Q,N,V,I+"["+Q+"]",t);if(Z instanceof Error)return Z}return null}return k(C)}function $(){function g(C,z,p,N,V){var I=C[z];if(!i(I)){var R=Y(I);return new D("Invalid "+N+" `"+V+"` of type "+("`"+R+"` supplied to `"+p+"`, expected a single ReactElement."))}return null}return k(g)}function y(){function g(C,z,p,N,V){var I=C[z];if(!e.isValidElementType(I)){var R=Y(I);return new D("Invalid "+N+" `"+V+"` of type "+("`"+R+"` supplied to `"+p+"`, expected a single ReactElement type."))}return null}return k(g)}function A(g){function C(z,p,N,V,I){if(!(z[p]instanceof g)){var R=g.name||w,W=he(z[p]);return new D("Invalid "+V+" `"+I+"` of type "+("`"+W+"` supplied to `"+N+"`, expected ")+("instance of `"+R+"`."))}return null}return k(C)}function O(g){if(!Array.isArray(g))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),o;function C(z,p,N,V,I){for(var R=z[p],W=0;W<g.length;W++)if(P(R,g[W]))return null;var Q=JSON.stringify(g,function(Se,_){var Ne=se(_);return Ne==="symbol"?String(_):_});return new D("Invalid "+V+" `"+I+"` of value `"+String(R)+"` "+("supplied to `"+N+"`, expected one of "+Q+"."))}return k(C)}function H(g){function C(z,p,N,V,I){if(typeof g!="function")return new D("Property `"+I+"` of component `"+N+"` has invalid PropType notation inside objectOf.");var R=z[p],W=Y(R);if(W!=="object")return new D("Invalid "+V+" `"+I+"` of type "+("`"+W+"` supplied to `"+N+"`, expected an object."));for(var Q in R)if(n(R,Q)){var Z=g(R,Q,N,V,I+"."+Q,t);if(Z instanceof Error)return Z}return null}return k(C)}function F(g){if(!Array.isArray(g))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var C=0;C<g.length;C++){var z=g[C];if(typeof z!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+M(z)+" at index "+C+"."),o}function p(N,V,I,R,W){for(var Q=[],Z=0;Z<g.length;Z++){var Se=g[Z],_=Se(N,V,I,R,W,t);if(_==null)return null;_.data&&n(_.data,"expectedType")&&Q.push(_.data.expectedType)}var Ne=Q.length>0?", expected one of type ["+Q.join(", ")+"]":"";return new D("Invalid "+R+" `"+W+"` supplied to "+("`"+I+"`"+Ne+"."))}return k(p)}function re(){function g(C,z,p,N,V){return T(C[z])?null:new D("Invalid "+N+" `"+V+"` supplied to "+("`"+p+"`, expected a ReactNode."))}return k(g)}function ee(g,C,z,p,N){return new D((g||"React class")+": "+C+" type `"+z+"."+p+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+N+"`.")}function q(g){function C(z,p,N,V,I){var R=z[p],W=Y(R);if(W!=="object")return new D("Invalid "+V+" `"+I+"` of type `"+W+"` "+("supplied to `"+N+"`, expected `object`."));for(var Q in g){var Z=g[Q];if(typeof Z!="function")return ee(N,V,I,Q,se(Z));var Se=Z(R,Q,N,V,I+"."+Q,t);if(Se)return Se}return null}return k(C)}function S(g){function C(z,p,N,V,I){var R=z[p],W=Y(R);if(W!=="object")return new D("Invalid "+V+" `"+I+"` of type `"+W+"` "+("supplied to `"+N+"`, expected `object`."));var Q=r({},z[p],g);for(var Z in Q){var Se=g[Z];if(n(g,Z)&&typeof Se!="function")return ee(N,V,I,Z,se(Se));if(!Se)return new D("Invalid "+V+" `"+I+"` key `"+Z+"` supplied to `"+N+"`.\nBad object: "+JSON.stringify(z[p],null," ")+`
50
- Valid keys: `+JSON.stringify(Object.keys(g),null," "));var _=Se(R,Z,N,V,I+"."+Z,t);if(_)return _}return null}return k(C)}function T(g){switch(typeof g){case"number":case"string":case"undefined":return!0;case"boolean":return!g;case"object":if(Array.isArray(g))return g.every(T);if(g===null||i(g))return!0;var C=b(g);if(C){var z=C.call(g),p;if(C!==g.entries){for(;!(p=z.next()).done;)if(!T(p.value))return!1}else for(;!(p=z.next()).done;){var N=p.value;if(N&&!T(N[1]))return!1}}else return!1;return!0;default:return!1}}function B(g,C){return g==="symbol"?!0:C?C["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&C instanceof Symbol:!1}function Y(g){var C=typeof g;return Array.isArray(g)?"array":g instanceof RegExp?"object":B(C,g)?"symbol":C}function se(g){if(typeof g>"u"||g===null)return""+g;var C=Y(g);if(C==="object"){if(g instanceof Date)return"date";if(g instanceof RegExp)return"regexp"}return C}function M(g){var C=se(g);switch(C){case"array":case"object":return"an "+C;case"boolean":case"date":case"regexp":return"a "+C;default:return C}}function he(g){return!g.constructor||!g.constructor.name?w:g.constructor.name}return x.checkPropTypes=s,x.resetWarningCache=s.resetWarningCache,x.PropTypes=x,x},Xr}var Jr,Zs;function Ud(){if(Zs)return Jr;Zs=1;var e=Zr();function r(){}function t(){}return t.resetWarningCache=r,Jr=function(){function n(o,i,c,l,h,b){if(b!==e){var w=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw w.name="Invariant Violation",w}}n.isRequired=n;function s(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:s,element:n,elementType:n,instanceOf:s,node:n,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:t,resetWarningCache:r};return a.PropTypes=a,a},Jr}if(process.env.NODE_ENV!=="production"){var qd=Ws(),zd=!0;qr.exports=Bd()(qd.isElement,zd)}else qr.exports=Ud()();var Gd=qr.exports;const te=cn(Gd),Qs={disabled:!1};var Zd=process.env.NODE_ENV!=="production"?te.oneOfType([te.number,te.shape({enter:te.number,exit:te.number,appear:te.number}).isRequired]):null;process.env.NODE_ENV!=="production"&&te.oneOfType([te.string,te.shape({enter:te.string,exit:te.string,active:te.string}),te.shape({enter:te.string,enterDone:te.string,enterActive:te.string,exit:te.string,exitDone:te.string,exitActive:te.string})]);const Ks=d.createContext(null);var Qd=function(r){return r.scrollTop},Lt="unmounted",at="exited",ot="entering",bt="entered",en="exiting",Ue=function(e){Fd(r,e);function r(n,s){var a;a=e.call(this,n,s)||this;var o=s,i=o&&!o.isMounting?n.enter:n.appear,c;return a.appearStatus=null,n.in?i?(c=at,a.appearStatus=ot):c=bt:n.unmountOnExit||n.mountOnEnter?c=Lt:c=at,a.state={status:c},a.nextCallback=null,a}r.getDerivedStateFromProps=function(s,a){var o=s.in;return o&&a.status===Lt?{status:at}:null};var t=r.prototype;return t.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},t.componentDidUpdate=function(s){var a=null;if(s!==this.props){var o=this.state.status;this.props.in?o!==ot&&o!==bt&&(a=ot):(o===ot||o===bt)&&(a=en)}this.updateStatus(!1,a)},t.componentWillUnmount=function(){this.cancelNextCallback()},t.getTimeouts=function(){var s=this.props.timeout,a,o,i;return a=o=i=s,s!=null&&typeof s!="number"&&(a=s.exit,o=s.enter,i=s.appear!==void 0?s.appear:o),{exit:a,enter:o,appear:i}},t.updateStatus=function(s,a){if(s===void 0&&(s=!1),a!==null)if(this.cancelNextCallback(),a===ot){if(this.props.unmountOnExit||this.props.mountOnEnter){var o=this.props.nodeRef?this.props.nodeRef.current:Re.findDOMNode(this);o&&Qd(o)}this.performEnter(s)}else this.performExit();else this.props.unmountOnExit&&this.state.status===at&&this.setState({status:Lt})},t.performEnter=function(s){var a=this,o=this.props.enter,i=this.context?this.context.isMounting:s,c=this.props.nodeRef?[i]:[Re.findDOMNode(this),i],l=c[0],h=c[1],b=this.getTimeouts(),w=i?b.appear:b.enter;if(!s&&!o||Qs.disabled){this.safeSetState({status:bt},function(){a.props.onEntered(l)});return}this.props.onEnter(l,h),this.safeSetState({status:ot},function(){a.props.onEntering(l,h),a.onTransitionEnd(w,function(){a.safeSetState({status:bt},function(){a.props.onEntered(l,h)})})})},t.performExit=function(){var s=this,a=this.props.exit,o=this.getTimeouts(),i=this.props.nodeRef?void 0:Re.findDOMNode(this);if(!a||Qs.disabled){this.safeSetState({status:at},function(){s.props.onExited(i)});return}this.props.onExit(i),this.safeSetState({status:en},function(){s.props.onExiting(i),s.onTransitionEnd(o.exit,function(){s.safeSetState({status:at},function(){s.props.onExited(i)})})})},t.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},t.safeSetState=function(s,a){a=this.setNextCallback(a),this.setState(s,a)},t.setNextCallback=function(s){var a=this,o=!0;return this.nextCallback=function(i){o&&(o=!1,a.nextCallback=null,s(i))},this.nextCallback.cancel=function(){o=!1},this.nextCallback},t.onTransitionEnd=function(s,a){this.setNextCallback(a);var o=this.props.nodeRef?this.props.nodeRef.current:Re.findDOMNode(this),i=s==null&&!this.props.addEndListener;if(!o||i){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[o,this.nextCallback],l=c[0],h=c[1];this.props.addEndListener(l,h)}s!=null&&setTimeout(this.nextCallback,s)},t.render=function(){var s=this.state.status;if(s===Lt)return null;var a=this.props,o=a.children;a.in,a.mountOnEnter,a.unmountOnExit,a.appear,a.enter,a.exit,a.timeout,a.addEndListener,a.onEnter,a.onEntering,a.onEntered,a.onExit,a.onExiting,a.onExited,a.nodeRef;var i=$d(a,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return d.createElement(Ks.Provider,{value:null},typeof o=="function"?o(s,i):d.cloneElement(d.Children.only(o),i))},r}(d.Component);Ue.contextType=Ks,Ue.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:te.shape({current:typeof Element>"u"?te.any:function(e,r,t,n,s,a){var o=e[r];return te.instanceOf(o&&"ownerDocument"in o?o.ownerDocument.defaultView.Element:Element)(e,r,t,n,s,a)}}),children:te.oneOfType([te.func.isRequired,te.element.isRequired]).isRequired,in:te.bool,mountOnEnter:te.bool,unmountOnExit:te.bool,appear:te.bool,enter:te.bool,exit:te.bool,timeout:function(r){var t=Zd;r.addEndListener||(t=t.isRequired);for(var n=arguments.length,s=new Array(n>1?n-1:0),a=1;a<n;a++)s[a-1]=arguments[a];return t.apply(void 0,[r].concat(s))},addEndListener:te.func,onEnter:te.func,onEntering:te.func,onEntered:te.func,onExit:te.func,onExiting:te.func,onExited:te.func}:{};function gt(){}Ue.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:gt,onEntering:gt,onEntered:gt,onExit:gt,onExiting:gt,onExited:gt},Ue.UNMOUNTED=Lt,Ue.EXITED=at,Ue.ENTERING=ot,Ue.ENTERED=bt,Ue.EXITING=en;const Kd=Ue,Xs=({start:e,timeout:r=400,defaultStyle:t,transitionStyles:n,showTransitionOptions:s="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:a="linear",unmountOnExit:o=!1,onEntering:i,onEntered:c,onExit:l,onExited:h,children:b})=>{const w=t||{transition:`opacity ${r}ms ${s}`,opacity:0},x=n||{entering:{opacity:1},entered:{opacity:1},exiting:{transition:`opacity ${r}ms ${a}`,opacity:0},exited:{transition:`opacity ${r}ms ${a}`,opacity:0},unmounted:{}};return f.jsx(Kd,{in:e,timeout:r,onEntering:i,onEntered:c,onExit:l,onExited:h,unmountOnExit:o,children:P=>b({state:P,defaultStyle:w,transitionStyles:x})})};function Js(e){return e.target?e.target:e}const ea=({visible:e,target:r,appendTo:t=document.body,unmountWhenHidden:n=!1,transitionDuration:s=400,showTransitionOptions:a="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:o="linear",approveText:i="DONE",shown:c,hidden:l,isClickedWithin:h,children:b})=>{const[w,x]=d.useState(-1),[P,D]=d.useState(-1),[k,E]=d.useState(e),L=d.useRef(100),U=d.useRef(101),$=d.useRef(),y=d.useRef(),A=d.useRef();d.useEffect(()=>{r&&($.current=Js(r));const S=Ms("zIndex",T=>T==="auto"||T==="-1"?!1:parseInt(T)>100).map(T=>parseInt(T,10));S.length>0&&(L.current=Math.max(...S)+1,U.current=Math.max(...S)+2),E(e)},[e,r]);const O=S=>{y.current=S},H=()=>{D(L.current),x(U.current)},F=()=>{if(!y.current)return;c==null||c();let S;$.current&&(S=[$.current]);const T=B=>{B?h==null||h():E(!1)};A.current=As(y.current,T,S)},re=()=>{A.current&&$s(A.current)},ee=()=>{D(-1),x(-1),l==null||l()},q={entering:{opacity:.5},entered:{opacity:.5}};return Re.createPortal(f.jsx(Xs,{start:k,timeout:s,showTransitionOptions:a,hideTransitionOptions:o,onEntering:H,onEntered:F,onExit:re,onExited:ee,unmountOnExit:n,children:({state:S,defaultStyle:T,transitionStyles:B})=>f.jsxs("div",{ref:Y=>Y&&O(Y),children:[f.jsx("div",{className:"bsc-fixed bsc-left-0 bsc-top-0 bsc-h-full bsc-w-full bsc-bg-mono-dark-1",style:{zIndex:P,...B[S],...q[S]}}),f.jsxs("div",{className:"dark:bsck-border-mono-light-1 bsc-fixed bsc-bottom-0 bsc-left-0 bsc-w-full bsc-bg-white dark:bsc-border-t dark:bsc-border-solid dark:bsc-bg-mono-dark-1 dark:bsc-text-mono-light-1",style:{zIndex:w,...T,...B[S]},children:[f.jsx("div",{className:"bsc-w-full",children:b}),f.jsx(f.Fragment,{children:f.jsx($e,{buttonType:"primary",fullWidth:!0,onClick:()=>E(!1),className:"bsc-text-xs bsc-font-bold",children:i})})]})]})}),t)};var ta=(e=>(e[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e))(ta||{}),ra=(e=>(e[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e))(ra||{});class ye{static positionToTarget(r,t=2){const n=r.getBoundingClientRect();let s=0,a=0;const o=window.scrollY;switch(t){case 2:s=n.top+n.height+o,a=n.left;break;case 0:s=n.top+o,a=n.left;break;case 3:s=n.top+n.height+o,a=n.left+n.width;break;case 1:s=n.top+o,a=n.left+n.width}return{top:s,left:a}}static positionElementToTarget(r,t,n=0,s=2){let{left:a,top:o}=ye.positionToTarget(t,s);const i=r.getBoundingClientRect();switch(n){case 0:break;case 1:a=a-i.width;break;case 2:o=o-i.height;break;case 3:o=o-i.height,a=a-i.width;break}return{top:o,left:a}}static canPositionElementOnScreenWithTarget(r,t){const n=ye.getScreenDimensions(),s=r.getBoundingClientRect(),a=ye.positionElementToTarget(r,t,0,2);if(a.left+s.width<n.width&&a.top+s.height<n.height||ye.positionElementToTarget(r,t,1,3).left>=0&&a.top+s.height<n.height)return!0;const i=ye.positionElementToTarget(r,t,2,0);if(i.left+s.width<n.width&&i.top>=0)return!0;const c=ye.positionElementToTarget(r,t,3,1);return c.left>=0&&c.top>=0}static canPositionElementOnScreen(r){const t=ye.getScreenDimensions(),n=r.getBoundingClientRect();return n.width<=t.width&&n.height<=t.height}static positionElementToTargetOnScreen(r,t,n=0,s=2){const{left:a,top:o}=ye.positionElementToTarget(r,t,n,s),i=r.getBoundingClientRect(),c=ye.determineOffScreenLocation(i);if(c){if(n===0&&s===2){if(c.right&&!c.bottom)return ye.positionElementToTarget(r,t,1,3);if(c.bottom&&!c.right)return ye.positionElementToTarget(r,t,2,0);if(c.right&&c.bottom)return ye.positionElementToTarget(r,t,3,1)}else if(n===1&&s===3){if(c.left&&!c.bottom)return ye.positionElementToTarget(r,t,0,2);if(c.bottom&&!c.left)return ye.positionElementToTarget(r,t,3,1);if(c.left&&c.bottom)return ye.positionElementToTarget(r,t,2,0)}}return{top:o,left:a}}static determineOffScreenLocation(r){const t=ye.getScreenDimensions(),n={left:r.left<0,top:r.top<0,right:r.left+r.width>t.width,bottom:r.top+r.height>t.height};return n.left||n.top||n.right||n.bottom?n:void 0}static getScreenDimensions(){return{width:window.innerWidth,height:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}}}const na=({visible:e,target:r,targetPosition:t=ta.BottomLeft,elementAlignment:n=ra.TopLeft,shouldTargetCloseOverlay:s=!0,shouldMatchTargetWidth:a=!1,shouldScrollCloseOverlay:o=!1,shouldCheckZIndex:i=!1,shouldRemainOnScreen:c=!1,unmountWhenHidden:l=!1,transitionDuration:h=400,showTransitionOptions:b="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:w="linear",shown:x,hidden:P,isClickedWithin:D,markupCreated:k,children:E})=>{const[L,U]=d.useState(-1),[$,y]=d.useState(e),[A,O]=d.useState(!1),H=d.useRef(!1),F=d.useRef(100),re=d.useRef({left:0,top:0,width:0}),ee=d.useRef(),q=d.useRef(),S=d.useRef(),T=d.useRef(),B=d.useRef(),Y=d.useRef(),se=dn();d.useEffect(()=>(c===!0&&(Y.current=new ResizeObserver(M)),()=>{var I,R;c===!0&&(q.current&&((I=Y.current)==null||I.unobserve(q.current)),(R=Y.current)==null||R.disconnect())}),[]),d.useEffect(()=>{if(r&&(ee.current=Js(r),o)){const I=se==null?void 0:se.isValidScrollableElement;S.current=Is(ee.current,{overflow:"scroll, auto",overflowX:"scroll, auto",overflowY:"scroll, auto"},!1,I),S.current.tagName.toLowerCase()==="html"&&(S.current=document)}if(i){const I=Ms("zIndex",R=>parseInt(R)>=100).map(R=>parseInt(R));I.length>0&&(F.current=Math.max(...I)+1)}e!==void 0&&y(e)},[r,e,o,i]);const M=I=>{if(q.current){const R=ye.getScreenDimensions(),W=I[I.length-1].target,Q=W.getBoundingClientRect(),Z=ye.determineOffScreenLocation(Q);if(Z){if(ee.current&&ye.canPositionElementOnScreenWithTarget(W,ee.current)){const Se=ye.positionElementToTargetOnScreen(q.current,ee.current,n,t);re.current={...re.current,...Se}}else Z.right?re.current.left=R.width-Q.width:Z.left&&(re.current.left=0),Z.bottom?re.current.top=R.height-Q.height:Z.top&&(re.current.top=0);he()}}},he=_t(()=>{H.current=!H.current,O(H.current)},20),g=()=>{U(F.current)},C=()=>{if(!q.current)return;x==null||x();let I;!s&&ee.current&&(I=[ee.current]);const R=W=>{W?D==null||D():y(!1)};T.current=As(q.current,R,I),o&&(B.current=al(W=>q.current&&Td(W,q.current)&&y(!1),100,{leading:!0}),S.current&&S.current.addEventListener("scroll",B.current))},z=()=>{S.current&&B.current&&(S.current.removeEventListener("scroll",B.current),B.current=void 0),T.current&&$s(T.current)},p=()=>{U(-1),P==null||P()},N=I=>{var R,W;if(c===!0&&q.current&&((R=Y.current)==null||R.unobserve(q.current)),q.current=I,k==null||k(I),ee.current){const Q=ye.positionElementToTarget(q.current,ee.current,n,t);re.current={...Q,width:ee.current.offsetWidth},c===!0&&(ye.canPositionElementOnScreenWithTarget(q.current,ee.current)||ye.canPositionElementOnScreen(q.current))&&((W=Y.current)==null||W.observe(q.current))}},V=d.useMemo(()=>{const I={top:`${re.current.top}px`,left:`${re.current.left}px`,zIndex:L};return a&&(I.width=`${re.current.width}px`),I},[A,L,a]);return f.jsx(Xs,{start:$,timeout:h,showTransitionOptions:b,hideTransitionOptions:w,onEntering:g,onEntered:C,onExit:z,onExited:p,unmountOnExit:l,children:({state:I,defaultStyle:R,transitionStyles:W})=>f.jsx("div",{className:"bsc-fixed bsc-border bsc-border-solid bsc-bg-white bsc-shadow dark:bsc-border-mono-light-1 dark:bsc-bg-mono-dark-1 dark:bsc-text-mono-light-1",style:{...V,...R,...W[I]},ref:Q=>Q&&N(Q),children:E})})};let nr;const Xd=new Uint8Array(16);function Jd(){if(!nr&&(nr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!nr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return nr(Xd)}const ke=[];for(let e=0;e<256;++e)ke.push((e+256).toString(16).slice(1));function eh(e,r=0){return ke[e[r+0]]+ke[e[r+1]]+ke[e[r+2]]+ke[e[r+3]]+"-"+ke[e[r+4]]+ke[e[r+5]]+"-"+ke[e[r+6]]+ke[e[r+7]]+"-"+ke[e[r+8]]+ke[e[r+9]]+"-"+ke[e[r+10]]+ke[e[r+11]]+ke[e[r+12]]+ke[e[r+13]]+ke[e[r+14]]+ke[e[r+15]]}const sa={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function th(e,r,t){if(sa.randomUUID&&!r&&!e)return sa.randomUUID();e=e||{};const n=e.random||(e.rng||Jd)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,r){t=t||0;for(let s=0;s<16;++s)r[t+s]=n[s];return r}return eh(n)}class sr{static create(r){const t=[];let n=0;for(let s=0,a=r.formatParts.length;s<a;s++){const o=r.formatParts[s],i=n,c=i+o.characterCount;t.push({startPosition:i,endPosition:c,...o}),n=c}return t}}class rh{constructor(r,t){m(this,"instanceCollection");m(this,"formatPartList");m(this,"inputSlotCollection");m(this,"currentPartIndex",0);m(this,"currentCursorPosition",0);m(this,"inputElement");m(this,"inputSelection",null);m(this,"inputRange");m(this,"textNode");this.instanceCollection=yt.getInstance(),this.formatPartList=sr.create(r),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(t,r)}getCursorPosition(){return this.currentCursorPosition}getCurrentPartIndex(){return this.currentPartIndex}setInputElement(r){this.inputElement=r}setCursorToCurrentPosition(){this.setCursorSelection(this.currentCursorPosition)}setCursorPosition(r){this.setCursorSelection(r)}setCursorSelection(r,t){this.createInputRangeSelection(),this.inputRange&&this.textNode&&(this.inputRange.setStart(this.textNode,r),this.inputRange.setEnd(this.textNode,t||r),this.currentCursorPosition=t||r,this.setPartIndexByCursorPosition())}findCursorPosition(){var t,n;const r=(t=window.getSelection())==null?void 0:t.getRangeAt(0);if(this.inputElement&&r){const s=document.createTreeWalker(this.inputElement,NodeFilter.SHOW_TEXT,c=>{const l=document.createRange();return l.selectNodeContents(c),l.compareBoundaryPoints(Range.END_TO_END,r)<1?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT});let a=0;for(;s.nextNode();)a+=((n=s.currentNode.textContent)==null?void 0:n.length)||0;r.startContainer.nodeType===Node.TEXT_NODE&&(a+=r.startOffset);const o=this.inputSlotCollection.getLastSlotWithData(),i=o.startPosition+o.partText.length;this.setCursorSelection(a>i?i:a)}}isAtLastPart(){return this.currentPartIndex===this.formatPartList.length-1}moveHome(){const r=this.inputSlotCollection.getFirstSlot();this.setCursorSelection(r.startPosition)}moveEnd(){const r=this.inputSlotCollection.getLastSlotWithData(),t=r.startPosition+r.partText.length;this.setCursorSelection(t)}moveCursorLeft(){if(this.currentCursorPosition>0){const r=this.currentCursorPosition-1;let t=this.formatPartList[this.currentPartIndex];if(r>=t.startPosition&&r<=t.endPosition)this.setCursorSelection(r);else for(let n=this.currentPartIndex-1;n>=0;n--)t=this.formatPartList[n],r>=t.startPosition&&r<=t.endPosition&&(t.isSeparator?this.setCursorSelection(this.formatPartList[n-1].endPosition):this.setCursorSelection(r))}}moveCursorRight(){const r=this.inputSlotCollection.getLastSlotWithData(),t=r.startPosition+r.partText.length;if(this.currentCursorPosition<t){const n=this.currentCursorPosition+1;let s=this.formatPartList[this.currentPartIndex];if(n>=s.startPosition&&n<=s.endPosition)this.setCursorSelection(n);else for(let a=this.currentPartIndex+1,o=this.formatPartList.length;a<o;a++)s=this.formatPartList[a],n>=s.startPosition&&n<=s.endPosition&&(s.isSeparator?this.setCursorSelection(this.formatPartList[a+1].startPosition):this.setCursorSelection(n))}}moveToNextInputPart(){if(this.currentPartIndex<this.formatPartList.length-1){const r=this.findNextEditablePart();r&&(this.currentPartIndex=r.partIndex,this.setCursorSelection(r.startPosition))}}moveToPreviousInputPart(){if(this.currentPartIndex>0){const r=this.findPreviousEditablePart();r&&(this.currentPartIndex=r.partIndex,this.setCursorSelection(r.endPosition))}}findNextEditablePart(){return this.inputSlotCollection.getNextSlot(this.currentPartIndex)}findPreviousEditablePart(){return this.inputSlotCollection.getPreviousSlot(this.currentPartIndex)}setPartIndexByCursorPosition(){for(let r=0;r<this.formatPartList.length;r++){const t=this.formatPartList[r];if(this.currentCursorPosition>=t.startPosition&&this.currentCursorPosition<=t.endPosition){if(t.isSeparator){this.currentCursorPosition=this.formatPartList[r+1].startPosition,this.currentPartIndex=r+1;break}this.currentPartIndex=r;break}}}createInputRangeSelection(){var r,t;this.inputElement&&(this.inputSelection=window.getSelection(),this.inputRange=document.createRange(),(r=this.inputSelection)==null||r.removeAllRanges(),this.inputRange.selectNodeContents(this.inputElement),this.inputRange.collapse(!0),(t=this.inputSelection)==null||t.addRange(this.inputRange),this.inputElement.firstChild&&(this.textNode=this.inputElement.firstChild))}}class nh{static create(r){const t=[];for(let n=0,s=r.length;n<s;n++){const a=r[n];a.isSeparator||t.push({partIndex:n,partText:"",isComplete:!1,...a})}return t}}class sh{constructor(r){m(this,"inputSlots");this.inputSlots=nh.create(sr.create(r))}clearAllSlots(){for(let r=0,t=this.inputSlots.length;r<t;r++)this.inputSlots[r].partText=""}getSlot(r){return this.inputSlots.find(t=>t.partIndex===r)}getFirstSlot(){return this.inputSlots[0]}getNextSlot(r){const t=this.inputSlots.findIndex(n=>n.partIndex===r);if(t>-1&&t+1<this.inputSlots.length)return this.inputSlots[t+1]}getPreviousSlot(r){const t=this.inputSlots.findIndex(n=>n.partIndex===r);if(t>-1&&t-1>=0)return this.inputSlots[t-1]}getLastSlotWithData(){const r=this.inputSlots.findIndex(n=>!n.isComplete);let t=r;for(let n=r+1,s=this.inputSlots.length;n<s;n++)this.inputSlots[n].partText.length>0&&(t=n);return this.inputSlots[t>-1?t:0]}allSlotsCompleted(){return this.inputSlots.every(r=>r.isComplete)}allSlotsEmpty(){return this.inputSlots.every(r=>r.partText.length===0)}}class yt{static getInstance(){return this.instance||(this.instance=new ah),this.instance}}m(yt,"instance");class ah{constructor(){m(this,"navigatorInstances");m(this,"inputSlotInstances");this.navigatorInstances={},this.inputSlotInstances={}}getNavigatorInstance(r,t){return this.navigatorInstances[r]||(this.navigatorInstances[r]=new rh(t,r)),this.navigatorInstances[r]}getInputSlotInstance(r,t){return this.inputSlotInstances[r]||(this.inputSlotInstances[r]=new sh(t)),this.inputSlotInstances[r]}removeInstances(r){this.navigatorInstances[r]&&delete this.navigatorInstances[r],this.inputSlotInstances[r]&&delete this.inputSlotInstances[r]}}class tn{constructor(r,t){m(this,"instanceCollection");m(this,"formatPartList");m(this,"inputSlotCollection");m(this,"inputElement");this.instanceCollection=yt.getInstance(),this.formatPartList=sr.create(r),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(t,r)}setInputElement(r){this.inputElement=r}render(){var t;let r="";for(let n=0,s=this.formatPartList.length;n<s;n++){const a=this.formatPartList[n];if(a.isSeparator)r+=a.inputText;else{const o=this.inputSlotCollection.getSlot(n);o&&(r+=o.partText+((t=o.inputText)==null?void 0:t.repeat(o.characterCount-o.partText.length)))}}this.inputElement&&(this.inputElement.innerHTML=r)}}var We=(e=>(e[e.Text=0]="Text",e[e.Numeric=1]="Numeric",e))(We||{});class aa{constructor(){m(this,"numberKeys",["0","1","2","3","4","5","6","7","8","9"]);m(this,"movementKeys",["ArrowLeft","ArrowRight","Home","End"]);m(this,"editingKeys",["Backspace","Delete"]);m(this,"ignoreKeys",["Shift","Alt","Control","Fn","Meta"])}isNumberKey(r){return this.numberKeys.includes(r)}isMovementKey(r){return this.movementKeys.includes(r.key)}isEditingKey(r){return this.editingKeys.includes(r.key)}isIgnoreKey(r){return this.ignoreKeys.includes(r.key)}}class oh{constructor(r){m(this,"_currentIndex",0);m(this,"index",0);m(this,"formatParts");this.formatParts=sr.create(r)}get currentIndex(){return this._currentIndex}hasNext(){return this.index<this.formatParts.length}next(){if(this.index<this.formatParts.length)return this._currentIndex=this.index++,this.formatParts[this._currentIndex]}peek(){if(this.index<this.formatParts.length)return this.formatParts[this.index]}reset(){this.index=0}}class oa{constructor(r,t){m(this,"instanceCollection");m(this,"inputSlotCollection");m(this,"formatNavigator");m(this,"keyTypeChecker");m(this,"formatRenderer");m(this,"formatPartList");this.format=r,this.instanceCollection=yt.getInstance(),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(t,r),this.formatNavigator=this.instanceCollection.getNavigatorInstance(t,r),this.keyTypeChecker=new aa,this.formatRenderer=new tn(r,t),this.formatPartList=new oh(r)}setInputElement(r){this.formatRenderer.setInputElement(r)}processKeyPress(r){if(this.keyTypeChecker.isEditingKey(r)){this.processEditRules(r);return}this.processInputRules(r)}processInputValue(r){var n;this.inputSlotCollection.clearAllSlots(),this.formatPartList.reset();let t=0;for(;this.formatPartList.hasNext();){const s=this.formatPartList.next();if(s&&!s.isSeparator)if(((n=this.formatPartList.peek())==null?void 0:n.isSeparator)===!0){const a=this.formatPartList.currentIndex,o=this.formatPartList.next();if(o&&o.inputText){const i=r.indexOf(o.inputText,t),c=this.inputSlotCollection.getSlot(a);if(c&&i>-1){const l=i-t>c.characterCount?t+c.characterCount:i;c.partText=r.substring(t,l),this.processSlotRules(c),t=i+o.characterCount}}}else{const a=this.inputSlotCollection.getSlot(this.formatPartList.currentIndex);a&&(a.partText=r.substring(t,t+a.characterCount),this.processSlotRules(a))}}}processEditRules(r){const t=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());if(!t)return;const n=this.formatNavigator.getCursorPosition(),s=n-t.startPosition,a=this.format.deleteShiftsFormatPart||!1;switch(r.key){case"Backspace":{if(!(t.startPosition===n))t.partText=t.partText.substring(0,s-1)+t.partText.substring(s),a&&this.shiftFormatParts(t),this.formatRenderer.render(),this.formatNavigator.moveCursorLeft(),this.processSlotRules(t,!0);else{this.processSlotRules(t,!0);const i=this.inputSlotCollection.getPreviousSlot(t.partIndex);i&&(i.partText=i.partText.substring(0,i.partText.length-1),a&&this.shiftFormatParts(i),this.formatRenderer.render(),this.formatNavigator.setCursorPosition(i.startPosition+i.partText.length),this.processSlotRules(i,!0))}break}case"Delete":t.partText=t.partText.substring(0,s)+t.partText.substring(s+1),a&&this.shiftFormatParts(t),this.formatRenderer.render(),this.formatNavigator.setCursorToCurrentPosition(),this.processSlotRules(t,!0);break}}shiftFormatParts(r){let t=r,n;for(;(n=this.inputSlotCollection.getNextSlot(t.partIndex))!==void 0;){const s=n.partText.substring(0,1);n.partText=n.partText.substring(1),t.partText=t.partText+s,t=n}}processInputRules(r){const t=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());if(!t)return;const{key:n}=r,s=t.characterCount,a=t.partText;if(t.valueType===We.Numeric){if(!this.keyTypeChecker.isNumberKey(n))return;const o=t.maximumValue,i=t.exceedingMaximumValueCausesTab||!1,c=t.padWithZeros||!1,l=parseInt(this.createNewValue(t,n));if(o&&l>o)if(i){c&&(t.partText=t.partText.padStart(s,"0")),t.isComplete=!0;const h=this.inputSlotCollection.getNextSlot(t.partIndex);h&&!h.isComplete&&(h.partText=n),this.formatRenderer.render(),h&&this.formatNavigator.setCursorPosition(h.isComplete?h.startPosition:h.startPosition+1)}else return;else a.length+1===s?(this.addToInputSlot(n),t.isComplete=!0,this.formatRenderer.render(),this.formatNavigator.isAtLastPart()?this.formatNavigator.moveCursorRight():this.formatNavigator.moveToNextInputPart()):a.length+1<s&&(this.addToInputSlot(n),this.formatRenderer.render(),this.formatNavigator.moveCursorRight())}else a.length+1===s?(this.addToInputSlot(n),t.isComplete=!0,this.formatRenderer.render(),this.formatNavigator.isAtLastPart()?this.formatNavigator.moveCursorRight():this.formatNavigator.moveToNextInputPart()):(this.addToInputSlot(n),this.formatRenderer.render(),this.formatNavigator.moveCursorRight())}addToInputSlot(r){const t=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());t&&(t.partText=this.createNewValue(t,r))}createNewValue(r,t){const n=r.partText,s=this.formatNavigator.getCursorPosition();if(s>=r.startPosition+r.partText.length)return n+t;{const a=s-r.startPosition;return n.substring(0,a)+t+n.substring(a)}}processSlotRules(r,t=!1){const n=r.characterCount,s=r.allCharactersRequired||!1;if(r.valueType===We.Numeric){const a=r.minimumValue,o=r.maximumValue;if(s)r.isComplete=r.partText.length===n;else if(a!==void 0&&o!==void 0){const i=r.padWithZeros||!1,c=parseInt(r.partText);r.isComplete=c>=a&&c<=o,r.isComplete&&i&&!t&&(r.partText=r.partText.padStart(n,"0"))}else r.isComplete=r.partText.length>0}else s?r.isComplete=r.partText.length===n:r.isComplete=r.partText.length>0}}class ih{constructor(r,t){m(this,"instanceCollection");m(this,"formatNavigator");m(this,"ruleProcessor");m(this,"keyTypeChecker");m(this,"formatRenderer");this.format=r,this.instanceCollection=yt.getInstance(),this.formatNavigator=this.instanceCollection.getNavigatorInstance(t,r),this.ruleProcessor=new oa(r,t),this.keyTypeChecker=new aa,this.formatRenderer=new tn(r,t)}setInputElement(r){this.ruleProcessor.setInputElement(r),this.formatRenderer.setInputElement(r)}processMovementKey(r){const{key:t,metaKey:n}=r;switch(t){case"ArrowLeft":n?this.formatNavigator.moveHome():this.formatNavigator.moveCursorLeft();break;case"ArrowRight":n?this.formatNavigator.moveEnd():this.formatNavigator.moveCursorRight();break;case"Home":this.formatNavigator.moveHome();break;case"End":this.formatNavigator.moveEnd();break}}processKeyPress(r){return this.keyTypeChecker.isIgnoreKey(r)?!1:this.keyTypeChecker.isMovementKey(r)?(this.processMovementKey(r),!1):(this.ruleProcessor.processKeyPress(r),!0)}}class ch{constructor(r,t=""){m(this,"instanceId");m(this,"instanceCollection");m(this,"keyProcessor");m(this,"formatNavigator");m(this,"formatRenderer");m(this,"inputSlotCollection");m(this,"inputRuleProcessor");m(this,"previousOutputValue","");m(this,"inputElementSet",!1);m(this,"isInputFocused",!1);m(this,"inputElement");m(this,"onFormatChange");this.inputValue=t,this.instanceId=th(),this.instanceCollection=yt.getInstance(),this.keyProcessor=new ih(r,this.instanceId),this.formatNavigator=this.instanceCollection.getNavigatorInstance(this.instanceId,r),this.formatRenderer=new tn(r,this.instanceId),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(this.instanceId,r),this.inputRuleProcessor=new oa(r,this.instanceId)}inputElementCreated(r){this.keyProcessor.setInputElement(r),this.formatNavigator.setInputElement(r),this.formatRenderer.setInputElement(r),this.inputElement=r,this.inputElementSet=!0,this.inputElementSet&&this.inputValue.length>0&&this.inputValuePassed(this.inputValue)}inputFocused(){this.isInputFocused=!0,this.formatRenderer.render(),setTimeout(()=>this.formatNavigator.findCursorPosition())}inputBlurred(){this.isInputFocused=!1}inputValuePassed(r){this.inputValue=r,this.inputElementSet&&(this.inputValue.length>0?this.inputRuleProcessor.processInputValue(r):(this.inputSlotCollection.clearAllSlots(),this.previousOutputValue=void 0),setTimeout(()=>{var t;this.formatRenderer.render(),this.isInputFocused&&this.formatNavigator.setCursorToCurrentPosition(),this.inputValue.length>0&&(this.previousOutputValue=(t=this.inputElement)==null?void 0:t.innerHTML)}))}registerFormatChangeEvent(r){this.onFormatChange=r}mouseUpHandler(){this.formatNavigator.findCursorPosition()}keyDownHandler(r){r.key!=="Tab"&&(r.preventDefault(),r.stopPropagation(),this.keyProcessor.processKeyPress(r)&&this.inputElement&&this.onFormatChange&&(this.inputSlotCollection.allSlotsCompleted()&&this.previousOutputValue!==this.inputElement.innerHTML?(this.previousOutputValue=this.inputElement.innerHTML,this.onFormatChange(this.inputElement.innerHTML)):this.inputSlotCollection.allSlotsEmpty()&&this.previousOutputValue!==void 0&&(this.previousOutputValue=void 0,this.onFormatChange())))}dispose(){this.instanceCollection.removeInstances(this.instanceId)}}const uh=(e,r)=>{const{value:t="",format:n,readOnly:s=!1,debounceTime:a=800,fillContainer:o=!0,leftElement:i,rightElement:c,className:l,leftElementClassName:h,rightElementClassName:b,isSingleLine:w=!1,allowSingleLineScroll:x=!1,isInputValid:P,onChange:D,onFocus:k,onBlur:E,onElementCreate:L,onLeftElementClick:U,onRightElementClick:$}=e,[y,A]=d.useState(!0),O=d.useRef(),H=d.useRef(),F=d.useRef();d.useEffect(()=>()=>{var M;(M=F.current)==null||M.dispose()},[]),d.useEffect(()=>{var M;(M=F.current)==null||M.inputValuePassed(t)},[t]),d.useEffect(()=>{var M,he,g;(M=F.current)==null||M.dispose(),n&&(F.current=new ch(n,t),H.current&&((he=F.current)==null||he.inputElementCreated(H.current)),(g=F.current)==null||g.registerFormatChangeEvent(re))},[n]);const re=d.useCallback(M=>{P?P(M)?(A(!0),D==null||D(M)):A(!1):D==null||D(M)},[D]),ee=d.useCallback(M=>{var he;(he=F.current)==null||he.inputFocused(),k==null||k(M)},[k]),q=d.useCallback(M=>{var he;(he=F.current)==null||he.inputBlurred(),E==null||E(M)},[E]),S=d.useCallback(()=>{var M;(M=F.current)==null||M.mouseUpHandler()},[]),T=d.useCallback(M=>{var he;(he=F.current)==null||he.keyDownHandler(M)},[]),B=d.useCallback(M=>{var he,g,C,z,p,N,V,I,R;(g=(he=O.current)==null?void 0:he.inputElement)==null||g.removeEventListener("keydown",T),(z=(C=O.current)==null?void 0:C.inputElement)==null||z.removeEventListener("mouseup",S),O.current=M,(N=(p=O.current)==null?void 0:p.inputElement)==null||N.addEventListener("keydown",T),(I=(V=O.current)==null?void 0:V.inputElement)==null||I.addEventListener("mouseup",S),H.current=(R=O.current)==null?void 0:R.inputElement},[]),Y=d.useCallback(()=>{var M;(M=O.current)==null||M.focus()},[]);d.useImperativeHandle(r,()=>({focus:Y}));const se=ve(l,{"!bsc-border-error":!y});return f.jsx(Qt,{ref:M=>M&&B(M),readOnly:s,debounceTime:a,fillContainer:o,leftElement:i,rightElement:c,className:se,leftElementClassName:h,rightElementClassName:b,isSingleLine:w,allowSingleLineScroll:x,onFocus:ee,onBlur:q,onElementCreate:L,onLeftElementClick:U,onRightElementClick:$})},ia=d.forwardRef(uh),rn=d.createContext(void 0);function ca(e,r,t=!0){var w,x;const n=Es(e),s=ys(e),a=nf(e);let o=Fr(s)-(((w=r.options)==null?void 0:w.weekStartsOn)||0);o=o===-1?6:o;const i=Fr(a)-(((x=r.options)==null?void 0:x.weekStartsOn)||0),c=dl({start:s,end:a}),l=n+o>35?6:5,h=ua(l,7,{dayValue:null,isCurrent:!0});let b=1;for(let P=0,D=l;P<D;P++){for(let k=P>0?0:o;k<7;k++){const E=c[b-1];if(E.setHours(e.getHours(),e.getMinutes(),e.getSeconds()),h[P][k].dayValue=E,++b>n)break}if(b>n)break}if(o>0&&t)for(let P=0;P<o;P++)h[0][P].dayValue=td(s,o-P),h[0][P].isCurrent=!1;if(i>-1&&t)for(let P=6;P>i;P--)h[l-1][P].dayValue=pt(a,P-i),h[l-1][P].isCurrent=!1;return h}function ua(e,r,t){const n=[];for(let s=0,a=e;s<a;s++){const o=[];for(let i=0,c=r;i<c;i++){const l=lh(t)?t:{...t};o.push(l)}n.push(o)}return n}function lh(e){const r=typeof e;return r==="string"||r==="number"||r==="boolean"||e instanceof Date}function fh(e){var n;const r=rd(new Date,((n=e.options)==null?void 0:n.weekStartsOn)||0),t=[];for(let s=0;s<7;s++)t.push(pt(r,s).toLocaleDateString(e.code,{weekday:"short"}));return t}function dh(e){const r=new Date(Date.UTC(2020,0,1)),t=[[{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""}],[{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""}],[{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""}]];let n=0;for(let s=0;s<3;s++)for(let a=0;a<4;a++)t[s][a]={monthNumber:n,monthName:st(r,n++).toLocaleDateString(e.code,{month:"short"})};return t}function hh(e,r){const t=new Date(e.getTime()),n=Math.floor(t.getFullYear()/10)*10;t.setFullYear(n);const s=hl({start:t,end:Kt(t,9)}),a=ua(3,4,"");let o=0;for(let i=0;i<3;i++)for(let c=0;c<4&&(a[i][c]=s[o++].toLocaleDateString(r.code,{year:"numeric"}),o!==s.length);c++);return a}function ph(e){const r=new Date;return r.setHours(0,0,0,0),r.toLocaleTimeString(e.code)}function mh(e,r,t){return e.getTime()>=r.getTime()&&e.getTime()<=t.getTime()}async function la(e){return(await import(`/node_modules/date-fns/locale/${bh(e)}`)).default}function bh(e){const[r,t]=e.split("-");switch(r){case"af":return"af";case"ar":switch(t){case"DZ":return"ar-DZ";case"EG":return"ar-EG";case"MA":return"ar-MA";case"SA":return"ar-SA";case"TN":return"ar-TN";default:return"ar"}case"az":return"az";case"be":switch(t){case"tarask":return"be-tarask";default:return"be"}case"bg":return"bg";case"bn":return"bn";case"bs":return"bs";case"ca":return"ca";case"cs":return"cs";case"cy":return"cy";case"da":return"da";case"de":switch(t){case"AT":return"de-AT";default:return"de"}case"el":return"el";case"en":switch(t){case"AU":return"en-AU";case"CA":return"en-CA";case"GB":return"en-GB";case"IE":return"en-IE";case"IN":return"en-IN";case"NZ":return"en-NZ";case"US":return"en-US";default:return"en-ZA"}case"eo":return"eo";case"es":return"es";case"et":return"et";case"eu":return"eu";case"fa":return"fa-IR";case"fi":return"fi";case"fr":switch(t){case"CA":return"fr-CA";case"CH":return"fr-CH";default:return"fr"}case"fy":return"fy";case"gd":return"gd";case"gl":return"gl";case"gu":return"gu";case"he":return"he";case"hi":return"hi";case"hr":return"hr";case"ht":return"ht";case"hu":return"hu";case"hy":return"hy";case"id":return"id";case"is":return"is";case"it":switch(t){case"CH":return"it-CH";default:return"it"}case"ja":switch(t){case"Hira":return"ja-Hira";default:return"ja"}case"ka":return"ka";case"kk":return"kk";case"km":return"km";case"kn":return"kn";case"ko":return"ko";case"lb":return"lb";case"lt":return"lt";case"lv":return"lv";case"mk":return"mk";case"mn":return"mn";case"ms":return"ms";case"mt":return"mt";case"nb":return"nb";case"nl":switch(t){case"BE":return"nl-BE";default:return"nl"}case"nn":return"nn";case"oc":return"oc";case"pl":return"pl";case"pt":switch(t){case"BR":return"pt-BR";default:return"pt"}case"ro":return"ro";case"ru":return"ru";case"sk":return"sk";case"sl":return"sl";case"sq":return"sq";case"sr":switch(t){case"Latn":return"sr-Latn";default:return"sr"}case"sv":return"sv";case"ta":return"ta";case"te":return"te";case"th":return"th";case"tr":return"tr";case"ug":return"ug";case"uk":return"uk";case"uz":switch(t){case"Cyrl":return"uz-Cyrl";default:return"uz"}case"vi":return"vi";case"zh":switch(t){case"CN":return"zh-CN";case"HK":return"zh-HK";default:return"zh-TW"}default:return"en-AU"}}function At(e,r){const t=nd(e);if(isNaN(t.valueOf())){let n=He(e,"P pp",new Date,{locale:r});return!isNaN(n.valueOf())||(n=He(e,"Pp",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=He(e,"P HH:mm",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=He(e,"P hh:mm a..aaa",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=He(e,"P HH:mm:ss",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=He(e,"P hh:mm:ss a..aaa",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=He(e,"P",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=He(e,"P p",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=He(e,"pp",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=He(e,"p",new Date,{locale:r}),!isNaN(n.valueOf()))?n:void 0}return t}function fa(e,r){const t=e.split("-");if(t.length!==2)return;const n=At(t[0].trim(),r);if(!n)return;const s=At(t[1].trim(),r);if(s)return[n,s]}var de=(e=>(e[e.DateTime=0]="DateTime",e[e.DateOnly=1]="DateOnly",e[e.TimeOnly=2]="TimeOnly",e[e.DateRange=3]="DateRange",e))(de||{}),$t=(e=>(e[e.Day=0]="Day",e[e.Month=1]="Month",e[e.Year=2]="Year",e[e.Range=3]="Range",e))($t||{}),Ft=(e=>(e[e.Short=0]="Short",e[e.Medium=1]="Medium",e[e.Long=2]="Long",e))(Ft||{}),Te=(e=>(e[e.TwelveHour=0]="TwelveHour",e[e.TwentyFourHour=1]="TwentyFourHour",e))(Te||{}),Xe=(e=>(e[e.Normal=0]="Normal",e[e.Range=1]="Range",e))(Xe||{}),ar=(e=>(e[e.Right=0]="Right",e[e.Left=1]="Left",e[e.None=2]="None",e))(ar||{}),X=(e=>(e[e.DaySelector=0]="DaySelector",e[e.MonthSelector=1]="MonthSelector",e[e.YearSelector=2]="YearSelector",e[e.TimeSelector=3]="TimeSelector",e[e.DateRangeSelector=4]="DateRangeSelector",e[e.SetViewDate=5]="SetViewDate",e[e.SetSelectedDate=6]="SetSelectedDate",e[e.SetSelectedDateRange=7]="SetSelectedDateRange",e[e.SetSelectedStartDate=8]="SetSelectedStartDate",e[e.SetSelectedEndDate=9]="SetSelectedEndDate",e[e.SetTimeFormat=10]="SetTimeFormat",e[e.ClearDates=11]="ClearDates",e[e.InitializeDates=12]="InitializeDates",e))(X||{});const gh=(e,r)=>{switch(r.type){case 0:return{...e,currentSelector:0,currentViewDate:r.viewDate||e.currentViewDate};case 1:return{...e,currentSelector:1,currentViewDate:r.viewDate||e.currentViewDate};case 2:return{...e,currentSelector:2};case 3:return{...e,currentSelector:3};case 4:return{...e,currentSelector:4,currentViewDate:r.viewDate||e.currentViewDate};case 5:return{...e,currentViewDate:r.viewDate||new Date,dateInitialized:!0};case 6:return{...e,selectedDate:r.selectedDate||e.selectedDate,currentViewDate:r.viewDate||e.currentViewDate};case 7:return{...e,selectedStartDate:r.selectedStartDate||e.selectedStartDate,selectedEndDate:r.selectedEndDate||e.selectedEndDate};case 8:return{...e,selectedStartDate:r.selectedStartDate,selectedEndDate:void 0};case 9:return{...e,selectedEndDate:r.selectedEndDate};case 10:return{...e,timeFormat:r.timeFormat||e.timeFormat};case 11:return{currentSelector:e.currentSelector,currentViewDate:e.currentViewDate,timeFormat:e.timeFormat,dateInitialized:!0};case 12:{const t={...e,currentViewDate:yh(r.initialDate),dateInitialized:!0};return Array.isArray(r.initialDate)?{...t,selectedStartDate:r.initialDate[0],selectedEndDate:r.initialDate[1]}:{...t,selectedDate:r.initialDate}}default:return{...e,currentSelector:0}}};function yh(e){return e?Array.isArray(e)?e[0]:e:new Date}const or=({viewDate:e,selectedDate:r,selectedStartDate:t,selectedEndDate:n,selectionMode:s=Xe.Normal,locale:a,onDateSelected:o,selectableDate:i,isValidDate:c,dispatcher:l})=>{var B;const[h,b]=d.useState(!1),[w,x]=d.useState(),[P,D]=d.useState(),[k,E]=d.useState(),[L,U]=d.useState(),$=d.useRef(),y=d.useRef(),A=d.useContext(rn),O=d.useMemo(()=>A.calendarTemplate,[A.calendarTemplate]),H=async()=>a||await la(js());d.useEffect(()=>{H().then(Y=>{$.current=Y,y.current=fh($.current),b(!0)}).catch(Y=>console.error(Y))},[]),d.useEffect(()=>{e&&$.current&&E(ca(e,$.current,s===Xe.Normal))},[e,h]),d.useEffect(()=>{U(r?new Date(r.getFullYear(),r.getMonth(),r.getDate()):void 0)},[r]),d.useEffect(()=>{x(t?new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0).getTime():void 0),D(n?new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59).getTime():void 0)},[t,n]),d.useEffect(()=>{$.current&&a&&($.current=a,E(ca(e,$.current,s===Xe.Normal)))},[a]);const F=Y=>{if(s===Xe.Normal)l==null||l({type:X.SetSelectedDate,selectedDate:Y,viewDate:Y}),o==null||o(Y);else{if(!o)throw new Error("Range selection mode requires onDateSelected to be set");!t||sf(Y,t)?o(Y):t&&!n?o(Y,{setEndDate:!0}):t&&n&&o(Y)}},re=Y=>(L==null?void 0:L.toLocaleDateString())===Y.toLocaleDateString(),ee=Y=>{if(w&&P){const se=Y.getTime();return se>=w&&se<=P}return!1},q={viewDate:e,selectedDate:r,selectedStartDate:t,selectedEndDate:n,selectionMode:s,locale:a,weekDays:y.current,monthMatrix:k,selectableDate:i,isValidDate:c,onDateClicked:F,isSelectedDate:re,isInSelectedDateRange:ee},T=O||((Y,se)=>f.jsx("div",{className:"bc-dt-calendar bsc-w-full",children:se}));return f.jsx(er,{props:q,template:T,children:f.jsxs("div",{className:"bc-dt-day-row bsc-grid bsc-min-w-[329px] bsc-grid-cols-7 bsc-gap-3",children:[(B=y.current)==null?void 0:B.map((Y,se)=>f.jsx("div",{className:"bc-dt-day-cell bsc-text-center bsc-font-bold",children:Y},se)),k==null?void 0:k.map((Y,se)=>Y.map((M,he)=>{var z,p;const g=M.dayValue!==null&&(i===void 0||i(M.dayValue)),C=ve("bsc-text-center bsc-py-1",{"bsc-text-gray-3":!M.isCurrent,"bsc-bg-primary-3 dark:bsc-bg-mono-light-1 dark:bsc-text-mono-dark-1":M&&M.dayValue&&(L&&re(M.dayValue)||w&&!P&&gs(w,M.dayValue)||w&&P&&ee(M.dayValue)),"bsc-cursor-pointer":g,"bsc-text-error bsc-cursor-not-allowed":!g,"bsc-bg-primary-5 dark:bsc-bg-mono-light-3 dark:bsc-text-mono-dark-1":M.dayValue&&ed(M.dayValue)&&!(re(M.dayValue)||ee(M.dayValue))},"bc-dt-date-cell");return f.jsx("div",{className:C,onClick:()=>M&&M.dayValue&&g&&(c===void 0||c(M.dayValue))&&F(M.dayValue),children:(p=M.dayValue)==null?void 0:p.getDate().toLocaleString((z=$.current)==null?void 0:z.code)},se.toString()+he.toString())}))]})})},ir=({title:e,scrollerType:r,onTitleClicked:t,onMovePrevious:n,onMoveNext:s})=>{const o=d.useContext(rn).dateScrollerTemplate,i={title:e,scrollerType:r,onTitleClicked:t,onMovePrevious:n,onMoveNext:s},l=o||((h,b)=>f.jsx("div",{className:"bc-dt-scroller bsc-flex bsc-w-full bsc-flex-row bsc-items-center bsc-px-2 bsc-py-1",children:b}));return f.jsxs(er,{props:i,template:l,children:[f.jsx("div",{className:"bc-dt-scroller-left bsc-flex-shrink bsc-cursor-pointer",children:f.jsx($e,{className:"bsc-bg-transparent focus:bsc-outline-none",onClick:n,children:f.jsx(je,{icon:"chevronLeft",size:Oe.Regular})})}),f.jsx("div",{className:"bc-dt-scroller-title bsc-flex-grow bsc-cursor-pointer bsc-text-center",onClick:t,children:e}),f.jsx("div",{className:"bc-dt-scroller-right bsc-flex-shrink bsc-cursor-pointer",children:f.jsx($e,{className:"bsc-bg-transparent focus:bsc-outline-none",onClick:s,children:f.jsx(je,{icon:"chevronRight",size:Oe.Regular})})})]})},vh=({selectedDate:e,viewDate:r,locale:t,showTimeSelector:n,selectableDate:s,isValidDate:a,onChange:o,dispatcher:i})=>{const c=()=>{r&&i({type:X.SetViewDate,viewDate:Ns(r,1)})},l=()=>{r&&i({type:X.SetViewDate,viewDate:st(r,1)})},h=()=>{i({type:X.MonthSelector})},b=()=>{i({type:X.TimeSelector})},w=()=>r?r.toLocaleDateString(t.code,{month:"long",year:"numeric"}):"";return f.jsxs("div",{className:"bc-dt-day-selector bsc-p-2",children:[f.jsx(ir,{title:w(),scrollerType:$t.Day,onTitleClicked:h,onMovePrevious:c,onMoveNext:l}),f.jsx(or,{viewDate:r,selectedDate:e,locale:t,selectableDate:s,isValidDate:a,onDateSelected:o,dispatcher:i}),n&&f.jsx("div",{className:"bc-dt-time-value-wrapper bsc-flex bsc-w-full bsc-flex-row bsc-justify-center bsc-p-2",children:f.jsx("div",{className:"bc-dt-time-value bsc-cursor-pointer bsc-p-2 hover:bsc-bg-gray-4 dark:bsc-bg-mono-dark-1 dark:bsc-text-mono-light-1 dark:hover:bsc-bg-mono-light-2 dark:hover:bsc-text-mono-dark-2",onClick:b,children:(e==null?void 0:e.toLocaleTimeString(t.code))||ph(t)})})]})},xh=({viewDate:e,locale:r,dateSelection:t=de.DateTime,dispatcher:n})=>{const s=d.useRef(dh(r)),a=()=>{const h=_s(e,1);n({type:X.SetViewDate,viewDate:h})},o=()=>{const h=Kt(e,1);n({type:X.SetViewDate,viewDate:h})},i=h=>{n({type:t!==de.DateRange?X.DaySelector:X.DateRangeSelector,viewDate:vd(e,h)})},c=()=>e.toLocaleDateString(r.code,{year:"numeric"}),l=()=>{n({type:X.YearSelector})};return f.jsxs("div",{className:"bc-dt-month-selector bsc-p-2",style:{minWidth:"20rem"},children:[f.jsx(ir,{title:c(),scrollerType:$t.Month,onTitleClicked:l,onMovePrevious:a,onMoveNext:o}),f.jsx("div",{className:"bc-dt-month-grid bsc-grid bsc-w-full bsc-grid-cols-4 bsc-gap-4",children:s.current.map((h,b)=>h.map((w,x)=>f.jsx("div",{className:"bc-dt-month-cell bsc-cursor-pointer bsc-text-center",onClick:()=>i(w.monthNumber),children:w.monthName},b.toString()+x.toString())))})]})},wh=({viewDate:e,selectedStartDate:r,selectedEndDate:t,locale:n,onChange:s,dispatcher:a})=>{const o=tr("screen and (max-device-width: 40rem)"),i=st(e,1),c=(x,P)=>{!P||!P.setEndDate?a({type:X.SetSelectedStartDate,selectedStartDate:x}):(a({type:X.SetSelectedEndDate,selectedEndDate:x}),r&&(s==null||s([r,x])))},l=()=>{a({type:X.MonthSelector})},h=()=>o?`${e.toLocaleDateString(n.code,{month:"long"})} ${e.toLocaleDateString(n.code,{year:"numeric"})}`:`${e.toLocaleDateString(n.code,{month:"long"})} ${e.toLocaleDateString(n.code,{year:"numeric"})} - ${i.toLocaleDateString(n.code,{month:"long"})} ${i.toLocaleDateString(n.code,{year:"numeric"})}`,b=()=>{e&&a({type:X.SetViewDate,viewDate:Ns(e,1)})},w=()=>{e&&a({type:X.SetViewDate,viewDate:st(e,1)})};return f.jsxs("div",{className:"bc-dt-range-selector bsc-flex bsc-flex-col",children:[f.jsx("div",{className:"bc-dt-range-scroller-wrapper bsc-flex-shrink",children:f.jsx(ir,{title:h(),scrollerType:$t.Range,onTitleClicked:l,onMovePrevious:b,onMoveNext:w})}),f.jsx("div",{className:"bsc-flex-grow",children:f.jsx(Br,{mobileMarkup:f.jsx("div",{className:"bc-dt-range-calendar bsc-px-2 bsc-py-1",children:f.jsx(or,{viewDate:e,selectedStartDate:r,selectedEndDate:t,selectionMode:Xe.Range,onDateSelected:c,locale:n,dispatcher:a})}),aboveMobileMarkup:f.jsxs("div",{className:"bc-dt-range-wrapper bsc-flex bsc-flex-row bsc-px-2 bsc-py-1",children:[f.jsx("div",{className:"bc-dt-range-calendar-1 bsc-border-r bsc-border-solid bsc-border-gray-3 bsc-pr-4",children:f.jsx(or,{viewDate:e,selectedStartDate:r,selectedEndDate:t,selectionMode:Xe.Range,onDateSelected:c,locale:n,dispatcher:a})}),f.jsx("div",{className:"bc-dt-range-calendar-2 bsc-pl-4",children:f.jsx(or,{viewDate:i,selectedStartDate:r,selectedEndDate:t,selectionMode:Xe.Range,onDateSelected:c,locale:n,dispatcher:a})})]})})})]})},Th=({viewDate:e,showDateSelector:r,locale:t,timeFormat:n=Te.TwelveHour,timeConstraints:s,onChange:a,dispatcher:o})=>{const i=d.useRef(n===Te.TwelveHour?11:23),c=d.useRef(n===Te.TwelveHour?["12","01","02","03","04","05","06","07","08","09","10","11"]:["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"]),l=d.useRef(wd(0,59,S=>S.toString().padStart(2,"0"))),h=d.useRef(["AM","PM"]),b=d.useRef(Ju(e)),w=S=>S>11?S-12:S,[x,P]=d.useState(w(e.getHours())),[D,k]=d.useState(e.getMinutes()),[E,L]=d.useState(e.getHours()<=12?0:1),U=d.useRef(e.toLocaleDateString(t.code));d.useEffect(()=>{const S=e.getHours(),T=e.getMinutes();if(S!==x&&P(n===Te.TwelveHour?w(S):S),T!==D&&k(T),n===Te.TwelveHour){const B=S<=11?0:1;B!==E&&L(B)}},[e]);const $=()=>{var B;const S=((B=s==null?void 0:s.hours)==null?void 0:B.step)||1,T=x<i.current?x+S:0;P(T),F(T,D,E)},y=()=>{var B;const S=((B=s==null?void 0:s.hours)==null?void 0:B.step)||1,T=x>0?x-S:i.current;P(T),F(T,D,E)},A=()=>{var B,Y,se;const S=((B=s==null?void 0:s.minutes)==null?void 0:B.step)||1,T=D+S<(((Y=s==null?void 0:s.minutes)==null?void 0:Y.max)||59)?D+S:((se=s==null?void 0:s.minutes)==null?void 0:se.min)||0;k(T),F(x,T,E)},O=()=>{var B,Y,se;const S=((B=s==null?void 0:s.minutes)==null?void 0:B.step)||1,T=D-S>=(((Y=s==null?void 0:s.minutes)==null?void 0:Y.min)||0)?D-S:(((se=s==null?void 0:s.minutes)==null?void 0:se.max)||60)-S;k(T),F(x,T,E)},H=()=>{const S=E===0?1:0;L(S),F(x,D,S)},F=(S,T,B)=>{const Y=n===Te.TwelveHour&&B===1?S+12:S;b.current.setHours(Y,T),o({type:X.SetSelectedDate,selectedDate:b.current,viewDate:b.current}),a==null||a(b.current)},re=()=>{o({type:X.DaySelector})},ee=ve("bsc-w-full bsc-grid bsc-grid-rows-3 bsc-gap-4 bc-dt-time-grid",{"bsc-grid-cols-4":n===Te.TwelveHour,"bsc-grid-cols-3":n===Te.TwentyFourHour}),q=ve("bsc-text-center bsc-cursor-pointer hover:bsc-bg-gray-4 dark:bsc-text-mono-light-1 dark:hover:bsc-bg-mono-light-1 dark:hover:bsc-text-mono-dark-1 bc-dt-time-date-value",{"bsc-col-span-4":n===Te.TwelveHour,"bsc-col-span-3":n===Te.TwentyFourHour});return f.jsx("div",{className:"bc-dt-time-selector bsc-flex bsc-flex-row bsc-justify-center bsc-p-2",style:{minWidth:n===Te.TwelveHour?"15rem":"11rem"},children:f.jsxs("div",{className:ee,children:[r&&f.jsx("div",{className:q,onClick:re,children:U.current}),f.jsx("div",{className:"bc-dt-time-hour-increase bsc-cursor-pointer bsc-text-center",children:f.jsx($e,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:$,children:f.jsx(je,{icon:"chevronUp",size:Oe.Regular})})}),f.jsx("div",{}),f.jsx("div",{className:"bc-dt-time-minute-increase bsc-cursor-pointer bsc-text-center",children:f.jsx($e,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:A,children:f.jsx(je,{icon:"chevronUp",size:Oe.Regular})})}),n===Te.TwelveHour&&f.jsx("div",{className:"bc-dt-time-meridian-increase bsc-cursor-pointer bsc-text-center",children:f.jsx($e,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:H,children:f.jsx(je,{icon:"chevronUp",size:Oe.Regular})})}),f.jsx("div",{className:"bc-dt-time-hour-value bsc-text-center",children:c.current[x]}),f.jsx("div",{className:"bc-dt-time-separator bsc-text-center",children:":"}),f.jsx("div",{className:"bc-dt-time-minute-value bsc-text-center",children:l.current[D]}),n===Te.TwelveHour&&f.jsx("div",{className:"bc-dt-time-meridian-value bsc-text-center",children:h.current[E]}),f.jsx("div",{className:"bc-dt-time-hour-decrease bsc-cursor-pointer bsc-text-center",children:f.jsx($e,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:y,children:f.jsx(je,{icon:"chevronDown",size:Oe.Regular})})}),f.jsx("div",{}),f.jsx("div",{className:"bc-dt-time-minute-decrease bsc-cursor-pointer bsc-text-center",children:f.jsx($e,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:O,children:f.jsx(je,{icon:"chevronDown",size:Oe.Regular})})}),n===Te.TwelveHour&&f.jsx("div",{className:"bc-dt-time-meridian-decrease bsc-cursor-pointer bsc-text-center",children:f.jsx($e,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:H,children:f.jsx(je,{icon:"chevronDown",size:Oe.Regular})})})]})})},Ph=({viewDate:e,locale:r,dispatcher:t})=>{const n=hh(e,r),s=()=>{const c=_s(e,10);t({type:X.SetViewDate,viewDate:c})},a=()=>{const c=Kt(e,10);t({type:X.SetViewDate,viewDate:c})},o=c=>{const l=parseInt(c);t({type:X.MonthSelector,viewDate:xd(e,l)})},i=()=>`${n[0][0].toString()} - ${n[2][1].toString()}`;return f.jsxs("div",{className:"bc-dt-year-selector",style:{minWidth:"20rem"},children:[f.jsx(ir,{title:i(),scrollerType:$t.Year,onMovePrevious:s,onMoveNext:a}),f.jsx("div",{className:"bc-dt-year-wrapper bsc-w-full",children:f.jsx("div",{className:"bc-dt-year-grid bsc-grid bsc-grid-cols-4 bsc-gap-4",children:n.map((c,l)=>c.map((h,b)=>h.length>0?f.jsx("div",{className:"bc-dt-year-cell bsc-cursor-pointer bsc-text-center",onClick:()=>o(h),children:h},l.toString()+b.toString()):f.jsx("div",{},l.toString()+b.toString())))})})]})};class Eh{constructor(r,t){m(this,"dateFormat");m(this,"timeFormat");m(this,"use24HourTime");m(this,"monthPart");m(this,"dayPart");m(this,"yearPart");m(this,"twelveHourPart");m(this,"twentyFourHourPart");m(this,"minutePart");m(this,"meridianPart");this.dateSelection=r;const n=2023,s=12,a=20,i=new Date(n,s-1,a).toLocaleDateString(t,{year:"numeric",month:"numeric",day:"numeric"});this.dateFormat=i.replace(`${n}`,"YYYY").replace(`${s}`,"MM").replace(`${a}`,"DD");const c=new Date,l=18,h=24,b=37,w=317;c.setHours(l,h,b,w);const x=c.toLocaleTimeString(t);this.use24HourTime=x.startsWith("18"),this.timeFormat=x.replace(`${this.use24HourTime?l:"6"}`,"HH").replace(`${h}`,"MM").replace(`${b}`,"SS").replace(`${w}`,"LLL"),this.createDateParts()}get is24HourTime(){return this.use24HourTime}createInputFormat(){const r={deleteShiftsFormatPart:!1,formatParts:[]};switch(this.dateSelection){case de.DateOnly:return this.createDateFormat(r);case de.TimeOnly:return this.createTimeFormat(r);case de.DateRange:return this.createDateRangeFormat(r);case de.DateTime:return this.createDateTimeFormat(r)}}createDateFormat(r){return this.dateFormat.startsWith("MM")?r.formatParts.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?r.formatParts.push(...this.createDayMonthYearFormatParts()):r.formatParts.push(...this.createYearMonthDayFormatParts()),r}createTimeFormat(r){return this.use24HourTime?r.formatParts.push(...this.createTwentyFourHourFormatParts()):r.formatParts.push(...this.createTwelveHourFormatParts()),r}createDateRangeFormat(r){const t=[];this.dateFormat.startsWith("MM")?t.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?t.push(...this.createDayMonthYearFormatParts()):t.push(...this.createYearMonthDayFormatParts());const n={characterCount:3,placeholder:" - ",inputText:" - ",isSeparator:!0};return r.formatParts.push(...t,n,...t),r}createDateTimeFormat(r){this.dateFormat.startsWith("MM")?r.formatParts.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?r.formatParts.push(...this.createDayMonthYearFormatParts()):r.formatParts.push(...this.createYearMonthDayFormatParts());const t={characterCount:1,placeholder:" ",inputText:" ",isSeparator:!0};return r.formatParts.push(t),this.use24HourTime?r.formatParts.push(...this.createTwentyFourHourFormatParts()):r.formatParts.push(...this.createTwelveHourFormatParts()),r}createMonthDayYearFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let r=this.dateFormat.replace("MM",""),t=r.indexOf("DD"),n=r.substring(0,t);r=r.replace(n,"").replace("DD","");const s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};t=r.indexOf("YYYY"),n=r.substring(0,t);const a={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.monthPart,s,this.dayPart,a,this.yearPart]}return[]}createDayMonthYearFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let r=this.dateFormat.replace("DD",""),t=r.indexOf("MM"),n=r.substring(0,t);r=r.replace(n,"").replace("MM","");const s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};t=r.indexOf("YYYY"),n=r.substring(0,t);const a={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.dayPart,s,this.monthPart,a,this.yearPart]}return[]}createYearMonthDayFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let r=this.dateFormat.replace("YYYY",""),t=r.indexOf("MM"),n=r.substring(0,t);r=r.replace(n,"").replace("MM","");const s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};t=r.indexOf("DD"),n=r.substring(0,t);const a={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.yearPart,s,this.monthPart,a,this.dayPart]}return[]}createTwelveHourFormatParts(){if(this.twelveHourPart&&this.minutePart&&this.meridianPart){const r=this.timeFormat.replace("HH",""),t=r.indexOf("MM"),n=r.substring(0,t),s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0},a={characterCount:1,placeholder:" ",inputText:" ",isSeparator:!0};return[this.twelveHourPart,s,this.minutePart,a,this.meridianPart]}return[]}createTwentyFourHourFormatParts(){if(this.twentyFourHourPart&&this.minutePart){const r=this.timeFormat.replace("HH",""),t=r.indexOf("MM"),n=r.substring(0,t),s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.twentyFourHourPart,s,this.minutePart]}return[]}createDateParts(){this.monthPart={characterCount:2,placeholder:"M",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:We.Numeric,minimumValue:1,maximumValue:12,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.dayPart={characterCount:2,placeholder:"D",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:We.Numeric,minimumValue:1,maximumValue:31,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.yearPart={characterCount:4,placeholder:"Y",inputText:"_",isSeparator:!1,allCharactersRequired:!0,valueType:We.Numeric},this.twelveHourPart={characterCount:2,placeholder:"H",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:We.Numeric,minimumValue:1,maximumValue:12,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.twentyFourHourPart={characterCount:2,placeholder:"H",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:We.Numeric,minimumValue:0,maximumValue:23,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.minutePart={characterCount:2,placeholder:"M",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:We.Numeric,minimumValue:0,maximumValue:59,exceedingMaximumValueCausesError:!0,padWithZeros:!0},this.meridianPart={characterCount:2,inputText:"_",isSeparator:!1,valueType:We.Text,possibleValues:["AM","PM"]}}}const Sh=(e,r)=>{var a;const[t,n]=d.useState(),s=d.useRef();return d.useEffect(()=>{r&&!t&&(s.current=new Eh(e,r),n(s.current.createInputFormat()))},[r]),[t,(a=s.current)==null?void 0:a.is24HourTime]},Ch=({value:e,readOnly:r=!1,label:t,useDefaultDateValue:n=!1,useFormattedInput:s=!1,allowClear:a=!1,closeSelector:o=!1,locale:i,className:c,dateSelection:l=de.DateTime,dateFormat:h,timeConstraints:b,icon:w,iconPosition:x=ar.Right,inputElement:P,selectableDate:D,isValidDate:k,onChange:E,calendarTemplate:L,dateScrollerTemplate:U,inputTemplate:$})=>{const[y,A]=d.useState(!1),[O,H]=d.useState(),[F,re]=d.useState(),ee=d.useRef(),q=d.useRef(!1),S=d.useRef(i||js()),T=d.useRef(),B=d.useRef(),Y=d.useRef(),[se,M]=Sh(l,O),he=d.useRef({calendarTemplate:L,dateScrollerTemplate:U});d.useEffect(()=>{S.current&&g(S.current)},[S]),d.useEffect(()=>{i&&g(i)},[i]),d.useEffect(()=>{if(e){const K=C();N({type:X.InitializeDates,initialDate:K})}else N({type:X.ClearDates})},[e,T.current]),d.useEffect(()=>{M&&N({type:X.SetTimeFormat,timeFormat:M?Te.TwentyFourHour:Te.TwelveHour})},[M]),d.useEffect(()=>{P&&(B.current=P)},[P]);const g=K=>{la(K).then(fe=>{H(fe.code),T.current=fe;const Ie=C();N(e||n?{type:X.InitializeDates,initialDate:Array.isArray(Ie)?Ie[0]:Ie}:{type:X.SetViewDate,viewDate:Array.isArray(Ie)?Ie[0]:Ie})}).catch(fe=>console.error(fe))},C=()=>{const K=new Date;return K.setHours(0,0,0,0),e?typeof e=="string"?l!==de.DateRange?At(e,T.current):fa(e,T.current):e:K},z={currentSelector:l===de.TimeOnly?X.TimeSelector:l===de.DateTime||l===de.DateOnly?X.DaySelector:X.DateRangeSelector,currentViewDate:new Date,timeFormat:Te.TwelveHour,dateInitialized:!1},[p,N]=d.useReducer(gh,z),V=()=>{it(),A(!0)},I=d.useMemo(()=>_t(()=>{A(!1)},250),[]),R=d.useMemo(()=>_t(()=>{I.cancel()},5),[I]),W=K=>{const fe=K.target.innerText;Se(fe)},Q=K=>{if(K){const fe=At(K,T.current);return fe?k?k(fe):!0:!1}else return!0},Z=K=>{Se(K||"")},Se=K=>{const fe=l!==de.DateRange?At(K,T.current):fa(K,T.current);fe?(Array.isArray(fe)?(mh(fe[0],ys(p.currentViewDate),fl(st(p.currentViewDate,1)))||N({type:X.SetViewDate,viewDate:fe[0]}),N({type:X.SetSelectedDateRange,selectedStartDate:fe[0],selectedEndDate:fe[1]})):N({type:X.SetSelectedDate,selectedDate:fe,viewDate:fe}),E==null||E(fe)):K===""&&(N({type:X.ClearDates}),E==null||E())},_=K=>{l===de.DateOnly&&o===!0&&A(!1),E==null||E(K)},Ne=()=>{it(),A(!y)},qe=()=>{N({type:X.ClearDates}),A(!1),E==null||E()},Ae=(K,fe)=>{(!B.current||ee.current!==fe)&&(B.current=K,ee.current=fe,q.current=!0)},it=()=>{(!Y.current||q.current)&&B.current&&(Y.current=B.current,re(B.current),q.current=!1)},Yt=()=>{A(!1),N({type:l===de.TimeOnly?X.TimeSelector:l===de.DateTime||l===de.DateOnly?X.DaySelector:X.DateRangeSelector})},cr=()=>{switch(h){case Ft.Short:return"short";case Ft.Medium:return"medium";case Ft.Long:return"long";default:return}},ze=()=>{var fe,Ie,xt,fr,dr,hr,pr,mr,br,gr,wt,Wt;const K=cr();switch(l){case de.DateTime:return p.selectedDate?K?p.selectedDate.toLocaleString((fe=T.current)==null?void 0:fe.code,{dateStyle:K,timeStyle:K}):p.selectedDate.toLocaleString((Ie=T.current)==null?void 0:Ie.code):"";case de.DateOnly:return p.selectedDate?K?p.selectedDate.toLocaleDateString((xt=T.current)==null?void 0:xt.code,{dateStyle:K}):p.selectedDate.toLocaleDateString((fr=T.current)==null?void 0:fr.code):"";case de.TimeOnly:return p.selectedDate?K?p.selectedDate.toLocaleTimeString((dr=T.current)==null?void 0:dr.code,{timeStyle:K,hour12:p.timeFormat===Te.TwelveHour,hourCycle:p.timeFormat===Te.TwentyFourHour?"h23":void 0}):p.selectedDate.toLocaleTimeString((hr=T.current)==null?void 0:hr.code,{hour12:p.timeFormat===Te.TwelveHour,hourCycle:p.timeFormat===Te.TwentyFourHour?"h23":void 0}):"";case de.DateRange:return p.selectedStartDate&&p.selectedEndDate?K?`${p.selectedStartDate.toLocaleDateString((pr=T.current)==null?void 0:pr.code,{dateStyle:K})} - ${p.selectedEndDate.toLocaleDateString((mr=T.current)==null?void 0:mr.code,{dateStyle:K})}`:`${p.selectedStartDate.toLocaleDateString((br=T.current)==null?void 0:br.code)} - ${p.selectedEndDate.toLocaleDateString((gr=T.current)==null?void 0:gr.code)}`:"";default:return p.selectedDate?K?p.selectedDate.toLocaleString((wt=T.current)==null?void 0:wt.code,{dateStyle:K,timeStyle:K}):p.selectedDate.toLocaleString((Wt=T.current)==null?void 0:Wt.code):""}},vt=l===de.DateTime||l===de.DateOnly||l===de.DateRange,nn=l===de.DateTime||l===de.TimeOnly,Ge=x===ar.None?{}:x===ar.Right?{rightElement:f.jsxs("div",{className:"bsc-flex bsc-text-black dark:bsc-text-mono-light-1",children:[a&&!r&&f.jsx("div",{children:f.jsx(je,{icon:"close",size:Oe.Small,className:"bsc-cursor-pointer bsc-text-sm",onClick:qe})}),f.jsx("div",{className:"bsc-ml-2",children:w||f.jsx(je,{icon:"calendar",size:Oe.Small,className:r?void 0:"bsc-cursor-pointer",onClick:r?void 0:Ne})})]}),rightElementClassName:"bsc-justify-center"}:{leftElement:f.jsxs("div",{className:"bsc-flex bsc-text-black dark:bsc-text-mono-light-1",children:[f.jsx("div",{className:"bsc-mr-2",children:w||f.jsx(je,{icon:"calendar",size:Oe.Small,className:r?void 0:"bsc-cursor-pointer",onClick:r?void 0:Ne})}),a&&!r&&f.jsx("div",{children:f.jsx(je,{icon:"close",size:Oe.Small,className:"bsc-cursor-pointer bsc-text-sm",onClick:qe})})]}),leftElementClassName:"bsc-justify-center"},ur=()=>f.jsxs(f.Fragment,{children:[p.currentSelector===X.DaySelector&&vt&&p.dateInitialized&&T.current&&f.jsx(vh,{selectedDate:p.selectedDate,viewDate:p.currentViewDate,locale:T.current,showTimeSelector:l===de.DateTime,selectableDate:D,isValidDate:k,dispatcher:N,onChange:_}),p.currentSelector===X.MonthSelector&&vt&&p.dateInitialized&&T.current&&f.jsx(xh,{viewDate:p.currentViewDate,locale:T.current,dateSelection:l,dispatcher:N}),p.currentSelector===X.YearSelector&&vt&&p.dateInitialized&&T.current&&f.jsx(Ph,{viewDate:p.currentViewDate,locale:T.current,dispatcher:N}),p.currentSelector===X.TimeSelector&&nn&&p.dateInitialized&&T.current&&f.jsx(Th,{viewDate:p.currentViewDate,showDateSelector:l===de.DateTime,locale:T.current,timeFormat:p.timeFormat,timeConstraints:b,onChange:E,dispatcher:N}),p.currentSelector===X.DateRangeSelector&&vt&&p.dateInitialized&&T.current&&f.jsx(wh,{viewDate:p.currentViewDate,selectedStartDate:p.selectedStartDate,selectedEndDate:p.selectedEndDate,locale:T.current,onChange:E,dispatcher:N})]}),lr={label:t,readOnly:r,allowClear:a,getValue:ze,onFocus:V,onInput:W,iconPosition:x,iconElement:Ge.rightElement||Ge.leftElement},Ht=$||((K,fe)=>f.jsx(f.Fragment,{children:fe})),Ze=ve("bsc-text-left",{"bc-read-only bsc-bg-gray-4 dark:bsc-bg-mono-dark-3":r,"bsc-bg-white dark:bsc-bg-mono-dark-1":!r},"bc-dt-input",c);return f.jsx(rn.Provider,{value:he.current,children:f.jsxs("div",{className:"bc-date-time",children:[t&&f.jsx(Ut,{label:t,readOnly:r,className:"bc-dt-label"}),f.jsx(Br,{mobileMarkup:f.jsxs(f.Fragment,{children:[f.jsx(er,{props:lr,template:Ht,children:f.jsx(Qt,{value:ze(),readOnly:r,inputMode:"none",className:Ze,onFocus:V,onElementCreate:K=>Ae(K,!1),...Ge})}),f.jsx(ea,{visible:y,target:F,hidden:Yt,unmountWhenHidden:!0,children:ur()})]}),aboveMobileMarkup:f.jsxs(f.Fragment,{children:[f.jsx(er,{props:lr,template:Ht,children:s===!1?f.jsx(Qt,{value:ze(),readOnly:r,className:Ze,onFocus:V,onBlur:I,onInput:W,onElementCreate:K=>Ae(K,!1),...Ge}):f.jsx(ia,{value:ze(),readOnly:r,className:Ze,format:se,isInputValid:Q,onFocus:V,onBlur:I,onChange:Z,onElementCreate:K=>Ae(K,!0),...Ge})}),f.jsx(na,{visible:y,target:F,shouldTargetCloseOverlay:!1,shouldScrollCloseOverlay:!0,shouldCheckZIndex:!0,shouldRemainOnScreen:!0,hidden:Yt,isClickedWithin:R,unmountWhenHidden:!0,children:ur()})]})})]})})},Hh="";J.BeeSoftProvider=wa,J.Button=$e,J.Checkbox=xn,J.CheckboxGroup=Wa,J.ContentEditableInput=Qt,J.DateFormatType=Ft,J.DateSelectionType=de,J.DateTime=Ch,J.FormGroupItemOrientation=Vt,J.FormattedInput=ia,J.MediaQuery=Br,J.MobileOverlayPanel=ea,J.OverlayPanel=na,J.SelectionLabelLocation=Je,J.applyBeeSoftTheme=Cd,J.createBeeSoftTheme=Dd,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})});
49
+ */var on,ea;function Jd(){if(ea)return on;ea=1;var e=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function n(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function s(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var o={},i=0;i<10;i++)o["_"+String.fromCharCode(i)]=i;var c=Object.getOwnPropertyNames(o).map(function(h){return o[h]});if(c.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(h){l[h]=h}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return on=s()?Object.assign:function(a,o){for(var i,c=n(a),l,h=1;h<arguments.length;h++){i=Object(arguments[h]);for(var m in i)r.call(i,m)&&(c[m]=i[m]);if(e){l=e(i);for(var x=0;x<l.length;x++)t.call(i,l[x])&&(c[l[x]]=i[l[x]])}}return c},on}var cn,ta;function un(){if(ta)return cn;ta=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return cn=e,cn}var ln,ra;function na(){return ra||(ra=1,ln=Function.call.bind(Object.prototype.hasOwnProperty)),ln}var fn,sa;function eh(){if(sa)return fn;sa=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var r=un(),t={},n=na();e=function(a){var o="Warning: "+a;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function s(a,o,i,c,l){if(process.env.NODE_ENV!=="production"){for(var h in a)if(n(a,h)){var m;try{if(typeof a[h]!="function"){var x=Error((c||"React class")+": "+i+" type `"+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[h]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw x.name="Invariant Violation",x}m=a[h](o,h,c,i,null,r)}catch(w){m=w}if(m&&!(m instanceof Error)&&e((c||"React class")+": type specification of "+i+" `"+h+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof m+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),m instanceof Error&&!(m.message in t)){t[m.message]=!0;var v=l?l():"";e("Failed "+i+" type: "+m.message+(v??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},fn=s,fn}var dn,aa;function th(){if(aa)return dn;aa=1;var e=Js(),r=Jd(),t=un(),n=na(),s=eh(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(i){var c="Warning: "+i;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function o(){return null}return dn=function(i,c){var l=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function m(y){var C=y&&(l&&y[l]||y[h]);if(typeof C=="function")return C}var x="<<anonymous>>",v={array:S("array"),bigint:S("bigint"),bool:S("boolean"),func:S("function"),number:S("number"),object:S("object"),string:S("string"),symbol:S("symbol"),any:A(),arrayOf:B,element:F(),elementType:g(),instanceOf:$,node:re(),objectOf:W,oneOf:_,oneOfType:Y,shape:U,exact:E};function w(y,C){return y===C?y!==0||1/y===1/C:y!==y&&C!==C}function D(y,C){this.message=y,this.data=C&&typeof C=="object"?C:{},this.stack=""}D.prototype=Error.prototype;function N(y){if(process.env.NODE_ENV!=="production")var C={},V=0;function p(q,L,H,z,X,Q,ke){if(z=z||x,Q=Q||H,ke!==t){if(c){var M=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw M.name="Invariant Violation",M}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Ie=z+":"+H;!C[Ie]&&V<3&&(a("You are manually calling a React.PropTypes validation function for the `"+Q+"` prop on `"+z+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),C[Ie]=!0,V++)}}return L[H]==null?q?L[H]===null?new D("The "+X+" `"+Q+"` is marked as required "+("in `"+z+"`, but its value is `null`.")):new D("The "+X+" `"+Q+"` is marked as required in "+("`"+z+"`, but its value is `undefined`.")):null:y(L,H,z,X,Q)}var j=p.bind(null,!1);return j.isRequired=p.bind(null,!0),j}function S(y){function C(V,p,j,q,L,H){var z=V[p],X=k(z);if(X!==y){var Q=G(z);return new D("Invalid "+q+" `"+L+"` of type "+("`"+Q+"` supplied to `"+j+"`, expected ")+("`"+y+"`."),{expectedType:y})}return null}return N(C)}function A(){return N(o)}function B(y){function C(V,p,j,q,L){if(typeof y!="function")return new D("Property `"+L+"` of component `"+j+"` has invalid PropType notation inside arrayOf.");var H=V[p];if(!Array.isArray(H)){var z=k(H);return new D("Invalid "+q+" `"+L+"` of type "+("`"+z+"` supplied to `"+j+"`, expected an array."))}for(var X=0;X<H.length;X++){var Q=y(H,X,j,q,L+"["+X+"]",t);if(Q instanceof Error)return Q}return null}return N(C)}function F(){function y(C,V,p,j,q){var L=C[V];if(!i(L)){var H=k(L);return new D("Invalid "+j+" `"+q+"` of type "+("`"+H+"` supplied to `"+p+"`, expected a single ReactElement."))}return null}return N(y)}function g(){function y(C,V,p,j,q){var L=C[V];if(!e.isValidElementType(L)){var H=k(L);return new D("Invalid "+j+" `"+q+"` of type "+("`"+H+"` supplied to `"+p+"`, expected a single ReactElement type."))}return null}return N(y)}function $(y){function C(V,p,j,q,L){if(!(V[p]instanceof y)){var H=y.name||x,z=se(V[p]);return new D("Invalid "+q+" `"+L+"` of type "+("`"+z+"` supplied to `"+j+"`, expected ")+("instance of `"+H+"`."))}return null}return N(C)}function _(y){if(!Array.isArray(y))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),o;function C(V,p,j,q,L){for(var H=V[p],z=0;z<y.length;z++)if(w(H,y[z]))return null;var X=JSON.stringify(y,function(ke,M){var Ie=G(M);return Ie==="symbol"?String(M):M});return new D("Invalid "+q+" `"+L+"` of value `"+String(H)+"` "+("supplied to `"+j+"`, expected one of "+X+"."))}return N(C)}function W(y){function C(V,p,j,q,L){if(typeof y!="function")return new D("Property `"+L+"` of component `"+j+"` has invalid PropType notation inside objectOf.");var H=V[p],z=k(H);if(z!=="object")return new D("Invalid "+q+" `"+L+"` of type "+("`"+z+"` supplied to `"+j+"`, expected an object."));for(var X in H)if(n(H,X)){var Q=y(H,X,j,q,L+"."+X,t);if(Q instanceof Error)return Q}return null}return N(C)}function Y(y){if(!Array.isArray(y))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var C=0;C<y.length;C++){var V=y[C];if(typeof V!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+O(V)+" at index "+C+"."),o}function p(j,q,L,H,z){for(var X=[],Q=0;Q<y.length;Q++){var ke=y[Q],M=ke(j,q,L,H,z,t);if(M==null)return null;M.data&&n(M.data,"expectedType")&&X.push(M.data.expectedType)}var Ie=X.length>0?", expected one of type ["+X.join(", ")+"]":"";return new D("Invalid "+H+" `"+z+"` supplied to "+("`"+L+"`"+Ie+"."))}return N(p)}function re(){function y(C,V,p,j,q){return P(C[V])?null:new D("Invalid "+j+" `"+q+"` supplied to "+("`"+p+"`, expected a ReactNode."))}return N(y)}function te(y,C,V,p,j){return new D((y||"React class")+": "+C+" type `"+V+"."+p+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+j+"`.")}function U(y){function C(V,p,j,q,L){var H=V[p],z=k(H);if(z!=="object")return new D("Invalid "+q+" `"+L+"` of type `"+z+"` "+("supplied to `"+j+"`, expected `object`."));for(var X in y){var Q=y[X];if(typeof Q!="function")return te(j,q,L,X,G(Q));var ke=Q(H,X,j,q,L+"."+X,t);if(ke)return ke}return null}return N(C)}function E(y){function C(V,p,j,q,L){var H=V[p],z=k(H);if(z!=="object")return new D("Invalid "+q+" `"+L+"` of type `"+z+"` "+("supplied to `"+j+"`, expected `object`."));var X=r({},V[p],y);for(var Q in X){var ke=y[Q];if(n(y,Q)&&typeof ke!="function")return te(j,q,L,Q,G(ke));if(!ke)return new D("Invalid "+q+" `"+L+"` key `"+Q+"` supplied to `"+j+"`.\nBad object: "+JSON.stringify(V[p],null," ")+`
50
+ Valid keys: `+JSON.stringify(Object.keys(y),null," "));var M=ke(H,Q,j,q,L+"."+Q,t);if(M)return M}return null}return N(C)}function P(y){switch(typeof y){case"number":case"string":case"undefined":return!0;case"boolean":return!y;case"object":if(Array.isArray(y))return y.every(P);if(y===null||i(y))return!0;var C=m(y);if(C){var V=C.call(y),p;if(C!==y.entries){for(;!(p=V.next()).done;)if(!P(p.value))return!1}else for(;!(p=V.next()).done;){var j=p.value;if(j&&!P(j[1]))return!1}}else return!1;return!0;default:return!1}}function I(y,C){return y==="symbol"?!0:C?C["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&C instanceof Symbol:!1}function k(y){var C=typeof y;return Array.isArray(y)?"array":y instanceof RegExp?"object":I(C,y)?"symbol":C}function G(y){if(typeof y>"u"||y===null)return""+y;var C=k(y);if(C==="object"){if(y instanceof Date)return"date";if(y instanceof RegExp)return"regexp"}return C}function O(y){var C=G(y);switch(C){case"array":case"object":return"an "+C;case"boolean":case"date":case"regexp":return"a "+C;default:return C}}function se(y){return!y.constructor||!y.constructor.name?x:y.constructor.name}return v.checkPropTypes=s,v.resetWarningCache=s.resetWarningCache,v.PropTypes=v,v},dn}var hn,oa;function rh(){if(oa)return hn;oa=1;var e=un();function r(){}function t(){}return t.resetWarningCache=r,hn=function(){function n(o,i,c,l,h,m){if(m!==e){var x=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw x.name="Invariant Violation",x}}n.isRequired=n;function s(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:s,element:n,elementType:n,instanceOf:s,node:n,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:t,resetWarningCache:r};return a.PropTypes=a,a},hn}if(process.env.NODE_ENV!=="production"){var nh=Js(),sh=!0;an.exports=th()(nh.isElement,sh)}else an.exports=rh()();var ah=an.exports;const ne=Or(ah),ia={disabled:!1};var oh=process.env.NODE_ENV!=="production"?ne.oneOfType([ne.number,ne.shape({enter:ne.number,exit:ne.number,appear:ne.number}).isRequired]):null;process.env.NODE_ENV!=="production"&&ne.oneOfType([ne.string,ne.shape({enter:ne.string,exit:ne.string,active:ne.string}),ne.shape({enter:ne.string,enterDone:ne.string,enterActive:ne.string,exit:ne.string,exitDone:ne.string,exitActive:ne.string})]);const ca=d.createContext(null);var ih=function(r){return r.scrollTop},Bt="unmounted",ut="exited",lt="entering",Tt="entered",pn="exiting",Qe=function(e){Qd(r,e);function r(n,s){var a;a=e.call(this,n,s)||this;var o=s,i=o&&!o.isMounting?n.enter:n.appear,c;return a.appearStatus=null,n.in?i?(c=ut,a.appearStatus=lt):c=Tt:n.unmountOnExit||n.mountOnEnter?c=Bt:c=ut,a.state={status:c},a.nextCallback=null,a}r.getDerivedStateFromProps=function(s,a){var o=s.in;return o&&a.status===Bt?{status:ut}:null};var t=r.prototype;return t.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},t.componentDidUpdate=function(s){var a=null;if(s!==this.props){var o=this.state.status;this.props.in?o!==lt&&o!==Tt&&(a=lt):(o===lt||o===Tt)&&(a=pn)}this.updateStatus(!1,a)},t.componentWillUnmount=function(){this.cancelNextCallback()},t.getTimeouts=function(){var s=this.props.timeout,a,o,i;return a=o=i=s,s!=null&&typeof s!="number"&&(a=s.exit,o=s.enter,i=s.appear!==void 0?s.appear:o),{exit:a,enter:o,appear:i}},t.updateStatus=function(s,a){if(s===void 0&&(s=!1),a!==null)if(this.cancelNextCallback(),a===lt){if(this.props.unmountOnExit||this.props.mountOnEnter){var o=this.props.nodeRef?this.props.nodeRef.current:$e.findDOMNode(this);o&&ih(o)}this.performEnter(s)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ut&&this.setState({status:Bt})},t.performEnter=function(s){var a=this,o=this.props.enter,i=this.context?this.context.isMounting:s,c=this.props.nodeRef?[i]:[$e.findDOMNode(this),i],l=c[0],h=c[1],m=this.getTimeouts(),x=i?m.appear:m.enter;if(!s&&!o||ia.disabled){this.safeSetState({status:Tt},function(){a.props.onEntered(l)});return}this.props.onEnter(l,h),this.safeSetState({status:lt},function(){a.props.onEntering(l,h),a.onTransitionEnd(x,function(){a.safeSetState({status:Tt},function(){a.props.onEntered(l,h)})})})},t.performExit=function(){var s=this,a=this.props.exit,o=this.getTimeouts(),i=this.props.nodeRef?void 0:$e.findDOMNode(this);if(!a||ia.disabled){this.safeSetState({status:ut},function(){s.props.onExited(i)});return}this.props.onExit(i),this.safeSetState({status:pn},function(){s.props.onExiting(i),s.onTransitionEnd(o.exit,function(){s.safeSetState({status:ut},function(){s.props.onExited(i)})})})},t.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},t.safeSetState=function(s,a){a=this.setNextCallback(a),this.setState(s,a)},t.setNextCallback=function(s){var a=this,o=!0;return this.nextCallback=function(i){o&&(o=!1,a.nextCallback=null,s(i))},this.nextCallback.cancel=function(){o=!1},this.nextCallback},t.onTransitionEnd=function(s,a){this.setNextCallback(a);var o=this.props.nodeRef?this.props.nodeRef.current:$e.findDOMNode(this),i=s==null&&!this.props.addEndListener;if(!o||i){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[o,this.nextCallback],l=c[0],h=c[1];this.props.addEndListener(l,h)}s!=null&&setTimeout(this.nextCallback,s)},t.render=function(){var s=this.state.status;if(s===Bt)return null;var a=this.props,o=a.children;a.in,a.mountOnEnter,a.unmountOnExit,a.appear,a.enter,a.exit,a.timeout,a.addEndListener,a.onEnter,a.onEntering,a.onEntered,a.onExit,a.onExiting,a.onExited,a.nodeRef;var i=Zd(a,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return d.createElement(ca.Provider,{value:null},typeof o=="function"?o(s,i):d.cloneElement(d.Children.only(o),i))},r}(d.Component);Qe.contextType=ca,Qe.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:ne.shape({current:typeof Element>"u"?ne.any:function(e,r,t,n,s,a){var o=e[r];return ne.instanceOf(o&&"ownerDocument"in o?o.ownerDocument.defaultView.Element:Element)(e,r,t,n,s,a)}}),children:ne.oneOfType([ne.func.isRequired,ne.element.isRequired]).isRequired,in:ne.bool,mountOnEnter:ne.bool,unmountOnExit:ne.bool,appear:ne.bool,enter:ne.bool,exit:ne.bool,timeout:function(r){var t=oh;r.addEndListener||(t=t.isRequired);for(var n=arguments.length,s=new Array(n>1?n-1:0),a=1;a<n;a++)s[a-1]=arguments[a];return t.apply(void 0,[r].concat(s))},addEndListener:ne.func,onEnter:ne.func,onEntering:ne.func,onEntered:ne.func,onExit:ne.func,onExiting:ne.func,onExited:ne.func}:{};function St(){}Qe.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:St,onEntering:St,onEntered:St,onExit:St,onExiting:St,onExited:St},Qe.UNMOUNTED=Bt,Qe.EXITED=ut,Qe.ENTERING=lt,Qe.ENTERED=Tt,Qe.EXITING=pn;const ch=Qe,ua=({start:e,timeout:r=400,defaultStyle:t,transitionStyles:n,showTransitionOptions:s="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:a="linear",unmountOnExit:o=!1,onEntering:i,onEntered:c,onExit:l,onExited:h,children:m})=>{const x=t||{transition:`opacity ${r}ms ${s}`,opacity:0},v=n||{entering:{opacity:1},entered:{opacity:1},exiting:{transition:`opacity ${r}ms ${a}`,opacity:0},exited:{transition:`opacity ${r}ms ${a}`,opacity:0},unmounted:{}};return f.jsx(ch,{in:e,timeout:r,onEntering:i,onEntered:c,onExit:l,onExited:h,unmountOnExit:o,children:w=>m({state:w,defaultStyle:x,transitionStyles:v})})};function la(e){return e.target?e.target:e}const fa=({visible:e,target:r,appendTo:t=document.body,unmountWhenHidden:n=!1,transitionDuration:s=400,showTransitionOptions:a="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:o="linear",approveText:i="DONE",shown:c,hidden:l,isClickedWithin:h,children:m})=>{const[x,v]=d.useState(-1),[w,D]=d.useState(-1),[N,S]=d.useState(e),A=d.useRef(100),B=d.useRef(101),F=d.useRef(),g=d.useRef(),$=d.useRef();d.useEffect(()=>{r&&(F.current=la(r));const E=zs("zIndex",P=>P==="auto"||P==="-1"?!1:parseInt(P)>100).map(P=>parseInt(P,10));E.length>0&&(A.current=Math.max(...E)+1,B.current=Math.max(...E)+2),S(e)},[e,r]);const _=E=>{g.current=E},W=()=>{D(A.current),v(B.current)},Y=()=>{if(!g.current)return;c==null||c();let E;F.current&&(E=[F.current]);const P=I=>{I?h==null||h():S(!1)};$.current=Gs(g.current,P,E)},re=()=>{$.current&&Zs($.current)},te=()=>{D(-1),v(-1),l==null||l()},U={entering:{opacity:.5},entered:{opacity:.5}};return $e.createPortal(f.jsx(ua,{start:N,timeout:s,showTransitionOptions:a,hideTransitionOptions:o,onEntering:W,onEntered:Y,onExit:re,onExited:te,unmountOnExit:n,children:({state:E,defaultStyle:P,transitionStyles:I})=>f.jsxs("div",{ref:k=>k&&_(k),children:[f.jsx("div",{className:"bsc-fixed bsc-left-0 bsc-top-0 bsc-h-full bsc-w-full bsc-bg-mono-dark-1",style:{zIndex:w,...I[E],...U[E]}}),f.jsxs("div",{className:"dark:bsck-border-mono-light-1 bsc-fixed bsc-bottom-0 bsc-left-0 bsc-w-full bsc-bg-white dark:bsc-border-t dark:bsc-border-solid dark:bsc-bg-mono-dark-1 dark:bsc-text-mono-light-1",style:{zIndex:x,...P,...I[E]},children:[f.jsx("div",{className:"bsc-w-full",children:m}),f.jsx(f.Fragment,{children:f.jsx(We,{buttonType:"primary",fullWidth:!0,onClick:()=>S(!1),className:"bsc-text-xs bsc-font-bold",children:i})})]})]})}),t)};var da=(e=>(e[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e))(da||{}),ha=(e=>(e[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e))(ha||{});class xe{static positionToTarget(r,t=2){const n=r.getBoundingClientRect();let s=0,a=0;const o=window.scrollY;switch(t){case 2:s=n.top+n.height+o,a=n.left;break;case 0:s=n.top+o,a=n.left;break;case 3:s=n.top+n.height+o,a=n.left+n.width;break;case 1:s=n.top+o,a=n.left+n.width}return{top:s,left:a}}static positionElementToTarget(r,t,n=0,s=2){let{left:a,top:o}=xe.positionToTarget(t,s);const i=r.getBoundingClientRect();switch(n){case 0:break;case 1:a=a-i.width;break;case 2:o=o-i.height;break;case 3:o=o-i.height,a=a-i.width;break}return{top:o,left:a}}static canPositionElementOnScreenWithTarget(r,t){const n=xe.getScreenDimensions(),s=r.getBoundingClientRect(),a=xe.positionElementToTarget(r,t,0,2);if(a.left+s.width<n.width&&a.top+s.height<n.height||xe.positionElementToTarget(r,t,1,3).left>=0&&a.top+s.height<n.height)return!0;const i=xe.positionElementToTarget(r,t,2,0);if(i.left+s.width<n.width&&i.top>=0)return!0;const c=xe.positionElementToTarget(r,t,3,1);return c.left>=0&&c.top>=0}static canPositionElementOnScreen(r){const t=xe.getScreenDimensions(),n=r.getBoundingClientRect();return n.width<=t.width&&n.height<=t.height}static positionElementToTargetOnScreen(r,t,n=0,s=2){const{left:a,top:o}=xe.positionElementToTarget(r,t,n,s),i=r.getBoundingClientRect(),c=xe.determineOffScreenLocation(i);if(c){if(n===0&&s===2){if(c.right&&!c.bottom)return xe.positionElementToTarget(r,t,1,3);if(c.bottom&&!c.right)return xe.positionElementToTarget(r,t,2,0);if(c.right&&c.bottom)return xe.positionElementToTarget(r,t,3,1)}else if(n===1&&s===3){if(c.left&&!c.bottom)return xe.positionElementToTarget(r,t,0,2);if(c.bottom&&!c.left)return xe.positionElementToTarget(r,t,3,1);if(c.left&&c.bottom)return xe.positionElementToTarget(r,t,2,0)}}return{top:o,left:a}}static determineOffScreenLocation(r){const t=xe.getScreenDimensions(),n={left:r.left<0,top:r.top<0,right:r.left+r.width>t.width,bottom:r.top+r.height>t.height};return n.left||n.top||n.right||n.bottom?n:void 0}static getScreenDimensions(){return{width:window.innerWidth,height:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}}}const pa=({visible:e,target:r,targetPosition:t=da.BottomLeft,elementAlignment:n=ha.TopLeft,shouldTargetCloseOverlay:s=!0,shouldMatchTargetWidth:a=!1,shouldScrollCloseOverlay:o=!1,shouldCheckZIndex:i=!1,shouldRemainOnScreen:c=!1,unmountWhenHidden:l=!1,transitionDuration:h=400,showTransitionOptions:m="cubic-bezier(0, 0, 0.2, 1)",hideTransitionOptions:x="linear",shown:v,hidden:w,isClickedWithin:D,markupCreated:N,children:S})=>{const[A,B]=d.useState(-1),[F,g]=d.useState(e),[$,_]=d.useState(!1),W=d.useRef(!1),Y=d.useRef(100),re=d.useRef({left:0,top:0,width:0}),te=d.useRef(),U=d.useRef(),E=d.useRef(),P=d.useRef(),I=d.useRef(),k=d.useRef(),G=Pn();d.useEffect(()=>(c===!0&&(k.current=new ResizeObserver(O)),()=>{var L,H;c===!0&&(U.current&&((L=k.current)==null||L.unobserve(U.current)),(H=k.current)==null||H.disconnect())}),[]),d.useEffect(()=>{if(r&&(te.current=la(r),o)){const L=G==null?void 0:G.isValidScrollableElement;E.current=Bs(te.current,{overflow:"scroll, auto",overflowX:"scroll, auto",overflowY:"scroll, auto"},!1,L),E.current.tagName.toLowerCase()==="html"&&(E.current=document)}if(i){const L=zs("zIndex",H=>parseInt(H)>=100).map(H=>parseInt(H));L.length>0&&(Y.current=Math.max(...L)+1)}e!==void 0&&g(e)},[r,e,o,i]);const O=L=>{if(U.current){const H=xe.getScreenDimensions(),z=L[L.length-1].target,X=z.getBoundingClientRect(),Q=xe.determineOffScreenLocation(X);if(Q){if(te.current&&xe.canPositionElementOnScreenWithTarget(z,te.current)){const ke=xe.positionElementToTargetOnScreen(U.current,te.current,n,t);re.current={...re.current,...ke}}else Q.right?re.current.left=H.width-X.width:Q.left&&(re.current.left=0),Q.bottom?re.current.top=H.height-X.height:Q.top&&(re.current.top=0);se()}}},se=Ft(()=>{W.current=!W.current,_(W.current)},20),y=()=>{B(Y.current)},C=()=>{if(!U.current)return;v==null||v();let L;!s&&te.current&&(L=[te.current]);const H=z=>{z?D==null||D():g(!1)};P.current=Gs(U.current,H,L),o&&(I.current=bl(z=>U.current&&jd(z,U.current)&&g(!1),100,{leading:!0}),E.current&&E.current.addEventListener("scroll",I.current))},V=()=>{E.current&&I.current&&(E.current.removeEventListener("scroll",I.current),I.current=void 0),P.current&&Zs(P.current)},p=()=>{B(-1),w==null||w()},j=L=>{var H,z;if(c===!0&&U.current&&((H=k.current)==null||H.unobserve(U.current)),U.current=L,N==null||N(L),te.current){const X=xe.positionElementToTarget(U.current,te.current,n,t);re.current={...X,width:te.current.offsetWidth},c===!0&&(xe.canPositionElementOnScreenWithTarget(U.current,te.current)||xe.canPositionElementOnScreen(U.current))&&((z=k.current)==null||z.observe(U.current))}},q=d.useMemo(()=>{const L={top:`${re.current.top}px`,left:`${re.current.left}px`,zIndex:A};return a&&(L.width=`${re.current.width}px`),L},[$,A,a]);return f.jsx(ua,{start:F,timeout:h,showTransitionOptions:m,hideTransitionOptions:x,onEntering:y,onEntered:C,onExit:V,onExited:p,unmountOnExit:l,children:({state:L,defaultStyle:H,transitionStyles:z})=>f.jsx("div",{className:"bsc-fixed bsc-border bsc-border-solid bsc-bg-white bsc-shadow dark:bsc-border-mono-light-1 dark:bsc-bg-mono-dark-1 dark:bsc-text-mono-light-1",style:{...q,...H,...z[L]},ref:X=>X&&j(X),children:S})})};let lr;const uh=new Uint8Array(16);function lh(){if(!lr&&(lr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!lr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return lr(uh)}const Oe=[];for(let e=0;e<256;++e)Oe.push((e+256).toString(16).slice(1));function fh(e,r=0){return Oe[e[r+0]]+Oe[e[r+1]]+Oe[e[r+2]]+Oe[e[r+3]]+"-"+Oe[e[r+4]]+Oe[e[r+5]]+"-"+Oe[e[r+6]]+Oe[e[r+7]]+"-"+Oe[e[r+8]]+Oe[e[r+9]]+"-"+Oe[e[r+10]]+Oe[e[r+11]]+Oe[e[r+12]]+Oe[e[r+13]]+Oe[e[r+14]]+Oe[e[r+15]]}const ma={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function dh(e,r,t){if(ma.randomUUID&&!r&&!e)return ma.randomUUID();e=e||{};const n=e.random||(e.rng||lh)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,r){t=t||0;for(let s=0;s<16;++s)r[t+s]=n[s];return r}return fh(n)}class fr{static create(r){const t=[];let n=0;for(let s=0,a=r.formatParts.length;s<a;s++){const o=r.formatParts[s],i=n,c=i+o.characterCount;t.push({startPosition:i,endPosition:c,...o}),n=c}return t}}class hh{constructor(r,t){b(this,"instanceCollection");b(this,"formatPartList");b(this,"inputSlotCollection");b(this,"currentPartIndex",0);b(this,"currentCursorPosition",0);b(this,"inputElement");b(this,"inputSelection",null);b(this,"inputRange");b(this,"textNode");this.instanceCollection=Pt.getInstance(),this.formatPartList=fr.create(r),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(t,r)}getCursorPosition(){return this.currentCursorPosition}getCurrentPartIndex(){return this.currentPartIndex}setInputElement(r){this.inputElement=r}setCursorToCurrentPosition(){this.setCursorSelection(this.currentCursorPosition)}setCursorPosition(r){this.setCursorSelection(r)}setCursorSelection(r,t){this.createInputRangeSelection(),this.inputRange&&this.textNode&&(this.inputRange.setStart(this.textNode,r),this.inputRange.setEnd(this.textNode,t||r),this.currentCursorPosition=t||r,this.setPartIndexByCursorPosition())}findCursorPosition(){var t,n;const r=(t=window.getSelection())==null?void 0:t.getRangeAt(0);if(this.inputElement&&r){const s=document.createTreeWalker(this.inputElement,NodeFilter.SHOW_TEXT,c=>{const l=document.createRange();return l.selectNodeContents(c),l.compareBoundaryPoints(Range.END_TO_END,r)<1?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT});let a=0;for(;s.nextNode();)a+=((n=s.currentNode.textContent)==null?void 0:n.length)||0;r.startContainer.nodeType===Node.TEXT_NODE&&(a+=r.startOffset);const o=this.inputSlotCollection.getLastSlotWithData(),i=o.startPosition+o.partText.length;this.setCursorSelection(a>i?i:a)}}isAtLastPart(){return this.currentPartIndex===this.formatPartList.length-1}moveHome(){const r=this.inputSlotCollection.getFirstSlot();this.setCursorSelection(r.startPosition)}moveEnd(){const r=this.inputSlotCollection.getLastSlotWithData(),t=r.startPosition+r.partText.length;this.setCursorSelection(t)}moveCursorLeft(){if(this.currentCursorPosition>0){const r=this.currentCursorPosition-1;let t=this.formatPartList[this.currentPartIndex];if(r>=t.startPosition&&r<=t.endPosition)this.setCursorSelection(r);else for(let n=this.currentPartIndex-1;n>=0;n--)t=this.formatPartList[n],r>=t.startPosition&&r<=t.endPosition&&(t.isSeparator?this.setCursorSelection(this.formatPartList[n-1].endPosition):this.setCursorSelection(r))}}moveCursorRight(){const r=this.inputSlotCollection.getLastSlotWithData(),t=r.startPosition+r.partText.length;if(this.currentCursorPosition<t){const n=this.currentCursorPosition+1;let s=this.formatPartList[this.currentPartIndex];if(n>=s.startPosition&&n<=s.endPosition)this.setCursorSelection(n);else for(let a=this.currentPartIndex+1,o=this.formatPartList.length;a<o;a++)s=this.formatPartList[a],n>=s.startPosition&&n<=s.endPosition&&(s.isSeparator?this.setCursorSelection(this.formatPartList[a+1].startPosition):this.setCursorSelection(n))}}moveToNextInputPart(){if(this.currentPartIndex<this.formatPartList.length-1){const r=this.findNextEditablePart();r&&(this.currentPartIndex=r.partIndex,this.setCursorSelection(r.startPosition))}}moveToPreviousInputPart(){if(this.currentPartIndex>0){const r=this.findPreviousEditablePart();r&&(this.currentPartIndex=r.partIndex,this.setCursorSelection(r.endPosition))}}findNextEditablePart(){return this.inputSlotCollection.getNextSlot(this.currentPartIndex)}findPreviousEditablePart(){return this.inputSlotCollection.getPreviousSlot(this.currentPartIndex)}setPartIndexByCursorPosition(){for(let r=0;r<this.formatPartList.length;r++){const t=this.formatPartList[r];if(this.currentCursorPosition>=t.startPosition&&this.currentCursorPosition<=t.endPosition){if(t.isSeparator){this.currentCursorPosition=this.formatPartList[r+1].startPosition,this.currentPartIndex=r+1;break}this.currentPartIndex=r;break}}}createInputRangeSelection(){var r,t;this.inputElement&&(this.inputSelection=window.getSelection(),this.inputRange=document.createRange(),(r=this.inputSelection)==null||r.removeAllRanges(),this.inputRange.selectNodeContents(this.inputElement),this.inputRange.collapse(!0),(t=this.inputSelection)==null||t.addRange(this.inputRange),this.inputElement.firstChild&&(this.textNode=this.inputElement.firstChild))}}class ph{static create(r){const t=[];for(let n=0,s=r.length;n<s;n++){const a=r[n];a.isSeparator||t.push({partIndex:n,partText:"",isComplete:!1,...a})}return t}}class mh{constructor(r){b(this,"inputSlots");this.inputSlots=ph.create(fr.create(r))}clearAllSlots(){for(let r=0,t=this.inputSlots.length;r<t;r++)this.inputSlots[r].partText=""}getSlot(r){return this.inputSlots.find(t=>t.partIndex===r)}getFirstSlot(){return this.inputSlots[0]}getNextSlot(r){const t=this.inputSlots.findIndex(n=>n.partIndex===r);if(t>-1&&t+1<this.inputSlots.length)return this.inputSlots[t+1]}getPreviousSlot(r){const t=this.inputSlots.findIndex(n=>n.partIndex===r);if(t>-1&&t-1>=0)return this.inputSlots[t-1]}getLastSlotWithData(){const r=this.inputSlots.findIndex(n=>!n.isComplete);let t=r;for(let n=r+1,s=this.inputSlots.length;n<s;n++)this.inputSlots[n].partText.length>0&&(t=n);return this.inputSlots[t>-1?t:0]}allSlotsCompleted(){return this.inputSlots.every(r=>r.isComplete)}allSlotsEmpty(){return this.inputSlots.every(r=>r.partText.length===0)}}class Pt{static getInstance(){return this.instance||(this.instance=new bh),this.instance}}b(Pt,"instance");class bh{constructor(){b(this,"navigatorInstances");b(this,"inputSlotInstances");this.navigatorInstances={},this.inputSlotInstances={}}getNavigatorInstance(r,t){return this.navigatorInstances[r]||(this.navigatorInstances[r]=new hh(t,r)),this.navigatorInstances[r]}getInputSlotInstance(r,t){return this.inputSlotInstances[r]||(this.inputSlotInstances[r]=new mh(t)),this.inputSlotInstances[r]}removeInstances(r){this.navigatorInstances[r]&&delete this.navigatorInstances[r],this.inputSlotInstances[r]&&delete this.inputSlotInstances[r]}}class mn{constructor(r,t){b(this,"instanceCollection");b(this,"formatPartList");b(this,"inputSlotCollection");b(this,"inputElement");this.instanceCollection=Pt.getInstance(),this.formatPartList=fr.create(r),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(t,r)}setInputElement(r){this.inputElement=r}render(){var t;let r="";for(let n=0,s=this.formatPartList.length;n<s;n++){const a=this.formatPartList[n];if(a.isSeparator)r+=a.inputText;else{const o=this.inputSlotCollection.getSlot(n);o&&(r+=o.partText+((t=o.inputText)==null?void 0:t.repeat(o.characterCount-o.partText.length)))}}this.inputElement&&(this.inputElement.innerHTML=r)}}var Ue=(e=>(e[e.Text=0]="Text",e[e.Numeric=1]="Numeric",e))(Ue||{});class ba{constructor(){b(this,"numberKeys",["0","1","2","3","4","5","6","7","8","9"]);b(this,"movementKeys",["ArrowLeft","ArrowRight","Home","End"]);b(this,"editingKeys",["Backspace","Delete"]);b(this,"ignoreKeys",["Shift","Alt","Control","Fn","Meta"])}isNumberKey(r){return this.numberKeys.includes(r)}isMovementKey(r){return this.movementKeys.includes(r.key)}isEditingKey(r){return this.editingKeys.includes(r.key)}isIgnoreKey(r){return this.ignoreKeys.includes(r.key)}}class gh{constructor(r){b(this,"_currentIndex",0);b(this,"index",0);b(this,"formatParts");this.formatParts=fr.create(r)}get currentIndex(){return this._currentIndex}hasNext(){return this.index<this.formatParts.length}next(){if(this.index<this.formatParts.length)return this._currentIndex=this.index++,this.formatParts[this._currentIndex]}peek(){if(this.index<this.formatParts.length)return this.formatParts[this.index]}reset(){this.index=0}}class ga{constructor(r,t){b(this,"instanceCollection");b(this,"inputSlotCollection");b(this,"formatNavigator");b(this,"keyTypeChecker");b(this,"formatRenderer");b(this,"formatPartList");this.format=r,this.instanceCollection=Pt.getInstance(),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(t,r),this.formatNavigator=this.instanceCollection.getNavigatorInstance(t,r),this.keyTypeChecker=new ba,this.formatRenderer=new mn(r,t),this.formatPartList=new gh(r)}setInputElement(r){this.formatRenderer.setInputElement(r)}processKeyPress(r){if(this.keyTypeChecker.isEditingKey(r)){this.processEditRules(r);return}this.processInputRules(r)}processInputValue(r){var n;this.inputSlotCollection.clearAllSlots(),this.formatPartList.reset();let t=0;for(;this.formatPartList.hasNext();){const s=this.formatPartList.next();if(s&&!s.isSeparator)if(((n=this.formatPartList.peek())==null?void 0:n.isSeparator)===!0){const a=this.formatPartList.currentIndex,o=this.formatPartList.next();if(o&&o.inputText){const i=r.indexOf(o.inputText,t),c=this.inputSlotCollection.getSlot(a);if(c&&i>-1){const l=i-t>c.characterCount?t+c.characterCount:i;c.partText=r.substring(t,l),this.processSlotRules(c),t=i+o.characterCount}}}else{const a=this.inputSlotCollection.getSlot(this.formatPartList.currentIndex);a&&(a.partText=r.substring(t,t+a.characterCount),this.processSlotRules(a))}}}processEditRules(r){const t=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());if(!t)return;const n=this.formatNavigator.getCursorPosition(),s=n-t.startPosition,a=this.format.deleteShiftsFormatPart||!1;switch(r.key){case"Backspace":{if(!(t.startPosition===n))t.partText=t.partText.substring(0,s-1)+t.partText.substring(s),a&&this.shiftFormatParts(t),this.formatRenderer.render(),this.formatNavigator.moveCursorLeft(),this.processSlotRules(t,!0);else{this.processSlotRules(t,!0);const i=this.inputSlotCollection.getPreviousSlot(t.partIndex);i&&(i.partText=i.partText.substring(0,i.partText.length-1),a&&this.shiftFormatParts(i),this.formatRenderer.render(),this.formatNavigator.setCursorPosition(i.startPosition+i.partText.length),this.processSlotRules(i,!0))}break}case"Delete":t.partText=t.partText.substring(0,s)+t.partText.substring(s+1),a&&this.shiftFormatParts(t),this.formatRenderer.render(),this.formatNavigator.setCursorToCurrentPosition(),this.processSlotRules(t,!0);break}}shiftFormatParts(r){let t=r,n;for(;(n=this.inputSlotCollection.getNextSlot(t.partIndex))!==void 0;){const s=n.partText.substring(0,1);n.partText=n.partText.substring(1),t.partText=t.partText+s,t=n}}processInputRules(r){const t=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());if(!t)return;const{key:n}=r,s=t.characterCount,a=t.partText;if(t.valueType===Ue.Numeric){if(!this.keyTypeChecker.isNumberKey(n))return;const o=t.maximumValue,i=t.exceedingMaximumValueCausesTab||!1,c=t.padWithZeros||!1,l=parseInt(this.createNewValue(t,n));if(o&&l>o)if(i){c&&(t.partText=t.partText.padStart(s,"0")),t.isComplete=!0;const h=this.inputSlotCollection.getNextSlot(t.partIndex);h&&!h.isComplete&&(h.partText=n),this.formatRenderer.render(),h&&this.formatNavigator.setCursorPosition(h.isComplete?h.startPosition:h.startPosition+1)}else return;else a.length+1===s?(this.addToInputSlot(n),t.isComplete=!0,this.formatRenderer.render(),this.formatNavigator.isAtLastPart()?this.formatNavigator.moveCursorRight():this.formatNavigator.moveToNextInputPart()):a.length+1<s&&(this.addToInputSlot(n),this.formatRenderer.render(),this.formatNavigator.moveCursorRight())}else a.length+1===s?(this.addToInputSlot(n),t.isComplete=!0,this.formatRenderer.render(),this.formatNavigator.isAtLastPart()?this.formatNavigator.moveCursorRight():this.formatNavigator.moveToNextInputPart()):(this.addToInputSlot(n),this.formatRenderer.render(),this.formatNavigator.moveCursorRight())}addToInputSlot(r){const t=this.inputSlotCollection.getSlot(this.formatNavigator.getCurrentPartIndex());t&&(t.partText=this.createNewValue(t,r))}createNewValue(r,t){const n=r.partText,s=this.formatNavigator.getCursorPosition();if(s>=r.startPosition+r.partText.length)return n+t;{const a=s-r.startPosition;return n.substring(0,a)+t+n.substring(a)}}processSlotRules(r,t=!1){const n=r.characterCount,s=r.allCharactersRequired||!1;if(r.valueType===Ue.Numeric){const a=r.minimumValue,o=r.maximumValue;if(s)r.isComplete=r.partText.length===n;else if(a!==void 0&&o!==void 0){const i=r.padWithZeros||!1,c=parseInt(r.partText);r.isComplete=c>=a&&c<=o,r.isComplete&&i&&!t&&(r.partText=r.partText.padStart(n,"0"))}else r.isComplete=r.partText.length>0}else s?r.isComplete=r.partText.length===n:r.isComplete=r.partText.length>0}}class yh{constructor(r,t){b(this,"instanceCollection");b(this,"formatNavigator");b(this,"ruleProcessor");b(this,"keyTypeChecker");b(this,"formatRenderer");this.format=r,this.instanceCollection=Pt.getInstance(),this.formatNavigator=this.instanceCollection.getNavigatorInstance(t,r),this.ruleProcessor=new ga(r,t),this.keyTypeChecker=new ba,this.formatRenderer=new mn(r,t)}setInputElement(r){this.ruleProcessor.setInputElement(r),this.formatRenderer.setInputElement(r)}processMovementKey(r){const{key:t,metaKey:n}=r;switch(t){case"ArrowLeft":n?this.formatNavigator.moveHome():this.formatNavigator.moveCursorLeft();break;case"ArrowRight":n?this.formatNavigator.moveEnd():this.formatNavigator.moveCursorRight();break;case"Home":this.formatNavigator.moveHome();break;case"End":this.formatNavigator.moveEnd();break}}processKeyPress(r){return this.keyTypeChecker.isIgnoreKey(r)?!1:this.keyTypeChecker.isMovementKey(r)?(this.processMovementKey(r),!1):(this.ruleProcessor.processKeyPress(r),!0)}}class vh{constructor(r,t=""){b(this,"instanceId");b(this,"instanceCollection");b(this,"keyProcessor");b(this,"formatNavigator");b(this,"formatRenderer");b(this,"inputSlotCollection");b(this,"inputRuleProcessor");b(this,"previousOutputValue","");b(this,"inputElementSet",!1);b(this,"isInputFocused",!1);b(this,"inputElement");b(this,"onFormatChange");this.inputValue=t,this.instanceId=dh(),this.instanceCollection=Pt.getInstance(),this.keyProcessor=new yh(r,this.instanceId),this.formatNavigator=this.instanceCollection.getNavigatorInstance(this.instanceId,r),this.formatRenderer=new mn(r,this.instanceId),this.inputSlotCollection=this.instanceCollection.getInputSlotInstance(this.instanceId,r),this.inputRuleProcessor=new ga(r,this.instanceId)}inputElementCreated(r){this.keyProcessor.setInputElement(r),this.formatNavigator.setInputElement(r),this.formatRenderer.setInputElement(r),this.inputElement=r,this.inputElementSet=!0,this.inputElementSet&&this.inputValue.length>0&&this.inputValuePassed(this.inputValue)}inputFocused(){this.isInputFocused=!0,this.formatRenderer.render(),setTimeout(()=>this.formatNavigator.findCursorPosition())}inputBlurred(){this.isInputFocused=!1}inputValuePassed(r){this.inputValue=r,this.inputElementSet&&(this.inputValue.length>0?this.inputRuleProcessor.processInputValue(r):(this.inputSlotCollection.clearAllSlots(),this.previousOutputValue=void 0),setTimeout(()=>{var t;this.formatRenderer.render(),this.isInputFocused&&this.formatNavigator.setCursorToCurrentPosition(),this.inputValue.length>0&&(this.previousOutputValue=(t=this.inputElement)==null?void 0:t.innerHTML)}))}registerFormatChangeEvent(r){this.onFormatChange=r}mouseUpHandler(){this.formatNavigator.findCursorPosition()}keyDownHandler(r){r.key!=="Tab"&&(r.preventDefault(),r.stopPropagation(),this.keyProcessor.processKeyPress(r)&&this.inputElement&&this.onFormatChange&&(this.inputSlotCollection.allSlotsCompleted()&&this.previousOutputValue!==this.inputElement.innerHTML?(this.previousOutputValue=this.inputElement.innerHTML,this.onFormatChange(this.inputElement.innerHTML)):this.inputSlotCollection.allSlotsEmpty()&&this.previousOutputValue!==void 0&&(this.previousOutputValue=void 0,this.onFormatChange())))}dispose(){this.instanceCollection.removeInstances(this.instanceId)}}const xh=(e,r)=>{const{value:t="",format:n,readOnly:s=!1,debounceTime:a=800,fillContainer:o=!0,leftElement:i,rightElement:c,className:l,leftElementClassName:h,rightElementClassName:m,isSingleLine:x=!1,allowSingleLineScroll:v=!1,isInputValid:w,onChange:D,onFocus:N,onBlur:S,onElementCreate:A,onLeftElementClick:B,onRightElementClick:F}=e,[g,$]=d.useState(!0),_=d.useRef(),W=d.useRef(),Y=d.useRef();d.useEffect(()=>()=>{var O;(O=Y.current)==null||O.dispose()},[]),d.useEffect(()=>{var O;(O=Y.current)==null||O.inputValuePassed(t)},[t]),d.useEffect(()=>{var O,se,y;(O=Y.current)==null||O.dispose(),n&&(Y.current=new vh(n,t),W.current&&((se=Y.current)==null||se.inputElementCreated(W.current)),(y=Y.current)==null||y.registerFormatChangeEvent(re))},[n]);const re=d.useCallback(O=>{w?w(O)?($(!0),D==null||D(O)):$(!1):D==null||D(O)},[D]),te=d.useCallback(O=>{var se;(se=Y.current)==null||se.inputFocused(),N==null||N(O)},[N]),U=d.useCallback(O=>{var se;(se=Y.current)==null||se.inputBlurred(),S==null||S(O)},[S]),E=d.useCallback(()=>{var O;(O=Y.current)==null||O.mouseUpHandler()},[]),P=d.useCallback(O=>{var se;(se=Y.current)==null||se.keyDownHandler(O)},[]),I=d.useCallback(O=>{var se,y,C,V,p,j,q,L,H;(y=(se=_.current)==null?void 0:se.inputElement)==null||y.removeEventListener("keydown",P),(V=(C=_.current)==null?void 0:C.inputElement)==null||V.removeEventListener("mouseup",E),_.current=O,(j=(p=_.current)==null?void 0:p.inputElement)==null||j.addEventListener("keydown",P),(L=(q=_.current)==null?void 0:q.inputElement)==null||L.addEventListener("mouseup",E),W.current=(H=_.current)==null?void 0:H.inputElement},[]),k=d.useCallback(()=>{var O;(O=_.current)==null||O.focus()},[]);d.useImperativeHandle(r,()=>({focus:k}));const G=ce(l,{"!bsc-border-error":!g});return f.jsx(sr,{ref:O=>O&&I(O),readOnly:s,debounceTime:a,fillContainer:o,leftElement:i,rightElement:c,className:G,leftElementClassName:h,rightElementClassName:m,isSingleLine:x,allowSingleLineScroll:v,onFocus:te,onBlur:U,onElementCreate:A,onLeftElementClick:B,onRightElementClick:F})},ya=d.forwardRef(xh),bn=d.createContext(void 0);function va(e,r,t=!0){var x,v;const n=Rs(e),s=Os(e),a=mf(e);let o=Xr(s)-(((x=r.options)==null?void 0:x.weekStartsOn)||0);o=o===-1?6:o;const i=Xr(a)-(((v=r.options)==null?void 0:v.weekStartsOn)||0),c=Sl({start:s,end:a}),l=n+o>35?6:5,h=xa(l,7,{dayValue:null,isCurrent:!0});let m=1;for(let w=0,D=l;w<D;w++){for(let N=w>0?0:o;N<7;N++){const S=c[m-1];if(S.setHours(e.getHours(),e.getMinutes(),e.getSeconds()),h[w][N].dayValue=S,++m>n)break}if(m>n)break}if(o>0&&t)for(let w=0;w<o;w++)h[0][w].dayValue=dd(s,o-w),h[0][w].isCurrent=!1;if(i>-1&&t)for(let w=6;w>i;w--)h[l-1][w].dayValue=vt(a,w-i),h[l-1][w].isCurrent=!1;return h}function xa(e,r,t){const n=[];for(let s=0,a=e;s<a;s++){const o=[];for(let i=0,c=r;i<c;i++){const l=wh(t)?t:{...t};o.push(l)}n.push(o)}return n}function wh(e){const r=typeof e;return r==="string"||r==="number"||r==="boolean"||e instanceof Date}function Th(e){var n;const r=hd(new Date,((n=e.options)==null?void 0:n.weekStartsOn)||0),t=[];for(let s=0;s<7;s++)t.push(vt(r,s).toLocaleDateString(e.code,{weekday:"short"}));return t}function Sh(e){const r=new Date(Date.UTC(2020,0,1)),t=[[{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""}],[{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""}],[{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""},{monthNumber:0,monthName:""}]];let n=0;for(let s=0;s<3;s++)for(let a=0;a<4;a++)t[s][a]={monthNumber:n,monthName:ct(r,n++).toLocaleDateString(e.code,{month:"short"})};return t}function Ph(e,r){const t=new Date(e.getTime()),n=Math.floor(t.getFullYear()/10)*10;t.setFullYear(n);const s=Pl({start:t,end:ar(t,9)}),a=xa(3,4,"");let o=0;for(let i=0;i<3;i++)for(let c=0;c<4&&(a[i][c]=s[o++].toLocaleDateString(r.code,{year:"numeric"}),o!==s.length);c++);return a}function Eh(e){const r=new Date;return r.setHours(0,0,0,0),r.toLocaleTimeString(e.code)}function kh(e,r,t){return e.getTime()>=r.getTime()&&e.getTime()<=t.getTime()}async function wa(e){return(await import(`/node_modules/date-fns/locale/${Ch(e)}`)).default}function Ch(e){const[r,t]=e.split("-");switch(r){case"af":return"af";case"ar":switch(t){case"DZ":return"ar-DZ";case"EG":return"ar-EG";case"MA":return"ar-MA";case"SA":return"ar-SA";case"TN":return"ar-TN";default:return"ar"}case"az":return"az";case"be":switch(t){case"tarask":return"be-tarask";default:return"be"}case"bg":return"bg";case"bn":return"bn";case"bs":return"bs";case"ca":return"ca";case"cs":return"cs";case"cy":return"cy";case"da":return"da";case"de":switch(t){case"AT":return"de-AT";default:return"de"}case"el":return"el";case"en":switch(t){case"AU":return"en-AU";case"CA":return"en-CA";case"GB":return"en-GB";case"IE":return"en-IE";case"IN":return"en-IN";case"NZ":return"en-NZ";case"US":return"en-US";default:return"en-ZA"}case"eo":return"eo";case"es":return"es";case"et":return"et";case"eu":return"eu";case"fa":return"fa-IR";case"fi":return"fi";case"fr":switch(t){case"CA":return"fr-CA";case"CH":return"fr-CH";default:return"fr"}case"fy":return"fy";case"gd":return"gd";case"gl":return"gl";case"gu":return"gu";case"he":return"he";case"hi":return"hi";case"hr":return"hr";case"ht":return"ht";case"hu":return"hu";case"hy":return"hy";case"id":return"id";case"is":return"is";case"it":switch(t){case"CH":return"it-CH";default:return"it"}case"ja":switch(t){case"Hira":return"ja-Hira";default:return"ja"}case"ka":return"ka";case"kk":return"kk";case"km":return"km";case"kn":return"kn";case"ko":return"ko";case"lb":return"lb";case"lt":return"lt";case"lv":return"lv";case"mk":return"mk";case"mn":return"mn";case"ms":return"ms";case"mt":return"mt";case"nb":return"nb";case"nl":switch(t){case"BE":return"nl-BE";default:return"nl"}case"nn":return"nn";case"oc":return"oc";case"pl":return"pl";case"pt":switch(t){case"BR":return"pt-BR";default:return"pt"}case"ro":return"ro";case"ru":return"ru";case"sk":return"sk";case"sl":return"sl";case"sq":return"sq";case"sr":switch(t){case"Latn":return"sr-Latn";default:return"sr"}case"sv":return"sv";case"ta":return"ta";case"te":return"te";case"th":return"th";case"tr":return"tr";case"ug":return"ug";case"uk":return"uk";case"uz":switch(t){case"Cyrl":return"uz-Cyrl";default:return"uz"}case"vi":return"vi";case"zh":switch(t){case"CN":return"zh-CN";case"HK":return"zh-HK";default:return"zh-TW"}default:return"en-AU"}}function zt(e,r){const t=pd(e);if(isNaN(t.valueOf())){let n=ze(e,"P pp",new Date,{locale:r});return!isNaN(n.valueOf())||(n=ze(e,"Pp",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=ze(e,"P HH:mm",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=ze(e,"P hh:mm a..aaa",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=ze(e,"P HH:mm:ss",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=ze(e,"P hh:mm:ss a..aaa",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=ze(e,"P",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=ze(e,"P p",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=ze(e,"pp",new Date,{locale:r}),!isNaN(n.valueOf()))||(n=ze(e,"p",new Date,{locale:r}),!isNaN(n.valueOf()))?n:void 0}return t}function Ta(e,r){const t=e.split("-");if(t.length!==2)return;const n=zt(t[0].trim(),r);if(!n)return;const s=zt(t[1].trim(),r);if(s)return[n,s]}var me=(e=>(e[e.DateTime=0]="DateTime",e[e.DateOnly=1]="DateOnly",e[e.TimeOnly=2]="TimeOnly",e[e.DateRange=3]="DateRange",e))(me||{}),Ut=(e=>(e[e.Day=0]="Day",e[e.Month=1]="Month",e[e.Year=2]="Year",e[e.Range=3]="Range",e))(Ut||{}),qt=(e=>(e[e.Short=0]="Short",e[e.Medium=1]="Medium",e[e.Long=2]="Long",e))(qt||{}),Se=(e=>(e[e.TwelveHour=0]="TwelveHour",e[e.TwentyFourHour=1]="TwentyFourHour",e))(Se||{}),nt=(e=>(e[e.Normal=0]="Normal",e[e.Range=1]="Range",e))(nt||{}),dr=(e=>(e[e.Right=0]="Right",e[e.Left=1]="Left",e[e.None=2]="None",e))(dr||{}),ee=(e=>(e[e.DaySelector=0]="DaySelector",e[e.MonthSelector=1]="MonthSelector",e[e.YearSelector=2]="YearSelector",e[e.TimeSelector=3]="TimeSelector",e[e.DateRangeSelector=4]="DateRangeSelector",e[e.SetViewDate=5]="SetViewDate",e[e.SetSelectedDate=6]="SetSelectedDate",e[e.SetSelectedDateRange=7]="SetSelectedDateRange",e[e.SetSelectedStartDate=8]="SetSelectedStartDate",e[e.SetSelectedEndDate=9]="SetSelectedEndDate",e[e.SetTimeFormat=10]="SetTimeFormat",e[e.ClearDates=11]="ClearDates",e[e.InitializeDates=12]="InitializeDates",e))(ee||{});const Dh=(e,r)=>{switch(r.type){case 0:return{...e,currentSelector:0,currentViewDate:r.viewDate||e.currentViewDate};case 1:return{...e,currentSelector:1,currentViewDate:r.viewDate||e.currentViewDate};case 2:return{...e,currentSelector:2};case 3:return{...e,currentSelector:3};case 4:return{...e,currentSelector:4,currentViewDate:r.viewDate||e.currentViewDate};case 5:return{...e,currentViewDate:r.viewDate||new Date,dateInitialized:!0};case 6:return{...e,selectedDate:r.selectedDate||e.selectedDate,currentViewDate:r.viewDate||e.currentViewDate};case 7:return{...e,selectedStartDate:r.selectedStartDate||e.selectedStartDate,selectedEndDate:r.selectedEndDate||e.selectedEndDate};case 8:return{...e,selectedStartDate:r.selectedStartDate,selectedEndDate:void 0};case 9:return{...e,selectedEndDate:r.selectedEndDate};case 10:return{...e,timeFormat:r.timeFormat||e.timeFormat};case 11:return{currentSelector:e.currentSelector,currentViewDate:e.currentViewDate,timeFormat:e.timeFormat,dateInitialized:!0};case 12:{const t={...e,currentViewDate:Oh(r.initialDate),dateInitialized:!0};return Array.isArray(r.initialDate)?{...t,selectedStartDate:r.initialDate[0],selectedEndDate:r.initialDate[1]}:{...t,selectedDate:r.initialDate}}default:return{...e,currentSelector:0}}};function Oh(e){return e?Array.isArray(e)?e[0]:e:new Date}const hr=({viewDate:e,selectedDate:r,selectedStartDate:t,selectedEndDate:n,selectionMode:s=nt.Normal,locale:a,onDateSelected:o,selectableDate:i,isValidDate:c,dispatcher:l})=>{var I;const[h,m]=d.useState(!1),[x,v]=d.useState(),[w,D]=d.useState(),[N,S]=d.useState(),[A,B]=d.useState(),F=d.useRef(),g=d.useRef(),$=d.useContext(bn),_=d.useMemo(()=>$.calendarTemplate,[$.calendarTemplate]),W=async()=>a||await wa(Vs());d.useEffect(()=>{W().then(k=>{F.current=k,g.current=Th(F.current),m(!0)}).catch(k=>console.error(k))},[]),d.useEffect(()=>{e&&F.current&&S(va(e,F.current,s===nt.Normal))},[e,h]),d.useEffect(()=>{B(r?new Date(r.getFullYear(),r.getMonth(),r.getDate()):void 0)},[r]),d.useEffect(()=>{v(t?new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0).getTime():void 0),D(n?new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59).getTime():void 0)},[t,n]),d.useEffect(()=>{F.current&&a&&(F.current=a,S(va(e,F.current,s===nt.Normal)))},[a]);const Y=k=>{if(s===nt.Normal)l==null||l({type:ee.SetSelectedDate,selectedDate:k,viewDate:k}),o==null||o(k);else{if(!o)throw new Error("Range selection mode requires onDateSelected to be set");!t||bf(k,t)?o(k):t&&!n?o(k,{setEndDate:!0}):t&&n&&o(k)}},re=k=>(A==null?void 0:A.toLocaleDateString())===k.toLocaleDateString(),te=k=>{if(x&&w){const G=k.getTime();return G>=x&&G<=w}return!1},U={viewDate:e,selectedDate:r,selectedStartDate:t,selectedEndDate:n,selectionMode:s,locale:a,weekDays:g.current,monthMatrix:N,selectableDate:i,isValidDate:c,onDateClicked:Y,isSelectedDate:re,isInSelectedDateRange:te},P=_||((k,G)=>f.jsx("div",{className:"bc-dt-calendar bsc-w-full",children:G}));return f.jsx(wt,{props:U,template:P,children:f.jsxs("div",{className:"bc-dt-day-row bsc-grid bsc-min-w-[329px] bsc-grid-cols-7 bsc-gap-3",children:[(I=g.current)==null?void 0:I.map((k,G)=>f.jsx("div",{className:"bc-dt-day-cell bsc-text-center bsc-font-bold",children:k},G)),N==null?void 0:N.map((k,G)=>k.map((O,se)=>{var V,p;const y=O.dayValue!==null&&(i===void 0||i(O.dayValue)),C=ce("bsc-text-center bsc-py-1",{"bsc-text-gray-3":!O.isCurrent,"bsc-bg-primary-3 dark:bsc-bg-mono-light-1 dark:bsc-text-mono-dark-1":O&&O.dayValue&&(A&&re(O.dayValue)||x&&!w&&Ds(x,O.dayValue)||x&&w&&te(O.dayValue)),"bsc-cursor-pointer":y,"bsc-text-error bsc-cursor-not-allowed":!y,"bsc-bg-primary-5 dark:bsc-bg-mono-light-3 dark:bsc-text-mono-dark-1":O.dayValue&&fd(O.dayValue)&&!(re(O.dayValue)||te(O.dayValue))},"bc-dt-date-cell");return f.jsx("div",{className:C,onClick:()=>O&&O.dayValue&&y&&(c===void 0||c(O.dayValue))&&Y(O.dayValue),children:(p=O.dayValue)==null?void 0:p.getDate().toLocaleString((V=F.current)==null?void 0:V.code)},G.toString()+se.toString())}))]})})},pr=({title:e,scrollerType:r,onTitleClicked:t,onMovePrevious:n,onMoveNext:s})=>{const o=d.useContext(bn).dateScrollerTemplate,i={title:e,scrollerType:r,onTitleClicked:t,onMovePrevious:n,onMoveNext:s},l=o||((h,m)=>f.jsx("div",{className:"bc-dt-scroller bsc-flex bsc-w-full bsc-flex-row bsc-items-center bsc-px-2 bsc-py-1",children:m}));return f.jsxs(wt,{props:i,template:l,children:[f.jsx("div",{className:"bc-dt-scroller-left bsc-flex-shrink bsc-cursor-pointer",children:f.jsx(We,{className:"bsc-bg-transparent focus:bsc-outline-none",onClick:n,children:f.jsx(Re,{icon:"chevronLeft",size:_e.Regular})})}),f.jsx("div",{className:"bc-dt-scroller-title bsc-flex-grow bsc-cursor-pointer bsc-text-center",onClick:t,children:e}),f.jsx("div",{className:"bc-dt-scroller-right bsc-flex-shrink bsc-cursor-pointer",children:f.jsx(We,{className:"bsc-bg-transparent focus:bsc-outline-none",onClick:s,children:f.jsx(Re,{icon:"chevronRight",size:_e.Regular})})})]})},Nh=({selectedDate:e,viewDate:r,locale:t,showTimeSelector:n,selectableDate:s,isValidDate:a,onChange:o,dispatcher:i})=>{const c=()=>{r&&i({type:ee.SetViewDate,viewDate:Hs(r,1)})},l=()=>{r&&i({type:ee.SetViewDate,viewDate:ct(r,1)})},h=()=>{i({type:ee.MonthSelector})},m=()=>{i({type:ee.TimeSelector})},x=()=>r?r.toLocaleDateString(t.code,{month:"long",year:"numeric"}):"";return f.jsxs("div",{className:"bc-dt-day-selector bsc-p-2",children:[f.jsx(pr,{title:x(),scrollerType:Ut.Day,onTitleClicked:h,onMovePrevious:c,onMoveNext:l}),f.jsx(hr,{viewDate:r,selectedDate:e,locale:t,selectableDate:s,isValidDate:a,onDateSelected:o,dispatcher:i}),n&&f.jsx("div",{className:"bc-dt-time-value-wrapper bsc-flex bsc-w-full bsc-flex-row bsc-justify-center bsc-p-2",children:f.jsx("div",{className:"bc-dt-time-value bsc-cursor-pointer bsc-p-2 hover:bsc-bg-gray-4 dark:bsc-bg-mono-dark-1 dark:bsc-text-mono-light-1 dark:hover:bsc-bg-mono-light-2 dark:hover:bsc-text-mono-dark-2",onClick:m,children:(e==null?void 0:e.toLocaleTimeString(t.code))||Eh(t)})})]})},_h=({viewDate:e,locale:r,dateSelection:t=me.DateTime,dispatcher:n})=>{const s=d.useRef(Sh(r)),a=()=>{const h=Ws(e,1);n({type:ee.SetViewDate,viewDate:h})},o=()=>{const h=ar(e,1);n({type:ee.SetViewDate,viewDate:h})},i=h=>{n({type:t!==me.DateRange?ee.DaySelector:ee.DateRangeSelector,viewDate:Nd(e,h)})},c=()=>e.toLocaleDateString(r.code,{year:"numeric"}),l=()=>{n({type:ee.YearSelector})};return f.jsxs("div",{className:"bc-dt-month-selector bsc-p-2",style:{minWidth:"20rem"},children:[f.jsx(pr,{title:c(),scrollerType:Ut.Month,onTitleClicked:l,onMovePrevious:a,onMoveNext:o}),f.jsx("div",{className:"bc-dt-month-grid bsc-grid bsc-w-full bsc-grid-cols-4 bsc-gap-4",children:s.current.map((h,m)=>h.map((x,v)=>f.jsx("div",{className:"bc-dt-month-cell bsc-cursor-pointer bsc-text-center",onClick:()=>i(x.monthNumber),children:x.monthName},m.toString()+v.toString())))})]})},Ih=({viewDate:e,selectedStartDate:r,selectedEndDate:t,locale:n,onChange:s,dispatcher:a})=>{const o=cr("screen and (max-device-width: 40rem)"),i=ct(e,1),c=(v,w)=>{!w||!w.setEndDate?a({type:ee.SetSelectedStartDate,selectedStartDate:v}):(a({type:ee.SetSelectedEndDate,selectedEndDate:v}),r&&(s==null||s([r,v])))},l=()=>{a({type:ee.MonthSelector})},h=()=>o?`${e.toLocaleDateString(n.code,{month:"long"})} ${e.toLocaleDateString(n.code,{year:"numeric"})}`:`${e.toLocaleDateString(n.code,{month:"long"})} ${e.toLocaleDateString(n.code,{year:"numeric"})} - ${i.toLocaleDateString(n.code,{month:"long"})} ${i.toLocaleDateString(n.code,{year:"numeric"})}`,m=()=>{e&&a({type:ee.SetViewDate,viewDate:Hs(e,1)})},x=()=>{e&&a({type:ee.SetViewDate,viewDate:ct(e,1)})};return f.jsxs("div",{className:"bc-dt-range-selector bsc-flex bsc-flex-col",children:[f.jsx("div",{className:"bc-dt-range-scroller-wrapper bsc-flex-shrink",children:f.jsx(pr,{title:h(),scrollerType:Ut.Range,onTitleClicked:l,onMovePrevious:m,onMoveNext:x})}),f.jsx("div",{className:"bsc-flex-grow",children:f.jsx(nn,{mobileMarkup:f.jsx("div",{className:"bc-dt-range-calendar bsc-px-2 bsc-py-1",children:f.jsx(hr,{viewDate:e,selectedStartDate:r,selectedEndDate:t,selectionMode:nt.Range,onDateSelected:c,locale:n,dispatcher:a})}),aboveMobileMarkup:f.jsxs("div",{className:"bc-dt-range-wrapper bsc-flex bsc-flex-row bsc-px-2 bsc-py-1",children:[f.jsx("div",{className:"bc-dt-range-calendar-1 bsc-border-r bsc-border-solid bsc-border-gray-3 bsc-pr-4",children:f.jsx(hr,{viewDate:e,selectedStartDate:r,selectedEndDate:t,selectionMode:nt.Range,onDateSelected:c,locale:n,dispatcher:a})}),f.jsx("div",{className:"bc-dt-range-calendar-2 bsc-pl-4",children:f.jsx(hr,{viewDate:i,selectedStartDate:r,selectedEndDate:t,selectionMode:nt.Range,onDateSelected:c,locale:n,dispatcher:a})})]})})})]})},jh=({viewDate:e,showDateSelector:r,locale:t,timeFormat:n=Se.TwelveHour,timeConstraints:s,onChange:a,dispatcher:o})=>{const i=d.useRef(n===Se.TwelveHour?11:23),c=d.useRef(n===Se.TwelveHour?["12","01","02","03","04","05","06","07","08","09","10","11"]:["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"]),l=d.useRef(Id(0,59,E=>E.toString().padStart(2,"0"))),h=d.useRef(["AM","PM"]),m=d.useRef(ll(e)),x=E=>E>11?E-12:E,[v,w]=d.useState(x(e.getHours())),[D,N]=d.useState(e.getMinutes()),[S,A]=d.useState(e.getHours()<=12?0:1),B=d.useRef(e.toLocaleDateString(t.code));d.useEffect(()=>{const E=e.getHours(),P=e.getMinutes();if(E!==v&&w(n===Se.TwelveHour?x(E):E),P!==D&&N(P),n===Se.TwelveHour){const I=E<=11?0:1;I!==S&&A(I)}},[e]);const F=()=>{var I;const E=((I=s==null?void 0:s.hours)==null?void 0:I.step)||1,P=v<i.current?v+E:0;w(P),Y(P,D,S)},g=()=>{var I;const E=((I=s==null?void 0:s.hours)==null?void 0:I.step)||1,P=v>0?v-E:i.current;w(P),Y(P,D,S)},$=()=>{var I,k,G;const E=((I=s==null?void 0:s.minutes)==null?void 0:I.step)||1,P=D+E<(((k=s==null?void 0:s.minutes)==null?void 0:k.max)||59)?D+E:((G=s==null?void 0:s.minutes)==null?void 0:G.min)||0;N(P),Y(v,P,S)},_=()=>{var I,k,G;const E=((I=s==null?void 0:s.minutes)==null?void 0:I.step)||1,P=D-E>=(((k=s==null?void 0:s.minutes)==null?void 0:k.min)||0)?D-E:(((G=s==null?void 0:s.minutes)==null?void 0:G.max)||60)-E;N(P),Y(v,P,S)},W=()=>{const E=S===0?1:0;A(E),Y(v,D,E)},Y=(E,P,I)=>{const k=n===Se.TwelveHour&&I===1?E+12:E;m.current.setHours(k,P),o({type:ee.SetSelectedDate,selectedDate:m.current,viewDate:m.current}),a==null||a(m.current)},re=()=>{o({type:ee.DaySelector})},te=ce("bsc-w-full bsc-grid bsc-grid-rows-3 bsc-gap-4 bc-dt-time-grid",{"bsc-grid-cols-4":n===Se.TwelveHour,"bsc-grid-cols-3":n===Se.TwentyFourHour}),U=ce("bsc-text-center bsc-cursor-pointer hover:bsc-bg-gray-4 dark:bsc-text-mono-light-1 dark:hover:bsc-bg-mono-light-1 dark:hover:bsc-text-mono-dark-1 bc-dt-time-date-value",{"bsc-col-span-4":n===Se.TwelveHour,"bsc-col-span-3":n===Se.TwentyFourHour});return f.jsx("div",{className:"bc-dt-time-selector bsc-flex bsc-flex-row bsc-justify-center bsc-p-2",style:{minWidth:n===Se.TwelveHour?"15rem":"11rem"},children:f.jsxs("div",{className:te,children:[r&&f.jsx("div",{className:U,onClick:re,children:B.current}),f.jsx("div",{className:"bc-dt-time-hour-increase bsc-cursor-pointer bsc-text-center",children:f.jsx(We,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:F,children:f.jsx(Re,{icon:"chevronUp",size:_e.Regular})})}),f.jsx("div",{}),f.jsx("div",{className:"bc-dt-time-minute-increase bsc-cursor-pointer bsc-text-center",children:f.jsx(We,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:$,children:f.jsx(Re,{icon:"chevronUp",size:_e.Regular})})}),n===Se.TwelveHour&&f.jsx("div",{className:"bc-dt-time-meridian-increase bsc-cursor-pointer bsc-text-center",children:f.jsx(We,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:W,children:f.jsx(Re,{icon:"chevronUp",size:_e.Regular})})}),f.jsx("div",{className:"bc-dt-time-hour-value bsc-text-center",children:c.current[v]}),f.jsx("div",{className:"bc-dt-time-separator bsc-text-center",children:":"}),f.jsx("div",{className:"bc-dt-time-minute-value bsc-text-center",children:l.current[D]}),n===Se.TwelveHour&&f.jsx("div",{className:"bc-dt-time-meridian-value bsc-text-center",children:h.current[S]}),f.jsx("div",{className:"bc-dt-time-hour-decrease bsc-cursor-pointer bsc-text-center",children:f.jsx(We,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:g,children:f.jsx(Re,{icon:"chevronDown",size:_e.Regular})})}),f.jsx("div",{}),f.jsx("div",{className:"bc-dt-time-minute-decrease bsc-cursor-pointer bsc-text-center",children:f.jsx(We,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:_,children:f.jsx(Re,{icon:"chevronDown",size:_e.Regular})})}),n===Se.TwelveHour&&f.jsx("div",{className:"bc-dt-time-meridian-decrease bsc-cursor-pointer bsc-text-center",children:f.jsx(We,{className:"bsc-bg-transparent bsc-p-2 focus:bsc-outline-none",onClick:W,children:f.jsx(Re,{icon:"chevronDown",size:_e.Regular})})})]})})},Mh=({viewDate:e,locale:r,dispatcher:t})=>{const n=Ph(e,r),s=()=>{const c=Ws(e,10);t({type:ee.SetViewDate,viewDate:c})},a=()=>{const c=ar(e,10);t({type:ee.SetViewDate,viewDate:c})},o=c=>{const l=parseInt(c);t({type:ee.MonthSelector,viewDate:_d(e,l)})},i=()=>`${n[0][0].toString()} - ${n[2][1].toString()}`;return f.jsxs("div",{className:"bc-dt-year-selector",style:{minWidth:"20rem"},children:[f.jsx(pr,{title:i(),scrollerType:Ut.Year,onMovePrevious:s,onMoveNext:a}),f.jsx("div",{className:"bc-dt-year-wrapper bsc-w-full",children:f.jsx("div",{className:"bc-dt-year-grid bsc-grid bsc-grid-cols-4 bsc-gap-4",children:n.map((c,l)=>c.map((h,m)=>h.length>0?f.jsx("div",{className:"bc-dt-year-cell bsc-cursor-pointer bsc-text-center",onClick:()=>o(h),children:h},l.toString()+m.toString()):f.jsx("div",{},l.toString()+m.toString())))})})]})};class Rh{constructor(r,t){b(this,"dateFormat");b(this,"timeFormat");b(this,"use24HourTime");b(this,"monthPart");b(this,"dayPart");b(this,"yearPart");b(this,"twelveHourPart");b(this,"twentyFourHourPart");b(this,"minutePart");b(this,"meridianPart");this.dateSelection=r;const n=2023,s=12,a=20,i=new Date(n,s-1,a).toLocaleDateString(t,{year:"numeric",month:"numeric",day:"numeric"});this.dateFormat=i.replace(`${n}`,"YYYY").replace(`${s}`,"MM").replace(`${a}`,"DD");const c=new Date,l=18,h=24,m=37,x=317;c.setHours(l,h,m,x);const v=c.toLocaleTimeString(t);this.use24HourTime=v.startsWith("18"),this.timeFormat=v.replace(`${this.use24HourTime?l:"6"}`,"HH").replace(`${h}`,"MM").replace(`${m}`,"SS").replace(`${x}`,"LLL"),this.createDateParts()}get is24HourTime(){return this.use24HourTime}createInputFormat(){const r={deleteShiftsFormatPart:!1,formatParts:[]};switch(this.dateSelection){case me.DateOnly:return this.createDateFormat(r);case me.TimeOnly:return this.createTimeFormat(r);case me.DateRange:return this.createDateRangeFormat(r);case me.DateTime:return this.createDateTimeFormat(r)}}createDateFormat(r){return this.dateFormat.startsWith("MM")?r.formatParts.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?r.formatParts.push(...this.createDayMonthYearFormatParts()):r.formatParts.push(...this.createYearMonthDayFormatParts()),r}createTimeFormat(r){return this.use24HourTime?r.formatParts.push(...this.createTwentyFourHourFormatParts()):r.formatParts.push(...this.createTwelveHourFormatParts()),r}createDateRangeFormat(r){const t=[];this.dateFormat.startsWith("MM")?t.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?t.push(...this.createDayMonthYearFormatParts()):t.push(...this.createYearMonthDayFormatParts());const n={characterCount:3,placeholder:" - ",inputText:" - ",isSeparator:!0};return r.formatParts.push(...t,n,...t),r}createDateTimeFormat(r){this.dateFormat.startsWith("MM")?r.formatParts.push(...this.createMonthDayYearFormatParts()):this.dateFormat.startsWith("DD")?r.formatParts.push(...this.createDayMonthYearFormatParts()):r.formatParts.push(...this.createYearMonthDayFormatParts());const t={characterCount:1,placeholder:" ",inputText:" ",isSeparator:!0};return r.formatParts.push(t),this.use24HourTime?r.formatParts.push(...this.createTwentyFourHourFormatParts()):r.formatParts.push(...this.createTwelveHourFormatParts()),r}createMonthDayYearFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let r=this.dateFormat.replace("MM",""),t=r.indexOf("DD"),n=r.substring(0,t);r=r.replace(n,"").replace("DD","");const s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};t=r.indexOf("YYYY"),n=r.substring(0,t);const a={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.monthPart,s,this.dayPart,a,this.yearPart]}return[]}createDayMonthYearFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let r=this.dateFormat.replace("DD",""),t=r.indexOf("MM"),n=r.substring(0,t);r=r.replace(n,"").replace("MM","");const s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};t=r.indexOf("YYYY"),n=r.substring(0,t);const a={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.dayPart,s,this.monthPart,a,this.yearPart]}return[]}createYearMonthDayFormatParts(){if(this.monthPart&&this.dayPart&&this.yearPart){let r=this.dateFormat.replace("YYYY",""),t=r.indexOf("MM"),n=r.substring(0,t);r=r.replace(n,"").replace("MM","");const s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};t=r.indexOf("DD"),n=r.substring(0,t);const a={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.yearPart,s,this.monthPart,a,this.dayPart]}return[]}createTwelveHourFormatParts(){if(this.twelveHourPart&&this.minutePart&&this.meridianPart){const r=this.timeFormat.replace("HH",""),t=r.indexOf("MM"),n=r.substring(0,t),s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0},a={characterCount:1,placeholder:" ",inputText:" ",isSeparator:!0};return[this.twelveHourPart,s,this.minutePart,a,this.meridianPart]}return[]}createTwentyFourHourFormatParts(){if(this.twentyFourHourPart&&this.minutePart){const r=this.timeFormat.replace("HH",""),t=r.indexOf("MM"),n=r.substring(0,t),s={characterCount:n.length,placeholder:n,inputText:n,isSeparator:!0};return[this.twentyFourHourPart,s,this.minutePart]}return[]}createDateParts(){this.monthPart={characterCount:2,placeholder:"M",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Ue.Numeric,minimumValue:1,maximumValue:12,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.dayPart={characterCount:2,placeholder:"D",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Ue.Numeric,minimumValue:1,maximumValue:31,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.yearPart={characterCount:4,placeholder:"Y",inputText:"_",isSeparator:!1,allCharactersRequired:!0,valueType:Ue.Numeric},this.twelveHourPart={characterCount:2,placeholder:"H",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Ue.Numeric,minimumValue:1,maximumValue:12,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.twentyFourHourPart={characterCount:2,placeholder:"H",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Ue.Numeric,minimumValue:0,maximumValue:23,exceedingMaximumValueCausesTab:!0,padWithZeros:!0},this.minutePart={characterCount:2,placeholder:"M",inputText:"_",isSeparator:!1,allCharactersRequired:!1,valueType:Ue.Numeric,minimumValue:0,maximumValue:59,exceedingMaximumValueCausesError:!0,padWithZeros:!0},this.meridianPart={characterCount:2,inputText:"_",isSeparator:!1,valueType:Ue.Text,possibleValues:["AM","PM"]}}}const Ah=(e,r)=>{var a;const[t,n]=d.useState(),s=d.useRef();return d.useEffect(()=>{r&&!t&&(s.current=new Rh(e,r),n(s.current.createInputFormat()))},[r]),[t,(a=s.current)==null?void 0:a.is24HourTime]},Lh=({value:e,readOnly:r=!1,label:t,useDefaultDateValue:n=!1,useFormattedInput:s=!1,allowClear:a=!1,closeSelector:o=!1,locale:i,className:c,dateSelection:l=me.DateTime,dateFormat:h,timeConstraints:m,icon:x,iconPosition:v=dr.Right,inputElement:w,selectableDate:D,isValidDate:N,onChange:S,calendarTemplate:A,dateScrollerTemplate:B,inputTemplate:F})=>{const[g,$]=d.useState(!1),[_,W]=d.useState(),[Y,re]=d.useState(),te=d.useRef(),U=d.useRef(!1),E=d.useRef(i||Vs()),P=d.useRef(),I=d.useRef(),k=d.useRef(),[G,O]=Ah(l,_),se=d.useRef({calendarTemplate:A,dateScrollerTemplate:B});d.useEffect(()=>{E.current&&y(E.current)},[E]),d.useEffect(()=>{i&&y(i)},[i]),d.useEffect(()=>{if(e){const J=C();j({type:ee.InitializeDates,initialDate:J})}else j({type:ee.ClearDates})},[e,P.current]),d.useEffect(()=>{O&&j({type:ee.SetTimeFormat,timeFormat:O?Se.TwentyFourHour:Se.TwelveHour})},[O]),d.useEffect(()=>{w&&(I.current=w)},[w]);const y=J=>{wa(J).then(pe=>{W(pe.code),P.current=pe;const Ae=C();j(e||n?{type:ee.InitializeDates,initialDate:Array.isArray(Ae)?Ae[0]:Ae}:{type:ee.SetViewDate,viewDate:Array.isArray(Ae)?Ae[0]:Ae})}).catch(pe=>console.error(pe))},C=()=>{const J=new Date;return J.setHours(0,0,0,0),e?typeof e=="string"?l!==me.DateRange?zt(e,P.current):Ta(e,P.current):e:J},V={currentSelector:l===me.TimeOnly?ee.TimeSelector:l===me.DateTime||l===me.DateOnly?ee.DaySelector:ee.DateRangeSelector,currentViewDate:new Date,timeFormat:Se.TwelveHour,dateInitialized:!1},[p,j]=d.useReducer(Dh,V),q=()=>{dt(),$(!0)},L=d.useMemo(()=>Ft(()=>{$(!1)},250),[]),H=d.useMemo(()=>Ft(()=>{L.cancel()},5),[L]),z=J=>{const pe=J.target.innerText;ke(pe)},X=J=>{if(J){const pe=zt(J,P.current);return pe?N?N(pe):!0:!1}else return!0},Q=J=>{ke(J||"")},ke=J=>{const pe=l!==me.DateRange?zt(J,P.current):Ta(J,P.current);pe?(Array.isArray(pe)?(kh(pe[0],Os(p.currentViewDate),Tl(ct(p.currentViewDate,1)))||j({type:ee.SetViewDate,viewDate:pe[0]}),j({type:ee.SetSelectedDateRange,selectedStartDate:pe[0],selectedEndDate:pe[1]})):j({type:ee.SetSelectedDate,selectedDate:pe,viewDate:pe}),S==null||S(pe)):J===""&&(j({type:ee.ClearDates}),S==null||S())},M=J=>{l===me.DateOnly&&o===!0&&$(!1),S==null||S(J)},Ie=()=>{dt(),$(!g)},Ke=()=>{j({type:ee.ClearDates}),$(!1),S==null||S()},He=(J,pe)=>{(!I.current||te.current!==pe)&&(I.current=J,te.current=pe,U.current=!0)},dt=()=>{(!k.current||U.current)&&I.current&&(k.current=I.current,re(I.current),U.current=!1)},Zt=()=>{$(!1),j({type:l===me.TimeOnly?ee.TimeSelector:l===me.DateTime||l===me.DateOnly?ee.DaySelector:ee.DateRangeSelector})},vr=()=>{switch(h){case qt.Short:return"short";case qt.Medium:return"medium";case qt.Long:return"long";default:return}},Xe=()=>{var pe,Ae,Ct,Tr,Sr,Pr,Er,kr,Cr,Dr,Dt,Kt;const J=vr();switch(l){case me.DateTime:return p.selectedDate?J?p.selectedDate.toLocaleString((pe=P.current)==null?void 0:pe.code,{dateStyle:J,timeStyle:J}):p.selectedDate.toLocaleString((Ae=P.current)==null?void 0:Ae.code):"";case me.DateOnly:return p.selectedDate?J?p.selectedDate.toLocaleDateString((Ct=P.current)==null?void 0:Ct.code,{dateStyle:J}):p.selectedDate.toLocaleDateString((Tr=P.current)==null?void 0:Tr.code):"";case me.TimeOnly:return p.selectedDate?J?p.selectedDate.toLocaleTimeString((Sr=P.current)==null?void 0:Sr.code,{timeStyle:J,hour12:p.timeFormat===Se.TwelveHour,hourCycle:p.timeFormat===Se.TwentyFourHour?"h23":void 0}):p.selectedDate.toLocaleTimeString((Pr=P.current)==null?void 0:Pr.code,{hour12:p.timeFormat===Se.TwelveHour,hourCycle:p.timeFormat===Se.TwentyFourHour?"h23":void 0}):"";case me.DateRange:return p.selectedStartDate&&p.selectedEndDate?J?`${p.selectedStartDate.toLocaleDateString((Er=P.current)==null?void 0:Er.code,{dateStyle:J})} - ${p.selectedEndDate.toLocaleDateString((kr=P.current)==null?void 0:kr.code,{dateStyle:J})}`:`${p.selectedStartDate.toLocaleDateString((Cr=P.current)==null?void 0:Cr.code)} - ${p.selectedEndDate.toLocaleDateString((Dr=P.current)==null?void 0:Dr.code)}`:"";default:return p.selectedDate?J?p.selectedDate.toLocaleString((Dt=P.current)==null?void 0:Dt.code,{dateStyle:J,timeStyle:J}):p.selectedDate.toLocaleString((Kt=P.current)==null?void 0:Kt.code):""}},kt=l===me.DateTime||l===me.DateOnly||l===me.DateRange,gn=l===me.DateTime||l===me.TimeOnly,Je=v===dr.None?{}:v===dr.Right?{rightElement:f.jsxs("div",{className:"bsc-flex bsc-text-black dark:bsc-text-mono-light-1",children:[a&&!r&&f.jsx("div",{children:f.jsx(Re,{icon:"close",size:_e.Small,className:"bsc-cursor-pointer bsc-text-sm",onClick:Ke})}),f.jsx("div",{className:"bsc-ml-2",children:x||f.jsx(Re,{icon:"calendar",size:_e.Small,className:r?void 0:"bsc-cursor-pointer",onClick:r?void 0:Ie})})]}),rightElementClassName:"bsc-justify-center"}:{leftElement:f.jsxs("div",{className:"bsc-flex bsc-text-black dark:bsc-text-mono-light-1",children:[f.jsx("div",{className:"bsc-mr-2",children:x||f.jsx(Re,{icon:"calendar",size:_e.Small,className:r?void 0:"bsc-cursor-pointer",onClick:r?void 0:Ie})}),a&&!r&&f.jsx("div",{children:f.jsx(Re,{icon:"close",size:_e.Small,className:"bsc-cursor-pointer bsc-text-sm",onClick:Ke})})]}),leftElementClassName:"bsc-justify-center"},xr=()=>f.jsxs(f.Fragment,{children:[p.currentSelector===ee.DaySelector&&kt&&p.dateInitialized&&P.current&&f.jsx(Nh,{selectedDate:p.selectedDate,viewDate:p.currentViewDate,locale:P.current,showTimeSelector:l===me.DateTime,selectableDate:D,isValidDate:N,dispatcher:j,onChange:M}),p.currentSelector===ee.MonthSelector&&kt&&p.dateInitialized&&P.current&&f.jsx(_h,{viewDate:p.currentViewDate,locale:P.current,dateSelection:l,dispatcher:j}),p.currentSelector===ee.YearSelector&&kt&&p.dateInitialized&&P.current&&f.jsx(Mh,{viewDate:p.currentViewDate,locale:P.current,dispatcher:j}),p.currentSelector===ee.TimeSelector&&gn&&p.dateInitialized&&P.current&&f.jsx(jh,{viewDate:p.currentViewDate,showDateSelector:l===me.DateTime,locale:P.current,timeFormat:p.timeFormat,timeConstraints:m,onChange:S,dispatcher:j}),p.currentSelector===ee.DateRangeSelector&&kt&&p.dateInitialized&&P.current&&f.jsx(Ih,{viewDate:p.currentViewDate,selectedStartDate:p.selectedStartDate,selectedEndDate:p.selectedEndDate,locale:P.current,onChange:S,dispatcher:j})]}),wr={label:t,readOnly:r,allowClear:a,getValue:Xe,onFocus:q,onInput:z,iconPosition:v,iconElement:Je.rightElement||Je.leftElement},Qt=F||((J,pe)=>f.jsx(f.Fragment,{children:pe})),et=ce("bsc-text-left",{"bc-read-only bsc-bg-gray-4 dark:bsc-bg-mono-dark-3":r,"bsc-bg-white dark:bsc-bg-mono-dark-1":!r},"bc-dt-input",c);return f.jsx(bn.Provider,{value:se.current,children:f.jsxs("div",{className:"bc-date-time",children:[t&&f.jsx(qe,{label:t,readOnly:r,className:"bc-dt-label"}),f.jsx(nn,{mobileMarkup:f.jsxs(f.Fragment,{children:[f.jsx(wt,{props:wr,template:Qt,children:f.jsx(sr,{value:Xe(),readOnly:r,inputMode:"none",className:et,onFocus:q,onElementCreate:J=>He(J,!1),...Je})}),f.jsx(fa,{visible:g,target:Y,hidden:Zt,unmountWhenHidden:!0,children:xr()})]}),aboveMobileMarkup:f.jsxs(f.Fragment,{children:[f.jsx(wt,{props:wr,template:Qt,children:s===!1?f.jsx(sr,{value:Xe(),readOnly:r,className:et,onFocus:q,onBlur:L,onInput:z,onElementCreate:J=>He(J,!1),...Je}):f.jsx(ya,{value:Xe(),readOnly:r,className:et,format:G,isInputValid:X,onFocus:q,onBlur:L,onChange:Q,onElementCreate:J=>He(J,!0),...Je})}),f.jsx(pa,{visible:g,target:Y,shouldTargetCloseOverlay:!1,shouldScrollCloseOverlay:!0,shouldCheckZIndex:!0,shouldRemainOnScreen:!0,hidden:Zt,isClickedWithin:H,unmountWhenHidden:!0,children:xr()})]})})]})})};function ft(e,r){var t,n;if(typeof r=="function")n=r(e),n!==void 0&&(e=n);else if(Array.isArray(r))for(t=0;t<r.length;t++)n=r[t](e),n!==void 0&&(e=n);return e}function $h(e,r){return e[0]==="-"&&Array.isArray(r)&&/^-\d+$/.test(e)?r.length+parseInt(e,10):e}function Fh(e){return/^\d+$/.test(e)}function mr(e){return Object.prototype.toString.call(e)==="[object Object]"}function Gt(e){return Object(e)===e}function br(e){return Object.keys(e).length===0}var Yh=["__proto__","prototype","constructor"],Hh=function(e){return Yh.indexOf(e)===-1};function gr(e,r){e.indexOf("[")>=0&&(e=e.replace(/\[/g,r).replace(/]/g,""));var t=e.split(r),n=t.filter(Hh);if(n.length!==t.length)throw Error("Refusing to update blacklisted property "+e);return t}var Sa=Object.prototype.hasOwnProperty;function oe(e,r,t,n){if(!(this instanceof oe))return new oe(e,r,t,n);typeof r>"u"&&(r=!1),typeof t>"u"&&(t=!0),typeof n>"u"&&(n=!0),this.separator=e||".",this.override=r,this.useArray=t,this.useBrackets=n,this.keepArray=!1,this.cleanup=[]}var Et=new oe(".",!1,!0,!0);function Ye(e){return function(){return Et[e].apply(Et,arguments)}}oe.prototype._fill=function(e,r,t,n){var s=e.shift();if(e.length>0){if(r[s]=r[s]||(this.useArray&&Fh(e[0])?[]:{}),!Gt(r[s]))if(this.override)r[s]={};else{if(!(Gt(t)&&br(t)))throw new Error("Trying to redefine `"+s+"` which is a "+typeof r[s]);return}this._fill(e,r[s],t,n)}else{if(!this.override&&Gt(r[s])&&!br(r[s])){if(!(Gt(t)&&br(t)))throw new Error("Trying to redefine non-empty obj['"+s+"']");return}r[s]=ft(t,n)}},oe.prototype.object=function(e,r){var t=this;return Object.keys(e).forEach(function(n){var s=r===void 0?null:r[n],a=gr(n,t.separator).join(t.separator);a.indexOf(t.separator)!==-1?(t._fill(a.split(t.separator),e,e[n],s),delete e[n]):e[n]=ft(e[n],s)}),e},oe.prototype.str=function(e,r,t,n){var s=gr(e,this.separator).join(this.separator);return e.indexOf(this.separator)!==-1?this._fill(s.split(this.separator),t,r,n):t[e]=ft(r,n),t},oe.prototype.pick=function(e,r,t,n){var s,a,o,i,c;for(a=gr(e,this.separator),s=0;s<a.length;s++)if(i=$h(a[s],r),r&&typeof r=="object"&&i in r){if(s===a.length-1)return t?(o=r[i],n&&Array.isArray(r)?r.splice(i,1):delete r[i],Array.isArray(r)&&(c=a.slice(0,-1).join("."),this.cleanup.indexOf(c)===-1&&this.cleanup.push(c)),o):r[i];r=r[i]}else return;return t&&Array.isArray(r)&&(r=r.filter(function(l){return l!==void 0})),r},oe.prototype.delete=function(e,r){return this.remove(e,r,!0)},oe.prototype.remove=function(e,r,t){var n;if(this.cleanup=[],Array.isArray(e)){for(n=0;n<e.length;n++)this.pick(e[n],r,!0,t);return t||this._cleanup(r),r}else return this.pick(e,r,!0,t)},oe.prototype._cleanup=function(e){var r,t,n,s;if(this.cleanup.length){for(t=0;t<this.cleanup.length;t++)n=this.cleanup[t].split("."),s=n.splice(0,-1).join("."),r=s?this.pick(s,e):e,r=r[n[0]].filter(function(a){return a!==void 0}),this.set(this.cleanup[t],r,e);this.cleanup=[]}},oe.prototype.del=oe.prototype.remove,oe.prototype.move=function(e,r,t,n,s){return typeof n=="function"||Array.isArray(n)?this.set(r,ft(this.pick(e,t,!0),n),t,s):(s=n,this.set(r,this.pick(e,t,!0),t,s)),t},oe.prototype.transfer=function(e,r,t,n,s,a){return typeof s=="function"||Array.isArray(s)?this.set(r,ft(this.pick(e,t,!0),s),n,a):(a=s,this.set(r,this.pick(e,t,!0),n,a)),n},oe.prototype.copy=function(e,r,t,n,s,a){return typeof s=="function"||Array.isArray(s)?this.set(r,ft(JSON.parse(JSON.stringify(this.pick(e,t,!1))),s),n,a):(a=s,this.set(r,this.pick(e,t,!1),n,a)),n},oe.prototype.set=function(e,r,t,n){var s,a,o,i;if(typeof r>"u")return t;for(o=gr(e,this.separator),s=0;s<o.length;s++){if(i=o[s],s===o.length-1)if(n&&mr(r)&&mr(t[i]))for(a in r)Sa.call(r,a)&&(t[i][a]=r[a]);else if(n&&Array.isArray(t[i])&&Array.isArray(r))for(var c=0;c<r.length;c++)t[o[s]].push(r[c]);else t[i]=r;else(!Sa.call(t,i)||!mr(t[i])&&!Array.isArray(t[i]))&&(/^\d+$/.test(o[s+1])?t[i]=[]:t[i]={});t=t[i]}return t},oe.prototype.transform=function(e,r,t){return r=r||{},t=t||{},Object.keys(e).forEach((function(n){this.set(e[n],this.pick(n,r),t)}).bind(this)),t},oe.prototype.dot=function(e,r,t){r=r||{},t=t||[];var n=Array.isArray(e);return Object.keys(e).forEach((function(s){var a=n&&this.useBrackets?"["+s+"]":s;if(Gt(e[s])&&(mr(e[s])&&!br(e[s])||Array.isArray(e[s])&&!this.keepArray&&e[s].length!==0))if(n&&this.useBrackets){var o=t[t.length-1]||"";return this.dot(e[s],r,t.slice(0,-1).concat(o+a))}else return this.dot(e[s],r,t.concat(a));else n&&this.useBrackets?r[t.join(this.separator).concat("["+s+"]")]=e[s]:r[t.concat(a).join(this.separator)]=e[s]}).bind(this)),r},oe.pick=Ye("pick"),oe.move=Ye("move"),oe.transfer=Ye("transfer"),oe.transform=Ye("transform"),oe.copy=Ye("copy"),oe.object=Ye("object"),oe.str=Ye("str"),oe.set=Ye("set"),oe.delete=Ye("delete"),oe.del=oe.remove=Ye("remove"),oe.dot=Ye("dot"),["override","overwrite"].forEach(function(e){Object.defineProperty(oe,e,{get:function(){return Et.override},set:function(r){Et.override=!!r}})}),["useArray","keepArray","useBrackets"].forEach(function(e){Object.defineProperty(oe,e,{get:function(){return Et[e]},set:function(r){Et[e]=r}})}),oe._process=ft;var Wh=oe;const yr=Or(Wh),Vh=({name:e,label:r,value:t,data:n,textField:s,valueField:a,readOnly:o=!1,orientation:i=Ne.Horizontal,isMultiSelect:c=!1,className:l,onChange:h,itemTemplate:m})=>{const[x,v]=d.useState(),[w,D]=d.useState([]),N=Ir(()=>n,[n]),S=d.useId();d.useEffect(()=>{if(c){const I=Array.isArray(t)?t.map(k=>k.toString()):t?[String(t)]:void 0;D(I??[])}else t&&v(t.toString())},[t]);const A=I=>c?w.findIndex(k=>k===I)>-1:x===I,B=I=>{const k=I.toString();if(c){const G=A(k);let O;G?O=w.filter(se=>se!=k):O=[...w,k],D(O),h==null||h({name:e,value:O})}else k!==x&&(v(k),h==null||h({name:e,value:k}))},F=I=>{const{value:k}=I.target;v(k),h==null||h({name:e,value:k})},g=I=>{const{value:k,checked:G}=I.target;let O;G?O=[...w,k]:O=w.filter(se=>se!=k),D(O),h==null||h({name:e,value:O})},$=(I,k,G,O)=>f.jsxs("label",{htmlFor:I,className:O,children:[f.jsx("input",{id:I,name:e,value:G,type:"checkbox",onChange:g,checked:A(G),className:"bsc-appearance-none"}),k]},I),_=(I,k,G,O)=>f.jsxs("label",{htmlFor:I,className:O,children:[f.jsx("input",{id:I,name:e,value:G,type:"radio",onChange:F,checked:A(G),className:"bsc-appearance-none"}),k]},I),W=Xt(Mt.FocusWithin),Y=d.useCallback((I,k)=>f.jsx(f.Fragment,{children:k}),[]),re=m||Y,te=(I,k,G)=>{const O=`element_${S}_${k}`,se=yr.pick(s,I),y=String(yr.pick(a,I)),C=k===0,V=k===G.length-1,p=ce("bc-group-button-item bsc-cursor-pointer bsc-border-solid bsc-p-2 bsc-font-medium",{"has-[:checked]:bsc-bg-primary-1 has-[:checked]:dark:bsc-bg-mono-light-1 has-[:checked]:bsc-text-white has-[:checked]:dark:bsc-text-mono-dark-1 dark:bsc-text-mono-light-1 bsc-text-gray-2 bsc-border-gray-3 dark:bsc-border-mono-light-2":!o,"bc-read-only has-[:checked]:bsc-bg-primary-4 has-[:checked]:dark:bsc-bg-mono-light-3 has-[:checked]:bsc-text-gray-5 has-[:checked]:dark:bsc-text-mono-dark-3 dark:bsc-text-mono-light-3 bsc-text-gray-3 bsc-border-gray-4 dark:bsc-border-mono-light-3 bsc-pointer-events-none":o,"bsc-border-t bsc-border-l bsc-border-b bsc-rounded-l-md bsc-pl-2":C&&i===Ne.Horizontal,"bsc-border-t bsc-border-r bsc-border-l bsc-border-b bsc-rounded-r-md bsc-pr-2":V&&i===Ne.Horizontal,"bsc-border-t bsc-border-b":!C&&!V&&i===Ne.Horizontal,"bsc-border-l":!C&&i===Ne.Horizontal,"bsc-border-l bsc-border-r bsc-border-t bsc-rounded-t-md":C&&i===Ne.Vertical,"bsc-border bsc-rounded-b-md":V&&i===Ne.Vertical,"bsc-border-t bsc-border-l bsc-border-r":!C&&!V&&i===Ne.Vertical},W),j={itemId:O,selectedValue:c?w:x,itemText:se,itemValue:y,itemData:I,itemStyles:p,isSelected:A(y),isFirstItem:C,isLastItem:V,onItemChanged:B};return c?f.jsx(wt,{props:j,template:re,children:$(O,se,y,p)}):f.jsx(wt,{props:j,template:re,children:_(O,se,y,p)})},U=ce("bsc-flex bsc-flex-col bsc-gap-2",l),E=ce("bsc-flex",{"bsc-flex-col [width:max-content]":i===Ne.Vertical}),P=I=>f.jsx("div",{className:E,children:I.map(te)});return f.jsxs("div",{className:U,children:[r&&f.jsx(qe,{label:r,readOnly:o}),N&&P(N)]})},Bh=d.memo(Vh),zh=({id:e,name:r,label:t,value:n,checked:s=!1,labelLocation:a=Me.Right,readOnly:o=!1,useAnimation:i,onChange:c})=>{const l=jr(i),h=d.useCallback(v=>{c==null||c(v)},[c]),m=ce("bc-radio-item-wrapper bsc-flex bsc-items-center *:bsc-cursor-pointer",{"bc-read-only":o}),x=ce("bc-radio-item-outer bsc-relative *:bsc-size-[21px]",{"bsc-pl-1":a===Me.Left,"bsc-pr-1":a===Me.Right,"bsc-radio-item-animate":!o&&l,"bsc-radio-item":!o,"bc-read-only bsc-radio-item-read-only":o});return f.jsxs("div",{className:m,children:[a===Me.Left&&f.jsx(qe,{label:t,htmlFor:e,readOnly:o}),f.jsxs("label",{className:x,children:[f.jsx("input",{id:e,name:r,value:n,type:"radio",checked:s,onChange:h,className:"bc-radio-item-input-hidden bsc-hidden"}),f.jsxs("svg",{viewBox:"0 0 30 30",preserveAspectRatio:"xMidYMid meet",className:"bc-radio-item-svg",children:[f.jsx("circle",{cx:15,cy:15,r:13}),f.jsx("circle",{cx:"50%",cy:"50%",r:7})]})]}),a===Me.Right&&f.jsx(qe,{label:t,htmlFor:e,readOnly:o})]})},Uh=d.memo(zh),qh=({name:e,label:r,value:t,data:n,textField:s,valueField:a,readOnly:o=!1,labelLocation:i=Me.Right,orientation:c=Ne.Vertical,className:l,useAnimation:h,onChange:m})=>{const[x,v]=d.useState(t),w=Ir(()=>n,[n]),D=d.useId(),N=d.useCallback(g=>{const $=g.target.value;v($),m==null||m({name:e,value:$,originalEvent:g})},[e]),S=(g,$)=>{const _=`${D}_radio_${$}`,W=yr.pick(a,g);return f.jsx(Uh,{id:_,name:e,label:yr.pick(s,g),value:W,checked:W==x,labelLocation:i,readOnly:o,useAnimation:h,onChange:N},_)},A=ce("bc-radio-container bsc-flex bsc-flex-col bsc-gap-1",l),B=ce("bc-radio-wrapper bsc-flex bsc-gap-1",{"bsc-flex-col":c===Ne.Vertical,"[&>*]:bsc-pr-2":c===Ne.Horizontal}),F=g=>f.jsx("div",{className:B,children:g.map(S)});return f.jsxs("div",{className:A,children:[r&&f.jsx(qe,{label:r,readOnly:o}),w&&F(w)]})},Gh=d.memo(qh),Zh=({name:e,label:r,value:t,checked:n=!1,readOnly:s=!1,useAnimation:a,className:o,onChange:i})=>{const[c,l]=d.useState(!1),h=d.useId(),m=jr(a);d.useEffect(()=>{l(n)},[n]);const x=S=>{const{checked:A}=S.target;l(A),i==null||i({originalEvent:S,name:e||S.target.name,value:t||S.target.value,checked:A})},v=ce("bc-toggle-wrapper bsc-flex bsc-flex-col",o),w=Xt(Mt.FocusWithin),D=ce("bc-toggle-container bsc-toggle-switch bsc-flex bsc-mt-0.5 bsc-relative bsc-w-[70px] bsc-h-[30px] bsc-rounded-full [transition:background-color_1s]",{"bsc-cursor-pointer bsc-bg-gray-3 dark:bsc-bg-mono-dark-3 has-[:checked]:bsc-bg-primary-1 has-[:checked]:dark:bsc-bg-mono-light-2":!s,"bc-read-only bsc-pointer-events-none bsc-bg-gray-4 dark:bsc-bg-mono-dark-2 has-[:checked]:bsc-bg-primary-4 has-[:checked]:dark:bsc-bg-mono-light-3":s},w),N=ce("bc-toggle-switch bsc-absolute bsc-rounded-full dark:bsc-border dark:bsc-border-solid dark:bsc-border-mono-dark-1 bsc-w-[22px] bsc-h-[22px] bsc-top-[4px] bsc-left-[4px]",{"bsc-bg-white bsc-cursor-pointer":!s,"bc-read-only bsc-bg-gray-5 bsc-pointer-events-none":s,"[transition:0.3s]":!s&&m});return f.jsxs("div",{className:v,children:[r&&f.jsx(qe,{label:r,htmlFor:h,readOnly:s}),f.jsxs("label",{className:D,children:[f.jsx("input",{id:h,name:e,value:t,type:"checkbox",checked:c,onChange:x,className:"bsc-appearance-none"}),f.jsx("div",{id:"switch",className:N})]})]})},Qh=d.memo(Zh),fp="";K.BeeSoftProvider=ja,K.Button=We,K.Checkbox=_n,K.CheckboxGroup=Ja,K.ContentEditableInput=sr,K.DateFormatType=qt,K.DateSelectionType=me,K.DateTime=Lh,K.FormGroupItemOrientation=Ne,K.FormattedInput=ya,K.GroupButton=Bh,K.MediaQuery=nn,K.MobileOverlayPanel=fa,K.OverlayPanel=pa,K.RadioButton=Gh,K.SelectionLabelLocation=Me,K.Toggle=Qh,K.applyBeeSoftTheme=Ld,K.createBeeSoftTheme=$d,Object.defineProperty(K,Symbol.toStringTag,{value:"Module"})});