@layerfi/components 0.1.114-alpha.3 → 0.1.114-alpha.5

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.
@@ -65,18 +65,18 @@ import useSWRInfinite from "swr/infinite";
65
65
  import useSWRMutation from "swr/mutation";
66
66
  import { useStoreWithEqualityFn } from "zustand/traditional";
67
67
  import { useFloating, offset, flip, shift, autoUpdate, useHover, useFocus, useDismiss, useRole, useInteractions, useTransitionStyles, useMergeRefs, FloatingPortal } from "@floating-ui/react";
68
- import { Button as Button$2, Header as Header$3, Label as Label$1, Text as Text$1, ModalOverlay as ModalOverlay$1, Modal as Modal$1, Dialog as Dialog$1, Heading as Heading$2, Form as Form$1, TextField as TextField$1, FieldError as FieldError$1, Input as Input$2, Group, Checkbox as Checkbox$1, DateField as DateField$1, DateInput as DateInput$1, DateSegment as DateSegment$1, DatePicker as DatePicker$2, NumberField as NumberField$1, TextArea as TextArea$1, MenuTrigger, Popover as Popover$1, Menu as Menu$1, MenuItem as MenuItem$2, GridList, GridListItem, DialogTrigger, SearchField as SearchField$1, Table as Table$2, Column as Column$1, Cell as Cell$1, TableHeader as TableHeader$1, TableBody as TableBody$2, Row as Row$1, Switch as Switch$1, Calendar as Calendar$1, CalendarGrid as CalendarGrid$1, CalendarGridBody as CalendarGridBody$1, CalendarCell as CalendarCell$1, CalendarGridHeader as CalendarGridHeader$1, CalendarHeaderCell as CalendarHeaderCell$1, Meter as Meter$1, Link as Link$3 } from "react-aria-components";
69
- import { LoaderCircle, X as X$1, ChevronDown as ChevronDown$1, Layers2Icon, UploadCloud as UploadCloud$1, CopyIcon, FileSpreadsheet, FileDownIcon, Minus, Check as Check$1, RefreshCcw as RefreshCcw$1, MenuIcon, ChevronRight as ChevronRight$1, PencilRuler, ChevronLeft as ChevronLeft$1, Search, SearchX, Trash2, CheckIcon, AlertCircle as AlertCircle$1, TriangleAlert, List, AlertTriangle, Save as Save$1, Plus as Plus$1, HandCoins, Menu as Menu$2, Trash as Trash$1, Send, Calendar as Calendar$2, Download, Users, Milestone, Video, Clock as Clock$1, Link as Link$4, Car } from "lucide-react";
68
+ import { Button as Button$2, Header as Header$3, Label as Label$1, Text as Text$1, ModalOverlay as ModalOverlay$1, Modal as Modal$1, Dialog as Dialog$1, Heading as Heading$2, Group, SearchField as SearchField$1, Input as Input$2, Form as Form$1, TextField as TextField$1, FieldError as FieldError$1, Checkbox as Checkbox$1, DateField as DateField$1, DateInput as DateInput$1, DateSegment as DateSegment$1, DatePicker as DatePicker$2, NumberField as NumberField$1, TextArea as TextArea$1, MenuTrigger, Popover as Popover$1, Menu as Menu$1, MenuItem as MenuItem$2, GridList, GridListItem, DialogTrigger, Table as Table$2, Column as Column$1, Cell as Cell$1, TableHeader as TableHeader$1, TableBody as TableBody$2, Row as Row$1, Switch as Switch$1, ToggleButton, SelectionIndicator, ToggleButtonGroup, Calendar as Calendar$1, CalendarGrid as CalendarGrid$1, CalendarGridBody as CalendarGridBody$1, CalendarCell as CalendarCell$1, CalendarGridHeader as CalendarGridHeader$1, CalendarHeaderCell as CalendarHeaderCell$1, Meter as Meter$1, Link as Link$3 } from "react-aria-components";
69
+ import { LoaderCircle, X as X$1, ChevronDown as ChevronDown$1, Layers2Icon, UploadCloud as UploadCloud$1, Search, ChevronLeft as ChevronLeft$1, CopyIcon, FileSpreadsheet, FileDownIcon, Minus, Check as Check$1, RefreshCcw as RefreshCcw$1, MenuIcon, ChevronRight as ChevronRight$1, PencilRuler, SearchX, Trash2, CheckIcon, AlertCircle as AlertCircle$1, TriangleAlert, List, AlertTriangle, Save as Save$1, Plus as Plus$1, HandCoins, Menu as Menu$2, Trash as Trash$1, Send, Calendar as Calendar$2, Download, Users, Milestone, Video, Clock as Clock$1, Link as Link$4, Car } from "lucide-react";
70
70
  import pluralize from "pluralize";
71
71
  import { mergeRefs } from "react-merge-refs";
72
72
  import useResizeObserver from "@react-hook/resize-observer";
73
73
  import Select$1, { components } from "react-select";
74
- import { AnimatePresence, motion } from "motion/react";
75
74
  import { useDropzone } from "react-dropzone";
76
75
  import { createFormHookContexts, createFormHook, useForm as useForm$1, useStore as useStore$1, revalidateLogic } from "@tanstack/react-form";
77
76
  import BaseCreatableSelect from "react-select/creatable";
78
77
  import { useReactTable, getSortedRowModel, getCoreRowModel, flexRender, createColumnHelper, getPaginationRowModel, getExpandedRowModel } from "@tanstack/react-table";
79
78
  import { useVirtualizer } from "@tanstack/react-virtual";
79
+ import { AnimatePresence, motion } from "motion/react";
80
80
  import CurrencyInput from "react-currency-input-field";
81
81
  import { v4 } from "uuid";
82
82
  import { ResponsiveContainer, ComposedChart, ReferenceLine, Tooltip as Tooltip$1, CartesianGrid, Legend, XAxis, YAxis, Bar, Cell as Cell$2, LabelList, Line, Rectangle, PieChart, Pie, Label as Label$2, Text as Text$2 } from "recharts";
@@ -202,7 +202,7 @@ class ErrorHandlerClass {
202
202
  }
203
203
  const errorHandler = new ErrorHandlerClass();
204
204
  const reportError = (payload) => errorHandler.onError(payload);
205
- const version = "0.1.114-alpha.3";
205
+ const version = "0.1.114-alpha.5";
206
206
  const pkg = {
207
207
  version
208
208
  };
@@ -4894,7 +4894,7 @@ const useAugmentedBankTransactions = (params) => {
4894
4894
  }
4895
4895
  }).finally(() => {
4896
4896
  var _a2;
4897
- (_a2 = eventCallbacks == null ? void 0 : eventCallbacks.onTransactionCategorized) == null ? void 0 : _a2.call(eventCallbacks, bankTransactionId);
4897
+ (_a2 = eventCallbacks == null ? void 0 : eventCallbacks.onTransactionCategorized) == null ? void 0 : _a2.call(eventCallbacks);
4898
4898
  });
4899
4899
  });
4900
4900
  const { trigger: matchBankTransaction2 } = useMatchBankTransaction({
@@ -4953,7 +4953,7 @@ const useAugmentedBankTransactions = (params) => {
4953
4953
  }
4954
4954
  }).finally(() => {
4955
4955
  var _a2;
4956
- (_a2 = eventCallbacks == null ? void 0 : eventCallbacks.onTransactionCategorized) == null ? void 0 : _a2.call(eventCallbacks, bankTransactionId);
4956
+ (_a2 = eventCallbacks == null ? void 0 : eventCallbacks.onTransactionCategorized) == null ? void 0 : _a2.call(eventCallbacks);
4957
4957
  });
4958
4958
  });
4959
4959
  const shouldHideAfterCategorize = () => {
@@ -6786,7 +6786,7 @@ function BulkSelectionStoreProvider({
6786
6786
  const [store] = useState(() => buildStore());
6787
6787
  return /* @__PURE__ */ jsx(BulkSelectionStoreContext.Provider, { value: store, children });
6788
6788
  }
6789
- const CLASS_NAME$d = "Layer__Stack";
6789
+ const CLASS_NAME$c = "Layer__Stack";
6790
6790
  const Stack = forwardRef(
6791
6791
  function Stack2(_H, ref) {
6792
6792
  var _I = _H, {
@@ -6839,7 +6839,7 @@ const Stack = forwardRef(
6839
6839
  __spreadProps(__spreadValues(__spreadValues({
6840
6840
  ref
6841
6841
  }, restProps), dataProperties), {
6842
- className: classNames(CLASS_NAME$d, className),
6842
+ className: classNames(CLASS_NAME$c, className),
6843
6843
  children
6844
6844
  })
6845
6845
  );
@@ -6963,9 +6963,9 @@ function useDebounce(fn) {
6963
6963
  }, []);
6964
6964
  return debouncedCallback;
6965
6965
  }
6966
- const CLASS_NAME$c = "Layer__LoadingSpinner";
6966
+ const CLASS_NAME$b = "Layer__LoadingSpinner";
6967
6967
  function LoadingSpinner({ size }) {
6968
- return /* @__PURE__ */ jsx(LoaderCircle, { className: CLASS_NAME$c, size });
6968
+ return /* @__PURE__ */ jsx(LoaderCircle, { className: CLASS_NAME$b, size });
6969
6969
  }
6970
6970
  function withRenderProp(renderProp, callback) {
6971
6971
  if (typeof renderProp === "function") {
@@ -7079,7 +7079,7 @@ function buildKey$T({
7079
7079
  }
7080
7080
  const useBulkCategorize = () => {
7081
7081
  const { data } = useAuth();
7082
- const { businessId } = useLayerContext();
7082
+ const { businessId, eventCallbacks } = useLayerContext();
7083
7083
  const { forceReloadBankTransactions } = useBankTransactionsGlobalCacheActions();
7084
7084
  const mutationResponse = useSWRMutation(
7085
7085
  () => buildKey$T(__spreadProps(__spreadValues({}, data), {
@@ -7101,11 +7101,13 @@ const useBulkCategorize = () => {
7101
7101
  const originalTrigger = mutationResponse.trigger;
7102
7102
  const stableProxiedTrigger = useCallback(
7103
7103
  (...triggerParameters) => __async(null, null, function* () {
7104
+ var _a;
7104
7105
  const triggerResult = yield originalTrigger(...triggerParameters);
7105
7106
  void forceReloadBankTransactions();
7107
+ (_a = eventCallbacks == null ? void 0 : eventCallbacks.onTransactionCategorized) == null ? void 0 : _a.call(eventCallbacks);
7106
7108
  return triggerResult;
7107
7109
  }),
7108
- [originalTrigger, forceReloadBankTransactions]
7110
+ [originalTrigger, forceReloadBankTransactions, eventCallbacks]
7109
7111
  );
7110
7112
  return new Proxy(mutationResponse, {
7111
7113
  get(target, prop) {
@@ -7705,18 +7707,16 @@ const centsToDollars = (cents = NaN) => isNaN(cents) ? "-.--" : formatter.format
7705
7707
  function centsToDollarsWithoutCommas(cents = 0) {
7706
7708
  return centsToDollars(cents).replaceAll(",", "");
7707
7709
  }
7708
- const CLASS_NAME$b = "Layer__MoneyText";
7710
+ const CLASS_NAME$a = "Layer__MoneySpan";
7709
7711
  const MoneySpan = forwardRef(
7710
7712
  (_V, ref) => {
7711
- var _W = _V, { amount, bold, size, displayPlusSign, className } = _W, restProps = __objRest(_W, ["amount", "bold", "size", "displayPlusSign", "className"]);
7713
+ var _W = _V, { amount, displayPlusSign, className } = _W, restProps = __objRest(_W, ["amount", "displayPlusSign", "className"]);
7712
7714
  const dataProperties = toDataProperties({
7713
- bold,
7714
7715
  "positive": amount >= 0,
7715
7716
  "negative": amount < 0,
7716
- size,
7717
7717
  "display-plus-sign": displayPlusSign
7718
7718
  });
7719
- return /* @__PURE__ */ jsx("span", __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), { className: classNames(CLASS_NAME$b, className), ref, children: centsToDollars(Math.abs(amount)) }));
7719
+ return /* @__PURE__ */ jsx(Span, __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), { className: classNames(CLASS_NAME$a, className), ref, children: centsToDollars(Math.abs(amount)) }));
7720
7720
  }
7721
7721
  );
7722
7722
  MoneySpan.displayName = "MoneySpan";
@@ -8137,7 +8137,7 @@ const BankTransactionCategoryComboBoxOption = ({ option, fallback }) => {
8137
8137
  /* @__PURE__ */ jsx(Span, { size: "sm", variant: "placeholder", children: option.label }),
8138
8138
  inAppLink
8139
8139
  ] }),
8140
- /* @__PURE__ */ jsx(MoneySpan, { size: "sm", bold: true, amount: option.original.details.amount })
8140
+ /* @__PURE__ */ jsx(MoneySpan, { size: "sm", weight: "bold", amount: option.original.details.amount })
8141
8141
  ] });
8142
8142
  }
8143
8143
  return fallback;
@@ -8213,59 +8213,11 @@ const BankTransactionCategoryComboBox = ({
8213
8213
  }
8214
8214
  );
8215
8215
  };
8216
- const variants = {
8217
- fade: {
8218
- initial: { opacity: 0 },
8219
- animate: { opacity: 1 },
8220
- exit: { opacity: 0 },
8221
- transition: { duration: 0.3, ease: [0, 0, 0.58, 1] }
8222
- },
8223
- slideUp: {
8224
- initial: { y: "100%" },
8225
- animate: { y: 0 },
8226
- exit: { y: "100%" },
8227
- transition: { duration: 0.35, ease: [0.4, 0, 0.2, 1] }
8228
- },
8229
- expand: {
8230
- initial: { height: 0, opacity: 0 },
8231
- animate: { height: "auto", opacity: 1 },
8232
- exit: { height: 0, opacity: 0 },
8233
- transition: {
8234
- height: { duration: 0.25, ease: [0.4, 0, 0.2, 1] },
8235
- opacity: { duration: 0.15, ease: [0, 0, 0.58, 1] }
8236
- }
8237
- }
8238
- };
8239
- const AnimatedPresenceDiv = (_$) => {
8240
- var _aa = _$, {
8241
- children,
8242
- variant,
8243
- isOpen,
8244
- slotProps = { AnimatePresence: { initial: false } }
8245
- } = _aa, props = __objRest(_aa, [
8246
- "children",
8247
- "variant",
8248
- "isOpen",
8249
- "slotProps"
8250
- ]);
8251
- const config = variants[variant];
8252
- return /* @__PURE__ */ jsx(AnimatePresence, __spreadProps(__spreadValues({}, slotProps.AnimatePresence), { children: isOpen && /* @__PURE__ */ jsx(
8253
- motion.div,
8254
- __spreadProps(__spreadValues({
8255
- initial: config.initial,
8256
- animate: config.animate,
8257
- exit: config.exit,
8258
- transition: config.transition
8259
- }, props), {
8260
- children
8261
- })
8262
- ) }));
8263
- };
8264
8216
  const BASE_MODAL_OVERLAY_CLASS_NAME = "Layer__ModalOverlay";
8265
8217
  const MODAL_OVERLAY_CLASS_NAME = `Layer__Portal ${BASE_MODAL_OVERLAY_CLASS_NAME}`;
8266
8218
  const ModalOverlay = forwardRef(
8267
- (_ba, ref) => {
8268
- var _ca = _ba, { variant } = _ca, restProps = __objRest(_ca, ["variant"]);
8219
+ (_$, ref) => {
8220
+ var _aa = _$, { variant } = _aa, restProps = __objRest(_aa, ["variant"]);
8269
8221
  const dataProperties = toDataProperties({ variant });
8270
8222
  return /* @__PURE__ */ jsx(
8271
8223
  ModalOverlay$1,
@@ -8292,8 +8244,8 @@ const InternalModal = forwardRef(({ children, flexBlock, flexInline, size, varia
8292
8244
  InternalModal.displayName = "Modal";
8293
8245
  const DIALOG_CLASS_NAME = "Layer__Dialog";
8294
8246
  const Dialog = forwardRef(
8295
- (_da, ref) => {
8296
- var _ea = _da, { variant = "center" } = _ea, restProps = __objRest(_ea, ["variant"]);
8247
+ (_ba, ref) => {
8248
+ var _ca = _ba, { variant = "center" } = _ca, restProps = __objRest(_ca, ["variant"]);
8297
8249
  const dataProperties = toDataProperties({ variant });
8298
8250
  return /* @__PURE__ */ jsx(
8299
8251
  Dialog$1,
@@ -8331,25 +8283,11 @@ function Drawer({
8331
8283
  isDismissable = false,
8332
8284
  role
8333
8285
  }) {
8334
- const isMobileDrawer = variant === "mobile-drawer";
8335
- const shouldUseFadeOverlay = variant === "drawer" || isMobileDrawer;
8336
- const modalContent = /* @__PURE__ */ jsx(InternalModal, { flexBlock, flexInline, size, variant, children: /* @__PURE__ */ jsx(Dialog, { role: role != null ? role : "dialog", "aria-label": ariaLabel, variant, children }) });
8337
- const wrappedModalContent = isMobileDrawer ? /* @__PURE__ */ jsx(
8338
- AnimatedPresenceDiv,
8339
- {
8340
- variant: "slideUp",
8341
- isOpen,
8342
- className: "Layer__ModalContentSlideUpMotionContent",
8343
- slotProps: { AnimatePresence: { initial: true } },
8344
- children: modalContent
8345
- }
8346
- ) : modalContent;
8347
- const overlayContent = shouldUseFadeOverlay ? /* @__PURE__ */ jsx(AnimatedPresenceDiv, { variant: "fade", isOpen, className: "Layer__ModalContentFadeMotionContent", children: wrappedModalContent }) : wrappedModalContent;
8348
- return /* @__PURE__ */ jsx(ModalOverlay, { isOpen, onOpenChange, variant, isDismissable, children: overlayContent });
8286
+ return /* @__PURE__ */ jsx(ModalOverlay, { isOpen, onOpenChange, variant, isDismissable, children: /* @__PURE__ */ jsx(InternalModal, { flexBlock, flexInline, size, variant, children: /* @__PURE__ */ jsx(Dialog, { role: role != null ? role : "dialog", "aria-label": ariaLabel, variant, children }) }) });
8349
8287
  }
8350
8288
  const HEADING_CLASS_NAME = "Layer__UI__Heading";
8351
- const Heading$1 = forwardRef((_fa, ref) => {
8352
- var _ga = _fa, { align, pie, pbe, size, variant, weight, ellipsis, className } = _ga, restProps = __objRest(_ga, ["align", "pie", "pbe", "size", "variant", "weight", "ellipsis", "className"]);
8289
+ const Heading$1 = forwardRef((_da, ref) => {
8290
+ var _ea = _da, { align, pie, pbe, size, variant, weight, ellipsis, className } = _ea, restProps = __objRest(_ea, ["align", "pie", "pbe", "size", "variant", "weight", "ellipsis", "className"]);
8353
8291
  const dataProperties = toDataProperties({ pbe, pie, size, align, variant, weight, ellipsis });
8354
8292
  return /* @__PURE__ */ jsx(
8355
8293
  Heading$2,
@@ -8420,8 +8358,8 @@ const MODAL_ACTIONS_CLASS_NAME = "Layer__ModalActions";
8420
8358
  function ModalActions({ children }) {
8421
8359
  return /* @__PURE__ */ jsx("div", { className: MODAL_ACTIONS_CLASS_NAME, children });
8422
8360
  }
8423
- const AlertCircle = (_ha) => {
8424
- var _ia = _ha, { size = 18 } = _ia, props = __objRest(_ia, ["size"]);
8361
+ const AlertCircle = (_fa) => {
8362
+ var _ga = _fa, { size = 18 } = _ga, props = __objRest(_ga, ["size"]);
8425
8363
  return /* @__PURE__ */ jsxs(
8426
8364
  "svg",
8427
8365
  __spreadProps(__spreadValues({
@@ -8463,8 +8401,8 @@ const AlertCircle = (_ha) => {
8463
8401
  })
8464
8402
  );
8465
8403
  };
8466
- const Save = (_ja) => {
8467
- var _ka = _ja, { size = 18 } = _ka, props = __objRest(_ka, ["size"]);
8404
+ const Save = (_ha) => {
8405
+ var _ia = _ha, { size = 18 } = _ia, props = __objRest(_ia, ["size"]);
8468
8406
  return /* @__PURE__ */ jsxs(
8469
8407
  "svg",
8470
8408
  __spreadProps(__spreadValues({
@@ -8506,14 +8444,14 @@ const Save = (_ja) => {
8506
8444
  })
8507
8445
  );
8508
8446
  };
8509
- const RetryButton = (_la) => {
8510
- var _ma = _la, {
8447
+ const RetryButton = (_ja) => {
8448
+ var _ka = _ja, {
8511
8449
  className,
8512
8450
  processing,
8513
8451
  disabled,
8514
8452
  error,
8515
8453
  children
8516
- } = _ma, props = __objRest(_ma, [
8454
+ } = _ka, props = __objRest(_ka, [
8517
8455
  "className",
8518
8456
  "processing",
8519
8457
  "disabled",
@@ -8570,8 +8508,8 @@ const buildRightIcon = ({
8570
8508
  }
8571
8509
  return /* @__PURE__ */ jsx(Save, { size: 16 });
8572
8510
  };
8573
- const SubmitButton = (_na) => {
8574
- var _oa = _na, {
8511
+ const SubmitButton = (_la) => {
8512
+ var _ma = _la, {
8575
8513
  active,
8576
8514
  className,
8577
8515
  processing,
@@ -8583,7 +8521,7 @@ const SubmitButton = (_na) => {
8583
8521
  variant = ButtonVariant.primary,
8584
8522
  withRetry,
8585
8523
  iconAsPrimary = true
8586
- } = _oa, props = __objRest(_oa, [
8524
+ } = _ma, props = __objRest(_ma, [
8587
8525
  "active",
8588
8526
  "className",
8589
8527
  "processing",
@@ -8688,12 +8626,323 @@ function BaseConfirmationModal({
8688
8626
  ] });
8689
8627
  } });
8690
8628
  }
8629
+ const ChevronDown = (_na) => {
8630
+ var _oa = _na, { size = 18 } = _oa, props = __objRest(_oa, ["size"]);
8631
+ return /* @__PURE__ */ jsx(
8632
+ "svg",
8633
+ __spreadProps(__spreadValues({
8634
+ viewBox: "0 0 18 18",
8635
+ fill: "none",
8636
+ xmlns: "http://www.w3.org/2000/svg"
8637
+ }, props), {
8638
+ width: size,
8639
+ height: size,
8640
+ children: /* @__PURE__ */ jsx(
8641
+ "path",
8642
+ {
8643
+ d: "M4.5 6.75L9 11.25L13.5 6.75",
8644
+ stroke: "currentColor",
8645
+ strokeLinecap: "round",
8646
+ strokeLinejoin: "round"
8647
+ }
8648
+ )
8649
+ })
8650
+ );
8651
+ };
8652
+ const ActionableList = ({
8653
+ options: options2,
8654
+ onClick,
8655
+ selectedId,
8656
+ showDescriptions = false,
8657
+ className
8658
+ }) => {
8659
+ return /* @__PURE__ */ jsx("ul", { className: classNames("Layer__actionable-list", className), children: options2.map((x, idx) => /* @__PURE__ */ jsxs(
8660
+ "li",
8661
+ {
8662
+ role: "button",
8663
+ onClick: () => onClick(x),
8664
+ className: classNames(
8665
+ x.secondary && "Layer__actionable-list-item--secondary",
8666
+ x.asLink && "Layer__actionable-list-item--as-link",
8667
+ selectedId === x.id && "Layer__actionable-list__item--selected"
8668
+ ),
8669
+ children: [
8670
+ /* @__PURE__ */ jsxs("div", { className: "Layer__actionable-list__content", children: [
8671
+ /* @__PURE__ */ jsx(Text, { size: TextSize.sm, children: x.label }),
8672
+ /* TODO: Replace 'See all categories' with something more generic */
8673
+ showDescriptions && x.description && x.label !== "See all categories" && /* @__PURE__ */ jsx(
8674
+ Text,
8675
+ {
8676
+ className: "Layer__actionable-list__content-description",
8677
+ size: TextSize.sm,
8678
+ children: x.description
8679
+ }
8680
+ )
8681
+ ] }),
8682
+ !x.asLink && selectedId && selectedId === x.id ? /* @__PURE__ */ jsx("span", { className: "Layer__actionable-list__select Layer__actionable-list__select--selected", children: /* @__PURE__ */ jsx(
8683
+ Check,
8684
+ {
8685
+ size: 14,
8686
+ className: "Layer__actionable-list__selected-icon"
8687
+ }
8688
+ ) }) : null,
8689
+ !x.asLink && (!selectedId || selectedId !== x.id) ? /* @__PURE__ */ jsx("span", { className: "Layer__actionable-list__select" }) : null,
8690
+ x.asLink && /* @__PURE__ */ jsx(
8691
+ ChevronRight,
8692
+ {
8693
+ size: 16,
8694
+ className: "Layer__actionable-list__link-icon"
8695
+ }
8696
+ )
8697
+ ]
8698
+ },
8699
+ `actionable-list-item-${idx}`
8700
+ )) });
8701
+ };
8702
+ function getLeafCategories(category) {
8703
+ if (!category.subCategories || category.subCategories.length === 0) {
8704
+ return [category];
8705
+ }
8706
+ return category.subCategories.flatMap((subCategory) => getLeafCategories(subCategory));
8707
+ }
8708
+ const flattenCategories = (categories) => {
8709
+ return categories.flatMap((category) => {
8710
+ const subCategories = category.subCategories;
8711
+ if (!subCategories || subCategories.length === 0) {
8712
+ return [new CategoryAsOption(category)];
8713
+ }
8714
+ const leafCategories = getLeafCategories(category);
8715
+ if (subCategories.every((subCategory) => !subCategory.subCategories || subCategory.subCategories.length === 0)) {
8716
+ return [{
8717
+ label: category.displayName,
8718
+ id: "id" in category ? category.id : category.stableName,
8719
+ categories: leafCategories.map((cat) => new CategoryAsOption(cat))
8720
+ }];
8721
+ }
8722
+ return leafCategories.map((cat) => new CategoryAsOption(cat));
8723
+ });
8724
+ };
8725
+ const INPUT_GROUP_CLASS_NAME = "Layer__InputGroup";
8726
+ const InputGroup$1 = forwardRef(
8727
+ function InputGroup2(_pa, ref) {
8728
+ var _qa = _pa, { actionCount, className, slots, children } = _qa, restProps = __objRest(_qa, ["actionCount", "className", "slots", "children"]);
8729
+ const combinedClassName = classNames(INPUT_GROUP_CLASS_NAME, className);
8730
+ const dataProperties = toDataProperties({
8731
+ "action-count": actionCount
8732
+ });
8733
+ return /* @__PURE__ */ jsx(
8734
+ Group,
8735
+ __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), {
8736
+ className: combinedClassName,
8737
+ ref,
8738
+ children
8739
+ })
8740
+ );
8741
+ }
8742
+ );
8743
+ const X = (_ra) => {
8744
+ var _sa = _ra, { size = 18 } = _sa, props = __objRest(_sa, ["size"]);
8745
+ return /* @__PURE__ */ jsxs(
8746
+ "svg",
8747
+ __spreadProps(__spreadValues({
8748
+ xmlns: "http://www.w3.org/2000/svg",
8749
+ viewBox: "0 0 18 18",
8750
+ fill: "none"
8751
+ }, props), {
8752
+ width: size,
8753
+ height: size,
8754
+ children: [
8755
+ /* @__PURE__ */ jsx(
8756
+ "path",
8757
+ {
8758
+ d: "M13.5 4.5L4.5 13.5",
8759
+ stroke: "currentColor",
8760
+ strokeLinecap: "round",
8761
+ strokeLinejoin: "round"
8762
+ }
8763
+ ),
8764
+ /* @__PURE__ */ jsx(
8765
+ "path",
8766
+ {
8767
+ d: "M4.5 4.5L13.5 13.5",
8768
+ stroke: "currentColor",
8769
+ strokeLinecap: "round",
8770
+ strokeLinejoin: "round"
8771
+ }
8772
+ )
8773
+ ]
8774
+ })
8775
+ );
8776
+ };
8777
+ const CLASS_NAME$9 = "Layer__MinimalSearchField";
8778
+ function MinimalSearchField(_ta) {
8779
+ var _ua = _ta, {
8780
+ placeholder,
8781
+ isDisabled
8782
+ } = _ua, restProps = __objRest(_ua, [
8783
+ "placeholder",
8784
+ "isDisabled"
8785
+ ]);
8786
+ return /* @__PURE__ */ jsxs(SearchField$1, __spreadProps(__spreadValues({}, restProps), { isDisabled, className: CLASS_NAME$9, children: [
8787
+ /* @__PURE__ */ jsx(
8788
+ Input$2,
8789
+ {
8790
+ slot: "input",
8791
+ placeholder
8792
+ }
8793
+ ),
8794
+ /* @__PURE__ */ jsx(Button, { slot: "clear-button", inset: true, icon: true, variant: "ghost", "aria-label": "Clear search", children: /* @__PURE__ */ jsx(X, {}) })
8795
+ ] }));
8796
+ }
8797
+ const CLASS_NAME$8 = "Layer__SearchField";
8798
+ function SearchField(_va) {
8799
+ var _wa = _va, { slot = "search", className, label, isDisabled } = _wa, restProps = __objRest(_wa, ["slot", "className", "label", "isDisabled"]);
8800
+ const combinedClassName = classNames(CLASS_NAME$8, className);
8801
+ return /* @__PURE__ */ jsxs(InputGroup$1, { slot, className: combinedClassName, children: [
8802
+ /* @__PURE__ */ jsx(VStack, { slot: "icon", align: "center", justify: "center", className: "Layer__SearchField__Icon", "data-disabled": isDisabled || void 0, children: /* @__PURE__ */ jsx(Search, { size: 14 }) }),
8803
+ /* @__PURE__ */ jsx(
8804
+ MinimalSearchField,
8805
+ __spreadProps(__spreadValues({}, restProps), {
8806
+ placeholder: label,
8807
+ "aria-label": label,
8808
+ isDisabled
8809
+ })
8810
+ )
8811
+ ] });
8812
+ }
8813
+ const isGroup = (item) => {
8814
+ return "categories" in item;
8815
+ };
8816
+ const BankTransactionsMobileListBusinessCategories = ({
8817
+ select,
8818
+ selectedId,
8819
+ showTooltips
8820
+ }) => {
8821
+ const { data: categories } = useCategories();
8822
+ const [query, setQuery] = useState("");
8823
+ const categoryOptions = useMemo(
8824
+ () => flattenCategories(
8825
+ (categories != null ? categories : []).filter((category) => category.type != "ExclusionNested")
8826
+ ),
8827
+ [categories]
8828
+ );
8829
+ const [optionsToShow, setOptionsToShow] = useState(categoryOptions);
8830
+ const [selectedGroup, setSelectedGroup] = useState();
8831
+ const filteredOptions = useMemo(() => {
8832
+ let options2 = optionsToShow;
8833
+ if (query) {
8834
+ const lower = query.toLowerCase();
8835
+ options2 = options2.flatMap((opt) => {
8836
+ if (isGroup(opt)) {
8837
+ return opt.categories.filter(
8838
+ (cat) => cat.label.toLowerCase().includes(lower)
8839
+ );
8840
+ }
8841
+ return opt.label.toLowerCase().includes(lower) ? [opt] : [];
8842
+ });
8843
+ }
8844
+ return options2.sort((a, b) => a.label.localeCompare(b.label)).map((opt) => {
8845
+ var _a;
8846
+ return isGroup(opt) ? { label: opt.label, id: opt.id, value: opt, asLink: true } : { label: opt.label, id: opt.value, description: (_a = opt.original.description) != null ? _a : void 0, value: opt };
8847
+ });
8848
+ }, [optionsToShow, query]);
8849
+ const onCategorySelect = (item) => {
8850
+ if (isGroup(item.value)) {
8851
+ setOptionsToShow(item.value.categories);
8852
+ setSelectedGroup(item.value.label);
8853
+ setQuery("");
8854
+ return;
8855
+ }
8856
+ select(item.value);
8857
+ };
8858
+ const clearSelectedGroup = useCallback(() => {
8859
+ setOptionsToShow(categoryOptions);
8860
+ setSelectedGroup(void 0);
8861
+ setQuery("");
8862
+ }, [categoryOptions]);
8863
+ return /* @__PURE__ */ jsxs(VStack, { className: "Layer__bank-transaction-mobile-list-item__categories_list-container", pbs: "lg", gap: "md", children: [
8864
+ /* @__PURE__ */ jsxs(VStack, { pis: "sm", pie: "sm", gap: "md", children: [
8865
+ /* @__PURE__ */ jsx(HStack, { pis: "xs", children: selectedGroup ? /* @__PURE__ */ jsxs(Button, { variant: "text", onClick: clearSelectedGroup, children: [
8866
+ /* @__PURE__ */ jsx(ChevronLeft$1, { size: 18 }),
8867
+ /* @__PURE__ */ jsx(ModalHeading, { size: "sm", weight: "bold", align: "center", children: selectedGroup })
8868
+ ] }) : /* @__PURE__ */ jsx(ModalHeading, { size: "sm", weight: "bold", children: "Select category" }) }),
8869
+ /* @__PURE__ */ jsx(SearchField, { value: query, onChange: setQuery, label: "Search categories..." })
8870
+ ] }),
8871
+ /* @__PURE__ */ jsx(
8872
+ ActionableList,
8873
+ {
8874
+ options: filteredOptions,
8875
+ onClick: onCategorySelect,
8876
+ selectedId,
8877
+ showDescriptions: showTooltips,
8878
+ className: "Layer__bank-transaction-mobile-list-item__categories_list"
8879
+ }
8880
+ )
8881
+ ] });
8882
+ };
8883
+ const CategorySelectDrawer = ({
8884
+ onSelect,
8885
+ selectedId,
8886
+ showTooltips,
8887
+ isOpen,
8888
+ onOpenChange
8889
+ }) => {
8890
+ return /* @__PURE__ */ jsx(Drawer, { isOpen, onOpenChange, variant: "mobile-drawer", isDismissable: true, children: ({ close: close2 }) => /* @__PURE__ */ jsx(
8891
+ BankTransactionsMobileListBusinessCategories,
8892
+ {
8893
+ select: (option) => {
8894
+ onSelect(option);
8895
+ close2();
8896
+ },
8897
+ selectedId,
8898
+ showTooltips
8899
+ }
8900
+ ) });
8901
+ };
8902
+ const CategorySelectDrawerWithTrigger = ({ value, onChange, showTooltips }) => {
8903
+ var _a;
8904
+ const [isDrawerOpen, setIsDrawerOpen] = useState(false);
8905
+ return /* @__PURE__ */ jsxs(HStack, { fluid: true, children: [
8906
+ /* @__PURE__ */ jsxs(
8907
+ Button,
8908
+ {
8909
+ flex: true,
8910
+ fullWidth: true,
8911
+ "aria-label": "Select category",
8912
+ onClick: () => {
8913
+ setIsDrawerOpen(true);
8914
+ },
8915
+ variant: "outlined",
8916
+ children: [
8917
+ /* @__PURE__ */ jsx(Span, { children: (_a = value == null ? void 0 : value.label) != null ? _a : "Select..." }),
8918
+ /* @__PURE__ */ jsx(Spacer, {}),
8919
+ /* @__PURE__ */ jsx(ChevronDown, { size: 16 })
8920
+ ]
8921
+ }
8922
+ ),
8923
+ /* @__PURE__ */ jsx(
8924
+ CategorySelectDrawer,
8925
+ {
8926
+ onSelect: onChange,
8927
+ selectedId: value == null ? void 0 : value.value,
8928
+ showTooltips,
8929
+ isOpen: isDrawerOpen,
8930
+ onOpenChange: setIsDrawerOpen
8931
+ }
8932
+ )
8933
+ ] });
8934
+ };
8691
8935
  var CategorizationMode = /* @__PURE__ */ ((CategorizationMode2) => {
8692
8936
  CategorizationMode2["Categorize"] = "Categorize";
8693
8937
  CategorizationMode2["Recategorize"] = "Recategorize";
8694
8938
  return CategorizationMode2;
8695
8939
  })(CategorizationMode || {});
8696
- const BankTransactionsCategorizeAllModal = ({ isOpen, onOpenChange, mode }) => {
8940
+ const BankTransactionsCategorizeAllModal = ({
8941
+ isOpen,
8942
+ onOpenChange,
8943
+ mode,
8944
+ useCategorySelectDrawer = false
8945
+ }) => {
8697
8946
  const { count } = useCountSelectedIds();
8698
8947
  const { selectedIds } = useSelectedIds();
8699
8948
  const { clearSelection } = useBulkSelectionActions();
@@ -8735,7 +8984,15 @@ const BankTransactionsCategorizeAllModal = ({ isOpen, onOpenChange, mode }) => {
8735
8984
  content: /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
8736
8985
  /* @__PURE__ */ jsxs(VStack, { gap: "3xs", children: [
8737
8986
  /* @__PURE__ */ jsx(Label, { htmlFor: categorySelectId, children: "Select category" }),
8738
- /* @__PURE__ */ jsx(
8987
+ useCategorySelectDrawer ? /* @__PURE__ */ jsx(
8988
+ CategorySelectDrawerWithTrigger,
8989
+ {
8990
+ "aria-labelledby": categorySelectId,
8991
+ value: selectedCategory,
8992
+ onChange: setSelectedCategory,
8993
+ showTooltips: false
8994
+ }
8995
+ ) : /* @__PURE__ */ jsx(
8739
8996
  BankTransactionCategoryComboBox,
8740
8997
  {
8741
8998
  inputId: categorySelectId,
@@ -8806,7 +9063,7 @@ function buildKey$R({
8806
9063
  }
8807
9064
  const useBulkMatchOrCategorize = () => {
8808
9065
  const { data } = useAuth();
8809
- const { businessId } = useLayerContext();
9066
+ const { businessId, eventCallbacks } = useLayerContext();
8810
9067
  const { selectedIds } = useSelectedIds();
8811
9068
  const { transactionCategories } = useGetAllBankTransactionsCategories();
8812
9069
  const { forceReloadBankTransactions } = useBankTransactionsGlobalCacheActions();
@@ -8834,14 +9091,13 @@ const useBulkMatchOrCategorize = () => {
8834
9091
  const { trigger: originalTrigger } = mutationResponse;
8835
9092
  const stableProxiedTrigger = useCallback(
8836
9093
  (...triggerParameters) => __async(null, null, function* () {
9094
+ var _a;
8837
9095
  const triggerResult = yield originalTrigger(...triggerParameters);
8838
9096
  void forceReloadBankTransactions();
9097
+ (_a = eventCallbacks == null ? void 0 : eventCallbacks.onTransactionCategorized) == null ? void 0 : _a.call(eventCallbacks);
8839
9098
  return triggerResult;
8840
9099
  }),
8841
- [
8842
- originalTrigger,
8843
- forceReloadBankTransactions
8844
- ]
9100
+ [originalTrigger, forceReloadBankTransactions, eventCallbacks]
8845
9101
  );
8846
9102
  const proxiedResponse = new Proxy(mutationResponse, {
8847
9103
  get(target, prop) {
@@ -8902,7 +9158,7 @@ function buildKey$Q({
8902
9158
  }
8903
9159
  const useBulkUncategorize = () => {
8904
9160
  const { data } = useAuth();
8905
- const { businessId } = useLayerContext();
9161
+ const { businessId, eventCallbacks } = useLayerContext();
8906
9162
  const { forceReloadBankTransactions } = useBankTransactionsGlobalCacheActions();
8907
9163
  const mutationResponse = useSWRMutation(
8908
9164
  () => buildKey$Q(__spreadProps(__spreadValues({}, data), {
@@ -8924,11 +9180,13 @@ const useBulkUncategorize = () => {
8924
9180
  const originalTrigger = mutationResponse.trigger;
8925
9181
  const stableProxiedTrigger = useCallback(
8926
9182
  (...triggerParameters) => __async(null, null, function* () {
9183
+ var _a;
8927
9184
  const triggerResult = yield originalTrigger(...triggerParameters);
8928
9185
  void forceReloadBankTransactions();
9186
+ (_a = eventCallbacks == null ? void 0 : eventCallbacks.onTransactionCategorized) == null ? void 0 : _a.call(eventCallbacks);
8929
9187
  return triggerResult;
8930
9188
  }),
8931
- [originalTrigger, forceReloadBankTransactions]
9189
+ [originalTrigger, forceReloadBankTransactions, eventCallbacks]
8932
9190
  );
8933
9191
  return new Proxy(mutationResponse, {
8934
9192
  get(target, prop) {
@@ -8963,7 +9221,7 @@ const BankTransactionsUncategorizeAllModal = ({ isOpen, onOpenChange }) => {
8963
9221
  }
8964
9222
  );
8965
9223
  };
8966
- const BankTransactionsBulkActions = () => {
9224
+ const BankTransactionsBulkActions = ({ useCategorySelectDrawer = false }) => {
8967
9225
  const { display } = useBankTransactionsContext();
8968
9226
  const [categorizeModalOpen, setCategorizeModalOpen] = useState(false);
8969
9227
  const [confirmModalOpen, setConfirmModalOpen] = useState(false);
@@ -8983,7 +9241,8 @@ const BankTransactionsBulkActions = () => {
8983
9241
  {
8984
9242
  isOpen: categorizeModalOpen,
8985
9243
  onOpenChange: setCategorizeModalOpen,
8986
- mode: CategorizationMode.Categorize
9244
+ mode: CategorizationMode.Categorize,
9245
+ useCategorySelectDrawer
8987
9246
  }
8988
9247
  ),
8989
9248
  /* @__PURE__ */ jsx(Button, { variant: "solid", onClick: () => setConfirmModalOpen(true), children: "Confirm" }),
@@ -9008,7 +9267,8 @@ const BankTransactionsBulkActions = () => {
9008
9267
  {
9009
9268
  isOpen: recategorizeModalOpen,
9010
9269
  onOpenChange: setRecategorizeModalOpen,
9011
- mode: CategorizationMode.Recategorize
9270
+ mode: CategorizationMode.Recategorize,
9271
+ useCategorySelectDrawer
9012
9272
  }
9013
9273
  ),
9014
9274
  /* @__PURE__ */ jsx(
@@ -9028,8 +9288,8 @@ const BankTransactionsBulkActions = () => {
9028
9288
  )
9029
9289
  ] }) }) });
9030
9290
  };
9031
- const UploadCloud = (_pa) => {
9032
- var _qa = _pa, { size = 18 } = _qa, props = __objRest(_qa, ["size"]);
9291
+ const UploadCloud = (_xa) => {
9292
+ var _ya = _xa, { size = 18 } = _ya, props = __objRest(_ya, ["size"]);
9033
9293
  return /* @__PURE__ */ jsxs(
9034
9294
  "svg",
9035
9295
  __spreadProps(__spreadValues({
@@ -9411,8 +9671,8 @@ const CopyTemplateHeadersButtonGroup = ({ headers, className }) => {
9411
9671
  key
9412
9672
  )) });
9413
9673
  };
9414
- const CloseIcon = (_ra) => {
9415
- var _sa = _ra, { size = 12 } = _sa, props = __objRest(_sa, ["size"]);
9674
+ const CloseIcon = (_za) => {
9675
+ var _Aa = _za, { size = 12 } = _Aa, props = __objRest(_Aa, ["size"]);
9416
9676
  return /* @__PURE__ */ jsxs(
9417
9677
  "svg",
9418
9678
  __spreadProps(__spreadValues({
@@ -9683,15 +9943,15 @@ function useCreateCustomAccount() {
9683
9943
  }
9684
9944
  const FORM_CLASS_NAME = "Layer__UI__Form";
9685
9945
  const Form = forwardRef(
9686
- function Form2(_ta, ref) {
9687
- var _ua = _ta, { children, className } = _ua, restProps = __objRest(_ua, ["children", "className"]);
9946
+ function Form2(_Ba, ref) {
9947
+ var _Ca = _Ba, { children, className } = _Ca, restProps = __objRest(_Ca, ["children", "className"]);
9688
9948
  return /* @__PURE__ */ jsx(Form$1, __spreadProps(__spreadValues({}, restProps), { className: classNames(FORM_CLASS_NAME, className), ref, children }));
9689
9949
  }
9690
9950
  );
9691
9951
  const TEXT_FIELD_CLASS_NAME = "Layer__UI__TextField";
9692
9952
  const TextField = forwardRef(
9693
- function TextField2(_va, ref) {
9694
- var _wa = _va, { children, inline, textarea, className } = _wa, restProps = __objRest(_wa, ["children", "inline", "textarea", "className"]);
9953
+ function TextField2(_Da, ref) {
9954
+ var _Ea = _Da, { children, inline, textarea, className } = _Ea, restProps = __objRest(_Ea, ["children", "inline", "textarea", "className"]);
9695
9955
  const dataProperties = toDataProperties({ inline, textarea });
9696
9956
  return /* @__PURE__ */ jsx(TextField$1, __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), { className: classNames(TEXT_FIELD_CLASS_NAME, className), ref, children: withRenderProp(children, (node) => node) }));
9697
9957
  }
@@ -9821,8 +10081,8 @@ function formatBigDecimalToString(value, options2 = {
9821
10081
  }
9822
10082
  const INPUT_CLASS_NAME = "Layer__UI__Input";
9823
10083
  const Input$1 = forwardRef(
9824
- function Input2(_xa, ref) {
9825
- var _ya = _xa, { inset, placement } = _ya, restProps = __objRest(_ya, ["inset", "placement"]);
10084
+ function Input2(_Fa, ref) {
10085
+ var _Ga = _Fa, { inset, placement } = _Ga, restProps = __objRest(_Ga, ["inset", "placement"]);
9826
10086
  const dataProperties = toDataProperties({ inset, placement });
9827
10087
  return /* @__PURE__ */ jsx(
9828
10088
  Input$2,
@@ -9833,24 +10093,6 @@ const Input$1 = forwardRef(
9833
10093
  );
9834
10094
  }
9835
10095
  );
9836
- const INPUT_GROUP_CLASS_NAME = "Layer__InputGroup";
9837
- const InputGroup$1 = forwardRef(
9838
- function InputGroup2(_za, ref) {
9839
- var _Aa = _za, { actionCount, className, slots, children } = _Aa, restProps = __objRest(_Aa, ["actionCount", "className", "slots", "children"]);
9840
- const combinedClassName = classNames(INPUT_GROUP_CLASS_NAME, className);
9841
- const dataProperties = toDataProperties({
9842
- "action-count": actionCount
9843
- });
9844
- return /* @__PURE__ */ jsx(
9845
- Group,
9846
- __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), {
9847
- className: combinedClassName,
9848
- ref,
9849
- children
9850
- })
9851
- );
9852
- }
9853
- );
9854
10096
  const DEFAULT_MAX_VALUE = BigDecimal.fromBigInt(BigInt(1e7));
9855
10097
  const DEFAULT_MIN_DECIMAL_PLACES = 0;
9856
10098
  const DEFAULT_MAX_DECIMAL_PLACES = 3;
@@ -9863,21 +10105,23 @@ const withForceUpdate = (value) => {
9863
10105
  writable: false
9864
10106
  });
9865
10107
  };
9866
- function FormBigDecimalField(_Ba) {
9867
- var _Ca = _Ba, {
10108
+ function FormBigDecimalField(_Ha) {
10109
+ var _Ia = _Ha, {
9868
10110
  mode = "decimal",
9869
10111
  allowNegative = false,
9870
10112
  maxValue = mode === "percent" ? BIG_DECIMAL_ONE : DEFAULT_MAX_VALUE,
9871
10113
  minDecimalPlaces = mode === "currency" ? 2 : DEFAULT_MIN_DECIMAL_PLACES,
9872
10114
  maxDecimalPlaces = mode === "currency" ? 2 : DEFAULT_MAX_DECIMAL_PLACES,
9873
- slots
9874
- } = _Ca, restProps = __objRest(_Ca, [
10115
+ slots,
10116
+ placeholder
10117
+ } = _Ia, restProps = __objRest(_Ia, [
9875
10118
  "mode",
9876
10119
  "allowNegative",
9877
10120
  "maxValue",
9878
10121
  "minDecimalPlaces",
9879
10122
  "maxDecimalPlaces",
9880
- "slots"
10123
+ "slots",
10124
+ "placeholder"
9881
10125
  ]);
9882
10126
  const field = useFieldContext();
9883
10127
  const { name, state, handleChange, handleBlur } = field;
@@ -9937,20 +10181,21 @@ function FormBigDecimalField(_Ba) {
9937
10181
  onChange: onInputChange,
9938
10182
  onBlur: onInputBlur,
9939
10183
  onBeforeInput,
9940
- onPaste
10184
+ onPaste,
10185
+ placeholder
9941
10186
  }
9942
10187
  ),
9943
10188
  (slots == null ? void 0 : slots.badge) && /* @__PURE__ */ jsx(HStack, { children: slots.badge })
9944
10189
  ] }) }));
9945
10190
  }
9946
- const CLASS_NAME$a = "Layer__Checkbox";
10191
+ const CLASS_NAME$7 = "Layer__Checkbox";
9947
10192
  const CHECK_SIZE = {
9948
10193
  sm: 12,
9949
10194
  md: 14,
9950
10195
  lg: 16
9951
10196
  };
9952
- function Checkbox(_Da) {
9953
- var _Ea = _Da, { children, className, variant = "default", size = "sm", isIndeterminate } = _Ea, props = __objRest(_Ea, ["children", "className", "variant", "size", "isIndeterminate"]);
10197
+ function Checkbox(_Ja) {
10198
+ var _Ka = _Ja, { children, className, variant = "default", size = "sm", isIndeterminate } = _Ka, props = __objRest(_Ka, ["children", "className", "variant", "size", "isIndeterminate"]);
9954
10199
  const dataProperties = useMemo(() => toDataProperties({
9955
10200
  size,
9956
10201
  variant,
@@ -9960,7 +10205,7 @@ function Checkbox(_Da) {
9960
10205
  Checkbox$1,
9961
10206
  __spreadProps(__spreadValues(__spreadValues({}, dataProperties), props), {
9962
10207
  isIndeterminate,
9963
- className: classNames(CLASS_NAME$a, className),
10208
+ className: classNames(CLASS_NAME$7, className),
9964
10209
  children: withRenderProp(children, (node) => /* @__PURE__ */ jsxs(Fragment, { children: [
9965
10210
  /* @__PURE__ */ jsx("div", { slot: "checkbox", children: isIndeterminate ? /* @__PURE__ */ jsx(Minus, { size: CHECK_SIZE[size] }) : /* @__PURE__ */ jsx(Check$1, { size: CHECK_SIZE[size] }) }),
9966
10211
  node
@@ -9968,8 +10213,8 @@ function Checkbox(_Da) {
9968
10213
  })
9969
10214
  );
9970
10215
  }
9971
- function CheckboxWithTooltip(_Fa) {
9972
- var _Ga = _Fa, { tooltip } = _Ga, props = __objRest(_Ga, ["tooltip"]);
10216
+ function CheckboxWithTooltip(_La) {
10217
+ var _Ma = _La, { tooltip } = _Ma, props = __objRest(_Ma, ["tooltip"]);
9973
10218
  return /* @__PURE__ */ jsx("div", { className: "Layer__checkbox-wrapper", children: /* @__PURE__ */ jsxs(DeprecatedTooltip, { disabled: !tooltip, children: [
9974
10219
  /* @__PURE__ */ jsx(DeprecatedTooltipTrigger, { className: "Layer__input-tooltip", children: /* @__PURE__ */ jsx(Checkbox, __spreadValues({}, props)) }),
9975
10220
  /* @__PURE__ */ jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", children: tooltip })
@@ -10015,8 +10260,8 @@ function FormCheckboxField({
10015
10260
  }
10016
10261
  const DATE_FIELD_CLASS_NAME = "Layer__UI__DateField";
10017
10262
  const DateField = forwardRef(
10018
- function DateField2(_Ha, ref) {
10019
- var _Ia = _Ha, { inline, className, isReadOnly } = _Ia, restProps = __objRest(_Ia, ["inline", "className", "isReadOnly"]);
10263
+ function DateField2(_Na, ref) {
10264
+ var _Oa = _Na, { inline, className, isReadOnly } = _Oa, restProps = __objRest(_Oa, ["inline", "className", "isReadOnly"]);
10020
10265
  const dataProperties = toDataProperties({ inline, readonly: isReadOnly });
10021
10266
  return /* @__PURE__ */ jsx(
10022
10267
  DateField$1,
@@ -10030,8 +10275,8 @@ const DateField = forwardRef(
10030
10275
  );
10031
10276
  const DATE_INPUT_CLASS_NAME = "Layer__UI__DateInput";
10032
10277
  const DateInput = forwardRef(
10033
- function DateInput2(_Ja, ref) {
10034
- var _Ka = _Ja, { inset, pointerEvents } = _Ka, restProps = __objRest(_Ka, ["inset", "pointerEvents"]);
10278
+ function DateInput2(_Pa, ref) {
10279
+ var _Qa = _Pa, { inset, pointerEvents } = _Qa, restProps = __objRest(_Qa, ["inset", "pointerEvents"]);
10035
10280
  const dataProperties = toDataProperties({ inset, "pointer-events": pointerEvents });
10036
10281
  return /* @__PURE__ */ jsx(
10037
10282
  DateInput$1,
@@ -10044,8 +10289,8 @@ const DateInput = forwardRef(
10044
10289
  );
10045
10290
  const DATE_SEGMENT_CLASS_NAME = "Layer__UI__DateSegment";
10046
10291
  const DateSegment = forwardRef(
10047
- function DateSegment2(_La, ref) {
10048
- var _Ma = _La, { isReadOnly } = _Ma, restProps = __objRest(_Ma, ["isReadOnly"]);
10292
+ function DateSegment2(_Ra, ref) {
10293
+ var _Sa = _Ra, { isReadOnly } = _Sa, restProps = __objRest(_Sa, ["isReadOnly"]);
10049
10294
  const dataProperties = toDataProperties({ interactive: !isReadOnly });
10050
10295
  return /* @__PURE__ */ jsx(
10051
10296
  DateSegment$1,
@@ -10126,8 +10371,8 @@ function FormDateField({
10126
10371
  }
10127
10372
  const NUMBER_FIELD_CLASS_NAME = "Layer__UI__NumberField";
10128
10373
  const NumberField = forwardRef(
10129
- function NumberField2(_Na, ref) {
10130
- var _Oa = _Na, { inline, className, isReadOnly } = _Oa, restProps = __objRest(_Oa, ["inline", "className", "isReadOnly"]);
10374
+ function NumberField2(_Ta, ref) {
10375
+ var _Ua = _Ta, { inline, className, isReadOnly } = _Ua, restProps = __objRest(_Ua, ["inline", "className", "isReadOnly"]);
10131
10376
  const dataProperties = toDataProperties({ inline, readonly: isReadOnly });
10132
10377
  return /* @__PURE__ */ jsx(
10133
10378
  NumberField$1,
@@ -10149,7 +10394,8 @@ function FormNumberField({
10149
10394
  showFieldError = true,
10150
10395
  isReadOnly = false,
10151
10396
  minValue,
10152
- maxValue
10397
+ maxValue,
10398
+ placeholder
10153
10399
  }) {
10154
10400
  const field = useFieldContext();
10155
10401
  const { name, state, handleChange, handleBlur } = field;
@@ -10187,7 +10433,7 @@ function FormNumberField({
10187
10433
  children: label
10188
10434
  })
10189
10435
  ),
10190
- /* @__PURE__ */ jsx(InputGroup$1, { slot: "input", children: /* @__PURE__ */ jsx(Input$1, { inset: true }) }),
10436
+ /* @__PURE__ */ jsx(InputGroup$1, { slot: "input", children: /* @__PURE__ */ jsx(Input$1, { inset: true, placeholder }) }),
10191
10437
  shouldShowErrorMessage && /* @__PURE__ */ jsx(FieldError, { children: errorMessage })
10192
10438
  ]
10193
10439
  })
@@ -10195,8 +10441,8 @@ function FormNumberField({
10195
10441
  }
10196
10442
  const TEXTAREA_CLASS_NAME = "Layer__UI__TextArea";
10197
10443
  const TextArea = forwardRef(
10198
- function TextArea2(_Pa, ref) {
10199
- var _Qa = _Pa, { resize = "none" } = _Qa, restProps = __objRest(_Qa, ["resize"]);
10444
+ function TextArea2(_Va, ref) {
10445
+ var _Wa = _Va, { resize = "none" } = _Wa, restProps = __objRest(_Wa, ["resize"]);
10200
10446
  const dataProperties = toDataProperties({ resize });
10201
10447
  return /* @__PURE__ */ jsx(
10202
10448
  TextArea$1,
@@ -10207,7 +10453,8 @@ const TextArea = forwardRef(
10207
10453
  );
10208
10454
  }
10209
10455
  );
10210
- function FormTextAreaField(props) {
10456
+ function FormTextAreaField(_Xa) {
10457
+ var _Ya = _Xa, { placeholder } = _Ya, props = __objRest(_Ya, ["placeholder"]);
10211
10458
  const field = useFieldContext();
10212
10459
  const { name, state, handleChange, handleBlur } = field;
10213
10460
  const { value } = state;
@@ -10222,11 +10469,13 @@ function FormTextAreaField(props) {
10222
10469
  name,
10223
10470
  value,
10224
10471
  onChange,
10225
- onBlur: handleBlur
10472
+ onBlur: handleBlur,
10473
+ placeholder
10226
10474
  }
10227
10475
  ) }));
10228
10476
  }
10229
- function FormTextField(props) {
10477
+ function FormTextField(_Za) {
10478
+ var __a = _Za, { placeholder } = __a, props = __objRest(__a, ["placeholder"]);
10230
10479
  const field = useFieldContext();
10231
10480
  const { name, state, handleChange, handleBlur } = field;
10232
10481
  const { value } = state;
@@ -10241,6 +10490,7 @@ function FormTextField(props) {
10241
10490
  value,
10242
10491
  onChange,
10243
10492
  onBlur: handleBlur,
10493
+ placeholder,
10244
10494
  inset: true
10245
10495
  }
10246
10496
  ) }) }));
@@ -10313,13 +10563,13 @@ const useCustomAccountForm = ({ onSuccess }) => {
10313
10563
  const isFormValid = useStore$1(form.store, (state) => state.isValid);
10314
10564
  return { form, submitError, isFormValid };
10315
10565
  };
10316
- const Input = (_Ra) => {
10317
- var _Sa = _Ra, {
10566
+ const Input = (_$a) => {
10567
+ var _ab = _$a, {
10318
10568
  className,
10319
10569
  isInvalid,
10320
10570
  errorMessage,
10321
10571
  leftText
10322
- } = _Sa, props = __objRest(_Sa, [
10572
+ } = _ab, props = __objRest(_ab, [
10323
10573
  "className",
10324
10574
  "isInvalid",
10325
10575
  "errorMessage",
@@ -10365,8 +10615,8 @@ const InputGroup = ({
10365
10615
  children
10366
10616
  ] });
10367
10617
  };
10368
- const ChevronDownFill = (_Ta) => {
10369
- var _Ua = _Ta, { size = 18 } = _Ua, props = __objRest(_Ua, ["size"]);
10618
+ const ChevronDownFill = (_bb) => {
10619
+ var _cb = _bb, { size = 18 } = _cb, props = __objRest(_cb, ["size"]);
10370
10620
  return /* @__PURE__ */ jsxs(
10371
10621
  "svg",
10372
10622
  __spreadProps(__spreadValues({
@@ -10435,8 +10685,8 @@ const Select = ({
10435
10685
  /* @__PURE__ */ jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", children: errorMessage })
10436
10686
  ] });
10437
10687
  };
10438
- const ErrorText = (_Va) => {
10439
- var _Wa = _Va, { className } = _Wa, props = __objRest(_Wa, ["className"]);
10688
+ const ErrorText = (_db) => {
10689
+ var _eb = _db, { className } = _eb, props = __objRest(_eb, ["className"]);
10440
10690
  return /* @__PURE__ */ jsx(Text, __spreadProps(__spreadValues({}, props), { status: "error", className }));
10441
10691
  };
10442
10692
  const accountTypeOptions = [
@@ -11269,44 +11519,10 @@ const BankTransactionsHeaderMenu = ({ actions, isDisabled }) => {
11269
11519
  isModalOpen && /* @__PURE__ */ jsx(BankTransactionsUploadModal, { isOpen: true, onOpenChange: setIsModalOpen })
11270
11520
  ] });
11271
11521
  };
11272
- const CLASS_NAME$9 = "Layer__BankTransactionsActions";
11522
+ const CLASS_NAME$6 = "Layer__BankTransactionsActions";
11273
11523
  function BankTransactionsActions({ children }) {
11274
- return /* @__PURE__ */ jsx("div", { className: CLASS_NAME$9, children });
11524
+ return /* @__PURE__ */ jsx("div", { className: CLASS_NAME$6, children });
11275
11525
  }
11276
- const X = (_Xa) => {
11277
- var _Ya = _Xa, { size = 18 } = _Ya, props = __objRest(_Ya, ["size"]);
11278
- return /* @__PURE__ */ jsxs(
11279
- "svg",
11280
- __spreadProps(__spreadValues({
11281
- xmlns: "http://www.w3.org/2000/svg",
11282
- viewBox: "0 0 18 18",
11283
- fill: "none"
11284
- }, props), {
11285
- width: size,
11286
- height: size,
11287
- children: [
11288
- /* @__PURE__ */ jsx(
11289
- "path",
11290
- {
11291
- d: "M13.5 4.5L4.5 13.5",
11292
- stroke: "currentColor",
11293
- strokeLinecap: "round",
11294
- strokeLinejoin: "round"
11295
- }
11296
- ),
11297
- /* @__PURE__ */ jsx(
11298
- "path",
11299
- {
11300
- d: "M4.5 4.5L13.5 13.5",
11301
- stroke: "currentColor",
11302
- strokeLinecap: "round",
11303
- strokeLinejoin: "round"
11304
- }
11305
- )
11306
- ]
11307
- })
11308
- );
11309
- };
11310
11526
  const BulkActionsModule = ({ slots }) => {
11311
11527
  const { count } = useCountSelectedIds();
11312
11528
  const { clearSelection } = useBulkSelectionActions();
@@ -11328,8 +11544,8 @@ const BulkActionsModule = ({ slots }) => {
11328
11544
  /* @__PURE__ */ jsx(slots.BulkActions, {})
11329
11545
  ] });
11330
11546
  };
11331
- const DownloadCloud = (_Za) => {
11332
- var __a = _Za, { size = 18 } = __a, props = __objRest(__a, ["size"]);
11547
+ const DownloadCloud = (_fb) => {
11548
+ var _gb = _fb, { size = 18 } = _gb, props = __objRest(_gb, ["size"]);
11333
11549
  return /* @__PURE__ */ jsxs(
11334
11550
  "svg",
11335
11551
  __spreadProps(__spreadValues({
@@ -11453,29 +11669,6 @@ function useSizeClass() {
11453
11669
  isDesktop: sizeClass === "desktop"
11454
11670
  };
11455
11671
  }
11456
- const ChevronDown = (_$a) => {
11457
- var _ab = _$a, { size = 18 } = _ab, props = __objRest(_ab, ["size"]);
11458
- return /* @__PURE__ */ jsx(
11459
- "svg",
11460
- __spreadProps(__spreadValues({
11461
- viewBox: "0 0 18 18",
11462
- fill: "none",
11463
- xmlns: "http://www.w3.org/2000/svg"
11464
- }, props), {
11465
- width: size,
11466
- height: size,
11467
- children: /* @__PURE__ */ jsx(
11468
- "path",
11469
- {
11470
- d: "M4.5 6.75L9 11.25L13.5 6.75",
11471
- stroke: "currentColor",
11472
- strokeLinecap: "round",
11473
- strokeLinejoin: "round"
11474
- }
11475
- )
11476
- })
11477
- );
11478
- };
11479
11672
  const MONTHS = [
11480
11673
  "January",
11481
11674
  "February",
@@ -11604,8 +11797,8 @@ function MonthCalendar({
11604
11797
  const POPOVER_CLASS_NAME = "Layer__Popover";
11605
11798
  const POPOVER_CLASS_NAMES = `Layer__Portal ${POPOVER_CLASS_NAME}`;
11606
11799
  const Popover = forwardRef(
11607
- function Popover2(_bb, ref) {
11608
- var _cb = _bb, { flexInline = false } = _cb, restProps = __objRest(_cb, ["flexInline"]);
11800
+ function Popover2(_hb, ref) {
11801
+ var _ib = _hb, { flexInline = false } = _ib, restProps = __objRest(_ib, ["flexInline"]);
11609
11802
  const dataProperties = toDataProperties({ "flex-inline": flexInline });
11610
11803
  return /* @__PURE__ */ jsx(
11611
11804
  Popover$1,
@@ -11675,42 +11868,6 @@ const MonthPicker = ({
11675
11868
  ) }) })
11676
11869
  ] });
11677
11870
  };
11678
- const CLASS_NAME$8 = "Layer__MinimalSearchField";
11679
- function MinimalSearchField(_db) {
11680
- var _eb = _db, {
11681
- placeholder,
11682
- isDisabled
11683
- } = _eb, restProps = __objRest(_eb, [
11684
- "placeholder",
11685
- "isDisabled"
11686
- ]);
11687
- return /* @__PURE__ */ jsxs(SearchField$1, __spreadProps(__spreadValues({}, restProps), { isDisabled, className: CLASS_NAME$8, children: [
11688
- /* @__PURE__ */ jsx(
11689
- Input$2,
11690
- {
11691
- slot: "input",
11692
- placeholder
11693
- }
11694
- ),
11695
- /* @__PURE__ */ jsx(Button, { slot: "clear-button", inset: true, icon: true, variant: "ghost", "aria-label": "Clear search", children: /* @__PURE__ */ jsx(X, {}) })
11696
- ] }));
11697
- }
11698
- const CLASS_NAME$7 = "Layer__SearchField";
11699
- function SearchField(_fb) {
11700
- var _gb = _fb, { slot = "search", className, label, isDisabled } = _gb, restProps = __objRest(_gb, ["slot", "className", "label", "isDisabled"]);
11701
- const combinedClassName = classNames(CLASS_NAME$7, className);
11702
- return /* @__PURE__ */ jsxs(InputGroup$1, { slot, className: combinedClassName, children: [
11703
- /* @__PURE__ */ jsx(VStack, { slot: "icon", align: "center", justify: "center", className: "Layer__SearchField__Icon", "data-disabled": isDisabled || void 0, children: /* @__PURE__ */ jsx(Search, { size: 14 }) }),
11704
- /* @__PURE__ */ jsx(
11705
- MinimalSearchField,
11706
- __spreadProps(__spreadValues({}, restProps), {
11707
- placeholder: label,
11708
- "aria-label": label,
11709
- isDisabled
11710
- })
11711
- )
11712
- ] });
11713
- }
11714
11871
  const SmallLoader = ({ size = 28 }) => {
11715
11872
  return /* @__PURE__ */ jsx(
11716
11873
  "span",
@@ -11953,7 +12110,7 @@ function useInvisibleDownload() {
11953
12110
  }, []);
11954
12111
  return { invisibleDownloadRef, triggerInvisibleDownload };
11955
12112
  }
11956
- const CLASS_NAME$6 = "Layer__InvisibleDownload";
12113
+ const CLASS_NAME$5 = "Layer__InvisibleDownload";
11957
12114
  const InvisibleDownload = forwardRef((_props, ref) => {
11958
12115
  const internalRef = useRef(null);
11959
12116
  useImperativeHandle(ref, () => ({
@@ -11972,7 +12129,7 @@ const InvisibleDownload = forwardRef((_props, ref) => {
11972
12129
  const handleContainClick = useCallback((event) => {
11973
12130
  event.stopPropagation();
11974
12131
  }, []);
11975
- return /* @__PURE__ */ jsx("a", { download: true, className: CLASS_NAME$6, ref: internalRef, onClick: handleContainClick });
12132
+ return /* @__PURE__ */ jsx("a", { download: true, className: CLASS_NAME$5, ref: internalRef, onClick: handleContainClick });
11976
12133
  });
11977
12134
  InvisibleDownload.displayName = "InvisibleDownload";
11978
12135
  function TransactionsSearch({ slot, isDisabled }) {
@@ -12119,6 +12276,9 @@ const BankTransactionsHeader = ({
12119
12276
  }
12120
12277
  return actions;
12121
12278
  }, [withUploadMenu, showCategorizationRules]);
12279
+ const BulkActionsModuleSlot = useCallback(() => {
12280
+ return /* @__PURE__ */ jsx(BankTransactionsBulkActions, { useCategorySelectDrawer: listView && mobileComponent === "mobileList" });
12281
+ }, [listView, mobileComponent]);
12122
12282
  return /* @__PURE__ */ jsxs(
12123
12283
  Header$1,
12124
12284
  {
@@ -12134,7 +12294,7 @@ const BankTransactionsHeader = ({
12134
12294
  showBulkActions ? /* @__PURE__ */ jsx(
12135
12295
  BulkActionsModule,
12136
12296
  {
12137
- slots: { BulkActions: BankTransactionsBulkActions }
12297
+ slots: { BulkActions: BulkActionsModuleSlot }
12138
12298
  }
12139
12299
  ) : /* @__PURE__ */ jsxs(HStack, { slot: "toggle", justify: "center", gap: "xs", children: [
12140
12300
  collapseHeader && headerTopRow,
@@ -12169,8 +12329,8 @@ const BankTransactionsHeader = ({
12169
12329
  }
12170
12330
  );
12171
12331
  };
12172
- const Inbox = (_hb) => {
12173
- var _ib = _hb, { size = 18 } = _ib, props = __objRest(_ib, ["size"]);
12332
+ const Inbox = (_jb) => {
12333
+ var _kb = _jb, { size = 18 } = _kb, props = __objRest(_kb, ["size"]);
12174
12334
  return /* @__PURE__ */ jsxs(
12175
12335
  "svg",
12176
12336
  __spreadProps(__spreadValues({
@@ -12652,8 +12812,8 @@ function asMutable(a) {
12652
12812
  const CSS_PREFIX$1 = "Layer__UI__Table";
12653
12813
  const getClassName = (component, additionalClassNames, withHidden) => classNames(`${CSS_PREFIX$1}-${component}`, withHidden && `${CSS_PREFIX$1}-${component}--hidden`, additionalClassNames);
12654
12814
  const Table$1 = forwardRef(
12655
- (_jb, ref) => {
12656
- var _kb = _jb, { children, className } = _kb, restProps = __objRest(_kb, ["children", "className"]);
12815
+ (_lb, ref) => {
12816
+ var _mb = _lb, { children, className } = _mb, restProps = __objRest(_mb, ["children", "className"]);
12657
12817
  return /* @__PURE__ */ jsx(
12658
12818
  Table$2,
12659
12819
  __spreadProps(__spreadValues({
@@ -12666,8 +12826,8 @@ const Table$1 = forwardRef(
12666
12826
  }
12667
12827
  );
12668
12828
  Table$1.displayName = "Table";
12669
- const TableHeaderInner = (_lb, ref) => {
12670
- var _mb = _lb, { children, className, hideHeader } = _mb, restProps = __objRest(_mb, ["children", "className", "hideHeader"]);
12829
+ const TableHeaderInner = (_nb, ref) => {
12830
+ var _ob = _nb, { children, className, hideHeader } = _ob, restProps = __objRest(_ob, ["children", "className", "hideHeader"]);
12671
12831
  return /* @__PURE__ */ jsx(
12672
12832
  TableHeader$1,
12673
12833
  __spreadProps(__spreadValues({
@@ -12680,8 +12840,8 @@ const TableHeaderInner = (_lb, ref) => {
12680
12840
  };
12681
12841
  const TableHeader = forwardRef(TableHeaderInner);
12682
12842
  TableHeader.displayName = "TableHeader";
12683
- const TableBodyInner = (_nb, ref) => {
12684
- var _ob = _nb, { children, className } = _ob, restProps = __objRest(_ob, ["children", "className"]);
12843
+ const TableBodyInner = (_pb, ref) => {
12844
+ var _qb = _pb, { children, className } = _qb, restProps = __objRest(_qb, ["children", "className"]);
12685
12845
  return /* @__PURE__ */ jsx(
12686
12846
  TableBody$2,
12687
12847
  __spreadProps(__spreadValues({
@@ -12694,8 +12854,8 @@ const TableBodyInner = (_nb, ref) => {
12694
12854
  };
12695
12855
  const TableBody$1 = forwardRef(TableBodyInner);
12696
12856
  TableBody$1.displayName = "TableBody";
12697
- const RowInner = (_pb, ref) => {
12698
- var _qb = _pb, { children, className, depth = 0 } = _qb, restProps = __objRest(_qb, ["children", "className", "depth"]);
12857
+ const RowInner = (_rb, ref) => {
12858
+ var _sb = _rb, { children, className, depth = 0 } = _sb, restProps = __objRest(_sb, ["children", "className", "depth"]);
12699
12859
  const dataProperties = toDataProperties({ depth });
12700
12860
  return /* @__PURE__ */ jsx(
12701
12861
  Row$1,
@@ -12710,8 +12870,8 @@ const RowInner = (_pb, ref) => {
12710
12870
  const Row = forwardRef(RowInner);
12711
12871
  Row.displayName = "Row";
12712
12872
  const Column = forwardRef(
12713
- (_rb, ref) => {
12714
- var _sb = _rb, { children, className, textAlign = "left" } = _sb, restProps = __objRest(_sb, ["children", "className", "textAlign"]);
12873
+ (_tb, ref) => {
12874
+ var _ub = _tb, { children, className, textAlign = "left" } = _ub, restProps = __objRest(_ub, ["children", "className", "textAlign"]);
12715
12875
  const dataProperties = toDataProperties({ "text-align": textAlign });
12716
12876
  return /* @__PURE__ */ jsx(
12717
12877
  Column$1,
@@ -12726,8 +12886,8 @@ const Column = forwardRef(
12726
12886
  );
12727
12887
  Column.displayName = "Column";
12728
12888
  const Cell = forwardRef(
12729
- (_tb, ref) => {
12730
- var _ub = _tb, { children, className } = _ub, restProps = __objRest(_ub, ["children", "className"]);
12889
+ (_vb, ref) => {
12890
+ var _wb = _vb, { children, className } = _wb, restProps = __objRest(_wb, ["children", "className"]);
12731
12891
  return /* @__PURE__ */ jsx(
12732
12892
  Cell$1,
12733
12893
  __spreadProps(__spreadValues({
@@ -13104,8 +13264,8 @@ function useDelayedVisibility({
13104
13264
  );
13105
13265
  return { isVisible };
13106
13266
  }
13107
- const File = (_vb) => {
13108
- var _wb = _vb, { size = 12 } = _wb, props = __objRest(_wb, ["size"]);
13267
+ const File = (_xb) => {
13268
+ var _yb = _xb, { size = 12 } = _yb, props = __objRest(_yb, ["size"]);
13109
13269
  return /* @__PURE__ */ jsxs(
13110
13270
  "svg",
13111
13271
  __spreadProps(__spreadValues({
@@ -13165,6 +13325,57 @@ const File = (_vb) => {
13165
13325
  })
13166
13326
  );
13167
13327
  };
13328
+ const variants = {
13329
+ fade: {
13330
+ initial: { opacity: 0 },
13331
+ animate: { opacity: 1 },
13332
+ exit: { opacity: 0 },
13333
+ transition: { duration: 0.3, ease: [0, 0, 0.58, 1] }
13334
+ },
13335
+ slideUp: {
13336
+ initial: { y: "100%" },
13337
+ animate: { y: 0 },
13338
+ exit: { y: "100%" },
13339
+ transition: { duration: 0.35, ease: [0.4, 0, 0.2, 1] }
13340
+ },
13341
+ expand: {
13342
+ initial: { height: 0, opacity: 0 },
13343
+ animate: { height: "auto", opacity: 1 },
13344
+ exit: { height: 0, opacity: 0 },
13345
+ transition: {
13346
+ height: { duration: 0.25, ease: [0.4, 0, 0.2, 1] },
13347
+ opacity: { duration: 0.15, ease: [0, 0, 0.58, 1] }
13348
+ }
13349
+ }
13350
+ };
13351
+ const AnimatedPresenceDiv = (_zb) => {
13352
+ var _Ab = _zb, {
13353
+ children,
13354
+ variant,
13355
+ isOpen,
13356
+ slotProps = { AnimatePresence: { initial: false } },
13357
+ key
13358
+ } = _Ab, props = __objRest(_Ab, [
13359
+ "children",
13360
+ "variant",
13361
+ "isOpen",
13362
+ "slotProps",
13363
+ "key"
13364
+ ]);
13365
+ const config = variants[variant];
13366
+ return /* @__PURE__ */ jsx(AnimatePresence, __spreadProps(__spreadValues({}, slotProps.AnimatePresence), { children: isOpen && /* @__PURE__ */ jsx(
13367
+ motion.div,
13368
+ __spreadProps(__spreadValues({
13369
+ initial: config.initial,
13370
+ animate: config.animate,
13371
+ exit: config.exit,
13372
+ transition: config.transition
13373
+ }, props), {
13374
+ children
13375
+ }),
13376
+ key
13377
+ ) }));
13378
+ };
13168
13379
  function isActiveBookkeepingStatus(status) {
13169
13380
  return status === BookkeepingStatus$2.ACTIVE || status === BookkeepingStatus$2.ONBOARDING;
13170
13381
  }
@@ -13264,29 +13475,8 @@ function useBookkeepingPeriods() {
13264
13475
  }
13265
13476
  });
13266
13477
  }
13267
- const monthNames = [
13268
- "January",
13269
- "February",
13270
- "March",
13271
- "April",
13272
- "May",
13273
- "June",
13274
- "July",
13275
- "August",
13276
- "September",
13277
- "October",
13278
- "November",
13279
- "December"
13280
- ];
13281
- const getMonthNameFromNumber = (monthNumber) => {
13282
- var _a;
13283
- if (monthNumber < 1 || monthNumber > 12) {
13284
- return "";
13285
- }
13286
- return (_a = monthNames.at(monthNumber - 1)) != null ? _a : "";
13287
- };
13288
- const Clock = (_xb) => {
13289
- var _yb = _xb, { size = 18 } = _yb, props = __objRest(_yb, ["size"]);
13478
+ const Clock = (_Bb) => {
13479
+ var _Cb = _Bb, { size = 18 } = _Cb, props = __objRest(_Cb, ["size"]);
13290
13480
  return /* @__PURE__ */ jsxs(
13291
13481
  "svg",
13292
13482
  __spreadProps(__spreadValues({
@@ -13311,6 +13501,27 @@ const Clock = (_xb) => {
13311
13501
  })
13312
13502
  );
13313
13503
  };
13504
+ const monthNames = [
13505
+ "January",
13506
+ "February",
13507
+ "March",
13508
+ "April",
13509
+ "May",
13510
+ "June",
13511
+ "July",
13512
+ "August",
13513
+ "September",
13514
+ "October",
13515
+ "November",
13516
+ "December"
13517
+ ];
13518
+ const getMonthNameFromNumber = (monthNumber) => {
13519
+ var _a;
13520
+ if (monthNumber < 1 || monthNumber > 12) {
13521
+ return "";
13522
+ }
13523
+ return (_a = monthNames.at(monthNumber - 1)) != null ? _a : "";
13524
+ };
13314
13525
  function getBookkeepingStatusConfig({
13315
13526
  status,
13316
13527
  monthNumber,
@@ -13379,10 +13590,24 @@ const BookkeepingStatus$1 = ({ status, text, monthNumber, iconOnly }) => {
13379
13590
  )
13380
13591
  ] }));
13381
13592
  };
13382
- const BankTransactionsProcessingInfo = () => /* @__PURE__ */ jsxs(DeprecatedTooltip, { offset: 12, children: [
13383
- /* @__PURE__ */ jsx(DeprecatedTooltipTrigger, { children: /* @__PURE__ */ jsx(BookkeepingStatus$1, { status: BookkeepingPeriodStatus.IN_PROGRESS_AWAITING_BOOKKEEPER, text: "Processing" }) }),
13384
- /* @__PURE__ */ jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", width: "md", children: "Our team will review and categorize this transaction. We'll reach out if we have any questions about it." })
13385
- ] });
13593
+ const BankTransactionsProcessingInfo = ({ showAsBadge = false }) => {
13594
+ const tooltipContent = "Our team will review and categorize this transaction. We'll reach out if we have any questions about it.";
13595
+ if (showAsBadge) {
13596
+ return /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", fluid: true, className: "Layer__BankTransactionsProcessingInfo", children: /* @__PURE__ */ jsx(
13597
+ Badge,
13598
+ {
13599
+ size: BadgeSize.SMALL,
13600
+ icon: /* @__PURE__ */ jsx(Clock, { size: 11 }),
13601
+ variant: BadgeVariant.INFO,
13602
+ children: "Processing"
13603
+ }
13604
+ ) });
13605
+ }
13606
+ return /* @__PURE__ */ jsxs(DeprecatedTooltip, { offset: 12, children: [
13607
+ /* @__PURE__ */ jsx(DeprecatedTooltipTrigger, { children: /* @__PURE__ */ jsx(BookkeepingStatus$1, { status: BookkeepingPeriodStatus.IN_PROGRESS_AWAITING_BOOKKEEPER, text: "Processing" }) }),
13608
+ /* @__PURE__ */ jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", width: "md", children: tooltipContent })
13609
+ ] });
13610
+ };
13386
13611
  const isSplitsValid = (localSplits) => {
13387
13612
  return validateSplit(localSplits).reduce((acc, splitError) => acc && splitError === void 0, true);
13388
13613
  };
@@ -13577,8 +13802,8 @@ const useSplitsForm = ({
13577
13802
  saveLocalSplitsToCategoryStore
13578
13803
  };
13579
13804
  };
13580
- const ScissorsFullOpen = (_zb) => {
13581
- var _Ab = _zb, { size = 12 } = _Ab, props = __objRest(_Ab, ["size"]);
13805
+ const ScissorsFullOpen = (_Db) => {
13806
+ var _Eb = _Db, { size = 12 } = _Eb, props = __objRest(_Eb, ["size"]);
13582
13807
  return /* @__PURE__ */ jsx(
13583
13808
  "svg",
13584
13809
  __spreadProps(__spreadValues({
@@ -13643,8 +13868,8 @@ const ScissorsFullOpen = (_zb) => {
13643
13868
  })
13644
13869
  );
13645
13870
  };
13646
- const Trash = (_Bb) => {
13647
- var _Cb = _Bb, { size = 18 } = _Cb, props = __objRest(_Cb, ["size"]);
13871
+ const Trash = (_Fb) => {
13872
+ var _Gb = _Fb, { size = 18 } = _Gb, props = __objRest(_Gb, ["size"]);
13648
13873
  return /* @__PURE__ */ jsxs(
13649
13874
  "svg",
13650
13875
  __spreadProps(__spreadValues({
@@ -13839,8 +14064,8 @@ const ReceiptsProvider = ({
13839
14064
  const contextData = useReceipts({ bankTransaction, isActive });
13840
14065
  return /* @__PURE__ */ jsx(ReceiptsContext.Provider, { value: contextData, children });
13841
14066
  };
13842
- const Eye = (_Db) => {
13843
- var _Eb = _Db, { size = 18 } = _Eb, props = __objRest(_Eb, ["size"]);
14067
+ const Eye = (_Hb) => {
14068
+ var _Ib = _Hb, { size = 18 } = _Ib, props = __objRest(_Ib, ["size"]);
13844
14069
  return /* @__PURE__ */ jsx(
13845
14070
  "svg",
13846
14071
  __spreadProps(__spreadValues({
@@ -13976,11 +14201,11 @@ const FileThumb = ({
13976
14201
  }
13977
14202
  );
13978
14203
  };
13979
- const TextButton = (_Fb) => {
13980
- var _Gb = _Fb, {
14204
+ const TextButton = (_Jb) => {
14205
+ var _Kb = _Jb, {
13981
14206
  className,
13982
14207
  children
13983
- } = _Gb, props = __objRest(_Gb, [
14208
+ } = _Kb, props = __objRest(_Kb, [
13984
14209
  "className",
13985
14210
  "children"
13986
14211
  ]);
@@ -14064,8 +14289,8 @@ const openReceiptInNewTab = (url, index) => (e) => {
14064
14289
  `);
14065
14290
  }
14066
14291
  };
14067
- const BankTransactionReceiptsWithProvider = forwardRef((_Hb, ref) => {
14068
- var _Ib = _Hb, { bankTransaction, isActive } = _Ib, props = __objRest(_Ib, ["bankTransaction", "isActive"]);
14292
+ const BankTransactionReceiptsWithProvider = forwardRef((_Lb, ref) => {
14293
+ var _Mb = _Lb, { bankTransaction, isActive } = _Mb, props = __objRest(_Mb, ["bankTransaction", "isActive"]);
14069
14294
  return /* @__PURE__ */ jsx(ReceiptsProvider, { bankTransaction, isActive, children: /* @__PURE__ */ jsx(BankTransactionReceipts, __spreadProps(__spreadValues({}, props), { ref })) });
14070
14295
  });
14071
14296
  BankTransactionReceiptsWithProvider.displayName = "BankTransactionReceiptsWithProvider";
@@ -14232,8 +14457,8 @@ const transformCurrencyValue = (rawValue) => {
14232
14457
  }
14233
14458
  return cleaned;
14234
14459
  };
14235
- const AmountInput = (_Jb) => {
14236
- var _Kb = _Jb, {
14460
+ const AmountInput = (_Nb) => {
14461
+ var _Ob = _Nb, {
14237
14462
  onChange,
14238
14463
  className,
14239
14464
  leftText,
@@ -14241,7 +14466,7 @@ const AmountInput = (_Jb) => {
14241
14466
  isInvalid,
14242
14467
  badge,
14243
14468
  placeholder = "$0.00"
14244
- } = _Kb, props = __objRest(_Kb, [
14469
+ } = _Ob, props = __objRest(_Ob, [
14245
14470
  "onChange",
14246
14471
  "className",
14247
14472
  "leftText",
@@ -14517,12 +14742,12 @@ const useBankTransactionMemo = ({ bankTransactionId }) => {
14517
14742
  });
14518
14743
  return form;
14519
14744
  };
14520
- const Textarea = (_Lb) => {
14521
- var _Mb = _Lb, {
14745
+ const Textarea = (_Pb) => {
14746
+ var _Qb = _Pb, {
14522
14747
  className,
14523
14748
  isInvalid,
14524
14749
  errorMessage
14525
- } = _Mb, props = __objRest(_Mb, [
14750
+ } = _Qb, props = __objRest(_Qb, [
14526
14751
  "className",
14527
14752
  "isInvalid",
14528
14753
  "errorMessage"
@@ -16074,7 +16299,6 @@ const extractDescriptionForSplit = (category) => {
16074
16299
  }
16075
16300
  return category.entries.map((c) => c.category.display_name).join(", ");
16076
16301
  };
16077
- let clickTimer = Date.now();
16078
16302
  const BankTransactionRow = ({
16079
16303
  index,
16080
16304
  editable,
@@ -16094,10 +16318,10 @@ const BankTransactionRow = ({
16094
16318
  const [showRetry, setShowRetry] = useState(false);
16095
16319
  const { shouldHideAfterCategorize } = useBankTransactionsContext();
16096
16320
  const [open, setOpen] = useState(false);
16097
- const toggleOpen = () => {
16321
+ const toggleOpen = useCallback(() => {
16098
16322
  setShowRetry(false);
16099
16323
  setOpen(!open);
16100
- };
16324
+ }, [open]);
16101
16325
  const bookkeepingStatus = useEffectiveBookkeepingStatus();
16102
16326
  const categorizationEnabled = isCategorizationEnabledForStatus(bookkeepingStatus);
16103
16327
  const categorized = isCategorized(bankTransaction);
@@ -16130,16 +16354,12 @@ const BankTransactionRow = ({
16130
16354
  deselect(bankTransaction.id);
16131
16355
  setOpen(false);
16132
16356
  });
16133
- const openRow = {
16134
- onMouseDown: () => {
16135
- clickTimer = Date.now();
16136
- },
16137
- onMouseUp: () => {
16138
- if (Date.now() - clickTimer < 100 && !open) {
16139
- setShowRetry(false);
16140
- setOpen(true);
16141
- }
16142
- }
16357
+ const handleRowClick = () => {
16358
+ setShowRetry(false);
16359
+ toggleOpen();
16360
+ };
16361
+ const preventRowExpansion = (e) => {
16362
+ e.stopPropagation();
16143
16363
  };
16144
16364
  const className = "Layer__bank-transaction-row";
16145
16365
  const openClassName = open ? `${className}--expanded` : "";
@@ -16156,8 +16376,8 @@ const BankTransactionRow = ({
16156
16376
  );
16157
16377
  const colSpan = categorizationEnabled ? 7 : 6;
16158
16378
  return /* @__PURE__ */ jsxs(Fragment, { children: [
16159
- /* @__PURE__ */ jsxs("tr", { className: rowClassName, children: [
16160
- categorizationEnabled && /* @__PURE__ */ jsx("td", { className: "Layer__table-cell Layer__bank-transactions__checkbox-col", children: /* @__PURE__ */ jsx("span", { className: "Layer__table-cell-content", children: /* @__PURE__ */ jsx(
16379
+ /* @__PURE__ */ jsxs("tr", { className: rowClassName, onClick: handleRowClick, children: [
16380
+ categorizationEnabled && /* @__PURE__ */ jsx("td", { className: "Layer__table-cell Layer__bank-transactions__checkbox-col", onClick: preventRowExpansion, children: /* @__PURE__ */ jsx("span", { className: "Layer__table-cell-content", children: /* @__PURE__ */ jsx(
16161
16381
  Checkbox,
16162
16382
  {
16163
16383
  isSelected: isTransactionSelected,
@@ -16172,25 +16392,22 @@ const BankTransactionRow = ({
16172
16392
  ) }) }),
16173
16393
  /* @__PURE__ */ jsx(
16174
16394
  "td",
16175
- __spreadProps(__spreadValues({
16176
- className: "Layer__table-cell Layer__bank-transaction-table__date-col"
16177
- }, openRow), {
16395
+ {
16396
+ className: "Layer__table-cell Layer__bank-transaction-table__date-col",
16178
16397
  children: /* @__PURE__ */ jsx("span", { className: "Layer__table-cell-content", children: /* @__PURE__ */ jsx(Span, { children: format(parseISO(bankTransaction.date), dateFormat) }) })
16179
- })
16398
+ }
16180
16399
  ),
16181
16400
  /* @__PURE__ */ jsx(
16182
16401
  "td",
16183
- __spreadProps(__spreadValues({
16184
- className: "Layer__table-cell Layer__bank-transactions__tx-col"
16185
- }, openRow), {
16402
+ {
16403
+ className: "Layer__table-cell Layer__bank-transactions__tx-col",
16186
16404
  children: /* @__PURE__ */ jsx("span", { className: "Layer__table-cell-content", children: /* @__PURE__ */ jsx(Span, { withTooltip: true, children: (_a = bankTransaction.counterparty_name) != null ? _a : bankTransaction.description }) })
16187
- })
16405
+ }
16188
16406
  ),
16189
16407
  /* @__PURE__ */ jsx(
16190
16408
  "td",
16191
- __spreadProps(__spreadValues({
16192
- className: "Layer__table-cell Layer__bank-transactions__account-col"
16193
- }, openRow), {
16409
+ {
16410
+ className: "Layer__table-cell Layer__bank-transactions__account-col",
16194
16411
  children: /* @__PURE__ */ jsx("span", { className: "Layer__table-cell-content", children: /* @__PURE__ */ jsxs(VStack, { align: "start", children: [
16195
16412
  /* @__PURE__ */ jsxs(Span, { ellipsis: true, children: [
16196
16413
  bankTransaction.account_name,
@@ -16198,13 +16415,13 @@ const BankTransactionRow = ({
16198
16415
  ] }),
16199
16416
  ((_b = bankTransaction.account_institution) == null ? void 0 : _b.name) && /* @__PURE__ */ jsx(Span, { ellipsis: true, variant: "subtle", size: "sm", children: bankTransaction.account_institution.name })
16200
16417
  ] }) })
16201
- })
16418
+ }
16202
16419
  ),
16203
16420
  /* @__PURE__ */ jsx(
16204
16421
  "td",
16205
- __spreadProps(__spreadValues(__spreadValues({
16422
+ __spreadProps(__spreadValues({
16206
16423
  className: `Layer__table-cell Layer__table-cell__amount-col Layer__bank-transactions__amount-col Layer__table-cell--amount ${className}__table-cell--amount-${isCredit(bankTransaction) ? "credit" : "debit"}`
16207
- }, openRow), showReceiptDataProperties), {
16424
+ }, showReceiptDataProperties), {
16208
16425
  children: /* @__PURE__ */ jsx(VStack, { align: "end", children: /* @__PURE__ */ jsx(
16209
16426
  MoneySpan,
16210
16427
  {
@@ -16232,6 +16449,7 @@ const BankTransactionRow = ({
16232
16449
  `${className}__actions-cell`,
16233
16450
  `${className}__actions-cell--${open ? "open" : "close"}`
16234
16451
  ),
16452
+ onClick: preventRowExpansion,
16235
16453
  children: open ? /* @__PURE__ */ jsxs(HStack, { pie: "md", gap: "md", justify: "end", className: "Layer__bank-transaction-row__category-open", children: [
16236
16454
  bankTransaction.error && /* @__PURE__ */ jsxs(
16237
16455
  Text,
@@ -16257,6 +16475,7 @@ const BankTransactionRow = ({
16257
16475
  processing: bankTransaction.processing,
16258
16476
  active: open,
16259
16477
  action: categorized ? SubmitAction.SAVE : SubmitAction.UPDATE,
16478
+ disabled: selectedCategory === null,
16260
16479
  children: categorized ? (stringOverrides == null ? void 0 : stringOverrides.updateButtonText) || "Update" : (stringOverrides == null ? void 0 : stringOverrides.approveButtonText) || "Confirm"
16261
16480
  }
16262
16481
  ),
@@ -16330,6 +16549,7 @@ const BankTransactionRow = ({
16330
16549
  className: "Layer__bank-transaction__submit-btn",
16331
16550
  processing: bankTransaction.processing,
16332
16551
  active: open,
16552
+ disabled: selectedCategory === null,
16333
16553
  action: categorized ? SubmitAction.SAVE : SubmitAction.UPDATE,
16334
16554
  children: categorized ? (stringOverrides == null ? void 0 : stringOverrides.updateButtonText) || "Update" : (stringOverrides == null ? void 0 : stringOverrides.approveButtonText) || "Confirm"
16335
16555
  }
@@ -16495,6 +16715,9 @@ const BankTransactionsListItem = ({
16495
16715
  const handleSave = () => {
16496
16716
  void save();
16497
16717
  };
16718
+ const preventRowExpansion = (e) => {
16719
+ e.stopPropagation();
16720
+ };
16498
16721
  const openClassName = openExpandedRow ? "Layer__bank-transaction-list-item--expanded" : "";
16499
16722
  const rowClassName = classNames(
16500
16723
  "Layer__bank-transaction-list-item",
@@ -16502,7 +16725,7 @@ const BankTransactionsListItem = ({
16502
16725
  openExpandedRow ? openClassName : "",
16503
16726
  isVisible ? "show" : ""
16504
16727
  );
16505
- return /* @__PURE__ */ jsxs("li", { className: rowClassName, children: [
16728
+ return /* @__PURE__ */ jsxs("li", { className: rowClassName, onClick: toggleExpandedRow, children: [
16506
16729
  /* @__PURE__ */ jsxs("span", { className: "Layer__bank-transaction-list-item__heading", children: [
16507
16730
  /* @__PURE__ */ jsxs("div", { className: "Layer__bank-transaction-list-item__heading__main", children: [
16508
16731
  /* @__PURE__ */ jsx(Span, { ellipsis: true, size: "sm", children: format(parseISO(bankTransaction.date), dateFormat) }),
@@ -16533,7 +16756,7 @@ const BankTransactionsListItem = ({
16533
16756
  ] }),
16534
16757
  /* @__PURE__ */ jsxs(HStack, { className: "Layer__bank-transaction-list-item__body", children: [
16535
16758
  /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "Layer__bank-transaction-list-item__body__name", children: [
16536
- categorizationEnabled && /* @__PURE__ */ jsx("div", { className: "Layer__bank-transaction-list-item__checkbox", children: /* @__PURE__ */ jsx(
16759
+ categorizationEnabled && /* @__PURE__ */ jsx("div", { className: "Layer__bank-transaction-list-item__checkbox", onClick: preventRowExpansion, children: /* @__PURE__ */ jsx(
16537
16760
  Checkbox,
16538
16761
  {
16539
16762
  isSelected: isTransactionSelected,
@@ -16558,7 +16781,7 @@ const BankTransactionsListItem = ({
16558
16781
  )
16559
16782
  ] }),
16560
16783
  !categorizationEnabled && !categorized && /* @__PURE__ */ jsx("span", { className: "Layer__bank-transaction-list-item__processing-info", children: /* @__PURE__ */ jsx(BankTransactionsProcessingInfo, {}) }),
16561
- /* @__PURE__ */ jsx("span", { className: "Layer__bank-transaction-list-item__expanded-row", children: /* @__PURE__ */ jsx(AnimatedPresenceDiv, { variant: "expand", isOpen: openExpandedRow, children: /* @__PURE__ */ jsx(
16784
+ /* @__PURE__ */ jsx("span", { className: "Layer__bank-transaction-list-item__expanded-row", onClick: preventRowExpansion, children: /* @__PURE__ */ jsx(AnimatedPresenceDiv, { variant: "expand", isOpen: openExpandedRow, children: /* @__PURE__ */ jsx(
16562
16785
  ExpandedBankTransactionRow,
16563
16786
  {
16564
16787
  ref: expandedRowRef,
@@ -16575,7 +16798,7 @@ const BankTransactionsListItem = ({
16575
16798
  variant: "list"
16576
16799
  }
16577
16800
  ) }, `expanded-${bankTransaction.id}`) }),
16578
- !openExpandedRow && categorizationEnabled && !categorized && /* @__PURE__ */ jsxs(HStack, { pi: "md", gap: "md", pb: "md", children: [
16801
+ !openExpandedRow && categorizationEnabled && !categorized && /* @__PURE__ */ jsx("div", { onClick: preventRowExpansion, children: /* @__PURE__ */ jsxs(HStack, { pi: "md", gap: "md", pb: "md", children: [
16579
16802
  /* @__PURE__ */ jsx(
16580
16803
  BankTransactionCategoryComboBox,
16581
16804
  {
@@ -16601,7 +16824,7 @@ const BankTransactionsListItem = ({
16601
16824
  children: showRetry ? "Retry" : !categorized ? (stringOverrides == null ? void 0 : stringOverrides.approveButtonText) || "Approve" : (stringOverrides == null ? void 0 : stringOverrides.updateButtonText) || "Update"
16602
16825
  }
16603
16826
  )
16604
- ] }),
16827
+ ] }) }),
16605
16828
  !openExpandedRow && categorized && /* @__PURE__ */ jsx(
16606
16829
  BankTransactionsListItemCategory,
16607
16830
  {
@@ -16669,10 +16892,10 @@ const BankTransactionsList = ({
16669
16892
  ] });
16670
16893
  };
16671
16894
  const SWITCH_CLASS_NAME = "Layer__Switch";
16672
- const Switch = forwardRef((_Nb, ref) => {
16673
- var _Ob = _Nb, {
16895
+ const Switch = forwardRef((_Rb, ref) => {
16896
+ var _Sb = _Rb, {
16674
16897
  children
16675
- } = _Ob, props = __objRest(_Ob, [
16898
+ } = _Sb, props = __objRest(_Sb, [
16676
16899
  "children"
16677
16900
  ]);
16678
16901
  return /* @__PURE__ */ jsx(
@@ -16811,8 +17034,8 @@ const BankTransactionsMobileListItemCheckbox = ({
16811
17034
  }
16812
17035
  ) });
16813
17036
  };
16814
- const Paperclip = (_Pb) => {
16815
- var _Qb = _Pb, { size = 20 } = _Qb, props = __objRest(_Qb, ["size"]);
17037
+ const Paperclip = (_Tb) => {
17038
+ var _Ub = _Tb, { size = 20 } = _Ub, props = __objRest(_Ub, ["size"]);
16816
17039
  return /* @__PURE__ */ jsx(
16817
17040
  "svg",
16818
17041
  __spreadProps(__spreadValues({
@@ -16901,168 +17124,6 @@ const BusinessFormMobile = ({
16901
17124
  )
16902
17125
  ] });
16903
17126
  };
16904
- const ActionableList = ({
16905
- options: options2,
16906
- onClick,
16907
- selectedId,
16908
- showDescriptions = false,
16909
- className
16910
- }) => {
16911
- return /* @__PURE__ */ jsx("ul", { className: classNames("Layer__actionable-list", className), children: options2.map((x, idx) => /* @__PURE__ */ jsxs(
16912
- "li",
16913
- {
16914
- role: "button",
16915
- onClick: () => onClick(x),
16916
- className: classNames(
16917
- x.secondary && "Layer__actionable-list-item--secondary",
16918
- x.asLink && "Layer__actionable-list-item--as-link",
16919
- selectedId === x.id && "Layer__actionable-list__item--selected"
16920
- ),
16921
- children: [
16922
- /* @__PURE__ */ jsxs("div", { className: "Layer__actionable-list__content", children: [
16923
- /* @__PURE__ */ jsx(Text, { size: TextSize.sm, children: x.label }),
16924
- /* TODO: Replace 'See all categories' with something more generic */
16925
- showDescriptions && x.description && x.label !== "See all categories" && /* @__PURE__ */ jsx(
16926
- Text,
16927
- {
16928
- className: "Layer__actionable-list__content-description",
16929
- size: TextSize.sm,
16930
- children: x.description
16931
- }
16932
- )
16933
- ] }),
16934
- !x.asLink && selectedId && selectedId === x.id ? /* @__PURE__ */ jsx("span", { className: "Layer__actionable-list__select Layer__actionable-list__select--selected", children: /* @__PURE__ */ jsx(
16935
- Check,
16936
- {
16937
- size: 14,
16938
- className: "Layer__actionable-list__selected-icon"
16939
- }
16940
- ) }) : null,
16941
- !x.asLink && (!selectedId || selectedId !== x.id) ? /* @__PURE__ */ jsx("span", { className: "Layer__actionable-list__select" }) : null,
16942
- x.asLink && /* @__PURE__ */ jsx(
16943
- ChevronRight,
16944
- {
16945
- size: 16,
16946
- className: "Layer__actionable-list__link-icon"
16947
- }
16948
- )
16949
- ]
16950
- },
16951
- `actionable-list-item-${idx}`
16952
- )) });
16953
- };
16954
- function getLeafCategories(category) {
16955
- if (!category.subCategories || category.subCategories.length === 0) {
16956
- return [category];
16957
- }
16958
- return category.subCategories.flatMap((subCategory) => getLeafCategories(subCategory));
16959
- }
16960
- const flattenCategories = (categories) => {
16961
- return categories.flatMap((category) => {
16962
- const subCategories = category.subCategories;
16963
- if (!subCategories || subCategories.length === 0) {
16964
- return [new CategoryAsOption(category)];
16965
- }
16966
- const leafCategories = getLeafCategories(category);
16967
- if (subCategories.every((subCategory) => !subCategory.subCategories || subCategory.subCategories.length === 0)) {
16968
- return [{
16969
- label: category.displayName,
16970
- id: "id" in category ? category.id : category.stableName,
16971
- categories: leafCategories.map((cat) => new CategoryAsOption(cat))
16972
- }];
16973
- }
16974
- return leafCategories.map((cat) => new CategoryAsOption(cat));
16975
- });
16976
- };
16977
- const isGroup = (item) => {
16978
- return "categories" in item;
16979
- };
16980
- const BankTransactionsMobileListBusinessCategories = ({
16981
- select,
16982
- selectedId,
16983
- showTooltips
16984
- }) => {
16985
- const { data: categories } = useCategories();
16986
- const [query, setQuery] = useState("");
16987
- const categoryOptions = useMemo(
16988
- () => flattenCategories(
16989
- (categories != null ? categories : []).filter((category) => category.type != "ExclusionNested")
16990
- ),
16991
- [categories]
16992
- );
16993
- const [optionsToShow, setOptionsToShow] = useState(categoryOptions);
16994
- const [selectedGroup, setSelectedGroup] = useState();
16995
- const filteredOptions = useMemo(() => {
16996
- let options2 = optionsToShow;
16997
- if (query) {
16998
- const lower = query.toLowerCase();
16999
- options2 = options2.flatMap((opt) => {
17000
- if (isGroup(opt)) {
17001
- return opt.categories.filter(
17002
- (cat) => cat.label.toLowerCase().includes(lower)
17003
- );
17004
- }
17005
- return opt.label.toLowerCase().includes(lower) ? [opt] : [];
17006
- });
17007
- }
17008
- return options2.sort((a, b) => a.label.localeCompare(b.label)).map((opt) => {
17009
- var _a;
17010
- return isGroup(opt) ? { label: opt.label, id: opt.id, value: opt, asLink: true } : { label: opt.label, id: opt.value, description: (_a = opt.original.description) != null ? _a : void 0, value: opt };
17011
- });
17012
- }, [optionsToShow, query]);
17013
- const onCategorySelect = (item) => {
17014
- if (isGroup(item.value)) {
17015
- setOptionsToShow(item.value.categories);
17016
- setSelectedGroup(item.value.label);
17017
- setQuery("");
17018
- return;
17019
- }
17020
- select(item.value);
17021
- };
17022
- const clearSelectedGroup = useCallback(() => {
17023
- setOptionsToShow(categoryOptions);
17024
- setSelectedGroup(void 0);
17025
- setQuery("");
17026
- }, [categoryOptions]);
17027
- return /* @__PURE__ */ jsxs(VStack, { className: "Layer__bank-transaction-mobile-list-item__categories_list-container", pbs: "lg", gap: "md", children: [
17028
- /* @__PURE__ */ jsxs(VStack, { pis: "sm", pie: "sm", gap: "md", children: [
17029
- /* @__PURE__ */ jsx(HStack, { pis: "xs", children: selectedGroup ? /* @__PURE__ */ jsxs(Button, { variant: "text", onClick: clearSelectedGroup, children: [
17030
- /* @__PURE__ */ jsx(ChevronLeft$1, { size: 18 }),
17031
- /* @__PURE__ */ jsx(ModalHeading, { size: "sm", weight: "bold", align: "center", children: selectedGroup })
17032
- ] }) : /* @__PURE__ */ jsx(ModalHeading, { size: "sm", weight: "bold", children: "Select category" }) }),
17033
- /* @__PURE__ */ jsx(SearchField, { value: query, onChange: setQuery, label: "Search categories..." })
17034
- ] }),
17035
- /* @__PURE__ */ jsx(
17036
- ActionableList,
17037
- {
17038
- options: filteredOptions,
17039
- onClick: onCategorySelect,
17040
- selectedId,
17041
- showDescriptions: showTooltips,
17042
- className: "Layer__bank-transaction-mobile-list-item__categories_list"
17043
- }
17044
- )
17045
- ] });
17046
- };
17047
- const CategorySelectDrawer = ({
17048
- onSelect,
17049
- selectedId,
17050
- showTooltips,
17051
- isOpen,
17052
- onOpenChange
17053
- }) => {
17054
- return /* @__PURE__ */ jsx(Drawer, { isOpen, onOpenChange, variant: "mobile-drawer", isDismissable: true, children: ({ close: close2 }) => /* @__PURE__ */ jsx(
17055
- BankTransactionsMobileListBusinessCategories,
17056
- {
17057
- select: (option) => {
17058
- onSelect(option);
17059
- close2();
17060
- },
17061
- selectedId,
17062
- showTooltips
17063
- }
17064
- ) });
17065
- };
17066
17127
  const SELECT_CATEGORY_VALUE = "SELECT_CATEGORY";
17067
17128
  const isSelectCategoryOption = (value) => {
17068
17129
  return isPlaceholderAsOption(value) && value.value === SELECT_CATEGORY_VALUE;
@@ -17079,6 +17140,10 @@ const BankTransactionsMobileListBusinessForm = ({
17079
17140
  const [sessionCategories, setSessionCategories] = useState(() => {
17080
17141
  var _a;
17081
17142
  const initialMap = /* @__PURE__ */ new Map();
17143
+ if (bankTransaction.category) {
17144
+ const existingCategory = convertApiCategorizationToCategoryOrSplitAsOption(bankTransaction.category);
17145
+ initialMap.set(existingCategory.value, existingCategory);
17146
+ }
17082
17147
  if (((_a = bankTransaction == null ? void 0 : bankTransaction.categorization_flow) == null ? void 0 : _a.type) === CategorizationType.ASK_FROM_SUGGESTIONS) {
17083
17148
  bankTransaction.categorization_flow.suggestions.forEach((suggestion) => {
17084
17149
  const opt = new ApiCategorizationAsOption(suggestion);
@@ -17347,7 +17412,7 @@ const MatchFormMobileItem = ({ match, bankTransaction, inAppLink }) => {
17347
17412
  }
17348
17413
  }
17349
17414
  ),
17350
- inAppLink
17415
+ inAppLink && /* @__PURE__ */ jsx(HStack, { align: "center", children: /* @__PURE__ */ jsx(Span, { size: "sm", children: inAppLink }) })
17351
17416
  ] })
17352
17417
  },
17353
17418
  match.id
@@ -17492,39 +17557,6 @@ const BankTransactionsMobileListMatchForm = ({
17492
17557
  showRetry && /* @__PURE__ */ jsx(ErrorText, { children: "Approval failed. Check connection and retry in few seconds." })
17493
17558
  ] });
17494
17559
  };
17495
- const CategorySelectDrawerWithTrigger = ({ value, onChange, showTooltips }) => {
17496
- var _a;
17497
- const [isDrawerOpen, setIsDrawerOpen] = useState(false);
17498
- return /* @__PURE__ */ jsxs(HStack, { fluid: true, children: [
17499
- /* @__PURE__ */ jsxs(
17500
- Button,
17501
- {
17502
- flex: true,
17503
- fullWidth: true,
17504
- "aria-label": "Select category",
17505
- onClick: () => {
17506
- setIsDrawerOpen(true);
17507
- },
17508
- variant: "outlined",
17509
- children: [
17510
- /* @__PURE__ */ jsx(Span, { children: (_a = value == null ? void 0 : value.label) != null ? _a : "Select..." }),
17511
- /* @__PURE__ */ jsx(Spacer, {}),
17512
- /* @__PURE__ */ jsx(ChevronDown, { size: 16 })
17513
- ]
17514
- }
17515
- ),
17516
- /* @__PURE__ */ jsx(
17517
- CategorySelectDrawer,
17518
- {
17519
- onSelect: onChange,
17520
- selectedId: value == null ? void 0 : value.value,
17521
- showTooltips,
17522
- isOpen: isDrawerOpen,
17523
- onOpenChange: setIsDrawerOpen
17524
- }
17525
- )
17526
- ] });
17527
- };
17528
17560
  const BankTransactionsMobileListSplitForm = ({
17529
17561
  bankTransaction,
17530
17562
  showTooltips,
@@ -17774,6 +17806,37 @@ const BankTransactionsMobileForms = ({
17774
17806
  };
17775
17807
  return /* @__PURE__ */ jsx(ReceiptsProvider, { bankTransaction, isActive: isOpen, children: getContent() });
17776
17808
  };
17809
+ const NewToggleOption = ({
17810
+ label,
17811
+ value
17812
+ }) => {
17813
+ return /* @__PURE__ */ jsxs(ToggleButton, { id: value, className: "Layer__NewToggleOption", children: [
17814
+ /* @__PURE__ */ jsx(SelectionIndicator, { className: "Layer__NewToggleOption-SelectionIndicator" }),
17815
+ /* @__PURE__ */ jsx(Span, { className: "Layer__NewToggle-Option-Content", children: /* @__PURE__ */ jsx(Span, { noWrap: true, children: label }) })
17816
+ ] });
17817
+ };
17818
+ const NewToggle = ({
17819
+ options: options2,
17820
+ selectedKey,
17821
+ onSelectionChange
17822
+ }) => {
17823
+ const selectedKeys = selectedKey !== void 0 ? /* @__PURE__ */ new Set([selectedKey]) : /* @__PURE__ */ new Set();
17824
+ return /* @__PURE__ */ jsx(
17825
+ ToggleButtonGroup,
17826
+ {
17827
+ className: "Layer__NewToggle",
17828
+ selectionMode: "single",
17829
+ selectedKeys,
17830
+ onSelectionChange: (keys) => {
17831
+ const selectedKeysArray = Array.from(keys);
17832
+ if (selectedKeysArray.length > 0 && onSelectionChange) {
17833
+ onSelectionChange(selectedKeysArray[0]);
17834
+ }
17835
+ },
17836
+ children: options2.map((option) => /* @__PURE__ */ jsx(NewToggleOption, __spreadValues({}, option), option.value))
17837
+ }
17838
+ );
17839
+ };
17777
17840
  const PURPOSE_TOGGLE_OPTIONS = [
17778
17841
  {
17779
17842
  value: "business",
@@ -17793,27 +17856,27 @@ const PURPOSE_TOGGLE_OPTIONS = [
17793
17856
  ];
17794
17857
  const BankTransactionsMobileListItemExpandedRow = ({
17795
17858
  bankTransaction,
17859
+ isOpen,
17796
17860
  showCategorization,
17797
17861
  showDescriptions,
17798
17862
  showReceiptUploads,
17799
17863
  showTooltips
17800
17864
  }) => {
17801
17865
  const [purpose, setPurpose] = useState(getInitialPurpose(bankTransaction));
17802
- const onChangePurpose = (event) => setPurpose(event.target.value);
17866
+ const onChangePurpose = (key) => setPurpose(key);
17803
17867
  return /* @__PURE__ */ jsxs(VStack, { pi: "md", gap: "md", pbe: "md", children: [
17804
17868
  showCategorization && /* @__PURE__ */ jsx(
17805
- Toggle,
17869
+ NewToggle,
17806
17870
  {
17807
- name: `purpose-${bankTransaction.id}`,
17808
- size: ToggleSize.medium,
17809
17871
  options: PURPOSE_TOGGLE_OPTIONS,
17810
- selected: purpose,
17811
- onChange: onChangePurpose
17872
+ selectedKey: purpose,
17873
+ onSelectionChange: onChangePurpose
17812
17874
  }
17813
17875
  ),
17814
17876
  /* @__PURE__ */ jsx(
17815
17877
  BankTransactionsMobileForms,
17816
17878
  {
17879
+ isOpen,
17817
17880
  purpose,
17818
17881
  bankTransaction,
17819
17882
  showCategorization,
@@ -17856,20 +17919,15 @@ var Purpose = /* @__PURE__ */ ((Purpose2) => {
17856
17919
  Purpose2["more"] = "more";
17857
17920
  return Purpose2;
17858
17921
  })(Purpose || {});
17859
- const getAssignedValue = (bankTransaction, renderInAppLink) => {
17860
- var _a, _b, _c, _d;
17861
- if (bankTransaction.categorization_status === CategorizationStatus.SPLIT) {
17862
- return extractDescriptionForSplit(bankTransaction.category);
17863
- }
17864
- if (bankTransaction.categorization_status === CategorizationStatus.MATCHED) {
17865
- if (renderInAppLink && ((_a = bankTransaction.match) == null ? void 0 : _a.details)) {
17866
- const matchDetails = bankTransaction.match.details ? decodeMatchDetails(bankTransaction.match.details) : void 0;
17867
- const inAppLink = matchDetails ? renderInAppLink(convertMatchDetailsToLinkingMetadata(matchDetails)) : void 0;
17868
- if (inAppLink) return inAppLink;
17922
+ const getInAppLink = (bankTransaction, renderInAppLink) => {
17923
+ var _a;
17924
+ if (bankTransaction.categorization_status === CategorizationStatus.MATCHED && renderInAppLink && ((_a = bankTransaction.match) == null ? void 0 : _a.details)) {
17925
+ const matchDetails = decodeMatchDetails(bankTransaction.match.details);
17926
+ if (matchDetails) {
17927
+ return renderInAppLink(convertMatchDetailsToLinkingMetadata(matchDetails));
17869
17928
  }
17870
- return (_c = (_b = bankTransaction.match) == null ? void 0 : _b.details) == null ? void 0 : _c.description;
17871
17929
  }
17872
- return (_d = bankTransaction.category) == null ? void 0 : _d.display_name;
17930
+ return null;
17873
17931
  };
17874
17932
  const BankTransactionsMobileListItem = ({
17875
17933
  index,
@@ -17977,6 +18035,12 @@ const BankTransactionsMobileListItem = ({
17977
18035
  const isSelected = useIdIsSelected();
17978
18036
  const isTransactionSelected = isSelected(bankTransaction.id);
17979
18037
  const { renderInAppLink } = useInAppLinkContext();
18038
+ const inAppLink = useMemo(() => {
18039
+ if (!categorized) {
18040
+ return null;
18041
+ }
18042
+ return getInAppLink(bankTransaction, renderInAppLink);
18043
+ }, [categorized, bankTransaction, renderInAppLink]);
17980
18044
  const { isVisible } = useDelayedVisibility({ delay: index * 20, initialVisibility: Boolean(initialLoad) });
17981
18045
  const className = "Layer__bank-transaction-mobile-list-item";
17982
18046
  const openClassName = open ? `${className}--expanded` : "";
@@ -17995,9 +18059,8 @@ const BankTransactionsMobileListItem = ({
17995
18059
  /* @__PURE__ */ jsxs(
17996
18060
  HStack,
17997
18061
  {
17998
- gap: "lg",
18062
+ gap: "sm",
17999
18063
  justify: "space-between",
18000
- align: "center",
18001
18064
  pie: "md",
18002
18065
  children: [
18003
18066
  /* @__PURE__ */ jsxs(HStack, { align: "center", overflow: "hidden", children: [
@@ -18014,12 +18077,12 @@ const BankTransactionsMobileListItem = ({
18014
18077
  {
18015
18078
  align: "start",
18016
18079
  gap: "3xs",
18017
- className: "Layer__bankTransactionsMobileListItem__headingContentLeft",
18080
+ className: "Layer__BankTransactionsMobileListItem__HeadingContentLeft",
18018
18081
  pi: "md",
18019
18082
  pb: "sm",
18020
18083
  children: [
18021
18084
  /* @__PURE__ */ jsx(Span, { ellipsis: true, children: (_b = bankTransaction.counterparty_name) != null ? _b : bankTransaction.description }),
18022
- /* @__PURE__ */ jsx(Span, { className: "Layer__bankTransactionsMobileListItem__categorizedValue", children: categorized && bankTransaction.categorization_status ? getAssignedValue(bankTransaction, renderInAppLink) : null }),
18085
+ inAppLink && /* @__PURE__ */ jsx(Span, { className: "Layer__BankTransactionsMobileListItem__CategorizedValue", children: inAppLink }),
18023
18086
  /* @__PURE__ */ jsxs(HStack, { gap: "2xs", align: "center", children: [
18024
18087
  /* @__PURE__ */ jsx(Span, { size: "sm", ellipsis: true, children: fullAccountName }),
18025
18088
  hasReceipts(bankTransaction) ? /* @__PURE__ */ jsx(File, { size: 12 }) : null
@@ -18044,7 +18107,7 @@ const BankTransactionsMobileListItem = ({
18044
18107
  ]
18045
18108
  }
18046
18109
  ),
18047
- !open && (!categorizationEnabled && !categorized ? /* @__PURE__ */ jsx("span", { className: "Layer__bank-transaction-list-item__processing-info", children: /* @__PURE__ */ jsx(BankTransactionsProcessingInfo, {}) }) : /* @__PURE__ */ jsx(
18110
+ !open && (!categorizationEnabled && !categorized ? /* @__PURE__ */ jsx(BankTransactionsProcessingInfo, { showAsBadge: true }) : /* @__PURE__ */ jsx(
18048
18111
  BankTransactionsListItemCategory,
18049
18112
  {
18050
18113
  bankTransaction,
@@ -18058,6 +18121,7 @@ const BankTransactionsMobileListItem = ({
18058
18121
  BankTransactionsMobileListItemExpandedRow,
18059
18122
  {
18060
18123
  bankTransaction,
18124
+ isOpen: open,
18061
18125
  showCategorization: categorizationEnabled,
18062
18126
  showDescriptions,
18063
18127
  showReceiptUploads,
@@ -18078,6 +18142,7 @@ const BankTransactionsMobileList = ({
18078
18142
  const transactionToOpenContextData = useTransactionToOpen();
18079
18143
  const [bulkActionsEnabled, setBulkActionsEnabled] = useState(false);
18080
18144
  const { clearSelection } = useBulkSelectionActions();
18145
+ useUpsertBankTransactionsDefaultCategories(bankTransactions);
18081
18146
  useEffect(() => {
18082
18147
  if (!bulkActionsEnabled) {
18083
18148
  clearSelection();
@@ -18248,6 +18313,7 @@ const BankTransactionsTable = ({
18248
18313
  SyncingComponent,
18249
18314
  {
18250
18315
  title: "Syncing historical account data",
18316
+ timeSync: 5,
18251
18317
  onRefresh: () => onRefresh && onRefresh()
18252
18318
  }
18253
18319
  ) }) }) : null
@@ -18256,8 +18322,8 @@ const BankTransactionsTable = ({
18256
18322
  }
18257
18323
  );
18258
18324
  };
18259
- const BackArrow = (_Rb) => {
18260
- var _Sb = _Rb, { size = 18 } = _Sb, props = __objRest(_Sb, ["size"]);
18325
+ const BackArrow = (_Vb) => {
18326
+ var _Wb = _Vb, { size = 18 } = _Wb, props = __objRest(_Wb, ["size"]);
18261
18327
  return /* @__PURE__ */ jsx(
18262
18328
  "svg",
18263
18329
  __spreadProps(__spreadValues({
@@ -18425,8 +18491,8 @@ const usePaginationRange = ({
18425
18491
  }, [totalCount, pageSize, siblingCount, currentPage]);
18426
18492
  return paginationRange;
18427
18493
  };
18428
- const ChevronLeft = (_Tb) => {
18429
- var props = __objRest(_Tb, []);
18494
+ const ChevronLeft = (_Xb) => {
18495
+ var props = __objRest(_Xb, []);
18430
18496
  return /* @__PURE__ */ jsx(
18431
18497
  "svg",
18432
18498
  __spreadProps(__spreadValues({
@@ -18448,8 +18514,8 @@ const ChevronLeft = (_Tb) => {
18448
18514
  })
18449
18515
  );
18450
18516
  };
18451
- const PaginationButton = (_Ub) => {
18452
- var _Vb = _Ub, { children, isSelected } = _Vb, buttonProps = __objRest(_Vb, ["children", "isSelected"]);
18517
+ const PaginationButton = (_Yb) => {
18518
+ var _Zb = _Yb, { children, isSelected } = _Zb, buttonProps = __objRest(_Zb, ["children", "isSelected"]);
18453
18519
  return /* @__PURE__ */ jsx(
18454
18520
  Button,
18455
18521
  __spreadProps(__spreadValues({
@@ -18878,8 +18944,8 @@ function usePreloadTagDimensions(parameters) {
18878
18944
  useTagDimensions(parameters);
18879
18945
  }
18880
18946
  const COMPONENT_NAME$c = "bank-transactions";
18881
- const BankTransactions = (_Wb) => {
18882
- var _Xb = _Wb, {
18947
+ const BankTransactions = (__b) => {
18948
+ var _$b = __b, {
18883
18949
  onError,
18884
18950
  showTags = false,
18885
18951
  showCustomerVendor = false,
@@ -18887,7 +18953,7 @@ const BankTransactions = (_Wb) => {
18887
18953
  applyGlobalDateRange = false,
18888
18954
  mode,
18889
18955
  renderInAppLink
18890
- } = _Xb, props = __objRest(_Xb, [
18956
+ } = _$b, props = __objRest(_$b, [
18891
18957
  "onError",
18892
18958
  "showTags",
18893
18959
  "showCustomerVendor",
@@ -19117,7 +19183,7 @@ const BankTransactionsTableView = ({
19117
19183
  }
19118
19184
  )
19119
19185
  ] }),
19120
- !isLoadingWithoutData && listView && mobileComponent !== "mobileList" ? /* @__PURE__ */ jsxs("div", { className: "Layer__bank-transactions__list-wrapper", children: [
19186
+ !isLoadingWithoutData && listView && mobileComponent !== "mobileList" && /* @__PURE__ */ jsxs("div", { className: "Layer__bank-transactions__list-wrapper", children: [
19121
19187
  rulesSuggestionModal,
19122
19188
  /* @__PURE__ */ jsx(
19123
19189
  BankTransactionsList,
@@ -19132,8 +19198,8 @@ const BankTransactionsTableView = ({
19132
19198
  showTooltips
19133
19199
  }
19134
19200
  )
19135
- ] }) : null,
19136
- !isLoadingWithoutData && listView && mobileComponent === "mobileList" ? /* @__PURE__ */ jsxs(Fragment, { children: [
19201
+ ] }),
19202
+ !isLoadingWithoutData && listView && mobileComponent === "mobileList" && /* @__PURE__ */ jsxs(Fragment, { children: [
19137
19203
  /* @__PURE__ */ jsx(
19138
19204
  BankTransactionsMobileList,
19139
19205
  {
@@ -19146,9 +19212,9 @@ const BankTransactionsTableView = ({
19146
19212
  }
19147
19213
  ),
19148
19214
  rulesSuggestionDrawer
19149
- ] }) : null,
19150
- listView && isLoadingWithoutData ? /* @__PURE__ */ jsx("div", { className: "Layer__bank-transactions__list-loader", children: /* @__PURE__ */ jsx(Loader, {}) }) : null,
19151
- !isSyncing || listView ? /* @__PURE__ */ jsx(
19215
+ ] }),
19216
+ listView && isLoadingWithoutData && /* @__PURE__ */ jsx("div", { className: "Layer__bank-transactions__list-loader", children: /* @__PURE__ */ jsx(Loader, {}) }),
19217
+ (!isSyncing || listView) && /* @__PURE__ */ jsx(
19152
19218
  BankTransactionsTableEmptyStates,
19153
19219
  {
19154
19220
  hasVisibleTransactions: ((_a = bankTransactions == null ? void 0 : bankTransactions.length) != null ? _a : 0) > 0,
@@ -19157,7 +19223,7 @@ const BankTransactionsTableView = ({
19157
19223
  isFiltered: Boolean(filters == null ? void 0 : filters.query),
19158
19224
  isLoadingWithoutData
19159
19225
  }
19160
- ) : null,
19226
+ ),
19161
19227
  !isMonthlyViewMode && /* @__PURE__ */ jsx(HStack, { justify: "end", children: /* @__PURE__ */ jsx(
19162
19228
  Pagination,
19163
19229
  {
@@ -19252,8 +19318,8 @@ function QuickbooksContextProvider({ children }) {
19252
19318
  const quickbooksContextData = useQuickbooks();
19253
19319
  return /* @__PURE__ */ jsx(QuickbooksContext.Provider, { value: quickbooksContextData, children });
19254
19320
  }
19255
- const Cog = (_Yb) => {
19256
- var _Zb = _Yb, { size = 12 } = _Zb, props = __objRest(_Zb, ["size"]);
19321
+ const Cog = (_ac) => {
19322
+ var _bc = _ac, { size = 12 } = _bc, props = __objRest(_bc, ["size"]);
19257
19323
  const id = useId();
19258
19324
  return /* @__PURE__ */ jsxs(
19259
19325
  "svg",
@@ -19274,8 +19340,8 @@ const Cog = (_Yb) => {
19274
19340
  })
19275
19341
  );
19276
19342
  };
19277
- const QuickbooksIcon = (__b) => {
19278
- var _$b = __b, { size = 24 } = _$b, props = __objRest(_$b, ["size"]);
19343
+ const QuickbooksIcon = (_cc) => {
19344
+ var _dc = _cc, { size = 24 } = _dc, props = __objRest(_dc, ["size"]);
19279
19345
  return /* @__PURE__ */ jsxs(
19280
19346
  "svg",
19281
19347
  __spreadProps(__spreadValues({
@@ -19434,8 +19500,8 @@ function IntegrationsQuickbooksUnlinkConfirmationModal({ isOpen, onOpenChange })
19434
19500
  }
19435
19501
  );
19436
19502
  }
19437
- const MoreVertical = (_ac) => {
19438
- var _bc = _ac, { size = 18 } = _bc, props = __objRest(_bc, ["size"]);
19503
+ const MoreVertical = (_ec) => {
19504
+ var _fc = _ec, { size = 18 } = _fc, props = __objRest(_fc, ["size"]);
19439
19505
  return /* @__PURE__ */ jsxs(
19440
19506
  "svg",
19441
19507
  __spreadProps(__spreadValues({
@@ -19664,8 +19730,8 @@ const IntegrationsComponent = ({
19664
19730
  (quickbooksConnectionStatus == null ? void 0 : quickbooksConnectionStatus.is_connected) && /* @__PURE__ */ jsx(IntegrationsContent, {})
19665
19731
  ] });
19666
19732
  };
19667
- const PlusIcon = (_cc) => {
19668
- var _dc = _cc, { size = 14 } = _dc, props = __objRest(_dc, ["size"]);
19733
+ const PlusIcon = (_gc) => {
19734
+ var _hc = _gc, { size = 14 } = _hc, props = __objRest(_hc, ["size"]);
19669
19735
  return /* @__PURE__ */ jsxs(
19670
19736
  "svg",
19671
19737
  __spreadProps(__spreadValues({
@@ -19707,8 +19773,8 @@ const PlusIcon = (_cc) => {
19707
19773
  })
19708
19774
  );
19709
19775
  };
19710
- const InstitutionIcon = (_ec) => {
19711
- var _fc = _ec, { size = 18 } = _fc, props = __objRest(_fc, ["size"]);
19776
+ const InstitutionIcon = (_ic) => {
19777
+ var _jc = _ic, { size = 18 } = _jc, props = __objRest(_jc, ["size"]);
19712
19778
  return /* @__PURE__ */ jsxs(
19713
19779
  "svg",
19714
19780
  __spreadProps(__spreadValues({
@@ -20015,10 +20081,10 @@ const InstitutionIcon = (_ec) => {
20015
20081
  })
20016
20082
  );
20017
20083
  };
20018
- const CLASS_NAME$5 = "Layer__BasicLinkedAccountContainer";
20084
+ const CLASS_NAME$4 = "Layer__BasicLinkedAccountContainer";
20019
20085
  function BasicLinkedAccountContainer({ children, isSelected }) {
20020
20086
  const dataProperties = toDataProperties({ selected: isSelected });
20021
- return /* @__PURE__ */ jsx("div", __spreadProps(__spreadValues({}, dataProperties), { className: CLASS_NAME$5, children }));
20087
+ return /* @__PURE__ */ jsx("div", __spreadProps(__spreadValues({}, dataProperties), { className: CLASS_NAME$4, children }));
20022
20088
  }
20023
20089
  function BasicLinkedAccountLogo({ account }) {
20024
20090
  var _a, _b, _c;
@@ -20326,8 +20392,8 @@ const MenuItem = forwardRef(
20326
20392
  );
20327
20393
  const PILL_CLASS_NAME = "Layer__Pill";
20328
20394
  const Pill = forwardRef(
20329
- function Pill2(_gc, ref) {
20330
- var _hc = _gc, { children, status } = _hc, restProps = __objRest(_hc, ["children", "status"]);
20395
+ function Pill2(_kc, ref) {
20396
+ var _lc = _kc, { children, status } = _lc, restProps = __objRest(_lc, ["children", "status"]);
20331
20397
  const dataProperties = toDataProperties({ status });
20332
20398
  return /* @__PURE__ */ jsx(
20333
20399
  Button$2,
@@ -20690,8 +20756,8 @@ const LinkedAccountsContent = ({
20690
20756
  };
20691
20757
  const CALENDAR_CLASS_NAME = "Layer__UI__Calendar";
20692
20758
  const Calendar = forwardRef(
20693
- function Calendar2(_ic, ref) {
20694
- var _jc = _ic, { className, isReadOnly } = _jc, restProps = __objRest(_jc, ["className", "isReadOnly"]);
20759
+ function Calendar2(_mc, ref) {
20760
+ var _nc = _mc, { className, isReadOnly } = _nc, restProps = __objRest(_nc, ["className", "isReadOnly"]);
20695
20761
  const dataProperties = toDataProperties({ readonly: isReadOnly });
20696
20762
  return /* @__PURE__ */ jsx(
20697
20763
  Calendar$1,
@@ -20705,8 +20771,8 @@ const Calendar = forwardRef(
20705
20771
  );
20706
20772
  const CALENDAR_GRID_CLASS_NAME = "Layer__UI__CalendarGrid";
20707
20773
  const CalendarGrid = forwardRef(
20708
- function CalendarGrid2(_kc, ref) {
20709
- var _lc = _kc, { className } = _lc, restProps = __objRest(_lc, ["className"]);
20774
+ function CalendarGrid2(_oc, ref) {
20775
+ var _pc = _oc, { className } = _pc, restProps = __objRest(_pc, ["className"]);
20710
20776
  return /* @__PURE__ */ jsx(
20711
20777
  CalendarGrid$1,
20712
20778
  __spreadProps(__spreadValues({}, restProps), {
@@ -20718,8 +20784,8 @@ const CalendarGrid = forwardRef(
20718
20784
  );
20719
20785
  const CALENDAR_GRID_BODY_CLASS_NAME = "Layer__UI__CalendarGridBody";
20720
20786
  const CalendarGridBody = forwardRef(
20721
- function CalendarGridBody2(_mc, ref) {
20722
- var _nc = _mc, { className } = _nc, restProps = __objRest(_nc, ["className"]);
20787
+ function CalendarGridBody2(_qc, ref) {
20788
+ var _rc = _qc, { className } = _rc, restProps = __objRest(_rc, ["className"]);
20723
20789
  return /* @__PURE__ */ jsx(
20724
20790
  CalendarGridBody$1,
20725
20791
  __spreadProps(__spreadValues({}, restProps), {
@@ -20731,8 +20797,8 @@ const CalendarGridBody = forwardRef(
20731
20797
  );
20732
20798
  const CALENDAR_CELL_CLASS_NAME = "Layer__UI__CalendarCell";
20733
20799
  const CalendarCell = forwardRef(
20734
- function CalendarCell2(_oc, ref) {
20735
- var _pc = _oc, { className, size = "sm" } = _pc, restProps = __objRest(_pc, ["className", "size"]);
20800
+ function CalendarCell2(_sc, ref) {
20801
+ var _tc = _sc, { className, size = "sm" } = _tc, restProps = __objRest(_tc, ["className", "size"]);
20736
20802
  const dataProperties = toDataProperties({ size });
20737
20803
  return /* @__PURE__ */ jsx(
20738
20804
  CalendarCell$1,
@@ -20745,8 +20811,8 @@ const CalendarCell = forwardRef(
20745
20811
  );
20746
20812
  const CALENDAR_GRID_HEADER_CLASS_NAME = "Layer__UI__CalendarGridHeader";
20747
20813
  const CalendarGridHeader = forwardRef(
20748
- function CalendarGridHeader2(_qc, ref) {
20749
- var _rc = _qc, { className } = _rc, restProps = __objRest(_rc, ["className"]);
20814
+ function CalendarGridHeader2(_uc, ref) {
20815
+ var _vc = _uc, { className } = _vc, restProps = __objRest(_vc, ["className"]);
20750
20816
  return /* @__PURE__ */ jsx(
20751
20817
  CalendarGridHeader$1,
20752
20818
  __spreadProps(__spreadValues({}, restProps), {
@@ -20758,8 +20824,8 @@ const CalendarGridHeader = forwardRef(
20758
20824
  );
20759
20825
  const CALENDAR_HEADER_CELL_CLASS_NAME = "Layer__UI__CalendarHeaderCell";
20760
20826
  const CalendarHeaderCell = forwardRef(
20761
- function CalendarHeaderCell2(_sc, ref) {
20762
- var _tc = _sc, { className, size = "sm" } = _tc, restProps = __objRest(_tc, ["className", "size"]);
20827
+ function CalendarHeaderCell2(_wc, ref) {
20828
+ var _xc = _wc, { className, size = "sm" } = _xc, restProps = __objRest(_xc, ["className", "size"]);
20763
20829
  const dataProperties = toDataProperties({ size });
20764
20830
  return /* @__PURE__ */ jsx(
20765
20831
  CalendarHeaderCell$1,
@@ -20892,7 +20958,7 @@ const useDatePickerState = ({ date, setDate, minDate = null, maxDate = null }) =
20892
20958
  maxDateZdt
20893
20959
  }), [errorText, isInvalid, localDate, onBlur, onChange, maxDateZdt, minDateZdt]);
20894
20960
  };
20895
- const CLASS_NAME$4 = "Layer__caobfb";
20961
+ const CLASS_NAME$3 = "Layer__caobfb";
20896
20962
  const AccountFormBox = ({
20897
20963
  account,
20898
20964
  value,
@@ -20925,8 +20991,8 @@ const AccountFormBox = ({
20925
20991
  onChange(__spreadProps(__spreadValues({}, value), { isDateInvalid }));
20926
20992
  }
20927
20993
  }, [isDateInvalid, onChange, value]);
20928
- return /* @__PURE__ */ jsxs("div", __spreadProps(__spreadValues({}, dataProps), { className: CLASS_NAME$4, children: [
20929
- /* @__PURE__ */ jsx("div", { className: `${CLASS_NAME$4}__icon-col`, children: ((_a = account.institution) == null ? void 0 : _a.logo) != void 0 ? /* @__PURE__ */ jsx(
20994
+ return /* @__PURE__ */ jsxs("div", __spreadProps(__spreadValues({}, dataProps), { className: CLASS_NAME$3, children: [
20995
+ /* @__PURE__ */ jsx("div", { className: `${CLASS_NAME$3}__icon-col`, children: ((_a = account.institution) == null ? void 0 : _a.logo) != void 0 ? /* @__PURE__ */ jsx(
20930
20996
  "img",
20931
20997
  {
20932
20998
  width: 32,
@@ -20935,13 +21001,13 @@ const AccountFormBox = ({
20935
21001
  alt: ((_b = account.institution) == null ? void 0 : _b.name) ? (_c = account.institution) == null ? void 0 : _c.name : account.external_account_name
20936
21002
  }
20937
21003
  ) : /* @__PURE__ */ jsx(InstitutionIcon, {}) }),
20938
- /* @__PURE__ */ jsxs("div", { className: `${CLASS_NAME$4}__details-col`, children: [
20939
- /* @__PURE__ */ jsxs("div", { className: `${CLASS_NAME$4}__details-col__details`, children: [
20940
- /* @__PURE__ */ jsxs("div", { className: `${CLASS_NAME$4}__details-col__name`, children: [
21004
+ /* @__PURE__ */ jsxs("div", { className: `${CLASS_NAME$3}__details-col`, children: [
21005
+ /* @__PURE__ */ jsxs("div", { className: `${CLASS_NAME$3}__details-col__details`, children: [
21006
+ /* @__PURE__ */ jsxs("div", { className: `${CLASS_NAME$3}__details-col__name`, children: [
20941
21007
  /* @__PURE__ */ jsx(
20942
21008
  Text,
20943
21009
  {
20944
- className: `${CLASS_NAME$4}__details-col__name__institution-name`,
21010
+ className: `${CLASS_NAME$3}__details-col__name__institution-name`,
20945
21011
  size: TextSize.sm,
20946
21012
  children: (_d = account.institution) == null ? void 0 : _d.name
20947
21013
  }
@@ -20949,7 +21015,7 @@ const AccountFormBox = ({
20949
21015
  /* @__PURE__ */ jsx(
20950
21016
  Text,
20951
21017
  {
20952
- className: `${CLASS_NAME$4}__details-col__name__account-name`,
21018
+ className: `${CLASS_NAME$3}__details-col__name__account-name`,
20953
21019
  size: TextSize.sm,
20954
21020
  children: account.external_account_name
20955
21021
  }
@@ -20960,7 +21026,7 @@ const AccountFormBox = ({
20960
21026
  account.mask
20961
21027
  ] })
20962
21028
  ] }),
20963
- /* @__PURE__ */ jsxs("div", { className: `${CLASS_NAME$4}__details-col__inputs`, children: [
21029
+ /* @__PURE__ */ jsxs("div", { className: `${CLASS_NAME$3}__details-col__inputs`, children: [
20964
21030
  /* @__PURE__ */ jsx(InputGroup, { label: "Opening date", children: /* @__PURE__ */ jsx(
20965
21031
  DatePicker,
20966
21032
  {
@@ -20989,7 +21055,7 @@ const AccountFormBox = ({
20989
21055
  ] }),
20990
21056
  errors.includes("API_ERROR") && /* @__PURE__ */ jsx(ErrorText, { children: "An error occurred while saving data. You will have an opportunity to try again later." })
20991
21057
  ] }),
20992
- !disableConfirmExclude && /* @__PURE__ */ jsx("div", { className: `${CLASS_NAME$4}__confirm-col`, children: /* @__PURE__ */ jsx(
21058
+ !disableConfirmExclude && /* @__PURE__ */ jsx("div", { className: `${CLASS_NAME$3}__confirm-col`, children: /* @__PURE__ */ jsx(
20993
21059
  Checkbox,
20994
21060
  {
20995
21061
  size: "lg",
@@ -20998,7 +21064,7 @@ const AccountFormBox = ({
20998
21064
  "aria-label": "Confirm Account Inclusion"
20999
21065
  }
21000
21066
  ) }),
21001
- /* @__PURE__ */ jsx("div", { className: `${CLASS_NAME$4}__success-banner`, children: /* @__PURE__ */ jsx(CheckCircle, { size: 36 }) })
21067
+ /* @__PURE__ */ jsx("div", { className: `${CLASS_NAME$3}__success-banner`, children: /* @__PURE__ */ jsx(CheckCircle, { size: 36 }) })
21002
21068
  ] }));
21003
21069
  };
21004
21070
  function buildKey$z({
@@ -21874,8 +21940,8 @@ const useProfitAndLossLTM = ({ currentDate, tagFilter, reportingBasis } = {
21874
21940
  refetch
21875
21941
  };
21876
21942
  };
21877
- const BarChart2 = (_uc) => {
21878
- var _vc = _uc, { size = 12 } = _vc, props = __objRest(_vc, ["size"]);
21943
+ const BarChart2 = (_yc) => {
21944
+ var _zc = _yc, { size = 12 } = _zc, props = __objRest(_zc, ["size"]);
21879
21945
  return /* @__PURE__ */ jsxs(
21880
21946
  "svg",
21881
21947
  __spreadProps(__spreadValues({
@@ -22665,11 +22731,11 @@ const ProfitAndLossChart = ({
22665
22731
  isSyncing && !hasNonZeroData ? /* @__PURE__ */ jsx(ChartStateCard, {}) : null
22666
22732
  ] });
22667
22733
  };
22668
- const BackButton = (_wc) => {
22669
- var _xc = _wc, {
22734
+ const BackButton = (_Ac) => {
22735
+ var _Bc = _Ac, {
22670
22736
  className,
22671
22737
  textOnly = false
22672
- } = _xc, props = __objRest(_xc, [
22738
+ } = _Bc, props = __objRest(_Bc, [
22673
22739
  "className",
22674
22740
  "textOnly"
22675
22741
  ]);
@@ -22717,8 +22783,8 @@ const TASKS_CHARTS_COLORS = {
22717
22783
  done: "#3B9C63",
22718
22784
  pending: "#DFA000"
22719
22785
  };
22720
- const SortArrows = (_yc) => {
22721
- var _zc = _yc, { size = 13 } = _zc, props = __objRest(_zc, ["size"]);
22786
+ const SortArrows = (_Cc) => {
22787
+ var _Dc = _Cc, { size = 13 } = _Dc, props = __objRest(_Dc, ["size"]);
22722
22788
  return /* @__PURE__ */ jsxs(
22723
22789
  "svg",
22724
22790
  __spreadProps(__spreadValues({
@@ -23383,11 +23449,11 @@ const LedgerAccountsContext = createContext({
23383
23449
  fetchMore: () => {
23384
23450
  }
23385
23451
  });
23386
- const CloseButton = (_Ac) => {
23387
- var _Bc = _Ac, {
23452
+ const CloseButton = (_Ec) => {
23453
+ var _Fc = _Ec, {
23388
23454
  className,
23389
23455
  textOnly = false
23390
- } = _Bc, props = __objRest(_Bc, [
23456
+ } = _Fc, props = __objRest(_Fc, [
23391
23457
  "className",
23392
23458
  "textOnly"
23393
23459
  ]);
@@ -24125,7 +24191,7 @@ const ProfitAndLossDetailReport = ({
24125
24191
  ),
24126
24192
  rowsWithRunningBalance.lines.length > 0 && /* @__PURE__ */ jsxs(HStack, { pb: "sm", align: "center", className: "Layer__profit-and-loss-detail-report__total-row", children: [
24127
24193
  /* @__PURE__ */ jsx(HStack, { className: "Layer__profit-and-loss-detail-report__total-label", children: /* @__PURE__ */ jsx(Label, { weight: "bold", size: "md", children: "Total" }) }),
24128
- /* @__PURE__ */ jsx(HStack, { className: "Layer__profit-and-loss-detail-report__total-amount", children: /* @__PURE__ */ jsx(MoneySpan, { bold: true, size: "md", amount: rowsWithRunningBalance.total }) })
24194
+ /* @__PURE__ */ jsx(HStack, { className: "Layer__profit-and-loss-detail-report__total-amount", children: /* @__PURE__ */ jsx(MoneySpan, { weight: "bold", size: "md", amount: rowsWithRunningBalance.total }) })
24129
24195
  ] })
24130
24196
  ] }) });
24131
24197
  };
@@ -25282,7 +25348,7 @@ const ProfitAndLossTableComponent = ({
25282
25348
  {
25283
25349
  variant: "text",
25284
25350
  onPress: () => onLineItemClick(lineItem.name, currentBreadcrumbs),
25285
- children: /* @__PURE__ */ jsx(MoneySpan, { bold: true, amount: (_a = lineItem.value) != null ? _a : 0 })
25351
+ children: /* @__PURE__ */ jsx(MoneySpan, { amount: (_a = lineItem.value) != null ? _a : 0, weight: "bold" })
25286
25352
  }
25287
25353
  )
25288
25354
  }
@@ -25564,6 +25630,19 @@ const ProfitAndLossReport = ({
25564
25630
  }
25565
25631
  ) }) });
25566
25632
  };
25633
+ function calculatePercentageChange(current, previous) {
25634
+ if (current >= 0 && previous < 0 || current < 0 && previous >= 0) {
25635
+ return null;
25636
+ }
25637
+ if (previous === 0) {
25638
+ return current === 0 ? null : 100;
25639
+ }
25640
+ return (current - previous) / Math.abs(previous) * 100;
25641
+ }
25642
+ function formatPercentageChange(value) {
25643
+ if (value === null) return "";
25644
+ return `${Math.abs(value).toFixed(0)}%`;
25645
+ }
25567
25646
  const LIST_ITEM_CLASS_NAME = "Layer__ProfitAndLossSummariesListItem";
25568
25647
  function ProfitAndLossSummariesListItem({
25569
25648
  children,
@@ -25675,24 +25754,49 @@ function ProfitAndLossSummariesHeading({
25675
25754
  const { size = "2xs" } = variants2 != null ? variants2 : {};
25676
25755
  return /* @__PURE__ */ jsx(Heading$1, { level: 3, size, slot: "heading", children });
25677
25756
  }
25678
- const CLASS_NAME$3 = "Layer__ProfitAndLossSummariesSummary";
25679
25757
  const CHART_AREA_CLASS_NAME = "Layer__ProfitAndLossSummariesSummaryChartArea";
25680
- const CHART_AREA_EMPTY_FRAME_CLASS_NAME = "Layer__ProfitAndLossSummariesSummaryChartAreaEmptyFrame";
25681
25758
  function ProfitAndLossSummariesSummary({
25682
25759
  label,
25683
25760
  amount,
25684
25761
  isLoading,
25762
+ percentChange,
25763
+ comparisonMonth,
25764
+ isExpense = false,
25685
25765
  slots,
25686
25766
  variants: variants2
25687
25767
  }) {
25688
25768
  const { Chart } = slots != null ? slots : {};
25689
- const { size = "2xs" } = variants2 != null ? variants2 : {};
25690
- const dataProperties = toDataProperties({ size });
25691
- return /* @__PURE__ */ jsxs("div", __spreadProps(__spreadValues({ className: CLASS_NAME$3 }, dataProperties), { children: [
25692
- Chart ? /* @__PURE__ */ jsx("div", { className: CHART_AREA_CLASS_NAME, children: Chart }) : /* @__PURE__ */ jsx("div", { className: CHART_AREA_EMPTY_FRAME_CLASS_NAME }),
25693
- /* @__PURE__ */ jsx(ProfitAndLossSummariesHeading, { variants: variants2, children: label }),
25694
- isLoading ? /* @__PURE__ */ jsx(SkeletonLoader, { height: "20px" }) : /* @__PURE__ */ jsx(MoneySpan, { slot: "amount", amount, size: "lg", bold: true })
25695
- ] }));
25769
+ const showPercentChange = percentChange !== void 0 && percentChange !== null && comparisonMonth;
25770
+ const isGoodChange = showPercentChange && (isExpense ? percentChange < 0 : percentChange >= 0);
25771
+ const arrow = showPercentChange && percentChange >= 0 ? "↑" : "↓";
25772
+ return /* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
25773
+ Chart && /* @__PURE__ */ jsx(
25774
+ HStack,
25775
+ {
25776
+ align: "center",
25777
+ justify: "center",
25778
+ className: CHART_AREA_CLASS_NAME,
25779
+ children: Chart
25780
+ }
25781
+ ),
25782
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", fluid: true, pi: "sm", children: [
25783
+ /* @__PURE__ */ jsxs(VStack, { gap: "3xs", fluid: true, children: [
25784
+ /* @__PURE__ */ jsx(ProfitAndLossSummariesHeading, { variants: variants2, children: label }),
25785
+ isLoading ? /* @__PURE__ */ jsx(SkeletonLoader, { height: "20px" }) : /* @__PURE__ */ jsx(MoneySpan, { slot: "amount", amount, size: "lg", weight: "bold" })
25786
+ ] }),
25787
+ showPercentChange && /* @__PURE__ */ jsxs(VStack, { gap: "3xs", align: "end", children: [
25788
+ /* @__PURE__ */ jsxs(HStack, { gap: "3xs", align: "center", children: [
25789
+ /* @__PURE__ */ jsx(Span, { size: "md", weight: "bold", status: isGoodChange ? "success" : void 0, children: arrow }),
25790
+ /* @__PURE__ */ jsx(Span, { size: "md", weight: "normal", status: isGoodChange ? "success" : void 0, children: formatPercentageChange(percentChange != null ? percentChange : null) })
25791
+ ] }),
25792
+ /* @__PURE__ */ jsxs(Span, { size: "xs", variant: "subtle", noWrap: true, children: [
25793
+ "vs.",
25794
+ " ",
25795
+ comparisonMonth || ""
25796
+ ] })
25797
+ ] })
25798
+ ] })
25799
+ ] });
25696
25800
  }
25697
25801
  const CLASS_NAME$2 = "Layer__TransactionsToReview";
25698
25802
  function TransactionsToReview({
@@ -25799,6 +25903,14 @@ function Internal_ProfitAndLossSummaries({
25799
25903
  setSidebarScope,
25800
25904
  sidebarScope
25801
25905
  } = useContext(ProfitAndLossContext);
25906
+ const { startDate, endDate: _endDate } = useGlobalDateRange({ displayMode: "month" });
25907
+ const previousMonthStart = sub(startDate, { months: 1 });
25908
+ const { data: previousData } = useProfitAndLossSummaries({
25909
+ startYear: previousMonthStart.getFullYear(),
25910
+ startMonth: previousMonthStart.getMonth() + 1,
25911
+ endYear: previousMonthStart.getFullYear(),
25912
+ endMonth: previousMonthStart.getMonth() + 1
25913
+ });
25802
25914
  const { revenueChartData, expensesChartData } = useMemo(
25803
25915
  () => ({
25804
25916
  revenueChartData: toMiniChartData({ scope: "revenue", data }),
@@ -25806,7 +25918,35 @@ function Internal_ProfitAndLossSummaries({
25806
25918
  }),
25807
25919
  [data]
25808
25920
  );
25809
- const effectiveData = data != null ? data : { income: { value: 0 }, netProfit: 0 };
25921
+ const effectiveData = useMemo(
25922
+ () => data != null ? data : { income: { value: 0 }, netProfit: 0 },
25923
+ [data]
25924
+ );
25925
+ const comparisonData = useMemo(() => {
25926
+ var _a2, _b2, _c2, _d2, _e, _f, _g;
25927
+ const previousMonthData = (_a2 = previousData == null ? void 0 : previousData.months) == null ? void 0 : _a2[0];
25928
+ if (!previousMonthData) {
25929
+ return null;
25930
+ }
25931
+ const currentRevenue = (_b2 = effectiveData.income.value) != null ? _b2 : 0;
25932
+ const previousRevenue = (_c2 = previousMonthData.income) != null ? _c2 : 0;
25933
+ const currentExpenses = ((_d2 = effectiveData.income.value) != null ? _d2 : 0) - effectiveData.netProfit;
25934
+ const previousExpenses = (_e = previousMonthData.totalExpenses) != null ? _e : 0;
25935
+ const currentNetProfit = (_f = effectiveData.netProfit) != null ? _f : 0;
25936
+ const previousNetProfit = (_g = previousMonthData.netProfit) != null ? _g : 0;
25937
+ return {
25938
+ revenuePercentChange: calculatePercentageChange(currentRevenue, previousRevenue),
25939
+ expensesPercentChange: calculatePercentageChange(currentExpenses, previousExpenses),
25940
+ netProfitPercentChange: calculatePercentageChange(currentNetProfit, previousNetProfit),
25941
+ comparisonMonth: format(previousMonthStart, "MMM")
25942
+ };
25943
+ }, [previousData, effectiveData, previousMonthStart]);
25944
+ const {
25945
+ revenuePercentChange = null,
25946
+ expensesPercentChange = null,
25947
+ netProfitPercentChange = null,
25948
+ comparisonMonth = null
25949
+ } = comparisonData != null ? comparisonData : {};
25810
25950
  const { unstable_AdditionalListItems = [] } = slots != null ? slots : {};
25811
25951
  const listItemCount = unstable_AdditionalListItems.length + 3;
25812
25952
  return /* @__PURE__ */ jsx("section", { className: SECTION_CLASS_NAMES, children: /* @__PURE__ */ jsxs(ProfitAndLossSummariesList, { itemCount: listItemCount, children: [
@@ -25821,6 +25961,8 @@ function Internal_ProfitAndLossSummaries({
25821
25961
  label: (stringOverrides == null ? void 0 : stringOverrides.revenueLabel) || revenueLabel || "Revenue",
25822
25962
  amount: (_a = effectiveData.income.value) != null ? _a : 0,
25823
25963
  isLoading,
25964
+ percentChange: revenuePercentChange,
25965
+ comparisonMonth: comparisonMonth != null ? comparisonMonth : void 0,
25824
25966
  slots: {
25825
25967
  Chart: /* @__PURE__ */ jsx(
25826
25968
  ProfitAndLossSummariesMiniChart,
@@ -25847,6 +25989,9 @@ function Internal_ProfitAndLossSummaries({
25847
25989
  label: (stringOverrides == null ? void 0 : stringOverrides.expensesLabel) || "Expenses",
25848
25990
  amount: ((_c = (_b = effectiveData == null ? void 0 : effectiveData.income) == null ? void 0 : _b.value) != null ? _c : 0) - effectiveData.netProfit,
25849
25991
  isLoading,
25992
+ percentChange: expensesPercentChange,
25993
+ comparisonMonth: comparisonMonth != null ? comparisonMonth : void 0,
25994
+ isExpense: true,
25850
25995
  slots: {
25851
25996
  Chart: /* @__PURE__ */ jsx(
25852
25997
  ProfitAndLossSummariesMiniChart,
@@ -25868,16 +26013,18 @@ function Internal_ProfitAndLossSummaries({
25868
26013
  label: (stringOverrides == null ? void 0 : stringOverrides.netProfitLabel) || "Net Profit",
25869
26014
  amount: (_d = data == null ? void 0 : data.netProfit) != null ? _d : 0,
25870
26015
  variants: variants2,
25871
- isLoading
26016
+ isLoading,
26017
+ percentChange: netProfitPercentChange,
26018
+ comparisonMonth: comparisonMonth != null ? comparisonMonth : void 0
25872
26019
  }
25873
26020
  ) }),
25874
26021
  unstable_AdditionalListItems.map((item, index) => /* @__PURE__ */ jsx(ProfitAndLossSummariesListItem, { children: item }, index))
25875
26022
  ] }) });
25876
26023
  }
25877
- function ProfitAndLossSummaries(_Cc) {
25878
- var _Dc = _Cc, {
26024
+ function ProfitAndLossSummaries(_Gc) {
26025
+ var _Hc = _Gc, {
25879
26026
  onTransactionsToReviewClick
25880
- } = _Dc, restProps = __objRest(_Dc, [
26027
+ } = _Hc, restProps = __objRest(_Hc, [
25881
26028
  "onTransactionsToReviewClick"
25882
26029
  ]);
25883
26030
  return /* @__PURE__ */ jsx(
@@ -26077,8 +26224,8 @@ function BalanceSheetDownloadButton({
26077
26224
  /* @__PURE__ */ jsx(InvisibleDownload, { ref: invisibleDownloadRef })
26078
26225
  ] });
26079
26226
  }
26080
- const Collapse = (_Ec) => {
26081
- var props = __objRest(_Ec, []);
26227
+ const Collapse = (_Ic) => {
26228
+ var props = __objRest(_Ic, []);
26082
26229
  return /* @__PURE__ */ jsxs(
26083
26230
  "svg",
26084
26231
  __spreadProps(__spreadValues({
@@ -26111,8 +26258,8 @@ const Collapse = (_Ec) => {
26111
26258
  })
26112
26259
  );
26113
26260
  };
26114
- const Expand = (_Fc) => {
26115
- var props = __objRest(_Fc, []);
26261
+ const Expand = (_Jc) => {
26262
+ var props = __objRest(_Jc, []);
26116
26263
  return /* @__PURE__ */ jsxs(
26117
26264
  "svg",
26118
26265
  __spreadProps(__spreadValues({
@@ -27760,8 +27907,8 @@ const ChartOfAccountsContext = createContext(
27760
27907
  }
27761
27908
  }
27762
27909
  );
27763
- const Plus = (_Gc) => {
27764
- var _Hc = _Gc, { size = 14 } = _Hc, props = __objRest(_Hc, ["size"]);
27910
+ const Plus = (_Kc) => {
27911
+ var _Lc = _Kc, { size = 14 } = _Lc, props = __objRest(_Lc, ["size"]);
27765
27912
  return /* @__PURE__ */ jsxs(
27766
27913
  "svg",
27767
27914
  __spreadProps(__spreadValues({
@@ -28128,8 +28275,8 @@ var LedgerAccountNodeType = /* @__PURE__ */ ((LedgerAccountNodeType2) => {
28128
28275
  LedgerAccountNodeType2["Parent"] = "Parent";
28129
28276
  return LedgerAccountNodeType2;
28130
28277
  })(LedgerAccountNodeType || {});
28131
- const Edit2 = (_Ic) => {
28132
- var _Jc = _Ic, { size = 18 } = _Jc, props = __objRest(_Jc, ["size"]);
28278
+ const Edit2 = (_Mc) => {
28279
+ var _Nc = _Mc, { size = 18 } = _Nc, props = __objRest(_Nc, ["size"]);
28133
28280
  return /* @__PURE__ */ jsx(
28134
28281
  "svg",
28135
28282
  __spreadProps(__spreadValues({
@@ -30810,8 +30957,8 @@ function usePaginatedList(list, pageSize) {
30810
30957
  reset
30811
30958
  };
30812
30959
  }
30813
- const SmileIcon = (_Kc) => {
30814
- var _Lc = _Kc, { size = 12 } = _Lc, props = __objRest(_Lc, ["size"]);
30960
+ const SmileIcon = (_Oc) => {
30961
+ var _Pc = _Oc, { size = 12 } = _Pc, props = __objRest(_Pc, ["size"]);
30815
30962
  return /* @__PURE__ */ jsxs(
30816
30963
  "svg",
30817
30964
  __spreadProps(__spreadValues({
@@ -31656,8 +31803,8 @@ const useBookkeepingYearsStatus = () => {
31656
31803
  isLoading
31657
31804
  };
31658
31805
  };
31659
- const ArrowRightCircle = (_Mc) => {
31660
- var _Nc = _Mc, { size = 18 } = _Nc, props = __objRest(_Nc, ["size"]);
31806
+ const ArrowRightCircle = (_Qc) => {
31807
+ var _Rc = _Qc, { size = 18 } = _Rc, props = __objRest(_Rc, ["size"]);
31661
31808
  return /* @__PURE__ */ jsxs(
31662
31809
  "svg",
31663
31810
  __spreadProps(__spreadValues({
@@ -33705,12 +33852,12 @@ const FormSection = ({ children, title }) => {
33705
33852
  children
33706
33853
  ] });
33707
33854
  };
33708
- const PhoneInput = (_Oc) => {
33709
- var _Pc = _Oc, {
33855
+ const PhoneInput = (_Sc) => {
33856
+ var _Tc = _Sc, {
33710
33857
  value,
33711
33858
  onChange,
33712
33859
  placeholder = "Phone number"
33713
- } = _Pc, props = __objRest(_Pc, [
33860
+ } = _Tc, props = __objRest(_Tc, [
33714
33861
  "value",
33715
33862
  "onChange",
33716
33863
  "placeholder"
@@ -34002,8 +34149,8 @@ const SummaryStep = ({ onNext, title = defaultTitle$1, description = defaultDesc
34002
34149
  /* @__PURE__ */ jsx(Button$1, { onClick: onNext, children: nextBtnText })
34003
34150
  ] });
34004
34151
  };
34005
- const Document = (_Qc) => {
34006
- var _Rc = _Qc, { size = 20 } = _Rc, props = __objRest(_Rc, ["size"]);
34152
+ const Document = (_Uc) => {
34153
+ var _Vc = _Uc, { size = 20 } = _Vc, props = __objRest(_Vc, ["size"]);
34007
34154
  return /* @__PURE__ */ jsxs(
34008
34155
  "svg",
34009
34156
  __spreadProps(__spreadValues({
@@ -34108,8 +34255,8 @@ const Document = (_Qc) => {
34108
34255
  })
34109
34256
  );
34110
34257
  };
34111
- const TrendingUp = (_Sc) => {
34112
- var _Tc = _Sc, { size = 20 } = _Tc, props = __objRest(_Tc, ["size"]);
34258
+ const TrendingUp = (_Wc) => {
34259
+ var _Xc = _Wc, { size = 20 } = _Xc, props = __objRest(_Xc, ["size"]);
34113
34260
  return /* @__PURE__ */ jsxs(
34114
34261
  "svg",
34115
34262
  __spreadProps(__spreadValues({
@@ -34366,8 +34513,8 @@ const PlatformOnboarding = ({ onComplete }) => {
34366
34513
  /* @__PURE__ */ jsx("div", { className: "Layer__platform-onboarding-layout__footer", children: renderStepFooter() })
34367
34514
  ] }) });
34368
34515
  };
34369
- const CoffeeIcon = (_Uc) => {
34370
- var _Vc = _Uc, { size = 11 } = _Vc, props = __objRest(_Vc, ["size"]);
34516
+ const CoffeeIcon = (_Yc) => {
34517
+ var _Zc = _Yc, { size = 11 } = _Zc, props = __objRest(_Zc, ["size"]);
34371
34518
  return /* @__PURE__ */ jsxs(
34372
34519
  "svg",
34373
34520
  __spreadProps(__spreadValues({
@@ -34438,8 +34585,8 @@ const CoffeeIcon = (_Uc) => {
34438
34585
  })
34439
34586
  );
34440
34587
  };
34441
- const Link$1 = (_Wc) => {
34442
- var _Xc = _Wc, {
34588
+ const Link$1 = (__c) => {
34589
+ var _$c = __c, {
34443
34590
  className,
34444
34591
  children,
34445
34592
  variant = ButtonVariant.primary,
@@ -34449,7 +34596,7 @@ const Link$1 = (_Wc) => {
34449
34596
  iconAsPrimary = false,
34450
34597
  justify = "center",
34451
34598
  fullWidth
34452
- } = _Xc, props = __objRest(_Xc, [
34599
+ } = _$c, props = __objRest(_$c, [
34453
34600
  "className",
34454
34601
  "children",
34455
34602
  "variant",
@@ -34541,8 +34688,8 @@ const BookkeepingUpsellBar = ({
34541
34688
  onClick ? /* @__PURE__ */ jsx(Button$1, { variant: ButtonVariant.secondary, onClick, children: "Schedule a demo" }) : href ? /* @__PURE__ */ jsx(Link$1, { href, target: "_blank", variant: ButtonVariant.secondary, children: "Schedule a demo" }) : null
34542
34689
  ] });
34543
34690
  };
34544
- const ChevronRightFill = (_Yc) => {
34545
- var _Zc = _Yc, { size = 18 } = _Zc, props = __objRest(_Zc, ["size"]);
34691
+ const ChevronRightFill = (_ad) => {
34692
+ var _bd = _ad, { size = 18 } = _bd, props = __objRest(_bd, ["size"]);
34546
34693
  return /* @__PURE__ */ jsxs(
34547
34694
  "svg",
34548
34695
  __spreadProps(__spreadValues({
@@ -37824,8 +37971,8 @@ const getClassnameForSubComponent = (className, suffix) => {
37824
37971
  };
37825
37972
  const METER_CLASS_NAME = "Layer__Meter";
37826
37973
  const Meter = forwardRef(
37827
- function Meter2(__c, ref) {
37828
- var _$c = __c, { className, label, meterOnly } = _$c, restProps = __objRest(_$c, ["className", "label", "meterOnly"]);
37974
+ function Meter2(_cd, ref) {
37975
+ var _dd = _cd, { className, label, meterOnly } = _dd, restProps = __objRest(_dd, ["className", "label", "meterOnly"]);
37829
37976
  return /* @__PURE__ */ jsx(Meter$1, __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, restProps), { className: classNames(METER_CLASS_NAME, className), ref }), meterOnly && { "aria-label": label }), { children: ({ percentage, valueText }) => /* @__PURE__ */ jsxs(VStack, { gap: "3xs", fluid: true, children: [
37830
37977
  !meterOnly && /* @__PURE__ */ jsxs(HStack, { justify: "space-between", children: [
37831
37978
  /* @__PURE__ */ jsx(Label, { slot: "label", children: label }),
@@ -37940,11 +38087,11 @@ const ProfitAndLossView = (props) => {
37940
38087
  const containerRef = useRef(null);
37941
38088
  return /* @__PURE__ */ jsx(Container, { name: COMPONENT_NAME$3, ref: containerRef, children: /* @__PURE__ */ jsx(ProfitAndLoss, { children: /* @__PURE__ */ jsx(ProfitAndLossPanel, __spreadValues({ containerRef }, props)) }) });
37942
38089
  };
37943
- const ProfitAndLossPanel = (_ad) => {
37944
- var _bd = _ad, {
38090
+ const ProfitAndLossPanel = (_ed) => {
38091
+ var _fd = _ed, {
37945
38092
  containerRef,
37946
38093
  stringOverrides
37947
- } = _bd, props = __objRest(_bd, [
38094
+ } = _fd, props = __objRest(_fd, [
37948
38095
  "containerRef",
37949
38096
  "stringOverrides"
37950
38097
  ]);
@@ -38207,13 +38354,13 @@ function ExpandableDataTable({
38207
38354
  );
38208
38355
  }
38209
38356
  const UNIFIED_REPORT_TAG_KEY = "#unified-report";
38210
- function buildKey$7(_cd) {
38211
- var _dd = _cd, {
38357
+ function buildKey$7(_gd) {
38358
+ var _hd = _gd, {
38212
38359
  access_token: accessToken,
38213
38360
  apiUrl,
38214
38361
  businessId,
38215
38362
  report
38216
- } = _dd, dateParams = __objRest(_dd, [
38363
+ } = _hd, dateParams = __objRest(_hd, [
38217
38364
  "access_token",
38218
38365
  "apiUrl",
38219
38366
  "businessId",
@@ -38229,8 +38376,8 @@ function buildKey$7(_cd) {
38229
38376
  }, dateParams);
38230
38377
  }
38231
38378
  }
38232
- const getUnifiedReport = get((_ed) => {
38233
- var _fd = _ed, { businessId, report } = _fd, dateParams = __objRest(_fd, ["businessId", "report"]);
38379
+ const getUnifiedReport = get((_id) => {
38380
+ var _jd = _id, { businessId, report } = _jd, dateParams = __objRest(_jd, ["businessId", "report"]);
38234
38381
  const parameters = toDefinedSearchParameters(__spreadValues({}, dateParams));
38235
38382
  return `/v1/businesses/${businessId}/reports/unified/${report}?${parameters}`;
38236
38383
  });
@@ -38259,8 +38406,8 @@ class UnifiedReportSWRResponse {
38259
38406
  return this.swrResponse.mutate;
38260
38407
  }
38261
38408
  }
38262
- function useUnifiedReport(_gd) {
38263
- var _hd = _gd, { report } = _hd, dateParams = __objRest(_hd, ["report"]);
38409
+ function useUnifiedReport(_kd) {
38410
+ var _ld = _kd, { report } = _ld, dateParams = __objRest(_ld, ["report"]);
38264
38411
  const { data: auth } = useAuth();
38265
38412
  const { apiUrl } = useEnvironment();
38266
38413
  const { businessId } = useLayerContext();
@@ -39790,19 +39937,19 @@ const VendorsProvider = ({ children }) => {
39790
39937
  const vendors = useVendors();
39791
39938
  return /* @__PURE__ */ jsx(VendorsContext.Provider, { value: vendors, children });
39792
39939
  };
39793
- const SelectVendor = (_id) => {
39794
- var _jd = _id, { withContext = true } = _jd, props = __objRest(_jd, ["withContext"]);
39940
+ const SelectVendor = (_md) => {
39941
+ var _nd = _md, { withContext = true } = _nd, props = __objRest(_nd, ["withContext"]);
39795
39942
  if (withContext) {
39796
39943
  return /* @__PURE__ */ jsx(VendorsProvider, { children: /* @__PURE__ */ jsx(SelectVendorContent, __spreadValues({}, props)) });
39797
39944
  }
39798
39945
  return /* @__PURE__ */ jsx(SelectVendorContent, __spreadValues({}, props));
39799
39946
  };
39800
- const SelectVendorContent = (_kd) => {
39801
- var _ld = _kd, {
39947
+ const SelectVendorContent = (_od) => {
39948
+ var _pd = _od, {
39802
39949
  value,
39803
39950
  onChange,
39804
39951
  placeholder = "Select vendor"
39805
- } = _ld, props = __objRest(_ld, [
39952
+ } = _pd, props = __objRest(_pd, [
39806
39953
  "value",
39807
39954
  "onChange",
39808
39955
  "placeholder"
@@ -40569,8 +40716,8 @@ const BillsTableWithPanel = ({
40569
40716
  }
40570
40717
  );
40571
40718
  };
40572
- const Bills = (_md) => {
40573
- var _nd = _md, { context = true } = _nd, props = __objRest(_nd, ["context"]);
40719
+ const Bills = (_qd) => {
40720
+ var _rd = _qd, { context = true } = _rd, props = __objRest(_rd, ["context"]);
40574
40721
  if (context) {
40575
40722
  return /* @__PURE__ */ jsx(BillsProvider, { children: /* @__PURE__ */ jsx(BillsContent, __spreadValues({}, props)) });
40576
40723
  }
@@ -40628,8 +40775,8 @@ const getTimezoneDisplay = (date) => {
40628
40775
  };
40629
40776
  const LINK_CLASS_NAME = "Layer__UI__Link";
40630
40777
  const Link = forwardRef(
40631
- function Link2(_od, ref) {
40632
- var _pd = _od, {
40778
+ function Link2(_sd, ref) {
40779
+ var _td = _sd, {
40633
40780
  children,
40634
40781
  size = "md",
40635
40782
  ellipsis,
@@ -40638,7 +40785,7 @@ const Link = forwardRef(
40638
40785
  href,
40639
40786
  target,
40640
40787
  rel
40641
- } = _pd, restProps = __objRest(_pd, [
40788
+ } = _td, restProps = __objRest(_td, [
40642
40789
  "children",
40643
40790
  "size",
40644
40791
  "ellipsis",
@@ -41141,8 +41288,10 @@ const VehicleSchema = Schema.Struct({
41141
41288
  Schema.propertySignature(Schema.NullishOr(Schema.String)),
41142
41289
  Schema.fromKey("external_id")
41143
41290
  ),
41144
- make: Schema.String,
41145
- model: Schema.String,
41291
+ makeAndModel: pipe(
41292
+ Schema.propertySignature(Schema.String),
41293
+ Schema.fromKey("make_and_model")
41294
+ ),
41146
41295
  year: Schema.Number,
41147
41296
  licensePlate: pipe(
41148
41297
  Schema.propertySignature(Schema.NullishOr(Schema.String)),
@@ -41164,16 +41313,17 @@ const VehicleSchema = Schema.Struct({
41164
41313
  )
41165
41314
  });
41166
41315
  Schema.Struct({
41167
- make: Schema.String,
41168
- model: Schema.String,
41316
+ makeAndModel: Schema.String,
41169
41317
  year: Schema.Number,
41170
41318
  licensePlate: Schema.String,
41171
41319
  vin: Schema.String,
41172
41320
  description: Schema.String
41173
41321
  });
41174
41322
  const UpsertVehicleSchema = Schema.Struct({
41175
- make: Schema.String,
41176
- model: Schema.String,
41323
+ makeAndModel: pipe(
41324
+ Schema.propertySignature(Schema.String),
41325
+ Schema.fromKey("make_and_model")
41326
+ ),
41177
41327
  year: Schema.Number,
41178
41328
  licensePlate: pipe(
41179
41329
  Schema.propertySignature(Schema.NullishOr(Schema.String)),
@@ -41415,9 +41565,6 @@ const getTripFormDefaultValues = (trip) => {
41415
41565
  const validateTripForm = ({ trip }) => {
41416
41566
  const { vehicle, tripDate, distance, purpose } = trip;
41417
41567
  const errors = [];
41418
- if (vehicle === null) {
41419
- errors.push({ vehicle: "Vehicle is a required field." });
41420
- }
41421
41568
  if (tripDate === null) {
41422
41569
  errors.push({ tripDate: "Trip date is a required field." });
41423
41570
  }
@@ -41430,6 +41577,9 @@ const validateTripForm = ({ trip }) => {
41430
41577
  if (!purpose) {
41431
41578
  errors.push({ purpose: "Purpose is a required field." });
41432
41579
  }
41580
+ if (vehicle === null) {
41581
+ errors.push({ vehicle: "Vehicle is a required field." });
41582
+ }
41433
41583
  return errors.length > 0 ? errors : null;
41434
41584
  };
41435
41585
  const convertTripFormToUpsertTrip = (form) => {
@@ -41728,8 +41878,7 @@ const useTripForm = (props) => {
41728
41878
  );
41729
41879
  };
41730
41880
  const formatDistance = (distance) => {
41731
- const distanceNum = parseFloat(BigDecimal.unsafeToNumber(distance).toString());
41732
- return `${distanceNum.toFixed(1)} mi`;
41881
+ return `${BigDecimal.format(distance)} mi`;
41733
41882
  };
41734
41883
  const getPurposeLabel = (purpose) => {
41735
41884
  var _a;
@@ -41842,7 +41991,7 @@ function useListVehicles() {
41842
41991
  );
41843
41992
  return new ListVehiclesSWRResponse(response);
41844
41993
  }
41845
- const getVehicleDisplayName = (vehicle) => [vehicle.year, vehicle.make, vehicle.model].join(" ");
41994
+ const getVehicleDisplayName = (vehicle) => `${vehicle.year} ${vehicle.makeAndModel}`;
41846
41995
  class VehicleAsOption {
41847
41996
  constructor(vehicle) {
41848
41997
  __publicField(this, "internalVehicle");
@@ -41957,33 +42106,88 @@ const TripForm = (props) => {
41957
42106
  ) });
41958
42107
  }
41959
42108
  } }),
41960
- /* @__PURE__ */ jsx(form.Field, { name: "vehicle", children: (field) => /* @__PURE__ */ jsx(
41961
- VehicleSelector,
42109
+ /* @__PURE__ */ jsx(form.AppField, { name: "tripDate", children: (field) => /* @__PURE__ */ jsx(
42110
+ field.FormDateField,
41962
42111
  {
41963
- selectedVehicle: field.state.value,
41964
- onSelectedVehicleChange: field.handleChange,
42112
+ label: "Trip date",
42113
+ inline: true,
41965
42114
  isReadOnly,
42115
+ className: `${TRIP_FORM_FIELD_CSS_PREFIX}__TripDate`
42116
+ }
42117
+ ) }),
42118
+ /* @__PURE__ */ jsx(form.AppField, { name: "distance", children: (field) => /* @__PURE__ */ jsx(
42119
+ field.FormBigDecimalField,
42120
+ {
42121
+ label: "Distance (miles)",
41966
42122
  inline: true,
41967
- containerClassName: `${TRIP_FORM_FIELD_CSS_PREFIX}__Vehicle`
42123
+ isReadOnly,
42124
+ maxDecimalPlaces: 2,
42125
+ placeholder: "Enter distance",
42126
+ className: `${TRIP_FORM_FIELD_CSS_PREFIX}__Distance`
42127
+ }
42128
+ ) }),
42129
+ /* @__PURE__ */ jsx(form.AppField, { name: "startAddress", children: (field) => /* @__PURE__ */ jsx(
42130
+ field.FormTextField,
42131
+ {
42132
+ label: "Start address",
42133
+ inline: true,
42134
+ isReadOnly,
42135
+ placeholder: "Enter address",
42136
+ className: `${TRIP_FORM_FIELD_CSS_PREFIX}__StartAddress`
42137
+ }
42138
+ ) }),
42139
+ /* @__PURE__ */ jsx(form.AppField, { name: "endAddress", children: (field) => /* @__PURE__ */ jsx(
42140
+ field.FormTextField,
42141
+ {
42142
+ label: "End address",
42143
+ inline: true,
42144
+ isReadOnly,
42145
+ placeholder: "Enter address",
42146
+ className: `${TRIP_FORM_FIELD_CSS_PREFIX}__EndAddress`
41968
42147
  }
41969
42148
  ) }),
41970
- /* @__PURE__ */ jsx(form.AppField, { name: "tripDate", children: (field) => /* @__PURE__ */ jsx(field.FormDateField, { label: "Trip date", inline: true, className: `${TRIP_FORM_FIELD_CSS_PREFIX}__TripDate`, isReadOnly }) }),
41971
- /* @__PURE__ */ jsx(form.AppField, { name: "distance", children: (field) => /* @__PURE__ */ jsx(field.FormBigDecimalField, { label: "Distance (miles)", inline: true, className: `${TRIP_FORM_FIELD_CSS_PREFIX}__Distance`, isReadOnly, maxDecimalPlaces: 1 }) }),
41972
42149
  /* @__PURE__ */ jsx(form.Field, { name: "purpose", children: (field) => /* @__PURE__ */ jsx(
41973
42150
  TripPurposeComboBox,
41974
42151
  {
41975
- className: `${TRIP_FORM_FIELD_CSS_PREFIX}__Purpose`,
41976
42152
  value: field.state.value,
41977
42153
  onValueChange: (value) => field.handleChange(value != null ? value : TripPurpose.Unreviewed),
41978
- isReadOnly
42154
+ isReadOnly,
42155
+ className: `${TRIP_FORM_FIELD_CSS_PREFIX}__Purpose`
41979
42156
  }
41980
42157
  ) }),
41981
- /* @__PURE__ */ jsx(form.AppField, { name: "startAddress", children: (field) => /* @__PURE__ */ jsx(field.FormTextField, { label: "Start address", inline: true, className: `${TRIP_FORM_FIELD_CSS_PREFIX}__StartAddress`, isReadOnly }) }),
41982
- /* @__PURE__ */ jsx(form.AppField, { name: "endAddress", children: (field) => /* @__PURE__ */ jsx(field.FormTextField, { label: "End address", inline: true, className: `${TRIP_FORM_FIELD_CSS_PREFIX}__EndAddress`, isReadOnly }) }),
41983
- /* @__PURE__ */ jsx(form.AppField, { name: "description", children: (field) => /* @__PURE__ */ jsx(field.FormTextAreaField, { label: "Description", inline: true, className: `${TRIP_FORM_FIELD_CSS_PREFIX}__Description`, isReadOnly }) }),
41984
- /* @__PURE__ */ jsx(VStack, { justify: "end", className: `${TRIP_FORM_CSS_PREFIX}__Submit`, children: /* @__PURE__ */ jsx(form.Subscribe, { selector: (state) => [state.canSubmit, state.isSubmitting], children: ([canSubmit, isSubmitting]) => /* @__PURE__ */ jsx(Button, { type: "submit", isDisabled: !canSubmit, isPending: isSubmitting, onPress: () => {
41985
- void form.handleSubmit();
41986
- }, children: "Save Trip" }) }) })
42158
+ /* @__PURE__ */ jsx(form.AppField, { name: "description", children: (field) => /* @__PURE__ */ jsx(
42159
+ field.FormTextAreaField,
42160
+ {
42161
+ label: "Description",
42162
+ inline: true,
42163
+ isReadOnly,
42164
+ placeholder: "Add description",
42165
+ className: `${TRIP_FORM_FIELD_CSS_PREFIX}__Description`
42166
+ }
42167
+ ) }),
42168
+ /* @__PURE__ */ jsx(form.Field, { name: "vehicle", children: (field) => /* @__PURE__ */ jsx(
42169
+ VehicleSelector,
42170
+ {
42171
+ selectedVehicle: field.state.value,
42172
+ onSelectedVehicleChange: field.handleChange,
42173
+ isReadOnly,
42174
+ inline: true,
42175
+ placeholder: "Add vehicle",
42176
+ containerClassName: `${TRIP_FORM_FIELD_CSS_PREFIX}__Vehicle`
42177
+ }
42178
+ ) }),
42179
+ /* @__PURE__ */ jsx(VStack, { justify: "end", className: `${TRIP_FORM_CSS_PREFIX}__Submit`, children: /* @__PURE__ */ jsx(form.Subscribe, { selector: (state) => [state.canSubmit, state.isSubmitting], children: ([canSubmit, isSubmitting]) => /* @__PURE__ */ jsx(
42180
+ Button,
42181
+ {
42182
+ type: "submit",
42183
+ isDisabled: !canSubmit,
42184
+ isPending: isSubmitting,
42185
+ onPress: () => {
42186
+ void form.handleSubmit();
42187
+ },
42188
+ children: "Save Trip"
42189
+ }
42190
+ ) }) })
41987
42191
  ] });
41988
42192
  };
41989
42193
  const TripsTableHeaderMenu = () => {
@@ -42215,32 +42419,40 @@ const TripsTable = () => {
42215
42419
  }
42216
42420
  )
42217
42421
  ] }),
42218
- /* @__PURE__ */ jsx(Drawer, { isOpen: isTripDrawerOpen, onOpenChange: setIsTripDrawerOpen, "aria-label": selectedTrip ? "Trip details" : "Record trip", children: ({ close: close2 }) => /* @__PURE__ */ jsxs(VStack, { pb: "lg", children: [
42219
- /* @__PURE__ */ jsx(VStack, { pi: "md", children: /* @__PURE__ */ jsx(
42220
- ModalTitleWithClose,
42221
- {
42222
- heading: /* @__PURE__ */ jsx(ModalHeading, { size: "md", children: selectedTrip ? "Trip details" : "Record trip" }),
42223
- onClose: close2
42224
- }
42225
- ) }),
42226
- /* @__PURE__ */ jsx(
42227
- TripForm,
42228
- {
42229
- trip: selectedTrip != null ? selectedTrip : void 0,
42230
- onSuccess: () => {
42231
- setSelectedTrip(null);
42232
- close2();
42233
- }
42234
- }
42235
- )
42236
- ] }) })
42422
+ /* @__PURE__ */ jsx(
42423
+ Drawer,
42424
+ {
42425
+ isOpen: isTripDrawerOpen,
42426
+ onOpenChange: setIsTripDrawerOpen,
42427
+ isDismissable: true,
42428
+ "aria-label": selectedTrip ? "Trip details" : "Record trip",
42429
+ children: ({ close: close2 }) => /* @__PURE__ */ jsxs(VStack, { pb: "lg", children: [
42430
+ /* @__PURE__ */ jsx(VStack, { pi: "md", children: /* @__PURE__ */ jsx(
42431
+ ModalTitleWithClose,
42432
+ {
42433
+ heading: /* @__PURE__ */ jsx(ModalHeading, { size: "md", children: selectedTrip ? "Trip details" : "Record trip" }),
42434
+ onClose: close2
42435
+ }
42436
+ ) }),
42437
+ /* @__PURE__ */ jsx(
42438
+ TripForm,
42439
+ {
42440
+ trip: selectedTrip != null ? selectedTrip : void 0,
42441
+ onSuccess: () => {
42442
+ setSelectedTrip(null);
42443
+ close2();
42444
+ }
42445
+ }
42446
+ )
42447
+ ] })
42448
+ }
42449
+ )
42237
42450
  ] });
42238
42451
  };
42239
42452
  const getVehicleFormDefaultValues = (vehicle) => {
42240
42453
  if (vehicle) {
42241
42454
  return {
42242
- make: vehicle.make,
42243
- model: vehicle.model,
42455
+ makeAndModel: vehicle.makeAndModel,
42244
42456
  year: vehicle.year,
42245
42457
  licensePlate: vehicle.licensePlate || "",
42246
42458
  vin: vehicle.vin || "",
@@ -42248,33 +42460,31 @@ const getVehicleFormDefaultValues = (vehicle) => {
42248
42460
  };
42249
42461
  }
42250
42462
  return {
42251
- make: "",
42252
- model: "",
42253
- year: (/* @__PURE__ */ new Date()).getFullYear(),
42463
+ makeAndModel: "",
42464
+ year: Number.NaN,
42254
42465
  licensePlate: "",
42255
42466
  vin: "",
42256
42467
  description: ""
42257
42468
  };
42258
42469
  };
42259
42470
  const validateVehicleForm = ({ vehicle }) => {
42260
- const { make, model, year } = vehicle;
42471
+ const { makeAndModel, year } = vehicle;
42261
42472
  const errors = [];
42262
- if (!make.trim()) {
42263
- errors.push({ make: "Make is a required field." });
42473
+ if (!makeAndModel.trim()) {
42474
+ errors.push({ makeAndModel: "Make and model is a required field." });
42264
42475
  }
42265
- if (!model.trim()) {
42266
- errors.push({ model: "Model is a required field." });
42476
+ if (Number.isNaN(year)) {
42477
+ errors.push({ year: "Year is a required field." });
42267
42478
  }
42268
42479
  const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
42269
- if (year < 1900 || year > currentYear + 1) {
42480
+ if (!Number.isNaN(year) && (year < 1900 || year > currentYear + 1)) {
42270
42481
  errors.push({ year: `Year must be between 1900 and ${currentYear + 1}.` });
42271
42482
  }
42272
42483
  return errors.length > 0 ? errors : null;
42273
42484
  };
42274
42485
  const convertVehicleFormToUpsertVehicle = (form) => {
42275
42486
  return {
42276
- make: form.make.trim(),
42277
- model: form.model.trim(),
42487
+ makeAndModel: form.makeAndModel.trim(),
42278
42488
  year: form.year,
42279
42489
  licensePlate: form.licensePlate.trim() || null,
42280
42490
  vin: form.vin.trim() || null,
@@ -42464,20 +42674,73 @@ const VehicleForm = (props) => {
42464
42674
  ) });
42465
42675
  }
42466
42676
  } }),
42467
- /* @__PURE__ */ jsx(form.AppField, { name: "make", children: (field) => /* @__PURE__ */ jsx(field.FormTextField, { label: "Make", inline: true, className: `${VEHICLE_FORM_FIELD_CSS_PREFIX}__Make`, isReadOnly }) }),
42468
- /* @__PURE__ */ jsx(form.AppField, { name: "model", children: (field) => /* @__PURE__ */ jsx(field.FormTextField, { label: "Model", inline: true, className: `${VEHICLE_FORM_FIELD_CSS_PREFIX}__Model`, isReadOnly }) }),
42469
- /* @__PURE__ */ jsx(form.AppField, { name: "year", children: (field) => /* @__PURE__ */ jsx(field.FormNumberField, { maxValue: 9999, label: "Year", inline: true, className: `${VEHICLE_FORM_FIELD_CSS_PREFIX}__Year`, isReadOnly }) }),
42470
- /* @__PURE__ */ jsx(form.AppField, { name: "licensePlate", children: (field) => /* @__PURE__ */ jsx(field.FormTextField, { label: "License plate", inline: true, className: `${VEHICLE_FORM_FIELD_CSS_PREFIX}__LicensePlate`, isReadOnly }) }),
42471
- /* @__PURE__ */ jsx(form.AppField, { name: "vin", children: (field) => /* @__PURE__ */ jsx(field.FormTextField, { label: "VIN", inline: true, className: `${VEHICLE_FORM_FIELD_CSS_PREFIX}__Vin`, isReadOnly }) }),
42472
- /* @__PURE__ */ jsx(form.AppField, { name: "description", children: (field) => /* @__PURE__ */ jsx(field.FormTextAreaField, { label: "Description", inline: true, className: `${VEHICLE_FORM_FIELD_CSS_PREFIX}__Description`, isReadOnly }) }),
42473
- /* @__PURE__ */ jsx(VStack, { justify: "end", className: `${VEHICLE_FORM_CSS_PREFIX}__Submit`, children: /* @__PURE__ */ jsx(form.Subscribe, { selector: (state) => [state.canSubmit, state.isSubmitting], children: ([canSubmit, isSubmitting]) => /* @__PURE__ */ jsx(Button, { type: "submit", isDisabled: !canSubmit, isPending: isSubmitting, onPress: () => {
42474
- void form.handleSubmit();
42475
- }, children: "Save Vehicle" }) }) })
42677
+ /* @__PURE__ */ jsx(form.AppField, { name: "makeAndModel", children: (field) => /* @__PURE__ */ jsx(
42678
+ field.FormTextField,
42679
+ {
42680
+ label: "Make and model",
42681
+ inline: true,
42682
+ isReadOnly,
42683
+ placeholder: "Enter vehicle make and model",
42684
+ className: `${VEHICLE_FORM_FIELD_CSS_PREFIX}__MakeAndModel`
42685
+ }
42686
+ ) }),
42687
+ /* @__PURE__ */ jsx(form.AppField, { name: "year", children: (field) => /* @__PURE__ */ jsx(
42688
+ field.FormNumberField,
42689
+ {
42690
+ maxValue: 9999,
42691
+ label: "Year",
42692
+ inline: true,
42693
+ isReadOnly,
42694
+ placeholder: "Enter vehicle year",
42695
+ className: `${VEHICLE_FORM_FIELD_CSS_PREFIX}__Year`
42696
+ }
42697
+ ) }),
42698
+ /* @__PURE__ */ jsx(form.AppField, { name: "licensePlate", children: (field) => /* @__PURE__ */ jsx(
42699
+ field.FormTextField,
42700
+ {
42701
+ label: "License plate",
42702
+ inline: true,
42703
+ isReadOnly,
42704
+ placeholder: "Enter license plate",
42705
+ className: `${VEHICLE_FORM_FIELD_CSS_PREFIX}__LicensePlate`
42706
+ }
42707
+ ) }),
42708
+ /* @__PURE__ */ jsx(form.AppField, { name: "vin", children: (field) => /* @__PURE__ */ jsx(
42709
+ field.FormTextField,
42710
+ {
42711
+ label: "VIN",
42712
+ inline: true,
42713
+ isReadOnly,
42714
+ placeholder: "Enter VIN",
42715
+ className: `${VEHICLE_FORM_FIELD_CSS_PREFIX}__Vin`
42716
+ }
42717
+ ) }),
42718
+ /* @__PURE__ */ jsx(form.AppField, { name: "description", children: (field) => /* @__PURE__ */ jsx(
42719
+ field.FormTextAreaField,
42720
+ {
42721
+ label: "Description",
42722
+ inline: true,
42723
+ isReadOnly,
42724
+ placeholder: "Add description",
42725
+ className: `${VEHICLE_FORM_FIELD_CSS_PREFIX}__Description`
42726
+ }
42727
+ ) }),
42728
+ /* @__PURE__ */ jsx(VStack, { justify: "end", className: `${VEHICLE_FORM_CSS_PREFIX}__Submit`, children: /* @__PURE__ */ jsx(form.Subscribe, { selector: (state) => [state.canSubmit, state.isSubmitting], children: ([canSubmit, isSubmitting]) => /* @__PURE__ */ jsx(
42729
+ Button,
42730
+ {
42731
+ type: "submit",
42732
+ isDisabled: !canSubmit,
42733
+ isPending: isSubmitting,
42734
+ onPress: () => {
42735
+ void form.handleSubmit();
42736
+ },
42737
+ children: "Save Vehicle"
42738
+ }
42739
+ ) }) })
42476
42740
  ] });
42477
42741
  };
42478
42742
  const VEHICLE_CARD_FIELDS = [
42479
- { label: "Make", key: "make" },
42480
- { label: "Model", key: "model" },
42743
+ { label: "Make and model", key: "makeAndModel" },
42481
42744
  { label: "Year", key: "year" },
42482
42745
  { label: "License plate", key: "licensePlate" },
42483
42746
  { label: "VIN", key: "vin" },
@@ -43059,6 +43322,20 @@ const BusinessProvider = ({
43059
43322
  }) => {
43060
43323
  errorHandler.setOnError(onError);
43061
43324
  const colors = buildColorsPalette(theme);
43325
+ const eventCallbacksRef = useRef(eventCallbacks);
43326
+ useEffect(() => {
43327
+ eventCallbacksRef.current = eventCallbacks;
43328
+ }, [eventCallbacks]);
43329
+ const stableEventCallbacks = useMemo(() => ({
43330
+ onTransactionCategorized: () => {
43331
+ var _a, _b;
43332
+ (_b = (_a = eventCallbacksRef.current) == null ? void 0 : _a.onTransactionCategorized) == null ? void 0 : _b.call(_a);
43333
+ },
43334
+ onTransactionsFetched: () => {
43335
+ var _a, _b;
43336
+ (_b = (_a = eventCallbacksRef.current) == null ? void 0 : _a.onTransactionsFetched) == null ? void 0 : _b.call(_a);
43337
+ }
43338
+ }), []);
43062
43339
  const [state, dispatch] = useReducer(reducer, {
43063
43340
  businessId,
43064
43341
  business: void 0,
@@ -43203,7 +43480,7 @@ const BusinessProvider = ({
43203
43480
  readTimestamps,
43204
43481
  expireDataCaches: resetCaches,
43205
43482
  hasBeenTouched,
43206
- eventCallbacks,
43483
+ eventCallbacks: stableEventCallbacks,
43207
43484
  accountingConfiguration,
43208
43485
  dateRange
43209
43486
  }),
@@ -43214,14 +43491,14 @@ const BusinessProvider = ({
43214
43491
  }
43215
43492
  );
43216
43493
  };
43217
- const LayerProvider = (_qd) => {
43218
- var _rd = _qd, {
43494
+ const LayerProvider = (_ud) => {
43495
+ var _vd = _ud, {
43219
43496
  appId,
43220
43497
  appSecret,
43221
43498
  businessAccessToken,
43222
43499
  environment,
43223
43500
  usePlaidSandbox
43224
- } = _rd, restProps = __objRest(_rd, [
43501
+ } = _vd, restProps = __objRest(_vd, [
43225
43502
  "appId",
43226
43503
  "appSecret",
43227
43504
  "businessAccessToken",