finform-react-builder
Version:
A powerful, flexible React form builder with dynamic field rendering, custom validation, multi-step forms, Material-UI integration, image component support, toggle/radio buttons, switches, autocomplete, and advanced button positioning
17,071 lines • 555 kB
JavaScript
var dc = Object.defineProperty;
var ro = (e) => {
throw TypeError(e);
};
var fc = (e, t, n) => t in e ? dc(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var cr = (e, t, n) => fc(e, typeof t != "symbol" ? t + "" : t, n), Ai = (e, t, n) => t.has(e) || ro("Cannot " + n);
var C = (e, t, n) => (Ai(e, t, "read from private field"), n ? n.call(e) : t.get(e)), pe = (e, t, n) => t.has(e) ? ro("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), ee = (e, t, n, r) => (Ai(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), xe = (e, t, n) => (Ai(e, t, "access private method"), n);
var _r = (e, t, n, r) => ({
set _(i) {
ee(e, t, i, n);
},
get _() {
return C(e, t, r);
}
});
import { jsx as u, jsxs as U, Fragment as mi } from "react/jsx-runtime";
import * as te from "react";
import We, { isValidElement as Wr, cloneElement as Ur, Children as mc, useMemo as Ie, useState as at, useEffect as ot, useCallback as we, useRef as pt, useReducer as hc, forwardRef as gc, useImperativeHandle as yc, Fragment as vc, createElement as xc } from "react";
import { appendErrors as bc, useFieldArray as wc, useWatch as Sc, Controller as Pe, useForm as Cc } from "react-hook-form";
import { validateFieldsNatively as Ec, toNestErrors as kc } from "@hookform/resolvers";
import { InputAdornment as Ns, Box as q, Typography as se, TextField as hi, Select as Ls, MenuItem as Gi, Divider as gi, FormControl as Aa, InputLabel as Tc, CircularProgress as ar, OutlinedInput as Oc, FormHelperText as $a, Autocomplete as Fc, Checkbox as gr, FormControlLabel as Un, FormLabel as Bs, Switch as Vs, RadioGroup as Ac, Radio as $c, Button as Ve, Chip as Ra, StepConnector as qs, stepConnectorClasses as nn, Stepper as Ws, Step as Us, StepLabel as Hs, Card as st, List as io, ListItem as ao, ListItemText as oo, Tabs as Rc, Tab as Pc, TableContainer as _c, Table as Dc, TableHead as Ic, TableRow as so, TableCell as Dn, TableBody as Mc, IconButton as yi, CardContent as jc, Tooltip as Hr, Dialog as zc, DialogTitle as Nc, DialogContent as Lc, DialogActions as Bc, LinearProgress as Vc, ButtonGroup as qc, createTheme as Wc, ThemeProvider as Uc, Paper as Hc, Alert as Yc } from "@mui/material";
import Kc from "@emotion/styled";
import { ThemeContext as Qc, keyframes as Tr, css as Ys } from "@emotion/react";
import { DatePicker as Gc } from "@mui/x-date-pickers/DatePicker";
import Vn from "dayjs";
import Zc from "dayjs/plugin/customParseFormat";
function Xc(e, t, n) {
return n === void 0 && (n = {}), function(r, i, a) {
try {
return Promise.resolve(function(o, s) {
try {
var l = (t != null && t.context && process.env.NODE_ENV === "development" && console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"), Promise.resolve(e[n.mode === "sync" ? "validateSync" : "validate"](r, Object.assign({ abortEarly: !1 }, t, { context: i }))).then(function(c) {
return a.shouldUseNativeValidation && Ec({}, a), { values: n.raw ? Object.assign({}, r) : c, errors: {} };
}));
} catch (c) {
return s(c);
}
return l && l.then ? l.then(void 0, s) : l;
}(0, function(o) {
if (!o.inner) throw o;
return { values: {}, errors: kc((s = o, l = !a.shouldUseNativeValidation && a.criteriaMode === "all", (s.inner || []).reduce(function(c, m) {
if (c[m.path] || (c[m.path] = { message: m.message, type: m.type }), l) {
var h = c[m.path].types, d = h && h[m.type];
c[m.path] = bc(m.path, l, c, m.type, d ? [].concat(d, m.message) : m.message);
}
return c;
}, {})), a) };
var s, l;
}));
} catch (o) {
return Promise.reject(o);
}
};
}
var Or = class {
constructor() {
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
}
subscribe(e) {
return this.listeners.add(e), this.onSubscribe(), () => {
this.listeners.delete(e), this.onUnsubscribe();
};
}
hasListeners() {
return this.listeners.size > 0;
}
onSubscribe() {
}
onUnsubscribe() {
}
}, On = typeof window > "u" || "Deno" in globalThis;
function rt() {
}
function Jc(e, t) {
return typeof e == "function" ? e(t) : e;
}
function Zi(e) {
return typeof e == "number" && e >= 0 && e !== 1 / 0;
}
function Ks(e, t) {
return Math.max(e + (t || 0) - Date.now(), 0);
}
function an(e, t) {
return typeof e == "function" ? e(t) : e;
}
function bt(e, t) {
return typeof e == "function" ? e(t) : e;
}
function lo(e, t) {
const {
type: n = "all",
exact: r,
fetchStatus: i,
predicate: a,
queryKey: o,
stale: s
} = e;
if (o) {
if (r) {
if (t.queryHash !== Pa(o, t.options))
return !1;
} else if (!xr(t.queryKey, o))
return !1;
}
if (n !== "all") {
const l = t.isActive();
if (n === "active" && !l || n === "inactive" && l)
return !1;
}
return !(typeof s == "boolean" && t.isStale() !== s || i && i !== t.state.fetchStatus || a && !a(t));
}
function co(e, t) {
const { exact: n, status: r, predicate: i, mutationKey: a } = e;
if (a) {
if (!t.options.mutationKey)
return !1;
if (n) {
if (vr(t.options.mutationKey) !== vr(a))
return !1;
} else if (!xr(t.options.mutationKey, a))
return !1;
}
return !(r && t.state.status !== r || i && !i(t));
}
function Pa(e, t) {
return ((t == null ? void 0 : t.queryKeyHashFn) || vr)(e);
}
function vr(e) {
return JSON.stringify(
e,
(t, n) => ea(n) ? Object.keys(n).sort().reduce((r, i) => (r[i] = n[i], r), {}) : n
);
}
function xr(e, t) {
return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? Object.keys(t).every((n) => xr(e[n], t[n])) : !1;
}
function Xi(e, t) {
if (e === t)
return e;
const n = uo(e) && uo(t);
if (n || ea(e) && ea(t)) {
const r = n ? e : Object.keys(e), i = r.length, a = n ? t : Object.keys(t), o = a.length, s = n ? [] : {}, l = new Set(r);
let c = 0;
for (let m = 0; m < o; m++) {
const h = n ? m : a[m];
(!n && l.has(h) || n) && e[h] === void 0 && t[h] === void 0 ? (s[h] = void 0, c++) : (s[h] = Xi(e[h], t[h]), s[h] === e[h] && e[h] !== void 0 && c++);
}
return i === o && c === i ? e : s;
}
return t;
}
function Ji(e, t) {
if (!t || Object.keys(e).length !== Object.keys(t).length)
return !1;
for (const n in e)
if (e[n] !== t[n])
return !1;
return !0;
}
function uo(e) {
return Array.isArray(e) && e.length === Object.keys(e).length;
}
function ea(e) {
if (!po(e))
return !1;
const t = e.constructor;
if (t === void 0)
return !0;
const n = t.prototype;
return !(!po(n) || !n.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
}
function po(e) {
return Object.prototype.toString.call(e) === "[object Object]";
}
function eu(e) {
return new Promise((t) => {
setTimeout(t, e);
});
}
function ta(e, t, n) {
if (typeof n.structuralSharing == "function")
return n.structuralSharing(e, t);
if (n.structuralSharing !== !1) {
if (process.env.NODE_ENV !== "production")
try {
return Xi(e, t);
} catch (r) {
throw console.error(
`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`
), r;
}
return Xi(e, t);
}
return t;
}
function tu(e, t, n = 0) {
const r = [...e, t];
return n && r.length > n ? r.slice(1) : r;
}
function nu(e, t, n = 0) {
const r = [t, ...e];
return n && r.length > n ? r.slice(0, -1) : r;
}
var Jr = Symbol();
function Qs(e, t) {
return process.env.NODE_ENV !== "production" && e.queryFn === Jr && console.error(
`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`
), !e.queryFn && (t != null && t.initialPromise) ? () => t.initialPromise : !e.queryFn || e.queryFn === Jr ? () => Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn;
}
function ru(e, t) {
return typeof e == "function" ? e(...t) : !!e;
}
var yn, Kt, Yn, $s, iu = ($s = class extends Or {
constructor() {
super();
pe(this, yn);
pe(this, Kt);
pe(this, Yn);
ee(this, Yn, (t) => {
if (!On && window.addEventListener) {
const n = () => t();
return window.addEventListener("visibilitychange", n, !1), () => {
window.removeEventListener("visibilitychange", n);
};
}
});
}
onSubscribe() {
C(this, Kt) || this.setEventListener(C(this, Yn));
}
onUnsubscribe() {
var t;
this.hasListeners() || ((t = C(this, Kt)) == null || t.call(this), ee(this, Kt, void 0));
}
setEventListener(t) {
var n;
ee(this, Yn, t), (n = C(this, Kt)) == null || n.call(this), ee(this, Kt, t((r) => {
typeof r == "boolean" ? this.setFocused(r) : this.onFocus();
}));
}
setFocused(t) {
C(this, yn) !== t && (ee(this, yn, t), this.onFocus());
}
onFocus() {
const t = this.isFocused();
this.listeners.forEach((n) => {
n(t);
});
}
isFocused() {
var t;
return typeof C(this, yn) == "boolean" ? C(this, yn) : ((t = globalThis.document) == null ? void 0 : t.visibilityState) !== "hidden";
}
}, yn = new WeakMap(), Kt = new WeakMap(), Yn = new WeakMap(), $s), _a = new iu(), Kn, Qt, Qn, Rs, au = (Rs = class extends Or {
constructor() {
super();
pe(this, Kn, !0);
pe(this, Qt);
pe(this, Qn);
ee(this, Qn, (t) => {
if (!On && window.addEventListener) {
const n = () => t(!0), r = () => t(!1);
return window.addEventListener("online", n, !1), window.addEventListener("offline", r, !1), () => {
window.removeEventListener("online", n), window.removeEventListener("offline", r);
};
}
});
}
onSubscribe() {
C(this, Qt) || this.setEventListener(C(this, Qn));
}
onUnsubscribe() {
var t;
this.hasListeners() || ((t = C(this, Qt)) == null || t.call(this), ee(this, Qt, void 0));
}
setEventListener(t) {
var n;
ee(this, Qn, t), (n = C(this, Qt)) == null || n.call(this), ee(this, Qt, t(this.setOnline.bind(this)));
}
setOnline(t) {
C(this, Kn) !== t && (ee(this, Kn, t), this.listeners.forEach((r) => {
r(t);
}));
}
isOnline() {
return C(this, Kn);
}
}, Kn = new WeakMap(), Qt = new WeakMap(), Qn = new WeakMap(), Rs), ei = new au();
function na() {
let e, t;
const n = new Promise((i, a) => {
e = i, t = a;
});
n.status = "pending", n.catch(() => {
});
function r(i) {
Object.assign(n, i), delete n.resolve, delete n.reject;
}
return n.resolve = (i) => {
r({
status: "fulfilled",
value: i
}), e(i);
}, n.reject = (i) => {
r({
status: "rejected",
reason: i
}), t(i);
}, n;
}
function ou(e) {
return Math.min(1e3 * 2 ** e, 3e4);
}
function Gs(e) {
return (e ?? "online") === "online" ? ei.isOnline() : !0;
}
var Zs = class extends Error {
constructor(e) {
super("CancelledError"), this.revert = e == null ? void 0 : e.revert, this.silent = e == null ? void 0 : e.silent;
}
};
function $i(e) {
return e instanceof Zs;
}
function Xs(e) {
let t = !1, n = 0, r = !1, i;
const a = na(), o = (f) => {
var E;
r || (d(new Zs(f)), (E = e.abort) == null || E.call(e));
}, s = () => {
t = !0;
}, l = () => {
t = !1;
}, c = () => _a.isFocused() && (e.networkMode === "always" || ei.isOnline()) && e.canRun(), m = () => Gs(e.networkMode) && e.canRun(), h = (f) => {
var E;
r || (r = !0, (E = e.onSuccess) == null || E.call(e, f), i == null || i(), a.resolve(f));
}, d = (f) => {
var E;
r || (r = !0, (E = e.onError) == null || E.call(e, f), i == null || i(), a.reject(f));
}, g = () => new Promise((f) => {
var E;
i = (y) => {
(r || c()) && f(y);
}, (E = e.onPause) == null || E.call(e);
}).then(() => {
var f;
i = void 0, r || (f = e.onContinue) == null || f.call(e);
}), x = () => {
if (r)
return;
let f;
const E = n === 0 ? e.initialPromise : void 0;
try {
f = E ?? e.fn();
} catch (y) {
f = Promise.reject(y);
}
Promise.resolve(f).then(h).catch((y) => {
var P;
if (r)
return;
const T = e.retry ?? (On ? 0 : 3), k = e.retryDelay ?? ou, v = typeof k == "function" ? k(n, y) : k, w = T === !0 || typeof T == "number" && n < T || typeof T == "function" && T(n, y);
if (t || !w) {
d(y);
return;
}
n++, (P = e.onFail) == null || P.call(e, n, y), eu(v).then(() => c() ? void 0 : g()).then(() => {
t ? d(y) : x();
});
});
};
return {
promise: a,
cancel: o,
continue: () => (i == null || i(), a),
cancelRetry: s,
continueRetry: l,
canStart: m,
start: () => (m() ? x() : g().then(x), a)
};
}
var su = (e) => setTimeout(e, 0);
function lu() {
let e = [], t = 0, n = (s) => {
s();
}, r = (s) => {
s();
}, i = su;
const a = (s) => {
t ? e.push(s) : i(() => {
n(s);
});
}, o = () => {
const s = e;
e = [], s.length && i(() => {
r(() => {
s.forEach((l) => {
n(l);
});
});
});
};
return {
batch: (s) => {
let l;
t++;
try {
l = s();
} finally {
t--, t || o();
}
return l;
},
/**
* All calls to the wrapped function will be batched.
*/
batchCalls: (s) => (...l) => {
a(() => {
s(...l);
});
},
schedule: a,
/**
* Use this method to set a custom notify function.
* This can be used to for example wrap notifications with `React.act` while running tests.
*/
setNotifyFunction: (s) => {
n = s;
},
/**
* Use this method to set a custom function to batch notifications together into a single tick.
* By default React Query will use the batch function provided by ReactDOM or React Native.
*/
setBatchNotifyFunction: (s) => {
r = s;
},
setScheduler: (s) => {
i = s;
}
};
}
var Ue = lu(), vn, Ps, Js = (Ps = class {
constructor() {
pe(this, vn);
}
destroy() {
this.clearGcTimeout();
}
scheduleGc() {
this.clearGcTimeout(), Zi(this.gcTime) && ee(this, vn, setTimeout(() => {
this.optionalRemove();
}, this.gcTime));
}
updateGcTime(e) {
this.gcTime = Math.max(
this.gcTime || 0,
e ?? (On ? 1 / 0 : 5 * 60 * 1e3)
);
}
clearGcTimeout() {
C(this, vn) && (clearTimeout(C(this, vn)), ee(this, vn, void 0));
}
}, vn = new WeakMap(), Ps), Gn, xn, vt, bn, He, Sr, wn, kt, Bt, _s, cu = (_s = class extends Js {
constructor(t) {
super();
pe(this, kt);
pe(this, Gn);
pe(this, xn);
pe(this, vt);
pe(this, bn);
pe(this, He);
pe(this, Sr);
pe(this, wn);
ee(this, wn, !1), ee(this, Sr, t.defaultOptions), this.setOptions(t.options), this.observers = [], ee(this, bn, t.client), ee(this, vt, C(this, bn).getQueryCache()), this.queryKey = t.queryKey, this.queryHash = t.queryHash, ee(this, Gn, uu(this.options)), this.state = t.state ?? C(this, Gn), this.scheduleGc();
}
get meta() {
return this.options.meta;
}
get promise() {
var t;
return (t = C(this, He)) == null ? void 0 : t.promise;
}
setOptions(t) {
this.options = { ...C(this, Sr), ...t }, this.updateGcTime(this.options.gcTime);
}
optionalRemove() {
!this.observers.length && this.state.fetchStatus === "idle" && C(this, vt).remove(this);
}
setData(t, n) {
const r = ta(this.state.data, t, this.options);
return xe(this, kt, Bt).call(this, {
data: r,
type: "success",
dataUpdatedAt: n == null ? void 0 : n.updatedAt,
manual: n == null ? void 0 : n.manual
}), r;
}
setState(t, n) {
xe(this, kt, Bt).call(this, { type: "setState", state: t, setStateOptions: n });
}
cancel(t) {
var r, i;
const n = (r = C(this, He)) == null ? void 0 : r.promise;
return (i = C(this, He)) == null || i.cancel(t), n ? n.then(rt).catch(rt) : Promise.resolve();
}
destroy() {
super.destroy(), this.cancel({ silent: !0 });
}
reset() {
this.destroy(), this.setState(C(this, Gn));
}
isActive() {
return this.observers.some(
(t) => bt(t.options.enabled, this) !== !1
);
}
isDisabled() {
return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === Jr || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
}
isStatic() {
return this.getObserversCount() > 0 ? this.observers.some(
(t) => an(t.options.staleTime, this) === "static"
) : !1;
}
isStale() {
return this.getObserversCount() > 0 ? this.observers.some(
(t) => t.getCurrentResult().isStale
) : this.state.data === void 0 || this.state.isInvalidated;
}
isStaleByTime(t = 0) {
return this.state.data === void 0 ? !0 : t === "static" ? !1 : this.state.isInvalidated ? !0 : !Ks(this.state.dataUpdatedAt, t);
}
onFocus() {
var n;
const t = this.observers.find((r) => r.shouldFetchOnWindowFocus());
t == null || t.refetch({ cancelRefetch: !1 }), (n = C(this, He)) == null || n.continue();
}
onOnline() {
var n;
const t = this.observers.find((r) => r.shouldFetchOnReconnect());
t == null || t.refetch({ cancelRefetch: !1 }), (n = C(this, He)) == null || n.continue();
}
addObserver(t) {
this.observers.includes(t) || (this.observers.push(t), this.clearGcTimeout(), C(this, vt).notify({ type: "observerAdded", query: this, observer: t }));
}
removeObserver(t) {
this.observers.includes(t) && (this.observers = this.observers.filter((n) => n !== t), this.observers.length || (C(this, He) && (C(this, wn) ? C(this, He).cancel({ revert: !0 }) : C(this, He).cancelRetry()), this.scheduleGc()), C(this, vt).notify({ type: "observerRemoved", query: this, observer: t }));
}
getObserversCount() {
return this.observers.length;
}
invalidate() {
this.state.isInvalidated || xe(this, kt, Bt).call(this, { type: "invalidate" });
}
fetch(t, n) {
var c, m, h;
if (this.state.fetchStatus !== "idle") {
if (this.state.data !== void 0 && (n != null && n.cancelRefetch))
this.cancel({ silent: !0 });
else if (C(this, He))
return C(this, He).continueRetry(), C(this, He).promise;
}
if (t && this.setOptions(t), !this.options.queryFn) {
const d = this.observers.find((g) => g.options.queryFn);
d && this.setOptions(d.options);
}
process.env.NODE_ENV !== "production" && (Array.isArray(this.options.queryKey) || console.error(
"As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"
));
const r = new AbortController(), i = (d) => {
Object.defineProperty(d, "signal", {
enumerable: !0,
get: () => (ee(this, wn, !0), r.signal)
});
}, a = () => {
const d = Qs(this.options, n), x = (() => {
const f = {
client: C(this, bn),
queryKey: this.queryKey,
meta: this.meta
};
return i(f), f;
})();
return ee(this, wn, !1), this.options.persister ? this.options.persister(
d,
x,
this
) : d(x);
}, s = (() => {
const d = {
fetchOptions: n,
options: this.options,
queryKey: this.queryKey,
client: C(this, bn),
state: this.state,
fetchFn: a
};
return i(d), d;
})();
(c = this.options.behavior) == null || c.onFetch(s, this), ee(this, xn, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((m = s.fetchOptions) == null ? void 0 : m.meta)) && xe(this, kt, Bt).call(this, { type: "fetch", meta: (h = s.fetchOptions) == null ? void 0 : h.meta });
const l = (d) => {
var g, x, f, E;
$i(d) && d.silent || xe(this, kt, Bt).call(this, {
type: "error",
error: d
}), $i(d) || ((x = (g = C(this, vt).config).onError) == null || x.call(
g,
d,
this
), (E = (f = C(this, vt).config).onSettled) == null || E.call(
f,
this.state.data,
d,
this
)), this.scheduleGc();
};
return ee(this, He, Xs({
initialPromise: n == null ? void 0 : n.initialPromise,
fn: s.fetchFn,
abort: r.abort.bind(r),
onSuccess: (d) => {
var g, x, f, E;
if (d === void 0) {
process.env.NODE_ENV !== "production" && console.error(
`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
), l(new Error(`${this.queryHash} data is undefined`));
return;
}
try {
this.setData(d);
} catch (y) {
l(y);
return;
}
(x = (g = C(this, vt).config).onSuccess) == null || x.call(g, d, this), (E = (f = C(this, vt).config).onSettled) == null || E.call(
f,
d,
this.state.error,
this
), this.scheduleGc();
},
onError: l,
onFail: (d, g) => {
xe(this, kt, Bt).call(this, { type: "failed", failureCount: d, error: g });
},
onPause: () => {
xe(this, kt, Bt).call(this, { type: "pause" });
},
onContinue: () => {
xe(this, kt, Bt).call(this, { type: "continue" });
},
retry: s.options.retry,
retryDelay: s.options.retryDelay,
networkMode: s.options.networkMode,
canRun: () => !0
})), C(this, He).start();
}
}, Gn = new WeakMap(), xn = new WeakMap(), vt = new WeakMap(), bn = new WeakMap(), He = new WeakMap(), Sr = new WeakMap(), wn = new WeakMap(), kt = new WeakSet(), Bt = function(t) {
const n = (r) => {
switch (t.type) {
case "failed":
return {
...r,
fetchFailureCount: t.failureCount,
fetchFailureReason: t.error
};
case "pause":
return {
...r,
fetchStatus: "paused"
};
case "continue":
return {
...r,
fetchStatus: "fetching"
};
case "fetch":
return {
...r,
...el(r.data, this.options),
fetchMeta: t.meta ?? null
};
case "success":
return ee(this, xn, void 0), {
...r,
data: t.data,
dataUpdateCount: r.dataUpdateCount + 1,
dataUpdatedAt: t.dataUpdatedAt ?? Date.now(),
error: null,
isInvalidated: !1,
status: "success",
...!t.manual && {
fetchStatus: "idle",
fetchFailureCount: 0,
fetchFailureReason: null
}
};
case "error":
const i = t.error;
return $i(i) && i.revert && C(this, xn) ? { ...C(this, xn), fetchStatus: "idle" } : {
...r,
error: i,
errorUpdateCount: r.errorUpdateCount + 1,
errorUpdatedAt: Date.now(),
fetchFailureCount: r.fetchFailureCount + 1,
fetchFailureReason: i,
fetchStatus: "idle",
status: "error"
};
case "invalidate":
return {
...r,
isInvalidated: !0
};
case "setState":
return {
...r,
...t.state
};
}
};
this.state = n(this.state), Ue.batch(() => {
this.observers.forEach((r) => {
r.onQueryUpdate();
}), C(this, vt).notify({ query: this, type: "updated", action: t });
});
}, _s);
function el(e, t) {
return {
fetchFailureCount: 0,
fetchFailureReason: null,
fetchStatus: Gs(t.networkMode) ? "fetching" : "paused",
...e === void 0 && {
error: null,
status: "pending"
}
};
}
function uu(e) {
const t = typeof e.initialData == "function" ? e.initialData() : e.initialData, n = t !== void 0, r = n ? typeof e.initialDataUpdatedAt == "function" ? e.initialDataUpdatedAt() : e.initialDataUpdatedAt : 0;
return {
data: t,
dataUpdateCount: 0,
dataUpdatedAt: n ? r ?? Date.now() : 0,
error: null,
errorUpdateCount: 0,
errorUpdatedAt: 0,
fetchFailureCount: 0,
fetchFailureReason: null,
fetchMeta: null,
isInvalidated: !1,
status: n ? "success" : "pending",
fetchStatus: "idle"
};
}
var Rt, Ds, pu = (Ds = class extends Or {
constructor(t = {}) {
super();
pe(this, Rt);
this.config = t, ee(this, Rt, /* @__PURE__ */ new Map());
}
build(t, n, r) {
const i = n.queryKey, a = n.queryHash ?? Pa(i, n);
let o = this.get(a);
return o || (o = new cu({
client: t,
queryKey: i,
queryHash: a,
options: t.defaultQueryOptions(n),
state: r,
defaultOptions: t.getQueryDefaults(i)
}), this.add(o)), o;
}
add(t) {
C(this, Rt).has(t.queryHash) || (C(this, Rt).set(t.queryHash, t), this.notify({
type: "added",
query: t
}));
}
remove(t) {
const n = C(this, Rt).get(t.queryHash);
n && (t.destroy(), n === t && C(this, Rt).delete(t.queryHash), this.notify({ type: "removed", query: t }));
}
clear() {
Ue.batch(() => {
this.getAll().forEach((t) => {
this.remove(t);
});
});
}
get(t) {
return C(this, Rt).get(t);
}
getAll() {
return [...C(this, Rt).values()];
}
find(t) {
const n = { exact: !0, ...t };
return this.getAll().find(
(r) => lo(n, r)
);
}
findAll(t = {}) {
const n = this.getAll();
return Object.keys(t).length > 0 ? n.filter((r) => lo(t, r)) : n;
}
notify(t) {
Ue.batch(() => {
this.listeners.forEach((n) => {
n(t);
});
});
}
onFocus() {
Ue.batch(() => {
this.getAll().forEach((t) => {
t.onFocus();
});
});
}
onOnline() {
Ue.batch(() => {
this.getAll().forEach((t) => {
t.onOnline();
});
});
}
}, Rt = new WeakMap(), Ds), Pt, Qe, Sn, _t, Ut, Is, du = (Is = class extends Js {
constructor(t) {
super();
pe(this, _t);
pe(this, Pt);
pe(this, Qe);
pe(this, Sn);
this.mutationId = t.mutationId, ee(this, Qe, t.mutationCache), ee(this, Pt, []), this.state = t.state || fu(), this.setOptions(t.options), this.scheduleGc();
}
setOptions(t) {
this.options = t, this.updateGcTime(this.options.gcTime);
}
get meta() {
return this.options.meta;
}
addObserver(t) {
C(this, Pt).includes(t) || (C(this, Pt).push(t), this.clearGcTimeout(), C(this, Qe).notify({
type: "observerAdded",
mutation: this,
observer: t
}));
}
removeObserver(t) {
ee(this, Pt, C(this, Pt).filter((n) => n !== t)), this.scheduleGc(), C(this, Qe).notify({
type: "observerRemoved",
mutation: this,
observer: t
});
}
optionalRemove() {
C(this, Pt).length || (this.state.status === "pending" ? this.scheduleGc() : C(this, Qe).remove(this));
}
continue() {
var t;
return ((t = C(this, Sn)) == null ? void 0 : t.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before
this.execute(this.state.variables);
}
async execute(t) {
var a, o, s, l, c, m, h, d, g, x, f, E, y, T, k, v, w, P, M, I;
const n = () => {
xe(this, _t, Ut).call(this, { type: "continue" });
};
ee(this, Sn, Xs({
fn: () => this.options.mutationFn ? this.options.mutationFn(t) : Promise.reject(new Error("No mutationFn found")),
onFail: (N, p) => {
xe(this, _t, Ut).call(this, { type: "failed", failureCount: N, error: p });
},
onPause: () => {
xe(this, _t, Ut).call(this, { type: "pause" });
},
onContinue: n,
retry: this.options.retry ?? 0,
retryDelay: this.options.retryDelay,
networkMode: this.options.networkMode,
canRun: () => C(this, Qe).canRun(this)
}));
const r = this.state.status === "pending", i = !C(this, Sn).canStart();
try {
if (r)
n();
else {
xe(this, _t, Ut).call(this, { type: "pending", variables: t, isPaused: i }), await ((o = (a = C(this, Qe).config).onMutate) == null ? void 0 : o.call(
a,
t,
this
));
const p = await ((l = (s = this.options).onMutate) == null ? void 0 : l.call(s, t));
p !== this.state.context && xe(this, _t, Ut).call(this, {
type: "pending",
context: p,
variables: t,
isPaused: i
});
}
const N = await C(this, Sn).start();
return await ((m = (c = C(this, Qe).config).onSuccess) == null ? void 0 : m.call(
c,
N,
t,
this.state.context,
this
)), await ((d = (h = this.options).onSuccess) == null ? void 0 : d.call(h, N, t, this.state.context)), await ((x = (g = C(this, Qe).config).onSettled) == null ? void 0 : x.call(
g,
N,
null,
this.state.variables,
this.state.context,
this
)), await ((E = (f = this.options).onSettled) == null ? void 0 : E.call(f, N, null, t, this.state.context)), xe(this, _t, Ut).call(this, { type: "success", data: N }), N;
} catch (N) {
try {
throw await ((T = (y = C(this, Qe).config).onError) == null ? void 0 : T.call(
y,
N,
t,
this.state.context,
this
)), await ((v = (k = this.options).onError) == null ? void 0 : v.call(
k,
N,
t,
this.state.context
)), await ((P = (w = C(this, Qe).config).onSettled) == null ? void 0 : P.call(
w,
void 0,
N,
this.state.variables,
this.state.context,
this
)), await ((I = (M = this.options).onSettled) == null ? void 0 : I.call(
M,
void 0,
N,
t,
this.state.context
)), N;
} finally {
xe(this, _t, Ut).call(this, { type: "error", error: N });
}
} finally {
C(this, Qe).runNext(this);
}
}
}, Pt = new WeakMap(), Qe = new WeakMap(), Sn = new WeakMap(), _t = new WeakSet(), Ut = function(t) {
const n = (r) => {
switch (t.type) {
case "failed":
return {
...r,
failureCount: t.failureCount,
failureReason: t.error
};
case "pause":
return {
...r,
isPaused: !0
};
case "continue":
return {
...r,
isPaused: !1
};
case "pending":
return {
...r,
context: t.context,
data: void 0,
failureCount: 0,
failureReason: null,
error: null,
isPaused: t.isPaused,
status: "pending",
variables: t.variables,
submittedAt: Date.now()
};
case "success":
return {
...r,
data: t.data,
failureCount: 0,
failureReason: null,
error: null,
status: "success",
isPaused: !1
};
case "error":
return {
...r,
data: void 0,
error: t.error,
failureCount: r.failureCount + 1,
failureReason: t.error,
isPaused: !1,
status: "error"
};
}
};
this.state = n(this.state), Ue.batch(() => {
C(this, Pt).forEach((r) => {
r.onMutationUpdate(t);
}), C(this, Qe).notify({
mutation: this,
type: "updated",
action: t
});
});
}, Is);
function fu() {
return {
context: void 0,
data: void 0,
error: null,
failureCount: 0,
failureReason: null,
isPaused: !1,
status: "idle",
variables: void 0,
submittedAt: 0
};
}
var Vt, Tt, Cr, Ms, mu = (Ms = class extends Or {
constructor(t = {}) {
super();
pe(this, Vt);
pe(this, Tt);
pe(this, Cr);
this.config = t, ee(this, Vt, /* @__PURE__ */ new Set()), ee(this, Tt, /* @__PURE__ */ new Map()), ee(this, Cr, 0);
}
build(t, n, r) {
const i = new du({
mutationCache: this,
mutationId: ++_r(this, Cr)._,
options: t.defaultMutationOptions(n),
state: r
});
return this.add(i), i;
}
add(t) {
C(this, Vt).add(t);
const n = Dr(t);
if (typeof n == "string") {
const r = C(this, Tt).get(n);
r ? r.push(t) : C(this, Tt).set(n, [t]);
}
this.notify({ type: "added", mutation: t });
}
remove(t) {
if (C(this, Vt).delete(t)) {
const n = Dr(t);
if (typeof n == "string") {
const r = C(this, Tt).get(n);
if (r)
if (r.length > 1) {
const i = r.indexOf(t);
i !== -1 && r.splice(i, 1);
} else r[0] === t && C(this, Tt).delete(n);
}
}
this.notify({ type: "removed", mutation: t });
}
canRun(t) {
const n = Dr(t);
if (typeof n == "string") {
const r = C(this, Tt).get(n), i = r == null ? void 0 : r.find(
(a) => a.state.status === "pending"
);
return !i || i === t;
} else
return !0;
}
runNext(t) {
var r;
const n = Dr(t);
if (typeof n == "string") {
const i = (r = C(this, Tt).get(n)) == null ? void 0 : r.find((a) => a !== t && a.state.isPaused);
return (i == null ? void 0 : i.continue()) ?? Promise.resolve();
} else
return Promise.resolve();
}
clear() {
Ue.batch(() => {
C(this, Vt).forEach((t) => {
this.notify({ type: "removed", mutation: t });
}), C(this, Vt).clear(), C(this, Tt).clear();
});
}
getAll() {
return Array.from(C(this, Vt));
}
find(t) {
const n = { exact: !0, ...t };
return this.getAll().find(
(r) => co(n, r)
);
}
findAll(t = {}) {
return this.getAll().filter((n) => co(t, n));
}
notify(t) {
Ue.batch(() => {
this.listeners.forEach((n) => {
n(t);
});
});
}
resumePausedMutations() {
const t = this.getAll().filter((n) => n.state.isPaused);
return Ue.batch(
() => Promise.all(
t.map((n) => n.continue().catch(rt))
)
);
}
}, Vt = new WeakMap(), Tt = new WeakMap(), Cr = new WeakMap(), Ms);
function Dr(e) {
var t;
return (t = e.options.scope) == null ? void 0 : t.id;
}
function fo(e) {
return {
onFetch: (t, n) => {
var m, h, d, g, x;
const r = t.options, i = (d = (h = (m = t.fetchOptions) == null ? void 0 : m.meta) == null ? void 0 : h.fetchMore) == null ? void 0 : d.direction, a = ((g = t.state.data) == null ? void 0 : g.pages) || [], o = ((x = t.state.data) == null ? void 0 : x.pageParams) || [];
let s = { pages: [], pageParams: [] }, l = 0;
const c = async () => {
let f = !1;
const E = (k) => {
Object.defineProperty(k, "signal", {
enumerable: !0,
get: () => (t.signal.aborted ? f = !0 : t.signal.addEventListener("abort", () => {
f = !0;
}), t.signal)
});
}, y = Qs(t.options, t.fetchOptions), T = async (k, v, w) => {
if (f)
return Promise.reject();
if (v == null && k.pages.length)
return Promise.resolve(k);
const M = (() => {
const R = {
client: t.client,
queryKey: t.queryKey,
pageParam: v,
direction: w ? "backward" : "forward",
meta: t.options.meta
};
return E(R), R;
})(), I = await y(M), { maxPages: N } = t.options, p = w ? nu : tu;
return {
pages: p(k.pages, I, N),
pageParams: p(k.pageParams, v, N)
};
};
if (i && a.length) {
const k = i === "backward", v = k ? hu : mo, w = {
pages: a,
pageParams: o
}, P = v(r, w);
s = await T(w, P, k);
} else {
const k = e ?? a.length;
do {
const v = l === 0 ? o[0] ?? r.initialPageParam : mo(r, s);
if (l > 0 && v == null)
break;
s = await T(s, v), l++;
} while (l < k);
}
return s;
};
t.options.persister ? t.fetchFn = () => {
var f, E;
return (E = (f = t.options).persister) == null ? void 0 : E.call(
f,
c,
{
client: t.client,
queryKey: t.queryKey,
meta: t.options.meta,
signal: t.signal
},
n
);
} : t.fetchFn = c;
}
};
}
function mo(e, { pages: t, pageParams: n }) {
const r = t.length - 1;
return t.length > 0 ? e.getNextPageParam(
t[r],
t,
n[r],
n
) : void 0;
}
function hu(e, { pages: t, pageParams: n }) {
var r;
return t.length > 0 ? (r = e.getPreviousPageParam) == null ? void 0 : r.call(e, t[0], t, n[0], n) : void 0;
}
var Ne, Gt, Zt, Zn, Xn, Xt, Jn, er, js, gu = (js = class {
constructor(e = {}) {
pe(this, Ne);
pe(this, Gt);
pe(this, Zt);
pe(this, Zn);
pe(this, Xn);
pe(this, Xt);
pe(this, Jn);
pe(this, er);
ee(this, Ne, e.queryCache || new pu()), ee(this, Gt, e.mutationCache || new mu()), ee(this, Zt, e.defaultOptions || {}), ee(this, Zn, /* @__PURE__ */ new Map()), ee(this, Xn, /* @__PURE__ */ new Map()), ee(this, Xt, 0);
}
mount() {
_r(this, Xt)._++, C(this, Xt) === 1 && (ee(this, Jn, _a.subscribe(async (e) => {
e && (await this.resumePausedMutations(), C(this, Ne).onFocus());
})), ee(this, er, ei.subscribe(async (e) => {
e && (await this.resumePausedMutations(), C(this, Ne).onOnline());
})));
}
unmount() {
var e, t;
_r(this, Xt)._--, C(this, Xt) === 0 && ((e = C(this, Jn)) == null || e.call(this), ee(this, Jn, void 0), (t = C(this, er)) == null || t.call(this), ee(this, er, void 0));
}
isFetching(e) {
return C(this, Ne).findAll({ ...e, fetchStatus: "fetching" }).length;
}
isMutating(e) {
return C(this, Gt).findAll({ ...e, status: "pending" }).length;
}
/**
* Imperative (non-reactive) way to retrieve data for a QueryKey.
* Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.
*
* Hint: Do not use this function inside a component, because it won't receive updates.
* Use `useQuery` to create a `QueryObserver` that subscribes to changes.
*/
getQueryData(e) {
var n;
const t = this.defaultQueryOptions({ queryKey: e });
return (n = C(this, Ne).get(t.queryHash)) == null ? void 0 : n.state.data;
}
ensureQueryData(e) {
const t = this.defaultQueryOptions(e), n = C(this, Ne).build(this, t), r = n.state.data;
return r === void 0 ? this.fetchQuery(e) : (e.revalidateIfStale && n.isStaleByTime(an(t.staleTime, n)) && this.prefetchQuery(t), Promise.resolve(r));
}
getQueriesData(e) {
return C(this, Ne).findAll(e).map(({ queryKey: t, state: n }) => {
const r = n.data;
return [t, r];
});
}
setQueryData(e, t, n) {
const r = this.defaultQueryOptions({ queryKey: e }), i = C(this, Ne).get(
r.queryHash
), a = i == null ? void 0 : i.state.data, o = Jc(t, a);
if (o !== void 0)
return C(this, Ne).build(this, r).setData(o, { ...n, manual: !0 });
}
setQueriesData(e, t, n) {
return Ue.batch(
() => C(this, Ne).findAll(e).map(({ queryKey: r }) => [
r,
this.setQueryData(r, t, n)
])
);
}
getQueryState(e) {
var n;
const t = this.defaultQueryOptions({ queryKey: e });
return (n = C(this, Ne).get(
t.queryHash
)) == null ? void 0 : n.state;
}
removeQueries(e) {
const t = C(this, Ne);
Ue.batch(() => {
t.findAll(e).forEach((n) => {
t.remove(n);
});
});
}
resetQueries(e, t) {
const n = C(this, Ne);
return Ue.batch(() => (n.findAll(e).forEach((r) => {
r.reset();
}), this.refetchQueries(
{
type: "active",
...e
},
t
)));
}
cancelQueries(e, t = {}) {
const n = { revert: !0, ...t }, r = Ue.batch(
() => C(this, Ne).findAll(e).map((i) => i.cancel(n))
);
return Promise.all(r).then(rt).catch(rt);
}
invalidateQueries(e, t = {}) {
return Ue.batch(() => (C(this, Ne).findAll(e).forEach((n) => {
n.invalidate();
}), (e == null ? void 0 : e.refetchType) === "none" ? Promise.resolve() : this.refetchQueries(
{
...e,
type: (e == null ? void 0 : e.refetchType) ?? (e == null ? void 0 : e.type) ?? "active"
},
t
)));
}
refetchQueries(e, t = {}) {
const n = {
...t,
cancelRefetch: t.cancelRefetch ?? !0
}, r = Ue.batch(
() => C(this, Ne).findAll(e).filter((i) => !i.isDisabled() && !i.isStatic()).map((i) => {
let a = i.fetch(void 0, n);
return n.throwOnError || (a = a.catch(rt)), i.state.fetchStatus === "paused" ? Promise.resolve() : a;
})
);
return Promise.all(r).then(rt);
}
fetchQuery(e) {
const t = this.defaultQueryOptions(e);
t.retry === void 0 && (t.retry = !1);
const n = C(this, Ne).build(this, t);
return n.isStaleByTime(
an(t.staleTime, n)
) ? n.fetch(t) : Promise.resolve(n.state.data);
}
prefetchQuery(e) {
return this.fetchQuery(e).then(rt).catch(rt);
}
fetchInfiniteQuery(e) {
return e.behavior = fo(e.pages), this.fetchQuery(e);
}
prefetchInfiniteQuery(e) {
return this.fetchInfiniteQuery(e).then(rt).catch(rt);
}
ensureInfiniteQueryData(e) {
return e.behavior = fo(e.pages), this.ensureQueryData(e);
}
resumePausedMutations() {
return ei.isOnline() ? C(this, Gt).resumePausedMutations() : Promise.resolve();
}
getQueryCache() {
return C(this, Ne);
}
getMutationCache() {
return C(this, Gt);
}
getDefaultOptions() {
return C(this, Zt);
}
setDefaultOptions(e) {
ee(this, Zt, e);
}
setQueryDefaults(e, t) {
C(this, Zn).set(vr(e), {
queryKey: e,
defaultOptions: t
});
}
getQueryDefaults(e) {
const t = [...C(this, Zn).values()], n = {};
return t.forEach((r) => {
xr(e, r.queryKey) && Object.assign(n, r.defaultOptions);
}), n;
}
setMutationDefaults(e, t) {
C(this, Xn).set(vr(e), {
mutationKey: e,
defaultOptions: t
});
}
getMutationDefaults(e) {
const t = [...C(this, Xn).values()], n = {};
return t.forEach((r) => {
xr(e, r.mutationKey) && Object.assign(n, r.defaultOptions);
}), n;
}
defaultQueryOptions(e) {
if (e._defaulted)
return e;
const t = {
...C(this, Zt).queries,
...this.getQueryDefaults(e.queryKey),
...e,
_defaulted: !0
};
return t.queryHash || (t.queryHash = Pa(
t.queryKey,
t
)), t.refetchOnReconnect === void 0 && (t.refetchOnReconnect = t.networkMode !== "always"), t.throwOnError === void 0 && (t.throwOnError = !!t.suspense), !t.networkMode && t.persister && (t.networkMode = "offlineFirst"), t.queryFn === Jr && (t.enabled = !1), t;
}
defaultMutationOptions(e) {
return e != null && e._defaulted ? e : {
...C(this, Zt).mutations,
...(e == null ? void 0 : e.mutationKey) && this.getMutationDefaults(e.mutationKey),
...e,
_defaulted: !0
};
}
clear() {
C(this, Ne).clear(), C(this, Gt).clear();
}
}, Ne = new WeakMap(), Gt = new WeakMap(), Zt = new WeakMap(), Zn = new WeakMap(), Xn = new WeakMap(), Xt = new WeakMap(), Jn = new WeakMap(), er = new WeakMap(), js), nt, be, Er, Ge, Cn, tr, Jt, en, kr, nr, rr, En, kn, tn, ir, Ee, pr, ra, ia, aa, oa, sa, la, ca, tl, zs, yu = (zs = class extends Or {
constructor(t, n) {
super();
pe(this, Ee);
pe(this, nt);
pe(this, be);
pe(this, Er);
pe(this, Ge);
pe(this, Cn);
pe(this, tr);
pe(this, Jt);
pe(this, en);
pe(this, kr);
pe(this, nr);
// This property keeps track of the last query with defined data.
// It will be used to pass the previous data and query to the placeholder function between renders.
pe(this, rr);
pe(this, En);
pe(this, kn);
pe(this, tn);
pe(this, ir, /* @__PURE__ */ new Set());
this.options = n, ee(this, nt, t), ee(this, en, null), ee(this, Jt, na()), this.options.experimental_prefetchInRender || C(this, Jt).reject(
new Error("experimental_prefetchInRender feature flag is not enabled")
), this.bindMethods(), this.setOptions(n);
}
bindMethods() {
this.refetch = this.refetch.bind(this);
}
onSubscribe() {
this.listeners.size === 1 && (C(this, be).addObserver(this), ho(C(this, be), this.options) ? xe(this, Ee, pr).call(this) : this.updateResult(), xe(this, Ee, oa).call(this));
}
onUnsubscribe() {
this.hasListeners() || this.destroy();
}
shouldFetchOnReconnect() {
return ua(
C(this, be),
this.options,
this.options.refetchOnReconnect
);
}
shouldFetchOnWindowFocus() {
return ua(
C(this, be),
this.options,
this.options.refetchOnWindowFocus
);
}
destroy() {
this.listeners = /* @__PURE__ */ new Set(), xe(this, Ee, sa).call(this), xe(this, Ee, la).call(this), C(this, be).removeObserver(this);
}
setOptions(t) {
const n = this.options, r = C(this, be);
if (this.options = C(this, nt).defaultQueryOptions(t), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof bt(this.options.enabled, C(this, be)) != "boolean")
throw new Error(
"Expected enabled to be a boolean or a callback that returns a boolean"
);
xe(this, Ee, ca).call(this), C(this, be).setOptions(this.options), n._defaulted && !Ji(this.options, n) && C(this, nt).getQueryCache().notify({
type: "observerOptionsUpdated",
query: C(this, be),
observer: this
});
const i = this.hasListeners();
i && go(
C(this, be),
r,
this.options,
n
) && xe(this, Ee, pr).call(this), this.updateResult(), i && (C(this, be) !== r || bt(this.options.enabled, C(this, be)) !== bt(n.enabled, C(this, be)) || an(this.options.staleTime, C(this, be)) !== an(n.staleTime, C(this, be))) && xe(this, Ee, ra).call(this);
const a = xe(this, Ee, ia).call(this);
i && (C(this, be) !== r || bt(this.options.enabled, C(this, be)) !== bt(n.enabled, C(this, be)) || a !== C(this, tn)) && xe(this, Ee, aa).call(this, a);
}
getOptimisticResult(t) {
const n = C(this, nt).getQueryCache().build(C(this, nt), t), r = this.createResult(n, t);
return xu(this, r) && (ee(this, Ge, r), ee(this, tr, this.options), ee(this, Cn, C(this, be).state)), r;
}
getCurrentResult() {
return C(this, Ge);
}
trackResult(t, n) {
return new Proxy(t, {
get: (r, i) => (this.trackProp(i), n == null || n(i), Reflect.get(r, i))
});
}
trackProp(t) {
C(this, ir).add(t);
}
getCurrentQuery() {
return C(this, be);
}
refetch({ ...t } = {}) {
return this.fetch({
...t
});
}
fetchOptimistic(t) {
const n = C(this, nt).defaultQueryOptions(t), r = C(this, nt).getQueryCache().build(C(this, nt), n);
return r.fetch().then(() => this.createResult(r, n));
}
fetch(t) {
return xe(this, Ee, pr).call(this, {
...t,
cancelRefetch: t.cancelRefetch ?? !0
}).then(() => (this.updateResult(), C(this, Ge)));
}
createResult(t, n) {
var N;
const r = C(this, be), i = this.options, a = C(this, Ge), o = C(this, Cn), s = C(this, tr), c = t !== r ? t.state : C(this, Er), { state: m } = t;
let h = { ...m }, d = !1, g;
if (n._optimisticResults) {
const p = this.hasListeners(), R = !p && ho(t, n), $ = p && go(t, r, n, i);
(R || $) && (h = {
...h,
...el(m.data, t.options)
}), n._optimisticResults === "isRestoring" && (h.fetchStatus = "idle");
}
let { error: x, errorUpdatedAt: f, status: E } = h;
g = h.data;
let y = !1;
if (n.placeholderData !== void 0 && g === void 0 && E === "pending") {
let p;
a != null && a.isPlaceholderData && n.placeholderData === (s == null ? void 0 : s.placeholderData) ? (p = a.data, y = !0) : p = typeof n.placeholderData == "function" ? n.placeholderData(
(N = C(this, rr)) == null ? void 0 : N.state.data,
C(this, rr)
) : n.placeholderData, p !== void 0 && (E = "success", g = ta(
a == null ? void 0 : a.data,
p,
n
), d = !0);
}
if (n.select && g !== void 0 && !y)
if (a && g === (o == null ? void 0 : o.data) && n.select === C(this, kr))
g = C(this, nr);
else
try {
ee(this, kr, n.select), g = n.select(g), g = ta(a == null ? void 0 : a.data, g, n), ee(this, nr, g), ee(this, en, null);
} catch (p) {
ee(this, en, p);
}
C(this, en) && (x = C(this, en), g = C(this, nr), f = Date.now(), E = "error");
const T = h.fetchStatus === "fetching", k = E === "pending", v = E === "error", w = k && T, P = g !== void 0, I = {
status: E,
fetchStatus: h.fetchStatus,
isPending: k,
isSuccess: E === "success",
isError: v,
isInitialLoading: w,
isLoading: w,
data: g,
dataUpdatedAt: h.dataUpdatedAt,
error: x,
errorUpdatedAt: f,
failureCount: h.fetchFailureCount,
failureReason: h.fetchFailureReason,
errorUpdateCount: h.errorUpdateCount,
isFetched: h.dataUpdateCount > 0 || h.errorUpdateCount > 0,
isFetchedAfterMount: h.dataUpdateCount > c.dataUpdateCount || h.errorUpdateCount > c.errorUpdateCount,
isFetching: T,
isRefetching: T && !k,
isLoadingError: v && !P,
isPaused: h.fetchStatus === "paused",
isPlaceholderData: d,
isRefetchError: v && P,
isStale: Da(t, n),
refetch: this.refetch,
promise: C(this, Jt),
isEnabled: bt(n.enabled, t) !== !1
};
if (this.options.experimental_prefetchInRender) {
const p = (Z) => {
I.status === "error" ? Z.reject(I.error) : I.data !== void 0 && Z.resolve(I.data);
}, R = () => {
const Z = ee(this, Jt, I.promise = na());
p(Z);
}, $ = C(this, Jt);
switch ($.status) {
case "pending":
t.queryHash === r.queryHash && p($);
break;
case "fulfilled":
(I.status === "error" || I.data !== $.value) && R();
break;
case "rejected":
(I.status !== "error" || I.error !== $.reason) && R();
break;
}
}
return I;
}
updateResult() {
const t = C(this, Ge), n = this.createResult(C(this, be), this.options);
if (ee(this, Cn, C(this, be).state), ee(this, tr, this.options), C(this, Cn).data !== void 0 && ee(this, rr, C(this, be)), Ji(n, t))
return;
ee(this, Ge, n);
const r = () => {
if (!t)
return !0;
const { notifyOnChangeProps: i } = this.options, a = typeof i == "function" ? i() : i;
if (a === "all" || !a && !C(this, ir).size)
return !0;
const o = new Set(
a ?? C(this, ir)
);
return this.options.throwOnError && o.add("error"), Object.keys(C(this, Ge)).some((s) => {
const l = s;
return C(this, Ge)[l] !== t[l] && o.has(l);
});
};
xe(this, Ee, tl).call(this, { listeners: r() });
}
onQueryUpdate() {
this.updateResult(), this.hasListeners() && xe(this, Ee, oa).call(this);
}
}, nt = new WeakMap(), be = new WeakMap(), Er = new WeakMap(), Ge = new WeakMap(), Cn = new WeakMap(), tr = new WeakMap(), Jt = new WeakMap(), en = new WeakMap(), kr = new WeakMap(), nr = new WeakMap(), rr = new WeakMap(), En = new WeakMap(), kn = new WeakMap(), tn = new WeakMap(), ir = new WeakMap(), Ee = new WeakSet(), pr = function(t) {
xe(this, Ee, ca).call(this);
let n = C(this, be).fetch(
this.options,
t
);
return t != null && t.throwOnError || (n = n.catch(rt)), n;
}, ra = function() {
xe(this, Ee, sa).call(this);
const t = an(
this.options.staleTime,
C(this, be)
);
if (On || C(this, Ge).isStale || !Zi(t))
return;
const r = Ks(C(this, Ge).dataUpdatedAt, t) + 1;
ee(this, En, setTimeout(() => {
C(this, Ge).isStale || this.updateResult();
}, r));
}, ia = function() {
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(C(this, be)) : this.options.refetchInterval) ?? !1;
}, aa = function(t) {
xe(this, Ee, la).call(this), ee(this, tn, t), !(On || bt(this.options.enabled, C(this, be)) === !1 || !Zi(C(this, tn)) || C(this, tn) === 0) && ee(this, kn, setInterval(() => {
(this.options.refetchIntervalInBackground || _a.isFocused()) && xe(this, Ee, pr).call(this);
}, C(this, tn)));
}, oa = function() {
xe(this, Ee, ra).call(this), xe(this, Ee, aa).call(this, xe(this, Ee, ia).call(this));
}, sa = function() {
C(this, En) && (clearTimeout(C(this, En)), ee(this, En, void 0));
}, la = function() {
C(this, kn) && (clearInterval(C(this, kn)), ee(this, kn, void 0));
}, ca = function() {
const t = C(this, nt).getQueryCache().build(C(this, nt), this.options);
if (t === C(this, be))
return;
const n = C(this, be);
ee(this, be, t), ee(this, Er, t.state), this.hasListeners() && (n == null || n.removeObserver(this), t.addObserver(this));
}, tl = function(t) {
Ue.batch(() => {
t.listeners && this.listeners.forEach((n) => {
n(C(this, Ge));
}), C(this, nt).getQueryCache().notify({
query: C(this, be),
type: "observerResultsUpdated"
});
});
}, zs);
function vu(e, t) {
return bt(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && t.retryOnMount === !1);
}
function ho(e, t) {
return vu(e, t) || e.state.data !== void 0 && ua(e, t, t.refetchOnMount);
}
function ua(e, t, n) {
if (bt(t.enabled, e) !== !1 && an(t.staleTime, e) !== "static") {
const r = typeof n == "function" ? n(e) : n;
return r === "always" || r !== !1 && Da(e, t);
}
return !1;
}
function go(e, t, n, r) {
return (e !== t || bt(r.enabled, e) === !1) && (!n.suspense || e.state.status !== "error") && Da(e, n);
}
function Da(e, t) {
return bt(t.enabled, e) !== !1 && e.isStaleByTime(an(t.staleTime, e));
}
function xu(e, t) {
return !Ji(e.getCurrentResult(), t);
}
var nl = te.createContext(
void 0
), bu = (e) => {
const t = te.useContext(nl);
if (!t)
throw new Error("No QueryClient set, use QueryClientProvider to set one");
return t;
}, wu = ({
client: e,
children: t
}) => (te.useEffect(() => (e.mount(), () => {
e.unmount();
}), [e]), /* @__PURE__ */ u(nl.Provider, { value: e, children: t })), rl = te.createContext(!1), Su = () => te.useContext(rl);
rl.Provider;
function Cu() {
let e = !1;
return {
clearReset: () => {
e = !1;
},
reset: () => {
e = !0;
},
isReset: () => e
};
}
var Eu = te.createContext(Cu()), ku = () => te.useContext(Eu), Tu = (e, t) => {
(e.suspense || e.throwOnError || e.experimental_prefetchInRender) && (t.isReset() || (e.retryOnMount = !1));
}, Ou = (e) => {
te.useEffect(() => {
e.clearReset();
}, [e]);
}, Fu = ({
result: e,
errorResetBoundary: t,
throwOnError: n,
query: r,
suspense: i
}) => e.isError && !t.isReset() && !e.isFetching && r && (i && e.data === void 0 || ru(n, [e.error, r])), Au = (e) => {
if (e.suspense) {
const t = (r) => r === "static" ? r : Math.max(r ?? 1e3, 1e3), n = e.staleTime;
e.staleTime = typeof n == "function" ? (...r) => t(n(...r)) : t(n), typeof e.gcTime == "number" && (e.gcTime = Math.max(e.gcTime, 1e3));
}
}, $u = (e, t) => e.isLoading && e.isFetching && !t, Ru = (e, t) => (e == null ? void 0 : e.suspense) && t.isPending, yo = (e, t, n) => t.fetchOptimistic(e).catch(() => {
n.clearReset();
});
function Pu(e, t, n) {
var h, d, g, x, f;
if (process.env.NODE_ENV !== "production" && (typeof e != "object" || Array.isArray(e)))
throw new Error(
'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'
);
const r = Su(), i = ku(), a = bu(), o = a.defaultQueryOptions(e);
(d = (h = a.getDefaultOptions().queries) == null ? void 0 : h._experimental_beforeQuery) == null || d.call(
h,
o
), process.env.NODE_ENV !== "production" && (o.queryFn || console.error(
`[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`
)), o._optimisticResults = r ? "isRestoring" : "optimistic", Au(o), Tu(o, i), Ou(i);
const s = !a.getQueryCache().get(o.queryHash), [l] = te.useState(
() => new t(
a,
o
)
), c = l.getOptimisticResult(o), m = !r && e.subscribed !== !1;
if (te.useSyncExternalStore(
te.useCallback(
(E) => {
const y = m ? l.subscribe(Ue.batchCalls(E)) : rt;
return l.updateResult(), y;
},
[l, m]
),
() => l.getCurrentResult(),
() => l.getCurrentResult()
), te.useEffect(() => {
l.setOptions(o);
}, [o, l]), Ru(o, c))
throw yo(o, l, i);
if (Fu({
result: c,
errorResetBoundary: i,
throwOnError: o.throwOnError,
query: a.getQueryCache().get(o.queryHash),
suspense: o.suspense
}))
throw c.error;
if ((x = (g = a.getDefaultOptions().queries) == null ? void 0 : g._experimental_afterQuery) == null || x.call(
g,
o,
c
), o.experimental_prefetchInRender && !On && $u(c, r)) {
const E = s ? (
// Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
yo(o, l, i)
) : (
// subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
(f = a.getQueryCache().get(o.queryHash)) == null ? void 0 : f.promise
);
E == null || E.catch(rt).finally(() => {
l.updateResult();
});
}
return o.notifyOnChangeProps ? c : l.trackResult(c);
}
function _u(e, t) {
return Pu(e, yu);
}
function Ia(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var Ir = { exports: {} }, Mr = { exports: {} }, Se = {};
/** @license React v16.13.1
* react-is.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 vo;
function Du() {
if (vo) return Se;
vo = 1;
var e = typeof Symbol == "function" && Symbol.for, t = e ? Symbol.for("react.element") : 60103, n = e ? Symbol.for("react.portal") : 60106, r = e ? Symbol.for("react.fragment") : 60107, i = e ? Symbol.for("react.strict_mode") : 60108, a = e ? Symbol.for("react.profiler") : 60114, o = e ? Symbol.for("react.provider") : 60109, s = e ? Symbol.for("react.context") : 60110, l = e ? Symbol.for("react.async_mode") : 60111, c = e ? Symbol.for("react.concurrent_mode") : 60111, m = e ? Symbol.for("react.forward_ref") : 60112, h = e ? Symbol.for("react.suspense") : 60113, d = e ? Symbol.for("react.suspense_list") : 60120, g = e ? Symbol.for("react.memo") : 60115, x = e ? Symbol.for("react.lazy") : 60116, f = e ? Symbol.for("react.block") : 60121, E = e ? Symbol.for("react.fundamental") : 60117, y = e ? Symbol.for("react.responder") : 60118, T = e ? Symbol.for("react.scope") : 60119;
function k(w) {
if (typeof w == "object" && w !== null) {
var P = w.$$typeof;
switch (P) {
case t:
switch (w = w.type, w) {
case l:
case c:
case r:
case a:
case i:
case h:
return w;
default:
switch (w = w && w.$$typeof, w) {
case s:
case m:
case x:
case g:
case o:
return w;
default:
return P;
}
}
case n:
return P;
}
}
}
function v(w) {
return k(w) === c;
}
return Se.AsyncMode = l, Se.ConcurrentMode = c, Se.ContextConsumer = s, Se.ContextProvider = o, Se.Element = t, Se.ForwardRef = m, Se.Fragment = r, Se.Lazy = x, Se.Memo = g, Se.Portal = n, Se.Profiler = a, Se.StrictMode = i, Se.Suspense = h, Se.isAsyncMode = function(w) {
return v(w) || k(w) === l;
}, Se.isConcurrentMode = v, Se.isContextConsumer = function(w) {
return k(w) === s;
}, Se.isContextProvider = function(w) {
return k(w) === o;
}, Se.isElement = function(w) {
return typeof w == "object" && w !== null && w.$$typeof === t;
}, Se.isForwardRef = function(w) {
return k(w) === m;
}, Se.isFragment = function(w) {
return k(w) === r;
}, Se.isLazy = function(w) {
return k(w) === x;
}, Se.isMemo = function(w) {
return k(w) === g;
}, Se.isPortal = function(w) {
return k(w) === n;
}, Se.isProfiler = function(w) {
return k(w) === a;
}, Se.isStrictMode = function(w) {
return k(w) === i;
}, Se.isSuspense = function(w) {
return k(w) === h;
}, Se.isValidElementType = function(w) {
return typeof w == "string" || typeof w == "function" || w === r || w === c || w === a || w === i || w === h || w === d || typeof w == "object" && w !== null && (w.$$typeof === x || w.$$typeof === g || w.$$typeof === o || w.$$typeof === s || w.$$typeof === m || w.$$typeof === E || w.$$typeof === y || w.$$typeof === T || w.$$typeof === f);
}, Se.typeOf = k, Se;
}
var Ce = {};
/** @license React v16.13.1
* react-is.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 xo;
function Iu() {
return xo || (xo = 1, process.env.NODE_ENV !== "production" && function() {
var e = typeof Symbol == "function" && Symbol.for, t = e ? Symbol.for("react.element") : 60103, n = e ? Symbol.for("react.portal") : 60106, r = e ? Symbol.for("react.fragment") : 60107, i = e ? Symbol.for("react.strict_mode") : 60108, a = e ? Symbol.for("react.profiler") : 60114, o = e ? Symbol.for("react.provider") : 60109, s = e ? Symbol.for("react.context") : 60110, l = e ? Symbol.for("react.async_mode") : 60111, c = e ? Symbol.for("react.concurrent_mode") : 60111, m = e ? Symbol.for("react.forward_ref") : 60112, h = e ? Symbol.for("react.suspense") : 60113, d = e ? Symbol.for("react.suspense_list") : 60120, g = e ? Symbol.for("react.memo") : 60115, x = e ? Symbol.for("react.lazy") : 60116, f = e ? Symbol.for("react.block") : 60121, E = e ? Symbol.for("react.fundamental") : 60117, y = e ? Symbol.for("react.responder") : 60118, T = e ? Symbol.for("react.scope") : 60119;
function k(z) {
return typeof z == "string" || typeof z == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
z === r || z === c || z === a || z === i || z === h || z === d || typeof z == "object" && z !== null && (z.$$typeof === x || z.$$typeof === g || z.$$typeof === o || z.$$typeof === s || z.$$typeof === m || z.$$typeof === E || z.$$typeof === y || z.$$typeof === T || z.$$typeof === f);
}
function v(z) {
if (typeof z == "object" && z !== null) {
var ye = z.$$typeof;
switch (ye) {
case t:
var Oe = z.type;
switch (Oe) {
case l:
case c:
case r:
case a:
case i:
case h:
return Oe;
default:
var Ye = Oe && Oe.$$typeof;
switch (Ye) {
case s:
case m:
case x:
case g:
case o:
return Ye;
default:
return ye;
}
}
case n:
return ye;
}
}
}
var w = l, P = c, M = s, I = o, N = t, p = m, R = r, $ = x, Z = g, j = n, re = a, L = i, Q = h, V = !1;
function K(z) {
return V || (V = !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.")), S(z) || v(z) === l;
}
function S(z) {
return v(z) === c;
}
function D(z) {
return v(z) === s;
}
function ne(z) {
return v(z) === o;
}
function le(z) {
return typeof z == "object" && z !== null && z.$$typeof === t;
}
function ae(z) {
return v(z) === m;
}
function de(z) {
return v(z) === r;
}
function H(z) {
return v(z) === x;
}
function ie(z) {
return v(z) === g;
}
function fe(z) {
return v(z) === n;
}
function ge(z) {
return v(z) === a;
}
function B(z) {
return v(z) === i;
}
function G(z) {
return v(z) === h;
}
Ce.AsyncMode = w, Ce.ConcurrentMode = P, Ce.ContextConsumer = M, Ce.ContextProvider = I, Ce.Element = N, Ce.ForwardRef = p, Ce.Fragment = R, Ce.Lazy = $, Ce.Memo = Z, Ce.Portal = j, Ce.Profiler = re, Ce.StrictMode = L, Ce.Suspense = Q, Ce.isAsyncMode = K, Ce.isConcurrentMode = S, Ce.isContextConsumer = D, Ce.isContextProvider = ne, Ce.isElement = le, Ce.isForwardRef = ae, Ce.isFragment = de, Ce.isLazy = H, Ce.isMemo = ie, Ce.isPortal = fe, Ce.isProfiler = ge, Ce.isStrictMode = B, Ce.isSuspense = G, Ce.isValidElementType = k, Ce.typeOf = v;
}()), Ce;
}
var bo;
function il() {
return bo || (bo = 1, process.env.NODE_ENV === "production" ? Mr.exports = Du() : Mr.exports = Iu()), Mr.exports;
}
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
var Ri, wo;
function Mu() {
if (wo) return Ri;
wo = 1;
var e = Object.getOwnPropertySymbols, t = Object.prototype.hasOwnProperty, n = Object.prototype.propertyIsEnumerable;
function r(a) {
if (a == null)
throw new TypeError("Object.assign cannot be called with null or undefined");
return Object(a);
}
function i() {
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 = {}, s = 0; s < 10; s++)
o["_" + String.fromCharCode(s)] = s;
var l = Object.getOwnPropertyNames(o).map(function(m) {
return o[m];
});
if (l.join("") !== "0123456789")
return !1;
var c = {};
return "abcdefghijklmnopqrst".split("").forEach(function(m) {
c[m] = m;
}), Object.keys(Object.assign({}, c)).join("") === "abcdefghijklmnopqrst";
} catch {
return !1;
}
}
return Ri = i() ? Object.assign : function(a, o) {
for (var s, l = r(a), c, m = 1; m < arguments.length; m++) {
s = Object(arguments[m]);
for (var h in s)
t.call(s, h) && (l[h] = s[h]);
if (e) {
c = e(s);
for (var d = 0; d < c.length; d++)
n.call(s, c[d]) && (l[c[d]] = s[c[d]]);
}
}
return l;
}, Ri;
}
var Pi, So;
function Ma() {
if (So) return Pi;
So = 1;
var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
return Pi = e, Pi;
}
var _i, Co;
function al() {
return Co || (Co = 1, _i = Function.call.bind(Object.prototype.hasOwnProperty)), _i;
}
var Di, Eo;
function ju() {
if (Eo) return Di;
Eo = 1;
var e = function() {
};
if (process.env.NODE_ENV !== "production") {
var t = /* @__PURE__ */ Ma(), n = {}, r = /* @__PURE__ */ al();
e = function(a) {
var o = "Warning: " + a;
typeof console < "u" && console.error(o);
try {
throw new Error(o);
} catch {
}
};
}
function i(a, o, s, l, c) {
if (process.env.NODE_ENV !== "production") {
for (var m in a)
if (r(a, m)) {
var h;
try {
if (typeof a[m] != "function") {
var d = Error(
(l || "React class") + ": " + s + " type `" + m + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof a[m] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
);
throw d.name = "Invariant Violation", d;
}
h = a[m](o, m, l, s, null, t);
} catch (x) {
h = x;
}
if (h && !(h instanceof Error) && e(
(l || "React class") + ": type specification of " + s + " `" + m + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof h + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
), h instanceof Error && !(h.message in n)) {
n[h.message] = !0;
var g = c ? c() : "";
e(
"Failed " + s + " type: " + h.message + (g ?? "")
);
}
}
}
}
return i.resetWarningCache = function() {
process.env.NODE_ENV !== "production" && (n = {});
}, Di = i, Di;
}
var Ii, ko;
function zu() {
if (ko) return Ii;
ko = 1;
var e = il(), t = Mu(), n = /* @__PURE__ */ Ma(), r = /* @__PURE__ */ al(), i = /* @__PURE__ */ ju(), a = function() {
};
process.env.NODE_ENV !== "production" && (a = function(s) {
var l = "Warning: " + s;
typeof console < "u" && console.error(l);
try {
throw new Error(l);
} catch {
}
});
function o() {
return null;
}
return Ii = function(s, l) {
var c = typeof Symbol == "function" && Symbol.iterator, m = "@@iterator";
function h(S) {
var D = S && (c && S[c] || S[m]);
if (typeof D == "function")
return D;
}
var d = "<<anonymous>>", g = {
array: y("array"),
bigint: y("bigint"),
bool: y("boolean"),
func: y("function"),
number: y("number"),
object: y("object"),
string: y("string"),
symbol: y("symbol"),
any: T(),
arrayOf: k,
element: v(),
elementType: w(),
instanceOf: P,
node: p(),
objectOf: I,
oneOf: M,
oneOfType: N,
shape: $,
exact: Z
};
function x(S, D) {
return S === D ? S !== 0 || 1 / S === 1 / D : S !== S && D !== D;
}
function f(S, D) {
this.message = S, this.data = D && typeof D == "object" ? D : {}, this.stack = "";
}
f.prototype = Error.prototype;
function E(S) {
if (process.env.NODE_ENV !== "production")
var D = {}, ne = 0;
function le(de, H, ie, fe, ge, B, G) {
if (fe = fe || d, B = B || ie, G !== n) {
if (l) {
var z = 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 z.name = "Invariant Violation", z;
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
var ye = fe + ":" + ie;
!D[ye] && // Avoid spamming the console because they are often not actionable except for lib authors
ne < 3 && (a(
"You are manually calling a React.PropTypes validation function for the `" + B + "` prop on `" + fe + "`. 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."
), D[ye] = !0, ne++);
}
}
return H[ie] == null ? de ? H[ie] === null ? new f("The " + ge + " `" + B + "` is marked as required " + ("in `" + fe + "`, but its value is `null`.")) : new f("The " + ge + " `" + B + "` is marked as required in " + ("`" + fe + "`, but its value is `undefined`.")) : null : S(H, ie, fe, ge, B);
}
var ae = le.bind(null, !1);
return ae.isRequired = le.bind(null, !0), ae;
}
function y(S) {
function D(ne, le, ae, de, H, ie) {
var fe = ne[le], ge = L(fe);
if (ge !== S) {
var B = Q(fe);
return new f(
"Invalid " + de + " `" + H + "` of type " + ("`" + B + "` supplied to `" + ae + "`, expected ") + ("`" + S + "`."),
{ expectedType: S }
);
}
return null;
}
return E(D);
}
function T() {
return E(o);
}
function k(S) {
function D(ne, le, ae, de, H) {
if (typeof S != "function")
return new f("Property `" + H + "` of component `" + ae + "` has invalid PropType notation inside arrayOf.");
var ie = ne[le];
if (!Array.isArray(ie)) {
var fe = L(ie);
return new f("Invalid " + de + " `" + H + "` of type " + ("`" + fe + "` supplied to `" + ae + "`, expected an array."));
}
for (var ge = 0; ge < ie.length; ge++) {
var B = S(ie, ge, ae, de, H + "[" + ge + "]", n);
if (B instanceof Error)
return B;
}
return null;
}
return E(D);
}
function v() {
function S(D, ne, le, ae, de) {
var H = D[ne];
if (!s(H)) {
var ie = L(H);
return new f("Invalid " + ae + " `" + de + "` of type " + ("`" + ie + "` supplied to `" + le + "`, expected a single ReactElement."));
}
return null;
}
return E(S);
}
function w() {
function S(D, ne, le, ae, de) {
var H = D[ne];
if (!e.isValidElementType(H)) {
var ie = L(H);
return new f("Invalid " + ae + " `" + de + "` of type " + ("`" + ie + "` supplied to `" + le + "`, expected a single ReactElement type."));
}
return null;
}
return E(S);
}
function P(S) {
function D(ne, le, ae, de, H) {
if (!(ne[le] instanceof S)) {
var ie = S.name || d, fe = K(ne[le]);
return new f("Invalid " + de + " `" + H + "` of type " + ("`" + fe + "` supplied to `" + ae + "`, expected ") + ("instance of `" + ie + "`."));
}
return null;
}
return E(D);
}
function M(S) {
if (!Array.isArray(S))
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 D(ne, le, ae, de, H) {
for (var ie = ne[le], fe = 0; fe < S.length; fe++)
if (x(ie, S[fe]))
return null;
var ge = JSON.stringify(S, function(G, z) {
var ye = Q(z);
return ye === "symbol" ? String(z) : z;
});
return new f("Invalid " + de + " `" + H + "` of value `" + String(ie) + "` " + ("supplied to `" + ae + "`, expected one of " + ge + "."));
}
return E(D);
}
function I(S) {
function D(ne, le, ae, de, H) {
if (typeof S != "function")
return new f("Property `" + H + "` of component `" + ae + "` has invalid PropType notation inside objectOf.");
var ie = ne[le], fe = L(ie);
if (fe !== "object")
return new f("Invalid " + de + " `" + H + "` of type " + ("`" + fe + "` supplied to `" + ae + "`, expected an object."));
for (var ge in ie)
if (r(ie, ge)) {
var B = S(ie, ge, ae, de, H + "." + ge, n);
if (B instanceof Error)
return B;
}
return null;
}
return E(D);
}
function N(S) {
if (!Array.isArray(S))
return process.env.NODE_ENV !== "production" && a("Invalid argument supplied to oneOfType, expected an instance of array."), o;
for (var D = 0; D < S.length; D++) {
var ne = S[D];
if (typeof ne != "function")
return a(
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + V(ne) + " at index " + D + "."
), o;
}
function le(ae, de, H, ie, fe) {
for (var ge = [], B = 0; B < S.length; B++) {
var G = S[B], z = G(ae, de, H, ie, fe, n);
if (z == null)
return null;
z.data && r(z.data, "expectedType") && ge.push(z.data.expectedType);
}
var ye = ge.length > 0 ? ", expected one of type [" + ge.join(", ") + "]" : "";
return new f("Invalid " + ie + " `" + fe + "` supplied to " + ("`" + H + "`" + ye + "."));
}
return E(le);
}
function p() {
function S(D, ne, le, ae, de) {
return j(D[ne]) ? null : new f("Invalid " + ae + " `" + de + "` supplied to " + ("`" + le + "`, expected a ReactNode."));
}
return E(S);
}
function R(S, D, ne, le, ae) {
return new f(
(S || "React class") + ": " + D + " type `" + ne + "." + le + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + ae + "`."
);
}
function $(S) {
function D(ne, le, ae, de, H) {
var ie = ne[le], fe = L(ie);
if (fe !== "object")
return new f("Invalid " + de + " `" + H + "` of type `" + fe + "` " + ("supplied to `" + ae + "`, expected `object`."));
for (var ge in S) {
var B = S[ge];
if (typeof B != "function")
return R(ae, de, H, ge, Q(B));
var G = B(ie, ge, ae, de, H + "." + ge, n);
if (G)
return G;
}
return null;
}
return E(D);
}
function Z(S) {
function D(ne, le, ae, de, H) {
var ie = ne[le], fe = L(ie);
if (fe !== "object")
return new f("Invalid " + de + " `" + H + "` of type `" + fe + "` " + ("supplied to `" + ae + "`, expected `object`."));
var ge = t({}, ne[le], S);
for (var B in ge) {
var G = S[B];
if (r(S, B) && typeof G != "function")
return R(ae, de, H, B, Q(G));
if (!G)
return new f(
"Invalid " + de + " `" + H + "` key `" + B + "` supplied to `" + ae + "`.\nBad object: " + JSON.stringify(ne[le], null, " ") + `
Valid keys: ` + JSON.stringify(Object.keys(S), null, " ")
);
var z = G(ie, B, ae, de, H + "." + B, n);
if (z)
return z;
}
return null;
}
return E(D);
}
function j(S) {
switch (typeof S) {
case "number":
case "string":
case "undefined":
return !0;
case "boolean":
return !S;
case "object":
if (Array.isArray(S))
return S.every(j);
if (S === null || s(S))
return !0;
var D = h(S);
if (D) {
var ne = D.call(S), le;
if (D !== S.entries) {
for (; !(le = ne.next()).done; )
if (!j(le.value))
return !1;
} else
for (; !(le = ne.next()).done; ) {
var ae = le.value;
if (ae && !j(ae[1]))
return !1;
}
} else
return !1;
return !0;
default:
return !1;
}
}
function re(S, D) {
return S === "symbol" ? !0 : D ? D["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && D instanceof Symbol : !1;
}
function L(S) {
var D = typeof S;
return Array.isArray(S) ? "array" : S instanceof RegExp ? "object" : re(D, S) ? "symbol" : D;
}
function Q(S) {
if (typeof S > "u" || S === null)
return "" + S;
var D = L(S);
if (D === "object") {
if (S instanceof Date)
return "date";
if (S instanceof RegExp)
return "regexp";
}
return D;
}
function V(S) {
var D = Q(S);
switch (D) {
case "array":
case "object":
return "an " + D;
case "boolean":
case "date":
case "regexp":
return "a " + D;
default:
return D;
}
}
function K(S) {
return !S.constructor || !S.constructor.name ? d : S.constructor.name;
}
return g.checkPropTypes = i, g.resetWarningCache = i.resetWarningCache, g.PropTypes = g, g;
}, Ii;
}
var Mi, To;
function Nu() {
if (To) return Mi;
To = 1;
var e = /* @__PURE__ */ Ma();
function t() {
}
function n() {
}
return n.resetWarningCache = t, Mi = function() {
function r(o, s, l, c, m, h) {
if (h !== e) {
var d = 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 d.name = "Invariant Violation", d;
}
}
r.isRequired = r;
function i() {
return r;
}
var a = {
array: r,
bigint: r,
bool: r,
func: r,
number: r,
object: r,
string: r,
symbol: r,
any: r,
arrayOf: i,
element: r,
elementType: r,
instanceOf: i,
node: r,
objectOf: i,
oneOf: i,
oneOfType: i,
shape: i,
exact: i,
checkPropTypes: n,
resetWarningCache: t
};
return a.PropTypes = a, a;
}, Mi;
}
var Oo;
function Lu() {
if (Oo) return Ir.exports;
if (Oo = 1, process.env.NODE_ENV !== "production") {
var e = il(), t = !0;
Ir.exports = /* @__PURE__ */ zu()(e.isElement, t);
} else
Ir.exports = /* @__PURE__ */ Nu()();
return Ir.exports;
}
var Bu = /* @__PURE__ */ Lu();
const b = /* @__PURE__ */ Ia(Bu);
function ol(e) {
var t, n, r = "";
if (typeof e == "string" || typeof e == "number") r += e;
else if (typeof e == "object") if (Array.isArray(e)) {
var i = e.length;
for (t = 0; t < i; t++) e[t] && (n = ol(e[t])) && (r && (r += " "), r += n);
} else for (n in e) e[n] && (r && (r += " "), r += n);
return r;
}
function Ze() {
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = ol(e)) && (r && (r += " "), r += t);
return r;
}
function lr(e, t, n = void 0) {
const r = {};
for (const i in e) {
const a = e[i];
let o = "", s = !0;
for (let l = 0; l < a.length; l += 1) {
const c = a[l];
c && (o += (s === !0 ? "" : " ") + t(c), s = !1, n && n[c] && (o += " " + n[c]));
}
r[i] = o;
}
return r;
}
function ln(e, ...t) {
const n = new URL(`https://mui.com/production-error/?code=${e}`);
return t.forEach((r) => n.searchParams.append("args[]", r)), `Minified MUI error #${e}; visit ${n} for the full message.`;
}
function Me(e) {
if (typeof e != "string")
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: `capitalize(string)` expects a string argument." : ln(7));
return e.charAt(0).toUpperCase() + e.slice(1);
}
var jr = { exports: {} }, ke = {};
/**
* @license React
* react-is.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var Fo;
function Vu() {
if (Fo) return ke;
Fo = 1;
var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), r = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), a = Symbol.for("react.consumer"), o = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), h = Symbol.for("react.lazy"), d = Symbol.for("react.view_transition"), g = Symbol.for("react.client.reference");
function x(f) {
if (typeof f == "object" && f !== null) {
var E = f.$$typeof;
switch (E) {
case e:
switch (f = f.type, f) {
case n:
case i:
case r:
case l:
case c:
case d:
return f;
default:
switch (f = f && f.$$typeof, f) {
case o:
case s:
case h:
case m:
return f;
case a:
return f;
default:
return E;
}
}
case t:
return E;
}
}
}
return ke.ContextConsumer = a, ke.ContextProvider = o, ke.Element = e, ke.ForwardRef = s, ke.Fragment = n, ke.Lazy = h, ke.Memo = m, ke.Portal = t, ke.Profiler = i, ke.StrictMode = r, ke.Suspense = l, ke.SuspenseList = c, ke.isContextConsumer = function(f) {
return x(f) === a;
}, ke.isContextProvider = function(f) {
return x(f) === o;
}, ke.isElement = function(f) {
return typeof f == "object" && f !== null && f.$$typeof === e;
}, ke.isForwardRef = function(f) {
return x(f) === s;
}, ke.isFragment = function(f) {
return x(f) === n;
}, ke.isLazy = function(f) {
return x(f) === h;
}, ke.isMemo = function(f) {
return x(f) === m;
}, ke.isPortal = function(f) {
return x(f) === t;
}, ke.isProfiler = function(f) {
return x(f) === i;
}, ke.isStrictMode = function(f) {
return x(f) === r;
}, ke.isSuspense = function(f) {
return x(f) === l;
}, ke.isSuspenseList = function(f) {
return x(f) === c;
}, ke.isValidElementType = function(f) {
return typeof f == "string" || typeof f == "function" || f === n || f === i || f === r || f === l || f === c || typeof f == "object" && f !== null && (f.$$typeof === h || f.$$typeof === m || f.$$typeof === o || f.$$typeof === a || f.$$typeof === s || f.$$typeof === g || f.getModuleId !== void 0);
}, ke.typeOf = x, ke;
}
var Te = {};
/**
* @license React
* react-is.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var Ao;
function qu() {
return Ao || (Ao = 1, process.env.NODE_ENV !== "production" && function() {
function e(f) {
if (typeof f == "object" && f !== null) {
var E = f.$$typeof;
switch (E) {
case t:
switch (f = f.type, f) {
case r:
case a:
case i:
case c:
case m:
case g:
return f;
default:
switch (f = f && f.$$typeof, f) {
case s:
case l:
case d:
case h:
return f;
case o:
return f;
default:
return E;
}
}
case n:
return E;
}
}
}
var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), a = Symbol.for("react.profiler"), o = Symbol.for("react.consumer"), s = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), d = Symbol.for("react.lazy"), g = Symbol.for("react.view_transition"), x = Symbol.for("react.client.reference");
Te.ContextConsumer = o, Te.ContextProvider = s, Te.Element = t, Te.ForwardRef = l, Te.Fragment = r, Te.Lazy = d, Te.Memo = h, Te.Portal = n, Te.Profiler = a, Te.StrictMode = i, Te.Suspense = c, Te.SuspenseList = m, Te.isContextConsumer = function(f) {
return e(f) === o;
}, Te.isContextProvider = function(f) {
return e(f) === s;
}, Te.isElement = function(f) {
return typeof f == "object" && f !== null && f.$$typeof === t;
}, Te.isForwardRef = function(f) {
return e(f) === l;
}, Te.isFragment = function(f) {
return e(f) === r;
}, Te.isLazy = function(f) {
return e(f) === d;
}, Te.isMemo = function(f) {
return e(f) === h;
}, Te.isPortal = function(f) {
return e(f) === n;
}, Te.isProfiler = function(f) {
return e(f) === a;
}, Te.isStrictMode = function(f) {
return e(f) === i;
}, Te.isSuspense = function(f) {
return e(f) === c;
}, Te.isSuspenseList = function(f) {
return e(f) === m;
}, Te.isValidElementType = function(f) {
return typeof f == "string" || typeof f == "function" || f === r || f === a || f === i || f === c || f === m || typeof f == "object" && f !== null && (f.$$typeof === d || f.$$typeof === h || f.$$typeof === s || f.$$typeof === o || f.$$typeof === l || f.$$typeof === x || f.getModuleId !== void 0);
}, Te.typeOf = e;
}()), Te;
}
var $o;
function Wu() {
return $o || ($o = 1, process.env.NODE_ENV === "production" ? jr.exports = /* @__PURE__ */ Vu() : jr.exports = /* @__PURE__ */ qu()), jr.exports;
}
var ti = /* @__PURE__ */ Wu();
function Dt(e) {
if (typeof e != "object" || e === null)
return !1;
const t = Object.getPrototypeOf(e);
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
}
function sl(e) {
if (/* @__PURE__ */ te.isValidElement(e) || ti.isValidElementType(e) || !Dt(e))
return e;
const t = {};
return Object.keys(e).forEach((n) => {
t[n] = sl(e[n]);
}), t;
}
function ft(e, t, n = {
clone: !0
}) {
const r = n.clone ? {
...e
} : e;
return Dt(e) && Dt(t) && Object.keys(t).forEach((i) => {
/* @__PURE__ */ te.isValidElement(t[i]) || ti.isValidElementType(t[i]) ? r[i] = t[i] : Dt(t[i]) && // Avoid prototype pollution
Object.prototype.hasOwnProperty.call(e, i) && Dt(e[i]) ? r[i] = ft(e[i], t[i], n) : n.clone ? r[i] = Dt(t[i]) ? sl(t[i]) : t[i] : r[i] = t[i];
}), r;
}
function yr(e, t) {
return t ? ft(e, t, {
clone: !1
// No need to clone deep, it's way faster.
}) : e;
}
const pn = process.env.NODE_ENV !== "production" ? b.oneOfType([b.number, b.string, b.object, b.array]) : {};
function Uu(e, t) {
if (!e.containerQueries)
return t;
const n = Object.keys(t).filter((r) => r.startsWith("@container")).sort((r, i) => {
var o, s;
const a = /min-width:\s*([0-9.]+)/;
return +(((o = r.match(a)) == null ? void 0 : o[1]) || 0) - +(((s = i.match(a)) == null ? void 0 : s[1]) || 0);
});
return n.length ? n.reduce((r, i) => {
const a = t[i];
return delete r[i], r[i] = a, r;
}, {
...t
}) : t;
}
function Hu(e, t) {
return t === "@" || t.startsWith("@") && (e.some((n) => t.startsWith(`@${n}`)) || !!t.match(/^@\d/));
}
function Yu(e, t) {
const n = t.match(/^@([^/]+)?\/?(.+)?$/);
if (!n) {
if (process.env.NODE_ENV !== "production")
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The provided shorthand ${`(${t})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.
For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.` : ln(18, `(${t})`));
return null;
}
const [, r, i] = n, a = Number.isNaN(+r) ? r || 0 : +r;
return e.containerQueries(i).up(a);
}
function Ku(e) {
const t = (a, o) => a.replace("@media", o ? `@container ${o}` : "@container");
function n(a, o) {
a.up = (...s) => t(e.breakpoints.up(...s), o), a.down = (...s) => t(e.breakpoints.down(...s), o), a.between = (...s) => t(e.breakpoints.between(...s), o), a.only = (...s) => t(e.breakpoints.only(...s), o), a.not = (...s) => {
const l = t(e.breakpoints.not(...s), o);
return l.includes("not all and") ? l.replace("not all and ", "").replace("min-width:", "width<").replace("max-width:", "width>").replace("and", "or") : l;
};
}
const r = {}, i = (a) => (n(r, a), r);
return n(i), {
...e,
containerQueries: i
};
}
const vi = {
xs: 0,
// phone
sm: 600,
// tablet
md: 900,
// small laptop
lg: 1200,
// desktop
xl: 1536
// large screen
}, Ro = {
// Sorted ASC by size. That's important.
// It can't be configured as it's used statically for propTypes.
keys: ["xs", "sm", "md", "lg", "xl"],
up: (e) => `@media (min-width:${vi[e]}px)`
}, Qu = {
containerQueries: (e) => ({
up: (t) => {
let n = typeof t == "number" ? t : vi[t] || t;
return typeof n == "number" && (n = `${n}px`), e ? `@container ${e} (min-width:${n})` : `@container (min-width:${n})`;
}
})
};
function qt(e, t, n) {
const r = e.theme || {};
if (Array.isArray(t)) {
const a = r.breakpoints || Ro;
return t.reduce((o, s, l) => (o[a.up(a.keys[l])] = n(t[l]), o), {});
}
if (typeof t == "object") {
const a = r.breakpoints || Ro;
return Object.keys(t).reduce((o, s) => {
if (Hu(a.keys, s)) {
const l = Yu(r.containerQueries ? r : Qu, s);
l && (o[l] = n(t[s], s));
} else if (Object.keys(a.values || vi).includes(s)) {
const l = a.up(s);
o[l] = n(t[s], s);
} else {
const l = s;
o[l] = t[l];
}
return o;
}, {});
}
return n(t);
}
function Gu(e = {}) {
var n;
return ((n = e.keys) == null ? void 0 : n.reduce((r, i) => {
const a = e.up(i);
return r[a] = {}, r;
}, {})) || {};
}
function Zu(e, t) {
return e.reduce((n, r) => {
const i = n[r];
return (!i || Object.keys(i).length === 0) && delete n[r], n;
}, t);
}
function xi(e, t, n = !0) {
if (!t || typeof t != "string")
return null;
if (e && e.vars && n) {
const r = `vars.${t}`.split(".").reduce((i, a) => i && i[a] ? i[a] : null, e);
if (r != null)
return r;
}
return t.split(".").reduce((r, i) => r && r[i] != null ? r[i] : null, e);
}
function ni(e, t, n, r = n) {
let i;
return typeof e == "function" ? i = e(n) : Array.isArray(e) ? i = e[n] || r : i = xi(e, n) || r, t && (i = t(i, r, e)), i;
}
function Be(e) {
const {
prop: t,
cssProperty: n = e.prop,
themeKey: r,
transform: i
} = e, a = (o) => {
if (o[t] == null)
return null;
const s = o[t], l = o.theme, c = xi(l, r) || {};
return qt(o, s, (h) => {
let d = ni(c, i, h);
return h === d && typeof h == "string" && (d = ni(c, i, `${t}${h === "default" ? "" : Me(h)}`, h)), n === !1 ? d : {
[n]: d
};
});
};
return a.propTypes = process.env.NODE_ENV !== "production" ? {
[t]: pn
} : {}, a.filterProps = [t], a;
}
function Xu(e) {
const t = {};
return (n) => (t[n] === void 0 && (t[n] = e(n)), t[n]);
}
const Ju = {
m: "margin",
p: "padding"
}, ep = {
t: "Top",
r: "Right",
b: "Bottom",
l: "Left",
x: ["Left", "Right"],
y: ["Top", "Bottom"]
}, Po = {
marginX: "mx",
marginY: "my",
paddingX: "px",
paddingY: "py"
}, tp = Xu((e) => {
if (e.length > 2)
if (Po[e])
e = Po[e];
else
return [e];
const [t, n] = e.split(""), r = Ju[t], i = ep[n] || "";
return Array.isArray(i) ? i.map((a) => r + a) : [r + i];
}), bi = ["m", "mt", "mr", "mb", "ml", "mx", "my", "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "marginX", "marginY", "marginInline", "marginInlineStart", "marginInlineEnd", "marginBlock", "marginBlockStart", "marginBlockEnd"], wi = ["p", "pt", "pr", "pb", "pl", "px", "py", "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "paddingX", "paddingY", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "paddingBlock", "paddingBlockStart", "paddingBlockEnd"], np = [...bi, ...wi];
function Fr(e, t, n, r) {
const i = xi(e, t, !0) ?? n;
return typeof i == "number" || typeof i == "string" ? (a) => typeof a == "string" ? a : (process.env.NODE_ENV !== "production" && typeof a != "number" && console.error(`MUI: Expected ${r} argument to be a number or a string, got ${a}.`), typeof i == "string" ? i.startsWith("var(") && a === 0 ? 0 : i.startsWith("var(") && a === 1 ? i : `calc(${a} * ${i})` : i * a) : Array.isArray(i) ? (a) => {
if (typeof a == "string")
return a;
const o = Math.abs(a);
process.env.NODE_ENV !== "production" && (Number.isInteger(o) ? o > i.length - 1 && console.error([`MUI: The value provided (${o}) overflows.`, `The supported values are: ${JSON.stringify(i)}.`, `${o} > ${i.length - 1}, you need to add the missing values.`].join(`
`)) : console.error([`MUI: The \`theme.${t}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${t}\` as a number.`].join(`
`)));
const s = i[o];
return a >= 0 ? s : typeof s == "number" ? -s : typeof s == "string" && s.startsWith("var(") ? `calc(-1 * ${s})` : `-${s}`;
} : typeof i == "function" ? i : (process.env.NODE_ENV !== "production" && console.error([`MUI: The \`theme.${t}\` value (${i}) is invalid.`, "It should be a number, an array or a function."].join(`
`)), () => {
});
}
function ja(e) {
return Fr(e, "spacing", 8, "spacing");
}
function Ar(e, t) {
return typeof t == "string" || t == null ? t : e(t);
}
function rp(e, t) {
return (n) => e.reduce((r, i) => (r[i] = Ar(t, n), r), {});
}
function ip(e, t, n, r) {
if (!t.includes(n))
return null;
const i = tp(n), a = rp(i, r), o = e[n];
return qt(e, o, a);
}
function ll(e, t) {
const n = ja(e.theme);
return Object.keys(e).map((r) => ip(e, t, r, n)).reduce(yr, {});
}
function je(e) {
return ll(e, bi);
}
je.propTypes = process.env.NODE_ENV !== "production" ? bi.reduce((e, t) => (e[t] = pn, e), {}) : {};
je.filterProps = bi;
function ze(e) {
return ll(e, wi);
}
ze.propTypes = process.env.NODE_ENV !== "production" ? wi.reduce((e, t) => (e[t] = pn, e), {}) : {};
ze.filterProps = wi;
process.env.NODE_ENV !== "production" && np.reduce((e, t) => (e[t] = pn, e), {});
function Si(...e) {
const t = e.reduce((r, i) => (i.filterProps.forEach((a) => {
r[a] = i;
}), r), {}), n = (r) => Object.keys(r).reduce((i, a) => t[a] ? yr(i, t[a](r)) : i, {});
return n.propTypes = process.env.NODE_ENV !== "production" ? e.reduce((r, i) => Object.assign(r, i.propTypes), {}) : {}, n.filterProps = e.reduce((r, i) => r.concat(i.filterProps), []), n;
}
function St(e) {
return typeof e != "number" ? e : `${e}px solid`;
}
function Ct(e, t) {
return Be({
prop: e,
themeKey: "borders",
transform: t
});
}
const ap = Ct("border", St), op = Ct("borderTop", St), sp = Ct("borderRight", St), lp = Ct("borderBottom", St), cp = Ct("borderLeft", St), up = Ct("borderColor"), pp = Ct("borderTopColor"), dp = Ct("borderRightColor"), fp = Ct("borderBottomColor"), mp = Ct("borderLeftColor"), hp = Ct("outline", St), gp = Ct("outlineColor"), Ci = (e) => {
if (e.borderRadius !== void 0 && e.borderRadius !== null) {
const t = Fr(e.theme, "shape.borderRadius", 4, "borderRadius"), n = (r) => ({
borderRadius: Ar(t, r)
});
return qt(e, e.borderRadius, n);
}
return null;
};
Ci.propTypes = process.env.NODE_ENV !== "production" ? {
borderRadius: pn
} : {};
Ci.filterProps = ["borderRadius"];
Si(ap, op, sp, lp, cp, up, pp, dp, fp, mp, Ci, hp, gp);
const Ei = (e) => {
if (e.gap !== void 0 && e.gap !== null) {
const t = Fr(e.theme, "spacing", 8, "gap"), n = (r) => ({
gap: Ar(t, r)
});
return qt(e, e.gap, n);
}
return null;
};
Ei.propTypes = process.env.NODE_ENV !== "production" ? {
gap: pn
} : {};
Ei.filterProps = ["gap"];
const ki = (e) => {
if (e.columnGap !== void 0 && e.columnGap !== null) {
const t = Fr(e.theme, "spacing", 8, "columnGap"), n = (r) => ({
columnGap: Ar(t, r)
});
return qt(e, e.columnGap, n);
}
return null;
};
ki.propTypes = process.env.NODE_ENV !== "production" ? {
columnGap: pn
} : {};
ki.filterProps = ["columnGap"];
const Ti = (e) => {
if (e.rowGap !== void 0 && e.rowGap !== null) {
const t = Fr(e.theme, "spacing", 8, "rowGap"), n = (r) => ({
rowGap: Ar(t, r)
});
return qt(e, e.rowGap, n);
}
return null;
};
Ti.propTypes = process.env.NODE_ENV !== "production" ? {
rowGap: pn
} : {};
Ti.filterProps = ["rowGap"];
const yp = Be({
prop: "gridColumn"
}), vp = Be({
prop: "gridRow"
}), xp = Be({
prop: "gridAutoFlow"
}), bp = Be({
prop: "gridAutoColumns"
}), wp = Be({
prop: "gridAutoRows"
}), Sp = Be({
prop: "gridTemplateColumns"
}), Cp = Be({
prop: "gridTemplateRows"
}), Ep = Be({
prop: "gridTemplateAreas"
}), kp = Be({
prop: "gridArea"
});
Si(Ei, ki, Ti, yp, vp, xp, bp, wp, Sp, Cp, Ep, kp);
function Hn(e, t) {
return t === "grey" ? t : e;
}
const Tp = Be({
prop: "color",
themeKey: "palette",
transform: Hn
}), Op = Be({
prop: "bgcolor",
cssProperty: "backgroundColor",
themeKey: "palette",
transform: Hn
}), Fp = Be({
prop: "backgroundColor",
themeKey: "palette",
transform: Hn
});
Si(Tp, Op, Fp);
function dt(e) {
return e <= 1 && e !== 0 ? `${e * 100}%` : e;
}
const Ap = Be({
prop: "width",
transform: dt
}), za = (e) => {
if (e.maxWidth !== void 0 && e.maxWidth !== null) {
const t = (n) => {
var i, a, o, s, l;
const r = ((o = (a = (i = e.theme) == null ? void 0 : i.breakpoints) == null ? void 0 : a.values) == null ? void 0 : o[n]) || vi[n];
return r ? ((l = (s = e.theme) == null ? void 0 : s.breakpoints) == null ? void 0 : l.unit) !== "px" ? {
maxWidth: `${r}${e.theme.breakpoints.unit}`
} : {
maxWidth: r
} : {
maxWidth: dt(n)
};
};
return qt(e, e.maxWidth, t);
}
return null;
};
za.filterProps = ["maxWidth"];
const $p = Be({
prop: "minWidth",
transform: dt
}), Rp = Be({
prop: "height",
transform: dt
}), Pp = Be({
prop: "maxHeight",
transform: dt
}), _p = Be({
prop: "minHeight",
transform: dt
});
Be({
prop: "size",
cssProperty: "width",
transform: dt
});
Be({
prop: "size",
cssProperty: "height",
transform: dt
});
const Dp = Be({
prop: "boxSizing"
});
Si(Ap, za, $p, Rp, Pp, _p, Dp);
const $r = {
// borders
border: {
themeKey: "borders",
transform: St
},
borderTop: {
themeKey: "borders",
transform: St
},
borderRight: {
themeKey: "borders",
transform: St
},
borderBottom: {
themeKey: "borders",
transform: St
},
borderLeft: {
themeKey: "borders",
transform: St
},
borderColor: {
themeKey: "palette"
},
borderTopColor: {
themeKey: "palette"
},
borderRightColor: {
themeKey: "palette"
},
borderBottomColor: {
themeKey: "palette"
},
borderLeftColor: {
themeKey: "palette"
},
outline: {
themeKey: "borders",
transform: St
},
outlineColor: {
themeKey: "palette"
},
borderRadius: {
themeKey: "shape.borderRadius",
style: Ci
},
// palette
color: {
themeKey: "palette",
transform: Hn
},
bgcolor: {
themeKey: "palette",
cssProperty: "backgroundColor",
transform: Hn
},
backgroundColor: {
themeKey: "palette",
transform: Hn
},
// spacing
p: {
style: ze
},
pt: {
style: ze
},
pr: {
style: ze
},
pb: {
style: ze
},
pl: {
style: ze
},
px: {
style: ze
},
py: {
style: ze
},
padding: {
style: ze
},
paddingTop: {
style: ze
},
paddingRight: {
style: ze
},
paddingBottom: {
style: ze
},
paddingLeft: {
style: ze
},
paddingX: {
style: ze
},
paddingY: {
style: ze
},
paddingInline: {
style: ze
},
paddingInlineStart: {
style: ze
},
paddingInlineEnd: {
style: ze
},
paddingBlock: {
style: ze
},
paddingBlockStart: {
style: ze
},
paddingBlockEnd: {
style: ze
},
m: {
style: je
},
mt: {
style: je
},
mr: {
style: je
},
mb: {
style: je
},
ml: {
style: je
},
mx: {
style: je
},
my: {
style: je
},
margin: {
style: je
},
marginTop: {
style: je
},
marginRight: {
style: je
},
marginBottom: {
style: je
},
marginLeft: {
style: je
},
marginX: {
style: je
},
marginY: {
style: je
},
marginInline: {
style: je
},
marginInlineStart: {
style: je
},
marginInlineEnd: {
style: je
},
marginBlock: {
style: je
},
marginBlockStart: {
style: je
},
marginBlockEnd: {
style: je
},
// display
displayPrint: {
cssProperty: !1,
transform: (e) => ({
"@media print": {
display: e
}
})
},
display: {},
overflow: {},
textOverflow: {},
visibility: {},
whiteSpace: {},
// flexbox
flexBasis: {},
flexDirection: {},
flexWrap: {},
justifyContent: {},
alignItems: {},
alignContent: {},
order: {},
flex: {},
flexGrow: {},
flexShrink: {},
alignSelf: {},
justifyItems: {},
justifySelf: {},
// grid
gap: {
style: Ei
},
rowGap: {
style: Ti
},
columnGap: {
style: ki
},
gridColumn: {},
gridRow: {},
gridAutoFlow: {},
gridAutoColumns: {},
gridAutoRows: {},
gridTemplateColumns: {},
gridTemplateRows: {},
gridTemplateAreas: {},
gridArea: {},
// positions
position: {},
zIndex: {
themeKey: "zIndex"
},
top: {},
right: {},
bottom: {},
left: {},
// shadows
boxShadow: {
themeKey: "shadows"
},
// sizing
width: {
transform: dt
},
maxWidth: {
style: za
},
minWidth: {
transform: dt
},
height: {
transform: dt
},
maxHeight: {
transform: dt
},
minHeight: {
transform: dt
},
boxSizing: {},
// typography
font: {
themeKey: "font"
},
fontFamily: {
themeKey: "typography"
},
fontSize: {
themeKey: "typography"
},
fontStyle: {
themeKey: "typography"
},
fontWeight: {
themeKey: "typography"
},
letterSpacing: {},
textTransform: {},
lineHeight: {},
textAlign: {},
typography: {
cssProperty: !1,
themeKey: "typography"
}
};
function Ip(...e) {
const t = e.reduce((r, i) => r.concat(Object.keys(i)), []), n = new Set(t);
return e.every((r) => n.size === Object.keys(r).length);
}
function Mp(e, t) {
return typeof e == "function" ? e(t) : e;
}
function jp() {
function e(n, r, i, a) {
const o = {
[n]: r,
theme: i
}, s = a[n];
if (!s)
return {
[n]: r
};
const {
cssProperty: l = n,
themeKey: c,
transform: m,
style: h
} = s;
if (r == null)
return null;
if (c === "typography" && r === "inherit")
return {
[n]: r
};
const d = xi(i, c) || {};
return h ? h(o) : qt(o, r, (x) => {
let f = ni(d, m, x);
return x === f && typeof x == "string" && (f = ni(d, m, `${n}${x === "default" ? "" : Me(x)}`, x)), l === !1 ? f : {
[l]: f
};
});
}
function t(n) {
const {
sx: r,
theme: i = {}
} = n || {};
if (!r)
return null;
const a = i.unstable_sxConfig ?? $r;
function o(s) {
let l = s;
if (typeof s == "function")
l = s(i);
else if (typeof s != "object")
return s;
if (!l)
return null;
const c = Gu(i.breakpoints), m = Object.keys(c);
let h = c;
return Object.keys(l).forEach((d) => {
const g = Mp(l[d], i);
if (g != null)
if (typeof g == "object")
if (a[d])
h = yr(h, e(d, g, i, a));
else {
const x = qt({
theme: i
}, g, (f) => ({
[d]: f
}));
Ip(x, g) ? h[d] = t({
sx: g,
theme: i
}) : h = yr(h, x);
}
else
h = yr(h, e(d, g, i, a));
}), Uu(i, Zu(m, h));
}
return Array.isArray(r) ? r.map(o) : o(r);
}
return t;
}
const or = jp();
or.filterProps = ["sx"];
const zp = (e) => {
var r;
const t = {
systemProps: {},
otherProps: {}
}, n = ((r = e == null ? void 0 : e.theme) == null ? void 0 : r.unstable_sxConfig) ?? $r;
return Object.keys(e).forEach((i) => {
n[i] ? t.systemProps[i] = e[i] : t.otherProps[i] = e[i];
}), t;
};
function Np(e) {
const {
sx: t,
...n
} = e, {
systemProps: r,
otherProps: i
} = zp(n);
let a;
return Array.isArray(t) ? a = [r, ...t] : typeof t == "function" ? a = (...o) => {
const s = t(...o);
return Dt(s) ? {
...r,
...s
} : r;
} : a = {
...r,
...t
}, {
...i,
sx: a
};
}
function Lp(e) {
for (var t = 0, n, r = 0, i = e.length; i >= 4; ++r, i -= 4)
n = e.charCodeAt(r) & 255 | (e.charCodeAt(++r) & 255) << 8 | (e.charCodeAt(++r) & 255) << 16 | (e.charCodeAt(++r) & 255) << 24, n = /* Math.imul(k, m): */
(n & 65535) * 1540483477 + ((n >>> 16) * 59797 << 16), n ^= /* k >>> r: */
n >>> 24, t = /* Math.imul(k, m): */
(n & 65535) * 1540483477 + ((n >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */
(t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16);
switch (i) {
case 3:
t ^= (e.charCodeAt(r + 2) & 255) << 16;
case 2:
t ^= (e.charCodeAt(r + 1) & 255) << 8;
case 1:
t ^= e.charCodeAt(r) & 255, t = /* Math.imul(h, m): */
(t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16);
}
return t ^= t >>> 13, t = /* Math.imul(h, m): */
(t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16), ((t ^ t >>> 15) >>> 0).toString(36);
}
var Bp = {
animationIterationCount: 1,
aspectRatio: 1,
borderImageOutset: 1,
borderImageSlice: 1,
borderImageWidth: 1,
boxFlex: 1,
boxFlexGroup: 1,
boxOrdinalGroup: 1,
columnCount: 1,
columns: 1,
flex: 1,
flexGrow: 1,
flexPositive: 1,
flexShrink: 1,
flexNegative: 1,
flexOrder: 1,
gridRow: 1,
gridRowEnd: 1,
gridRowSpan: 1,
gridRowStart: 1,
gridColumn: 1,
gridColumnEnd: 1,
gridColumnSpan: 1,
gridColumnStart: 1,
msGridRow: 1,
msGridRowSpan: 1,
msGridColumn: 1,
msGridColumnSpan: 1,
fontWeight: 1,
lineHeight: 1,
opacity: 1,
order: 1,
orphans: 1,
scale: 1,
tabSize: 1,
widows: 1,
zIndex: 1,
zoom: 1,
WebkitLineClamp: 1,
// SVG-related properties
fillOpacity: 1,
floodOpacity: 1,
stopOpacity: 1,
strokeDasharray: 1,
strokeDashoffset: 1,
strokeMiterlimit: 1,
strokeOpacity: 1,
strokeWidth: 1
};
function Vp(e) {
var t = /* @__PURE__ */ Object.create(null);
return function(n) {
return t[n] === void 0 && (t[n] = e(n)), t[n];
};
}
var qp = /[A-Z]|^ms/g, Wp = /_EMO_([^_]+?)_([^]*?)_EMO_/g, cl = function(t) {
return t.charCodeAt(1) === 45;
}, _o = function(t) {
return t != null && typeof t != "boolean";
}, ji = /* @__PURE__ */ Vp(function(e) {
return cl(e) ? e : e.replace(qp, "-$&").toLowerCase();
}), Do = function(t, n) {
switch (t) {
case "animation":
case "animationName":
if (typeof n == "string")
return n.replace(Wp, function(r, i, a) {
return rn = {
name: i,
styles: a,
next: rn
}, i;
});
}
return Bp[t] !== 1 && !cl(t) && typeof n == "number" && n !== 0 ? n + "px" : n;
};
function ri(e, t, n) {
if (n == null)
return "";
var r = n;
if (r.__emotion_styles !== void 0)
return r;
switch (typeof n) {
case "boolean":
return "";
case "object": {
var i = n;
if (i.anim === 1)
return rn = {
name: i.name,
styles: i.styles,
next: rn
}, i.name;
var a = n;
if (a.styles !== void 0) {
var o = a.next;
if (o !== void 0)
for (; o !== void 0; )
rn = {
name: o.name,
styles: o.styles,
next: rn
}, o = o.next;
var s = a.styles + ";";
return s;
}
return Up(e, t, n);
}
}
var l = n;
return l;
}
function Up(e, t, n) {
var r = "";
if (Array.isArray(n))
for (var i = 0; i < n.length; i++)
r += ri(e, t, n[i]) + ";";
else
for (var a in n) {
var o = n[a];
if (typeof o != "object") {
var s = o;
_o(s) && (r += ji(a) + ":" + Do(a, s) + ";");
} else if (Array.isArray(o) && typeof o[0] == "string" && t == null)
for (var l = 0; l < o.length; l++)
_o(o[l]) && (r += ji(a) + ":" + Do(a, o[l]) + ";");
else {
var c = ri(e, t, o);
switch (a) {
case "animation":
case "animationName": {
r += ji(a) + ":" + c + ";";
break;
}
default:
r += a + "{" + c + "}";
}
}
}
return r;
}
var Io = /label:\s*([^\s;{]+)\s*(;|$)/g, rn;
function Hp(e, t, n) {
if (e.length === 1 && typeof e[0] == "object" && e[0] !== null && e[0].styles !== void 0)
return e[0];
var r = !0, i = "";
rn = void 0;
var a = e[0];
if (a == null || a.raw === void 0)
r = !1, i += ri(n, t, a);
else {
var o = a;
i += o[0];
}
for (var s = 1; s < e.length; s++)
if (i += ri(n, t, e[s]), r) {
var l = a;
i += l[s];
}
Io.lastIndex = 0;
for (var c = "", m; (m = Io.exec(i)) !== null; )
c += "-" + m[1];
var h = Lp(i) + c;
return {
name: h,
styles: i,
next: rn
};
}
/**
* @mui/styled-engine v7.1.1
*
* @license MIT
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
function Yp(e, t) {
const n = Kc(e, t);
return process.env.NODE_ENV !== "production" ? (...r) => {
const i = typeof e == "string" ? `"${e}"` : "component";
return r.length === 0 ? console.error([`MUI: Seems like you called \`styled(${i})()\` without a \`style\` argument.`, 'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join(`
`)) : r.some((a) => a === void 0) && console.error(`MUI: the styled(${i})(...args) API requires all its args to be defined.`), n(...r);
} : n;
}
function Kp(e, t) {
Array.isArray(e.__emotion_styles) && (e.__emotion_styles = t(e.__emotion_styles));
}
const Mo = [];
function jo(e) {
return Mo[0] = e, Hp(Mo);
}
const Qp = (e) => {
const t = Object.keys(e).map((n) => ({
key: n,
val: e[n]
})) || [];
return t.sort((n, r) => n.val - r.val), t.reduce((n, r) => ({
...n,
[r.key]: r.val
}), {});
};
function Gp(e) {
const {
// The breakpoint **start** at this value.
// For instance with the first breakpoint xs: [xs, sm).
values: t = {
xs: 0,
// phone
sm: 600,
// tablet
md: 900,
// small laptop
lg: 1200,
// desktop
xl: 1536
// large screen
},
unit: n = "px",
step: r = 5,
...i
} = e, a = Qp(t), o = Object.keys(a);
function s(d) {
return `@media (min-width:${typeof t[d] == "number" ? t[d] : d}${n})`;
}
function l(d) {
return `@media (max-width:${(typeof t[d] == "number" ? t[d] : d) - r / 100}${n})`;
}
function c(d, g) {
const x = o.indexOf(g);
return `@media (min-width:${typeof t[d] == "number" ? t[d] : d}${n}) and (max-width:${(x !== -1 && typeof t[o[x]] == "number" ? t[o[x]] : g) - r / 100}${n})`;
}
function m(d) {
return o.indexOf(d) + 1 < o.length ? c(d, o[o.indexOf(d) + 1]) : s(d);
}
function h(d) {
const g = o.indexOf(d);
return g === 0 ? s(o[1]) : g === o.length - 1 ? l(o[g]) : c(d, o[o.indexOf(d) + 1]).replace("@media", "@media not all and");
}
return {
keys: o,
values: a,
up: s,
down: l,
between: c,
only: m,
not: h,
unit: n,
...i
};
}
const Zp = {
borderRadius: 4
};
function ul(e = 8, t = ja({
spacing: e
})) {
if (e.mui)
return e;
const n = (...r) => (process.env.NODE_ENV !== "production" && (r.length <= 4 || console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${r.length}`)), (r.length === 0 ? [1] : r).map((a) => {
const o = t(a);
return typeof o == "number" ? `${o}px` : o;
}).join(" "));
return n.mui = !0, n;
}
function Xp(e, t) {
var r;
const n = this;
if (n.vars) {
if (!((r = n.colorSchemes) != null && r[e]) || typeof n.getColorSchemeSelector != "function")
return {};
let i = n.getColorSchemeSelector(e);
return i === "&" ? t : ((i.includes("data-") || i.includes(".")) && (i = `*:where(${i.replace(/\s*&$/, "")}) &`), {
[i]: t
});
}
return n.palette.mode === e ? t : {};
}
function Na(e = {}, ...t) {
const {
breakpoints: n = {},
palette: r = {},
spacing: i,
shape: a = {},
...o
} = e, s = Gp(n), l = ul(i);
let c = ft({
breakpoints: s,
direction: "ltr",
components: {},
// Inject component definitions.
palette: {
mode: "light",
...r
},
spacing: l,
shape: {
...Zp,
...a
}
}, o);
return c = Ku(c), c.applyStyles = Xp, c = t.reduce((m, h) => ft(m, h), c), c.unstable_sxConfig = {
...$r,
...o == null ? void 0 : o.unstable_sxConfig
}, c.unstable_sx = function(h) {
return or({
sx: h,
theme: this
});
}, c;
}
function Jp(e) {
return Object.keys(e).length === 0;
}
function ed(e = null) {
const t = te.useContext(Qc);
return !t || Jp(t) ? e : t;
}
const td = Na();
function nd(e = td) {
return ed(e);
}
const zo = (e) => e, rd = () => {
let e = zo;
return {
configure(t) {
e = t;
},
generate(t) {
return e(t);
},
reset() {
e = zo;
}
};
}, id = rd(), ad = {
active: "active",
checked: "checked",
completed: "completed",
disabled: "disabled",
error: "error",
expanded: "expanded",
focused: "focused",
focusVisible: "focusVisible",
open: "open",
readOnly: "readOnly",
required: "required",
selected: "selected"
};
function dn(e, t, n = "Mui") {
const r = ad[t];
return r ? `${n}-${r}` : `${id.generate(e)}-${t}`;
}
function An(e, t, n = "Mui") {
const r = {};
return t.forEach((i) => {
r[i] = dn(e, i, n);
}), r;
}
function pl(e, t = "") {
return e.displayName || e.name || t;
}
function No(e, t, n) {
const r = pl(t);
return e.displayName || (r !== "" ? `${n}(${r})` : n);
}
function od(e) {
if (e != null) {
if (typeof e == "string")
return e;
if (typeof e == "function")
return pl(e, "Component");
if (typeof e == "object")
switch (e.$$typeof) {
case ti.ForwardRef:
return No(e, e.render, "ForwardRef");
case ti.Memo:
return No(e, e.type, "memo");
default:
return;
}
}
}
function dl(e) {
const {
variants: t,
...n
} = e, r = {
variants: t,
style: jo(n),
isProcessed: !0
};
return r.style === n || t && t.forEach((i) => {
typeof i.style != "function" && (i.style = jo(i.style));
}), r;
}
const sd = Na();
function zi(e) {
return e !== "ownerState" && e !== "theme" && e !== "sx" && e !== "as";
}
function ld(e) {
return e ? (t, n) => n[e] : null;
}
function cd(e, t, n) {
e.theme = fd(e.theme) ? n : e.theme[t] || e.theme;
}
function Yr(e, t) {
const n = typeof t == "function" ? t(e) : t;
if (Array.isArray(n))
return n.flatMap((r) => Yr(e, r));
if (Array.isArray(n == null ? void 0 : n.variants)) {
let r;
if (n.isProcessed)
r = n.style;
else {
const {
variants: i,
...a
} = n;
r = a;
}
return fl(e, n.variants, [r]);
}
return n != null && n.isProcessed ? n.style : n;
}
function fl(e, t, n = []) {
var i;
let r;
e: for (let a = 0; a < t.length; a += 1) {
const o = t[a];
if (typeof o.props == "function") {
if (r ?? (r = {
...e,
...e.ownerState,
ownerState: e.ownerState
}), !o.props(r))
continue;
} else
for (const s in o.props)
if (e[s] !== o.props[s] && ((i = e.ownerState) == null ? void 0 : i[s]) !== o.props[s])
continue e;
typeof o.style == "function" ? (r ?? (r = {
...e,
...e.ownerState,
ownerState: e.ownerState
}), n.push(o.style(r))) : n.push(o.style);
}
return n;
}
function ud(e = {}) {
const {
themeId: t,
defaultTheme: n = sd,
rootShouldForwardProp: r = zi,
slotShouldForwardProp: i = zi
} = e;
function a(s) {
cd(s, t, n);
}
return (s, l = {}) => {
Kp(s, (w) => w.filter((P) => P !== or));
const {
name: c,
slot: m,
skipVariantsResolver: h,
skipSx: d,
// TODO v6: remove `lowercaseFirstLetter()` in the next major release
// For more details: https://github.com/mui/material-ui/pull/37908
overridesResolver: g = ld(ml(m)),
...x
} = l, f = h !== void 0 ? h : (
// TODO v6: remove `Root` in the next major release
// For more details: https://github.com/mui/material-ui/pull/37908
m && m !== "Root" && m !== "root" || !1
), E = d || !1;
let y = zi;
m === "Root" || m === "root" ? y = r : m ? y = i : md(s) && (y = void 0);
const T = Yp(s, {
shouldForwardProp: y,
label: dd(c, m),
...x
}), k = (w) => {
if (w.__emotion_real === w)
return w;
if (typeof w == "function")
return function(M) {
return Yr(M, w);
};
if (Dt(w)) {
const P = dl(w);
return P.variants ? function(I) {
return Yr(I, P);
} : P.style;
}
return w;
}, v = (...w) => {
const P = [], M = w.map(k), I = [];
if (P.push(a), c && g && I.push(function($) {
var L, Q;
const j = (Q = (L = $.theme.components) == null ? void 0 : L[c]) == null ? void 0 : Q.styleOverrides;
if (!j)
return null;
const re = {};
for (const V in j)
re[V] = Yr($, j[V]);
return g($, re);
}), c && !f && I.push(function($) {
var re, L;
const Z = $.theme, j = (L = (re = Z == null ? void 0 : Z.components) == null ? void 0 : re[c]) == null ? void 0 : L.variants;
return j ? fl($, j) : null;
}), E || I.push(or), Array.isArray(M[0])) {
const R = M.shift(), $ = new Array(P.length).fill(""), Z = new Array(I.length).fill("");
let j;
j = [...$, ...R, ...Z], j.raw = [...$, ...R.raw, ...Z], P.unshift(j);
}
const N = [...P, ...M, ...I], p = T(...N);
return s.muiName && (p.muiName = s.muiName), process.env.NODE_ENV !== "production" && (p.displayName = pd(c, m, s)), p;
};
return T.withConfig && (v.withConfig = T.withConfig), v;
};
}
function pd(e, t, n) {
return e ? `${e}${Me(t || "")}` : `Styled(${od(n)})`;
}
function dd(e, t) {
let n;
return process.env.NODE_ENV !== "production" && e && (n = `${e}-${ml(t || "Root")}`), n;
}
function fd(e) {
for (const t in e)
return !1;
return !0;
}
function md(e) {
return typeof e == "string" && // 96 is one less than the char code
// for "a" so this is checking that
// it's a lowercase character
e.charCodeAt(0) > 96;
}
function ml(e) {
return e && e.charAt(0).toLowerCase() + e.slice(1);
}
function pa(e, t) {
const n = {
...t
};
for (const r in e)
if (Object.prototype.hasOwnProperty.call(e, r)) {
const i = r;
if (i === "components" || i === "slots")
n[i] = {
...e[i],
...n[i]
};
else if (i === "componentsProps" || i === "slotProps") {
const a = e[i], o = t[i];
if (!o)
n[i] = a || {};
else if (!a)
n[i] = o;
else {
n[i] = {
...o
};
for (const s in a)
if (Object.prototype.hasOwnProperty.call(a, s)) {
const l = s;
n[i][l] = pa(a[l], o[l]);
}
}
} else n[i] === void 0 && (n[i] = e[i]);
}
return n;
}
const hd = typeof window < "u" ? te.useLayoutEffect : te.useEffect;
function gd(e, t = Number.MIN_SAFE_INTEGER, n = Number.MAX_SAFE_INTEGER) {
return Math.max(t, Math.min(e, n));
}
function La(e, t = 0, n = 1) {
return process.env.NODE_ENV !== "production" && (e < t || e > n) && console.error(`MUI: The value provided ${e} is out of range [${t}, ${n}].`), gd(e, t, n);
}
function yd(e) {
e = e.slice(1);
const t = new RegExp(`.{1,${e.length >= 6 ? 2 : 1}}`, "g");
let n = e.match(t);
return n && n[0].length === 1 && (n = n.map((r) => r + r)), process.env.NODE_ENV !== "production" && e.length !== e.trim().length && console.error(`MUI: The color: "${e}" is invalid. Make sure the color input doesn't contain leading/trailing space.`), n ? `rgb${n.length === 4 ? "a" : ""}(${n.map((r, i) => i < 3 ? parseInt(r, 16) : Math.round(parseInt(r, 16) / 255 * 1e3) / 1e3).join(", ")})` : "";
}
function cn(e) {
if (e.type)
return e;
if (e.charAt(0) === "#")
return cn(yd(e));
const t = e.indexOf("("), n = e.substring(0, t);
if (!["rgb", "rgba", "hsl", "hsla", "color"].includes(n))
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: Unsupported \`${e}\` color.
The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().` : ln(9, e));
let r = e.substring(t + 1, e.length - 1), i;
if (n === "color") {
if (r = r.split(" "), i = r.shift(), r.length === 4 && r[3].charAt(0) === "/" && (r[3] = r[3].slice(1)), !["srgb", "display-p3", "a98-rgb", "prophoto-rgb", "rec-2020"].includes(i))
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: unsupported \`${i}\` color space.
The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.` : ln(10, i));
} else
r = r.split(",");
return r = r.map((a) => parseFloat(a)), {
type: n,
values: r,
colorSpace: i
};
}
const vd = (e) => {
const t = cn(e);
return t.values.slice(0, 3).map((n, r) => t.type.includes("hsl") && r !== 0 ? `${n}%` : n).join(" ");
}, dr = (e, t) => {
try {
return vd(e);
} catch {
return t && process.env.NODE_ENV !== "production" && console.warn(t), e;
}
};
function Oi(e) {
const {
type: t,
colorSpace: n
} = e;
let {
values: r
} = e;
return t.includes("rgb") ? r = r.map((i, a) => a < 3 ? parseInt(i, 10) : i) : t.includes("hsl") && (r[1] = `${r[1]}%`, r[2] = `${r[2]}%`), t.includes("color") ? r = `${n} ${r.join(" ")}` : r = `${r.join(", ")}`, `${t}(${r})`;
}
function hl(e) {
e = cn(e);
const {
values: t
} = e, n = t[0], r = t[1] / 100, i = t[2] / 100, a = r * Math.min(i, 1 - i), o = (c, m = (c + n / 30) % 12) => i - a * Math.max(Math.min(m - 3, 9 - m, 1), -1);
let s = "rgb";
const l = [Math.round(o(0) * 255), Math.round(o(8) * 255), Math.round(o(4) * 255)];
return e.type === "hsla" && (s += "a", l.push(t[3])), Oi({
type: s,
values: l
});
}
function da(e) {
e = cn(e);
let t = e.type === "hsl" || e.type === "hsla" ? cn(hl(e)).values : e.values;
return t = t.map((n) => (e.type !== "color" && (n /= 255), n <= 0.03928 ? n / 12.92 : ((n + 0.055) / 1.055) ** 2.4)), Number((0.2126 * t[0] + 0.7152 * t[1] + 0.0722 * t[2]).toFixed(3));
}
function Lo(e, t) {
const n = da(e), r = da(t);
return (Math.max(n, r) + 0.05) / (Math.min(n, r) + 0.05);
}
function mt(e, t) {
return e = cn(e), t = La(t), (e.type === "rgb" || e.type === "hsl") && (e.type += "a"), e.type === "color" ? e.values[3] = `/${t}` : e.values[3] = t, Oi(e);
}
function zr(e, t, n) {
try {
return mt(e, t);
} catch {
return e;
}
}
function Ba(e, t) {
if (e = cn(e), t = La(t), e.type.includes("hsl"))
e.values[2] *= 1 - t;
else if (e.type.includes("rgb") || e.type.includes("color"))
for (let n = 0; n < 3; n += 1)
e.values[n] *= 1 - t;
return Oi(e);
}
function Fe(e, t, n) {
try {
return Ba(e, t);
} catch {
return e;
}
}
function Va(e, t) {
if (e = cn(e), t = La(t), e.type.includes("hsl"))
e.values[2] += (100 - e.values[2]) * t;
else if (e.type.includes("rgb"))
for (let n = 0; n < 3; n += 1)
e.values[n] += (255 - e.values[n]) * t;
else if (e.type.includes("color"))
for (let n = 0; n < 3; n += 1)
e.values[n] += (1 - e.values[n]) * t;
return Oi(e);
}
function Ae(e, t, n) {
try {
return Va(e, t);
} catch {
return e;
}
}
function xd(e, t = 0.15) {
return da(e) > 0.5 ? Ba(e, t) : Va(e, t);
}
function Nr(e, t, n) {
try {
return xd(e, t);
} catch {
return e;
}
}
const bd = /* @__PURE__ */ te.createContext(void 0);
process.env.NODE_ENV !== "production" && (b.node, b.object);
function wd(e) {
const {
theme: t,
name: n,
props: r
} = e;
if (!t || !t.components || !t.components[n])
return r;
const i = t.components[n];
return i.defaultProps ? pa(i.defaultProps, r) : !i.styleOverrides && !i.variants ? pa(i, r) : r;
}
function Sd({
props: e,
name: t
}) {
const n = te.useContext(bd);
return wd({
props: e,
name: t,
theme: {
components: n
}
});
}
const Bo = {
theme: void 0
};
function Cd(e) {
let t, n;
return function(i) {
let a = t;
return (a === void 0 || i.theme !== n) && (Bo.theme = i.theme, a = dl(e(Bo)), t = a, n = i.theme), a;
};
}
function Ed(e = "") {
function t(...r) {
if (!r.length)
return "";
const i = r[0];
return typeof i == "string" && !i.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/) ? `, var(--${e ? `${e}-` : ""}${i}${t(...r.slice(1))})` : `, ${i}`;
}
return (r, ...i) => `var(--${e ? `${e}-` : ""}${r}${t(...i)})`;
}
const Vo = (e, t, n, r = []) => {
let i = e;
t.forEach((a, o) => {
o === t.length - 1 ? Array.isArray(i) ? i[Number(a)] = n : i && typeof i == "object" && (i[a] = n) : i && typeof i == "object" && (i[a] || (i[a] = r.includes(a) ? [] : {}), i = i[a]);
});
}, kd = (e, t, n) => {
function r(i, a = [], o = []) {
Object.entries(i).forEach(([s, l]) => {
(!n || n && !n([...a, s])) && l != null && (typeof l == "object" && Object.keys(l).length > 0 ? r(l, [...a, s], Array.isArray(l) ? [...o, s] : o) : t([...a, s], l, o));
});
}
r(e);
}, Td = (e, t) => typeof t == "number" ? ["lineHeight", "fontWeight", "opacity", "zIndex"].some((r) => e.includes(r)) || e[e.length - 1].toLowerCase().includes("opacity") ? t : `${t}px` : t;
function Ni(e, t) {
const {
prefix: n,
shouldSkipGeneratingVar: r
} = t || {}, i = {}, a = {}, o = {};
return kd(
e,
(s, l, c) => {
if ((typeof l == "string" || typeof l == "number") && (!r || !r(s, l))) {
const m = `--${n ? `${n}-` : ""}${s.join("-")}`, h = Td(s, l);
Object.assign(i, {
[m]: h
}), Vo(a, s, `var(${m})`, c), Vo(o, s, `var(${m}, ${h})`, c);
}
},
(s) => s[0] === "vars"
// skip 'vars/*' paths
), {
css: i,
vars: a,
varsWithDefaults: o
};
}
function Od(e, t = {}) {
const {
getSelector: n = E,
disableCssColorScheme: r,
colorSchemeSelector: i
} = t, {
colorSchemes: a = {},
components: o,
defaultColorScheme: s = "light",
...l
} = e, {
vars: c,
css: m,
varsWithDefaults: h
} = Ni(l, t);
let d = h;
const g = {}, {
[s]: x,
...f
} = a;
if (Object.entries(f || {}).forEach(([k, v]) => {
const {
vars: w,
css: P,
varsWithDefaults: M
} = Ni(v, t);
d = ft(d, M), g[k] = {
css: P,
vars: w
};
}), x) {
const {
css: k,
vars: v,
varsWithDefaults: w
} = Ni(x, t);
d = ft(d, w), g[s] = {
css: k,
vars: v
};
}
function E(k, v) {
var P, M;
let w = i;
if (i === "class" && (w = ".%s"), i === "data" && (w = "[data-%s]"), i != null && i.startsWith("data-") && !i.includes("%s") && (w = `[${i}="%s"]`), k) {
if (w === "media")
return e.defaultColorScheme === k ? ":root" : {
[`@media (prefers-color-scheme: ${((M = (P = a[k]) == null ? void 0 : P.palette) == null ? void 0 : M.mode) || k})`]: {
":root": v
}
};
if (w)
return e.defaultColorScheme === k ? `:root, ${w.replace("%s", String(k))}` : w.replace("%s", String(k));
}
return ":root";
}
return {
vars: d,
generateThemeVars: () => {
let k = {
...c
};
return Object.entries(g).forEach(([, {
vars: v
}]) => {
k = ft(k, v);
}), k;
},
generateStyleSheets: () => {
var I, N;
const k = [], v = e.defaultColorScheme || "light";
function w(p, R) {
Object.keys(R).length && k.push(typeof p == "string" ? {
[p]: {
...R
}
} : p);
}
w(n(void 0, {
...m
}), m);
const {
[v]: P,
...M
} = g;
if (P) {
const {
css: p
} = P, R = (N = (I = a[v]) == null ? void 0 : I.palette) == null ? void 0 : N.mode, $ = !r && R ? {
colorScheme: R,
...p
} : {
...p
};
w(n(v, {
...$
}), $);
}
return Object.entries(M).forEach(([p, {
css: R
}]) => {
var j, re;
const $ = (re = (j = a[p]) == null ? void 0 : j.palette) == null ? void 0 : re.mode, Z = !r && $ ? {
colorScheme: $,
...R
} : {
...R
};
w(n(p, {
...Z
}), Z);
}), k;
}
};
}
function Fd(e) {
return function(n) {
return e === "media" ? (process.env.NODE_ENV !== "production" && n !== "light" && n !== "dark" && console.error(`MUI: @media (prefers-color-scheme) supports only 'light' or 'dark', but receive '${n}'.`), `@media (prefers-color-scheme: ${n})`) : e ? e.startsWith("data-") && !e.includes("%s") ? `[${e}="${n}"] &` : e === "class" ? `.${n} &` : e === "data" ? `[data-${n}] &` : `${e.replace("%s", n)} &` : "&";
};
}
const br = {
black: "#000",
white: "#fff"
}, Ad = {
50: "#fafafa",
100: "#f5f5f5",
200: "#eeeeee",
300: "#e0e0e0",
400: "#bdbdbd",
500: "#9e9e9e",
600: "#757575",
700: "#616161",
800: "#424242",
900: "#212121",
A100: "#f5f5f5",
A200: "#eeeeee",
A400: "#bdbdbd",
A700: "#616161"
}, In = {
50: "#f3e5f5",
200: "#ce93d8",
300: "#ba68c8",
400: "#ab47bc",
500: "#9c27b0",
700: "#7b1fa2"
}, Mn = {
300: "#e57373",
400: "#ef5350",
500: "#f44336",
700: "#d32f2f",
800: "#c62828"
}, ur = {
300: "#ffb74d",
400: "#ffa726",
500: "#ff9800",
700: "#f57c00",
900: "#e65100"
}, jn = {
50: "#e3f2fd",
200: "#90caf9",
400: "#42a5f5",
700: "#1976d2",
800: "#1565c0"
}, zn = {
300: "#4fc3f7",
400: "#29b6f6",
500: "#03a9f4",
700: "#0288d1",
900: "#01579b"
}, Nn = {
300: "#81c784",
400: "#66bb6a",
500: "#4caf50",
700: "#388e3c",
800: "#2e7d32",
900: "#1b5e20"
};
function gl() {
return {
// The colors used to style the text.
text: {
// The most important text.
primary: "rgba(0, 0, 0, 0.87)",
// Secondary text.
secondary: "rgba(0, 0, 0, 0.6)",
// Disabled text have even lower visual prominence.
disabled: "rgba(0, 0, 0, 0.38)"
},
// The color used to divide different elements.
divider: "rgba(0, 0, 0, 0.12)",
// The background colors used to style the surfaces.
// Consistency between these values is important.
background: {
paper: br.white,
default: br.white
},
// The colors used to style the action elements.
action: {
// The color of an active action like an icon button.
active: "rgba(0, 0, 0, 0.54)",
// The color of an hovered action.
hover: "rgba(0, 0, 0, 0.04)",
hoverOpacity: 0.04,
// The color of a selected action.
selected: "rgba(0, 0, 0, 0.08)",
selectedOpacity: 0.08,
// The color of a disabled action.
disabled: "rgba(0, 0, 0, 0.26)",
// The background color of a disabled action.
disabledBackground: "rgba(0, 0, 0, 0.12)",
disabledOpacity: 0.38,
focus: "rgba(0, 0, 0, 0.12)",
focusOpacity: 0.12,
activatedOpacity: 0.12
}
};
}
const $d = gl();
function yl() {
return {
text: {
primary: br.white,
secondary: "rgba(255, 255, 255, 0.7)",
disabled: "rgba(255, 255, 255, 0.5)",
icon: "rgba(255, 255, 255, 0.5)"
},
divider: "rgba(255, 255, 255, 0.12)",
background: {
paper: "#121212",
default: "#121212"
},
action: {
active: br.white,
hover: "rgba(255, 255, 255, 0.08)",
hoverOpacity: 0.08,
selected: "rgba(255, 255, 255, 0.16)",
selectedOpacity: 0.16,
disabled: "rgba(255, 255, 255, 0.3)",
disabledBackground: "rgba(255, 255, 255, 0.12)",
disabledOpacity: 0.38,
focus: "rgba(255, 255, 255, 0.12)",
focusOpacity: 0.12,
activatedOpacity: 0.24
}
};
}
const qo = yl();
function Wo(e, t, n, r) {
const i = r.light || r, a = r.dark || r * 1.5;
e[t] || (e.hasOwnProperty(n) ? e[t] = e[n] : t === "light" ? e.light = Va(e.main, i) : t === "dark" && (e.dark = Ba(e.main, a)));
}
function Rd(e = "light") {
return e === "dark" ? {
main: jn[200],
light: jn[50],
dark: jn[400]
} : {
main: jn[700],
light: jn[400],
dark: jn[800]
};
}
function Pd(e = "light") {
return e === "dark" ? {
main: In[200],
light: In[50],
dark: In[400]
} : {
main: In[500],
light: In[300],
dark: In[700]
};
}
function _d(e = "light") {
return e === "dark" ? {
main: Mn[500],
light: Mn[300],
dark: Mn[700]
} : {
main: Mn[700],
light: Mn[400],
dark: Mn[800]
};
}
function Dd(e = "light") {
return e === "dark" ? {
main: zn[400],
light: zn[300],
dark: zn[700]
} : {
main: zn[700],
light: zn[500],
dark: zn[900]
};
}
function Id(e = "light") {
return e === "dark" ? {
main: Nn[400],
light: Nn[300],
dark: Nn[700]
} : {
main: Nn[800],
light: Nn[500],
dark: Nn[900]
};
}
function Md(e = "light") {
return e === "dark" ? {
main: ur[400],
light: ur[300],
dark: ur[700]
} : {
main: "#ed6c02",
// closest to orange[800] that pass 3:1.
light: ur[500],
dark: ur[900]
};
}
function qa(e) {
const {
mode: t = "light",
contrastThreshold: n = 3,
tonalOffset: r = 0.2,
...i
} = e, a = e.primary || Rd(t), o = e.secondary || Pd(t), s = e.error || _d(t), l = e.info || Dd(t), c = e.success || Id(t), m = e.warning || Md(t);
function h(f) {
const E = Lo(f, qo.text.primary) >= n ? qo.text.primary : $d.text.primary;
if (process.env.NODE_ENV !== "production") {
const y = Lo(f, E);
y < 3 && console.error([`MUI: The contrast ratio of ${y}:1 for ${E} on ${f}`, "falls below the WCAG recommended absolute minimum contrast ratio of 3:1.", "https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast"].join(`
`));
}
return E;
}
const d = ({
color: f,
name: E,
mainShade: y = 500,
lightShade: T = 300,
darkShade: k = 700
}) => {
if (f = {
...f
}, !f.main && f[y] && (f.main = f[y]), !f.hasOwnProperty("main"))
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${E ? ` (${E})` : ""} provided to augmentColor(color) is invalid.
The color object needs to have a \`main\` property or a \`${y}\` property.` : ln(11, E ? ` (${E})` : "", y));
if (typeof f.main != "string")
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${E ? ` (${E})` : ""} provided to augmentColor(color) is invalid.
\`color.main\` should be a string, but \`${JSON.stringify(f.main)}\` was provided instead.
Did you intend to use one of the following approaches?
import { green } from "@mui/material/colors";
const theme1 = createTheme({ palette: {
primary: green,
} });
const theme2 = createTheme({ palette: {
primary: { main: green[500] },
} });` : ln(12, E ? ` (${E})` : "", JSON.stringify(f.main)));
return Wo(f, "light", T, r), Wo(f, "dark", k, r), f.contrastText || (f.contrastText = h(f.main)), f;
};
let g;
return t === "light" ? g = gl() : t === "dark" && (g = yl()), process.env.NODE_ENV !== "production" && (g || console.error(`MUI: The palette mode \`${t}\` is not supported.`)), ft({
// A collection of common colors.
common: {
...br
},
// prevent mutable object.
// The palette mode, can be light or dark.
mode: t,
// The colors used to represent primary interface elements for a user.
primary: d({
color: a,
name: "primary"
}),
// The colors used to represent secondary interface elements for a user.
secondary: d({
color: o,
name: "secondary",
mainShade: "A400",
lightShade: "A200",
darkShade: "A700"
}),
// The colors used to represent interface elements that the user should be made aware of.
error: d({
color: s,
name: "error"
}),
// The colors used to represent potentially dangerous actions or important messages.
warning: d({
color: m,
name: "warning"
}),
// The colors used to present information to the user that is neutral and not necessarily important.
info: d({
color: l,
name: "info"
}),
// The colors used to indicate the successful completion of an action that user triggered.
success: d({
color: c,
name: "success"
}),
// The grey colors.
grey: Ad,
// Used by `getContrastText()` to maximize the contrast between
// the background and the text.
contrastThreshold: n,
// Takes a background color and returns the text color that maximizes the contrast.
getContrastText: h,
// Generate a rich color object.
augmentColor: d,
// Used by the functions below to shift a color's luminance by approximately
// two indexes within its tonal palette.
// E.g., shift from Red 500 to Red 300 or Red 700.
tonalOffset: r,
// The light and dark mode object.
...g
}, i);
}
function jd(e) {
const t = {};
return Object.entries(e).forEach((r) => {
const [i, a] = r;
typeof a == "object" && (t[i] = `${a.fontStyle ? `${a.fontStyle} ` : ""}${a.fontVariant ? `${a.fontVariant} ` : ""}${a.fontWeight ? `${a.fontWeight} ` : ""}${a.fontStretch ? `${a.fontStretch} ` : ""}${a.fontSize || ""}${a.lineHeight ? `/${a.lineHeight} ` : ""}${a.fontFamily || ""}`);
}), t;
}
function zd(e, t) {
return {
toolbar: {
minHeight: 56,
[e.up("xs")]: {
"@media (orientation: landscape)": {
minHeight: 48
}
},
[e.up("sm")]: {
minHeight: 64
}
},
...t
};
}
function Nd(e) {
return Math.round(e * 1e5) / 1e5;
}
const Uo = {
textTransform: "uppercase"
}, Ho = '"Roboto", "Helvetica", "Arial", sans-serif';
function Ld(e, t) {
const {
fontFamily: n = Ho,
// The default font size of the Material Specification.
fontSize: r = 14,
// px
fontWeightLight: i = 300,
fontWeightRegular: a = 400,
fontWeightMedium: o = 500,
fontWeightBold: s = 700,
// Tell MUI what's the font-size on the html element.
// 16px is the default font-size used by browsers.
htmlFontSize: l = 16,
// Apply the CSS properties to all the variants.
allVariants: c,
pxToRem: m,
...h
} = typeof t == "function" ? t(e) : t;
process.env.NODE_ENV !== "production" && (typeof r != "number" && console.error("MUI: `fontSize` is required to be a number."), typeof l != "number" && console.error("MUI: `htmlFontSize` is required to be a number."));
const d = r / 14, g = m || ((E) => `${E / l * d}rem`), x = (E, y, T, k, v) => ({
fontFamily: n,
fontWeight: E,
fontSize: g(y),
// Unitless following https://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/
lineHeight: T,
// The letter spacing was designed for the Roboto font-family. Using the same letter-spacing
// across font-families can cause issues with the kerning.
...n === Ho ? {
letterSpacing: `${Nd(k / y)}em`
} : {},
...v,
...c
}), f = {
h1: x(i, 96, 1.167, -1.5),
h2: x(i, 60, 1.2, -0.5),
h3: x(a, 48, 1.167, 0),
h4: x(a, 34, 1.235, 0.25),
h5: x(a, 24, 1.334, 0),
h6: x(o, 20, 1.6, 0.15),
subtitle1: x(a, 16, 1.75, 0.15),
subtitle2: x(o, 14, 1.57, 0.1),
body1: x(a, 16, 1.5, 0.15),
body2: x(a, 14, 1.43, 0.15),
button: x(o, 14, 1.75, 0.4, Uo),
caption: x(a, 12, 1.66, 0.4),
overline: x(a, 12, 2.66, 1, Uo),
// TODO v6: Remove handling of 'inherit' variant from the theme as it is already handled in Material UI's Typography component. Also, remember to remove the associated types.
inherit: {
fontFamily: "inherit",
fontWeight: "inherit",
fontSize: "inherit",
lineHeight: "inherit",
letterSpacing: "inherit"
}
};
return ft({
htmlFontSize: l,
pxToRem: g,
fontFamily: n,
fontSize: r,
fontWeightLight: i,
fontWeightRegular: a,
fontWeightMedium: o,
fontWeightBold: s,
...f
}, h, {
clone: !1
// No need to clone deep
});
}
const Bd = 0.2, Vd = 0.14, qd = 0.12;
function _e(...e) {
return [`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${Bd})`, `${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${Vd})`, `${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${qd})`].join(",");
}
const Wd = ["none", _e(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), _e(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), _e(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), _e(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), _e(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), _e(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), _e(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), _e(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), _e(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), _e(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), _e(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), _e(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), _e(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), _e(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), _e(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), _e(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), _e(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), _e(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), _e(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), _e(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), _e(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), _e(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), _e(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), _e(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)], Ud = {
// This is the most common easing curve.
easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)",
// Objects enter the screen at full velocity from off-screen and
// slowly decelerate to a resting point.
easeOut: "cubic-bezier(0.0, 0, 0.2, 1)",
// Objects leave the screen at full velocity. They do not decelerate when off-screen.
easeIn: "cubic-bezier(0.4, 0, 1, 1)",
// The sharp curve is used by objects that may return to the screen at any time.
sharp: "cubic-bezier(0.4, 0, 0.6, 1)"
}, Hd = {
shortest: 150,
shorter: 200,
short: 250,
// most basic recommended timing
standard: 300,
// this is to be used in complex animations
complex: 375,
// recommended when something is entering screen
enteringScreen: 225,
// recommended when something is leaving screen
leavingScreen: 195
};
function Yo(e) {
return `${Math.round(e)}ms`;
}
function Yd(e) {
if (!e)
return 0;
const t = e / 36;
return Math.min(Math.round((4 + 15 * t ** 0.25 + t / 5) * 10), 3e3);
}
function Kd(e) {
const t = {
...Ud,
...e.easing
}, n = {
...Hd,
...e.duration
};
return {
getAutoHeightDuration: Yd,
create: (i = ["all"], a = {}) => {
const {
duration: o = n.standard,
easing: s = t.easeInOut,
delay: l = 0,
...c
} = a;
if (process.env.NODE_ENV !== "production") {
const m = (d) => typeof d == "string", h = (d) => !Number.isNaN(parseFloat(d));
!m(i) && !Array.isArray(i) && console.error('MUI: Argument "props" must be a string or Array.'), !h(o) && !m(o) && console.error(`MUI: Argument "duration" must be a number or a string but found ${o}.`), m(s) || console.error('MUI: Argument "easing" must be a string.'), !h(l) && !m(l) && console.error('MUI: Argument "delay" must be a number or a string.'), typeof a != "object" && console.error(["MUI: Secong argument of transition.create must be an object.", "Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`"].join(`
`)), Object.keys(c).length !== 0 && console.error(`MUI: Unrecognized argument(s) [${Object.keys(c).join(",")}].`);
}
return (Array.isArray(i) ? i : [i]).map((m) => `${m} ${typeof o == "string" ? o : Yo(o)} ${s} ${typeof l == "string" ? l : Yo(l)}`).join(",");
},
...e,
easing: t,
duration: n
};
}
const Qd = {
mobileStepper: 1e3,
fab: 1050,
speedDial: 1050,
appBar: 1100,
drawer: 1200,
modal: 1300,
snackbar: 1400,
tooltip: 1500
};
function Gd(e) {
return Dt(e) || typeof e > "u" || typeof e == "string" || typeof e == "boolean" || typeof e == "number" || Array.isArray(e);
}
function vl(e = {}) {
const t = {
...e
};
function n(r) {
const i = Object.entries(r);
for (let a = 0; a < i.length; a++) {
const [o, s] = i[a];
!Gd(s) || o.startsWith("unstable_") ? delete r[o] : Dt(s) && (r[o] = {
...s
}, n(r[o]));
}
}
return n(t), `import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
const theme = ${JSON.stringify(t, null, 2)};
theme.breakpoints = createBreakpoints(theme.breakpoints || {});
theme.transitions = createTransitions(theme.transitions || {});
export default theme;`;
}
function fa(e = {}, ...t) {
const {
breakpoints: n,
mixins: r = {},
spacing: i,
palette: a = {},
transitions: o = {},
typography: s = {},
shape: l,
...c
} = e;
if (e.vars && // The error should throw only for the root theme creation because user is not allowed to use a custom node `vars`.
// `generateThemeVars` is the closest identifier for checking that the `options` is a result of `createTheme` with CSS variables so that user can create new theme for nested ThemeProvider.
e.generateThemeVars === void 0)
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature." : ln(20));
const m = qa(a), h = Na(e);
let d = ft(h, {
mixins: zd(h.breakpoints, r),
palette: m,
// Don't use [...shadows] until you've verified its transpiled code is not invoking the iterator protocol.
shadows: Wd.slice(),
typography: Ld(m, s),
transitions: Kd(o),
zIndex: {
...Qd
}
});
if (d = ft(d, c), d = t.reduce((g, x) => ft(g, x), d), process.env.NODE_ENV !== "production") {
const g = ["active", "checked", "completed", "disabled", "error", "expanded", "focused", "focusVisible", "required", "selected"], x = (f, E) => {
let y;
for (y in f) {
const T = f[y];
if (g.includes(y) && Object.keys(T).length > 0) {
if (process.env.NODE_ENV !== "production") {
const k = dn("", y);
console.error([`MUI: The \`${E}\` component increases the CSS specificity of the \`${y}\` internal state.`, "You can not override it like this: ", JSON.stringify(f, null, 2), "", `Instead, you need to use the '&.${k}' syntax:`, JSON.stringify({
root: {
[`&.${k}`]: T
}
}, null, 2), "", "https://mui.com/r/state-classes-guide"].join(`
`));
}
f[y] = {};
}
}
};
Object.keys(d.components).forEach((f) => {
const E = d.components[f].styleOverrides;
E && f.startsWith("Mui") && x(E, f);
});
}
return d.unstable_sxConfig = {
...$r,
...c == null ? void 0 : c.unstable_sxConfig
}, d.unstable_sx = function(x) {
return or({
sx: x,
theme: this
});
}, d.toRuntimeSource = vl, d;
}
function Zd(e) {
let t;
return e < 1 ? t = 5.11916 * e ** 2 : t = 4.5 * Math.log(e + 1) + 2, Math.round(t * 10) / 1e3;
}
const Xd = [...Array(25)].map((e, t) => {
if (t === 0)
return "none";
const n = Zd(t);
return `linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`;
});
function xl(e) {
return {
inputPlaceholder: e === "dark" ? 0.5 : 0.42,
inputUnderline: e === "dark" ? 0.7 : 0.42,
switchTrackDisabled: e === "dark" ? 0.2 : 0.12,
switchTrack: e === "dark" ? 0.3 : 0.38
};
}
function bl(e) {
return e === "dark" ? Xd : [];
}
function Jd(e) {
const {
palette: t = {
mode: "light"
},
// need to cast to avoid module augmentation test
opacity: n,
overlays: r,
...i
} = e, a = qa(t);
return {
palette: a,
opacity: {
...xl(a.mode),
...n
},
overlays: r || bl(a.mode),
...i
};
}
function ef(e) {
var t;
return !!e[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/) || !!e[0].match(/sxConfig$/) || // ends with sxConfig
e[0] === "palette" && !!((t = e[1]) != null && t.match(/(mode|contrastThreshold|tonalOffset)/));
}
const tf = (e) => [...[...Array(25)].map((t, n) => `--${e ? `${e}-` : ""}overlays-${n}`), `--${e ? `${e}-` : ""}palette-AppBar-darkBg`, `--${e ? `${e}-` : ""}palette-AppBar-darkColor`], nf = (e) => (t, n) => {
const r = e.rootSelector || ":root", i = e.colorSchemeSelector;
let a = i;
if (i === "class" && (a = ".%s"), i === "data" && (a = "[data-%s]"), i != null && i.startsWith("data-") && !i.includes("%s") && (a = `[${i}="%s"]`), e.defaultColorScheme === t) {
if (t === "dark") {
const o = {};
return tf(e.cssVarPrefix).forEach((s) => {
o[s] = n[s], delete n[s];
}), a === "media" ? {
[r]: n,
"@media (prefers-color-scheme: dark)": {
[r]: o
}
} : a ? {
[a.replace("%s", t)]: o,
[`${r}, ${a.replace("%s", t)}`]: n
} : {
[r]: {
...n,
...o
}
};
}
if (a && a !== "media")
return `${r}, ${a.replace("%s", String(t))}`;
} else if (t) {
if (a === "media")
return {
[`@media (prefers-color-scheme: ${String(t)})`]: {
[r]: n
}
};
if (a)
return a.replace("%s", String(t));
}
return r;
};
function rf(e, t) {
t.forEach((n) => {
e[n] || (e[n] = {});
});
}
function _(e, t, n) {
!e[t] && n && (e[t] = n);
}
function fr(e) {
return typeof e != "string" || !e.startsWith("hsl") ? e : hl(e);
}
function jt(e, t) {
`${t}Channel` in e || (e[`${t}Channel`] = dr(fr(e[t]), `MUI: Can't create \`palette.${t}Channel\` because \`palette.${t}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`));
}
function af(e) {
return typeof e == "number" ? `${e}px` : typeof e == "string" || typeof e == "function" || Array.isArray(e) ? e : "8px";
}
const Ft = (e) => {
try {
return e();
} catch {
}
}, of = (e = "mui") => Ed(e);
function Li(e, t, n, r) {
if (!t)
return;
t = t === !0 ? {} : t;
const i = r === "dark" ? "dark" : "light";
if (!n) {
e[r] = Jd({
...t,
palette: {
mode: i,
...t == null ? void 0 : t.palette
}
});
return;
}
const {
palette: a,
...o
} = fa({
...n,
palette: {
mode: i,
...t == null ? void 0 : t.palette
}
});
return e[r] = {
...t,
palette: a,
opacity: {
...xl(i),
...t == null ? void 0 : t.opacity
},
overlays: (t == null ? void 0 : t.overlays) || bl(i)
}, o;
}
function sf(e = {}, ...t) {
const {
colorSchemes: n = {
light: !0
},
defaultColorScheme: r,
disableCssColorScheme: i = !1,
cssVarPrefix: a = "mui",
shouldSkipGeneratingVar: o = ef,
colorSchemeSelector: s = n.light && n.dark ? "media" : void 0,
rootSelector: l = ":root",
...c
} = e, m = Object.keys(n)[0], h = r || (n.light && m !== "light" ? "light" : m), d = of(a), {
[h]: g,
light: x,
dark: f,
...E
} = n, y = {
...E
};
let T = g;
if ((h === "dark" && !("dark" in n) || h === "light" && !("light" in n)) && (T = !0), !T)
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The \`colorSchemes.${h}\` option is either missing or invalid.` : ln(21, h));
const k = Li(y, T, c, h);
x && !y.light && Li(y, x, void 0, "light"), f && !y.dark && Li(y, f, void 0, "dark");
let v = {
defaultColorScheme: h,
...k,
cssVarPrefix: a,
colorSchemeSelector: s,
rootSelector: l,
getCssVar: d,
colorSchemes: y,
font: {
...jd(k.typography),
...k.font
},
spacing: af(c.spacing)
};
Object.keys(v.colorSchemes).forEach((N) => {
const p = v.colorSchemes[N].palette, R = ($) => {
const Z = $.split("-"), j = Z[1], re = Z[2];
return d($, p[j][re]);
};
if (p.mode === "light" && (_(p.common, "background", "#fff"), _(p.common, "onBackground", "#000")), p.mode === "dark" && (_(p.common, "background", "#000"), _(p.common, "onBackground", "#fff")), rf(p, ["Alert", "AppBar", "Avatar", "Button", "Chip", "FilledInput", "LinearProgress", "Skeleton", "Slider", "SnackbarContent", "SpeedDialAction", "StepConnector", "StepContent", "Switch", "TableCell", "Tooltip"]), p.mode === "light") {
_(p.Alert, "errorColor", Fe(p.error.light, 0.6)), _(p.Alert, "infoColor", Fe(p.info.light, 0.6)), _(p.Alert, "successColor", Fe(p.success.light, 0.6)), _(p.Alert, "warningColor", Fe(p.warning.light, 0.6)), _(p.Alert, "errorFilledBg", R("palette-error-main")), _(p.Alert, "infoFilledBg", R("palette-info-main")), _(p.Alert, "successFilledBg", R("palette-success-main")), _(p.Alert, "warningFilledBg", R("palette-warning-main")), _(p.Alert, "errorFilledColor", Ft(() => p.getContrastText(p.error.main))), _(p.Alert, "infoFilledColor", Ft(() => p.getContrastText(p.info.main))), _(p.Alert, "successFilledColor", Ft(() => p.getContrastText(p.success.main))), _(p.Alert, "warningFilledColor", Ft(() => p.getContrastText(p.warning.main))), _(p.Alert, "errorStandardBg", Ae(p.error.light, 0.9)), _(p.Alert, "infoStandardBg", Ae(p.info.light, 0.9)), _(p.Alert, "successStandardBg", Ae(p.success.light, 0.9)), _(p.Alert, "warningStandardBg", Ae(p.warning.light, 0.9)), _(p.Alert, "errorIconColor", R("palette-error-main")), _(p.Alert, "infoIconColor", R("palette-info-main")), _(p.Alert, "successIconColor", R("palette-success-main")), _(p.Alert, "warningIconColor", R("palette-warning-main")), _(p.AppBar, "defaultBg", R("palette-grey-100")), _(p.Avatar, "defaultBg", R("palette-grey-400")), _(p.Button, "inheritContainedBg", R("palette-grey-300")), _(p.Button, "inheritContainedHoverBg", R("palette-grey-A100")), _(p.Chip, "defaultBorder", R("palette-grey-400")), _(p.Chip, "defaultAvatarColor", R("palette-grey-700")), _(p.Chip, "defaultIconColor", R("palette-grey-700")), _(p.FilledInput, "bg", "rgba(0, 0, 0, 0.06)"), _(p.FilledInput, "hoverBg", "rgba(0, 0, 0, 0.09)"), _(p.FilledInput, "disabledBg", "rgba(0, 0, 0, 0.12)"), _(p.LinearProgress, "primaryBg", Ae(p.primary.main, 0.62)), _(p.LinearProgress, "secondaryBg", Ae(p.secondary.main, 0.62)), _(p.LinearProgress, "errorBg", Ae(p.error.main, 0.62)), _(p.LinearProgress, "infoBg", Ae(p.info.main, 0.62)), _(p.LinearProgress, "successBg", Ae(p.success.main, 0.62)), _(p.LinearProgress, "warningBg", Ae(p.warning.main, 0.62)), _(p.Skeleton, "bg", `rgba(${R("palette-text-primaryChannel")} / 0.11)`), _(p.Slider, "primaryTrack", Ae(p.primary.main, 0.62)), _(p.Slider, "secondaryTrack", Ae(p.secondary.main, 0.62)), _(p.Slider, "errorTrack", Ae(p.error.main, 0.62)), _(p.Slider, "infoTrack", Ae(p.info.main, 0.62)), _(p.Slider, "successTrack", Ae(p.success.main, 0.62)), _(p.Slider, "warningTrack", Ae(p.warning.main, 0.62));
const $ = Nr(p.background.default, 0.8);
_(p.SnackbarContent, "bg", $), _(p.SnackbarContent, "color", Ft(() => p.getContrastText($))), _(p.SpeedDialAction, "fabHoverBg", Nr(p.background.paper, 0.15)), _(p.StepConnector, "border", R("palette-grey-400")), _(p.StepContent, "border", R("palette-grey-400")), _(p.Switch, "defaultColor", R("palette-common-white")), _(p.Switch, "defaultDisabledColor", R("palette-grey-100")), _(p.Switch, "primaryDisabledColor", Ae(p.primary.main, 0.62)), _(p.Switch, "secondaryDisabledColor", Ae(p.secondary.main, 0.62)), _(p.Switch, "errorDisabledColor", Ae(p.error.main, 0.62)), _(p.Switch, "infoDisabledColor", Ae(p.info.main, 0.62)), _(p.Switch, "successDisabledColor", Ae(p.success.main, 0.62)), _(p.Switch, "warningDisabledColor", Ae(p.warning.main, 0.62)), _(p.TableCell, "border", Ae(zr(p.divider, 1), 0.88)), _(p.Tooltip, "bg", zr(p.grey[700], 0.92));
}
if (p.mode === "dark") {
_(p.Alert, "errorColor", Ae(p.error.light, 0.6)), _(p.Alert, "infoColor", Ae(p.info.light, 0.6)), _(p.Alert, "successColor", Ae(p.success.light, 0.6)), _(p.Alert, "warningColor", Ae(p.warning.light, 0.6)), _(p.Alert, "errorFilledBg", R("palette-error-dark")), _(p.Alert, "infoFilledBg", R("palette-info-dark")), _(p.Alert, "successFilledBg", R("palette-success-dark")), _(p.Alert, "warningFilledBg", R("palette-warning-dark")), _(p.Alert, "errorFilledColor", Ft(() => p.getContrastText(p.error.dark))), _(p.Alert, "infoFilledColor", Ft(() => p.getContrastText(p.info.dark))), _(p.Alert, "successFilledColor", Ft(() => p.getContrastText(p.success.dark))), _(p.Alert, "warningFilledColor", Ft(() => p.getContrastText(p.warning.dark))), _(p.Alert, "errorStandardBg", Fe(p.error.light, 0.9)), _(p.Alert, "infoStandardBg", Fe(p.info.light, 0.9)), _(p.Alert, "successStandardBg", Fe(p.success.light, 0.9)), _(p.Alert, "warningStandardBg", Fe(p.warning.light, 0.9)), _(p.Alert, "errorIconColor", R("palette-error-main")), _(p.Alert, "infoIconColor", R("palette-info-main")), _(p.Alert, "successIconColor", R("palette-success-main")), _(p.Alert, "warningIconColor", R("palette-warning-main")), _(p.AppBar, "defaultBg", R("palette-grey-900")), _(p.AppBar, "darkBg", R("palette-background-paper")), _(p.AppBar, "darkColor", R("palette-text-primary")), _(p.Avatar, "defaultBg", R("palette-grey-600")), _(p.Button, "inheritContainedBg", R("palette-grey-800")), _(p.Button, "inheritContainedHoverBg", R("palette-grey-700")), _(p.Chip, "defaultBorder", R("palette-grey-700")), _(p.Chip, "defaultAvatarColor", R("palette-grey-300")), _(p.Chip, "defaultIconColor", R("palette-grey-300")), _(p.FilledInput, "bg", "rgba(255, 255, 255, 0.09)"), _(p.FilledInput, "hoverBg", "rgba(255, 255, 255, 0.13)"), _(p.FilledInput, "disabledBg", "rgba(255, 255, 255, 0.12)"), _(p.LinearProgress, "primaryBg", Fe(p.primary.main, 0.5)), _(p.LinearProgress, "secondaryBg", Fe(p.secondary.main, 0.5)), _(p.LinearProgress, "errorBg", Fe(p.error.main, 0.5)), _(p.LinearProgress, "infoBg", Fe(p.info.main, 0.5)), _(p.LinearProgress, "successBg", Fe(p.success.main, 0.5)), _(p.LinearProgress, "warningBg", Fe(p.warning.main, 0.5)), _(p.Skeleton, "bg", `rgba(${R("palette-text-primaryChannel")} / 0.13)`), _(p.Slider, "primaryTrack", Fe(p.primary.main, 0.5)), _(p.Slider, "secondaryTrack", Fe(p.secondary.main, 0.5)), _(p.Slider, "errorTrack", Fe(p.error.main, 0.5)), _(p.Slider, "infoTrack", Fe(p.info.main, 0.5)), _(p.Slider, "successTrack", Fe(p.success.main, 0.5)), _(p.Slider, "warningTrack", Fe(p.warning.main, 0.5));
const $ = Nr(p.background.default, 0.98);
_(p.SnackbarContent, "bg", $), _(p.SnackbarContent, "color", Ft(() => p.getContrastText($))), _(p.SpeedDialAction, "fabHoverBg", Nr(p.background.paper, 0.15)), _(p.StepConnector, "border", R("palette-grey-600")), _(p.StepContent, "border", R("palette-grey-600")), _(p.Switch, "defaultColor", R("palette-grey-300")), _(p.Switch, "defaultDisabledColor", R("palette-grey-600")), _(p.Switch, "primaryDisabledColor", Fe(p.primary.main, 0.55)), _(p.Switch, "secondaryDisabledColor", Fe(p.secondary.main, 0.55)), _(p.Switch, "errorDisabledColor", Fe(p.error.main, 0.55)), _(p.Switch, "infoDisabledColor", Fe(p.info.main, 0.55)), _(p.Switch, "successDisabledColor", Fe(p.success.main, 0.55)), _(p.Switch, "warningDisabledColor", Fe(p.warning.main, 0.55)), _(p.TableCell, "border", Fe(zr(p.divider, 1), 0.68)), _(p.Tooltip, "bg", zr(p.grey[700], 0.92));
}
jt(p.background, "default"), jt(p.background, "paper"), jt(p.common, "background"), jt(p.common, "onBackground"), jt(p, "divider"), Object.keys(p).forEach(($) => {
const Z = p[$];
$ !== "tonalOffset" && Z && typeof Z == "object" && (Z.main && _(p[$], "mainChannel", dr(fr(Z.main))), Z.light && _(p[$], "lightChannel", dr(fr(Z.light))), Z.dark && _(p[$], "darkChannel", dr(fr(Z.dark))), Z.contrastText && _(p[$], "contrastTextChannel", dr(fr(Z.contrastText))), $ === "text" && (jt(p[$], "primary"), jt(p[$], "secondary")), $ === "action" && (Z.active && jt(p[$], "active"), Z.selected && jt(p[$], "selected")));
});
}), v = t.reduce((N, p) => ft(N, p), v);
const w = {
prefix: a,
disableCssColorScheme: i,
shouldSkipGeneratingVar: o,
getSelector: nf(v)
}, {
vars: P,
generateThemeVars: M,
generateStyleSheets: I
} = Od(v, w);
return v.vars = P, Object.entries(v.colorSchemes[v.defaultColorScheme]).forEach(([N, p]) => {
v[N] = p;
}), v.generateThemeVars = M, v.generateStyleSheets = I, v.generateSpacing = function() {
return ul(c.spacing, ja(this));
}, v.getColorSchemeSelector = Fd(s), v.spacing = v.generateSpacing(), v.shouldSkipGeneratingVar = o, v.unstable_sxConfig = {
...$r,
...c == null ? void 0 : c.unstable_sxConfig
}, v.unstable_sx = function(p) {
return or({
sx: p,
theme: this
});
}, v.toRuntimeSource = vl, v;
}
function Ko(e, t, n) {
e.colorSchemes && n && (e.colorSchemes[t] = {
...n !== !0 && n,
palette: qa({
...n === !0 ? {} : n.palette,
mode: t
})
// cast type to skip module augmentation test
});
}
function wl(e = {}, ...t) {
const {
palette: n,
cssVariables: r = !1,
colorSchemes: i = n ? void 0 : {
light: !0
},
defaultColorScheme: a = n == null ? void 0 : n.mode,
...o
} = e, s = a || "light", l = i == null ? void 0 : i[s], c = {
...i,
...n ? {
[s]: {
...typeof l != "boolean" && l,
palette: n
}
} : void 0
};
if (r === !1) {
if (!("colorSchemes" in e))
return fa(e, ...t);
let m = n;
"palette" in e || c[s] && (c[s] !== !0 ? m = c[s].palette : s === "dark" && (m = {
mode: "dark"
}));
const h = fa({
...e,
palette: m
}, ...t);
return h.defaultColorScheme = s, h.colorSchemes = c, h.palette.mode === "light" && (h.colorSchemes.light = {
...c.light !== !0 && c.light,
palette: h.palette
}, Ko(h, "dark", c.dark)), h.palette.mode === "dark" && (h.colorSchemes.dark = {
...c.dark !== !0 && c.dark,
palette: h.palette
}, Ko(h, "light", c.light)), h;
}
return !n && !("light" in c) && s === "light" && (c.light = !0), sf({
...o,
colorSchemes: c,
defaultColorScheme: s,
...typeof r != "boolean" && r
}, ...t);
}
const Sl = wl(), Cl = "$$material";
function El() {
const e = nd(Sl);
return process.env.NODE_ENV !== "production" && te.useDebugValue(e), e[Cl] || e;
}
function lf(e) {
return e !== "ownerState" && e !== "theme" && e !== "sx" && e !== "as";
}
const cf = (e) => lf(e) && e !== "classes", gt = ud({
themeId: Cl,
defaultTheme: Sl,
rootShouldForwardProp: cf
});
function uf() {
return Np;
}
const Fn = Cd;
process.env.NODE_ENV !== "production" && (b.node, b.object.isRequired);
function $n(e) {
return Sd(e);
}
function pf(e) {
return typeof e.main == "string";
}
function df(e, t = []) {
if (!pf(e))
return !1;
for (const n of t)
if (!e.hasOwnProperty(n) || typeof e[n] != "string")
return !1;
return !0;
}
function ii(e = []) {
return ([, t]) => t && df(t, e);
}
function ff(e) {
return dn("MuiTypography", e);
}
An("MuiTypography", ["root", "h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2", "inherit", "button", "caption", "overline", "alignLeft", "alignRight", "alignCenter", "alignJustify", "noWrap", "gutterBottom", "paragraph"]);
const mf = {
primary: !0,
secondary: !0,
error: !0,
info: !0,
success: !0,
warning: !0,
textPrimary: !0,
textSecondary: !0,
textDisabled: !0
}, hf = uf(), gf = (e) => {
const {
align: t,
gutterBottom: n,
noWrap: r,
paragraph: i,
variant: a,
classes: o
} = e, s = {
root: ["root", a, e.align !== "inherit" && `align${Me(t)}`, n && "gutterBottom", r && "noWrap", i && "paragraph"]
};
return lr(s, ff, o);
}, yf = gt("span", {
name: "MuiTypography",
slot: "Root",
overridesResolver: (e, t) => {
const {
ownerState: n
} = e;
return [t.root, n.variant && t[n.variant], n.align !== "inherit" && t[`align${Me(n.align)}`], n.noWrap && t.noWrap, n.gutterBottom && t.gutterBottom, n.paragraph && t.paragraph];
}
})(Fn(({
theme: e
}) => {
var t;
return {
margin: 0,
variants: [{
props: {
variant: "inherit"
},
style: {
// Some elements, like <button> on Chrome have default font that doesn't inherit, reset this.
font: "inherit",
lineHeight: "inherit",
letterSpacing: "inherit"
}
}, ...Object.entries(e.typography).filter(([n, r]) => n !== "inherit" && r && typeof r == "object").map(([n, r]) => ({
props: {
variant: n
},
style: r
})), ...Object.entries(e.palette).filter(ii()).map(([n]) => ({
props: {
color: n
},
style: {
color: (e.vars || e).palette[n].main
}
})), ...Object.entries(((t = e.palette) == null ? void 0 : t.text) || {}).filter(([, n]) => typeof n == "string").map(([n]) => ({
props: {
color: `text${Me(n)}`
},
style: {
color: (e.vars || e).palette.text[n]
}
})), {
props: ({
ownerState: n
}) => n.align !== "inherit",
style: {
textAlign: "var(--Typography-textAlign)"
}
}, {
props: ({
ownerState: n
}) => n.noWrap,
style: {
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap"
}
}, {
props: ({
ownerState: n
}) => n.gutterBottom,
style: {
marginBottom: "0.35em"
}
}, {
props: ({
ownerState: n
}) => n.paragraph,
style: {
marginBottom: 16
}
}]
};
})), Qo = {
h1: "h1",
h2: "h2",
h3: "h3",
h4: "h4",
h5: "h5",
h6: "h6",
subtitle1: "h6",
subtitle2: "h6",
body1: "p",
body2: "p",
inherit: "p"
}, kl = /* @__PURE__ */ te.forwardRef(function(t, n) {
const {
color: r,
...i
} = $n({
props: t,
name: "MuiTypography"
}), a = !mf[r], o = hf({
...i,
...a && {
color: r
}
}), {
align: s = "inherit",
className: l,
component: c,
gutterBottom: m = !1,
noWrap: h = !1,
paragraph: d = !1,
variant: g = "body1",
variantMapping: x = Qo,
...f
} = o, E = {
...o,
align: s,
color: r,
className: l,
component: c,
gutterBottom: m,
noWrap: h,
paragraph: d,
variant: g,
variantMapping: x
}, y = c || (d ? "p" : x[g] || Qo[g]) || "span", T = gf(E);
return /* @__PURE__ */ u(yf, {
as: y,
ref: n,
className: Ze(T.root, l),
...f,
ownerState: E,
style: {
...s !== "inherit" && {
"--Typography-textAlign": s
},
...f.style
}
});
});
process.env.NODE_ENV !== "production" && (kl.propTypes = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
// │ These PropTypes are generated from the TypeScript type definitions. │
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* Set the text-align on the component.
* @default 'inherit'
*/
align: b.oneOf(["center", "inherit", "justify", "left", "right"]),
/**
* The content of the component.
*/
children: b.node,
/**
* Override or extend the styles applied to the component.
*/
classes: b.object,
/**
* @ignore
*/
className: b.string,
/**
* The color of the component.
* It supports both default and custom theme colors, which can be added as shown in the
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
*/
color: b.oneOfType([b.oneOf(["primary", "secondary", "success", "error", "info", "warning", "textPrimary", "textSecondary", "textDisabled"]), b.string]),
/**
* The component used for the root node.
* Either a string to use a HTML element or a component.
*/
component: b.elementType,
/**
* If `true`, the text will have a bottom margin.
* @default false
*/
gutterBottom: b.bool,
/**
* If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.
*
* Note that text overflow can only happen with block or inline-block level elements
* (the element needs to have a width in order to overflow).
* @default false
*/
noWrap: b.bool,
/**
* If `true`, the element will be a paragraph element.
* @default false
* @deprecated Use the `component` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
*/
paragraph: b.bool,
/**
* @ignore
*/
style: b.object,
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: b.oneOfType([b.arrayOf(b.oneOfType([b.func, b.object, b.bool])), b.func, b.object]),
/**
* Applies the theme typography styles.
* @default 'body1'
*/
variant: b.oneOfType([b.oneOf(["body1", "body2", "button", "caption", "h1", "h2", "h3", "h4", "h5", "h6", "inherit", "overline", "subtitle1", "subtitle2"]), b.string]),
/**
* The component maps the variant prop to a range of different HTML element types.
* For instance, subtitle1 to `<h6>`.
* If you wish to change that mapping, you can provide your own.
* Alternatively, you can use the `component` prop.
* @default {
* h1: 'h1',
* h2: 'h2',
* h3: 'h3',
* h4: 'h4',
* h5: 'h5',
* h6: 'h6',
* subtitle1: 'h6',
* subtitle2: 'h6',
* body1: 'p',
* body2: 'p',
* inherit: 'p',
* }
*/
variantMapping: b.object
});
const Wa = /* @__PURE__ */ te.createContext(void 0);
process.env.NODE_ENV !== "production" && (Wa.displayName = "FormControlContext");
function vf() {
return te.useContext(Wa);
}
function xf(e) {
return dn("MuiInputAdornment", e);
}
const Go = An("MuiInputAdornment", ["root", "filled", "standard", "outlined", "positionStart", "positionEnd", "disablePointerEvents", "hiddenLabel", "sizeSmall"]);
var Zo;
const bf = (e, t) => {
const {
ownerState: n
} = e;
return [t.root, t[`position${Me(n.position)}`], n.disablePointerEvents === !0 && t.disablePointerEvents, t[n.variant]];
}, wf = (e) => {
const {
classes: t,
disablePointerEvents: n,
hiddenLabel: r,
position: i,
size: a,
variant: o
} = e, s = {
root: ["root", n && "disablePointerEvents", i && `position${Me(i)}`, o, r && "hiddenLabel", a && `size${Me(a)}`]
};
return lr(s, xf, t);
}, Sf = gt("div", {
name: "MuiInputAdornment",
slot: "Root",
overridesResolver: bf
})(Fn(({
theme: e
}) => ({
display: "flex",
maxHeight: "2em",
alignItems: "center",
whiteSpace: "nowrap",
color: (e.vars || e).palette.action.active,
variants: [{
props: {
variant: "filled"
},
style: {
[`&.${Go.positionStart}&:not(.${Go.hiddenLabel})`]: {
marginTop: 16
}
}
}, {
props: {
position: "start"
},
style: {
marginRight: 8
}
}, {
props: {
position: "end"
},
style: {
marginLeft: 8
}
}, {
props: {
disablePointerEvents: !0
},
style: {
pointerEvents: "none"
}
}]
}))), Tl = /* @__PURE__ */ te.forwardRef(function(t, n) {
const r = $n({
props: t,
name: "MuiInputAdornment"
}), {
children: i,
className: a,
component: o = "div",
disablePointerEvents: s = !1,
disableTypography: l = !1,
position: c,
variant: m,
...h
} = r, d = vf() || {};
let g = m;
m && d.variant && process.env.NODE_ENV !== "production" && m === d.variant && console.error("MUI: The `InputAdornment` variant infers the variant prop you do not have to provide one."), d && !g && (g = d.variant);
const x = {
...r,
hiddenLabel: d.hiddenLabel,
size: d.size,
disablePointerEvents: s,
position: c,
variant: g
}, f = wf(x);
return /* @__PURE__ */ u(Wa.Provider, {
value: null,
children: /* @__PURE__ */ u(Sf, {
as: o,
ownerState: x,
className: Ze(f.root, a),
ref: n,
...h,
children: typeof i == "string" && !l ? /* @__PURE__ */ u(kl, {
color: "textSecondary",
children: i
}) : /* @__PURE__ */ U(te.Fragment, {
children: [c === "start" ? (
/* notranslate needed while Google Translate will not fix zero-width space issue */
Zo || (Zo = /* @__PURE__ */ u("span", {
className: "notranslate",
"aria-hidden": !0,
children: ""
}))
) : null, i]
})
})
});
});
process.env.NODE_ENV !== "production" && (Tl.propTypes = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
// │ These PropTypes are generated from the TypeScript type definitions. │
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* The content of the component, normally an `IconButton` or string.
*/
children: b.node,
/**
* Override or extend the styles applied to the component.
*/
classes: b.object,
/**
* @ignore
*/
className: b.string,
/**
* The component used for the root node.
* Either a string to use a HTML element or a component.
*/
component: b.elementType,
/**
* Disable pointer events on the root.
* This allows for the content of the adornment to focus the `input` on click.
* @default false
*/
disablePointerEvents: b.bool,
/**
* If children is a string then disable wrapping in a Typography component.
* @default false
*/
disableTypography: b.bool,
/**
* The position this adornment should appear relative to the `Input`.
*/
position: b.oneOf(["end", "start"]).isRequired,
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: b.oneOfType([b.arrayOf(b.oneOfType([b.func, b.object, b.bool])), b.func, b.object]),
/**
* The variant to use.
* Note: If you are using the `TextField` component or the `FormControl` component
* you do not have to set this manually.
*/
variant: b.oneOf(["filled", "outlined", "standard"])
});
function Ua(e, t) {
return process.env.NODE_ENV === "production" ? () => null : function(...r) {
return e(...r) || t(...r);
};
}
function Cf(e) {
return dn("MuiSvgIcon", e);
}
An("MuiSvgIcon", ["root", "colorPrimary", "colorSecondary", "colorAction", "colorError", "colorDisabled", "fontSizeInherit", "fontSizeSmall", "fontSizeMedium", "fontSizeLarge"]);
const Ef = (e) => {
const {
color: t,
fontSize: n,
classes: r
} = e, i = {
root: ["root", t !== "inherit" && `color${Me(t)}`, `fontSize${Me(n)}`]
};
return lr(i, Cf, r);
}, kf = gt("svg", {
name: "MuiSvgIcon",
slot: "Root",
overridesResolver: (e, t) => {
const {
ownerState: n
} = e;
return [t.root, n.color !== "inherit" && t[`color${Me(n.color)}`], t[`fontSize${Me(n.fontSize)}`]];
}
})(Fn(({
theme: e
}) => {
var t, n, r, i, a, o, s, l, c, m, h, d, g, x;
return {
userSelect: "none",
width: "1em",
height: "1em",
display: "inline-block",
flexShrink: 0,
transition: (i = (t = e.transitions) == null ? void 0 : t.create) == null ? void 0 : i.call(t, "fill", {
duration: (r = (n = (e.vars ?? e).transitions) == null ? void 0 : n.duration) == null ? void 0 : r.shorter
}),
variants: [
{
props: (f) => !f.hasSvgAsChild,
style: {
// the <svg> will define the property that has `currentColor`
// for example heroicons uses fill="none" and stroke="currentColor"
fill: "currentColor"
}
},
{
props: {
fontSize: "inherit"
},
style: {
fontSize: "inherit"
}
},
{
props: {
fontSize: "small"
},
style: {
fontSize: ((o = (a = e.typography) == null ? void 0 : a.pxToRem) == null ? void 0 : o.call(a, 20)) || "1.25rem"
}
},
{
props: {
fontSize: "medium"
},
style: {
fontSize: ((l = (s = e.typography) == null ? void 0 : s.pxToRem) == null ? void 0 : l.call(s, 24)) || "1.5rem"
}
},
{
props: {
fontSize: "large"
},
style: {
fontSize: ((m = (c = e.typography) == null ? void 0 : c.pxToRem) == null ? void 0 : m.call(c, 35)) || "2.1875rem"
}
},
// TODO v5 deprecate color prop, v6 remove for sx
...Object.entries((e.vars ?? e).palette).filter(([, f]) => f && f.main).map(([f]) => {
var E, y;
return {
props: {
color: f
},
style: {
color: (y = (E = (e.vars ?? e).palette) == null ? void 0 : E[f]) == null ? void 0 : y.main
}
};
}),
{
props: {
color: "action"
},
style: {
color: (d = (h = (e.vars ?? e).palette) == null ? void 0 : h.action) == null ? void 0 : d.active
}
},
{
props: {
color: "disabled"
},
style: {
color: (x = (g = (e.vars ?? e).palette) == null ? void 0 : g.action) == null ? void 0 : x.disabled
}
},
{
props: {
color: "inherit"
},
style: {
color: void 0
}
}
]
};
})), ai = /* @__PURE__ */ te.forwardRef(function(t, n) {
const r = $n({
props: t,
name: "MuiSvgIcon"
}), {
children: i,
className: a,
color: o = "inherit",
component: s = "svg",
fontSize: l = "medium",
htmlColor: c,
inheritViewBox: m = !1,
titleAccess: h,
viewBox: d = "0 0 24 24",
...g
} = r, x = /* @__PURE__ */ te.isValidElement(i) && i.type === "svg", f = {
...r,
color: o,
component: s,
fontSize: l,
instanceFontSize: t.fontSize,
inheritViewBox: m,
viewBox: d,
hasSvgAsChild: x
}, E = {};
m || (E.viewBox = d);
const y = Ef(f);
return /* @__PURE__ */ U(kf, {
as: s,
className: Ze(y.root, a),
focusable: "false",
color: c,
"aria-hidden": h ? void 0 : !0,
role: h ? "img" : void 0,
ref: n,
...E,
...g,
...x && i.props,
ownerState: f,
children: [x ? i.props.children : i, h ? /* @__PURE__ */ u("title", {
children: h
}) : null]
});
});
process.env.NODE_ENV !== "production" && (ai.propTypes = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
// │ These PropTypes are generated from the TypeScript type definitions. │
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* Node passed into the SVG element.
*/
children: b.node,
/**
* Override or extend the styles applied to the component.
*/
classes: b.object,
/**
* @ignore
*/
className: b.string,
/**
* The color of the component.
* It supports both default and custom theme colors, which can be added as shown in the
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
* You can use the `htmlColor` prop to apply a color attribute to the SVG element.
* @default 'inherit'
*/
color: b.oneOfType([b.oneOf(["inherit", "action", "disabled", "primary", "secondary", "error", "info", "success", "warning"]), b.string]),
/**
* The component used for the root node.
* Either a string to use a HTML element or a component.
*/
component: b.elementType,
/**
* The fontSize applied to the icon. Defaults to 24px, but can be configure to inherit font size.
* @default 'medium'
*/
fontSize: b.oneOfType([b.oneOf(["inherit", "large", "medium", "small"]), b.string]),
/**
* Applies a color attribute to the SVG element.
*/
htmlColor: b.string,
/**
* If `true`, the root node will inherit the custom `component`'s viewBox and the `viewBox`
* prop will be ignored.
* Useful when you want to reference a custom `component` and have `SvgIcon` pass that
* `component`'s viewBox to the root node.
* @default false
*/
inheritViewBox: b.bool,
/**
* The shape-rendering attribute. The behavior of the different options is described on the
* [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/shape-rendering).
* If you are having issues with blurry icons you should investigate this prop.
*/
shapeRendering: b.string,
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: b.oneOfType([b.arrayOf(b.oneOfType([b.func, b.object, b.bool])), b.func, b.object]),
/**
* Provides a human-readable title for the element that contains it.
* https://www.w3.org/TR/SVG-access/#Equivalent
*/
titleAccess: b.string,
/**
* Allows you to redefine what the coordinates without units mean inside an SVG element.
* For example, if the SVG element is 500 (width) by 200 (height),
* and you pass viewBox="0 0 50 20",
* this means that the coordinates inside the SVG will go from the top left corner (0,0)
* to bottom right (50,20) and each unit will be worth 10px.
* @default '0 0 24 24'
*/
viewBox: b.string
});
ai.muiName = "SvgIcon";
function Xe(e, t) {
function n(r, i) {
return /* @__PURE__ */ u(ai, {
"data-testid": process.env.NODE_ENV !== "production" ? `${t}Icon` : void 0,
ref: i,
...r,
children: e
});
}
return process.env.NODE_ENV !== "production" && (n.displayName = `${t}Icon`), n.muiName = ai.muiName, /* @__PURE__ */ te.memo(/* @__PURE__ */ te.forwardRef(n));
}
let Xo = 0;
function Tf(e) {
const [t, n] = te.useState(e), r = e || t;
return te.useEffect(() => {
t == null && (Xo += 1, n(`mui-${Xo}`));
}, [t]), r;
}
const Of = {
...te
}, Jo = Of.useId;
function Ff(e) {
if (Jo !== void 0) {
const t = Jo();
return e ?? t;
}
return Tf(e);
}
function Kr(e) {
const t = te.useRef(e);
return hd(() => {
t.current = e;
}), te.useRef((...n) => (
// @ts-expect-error hide `this`
(0, t.current)(...n)
)).current;
}
function es(...e) {
const t = te.useRef(void 0), n = te.useCallback((r) => {
const i = e.map((a) => {
if (a == null)
return null;
if (typeof a == "function") {
const o = a, s = o(r);
return typeof s == "function" ? s : () => {
o(null);
};
}
return a.current = r, () => {
a.current = null;
};
});
return () => {
i.forEach((a) => a == null ? void 0 : a());
};
}, e);
return te.useMemo(() => e.every((r) => r == null) ? null : (r) => {
t.current && (t.current(), t.current = void 0), r != null && (t.current = n(r));
}, e);
}
const Af = b.oneOfType([b.func, b.object]);
function $f(e) {
const {
prototype: t = {}
} = e;
return !!t.isReactComponent;
}
function Rf(e, t, n, r, i) {
const a = e[t], o = i || t;
if (a == null || // When server-side rendering React doesn't warn either.
// This is not an accurate check for SSR.
// This is only in place for emotion compat.
// TODO: Revisit once https://github.com/facebook/react/issues/20047 is resolved.
typeof window > "u")
return null;
let s;
return typeof a == "function" && !$f(a) && (s = "Did you accidentally provide a plain function component instead?"), s !== void 0 ? new Error(`Invalid ${r} \`${o}\` supplied to \`${n}\`. Expected an element type that can hold a ref. ${s} For more information see https://mui.com/r/caveat-with-refs-guide`) : null;
}
const Pf = Ua(b.elementType, Rf);
function ts(e) {
try {
return e.matches(":focus-visible");
} catch {
process.env.NODE_ENV !== "production" && !/jsdom/.test(window.navigator.userAgent) && console.warn(["MUI: The `:focus-visible` pseudo class is not supported in this browser.", "Some components rely on this feature to work properly."].join(`
`));
}
return !1;
}
const ns = {};
function Ol(e, t) {
const n = te.useRef(ns);
return n.current === ns && (n.current = e(t)), n;
}
class oi {
constructor() {
cr(this, "mountEffect", () => {
this.shouldMount && !this.didMount && this.ref.current !== null && (this.didMount = !0, this.mounted.resolve());
});
this.ref = {
current: null
}, this.mounted = null, this.didMount = !1, this.shouldMount = !1, this.setShouldMount = null;
}
/** React ref to the ripple instance */
/** If the ripple component should be mounted */
/** Promise that resolves when the ripple component is mounted */
/** If the ripple component has been mounted */
/** React state hook setter */
static create() {
return new oi();
}
static use() {
const t = Ol(oi.create).current, [n, r] = te.useState(!1);
return t.shouldMount = n, t.setShouldMount = r, te.useEffect(t.mountEffect, [n]), t;
}
mount() {
return this.mounted || (this.mounted = Df(), this.shouldMount = !0, this.setShouldMount(this.shouldMount)), this.mounted;
}
/* Ripple API */
start(...t) {
this.mount().then(() => {
var n;
return (n = this.ref.current) == null ? void 0 : n.start(...t);
});
}
stop(...t) {
this.mount().then(() => {
var n;
return (n = this.ref.current) == null ? void 0 : n.stop(...t);
});
}
pulsate(...t) {
this.mount().then(() => {
var n;
return (n = this.ref.current) == null ? void 0 : n.pulsate(...t);
});
}
}
function _f() {
return oi.use();
}
function Df() {
let e, t;
const n = new Promise((r, i) => {
e = r, t = i;
});
return n.resolve = e, n.reject = t, n;
}
function ma() {
return ma = Object.assign ? Object.assign.bind() : function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
}
return e;
}, ma.apply(null, arguments);
}
function If(e, t) {
if (e == null) return {};
var n = {};
for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
if (t.indexOf(r) !== -1) continue;
n[r] = e[r];
}
return n;
}
function ha(e, t) {
return ha = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
return n.__proto__ = r, n;
}, ha(e, t);
}
function Mf(e, t) {
e.prototype = Object.create(t.prototype), e.prototype.constructor = e, ha(e, t);
}
const rs = We.createContext(null);
function jf(e) {
if (e === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e;
}
function Ha(e, t) {
var n = function(a) {
return t && Wr(a) ? t(a) : a;
}, r = /* @__PURE__ */ Object.create(null);
return e && mc.map(e, function(i) {
return i;
}).forEach(function(i) {
r[i.key] = n(i);
}), r;
}
function zf(e, t) {
e = e || {}, t = t || {};
function n(m) {
return m in t ? t[m] : e[m];
}
var r = /* @__PURE__ */ Object.create(null), i = [];
for (var a in e)
a in t ? i.length && (r[a] = i, i = []) : i.push(a);
var o, s = {};
for (var l in t) {
if (r[l])
for (o = 0; o < r[l].length; o++) {
var c = r[l][o];
s[r[l][o]] = n(c);
}
s[l] = n(l);
}
for (o = 0; o < i.length; o++)
s[i[o]] = n(i[o]);
return s;
}
function gn(e, t, n) {
return n[t] != null ? n[t] : e.props[t];
}
function Nf(e, t) {
return Ha(e.children, function(n) {
return Ur(n, {
onExited: t.bind(null, n),
in: !0,
appear: gn(n, "appear", e),
enter: gn(n, "enter", e),
exit: gn(n, "exit", e)
});
});
}
function Lf(e, t, n) {
var r = Ha(e.children), i = zf(t, r);
return Object.keys(i).forEach(function(a) {
var o = i[a];
if (Wr(o)) {
var s = a in t, l = a in r, c = t[a], m = Wr(c) && !c.props.in;
l && (!s || m) ? i[a] = Ur(o, {
onExited: n.bind(null, o),
in: !0,
exit: gn(o, "exit", e),
enter: gn(o, "enter", e)
}) : !l && s && !m ? i[a] = Ur(o, {
in: !1
}) : l && s && Wr(c) && (i[a] = Ur(o, {
onExited: n.bind(null, o),
in: c.props.in,
exit: gn(o, "exit", e),
enter: gn(o, "enter", e)
}));
}
}), i;
}
var Bf = Object.values || function(e) {
return Object.keys(e).map(function(t) {
return e[t];
});
}, Vf = {
component: "div",
childFactory: function(t) {
return t;
}
}, Ya = /* @__PURE__ */ function(e) {
Mf(t, e);
function t(r, i) {
var a;
a = e.call(this, r, i) || this;
var o = a.handleExited.bind(jf(a));
return a.state = {
contextValue: {
isMounting: !0
},
handleExited: o,
firstRender: !0
}, a;
}
var n = t.prototype;
return n.componentDidMount = function() {
this.mounted = !0, this.setState({
contextValue: {
isMounting: !1
}
});
}, n.componentWillUnmount = function() {
this.mounted = !1;
}, t.getDerivedStateFromProps = function(i, a) {
var o = a.children, s = a.handleExited, l = a.firstRender;
return {
children: l ? Nf(i, s) : Lf(i, o, s),
firstRender: !1
};
}, n.handleExited = function(i, a) {
var o = Ha(this.props.children);
i.key in o || (i.props.onExited && i.props.onExited(a), this.mounted && this.setState(function(s) {
var l = ma({}, s.children);
return delete l[i.key], {
children: l
};
}));
}, n.render = function() {
var i = this.props, a = i.component, o = i.childFactory, s = If(i, ["component", "childFactory"]), l = this.state.contextValue, c = Bf(this.state.children).map(o);
return delete s.appear, delete s.enter, delete s.exit, a === null ? /* @__PURE__ */ We.createElement(rs.Provider, {
value: l
}, c) : /* @__PURE__ */ We.createElement(rs.Provider, {
value: l
}, /* @__PURE__ */ We.createElement(a, s, c));
}, t;
}(We.Component);
Ya.propTypes = process.env.NODE_ENV !== "production" ? {
/**
* `<TransitionGroup>` renders a `<div>` by default. You can change this
* behavior by providing a `component` prop.
* If you use React v16+ and would like to avoid a wrapping `<div>` element
* you can pass in `component={null}`. This is useful if the wrapping div
* borks your css styles.
*/
component: b.any,
/**
* A set of `<Transition>` components, that are toggled `in` and out as they
* leave. the `<TransitionGroup>` will inject specific transition props, so
* remember to spread them through if you are wrapping the `<Transition>` as
* with our `<Fade>` example.
*
* While this component is meant for multiple `Transition` or `CSSTransition`
* children, sometimes you may want to have a single transition child with
* content that you want to be transitioned out and in when you change it
* (e.g. routes, images etc.) In that case you can change the `key` prop of
* the transition child as you change its content, this will cause
* `TransitionGroup` to transition the child out and back in.
*/
children: b.node,
/**
* A convenience prop that enables or disables appear animations
* for all children. Note that specifying this will override any defaults set
* on individual children Transitions.
*/
appear: b.bool,
/**
* A convenience prop that enables or disables enter animations
* for all children. Note that specifying this will override any defaults set
* on individual children Transitions.
*/
enter: b.bool,
/**
* A convenience prop that enables or disables exit animations
* for all children. Note that specifying this will override any defaults set
* on individual children Transitions.
*/
exit: b.bool,
/**
* You may need to apply reactive updates to a child as it is exiting.
* This is generally done by using `cloneElement` however in the case of an exiting
* child the element has already been removed and not accessible to the consumer.
*
* If you do need to update a child as it leaves you can provide a `childFactory`
* to wrap every child, even the ones that are leaving.
*
* @type Function(child: ReactElement) -> ReactElement
*/
childFactory: b.func
} : {};
Ya.defaultProps = Vf;
const qf = [];
function Wf(e) {
te.useEffect(e, qf);
}
class Ka {
constructor() {
cr(this, "currentId", null);
cr(this, "clear", () => {
this.currentId !== null && (clearTimeout(this.currentId), this.currentId = null);
});
cr(this, "disposeEffect", () => this.clear);
}
static create() {
return new Ka();
}
/**
* Executes `fn` after `delay`, clearing any previously scheduled call.
*/
start(t, n) {
this.clear(), this.currentId = setTimeout(() => {
this.currentId = null, n();
}, t);
}
}
function Uf() {
const e = Ol(Ka.create).current;
return Wf(e.disposeEffect), e;
}
function Fl(e) {
const {
className: t,
classes: n,
pulsate: r = !1,
rippleX: i,
rippleY: a,
rippleSize: o,
in: s,
onExited: l,
timeout: c
} = e, [m, h] = te.useState(!1), d = Ze(t, n.ripple, n.rippleVisible, r && n.ripplePulsate), g = {
width: o,
height: o,
top: -(o / 2) + a,
left: -(o / 2) + i
}, x = Ze(n.child, m && n.childLeaving, r && n.childPulsate);
return !s && !m && h(!0), te.useEffect(() => {
if (!s && l != null) {
const f = setTimeout(l, c);
return () => {
clearTimeout(f);
};
}
}, [l, s, c]), /* @__PURE__ */ u("span", {
className: d,
style: g,
children: /* @__PURE__ */ u("span", {
className: x
})
});
}
process.env.NODE_ENV !== "production" && (Fl.propTypes = {
/**
* Override or extend the styles applied to the component.
*/
classes: b.object.isRequired,
className: b.string,
/**
* @ignore - injected from TransitionGroup
*/
in: b.bool,
/**
* @ignore - injected from TransitionGroup
*/
onExited: b.func,
/**
* If `true`, the ripple pulsates, typically indicating the keyboard focus state of an element.
*/
pulsate: b.bool,
/**
* Diameter of the ripple.
*/
rippleSize: b.number,
/**
* Horizontal position of the ripple center.
*/
rippleX: b.number,
/**
* Vertical position of the ripple center.
*/
rippleY: b.number,
/**
* exit delay
*/
timeout: b.number.isRequired
});
const wt = An("MuiTouchRipple", ["root", "ripple", "rippleVisible", "ripplePulsate", "child", "childLeaving", "childPulsate"]), ga = 550, Hf = 80, Yf = Tr`
0% {
transform: scale(0);
opacity: 0.1;
}
100% {
transform: scale(1);
opacity: 0.3;
}
`, Kf = Tr`
0% {
opacity: 1;
}
100% {
opacity: 0;
}
`, Qf = Tr`
0% {
transform: scale(1);
}
50% {
transform: scale(0.92);
}
100% {
transform: scale(1);
}
`, Gf = gt("span", {
name: "MuiTouchRipple",
slot: "Root"
})({
overflow: "hidden",
pointerEvents: "none",
position: "absolute",
zIndex: 0,
top: 0,
right: 0,
bottom: 0,
left: 0,
borderRadius: "inherit"
}), Zf = gt(Fl, {
name: "MuiTouchRipple",
slot: "Ripple"
})`
opacity: 0;
position: absolute;
&.${wt.rippleVisible} {
opacity: 0.3;
transform: scale(1);
animation-name: ${Yf};
animation-duration: ${ga}ms;
animation-timing-function: ${({
theme: e
}) => e.transitions.easing.easeInOut};
}
&.${wt.ripplePulsate} {
animation-duration: ${({
theme: e
}) => e.transitions.duration.shorter}ms;
}
& .${wt.child} {
opacity: 1;
display: block;
width: 100%;
height: 100%;
border-radius: 50%;
background-color: currentColor;
}
& .${wt.childLeaving} {
opacity: 0;
animation-name: ${Kf};
animation-duration: ${ga}ms;
animation-timing-function: ${({
theme: e
}) => e.transitions.easing.easeInOut};
}
& .${wt.childPulsate} {
position: absolute;
/* @noflip */
left: 0px;
top: 0;
animation-name: ${Qf};
animation-duration: 2500ms;
animation-timing-function: ${({
theme: e
}) => e.transitions.easing.easeInOut};
animation-iteration-count: infinite;
animation-delay: 200ms;
}
`, Al = /* @__PURE__ */ te.forwardRef(function(t, n) {
const r = $n({
props: t,
name: "MuiTouchRipple"
}), {
center: i = !1,
classes: a = {},
className: o,
...s
} = r, [l, c] = te.useState([]), m = te.useRef(0), h = te.useRef(null);
te.useEffect(() => {
h.current && (h.current(), h.current = null);
}, [l]);
const d = te.useRef(!1), g = Uf(), x = te.useRef(null), f = te.useRef(null), E = te.useCallback((v) => {
const {
pulsate: w,
rippleX: P,
rippleY: M,
rippleSize: I,
cb: N
} = v;
c((p) => [...p, /* @__PURE__ */ u(Zf, {
classes: {
ripple: Ze(a.ripple, wt.ripple),
rippleVisible: Ze(a.rippleVisible, wt.rippleVisible),
ripplePulsate: Ze(a.ripplePulsate, wt.ripplePulsate),
child: Ze(a.child, wt.child),
childLeaving: Ze(a.childLeaving, wt.childLeaving),
childPulsate: Ze(a.childPulsate, wt.childPulsate)
},
timeout: ga,
pulsate: w,
rippleX: P,
rippleY: M,
rippleSize: I
}, m.current)]), m.current += 1, h.current = N;
}, [a]), y = te.useCallback((v = {}, w = {}, P = () => {
}) => {
const {
pulsate: M = !1,
center: I = i || w.pulsate,
fakeElement: N = !1
// For test purposes
} = w;
if ((v == null ? void 0 : v.type) === "mousedown" && d.current) {
d.current = !1;
return;
}
(v == null ? void 0 : v.type) === "touchstart" && (d.current = !0);
const p = N ? null : f.current, R = p ? p.getBoundingClientRect() : {
width: 0,
height: 0,
left: 0,
top: 0
};
let $, Z, j;
if (I || v === void 0 || v.clientX === 0 && v.clientY === 0 || !v.clientX && !v.touches)
$ = Math.round(R.width / 2), Z = Math.round(R.height / 2);
else {
const {
clientX: re,
clientY: L
} = v.touches && v.touches.length > 0 ? v.touches[0] : v;
$ = Math.round(re - R.left), Z = Math.round(L - R.top);
}
if (I)
j = Math.sqrt((2 * R.width ** 2 + R.height ** 2) / 3), j % 2 === 0 && (j += 1);
else {
const re = Math.max(Math.abs((p ? p.clientWidth : 0) - $), $) * 2 + 2, L = Math.max(Math.abs((p ? p.clientHeight : 0) - Z), Z) * 2 + 2;
j = Math.sqrt(re ** 2 + L ** 2);
}
v != null && v.touches ? x.current === null && (x.current = () => {
E({
pulsate: M,
rippleX: $,
rippleY: Z,
rippleSize: j,
cb: P
});
}, g.start(Hf, () => {
x.current && (x.current(), x.current = null);
})) : E({
pulsate: M,
rippleX: $,
rippleY: Z,
rippleSize: j,
cb: P
});
}, [i, E, g]), T = te.useCallback(() => {
y({}, {
pulsate: !0
});
}, [y]), k = te.useCallback((v, w) => {
if (g.clear(), (v == null ? void 0 : v.type) === "touchend" && x.current) {
x.current(), x.current = null, g.start(0, () => {
k(v, w);
});
return;
}
x.current = null, c((P) => P.length > 0 ? P.slice(1) : P), h.current = w;
}, [g]);
return te.useImperativeHandle(n, () => ({
pulsate: T,
start: y,
stop: k
}), [T, y, k]), /* @__PURE__ */ u(Gf, {
className: Ze(wt.root, a.root, o),
ref: f,
...s,
children: /* @__PURE__ */ u(Ya, {
component: null,
exit: !0,
children: l
})
});
});
process.env.NODE_ENV !== "production" && (Al.propTypes = {
/**
* If `true`, the ripple starts at the center of the component
* rather than at the point of interaction.
*/
center: b.bool,
/**
* Override or extend the styles applied to the component.
*/
classes: b.object,
/**
* @ignore
*/
className: b.string
});
function Xf(e) {
return dn("MuiButtonBase", e);
}
const Jf = An("MuiButtonBase", ["root", "disabled", "focusVisible"]), em = (e) => {
const {
disabled: t,
focusVisible: n,
focusVisibleClassName: r,
classes: i
} = e, o = lr({
root: ["root", t && "disabled", n && "focusVisible"]
}, Xf, i);
return n && r && (o.root += ` ${r}`), o;
}, tm = gt("button", {
name: "MuiButtonBase",
slot: "Root"
})({
display: "inline-flex",
alignItems: "center",
justifyContent: "center",
position: "relative",
boxSizing: "border-box",
WebkitTapHighlightColor: "transparent",
backgroundColor: "transparent",
// Reset default value
// We disable the focus ring for mouse, touch and keyboard users.
outline: 0,
border: 0,
margin: 0,
// Remove the margin in Safari
borderRadius: 0,
padding: 0,
// Remove the padding in Firefox
cursor: "pointer",
userSelect: "none",
verticalAlign: "middle",
MozAppearance: "none",
// Reset
WebkitAppearance: "none",
// Reset
textDecoration: "none",
// So we take precedent over the style of a native <a /> element.
color: "inherit",
"&::-moz-focus-inner": {
borderStyle: "none"
// Remove Firefox dotted outline.
},
[`&.${Jf.disabled}`]: {
pointerEvents: "none",
// Disable link interactions
cursor: "default"
},
"@media print": {
colorAdjust: "exact"
}
}), $l = /* @__PURE__ */ te.forwardRef(function(t, n) {
const r = $n({
props: t,
name: "MuiButtonBase"
}), {
action: i,
centerRipple: a = !1,
children: o,
className: s,
component: l = "button",
disabled: c = !1,
disableRipple: m = !1,
disableTouchRipple: h = !1,
focusRipple: d = !1,
focusVisibleClassName: g,
LinkComponent: x = "a",
onBlur: f,
onClick: E,
onContextMenu: y,
onDragLeave: T,
onFocus: k,
onFocusVisible: v,
onKeyDown: w,
onKeyUp: P,
onMouseDown: M,
onMouseLeave: I,
onMouseUp: N,
onTouchEnd: p,
onTouchMove: R,
onTouchStart: $,
tabIndex: Z = 0,
TouchRippleProps: j,
touchRippleRef: re,
type: L,
...Q
} = r, V = te.useRef(null), K = _f(), S = es(K.ref, re), [D, ne] = te.useState(!1);
c && D && ne(!1), te.useImperativeHandle(i, () => ({
focusVisible: () => {
ne(!0), V.current.focus();
}
}), []);
const le = K.shouldMount && !m && !c;
te.useEffect(() => {
D && d && !m && K.pulsate();
}, [m, d, D, K]);
const ae = zt(K, "start", M, h), de = zt(K, "stop", y, h), H = zt(K, "stop", T, h), ie = zt(K, "stop", N, h), fe = zt(K, "stop", (ce) => {
D && ce.preventDefault(), I && I(ce);
}, h), ge = zt(K, "start", $, h), B = zt(K, "stop", p, h), G = zt(K, "stop", R, h), z = zt(K, "stop", (ce) => {
ts(ce.target) || ne(!1), f && f(ce);
}, !1), ye = Kr((ce) => {
V.current || (V.current = ce.currentTarget), ts(ce.target) && (ne(!0), v && v(ce)), k && k(ce);
}), Oe = () => {
const ce = V.current;
return l && l !== "button" && !(ce.tagName === "A" && ce.href);
}, Ye = Kr((ce) => {
d && !ce.repeat && D && ce.key === " " && K.stop(ce, () => {
K.start(ce);
}), ce.target === ce.currentTarget && Oe() && ce.key === " " && ce.preventDefault(), w && w(ce), ce.target === ce.currentTarget && Oe() && ce.key === "Enter" && !c && (ce.preventDefault(), E && E(ce));
}), It = Kr((ce) => {
d && ce.key === " " && D && !ce.defaultPrevented && K.stop(ce, () => {
K.pulsate(ce);
}), P && P(ce), E && ce.target === ce.currentTarget && Oe() && ce.key === " " && !ce.defaultPrevented && E(ce);
});
let qe = l;
qe === "button" && (Q.href || Q.to) && (qe = x);
const Je = {};
qe === "button" ? (Je.type = L === void 0 ? "button" : L, Je.disabled = c) : (!Q.href && !Q.to && (Je.role = "button"), c && (Je["aria-disabled"] = c));
const Et = es(n, V), lt = {
...r,
centerRipple: a,
component: l,
disabled: c,
disableRipple: m,
disableTouchRipple: h,
focusRipple: d,
tabIndex: Z,
focusVisible: D
}, Mt = em(lt);
return /* @__PURE__ */ U(tm, {
as: qe,
className: Ze(Mt.root, s),
ownerState: lt,
onBlur: z,
onClick: E,
onContextMenu: de,
onFocus: ye,
onKeyDown: Ye,
onKeyUp: It,
onMouseDown: ae,
onMouseLeave: fe,
onMouseUp: ie,
onDragLeave: H,
onTouchEnd: B,
onTouchMove: G,
onTouchStart: ge,
ref: Et,
tabIndex: c ? -1 : Z,
type: L,
...Je,
...Q,
children: [o, le ? /* @__PURE__ */ u(Al, {
ref: S,
center: a,
...j
}) : null]
});
});
function zt(e, t, n, r = !1) {
return Kr((i) => (n && n(i), r || e[t](i), !0));
}
process.env.NODE_ENV !== "production" && ($l.propTypes = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
// │ These PropTypes are generated from the TypeScript type definitions. │
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* A ref for imperative actions.
* It currently only supports `focusVisible()` action.
*/
action: Af,
/**
* If `true`, the ripples are centered.
* They won't start at the cursor interaction position.
* @default false
*/
centerRipple: b.bool,
/**
* The content of the component.
*/
children: b.node,
/**
* Override or extend the styles applied to the component.
*/
classes: b.object,
/**
* @ignore
*/
className: b.string,
/**
* The component used for the root node.
* Either a string to use a HTML element or a component.
*/
component: Pf,
/**
* If `true`, the component is disabled.
* @default false
*/
disabled: b.bool,
/**
* If `true`, the ripple effect is disabled.
*
* ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
* to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
* @default false
*/
disableRipple: b.bool,
/**
* If `true`, the touch ripple effect is disabled.
* @default false
*/
disableTouchRipple: b.bool,
/**
* If `true`, the base button will have a keyboard focus ripple.
* @default false
*/
focusRipple: b.bool,
/**
* This prop can help identify which element has keyboard focus.
* The class name will be applied when the element gains the focus through keyboard interaction.
* It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
* The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
* A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
* if needed.
*/
focusVisibleClassName: b.string,
/**
* @ignore
*/
href: b.any,
/**
* The component used to render a link when the `href` prop is provided.
* @default 'a'
*/
LinkComponent: b.elementType,
/**
* @ignore
*/
onBlur: b.func,
/**
* @ignore
*/
onClick: b.func,
/**
* @ignore
*/
onContextMenu: b.func,
/**
* @ignore
*/
onDragLeave: b.func,
/**
* @ignore
*/
onFocus: b.func,
/**
* Callback fired when the component is focused with a keyboard.
* We trigger a `onFocus` callback too.
*/
onFocusVisible: b.func,
/**
* @ignore
*/
onKeyDown: b.func,
/**
* @ignore
*/
onKeyUp: b.func,
/**
* @ignore
*/
onMouseDown: b.func,
/**
* @ignore
*/
onMouseLeave: b.func,
/**
* @ignore
*/
onMouseUp: b.func,
/**
* @ignore
*/
onTouchEnd: b.func,
/**
* @ignore
*/
onTouchMove: b.func,
/**
* @ignore
*/
onTouchStart: b.func,
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: b.oneOfType([b.arrayOf(b.oneOfType([b.func, b.object, b.bool])), b.func, b.object]),
/**
* @default 0
*/
tabIndex: b.number,
/**
* Props applied to the `TouchRipple` element.
*/
TouchRippleProps: b.object,
/**
* A ref that points to the `TouchRipple` element.
*/
touchRippleRef: b.oneOfType([b.func, b.shape({
current: b.shape({
pulsate: b.func.isRequired,
start: b.func.isRequired,
stop: b.func.isRequired
})
})]),
/**
* @ignore
*/
type: b.oneOfType([b.oneOf(["button", "reset", "submit"]), b.string])
});
function nm(e) {
return dn("MuiCircularProgress", e);
}
An("MuiCircularProgress", ["root", "determinate", "indeterminate", "colorPrimary", "colorSecondary", "svg", "circle", "circleDeterminate", "circleIndeterminate", "circleDisableShrink"]);
const Wt = 44, ya = Tr`
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
`, va = Tr`
0% {
stroke-dasharray: 1px, 200px;
stroke-dashoffset: 0;
}
50% {
stroke-dasharray: 100px, 200px;
stroke-dashoffset: -15px;
}
100% {
stroke-dasharray: 1px, 200px;
stroke-dashoffset: -126px;
}
`, rm = typeof ya != "string" ? Ys`
animation: ${ya} 1.4s linear infinite;
` : null, im = typeof va != "string" ? Ys`
animation: ${va} 1.4s ease-in-out infinite;
` : null, am = (e) => {
const {
classes: t,
variant: n,
color: r,
disableShrink: i
} = e, a = {
root: ["root", n, `color${Me(r)}`],
svg: ["svg"],
circle: ["circle", `circle${Me(n)}`, i && "circleDisableShrink"]
};
return lr(a, nm, t);
}, om = gt("span", {
name: "MuiCircularProgress",
slot: "Root",
overridesResolver: (e, t) => {
const {
ownerState: n
} = e;
return [t.root, t[n.variant], t[`color${Me(n.color)}`]];
}
})(Fn(({
theme: e
}) => ({
display: "inline-block",
variants: [{
props: {
variant: "determinate"
},
style: {
transition: e.transitions.create("transform")
}
}, {
props: {
variant: "indeterminate"
},
style: rm || {
animation: `${ya} 1.4s linear infinite`
}
}, ...Object.entries(e.palette).filter(ii()).map(([t]) => ({
props: {
color: t
},
style: {
color: (e.vars || e).palette[t].main
}
}))]
}))), sm = gt("svg", {
name: "MuiCircularProgress",
slot: "Svg"
})({
display: "block"
// Keeps the progress centered
}), lm = gt("circle", {
name: "MuiCircularProgress",
slot: "Circle",
overridesResolver: (e, t) => {
const {
ownerState: n
} = e;
return [t.circle, t[`circle${Me(n.variant)}`], n.disableShrink && t.circleDisableShrink];
}
})(Fn(({
theme: e
}) => ({
stroke: "currentColor",
variants: [{
props: {
variant: "determinate"
},
style: {
transition: e.transitions.create("stroke-dashoffset")
}
}, {
props: {
variant: "indeterminate"
},
style: {
// Some default value that looks fine waiting for the animation to kicks in.
strokeDasharray: "80px, 200px",
strokeDashoffset: 0
// Add the unit to fix a Edge 16 and below bug.
}
}, {
props: ({
ownerState: t
}) => t.variant === "indeterminate" && !t.disableShrink,
style: im || {
// At runtime for Pigment CSS, `bufferAnimation` will be null and the generated keyframe will be used.
animation: `${va} 1.4s ease-in-out infinite`
}
}]
}))), Rl = /* @__PURE__ */ te.forwardRef(function(t, n) {
const r = $n({
props: t,
name: "MuiCircularProgress"
}), {
className: i,
color: a = "primary",
disableShrink: o = !1,
size: s = 40,
style: l,
thickness: c = 3.6,
value: m = 0,
variant: h = "indeterminate",
...d
} = r, g = {
...r,
color: a,
disableShrink: o,
size: s,
thickness: c,
value: m,
variant: h
}, x = am(g), f = {}, E = {}, y = {};
if (h === "determinate") {
const T = 2 * Math.PI * ((Wt - c) / 2);
f.strokeDasharray = T.toFixed(3), y["aria-valuenow"] = Math.round(m), f.strokeDashoffset = `${((100 - m) / 100 * T).toFixed(3)}px`, E.transform = "rotate(-90deg)";
}
return /* @__PURE__ */ u(om, {
className: Ze(x.root, i),
style: {
width: s,
height: s,
...E,
...l
},
ownerState: g,
ref: n,
role: "progressbar",
...y,
...d,
children: /* @__PURE__ */ u(sm, {
className: x.svg,
ownerState: g,
viewBox: `${Wt / 2} ${Wt / 2} ${Wt} ${Wt}`,
children: /* @__PURE__ */ u(lm, {
className: x.circle,
style: f,
ownerState: g,
cx: Wt,
cy: Wt,
r: (Wt - c) / 2,
fill: "none",
strokeWidth: c
})
})
});
});
process.env.NODE_ENV !== "production" && (Rl.propTypes = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
// │ These PropTypes are generated from the TypeScript type definitions. │
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* Override or extend the styles applied to the component.
*/
classes: b.object,
/**
* @ignore
*/
className: b.string,
/**
* The color of the component.
* It supports both default and custom theme colors, which can be added as shown in the
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
* @default 'primary'
*/
color: b.oneOfType([b.oneOf(["inherit", "primary", "secondary", "error", "info", "success", "warning"]), b.string]),
/**
* If `true`, the shrink animation is disabled.
* This only works if variant is `indeterminate`.
* @default false
*/
disableShrink: Ua(b.bool, (e) => e.disableShrink && e.variant && e.variant !== "indeterminate" ? new Error("MUI: You have provided the `disableShrink` prop with a variant other than `indeterminate`. This will have no effect.") : null),
/**
* The size of the component.
* If using a number, the pixel unit is assumed.
* If using a string, you need to provide the CSS unit, for example '3rem'.
* @default 40
*/
size: b.oneOfType([b.number, b.string]),
/**
* @ignore
*/
style: b.object,
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: b.oneOfType([b.arrayOf(b.oneOfType([b.func, b.object, b.bool])), b.func, b.object]),
/**
* The thickness of the circle.
* @default 3.6
*/
thickness: b.number,
/**
* The value of the progress indicator for the determinate variant.
* Value between 0 and 100.
* @default 0
*/
value: b.number,
/**
* The variant to use.
* Use indeterminate when there is no progress value.
* @default 'indeterminate'
*/
variant: b.oneOf(["determinate", "indeterminate"])
});
function cm(e) {
return dn("MuiIconButton", e);
}
const is = An("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary", "colorSecondary", "colorError", "colorInfo", "colorSuccess", "colorWarning", "edgeStart", "edgeEnd", "sizeSmall", "sizeMedium", "sizeLarge", "loading", "loadingIndicator", "loadingWrapper"]), um = (e) => {
const {
classes: t,
disabled: n,
color: r,
edge: i,
size: a,
loading: o
} = e, s = {
root: ["root", o && "loading", n && "disabled", r !== "default" && `color${Me(r)}`, i && `edge${Me(i)}`, `size${Me(a)}`],
loadingIndicator: ["loadingIndicator"],
loadingWrapper: ["loadingWrapper"]
};
return lr(s, cm, t);
}, pm = gt($l, {
name: "MuiIconButton",
slot: "Root",
overridesResolver: (e, t) => {
const {
ownerState: n
} = e;
return [t.root, n.loading && t.loading, n.color !== "default" && t[`color${Me(n.color)}`], n.edge && t[`edge${Me(n.edge)}`], t[`size${Me(n.size)}`]];
}
})(Fn(({
theme: e
}) => ({
textAlign: "center",
flex: "0 0 auto",
fontSize: e.typography.pxToRem(24),
padding: 8,
borderRadius: "50%",
color: (e.vars || e).palette.action.active,
transition: e.transitions.create("background-color", {
duration: e.transitions.duration.shortest
}),
variants: [{
props: (t) => !t.disableRipple,
style: {
"--IconButton-hoverBg": e.vars ? `rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})` : mt(e.palette.action.active, e.palette.action.hoverOpacity),
"&:hover": {
backgroundColor: "var(--IconButton-hoverBg)",
// Reset on touch devices, it doesn't add specificity
"@media (hover: none)": {
backgroundColor: "transparent"
}
}
}
}, {
props: {
edge: "start"
},
style: {
marginLeft: -12
}
}, {
props: {
edge: "start",
size: "small"
},
style: {
marginLeft: -3
}
}, {
props: {
edge: "end"
},
style: {
marginRight: -12
}
}, {
props: {
edge: "end",
size: "small"
},
style: {
marginRight: -3
}
}]
})), Fn(({
theme: e
}) => ({
variants: [{
props: {
color: "inherit"
},
style: {
color: "inherit"
}
}, ...Object.entries(e.palette).filter(ii()).map(([t]) => ({
props: {
color: t
},
style: {
color: (e.vars || e).palette[t].main
}
})), ...Object.entries(e.palette).filter(ii()).map(([t]) => ({
props: {
color: t
},
style: {
"--IconButton-hoverBg": e.vars ? `rgba(${(e.vars || e).palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})` : mt((e.vars || e).palette[t].main, e.palette.action.hoverOpacity)
}
})), {
props: {
size: "small"
},
style: {
padding: 5,
fontSize: e.typography.pxToRem(18)
}
}, {
props: {
size: "large"
},
style: {
padding: 12,
fontSize: e.typography.pxToRem(28)
}
}],
[`&.${is.disabled}`]: {
backgroundColor: "transparent",
color: (e.vars || e).palette.action.disabled
},
[`&.${is.loading}`]: {
color: "transparent"
}
}))), dm = gt("span", {
name: "MuiIconButton",
slot: "LoadingIndicator"
})(({
theme: e
}) => ({
display: "none",
position: "absolute",
visibility: "visible",
top: "50%",
left: "50%",
transform: "translate(-50%, -50%)",
color: (e.vars || e).palette.action.disabled,
variants: [{
props: {
loading: !0
},
style: {
display: "flex"
}
}]
})), Qr = /* @__PURE__ */ te.forwardRef(function(t, n) {
const r = $n({
props: t,
name: "MuiIconButton"
}), {
edge: i = !1,
children: a,
className: o,
color: s = "default",
disabled: l = !1,
disableFocusRipple: c = !1,
size: m = "medium",
id: h,
loading: d = null,
loadingIndicator: g,
...x
} = r, f = Ff(h), E = g ?? /* @__PURE__ */ u(Rl, {
"aria-labelledby": f,
color: "inherit",
size: 16
}), y = {
...r,
edge: i,
color: s,
disabled: l,
disableFocusRipple: c,
loading: d,
loadingIndicator: E,
size: m
}, T = um(y);
return /* @__PURE__ */ U(pm, {
id: d ? f : h,
className: Ze(T.root, o),
centerRipple: !0,
focusRipple: !c,
disabled: l || d,
ref: n,
...x,
ownerState: y,
children: [typeof d == "boolean" && // use plain HTML span to minimize the runtime overhead
/* @__PURE__ */ u("span", {
className: T.loadingWrapper,
style: {
display: "contents"
},
children: /* @__PURE__ */ u(dm, {
className: T.loadingIndicator,
ownerState: y,
children: d && E
})
}), a]
});
});
process.env.NODE_ENV !== "production" && (Qr.propTypes = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
// │ These PropTypes are generated from the TypeScript type definitions. │
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* The icon to display.
*/
children: Ua(b.node, (e) => te.Children.toArray(e.children).some((n) => /* @__PURE__ */ te.isValidElement(n) && n.props.onClick) ? new Error(["MUI: You are providing an onClick event listener to a child of a button element.", "Prefer applying it to the IconButton directly.", "This guarantees that the whole <button> will be responsive to click events."].join(`
`)) : null),
/**
* Override or extend the styles applied to the component.
*/
classes: b.object,
/**
* @ignore
*/
className: b.string,
/**
* The color of the component.
* It supports both default and custom theme colors, which can be added as shown in the
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
* @default 'default'
*/
color: b.oneOfType([b.oneOf(["inherit", "default", "primary", "secondary", "error", "info", "success", "warning"]), b.string]),
/**
* If `true`, the component is disabled.
* @default false
*/
disabled: b.bool,
/**
* If `true`, the keyboard focus ripple is disabled.
* @default false
*/
disableFocusRipple: b.bool,
/**
* If `true`, the ripple effect is disabled.
*
* ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
* to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
* @default false
*/
disableRipple: b.bool,
/**
* If given, uses a negative margin to counteract the padding on one
* side (this is often helpful for aligning the left or right
* side of the icon with content above or below, without ruining the border
* size and shape).
* @default false
*/
edge: b.oneOf(["end", "start", !1]),
/**
* @ignore
*/
id: b.string,
/**
* If `true`, the loading indicator is visible and the button is disabled.
* If `true | false`, the loading wrapper is always rendered before the children to prevent [Google Translation Crash](https://github.com/mui/material-ui/issues/27853).
* @default null
*/
loading: b.bool,
/**
* Element placed before the children if the button is in loading state.
* The node should contain an element with `role="progressbar"` with an accessible name.
* By default, it renders a `CircularProgress` that is labeled by the button itself.
* @default <CircularProgress color="inherit" size={16} />
*/
loadingIndicator: b.node,
/**
* The size of the component.
* `small` is equivalent to the dense button styling.
* @default 'medium'
*/
size: b.oneOfType([b.oneOf(["small", "medium", "large"]), b.string]),
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: b.oneOfType([b.arrayOf(b.oneOfType([b.func, b.object, b.bool])), b.func, b.object])
});
const as = Xe(/* @__PURE__ */ u("path", {
d: "M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"
}), "Visibility"), os = Xe(/* @__PURE__ */ u("path", {
d: "M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"
}), "VisibilityOff"), fm = Xe(/* @__PURE__ */ u("path", {
d: "M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"
}), "ContentCopy"), Qa = Xe(/* @__PURE__ */ u("path", {
d: "M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"
}), "Check"), si = Xe(/* @__PURE__ */ u("path", {
d: "M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3zM7 9l1.41 1.41L11 7.83V16h2V7.83l2.59 2.58L17 9l-5-5z"
}), "FileUploadOutlined"), mm = Xe(/* @__PURE__ */ u("path", {
d: "M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-4.86 8.86-3 3.87L9 13.14 6 17h12z"
}), "ImageOutlined"), he = {
// Core brand tokens (placeholder values – align with Figma 5814:23450)
primary: {
main: "#2C5EFF",
contrastText: "#FFFFFF"
},
secondary: {
main: "#00B894",
contrastText: "#FFFFFF"
},
error: { main: "#E53935" },
warning: { main: "#FB8C00" },
info: { main: "#1E88E5" },
success: { main: "#43A047" },
// Surfaces
background: {
default: "#FFFFFF",
paper: "#FFFFFF"
},
text: {
primary: "#111827",
secondary: "#6B7280",
disabled: "#9CA3AF"
},
divider: "#E5E7EB"
}, ss = (e) => {
const t = e.replace("#", ""), n = parseInt(t.length === 3 ? t.split("").map((r) => r + r).join("") : t, 16);
return { r: n >> 16 & 255, g: n >> 8 & 255, b: n & 255 };
}, hm = (e, t, n) => "#" + [e, t, n].map((r) => {
const i = Math.round(Math.min(255, Math.max(0, r))).toString(16);
return i.length === 1 ? "0" + i : i;
}).join(""), Nt = (e, t, n) => {
const r = ss(e), i = ss(t);
return hm(r.r + (i.r - r.r) * n, r.g + (i.g - r.g) * n, r.b + (i.b - r.b) * n);
}, Fi = (e) => {
const t = "#FFFFFF", n = "#000000";
return {
50: Nt(t, e, 0.08),
100: Nt(t, e, 0.16),
200: Nt(t, e, 0.28),
300: Nt(t, e, 0.4),
400: Nt(t, e, 0.55),
500: e,
600: Nt(e, n, 0.1),
700: Nt(e, n, 0.2),
800: Nt(e, n, 0.3),
900: Nt(e, n, 0.42)
};
}, Ig = Fi(he.primary.main), Mg = Fi(he.secondary.main), Bi = Fi(he.text.primary), gm = (e) => Fi(e), jg = {
primary: he.primary.main,
secondary: he.secondary.main,
textPrimary: he.text.primary,
textSecondary: he.text.secondary,
divider: he.divider,
background: he.background
}, ym = "#111827";
function vm(e) {
const t = e.palette.text.primary;
return typeof t == "string" ? t : ym;
}
function Rr() {
const e = El(), t = e.palette.mode, n = vm(e), r = e.palette.background.paper, i = e.palette.divider, a = e.palette.text.secondary, o = e.palette.error.main;
return Ie(() => {
const s = gm(n);
return {
paper: r,
divider: i,
textPrimary: n,
textSecondary: a,
errorMain: o,
neutral50: s[50],
outlineDefault: mt(s[300], 0.5),
outlineHover: s[300],
outlineFocus: s[400]
};
}, [t, n, r, i, a, o]);
}
const xm = "#244061";
function zg() {
return wl({
palette: {
mode: "light",
primary: {
main: xm,
light: "#0a8a4f",
dark: "#0d9c5a"
},
success: { main: "#10B981" },
warning: { main: "#F59E0B" },
error: { main: "#D40824" },
info: { main: "#3B82F6" },
text: {
primary: "#1A1A1A",
secondary: "rgba(0, 0, 0, 0.6)"
},
background: {
default: "#fafafa",
paper: "#ffffff"
},
divider: "#e2e8f0"
},
typography: {
fontFamily: '"Inter", sans-serif',
h1: {
fontSize: "24px",
fontWeight: 700,
lineHeight: 1.3,
letterSpacing: "-0.01em"
},
h2: {
fontSize: "20px",
fontWeight: 600,
lineHeight: 1.35,
letterSpacing: "-0.005em"
},
h3: { fontSize: "18px", fontWeight: 600, lineHeight: 1.4 },
h4: {
fontSize: "18px",
fontWeight: 600,
lineHeight: 1.35,
letterSpacing: "-0.005em"
},
h5: { fontSize: "15px", fontWeight: 500, lineHeight: 1.4 },
h6: { fontSize: "13px", fontWeight: 500, lineHeight: 1.5 },
body1: {
fontSize: "14px",
fontWeight: 400,
lineHeight: 1.6,
letterSpacing: "0.01em"
},
body2: {
fontSize: "13px",
fontWeight: 400,
lineHeight: 1.6,
letterSpacing: "0.01em"
},
subtitle1: { fontSize: "14px", fontWeight: 500, lineHeight: 1.5 },
subtitle2: { fontSize: "13px", fontWeight: 500, lineHeight: 1.5 },
caption: {
fontSize: "12px",
fontWeight: 400,
lineHeight: 1.5,
letterSpacing: "0.02em"
},
overline: {
fontSize: "11px",
fontWeight: 500,
lineHeight: 1.5,
letterSpacing: "0.08em",
textTransform: "uppercase"
},
button: {
fontSize: "14px",
fontWeight: 500,
lineHeight: 1.2,
letterSpacing: "0.01em"
},
allVariants: {
fontFamily: '"Inter", sans-serif'
}
},
shape: { borderRadius: 6 },
spacing: 8
});
}
const xt = ({
hasError: e,
sx: t,
labelText: n,
labelVariant: r = "subtitle2",
endAdornment: i,
endorsementText: a,
endorsementBg: o = "#E6E8EC",
endorsementColor: s = "#111827",
endorsementRadius: l = "6px",
endorsementHeight: c = 28,
endorsementPaddingX: m = "8px",
inputTestId: h,
labelTestId: d,
errorTestId: g,
...x
}) => {
var k, v;
const f = Rr(), E = !!n, y = a ? /* @__PURE__ */ u(
q,
{
component: "span",
sx: {
display: "inline-flex",
flex: "0 0 auto",
width: "auto",
maxWidth: "100%",
alignItems: "center",
height: c,
paddingLeft: m,
paddingRight: m,
borderRadius: l,
backgroundColor: o,
color: s,
fontSize: 12,
fontWeight: 300,
lineHeight: 1,
whiteSpace: "nowrap"
},
children: a
}
) : null, T = {
...x.InputProps,
endAdornment: y || i ? /* @__PURE__ */ U(Ns, { sx: { mr: -1 }, position: "end", children: [
y || i,
(k = x.InputProps) == null ? void 0 : k.endAdornment
] }) : (v = x.InputProps) == null ? void 0 : v.endAdornment
};
return /* @__PURE__ */ U(q, { children: [
E && /* @__PURE__ */ u(
se,
{
variant: r,
"data-testid": d,
sx: {
color: f.textPrimary,
mb: 0.5,
fontWeight: 500
},
children: n
}
),
/* @__PURE__ */ u(
hi,
{
fullWidth: !0,
size: "small",
...x,
InputProps: T,
label: E ? void 0 : x.label,
inputProps: {
...x.inputProps,
...h ? { "data-testid": h } : {}
},
FormHelperTextProps: {
...x.FormHelperTextProps,
...g ? { "data-testid": g } : {}
},
InputLabelProps: {
...x.InputLabelProps,
...d && !E ? { "data-testid": d } : {}
},
sx: {
"& .MuiOutlinedInput-root": {
backgroundColor: f.paper,
borderRadius: "8px",
"& fieldset": { borderColor: f.outlineDefault },
"&:hover fieldset": { borderColor: f.outlineHover },
"&.Mui-focused fieldset": { borderColor: f.outlineFocus },
"&.Mui-error fieldset": { borderColor: f.errorMain }
},
"& .MuiInputBase-input": {
color: f.textPrimary
},
// override default blue label when no custom labelText
"& .MuiFormLabel-root": {
color: f.textSecondary
},
"& .MuiFormLabel-root.Mui-focused": {
color: f.textPrimary
},
"& .MuiFormHelperText-root": {
color: e ? f.errorMain : f.textSecondary
},
...t
}
}
)
] });
}, bm = Xe(/* @__PURE__ */ u("path", {
d: "M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"
}), "KeyboardArrowDown");
function un(e) {
return String(e ?? "").replace(/\D+/g, "");
}
function Yt(e) {
return un(e).replace(/^0+/, "") || un(e);
}
function wm(e) {
const t = String(e ?? "");
if (!t)
return { leadingDigits: "", xCount: 0, totalLen: 0 };
const n = t.match(/^[0-9]+/), r = n ? n[0] : "", i = (t.match(/X/gi) || []).length, a = r.length + i;
return { leadingDigits: r, xCount: i, totalLen: a };
}
function Vi(e, t = {}) {
let n = un(e);
if (!n) return "";
const r = Yt(t.dialCode);
r && n.startsWith(r) && n.length > r.length && (n = n.slice(r.length));
const { leadingDigits: i, xCount: a, totalLen: o } = wm(t.storeFormat);
if (i && !n.startsWith(i) && (a > 0 && n.length === a || o > 0 && n.length === o - i.length ? n = i + n : o === 0 && i === "0" && !n.startsWith("0") && (n = "0" + n)), o > 0 && n.length > o && (n = n.slice(-o), i && !n.startsWith(i) && a > 0)) {
const s = n.slice(-a);
n = i + s;
}
return n;
}
function Sm(e, t = {}) {
var a, o;
const n = (o = (a = t.dialCodes) == null ? void 0 : a[0]) == null ? void 0 : o.dial_code, r = Yt(t.dialCode) || Yt(n) || "", i = un(e);
return { dialCode: r, national: i };
}
function Ng(e, t = {}) {
const n = String(e ?? "");
if (!n)
return { valid: !0 };
if (t.pattern && !(typeof t.pattern == "string" ? new RegExp(t.pattern) : t.pattern).test(n))
return {
valid: !1,
message: t.message || "Invalid mobile number"
};
if (t.prefixes && t.prefixes.length > 0) {
const r = un(n);
if (!t.prefixes.some((a) => {
const o = un(a);
return o.length > 0 && r.startsWith(o);
}))
return {
valid: !1,
message: t.message || "Invalid mobile number prefix"
};
}
return { valid: !0 };
}
const Cm = ({
id: e,
value: t,
onChange: n,
onBlur: r,
labelText: i,
label: a,
labelVariant: o = "subtitle2",
placeholder: s = "Enter phone number",
disabled: l,
hasError: c,
helperText: m,
dialCodes: h = [],
defaultDialCode: d,
storeFormat: g,
phoneExamples: x,
name: f,
inputTestId: E,
labelTestId: y,
errorTestId: T
}) => {
const k = Rr(), v = !!i, w = Ie(() => {
if (Array.isArray(h) && h.length > 0)
return h.map((K) => ({
dial_code: Yt(K.dial_code),
label: K.label,
iso: K.iso
})).filter((K) => K.dial_code);
const V = Yt(d);
return V ? [{ dial_code: V }] : [];
}, [h, d]), [P, M] = at(
() => {
var V;
return Yt(d) || ((V = w[0]) == null ? void 0 : V.dial_code) || "";
}
), [I, N] = at("");
ot(() => {
var K;
const V = Yt(d) || ((K = w[0]) == null ? void 0 : K.dial_code) || "";
V && V !== P && M(V);
}, [d, w]), ot(() => {
const V = Sm(t, {
dialCode: P,
dialCodes: w
});
N(
(K) => K === V.national ? K : V.national || ""
);
}, [t, P, w]);
const p = we(
(V, K) => {
n && n(
Vi(V, {
dialCode: K,
storeFormat: g
})
);
},
[n, g]
), R = we(
(V) => {
const K = String(V).trim().startsWith("+"), S = un(V);
if (K || P && S.startsWith(P) && S.length > P.length + 3) {
const D = Vi(V, {
dialCode: P,
storeFormat: g
});
N(D), n == null || n(D);
return;
}
N(S), p(S, P);
},
[P, g, n, p]
), $ = we(() => {
const V = Vi(I, {
dialCode: P,
storeFormat: g
});
V !== I && N(V), n && V !== un(t) && n(V), r == null || r();
}, [I, P, g, n, r, t]), Z = we(
(V) => {
const K = Yt(V);
M(K), p(I, K);
},
[I, p]
), j = !m && (x != null && x.length) ? `e.g. ${x[0]}` : void 0, re = m || j, L = !l && w.length > 0, Q = /* @__PURE__ */ U(Ns, { position: "start", sx: { mr: 0, ml: 0.5 }, children: [
/* @__PURE__ */ u(
Ls,
{
value: P || "",
onChange: (V) => Z(String(V.target.value)),
disabled: !L,
variant: "standard",
disableUnderline: !0,
IconComponent: bm,
displayEmpty: !0,
renderValue: (V) => V ? `+${V}` : "+—",
inputProps: {
"aria-label": "Country dial code",
...E ? { "data-testid": `${E}.dial` } : {}
},
sx: {
minWidth: 72,
fontSize: 14,
color: k.textPrimary,
"& .MuiSelect-select": {
py: 0.5,
pr: "20px !important",
pl: 0.5
},
"& .MuiSelect-icon": {
color: k.textSecondary,
right: 0
}
},
MenuProps: {
PaperProps: {
sx: {
maxHeight: 280,
borderRadius: "8px"
}
}
},
children: w.map((V) => {
const K = V.label || V.iso ? `${V.label || V.iso} (+${V.dial_code})` : `+${V.dial_code}`;
return /* @__PURE__ */ u(Gi, { value: V.dial_code, dense: !0, children: K }, V.dial_code);
})
}
),
/* @__PURE__ */ u(
gi,
{
orientation: "vertical",
flexItem: !0,
sx: {
mx: 1,
borderColor: k.outlineHover,
alignSelf: "center",
height: 20
}
}
)
] });
return /* @__PURE__ */ U(q, { children: [
v && /* @__PURE__ */ u(
se,
{
variant: o,
"data-testid": y,
sx: {
color: k.textPrimary,
mb: 0.5,
fontWeight: 500
},
children: i
}
),
/* @__PURE__ */ u(
hi,
{
id: e,
name: f,
fullWidth: !0,
size: "small",
type: "tel",
value: I,
onChange: (V) => R(V.target.value),
onBlur: $,
placeholder: s,
disabled: l,
error: !!c,
helperText: re,
label: v ? void 0 : a,
inputProps: {
inputMode: "tel",
...E ? { "data-testid": E } : {}
},
FormHelperTextProps: T ? { "data-testid": T } : void 0,
InputProps: {
startAdornment: Q
},
sx: {
"& .MuiOutlinedInput-root": {
backgroundColor: l ? k.neutral50 : k.paper,
borderRadius: "8px",
"& fieldset": { borderColor: k.outlineDefault },
"&:hover fieldset": { borderColor: k.outlineHover },
"&.Mui-focused fieldset": { borderColor: k.outlineFocus },
"&.Mui-error fieldset": { borderColor: k.errorMain }
},
"& .MuiInputBase-input": {
color: k.textPrimary
},
"& .MuiFormLabel-root": {
color: k.textSecondary
},
"& .MuiFormLabel-root.Mui-focused": {
color: k.textPrimary
},
"& .MuiFormHelperText-root": {
color: c ? k.errorMain : k.textSecondary
}
}
}
)
] });
}, Ga = ({
labelText: e,
label: t,
options: n,
loading: r,
helperText: i,
size: a = "small",
labelVariant: o = "subtitle2",
placeholder: s,
value: l,
sx: c,
inputTestId: m,
labelTestId: h,
errorTestId: d,
optionTestId: g,
...x
}) => {
const f = Rr(), E = We.useId(), y = l == null || l === "" || Array.isArray(l) && l.length === 0, T = (k) => /* @__PURE__ */ u(
"svg",
{
width: "16",
height: "16",
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
...k,
children: /* @__PURE__ */ u(
"path",
{
d: "M6 9l6 6 6-6",
stroke: f.textSecondary,
strokeWidth: "1.5",
strokeLinecap: "round",
strokeLinejoin: "round"
}
)
}
);
return /* @__PURE__ */ U(Aa, { fullWidth: !0, size: a, error: !!x.error, variant: "outlined", children: [
e && /* @__PURE__ */ u(
se,
{
variant: o,
"data-testid": h,
sx: {
color: f.textPrimary,
mb: 0.5,
fontWeight: 500
},
children: e
}
),
t && /* @__PURE__ */ u(
Tc,
{
id: E,
shrink: !y || !!s,
"data-testid": h,
sx: {
color: f.textSecondary,
"&.Mui-focused": {
color: f.textPrimary
},
"&.Mui-error": {
color: f.errorMain
}
},
children: t
}
),
/* @__PURE__ */ u(
Ls,
{
...x,
value: l,
labelId: t ? E : void 0,
label: t,
displayEmpty: !0,
input: /* @__PURE__ */ u(Oc, { label: t, inputProps: m ? { "data-testid": m } : void 0 }),
IconComponent: T,
renderValue: (k) => {
const v = k;
if (y)
return /* @__PURE__ */ u("span", { style: { color: f.textSecondary }, children: s ?? "" });
const w = n.find((P) => P.value === v);
return (w == null ? void 0 : w.label) ?? String(v);
},
endAdornment: r ? /* @__PURE__ */ u(ar, { size: 20 }) : void 0,
MenuProps: {
PaperProps: {
sx: {
boxShadow: "0px 0px 10px 0px rgba(0, 0, 0, 0.1)",
border: `1px solid ${f.divider}`,
mt: 0.5,
borderRadius: "8px"
}
}
},
sx: {
backgroundColor: f.paper,
boxShadow: "none",
borderRadius: "8px",
height: "40px",
"& .MuiSelect-select": {
color: f.textPrimary,
fontSize: 14,
pr: 3
},
"& .MuiOutlinedInput-notchedOutline": {
borderColor: f.outlineDefault
},
"&:hover .MuiOutlinedInput-notchedOutline": {
borderColor: f.outlineHover
},
"&.Mui-focused .MuiOutlinedInput-notchedOutline": {
borderColor: f.outlineFocus
},
"&.Mui-error .MuiOutlinedInput-notchedOutline": {
borderColor: f.errorMain
},
"& svg": {
right: 8,
position: "absolute",
pointerEvents: "none"
},
...c
},
children: r ? /* @__PURE__ */ u(Gi, { disabled: !0, children: /* @__PURE__ */ u(ar, { size: 16 }) }) : n.map((k) => /* @__PURE__ */ u(
Gi,
{
value: k.value,
"data-testid": g ? g(k.value) : void 0,
sx: {
backgroundColor: f.paper,
color: f.textPrimary,
fontSize: 14,
mx: 1,
"&:hover": {
backgroundColor: f.neutral50,
borderRadius: "4px"
},
"&.Mui-selected": {
backgroundColor: f.neutral50,
borderRadius: "4px"
}
},
children: k.label
},
k.value
))
}
),
i && /* @__PURE__ */ u($a, { "data-testid": d, children: i })
] });
}, Em = ({
id: e,
options: t,
value: n,
multiple: r,
label: i,
labelText: a,
placeholder: o,
onChange: s,
labelVariant: l = "subtitle2",
disabled: c,
loading: m,
error: h,
helperText: d,
onOpen: g,
noOptionsText: x,
sx: f,
inputTestId: E,
labelTestId: y,
errorTestId: T,
optionTestId: k
}) => {
const v = Rr(), w = (P) => /* @__PURE__ */ u(
"svg",
{
width: "16",
height: "16",
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
...P,
children: /* @__PURE__ */ u(
"path",
{
d: "M6 9l6 6 6-6",
stroke: v.textSecondary,
strokeWidth: "1.5",
strokeLinecap: "round",
strokeLinejoin: "round"
}
)
}
);
return /* @__PURE__ */ U(q, { children: [
a && /* @__PURE__ */ u(
se,
{
variant: l,
"data-testid": y,
sx: {
color: v.textPrimary,
mb: 0.5,
fontWeight: 500
},
children: a
}
),
/* @__PURE__ */ u(
Fc,
{
id: e,
options: t,
value: n,
multiple: r,
size: "small",
popupIcon: /* @__PURE__ */ u(w, {}),
disabled: c,
loading: m,
onOpen: g,
noOptionsText: x,
fullWidth: !0,
componentsProps: {
paper: {
sx: {
boxShadow: "0px 0px 10px 0px rgba(0, 0, 0, 0.1)",
// same as FinSelect
border: `1px solid ${v.divider}`,
mt: 0.5,
borderRadius: "8px"
}
}
},
sx: {
"& .MuiOutlinedInput-root": {
backgroundColor: v.paper,
borderRadius: "8px",
height: "40px",
"& fieldset": { borderColor: v.outlineDefault },
"&:hover fieldset": { borderColor: v.outlineHover },
"&.Mui-focused fieldset": { borderColor: v.outlineFocus },
"&.Mui-error fieldset": { borderColor: v.errorMain }
},
"& .MuiInputBase-input": {
color: v.textPrimary,
fontSize: 14
},
"& .MuiAutocomplete-popupIndicator": {
color: v.textSecondary
},
"& .MuiAutocomplete-endAdornment svg": {
width: 16,
height: 16
},
...f
},
getOptionLabel: (P) => typeof P == "string" ? P : (P == null ? void 0 : P.label) ?? "",
isOptionEqualToValue: (P, M) => ((P == null ? void 0 : P.value) ?? P) === ((M == null ? void 0 : M.value) ?? M),
renderOption: (P, M, { selected: I }) => {
const { key: N, ...p } = P, R = typeof M == "string" ? M : (M == null ? void 0 : M.value) ?? (M == null ? void 0 : M.id) ?? (M == null ? void 0 : M.label) ?? "";
return /* @__PURE__ */ U(
q,
{
component: "li",
...p,
"data-testid": k ? k(R) : void 0,
sx: {
backgroundColor: v.paper,
color: v.textPrimary,
mx: 0.5,
borderRadius: "4px",
"&:hover": { backgroundColor: v.neutral50 },
"&.Mui-focused": { backgroundColor: v.neutral50 },
...I ? { backgroundColor: v.neutral50 } : {}
},
children: [
r && /* @__PURE__ */ u(gr, { checked: I }),
/* @__PURE__ */ u(
se,
{
variant: "body2",
sx: {
color: v.textPrimary,
fontSize: 14
},
children: typeof M == "string" ? M : M.label
}
)
]
},
N
);
},
renderInput: (P) => /* @__PURE__ */ u(
hi,
{
...P,
label: i,
placeholder: o,
size: "small",
error: h,
helperText: d,
inputProps: {
...P.inputProps,
...E ? { "data-testid": E } : {}
},
FormHelperTextProps: T ? { "data-testid": T } : void 0,
InputLabelProps: {
shrink: !!n || !!o,
// fixes label overlap
sx: {
color: v.textSecondary,
"&.Mui-focused": {
color: v.textPrimary
},
"&.Mui-error": {
color: v.errorMain
}
},
...y && !a ? { "data-testid": y } : {}
},
InputProps: {
...P.InputProps,
endAdornment: /* @__PURE__ */ U(mi, { children: [
m ? /* @__PURE__ */ u(ar, { size: 20 }) : null,
P.InputProps.endAdornment
] })
}
}
),
onChange: (P, M) => s(M)
}
)
] });
}, on = ({
label: e,
checked: t,
disabled: n,
onChange: r,
sx: i,
inputTestId: a,
labelTestId: o
}) => /* @__PURE__ */ u(
Un,
{
control: /* @__PURE__ */ u(
gr,
{
size: "small",
checked: t,
disabled: n,
onChange: (s, l) => r(l),
inputProps: a ? { "data-testid": a } : void 0
}
),
label: e,
"data-testid": o,
sx: (s) => ({ "& .MuiFormControlLabel-label": { color: s.palette.text.primary, fontSize: 14 }, ...i })
}
), km = ({
labelText: e,
label: t,
value: n = [],
options: r,
row: i = !1,
onChange: a,
labelPosition: o = "top",
labelVariant: s = "subtitle2",
helperText: l,
error: c,
groupPadding: m = 1.5,
itemGap: h = 1,
disabled: d = !1
}) => {
const g = typeof i == "number" && i > 0, x = g ? i : 12, f = i === !0, E = i === !1 && !g, y = (T, k) => {
const v = Array.isArray(n) ? [...n] : [];
k ? v.includes(T) || a([...v, T]) : a(v.filter((w) => w !== T));
};
return /* @__PURE__ */ U(
Aa,
{
error: c,
disabled: d,
sx: (T) => {
var k;
return {
display: "flex",
flexDirection: "column",
px: T.spacing(m),
borderRadius: ((k = T.shape) == null ? void 0 : k.borderRadius) || 8,
mx: -2.5,
backgroundColor: T.palette.background.paper
};
},
children: [
o === "top" && e && /* @__PURE__ */ u(
se,
{
variant: s,
sx: (T) => ({
color: T.palette.text.primary,
mb: 0.5,
fontSize: T.typography.fontSize,
fontWeight: 500
}),
children: e
}
),
t && /* @__PURE__ */ u(
Bs,
{
sx: (T) => ({
color: T.palette.text.secondary,
mb: 0.5,
mx: 1,
fontSize: T.typography.fontSize || 12,
fontWeight: 500,
"&.Mui-focused": {
color: T.palette.text.primary
},
"&.Mui-error": {
color: T.palette.error.main
}
}),
children: t
}
),
g && /* @__PURE__ */ u(
q,
{
sx: (T) => ({
display: "grid",
gridTemplateColumns: `repeat(${x}, 1fr)`,
gap: T.spacing(h),
mt: 0
}),
children: r.map((T) => {
const k = Array.isArray(n) && n.includes(T.value);
return /* @__PURE__ */ u(
Un,
{
control: /* @__PURE__ */ u(
gr,
{
size: "small",
checked: k,
onChange: (v) => y(T.value, v.target.checked),
disabled: d,
sx: (v) => ({
color: v.palette.text.secondary,
"&.Mui-checked": {
color: v.palette.primary.main
}
})
}
),
label: T.label,
sx: (v) => ({
m: 0,
"& .MuiFormControlLabel-label": {
color: v.palette.text.primary,
fontSize: 12
}
})
},
String(T.value)
);
})
}
),
f && /* @__PURE__ */ u(
q,
{
sx: (T) => ({
display: "flex",
flexDirection: "row",
flexWrap: "wrap",
gap: T.spacing(h),
alignItems: "center",
mt: 0
}),
children: r.map((T) => {
const k = Array.isArray(n) && n.includes(T.value);
return /* @__PURE__ */ u(
Un,
{
control: /* @__PURE__ */ u(
gr,
{
size: "small",
checked: k,
onChange: (v) => y(T.value, v.target.checked),
disabled: d,
sx: (v) => ({
color: v.palette.text.secondary,
"&.Mui-checked": {
color: v.palette.primary.main
}
})
}
),
label: T.label,
sx: (v) => ({
m: 0,
"& .MuiFormControlLabel-label": {
color: v.palette.text.primary,
fontSize: 12
}
})
},
String(T.value)
);
})
}
),
E && /* @__PURE__ */ u(
q,
{
sx: (T) => ({
display: "flex",
flexDirection: "column",
gap: T.spacing(h),
alignItems: "flex-start",
mt: 0
}),
children: r.map((T) => {
const k = Array.isArray(n) && n.includes(T.value);
return /* @__PURE__ */ u(
Un,
{
control: /* @__PURE__ */ u(
gr,
{
size: "small",
checked: k,
onChange: (v) => y(T.value, v.target.checked),
disabled: d,
sx: (v) => ({
color: v.palette.text.secondary,
"&.Mui-checked": {
color: v.palette.primary.main
}
})
}
),
label: T.label,
sx: (v) => ({
m: 0,
"& .MuiFormControlLabel-label": {
color: v.palette.text.primary,
fontSize: 12
}
})
},
String(T.value)
);
})
}
),
l && /* @__PURE__ */ u($a, { sx: { mt: 0.5 }, children: l })
]
}
);
}, xa = ({ label: e, checked: t, disabled: n, onChange: r, sx: i }) => /* @__PURE__ */ u(
Un,
{
control: /* @__PURE__ */ u(
Vs,
{
checked: t,
disabled: n,
onChange: (a, o) => r(o)
}
),
label: e,
sx: (a) => ({ "& .MuiFormControlLabel-label": { color: a.palette.text.primary, fontSize: 14 }, ...i })
}
), qn = ({
labelText: e,
label: t,
value: n,
options: r,
row: i = !1,
onChange: a,
labelPosition: o = "top",
labelVariant: s = "subtitle2",
helperText: l,
error: c,
groupPadding: m = 1.5,
itemGap: h = 1
}) => /* @__PURE__ */ U(
Aa,
{
error: c,
sx: (d) => {
var g;
return {
display: "flex",
flexDirection: "column",
px: d.spacing(m),
borderRadius: ((g = d.shape) == null ? void 0 : g.borderRadius) || 8,
mx: -2.5,
backgroundColor: d.palette.background.paper
};
},
children: [
o === "top" && e && /* @__PURE__ */ u(
se,
{
variant: s,
sx: (d) => ({
color: d.palette.text.primary,
mb: 0.5,
fontSize: d.typography.fontSize,
fontWeight: 500
}),
children: e
}
),
t && /* @__PURE__ */ u(
Bs,
{
sx: (d) => ({
color: d.palette.text.secondary,
mb: 0.5,
mx: 1,
fontSize: d.typography.fontSize || 12,
fontWeight: 500,
"&.Mui-focused": {
color: d.palette.text.primary
},
"&.Mui-error": {
color: d.palette.error.main
}
}),
children: t
}
),
/* @__PURE__ */ u(
Ac,
{
row: i,
value: n,
onChange: (d) => a(d.target.value),
sx: (d) => ({
display: "flex",
flexDirection: i ? "row" : "column",
gap: d.spacing(h),
alignItems: i ? "center" : "flex-start"
}),
children: r.map((d) => /* @__PURE__ */ u(
Un,
{
value: d.value,
control: /* @__PURE__ */ u(
$c,
{
size: "small",
sx: (g) => ({
color: g.palette.text.secondary,
"&.Mui-checked": {
color: g.palette.primary.main
}
})
}
),
label: /* @__PURE__ */ U(q, { sx: { display: "flex", flexDirection: "column", gap: 0 }, children: [
/* @__PURE__ */ u(
se,
{
variant: "body2",
sx: {
color: "#1a1a1a",
fontSize: 12,
fontWeight: 400,
lineHeight: 1.5
},
children: d.label
}
),
d.description && /* @__PURE__ */ u(
se,
{
variant: "caption",
sx: {
color: "#1a1a1a",
fontSize: 10,
fontWeight: 300,
lineHeight: 1.5
},
children: d.description
}
)
] }),
sx: {
m: 0,
// Tight spacing between radio control and label (0 = no extra gap beyond control padding)
gap: 0,
"& .MuiFormControlLabel-label": {
marginLeft: 0
},
"& .MuiRadio-root": {
alignSelf: "flex-start",
marginTop: 0
// Always align with top of label
}
}
},
String(d.value)
))
}
),
l && /* @__PURE__ */ u($a, { sx: { mt: 0.5 }, children: l })
]
}
);
Vn.extend(Zc);
const ba = "DD-MM-YYYY";
function Pl(e) {
return (e || ba).replace(/-/g, "/");
}
const _l = ({
labelPosition: e = "inner",
labelVariant: t = "subtitle2",
label: n,
sx: r,
inputTestId: i,
labelTestId: a,
errorTestId: o,
value: s,
onChange: l,
onBlur: c,
dateFormat: m = ba,
minDate: h,
maxDate: d,
disabled: g,
error: x,
helperText: f,
fullWidth: E = !0,
size: y = "small",
placeholder: T,
inputProps: k
}) => {
const v = h ?? (k == null ? void 0 : k.min), w = d ?? (k == null ? void 0 : k.max), P = m || ba, M = T ?? Pl(P), I = s ? Vn(s, "YYYY-MM-DD", !0) : null, N = I != null && I.isValid() ? I : null, p = (R) => {
const $ = R && R.isValid() ? R.format("YYYY-MM-DD") : "";
l == null || l($);
};
return /* @__PURE__ */ U(q, { children: [
e === "top" && n && /* @__PURE__ */ u(
se,
{
variant: t,
"data-testid": a,
sx: { color: "#111827", mb: 0.5 },
children: n
}
),
/* @__PURE__ */ u(
Gc,
{
format: P,
value: N,
disabled: g,
minDate: v && Vn(v, "YYYY-MM-DD", !0).isValid() ? Vn(v, "YYYY-MM-DD", !0) : void 0,
maxDate: w && Vn(w, "YYYY-MM-DD", !0).isValid() ? Vn(w, "YYYY-MM-DD", !0) : void 0,
onChange: p,
onClose: c,
slots: { textField: xt },
slotProps: {
textField: {
fullWidth: E,
size: y,
label: e === "inner" ? n : void 0,
error: x,
helperText: f,
placeholder: M,
labelTestId: e === "inner" ? a : void 0,
inputTestId: i,
errorTestId: o,
sx: {
"& .MuiOutlinedInput-root": {
backgroundColor: "#FFFFFF",
borderRadius: "8px",
"& fieldset": { borderColor: "#E5E7EB" },
"&:hover fieldset": { borderColor: "#D1D5DB" },
"&.Mui-focused fieldset": { borderColor: "#D1D5DB" },
"&.Mui-error fieldset": { borderColor: "#E53935" }
},
"& .MuiInputBase-input": { color: "#111827", fontSize: 14 },
...r
}
}
}
}
)
] });
}, Tm = ({
labelText: e,
labelVariant: t = "subtitle2",
hasError: n,
sx: r,
label: i,
inputTestId: a,
labelTestId: o,
errorTestId: s,
...l
}) => {
const c = Rr(), m = !!e;
return /* @__PURE__ */ U(q, { children: [
m && /* @__PURE__ */ u(
se,
{
variant: t,
"data-testid": o,
sx: { color: c.textPrimary, mb: 0.5, fontWeight: 500 },
children: e
}
),
/* @__PURE__ */ u(
hi,
{
fullWidth: !0,
multiline: !0,
minRows: 3,
size: "small",
...l,
label: m ? void 0 : i,
inputProps: {
...l.inputProps,
...a ? { "data-testid": a } : {}
},
FormHelperTextProps: {
...l.FormHelperTextProps,
...s ? { "data-testid": s } : {}
},
InputLabelProps: {
...l.InputLabelProps,
...o && !m ? { "data-testid": o } : {}
},
sx: {
"& .MuiOutlinedInput-root": {
backgroundColor: c.paper,
borderRadius: "8px",
"& fieldset": { borderColor: c.outlineDefault },
"&:hover fieldset": { borderColor: c.outlineHover },
"&.Mui-focused fieldset": { borderColor: c.outlineFocus },
"&.Mui-error fieldset": { borderColor: c.errorMain }
},
"& .MuiInputBase-input": { color: c.textPrimary, fontSize: 14 },
"& .MuiFormLabel-root": { color: c.textSecondary },
"& .MuiFormLabel-root.Mui-focused": { color: c.textPrimary },
"& .MuiFormHelperText-root": {
color: n ? c.errorMain : c.textSecondary
},
...r
}
}
)
] });
}, Om = ({ title: e, subtitle: t, actions: n, align: r = "left", sx: i }) => /* @__PURE__ */ U(
q,
{
sx: (a) => ({
display: "flex",
flexDirection: "row",
alignItems: "center",
justifyContent: "space-between",
gap: a.spacing(1),
py: a.spacing(1),
...i
}),
children: [
/* @__PURE__ */ U(q, { sx: { display: "flex", flexDirection: "column", minWidth: 0, flex: 1, textAlign: r }, children: [
e && /* @__PURE__ */ u(se, { variant: "h6", sx: (a) => ({ color: a.palette.text.primary, fontSize: 16, fontWeight: 500, lineHeight: 1.3 }), children: e }),
t && /* @__PURE__ */ u(se, { variant: "body2", sx: (a) => ({ color: a.palette.text.secondary, mt: e ? 0.5 : 0, fontSize: 12, fontWeight: 500 }), children: t })
] }),
n && /* @__PURE__ */ u(q, { sx: { display: "flex", alignItems: "center", gap: 1, flexWrap: "wrap" }, children: n })
]
}
), mr = Xe(/* @__PURE__ */ u("path", {
d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"
}), "Add"), Dl = () => /* @__PURE__ */ U(
"svg",
{
width: "24",
height: "24",
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
children: [
/* @__PURE__ */ u("g", { "clip-path": "url(#clip0_5814_24904)", children: /* @__PURE__ */ u(
"path",
{
d: "M11 18C11 19.1 10.1 20 9 20C7.9 20 7 19.1 7 18C7 16.9 7.9 16 9 16C10.1 16 11 16.9 11 18ZM9 10C7.9 10 7 10.9 7 12C7 13.1 7.9 14 9 14C10.1 14 11 13.1 11 12C11 10.9 10.1 10 9 10ZM9 4C7.9 4 7 4.9 7 6C7 7.1 7.9 8 9 8C10.1 8 11 7.1 11 6C11 4.9 10.1 4 9 4ZM15 8C16.1 8 17 7.1 17 6C17 4.9 16.1 4 15 4C13.9 4 13 4.9 13 6C13 7.1 13.9 8 15 8ZM15 10C13.9 10 13 10.9 13 12C13 13.1 13.9 14 15 14C16.1 14 17 13.1 17 12C17 10.9 16.1 10 15 10ZM15 16C13.9 16 13 16.9 13 18C13 19.1 13.9 20 15 20C16.1 20 17 19.1 17 18C17 16.9 16.1 16 15 16Z",
fill: "#056739",
"fill-opacity": "0.5"
}
) }),
/* @__PURE__ */ u("defs", { children: /* @__PURE__ */ u("clipPath", { id: "clip0_5814_24904", children: /* @__PURE__ */ u("rect", { width: "24", height: "24", fill: "white" }) }) })
]
}
);
function Fm({
items: e,
getId: t,
onReorder: n,
header: r,
disabled: i,
sx: a,
getText: o,
/* getChip */
showIndex: s = !0,
showLeftIcon: l = !0,
renderItem: c,
chipText: m,
helperText: h,
emptyStateText: d,
emptyStateButtonText: g = "Add Phase",
onEmptyStateButtonClick: x,
emptyStateSx: f
}) {
const [E, y] = We.useState(null), [T, k] = We.useState(null), v = (p) => (R) => {
if (!i) {
y(p), R.dataTransfer.effectAllowed = "move";
try {
R.dataTransfer.setData("text/plain", String(t(e[p])));
} catch {
}
}
}, w = (p) => (R) => {
i || (R.preventDefault(), k(p), R.dataTransfer.dropEffect = "move");
}, P = (p) => (R) => {
if (i) return;
if (R.preventDefault(), E === null || E === p) {
y(null), k(null);
return;
}
const $ = [...e], [Z] = $.splice(E, 1);
$.splice(p, 0, Z), y(null), k(null), n($);
}, M = () => {
y(null), k(null);
}, I = e.length === 0;
return /* @__PURE__ */ U(
q,
{
role: "list",
sx: (p) => ({
display: "flex",
flexDirection: "column",
gap: p.spacing(1),
...a
}),
children: [
r,
!I && /* @__PURE__ */ u(gi, { sx: { mt: -0.5, mb: 1, dividerColor: "#EBEBEB" } }),
I && (d || x !== void 0) ? /* @__PURE__ */ U(
q,
{
sx: (p) => ({
display: "flex",
flexDirection: "column",
alignItems: "center",
justifyContent: "center",
minHeight: "200px",
padding: p.spacing(4),
backgroundColor: p.palette.mode === "dark" ? "#000000" : he.background.paper,
border: `2px dashed ${p.palette.mode === "dark" ? "#FFFFFF" : he.divider}`,
borderRadius: "8px",
textAlign: "center",
...f
}),
children: [
d && /* @__PURE__ */ u(
se,
{
variant: "body1",
sx: (p) => ({
color: p.palette.text.secondary,
fontSize: "14px",
fontWeight: 400,
lineHeight: 1.5,
mb: x ? 2 : 0,
maxWidth: "400px"
}),
children: d
}
),
x && /* @__PURE__ */ u(
Ve,
{
variant: "outlined",
startIcon: /* @__PURE__ */ u(mr, {}),
onClick: x,
disabled: i,
sx: (p) => ({
mt: d ? 0 : 2,
backgroundColor: p.palette.mode === "dark" ? `${p.palette.primary.main}1A` : `${p.palette.primary.main}0D`,
borderColor: p.palette.primary.main,
color: p.palette.primary.main,
"&:hover": {
backgroundColor: p.palette.mode === "dark" ? `${p.palette.primary.main}33` : `${p.palette.primary.main}1A`,
borderColor: p.palette.primary.main
},
borderRadius: "6px",
textTransform: "none",
fontSize: "14px",
fontWeight: 500,
px: 2,
py: 1
}),
children: g
}
)
]
}
) : e.map((p, R) => {
const $ = E === R, Z = T === R && E !== null && E !== R;
return /* @__PURE__ */ u(
q,
{
role: "listitem",
draggable: !i,
onDragStart: v(R),
onDragOver: w(R),
onDrop: P(R),
onDragEnd: M,
sx: (j) => ({
userSelect: "none",
cursor: i ? "default" : "grab",
backgroundColor: "#F8F8FA",
border: `1px solid ${Z ? j.palette.primary.main : "#EBEBEB"}`,
borderRadius: "8px",
padding: j.spacing(1),
opacity: $ ? 0.6 : 1,
boxShadow: Z ? `0 0 0 2px ${j.palette.primary.main}33` : "none"
}),
children: c ? c(p, $) : /* @__PURE__ */ U(q, { sx: (j) => ({ display: "flex", alignItems: "center", gap: j.spacing(1), minWidth: 0 }), children: [
l && /* @__PURE__ */ u(Dl, {}),
s && /* @__PURE__ */ U(se, { variant: "body2", sx: (j) => ({ fontWeight: 600, fontSize: 14, color: `${j.palette.text.primary}`, flex: "0 0 auto" }), children: [
R + 1,
"."
] }),
(() => {
const j = typeof m == "function" ? m(p, R) : m;
return j ? /* @__PURE__ */ u(Ra, { label: j, sx: { borderRadius: "4px", p: "12px 3px" }, size: "small" }) : null;
})(),
/* @__PURE__ */ u(se, { variant: "body2", sx: (j) => ({ fontSize: 12, fontWeight: 500, color: `${j.palette.text.primary}90`, flex: 1, minWidth: 0, overflow: "hidden", whiteSpace: "nowrap", textOverflow: "ellipsis" }), children: o ? o(p) : "" })
] })
},
String(t(p))
);
}),
!I && h ? typeof h == "string" ? /* @__PURE__ */ u(se, { variant: "caption", sx: (p) => ({ color: `${p.palette.text.primary}60` }), children: h }) : h : null
]
}
);
}
const Am = gt(qs)(({ theme: e }) => {
const t = e.palette.divider || "#E8E8E8", n = e.palette.primary.main;
return {
[`&.${nn.vertical}`]: {
marginLeft: 11
// aligns with 24px icon
},
[`& .${nn.line}`]: {
minHeight: 28,
borderLeftWidth: 2,
borderColor: t,
// theme-based divider color
transition: "border-color 0.3s ease"
},
[`&.${nn.completed} .${nn.line}`]: {
borderColor: n
// theme-based primary for completed
}
};
}), Lg = ({
items: e,
activeIndex: t = 1,
onStepClick: n,
sx: r,
completedSteps: i
}) => {
const a = El(), o = a.palette.primary.main, s = a.palette.text.primary, l = a.palette.divider, c = a.palette.action && a.palette.action.disabledBackground || "#E8E8E8", m = (h) => {
const { active: d, completed: g, icon: x } = h;
return g ? /* @__PURE__ */ u(
q,
{
sx: {
width: 24,
height: 24,
border: `1.2px solid ${o}`,
borderRadius: "50%",
backgroundColor: o,
color: "#fff",
display: "flex",
alignItems: "center",
justifyContent: "center"
},
children: /* @__PURE__ */ u(Qa, { sx: { fontSize: 16, fontWeight: 600 } })
}
) : d ? /* @__PURE__ */ u(
q,
{
sx: {
width: 24,
height: 24,
borderRadius: "50%",
border: `1.2px solid ${o}`,
backgroundColor: mt(o, 0.2),
color: o,
display: "flex",
alignItems: "center",
justifyContent: "center",
fontWeight: 500,
fontSize: 12
},
children: x
}
) : /* @__PURE__ */ u(
q,
{
sx: {
width: 24,
height: 24,
borderRadius: "50%",
backgroundColor: c,
color: s,
display: "flex",
alignItems: "center",
justifyContent: "center",
fontWeight: 500,
fontSize: 12
},
children: x
}
);
};
return /* @__PURE__ */ u(
Ws,
{
orientation: "vertical",
activeStep: t,
connector: /* @__PURE__ */ u(Am, {}),
sx: {
"& .MuiStepConnector-vertical": {
my: -1.1
},
"& .MuiStepLabel-label": {
fontSize: 14,
color: s,
fontWeight: 500
},
"& .MuiStep-root": {
cursor: n ? "pointer" : "default"
},
...r
},
children: e.map((h, d) => {
const g = Array.isArray(i) && i.length > 0 ? i.includes(d) : d < t;
return /* @__PURE__ */ U(
Us,
{
onClick: () => n == null ? void 0 : n(d),
completed: g,
children: [
/* @__PURE__ */ u(Hs, { StepIconComponent: m, children: /* @__PURE__ */ u(
se,
{
sx: {
fontSize: 12,
fontWeight: 500,
color: d === t ? o : s
},
children: h.label
}
) }),
d !== e.length - 1 && /* @__PURE__ */ u(gi, { sx: { ml: 4.2, borderColor: l } })
]
},
d
);
})
}
);
}, Il = ({
colorKey: e = "primary",
colorHex: t,
tone: n = "soft",
bgAlpha: r = 0.12,
borderAlpha: i = 0.24,
sx: a,
...o
}) => /* @__PURE__ */ u(
Ra,
{
...o,
sx: (s) => ({
fontWeight: 600,
borderRadius: "4px",
height: 18,
border: `0.5px solid ${mt(t || s.palette.text.primary, 0.5)}`,
backgroundColor: mt(t || s.palette.text.primary, 0.1),
"& .MuiChip-label": { p: "8px", color: t || s.palette.text.primary, fontSize: 10, fontWeight: 500 },
...a
})
}
), $m = gt(qs)(() => ({
[`&.${nn.vertical}`]: {
marginLeft: 11
// aligns with 24px icon
},
[`& .${nn.line}`]: {
minHeight: 28,
borderLeftWidth: 2,
height: "70px",
borderColor: "#E8E8E8",
// default gray
transition: "border-color 0.3s ease",
zIndex: -1
},
[`&.${nn.completed} .${nn.line}`]: {
borderColor: he.primary.main
// ✅ green for completed
}
})), Bg = ({ items: e, activeIndex: t = 1, onStepClick: n, sx: r }) => {
const [i, a] = at(null), o = (s) => {
const { active: l, completed: c, icon: m } = s;
return c ? /* @__PURE__ */ u(
q,
{
sx: {
width: 24,
height: 24,
border: `1.2px solid ${he.primary.main}`,
borderRadius: "50%",
backgroundColor: he.primary.main,
color: "#fff",
display: "flex",
alignItems: "center",
justifyContent: "center",
zIndex: 1e3
},
children: /* @__PURE__ */ u(Qa, { sx: { fontSize: 16, fontWeight: 600 } })
}
) : l ? /* @__PURE__ */ u(
q,
{
sx: {
width: 24,
height: 24,
borderRadius: "50%",
border: `1.2px solid ${he.primary.main}`,
backgroundColor: mt(he.primary.main, 0.2),
color: he.primary.main,
display: "flex",
alignItems: "center",
justifyContent: "center",
fontWeight: 500,
fontSize: 12,
zIndex: 1e3,
overflow: "hidden"
},
children: m
}
) : /* @__PURE__ */ u(
q,
{
sx: {
width: 24,
height: 24,
borderRadius: "50%",
backgroundColor: "#E8E8E8",
color: he.text.primary,
display: "flex",
alignItems: "center",
justifyContent: "center",
fontWeight: 500,
fontSize: 12,
zIndex: 1e3
},
children: m
}
);
};
return /* @__PURE__ */ u(
Ws,
{
orientation: "vertical",
activeStep: t,
connector: /* @__PURE__ */ u($m, {}),
sx: {
"& .MuiStepConnector-vertical": {
my: -3.5
},
"& .MuiStepLabel-label": {
fontSize: 14,
color: he.text.primary,
fontWeight: 500
},
"& .MuiStep-root": {
cursor: n ? "pointer" : "default"
},
...r
},
children: e.map((s, l) => /* @__PURE__ */ U(
Us,
{
onMouseEnter: () => a(l),
onMouseLeave: () => a(null),
onClick: () => n == null ? void 0 : n(l),
completed: l < t,
children: [
/* @__PURE__ */ U(
q,
{
sx: {
display: "flex",
justifyContent: "space-between",
alignItems: "flex-start"
},
children: [
/* @__PURE__ */ U(Hs, { StepIconComponent: o, children: [
/* @__PURE__ */ U(q, { sx: { display: "flex", gap: 1, alignItems: "center" }, children: [
/* @__PURE__ */ u(
se,
{
sx: {
fontSize: 14,
fontWeight: 500,
color: l === t ? he.primary.main : he.text.primary
},
children: s.label
}
),
/* @__PURE__ */ u(
Il,
{
size: "small",
colorHex: l < t ? he.success.main : l === t ? "#973B00" : he.text.primary,
label: l < t ? "Completed" : l === t ? "In progress" : "Not started"
}
)
] }),
/* @__PURE__ */ u(
se,
{
sx: {
fontSize: 12,
fontWeight: 400,
color: `${he.text.primary}60`,
mt: 0.5,
width: "80%"
},
children: s.description
}
)
] }),
i === l && /* @__PURE__ */ u(Ve, { sx: { display: l > t ? "none" : "block" }, variant: l < t ? "outlined" : "contained", size: "small", color: "primary", children: l < t ? "Edit" : l === t ? "Complete" : "" })
]
}
),
l !== e.length - 1 && /* @__PURE__ */ u(gi, { sx: { ml: 4.2, borderColor: he.divider } })
]
},
l
))
}
);
}, Rm = Xe(/* @__PURE__ */ u("path", {
d: "M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"
}), "InfoOutlined"), Vg = ({
variant: e = "list",
title: t,
subtitle: n,
text: r,
items: i = [],
icon: a,
colorHex: o,
sx: s
}) => {
const l = o || he.info.main, c = mt(l, 0.08), m = mt(l, 0.08), h = a ?? /* @__PURE__ */ u(Rm, { sx: { color: l, fontSize: 18 } });
return e === "inlineInfo" ? /* @__PURE__ */ U(
st,
{
sx: {
p: 1.5,
display: "flex",
alignItems: "center",
gap: 1,
backgroundColor: c,
border: `1px solid ${m}`,
boxShadow: "none",
...s
},
children: [
/* @__PURE__ */ u(q, { sx: { display: "flex", alignItems: "center" }, children: h }),
/* @__PURE__ */ u(
se,
{
variant: "body2",
sx: { fontWeight: 400, fontSize: 12, lineHeight: 1.3, color: l },
children: r
}
)
]
}
) : e === "inline" ? /* @__PURE__ */ u(
st,
{
sx: {
p: 1.5,
display: "flex",
alignItems: "center",
gap: 1,
backgroundColor: c,
border: `1px solid ${m}`,
boxShadow: "none",
...s
},
children: /* @__PURE__ */ u(
se,
{
variant: "body2",
sx: { fontWeight: 400, fontSize: 12, lineHeight: 1.3, color: l },
children: r
}
)
}
) : e === "listWithHeader" ? /* @__PURE__ */ U(
st,
{
sx: {
p: 2,
boxShadow: "none",
borderRadius: "6px",
backgroundColor: c,
border: `1px solid ${m}`,
...s
},
children: [
/* @__PURE__ */ U(q, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
h,
/* @__PURE__ */ u(
se,
{
variant: "subtitle2",
sx: {
fontWeight: 600,
color: l,
fontSize: 14,
lineHeight: 1.3
},
children: t
}
)
] }),
n && /* @__PURE__ */ u(
se,
{
variant: "body2",
sx: { mt: 0.5, color: l, fontSize: 10, lineHeight: 1.3 },
children: n
}
),
/* @__PURE__ */ u(
io,
{
sx: {
pl: 5,
// add padding for bullet indentation
"& .MuiListItem-root": {
display: "list-item",
// enable bullet rendering
listStyleType: "disc",
// or 'disc'
color: l
},
"& .MuiListItemText-primary": {
fontSize: "12px",
fontWeight: 400,
lineHeight: "18px",
color: l,
my: -0.5
}
},
children: i.map((d, g) => /* @__PURE__ */ u(ao, { sx: { py: 0 }, children: /* @__PURE__ */ u(oo, { primary: d }) }, g))
}
)
]
}
) : /* @__PURE__ */ u(
st,
{
sx: {
p: "11px",
borderRadius: "8px",
backgroundColor: c,
border: `0.5px solid ${m}`,
boxShadow: "none",
...s
},
children: /* @__PURE__ */ u(
io,
{
sx: {
pl: 4,
// add padding for bullet indentation
"& .MuiListItem-root": {
display: "list-item",
// enable bullet rendering
listStyleType: "disc",
// or 'disc'
color: l
},
"& .MuiListItemText-primary": {
fontSize: "12px",
fontWeight: 600,
lineHeight: "18px",
color: l,
my: -0.5
}
},
children: i.map((d, g) => /* @__PURE__ */ u(ao, { sx: { py: 0 }, children: /* @__PURE__ */ u(oo, { primary: d }) }, g))
}
)
}
);
}, ls = (e) => e == null ? [] : Array.isArray(e) ? e : [e], Pm = ({ value: e, onChange: t, items: n, ariaLabel: r, sx: i, tabSx: a }) => {
const o = [
{
alignItems: "center",
borderRadius: "6px",
p: "10px",
backgroundColor: "#FFFFFF",
"& .MuiTabs-flexContainer": {
gap: 1
},
"& .MuiTabs-indicator": {
display: "none"
}
},
...ls(i)
];
return /* @__PURE__ */ U(q, { children: [
/* @__PURE__ */ u(
Rc,
{
value: e,
onChange: (s, l) => t(l),
"aria-label": r || "Fin tabs",
sx: o,
children: n.map((s, l) => {
const c = typeof s.value == "string" || typeof s.value == "number" ? s.value : l;
return /* @__PURE__ */ u(
Pc,
{
value: c,
disabled: s.disabled,
label: /* @__PURE__ */ u(se, { variant: "body2", children: s.label }),
sx: [
(m) => ({
px: 2,
textTransform: "none",
color: m.palette.primary.main,
boxShadow: "none",
borderRadius: "3px",
border: "0.5px solid #0000001A",
backgroundColor: "#FFFFFF",
"&:hover": {
backgroundColor: m.palette.action.hover
},
"&.Mui-selected": {
color: m.palette.common.white,
borderColor: m.palette.primary.main,
backgroundColor: m.palette.primary.main,
fontWeight: 600
}
}),
...ls(a)
]
},
String(c)
);
})
}
),
n.map((s, l) => {
const c = typeof s.value == "string" || typeof s.value == "number" ? s.value : l, m = s.content ?? (typeof s.value == "object" ? s.value : null);
return m && e === c ? /* @__PURE__ */ u(q, { sx: { mt: 1 }, children: m }, `panel-${c}`) : null;
})
] });
}, _m = Xe(/* @__PURE__ */ u("path", {
d: "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"
}), "DeleteOutline"), Dm = ({
name: e,
columns: t,
initialRow: n,
addLabel: r,
maxRows: i,
hideAddWhenMax: a,
disableAddWhenMax: o = !0,
showEmptyState: s = !0,
rowDeletable: l = !0,
control: c,
sx: m,
addActions: h,
emptyTitle: d = "No items configured",
emptySubtitle: g = "Click 'Add' to get started.",
emptyCardSx: x,
setValue: f,
rowSelectionMode: E,
rowSelectionKey: y,
dateFormat: T
}) => {
const { fields: k, append: v, remove: w } = wc({ control: c, name: e }), M = !(typeof i == "number" ? k.length >= i : !1), I = We.useMemo(() => {
if (y) return y;
const L = t.find((Q) => Q.type === "rowSelect");
return L == null ? void 0 : L.key;
}, [t, y]), N = Sc({ control: c, name: e }) || [], p = We.useMemo(() => {
if (!I) return {};
const L = {};
return N.forEach((Q, V) => {
L[V] = !!(Q != null && Q[I]);
}), L;
}, [N, I]), R = We.useCallback((L) => p[L] === !0, [p]), $ = We.useCallback((L, Q) => {
if (!f || !I) return;
const V = `${e}.${L}.${I}`;
E === "single" && Q && N.forEach((K, S) => {
if (S !== L) {
const D = `${e}.${S}.${I}`;
f(D, !1, { shouldDirty: !0 });
}
}), f(V, Q, { shouldDirty: !0 });
}, [e, I, E, f, N]), Z = (L) => {
const Q = { ...L || n };
t.forEach((V) => {
V.value !== void 0 && Q[V.key] === void 0 && (Q[V.key] = typeof V.value == "function" ? V.value(Q, k.length) : V.value);
}), v(Q);
};
We.useEffect(() => {
!s && k.length === 0 && M && Z();
}, [s, k.length, M]);
const j = We.useMemo(() => t.reduce((Q, V) => {
if (V.width === "auto" || V.width === void 0)
return Q + 120;
const K = typeof V.width == "number" ? V.width : typeof V.width == "string" && parseInt(V.width) || 160;
return Q + K;
}, 0) + (l ? 100 : 0), [t, l]), re = (L) => L.width === "auto" || L.width === void 0 ? {
width: "auto",
minWidth: 120,
maxWidth: "none"
} : typeof L.width == "number" ? {
width: `${L.width}px`,
minWidth: `${L.width}px`,
maxWidth: `${L.width}px`
} : typeof L.width == "string" ? { width: L.width, minWidth: L.width } : { width: "160px", minWidth: "160px" };
return /* @__PURE__ */ u(
st,
{
sx: {
width: "100%",
borderRadius: "4px",
boxShadow: "0px 0.783px 3.131px 0px rgba(0,0,0,0.16)",
backgroundColor: "#FFFFFF",
// Allow inner scrollbars to be visible (horizontal/vertical)
overflow: "visible",
...m
},
children: k.length === 0 && s ? /* @__PURE__ */ U(
q,
{
sx: (L) => ({
p: 4,
textAlign: "center",
borderStyle: "dashed",
borderColor: mt(L.palette.primary.main, 0.4),
backgroundColor: mt(L.palette.primary.main, 0.04),
borderWidth: 1,
borderRadius: "8px",
...x
}),
children: [
/* @__PURE__ */ u(
se,
{
variant: "subtitle1",
sx: (L) => ({
color: L.palette.primary.main,
fontWeight: 600,
mb: 0.5,
fontSize: 14
}),
children: d
}
),
/* @__PURE__ */ u(
se,
{
variant: "body2",
sx: (L) => ({
color: L.palette.primary.main,
mb: 2,
fontSize: 12,
fontWeight: 400
}),
children: g
}
),
Array.isArray(h) && h.length > 0 ? h.map((L, Q) => /* @__PURE__ */ u(
Ve,
{
variant: "outlined",
size: "small",
startIcon: /* @__PURE__ */ u(mr, {}),
sx: { mr: 1, mt: 1 },
onClick: () => Z(L.template),
disabled: !M && o,
style: { display: !M && a ? "none" : void 0 },
children: L.label
},
`empty-add-${Q}`
)) : r && /* @__PURE__ */ u(
Ve,
{
variant: "outlined",
size: "small",
startIcon: /* @__PURE__ */ u(mr, {}),
onClick: () => Z(),
disabled: !M && o,
style: { display: !M && a ? "none" : void 0 },
children: r
}
)
]
}
) : /* @__PURE__ */ U(mi, { children: [
/* @__PURE__ */ u(
q,
{
sx: {
height: "45px",
display: "flex",
alignItems: "center",
px: 1.125,
gap: 1,
py: 1.25,
borderBottom: "1px solid #E5E6EB"
},
children: Array.isArray(h) && h.length > 0 ? h.map((L, Q) => /* @__PURE__ */ u(
Ve,
{
variant: Q === 0 ? "contained" : "outlined",
size: "small",
startIcon: /* @__PURE__ */ u(mr, {}),
onClick: () => Z(L.template),
sx: {
borderRadius: "3px",
fontSize: "10.938px",
fontWeight: 500,
textTransform: "none",
px: 1.17,
py: 0.586,
minWidth: "90px",
"&:hover": {
backgroundColor: Q === 0 ? "#04502d" : void 0
}
},
disabled: !M && o,
style: { display: !M && a ? "none" : void 0 },
children: L.label
},
`add-${Q}`
)) : r && /* @__PURE__ */ u(
Ve,
{
variant: "contained",
size: "small",
startIcon: /* @__PURE__ */ u(mr, {}),
onClick: () => Z(),
sx: {
backgroundColor: "#056739",
color: "#FFFFFF",
borderRadius: "3px",
fontSize: "10.938px",
fontWeight: 500,
textTransform: "none",
px: 1.17,
py: 0.586,
minWidth: "90px",
"&:hover": {
backgroundColor: "#04502d"
}
},
disabled: !M && o,
style: { display: !M && a ? "none" : void 0 },
children: r
}
)
}
),
/* @__PURE__ */ u(
q,
{
sx: {
width: "100%",
// Enable both axis scrolling explicitly
overflowX: "auto",
overflowY: "auto",
maxHeight: "600px",
"&::-webkit-scrollbar": {
height: "8px",
width: "8px"
},
"&::-webkit-scrollbar-track": {
backgroundColor: "#f1f1f1"
},
"&::-webkit-scrollbar-thumb": {
backgroundColor: "#888",
borderRadius: "4px",
"&:hover": {
backgroundColor: "#555"
}
}
},
children: /* @__PURE__ */ u(
_c,
{
sx: {
// Table container spans parent; inner table sets minWidth to force horizontal scroll
width: "100%",
minWidth: "100%"
},
children: /* @__PURE__ */ U(
Dc,
{
stickyHeader: !0,
sx: {
minWidth: `${j || 650}px`
},
children: [
/* @__PURE__ */ u(Ic, { children: /* @__PURE__ */ U(so, { children: [
t.map((L) => /* @__PURE__ */ u(
Dn,
{
sx: {
backgroundColor: "#F2F3F5",
borderBottom: "1.756px solid #E5E6EB",
fontWeight: 500,
fontSize: "12px",
color: "#6B7785",
whiteSpace: "nowrap",
height: "43px",
px: 1.75,
py: 0,
...re(L)
},
children: L.header
},
L.key
)),
l && /* @__PURE__ */ u(
Dn,
{
sx: {
backgroundColor: "#F2F3F5",
borderBottom: "1.756px solid #E5E6EB",
fontWeight: 500,
fontSize: "12px",
color: "#6B7785",
whiteSpace: "nowrap",
height: "43px",
px: 1.75,
py: 0,
width: 100,
textAlign: "center"
},
children: "Actions"
}
)
] }) }),
/* @__PURE__ */ u(Mc, { children: k.map((L, Q) => {
const V = R(Q), K = E && !V;
return /* @__PURE__ */ U(so, { children: [
t.map((S) => {
var de;
const D = `${e}.${Q}.${S.key}`, ne = S.type === "rowSelect" || S.key === I, le = ne ? !1 : K ? !0 : typeof S.disabled == "function" ? S.disabled(L, Q) : !!S.disabled;
if (S.type === "index") {
const H = S.indexFormat ? S.indexFormat(Q) : `#${Q + 1}`;
return /* @__PURE__ */ u(
Dn,
{
sx: {
whiteSpace: "nowrap",
height: "35px",
p: 1,
borderBottom: "1px solid #E5E6EB",
textAlign: ((de = S.cellSx) == null ? void 0 : de.textAlign) || "center",
...re(S),
...S.cellSx
},
children: H
},
S.key
);
}
if (S.value !== void 0 && S.editable === !1) {
const H = typeof S.value == "function" ? S.value(L, Q) : S.value;
return /* @__PURE__ */ u(
Dn,
{
sx: {
whiteSpace: "nowrap",
height: "35px",
p: 1,
borderBottom: "1px solid #E5E6EB",
...re(S),
...S.cellSx
},
children: H
},
S.key
);
}
const ae = S.endorsementText ? typeof S.endorsementText == "function" ? S.endorsementText(L, Q) : S.endorsementText : void 0;
return /* @__PURE__ */ u(
Dn,
{
sx: {
whiteSpace: "nowrap",
height: "35px",
p: 1,
borderBottom: "1px solid #E5E6EB",
...re(S),
...S.cellSx
},
children: S.type === "rowSelect" || ne && S.type === "checkbox" ? /* @__PURE__ */ u(
Pe,
{
name: D,
control: c,
defaultValue: !1,
render: ({ field: H }) => /* @__PURE__ */ u(
on,
{
label: "",
checked: !!H.value,
disabled: !1,
onChange: (ie) => {
H.onChange(ie), $(Q, ie);
},
sx: S.sx
}
)
}
) : S.type === "checkbox" ? /* @__PURE__ */ u(
Pe,
{
name: D,
control: c,
render: ({ field: H }) => /* @__PURE__ */ u(
on,
{
label: "",
checked: !!H.value,
disabled: le,
onChange: H.onChange,
sx: S.sx
}
)
}
) : S.type === "select" ? /* @__PURE__ */ u(
Pe,
{
name: D,
control: c,
render: ({ field: H }) => /* @__PURE__ */ u(
Ga,
{
...H,
fullWidth: !0,
disabled: le,
options: S.options || [],
size: "small",
sx: {
"& .MuiOutlinedInput-input": {
py: "7.5px"
},
...S.sx
},
helperText: S.helperText,
required: S.required
}
)
}
) : S.type === "date" ? /* @__PURE__ */ u(
Pe,
{
name: D,
control: c,
defaultValue: S.value !== void 0 ? typeof S.value == "function" ? S.value(L, Q) : S.value : void 0,
render: ({ field: H }) => (We.useEffect(() => {
if (f && (H.value === void 0 || H.value === null || H.value === "") && S.value !== void 0) {
const ie = typeof S.value == "function" ? S.value(L, Q) : S.value;
f(D, ie, {
shouldValidate: !1
});
}
}, [
D,
H.value,
S.value,
L,
Q,
f
]), /* @__PURE__ */ u(
_l,
{
name: H.name,
value: H.value,
onChange: H.onChange,
onBlur: H.onBlur,
fullWidth: !0,
disabled: le,
size: "small",
dateFormat: S.dateFormat ?? T,
placeholder: S.placeholder || Pl(
S.dateFormat ?? T ?? "DD-MM-YYYY"
),
sx: {
"& .MuiOutlinedInput-input": {
py: "7.5px"
},
...S.sx
},
helperText: S.helperText,
required: S.required
}
))
}
) : /* @__PURE__ */ u(
Pe,
{
name: D,
control: c,
defaultValue: S.value !== void 0 ? typeof S.value == "function" ? S.value(L, Q) : S.value : void 0,
render: ({ field: H }) => (We.useEffect(() => {
if (f && (H.value === void 0 || H.value === null || H.value === "") && S.value !== void 0) {
const ie = typeof S.value == "function" ? S.value(L, Q) : S.value;
f(D, ie, {
shouldValidate: !1
});
}
}, [
D,
H.value,
S.value,
L,
Q,
f
]), /* @__PURE__ */ u(
xt,
{
...H,
fullWidth: !0,
type: S.type === "number" ? "number" : "text",
placeholder: S.placeholder,
disabled: le,
size: "small",
sx: {
"& .MuiOutlinedInput-input": {
py: "7.5px"
},
...S.sx
},
helperText: S.helperText,
required: S.required,
endorsementText: ae,
endorsementBg: S.endorsementBg,
endorsementColor: S.endorsementColor,
endorsementRadius: S.endorsementRadius,
endorsementHeight: S.endorsementHeight,
endorsementPaddingX: S.endorsementPaddingX,
inputProps: {
...S.type === "number" ? {
min: S.min,
max: S.max,
step: S.step
} : {
minLength: S.minLength,
maxLength: S.maxLength,
pattern: S.pattern
}
}
}
))
}
)
},
S.key
);
}),
l && /* @__PURE__ */ u(
Dn,
{
sx: {
whiteSpace: "nowrap",
height: "35px",
px: 1.5,
py: 0,
borderBottom: "1px solid #E5E6EB",
textAlign: "center"
},
children: /* @__PURE__ */ u(
yi,
{
size: "small",
color: "error",
onClick: () => w(Q),
sx: { width: "20px", height: "20px" },
children: /* @__PURE__ */ u(_m, { sx: { fontSize: "20px" } })
}
)
}
)
] }, L.id);
}) })
]
}
)
}
)
}
)
] })
}
);
}, Im = ({
name: e,
control: t,
items: n,
sx: r,
cardSx: i
}) => /* @__PURE__ */ u(q, { sx: { display: "flex", flexDirection: "column", gap: 1, ...r }, children: n.map((a) => {
const o = !!a.leftAction, s = !!a.rightAction, l = !!(a.header || a.chipText), c = a.leftAction, m = a.rightAction;
return /* @__PURE__ */ U(
q,
{
sx: {
border: "1px solid #DDDDDD",
borderRadius: "8px",
height: "40px",
display: "flex",
alignItems: "center",
justifyContent: "space-between",
px: 1,
...i
},
children: [
o && c && /* @__PURE__ */ u(q, { sx: { display: "flex", alignItems: "center", gap: 1, flexShrink: 0 }, children: /* @__PURE__ */ u(
Pe,
{
name: c.name,
control: t,
defaultValue: !1,
render: ({ field: h }) => /* @__PURE__ */ u(
on,
{
label: c.label || "",
checked: !!h.value,
onChange: h.onChange,
sx: { margin: 0 }
}
)
}
) }),
l && /* @__PURE__ */ U(q, { sx: { display: "flex", alignItems: "center", gap: 1, flex: o || s ? 1 : "none", ml: o ? 1 : 0 }, children: [
a.header && /* @__PURE__ */ u(
se,
{
variant: "body2",
sx: {
fontSize: "12px",
color: "rgba(0,0,0,0.87)",
fontWeight: 400
},
children: a.header
}
),
a.chipText && /* @__PURE__ */ u(
q,
{
sx: {
bgcolor: "rgba(26,26,26,0.1)",
px: 1.5,
py: 0.375,
borderRadius: "4px",
fontSize: "12px",
color: "rgba(26,26,26,0.8)"
},
children: a.chipText
}
)
] }),
s && m && /* @__PURE__ */ u(q, { sx: { display: "flex", alignItems: "center", gap: 0.5, flexShrink: 0, ml: "auto" }, children: /* @__PURE__ */ u(
Pe,
{
name: m.name,
control: t,
defaultValue: !1,
render: ({ field: h }) => /* @__PURE__ */ u(
xa,
{
label: m.label,
checked: !!h.value,
onChange: h.onChange,
sx: { margin: 0 }
}
)
}
) }),
!o && !s && !l && /* @__PURE__ */ u(q, { sx: { width: "100%", height: "100%" } })
]
},
a.id
);
}) }), Ml = Xe(/* @__PURE__ */ u("path", {
d: "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"
}), "Delete"), qi = Xe(/* @__PURE__ */ u("path", {
d: "M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"
}), "HelpOutline"), Mm = [
{ label: "Interest-only", value: "interest-only" },
{ label: "Principal moratorium", value: "principal-moratorium" },
{ label: "EMI", value: "emi" },
{ label: "Equal-principal", value: "equal-principal" },
{ label: "Balloon", value: "balloon" },
{ label: "Bullet", value: "bullet" },
{ label: "Step-up/Down", value: "step-up-down" },
{ label: "Seasonal skips", value: "seasonal-skips" },
{ label: "Custom fixed installment", value: "custom-fixed" },
{ label: "Full payment holiday (no billing)", value: "payment-holiday" }
], Wi = [
{ label: "Accrue & capitalize at end of phase", value: "accrue-capitalize" },
{
label: "Accrue & bill in first period after phase",
value: "accrue-bill-next"
},
{ label: "Accrue & forgive at phase end", value: "accrue-forgive" }
], qg = ({
phase: e,
index: t,
onUpdate: n,
onDelete: r,
months: i = [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
],
disabled: a = !1,
sx: o
}) => {
const [s, l] = at(
e.seasonalMonths || []
), c = (d) => {
const g = s.includes(d) ? s.filter((x) => x !== d) : [...s, d];
l(g), n(e.id, { seasonalMonths: g });
}, m = (() => {
const d = e.min || 0;
return d < 0 ? "Min cannot be negative." : Number.isInteger(d) ? null : "Use whole periods.";
})(), h = (() => {
const d = e.min || 0, g = e.max || 0;
return Number.isInteger(g) ? g < d ? "Max must be ≥ Min." : null : "Use whole periods.";
})();
return /* @__PURE__ */ u(
st,
{
sx: {
border: "2px solid",
borderColor: he.divider,
position: "relative",
...o
},
children: /* @__PURE__ */ U(jc, { sx: { p: 2 }, children: [
/* @__PURE__ */ U(q, { sx: { mb: 1, display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
/* @__PURE__ */ U(
q,
{
sx: {
display: "flex",
gap: 0.5,
alignItems: "center"
},
children: [
/* @__PURE__ */ u(q, { children: /* @__PURE__ */ u(Dl, {}) }),
/* @__PURE__ */ u(
Il,
{
label: t + 1,
size: "small"
}
)
]
}
),
/* @__PURE__ */ u(
yi,
{
onClick: () => r(e.id),
disabled: a,
sx: {
color: he.error.main,
"&:hover": {
bgcolor: Bi[50]
}
},
size: "small",
children: /* @__PURE__ */ u(Ml, { fontSize: "small" })
}
)
] }),
/* @__PURE__ */ u(q, { sx: { display: "flex", alignItems: "flex-start", gap: 1.5 }, children: /* @__PURE__ */ U(q, { sx: { flex: 1, display: "grid", gap: 1.5 }, children: [
/* @__PURE__ */ U(q, { sx: { display: "flex", gap: 2, mb: 0.5 }, children: [
/* @__PURE__ */ u(q, { sx: { flex: 0.5, display: "grid", gap: 1 }, children: /* @__PURE__ */ u(
Ga,
{
labelText: "Phase type",
value: e.type,
onChange: (d) => n(e.id, { type: d.target.value }),
options: Mm,
disabled: a
}
) }),
/* @__PURE__ */ U(q, { sx: { display: "grid", gap: 1, flex: 0.5 }, children: [
/* @__PURE__ */ u(
se,
{
variant: "caption",
sx: {
fontSize: "12px",
color: he.text.secondary
},
children: "Allocation priority (1–9)"
}
),
/* @__PURE__ */ u(
xt,
{
type: "number",
value: e.priority || 5,
onChange: (d) => {
const g = parseInt(d.target.value) || 5;
n(e.id, {
priority: Math.min(9, Math.max(1, g))
});
},
inputProps: { min: 1, max: 9 },
disabled: a,
sx: { textAlign: "center" }
}
)
] })
] }),
/* @__PURE__ */ U(
q,
{
sx: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 2 },
children: [
/* @__PURE__ */ u(q, { sx: { display: "grid", gap: 1 }, children: /* @__PURE__ */ u(
xt,
{
labelText: "Min periods",
type: "number",
value: e.min || 0,
onChange: (d) => {
const g = parseInt(d.target.value) || 0;
n(e.id, {
min: g,
...e.lockLength ? { max: g } : {}
});
},
inputProps: { min: 0 },
disabled: a,
error: !!m,
helperText: m || void 0
}
) }),
/* @__PURE__ */ u(q, { sx: { display: "grid", gap: 1 }, children: /* @__PURE__ */ u(
xt,
{
labelText: "Max periods",
type: "number",
value: e.lockLength ? e.min : e.max || 0,
onChange: (d) => n(e.id, { max: parseInt(d.target.value) || 0 }),
inputProps: { min: 0 },
disabled: a || e.lockLength,
error: !!h && !e.lockLength,
helperText: e.lockLength ? "Locked to Min" : h || void 0,
sx: e.lockLength ? { opacity: 0.5 } : {}
}
) })
]
}
),
/* @__PURE__ */ U(q, { sx: { display: "flex", gap: 3 }, children: [
/* @__PURE__ */ u(
on,
{
label: "Lock length (fix to Min)",
checked: e.lockLength || !1,
onChange: (d) => n(e.id, {
lockLength: d,
...d ? { max: e.min } : {}
}),
disabled: a
}
),
/* @__PURE__ */ u(
on,
{
label: "Residual fill",
checked: e.residualFill || !1,
onChange: (d) => n(e.id, { residualFill: d }),
disabled: a
}
)
] }),
e.type === "principal-moratorium" && /* @__PURE__ */ U(q, { sx: { display: "grid", gap: 1 }, children: [
/* @__PURE__ */ U(q, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
/* @__PURE__ */ u(se, { variant: "subtitle2", sx: { fontWeight: 500 }, children: "Interest policy during phase" }),
/* @__PURE__ */ u(Hr, { title: "IFRS: interest is recognized via EIR; to not charge customers, accrue then forgive via waiver journal.", children: /* @__PURE__ */ u(
qi,
{
sx: {
fontSize: 14,
color: he.text.secondary,
cursor: "help"
}
}
) })
] }),
/* @__PURE__ */ u(
qn,
{
value: e.interestPolicy || "accrue-capitalize",
onChange: (d) => n(e.id, {
interestPolicy: d
}),
options: Wi,
labelPosition: "none"
}
),
e.interestPolicy === "accrue-forgive" && /* @__PURE__ */ u(
se,
{
variant: "caption",
sx: { color: he.text.secondary, mt: 1 },
children: "Accruals are recognized daily and waived at phase end as contra-revenue; no capitalization."
}
)
] }),
e.type === "balloon" && /* @__PURE__ */ U(q, { sx: { display: "grid", gap: 1.5 }, children: [
/* @__PURE__ */ u(
qn,
{
value: e.balloonType || "percent",
onChange: (d) => n(e.id, {
balloonType: d
}),
options: [
{ label: "Amount", value: "amount" },
{ label: "Percent", value: "percent" }
],
row: !0,
labelPosition: "none"
}
),
e.balloonType === "amount" && /* @__PURE__ */ u(
xt,
{
labelText: "Balloon Amount",
type: "number",
value: e.balloonAmount || "",
onChange: (d) => n(e.id, {
balloonAmount: parseFloat(d.target.value) || 0
}),
placeholder: "Enter amount",
disabled: a
}
),
e.balloonType === "percent" && /* @__PURE__ */ u(
xt,
{
labelText: "Balloon Percent",
type: "number",
value: e.balloonPercent || "",
onChange: (d) => n(e.id, {
balloonPercent: parseFloat(d.target.value) || 0
}),
placeholder: "Enter percent",
inputProps: { max: 100 },
disabled: a
}
)
] }),
e.type === "bullet" && /* @__PURE__ */ u(
se,
{
variant: "caption",
sx: { color: he.text.secondary },
children: "Principal at maturity"
}
),
e.type === "step-up-down" && /* @__PURE__ */ U(
q,
{
sx: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 2 },
children: [
/* @__PURE__ */ u(
xt,
{
labelText: "Step Percent",
type: "number",
value: e.stepPercent || "",
onChange: (d) => n(e.id, {
stepPercent: parseFloat(d.target.value) || 0
}),
placeholder: "e.g., 10",
disabled: a
}
),
/* @__PURE__ */ u(
xt,
{
labelText: "Every N periods",
type: "number",
value: e.stepEveryN || "",
onChange: (d) => n(e.id, {
stepEveryN: parseInt(d.target.value) || 0
}),
placeholder: "e.g., 6",
disabled: a
}
)
]
}
),
e.type === "seasonal-skips" && /* @__PURE__ */ U(q, { sx: { display: "grid", gap: 1.5 }, children: [
/* @__PURE__ */ U(q, { sx: { display: "grid", gap: 1 }, children: [
/* @__PURE__ */ u(se, { variant: "subtitle2", sx: { fontWeight: 500 }, children: "Skip Months" }),
/* @__PURE__ */ u(q, { sx: { display: "flex", flexWrap: "wrap", gap: 1 }, children: i.map((d) => /* @__PURE__ */ u(
Ra,
{
label: d,
size: "small",
onClick: () => !a && c(d),
sx: {
cursor: a ? "default" : "pointer",
bgcolor: s.includes(d) ? he.primary.main : "transparent",
color: s.includes(d) ? he.primary.contrastText : he.text.primary,
border: `1px solid ${he.divider}`,
"&:hover": {
bgcolor: s.includes(d) ? Bi[600] : Bi[50]
}
}
},
d
)) })
] }),
/* @__PURE__ */ U(q, { sx: { display: "grid", gap: 1 }, children: [
/* @__PURE__ */ U(q, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
/* @__PURE__ */ u(se, { variant: "subtitle2", sx: { fontWeight: 500 }, children: "Interest policy during phase" }),
/* @__PURE__ */ u(Hr, { title: "IFRS: interest is recognized via EIR; to not charge customers, accrue then forgive via waiver journal.", children: /* @__PURE__ */ u(
qi,
{
sx: {
fontSize: 14,
color: he.text.secondary,
cursor: "help"
}
}
) })
] }),
/* @__PURE__ */ u(
qn,
{
value: e.interestPolicy || "accrue-capitalize",
onChange: (d) => n(e.id, {
interestPolicy: d
}),
options: Wi,
labelPosition: "none"
}
),
e.interestPolicy === "accrue-forgive" && /* @__PURE__ */ u(
se,
{
variant: "caption",
sx: { color: he.text.secondary },
children: "Accruals are recognized daily and waived at phase end as contra-revenue; no capitalization."
}
)
] })
] }),
e.type === "custom-fixed" && /* @__PURE__ */ u(
xt,
{
labelText: "Fixed Installment Amount",
type: "number",
value: e.customAmount || "",
onChange: (d) => n(e.id, {
customAmount: parseFloat(d.target.value) || 0
}),
placeholder: "Enter amount",
disabled: a
}
),
e.type === "payment-holiday" && /* @__PURE__ */ U(q, { sx: { display: "grid", gap: 1 }, children: [
/* @__PURE__ */ U(q, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
/* @__PURE__ */ u(se, { variant: "subtitle2", sx: { fontWeight: 500 }, children: "Interest policy during phase" }),
/* @__PURE__ */ u(Hr, { title: "IFRS: interest is recognized via EIR; to not charge customers, accrue then forgive via waiver journal.", children: /* @__PURE__ */ u(
qi,
{
sx: {
fontSize: 14,
color: he.text.secondary,
cursor: "help"
}
}
) })
] }),
/* @__PURE__ */ u(
qn,
{
value: e.holidayInterestTreatment || "accrue-capitalize",
onChange: (d) => n(e.id, {
holidayInterestTreatment: d
}),
options: Wi,
labelPosition: "none"
}
),
e.holidayInterestTreatment === "accrue-forgive" && /* @__PURE__ */ u(
se,
{
variant: "caption",
sx: { color: he.text.secondary },
children: "Accruals are recognized daily and waived at phase end as contra-revenue; no capitalization."
}
)
] })
] }) })
] })
}
);
};
function jm(e, t) {
return {
field: `${e}-field-${t}`,
label: `${e}-label-${t}`,
input: `${e}-input-${t}`,
error: `${e}-error-${t}`,
section: `${e}-section-${t}`,
upload: `${e}-upload-${t}`,
preview: `${e}-preview-${t}`,
remove: `${e}-remove-${t}`,
replace: `${e}-replace-${t}`,
option: (n) => `${e}-option-${t}-${String(n)}`,
submit: `${e}-submit`,
cancel: `${e}-cancel`
};
}
function zm(e, t) {
if (!e || !t.name) return null;
const n = t.automation;
if (n != null && n.skip) return null;
const r = jm(e, t.name);
return {
field: (n == null ? void 0 : n.fieldTestId) || r.field,
label: (n == null ? void 0 : n.labelTestId) || r.label,
input: t.testId || (n == null ? void 0 : n.inputTestId) || r.input,
error: (n == null ? void 0 : n.errorTestId) || r.error,
section: r.section,
upload: r.upload,
preview: r.preview,
remove: r.remove,
replace: r.replace,
option: r.option
};
}
async function Nm(e, t, n, r) {
try {
const {
endpoint: i,
method: a = "GET",
valueField: o = "value",
labelField: s = "label",
headers: l = {},
params: c = {},
body: m,
transform: h,
passThroughFields: d
} = e;
let g = i;
if (t && !i.startsWith("http") && (g = `${t}${i.startsWith("/") ? i : `/${i}`}`), r) {
const v = /\{([^}]+)\}/g;
g = g.replace(v, (w, P) => {
const M = r[P];
return M != null ? encodeURIComponent(String(M)) : "";
}), g = g.replace(/\?&/g, "?").replace(/&&/g, "&").replace(/\?$/g, "");
}
const x = new URLSearchParams();
Object.entries(c).forEach(([v, w]) => {
w != null && x.append(v, String(w));
}), x.toString() && (g += `${g.includes("?") ? "&" : "?"}${x.toString()}`);
try {
const v = /^https?:\/\//i.test(g), w = new URL(g, v ? void 0 : "http://local.placeholder"), P = Array.from(w.searchParams.entries());
for (const [M, I] of P)
(I === "" || I === "undefined" || I === "null") && w.searchParams.delete(M);
v ? g = w.toString() : g = w.pathname + (w.search ? w.search : ""), g = g.replace(/\?&/g, "?").replace(/&&/g, "&").replace(/\?$/g, "");
} catch {
}
const f = {
"Content-Type": "application/json",
...n,
...l
}, E = {
method: a,
headers: f
};
(a === "POST" || a === "PUT") && m && (E.body = JSON.stringify(m));
const y = await fetch(g, E);
if (!y.ok)
throw new Error(`API request failed: ${y.status} ${y.statusText}`);
const T = await y.json();
if (h)
return h(Array.isArray(T) ? T : T.data || T);
const k = Array.isArray(T) ? T : T.data || T;
if (!Array.isArray(k))
throw new Error("API response is not an array");
return k.map((v) => {
const w = {
label: v[s] || v.name || v.title || String(v[o] || ""),
value: v[o] || v.id || v.value || ""
}, P = Array.isArray(d) ? d : void 0;
if (Array.isArray(P))
for (const M of P)
v[M] !== void 0 && (w[M] = v[M]);
return w;
});
} catch (i) {
throw console.error("API fetch error:", i), new Error(`Failed to fetch data: ${i instanceof Error ? i.message : "Unknown error"}`);
}
}
function Lm(e, t, n, r, i = !1) {
const a = Ie(() => {
if (!(e != null && e.dependsOn) || !r) return null;
const s = r[e.dependsOn];
return s !== void 0 ? s : null;
}, [e == null ? void 0 : e.dependsOn, r]), o = Ie(() => [
"api-data",
e == null ? void 0 : e.endpoint,
e == null ? void 0 : e.method,
e == null ? void 0 : e.valueField,
e == null ? void 0 : e.labelField,
t,
a,
// primary dependency value for gating
r ? JSON.stringify(r) : null
], [e == null ? void 0 : e.endpoint, e == null ? void 0 : e.method, e == null ? void 0 : e.valueField, e == null ? void 0 : e.labelField, t, a, r]);
return _u({
queryKey: o,
queryFn: () => {
if (!e)
throw new Error("API config is required");
return Nm(e, t, n, r);
},
enabled: !!i && !!e,
// Only fetch when explicitly enabled (user interaction)
staleTime: 15 * 60 * 1e3,
// 15 minutes
gcTime: 30 * 60 * 1e3,
// 30 minutes
retry: 3,
retryDelay: (s) => Math.min(1e3 * 2 ** s, 3e4),
refetchOnWindowFocus: !1,
refetchOnReconnect: !0,
refetchOnMount: !1
// Don't refetch on mount if we already have data
});
}
function Ln(e) {
return !!(e.apiConfig || e.api_endpoint);
}
function jl(e) {
return e.apiConfig ? e.apiConfig : e.api_endpoint ? {
endpoint: e.api_endpoint,
method: e.api_method || "GET",
valueField: e.value_field || "value",
labelField: e.label_field || "label",
dependsOn: e.depends_on,
conditional: e.conditional
} : null;
}
function Wg(e, t) {
const n = jl(e);
if (!(n != null && n.conditional) && !e.conditional)
return !0;
if (n != null && n.dependsOn || e.depends_on) {
const r = (n == null ? void 0 : n.dependsOn) || e.depends_on;
if (r) {
const i = t[r];
return i != null && i !== "";
}
}
return !0;
}
const zl = ({
field: e,
control: t,
errors: n,
baseUrl: r,
apiHeaders: i,
formData: a,
setValue: o,
testIdPrefix: s,
dateFormat: l
}) => {
const c = n[e.name], m = !!c, h = Ie(
() => zm(s, e),
[s, e]
), d = Ie(
() => h ? {
inputTestId: h.input,
labelTestId: h.label,
errorTestId: h.error,
optionTestId: h.option
} : {},
[h]
), [g, x] = at(!1), f = pt(!1), [E, y] = at(!1), [T, k] = at(!1), [v, w] = at(!1), P = pt(null), M = pt(null), I = () => {
var z;
const B = e.required;
if (typeof B == "function")
try {
return !!B(a || {});
} catch {
return !1;
}
if (B !== void 0) return !!B;
const G = (z = e.validation) == null ? void 0 : z.required;
if (typeof G == "function")
try {
return !!G(a || {});
} catch {
return !1;
}
return G !== void 0 ? !!G : !1;
}, N = (B) => I() ? `${B} *` : B, p = () => {
if (e.value !== void 0) {
if (typeof e.value == "function")
try {
return e.value(a || {});
} catch {
return "";
}
return e.value;
}
return e.type === "checkbox" ? !1 : e.type === "select" && e.default ? e.default : e.type === "autocomplete" && e.multiple ? [] : "";
}, R = pt(void 0);
ot(() => {
const B = e.value;
if (typeof B != "function" || !o) return;
let G;
try {
G = B(a || {});
} catch {
return;
}
const z = a ? a[e.name] : void 0;
if (R.current === void 0 && (R.current = G), z === void 0 || z === R.current)
try {
o(e.name, G, {
shouldValidate: !0,
shouldDirty: !1
}), R.current = G;
} catch {
}
}, [
JSON.stringify(
Array.isArray(e.valueDeps) && a ? e.valueDeps.reduce(
(B, G) => ({ ...B, [G]: a[G] }),
{}
) : a || {}
),
e.name
]);
const $ = Ie(() => {
const B = jl(e);
return B && Array.isArray(e.passThroughFields) && (B.passThroughFields = e.passThroughFields), B;
}, [
e.apiConfig,
e.api_endpoint,
e.api_method,
e.value_field,
e.label_field,
e.depends_on,
e.conditional,
e.passThroughFields
]), Z = pt(null), j = $ != null && $.dependsOn ? a == null ? void 0 : a[$.dependsOn] : null;
ot(() => {
$ != null && $.dependsOn && (Z.current = j);
}, [$ == null ? void 0 : $.dependsOn, j]);
const re = Ie(() => {
const B = e.showWhen;
if (typeof B == "function")
try {
return !!B(a || {});
} catch {
return !0;
}
if (B && typeof B == "object") {
const G = B.field, z = B.equals, ye = B.in, Oe = G ? (a || {})[G] : void 0;
if (G && typeof z < "u") return Oe === z;
if (G && Array.isArray(ye)) return ye.includes(Oe);
}
return !0;
}, [e.showWhen, a]), L = we(() => {
const B = e.dynamicEndorsement;
if (typeof B == "function")
try {
return B(a || {});
} catch {
return e.endorsementText;
}
return e.endorsementText;
}, [e, a]), Q = we(() => {
const B = e.endAdornment, G = e.endAdornmentSwitch, z = e.endAdornmentCheckbox;
if (G)
return /* @__PURE__ */ u(
Pe,
{
name: G,
control: t,
defaultValue: e.endAdornmentSwitchDefault ?? !1,
render: ({ field: ye }) => /* @__PURE__ */ u(
Vs,
{
checked: ye.value || !1,
onChange: (Oe) => {
ye.onChange(Oe.target.checked), e.endAdornmentSwitchOnChange && e.endAdornmentSwitchOnChange(
Oe.target.checked,
a,
o
);
},
disabled: e.endAdornmentSwitchDisabled,
size: e.endAdornmentSwitchSize || "small",
sx: e.endAdornmentSwitchSx
}
)
}
);
if (z)
return /* @__PURE__ */ u(
Pe,
{
name: z,
control: t,
defaultValue: e.endAdornmentCheckboxDefault ?? !1,
render: ({ field: ye }) => /* @__PURE__ */ u(
on,
{
label: "",
checked: ye.value || !1,
onChange: ye.onChange,
disabled: e.endAdornmentCheckboxDisabled,
sx: e.endAdornmentCheckboxSx
}
)
}
);
if (typeof B == "function")
try {
return B(a || {}, { control: t, setValue: o });
} catch {
return;
}
return B;
}, [e, a, t, o]), V = Ie(() => !!(g && Ln(e) && (!($ != null && $.dependsOn) || j)), [g, e, $ == null ? void 0 : $.dependsOn, j]), K = Ie(() => {
const B = {};
if (!a) return B;
const G = ($ == null ? void 0 : $.endpoint) || (e == null ? void 0 : e.api_endpoint);
if (G && typeof G == "string") {
const z = G.match(/\{([^}]+)\}/g) || [];
for (const ye of z) {
const Oe = ye.slice(1, -1), Ye = a[Oe];
Ye !== void 0 && (B[Oe] = Ye);
}
}
if ($ != null && $.dependsOn) {
const z = $.dependsOn, ye = a[z];
ye !== void 0 && (B[z] = ye);
}
return B;
}, [
$ == null ? void 0 : $.endpoint,
e == null ? void 0 : e.api_endpoint,
$ == null ? void 0 : $.dependsOn,
a
]), {
data: S = [],
isLoading: D,
error: ne
} = Lm(
$,
r,
i,
K,
// Only pass dependent values, not entire formData
V
), le = we(() => {
Ln(e) && !f.current && (f.current = !0, x(!0));
}, [e]), ae = we(() => {
Ln(e) && !f.current && (f.current = !0, x(!0));
}, [e]);
ot(() => {
if (Ln(e) && !f.current) {
const B = a == null ? void 0 : a[e.name];
B != null && B !== "" && (f.current = !0, x(!0));
}
}, [e, a]), ot(() => {
Ln(e) && ($ != null && $.dependsOn) && (j != null && `${j}` != "" ? (f.current = !0, x(!0)) : (f.current = !1, x(!1)));
}, [$ == null ? void 0 : $.dependsOn, j]);
const de = we((B) => {
if (typeof B == "function")
try {
const G = B(a || {});
return de(G);
} catch {
return [];
}
return B ? Array.isArray(B) ? B.map((G) => {
if (G && typeof G == "object") {
const z = G.value ?? G.id ?? G.key ?? void 0, ye = G.label ?? G.name ?? G.title ?? (z !== void 0 ? String(z) : "");
return { label: String(ye ?? ""), value: String(z ?? ye ?? "") };
}
return { label: String(G), value: String(G) };
}) : typeof B == "object" ? Object.keys(B).map((G) => ({
value: String(G),
label: String(B[G])
})) : [] : [];
}, [a]), H = we(() => Ln(e) ? Array.isArray(S) ? S : [] : e.type === "select" || e.type === "toggle" || e.type === "radio" || e.type === "autocomplete" ? de(e.options) : [], [e, S, de]), ie = () => {
var B, G, z, ye, Oe, Ye;
switch (e.type) {
case "title":
return /* @__PURE__ */ u(
se,
{
variant: e.variant || "h4",
component: "h1",
color: e.color,
align: e.align || "left",
sx: { mb: 3, fontWeight: 600, ...e.sx },
children: e.label
}
);
case "section":
return /* @__PURE__ */ u(
se,
{
variant: e.variant || "h6",
component: "h3",
color: e.color,
align: e.align || "left",
"data-testid": h == null ? void 0 : h.section,
sx: { mb: 2, fontWeight: 600, color: "text.primary", ...e.sx },
children: e.label
}
);
case "finuiHeader":
const It = e.actionName, qe = e.actionComponent, Je = e.actionLabel, Et = (A) => /* @__PURE__ */ u(
Om,
{
title: e.title || e.label,
subtitle: e.subtitle,
align: e.align || "left",
sx: e.sx,
actions: A ?? e.actions
}
), lt = (A) => {
if (e.cardWrap) {
const W = { ...{
px: 2,
py: 1,
boxShadow: "none",
border: "1px solid #DDDDDD"
}, ...e.cardSx };
return /* @__PURE__ */ u(st, { sx: W, ...e.cardProps, children: A });
}
return A;
};
return lt(
It && qe ? /* @__PURE__ */ u(
Pe,
{
name: It,
control: t,
defaultValue: e.value ?? !1,
render: ({ field: A }) => Et(
qe === "switch" ? /* @__PURE__ */ u(
xa,
{
label: Je,
checked: !!A.value,
onChange: A.onChange
}
) : /* @__PURE__ */ u(
on,
{
label: Je || "",
checked: !!A.value,
onChange: A.onChange
}
)
)
}
) : Et()
);
case "tabs":
return /* @__PURE__ */ u(
Pe,
{
name: e.name,
control: t,
defaultValue: e.defaultValue ?? (typeof ((G = (B = e.items) == null ? void 0 : B[0]) == null ? void 0 : G.value) == "string" || typeof ((ye = (z = e.items) == null ? void 0 : z[0]) == null ? void 0 : ye.value) == "number" ? (Ye = (Oe = e.items) == null ? void 0 : Oe[0]) == null ? void 0 : Ye.value : 0),
render: ({ field: A }) => {
const F = e.items || [], W = F.map((Y, X) => ({
label: Y.label,
value: typeof Y.value == "string" || typeof Y.value == "number" ? Y.value : X,
content: Y.content,
disabled: Y.disabled
})), J = A.value, ue = (() => {
if (typeof J == "string" || typeof J == "number") {
const Y = F.findIndex(
(X, ve) => typeof X.value == "string" || typeof X.value == "number" ? X.value === J : ve === J
);
return Y >= 0 ? Y : 0;
}
return Number(J) || 0;
})(), me = F[ue] || {};
return /* @__PURE__ */ U(q, { children: [
/* @__PURE__ */ u(
Pm,
{
value: A.value,
onChange: A.onChange,
items: W,
ariaLabel: e.ariaLabel || e.label,
sx: e.sx,
tabSx: e.tabSx
}
),
Array.isArray(me.fields) && me.fields.length > 0 && (() => {
const Y = me.fields, X = [];
let ve = [];
for (const Re of Y)
Re.type === "section" && ve.length > 0 ? (X.push(ve), ve = [Re]) : ve.push(Re);
ve.length > 0 && X.push(ve);
const $e = {
p: 2,
boxShadow: "0px 1px 4px 0px #00000029",
background: "#FFFFFF",
borderRadius: "6px",
display: "grid",
gridTemplateColumns: "repeat(12, 1fr)",
gap: 2,
width: "100%",
mt: 1
};
return /* @__PURE__ */ u(q, { sx: { mt: 1 }, children: X.map((Re, Ke) => {
const Le = Re.find(
(ct) => ct.type === "section"
), et = (Le == null ? void 0 : Le.cardWrap) !== !1, oe = /* @__PURE__ */ u(mi, { children: Re.map((ct) => {
const ut = ct.showWhen;
if (ut)
try {
if (typeof ut == "function") {
if (!ut(a || {}))
return null;
} else if (typeof ut == "object") {
const _n = ut.field, eo = ut.equals, to = ut.in, no = _n ? (a || {})[_n] : void 0;
if (_n && typeof eo < "u" && no !== eo || _n && Array.isArray(to) && !to.includes(no))
return null;
}
} catch {
}
const Pn = Math.min(
Math.max(ct.col ?? 12, 1),
12
);
return /* @__PURE__ */ u(
q,
{
sx: { gridColumn: `span ${Pn}` },
children: /* @__PURE__ */ u(
zl,
{
field: ct,
control: t,
errors: n,
baseUrl: r,
apiHeaders: i,
formData: a,
setValue: o,
testIdPrefix: s
}
)
},
ct.name
);
}) });
return et ? /* @__PURE__ */ u(
st,
{
sx: {
...$e,
...(Le == null ? void 0 : Le.cardSx) || {}
},
...(Le == null ? void 0 : Le.cardProps) || {},
children: oe
},
`tab-group-${Ke}`
) : /* @__PURE__ */ u(
q,
{
sx: {
display: "grid",
gridTemplateColumns: "repeat(12, 1fr)",
gap: 2,
width: "100%",
mt: 1
},
children: oe
},
`tab-group-${Ke}`
);
}) });
})()
] });
}
}
);
case "grid":
const Mt = e.defaultRows || [];
return /* @__PURE__ */ u(q, { children: /* @__PURE__ */ u(
Pe,
{
name: e.name,
control: t,
defaultValue: Mt.length > 0 ? Mt : p() || [],
render: () => /* @__PURE__ */ u(
Dm,
{
name: e.name,
columns: e.columns || [],
initialRow: e.initialRow || {},
addLabel: e.addLabel,
showEmptyState: e.showEmptyState,
maxRows: e.maxRows,
hideAddWhenMax: e.hideAddWhenMax,
disableAddWhenMax: e.disableAddWhenMax,
rowDeletable: e.rowDeletable !== !1,
control: t,
setValue: o,
addActions: e.addActions,
emptyTitle: e.emptyTitle,
emptySubtitle: e.emptySubtitle,
emptyCardSx: e.emptyCardSx,
sx: e.sx,
rowSelectionMode: e.rowSelectionMode,
rowSelectionKey: e.rowSelectionKey,
dateFormat: l
}
)
}
) });
case "listcards":
return /* @__PURE__ */ u(
Im,
{
name: e.name,
control: t,
items: e.items || [],
sx: e.sx,
cardSx: e.cardSx
}
);
case "dragdroplist":
return /* @__PURE__ */ u(
Pe,
{
name: e.name,
control: t,
defaultValue: e.items || [],
render: ({ field: A }) => {
const F = e, W = A.value || F.items || [], J = typeof F.getId == "function" ? F.getId : typeof F.getId == "string" ? (Y) => Y[F.getId] : (Y) => Y.id ?? Y._id ?? Y.key ?? String(Y), ue = typeof F.getText == "function" ? F.getText : typeof F.getText == "string" ? (Y) => Y[F.getText] ?? String(Y) : (Y) => Y.text ?? Y.label ?? Y.name ?? Y.title ?? String(Y), me = (() => {
if (typeof F.chipText == "function")
return F.chipText;
if (typeof F.chipText == "string")
return W.length > 0 && W[0] && F.chipText in W[0] ? (Y, X) => Y[F.chipText] ?? void 0 : F.chipText;
})();
return /* @__PURE__ */ u(
Fm,
{
items: W,
getId: J,
onReorder: (Y) => {
A.onChange(Y);
},
header: F.header,
disabled: e.disabled,
sx: F.sx,
chipText: me,
helperText: F.helperText || (m ? c == null ? void 0 : c.message : void 0),
getText: ue,
showIndex: F.showIndex !== !1,
showLeftIcon: F.showLeftIcon !== !1,
renderItem: F.renderItem
}
);
}
}
);
case "mobile":
return /* @__PURE__ */ u(
Pe,
{
name: e.name,
control: t,
defaultValue: p(),
render: ({ field: A }) => {
const F = e;
return /* @__PURE__ */ u(
Cm,
{
...A,
...d,
id: e.id,
name: e.name,
labelText: e.labelPosition === "top" ? N(e.label) : void 0,
label: e.labelPosition !== "top" ? N(e.label) : void 0,
labelVariant: e.labelVariant,
placeholder: e.placeholder,
disabled: e.disabled,
hasError: m,
helperText: (c == null ? void 0 : c.message) || F.helperText,
dialCodes: F.dialCodes,
defaultDialCode: F.defaultDialCode,
mobilePrefixes: F.mobilePrefixes,
storeFormat: F.storeFormat,
phoneExamples: F.phoneExamples
}
);
}
}
);
case "text":
case "email":
case "password":
case "tel":
case "textarea":
return /* @__PURE__ */ u(
Pe,
{
name: e.name,
control: t,
defaultValue: p(),
render: ({ field: A }) => e.type === "textarea" ? /* @__PURE__ */ u(
Tm,
{
...A,
...d,
labelText: e.labelPosition === "top" ? N(e.label) : void 0,
label: e.labelPosition !== "top" ? N(e.label) : void 0,
labelVariant: e.labelVariant,
placeholder: e.placeholder,
disabled: e.disabled,
hasError: m,
helperText: (c == null ? void 0 : c.message) || e.helperText
}
) : /* @__PURE__ */ u(
xt,
{
...A,
...d,
id: e.id,
labelText: e.labelPosition === "top" ? N(e.label) : void 0,
label: e.labelPosition !== "top" ? N(e.label) : void 0,
endAdornment: Q(),
endorsementText: L(),
endorsementBg: e.endorsementBg,
endorsementColor: e.endorsementColor,
endorsementRadius: e.endorsementRadius,
endorsementHeight: e.endorsementHeight,
endorsementPaddingX: e.endorsementPaddingX,
labelVariant: e.labelVariant,
type: e.type === "password" ? E ? "text" : "password" : e.type,
placeholder: e.placeholder,
disabled: e.disabled,
hasError: m,
helperText: (c == null ? void 0 : c.message) || e.helperText,
InputProps: e.type === "password" ? {
endAdornment: /* @__PURE__ */ u(Tl, { position: "end", children: /* @__PURE__ */ u(
Qr,
{
"aria-label": "toggle password visibility",
onClick: () => y((F) => !F),
edge: "end",
children: E ? /* @__PURE__ */ u(os, {}) : /* @__PURE__ */ u(as, {})
}
) })
} : void 0
}
)
}
);
case "number":
return /* @__PURE__ */ u(
Pe,
{
name: e.name,
control: t,
defaultValue: p(),
render: ({ field: A }) => /* @__PURE__ */ u(
xt,
{
...A,
...d,
id: e.id,
labelText: e.labelPosition === "top" ? N(e.label) : void 0,
label: e.labelPosition !== "top" ? N(e.label) : void 0,
endAdornment: Q(),
endorsementText: L(),
endorsementBg: e.endorsementBg,
endorsementColor: e.endorsementColor,
endorsementRadius: e.endorsementRadius,
endorsementHeight: e.endorsementHeight,
endorsementPaddingX: e.endorsementPaddingX,
labelVariant: e.labelVariant,
type: "number",
placeholder: e.placeholder,
disabled: e.disabled,
hasError: m,
helperText: (c == null ? void 0 : c.message) || e.helperText,
inputProps: {
min: e.min,
max: e.max
}
}
)
}
);
case "select":
const ce = H();
return /* @__PURE__ */ u(
Pe,
{
name: e.name,
control: t,
defaultValue: p(),
render: ({ field: A }) => {
const F = typeof e.disabled == "function" ? !!e.disabled(a || {}) : !!e.disabled, W = e.disableWhenEmptyOptions === !0 && Array.isArray(ce) && ce.length === 0, J = F || W || D, ue = A.value, me = (() => {
if (Array.isArray(ce) && ce.length > 0) {
const Y = ce.find(
(X) => String(X == null ? void 0 : X.value) === String(ue)
);
return Y ? Y.value : ue;
}
return ue;
})();
return /* @__PURE__ */ u(
Ga,
{
...d,
labelText: e.labelPosition === "top" ? N(e.label) : void 0,
label: e.labelPosition !== "top" && e.labelPosition !== "none" ? N(e.label) : void 0,
labelVariant: e.labelVariant,
value: me,
onChange: A.onChange,
options: ce,
disabled: J,
placeholder: e.labelPosition === "inner" || e.labelPosition === "none" || !e.labelPosition ? e.placeholder || (e.labelPosition === "none" ? N(e.label) : void 0) : e.placeholder,
loading: D,
error: m || !!ne,
helperText: (c == null ? void 0 : c.message) || (ne == null ? void 0 : ne.message) || e.helperText,
onOpen: le
}
);
}
}
);
case "checkbox":
return /* @__PURE__ */ u(
Pe,
{
name: e.name,
control: t,
defaultValue: p(),
render: ({ field: A }) => /* @__PURE__ */ u(
on,
{
...d,
label: N(e.label),
checked: !!A.value,
disabled: e.disabled,
onChange: A.onChange
}
)
}
);
case "toggle":
return /* @__PURE__ */ u(
Pe,
{
name: e.name,
control: t,
defaultValue: p(),
render: ({ field: A }) => /* @__PURE__ */ u(
qn,
{
label: N(e.label),
labelPosition: e.labelPosition === "none" ? "none" : "top",
labelVariant: e.labelVariant,
value: A.value,
options: e.options || [],
row: !0,
onChange: A.onChange
}
)
}
);
case "radio":
return /* @__PURE__ */ u(
Pe,
{
name: e.name,
control: t,
defaultValue: p(),
render: ({ field: A }) => /* @__PURE__ */ u(
qn,
{
label: N(e.label),
labelPosition: e.labelPosition === "none" ? "none" : "top",
labelVariant: e.labelVariant,
value: A.value,
options: e.options || [],
row: e.row === !0,
groupPadding: e.groupPadding,
itemGap: e.itemGap,
helperText: e.helperText,
onChange: A.onChange
}
)
}
);
case "checkboxGroup":
return /* @__PURE__ */ u(
Pe,
{
name: e.name,
control: t,
defaultValue: p() || [],
render: ({ field: A }) => /* @__PURE__ */ u(
km,
{
label: N(e.label),
labelPosition: e.labelPosition === "none" ? "none" : "top",
labelVariant: e.labelVariant,
value: Array.isArray(A.value) ? A.value : [],
options: e.options || [],
row: e.row,
groupPadding: e.groupPadding,
itemGap: e.itemGap,
helperText: e.helperText,
onChange: A.onChange,
disabled: e.disabled
}
)
}
);
case "switch":
return /* @__PURE__ */ u(
Pe,
{
name: e.name,
control: t,
defaultValue: p(),
render: ({ field: A }) => /* @__PURE__ */ u(
xa,
{
label: N(e.label),
checked: !!A.value,
disabled: e.disabled,
onChange: A.onChange
}
)
}
);
case "autocomplete":
const yt = H(), O = !!((typeof e.disabled == "function" ? e.disabled(a || {}, { options: yt, isLoading: D, error: ne }) : e.disabled) || e.disableWhenEmptyOptions === !0 && Array.isArray(yt) && yt.length === 0 || D || $ != null && $.dependsOn && !j);
return /* @__PURE__ */ u(
Pe,
{
name: e.name,
control: t,
defaultValue: p(),
render: ({ field: A }) => {
const F = A.value, W = e.multiple === !0, J = ($ == null ? void 0 : $.valueField) || e.value_field || "value", ue = (Y) => {
if (Y != null) {
if (typeof Y == "string" || typeof Y == "number")
return Y;
if (typeof Y == "object") {
if (Y[J] !== void 0)
return Y[J];
if (Y.value !== void 0)
return Y.value;
if (Y.id !== void 0) return Y.id;
}
}
}, me = (() => {
if (W)
return (Array.isArray(F) ? F : []).map((X) => {
const ve = String(typeof X == "object" ? ue(X) : X);
return yt.find((Re) => {
const Ke = ue(Re);
return Ke !== void 0 && String(Ke) === ve;
}) || null;
}).filter(Boolean);
{
if (F == null || F === "")
return null;
const Y = String(
typeof F == "object" ? ue(F) : F
), X = yt.find((ve) => {
const $e = ue(ve);
return $e !== void 0 && String($e) === Y;
});
return X || null;
}
})();
return /* @__PURE__ */ u(
Em,
{
...d,
id: e.id,
options: yt,
value: me,
multiple: W,
labelText: e.labelPosition === "top" ? N(e.label) : void 0,
label: e.labelPosition !== "top" ? N(e.label) : void 0,
placeholder: O && ($ != null && $.dependsOn) && !j ? `Please select ${$.dependsOn.replace(
/_/g,
" "
)} first` : e.placeholder,
labelVariant: e.labelVariant,
disabled: O,
loading: D,
error: m || !!ne,
helperText: (c == null ? void 0 : c.message) || (ne == null ? void 0 : ne.message) || e.helperText || "",
onOpen: ae,
noOptionsText: O && ($ != null && $.dependsOn) && !j ? `Please select ${$.dependsOn.replace(
/_/g,
" "
)} first` : D ? "Fetching data..." : g && !D && yt.length === 0 ? "No options available" : "Click to load options",
onChange: (Y) => {
const X = ($ == null ? void 0 : $.valueField) || e.value_field || "value";
if (W) {
const $e = (Array.isArray(Y) ? Y : []).map((Re) => typeof Re == "object" && (Re[X] || Re.value || Re.id) || Re);
A.onChange($e);
} else {
let ve;
Y && typeof Y == "object" ? ve = Y[X] || Y.value || Y.id || Y : ve = Y, A.onChange(ve);
const $e = e.selectedAssignments;
if ($e && Y && typeof Y == "object")
for (const [Re, Ke] of Object.entries(
$e
)) {
const Le = Y[Ke];
if (Le !== void 0 && typeof o == "function")
try {
o(Re, Le, {
shouldDirty: !0,
shouldTouch: !0,
shouldValidate: !1
});
} catch {
}
}
}
}
}
);
}
}
);
case "date": {
const A = e.dateFormat ?? l;
return /* @__PURE__ */ u(
Pe,
{
name: e.name,
control: t,
defaultValue: p(),
render: ({ field: F }) => /* @__PURE__ */ u(
_l,
{
name: F.name,
value: F.value,
onChange: F.onChange,
onBlur: F.onBlur,
...d,
id: e.name,
label: N(e.label),
labelPosition: e.labelPosition || "inner",
labelVariant: e.labelVariant,
disabled: e.disabled,
error: m,
helperText: c == null ? void 0 : c.message,
dateFormat: A,
minDate: e.minDate,
maxDate: e.maxDate
}
)
}
);
}
case "image":
return /* @__PURE__ */ u(
Pe,
{
name: e.name,
control: t,
defaultValue: p(),
render: ({ field: A }) => {
const F = A.value || e.defaultValue || e.src;
if (F) {
const X = e.imageUploaded || {}, ve = X.previewText || "Preview", $e = X.removeText || "Remove", Re = X.saveText || "Save logo", Ke = X.showSave !== void 0 ? X.showSave : !!(e.onSave || X.saveText), Le = () => {
if (w(!0), typeof e.onPreview == "function")
try {
e.onPreview(F);
} catch {
}
}, et = () => {
A.onChange(""), typeof e.onRemove == "function" && e.onRemove();
}, oe = () => {
typeof e.onSave == "function" && e.onSave({
url: F,
file: M.current || void 0
});
}, ct = (ut) => {
const Pn = ut.target.files && ut.target.files[0];
if (Pn) {
if (typeof e.onFileSelected == "function")
try {
e.onFileSelected(Pn);
} catch {
}
try {
const _n = URL.createObjectURL(Pn);
A.onChange(_n);
} catch {
}
M.current = Pn, w(!1);
}
};
return /* @__PURE__ */ U(
st,
{
sx: {
display: "flex",
alignItems: "center",
gap: 2,
p: 2,
boxShadow: "0px 1px 4px 0px #00000014",
...X.cardSx
},
children: [
/* @__PURE__ */ u(
"input",
{
type: "file",
ref: P,
accept: Array.isArray(e.accept) ? e.accept.join(",") : e.accept || "image/*",
style: { display: "none" },
onChange: ct
}
),
/* @__PURE__ */ U(
q,
{
sx: { display: "flex", flexDirection: "column", gap: 1 },
children: [
/* @__PURE__ */ u(
q,
{
sx: {
width: "30%",
height: "10%",
display: "flex",
alignItems: "center",
justifyContent: "center",
borderRadius: "6px",
background: "#FFFFFF",
overflow: "hidden",
...X.thumbnailSx
},
children: /* @__PURE__ */ u(
"img",
{
src: F,
alt: e.alt || e.label,
style: { maxWidth: "100%", maxHeight: "100%" }
}
)
}
),
/* @__PURE__ */ U(q, { sx: { flexGrow: 1 }, children: [
/* @__PURE__ */ u(
se,
{
sx: {
fontSize: "12px",
fontWeight: 500,
...X.fileNameSx
},
children: typeof F == "string" ? F.split("/").pop() : "Selected image"
}
),
/* @__PURE__ */ u(
se,
{
sx: { fontSize: "10px", ...X.fileMetaSx },
children: "Image selected"
}
)
] }),
/* @__PURE__ */ U(q, { sx: { display: "flex", gap: 1 }, children: [
/* @__PURE__ */ u(
Ve,
{
type: "button",
sx: { ...X.previewButtonSx },
variant: "outlined",
onClick: Le,
startIcon: /* @__PURE__ */ u(as, {}),
"data-testid": h == null ? void 0 : h.preview,
children: ve
}
),
/* @__PURE__ */ u(
Ve,
{
variant: "outlined",
color: "error",
onClick: et,
sx: { ...X.removeButtonSx },
startIcon: /* @__PURE__ */ u(os, {}),
"data-testid": h == null ? void 0 : h.remove,
children: $e
}
),
Ke && /* @__PURE__ */ u(
Ve,
{
variant: "contained",
onClick: oe,
sx: { ...X.saveButtonSx },
children: Re
}
)
] })
]
}
),
/* @__PURE__ */ U(
zc,
{
open: v,
onClose: () => w(!1),
maxWidth: "md",
fullWidth: !0,
children: [
/* @__PURE__ */ u(Nc, { children: X.previewTitle || "Image preview" }),
/* @__PURE__ */ u(Lc, { children: /* @__PURE__ */ u(
q,
{
sx: {
display: "flex",
alignItems: "center",
justifyContent: "center",
borderRadius: "8px",
border: "1px solid",
borderColor: "divider",
backgroundColor: "background.paper",
p: 1,
minHeight: 260
},
children: /* @__PURE__ */ u(
"img",
{
src: F,
alt: e.alt || e.label,
style: { maxWidth: "100%", maxHeight: 380 }
}
)
}
) }),
/* @__PURE__ */ U(Bc, { children: [
/* @__PURE__ */ u(
Ve,
{
type: "button",
variant: "outlined",
onClick: () => {
var ut;
return (ut = P.current) == null ? void 0 : ut.click();
},
"data-testid": h == null ? void 0 : h.replace,
children: X.replaceText || "Replace logo"
}
),
/* @__PURE__ */ u(
Ve,
{
type: "button",
variant: "contained",
onClick: () => w(!1),
children: X.closeText || "Close"
}
)
] })
]
}
)
]
}
);
}
const W = e.imagePlaceholder || {}, J = W.icon || "upload", ue = P, me = () => {
var X;
try {
(X = ue.current) == null || X.click();
} catch {
}
}, Y = (X) => {
const ve = X.target.files && X.target.files[0];
if (ve) {
typeof e.onFileSelected == "function" && e.onFileSelected(ve);
try {
const $e = URL.createObjectURL(ve);
A.onChange($e);
} catch {
}
M.current = ve;
}
};
return /* @__PURE__ */ U(
st,
{
sx: {
border: "1px dashed",
borderColor: "#CCCCCC",
boxShadow: "none",
p: 2,
textAlign: "center",
color: "primary.main",
...W.sx
},
children: [
/* @__PURE__ */ u(
"input",
{
type: "file",
ref: ue,
accept: Array.isArray(e.accept) ? e.accept.join(",") : e.accept || "image/*",
style: { display: "none" },
onChange: Y
}
),
/* @__PURE__ */ u(
Qr,
{
sx: { borderRadius: "8px", ...W.iconSx },
children: J === "image" ? /* @__PURE__ */ u(
mm,
{
sx: { width: 36, height: 36, color: "primary.main" }
}
) : /* @__PURE__ */ u(
si,
{
sx: { width: 36, height: 36, color: "primary.main" }
}
)
}
),
/* @__PURE__ */ u(
se,
{
sx: {
fontSize: "16px",
fontWeight: 600,
color: "primary.main",
...W.titleSx
},
children: W.title || "Drag & Drop the image here"
}
),
/* @__PURE__ */ u(
se,
{
sx: {
fontSize: "12px",
fontWeight: 400,
color: "primary.main",
...W.subtitleSx
},
children: W.subtitle || ""
}
),
/* @__PURE__ */ u(
Ve,
{
onClick: me,
sx: { my: 2, ...W.buttonSx },
startIcon: /* @__PURE__ */ u(si, {}),
variant: "contained",
disabled: e.disabled,
"data-testid": h == null ? void 0 : h.upload,
children: W.buttonText || "Upload File"
}
),
/* @__PURE__ */ u(
se,
{
sx: {
fontSize: "12px",
fontWeight: 400,
...W.helperTextSx
},
children: W.helperText || e.helperText || ""
}
)
]
}
);
}
}
);
case "component":
return /* @__PURE__ */ u(q, { children: e.render ? typeof e.render == "function" ? (() => {
try {
return e.render(a || {}, {
control: t,
setValue: o
});
} catch {
try {
return e.render({
control: t,
formData: a,
setValue: o
});
} catch {
return e.render();
}
}
})() : e.render : e.content });
default:
return null;
}
}, fe = Ie(() => !e.disabled || e.copyWhenDisabled === !1 ? !1 : !["title", "section", "image", "component"].includes(
e.type
), [e.disabled, e.copyWhenDisabled, e.type]), ge = we(async () => {
try {
const B = a ? a[e.name] : void 0;
let G = "";
B == null ? G = "" : Array.isArray(B) ? G = B.join(", ") : typeof B == "object" ? G = JSON.stringify(B) : G = String(B), await navigator.clipboard.writeText(G), k(!0), window.setTimeout(() => k(!1), 1200);
} catch {
}
}, [a, e.name]);
return /* @__PURE__ */ U(
q,
{
"data-testid": h == null ? void 0 : h.field,
sx: { display: "flex", alignItems: "center", gap: 0.3 },
children: [
/* @__PURE__ */ u(q, { sx: { flexGrow: 1 }, children: re ? ie() : null }),
fe && /* @__PURE__ */ u(
Qr,
{
"aria-label": `copy ${e.label || e.name}`,
onClick: ge,
size: "small",
children: T ? /* @__PURE__ */ u(Qa, { fontSize: "small" }) : /* @__PURE__ */ u(fm, { fontSize: "small" })
}
)
]
}
);
};
var Ui, cs;
function Bm() {
if (cs) return Ui;
cs = 1;
function e(y) {
this._maxSize = y, this.clear();
}
e.prototype.clear = function() {
this._size = 0, this._values = /* @__PURE__ */ Object.create(null);
}, e.prototype.get = function(y) {
return this._values[y];
}, e.prototype.set = function(y, T) {
return this._size >= this._maxSize && this.clear(), y in this._values || this._size++, this._values[y] = T;
};
var t = /[^.^\]^[]+|(?=\[\]|\.\.)/g, n = /^\d+$/, r = /^\d/, i = /[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g, a = /^\s*(['"]?)(.*?)(\1)\s*$/, o = 512, s = new e(o), l = new e(o), c = new e(o);
Ui = {
Cache: e,
split: h,
normalizePath: m,
setter: function(y) {
var T = m(y);
return l.get(y) || l.set(y, function(v, w) {
for (var P = 0, M = T.length, I = v; P < M - 1; ) {
var N = T[P];
if (N === "__proto__" || N === "constructor" || N === "prototype")
return v;
I = I[T[P++]];
}
I[T[P]] = w;
});
},
getter: function(y, T) {
var k = m(y);
return c.get(y) || c.set(y, function(w) {
for (var P = 0, M = k.length; P < M; )
if (w != null || !T) w = w[k[P++]];
else return;
return w;
});
},
join: function(y) {
return y.reduce(function(T, k) {
return T + (g(k) || n.test(k) ? "[" + k + "]" : (T ? "." : "") + k);
}, "");
},
forEach: function(y, T, k) {
d(Array.isArray(y) ? y : h(y), T, k);
}
};
function m(y) {
return s.get(y) || s.set(
y,
h(y).map(function(T) {
return T.replace(a, "$2");
})
);
}
function h(y) {
return y.match(t) || [""];
}
function d(y, T, k) {
var v = y.length, w, P, M, I;
for (P = 0; P < v; P++)
w = y[P], w && (E(w) && (w = '"' + w + '"'), I = g(w), M = !I && /^\d+$/.test(w), T.call(k, w, I, M, P, y));
}
function g(y) {
return typeof y == "string" && y && ["'", '"'].indexOf(y.charAt(0)) !== -1;
}
function x(y) {
return y.match(r) && !y.match(n);
}
function f(y) {
return i.test(y);
}
function E(y) {
return !g(y) && (x(y) || f(y));
}
return Ui;
}
var Tn = Bm(), Hi, us;
function Vm() {
if (us) return Hi;
us = 1;
const e = /[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g, t = (m) => m.match(e) || [], n = (m) => m[0].toUpperCase() + m.slice(1), r = (m, h) => t(m).join(h).toLowerCase(), i = (m) => t(m).reduce(
(h, d) => `${h}${h ? d[0].toUpperCase() + d.slice(1).toLowerCase() : d.toLowerCase()}`,
""
);
return Hi = {
words: t,
upperFirst: n,
camelCase: i,
pascalCase: (m) => n(i(m)),
snakeCase: (m) => r(m, "_"),
kebabCase: (m) => r(m, "-"),
sentenceCase: (m) => n(r(m, " ")),
titleCase: (m) => t(m).map(n).join(" ")
}, Hi;
}
var Yi = Vm(), Lr = { exports: {} }, ps;
function qm() {
if (ps) return Lr.exports;
ps = 1, Lr.exports = function(i) {
return e(t(i), i);
}, Lr.exports.array = e;
function e(i, a) {
var o = i.length, s = new Array(o), l = {}, c = o, m = n(a), h = r(i);
for (a.forEach(function(g) {
if (!h.has(g[0]) || !h.has(g[1]))
throw new Error("Unknown node. There is an unknown node in the supplied edges.");
}); c--; )
l[c] || d(i[c], c, /* @__PURE__ */ new Set());
return s;
function d(g, x, f) {
if (f.has(g)) {
var E;
try {
E = ", node was:" + JSON.stringify(g);
} catch {
E = "";
}
throw new Error("Cyclic dependency" + E);
}
if (!h.has(g))
throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: " + JSON.stringify(g));
if (!l[x]) {
l[x] = !0;
var y = m.get(g) || /* @__PURE__ */ new Set();
if (y = Array.from(y), x = y.length) {
f.add(g);
do {
var T = y[--x];
d(T, h.get(T), f);
} while (x);
f.delete(g);
}
s[--o] = g;
}
}
}
function t(i) {
for (var a = /* @__PURE__ */ new Set(), o = 0, s = i.length; o < s; o++) {
var l = i[o];
a.add(l[0]), a.add(l[1]);
}
return Array.from(a);
}
function n(i) {
for (var a = /* @__PURE__ */ new Map(), o = 0, s = i.length; o < s; o++) {
var l = i[o];
a.has(l[0]) || a.set(l[0], /* @__PURE__ */ new Set()), a.has(l[1]) || a.set(l[1], /* @__PURE__ */ new Set()), a.get(l[0]).add(l[1]);
}
return a;
}
function r(i) {
for (var a = /* @__PURE__ */ new Map(), o = 0, s = i.length; o < s; o++)
a.set(i[o], o);
return a;
}
return Lr.exports;
}
var Wm = qm();
const Um = /* @__PURE__ */ Ia(Wm), Hm = Object.prototype.toString, Ym = Error.prototype.toString, Km = RegExp.prototype.toString, Qm = typeof Symbol < "u" ? Symbol.prototype.toString : () => "", Gm = /^Symbol\((.*)\)(.*)$/;
function Zm(e) {
return e != +e ? "NaN" : e === 0 && 1 / e < 0 ? "-0" : "" + e;
}
function ds(e, t = !1) {
if (e == null || e === !0 || e === !1) return "" + e;
const n = typeof e;
if (n === "number") return Zm(e);
if (n === "string") return t ? `"${e}"` : e;
if (n === "function") return "[Function " + (e.name || "anonymous") + "]";
if (n === "symbol") return Qm.call(e).replace(Gm, "Symbol($1)");
const r = Hm.call(e).slice(8, -1);
return r === "Date" ? isNaN(e.getTime()) ? "" + e : e.toISOString(e) : r === "Error" || e instanceof Error ? "[" + Ym.call(e) + "]" : r === "RegExp" ? Km.call(e) : null;
}
function sn(e, t) {
let n = ds(e, t);
return n !== null ? n : JSON.stringify(e, function(r, i) {
let a = ds(this[r], t);
return a !== null ? a : i;
}, 2);
}
function Nl(e) {
return e == null ? [] : [].concat(e);
}
let Ll, Bl, Vl, Xm = /\$\{\s*(\w+)\s*\}/g;
Ll = Symbol.toStringTag;
class fs {
constructor(t, n, r, i) {
this.name = void 0, this.message = void 0, this.value = void 0, this.path = void 0, this.type = void 0, this.params = void 0, this.errors = void 0, this.inner = void 0, this[Ll] = "Error", this.name = "ValidationError", this.value = n, this.path = r, this.type = i, this.errors = [], this.inner = [], Nl(t).forEach((a) => {
if (it.isError(a)) {
this.errors.push(...a.errors);
const o = a.inner.length ? a.inner : [a];
this.inner.push(...o);
} else
this.errors.push(a);
}), this.message = this.errors.length > 1 ? `${this.errors.length} errors occurred` : this.errors[0];
}
}
Bl = Symbol.hasInstance;
Vl = Symbol.toStringTag;
class it extends Error {
static formatError(t, n) {
const r = n.label || n.path || "this";
return n = Object.assign({}, n, {
path: r,
originalPath: n.path
}), typeof t == "string" ? t.replace(Xm, (i, a) => sn(n[a])) : typeof t == "function" ? t(n) : t;
}
static isError(t) {
return t && t.name === "ValidationError";
}
constructor(t, n, r, i, a) {
const o = new fs(t, n, r, i);
if (a)
return o;
super(), this.value = void 0, this.path = void 0, this.type = void 0, this.params = void 0, this.errors = [], this.inner = [], this[Vl] = "Error", this.name = o.name, this.message = o.message, this.type = o.type, this.value = o.value, this.path = o.path, this.errors = o.errors, this.inner = o.inner, Error.captureStackTrace && Error.captureStackTrace(this, it);
}
static [Bl](t) {
return fs[Symbol.hasInstance](t) || super[Symbol.hasInstance](t);
}
}
let $t = {
default: "${path} is invalid",
required: "${path} is a required field",
defined: "${path} must be defined",
notNull: "${path} cannot be null",
oneOf: "${path} must be one of the following values: ${values}",
notOneOf: "${path} must not be one of the following values: ${values}",
notType: ({
path: e,
type: t,
value: n,
originalValue: r
}) => {
const i = r != null && r !== n ? ` (cast from the value \`${sn(r, !0)}\`).` : ".";
return t !== "mixed" ? `${e} must be a \`${t}\` type, but the final value was: \`${sn(n, !0)}\`` + i : `${e} must match the configured type. The validated value was: \`${sn(n, !0)}\`` + i;
}
}, tt = {
length: "${path} must be exactly ${length} characters",
min: "${path} must be at least ${min} characters",
max: "${path} must be at most ${max} characters",
matches: '${path} must match the following: "${regex}"',
email: "${path} must be a valid email",
url: "${path} must be a valid URL",
uuid: "${path} must be a valid UUID",
datetime: "${path} must be a valid ISO date-time",
datetime_precision: "${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",
datetime_offset: '${path} must be a valid ISO date-time with UTC "Z" timezone',
trim: "${path} must be a trimmed string",
lowercase: "${path} must be a lowercase string",
uppercase: "${path} must be a upper case string"
}, Ht = {
min: "${path} must be greater than or equal to ${min}",
max: "${path} must be less than or equal to ${max}",
lessThan: "${path} must be less than ${less}",
moreThan: "${path} must be greater than ${more}",
positive: "${path} must be a positive number",
negative: "${path} must be a negative number",
integer: "${path} must be an integer"
}, wa = {
min: "${path} field must be later than ${min}",
max: "${path} field must be at earlier than ${max}"
}, Sa = {
isValue: "${path} field must be ${value}"
}, Gr = {
noUnknown: "${path} field has unspecified keys: ${unknown}",
exact: "${path} object contains unknown properties: ${properties}"
}, Jm = {
min: "${path} field must have at least ${min} items",
max: "${path} field must have less than or equal to ${max} items",
length: "${path} must have ${length} items"
}, eh = {
notType: (e) => {
const {
path: t,
value: n,
spec: r
} = e, i = r.types.length;
if (Array.isArray(n)) {
if (n.length < i) return `${t} tuple value has too few items, expected a length of ${i} but got ${n.length} for value: \`${sn(n, !0)}\``;
if (n.length > i) return `${t} tuple value has too many items, expected a length of ${i} but got ${n.length} for value: \`${sn(n, !0)}\``;
}
return it.formatError($t.notType, e);
}
};
Object.assign(/* @__PURE__ */ Object.create(null), {
mixed: $t,
string: tt,
number: Ht,
date: wa,
object: Gr,
array: Jm,
boolean: Sa,
tuple: eh
});
const Za = (e) => e && e.__isYupSchema__;
class li {
static fromOptions(t, n) {
if (!n.then && !n.otherwise) throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");
let {
is: r,
then: i,
otherwise: a
} = n, o = typeof r == "function" ? r : (...s) => s.every((l) => l === r);
return new li(t, (s, l) => {
var c;
let m = o(...s) ? i : a;
return (c = m == null ? void 0 : m(l)) != null ? c : l;
});
}
constructor(t, n) {
this.fn = void 0, this.refs = t, this.refs = t, this.fn = n;
}
resolve(t, n) {
let r = this.refs.map((a) => (
// TODO: ? operator here?
a.getValue(n == null ? void 0 : n.value, n == null ? void 0 : n.parent, n == null ? void 0 : n.context)
)), i = this.fn(r, t, n);
if (i === void 0 || // @ts-ignore this can be base
i === t)
return t;
if (!Za(i)) throw new TypeError("conditions must return a schema object");
return i.resolve(n);
}
}
const Br = {
context: "$",
value: "."
};
function ci(e, t) {
return new fn(e, t);
}
class fn {
constructor(t, n = {}) {
if (this.key = void 0, this.isContext = void 0, this.isValue = void 0, this.isSibling = void 0, this.path = void 0, this.getter = void 0, this.map = void 0, typeof t != "string") throw new TypeError("ref must be a string, got: " + t);
if (this.key = t.trim(), t === "") throw new TypeError("ref must be a non-empty string");
this.isContext = this.key[0] === Br.context, this.isValue = this.key[0] === Br.value, this.isSibling = !this.isContext && !this.isValue;
let r = this.isContext ? Br.context : this.isValue ? Br.value : "";
this.path = this.key.slice(r.length), this.getter = this.path && Tn.getter(this.path, !0), this.map = n.map;
}
getValue(t, n, r) {
let i = this.isContext ? r : this.isValue ? t : n;
return this.getter && (i = this.getter(i || {})), this.map && (i = this.map(i)), i;
}
/**
*
* @param {*} value
* @param {Object} options
* @param {Object=} options.context
* @param {Object=} options.parent
*/
cast(t, n) {
return this.getValue(t, n == null ? void 0 : n.parent, n == null ? void 0 : n.context);
}
resolve() {
return this;
}
describe() {
return {
type: "ref",
key: this.key
};
}
toString() {
return `Ref(${this.key})`;
}
static isRef(t) {
return t && t.__isYupRef;
}
}
fn.prototype.__isYupRef = !0;
const Ot = (e) => e == null;
function Bn(e) {
function t({
value: n,
path: r = "",
options: i,
originalValue: a,
schema: o
}, s, l) {
const {
name: c,
test: m,
params: h,
message: d,
skipAbsent: g
} = e;
let {
parent: x,
context: f,
abortEarly: E = o.spec.abortEarly,
disableStackTrace: y = o.spec.disableStackTrace
} = i;
function T(R) {
return fn.isRef(R) ? R.getValue(n, x, f) : R;
}
function k(R = {}) {
const $ = Object.assign({
value: n,
originalValue: a,
label: o.spec.label,
path: R.path || r,
spec: o.spec,
disableStackTrace: R.disableStackTrace || y
}, h, R.params);
for (const j of Object.keys($)) $[j] = T($[j]);
const Z = new it(it.formatError(R.message || d, $), n, $.path, R.type || c, $.disableStackTrace);
return Z.params = $, Z;
}
const v = E ? s : l;
let w = {
path: r,
parent: x,
type: c,
from: i.from,
createError: k,
resolve: T,
options: i,
originalValue: a,
schema: o
};
const P = (R) => {
it.isError(R) ? v(R) : R ? l(null) : v(k());
}, M = (R) => {
it.isError(R) ? v(R) : s(R);
};
if (g && Ot(n))
return P(!0);
let N;
try {
var p;
if (N = m.call(w, n, w), typeof ((p = N) == null ? void 0 : p.then) == "function") {
if (i.sync)
throw new Error(`Validation test of type: "${w.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);
return Promise.resolve(N).then(P, M);
}
} catch (R) {
M(R);
return;
}
P(N);
}
return t.OPTIONS = e, t;
}
function th(e, t, n, r = n) {
let i, a, o;
return t ? (Tn.forEach(t, (s, l, c) => {
let m = l ? s.slice(1, s.length - 1) : s;
e = e.resolve({
context: r,
parent: i,
value: n
});
let h = e.type === "tuple", d = c ? parseInt(m, 10) : 0;
if (e.innerType || h) {
if (h && !c) throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);
if (n && d >= n.length)
throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);
i = n, n = n && n[d], e = h ? e.spec.types[d] : e.innerType;
}
if (!c) {
if (!e.fields || !e.fields[m]) throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e.type}")`);
i = n, n = n && n[m], e = e.fields[m];
}
a = m, o = l ? "[" + s + "]" : "." + s;
}), {
schema: e,
parent: i,
parentPath: a
}) : {
parent: i,
parentPath: t,
schema: e
};
}
class ui extends Set {
describe() {
const t = [];
for (const n of this.values())
t.push(fn.isRef(n) ? n.describe() : n);
return t;
}
resolveAll(t) {
let n = [];
for (const r of this.values())
n.push(t(r));
return n;
}
clone() {
return new ui(this.values());
}
merge(t, n) {
const r = this.clone();
return t.forEach((i) => r.add(i)), n.forEach((i) => r.delete(i)), r;
}
}
function Wn(e, t = /* @__PURE__ */ new Map()) {
if (Za(e) || !e || typeof e != "object") return e;
if (t.has(e)) return t.get(e);
let n;
if (e instanceof Date)
n = new Date(e.getTime()), t.set(e, n);
else if (e instanceof RegExp)
n = new RegExp(e), t.set(e, n);
else if (Array.isArray(e)) {
n = new Array(e.length), t.set(e, n);
for (let r = 0; r < e.length; r++) n[r] = Wn(e[r], t);
} else if (e instanceof Map) {
n = /* @__PURE__ */ new Map(), t.set(e, n);
for (const [r, i] of e.entries()) n.set(r, Wn(i, t));
} else if (e instanceof Set) {
n = /* @__PURE__ */ new Set(), t.set(e, n);
for (const r of e) n.add(Wn(r, t));
} else if (e instanceof Object) {
n = {}, t.set(e, n);
for (const [r, i] of Object.entries(e)) n[r] = Wn(i, t);
} else
throw Error(`Unable to clone ${e}`);
return n;
}
class ht {
constructor(t) {
this.type = void 0, this.deps = [], this.tests = void 0, this.transforms = void 0, this.conditions = [], this._mutate = void 0, this.internalTests = {}, this._whitelist = new ui(), this._blacklist = new ui(), this.exclusiveTests = /* @__PURE__ */ Object.create(null), this._typeCheck = void 0, this.spec = void 0, this.tests = [], this.transforms = [], this.withMutation(() => {
this.typeError($t.notType);
}), this.type = t.type, this._typeCheck = t.check, this.spec = Object.assign({
strip: !1,
strict: !1,
abortEarly: !0,
recursive: !0,
disableStackTrace: !1,
nullable: !1,
optional: !0,
coerce: !0
}, t == null ? void 0 : t.spec), this.withMutation((n) => {
n.nonNullable();
});
}
// TODO: remove
get _type() {
return this.type;
}
clone(t) {
if (this._mutate)
return t && Object.assign(this.spec, t), this;
const n = Object.create(Object.getPrototypeOf(this));
return n.type = this.type, n._typeCheck = this._typeCheck, n._whitelist = this._whitelist.clone(), n._blacklist = this._blacklist.clone(), n.internalTests = Object.assign({}, this.internalTests), n.exclusiveTests = Object.assign({}, this.exclusiveTests), n.deps = [...this.deps], n.conditions = [...this.conditions], n.tests = [...this.tests], n.transforms = [...this.transforms], n.spec = Wn(Object.assign({}, this.spec, t)), n;
}
label(t) {
let n = this.clone();
return n.spec.label = t, n;
}
meta(...t) {
if (t.length === 0) return this.spec.meta;
let n = this.clone();
return n.spec.meta = Object.assign(n.spec.meta || {}, t[0]), n;
}
withMutation(t) {
let n = this._mutate;
this._mutate = !0;
let r = t(this);
return this._mutate = n, r;
}
concat(t) {
if (!t || t === this) return this;
if (t.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);
let n = this, r = t.clone();
const i = Object.assign({}, n.spec, r.spec);
return r.spec = i, r.internalTests = Object.assign({}, n.internalTests, r.internalTests), r._whitelist = n._whitelist.merge(t._whitelist, t._blacklist), r._blacklist = n._blacklist.merge(t._blacklist, t._whitelist), r.tests = n.tests, r.exclusiveTests = n.exclusiveTests, r.withMutation((a) => {
t.tests.forEach((o) => {
a.test(o.OPTIONS);
});
}), r.transforms = [...n.transforms, ...r.transforms], r;
}
isType(t) {
return t == null ? !!(this.spec.nullable && t === null || this.spec.optional && t === void 0) : this._typeCheck(t);
}
resolve(t) {
let n = this;
if (n.conditions.length) {
let r = n.conditions;
n = n.clone(), n.conditions = [], n = r.reduce((i, a) => a.resolve(i, t), n), n = n.resolve(t);
}
return n;
}
resolveOptions(t) {
var n, r, i, a;
return Object.assign({}, t, {
from: t.from || [],
strict: (n = t.strict) != null ? n : this.spec.strict,
abortEarly: (r = t.abortEarly) != null ? r : this.spec.abortEarly,
recursive: (i = t.recursive) != null ? i : this.spec.recursive,
disableStackTrace: (a = t.disableStackTrace) != null ? a : this.spec.disableStackTrace
});
}
/**
* Run the configured transform pipeline over an input value.
*/
cast(t, n = {}) {
let r = this.resolve(Object.assign({
value: t
}, n)), i = n.assert === "ignore-optionality", a = r._cast(t, n);
if (n.assert !== !1 && !r.isType(a)) {
if (i && Ot(a))
return a;
let o = sn(t), s = sn(a);
throw new TypeError(`The value of ${n.path || "field"} could not be cast to a value that satisfies the schema type: "${r.type}".
attempted value: ${o}
` + (s !== o ? `result of cast: ${s}` : ""));
}
return a;
}
_cast(t, n) {
let r = t === void 0 ? t : this.transforms.reduce((i, a) => a.call(this, i, t, this), t);
return r === void 0 && (r = this.getDefault(n)), r;
}
_validate(t, n = {}, r, i) {
let {
path: a,
originalValue: o = t,
strict: s = this.spec.strict
} = n, l = t;
s || (l = this._cast(l, Object.assign({
assert: !1
}, n)));
let c = [];
for (let m of Object.values(this.internalTests))
m && c.push(m);
this.runTests({
path: a,
value: l,
originalValue: o,
options: n,
tests: c
}, r, (m) => {
if (m.length)
return i(m, l);
this.runTests({
path: a,
value: l,
originalValue: o,
options: n,
tests: this.tests
}, r, i);
});
}
/**
* Executes a set of validations, either schema, produced Tests or a nested
* schema validate result.
*/
runTests(t, n, r) {
let i = !1, {
tests: a,
value: o,
originalValue: s,
path: l,
options: c
} = t, m = (f) => {
i || (i = !0, n(f, o));
}, h = (f) => {
i || (i = !0, r(f, o));
}, d = a.length, g = [];
if (!d) return h([]);
let x = {
value: o,
originalValue: s,
path: l,
options: c,
schema: this
};
for (let f = 0; f < a.length; f++) {
const E = a[f];
E(x, m, function(T) {
T && (Array.isArray(T) ? g.push(...T) : g.push(T)), --d <= 0 && h(g);
});
}
}
asNestedTest({
key: t,
index: n,
parent: r,
parentPath: i,
originalParent: a,
options: o
}) {
const s = t ?? n;
if (s == null)
throw TypeError("Must include `key` or `index` for nested validations");
const l = typeof s == "number";
let c = r[s];
const m = Object.assign({}, o, {
// Nested validations fields are always strict:
// 1. parent isn't strict so the casting will also have cast inner values
// 2. parent is strict in which case the nested values weren't cast either
strict: !0,
parent: r,
value: c,
originalValue: a[s],
// FIXME: tests depend on `index` being passed around deeply,
// we should not let the options.key/index bleed through
key: void 0,
// index: undefined,
[l ? "index" : "key"]: s,
path: l || s.includes(".") ? `${i || ""}[${l ? s : `"${s}"`}]` : (i ? `${i}.` : "") + t
});
return (h, d, g) => this.resolve(m)._validate(c, m, d, g);
}
validate(t, n) {
var r;
let i = this.resolve(Object.assign({}, n, {
value: t
})), a = (r = n == null ? void 0 : n.disableStackTrace) != null ? r : i.spec.disableStackTrace;
return new Promise((o, s) => i._validate(t, n, (l, c) => {
it.isError(l) && (l.value = c), s(l);
}, (l, c) => {
l.length ? s(new it(l, c, void 0, void 0, a)) : o(c);
}));
}
validateSync(t, n) {
var r;
let i = this.resolve(Object.assign({}, n, {
value: t
})), a, o = (r = n == null ? void 0 : n.disableStackTrace) != null ? r : i.spec.disableStackTrace;
return i._validate(t, Object.assign({}, n, {
sync: !0
}), (s, l) => {
throw it.isError(s) && (s.value = l), s;
}, (s, l) => {
if (s.length) throw new it(s, t, void 0, void 0, o);
a = l;
}), a;
}
isValid(t, n) {
return this.validate(t, n).then(() => !0, (r) => {
if (it.isError(r)) return !1;
throw r;
});
}
isValidSync(t, n) {
try {
return this.validateSync(t, n), !0;
} catch (r) {
if (it.isError(r)) return !1;
throw r;
}
}
_getDefault(t) {
let n = this.spec.default;
return n == null ? n : typeof n == "function" ? n.call(this, t) : Wn(n);
}
getDefault(t) {
return this.resolve(t || {})._getDefault(t);
}
default(t) {
return arguments.length === 0 ? this._getDefault() : this.clone({
default: t
});
}
strict(t = !0) {
return this.clone({
strict: t
});
}
nullability(t, n) {
const r = this.clone({
nullable: t
});
return r.internalTests.nullable = Bn({
message: n,
name: "nullable",
test(i) {
return i === null ? this.schema.spec.nullable : !0;
}
}), r;
}
optionality(t, n) {
const r = this.clone({
optional: t
});
return r.internalTests.optionality = Bn({
message: n,
name: "optionality",
test(i) {
return i === void 0 ? this.schema.spec.optional : !0;
}
}), r;
}
optional() {
return this.optionality(!0);
}
defined(t = $t.defined) {
return this.optionality(!1, t);
}
nullable() {
return this.nullability(!0);
}
nonNullable(t = $t.notNull) {
return this.nullability(!1, t);
}
required(t = $t.required) {
return this.clone().withMutation((n) => n.nonNullable(t).defined(t));
}
notRequired() {
return this.clone().withMutation((t) => t.nullable().optional());
}
transform(t) {
let n = this.clone();
return n.transforms.push(t), n;
}
/**
* Adds a test function to the schema's queue of tests.
* tests can be exclusive or non-exclusive.
*
* - exclusive tests, will replace any existing tests of the same name.
* - non-exclusive: can be stacked
*
* If a non-exclusive test is added to a schema with an exclusive test of the same name
* the exclusive test is removed and further tests of the same name will be stacked.
*
* If an exclusive test is added to a schema with non-exclusive tests of the same name
* the previous tests are removed and further tests of the same name will replace each other.
*/
test(...t) {
let n;
if (t.length === 1 ? typeof t[0] == "function" ? n = {
test: t[0]
} : n = t[0] : t.length === 2 ? n = {
name: t[0],
test: t[1]
} : n = {
name: t[0],
message: t[1],
test: t[2]
}, n.message === void 0 && (n.message = $t.default), typeof n.test != "function") throw new TypeError("`test` is a required parameters");
let r = this.clone(), i = Bn(n), a = n.exclusive || n.name && r.exclusiveTests[n.name] === !0;
if (n.exclusive && !n.name)
throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");
return n.name && (r.exclusiveTests[n.name] = !!n.exclusive), r.tests = r.tests.filter((o) => !(o.OPTIONS.name === n.name && (a || o.OPTIONS.test === i.OPTIONS.test))), r.tests.push(i), r;
}
when(t, n) {
!Array.isArray(t) && typeof t != "string" && (n = t, t = ".");
let r = this.clone(), i = Nl(t).map((a) => new fn(a));
return i.forEach((a) => {
a.isSibling && r.deps.push(a.key);
}), r.conditions.push(typeof n == "function" ? new li(i, n) : li.fromOptions(i, n)), r;
}
typeError(t) {
let n = this.clone();
return n.internalTests.typeError = Bn({
message: t,
name: "typeError",
skipAbsent: !0,
test(r) {
return this.schema._typeCheck(r) ? !0 : this.createError({
params: {
type: this.schema.type
}
});
}
}), n;
}
oneOf(t, n = $t.oneOf) {
let r = this.clone();
return t.forEach((i) => {
r._whitelist.add(i), r._blacklist.delete(i);
}), r.internalTests.whiteList = Bn({
message: n,
name: "oneOf",
skipAbsent: !0,
test(i) {
let a = this.schema._whitelist, o = a.resolveAll(this.resolve);
return o.includes(i) ? !0 : this.createError({
params: {
values: Array.from(a).join(", "),
resolved: o
}
});
}
}), r;
}
notOneOf(t, n = $t.notOneOf) {
let r = this.clone();
return t.forEach((i) => {
r._blacklist.add(i), r._whitelist.delete(i);
}), r.internalTests.blacklist = Bn({
message: n,
name: "notOneOf",
test(i) {
let a = this.schema._blacklist, o = a.resolveAll(this.resolve);
return o.includes(i) ? this.createError({
params: {
values: Array.from(a).join(", "),
resolved: o
}
}) : !0;
}
}), r;
}
strip(t = !0) {
let n = this.clone();
return n.spec.strip = t, n;
}
/**
* Return a serialized description of the schema including validations, flags, types etc.
*
* @param options Provide any needed context for resolving runtime schema alterations (lazy, when conditions, etc).
*/
describe(t) {
const n = (t ? this.resolve(t) : this).clone(), {
label: r,
meta: i,
optional: a,
nullable: o
} = n.spec;
return {
meta: i,
label: r,
optional: a,
nullable: o,
default: n.getDefault(t),
type: n.type,
oneOf: n._whitelist.describe(),
notOneOf: n._blacklist.describe(),
tests: n.tests.map((l) => ({
name: l.OPTIONS.name,
params: l.OPTIONS.params
})).filter((l, c, m) => m.findIndex((h) => h.name === l.name) === c)
};
}
}
ht.prototype.__isYupSchema__ = !0;
for (const e of ["validate", "validateSync"]) ht.prototype[`${e}At`] = function(t, n, r = {}) {
const {
parent: i,
parentPath: a,
schema: o
} = th(this, t, n, r.context);
return o[e](i && i[a], Object.assign({}, r, {
parent: i,
path: t
}));
};
for (const e of ["equals", "is"]) ht.prototype[e] = ht.prototype.oneOf;
for (const e of ["not", "nope"]) ht.prototype[e] = ht.prototype.notOneOf;
const nh = () => !0;
function ql(e) {
return new Wl(e);
}
class Wl extends ht {
constructor(t) {
super(typeof t == "function" ? {
type: "mixed",
check: t
} : Object.assign({
type: "mixed",
check: nh
}, t));
}
}
ql.prototype = Wl.prototype;
function Ul() {
return new Hl();
}
class Hl extends ht {
constructor() {
super({
type: "boolean",
check(t) {
return t instanceof Boolean && (t = t.valueOf()), typeof t == "boolean";
}
}), this.withMutation(() => {
this.transform((t, n, r) => {
if (r.spec.coerce && !r.isType(t)) {
if (/^(true|1)$/i.test(String(t))) return !0;
if (/^(false|0)$/i.test(String(t))) return !1;
}
return t;
});
});
}
isTrue(t = Sa.isValue) {
return this.test({
message: t,
name: "is-value",
exclusive: !0,
params: {
value: "true"
},
test(n) {
return Ot(n) || n === !0;
}
});
}
isFalse(t = Sa.isValue) {
return this.test({
message: t,
name: "is-value",
exclusive: !0,
params: {
value: "false"
},
test(n) {
return Ot(n) || n === !1;
}
});
}
default(t) {
return super.default(t);
}
defined(t) {
return super.defined(t);
}
optional() {
return super.optional();
}
required(t) {
return super.required(t);
}
notRequired() {
return super.notRequired();
}
nullable() {
return super.nullable();
}
nonNullable(t) {
return super.nonNullable(t);
}
strip(t) {
return super.strip(t);
}
}
Ul.prototype = Hl.prototype;
const rh = /^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;
function ih(e) {
const t = Ca(e);
if (!t) return Date.parse ? Date.parse(e) : Number.NaN;
if (t.z === void 0 && t.plusMinus === void 0)
return new Date(t.year, t.month, t.day, t.hour, t.minute, t.second, t.millisecond).valueOf();
let n = 0;
return t.z !== "Z" && t.plusMinus !== void 0 && (n = t.hourOffset * 60 + t.minuteOffset, t.plusMinus === "+" && (n = 0 - n)), Date.UTC(t.year, t.month, t.day, t.hour, t.minute + n, t.second, t.millisecond);
}
function Ca(e) {
var t, n;
const r = rh.exec(e);
return r ? {
year: Lt(r[1]),
month: Lt(r[2], 1) - 1,
day: Lt(r[3], 1),
hour: Lt(r[4]),
minute: Lt(r[5]),
second: Lt(r[6]),
millisecond: r[7] ? (
// allow arbitrary sub-second precision beyond milliseconds
Lt(r[7].substring(0, 3))
) : 0,
precision: (t = (n = r[7]) == null ? void 0 : n.length) != null ? t : void 0,
z: r[8] || void 0,
plusMinus: r[9] || void 0,
hourOffset: Lt(r[10]),
minuteOffset: Lt(r[11])
} : null;
}
function Lt(e, t = 0) {
return Number(e) || t;
}
let ah = (
// eslint-disable-next-line
/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/
), oh = (
// eslint-disable-next-line
/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i
), sh = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i, lh = "^\\d{4}-\\d{2}-\\d{2}", ch = "\\d{2}:\\d{2}:\\d{2}", uh = "(([+-]\\d{2}(:?\\d{2})?)|Z)", ph = new RegExp(`${lh}T${ch}(\\.\\d+)?${uh}$`), dh = (e) => Ot(e) || e === e.trim(), fh = {}.toString();
function hr() {
return new Yl();
}
class Yl extends ht {
constructor() {
super({
type: "string",
check(t) {
return t instanceof String && (t = t.valueOf()), typeof t == "string";
}
}), this.withMutation(() => {
this.transform((t, n, r) => {
if (!r.spec.coerce || r.isType(t) || Array.isArray(t)) return t;
const i = t != null && t.toString ? t.toString() : t;
return i === fh ? t : i;
});
});
}
required(t) {
return super.required(t).withMutation((n) => n.test({
message: t || $t.required,
name: "required",
skipAbsent: !0,
test: (r) => !!r.length
}));
}
notRequired() {
return super.notRequired().withMutation((t) => (t.tests = t.tests.filter((n) => n.OPTIONS.name !== "required"), t));
}
length(t, n = tt.length) {
return this.test({
message: n,
name: "length",
exclusive: !0,
params: {
length: t
},
skipAbsent: !0,
test(r) {
return r.length === this.resolve(t);
}
});
}
min(t, n = tt.min) {
return this.test({
message: n,
name: "min",
exclusive: !0,
params: {
min: t
},
skipAbsent: !0,
test(r) {
return r.length >= this.resolve(t);
}
});
}
max(t, n = tt.max) {
return this.test({
name: "max",
exclusive: !0,
message: n,
params: {
max: t
},
skipAbsent: !0,
test(r) {
return r.length <= this.resolve(t);
}
});
}
matches(t, n) {
let r = !1, i, a;
return n && (typeof n == "object" ? {
excludeEmptyString: r = !1,
message: i,
name: a
} = n : i = n), this.test({
name: a || "matches",
message: i || tt.matches,
params: {
regex: t
},
skipAbsent: !0,
test: (o) => o === "" && r || o.search(t) !== -1
});
}
email(t = tt.email) {
return this.matches(ah, {
name: "email",
message: t,
excludeEmptyString: !0
});
}
url(t = tt.url) {
return this.matches(oh, {
name: "url",
message: t,
excludeEmptyString: !0
});
}
uuid(t = tt.uuid) {
return this.matches(sh, {
name: "uuid",
message: t,
excludeEmptyString: !1
});
}
datetime(t) {
let n = "", r, i;
return t && (typeof t == "object" ? {
message: n = "",
allowOffset: r = !1,
precision: i = void 0
} = t : n = t), this.matches(ph, {
name: "datetime",
message: n || tt.datetime,
excludeEmptyString: !0
}).test({
name: "datetime_offset",
message: n || tt.datetime_offset,
params: {
allowOffset: r
},
skipAbsent: !0,
test: (a) => {
if (!a || r) return !0;
const o = Ca(a);
return o ? !!o.z : !1;
}
}).test({
name: "datetime_precision",
message: n || tt.datetime_precision,
params: {
precision: i
},
skipAbsent: !0,
test: (a) => {
if (!a || i == null) return !0;
const o = Ca(a);
return o ? o.precision === i : !1;
}
});
}
//-- transforms --
ensure() {
return this.default("").transform((t) => t === null ? "" : t);
}
trim(t = tt.trim) {
return this.transform((n) => n != null ? n.trim() : n).test({
message: t,
name: "trim",
test: dh
});
}
lowercase(t = tt.lowercase) {
return this.transform((n) => Ot(n) ? n : n.toLowerCase()).test({
message: t,
name: "string_case",
exclusive: !0,
skipAbsent: !0,
test: (n) => Ot(n) || n === n.toLowerCase()
});
}
uppercase(t = tt.uppercase) {
return this.transform((n) => Ot(n) ? n : n.toUpperCase()).test({
message: t,
name: "string_case",
exclusive: !0,
skipAbsent: !0,
test: (n) => Ot(n) || n === n.toUpperCase()
});
}
}
hr.prototype = Yl.prototype;
let mh = (e) => e != +e;
function Kl() {
return new Ql();
}
class Ql extends ht {
constructor() {
super({
type: "number",
check(t) {
return t instanceof Number && (t = t.valueOf()), typeof t == "number" && !mh(t);
}
}), this.withMutation(() => {
this.transform((t, n, r) => {
if (!r.spec.coerce) return t;
let i = t;
if (typeof i == "string") {
if (i = i.replace(/\s/g, ""), i === "") return NaN;
i = +i;
}
return r.isType(i) || i === null ? i : parseFloat(i);
});
});
}
min(t, n = Ht.min) {
return this.test({
message: n,
name: "min",
exclusive: !0,
params: {
min: t
},
skipAbsent: !0,
test(r) {
return r >= this.resolve(t);
}
});
}
max(t, n = Ht.max) {
return this.test({
message: n,
name: "max",
exclusive: !0,
params: {
max: t
},
skipAbsent: !0,
test(r) {
return r <= this.resolve(t);
}
});
}
lessThan(t, n = Ht.lessThan) {
return this.test({
message: n,
name: "max",
exclusive: !0,
params: {
less: t
},
skipAbsent: !0,
test(r) {
return r < this.resolve(t);
}
});
}
moreThan(t, n = Ht.moreThan) {
return this.test({
message: n,
name: "min",
exclusive: !0,
params: {
more: t
},
skipAbsent: !0,
test(r) {
return r > this.resolve(t);
}
});
}
positive(t = Ht.positive) {
return this.moreThan(0, t);
}
negative(t = Ht.negative) {
return this.lessThan(0, t);
}
integer(t = Ht.integer) {
return this.test({
name: "integer",
message: t,
skipAbsent: !0,
test: (n) => Number.isInteger(n)
});
}
truncate() {
return this.transform((t) => Ot(t) ? t : t | 0);
}
round(t) {
var n;
let r = ["ceil", "floor", "round", "trunc"];
if (t = ((n = t) == null ? void 0 : n.toLowerCase()) || "round", t === "trunc") return this.truncate();
if (r.indexOf(t.toLowerCase()) === -1) throw new TypeError("Only valid options for round() are: " + r.join(", "));
return this.transform((i) => Ot(i) ? i : Math[t](i));
}
}
Kl.prototype = Ql.prototype;
let Gl = /* @__PURE__ */ new Date(""), hh = (e) => Object.prototype.toString.call(e) === "[object Date]";
function Xa() {
return new Pr();
}
class Pr extends ht {
constructor() {
super({
type: "date",
check(t) {
return hh(t) && !isNaN(t.getTime());
}
}), this.withMutation(() => {
this.transform((t, n, r) => !r.spec.coerce || r.isType(t) || t === null ? t : (t = ih(t), isNaN(t) ? Pr.INVALID_DATE : new Date(t)));
});
}
prepareParam(t, n) {
let r;
if (fn.isRef(t))
r = t;
else {
let i = this.cast(t);
if (!this._typeCheck(i)) throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);
r = i;
}
return r;
}
min(t, n = wa.min) {
let r = this.prepareParam(t, "min");
return this.test({
message: n,
name: "min",
exclusive: !0,
params: {
min: t
},
skipAbsent: !0,
test(i) {
return i >= this.resolve(r);
}
});
}
max(t, n = wa.max) {
let r = this.prepareParam(t, "max");
return this.test({
message: n,
name: "max",
exclusive: !0,
params: {
max: t
},
skipAbsent: !0,
test(i) {
return i <= this.resolve(r);
}
});
}
}
Pr.INVALID_DATE = Gl;
Xa.prototype = Pr.prototype;
Xa.INVALID_DATE = Gl;
function gh(e, t = []) {
let n = [], r = /* @__PURE__ */ new Set(), i = new Set(t.map(([o, s]) => `${o}-${s}`));
function a(o, s) {
let l = Tn.split(o)[0];
r.add(l), i.has(`${s}-${l}`) || n.push([s, l]);
}
for (const o of Object.keys(e)) {
let s = e[o];
r.add(o), fn.isRef(s) && s.isSibling ? a(s.path, o) : Za(s) && "deps" in s && s.deps.forEach((l) => a(l, o));
}
return Um.array(Array.from(r), n).reverse();
}
function ms(e, t) {
let n = 1 / 0;
return e.some((r, i) => {
var a;
if ((a = t.path) != null && a.includes(r))
return n = i, !0;
}), n;
}
function Zl(e) {
return (t, n) => ms(e, t) - ms(e, n);
}
const yh = (e, t, n) => {
if (typeof e != "string")
return e;
let r = e;
try {
r = JSON.parse(e);
} catch {
}
return n.isType(r) ? r : e;
};
function Zr(e) {
if ("fields" in e) {
const t = {};
for (const [n, r] of Object.entries(e.fields))
t[n] = Zr(r);
return e.setFields(t);
}
if (e.type === "array") {
const t = e.optional();
return t.innerType && (t.innerType = Zr(t.innerType)), t;
}
return e.type === "tuple" ? e.optional().clone({
types: e.spec.types.map(Zr)
}) : "optional" in e ? e.optional() : e;
}
const vh = (e, t) => {
const n = [...Tn.normalizePath(t)];
if (n.length === 1) return n[0] in e;
let r = n.pop(), i = Tn.getter(Tn.join(n), !0)(e);
return !!(i && r in i);
};
let hs = (e) => Object.prototype.toString.call(e) === "[object Object]";
function gs(e, t) {
let n = Object.keys(e.fields);
return Object.keys(t).filter((r) => n.indexOf(r) === -1);
}
const xh = Zl([]);
function Xl(e) {
return new Jl(e);
}
class Jl extends ht {
constructor(t) {
super({
type: "object",
check(n) {
return hs(n) || typeof n == "function";
}
}), this.fields = /* @__PURE__ */ Object.create(null), this._sortErrors = xh, this._nodes = [], this._excludedEdges = [], this.withMutation(() => {
t && this.shape(t);
});
}
_cast(t, n = {}) {
var r;
let i = super._cast(t, n);
if (i === void 0) return this.getDefault(n);
if (!this._typeCheck(i)) return i;
let a = this.fields, o = (r = n.stripUnknown) != null ? r : this.spec.noUnknown, s = [].concat(this._nodes, Object.keys(i).filter((h) => !this._nodes.includes(h))), l = {}, c = Object.assign({}, n, {
parent: l,
__validating: n.__validating || !1
}), m = !1;
for (const h of s) {
let d = a[h], g = h in i;
if (d) {
let x, f = i[h];
c.path = (n.path ? `${n.path}.` : "") + h, d = d.resolve({
value: f,
context: n.context,
parent: l
});
let E = d instanceof ht ? d.spec : void 0, y = E == null ? void 0 : E.strict;
if (E != null && E.strip) {
m = m || h in i;
continue;
}
x = !n.__validating || !y ? (
// TODO: use _cast, this is double resolving
d.cast(i[h], c)
) : i[h], x !== void 0 && (l[h] = x);
} else g && !o && (l[h] = i[h]);
(g !== h in l || l[h] !== i[h]) && (m = !0);
}
return m ? l : i;
}
_validate(t, n = {}, r, i) {
let {
from: a = [],
originalValue: o = t,
recursive: s = this.spec.recursive
} = n;
n.from = [{
schema: this,
value: o
}, ...a], n.__validating = !0, n.originalValue = o, super._validate(t, n, r, (l, c) => {
if (!s || !hs(c)) {
i(l, c);
return;
}
o = o || c;
let m = [];
for (let h of this._nodes) {
let d = this.fields[h];
!d || fn.isRef(d) || m.push(d.asNestedTest({
options: n,
key: h,
parent: c,
parentPath: n.path,
originalParent: o
}));
}
this.runTests({
tests: m,
value: c,
originalValue: o,
options: n
}, r, (h) => {
i(h.sort(this._sortErrors).concat(l), c);
});
});
}
clone(t) {
const n = super.clone(t);
return n.fields = Object.assign({}, this.fields), n._nodes = this._nodes, n._excludedEdges = this._excludedEdges, n._sortErrors = this._sortErrors, n;
}
concat(t) {
let n = super.concat(t), r = n.fields;
for (let [i, a] of Object.entries(this.fields)) {
const o = r[i];
r[i] = o === void 0 ? a : o;
}
return n.withMutation((i) => (
// XXX: excludes here is wrong
i.setFields(r, [...this._excludedEdges, ...t._excludedEdges])
));
}
_getDefault(t) {
if ("default" in this.spec)
return super._getDefault(t);
if (!this._nodes.length)
return;
let n = {};
return this._nodes.forEach((r) => {
var i;
const a = this.fields[r];
let o = t;
(i = o) != null && i.value && (o = Object.assign({}, o, {
parent: o.value,
value: o.value[r]
})), n[r] = a && "getDefault" in a ? a.getDefault(o) : void 0;
}), n;
}
setFields(t, n) {
let r = this.clone();
return r.fields = t, r._nodes = gh(t, n), r._sortErrors = Zl(Object.keys(t)), n && (r._excludedEdges = n), r;
}
shape(t, n = []) {
return this.clone().withMutation((r) => {
let i = r._excludedEdges;
return n.length && (Array.isArray(n[0]) || (n = [n]), i = [...r._excludedEdges, ...n]), r.setFields(Object.assign(r.fields, t), i);
});
}
partial() {
const t = {};
for (const [n, r] of Object.entries(this.fields))
t[n] = "optional" in r && r.optional instanceof Function ? r.optional() : r;
return this.setFields(t);
}
deepPartial() {
return Zr(this);
}
pick(t) {
const n = {};
for (const r of t)
this.fields[r] && (n[r] = this.fields[r]);
return this.setFields(n, this._excludedEdges.filter(([r, i]) => t.includes(r) && t.includes(i)));
}
omit(t) {
const n = [];
for (const r of Object.keys(this.fields))
t.includes(r) || n.push(r);
return this.pick(n);
}
from(t, n, r) {
let i = Tn.getter(t, !0);
return this.transform((a) => {
if (!a) return a;
let o = a;
return vh(a, t) && (o = Object.assign({}, a), r || delete o[t], o[n] = i(a)), o;
});
}
/** Parse an input JSON string to an object */
json() {
return this.transform(yh);
}
/**
* Similar to `noUnknown` but only validates that an object is the right shape without stripping the unknown keys
*/
exact(t) {
return this.test({
name: "exact",
exclusive: !0,
message: t || Gr.exact,
test(n) {
if (n == null) return !0;
const r = gs(this.schema, n);
return r.length === 0 || this.createError({
params: {
properties: r.join(", ")
}
});
}
});
}
stripUnknown() {
return this.clone({
noUnknown: !0
});
}
noUnknown(t = !0, n = Gr.noUnknown) {
typeof t != "boolean" && (n = t, t = !0);
let r = this.test({
name: "noUnknown",
exclusive: !0,
message: n,
test(i) {
if (i == null) return !0;
const a = gs(this.schema, i);
return !t || a.length === 0 || this.createError({
params: {
unknown: a.join(", ")
}
});
}
});
return r.spec.noUnknown = t, r;
}
unknown(t = !0, n = Gr.noUnknown) {
return this.noUnknown(!t, n);
}
transformKeys(t) {
return this.transform((n) => {
if (!n) return n;
const r = {};
for (const i of Object.keys(n)) r[t(i)] = n[i];
return r;
});
}
camelCase() {
return this.transformKeys(Yi.camelCase);
}
snakeCase() {
return this.transformKeys(Yi.snakeCase);
}
constantCase() {
return this.transformKeys((t) => Yi.snakeCase(t).toUpperCase());
}
describe(t) {
const n = (t ? this.resolve(t) : this).clone(), r = super.describe(t);
r.fields = {};
for (const [a, o] of Object.entries(n.fields)) {
var i;
let s = t;
(i = s) != null && i.value && (s = Object.assign({}, s, {
parent: s.value,
value: s.value[a]
})), r.fields[a] = o.describe(s);
}
return r;
}
}
Xl.prototype = Jl.prototype;
const bh = (e) => {
const t = {};
return e.forEach((n) => {
var o, s, l;
let r;
switch (n.type) {
case "text":
case "textarea":
case "tel":
case "mobile":
r = hr(), n.validation ? r = mn(r, n, "string") : (n.minLength && (r = r.min(n.minLength, `${n.label} must be at least ${n.minLength} characters`)), n.maxLength && (r = r.max(n.maxLength, `${n.label} must be at most ${n.maxLength} characters`)), n.pattern && (r = r.test("pattern", `${n.label} format is invalid`, (c) => c ? new RegExp(n.pattern).test(c) : !0)));
break;
case "email":
r = hr().email(((o = n.validation) == null ? void 0 : o.message) || `${n.label} must be a valid email address`), n.validation && (r = mn(r, n, "string"));
break;
case "password":
r = hr(), n.validation ? r = mn(r, n, "string") : (n.minLength && (r = r.min(n.minLength, `${n.label} must be at least ${n.minLength} characters`)), n.maxLength && (r = r.max(n.maxLength, `${n.label} must be at most ${n.maxLength} characters`)), n.pattern && (r = r.test("pattern", `${n.label} format is invalid`, (c) => c ? new RegExp(n.pattern).test(c) : !0)));
break;
case "number":
if (r = Kl().transform(
(c, m) => m === "" || m === null ? void 0 : c
).nullable().typeError(`${n.label} must be a number`), n.validation)
r = mn(r, n, "number");
else {
if (n.min !== void 0) {
const c = typeof n.min == "object" && n.min !== null && "field" in n.min, m = c ? ci(n.min.field) : n.min, h = c && n.min.message ? n.min.message : `${n.label} must be at least ${c ? "the minimum value" : n.min}`;
r = r.min(m, h);
}
if (n.max !== void 0) {
const c = typeof n.max == "object" && n.max !== null && "field" in n.max, m = c ? ci(n.max.field) : n.max, h = c && n.max.message ? n.max.message : `${n.label} must be at most ${c ? "the maximum value" : n.max}`;
r = r.max(m, h);
}
}
break;
case "select":
r = hr(), n.validation && (r = mn(r, n, "string"));
break;
case "checkbox":
r = Ul(), n.validation && (r = mn(r, n, "boolean"));
break;
case "date":
r = Xa().typeError(`${n.label} must be a valid date`), n.validation ? r = mn(r, n, "date") : (n.minDate && (r = r.min(new Date(n.minDate), `${n.label} must be after ${n.minDate}`)), n.maxDate && (r = r.max(new Date(n.maxDate), `${n.label} must be before ${n.maxDate}`)));
break;
default:
r = ql();
}
const i = ((s = n.validation) == null ? void 0 : s.required) !== void 0 ? n.validation.required : n.required;
if (typeof i == "function" ? !1 : !!i) {
const c = ((l = n.validation) == null ? void 0 : l.message) || `${n.label} is required`;
r = r.required(c);
}
t[n.name] = r;
}), Xl().shape(t);
}, mn = (e, t, n, r) => {
const i = t.validation;
if (!i) return e;
if (n === "string") {
if (i.minLength !== void 0) {
const a = i.message || `${t.label} must be at least ${i.minLength} characters`;
e = e.min(i.minLength, a);
}
if (i.maxLength !== void 0) {
const a = i.message || `${t.label} must be at most ${i.maxLength} characters`;
e = e.max(i.maxLength, a);
}
}
if (n === "number") {
if (i.min !== void 0)
if (typeof i.min == "object" && "field" in i.min) {
const a = ci(i.min.field), o = i.min.message || i.message || `${t.label} must be at least the value of ${i.min.field}`;
e = e.min(a, o);
} else {
const a = i.message || `${t.label} must be at least ${i.min}`;
e = e.min(i.min, a);
}
if (i.max !== void 0)
if (typeof i.max == "object" && "field" in i.max) {
const a = ci(i.max.field), o = i.max.message || i.message || `${t.label} must be at most the value of ${i.max.field}`;
e = e.max(a, o);
} else {
const a = i.message || `${t.label} must be at most ${i.max}`;
e = e.max(i.max, a);
}
}
if (i.pattern) {
const a = typeof i.pattern == "string" ? new RegExp(i.pattern) : i.pattern, o = i.message || `${t.label} format is invalid`;
e = e.test("pattern", o, (s) => s ? a.test(s) : !0);
}
return i.custom && (e = e.test("custom", i.message || `${t.label} is invalid`, function(a) {
const o = this.parent || {}, s = i.custom(a, o);
return typeof s == "boolean" ? s : !1;
})), e;
}, wh = ({
currentStep: e,
totalSteps: t,
onStepChange: n,
stepTitles: r = [],
showStepTitles: i = !0,
completedSteps: a = []
}) => {
const o = Ie(
() => Array.from({ length: t }, (m, h) => h + 1),
[t]
), s = Ie(
() => Math.round(e / t * 100),
[e, t]
), l = (m) => r[m - 1] || `Step ${m}`, c = (m) => m === e || a.includes(m) || m === e + 1 && a.includes(e);
return /* @__PURE__ */ U(
st,
{
sx: {
mb: 2,
p: 2,
boxShadow: "0px 1px 4px 0px #00000014",
background: "#F8F8F8",
borderRadius: "4px"
},
children: [
/* @__PURE__ */ U(
q,
{
sx: {
display: "flex",
alignItems: "center",
justifyContent: "space-between",
mb: 2
},
children: [
/* @__PURE__ */ u(
q,
{
sx: {
display: "flex",
alignItems: "center",
// gap: 2,
flexWrap: "wrap"
},
children: o.map((m, h) => {
const d = m === e, g = m < e || a.includes(m), x = d || g ? "primary.main" : "#8F97A4";
return /* @__PURE__ */ U(q, { sx: { display: "flex", alignItems: "center" }, children: [
/* @__PURE__ */ U(
q,
{
onClick: () => c(m) && n(m),
sx: {
display: "flex",
alignItems: "center",
cursor: c(m) ? "pointer" : "default"
},
children: [
/* @__PURE__ */ u(
q,
{
sx: {
width: 24,
height: 24,
borderRadius: "50%",
border: d || g ? "2px solid" : "1px solid",
borderColor: d || g ? "primary.main" : "#8F97A4",
display: "flex",
alignItems: "center",
justifyContent: "center",
backgroundColor: (f) => d || g ? mt(f.palette.primary.main, 0.2) : "transparent",
mr: 0.5,
color: x,
fontWeight: d || g ? 600 : 500,
fontSize: "12px"
},
children: m
}
),
i && /* @__PURE__ */ u(
se,
{
sx: { fontSize: "12px", fontWeight: 600, color: x },
children: l(m)
}
)
]
}
),
h < o.length - 1 && /* @__PURE__ */ u(
q,
{
sx: {
width: 40,
height: 2,
mx: 1,
borderRadius: 1,
backgroundColor: m < e ? "primary.main" : "#DFE3E8"
}
}
)
] }, m);
})
}
),
/* @__PURE__ */ u(se, { sx: { color: "#8F97A4", fontSize: "12px", fontWeight: 500 }, children: `Step ${e} of ${t}, ${s}% complete` })
]
}
),
/* @__PURE__ */ u(
Vc,
{
variant: "determinate",
value: s,
sx: {
height: 4,
borderRadius: "50px",
backgroundColor: (m) => m.palette.grey[300],
"& .MuiLinearProgress-bar": {
backgroundColor: "primary.main",
borderRadius: 5
}
}
}
)
]
}
);
}, Sh = ({
buttons: e,
disabled: t = !1,
testIdPrefix: n
}) => {
const r = (l) => {
l.onClick && l.onClick();
}, i = e.filter((l) => l.position === "left" || !l.position), a = e.filter((l) => l.position === "center"), o = e.filter((l) => l.position === "right"), s = (l, c) => {
const m = (l.text || "").toLowerCase(), h = l.type === "submit" || m.includes("submit") || m.includes("save") || m.includes("next"), d = l.position === "left" || m.includes("cancel") || m.includes("back") || m.includes("draft"), g = l.type ? l.type : h ? "submit" : "button", x = d ? "outlined" : "contained", f = l.disabled || t, E = m.includes("cancel") || m.includes("back"), y = n ? h ? `${n}-submit` : E ? `${n}-cancel` : void 0 : void 0;
return /* @__PURE__ */ U(
Ve,
{
type: g,
variant: x,
color: ((k) => k && ["primary", "secondary", "error", "info", "success", "warning"].includes(k) ? k : "primary")(l.color),
size: l.size || "large",
disabled: f,
onClick: l.onClick ? () => r(l) : void 0,
"data-testid": y,
sx: l.sx,
children: [
l.loading && /* @__PURE__ */ u(ar, { size: 20, sx: { mr: 1 } }),
l.text
]
},
`${l.text}-${c}`
);
};
return /* @__PURE__ */ U(q, { sx: { mt: 3, display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
/* @__PURE__ */ u(q, { sx: { display: "flex", gap: 2 }, children: i.map((l, c) => s(l, c)) }),
/* @__PURE__ */ u(q, { sx: { display: "flex", gap: 2 }, children: a.map((l, c) => s(l, c)) }),
/* @__PURE__ */ u(q, { sx: { display: "flex", gap: 2 }, children: o.map((l, c) => s(l, c)) })
] });
}, Ch = ({
config: e,
onSubmit: t,
onStepChange: n,
currentStep: r = 1,
totalSteps: i = 1,
isMultiStep: a = !1,
formData: o
}) => {
const { buttons: s, position: l = "right", layout: c = "horizontal", spacing: m = 2, sx: h } = e, d = (y) => {
let T = "button", k = "contained";
return y.type ? T = y.type : y.text.toLowerCase().includes("submit") || y.text.toLowerCase().includes("save") || y.text.toLowerCase().includes("next") ? T = "submit" : (y.text.toLowerCase().includes("reset") || y.text.toLowerCase().includes("clear")) && (T = "reset"), (y.text.toLowerCase().includes("cancel") || y.text.toLowerCase().includes("back") || y.text.toLowerCase().includes("draft")) && (k = "outlined"), { buttonType: T, buttonVariant: k };
}, g = (y) => ["primary", "secondary", "error", "warning", "info", "success"].includes(y || "") ? y : "primary", x = (y) => {
const { buttonType: T } = d(y);
y.onClick ? y.onClick() : T === "submit" && t ? t(o) : a && n && (y.text.toLowerCase().includes("next") ? n(r + 1, i) : (y.text.toLowerCase().includes("back") || y.text.toLowerCase().includes("previous")) && n(r - 1, i));
}, f = (y, T) => {
const { buttonType: k, buttonVariant: v } = d(y), w = g(y.color);
return /* @__PURE__ */ u(
Ve,
{
type: k,
variant: v,
color: w,
size: y.size || "medium",
disabled: y.disabled,
onClick: () => x(y),
sx: y.sx,
children: y.text
},
T
);
}, E = () => {
const y = {
display: "flex",
gap: m,
...h
};
switch (l) {
case "left":
return { ...y, justifyContent: "flex-start" };
case "center":
return { ...y, justifyContent: "center" };
case "right":
return { ...y, justifyContent: "flex-end" };
case "space-between":
return { ...y, justifyContent: "space-between" };
default:
return { ...y, justifyContent: "flex-end" };
}
};
return c === "vertical" ? /* @__PURE__ */ u(q, { sx: E(), children: s.map((y, T) => /* @__PURE__ */ u(q, { sx: { width: "100%" }, children: f(y, T) }, T)) }) : /* @__PURE__ */ u(q, { sx: E(), children: /* @__PURE__ */ u(qc, { variant: "outlined", size: "medium", children: s.map((y, T) => f(y, T)) }) });
}, ec = (e, t) => {
const n = e == null ? void 0 : e.showWhen;
if (n) {
if (typeof n == "function")
try {
return !!n(t || {});
} catch {
return !0;
}
if (n && typeof n == "object") {
const r = n.field, i = n.equals, a = n.in, o = r ? (t || {})[r] : void 0;
if (r && typeof i < "u") return o === i;
if (r && Array.isArray(a)) return a.includes(o);
}
}
return !0;
}, Xr = (e, t) => {
const n = [];
for (const r of e)
if (ec(r, t) && (n.push(r), r.type === "tabs" && r.items)) {
const i = r.items || [], a = (t || {})[r.name], o = (() => {
if (typeof a == "string" || typeof a == "number") {
const l = i.findIndex(
(c, m) => typeof c.value == "string" || typeof c.value == "number" ? c.value === a : m === a
);
return l >= 0 ? l : 0;
}
return Number(a) || 0;
})(), s = i[o] || {};
Array.isArray(s.fields) && n.push(...Xr(s.fields, t));
}
return n;
}, Eh = new gu({
defaultOptions: {
queries: {
staleTime: 15 * 60 * 1e3,
// 15 minutes (was 5)
gcTime: 30 * 60 * 1e3,
// 30 minutes (was 10)
retry: 3,
// Increase retries (was 1)
retryDelay: (e) => Math.min(1e3 * 2 ** e, 3e4),
refetchOnWindowFocus: !1,
refetchOnReconnect: !0
}
}
}), Ug = (e) => /* @__PURE__ */ u(wu, { client: Eh, children: /* @__PURE__ */ u(kh, { ...e }) }), kh = ({
id: e,
theme: t,
fields: n,
onSubmit: r,
onChange: i,
submitButtonText: a = "Submit",
onSubmitClick: o,
defaultValues: s,
showSubmitButton: l = !0,
buttons: c,
buttonGroup: m,
stickyButtons: h,
stickyButtonsSx: d,
fixedButtons: g,
fixedButtonsSx: x,
formCardWrap: f,
formCardSx: E,
formCardProps: y,
// API configuration
baseUrl: T,
apiHeaders: k,
stepNavigationProps: v,
testIdPrefix: w,
dateFormat: P
}) => {
var ce, yt;
const M = [
...new Set(
n.map((O) => O.step).filter((O) => O != null && O > 0)
)
].sort((O, A) => (O || 0) - (A || 0)), I = M.length > 1, N = M.length || 1, [p, R] = at(1), $ = I ? n.filter((O) => O.step === p) : n, Z = we((O) => {
const A = [];
for (const F of O)
if (A.push(F), F.type === "tabs" && F.items)
for (const W of F.items || [])
Array.isArray(W.fields) && A.push(...Z(W.fields));
return A;
}, []), {
control: j,
handleSubmit: re,
formState: { errors: L },
watch: Q,
setValue: V,
resetField: K,
trigger: S
} = Cc({
resolver: we((O, A, F) => {
const J = Xr(I ? $ : n, O), ue = bh(J);
return Xc(ue)(O, A, F);
}, [I, $, n]),
mode: "onChange",
defaultValues: s
}), D = Q(), ne = pt({});
ot(() => {
const O = [];
for (const A of n) {
const F = A.depends_on;
F && typeof A.name == "string" && O.push({ dependentField: A.name, dependencyName: F });
}
if (O.length !== 0)
for (const { dependentField: A, dependencyName: F } of O) {
const W = ne.current[F], J = D == null ? void 0 : D[F];
if (W !== J)
try {
K(A);
} catch {
}
ne.current[F] = J;
}
}, [n, D, K]);
const le = pt(i);
ot(() => {
le.current = i;
}, [i]);
const ae = Ie(() => {
try {
return JSON.stringify(D);
} catch {
return String(Date.now());
}
}, [D]), de = pt(null);
ot(() => {
le.current && de.current !== ae && (de.current = ae, le.current(D));
}, [ae]);
const H = async () => {
if (!I) return !0;
const O = n.filter((F) => F.step === p);
for (const F of O)
if (typeof F.required == "function" ? !!F.required(D) : !!F.required) {
const J = D[F.name];
let ue = !0;
if (F.type === "checkbox" ? ue = J === !0 : Array.isArray(J) ? ue = J.length > 0 : ue = J != null && J !== "", !ue)
return !1;
}
return await S() ? !0 : Object.keys(L).filter((W) => O.some((J) => J.name === W)).map((W) => {
const J = L[W];
return typeof (J == null ? void 0 : J.message) == "string" ? J.message : `${W} is invalid`;
}).length === 0;
}, ie = Ie(() => {
if (!I) return !0;
const O = n.filter((F) => F.step === p);
for (const F of O)
if (typeof F.required == "function" ? !!F.required(D) : !!F.required) {
const J = D[F.name];
let ue = !0;
if (F.type === "checkbox" ? ue = J === !0 : Array.isArray(J) ? ue = J.length > 0 : ue = J != null && J !== "", !ue)
return !1;
}
return Object.keys(L).filter(
(F) => O.some((W) => W.name === F)
).length === 0;
}, [I, p, n, D, L]), fe = we((O, A) => ec(O, A), []), ge = we((O) => {
const A = [];
for (const F of O)
if (A.push(F), F.type === "tabs" && F.items)
for (const W of F.items || [])
Array.isArray(W.fields) && A.push(...ge(W.fields));
return A;
}, []), B = we((O, A) => Xr(O, A), []), G = Ie(() => {
if (I)
return ie;
const O = Xr(n, D);
for (const W of O) {
if (!fe(W, D))
continue;
if (typeof W.required == "function" ? !!W.required(D) : !!W.required) {
const ue = D[W.name];
let me = !0;
if (W.type === "checkbox" ? me = ue === !0 : me = ue != null && ue !== "" && !(Array.isArray(ue) && ue.length === 0), !me)
return !1;
}
}
const A = new Set(O.map((W) => W.name));
return Object.keys(L).filter(
(W) => A.has(W)
).length === 0;
}, [I, ie, n, D, L, B, fe]), z = async (O) => {
O < 1 || O > N || O > p && I && !await H() || R(O);
}, ye = async (O) => {
if (I && p < N) {
console.warn("Form submission attempted on non-final step");
return;
}
const F = ((W) => {
const J = { ...W || {} }, ue = ge(n);
for (const me of ue) {
if (!me || !me.name) continue;
const Y = J[me.name];
if (me.type === "dragdroplist" && Array.isArray(Y)) {
const X = me, ve = X.serialize;
if (!ve) continue;
const $e = Y, Re = typeof X.getId == "function" ? X.getId : typeof X.getId == "string" ? (oe) => oe == null ? void 0 : oe[X.getId] : (oe) => (oe == null ? void 0 : oe.id) ?? (oe == null ? void 0 : oe._id) ?? (oe == null ? void 0 : oe.key) ?? String(oe), Ke = typeof X.getText == "function" ? X.getText : typeof X.getText == "string" ? (oe) => (oe == null ? void 0 : oe[X.getText]) ?? String(oe) : (oe) => (oe == null ? void 0 : oe.text) ?? (oe == null ? void 0 : oe.label) ?? (oe == null ? void 0 : oe.name) ?? (oe == null ? void 0 : oe.title) ?? String(oe), Le = (() => {
if (typeof X.chipText == "function") return X.chipText;
if (typeof X.chipText == "string") return (oe, ct) => oe == null ? void 0 : oe[X.chipText];
})();
let et = Y;
typeof ve == "function" ? et = $e.map((oe, ct) => ve(oe, ct)) : ve === "ids" ? et = $e.map((oe) => Re(oe)) : ve === "text" ? et = $e.map((oe) => Ke(oe)) : ve === "chips" ? et = $e.map((oe, ct) => (typeof Le == "function" ? Le(oe, ct) : void 0) ?? "") : ve && typeof ve == "object" && "field" in ve && (et = $e.map((oe) => oe == null ? void 0 : oe[ve.field])), J[me.name] = et;
}
}
return J;
})(O);
o && o(F), r(F);
}, Oe = async (O) => {
O && (O.preventDefault(), O.stopPropagation()), I && p < N && await H() && z(p + 1);
}, Ye = (O) => {
O && (O.preventDefault(), O.stopPropagation()), I && p > 1 && z(p - 1);
}, It = (O) => {
const A = O.col ?? 12, F = O.xs !== void 0 ? O.xs : 12, W = O.sm !== void 0 ? O.sm : A, J = O.md !== void 0 ? O.md : A, ue = O.lg !== void 0 ? O.lg : J, me = O.xl !== void 0 ? O.xl : ue;
return { xs: F, sm: W, md: J, lg: ue, xl: me };
}, qe = t ? Wc({
palette: {
primary: {
main: t.primaryColor || "#1976d2"
},
secondary: {
main: t.secondaryColor || "#dc004e"
},
background: {
default: t.backgroundColor || "#ffffff"
},
text: {
primary: t.textColor || "#000000"
}
},
shape: {
borderRadius: t.borderRadius || 4
},
spacing: t.spacing || 8,
typography: {
fontFamily: ((ce = t.typography) == null ? void 0 : ce.fontFamily) || "Roboto, Arial, sans-serif",
fontSize: typeof ((yt = t.typography) == null ? void 0 : yt.fontSize) == "number" ? t.typography.fontSize : 14
}
}) : void 0, Je = () => {
const O = g ? {
position: "fixed",
left: 0,
right: 0,
bottom: 0,
background: "#FFFFFF",
pt: 2,
px: 2,
pb: 2,
zIndex: 1300,
borderTop: "1px solid rgba(0,0,0,0.08)",
boxShadow: "0 -2px 8px rgba(0,0,0,0.08)",
...x
} : h ? {
position: "sticky",
bottom: 0,
background: "#FFFFFF",
pt: 2,
pb: 2,
zIndex: 1200,
borderTop: "1px solid rgba(0,0,0,0.08)",
boxShadow: "0 -2px 8px rgba(0,0,0,0.04)",
...d
} : void 0;
if (m && m.buttons && m.buttons.length > 0) {
const A = {
...m,
buttons: m.buttons.map((F) => {
const W = (F.text || "").toLowerCase(), J = F.type === "submit" || W.includes("submit") || W.includes("save") || W.includes("finish") || W.includes("complete"), ue = W.includes("next");
let me = !1;
return I ? (J || ue) && (me = !ie) : J && (me = !G), { ...F, disabled: F.disabled || me };
})
};
return /* @__PURE__ */ u(q, { sx: { mt: 3, ...O || {} }, children: /* @__PURE__ */ u(
Ch,
{
config: A,
onSubmit: ye,
onStepChange: z,
currentStep: p,
totalSteps: N,
isMultiStep: I,
formData: D
}
) });
}
if (c && c.length > 0) {
const A = c.map((F) => {
const W = (F.text || "").toLowerCase(), J = F.type === "submit" || W.includes("submit") || W.includes("save") || W.includes("finish") || W.includes("complete"), ue = W.includes("next");
let me = !1;
return I ? (J || ue) && (me = !ie) : J && (me = !G), {
...F,
disabled: F.disabled || me
};
});
return /* @__PURE__ */ u(q, { sx: O, children: /* @__PURE__ */ u(Sh, { buttons: A, testIdPrefix: w }) });
}
return l ? /* @__PURE__ */ u(
q,
{
sx: {
mt: 3,
display: "flex",
justifyContent: "flex-end",
flexDirection: "column",
alignItems: "flex-end",
...O || {}
},
children: /* @__PURE__ */ U(q, { sx: { display: "flex", gap: 2 }, children: [
I && p > 1 && /* @__PURE__ */ u(
Ve,
{
type: "button",
variant: "outlined",
onClick: Ye,
children: "Previous"
}
),
I ? (
// Multi-step form: Show Next for non-final steps, Submit for final step
p < N ? /* @__PURE__ */ u(
Ve,
{
type: "button",
variant: "contained",
color: "primary",
size: "large",
disabled: !ie,
onClick: Oe,
children: "Next"
}
) : /* @__PURE__ */ u(
Ve,
{
type: "submit",
variant: "contained",
color: "primary",
size: "large",
disabled: !ie,
children: a
}
)
) : (
// Single-step form: Show Submit button (disabled if invalid)
/* @__PURE__ */ u(
Ve,
{
type: "submit",
variant: "contained",
color: "primary",
size: "large",
disabled: !G,
"data-testid": w ? `${w}-submit` : void 0,
children: a
}
)
)
] })
}
) : null;
}, Et = Ie(() => {
const O = [];
let A = [];
for (const F of $)
F.type === "section" && A.length > 0 ? (O.push(A), A = [F]) : A.push(F);
return A.length > 0 && O.push(A), O;
}, [$]), lt = /* @__PURE__ */ U(
q,
{
component: "form",
onSubmit: (O) => {
if (I && p < N) {
O.preventDefault(), O.stopPropagation(), ie && Oe();
return;
}
re(ye)(O);
},
id: e,
onKeyDown: (O) => {
O.key === "Enter" && I && p < N && (O.preventDefault(), ie && Oe());
},
sx: { pb: g ? 10 : void 0 },
children: [
I && /* @__PURE__ */ u(
wh,
{
currentStep: p,
totalSteps: N,
onStepChange: z,
stepTitles: v == null ? void 0 : v.stepTitles,
showStepTitles: (v == null ? void 0 : v.showStepTitles) !== !1
}
),
Et.map((O, A) => {
const F = O.find((Y) => Y.type === "section");
if (F && !fe(F, D))
return null;
const W = (F == null ? void 0 : F.cardWrap) !== !1, J = {
p: 2,
boxShadow: "0px 1px 4px 0px #00000029",
background: "#FFFFFF",
borderRadius: "6px",
display: "grid",
gridTemplateColumns: "repeat(12, 1fr)",
gap: 2,
width: "100%",
mb: 2
}, ue = {
display: "grid",
gridTemplateColumns: "repeat(12, 1fr)",
gap: 2,
width: "100%",
mb: 2
}, me = /* @__PURE__ */ u(mi, { children: O.map((Y) => {
if (!fe(Y, D))
return null;
const X = It(Y);
return /* @__PURE__ */ u(q, { sx: { gridColumn: { xs: `span ${X.xs}`, sm: `span ${X.sm}`, md: `span ${X.md}`, lg: `span ${X.lg}`, xl: `span ${X.xl}` } }, children: /* @__PURE__ */ u(
zl,
{
field: Y,
control: j,
errors: L,
baseUrl: T,
apiHeaders: k,
formData: D,
setValue: V,
testIdPrefix: w,
dateFormat: P
}
) }, Y.name);
}) });
return W ? /* @__PURE__ */ u(
st,
{
sx: { ...J, ...(F == null ? void 0 : F.cardSx) || {} },
...(F == null ? void 0 : F.cardProps) || {},
children: me
},
`group-${A}`
) : /* @__PURE__ */ u(q, { sx: ue, children: me }, `group-${A}`);
}),
Je()
]
}
), Mt = f ? /* @__PURE__ */ u(
st,
{
sx: {
p: 2,
boxShadow: "0px 1px 4px 0px #00000029",
background: "#FFFFFF",
borderRadius: "6px",
...E
},
...y,
children: lt
}
) : lt;
return qe ? /* @__PURE__ */ u(Uc, { theme: qe, children: Mt }) : Mt;
}, Hg = ({
src: e,
alt: t,
width: n = "100%",
height: r = "auto",
style: i,
className: a,
onClick: o
}) => /* @__PURE__ */ u(q, { sx: { textAlign: "center" }, children: /* @__PURE__ */ u(
"img",
{
src: e || "/placeholder-image.png",
alt: t || "Image",
width: n,
height: r,
style: {
maxWidth: "100%",
height: "auto",
borderRadius: "8px",
cursor: o ? "pointer" : "default",
...i
},
className: a,
onClick: o,
onError: (s) => {
s.currentTarget.src = "/placeholder-image.png";
}
}
) });
function Rn(e, t, n, r) {
function i(a) {
return a instanceof n ? a : new n(function(o) {
o(a);
});
}
return new (n || (n = Promise))(function(a, o) {
function s(m) {
try {
c(r.next(m));
} catch (h) {
o(h);
}
}
function l(m) {
try {
c(r.throw(m));
} catch (h) {
o(h);
}
}
function c(m) {
m.done ? a(m.value) : i(m.value).then(s, l);
}
c((r = r.apply(e, t || [])).next());
});
}
const Th = /* @__PURE__ */ new Map([
// https://github.com/guzzle/psr7/blob/2d9260799e713f1c475d3c5fdc3d6561ff7441b2/src/MimeType.php
["1km", "application/vnd.1000minds.decision-model+xml"],
["3dml", "text/vnd.in3d.3dml"],
["3ds", "image/x-3ds"],
["3g2", "video/3gpp2"],
["3gp", "video/3gp"],
["3gpp", "video/3gpp"],
["3mf", "model/3mf"],
["7z", "application/x-7z-compressed"],
["7zip", "application/x-7z-compressed"],
["123", "application/vnd.lotus-1-2-3"],
["aab", "application/x-authorware-bin"],
["aac", "audio/x-acc"],
["aam", "application/x-authorware-map"],
["aas", "application/x-authorware-seg"],
["abw", "application/x-abiword"],
["ac", "application/vnd.nokia.n-gage.ac+xml"],
["ac3", "audio/ac3"],
["acc", "application/vnd.americandynamics.acc"],
["ace", "application/x-ace-compressed"],
["acu", "application/vnd.acucobol"],
["acutc", "application/vnd.acucorp"],
["adp", "audio/adpcm"],
["aep", "application/vnd.audiograph"],
["afm", "application/x-font-type1"],
["afp", "application/vnd.ibm.modcap"],
["ahead", "application/vnd.ahead.space"],
["ai", "application/pdf"],
["aif", "audio/x-aiff"],
["aifc", "audio/x-aiff"],
["aiff", "audio/x-aiff"],
["air", "application/vnd.adobe.air-application-installer-package+zip"],
["ait", "application/vnd.dvb.ait"],
["ami", "application/vnd.amiga.ami"],
["amr", "audio/amr"],
["apk", "application/vnd.android.package-archive"],
["apng", "image/apng"],
["appcache", "text/cache-manifest"],
["application", "application/x-ms-application"],
["apr", "application/vnd.lotus-approach"],
["arc", "application/x-freearc"],
["arj", "application/x-arj"],
["asc", "application/pgp-signature"],
["asf", "video/x-ms-asf"],
["asm", "text/x-asm"],
["aso", "application/vnd.accpac.simply.aso"],
["asx", "video/x-ms-asf"],
["atc", "application/vnd.acucorp"],
["atom", "application/atom+xml"],
["atomcat", "application/atomcat+xml"],
["atomdeleted", "application/atomdeleted+xml"],
["atomsvc", "application/atomsvc+xml"],
["atx", "application/vnd.antix.game-component"],
["au", "audio/x-au"],
["avi", "video/x-msvideo"],
["avif", "image/avif"],
["aw", "application/applixware"],
["azf", "application/vnd.airzip.filesecure.azf"],
["azs", "application/vnd.airzip.filesecure.azs"],
["azv", "image/vnd.airzip.accelerator.azv"],
["azw", "application/vnd.amazon.ebook"],
["b16", "image/vnd.pco.b16"],
["bat", "application/x-msdownload"],
["bcpio", "application/x-bcpio"],
["bdf", "application/x-font-bdf"],
["bdm", "application/vnd.syncml.dm+wbxml"],
["bdoc", "application/x-bdoc"],
["bed", "application/vnd.realvnc.bed"],
["bh2", "application/vnd.fujitsu.oasysprs"],
["bin", "application/octet-stream"],
["blb", "application/x-blorb"],
["blorb", "application/x-blorb"],
["bmi", "application/vnd.bmi"],
["bmml", "application/vnd.balsamiq.bmml+xml"],
["bmp", "image/bmp"],
["book", "application/vnd.framemaker"],
["box", "application/vnd.previewsystems.box"],
["boz", "application/x-bzip2"],
["bpk", "application/octet-stream"],
["bpmn", "application/octet-stream"],
["bsp", "model/vnd.valve.source.compiled-map"],
["btif", "image/prs.btif"],
["buffer", "application/octet-stream"],
["bz", "application/x-bzip"],
["bz2", "application/x-bzip2"],
["c", "text/x-c"],
["c4d", "application/vnd.clonk.c4group"],
["c4f", "application/vnd.clonk.c4group"],
["c4g", "application/vnd.clonk.c4group"],
["c4p", "application/vnd.clonk.c4group"],
["c4u", "application/vnd.clonk.c4group"],
["c11amc", "application/vnd.cluetrust.cartomobile-config"],
["c11amz", "application/vnd.cluetrust.cartomobile-config-pkg"],
["cab", "application/vnd.ms-cab-compressed"],
["caf", "audio/x-caf"],
["cap", "application/vnd.tcpdump.pcap"],
["car", "application/vnd.curl.car"],
["cat", "application/vnd.ms-pki.seccat"],
["cb7", "application/x-cbr"],
["cba", "application/x-cbr"],
["cbr", "application/x-cbr"],
["cbt", "application/x-cbr"],
["cbz", "application/x-cbr"],
["cc", "text/x-c"],
["cco", "application/x-cocoa"],
["cct", "application/x-director"],
["ccxml", "application/ccxml+xml"],
["cdbcmsg", "application/vnd.contact.cmsg"],
["cda", "application/x-cdf"],
["cdf", "application/x-netcdf"],
["cdfx", "application/cdfx+xml"],
["cdkey", "application/vnd.mediastation.cdkey"],
["cdmia", "application/cdmi-capability"],
["cdmic", "application/cdmi-container"],
["cdmid", "application/cdmi-domain"],
["cdmio", "application/cdmi-object"],
["cdmiq", "application/cdmi-queue"],
["cdr", "application/cdr"],
["cdx", "chemical/x-cdx"],
["cdxml", "application/vnd.chemdraw+xml"],
["cdy", "application/vnd.cinderella"],
["cer", "application/pkix-cert"],
["cfs", "application/x-cfs-compressed"],
["cgm", "image/cgm"],
["chat", "application/x-chat"],
["chm", "application/vnd.ms-htmlhelp"],
["chrt", "application/vnd.kde.kchart"],
["cif", "chemical/x-cif"],
["cii", "application/vnd.anser-web-certificate-issue-initiation"],
["cil", "application/vnd.ms-artgalry"],
["cjs", "application/node"],
["cla", "application/vnd.claymore"],
["class", "application/octet-stream"],
["clkk", "application/vnd.crick.clicker.keyboard"],
["clkp", "application/vnd.crick.clicker.palette"],
["clkt", "application/vnd.crick.clicker.template"],
["clkw", "application/vnd.crick.clicker.wordbank"],
["clkx", "application/vnd.crick.clicker"],
["clp", "application/x-msclip"],
["cmc", "application/vnd.cosmocaller"],
["cmdf", "chemical/x-cmdf"],
["cml", "chemical/x-cml"],
["cmp", "application/vnd.yellowriver-custom-menu"],
["cmx", "image/x-cmx"],
["cod", "application/vnd.rim.cod"],
["coffee", "text/coffeescript"],
["com", "application/x-msdownload"],
["conf", "text/plain"],
["cpio", "application/x-cpio"],
["cpp", "text/x-c"],
["cpt", "application/mac-compactpro"],
["crd", "application/x-mscardfile"],
["crl", "application/pkix-crl"],
["crt", "application/x-x509-ca-cert"],
["crx", "application/x-chrome-extension"],
["cryptonote", "application/vnd.rig.cryptonote"],
["csh", "application/x-csh"],
["csl", "application/vnd.citationstyles.style+xml"],
["csml", "chemical/x-csml"],
["csp", "application/vnd.commonspace"],
["csr", "application/octet-stream"],
["css", "text/css"],
["cst", "application/x-director"],
["csv", "text/csv"],
["cu", "application/cu-seeme"],
["curl", "text/vnd.curl"],
["cww", "application/prs.cww"],
["cxt", "application/x-director"],
["cxx", "text/x-c"],
["dae", "model/vnd.collada+xml"],
["daf", "application/vnd.mobius.daf"],
["dart", "application/vnd.dart"],
["dataless", "application/vnd.fdsn.seed"],
["davmount", "application/davmount+xml"],
["dbf", "application/vnd.dbf"],
["dbk", "application/docbook+xml"],
["dcr", "application/x-director"],
["dcurl", "text/vnd.curl.dcurl"],
["dd2", "application/vnd.oma.dd2+xml"],
["ddd", "application/vnd.fujixerox.ddd"],
["ddf", "application/vnd.syncml.dmddf+xml"],
["dds", "image/vnd.ms-dds"],
["deb", "application/x-debian-package"],
["def", "text/plain"],
["deploy", "application/octet-stream"],
["der", "application/x-x509-ca-cert"],
["dfac", "application/vnd.dreamfactory"],
["dgc", "application/x-dgc-compressed"],
["dic", "text/x-c"],
["dir", "application/x-director"],
["dis", "application/vnd.mobius.dis"],
["disposition-notification", "message/disposition-notification"],
["dist", "application/octet-stream"],
["distz", "application/octet-stream"],
["djv", "image/vnd.djvu"],
["djvu", "image/vnd.djvu"],
["dll", "application/octet-stream"],
["dmg", "application/x-apple-diskimage"],
["dmn", "application/octet-stream"],
["dmp", "application/vnd.tcpdump.pcap"],
["dms", "application/octet-stream"],
["dna", "application/vnd.dna"],
["doc", "application/msword"],
["docm", "application/vnd.ms-word.template.macroEnabled.12"],
["docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
["dot", "application/msword"],
["dotm", "application/vnd.ms-word.template.macroEnabled.12"],
["dotx", "application/vnd.openxmlformats-officedocument.wordprocessingml.template"],
["dp", "application/vnd.osgi.dp"],
["dpg", "application/vnd.dpgraph"],
["dra", "audio/vnd.dra"],
["drle", "image/dicom-rle"],
["dsc", "text/prs.lines.tag"],
["dssc", "application/dssc+der"],
["dtb", "application/x-dtbook+xml"],
["dtd", "application/xml-dtd"],
["dts", "audio/vnd.dts"],
["dtshd", "audio/vnd.dts.hd"],
["dump", "application/octet-stream"],
["dvb", "video/vnd.dvb.file"],
["dvi", "application/x-dvi"],
["dwd", "application/atsc-dwd+xml"],
["dwf", "model/vnd.dwf"],
["dwg", "image/vnd.dwg"],
["dxf", "image/vnd.dxf"],
["dxp", "application/vnd.spotfire.dxp"],
["dxr", "application/x-director"],
["ear", "application/java-archive"],
["ecelp4800", "audio/vnd.nuera.ecelp4800"],
["ecelp7470", "audio/vnd.nuera.ecelp7470"],
["ecelp9600", "audio/vnd.nuera.ecelp9600"],
["ecma", "application/ecmascript"],
["edm", "application/vnd.novadigm.edm"],
["edx", "application/vnd.novadigm.edx"],
["efif", "application/vnd.picsel"],
["ei6", "application/vnd.pg.osasli"],
["elc", "application/octet-stream"],
["emf", "image/emf"],
["eml", "message/rfc822"],
["emma", "application/emma+xml"],
["emotionml", "application/emotionml+xml"],
["emz", "application/x-msmetafile"],
["eol", "audio/vnd.digital-winds"],
["eot", "application/vnd.ms-fontobject"],
["eps", "application/postscript"],
["epub", "application/epub+zip"],
["es", "application/ecmascript"],
["es3", "application/vnd.eszigno3+xml"],
["esa", "application/vnd.osgi.subsystem"],
["esf", "application/vnd.epson.esf"],
["et3", "application/vnd.eszigno3+xml"],
["etx", "text/x-setext"],
["eva", "application/x-eva"],
["evy", "application/x-envoy"],
["exe", "application/octet-stream"],
["exi", "application/exi"],
["exp", "application/express"],
["exr", "image/aces"],
["ext", "application/vnd.novadigm.ext"],
["ez", "application/andrew-inset"],
["ez2", "application/vnd.ezpix-album"],
["ez3", "application/vnd.ezpix-package"],
["f", "text/x-fortran"],
["f4v", "video/mp4"],
["f77", "text/x-fortran"],
["f90", "text/x-fortran"],
["fbs", "image/vnd.fastbidsheet"],
["fcdt", "application/vnd.adobe.formscentral.fcdt"],
["fcs", "application/vnd.isac.fcs"],
["fdf", "application/vnd.fdf"],
["fdt", "application/fdt+xml"],
["fe_launch", "application/vnd.denovo.fcselayout-link"],
["fg5", "application/vnd.fujitsu.oasysgp"],
["fgd", "application/x-director"],
["fh", "image/x-freehand"],
["fh4", "image/x-freehand"],
["fh5", "image/x-freehand"],
["fh7", "image/x-freehand"],
["fhc", "image/x-freehand"],
["fig", "application/x-xfig"],
["fits", "image/fits"],
["flac", "audio/x-flac"],
["fli", "video/x-fli"],
["flo", "application/vnd.micrografx.flo"],
["flv", "video/x-flv"],
["flw", "application/vnd.kde.kivio"],
["flx", "text/vnd.fmi.flexstor"],
["fly", "text/vnd.fly"],
["fm", "application/vnd.framemaker"],
["fnc", "application/vnd.frogans.fnc"],
["fo", "application/vnd.software602.filler.form+xml"],
["for", "text/x-fortran"],
["fpx", "image/vnd.fpx"],
["frame", "application/vnd.framemaker"],
["fsc", "application/vnd.fsc.weblaunch"],
["fst", "image/vnd.fst"],
["ftc", "application/vnd.fluxtime.clip"],
["fti", "application/vnd.anser-web-funds-transfer-initiation"],
["fvt", "video/vnd.fvt"],
["fxp", "application/vnd.adobe.fxp"],
["fxpl", "application/vnd.adobe.fxp"],
["fzs", "application/vnd.fuzzysheet"],
["g2w", "application/vnd.geoplan"],
["g3", "image/g3fax"],
["g3w", "application/vnd.geospace"],
["gac", "application/vnd.groove-account"],
["gam", "application/x-tads"],
["gbr", "application/rpki-ghostbusters"],
["gca", "application/x-gca-compressed"],
["gdl", "model/vnd.gdl"],
["gdoc", "application/vnd.google-apps.document"],
["geo", "application/vnd.dynageo"],
["geojson", "application/geo+json"],
["gex", "application/vnd.geometry-explorer"],
["ggb", "application/vnd.geogebra.file"],
["ggt", "application/vnd.geogebra.tool"],
["ghf", "application/vnd.groove-help"],
["gif", "image/gif"],
["gim", "application/vnd.groove-identity-message"],
["glb", "model/gltf-binary"],
["gltf", "model/gltf+json"],
["gml", "application/gml+xml"],
["gmx", "application/vnd.gmx"],
["gnumeric", "application/x-gnumeric"],
["gpg", "application/gpg-keys"],
["gph", "application/vnd.flographit"],
["gpx", "application/gpx+xml"],
["gqf", "application/vnd.grafeq"],
["gqs", "application/vnd.grafeq"],
["gram", "application/srgs"],
["gramps", "application/x-gramps-xml"],
["gre", "application/vnd.geometry-explorer"],
["grv", "application/vnd.groove-injector"],
["grxml", "application/srgs+xml"],
["gsf", "application/x-font-ghostscript"],
["gsheet", "application/vnd.google-apps.spreadsheet"],
["gslides", "application/vnd.google-apps.presentation"],
["gtar", "application/x-gtar"],
["gtm", "application/vnd.groove-tool-message"],
["gtw", "model/vnd.gtw"],
["gv", "text/vnd.graphviz"],
["gxf", "application/gxf"],
["gxt", "application/vnd.geonext"],
["gz", "application/gzip"],
["gzip", "application/gzip"],
["h", "text/x-c"],
["h261", "video/h261"],
["h263", "video/h263"],
["h264", "video/h264"],
["hal", "application/vnd.hal+xml"],
["hbci", "application/vnd.hbci"],
["hbs", "text/x-handlebars-template"],
["hdd", "application/x-virtualbox-hdd"],
["hdf", "application/x-hdf"],
["heic", "image/heic"],
["heics", "image/heic-sequence"],
["heif", "image/heif"],
["heifs", "image/heif-sequence"],
["hej2", "image/hej2k"],
["held", "application/atsc-held+xml"],
["hh", "text/x-c"],
["hjson", "application/hjson"],
["hlp", "application/winhlp"],
["hpgl", "application/vnd.hp-hpgl"],
["hpid", "application/vnd.hp-hpid"],
["hps", "application/vnd.hp-hps"],
["hqx", "application/mac-binhex40"],
["hsj2", "image/hsj2"],
["htc", "text/x-component"],
["htke", "application/vnd.kenameaapp"],
["htm", "text/html"],
["html", "text/html"],
["hvd", "application/vnd.yamaha.hv-dic"],
["hvp", "application/vnd.yamaha.hv-voice"],
["hvs", "application/vnd.yamaha.hv-script"],
["i2g", "application/vnd.intergeo"],
["icc", "application/vnd.iccprofile"],
["ice", "x-conference/x-cooltalk"],
["icm", "application/vnd.iccprofile"],
["ico", "image/x-icon"],
["ics", "text/calendar"],
["ief", "image/ief"],
["ifb", "text/calendar"],
["ifm", "application/vnd.shana.informed.formdata"],
["iges", "model/iges"],
["igl", "application/vnd.igloader"],
["igm", "application/vnd.insors.igm"],
["igs", "model/iges"],
["igx", "application/vnd.micrografx.igx"],
["iif", "application/vnd.shana.informed.interchange"],
["img", "application/octet-stream"],
["imp", "application/vnd.accpac.simply.imp"],
["ims", "application/vnd.ms-ims"],
["in", "text/plain"],
["ini", "text/plain"],
["ink", "application/inkml+xml"],
["inkml", "application/inkml+xml"],
["install", "application/x-install-instructions"],
["iota", "application/vnd.astraea-software.iota"],
["ipfix", "application/ipfix"],
["ipk", "application/vnd.shana.informed.package"],
["irm", "application/vnd.ibm.rights-management"],
["irp", "application/vnd.irepository.package+xml"],
["iso", "application/x-iso9660-image"],
["itp", "application/vnd.shana.informed.formtemplate"],
["its", "application/its+xml"],
["ivp", "application/vnd.immervision-ivp"],
["ivu", "application/vnd.immervision-ivu"],
["jad", "text/vnd.sun.j2me.app-descriptor"],
["jade", "text/jade"],
["jam", "application/vnd.jam"],
["jar", "application/java-archive"],
["jardiff", "application/x-java-archive-diff"],
["java", "text/x-java-source"],
["jhc", "image/jphc"],
["jisp", "application/vnd.jisp"],
["jls", "image/jls"],
["jlt", "application/vnd.hp-jlyt"],
["jng", "image/x-jng"],
["jnlp", "application/x-java-jnlp-file"],
["joda", "application/vnd.joost.joda-archive"],
["jp2", "image/jp2"],
["jpe", "image/jpeg"],
["jpeg", "image/jpeg"],
["jpf", "image/jpx"],
["jpg", "image/jpeg"],
["jpg2", "image/jp2"],
["jpgm", "video/jpm"],
["jpgv", "video/jpeg"],
["jph", "image/jph"],
["jpm", "video/jpm"],
["jpx", "image/jpx"],
["js", "application/javascript"],
["json", "application/json"],
["json5", "application/json5"],
["jsonld", "application/ld+json"],
// https://jsonlines.org/
["jsonl", "application/jsonl"],
["jsonml", "application/jsonml+json"],
["jsx", "text/jsx"],
["jxr", "image/jxr"],
["jxra", "image/jxra"],
["jxrs", "image/jxrs"],
["jxs", "image/jxs"],
["jxsc", "image/jxsc"],
["jxsi", "image/jxsi"],
["jxss", "image/jxss"],
["kar", "audio/midi"],
["karbon", "application/vnd.kde.karbon"],
["kdb", "application/octet-stream"],
["kdbx", "application/x-keepass2"],
["key", "application/x-iwork-keynote-sffkey"],
["kfo", "application/vnd.kde.kformula"],
["kia", "application/vnd.kidspiration"],
["kml", "application/vnd.google-earth.kml+xml"],
["kmz", "application/vnd.google-earth.kmz"],
["kne", "application/vnd.kinar"],
["knp", "application/vnd.kinar"],
["kon", "application/vnd.kde.kontour"],
["kpr", "application/vnd.kde.kpresenter"],
["kpt", "application/vnd.kde.kpresenter"],
["kpxx", "application/vnd.ds-keypoint"],
["ksp", "application/vnd.kde.kspread"],
["ktr", "application/vnd.kahootz"],
["ktx", "image/ktx"],
["ktx2", "image/ktx2"],
["ktz", "application/vnd.kahootz"],
["kwd", "application/vnd.kde.kword"],
["kwt", "application/vnd.kde.kword"],
["lasxml", "application/vnd.las.las+xml"],
["latex", "application/x-latex"],
["lbd", "application/vnd.llamagraphics.life-balance.desktop"],
["lbe", "application/vnd.llamagraphics.life-balance.exchange+xml"],
["les", "application/vnd.hhe.lesson-player"],
["less", "text/less"],
["lgr", "application/lgr+xml"],
["lha", "application/octet-stream"],
["link66", "application/vnd.route66.link66+xml"],
["list", "text/plain"],
["list3820", "application/vnd.ibm.modcap"],
["listafp", "application/vnd.ibm.modcap"],
["litcoffee", "text/coffeescript"],
["lnk", "application/x-ms-shortcut"],
["log", "text/plain"],
["lostxml", "application/lost+xml"],
["lrf", "application/octet-stream"],
["lrm", "application/vnd.ms-lrm"],
["ltf", "application/vnd.frogans.ltf"],
["lua", "text/x-lua"],
["luac", "application/x-lua-bytecode"],
["lvp", "audio/vnd.lucent.voice"],
["lwp", "application/vnd.lotus-wordpro"],
["lzh", "application/octet-stream"],
["m1v", "video/mpeg"],
["m2a", "audio/mpeg"],
["m2v", "video/mpeg"],
["m3a", "audio/mpeg"],
["m3u", "text/plain"],
["m3u8", "application/vnd.apple.mpegurl"],
["m4a", "audio/x-m4a"],
["m4p", "application/mp4"],
["m4s", "video/iso.segment"],
["m4u", "application/vnd.mpegurl"],
["m4v", "video/x-m4v"],
["m13", "application/x-msmediaview"],
["m14", "application/x-msmediaview"],
["m21", "application/mp21"],
["ma", "application/mathematica"],
["mads", "application/mads+xml"],
["maei", "application/mmt-aei+xml"],
["mag", "application/vnd.ecowin.chart"],
["maker", "application/vnd.framemaker"],
["man", "text/troff"],
["manifest", "text/cache-manifest"],
["map", "application/json"],
["mar", "application/octet-stream"],
["markdown", "text/markdown"],
["mathml", "application/mathml+xml"],
["mb", "application/mathematica"],
["mbk", "application/vnd.mobius.mbk"],
["mbox", "application/mbox"],
["mc1", "application/vnd.medcalcdata"],
["mcd", "application/vnd.mcd"],
["mcurl", "text/vnd.curl.mcurl"],
["md", "text/markdown"],
["mdb", "application/x-msaccess"],
["mdi", "image/vnd.ms-modi"],
["mdx", "text/mdx"],
["me", "text/troff"],
["mesh", "model/mesh"],
["meta4", "application/metalink4+xml"],
["metalink", "application/metalink+xml"],
["mets", "application/mets+xml"],
["mfm", "application/vnd.mfmp"],
["mft", "application/rpki-manifest"],
["mgp", "application/vnd.osgeo.mapguide.package"],
["mgz", "application/vnd.proteus.magazine"],
["mid", "audio/midi"],
["midi", "audio/midi"],
["mie", "application/x-mie"],
["mif", "application/vnd.mif"],
["mime", "message/rfc822"],
["mj2", "video/mj2"],
["mjp2", "video/mj2"],
["mjs", "application/javascript"],
["mk3d", "video/x-matroska"],
["mka", "audio/x-matroska"],
["mkd", "text/x-markdown"],
["mks", "video/x-matroska"],
["mkv", "video/x-matroska"],
["mlp", "application/vnd.dolby.mlp"],
["mmd", "application/vnd.chipnuts.karaoke-mmd"],
["mmf", "application/vnd.smaf"],
["mml", "text/mathml"],
["mmr", "image/vnd.fujixerox.edmics-mmr"],
["mng", "video/x-mng"],
["mny", "application/x-msmoney"],
["mobi", "application/x-mobipocket-ebook"],
["mods", "application/mods+xml"],
["mov", "video/quicktime"],
["movie", "video/x-sgi-movie"],
["mp2", "audio/mpeg"],
["mp2a", "audio/mpeg"],
["mp3", "audio/mpeg"],
["mp4", "video/mp4"],
["mp4a", "audio/mp4"],
["mp4s", "application/mp4"],
["mp4v", "video/mp4"],
["mp21", "application/mp21"],
["mpc", "application/vnd.mophun.certificate"],
["mpd", "application/dash+xml"],
["mpe", "video/mpeg"],
["mpeg", "video/mpeg"],
["mpg", "video/mpeg"],
["mpg4", "video/mp4"],
["mpga", "audio/mpeg"],
["mpkg", "application/vnd.apple.installer+xml"],
["mpm", "application/vnd.blueice.multipass"],
["mpn", "application/vnd.mophun.application"],
["mpp", "application/vnd.ms-project"],
["mpt", "application/vnd.ms-project"],
["mpy", "application/vnd.ibm.minipay"],
["mqy", "application/vnd.mobius.mqy"],
["mrc", "application/marc"],
["mrcx", "application/marcxml+xml"],
["ms", "text/troff"],
["mscml", "application/mediaservercontrol+xml"],
["mseed", "application/vnd.fdsn.mseed"],
["mseq", "application/vnd.mseq"],
["msf", "application/vnd.epson.msf"],
["msg", "application/vnd.ms-outlook"],
["msh", "model/mesh"],
["msi", "application/x-msdownload"],
["msl", "application/vnd.mobius.msl"],
["msm", "application/octet-stream"],
["msp", "application/octet-stream"],
["msty", "application/vnd.muvee.style"],
["mtl", "model/mtl"],
["mts", "model/vnd.mts"],
["mus", "application/vnd.musician"],
["musd", "application/mmt-usd+xml"],
["musicxml", "application/vnd.recordare.musicxml+xml"],
["mvb", "application/x-msmediaview"],
["mvt", "application/vnd.mapbox-vector-tile"],
["mwf", "application/vnd.mfer"],
["mxf", "application/mxf"],
["mxl", "application/vnd.recordare.musicxml"],
["mxmf", "audio/mobile-xmf"],
["mxml", "application/xv+xml"],
["mxs", "application/vnd.triscape.mxs"],
["mxu", "video/vnd.mpegurl"],
["n-gage", "application/vnd.nokia.n-gage.symbian.install"],
["n3", "text/n3"],
["nb", "application/mathematica"],
["nbp", "application/vnd.wolfram.player"],
["nc", "application/x-netcdf"],
["ncx", "application/x-dtbncx+xml"],
["nfo", "text/x-nfo"],
["ngdat", "application/vnd.nokia.n-gage.data"],
["nitf", "application/vnd.nitf"],
["nlu", "application/vnd.neurolanguage.nlu"],
["nml", "application/vnd.enliven"],
["nnd", "application/vnd.noblenet-directory"],
["nns", "application/vnd.noblenet-sealer"],
["nnw", "application/vnd.noblenet-web"],
["npx", "image/vnd.net-fpx"],
["nq", "application/n-quads"],
["nsc", "application/x-conference"],
["nsf", "application/vnd.lotus-notes"],
["nt", "application/n-triples"],
["ntf", "application/vnd.nitf"],
["numbers", "application/x-iwork-numbers-sffnumbers"],
["nzb", "application/x-nzb"],
["oa2", "application/vnd.fujitsu.oasys2"],
["oa3", "application/vnd.fujitsu.oasys3"],
["oas", "application/vnd.fujitsu.oasys"],
["obd", "application/x-msbinder"],
["obgx", "application/vnd.openblox.game+xml"],
["obj", "model/obj"],
["oda", "application/oda"],
["odb", "application/vnd.oasis.opendocument.database"],
["odc", "application/vnd.oasis.opendocument.chart"],
["odf", "application/vnd.oasis.opendocument.formula"],
["odft", "application/vnd.oasis.opendocument.formula-template"],
["odg", "application/vnd.oasis.opendocument.graphics"],
["odi", "application/vnd.oasis.opendocument.image"],
["odm", "application/vnd.oasis.opendocument.text-master"],
["odp", "application/vnd.oasis.opendocument.presentation"],
["ods", "application/vnd.oasis.opendocument.spreadsheet"],
["odt", "application/vnd.oasis.opendocument.text"],
["oga", "audio/ogg"],
["ogex", "model/vnd.opengex"],
["ogg", "audio/ogg"],
["ogv", "video/ogg"],
["ogx", "application/ogg"],
["omdoc", "application/omdoc+xml"],
["onepkg", "application/onenote"],
["onetmp", "application/onenote"],
["onetoc", "application/onenote"],
["onetoc2", "application/onenote"],
["opf", "application/oebps-package+xml"],
["opml", "text/x-opml"],
["oprc", "application/vnd.palm"],
["opus", "audio/ogg"],
["org", "text/x-org"],
["osf", "application/vnd.yamaha.openscoreformat"],
["osfpvg", "application/vnd.yamaha.openscoreformat.osfpvg+xml"],
["osm", "application/vnd.openstreetmap.data+xml"],
["otc", "application/vnd.oasis.opendocument.chart-template"],
["otf", "font/otf"],
["otg", "application/vnd.oasis.opendocument.graphics-template"],
["oth", "application/vnd.oasis.opendocument.text-web"],
["oti", "application/vnd.oasis.opendocument.image-template"],
["otp", "application/vnd.oasis.opendocument.presentation-template"],
["ots", "application/vnd.oasis.opendocument.spreadsheet-template"],
["ott", "application/vnd.oasis.opendocument.text-template"],
["ova", "application/x-virtualbox-ova"],
["ovf", "application/x-virtualbox-ovf"],
["owl", "application/rdf+xml"],
["oxps", "application/oxps"],
["oxt", "application/vnd.openofficeorg.extension"],
["p", "text/x-pascal"],
["p7a", "application/x-pkcs7-signature"],
["p7b", "application/x-pkcs7-certificates"],
["p7c", "application/pkcs7-mime"],
["p7m", "application/pkcs7-mime"],
["p7r", "application/x-pkcs7-certreqresp"],
["p7s", "application/pkcs7-signature"],
["p8", "application/pkcs8"],
["p10", "application/x-pkcs10"],
["p12", "application/x-pkcs12"],
["pac", "application/x-ns-proxy-autoconfig"],
["pages", "application/x-iwork-pages-sffpages"],
["pas", "text/x-pascal"],
["paw", "application/vnd.pawaafile"],
["pbd", "application/vnd.powerbuilder6"],
["pbm", "image/x-portable-bitmap"],
["pcap", "application/vnd.tcpdump.pcap"],
["pcf", "application/x-font-pcf"],
["pcl", "application/vnd.hp-pcl"],
["pclxl", "application/vnd.hp-pclxl"],
["pct", "image/x-pict"],
["pcurl", "application/vnd.curl.pcurl"],
["pcx", "image/x-pcx"],
["pdb", "application/x-pilot"],
["pde", "text/x-processing"],
["pdf", "application/pdf"],
["pem", "application/x-x509-user-cert"],
["pfa", "application/x-font-type1"],
["pfb", "application/x-font-type1"],
["pfm", "application/x-font-type1"],
["pfr", "application/font-tdpfr"],
["pfx", "application/x-pkcs12"],
["pgm", "image/x-portable-graymap"],
["pgn", "application/x-chess-pgn"],
["pgp", "application/pgp"],
["php", "application/x-httpd-php"],
["php3", "application/x-httpd-php"],
["php4", "application/x-httpd-php"],
["phps", "application/x-httpd-php-source"],
["phtml", "application/x-httpd-php"],
["pic", "image/x-pict"],
["pkg", "application/octet-stream"],
["pki", "application/pkixcmp"],
["pkipath", "application/pkix-pkipath"],
["pkpass", "application/vnd.apple.pkpass"],
["pl", "application/x-perl"],
["plb", "application/vnd.3gpp.pic-bw-large"],
["plc", "application/vnd.mobius.plc"],
["plf", "application/vnd.pocketlearn"],
["pls", "application/pls+xml"],
["pm", "application/x-perl"],
["pml", "application/vnd.ctc-posml"],
["png", "image/png"],
["pnm", "image/x-portable-anymap"],
["portpkg", "application/vnd.macports.portpkg"],
["pot", "application/vnd.ms-powerpoint"],
["potm", "application/vnd.ms-powerpoint.presentation.macroEnabled.12"],
["potx", "application/vnd.openxmlformats-officedocument.presentationml.template"],
["ppa", "application/vnd.ms-powerpoint"],
["ppam", "application/vnd.ms-powerpoint.addin.macroEnabled.12"],
["ppd", "application/vnd.cups-ppd"],
["ppm", "image/x-portable-pixmap"],
["pps", "application/vnd.ms-powerpoint"],
["ppsm", "application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],
["ppsx", "application/vnd.openxmlformats-officedocument.presentationml.slideshow"],
["ppt", "application/powerpoint"],
["pptm", "application/vnd.ms-powerpoint.presentation.macroEnabled.12"],
["pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation"],
["pqa", "application/vnd.palm"],
["prc", "application/x-pilot"],
["pre", "application/vnd.lotus-freelance"],
["prf", "application/pics-rules"],
["provx", "application/provenance+xml"],
["ps", "application/postscript"],
["psb", "application/vnd.3gpp.pic-bw-small"],
["psd", "application/x-photoshop"],
["psf", "application/x-font-linux-psf"],
["pskcxml", "application/pskc+xml"],
["pti", "image/prs.pti"],
["ptid", "application/vnd.pvi.ptid1"],
["pub", "application/x-mspublisher"],
["pvb", "application/vnd.3gpp.pic-bw-var"],
["pwn", "application/vnd.3m.post-it-notes"],
["pya", "audio/vnd.ms-playready.media.pya"],
["pyv", "video/vnd.ms-playready.media.pyv"],
["qam", "application/vnd.epson.quickanime"],
["qbo", "application/vnd.intu.qbo"],
["qfx", "application/vnd.intu.qfx"],
["qps", "application/vnd.publishare-delta-tree"],
["qt", "video/quicktime"],
["qwd", "application/vnd.quark.quarkxpress"],
["qwt", "application/vnd.quark.quarkxpress"],
["qxb", "application/vnd.quark.quarkxpress"],
["qxd", "application/vnd.quark.quarkxpress"],
["qxl", "application/vnd.quark.quarkxpress"],
["qxt", "application/vnd.quark.quarkxpress"],
["ra", "audio/x-realaudio"],
["ram", "audio/x-pn-realaudio"],
["raml", "application/raml+yaml"],
["rapd", "application/route-apd+xml"],
["rar", "application/x-rar"],
["ras", "image/x-cmu-raster"],
["rcprofile", "application/vnd.ipunplugged.rcprofile"],
["rdf", "application/rdf+xml"],
["rdz", "application/vnd.data-vision.rdz"],
["relo", "application/p2p-overlay+xml"],
["rep", "application/vnd.businessobjects"],
["res", "application/x-dtbresource+xml"],
["rgb", "image/x-rgb"],
["rif", "application/reginfo+xml"],
["rip", "audio/vnd.rip"],
["ris", "application/x-research-info-systems"],
["rl", "application/resource-lists+xml"],
["rlc", "image/vnd.fujixerox.edmics-rlc"],
["rld", "application/resource-lists-diff+xml"],
["rm", "audio/x-pn-realaudio"],
["rmi", "audio/midi"],
["rmp", "audio/x-pn-realaudio-plugin"],
["rms", "application/vnd.jcp.javame.midlet-rms"],
["rmvb", "application/vnd.rn-realmedia-vbr"],
["rnc", "application/relax-ng-compact-syntax"],
["rng", "application/xml"],
["roa", "application/rpki-roa"],
["roff", "text/troff"],
["rp9", "application/vnd.cloanto.rp9"],
["rpm", "audio/x-pn-realaudio-plugin"],
["rpss", "application/vnd.nokia.radio-presets"],
["rpst", "application/vnd.nokia.radio-preset"],
["rq", "application/sparql-query"],
["rs", "application/rls-services+xml"],
["rsa", "application/x-pkcs7"],
["rsat", "application/atsc-rsat+xml"],
["rsd", "application/rsd+xml"],
["rsheet", "application/urc-ressheet+xml"],
["rss", "application/rss+xml"],
["rtf", "text/rtf"],
["rtx", "text/richtext"],
["run", "application/x-makeself"],
["rusd", "application/route-usd+xml"],
["rv", "video/vnd.rn-realvideo"],
["s", "text/x-asm"],
["s3m", "audio/s3m"],
["saf", "application/vnd.yamaha.smaf-audio"],
["sass", "text/x-sass"],
["sbml", "application/sbml+xml"],
["sc", "application/vnd.ibm.secure-container"],
["scd", "application/x-msschedule"],
["scm", "application/vnd.lotus-screencam"],
["scq", "application/scvp-cv-request"],
["scs", "application/scvp-cv-response"],
["scss", "text/x-scss"],
["scurl", "text/vnd.curl.scurl"],
["sda", "application/vnd.stardivision.draw"],
["sdc", "application/vnd.stardivision.calc"],
["sdd", "application/vnd.stardivision.impress"],
["sdkd", "application/vnd.solent.sdkm+xml"],
["sdkm", "application/vnd.solent.sdkm+xml"],
["sdp", "application/sdp"],
["sdw", "application/vnd.stardivision.writer"],
["sea", "application/octet-stream"],
["see", "application/vnd.seemail"],
["seed", "application/vnd.fdsn.seed"],
["sema", "application/vnd.sema"],
["semd", "application/vnd.semd"],
["semf", "application/vnd.semf"],
["senmlx", "application/senml+xml"],
["sensmlx", "application/sensml+xml"],
["ser", "application/java-serialized-object"],
["setpay", "application/set-payment-initiation"],
["setreg", "application/set-registration-initiation"],
["sfd-hdstx", "application/vnd.hydrostatix.sof-data"],
["sfs", "application/vnd.spotfire.sfs"],
["sfv", "text/x-sfv"],
["sgi", "image/sgi"],
["sgl", "application/vnd.stardivision.writer-global"],
["sgm", "text/sgml"],
["sgml", "text/sgml"],
["sh", "application/x-sh"],
["shar", "application/x-shar"],
["shex", "text/shex"],
["shf", "application/shf+xml"],
["shtml", "text/html"],
["sid", "image/x-mrsid-image"],
["sieve", "application/sieve"],
["sig", "application/pgp-signature"],
["sil", "audio/silk"],
["silo", "model/mesh"],
["sis", "application/vnd.symbian.install"],
["sisx", "application/vnd.symbian.install"],
["sit", "application/x-stuffit"],
["sitx", "application/x-stuffitx"],
["siv", "application/sieve"],
["skd", "application/vnd.koan"],
["skm", "application/vnd.koan"],
["skp", "application/vnd.koan"],
["skt", "application/vnd.koan"],
["sldm", "application/vnd.ms-powerpoint.slide.macroenabled.12"],
["sldx", "application/vnd.openxmlformats-officedocument.presentationml.slide"],
["slim", "text/slim"],
["slm", "text/slim"],
["sls", "application/route-s-tsid+xml"],
["slt", "application/vnd.epson.salt"],
["sm", "application/vnd.stepmania.stepchart"],
["smf", "application/vnd.stardivision.math"],
["smi", "application/smil"],
["smil", "application/smil"],
["smv", "video/x-smv"],
["smzip", "application/vnd.stepmania.package"],
["snd", "audio/basic"],
["snf", "application/x-font-snf"],
["so", "application/octet-stream"],
["spc", "application/x-pkcs7-certificates"],
["spdx", "text/spdx"],
["spf", "application/vnd.yamaha.smaf-phrase"],
["spl", "application/x-futuresplash"],
["spot", "text/vnd.in3d.spot"],
["spp", "application/scvp-vp-response"],
["spq", "application/scvp-vp-request"],
["spx", "audio/ogg"],
["sql", "application/x-sql"],
["src", "application/x-wais-source"],
["srt", "application/x-subrip"],
["sru", "application/sru+xml"],
["srx", "application/sparql-results+xml"],
["ssdl", "application/ssdl+xml"],
["sse", "application/vnd.kodak-descriptor"],
["ssf", "application/vnd.epson.ssf"],
["ssml", "application/ssml+xml"],
["sst", "application/octet-stream"],
["st", "application/vnd.sailingtracker.track"],
["stc", "application/vnd.sun.xml.calc.template"],
["std", "application/vnd.sun.xml.draw.template"],
["stf", "application/vnd.wt.stf"],
["sti", "application/vnd.sun.xml.impress.template"],
["stk", "application/hyperstudio"],
["stl", "model/stl"],
["stpx", "model/step+xml"],
["stpxz", "model/step-xml+zip"],
["stpz", "model/step+zip"],
["str", "application/vnd.pg.format"],
["stw", "application/vnd.sun.xml.writer.template"],
["styl", "text/stylus"],
["stylus", "text/stylus"],
["sub", "text/vnd.dvb.subtitle"],
["sus", "application/vnd.sus-calendar"],
["susp", "application/vnd.sus-calendar"],
["sv4cpio", "application/x-sv4cpio"],
["sv4crc", "application/x-sv4crc"],
["svc", "application/vnd.dvb.service"],
["svd", "application/vnd.svd"],
["svg", "image/svg+xml"],
["svgz", "image/svg+xml"],
["swa", "application/x-director"],
["swf", "application/x-shockwave-flash"],
["swi", "application/vnd.aristanetworks.swi"],
["swidtag", "application/swid+xml"],
["sxc", "application/vnd.sun.xml.calc"],
["sxd", "application/vnd.sun.xml.draw"],
["sxg", "application/vnd.sun.xml.writer.global"],
["sxi", "application/vnd.sun.xml.impress"],
["sxm", "application/vnd.sun.xml.math"],
["sxw", "application/vnd.sun.xml.writer"],
["t", "text/troff"],
["t3", "application/x-t3vm-image"],
["t38", "image/t38"],
["taglet", "application/vnd.mynfc"],
["tao", "application/vnd.tao.intent-module-archive"],
["tap", "image/vnd.tencent.tap"],
["tar", "application/x-tar"],
["tcap", "application/vnd.3gpp2.tcap"],
["tcl", "application/x-tcl"],
["td", "application/urc-targetdesc+xml"],
["teacher", "application/vnd.smart.teacher"],
["tei", "application/tei+xml"],
["teicorpus", "application/tei+xml"],
["tex", "application/x-tex"],
["texi", "application/x-texinfo"],
["texinfo", "application/x-texinfo"],
["text", "text/plain"],
["tfi", "application/thraud+xml"],
["tfm", "application/x-tex-tfm"],
["tfx", "image/tiff-fx"],
["tga", "image/x-tga"],
["tgz", "application/x-tar"],
["thmx", "application/vnd.ms-officetheme"],
["tif", "image/tiff"],
["tiff", "image/tiff"],
["tk", "application/x-tcl"],
["tmo", "application/vnd.tmobile-livetv"],
["toml", "application/toml"],
["torrent", "application/x-bittorrent"],
["tpl", "application/vnd.groove-tool-template"],
["tpt", "application/vnd.trid.tpt"],
["tr", "text/troff"],
["tra", "application/vnd.trueapp"],
["trig", "application/trig"],
["trm", "application/x-msterminal"],
["ts", "video/mp2t"],
["tsd", "application/timestamped-data"],
["tsv", "text/tab-separated-values"],
["ttc", "font/collection"],
["ttf", "font/ttf"],
["ttl", "text/turtle"],
["ttml", "application/ttml+xml"],
["twd", "application/vnd.simtech-mindmapper"],
["twds", "application/vnd.simtech-mindmapper"],
["txd", "application/vnd.genomatix.tuxedo"],
["txf", "application/vnd.mobius.txf"],
["txt", "text/plain"],
["u8dsn", "message/global-delivery-status"],
["u8hdr", "message/global-headers"],
["u8mdn", "message/global-disposition-notification"],
["u8msg", "message/global"],
["u32", "application/x-authorware-bin"],
["ubj", "application/ubjson"],
["udeb", "application/x-debian-package"],
["ufd", "application/vnd.ufdl"],
["ufdl", "application/vnd.ufdl"],
["ulx", "application/x-glulx"],
["umj", "application/vnd.umajin"],
["unityweb", "application/vnd.unity"],
["uoml", "application/vnd.uoml+xml"],
["uri", "text/uri-list"],
["uris", "text/uri-list"],
["urls", "text/uri-list"],
["usdz", "model/vnd.usdz+zip"],
["ustar", "application/x-ustar"],
["utz", "application/vnd.uiq.theme"],
["uu", "text/x-uuencode"],
["uva", "audio/vnd.dece.audio"],
["uvd", "application/vnd.dece.data"],
["uvf", "application/vnd.dece.data"],
["uvg", "image/vnd.dece.graphic"],
["uvh", "video/vnd.dece.hd"],
["uvi", "image/vnd.dece.graphic"],
["uvm", "video/vnd.dece.mobile"],
["uvp", "video/vnd.dece.pd"],
["uvs", "video/vnd.dece.sd"],
["uvt", "application/vnd.dece.ttml+xml"],
["uvu", "video/vnd.uvvu.mp4"],
["uvv", "video/vnd.dece.video"],
["uvva", "audio/vnd.dece.audio"],
["uvvd", "application/vnd.dece.data"],
["uvvf", "application/vnd.dece.data"],
["uvvg", "image/vnd.dece.graphic"],
["uvvh", "video/vnd.dece.hd"],
["uvvi", "image/vnd.dece.graphic"],
["uvvm", "video/vnd.dece.mobile"],
["uvvp", "video/vnd.dece.pd"],
["uvvs", "video/vnd.dece.sd"],
["uvvt", "application/vnd.dece.ttml+xml"],
["uvvu", "video/vnd.uvvu.mp4"],
["uvvv", "video/vnd.dece.video"],
["uvvx", "application/vnd.dece.unspecified"],
["uvvz", "application/vnd.dece.zip"],
["uvx", "application/vnd.dece.unspecified"],
["uvz", "application/vnd.dece.zip"],
["vbox", "application/x-virtualbox-vbox"],
["vbox-extpack", "application/x-virtualbox-vbox-extpack"],
["vcard", "text/vcard"],
["vcd", "application/x-cdlink"],
["vcf", "text/x-vcard"],
["vcg", "application/vnd.groove-vcard"],
["vcs", "text/x-vcalendar"],
["vcx", "application/vnd.vcx"],
["vdi", "application/x-virtualbox-vdi"],
["vds", "model/vnd.sap.vds"],
["vhd", "application/x-virtualbox-vhd"],
["vis", "application/vnd.visionary"],
["viv", "video/vnd.vivo"],
["vlc", "application/videolan"],
["vmdk", "application/x-virtualbox-vmdk"],
["vob", "video/x-ms-vob"],
["vor", "application/vnd.stardivision.writer"],
["vox", "application/x-authorware-bin"],
["vrml", "model/vrml"],
["vsd", "application/vnd.visio"],
["vsf", "application/vnd.vsf"],
["vss", "application/vnd.visio"],
["vst", "application/vnd.visio"],
["vsw", "application/vnd.visio"],
["vtf", "image/vnd.valve.source.texture"],
["vtt", "text/vtt"],
["vtu", "model/vnd.vtu"],
["vxml", "application/voicexml+xml"],
["w3d", "application/x-director"],
["wad", "application/x-doom"],
["wadl", "application/vnd.sun.wadl+xml"],
["war", "application/java-archive"],
["wasm", "application/wasm"],
["wav", "audio/x-wav"],
["wax", "audio/x-ms-wax"],
["wbmp", "image/vnd.wap.wbmp"],
["wbs", "application/vnd.criticaltools.wbs+xml"],
["wbxml", "application/wbxml"],
["wcm", "application/vnd.ms-works"],
["wdb", "application/vnd.ms-works"],
["wdp", "image/vnd.ms-photo"],
["weba", "audio/webm"],
["webapp", "application/x-web-app-manifest+json"],
["webm", "video/webm"],
["webmanifest", "application/manifest+json"],
["webp", "image/webp"],
["wg", "application/vnd.pmi.widget"],
["wgt", "application/widget"],
["wks", "application/vnd.ms-works"],
["wm", "video/x-ms-wm"],
["wma", "audio/x-ms-wma"],
["wmd", "application/x-ms-wmd"],
["wmf", "image/wmf"],
["wml", "text/vnd.wap.wml"],
["wmlc", "application/wmlc"],
["wmls", "text/vnd.wap.wmlscript"],
["wmlsc", "application/vnd.wap.wmlscriptc"],
["wmv", "video/x-ms-wmv"],
["wmx", "video/x-ms-wmx"],
["wmz", "application/x-msmetafile"],
["woff", "font/woff"],
["woff2", "font/woff2"],
["word", "application/msword"],
["wpd", "application/vnd.wordperfect"],
["wpl", "application/vnd.ms-wpl"],
["wps", "application/vnd.ms-works"],
["wqd", "application/vnd.wqd"],
["wri", "application/x-mswrite"],
["wrl", "model/vrml"],
["wsc", "message/vnd.wfa.wsc"],
["wsdl", "application/wsdl+xml"],
["wspolicy", "application/wspolicy+xml"],
["wtb", "application/vnd.webturbo"],
["wvx", "video/x-ms-wvx"],
["x3d", "model/x3d+xml"],
["x3db", "model/x3d+fastinfoset"],
["x3dbz", "model/x3d+binary"],
["x3dv", "model/x3d-vrml"],
["x3dvz", "model/x3d+vrml"],
["x3dz", "model/x3d+xml"],
["x32", "application/x-authorware-bin"],
["x_b", "model/vnd.parasolid.transmit.binary"],
["x_t", "model/vnd.parasolid.transmit.text"],
["xaml", "application/xaml+xml"],
["xap", "application/x-silverlight-app"],
["xar", "application/vnd.xara"],
["xav", "application/xcap-att+xml"],
["xbap", "application/x-ms-xbap"],
["xbd", "application/vnd.fujixerox.docuworks.binder"],
["xbm", "image/x-xbitmap"],
["xca", "application/xcap-caps+xml"],
["xcs", "application/calendar+xml"],
["xdf", "application/xcap-diff+xml"],
["xdm", "application/vnd.syncml.dm+xml"],
["xdp", "application/vnd.adobe.xdp+xml"],
["xdssc", "application/dssc+xml"],
["xdw", "application/vnd.fujixerox.docuworks"],
["xel", "application/xcap-el+xml"],
["xenc", "application/xenc+xml"],
["xer", "application/patch-ops-error+xml"],
["xfdf", "application/vnd.adobe.xfdf"],
["xfdl", "application/vnd.xfdl"],
["xht", "application/xhtml+xml"],
["xhtml", "application/xhtml+xml"],
["xhvml", "application/xv+xml"],
["xif", "image/vnd.xiff"],
["xl", "application/excel"],
["xla", "application/vnd.ms-excel"],
["xlam", "application/vnd.ms-excel.addin.macroEnabled.12"],
["xlc", "application/vnd.ms-excel"],
["xlf", "application/xliff+xml"],
["xlm", "application/vnd.ms-excel"],
["xls", "application/vnd.ms-excel"],
["xlsb", "application/vnd.ms-excel.sheet.binary.macroEnabled.12"],
["xlsm", "application/vnd.ms-excel.sheet.macroEnabled.12"],
["xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
["xlt", "application/vnd.ms-excel"],
["xltm", "application/vnd.ms-excel.template.macroEnabled.12"],
["xltx", "application/vnd.openxmlformats-officedocument.spreadsheetml.template"],
["xlw", "application/vnd.ms-excel"],
["xm", "audio/xm"],
["xml", "application/xml"],
["xns", "application/xcap-ns+xml"],
["xo", "application/vnd.olpc-sugar"],
["xop", "application/xop+xml"],
["xpi", "application/x-xpinstall"],
["xpl", "application/xproc+xml"],
["xpm", "image/x-xpixmap"],
["xpr", "application/vnd.is-xpr"],
["xps", "application/vnd.ms-xpsdocument"],
["xpw", "application/vnd.intercon.formnet"],
["xpx", "application/vnd.intercon.formnet"],
["xsd", "application/xml"],
["xsl", "application/xml"],
["xslt", "application/xslt+xml"],
["xsm", "application/vnd.syncml+xml"],
["xspf", "application/xspf+xml"],
["xul", "application/vnd.mozilla.xul+xml"],
["xvm", "application/xv+xml"],
["xvml", "application/xv+xml"],
["xwd", "image/x-xwindowdump"],
["xyz", "chemical/x-xyz"],
["xz", "application/x-xz"],
["yaml", "text/yaml"],
["yang", "application/yang"],
["yin", "application/yin+xml"],
["yml", "text/yaml"],
["ymp", "text/x-suse-ymp"],
["z", "application/x-compress"],
["z1", "application/x-zmachine"],
["z2", "application/x-zmachine"],
["z3", "application/x-zmachine"],
["z4", "application/x-zmachine"],
["z5", "application/x-zmachine"],
["z6", "application/x-zmachine"],
["z7", "application/x-zmachine"],
["z8", "application/x-zmachine"],
["zaz", "application/vnd.zzazz.deck+xml"],
["zip", "application/zip"],
["zir", "application/vnd.zul"],
["zirz", "application/vnd.zul"],
["zmm", "application/vnd.handheld-entertainment+xml"],
["zsh", "text/x-scriptzsh"]
]);
function sr(e, t, n) {
const r = Oh(e), { webkitRelativePath: i } = e, a = typeof t == "string" ? t : typeof i == "string" && i.length > 0 ? i : `./${e.name}`;
return typeof r.path != "string" && ys(r, "path", a), ys(r, "relativePath", a), r;
}
function Oh(e) {
const { name: t } = e;
if (t && t.lastIndexOf(".") !== -1 && !e.type) {
const r = t.split(".").pop().toLowerCase(), i = Th.get(r);
i && Object.defineProperty(e, "type", {
value: i,
writable: !1,
configurable: !1,
enumerable: !0
});
}
return e;
}
function ys(e, t, n) {
Object.defineProperty(e, t, {
value: n,
writable: !1,
configurable: !1,
enumerable: !0
});
}
const Fh = [
// Thumbnail cache files for macOS and Windows
".DS_Store",
// macOs
"Thumbs.db"
// Windows
];
function Ah(e) {
return Rn(this, void 0, void 0, function* () {
return pi(e) && $h(e.dataTransfer) ? Dh(e.dataTransfer, e.type) : Rh(e) ? Ph(e) : Array.isArray(e) && e.every((t) => "getFile" in t && typeof t.getFile == "function") ? _h(e) : [];
});
}
function $h(e) {
return pi(e);
}
function Rh(e) {
return pi(e) && pi(e.target);
}
function pi(e) {
return typeof e == "object" && e !== null;
}
function Ph(e) {
return Ea(e.target.files).map((t) => sr(t));
}
function _h(e) {
return Rn(this, void 0, void 0, function* () {
return (yield Promise.all(e.map((n) => n.getFile()))).map((n) => sr(n));
});
}
function Dh(e, t) {
return Rn(this, void 0, void 0, function* () {
if (e.items) {
const n = Ea(e.items).filter((i) => i.kind === "file");
if (t !== "drop")
return n;
const r = yield Promise.all(n.map(Ih));
return vs(tc(r));
}
return vs(Ea(e.files).map((n) => sr(n)));
});
}
function vs(e) {
return e.filter((t) => Fh.indexOf(t.name) === -1);
}
function Ea(e) {
if (e === null)
return [];
const t = [];
for (let n = 0; n < e.length; n++) {
const r = e[n];
t.push(r);
}
return t;
}
function Ih(e) {
if (typeof e.webkitGetAsEntry != "function")
return xs(e);
const t = e.webkitGetAsEntry();
return t && t.isDirectory ? nc(t) : xs(e, t);
}
function tc(e) {
return e.reduce((t, n) => [
...t,
...Array.isArray(n) ? tc(n) : [n]
], []);
}
function xs(e, t) {
return Rn(this, void 0, void 0, function* () {
var n;
if (globalThis.isSecureContext && typeof e.getAsFileSystemHandle == "function") {
const a = yield e.getAsFileSystemHandle();
if (a === null)
throw new Error(`${e} is not a File`);
if (a !== void 0) {
const o = yield a.getFile();
return o.handle = a, sr(o);
}
}
const r = e.getAsFile();
if (!r)
throw new Error(`${e} is not a File`);
return sr(r, (n = t == null ? void 0 : t.fullPath) !== null && n !== void 0 ? n : void 0);
});
}
function Mh(e) {
return Rn(this, void 0, void 0, function* () {
return e.isDirectory ? nc(e) : jh(e);
});
}
function nc(e) {
const t = e.createReader();
return new Promise((n, r) => {
const i = [];
function a() {
t.readEntries((o) => Rn(this, void 0, void 0, function* () {
if (o.length) {
const s = Promise.all(o.map(Mh));
i.push(s), a();
} else
try {
const s = yield Promise.all(i);
n(s);
} catch (s) {
r(s);
}
}), (o) => {
r(o);
});
}
a();
});
}
function jh(e) {
return Rn(this, void 0, void 0, function* () {
return new Promise((t, n) => {
e.file((r) => {
const i = sr(r, e.fullPath);
t(i);
}, (r) => {
n(r);
});
});
});
}
var Vr = {}, bs;
function zh() {
return bs || (bs = 1, Vr.__esModule = !0, Vr.default = function(e, t) {
if (e && t) {
var n = Array.isArray(t) ? t : t.split(",");
if (n.length === 0)
return !0;
var r = e.name || "", i = (e.type || "").toLowerCase(), a = i.replace(/\/.*$/, "");
return n.some(function(o) {
var s = o.trim().toLowerCase();
return s.charAt(0) === "." ? r.toLowerCase().endsWith(s) : s.endsWith("/*") ? a === s.replace(/\/.*$/, "") : i === s;
});
}
return !0;
}), Vr;
}
var Nh = zh();
const Ki = /* @__PURE__ */ Ia(Nh);
function ws(e) {
return Vh(e) || Bh(e) || ic(e) || Lh();
}
function Lh() {
throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function Bh(e) {
if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
}
function Vh(e) {
if (Array.isArray(e)) return ka(e);
}
function Ss(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var r = Object.getOwnPropertySymbols(e);
t && (r = r.filter(function(i) {
return Object.getOwnPropertyDescriptor(e, i).enumerable;
})), n.push.apply(n, r);
}
return n;
}
function Cs(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t] != null ? arguments[t] : {};
t % 2 ? Ss(Object(n), !0).forEach(function(r) {
rc(e, r, n[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Ss(Object(n)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
});
}
return e;
}
function rc(e, t, n) {
return t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function wr(e, t) {
return Uh(e) || Wh(e, t) || ic(e, t) || qh();
}
function qh() {
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function ic(e, t) {
if (e) {
if (typeof e == "string") return ka(e, t);
var n = Object.prototype.toString.call(e).slice(8, -1);
if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ka(e, t);
}
}
function ka(e, t) {
(t == null || t > e.length) && (t = e.length);
for (var n = 0, r = new Array(t); n < t; n++)
r[n] = e[n];
return r;
}
function Wh(e, t) {
var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
if (n != null) {
var r = [], i = !0, a = !1, o, s;
try {
for (n = n.call(e); !(i = (o = n.next()).done) && (r.push(o.value), !(t && r.length === t)); i = !0)
;
} catch (l) {
a = !0, s = l;
} finally {
try {
!i && n.return != null && n.return();
} finally {
if (a) throw s;
}
}
return r;
}
}
function Uh(e) {
if (Array.isArray(e)) return e;
}
var Hh = typeof Ki == "function" ? Ki : Ki.default, Yh = "file-invalid-type", Kh = "file-too-large", Qh = "file-too-small", Gh = "too-many-files", Zh = function() {
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", n = t.split(","), r = n.length > 1 ? "one of ".concat(n.join(", ")) : n[0];
return {
code: Yh,
message: "File type must be ".concat(r)
};
}, Es = function(t) {
return {
code: Kh,
message: "File is larger than ".concat(t, " ").concat(t === 1 ? "byte" : "bytes")
};
}, ks = function(t) {
return {
code: Qh,
message: "File is smaller than ".concat(t, " ").concat(t === 1 ? "byte" : "bytes")
};
}, Xh = {
code: Gh,
message: "Too many files"
};
function ac(e, t) {
var n = e.type === "application/x-moz-file" || Hh(e, t);
return [n, n ? null : Zh(t)];
}
function oc(e, t, n) {
if (hn(e.size))
if (hn(t) && hn(n)) {
if (e.size > n) return [!1, Es(n)];
if (e.size < t) return [!1, ks(t)];
} else {
if (hn(t) && e.size < t) return [!1, ks(t)];
if (hn(n) && e.size > n) return [!1, Es(n)];
}
return [!0, null];
}
function hn(e) {
return e != null;
}
function Jh(e) {
var t = e.files, n = e.accept, r = e.minSize, i = e.maxSize, a = e.multiple, o = e.maxFiles, s = e.validator;
return !a && t.length > 1 || a && o >= 1 && t.length > o ? !1 : t.every(function(l) {
var c = ac(l, n), m = wr(c, 1), h = m[0], d = oc(l, r, i), g = wr(d, 1), x = g[0], f = s ? s(l) : null;
return h && x && !f;
});
}
function di(e) {
return typeof e.isPropagationStopped == "function" ? e.isPropagationStopped() : typeof e.cancelBubble < "u" ? e.cancelBubble : !1;
}
function qr(e) {
return e.dataTransfer ? Array.prototype.some.call(e.dataTransfer.types, function(t) {
return t === "Files" || t === "application/x-moz-file";
}) : !!e.target && !!e.target.files;
}
function Ts(e) {
e.preventDefault();
}
function eg(e) {
return e.indexOf("MSIE") !== -1 || e.indexOf("Trident/") !== -1;
}
function tg(e) {
return e.indexOf("Edge/") !== -1;
}
function ng() {
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : window.navigator.userAgent;
return eg(e) || tg(e);
}
function At() {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
t[n] = arguments[n];
return function(r) {
for (var i = arguments.length, a = new Array(i > 1 ? i - 1 : 0), o = 1; o < i; o++)
a[o - 1] = arguments[o];
return t.some(function(s) {
return !di(r) && s && s.apply(void 0, [r].concat(a)), di(r);
});
};
}
function rg() {
return "showOpenFilePicker" in window;
}
function ig(e) {
if (hn(e)) {
var t = Object.entries(e).filter(function(n) {
var r = wr(n, 2), i = r[0], a = r[1], o = !0;
return sc(i) || (console.warn('Skipped "'.concat(i, '" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')), o = !1), (!Array.isArray(a) || !a.every(lc)) && (console.warn('Skipped "'.concat(i, '" because an invalid file extension was provided.')), o = !1), o;
}).reduce(function(n, r) {
var i = wr(r, 2), a = i[0], o = i[1];
return Cs(Cs({}, n), {}, rc({}, a, o));
}, {});
return [{
// description is required due to https://crbug.com/1264708
description: "Files",
accept: t
}];
}
return e;
}
function ag(e) {
if (hn(e))
return Object.entries(e).reduce(function(t, n) {
var r = wr(n, 2), i = r[0], a = r[1];
return [].concat(ws(t), [i], ws(a));
}, []).filter(function(t) {
return sc(t) || lc(t);
}).join(",");
}
function og(e) {
return e instanceof DOMException && (e.name === "AbortError" || e.code === e.ABORT_ERR);
}
function sg(e) {
return e instanceof DOMException && (e.name === "SecurityError" || e.code === e.SECURITY_ERR);
}
function sc(e) {
return e === "audio/*" || e === "video/*" || e === "image/*" || e === "text/*" || e === "application/*" || /\w+\/[-+.\w]+/g.test(e);
}
function lc(e) {
return /^.*\.[\w]+$/.test(e);
}
var lg = ["children"], cg = ["open"], ug = ["refKey", "role", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragEnter", "onDragOver", "onDragLeave", "onDrop"], pg = ["refKey", "onChange", "onClick"];
function dg(e) {
return hg(e) || mg(e) || cc(e) || fg();
}
function fg() {
throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function mg(e) {
if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
}
function hg(e) {
if (Array.isArray(e)) return Ta(e);
}
function Qi(e, t) {
return vg(e) || yg(e, t) || cc(e, t) || gg();
}
function gg() {
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function cc(e, t) {
if (e) {
if (typeof e == "string") return Ta(e, t);
var n = Object.prototype.toString.call(e).slice(8, -1);
if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Ta(e, t);
}
}
function Ta(e, t) {
(t == null || t > e.length) && (t = e.length);
for (var n = 0, r = new Array(t); n < t; n++)
r[n] = e[n];
return r;
}
function yg(e, t) {
var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
if (n != null) {
var r = [], i = !0, a = !1, o, s;
try {
for (n = n.call(e); !(i = (o = n.next()).done) && (r.push(o.value), !(t && r.length === t)); i = !0)
;
} catch (l) {
a = !0, s = l;
} finally {
try {
!i && n.return != null && n.return();
} finally {
if (a) throw s;
}
}
return r;
}
}
function vg(e) {
if (Array.isArray(e)) return e;
}
function Os(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var r = Object.getOwnPropertySymbols(e);
t && (r = r.filter(function(i) {
return Object.getOwnPropertyDescriptor(e, i).enumerable;
})), n.push.apply(n, r);
}
return n;
}
function De(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t] != null ? arguments[t] : {};
t % 2 ? Os(Object(n), !0).forEach(function(r) {
Oa(e, r, n[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Os(Object(n)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
});
}
return e;
}
function Oa(e, t, n) {
return t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function fi(e, t) {
if (e == null) return {};
var n = xg(e, t), r, i;
if (Object.getOwnPropertySymbols) {
var a = Object.getOwnPropertySymbols(e);
for (i = 0; i < a.length; i++)
r = a[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
}
return n;
}
function xg(e, t) {
if (e == null) return {};
var n = {}, r = Object.keys(e), i, a;
for (a = 0; a < r.length; a++)
i = r[a], !(t.indexOf(i) >= 0) && (n[i] = e[i]);
return n;
}
var Ja = /* @__PURE__ */ gc(function(e, t) {
var n = e.children, r = fi(e, lg), i = pc(r), a = i.open, o = fi(i, cg);
return yc(t, function() {
return {
open: a
};
}, [a]), /* @__PURE__ */ We.createElement(vc, null, n(De(De({}, o), {}, {
open: a
})));
});
Ja.displayName = "Dropzone";
var uc = {
disabled: !1,
getFilesFromEvent: Ah,
maxSize: 1 / 0,
minSize: 0,
multiple: !0,
maxFiles: 0,
preventDropOnDocument: !0,
noClick: !1,
noKeyboard: !1,
noDrag: !1,
noDragEventsBubbling: !1,
validator: null,
useFsAccessApi: !1,
autoFocus: !1
};
Ja.defaultProps = uc;
Ja.propTypes = {
/**
* Render function that exposes the dropzone state and prop getter fns
*
* @param {object} params
* @param {Function} params.getRootProps Returns the props you should apply to the root drop container you render
* @param {Function} params.getInputProps Returns the props you should apply to hidden file input you render
* @param {Function} params.open Open the native file selection dialog
* @param {boolean} params.isFocused Dropzone area is in focus
* @param {boolean} params.isFileDialogActive File dialog is opened
* @param {boolean} params.isDragActive Active drag is in progress
* @param {boolean} params.isDragAccept Dragged files are accepted
* @param {boolean} params.isDragReject Some dragged files are rejected
* @param {File[]} params.acceptedFiles Accepted files
* @param {FileRejection[]} params.fileRejections Rejected files and why they were rejected
*/
children: b.func,
/**
* Set accepted file types.
* Checkout https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker types option for more information.
* Keep in mind that mime type determination is not reliable across platforms. CSV files,
* for example, are reported as text/plain under macOS but as application/vnd.ms-excel under
* Windows. In some cases there might not be a mime type set at all (https://github.com/react-dropzone/react-dropzone/issues/276).
*/
accept: b.objectOf(b.arrayOf(b.string)),
/**
* Allow drag 'n' drop (or selection from the file dialog) of multiple files
*/
multiple: b.bool,
/**
* If false, allow dropped items to take over the current browser window
*/
preventDropOnDocument: b.bool,
/**
* If true, disables click to open the native file selection dialog
*/
noClick: b.bool,
/**
* If true, disables SPACE/ENTER to open the native file selection dialog.
* Note that it also stops tracking the focus state.
*/
noKeyboard: b.bool,
/**
* If true, disables drag 'n' drop
*/
noDrag: b.bool,
/**
* If true, stops drag event propagation to parents
*/
noDragEventsBubbling: b.bool,
/**
* Minimum file size (in bytes)
*/
minSize: b.number,
/**
* Maximum file size (in bytes)
*/
maxSize: b.number,
/**
* Maximum accepted number of files
* The default value is 0 which means there is no limitation to how many files are accepted.
*/
maxFiles: b.number,
/**
* Enable/disable the dropzone
*/
disabled: b.bool,
/**
* Use this to provide a custom file aggregator
*
* @param {(DragEvent|Event|Array<FileSystemFileHandle>)} event A drag event or input change event (if files were selected via the file dialog)
*/
getFilesFromEvent: b.func,
/**
* Cb for when closing the file dialog with no selection
*/
onFileDialogCancel: b.func,
/**
* Cb for when opening the file dialog
*/
onFileDialogOpen: b.func,
/**
* Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API
* to open the file picker instead of using an `<input type="file">` click event.
*/
useFsAccessApi: b.bool,
/**
* Set to true to focus the root element on render
*/
autoFocus: b.bool,
/**
* Cb for when the `dragenter` event occurs.
*
* @param {DragEvent} event
*/
onDragEnter: b.func,
/**
* Cb for when the `dragleave` event occurs
*
* @param {DragEvent} event
*/
onDragLeave: b.func,
/**
* Cb for when the `dragover` event occurs
*
* @param {DragEvent} event
*/
onDragOver: b.func,
/**
* Cb for when the `drop` event occurs.
* Note that this callback is invoked after the `getFilesFromEvent` callback is done.
*
* Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.
* `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.
* If `multiple` is set to false and additional files are dropped,
* all files besides the first will be rejected.
* Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.
*
* Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.
* If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.
*
* `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.
* For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:
*
* ```js
* function onDrop(acceptedFiles) {
* const req = request.post('/upload')
* acceptedFiles.forEach(file => {
* req.attach(file.name, file)
* })
* req.end(callback)
* }
* ```
*
* @param {File[]} acceptedFiles
* @param {FileRejection[]} fileRejections
* @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)
*/
onDrop: b.func,
/**
* Cb for when the `drop` event occurs.
* Note that if no files are accepted, this callback is not invoked.
*
* @param {File[]} files
* @param {(DragEvent|Event)} event
*/
onDropAccepted: b.func,
/**
* Cb for when the `drop` event occurs.
* Note that if no files are rejected, this callback is not invoked.
*
* @param {FileRejection[]} fileRejections
* @param {(DragEvent|Event)} event
*/
onDropRejected: b.func,
/**
* Cb for when there's some error from any of the promises.
*
* @param {Error} error
*/
onError: b.func,
/**
* Custom validation function. It must return null if there's no errors.
* @param {File} file
* @returns {FileError|FileError[]|null}
*/
validator: b.func
};
var Fa = {
isFocused: !1,
isFileDialogActive: !1,
isDragActive: !1,
isDragAccept: !1,
isDragReject: !1,
acceptedFiles: [],
fileRejections: []
};
function pc() {
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = De(De({}, uc), e), n = t.accept, r = t.disabled, i = t.getFilesFromEvent, a = t.maxSize, o = t.minSize, s = t.multiple, l = t.maxFiles, c = t.onDragEnter, m = t.onDragLeave, h = t.onDragOver, d = t.onDrop, g = t.onDropAccepted, x = t.onDropRejected, f = t.onFileDialogCancel, E = t.onFileDialogOpen, y = t.useFsAccessApi, T = t.autoFocus, k = t.preventDropOnDocument, v = t.noClick, w = t.noKeyboard, P = t.noDrag, M = t.noDragEventsBubbling, I = t.onError, N = t.validator, p = Ie(function() {
return ag(n);
}, [n]), R = Ie(function() {
return ig(n);
}, [n]), $ = Ie(function() {
return typeof E == "function" ? E : Fs;
}, [E]), Z = Ie(function() {
return typeof f == "function" ? f : Fs;
}, [f]), j = pt(null), re = pt(null), L = hc(bg, Fa), Q = Qi(L, 2), V = Q[0], K = Q[1], S = V.isFocused, D = V.isFileDialogActive, ne = pt(typeof window < "u" && window.isSecureContext && y && rg()), le = function() {
!ne.current && D && setTimeout(function() {
if (re.current) {
var A = re.current.files;
A.length || (K({
type: "closeDialog"
}), Z());
}
}, 300);
};
ot(function() {
return window.addEventListener("focus", le, !1), function() {
window.removeEventListener("focus", le, !1);
};
}, [re, D, Z, ne]);
var ae = pt([]), de = function(A) {
j.current && j.current.contains(A.target) || (A.preventDefault(), ae.current = []);
};
ot(function() {
return k && (document.addEventListener("dragover", Ts, !1), document.addEventListener("drop", de, !1)), function() {
k && (document.removeEventListener("dragover", Ts), document.removeEventListener("drop", de));
};
}, [j, k]), ot(function() {
return !r && T && j.current && j.current.focus(), function() {
};
}, [j, T, r]);
var H = we(function(O) {
I ? I(O) : console.error(O);
}, [I]), ie = we(function(O) {
O.preventDefault(), O.persist(), lt(O), ae.current = [].concat(dg(ae.current), [O.target]), qr(O) && Promise.resolve(i(O)).then(function(A) {
if (!(di(O) && !M)) {
var F = A.length, W = F > 0 && Jh({
files: A,
accept: p,
minSize: o,
maxSize: a,
multiple: s,
maxFiles: l,
validator: N
}), J = F > 0 && !W;
K({
isDragAccept: W,
isDragReject: J,
isDragActive: !0,
type: "setDraggedFiles"
}), c && c(O);
}
}).catch(function(A) {
return H(A);
});
}, [i, c, H, M, p, o, a, s, l, N]), fe = we(function(O) {
O.preventDefault(), O.persist(), lt(O);
var A = qr(O);
if (A && O.dataTransfer)
try {
O.dataTransfer.dropEffect = "copy";
} catch {
}
return A && h && h(O), !1;
}, [h, M]), ge = we(function(O) {
O.preventDefault(), O.persist(), lt(O);
var A = ae.current.filter(function(W) {
return j.current && j.current.contains(W);
}), F = A.indexOf(O.target);
F !== -1 && A.splice(F, 1), ae.current = A, !(A.length > 0) && (K({
type: "setDraggedFiles",
isDragActive: !1,
isDragAccept: !1,
isDragReject: !1
}), qr(O) && m && m(O));
}, [j, m, M]), B = we(function(O, A) {
var F = [], W = [];
O.forEach(function(J) {
var ue = ac(J, p), me = Qi(ue, 2), Y = me[0], X = me[1], ve = oc(J, o, a), $e = Qi(ve, 2), Re = $e[0], Ke = $e[1], Le = N ? N(J) : null;
if (Y && Re && !Le)
F.push(J);
else {
var et = [X, Ke];
Le && (et = et.concat(Le)), W.push({
file: J,
errors: et.filter(function(oe) {
return oe;
})
});
}
}), (!s && F.length > 1 || s && l >= 1 && F.length > l) && (F.forEach(function(J) {
W.push({
file: J,
errors: [Xh]
});
}), F.splice(0)), K({
acceptedFiles: F,
fileRejections: W,
isDragReject: W.length > 0,
type: "setFiles"
}), d && d(F, W, A), W.length > 0 && x && x(W, A), F.length > 0 && g && g(F, A);
}, [K, s, p, o, a, l, d, g, x, N]), G = we(function(O) {
O.preventDefault(), O.persist(), lt(O), ae.current = [], qr(O) && Promise.resolve(i(O)).then(function(A) {
di(O) && !M || B(A, O);
}).catch(function(A) {
return H(A);
}), K({
type: "reset"
});
}, [i, B, H, M]), z = we(function() {
if (ne.current) {
K({
type: "openDialog"
}), $();
var O = {
multiple: s,
types: R
};
window.showOpenFilePicker(O).then(function(A) {
return i(A);
}).then(function(A) {
B(A, null), K({
type: "closeDialog"
});
}).catch(function(A) {
og(A) ? (Z(A), K({
type: "closeDialog"
})) : sg(A) ? (ne.current = !1, re.current ? (re.current.value = null, re.current.click()) : H(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))) : H(A);
});
return;
}
re.current && (K({
type: "openDialog"
}), $(), re.current.value = null, re.current.click());
}, [K, $, Z, y, B, H, R, s]), ye = we(function(O) {
!j.current || !j.current.isEqualNode(O.target) || (O.key === " " || O.key === "Enter" || O.keyCode === 32 || O.keyCode === 13) && (O.preventDefault(), z());
}, [j, z]), Oe = we(function() {
K({
type: "focus"
});
}, []), Ye = we(function() {
K({
type: "blur"
});
}, []), It = we(function() {
v || (ng() ? setTimeout(z, 0) : z());
}, [v, z]), qe = function(A) {
return r ? null : A;
}, Je = function(A) {
return w ? null : qe(A);
}, Et = function(A) {
return P ? null : qe(A);
}, lt = function(A) {
M && A.stopPropagation();
}, Mt = Ie(function() {
return function() {
var O = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, A = O.refKey, F = A === void 0 ? "ref" : A, W = O.role, J = O.onKeyDown, ue = O.onFocus, me = O.onBlur, Y = O.onClick, X = O.onDragEnter, ve = O.onDragOver, $e = O.onDragLeave, Re = O.onDrop, Ke = fi(O, ug);
return De(De(Oa({
onKeyDown: Je(At(J, ye)),
onFocus: Je(At(ue, Oe)),
onBlur: Je(At(me, Ye)),
onClick: qe(At(Y, It)),
onDragEnter: Et(At(X, ie)),
onDragOver: Et(At(ve, fe)),
onDragLeave: Et(At($e, ge)),
onDrop: Et(At(Re, G)),
role: typeof W == "string" && W !== "" ? W : "presentation"
}, F, j), !r && !w ? {
tabIndex: 0
} : {}), Ke);
};
}, [j, ye, Oe, Ye, It, ie, fe, ge, G, w, P, r]), ce = we(function(O) {
O.stopPropagation();
}, []), yt = Ie(function() {
return function() {
var O = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, A = O.refKey, F = A === void 0 ? "ref" : A, W = O.onChange, J = O.onClick, ue = fi(O, pg), me = Oa({
accept: p,
multiple: s,
type: "file",
style: {
border: 0,
clip: "rect(0, 0, 0, 0)",
clipPath: "inset(50%)",
height: "1px",
margin: "0 -1px -1px 0",
overflow: "hidden",
padding: 0,
position: "absolute",
width: "1px",
whiteSpace: "nowrap"
},
onChange: qe(At(W, G)),
onClick: qe(At(J, ce)),
tabIndex: -1
}, F, re);
return De(De({}, me), ue);
};
}, [re, n, s, G, r]);
return De(De({}, V), {}, {
isFocused: S && !r,
getRootProps: Mt,
getInputProps: yt,
rootRef: j,
inputRef: re,
open: qe(z)
});
}
function bg(e, t) {
switch (t.type) {
case "focus":
return De(De({}, e), {}, {
isFocused: !0
});
case "blur":
return De(De({}, e), {}, {
isFocused: !1
});
case "openDialog":
return De(De({}, Fa), {}, {
isFileDialogActive: !0
});
case "closeDialog":
return De(De({}, e), {}, {
isFileDialogActive: !1
});
case "setDraggedFiles":
return De(De({}, e), {}, {
isDragActive: t.isDragActive,
isDragAccept: t.isDragAccept,
isDragReject: t.isDragReject
});
case "setFiles":
return De(De({}, e), {}, {
acceptedFiles: t.acceptedFiles,
fileRejections: t.fileRejections,
isDragReject: t.isDragReject
});
case "reset":
return De({}, Fa);
default:
return e;
}
}
function Fs() {
}
const wg = Xe(/* @__PURE__ */ u("path", {
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"
}), "CheckCircle"), As = Xe(/* @__PURE__ */ u("path", {
d: "M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm2 16H8v-2h8zm0-4H8v-2h8zm-3-5V3.5L18.5 9z"
}), "Description"), Sg = Xe(/* @__PURE__ */ u("path", {
d: "M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2M8.5 13.5l2.5 3.01L14.5 12l4.5 6H5z"
}), "Image"), Cg = ({
file: e,
onRemove: t
}) => {
const n = () => e.file.type.startsWith("image/") ? /* @__PURE__ */ u(Sg, {}) : e.file.type.includes("pdf") ? /* @__PURE__ */ u(As, {}) : /* @__PURE__ */ u(As, {}), r = () => {
switch (e.status) {
case "success":
return /* @__PURE__ */ u(wg, { color: "success" });
case "uploading":
return /* @__PURE__ */ u(ar, { size: 16 });
default:
return null;
}
}, i = (a) => {
if (a === 0) return "0 Bytes";
const o = 1024, s = ["Bytes", "KB", "MB", "GB"], l = Math.floor(Math.log(a) / Math.log(o));
return parseFloat((a / Math.pow(o, l)).toFixed(2)) + " " + s[l];
};
return /* @__PURE__ */ U(
Hc,
{
sx: {
p: 2,
mb: 1,
display: "flex",
alignItems: "center",
gap: 2,
border: "1px solid #e0e0e0"
},
children: [
/* @__PURE__ */ U(q, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
n(),
r()
] }),
/* @__PURE__ */ U(q, { sx: { flex: 1, minWidth: 0 }, children: [
/* @__PURE__ */ u(se, { variant: "body2", noWrap: !0, children: e.file.name }),
/* @__PURE__ */ U(se, { variant: "caption", color: "textSecondary", children: [
i(e.file.size),
" • ",
e.file.type
] })
] }),
/* @__PURE__ */ u(Hr, { title: "Remove file", children: /* @__PURE__ */ u(
yi,
{
size: "small",
onClick: () => t(e.id),
color: "error",
children: /* @__PURE__ */ u(Ml, {})
}
) })
]
}
);
}, Yg = ({
config: e,
value: t = [],
onChange: n,
onSubmit: r,
disabled: i = !1,
className: a,
style: o,
title: s,
subtitle: l,
buttonText: c,
fileSupportedText: m
}) => {
const [h, d] = at(t), [g, x] = at([]), [f, E] = at(!1), [y, T] = at(!1), [k, v] = at(
[]
), w = pt(null);
ot(() => {
d(t);
}, [t]);
const P = we(
(j) => {
var L, Q;
return ((L = e == null ? void 0 : e.fileTypes) == null ? void 0 : L.some((V) => {
if (V.includes("*")) {
const K = V.split("/")[0];
return j.type.startsWith(K);
}
return j.type === V;
})) ? e != null && e.maxSize && j.size > e.maxSize ? `File size exceeds maximum limit of ${(e.maxSize / 1048576).toFixed(1)}MB` : null : `File type ${j.type} is not allowed. Allowed types: ${(Q = e == null ? void 0 : e.fileTypes) == null ? void 0 : Q.join(", ")}`;
},
[e]
), M = we(
async (j) => {
console.log("handleFiles called with:", j.length, "files"), E(!0);
const re = [], L = [];
try {
for (const V of j) {
let K = null;
if (e != null && e.multiple && h.some(
(D) => D.file.name === V.name && D.file.size === V.size && D.file.lastModified === V.lastModified
)) {
L.push(`${V.name}: File already exists`);
continue;
}
if (K = P(V), !K && (e != null && e.customValidation))
try {
const S = e.customValidation(V);
S instanceof Promise ? K = await S : K = S;
} catch (S) {
K = `Custom validation failed: ${S instanceof Error ? S.message : "Unknown error"}`;
}
if (K)
L.push(`${V.name}: ${K}`);
else {
const S = {
id: `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
file: V,
preview: V.type.startsWith("image/") ? URL.createObjectURL(V) : void 0,
progress: 0,
status: "pending",
uploadedAt: /* @__PURE__ */ new Date()
};
re.push(S);
}
}
const Q = e != null && e.multiple ? [...h, ...re] : re;
d(Q), n == null || n(Q), L.length > 0 ? (v(L), x(L)) : (v([]), x([]));
} catch (Q) {
const V = `Unexpected error: ${Q instanceof Error ? Q.message : "Unknown error"}`;
v([V]), x([V]);
}
},
[h, e == null ? void 0 : e.multiple, P, e == null ? void 0 : e.customValidation, n]
), I = we(
(j) => {
E(!0);
const re = h.filter((L) => L.id !== j);
d(re), n == null || n(re), v([]), w.current && (w.current.value = "");
},
[h, n]
), N = we(() => {
if (e != null && e.required && h.length === 0) {
x([`${e.title} is required`]);
return;
}
v([]), T(!0);
const j = h.filter((re) => re.status !== "error");
r == null || r(j);
}, [h, r, e == null ? void 0 : e.required, e == null ? void 0 : e.title]), { getRootProps: p, getInputProps: R, isDragActive: $ } = pc({
onDrop: M,
multiple: e == null ? void 0 : e.multiple,
disabled: i,
noClick: !1,
noKeyboard: !1
});
ot(() => {
if (!f) return;
const j = [], re = [...k, ...j];
re.length > 0 ? x(re) : x([]);
}, [
h,
e == null ? void 0 : e.required,
e == null ? void 0 : e.title,
f,
y,
k
]);
const Z = () => {
var j;
switch (((j = e == null ? void 0 : e.submitButton) == null ? void 0 : j.position) || "right") {
case "left":
return "flex-start";
case "center":
return "center";
case "right":
return "flex-end";
default:
return "flex-end";
}
};
return /* @__PURE__ */ U(q, { className: a, style: o, children: [
/* @__PURE__ */ U(se, { variant: "h6", gutterBottom: !0, children: [
e == null ? void 0 : e.title,
(e == null ? void 0 : e.required) && /* @__PURE__ */ u("span", { style: { color: "red" }, children: " *" })
] }),
(e == null ? void 0 : e.description) && /* @__PURE__ */ u(se, { variant: "body2", color: "textSecondary", gutterBottom: !0, children: e == null ? void 0 : e.description }),
/* @__PURE__ */ xc(
st,
{
...p(),
key: `dropzone-${h.length}`,
sx: {
border: "1px dashed",
borderColor: $ ? "primary.main" : "#CCCCCC",
backgroundColor: $ ? "action.hover" : "#F5F5F5",
boxShadow: "none",
p: 3,
textAlign: "center",
cursor: i ? "not-allowed" : "pointer",
transition: "all 0.2s ease",
"&:hover": {
borderColor: i ? "grey.300" : "primary.main",
backgroundColor: i ? "background.paper" : "action.hover"
}
}
},
/* @__PURE__ */ u("input", { ...R(), ref: w }),
/* @__PURE__ */ u(
yi,
{
sx: {
borderRadius: "8px"
},
children: /* @__PURE__ */ u(
si,
{
sx: { width: 36, height: 36, color: "primary.main" }
}
)
}
),
/* @__PURE__ */ u(se, { sx: { fontSize: "16px", fontWeight: 600, color: "primary.main" }, children: s }),
/* @__PURE__ */ u(se, { sx: { fontSize: "12px", fontWeight: 400, color: "primary.main" }, children: l }),
/* @__PURE__ */ u(Ve, { onClick: () => {
var j;
return (j = w.current) == null ? void 0 : j.click();
}, sx: { my: 2 }, startIcon: /* @__PURE__ */ u(si, {}), variant: "contained", children: c }),
/* @__PURE__ */ u(se, { sx: { fontSize: "12px", fontWeight: 400 }, children: m })
),
g.length > 0 && /* @__PURE__ */ u(Yc, { severity: "error", sx: { mt: 2 }, children: g.map((j, re) => /* @__PURE__ */ u(se, { variant: "body2", children: j }, re)) }),
h.length > 0 && /* @__PURE__ */ U(q, { sx: { mt: 2 }, children: [
/* @__PURE__ */ U(se, { variant: "subtitle1", gutterBottom: !0, children: [
"Selected Files (",
h.length,
")"
] }),
h.map((j) => /* @__PURE__ */ u(Cg, { file: j, onRemove: I }, j.id))
] }),
(e == null ? void 0 : e.helperText) && /* @__PURE__ */ u(
se,
{
variant: "caption",
color: "textSecondary",
sx: { mt: 1, display: "block" },
children: e.helperText
}
),
(e == null ? void 0 : e.submitButton) && /* @__PURE__ */ u(
q,
{
sx: {
mt: 3,
display: "flex",
justifyContent: Z()
},
children: /* @__PURE__ */ u(
Ve,
{
variant: "contained",
onClick: N,
disabled: i || e.submitButton.disabled || h.length === 0,
startIcon: e.submitButton.loading ? /* @__PURE__ */ u(ar, { size: 16, color: "inherit" }) : void 0,
children: e.submitButton.text
}
)
}
)
] });
};
export {
Sh as CustomButtons,
ba as DEFAULT_DATE_FORMAT,
Yg as DocumentUpload,
xm as FINFLOW_FRONTEND_DEFAULT_PRIMARY,
zl as FieldRenderer,
Cg as FilePreview,
Em as FinAutocomplete,
on as FinCheckbox,
km as FinCheckboxGroup,
Il as FinChip,
Bg as FinCustomizedVerticalStepper,
_l as FinDateField,
Fm as FinDragDropList,
Dm as FinEditableGrid,
Ug as FinForm,
Vg as FinInfoCard,
Im as FinListCards,
Cm as FinMobileField,
qg as FinPhaseCard,
qn as FinRadioGroup,
Ga as FinSelect,
xa as FinSwitch,
Pm as FinTabs,
xt as FinTextField,
Tm as FinTextarea,
Om as FinUiHeader,
Lg as FinVerticalStepper,
Hg as ImageComponent,
wh as StepNavigation,
jg as brand,
jm as buildFinformTestIds,
zg as createFinflowFrontendMirrorTheme,
gm as createNeutralToneScale,
Pl as dateFormatToPlaceholder,
un as digitsOnly,
Nm as fetchApiData,
he as finflowPalette,
bh as generateSchema,
jl as getApiConfig,
Ln as hasApiConfig,
Bi as neutral,
Yt as normalizeDialCode,
Vi as normalizePhoneToStoreFormat,
Sm as parsePhoneDisplayParts,
wm as parseStoreFormat,
Ig as primary,
zm as resolveFieldTestIds,
Mg as secondary,
Wg as shouldShowField,
Lm as useApiData,
Rr as useFinInputTokens,
Ng as validatePhone
};