@veevarts/design-system 2.0.0-alpha.60 → 2.0.0-alpha.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +5 -5
- package/dist/index.js +865 -863
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as a, jsxs as c, Fragment as de } from "react/jsx-runtime";
|
|
2
2
|
import { HeroUIProvider as ro, ToastProvider as io, cn as m, Card as _e, CardBody as Re, DatePicker as Lr, Popover as Na, PopoverTrigger as ka, Button as _r, PopoverContent as Ca, ScrollShadow as so, TimeInput as lo, Input as ze, SelectItem as $t, Alert as yt, Tooltip as xt, Divider as Mt, Dropdown as ta, DropdownTrigger as aa, DropdownMenu as na, DropdownItem as Ut, ButtonGroup as oo, useInput as co, NumberInput as zn, Image as ja, CardHeader as Ki, CardFooter as uo, Chip as ht, Autocomplete as Zi, AutocompleteItem as Qi, Checkbox as an, ModalContent as Xn, ModalHeader as Jn, ModalBody as er, ModalFooter as Xi, Accordion as tr, AccordionItem as ar, Tabs as nr, Tab as Wa, DropdownSection as Fr, Spinner as Ji, Switch as mo, CheckboxGroup as fo, RadioGroup as po, Radio as ho, TableHeader as bo, TableColumn as go, TableBody as xo, Avatar as yo, Link as vo, Textarea as wo, Breadcrumbs as No, BreadcrumbItem as ko, useProviderContext as Co } from "@heroui/react";
|
|
3
3
|
export * from "@heroui/react";
|
|
4
|
-
import Q, { createContext as $a, useContext as St, useState as K, useMemo as ue, useId as Ye, useRef as ge, useEffect as
|
|
5
|
-
import { u as Do, C as Eo, a as nn, B as I, I as O, S as At, h as
|
|
4
|
+
import Q, { createContext as $a, useContext as St, useState as K, useMemo as ue, useId as Ye, useRef as ge, useEffect as Ve, useReducer as $o, useCallback as X, forwardRef as rr, isValidElement as So, useLayoutEffect as Wt, Fragment as Ao } from "react";
|
|
5
|
+
import { u as Do, C as Eo, a as nn, B as I, I as O, S as At, h as se, s as Le, b as fe, M as ir, c as Ba, d as es, T as Lo } from "./hasContent-BCRxiry-.js";
|
|
6
6
|
import { D as Bg } from "./hasContent-BCRxiry-.js";
|
|
7
7
|
import { Clock3 as _o, Globe as Rr, User as Mr, Heading as ts, Check as as, ListTodo as ns, ListOrdered as rs, List as sr, AlignJustify as Fo, AlignRight as Ro, AlignCenter as Mo, AlignLeft as is, CornerDownLeft as Po, Redo2 as Oo, Undo2 as zo, Eraser as Pr, Minus as To, Quote as Bo, CodeSquare as Io, FileText as Vo, Link2 as Uo, Highlighter as ss, Palette as ls, Code as jo, Underline as Wo, Strikethrough as Ho, Italic as qo, Bold as Yo, X as Go, ZoomOut as Ko, ZoomIn as Zo, Link as Qo, Clock as Or, CheckCircle as Xo, AlertCircle as Jo, Plus as lr, CircleDollarSign as os } from "lucide-react";
|
|
8
8
|
import { m as Ha, LazyMotion as ds, domAnimation as cs, motion as qa, AnimatePresence as Tn } from "framer-motion";
|
|
@@ -34,7 +34,7 @@ import { Document as Nd } from "@tiptap/extension-document";
|
|
|
34
34
|
import { Text as kd } from "@tiptap/extension-text";
|
|
35
35
|
import { Dropcursor as Cd } from "@tiptap/extension-dropcursor";
|
|
36
36
|
import { Gapcursor as $d } from "@tiptap/extension-gapcursor";
|
|
37
|
-
const
|
|
37
|
+
const Ie = {
|
|
38
38
|
brand: {
|
|
39
39
|
primary: {
|
|
40
40
|
500: "#C14615",
|
|
@@ -77,7 +77,7 @@ const Be = {
|
|
|
77
77
|
900: "#172554"
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
},
|
|
80
|
+
}, ke = {
|
|
81
81
|
xs: "0.25rem",
|
|
82
82
|
// 4px - Fine control (½ of base unit)
|
|
83
83
|
sm: "0.5rem",
|
|
@@ -116,7 +116,7 @@ const Be = {
|
|
|
116
116
|
tight: "1.25",
|
|
117
117
|
normal: "1.5"
|
|
118
118
|
}
|
|
119
|
-
}, { gray: La } =
|
|
119
|
+
}, { gray: La } = Ie.neutral, Sd = Ie.palettes.warning[700], Ad = Ie.palettes.warning[100], Et = {
|
|
120
120
|
rustFill: "#FBEBE4",
|
|
121
121
|
rustBorder: "#EBC3B1",
|
|
122
122
|
page: "#F6F7F8",
|
|
@@ -127,12 +127,12 @@ const Be = {
|
|
|
127
127
|
infoFill: "#E8EEFC"
|
|
128
128
|
}, rn = {
|
|
129
129
|
// Brand — the 500 already matches the scale exactly.
|
|
130
|
-
"--rust":
|
|
130
|
+
"--rust": Ie.brand.primary[500],
|
|
131
131
|
"--rust-fill": Et.rustFill,
|
|
132
132
|
"--rust-border": Et.rustBorder,
|
|
133
133
|
// Chrome
|
|
134
134
|
"--page": Et.page,
|
|
135
|
-
"--surface":
|
|
135
|
+
"--surface": Ie.neutral.white,
|
|
136
136
|
"--border": Et.border,
|
|
137
137
|
"--hair": Et.hair,
|
|
138
138
|
// Text — all four match the scale's grays exactly.
|
|
@@ -141,13 +141,13 @@ const Be = {
|
|
|
141
141
|
"--sub": La[500],
|
|
142
142
|
"--muted": La[400],
|
|
143
143
|
// Semantic — text tone paired with the tint it sits on.
|
|
144
|
-
"--ok":
|
|
144
|
+
"--ok": Ie.semantic.success,
|
|
145
145
|
"--ok-fill": Et.okFill,
|
|
146
146
|
"--warn": Sd,
|
|
147
147
|
"--warn-fill": Ad,
|
|
148
|
-
"--danger":
|
|
148
|
+
"--danger": Ie.semantic.danger,
|
|
149
149
|
"--danger-fill": Et.dangerFill,
|
|
150
|
-
"--info":
|
|
150
|
+
"--info": Ie.semantic.info,
|
|
151
151
|
"--info-fill": Et.infoFill
|
|
152
152
|
};
|
|
153
153
|
Object.fromEntries(
|
|
@@ -166,7 +166,7 @@ ${n}${r}
|
|
|
166
166
|
}
|
|
167
167
|
`;
|
|
168
168
|
}
|
|
169
|
-
const
|
|
169
|
+
const he = {
|
|
170
170
|
/** `--line`: row, card and divider hairline. */
|
|
171
171
|
line: "#E7E7E9",
|
|
172
172
|
/** `--line2`: the lighter hairline under list rows and above the role bar. */
|
|
@@ -191,7 +191,7 @@ const pe = {
|
|
|
191
191
|
"warn-icon": "#EFD9B2",
|
|
192
192
|
/** `--eb` / `--ef`, plus the banner icon disc `.banner.err .bic`. */
|
|
193
193
|
"danger-fill": "#FCEBEB",
|
|
194
|
-
danger:
|
|
194
|
+
danger: Ie.semantic.danger,
|
|
195
195
|
"danger-icon": "#F3D3CF",
|
|
196
196
|
/** `--ib` / `--if` */
|
|
197
197
|
"info-fill": "#EAF1FC",
|
|
@@ -203,8 +203,8 @@ const pe = {
|
|
|
203
203
|
/** `.btn-dstr` — the fill behind an irreversible confirmation. */
|
|
204
204
|
destructive: "#A32D2D"
|
|
205
205
|
};
|
|
206
|
-
({ ...
|
|
207
|
-
const Lt =
|
|
206
|
+
({ ...he });
|
|
207
|
+
const Lt = Ie.palettes.info, _a = {
|
|
208
208
|
light: { content1: "#ffffff", content2: "#f4f4f5" },
|
|
209
209
|
dark: { content1: "#18181b", content2: "#27272a" }
|
|
210
210
|
}, ms = [
|
|
@@ -1242,7 +1242,7 @@ const nc = typeof document < "u" ? (vn = Q.useInsertionEffect) !== null && vn !=
|
|
|
1242
1242
|
};
|
|
1243
1243
|
function ra(e, t, n) {
|
|
1244
1244
|
let [r, i] = K(e || t), s = ge(r), o = ge(e !== void 0), l = e !== void 0;
|
|
1245
|
-
|
|
1245
|
+
Ve(() => {
|
|
1246
1246
|
let f = o.current;
|
|
1247
1247
|
f !== l && process.env.NODE_ENV !== "production" && console.warn(`WARN: A component changed from ${f ? "controlled" : "uncontrolled"} to ${l ? "controlled" : "uncontrolled"}.`), o.current = l;
|
|
1248
1248
|
}, [
|
|
@@ -1304,7 +1304,7 @@ const rc = Q.forwardRef(
|
|
|
1304
1304
|
...k
|
|
1305
1305
|
}, $) => {
|
|
1306
1306
|
const [C, S] = ra(p, r, b), F = Q.useMemo(() => {
|
|
1307
|
-
let
|
|
1307
|
+
let w, _;
|
|
1308
1308
|
const A = [
|
|
1309
1309
|
"[--active-fg-color:hsl(var(--step-fg-color))]",
|
|
1310
1310
|
"[--active-border-color:hsl(var(--step-color))]",
|
|
@@ -1316,28 +1316,28 @@ const rc = Q.forwardRef(
|
|
|
1316
1316
|
];
|
|
1317
1317
|
switch (e) {
|
|
1318
1318
|
case "primary":
|
|
1319
|
-
|
|
1319
|
+
w = "[--step-color:var(--heroui-primary)]", _ = "[--step-fg-color:var(--heroui-primary-foreground)]";
|
|
1320
1320
|
break;
|
|
1321
1321
|
case "secondary":
|
|
1322
|
-
|
|
1322
|
+
w = "[--step-color:var(--heroui-secondary)]", _ = "[--step-fg-color:var(--heroui-secondary-foreground)]";
|
|
1323
1323
|
break;
|
|
1324
1324
|
case "success":
|
|
1325
|
-
|
|
1325
|
+
w = "[--step-color:var(--heroui-success)]", _ = "[--step-fg-color:var(--heroui-success-foreground)]";
|
|
1326
1326
|
break;
|
|
1327
1327
|
case "warning":
|
|
1328
|
-
|
|
1328
|
+
w = "[--step-color:var(--heroui-warning)]", _ = "[--step-fg-color:var(--heroui-warning-foreground)]";
|
|
1329
1329
|
break;
|
|
1330
1330
|
case "danger":
|
|
1331
|
-
|
|
1331
|
+
w = "[--step-color:var(--heroui-danger)]", _ = "[--step-fg-color:var(--heroui-danger-foreground)]";
|
|
1332
1332
|
break;
|
|
1333
1333
|
case "default":
|
|
1334
|
-
|
|
1334
|
+
w = "[--step-color:var(--heroui-default)]", _ = "[--step-fg-color:var(--heroui-default-foreground)]";
|
|
1335
1335
|
break;
|
|
1336
1336
|
default:
|
|
1337
|
-
|
|
1337
|
+
w = "[--step-color:var(--heroui-primary)]", _ = "[--step-fg-color:var(--heroui-primary-foreground)]";
|
|
1338
1338
|
break;
|
|
1339
1339
|
}
|
|
1340
|
-
return A.unshift(_), A.unshift(
|
|
1340
|
+
return A.unshift(_), A.unshift(w), A;
|
|
1341
1341
|
}, [e]);
|
|
1342
1342
|
return /* @__PURE__ */ c(
|
|
1343
1343
|
"nav",
|
|
@@ -1361,7 +1361,7 @@ const rc = Q.forwardRef(
|
|
|
1361
1361
|
children: i
|
|
1362
1362
|
}
|
|
1363
1363
|
),
|
|
1364
|
-
/* @__PURE__ */ a("ol", { className: m("flex flex-row flex-nowrap gap-x-3", F, x), "data-testid": "stepper-list", children: Array.from({ length: n })?.map((
|
|
1364
|
+
/* @__PURE__ */ a("ol", { className: m("flex flex-row flex-nowrap gap-x-3", F, x), "data-testid": "stepper-list", children: Array.from({ length: n })?.map((w, _) => {
|
|
1365
1365
|
const A = C === _ ? "active" : C < _ ? "inactive" : "complete", P = t === "activeLabel" && A === "active" && !!s?.[_], E = o && A !== "active" && !!s?.[_];
|
|
1366
1366
|
return /* @__PURE__ */ c(
|
|
1367
1367
|
"li",
|
|
@@ -1497,7 +1497,7 @@ function og(e) {
|
|
|
1497
1497
|
}
|
|
1498
1498
|
) }) });
|
|
1499
1499
|
}
|
|
1500
|
-
function
|
|
1500
|
+
function Ne(e, t = "en-US", n = "USD") {
|
|
1501
1501
|
try {
|
|
1502
1502
|
return new Intl.NumberFormat(t, {
|
|
1503
1503
|
style: "currency",
|
|
@@ -1574,14 +1574,14 @@ const Gr = {
|
|
|
1574
1574
|
ariaLabel: C = "Progress",
|
|
1575
1575
|
invalidLabelSuffix: S = ", has errors",
|
|
1576
1576
|
testId: F,
|
|
1577
|
-
isStepReachable:
|
|
1577
|
+
isStepReachable: w,
|
|
1578
1578
|
..._
|
|
1579
1579
|
}, A) {
|
|
1580
1580
|
const [P, E] = ra(
|
|
1581
1581
|
s,
|
|
1582
1582
|
r,
|
|
1583
1583
|
i
|
|
1584
|
-
), D = Gr[t] ?? Gr.primary, M = l ?? D.active, z = d ?? D.fg,
|
|
1584
|
+
), D = Gr[t] ?? Gr.primary, M = l ?? D.active, z = d ?? D.fg, U = (Y, T) => {
|
|
1585
1585
|
const q = Y.ariaLabel ?? (typeof Y.title == "string" ? Y.title : null) ?? `${T + 1}`;
|
|
1586
1586
|
return Y.invalid ? `${q}${S}` : q;
|
|
1587
1587
|
};
|
|
@@ -1593,7 +1593,7 @@ const Gr = {
|
|
|
1593
1593
|
...F ? { "data-testid": F } : {},
|
|
1594
1594
|
children: [
|
|
1595
1595
|
/* @__PURE__ */ a("div", { className: m("flex items-center", $), children: n?.map((Y, T) => {
|
|
1596
|
-
const
|
|
1596
|
+
const ne = T === P ? "active" : T < P ? "complete" : "inactive", q = w ? w(T) : !0;
|
|
1597
1597
|
return /* @__PURE__ */ c(Q.Fragment, { children: [
|
|
1598
1598
|
/* @__PURE__ */ a(
|
|
1599
1599
|
I,
|
|
@@ -1604,9 +1604,9 @@ const Gr = {
|
|
|
1604
1604
|
radius: "full",
|
|
1605
1605
|
variant: "light",
|
|
1606
1606
|
testId: `${F ?? "horizontal-steps"}-step-${T}`,
|
|
1607
|
-
"aria-current":
|
|
1607
|
+
"aria-current": ne === "active" ? "step" : void 0,
|
|
1608
1608
|
"aria-describedby": Y.describedBy,
|
|
1609
|
-
"aria-label":
|
|
1609
|
+
"aria-label": U(Y, T),
|
|
1610
1610
|
"data-invalid": Y.invalid ? "true" : void 0,
|
|
1611
1611
|
isDisabled: !q,
|
|
1612
1612
|
className: m(
|
|
@@ -1631,7 +1631,7 @@ const Gr = {
|
|
|
1631
1631
|
children: /* @__PURE__ */ a(ds, { features: cs, children: /* @__PURE__ */ a(
|
|
1632
1632
|
Ha.div,
|
|
1633
1633
|
{
|
|
1634
|
-
animate:
|
|
1634
|
+
animate: ne,
|
|
1635
1635
|
className: m(
|
|
1636
1636
|
"relative flex size-8 items-center justify-center rounded-full text-[13px] font-medium",
|
|
1637
1637
|
p
|
|
@@ -1658,7 +1658,7 @@ const Gr = {
|
|
|
1658
1658
|
color: M
|
|
1659
1659
|
}
|
|
1660
1660
|
},
|
|
1661
|
-
children:
|
|
1661
|
+
children: ne === "complete" ? /* @__PURE__ */ a(
|
|
1662
1662
|
Bs,
|
|
1663
1663
|
{
|
|
1664
1664
|
className: "size-4",
|
|
@@ -1685,7 +1685,7 @@ const Gr = {
|
|
|
1685
1685
|
] }, T);
|
|
1686
1686
|
}) }),
|
|
1687
1687
|
/* @__PURE__ */ a("div", { className: m("mt-2.5 hidden md:flex", v), children: n?.map((Y, T) => {
|
|
1688
|
-
const
|
|
1688
|
+
const ne = T <= P;
|
|
1689
1689
|
return /* @__PURE__ */ c(Q.Fragment, { children: [
|
|
1690
1690
|
/* @__PURE__ */ a(
|
|
1691
1691
|
"div",
|
|
@@ -1699,10 +1699,10 @@ const Gr = {
|
|
|
1699
1699
|
{
|
|
1700
1700
|
className: m(
|
|
1701
1701
|
"absolute left-1/2 top-0 -translate-x-1/2 whitespace-nowrap text-center text-[12px] font-medium transition-colors duration-200",
|
|
1702
|
-
|
|
1702
|
+
ne ? y : k
|
|
1703
1703
|
),
|
|
1704
1704
|
style: {
|
|
1705
|
-
color:
|
|
1705
|
+
color: ne ? M : h
|
|
1706
1706
|
},
|
|
1707
1707
|
children: Y.title
|
|
1708
1708
|
}
|
|
@@ -1726,22 +1726,22 @@ const Gr = {
|
|
|
1726
1726
|
}
|
|
1727
1727
|
);
|
|
1728
1728
|
lc.displayName = "HorizontalSteps";
|
|
1729
|
-
const
|
|
1729
|
+
const lt = (e) => rn[e], oc = {
|
|
1730
1730
|
done: "solar:check-circle-bold",
|
|
1731
1731
|
"needs-fix": "solar:danger-triangle-bold",
|
|
1732
1732
|
optional: "solar:record-outline"
|
|
1733
1733
|
}, Vs = {
|
|
1734
|
-
done: { icon:
|
|
1735
|
-
"needs-fix": { icon:
|
|
1736
|
-
optional: { icon:
|
|
1737
|
-
}, dc =
|
|
1734
|
+
done: { icon: lt("--ok"), meta: lt("--sub") },
|
|
1735
|
+
"needs-fix": { icon: lt("--warn"), meta: lt("--warn") },
|
|
1736
|
+
optional: { icon: lt("--muted"), meta: lt("--sub") }
|
|
1737
|
+
}, dc = lt("--ink"), cc = {
|
|
1738
1738
|
ready: "solar:check-circle-bold",
|
|
1739
1739
|
fix: "solar:danger-triangle-bold",
|
|
1740
1740
|
live: "solar:check-circle-bold"
|
|
1741
1741
|
}, uc = {
|
|
1742
|
-
ready: { fill:
|
|
1743
|
-
fix: { fill:
|
|
1744
|
-
live: { fill:
|
|
1742
|
+
ready: { fill: lt("--ok-fill"), text: lt("--ok") },
|
|
1743
|
+
fix: { fill: lt("--warn-fill"), text: lt("--warn") },
|
|
1744
|
+
live: { fill: lt("--ok-fill"), text: lt("--ok") }
|
|
1745
1745
|
}, mt = {
|
|
1746
1746
|
/** Scrolls inside once `maxHeight` (or the parent) caps it. */
|
|
1747
1747
|
root: "flex min-h-0 flex-col gap-3 overflow-y-auto overscroll-contain",
|
|
@@ -1782,16 +1782,16 @@ function mc({ step: e, labels: t }) {
|
|
|
1782
1782
|
if (e.status === "optional")
|
|
1783
1783
|
return /* @__PURE__ */ c("span", { className: mt.meta, style: { color: n.meta }, children: [
|
|
1784
1784
|
t.optional,
|
|
1785
|
-
|
|
1785
|
+
se(e.summary) ? /* @__PURE__ */ c(de, { children: [
|
|
1786
1786
|
" · ",
|
|
1787
1787
|
e.summary
|
|
1788
1788
|
] }) : null
|
|
1789
1789
|
] });
|
|
1790
|
-
const r = e.status === "needs-fix" &&
|
|
1790
|
+
const r = e.status === "needs-fix" && se(e.reason) ? e.reason : e.summary, i = e.status === "done" ? t.done : t.needsFix;
|
|
1791
1791
|
return /* @__PURE__ */ c(de, { children: [
|
|
1792
1792
|
/* @__PURE__ */ a("span", { className: "sr-only", children: i }),
|
|
1793
1793
|
" ",
|
|
1794
|
-
|
|
1794
|
+
se(r) ? /* @__PURE__ */ a("span", { className: mt.meta, style: { color: n.meta }, children: r }) : null
|
|
1795
1795
|
] });
|
|
1796
1796
|
}
|
|
1797
1797
|
function fc({
|
|
@@ -1888,7 +1888,7 @@ function pc({
|
|
|
1888
1888
|
/* @__PURE__ */ c("span", { className: la.text, children: [
|
|
1889
1889
|
/* @__PURE__ */ a("span", { className: la.title, children: t }),
|
|
1890
1890
|
" ",
|
|
1891
|
-
|
|
1891
|
+
se(n) ? /* @__PURE__ */ a("span", { className: la.description, children: n }) : null
|
|
1892
1892
|
] })
|
|
1893
1893
|
]
|
|
1894
1894
|
}
|
|
@@ -1997,16 +1997,16 @@ const cg = (e) => {
|
|
|
1997
1997
|
}, S = () => {
|
|
1998
1998
|
t.length !== 0 && (n([]), d([]));
|
|
1999
1999
|
}, F = (E, D, M) => {
|
|
2000
|
-
const z = Math.min(D, M),
|
|
2001
|
-
return E.slice(z,
|
|
2002
|
-
},
|
|
2000
|
+
const z = Math.min(D, M), U = Math.max(D, M);
|
|
2001
|
+
return E.slice(z, U + 1);
|
|
2002
|
+
}, w = (E, D, M) => {
|
|
2003
2003
|
if (M && u !== null) {
|
|
2004
2004
|
o(F(v, u, D)), d([]), h(D);
|
|
2005
2005
|
return;
|
|
2006
2006
|
}
|
|
2007
2007
|
const z = s.includes(E);
|
|
2008
2008
|
o(
|
|
2009
|
-
z ? s.filter((
|
|
2009
|
+
z ? s.filter((U) => U !== E) : [...s, E]
|
|
2010
2010
|
), d([]), h(D);
|
|
2011
2011
|
}, _ = (E, D, M) => {
|
|
2012
2012
|
if (M && f !== null) {
|
|
@@ -2015,7 +2015,7 @@ const cg = (e) => {
|
|
|
2015
2015
|
}
|
|
2016
2016
|
const z = l.includes(E);
|
|
2017
2017
|
d(
|
|
2018
|
-
z ? l.filter((
|
|
2018
|
+
z ? l.filter((U) => U !== E) : [...l, E]
|
|
2019
2019
|
), o([]), b(D);
|
|
2020
2020
|
}, A = (E, D, M) => {
|
|
2021
2021
|
const z = M === "available" ? s.includes(D) ? s : [D] : l.includes(D) ? l : [D];
|
|
@@ -2028,11 +2028,11 @@ const cg = (e) => {
|
|
|
2028
2028
|
const M = E.dataTransfer.getData("text/plain");
|
|
2029
2029
|
if (M)
|
|
2030
2030
|
try {
|
|
2031
|
-
const z = JSON.parse(M),
|
|
2031
|
+
const z = JSON.parse(M), U = (z.items || []).filter(
|
|
2032
2032
|
(Y) => g.has(Y)
|
|
2033
2033
|
);
|
|
2034
|
-
if (
|
|
2035
|
-
D === "selected" ? (x(
|
|
2034
|
+
if (U.length === 0 || z.source === D) return;
|
|
2035
|
+
D === "selected" ? (x(U), o([])) : (y(U), d([]));
|
|
2036
2036
|
} catch {
|
|
2037
2037
|
return;
|
|
2038
2038
|
}
|
|
@@ -2053,7 +2053,7 @@ const cg = (e) => {
|
|
|
2053
2053
|
{
|
|
2054
2054
|
type: "button",
|
|
2055
2055
|
onClick: (z) => {
|
|
2056
|
-
|
|
2056
|
+
w(E, D, z.shiftKey);
|
|
2057
2057
|
},
|
|
2058
2058
|
onMouseDown: (z) => {
|
|
2059
2059
|
z.shiftKey && z.preventDefault();
|
|
@@ -2910,7 +2910,7 @@ function Us(e, t) {
|
|
|
2910
2910
|
}
|
|
2911
2911
|
}), s;
|
|
2912
2912
|
}, [e, t]), [r, i] = K(n);
|
|
2913
|
-
return
|
|
2913
|
+
return Ve(() => {
|
|
2914
2914
|
if (!e)
|
|
2915
2915
|
return;
|
|
2916
2916
|
const s = () => {
|
|
@@ -3045,7 +3045,7 @@ function Fc({
|
|
|
3045
3045
|
}) {
|
|
3046
3046
|
const l = Us(e, t), { toggleModifier: d, executeCommand: u } = js(e, o);
|
|
3047
3047
|
if (!e) return null;
|
|
3048
|
-
const h = t.map((
|
|
3048
|
+
const h = t.map((w) => va(w)), f = h.some((w) => ["bold", "italic", "strike", "underline", "code"].includes(w)), b = h.some((w) => ["textColor", "highlight"].includes(w)), p = h.includes("heading"), g = h.includes("textAlign"), v = h.some((w) => ["bulletList", "orderedList", "taskList"].includes(w)), x = h.includes("blockquote"), y = h.includes("codeBlock"), k = h.includes("link"), $ = h.includes("horizontalRule"), C = h.some((w) => ["undo", "redo"].includes(w)), S = n !== void 0 && r !== void 0;
|
|
3049
3049
|
return /* @__PURE__ */ a("div", { className: `w-full p-2 bg-background border-b border-divider ${i ? "sticky top-0 z-10" : ""} ${s || ""}`, children: /* @__PURE__ */ c("div", { className: "flex flex-row flex-wrap gap-2 w-full items-center", children: [
|
|
3050
3050
|
f && /* @__PURE__ */ c(de, { children: [
|
|
3051
3051
|
/* @__PURE__ */ a(
|
|
@@ -3086,21 +3086,21 @@ function Fc({
|
|
|
3086
3086
|
(g || v || x || y || k || $ || C || S) && /* @__PURE__ */ a(Ot, {})
|
|
3087
3087
|
] }),
|
|
3088
3088
|
g && /* @__PURE__ */ c(de, { children: [
|
|
3089
|
-
/* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: ["left", "center", "right", "justify"].map((
|
|
3090
|
-
const _ = Cc[
|
|
3089
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: ["left", "center", "right", "justify"].map((w) => {
|
|
3090
|
+
const _ = Cc[w], A = e.isActive({ textAlign: w });
|
|
3091
3091
|
return /* @__PURE__ */ a(
|
|
3092
3092
|
Tt,
|
|
3093
3093
|
{
|
|
3094
3094
|
icon: _,
|
|
3095
|
-
label: `Align ${
|
|
3095
|
+
label: `Align ${w}`,
|
|
3096
3096
|
isActive: A,
|
|
3097
3097
|
onClick: () => u("textAlign", {
|
|
3098
3098
|
type: "textAlign",
|
|
3099
3099
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3100
|
-
alignment:
|
|
3100
|
+
alignment: w
|
|
3101
3101
|
})
|
|
3102
3102
|
},
|
|
3103
|
-
|
|
3103
|
+
w
|
|
3104
3104
|
);
|
|
3105
3105
|
}) }),
|
|
3106
3106
|
(v || x || y || k || $ || C || S) && /* @__PURE__ */ a(Ot, {})
|
|
@@ -3111,7 +3111,7 @@ function Fc({
|
|
|
3111
3111
|
{
|
|
3112
3112
|
editor: e,
|
|
3113
3113
|
types: h.filter(
|
|
3114
|
-
(
|
|
3114
|
+
(w) => ["bulletList", "orderedList", "taskList"].includes(w)
|
|
3115
3115
|
)
|
|
3116
3116
|
}
|
|
3117
3117
|
),
|
|
@@ -3184,8 +3184,8 @@ function Fc({
|
|
|
3184
3184
|
Sc,
|
|
3185
3185
|
{
|
|
3186
3186
|
zoom: n,
|
|
3187
|
-
onZoomChange: (
|
|
3188
|
-
r?.(
|
|
3187
|
+
onZoomChange: (w) => {
|
|
3188
|
+
r?.(w), o?.({ type: "zoom", modifier: `${w}%` });
|
|
3189
3189
|
}
|
|
3190
3190
|
}
|
|
3191
3191
|
)
|
|
@@ -3508,36 +3508,36 @@ const Pc = {
|
|
|
3508
3508
|
]
|
|
3509
3509
|
}, Oc = {
|
|
3510
3510
|
// Headings - using design token sizes and weights
|
|
3511
|
-
h1: `font-size: ${Ae.fontSize["4xl"]}; font-weight: ${Ae.fontWeight.semibold}; line-height: ${Ae.lineHeight.tight}; margin: ${
|
|
3512
|
-
h2: `font-size: ${Ae.fontSize["2xl"]}; font-weight: ${Ae.fontWeight.semibold}; line-height: ${Ae.lineHeight.tight}; margin: ${
|
|
3513
|
-
h3: `font-size: ${Ae.fontSize.xl}; font-weight: ${Ae.fontWeight.semibold}; line-height: ${Ae.lineHeight.tight}; margin: ${
|
|
3514
|
-
h4: `font-size: ${Ae.fontSize.lg}; font-weight: ${Ae.fontWeight.semibold}; line-height: ${Ae.lineHeight.tight}; margin: ${
|
|
3515
|
-
h5: `font-size: ${Ae.fontSize.base}; font-weight: ${Ae.fontWeight.semibold}; line-height: ${Ae.lineHeight.tight}; margin: ${
|
|
3516
|
-
h6: `font-size: ${Ae.fontSize.sm}; font-weight: ${Ae.fontWeight.semibold}; line-height: ${Ae.lineHeight.tight}; margin: ${
|
|
3511
|
+
h1: `font-size: ${Ae.fontSize["4xl"]}; font-weight: ${Ae.fontWeight.semibold}; line-height: ${Ae.lineHeight.tight}; margin: ${ke.md} 0 ${ke.sm} 0;`,
|
|
3512
|
+
h2: `font-size: ${Ae.fontSize["2xl"]}; font-weight: ${Ae.fontWeight.semibold}; line-height: ${Ae.lineHeight.tight}; margin: ${ke.md} 0 ${ke.sm} 0;`,
|
|
3513
|
+
h3: `font-size: ${Ae.fontSize.xl}; font-weight: ${Ae.fontWeight.semibold}; line-height: ${Ae.lineHeight.tight}; margin: ${ke.md} 0 ${ke.sm} 0;`,
|
|
3514
|
+
h4: `font-size: ${Ae.fontSize.lg}; font-weight: ${Ae.fontWeight.semibold}; line-height: ${Ae.lineHeight.tight}; margin: ${ke.md} 0 ${ke.sm} 0;`,
|
|
3515
|
+
h5: `font-size: ${Ae.fontSize.base}; font-weight: ${Ae.fontWeight.semibold}; line-height: ${Ae.lineHeight.tight}; margin: ${ke.md} 0 ${ke.sm} 0;`,
|
|
3516
|
+
h6: `font-size: ${Ae.fontSize.sm}; font-weight: ${Ae.fontWeight.semibold}; line-height: ${Ae.lineHeight.tight}; margin: ${ke.md} 0 ${ke.sm} 0;`,
|
|
3517
3517
|
// Paragraph
|
|
3518
3518
|
p: `min-height: ${Ae.lineHeight.normal}em; margin: 0;`,
|
|
3519
3519
|
// Lists
|
|
3520
|
-
ul: `list-style-type: disc; list-style-position: outside; padding-left: ${
|
|
3521
|
-
ol: `list-style-type: decimal; list-style-position: outside; padding-left: ${
|
|
3522
|
-
li: `display: list-item; margin: ${
|
|
3520
|
+
ul: `list-style-type: disc; list-style-position: outside; padding-left: ${ke.xl}; margin: ${ke.md} 0;`,
|
|
3521
|
+
ol: `list-style-type: decimal; list-style-position: outside; padding-left: ${ke.xl}; margin: ${ke.md} 0;`,
|
|
3522
|
+
li: `display: list-item; margin: ${ke.xs} 0;`,
|
|
3523
3523
|
// Text formatting
|
|
3524
3524
|
strong: `font-weight: ${Ae.fontWeight.bold};`,
|
|
3525
3525
|
em: "font-style: italic;",
|
|
3526
3526
|
s: "text-decoration: line-through;",
|
|
3527
3527
|
u: "text-decoration: underline;",
|
|
3528
3528
|
// Code - using mono font family and token colors
|
|
3529
|
-
code: `background-color: ${
|
|
3530
|
-
pre: `background: ${
|
|
3529
|
+
code: `background-color: ${Ie.neutral.gray[100]}; border-radius: 0.4rem; font-size: ${Ae.fontSize.sm}; padding: 0.25em 0.3em; font-family: ${Ae.fontFamily.mono};`,
|
|
3530
|
+
pre: `background: ${Ie.neutral.gray[800]}; border-radius: ${ke.sm}; color: ${Ie.neutral.gray[100]}; font-family: ${Ae.fontFamily.mono}; margin: ${ke.lg} 0; padding: 0.75rem ${ke.md}; overflow-x: auto;`,
|
|
3531
3531
|
// Blockquote
|
|
3532
|
-
blockquote: `border-left: 3px solid ${
|
|
3532
|
+
blockquote: `border-left: 3px solid ${Ie.neutral.gray[300]}; margin: ${ke.lg} 0; padding-left: ${ke.md}; color: ${Ie.neutral.gray[500]};`,
|
|
3533
3533
|
// Horizontal rule
|
|
3534
|
-
hr: `border: none; border-top: 1px solid ${
|
|
3534
|
+
hr: `border: none; border-top: 1px solid ${Ie.neutral.gray[200]}; margin: ${ke.xl} 0;`,
|
|
3535
3535
|
// Links - using brand primary color
|
|
3536
|
-
a: `color: ${
|
|
3536
|
+
a: `color: ${Ie.brand.primary.DEFAULT}; text-decoration: underline; cursor: pointer;`,
|
|
3537
3537
|
// Mark/Highlight - using warning palette
|
|
3538
|
-
mark: `background-color: ${
|
|
3538
|
+
mark: `background-color: ${Ie.palettes.warning[200]}; border-radius: ${ke.xs}; padding: 0 0.125rem;`,
|
|
3539
3539
|
// Task list checkbox label
|
|
3540
|
-
label: `display: flex; align-items: center; gap: ${
|
|
3540
|
+
label: `display: flex; align-items: center; gap: ${ke.sm}; cursor: pointer;`,
|
|
3541
3541
|
// Input checkbox (task items)
|
|
3542
3542
|
input: "cursor: pointer; margin: 0;"
|
|
3543
3543
|
}, zc = {
|
|
@@ -3622,20 +3622,20 @@ const Bc = ({
|
|
|
3622
3622
|
isDisabled: x = !1,
|
|
3623
3623
|
includeInlineStyles: y = !0,
|
|
3624
3624
|
...k
|
|
3625
|
-
} = e, { zoom: $, setZoom: C } = Ec(), S = Kr.lineHeight, F = n * S,
|
|
3625
|
+
} = e, { zoom: $, setZoom: C } = Ec(), S = Kr.lineHeight, F = n * S, w = i ? void 0 : r * S, _ = Q.useMemo(() => Mc(d), [d]), { Component: A, label: P, shouldLabelBeOutside: E, getBaseProps: D, getLabelProps: M, getInputWrapperProps: z } = co({
|
|
3626
3626
|
...k,
|
|
3627
3627
|
variant: u,
|
|
3628
3628
|
// Explicitly pass variant to ensure bordered styling
|
|
3629
3629
|
ref: t,
|
|
3630
3630
|
isMultiline: !0
|
|
3631
|
-
}),
|
|
3631
|
+
}), U = P ? /* @__PURE__ */ a("label", { ...M(), children: P }) : null, Y = Q.useCallback(
|
|
3632
3632
|
({ editor: T }) => {
|
|
3633
|
-
const
|
|
3633
|
+
const ne = T.getHTML(), q = y ? Tc(ne) : ne, J = T.getJSON(), Z = T.getText(), me = Z.length, re = Z.split(/\s+/).filter((oe) => oe.length > 0).length, te = {
|
|
3634
3634
|
html: q,
|
|
3635
3635
|
json: J,
|
|
3636
3636
|
text: Z,
|
|
3637
3637
|
characters: me,
|
|
3638
|
-
words:
|
|
3638
|
+
words: re
|
|
3639
3639
|
};
|
|
3640
3640
|
if (b?.(te), p?.(te), "onChange" in k && typeof k.onChange == "function") {
|
|
3641
3641
|
const oe = {
|
|
@@ -3648,15 +3648,15 @@ const Bc = ({
|
|
|
3648
3648
|
[b, p, k, y]
|
|
3649
3649
|
);
|
|
3650
3650
|
return /* @__PURE__ */ c(A, { ...D(), children: [
|
|
3651
|
-
E ?
|
|
3651
|
+
E ? U : null,
|
|
3652
3652
|
/* @__PURE__ */ a(
|
|
3653
3653
|
"div",
|
|
3654
3654
|
{
|
|
3655
3655
|
...z(),
|
|
3656
3656
|
className: m(z().className, "flex flex-col w-full p-0 gap-0 rich-text-editor"),
|
|
3657
3657
|
style: {
|
|
3658
|
-
maxHeight:
|
|
3659
|
-
overflow:
|
|
3658
|
+
maxHeight: w ? `${w + Kr.toolbarHeight}px` : void 0,
|
|
3659
|
+
overflow: w ? "auto" : void 0
|
|
3660
3660
|
},
|
|
3661
3661
|
children: /* @__PURE__ */ a(
|
|
3662
3662
|
ed,
|
|
@@ -3820,7 +3820,7 @@ const Xr = `h-auto min-w-0 w-full flex-col gap-0 border bg-white text-center sha
|
|
|
3820
3820
|
customAmountPlacement: S = "below",
|
|
3821
3821
|
isRequired: F = !1
|
|
3822
3822
|
}) => {
|
|
3823
|
-
const
|
|
3823
|
+
const w = { ...Hc, ...h }, _ = Ye(), A = `${_}-title`, P = `${_}-custom`, E = Array.isArray(e) ? e : ei, D = {
|
|
3824
3824
|
2: "grid-cols-2",
|
|
3825
3825
|
3: "grid-cols-3"
|
|
3826
3826
|
}, M = {
|
|
@@ -3828,43 +3828,45 @@ const Xr = `h-auto min-w-0 w-full flex-col gap-0 border bg-white text-center sha
|
|
|
3828
3828
|
4: "sm:grid-cols-4",
|
|
3829
3829
|
5: "sm:grid-cols-5",
|
|
3830
3830
|
6: "sm:grid-cols-6"
|
|
3831
|
-
}, z = `${D[f]} ${M[b]}`, [
|
|
3831
|
+
}, z = `${D[f]} ${M[b]}`, [U, Y] = ra(
|
|
3832
3832
|
t,
|
|
3833
3833
|
n,
|
|
3834
3834
|
r
|
|
3835
|
-
), [T,
|
|
3836
|
-
(
|
|
3835
|
+
), [T, ne] = K(
|
|
3836
|
+
() => !i && U?.isCustom ? String(U.amount) : ""
|
|
3837
|
+
), [q, J] = K(!1), [Z, me] = K(0), re = X(
|
|
3838
|
+
(ie) => {
|
|
3837
3839
|
if (p) return;
|
|
3838
3840
|
const $e = {
|
|
3839
|
-
amount:
|
|
3841
|
+
amount: ie.amount,
|
|
3840
3842
|
isCustom: !1,
|
|
3841
|
-
presetId:
|
|
3843
|
+
presetId: ie.id
|
|
3842
3844
|
};
|
|
3843
|
-
Y($e),
|
|
3845
|
+
Y($e), ne(""), J(!1), me((Be) => Be + 1), i?.($e);
|
|
3844
3846
|
},
|
|
3845
3847
|
[p, Y, i]
|
|
3846
3848
|
), te = X(
|
|
3847
|
-
(
|
|
3849
|
+
(ie) => {
|
|
3848
3850
|
if (p) return;
|
|
3849
|
-
if (
|
|
3851
|
+
if (ne(ie !== void 0 ? String(ie) : ""), i) {
|
|
3850
3852
|
Y(null);
|
|
3851
3853
|
return;
|
|
3852
3854
|
}
|
|
3853
|
-
if (J(!1),
|
|
3855
|
+
if (J(!1), ie === void 0 || isNaN(ie)) {
|
|
3854
3856
|
Y(null);
|
|
3855
3857
|
return;
|
|
3856
3858
|
}
|
|
3857
3859
|
Y({
|
|
3858
|
-
amount:
|
|
3860
|
+
amount: ie,
|
|
3859
3861
|
isCustom: !0
|
|
3860
3862
|
});
|
|
3861
3863
|
},
|
|
3862
3864
|
[p, Y, i]
|
|
3863
3865
|
), oe = X(() => {
|
|
3864
3866
|
if (p) return;
|
|
3865
|
-
const
|
|
3866
|
-
|
|
3867
|
-
}, [p, T, i]),
|
|
3867
|
+
const ie = T !== "" ? parseFloat(T) : void 0;
|
|
3868
|
+
ie === void 0 || isNaN(ie) || i?.({ amount: ie, isCustom: !0 });
|
|
3869
|
+
}, [p, T, i]), j = Q.useMemo(
|
|
3868
3870
|
() => ({
|
|
3869
3871
|
style: "currency",
|
|
3870
3872
|
currency: s,
|
|
@@ -3873,19 +3875,19 @@ const Xr = `h-auto min-w-0 w-full flex-col gap-0 border bg-white text-center sha
|
|
|
3873
3875
|
// the currency and formatting match our locale prop
|
|
3874
3876
|
}),
|
|
3875
3877
|
[s]
|
|
3876
|
-
), V = Q.useMemo(() => Uc(o, s), [o, s]), ee = (
|
|
3877
|
-
const
|
|
3878
|
+
), V = Q.useMemo(() => Uc(o, s), [o, s]), ee = (ie) => U !== null && !U.isCustom && U.presetId === ie.id, Ge = (ie, $e) => {
|
|
3879
|
+
const Be = !i && q, Se = C === "tile" && S === "inline", rt = Se ? /* @__PURE__ */ a("span", { className: qt.affix, "data-testid": "donation-amounts-custom-symbol", children: V.symbol }) : void 0, We = /* @__PURE__ */ c(
|
|
3878
3880
|
"div",
|
|
3879
3881
|
{
|
|
3880
|
-
className: m("flex items-start gap-3",
|
|
3882
|
+
className: m("flex items-start gap-3", Se && qt.field),
|
|
3881
3883
|
"data-testid": "donation-amounts-custom-field",
|
|
3882
3884
|
children: [
|
|
3883
3885
|
/* @__PURE__ */ a(
|
|
3884
3886
|
zn,
|
|
3885
3887
|
{
|
|
3886
3888
|
id: P,
|
|
3887
|
-
placeholder:
|
|
3888
|
-
"aria-label":
|
|
3889
|
+
placeholder: w.customAmountPlaceholder,
|
|
3890
|
+
"aria-label": Se ? w.customAmountLabel ?? w.customAmountAriaLabel : w.customAmountLabel ? void 0 : w.customAmountAriaLabel,
|
|
3889
3891
|
onInput: i ? () => {
|
|
3890
3892
|
Y(null), J(!0);
|
|
3891
3893
|
} : () => J(!0),
|
|
@@ -3894,26 +3896,26 @@ const Xr = `h-auto min-w-0 w-full flex-col gap-0 border bg-white text-center sha
|
|
|
3894
3896
|
minValue: d,
|
|
3895
3897
|
maxValue: u,
|
|
3896
3898
|
step: 0.01,
|
|
3897
|
-
formatOptions:
|
|
3898
|
-
startContent: V.position === "start" ?
|
|
3899
|
-
endContent: V.position === "end" ?
|
|
3899
|
+
formatOptions: Se ? V.formatOptions : j,
|
|
3900
|
+
startContent: V.position === "start" ? rt : void 0,
|
|
3901
|
+
endContent: V.position === "end" ? rt : void 0,
|
|
3900
3902
|
value: T !== "" ? parseFloat(T) : void 0,
|
|
3901
3903
|
onValueChange: te,
|
|
3902
3904
|
isDisabled: p,
|
|
3903
3905
|
className: "flex-1",
|
|
3904
3906
|
classNames: {
|
|
3905
3907
|
inputWrapper: m(
|
|
3906
|
-
|
|
3908
|
+
ie.inputWrapper,
|
|
3907
3909
|
$e.wrapper,
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
+
Se && qt.inputWrapper,
|
|
3911
|
+
Be && ie.inputWrapperActive
|
|
3910
3912
|
),
|
|
3911
|
-
input: m(
|
|
3913
|
+
input: m(ie.input, $e.input, Se && qt.input)
|
|
3912
3914
|
},
|
|
3913
3915
|
"data-testid": "donation-amounts-custom-input",
|
|
3914
3916
|
hideStepper: !0
|
|
3915
3917
|
},
|
|
3916
|
-
i ? `custom-${Z}` :
|
|
3918
|
+
i ? `custom-${Z}` : U?.isCustom === !1 ? U.presetId : "custom"
|
|
3917
3919
|
),
|
|
3918
3920
|
i && /* @__PURE__ */ a(
|
|
3919
3921
|
I,
|
|
@@ -3925,100 +3927,100 @@ const Xr = `h-auto min-w-0 w-full flex-col gap-0 border bg-white text-center sha
|
|
|
3925
3927
|
onPress: oe,
|
|
3926
3928
|
isDisabled: p || !q,
|
|
3927
3929
|
"data-testid": "donation-amounts-add-button",
|
|
3928
|
-
children:
|
|
3930
|
+
children: w.addDonationButton
|
|
3929
3931
|
}
|
|
3930
3932
|
)
|
|
3931
3933
|
]
|
|
3932
3934
|
}
|
|
3933
|
-
),
|
|
3934
|
-
|
|
3935
|
+
), pe = l && (Se ? We : /* @__PURE__ */ c("div", { className: m("flex flex-col", ie.inputBase), children: [
|
|
3936
|
+
w.customAmountLabel && /* @__PURE__ */ a(
|
|
3935
3937
|
"label",
|
|
3936
3938
|
{
|
|
3937
3939
|
htmlFor: P,
|
|
3938
|
-
className:
|
|
3940
|
+
className: ie.customLabel,
|
|
3939
3941
|
"data-testid": "donation-amounts-custom-label",
|
|
3940
|
-
children:
|
|
3942
|
+
children: w.customAmountLabel
|
|
3941
3943
|
}
|
|
3942
3944
|
),
|
|
3943
|
-
|
|
3945
|
+
We
|
|
3944
3946
|
] }));
|
|
3945
3947
|
return /* @__PURE__ */ c(
|
|
3946
3948
|
"div",
|
|
3947
3949
|
{
|
|
3948
|
-
className:
|
|
3950
|
+
className: ie.root,
|
|
3949
3951
|
"data-testid": "donation-amounts-root",
|
|
3950
3952
|
"data-variant": C,
|
|
3951
|
-
"data-custom-placement":
|
|
3953
|
+
"data-custom-placement": Se ? "inline" : void 0,
|
|
3952
3954
|
children: [
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3955
|
+
w.eyebrow && /* @__PURE__ */ a("p", { className: ie.eyebrow, "data-testid": "donation-amounts-eyebrow", children: w.eyebrow }),
|
|
3956
|
+
w.title && /* @__PURE__ */ c("p", { id: A, className: ie.title, "data-testid": "donation-amounts-title", children: [
|
|
3957
|
+
w.title,
|
|
3956
3958
|
F && /* @__PURE__ */ a("span", { "aria-hidden": "true", className: "ml-0.5 text-pos-danger", children: "*" })
|
|
3957
3959
|
] }),
|
|
3958
|
-
|
|
3959
|
-
(E.length > 0 ||
|
|
3960
|
+
w.caption && /* @__PURE__ */ a("p", { className: ie.caption, "data-testid": "donation-amounts-caption", children: w.caption }),
|
|
3961
|
+
(E.length > 0 || Se && pe) && /* @__PURE__ */ c(
|
|
3960
3962
|
"div",
|
|
3961
3963
|
{
|
|
3962
3964
|
role: "group",
|
|
3963
|
-
"aria-labelledby":
|
|
3964
|
-
"aria-label":
|
|
3965
|
-
className:
|
|
3965
|
+
"aria-labelledby": w.title ? A : void 0,
|
|
3966
|
+
"aria-label": w.title ? void 0 : w.presetsAriaLabel,
|
|
3967
|
+
className: Se ? qt.row : m(ie.grid, C === "tile" && z),
|
|
3966
3968
|
"data-testid": "donation-amounts-presets",
|
|
3967
3969
|
children: [
|
|
3968
|
-
E.map((
|
|
3969
|
-
const
|
|
3970
|
+
E.map((xe) => {
|
|
3971
|
+
const le = ee(xe) && !Be;
|
|
3970
3972
|
return /* @__PURE__ */ c(
|
|
3971
3973
|
I,
|
|
3972
3974
|
{
|
|
3973
3975
|
color: "default",
|
|
3974
3976
|
variant: "bordered",
|
|
3975
3977
|
disableRipple: !0,
|
|
3976
|
-
"aria-pressed":
|
|
3978
|
+
"aria-pressed": le,
|
|
3977
3979
|
className: m(
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3980
|
+
ie.preset,
|
|
3981
|
+
Se && qt.preset,
|
|
3982
|
+
le ? ie.presetSelected : ie.presetIdle
|
|
3981
3983
|
),
|
|
3982
|
-
onPress: () =>
|
|
3984
|
+
onPress: () => re(xe),
|
|
3983
3985
|
isDisabled: p,
|
|
3984
|
-
"data-selected":
|
|
3985
|
-
"data-testid": `donation-amounts-preset-${
|
|
3986
|
+
"data-selected": le || void 0,
|
|
3987
|
+
"data-testid": `donation-amounts-preset-${xe.id}`,
|
|
3986
3988
|
children: [
|
|
3987
|
-
/* @__PURE__ */ a("span", { className: m(
|
|
3988
|
-
|
|
3989
|
-
|
|
3989
|
+
/* @__PURE__ */ a("span", { className: m(ie.amount, le && ie.amountSelected), children: xe.label || Qr(xe.amount, o, s, C !== "pos") }),
|
|
3990
|
+
xe.sublabel && " ",
|
|
3991
|
+
xe.sublabel && /* @__PURE__ */ a(
|
|
3990
3992
|
"span",
|
|
3991
3993
|
{
|
|
3992
|
-
className:
|
|
3993
|
-
"data-testid": `donation-amounts-preset-${
|
|
3994
|
-
children:
|
|
3994
|
+
className: ie.sublabel,
|
|
3995
|
+
"data-testid": `donation-amounts-preset-${xe.id}-sublabel`,
|
|
3996
|
+
children: xe.sublabel
|
|
3995
3997
|
}
|
|
3996
3998
|
)
|
|
3997
3999
|
]
|
|
3998
4000
|
},
|
|
3999
|
-
|
|
4001
|
+
xe.id
|
|
4000
4002
|
);
|
|
4001
4003
|
}),
|
|
4002
|
-
|
|
4004
|
+
Se && pe
|
|
4003
4005
|
]
|
|
4004
4006
|
}
|
|
4005
4007
|
),
|
|
4006
|
-
!
|
|
4008
|
+
!Se && pe
|
|
4007
4009
|
]
|
|
4008
4010
|
}
|
|
4009
4011
|
);
|
|
4010
|
-
},
|
|
4011
|
-
|
|
4012
|
+
}, Ue = /* @__PURE__ */ c("div", { className: "space-y-4", "data-testid": "donation-amounts-root", children: [
|
|
4013
|
+
w.title && /* @__PURE__ */ a("h2", { id: A, className: "text-base font-semibold", "data-testid": "donation-amounts-title", children: w.title }),
|
|
4012
4014
|
E.length > 0 && /* @__PURE__ */ a(
|
|
4013
4015
|
"div",
|
|
4014
4016
|
{
|
|
4015
4017
|
role: "group",
|
|
4016
|
-
"aria-labelledby":
|
|
4017
|
-
"aria-label":
|
|
4018
|
+
"aria-labelledby": w.title ? A : void 0,
|
|
4019
|
+
"aria-label": w.title ? void 0 : w.presetsAriaLabel,
|
|
4018
4020
|
className: m("grid gap-3", z),
|
|
4019
4021
|
"data-testid": "donation-amounts-presets",
|
|
4020
|
-
children: E.map((
|
|
4021
|
-
const $e =
|
|
4022
|
+
children: E.map((ie) => {
|
|
4023
|
+
const $e = U !== null && !U.isCustom && U.presetId === ie.id;
|
|
4022
4024
|
return /* @__PURE__ */ a(
|
|
4023
4025
|
I,
|
|
4024
4026
|
{
|
|
@@ -4026,12 +4028,12 @@ const Xr = `h-auto min-w-0 w-full flex-col gap-0 border bg-white text-center sha
|
|
|
4026
4028
|
variant: $e ? "solid" : g,
|
|
4027
4029
|
className: "w-full",
|
|
4028
4030
|
"aria-pressed": $e,
|
|
4029
|
-
onPress: () => ie
|
|
4031
|
+
onPress: () => re(ie),
|
|
4030
4032
|
isDisabled: p,
|
|
4031
|
-
"data-testid": `donation-amounts-preset-${
|
|
4032
|
-
children:
|
|
4033
|
+
"data-testid": `donation-amounts-preset-${ie.id}`,
|
|
4034
|
+
children: ie.label || Qr(ie.amount, o, s)
|
|
4033
4035
|
},
|
|
4034
|
-
|
|
4036
|
+
ie.id
|
|
4035
4037
|
);
|
|
4036
4038
|
})
|
|
4037
4039
|
}
|
|
@@ -4040,8 +4042,8 @@ const Xr = `h-auto min-w-0 w-full flex-col gap-0 border bg-white text-center sha
|
|
|
4040
4042
|
/* @__PURE__ */ a(
|
|
4041
4043
|
zn,
|
|
4042
4044
|
{
|
|
4043
|
-
placeholder:
|
|
4044
|
-
"aria-label":
|
|
4045
|
+
placeholder: w.customAmountPlaceholder,
|
|
4046
|
+
"aria-label": w.customAmountAriaLabel,
|
|
4045
4047
|
onInput: i ? () => {
|
|
4046
4048
|
Y(null), J(!0);
|
|
4047
4049
|
} : void 0,
|
|
@@ -4051,7 +4053,7 @@ const Xr = `h-auto min-w-0 w-full flex-col gap-0 border bg-white text-center sha
|
|
|
4051
4053
|
minValue: d,
|
|
4052
4054
|
maxValue: u,
|
|
4053
4055
|
step: 0.01,
|
|
4054
|
-
formatOptions:
|
|
4056
|
+
formatOptions: j,
|
|
4055
4057
|
value: T !== "" ? parseFloat(T) : void 0,
|
|
4056
4058
|
onValueChange: te,
|
|
4057
4059
|
isDisabled: p,
|
|
@@ -4059,7 +4061,7 @@ const Xr = `h-auto min-w-0 w-full flex-col gap-0 border bg-white text-center sha
|
|
|
4059
4061
|
"data-testid": "donation-amounts-custom-input",
|
|
4060
4062
|
hideStepper: !0
|
|
4061
4063
|
},
|
|
4062
|
-
i ? `custom-${Z}` :
|
|
4064
|
+
i ? `custom-${Z}` : U?.isCustom === !1 ? U.presetId : "custom"
|
|
4063
4065
|
),
|
|
4064
4066
|
i && /* @__PURE__ */ a(
|
|
4065
4067
|
I,
|
|
@@ -4072,12 +4074,12 @@ const Xr = `h-auto min-w-0 w-full flex-col gap-0 border bg-white text-center sha
|
|
|
4072
4074
|
onPress: oe,
|
|
4073
4075
|
isDisabled: p || !q,
|
|
4074
4076
|
"data-testid": "donation-amounts-add-button",
|
|
4075
|
-
children:
|
|
4077
|
+
children: w.addDonationButton
|
|
4076
4078
|
}
|
|
4077
4079
|
)
|
|
4078
4080
|
] })
|
|
4079
|
-
] }),
|
|
4080
|
-
return $ ? /* @__PURE__ */ a(_e, { className: m("w-full", k), "data-testid": "donation-amounts-card", children: /* @__PURE__ */ a(Re, { children:
|
|
4081
|
+
] }), je = C === "pill" ? Ue : Ge(jc[C], Wc[C][y]);
|
|
4082
|
+
return $ ? /* @__PURE__ */ a(_e, { className: m("w-full", k), "data-testid": "donation-amounts-card", children: /* @__PURE__ */ a(Re, { children: je }) }) : /* @__PURE__ */ a("div", { className: m("w-full", k), "data-testid": "donation-amounts-plain", children: je });
|
|
4081
4083
|
};
|
|
4082
4084
|
qc.displayName = "DonationAmounts";
|
|
4083
4085
|
const Yc = (e) => {
|
|
@@ -4134,9 +4136,9 @@ const Yc = (e) => {
|
|
|
4134
4136
|
Math.max(0, t),
|
|
4135
4137
|
n
|
|
4136
4138
|
), y = ge(null), k = ge(!1);
|
|
4137
|
-
|
|
4139
|
+
Ve(() => () => {
|
|
4138
4140
|
y.current && clearInterval(y.current);
|
|
4139
|
-
}, []),
|
|
4141
|
+
}, []), Ve(() => {
|
|
4140
4142
|
if (!h || v <= 0) {
|
|
4141
4143
|
y.current && (clearInterval(y.current), y.current = null);
|
|
4142
4144
|
return;
|
|
@@ -4146,7 +4148,7 @@ const Yc = (e) => {
|
|
|
4146
4148
|
}, 1e3), () => {
|
|
4147
4149
|
y.current && (clearInterval(y.current), y.current = null);
|
|
4148
4150
|
};
|
|
4149
|
-
}, [h, v, x, r]),
|
|
4151
|
+
}, [h, v, x, r]), Ve(() => {
|
|
4150
4152
|
v > 0 && (k.current = !1);
|
|
4151
4153
|
}, [v]);
|
|
4152
4154
|
const $ = d || Gc(i), C = Kc(s), S = {
|
|
@@ -4236,7 +4238,7 @@ const Yt = ({
|
|
|
4236
4238
|
labels: b
|
|
4237
4239
|
}) => {
|
|
4238
4240
|
const [p, g] = K(!1), [v, x] = K(!1), y = ge(null);
|
|
4239
|
-
return
|
|
4241
|
+
return Ve(() => {
|
|
4240
4242
|
const k = () => {
|
|
4241
4243
|
if (y.current) {
|
|
4242
4244
|
const $ = y.current.scrollHeight > y.current.clientHeight;
|
|
@@ -4426,16 +4428,16 @@ const Qc = {
|
|
|
4426
4428
|
compact: C = !1,
|
|
4427
4429
|
isSoldOut: S,
|
|
4428
4430
|
isMaxReached: F,
|
|
4429
|
-
isRuleBlocked:
|
|
4431
|
+
isRuleBlocked: w,
|
|
4430
4432
|
statusTone: _ = "default",
|
|
4431
4433
|
statusLabel: A,
|
|
4432
4434
|
disabledReason: P,
|
|
4433
4435
|
disabled: E
|
|
4434
4436
|
}) => {
|
|
4435
|
-
const D = ue(() => ({ ...Qc, ...o }), [o]), [M, z] = K(n),
|
|
4436
|
-
if (
|
|
4437
|
-
const
|
|
4438
|
-
t === void 0 && z(
|
|
4437
|
+
const D = ue(() => ({ ...Qc, ...o }), [o]), [M, z] = K(n), U = t !== void 0 ? t : M, Y = !!(d || E), T = C || !!e.compact, ne = $ === "press-to-add", q = ue(() => typeof S == "boolean" ? S : typeof e.isSoldOut == "boolean" ? e.isSoldOut : !Gt(e.totalTicketsSold) || !Gt(e.ticketsAllowed) ? !1 : e.totalTicketsSold >= e.ticketsAllowed, [S, e.isSoldOut, e.totalTicketsSold, e.ticketsAllowed]), J = ue(() => typeof F == "boolean" ? F : typeof e.isMaxReached == "boolean" ? e.isMaxReached : q || !Gt(e.ticketsAllowed) ? !1 : U >= e.ticketsAllowed - (e.totalTicketsSold ?? 0), [F, e.isMaxReached, q, e.ticketsAllowed, e.totalTicketsSold, U]), Z = ue(() => typeof w == "boolean" ? w : typeof e.isRuleBlocked == "boolean" ? e.isRuleBlocked : !1, [w, e.isRuleBlocked]), me = P || e.disabledReason, re = Y || q || Z, te = (pe) => {
|
|
4438
|
+
if (re || pe > 0 && J) return;
|
|
4439
|
+
const xe = Math.max(0, U + pe);
|
|
4440
|
+
t === void 0 && z(xe), r?.(e.id, xe);
|
|
4439
4441
|
}, oe = ue(() => {
|
|
4440
4442
|
if (q)
|
|
4441
4443
|
return "soldOut";
|
|
@@ -4443,12 +4445,12 @@ const Qc = {
|
|
|
4443
4445
|
return "ruleBlocked";
|
|
4444
4446
|
if (Y)
|
|
4445
4447
|
return "disabled";
|
|
4446
|
-
}, [q, Z, Y]),
|
|
4448
|
+
}, [q, Z, Y]), j = ue(() => _ || (q || Z ? "danger" : J ? "warning" : "default"), [_, q, Z, J]), V = ue(() => {
|
|
4447
4449
|
if (oe)
|
|
4448
4450
|
return oe === "ruleBlocked" ? A || me || D.ruleBlocked : oe === "soldOut" ? A || me || D.soldOut : oe === "disabled" ? A || me || D.disabled : A || D.maxReached;
|
|
4449
4451
|
}, [oe, A, me, D]), ee = {
|
|
4450
4452
|
soldOut: "danger",
|
|
4451
|
-
ruleBlocked:
|
|
4453
|
+
ruleBlocked: j,
|
|
4452
4454
|
disabled: "default",
|
|
4453
4455
|
maxReached: "warning"
|
|
4454
4456
|
}, Ge = {
|
|
@@ -4456,21 +4458,21 @@ const Qc = {
|
|
|
4456
4458
|
maxReached: "offer-card-max-reached-chip",
|
|
4457
4459
|
ruleBlocked: "offer-card-ruleBlocked-chip",
|
|
4458
4460
|
disabled: "offer-card-disabled-chip"
|
|
4459
|
-
},
|
|
4461
|
+
}, Ue = () => l?.renderName ? l.renderName(e.name, e) : /* @__PURE__ */ a(
|
|
4460
4462
|
"h2",
|
|
4461
4463
|
{
|
|
4462
4464
|
"data-testid": "offer-card-name",
|
|
4463
4465
|
className: m("text-base font-medium", T && "text-sm", x.name),
|
|
4464
4466
|
children: e.name
|
|
4465
4467
|
}
|
|
4466
|
-
),
|
|
4468
|
+
), je = () => {
|
|
4467
4469
|
if (!g)
|
|
4468
4470
|
return null;
|
|
4469
|
-
const
|
|
4471
|
+
const pe = v?.price ?? e.price, xe = v?.originalPrice, le = ti(pe, s, i);
|
|
4470
4472
|
if (l?.renderPrice)
|
|
4471
|
-
return l.renderPrice(
|
|
4472
|
-
if (Gt(
|
|
4473
|
-
const L = ti(
|
|
4473
|
+
return l.renderPrice(pe, le, e);
|
|
4474
|
+
if (Gt(xe) && Gt(pe) && xe > pe) {
|
|
4475
|
+
const L = ti(xe, s, i);
|
|
4474
4476
|
return /* @__PURE__ */ c(
|
|
4475
4477
|
"div",
|
|
4476
4478
|
{
|
|
@@ -4485,7 +4487,7 @@ const Qc = {
|
|
|
4485
4487
|
"Original price ",
|
|
4486
4488
|
L,
|
|
4487
4489
|
", discounted price ",
|
|
4488
|
-
|
|
4490
|
+
le
|
|
4489
4491
|
] }),
|
|
4490
4492
|
/* @__PURE__ */ a(
|
|
4491
4493
|
"span",
|
|
@@ -4510,7 +4512,7 @@ const Qc = {
|
|
|
4510
4512
|
T && "text-sm",
|
|
4511
4513
|
x.discountedPrice
|
|
4512
4514
|
),
|
|
4513
|
-
children:
|
|
4515
|
+
children: le
|
|
4514
4516
|
}
|
|
4515
4517
|
)
|
|
4516
4518
|
]
|
|
@@ -4522,10 +4524,10 @@ const Qc = {
|
|
|
4522
4524
|
{
|
|
4523
4525
|
"data-testid": "offer-card-price",
|
|
4524
4526
|
className: m("text-primary text-base mt-1", T && "text-sm mt-0.5", x.price),
|
|
4525
|
-
children:
|
|
4527
|
+
children: le
|
|
4526
4528
|
}
|
|
4527
4529
|
);
|
|
4528
|
-
},
|
|
4530
|
+
}, ie = () => !b || !e.description ? null : l?.renderDescription ? l.renderDescription(e.description, e) : /* @__PURE__ */ a(
|
|
4529
4531
|
"p",
|
|
4530
4532
|
{
|
|
4531
4533
|
"data-testid": "offer-card-description",
|
|
@@ -4539,8 +4541,8 @@ const Qc = {
|
|
|
4539
4541
|
), $e = () => {
|
|
4540
4542
|
if (!p || !Gt(e.numberOfPeople) || e.numberOfPeople <= 0)
|
|
4541
4543
|
return null;
|
|
4542
|
-
const
|
|
4543
|
-
return l?.renderPeopleCount ? l.renderPeopleCount(e.numberOfPeople,
|
|
4544
|
+
const pe = e.numberOfPeople === 1 ? D.person : D.people;
|
|
4545
|
+
return l?.renderPeopleCount ? l.renderPeopleCount(e.numberOfPeople, pe, e) : /* @__PURE__ */ c(
|
|
4544
4546
|
"p",
|
|
4545
4547
|
{
|
|
4546
4548
|
"data-testid": "offer-card-people-count",
|
|
@@ -4556,28 +4558,28 @@ const Qc = {
|
|
|
4556
4558
|
),
|
|
4557
4559
|
e.numberOfPeople,
|
|
4558
4560
|
" ",
|
|
4559
|
-
|
|
4561
|
+
pe
|
|
4560
4562
|
]
|
|
4561
4563
|
}
|
|
4562
4564
|
);
|
|
4563
|
-
},
|
|
4564
|
-
const
|
|
4565
|
+
}, Be = () => {
|
|
4566
|
+
const pe = U === 0 || re, xe = J || re;
|
|
4565
4567
|
return l?.renderQuantitySelector ? l.renderQuantitySelector({
|
|
4566
|
-
quantity:
|
|
4568
|
+
quantity: U,
|
|
4567
4569
|
onIncrement: () => te(1),
|
|
4568
4570
|
onDecrement: () => te(-1),
|
|
4569
|
-
isDecrementDisabled:
|
|
4570
|
-
isIncrementDisabled:
|
|
4571
|
-
isDisabled:
|
|
4571
|
+
isDecrementDisabled: pe,
|
|
4572
|
+
isIncrementDisabled: xe,
|
|
4573
|
+
isDisabled: re
|
|
4572
4574
|
}) : /* @__PURE__ */ c("div", { className: m("flex items-center gap-2", x.quantitySelector), children: [
|
|
4573
4575
|
/* @__PURE__ */ a(
|
|
4574
4576
|
I,
|
|
4575
4577
|
{
|
|
4576
4578
|
"data-testid": "offer-card-decrement-button",
|
|
4577
4579
|
onPress: () => te(-1),
|
|
4578
|
-
isDisabled:
|
|
4580
|
+
isDisabled: pe,
|
|
4579
4581
|
variant: u,
|
|
4580
|
-
color:
|
|
4582
|
+
color: U > 0 ? k : h,
|
|
4581
4583
|
radius: "full",
|
|
4582
4584
|
isIconOnly: !0,
|
|
4583
4585
|
size: T ? "md" : "sm",
|
|
@@ -4585,15 +4587,15 @@ const Qc = {
|
|
|
4585
4587
|
children: /* @__PURE__ */ a(O, { icon: "gravity-ui:minus", width: 16 })
|
|
4586
4588
|
}
|
|
4587
4589
|
),
|
|
4588
|
-
/* @__PURE__ */ a("span", { "data-testid": "offer-card-quantity", className: m("min-w-[2rem] text-center font-medium", T && "text-sm"), children:
|
|
4590
|
+
/* @__PURE__ */ a("span", { "data-testid": "offer-card-quantity", className: m("min-w-[2rem] text-center font-medium", T && "text-sm"), children: U }),
|
|
4589
4591
|
/* @__PURE__ */ a(
|
|
4590
4592
|
I,
|
|
4591
4593
|
{
|
|
4592
4594
|
"data-testid": "offer-card-increment-button",
|
|
4593
4595
|
onPress: () => te(1),
|
|
4594
|
-
isDisabled:
|
|
4596
|
+
isDisabled: xe,
|
|
4595
4597
|
variant: u,
|
|
4596
|
-
color:
|
|
4598
|
+
color: U > 0 ? k : h,
|
|
4597
4599
|
radius: "full",
|
|
4598
4600
|
isIconOnly: !0,
|
|
4599
4601
|
size: T ? "md" : "sm",
|
|
@@ -4602,23 +4604,23 @@ const Qc = {
|
|
|
4602
4604
|
}
|
|
4603
4605
|
)
|
|
4604
4606
|
] });
|
|
4605
|
-
},
|
|
4607
|
+
}, Se = (pe, xe) => l?.renderDisabledState ? l.renderDisabledState(pe, xe) : pe === "soldOut" && l?.renderSoldOut ? l.renderSoldOut(xe) : pe === "maxReached" && l?.renderMaxReachedAlert ? l.renderMaxReachedAlert(xe) : /* @__PURE__ */ a(
|
|
4606
4608
|
ht,
|
|
4607
4609
|
{
|
|
4608
|
-
"data-testid": Ge[
|
|
4609
|
-
color: ee[
|
|
4610
|
-
variant:
|
|
4610
|
+
"data-testid": Ge[pe],
|
|
4611
|
+
color: ee[pe],
|
|
4612
|
+
variant: pe === "maxReached" ? "flat" : "solid",
|
|
4611
4613
|
className: m(
|
|
4612
4614
|
"gap-2 px-4",
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4615
|
+
pe === "maxReached" ? "h-8" : "h-10",
|
|
4616
|
+
pe === "soldOut" && x.soldOut,
|
|
4617
|
+
pe === "maxReached" && x.maxReachedAlert,
|
|
4616
4618
|
T && "h-8"
|
|
4617
4619
|
),
|
|
4618
4620
|
startContent: /* @__PURE__ */ a(O, { icon: "gravity-ui:triangle-exclamation-fill", width: 14 }),
|
|
4619
|
-
children: /* @__PURE__ */ a("span", { className: "font-medium text-sm", children:
|
|
4621
|
+
children: /* @__PURE__ */ a("span", { className: "font-medium text-sm", children: xe })
|
|
4620
4622
|
}
|
|
4621
|
-
),
|
|
4623
|
+
), rt = /* @__PURE__ */ c(
|
|
4622
4624
|
"div",
|
|
4623
4625
|
{
|
|
4624
4626
|
className: m(
|
|
@@ -4631,11 +4633,11 @@ const Qc = {
|
|
|
4631
4633
|
{
|
|
4632
4634
|
className: m(
|
|
4633
4635
|
"h-full col-span-2",
|
|
4634
|
-
|
|
4636
|
+
re || J ? "opacity-50 pointer-events-none select-none" : ""
|
|
4635
4637
|
),
|
|
4636
4638
|
children: [
|
|
4637
|
-
Ve(),
|
|
4638
4639
|
Ue(),
|
|
4640
|
+
je(),
|
|
4639
4641
|
/* @__PURE__ */ c(
|
|
4640
4642
|
"div",
|
|
4641
4643
|
{
|
|
@@ -4645,14 +4647,14 @@ const Qc = {
|
|
|
4645
4647
|
),
|
|
4646
4648
|
children: [
|
|
4647
4649
|
$e(),
|
|
4648
|
-
|
|
4650
|
+
ie()
|
|
4649
4651
|
]
|
|
4650
4652
|
}
|
|
4651
4653
|
)
|
|
4652
4654
|
]
|
|
4653
4655
|
}
|
|
4654
4656
|
),
|
|
4655
|
-
!
|
|
4657
|
+
!ne && /* @__PURE__ */ a(
|
|
4656
4658
|
"div",
|
|
4657
4659
|
{
|
|
4658
4660
|
className: m(
|
|
@@ -4660,7 +4662,7 @@ const Qc = {
|
|
|
4660
4662
|
T && "space-x-1 pb-1 md:p-1",
|
|
4661
4663
|
x.compactFooter
|
|
4662
4664
|
),
|
|
4663
|
-
children: oe && V ?
|
|
4665
|
+
children: oe && V ? Se(oe, V) : Be()
|
|
4664
4666
|
}
|
|
4665
4667
|
)
|
|
4666
4668
|
]
|
|
@@ -4673,18 +4675,18 @@ const Qc = {
|
|
|
4673
4675
|
animate: { opacity: 1, y: 0 },
|
|
4674
4676
|
exit: { opacity: 0, y: 10 },
|
|
4675
4677
|
transition: { duration: 0.3 },
|
|
4676
|
-
children:
|
|
4678
|
+
children: Se("maxReached", V || D.maxReached)
|
|
4677
4679
|
}
|
|
4678
4680
|
) : null;
|
|
4679
4681
|
return f ? /* @__PURE__ */ c(
|
|
4680
4682
|
_e,
|
|
4681
4683
|
{
|
|
4682
|
-
className: m("w-full",
|
|
4684
|
+
className: m("w-full", ne && !re && !J && "cursor-pointer", T && x.compact, x.base),
|
|
4683
4685
|
"data-testid": y || `offer-card-${e.id}`,
|
|
4684
|
-
isPressable:
|
|
4685
|
-
onPress:
|
|
4686
|
+
isPressable: ne && !re && !J,
|
|
4687
|
+
onPress: ne && !re && !J ? () => te(1) : void 0,
|
|
4686
4688
|
children: [
|
|
4687
|
-
/* @__PURE__ */ a(Re, { className: m("pt-1 pb-0", T ? "pb-0.5" : "", x.body), children:
|
|
4689
|
+
/* @__PURE__ */ a(Re, { className: m("pt-1 pb-0", T ? "pb-0.5" : "", x.body), children: rt }),
|
|
4688
4690
|
/* @__PURE__ */ a(Tn, { children: We && /* @__PURE__ */ a(uo, { className: m("w-full mt-0 pt-0", T ? "pt-1" : "", x.footer), children: We }) })
|
|
4689
4691
|
]
|
|
4690
4692
|
}
|
|
@@ -4694,7 +4696,7 @@ const Qc = {
|
|
|
4694
4696
|
className: m("w-full", T && x.compact, x.base),
|
|
4695
4697
|
"data-testid": y || `offer-card-${e.id}`,
|
|
4696
4698
|
children: [
|
|
4697
|
-
/* @__PURE__ */ a("div", { className: m("pt-1 pb-0", T ? "pb-0.5" : "", x.body), children:
|
|
4699
|
+
/* @__PURE__ */ a("div", { className: m("pt-1 pb-0", T ? "pb-0.5" : "", x.body), children: rt }),
|
|
4698
4700
|
/* @__PURE__ */ a(Tn, { children: We && /* @__PURE__ */ a("div", { className: m("w-full mt-0 pt-0", T ? "pt-1" : "", x.footer), children: We }) })
|
|
4699
4701
|
]
|
|
4700
4702
|
}
|
|
@@ -4922,7 +4924,7 @@ const nu = {
|
|
|
4922
4924
|
n === void 0 && $(M), i?.(M), s?.(E, M[E]);
|
|
4923
4925
|
},
|
|
4924
4926
|
[C, n, i, s]
|
|
4925
|
-
), F = [...e].sort((E, D) => (E.position ?? 0) - (D.position ?? 0)),
|
|
4927
|
+
), F = [...e].sort((E, D) => (E.position ?? 0) - (D.position ?? 0)), w = (E) => {
|
|
4926
4928
|
const D = t ? t(E) : E, M = (C ?? {})[D.id] || 0;
|
|
4927
4929
|
return {
|
|
4928
4930
|
offer: D,
|
|
@@ -4939,7 +4941,7 @@ const nu = {
|
|
|
4939
4941
|
compact: x
|
|
4940
4942
|
};
|
|
4941
4943
|
}, _ = iu[v], A = m("grid mx-auto pt-2", _, y.base), P = (E) => {
|
|
4942
|
-
const D =
|
|
4944
|
+
const D = w(E);
|
|
4943
4945
|
return /* @__PURE__ */ a(
|
|
4944
4946
|
jn,
|
|
4945
4947
|
{
|
|
@@ -4969,7 +4971,7 @@ const nu = {
|
|
|
4969
4971
|
initial: "hidden",
|
|
4970
4972
|
animate: "show",
|
|
4971
4973
|
children: /* @__PURE__ */ a(Tn, { children: F.map((E) => {
|
|
4972
|
-
const D =
|
|
4974
|
+
const D = w(E);
|
|
4973
4975
|
return /* @__PURE__ */ a(
|
|
4974
4976
|
qa.div,
|
|
4975
4977
|
{
|
|
@@ -5029,7 +5031,7 @@ var on = (e) => /^\w*$/.test(e), Ce = (e) => e === void 0, pr = (e) => Array.isA
|
|
|
5029
5031
|
return n;
|
|
5030
5032
|
const r = (on(t) ? [t] : hr(t)).reduce((i, s) => nt(i) ? i : i[s], e);
|
|
5031
5033
|
return Ce(r) || r === e ? Ce(e[t]) ? n : e[t] : r;
|
|
5032
|
-
},
|
|
5034
|
+
}, st = (e) => typeof e == "boolean", et = (e) => typeof e == "function", we = (e, t, n) => {
|
|
5033
5035
|
let r = -1;
|
|
5034
5036
|
const i = on(t) ? [t] : hr(t), s = i.length, o = s - 1;
|
|
5035
5037
|
for (; ++r < s; ) {
|
|
@@ -5104,7 +5106,7 @@ function du(e) {
|
|
|
5104
5106
|
d.current.isValid && n._setValid(!0);
|
|
5105
5107
|
}, [n]), Q.useMemo(() => Gs(o, n, d.current, !1), [o, n]);
|
|
5106
5108
|
}
|
|
5107
|
-
var
|
|
5109
|
+
var ot = (e) => typeof e == "string", Wn = (e, t, n, r, i) => ot(e) ? (r && t.watch.add(e), G(n, e, i)) : Array.isArray(e) ? e.map((s) => (r && t.watch.add(s), G(n, s))) : (r && (t.watchAll = !0), n), Hn = (e) => nt(e) || !Ws(e);
|
|
5108
5110
|
function pt(e, t, n = /* @__PURE__ */ new WeakSet()) {
|
|
5109
5111
|
if (Hn(e) || Hn(t))
|
|
5110
5112
|
return Object.is(e, t);
|
|
@@ -5178,7 +5180,7 @@ function uu(e) {
|
|
|
5178
5180
|
}), b = Q.useRef(e), p = Q.useRef(void 0), g = Q.useRef(i.register(n, {
|
|
5179
5181
|
...e.rules,
|
|
5180
5182
|
value: h,
|
|
5181
|
-
...
|
|
5183
|
+
...st(e.disabled) ? { disabled: e.disabled } : {}
|
|
5182
5184
|
}));
|
|
5183
5185
|
b.current = e;
|
|
5184
5186
|
const v = Q.useMemo(() => Object.defineProperties({}, {
|
|
@@ -5225,7 +5227,7 @@ function uu(e) {
|
|
|
5225
5227
|
}, [i._fields, n]), $ = Q.useMemo(() => ({
|
|
5226
5228
|
name: n,
|
|
5227
5229
|
value: h,
|
|
5228
|
-
...
|
|
5230
|
+
...st(r) || f.disabled ? { disabled: f.disabled || r } : {},
|
|
5229
5231
|
onChange: x,
|
|
5230
5232
|
onBlur: y,
|
|
5231
5233
|
ref: k
|
|
@@ -5234,15 +5236,15 @@ function uu(e) {
|
|
|
5234
5236
|
const C = i._options.shouldUnregister || s, S = p.current;
|
|
5235
5237
|
S && S !== n && !d && i.unregister(S), i.register(n, {
|
|
5236
5238
|
...b.current.rules,
|
|
5237
|
-
...
|
|
5239
|
+
...st(b.current.disabled) ? { disabled: b.current.disabled } : {}
|
|
5238
5240
|
});
|
|
5239
|
-
const F = (
|
|
5240
|
-
const A = G(i._fields,
|
|
5241
|
+
const F = (w, _) => {
|
|
5242
|
+
const A = G(i._fields, w);
|
|
5241
5243
|
A && A._f && (A._f.mount = _);
|
|
5242
5244
|
};
|
|
5243
5245
|
if (F(n, !0), C) {
|
|
5244
|
-
const
|
|
5245
|
-
|
|
5246
|
+
const w = Me(G(i._options.defaultValues, n, b.current.defaultValue));
|
|
5247
|
+
we(i._defaultValues, n, w), Ce(G(i._formValues, n)) && we(i._formValues, n, w);
|
|
5246
5248
|
}
|
|
5247
5249
|
return !d && i.register(n), p.current = n, () => {
|
|
5248
5250
|
(d ? C && !i._state.action : C) ? i.unregister(n) : F(n, !1);
|
|
@@ -5366,7 +5368,7 @@ var Xs = (e) => {
|
|
|
5366
5368
|
) : ni;
|
|
5367
5369
|
}
|
|
5368
5370
|
return ni;
|
|
5369
|
-
}, Js = (e, { valueAsNumber: t, valueAsDate: n, setValueAs: r }) => Ce(e) ? e : t ? e === "" ? NaN : e && +e : n &&
|
|
5371
|
+
}, Js = (e, { valueAsNumber: t, valueAsDate: n, setValueAs: r }) => Ce(e) ? e : t ? e === "" ? NaN : e && +e : n && ot(e) ? new Date(e) : r ? r(e) : e;
|
|
5370
5372
|
const ii = {
|
|
5371
5373
|
isValid: !1,
|
|
5372
5374
|
value: null
|
|
@@ -5383,7 +5385,7 @@ var xu = (e, t, n, r) => {
|
|
|
5383
5385
|
const i = {};
|
|
5384
5386
|
for (const s of e) {
|
|
5385
5387
|
const o = G(t, s);
|
|
5386
|
-
o &&
|
|
5388
|
+
o && we(i, s, o._f);
|
|
5387
5389
|
}
|
|
5388
5390
|
return {
|
|
5389
5391
|
criteriaMode: n,
|
|
@@ -5451,13 +5453,13 @@ var wu = (e, t, n, r) => {
|
|
|
5451
5453
|
return Je(s) || Object.keys(s).length >= Object.keys(t).length || Object.keys(s).find((o) => t[o] === (!r || ft.all));
|
|
5452
5454
|
}, Nu = (e, t, n) => !e || !t || e === t || ga(e).some((r) => r && (n ? r === t : r.startsWith(t) || t.startsWith(r))), ku = (e, t, n, r, i) => i.isOnAll ? !1 : !n && i.isOnTouch ? !(t || e) : (n ? r.isOnBlur : i.isOnBlur) ? !e : (n ? r.isOnChange : i.isOnChange) ? e : !0, Cu = (e, t) => !pr(G(e, t)).length && Pe(e, t), $u = (e, t, n) => {
|
|
5453
5455
|
const r = ga(G(e, n));
|
|
5454
|
-
return
|
|
5456
|
+
return we(r, "root", t[n]), we(e, n, r), e;
|
|
5455
5457
|
};
|
|
5456
5458
|
function ui(e, t, n = "validate") {
|
|
5457
|
-
if (
|
|
5459
|
+
if (ot(e) || Array.isArray(e) && e.every(ot) || st(e) && !e)
|
|
5458
5460
|
return {
|
|
5459
5461
|
type: n,
|
|
5460
|
-
message:
|
|
5462
|
+
message: ot(e) ? e : "",
|
|
5461
5463
|
ref: t
|
|
5462
5464
|
};
|
|
5463
5465
|
}
|
|
@@ -5469,18 +5471,18 @@ var Kt = (e) => Te(e) && !Za(e) ? e : {
|
|
|
5469
5471
|
if (!y || t.has(v))
|
|
5470
5472
|
return {};
|
|
5471
5473
|
const $ = l ? l[0] : o, C = (D) => {
|
|
5472
|
-
i && $.reportValidity && ($.setCustomValidity(
|
|
5473
|
-
}, S = {}, F = yr(o),
|
|
5474
|
+
i && $.reportValidity && ($.setCustomValidity(st(D) ? "" : D || ""), $.reportValidity());
|
|
5475
|
+
}, S = {}, F = yr(o), w = Aa(o), _ = F || w, A = (x || xr(o)) && Ce(o.value) && Ce(k) || Ka(o) && o.value === "" || k === "" || Array.isArray(k) && !k.length, P = fu.bind(null, v, r, S), E = (D, M, z, U = vt.maxLength, Y = vt.minLength) => {
|
|
5474
5476
|
const T = D ? M : z;
|
|
5475
5477
|
S[v] = {
|
|
5476
|
-
type: D ?
|
|
5478
|
+
type: D ? U : Y,
|
|
5477
5479
|
message: T,
|
|
5478
5480
|
ref: o,
|
|
5479
|
-
...P(D ?
|
|
5481
|
+
...P(D ? U : Y, T)
|
|
5480
5482
|
};
|
|
5481
5483
|
};
|
|
5482
|
-
if (s ? !Array.isArray(k) || !k.length : d && (!_ && (A || nt(k)) ||
|
|
5483
|
-
const { value: D, message: M } =
|
|
5484
|
+
if (s ? !Array.isArray(k) || !k.length : d && (!_ && (A || nt(k)) || st(k) && !k || w && !Xs(l).isValid || F && !el(l).isValid)) {
|
|
5485
|
+
const { value: D, message: M } = ot(d) ? { value: !!d, message: d } : Kt(d);
|
|
5484
5486
|
if (D && (S[v] = {
|
|
5485
5487
|
type: vt.required,
|
|
5486
5488
|
message: M,
|
|
@@ -5491,23 +5493,23 @@ var Kt = (e) => Te(e) && !Za(e) ? e : {
|
|
|
5491
5493
|
}
|
|
5492
5494
|
if (!A && (!nt(f) || !nt(b))) {
|
|
5493
5495
|
let D, M;
|
|
5494
|
-
const z = Kt(b),
|
|
5496
|
+
const z = Kt(b), U = Kt(f);
|
|
5495
5497
|
if (!nt(k) && !isNaN(k)) {
|
|
5496
5498
|
const Y = o.valueAsNumber || k && +k;
|
|
5497
|
-
nt(z.value) || (D = Y > z.value), nt(
|
|
5499
|
+
nt(z.value) || (D = Y > z.value), nt(U.value) || (M = Y < U.value);
|
|
5498
5500
|
} else {
|
|
5499
|
-
const Y = o.valueAsDate || new Date(k), T = (J) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + J),
|
|
5500
|
-
|
|
5501
|
+
const Y = o.valueAsDate || new Date(k), T = (J) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + J), ne = o.type == "time", q = o.type == "week";
|
|
5502
|
+
ot(z.value) && k && (D = ne ? T(k) > T(z.value) : q ? k > z.value : Y > new Date(z.value)), ot(U.value) && k && (M = ne ? T(k) < T(U.value) : q ? k < U.value : Y < new Date(U.value));
|
|
5501
5503
|
}
|
|
5502
|
-
if ((D || M) && (E(!!D, z.message,
|
|
5504
|
+
if ((D || M) && (E(!!D, z.message, U.message, vt.max, vt.min), !r))
|
|
5503
5505
|
return C(S[v].message), S;
|
|
5504
5506
|
}
|
|
5505
|
-
if ((u || h) && !A && (
|
|
5506
|
-
const D = Kt(u), M = Kt(h), z = !nt(D.value) && k.length > +D.value,
|
|
5507
|
-
if ((z ||
|
|
5507
|
+
if ((u || h) && !A && (ot(k) || s && Array.isArray(k))) {
|
|
5508
|
+
const D = Kt(u), M = Kt(h), z = !nt(D.value) && k.length > +D.value, U = !nt(M.value) && k.length < +M.value;
|
|
5509
|
+
if ((z || U) && (E(z, D.message, M.message), !r))
|
|
5508
5510
|
return C(S[v].message), S;
|
|
5509
5511
|
}
|
|
5510
|
-
if (p && !A &&
|
|
5512
|
+
if (p && !A && ot(k)) {
|
|
5511
5513
|
const { value: D, message: M } = Kt(p);
|
|
5512
5514
|
if (Za(D) && !k.match(D) && (S[v] = {
|
|
5513
5515
|
type: vt.pattern,
|
|
@@ -5598,181 +5600,181 @@ function Au(e = {}) {
|
|
|
5598
5600
|
const p = {
|
|
5599
5601
|
array: ai(),
|
|
5600
5602
|
state: ai()
|
|
5601
|
-
}, g = t.criteriaMode === ft.all, v = (
|
|
5602
|
-
clearTimeout(u), u = setTimeout(
|
|
5603
|
-
}, x = async (
|
|
5604
|
-
if (!o.keepIsValid && !t.disabled && (f.isValid || b.isValid ||
|
|
5603
|
+
}, g = t.criteriaMode === ft.all, v = (N) => (L) => {
|
|
5604
|
+
clearTimeout(u), u = setTimeout(N, L);
|
|
5605
|
+
}, x = async (N) => {
|
|
5606
|
+
if (!o.keepIsValid && !t.disabled && (f.isValid || b.isValid || N)) {
|
|
5605
5607
|
let L;
|
|
5606
5608
|
t.resolver ? (L = Je((await _()).errors), y()) : L = await P(r, !0), L !== n.isValid && p.state.next({
|
|
5607
5609
|
isValid: L
|
|
5608
5610
|
});
|
|
5609
5611
|
}
|
|
5610
|
-
}, y = (
|
|
5611
|
-
!t.disabled && (f.isValidating || f.validatingFields || b.isValidating || b.validatingFields) && ((
|
|
5612
|
-
R && (L ?
|
|
5612
|
+
}, y = (N, L) => {
|
|
5613
|
+
!t.disabled && (f.isValidating || f.validatingFields || b.isValidating || b.validatingFields) && ((N || Array.from(l.mount)).forEach((R) => {
|
|
5614
|
+
R && (L ? we(n.validatingFields, R, L) : Pe(n.validatingFields, R));
|
|
5613
5615
|
}), p.state.next({
|
|
5614
5616
|
validatingFields: n.validatingFields,
|
|
5615
5617
|
isValidating: !Je(n.validatingFields)
|
|
5616
5618
|
}));
|
|
5617
|
-
}, k = (
|
|
5619
|
+
}, k = (N, L = [], R, H, W = !0, B = !0) => {
|
|
5618
5620
|
if (H && R && !t.disabled) {
|
|
5619
|
-
if (o.action = !0, B && Array.isArray(G(r,
|
|
5620
|
-
const
|
|
5621
|
-
W &&
|
|
5621
|
+
if (o.action = !0, B && Array.isArray(G(r, N))) {
|
|
5622
|
+
const ae = R(G(r, N), H.argA, H.argB);
|
|
5623
|
+
W && we(r, N, ae);
|
|
5622
5624
|
}
|
|
5623
|
-
if (B && Array.isArray(G(n.errors,
|
|
5624
|
-
const
|
|
5625
|
-
W &&
|
|
5625
|
+
if (B && Array.isArray(G(n.errors, N))) {
|
|
5626
|
+
const ae = R(G(n.errors, N), H.argA, H.argB);
|
|
5627
|
+
W && we(n.errors, N, ae), Cu(n.errors, N);
|
|
5626
5628
|
}
|
|
5627
|
-
if ((f.touchedFields || b.touchedFields) && B && Array.isArray(G(n.touchedFields,
|
|
5628
|
-
const
|
|
5629
|
-
W &&
|
|
5629
|
+
if ((f.touchedFields || b.touchedFields) && B && Array.isArray(G(n.touchedFields, N))) {
|
|
5630
|
+
const ae = R(G(n.touchedFields, N), H.argA, H.argB);
|
|
5631
|
+
W && we(n.touchedFields, N, ae);
|
|
5630
5632
|
}
|
|
5631
5633
|
(f.dirtyFields || b.dirtyFields) && (n.dirtyFields = Jt(i, s)), p.state.next({
|
|
5632
|
-
name:
|
|
5633
|
-
isDirty: D(
|
|
5634
|
+
name: N,
|
|
5635
|
+
isDirty: D(N, L),
|
|
5634
5636
|
dirtyFields: n.dirtyFields,
|
|
5635
5637
|
errors: n.errors,
|
|
5636
5638
|
isValid: n.isValid
|
|
5637
5639
|
});
|
|
5638
5640
|
} else
|
|
5639
|
-
|
|
5640
|
-
}, $ = (
|
|
5641
|
-
|
|
5641
|
+
we(s, N, L);
|
|
5642
|
+
}, $ = (N, L) => {
|
|
5643
|
+
we(n.errors, N, L), p.state.next({
|
|
5642
5644
|
errors: n.errors
|
|
5643
5645
|
});
|
|
5644
|
-
}, C = (
|
|
5645
|
-
n.errors =
|
|
5646
|
+
}, C = (N) => {
|
|
5647
|
+
n.errors = N, p.state.next({
|
|
5646
5648
|
errors: n.errors,
|
|
5647
5649
|
isValid: !1
|
|
5648
5650
|
});
|
|
5649
|
-
}, S = (
|
|
5650
|
-
const W = G(r,
|
|
5651
|
+
}, S = (N, L, R, H) => {
|
|
5652
|
+
const W = G(r, N);
|
|
5651
5653
|
if (W) {
|
|
5652
|
-
const B = G(s,
|
|
5653
|
-
Ce(B) || H && H.defaultChecked || L ?
|
|
5654
|
+
const B = G(s, N, Ce(R) ? G(i, N) : R);
|
|
5655
|
+
Ce(B) || H && H.defaultChecked || L ? we(s, N, L ? B : si(W._f)) : U(N, B), o.mount && !o.action && x();
|
|
5654
5656
|
}
|
|
5655
|
-
}, F = (
|
|
5656
|
-
let B = !1,
|
|
5657
|
-
const
|
|
5658
|
-
name:
|
|
5657
|
+
}, F = (N, L, R, H, W) => {
|
|
5658
|
+
let B = !1, ae = !1;
|
|
5659
|
+
const ye = {
|
|
5660
|
+
name: N
|
|
5659
5661
|
};
|
|
5660
5662
|
if (!t.disabled) {
|
|
5661
5663
|
if (!R || H) {
|
|
5662
|
-
(f.isDirty || b.isDirty) && (
|
|
5663
|
-
const
|
|
5664
|
-
|
|
5664
|
+
(f.isDirty || b.isDirty) && (ae = n.isDirty, n.isDirty = ye.isDirty = D(), B = ae !== ye.isDirty);
|
|
5665
|
+
const ve = pt(G(i, N), L);
|
|
5666
|
+
ae = !!G(n.dirtyFields, N), ve ? Pe(n.dirtyFields, N) : we(n.dirtyFields, N, !0), ye.dirtyFields = n.dirtyFields, B = B || (f.dirtyFields || b.dirtyFields) && ae !== !ve;
|
|
5665
5667
|
}
|
|
5666
5668
|
if (R) {
|
|
5667
|
-
const
|
|
5668
|
-
|
|
5669
|
+
const ve = G(n.touchedFields, N);
|
|
5670
|
+
ve || (we(n.touchedFields, N, R), ye.touchedFields = n.touchedFields, B = B || (f.touchedFields || b.touchedFields) && ve !== R);
|
|
5669
5671
|
}
|
|
5670
|
-
B && W && p.state.next(
|
|
5672
|
+
B && W && p.state.next(ye);
|
|
5671
5673
|
}
|
|
5672
|
-
return B ?
|
|
5673
|
-
},
|
|
5674
|
-
const W = G(n.errors,
|
|
5675
|
-
if (t.delayError && R ? (d = v(() => $(
|
|
5676
|
-
const
|
|
5674
|
+
return B ? ye : {};
|
|
5675
|
+
}, w = (N, L, R, H) => {
|
|
5676
|
+
const W = G(n.errors, N), B = (f.isValid || b.isValid) && st(L) && n.isValid !== L;
|
|
5677
|
+
if (t.delayError && R ? (d = v(() => $(N, R)), d(t.delayError)) : (clearTimeout(u), d = null, R ? we(n.errors, N, R) : Pe(n.errors, N)), (R ? !pt(W, R) : W) || !Je(H) || B) {
|
|
5678
|
+
const ae = {
|
|
5677
5679
|
...H,
|
|
5678
|
-
...B &&
|
|
5680
|
+
...B && st(L) ? { isValid: L } : {},
|
|
5679
5681
|
errors: n.errors,
|
|
5680
|
-
name:
|
|
5682
|
+
name: N
|
|
5681
5683
|
};
|
|
5682
5684
|
n = {
|
|
5683
5685
|
...n,
|
|
5684
|
-
...
|
|
5685
|
-
}, p.state.next(
|
|
5686
|
+
...ae
|
|
5687
|
+
}, p.state.next(ae);
|
|
5686
5688
|
}
|
|
5687
|
-
}, _ = async (
|
|
5688
|
-
const { errors: L } = await _(
|
|
5689
|
-
if (y(
|
|
5690
|
-
for (const R of
|
|
5689
|
+
}, _ = async (N) => (y(N, !0), await t.resolver(s, t.context, xu(N || l.mount, r, t.criteriaMode, t.shouldUseNativeValidation))), A = async (N) => {
|
|
5690
|
+
const { errors: L } = await _(N);
|
|
5691
|
+
if (y(N), N)
|
|
5692
|
+
for (const R of N) {
|
|
5691
5693
|
const H = G(L, R);
|
|
5692
|
-
H ?
|
|
5694
|
+
H ? we(n.errors, R, H) : Pe(n.errors, R);
|
|
5693
5695
|
}
|
|
5694
5696
|
else
|
|
5695
5697
|
n.errors = L;
|
|
5696
5698
|
return L;
|
|
5697
|
-
}, P = async (
|
|
5699
|
+
}, P = async (N, L, R = {
|
|
5698
5700
|
valid: !0
|
|
5699
5701
|
}) => {
|
|
5700
|
-
for (const H in
|
|
5701
|
-
const W =
|
|
5702
|
+
for (const H in N) {
|
|
5703
|
+
const W = N[H];
|
|
5702
5704
|
if (W) {
|
|
5703
|
-
const { _f: B, ...
|
|
5705
|
+
const { _f: B, ...ae } = W;
|
|
5704
5706
|
if (B) {
|
|
5705
|
-
const
|
|
5706
|
-
|
|
5707
|
-
const Qe = await mi(W, l.disabled, s, g, t.shouldUseNativeValidation && !L,
|
|
5708
|
-
if (
|
|
5707
|
+
const ye = l.array.has(B.name), ve = W._f && yu(W._f);
|
|
5708
|
+
ve && f.validatingFields && y([B.name], !0);
|
|
5709
|
+
const Qe = await mi(W, l.disabled, s, g, t.shouldUseNativeValidation && !L, ye);
|
|
5710
|
+
if (ve && f.validatingFields && y([B.name]), Qe[B.name] && (R.valid = !1, L || e.shouldUseNativeValidation))
|
|
5709
5711
|
break;
|
|
5710
|
-
!L && (G(Qe, B.name) ?
|
|
5712
|
+
!L && (G(Qe, B.name) ? ye ? $u(n.errors, Qe, B.name) : we(n.errors, B.name, Qe[B.name]) : Pe(n.errors, B.name));
|
|
5711
5713
|
}
|
|
5712
|
-
!Je(
|
|
5714
|
+
!Je(ae) && await P(ae, L, R);
|
|
5713
5715
|
}
|
|
5714
5716
|
}
|
|
5715
5717
|
return R.valid;
|
|
5716
5718
|
}, E = () => {
|
|
5717
|
-
for (const
|
|
5718
|
-
const L = G(r,
|
|
5719
|
-
L && (L._f.refs ? L._f.refs.every((R) => !kn(R)) : !kn(L._f.ref)) && ee(
|
|
5719
|
+
for (const N of l.unMount) {
|
|
5720
|
+
const L = G(r, N);
|
|
5721
|
+
L && (L._f.refs ? L._f.refs.every((R) => !kn(R)) : !kn(L._f.ref)) && ee(N);
|
|
5720
5722
|
}
|
|
5721
5723
|
l.unMount = /* @__PURE__ */ new Set();
|
|
5722
|
-
}, D = (
|
|
5723
|
-
...o.mount ? s : Ce(L) ? i :
|
|
5724
|
-
}, R, L), z = (
|
|
5725
|
-
const H = G(r,
|
|
5724
|
+
}, D = (N, L) => !t.disabled && (N && L && we(s, N, L), !pt(Z(), i)), M = (N, L, R) => Wn(N, l, {
|
|
5725
|
+
...o.mount ? s : Ce(L) ? i : ot(N) ? { [N]: L } : L
|
|
5726
|
+
}, R, L), z = (N) => pr(G(o.mount ? s : i, N, t.shouldUnregister ? G(i, N, []) : [])), U = (N, L, R = {}) => {
|
|
5727
|
+
const H = G(r, N);
|
|
5726
5728
|
let W = L;
|
|
5727
5729
|
if (H) {
|
|
5728
5730
|
const B = H._f;
|
|
5729
|
-
B && (!B.disabled &&
|
|
5730
|
-
(!
|
|
5731
|
-
}) : B.refs.forEach((
|
|
5732
|
-
name:
|
|
5731
|
+
B && (!B.disabled && we(s, N, Js(L, B)), W = Ka(B.ref) && nt(L) ? "" : L, Zs(B.ref) ? [...B.ref.options].forEach((ae) => ae.selected = W.includes(ae.value)) : B.refs ? Aa(B.ref) ? B.refs.forEach((ae) => {
|
|
5732
|
+
(!ae.defaultChecked || !ae.disabled) && (Array.isArray(W) ? ae.checked = !!W.find((ye) => ye === ae.value) : ae.checked = W === ae.value || !!W);
|
|
5733
|
+
}) : B.refs.forEach((ae) => ae.checked = ae.value === W) : xr(B.ref) ? B.ref.value = "" : (B.ref.value = W, B.ref.type || p.state.next({
|
|
5734
|
+
name: N,
|
|
5733
5735
|
values: Me(s)
|
|
5734
5736
|
})));
|
|
5735
5737
|
}
|
|
5736
|
-
(R.shouldDirty || R.shouldTouch) && F(
|
|
5737
|
-
}, Y = (
|
|
5738
|
+
(R.shouldDirty || R.shouldTouch) && F(N, W, R.shouldTouch, R.shouldDirty, !0), R.shouldValidate && J(N);
|
|
5739
|
+
}, Y = (N, L, R) => {
|
|
5738
5740
|
for (const H in L) {
|
|
5739
5741
|
if (!L.hasOwnProperty(H))
|
|
5740
5742
|
return;
|
|
5741
|
-
const W = L[H], B =
|
|
5742
|
-
(l.array.has(
|
|
5743
|
+
const W = L[H], B = N + "." + H, ae = G(r, B);
|
|
5744
|
+
(l.array.has(N) || Te(W) || ae && !ae._f) && !It(W) ? Y(B, W, R) : U(B, W, R);
|
|
5743
5745
|
}
|
|
5744
|
-
}, T = (
|
|
5745
|
-
const H = G(r,
|
|
5746
|
-
|
|
5747
|
-
name:
|
|
5746
|
+
}, T = (N, L, R = {}) => {
|
|
5747
|
+
const H = G(r, N), W = l.array.has(N), B = Me(L);
|
|
5748
|
+
we(s, N, B), W ? (p.array.next({
|
|
5749
|
+
name: N,
|
|
5748
5750
|
values: Me(s)
|
|
5749
5751
|
}), (f.isDirty || f.dirtyFields || b.isDirty || b.dirtyFields) && R.shouldDirty && p.state.next({
|
|
5750
|
-
name:
|
|
5752
|
+
name: N,
|
|
5751
5753
|
dirtyFields: Jt(i, s),
|
|
5752
|
-
isDirty: D(
|
|
5753
|
-
})) : H && !H._f && !nt(B) ? Y(
|
|
5754
|
+
isDirty: D(N, B)
|
|
5755
|
+
})) : H && !H._f && !nt(B) ? Y(N, B, R) : U(N, B, R), di(N, l) ? p.state.next({
|
|
5754
5756
|
...n,
|
|
5755
|
-
name:
|
|
5757
|
+
name: N,
|
|
5756
5758
|
values: Me(s)
|
|
5757
5759
|
}) : p.state.next({
|
|
5758
|
-
name: o.mount ?
|
|
5760
|
+
name: o.mount ? N : void 0,
|
|
5759
5761
|
values: Me(s)
|
|
5760
5762
|
});
|
|
5761
|
-
},
|
|
5763
|
+
}, ne = async (N) => {
|
|
5762
5764
|
o.mount = !0;
|
|
5763
|
-
const L =
|
|
5765
|
+
const L = N.target;
|
|
5764
5766
|
let R = L.name, H = !0;
|
|
5765
|
-
const W = G(r, R), B = (
|
|
5766
|
-
H = Number.isNaN(
|
|
5767
|
-
},
|
|
5767
|
+
const W = G(r, R), B = (ve) => {
|
|
5768
|
+
H = Number.isNaN(ve) || It(ve) && isNaN(ve.getTime()) || pt(ve, G(s, R, ve));
|
|
5769
|
+
}, ae = li(t.mode), ye = li(t.reValidateMode);
|
|
5768
5770
|
if (W) {
|
|
5769
|
-
let
|
|
5770
|
-
const Pt = L.type ? si(W._f) : Hs(
|
|
5771
|
-
|
|
5771
|
+
let ve, Qe;
|
|
5772
|
+
const Pt = L.type ? si(W._f) : Hs(N), Dt = N.type === Ga.BLUR || N.type === Ga.FOCUS_OUT, to = !vu(W._f) && !t.resolver && !G(n.errors, R) && !W._f.deps || ku(Dt, G(n.touchedFields, R), n.isSubmitted, ye, ae), pn = di(R, l, Dt);
|
|
5773
|
+
we(s, R, Pt), Dt ? (!L || !L.readOnly) && (W._f.onBlur && W._f.onBlur(N), d && d(0)) : W._f.onChange && W._f.onChange(N);
|
|
5772
5774
|
const hn = F(R, Pt, Dt), ao = !Je(hn) || pn;
|
|
5773
5775
|
if (!Dt && p.state.next({
|
|
5774
5776
|
name: R,
|
|
5775
|
-
type:
|
|
5777
|
+
type: N.type,
|
|
5776
5778
|
values: Me(s)
|
|
5777
5779
|
}), to)
|
|
5778
5780
|
return (f.isValid || b.isValid) && (t.mode === "onBlur" ? Dt && x() : Dt || x()), ao && p.state.next({ name: R, ...pn ? {} : hn });
|
|
@@ -5780,78 +5782,78 @@ function Au(e = {}) {
|
|
|
5780
5782
|
const { errors: Dr } = await _([R]);
|
|
5781
5783
|
if (y([R]), B(Pt), H) {
|
|
5782
5784
|
const no = ci(n.errors, r, R), Er = ci(Dr, r, no.name || R);
|
|
5783
|
-
|
|
5785
|
+
ve = Er.error, R = Er.name, Qe = Je(Dr);
|
|
5784
5786
|
}
|
|
5785
5787
|
} else
|
|
5786
|
-
y([R], !0),
|
|
5787
|
-
H && (W._f.deps && (!Array.isArray(W._f.deps) || W._f.deps.length > 0) && J(W._f.deps),
|
|
5788
|
+
y([R], !0), ve = (await mi(W, l.disabled, s, g, t.shouldUseNativeValidation))[R], y([R]), B(Pt), H && (ve ? Qe = !1 : (f.isValid || b.isValid) && (Qe = await P(r, !0)));
|
|
5789
|
+
H && (W._f.deps && (!Array.isArray(W._f.deps) || W._f.deps.length > 0) && J(W._f.deps), w(R, Qe, ve, hn));
|
|
5788
5790
|
}
|
|
5789
|
-
}, q = (
|
|
5790
|
-
if (G(n.errors, L) &&
|
|
5791
|
-
return
|
|
5792
|
-
}, J = async (
|
|
5791
|
+
}, q = (N, L) => {
|
|
5792
|
+
if (G(n.errors, L) && N.focus)
|
|
5793
|
+
return N.focus(), 1;
|
|
5794
|
+
}, J = async (N, L = {}) => {
|
|
5793
5795
|
let R, H;
|
|
5794
|
-
const W = ga(
|
|
5796
|
+
const W = ga(N);
|
|
5795
5797
|
if (t.resolver) {
|
|
5796
|
-
const B = await A(Ce(
|
|
5797
|
-
R = Je(B), H =
|
|
5798
|
-
} else
|
|
5799
|
-
const
|
|
5800
|
-
return await P(
|
|
5798
|
+
const B = await A(Ce(N) ? N : W);
|
|
5799
|
+
R = Je(B), H = N ? !W.some((ae) => G(B, ae)) : R;
|
|
5800
|
+
} else N ? (H = (await Promise.all(W.map(async (B) => {
|
|
5801
|
+
const ae = G(r, B);
|
|
5802
|
+
return await P(ae && ae._f ? { [B]: ae } : ae);
|
|
5801
5803
|
}))).every(Boolean), !(!H && !n.isValid) && x()) : H = R = await P(r);
|
|
5802
5804
|
return p.state.next({
|
|
5803
|
-
...!
|
|
5804
|
-
...t.resolver || !
|
|
5805
|
+
...!ot(N) || (f.isValid || b.isValid) && R !== n.isValid ? {} : { name: N },
|
|
5806
|
+
...t.resolver || !N ? { isValid: R } : {},
|
|
5805
5807
|
errors: n.errors
|
|
5806
|
-
}), L.shouldFocus && !H && xa(r, q,
|
|
5807
|
-
}, Z = (
|
|
5808
|
+
}), L.shouldFocus && !H && xa(r, q, N ? W : l.mount), H;
|
|
5809
|
+
}, Z = (N, L) => {
|
|
5808
5810
|
let R = {
|
|
5809
5811
|
...o.mount ? s : i
|
|
5810
5812
|
};
|
|
5811
|
-
return L && (R = Ks(L.dirtyFields ? n.dirtyFields : n.touchedFields, R)), Ce(
|
|
5812
|
-
}, me = (
|
|
5813
|
-
invalid: !!G((L || n).errors,
|
|
5814
|
-
isDirty: !!G((L || n).dirtyFields,
|
|
5815
|
-
error: G((L || n).errors,
|
|
5816
|
-
isValidating: !!G(n.validatingFields,
|
|
5817
|
-
isTouched: !!G((L || n).touchedFields,
|
|
5818
|
-
}),
|
|
5819
|
-
|
|
5820
|
-
errors:
|
|
5813
|
+
return L && (R = Ks(L.dirtyFields ? n.dirtyFields : n.touchedFields, R)), Ce(N) ? R : ot(N) ? G(R, N) : N.map((H) => G(R, H));
|
|
5814
|
+
}, me = (N, L) => ({
|
|
5815
|
+
invalid: !!G((L || n).errors, N),
|
|
5816
|
+
isDirty: !!G((L || n).dirtyFields, N),
|
|
5817
|
+
error: G((L || n).errors, N),
|
|
5818
|
+
isValidating: !!G(n.validatingFields, N),
|
|
5819
|
+
isTouched: !!G((L || n).touchedFields, N)
|
|
5820
|
+
}), re = (N) => {
|
|
5821
|
+
N && ga(N).forEach((L) => Pe(n.errors, L)), p.state.next({
|
|
5822
|
+
errors: N ? n.errors : {}
|
|
5821
5823
|
});
|
|
5822
|
-
}, te = (
|
|
5823
|
-
const H = (G(r,
|
|
5824
|
-
|
|
5825
|
-
...
|
|
5824
|
+
}, te = (N, L, R) => {
|
|
5825
|
+
const H = (G(r, N, { _f: {} })._f || {}).ref, W = G(n.errors, N) || {}, { ref: B, message: ae, type: ye, ...ve } = W;
|
|
5826
|
+
we(n.errors, N, {
|
|
5827
|
+
...ve,
|
|
5826
5828
|
...L,
|
|
5827
5829
|
ref: H
|
|
5828
5830
|
}), p.state.next({
|
|
5829
|
-
name:
|
|
5831
|
+
name: N,
|
|
5830
5832
|
errors: n.errors,
|
|
5831
5833
|
isValid: !1
|
|
5832
5834
|
}), R && R.shouldFocus && H && H.focus && H.focus();
|
|
5833
|
-
}, oe = (
|
|
5834
|
-
next: (R) => "values" in R &&
|
|
5835
|
-
}) : M(
|
|
5835
|
+
}, oe = (N, L) => et(N) ? p.state.subscribe({
|
|
5836
|
+
next: (R) => "values" in R && N(M(void 0, L), R)
|
|
5837
|
+
}) : M(N, L, !0), j = (N) => p.state.subscribe({
|
|
5836
5838
|
next: (L) => {
|
|
5837
|
-
Nu(
|
|
5839
|
+
Nu(N.name, L.name, N.exact) && wu(L, N.formState || f, pe, N.reRenderRoot) && N.callback({
|
|
5838
5840
|
values: { ...s },
|
|
5839
5841
|
...n,
|
|
5840
5842
|
...L,
|
|
5841
5843
|
defaultValues: i
|
|
5842
5844
|
});
|
|
5843
5845
|
}
|
|
5844
|
-
}).unsubscribe, V = (
|
|
5846
|
+
}).unsubscribe, V = (N) => (o.mount = !0, b = {
|
|
5845
5847
|
...b,
|
|
5846
|
-
...
|
|
5847
|
-
},
|
|
5848
|
-
...
|
|
5848
|
+
...N.formState
|
|
5849
|
+
}, j({
|
|
5850
|
+
...N,
|
|
5849
5851
|
formState: {
|
|
5850
5852
|
...h,
|
|
5851
|
-
...
|
|
5853
|
+
...N.formState
|
|
5852
5854
|
}
|
|
5853
|
-
})), ee = (
|
|
5854
|
-
for (const R of
|
|
5855
|
+
})), ee = (N, L = {}) => {
|
|
5856
|
+
for (const R of N ? ga(N) : l.mount)
|
|
5855
5857
|
l.mount.delete(R), l.array.delete(R), L.keepValue || (Pe(r, R), Pe(s, R)), !L.keepError && Pe(n.errors, R), !L.keepDirty && Pe(n.dirtyFields, R), !L.keepTouched && Pe(n.touchedFields, R), !L.keepIsValidating && Pe(n.validatingFields, R), !t.shouldUnregister && !L.keepDefaultValue && Pe(i, R);
|
|
5856
5858
|
p.state.next({
|
|
5857
5859
|
values: Me(s)
|
|
@@ -5859,26 +5861,26 @@ function Au(e = {}) {
|
|
|
5859
5861
|
...n,
|
|
5860
5862
|
...L.keepDirty ? { isDirty: D() } : {}
|
|
5861
5863
|
}), !L.keepIsValid && x();
|
|
5862
|
-
}, Ge = ({ disabled:
|
|
5863
|
-
if (
|
|
5864
|
-
const W = l.disabled.has(L) !== !!
|
|
5865
|
-
|
|
5864
|
+
}, Ge = ({ disabled: N, name: L }) => {
|
|
5865
|
+
if (st(N) && o.mount || N || l.disabled.has(L)) {
|
|
5866
|
+
const W = l.disabled.has(L) !== !!N;
|
|
5867
|
+
N ? l.disabled.add(L) : l.disabled.delete(L), W && o.mount && !o.action && x();
|
|
5866
5868
|
}
|
|
5867
|
-
},
|
|
5868
|
-
let R = G(r,
|
|
5869
|
-
const H =
|
|
5870
|
-
return
|
|
5869
|
+
}, Ue = (N, L = {}) => {
|
|
5870
|
+
let R = G(r, N);
|
|
5871
|
+
const H = st(L.disabled) || st(t.disabled);
|
|
5872
|
+
return we(r, N, {
|
|
5871
5873
|
...R || {},
|
|
5872
5874
|
_f: {
|
|
5873
|
-
...R && R._f ? R._f : { ref: { name:
|
|
5874
|
-
name:
|
|
5875
|
+
...R && R._f ? R._f : { ref: { name: N } },
|
|
5876
|
+
name: N,
|
|
5875
5877
|
mount: !0,
|
|
5876
5878
|
...L
|
|
5877
5879
|
}
|
|
5878
|
-
}), l.mount.add(
|
|
5879
|
-
disabled:
|
|
5880
|
-
name:
|
|
5881
|
-
}) : S(
|
|
5880
|
+
}), l.mount.add(N), R ? Ge({
|
|
5881
|
+
disabled: st(L.disabled) ? L.disabled : t.disabled,
|
|
5882
|
+
name: N
|
|
5883
|
+
}) : S(N, !0, L.value), {
|
|
5882
5884
|
...H ? { disabled: L.disabled || t.disabled } : {},
|
|
5883
5885
|
...t.progressive ? {
|
|
5884
5886
|
required: !!L.required,
|
|
@@ -5888,48 +5890,48 @@ function Au(e = {}) {
|
|
|
5888
5890
|
maxLength: da(L.maxLength),
|
|
5889
5891
|
pattern: da(L.pattern)
|
|
5890
5892
|
} : {},
|
|
5891
|
-
name:
|
|
5892
|
-
onChange:
|
|
5893
|
-
onBlur:
|
|
5893
|
+
name: N,
|
|
5894
|
+
onChange: ne,
|
|
5895
|
+
onBlur: ne,
|
|
5894
5896
|
ref: (W) => {
|
|
5895
5897
|
if (W) {
|
|
5896
|
-
|
|
5897
|
-
const B = Ce(W.value) && W.querySelectorAll && W.querySelectorAll("input,select,textarea")[0] || W,
|
|
5898
|
-
if (
|
|
5898
|
+
Ue(N, L), R = G(r, N);
|
|
5899
|
+
const B = Ce(W.value) && W.querySelectorAll && W.querySelectorAll("input,select,textarea")[0] || W, ae = pu(B), ye = R._f.refs || [];
|
|
5900
|
+
if (ae ? ye.find((ve) => ve === B) : B === R._f.ref)
|
|
5899
5901
|
return;
|
|
5900
|
-
|
|
5902
|
+
we(r, N, {
|
|
5901
5903
|
_f: {
|
|
5902
5904
|
...R._f,
|
|
5903
|
-
...
|
|
5905
|
+
...ae ? {
|
|
5904
5906
|
refs: [
|
|
5905
|
-
...
|
|
5907
|
+
...ye.filter(kn),
|
|
5906
5908
|
B,
|
|
5907
|
-
...Array.isArray(G(i,
|
|
5909
|
+
...Array.isArray(G(i, N)) ? [{}] : []
|
|
5908
5910
|
],
|
|
5909
|
-
ref: { type: B.type, name:
|
|
5911
|
+
ref: { type: B.type, name: N }
|
|
5910
5912
|
} : { ref: B }
|
|
5911
5913
|
}
|
|
5912
|
-
}), S(
|
|
5914
|
+
}), S(N, !1, void 0, B);
|
|
5913
5915
|
} else
|
|
5914
|
-
R = G(r,
|
|
5916
|
+
R = G(r, N, {}), R._f && (R._f.mount = !1), (t.shouldUnregister || L.shouldUnregister) && !(qs(l.array, N) && o.action) && l.unMount.add(N);
|
|
5915
5917
|
}
|
|
5916
5918
|
};
|
|
5917
|
-
},
|
|
5918
|
-
|
|
5919
|
+
}, je = () => t.shouldFocusError && xa(r, q, l.mount), ie = (N) => {
|
|
5920
|
+
st(N) && (p.state.next({ disabled: N }), xa(r, (L, R) => {
|
|
5919
5921
|
const H = G(r, R);
|
|
5920
|
-
H && (L.disabled = H._f.disabled ||
|
|
5921
|
-
W.disabled = H._f.disabled ||
|
|
5922
|
+
H && (L.disabled = H._f.disabled || N, Array.isArray(H._f.refs) && H._f.refs.forEach((W) => {
|
|
5923
|
+
W.disabled = H._f.disabled || N;
|
|
5922
5924
|
}));
|
|
5923
5925
|
}, 0, !1));
|
|
5924
|
-
}, $e = (
|
|
5926
|
+
}, $e = (N, L) => async (R) => {
|
|
5925
5927
|
let H;
|
|
5926
5928
|
R && (R.preventDefault && R.preventDefault(), R.persist && R.persist());
|
|
5927
5929
|
let W = Me(s);
|
|
5928
5930
|
if (p.state.next({
|
|
5929
5931
|
isSubmitting: !0
|
|
5930
5932
|
}), t.resolver) {
|
|
5931
|
-
const { errors: B, values:
|
|
5932
|
-
y(), n.errors = B, W = Me(
|
|
5933
|
+
const { errors: B, values: ae } = await _();
|
|
5934
|
+
y(), n.errors = B, W = Me(ae);
|
|
5933
5935
|
} else
|
|
5934
5936
|
await P(r);
|
|
5935
5937
|
if (l.disabled.size)
|
|
@@ -5940,12 +5942,12 @@ function Au(e = {}) {
|
|
|
5940
5942
|
errors: {}
|
|
5941
5943
|
});
|
|
5942
5944
|
try {
|
|
5943
|
-
await
|
|
5945
|
+
await N(W, R);
|
|
5944
5946
|
} catch (B) {
|
|
5945
5947
|
H = B;
|
|
5946
5948
|
}
|
|
5947
5949
|
} else
|
|
5948
|
-
L && await L({ ...n.errors }, R),
|
|
5950
|
+
L && await L({ ...n.errors }, R), je(), setTimeout(je);
|
|
5949
5951
|
if (p.state.next({
|
|
5950
5952
|
isSubmitted: !0,
|
|
5951
5953
|
isSubmitting: !1,
|
|
@@ -5954,28 +5956,28 @@ function Au(e = {}) {
|
|
|
5954
5956
|
errors: n.errors
|
|
5955
5957
|
}), H)
|
|
5956
5958
|
throw H;
|
|
5957
|
-
},
|
|
5958
|
-
G(r,
|
|
5959
|
-
},
|
|
5960
|
-
const R =
|
|
5959
|
+
}, Be = (N, L = {}) => {
|
|
5960
|
+
G(r, N) && (Ce(L.defaultValue) ? T(N, Me(G(i, N))) : (T(N, L.defaultValue), we(i, N, Me(L.defaultValue))), L.keepTouched || Pe(n.touchedFields, N), L.keepDirty || (Pe(n.dirtyFields, N), n.isDirty = L.defaultValue ? D(N, Me(G(i, N))) : D()), L.keepError || (Pe(n.errors, N), f.isValid && x()), p.state.next({ ...n }));
|
|
5961
|
+
}, Se = (N, L = {}) => {
|
|
5962
|
+
const R = N ? Me(N) : i, H = Me(R), W = Je(N), B = W ? i : H;
|
|
5961
5963
|
if (L.keepDefaultValues || (i = R), !L.keepValues) {
|
|
5962
5964
|
if (L.keepDirtyValues) {
|
|
5963
|
-
const
|
|
5965
|
+
const ae = /* @__PURE__ */ new Set([
|
|
5964
5966
|
...l.mount,
|
|
5965
5967
|
...Object.keys(Jt(i, s))
|
|
5966
5968
|
]);
|
|
5967
|
-
for (const
|
|
5968
|
-
const
|
|
5969
|
-
|
|
5969
|
+
for (const ye of Array.from(ae)) {
|
|
5970
|
+
const ve = G(n.dirtyFields, ye), Qe = G(s, ye), Pt = G(B, ye);
|
|
5971
|
+
ve && !Ce(Qe) ? we(B, ye, Qe) : !ve && !Ce(Pt) && T(ye, Pt);
|
|
5970
5972
|
}
|
|
5971
5973
|
} else {
|
|
5972
|
-
if (fr && Ce(
|
|
5973
|
-
for (const
|
|
5974
|
-
const
|
|
5975
|
-
if (
|
|
5976
|
-
const
|
|
5977
|
-
if (Ka(
|
|
5978
|
-
const Qe =
|
|
5974
|
+
if (fr && Ce(N))
|
|
5975
|
+
for (const ae of l.mount) {
|
|
5976
|
+
const ye = G(r, ae);
|
|
5977
|
+
if (ye && ye._f) {
|
|
5978
|
+
const ve = Array.isArray(ye._f.refs) ? ye._f.refs[0] : ye._f.ref;
|
|
5979
|
+
if (Ka(ve)) {
|
|
5980
|
+
const Qe = ve.closest("form");
|
|
5979
5981
|
if (Qe) {
|
|
5980
5982
|
Qe.reset();
|
|
5981
5983
|
break;
|
|
@@ -5984,8 +5986,8 @@ function Au(e = {}) {
|
|
|
5984
5986
|
}
|
|
5985
5987
|
}
|
|
5986
5988
|
if (L.keepFieldsRef)
|
|
5987
|
-
for (const
|
|
5988
|
-
T(
|
|
5989
|
+
for (const ae of l.mount)
|
|
5990
|
+
T(ae, G(B, ae));
|
|
5989
5991
|
else
|
|
5990
5992
|
r = {};
|
|
5991
5993
|
}
|
|
@@ -6005,39 +6007,39 @@ function Au(e = {}) {
|
|
|
6005
6007
|
focus: ""
|
|
6006
6008
|
}, o.mount = !f.isValid || !!L.keepIsValid || !!L.keepDirtyValues || !t.shouldUnregister && !Je(B), o.watch = !!t.shouldUnregister, o.keepIsValid = !!L.keepIsValid, o.action = !1, L.keepErrors || (n.errors = {}), p.state.next({
|
|
6007
6009
|
submitCount: L.keepSubmitCount ? n.submitCount : 0,
|
|
6008
|
-
isDirty: W ? !1 : L.keepDirty ? n.isDirty : !!(L.keepDefaultValues && !pt(
|
|
6010
|
+
isDirty: W ? !1 : L.keepDirty ? n.isDirty : !!(L.keepDefaultValues && !pt(N, i)),
|
|
6009
6011
|
isSubmitted: L.keepIsSubmitted ? n.isSubmitted : !1,
|
|
6010
|
-
dirtyFields: W ? {} : L.keepDirtyValues ? L.keepDefaultValues && s ? Jt(i, s) : n.dirtyFields : L.keepDefaultValues &&
|
|
6012
|
+
dirtyFields: W ? {} : L.keepDirtyValues ? L.keepDefaultValues && s ? Jt(i, s) : n.dirtyFields : L.keepDefaultValues && N ? Jt(i, N) : L.keepDirty ? n.dirtyFields : {},
|
|
6011
6013
|
touchedFields: L.keepTouched ? n.touchedFields : {},
|
|
6012
6014
|
errors: L.keepErrors ? n.errors : {},
|
|
6013
6015
|
isSubmitSuccessful: L.keepIsSubmitSuccessful ? n.isSubmitSuccessful : !1,
|
|
6014
6016
|
isSubmitting: !1,
|
|
6015
6017
|
defaultValues: i
|
|
6016
6018
|
});
|
|
6017
|
-
},
|
|
6018
|
-
const R = G(r,
|
|
6019
|
+
}, rt = (N, L) => Se(et(N) ? N(s) : N, { ...t.resetOptions, ...L }), We = (N, L = {}) => {
|
|
6020
|
+
const R = G(r, N), H = R && R._f;
|
|
6019
6021
|
if (H) {
|
|
6020
6022
|
const W = H.refs ? H.refs[0] : H.ref;
|
|
6021
6023
|
W.focus && setTimeout(() => {
|
|
6022
6024
|
W.focus(), L.shouldSelect && et(W.select) && W.select();
|
|
6023
6025
|
});
|
|
6024
6026
|
}
|
|
6025
|
-
},
|
|
6027
|
+
}, pe = (N) => {
|
|
6026
6028
|
n = {
|
|
6027
6029
|
...n,
|
|
6028
|
-
...
|
|
6030
|
+
...N
|
|
6029
6031
|
};
|
|
6030
|
-
},
|
|
6032
|
+
}, le = {
|
|
6031
6033
|
control: {
|
|
6032
|
-
register:
|
|
6034
|
+
register: Ue,
|
|
6033
6035
|
unregister: ee,
|
|
6034
6036
|
getFieldState: me,
|
|
6035
6037
|
handleSubmit: $e,
|
|
6036
6038
|
setError: te,
|
|
6037
|
-
_subscribe:
|
|
6039
|
+
_subscribe: j,
|
|
6038
6040
|
_runSchema: _,
|
|
6039
6041
|
_updateIsValidating: y,
|
|
6040
|
-
_focusError:
|
|
6042
|
+
_focusError: je,
|
|
6041
6043
|
_getWatch: M,
|
|
6042
6044
|
_getDirty: D,
|
|
6043
6045
|
_setValid: x,
|
|
@@ -6045,14 +6047,14 @@ function Au(e = {}) {
|
|
|
6045
6047
|
_setDisabledField: Ge,
|
|
6046
6048
|
_setErrors: C,
|
|
6047
6049
|
_getFieldArray: z,
|
|
6048
|
-
_reset:
|
|
6049
|
-
_resetDefaultValues: () => et(t.defaultValues) && t.defaultValues().then((
|
|
6050
|
-
|
|
6050
|
+
_reset: Se,
|
|
6051
|
+
_resetDefaultValues: () => et(t.defaultValues) && t.defaultValues().then((N) => {
|
|
6052
|
+
rt(N, t.resetOptions), p.state.next({
|
|
6051
6053
|
isLoading: !1
|
|
6052
6054
|
});
|
|
6053
6055
|
}),
|
|
6054
6056
|
_removeUnmounted: E,
|
|
6055
|
-
_disableForm:
|
|
6057
|
+
_disableForm: ie,
|
|
6056
6058
|
_subjects: p,
|
|
6057
6059
|
_proxyFormState: f,
|
|
6058
6060
|
get _fields() {
|
|
@@ -6064,8 +6066,8 @@ function Au(e = {}) {
|
|
|
6064
6066
|
get _state() {
|
|
6065
6067
|
return o;
|
|
6066
6068
|
},
|
|
6067
|
-
set _state(
|
|
6068
|
-
o =
|
|
6069
|
+
set _state(N) {
|
|
6070
|
+
o = N;
|
|
6069
6071
|
},
|
|
6070
6072
|
get _defaultValues() {
|
|
6071
6073
|
return i;
|
|
@@ -6073,8 +6075,8 @@ function Au(e = {}) {
|
|
|
6073
6075
|
get _names() {
|
|
6074
6076
|
return l;
|
|
6075
6077
|
},
|
|
6076
|
-
set _names(
|
|
6077
|
-
l =
|
|
6078
|
+
set _names(N) {
|
|
6079
|
+
l = N;
|
|
6078
6080
|
},
|
|
6079
6081
|
get _formState() {
|
|
6080
6082
|
return n;
|
|
@@ -6082,31 +6084,31 @@ function Au(e = {}) {
|
|
|
6082
6084
|
get _options() {
|
|
6083
6085
|
return t;
|
|
6084
6086
|
},
|
|
6085
|
-
set _options(
|
|
6087
|
+
set _options(N) {
|
|
6086
6088
|
t = {
|
|
6087
6089
|
...t,
|
|
6088
|
-
...
|
|
6090
|
+
...N
|
|
6089
6091
|
};
|
|
6090
6092
|
}
|
|
6091
6093
|
},
|
|
6092
6094
|
subscribe: V,
|
|
6093
6095
|
trigger: J,
|
|
6094
|
-
register:
|
|
6096
|
+
register: Ue,
|
|
6095
6097
|
handleSubmit: $e,
|
|
6096
6098
|
watch: oe,
|
|
6097
6099
|
setValue: T,
|
|
6098
6100
|
getValues: Z,
|
|
6099
|
-
reset:
|
|
6100
|
-
resetField:
|
|
6101
|
-
clearErrors:
|
|
6101
|
+
reset: rt,
|
|
6102
|
+
resetField: Be,
|
|
6103
|
+
clearErrors: re,
|
|
6102
6104
|
unregister: ee,
|
|
6103
6105
|
setError: te,
|
|
6104
6106
|
setFocus: We,
|
|
6105
6107
|
getFieldState: me
|
|
6106
6108
|
};
|
|
6107
6109
|
return {
|
|
6108
|
-
...
|
|
6109
|
-
formControl:
|
|
6110
|
+
...le,
|
|
6111
|
+
formControl: le
|
|
6110
6112
|
};
|
|
6111
6113
|
}
|
|
6112
6114
|
function Du(e = {}) {
|
|
@@ -6267,15 +6269,15 @@ const Eu = {
|
|
|
6267
6269
|
control: C ? x : S.control,
|
|
6268
6270
|
name: C ? y : "_internal",
|
|
6269
6271
|
rules: C ? k : void 0
|
|
6270
|
-
}), [
|
|
6272
|
+
}), [w, _] = K(
|
|
6271
6273
|
t || Cn()
|
|
6272
|
-
), A = C ? F.field.value ?? Cn() : e ??
|
|
6274
|
+
), A = C ? F.field.value ?? Cn() : e ?? w, P = C && !!F.fieldState?.error, E = C && (F.fieldState?.isTouched ?? !1), D = P || E, M = D && (!A.amount || A.amount <= 0), z = D && !A.glAccount, [U, Y] = K(A.glAccount?.name || ""), T = X(
|
|
6273
6275
|
(te) => {
|
|
6274
6276
|
const oe = { ...A, ...te };
|
|
6275
6277
|
C && F.field.onChange(oe), !C && e === void 0 && _(oe), s?.(oe);
|
|
6276
6278
|
},
|
|
6277
6279
|
[A, e, s, C, F]
|
|
6278
|
-
),
|
|
6280
|
+
), ne = X(
|
|
6279
6281
|
(te) => {
|
|
6280
6282
|
const oe = te || 0;
|
|
6281
6283
|
T({ amount: oe }), o?.(oe);
|
|
@@ -6292,8 +6294,8 @@ const Eu = {
|
|
|
6292
6294
|
T({ glAccount: null }), l?.(null);
|
|
6293
6295
|
return;
|
|
6294
6296
|
}
|
|
6295
|
-
const
|
|
6296
|
-
T({ glAccount:
|
|
6297
|
+
const j = n.find((V) => String(V.id) === String(te)) || null;
|
|
6298
|
+
T({ glAccount: j }), l?.(j);
|
|
6297
6299
|
},
|
|
6298
6300
|
[n, T, l]
|
|
6299
6301
|
), Z = X(() => {
|
|
@@ -6303,7 +6305,7 @@ const Eu = {
|
|
|
6303
6305
|
T({ isTaxDeductible: te }), d?.(te);
|
|
6304
6306
|
},
|
|
6305
6307
|
[T, d]
|
|
6306
|
-
),
|
|
6308
|
+
), re = X(() => {
|
|
6307
6309
|
u?.();
|
|
6308
6310
|
}, [u]);
|
|
6309
6311
|
return /* @__PURE__ */ a(
|
|
@@ -6330,7 +6332,7 @@ const Eu = {
|
|
|
6330
6332
|
) })
|
|
6331
6333
|
] }),
|
|
6332
6334
|
value: A.amount || void 0,
|
|
6333
|
-
onValueChange:
|
|
6335
|
+
onValueChange: ne,
|
|
6334
6336
|
labelPlacement: "outside",
|
|
6335
6337
|
placeholder: $.amountPlaceholder,
|
|
6336
6338
|
isWheelDisabled: !0,
|
|
@@ -6366,7 +6368,7 @@ const Eu = {
|
|
|
6366
6368
|
variant: "bordered",
|
|
6367
6369
|
items: n,
|
|
6368
6370
|
menuTrigger: "input",
|
|
6369
|
-
inputValue: A.glAccount?.name ??
|
|
6371
|
+
inputValue: A.glAccount?.name ?? U,
|
|
6370
6372
|
selectedKey: A.glAccount?.id ?? null,
|
|
6371
6373
|
isDisabled: b,
|
|
6372
6374
|
isInvalid: z,
|
|
@@ -6405,7 +6407,7 @@ const Eu = {
|
|
|
6405
6407
|
color: "danger",
|
|
6406
6408
|
variant: "flat",
|
|
6407
6409
|
isDisabled: b || !h,
|
|
6408
|
-
onPress:
|
|
6410
|
+
onPress: re,
|
|
6409
6411
|
startContent: /* @__PURE__ */ a(O, { icon: "solar:trash-bin-trash-linear", width: 16 }),
|
|
6410
6412
|
className: m("text-danger", g.deleteButton),
|
|
6411
6413
|
children: $.deleteButton
|
|
@@ -6724,29 +6726,29 @@ function xg({
|
|
|
6724
6726
|
onCollapseChange: v,
|
|
6725
6727
|
onSave: x
|
|
6726
6728
|
}) {
|
|
6727
|
-
const [y, k] = K(null), $ = h ?? y ?? void 0, C = { ...zu, ...n }, S = e.filter((
|
|
6728
|
-
() => e.filter((
|
|
6729
|
+
const [y, k] = K(null), $ = h ?? y ?? void 0, C = { ...zu, ...n }, S = e.filter((j) => !fi(j)), w = S.filter(Uu).length > 0, _ = ue(
|
|
6730
|
+
() => e.filter((j) => !fi(j)).reduce((j, V) => j + Number(V.percentage || 0), 0),
|
|
6729
6731
|
[e]
|
|
6730
6732
|
), A = Math.round(_ * 100) / 100, P = S.some(
|
|
6731
|
-
(
|
|
6732
|
-
), E =
|
|
6733
|
+
(j) => !j.fund || Number(j.percentage || 0) <= 0
|
|
6734
|
+
), E = w && (A !== 100 || P), D = `${C.totalError} (${C.total} ${Number(_.toFixed(2))}%)`, M = Ou({ mode: "split", assignments: e }), z = w && A >= 100, [U, Y] = K(!1), [T, ne] = K(!1), q = /* @__PURE__ */ c("span", { className: "flex items-center gap-2", children: [
|
|
6733
6735
|
/* @__PURE__ */ a(Iu, {}),
|
|
6734
6736
|
/* @__PURE__ */ a("span", { className: "text-base font-medium leading-6 text-zinc-950", children: C.title }),
|
|
6735
6737
|
o ? /* @__PURE__ */ a(ht, { size: "sm", radius: "full", color: "success", variant: "flat", children: C.saved }) : null
|
|
6736
|
-
] }), J = (
|
|
6738
|
+
] }), J = (j, V) => {
|
|
6737
6739
|
b(
|
|
6738
6740
|
e.map(
|
|
6739
|
-
(ee) => ee.id ===
|
|
6741
|
+
(ee) => ee.id === j ? { ...ee, ...V } : ee
|
|
6740
6742
|
)
|
|
6741
6743
|
);
|
|
6742
6744
|
}, Z = () => {
|
|
6743
6745
|
z || b([...e, Pu()]);
|
|
6744
|
-
}, me = (
|
|
6745
|
-
e.length <= 1 || b(e.filter((V) => V.id !==
|
|
6746
|
-
},
|
|
6746
|
+
}, me = (j) => {
|
|
6747
|
+
e.length <= 1 || b(e.filter((V) => V.id !== j));
|
|
6748
|
+
}, re = () => {
|
|
6747
6749
|
if (!i) {
|
|
6748
6750
|
if (!M) {
|
|
6749
|
-
|
|
6751
|
+
ne(!0);
|
|
6750
6752
|
return;
|
|
6751
6753
|
}
|
|
6752
6754
|
if (!s) {
|
|
@@ -6757,11 +6759,11 @@ function xg({
|
|
|
6757
6759
|
}
|
|
6758
6760
|
}, te = () => {
|
|
6759
6761
|
Y(!1), x();
|
|
6760
|
-
}, oe = (
|
|
6762
|
+
}, oe = (j) => {
|
|
6761
6763
|
const V = u ?? e.find((ee) => !ee.fund)?.id ?? e[0]?.id;
|
|
6762
6764
|
V && (b(
|
|
6763
6765
|
e.map(
|
|
6764
|
-
(ee) => ee.id === V ? { ...ee, fund:
|
|
6766
|
+
(ee) => ee.id === V ? { ...ee, fund: j } : ee
|
|
6765
6767
|
)
|
|
6766
6768
|
), g());
|
|
6767
6769
|
};
|
|
@@ -6789,10 +6791,10 @@ function xg({
|
|
|
6789
6791
|
content: "w-full px-4 pb-4 pt-0",
|
|
6790
6792
|
indicator: "text-zinc-500 [&>svg]:size-4"
|
|
6791
6793
|
},
|
|
6792
|
-
onSelectionChange: (
|
|
6794
|
+
onSelectionChange: (j) => v?.(!(j === "all" || Array.from(j).length > 0)),
|
|
6793
6795
|
children: /* @__PURE__ */ a(ar, { "aria-label": C.title, title: q, children: /* @__PURE__ */ c("div", { className: m("flex w-full flex-col gap-4", r?.content), children: [
|
|
6794
6796
|
/* @__PURE__ */ c("div", { className: "flex w-full flex-col gap-4", children: [
|
|
6795
|
-
!
|
|
6797
|
+
!w && /* @__PURE__ */ a(
|
|
6796
6798
|
yt,
|
|
6797
6799
|
{
|
|
6798
6800
|
icon: /* @__PURE__ */ a(O, { icon: "solar:info-circle-outline", className: "size-4" }),
|
|
@@ -6804,7 +6806,7 @@ function xg({
|
|
|
6804
6806
|
title: C.emptySplit
|
|
6805
6807
|
}
|
|
6806
6808
|
),
|
|
6807
|
-
|
|
6809
|
+
w && /* @__PURE__ */ a(
|
|
6808
6810
|
ju,
|
|
6809
6811
|
{
|
|
6810
6812
|
assignments: e,
|
|
@@ -6812,9 +6814,9 @@ function xg({
|
|
|
6812
6814
|
total: _,
|
|
6813
6815
|
hasTotalError: T && !M || E,
|
|
6814
6816
|
validationMessage: D,
|
|
6815
|
-
onSelectFund: (
|
|
6817
|
+
onSelectFund: (j) => p(j),
|
|
6816
6818
|
onRemoveFund: me,
|
|
6817
|
-
onPercentageChange: (
|
|
6819
|
+
onPercentageChange: (j, V) => J(j, { percentage: Vu(V) })
|
|
6818
6820
|
}
|
|
6819
6821
|
),
|
|
6820
6822
|
/* @__PURE__ */ c("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
|
|
@@ -6828,7 +6830,7 @@ function xg({
|
|
|
6828
6830
|
className: "h-11 bg-zinc-950 px-4 text-lg font-normal text-white disabled:opacity-50 [@container(max-width:479px)]:w-full",
|
|
6829
6831
|
startContent: /* @__PURE__ */ a(lr, { className: "size-5", strokeWidth: 2 }),
|
|
6830
6832
|
isDisabled: z,
|
|
6831
|
-
onPress: () =>
|
|
6833
|
+
onPress: () => w ? Z() : p(),
|
|
6832
6834
|
children: C.assignSpecificFund
|
|
6833
6835
|
}
|
|
6834
6836
|
),
|
|
@@ -6844,7 +6846,7 @@ function xg({
|
|
|
6844
6846
|
startContent: i ? void 0 : /* @__PURE__ */ a(O, { icon: "solar:cloud-upload-outline", className: "size-4" }),
|
|
6845
6847
|
isLoading: i,
|
|
6846
6848
|
isDisabled: !M || i,
|
|
6847
|
-
onPress:
|
|
6849
|
+
onPress: re,
|
|
6848
6850
|
children: C.saveAssignment
|
|
6849
6851
|
}
|
|
6850
6852
|
)
|
|
@@ -6859,7 +6861,7 @@ function xg({
|
|
|
6859
6861
|
{
|
|
6860
6862
|
funds: t,
|
|
6861
6863
|
labels: C,
|
|
6862
|
-
selectedFundIds: e.map((
|
|
6864
|
+
selectedFundIds: e.map((j) => j.fund?.id).filter(Boolean),
|
|
6863
6865
|
portalContainer: $,
|
|
6864
6866
|
onSelect: oe,
|
|
6865
6867
|
onClose: g
|
|
@@ -6868,7 +6870,7 @@ function xg({
|
|
|
6868
6870
|
/* @__PURE__ */ a(
|
|
6869
6871
|
al,
|
|
6870
6872
|
{
|
|
6871
|
-
isOpen:
|
|
6873
|
+
isOpen: U,
|
|
6872
6874
|
labels: {
|
|
6873
6875
|
title: C.modifyAssignedFundsTitle,
|
|
6874
6876
|
description: /* @__PURE__ */ c(de, { children: [
|
|
@@ -7317,7 +7319,7 @@ function wg({
|
|
|
7317
7319
|
onAutomaticSettingsChange: C,
|
|
7318
7320
|
onInstallmentsChange: S,
|
|
7319
7321
|
onSave: F,
|
|
7320
|
-
onCancel:
|
|
7322
|
+
onCancel: w
|
|
7321
7323
|
}) {
|
|
7322
7324
|
const [_, A] = K(o), P = { ...nm, ...g }, E = e ?? _, D = ue(() => new Intl.NumberFormat(r, { style: "currency", currency: n }), [n, r]), M = ue(
|
|
7323
7325
|
() => ({
|
|
@@ -7331,31 +7333,31 @@ function wg({
|
|
|
7331
7333
|
// that date, and overriding it would show a schedule that
|
|
7332
7334
|
// contradicts the field right above it.
|
|
7333
7335
|
f.includes("firstInstallmentDate") ? void 0 : p
|
|
7334
|
-
) : i,
|
|
7336
|
+
) : i, U = ue(
|
|
7335
7337
|
() => Qa(z.reduce((ee, Ge) => ee + Number(Ge.amount || 0), 0)),
|
|
7336
7338
|
[z]
|
|
7337
|
-
), Y = Math.abs(
|
|
7339
|
+
), Y = Math.abs(U - t) > 9e-3, T = Qa(t - U) <= 0, ne = ue(() => Ju(i), [i]), q = E === "manual" && em(ne), J = Y || q, Z = l ? /* @__PURE__ */ c("span", { className: "flex items-center gap-2", children: [
|
|
7338
7340
|
/* @__PURE__ */ a(os, { className: "size-4 text-zinc-500", strokeWidth: 1.75 }),
|
|
7339
7341
|
/* @__PURE__ */ a("span", { className: "text-base font-medium leading-6 text-zinc-950", children: P.title }),
|
|
7340
7342
|
y ? /* @__PURE__ */ a(ht, { size: "sm", radius: "full", color: "success", variant: "flat", children: P.saved }) : null
|
|
7341
7343
|
] }) : void 0, me = (ee) => {
|
|
7342
7344
|
ee !== E && (e || A(ee), $?.(ee), ee === "manual" && i.length === 0 && S([pi()]));
|
|
7343
|
-
},
|
|
7344
|
-
const
|
|
7345
|
-
Vt(
|
|
7345
|
+
}, re = (ee, Ge) => {
|
|
7346
|
+
const Ue = i.find((je) => je.id === ee);
|
|
7347
|
+
Vt(Ue?.status) || S(
|
|
7346
7348
|
i.map(
|
|
7347
|
-
(
|
|
7349
|
+
(je) => je.id === ee ? { ...je, ...Ge } : je
|
|
7348
7350
|
)
|
|
7349
7351
|
);
|
|
7350
7352
|
}, te = () => {
|
|
7351
7353
|
S([...i, pi()]);
|
|
7352
7354
|
}, oe = (ee) => {
|
|
7353
|
-
const Ge = i.find((
|
|
7354
|
-
Vt(Ge?.status) || S(i.filter((
|
|
7355
|
-
},
|
|
7355
|
+
const Ge = i.find((Ue) => Ue.id === ee);
|
|
7356
|
+
Vt(Ge?.status) || S(i.filter((Ue) => Ue.id !== ee));
|
|
7357
|
+
}, j = () => {
|
|
7356
7358
|
x || J || F?.();
|
|
7357
7359
|
}, V = /* @__PURE__ */ c("div", { className: m("flex w-full flex-col gap-4", v?.content), children: [
|
|
7358
|
-
h || u ||
|
|
7360
|
+
h || u || w ? /* @__PURE__ */ c("div", { className: "flex w-full items-center justify-between gap-6", children: [
|
|
7359
7361
|
h ? /* @__PURE__ */ a(
|
|
7360
7362
|
um,
|
|
7361
7363
|
{
|
|
@@ -7367,7 +7369,7 @@ function wg({
|
|
|
7367
7369
|
}
|
|
7368
7370
|
) : null,
|
|
7369
7371
|
/* @__PURE__ */ c("div", { className: "ml-auto flex items-center gap-3", children: [
|
|
7370
|
-
|
|
7372
|
+
w ? /* @__PURE__ */ a(
|
|
7371
7373
|
I,
|
|
7372
7374
|
{
|
|
7373
7375
|
type: "button",
|
|
@@ -7377,7 +7379,7 @@ function wg({
|
|
|
7377
7379
|
radius: "full",
|
|
7378
7380
|
className: "min-w-28",
|
|
7379
7381
|
isDisabled: x,
|
|
7380
|
-
onPress:
|
|
7382
|
+
onPress: w,
|
|
7381
7383
|
children: P.cancelEdit
|
|
7382
7384
|
}
|
|
7383
7385
|
) : null,
|
|
@@ -7393,7 +7395,7 @@ function wg({
|
|
|
7393
7395
|
startContent: x ? void 0 : /* @__PURE__ */ a(O, { icon: "solar:cloud-upload-outline", className: "size-4" }),
|
|
7394
7396
|
isLoading: x,
|
|
7395
7397
|
isDisabled: x || J,
|
|
7396
|
-
onPress:
|
|
7398
|
+
onPress: j,
|
|
7397
7399
|
children: P.saveInstallments
|
|
7398
7400
|
}
|
|
7399
7401
|
) : null
|
|
@@ -7425,11 +7427,11 @@ function wg({
|
|
|
7425
7427
|
{
|
|
7426
7428
|
mode: E,
|
|
7427
7429
|
installments: z,
|
|
7428
|
-
rowErrors:
|
|
7430
|
+
rowErrors: ne,
|
|
7429
7431
|
labels: P,
|
|
7430
7432
|
formatter: D,
|
|
7431
7433
|
locale: r,
|
|
7432
|
-
onUpdateInstallment:
|
|
7434
|
+
onUpdateInstallment: re,
|
|
7433
7435
|
onRemoveInstallment: oe
|
|
7434
7436
|
}
|
|
7435
7437
|
),
|
|
@@ -7450,7 +7452,7 @@ function wg({
|
|
|
7450
7452
|
/* @__PURE__ */ a(
|
|
7451
7453
|
gm,
|
|
7452
7454
|
{
|
|
7453
|
-
total:
|
|
7455
|
+
total: U,
|
|
7454
7456
|
donationAmount: t,
|
|
7455
7457
|
hasTotalMismatch: Y,
|
|
7456
7458
|
mode: E,
|
|
@@ -7901,7 +7903,7 @@ function kg({
|
|
|
7901
7903
|
/* @__PURE__ */ a(os, { className: "size-4 text-zinc-500", strokeWidth: 1.75 }),
|
|
7902
7904
|
/* @__PURE__ */ a("span", { className: "text-base font-medium leading-6 text-zinc-950", children: x.title }),
|
|
7903
7905
|
d ? /* @__PURE__ */ a(ht, { size: "sm", radius: "full", color: "success", variant: "flat", children: x.saved }) : null
|
|
7904
|
-
] }) : void 0,
|
|
7906
|
+
] }) : void 0, w = ue(() => {
|
|
7905
7907
|
const A = y.trim().toLowerCase();
|
|
7906
7908
|
if (!A) return e;
|
|
7907
7909
|
const P = new Intl.NumberFormat(n, { style: "currency", currency: t });
|
|
@@ -7963,10 +7965,10 @@ function kg({
|
|
|
7963
7965
|
{
|
|
7964
7966
|
className: m(
|
|
7965
7967
|
"hidden [@container(max-width:767px)]:block",
|
|
7966
|
-
|
|
7968
|
+
w.length > 3 && "max-h-[560px] overflow-y-auto pr-1"
|
|
7967
7969
|
),
|
|
7968
7970
|
children: /* @__PURE__ */ c("div", { className: "flex flex-col gap-2", children: [
|
|
7969
|
-
|
|
7971
|
+
w.map((A, P) => {
|
|
7970
7972
|
const E = A.status ?? "scheduled", D = Sn(A), M = An(A, x.paidOn, n), z = Dn(A, x.refundedAmount, $);
|
|
7971
7973
|
return /* @__PURE__ */ a(_e, { radius: "lg", shadow: "none", className: "border border-default-200", children: /* @__PURE__ */ c(Re, { className: "gap-3 p-3", children: [
|
|
7972
7974
|
/* @__PURE__ */ c("div", { className: "flex items-start justify-between gap-2", children: [
|
|
@@ -8006,7 +8008,7 @@ function kg({
|
|
|
8006
8008
|
)
|
|
8007
8009
|
] }) }, A.id);
|
|
8008
8010
|
}),
|
|
8009
|
-
|
|
8011
|
+
w.length === 0 && /* @__PURE__ */ a("div", { className: "rounded-lg border border-default-200 px-4 py-6 text-center text-sm text-default-500", children: x.noInstallmentsFound })
|
|
8010
8012
|
] })
|
|
8011
8013
|
}
|
|
8012
8014
|
),
|
|
@@ -8015,7 +8017,7 @@ function kg({
|
|
|
8015
8017
|
{
|
|
8016
8018
|
className: m(
|
|
8017
8019
|
"w-full overflow-x-hidden [@container(max-width:767px)]:hidden",
|
|
8018
|
-
|
|
8020
|
+
w.length > 5 && "max-h-[344px] overflow-y-auto pr-1"
|
|
8019
8021
|
),
|
|
8020
8022
|
children: /* @__PURE__ */ c("table", { className: "w-full table-fixed border-collapse text-left text-sm", children: [
|
|
8021
8023
|
/* @__PURE__ */ c("colgroup", { children: [
|
|
@@ -8035,7 +8037,7 @@ function kg({
|
|
|
8035
8037
|
/* @__PURE__ */ a("th", { className: "whitespace-nowrap py-3 pl-4 pr-2 font-medium", children: x.actions })
|
|
8036
8038
|
] }) }),
|
|
8037
8039
|
/* @__PURE__ */ c("tbody", { children: [
|
|
8038
|
-
|
|
8040
|
+
w.map((A, P) => {
|
|
8039
8041
|
const E = A.status ?? "scheduled", D = Sn(A), M = An(A, x.paidOn, n), z = Dn(
|
|
8040
8042
|
A,
|
|
8041
8043
|
x.refundedAmount,
|
|
@@ -8068,7 +8070,7 @@ function kg({
|
|
|
8068
8070
|
) })
|
|
8069
8071
|
] }, A.id);
|
|
8070
8072
|
}),
|
|
8071
|
-
|
|
8073
|
+
w.length === 0 && /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: 6, className: "px-2 py-6 text-center text-zinc-500", children: x.noInstallmentsFound }) })
|
|
8072
8074
|
] })
|
|
8073
8075
|
] })
|
|
8074
8076
|
}
|
|
@@ -8287,7 +8289,7 @@ const Cm = {
|
|
|
8287
8289
|
className: f = ""
|
|
8288
8290
|
}) => {
|
|
8289
8291
|
const b = Array.isArray(e) ? e : [], [p, g] = K(l), [v, x] = K(o), y = { ...Cm, ...i };
|
|
8290
|
-
|
|
8292
|
+
Ve(() => {
|
|
8291
8293
|
g(l);
|
|
8292
8294
|
}, [l]);
|
|
8293
8295
|
const k = (C) => {
|
|
@@ -8432,7 +8434,7 @@ const Cm = {
|
|
|
8432
8434
|
footerClassName: y = "",
|
|
8433
8435
|
dataTestId: k
|
|
8434
8436
|
}) => {
|
|
8435
|
-
const $ = !!(d && d.value), C = !!u?.label, S = b && !!f && !C, F = !S,
|
|
8437
|
+
const $ = !!(d && d.value), C = !!u?.label, S = b && !!f && !C, F = !S, w = C ? {
|
|
8436
8438
|
variant: u?.variant ?? vi.variant,
|
|
8437
8439
|
color: u?.color ?? vi.color,
|
|
8438
8440
|
size: u?.size ?? "sm",
|
|
@@ -8516,11 +8518,11 @@ const Cm = {
|
|
|
8516
8518
|
{
|
|
8517
8519
|
className: m("rounded-full", u?.className),
|
|
8518
8520
|
onPress: u?.onPress,
|
|
8519
|
-
variant:
|
|
8520
|
-
color:
|
|
8521
|
-
size:
|
|
8522
|
-
startContent:
|
|
8523
|
-
isDisabled:
|
|
8521
|
+
variant: w?.variant,
|
|
8522
|
+
color: w?.color,
|
|
8523
|
+
size: w?.size,
|
|
8524
|
+
startContent: w?.startContent,
|
|
8525
|
+
isDisabled: w?.isDisabled,
|
|
8524
8526
|
"aria-label": u?.ariaLabel || u?.label,
|
|
8525
8527
|
children: u?.label
|
|
8526
8528
|
}
|
|
@@ -9142,8 +9144,8 @@ const jm = ({ title: e, value: t, description: n, onValueChange: r, className: i
|
|
|
9142
9144
|
);
|
|
9143
9145
|
return new Map(k);
|
|
9144
9146
|
}, [l]), p = Ym(l, u, t), g = (k, $, C) => u[k]?.[$]?.[C]?.selectedQuantity ?? 0, v = () => ul(u), x = (k, $, C, S) => {
|
|
9145
|
-
const F = g(k, $, C),
|
|
9146
|
-
if (t !== void 0 &&
|
|
9147
|
+
const F = g(k, $, C), w = v() - F;
|
|
9148
|
+
if (t !== void 0 && w + S > t) return;
|
|
9147
9149
|
const _ = b.get(Ni(k, $, C));
|
|
9148
9150
|
if (!_) return;
|
|
9149
9151
|
const A = {
|
|
@@ -9166,7 +9168,7 @@ const jm = ({ title: e, value: t, description: n, onValueChange: r, className: i
|
|
|
9166
9168
|
const $ = wi(l, t, k);
|
|
9167
9169
|
h($), o?.($);
|
|
9168
9170
|
};
|
|
9169
|
-
return
|
|
9171
|
+
return Ve(() => {
|
|
9170
9172
|
!f.current && p && (o?.(u), f.current = !0);
|
|
9171
9173
|
}, [p, u, o]), /* @__PURE__ */ c("div", { className: m("flex flex-col w-full font-sans", s), "data-testid": "ticket-selection", children: [
|
|
9172
9174
|
/* @__PURE__ */ c("div", { className: "flex items-center justify-between py-2 gap-4", "data-testid": "ticket-selection-header", children: [
|
|
@@ -9241,16 +9243,16 @@ const jm = ({ title: e, value: t, description: n, onValueChange: r, className: i
|
|
|
9241
9243
|
closeOnConfirm: S = !0,
|
|
9242
9244
|
keepOpenAfterClear: F = !1
|
|
9243
9245
|
}) => {
|
|
9244
|
-
const [
|
|
9246
|
+
const [w, _] = K(k), [A, P] = K(() => _n(u)), E = y ?? w, D = b ?? u.filter((Z) => ef(Z)).length, M = (Z) => {
|
|
9245
9247
|
Z && P(_n(u)), y || _(Z), $?.(Z);
|
|
9246
9248
|
}, z = (Z, me) => {
|
|
9247
|
-
P((
|
|
9248
|
-
...
|
|
9249
|
+
P((re) => ({
|
|
9250
|
+
...re,
|
|
9249
9251
|
[Z.id]: me
|
|
9250
9252
|
}));
|
|
9251
|
-
},
|
|
9252
|
-
P((
|
|
9253
|
-
...
|
|
9253
|
+
}, U = (Z, me) => {
|
|
9254
|
+
P((re) => ({
|
|
9255
|
+
...re,
|
|
9254
9256
|
[Z.id]: me ? [me] : []
|
|
9255
9257
|
}));
|
|
9256
9258
|
}, Y = async () => {
|
|
@@ -9258,15 +9260,15 @@ const jm = ({ title: e, value: t, description: n, onValueChange: r, className: i
|
|
|
9258
9260
|
}, T = async () => {
|
|
9259
9261
|
const Z = Jm(A, u);
|
|
9260
9262
|
await h(Z), S && M(!1);
|
|
9261
|
-
},
|
|
9263
|
+
}, ne = (Z) => {
|
|
9262
9264
|
if (Z.type === "checkbox")
|
|
9263
9265
|
return /* @__PURE__ */ a(
|
|
9264
9266
|
fo,
|
|
9265
9267
|
{
|
|
9266
9268
|
label: Z.label,
|
|
9267
9269
|
value: A[Z.id] ?? [],
|
|
9268
|
-
onValueChange: (
|
|
9269
|
-
children: Z.options.map((
|
|
9270
|
+
onValueChange: (re) => z(Z, re),
|
|
9271
|
+
children: Z.options.map((re) => /* @__PURE__ */ a(an, { value: re.value, isDisabled: re.isDisabled, children: re.label }, re.value))
|
|
9270
9272
|
},
|
|
9271
9273
|
Z.id
|
|
9272
9274
|
);
|
|
@@ -9276,8 +9278,8 @@ const jm = ({ title: e, value: t, description: n, onValueChange: r, className: i
|
|
|
9276
9278
|
{
|
|
9277
9279
|
label: Z.label,
|
|
9278
9280
|
value: me,
|
|
9279
|
-
onValueChange: (
|
|
9280
|
-
children: Z.options.map((
|
|
9281
|
+
onValueChange: (re) => U(Z, re || null),
|
|
9282
|
+
children: Z.options.map((re) => /* @__PURE__ */ a(ho, { value: re.value, isDisabled: re.isDisabled, children: re.label }, re.value))
|
|
9281
9283
|
},
|
|
9282
9284
|
Z.id
|
|
9283
9285
|
);
|
|
@@ -9312,7 +9314,7 @@ const jm = ({ title: e, value: t, description: n, onValueChange: r, className: i
|
|
|
9312
9314
|
}
|
|
9313
9315
|
) }),
|
|
9314
9316
|
/* @__PURE__ */ a(Ca, { className: l, children: /* @__PURE__ */ c("div", { className: "flex w-full flex-col gap-5 px-4 py-4", children: [
|
|
9315
|
-
u.map((Z) =>
|
|
9317
|
+
u.map((Z) => ne(Z)),
|
|
9316
9318
|
/* @__PURE__ */ c("div", { className: "flex items-center justify-end gap-2 border-t border-gray-200 pt-3", children: [
|
|
9317
9319
|
/* @__PURE__ */ a(I, { variant: "light", color: "default", size: "sm", onPress: Y, children: x }),
|
|
9318
9320
|
/* @__PURE__ */ a(I, { color: "primary", size: "sm", onPress: T, children: v })
|
|
@@ -9345,7 +9347,7 @@ const af = "No sessions available for this date", nf = (e) => e === "sold-out" |
|
|
|
9345
9347
|
headingClassName: y,
|
|
9346
9348
|
subheadingClassName: k
|
|
9347
9349
|
}) => {
|
|
9348
|
-
const $ = sf(n, r), C = n.find((A) => A.date === $), S = s ?? n.map((A) => ({ date: A.date, label: A.label })), F = C?.sessions ?? [],
|
|
9350
|
+
const $ = sf(n, r), C = n.find((A) => A.date === $), S = s ?? n.map((A) => ({ date: A.date, label: A.label })), F = C?.sessions ?? [], w = (A) => A === $ ? "solid" : "bordered", _ = (A) => {
|
|
9349
9351
|
if (!ki(A)) {
|
|
9350
9352
|
if (A.id === o) {
|
|
9351
9353
|
l(null);
|
|
@@ -9370,7 +9372,7 @@ const af = "No sessions available for this date", nf = (e) => e === "sold-out" |
|
|
|
9370
9372
|
I,
|
|
9371
9373
|
{
|
|
9372
9374
|
size: "sm",
|
|
9373
|
-
variant:
|
|
9375
|
+
variant: w(A.date),
|
|
9374
9376
|
color: "default",
|
|
9375
9377
|
className: m("rounded-full", b),
|
|
9376
9378
|
isDisabled: A.isDisabled,
|
|
@@ -9453,7 +9455,7 @@ function ia() {
|
|
|
9453
9455
|
l && n(l.borderBoxSize?.[0]?.inlineSize ?? l.contentRect.width);
|
|
9454
9456
|
});
|
|
9455
9457
|
return n(i.getBoundingClientRect().width), s.observe(i), () => s.disconnect();
|
|
9456
|
-
}, []),
|
|
9458
|
+
}, []), Ve(() => {
|
|
9457
9459
|
if (typeof MutationObserver > "u") return;
|
|
9458
9460
|
const i = document.documentElement, s = new MutationObserver(() => r(getComputedStyle(i).fontSize));
|
|
9459
9461
|
return s.observe(i, { attributes: !0, attributeFilter: ["style", "class"] }), () => s.disconnect();
|
|
@@ -9568,17 +9570,17 @@ const cf = 48, ct = {
|
|
|
9568
9570
|
return /* @__PURE__ */ a(ml, { ...e, list: !0, narrow: r, headerRef: t });
|
|
9569
9571
|
}, ff = (e) => e.variant === "list" ? /* @__PURE__ */ a(mf, { ...e }) : /* @__PURE__ */ a(ml, { ...e, list: !1, narrow: !1 });
|
|
9570
9572
|
ff.displayName = "PageHeader";
|
|
9571
|
-
const
|
|
9572
|
-
ok: { fg:
|
|
9573
|
-
warn: { fg:
|
|
9574
|
-
danger: { fg:
|
|
9575
|
-
info: { fg:
|
|
9576
|
-
violet: { fg:
|
|
9577
|
-
neutral: { fg:
|
|
9573
|
+
const dt = {
|
|
9574
|
+
ok: { fg: he.ok, bg: he["ok-fill"] },
|
|
9575
|
+
warn: { fg: he.warn, bg: he["warn-fill"] },
|
|
9576
|
+
danger: { fg: he.danger, bg: he["danger-fill"] },
|
|
9577
|
+
info: { fg: he.info, bg: he["info-fill"] },
|
|
9578
|
+
violet: { fg: he.violet, bg: he["violet-fill"] },
|
|
9579
|
+
neutral: { fg: he.neutral, bg: he["neutral-fill"] }
|
|
9578
9580
|
};
|
|
9579
9581
|
function Ea(e) {
|
|
9580
|
-
if (e === "positive") return { color:
|
|
9581
|
-
if (e === "negative") return { color:
|
|
9582
|
+
if (e === "positive") return { color: he.ok };
|
|
9583
|
+
if (e === "negative") return { color: he.danger };
|
|
9582
9584
|
}
|
|
9583
9585
|
const pf = {
|
|
9584
9586
|
active: "success",
|
|
@@ -9602,8 +9604,8 @@ const pf = {
|
|
|
9602
9604
|
archived: { fg: "#9CA3AF", bg: "#F1F2F4" },
|
|
9603
9605
|
inactive: { fg: "#9CA3AF", bg: "#F1F2F4" },
|
|
9604
9606
|
neutral: { fg: "#9CA3AF", bg: "#F1F2F4" },
|
|
9605
|
-
info:
|
|
9606
|
-
violet:
|
|
9607
|
+
info: dt.info,
|
|
9608
|
+
violet: dt.violet
|
|
9607
9609
|
}, hf = {
|
|
9608
9610
|
active: "ok",
|
|
9609
9611
|
success: "ok",
|
|
@@ -9634,7 +9636,7 @@ const pf = {
|
|
|
9634
9636
|
"data-testid": l = "status-chip"
|
|
9635
9637
|
}) => {
|
|
9636
9638
|
if (n === "plain") {
|
|
9637
|
-
const u =
|
|
9639
|
+
const u = dt[hf[e]];
|
|
9638
9640
|
return /* @__PURE__ */ c(
|
|
9639
9641
|
"span",
|
|
9640
9642
|
{
|
|
@@ -9936,7 +9938,7 @@ const kf = {
|
|
|
9936
9938
|
)
|
|
9937
9939
|
);
|
|
9938
9940
|
xl.displayName = "RowActions";
|
|
9939
|
-
const Cf =
|
|
9941
|
+
const Cf = Ie.palettes.warning[50], $f = "solar:alt-arrow-down-outline", Sf = "solar:pen-2-outline", Af = {
|
|
9940
9942
|
sm: "hidden sm:table-cell",
|
|
9941
9943
|
md: "hidden md:table-cell",
|
|
9942
9944
|
lg: "hidden lg:table-cell"
|
|
@@ -10000,15 +10002,15 @@ function Lf({
|
|
|
10000
10002
|
const y = Ye(), k = h !== void 0, [$, C] = K(() => new Set(f ?? [])), S = ue(
|
|
10001
10003
|
() => k ? new Set(h) : $,
|
|
10002
10004
|
[k, h, $]
|
|
10003
|
-
), F = ge(/* @__PURE__ */ new Map()),
|
|
10005
|
+
), F = ge(/* @__PURE__ */ new Map()), w = ge(null), _ = (E, D, M) => {
|
|
10004
10006
|
if (S.has(E) === D) return;
|
|
10005
10007
|
const z = new Set(S);
|
|
10006
10008
|
D ? z.add(E) : z.delete(E), k || C(z), b?.(z, { key: E, expanded: D, reason: M });
|
|
10007
10009
|
};
|
|
10008
10010
|
Wt(() => {
|
|
10009
|
-
const E =
|
|
10011
|
+
const E = w.current;
|
|
10010
10012
|
if (E === null || S.has(E)) return;
|
|
10011
|
-
|
|
10013
|
+
w.current = null;
|
|
10012
10014
|
const D = document.activeElement;
|
|
10013
10015
|
(D === null || D === document.body) && F.current.get(E)?.focus();
|
|
10014
10016
|
});
|
|
@@ -10031,21 +10033,21 @@ function Lf({
|
|
|
10031
10033
|
)),
|
|
10032
10034
|
/* @__PURE__ */ a("th", { scope: "col", className: m(De.th, De.thActions), children: /* @__PURE__ */ a("span", { className: "sr-only", children: p.actions }) })
|
|
10033
10035
|
] }) }),
|
|
10034
|
-
n.length === 0 &&
|
|
10036
|
+
n.length === 0 && se(g) ? /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: P, className: De.empty, "data-testid": `${x}-empty`, children: g }) }) }) : null,
|
|
10035
10037
|
n.map((E, D) => {
|
|
10036
|
-
const M = r(E), z = S.has(M),
|
|
10038
|
+
const M = r(E), z = S.has(M), U = u?.(E) ?? !1, Y = p.toggleRow(i(E)), T = `${y}-panel-${D}`, ne = d?.(E, D) ?? [], q = { rowIndex: D, close: () => _(M, !1, "done") };
|
|
10037
10039
|
return /* @__PURE__ */ c(
|
|
10038
10040
|
"tbody",
|
|
10039
10041
|
{
|
|
10040
10042
|
"data-testid": `${x}-row-${M}`,
|
|
10041
10043
|
"data-expanded": z ? "true" : "false",
|
|
10042
|
-
"data-needs-fix":
|
|
10044
|
+
"data-needs-fix": U ? "true" : void 0,
|
|
10043
10045
|
children: [
|
|
10044
10046
|
/* @__PURE__ */ c(
|
|
10045
10047
|
"tr",
|
|
10046
10048
|
{
|
|
10047
10049
|
className: m(De.row, z && De.rowOpen),
|
|
10048
|
-
style:
|
|
10050
|
+
style: U && !z ? { backgroundColor: Cf } : void 0,
|
|
10049
10051
|
children: [
|
|
10050
10052
|
t.map((J) => /* @__PURE__ */ a("td", { className: m(De.td, Ci(J)), children: s(E, J.key, D) }, J.key)),
|
|
10051
10053
|
/* @__PURE__ */ a("td", { className: De.tdActions, children: /* @__PURE__ */ c("div", { className: De.actions, children: [
|
|
@@ -10075,7 +10077,7 @@ function Lf({
|
|
|
10075
10077
|
children: p.toggle
|
|
10076
10078
|
}
|
|
10077
10079
|
),
|
|
10078
|
-
|
|
10080
|
+
ne.length > 0 ? /* @__PURE__ */ a(xl, { actions: ne, "data-testid": `${x}-actions-${M}` }) : null
|
|
10079
10081
|
] }) })
|
|
10080
10082
|
]
|
|
10081
10083
|
}
|
|
@@ -10090,14 +10092,14 @@ function Lf({
|
|
|
10090
10092
|
className: De.panel,
|
|
10091
10093
|
onKeyDown: A(M),
|
|
10092
10094
|
onFocus: () => {
|
|
10093
|
-
|
|
10095
|
+
w.current = M;
|
|
10094
10096
|
},
|
|
10095
10097
|
onBlur: (J) => {
|
|
10096
10098
|
const Z = J.relatedTarget;
|
|
10097
|
-
Z && !J.currentTarget.contains(Z) && (
|
|
10099
|
+
Z && !J.currentTarget.contains(Z) && (w.current = null);
|
|
10098
10100
|
},
|
|
10099
10101
|
children: [
|
|
10100
|
-
|
|
10102
|
+
se(p.panelTitle) ? /* @__PURE__ */ c("p", { className: De.panelTitle, children: [
|
|
10101
10103
|
/* @__PURE__ */ a(
|
|
10102
10104
|
O,
|
|
10103
10105
|
{
|
|
@@ -10588,7 +10590,7 @@ const kl = ({
|
|
|
10588
10590
|
className: d,
|
|
10589
10591
|
"data-testid": u = "admin-field-label"
|
|
10590
10592
|
}) => {
|
|
10591
|
-
const h = Ye(), f = Nl(e, t, i, s), b =
|
|
10593
|
+
const h = Ye(), f = Nl(e, t, i, s), b = se(o), p = r ?? (b ? h : void 0);
|
|
10592
10594
|
return /* @__PURE__ */ c("div", { "data-testid": u, className: m(wl, d), children: [
|
|
10593
10595
|
n ? /* @__PURE__ */ a("label", { id: p, htmlFor: n, children: f }) : p ? /* @__PURE__ */ a("span", { id: p, children: f }) : f,
|
|
10594
10596
|
b && p ? /* @__PURE__ */ a(np, { help: o, label: l, labelledBy: p, testId: `${u}-help` }) : null
|
|
@@ -10614,7 +10616,7 @@ const rp = ({
|
|
|
10614
10616
|
className: v,
|
|
10615
10617
|
"data-testid": x = "admin-text-field"
|
|
10616
10618
|
}) => {
|
|
10617
|
-
const y = Ye(), k = Ye(), $ =
|
|
10619
|
+
const y = Ye(), k = Ye(), $ = se(e), C = $ && se(p), S = /* @__PURE__ */ a(
|
|
10618
10620
|
ze,
|
|
10619
10621
|
{
|
|
10620
10622
|
labelPlacement: $ && !C ? "outside" : void 0,
|
|
@@ -10743,44 +10745,44 @@ function dp({
|
|
|
10743
10745
|
onBlur: C,
|
|
10744
10746
|
size: S,
|
|
10745
10747
|
variant: F = "bordered",
|
|
10746
|
-
labelPlacement:
|
|
10748
|
+
labelPlacement: w = "outside-top",
|
|
10747
10749
|
className: _,
|
|
10748
10750
|
inputProps: A,
|
|
10749
10751
|
popoverProps: P,
|
|
10750
10752
|
"data-testid": E = "time-field"
|
|
10751
10753
|
}) {
|
|
10752
|
-
const [D, M] = ra(e, t, n), z = (
|
|
10753
|
-
|
|
10754
|
-
const te = Y.trim() !== "" && Y !==
|
|
10755
|
-
const
|
|
10756
|
-
let
|
|
10757
|
-
if (
|
|
10758
|
-
const L =
|
|
10759
|
-
|
|
10760
|
-
} else
|
|
10761
|
-
return
|
|
10762
|
-
}, [ee, d,
|
|
10763
|
-
(
|
|
10754
|
+
const [D, M] = ra(e, t, n), z = (le) => le ? Ri(le, p) : "", U = z(D), [Y, T] = K(U), [ne, q] = K(null), [J, Z] = K(!1), [me, re] = K(U);
|
|
10755
|
+
U !== me && (re(U), T(U), q(null));
|
|
10756
|
+
const te = Y.trim() !== "" && Y !== U, oe = te ? Li(Y) : null, j = te ? "typed" : Y.trim() === "" && !J ? "none" : "all", V = te ? Y : "", ee = ue(() => lp(h, f, b), [h, f, b]), Ge = ue(() => {
|
|
10757
|
+
const le = ee.filter((L) => ma(L, d));
|
|
10758
|
+
let N;
|
|
10759
|
+
if (j === "typed") {
|
|
10760
|
+
const L = le.filter((H) => op(H, V)), R = Li(V);
|
|
10761
|
+
N = R !== null && ma(R, d) ? [R, ...L.filter((H) => H !== R)] : L;
|
|
10762
|
+
} else j === "none" ? N = [] : D !== null && ma(D, d) && !le.includes(D) ? N = [...le, D].sort() : N = le;
|
|
10763
|
+
return N.map((L) => ({ key: L, label: Ri(L, p) }));
|
|
10764
|
+
}, [ee, d, j, V, D, p]), Ue = X(
|
|
10765
|
+
(le) => /* @__PURE__ */ a(Qi, { textValue: le.label, "data-testid": `${E}-option-${le.key}`, children: le.label }, le.key),
|
|
10764
10766
|
[E]
|
|
10765
|
-
),
|
|
10766
|
-
q(null), M(
|
|
10767
|
+
), je = !te && D !== null && Ge.some((le) => le.key === D) ? D : null, ie = (le) => {
|
|
10768
|
+
q(null), M(le), T(z(le));
|
|
10767
10769
|
}, $e = () => {
|
|
10768
10770
|
if (Y.trim() === "") {
|
|
10769
|
-
k ?
|
|
10771
|
+
k ? ie(null) : (T(U), q(null));
|
|
10770
10772
|
return;
|
|
10771
10773
|
}
|
|
10772
|
-
te && (oe === null ? q("invalid") : ma(oe, d) ?
|
|
10773
|
-
},
|
|
10774
|
-
|
|
10775
|
-
|
|
10776
|
-
}),
|
|
10777
|
-
},
|
|
10774
|
+
te && (oe === null ? q("invalid") : ma(oe, d) ? ie(oe) : q("min"));
|
|
10775
|
+
}, Be = ge(!1), Se = (le) => {
|
|
10776
|
+
le !== null && (Be.current = !0, queueMicrotask(() => {
|
|
10777
|
+
Be.current = !1;
|
|
10778
|
+
}), ie(String(le)));
|
|
10779
|
+
}, rt = D !== null && !ma(D, d), We = ne ?? (rt ? "min" : null), pe = We !== null || x;
|
|
10778
10780
|
return /* @__PURE__ */ a(
|
|
10779
10781
|
Zi,
|
|
10780
10782
|
{
|
|
10781
10783
|
label: r,
|
|
10782
10784
|
"aria-label": i,
|
|
10783
|
-
labelPlacement:
|
|
10785
|
+
labelPlacement: w,
|
|
10784
10786
|
placeholder: s,
|
|
10785
10787
|
size: S,
|
|
10786
10788
|
variant: F,
|
|
@@ -10788,31 +10790,31 @@ function dp({
|
|
|
10788
10790
|
"data-testid": E,
|
|
10789
10791
|
allowsCustomValue: !0,
|
|
10790
10792
|
isClearable: k,
|
|
10791
|
-
onClear: k ? () =>
|
|
10793
|
+
onClear: k ? () => ie(null) : void 0,
|
|
10792
10794
|
clearButtonProps: k && $ ? { "aria-label": $ } : void 0,
|
|
10793
10795
|
isRequired: g,
|
|
10794
10796
|
isDisabled: v,
|
|
10795
|
-
isInvalid:
|
|
10796
|
-
errorMessage:
|
|
10797
|
+
isInvalid: pe,
|
|
10798
|
+
errorMessage: pe ? We === "invalid" ? l : We === "min" ? u ?? l : y : void 0,
|
|
10797
10799
|
validationBehavior: "aria",
|
|
10798
10800
|
items: Ge,
|
|
10799
10801
|
inputValue: Y,
|
|
10800
|
-
onInputChange: (
|
|
10801
|
-
T(
|
|
10802
|
+
onInputChange: (le) => {
|
|
10803
|
+
T(le), Z(!1), ne && q(null);
|
|
10802
10804
|
},
|
|
10803
|
-
selectedKey:
|
|
10804
|
-
onSelectionChange:
|
|
10805
|
-
onOpenChange: (
|
|
10806
|
-
onBlur: (
|
|
10807
|
-
$e(), C?.(
|
|
10805
|
+
selectedKey: je,
|
|
10806
|
+
onSelectionChange: Se,
|
|
10807
|
+
onOpenChange: (le, N) => Z(le && (N === "focus" || N === "manual")),
|
|
10808
|
+
onBlur: (le) => {
|
|
10809
|
+
$e(), C?.(le);
|
|
10808
10810
|
},
|
|
10809
|
-
onKeyDown: (
|
|
10810
|
-
|
|
10811
|
+
onKeyDown: (le) => {
|
|
10812
|
+
le.key === "Enter" && !Be.current && $e(), (le.key === "ArrowDown" || le.key === "ArrowUp") && Z(!0), "continuePropagation" in le && le.continuePropagation();
|
|
10811
10813
|
},
|
|
10812
10814
|
inputProps: A,
|
|
10813
10815
|
popoverProps: P,
|
|
10814
10816
|
listboxProps: { emptyContent: o },
|
|
10815
|
-
children:
|
|
10817
|
+
children: Ue
|
|
10816
10818
|
}
|
|
10817
10819
|
);
|
|
10818
10820
|
}
|
|
@@ -11021,15 +11023,15 @@ const xp = ({
|
|
|
11021
11023
|
className: k,
|
|
11022
11024
|
"data-testid": $ = "entity-row"
|
|
11023
11025
|
}) => {
|
|
11024
|
-
const C = St(Al), S = or(), F = g ?? (S === "touch" ? "lg" : "md"),
|
|
11026
|
+
const C = St(Al), S = or(), F = g ?? (S === "touch" ? "lg" : "md"), w = $l[F], _ = mp[v], A = y ?? (C ? "li" : "div"), P = Ye(), E = Ye(), D = Ye(), M = Ye(), z = s !== void 0 || i !== void 0, U = r !== void 0 && r.length > 0, Y = se(t), T = f !== void 0 && f.length > 0, ne = typeof e == "string" ? e : void 0, q = T && f.some((V) => se(V.description)), J = T ? f.filter((V) => V.isDisabled === !0 && se(V.description)).map((V) => `${V.label}: ${V.description}`).join(" ") : "", Z = n ? /* @__PURE__ */ a(
|
|
11025
11027
|
yo,
|
|
11026
11028
|
{
|
|
11027
11029
|
"aria-hidden": "true",
|
|
11028
|
-
size:
|
|
11030
|
+
size: w.avatar,
|
|
11029
11031
|
radius: n.shape === "square" ? "lg" : "full",
|
|
11030
11032
|
src: n.src,
|
|
11031
11033
|
icon: n.icon,
|
|
11032
|
-
name: n.icon !== void 0 ? void 0 : n.initials ?? n.name ??
|
|
11034
|
+
name: n.icon !== void 0 ? void 0 : n.initials ?? n.name ?? ne,
|
|
11033
11035
|
getInitials: n.initials !== void 0 ? (V) => V : gp,
|
|
11034
11036
|
showFallback: n.src !== void 0,
|
|
11035
11037
|
classNames: { base: He.avatar },
|
|
@@ -11039,8 +11041,8 @@ const xp = ({
|
|
|
11039
11041
|
Z,
|
|
11040
11042
|
/* @__PURE__ */ c("span", { className: He.text, children: [
|
|
11041
11043
|
/* @__PURE__ */ c("span", { className: He.titleLine, children: [
|
|
11042
|
-
/* @__PURE__ */ a("span", { id: P, className: m(He.title,
|
|
11043
|
-
|
|
11044
|
+
/* @__PURE__ */ a("span", { id: P, className: m(He.title, w.title), title: ne, children: e }),
|
|
11045
|
+
U && /* @__PURE__ */ a("span", { id: E, className: He.tags, children: r.map((V) => /* @__PURE__ */ a(
|
|
11044
11046
|
ht,
|
|
11045
11047
|
{
|
|
11046
11048
|
size: "sm",
|
|
@@ -11053,16 +11055,16 @@ const xp = ({
|
|
|
11053
11055
|
V.key
|
|
11054
11056
|
)) })
|
|
11055
11057
|
] }),
|
|
11056
|
-
Y && /* @__PURE__ */ a("span", { id: D, className: m(He.subtitle,
|
|
11058
|
+
Y && /* @__PURE__ */ a("span", { id: D, className: m(He.subtitle, w.subtitle), children: t })
|
|
11057
11059
|
] })
|
|
11058
|
-
] }),
|
|
11060
|
+
] }), re = [U ? E : null, Y ? D : null].filter(Boolean).join(" "), te = {
|
|
11059
11061
|
"aria-labelledby": P,
|
|
11060
|
-
"aria-describedby":
|
|
11062
|
+
"aria-describedby": re === "" ? void 0 : re,
|
|
11061
11063
|
isDisabled: x,
|
|
11062
|
-
className: m(He.pressTarget, _.overlay,
|
|
11064
|
+
className: m(He.pressTarget, _.overlay, w.content)
|
|
11063
11065
|
}, oe = `${$}-trigger`;
|
|
11064
|
-
let
|
|
11065
|
-
return s !== void 0 ?
|
|
11066
|
+
let j;
|
|
11067
|
+
return s !== void 0 ? j = /* @__PURE__ */ a(
|
|
11066
11068
|
vo,
|
|
11067
11069
|
{
|
|
11068
11070
|
...te,
|
|
@@ -11074,7 +11076,7 @@ const xp = ({
|
|
|
11074
11076
|
onPress: i,
|
|
11075
11077
|
children: me
|
|
11076
11078
|
}
|
|
11077
|
-
) : i !== void 0 ?
|
|
11079
|
+
) : i !== void 0 ? j = /* @__PURE__ */ a(
|
|
11078
11080
|
I,
|
|
11079
11081
|
{
|
|
11080
11082
|
...te,
|
|
@@ -11088,7 +11090,7 @@ const xp = ({
|
|
|
11088
11090
|
onPress: i,
|
|
11089
11091
|
children: me
|
|
11090
11092
|
}
|
|
11091
|
-
) :
|
|
11093
|
+
) : j = /* @__PURE__ */ a("div", { className: m(He.content, w.content), children: me }), /* @__PURE__ */ c(
|
|
11092
11094
|
A,
|
|
11093
11095
|
{
|
|
11094
11096
|
"data-testid": $,
|
|
@@ -11097,20 +11099,20 @@ const xp = ({
|
|
|
11097
11099
|
className: m(
|
|
11098
11100
|
He.base,
|
|
11099
11101
|
_.row,
|
|
11100
|
-
|
|
11102
|
+
w.row,
|
|
11101
11103
|
z && !x && _.hover,
|
|
11102
11104
|
k
|
|
11103
11105
|
),
|
|
11104
11106
|
children: [
|
|
11105
|
-
|
|
11106
|
-
(
|
|
11107
|
+
j,
|
|
11108
|
+
(se(d) || T) && /* @__PURE__ */ c("div", { className: He.side, children: [
|
|
11107
11109
|
d,
|
|
11108
11110
|
T && /* @__PURE__ */ c(ta, { placement: "bottom-end", children: [
|
|
11109
11111
|
/* @__PURE__ */ a(aa, { children: /* @__PURE__ */ a(
|
|
11110
11112
|
I,
|
|
11111
11113
|
{
|
|
11112
11114
|
isIconOnly: !0,
|
|
11113
|
-
size:
|
|
11115
|
+
size: w.control,
|
|
11114
11116
|
variant: "light",
|
|
11115
11117
|
color: "default",
|
|
11116
11118
|
radius: "full",
|
|
@@ -11134,7 +11136,7 @@ const xp = ({
|
|
|
11134
11136
|
},
|
|
11135
11137
|
items: f,
|
|
11136
11138
|
children: (V) => {
|
|
11137
|
-
const ee = V.isDisabled === !0 &&
|
|
11139
|
+
const ee = V.isDisabled === !0 && se(V.description);
|
|
11138
11140
|
return /* @__PURE__ */ a(
|
|
11139
11141
|
Ut,
|
|
11140
11142
|
{
|
|
@@ -11148,7 +11150,7 @@ const xp = ({
|
|
|
11148
11150
|
),
|
|
11149
11151
|
classNames: {
|
|
11150
11152
|
title: ee ? He.menuItemDimmed : void 0,
|
|
11151
|
-
description: m(He.menuItemDescription,
|
|
11153
|
+
description: m(He.menuItemDescription, w.subtitle)
|
|
11152
11154
|
},
|
|
11153
11155
|
startContent: ee && V.icon !== void 0 ? /* @__PURE__ */ a("span", { className: He.menuItemDimmedIcon, children: V.icon }) : V.icon,
|
|
11154
11156
|
"data-testid": V["data-testid"] ?? `${$}-menu-${V.key}`,
|
|
@@ -11315,20 +11317,20 @@ const un = "shadow-[0_1px_4px_rgba(0,0,0,.06),0_4px_12px_rgba(0,0,0,.06)]", wt =
|
|
|
11315
11317
|
classNames: C = {},
|
|
11316
11318
|
"data-testid": S = "list-panel"
|
|
11317
11319
|
}) => {
|
|
11318
|
-
const F = k === "framed",
|
|
11320
|
+
const F = k === "framed", w = { base: m("border-0 bg-transparent py-12", C.state) }, _ = F ? {
|
|
11319
11321
|
base: m("px-6 py-[3.625rem]", C.state),
|
|
11320
11322
|
iconWrapper: "mb-[1.125rem] size-[4.75rem] rounded-[1.25rem] border-0 bg-default-100 text-default-400",
|
|
11321
11323
|
icon: "size-[2.875rem]",
|
|
11322
11324
|
title: "text-[1.0625rem] font-semibold text-default-900",
|
|
11323
11325
|
description: "mt-1.5 max-w-[26.25rem] text-[0.875rem] leading-[1.55] text-default-500",
|
|
11324
11326
|
actions: "mt-[1.375rem] gap-2.5"
|
|
11325
|
-
} :
|
|
11327
|
+
} : w;
|
|
11326
11328
|
let A;
|
|
11327
11329
|
return e ? A = i ?? /* @__PURE__ */ a(
|
|
11328
11330
|
cl,
|
|
11329
11331
|
{
|
|
11330
11332
|
title: r,
|
|
11331
|
-
classNames:
|
|
11333
|
+
classNames: w,
|
|
11332
11334
|
"data-testid": `${S}-loading`
|
|
11333
11335
|
}
|
|
11334
11336
|
) : t ? A = h ?? /* @__PURE__ */ a(
|
|
@@ -11336,7 +11338,7 @@ const un = "shadow-[0_1px_4px_rgba(0,0,0,.06),0_4px_12px_rgba(0,0,0,.06)]", wt =
|
|
|
11336
11338
|
{
|
|
11337
11339
|
title: s,
|
|
11338
11340
|
description: o,
|
|
11339
|
-
classNames:
|
|
11341
|
+
classNames: w,
|
|
11340
11342
|
"data-testid": `${S}-error`,
|
|
11341
11343
|
actions: u ?? (d ? /* @__PURE__ */ a(I, { color: "primary", variant: "flat", onPress: d, children: l }) : void 0)
|
|
11342
11344
|
}
|
|
@@ -11398,7 +11400,7 @@ const wr = (e, t) => t <= 0 ? /^\d*$/.test(e) : new RegExp(`^\\d*(?:[.,]\\d{0,${
|
|
|
11398
11400
|
const n = ge(null), r = ge(t);
|
|
11399
11401
|
return Wt(() => {
|
|
11400
11402
|
r.current = t;
|
|
11401
|
-
}, [t]),
|
|
11403
|
+
}, [t]), Ve(() => {
|
|
11402
11404
|
const i = n.current;
|
|
11403
11405
|
if (!i) return;
|
|
11404
11406
|
const s = (l) => {
|
|
@@ -11423,11 +11425,11 @@ const wr = (e, t) => t <= 0 ? /^\d*$/.test(e) : new RegExp(`^\\d*(?:[.,]\\d{0,${
|
|
|
11423
11425
|
quickAmountsLabel: "Quick cash amounts",
|
|
11424
11426
|
quickAmountAriaTemplate: "Add {amount}"
|
|
11425
11427
|
}, Lp = 7, _p = (e) => [...new Set((e ?? []).filter((t) => Number.isFinite(t) && t > 0))].sort((t, n) => t - n).slice(0, Lp), Fp = (e, t, n) => {
|
|
11426
|
-
if (!Number.isInteger(e)) return
|
|
11428
|
+
if (!Number.isInteger(e)) return Ne(e, t, n);
|
|
11427
11429
|
try {
|
|
11428
11430
|
return new Intl.NumberFormat(t, { style: "currency", currency: n, minimumFractionDigits: 0 }).format(e);
|
|
11429
11431
|
} catch {
|
|
11430
|
-
return
|
|
11432
|
+
return Ne(e, t, n);
|
|
11431
11433
|
}
|
|
11432
11434
|
}, Rp = (e, t) => (e ?? 0) === (t ?? 0), fa = (e, t) => Object.entries(t).reduce((n, [r, i]) => n.replace(`{${r}}`, i), e), Ag = ({
|
|
11433
11435
|
dueAmount: e,
|
|
@@ -11448,22 +11450,22 @@ const wr = (e, t) => t <= 0 ? /^\d*$/.test(e) : new RegExp(`^\\d*(?:[.,]\\d{0,${
|
|
|
11448
11450
|
draft: $,
|
|
11449
11451
|
setDraft: C,
|
|
11450
11452
|
normalize: S
|
|
11451
|
-
} = Dl(k, (
|
|
11452
|
-
const
|
|
11453
|
+
} = Dl(k, (j) => j == null ? "" : String(j)), { isUntouched: F, markEdited: w, markUntouched: _ } = El(k, Rp), A = ue(() => {
|
|
11454
|
+
const j = typeof k == "number" && Number.isFinite(k) ? k : 0, V = Yr(j, e.value, e.currency, i);
|
|
11453
11455
|
return {
|
|
11454
|
-
received:
|
|
11456
|
+
received: j,
|
|
11455
11457
|
change: V > 0 ? V : 0,
|
|
11456
|
-
isValid:
|
|
11458
|
+
isValid: j >= e.value && j > 0
|
|
11457
11459
|
};
|
|
11458
|
-
}, [k, e.value, e.currency, i]), P = X((
|
|
11459
|
-
const V =
|
|
11460
|
+
}, [k, e.value, e.currency, i]), P = X((j) => {
|
|
11461
|
+
const V = j.currentTarget;
|
|
11460
11462
|
requestAnimationFrame(() => {
|
|
11461
11463
|
V.isConnected && V.select();
|
|
11462
11464
|
});
|
|
11463
11465
|
}, []), E = X(
|
|
11464
|
-
(
|
|
11465
|
-
v || y(
|
|
11466
|
-
const V = typeof
|
|
11466
|
+
(j) => {
|
|
11467
|
+
v || y(j);
|
|
11468
|
+
const V = typeof j == "number" && Number.isFinite(j) ? j : 0, ee = Yr(V, e.value, e.currency, i);
|
|
11467
11469
|
r?.({
|
|
11468
11470
|
received: V,
|
|
11469
11471
|
change: ee > 0 ? ee : 0,
|
|
@@ -11472,28 +11474,28 @@ const wr = (e, t) => t <= 0 ? /^\d*$/.test(e) : new RegExp(`^\\d*(?:[.,]\\d{0,${
|
|
|
11472
11474
|
},
|
|
11473
11475
|
[v, e.value, e.currency, i, r]
|
|
11474
11476
|
), D = X(
|
|
11475
|
-
(
|
|
11477
|
+
(j) => {
|
|
11476
11478
|
if (o) return;
|
|
11477
|
-
const V =
|
|
11479
|
+
const V = j.replace(/[^\d.,]/g, "");
|
|
11478
11480
|
if (!wr(V, g)) return;
|
|
11479
11481
|
const ee = wa(V);
|
|
11480
|
-
ee !== null && l !== void 0 && ee > l || (C(V),
|
|
11482
|
+
ee !== null && l !== void 0 && ee > l || (C(V), w(ee), E(ee));
|
|
11481
11483
|
},
|
|
11482
|
-
[o, l, C,
|
|
11483
|
-
), M = Ll(F, D), z = ue(() => _p(d), [d]),
|
|
11484
|
-
o ||
|
|
11485
|
-
}, T = (
|
|
11484
|
+
[o, l, C, w, g, E]
|
|
11485
|
+
), M = Ll(F, D), z = ue(() => _p(d), [d]), U = (j) => l !== void 0 && j > l, Y = () => {
|
|
11486
|
+
o || U(e.value) || (C(String(e.value)), _(), E(e.value));
|
|
11487
|
+
}, T = (j) => {
|
|
11486
11488
|
if (o) return;
|
|
11487
|
-
const V = F() || typeof k != "number" || !Number.isFinite(k) ? 0 : k, ee = Is(V +
|
|
11488
|
-
|
|
11489
|
-
},
|
|
11490
|
-
|
|
11489
|
+
const V = F() || typeof k != "number" || !Number.isFinite(k) ? 0 : k, ee = Is(V + j, e.currency, i);
|
|
11490
|
+
U(ee) || (C(String(ee)), w(ee), E(ee));
|
|
11491
|
+
}, ne = A.isValid && A.change > 0, q = !A.isValid && A.received > 0, J = Ne(A.change, i, e.currency), Z = Ne(e.value, i, e.currency), [me, re] = K(""), te = ge(null);
|
|
11492
|
+
Ve(() => {
|
|
11491
11493
|
te.current && clearTimeout(te.current);
|
|
11492
|
-
const
|
|
11493
|
-
return te.current = setTimeout(() =>
|
|
11494
|
+
const j = ne ? fa(p.changeMessageTemplate, { change: J }) : "", V = ne ? Dp : 0;
|
|
11495
|
+
return te.current = setTimeout(() => re(j), V), () => {
|
|
11494
11496
|
te.current && clearTimeout(te.current);
|
|
11495
11497
|
};
|
|
11496
|
-
}, [
|
|
11498
|
+
}, [ne, J, p.changeMessageTemplate]);
|
|
11497
11499
|
const oe = `${b}-received`;
|
|
11498
11500
|
return /* @__PURE__ */ c("div", { className: m("flex flex-col gap-3", f), "data-testid": b, children: [
|
|
11499
11501
|
/* @__PURE__ */ a(
|
|
@@ -11507,7 +11509,7 @@ const wr = (e, t) => t <= 0 ? /^\d*$/.test(e) : new RegExp(`^\\d*(?:[.,]\\d{0,${
|
|
|
11507
11509
|
inputMode: g === 0 ? "numeric" : "decimal",
|
|
11508
11510
|
pattern: g === 0 ? "[0-9]*" : "[0-9]*[.,]?[0-9]*",
|
|
11509
11511
|
value: $,
|
|
11510
|
-
onChange: (
|
|
11512
|
+
onChange: (j) => D(j.target.value),
|
|
11511
11513
|
onFocus: P,
|
|
11512
11514
|
onBlur: S,
|
|
11513
11515
|
placeholder: p.receivedPlaceholder,
|
|
@@ -11546,8 +11548,8 @@ const wr = (e, t) => t <= 0 ? /^\d*$/.test(e) : new RegExp(`^\\d*(?:[.,]\\d{0,${
|
|
|
11546
11548
|
]
|
|
11547
11549
|
}
|
|
11548
11550
|
),
|
|
11549
|
-
z.map((
|
|
11550
|
-
const V = Fp(
|
|
11551
|
+
z.map((j) => {
|
|
11552
|
+
const V = Fp(j, i, e.currency);
|
|
11551
11553
|
return /* @__PURE__ */ a(
|
|
11552
11554
|
I,
|
|
11553
11555
|
{
|
|
@@ -11559,17 +11561,17 @@ const wr = (e, t) => t <= 0 ? /^\d*$/.test(e) : new RegExp(`^\\d*(?:[.,]\\d{0,${
|
|
|
11559
11561
|
"aria-label": fa(p.quickAmountAriaTemplate, {
|
|
11560
11562
|
amount: V
|
|
11561
11563
|
}),
|
|
11562
|
-
onPress: () => T(
|
|
11563
|
-
"data-testid": `${b}-quick-amount-${
|
|
11564
|
+
onPress: () => T(j),
|
|
11565
|
+
"data-testid": `${b}-quick-amount-${j}`,
|
|
11564
11566
|
children: V
|
|
11565
11567
|
},
|
|
11566
|
-
|
|
11568
|
+
j
|
|
11567
11569
|
);
|
|
11568
11570
|
})
|
|
11569
11571
|
]
|
|
11570
11572
|
}
|
|
11571
11573
|
) }),
|
|
11572
|
-
|
|
11574
|
+
ne && // Composed from the DS `<Alert>` primitive (HeroUI under
|
|
11573
11575
|
// `@components`). `aria-live="off"` keeps the visible
|
|
11574
11576
|
// alert SILENT for screen readers — its `description`
|
|
11575
11577
|
// changes on every keystroke and a default `role="alert"`
|
|
@@ -11669,7 +11671,7 @@ const wr = (e, t) => t <= 0 ? /^\d*$/.test(e) : new RegExp(`^\\d*(?:[.,]\\d{0,${
|
|
|
11669
11671
|
[$, C, l]
|
|
11670
11672
|
), F = X(() => {
|
|
11671
11673
|
l || k(!0);
|
|
11672
|
-
}, [l]),
|
|
11674
|
+
}, [l]), w = y && $.checkNumber.trim() === "", _ = `${b}-check-number`, A = `${b}-bank-name`, P = `${b}-date`;
|
|
11673
11675
|
return /* @__PURE__ */ c("div", { className: m("grid grid-cols-1 sm:grid-cols-2 gap-4", f), "data-testid": b, children: [
|
|
11674
11676
|
/* @__PURE__ */ a(
|
|
11675
11677
|
ze,
|
|
@@ -11684,8 +11686,8 @@ const wr = (e, t) => t <= 0 ? /^\d*$/.test(e) : new RegExp(`^\\d*(?:[.,]\\d{0,${
|
|
|
11684
11686
|
placeholder: p.checkNumberPlaceholder,
|
|
11685
11687
|
maxLength: d,
|
|
11686
11688
|
isRequired: !0,
|
|
11687
|
-
isInvalid:
|
|
11688
|
-
errorMessage:
|
|
11689
|
+
isInvalid: w,
|
|
11690
|
+
errorMessage: w ? p.checkNumberRequiredMessage : void 0,
|
|
11689
11691
|
isDisabled: l,
|
|
11690
11692
|
variant: "bordered",
|
|
11691
11693
|
radius: "lg",
|
|
@@ -11774,7 +11776,7 @@ const Op = {
|
|
|
11774
11776
|
), x = X(
|
|
11775
11777
|
(S) => {
|
|
11776
11778
|
f || p(S);
|
|
11777
|
-
const F = v(S.method),
|
|
11779
|
+
const F = v(S.method), w = {
|
|
11778
11780
|
amount: e.value,
|
|
11779
11781
|
method: S.method,
|
|
11780
11782
|
description: F,
|
|
@@ -11786,7 +11788,7 @@ const Op = {
|
|
|
11786
11788
|
// pre-rendered with no amount.
|
|
11787
11789
|
isValid: S.method !== ""
|
|
11788
11790
|
};
|
|
11789
|
-
i?.(
|
|
11791
|
+
i?.(w);
|
|
11790
11792
|
},
|
|
11791
11793
|
[f, e.value, i, v]
|
|
11792
11794
|
), y = X(
|
|
@@ -11912,7 +11914,7 @@ const Bp = {
|
|
|
11912
11914
|
{
|
|
11913
11915
|
className: "text-base font-semibold tracking-tight",
|
|
11914
11916
|
"data-testid": `${d}-remaining-amount`,
|
|
11915
|
-
children:
|
|
11917
|
+
children: Ne(b ? h : f, r, e.currency)
|
|
11916
11918
|
}
|
|
11917
11919
|
)
|
|
11918
11920
|
]
|
|
@@ -11929,7 +11931,7 @@ const Bp = {
|
|
|
11929
11931
|
{
|
|
11930
11932
|
className: "mt-1 text-4xl font-bold tracking-tight",
|
|
11931
11933
|
"data-testid": `${d}-remaining-amount`,
|
|
11932
|
-
children:
|
|
11934
|
+
children: Ne(b ? h : f, r, e.currency)
|
|
11933
11935
|
}
|
|
11934
11936
|
)
|
|
11935
11937
|
]
|
|
@@ -12002,7 +12004,7 @@ const Hp = ({
|
|
|
12002
12004
|
}
|
|
12003
12005
|
),
|
|
12004
12006
|
/* @__PURE__ */ a("span", { className: "flex-1 truncate", "data-testid": `${u}-label`, children: t.label }),
|
|
12005
|
-
/* @__PURE__ */ a("span", { className: "font-semibold tabular-nums", "data-testid": `${u}-amount`, children:
|
|
12007
|
+
/* @__PURE__ */ a("span", { className: "font-semibold tabular-nums", "data-testid": `${u}-amount`, children: Ne(t.amount, n, r) }),
|
|
12006
12008
|
/* @__PURE__ */ a(
|
|
12007
12009
|
ht,
|
|
12008
12010
|
{
|
|
@@ -12411,17 +12413,17 @@ function nh({
|
|
|
12411
12413
|
const _ = u.current, A = h.current;
|
|
12412
12414
|
if (!_ || !A) return;
|
|
12413
12415
|
const P = () => {
|
|
12414
|
-
const D = Array.from(A.children), M = D.slice(0, e.length).map((q) => q.getBoundingClientRect().width), z = D[e.length]?.getBoundingClientRect().width ?? 0,
|
|
12416
|
+
const D = Array.from(A.children), M = D.slice(0, e.length).map((q) => q.getBoundingClientRect().width), z = D[e.length]?.getBoundingClientRect().width ?? 0, U = window.getComputedStyle(_), Y = Number.parseFloat(U.columnGap) || 0, T = _.clientWidth - (Number.parseFloat(U.paddingLeft) || 0) - (Number.parseFloat(U.paddingRight) || 0);
|
|
12415
12417
|
if (T <= 0 || M.some((q) => q === 0)) {
|
|
12416
12418
|
v(f.length);
|
|
12417
12419
|
return;
|
|
12418
12420
|
}
|
|
12419
|
-
const
|
|
12421
|
+
const ne = (q) => {
|
|
12420
12422
|
const J = b || q < f.length, Z = q + (J ? 1 : 0);
|
|
12421
|
-
return p(q).reduce((
|
|
12423
|
+
return p(q).reduce((re, te) => re + (M[te] ?? 0), 0) + (J ? z : 0) + Y * (Z - 1) <= T;
|
|
12422
12424
|
};
|
|
12423
12425
|
for (let q = f.length; q >= 1; q -= 1)
|
|
12424
|
-
if (
|
|
12426
|
+
if (ne(q)) {
|
|
12425
12427
|
v(q);
|
|
12426
12428
|
return;
|
|
12427
12429
|
}
|
|
@@ -12431,7 +12433,7 @@ function nh({
|
|
|
12431
12433
|
const E = new ResizeObserver(P);
|
|
12432
12434
|
return E.observe(_), () => E.disconnect();
|
|
12433
12435
|
}, [e, o, p, f, b]);
|
|
12434
|
-
const x = Math.max(1, Math.min(g, s ?? f.length, f.length)), k = !b && x === f.length - 1 && g === f.length ? f.length : x, $ = b || k < f.length, C = new Set(p(k)), S = e.filter((_, A) => C.has(A)), F = $ ? e.filter((_, A) => !C.has(A)) : [],
|
|
12436
|
+
const x = Math.max(1, Math.min(g, s ?? f.length, f.length)), k = !b && x === f.length - 1 && g === f.length ? f.length : x, $ = b || k < f.length, C = new Set(p(k)), S = e.filter((_, A) => C.has(A)), F = $ ? e.filter((_, A) => !C.has(A)) : [], w = F.find((_) => _.key === t);
|
|
12435
12437
|
return /* @__PURE__ */ c("div", { className: m("relative flex flex-col gap-3", l), "data-testid": d, children: [
|
|
12436
12438
|
r && /* @__PURE__ */ a("h3", { className: "text-sm font-medium text-default-700", id: `${d}-heading`, children: r }),
|
|
12437
12439
|
/* @__PURE__ */ c(
|
|
@@ -12463,7 +12465,7 @@ function nh({
|
|
|
12463
12465
|
{
|
|
12464
12466
|
variant: "light",
|
|
12465
12467
|
radius: "full",
|
|
12466
|
-
"aria-pressed":
|
|
12468
|
+
"aria-pressed": w !== void 0,
|
|
12467
12469
|
"data-testid": `${d}-more`,
|
|
12468
12470
|
className: m(
|
|
12469
12471
|
za,
|
|
@@ -12476,11 +12478,11 @@ function nh({
|
|
|
12476
12478
|
// label it may be wider than what was
|
|
12477
12479
|
// reserved, so there it gives way instead
|
|
12478
12480
|
// of pushing the row past the track.
|
|
12479
|
-
|
|
12480
|
-
Oi(
|
|
12481
|
+
w !== void 0 ? "min-w-0" : "min-w-fit",
|
|
12482
|
+
Oi(w !== void 0)
|
|
12481
12483
|
),
|
|
12482
12484
|
children: [
|
|
12483
|
-
/* @__PURE__ */ a("span", { className: "min-w-0 truncate", children:
|
|
12485
|
+
/* @__PURE__ */ a("span", { className: "min-w-0 truncate", children: w?.label ?? o }),
|
|
12484
12486
|
/* @__PURE__ */ a(O, { icon: "lucide:chevron-down", width: 14, height: 14, "aria-hidden": "true" })
|
|
12485
12487
|
]
|
|
12486
12488
|
}
|
|
@@ -12491,7 +12493,7 @@ function nh({
|
|
|
12491
12493
|
"aria-label": o,
|
|
12492
12494
|
className: "w-64 p-2",
|
|
12493
12495
|
selectionMode: "single",
|
|
12494
|
-
selectedKeys:
|
|
12496
|
+
selectedKeys: w ? [w.key] : [],
|
|
12495
12497
|
disabledKeys: F.filter((_) => _.isDisabled || _.isLocked).map((_) => _.key),
|
|
12496
12498
|
onAction: (_) => n(String(_)),
|
|
12497
12499
|
children: F.map((_) => /* @__PURE__ */ a(
|
|
@@ -12568,7 +12570,7 @@ const rh = {
|
|
|
12568
12570
|
{
|
|
12569
12571
|
className: m("mt-1 text-4xl font-bold tracking-tight", o.amount),
|
|
12570
12572
|
"data-testid": `${s}-amount`,
|
|
12571
|
-
children:
|
|
12573
|
+
children: Ne(e.value, n, e.currency)
|
|
12572
12574
|
}
|
|
12573
12575
|
)
|
|
12574
12576
|
]
|
|
@@ -12680,7 +12682,7 @@ const _l = ({
|
|
|
12680
12682
|
{
|
|
12681
12683
|
className: "text-2xl font-bold text-info-700",
|
|
12682
12684
|
"data-testid": `${d}-amount`,
|
|
12683
|
-
children:
|
|
12685
|
+
children: Ne(e.value, r, e.currency)
|
|
12684
12686
|
}
|
|
12685
12687
|
),
|
|
12686
12688
|
n && /* @__PURE__ */ a("span", { className: "mt-0.5 text-xs text-info-700/80", children: n })
|
|
@@ -12814,7 +12816,7 @@ const Fl = ({
|
|
|
12814
12816
|
S(A), x || k(A), i?.(A);
|
|
12815
12817
|
},
|
|
12816
12818
|
[f, i, S, x]
|
|
12817
|
-
),
|
|
12819
|
+
), w = Ll(C, F), _ = X((A) => {
|
|
12818
12820
|
const P = A.currentTarget;
|
|
12819
12821
|
requestAnimationFrame(() => {
|
|
12820
12822
|
P.isConnected && P.select();
|
|
@@ -12825,7 +12827,7 @@ const Fl = ({
|
|
|
12825
12827
|
/* @__PURE__ */ a(
|
|
12826
12828
|
ze,
|
|
12827
12829
|
{
|
|
12828
|
-
ref:
|
|
12830
|
+
ref: w,
|
|
12829
12831
|
id: v,
|
|
12830
12832
|
label: t,
|
|
12831
12833
|
labelPlacement: "outside",
|
|
@@ -12983,27 +12985,27 @@ const zt = {
|
|
|
12983
12985
|
"data-testid": p = "inline-confirm"
|
|
12984
12986
|
}) => {
|
|
12985
12987
|
const g = Ye(), v = Ye(), x = ge(null), y = ge(null), k = ge(null), $ = t != null, C = ge({ isPending: l, containEscape: u, onCancel: s });
|
|
12986
|
-
C.current = { isPending: l, containEscape: u, onCancel: s },
|
|
12988
|
+
C.current = { isPending: l, containEscape: u, onCancel: s }, Ve(() => {
|
|
12987
12989
|
(d === "confirm" ? y : k).current?.focus();
|
|
12988
|
-
}, []),
|
|
12989
|
-
const
|
|
12990
|
-
if (
|
|
12990
|
+
}, []), Ve(() => {
|
|
12991
|
+
const w = x.current;
|
|
12992
|
+
if (w === null) return;
|
|
12991
12993
|
const _ = (A) => {
|
|
12992
12994
|
A.key === "Escape" && (C.current.containEscape && A.stopPropagation(), !C.current.isPending && C.current.onCancel());
|
|
12993
12995
|
};
|
|
12994
|
-
return
|
|
12996
|
+
return w.addEventListener("keydown", _), () => w.removeEventListener("keydown", _);
|
|
12995
12997
|
}, []);
|
|
12996
12998
|
const S = ge(!1);
|
|
12997
12999
|
Wt(() => {
|
|
12998
|
-
const
|
|
12999
|
-
if (
|
|
13000
|
+
const w = x.current;
|
|
13001
|
+
if (w === null) return;
|
|
13000
13002
|
const _ = document.activeElement;
|
|
13001
13003
|
if (l) {
|
|
13002
|
-
const A = _ === null || _ === document.body || !
|
|
13003
|
-
S.current && (A || P) &&
|
|
13004
|
+
const A = _ === null || _ === document.body || !w.contains(_), P = _ instanceof HTMLButtonElement && _.disabled;
|
|
13005
|
+
S.current && (A || P) && w.focus({ preventScroll: !0 });
|
|
13004
13006
|
return;
|
|
13005
13007
|
}
|
|
13006
|
-
_ ===
|
|
13008
|
+
_ === w && (d === "confirm" ? y : k).current?.focus();
|
|
13007
13009
|
}, [l, d]);
|
|
13008
13010
|
const F = /* @__PURE__ */ a(
|
|
13009
13011
|
_e,
|
|
@@ -13020,9 +13022,9 @@ const zt = {
|
|
|
13020
13022
|
onFocus: () => {
|
|
13021
13023
|
S.current = !0;
|
|
13022
13024
|
},
|
|
13023
|
-
onBlur: (
|
|
13024
|
-
const _ =
|
|
13025
|
-
S.current = _ instanceof Node &&
|
|
13025
|
+
onBlur: (w) => {
|
|
13026
|
+
const _ = w.relatedTarget;
|
|
13027
|
+
S.current = _ instanceof Node && w.currentTarget.contains(_);
|
|
13026
13028
|
},
|
|
13027
13029
|
className: m(zt.box, uh[o], f === "div" && b),
|
|
13028
13030
|
"data-testid": p,
|
|
@@ -13075,9 +13077,9 @@ const fh = {
|
|
|
13075
13077
|
}, mn = $a(fh), Nr = $a(null);
|
|
13076
13078
|
function Dg(e) {
|
|
13077
13079
|
const { report: t, unreport: n } = St(mn), r = St(Nr), i = Ye();
|
|
13078
|
-
|
|
13080
|
+
Ve(() => {
|
|
13079
13081
|
t(i, { scope: r, isDirty: e });
|
|
13080
|
-
}, [t, i, r, e]),
|
|
13082
|
+
}, [t, i, r, e]), Ve(() => () => n(i), [n, i]);
|
|
13081
13083
|
}
|
|
13082
13084
|
function Eg() {
|
|
13083
13085
|
const { guardScope: e, bypass: t } = St(mn);
|
|
@@ -13372,7 +13374,7 @@ const Ah = 60, Dh = (e, t, n = Ah) => t ? e > n : e < -n, Pl = (e, t) => Math.ma
|
|
|
13372
13374
|
onDragEnd: (t, n) => {
|
|
13373
13375
|
Dh(n?.offset?.y ?? 0, e.open) && e.onToggleOpen?.(), e.setDragHeight(null);
|
|
13374
13376
|
}
|
|
13375
|
-
}), jt = (e, t) =>
|
|
13377
|
+
}), jt = (e, t) => Ne(e.value, t, e.currency), Bi = `opacity-60 transition-opacity ${Le}`, Cr = ({
|
|
13376
13378
|
item: e,
|
|
13377
13379
|
locale: t,
|
|
13378
13380
|
onRemove: n,
|
|
@@ -13389,7 +13391,7 @@ const Ah = 60, Dh = (e, t, n = Ah) => t ? e > n : e < -n, Pl = (e, t) => Math.ma
|
|
|
13389
13391
|
s ? "flex flex-col gap-1 py-3 first:pt-0" : "flex flex-col gap-2",
|
|
13390
13392
|
e.tone && "-mx-2 rounded-lg px-2 py-1.5"
|
|
13391
13393
|
),
|
|
13392
|
-
style: e.tone ? { backgroundColor:
|
|
13394
|
+
style: e.tone ? { backgroundColor: dt[e.tone].bg } : void 0,
|
|
13393
13395
|
children: [
|
|
13394
13396
|
/* @__PURE__ */ c(
|
|
13395
13397
|
"div",
|
|
@@ -13453,7 +13455,7 @@ const Ah = 60, Dh = (e, t, n = Ah) => t ? e > n : e < -n, Pl = (e, t) => Math.ma
|
|
|
13453
13455
|
]
|
|
13454
13456
|
}
|
|
13455
13457
|
),
|
|
13456
|
-
|
|
13458
|
+
se(e.trailing) && /* @__PURE__ */ a("div", { "data-testid": `summary-item-trailing-${e.id}`, className: "flex justify-end", children: e.trailing }),
|
|
13457
13459
|
e.dateLabel && /* @__PURE__ */ c(
|
|
13458
13460
|
"div",
|
|
13459
13461
|
{
|
|
@@ -13936,7 +13938,7 @@ const Ul = ({
|
|
|
13936
13938
|
Ul.displayName = "SummaryActionBar";
|
|
13937
13939
|
const Ph = "(max-width: 767px)", Oh = (e) => typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia(e).matches : !1, zh = (e = Ph) => {
|
|
13938
13940
|
const [t, n] = K(() => Oh(e));
|
|
13939
|
-
return
|
|
13941
|
+
return Ve(() => {
|
|
13940
13942
|
if (typeof window > "u" || typeof window.matchMedia != "function") return;
|
|
13941
13943
|
const r = window.matchMedia(e), i = () => n(r.matches);
|
|
13942
13944
|
return i(), r.addEventListener("change", i), () => r.removeEventListener("change", i);
|
|
@@ -13965,7 +13967,7 @@ const Ph = "(max-width: 767px)", Oh = (e) => typeof window < "u" && typeof windo
|
|
|
13965
13967
|
ctaCaption: C,
|
|
13966
13968
|
ctaError: S,
|
|
13967
13969
|
variant: F,
|
|
13968
|
-
cart:
|
|
13970
|
+
cart: w,
|
|
13969
13971
|
emptyState: _,
|
|
13970
13972
|
labels: A,
|
|
13971
13973
|
classNames: P = {},
|
|
@@ -13973,19 +13975,19 @@ const Ph = "(max-width: 767px)", Oh = (e) => typeof window < "u" && typeof windo
|
|
|
13973
13975
|
"data-testid": D = "summary",
|
|
13974
13976
|
className: M
|
|
13975
13977
|
}) => {
|
|
13976
|
-
const z = A?.removeAriaLabel ?? "Remove item",
|
|
13978
|
+
const z = A?.removeAriaLabel ?? "Remove item", U = A?.removeTotalRowAriaLabel ?? "Remove discount", Y = A?.removePostTotalRowAriaLabel ?? "Remove applied code", T = A?.toggleAriaLabel ?? "Toggle summary", ne = A?.cartAriaLabel ?? "View cart", q = E === "compact", J = zh(), me = b ?? (F ?? (J ? "mobile" : "main")) === "mobile", [re, te] = K(v), oe = p !== void 0, j = !me || (oe ? p : re), V = X(() => {
|
|
13977
13979
|
oe || te((B) => !B), g?.();
|
|
13978
|
-
}, [oe, g]), [ee, Ge] = K(0), [
|
|
13979
|
-
const B =
|
|
13980
|
+
}, [oe, g]), [ee, Ge] = K(0), [Ue, je] = K(null), ie = ge(null), $e = ge(null), Be = X(() => {
|
|
13981
|
+
const B = ie.current;
|
|
13980
13982
|
B && Ge(Lh(B.scrollHeight, window.innerHeight));
|
|
13981
|
-
}, []),
|
|
13983
|
+
}, []), Se = X(
|
|
13982
13984
|
(B) => {
|
|
13983
|
-
$e.current?.disconnect(), $e.current = null,
|
|
13985
|
+
$e.current?.disconnect(), $e.current = null, ie.current = B, B && (Be(), typeof ResizeObserver < "u" && ($e.current = new ResizeObserver(Be), $e.current.observe(B)));
|
|
13984
13986
|
},
|
|
13985
|
-
[
|
|
13987
|
+
[Be]
|
|
13986
13988
|
);
|
|
13987
|
-
|
|
13988
|
-
const
|
|
13989
|
+
Ve(() => (window.addEventListener("resize", Be), () => window.removeEventListener("resize", Be)), [Be]);
|
|
13990
|
+
const rt = Mh({ open: j, fullHeight: ee, setDragHeight: je, onToggleOpen: V }), We = Ue !== null, pe = Fh(Ue, j, ee), xe = ee > 0 ? Math.min(1, Math.max(0, pe / ee)) : j ? 1 : 0, le = /* @__PURE__ */ a(Tl, { total: l, locale: r, compact: q, className: P.total }), N = d && d.length > 0 && /* @__PURE__ */ a("div", { "data-testid": "summary-post-total-rows", className: "flex flex-col gap-4", children: d.map((B) => /* @__PURE__ */ a(
|
|
13989
13991
|
$r,
|
|
13990
13992
|
{
|
|
13991
13993
|
row: B,
|
|
@@ -14024,7 +14026,7 @@ const Ph = "(max-width: 767px)", Oh = (e) => typeof window < "u" && typeof windo
|
|
|
14024
14026
|
onRemoveItem: k,
|
|
14025
14027
|
removeAriaLabel: z,
|
|
14026
14028
|
onRemoveTotalRow: u,
|
|
14027
|
-
removeTotalRowAriaLabel:
|
|
14029
|
+
removeTotalRowAriaLabel: U,
|
|
14028
14030
|
showRemoveButton: $,
|
|
14029
14031
|
emptyState: _,
|
|
14030
14032
|
compact: q,
|
|
@@ -14039,8 +14041,8 @@ const Ph = "(max-width: 767px)", Oh = (e) => typeof window < "u" && typeof windo
|
|
|
14039
14041
|
dragConstraints: { top: 0, bottom: 0 },
|
|
14040
14042
|
dragElastic: 0.12,
|
|
14041
14043
|
dragSnapToOrigin: !0,
|
|
14042
|
-
onDrag:
|
|
14043
|
-
onDragEnd:
|
|
14044
|
+
onDrag: rt.onDrag,
|
|
14045
|
+
onDragEnd: rt.onDragEnd,
|
|
14044
14046
|
className: m(
|
|
14045
14047
|
// max-h-full + the reveal's min-h-0 keep the header and the
|
|
14046
14048
|
// action bar on screen no matter how tall the content: a fixed
|
|
@@ -14061,8 +14063,8 @@ const Ph = "(max-width: 767px)", Oh = (e) => typeof window < "u" && typeof windo
|
|
|
14061
14063
|
total: l,
|
|
14062
14064
|
secondaryTotal: f,
|
|
14063
14065
|
locale: r,
|
|
14064
|
-
open:
|
|
14065
|
-
progress:
|
|
14066
|
+
open: j,
|
|
14067
|
+
progress: xe,
|
|
14066
14068
|
dragging: We,
|
|
14067
14069
|
toggleAriaLabel: T,
|
|
14068
14070
|
onToggleOpen: V,
|
|
@@ -14073,8 +14075,8 @@ const Ph = "(max-width: 767px)", Oh = (e) => typeof window < "u" && typeof windo
|
|
|
14073
14075
|
"div",
|
|
14074
14076
|
{
|
|
14075
14077
|
"data-testid": "summary-reveal",
|
|
14076
|
-
"aria-hidden": !
|
|
14077
|
-
style: { height:
|
|
14078
|
+
"aria-hidden": !j,
|
|
14079
|
+
style: { height: pe },
|
|
14078
14080
|
className: m(
|
|
14079
14081
|
// min-h-0 lets the panel give way inside the max-h-dvh
|
|
14080
14082
|
// sheet (the header/action bar keep their min-content
|
|
@@ -14083,15 +14085,15 @@ const Ph = "(max-width: 767px)", Oh = (e) => typeof window < "u" && typeof windo
|
|
|
14083
14085
|
// — the sheet stays chromeless); closed or mid-drag stays
|
|
14084
14086
|
// clipped so the reveal tracks the gesture.
|
|
14085
14087
|
"min-h-0",
|
|
14086
|
-
|
|
14087
|
-
!
|
|
14088
|
+
j && !We ? "overflow-y-auto overscroll-contain [scrollbar-width:none] [&::-webkit-scrollbar]:hidden" : "overflow-hidden",
|
|
14089
|
+
!j && "pointer-events-none",
|
|
14088
14090
|
Rh(We)
|
|
14089
14091
|
),
|
|
14090
|
-
children: /* @__PURE__ */ c("div", { ref:
|
|
14092
|
+
children: /* @__PURE__ */ c("div", { ref: Se, className: q ? "flex flex-col gap-3 pb-4" : "flex flex-col gap-4 pb-4", children: [
|
|
14091
14093
|
W,
|
|
14092
14094
|
!q && /* @__PURE__ */ a(Mt, { className: "bg-default-200" }),
|
|
14093
|
-
|
|
14094
|
-
|
|
14095
|
+
le,
|
|
14096
|
+
N,
|
|
14095
14097
|
L
|
|
14096
14098
|
] })
|
|
14097
14099
|
}
|
|
@@ -14099,13 +14101,13 @@ const Ph = "(max-width: 767px)", Oh = (e) => typeof window < "u" && typeof windo
|
|
|
14099
14101
|
/* @__PURE__ */ a(
|
|
14100
14102
|
Ul,
|
|
14101
14103
|
{
|
|
14102
|
-
open:
|
|
14103
|
-
progress:
|
|
14104
|
+
open: j,
|
|
14105
|
+
progress: xe,
|
|
14104
14106
|
dragging: We,
|
|
14105
14107
|
primaryAction: x,
|
|
14106
14108
|
isLoading: y,
|
|
14107
|
-
cart:
|
|
14108
|
-
cartAriaLabel:
|
|
14109
|
+
cart: w,
|
|
14110
|
+
cartAriaLabel: ne,
|
|
14109
14111
|
ctaCaption: R,
|
|
14110
14112
|
ctaError: H,
|
|
14111
14113
|
onToggleOpen: V,
|
|
@@ -14134,8 +14136,8 @@ const Ph = "(max-width: 767px)", Oh = (e) => typeof window < "u" && typeof windo
|
|
|
14134
14136
|
) }),
|
|
14135
14137
|
W,
|
|
14136
14138
|
!q && /* @__PURE__ */ a(Mt, { className: "bg-default-200" }),
|
|
14137
|
-
|
|
14138
|
-
|
|
14139
|
+
le,
|
|
14140
|
+
N,
|
|
14139
14141
|
L,
|
|
14140
14142
|
f && x && /* @__PURE__ */ a(Mt, { className: "bg-default-200" }),
|
|
14141
14143
|
x && /* @__PURE__ */ a(en, { action: x, disabledByLoading: y, className: m("w-full", P.cta) }),
|
|
@@ -14257,13 +14259,13 @@ const Vh = {
|
|
|
14257
14259
|
partialBadge: "Partial refund",
|
|
14258
14260
|
owesBadge: "Customer owes",
|
|
14259
14261
|
ofSeparator: "of"
|
|
14260
|
-
}, Uh = { backgroundColor:
|
|
14261
|
-
warn: { backgroundColor:
|
|
14262
|
-
ok: { backgroundColor:
|
|
14262
|
+
}, Uh = { backgroundColor: he.destructive, color: "#fff" }, jh = {
|
|
14263
|
+
warn: { backgroundColor: he["warn-fill"], color: he.warn },
|
|
14264
|
+
ok: { backgroundColor: he["ok-fill"], color: he.ok },
|
|
14263
14265
|
neutral: {
|
|
14264
14266
|
backgroundColor: "hsl(var(--heroui-default-100))",
|
|
14265
14267
|
color: "hsl(var(--heroui-default-600))",
|
|
14266
|
-
border: `1px solid ${
|
|
14268
|
+
border: `1px solid ${he.line}`
|
|
14267
14269
|
}
|
|
14268
14270
|
}, Mn = "inline-flex h-[22px] items-center gap-[5px] whitespace-nowrap rounded-full px-[9px] text-xs font-medium leading-none", Pn = "absolute top-0 h-5 w-5 opacity-0", Wh = ({
|
|
14269
14271
|
onClose: e,
|
|
@@ -14357,7 +14359,7 @@ const Vh = {
|
|
|
14357
14359
|
"data-testid": `${b}-total`,
|
|
14358
14360
|
children: [
|
|
14359
14361
|
/* @__PURE__ */ a("span", { children: o.label }),
|
|
14360
|
-
o.amount && /* @__PURE__ */ a("span", { className: "tabular-nums text-default-900", children:
|
|
14362
|
+
o.amount && /* @__PURE__ */ a("span", { className: "tabular-nums text-default-900", children: Ne(o.amount.value, void 0, o.amount.currency) }),
|
|
14361
14363
|
o.of && /* @__PURE__ */ c(de, { children: [
|
|
14362
14364
|
/* @__PURE__ */ a("span", { children: g.ofSeparator }),
|
|
14363
14365
|
/* @__PURE__ */ a(
|
|
@@ -14365,7 +14367,7 @@ const Vh = {
|
|
|
14365
14367
|
{
|
|
14366
14368
|
className: "tabular-nums text-default-900",
|
|
14367
14369
|
"data-testid": `${b}-total-of`,
|
|
14368
|
-
children:
|
|
14370
|
+
children: Ne(o.of.value, void 0, o.of.currency)
|
|
14369
14371
|
}
|
|
14370
14372
|
)
|
|
14371
14373
|
] }),
|
|
@@ -14519,10 +14521,10 @@ const Gh = {
|
|
|
14519
14521
|
amountOnlyDetail: "Not tied to an item · up to {amount} remaining",
|
|
14520
14522
|
amountOnlyRemove: "Remove amount refund"
|
|
14521
14523
|
}, Kh = "inline-flex h-[22px] shrink-0 items-center gap-[5px] whitespace-nowrap rounded-full border border-pos-line bg-default-100 px-[9px] text-xs font-medium leading-none text-default-600", Vi = "flex h-11 flex-1 items-center justify-center bg-white text-lg text-default-900 outline-none transition-colors hover:bg-default-100 disabled:opacity-50 focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary", On = "absolute h-5 w-5 opacity-0", Zh = (e) => {
|
|
14522
|
-
const t =
|
|
14524
|
+
const t = Ne(e.paidAmount.value, void 0, e.paidAmount.currency);
|
|
14523
14525
|
if (e.quantity <= 1) return t;
|
|
14524
14526
|
const n = qh(e.paidAmount, e.quantity);
|
|
14525
|
-
return `${e.quantity} × ${
|
|
14527
|
+
return `${e.quantity} × ${Ne(n.value, void 0, n.currency)} · ${t}`;
|
|
14526
14528
|
}, Qh = ({
|
|
14527
14529
|
items: e,
|
|
14528
14530
|
selections: t,
|
|
@@ -14541,12 +14543,12 @@ const Gh = {
|
|
|
14541
14543
|
];
|
|
14542
14544
|
return /* @__PURE__ */ c("div", { className: m("flex flex-col text-default-900", l), "data-testid": d, children: [
|
|
14543
14545
|
e.map((f) => {
|
|
14544
|
-
const b = t[f.id], p = f.state === "already_refunded" || f.state === "non_refundable", g = `${d}-row-${f.id}`, v = Math.max(1, Math.trunc(f.quantity)), x = b?.quantity, y = b?.selected ? Math.min(x ?? v, v) : x ?? 0, k = Kn(f.paidAmount, v, y).value, $ = b?.amount ?? (b?.selected ? k : 0), C = y === 0 && $ > 4e-3, S = (
|
|
14545
|
-
selected:
|
|
14546
|
+
const b = t[f.id], p = f.state === "already_refunded" || f.state === "non_refundable", g = `${d}-row-${f.id}`, v = Math.max(1, Math.trunc(f.quantity)), x = b?.quantity, y = b?.selected ? Math.min(x ?? v, v) : x ?? 0, k = Kn(f.paidAmount, v, y).value, $ = b?.amount ?? (b?.selected ? k : 0), C = y === 0 && $ > 4e-3, S = (w) => n(f.id, {
|
|
14547
|
+
selected: w.quantity > 0 || w.amount > 4e-3,
|
|
14546
14548
|
mode: "full",
|
|
14547
|
-
...
|
|
14548
|
-
}), F = (
|
|
14549
|
-
const _ = Math.min(Math.max(
|
|
14549
|
+
...w
|
|
14550
|
+
}), F = (w) => {
|
|
14551
|
+
const _ = Math.min(Math.max(w, 0), v);
|
|
14550
14552
|
S({ quantity: _, amount: Kn(f.paidAmount, v, _).value });
|
|
14551
14553
|
};
|
|
14552
14554
|
return /* @__PURE__ */ c(
|
|
@@ -14586,13 +14588,13 @@ const Gh = {
|
|
|
14586
14588
|
className: "flex w-full flex-wrap items-center gap-2.5 sm:w-auto sm:flex-nowrap",
|
|
14587
14589
|
"data-testid": `${g}-partial`,
|
|
14588
14590
|
children: [
|
|
14589
|
-
p ? /* @__PURE__ */ a("span", { className: "text-sm font-semibold tabular-nums", children:
|
|
14591
|
+
p ? /* @__PURE__ */ a("span", { className: "text-sm font-semibold tabular-nums", children: Ne(f.paidAmount.value, void 0, f.paidAmount.currency) }) : /* @__PURE__ */ a(
|
|
14590
14592
|
Zn,
|
|
14591
14593
|
{
|
|
14592
14594
|
value: $,
|
|
14593
14595
|
expected: k,
|
|
14594
14596
|
max: f.paidAmount.value,
|
|
14595
|
-
onChange: (
|
|
14597
|
+
onChange: (w) => S({ quantity: y, amount: w }),
|
|
14596
14598
|
ariaLabel: u.amount.replace("{name}", f.name),
|
|
14597
14599
|
className: "w-[120px]",
|
|
14598
14600
|
"data-testid": `${g}-amount`,
|
|
@@ -14679,13 +14681,13 @@ const Gh = {
|
|
|
14679
14681
|
selectedKeys: [
|
|
14680
14682
|
f.restock.disposition ?? (f.restock.on ? "stock" : "norestock")
|
|
14681
14683
|
],
|
|
14682
|
-
onSelectionChange: (
|
|
14683
|
-
if (
|
|
14684
|
-
const _ = [...
|
|
14684
|
+
onSelectionChange: (w) => {
|
|
14685
|
+
if (w === "all") return;
|
|
14686
|
+
const _ = [...w][0];
|
|
14685
14687
|
_ && (i?.(f.id, _), r(f.id, _ === "stock"));
|
|
14686
14688
|
},
|
|
14687
14689
|
"data-testid": `${g}-restock`,
|
|
14688
|
-
children: h.map((
|
|
14690
|
+
children: h.map((w) => /* @__PURE__ */ a($t, { children: w.label }, w.key))
|
|
14689
14691
|
}
|
|
14690
14692
|
)
|
|
14691
14693
|
] })
|
|
@@ -14696,7 +14698,7 @@ const Gh = {
|
|
|
14696
14698
|
{
|
|
14697
14699
|
className: m(On, "right-0 top-0 m-0 p-0"),
|
|
14698
14700
|
isSelected: !!b?.selected,
|
|
14699
|
-
onValueChange: (
|
|
14701
|
+
onValueChange: (w) => n(f.id, { selected: w, mode: "full" }),
|
|
14700
14702
|
"aria-label": f.name,
|
|
14701
14703
|
"data-testid": `${g}-checkbox`
|
|
14702
14704
|
}
|
|
@@ -14753,7 +14755,7 @@ const Gh = {
|
|
|
14753
14755
|
/* @__PURE__ */ a("p", { className: "text-sm font-semibold", children: u.amountOnlyTitle }),
|
|
14754
14756
|
/* @__PURE__ */ a("p", { className: "text-[12.5px] text-default-500", children: u.amountOnlyDetail.replace(
|
|
14755
14757
|
"{amount}",
|
|
14756
|
-
|
|
14758
|
+
Ne(s.max.value, void 0, s.max.currency)
|
|
14757
14759
|
) })
|
|
14758
14760
|
] }),
|
|
14759
14761
|
/* @__PURE__ */ c("div", { className: "flex w-full flex-wrap items-center gap-2.5 sm:w-[290px] sm:flex-nowrap", children: [
|
|
@@ -14788,7 +14790,7 @@ const Gh = {
|
|
|
14788
14790
|
] });
|
|
14789
14791
|
};
|
|
14790
14792
|
Qh.displayName = "LineItemList";
|
|
14791
|
-
const Xh = { color:
|
|
14793
|
+
const Xh = { color: he.danger }, Wl = ({
|
|
14792
14794
|
children: e,
|
|
14793
14795
|
className: t,
|
|
14794
14796
|
"data-testid": n = "meta-card"
|
|
@@ -15070,7 +15072,7 @@ function Yl({
|
|
|
15070
15072
|
className: d,
|
|
15071
15073
|
"data-testid": u = "notice"
|
|
15072
15074
|
}) {
|
|
15073
|
-
const h = nn(), f = lb[t], b = ob[e], p = t === "banner", g =
|
|
15075
|
+
const h = nn(), f = lb[t], b = ob[e], p = t === "banner", g = se(n), v = se(r), x = g ? p ? /* @__PURE__ */ a("p", { "data-testid": `${u}-title`, className: m(f.title, b.title), children: n }) : /* @__PURE__ */ a("span", { "data-testid": `${u}-title`, className: f.title, children: n }) : null, y = v ? p ? /* @__PURE__ */ a("p", { "data-testid": `${u}-description`, className: m(f.description, g && "mt-0.5"), children: r }) : /* @__PURE__ */ a("span", { "data-testid": `${u}-description`, className: f.description, children: r }) : null;
|
|
15074
15076
|
return /* @__PURE__ */ c(
|
|
15075
15077
|
"div",
|
|
15076
15078
|
{
|
|
@@ -15242,7 +15244,7 @@ const cb = {
|
|
|
15242
15244
|
),
|
|
15243
15245
|
/* @__PURE__ */ c("span", { className: "min-w-0", children: [
|
|
15244
15246
|
/* @__PURE__ */ a("span", { className: "block text-sm font-semibold", children: h.label }),
|
|
15245
|
-
/* @__PURE__ */ a("span", { className: "block text-xs text-default-500", children:
|
|
15247
|
+
/* @__PURE__ */ a("span", { className: "block text-xs text-default-500", children: Ne(h.maxRefundable.value, void 0, h.maxRefundable.currency) })
|
|
15246
15248
|
] })
|
|
15247
15249
|
]
|
|
15248
15250
|
},
|
|
@@ -15303,13 +15305,13 @@ const fb = (e) => e.refunded !== null, pb = {
|
|
|
15303
15305
|
className: f,
|
|
15304
15306
|
"data-testid": b = "split-tender-panel"
|
|
15305
15307
|
}) => {
|
|
15306
|
-
const p = { ...pb, ...h }, g = e.filter(fb), v = e.find((
|
|
15308
|
+
const p = { ...pb, ...h }, g = e.filter(fb), v = e.find((w) => w.tenderId === r.tenderId)?.label, x = !!(i?.length && r.onTenderChange), y = Sa(n.currency), {
|
|
15307
15309
|
draft: k,
|
|
15308
15310
|
setDraft: $,
|
|
15309
15311
|
normalize: C
|
|
15310
15312
|
} = Dl(r.amount, String), S = X(
|
|
15311
|
-
(
|
|
15312
|
-
wr(
|
|
15313
|
+
(w) => {
|
|
15314
|
+
wr(w, y) && ($(w), r.onAmountChange(wa(w) ?? 0));
|
|
15313
15315
|
},
|
|
15314
15316
|
[r, $, y]
|
|
15315
15317
|
), F = o?.kind === "processor_declined";
|
|
@@ -15334,20 +15336,20 @@ const fb = (e) => e.refunded !== null, pb = {
|
|
|
15334
15336
|
/* @__PURE__ */ c("div", { "data-testid": `${b}-totals`, children: [
|
|
15335
15337
|
/* @__PURE__ */ c("div", { className: "mb-4 flex items-center justify-between gap-2.5 rounded-xl bg-default-100 px-4 py-3.5", children: [
|
|
15336
15338
|
/* @__PURE__ */ a("span", { className: "text-[13px] font-semibold text-default-500", children: p.remaining }),
|
|
15337
|
-
/* @__PURE__ */ a("span", { className: "text-[22px] font-semibold tabular-nums", children:
|
|
15339
|
+
/* @__PURE__ */ a("span", { className: "text-[22px] font-semibold tabular-nums", children: Ne(n.value, void 0, n.currency) }),
|
|
15338
15340
|
/* @__PURE__ */ c("span", { className: "sr-only", children: [
|
|
15339
15341
|
p.refundedSoFar,
|
|
15340
15342
|
": ",
|
|
15341
|
-
|
|
15343
|
+
Ne(t.value, void 0, t.currency)
|
|
15342
15344
|
] })
|
|
15343
15345
|
] }),
|
|
15344
15346
|
g.length > 0 && /* @__PURE__ */ c("div", { children: [
|
|
15345
15347
|
/* @__PURE__ */ a("p", { className: hb, children: p.refundedSoFar }),
|
|
15346
|
-
g.map((
|
|
15348
|
+
g.map((w, _) => /* @__PURE__ */ c(
|
|
15347
15349
|
"div",
|
|
15348
15350
|
{
|
|
15349
15351
|
className: "mb-2 flex items-center gap-2.5 rounded-xl border border-pos-line px-3 py-2.5",
|
|
15350
|
-
"data-testid": `${b}-part-${
|
|
15352
|
+
"data-testid": `${b}-part-${w.tenderId}-done`,
|
|
15351
15353
|
children: [
|
|
15352
15354
|
/* @__PURE__ */ c("span", { className: "w-[22px] shrink-0 font-bold text-default-600", children: [
|
|
15353
15355
|
"#",
|
|
@@ -15356,30 +15358,30 @@ const fb = (e) => e.refunded !== null, pb = {
|
|
|
15356
15358
|
/* @__PURE__ */ a("span", { className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-[9px] bg-default-100 text-default-600", children: /* @__PURE__ */ a(
|
|
15357
15359
|
O,
|
|
15358
15360
|
{
|
|
15359
|
-
icon:
|
|
15361
|
+
icon: w.icon ?? "lucide:credit-card",
|
|
15360
15362
|
width: 15,
|
|
15361
15363
|
height: 15,
|
|
15362
15364
|
"aria-hidden": "true"
|
|
15363
15365
|
}
|
|
15364
15366
|
) }),
|
|
15365
15367
|
/* @__PURE__ */ c("span", { className: "min-w-0 flex-1", children: [
|
|
15366
|
-
/* @__PURE__ */ a("span", { className: "block text-[13.5px] font-semibold", children:
|
|
15367
|
-
|
|
15368
|
+
/* @__PURE__ */ a("span", { className: "block text-[13.5px] font-semibold", children: w.label }),
|
|
15369
|
+
w.feeNote && /* @__PURE__ */ a("span", { className: "block text-[11.5px] text-default-500", children: w.feeNote })
|
|
15368
15370
|
] }),
|
|
15369
|
-
/* @__PURE__ */ a("span", { className: "font-semibold tabular-nums", children:
|
|
15371
|
+
/* @__PURE__ */ a("span", { className: "font-semibold tabular-nums", children: Ne(w.refunded.value, void 0, w.refunded.currency) }),
|
|
15370
15372
|
/* @__PURE__ */ a(
|
|
15371
15373
|
"span",
|
|
15372
15374
|
{
|
|
15373
15375
|
className: m(
|
|
15374
15376
|
bb,
|
|
15375
|
-
|
|
15377
|
+
w.status === "pending" ? "bg-pos-warn-fill text-pos-warn" : "bg-pos-ok-fill text-pos-ok"
|
|
15376
15378
|
),
|
|
15377
|
-
children:
|
|
15379
|
+
children: w.status === "pending" ? p.pending : p.succeeded
|
|
15378
15380
|
}
|
|
15379
15381
|
)
|
|
15380
15382
|
]
|
|
15381
15383
|
},
|
|
15382
|
-
|
|
15384
|
+
w.tenderId
|
|
15383
15385
|
))
|
|
15384
15386
|
] })
|
|
15385
15387
|
] }),
|
|
@@ -15413,15 +15415,15 @@ const fb = (e) => e.refunded !== null, pb = {
|
|
|
15413
15415
|
"data-testid": `${b}-amount`
|
|
15414
15416
|
}
|
|
15415
15417
|
),
|
|
15416
|
-
x && /* @__PURE__ */ a("div", { className: "mt-2.5 flex gap-2", "data-testid": `${b}-methods`, children: i?.map((
|
|
15417
|
-
const _ =
|
|
15418
|
+
x && /* @__PURE__ */ a("div", { className: "mt-2.5 flex gap-2", "data-testid": `${b}-methods`, children: i?.map((w) => {
|
|
15419
|
+
const _ = w.tenderId === r.tenderId;
|
|
15418
15420
|
return /* @__PURE__ */ c(
|
|
15419
15421
|
"button",
|
|
15420
15422
|
{
|
|
15421
15423
|
type: "button",
|
|
15422
15424
|
"aria-pressed": _,
|
|
15423
|
-
disabled:
|
|
15424
|
-
onClick: () => r.onTenderChange?.(
|
|
15425
|
+
disabled: w.disabled || d,
|
|
15426
|
+
onClick: () => r.onTenderChange?.(w.tenderId),
|
|
15425
15427
|
className: m(
|
|
15426
15428
|
"flex h-11 flex-1 items-center justify-center gap-2 rounded-xl border-[1.5px] bg-white",
|
|
15427
15429
|
"text-[13px] font-semibold outline-none transition-colors",
|
|
@@ -15429,13 +15431,13 @@ const fb = (e) => e.refunded !== null, pb = {
|
|
|
15429
15431
|
"focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",
|
|
15430
15432
|
_ ? "border-primary bg-primary/5 text-primary" : "border-pos-line text-default-600"
|
|
15431
15433
|
),
|
|
15432
|
-
"data-testid": `${b}-method-${
|
|
15434
|
+
"data-testid": `${b}-method-${w.tenderId}`,
|
|
15433
15435
|
children: [
|
|
15434
|
-
|
|
15435
|
-
|
|
15436
|
+
w.icon && /* @__PURE__ */ a(O, { icon: w.icon, width: 15, height: 15, "aria-hidden": "true" }),
|
|
15437
|
+
w.label
|
|
15436
15438
|
]
|
|
15437
15439
|
},
|
|
15438
|
-
|
|
15440
|
+
w.tenderId
|
|
15439
15441
|
);
|
|
15440
15442
|
}) })
|
|
15441
15443
|
] }),
|
|
@@ -15500,16 +15502,16 @@ const Gl = "hsl(var(--heroui-primary))", xb = "hsl(var(--heroui-primary) / 0.05)
|
|
|
15500
15502
|
anotherOpen: "aria-expanded:scale-100",
|
|
15501
15503
|
menuItem: "py-2"
|
|
15502
15504
|
}, yb = {
|
|
15503
|
-
idle: { borderColor:
|
|
15505
|
+
idle: { borderColor: he.line, backgroundColor: "#fff" },
|
|
15504
15506
|
selected: { borderColor: Gl, backgroundColor: xb },
|
|
15505
|
-
declined: { borderColor:
|
|
15507
|
+
declined: { borderColor: he.danger, backgroundColor: he["danger-fill"] }
|
|
15506
15508
|
}, tn = {
|
|
15507
15509
|
idle: { backgroundColor: Kl, color: Zl },
|
|
15508
15510
|
selected: { backgroundColor: Gl, color: "#fff" }
|
|
15509
|
-
}, vb = { backgroundColor: Kl, color: Zl }, wb = { borderColor:
|
|
15510
|
-
declined: { color:
|
|
15511
|
-
pending: { color:
|
|
15512
|
-
done: { color:
|
|
15511
|
+
}, vb = { backgroundColor: Kl, color: Zl }, wb = { borderColor: he.line }, ji = {
|
|
15512
|
+
declined: { color: he.danger },
|
|
15513
|
+
pending: { color: he.warn, backgroundColor: he["warn-fill"] },
|
|
15514
|
+
done: { color: he.ok, backgroundColor: he["ok-fill"] }
|
|
15513
15515
|
}, Nb = {
|
|
15514
15516
|
heading: "Money back to",
|
|
15515
15517
|
upTo: "Up to {amount}",
|
|
@@ -15541,14 +15543,14 @@ const Gl = "hsl(var(--heroui-primary))", xb = "hsl(var(--heroui-primary) / 0.05)
|
|
|
15541
15543
|
const u = e.status ?? "idle", h = u === "pending" || u === "done", f = n || h, b = !!(e.removable && l), p = e.cap?.currency ?? t, g = Sa(p), v = `${d}-amount`, x = r.amountFor.replace("{method}", e.label), y = X(
|
|
15542
15544
|
(F) => {
|
|
15543
15545
|
if (!wr(F, g)) return;
|
|
15544
|
-
const
|
|
15545
|
-
e.cap &&
|
|
15546
|
+
const w = wa(F);
|
|
15547
|
+
e.cap && w !== null && w > e.cap.value || s(e.id, F);
|
|
15546
15548
|
},
|
|
15547
15549
|
[g, e.cap, e.id, s]
|
|
15548
15550
|
), k = X((F) => {
|
|
15549
|
-
const
|
|
15551
|
+
const w = F.currentTarget;
|
|
15550
15552
|
requestAnimationFrame(() => {
|
|
15551
|
-
|
|
15553
|
+
w.isConnected && w.select();
|
|
15552
15554
|
});
|
|
15553
15555
|
}, []), $ = u === "declined" ? "declined" : e.selected ? "selected" : "idle", C = e.statusLabel ?? (u === "idle" ? void 0 : r[u]), S = /* @__PURE__ */ c("span", { className: be.toggleHeader, children: [
|
|
15554
15556
|
/* @__PURE__ */ a(
|
|
@@ -15639,7 +15641,7 @@ const Gl = "hsl(var(--heroui-primary))", xb = "hsl(var(--heroui-primary) / 0.05)
|
|
|
15639
15641
|
S,
|
|
15640
15642
|
/* @__PURE__ */ a("span", { className: be.lowerSlot, style: vb, "data-testid": `${d}-cap`, children: e.cap ? r.upTo.replace(
|
|
15641
15643
|
"{amount}",
|
|
15642
|
-
|
|
15644
|
+
Ne(e.cap.value, void 0, e.cap.currency)
|
|
15643
15645
|
) : r.noCap })
|
|
15644
15646
|
]
|
|
15645
15647
|
}
|
|
@@ -15787,15 +15789,15 @@ const at = {
|
|
|
15787
15789
|
promptText: "min-w-0 flex-1 text-[13px] font-medium",
|
|
15788
15790
|
action: "h-11 min-w-0 rounded-[12px] px-4 text-[14px] font-semibold"
|
|
15789
15791
|
}, Ql = "hsl(var(--heroui-primary))", Sb = {
|
|
15790
|
-
idle: { borderColor:
|
|
15792
|
+
idle: { borderColor: he.line, backgroundColor: "#fff" },
|
|
15791
15793
|
active: { borderColor: Ql, backgroundColor: "hsl(var(--heroui-primary) / 0.05)" },
|
|
15792
|
-
failed: { borderColor:
|
|
15794
|
+
failed: { borderColor: he.danger, backgroundColor: he["danger-fill"] }
|
|
15793
15795
|
}, Wi = {
|
|
15794
15796
|
idle: { backgroundColor: "hsl(var(--heroui-default-100))", color: "hsl(var(--heroui-default-600))" },
|
|
15795
15797
|
active: { backgroundColor: Ql, color: "#fff" }
|
|
15796
|
-
}, Ab = { backgroundColor: "#fff", color:
|
|
15797
|
-
color:
|
|
15798
|
-
backgroundColor:
|
|
15798
|
+
}, Ab = { backgroundColor: "#fff", color: he.neutral }, Qt = (e) => ({
|
|
15799
|
+
color: dt[e].fg,
|
|
15800
|
+
backgroundColor: dt[e].bg
|
|
15799
15801
|
}), Db = {
|
|
15800
15802
|
queued: Qt("neutral"),
|
|
15801
15803
|
processing: Qt("info"),
|
|
@@ -15864,7 +15866,7 @@ const at = {
|
|
|
15864
15866
|
/* @__PURE__ */ a("span", { className: at.label, children: l.label }),
|
|
15865
15867
|
l.note && /* @__PURE__ */ a("span", { className: at.note, children: l.note })
|
|
15866
15868
|
] }),
|
|
15867
|
-
/* @__PURE__ */ a("span", { className: at.amount, children:
|
|
15869
|
+
/* @__PURE__ */ a("span", { className: at.amount, children: Ne(l.amount.value, void 0, l.amount.currency) }),
|
|
15868
15870
|
/* @__PURE__ */ c(
|
|
15869
15871
|
"span",
|
|
15870
15872
|
{
|
|
@@ -16062,7 +16064,7 @@ const Pb = {
|
|
|
16062
16064
|
className: y,
|
|
16063
16065
|
"data-testid": k = "outcome-view"
|
|
16064
16066
|
}) => {
|
|
16065
|
-
const $ = { ...Pb, ...Ob[t], ...x }, C = Ye(), S = n ?
|
|
16067
|
+
const $ = { ...Pb, ...Ob[t], ...x }, C = Ye(), S = n ? Ne(n.value, void 0, n.currency) : null;
|
|
16066
16068
|
return e === "processing" ? /* @__PURE__ */ a(
|
|
16067
16069
|
"div",
|
|
16068
16070
|
{
|
|
@@ -16100,7 +16102,7 @@ const Pb = {
|
|
|
16100
16102
|
d ? /* @__PURE__ */ c(de, { children: [
|
|
16101
16103
|
/* @__PURE__ */ a("p", { className: Fe.changeTitle, "data-testid": `${k}-title`, children: $.title }),
|
|
16102
16104
|
/* @__PURE__ */ a("p", { className: Fe.changeLabel, children: $.changeDue }),
|
|
16103
|
-
/* @__PURE__ */ a("p", { className: Fe.changeAmount, "data-testid": `${k}-change`, children:
|
|
16105
|
+
/* @__PURE__ */ a("p", { className: Fe.changeAmount, "data-testid": `${k}-change`, children: Ne(d.amount.value, void 0, d.amount.currency) }),
|
|
16104
16106
|
d.caption && /* @__PURE__ */ a("p", { className: Fe.changeCaption, "data-testid": `${k}-change-caption`, children: d.caption })
|
|
16105
16107
|
] }) : /* @__PURE__ */ c(de, { children: [
|
|
16106
16108
|
/* @__PURE__ */ a("p", { className: "text-[1.375rem] font-semibold", "data-testid": `${k}-title`, children: $.title }),
|
|
@@ -16118,44 +16120,44 @@ const Pb = {
|
|
|
16118
16120
|
] }),
|
|
16119
16121
|
o && o.length > 0 && /* @__PURE__ */ c("div", { className: "mt-5 text-left", "data-testid": `${k}-paid-with`, children: [
|
|
16120
16122
|
/* @__PURE__ */ a("p", { className: pa, children: $.paidWithTitle }),
|
|
16121
|
-
o.map((F,
|
|
16123
|
+
o.map((F, w) => /* @__PURE__ */ c(
|
|
16122
16124
|
"div",
|
|
16123
16125
|
{
|
|
16124
16126
|
className: Fe.paidRow,
|
|
16125
|
-
"data-testid": `${k}-paid-with-${
|
|
16127
|
+
"data-testid": `${k}-paid-with-${w}`,
|
|
16126
16128
|
children: [
|
|
16127
16129
|
F.icon && /* @__PURE__ */ a("span", { className: Fe.paidIcon, "aria-hidden": "true", children: /* @__PURE__ */ a("span", { className: "flex h-4 w-4", children: /* @__PURE__ */ a(O, { icon: F.icon, width: "100%", height: "100%" }) }) }),
|
|
16128
16130
|
/* @__PURE__ */ a("span", { className: Fe.paidLabel, children: F.label }),
|
|
16129
|
-
/* @__PURE__ */ a("span", { className: Fe.paidAmount, children:
|
|
16131
|
+
/* @__PURE__ */ a("span", { className: Fe.paidAmount, children: Ne(F.amount.value, void 0, F.amount.currency) }),
|
|
16130
16132
|
F.status && /* @__PURE__ */ a("span", { className: Fe.paidStatus, children: F.status })
|
|
16131
16133
|
]
|
|
16132
16134
|
},
|
|
16133
|
-
`${F.label}-${
|
|
16135
|
+
`${F.label}-${w}`
|
|
16134
16136
|
))
|
|
16135
16137
|
] }),
|
|
16136
16138
|
l && l.length > 0 && /* @__PURE__ */ c("div", { className: "mt-5 text-left", "data-testid": `${k}-outcome`, children: [
|
|
16137
16139
|
/* @__PURE__ */ a("p", { className: pa, children: $.outcomeTitle }),
|
|
16138
|
-
/* @__PURE__ */ a("div", { className: Fe.groups, children: l.map((F,
|
|
16140
|
+
/* @__PURE__ */ a("div", { className: Fe.groups, children: l.map((F, w) => /* @__PURE__ */ c("div", { "data-testid": `${k}-outcome-${w}`, children: [
|
|
16139
16141
|
/* @__PURE__ */ a("p", { className: Fe.groupLabel, children: F.label }),
|
|
16140
16142
|
/* @__PURE__ */ a("ul", { className: Fe.groupItems, "aria-label": F.label, children: F.items.map((_, A) => /* @__PURE__ */ a("li", { className: Fe.groupItem, children: _ }, `${_}-${A}`)) })
|
|
16141
|
-
] }, `${F.label}-${
|
|
16143
|
+
] }, `${F.label}-${w}`)) })
|
|
16142
16144
|
] }),
|
|
16143
16145
|
r && /* @__PURE__ */ c("div", { className: "mt-5 text-left", children: [
|
|
16144
16146
|
/* @__PURE__ */ a("p", { className: pa, children: $.destinationsTitle }),
|
|
16145
|
-
r.map((F,
|
|
16147
|
+
r.map((F, w) => /* @__PURE__ */ c(
|
|
16146
16148
|
"div",
|
|
16147
16149
|
{
|
|
16148
16150
|
className: "flex items-center justify-between gap-2.5 border-b border-pos-line-2 py-[0.6875rem] text-sm last:border-b-0",
|
|
16149
|
-
"data-testid": `${k}-destination-${
|
|
16151
|
+
"data-testid": `${k}-destination-${w}-${F.status}`,
|
|
16150
16152
|
children: [
|
|
16151
16153
|
/* @__PURE__ */ a("span", { className: "font-semibold", children: F.label }),
|
|
16152
16154
|
/* @__PURE__ */ c("div", { className: "flex items-center gap-2.5", children: [
|
|
16153
|
-
/* @__PURE__ */ a("span", { className: "tabular-nums text-pos-neutral", children:
|
|
16155
|
+
/* @__PURE__ */ a("span", { className: "tabular-nums text-pos-neutral", children: Ne(F.amount.value, void 0, F.amount.currency) }),
|
|
16154
16156
|
/* @__PURE__ */ a("span", { className: m(Tb, zb[F.status]), children: F.status === "succeeded" ? $.succeeded : $.pending })
|
|
16155
16157
|
] })
|
|
16156
16158
|
]
|
|
16157
16159
|
},
|
|
16158
|
-
`${F.label}-${
|
|
16160
|
+
`${F.label}-${w}`
|
|
16159
16161
|
))
|
|
16160
16162
|
] }),
|
|
16161
16163
|
b && b.length > 0 ? (
|
|
@@ -16185,18 +16187,18 @@ const Pb = {
|
|
|
16185
16187
|
) : f && /* @__PURE__ */ c("div", { className: "mt-5 text-left", children: [
|
|
16186
16188
|
/* @__PURE__ */ a("p", { className: pa, children: $.sendReceipt }),
|
|
16187
16189
|
/* @__PURE__ */ a("div", { className: "flex flex-col gap-2", children: Ib.map((F) => {
|
|
16188
|
-
const
|
|
16190
|
+
const w = h?.includes(F) ?? !1;
|
|
16189
16191
|
return /* @__PURE__ */ c(
|
|
16190
16192
|
"button",
|
|
16191
16193
|
{
|
|
16192
16194
|
type: "button",
|
|
16193
16195
|
role: "checkbox",
|
|
16194
|
-
"aria-checked":
|
|
16196
|
+
"aria-checked": w,
|
|
16195
16197
|
onClick: () => f(F),
|
|
16196
16198
|
className: `flex min-h-11 w-full items-center gap-2.5 rounded-[0.625rem] p-2 text-left text-sm outline-none transition-colors hover:bg-pos-neutral-fill focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary ${Le}`,
|
|
16197
16199
|
"data-testid": `${k}-receipt-${F}`,
|
|
16198
16200
|
children: [
|
|
16199
|
-
/* @__PURE__ */ a("span", { "aria-hidden": "true", className: "pointer-events-none flex", children: /* @__PURE__ */ a(an, { isSelected:
|
|
16201
|
+
/* @__PURE__ */ a("span", { "aria-hidden": "true", className: "pointer-events-none flex", children: /* @__PURE__ */ a(an, { isSelected: w, isReadOnly: !0, tabIndex: -1 }) }),
|
|
16200
16202
|
/* @__PURE__ */ a("span", { children: $[F] })
|
|
16201
16203
|
]
|
|
16202
16204
|
},
|
|
@@ -16438,9 +16440,9 @@ const _t = {
|
|
|
16438
16440
|
"data-testid": o = "load-more-footer"
|
|
16439
16441
|
}) => {
|
|
16440
16442
|
const l = ge(null), d = ge(t), u = ge(!1);
|
|
16441
|
-
return
|
|
16443
|
+
return Ve(() => {
|
|
16442
16444
|
d.current = t;
|
|
16443
|
-
}, [t]),
|
|
16445
|
+
}, [t]), Ve(() => {
|
|
16444
16446
|
if (e !== "idle") {
|
|
16445
16447
|
u.current = !1;
|
|
16446
16448
|
return;
|
|
@@ -16522,12 +16524,12 @@ const Oe = {
|
|
|
16522
16524
|
}, qi = ({ item: e, withActions: t }) => /* @__PURE__ */ c(de, { children: [
|
|
16523
16525
|
/* @__PURE__ */ c("span", { className: m(Oe.headline, t && Oe.headlineWithActions), children: [
|
|
16524
16526
|
/* @__PURE__ */ a("span", { className: Oe.title, children: e.title }),
|
|
16525
|
-
|
|
16527
|
+
se(e.amount) && !t && /* @__PURE__ */ a("span", { className: Oe.amount, children: e.amount })
|
|
16526
16528
|
] }),
|
|
16527
|
-
t ? (
|
|
16528
|
-
|
|
16529
|
-
|
|
16530
|
-
] }) :
|
|
16529
|
+
t ? (se(e.chips) || se(e.amount)) && /* @__PURE__ */ c("span", { className: Oe.chipsLine, children: [
|
|
16530
|
+
se(e.chips) && /* @__PURE__ */ a("span", { className: Oe.chipsInline, children: e.chips }),
|
|
16531
|
+
se(e.amount) && /* @__PURE__ */ a("span", { className: Oe.amount, children: e.amount })
|
|
16532
|
+
] }) : se(e.chips) && /* @__PURE__ */ a("span", { className: Oe.chips, children: e.chips }),
|
|
16531
16533
|
e.rows && e.rows.length > 0 && /* @__PURE__ */ a("span", { className: Oe.rows, children: e.rows.map((n, r) => /* @__PURE__ */ c("span", { className: Oe.row, children: [
|
|
16532
16534
|
/* @__PURE__ */ a("span", { className: Oe.rowLabel, children: n.label }),
|
|
16533
16535
|
/* @__PURE__ */ a("span", { className: Oe.rowValue, children: n.value })
|
|
@@ -16544,7 +16546,7 @@ const Oe = {
|
|
|
16544
16546
|
/* @__PURE__ */ a("div", { className: Ba, style: { height: kt(11), width: "70%", marginTop: kt(10) } }),
|
|
16545
16547
|
/* @__PURE__ */ a("div", { className: Ba, style: { height: kt(11), width: "45%", marginTop: kt(8) } })
|
|
16546
16548
|
] }, l)) }) }) : /* @__PURE__ */ a("ul", { "aria-label": t, className: Oe.list, children: e.map((o) => {
|
|
16547
|
-
const l =
|
|
16549
|
+
const l = se(o.actions);
|
|
16548
16550
|
return /* @__PURE__ */ c("li", { "data-testid": `${s}-item-${o.id}`, className: Oe.item, children: [
|
|
16549
16551
|
n ? /* @__PURE__ */ a(
|
|
16550
16552
|
"button",
|
|
@@ -16625,7 +16627,7 @@ const Qb = ({
|
|
|
16625
16627
|
banner: b,
|
|
16626
16628
|
"data-testid": p = "record-header"
|
|
16627
16629
|
}) => {
|
|
16628
|
-
const { ref: g, width: v } = ia(), x = !Da(v, Zb), y = e.length > 0 || !!t, k = !!(h && h.length > 0), $ = !!s ||
|
|
16630
|
+
const { ref: g, width: v } = ia(), x = !Da(v, Zb), y = e.length > 0 || !!t, k = !!(h && h.length > 0), $ = !!s || se(o) || se(l) || se(d) || se(u) || k;
|
|
16629
16631
|
return /* @__PURE__ */ c("div", { ref: g, "data-testid": p, "data-size": x ? "narrow" : "wide", className: ce.base, children: [
|
|
16630
16632
|
y && /* @__PURE__ */ c("div", { "data-testid": `${p}-band`, className: ce.band, children: [
|
|
16631
16633
|
t && /* @__PURE__ */ a(
|
|
@@ -16686,7 +16688,7 @@ const Qb = ({
|
|
|
16686
16688
|
className: m(ce.money, x ? ce.moneyNarrow : ce.moneyWide),
|
|
16687
16689
|
children: [
|
|
16688
16690
|
s && /* @__PURE__ */ a("div", { className: ce.amountLabel, children: s }),
|
|
16689
|
-
|
|
16691
|
+
se(o) && /* @__PURE__ */ a(
|
|
16690
16692
|
"div",
|
|
16691
16693
|
{
|
|
16692
16694
|
"data-testid": `${p}-amount`,
|
|
@@ -16694,9 +16696,9 @@ const Qb = ({
|
|
|
16694
16696
|
children: o
|
|
16695
16697
|
}
|
|
16696
16698
|
),
|
|
16697
|
-
|
|
16698
|
-
|
|
16699
|
-
|
|
16699
|
+
se(l) && /* @__PURE__ */ a("div", { className: ce.amountCaption, children: l }),
|
|
16700
|
+
se(d) && /* @__PURE__ */ a("div", { "data-testid": `${p}-record-id`, className: ce.recordId, children: d }),
|
|
16701
|
+
se(u) && /* @__PURE__ */ a(
|
|
16700
16702
|
"div",
|
|
16701
16703
|
{
|
|
16702
16704
|
"data-testid": `${p}-chips`,
|
|
@@ -16719,7 +16721,7 @@ const Qb = ({
|
|
|
16719
16721
|
{
|
|
16720
16722
|
"data-testid": `${p}-stat-${S}-value`,
|
|
16721
16723
|
className: ce.statValue,
|
|
16722
|
-
style: C.tone ? { color:
|
|
16724
|
+
style: C.tone ? { color: dt[C.tone].fg } : void 0,
|
|
16723
16725
|
children: C.value
|
|
16724
16726
|
}
|
|
16725
16727
|
)
|
|
@@ -16731,8 +16733,8 @@ const Qb = ({
|
|
|
16731
16733
|
}
|
|
16732
16734
|
)
|
|
16733
16735
|
] }),
|
|
16734
|
-
|
|
16735
|
-
|
|
16736
|
+
se(f) && /* @__PURE__ */ a("div", { "data-testid": `${p}-stats`, className: x ? ce.statsNarrow : ce.statsWide, children: f }),
|
|
16737
|
+
se(b) && /* @__PURE__ */ a("div", { "data-testid": `${p}-banner`, children: b })
|
|
16736
16738
|
] });
|
|
16737
16739
|
};
|
|
16738
16740
|
Qb.displayName = "RecordHeader";
|
|
@@ -16747,7 +16749,7 @@ const Xb = 50, ha = {
|
|
|
16747
16749
|
aside: t,
|
|
16748
16750
|
"data-testid": n = "record-layout"
|
|
16749
16751
|
}) => {
|
|
16750
|
-
const { ref: r, width: i } = ia(), s =
|
|
16752
|
+
const { ref: r, width: i } = ia(), s = se(t), o = s && i > 0 && Da(i, Xb), l = /* @__PURE__ */ a("div", { "data-testid": `${n}-main`, className: ha.column, children: e }, "main"), d = s ? /* @__PURE__ */ a("div", { "data-testid": `${n}-aside`, className: ha.aside, children: t }, "aside") : null;
|
|
16751
16753
|
return /* @__PURE__ */ a(
|
|
16752
16754
|
"div",
|
|
16753
16755
|
{
|
|
@@ -16782,12 +16784,12 @@ const e0 = 560, ba = {
|
|
|
16782
16784
|
{
|
|
16783
16785
|
"data-testid": `${t}-item-${o}-value`,
|
|
16784
16786
|
className: ba.value,
|
|
16785
|
-
style: s.tone ? { color:
|
|
16787
|
+
style: s.tone ? { color: dt[s.tone].fg } : void 0,
|
|
16786
16788
|
children: s.value
|
|
16787
16789
|
}
|
|
16788
16790
|
),
|
|
16789
16791
|
/* @__PURE__ */ a("div", { "data-testid": `${t}-item-${o}-label`, className: ba.label, children: s.label }),
|
|
16790
|
-
|
|
16792
|
+
se(s.caption) && /* @__PURE__ */ a("div", { "data-testid": `${t}-item-${o}-caption`, className: ba.caption, children: s.caption })
|
|
16791
16793
|
] }, o))
|
|
16792
16794
|
}
|
|
16793
16795
|
);
|
|
@@ -16863,7 +16865,7 @@ const Nt = {
|
|
|
16863
16865
|
"aria-controls": eo(f.key, u),
|
|
16864
16866
|
"data-testid": b,
|
|
16865
16867
|
title: /* @__PURE__ */ c("span", { className: m(Nt.title, h.title), children: [
|
|
16866
|
-
|
|
16868
|
+
se(f.icon) && /* @__PURE__ */ a(
|
|
16867
16869
|
"span",
|
|
16868
16870
|
{
|
|
16869
16871
|
"aria-hidden": "true",
|
|
@@ -16913,7 +16915,7 @@ const Ee = {
|
|
|
16913
16915
|
footerNote: "border-t border-pos-hair px-5 py-[0.8125rem] text-[0.78125rem] leading-[1.6] text-default-500",
|
|
16914
16916
|
empty: "px-5 pb-5 pt-[0.875rem] text-[0.875rem] text-default-500"
|
|
16915
16917
|
}, Yi = ({ row: e, testId: t }) => /* @__PURE__ */ c(de, { children: [
|
|
16916
|
-
/* @__PURE__ */ a("span", { "aria-hidden": "true", className: Ee.dot, style: { backgroundColor:
|
|
16918
|
+
/* @__PURE__ */ a("span", { "aria-hidden": "true", className: Ee.dot, style: { backgroundColor: dt[e.tone].fg } }),
|
|
16917
16919
|
/* @__PURE__ */ c("span", { className: Ee.body, children: [
|
|
16918
16920
|
/* @__PURE__ */ a("span", { className: Ee.title, children: e.title }),
|
|
16919
16921
|
(e.reference != null || e.timestamp != null) && /* @__PURE__ */ c("span", { className: Ee.meta, children: [
|
|
@@ -16928,7 +16930,7 @@ const Ee = {
|
|
|
16928
16930
|
{
|
|
16929
16931
|
"data-testid": `${t}-note`,
|
|
16930
16932
|
className: Ee.note,
|
|
16931
|
-
style: e.noteTone === "warn" ? { color:
|
|
16933
|
+
style: e.noteTone === "warn" ? { color: dt.warn.fg } : void 0,
|
|
16932
16934
|
children: e.note
|
|
16933
16935
|
}
|
|
16934
16936
|
) : null })
|
|
@@ -16968,7 +16970,7 @@ const Ee = {
|
|
|
16968
16970
|
] })
|
|
16969
16971
|
] });
|
|
16970
16972
|
r0.displayName = "AmountList";
|
|
16971
|
-
const
|
|
16973
|
+
const it = {
|
|
16972
16974
|
list: "m-0 list-none p-0 pl-0.5",
|
|
16973
16975
|
event: "flex gap-3.5",
|
|
16974
16976
|
eventSpaced: "pb-4",
|
|
@@ -16986,20 +16988,20 @@ const rt = {
|
|
|
16986
16988
|
events: e,
|
|
16987
16989
|
emptyContent: t,
|
|
16988
16990
|
"data-testid": n = "activity-timeline"
|
|
16989
|
-
}) => e.length === 0 ? /* @__PURE__ */ a("div", { "data-testid": n, children: t != null && /* @__PURE__ */ a("div", { "data-testid": `${n}-empty`, className:
|
|
16991
|
+
}) => e.length === 0 ? /* @__PURE__ */ a("div", { "data-testid": n, children: t != null && /* @__PURE__ */ a("div", { "data-testid": `${n}-empty`, className: it.empty, children: t }) }) : /* @__PURE__ */ a("ol", { "data-testid": n, className: it.list, children: e.map((r, i) => {
|
|
16990
16992
|
const s = i === e.length - 1, o = `${n}-event-${r.id}`;
|
|
16991
|
-
return /* @__PURE__ */ c("li", { "data-testid": o, className: m(
|
|
16992
|
-
/* @__PURE__ */ c("span", { "aria-hidden": "true", className:
|
|
16993
|
-
/* @__PURE__ */ a("span", { className:
|
|
16994
|
-
!s && /* @__PURE__ */ a("span", { "data-testid": `${o}-connector`, className:
|
|
16993
|
+
return /* @__PURE__ */ c("li", { "data-testid": o, className: m(it.event, !s && it.eventSpaced), children: [
|
|
16994
|
+
/* @__PURE__ */ c("span", { "aria-hidden": "true", className: it.rail, children: [
|
|
16995
|
+
/* @__PURE__ */ a("span", { className: it.dot, style: { backgroundColor: dt[r.tone].fg } }),
|
|
16996
|
+
!s && /* @__PURE__ */ a("span", { "data-testid": `${o}-connector`, className: it.connector })
|
|
16995
16997
|
] }),
|
|
16996
|
-
/* @__PURE__ */ c("div", { className:
|
|
16997
|
-
/* @__PURE__ */ c("div", { className:
|
|
16998
|
-
/* @__PURE__ */ a("span", { className:
|
|
16999
|
-
/* @__PURE__ */ a("span", { className:
|
|
16998
|
+
/* @__PURE__ */ c("div", { className: it.body, children: [
|
|
16999
|
+
/* @__PURE__ */ c("div", { className: it.head, children: [
|
|
17000
|
+
/* @__PURE__ */ a("span", { className: it.title, children: r.title }),
|
|
17001
|
+
/* @__PURE__ */ a("span", { className: it.timestamp, children: r.timestamp })
|
|
17000
17002
|
] }),
|
|
17001
|
-
|
|
17002
|
-
|
|
17003
|
+
se(r.detail) && /* @__PURE__ */ a("div", { className: it.detail, children: r.detail }),
|
|
17004
|
+
se(r.actor) && /* @__PURE__ */ a("div", { "data-testid": `${o}-actor`, className: it.actor, children: r.actor })
|
|
17003
17005
|
] })
|
|
17004
17006
|
] }, r.id);
|
|
17005
17007
|
}) });
|
|
@@ -17102,7 +17104,7 @@ const l0 = ({
|
|
|
17102
17104
|
children: b,
|
|
17103
17105
|
"data-testid": p = "record-card"
|
|
17104
17106
|
}) => {
|
|
17105
|
-
const g = Ye(), v =
|
|
17107
|
+
const g = Ye(), v = se(e);
|
|
17106
17108
|
return /* @__PURE__ */ c(
|
|
17107
17109
|
"section",
|
|
17108
17110
|
{
|
|
@@ -17114,22 +17116,22 @@ const l0 = ({
|
|
|
17114
17116
|
className: m(wt.base, kp[h], f),
|
|
17115
17117
|
children: [
|
|
17116
17118
|
v && /* @__PURE__ */ c("div", { "data-testid": `${p}-header`, className: Cp[d], children: [
|
|
17117
|
-
|
|
17119
|
+
se(n) && /* @__PURE__ */ a("span", { "aria-hidden": "true", className: wt.icon, children: n }),
|
|
17118
17120
|
/* @__PURE__ */ a(t, { id: g, className: wt.title, children: e }),
|
|
17119
|
-
|
|
17121
|
+
se(r) && /* @__PURE__ */ a("span", { "data-testid": `${p}-count`, className: wt.count, children: r }),
|
|
17120
17122
|
i,
|
|
17121
|
-
|
|
17123
|
+
se(s) && /* @__PURE__ */ a("span", { "data-testid": `${p}-action`, className: wt.action, children: s })
|
|
17122
17124
|
] }),
|
|
17123
17125
|
/* @__PURE__ */ c("div", { "data-testid": `${p}-body`, className: $p[d][u], children: [
|
|
17124
|
-
|
|
17126
|
+
se(o) && /* @__PURE__ */ a("p", { "data-testid": `${p}-description`, className: wt.description, children: o }),
|
|
17125
17127
|
b,
|
|
17126
|
-
|
|
17128
|
+
se(l) && /* @__PURE__ */ a(
|
|
17127
17129
|
"div",
|
|
17128
17130
|
{
|
|
17129
17131
|
"data-testid": `${p}-footer`,
|
|
17130
17132
|
className: m(
|
|
17131
17133
|
wt.footer,
|
|
17132
|
-
|
|
17134
|
+
se(b) ? wt.footerAfterContent : wt.footerAfterDescription
|
|
17133
17135
|
),
|
|
17134
17136
|
children: l
|
|
17135
17137
|
}
|
|
@@ -17194,13 +17196,13 @@ const ut = {
|
|
|
17194
17196
|
originalAmountLabel: n,
|
|
17195
17197
|
"data-testid": r = "line-item-rows"
|
|
17196
17198
|
}) => /* @__PURE__ */ a("ul", { "aria-label": t, "data-testid": r, className: ut.list, children: e.map((i) => {
|
|
17197
|
-
const s = `${r}-item-${i.id}`, o =
|
|
17199
|
+
const s = `${r}-item-${i.id}`, o = se(i.originalAmount);
|
|
17198
17200
|
return /* @__PURE__ */ c(
|
|
17199
17201
|
"li",
|
|
17200
17202
|
{
|
|
17201
17203
|
"data-testid": s,
|
|
17202
17204
|
className: ut.row,
|
|
17203
|
-
style: i.tone ? { backgroundColor:
|
|
17205
|
+
style: i.tone ? { backgroundColor: dt[i.tone].bg } : void 0,
|
|
17204
17206
|
children: [
|
|
17205
17207
|
/* @__PURE__ */ c("div", { className: ut.body, children: [
|
|
17206
17208
|
/* @__PURE__ */ a("div", { className: ut.name, children: i.name }),
|
|
@@ -17223,7 +17225,7 @@ const ut = {
|
|
|
17223
17225
|
{
|
|
17224
17226
|
"data-testid": `${s}-amount`,
|
|
17225
17227
|
className: ut.amount,
|
|
17226
|
-
style: o ? { color:
|
|
17228
|
+
style: o ? { color: dt.ok.fg } : void 0,
|
|
17227
17229
|
children: i.amount
|
|
17228
17230
|
}
|
|
17229
17231
|
)
|
|
@@ -17288,7 +17290,7 @@ const f0 = 37.5, Ke = {
|
|
|
17288
17290
|
/* @__PURE__ */ a("span", { className: m(d, Ke.totalLabel), children: t.label }),
|
|
17289
17291
|
/* @__PURE__ */ a("span", { "data-testid": `${r}-total-value`, className: Ke.totalValue, children: t.value })
|
|
17290
17292
|
] }) }),
|
|
17291
|
-
|
|
17293
|
+
se(n) && /* @__PURE__ */ a("div", { "data-testid": `${r}-memo`, className: Ke.memo, children: n })
|
|
17292
17294
|
]
|
|
17293
17295
|
}
|
|
17294
17296
|
);
|
|
@@ -17316,7 +17318,7 @@ const Qn = {
|
|
|
17316
17318
|
style: Ea(t),
|
|
17317
17319
|
children: [
|
|
17318
17320
|
r,
|
|
17319
|
-
|
|
17321
|
+
se(n) && /* @__PURE__ */ c("span", { "data-testid": `${i}-secondary`, className: Qn.secondary, children: [
|
|
17320
17322
|
/* @__PURE__ */ a("span", { "aria-hidden": "true", children: " · " }),
|
|
17321
17323
|
n
|
|
17322
17324
|
] })
|
|
@@ -17490,7 +17492,7 @@ export {
|
|
|
17490
17492
|
Yr as computeChange,
|
|
17491
17493
|
Sa as currencyFractionDigits,
|
|
17492
17494
|
Sg as firstNeedsFixKey,
|
|
17493
|
-
|
|
17495
|
+
Ne as formatMoney,
|
|
17494
17496
|
ti as formatOfferCurrency,
|
|
17495
17497
|
fg as formatRevenueAmount,
|
|
17496
17498
|
pg as formatRevenueCurrency,
|
|
@@ -17506,7 +17508,7 @@ export {
|
|
|
17506
17508
|
Jl as pillTabId,
|
|
17507
17509
|
eo as pillTabPanelId,
|
|
17508
17510
|
Pg as pillTabPanelProps,
|
|
17509
|
-
|
|
17511
|
+
he as posSurfaceTokens,
|
|
17510
17512
|
Is as roundToCurrency,
|
|
17511
17513
|
ag as useControlSize,
|
|
17512
17514
|
or as useDensity,
|