@layerfi/components 0.1.78 → 0.1.80

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.
@@ -51,11 +51,14 @@ var __async = (__this, __arguments, generator) => {
51
51
  };
52
52
 
53
53
  // src/providers/LayerProvider/LayerProvider.tsx
54
- import React9 from "react";
54
+ import React9, { useState as useState7 } from "react";
55
55
 
56
56
  // src/providers/BusinessProvider/BusinessProvider.tsx
57
57
  import React8, { useReducer, useEffect as useEffect4 } from "react";
58
58
 
59
+ // package.json
60
+ var version = "0.1.80";
61
+
59
62
  // src/models/APIError.ts
60
63
  var APIError = class _APIError extends Error {
61
64
  constructor(message, code, messages) {
@@ -92,31 +95,34 @@ var errorHandler = new ErrorHandlerClass();
92
95
  var reportError = (payload) => errorHandler.onError(payload);
93
96
 
94
97
  // src/api/layer/authenticated_http.ts
98
+ var CUSTOM_PREFIX = "Layer-";
99
+ var CUSTOM_HEADERS = {
100
+ [`${CUSTOM_PREFIX}React-Version`]: version
101
+ };
95
102
  var get = (url) => (baseUrl, accessToken, options) => () => fetch(`${baseUrl}${url((options == null ? void 0 : options.params) || {})}`, {
96
- headers: {
103
+ headers: __spreadValues({
97
104
  Authorization: "Bearer " + (accessToken || ""),
98
105
  "Content-Type": "application/json"
99
- },
106
+ }, CUSTOM_HEADERS),
100
107
  method: "GET"
101
108
  }).then((res) => handleResponse(res)).catch((error) => handleException(error));
102
109
  var request = (verb) => (url) => (baseUrl, accessToken, options) => fetch(`${baseUrl}${url((options == null ? void 0 : options.params) || {})}`, {
103
- headers: {
110
+ headers: __spreadValues({
104
111
  Authorization: "Bearer " + (accessToken || ""),
105
112
  "Content-Type": "application/json",
106
113
  "Cache-Control": "no-cache"
107
- },
114
+ }, CUSTOM_HEADERS),
108
115
  method: verb.toUpperCase(),
109
116
  body: JSON.stringify(options == null ? void 0 : options.body)
110
117
  }).then((res) => handleResponse(res)).catch((error) => handleException(error));
111
118
  var post = request("post");
112
119
  var put = request("put");
113
- var deleteRequest = request("delete");
114
120
  var postWithFormData = (url, formData, baseUrl, accessToken) => {
115
121
  return fetch(`${baseUrl}${url}`, {
116
122
  method: "POST",
117
- headers: {
123
+ headers: __spreadValues({
118
124
  Authorization: "Bearer " + (accessToken || "")
119
- },
125
+ }, CUSTOM_HEADERS),
120
126
  body: formData
121
127
  }).then((res) => handleResponse(res)).catch((error) => handleException(error));
122
128
  };
@@ -1254,7 +1260,7 @@ function buildKey({
1254
1260
  return null;
1255
1261
  }
1256
1262
  var DEFAULT_EXPIRES_IN_SECONDS = 3600;
1257
- var FALLBACK_REFRESH_MS = 1e3;
1263
+ var FALLBACK_REFRESH_MS = DEFAULT_EXPIRES_IN_SECONDS / 2 * 1e3;
1258
1264
  function useAuth() {
1259
1265
  const {
1260
1266
  apiUrl,
@@ -2301,13 +2307,8 @@ var LayerProvider = (_a) => {
2301
2307
  "environment",
2302
2308
  "usePlaidSandbox"
2303
2309
  ]);
2304
- const defaultSWRConfig = {
2305
- refreshInterval: 0,
2306
- revalidateOnFocus: false,
2307
- revalidateOnReconnect: false,
2308
- revalidateIfStale: false
2309
- };
2310
- return /* @__PURE__ */ React9.createElement(SWRConfig, { value: __spreadProps(__spreadValues({}, defaultSWRConfig), { provider: () => /* @__PURE__ */ new Map() }) }, /* @__PURE__ */ React9.createElement(EnvironmentInputProvider, { environment, usePlaidSandbox }, /* @__PURE__ */ React9.createElement(
2310
+ const [cache] = useState7(() => /* @__PURE__ */ new Map());
2311
+ return /* @__PURE__ */ React9.createElement(SWRConfig, { value: __spreadProps(__spreadValues({}, DEFAULT_SWR_CONFIG), { provider: () => cache }) }, /* @__PURE__ */ React9.createElement(EnvironmentInputProvider, { environment, usePlaidSandbox }, /* @__PURE__ */ React9.createElement(
2311
2312
  AuthInputProvider,
2312
2313
  {
2313
2314
  appId,
@@ -2319,7 +2320,7 @@ var LayerProvider = (_a) => {
2319
2320
  };
2320
2321
 
2321
2322
  // src/components/Onboarding/Onboarding.tsx
2322
- import React52, { useContext as useContext9, useEffect as useEffect7, useState as useState10 } from "react";
2323
+ import React52, { useContext as useContext9, useEffect as useEffect7, useState as useState11 } from "react";
2323
2324
 
2324
2325
  // src/contexts/LinkedAccountsContext/LinkedAccountsContext.ts
2325
2326
  import { createContext as createContext7 } from "react";
@@ -2840,7 +2841,7 @@ import React22, {
2840
2841
  } from "react";
2841
2842
 
2842
2843
  // src/components/Tooltip/useTooltip.ts
2843
- import React21, { useState as useState7 } from "react";
2844
+ import React21, { useState as useState8 } from "react";
2844
2845
  import {
2845
2846
  useFloating,
2846
2847
  autoUpdate,
@@ -2872,7 +2873,7 @@ var useTooltip = ({
2872
2873
  shift: shiftProp = { padding: 5 }
2873
2874
  } = {}) => {
2874
2875
  var _a;
2875
- const [uncontrolledOpen, setUncontrolledOpen] = useState7(initialOpen);
2876
+ const [uncontrolledOpen, setUncontrolledOpen] = useState8(initialOpen);
2876
2877
  const open = controlledOpen != null ? controlledOpen : uncontrolledOpen;
2877
2878
  const setOpen = setControlledOpen != null ? setControlledOpen : setUncontrolledOpen;
2878
2879
  const data = useFloating({
@@ -3514,7 +3515,7 @@ var ExpandButton = (_a) => {
3514
3515
  };
3515
3516
 
3516
3517
  // src/components/Button/SwitchButton.tsx
3517
- import React37, { useState as useState8, useEffect as useEffect5 } from "react";
3518
+ import React37, { useState as useState9, useEffect as useEffect5 } from "react";
3518
3519
  import classNames12 from "classnames";
3519
3520
 
3520
3521
  // src/components/Button/Link.tsx
@@ -3788,7 +3789,7 @@ var ExpandCollapseButton = ({
3788
3789
  };
3789
3790
 
3790
3791
  // src/components/Typography/Text.tsx
3791
- import React44, { useRef as useRef4, useState as useState9, useEffect as useEffect6 } from "react";
3792
+ import React44, { useRef as useRef4, useState as useState10, useEffect as useEffect6 } from "react";
3792
3793
  import classNames15 from "classnames";
3793
3794
  var Text = (_a) => {
3794
3795
  var _b = _a, {
@@ -3860,7 +3861,7 @@ var TextWithTooltip = (_a) => {
3860
3861
  },
3861
3862
  []
3862
3863
  );
3863
- const [hoverStatus, setHover] = useState9(false);
3864
+ const [hoverStatus, setHover] = useState10(false);
3864
3865
  const contentClassName = classNames15(
3865
3866
  "Layer__tooltip",
3866
3867
  tooltipOptions == null ? void 0 : tooltipOptions.contentClassName
@@ -4158,7 +4159,7 @@ var OnboardingContent = ({
4158
4159
  useEffect7(() => {
4159
4160
  setOnboardingStep(onboardingStepOverride);
4160
4161
  }, [onboardingStepOverride]);
4161
- const [style, setStyle] = useState10(
4162
+ const [style, setStyle] = useState11(
4162
4163
  onboardingStep ? EXPANDED_STYLE : COLLAPSED_STYLE
4163
4164
  );
4164
4165
  const { data, loadingStatus } = useContext9(LinkedAccountsContext);
@@ -4315,10 +4316,10 @@ var MoreVertical = (_a) => {
4315
4316
  var MoreVertical_default = MoreVertical;
4316
4317
 
4317
4318
  // src/components/HoverMenu/HoverMenu.tsx
4318
- import React57, { useEffect as useEffect8, useRef as useRef5, useState as useState11 } from "react";
4319
+ import React57, { useEffect as useEffect8, useRef as useRef5, useState as useState12 } from "react";
4319
4320
  import classNames19 from "classnames";
4320
4321
  var HoverMenu = ({ children, config }) => {
4321
- const [openMenu, setOpenMenu] = useState11(false);
4322
+ const [openMenu, setOpenMenu] = useState12(false);
4322
4323
  const hoverMenuRef = useRef5(null);
4323
4324
  const hoverMenuClassName = classNames19(
4324
4325
  "Layer__hover-menu",
@@ -4898,7 +4899,7 @@ var LinkedAccountItemThumb = ({
4898
4899
  import classNames22 from "classnames";
4899
4900
 
4900
4901
  // src/components/LinkedAccounts/ConfirmationModal/LinkedAccountsConfirmationModal.tsx
4901
- import React74, { useState as useState12 } from "react";
4902
+ import React74, { useState as useState13 } from "react";
4902
4903
 
4903
4904
  // src/components/ui/Modal/Modal.tsx
4904
4905
  import React64, { forwardRef as forwardRef4 } from "react";
@@ -5264,7 +5265,7 @@ function LinkedAccountsConfirmationModalPreloadedContent({ onClose }) {
5264
5265
  }
5265
5266
  function LinkedAccountsConfirmationModalContent({ onClose }) {
5266
5267
  const { accounts, onDismiss, onFinish, refetchAccounts } = useLinkedAccountsConfirmationModal();
5267
- const [formState, setFormState] = useState12(() => Object.fromEntries(
5268
+ const [formState, setFormState] = useState13(() => Object.fromEntries(
5268
5269
  accounts.map(({ id }) => [id, true])
5269
5270
  ));
5270
5271
  const { trigger, isMutating, error } = useConfirmAndExcludeMultiple(formState, {
@@ -5393,7 +5394,7 @@ var LinkedAccountsComponent = ({
5393
5394
  };
5394
5395
 
5395
5396
  // src/components/BankTransactions/BankTransactions.tsx
5396
- import React138, { useEffect as useEffect23, useMemo as useMemo14, useRef as useRef17, useState as useState31 } from "react";
5397
+ import React138, { useEffect as useEffect23, useMemo as useMemo14, useRef as useRef17, useState as useState32 } from "react";
5397
5398
 
5398
5399
  // src/hooks/useElementSize/useElementSize.ts
5399
5400
  import { useLayoutEffect as useLayoutEffect2, useRef as useRef6 } from "react";
@@ -5431,9 +5432,9 @@ var useElementSize = (callback) => {
5431
5432
  };
5432
5433
 
5433
5434
  // src/hooks/useIsVisible/useIsVisible.ts
5434
- import { useEffect as useEffect9, useState as useState13 } from "react";
5435
+ import { useEffect as useEffect9, useState as useState14 } from "react";
5435
5436
  var useIsVisible = (ref) => {
5436
- const [isIntersecting, setIntersecting] = useState13(false);
5437
+ const [isIntersecting, setIntersecting] = useState14(false);
5437
5438
  useEffect9(() => {
5438
5439
  if (!ref.current) {
5439
5440
  return;
@@ -5468,7 +5469,7 @@ var debounce = (fnc, timeout = 300) => {
5468
5469
  import React113 from "react";
5469
5470
 
5470
5471
  // src/components/BankTransactionList/BankTransactionListItem.tsx
5471
- import React112, { useEffect as useEffect15, useRef as useRef10, useState as useState20 } from "react";
5472
+ import React112, { useEffect as useEffect15, useRef as useRef10, useState as useState21 } from "react";
5472
5473
 
5473
5474
  // src/icons/ChevronDownFill.tsx
5474
5475
  import * as React77 from "react";
@@ -5562,7 +5563,7 @@ var File = (_a) => {
5562
5563
  var File_default = File;
5563
5564
 
5564
5565
  // src/components/BankTransactionRow/BankTransactionRow.tsx
5565
- import React110, { useEffect as useEffect14, useMemo as useMemo10, useRef as useRef9, useState as useState19 } from "react";
5566
+ import React110, { useEffect as useEffect14, useMemo as useMemo10, useRef as useRef9, useState as useState20 } from "react";
5566
5567
 
5567
5568
  // src/icons/Scissors.tsx
5568
5569
  import * as React79 from "react";
@@ -5859,7 +5860,7 @@ var MinimizeTwo_default = MinimizeTwo;
5859
5860
  import React86, { useContext as useContext13 } from "react";
5860
5861
 
5861
5862
  // src/components/BankTransactionMobileList/BusinessCategories.tsx
5862
- import React85, { useState as useState14 } from "react";
5863
+ import React85, { useState as useState15 } from "react";
5863
5864
 
5864
5865
  // src/components/ActionableList/ActionableList.tsx
5865
5866
  import React84 from "react";
@@ -5984,8 +5985,8 @@ var BusinessCategories = ({
5984
5985
  const categoryOptions = flattenCategories(
5985
5986
  categories.filter((category) => category.type != "ExclusionNested")
5986
5987
  );
5987
- const [optionsToShow, setOptionsToShow] = useState14(categoryOptions);
5988
- const [selectedGroup, setSelectedGroup] = useState14();
5988
+ const [optionsToShow, setOptionsToShow] = useState15(categoryOptions);
5989
+ const [selectedGroup, setSelectedGroup] = useState15();
5989
5990
  const onCategorySelect = (v) => {
5990
5991
  if (v.value.type === "GROUP" && v.value.items) {
5991
5992
  setOptionsToShow(v.value.items);
@@ -6293,7 +6294,7 @@ var CategorySelect = ({
6293
6294
  import React107, {
6294
6295
  forwardRef as forwardRef10,
6295
6296
  useImperativeHandle as useImperativeHandle2,
6296
- useState as useState18,
6297
+ useState as useState19,
6297
6298
  useCallback as useCallback3,
6298
6299
  useEffect as useEffect13,
6299
6300
  useRef as useRef8
@@ -6435,7 +6436,7 @@ var useReceiptsContext = () => useContext14(ReceiptsContext);
6435
6436
  import React90 from "react";
6436
6437
 
6437
6438
  // src/hooks/useReceipts/useReceipts.ts
6438
- import { useEffect as useEffect10, useState as useState15 } from "react";
6439
+ import { useEffect as useEffect10, useState as useState16 } from "react";
6439
6440
  import { parseISO as parseISO3, format as formatTime2 } from "date-fns";
6440
6441
  var readDate = (date) => {
6441
6442
  if (!date)
@@ -6450,7 +6451,7 @@ var useReceipts = ({
6450
6451
  const { apiUrl } = useEnvironment();
6451
6452
  const { data: auth } = useAuth();
6452
6453
  const { updateOneLocal: updateBankTransaction } = useBankTransactionsContext();
6453
- const [receiptUrls, setReceiptUrls] = useState15([]);
6454
+ const [receiptUrls, setReceiptUrls] = useState16([]);
6454
6455
  useEffect10(() => {
6455
6456
  if (isActive && receiptUrls.length === 0 && hasReceipts(bankTransaction)) {
6456
6457
  fetchDocuments();
@@ -7253,7 +7254,7 @@ var Textarea = (_a) => {
7253
7254
  // src/components/Toggle/Toggle.tsx
7254
7255
  import React105, {
7255
7256
  useEffect as useEffect11,
7256
- useState as useState16
7257
+ useState as useState17
7257
7258
  } from "react";
7258
7259
  import classNames35 from "classnames";
7259
7260
  var Toggle = ({
@@ -7263,9 +7264,9 @@ var Toggle = ({
7263
7264
  onChange,
7264
7265
  size = "medium" /* medium */
7265
7266
  }) => {
7266
- const [currentWidth, setCurrentWidth] = useState16(0);
7267
- const [thumbPos, setThumbPos] = useState16({ left: 0, width: 0 });
7268
- const [initialized, setInitialized] = useState16(false);
7267
+ const [currentWidth, setCurrentWidth] = useState17(0);
7268
+ const [thumbPos, setThumbPos] = useState17({ left: 0, width: 0 });
7269
+ const [initialized, setInitialized] = useState17(false);
7269
7270
  const toggleRef = useElementSize((a, b, c) => {
7270
7271
  if (c.width && (c == null ? void 0 : c.width) !== currentWidth) {
7271
7272
  setCurrentWidth(c.width);
@@ -7401,7 +7402,7 @@ var ToggleOption = ({
7401
7402
  };
7402
7403
 
7403
7404
  // src/components/ExpandedBankTransactionRow/APIErrorNotifications.tsx
7404
- import React106, { useEffect as useEffect12, useState as useState17 } from "react";
7405
+ import React106, { useEffect as useEffect12, useState as useState18 } from "react";
7405
7406
  var ERROR_TITLE = "Approval Failed";
7406
7407
  var ERROR_MESSAGE = "Something went wrong, try again later";
7407
7408
  var NOTIFICATION_TIME = 4e3;
@@ -7411,7 +7412,7 @@ var APIErrorNotifications = ({
7411
7412
  bankTransaction,
7412
7413
  containerWidth
7413
7414
  }) => {
7414
- const [notifications, setNotifications] = useState17([]);
7415
+ const [notifications, setNotifications] = useState18([]);
7415
7416
  const pushNotification = (title, message) => {
7416
7417
  const timestamp = (/* @__PURE__ */ new Date()).valueOf();
7417
7418
  if (notificationsCache.find(
@@ -7465,7 +7466,7 @@ var Notification = ({
7465
7466
  notification,
7466
7467
  deleteNotification
7467
7468
  }) => {
7468
- const [visible, setVisible] = useState17(false);
7469
+ const [visible, setVisible] = useState18(false);
7469
7470
  useEffect12(() => {
7470
7471
  setVisible(true);
7471
7472
  const timer = setTimeout(() => {
@@ -7548,24 +7549,24 @@ var ExpandedBankTransactionRow = forwardRef10(
7548
7549
  categorize: categorizeBankTransaction2,
7549
7550
  match: matchBankTransaction2
7550
7551
  } = useBankTransactionsContext();
7551
- const [purpose, setPurpose] = useState18(
7552
+ const [purpose, setPurpose] = useState19(
7552
7553
  bankTransaction.category ? "categorize" /* categorize */ : hasMatch(bankTransaction) ? "match" /* match */ : "categorize" /* categorize */
7553
7554
  );
7554
- const [selectedMatchId, setSelectedMatchId] = useState18(
7555
+ const [selectedMatchId, setSelectedMatchId] = useState19(
7555
7556
  (_c = isAlreadyMatched2(bankTransaction)) != null ? _c : (_b = (_a = bankTransaction == null ? void 0 : bankTransaction.suggested_matches) == null ? void 0 : _a[0]) == null ? void 0 : _b.id
7556
7557
  );
7557
- const [matchFormError, setMatchFormError] = useState18();
7558
- const [splitFormError, setSplitFormError] = useState18();
7559
- const [height, setHeight] = useState18(0);
7560
- const [isOver, setOver] = useState18(false);
7558
+ const [matchFormError, setMatchFormError] = useState19();
7559
+ const [splitFormError, setSplitFormError] = useState19();
7560
+ const [height, setHeight] = useState19(0);
7561
+ const [isOver, setOver] = useState19(false);
7561
7562
  const bodyRef = useRef8(null);
7562
- const [memoText, setMemoText] = useState18();
7563
- const [isLoaded, setIsLoaded] = useState18(false);
7563
+ const [memoText, setMemoText] = useState19();
7564
+ const [isLoaded, setIsLoaded] = useState19(false);
7564
7565
  const { businessId } = useLayerContext();
7565
7566
  const { apiUrl } = useEnvironment();
7566
7567
  const { data: auth } = useAuth();
7567
7568
  const defaultCategory = bankTransaction.category || hasSuggestions(bankTransaction.categorization_flow) && ((_e = (_d = bankTransaction.categorization_flow) == null ? void 0 : _d.suggestions) == null ? void 0 : _e[0]);
7568
- const [rowState, updateRowState] = useState18({
7569
+ const [rowState, updateRowState] = useState19({
7569
7570
  splits: ((_f = bankTransaction.category) == null ? void 0 : _f.entries) ? (_g = bankTransaction.category) == null ? void 0 : _g.entries.map((c) => {
7570
7571
  return c.type === "ExclusionSplitEntry" ? {
7571
7572
  amount: c.amount || 0,
@@ -8042,16 +8043,16 @@ var BankTransactionRow = ({
8042
8043
  }) => {
8043
8044
  var _a, _b, _c, _d, _e, _f;
8044
8045
  const expandedRowRef = useRef9(null);
8045
- const [showRetry, setShowRetry] = useState19(false);
8046
+ const [showRetry, setShowRetry] = useState20(false);
8046
8047
  const {
8047
8048
  categorize: categorizeBankTransaction2,
8048
8049
  match: matchBankTransaction2,
8049
8050
  shouldHideAfterCategorize
8050
8051
  } = useBankTransactionsContext();
8051
- const [selectedCategory, setSelectedCategory] = useState19(
8052
+ const [selectedCategory, setSelectedCategory] = useState20(
8052
8053
  getDefaultSelectedCategory(bankTransaction)
8053
8054
  );
8054
- const [open, setOpen] = useState19(false);
8055
+ const [open, setOpen] = useState20(false);
8055
8056
  const toggleOpen = () => {
8056
8057
  setShowRetry(false);
8057
8058
  setOpen(!open);
@@ -8067,7 +8068,7 @@ var BankTransactionRow = ({
8067
8068
  }
8068
8069
  }
8069
8070
  };
8070
- const [showComponent, setShowComponent] = useState19(false);
8071
+ const [showComponent, setShowComponent] = useState20(false);
8071
8072
  useEffect14(() => {
8072
8073
  if (initialLoad) {
8073
8074
  const timeoutId = setTimeout(() => {
@@ -8356,21 +8357,21 @@ var BankTransactionListItem = ({
8356
8357
  }) => {
8357
8358
  var _a, _b;
8358
8359
  const expandedRowRef = useRef10(null);
8359
- const [showRetry, setShowRetry] = useState20(false);
8360
+ const [showRetry, setShowRetry] = useState21(false);
8360
8361
  const {
8361
8362
  categorize: categorizeBankTransaction2,
8362
8363
  match: matchBankTransaction2,
8363
8364
  shouldHideAfterCategorize
8364
8365
  } = useBankTransactionsContext();
8365
- const [selectedCategory, setSelectedCategory] = useState20(
8366
+ const [selectedCategory, setSelectedCategory] = useState21(
8366
8367
  getDefaultSelectedCategory(bankTransaction)
8367
8368
  );
8368
- const [open, setOpen] = useState20(false);
8369
+ const [open, setOpen] = useState21(false);
8369
8370
  const toggleOpen = () => {
8370
8371
  setShowRetry(false);
8371
8372
  setOpen(!open);
8372
8373
  };
8373
- const [showComponent, setShowComponent] = useState20(false);
8374
+ const [showComponent, setShowComponent] = useState21(false);
8374
8375
  useEffect15(() => {
8375
8376
  const timeoutId = setTimeout(() => {
8376
8377
  setShowComponent(true);
@@ -8530,13 +8531,13 @@ var BankTransactionList = ({
8530
8531
  import React123 from "react";
8531
8532
 
8532
8533
  // src/components/BankTransactionMobileList/BankTransactionMobileListItem.tsx
8533
- import React122, { useContext as useContext17, useEffect as useEffect21, useRef as useRef15, useState as useState28 } from "react";
8534
+ import React122, { useContext as useContext17, useEffect as useEffect21, useRef as useRef15, useState as useState29 } from "react";
8534
8535
 
8535
8536
  // src/components/BankTransactionMobileList/BankTransactionMobileForms.tsx
8536
8537
  import React121 from "react";
8537
8538
 
8538
8539
  // src/components/BankTransactionMobileList/BusinessForm.tsx
8539
- import React116, { useContext as useContext16, useEffect as useEffect17, useMemo as useMemo11, useRef as useRef11, useState as useState22 } from "react";
8540
+ import React116, { useContext as useContext16, useEffect as useEffect17, useMemo as useMemo11, useRef as useRef11, useState as useState23 } from "react";
8540
8541
 
8541
8542
  // src/icons/Paperclip.tsx
8542
8543
  import React114 from "react";
@@ -8570,7 +8571,7 @@ import React115, {
8570
8571
  createContext as createContext9,
8571
8572
  useContext as useContext15,
8572
8573
  useEffect as useEffect16,
8573
- useState as useState21
8574
+ useState as useState22
8574
8575
  } from "react";
8575
8576
  var MemoTextContext = createContext9({
8576
8577
  memoText: void 0,
@@ -8583,8 +8584,8 @@ var useMemoText = ({ bankTransaction, isActive }) => {
8583
8584
  const { businessId } = useLayerContext();
8584
8585
  const { apiUrl } = useEnvironment();
8585
8586
  const { data: auth } = useAuth();
8586
- const [memoText, setMemoText] = useState21();
8587
- const [isLoaded, setIsLoaded] = useState21(false);
8587
+ const [memoText, setMemoText] = useState22();
8588
+ const [isLoaded, setIsLoaded] = useState22(false);
8588
8589
  useEffect16(() => {
8589
8590
  if (isActive && !isLoaded) {
8590
8591
  fetchMemos();
@@ -8654,10 +8655,10 @@ var BusinessForm = ({
8654
8655
  const receiptsRef = useRef11(null);
8655
8656
  const { setContent, close } = useContext16(DrawerContext);
8656
8657
  const { categorize: categorizeBankTransaction2, isLoading } = useBankTransactionsContext();
8657
- const [selectedCategory, setSelectedCategory] = useState22(
8658
+ const [selectedCategory, setSelectedCategory] = useState23(
8658
8659
  getAssignedValue(bankTransaction)
8659
8660
  );
8660
- const [showRetry, setShowRetry] = useState22(false);
8661
+ const [showRetry, setShowRetry] = useState23(false);
8661
8662
  const { memoText, setMemoText, saveMemoText } = useMemoTextContext();
8662
8663
  useEffect17(() => {
8663
8664
  if (bankTransaction.error) {
@@ -8813,7 +8814,7 @@ var BusinessForm = ({
8813
8814
  };
8814
8815
 
8815
8816
  // src/components/BankTransactionMobileList/PersonalForm.tsx
8816
- import React117, { useEffect as useEffect18, useRef as useRef12, useState as useState23 } from "react";
8817
+ import React117, { useEffect as useEffect18, useRef as useRef12, useState as useState24 } from "react";
8817
8818
 
8818
8819
  // src/components/BankTransactionMobileList/constants.ts
8819
8820
  var PersonalCategories = /* @__PURE__ */ ((PersonalCategories2) => {
@@ -8842,7 +8843,7 @@ var PersonalForm = ({
8842
8843
  var _a;
8843
8844
  const receiptsRef = useRef12(null);
8844
8845
  const { categorize: categorizeBankTransaction2, isLoading } = useBankTransactionsContext();
8845
- const [showRetry, setShowRetry] = useState23(false);
8846
+ const [showRetry, setShowRetry] = useState24(false);
8846
8847
  const { memoText, setMemoText, saveMemoText } = useMemoTextContext();
8847
8848
  useEffect18(() => {
8848
8849
  if (bankTransaction.error) {
@@ -8926,10 +8927,10 @@ var PersonalForm = ({
8926
8927
  };
8927
8928
 
8928
8929
  // src/components/BankTransactionMobileList/SplitAndMatchForm.tsx
8929
- import React120, { useState as useState26 } from "react";
8930
+ import React120, { useState as useState27 } from "react";
8930
8931
 
8931
8932
  // src/components/BankTransactionMobileList/MatchForm.tsx
8932
- import React118, { useEffect as useEffect19, useRef as useRef13, useState as useState24 } from "react";
8933
+ import React118, { useEffect as useEffect19, useRef as useRef13, useState as useState25 } from "react";
8933
8934
  import classNames41 from "classnames";
8934
8935
  var MatchForm2 = ({
8935
8936
  bankTransaction,
@@ -8940,11 +8941,11 @@ var MatchForm2 = ({
8940
8941
  const receiptsRef = useRef13(null);
8941
8942
  const { match: matchBankTransaction2, isLoading } = useBankTransactionsContext();
8942
8943
  const { memoText, setMemoText, saveMemoText } = useMemoTextContext();
8943
- const [selectedMatchId, setSelectedMatchId] = useState24(
8944
+ const [selectedMatchId, setSelectedMatchId] = useState25(
8944
8945
  (_b = isAlreadyMatched(bankTransaction)) != null ? _b : bankTransaction.suggested_matches && ((_a = bankTransaction.suggested_matches) == null ? void 0 : _a.length) > 0 ? bankTransaction.suggested_matches[0].id : void 0
8945
8946
  );
8946
- const [formError, setFormError] = useState24();
8947
- const [showRetry, setShowRetry] = useState24(false);
8947
+ const [formError, setFormError] = useState25();
8948
+ const [showRetry, setShowRetry] = useState25(false);
8948
8949
  useEffect19(() => {
8949
8950
  if (bankTransaction.error) {
8950
8951
  setShowRetry(true);
@@ -9044,7 +9045,7 @@ var MatchForm2 = ({
9044
9045
  };
9045
9046
 
9046
9047
  // src/components/BankTransactionMobileList/SplitForm.tsx
9047
- import React119, { useEffect as useEffect20, useRef as useRef14, useState as useState25 } from "react";
9048
+ import React119, { useEffect as useEffect20, useRef as useRef14, useState as useState26 } from "react";
9048
9049
  import classNames42 from "classnames";
9049
9050
  var SplitForm = ({
9050
9051
  bankTransaction,
@@ -9060,7 +9061,7 @@ var SplitForm = ({
9060
9061
  } = useBankTransactionsContext();
9061
9062
  const { memoText, setMemoText, saveMemoText } = useMemoTextContext();
9062
9063
  const defaultCategory = bankTransaction.category || hasSuggestions(bankTransaction.categorization_flow) && ((_b = (_a = bankTransaction.categorization_flow) == null ? void 0 : _a.suggestions) == null ? void 0 : _b[0]);
9063
- const [rowState, updateRowState] = useState25({
9064
+ const [rowState, updateRowState] = useState26({
9064
9065
  splits: ((_c = bankTransaction.category) == null ? void 0 : _c.entries) ? (_d = bankTransaction.category) == null ? void 0 : _d.entries.map((c) => {
9065
9066
  return c.type === "ExclusionSplitEntry" ? {
9066
9067
  amount: c.amount || 0,
@@ -9086,8 +9087,8 @@ var SplitForm = ({
9086
9087
  description: "",
9087
9088
  file: void 0
9088
9089
  });
9089
- const [formError, setFormError] = useState25();
9090
- const [showRetry, setShowRetry] = useState25(false);
9090
+ const [formError, setFormError] = useState26();
9091
+ const [showRetry, setShowRetry] = useState26(false);
9091
9092
  useEffect20(() => {
9092
9093
  if (bankTransaction.error) {
9093
9094
  setShowRetry(true);
@@ -9311,7 +9312,7 @@ var SplitAndMatchForm = ({
9311
9312
  showDescriptions
9312
9313
  }) => {
9313
9314
  const anyMatch = hasMatch(bankTransaction);
9314
- const [formType, setFormType] = useState26(
9315
+ const [formType, setFormType] = useState27(
9315
9316
  bankTransaction.category ? "categorize" /* categorize */ : anyMatch ? "match" /* match */ : "categorize" /* categorize */
9316
9317
  );
9317
9318
  return /* @__PURE__ */ React120.createElement("div", { className: "Layer__bank-transaction-mobile-list-item__split-and-match-form" }, formType === "categorize" /* categorize */ && /* @__PURE__ */ React120.createElement(
@@ -9380,9 +9381,9 @@ var BankTransactionMobileForms = ({
9380
9381
  };
9381
9382
 
9382
9383
  // src/components/BankTransactionMobileList/TransactionToOpenContext.ts
9383
- import { createContext as createContext10, useState as useState27 } from "react";
9384
+ import { createContext as createContext10, useState as useState28 } from "react";
9384
9385
  var useTransactionToOpen = () => {
9385
- const [transactionIdToOpen, setTransactionIdToOpen] = useState27(void 0);
9386
+ const [transactionIdToOpen, setTransactionIdToOpen] = useState28(void 0);
9386
9387
  const clearTransactionIdToOpen = () => setTransactionIdToOpen(void 0);
9387
9388
  return {
9388
9389
  transactionIdToOpen,
@@ -9436,14 +9437,14 @@ var BankTransactionMobileListItem = ({
9436
9437
  setHeadingHeight(height2);
9437
9438
  });
9438
9439
  const itemRef = useRef15(null);
9439
- const [removeAnim, setRemoveAnim] = useState28(false);
9440
- const [purpose, setPurpose] = useState28(
9440
+ const [removeAnim, setRemoveAnim] = useState29(false);
9441
+ const [purpose, setPurpose] = useState29(
9441
9442
  bankTransaction.category ? bankTransaction.category.type === "Exclusion" ? "personal" /* personal */ : bankTransaction.categorization_status === "SPLIT" /* SPLIT */ ? "more" /* more */ : "business" /* business */ : hasMatch(bankTransaction) ? "more" /* more */ : "business" /* business */
9442
9443
  );
9443
- const [open, setOpen] = useState28(isFirstItem);
9444
- const [showComponent, setShowComponent] = useState28(!initialLoad);
9445
- const [height, setHeight] = useState28(0);
9446
- const [headingHeight, setHeadingHeight] = useState28(63);
9444
+ const [open, setOpen] = useState29(isFirstItem);
9445
+ const [showComponent, setShowComponent] = useState29(!initialLoad);
9446
+ const [height, setHeight] = useState29(0);
9447
+ const [headingHeight, setHeadingHeight] = useState29(63);
9447
9448
  const openNext = () => {
9448
9449
  if (editable && itemRef.current && itemRef.current.nextSibling) {
9449
9450
  const txId = itemRef.current.nextSibling.getAttribute(
@@ -10043,7 +10044,7 @@ var Pagination = ({
10043
10044
  };
10044
10045
 
10045
10046
  // src/components/BankTransactions/BankTransactionsHeader.tsx
10046
- import React135, { useState as useState30 } from "react";
10047
+ import React135, { useState as useState31 } from "react";
10047
10048
 
10048
10049
  // src/utils/business.ts
10049
10050
  import { differenceInCalendarMonths, parseISO as parseISO11, startOfMonth as startOfMonth2 } from "date-fns";
@@ -10076,7 +10077,7 @@ var isDateAllowedToBrowse = (date, business) => {
10076
10077
  };
10077
10078
 
10078
10079
  // src/components/DatePicker/DatePicker.tsx
10079
- import React134, { useEffect as useEffect22, useRef as useRef16, useState as useState29 } from "react";
10080
+ import React134, { useEffect as useEffect22, useRef as useRef16, useState as useState30 } from "react";
10080
10081
  import * as RDP from "react-datepicker";
10081
10082
 
10082
10083
  // src/components/DatePicker/DatePickerOptions.tsx
@@ -10207,13 +10208,13 @@ var DatePicker = (_a) => {
10207
10208
  var _a2;
10208
10209
  const { ModeSelector } = slots != null ? slots : {};
10209
10210
  const pickerRef = useRef16(null);
10210
- const [updatePickerDate, setPickerDate] = useState29(false);
10211
- const [selectedDates, setSelectedDates] = useState29(selected);
10211
+ const [updatePickerDate, setPickerDate] = useState30(false);
10212
+ const [selectedDates, setSelectedDates] = useState30(selected);
10212
10213
  const { isDesktop } = useSizeClass();
10213
- const [startDate, setStartDate] = useState29(
10214
+ const [startDate, setStartDate] = useState30(
10214
10215
  (_a2 = getDefaultRangeDate("start", mode, selected)) != null ? _a2 : /* @__PURE__ */ new Date()
10215
10216
  );
10216
- const [endDate, setEndDate] = useState29(
10217
+ const [endDate, setEndDate] = useState30(
10217
10218
  getDefaultRangeDate("end", mode, selected)
10218
10219
  );
10219
10220
  useEffect22(() => {
@@ -10455,8 +10456,8 @@ var DownloadButton2 = ({
10455
10456
  const { businessId } = useLayerContext();
10456
10457
  const { apiUrl } = useEnvironment();
10457
10458
  const { data: auth } = useAuth();
10458
- const [requestFailed, setRequestFailed] = useState30(false);
10459
- const [isDownloading, setIsDownloading] = useState30(false);
10459
+ const [requestFailed, setRequestFailed] = useState31(false);
10460
+ const [isDownloading, setIsDownloading] = useState31(false);
10460
10461
  const handleClick = () => __async(void 0, null, function* () {
10461
10462
  var _a;
10462
10463
  setIsDownloading(true);
@@ -10679,14 +10680,14 @@ var BankTransactionsContent = ({
10679
10680
  hideHeader = false,
10680
10681
  stringOverrides
10681
10682
  }) => {
10682
- const [defaultDateRange] = useState31(() => ({
10683
+ const [defaultDateRange] = useState32(() => ({
10683
10684
  startDate: startOfMonth5(/* @__PURE__ */ new Date()),
10684
10685
  endDate: endOfMonth4(/* @__PURE__ */ new Date())
10685
10686
  }));
10686
10687
  const scrollPaginationRef = useRef17(null);
10687
10688
  const isVisible = useIsVisible(scrollPaginationRef);
10688
- const [currentPage, setCurrentPage] = useState31(1);
10689
- const [initialLoad, setInitialLoad] = useState31(true);
10689
+ const [currentPage, setCurrentPage] = useState32(1);
10690
+ const [initialLoad, setInitialLoad] = useState32(true);
10690
10691
  const categorizeView = categorizeViewProp != null ? categorizeViewProp : categorizationEnabled(mode);
10691
10692
  const {
10692
10693
  activate,
@@ -10769,10 +10770,10 @@ var BankTransactionsContent = ({
10769
10770
  });
10770
10771
  setCurrentPage(1);
10771
10772
  };
10772
- const [shiftStickyHeader, setShiftStickyHeader] = useState31(0);
10773
+ const [shiftStickyHeader, setShiftStickyHeader] = useState32(0);
10773
10774
  const debounceShiftStickyHeader = debounce(setShiftStickyHeader, 500);
10774
- const [listView, setListView] = useState31(false);
10775
- const [containerWidth, setContainerWidth] = useState31(0);
10775
+ const [listView, setListView] = useState32(false);
10776
+ const [containerWidth, setContainerWidth] = useState32(0);
10776
10777
  const debounceContainerWidth = debounce(setContainerWidth, 500);
10777
10778
  const removeTransaction = (bankTransaction) => removeAfterCategorize(bankTransaction);
10778
10779
  const containerRef = useElementSize((_el, _en, size) => {
@@ -10904,14 +10905,14 @@ var BankTransactionsContent = ({
10904
10905
  import React139 from "react";
10905
10906
 
10906
10907
  // src/hooks/useQuickbooks/useQuickbooks.ts
10907
- import { useEffect as useEffect24, useRef as useRef18, useState as useState32 } from "react";
10908
+ import { useEffect as useEffect24, useRef as useRef18, useState as useState33 } from "react";
10908
10909
  var DEBUG2 = true;
10909
10910
  var useQuickbooks = () => {
10910
10911
  const { businessId } = useLayerContext();
10911
10912
  const { apiUrl } = useEnvironment();
10912
10913
  const { data: auth } = useAuth();
10913
- const [isSyncingFromQuickbooks, setIsSyncingFromQuickbooks] = useState32(false);
10914
- const [quickbooksIsLinked, setQuickbooksIsLinked] = useState32(
10914
+ const [isSyncingFromQuickbooks, setIsSyncingFromQuickbooks] = useState33(false);
10915
+ const [quickbooksIsLinked, setQuickbooksIsLinked] = useState33(
10915
10916
  null
10916
10917
  );
10917
10918
  const syncStatusIntervalRef = useRef18(null);
@@ -11025,7 +11026,7 @@ var PNLComparisonContext = createContext11({
11025
11026
  });
11026
11027
 
11027
11028
  // src/hooks/useProfitAndLoss/useProfitAndLoss.tsx
11028
- import { useMemo as useMemo16, useState as useState34 } from "react";
11029
+ import { useMemo as useMemo16, useState as useState35 } from "react";
11029
11030
 
11030
11031
  // src/utils/profitAndLossUtils.ts
11031
11032
  var doesLineItemQualifies = (item) => {
@@ -11081,7 +11082,7 @@ var applyShare = (items, total) => {
11081
11082
  };
11082
11083
 
11083
11084
  // src/hooks/useProfitAndLoss/useProfitAndLossLTM.tsx
11084
- import { useEffect as useEffect25, useMemo as useMemo15, useState as useState33 } from "react";
11085
+ import { useEffect as useEffect25, useMemo as useMemo15, useState as useState34 } from "react";
11085
11086
  import { startOfMonth as startOfMonth6, sub } from "date-fns";
11086
11087
  import useSWR4 from "swr";
11087
11088
  var buildDates = ({ currentDate }) => {
@@ -11109,9 +11110,9 @@ var useProfitAndLossLTM = ({ currentDate, tagFilter, reportingBasis } = {
11109
11110
  const { businessId, syncTimestamps, read, hasBeenTouched } = useLayerContext();
11110
11111
  const { apiUrl } = useEnvironment();
11111
11112
  const { data: auth } = useAuth();
11112
- const [date, setDate] = useState33(currentDate);
11113
- const [loaded, setLoaded] = useState33("initial");
11114
- const [data, setData] = useState33([]);
11113
+ const [date, setDate] = useState34(currentDate);
11114
+ const [loaded, setLoaded] = useState34("initial");
11115
+ const [data, setData] = useState34([]);
11115
11116
  const { startYear, startMonth, endYear, endMonth } = useMemo15(() => {
11116
11117
  return buildDates({ currentDate: date });
11117
11118
  }, [date, businessId, tagFilter, reportingBasis]);
@@ -11308,17 +11309,17 @@ var useProfitAndLoss = ({
11308
11309
  startDate: startOfMonth8(/* @__PURE__ */ new Date()),
11309
11310
  endDate: endOfMonth6(/* @__PURE__ */ new Date())
11310
11311
  }) => {
11311
- const [startDate, setStartDate] = useState34(
11312
+ const [startDate, setStartDate] = useState35(
11312
11313
  initialStartDate || startOfMonth8(Date.now())
11313
11314
  );
11314
- const [endDate, setEndDate] = useState34(
11315
+ const [endDate, setEndDate] = useState35(
11315
11316
  initialEndDate || endOfMonth6(Date.now())
11316
11317
  );
11317
- const [filters, setFilters] = useState34({
11318
+ const [filters, setFilters] = useState35({
11318
11319
  expenses: void 0,
11319
11320
  revenue: void 0
11320
11321
  });
11321
- const [sidebarScope, setSidebarScope] = useState34(void 0);
11322
+ const [sidebarScope, setSidebarScope] = useState35(void 0);
11322
11323
  const { data, isLoading, isValidating, error, refetch } = useProfitAndLossQuery({
11323
11324
  startDate,
11324
11325
  endDate,
@@ -11478,24 +11479,24 @@ var useProfitAndLoss = ({
11478
11479
  };
11479
11480
 
11480
11481
  // src/hooks/useProfitAndLossComparison/useProfitAndLossComparison.tsx
11481
- import { useEffect as useEffect27, useState as useState35, useCallback as useCallback4, useRef as useRef19 } from "react";
11482
+ import { useEffect as useEffect27, useState as useState36, useCallback as useCallback4, useRef as useRef19 } from "react";
11482
11483
  import { startOfMonth as startOfMonth9, subMonths as subMonths2, getYear, getMonth } from "date-fns";
11483
11484
  var initialFetchDone = false;
11484
11485
  var useProfitAndLossComparison = ({
11485
11486
  reportingBasis
11486
11487
  }) => {
11487
11488
  const lastQuery = useRef19();
11488
- const [compareMode, setCompareMode] = useState35(false);
11489
- const [compareMonths, setCompareMonths] = useState35(0);
11490
- const [compareOptions, setCompareOptions] = useState35(
11489
+ const [compareMode, setCompareMode] = useState36(false);
11490
+ const [compareMonths, setCompareMonths] = useState36(0);
11491
+ const [compareOptions, setCompareOptions] = useState36(
11491
11492
  []
11492
11493
  );
11493
- const [data, setData] = useState35(
11494
+ const [data, setData] = useState36(
11494
11495
  void 0
11495
11496
  );
11496
- const [isLoading, setIsLoading] = useState35(false);
11497
- const [isValidating, setIsValidating] = useState35(false);
11498
- const [error, setError] = useState35(null);
11497
+ const [isLoading, setIsLoading] = useState36(false);
11498
+ const [isValidating, setIsValidating] = useState36(false);
11499
+ const [error, setError] = useState36(null);
11499
11500
  const { businessId } = useLayerContext();
11500
11501
  const { apiUrl } = useEnvironment();
11501
11502
  const { data: auth } = useAuth();
@@ -11634,7 +11635,7 @@ var useProfitAndLossComparison = ({
11634
11635
  };
11635
11636
 
11636
11637
  // src/components/ProfitAndLossChart/ProfitAndLossChart.tsx
11637
- import React143, { useContext as useContext18, useEffect as useEffect29, useMemo as useMemo17, useState as useState37 } from "react";
11638
+ import React143, { useContext as useContext18, useEffect as useEffect29, useMemo as useMemo17, useState as useState38 } from "react";
11638
11639
 
11639
11640
  // src/components/ProfitAndLossChart/ChartStateCard.tsx
11640
11641
  import React141 from "react";
@@ -11697,7 +11698,7 @@ var ChartStateCard = () => {
11697
11698
  };
11698
11699
 
11699
11700
  // src/components/ProfitAndLossChart/Indicator.tsx
11700
- import React142, { useEffect as useEffect28, useState as useState36 } from "react";
11701
+ import React142, { useEffect as useEffect28, useState as useState37 } from "react";
11701
11702
  var emptyViewBox = { x: 0, y: 0, width: 0, height: 0 };
11702
11703
  var Indicator = ({
11703
11704
  className,
@@ -11707,7 +11708,7 @@ var Indicator = ({
11707
11708
  setCustomCursorSize,
11708
11709
  viewBox = {}
11709
11710
  }) => {
11710
- const [opacityIndicator, setOpacityIndicator] = useState36(0);
11711
+ const [opacityIndicator, setOpacityIndicator] = useState37(0);
11711
11712
  const { x: animateTo = 0, width = 0 } = "x" in viewBox ? viewBox : emptyViewBox;
11712
11713
  const margin = width > 12 ? 12 : 6;
11713
11714
  const boxWidth = width + margin;
@@ -11851,18 +11852,18 @@ var ProfitAndLossChart = ({
11851
11852
  tagFilter = void 0
11852
11853
  }) => {
11853
11854
  var _c, _d, _e, _f, _g, _h;
11854
- const [compactView, setCompactView] = useState37(false);
11855
+ const [compactView, setCompactView] = useState38(false);
11855
11856
  const barSize = compactView ? 10 : 20;
11856
11857
  const { getColor, business } = useLayerContext();
11857
11858
  const { changeDateRange, dateRange } = useContext18(ProfitAndLoss.Context);
11858
- const [localDateRange, setLocalDateRange] = useState37(dateRange);
11859
- const [customCursorSize, setCustomCursorSize] = useState37({
11859
+ const [localDateRange, setLocalDateRange] = useState38(dateRange);
11860
+ const [customCursorSize, setCustomCursorSize] = useState38({
11860
11861
  width: 0,
11861
11862
  height: 0,
11862
11863
  x: 0
11863
11864
  });
11864
- const [barAnimActive, setBarAnimActive] = useState37(true);
11865
- const [chartWindow, setChartWindow] = useState37({
11865
+ const [barAnimActive, setBarAnimActive] = useState38(true);
11866
+ const [chartWindow, setChartWindow] = useState38({
11866
11867
  start: startOfMonth10(sub2(Date.now(), { months: 11 })),
11867
11868
  end: endOfMonth7(Date.now())
11868
11869
  });
@@ -12156,7 +12157,7 @@ var ProfitAndLossChart = ({
12156
12157
  }
12157
12158
  );
12158
12159
  };
12159
- const [animateFrom, setAnimateFrom] = useState37(-1);
12160
+ const [animateFrom, setAnimateFrom] = useState38(-1);
12160
12161
  return /* @__PURE__ */ React143.createElement("div", { className: "Layer__chart-wrapper" }, /* @__PURE__ */ React143.createElement(
12161
12162
  ResponsiveContainer,
12162
12163
  {
@@ -12453,7 +12454,7 @@ var ProfitAndLossChart = ({
12453
12454
  };
12454
12455
 
12455
12456
  // src/components/ProfitAndLossCompareOptions/ProfitAndLossCompareOptions.tsx
12456
- import React144, { useContext as useContext19, useEffect as useEffect30, useState as useState38 } from "react";
12457
+ import React144, { useContext as useContext19, useEffect as useEffect30, useState as useState39 } from "react";
12457
12458
  var selectStyles = {
12458
12459
  valueContainer: (styles) => {
12459
12460
  return __spreadProps(__spreadValues({}, styles), {
@@ -12474,7 +12475,7 @@ var ProfitAndLossCompareOptions = ({
12474
12475
  compareOptions
12475
12476
  } = useContext19(ProfitAndLoss.ComparisonContext);
12476
12477
  const { dateRange } = useContext19(ProfitAndLoss.Context);
12477
- const [initialDone, setInitialDone] = useState38(false);
12478
+ const [initialDone, setInitialDone] = useState39(false);
12478
12479
  useEffect30(() => {
12479
12480
  if (initialDone) {
12480
12481
  fetchData();
@@ -12490,10 +12491,10 @@ var ProfitAndLossCompareOptions = ({
12490
12491
  });
12491
12492
  }
12492
12493
  };
12493
- const [months, setMonths] = useState38(
12494
+ const [months, setMonths] = useState39(
12494
12495
  compareMonths !== 0 ? compareMonths : 1
12495
12496
  );
12496
- const [toggle, setToggle] = useState38(
12497
+ const [toggle, setToggle] = useState39(
12497
12498
  (compareOptions == null ? void 0 : compareOptions.length) > 0 ? compareOptions : [defaultOption]
12498
12499
  );
12499
12500
  useEffect30(() => {
@@ -12563,7 +12564,7 @@ var ProfitAndLossCompareOptions = ({
12563
12564
  };
12564
12565
 
12565
12566
  // src/components/ProfitAndLossDatePicker/ProfitAndLossDatePicker.tsx
12566
- import React146, { useContext as useContext20, useState as useState39 } from "react";
12567
+ import React146, { useContext as useContext20, useState as useState40 } from "react";
12567
12568
 
12568
12569
  // src/components/DatePicker/ModeSelector/DatePickerModeSelector.tsx
12569
12570
  import React145 from "react";
@@ -12620,7 +12621,7 @@ var ProfitAndLossDatePicker = ({
12620
12621
  const { refetch, compareMode, compareMonths } = useContext20(
12621
12622
  ProfitAndLoss.ComparisonContext
12622
12623
  );
12623
- const [datePickerMode, setDatePickerMode] = useState39(
12624
+ const [datePickerMode, setDatePickerMode] = useState40(
12624
12625
  (_a = defaultDatePickerMode != null ? defaultDatePickerMode : deprecated_datePickerMode) != null ? _a : "monthPicker"
12625
12626
  );
12626
12627
  const getComparisonData = (date) => {
@@ -12684,7 +12685,7 @@ var ProfitAndLossDatePicker = ({
12684
12685
  };
12685
12686
 
12686
12687
  // src/components/ProfitAndLossDetailedCharts/ProfitAndLossDetailedCharts.tsx
12687
- import React152, { useContext as useContext21, useState as useState40 } from "react";
12688
+ import React152, { useContext as useContext21, useState as useState41 } from "react";
12688
12689
 
12689
12690
  // src/icons/X.tsx
12690
12691
  import * as React147 from "react";
@@ -13376,7 +13377,7 @@ var ProfitAndLossDetailedCharts = ({
13376
13377
  const theScope = scope ? scope : sidebarScope;
13377
13378
  const data = theScope === "revenue" ? filteredDataRevenue : filteredDataExpenses;
13378
13379
  const total = theScope === "revenue" ? filteredTotalRevenue : filteredTotalExpenses;
13379
- const [hoveredItem, setHoveredItem] = useState40();
13380
+ const [hoveredItem, setHoveredItem] = useState41();
13380
13381
  return /* @__PURE__ */ React152.createElement("div", { className: "Layer__profit-and-loss-detailed-charts" }, /* @__PURE__ */ React152.createElement("header", { className: "Layer__profit-and-loss-detailed-charts__header" }, /* @__PURE__ */ React152.createElement("div", { className: "Layer__profit-and-loss-detailed-charts__head" }, /* @__PURE__ */ React152.createElement(Text, { size: "lg" /* lg */, weight: "bold" /* bold */, className: "title" }, humanizeTitle(theScope)), /* @__PURE__ */ React152.createElement(Text, { size: "sm" /* sm */, className: "date" }, format2(dateRange.startDate, "LLLL, y")), showDatePicker && /* @__PURE__ */ React152.createElement(ProfitAndLossDatePicker, null)), !hideClose && /* @__PURE__ */ React152.createElement(
13381
13382
  Button,
13382
13383
  {
@@ -13422,7 +13423,7 @@ var ProfitAndLossDetailedCharts = ({
13422
13423
  };
13423
13424
 
13424
13425
  // src/components/ProfitAndLossDownloadButton/ProfitAndLossDownloadButton.tsx
13425
- import React153, { useContext as useContext22, useState as useState41 } from "react";
13426
+ import React153, { useContext as useContext22, useState as useState42 } from "react";
13426
13427
  var ProfitAndLossDownloadButton = ({
13427
13428
  stringOverrides,
13428
13429
  useComparisonPnl = false,
@@ -13436,8 +13437,8 @@ var ProfitAndLossDownloadButton = ({
13436
13437
  const { businessId } = useLayerContext();
13437
13438
  const { apiUrl } = useEnvironment();
13438
13439
  const { data: auth } = useAuth();
13439
- const [requestFailed, setRequestFailed] = useState41(false);
13440
- const [isDownloading, setIsDownloading] = useState41(false);
13440
+ const [requestFailed, setRequestFailed] = useState42(false);
13441
+ const [isDownloading, setIsDownloading] = useState42(false);
13441
13442
  const handleClick = () => __async(void 0, null, function* () {
13442
13443
  var _a;
13443
13444
  setIsDownloading(true);
@@ -13557,7 +13558,7 @@ import classNames53 from "classnames";
13557
13558
  var HeaderCol = ({ className, children, style }) => /* @__PURE__ */ React158.createElement("div", { className: classNames53("Layer__header__col", className), style }, children);
13558
13559
 
13559
13560
  // src/components/Panel/Panel.tsx
13560
- import React159, { useEffect as useEffect31, useState as useState42 } from "react";
13561
+ import React159, { useEffect as useEffect31, useState as useState43 } from "react";
13561
13562
  import classNames54 from "classnames";
13562
13563
  var Panel = ({
13563
13564
  children,
@@ -13569,7 +13570,7 @@ var Panel = ({
13569
13570
  defaultSidebarHeight = false
13570
13571
  }) => {
13571
13572
  var _a;
13572
- const [sidebarHeight, setSidebarHeight] = useState42(0);
13573
+ const [sidebarHeight, setSidebarHeight] = useState43(0);
13573
13574
  useEffect31(() => {
13574
13575
  var _a2, _b;
13575
13576
  if ((_a2 = parentRef == null ? void 0 : parentRef.current) == null ? void 0 : _a2.offsetHeight) {
@@ -13970,7 +13971,7 @@ var ProfitAndLossSummaries = (props) => Internal_ProfitAndLossSummaries(props);
13970
13971
  import React177, { useContext as useContext28 } from "react";
13971
13972
 
13972
13973
  // src/contexts/TableContext/TableContext.tsx
13973
- import React168, { createContext as createContext12, useState as useState43 } from "react";
13974
+ import React168, { createContext as createContext12, useState as useState44 } from "react";
13974
13975
  var defaultValue = {
13975
13976
  expandedRows: [],
13976
13977
  setExpandedRows: () => {
@@ -13983,8 +13984,8 @@ var defaultValue = {
13983
13984
  };
13984
13985
  var TableContext = createContext12(defaultValue);
13985
13986
  var TableProvider = ({ children }) => {
13986
- const [expandedRows, setExpandedRowsState] = useState43([]);
13987
- const [expandedAllRows, setExpandedAllRows] = useState43(false);
13987
+ const [expandedRows, setExpandedRowsState] = useState44([]);
13988
+ const [expandedAllRows, setExpandedAllRows] = useState44(false);
13988
13989
  const toggleRow = (rowKey) => {
13989
13990
  setExpandedRowsState((prevRows) => {
13990
13991
  const rows = [...prevRows];
@@ -14650,7 +14651,7 @@ ProfitAndLoss.Report = ProfitAndLossReport;
14650
14651
  ProfitAndLoss.DownloadButton = ProfitAndLossDownloadButton;
14651
14652
 
14652
14653
  // src/components/BalanceSheet/BalanceSheet.tsx
14653
- import React182, { useEffect as useEffect38, useState as useState45 } from "react";
14654
+ import React182, { useEffect as useEffect38, useState as useState46 } from "react";
14654
14655
 
14655
14656
  // src/contexts/BalanceSheetContext/BalanceSheetContext.tsx
14656
14657
  import { createContext as createContext14 } from "react";
@@ -14698,10 +14699,10 @@ var useBalanceSheet = (date = /* @__PURE__ */ new Date()) => {
14698
14699
  };
14699
14700
 
14700
14701
  // src/hooks/useElementViewSize/useElementViewSize.tsx
14701
- import { useEffect as useEffect36, useLayoutEffect as useLayoutEffect3, useRef as useRef21, useState as useState44 } from "react";
14702
+ import { useEffect as useEffect36, useLayoutEffect as useLayoutEffect3, useRef as useRef21, useState as useState45 } from "react";
14702
14703
  var useElementViewSize = (callback) => {
14703
14704
  const ref = useRef21(null);
14704
- const [view, setView] = useState44("desktop");
14705
+ const [view, setView] = useState45("desktop");
14705
14706
  const resizeTimeout = useRef21(null);
14706
14707
  useLayoutEffect3(() => {
14707
14708
  const element = ref == null ? void 0 : ref.current;
@@ -14873,9 +14874,9 @@ var BalanceSheetView = ({
14873
14874
  asWidget = false,
14874
14875
  stringOverrides
14875
14876
  }) => {
14876
- const [effectiveDate, setEffectiveDate] = useState45(startOfDay2(/* @__PURE__ */ new Date()));
14877
+ const [effectiveDate, setEffectiveDate] = useState46(startOfDay2(/* @__PURE__ */ new Date()));
14877
14878
  const { data, isLoading, refetch } = useBalanceSheet(effectiveDate);
14878
- const [view, setView] = useState45("desktop");
14879
+ const [view, setView] = useState46("desktop");
14879
14880
  const containerRef = useElementViewSize(
14880
14881
  (newView) => setView(newView)
14881
14882
  );
@@ -14940,7 +14941,7 @@ var BalanceSheetView = ({
14940
14941
  };
14941
14942
 
14942
14943
  // src/components/StatementOfCashFlow/StatementOfCashFlow.tsx
14943
- import React184, { useState as useState46 } from "react";
14944
+ import React184, { useState as useState47 } from "react";
14944
14945
 
14945
14946
  // src/contexts/StatementOfCashContext/StatementOfCashFlowContext.tsx
14946
14947
  import { createContext as createContext15 } from "react";
@@ -15116,15 +15117,15 @@ var StatementOfCashFlowView = ({
15116
15117
  allowedDatePickerModes,
15117
15118
  customDateRanges
15118
15119
  }) => {
15119
- const [startDate, setStartDate] = useState46(
15120
+ const [startDate, setStartDate] = useState47(
15120
15121
  startOfDay4(subWeeks(/* @__PURE__ */ new Date(), 4))
15121
15122
  );
15122
- const [endDate, setEndDate] = useState46(startOfDay4(/* @__PURE__ */ new Date()));
15123
+ const [endDate, setEndDate] = useState47(startOfDay4(/* @__PURE__ */ new Date()));
15123
15124
  const { data, isLoading, refetch } = useStatementOfCashFlow(
15124
15125
  startDate,
15125
15126
  endDate
15126
15127
  );
15127
- const [datePickerMode, setDatePickerMode] = useState46(
15128
+ const [datePickerMode, setDatePickerMode] = useState47(
15128
15129
  deprecated_datePickerMode != null ? deprecated_datePickerMode : defaultDatePickerMode
15129
15130
  );
15130
15131
  const handleDateChange = (dates) => {
@@ -15189,7 +15190,7 @@ var StatementOfCashFlowView = ({
15189
15190
  };
15190
15191
 
15191
15192
  // src/components/ChartOfAccounts/ChartOfAccounts.tsx
15192
- import React199, { useContext as useContext36, useState as useState53 } from "react";
15193
+ import React199, { useContext as useContext36, useState as useState54 } from "react";
15193
15194
 
15194
15195
  // src/contexts/ChartOfAccountsContext/ChartOfAccountsContext.tsx
15195
15196
  import { createContext as createContext16 } from "react";
@@ -15248,7 +15249,7 @@ var LedgerAccountsContext = createContext17({
15248
15249
  });
15249
15250
 
15250
15251
  // src/hooks/useChartOfAccounts/useChartOfAccounts.tsx
15251
- import { useEffect as useEffect40, useState as useState47 } from "react";
15252
+ import { useEffect as useEffect40, useState as useState48 } from "react";
15252
15253
 
15253
15254
  // src/components/ChartOfAccountsForm/constants.ts
15254
15255
  var LEDGER_ACCOUNT_TYPES = [
@@ -15548,13 +15549,13 @@ var useChartOfAccounts = ({ withDates, startDate: initialStartDate, endDate: ini
15548
15549
  } = useLayerContext();
15549
15550
  const { apiUrl } = useEnvironment();
15550
15551
  const { data: auth } = useAuth();
15551
- const [form, setForm] = useState47();
15552
- const [sendingForm, setSendingForm] = useState47(false);
15553
- const [apiError, setApiError] = useState47(void 0);
15554
- const [startDate, setStartDate] = useState47(
15552
+ const [form, setForm] = useState48();
15553
+ const [sendingForm, setSendingForm] = useState48(false);
15554
+ const [apiError, setApiError] = useState48(void 0);
15555
+ const [startDate, setStartDate] = useState48(
15555
15556
  initialStartDate != null ? initialStartDate : startOfMonth15(Date.now())
15556
15557
  );
15557
- const [endDate, setEndDate] = useState47(
15558
+ const [endDate, setEndDate] = useState48(
15558
15559
  initialEndDate != null ? initialEndDate : endOfMonth12(Date.now())
15559
15560
  );
15560
15561
  const queryKey = businessId && (auth == null ? void 0 : auth.access_token) && `chart-of-accounts-${businessId}-${startDate == null ? void 0 : startDate.valueOf()}-${endDate == null ? void 0 : endDate.valueOf()}`;
@@ -15767,14 +15768,14 @@ var useChartOfAccounts = ({ withDates, startDate: initialStartDate, endDate: ini
15767
15768
  };
15768
15769
 
15769
15770
  // src/hooks/useLedgerAccounts/useLedgerAccounts.tsx
15770
- import { useEffect as useEffect41, useState as useState48 } from "react";
15771
+ import { useEffect as useEffect41, useState as useState49 } from "react";
15771
15772
  import useSWR9 from "swr";
15772
15773
  var useLedgerAccounts = (showReversalEntries = false) => {
15773
15774
  const { businessId, read, syncTimestamps, hasBeenTouched } = useLayerContext();
15774
15775
  const { apiUrl } = useEnvironment();
15775
15776
  const { data: auth } = useAuth();
15776
- const [accountId, setAccountId] = useState48();
15777
- const [selectedEntryId, setSelectedEntryId] = useState48();
15777
+ const [accountId, setAccountId] = useState49();
15778
+ const [selectedEntryId, setSelectedEntryId] = useState49();
15778
15779
  const queryKey = businessId && accountId && (auth == null ? void 0 : auth.access_token) && `ledger-accounts-lines-${businessId}-${accountId}`;
15779
15780
  const { data, isLoading, isValidating, error, mutate } = useSWR9(
15780
15781
  queryKey,
@@ -15832,7 +15833,7 @@ var useLedgerAccounts = (showReversalEntries = false) => {
15832
15833
  };
15833
15834
 
15834
15835
  // src/components/ChartOfAccountsTable/ChartOfAccountsTableWithPanel.tsx
15835
- import React191, { useContext as useContext32, useState as useState50 } from "react";
15836
+ import React191, { useContext as useContext32, useState as useState51 } from "react";
15836
15837
 
15837
15838
  // src/icons/Plus.tsx
15838
15839
  import * as React185 from "react";
@@ -16114,7 +16115,7 @@ var ChartOfAccountsSidebar = ({
16114
16115
  };
16115
16116
 
16116
16117
  // src/components/ChartOfAccountsTable/ChartOfAccountsTable.tsx
16117
- import React190, { useContext as useContext31, useEffect as useEffect42, useState as useState49 } from "react";
16118
+ import React190, { useContext as useContext31, useEffect as useEffect42, useState as useState50 } from "react";
16118
16119
 
16119
16120
  // src/icons/Edit2.tsx
16120
16121
  import * as React189 from "react";
@@ -16176,7 +16177,7 @@ var ChartOfAccountsTableContent = ({
16176
16177
  const { setAccountId } = useContext31(LedgerAccountsContext);
16177
16178
  const { editAccount } = useContext31(ChartOfAccountsContext);
16178
16179
  const { isOpen, setIsOpen } = useTableExpandRow();
16179
- const [accountsRowKeys, setAccountsRowKeys] = useState49([]);
16180
+ const [accountsRowKeys, setAccountsRowKeys] = useState50([]);
16180
16181
  useEffect42(() => {
16181
16182
  if (expandAll === "expanded") {
16182
16183
  setIsOpen(accountsRowKeys);
@@ -16278,7 +16279,7 @@ var ChartOfAccountsTableWithPanel = ({
16278
16279
  }) => {
16279
16280
  var _a;
16280
16281
  const { data, isLoading, addAccount, error, isValidating, refetch, form } = useContext32(ChartOfAccountsContext);
16281
- const [expandAll, setExpandAll] = useState50();
16282
+ const [expandAll, setExpandAll] = useState51();
16282
16283
  const cumulativeIndex = 0;
16283
16284
  const accountsLength = (_a = data == null ? void 0 : data.accounts.length) != null ? _a : 0;
16284
16285
  return /* @__PURE__ */ React191.createElement(
@@ -16371,7 +16372,7 @@ import React198, {
16371
16372
  useContext as useContext35,
16372
16373
  useEffect as useEffect44,
16373
16374
  useMemo as useMemo27,
16374
- useState as useState52
16375
+ useState as useState53
16375
16376
  } from "react";
16376
16377
 
16377
16378
  // src/components/LedgerAccountEntryDetails/LedgerAccountEntryDetails.tsx
@@ -16695,7 +16696,7 @@ var LedgerAccountEntryDetails = ({
16695
16696
  };
16696
16697
 
16697
16698
  // src/components/LedgerAccount/LedgerAccountRow.tsx
16698
- import React197, { useContext as useContext34, useEffect as useEffect43, useState as useState51 } from "react";
16699
+ import React197, { useContext as useContext34, useEffect as useEffect43, useState as useState52 } from "react";
16699
16700
  import classNames64 from "classnames";
16700
16701
  import { parseISO as parseISO13, format as formatTime11 } from "date-fns";
16701
16702
  var LedgerAccountRow = ({
@@ -16706,7 +16707,7 @@ var LedgerAccountRow = ({
16706
16707
  }) => {
16707
16708
  var _a, _b, _c, _d, _e, _f;
16708
16709
  const { selectedEntryId, setSelectedEntryId, closeSelectedEntry } = useContext34(LedgerAccountsContext);
16709
- const [showComponent, setShowComponent] = useState51(false);
16710
+ const [showComponent, setShowComponent] = useState52(false);
16710
16711
  useEffect43(() => {
16711
16712
  if (initialLoad) {
16712
16713
  const timeoutId = setTimeout(() => {
@@ -16817,8 +16818,8 @@ var LedgerAccount = ({
16817
16818
  stringOverrides
16818
16819
  }) => {
16819
16820
  var _a, _b, _c, _d, _e, _f, _g, _h;
16820
- const [currentPage, setCurrentPage] = useState52(1);
16821
- const [initialLoad, setInitialLoad] = useState52(true);
16821
+ const [currentPage, setCurrentPage] = useState53(1);
16822
+ const [initialLoad, setInitialLoad] = useState53(true);
16822
16823
  const { data: accountData } = useContext35(ChartOfAccountsContext);
16823
16824
  const {
16824
16825
  data: rawData,
@@ -16952,7 +16953,7 @@ var ChartOfAccountsContent = ({
16952
16953
  templateAccountsEditable
16953
16954
  }) => {
16954
16955
  const { accountId } = useContext36(LedgerAccountsContext);
16955
- const [view, setView] = useState53("desktop");
16956
+ const [view, setView] = useState54("desktop");
16956
16957
  const containerRef = useElementViewSize(
16957
16958
  (newView) => setView(newView)
16958
16959
  );
@@ -16978,7 +16979,7 @@ var ChartOfAccountsContent = ({
16978
16979
  };
16979
16980
 
16980
16981
  // src/components/Journal/Journal.tsx
16981
- import React206, { useState as useState57 } from "react";
16982
+ import React206, { useState as useState58 } from "react";
16982
16983
 
16983
16984
  // src/contexts/JournalContext/JournalContext.tsx
16984
16985
  import { createContext as createContext18 } from "react";
@@ -17016,7 +17017,7 @@ var JournalContext = createContext18({
17016
17017
  });
17017
17018
 
17018
17019
  // src/hooks/useJournal/useJournal.tsx
17019
- import { useEffect as useEffect45, useState as useState54 } from "react";
17020
+ import { useEffect as useEffect45, useState as useState55 } from "react";
17020
17021
  import useSWR10 from "swr";
17021
17022
  var useJournal = () => {
17022
17023
  const {
@@ -17028,11 +17029,11 @@ var useJournal = () => {
17028
17029
  } = useLayerContext();
17029
17030
  const { apiUrl } = useEnvironment();
17030
17031
  const { data: auth } = useAuth();
17031
- const [selectedEntryId, setSelectedEntryId] = useState54();
17032
- const [form, setForm] = useState54();
17033
- const [addingEntry, setAddingEntry] = useState54(false);
17034
- const [sendingForm, setSendingForm] = useState54(false);
17035
- const [apiError, setApiError] = useState54(void 0);
17032
+ const [selectedEntryId, setSelectedEntryId] = useState55();
17033
+ const [form, setForm] = useState55();
17034
+ const [addingEntry, setAddingEntry] = useState55(false);
17035
+ const [sendingForm, setSendingForm] = useState55(false);
17036
+ const [apiError, setApiError] = useState55(void 0);
17036
17037
  const queryKey = businessId && (auth == null ? void 0 : auth.access_token) && `journal-lines-${businessId}`;
17037
17038
  const { data, isLoading, isValidating, error, mutate } = useSWR10(
17038
17039
  queryKey,
@@ -17285,13 +17286,13 @@ var useJournal = () => {
17285
17286
  };
17286
17287
 
17287
17288
  // src/components/JournalTable/JournalTableWithPanel.tsx
17288
- import React205, { useContext as useContext42, useMemo as useMemo29, useState as useState56 } from "react";
17289
+ import React205, { useContext as useContext42, useMemo as useMemo29, useState as useState57 } from "react";
17289
17290
 
17290
17291
  // src/components/JournalSidebar/JournalSidebar.tsx
17291
17292
  import React203, { useContext as useContext40 } from "react";
17292
17293
 
17293
17294
  // src/components/JournalEntryDetails/JournalEntryDetails.tsx
17294
- import React200, { useContext as useContext37, useMemo as useMemo28, useState as useState55 } from "react";
17295
+ import React200, { useContext as useContext37, useMemo as useMemo28, useState as useState56 } from "react";
17295
17296
  var JournalEntryDetails = () => {
17296
17297
  var _a, _b, _c, _d;
17297
17298
  const {
@@ -17303,8 +17304,8 @@ var JournalEntryDetails = () => {
17303
17304
  reverseEntry,
17304
17305
  refetch
17305
17306
  } = useContext37(JournalContext);
17306
- const [reverseEntryProcessing, setReverseEntryProcessing] = useState55(false);
17307
- const [reverseEntryError, setReverseEntryError] = useState55();
17307
+ const [reverseEntryProcessing, setReverseEntryProcessing] = useState56(false);
17308
+ const [reverseEntryError, setReverseEntryError] = useState56();
17308
17309
  const entry = useMemo28(() => {
17309
17310
  if (selectedEntryId && data) {
17310
17311
  return data.find((x) => x.id === selectedEntryId);
@@ -17833,7 +17834,7 @@ var JournalTableWithPanel = ({
17833
17834
  stringOverrides,
17834
17835
  view
17835
17836
  }) => {
17836
- const [currentPage, setCurrentPage] = useState56(1);
17837
+ const [currentPage, setCurrentPage] = useState57(1);
17837
17838
  const {
17838
17839
  data: rawData,
17839
17840
  isLoading,
@@ -17945,7 +17946,7 @@ var JournalContent = ({
17945
17946
  config = JOURNAL_CONFIG,
17946
17947
  stringOverrides
17947
17948
  }) => {
17948
- const [view, setView] = useState57("desktop");
17949
+ const [view, setView] = useState58("desktop");
17949
17950
  const containerRef = useElementViewSize(
17950
17951
  (newView) => setView(newView)
17951
17952
  );
@@ -17966,7 +17967,7 @@ import React213, {
17966
17967
  useContext as useContext47,
17967
17968
  useEffect as useEffect49,
17968
17969
  useMemo as useMemo31,
17969
- useState as useState61
17970
+ useState as useState62
17970
17971
  } from "react";
17971
17972
 
17972
17973
  // src/contexts/TasksContext/TasksContext.tsx
@@ -17985,7 +17986,7 @@ var TasksContext = createContext19({
17985
17986
  });
17986
17987
 
17987
17988
  // src/hooks/useTasks/useTasks.tsx
17988
- import { useEffect as useEffect47, useState as useState58 } from "react";
17989
+ import { useEffect as useEffect47, useState as useState59 } from "react";
17989
17990
 
17990
17991
  // src/hooks/useTasks/mockData.ts
17991
17992
  var mockData = [
@@ -18027,7 +18028,7 @@ var mockData = [
18027
18028
  import useSWR11 from "swr";
18028
18029
  var DEBUG_MODE = false;
18029
18030
  var useTasks = () => {
18030
- const [loadedStatus, setLoadedStatus] = useState58("initial");
18031
+ const [loadedStatus, setLoadedStatus] = useState59("initial");
18031
18032
  const { businessId, read, syncTimestamps, hasBeenTouched } = useLayerContext();
18032
18033
  const { apiUrl } = useEnvironment();
18033
18034
  const { data: auth } = useAuth();
@@ -18234,7 +18235,7 @@ var TasksHeader = ({
18234
18235
  };
18235
18236
 
18236
18237
  // src/components/TasksList/TasksList.tsx
18237
- import React211, { useContext as useContext45, useMemo as useMemo30, useState as useState60 } from "react";
18238
+ import React211, { useContext as useContext45, useMemo as useMemo30, useState as useState61 } from "react";
18238
18239
 
18239
18240
  // src/icons/SmileIcon.tsx
18240
18241
  import * as React209 from "react";
@@ -18291,15 +18292,15 @@ var SmileIcon = (_a) => {
18291
18292
  var SmileIcon_default = SmileIcon;
18292
18293
 
18293
18294
  // src/components/TasksListItem/TasksListItem.tsx
18294
- import React210, { useContext as useContext44, useEffect as useEffect48, useState as useState59 } from "react";
18295
+ import React210, { useContext as useContext44, useEffect as useEffect48, useState as useState60 } from "react";
18295
18296
  import classNames66 from "classnames";
18296
18297
  var TasksListItem = ({
18297
18298
  task,
18298
18299
  goToNextPageIfAllComplete,
18299
18300
  defaultOpen
18300
18301
  }) => {
18301
- const [isOpen, setIsOpen] = useState59(defaultOpen);
18302
- const [userResponse, setUserResponse] = useState59(task.user_response || "");
18302
+ const [isOpen, setIsOpen] = useState60(defaultOpen);
18303
+ const [userResponse, setUserResponse] = useState60(task.user_response || "");
18303
18304
  const { submitResponseToTask: submitResponseToTask2, uploadDocumentForTask } = useContext44(TasksContext);
18304
18305
  const taskBodyClassName = classNames66(
18305
18306
  "Layer__tasks-list-item__body",
@@ -18382,7 +18383,7 @@ var TasksList = ({ pageSize = 10 }) => {
18382
18383
  tasks || [],
18383
18384
  pageSize
18384
18385
  ).findIndex((page) => page.some((task) => !isComplete(task.status)));
18385
- const [currentPage, setCurrentPage] = useState60(
18386
+ const [currentPage, setCurrentPage] = useState61(
18386
18387
  firstPageWithIincompleteTasks === -1 ? 1 : firstPageWithIincompleteTasks + 1
18387
18388
  );
18388
18389
  const sortedTasks = useMemo30(() => {
@@ -18525,7 +18526,7 @@ var TasksComponent = ({
18525
18526
  }
18526
18527
  return false;
18527
18528
  }, [data, isLoading]);
18528
- const [open, setOpen] = useState61(
18529
+ const [open, setOpen] = useState62(
18529
18530
  defaultCollapsed || collapsedWhenComplete ? false : true
18530
18531
  );
18531
18532
  useEffect49(() => {
@@ -18702,7 +18703,7 @@ var BookkeepingUpsellBar = ({
18702
18703
  };
18703
18704
 
18704
18705
  // src/views/BookkeepingOverview/BookkeepingOverview.tsx
18705
- import React218, { useState as useState62 } from "react";
18706
+ import React218, { useState as useState63 } from "react";
18706
18707
 
18707
18708
  // src/views/BookkeepingOverview/internal/BookkeepingProfitAndLossSummariesContainer.tsx
18708
18709
  import React217 from "react";
@@ -18722,7 +18723,7 @@ var BookkeepingOverview = ({
18722
18723
  slotProps
18723
18724
  }) => {
18724
18725
  var _a, _b, _c, _d, _e, _f;
18725
- const [pnlToggle, setPnlToggle] = useState62("expenses");
18726
+ const [pnlToggle, setPnlToggle] = useState63("expenses");
18726
18727
  const [width] = useWindowSize();
18727
18728
  const profitAndLossSummariesVariants = (_b = (_a = slotProps == null ? void 0 : slotProps.profitAndLoss) == null ? void 0 : _a.summaries) == null ? void 0 : _b.variants;
18728
18729
  return /* @__PURE__ */ React218.createElement(ProfitAndLoss, { asContainer: false }, /* @__PURE__ */ React218.createElement(TasksProvider, null, /* @__PURE__ */ React218.createElement(
@@ -18819,10 +18820,10 @@ var BookkeepingOverview = ({
18819
18820
  };
18820
18821
 
18821
18822
  // src/views/AccountingOverview/AccountingOverview.tsx
18822
- import React221, { useState as useState64 } from "react";
18823
+ import React221, { useState as useState65 } from "react";
18823
18824
 
18824
18825
  // src/views/AccountingOverview/internal/TransactionsToReview.tsx
18825
- import React220, { useContext as useContext49, useEffect as useEffect50, useState as useState63 } from "react";
18826
+ import React220, { useContext as useContext49, useEffect as useEffect50, useState as useState64 } from "react";
18826
18827
 
18827
18828
  // src/components/BadgeLoader/BadgeLoader.tsx
18828
18829
  import React219 from "react";
@@ -18842,7 +18843,7 @@ function TransactionsToReview({
18842
18843
  const { size = "sm" } = variants != null ? variants : {};
18843
18844
  const { dateRange: contextDateRange } = useContext49(ProfitAndLoss.Context);
18844
18845
  const dateRange = usePnlDateRange ? contextDateRange : void 0;
18845
- const [toReview, setToReview] = useState63(0);
18846
+ const [toReview, setToReview] = useState64(0);
18846
18847
  const { data, loaded, error, refetch } = useProfitAndLossLTM({
18847
18848
  currentDate: dateRange ? dateRange.startDate : startOfMonth17(/* @__PURE__ */ new Date()),
18848
18849
  tagFilter
@@ -18917,7 +18918,7 @@ var AccountingOverview = ({
18917
18918
  slotProps
18918
18919
  }) => {
18919
18920
  var _a, _b, _c, _d, _e;
18920
- const [pnlToggle, setPnlToggle] = useState64("expenses");
18921
+ const [pnlToggle, setPnlToggle] = useState65("expenses");
18921
18922
  const profitAndLossSummariesVariants = (_b = (_a = slotProps == null ? void 0 : slotProps.profitAndLoss) == null ? void 0 : _a.summaries) == null ? void 0 : _b.variants;
18922
18923
  return /* @__PURE__ */ React221.createElement(
18923
18924
  ProfitAndLoss,
@@ -19086,7 +19087,7 @@ var BankTransactionsWithLinkedAccounts = ({
19086
19087
  };
19087
19088
 
19088
19089
  // src/views/GeneralLedger/GeneralLedger.tsx
19089
- import React223, { useState as useState65 } from "react";
19090
+ import React223, { useState as useState66 } from "react";
19090
19091
  var GeneralLedgerView = ({
19091
19092
  title,
19092
19093
  // deprecated
@@ -19094,7 +19095,7 @@ var GeneralLedgerView = ({
19094
19095
  stringOverrides,
19095
19096
  chartOfAccountsOptions
19096
19097
  }) => {
19097
- const [activeTab, setActiveTab] = useState65("chartOfAccounts");
19098
+ const [activeTab, setActiveTab] = useState66("chartOfAccounts");
19098
19099
  return /* @__PURE__ */ React223.createElement(ProfitAndLoss, { asContainer: false }, /* @__PURE__ */ React223.createElement(
19099
19100
  View,
19100
19101
  {
@@ -19133,7 +19134,7 @@ var GeneralLedgerView = ({
19133
19134
  };
19134
19135
 
19135
19136
  // src/views/ProjectProfitability/ProjectProfitability.tsx
19136
- import React224, { useState as useState66 } from "react";
19137
+ import React224, { useState as useState67 } from "react";
19137
19138
  import Select4 from "react-select";
19138
19139
  var ProjectProfitabilityView = ({
19139
19140
  valueOptions,
@@ -19142,9 +19143,9 @@ var ProjectProfitabilityView = ({
19142
19143
  datePickerMode = "monthPicker",
19143
19144
  csvMoneyFormat = "DOLLAR_STRING"
19144
19145
  }) => {
19145
- const [activeTab, setActiveTab] = useState66("overview");
19146
- const [tagFilter, setTagFilter] = useState66(null);
19147
- const [pnlTagFilter, setPnlTagFilter] = useState66(
19146
+ const [activeTab, setActiveTab] = useState67("overview");
19147
+ const [tagFilter, setTagFilter] = useState67(null);
19148
+ const [pnlTagFilter, setPnlTagFilter] = useState67(
19148
19149
  void 0
19149
19150
  );
19150
19151
  const isOptionSelected = (option, selectValue) => {
@@ -19235,7 +19236,7 @@ var ProjectProfitabilityView = ({
19235
19236
  };
19236
19237
 
19237
19238
  // src/views/Reports/Reports.tsx
19238
- import React225, { useState as useState67 } from "react";
19239
+ import React225, { useState as useState68 } from "react";
19239
19240
  var getOptions = (enabledReports) => {
19240
19241
  return [
19241
19242
  enabledReports.includes("profitAndLoss") ? {
@@ -19262,8 +19263,8 @@ var Reports = ({
19262
19263
  statementOfCashFlowConfig
19263
19264
  }) => {
19264
19265
  var _a;
19265
- const [activeTab, setActiveTab] = useState67(enabledReports[0]);
19266
- const [view, setView] = useState67("desktop");
19266
+ const [activeTab, setActiveTab] = useState68(enabledReports[0]);
19267
+ const [view, setView] = useState68("desktop");
19267
19268
  const containerRef = useElementViewSize(
19268
19269
  (newView) => setView(newView)
19269
19270
  );