mist-ui-comp
Version:
A React UI component library
102 lines (100 loc) • 220 kB
JavaScript
(function(Q,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],h):(Q=typeof globalThis<"u"?globalThis:Q||self,h(Q.MistUIComp={},Q.React,Q.ReactDOM))})(this,function(Q,h,Ae){"use strict";var Wu=Object.defineProperty;var $u=(Q,h,Ae)=>h in Q?Wu(Q,h,{enumerable:!0,configurable:!0,writable:!0,value:Ae}):Q[h]=Ae;var P=(Q,h,Ae)=>$u(Q,typeof h!="symbol"?h+"":h,Ae);function gn(n){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const e=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(a,t,e.get?e:{enumerable:!0,get:()=>n[t]})}}return a.default=n,Object.freeze(a)}const I=gn(h),ro=gn(Ae);var _r={exports:{}},bt={};/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var vn;function no(){if(vn)return bt;vn=1;var n=h,a=Symbol.for("react.element"),t=Symbol.for("react.fragment"),e=Object.prototype.hasOwnProperty,r=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(i,l,c){var u,d={},p=null,m=null;c!==void 0&&(p=""+c),l.key!==void 0&&(p=""+l.key),l.ref!==void 0&&(m=l.ref);for(u in l)e.call(l,u)&&!o.hasOwnProperty(u)&&(d[u]=l[u]);if(i&&i.defaultProps)for(u in l=i.defaultProps,l)d[u]===void 0&&(d[u]=l[u]);return{$$typeof:a,type:i,key:p,ref:m,props:d,_owner:r.current}}return bt.Fragment=t,bt.jsx=s,bt.jsxs=s,bt}var wt={};/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var yn;function ao(){return yn||(yn=1,process.env.NODE_ENV!=="production"&&function(){var n=h,a=Symbol.for("react.element"),t=Symbol.for("react.portal"),e=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),i=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),v=Symbol.iterator,y="@@iterator";function b(f){if(f===null||typeof f!="object")return null;var D=v&&f[v]||f[y];return typeof D=="function"?D:null}var x=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(f){{for(var D=arguments.length,E=new Array(D>1?D-1:0),R=1;R<D;R++)E[R-1]=arguments[R];_("error",f,E)}}function _(f,D,E){{var R=x.ReactDebugCurrentFrame,G=R.getStackAddendum();G!==""&&(D+="%s",E=E.concat([G]));var re=E.map(function(z){return String(z)});re.unshift("Warning: "+D),Function.prototype.apply.call(console[f],console,re)}}var O=!1,N=!1,T=!1,k=!1,S=!1,L;L=Symbol.for("react.module.reference");function te(f){return!!(typeof f=="string"||typeof f=="function"||f===e||f===o||S||f===r||f===c||f===u||k||f===m||O||N||T||typeof f=="object"&&f!==null&&(f.$$typeof===p||f.$$typeof===d||f.$$typeof===s||f.$$typeof===i||f.$$typeof===l||f.$$typeof===L||f.getModuleId!==void 0))}function q(f,D,E){var R=f.displayName;if(R)return R;var G=D.displayName||D.name||"";return G!==""?E+"("+G+")":E}function $(f){return f.displayName||"Context"}function j(f){if(f==null)return null;if(typeof f.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case e:return"Fragment";case t:return"Portal";case o:return"Profiler";case r:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof f=="object")switch(f.$$typeof){case i:var D=f;return $(D)+".Consumer";case s:var E=f;return $(E._context)+".Provider";case l:return q(f,f.render,"ForwardRef");case d:var R=f.displayName||null;return R!==null?R:j(f.type)||"Memo";case p:{var G=f,re=G._payload,z=G._init;try{return j(z(re))}catch{return null}}}return null}var Y=Object.assign,F=0,H,A,le,X,yr,ja,Wa;function $a(){}$a.__reactDisabledLog=!0;function pu(){{if(F===0){H=console.log,A=console.info,le=console.warn,X=console.error,yr=console.group,ja=console.groupCollapsed,Wa=console.groupEnd;var f={configurable:!0,enumerable:!0,value:$a,writable:!0};Object.defineProperties(console,{info:f,log:f,warn:f,error:f,group:f,groupCollapsed:f,groupEnd:f})}F++}}function hu(){{if(F--,F===0){var f={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Y({},f,{value:H}),info:Y({},f,{value:A}),warn:Y({},f,{value:le}),error:Y({},f,{value:X}),group:Y({},f,{value:yr}),groupCollapsed:Y({},f,{value:ja}),groupEnd:Y({},f,{value:Wa})})}F<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var sn=x.ReactCurrentDispatcher,ln;function br(f,D,E){{if(ln===void 0)try{throw Error()}catch(G){var R=G.stack.trim().match(/\n( *(at )?)/);ln=R&&R[1]||""}return`
`+ln+f}}var cn=!1,wr;{var mu=typeof WeakMap=="function"?WeakMap:Map;wr=new mu}function Ha(f,D){if(!f||cn)return"";{var E=wr.get(f);if(E!==void 0)return E}var R;cn=!0;var G=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var re;re=sn.current,sn.current=null,pu();try{if(D){var z=function(){throw Error()};if(Object.defineProperty(z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(z,[])}catch(ve){R=ve}Reflect.construct(f,[],z)}else{try{z.call()}catch(ve){R=ve}f.call(z.prototype)}}else{try{throw Error()}catch(ve){R=ve}f()}}catch(ve){if(ve&&R&&typeof ve.stack=="string"){for(var B=ve.stack.split(`
`),ge=R.stack.split(`
`),ce=B.length-1,ue=ge.length-1;ce>=1&&ue>=0&&B[ce]!==ge[ue];)ue--;for(;ce>=1&&ue>=0;ce--,ue--)if(B[ce]!==ge[ue]){if(ce!==1||ue!==1)do if(ce--,ue--,ue<0||B[ce]!==ge[ue]){var De=`
`+B[ce].replace(" at new "," at ");return f.displayName&&De.includes("<anonymous>")&&(De=De.replace("<anonymous>",f.displayName)),typeof f=="function"&&wr.set(f,De),De}while(ce>=1&&ue>=0);break}}}finally{cn=!1,sn.current=re,hu(),Error.prepareStackTrace=G}var yt=f?f.displayName||f.name:"",ot=yt?br(yt):"";return typeof f=="function"&&wr.set(f,ot),ot}function gu(f,D,E){return Ha(f,!1)}function vu(f){var D=f.prototype;return!!(D&&D.isReactComponent)}function xr(f,D,E){if(f==null)return"";if(typeof f=="function")return Ha(f,vu(f));if(typeof f=="string")return br(f);switch(f){case c:return br("Suspense");case u:return br("SuspenseList")}if(typeof f=="object")switch(f.$$typeof){case l:return gu(f.render);case d:return xr(f.type,D,E);case p:{var R=f,G=R._payload,re=R._init;try{return xr(re(G),D,E)}catch{}}}return""}var Rt=Object.prototype.hasOwnProperty,Ba={},Qa=x.ReactDebugCurrentFrame;function Dr(f){if(f){var D=f._owner,E=xr(f.type,f._source,D?D.type:null);Qa.setExtraStackFrame(E)}else Qa.setExtraStackFrame(null)}function yu(f,D,E,R,G){{var re=Function.call.bind(Rt);for(var z in f)if(re(f,z)){var B=void 0;try{if(typeof f[z]!="function"){var ge=Error((R||"React class")+": "+E+" type `"+z+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof f[z]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ge.name="Invariant Violation",ge}B=f[z](D,z,R,E,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ce){B=ce}B&&!(B instanceof Error)&&(Dr(G),w("%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).",R||"React class",E,z,typeof B),Dr(null)),B instanceof Error&&!(B.message in Ba)&&(Ba[B.message]=!0,Dr(G),w("Failed %s type: %s",E,B.message),Dr(null))}}}var bu=Array.isArray;function un(f){return bu(f)}function wu(f){{var D=typeof Symbol=="function"&&Symbol.toStringTag,E=D&&f[Symbol.toStringTag]||f.constructor.name||"Object";return E}}function xu(f){try{return Va(f),!1}catch{return!0}}function Va(f){return""+f}function za(f){if(xu(f))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",wu(f)),Va(f)}var At=x.ReactCurrentOwner,Du={key:!0,ref:!0,__self:!0,__source:!0},Ka,Ua,dn;dn={};function _u(f){if(Rt.call(f,"ref")){var D=Object.getOwnPropertyDescriptor(f,"ref").get;if(D&&D.isReactWarning)return!1}return f.ref!==void 0}function ku(f){if(Rt.call(f,"key")){var D=Object.getOwnPropertyDescriptor(f,"key").get;if(D&&D.isReactWarning)return!1}return f.key!==void 0}function Cu(f,D){if(typeof f.ref=="string"&&At.current&&D&&At.current.stateNode!==D){var E=j(At.current.type);dn[E]||(w('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',j(At.current.type),f.ref),dn[E]=!0)}}function Su(f,D){{var E=function(){Ka||(Ka=!0,w("%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)",D))};E.isReactWarning=!0,Object.defineProperty(f,"key",{get:E,configurable:!0})}}function Eu(f,D){{var E=function(){Ua||(Ua=!0,w("%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)",D))};E.isReactWarning=!0,Object.defineProperty(f,"ref",{get:E,configurable:!0})}}var Pu=function(f,D,E,R,G,re,z){var B={$$typeof:a,type:f,key:D,ref:E,props:z,_owner:re};return B._store={},Object.defineProperty(B._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(B,"_self",{configurable:!1,enumerable:!1,writable:!1,value:R}),Object.defineProperty(B,"_source",{configurable:!1,enumerable:!1,writable:!1,value:G}),Object.freeze&&(Object.freeze(B.props),Object.freeze(B)),B};function Mu(f,D,E,R,G){{var re,z={},B=null,ge=null;E!==void 0&&(za(E),B=""+E),ku(D)&&(za(D.key),B=""+D.key),_u(D)&&(ge=D.ref,Cu(D,G));for(re in D)Rt.call(D,re)&&!Du.hasOwnProperty(re)&&(z[re]=D[re]);if(f&&f.defaultProps){var ce=f.defaultProps;for(re in ce)z[re]===void 0&&(z[re]=ce[re])}if(B||ge){var ue=typeof f=="function"?f.displayName||f.name||"Unknown":f;B&&Su(z,ue),ge&&Eu(z,ue)}return Pu(f,B,ge,G,R,At.current,z)}}var fn=x.ReactCurrentOwner,qa=x.ReactDebugCurrentFrame;function vt(f){if(f){var D=f._owner,E=xr(f.type,f._source,D?D.type:null);qa.setExtraStackFrame(E)}else qa.setExtraStackFrame(null)}var pn;pn=!1;function hn(f){return typeof f=="object"&&f!==null&&f.$$typeof===a}function Xa(){{if(fn.current){var f=j(fn.current.type);if(f)return`
Check the render method of \``+f+"`."}return""}}function Ou(f){return""}var Ga={};function Nu(f){{var D=Xa();if(!D){var E=typeof f=="string"?f:f.displayName||f.name;E&&(D=`
Check the top-level render call using <`+E+">.")}return D}}function Ja(f,D){{if(!f._store||f._store.validated||f.key!=null)return;f._store.validated=!0;var E=Nu(D);if(Ga[E])return;Ga[E]=!0;var R="";f&&f._owner&&f._owner!==fn.current&&(R=" It was passed a child from "+j(f._owner.type)+"."),vt(f),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',E,R),vt(null)}}function Za(f,D){{if(typeof f!="object")return;if(un(f))for(var E=0;E<f.length;E++){var R=f[E];hn(R)&&Ja(R,D)}else if(hn(f))f._store&&(f._store.validated=!0);else if(f){var G=b(f);if(typeof G=="function"&&G!==f.entries)for(var re=G.call(f),z;!(z=re.next()).done;)hn(z.value)&&Ja(z.value,D)}}}function Tu(f){{var D=f.type;if(D==null||typeof D=="string")return;var E;if(typeof D=="function")E=D.propTypes;else if(typeof D=="object"&&(D.$$typeof===l||D.$$typeof===d))E=D.propTypes;else return;if(E){var R=j(D);yu(E,f.props,"prop",R,f)}else if(D.PropTypes!==void 0&&!pn){pn=!0;var G=j(D);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",G||"Unknown")}typeof D.getDefaultProps=="function"&&!D.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Yu(f){{for(var D=Object.keys(f.props),E=0;E<D.length;E++){var R=D[E];if(R!=="children"&&R!=="key"){vt(f),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",R),vt(null);break}}f.ref!==null&&(vt(f),w("Invalid attribute `ref` supplied to `React.Fragment`."),vt(null))}}var eo={};function to(f,D,E,R,G,re){{var z=te(f);if(!z){var B="";(f===void 0||typeof f=="object"&&f!==null&&Object.keys(f).length===0)&&(B+=" 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 ge=Ou();ge?B+=ge:B+=Xa();var ce;f===null?ce="null":un(f)?ce="array":f!==void 0&&f.$$typeof===a?(ce="<"+(j(f.type)||"Unknown")+" />",B=" Did you accidentally export a JSX literal instead of a component?"):ce=typeof f,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ce,B)}var ue=Mu(f,D,E,G,re);if(ue==null)return ue;if(z){var De=D.children;if(De!==void 0)if(R)if(un(De)){for(var yt=0;yt<De.length;yt++)Za(De[yt],f);Object.freeze&&Object.freeze(De)}else w("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 Za(De,f)}if(Rt.call(D,"key")){var ot=j(f),ve=Object.keys(D).filter(function(ju){return ju!=="key"}),mn=ve.length>0?"{key: someKey, "+ve.join(": ..., ")+": ...}":"{key: someKey}";if(!eo[ot+mn]){var Au=ve.length>0?"{"+ve.join(": ..., ")+": ...}":"{}";w(`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`,mn,ot,Au,ot),eo[ot+mn]=!0}}return f===e?Yu(ue):Tu(ue),ue}}function Iu(f,D,E){return to(f,D,E,!0)}function Lu(f,D,E){return to(f,D,E,!1)}var Fu=Lu,Ru=Iu;wt.Fragment=e,wt.jsx=Fu,wt.jsxs=Ru}()),wt}process.env.NODE_ENV==="production"?_r.exports=no():_r.exports=ao();var g=_r.exports;const oo=({label:n,checked:a,onChange:t,darkMode:e})=>g.jsxs("label",{className:"flex items-center font-montserrat cursor-pointer",children:[g.jsx("div",{className:`w-5 h-5 border-2 rounded-md mr-2 flex items-center justify-center ${a?e?"bg-violet-500 border-violet-500":"bg-violet-600 border-violet-600":e?"border-zinc-600":"border-violet-400"}`,children:a&&g.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})})}),g.jsx("input",{type:"checkbox",checked:a,onChange:t,className:"hidden"}),g.jsx("span",{className:`text-sm ${e?"text-violet-400":"text-gray-700"}`,children:n})]});/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const so=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),bn=(...n)=>n.filter((a,t,e)=>!!a&&e.indexOf(a)===t).join(" ");/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var io={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const lo=h.forwardRef(({color:n="currentColor",size:a=24,strokeWidth:t=2,absoluteStrokeWidth:e,className:r="",children:o,iconNode:s,...i},l)=>h.createElement("svg",{ref:l,...io,width:a,height:a,stroke:n,strokeWidth:e?Number(t)*24/Number(a):t,className:bn("lucide",r),...i},[...s.map(([c,u])=>h.createElement(c,u)),...Array.isArray(o)?o:[o]]));/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const je=(n,a)=>{const t=h.forwardRef(({className:e,...r},o)=>h.createElement(lo,{ref:o,iconNode:a,className:bn(`lucide-${so(n)}`,e),...r}));return t.displayName=`${n}`,t};/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const co=je("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const kr=je("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const uo=je("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const fo=je("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const po=je("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ho=je("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const mo=je("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const go=je("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),vo=({maxSize:n=5*1024*1024,acceptedFileTypes:a="*",onFileSelect:t,onUpload:e,buttonText:r="Upload File",dragDropText:o="Click to upload or drag and drop",className:s="",darkMode:i=!1})=>{const[l,c]=h.useState(null),[u,d]=h.useState(""),p=v=>{const y=v.target.files[0];y&&(y.size>n?(d(`File size exceeds ${n/(1024*1024)}MB limit.`),c(null)):(c(y),d(""),t&&t(y)))},m=v=>{v.preventDefault(),l?(e&&e(l),c(null)):d("Please select a file to upload.")};return g.jsx("div",{className:`w-96 ${s}`,children:g.jsxs("form",{onSubmit:m,className:"space-y-4",children:[g.jsx("div",{className:"w-full",children:g.jsxs("label",{htmlFor:"file-upload",className:`flex flex-col items-center justify-center w-full h-44 border-2 border-dashed rounded-sm cursor-pointer
${i?"border-violet-600 bg-zinc-900 hover:bg-zinc-800":"border-violet-300 bg-violet-50 hover:bg-violet-100"}`,children:[g.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[g.jsx(ho,{className:`w-8 h-8 mb-4 ${i?"text-violet-400":"text-violet-500"}`}),g.jsx("p",{className:`mb-2 text-sm ${i?"text-violet-400":"text-violet-500"}`,children:g.jsx("span",{className:"font-montserrat",children:o})}),g.jsxs("p",{className:`text-xs font-montserrat ${i?"text-violet-400":"text-violet-500"}`,children:["Max file size: ",n/(1024*1024),"MB"]})]}),g.jsx("input",{id:"file-upload",type:"file",className:"hidden",onChange:p,accept:a})]})}),l&&g.jsxs("p",{className:`text-sm font-montserrat ${i?"text-violet-400":"text-violet-500"}`,children:["Selected file: ",l.name]}),u&&g.jsx("div",{className:"bg-red-100 border font-montserrat border-red-400 text-red-700 px-4 py-3 rounded-sm relative",role:"alert",children:g.jsx("span",{className:"block sm:inline",children:u})}),g.jsx("button",{type:"submit",className:`px-4 py-2 w-full text-white font-montserrat rounded-sm
${i?"bg-violet-600 hover:bg-violet-700 focus:ring-violet-500":"bg-violet-500 hover:bg-violet-600 focus:ring-violet-500"}
focus:outline-none focus:ring-2 focus:ring-opacity-50`,children:r})]})})},yo=({options:n,value:a,onChange:t,placeholder:e,darkMode:r=!1})=>{const[o,s]=h.useState(!1),i=()=>s(!o),l=u=>{const d=a.includes(u)?a.filter(p=>p!==u):[...a,u];t(d)},c=u=>{u.currentTarget.contains(u.relatedTarget)||s(!1)};return g.jsxs("div",{className:"relative w-96",tabIndex:0,onBlur:c,children:[g.jsxs("div",{className:`
flex items-center justify-between w-full font-montserrat
px-4 py-2 rounded cursor-pointer border
${r?"bg-zinc-900 text-violet-400 border-zinc-700 hover:border-zinc-600":"bg-stone-50 text-black border-violet-300 hover:border-violet-400"}
`,onClick:i,children:[g.jsx("div",{className:"flex flex-wrap gap-1",children:a.length>0?a.map(u=>g.jsx("span",{className:`${r?"bg-zinc-800 text-violet-400":"bg-violet-100 text-violet-800"} px-2 py-1 rounded-full text-sm`,children:u},u)):g.jsx("span",{className:`${r?"text-zinc-500":"text-gray-400"}`,children:e||"Select options"})}),g.jsx(kr,{className:`h-5 w-5 transition-transform duration-200 ${r?"text-violet-400":"text-violet-300"} ${o?"rotate-180":""}`})]}),o&&g.jsx("div",{className:`absolute z-10 w-full mt-1 border rounded ${r?"bg-zinc-900 border-zinc-700":"bg-white border-violet-300"}`,children:n.map(u=>g.jsx("div",{className:`
px-4 py-2 cursor-pointer
${a.includes(u)?`${r?"bg-zinc-800":"bg-violet-100"}`:""}
${r?"hover:bg-zinc-800 text-violet-300":"hover:bg-violet-50 text-black"}
`,onClick:()=>l(u),children:u},u))})]})},bo=({label:n,checked:a,onChange:t,name:e,darkMode:r=!1})=>g.jsxs("label",{className:"flex items-center font-montserrat cursor-pointer",children:[g.jsx("div",{className:`w-5 h-5 border-2 rounded-full mr-2 flex items-center justify-center
${a?r?"border-violet-500":"border-violet-600":r?"border-zinc-600":"border-violet-400"}`,children:a&&g.jsx("div",{className:`w-3 h-3 rounded-full ${r?"bg-violet-500":"bg-violet-600"}`})}),g.jsx("input",{type:"radio",name:e,checked:a,onChange:t,className:"hidden"}),g.jsx("span",{className:`text-sm ${r?"text-violet-400":"text-gray-700"}`,children:n})]});function wn(n){var a,t,e="";if(typeof n=="string"||typeof n=="number")e+=n;else if(typeof n=="object")if(Array.isArray(n)){var r=n.length;for(a=0;a<r;a++)n[a]&&(t=wn(n[a]))&&(e&&(e+=" "),e+=t)}else for(t in n)n[t]&&(e&&(e+=" "),e+=t);return e}function de(){for(var n,a,t=0,e="",r=arguments.length;t<r;t++)(n=arguments[t])&&(a=wn(n))&&(e&&(e+=" "),e+=a);return e}function wo(n,a){n.prototype=Object.create(a.prototype),n.prototype.constructor=n,Cr(n,a)}function Cr(n,a){return Cr=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},Cr(n,a)}function xo(n,a){if(n==null)return{};var t={},e=Object.keys(n),r,o;for(o=0;o<e.length;o++)r=e[o],!(a.indexOf(r)>=0)&&(t[r]=n[r]);return t}function xn(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function Do(n,a,t){return n===a?!0:n.correspondingElement?n.correspondingElement.classList.contains(t):n.classList.contains(t)}function _o(n,a,t){if(n===a)return!0;for(;n.parentNode||n.host;){if(n.parentNode&&Do(n,a,t))return!0;n=n.parentNode||n.host}return n}function ko(n){return document.documentElement.clientWidth<=n.clientX||document.documentElement.clientHeight<=n.clientY}var Co=function(){if(!(typeof window>"u"||typeof window.addEventListener!="function")){var a=!1,t=Object.defineProperty({},"passive",{get:function(){a=!0}}),e=function(){};return window.addEventListener("testPassiveEventSupport",e,t),window.removeEventListener("testPassiveEventSupport",e,t),a}};function So(n){return n===void 0&&(n=0),function(){return++n}}var Eo=So(),Sr,jt={},Er={},Po=["touchstart","touchmove"],Mo="ignore-react-onclickoutside";function Dn(n,a){var t={},e=Po.indexOf(a)!==-1;return e&&Sr&&(t.passive=!n.props.preventDefault),t}function Wt(n,a){var t,e,r=n.displayName||n.name||"Component";return e=t=function(o){wo(s,o);function s(l){var c;return c=o.call(this,l)||this,c.__outsideClickHandler=function(u){if(typeof c.__clickOutsideHandlerProp=="function"){c.__clickOutsideHandlerProp(u);return}var d=c.getInstance();if(typeof d.props.handleClickOutside=="function"){d.props.handleClickOutside(u);return}if(typeof d.handleClickOutside=="function"){d.handleClickOutside(u);return}throw new Error("WrappedComponent: "+r+" lacks a handleClickOutside(event) function for processing outside click events.")},c.__getComponentNode=function(){var u=c.getInstance();return typeof u.setClickOutsideRef=="function"?u.setClickOutsideRef():Ae.findDOMNode(u)},c.enableOnClickOutside=function(){if(!(typeof document>"u"||Er[c._uid])){typeof Sr>"u"&&(Sr=Co()),Er[c._uid]=!0;var u=c.props.eventTypes;u.forEach||(u=[u]),jt[c._uid]=function(d){if(c.componentNode!==null&&!(c.initTimeStamp>d.timeStamp)&&(c.props.preventDefault&&d.preventDefault(),c.props.stopPropagation&&d.stopPropagation(),!(c.props.excludeScrollbar&&ko(d)))){var p=d.composed&&d.composedPath&&d.composedPath().shift()||d.target;_o(p,c.componentNode,c.props.outsideClickIgnoreClass)===document&&c.__outsideClickHandler(d)}},u.forEach(function(d){document.addEventListener(d,jt[c._uid],Dn(xn(c),d))})}},c.disableOnClickOutside=function(){delete Er[c._uid];var u=jt[c._uid];if(u&&typeof document<"u"){var d=c.props.eventTypes;d.forEach||(d=[d]),d.forEach(function(p){return document.removeEventListener(p,u,Dn(xn(c),p))}),delete jt[c._uid]}},c.getRef=function(u){return c.instanceRef=u},c._uid=Eo(),c.initTimeStamp=performance.now(),c}var i=s.prototype;return i.getInstance=function(){if(n.prototype&&!n.prototype.isReactComponent)return this;var c=this.instanceRef;return c.getInstance?c.getInstance():c},i.componentDidMount=function(){typeof document>"u"||!document.createElement||(this.getInstance(),this.componentNode=this.__getComponentNode(),!this.props.disableOnClickOutside&&this.enableOnClickOutside())},i.componentDidUpdate=function(){this.componentNode=this.__getComponentNode()},i.componentWillUnmount=function(){this.disableOnClickOutside()},i.render=function(){var c=this.props;c.excludeScrollbar;var u=xo(c,["excludeScrollbar"]);return n.prototype&&n.prototype.isReactComponent?u.ref=this.getRef:u.wrappedRef=this.getRef,u.disableOnClickOutside=this.disableOnClickOutside,u.enableOnClickOutside=this.enableOnClickOutside,h.createElement(n,u)},s}(h.Component),t.displayName="OnClickOutside("+r+")",t.defaultProps={eventTypes:["mousedown","touchstart"],excludeScrollbar:!1,outsideClickIgnoreClass:Mo,preventDefault:!1,stopPropagation:!1},t.getClass=function(){return n.getClass?n.getClass():n},e}function M(n){const a=Object.prototype.toString.call(n);return n instanceof Date||typeof n=="object"&&a==="[object Date]"?new n.constructor(+n):typeof n=="number"||a==="[object Number]"||typeof n=="string"||a==="[object String]"?new Date(n):new Date(NaN)}function J(n,a){return n instanceof Date?new n.constructor(a):new Date(a)}function We(n,a){const t=M(n);return isNaN(a)?J(n,NaN):(a&&t.setDate(t.getDate()+a),t)}function Pr(n,a){const t=+M(n);return J(n,t+a)}const _n=6048e5,Oo=864e5,$t=6e4,Ht=36e5,No=1e3;function To(n,a){return Pr(n,a*Ht)}function Mr(n,a){return Pr(n,a*$t)}function _e(n,a){const t=M(n);if(isNaN(a))return J(n,NaN);if(!a)return t;const e=t.getDate(),r=J(n,t.getTime());r.setMonth(t.getMonth()+a+1,0);const o=r.getDate();return e>=o?r:(t.setFullYear(r.getFullYear(),r.getMonth(),e),t)}function Or(n,a){const t=a*3;return _e(n,t)}function Yo(n,a){return Pr(n,a*1e3)}function Bt(n,a){const t=a*7;return We(n,t)}function Te(n,a){return _e(n,a*12)}function Xe(n){const a=M(n);return a.setHours(0,0,0,0),a}function Qt(n){const a=M(n),t=new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()));return t.setUTCFullYear(a.getFullYear()),+n-+t}function xt(n,a){const t=Xe(n),e=Xe(a),r=+t-Qt(t),o=+e-Qt(e);return Math.round((r-o)/Oo)}function Vt(n,a){const t=M(n),e=M(a),r=t.getFullYear()-e.getFullYear(),o=t.getMonth()-e.getMonth();return r*12+o}function Ge(n){const a=M(n);return Math.trunc(a.getMonth()/3)+1}function zt(n,a){const t=M(n),e=M(a),r=t.getFullYear()-e.getFullYear(),o=Ge(t)-Ge(e);return r*4+o}function Kt(n,a){const t=M(n),e=M(a);return t.getFullYear()-e.getFullYear()}function kn(n){const a=M(n);return a.setHours(23,59,59,999),a}function Io(n){const a=M(n),t=a.getMonth();return a.setFullYear(a.getFullYear(),t+1,0),a.setHours(23,59,59,999),a}let Lo={};function Je(){return Lo}function Fo(n,a){var i,l;const t=Je(),e=t.weekStartsOn??((l=(i=t.locale)==null?void 0:i.options)==null?void 0:l.weekStartsOn)??0,r=M(n),o=r.getDay(),s=(o<e?-7:0)+6-(o-e);return r.setDate(r.getDate()+s),r.setHours(23,59,59,999),r}function Cn(n){const a=M(n),t=a.getFullYear();return a.setFullYear(t+1,0,0),a.setHours(23,59,59,999),a}const Ro={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"}},Ao=(n,a,t)=>{let e;const r=Ro[n];return typeof r=="string"?e=r:a===1?e=r.one:e=r.other.replace("{{count}}",a.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+e:e+" ago":e};function Nr(n){return(a={})=>{const t=a.width?String(a.width):n.defaultWidth;return n.formats[t]||n.formats[n.defaultWidth]}}const jo={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Wo={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},$o={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ho={date:Nr({formats:jo,defaultWidth:"full"}),time:Nr({formats:Wo,defaultWidth:"full"}),dateTime:Nr({formats:$o,defaultWidth:"full"})},Bo={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Qo=(n,a,t,e)=>Bo[n];function Dt(n){return(a,t)=>{const e=t!=null&&t.context?String(t.context):"standalone";let r;if(e==="formatting"&&n.formattingValues){const s=n.defaultFormattingWidth||n.defaultWidth,i=t!=null&&t.width?String(t.width):s;r=n.formattingValues[i]||n.formattingValues[s]}else{const s=n.defaultWidth,i=t!=null&&t.width?String(t.width):n.defaultWidth;r=n.values[i]||n.values[s]}const o=n.argumentCallback?n.argumentCallback(a):a;return r[o]}}const Vo={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},zo={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ko={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"]},Uo={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"]},qo={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"}},Xo={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"}},Go={ordinalNumber:(n,a)=>{const t=Number(n),e=t%100;if(e>20||e<10)switch(e%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},era:Dt({values:Vo,defaultWidth:"wide"}),quarter:Dt({values:zo,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Dt({values:Ko,defaultWidth:"wide"}),day:Dt({values:Uo,defaultWidth:"wide"}),dayPeriod:Dt({values:qo,defaultWidth:"wide",formattingValues:Xo,defaultFormattingWidth:"wide"})};function _t(n){return(a,t={})=>{const e=t.width,r=e&&n.matchPatterns[e]||n.matchPatterns[n.defaultMatchWidth],o=a.match(r);if(!o)return null;const s=o[0],i=e&&n.parsePatterns[e]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(i)?Zo(i,d=>d.test(s)):Jo(i,d=>d.test(s));let c;c=n.valueCallback?n.valueCallback(l):l,c=t.valueCallback?t.valueCallback(c):c;const u=a.slice(s.length);return{value:c,rest:u}}}function Jo(n,a){for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&a(n[t]))return t}function Zo(n,a){for(let t=0;t<n.length;t++)if(a(n[t]))return t}function es(n){return(a,t={})=>{const e=a.match(n.matchPattern);if(!e)return null;const r=e[0],o=a.match(n.parsePattern);if(!o)return null;let s=n.valueCallback?n.valueCallback(o[0]):o[0];s=t.valueCallback?t.valueCallback(s):s;const i=a.slice(r.length);return{value:s,rest:i}}}const ts=/^(\d+)(th|st|nd|rd)?/i,rs=/\d+/i,ns={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},as={any:[/^b/i,/^(a|c)/i]},os={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ss={any:[/1/i,/2/i,/3/i,/4/i]},is={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},ls={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]},cs={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},us={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]},ds={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},fs={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}},ps={ordinalNumber:es({matchPattern:ts,parsePattern:rs,valueCallback:n=>parseInt(n,10)}),era:_t({matchPatterns:ns,defaultMatchWidth:"wide",parsePatterns:as,defaultParseWidth:"any"}),quarter:_t({matchPatterns:os,defaultMatchWidth:"wide",parsePatterns:ss,defaultParseWidth:"any",valueCallback:n=>n+1}),month:_t({matchPatterns:is,defaultMatchWidth:"wide",parsePatterns:ls,defaultParseWidth:"any"}),day:_t({matchPatterns:cs,defaultMatchWidth:"wide",parsePatterns:us,defaultParseWidth:"any"}),dayPeriod:_t({matchPatterns:ds,defaultMatchWidth:"any",parsePatterns:fs,defaultParseWidth:"any"})},Sn={code:"en-US",formatDistance:Ao,formatLong:Ho,formatRelative:Qo,localize:Go,match:ps,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Ut(n){const a=M(n),t=J(n,0);return t.setFullYear(a.getFullYear(),0,1),t.setHours(0,0,0,0),t}function hs(n){const a=M(n);return xt(a,Ut(a))+1}function Ye(n,a){var i,l,c,u;const t=Je(),e=(a==null?void 0:a.weekStartsOn)??((l=(i=a==null?void 0:a.locale)==null?void 0:i.options)==null?void 0:l.weekStartsOn)??t.weekStartsOn??((u=(c=t.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,r=M(n),o=r.getDay(),s=(o<e?7:0)+o-e;return r.setDate(r.getDate()-s),r.setHours(0,0,0,0),r}function st(n){return Ye(n,{weekStartsOn:1})}function En(n){const a=M(n),t=a.getFullYear(),e=J(n,0);e.setFullYear(t+1,0,4),e.setHours(0,0,0,0);const r=st(e),o=J(n,0);o.setFullYear(t,0,4),o.setHours(0,0,0,0);const s=st(o);return a.getTime()>=r.getTime()?t+1:a.getTime()>=s.getTime()?t:t-1}function ms(n){const a=En(n),t=J(n,0);return t.setFullYear(a,0,4),t.setHours(0,0,0,0),st(t)}function Tr(n){const a=M(n),t=+st(a)-+ms(a);return Math.round(t/_n)+1}function Yr(n,a){var u,d,p,m;const t=M(n),e=t.getFullYear(),r=Je(),o=(a==null?void 0:a.firstWeekContainsDate)??((d=(u=a==null?void 0:a.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((m=(p=r.locale)==null?void 0:p.options)==null?void 0:m.firstWeekContainsDate)??1,s=J(n,0);s.setFullYear(e+1,0,o),s.setHours(0,0,0,0);const i=Ye(s,a),l=J(n,0);l.setFullYear(e,0,o),l.setHours(0,0,0,0);const c=Ye(l,a);return t.getTime()>=i.getTime()?e+1:t.getTime()>=c.getTime()?e:e-1}function gs(n,a){var i,l,c,u;const t=Je(),e=(a==null?void 0:a.firstWeekContainsDate)??((l=(i=a==null?void 0:a.locale)==null?void 0:i.options)==null?void 0:l.firstWeekContainsDate)??t.firstWeekContainsDate??((u=(c=t.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,r=Yr(n,a),o=J(n,0);return o.setFullYear(r,0,e),o.setHours(0,0,0,0),Ye(o,a)}function Pn(n,a){const t=M(n),e=+Ye(t,a)-+gs(t,a);return Math.round(e/_n)+1}function Z(n,a){const t=n<0?"-":"",e=Math.abs(n).toString().padStart(a,"0");return t+e}const $e={y(n,a){const t=n.getFullYear(),e=t>0?t:1-t;return Z(a==="yy"?e%100:e,a.length)},M(n,a){const t=n.getMonth();return a==="M"?String(t+1):Z(t+1,2)},d(n,a){return Z(n.getDate(),a.length)},a(n,a){const t=n.getHours()/12>=1?"pm":"am";switch(a){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(n,a){return Z(n.getHours()%12||12,a.length)},H(n,a){return Z(n.getHours(),a.length)},m(n,a){return Z(n.getMinutes(),a.length)},s(n,a){return Z(n.getSeconds(),a.length)},S(n,a){const t=a.length,e=n.getMilliseconds(),r=Math.trunc(e*Math.pow(10,t-3));return Z(r,a.length)}},it={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Mn={G:function(n,a,t){const e=n.getFullYear()>0?1:0;switch(a){case"G":case"GG":case"GGG":return t.era(e,{width:"abbreviated"});case"GGGGG":return t.era(e,{width:"narrow"});case"GGGG":default:return t.era(e,{width:"wide"})}},y:function(n,a,t){if(a==="yo"){const e=n.getFullYear(),r=e>0?e:1-e;return t.ordinalNumber(r,{unit:"year"})}return $e.y(n,a)},Y:function(n,a,t,e){const r=Yr(n,e),o=r>0?r:1-r;if(a==="YY"){const s=o%100;return Z(s,2)}return a==="Yo"?t.ordinalNumber(o,{unit:"year"}):Z(o,a.length)},R:function(n,a){const t=En(n);return Z(t,a.length)},u:function(n,a){const t=n.getFullYear();return Z(t,a.length)},Q:function(n,a,t){const e=Math.ceil((n.getMonth()+1)/3);switch(a){case"Q":return String(e);case"QQ":return Z(e,2);case"Qo":return t.ordinalNumber(e,{unit:"quarter"});case"QQQ":return t.quarter(e,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(e,{width:"wide",context:"formatting"})}},q:function(n,a,t){const e=Math.ceil((n.getMonth()+1)/3);switch(a){case"q":return String(e);case"qq":return Z(e,2);case"qo":return t.ordinalNumber(e,{unit:"quarter"});case"qqq":return t.quarter(e,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(e,{width:"wide",context:"standalone"})}},M:function(n,a,t){const e=n.getMonth();switch(a){case"M":case"MM":return $e.M(n,a);case"Mo":return t.ordinalNumber(e+1,{unit:"month"});case"MMM":return t.month(e,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(e,{width:"wide",context:"formatting"})}},L:function(n,a,t){const e=n.getMonth();switch(a){case"L":return String(e+1);case"LL":return Z(e+1,2);case"Lo":return t.ordinalNumber(e+1,{unit:"month"});case"LLL":return t.month(e,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(e,{width:"wide",context:"standalone"})}},w:function(n,a,t,e){const r=Pn(n,e);return a==="wo"?t.ordinalNumber(r,{unit:"week"}):Z(r,a.length)},I:function(n,a,t){const e=Tr(n);return a==="Io"?t.ordinalNumber(e,{unit:"week"}):Z(e,a.length)},d:function(n,a,t){return a==="do"?t.ordinalNumber(n.getDate(),{unit:"date"}):$e.d(n,a)},D:function(n,a,t){const e=hs(n);return a==="Do"?t.ordinalNumber(e,{unit:"dayOfYear"}):Z(e,a.length)},E:function(n,a,t){const e=n.getDay();switch(a){case"E":case"EE":case"EEE":return t.day(e,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(e,{width:"short",context:"formatting"});case"EEEE":default:return t.day(e,{width:"wide",context:"formatting"})}},e:function(n,a,t,e){const r=n.getDay(),o=(r-e.weekStartsOn+8)%7||7;switch(a){case"e":return String(o);case"ee":return Z(o,2);case"eo":return t.ordinalNumber(o,{unit:"day"});case"eee":return t.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(r,{width:"short",context:"formatting"});case"eeee":default:return t.day(r,{width:"wide",context:"formatting"})}},c:function(n,a,t,e){const r=n.getDay(),o=(r-e.weekStartsOn+8)%7||7;switch(a){case"c":return String(o);case"cc":return Z(o,a.length);case"co":return t.ordinalNumber(o,{unit:"day"});case"ccc":return t.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(r,{width:"narrow",context:"standalone"});case"cccccc":return t.day(r,{width:"short",context:"standalone"});case"cccc":default:return t.day(r,{width:"wide",context:"standalone"})}},i:function(n,a,t){const e=n.getDay(),r=e===0?7:e;switch(a){case"i":return String(r);case"ii":return Z(r,a.length);case"io":return t.ordinalNumber(r,{unit:"day"});case"iii":return t.day(e,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(e,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(e,{width:"short",context:"formatting"});case"iiii":default:return t.day(e,{width:"wide",context:"formatting"})}},a:function(n,a,t){const r=n.getHours()/12>=1?"pm":"am";switch(a){case"a":case"aa":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(n,a,t){const e=n.getHours();let r;switch(e===12?r=it.noon:e===0?r=it.midnight:r=e/12>=1?"pm":"am",a){case"b":case"bb":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(n,a,t){const e=n.getHours();let r;switch(e>=17?r=it.evening:e>=12?r=it.afternoon:e>=4?r=it.morning:r=it.night,a){case"B":case"BB":case"BBB":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(n,a,t){if(a==="ho"){let e=n.getHours()%12;return e===0&&(e=12),t.ordinalNumber(e,{unit:"hour"})}return $e.h(n,a)},H:function(n,a,t){return a==="Ho"?t.ordinalNumber(n.getHours(),{unit:"hour"}):$e.H(n,a)},K:function(n,a,t){const e=n.getHours()%12;return a==="Ko"?t.ordinalNumber(e,{unit:"hour"}):Z(e,a.length)},k:function(n,a,t){let e=n.getHours();return e===0&&(e=24),a==="ko"?t.ordinalNumber(e,{unit:"hour"}):Z(e,a.length)},m:function(n,a,t){return a==="mo"?t.ordinalNumber(n.getMinutes(),{unit:"minute"}):$e.m(n,a)},s:function(n,a,t){return a==="so"?t.ordinalNumber(n.getSeconds(),{unit:"second"}):$e.s(n,a)},S:function(n,a){return $e.S(n,a)},X:function(n,a,t){const e=n.getTimezoneOffset();if(e===0)return"Z";switch(a){case"X":return Nn(e);case"XXXX":case"XX":return Ze(e);case"XXXXX":case"XXX":default:return Ze(e,":")}},x:function(n,a,t){const e=n.getTimezoneOffset();switch(a){case"x":return Nn(e);case"xxxx":case"xx":return Ze(e);case"xxxxx":case"xxx":default:return Ze(e,":")}},O:function(n,a,t){const e=n.getTimezoneOffset();switch(a){case"O":case"OO":case"OOO":return"GMT"+On(e,":");case"OOOO":default:return"GMT"+Ze(e,":")}},z:function(n,a,t){const e=n.getTimezoneOffset();switch(a){case"z":case"zz":case"zzz":return"GMT"+On(e,":");case"zzzz":default:return"GMT"+Ze(e,":")}},t:function(n,a,t){const e=Math.trunc(n.getTime()/1e3);return Z(e,a.length)},T:function(n,a,t){const e=n.getTime();return Z(e,a.length)}};function On(n,a=""){const t=n>0?"-":"+",e=Math.abs(n),r=Math.trunc(e/60),o=e%60;return o===0?t+String(r):t+String(r)+a+Z(o,2)}function Nn(n,a){return n%60===0?(n>0?"-":"+")+Z(Math.abs(n)/60,2):Ze(n,a)}function Ze(n,a=""){const t=n>0?"-":"+",e=Math.abs(n),r=Z(Math.trunc(e/60),2),o=Z(e%60,2);return t+r+a+o}const Tn=(n,a)=>{switch(n){case"P":return a.date({width:"short"});case"PP":return a.date({width:"medium"});case"PPP":return a.date({width:"long"});case"PPPP":default:return a.date({width:"full"})}},Yn=(n,a)=>{switch(n){case"p":return a.time({width:"short"});case"pp":return a.time({width:"medium"});case"ppp":return a.time({width:"long"});case"pppp":default:return a.time({width:"full"})}},qt={p:Yn,P:(n,a)=>{const t=n.match(/(P+)(p+)?/)||[],e=t[1],r=t[2];if(!r)return Tn(n,a);let o;switch(e){case"P":o=a.dateTime({width:"short"});break;case"PP":o=a.dateTime({width:"medium"});break;case"PPP":o=a.dateTime({width:"long"});break;case"PPPP":default:o=a.dateTime({width:"full"});break}return o.replace("{{date}}",Tn(e,a)).replace("{{time}}",Yn(r,a))}},vs=/^D+$/,ys=/^Y+$/,bs=["D","DD","YY","YYYY"];function In(n){return vs.test(n)}function Ln(n){return ys.test(n)}function Ir(n,a,t){const e=ws(n,a,t);if(console.warn(e),bs.includes(n))throw new RangeError(e)}function ws(n,a,t){const e=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${a}\`) for formatting ${e} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function Ie(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Xt(n){if(!Ie(n)&&typeof n!="number")return!1;const a=M(n);return!isNaN(Number(a))}const xs=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ds=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,_s=/^'([^]*?)'?$/,ks=/''/g,Cs=/[a-zA-Z]/;function Lr(n,a,t){var u,d,p,m,v,y,b,x;const e=Je(),r=(t==null?void 0:t.locale)??e.locale??Sn,o=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??e.firstWeekContainsDate??((m=(p=e.locale)==null?void 0:p.options)==null?void 0:m.firstWeekContainsDate)??1,s=(t==null?void 0:t.weekStartsOn)??((y=(v=t==null?void 0:t.locale)==null?void 0:v.options)==null?void 0:y.weekStartsOn)??e.weekStartsOn??((x=(b=e.locale)==null?void 0:b.options)==null?void 0:x.weekStartsOn)??0,i=M(n);if(!Xt(i))throw new RangeError("Invalid time value");let l=a.match(Ds).map(w=>{const _=w[0];if(_==="p"||_==="P"){const O=qt[_];return O(w,r.formatLong)}return w}).join("").match(xs).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const _=w[0];if(_==="'")return{isToken:!1,value:Ss(w)};if(Mn[_])return{isToken:!0,value:w};if(_.match(Cs))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return{isToken:!1,value:w}});r.localize.preprocessor&&(l=r.localize.preprocessor(i,l));const c={firstWeekContainsDate:o,weekStartsOn:s,locale:r};return l.map(w=>{if(!w.isToken)return w.value;const _=w.value;(!(t!=null&&t.useAdditionalWeekYearTokens)&&Ln(_)||!(t!=null&&t.useAdditionalDayOf