@layerfi/components 0.1.89-alpha → 0.1.91-alpha

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.
@@ -55,10 +55,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
55
55
  mod
56
56
  ));
57
57
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
58
- var __publicField = (obj, key, value) => {
59
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
60
- return value;
61
- };
58
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
62
59
  var __async = (__this, __arguments, generator) => {
63
60
  return new Promise((resolve, reject) => {
64
61
  var fulfilled = (value) => {
@@ -81,8 +78,8 @@ var __async = (__this, __arguments, generator) => {
81
78
  };
82
79
 
83
80
  // src/index.tsx
84
- var src_exports = {};
85
- __export(src_exports, {
81
+ var index_exports = {};
82
+ __export(index_exports, {
86
83
  AccountingOverview: () => AccountingOverview,
87
84
  BalanceSheet: () => BalanceSheet,
88
85
  BankTransactions: () => BankTransactions,
@@ -99,6 +96,7 @@ __export(src_exports, {
99
96
  LinkAccounts: () => LinkAccounts,
100
97
  LinkedAccounts: () => LinkedAccounts,
101
98
  Onboarding: () => Onboarding,
99
+ PlatformOnboarding: () => PlatformOnboarding,
102
100
  ProfitAndLoss: () => ProfitAndLoss,
103
101
  ProfitAndLossView: () => ProfitAndLossView,
104
102
  ProjectProfitabilityView: () => ProjectProfitabilityView,
@@ -110,7 +108,7 @@ __export(src_exports, {
110
108
  useDataSync: () => useDataSync,
111
109
  useLayerContext: () => useLayerContext
112
110
  });
113
- module.exports = __toCommonJS(src_exports);
111
+ module.exports = __toCommonJS(index_exports);
114
112
 
115
113
  // src/providers/LayerProvider/LayerProvider.tsx
116
114
  var import_react16 = require("react");
@@ -119,7 +117,7 @@ var import_react16 = require("react");
119
117
  var import_react14 = require("react");
120
118
 
121
119
  // package.json
122
- var version = "0.1.89-alpha";
120
+ var version = "0.1.91-alpha";
123
121
 
124
122
  // src/models/APIError.ts
125
123
  var APIError = class _APIError extends Error {
@@ -363,6 +361,9 @@ var createBillPayment = post(
363
361
 
364
362
  // src/api/layer/business.ts
365
363
  var getBusiness = get(({ businessId }) => `/v1/businesses/${businessId}`);
364
+ var updateBusiness = put(
365
+ ({ businessId }) => `/v1/businesses/${businessId}`
366
+ );
366
367
 
367
368
  // src/api/layer/categories.ts
368
369
  var getCategories = get(({ businessId, mode }) => {
@@ -501,7 +502,10 @@ var getCashflowStatementCSV = get(
501
502
 
502
503
  // src/api/layer/tasks.ts
503
504
  var getTasks = get(
504
- ({ businessId, startDate, endDate }) => `/v1/businesses/${businessId}/tasks?${startDate ? `&start_date=${encodeURIComponent(startDate)}` : ""}${endDate ? `&end_date=${encodeURIComponent(endDate)}` : ""}`
505
+ ({ businessId, startDate, endDate }) => {
506
+ const parameters = toDefinedSearchParameters({ startDate, endDate });
507
+ return `/v1/businesses/${businessId}/tasks?${parameters}`;
508
+ }
505
509
  );
506
510
  var submitResponseToTask = post(
507
511
  ({ businessId, taskId }) => `/v1/businesses/${businessId}/tasks/${taskId}/user-response`
@@ -761,14 +765,14 @@ function ToastsContainer() {
761
765
  // src/components/GlobalWidgets/GlobalWidgets.tsx
762
766
  var import_jsx_runtime3 = require("react/jsx-runtime");
763
767
  var DrawerWidget = () => {
764
- const { content, close } = (0, import_react5.useContext)(DrawerContext);
768
+ const { content, close: close2 } = (0, import_react5.useContext)(DrawerContext);
765
769
  const { isMobile, isTablet } = useSizeClass();
766
770
  (0, import_react5.useEffect)(() => {
767
771
  if (!isMobile && !isTablet && content) {
768
- close();
772
+ close2();
769
773
  }
770
774
  }, [isMobile]);
771
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Drawer, { isOpen: Boolean(content), onClose: close, children: content });
775
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Drawer, { isOpen: Boolean(content), onClose: close2, children: content });
772
776
  };
773
777
  var GlobalWidgets = () => {
774
778
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
@@ -873,7 +877,7 @@ var import_react7 = require("react");
873
877
  var useDrawer = () => {
874
878
  const [content, setContent] = (0, import_react7.useState)(void 0);
875
879
  const [isClosing, setIsClosing] = (0, import_react7.useState)(false);
876
- const close = () => {
880
+ const close2 = () => {
877
881
  setIsClosing(true);
878
882
  };
879
883
  const finishClosing = () => {
@@ -885,7 +889,7 @@ var useDrawer = () => {
885
889
  setContent,
886
890
  finishClosing,
887
891
  isClosing,
888
- close
892
+ close: close2
889
893
  };
890
894
  };
891
895
 
@@ -907,6 +911,15 @@ function hasSuggestions(categorization) {
907
911
  return categorization != null && categorization.suggestions !== void 0 && categorization.suggestions.length > 0;
908
912
  }
909
913
 
914
+ // src/types/business.ts
915
+ var ENTITY_TYPES = [
916
+ { value: "SOLE_PROP", label: "Sole Proprietorship" },
917
+ { value: "C_CORP", label: "C Corporation" },
918
+ { value: "LLC", label: "Limited Liability Company" },
919
+ { value: "S_CORP", label: "S Corporation" },
920
+ { value: "PARTNERSHIP", label: "Partnership" }
921
+ ];
922
+
910
923
  // src/config/theme.ts
911
924
  var SHADES = {
912
925
  50: { s: 1, l: 98 },
@@ -1105,16 +1118,11 @@ var buildColorShade = (shade, darkColorHsl) => {
1105
1118
  return { hsl, rgb, hex };
1106
1119
  };
1107
1120
  var hueToRgb = (p, q, t) => {
1108
- if (t < 0)
1109
- t += 1;
1110
- if (t > 1)
1111
- t -= 1;
1112
- if (t < 1 / 6)
1113
- return p + (q - p) * 6 * t;
1114
- if (t < 1 / 2)
1115
- return q;
1116
- if (t < 2 / 3)
1117
- return p + (q - p) * (2 / 3 - t) * 6;
1121
+ if (t < 0) t += 1;
1122
+ if (t > 1) t -= 1;
1123
+ if (t < 1 / 6) return p + (q - p) * 6 * t;
1124
+ if (t < 1 / 2) return q;
1125
+ if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
1118
1126
  return p;
1119
1127
  };
1120
1128
  var hslToRgb = (hsl) => {
@@ -2459,7 +2467,7 @@ var BusinessProvider = ({
2459
2467
  setOnboardingStep,
2460
2468
  addToast,
2461
2469
  removeToast,
2462
- onError: errorHandler.onError,
2470
+ onError: (payload) => errorHandler.onError(payload),
2463
2471
  touch,
2464
2472
  read,
2465
2473
  syncTimestamps,
@@ -3363,8 +3371,7 @@ var TooltipContent = (0, import_react22.forwardRef)(function TooltipContent2(_a,
3363
3371
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
3364
3372
  const context = useTooltipContext();
3365
3373
  const ref = (0, import_react23.useMergeRefs)([context.refs.setFloating, propRef]);
3366
- if (!context.open || context.disabled)
3367
- return null;
3374
+ if (!context.open || context.disabled) return null;
3368
3375
  return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react23.FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3369
3376
  "div",
3370
3377
  __spreadProps(__spreadValues({
@@ -3512,8 +3519,7 @@ var IconButton = (_a) => {
3512
3519
  download,
3513
3520
  className: baseClassName,
3514
3521
  onClick: (e) => {
3515
- if (props.disabled)
3516
- e.preventDefault();
3522
+ if (props.disabled) e.preventDefault();
3517
3523
  },
3518
3524
  children: icon
3519
3525
  }
@@ -3773,7 +3779,8 @@ var SubmitButton = (_a) => {
3773
3779
  children,
3774
3780
  action = "save" /* SAVE */,
3775
3781
  noIcon,
3776
- variant = "primary" /* primary */
3782
+ variant = "primary" /* primary */,
3783
+ withRetry
3777
3784
  } = _b, props = __objRest(_b, [
3778
3785
  "active",
3779
3786
  "className",
@@ -3783,12 +3790,24 @@ var SubmitButton = (_a) => {
3783
3790
  "children",
3784
3791
  "action",
3785
3792
  "noIcon",
3786
- "variant"
3793
+ "variant",
3794
+ "withRetry"
3787
3795
  ]);
3788
3796
  const baseClassName = (0, import_classnames7.default)(
3789
3797
  active ? "Layer__btn--active" : "",
3790
3798
  className
3791
3799
  );
3800
+ if (withRetry && error) {
3801
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3802
+ RetryButton,
3803
+ __spreadProps(__spreadValues({}, props), {
3804
+ className: baseClassName,
3805
+ disabled: processing || disabled,
3806
+ error: typeof error === "string" ? error : "Something went wrong",
3807
+ children
3808
+ })
3809
+ );
3810
+ }
3792
3811
  return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3793
3812
  Button,
3794
3813
  __spreadProps(__spreadValues({}, props), {
@@ -4242,7 +4261,8 @@ var Text = (_a) => {
4242
4261
  weight = "normal" /* normal */,
4243
4262
  withTooltip,
4244
4263
  ellipsis,
4245
- status
4264
+ status,
4265
+ pb
4246
4266
  } = _b, props = __objRest(_b, [
4247
4267
  "as",
4248
4268
  "className",
@@ -4251,9 +4271,10 @@ var Text = (_a) => {
4251
4271
  "weight",
4252
4272
  "withTooltip",
4253
4273
  "ellipsis",
4254
- "status"
4274
+ "status",
4275
+ "pb"
4255
4276
  ]);
4256
- const dataProperties = toDataProperties({ status, ellipsis });
4277
+ const dataProperties = toDataProperties({ status, ellipsis, pb });
4257
4278
  const baseClassName = (0, import_classnames15.default)(
4258
4279
  `Layer__text Layer__text--${size} Layer__text--${weight}`,
4259
4280
  className
@@ -4335,10 +4356,12 @@ var Heading = ({
4335
4356
  as: Component2 = "h2",
4336
4357
  className,
4337
4358
  children,
4338
- size = "primary" /* primary */
4359
+ size = "primary" /* primary */,
4360
+ align = "center"
4339
4361
  }) => {
4340
4362
  const baseClassName = (0, import_classnames16.default)(
4341
4363
  `Layer__heading Layer__heading--${size}`,
4364
+ `Layer__heading--${align}`,
4342
4365
  className
4343
4366
  );
4344
4367
  return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Component2, { className: baseClassName, children });
@@ -5463,7 +5486,7 @@ var LinkedAccountItemThumb = ({
5463
5486
  };
5464
5487
 
5465
5488
  // src/components/LinkedAccounts/LinkedAccountsContent.tsx
5466
- var import_classnames24 = __toESM(require("classnames"));
5489
+ var import_classnames25 = __toESM(require("classnames"));
5467
5490
 
5468
5491
  // src/components/LinkedAccounts/ConfirmationModal/LinkedAccountsConfirmationModal.tsx
5469
5492
  var import_react38 = require("react");
@@ -5642,12 +5665,13 @@ function ModalActions({ children }) {
5642
5665
  }
5643
5666
 
5644
5667
  // src/components/ui/Stack/Stack.tsx
5668
+ var import_classnames23 = __toESM(require("classnames"));
5645
5669
  var import_jsx_runtime69 = require("react/jsx-runtime");
5646
5670
  var CLASS_NAME2 = "Layer__Stack";
5647
5671
  function Stack(_a) {
5648
- var _b = _a, { align, children, direction, gap, justify, pbs, pbe } = _b, restProps = __objRest(_b, ["align", "children", "direction", "gap", "justify", "pbs", "pbe"]);
5672
+ var _b = _a, { align, children, direction, gap, justify, pbs, pbe, className } = _b, restProps = __objRest(_b, ["align", "children", "direction", "gap", "justify", "pbs", "pbe", "className"]);
5649
5673
  const dataProperties = toDataProperties({ align, direction, gap, justify, pbs, pbe });
5650
- return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), { className: CLASS_NAME2, children }));
5674
+ return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), { className: (0, import_classnames23.default)(CLASS_NAME2, className), children }));
5651
5675
  }
5652
5676
  function VStack(props) {
5653
5677
  return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Stack, __spreadProps(__spreadValues({}, props), { direction: "column" }));
@@ -5695,7 +5719,7 @@ function withRenderProp(renderProp, callback) {
5695
5719
  }
5696
5720
 
5697
5721
  // src/components/ui/Checkbox/Checkbox.tsx
5698
- var import_classnames23 = __toESM(require("classnames"));
5722
+ var import_classnames24 = __toESM(require("classnames"));
5699
5723
  var import_jsx_runtime71 = require("react/jsx-runtime");
5700
5724
  var CLASS_NAME3 = "Layer__Checkbox";
5701
5725
  function Checkbox(_a) {
@@ -5708,7 +5732,7 @@ function Checkbox(_a) {
5708
5732
  return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
5709
5733
  import_react_aria_components4.Checkbox,
5710
5734
  __spreadProps(__spreadValues(__spreadValues({}, dataProperties), props), {
5711
- className: (0, import_classnames23.default)(CLASS_NAME3, className),
5735
+ className: (0, import_classnames24.default)(CLASS_NAME3, className),
5712
5736
  children: withRenderProp(children, (node) => /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(import_jsx_runtime71.Fragment, { children: [
5713
5737
  /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { slot: "checkbox", children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_lucide_react2.Check, { size: size === "lg" ? 16 : 12 }) }),
5714
5738
  node
@@ -5726,7 +5750,7 @@ function BasicLinkedAccountContainer({ children, isSelected }) {
5726
5750
  }
5727
5751
  function BasicLinkedAccountLogo({ account }) {
5728
5752
  var _a, _b, _c;
5729
- return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(VStack, { justify: "center", children: ((_a = account.institution) == null ? void 0 : _a.logo) ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
5753
+ return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(VStack, { justify: "center", className: "Layer__BasicLinkedAccountLogo", children: ((_a = account.institution) == null ? void 0 : _a.logo) ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
5730
5754
  "img",
5731
5755
  {
5732
5756
  width: 28,
@@ -5734,17 +5758,17 @@ function BasicLinkedAccountLogo({ account }) {
5734
5758
  src: `data:image/png;base64,${account.institution.logo}`,
5735
5759
  alt: ((_b = account.institution) == null ? void 0 : _b.name) ? (_c = account.institution) == null ? void 0 : _c.name : account.external_account_name
5736
5760
  }
5737
- ) : /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(InstitutionIcon_default, { size: 28 }) });
5761
+ ) : /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(InstitutionIcon_default, {}) });
5738
5762
  }
5739
5763
  function BasicLinkedAccountContent({ account }) {
5740
5764
  var _a;
5741
5765
  return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(HStack, { gap: "md", children: [
5742
5766
  /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(BasicLinkedAccountLogo, { account }),
5743
5767
  /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(VStack, { children: [
5744
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Heading2, { level: 3, size: "sm", pbe: "2xs", children: account.external_account_name }),
5768
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Heading2, { level: 3, size: "xs", pbe: "3xs", children: account.external_account_name }),
5745
5769
  /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(HStack, { gap: "xs", children: [
5746
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(P, { children: (_a = account.institution) == null ? void 0 : _a.name }),
5747
- /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(P, { variant: "subtle", children: [
5770
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(P, { size: "sm", children: (_a = account.institution) == null ? void 0 : _a.name }),
5771
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(P, { variant: "subtle", size: "sm", children: [
5748
5772
  "\u2022\u2022\u2022",
5749
5773
  " ",
5750
5774
  account.mask
@@ -5916,13 +5940,8 @@ function useLinkedAccountsConfirmationModal() {
5916
5940
  }, baseInfo);
5917
5941
  }
5918
5942
  function LinkedAccountsConfirmationModalPreloadedContent({ onClose }) {
5919
- const { onDismiss } = useLinkedAccountsConfirmationModal();
5920
- const handleDismiss = () => {
5921
- onDismiss();
5922
- onClose();
5923
- };
5924
5943
  return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
5925
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ModalContextBar, { onClose: handleDismiss }),
5944
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ModalContextBar, { onClose }),
5926
5945
  /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ModalHeading, { pbe: "md", children: "Loading Your Accounts..." }),
5927
5946
  /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ModalContent, { children: /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(VStack, { slot: "center", align: "center", gap: "md", children: [
5928
5947
  /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(LoadingSpinner, { size: 48 }),
@@ -5931,16 +5950,12 @@ function LinkedAccountsConfirmationModalPreloadedContent({ onClose }) {
5931
5950
  ] });
5932
5951
  }
5933
5952
  function LinkedAccountsConfirmationModalContent({ onClose }) {
5934
- const { accounts, onDismiss, onFinish, refetchAccounts } = useLinkedAccountsConfirmationModal();
5953
+ const { accounts, onFinish, refetchAccounts } = useLinkedAccountsConfirmationModal();
5935
5954
  const [formState, setFormState] = (0, import_react38.useState)(() => Object.fromEntries(
5936
5955
  accounts.map(({ id }) => [id, true])
5937
5956
  ));
5938
5957
  const { trigger, isMutating, error } = useConfirmAndExcludeMultiple({ onSuccess: refetchAccounts });
5939
5958
  const hasError = Boolean(error);
5940
- const handleDismiss = () => {
5941
- onDismiss();
5942
- onClose();
5943
- };
5944
5959
  const handleFinish = () => __async(this, null, function* () {
5945
5960
  const success = yield trigger(formState);
5946
5961
  if (success) {
@@ -5948,9 +5963,12 @@ function LinkedAccountsConfirmationModalContent({ onClose }) {
5948
5963
  onClose();
5949
5964
  }
5950
5965
  });
5966
+ const handleDismiss = () => {
5967
+ onClose();
5968
+ };
5951
5969
  const { descriptionLabel, buttonLabel } = getFormComponentLabels(formState);
5952
5970
  return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
5953
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ModalContextBar, { onClose: handleDismiss }),
5971
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ModalContextBar, { onClose }),
5954
5972
  /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ModalHeading, { pbe: "2xs", children: "Confirm Business Accounts" }),
5955
5973
  /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ModalDescription, { pbe: "md", children: descriptionLabel }),
5956
5974
  /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ModalContent, { children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
@@ -5978,13 +5996,26 @@ function LinkedAccountsConfirmationModalContent({ onClose }) {
5978
5996
  /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ModalActions, { children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(VStack, { gap: "md", children: hasError ? /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
5979
5997
  /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(P, { size: "sm", children: "An error occurred while confirming accounts. You will have an opportunity to try again later." }),
5980
5998
  /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(P, { size: "sm", children: "No data will be synced until you confirm." }),
5981
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Button2, { size: "lg", onPress: handleDismiss, children: "Close" })
5982
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Button2, { size: "lg", onPress: handleFinish, isPending: isMutating, children: buttonLabel }) }) })
5999
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Button2, { size: "lg", onPress: close, children: "Close" })
6000
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Button2, { size: "lg", onPress: () => {
6001
+ void handleFinish();
6002
+ }, isPending: isMutating, children: buttonLabel }) }) })
5983
6003
  ] });
5984
6004
  }
5985
6005
  function LinkedAccountsConfirmationModal() {
5986
- const { preloadIsOpen, mainIsOpen } = useLinkedAccountsConfirmationModal();
5987
- return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Modal, { isOpen: preloadIsOpen || mainIsOpen, children: ({ close }) => preloadIsOpen ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(LinkedAccountsConfirmationModalPreloadedContent, { onClose: close }) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(LinkedAccountsConfirmationModalContent, { onClose: close }) });
6006
+ const { preloadIsOpen, mainIsOpen, onDismiss } = useLinkedAccountsConfirmationModal();
6007
+ return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
6008
+ Modal,
6009
+ {
6010
+ isOpen: preloadIsOpen || mainIsOpen,
6011
+ onOpenChange: (isOpen) => {
6012
+ if (!isOpen) {
6013
+ onDismiss();
6014
+ }
6015
+ },
6016
+ children: ({ close: close2 }) => preloadIsOpen ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(LinkedAccountsConfirmationModalPreloadedContent, { onClose: close2 }) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(LinkedAccountsConfirmationModalContent, { onClose: close2 })
6017
+ }
6018
+ );
5988
6019
  }
5989
6020
 
5990
6021
  // src/components/LinkedAccounts/LinkedAccountsContent.tsx
@@ -5996,7 +6027,7 @@ var LinkedAccountsContent = ({
5996
6027
  showBreakConnection
5997
6028
  }) => {
5998
6029
  const { data, addConnection } = (0, import_react39.useContext)(LinkedAccountsContext);
5999
- const linkedAccountsNewAccountClassName = (0, import_classnames24.default)(
6030
+ const linkedAccountsNewAccountClassName = (0, import_classnames25.default)(
6000
6031
  "Layer__linked-accounts__new-account",
6001
6032
  asWidget && "--as-widget",
6002
6033
  showLedgerBalance && "--show-ledger-balance",
@@ -6072,7 +6103,7 @@ var isDateAllowedToBrowse = (date, business) => {
6072
6103
  var import_react44 = require("react");
6073
6104
 
6074
6105
  // src/components/Input/Input.tsx
6075
- var import_classnames25 = __toESM(require("classnames"));
6106
+ var import_classnames26 = __toESM(require("classnames"));
6076
6107
  var import_jsx_runtime77 = require("react/jsx-runtime");
6077
6108
  var Input = (_a) => {
6078
6109
  var _b = _a, {
@@ -6086,7 +6117,7 @@ var Input = (_a) => {
6086
6117
  "errorMessage",
6087
6118
  "leftText"
6088
6119
  ]);
6089
- const baseClassName = (0, import_classnames25.default)(
6120
+ const baseClassName = (0, import_classnames26.default)(
6090
6121
  "Layer__input",
6091
6122
  isInvalid ? "Layer__input--error" : "",
6092
6123
  leftText ? "Layer__input--with-left-text" : "",
@@ -6102,7 +6133,7 @@ var Input = (_a) => {
6102
6133
  };
6103
6134
 
6104
6135
  // src/components/Input/InputGroup.tsx
6105
- var import_classnames26 = __toESM(require("classnames"));
6136
+ var import_classnames27 = __toESM(require("classnames"));
6106
6137
  var import_jsx_runtime78 = require("react/jsx-runtime");
6107
6138
  var InputGroup = ({
6108
6139
  label,
@@ -6111,7 +6142,7 @@ var InputGroup = ({
6111
6142
  inline,
6112
6143
  children
6113
6144
  }) => {
6114
- const baseClassName = (0, import_classnames26.default)(
6145
+ const baseClassName = (0, import_classnames27.default)(
6115
6146
  "Layer__input-group",
6116
6147
  className,
6117
6148
  inline && "Layer__input-group--inline"
@@ -6288,7 +6319,7 @@ var ChevronDownFill = (_a) => {
6288
6319
  var ChevronDownFill_default = ChevronDownFill;
6289
6320
 
6290
6321
  // src/components/Input/Select.tsx
6291
- var import_classnames27 = __toESM(require("classnames"));
6322
+ var import_classnames28 = __toESM(require("classnames"));
6292
6323
  var import_jsx_runtime82 = require("react/jsx-runtime");
6293
6324
  var Select = ({
6294
6325
  name,
@@ -6302,7 +6333,7 @@ var Select = ({
6302
6333
  isInvalid,
6303
6334
  errorMessage
6304
6335
  }) => {
6305
- const baseClassName = (0, import_classnames27.default)(
6336
+ const baseClassName = (0, import_classnames28.default)(
6306
6337
  "Layer__select",
6307
6338
  isInvalid ? "Layer__select--error" : "",
6308
6339
  className
@@ -6330,7 +6361,7 @@ var Select = ({
6330
6361
  };
6331
6362
 
6332
6363
  // src/components/Input/InputWithBadge.tsx
6333
- var import_classnames28 = __toESM(require("classnames"));
6364
+ var import_classnames29 = __toESM(require("classnames"));
6334
6365
  var import_jsx_runtime83 = require("react/jsx-runtime");
6335
6366
  var InputWithBadge = (_a) => {
6336
6367
  var _b = _a, {
@@ -6348,7 +6379,7 @@ var InputWithBadge = (_a) => {
6348
6379
  "badge",
6349
6380
  "variant"
6350
6381
  ]);
6351
- const baseClassName = (0, import_classnames28.default)(
6382
+ const baseClassName = (0, import_classnames29.default)(
6352
6383
  "Layer__input",
6353
6384
  isInvalid ? "Layer__input--error" : "",
6354
6385
  leftText ? "Layer__input--with-left-text" : "",
@@ -6369,7 +6400,7 @@ var InputWithBadge = (_a) => {
6369
6400
  // src/components/Input/MultiSelect.tsx
6370
6401
  var import_react42 = require("react");
6371
6402
  var import_react_select2 = __toESM(require("react-select"));
6372
- var import_classnames29 = __toESM(require("classnames"));
6403
+ var import_classnames30 = __toESM(require("classnames"));
6373
6404
  var import_jsx_runtime84 = require("react/jsx-runtime");
6374
6405
  var MultiSelect = ({
6375
6406
  name,
@@ -6385,7 +6416,7 @@ var MultiSelect = ({
6385
6416
  errorMessage,
6386
6417
  styles
6387
6418
  }) => {
6388
- const baseClassName = (0, import_classnames29.default)(
6419
+ const baseClassName = (0, import_classnames30.default)(
6389
6420
  "Layer__select",
6390
6421
  isInvalid ? "Layer__select--error" : "",
6391
6422
  className
@@ -6417,7 +6448,7 @@ var MultiSelect = ({
6417
6448
  };
6418
6449
 
6419
6450
  // src/components/Input/AmountInput.tsx
6420
- var import_classnames30 = __toESM(require("classnames"));
6451
+ var import_classnames31 = __toESM(require("classnames"));
6421
6452
  var import_react_currency_input_field = __toESM(require("react-currency-input-field"));
6422
6453
  var import_jsx_runtime85 = require("react/jsx-runtime");
6423
6454
  var AmountInput = (_a) => {
@@ -6436,7 +6467,7 @@ var AmountInput = (_a) => {
6436
6467
  "isInvalid",
6437
6468
  "placeholder"
6438
6469
  ]);
6439
- const baseClassName = (0, import_classnames30.default)(
6470
+ const baseClassName = (0, import_classnames31.default)(
6440
6471
  "Layer__input Layer__amount-input",
6441
6472
  isInvalid ? "Layer__input--error" : "",
6442
6473
  leftText ? "Layer__input--with-left-text" : "",
@@ -6554,7 +6585,7 @@ var DatePickerOptions = ({
6554
6585
  };
6555
6586
 
6556
6587
  // src/components/DatePicker/DatePicker.tsx
6557
- var import_classnames31 = __toESM(require("classnames"));
6588
+ var import_classnames32 = __toESM(require("classnames"));
6558
6589
  var import_date_fns8 = require("date-fns");
6559
6590
  var import_jsx_runtime88 = require("react/jsx-runtime");
6560
6591
  var ReactDatePicker = RDP.default.default || RDP.default || RDP;
@@ -6562,6 +6593,35 @@ var isRangeMode = (displayMode) => displayMode === "dayRangePicker" || displayMo
6562
6593
  var showNavigationArrows = (navigateArrows, isDesktop) => {
6563
6594
  return navigateArrows && (isDesktop && navigateArrows.includes("desktop") || !isDesktop && navigateArrows.includes("mobile"));
6564
6595
  };
6596
+ var renderYearContent = (calendarYear, highlightYears) => {
6597
+ if (!highlightYears || !highlightYears.includes(calendarYear)) {
6598
+ return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "Layer__datepicker__year-content", children: calendarYear });
6599
+ }
6600
+ return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("span", { className: "Layer__datepicker__year-content", children: [
6601
+ calendarYear,
6602
+ /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "Layer__datepicker__date-dot" })
6603
+ ] });
6604
+ };
6605
+ var highlightBackArrow = ({
6606
+ currentDate,
6607
+ modePicker,
6608
+ highlightYears
6609
+ }) => {
6610
+ if (modePicker === "yearPicker") {
6611
+ return Boolean(highlightYears == null ? void 0 : highlightYears.find((year) => year < (0, import_date_fns8.getYear)(currentDate)));
6612
+ }
6613
+ return false;
6614
+ };
6615
+ var highlightNextArrow = ({
6616
+ currentDate,
6617
+ modePicker,
6618
+ highlightYears
6619
+ }) => {
6620
+ if (modePicker === "yearPicker") {
6621
+ return Boolean(highlightYears == null ? void 0 : highlightYears.find((year) => year > (0, import_date_fns8.getYear)(currentDate)));
6622
+ }
6623
+ return false;
6624
+ };
6565
6625
  var DatePicker = (_a) => {
6566
6626
  var _b = _a, {
6567
6627
  selected,
@@ -6581,6 +6641,7 @@ var DatePicker = (_a) => {
6581
6641
  maxDate = /* @__PURE__ */ new Date(),
6582
6642
  currentDateOption = true,
6583
6643
  navigateArrows = displayMode === "monthPicker" ? ["mobile"] : void 0,
6644
+ highlightYears,
6584
6645
  onChangeMode,
6585
6646
  slots
6586
6647
  } = _b, props = __objRest(_b, [
@@ -6601,6 +6662,7 @@ var DatePicker = (_a) => {
6601
6662
  "maxDate",
6602
6663
  "currentDateOption",
6603
6664
  "navigateArrows",
6665
+ "highlightYears",
6604
6666
  "onChangeMode",
6605
6667
  "slots"
6606
6668
  ]);
@@ -6629,21 +6691,21 @@ var DatePicker = (_a) => {
6629
6691
  return [selected[0], null];
6630
6692
  }, [selected, displayMode]);
6631
6693
  const { isDesktop } = useSizeClass();
6632
- const wrapperClassNames = (0, import_classnames31.default)(
6694
+ const wrapperClassNames = (0, import_classnames32.default)(
6633
6695
  "Layer__datepicker__wrapper",
6634
6696
  displayMode === "timePicker" && "Layer__datepicker__time__wrapper",
6635
6697
  showNavigationArrows(navigateArrows, isDesktop) && "Layer__datepicker__wrapper--arrows"
6636
6698
  );
6637
- const datePickerWrapperClassNames = (0, import_classnames31.default)(
6699
+ const datePickerWrapperClassNames = (0, import_classnames32.default)(
6638
6700
  "Layer__datepicker",
6639
6701
  displayMode === "timePicker" && "Layer__datepicker__time",
6640
6702
  wrapperClassName
6641
6703
  );
6642
- const calendarClassNames = (0, import_classnames31.default)(
6704
+ const calendarClassNames = (0, import_classnames32.default)(
6643
6705
  "Layer__datepicker__calendar",
6644
6706
  calendarClassName
6645
6707
  );
6646
- const popperClassNames = (0, import_classnames31.default)(
6708
+ const popperClassNames = (0, import_classnames32.default)(
6647
6709
  "Layer__datepicker__popper",
6648
6710
  displayMode === "timePicker" && "Layer__datepicker__time__popper",
6649
6711
  popperClassName
@@ -6786,7 +6848,8 @@ var DatePicker = (_a) => {
6786
6848
  onFocus: (e) => {
6787
6849
  e.target.blur();
6788
6850
  },
6789
- disabled
6851
+ disabled,
6852
+ renderYearContent: (d) => renderYearContent(d, highlightYears)
6790
6853
  }, props), {
6791
6854
  children: [
6792
6855
  ModeSelector && pickerMode !== "timePicker" ? /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
@@ -6808,38 +6871,52 @@ var DatePicker = (_a) => {
6808
6871
  })
6809
6872
  ),
6810
6873
  showNavigationArrows(navigateArrows, isDesktop) && /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_jsx_runtime88.Fragment, { children: [
6811
- /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
6874
+ /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(
6812
6875
  Button,
6813
6876
  {
6814
6877
  "aria-label": "Previous Date",
6815
- className: (0, import_classnames31.default)(
6878
+ className: (0, import_classnames32.default)(
6816
6879
  "Layer__datepicker__prev-button",
6817
6880
  isBeforeMinDate && "Layer__datepicker__button--disabled"
6818
6881
  ),
6819
6882
  onClick: () => handleNavigateDate(-1),
6820
6883
  variant: "secondary" /* secondary */,
6821
6884
  disabled: isBeforeMinDate || disabled,
6822
- children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(ChevronLeft_default, { className: "Layer__datepicker__button-icon", size: 16 })
6885
+ children: [
6886
+ /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(ChevronLeft_default, { className: "Layer__datepicker__button-icon", size: 16 }),
6887
+ highlightBackArrow({
6888
+ currentDate: firstDate,
6889
+ modePicker: pickerMode,
6890
+ highlightYears
6891
+ }) && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "Layer__datepicker__nav-arrow-highlight" })
6892
+ ]
6823
6893
  }
6824
6894
  ),
6825
- /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
6895
+ /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(
6826
6896
  Button,
6827
6897
  {
6828
6898
  "aria-label": "Next Date",
6829
6899
  variant: "secondary" /* secondary */,
6830
- className: (0, import_classnames31.default)(
6900
+ className: (0, import_classnames32.default)(
6831
6901
  "Layer__datepicker__next-button",
6832
6902
  isTodayOrAfter ? "Layer__datepicker__button--disabled" : void 0
6833
6903
  ),
6834
6904
  onClick: () => handleNavigateDate(1),
6835
6905
  disabled: isTodayOrAfter || disabled,
6836
- children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
6837
- ChevronRight_default,
6838
- {
6839
- className: "Layer__datepicker__button-icon",
6840
- size: 16
6841
- }
6842
- )
6906
+ children: [
6907
+ /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
6908
+ ChevronRight_default,
6909
+ {
6910
+ className: "Layer__datepicker__button-icon",
6911
+ size: 16
6912
+ }
6913
+ ),
6914
+ highlightNextArrow({
6915
+ currentDate: firstDate,
6916
+ modePicker: pickerMode,
6917
+ highlightYears
6918
+ }) && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "Layer__datepicker__nav-arrow-highlight" })
6919
+ ]
6843
6920
  }
6844
6921
  )
6845
6922
  ] }),
@@ -7080,8 +7157,7 @@ var humanizeEnum = (text) => {
7080
7157
  return capitalizeFirstLetter(text.replace(/_/gi, " ").toLowerCase());
7081
7158
  };
7082
7159
  var convertNumberToCurrency = (amount) => {
7083
- if (typeof amount !== "number" || isNaN(amount))
7084
- return "";
7160
+ if (typeof amount !== "number" || isNaN(amount)) return "";
7085
7161
  const formattedValue = amount.toLocaleString("en-US");
7086
7162
  return formattedValue.length > 0 ? `$${formattedValue}` : "";
7087
7163
  };
@@ -7220,11 +7296,11 @@ function OpeningBalanceModal({
7220
7296
  setAccountsToAddOpeningBalanceInModal([]);
7221
7297
  }
7222
7298
  },
7223
- children: ({ close }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
7299
+ children: ({ close: close2 }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
7224
7300
  LinkedAccountsOpeningBalanceModalContent,
7225
7301
  {
7226
7302
  accounts: accountsToAddOpeningBalanceInModal,
7227
- onClose: close,
7303
+ onClose: close2,
7228
7304
  stringOverrides
7229
7305
  }
7230
7306
  )
@@ -7733,7 +7809,7 @@ var import_react50 = require("react");
7733
7809
  var import_react49 = require("react");
7734
7810
 
7735
7811
  // src/components/ActionableList/ActionableList.tsx
7736
- var import_classnames32 = __toESM(require("classnames"));
7812
+ var import_classnames33 = __toESM(require("classnames"));
7737
7813
  var import_jsx_runtime98 = require("react/jsx-runtime");
7738
7814
  var ActionableList = ({
7739
7815
  options,
@@ -7746,7 +7822,7 @@ var ActionableList = ({
7746
7822
  {
7747
7823
  role: "button",
7748
7824
  onClick: () => onClick(x),
7749
- className: (0, import_classnames32.default)(
7825
+ className: (0, import_classnames33.default)(
7750
7826
  x.secondary && "Layer__actionable-list-item--secondary",
7751
7827
  x.asLink && "Layer__actionable-list-item--as-link",
7752
7828
  selectedId === x.id && "Layer__actionable-list__item--selected"
@@ -7888,7 +7964,7 @@ var BusinessCategories = ({
7888
7964
  };
7889
7965
 
7890
7966
  // src/components/CategorySelect/CategorySelectDrawer.tsx
7891
- var import_classnames33 = __toESM(require("classnames"));
7967
+ var import_classnames34 = __toESM(require("classnames"));
7892
7968
  var import_jsx_runtime100 = require("react/jsx-runtime");
7893
7969
  var CategorySelectDrawer = ({
7894
7970
  onSelect,
@@ -7896,16 +7972,16 @@ var CategorySelectDrawer = ({
7896
7972
  showTooltips: _showTooltips
7897
7973
  }) => {
7898
7974
  var _a, _b;
7899
- const { setContent, close } = (0, import_react50.useContext)(DrawerContext);
7975
+ const { setContent, close: close2 } = (0, import_react50.useContext)(DrawerContext);
7900
7976
  const onDrawerCategorySelect = (value) => {
7901
- close();
7977
+ close2();
7902
7978
  onSelect(value);
7903
7979
  };
7904
7980
  return /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
7905
7981
  "button",
7906
7982
  {
7907
7983
  "aria-label": "Select category",
7908
- className: (0, import_classnames33.default)(
7984
+ className: (0, import_classnames34.default)(
7909
7985
  "Layer__category-menu__drawer-btn",
7910
7986
  selected && "Layer__category-menu__drawer-btn--selected"
7911
7987
  ),
@@ -7954,7 +8030,7 @@ var CategorySelectDrawerContent = ({
7954
8030
  };
7955
8031
 
7956
8032
  // src/components/CategorySelect/CategorySelect.tsx
7957
- var import_classnames34 = __toESM(require("classnames"));
8033
+ var import_classnames35 = __toESM(require("classnames"));
7958
8034
  var import_date_fns12 = require("date-fns");
7959
8035
  var import_jsx_runtime101 = require("react/jsx-runtime");
7960
8036
  var mapCategoryToOption2 = (category) => {
@@ -8006,7 +8082,7 @@ var GroupHeading = (props) => {
8006
8082
  return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
8007
8083
  import_react_select3.components.GroupHeading,
8008
8084
  __spreadValues({
8009
- className: (0, import_classnames34.default)(
8085
+ className: (0, import_classnames35.default)(
8010
8086
  props.className,
8011
8087
  props.children === "Match" || props.children === "All categories" ? "Layer__select__group-heading--main" : ""
8012
8088
  )
@@ -8337,8 +8413,7 @@ var useReceiptsContext = () => (0, import_react51.useContext)(ReceiptsContext);
8337
8413
  var import_react52 = require("react");
8338
8414
  var import_date_fns13 = require("date-fns");
8339
8415
  var readDate = (date) => {
8340
- if (!date)
8341
- return void 0;
8416
+ if (!date) return void 0;
8342
8417
  return date && (0, import_date_fns13.format)((0, import_date_fns13.parseISO)(date), DATE_FORMAT);
8343
8418
  };
8344
8419
  var useReceipts = ({
@@ -8423,8 +8498,7 @@ var useReceipts = ({
8423
8498
  }
8424
8499
  });
8425
8500
  const archiveDocument = (document2) => __async(void 0, null, function* () {
8426
- if (!document2.id)
8427
- return;
8501
+ if (!document2.id) return;
8428
8502
  try {
8429
8503
  if (document2.error) {
8430
8504
  setReceiptUrls(receiptUrls.filter((url) => url.id !== document2.id));
@@ -8519,7 +8593,7 @@ var Eye = (_a) => {
8519
8593
  var Eye_default = Eye;
8520
8594
 
8521
8595
  // src/components/FileThumb/FileThumb.tsx
8522
- var import_classnames35 = __toESM(require("classnames"));
8596
+ var import_classnames36 = __toESM(require("classnames"));
8523
8597
  var import_jsx_runtime106 = require("react/jsx-runtime");
8524
8598
  var FileThumb = ({
8525
8599
  url,
@@ -8538,7 +8612,7 @@ var FileThumb = ({
8538
8612
  return /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(
8539
8613
  "div",
8540
8614
  {
8541
- className: (0, import_classnames35.default)(
8615
+ className: (0, import_classnames36.default)(
8542
8616
  "Layer__file-thumb",
8543
8617
  floatingActions && "Layer__file-thumb--floating"
8544
8618
  ),
@@ -8571,7 +8645,7 @@ var FileThumb = ({
8571
8645
  enableOpen || enableDownload || onDelete ? /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(
8572
8646
  "div",
8573
8647
  {
8574
- className: (0, import_classnames35.default)(
8648
+ className: (0, import_classnames36.default)(
8575
8649
  "Layer__file-thumb__actions",
8576
8650
  floatingActions && "Layer__file-thumb__actions--floating"
8577
8651
  ),
@@ -8729,7 +8803,7 @@ var MatchBadge = ({
8729
8803
  };
8730
8804
 
8731
8805
  // src/components/MatchForm/MatchForm.tsx
8732
- var import_classnames36 = __toESM(require("classnames"));
8806
+ var import_classnames37 = __toESM(require("classnames"));
8733
8807
  var import_date_fns15 = require("date-fns");
8734
8808
  var import_jsx_runtime109 = require("react/jsx-runtime");
8735
8809
  var MatchForm = ({
@@ -8758,7 +8832,7 @@ var MatchForm = ({
8758
8832
  return /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
8759
8833
  "div",
8760
8834
  {
8761
- className: (0, import_classnames36.default)(
8835
+ className: (0, import_classnames37.default)(
8762
8836
  `${classNamePrefix}__match-row`,
8763
8837
  match.id === selectedMatchId ? `${classNamePrefix}__match-row--selected` : ""
8764
8838
  ),
@@ -8835,7 +8909,7 @@ var MatchForm = ({
8835
8909
  };
8836
8910
 
8837
8911
  // src/components/MatchForm/MatchFormMobile.tsx
8838
- var import_classnames37 = __toESM(require("classnames"));
8912
+ var import_classnames38 = __toESM(require("classnames"));
8839
8913
  var import_date_fns16 = require("date-fns");
8840
8914
  var import_jsx_runtime110 = require("react/jsx-runtime");
8841
8915
  var MatchFormMobile = ({
@@ -8851,7 +8925,7 @@ var MatchFormMobile = ({
8851
8925
  return /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(
8852
8926
  "div",
8853
8927
  {
8854
- className: (0, import_classnames37.default)(
8928
+ className: (0, import_classnames38.default)(
8855
8929
  `${classNamePrefix}__match-item`,
8856
8930
  match.id === selectedMatchId ? `${classNamePrefix}__match-item--selected` : ""
8857
8931
  ),
@@ -8912,7 +8986,7 @@ var MatchFormMobile = ({
8912
8986
  };
8913
8987
 
8914
8988
  // src/components/Textarea/Textarea.tsx
8915
- var import_classnames38 = __toESM(require("classnames"));
8989
+ var import_classnames39 = __toESM(require("classnames"));
8916
8990
  var import_jsx_runtime111 = require("react/jsx-runtime");
8917
8991
  var Textarea = (_a) => {
8918
8992
  var _b = _a, {
@@ -8924,7 +8998,7 @@ var Textarea = (_a) => {
8924
8998
  "isInvalid",
8925
8999
  "errorMessage"
8926
9000
  ]);
8927
- const baseClassName = (0, import_classnames38.default)(
9001
+ const baseClassName = (0, import_classnames39.default)(
8928
9002
  "Layer__textarea",
8929
9003
  isInvalid ? "Layer__textarea--error" : "",
8930
9004
  className
@@ -8937,7 +9011,7 @@ var Textarea = (_a) => {
8937
9011
 
8938
9012
  // src/components/Toggle/Toggle.tsx
8939
9013
  var import_react54 = require("react");
8940
- var import_classnames39 = __toESM(require("classnames"));
9014
+ var import_classnames40 = __toESM(require("classnames"));
8941
9015
  var import_jsx_runtime112 = require("react/jsx-runtime");
8942
9016
  var import_react55 = require("react");
8943
9017
  var Toggle = ({
@@ -8958,7 +9032,7 @@ var Toggle = ({
8958
9032
  setCurrentWidth(c.width);
8959
9033
  }
8960
9034
  });
8961
- const baseClassName = (0, import_classnames39.default)(
9035
+ const baseClassName = (0, import_classnames40.default)(
8962
9036
  "Layer__toggle",
8963
9037
  `Layer__toggle--${size}`,
8964
9038
  initialized ? "Layer__toggle--initialized" : ""
@@ -9043,7 +9117,7 @@ var ToggleOption = ({
9043
9117
  style,
9044
9118
  index
9045
9119
  }) => {
9046
- const optionClassName = (0, import_classnames39.default)("Layer__toggle-option", {
9120
+ const optionClassName = (0, import_classnames40.default)("Layer__toggle-option", {
9047
9121
  "Layer__toggle-option--active": checked
9048
9122
  });
9049
9123
  if (disabled) {
@@ -9208,7 +9282,7 @@ var Notification = ({
9208
9282
  };
9209
9283
 
9210
9284
  // src/components/ExpandedBankTransactionRow/ExpandedBankTransactionRow.tsx
9211
- var import_classnames40 = __toESM(require("classnames"));
9285
+ var import_classnames41 = __toESM(require("classnames"));
9212
9286
 
9213
9287
  // src/hooks/bookkeeping/useBookkeepingStatus.ts
9214
9288
  var import_swr5 = __toESM(require("swr"));
@@ -9231,7 +9305,12 @@ function LegacyModeProvider({
9231
9305
  }
9232
9306
 
9233
9307
  // src/hooks/bookkeeping/useBookkeepingStatus.ts
9234
- var BOOKKEEPING_STATUSES = ["NOT_PURCHASED", "BOOKKEEPING_PAUSED", "ACTIVE"];
9308
+ var BOOKKEEPING_STATUSES = [
9309
+ "NOT_PURCHASED",
9310
+ "ACTIVE",
9311
+ "ONBOARDING",
9312
+ "BOOKKEEPING_PAUSED"
9313
+ ];
9235
9314
  function constrainToKnownBookkeepingStatus(status) {
9236
9315
  if (BOOKKEEPING_STATUSES.includes(status)) {
9237
9316
  return status;
@@ -9251,7 +9330,7 @@ function buildKey4({
9251
9330
  accessToken,
9252
9331
  apiUrl,
9253
9332
  businessId,
9254
- tags: ["#bookkeeping, #status"]
9333
+ tags: ["#bookkeeping", "#status"]
9255
9334
  };
9256
9335
  }
9257
9336
  }
@@ -9322,7 +9401,7 @@ var ExpandedBankTransactionRow = (0, import_react58.forwardRef)(
9322
9401
  ({
9323
9402
  bankTransaction,
9324
9403
  isOpen = false,
9325
- close,
9404
+ close: close2,
9326
9405
  categorized,
9327
9406
  asListItem = false,
9328
9407
  submitBtnText = "Save",
@@ -9467,7 +9546,7 @@ var ExpandedBankTransactionRow = (0, import_react58.forwardRef)(
9467
9546
  yield onMatchSubmit(selectedMatchId);
9468
9547
  return;
9469
9548
  }
9470
- close();
9549
+ close2();
9471
9550
  return;
9472
9551
  }
9473
9552
  if (!validateSplit(rowState)) {
@@ -9493,7 +9572,7 @@ var ExpandedBankTransactionRow = (0, import_react58.forwardRef)(
9493
9572
  }))
9494
9573
  }
9495
9574
  );
9496
- close();
9575
+ close2();
9497
9576
  });
9498
9577
  const fetchMemos = () => __async(void 0, null, function* () {
9499
9578
  const getBankTransactionMetadata2 = Layer.getBankTransactionMetadata(
@@ -9507,8 +9586,7 @@ var ExpandedBankTransactionRow = (0, import_react58.forwardRef)(
9507
9586
  }
9508
9587
  );
9509
9588
  const result = yield getBankTransactionMetadata2();
9510
- if (result.data.memo)
9511
- setMemoText(result.data.memo);
9589
+ if (result.data.memo) setMemoText(result.data.memo);
9512
9590
  });
9513
9591
  (0, import_react58.useImperativeHandle)(ref, () => ({
9514
9592
  save
@@ -9522,7 +9600,7 @@ var ExpandedBankTransactionRow = (0, import_react58.forwardRef)(
9522
9600
  return;
9523
9601
  }
9524
9602
  yield matchBankTransaction2(bankTransaction.id, foundMatch.id);
9525
- close();
9603
+ close2();
9526
9604
  });
9527
9605
  const getDivHeight = (0, import_react58.useCallback)(() => {
9528
9606
  const { height: height2 } = bodyRef.current ? bodyRef.current.getBoundingClientRect() : { height: void 0 };
@@ -9558,8 +9636,7 @@ var ExpandedBankTransactionRow = (0, import_react58.forwardRef)(
9558
9636
  }, [getDivHeight, isOpen]);
9559
9637
  (0, import_react58.useEffect)(() => {
9560
9638
  const loadDocumentsAndMetadata = () => __async(void 0, null, function* () {
9561
- if (showDescriptions && isOpen)
9562
- yield fetchMemos();
9639
+ if (showDescriptions && isOpen) yield fetchMemos();
9563
9640
  setIsLoaded(true);
9564
9641
  setOver(true);
9565
9642
  });
@@ -9607,7 +9684,7 @@ var ExpandedBankTransactionRow = (0, import_react58.forwardRef)(
9607
9684
  /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
9608
9685
  "div",
9609
9686
  {
9610
- className: (0, import_classnames40.default)(
9687
+ className: (0, import_classnames41.default)(
9611
9688
  `${className}__match`,
9612
9689
  `${className}__content-panel`,
9613
9690
  purpose === "match" /* match */ ? `${className}__content-panel--active` : ""
@@ -9631,7 +9708,7 @@ var ExpandedBankTransactionRow = (0, import_react58.forwardRef)(
9631
9708
  /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
9632
9709
  "div",
9633
9710
  {
9634
- className: (0, import_classnames40.default)(
9711
+ className: (0, import_classnames41.default)(
9635
9712
  `${className}__splits`,
9636
9713
  `${className}__content-panel`,
9637
9714
  purpose === "categorize" /* categorize */ ? `${className}__content-panel--active` : ""
@@ -9825,7 +9902,7 @@ var SplitTooltipDetails = ({
9825
9902
  };
9826
9903
 
9827
9904
  // src/components/BankTransactionRow/BankTransactionRow.tsx
9828
- var import_classnames41 = __toESM(require("classnames"));
9905
+ var import_classnames42 = __toESM(require("classnames"));
9829
9906
  var import_date_fns17 = require("date-fns");
9830
9907
  var import_jsx_runtime118 = require("react/jsx-runtime");
9831
9908
  var extractDescriptionForSplit = (category) => {
@@ -9939,7 +10016,7 @@ var BankTransactionRow = ({
9939
10016
  const categorized = isCategorized(bankTransaction);
9940
10017
  const className = "Layer__bank-transaction-row";
9941
10018
  const openClassName = open ? `${className}--expanded` : "";
9942
- const rowClassName = (0, import_classnames41.default)(
10019
+ const rowClassName = (0, import_classnames42.default)(
9943
10020
  className,
9944
10021
  bankTransaction.recently_categorized && editable && shouldHideAfterCategorize(bankTransaction) ? "Layer__bank-transaction-row--removing" : "",
9945
10022
  open ? openClassName : "",
@@ -10017,7 +10094,7 @@ var BankTransactionRow = ({
10017
10094
  /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
10018
10095
  "td",
10019
10096
  {
10020
- className: (0, import_classnames41.default)(
10097
+ className: (0, import_classnames42.default)(
10021
10098
  "Layer__table-cell",
10022
10099
  "Layer__table-cell__category-col",
10023
10100
  `${className}__actions-cell`,
@@ -10199,7 +10276,7 @@ var Assignment = ({ bankTransaction }) => {
10199
10276
  };
10200
10277
 
10201
10278
  // src/components/BankTransactionList/BankTransactionListItem.tsx
10202
- var import_classnames42 = __toESM(require("classnames"));
10279
+ var import_classnames43 = __toESM(require("classnames"));
10203
10280
  var import_date_fns19 = require("date-fns");
10204
10281
  var import_jsx_runtime120 = require("react/jsx-runtime");
10205
10282
  var BankTransactionListItem = ({
@@ -10270,7 +10347,7 @@ var BankTransactionListItem = ({
10270
10347
  const categorized = isCategorized(bankTransaction);
10271
10348
  const className = "Layer__bank-transaction-list-item";
10272
10349
  const openClassName = open ? `${className}--expanded` : "";
10273
- const rowClassName = (0, import_classnames42.default)(
10350
+ const rowClassName = (0, import_classnames43.default)(
10274
10351
  className,
10275
10352
  bankTransaction.recently_categorized && editable && shouldHideAfterCategorize(bankTransaction) ? "Layer__bank-transaction-row--removing" : "",
10276
10353
  open ? openClassName : "",
@@ -10476,8 +10553,7 @@ var useMemoText = ({ bankTransaction, isActive }) => {
10476
10553
  }
10477
10554
  );
10478
10555
  const result = yield getBankTransactionMetadata2();
10479
- if (result.data.memo)
10480
- setMemoText(result.data.memo);
10556
+ if (result.data.memo) setMemoText(result.data.memo);
10481
10557
  } catch (error) {
10482
10558
  console.error(error);
10483
10559
  }
@@ -10515,7 +10591,7 @@ var MemoTextProvider = ({
10515
10591
  };
10516
10592
 
10517
10593
  // src/components/BankTransactionMobileList/BusinessForm.tsx
10518
- var import_classnames43 = __toESM(require("classnames"));
10594
+ var import_classnames44 = __toESM(require("classnames"));
10519
10595
  var import_jsx_runtime124 = require("react/jsx-runtime");
10520
10596
  var BusinessForm = ({
10521
10597
  bankTransaction,
@@ -10525,7 +10601,7 @@ var BusinessForm = ({
10525
10601
  showDescriptions
10526
10602
  }) => {
10527
10603
  const receiptsRef = (0, import_react62.useRef)(null);
10528
- const { setContent, close } = (0, import_react62.useContext)(DrawerContext);
10604
+ const { setContent, close: close2 } = (0, import_react62.useContext)(DrawerContext);
10529
10605
  const { categorize: categorizeBankTransaction2, isLoading } = useBankTransactionsContext();
10530
10606
  const [selectedCategory, setSelectedCategory] = (0, import_react62.useState)(
10531
10607
  getAssignedValue(bankTransaction)
@@ -10559,7 +10635,7 @@ var BusinessForm = ({
10559
10635
  return options2;
10560
10636
  }, [bankTransaction, selectedCategory]);
10561
10637
  const onDrawerCategorySelect = (value) => {
10562
- close();
10638
+ close2();
10563
10639
  setSelectedCategory(value);
10564
10640
  };
10565
10641
  const openDrawer = () => {
@@ -10649,7 +10725,7 @@ var BusinessForm = ({
10649
10725
  /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
10650
10726
  "div",
10651
10727
  {
10652
- className: (0, import_classnames43.default)(
10728
+ className: (0, import_classnames44.default)(
10653
10729
  "Layer__bank-transaction-mobile-list-item__receipts",
10654
10730
  hasReceipts(bankTransaction) ? "Layer__bank-transaction-mobile-list-item__actions--with-receipts" : void 0
10655
10731
  ),
@@ -10711,7 +10787,7 @@ var PersonalCategories = /* @__PURE__ */ ((PersonalCategories2) => {
10711
10787
  })(PersonalCategories || {});
10712
10788
 
10713
10789
  // src/components/BankTransactionMobileList/PersonalForm.tsx
10714
- var import_classnames44 = __toESM(require("classnames"));
10790
+ var import_classnames45 = __toESM(require("classnames"));
10715
10791
  var import_jsx_runtime125 = require("react/jsx-runtime");
10716
10792
  var isAlreadyAssigned = (bankTransaction) => {
10717
10793
  if (bankTransaction.categorization_status === "MATCHED" /* MATCHED */ || (bankTransaction == null ? void 0 : bankTransaction.categorization_status) === "SPLIT" /* SPLIT */) {
@@ -10784,7 +10860,7 @@ var PersonalForm = ({
10784
10860
  /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
10785
10861
  "div",
10786
10862
  {
10787
- className: (0, import_classnames44.default)(
10863
+ className: (0, import_classnames45.default)(
10788
10864
  "Layer__bank-transaction-mobile-list-item__receipts",
10789
10865
  hasReceipts(bankTransaction) ? "Layer__bank-transaction-mobile-list-item__actions--with-receipts" : void 0
10790
10866
  ),
@@ -10831,7 +10907,7 @@ var import_react66 = require("react");
10831
10907
 
10832
10908
  // src/components/BankTransactionMobileList/MatchForm.tsx
10833
10909
  var import_react64 = require("react");
10834
- var import_classnames45 = __toESM(require("classnames"));
10910
+ var import_classnames46 = __toESM(require("classnames"));
10835
10911
  var import_jsx_runtime126 = require("react/jsx-runtime");
10836
10912
  var MatchForm2 = ({
10837
10913
  bankTransaction,
@@ -10918,7 +10994,7 @@ var MatchForm2 = ({
10918
10994
  /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
10919
10995
  "div",
10920
10996
  {
10921
- className: (0, import_classnames45.default)(
10997
+ className: (0, import_classnames46.default)(
10922
10998
  "Layer__bank-transaction-mobile-list-item__receipts",
10923
10999
  hasReceipts(bankTransaction) ? "Layer__bank-transaction-mobile-list-item__actions--with-receipts" : void 0
10924
11000
  ),
@@ -10963,7 +11039,7 @@ var MatchForm2 = ({
10963
11039
 
10964
11040
  // src/components/BankTransactionMobileList/SplitForm.tsx
10965
11041
  var import_react65 = require("react");
10966
- var import_classnames46 = __toESM(require("classnames"));
11042
+ var import_classnames47 = __toESM(require("classnames"));
10967
11043
  var import_jsx_runtime127 = require("react/jsx-runtime");
10968
11044
  var SplitForm = ({
10969
11045
  bankTransaction,
@@ -11140,7 +11216,7 @@ var SplitForm = ({
11140
11216
  {
11141
11217
  type: "text",
11142
11218
  name: `split-${index}`,
11143
- className: (0, import_classnames46.default)(
11219
+ className: (0, import_classnames47.default)(
11144
11220
  "Layer__split-amount-input",
11145
11221
  index === 0 && "Layer__split-amount-input--first"
11146
11222
  ),
@@ -11207,7 +11283,7 @@ var SplitForm = ({
11207
11283
  /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
11208
11284
  "div",
11209
11285
  {
11210
- className: (0, import_classnames46.default)(
11286
+ className: (0, import_classnames47.default)(
11211
11287
  "Layer__bank-transaction-mobile-list-item__receipts",
11212
11288
  hasReceipts(bankTransaction) ? "Layer__bank-transaction-mobile-list-item__actions--with-receipts" : void 0
11213
11289
  ),
@@ -11356,7 +11432,7 @@ var TransactionToOpenContext = (0, import_react67.createContext)({
11356
11432
  });
11357
11433
 
11358
11434
  // src/components/BankTransactionMobileList/BankTransactionMobileListItem.tsx
11359
- var import_classnames47 = __toESM(require("classnames"));
11435
+ var import_classnames48 = __toESM(require("classnames"));
11360
11436
  var import_date_fns20 = require("date-fns");
11361
11437
  var import_jsx_runtime130 = require("react/jsx-runtime");
11362
11438
  var DATE_FORMAT2 = "LLL d";
@@ -11425,7 +11501,7 @@ var BankTransactionMobileListItem = ({
11425
11501
  setRemoveAnim(true);
11426
11502
  openNext();
11427
11503
  } else {
11428
- close();
11504
+ close2();
11429
11505
  }
11430
11506
  }
11431
11507
  }, [
@@ -11439,7 +11515,7 @@ var BankTransactionMobileListItem = ({
11439
11515
  }
11440
11516
  setOpen(!open);
11441
11517
  };
11442
- const close = () => {
11518
+ const close2 = () => {
11443
11519
  setOpen(false);
11444
11520
  setHeight(0);
11445
11521
  };
@@ -11466,7 +11542,7 @@ var BankTransactionMobileListItem = ({
11466
11542
  const categorized = isCategorized(bankTransaction);
11467
11543
  const className = "Layer__bank-transaction-mobile-list-item";
11468
11544
  const openClassName = open ? `${className}--expanded` : "";
11469
- const rowClassName = (0, import_classnames47.default)(
11545
+ const rowClassName = (0, import_classnames48.default)(
11470
11546
  className,
11471
11547
  removeAnim ? "Layer__bank-transaction-row--removing" : "",
11472
11548
  open ? openClassName : "",
@@ -11544,7 +11620,7 @@ var BankTransactionMobileListItem = ({
11544
11620
  onChange: onChangePurpose
11545
11621
  }
11546
11622
  ),
11547
- /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(CloseButton, { onClick: () => close() })
11623
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(CloseButton, { onClick: () => close2() })
11548
11624
  ] }) : null,
11549
11625
  /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
11550
11626
  BankTransactionMobileForms,
@@ -11601,14 +11677,14 @@ var BankTransactionMobileList = ({
11601
11677
  var import_react69 = require("react");
11602
11678
 
11603
11679
  // src/components/SkeletonLoader/SkeletonLoader.tsx
11604
- var import_classnames48 = __toESM(require("classnames"));
11680
+ var import_classnames49 = __toESM(require("classnames"));
11605
11681
  var import_jsx_runtime132 = require("react/jsx-runtime");
11606
11682
  var SkeletonLoader = ({
11607
11683
  height,
11608
11684
  width,
11609
11685
  className
11610
11686
  }) => {
11611
- const baseClassName = (0, import_classnames48.default)(
11687
+ const baseClassName = (0, import_classnames49.default)(
11612
11688
  "Layer__skeleton-loader Layer__anim--skeleton-loading",
11613
11689
  className
11614
11690
  );
@@ -11708,7 +11784,7 @@ var BankTransactionsLoader = ({
11708
11784
  };
11709
11785
 
11710
11786
  // src/components/SyncingComponent/SyncingComponent.tsx
11711
- var import_classnames49 = __toESM(require("classnames"));
11787
+ var import_classnames50 = __toESM(require("classnames"));
11712
11788
  var import_jsx_runtime135 = require("react/jsx-runtime");
11713
11789
  var SyncingComponent = ({
11714
11790
  title = "Syncing account data",
@@ -11730,7 +11806,7 @@ var SyncingComponent = ({
11730
11806
  return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
11731
11807
  "div",
11732
11808
  {
11733
- className: (0, import_classnames49.default)(
11809
+ className: (0, import_classnames50.default)(
11734
11810
  "Layer__syncing-component",
11735
11811
  inProgress ? "Layer__syncing-component--with-border" : ""
11736
11812
  ),
@@ -11925,7 +12001,7 @@ var usePagination = ({
11925
12001
  };
11926
12002
 
11927
12003
  // src/components/Pagination/Pagination.tsx
11928
- var import_classnames50 = __toESM(require("classnames"));
12004
+ var import_classnames51 = __toESM(require("classnames"));
11929
12005
  var import_jsx_runtime139 = require("react/jsx-runtime");
11930
12006
  var Pagination = (props) => {
11931
12007
  return /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "Layer__pagination-container", children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(PaginationContent, __spreadValues({}, props)) });
@@ -11956,7 +12032,7 @@ var PaginationContent = ({
11956
12032
  /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
11957
12033
  "li",
11958
12034
  {
11959
- className: (0, import_classnames50.default)(
12035
+ className: (0, import_classnames51.default)(
11960
12036
  "Layer__pagination-item Layer__pagination-arrow Layer__pagination-arrow--previous",
11961
12037
  {
11962
12038
  disabled: currentPage === 1
@@ -11981,7 +12057,7 @@ var PaginationContent = ({
11981
12057
  return /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
11982
12058
  "li",
11983
12059
  {
11984
- className: (0, import_classnames50.default)("Layer__pagination-item", {
12060
+ className: (0, import_classnames51.default)("Layer__pagination-item", {
11985
12061
  selected: pageNumber === currentPage
11986
12062
  }),
11987
12063
  onClick: () => {
@@ -12009,7 +12085,7 @@ var PaginationContent = ({
12009
12085
  /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
12010
12086
  "li",
12011
12087
  {
12012
- className: (0, import_classnames50.default)(
12088
+ className: (0, import_classnames51.default)(
12013
12089
  "Layer__pagination-item Layer__pagination-arrow Layer__pagination-arrow--next",
12014
12090
  {
12015
12091
  disabled: currentPage === lastPage
@@ -12025,7 +12101,7 @@ var PaginationContent = ({
12025
12101
 
12026
12102
  // src/components/BankTransactions/BankTransactionsHeader.tsx
12027
12103
  var import_react72 = require("react");
12028
- var import_classnames51 = __toESM(require("classnames"));
12104
+ var import_classnames52 = __toESM(require("classnames"));
12029
12105
  var import_date_fns21 = require("date-fns");
12030
12106
  var import_jsx_runtime140 = require("react/jsx-runtime");
12031
12107
  var DownloadButton2 = ({
@@ -12095,7 +12171,7 @@ var BankTransactionsHeader = ({
12095
12171
  return /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(
12096
12172
  Header,
12097
12173
  {
12098
- className: (0, import_classnames51.default)(
12174
+ className: (0, import_classnames52.default)(
12099
12175
  "Layer__bank-transactions__header",
12100
12176
  withDatePicker && "Layer__bank-transactions__header--with-date-picker",
12101
12177
  mobileComponent && listView ? "Layer__bank-transactions__header--mobile" : void 0
@@ -13081,25 +13157,36 @@ function prepareFiltersBody(compareOptions) {
13081
13157
  const noneFilters = compareOptions.filter(
13082
13158
  ({ tagFilterConfig: { tagFilters: tagFilters2 } }) => tagFilters2 === "None"
13083
13159
  );
13084
- const tagFilters = compareOptions.flatMap(({ tagFilterConfig: { tagFilters: tagFilters2 } }) => {
13160
+ const tagFilters = compareOptions.flatMap(({ tagFilterConfig: { tagFilters: tagFilters2, structure } }) => {
13085
13161
  if (tagFilters2 === "None") {
13086
13162
  return null;
13087
13163
  }
13088
13164
  if (tagFilters2.tagValues.length === 0) {
13089
- return { required_tags: [] };
13090
- }
13091
- return tagFilters2.tagValues.map((tagValue) => ({
13092
- required_tags: [{
13093
- key: tagFilters2.tagKey,
13094
- value: tagValue
13095
- }]
13096
- }));
13165
+ const filter = {
13166
+ structure,
13167
+ required_tags: []
13168
+ };
13169
+ return filter;
13170
+ }
13171
+ return tagFilters2.tagValues.map((tagValue) => {
13172
+ const filter = {
13173
+ structure,
13174
+ required_tags: [{
13175
+ key: tagFilters2.tagKey,
13176
+ value: tagValue
13177
+ }]
13178
+ };
13179
+ return filter;
13180
+ });
13097
13181
  }).filter((item) => item !== null);
13098
13182
  if (tagFilters.length === 0) {
13099
13183
  return;
13100
13184
  }
13101
13185
  const allFilters = [
13102
- noneFilters.length > 0 ? { required_tags: [] } : null,
13186
+ noneFilters.length > 0 ? {
13187
+ structure: noneFilters[0].tagFilterConfig.structure,
13188
+ required_tags: []
13189
+ } : null,
13103
13190
  ...tagFilters
13104
13191
  ].filter((item) => item !== null);
13105
13192
  return isArrayWithAtLeastOne(allFilters) ? allFilters : void 0;
@@ -13407,7 +13494,7 @@ var Indicator = ({
13407
13494
  };
13408
13495
 
13409
13496
  // src/components/ProfitAndLossChart/ProfitAndLossChart.tsx
13410
- var import_classnames52 = __toESM(require("classnames"));
13497
+ var import_classnames53 = __toESM(require("classnames"));
13411
13498
  var import_date_fns26 = require("date-fns");
13412
13499
  var import_recharts = require("recharts");
13413
13500
  var import_jsx_runtime148 = require("react/jsx-runtime");
@@ -13814,7 +13901,7 @@ var ProfitAndLossChart = ({
13814
13901
  /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
13815
13902
  import_recharts.ResponsiveContainer,
13816
13903
  {
13817
- className: (0, import_classnames52.default)(
13904
+ className: (0, import_classnames53.default)(
13818
13905
  "Layer__chart-container",
13819
13906
  loaded !== "complete" && "Layer__chart-container--loading"
13820
13907
  ),
@@ -13934,7 +14021,7 @@ var ProfitAndLossChart = ({
13934
14021
  isAnimationActive: barAnimActive,
13935
14022
  animationDuration: 100,
13936
14023
  radius: [2, 2, 0, 0],
13937
- className: (0, import_classnames52.default)(
14024
+ className: (0, import_classnames53.default)(
13938
14025
  "Layer__profit-and-loss-chart__bar--loading",
13939
14026
  loaded !== "complete" && "Layer__profit-and-loss-chart__bar--loading-anim"
13940
14027
  ),
@@ -13950,7 +14037,7 @@ var ProfitAndLossChart = ({
13950
14037
  isAnimationActive: barAnimActive,
13951
14038
  animationDuration: 100,
13952
14039
  radius: [2, 2, 0, 0],
13953
- className: (0, import_classnames52.default)(
14040
+ className: (0, import_classnames53.default)(
13954
14041
  "Layer__profit-and-loss-chart__bar--loading",
13955
14042
  loaded !== "complete" && "Layer__profit-and-loss-chart__bar--loading-anim"
13956
14043
  ),
@@ -14507,7 +14594,7 @@ var SortArrows = (_a) => {
14507
14594
  var SortArrows_default = SortArrows;
14508
14595
 
14509
14596
  // src/components/ProfitAndLossDetailedCharts/DetailedTable.tsx
14510
- var import_classnames53 = __toESM(require("classnames"));
14597
+ var import_classnames54 = __toESM(require("classnames"));
14511
14598
  var import_jsx_runtime154 = require("react/jsx-runtime");
14512
14599
  var mapTypesToColors = (data, colorList = DEFAULT_CHART_COLOR_TYPE) => {
14513
14600
  const typeToColor = {};
@@ -14601,7 +14688,7 @@ var DetailedTable = ({
14601
14688
  }) => {
14602
14689
  const buildColClass = (column) => {
14603
14690
  var _a, _b, _c;
14604
- return (0, import_classnames53.default)(
14691
+ return (0, import_classnames54.default)(
14605
14692
  "Layer__sortable-col",
14606
14693
  sidebarScope && ((_a = filters[sidebarScope]) == null ? void 0 : _a.sortBy) === column ? `sort--${(_c = sidebarScope && ((_b = filters[sidebarScope]) == null ? void 0 : _b.sortDirection)) != null ? _c : "desc"}` : ""
14607
14694
  );
@@ -14653,7 +14740,7 @@ var DetailedTable = ({
14653
14740
  return /* @__PURE__ */ (0, import_jsx_runtime154.jsxs)(
14654
14741
  "tr",
14655
14742
  {
14656
- className: (0, import_classnames53.default)(
14743
+ className: (0, import_classnames54.default)(
14657
14744
  "Layer__profit-and-loss-detailed-table__row",
14658
14745
  hoveredItem && hoveredItem === item.display_name ? "active" : ""
14659
14746
  ),
@@ -14686,7 +14773,7 @@ var DetailedTable = ({
14686
14773
  };
14687
14774
 
14688
14775
  // src/components/ProfitAndLossDetailedCharts/DetailedChart.tsx
14689
- var import_classnames54 = __toESM(require("classnames"));
14776
+ var import_classnames55 = __toESM(require("classnames"));
14690
14777
  var import_recharts2 = require("recharts");
14691
14778
  var import_jsx_runtime155 = require("react/jsx-runtime");
14692
14779
  var DetailedChart = ({
@@ -14780,7 +14867,7 @@ var DetailedChart = ({
14780
14867
  return /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
14781
14868
  import_recharts2.Cell,
14782
14869
  {
14783
- className: (0, import_classnames54.default)(
14870
+ className: (0, import_classnames55.default)(
14784
14871
  "Layer__profit-and-loss-detailed-charts__pie",
14785
14872
  hoveredItem && active ? "active" : "inactive",
14786
14873
  entry.type === "Uncategorized" && "Layer__profit-and-loss-detailed-charts__pie--border"
@@ -15246,11 +15333,11 @@ var import_react91 = require("react");
15246
15333
 
15247
15334
  // src/components/Header/Header.tsx
15248
15335
  var import_react88 = require("react");
15249
- var import_classnames55 = __toESM(require("classnames"));
15336
+ var import_classnames56 = __toESM(require("classnames"));
15250
15337
  var import_jsx_runtime161 = require("react/jsx-runtime");
15251
15338
  var Header2 = (0, import_react88.forwardRef)(
15252
15339
  ({ className, children, style, sticky, asHeader, rounded }, ref) => {
15253
- const baseClassName = (0, import_classnames55.default)(
15340
+ const baseClassName = (0, import_classnames56.default)(
15254
15341
  "Layer__header",
15255
15342
  sticky && "Layer__header--sticky",
15256
15343
  rounded && "Layer__header--top-rounded",
@@ -15273,24 +15360,24 @@ var Header2 = (0, import_react88.forwardRef)(
15273
15360
  Header2.displayName = "Header";
15274
15361
 
15275
15362
  // src/components/Header/HeaderRow.tsx
15276
- var import_classnames56 = __toESM(require("classnames"));
15363
+ var import_classnames57 = __toESM(require("classnames"));
15277
15364
  var import_jsx_runtime162 = require("react/jsx-runtime");
15278
15365
  var HeaderRow = ({ className, children, direction, style }) => {
15279
15366
  const dataProps = toDataProperties({ direction });
15280
- return /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("div", __spreadProps(__spreadValues({}, dataProps), { className: (0, import_classnames56.default)("Layer__header__row", className), style, children }));
15367
+ return /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("div", __spreadProps(__spreadValues({}, dataProps), { className: (0, import_classnames57.default)("Layer__header__row", className), style, children }));
15281
15368
  };
15282
15369
 
15283
15370
  // src/components/Header/HeaderCol.tsx
15284
- var import_classnames57 = __toESM(require("classnames"));
15371
+ var import_classnames58 = __toESM(require("classnames"));
15285
15372
  var import_jsx_runtime163 = require("react/jsx-runtime");
15286
15373
  var HeaderCol = ({ className, children, style, noPadding = false }) => {
15287
15374
  const dataProperties = toDataProperties({ "no-padding": noPadding });
15288
- return /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("div", __spreadProps(__spreadValues({}, dataProperties), { className: (0, import_classnames57.default)("Layer__header__col", className), style, children }));
15375
+ return /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("div", __spreadProps(__spreadValues({}, dataProperties), { className: (0, import_classnames58.default)("Layer__header__col", className), style, children }));
15289
15376
  };
15290
15377
 
15291
15378
  // src/components/Panel/Panel.tsx
15292
15379
  var import_react89 = require("react");
15293
- var import_classnames58 = __toESM(require("classnames"));
15380
+ var import_classnames59 = __toESM(require("classnames"));
15294
15381
  var import_jsx_runtime164 = require("react/jsx-runtime");
15295
15382
  var Panel = ({
15296
15383
  children,
@@ -15310,7 +15397,7 @@ var Panel = ({
15310
15397
  setSidebarHeight((_b = parentRef == null ? void 0 : parentRef.current) == null ? void 0 : _b.offsetHeight);
15311
15398
  }
15312
15399
  }, [parentRef, (_a = parentRef == null ? void 0 : parentRef.current) == null ? void 0 : _a.offsetHeight, sidebarIsOpen]);
15313
- const sidebarClass = (0, import_classnames58.default)(
15400
+ const sidebarClass = (0, import_classnames59.default)(
15314
15401
  "Layer__panel__sidebar",
15315
15402
  defaultSidebarHeight && "Layer__panel__sidebar--default",
15316
15403
  floating && "Layer__panel__sidebar--floating"
@@ -15318,7 +15405,7 @@ var Panel = ({
15318
15405
  return /* @__PURE__ */ (0, import_jsx_runtime164.jsxs)(
15319
15406
  "div",
15320
15407
  {
15321
- className: (0, import_classnames58.default)(
15408
+ className: (0, import_classnames59.default)(
15322
15409
  "Layer__panel",
15323
15410
  className,
15324
15411
  sidebarIsOpen && "Layer__panel--open"
@@ -15347,17 +15434,17 @@ var Panel = ({
15347
15434
  var import_react90 = require("react");
15348
15435
 
15349
15436
  // src/components/ViewHeader/ViewHeader.tsx
15350
- var import_classnames59 = __toESM(require("classnames"));
15437
+ var import_classnames60 = __toESM(require("classnames"));
15351
15438
  var import_jsx_runtime165 = require("react/jsx-runtime");
15352
15439
  var ViewHeader = ({ title, className, children }) => {
15353
- return /* @__PURE__ */ (0, import_jsx_runtime165.jsx)("div", { className: (0, import_classnames59.default)("Layer__view-header", className), children: /* @__PURE__ */ (0, import_jsx_runtime165.jsxs)("div", { className: "Layer__view-header__content", children: [
15440
+ return /* @__PURE__ */ (0, import_jsx_runtime165.jsx)("div", { className: (0, import_classnames60.default)("Layer__view-header", className), children: /* @__PURE__ */ (0, import_jsx_runtime165.jsxs)("div", { className: "Layer__view-header__content", children: [
15354
15441
  title && /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(Heading, { className: "Layer__view-header__title", children: title }),
15355
15442
  children && /* @__PURE__ */ (0, import_jsx_runtime165.jsx)("div", { className: "Layer__view-header__children", children })
15356
15443
  ] }) });
15357
15444
  };
15358
15445
 
15359
15446
  // src/components/View/View.tsx
15360
- var import_classnames60 = __toESM(require("classnames"));
15447
+ var import_classnames61 = __toESM(require("classnames"));
15361
15448
  var import_jsx_runtime166 = require("react/jsx-runtime");
15362
15449
  var View = (0, import_react90.forwardRef)(
15363
15450
  ({
@@ -15373,7 +15460,7 @@ var View = (0, import_react90.forwardRef)(
15373
15460
  }, ref) => {
15374
15461
  const { theme } = useLayerContext();
15375
15462
  const styles = parseStylesFromThemeConfig(theme);
15376
- const viewClassNames = (0, import_classnames60.default)(
15463
+ const viewClassNames = (0, import_classnames61.default)(
15377
15464
  "Layer__view",
15378
15465
  type === "panel" && "Layer__view--panel",
15379
15466
  viewClassName
@@ -15383,7 +15470,7 @@ var View = (0, import_react90.forwardRef)(
15383
15470
  ViewHeader,
15384
15471
  {
15385
15472
  title,
15386
- className: (0, import_classnames60.default)(
15473
+ className: (0, import_classnames61.default)(
15387
15474
  headerControls ? "Layer__view-header--paddings" : void 0
15388
15475
  ),
15389
15476
  children: header != null ? header : headerControls
@@ -15892,7 +15979,7 @@ var TableBody = ({ children }) => {
15892
15979
  };
15893
15980
 
15894
15981
  // src/components/TableCell/TableCell.tsx
15895
- var import_classnames61 = __toESM(require("classnames"));
15982
+ var import_classnames62 = __toESM(require("classnames"));
15896
15983
  var import_jsx_runtime176 = require("react/jsx-runtime");
15897
15984
  var TableCell = ({
15898
15985
  children,
@@ -15912,7 +15999,7 @@ var TableCell = ({
15912
15999
  const amount = typeof children === "number" ? children : 0;
15913
16000
  const isPositive = amount >= 0;
15914
16001
  const amountString = centsToDollars(Math.abs(amount));
15915
- const cellClassNames = (0, import_classnames61.default)(
16002
+ const cellClassNames = (0, import_classnames62.default)(
15916
16003
  "Layer__table-cell",
15917
16004
  (primary || isHeaderCell) && "Layer__table-cell--primary",
15918
16005
  isHeaderCell && "Layer__table-header",
@@ -15955,7 +16042,7 @@ var TableHead = ({ children }) => {
15955
16042
  };
15956
16043
 
15957
16044
  // src/components/TableRow/TableRow.tsx
15958
- var import_classnames62 = __toESM(require("classnames"));
16045
+ var import_classnames63 = __toESM(require("classnames"));
15959
16046
  var import_jsx_runtime178 = require("react/jsx-runtime");
15960
16047
  var TableRow = ({
15961
16048
  rowKey,
@@ -15975,12 +16062,11 @@ var TableRow = ({
15975
16062
  if (onClick) {
15976
16063
  onClick(e);
15977
16064
  } else {
15978
- if (variant === "summation" || !expandable)
15979
- return;
16065
+ if (variant === "summation" || !expandable) return;
15980
16066
  handleExpand && handleExpand();
15981
16067
  }
15982
16068
  };
15983
- const rowClassNames = (0, import_classnames62.default)([
16069
+ const rowClassNames = (0, import_classnames63.default)([
15984
16070
  "Layer__table-row",
15985
16071
  !isHeadRow && `Layer__table-row--depth-${depth}`,
15986
16072
  !isHeadRow && `Layer__table-row--variant-${variant}`,
@@ -16004,7 +16090,7 @@ var TableRow = ({
16004
16090
 
16005
16091
  // src/components/Table/Table.tsx
16006
16092
  var import_react97 = require("react");
16007
- var import_classnames63 = __toESM(require("classnames"));
16093
+ var import_classnames64 = __toESM(require("classnames"));
16008
16094
  var import_jsx_runtime179 = require("react/jsx-runtime");
16009
16095
  var Table = ({
16010
16096
  componentName,
@@ -16045,11 +16131,11 @@ var Table = ({
16045
16131
  prevChildrenRef.current = newChildrenKeys;
16046
16132
  }
16047
16133
  }, [children]);
16048
- const tableWrapperClassNames = (0, import_classnames63.default)(
16134
+ const tableWrapperClassNames = (0, import_classnames64.default)(
16049
16135
  "Layer__table-wrapper",
16050
16136
  bottomSpacing && "Layer__table-wrapper--bottom-spacing"
16051
16137
  );
16052
- const tableClassNames = (0, import_classnames63.default)(
16138
+ const tableClassNames = (0, import_classnames64.default)(
16053
16139
  "Layer__table",
16054
16140
  componentName && `Layer__${componentName}__table`,
16055
16141
  borderCollapse && `Layer__table__${borderCollapse}-rows`
@@ -16058,7 +16144,7 @@ var Table = ({
16058
16144
  };
16059
16145
 
16060
16146
  // src/components/ProfitAndLossTable/ProfitAndLossCompareTable.tsx
16061
- var import_classnames64 = __toESM(require("classnames"));
16147
+ var import_classnames65 = __toESM(require("classnames"));
16062
16148
  var import_jsx_runtime180 = require("react/jsx-runtime");
16063
16149
  var ProfitAndLossCompareTable = ({
16064
16150
  stringOverrides
@@ -16079,7 +16165,7 @@ var ProfitAndLossCompareTable = ({
16079
16165
  return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(
16080
16166
  "div",
16081
16167
  {
16082
- className: (0, import_classnames64.default)("Layer__profit-and-loss-table__loader-container"),
16168
+ className: (0, import_classnames65.default)("Layer__profit-and-loss-table__loader-container"),
16083
16169
  children: /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(Loader2, {})
16084
16170
  }
16085
16171
  );
@@ -16269,7 +16355,7 @@ var empty_profit_and_loss_report_default = {
16269
16355
  };
16270
16356
 
16271
16357
  // src/components/ProfitAndLossTable/ProfitAndLossTableComponent.tsx
16272
- var import_classnames65 = __toESM(require("classnames"));
16358
+ var import_classnames66 = __toESM(require("classnames"));
16273
16359
  var import_jsx_runtime182 = require("react/jsx-runtime");
16274
16360
  var ProfitAndLossTableComponent = ({
16275
16361
  asContainer,
@@ -16290,7 +16376,7 @@ var ProfitAndLossTableComponent = ({
16290
16376
  return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
16291
16377
  "div",
16292
16378
  {
16293
- className: (0, import_classnames65.default)(
16379
+ className: (0, import_classnames66.default)(
16294
16380
  "Layer__profit-and-loss-table__loader-container",
16295
16381
  asContainer && "Layer__component-container"
16296
16382
  ),
@@ -18603,10 +18689,10 @@ var lineEntryNumber = (ledgerEntryLine) => {
18603
18689
  };
18604
18690
 
18605
18691
  // src/components/Card/Card.tsx
18606
- var import_classnames66 = __toESM(require("classnames"));
18692
+ var import_classnames67 = __toESM(require("classnames"));
18607
18693
  var import_jsx_runtime203 = require("react/jsx-runtime");
18608
18694
  var Card = ({ children, className }) => {
18609
- return /* @__PURE__ */ (0, import_jsx_runtime203.jsx)("div", { className: (0, import_classnames66.default)("Layer__card", className), children });
18695
+ return /* @__PURE__ */ (0, import_jsx_runtime203.jsx)("div", { className: (0, import_classnames67.default)("Layer__card", className), children });
18610
18696
  };
18611
18697
 
18612
18698
  // src/components/DateTime/DateTime.tsx
@@ -18650,7 +18736,7 @@ var DateTime = ({
18650
18736
  };
18651
18737
 
18652
18738
  // src/components/DetailsList/DetailsList.tsx
18653
- var import_classnames67 = __toESM(require("classnames"));
18739
+ var import_classnames68 = __toESM(require("classnames"));
18654
18740
  var import_jsx_runtime205 = require("react/jsx-runtime");
18655
18741
  var DetailsList = ({
18656
18742
  title,
@@ -18659,7 +18745,7 @@ var DetailsList = ({
18659
18745
  titleClassName,
18660
18746
  actions
18661
18747
  }) => {
18662
- return /* @__PURE__ */ (0, import_jsx_runtime205.jsxs)("div", { className: (0, import_classnames67.default)("Layer__details-list", className), children: [
18748
+ return /* @__PURE__ */ (0, import_jsx_runtime205.jsxs)("div", { className: (0, import_classnames68.default)("Layer__details-list", className), children: [
18663
18749
  title && /* @__PURE__ */ (0, import_jsx_runtime205.jsxs)(Header, { className: titleClassName, children: [
18664
18750
  /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(Heading, { size: "secondary" /* secondary */, children: title }),
18665
18751
  actions && /* @__PURE__ */ (0, import_jsx_runtime205.jsx)("div", { className: "Layer__details-list__actions", children: actions })
@@ -18974,7 +19060,7 @@ var LedgerAccountEntryDetails = ({
18974
19060
 
18975
19061
  // src/components/LedgerAccount/LedgerAccountRow.tsx
18976
19062
  var import_react116 = require("react");
18977
- var import_classnames68 = __toESM(require("classnames"));
19063
+ var import_classnames69 = __toESM(require("classnames"));
18978
19064
  var import_date_fns36 = require("date-fns");
18979
19065
  var import_jsx_runtime208 = require("react/jsx-runtime");
18980
19066
  var LedgerAccountRow = ({
@@ -19000,7 +19086,7 @@ var LedgerAccountRow = ({
19000
19086
  return /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)(
19001
19087
  "tr",
19002
19088
  {
19003
- className: (0, import_classnames68.default)(
19089
+ className: (0, import_classnames69.default)(
19004
19090
  "Layer__table-row",
19005
19091
  row.entry_id === selectedEntryId && "Layer__table-row--active",
19006
19092
  initialLoad && "initial-load",
@@ -19041,7 +19127,7 @@ var LedgerAccountRow = ({
19041
19127
  return /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(
19042
19128
  "tr",
19043
19129
  {
19044
- className: (0, import_classnames68.default)(
19130
+ className: (0, import_classnames69.default)(
19045
19131
  "Layer__table-row",
19046
19132
  row.entry_id === selectedEntryId && "Layer__table-row--active",
19047
19133
  initialLoad && "initial-load",
@@ -19093,7 +19179,7 @@ var LedgerAccountRow = ({
19093
19179
  return /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)(
19094
19180
  "tr",
19095
19181
  {
19096
- className: (0, import_classnames68.default)(
19182
+ className: (0, import_classnames69.default)(
19097
19183
  "Layer__table-row",
19098
19184
  row.entry_id === selectedEntryId && "Layer__table-row--active",
19099
19185
  initialLoad && "initial-load",
@@ -19121,7 +19207,7 @@ var LedgerAccountRow = ({
19121
19207
  };
19122
19208
 
19123
19209
  // src/components/LedgerAccount/LedgerAccountIndex.tsx
19124
- var import_classnames69 = __toESM(require("classnames"));
19210
+ var import_classnames70 = __toESM(require("classnames"));
19125
19211
  var import_jsx_runtime209 = require("react/jsx-runtime");
19126
19212
  var LedgerAccount = ({
19127
19213
  containerRef,
@@ -19152,7 +19238,7 @@ var LedgerAccount = ({
19152
19238
  return () => clearTimeout(timeoutLoad);
19153
19239
  }
19154
19240
  }, [isLoading]);
19155
- const baseClassName = (0, import_classnames69.default)(
19241
+ const baseClassName = (0, import_classnames70.default)(
19156
19242
  "Layer__ledger-account__index",
19157
19243
  accountId && "open"
19158
19244
  );
@@ -19167,7 +19253,7 @@ var LedgerAccount = ({
19167
19253
  const lastPageIndex = firstPageIndex + pageSize;
19168
19254
  return (_a2 = rawData == null ? void 0 : rawData.sort((a, b) => Date.parse(b.date) - Date.parse(a.date))) == null ? void 0 : _a2.slice(firstPageIndex, lastPageIndex);
19169
19255
  }, [rawData, currentPage]);
19170
- const close = () => {
19256
+ const close2 = () => {
19171
19257
  setAccountId(void 0);
19172
19258
  closeSelectedEntry();
19173
19259
  };
@@ -19185,7 +19271,7 @@ var LedgerAccount = ({
19185
19271
  className: "Layer__ledger-account__panel",
19186
19272
  children: /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)("div", { className: baseClassName, children: [
19187
19273
  /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(Header2, { className: "Layer__ledger-account__header", children: /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(HeaderRow, { children: /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)(HeaderCol, { children: [
19188
- /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(BackButton, { onClick: close }),
19274
+ /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(BackButton, { onClick: close2 }),
19189
19275
  /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)("div", { className: "Layer__ledger-account__title-container", children: [
19190
19276
  /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(
19191
19277
  Text,
@@ -20793,8 +20879,7 @@ var useTasks = ({
20793
20879
  }).then(refetch);
20794
20880
  });
20795
20881
  const submitResponseToTask2 = (taskId, userResponse) => {
20796
- if (!taskId || !userResponse || userResponse.length === 0)
20797
- return;
20882
+ if (!taskId || !userResponse || userResponse.length === 0) return;
20798
20883
  const data2 = {
20799
20884
  type: "FreeResponse",
20800
20885
  user_response: userResponse
@@ -20947,7 +21032,7 @@ var ProgressIcon_default = ProgressIcon;
20947
21032
 
20948
21033
  // src/components/TasksHeader/TasksHeader.tsx
20949
21034
  var import_date_fns40 = require("date-fns");
20950
- var import_classnames70 = __toESM(require("classnames"));
21035
+ var import_classnames71 = __toESM(require("classnames"));
20951
21036
  var import_jsx_runtime220 = require("react/jsx-runtime");
20952
21037
  var ICONS = {
20953
21038
  loading: {
@@ -20975,7 +21060,8 @@ var TasksHeader = ({
20975
21060
  tasksHeader = "Bookkeeping Tasks",
20976
21061
  collapsable,
20977
21062
  open,
20978
- toggleContent
21063
+ toggleContent,
21064
+ highlightYears
20979
21065
  }) => {
20980
21066
  const {
20981
21067
  data: tasks,
@@ -20989,13 +21075,15 @@ var TasksHeader = ({
20989
21075
  const completedTasks = tasks == null ? void 0 : tasks.filter((task) => isComplete(task.status)).length;
20990
21076
  const badgeVariant = completedTasks === (tasks == null ? void 0 : tasks.length) ? ICONS.done : ICONS.pending;
20991
21077
  const minDate = getEarliestDateToBrowse(business);
20992
- return /* @__PURE__ */ (0, import_jsx_runtime220.jsx)("div", { className: (0, import_classnames70.default)("Layer__tasks-header", collapsable && "Layer__tasks-header--collapsable"), children: /* @__PURE__ */ (0, import_jsx_runtime220.jsxs)("div", { className: "Layer__tasks-header__left-col", children: [
21078
+ return /* @__PURE__ */ (0, import_jsx_runtime220.jsx)("div", { className: (0, import_classnames71.default)("Layer__tasks-header", collapsable && "Layer__tasks-header--collapsable"), children: /* @__PURE__ */ (0, import_jsx_runtime220.jsxs)("div", { className: "Layer__tasks-header__left-col", children: [
20993
21079
  /* @__PURE__ */ (0, import_jsx_runtime220.jsxs)("div", { className: "Layer__tasks-header__left-col__title", children: [
20994
21080
  /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(Text, { size: "lg" /* lg */, children: tasksHeader }),
20995
21081
  loadedStatus !== "complete" && !open ? /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(Badge, { variant: ICONS.loading.badge, icon: ICONS.loading.icon, children: ICONS.loading.text }) : loadedStatus === "complete" && !open && (!tasks || error) ? /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(
20996
21082
  Badge,
20997
21083
  {
20998
- onClick: () => refetch(),
21084
+ onClick: () => {
21085
+ void refetch();
21086
+ },
20999
21087
  variant: ICONS.refresh.badge,
21000
21088
  icon: ICONS.refresh.icon,
21001
21089
  children: ICONS.refresh.text
@@ -21021,7 +21109,8 @@ var TasksHeader = ({
21021
21109
  maxDate: (0, import_date_fns40.endOfYear)(/* @__PURE__ */ new Date()),
21022
21110
  currentDateOption: false,
21023
21111
  navigateArrows: ["mobile", "desktop"],
21024
- disabled: minDate && (0, import_date_fns40.getYear)(minDate) === (0, import_date_fns40.getYear)(/* @__PURE__ */ new Date())
21112
+ disabled: minDate && (0, import_date_fns40.getYear)(minDate) === (0, import_date_fns40.getYear)(/* @__PURE__ */ new Date()),
21113
+ highlightYears
21025
21114
  }
21026
21115
  ),
21027
21116
  collapsable && /* @__PURE__ */ (0, import_jsx_runtime220.jsx)("div", { className: "Layer__tasks-header__left-col__expand", children: /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(ExpandButton, { onClick: toggleContent, collapsed: !open }) })
@@ -21090,7 +21179,7 @@ var SmileIcon_default = SmileIcon;
21090
21179
 
21091
21180
  // src/components/TasksListItem/TasksListItem.tsx
21092
21181
  var import_react130 = require("react");
21093
- var import_classnames71 = __toESM(require("classnames"));
21182
+ var import_classnames72 = __toESM(require("classnames"));
21094
21183
  var import_jsx_runtime222 = require("react/jsx-runtime");
21095
21184
  var TasksListItem = ({
21096
21185
  task,
@@ -21107,16 +21196,16 @@ var TasksListItem = ({
21107
21196
  deleteUploadsForTask,
21108
21197
  updateDocUploadTaskDescription
21109
21198
  } = (0, import_react130.useContext)(TasksContext);
21110
- const taskBodyClassName = (0, import_classnames71.default)(
21199
+ const taskBodyClassName = (0, import_classnames72.default)(
21111
21200
  "Layer__tasks-list-item__body",
21112
21201
  isOpen && "Layer__tasks-list-item__body--expanded",
21113
21202
  isComplete(task.status) && "Layer__tasks-list-item--completed"
21114
21203
  );
21115
- const taskHeadClassName = (0, import_classnames71.default)(
21204
+ const taskHeadClassName = (0, import_classnames72.default)(
21116
21205
  "Layer__tasks-list-item__head-info",
21117
21206
  isComplete(task.status) ? "Layer__tasks-list-item--completed" : "Layer__tasks-list-item--pending"
21118
21207
  );
21119
- const taskItemClassName = (0, import_classnames71.default)(
21208
+ const taskItemClassName = (0, import_classnames72.default)(
21120
21209
  "Layer__tasks-list-item",
21121
21210
  isOpen && "Layer__tasks-list-item__expanded"
21122
21211
  );
@@ -21325,7 +21414,7 @@ var TasksList = ({ pageSize = 10 }) => {
21325
21414
 
21326
21415
  // src/components/TasksPending/TasksPending.tsx
21327
21416
  var import_react132 = require("react");
21328
- var import_classnames72 = __toESM(require("classnames"));
21417
+ var import_classnames73 = __toESM(require("classnames"));
21329
21418
  var import_date_fns42 = require("date-fns");
21330
21419
  var import_recharts4 = require("recharts");
21331
21420
  var import_jsx_runtime224 = require("react/jsx-runtime");
@@ -21348,7 +21437,7 @@ var TasksPending = () => {
21348
21437
  value: data == null ? void 0 : data.filter((task) => !isComplete(task.status)).length
21349
21438
  }
21350
21439
  ];
21351
- const taskStatusClassName = (0, import_classnames72.default)(
21440
+ const taskStatusClassName = (0, import_classnames73.default)(
21352
21441
  completedTasks && completedTasks > 0 ? "Layer__tasks-pending-bar__status--done" : "Layer__tasks-pending-bar__status--pending"
21353
21442
  );
21354
21443
  return /* @__PURE__ */ (0, import_jsx_runtime224.jsxs)("div", { className: "Layer__tasks-pending", children: [
@@ -21397,11 +21486,11 @@ var import_react133 = require("react");
21397
21486
  var import_date_fns43 = require("date-fns");
21398
21487
 
21399
21488
  // src/components/TasksMonthSelector/TaskMonthTile.tsx
21400
- var import_classnames73 = __toESM(require("classnames"));
21489
+ var import_classnames74 = __toESM(require("classnames"));
21401
21490
  var import_jsx_runtime225 = require("react/jsx-runtime");
21402
21491
  var TaskMonthTile = ({ monthData, onClick, active, disabled }) => {
21403
21492
  const isCompleted = monthData.total === monthData.completed;
21404
- const baseClass = (0, import_classnames73.default)(
21493
+ const baseClass = (0, import_classnames74.default)(
21405
21494
  "Layer__tasks-month-selector__month",
21406
21495
  isCompleted && "Layer__tasks-month-selector__month--completed",
21407
21496
  active && "Layer__tasks-month-selector__month--active",
@@ -21445,7 +21534,6 @@ var TasksMonthSelector = ({ tasks, year, currentDate, onClick }) => {
21445
21534
  { year, month: i, date: 1, hours: 0, minutes: 0, seconds: 0, milliseconds: 0 }
21446
21535
  );
21447
21536
  const endDate = (0, import_date_fns43.endOfMonth)(startDate);
21448
- const disabled = minDate && (0, import_date_fns43.isBefore)(startDate, minDate) || (0, import_date_fns43.isAfter)(startDate, (0, import_date_fns43.startOfMonth)(/* @__PURE__ */ new Date()));
21449
21537
  const taskData = (_a = tasks == null ? void 0 : tasks.find((x) => x.month === i && x.year === year)) != null ? _a : __spreadValues({
21450
21538
  monthStr: (0, import_date_fns43.format)(startDate, "MMM"),
21451
21539
  year,
@@ -21453,6 +21541,7 @@ var TasksMonthSelector = ({ tasks, year, currentDate, onClick }) => {
21453
21541
  startDate,
21454
21542
  endDate
21455
21543
  }, DEFAULT_TASK_DATA);
21544
+ const disabled = taskData.total === 0 && (minDate && (0, import_date_fns43.isBefore)(startDate, minDate) || (0, import_date_fns43.isAfter)(startDate, (0, import_date_fns43.startOfMonth)(/* @__PURE__ */ new Date())));
21456
21545
  return __spreadValues({
21457
21546
  monthStr: (0, import_date_fns43.format)(startDate, "MMM"),
21458
21547
  startDate,
@@ -21476,7 +21565,7 @@ var TasksMonthSelector = ({ tasks, year, currentDate, onClick }) => {
21476
21565
  };
21477
21566
 
21478
21567
  // src/components/Tasks/Tasks.tsx
21479
- var import_classnames74 = __toESM(require("classnames"));
21568
+ var import_classnames75 = __toESM(require("classnames"));
21480
21569
  var import_date_fns44 = require("date-fns");
21481
21570
  var import_jsx_runtime227 = require("react/jsx-runtime");
21482
21571
  var UseTasksContext = (0, import_react134.createContext)({
@@ -21566,7 +21655,7 @@ var TasksComponent = ({
21566
21655
  return /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)(
21567
21656
  "div",
21568
21657
  {
21569
- className: (0, import_classnames74.default)(
21658
+ className: (0, import_classnames75.default)(
21570
21659
  "Layer__tasks-component",
21571
21660
  collapsable && "Layer__tasks-component--collapsable"
21572
21661
  ),
@@ -21577,13 +21666,14 @@ var TasksComponent = ({
21577
21666
  tasksHeader: (stringOverrides == null ? void 0 : stringOverrides.header) || tasksHeader,
21578
21667
  collapsable,
21579
21668
  open,
21580
- toggleContent: () => setOpen(!open)
21669
+ toggleContent: () => setOpen(!open),
21670
+ highlightYears: yearlyData == null ? void 0 : yearlyData.map((x) => x.year)
21581
21671
  }
21582
21672
  ),
21583
21673
  /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
21584
21674
  "div",
21585
21675
  {
21586
- className: (0, import_classnames74.default)(
21676
+ className: (0, import_classnames75.default)(
21587
21677
  "Layer__tasks__content",
21588
21678
  !open && "Layer__tasks__content--collapsed"
21589
21679
  ),
@@ -21738,7 +21828,7 @@ function LinkAccountsConfirmationStep() {
21738
21828
  ) }, index)
21739
21829
  }
21740
21830
  ) }),
21741
- /* @__PURE__ */ (0, import_jsx_runtime230.jsxs)(HStack, { pbs: "lg", justify: "end", gap: "sm", children: [
21831
+ /* @__PURE__ */ (0, import_jsx_runtime230.jsxs)(HStack, { pbs: "lg", gap: "sm", children: [
21742
21832
  /* @__PURE__ */ (0, import_jsx_runtime230.jsx)(Button, { variant: "secondary" /* secondary */, onClick: previous, children: "Back" }),
21743
21833
  /* @__PURE__ */ (0, import_jsx_runtime230.jsx)(
21744
21834
  Subscribe,
@@ -21770,7 +21860,16 @@ function LinkAccountsConfirmationStep() {
21770
21860
  // src/components/PlatformOnboarding/Steps/LinkAccountsLinkStep.tsx
21771
21861
  var import_react137 = require("react");
21772
21862
  var import_pluralize = __toESM(require("pluralize"));
21863
+
21864
+ // src/components/Separator/Separator.tsx
21773
21865
  var import_jsx_runtime231 = require("react/jsx-runtime");
21866
+ var Separator = ({ mbs, mbe }) => {
21867
+ const dataProperties = toDataProperties({ mbs, mbe });
21868
+ return /* @__PURE__ */ (0, import_jsx_runtime231.jsx)("div", __spreadValues({ className: "Layer__separator" }, dataProperties));
21869
+ };
21870
+
21871
+ // src/components/PlatformOnboarding/Steps/LinkAccountsLinkStep.tsx
21872
+ var import_jsx_runtime232 = require("react/jsx-runtime");
21774
21873
  function LinkAccountsLinkStep() {
21775
21874
  const {
21776
21875
  data,
@@ -21781,48 +21880,57 @@ function LinkAccountsLinkStep() {
21781
21880
  } = (0, import_react137.useContext)(LinkedAccountsContext);
21782
21881
  const { next } = useWizard();
21783
21882
  const effectiveAccounts = data != null ? data : [];
21784
- return /* @__PURE__ */ (0, import_jsx_runtime231.jsxs)(import_jsx_runtime231.Fragment, { children: [
21785
- /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(
21883
+ return /* @__PURE__ */ (0, import_jsx_runtime232.jsxs)(import_jsx_runtime232.Fragment, { children: [
21884
+ /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(
21786
21885
  ConditionalList,
21787
21886
  {
21788
21887
  list: effectiveAccounts,
21789
- Empty: /* @__PURE__ */ (0, import_jsx_runtime231.jsxs)(VStack, { gap: "2xs", pbe: "md", children: [
21790
- /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(P, { variant: "subtle", size: "lg", children: "Connect your business bank accounts and credit cards to automatically import your business transactions." }),
21791
- /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(HStack, { pbs: "lg", justify: "center", children: /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(
21792
- Button,
21888
+ Empty: /* @__PURE__ */ (0, import_jsx_runtime232.jsxs)(VStack, { gap: "xl", pbe: "md", children: [
21889
+ /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(Text, { status: "disabled", children: "Connect your bank accounts and credit cards to automatically import your business transactions." }),
21890
+ /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(
21891
+ ActionableRow,
21793
21892
  {
21794
- onClick: () => {
21795
- addConnection("PLAID");
21796
- },
21797
- rightIcon: /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(Link_default, { size: 12 }),
21798
- disabled: loadingStatus !== "complete",
21799
- children: "Connect my bank"
21893
+ iconBox: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(PlaidIcon_default, {}),
21894
+ title: "Connect my bank",
21895
+ description: "Import data with one simple integration.",
21896
+ button: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(
21897
+ Button,
21898
+ {
21899
+ onClick: () => addConnection("PLAID"),
21900
+ rightIcon: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(Link_default, { size: 12 }),
21901
+ disabled: loadingStatus !== "complete",
21902
+ children: "Connect"
21903
+ }
21904
+ )
21800
21905
  }
21801
- ) })
21906
+ )
21802
21907
  ] }),
21803
- Container: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime231.jsxs)(VStack, { children: [
21804
- /* @__PURE__ */ (0, import_jsx_runtime231.jsxs)(VStack, { gap: "2xs", pbe: "md", children: [
21805
- /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(Heading2, { level: 3, size: "sm", children: `We've found ${(0, import_pluralize.default)("account", effectiveAccounts.length, true)}` }),
21806
- /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(P, { variant: "subtle", children: "You'll have the chance to remove any accounts you don't use for your business in the next step." })
21908
+ Container: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime232.jsxs)(VStack, { children: [
21909
+ /* @__PURE__ */ (0, import_jsx_runtime232.jsxs)(VStack, { gap: "2xs", pbe: "md", children: [
21910
+ /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(Heading2, { level: 3, size: "sm", children: `We've found ${(0, import_pluralize.default)("account", effectiveAccounts.length, true)}` }),
21911
+ /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(Text, { status: "disabled", children: "You'll have the chance to remove any accounts you don't use for your business in the next step." })
21807
21912
  ] }),
21808
- /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(LinkAccountsListContainer, { children }),
21809
- /* @__PURE__ */ (0, import_jsx_runtime231.jsxs)(VStack, { pbs: "xl", gap: "sm", children: [
21810
- /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(Heading2, { level: 3, align: "center", children: "Do you use any other bank accounts or credit cards for your business?" }),
21811
- /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(HStack, { justify: "center", children: /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(
21812
- Button,
21813
- {
21814
- onClick: () => {
21815
- addConnection("PLAID");
21816
- },
21817
- rightIcon: /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(Link_default, { size: 12 }),
21818
- disabled: loadingStatus !== "complete",
21819
- children: "Link another bank"
21820
- }
21821
- ) })
21822
- ] })
21913
+ /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(LinkAccountsListContainer, { children }),
21914
+ /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(VStack, { pbs: "xl", children: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(
21915
+ ActionableRow,
21916
+ {
21917
+ iconBox: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(PlaidIcon_default, {}),
21918
+ title: "Connect my next bank account",
21919
+ description: "Import data with one simple integration.",
21920
+ button: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(
21921
+ Button,
21922
+ {
21923
+ onClick: () => addConnection("PLAID"),
21924
+ rightIcon: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(Link_default, { size: 12 }),
21925
+ disabled: loadingStatus !== "complete",
21926
+ children: "Connect next"
21927
+ }
21928
+ )
21929
+ }
21930
+ ) })
21823
21931
  ] }),
21824
21932
  isError: Boolean(error),
21825
- Error: /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(
21933
+ Error: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(
21826
21934
  DataState,
21827
21935
  {
21828
21936
  status: "failed" /* failed */,
@@ -21834,20 +21942,23 @@ function LinkAccountsLinkStep() {
21834
21942
  }
21835
21943
  ),
21836
21944
  isLoading: loadingStatus === "loading" || loadingStatus === "initial",
21837
- Loading: /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(Loader2, {}),
21838
- children: ({ item: account }) => /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(BasicLinkedAccountContainer, { isSelected: true, children: /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(BasicLinkedAccountContent, { account }) }, account.id)
21945
+ Loading: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(Loader2, {}),
21946
+ children: ({ item: account }) => /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(BasicLinkedAccountContainer, { isSelected: true, children: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(BasicLinkedAccountContent, { account }) }, account.id)
21839
21947
  }
21840
21948
  ),
21841
- effectiveAccounts.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(HStack, { pbs: "lg", justify: "end", gap: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(Button, { onClick: () => {
21842
- void next();
21843
- }, children: "I\u2019m done connecting my business accounts" }) }) : null
21949
+ effectiveAccounts.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime232.jsxs)(import_jsx_runtime232.Fragment, { children: [
21950
+ /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(Separator, { mbs: "lg", mbe: "lg" }),
21951
+ /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(HStack, { justify: "start", gap: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(Button, { onClick: () => {
21952
+ void next();
21953
+ }, rightIcon: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(ChevronRight_default, {}), children: "I\u2019m done linking my banks" }) })
21954
+ ] }) : null
21844
21955
  ] });
21845
21956
  }
21846
21957
 
21847
21958
  // src/components/PlatformOnboarding/LinkAccounts.tsx
21848
- var import_jsx_runtime232 = require("react/jsx-runtime");
21959
+ var import_jsx_runtime233 = require("react/jsx-runtime");
21849
21960
  function LinkAccounts(props) {
21850
- return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(LinkedAccountsProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(LinkAccountsContent, __spreadValues({}, props)) });
21961
+ return /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(LinkedAccountsProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(LinkAccountsContent, __spreadValues({}, props)) });
21851
21962
  }
21852
21963
  function LinkAccountsContent({
21853
21964
  onComplete
@@ -21855,45 +21966,1112 @@ function LinkAccountsContent({
21855
21966
  const { data: linkedAccounts, loadingStatus } = (0, import_react138.useContext)(LinkedAccountsContext);
21856
21967
  const linkedAccountsNeedingConfirmation = linkedAccounts ? getAccountsNeedingConfirmation(linkedAccounts) : [];
21857
21968
  const hideConfirmationStep = loadingStatus === "complete" && linkedAccountsNeedingConfirmation.length === 0;
21858
- return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)("section", { className: "Layer__link-accounts Layer__component", children: /* @__PURE__ */ (0, import_jsx_runtime232.jsxs)(
21969
+ return /* @__PURE__ */ (0, import_jsx_runtime233.jsx)("section", { className: "Layer__link-accounts Layer__component", children: /* @__PURE__ */ (0, import_jsx_runtime233.jsxs)(
21859
21970
  Wizard,
21860
21971
  {
21861
- Header: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(Heading2, { level: 2, pbe: "md", children: "Link your bank accounts and credit cards" }),
21972
+ Header: /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(Heading2, { children: "Link your bank accounts and credit cards" }),
21862
21973
  Footer: null,
21863
21974
  onComplete,
21864
21975
  children: [
21865
- /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(LinkAccountsLinkStep, {}),
21866
- hideConfirmationStep ? null : /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(LinkAccountsConfirmationStep, {})
21976
+ /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(LinkAccountsLinkStep, {}),
21977
+ hideConfirmationStep ? null : /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(LinkAccountsConfirmationStep, {})
21867
21978
  ]
21868
21979
  }
21869
21980
  ) });
21870
21981
  }
21871
21982
 
21872
- // src/icons/Coffee.tsx
21873
- var import_jsx_runtime233 = require("react/jsx-runtime");
21874
- var CoffeeIcon = (_a) => {
21875
- var _b = _a, { size = 11 } = _b, props = __objRest(_b, ["size"]);
21876
- return /* @__PURE__ */ (0, import_jsx_runtime233.jsxs)(
21983
+ // src/components/PlatformOnboarding/PlatformOnboarding.tsx
21984
+ var import_react140 = require("react");
21985
+
21986
+ // src/components/ProgressSteps/ProgressSteps.tsx
21987
+ var import_jsx_runtime234 = require("react/jsx-runtime");
21988
+ var ProgressSteps = ({ steps, currentStep }) => {
21989
+ return /* @__PURE__ */ (0, import_jsx_runtime234.jsx)("div", { className: "Layer__progress-steps", children: steps.map((step, index) => {
21990
+ const dataProperties = toDataProperties({ active: index <= currentStep, complete: currentStep > index });
21991
+ return /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(
21992
+ "div",
21993
+ {
21994
+ className: "Layer__progress-steps--step-wrapper",
21995
+ children: /* @__PURE__ */ (0, import_jsx_runtime234.jsxs)("div", __spreadProps(__spreadValues({ className: "Layer__progress-steps--step" }, dataProperties), { children: [
21996
+ index < steps.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime234.jsx)("div", { className: "Layer__progress-steps--step-line" }),
21997
+ /* @__PURE__ */ (0, import_jsx_runtime234.jsx)("div", { className: "Layer__progress-steps--circle", children: index < currentStep && /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(Check_default, { size: 10 }) }),
21998
+ /* @__PURE__ */ (0, import_jsx_runtime234.jsx)("div", { className: "Layer__progress-steps--label", children: /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(Text, { size: "sm" /* sm */, children: step }) })
21999
+ ] }))
22000
+ },
22001
+ index
22002
+ );
22003
+ }) });
22004
+ };
22005
+
22006
+ // src/icons/Document.tsx
22007
+ var import_jsx_runtime235 = require("react/jsx-runtime");
22008
+ var Document = (_a) => {
22009
+ var _b = _a, { size = 20 } = _b, props = __objRest(_b, ["size"]);
22010
+ return /* @__PURE__ */ (0, import_jsx_runtime235.jsxs)(
21877
22011
  "svg",
21878
22012
  __spreadProps(__spreadValues({
21879
22013
  xmlns: "http://www.w3.org/2000/svg",
21880
- viewBox: "0 0 12 12",
22014
+ viewBox: "0 0 20 20",
21881
22015
  fill: "none"
21882
22016
  }, props), {
21883
22017
  width: size,
21884
22018
  height: size,
21885
22019
  children: [
21886
- /* @__PURE__ */ (0, import_jsx_runtime233.jsxs)("g", { clipPath: "url(#clip0_5018_10141)", children: [
21887
- /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(
21888
- "path",
21889
- {
21890
- d: "M3.25 4.16666H2.79167C2.30544 4.16666 1.83912 4.35981 1.4953 4.70363C1.15149 5.04744 0.958333 5.51376 0.958333 5.99999C0.958333 6.48622 1.15149 6.95254 1.4953 7.29635C1.83912 7.64017 2.30544 7.83332 2.79167 7.83332H3.25",
22020
+ /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
22021
+ "path",
22022
+ {
22023
+ d: "M11.6667 1.66666H5.00004C4.55801 1.66666 4.13409 1.84226 3.82153 2.15482C3.50897 2.46738 3.33337 2.8913 3.33337 3.33333V16.6667C3.33337 17.1087 3.50897 17.5326 3.82153 17.8452C4.13409 18.1577 4.55801 18.3333 5.00004 18.3333H15C15.4421 18.3333 15.866 18.1577 16.1786 17.8452C16.4911 17.5326 16.6667 17.1087 16.6667 16.6667V6.66666L11.6667 1.66666Z",
22024
+ stroke: "white",
22025
+ strokeLinecap: "round",
22026
+ strokeLinejoin: "round"
22027
+ }
22028
+ ),
22029
+ /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
22030
+ "path",
22031
+ {
22032
+ d: "M11.6667 1.66666H5.00004C4.55801 1.66666 4.13409 1.84226 3.82153 2.15482C3.50897 2.46738 3.33337 2.8913 3.33337 3.33333V16.6667C3.33337 17.1087 3.50897 17.5326 3.82153 17.8452C4.13409 18.1577 4.55801 18.3333 5.00004 18.3333H15C15.4421 18.3333 15.866 18.1577 16.1786 17.8452C16.4911 17.5326 16.6667 17.1087 16.6667 16.6667V6.66666L11.6667 1.66666Z",
22033
+ stroke: "currentColor",
22034
+ strokeLinecap: "round",
22035
+ strokeLinejoin: "round"
22036
+ }
22037
+ ),
22038
+ /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
22039
+ "path",
22040
+ {
22041
+ d: "M11.6666 1.66666V6.66666H16.6666",
22042
+ stroke: "white",
22043
+ strokeLinecap: "round",
22044
+ strokeLinejoin: "round"
22045
+ }
22046
+ ),
22047
+ /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
22048
+ "path",
22049
+ {
22050
+ d: "M11.6666 1.66666V6.66666H16.6666",
22051
+ stroke: "currentColor",
22052
+ strokeLinecap: "round",
22053
+ strokeLinejoin: "round"
22054
+ }
22055
+ ),
22056
+ /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
22057
+ "path",
22058
+ {
22059
+ d: "M13.3333 10.8333H6.66663",
22060
+ stroke: "white",
22061
+ strokeLinecap: "round",
22062
+ strokeLinejoin: "round"
22063
+ }
22064
+ ),
22065
+ /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
22066
+ "path",
22067
+ {
22068
+ d: "M13.3333 10.8333H6.66663",
22069
+ stroke: "currentColor",
22070
+ strokeLinecap: "round",
22071
+ strokeLinejoin: "round"
22072
+ }
22073
+ ),
22074
+ /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
22075
+ "path",
22076
+ {
22077
+ d: "M13.3333 14.1667H6.66663",
22078
+ stroke: "white",
22079
+ strokeLinecap: "round",
22080
+ strokeLinejoin: "round"
22081
+ }
22082
+ ),
22083
+ /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
22084
+ "path",
22085
+ {
22086
+ d: "M13.3333 14.1667H6.66663",
22087
+ stroke: "currentColor",
22088
+ strokeLinecap: "round",
22089
+ strokeLinejoin: "round"
22090
+ }
22091
+ ),
22092
+ /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
22093
+ "path",
22094
+ {
22095
+ d: "M8.33329 7.5H7.49996H6.66663",
22096
+ stroke: "white",
22097
+ strokeLinecap: "round",
22098
+ strokeLinejoin: "round"
22099
+ }
22100
+ ),
22101
+ /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
22102
+ "path",
22103
+ {
22104
+ d: "M8.33329 7.5H7.49996H6.66663",
22105
+ stroke: "currentColor",
22106
+ strokeLinecap: "round",
22107
+ strokeLinejoin: "round"
22108
+ }
22109
+ )
22110
+ ]
22111
+ })
22112
+ );
22113
+ };
22114
+ var Document_default = Document;
22115
+
22116
+ // src/icons/TrendingUp.tsx
22117
+ var import_jsx_runtime236 = require("react/jsx-runtime");
22118
+ var TrendingUp = (_a) => {
22119
+ var _b = _a, { size = 20 } = _b, props = __objRest(_b, ["size"]);
22120
+ return /* @__PURE__ */ (0, import_jsx_runtime236.jsxs)(
22121
+ "svg",
22122
+ __spreadProps(__spreadValues({
22123
+ xmlns: "http://www.w3.org/2000/svg",
22124
+ viewBox: "0 0 20 20",
22125
+ fill: "none"
22126
+ }, props), {
22127
+ width: size,
22128
+ height: size,
22129
+ children: [
22130
+ /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
22131
+ "path",
22132
+ {
22133
+ d: "M19.1667 5L11.25 12.9167L7.08337 8.75L0.833374 15",
22134
+ stroke: "white",
22135
+ strokeLinecap: "round",
22136
+ strokeLinejoin: "round"
22137
+ }
22138
+ ),
22139
+ /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
22140
+ "path",
22141
+ {
22142
+ d: "M19.1667 5L11.25 12.9167L7.08337 8.75L0.833374 15",
22143
+ stroke: "currentColor",
22144
+ strokeLinecap: "round",
22145
+ strokeLinejoin: "round"
22146
+ }
22147
+ ),
22148
+ /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
22149
+ "path",
22150
+ {
22151
+ d: "M14.1666 5H19.1666V10",
22152
+ stroke: "white",
22153
+ strokeLinecap: "round",
22154
+ strokeLinejoin: "round"
22155
+ }
22156
+ ),
22157
+ /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
22158
+ "path",
22159
+ {
22160
+ d: "M14.1666 5H19.1666V10",
22161
+ stroke: "currentColor",
22162
+ strokeLinecap: "round",
22163
+ strokeLinejoin: "round"
22164
+ }
22165
+ )
22166
+ ]
22167
+ })
22168
+ );
22169
+ };
22170
+ var TrendingUp_default = TrendingUp;
22171
+
22172
+ // src/components/PlatformOnboarding/Steps/WelcomeStep.tsx
22173
+ var import_jsx_runtime237 = require("react/jsx-runtime");
22174
+ var defaultTitle = "Welcome";
22175
+ var defaultDescription = "Welcome to the platform onboarding process";
22176
+ var WelcomeStep = ({ onNext, title = defaultTitle, description, stepsEnabled }) => {
22177
+ const buildDescription = () => {
22178
+ if (description) {
22179
+ return description;
22180
+ }
22181
+ if (stepsEnabled) {
22182
+ let text = "In this flow we\u2019ll ";
22183
+ if (stepsEnabled.includes("business-info")) {
22184
+ text += "confirm your business information, ";
22185
+ }
22186
+ if (stepsEnabled.includes("link-accounts")) {
22187
+ text += "connect your financial accounts, ";
22188
+ }
22189
+ text += "and start managing your books like a pro.";
22190
+ return text;
22191
+ }
22192
+ return defaultDescription;
22193
+ };
22194
+ return /* @__PURE__ */ (0, import_jsx_runtime237.jsxs)(import_jsx_runtime237.Fragment, { children: [
22195
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsxs)("div", { className: "Layer__platform-onboarding__welcome", children: [
22196
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Heading, { className: "Layer__platform-onboarding__heading", align: "left", children: title }),
22197
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Text, { status: "disabled", children: buildDescription() })
22198
+ ] }),
22199
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Button, { onClick: onNext, children: "Get started" })
22200
+ ] });
22201
+ };
22202
+ var WelcomeStepFooter = () => {
22203
+ return /* @__PURE__ */ (0, import_jsx_runtime237.jsxs)("div", { className: "Layer__platform-onboarding__welcome-footer", children: [
22204
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsxs)("div", { className: "Layer__platform-onboarding__welcome-footer__content", children: [
22205
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsxs)("div", { className: "Layer__platform-onboarding__welcome-footer__header", children: [
22206
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Heading, { align: "left", children: "How it works" }),
22207
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Text, { status: "disabled", children: "Discover how seamless accounting can transform your business." })
22208
+ ] }),
22209
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsxs)(VStack, { gap: "lg", children: [
22210
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsxs)(VStack, { gap: "xs", children: [
22211
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsxs)(HStack, { gap: "xs", children: [
22212
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(TrendingUp_default, {}),
22213
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Heading, { size: "secondary" /* secondary */, children: "Understand your business health" })
22214
+ ] }),
22215
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Text, { status: "disabled", children: "Get an accurate picture of your financial performance and insight into how to grow your profit." })
22216
+ ] }),
22217
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsxs)(VStack, { gap: "xs", children: [
22218
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsxs)(HStack, { gap: "xs", children: [
22219
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Document_default, {}),
22220
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Heading, { size: "secondary" /* secondary */, children: "Be ready for tax time" })
22221
+ ] }),
22222
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Text, { status: "disabled", children: "Keep your business finances organized to avoid paying more taxes than needed or IRS fines at tax time." })
22223
+ ] })
22224
+ ] })
22225
+ ] }),
22226
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsxs)("div", { className: "Layer__platform-onboarding__welcome-footer__images", children: [
22227
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsxs)("div", { className: "Layer__platform-onboarding__welcome-footer__image", children: [
22228
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsx)("div", { className: "Layer__platform__onboarding__welcome-footer__image-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(
22229
+ "img",
22230
+ {
22231
+ src: "https://layer-public.s3.us-west-2.amazonaws.com/site-images/linked-accounts.png",
22232
+ alt: "Connect your accounts"
22233
+ }
22234
+ ) }),
22235
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsxs)("div", { className: "Layer__platform__onboarding__welcome-footer__image-text", children: [
22236
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Heading, { size: "secondary" /* secondary */, children: "Connect your accounts" }),
22237
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Text, { as: "p", children: "Connect your bank accounts and credit cards to see a complete picture of your business finances." })
22238
+ ] })
22239
+ ] }),
22240
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsxs)("div", { className: "Layer__platform-onboarding__welcome-footer__image", children: [
22241
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsx)("div", { className: "Layer__platform__onboarding__welcome-footer__image-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(
22242
+ "img",
22243
+ {
22244
+ src: "https://layer-public.s3.us-west-2.amazonaws.com/site-images/bookkeeping-tasks.png",
22245
+ alt: "Bookkeeping tasks"
22246
+ }
22247
+ ) }),
22248
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsxs)("div", { className: "Layer__platform__onboarding__welcome-footer__image-text", children: [
22249
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Heading, { size: "secondary" /* secondary */, children: "Ongoing monthly bookkeeping" }),
22250
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Text, { as: "p", children: "Receive a monthly report of your financial performance to review with your PSM." })
22251
+ ] })
22252
+ ] }),
22253
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsxs)("div", { className: "Layer__platform-onboarding__welcome-footer__image", children: [
22254
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsx)("div", { className: "Layer__platform__onboarding__welcome-footer__image-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(
22255
+ "img",
22256
+ {
22257
+ src: "https://layer-public.s3.us-west-2.amazonaws.com/site-images/revenue.png",
22258
+ alt: "Profitability"
22259
+ }
22260
+ ) }),
22261
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsxs)("div", { className: "Layer__platform__onboarding__welcome-footer__image-text", children: [
22262
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Heading, { size: "secondary" /* secondary */, children: "See your profitability" }),
22263
+ /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Text, { as: "p", children: "Our bookkeeping team organized and categorizes your business transactions." })
22264
+ ] })
22265
+ ] })
22266
+ ] })
22267
+ ] });
22268
+ };
22269
+
22270
+ // src/components/PlatformOnboarding/Steps/SummaryStep.tsx
22271
+ var import_jsx_runtime238 = require("react/jsx-runtime");
22272
+ var defaultTitle2 = "You\u2019re all set!";
22273
+ var defaultDescription2 = "We\u2019re syncing your accounts. This process may take a while to complete.";
22274
+ var defaultNextBtnText = "Go to dashboard";
22275
+ var SummaryStep = ({ onNext, title = defaultTitle2, description = defaultDescription2, nextBtnText = defaultNextBtnText }) => {
22276
+ return /* @__PURE__ */ (0, import_jsx_runtime238.jsxs)(import_jsx_runtime238.Fragment, { children: [
22277
+ /* @__PURE__ */ (0, import_jsx_runtime238.jsxs)("div", { className: "Layer__platform-onboarding__summary", children: [
22278
+ /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(Heading, { className: "Layer__platform-onboarding__heading", align: "left", children: title }),
22279
+ /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(Text, { status: "disabled", children: description })
22280
+ ] }),
22281
+ /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(Button, { onClick: onNext, children: nextBtnText })
22282
+ ] });
22283
+ };
22284
+
22285
+ // src/utils/form.ts
22286
+ var notEmpty = (value) => {
22287
+ if (!value) {
22288
+ return false;
22289
+ }
22290
+ return value.trim().length > 0;
22291
+ };
22292
+ var validateEmailFormat = (email, required = false) => {
22293
+ if (!email) {
22294
+ return !required;
22295
+ }
22296
+ return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
22297
+ };
22298
+
22299
+ // src/components/BusinessForm/useBusinessForm.ts
22300
+ var import_react_form2 = require("@tanstack/react-form");
22301
+
22302
+ // src/hooks/businessPersonnel/useBusinessPersonnel.ts
22303
+ var import_swr16 = __toESM(require("swr"));
22304
+
22305
+ // src/utils/array/readonlyTransformations.ts
22306
+ function mapReadonly(array, callbackFn) {
22307
+ return array.map(callbackFn);
22308
+ }
22309
+ function filterReadonly(array, predicate) {
22310
+ return array.filter(predicate);
22311
+ }
22312
+
22313
+ // src/hooks/businessPersonnel/types.ts
22314
+ var PERSONNEL_ROLES = ["ACCOUNTANT", "ADMINISTRATOR", "OWNER"];
22315
+ function isPersonnelRole(role) {
22316
+ return PERSONNEL_ROLES.includes(role);
22317
+ }
22318
+
22319
+ // src/hooks/businessPersonnel/useBusinessPersonnel.ts
22320
+ var BUSINESS_PERSONNEL_TAG_KEY = "#business-personnel";
22321
+ function buildKey13({
22322
+ access_token: accessToken,
22323
+ apiUrl,
22324
+ businessId
22325
+ }) {
22326
+ if (accessToken && apiUrl) {
22327
+ return {
22328
+ accessToken,
22329
+ apiUrl,
22330
+ businessId,
22331
+ tags: [BUSINESS_PERSONNEL_TAG_KEY]
22332
+ };
22333
+ }
22334
+ }
22335
+ var getBusinessPersonnel = get(({ businessId }) => `/v1/businesses/${businessId}/personnel`);
22336
+ function useBusinessPersonnel() {
22337
+ const { data } = useAuth();
22338
+ const { businessId } = useLayerContext();
22339
+ return (0, import_swr16.default)(
22340
+ () => buildKey13(__spreadProps(__spreadValues({}, data), {
22341
+ businessId
22342
+ })),
22343
+ ({ accessToken, apiUrl, businessId: businessId2 }) => getBusinessPersonnel(
22344
+ apiUrl,
22345
+ accessToken,
22346
+ {
22347
+ params: { businessId: businessId2 }
22348
+ }
22349
+ )().then(({ data: data2 }) => data2.map(({
22350
+ id,
22351
+ full_name: fullName,
22352
+ preferred_name: preferredName,
22353
+ external_id: externalId,
22354
+ email_addresses,
22355
+ phone_numbers,
22356
+ roles
22357
+ }) => ({
22358
+ id,
22359
+ fullName,
22360
+ preferredName,
22361
+ externalId,
22362
+ emailAddresses: mapReadonly(
22363
+ email_addresses,
22364
+ ({ id: id2, email_address: emailAddress }) => ({ id: id2, emailAddress })
22365
+ ),
22366
+ phoneNumbers: mapReadonly(
22367
+ phone_numbers,
22368
+ ({ id: id2, phone_number: phoneNumber }) => ({ id: id2, phoneNumber })
22369
+ ),
22370
+ roles: filterReadonly(
22371
+ roles,
22372
+ (roleEntity) => isPersonnelRole(roleEntity.role)
22373
+ )
22374
+ })))
22375
+ );
22376
+ }
22377
+
22378
+ // src/hooks/businessPersonnel/useCreateBusinessPersonnel.ts
22379
+ var import_mutation7 = __toESM(require("swr/mutation"));
22380
+ var import_swr17 = require("swr");
22381
+
22382
+ // src/utils/swr/withSWRKeyTags.ts
22383
+ function withSWRKeyTags(key, predicate) {
22384
+ if (typeof key !== "object" || key === null || !("tags" in key)) {
22385
+ return false;
22386
+ }
22387
+ return isStringArray(key.tags) ? predicate(key.tags) : false;
22388
+ }
22389
+
22390
+ // src/hooks/businessPersonnel/useCreateBusinessPersonnel.ts
22391
+ var createBusinessPersonnel = post(({ businessId }) => `/v1/businesses/${businessId}/personnel`);
22392
+ function buildKey14({
22393
+ access_token: accessToken,
22394
+ apiUrl,
22395
+ businessId
22396
+ }) {
22397
+ if (accessToken && apiUrl) {
22398
+ return {
22399
+ accessToken,
22400
+ apiUrl,
22401
+ businessId,
22402
+ tags: [`${BUSINESS_PERSONNEL_TAG_KEY}:create`]
22403
+ };
22404
+ }
22405
+ }
22406
+ function useCreateBusinessPersonnel() {
22407
+ const { data } = useAuth();
22408
+ const { businessId } = useLayerContext();
22409
+ const { mutate } = (0, import_swr17.useSWRConfig)();
22410
+ const mutationResponse = (0, import_mutation7.default)(
22411
+ () => buildKey14(__spreadProps(__spreadValues({}, data), {
22412
+ businessId
22413
+ })),
22414
+ ({ accessToken, apiUrl, businessId: businessId2 }, { arg: body }) => createBusinessPersonnel(
22415
+ apiUrl,
22416
+ accessToken,
22417
+ {
22418
+ params: { businessId: businessId2 },
22419
+ body
22420
+ }
22421
+ ).then(({ data: data2 }) => data2),
22422
+ {
22423
+ revalidate: false,
22424
+ throwOnError: false
22425
+ }
22426
+ );
22427
+ const { trigger: originalTrigger } = mutationResponse;
22428
+ return Object.assign(
22429
+ mutationResponse,
22430
+ {
22431
+ trigger: (...triggerParameters) => __async(this, null, function* () {
22432
+ const data2 = yield originalTrigger(...triggerParameters);
22433
+ if (data2) {
22434
+ yield mutate((key) => withSWRKeyTags(key, (tags) => tags.includes(BUSINESS_PERSONNEL_TAG_KEY)));
22435
+ }
22436
+ return data2;
22437
+ })
22438
+ }
22439
+ );
22440
+ }
22441
+
22442
+ // src/hooks/businessPersonnel/useUpdateBusinessPersonnel.ts
22443
+ var import_mutation8 = __toESM(require("swr/mutation"));
22444
+ var import_swr18 = require("swr");
22445
+
22446
+ // src/api/layer/businessPersonnel/updateBusinessPersonnel.ts
22447
+ var updateBusinessPersonnel = post(({ businessId, businessPersonnelId }) => {
22448
+ return `/v1/businesses/${businessId}/personnel/${businessPersonnelId}/update`;
22449
+ });
22450
+
22451
+ // src/hooks/businessPersonnel/useUpdateBusinessPersonnel.ts
22452
+ function buildKey15({
22453
+ access_token: accessToken,
22454
+ apiUrl,
22455
+ businessId,
22456
+ businessPersonnelId
22457
+ }) {
22458
+ if (accessToken && apiUrl && businessPersonnelId) {
22459
+ return {
22460
+ accessToken,
22461
+ apiUrl,
22462
+ businessId,
22463
+ businessPersonnelId,
22464
+ tags: [`${BUSINESS_PERSONNEL_TAG_KEY}:${businessPersonnelId}`]
22465
+ };
22466
+ }
22467
+ }
22468
+ function useUpdateBusinessPersonnel({ businessPersonnelId }) {
22469
+ const { data } = useAuth();
22470
+ const { businessId } = useLayerContext();
22471
+ const { mutate } = (0, import_swr18.useSWRConfig)();
22472
+ const mutationResponse = (0, import_mutation8.default)(
22473
+ () => buildKey15(__spreadProps(__spreadValues({}, data), {
22474
+ businessId,
22475
+ businessPersonnelId
22476
+ })),
22477
+ ({ accessToken, apiUrl, businessId: businessId2, businessPersonnelId: businessPersonnelId2 }, { arg: body }) => updateBusinessPersonnel(
22478
+ apiUrl,
22479
+ accessToken,
22480
+ {
22481
+ params: {
22482
+ businessId: businessId2,
22483
+ businessPersonnelId: businessPersonnelId2
22484
+ },
22485
+ body
22486
+ }
22487
+ ).then(({ data: data2 }) => data2),
22488
+ {
22489
+ revalidate: false,
22490
+ throwOnError: false
22491
+ }
22492
+ );
22493
+ const { trigger: originalTrigger } = mutationResponse;
22494
+ return Object.assign(
22495
+ mutationResponse,
22496
+ {
22497
+ trigger: (...triggerParameters) => __async(this, null, function* () {
22498
+ const data2 = yield originalTrigger(...triggerParameters);
22499
+ if (data2) {
22500
+ yield mutate((key) => withSWRKeyTags(key, (tags) => tags.includes(BUSINESS_PERSONNEL_TAG_KEY)));
22501
+ }
22502
+ return data2;
22503
+ })
22504
+ }
22505
+ );
22506
+ }
22507
+
22508
+ // src/hooks/business/useUpdateBusiness.ts
22509
+ var import_mutation9 = __toESM(require("swr/mutation"));
22510
+ var import_swr19 = require("swr");
22511
+ var BUSINESS_TAG_KEY = "business";
22512
+ function buildKey16({
22513
+ access_token: accessToken,
22514
+ apiUrl,
22515
+ businessId
22516
+ }) {
22517
+ if (accessToken && apiUrl && businessId) {
22518
+ return {
22519
+ accessToken,
22520
+ apiUrl,
22521
+ businessId,
22522
+ tags: [`${BUSINESS_TAG_KEY}:${businessId}`]
22523
+ };
22524
+ }
22525
+ }
22526
+ function useUpdateBusiness() {
22527
+ const { data } = useAuth();
22528
+ const { businessId } = useLayerContext();
22529
+ const { mutate } = (0, import_swr19.useSWRConfig)();
22530
+ const mutationResponse = (0, import_mutation9.default)(
22531
+ () => buildKey16(__spreadProps(__spreadValues({}, data), {
22532
+ businessId
22533
+ })),
22534
+ ({ accessToken, apiUrl, businessId: businessId2 }, { arg: body }) => updateBusiness(
22535
+ apiUrl,
22536
+ accessToken,
22537
+ {
22538
+ params: { businessId: businessId2 },
22539
+ body
22540
+ }
22541
+ ).then(({ data: data2 }) => data2),
22542
+ {
22543
+ revalidate: false,
22544
+ throwOnError: false
22545
+ }
22546
+ );
22547
+ const { trigger: originalTrigger } = mutationResponse;
22548
+ return Object.assign(
22549
+ mutationResponse,
22550
+ {
22551
+ trigger: (...triggerParameters) => __async(this, null, function* () {
22552
+ const data2 = yield originalTrigger(...triggerParameters);
22553
+ if (data2) {
22554
+ yield mutate((key) => withSWRKeyTags(key, (tags) => tags.includes(BUSINESS_TAG_KEY)));
22555
+ }
22556
+ return data2;
22557
+ })
22558
+ }
22559
+ );
22560
+ }
22561
+
22562
+ // src/components/BusinessForm/useBusinessForm.ts
22563
+ var import_react139 = require("react");
22564
+ var getPerson = (personnel) => {
22565
+ const owners = personnel == null ? void 0 : personnel.filter((p) => p.roles.find((x) => x.role === "OWNER"));
22566
+ if (owners && owners.length > 0) {
22567
+ return owners[0];
22568
+ }
22569
+ return personnel == null ? void 0 : personnel[0];
22570
+ };
22571
+ var useBusinessForm = ({ onSuccess }) => {
22572
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
22573
+ const { business } = useLayerContext();
22574
+ const [submitError, setSubmitError] = (0, import_react139.useState)(void 0);
22575
+ const { data: personnel } = useBusinessPersonnel();
22576
+ const person = getPerson(personnel);
22577
+ const { trigger: createBusinessPersonnel2 } = useCreateBusinessPersonnel();
22578
+ const { trigger: updateBusinessPersonnel2 } = useUpdateBusinessPersonnel({ businessPersonnelId: person == null ? void 0 : person.id });
22579
+ const { trigger: updateBusiness2 } = useUpdateBusiness();
22580
+ const form = (0, import_react_form2.useForm)({
22581
+ defaultValues: {
22582
+ full_name: (_a = person == null ? void 0 : person.fullName) != null ? _a : void 0,
22583
+ preferred_name: (_b = person == null ? void 0 : person.preferredName) != null ? _b : void 0,
22584
+ phone_number: (_d = (_c = person == null ? void 0 : person.phoneNumbers) == null ? void 0 : _c[0]) == null ? void 0 : _d.phoneNumber,
22585
+ email: (_f = (_e = person == null ? void 0 : person.emailAddresses) == null ? void 0 : _e[0]) == null ? void 0 : _f.emailAddress,
22586
+ legal_name: (_g = business == null ? void 0 : business.legal_name) != null ? _g : void 0,
22587
+ entity_type: (_h = business == null ? void 0 : business.entity_type) != null ? _h : void 0,
22588
+ us_state: (_i = business == null ? void 0 : business.us_state) != null ? _i : void 0,
22589
+ tin: business == null ? void 0 : business.tin
22590
+ },
22591
+ onSubmit: (_0) => __async(void 0, [_0], function* ({ value }) {
22592
+ var _a2;
22593
+ try {
22594
+ setSubmitError(void 0);
22595
+ if (person) {
22596
+ yield updateBusinessPersonnel2({
22597
+ id: person.id,
22598
+ full_name: value.full_name,
22599
+ preferred_name: value.preferred_name,
22600
+ email_addresses: value.email ? [{ email_address: value.email }] : [],
22601
+ phone_numbers: value.phone_number ? [{ phone_number: value.phone_number }] : []
22602
+ });
22603
+ } else {
22604
+ if (value.full_name) {
22605
+ yield createBusinessPersonnel2({
22606
+ full_name: value.full_name,
22607
+ preferred_name: (_a2 = value.preferred_name) != null ? _a2 : null,
22608
+ email_addresses: value.email ? [{ email_address: value.email }] : [],
22609
+ phone_numbers: value.phone_number ? [{ phone_number: value.phone_number }] : [],
22610
+ external_id: null,
22611
+ roles: [{ role: "OWNER" }]
22612
+ });
22613
+ }
22614
+ }
22615
+ yield updateBusiness2({
22616
+ legal_name: value.legal_name,
22617
+ entity_type: value.entity_type,
22618
+ us_state: value.us_state,
22619
+ tin: value.tin
22620
+ });
22621
+ onSuccess == null ? void 0 : onSuccess();
22622
+ } catch (e) {
22623
+ setSubmitError("Something went wrong. Please try again.");
22624
+ }
22625
+ })
22626
+ });
22627
+ const isFormValid = (0, import_react_form2.useStore)(form.store, (state) => state.isValid);
22628
+ return { form, submitError, isFormValid };
22629
+ };
22630
+
22631
+ // src/components/Input/FormSection.tsx
22632
+ var import_jsx_runtime239 = require("react/jsx-runtime");
22633
+ var FormSection = ({ children, title }) => {
22634
+ return /* @__PURE__ */ (0, import_jsx_runtime239.jsxs)(VStack, { className: "Layer__form-section", gap: "sm", children: [
22635
+ title && /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(
22636
+ Text,
22637
+ {
22638
+ className: "Layer__form-section__title",
22639
+ size: "sm" /* sm */,
22640
+ weight: "bold" /* bold */,
22641
+ children: title
22642
+ }
22643
+ ),
22644
+ children
22645
+ ] });
22646
+ };
22647
+
22648
+ // src/components/Input/BusinessTypeSelect.tsx
22649
+ var import_jsx_runtime240 = require("react/jsx-runtime");
22650
+ var findSelectOption = (options, value) => {
22651
+ if (!value) {
22652
+ return void 0;
22653
+ }
22654
+ return options.find((o) => o.value === value);
22655
+ };
22656
+ var BusinessTypeSelect = ({ value, onChange }) => {
22657
+ const entityTypeOptions = ENTITY_TYPES;
22658
+ return /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(
22659
+ Select,
22660
+ {
22661
+ options: entityTypeOptions,
22662
+ value: findSelectOption(entityTypeOptions, value),
22663
+ onChange: (option) => onChange(option == null ? void 0 : option.value)
22664
+ }
22665
+ );
22666
+ };
22667
+
22668
+ // src/types/location.ts
22669
+ var US_STATES = [
22670
+ { value: "AL", label: "Alabama" },
22671
+ { value: "AK", label: "Alaska" },
22672
+ { value: "AZ", label: "Arizona" },
22673
+ { value: "AR", label: "Arkansas" },
22674
+ { value: "CA", label: "California" },
22675
+ { value: "CO", label: "Colorado" },
22676
+ { value: "CT", label: "Connecticut" },
22677
+ { value: "DE", label: "Delaware" },
22678
+ { value: "DC", label: "District of Columbia" },
22679
+ { value: "FL", label: "Florida" },
22680
+ { value: "GA", label: "Georgia" },
22681
+ { value: "HI", label: "Hawaii" },
22682
+ { value: "ID", label: "Idaho" },
22683
+ { value: "IL", label: "Illinois" },
22684
+ { value: "IN", label: "Indiana" },
22685
+ { value: "IA", label: "Iowa" },
22686
+ { value: "KS", label: "Kansas" },
22687
+ { value: "KY", label: "Kentucky" },
22688
+ { value: "LA", label: "Louisiana" },
22689
+ { value: "ME", label: "Maine" },
22690
+ { value: "MD", label: "Maryland" },
22691
+ { value: "MA", label: "Massachusetts" },
22692
+ { value: "MI", label: "Michigan" },
22693
+ { value: "MN", label: "Minnesota" },
22694
+ { value: "MS", label: "Mississippi" },
22695
+ { value: "MO", label: "Missouri" },
22696
+ { value: "MT", label: "Montana" },
22697
+ { value: "NE", label: "Nebraska" },
22698
+ { value: "NV", label: "Nevada" },
22699
+ { value: "NH", label: "New Hampshire" },
22700
+ { value: "NJ", label: "New Jersey" },
22701
+ { value: "NM", label: "New Mexico" },
22702
+ { value: "NY", label: "New York" },
22703
+ { value: "NC", label: "North Carolina" },
22704
+ { value: "ND", label: "North Dakota" },
22705
+ { value: "OH", label: "Ohio" },
22706
+ { value: "OK", label: "Oklahoma" },
22707
+ { value: "OR", label: "Oregon" },
22708
+ { value: "PA", label: "Pennsylvania" },
22709
+ { value: "RI", label: "Rhode Island" },
22710
+ { value: "SC", label: "South Carolina" },
22711
+ { value: "SD", label: "South Dakota" },
22712
+ { value: "TN", label: "Tennessee" },
22713
+ { value: "TX", label: "Texas" },
22714
+ { value: "UT", label: "Utah" },
22715
+ { value: "VT", label: "Vermont" },
22716
+ { value: "VA", label: "Virginia" },
22717
+ { value: "WA", label: "Washington" },
22718
+ { value: "WV", label: "West Virginia" },
22719
+ { value: "WI", label: "Wisconsin" },
22720
+ { value: "WY", label: "Wyoming" },
22721
+ { value: "PR", label: "Puerto Rico" }
22722
+ ];
22723
+
22724
+ // src/components/Input/USStateSelect.tsx
22725
+ var import_jsx_runtime241 = require("react/jsx-runtime");
22726
+ var findSelectOption2 = (options, selected) => {
22727
+ if (!selected) {
22728
+ return void 0;
22729
+ }
22730
+ return options.find(
22731
+ (o) => String(o.value).toLowerCase() === String(selected).toLowerCase() || String(o.label).toLowerCase() === String(selected).toLowerCase()
22732
+ );
22733
+ };
22734
+ var USStateSelect = ({ value, onChange }) => {
22735
+ const usStateOptions = US_STATES.map((state) => ({
22736
+ label: state.label,
22737
+ value: state.value
22738
+ }));
22739
+ return /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(
22740
+ Select,
22741
+ {
22742
+ options: usStateOptions,
22743
+ value: findSelectOption2(usStateOptions, value),
22744
+ onChange: (option) => onChange(option),
22745
+ placeholder: "US state"
22746
+ }
22747
+ );
22748
+ };
22749
+
22750
+ // src/components/Input/PhoneInput.tsx
22751
+ var import_libphonenumber_js = require("libphonenumber-js");
22752
+ var import_jsx_runtime242 = require("react/jsx-runtime");
22753
+ var PhoneInput = (_a) => {
22754
+ var _b = _a, {
22755
+ value,
22756
+ onChange,
22757
+ placeholder = "Phone number"
22758
+ } = _b, props = __objRest(_b, [
22759
+ "value",
22760
+ "onChange",
22761
+ "placeholder"
22762
+ ]);
22763
+ const handleChange = (e) => {
22764
+ const input = e.target.value;
22765
+ const formattedNumber = (0, import_libphonenumber_js.formatIncompletePhoneNumber)(input, "US");
22766
+ onChange(formattedNumber != null ? formattedNumber : input);
22767
+ };
22768
+ return /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(
22769
+ Input,
22770
+ __spreadValues({
22771
+ type: "tel",
22772
+ value: value ? (0, import_libphonenumber_js.formatIncompletePhoneNumber)(value, "US") : void 0,
22773
+ onChange: handleChange,
22774
+ placeholder,
22775
+ "aria-label": "Phone number input"
22776
+ }, props)
22777
+ );
22778
+ };
22779
+
22780
+ // src/components/BusinessForm/BusinessForm.tsx
22781
+ var import_libphonenumber_js2 = require("libphonenumber-js");
22782
+ var import_jsx_runtime243 = require("react/jsx-runtime");
22783
+ var BusinessForm2 = ({ stringOverrides, onSuccess }) => {
22784
+ var _a;
22785
+ const { form, submitError, isFormValid } = useBusinessForm({ onSuccess });
22786
+ const { isSubmitting } = form.state;
22787
+ return /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)(
22788
+ "form",
22789
+ {
22790
+ className: "Layer__form Layer__business-form",
22791
+ onSubmit: (e) => {
22792
+ e.preventDefault();
22793
+ e.stopPropagation();
22794
+ void form.handleSubmit();
22795
+ },
22796
+ children: [
22797
+ /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)(FormSection, { title: "Contact information", children: [
22798
+ /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)("div", { className: "Layer__business-form__name-fields", children: [
22799
+ /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
22800
+ form.Field,
22801
+ {
22802
+ name: "full_name",
22803
+ validators: {
22804
+ onSubmit: ({ value }) => notEmpty(value) ? void 0 : "Full name is required"
22805
+ },
22806
+ children: (field) => /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(import_jsx_runtime243.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(InputGroup, { name: "full_name", label: "Full name", children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
22807
+ Input,
22808
+ {
22809
+ name: "full_name",
22810
+ placeholder: "John Doe",
22811
+ value: field.state.value,
22812
+ onChange: (e) => field.handleChange(e.target.value),
22813
+ isInvalid: field.state.meta.errors.length > 0,
22814
+ errorMessage: field.state.meta.errors.join(", ")
22815
+ }
22816
+ ) }) })
22817
+ }
22818
+ ),
22819
+ /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(form.Field, { name: "preferred_name", children: (field) => /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(import_jsx_runtime243.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(InputGroup, { name: "preferred_name", label: "Preferred name", children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
22820
+ Input,
22821
+ {
22822
+ name: "preferred_name",
22823
+ placeholder: "John",
22824
+ value: field.state.value,
22825
+ onChange: (e) => field.handleChange(e.target.value)
22826
+ }
22827
+ ) }) }) })
22828
+ ] }),
22829
+ /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
22830
+ form.Field,
22831
+ {
22832
+ name: "email",
22833
+ validators: {
22834
+ onSubmit: ({ value }) => validateEmailFormat(value, true) ? void 0 : "Email is invalid"
22835
+ },
22836
+ children: (field) => /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(import_jsx_runtime243.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
22837
+ InputGroup,
22838
+ {
22839
+ name: "email",
22840
+ label: "What\u2019s the email you want to use for bookkeeping communication?",
22841
+ children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
22842
+ Input,
22843
+ {
22844
+ name: "email",
22845
+ placeholder: "john@company.com",
22846
+ value: field.state.value,
22847
+ onChange: (e) => field.handleChange(e.target.value),
22848
+ isInvalid: field.state.meta.errors.length > 0,
22849
+ errorMessage: field.state.meta.errors.join(", ")
22850
+ }
22851
+ )
22852
+ }
22853
+ ) })
22854
+ }
22855
+ ),
22856
+ /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
22857
+ form.Field,
22858
+ {
22859
+ name: "phone_number",
22860
+ validators: {
22861
+ onSubmit: ({ value }) => (0, import_libphonenumber_js2.isPossiblePhoneNumber)(value != null ? value : "", "US") ? void 0 : "Phone number is invalid"
22862
+ },
22863
+ children: (field) => /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(import_jsx_runtime243.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
22864
+ InputGroup,
22865
+ {
22866
+ name: "phone_number",
22867
+ label: "What\u2019s the phone number you want to use for bookkeeping communication?",
22868
+ children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
22869
+ PhoneInput,
22870
+ {
22871
+ value: field.state.value,
22872
+ onChange: (value) => field.handleChange(value),
22873
+ isInvalid: field.state.meta.errors.length > 0,
22874
+ errorMessage: field.state.meta.errors.join(", ")
22875
+ }
22876
+ )
22877
+ }
22878
+ ) })
22879
+ }
22880
+ )
22881
+ ] }),
22882
+ /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)(FormSection, { title: "Business information", children: [
22883
+ /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
22884
+ form.Field,
22885
+ {
22886
+ name: "legal_name",
22887
+ validators: {
22888
+ onBlur: ({ value }) => notEmpty(value) ? void 0 : "Company name is required"
22889
+ },
22890
+ children: (field) => /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(import_jsx_runtime243.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(InputGroup, { name: "legal_name", label: "Company", children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
22891
+ Input,
22892
+ {
22893
+ name: "legal_name",
22894
+ placeholder: "Company",
22895
+ value: field.state.value,
22896
+ onChange: (e) => field.handleChange(e.target.value),
22897
+ isInvalid: field.state.meta.errors.length > 0,
22898
+ errorMessage: field.state.meta.errors.join(", ")
22899
+ }
22900
+ ) }) })
22901
+ }
22902
+ ),
22903
+ /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(form.Field, { name: "dba", children: (field) => /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(import_jsx_runtime243.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(InputGroup, { name: "dba", label: "DBA (optional)", children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
22904
+ Input,
22905
+ {
22906
+ name: "dba",
22907
+ placeholder: "Alternative name",
22908
+ value: field.state.value,
22909
+ onChange: (e) => field.handleChange(e.target.value),
22910
+ isInvalid: field.state.meta.errors.length > 0,
22911
+ errorMessage: field.state.meta.errors.join(", ")
22912
+ }
22913
+ ) }) }) }),
22914
+ /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(form.Field, { name: "entity_type", children: (field) => /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(import_jsx_runtime243.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(InputGroup, { name: "entity_type", label: "Entity type", children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
22915
+ BusinessTypeSelect,
22916
+ {
22917
+ value: field.state.value,
22918
+ onChange: (value) => field.handleChange(value)
22919
+ }
22920
+ ) }) }) }),
22921
+ /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)("div", { className: "Layer__business-form__state-tin-fields", children: [
22922
+ /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(form.Field, { name: "us_state", children: (field) => /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(import_jsx_runtime243.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(InputGroup, { name: "us_state", label: "State", className: "Layer__business-form__state", children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
22923
+ USStateSelect,
22924
+ {
22925
+ value: field.state.value,
22926
+ onChange: (option) => field.handleChange(option.value)
22927
+ }
22928
+ ) }) }) }),
22929
+ /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(form.Field, { name: "tin", children: (field) => /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(import_jsx_runtime243.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(InputGroup, { name: "tin", label: "Tax ID number (optional)", children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
22930
+ Input,
22931
+ {
22932
+ name: "tin",
22933
+ placeholder: "Tax ID number",
22934
+ value: field.state.value,
22935
+ onChange: (e) => field.handleChange(e.target.value),
22936
+ isInvalid: field.state.meta.errors.length > 0,
22937
+ errorMessage: field.state.meta.errors.join(", ")
22938
+ }
22939
+ ) }) }) })
22940
+ ] })
22941
+ ] }),
22942
+ /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
22943
+ SubmitButton,
22944
+ {
22945
+ type: "submit",
22946
+ processing: isSubmitting,
22947
+ noIcon: true,
22948
+ withRetry: true,
22949
+ error: submitError,
22950
+ children: (_a = stringOverrides == null ? void 0 : stringOverrides.saveButton) != null ? _a : "Save"
22951
+ }
22952
+ ),
22953
+ !isFormValid && /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(ErrorText, { pb: "xs", children: "Please check all fields." })
22954
+ ]
22955
+ }
22956
+ );
22957
+ };
22958
+
22959
+ // src/components/PlatformOnboarding/Steps/BusinessInfoStep.tsx
22960
+ var import_jsx_runtime244 = require("react/jsx-runtime");
22961
+ var defaultTitle3 = "We\u2019ll use this information to contact you whenever we have questions on your books.";
22962
+ var BusinessInfoStep = ({ title = defaultTitle3, onNext }) => {
22963
+ return /* @__PURE__ */ (0, import_jsx_runtime244.jsxs)(import_jsx_runtime244.Fragment, { children: [
22964
+ /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(Heading2, { children: title }),
22965
+ /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(BusinessForm2, { onSuccess: onNext })
22966
+ ] });
22967
+ };
22968
+
22969
+ // src/components/PlatformOnboarding/PlatformOnboarding.tsx
22970
+ var import_jsx_runtime245 = require("react/jsx-runtime");
22971
+ var PLATFORM_ONBOARDING_STEPS = [
22972
+ {
22973
+ id: "welcome",
22974
+ label: "Get started"
22975
+ },
22976
+ {
22977
+ id: "business-info",
22978
+ label: "Confirm your informations"
22979
+ },
22980
+ {
22981
+ id: "link-accounts",
22982
+ label: "Connect accounts"
22983
+ },
22984
+ {
22985
+ id: "summary",
22986
+ label: "Summary"
22987
+ }
22988
+ ];
22989
+ var PlatformOnboarding = ({ onComplete }) => {
22990
+ const [step, setStep] = (0, import_react140.useState)(PLATFORM_ONBOARDING_STEPS[0].id);
22991
+ const isFirstStep = PLATFORM_ONBOARDING_STEPS[0].id === step;
22992
+ const nextStep = () => {
22993
+ const currentStepIndex = PLATFORM_ONBOARDING_STEPS.findIndex((s) => s.id === step);
22994
+ if (currentStepIndex === PLATFORM_ONBOARDING_STEPS.length - 1) {
22995
+ onComplete == null ? void 0 : onComplete();
22996
+ return;
22997
+ }
22998
+ const nextStep2 = PLATFORM_ONBOARDING_STEPS[currentStepIndex + 1];
22999
+ if (nextStep2) {
23000
+ setStep(nextStep2.id);
23001
+ }
23002
+ };
23003
+ const previousStep = () => {
23004
+ const currentStepIndex = PLATFORM_ONBOARDING_STEPS.findIndex((s) => s.id === step);
23005
+ const previousStep2 = PLATFORM_ONBOARDING_STEPS[currentStepIndex - 1];
23006
+ if (previousStep2) {
23007
+ setStep(previousStep2.id);
23008
+ }
23009
+ };
23010
+ const renderStepContent = () => {
23011
+ switch (step) {
23012
+ case "welcome":
23013
+ return /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(WelcomeStep, { onNext: nextStep, stepsEnabled: PLATFORM_ONBOARDING_STEPS.map((s) => s.id) });
23014
+ case "business-info":
23015
+ return /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(BusinessInfoStep, { onNext: nextStep });
23016
+ case "link-accounts":
23017
+ return /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(LinkAccounts, { onComplete: nextStep });
23018
+ case "summary":
23019
+ return /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(SummaryStep, { onNext: nextStep });
23020
+ }
23021
+ };
23022
+ const renderStepFooter = () => {
23023
+ if (step === "welcome") {
23024
+ return /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(WelcomeStepFooter, {});
23025
+ }
23026
+ };
23027
+ return /* @__PURE__ */ (0, import_jsx_runtime245.jsx)("div", { className: "Layer__component Layer__platform-onboarding", children: /* @__PURE__ */ (0, import_jsx_runtime245.jsxs)("div", { className: "Layer__platform-onboarding-layout", children: [
23028
+ !isFirstStep && /* @__PURE__ */ (0, import_jsx_runtime245.jsx)("div", { className: "Layer__platform-onboarding__back-button-container", children: /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(
23029
+ Button,
23030
+ {
23031
+ onClick: previousStep,
23032
+ variant: "secondary" /* secondary */,
23033
+ children: "Back"
23034
+ }
23035
+ ) }),
23036
+ /* @__PURE__ */ (0, import_jsx_runtime245.jsxs)("div", { className: "Layer__platfom-onboarding-layout__box", children: [
23037
+ PLATFORM_ONBOARDING_STEPS.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(
23038
+ ProgressSteps,
23039
+ {
23040
+ steps: PLATFORM_ONBOARDING_STEPS.map((step2) => step2.label),
23041
+ currentStep: step === "summary" ? PLATFORM_ONBOARDING_STEPS.length : PLATFORM_ONBOARDING_STEPS.findIndex((s) => s.id === step)
23042
+ }
23043
+ ),
23044
+ /* @__PURE__ */ (0, import_jsx_runtime245.jsx)("div", { className: "Layer__platform-onboarding-layout__content", children: renderStepContent() })
23045
+ ] }),
23046
+ /* @__PURE__ */ (0, import_jsx_runtime245.jsx)("div", { className: "Layer__platform-onboarding-layout__footer", children: renderStepFooter() })
23047
+ ] }) });
23048
+ };
23049
+
23050
+ // src/icons/Coffee.tsx
23051
+ var import_jsx_runtime246 = require("react/jsx-runtime");
23052
+ var CoffeeIcon = (_a) => {
23053
+ var _b = _a, { size = 11 } = _b, props = __objRest(_b, ["size"]);
23054
+ return /* @__PURE__ */ (0, import_jsx_runtime246.jsxs)(
23055
+ "svg",
23056
+ __spreadProps(__spreadValues({
23057
+ xmlns: "http://www.w3.org/2000/svg",
23058
+ viewBox: "0 0 12 12",
23059
+ fill: "none"
23060
+ }, props), {
23061
+ width: size,
23062
+ height: size,
23063
+ children: [
23064
+ /* @__PURE__ */ (0, import_jsx_runtime246.jsxs)("g", { clipPath: "url(#clip0_5018_10141)", children: [
23065
+ /* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
23066
+ "path",
23067
+ {
23068
+ d: "M3.25 4.16666H2.79167C2.30544 4.16666 1.83912 4.35981 1.4953 4.70363C1.15149 5.04744 0.958333 5.51376 0.958333 5.99999C0.958333 6.48622 1.15149 6.95254 1.4953 7.29635C1.83912 7.64017 2.30544 7.83332 2.79167 7.83332H3.25",
21891
23069
  stroke: "currentColor",
21892
23070
  strokeLinecap: "round",
21893
23071
  strokeLinejoin: "round"
21894
23072
  }
21895
23073
  ),
21896
- /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(
23074
+ /* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
21897
23075
  "path",
21898
23076
  {
21899
23077
  d: "M10.5834 4.16666H3.25004V8.29166C3.25004 8.77789 3.4432 9.2442 3.78701 9.58802C4.13083 9.93184 4.59714 10.125 5.08337 10.125H8.75004C9.23627 10.125 9.70259 9.93184 10.0464 9.58802C10.3902 9.2442 10.5834 8.77789 10.5834 8.29166V4.16666Z",
@@ -21902,7 +23080,7 @@ var CoffeeIcon = (_a) => {
21902
23080
  strokeLinejoin: "round"
21903
23081
  }
21904
23082
  ),
21905
- /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(
23083
+ /* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
21906
23084
  "path",
21907
23085
  {
21908
23086
  d: "M8.75 0.958344V2.33334",
@@ -21911,7 +23089,7 @@ var CoffeeIcon = (_a) => {
21911
23089
  strokeLinejoin: "round"
21912
23090
  }
21913
23091
  ),
21914
- /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(
23092
+ /* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
21915
23093
  "path",
21916
23094
  {
21917
23095
  d: "M6.91663 0.958344V2.33334",
@@ -21920,7 +23098,7 @@ var CoffeeIcon = (_a) => {
21920
23098
  strokeLinejoin: "round"
21921
23099
  }
21922
23100
  ),
21923
- /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(
23101
+ /* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
21924
23102
  "path",
21925
23103
  {
21926
23104
  d: "M5.08337 0.958344V2.33334",
@@ -21930,7 +23108,7 @@ var CoffeeIcon = (_a) => {
21930
23108
  }
21931
23109
  )
21932
23110
  ] }),
21933
- /* @__PURE__ */ (0, import_jsx_runtime233.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime233.jsx)("clipPath", { id: "clip0_5018_10141", children: /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(
23111
+ /* @__PURE__ */ (0, import_jsx_runtime246.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime246.jsx)("clipPath", { id: "clip0_5018_10141", children: /* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
21934
23112
  "rect",
21935
23113
  {
21936
23114
  width: "11",
@@ -21946,17 +23124,17 @@ var CoffeeIcon = (_a) => {
21946
23124
  var Coffee_default = CoffeeIcon;
21947
23125
 
21948
23126
  // src/components/UpsellBanner/BookkeepingUpsellBar.tsx
21949
- var import_jsx_runtime234 = require("react/jsx-runtime");
23127
+ var import_jsx_runtime247 = require("react/jsx-runtime");
21950
23128
  var BookkeepingUpsellBar = ({
21951
23129
  onClick,
21952
23130
  href
21953
23131
  }) => {
21954
- return /* @__PURE__ */ (0, import_jsx_runtime234.jsxs)("div", { className: "Layer__bar-banner Layer__bar-banner--bookkeeping", children: [
21955
- /* @__PURE__ */ (0, import_jsx_runtime234.jsxs)("div", { className: "Layer__bar-banner__left-col", children: [
21956
- /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(IconBox, { children: /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(Coffee_default, {}) }),
21957
- /* @__PURE__ */ (0, import_jsx_runtime234.jsxs)("div", { className: "Layer__bar-banner__text-container", children: [
21958
- /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(Text, { size: "md" /* md */, weight: "bold" /* bold */, children: "Need help with your books?" }),
21959
- /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(
23132
+ return /* @__PURE__ */ (0, import_jsx_runtime247.jsxs)("div", { className: "Layer__bar-banner Layer__bar-banner--bookkeeping", children: [
23133
+ /* @__PURE__ */ (0, import_jsx_runtime247.jsxs)("div", { className: "Layer__bar-banner__left-col", children: [
23134
+ /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(IconBox, { children: /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(Coffee_default, {}) }),
23135
+ /* @__PURE__ */ (0, import_jsx_runtime247.jsxs)("div", { className: "Layer__bar-banner__text-container", children: [
23136
+ /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(Text, { size: "md" /* md */, weight: "bold" /* bold */, children: "Need help with your books?" }),
23137
+ /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(
21960
23138
  Text,
21961
23139
  {
21962
23140
  size: "sm" /* sm */,
@@ -21966,25 +23144,25 @@ var BookkeepingUpsellBar = ({
21966
23144
  )
21967
23145
  ] })
21968
23146
  ] }),
21969
- onClick ? /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(Button, { variant: "secondary" /* secondary */, onClick, children: "Schedule a demo" }) : href ? /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(Link2, { href, target: "_blank", variant: "secondary" /* secondary */, children: "Schedule a demo" }) : null
23147
+ onClick ? /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(Button, { variant: "secondary" /* secondary */, onClick, children: "Schedule a demo" }) : href ? /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(Link2, { href, target: "_blank", variant: "secondary" /* secondary */, children: "Schedule a demo" }) : null
21970
23148
  ] });
21971
23149
  };
21972
23150
 
21973
23151
  // src/views/BookkeepingOverview/BookkeepingOverview.tsx
21974
- var import_react139 = require("react");
23152
+ var import_react141 = require("react");
21975
23153
 
21976
23154
  // src/views/BookkeepingOverview/internal/BookkeepingProfitAndLossSummariesContainer.tsx
21977
- var import_jsx_runtime235 = require("react/jsx-runtime");
23155
+ var import_jsx_runtime248 = require("react/jsx-runtime");
21978
23156
  var CLASS_NAME10 = "Layer__BookkeepingProfitAndLossSummariesContainer";
21979
23157
  function BookkeepingProfitAndLossSummariesContainer({
21980
23158
  children
21981
23159
  }) {
21982
- return /* @__PURE__ */ (0, import_jsx_runtime235.jsx)("div", { className: CLASS_NAME10, children });
23160
+ return /* @__PURE__ */ (0, import_jsx_runtime248.jsx)("div", { className: CLASS_NAME10, children });
21983
23161
  }
21984
23162
 
21985
23163
  // src/views/BookkeepingOverview/BookkeepingOverview.tsx
21986
- var import_classnames75 = __toESM(require("classnames"));
21987
- var import_jsx_runtime236 = require("react/jsx-runtime");
23164
+ var import_classnames76 = __toESM(require("classnames"));
23165
+ var import_jsx_runtime249 = require("react/jsx-runtime");
21988
23166
  var BookkeepingOverview = ({
21989
23167
  title,
21990
23168
  showTitle = true,
@@ -21992,19 +23170,19 @@ var BookkeepingOverview = ({
21992
23170
  slotProps
21993
23171
  }) => {
21994
23172
  var _a, _b, _c, _d, _e, _f;
21995
- const [pnlToggle, setPnlToggle] = (0, import_react139.useState)("expenses");
23173
+ const [pnlToggle, setPnlToggle] = (0, import_react141.useState)("expenses");
21996
23174
  const [width] = useWindowSize();
21997
23175
  const profitAndLossSummariesVariants = (_b = (_a = slotProps == null ? void 0 : slotProps.profitAndLoss) == null ? void 0 : _a.summaries) == null ? void 0 : _b.variants;
21998
- return /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(ProfitAndLoss, { asContainer: false, children: /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(TasksProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime236.jsxs)(
23176
+ return /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(ProfitAndLoss, { asContainer: false, children: /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(TasksProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime249.jsxs)(
21999
23177
  View,
22000
23178
  {
22001
23179
  viewClassName: "Layer__bookkeeping-overview--view",
22002
23180
  title: (stringOverrides == null ? void 0 : stringOverrides.title) || title || "Bookkeeping overview",
22003
23181
  withSidebar: width > 1100,
22004
- sidebar: /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(TasksComponent, { stringOverrides: stringOverrides == null ? void 0 : stringOverrides.tasks }),
23182
+ sidebar: /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(TasksComponent, { stringOverrides: stringOverrides == null ? void 0 : stringOverrides.tasks }),
22005
23183
  showHeader: showTitle,
22006
23184
  children: [
22007
- width <= 1100 && /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
23185
+ width <= 1100 && /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
22008
23186
  TasksComponent,
22009
23187
  {
22010
23188
  collapsable: true,
@@ -22012,33 +23190,33 @@ var BookkeepingOverview = ({
22012
23190
  stringOverrides: stringOverrides == null ? void 0 : stringOverrides.tasks
22013
23191
  }
22014
23192
  ),
22015
- /* @__PURE__ */ (0, import_jsx_runtime236.jsxs)(
23193
+ /* @__PURE__ */ (0, import_jsx_runtime249.jsxs)(
22016
23194
  Container,
22017
23195
  {
22018
23196
  name: "bookkeeping-overview-profit-and-loss",
22019
23197
  asWidget: true,
22020
23198
  elevated: true,
22021
23199
  children: [
22022
- /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
23200
+ /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
22023
23201
  ProfitAndLoss.Header,
22024
23202
  {
22025
23203
  text: ((_c = stringOverrides == null ? void 0 : stringOverrides.profitAndLoss) == null ? void 0 : _c.header) || "Profit & Loss",
22026
23204
  withDatePicker: true
22027
23205
  }
22028
23206
  ),
22029
- /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(BookkeepingProfitAndLossSummariesContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
23207
+ /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(BookkeepingProfitAndLossSummariesContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
22030
23208
  ProfitAndLoss.Summaries,
22031
23209
  {
22032
23210
  stringOverrides: (_d = stringOverrides == null ? void 0 : stringOverrides.profitAndLoss) == null ? void 0 : _d.summaries,
22033
23211
  variants: profitAndLossSummariesVariants
22034
23212
  }
22035
23213
  ) }),
22036
- /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(ProfitAndLoss.Chart, {})
23214
+ /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(ProfitAndLoss.Chart, {})
22037
23215
  ]
22038
23216
  }
22039
23217
  ),
22040
- /* @__PURE__ */ (0, import_jsx_runtime236.jsxs)("div", { className: "Layer__bookkeeping-overview-profit-and-loss-charts", children: [
22041
- /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
23218
+ /* @__PURE__ */ (0, import_jsx_runtime249.jsxs)("div", { className: "Layer__bookkeeping-overview-profit-and-loss-charts", children: [
23219
+ /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
22042
23220
  Toggle,
22043
23221
  {
22044
23222
  name: "pnl-detailed-charts",
@@ -22056,14 +23234,14 @@ var BookkeepingOverview = ({
22056
23234
  onChange: (e) => setPnlToggle(e.target.value)
22057
23235
  }
22058
23236
  ),
22059
- /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
23237
+ /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
22060
23238
  Container,
22061
23239
  {
22062
- name: (0, import_classnames75.default)(
23240
+ name: (0, import_classnames76.default)(
22063
23241
  "bookkeeping-overview-profit-and-loss-chart",
22064
23242
  pnlToggle !== "revenue" && "bookkeeping-overview-profit-and-loss-chart--hidden"
22065
23243
  ),
22066
- children: /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
23244
+ children: /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
22067
23245
  ProfitAndLoss.DetailedCharts,
22068
23246
  {
22069
23247
  scope: "revenue",
@@ -22073,14 +23251,14 @@ var BookkeepingOverview = ({
22073
23251
  )
22074
23252
  }
22075
23253
  ),
22076
- /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
23254
+ /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
22077
23255
  Container,
22078
23256
  {
22079
- name: (0, import_classnames75.default)(
23257
+ name: (0, import_classnames76.default)(
22080
23258
  "bookkeeping-overview-profit-and-loss-chart",
22081
23259
  pnlToggle !== "expenses" && "bookkeeping-overview-profit-and-loss-chart--hidden"
22082
23260
  ),
22083
- children: /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
23261
+ children: /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
22084
23262
  ProfitAndLoss.DetailedCharts,
22085
23263
  {
22086
23264
  scope: "expenses",
@@ -22097,23 +23275,23 @@ var BookkeepingOverview = ({
22097
23275
  };
22098
23276
 
22099
23277
  // src/views/AccountingOverview/AccountingOverview.tsx
22100
- var import_react141 = require("react");
23278
+ var import_react143 = require("react");
22101
23279
 
22102
23280
  // src/views/AccountingOverview/internal/TransactionsToReview.tsx
22103
- var import_react140 = require("react");
23281
+ var import_react142 = require("react");
22104
23282
 
22105
23283
  // src/components/BadgeLoader/BadgeLoader.tsx
22106
- var import_jsx_runtime237 = require("react/jsx-runtime");
23284
+ var import_jsx_runtime250 = require("react/jsx-runtime");
22107
23285
  var BadgeLoader = ({ children }) => {
22108
- return /* @__PURE__ */ (0, import_jsx_runtime237.jsxs)("span", { className: "Layer__loader Layer__loader--as-badge", children: [
22109
- /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Loader_default, { size: 11, className: "Layer__anim--rotating" }),
23286
+ return /* @__PURE__ */ (0, import_jsx_runtime250.jsxs)("span", { className: "Layer__loader Layer__loader--as-badge", children: [
23287
+ /* @__PURE__ */ (0, import_jsx_runtime250.jsx)(Loader_default, { size: 11, className: "Layer__anim--rotating" }),
22110
23288
  children
22111
23289
  ] });
22112
23290
  };
22113
23291
 
22114
23292
  // src/views/AccountingOverview/internal/TransactionsToReview.tsx
22115
23293
  var import_date_fns45 = require("date-fns");
22116
- var import_jsx_runtime238 = require("react/jsx-runtime");
23294
+ var import_jsx_runtime251 = require("react/jsx-runtime");
22117
23295
  var CLASS_NAME11 = "Layer__TransactionsToReview";
22118
23296
  function TransactionsToReview({
22119
23297
  onClick,
@@ -22122,17 +23300,17 @@ function TransactionsToReview({
22122
23300
  variants
22123
23301
  }) {
22124
23302
  const { size = "sm" } = variants != null ? variants : {};
22125
- const { dateRange: contextDateRange } = (0, import_react140.useContext)(ProfitAndLoss.Context);
23303
+ const { dateRange: contextDateRange } = (0, import_react142.useContext)(ProfitAndLoss.Context);
22126
23304
  const dateRange = usePnlDateRange ? contextDateRange : void 0;
22127
- const [toReview, setToReview] = (0, import_react140.useState)(0);
23305
+ const [toReview, setToReview] = (0, import_react142.useState)(0);
22128
23306
  const { data, loaded, error, refetch } = useProfitAndLossLTM({
22129
23307
  currentDate: dateRange ? dateRange.startDate : (0, import_date_fns45.startOfMonth)(/* @__PURE__ */ new Date()),
22130
23308
  tagFilter
22131
23309
  });
22132
- (0, import_react140.useEffect)(() => {
23310
+ (0, import_react142.useEffect)(() => {
22133
23311
  checkTransactionsToReview();
22134
23312
  }, []);
22135
- (0, import_react140.useEffect)(() => {
23313
+ (0, import_react142.useEffect)(() => {
22136
23314
  checkTransactionsToReview();
22137
23315
  }, [dateRange, loaded]);
22138
23316
  const checkTransactionsToReview = () => {
@@ -22154,26 +23332,26 @@ function TransactionsToReview({
22154
23332
  verticalGap = "sm";
22155
23333
  break;
22156
23334
  }
22157
- return /* @__PURE__ */ (0, import_jsx_runtime238.jsxs)("div", { onClick, className: CLASS_NAME11, children: [
22158
- /* @__PURE__ */ (0, import_jsx_runtime238.jsxs)(VStack, { gap: verticalGap, align: "start", children: [
22159
- /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(ProfitAndLossSummariesHeading, { variants, children: "Transactions to review" }),
22160
- loaded === "initial" || loaded === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(BadgeLoader, {}) : null,
22161
- loaded === "complete" && error ? /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(
23335
+ return /* @__PURE__ */ (0, import_jsx_runtime251.jsxs)("div", { onClick, className: CLASS_NAME11, children: [
23336
+ /* @__PURE__ */ (0, import_jsx_runtime251.jsxs)(VStack, { gap: verticalGap, align: "start", children: [
23337
+ /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(ProfitAndLossSummariesHeading, { variants, children: "Transactions to review" }),
23338
+ loaded === "initial" || loaded === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(BadgeLoader, {}) : null,
23339
+ loaded === "complete" && error ? /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(
22162
23340
  Badge,
22163
23341
  {
22164
23342
  variant: "error" /* ERROR */,
22165
23343
  size: "small" /* SMALL */,
22166
- icon: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(RefreshCcw_default, { size: 12 }),
23344
+ icon: /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(RefreshCcw_default, { size: 12 }),
22167
23345
  onClick: () => refetch(),
22168
23346
  children: "Refresh"
22169
23347
  }
22170
23348
  ) : null,
22171
- loaded === "complete" && !error && toReview > 0 ? /* @__PURE__ */ (0, import_jsx_runtime238.jsxs)(
23349
+ loaded === "complete" && !error && toReview > 0 ? /* @__PURE__ */ (0, import_jsx_runtime251.jsxs)(
22172
23350
  Badge,
22173
23351
  {
22174
23352
  variant: "warning" /* WARNING */,
22175
23353
  size: "small" /* SMALL */,
22176
- icon: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(Bell_default, { size: 12 }),
23354
+ icon: /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(Bell_default, { size: 12 }),
22177
23355
  children: [
22178
23356
  toReview,
22179
23357
  " ",
@@ -22181,23 +23359,23 @@ function TransactionsToReview({
22181
23359
  ]
22182
23360
  }
22183
23361
  ) : null,
22184
- loaded === "complete" && !error && toReview === 0 ? /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(
23362
+ loaded === "complete" && !error && toReview === 0 ? /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(
22185
23363
  Badge,
22186
23364
  {
22187
23365
  variant: "success" /* SUCCESS */,
22188
23366
  size: "small" /* SMALL */,
22189
- icon: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(Check_default, { size: 12 }),
23367
+ icon: /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(Check_default, { size: 12 }),
22190
23368
  children: "All done"
22191
23369
  }
22192
23370
  ) : null
22193
23371
  ] }),
22194
- /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(IconButton, { icon: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(ChevronRight_default, {}), withBorder: true, onClick })
23372
+ /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(IconButton, { icon: /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(ChevronRight_default, {}), withBorder: true, onClick })
22195
23373
  ] });
22196
23374
  }
22197
23375
 
22198
23376
  // src/views/AccountingOverview/AccountingOverview.tsx
22199
- var import_classnames76 = __toESM(require("classnames"));
22200
- var import_jsx_runtime239 = require("react/jsx-runtime");
23377
+ var import_classnames77 = __toESM(require("classnames"));
23378
+ var import_jsx_runtime252 = require("react/jsx-runtime");
22201
23379
  var AccountingOverview = ({
22202
23380
  title = "Accounting overview",
22203
23381
  showTitle = true,
@@ -22212,35 +23390,35 @@ var AccountingOverview = ({
22212
23390
  slotProps
22213
23391
  }) => {
22214
23392
  var _a, _b, _c, _d, _e;
22215
- const [pnlToggle, setPnlToggle] = (0, import_react141.useState)("expenses");
23393
+ const [pnlToggle, setPnlToggle] = (0, import_react143.useState)("expenses");
22216
23394
  const profitAndLossSummariesVariants = (_b = (_a = slotProps == null ? void 0 : slotProps.profitAndLoss) == null ? void 0 : _a.summaries) == null ? void 0 : _b.variants;
22217
- return /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(
23395
+ return /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
22218
23396
  ProfitAndLoss,
22219
23397
  {
22220
23398
  asContainer: false,
22221
23399
  tagFilter: tagFilter ? { key: tagFilter.tagKey, values: tagFilter.tagValues } : void 0,
22222
- children: /* @__PURE__ */ (0, import_jsx_runtime239.jsxs)(
23400
+ children: /* @__PURE__ */ (0, import_jsx_runtime252.jsxs)(
22223
23401
  View,
22224
23402
  {
22225
23403
  title,
22226
23404
  showHeader: showTitle,
22227
- header: /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(Header2, { children: /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(HeaderRow, { children: /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(HeaderCol, { children: /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(ProfitAndLoss.DatePicker, {}) }) }) }),
23405
+ header: /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(Header2, { children: /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(HeaderRow, { children: /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(HeaderCol, { children: /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(ProfitAndLoss.DatePicker, {}) }) }) }),
22228
23406
  children: [
22229
- enableOnboarding && /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(
23407
+ enableOnboarding && /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
22230
23408
  Onboarding,
22231
23409
  {
22232
23410
  onTransactionsToReviewClick,
22233
23411
  onboardingStepOverride
22234
23412
  }
22235
23413
  ),
22236
- /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(
23414
+ /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
22237
23415
  Internal_ProfitAndLossSummaries,
22238
23416
  {
22239
23417
  stringOverrides: (_c = stringOverrides == null ? void 0 : stringOverrides.profitAndLoss) == null ? void 0 : _c.summaries,
22240
23418
  chartColorsList,
22241
23419
  slots: {
22242
23420
  unstable_AdditionalListItems: showTransactionsToReview ? [
22243
- /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(
23421
+ /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
22244
23422
  TransactionsToReview,
22245
23423
  {
22246
23424
  usePnlDateRange: true,
@@ -22254,20 +23432,20 @@ var AccountingOverview = ({
22254
23432
  variants: profitAndLossSummariesVariants
22255
23433
  }
22256
23434
  ),
22257
- /* @__PURE__ */ (0, import_jsx_runtime239.jsxs)(
23435
+ /* @__PURE__ */ (0, import_jsx_runtime252.jsxs)(
22258
23436
  Container,
22259
23437
  {
22260
23438
  name: "accounting-overview-profit-and-loss",
22261
23439
  asWidget: true,
22262
23440
  elevated: true,
22263
23441
  children: [
22264
- /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(
23442
+ /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
22265
23443
  ProfitAndLoss.Header,
22266
23444
  {
22267
23445
  text: (stringOverrides == null ? void 0 : stringOverrides.header) || "Profit & Loss"
22268
23446
  }
22269
23447
  ),
22270
- /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(
23448
+ /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
22271
23449
  ProfitAndLoss.Chart,
22272
23450
  {
22273
23451
  tagFilter: tagFilter ? { key: tagFilter.tagKey, values: tagFilter.tagValues } : void 0
@@ -22276,9 +23454,9 @@ var AccountingOverview = ({
22276
23454
  ]
22277
23455
  }
22278
23456
  ),
22279
- middleBanner && /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(Container, { name: "accounting-overview-middle-banner", children: middleBanner }),
22280
- /* @__PURE__ */ (0, import_jsx_runtime239.jsxs)("div", { className: "Layer__accounting-overview-profit-and-loss-charts", children: [
22281
- /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(
23457
+ middleBanner && /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(Container, { name: "accounting-overview-middle-banner", children: middleBanner }),
23458
+ /* @__PURE__ */ (0, import_jsx_runtime252.jsxs)("div", { className: "Layer__accounting-overview-profit-and-loss-charts", children: [
23459
+ /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
22282
23460
  Toggle,
22283
23461
  {
22284
23462
  name: "pnl-detailed-charts",
@@ -22296,14 +23474,14 @@ var AccountingOverview = ({
22296
23474
  onChange: (e) => setPnlToggle(e.target.value)
22297
23475
  }
22298
23476
  ),
22299
- /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(
23477
+ /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
22300
23478
  Container,
22301
23479
  {
22302
- name: (0, import_classnames76.default)(
23480
+ name: (0, import_classnames77.default)(
22303
23481
  "accounting-overview-profit-and-loss-chart",
22304
23482
  pnlToggle !== "revenue" && "accounting-overview-profit-and-loss-chart--hidden"
22305
23483
  ),
22306
- children: /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(
23484
+ children: /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
22307
23485
  ProfitAndLoss.DetailedCharts,
22308
23486
  {
22309
23487
  scope: "revenue",
@@ -22314,14 +23492,14 @@ var AccountingOverview = ({
22314
23492
  )
22315
23493
  }
22316
23494
  ),
22317
- /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(
23495
+ /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
22318
23496
  Container,
22319
23497
  {
22320
- name: (0, import_classnames76.default)(
23498
+ name: (0, import_classnames77.default)(
22321
23499
  "accounting-overview-profit-and-loss-chart",
22322
23500
  pnlToggle !== "expenses" && "accounting-overview-profit-and-loss-chart--hidden"
22323
23501
  ),
22324
- children: /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(
23502
+ children: /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
22325
23503
  ProfitAndLoss.DetailedCharts,
22326
23504
  {
22327
23505
  scope: "expenses",
@@ -22341,7 +23519,7 @@ var AccountingOverview = ({
22341
23519
  };
22342
23520
 
22343
23521
  // src/views/BankTransactionsWithLinkedAccounts/BankTransactionsWithLinkedAccounts.tsx
22344
- var import_jsx_runtime240 = require("react/jsx-runtime");
23522
+ var import_jsx_runtime253 = require("react/jsx-runtime");
22345
23523
  var BankTransactionsWithLinkedAccounts = ({
22346
23524
  title,
22347
23525
  // deprecated
@@ -22357,13 +23535,13 @@ var BankTransactionsWithLinkedAccounts = ({
22357
23535
  mobileComponent,
22358
23536
  stringOverrides
22359
23537
  }) => {
22360
- return /* @__PURE__ */ (0, import_jsx_runtime240.jsxs)(
23538
+ return /* @__PURE__ */ (0, import_jsx_runtime253.jsxs)(
22361
23539
  View,
22362
23540
  {
22363
23541
  title: (stringOverrides == null ? void 0 : stringOverrides.title) || title || "Bank transactions",
22364
23542
  showHeader: showTitle,
22365
23543
  children: [
22366
- /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(
23544
+ /* @__PURE__ */ (0, import_jsx_runtime253.jsx)(
22367
23545
  LinkedAccounts,
22368
23546
  {
22369
23547
  elevated: elevatedLinkedAccounts,
@@ -22373,7 +23551,7 @@ var BankTransactionsWithLinkedAccounts = ({
22373
23551
  stringOverrides: stringOverrides == null ? void 0 : stringOverrides.linkedAccounts
22374
23552
  }
22375
23553
  ),
22376
- /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(
23554
+ /* @__PURE__ */ (0, import_jsx_runtime253.jsx)(
22377
23555
  BankTransactions,
22378
23556
  {
22379
23557
  asWidget: true,
@@ -22391,8 +23569,8 @@ var BankTransactionsWithLinkedAccounts = ({
22391
23569
  };
22392
23570
 
22393
23571
  // src/views/GeneralLedger/GeneralLedger.tsx
22394
- var import_react142 = require("react");
22395
- var import_jsx_runtime241 = require("react/jsx-runtime");
23572
+ var import_react144 = require("react");
23573
+ var import_jsx_runtime254 = require("react/jsx-runtime");
22396
23574
  var GeneralLedgerView = ({
22397
23575
  title,
22398
23576
  // deprecated
@@ -22400,14 +23578,14 @@ var GeneralLedgerView = ({
22400
23578
  stringOverrides,
22401
23579
  chartOfAccountsOptions
22402
23580
  }) => {
22403
- const [activeTab, setActiveTab] = (0, import_react142.useState)("chartOfAccounts");
22404
- return /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(ProfitAndLoss, { asContainer: false, children: /* @__PURE__ */ (0, import_jsx_runtime241.jsxs)(
23581
+ const [activeTab, setActiveTab] = (0, import_react144.useState)("chartOfAccounts");
23582
+ return /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(ProfitAndLoss, { asContainer: false, children: /* @__PURE__ */ (0, import_jsx_runtime254.jsxs)(
22405
23583
  View,
22406
23584
  {
22407
23585
  title: (stringOverrides == null ? void 0 : stringOverrides.title) || title || "General Ledger",
22408
23586
  showHeader: showTitle,
22409
23587
  children: [
22410
- /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(
23588
+ /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(
22411
23589
  Toggle,
22412
23590
  {
22413
23591
  name: "general-ledger-tabs",
@@ -22425,7 +23603,7 @@ var GeneralLedgerView = ({
22425
23603
  onChange: (opt) => setActiveTab(opt.target.value)
22426
23604
  }
22427
23605
  ),
22428
- activeTab === "chartOfAccounts" ? /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(
23606
+ activeTab === "chartOfAccounts" ? /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(
22429
23607
  ChartOfAccounts,
22430
23608
  {
22431
23609
  asWidget: true,
@@ -22435,16 +23613,16 @@ var GeneralLedgerView = ({
22435
23613
  templateAccountsEditable: chartOfAccountsOptions == null ? void 0 : chartOfAccountsOptions.templateAccountsEditable,
22436
23614
  showReversalEntries: chartOfAccountsOptions == null ? void 0 : chartOfAccountsOptions.showReversalEntries
22437
23615
  }
22438
- ) : /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(Journal, { stringOverrides: stringOverrides == null ? void 0 : stringOverrides.journal })
23616
+ ) : /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(Journal, { stringOverrides: stringOverrides == null ? void 0 : stringOverrides.journal })
22439
23617
  ]
22440
23618
  }
22441
23619
  ) });
22442
23620
  };
22443
23621
 
22444
23622
  // src/views/ProjectProfitability/ProjectProfitability.tsx
22445
- var import_react143 = require("react");
23623
+ var import_react145 = require("react");
22446
23624
  var import_react_select5 = __toESM(require("react-select"));
22447
- var import_jsx_runtime242 = require("react/jsx-runtime");
23625
+ var import_jsx_runtime255 = require("react/jsx-runtime");
22448
23626
  var ProjectProfitabilityView = ({
22449
23627
  valueOptions,
22450
23628
  showTitle,
@@ -22452,9 +23630,9 @@ var ProjectProfitabilityView = ({
22452
23630
  datePickerMode = "monthPicker",
22453
23631
  csvMoneyFormat = "DOLLAR_STRING"
22454
23632
  }) => {
22455
- const [activeTab, setActiveTab] = (0, import_react143.useState)("overview");
22456
- const [tagFilter, setTagFilter] = (0, import_react143.useState)(null);
22457
- const [pnlTagFilter, setPnlTagFilter] = (0, import_react143.useState)(
23633
+ const [activeTab, setActiveTab] = (0, import_react145.useState)("overview");
23634
+ const [tagFilter, setTagFilter] = (0, import_react145.useState)(null);
23635
+ const [pnlTagFilter, setPnlTagFilter] = (0, import_react145.useState)(
22458
23636
  void 0
22459
23637
  );
22460
23638
  const isOptionSelected = (option, selectValue) => {
@@ -22468,15 +23646,15 @@ var ProjectProfitabilityView = ({
22468
23646
  values: tagFilter2.tagValues
22469
23647
  } : void 0;
22470
23648
  };
22471
- return /* @__PURE__ */ (0, import_jsx_runtime242.jsxs)(
23649
+ return /* @__PURE__ */ (0, import_jsx_runtime255.jsxs)(
22472
23650
  View,
22473
23651
  {
22474
23652
  title: (stringOverrides == null ? void 0 : stringOverrides.title) || "",
22475
23653
  showHeader: showTitle,
22476
23654
  viewClassName: "Layer__project-view",
22477
23655
  children: [
22478
- /* @__PURE__ */ (0, import_jsx_runtime242.jsxs)("div", { className: "Layer__component Layer__header__actions", children: [
22479
- /* @__PURE__ */ (0, import_jsx_runtime242.jsx)("div", { className: "Layer__component", children: /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(
23656
+ /* @__PURE__ */ (0, import_jsx_runtime255.jsxs)("div", { className: "Layer__component Layer__header__actions", children: [
23657
+ /* @__PURE__ */ (0, import_jsx_runtime255.jsx)("div", { className: "Layer__component", children: /* @__PURE__ */ (0, import_jsx_runtime255.jsx)(
22480
23658
  Toggle,
22481
23659
  {
22482
23660
  name: "project-tabs",
@@ -22498,7 +23676,7 @@ var ProjectProfitabilityView = ({
22498
23676
  onChange: (opt) => setActiveTab(opt.target.value)
22499
23677
  }
22500
23678
  ) }),
22501
- /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(
23679
+ /* @__PURE__ */ (0, import_jsx_runtime255.jsx)(
22502
23680
  import_react_select5.default,
22503
23681
  {
22504
23682
  className: "Layer__category-menu Layer__select",
@@ -22517,8 +23695,8 @@ var ProjectProfitabilityView = ({
22517
23695
  }
22518
23696
  )
22519
23697
  ] }),
22520
- /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(Container, { name: "project", children: /* @__PURE__ */ (0, import_jsx_runtime242.jsxs)(import_jsx_runtime242.Fragment, { children: [
22521
- activeTab === "overview" && /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(
23698
+ /* @__PURE__ */ (0, import_jsx_runtime255.jsx)(Container, { name: "project", children: /* @__PURE__ */ (0, import_jsx_runtime255.jsxs)(import_jsx_runtime255.Fragment, { children: [
23699
+ activeTab === "overview" && /* @__PURE__ */ (0, import_jsx_runtime255.jsx)(
22522
23700
  AccountingOverview,
22523
23701
  {
22524
23702
  stringOverrides: { header: "Project Overview" },
@@ -22529,7 +23707,7 @@ var ProjectProfitabilityView = ({
22529
23707
  showTitle: false
22530
23708
  }
22531
23709
  ),
22532
- activeTab === "transactions" && /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(
23710
+ activeTab === "transactions" && /* @__PURE__ */ (0, import_jsx_runtime255.jsx)(
22533
23711
  BankTransactions,
22534
23712
  {
22535
23713
  hideHeader: true,
@@ -22539,7 +23717,7 @@ var ProjectProfitabilityView = ({
22539
23717
  }
22540
23718
  }
22541
23719
  ),
22542
- activeTab === "report" && /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(ProfitAndLoss, { asContainer: false, tagFilter: pnlTagFilter, children: /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(
23720
+ activeTab === "report" && /* @__PURE__ */ (0, import_jsx_runtime255.jsx)(ProfitAndLoss, { asContainer: false, tagFilter: pnlTagFilter, children: /* @__PURE__ */ (0, import_jsx_runtime255.jsx)(
22543
23721
  ProfitAndLoss.Report,
22544
23722
  {
22545
23723
  stringOverrides,
@@ -22554,8 +23732,8 @@ var ProjectProfitabilityView = ({
22554
23732
  };
22555
23733
 
22556
23734
  // src/views/Reports/Reports.tsx
22557
- var import_react144 = require("react");
22558
- var import_jsx_runtime243 = require("react/jsx-runtime");
23735
+ var import_react146 = require("react");
23736
+ var import_jsx_runtime256 = require("react/jsx-runtime");
22559
23737
  var getOptions = (enabledReports) => {
22560
23738
  return [
22561
23739
  enabledReports.includes("profitAndLoss") ? {
@@ -22582,17 +23760,17 @@ var Reports = ({
22582
23760
  statementOfCashFlowConfig
22583
23761
  }) => {
22584
23762
  var _a;
22585
- const [activeTab, setActiveTab] = (0, import_react144.useState)(enabledReports[0]);
23763
+ const [activeTab, setActiveTab] = (0, import_react146.useState)(enabledReports[0]);
22586
23764
  const { view, containerRef } = useElementViewSize();
22587
23765
  const options = getOptions(enabledReports);
22588
- const defaultTitle = enabledReports.length > 1 ? "Reports" : (_a = options.find((option) => option.value = enabledReports[0])) == null ? void 0 : _a.label;
22589
- return /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)(
23766
+ const defaultTitle4 = enabledReports.length > 1 ? "Reports" : (_a = options.find((option) => option.value = enabledReports[0])) == null ? void 0 : _a.label;
23767
+ return /* @__PURE__ */ (0, import_jsx_runtime256.jsxs)(
22590
23768
  View,
22591
23769
  {
22592
- title: (stringOverrides == null ? void 0 : stringOverrides.title) || title || defaultTitle,
23770
+ title: (stringOverrides == null ? void 0 : stringOverrides.title) || title || defaultTitle4,
22593
23771
  showHeader: showTitle,
22594
23772
  children: [
22595
- enabledReports.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime243.jsx)("div", { className: "Layer__component Layer__header__actions", children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
23773
+ enabledReports.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime256.jsx)("div", { className: "Layer__component Layer__header__actions", children: /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(
22596
23774
  Toggle,
22597
23775
  {
22598
23776
  name: "reports-tabs",
@@ -22601,7 +23779,7 @@ var Reports = ({
22601
23779
  onChange: (opt) => setActiveTab(opt.target.value)
22602
23780
  }
22603
23781
  ) }),
22604
- /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(Container, { name: "reports", ref: containerRef, children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(ProfitAndLoss, { asContainer: false, comparisonConfig, children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
23782
+ /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(Container, { name: "reports", ref: containerRef, children: /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(ProfitAndLoss, { asContainer: false, comparisonConfig, children: /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(
22605
23783
  ReportsPanel,
22606
23784
  {
22607
23785
  containerRef,
@@ -22624,8 +23802,8 @@ var ReportsPanel = ({
22624
23802
  statementOfCashFlowConfig,
22625
23803
  view
22626
23804
  }) => {
22627
- return /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)(import_jsx_runtime243.Fragment, { children: [
22628
- openReport === "profitAndLoss" && /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
23805
+ return /* @__PURE__ */ (0, import_jsx_runtime256.jsxs)(import_jsx_runtime256.Fragment, { children: [
23806
+ openReport === "profitAndLoss" && /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(
22629
23807
  ProfitAndLoss.Report,
22630
23808
  __spreadValues({
22631
23809
  stringOverrides,
@@ -22633,8 +23811,8 @@ var ReportsPanel = ({
22633
23811
  view
22634
23812
  }, profitAndLossConfig)
22635
23813
  ),
22636
- openReport === "balanceSheet" && /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(BalanceSheet, { stringOverrides: stringOverrides == null ? void 0 : stringOverrides.balanceSheet }),
22637
- openReport === "statementOfCashFlow" && /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
23814
+ openReport === "balanceSheet" && /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(BalanceSheet, { stringOverrides: stringOverrides == null ? void 0 : stringOverrides.balanceSheet }),
23815
+ openReport === "statementOfCashFlow" && /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(
22638
23816
  StatementOfCashFlow,
22639
23817
  __spreadValues({
22640
23818
  stringOverrides: stringOverrides == null ? void 0 : stringOverrides.statementOfCashflow
@@ -22644,12 +23822,12 @@ var ReportsPanel = ({
22644
23822
  };
22645
23823
 
22646
23824
  // src/components/ProfitAndLossView/ProfitAndLossView.tsx
22647
- var import_react145 = require("react");
22648
- var import_jsx_runtime244 = require("react/jsx-runtime");
23825
+ var import_react147 = require("react");
23826
+ var import_jsx_runtime257 = require("react/jsx-runtime");
22649
23827
  var COMPONENT_NAME7 = "profit-and-loss";
22650
23828
  var ProfitAndLossView = (props) => {
22651
- const containerRef = (0, import_react145.useRef)(null);
22652
- return /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(Container, { name: COMPONENT_NAME7, ref: containerRef, children: /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(ProfitAndLoss, { children: /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(ProfitAndLossPanel, __spreadValues({ containerRef }, props)) }) });
23829
+ const containerRef = (0, import_react147.useRef)(null);
23830
+ return /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(Container, { name: COMPONENT_NAME7, ref: containerRef, children: /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(ProfitAndLoss, { children: /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(ProfitAndLossPanel, __spreadValues({ containerRef }, props)) }) });
22653
23831
  };
22654
23832
  var ProfitAndLossPanel = (_a) => {
22655
23833
  var _b = _a, {
@@ -22659,11 +23837,11 @@ var ProfitAndLossPanel = (_a) => {
22659
23837
  "containerRef",
22660
23838
  "stringOverrides"
22661
23839
  ]);
22662
- const { sidebarScope } = (0, import_react145.useContext)(ProfitAndLoss.Context);
22663
- return /* @__PURE__ */ (0, import_jsx_runtime244.jsxs)(
23840
+ const { sidebarScope } = (0, import_react147.useContext)(ProfitAndLoss.Context);
23841
+ return /* @__PURE__ */ (0, import_jsx_runtime257.jsxs)(
22664
23842
  Panel,
22665
23843
  {
22666
- sidebar: /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(
23844
+ sidebar: /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(
22667
23845
  ProfitAndLossDetailedCharts,
22668
23846
  {
22669
23847
  stringOverrides: stringOverrides == null ? void 0 : stringOverrides.profitAndLossDetailedCharts
@@ -22672,7 +23850,7 @@ var ProfitAndLossPanel = (_a) => {
22672
23850
  sidebarIsOpen: Boolean(sidebarScope),
22673
23851
  parentRef: containerRef,
22674
23852
  children: [
22675
- /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(
23853
+ /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(
22676
23854
  ProfitAndLoss.Header,
22677
23855
  {
22678
23856
  text: (stringOverrides == null ? void 0 : stringOverrides.header) || "Profit & Loss",
@@ -22680,7 +23858,7 @@ var ProfitAndLossPanel = (_a) => {
22680
23858
  headingClassName: "Layer__profit-and-loss__title"
22681
23859
  }
22682
23860
  ),
22683
- /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(Components, __spreadValues({ stringOverrides }, props))
23861
+ /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(Components, __spreadValues({ stringOverrides }, props))
22684
23862
  ]
22685
23863
  }
22686
23864
  );
@@ -22690,11 +23868,11 @@ var Components = ({
22690
23868
  hideTable = false,
22691
23869
  stringOverrides
22692
23870
  }) => {
22693
- const { error, isLoading, isValidating, refetch } = (0, import_react145.useContext)(
23871
+ const { error, isLoading, isValidating, refetch } = (0, import_react147.useContext)(
22694
23872
  ProfitAndLoss.Context
22695
23873
  );
22696
23874
  if (!isLoading && error) {
22697
- return /* @__PURE__ */ (0, import_jsx_runtime244.jsx)("div", { className: "Layer__table-state-container", children: /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(
23875
+ return /* @__PURE__ */ (0, import_jsx_runtime257.jsx)("div", { className: "Layer__table-state-container", children: /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(
22698
23876
  DataState,
22699
23877
  {
22700
23878
  status: "failed" /* failed */,
@@ -22705,15 +23883,15 @@ var Components = ({
22705
23883
  }
22706
23884
  ) });
22707
23885
  }
22708
- return /* @__PURE__ */ (0, import_jsx_runtime244.jsxs)(import_jsx_runtime244.Fragment, { children: [
22709
- !hideChart && /* @__PURE__ */ (0, import_jsx_runtime244.jsxs)("div", { className: `Layer__${COMPONENT_NAME7}__chart_with_summaries`, children: [
22710
- /* @__PURE__ */ (0, import_jsx_runtime244.jsxs)(
23886
+ return /* @__PURE__ */ (0, import_jsx_runtime257.jsxs)(import_jsx_runtime257.Fragment, { children: [
23887
+ !hideChart && /* @__PURE__ */ (0, import_jsx_runtime257.jsxs)("div", { className: `Layer__${COMPONENT_NAME7}__chart_with_summaries`, children: [
23888
+ /* @__PURE__ */ (0, import_jsx_runtime257.jsxs)(
22711
23889
  "div",
22712
23890
  {
22713
23891
  className: `Layer__${COMPONENT_NAME7}__chart_with_summaries__summary-col`,
22714
23892
  children: [
22715
- /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(ProfitAndLoss.DatePicker, {}),
22716
- /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(
23893
+ /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(ProfitAndLoss.DatePicker, {}),
23894
+ /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(
22717
23895
  ProfitAndLoss.Summaries,
22718
23896
  {
22719
23897
  actionable: true,
@@ -22723,15 +23901,15 @@ var Components = ({
22723
23901
  ]
22724
23902
  }
22725
23903
  ),
22726
- /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(
23904
+ /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(
22727
23905
  "div",
22728
23906
  {
22729
23907
  className: `Layer__${COMPONENT_NAME7}__chart_with_summaries__chart-col`,
22730
- children: /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(ProfitAndLoss.Chart, {})
23908
+ children: /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(ProfitAndLoss.Chart, {})
22731
23909
  }
22732
23910
  )
22733
23911
  ] }),
22734
- !hideTable && /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(
23912
+ !hideTable && /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(
22735
23913
  ProfitAndLoss.Table,
22736
23914
  {
22737
23915
  stringOverrides: stringOverrides == null ? void 0 : stringOverrides.profitAndLossTable
@@ -22757,6 +23935,7 @@ var Components = ({
22757
23935
  LinkAccounts,
22758
23936
  LinkedAccounts,
22759
23937
  Onboarding,
23938
+ PlatformOnboarding,
22760
23939
  ProfitAndLoss,
22761
23940
  ProfitAndLossView,
22762
23941
  ProjectProfitabilityView,