@layerfi/components 0.1.112-alpha.4 → 0.1.112-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +1205 -1045
- package/dist/esm/index.mjs +1205 -1045
- package/dist/index.css +520 -495
- package/dist/index.d.ts +1 -2
- package/package.json +3 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -69,6 +69,8 @@ const useSWRMutation = require("swr/mutation");
|
|
|
69
69
|
const react$1 = require("@floating-ui/react");
|
|
70
70
|
const lucideReact = require("lucide-react");
|
|
71
71
|
const reactAriaComponents = require("react-aria-components");
|
|
72
|
+
const useResizeObserver = require("@react-hook/resize-observer");
|
|
73
|
+
const reactMergeRefs = require("react-merge-refs");
|
|
72
74
|
const Select$1 = require("react-select");
|
|
73
75
|
const CurrencyInput = require("react-currency-input-field");
|
|
74
76
|
const RDP = require("react-datepicker");
|
|
@@ -128,7 +130,7 @@ const LinkedAccountsContext = react.createContext({
|
|
|
128
130
|
setAccountsToAddOpeningBalanceInModal: () => {
|
|
129
131
|
}
|
|
130
132
|
});
|
|
131
|
-
const version = "0.1.112-alpha.
|
|
133
|
+
const version = "0.1.112-alpha.5";
|
|
132
134
|
const pkg = {
|
|
133
135
|
version
|
|
134
136
|
};
|
|
@@ -2692,6 +2694,36 @@ class PlaceholderAsOption extends BaseCategorizationOption {
|
|
|
2692
2694
|
return null;
|
|
2693
2695
|
}
|
|
2694
2696
|
}
|
|
2697
|
+
class SplitAsOption extends BaseCategorizationOption {
|
|
2698
|
+
constructor(splits) {
|
|
2699
|
+
super(splits);
|
|
2700
|
+
}
|
|
2701
|
+
get original() {
|
|
2702
|
+
return this.internalValue;
|
|
2703
|
+
}
|
|
2704
|
+
get type() {
|
|
2705
|
+
return "Split";
|
|
2706
|
+
}
|
|
2707
|
+
get label() {
|
|
2708
|
+
return this.internalValue.map((split) => {
|
|
2709
|
+
var _a, _b;
|
|
2710
|
+
return (_b = (_a = split.category) == null ? void 0 : _a.label) != null ? _b : "Uncategorized";
|
|
2711
|
+
}).join(", ");
|
|
2712
|
+
}
|
|
2713
|
+
get value() {
|
|
2714
|
+
var _a, _b;
|
|
2715
|
+
if (this.internalValue.length == 1) {
|
|
2716
|
+
return (_b = (_a = this.internalValue[0].category) == null ? void 0 : _a.value) != null ? _b : "";
|
|
2717
|
+
}
|
|
2718
|
+
return "split";
|
|
2719
|
+
}
|
|
2720
|
+
get classification() {
|
|
2721
|
+
return null;
|
|
2722
|
+
}
|
|
2723
|
+
get classificationEncoded() {
|
|
2724
|
+
return null;
|
|
2725
|
+
}
|
|
2726
|
+
}
|
|
2695
2727
|
class ApiCategorizationAsOption extends BaseCategorizationOption {
|
|
2696
2728
|
constructor(categorization) {
|
|
2697
2729
|
super(categorization);
|
|
@@ -5404,19 +5436,6 @@ const hasMatch = (bankTransaction) => {
|
|
|
5404
5436
|
);
|
|
5405
5437
|
};
|
|
5406
5438
|
const isCredit = ({ direction }) => direction === Direction.CREDIT;
|
|
5407
|
-
const isAlreadyMatched$1 = (bankTransaction) => {
|
|
5408
|
-
var _a;
|
|
5409
|
-
if (bankTransaction == null ? void 0 : bankTransaction.match) {
|
|
5410
|
-
const foundMatch = (_a = bankTransaction.suggested_matches) == null ? void 0 : _a.find(
|
|
5411
|
-
(x) => {
|
|
5412
|
-
var _a2;
|
|
5413
|
-
return x.details.id === ((_a2 = bankTransaction == null ? void 0 : bankTransaction.match) == null ? void 0 : _a2.details.id);
|
|
5414
|
-
}
|
|
5415
|
-
);
|
|
5416
|
-
return foundMatch == null ? void 0 : foundMatch.id;
|
|
5417
|
-
}
|
|
5418
|
-
return void 0;
|
|
5419
|
-
};
|
|
5420
5439
|
const countTransactionsToReview = ({
|
|
5421
5440
|
transactions,
|
|
5422
5441
|
dateRange
|
|
@@ -5448,6 +5467,19 @@ const hasSuggestedTransferMatches = (bankTransaction) => {
|
|
|
5448
5467
|
var _a, _b;
|
|
5449
5468
|
return (_b = (_a = bankTransaction == null ? void 0 : bankTransaction.suggested_matches) == null ? void 0 : _a.every((x) => x.details.type === "Transfer_Match")) != null ? _b : false;
|
|
5450
5469
|
};
|
|
5470
|
+
const getBankTransactionMatchAsSuggestedMatch = (bankTransaction) => {
|
|
5471
|
+
var _a;
|
|
5472
|
+
if (bankTransaction == null ? void 0 : bankTransaction.match) {
|
|
5473
|
+
const foundMatch = (_a = bankTransaction.suggested_matches) == null ? void 0 : _a.find(
|
|
5474
|
+
(x) => {
|
|
5475
|
+
var _a2, _b;
|
|
5476
|
+
return x.details.id === ((_a2 = bankTransaction == null ? void 0 : bankTransaction.match) == null ? void 0 : _a2.details.id) || x.details.id === ((_b = bankTransaction == null ? void 0 : bankTransaction.match) == null ? void 0 : _b.bank_transaction.id);
|
|
5477
|
+
}
|
|
5478
|
+
);
|
|
5479
|
+
return foundMatch;
|
|
5480
|
+
}
|
|
5481
|
+
return void 0;
|
|
5482
|
+
};
|
|
5451
5483
|
const ChevronRight = (_k) => {
|
|
5452
5484
|
var props = __objRest(_k, []);
|
|
5453
5485
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5636,7 +5668,7 @@ function toDataProperties(input) {
|
|
|
5636
5668
|
);
|
|
5637
5669
|
return unsafeProperties;
|
|
5638
5670
|
}
|
|
5639
|
-
const
|
|
5671
|
+
const DeprecatedTooltip = (_n) => {
|
|
5640
5672
|
var _o = _n, {
|
|
5641
5673
|
children
|
|
5642
5674
|
} = _o, options2 = __objRest(_o, [
|
|
@@ -5645,7 +5677,7 @@ const Tooltip = (_n) => {
|
|
|
5645
5677
|
const tooltip = useTooltip(options2);
|
|
5646
5678
|
return /* @__PURE__ */ jsxRuntime.jsx(TooltipContext.Provider, { value: tooltip, children });
|
|
5647
5679
|
};
|
|
5648
|
-
const
|
|
5680
|
+
const DeprecatedTooltipTrigger = react.forwardRef(function TooltipTrigger(_p, propRef) {
|
|
5649
5681
|
var _q = _p, { children, asChild = false } = _q, props = __objRest(_q, ["children", "asChild"]);
|
|
5650
5682
|
const context = useTooltipContext();
|
|
5651
5683
|
const childrenRef = react.isValidElement(children) && "ref" in children ? children.ref : null;
|
|
@@ -5672,7 +5704,7 @@ const TooltipTrigger = react.forwardRef(function TooltipTrigger2(_p, propRef) {
|
|
|
5672
5704
|
})
|
|
5673
5705
|
);
|
|
5674
5706
|
});
|
|
5675
|
-
const
|
|
5707
|
+
const DeprecatedTooltipContent = react.forwardRef(function TooltipContent(_r, propRef) {
|
|
5676
5708
|
var _s = _r, { className, width } = _s, props = __objRest(_s, ["className", "width"]);
|
|
5677
5709
|
const context = useTooltipContext();
|
|
5678
5710
|
const ref = react$1.useMergeRefs([context.refs.setFloating, propRef]);
|
|
@@ -5778,9 +5810,9 @@ const Button$1 = (_t) => {
|
|
|
5778
5810
|
onMouseEnter: startAnimation,
|
|
5779
5811
|
onMouseLeave: stopAnimation,
|
|
5780
5812
|
ref: buttonRef,
|
|
5781
|
-
children: tooltip ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5782
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5783
|
-
tooltip && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5813
|
+
children: tooltip ? /* @__PURE__ */ jsxRuntime.jsxs(DeprecatedTooltip, { offset: 12, children: [
|
|
5814
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipTrigger, { children: content }),
|
|
5815
|
+
tooltip && /* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", children: tooltip })
|
|
5784
5816
|
] }) : content
|
|
5785
5817
|
})
|
|
5786
5818
|
);
|
|
@@ -6045,9 +6077,9 @@ const buildRightIcon = ({
|
|
|
6045
6077
|
return /* @__PURE__ */ jsxRuntime.jsx(Loader$1, { size: 14, className: "Layer__anim--rotating" });
|
|
6046
6078
|
}
|
|
6047
6079
|
if (error) {
|
|
6048
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6049
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6050
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6080
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(DeprecatedTooltip, { offset: 12, children: [
|
|
6081
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipTrigger, { children: /* @__PURE__ */ jsxRuntime.jsx(AlertCircle, { size: 14 }) }),
|
|
6082
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", children: error })
|
|
6051
6083
|
] });
|
|
6052
6084
|
}
|
|
6053
6085
|
if (action === "upload") {
|
|
@@ -6479,7 +6511,7 @@ const Text = (_Z) => {
|
|
|
6479
6511
|
children,
|
|
6480
6512
|
size = "md",
|
|
6481
6513
|
weight = "normal",
|
|
6482
|
-
withTooltip,
|
|
6514
|
+
withDeprecatedTooltip: withTooltip,
|
|
6483
6515
|
ellipsis,
|
|
6484
6516
|
status,
|
|
6485
6517
|
pb,
|
|
@@ -6490,7 +6522,7 @@ const Text = (_Z) => {
|
|
|
6490
6522
|
"children",
|
|
6491
6523
|
"size",
|
|
6492
6524
|
"weight",
|
|
6493
|
-
"
|
|
6525
|
+
"withDeprecatedTooltip",
|
|
6494
6526
|
"ellipsis",
|
|
6495
6527
|
"status",
|
|
6496
6528
|
"pb",
|
|
@@ -6503,13 +6535,13 @@ const Text = (_Z) => {
|
|
|
6503
6535
|
);
|
|
6504
6536
|
if (withTooltip) {
|
|
6505
6537
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6506
|
-
|
|
6538
|
+
DeprecatedTextWithTooltip,
|
|
6507
6539
|
__spreadProps(__spreadValues(__spreadValues({
|
|
6508
6540
|
as: Component,
|
|
6509
6541
|
className: baseClassName2,
|
|
6510
6542
|
size,
|
|
6511
6543
|
weight,
|
|
6512
|
-
withTooltip
|
|
6544
|
+
withDeprecatedTooltip: withTooltip
|
|
6513
6545
|
}, dataProperties), props), {
|
|
6514
6546
|
children
|
|
6515
6547
|
})
|
|
@@ -6517,14 +6549,14 @@ const Text = (_Z) => {
|
|
|
6517
6549
|
}
|
|
6518
6550
|
return /* @__PURE__ */ jsxRuntime.jsx(Component, __spreadProps(__spreadValues(__spreadValues({}, props), dataProperties), { className: baseClassName2, children }));
|
|
6519
6551
|
};
|
|
6520
|
-
const
|
|
6552
|
+
const DeprecatedTextWithTooltip = (_$) => {
|
|
6521
6553
|
var _aa = _$, {
|
|
6522
6554
|
as: Component = "p",
|
|
6523
6555
|
className,
|
|
6524
6556
|
children,
|
|
6525
6557
|
size: _size = "md",
|
|
6526
6558
|
weight: _weight = "normal",
|
|
6527
|
-
|
|
6559
|
+
withDeprecatedTooltip: _withTooltip = "whenTruncated",
|
|
6528
6560
|
tooltipOptions
|
|
6529
6561
|
} = _aa, props = __objRest(_aa, [
|
|
6530
6562
|
"as",
|
|
@@ -6532,7 +6564,7 @@ const TextWithTooltip = (_$) => {
|
|
|
6532
6564
|
"children",
|
|
6533
6565
|
"size",
|
|
6534
6566
|
"weight",
|
|
6535
|
-
"
|
|
6567
|
+
"withDeprecatedTooltip",
|
|
6536
6568
|
"tooltipOptions"
|
|
6537
6569
|
]);
|
|
6538
6570
|
const textElementRef = react.useRef();
|
|
@@ -6558,14 +6590,14 @@ const TextWithTooltip = (_$) => {
|
|
|
6558
6590
|
tooltipOptions == null ? void 0 : tooltipOptions.contentClassName
|
|
6559
6591
|
);
|
|
6560
6592
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6561
|
-
|
|
6593
|
+
DeprecatedTooltip,
|
|
6562
6594
|
{
|
|
6563
6595
|
disabled: !hoverStatus,
|
|
6564
6596
|
offset: tooltipOptions == null ? void 0 : tooltipOptions.offset,
|
|
6565
6597
|
shift: tooltipOptions == null ? void 0 : tooltipOptions.shift,
|
|
6566
6598
|
children: [
|
|
6567
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6568
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6599
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipTrigger, { children: /* @__PURE__ */ jsxRuntime.jsx(Component, __spreadProps(__spreadValues({ className, ref: textElementRef }, props), { children })) }),
|
|
6600
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipContent, { className: contentClassName, children })
|
|
6569
6601
|
]
|
|
6570
6602
|
}
|
|
6571
6603
|
);
|
|
@@ -6693,9 +6725,9 @@ const Badge = ({
|
|
|
6693
6725
|
] });
|
|
6694
6726
|
content = onClick ? /* @__PURE__ */ jsxRuntime.jsx("button", __spreadProps(__spreadValues({ type: "button", role: "button" }, baseProps), { children: content })) : /* @__PURE__ */ jsxRuntime.jsx("span", __spreadProps(__spreadValues({}, baseProps), { children: content }));
|
|
6695
6727
|
if (tooltip) {
|
|
6696
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6697
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6698
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6728
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(DeprecatedTooltip, { offset: 12, children: [
|
|
6729
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipTrigger, { children: content }),
|
|
6730
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", children: tooltip })
|
|
6699
6731
|
] });
|
|
6700
6732
|
}
|
|
6701
6733
|
return content;
|
|
@@ -7568,6 +7600,165 @@ const MenuItem$1 = react.forwardRef(
|
|
|
7568
7600
|
);
|
|
7569
7601
|
}
|
|
7570
7602
|
);
|
|
7603
|
+
function useTruncationDetection(elementRef, options2 = {
|
|
7604
|
+
dependencies: [],
|
|
7605
|
+
checkFirstChild: false
|
|
7606
|
+
}) {
|
|
7607
|
+
const { checkFirstChild = false, dependencies = [] } = options2;
|
|
7608
|
+
const [isTruncated, setIsTruncated] = react.useState(false);
|
|
7609
|
+
const checkTruncation = react.useCallback(() => {
|
|
7610
|
+
if (!elementRef || !elementRef.current) {
|
|
7611
|
+
return;
|
|
7612
|
+
}
|
|
7613
|
+
const element = checkFirstChild ? elementRef.current.children[0] : elementRef.current;
|
|
7614
|
+
if (!element) {
|
|
7615
|
+
return;
|
|
7616
|
+
}
|
|
7617
|
+
const scrollWidth = element.scrollWidth;
|
|
7618
|
+
const clientWidth = element.clientWidth;
|
|
7619
|
+
const scrollHeight = element.scrollHeight;
|
|
7620
|
+
const clientHeight = element.clientHeight;
|
|
7621
|
+
const isHorizontallyOverflowing = Math.ceil(scrollWidth) > Math.ceil(clientWidth);
|
|
7622
|
+
const isVerticallyOverflowing = Math.ceil(scrollHeight) > Math.ceil(clientHeight);
|
|
7623
|
+
const isOverflowing = isHorizontallyOverflowing || isVerticallyOverflowing;
|
|
7624
|
+
setIsTruncated(isOverflowing);
|
|
7625
|
+
}, [elementRef, checkFirstChild, ...dependencies]);
|
|
7626
|
+
const DEBOUNCE_TIME_IN_MS = 450;
|
|
7627
|
+
const debouncedCheckTruncation = react.useMemo(
|
|
7628
|
+
() => lodash.debounce(checkTruncation, DEBOUNCE_TIME_IN_MS),
|
|
7629
|
+
[checkTruncation]
|
|
7630
|
+
);
|
|
7631
|
+
useResizeObserver(elementRef, debouncedCheckTruncation);
|
|
7632
|
+
react.useEffect(() => {
|
|
7633
|
+
const id = requestAnimationFrame(() => checkTruncation());
|
|
7634
|
+
return () => cancelAnimationFrame(id);
|
|
7635
|
+
}, [checkTruncation]);
|
|
7636
|
+
return isTruncated;
|
|
7637
|
+
}
|
|
7638
|
+
const CLASS_NAME$d = "Layer__Stack";
|
|
7639
|
+
const Stack = react.forwardRef(
|
|
7640
|
+
function Stack2(_na, ref) {
|
|
7641
|
+
var _oa = _na, {
|
|
7642
|
+
align,
|
|
7643
|
+
children,
|
|
7644
|
+
className,
|
|
7645
|
+
direction,
|
|
7646
|
+
gap,
|
|
7647
|
+
justify,
|
|
7648
|
+
overflow,
|
|
7649
|
+
pb,
|
|
7650
|
+
pbs,
|
|
7651
|
+
pbe,
|
|
7652
|
+
pi,
|
|
7653
|
+
pis,
|
|
7654
|
+
pie,
|
|
7655
|
+
fluid
|
|
7656
|
+
} = _oa, restProps = __objRest(_oa, [
|
|
7657
|
+
"align",
|
|
7658
|
+
"children",
|
|
7659
|
+
"className",
|
|
7660
|
+
"direction",
|
|
7661
|
+
"gap",
|
|
7662
|
+
"justify",
|
|
7663
|
+
"overflow",
|
|
7664
|
+
"pb",
|
|
7665
|
+
"pbs",
|
|
7666
|
+
"pbe",
|
|
7667
|
+
"pi",
|
|
7668
|
+
"pis",
|
|
7669
|
+
"pie",
|
|
7670
|
+
"fluid"
|
|
7671
|
+
]);
|
|
7672
|
+
const dataProperties = toDataProperties({
|
|
7673
|
+
align,
|
|
7674
|
+
direction,
|
|
7675
|
+
gap,
|
|
7676
|
+
justify,
|
|
7677
|
+
overflow,
|
|
7678
|
+
pb,
|
|
7679
|
+
pbs,
|
|
7680
|
+
pbe,
|
|
7681
|
+
pi,
|
|
7682
|
+
pis,
|
|
7683
|
+
pie,
|
|
7684
|
+
fluid
|
|
7685
|
+
});
|
|
7686
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7687
|
+
"div",
|
|
7688
|
+
__spreadProps(__spreadValues(__spreadValues({
|
|
7689
|
+
ref
|
|
7690
|
+
}, restProps), dataProperties), {
|
|
7691
|
+
className: classNames(CLASS_NAME$d, className),
|
|
7692
|
+
children
|
|
7693
|
+
})
|
|
7694
|
+
);
|
|
7695
|
+
}
|
|
7696
|
+
);
|
|
7697
|
+
const VStack = react.forwardRef(
|
|
7698
|
+
function VStack2(props, ref) {
|
|
7699
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Stack, __spreadProps(__spreadValues({}, props), { ref, direction: "column" }));
|
|
7700
|
+
}
|
|
7701
|
+
);
|
|
7702
|
+
const HStack = react.forwardRef(
|
|
7703
|
+
function HStack2(props, ref) {
|
|
7704
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Stack, __spreadProps(__spreadValues({}, props), { ref, direction: "row" }));
|
|
7705
|
+
}
|
|
7706
|
+
);
|
|
7707
|
+
const Spacer = () => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__Spacer" });
|
|
7708
|
+
const Tooltip = (_pa) => {
|
|
7709
|
+
var _qa = _pa, {
|
|
7710
|
+
children
|
|
7711
|
+
} = _qa, options2 = __objRest(_qa, [
|
|
7712
|
+
"children"
|
|
7713
|
+
]);
|
|
7714
|
+
const tooltip = useTooltip(options2);
|
|
7715
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TooltipContext.Provider, { value: tooltip, children });
|
|
7716
|
+
};
|
|
7717
|
+
const TooltipTrigger2 = react.forwardRef(function TooltipTrigger22(_ra, propRef) {
|
|
7718
|
+
var _sa = _ra, { children, asChild = false, wordBreak } = _sa, props = __objRest(_sa, ["children", "asChild", "wordBreak"]);
|
|
7719
|
+
const context = useTooltipContext();
|
|
7720
|
+
const childrenRef = react.isValidElement(children) && "ref" in children ? children.ref : null;
|
|
7721
|
+
const ref = react$1.useMergeRefs([context.refs.setReference, propRef, childrenRef]);
|
|
7722
|
+
if (asChild && react.isValidElement(children)) {
|
|
7723
|
+
return react.cloneElement(
|
|
7724
|
+
children,
|
|
7725
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
7726
|
+
context.getReferenceProps(__spreadProps(__spreadValues(__spreadValues({
|
|
7727
|
+
ref
|
|
7728
|
+
}, props), children.props), {
|
|
7729
|
+
"data-state": context.open ? "open" : "closed",
|
|
7730
|
+
"data-word-break": wordBreak
|
|
7731
|
+
}))
|
|
7732
|
+
);
|
|
7733
|
+
}
|
|
7734
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7735
|
+
HStack,
|
|
7736
|
+
__spreadProps(__spreadValues({
|
|
7737
|
+
ref,
|
|
7738
|
+
"data-state": context.open ? "open" : "closed",
|
|
7739
|
+
className: classNames("Layer__UI__tooltip-trigger")
|
|
7740
|
+
}, context.getReferenceProps(props)), {
|
|
7741
|
+
children
|
|
7742
|
+
})
|
|
7743
|
+
);
|
|
7744
|
+
});
|
|
7745
|
+
const TooltipContent2 = react.forwardRef(function TooltipContent22(_ta, propRef) {
|
|
7746
|
+
var _ua = _ta, { className, width, wordBreak } = _ua, props = __objRest(_ua, ["className", "width", "wordBreak"]);
|
|
7747
|
+
const context = useTooltipContext();
|
|
7748
|
+
const ref = react$1.useMergeRefs([context.refs.setFloating, propRef]);
|
|
7749
|
+
const dataProperties = toDataProperties({ width, "word-break": wordBreak });
|
|
7750
|
+
if (!context.open || context.disabled) return null;
|
|
7751
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react$1.FloatingPortal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7752
|
+
"div",
|
|
7753
|
+
__spreadProps(__spreadValues(__spreadValues({
|
|
7754
|
+
ref,
|
|
7755
|
+
className: classNames("Layer__UI__tooltip", className),
|
|
7756
|
+
style: __spreadValues({}, context.floatingStyles)
|
|
7757
|
+
}, dataProperties), context.getFloatingProps(props)), {
|
|
7758
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__UI__tooltip-content", style: __spreadValues({}, context.styles), children: props.children })
|
|
7759
|
+
})
|
|
7760
|
+
) });
|
|
7761
|
+
});
|
|
7571
7762
|
function splitTextProps(props) {
|
|
7572
7763
|
const _a = props, {
|
|
7573
7764
|
align,
|
|
@@ -7641,13 +7832,50 @@ const P = react.forwardRef(
|
|
|
7641
7832
|
}
|
|
7642
7833
|
);
|
|
7643
7834
|
const SPAN_CLASS_NAME = "Layer__Span";
|
|
7835
|
+
const BaseSpan = react.forwardRef(({ dataProperties, restProps, hasRef, className, renderingProps, children }, ref) => {
|
|
7836
|
+
if (renderingProps.nonAria) {
|
|
7837
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), { className: classNames(SPAN_CLASS_NAME, className), ref: hasRef ? ref : void 0, children }));
|
|
7838
|
+
}
|
|
7839
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Text, __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), { className: classNames(SPAN_CLASS_NAME, className), ref: hasRef ? ref : void 0, children }));
|
|
7840
|
+
});
|
|
7841
|
+
BaseSpan.displayName = "BaseSpan";
|
|
7644
7842
|
const Span = react.forwardRef(
|
|
7645
|
-
function Span2(props,
|
|
7843
|
+
function Span2(props, forwardedRef) {
|
|
7646
7844
|
const { children, dataProperties, renderingProps, restProps } = splitTextProps(props);
|
|
7647
|
-
|
|
7648
|
-
|
|
7845
|
+
const { className, tooltipContentWidth = "md" } = props;
|
|
7846
|
+
const internalRef = react.useRef(null);
|
|
7847
|
+
const isTruncated = useTruncationDetection(internalRef, { checkFirstChild: true });
|
|
7848
|
+
const mergedRef = reactMergeRefs.mergeRefs([internalRef, forwardedRef]);
|
|
7849
|
+
if (props.withTooltip) {
|
|
7850
|
+
const dataPropertiesWithEllipsis = __spreadProps(__spreadValues({}, dataProperties), { "data-with-tooltip": true });
|
|
7851
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { disabled: !isTruncated, children: [
|
|
7852
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger2, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7853
|
+
BaseSpan,
|
|
7854
|
+
{
|
|
7855
|
+
dataProperties: dataPropertiesWithEllipsis,
|
|
7856
|
+
restProps,
|
|
7857
|
+
hasRef: true,
|
|
7858
|
+
className,
|
|
7859
|
+
renderingProps,
|
|
7860
|
+
ref: mergedRef,
|
|
7861
|
+
children
|
|
7862
|
+
}
|
|
7863
|
+
) }),
|
|
7864
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent2, { width: tooltipContentWidth, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "Layer__UI__tooltip-content--text", children }) })
|
|
7865
|
+
] });
|
|
7649
7866
|
}
|
|
7650
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7867
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7868
|
+
BaseSpan,
|
|
7869
|
+
{
|
|
7870
|
+
dataProperties,
|
|
7871
|
+
restProps,
|
|
7872
|
+
hasRef: true,
|
|
7873
|
+
className,
|
|
7874
|
+
renderingProps,
|
|
7875
|
+
ref: mergedRef,
|
|
7876
|
+
children
|
|
7877
|
+
}
|
|
7878
|
+
);
|
|
7651
7879
|
}
|
|
7652
7880
|
);
|
|
7653
7881
|
function LinkedAccountPill({ label, items }) {
|
|
@@ -7685,8 +7913,8 @@ function LinkedAccountPill({ label, items }) {
|
|
|
7685
7913
|
const BASE_MODAL_OVERLAY_CLASS_NAME = "Layer__ModalOverlay";
|
|
7686
7914
|
const MODAL_OVERLAY_CLASS_NAME = `Layer__Portal ${BASE_MODAL_OVERLAY_CLASS_NAME}`;
|
|
7687
7915
|
const ModalOverlay = react.forwardRef(
|
|
7688
|
-
(
|
|
7689
|
-
var
|
|
7916
|
+
(_va, ref) => {
|
|
7917
|
+
var _wa = _va, { variant } = _wa, restProps = __objRest(_wa, ["variant"]);
|
|
7690
7918
|
const dataProperties = toDataProperties({ variant });
|
|
7691
7919
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7692
7920
|
reactAriaComponents.ModalOverlay,
|
|
@@ -7713,8 +7941,8 @@ const InternalModal = react.forwardRef(({ children, flexBlock, size, variant = "
|
|
|
7713
7941
|
InternalModal.displayName = "Modal";
|
|
7714
7942
|
const DIALOG_CLASS_NAME = "Layer__Dialog";
|
|
7715
7943
|
const Dialog = react.forwardRef(
|
|
7716
|
-
(
|
|
7717
|
-
var
|
|
7944
|
+
(_xa, ref) => {
|
|
7945
|
+
var _ya = _xa, { variant = "center" } = _ya, restProps = __objRest(_ya, ["variant"]);
|
|
7718
7946
|
const dataProperties = toDataProperties({ variant });
|
|
7719
7947
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7720
7948
|
reactAriaComponents.Dialog,
|
|
@@ -7750,9 +7978,9 @@ function Drawer({
|
|
|
7750
7978
|
}) {
|
|
7751
7979
|
return /* @__PURE__ */ jsxRuntime.jsx(ModalOverlay, { isOpen, onOpenChange, variant, isDismissable, children: /* @__PURE__ */ jsxRuntime.jsx(InternalModal, { flexBlock, size, variant, children: /* @__PURE__ */ jsxRuntime.jsx(Dialog, { role: role != null ? role : "dialog", "aria-label": ariaLabel, variant, children }) }) });
|
|
7752
7980
|
}
|
|
7753
|
-
const CLASS_NAME$
|
|
7981
|
+
const CLASS_NAME$c = "Layer__LoadingSpinner";
|
|
7754
7982
|
function LoadingSpinner({ size }) {
|
|
7755
|
-
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LoaderCircle, { className: CLASS_NAME$
|
|
7983
|
+
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LoaderCircle, { className: CLASS_NAME$c, size });
|
|
7756
7984
|
}
|
|
7757
7985
|
const BUTTON_CLASS_NAMES = {
|
|
7758
7986
|
DEFAULT: "Layer__UI__Button",
|
|
@@ -7766,15 +7994,15 @@ function ButtonSpinner({ size }) {
|
|
|
7766
7994
|
function ButtonTransparentContent({ children }) {
|
|
7767
7995
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: BUTTON_CLASS_NAMES.TRANSPARENT_CONTENT, children });
|
|
7768
7996
|
}
|
|
7769
|
-
const Button = react.forwardRef((
|
|
7770
|
-
var
|
|
7997
|
+
const Button = react.forwardRef((_za, ref) => {
|
|
7998
|
+
var _Aa = _za, {
|
|
7771
7999
|
children,
|
|
7772
8000
|
ellipsis,
|
|
7773
8001
|
icon,
|
|
7774
8002
|
inset,
|
|
7775
8003
|
size = "md",
|
|
7776
8004
|
variant = "solid"
|
|
7777
|
-
} =
|
|
8005
|
+
} = _Aa, restProps = __objRest(_Aa, [
|
|
7778
8006
|
"children",
|
|
7779
8007
|
"ellipsis",
|
|
7780
8008
|
"icon",
|
|
@@ -7809,8 +8037,8 @@ const Button = react.forwardRef((_ra, ref) => {
|
|
|
7809
8037
|
});
|
|
7810
8038
|
Button.displayName = "Button";
|
|
7811
8039
|
const HEADING_CLASS_NAME = "Layer__UI__Heading";
|
|
7812
|
-
const Heading = react.forwardRef((
|
|
7813
|
-
var
|
|
8040
|
+
const Heading = react.forwardRef((_Ba, ref) => {
|
|
8041
|
+
var _Ca = _Ba, { align, pie, pbe, size, variant, weight, ellipsis, className } = _Ca, restProps = __objRest(_Ca, ["align", "pie", "pbe", "size", "variant", "weight", "ellipsis", "className"]);
|
|
7814
8042
|
const dataProperties = toDataProperties({ pbe, pie, size, align, variant, weight, ellipsis });
|
|
7815
8043
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7816
8044
|
reactAriaComponents.Heading,
|
|
@@ -7821,76 +8049,6 @@ const Heading = react.forwardRef((_ta, ref) => {
|
|
|
7821
8049
|
);
|
|
7822
8050
|
});
|
|
7823
8051
|
Heading.displayName = "Heading";
|
|
7824
|
-
const CLASS_NAME$c = "Layer__Stack";
|
|
7825
|
-
const Stack = react.forwardRef(
|
|
7826
|
-
function Stack2(_va, ref) {
|
|
7827
|
-
var _wa = _va, {
|
|
7828
|
-
align,
|
|
7829
|
-
children,
|
|
7830
|
-
className,
|
|
7831
|
-
direction,
|
|
7832
|
-
gap,
|
|
7833
|
-
justify,
|
|
7834
|
-
overflow,
|
|
7835
|
-
pb,
|
|
7836
|
-
pbs,
|
|
7837
|
-
pbe,
|
|
7838
|
-
pi,
|
|
7839
|
-
pis,
|
|
7840
|
-
pie,
|
|
7841
|
-
fluid
|
|
7842
|
-
} = _wa, restProps = __objRest(_wa, [
|
|
7843
|
-
"align",
|
|
7844
|
-
"children",
|
|
7845
|
-
"className",
|
|
7846
|
-
"direction",
|
|
7847
|
-
"gap",
|
|
7848
|
-
"justify",
|
|
7849
|
-
"overflow",
|
|
7850
|
-
"pb",
|
|
7851
|
-
"pbs",
|
|
7852
|
-
"pbe",
|
|
7853
|
-
"pi",
|
|
7854
|
-
"pis",
|
|
7855
|
-
"pie",
|
|
7856
|
-
"fluid"
|
|
7857
|
-
]);
|
|
7858
|
-
const dataProperties = toDataProperties({
|
|
7859
|
-
align,
|
|
7860
|
-
direction,
|
|
7861
|
-
gap,
|
|
7862
|
-
justify,
|
|
7863
|
-
overflow,
|
|
7864
|
-
pb,
|
|
7865
|
-
pbs,
|
|
7866
|
-
pbe,
|
|
7867
|
-
pi,
|
|
7868
|
-
pis,
|
|
7869
|
-
pie,
|
|
7870
|
-
fluid
|
|
7871
|
-
});
|
|
7872
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7873
|
-
"div",
|
|
7874
|
-
__spreadProps(__spreadValues(__spreadValues({
|
|
7875
|
-
ref
|
|
7876
|
-
}, restProps), dataProperties), {
|
|
7877
|
-
className: classNames(CLASS_NAME$c, className),
|
|
7878
|
-
children
|
|
7879
|
-
})
|
|
7880
|
-
);
|
|
7881
|
-
}
|
|
7882
|
-
);
|
|
7883
|
-
const VStack = react.forwardRef(
|
|
7884
|
-
function VStack2(props, ref) {
|
|
7885
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Stack, __spreadProps(__spreadValues({}, props), { ref, direction: "column" }));
|
|
7886
|
-
}
|
|
7887
|
-
);
|
|
7888
|
-
const HStack = react.forwardRef(
|
|
7889
|
-
function HStack2(props, ref) {
|
|
7890
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Stack, __spreadProps(__spreadValues({}, props), { ref, direction: "row" }));
|
|
7891
|
-
}
|
|
7892
|
-
);
|
|
7893
|
-
const Spacer = () => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__Spacer" });
|
|
7894
8052
|
const Separator = ({ mbs, mbe }) => {
|
|
7895
8053
|
const dataProperties = toDataProperties({ mbs, mbe });
|
|
7896
8054
|
return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadValues({ className: "Layer__separator" }, dataProperties));
|
|
@@ -8220,8 +8378,8 @@ function ConditionalList({
|
|
|
8220
8378
|
return Container2 ? /* @__PURE__ */ jsxRuntime.jsx(Container2, { children: listItems }) : listItems;
|
|
8221
8379
|
}
|
|
8222
8380
|
const CLASS_NAME$b = "Layer__Checkbox";
|
|
8223
|
-
function Checkbox(
|
|
8224
|
-
var
|
|
8381
|
+
function Checkbox(_Da) {
|
|
8382
|
+
var _Ea = _Da, { children, className, variant = "default", size = "md", isIndeterminate } = _Ea, props = __objRest(_Ea, ["children", "className", "variant", "size", "isIndeterminate"]);
|
|
8225
8383
|
const dataProperties = react.useMemo(() => toDataProperties({
|
|
8226
8384
|
size,
|
|
8227
8385
|
variant,
|
|
@@ -8239,11 +8397,11 @@ function Checkbox(_xa) {
|
|
|
8239
8397
|
})
|
|
8240
8398
|
);
|
|
8241
8399
|
}
|
|
8242
|
-
function CheckboxWithTooltip(
|
|
8243
|
-
var
|
|
8244
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__checkbox-wrapper", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8245
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8246
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8400
|
+
function CheckboxWithTooltip(_Fa) {
|
|
8401
|
+
var _Ga = _Fa, { tooltip } = _Ga, props = __objRest(_Ga, ["tooltip"]);
|
|
8402
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__checkbox-wrapper", children: /* @__PURE__ */ jsxRuntime.jsxs(DeprecatedTooltip, { disabled: !tooltip, children: [
|
|
8403
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipTrigger, { className: "Layer__input-tooltip", children: /* @__PURE__ */ jsxRuntime.jsx(Checkbox, __spreadValues({}, props)) }),
|
|
8404
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", children: tooltip })
|
|
8247
8405
|
] }) });
|
|
8248
8406
|
}
|
|
8249
8407
|
const CLASS_NAME$a = "Layer__BasicLinkedAccountContainer";
|
|
@@ -8585,13 +8743,13 @@ const isDateAllowedToBrowse = (date2, business) => {
|
|
|
8585
8743
|
}
|
|
8586
8744
|
return dateFns.differenceInCalendarMonths(dateFns.startOfMonth(date2), activationDate) >= 0;
|
|
8587
8745
|
};
|
|
8588
|
-
const Input$1 = (
|
|
8589
|
-
var
|
|
8746
|
+
const Input$1 = (_Ha) => {
|
|
8747
|
+
var _Ia = _Ha, {
|
|
8590
8748
|
className,
|
|
8591
8749
|
isInvalid,
|
|
8592
8750
|
errorMessage,
|
|
8593
8751
|
leftText
|
|
8594
|
-
} =
|
|
8752
|
+
} = _Ia, props = __objRest(_Ia, [
|
|
8595
8753
|
"className",
|
|
8596
8754
|
"isInvalid",
|
|
8597
8755
|
"errorMessage",
|
|
@@ -8603,12 +8761,12 @@ const Input$1 = (_Ba) => {
|
|
|
8603
8761
|
leftText ? "Layer__input--with-left-text" : "",
|
|
8604
8762
|
className
|
|
8605
8763
|
);
|
|
8606
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8607
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
8764
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(DeprecatedTooltip, { disabled: !isInvalid || !errorMessage, children: [
|
|
8765
|
+
/* @__PURE__ */ jsxRuntime.jsxs(DeprecatedTooltipTrigger, { className: "Layer__input-tooltip", children: [
|
|
8608
8766
|
/* @__PURE__ */ jsxRuntime.jsx("input", __spreadProps(__spreadValues({}, props), { className: baseClassName2 })),
|
|
8609
8767
|
leftText && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "Layer__input-left-text", children: leftText })
|
|
8610
8768
|
] }),
|
|
8611
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8769
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", children: errorMessage })
|
|
8612
8770
|
] });
|
|
8613
8771
|
};
|
|
8614
8772
|
const InputGroup$1 = ({
|
|
@@ -8637,8 +8795,8 @@ const InputGroup$1 = ({
|
|
|
8637
8795
|
children
|
|
8638
8796
|
] });
|
|
8639
8797
|
};
|
|
8640
|
-
const UploadCloud = (
|
|
8641
|
-
var
|
|
8798
|
+
const UploadCloud = (_Ja) => {
|
|
8799
|
+
var _Ka = _Ja, { size = 18 } = _Ka, props = __objRest(_Ka, ["size"]);
|
|
8642
8800
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8643
8801
|
"svg",
|
|
8644
8802
|
__spreadProps(__spreadValues({
|
|
@@ -8749,8 +8907,8 @@ const FileInput = ({
|
|
|
8749
8907
|
)
|
|
8750
8908
|
] });
|
|
8751
8909
|
};
|
|
8752
|
-
const ChevronDownFill = (
|
|
8753
|
-
var
|
|
8910
|
+
const ChevronDownFill = (_La) => {
|
|
8911
|
+
var _Ma = _La, { size = 18 } = _Ma, props = __objRest(_Ma, ["size"]);
|
|
8754
8912
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8755
8913
|
"svg",
|
|
8756
8914
|
__spreadProps(__spreadValues({
|
|
@@ -8796,8 +8954,8 @@ const Select = ({
|
|
|
8796
8954
|
className
|
|
8797
8955
|
);
|
|
8798
8956
|
const DropdownIndicator = react.useCallback((props) => /* @__PURE__ */ jsxRuntime.jsx(Select$1.components.DropdownIndicator, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsxRuntime.jsx(ChevronDownFill, {}) })), []);
|
|
8799
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8800
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8957
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(DeprecatedTooltip, { disabled: !isInvalid || !errorMessage, children: [
|
|
8958
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipTrigger, { className: "Layer__input-tooltip", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8801
8959
|
Select$1,
|
|
8802
8960
|
{
|
|
8803
8961
|
inputId,
|
|
@@ -8816,7 +8974,7 @@ const Select = ({
|
|
|
8816
8974
|
isDisabled: disabled
|
|
8817
8975
|
}
|
|
8818
8976
|
) }),
|
|
8819
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8977
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", children: errorMessage })
|
|
8820
8978
|
] });
|
|
8821
8979
|
};
|
|
8822
8980
|
const MultiSelect = ({
|
|
@@ -8841,8 +8999,8 @@ const MultiSelect = ({
|
|
|
8841
8999
|
className
|
|
8842
9000
|
);
|
|
8843
9001
|
const DropdownIndicator = react.useCallback((props) => /* @__PURE__ */ jsxRuntime.jsx(Select$1.components.DropdownIndicator, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsxRuntime.jsx(ChevronDownFill, {}) })), []);
|
|
8844
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8845
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9002
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(DeprecatedTooltip, { disabled: !isInvalid || !errorMessage, children: [
|
|
9003
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipTrigger, { className: "Layer__input-tooltip", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8846
9004
|
Select$1,
|
|
8847
9005
|
{
|
|
8848
9006
|
inputId,
|
|
@@ -8864,7 +9022,7 @@ const MultiSelect = ({
|
|
|
8864
9022
|
isMulti: true
|
|
8865
9023
|
}
|
|
8866
9024
|
) }),
|
|
8867
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9025
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", children: errorMessage })
|
|
8868
9026
|
] });
|
|
8869
9027
|
};
|
|
8870
9028
|
const transformCurrencyValue = (rawValue) => {
|
|
@@ -8877,8 +9035,8 @@ const transformCurrencyValue = (rawValue) => {
|
|
|
8877
9035
|
}
|
|
8878
9036
|
return cleaned;
|
|
8879
9037
|
};
|
|
8880
|
-
const AmountInput = (
|
|
8881
|
-
var
|
|
9038
|
+
const AmountInput = (_Na) => {
|
|
9039
|
+
var _Oa = _Na, {
|
|
8882
9040
|
onChange,
|
|
8883
9041
|
className,
|
|
8884
9042
|
leftText,
|
|
@@ -8886,7 +9044,7 @@ const AmountInput = (_Ha) => {
|
|
|
8886
9044
|
isInvalid,
|
|
8887
9045
|
badge,
|
|
8888
9046
|
placeholder = "$0.00"
|
|
8889
|
-
} =
|
|
9047
|
+
} = _Oa, props = __objRest(_Oa, [
|
|
8890
9048
|
"onChange",
|
|
8891
9049
|
"className",
|
|
8892
9050
|
"leftText",
|
|
@@ -8920,15 +9078,15 @@ const AmountInput = (_Ha) => {
|
|
|
8920
9078
|
className: baseClassName2
|
|
8921
9079
|
})
|
|
8922
9080
|
);
|
|
8923
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8924
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
9081
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(DeprecatedTooltip, { disabled: !isInvalid || !errorMessage, children: [
|
|
9082
|
+
/* @__PURE__ */ jsxRuntime.jsxs(DeprecatedTooltipTrigger, { className: "Layer__input-tooltip", children: [
|
|
8925
9083
|
badge ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "Layer__input-with-badge", children: [
|
|
8926
9084
|
currencyInput,
|
|
8927
9085
|
badge
|
|
8928
9086
|
] }) : currencyInput,
|
|
8929
9087
|
leftText && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "Layer__input-left-text", children: leftText })
|
|
8930
9088
|
] }),
|
|
8931
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9089
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", children: errorMessage })
|
|
8932
9090
|
] });
|
|
8933
9091
|
};
|
|
8934
9092
|
const DATE_FORMAT$1 = "LLL d, yyyy";
|
|
@@ -8972,8 +9130,8 @@ function useSizeClass() {
|
|
|
8972
9130
|
isDesktop: sizeClass === "desktop"
|
|
8973
9131
|
};
|
|
8974
9132
|
}
|
|
8975
|
-
const ChevronLeft = (
|
|
8976
|
-
var props = __objRest(
|
|
9133
|
+
const ChevronLeft = (_Pa) => {
|
|
9134
|
+
var props = __objRest(_Pa, []);
|
|
8977
9135
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8978
9136
|
"svg",
|
|
8979
9137
|
__spreadProps(__spreadValues({
|
|
@@ -9101,8 +9259,8 @@ const getDateFormat = (mode) => {
|
|
|
9101
9259
|
});
|
|
9102
9260
|
}
|
|
9103
9261
|
};
|
|
9104
|
-
const DeprecatedDatePicker = (
|
|
9105
|
-
var
|
|
9262
|
+
const DeprecatedDatePicker = (_Qa) => {
|
|
9263
|
+
var _Ra = _Qa, {
|
|
9106
9264
|
selected,
|
|
9107
9265
|
onChange,
|
|
9108
9266
|
disabled,
|
|
@@ -9123,7 +9281,7 @@ const DeprecatedDatePicker = (_Ka) => {
|
|
|
9123
9281
|
highlightYears,
|
|
9124
9282
|
onChangeMode,
|
|
9125
9283
|
slots
|
|
9126
|
-
} =
|
|
9284
|
+
} = _Ra, props = __objRest(_Ra, [
|
|
9127
9285
|
"selected",
|
|
9128
9286
|
"onChange",
|
|
9129
9287
|
"disabled",
|
|
@@ -9950,8 +10108,8 @@ const useIsVisible = (ref) => {
|
|
|
9950
10108
|
}, [ref]);
|
|
9951
10109
|
return isIntersecting;
|
|
9952
10110
|
};
|
|
9953
|
-
const File = (
|
|
9954
|
-
var
|
|
10111
|
+
const File = (_Sa) => {
|
|
10112
|
+
var _Ta = _Sa, { size = 12 } = _Ta, props = __objRest(_Ta, ["size"]);
|
|
9955
10113
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9956
10114
|
"svg",
|
|
9957
10115
|
__spreadProps(__spreadValues({
|
|
@@ -10011,8 +10169,8 @@ const File = (_Ma) => {
|
|
|
10011
10169
|
})
|
|
10012
10170
|
);
|
|
10013
10171
|
};
|
|
10014
|
-
const ScissorsFullOpen = (
|
|
10015
|
-
var
|
|
10172
|
+
const ScissorsFullOpen = (_Ua) => {
|
|
10173
|
+
var _Va = _Ua, { size = 12 } = _Va, props = __objRest(_Va, ["size"]);
|
|
10016
10174
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10017
10175
|
"svg",
|
|
10018
10176
|
__spreadProps(__spreadValues({
|
|
@@ -10077,8 +10235,8 @@ const ScissorsFullOpen = (_Oa) => {
|
|
|
10077
10235
|
})
|
|
10078
10236
|
);
|
|
10079
10237
|
};
|
|
10080
|
-
const Trash = (
|
|
10081
|
-
var
|
|
10238
|
+
const Trash = (_Wa) => {
|
|
10239
|
+
var _Xa = _Wa, { size = 18 } = _Xa, props = __objRest(_Xa, ["size"]);
|
|
10082
10240
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10083
10241
|
"svg",
|
|
10084
10242
|
__spreadProps(__spreadValues({
|
|
@@ -10129,44 +10287,6 @@ const Trash = (_Qa) => {
|
|
|
10129
10287
|
})
|
|
10130
10288
|
);
|
|
10131
10289
|
};
|
|
10132
|
-
var CategorizationType = /* @__PURE__ */ ((CategorizationType2) => {
|
|
10133
|
-
CategorizationType2["AUTO"] = "AUTO";
|
|
10134
|
-
CategorizationType2["ASK_FROM_SUGGESTIONS"] = "ASK_FROM_SUGGESTIONS";
|
|
10135
|
-
CategorizationType2["MEALS"] = "MEALS";
|
|
10136
|
-
CategorizationType2["BUSINESS_TRAVEL_TRANSPORTATION"] = "BUSINESS_TRAVEL_TRANSPORTATION";
|
|
10137
|
-
return CategorizationType2;
|
|
10138
|
-
})(CategorizationType || {});
|
|
10139
|
-
function hasSuggestions(categorization) {
|
|
10140
|
-
return categorization != null && categorization.suggestions !== void 0 && categorization.suggestions.length > 0;
|
|
10141
|
-
}
|
|
10142
|
-
const accountIdentifierIsForCategory = (accountIdentifier, category) => {
|
|
10143
|
-
if (accountIdentifier.type === "AccountId") {
|
|
10144
|
-
switch (category.type) {
|
|
10145
|
-
case "AccountNested":
|
|
10146
|
-
return AccountIdEquivalence(accountIdentifier, makeAccountId(category.id));
|
|
10147
|
-
case "OptionalAccountNested":
|
|
10148
|
-
return false;
|
|
10149
|
-
case "ExclusionNested":
|
|
10150
|
-
return false;
|
|
10151
|
-
}
|
|
10152
|
-
}
|
|
10153
|
-
switch (category.type) {
|
|
10154
|
-
case "AccountNested":
|
|
10155
|
-
return category.stableName ? AccountStableNameEquivalence(accountIdentifier, makeStableName(category.stableName)) : false;
|
|
10156
|
-
case "OptionalAccountNested":
|
|
10157
|
-
return AccountStableNameEquivalence(accountIdentifier, makeStableName(category.stableName));
|
|
10158
|
-
case "ExclusionNested":
|
|
10159
|
-
return false;
|
|
10160
|
-
}
|
|
10161
|
-
};
|
|
10162
|
-
const getLeafCategories$2 = (categories) => {
|
|
10163
|
-
return categories.flatMap((category) => {
|
|
10164
|
-
if (!category.subCategories || category.subCategories.length === 0) {
|
|
10165
|
-
return [category];
|
|
10166
|
-
}
|
|
10167
|
-
return getLeafCategories$2(category.subCategories);
|
|
10168
|
-
});
|
|
10169
|
-
};
|
|
10170
10290
|
const ReceiptsContext = react.createContext({
|
|
10171
10291
|
receiptUrls: [],
|
|
10172
10292
|
uploadReceipt: () => Promise.resolve(),
|
|
@@ -10311,8 +10431,8 @@ const ReceiptsProvider = ({
|
|
|
10311
10431
|
const contextData = useReceipts({ bankTransaction, isActive });
|
|
10312
10432
|
return /* @__PURE__ */ jsxRuntime.jsx(ReceiptsContext.Provider, { value: contextData, children });
|
|
10313
10433
|
};
|
|
10314
|
-
const Eye = (
|
|
10315
|
-
var
|
|
10434
|
+
const Eye = (_Ya) => {
|
|
10435
|
+
var _Za = _Ya, { size = 18 } = _Za, props = __objRest(_Za, ["size"]);
|
|
10316
10436
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10317
10437
|
"svg",
|
|
10318
10438
|
__spreadProps(__spreadValues({
|
|
@@ -10465,8 +10585,8 @@ const openReceiptInNewTab = (url, index2) => (e) => {
|
|
|
10465
10585
|
`);
|
|
10466
10586
|
}
|
|
10467
10587
|
};
|
|
10468
|
-
const BankTransactionReceiptsWithProvider = react.forwardRef((
|
|
10469
|
-
var
|
|
10588
|
+
const BankTransactionReceiptsWithProvider = react.forwardRef((__a, ref) => {
|
|
10589
|
+
var _$a = __a, { bankTransaction, isActive } = _$a, props = __objRest(_$a, ["bankTransaction", "isActive"]);
|
|
10470
10590
|
return /* @__PURE__ */ jsxRuntime.jsx(ReceiptsProvider, { bankTransaction, isActive, children: /* @__PURE__ */ jsxRuntime.jsx(BankTransactionReceipts, __spreadProps(__spreadValues({}, props), { ref })) });
|
|
10471
10591
|
});
|
|
10472
10592
|
BankTransactionReceiptsWithProvider.displayName = "BankTransactionReceiptsWithProvider";
|
|
@@ -10518,8 +10638,8 @@ const BankTransactionReceipts = react.forwardRef(
|
|
|
10518
10638
|
);
|
|
10519
10639
|
BankTransactionReceipts.displayName = "BankTransactionReceipts";
|
|
10520
10640
|
const PORTAL_CLASS_NAME = "Layer__Portal";
|
|
10521
|
-
const Check = (
|
|
10522
|
-
var
|
|
10641
|
+
const Check = (_ab) => {
|
|
10642
|
+
var _bb = _ab, { size = 18 } = _bb, props = __objRest(_bb, ["size"]);
|
|
10523
10643
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10524
10644
|
"svg",
|
|
10525
10645
|
__spreadProps(__spreadValues({
|
|
@@ -10715,8 +10835,8 @@ function buildCustomMenuPortal() {
|
|
|
10715
10835
|
);
|
|
10716
10836
|
};
|
|
10717
10837
|
}
|
|
10718
|
-
function ComboBox(
|
|
10719
|
-
var
|
|
10838
|
+
function ComboBox(_cb) {
|
|
10839
|
+
var _db = _cb, {
|
|
10720
10840
|
className,
|
|
10721
10841
|
selectedValue,
|
|
10722
10842
|
onSelectedValueChange,
|
|
@@ -10734,7 +10854,7 @@ function ComboBox(_Ya) {
|
|
|
10734
10854
|
isClearable = true,
|
|
10735
10855
|
isReadOnly = false,
|
|
10736
10856
|
displayDisabledAsSelected
|
|
10737
|
-
} =
|
|
10857
|
+
} = _db, ariaProps = __objRest(_db, [
|
|
10738
10858
|
"className",
|
|
10739
10859
|
"selectedValue",
|
|
10740
10860
|
"onSelectedValueChange",
|
|
@@ -10780,7 +10900,7 @@ function ComboBox(_Ya) {
|
|
|
10780
10900
|
const CustomClearIndicatorRef = react.useRef(buildCustomClearIndicator());
|
|
10781
10901
|
const CustomLoadingIndicatorRef = react.useRef(buildCustomLoadingIndicator());
|
|
10782
10902
|
const CustomDropdownIndicatorRef = react.useRef(buildCustomDropdownIndicator());
|
|
10783
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "3xs", fluid: true, children: [
|
|
10903
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "3xs", fluid: true, className: className ? `${className}__Container` : void 0, children: [
|
|
10784
10904
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10785
10905
|
Select$1,
|
|
10786
10906
|
__spreadProps(__spreadValues({
|
|
@@ -11033,7 +11153,8 @@ const TagDimensionsGroup = ({
|
|
|
11033
11153
|
onChange,
|
|
11034
11154
|
showLabels = false,
|
|
11035
11155
|
isReadOnly = false,
|
|
11036
|
-
isEnabled = true
|
|
11156
|
+
isEnabled = true,
|
|
11157
|
+
className
|
|
11037
11158
|
}) => {
|
|
11038
11159
|
var _a;
|
|
11039
11160
|
const { accountingConfiguration } = useLayerContext();
|
|
@@ -11050,10 +11171,10 @@ const TagDimensionsGroup = ({
|
|
|
11050
11171
|
(tag) => tag.key.toLowerCase() === dimensionKey.toLowerCase()
|
|
11051
11172
|
)) != null ? _a2 : null;
|
|
11052
11173
|
};
|
|
11053
|
-
if (!isEnabled) {
|
|
11174
|
+
if (!isEnabled || (accountingConfiguration == null ? void 0 : accountingConfiguration.platformDisplayTags.length) === 0) {
|
|
11054
11175
|
return null;
|
|
11055
11176
|
}
|
|
11056
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11177
|
+
return /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", className, children: ((_a = accountingConfiguration == null ? void 0 : accountingConfiguration.platformDisplayTags) != null ? _a : []).map((dimension) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
11057
11178
|
TagDimensionCombobox,
|
|
11058
11179
|
{
|
|
11059
11180
|
dimensionKey: dimension.key,
|
|
@@ -11509,22 +11630,6 @@ function CustomerVendorSelector({
|
|
|
11509
11630
|
)
|
|
11510
11631
|
] });
|
|
11511
11632
|
}
|
|
11512
|
-
const CustomerVendorTypeSchema = effect.Schema.Literal("CUSTOMER", "VENDOR");
|
|
11513
|
-
const DiscriminatedCustomerSchema = effect.Schema.Struct(__spreadProps(__spreadValues({}, CustomerSchema.fields), {
|
|
11514
|
-
customerVendorType: CustomerVendorTypeSchema.pipe(
|
|
11515
|
-
effect.Schema.pickLiteral("CUSTOMER")
|
|
11516
|
-
)
|
|
11517
|
-
}));
|
|
11518
|
-
const DiscriminatedVendorSchema = effect.Schema.Struct(__spreadProps(__spreadValues({}, VendorSchema.fields), {
|
|
11519
|
-
customerVendorType: CustomerVendorTypeSchema.pipe(
|
|
11520
|
-
effect.Schema.pickLiteral("VENDOR")
|
|
11521
|
-
)
|
|
11522
|
-
}));
|
|
11523
|
-
const CustomerVendorSchema = effect.Schema.Union(
|
|
11524
|
-
DiscriminatedCustomerSchema,
|
|
11525
|
-
DiscriminatedVendorSchema
|
|
11526
|
-
);
|
|
11527
|
-
const decodeCustomerVendor = effect.Schema.decodeSync(CustomerVendorSchema);
|
|
11528
11633
|
const TAG_BANK_TRANSACTION_TAG_KEY = "#tag-bank-transaction";
|
|
11529
11634
|
const tagBankTransaction = post(({ businessId }) => `/v1/businesses/${businessId}/bank-transactions/tags`);
|
|
11530
11635
|
function buildKey$P({
|
|
@@ -11946,8 +12051,8 @@ function isCategorizationEnabledForStatus(status) {
|
|
|
11946
12051
|
}
|
|
11947
12052
|
}
|
|
11948
12053
|
}
|
|
11949
|
-
const MinimizeTwo = (
|
|
11950
|
-
var
|
|
12054
|
+
const MinimizeTwo = (_eb) => {
|
|
12055
|
+
var _fb = _eb, { size = 18 } = _fb, props = __objRest(_fb, ["size"]);
|
|
11951
12056
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11952
12057
|
"svg",
|
|
11953
12058
|
__spreadProps(__spreadValues({
|
|
@@ -12029,7 +12134,7 @@ const MatchForm$1 = ({
|
|
|
12029
12134
|
classNamePrefix,
|
|
12030
12135
|
bankTransaction,
|
|
12031
12136
|
selectedMatchId,
|
|
12032
|
-
|
|
12137
|
+
setSelectedMatch,
|
|
12033
12138
|
matchFormError,
|
|
12034
12139
|
readOnly = false
|
|
12035
12140
|
}) => {
|
|
@@ -12068,7 +12173,7 @@ const MatchForm$1 = ({
|
|
|
12068
12173
|
if (readOnly === true) {
|
|
12069
12174
|
return;
|
|
12070
12175
|
}
|
|
12071
|
-
|
|
12176
|
+
setSelectedMatch(suggestedMatch);
|
|
12072
12177
|
},
|
|
12073
12178
|
children: [
|
|
12074
12179
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `Layer__nowrap ${classNamePrefix}__match-table__date`, children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: dateFns.format(dateFns.parseISO(suggestedMatch.details.date), DATE_FORMAT$1) }) }),
|
|
@@ -12076,7 +12181,7 @@ const MatchForm$1 = ({
|
|
|
12076
12181
|
Text,
|
|
12077
12182
|
{
|
|
12078
12183
|
className: `${classNamePrefix}__match-table__desc-tooltip`,
|
|
12079
|
-
|
|
12184
|
+
withDeprecatedTooltip: TextUseTooltip.whenTruncated,
|
|
12080
12185
|
as: "span",
|
|
12081
12186
|
children: suggestedMatch.details.description
|
|
12082
12187
|
}
|
|
@@ -12113,7 +12218,7 @@ const MatchFormMobile = ({
|
|
|
12113
12218
|
classNamePrefix,
|
|
12114
12219
|
bankTransaction,
|
|
12115
12220
|
selectedMatchId,
|
|
12116
|
-
|
|
12221
|
+
setSelectedMatch,
|
|
12117
12222
|
matchFormError,
|
|
12118
12223
|
readOnly
|
|
12119
12224
|
}) => {
|
|
@@ -12134,7 +12239,7 @@ const MatchFormMobile = ({
|
|
|
12134
12239
|
if (readOnly) {
|
|
12135
12240
|
return;
|
|
12136
12241
|
}
|
|
12137
|
-
|
|
12242
|
+
setSelectedMatch(match);
|
|
12138
12243
|
},
|
|
12139
12244
|
children: [
|
|
12140
12245
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${classNamePrefix}__match-item__col-details`, children: [
|
|
@@ -12301,8 +12406,8 @@ const ToggleOption = ({
|
|
|
12301
12406
|
"Layer__toggle-option--active": checked
|
|
12302
12407
|
});
|
|
12303
12408
|
if (disabled) {
|
|
12304
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12305
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12409
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(DeprecatedTooltip, { children: [
|
|
12410
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipTrigger, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12306
12411
|
"label",
|
|
12307
12412
|
{
|
|
12308
12413
|
className: optionClassName,
|
|
@@ -12328,7 +12433,7 @@ const ToggleOption = ({
|
|
|
12328
12433
|
]
|
|
12329
12434
|
}
|
|
12330
12435
|
) }),
|
|
12331
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12436
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", children: disabledMessage })
|
|
12332
12437
|
] });
|
|
12333
12438
|
}
|
|
12334
12439
|
return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: optionClassName, "data-checked": checked, style, children: [
|
|
@@ -12456,12 +12561,12 @@ const Notification = ({
|
|
|
12456
12561
|
}
|
|
12457
12562
|
);
|
|
12458
12563
|
};
|
|
12459
|
-
const Textarea = (
|
|
12460
|
-
var
|
|
12564
|
+
const Textarea = (_gb) => {
|
|
12565
|
+
var _hb = _gb, {
|
|
12461
12566
|
className,
|
|
12462
12567
|
isInvalid,
|
|
12463
12568
|
errorMessage
|
|
12464
|
-
} =
|
|
12569
|
+
} = _hb, props = __objRest(_hb, [
|
|
12465
12570
|
"className",
|
|
12466
12571
|
"isInvalid",
|
|
12467
12572
|
"errorMessage"
|
|
@@ -12471,9 +12576,9 @@ const Textarea = (_ab) => {
|
|
|
12471
12576
|
isInvalid ? "Layer__textarea--error" : "",
|
|
12472
12577
|
className
|
|
12473
12578
|
);
|
|
12474
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12475
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12476
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12579
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(DeprecatedTooltip, { disabled: !isInvalid || !errorMessage, children: [
|
|
12580
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipTrigger, { className: "Layer__input-tooltip", children: /* @__PURE__ */ jsxRuntime.jsx("textarea", __spreadProps(__spreadValues({}, props), { className: baseClassName2 })) }),
|
|
12581
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", children: errorMessage })
|
|
12477
12582
|
] });
|
|
12478
12583
|
};
|
|
12479
12584
|
const GET_BANK_TRANSACTION_METADATA_TAG_KEY = "#bank-transaction-metadata";
|
|
@@ -12619,6 +12724,22 @@ const BankTransactionMemo = ({ bankTransactionId }) => {
|
|
|
12619
12724
|
);
|
|
12620
12725
|
} }) });
|
|
12621
12726
|
};
|
|
12727
|
+
const CustomerVendorTypeSchema = effect.Schema.Literal("CUSTOMER", "VENDOR");
|
|
12728
|
+
const DiscriminatedCustomerSchema = effect.Schema.Struct(__spreadProps(__spreadValues({}, CustomerSchema.fields), {
|
|
12729
|
+
customerVendorType: CustomerVendorTypeSchema.pipe(
|
|
12730
|
+
effect.Schema.pickLiteral("CUSTOMER")
|
|
12731
|
+
)
|
|
12732
|
+
}));
|
|
12733
|
+
const DiscriminatedVendorSchema = effect.Schema.Struct(__spreadProps(__spreadValues({}, VendorSchema.fields), {
|
|
12734
|
+
customerVendorType: CustomerVendorTypeSchema.pipe(
|
|
12735
|
+
effect.Schema.pickLiteral("VENDOR")
|
|
12736
|
+
)
|
|
12737
|
+
}));
|
|
12738
|
+
const CustomerVendorSchema = effect.Schema.Union(
|
|
12739
|
+
DiscriminatedCustomerSchema,
|
|
12740
|
+
DiscriminatedVendorSchema
|
|
12741
|
+
);
|
|
12742
|
+
const decodeCustomerVendor = effect.Schema.decodeSync(CustomerVendorSchema);
|
|
12622
12743
|
function BankTransactionCustomerVendorSelector({
|
|
12623
12744
|
bankTransaction
|
|
12624
12745
|
}) {
|
|
@@ -12785,6 +12906,44 @@ function BankTransactionFormFields({
|
|
|
12785
12906
|
showDescriptions ? /* @__PURE__ */ jsxRuntime.jsx(BankTransactionMemo, { bankTransactionId: bankTransaction.id }) : null
|
|
12786
12907
|
] });
|
|
12787
12908
|
}
|
|
12909
|
+
var CategorizationType = /* @__PURE__ */ ((CategorizationType2) => {
|
|
12910
|
+
CategorizationType2["AUTO"] = "AUTO";
|
|
12911
|
+
CategorizationType2["ASK_FROM_SUGGESTIONS"] = "ASK_FROM_SUGGESTIONS";
|
|
12912
|
+
CategorizationType2["MEALS"] = "MEALS";
|
|
12913
|
+
CategorizationType2["BUSINESS_TRAVEL_TRANSPORTATION"] = "BUSINESS_TRAVEL_TRANSPORTATION";
|
|
12914
|
+
return CategorizationType2;
|
|
12915
|
+
})(CategorizationType || {});
|
|
12916
|
+
function hasSuggestions(categorization) {
|
|
12917
|
+
return categorization != null && categorization.suggestions !== void 0 && categorization.suggestions.length > 0;
|
|
12918
|
+
}
|
|
12919
|
+
const accountIdentifierIsForCategory = (accountIdentifier, category) => {
|
|
12920
|
+
if (accountIdentifier.type === "AccountId") {
|
|
12921
|
+
switch (category.type) {
|
|
12922
|
+
case "AccountNested":
|
|
12923
|
+
return AccountIdEquivalence(accountIdentifier, makeAccountId(category.id));
|
|
12924
|
+
case "OptionalAccountNested":
|
|
12925
|
+
return false;
|
|
12926
|
+
case "ExclusionNested":
|
|
12927
|
+
return false;
|
|
12928
|
+
}
|
|
12929
|
+
}
|
|
12930
|
+
switch (category.type) {
|
|
12931
|
+
case "AccountNested":
|
|
12932
|
+
return category.stableName ? AccountStableNameEquivalence(accountIdentifier, makeStableName(category.stableName)) : false;
|
|
12933
|
+
case "OptionalAccountNested":
|
|
12934
|
+
return AccountStableNameEquivalence(accountIdentifier, makeStableName(category.stableName));
|
|
12935
|
+
case "ExclusionNested":
|
|
12936
|
+
return false;
|
|
12937
|
+
}
|
|
12938
|
+
};
|
|
12939
|
+
const getLeafCategories$2 = (categories) => {
|
|
12940
|
+
return categories.flatMap((category) => {
|
|
12941
|
+
if (!category.subCategories || category.subCategories.length === 0) {
|
|
12942
|
+
return [category];
|
|
12943
|
+
}
|
|
12944
|
+
return getLeafCategories$2(category.subCategories);
|
|
12945
|
+
});
|
|
12946
|
+
};
|
|
12788
12947
|
var BankTransactionCategoryComboBoxGroupLabel = /* @__PURE__ */ ((BankTransactionCategoryComboBoxGroupLabel2) => {
|
|
12789
12948
|
BankTransactionCategoryComboBoxGroupLabel2["TRANSFER"] = "TRANSFER";
|
|
12790
12949
|
BankTransactionCategoryComboBoxGroupLabel2["MATCH"] = "MATCH";
|
|
@@ -12792,6 +12951,19 @@ var BankTransactionCategoryComboBoxGroupLabel = /* @__PURE__ */ ((BankTransactio
|
|
|
12792
12951
|
BankTransactionCategoryComboBoxGroupLabel2["ALL_CATEGORIES"] = "ALL CATEGORIES";
|
|
12793
12952
|
return BankTransactionCategoryComboBoxGroupLabel2;
|
|
12794
12953
|
})(BankTransactionCategoryComboBoxGroupLabel || {});
|
|
12954
|
+
const convertCategorizationToOption = (categorization) => {
|
|
12955
|
+
if (isSplitCategorizationEncoded(categorization)) {
|
|
12956
|
+
const splits = categorization.entries.map((splitEntryEncoded) => ({
|
|
12957
|
+
amount: splitEntryEncoded.amount || 0,
|
|
12958
|
+
inputValue: centsToDollars(splitEntryEncoded.amount),
|
|
12959
|
+
category: splitEntryEncoded.category ? new ApiCategorizationAsOption(splitEntryEncoded.category) : null,
|
|
12960
|
+
tags: splitEntryEncoded.tags.map((tag) => makeTagFromTransactionTag(index.Schema.decodeSync(TransactionTagSchema)(tag))),
|
|
12961
|
+
customerVendor: splitEntryEncoded.customer ? decodeCustomerVendor(__spreadProps(__spreadValues({}, splitEntryEncoded.customer), { customerVendorType: "CUSTOMER" })) : splitEntryEncoded.vendor ? decodeCustomerVendor(__spreadProps(__spreadValues({}, splitEntryEncoded.vendor), { customerVendorType: "VENDOR" })) : null
|
|
12962
|
+
}));
|
|
12963
|
+
return new SplitAsOption(splits);
|
|
12964
|
+
}
|
|
12965
|
+
return new ApiCategorizationAsOption(categorization);
|
|
12966
|
+
};
|
|
12795
12967
|
function getLeafCategories$1(category) {
|
|
12796
12968
|
if (!category.subCategories || category.subCategories.length === 0) {
|
|
12797
12969
|
return [category];
|
|
@@ -12837,18 +13009,18 @@ const getSuggestedCategoriesGroup = (bankTransaction) => {
|
|
|
12837
13009
|
if ((categorizationFlow == null ? void 0 : categorizationFlow.type) === CategorizationType.ASK_FROM_SUGGESTIONS && hasSuggestions(categorizationFlow)) {
|
|
12838
13010
|
return {
|
|
12839
13011
|
label: "SUGGESTIONS",
|
|
12840
|
-
options: categorizationFlow.suggestions.map((suggestion) =>
|
|
13012
|
+
options: categorizationFlow.suggestions.map((suggestion) => convertCategorizationToOption(suggestion))
|
|
12841
13013
|
};
|
|
12842
13014
|
}
|
|
12843
13015
|
return null;
|
|
12844
13016
|
};
|
|
12845
|
-
const getDefaultSelectedCategoryForBankTransaction = (bankTransaction) => {
|
|
13017
|
+
const getDefaultSelectedCategoryForBankTransaction = (bankTransaction, ignoreSuggestedMatches = false) => {
|
|
12846
13018
|
var _a;
|
|
12847
|
-
if ((_a = bankTransaction.suggested_matches) == null ? void 0 : _a[0]) {
|
|
13019
|
+
if (!ignoreSuggestedMatches && ((_a = bankTransaction.suggested_matches) == null ? void 0 : _a[0])) {
|
|
12848
13020
|
return new SuggestedMatchAsOption(bankTransaction.suggested_matches[0]);
|
|
12849
13021
|
}
|
|
12850
13022
|
if (hasSuggestions(bankTransaction.categorization_flow)) {
|
|
12851
|
-
return
|
|
13023
|
+
return convertCategorizationToOption(bankTransaction.categorization_flow.suggestions[0]);
|
|
12852
13024
|
}
|
|
12853
13025
|
return null;
|
|
12854
13026
|
};
|
|
@@ -12896,8 +13068,8 @@ function useCategories({ mode } = {}) {
|
|
|
12896
13068
|
function usePreloadCategories(options2) {
|
|
12897
13069
|
useCategories(options2);
|
|
12898
13070
|
}
|
|
12899
|
-
const Scissors = (
|
|
12900
|
-
var
|
|
13071
|
+
const Scissors = (_ib) => {
|
|
13072
|
+
var _jb = _ib, { size = 11 } = _jb, props = __objRest(_jb, ["size"]);
|
|
12901
13073
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12902
13074
|
"svg",
|
|
12903
13075
|
__spreadProps(__spreadValues({
|
|
@@ -13053,8 +13225,8 @@ const DateTime = ({
|
|
|
13053
13225
|
};
|
|
13054
13226
|
const CLASS_NAME$8 = "Layer__MoneyText";
|
|
13055
13227
|
const MoneySpan = react.forwardRef(
|
|
13056
|
-
(
|
|
13057
|
-
var
|
|
13228
|
+
(_kb, ref) => {
|
|
13229
|
+
var _lb = _kb, { amount, bold, size, displayPlusSign } = _lb, restProps = __objRest(_lb, ["amount", "bold", "size", "displayPlusSign"]);
|
|
13058
13230
|
const dataProperties = toDataProperties({
|
|
13059
13231
|
bold,
|
|
13060
13232
|
positive: amount >= 0,
|
|
@@ -13076,7 +13248,7 @@ const BankTransactionCategoryComboBoxSelectedValue = ({ selectedValue }) => {
|
|
|
13076
13248
|
/* @__PURE__ */ jsxRuntime.jsx(Span, { ellipsis: true, children: selectedValue.label })
|
|
13077
13249
|
] });
|
|
13078
13250
|
}
|
|
13079
|
-
if (isSplitAsOption(selectedValue)) {
|
|
13251
|
+
if (isSplitAsOption(selectedValue) && selectedValue.original.length > 1) {
|
|
13080
13252
|
return /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "3xs", align: "center", children: [
|
|
13081
13253
|
/* @__PURE__ */ jsxRuntime.jsx(Badge, { size: BadgeSize.SMALL, icon: /* @__PURE__ */ jsxRuntime.jsx(Scissors, { size: 11 }), children: "Split" }),
|
|
13082
13254
|
/* @__PURE__ */ jsxRuntime.jsx(Span, { ellipsis: true, children: selectedValue.label })
|
|
@@ -13127,7 +13299,6 @@ const BankTransactionCategoryComboBox = ({
|
|
|
13127
13299
|
inputId
|
|
13128
13300
|
}) => {
|
|
13129
13301
|
const { data: categories } = useCategories();
|
|
13130
|
-
const loadingSuggestions = bankTransaction && isLoadingSuggestions(bankTransaction);
|
|
13131
13302
|
const matchGroup = react.useMemo(() => {
|
|
13132
13303
|
if (!includeSuggestedMatches || !bankTransaction) return null;
|
|
13133
13304
|
return getSuggestedMatchesGroup(bankTransaction);
|
|
@@ -13153,6 +13324,7 @@ const BankTransactionCategoryComboBox = ({
|
|
|
13153
13324
|
[allCategoriesGroup, categoryGroups, matchGroup, suggestedGroup]
|
|
13154
13325
|
);
|
|
13155
13326
|
const numMatchOptions = (matchGroup == null ? void 0 : matchGroup.options.length) || 0;
|
|
13327
|
+
const loadingSuggestions = bankTransaction && isLoadingSuggestions(bankTransaction) && selectedValue === null;
|
|
13156
13328
|
const placeholder = numMatchOptions > 1 ? `${numMatchOptions} possible matches...` : loadingSuggestions ? "Generating suggestions..." : "Categorize or match...";
|
|
13157
13329
|
const SelectedValue = react.useMemo(() => {
|
|
13158
13330
|
return /* @__PURE__ */ jsxRuntime.jsx(BankTransactionCategoryComboBoxSelectedValue, { selectedValue });
|
|
@@ -13236,22 +13408,9 @@ function BulkSelectionStoreProvider({
|
|
|
13236
13408
|
const [store] = react.useState(() => buildStore$1());
|
|
13237
13409
|
return /* @__PURE__ */ jsxRuntime.jsx(BulkSelectionStoreContext.Provider, { value: store, children });
|
|
13238
13410
|
}
|
|
13239
|
-
const
|
|
13240
|
-
var _a;
|
|
13241
|
-
if (bankTransaction == null ? void 0 : bankTransaction.match) {
|
|
13242
|
-
const foundMatch = (_a = bankTransaction.suggested_matches) == null ? void 0 : _a.find(
|
|
13243
|
-
(x) => {
|
|
13244
|
-
var _a2, _b;
|
|
13245
|
-
return x.details.id === ((_a2 = bankTransaction == null ? void 0 : bankTransaction.match) == null ? void 0 : _a2.details.id) || x.details.id === ((_b = bankTransaction == null ? void 0 : bankTransaction.match) == null ? void 0 : _b.bank_transaction.id);
|
|
13246
|
-
}
|
|
13247
|
-
);
|
|
13248
|
-
return foundMatch == null ? void 0 : foundMatch.id;
|
|
13249
|
-
}
|
|
13250
|
-
return void 0;
|
|
13251
|
-
};
|
|
13252
|
-
const validateSplit = (splitData) => {
|
|
13411
|
+
const validateSplit = (localSplits) => {
|
|
13253
13412
|
let valid = true;
|
|
13254
|
-
|
|
13413
|
+
localSplits.forEach((split) => {
|
|
13255
13414
|
if (split.amount <= 0) {
|
|
13256
13415
|
valid = false;
|
|
13257
13416
|
} else if (!split.category) {
|
|
@@ -13260,6 +13419,137 @@ const validateSplit = (splitData) => {
|
|
|
13260
13419
|
});
|
|
13261
13420
|
return valid;
|
|
13262
13421
|
};
|
|
13422
|
+
const calculateAddSplit = (initialRowSplits) => {
|
|
13423
|
+
const newSplit = {
|
|
13424
|
+
amount: 0,
|
|
13425
|
+
category: null,
|
|
13426
|
+
tags: [],
|
|
13427
|
+
customerVendor: null
|
|
13428
|
+
};
|
|
13429
|
+
return [...initialRowSplits, newSplit];
|
|
13430
|
+
};
|
|
13431
|
+
const calculateRemoveSplit = (initialRowSplits, { totalAmount, index: index2 }) => {
|
|
13432
|
+
const newSplits = initialRowSplits.filter((_v, idx) => idx !== index2);
|
|
13433
|
+
const splitTotal = newSplits.reduce((sum, split, index22) => {
|
|
13434
|
+
const splitAmount = index22 === 0 ? 0 : split.amount;
|
|
13435
|
+
return sum + splitAmount;
|
|
13436
|
+
}, 0);
|
|
13437
|
+
const remaining = totalAmount - splitTotal;
|
|
13438
|
+
newSplits[0].amount = remaining;
|
|
13439
|
+
return newSplits;
|
|
13440
|
+
};
|
|
13441
|
+
const calculateUpdatedAmounts = (initialRowSplits, { index: index2, newAmountInput, totalAmount }) => {
|
|
13442
|
+
const newAmount = Number(newAmountInput) * 100;
|
|
13443
|
+
const splitTotal = initialRowSplits.reduce((sum, split, idx) => {
|
|
13444
|
+
const amount = idx === 0 ? 0 : idx === index2 ? newAmount : split.amount;
|
|
13445
|
+
return sum + amount;
|
|
13446
|
+
}, 0);
|
|
13447
|
+
const remaining = totalAmount - splitTotal;
|
|
13448
|
+
initialRowSplits[index2].amount = newAmount;
|
|
13449
|
+
initialRowSplits[0].amount = remaining;
|
|
13450
|
+
return [...initialRowSplits];
|
|
13451
|
+
};
|
|
13452
|
+
const getCustomerVendorForBankTransaction = (bankTransaction) => {
|
|
13453
|
+
return bankTransaction.customer ? decodeCustomerVendor(__spreadProps(__spreadValues({}, bankTransaction.customer), { customerVendorType: "CUSTOMER" })) : bankTransaction.vendor ? decodeCustomerVendor(__spreadProps(__spreadValues({}, bankTransaction.vendor), { customerVendorType: "VENDOR" })) : null;
|
|
13454
|
+
};
|
|
13455
|
+
const getLocalSplitStateForExpandedTableRow = (selectedCategory, bankTransaction) => {
|
|
13456
|
+
let coercedSelectedCategory = selectedCategory;
|
|
13457
|
+
if (!selectedCategory || isPlaceholderAsOption(selectedCategory)) {
|
|
13458
|
+
coercedSelectedCategory = null;
|
|
13459
|
+
} else if (isSuggestedMatchAsOption(selectedCategory)) {
|
|
13460
|
+
coercedSelectedCategory = getDefaultSelectedCategoryForBankTransaction(bankTransaction, true);
|
|
13461
|
+
}
|
|
13462
|
+
if (selectedCategory && isSplitAsOption(selectedCategory)) {
|
|
13463
|
+
return selectedCategory.original.map((splitEntry) => {
|
|
13464
|
+
return {
|
|
13465
|
+
amount: splitEntry.amount || 0,
|
|
13466
|
+
category: splitEntry.category,
|
|
13467
|
+
tags: splitEntry.tags,
|
|
13468
|
+
customerVendor: splitEntry.customerVendor
|
|
13469
|
+
};
|
|
13470
|
+
});
|
|
13471
|
+
}
|
|
13472
|
+
return [
|
|
13473
|
+
{
|
|
13474
|
+
amount: bankTransaction.amount,
|
|
13475
|
+
category: coercedSelectedCategory != null ? coercedSelectedCategory : null,
|
|
13476
|
+
tags: bankTransaction.transaction_tags.map((tag) => makeTagFromTransactionTag(index.Schema.decodeSync(TransactionTagSchema)(tag))),
|
|
13477
|
+
customerVendor: getCustomerVendorForBankTransaction(bankTransaction)
|
|
13478
|
+
}
|
|
13479
|
+
];
|
|
13480
|
+
};
|
|
13481
|
+
function buildStore() {
|
|
13482
|
+
return zustand.createStore((set) => ({
|
|
13483
|
+
transactionCategories: /* @__PURE__ */ new Map(),
|
|
13484
|
+
actions: {
|
|
13485
|
+
setTransactionCategory: (id, category) => {
|
|
13486
|
+
set((state) => {
|
|
13487
|
+
const newMap = new Map(state.transactionCategories);
|
|
13488
|
+
newMap.set(id, category);
|
|
13489
|
+
return { transactionCategories: newMap };
|
|
13490
|
+
});
|
|
13491
|
+
},
|
|
13492
|
+
setOnlyNewTransactionCategories: (transactionCategories) => {
|
|
13493
|
+
set((state) => {
|
|
13494
|
+
const newMap = new Map(state.transactionCategories);
|
|
13495
|
+
let hasChanges = false;
|
|
13496
|
+
transactionCategories.forEach(({ id, category }) => {
|
|
13497
|
+
if (!newMap.has(id)) {
|
|
13498
|
+
newMap.set(id, category);
|
|
13499
|
+
hasChanges = true;
|
|
13500
|
+
}
|
|
13501
|
+
});
|
|
13502
|
+
return hasChanges ? { transactionCategories: newMap } : state;
|
|
13503
|
+
});
|
|
13504
|
+
},
|
|
13505
|
+
clearTransactionCategory: (id) => {
|
|
13506
|
+
set((state) => {
|
|
13507
|
+
const newMap = new Map(state.transactionCategories);
|
|
13508
|
+
newMap.delete(id);
|
|
13509
|
+
return { transactionCategories: newMap };
|
|
13510
|
+
});
|
|
13511
|
+
},
|
|
13512
|
+
clearMultipleTransactionCategories: (ids) => {
|
|
13513
|
+
set((state) => {
|
|
13514
|
+
const newMap = new Map(state.transactionCategories);
|
|
13515
|
+
ids.forEach((id) => newMap.delete(id));
|
|
13516
|
+
return { transactionCategories: newMap };
|
|
13517
|
+
});
|
|
13518
|
+
},
|
|
13519
|
+
clearAllTransactionCategories: () => {
|
|
13520
|
+
set({ transactionCategories: /* @__PURE__ */ new Map() });
|
|
13521
|
+
}
|
|
13522
|
+
}
|
|
13523
|
+
}));
|
|
13524
|
+
}
|
|
13525
|
+
const BankTransactionsCategoryStoreContext = react.createContext(null);
|
|
13526
|
+
function useBankTransactionsCategoryStore() {
|
|
13527
|
+
const store = react.useContext(BankTransactionsCategoryStoreContext);
|
|
13528
|
+
if (!store) {
|
|
13529
|
+
throw new Error("useBankTransactionsCategoryStore must be used within BankTransactionsCategoryStoreProvider");
|
|
13530
|
+
}
|
|
13531
|
+
return store;
|
|
13532
|
+
}
|
|
13533
|
+
function useBankTransactionsCategoryActions() {
|
|
13534
|
+
const store = useBankTransactionsCategoryStore();
|
|
13535
|
+
return zustand.useStore(store, (state) => state.actions);
|
|
13536
|
+
}
|
|
13537
|
+
function useGetBankTransactionCategory(transactionId) {
|
|
13538
|
+
const store = useBankTransactionsCategoryStore();
|
|
13539
|
+
const selectedCategory = zustand.useStore(store, (state) => state.transactionCategories.get(transactionId));
|
|
13540
|
+
return { selectedCategory };
|
|
13541
|
+
}
|
|
13542
|
+
function useGetAllBankTransactionsCategories() {
|
|
13543
|
+
const store = useBankTransactionsCategoryStore();
|
|
13544
|
+
const transactionCategories = zustand.useStore(store, (state) => state.transactionCategories);
|
|
13545
|
+
return { transactionCategories };
|
|
13546
|
+
}
|
|
13547
|
+
function BankTransactionsCategoryStoreProvider({
|
|
13548
|
+
children
|
|
13549
|
+
}) {
|
|
13550
|
+
const [store] = react.useState(() => buildStore());
|
|
13551
|
+
return /* @__PURE__ */ jsxRuntime.jsx(BankTransactionsCategoryStoreContext.Provider, { value: store, children });
|
|
13552
|
+
}
|
|
13263
13553
|
const ExpandedBankTransactionRow = react.forwardRef(
|
|
13264
13554
|
({
|
|
13265
13555
|
bankTransaction,
|
|
@@ -13272,12 +13562,14 @@ const ExpandedBankTransactionRow = react.forwardRef(
|
|
|
13272
13562
|
showDescriptions,
|
|
13273
13563
|
showReceiptUploads
|
|
13274
13564
|
}, ref) => {
|
|
13275
|
-
var _a, _b
|
|
13565
|
+
var _a, _b;
|
|
13276
13566
|
const {
|
|
13277
13567
|
categorize: categorizeBankTransaction2,
|
|
13278
13568
|
match: matchBankTransaction2
|
|
13279
13569
|
} = useBankTransactionsContext();
|
|
13280
13570
|
const { deselect } = useBulkSelectionActions();
|
|
13571
|
+
const { selectedCategory } = useGetBankTransactionCategory(bankTransaction.id);
|
|
13572
|
+
const { setTransactionCategory } = useBankTransactionsCategoryActions();
|
|
13281
13573
|
const { trigger: tagBankTransaction2 } = useTagBankTransaction({ bankTransactionId: bankTransaction.id });
|
|
13282
13574
|
const { trigger: removeTagFromBankTransaction2 } = useRemoveTagFromBankTransaction({ bankTransactionId: bankTransaction.id });
|
|
13283
13575
|
const { trigger: setMetadataOnBankTransaction2 } = useSetMetadataOnBankTransaction({ bankTransactionId: bankTransaction.id });
|
|
@@ -13287,146 +13579,71 @@ const ExpandedBankTransactionRow = react.forwardRef(
|
|
|
13287
13579
|
bankTransaction.category ? "categorize" : hasMatch(bankTransaction) ? "match" : "categorize"
|
|
13288
13580
|
/* categorize */
|
|
13289
13581
|
);
|
|
13290
|
-
const [
|
|
13291
|
-
(
|
|
13582
|
+
const [selectedMatch, setSelectedMatch] = react.useState(
|
|
13583
|
+
(_b = getBankTransactionMatchAsSuggestedMatch(bankTransaction)) != null ? _b : (_a = bankTransaction == null ? void 0 : bankTransaction.suggested_matches) == null ? void 0 : _a[0]
|
|
13292
13584
|
);
|
|
13293
13585
|
const [matchFormError, setMatchFormError] = react.useState();
|
|
13294
13586
|
const [splitFormError, setSplitFormError] = react.useState();
|
|
13295
13587
|
const bodyRef = react.useRef(null);
|
|
13296
|
-
const
|
|
13297
|
-
|
|
13298
|
-
|
|
13299
|
-
|
|
13300
|
-
|
|
13301
|
-
id,
|
|
13302
|
-
key,
|
|
13303
|
-
value,
|
|
13304
|
-
dimensionDisplayName: dimension_display_name,
|
|
13305
|
-
valueDisplayName: value_display_name,
|
|
13306
|
-
archivedAt: archived_at,
|
|
13307
|
-
_local: {
|
|
13308
|
-
isOptimistic: (_a2 = _local == null ? void 0 : _local.isOptimistic) != null ? _a2 : false
|
|
13309
|
-
}
|
|
13310
|
-
});
|
|
13311
|
-
});
|
|
13312
|
-
const [rowState, updateRowState] = react.useState({
|
|
13313
|
-
splits: bankTransaction.category && isSplitCategorizationEncoded(bankTransaction.category) ? (_e = bankTransaction.category) == null ? void 0 : _e.entries.map((c) => {
|
|
13314
|
-
var _a2, _b2;
|
|
13315
|
-
const splitTags = (_b2 = (_a2 = c.tags) == null ? void 0 : _a2.map((tag) => makeTagFromTransactionTag({
|
|
13316
|
-
id: tag.id,
|
|
13317
|
-
key: tag.key,
|
|
13318
|
-
value: tag.value,
|
|
13319
|
-
dimensionDisplayName: tag.dimension_display_name,
|
|
13320
|
-
valueDisplayName: tag.value_display_name,
|
|
13321
|
-
createdAt: new Date(tag.created_at),
|
|
13322
|
-
updatedAt: new Date(tag.updated_at),
|
|
13323
|
-
deletedAt: tag.deleted_at ? new Date(tag.deleted_at) : null,
|
|
13324
|
-
archivedAt: tag.archived_at ? new Date(tag.archived_at) : null,
|
|
13325
|
-
_local: tag._local
|
|
13326
|
-
}))) != null ? _b2 : [];
|
|
13327
|
-
const splitCustomerVendor = c.customer ? decodeCustomerVendor(__spreadProps(__spreadValues({}, c.customer), { customerVendorType: "CUSTOMER" })) : c.vendor ? decodeCustomerVendor(__spreadProps(__spreadValues({}, c.vendor), { customerVendorType: "VENDOR" })) : null;
|
|
13328
|
-
return {
|
|
13329
|
-
amount: c.amount || 0,
|
|
13330
|
-
inputValue: centsToDollars(c.amount),
|
|
13331
|
-
category: new ApiCategorizationAsOption(c.category),
|
|
13332
|
-
tags: splitTags,
|
|
13333
|
-
customerVendor: splitCustomerVendor
|
|
13334
|
-
};
|
|
13335
|
-
}) : [
|
|
13336
|
-
{
|
|
13337
|
-
amount: bankTransaction.amount,
|
|
13338
|
-
inputValue: centsToDollars(bankTransaction.amount),
|
|
13339
|
-
category: defaultCategory ? new ApiCategorizationAsOption(defaultCategory) : null,
|
|
13340
|
-
tags: initialTags,
|
|
13341
|
-
customerVendor: initialCustomerVendor
|
|
13342
|
-
}
|
|
13343
|
-
],
|
|
13344
|
-
description: "",
|
|
13345
|
-
file: void 0
|
|
13346
|
-
});
|
|
13588
|
+
const [localSplits, setLocalSplits] = react.useState(getLocalSplitStateForExpandedTableRow(selectedCategory, bankTransaction));
|
|
13589
|
+
react.useEffect(() => {
|
|
13590
|
+
setLocalSplits(getLocalSplitStateForExpandedTableRow(selectedCategory, bankTransaction));
|
|
13591
|
+
setSplitFormError(void 0);
|
|
13592
|
+
}, [selectedCategory, bankTransaction, isOpen]);
|
|
13347
13593
|
const addSplit = () => {
|
|
13348
|
-
|
|
13349
|
-
|
|
13350
|
-
...rowState.splits,
|
|
13351
|
-
{
|
|
13352
|
-
amount: 0,
|
|
13353
|
-
inputValue: "0.00",
|
|
13354
|
-
category: defaultCategory ? new ApiCategorizationAsOption(defaultCategory) : null,
|
|
13355
|
-
tags: [],
|
|
13356
|
-
customerVendor: initialCustomerVendor
|
|
13357
|
-
}
|
|
13358
|
-
]
|
|
13359
|
-
}));
|
|
13594
|
+
const newSplits = calculateAddSplit(localSplits);
|
|
13595
|
+
setLocalSplits(newSplits);
|
|
13360
13596
|
setSplitFormError(void 0);
|
|
13361
13597
|
};
|
|
13362
13598
|
const removeSplit = (index2) => {
|
|
13363
|
-
const newSplits =
|
|
13364
|
-
|
|
13365
|
-
const amount = index22 === 0 ? 0 : split.amount;
|
|
13366
|
-
return sum + amount;
|
|
13367
|
-
}, 0);
|
|
13368
|
-
const remaining = bankTransaction.amount - splitTotal;
|
|
13369
|
-
newSplits[0].amount = remaining;
|
|
13370
|
-
newSplits[0].inputValue = centsToDollars(remaining);
|
|
13371
|
-
updateRowState(__spreadProps(__spreadValues({}, rowState), {
|
|
13372
|
-
splits: newSplits
|
|
13373
|
-
}));
|
|
13599
|
+
const newSplits = calculateRemoveSplit(localSplits, { totalAmount: bankTransaction.amount, index: index2 });
|
|
13600
|
+
setLocalSplits(newSplits);
|
|
13374
13601
|
setSplitFormError(void 0);
|
|
13375
13602
|
};
|
|
13376
|
-
const
|
|
13377
|
-
|
|
13378
|
-
const
|
|
13379
|
-
|
|
13380
|
-
sanitized = parts[0] + "." + parts.slice(1).join("");
|
|
13381
|
-
}
|
|
13382
|
-
if (parts.length === 2) {
|
|
13383
|
-
sanitized = parts[0] + "." + parts[1].slice(0, 2);
|
|
13384
|
-
}
|
|
13385
|
-
return sanitized;
|
|
13386
|
-
};
|
|
13387
|
-
const updateAmounts = (rowNumber) => (event) => {
|
|
13388
|
-
const newDisplaying = sanitizeNumberInput(event.target.value);
|
|
13389
|
-
const newAmount = Number(newDisplaying) * 100;
|
|
13390
|
-
const splitTotal = rowState.splits.reduce((sum, split, index2) => {
|
|
13391
|
-
const amount = index2 === 0 ? 0 : index2 === rowNumber ? newAmount : split.amount;
|
|
13392
|
-
return sum + amount;
|
|
13393
|
-
}, 0);
|
|
13394
|
-
const remaining = bankTransaction.amount - splitTotal;
|
|
13395
|
-
rowState.splits[rowNumber].amount = newAmount;
|
|
13396
|
-
rowState.splits[rowNumber].inputValue = newDisplaying;
|
|
13397
|
-
rowState.splits[0].amount = remaining;
|
|
13398
|
-
rowState.splits[0].inputValue = centsToDollars(remaining);
|
|
13399
|
-
updateRowState(__spreadValues({}, rowState));
|
|
13603
|
+
const updateAmounts = (index2) => (value) => {
|
|
13604
|
+
if (!value) return;
|
|
13605
|
+
const newLocalSplits = calculateUpdatedAmounts(localSplits, { index: index2, newAmountInput: value, totalAmount: bankTransaction.amount });
|
|
13606
|
+
setLocalSplits(newLocalSplits);
|
|
13400
13607
|
setSplitFormError(void 0);
|
|
13608
|
+
if (validateSplit(newLocalSplits)) {
|
|
13609
|
+
setTransactionCategory(bankTransaction.id, new SplitAsOption(newLocalSplits));
|
|
13610
|
+
}
|
|
13401
13611
|
};
|
|
13402
|
-
const onBlur = (
|
|
13403
|
-
if (
|
|
13404
|
-
|
|
13405
|
-
|
|
13406
|
-
updateRowState(__spreadValues({}, rowState));
|
|
13407
|
-
setSplitFormError(void 0);
|
|
13612
|
+
const onBlur = () => {
|
|
13613
|
+
if (!validateSplit(localSplits)) {
|
|
13614
|
+
setSplitFormError("Amounts must be greater than $0.00");
|
|
13615
|
+
return;
|
|
13408
13616
|
}
|
|
13617
|
+
setSplitFormError(void 0);
|
|
13409
13618
|
};
|
|
13410
13619
|
const onChangePurpose = (event) => {
|
|
13411
|
-
|
|
13412
|
-
|
|
13413
|
-
|
|
13414
|
-
|
|
13620
|
+
const newPurpose = event.target.value === "match" ? "match" : "categorize";
|
|
13621
|
+
setPurpose(newPurpose);
|
|
13622
|
+
if (newPurpose === "match") {
|
|
13623
|
+
setTransactionCategory(bankTransaction.id, selectedMatch ? new SuggestedMatchAsOption(selectedMatch) : null);
|
|
13624
|
+
} else if (newPurpose === "categorize" && validateSplit(localSplits)) {
|
|
13625
|
+
setTransactionCategory(bankTransaction.id, new SplitAsOption(localSplits));
|
|
13626
|
+
}
|
|
13415
13627
|
setSplitFormError(void 0);
|
|
13416
13628
|
setMatchFormError(void 0);
|
|
13417
13629
|
};
|
|
13418
|
-
const changeCategory = (index2,
|
|
13419
|
-
if (
|
|
13420
|
-
|
|
13421
|
-
|
|
13630
|
+
const changeCategory = (index2, newCategory) => {
|
|
13631
|
+
if (newCategory === null) return;
|
|
13632
|
+
localSplits[index2].category = newCategory;
|
|
13633
|
+
const newLocalSplits = [...localSplits];
|
|
13634
|
+
setLocalSplits(newLocalSplits);
|
|
13422
13635
|
setSplitFormError(void 0);
|
|
13636
|
+
if (validateSplit(newLocalSplits)) {
|
|
13637
|
+
setTransactionCategory(bankTransaction.id, new SplitAsOption(newLocalSplits));
|
|
13638
|
+
}
|
|
13423
13639
|
};
|
|
13424
13640
|
const changeTags = (index2, newTags) => {
|
|
13425
|
-
const oldTags =
|
|
13426
|
-
|
|
13427
|
-
|
|
13641
|
+
const oldTags = localSplits[index2].tags;
|
|
13642
|
+
localSplits[index2].tags = newTags;
|
|
13643
|
+
const newLocalSplits = [...localSplits];
|
|
13644
|
+
setLocalSplits(newLocalSplits);
|
|
13428
13645
|
setSplitFormError(void 0);
|
|
13429
|
-
if (
|
|
13646
|
+
if (newLocalSplits.length === 1) {
|
|
13430
13647
|
const addedTags = newTags.filter(
|
|
13431
13648
|
(newTag) => !oldTags.some((oldTag) => oldTag.key === newTag.key && oldTag.value === newTag.value)
|
|
13432
13649
|
);
|
|
@@ -13447,32 +13664,40 @@ const ExpandedBankTransactionRow = react.forwardRef(
|
|
|
13447
13664
|
});
|
|
13448
13665
|
});
|
|
13449
13666
|
}
|
|
13667
|
+
if (validateSplit(newLocalSplits)) {
|
|
13668
|
+
setTransactionCategory(bankTransaction.id, new SplitAsOption(newLocalSplits));
|
|
13669
|
+
}
|
|
13450
13670
|
};
|
|
13451
13671
|
const changeCustomerVendor = (index2, newCustomerVendor) => {
|
|
13452
|
-
|
|
13453
|
-
|
|
13672
|
+
localSplits[index2].customerVendor = newCustomerVendor;
|
|
13673
|
+
const newLocalSplits = [...localSplits];
|
|
13674
|
+
setLocalSplits(newLocalSplits);
|
|
13454
13675
|
setSplitFormError(void 0);
|
|
13455
|
-
if (
|
|
13676
|
+
if (newLocalSplits.length === 1) {
|
|
13456
13677
|
void setMetadataOnBankTransaction2({
|
|
13457
13678
|
customer: (newCustomerVendor == null ? void 0 : newCustomerVendor.customerVendorType) === "CUSTOMER" ? newCustomerVendor : null,
|
|
13458
13679
|
vendor: (newCustomerVendor == null ? void 0 : newCustomerVendor.customerVendorType) === "VENDOR" ? newCustomerVendor : null
|
|
13459
13680
|
});
|
|
13460
13681
|
}
|
|
13682
|
+
if (validateSplit(newLocalSplits)) {
|
|
13683
|
+
setTransactionCategory(bankTransaction.id, new SplitAsOption(newLocalSplits));
|
|
13684
|
+
}
|
|
13461
13685
|
};
|
|
13462
13686
|
const save = () => __async(null, null, function* () {
|
|
13687
|
+
var _a2;
|
|
13463
13688
|
if (purpose === "match") {
|
|
13464
|
-
if (!
|
|
13689
|
+
if (!selectedMatch) {
|
|
13465
13690
|
setMatchFormError("Select an option to match the transaction");
|
|
13466
13691
|
return;
|
|
13467
|
-
} else if (
|
|
13468
|
-
yield onMatchSubmit(
|
|
13692
|
+
} else if (selectedMatch && selectedMatch.id !== ((_a2 = getBankTransactionMatchAsSuggestedMatch(bankTransaction)) == null ? void 0 : _a2.id)) {
|
|
13693
|
+
yield onMatchSubmit(selectedMatch.id);
|
|
13469
13694
|
return;
|
|
13470
13695
|
}
|
|
13471
13696
|
close2();
|
|
13472
13697
|
return;
|
|
13473
13698
|
}
|
|
13474
|
-
if (!validateSplit(
|
|
13475
|
-
if (
|
|
13699
|
+
if (!validateSplit(localSplits)) {
|
|
13700
|
+
if (localSplits.length > 1) {
|
|
13476
13701
|
setSplitFormError(
|
|
13477
13702
|
"Use only positive amounts and select category for each entry"
|
|
13478
13703
|
);
|
|
@@ -13483,19 +13708,19 @@ const ExpandedBankTransactionRow = react.forwardRef(
|
|
|
13483
13708
|
}
|
|
13484
13709
|
yield categorizeBankTransaction2(
|
|
13485
13710
|
bankTransaction.id,
|
|
13486
|
-
|
|
13711
|
+
localSplits.length === 1 && localSplits[0].category ? {
|
|
13487
13712
|
type: "Category",
|
|
13488
|
-
category:
|
|
13713
|
+
category: localSplits[0].category.classificationEncoded
|
|
13489
13714
|
} : {
|
|
13490
13715
|
type: "Split",
|
|
13491
|
-
entries:
|
|
13492
|
-
var
|
|
13716
|
+
entries: localSplits.map((split) => {
|
|
13717
|
+
var _a3, _b2, _c;
|
|
13493
13718
|
return {
|
|
13494
|
-
category: (
|
|
13719
|
+
category: (_a3 = split.category) == null ? void 0 : _a3.classificationEncoded,
|
|
13495
13720
|
amount: split.amount,
|
|
13496
13721
|
tags: split.tags.map((tag) => makeTagKeyValueFromTag(tag)),
|
|
13497
13722
|
customer_id: ((_b2 = split.customerVendor) == null ? void 0 : _b2.customerVendorType) === "CUSTOMER" ? split.customerVendor.id : null,
|
|
13498
|
-
vendor_id: ((
|
|
13723
|
+
vendor_id: ((_c = split.customerVendor) == null ? void 0 : _c.customerVendorType) === "VENDOR" ? split.customerVendor.id : null
|
|
13499
13724
|
};
|
|
13500
13725
|
})
|
|
13501
13726
|
}
|
|
@@ -13520,7 +13745,7 @@ const ExpandedBankTransactionRow = react.forwardRef(
|
|
|
13520
13745
|
});
|
|
13521
13746
|
const bookkeepingStatus = useEffectiveBookkeepingStatus();
|
|
13522
13747
|
const categorizationEnabled = isCategorizationEnabledForStatus(bookkeepingStatus);
|
|
13523
|
-
const effectiveSplits = categorizationEnabled ?
|
|
13748
|
+
const effectiveSplits = categorizationEnabled ? localSplits : [];
|
|
13524
13749
|
const className = "Layer__expanded-bank-transaction-row";
|
|
13525
13750
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13526
13751
|
"span",
|
|
@@ -13568,11 +13793,11 @@ const ExpandedBankTransactionRow = react.forwardRef(
|
|
|
13568
13793
|
{
|
|
13569
13794
|
classNamePrefix: className,
|
|
13570
13795
|
bankTransaction,
|
|
13571
|
-
selectedMatchId,
|
|
13796
|
+
selectedMatchId: selectedMatch == null ? void 0 : selectedMatch.id,
|
|
13572
13797
|
readOnly: !categorizationEnabled,
|
|
13573
|
-
|
|
13798
|
+
setSelectedMatch: (suggestedMatch) => {
|
|
13574
13799
|
setMatchFormError(void 0);
|
|
13575
|
-
|
|
13800
|
+
setSelectedMatch(suggestedMatch);
|
|
13576
13801
|
},
|
|
13577
13802
|
matchFormError
|
|
13578
13803
|
}
|
|
@@ -13594,18 +13819,16 @@ const ExpandedBankTransactionRow = react.forwardRef(
|
|
|
13594
13819
|
className: `${className}__table-cell--split-entry`,
|
|
13595
13820
|
children: [
|
|
13596
13821
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13597
|
-
|
|
13822
|
+
AmountInput,
|
|
13598
13823
|
{
|
|
13599
|
-
type: "text",
|
|
13600
13824
|
name: `split-${index2}${asListItem ? "-li" : ""}`,
|
|
13601
13825
|
disabled: index2 === 0 || !categorizationEnabled,
|
|
13602
13826
|
onChange: updateAmounts(index2),
|
|
13603
|
-
value: split.
|
|
13827
|
+
value: convertFromCents(split.amount),
|
|
13604
13828
|
onBlur,
|
|
13829
|
+
className: `${className}__table-cell--split-entry__amount`,
|
|
13605
13830
|
isInvalid: split.amount < 0,
|
|
13606
|
-
|
|
13607
|
-
errorMessage: "Negative values are not allowed",
|
|
13608
|
-
className: `${className}__table-cell--split-entry__amount`
|
|
13831
|
+
errorMessage: "Amounts must be greater than $0.00"
|
|
13609
13832
|
}
|
|
13610
13833
|
),
|
|
13611
13834
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -13619,15 +13842,16 @@ const ExpandedBankTransactionRow = react.forwardRef(
|
|
|
13619
13842
|
includeSuggestedMatches: false
|
|
13620
13843
|
}
|
|
13621
13844
|
),
|
|
13622
|
-
showTags && /* @__PURE__ */ jsxRuntime.jsx(
|
|
13845
|
+
showTags && /* @__PURE__ */ jsxRuntime.jsx(
|
|
13623
13846
|
TagDimensionsGroup,
|
|
13624
13847
|
{
|
|
13625
13848
|
value: split.tags,
|
|
13626
13849
|
onChange: (tags) => changeTags(index2, tags),
|
|
13627
13850
|
showLabels: false,
|
|
13628
|
-
isReadOnly: !categorizationEnabled
|
|
13851
|
+
isReadOnly: !categorizationEnabled,
|
|
13852
|
+
className: `${className}__table-cell--split-entry__tags`
|
|
13629
13853
|
}
|
|
13630
|
-
)
|
|
13854
|
+
),
|
|
13631
13855
|
showCustomerVendor && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__expanded-bank-transaction-row__table-cell--split-entry__customer", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13632
13856
|
CustomerVendorSelector,
|
|
13633
13857
|
{
|
|
@@ -13892,8 +14116,8 @@ const getMonthNameFromNumber = (monthNumber) => {
|
|
|
13892
14116
|
}
|
|
13893
14117
|
return (_a = monthNames.at(monthNumber - 1)) != null ? _a : "";
|
|
13894
14118
|
};
|
|
13895
|
-
const Clock = (
|
|
13896
|
-
var
|
|
14119
|
+
const Clock = (_mb) => {
|
|
14120
|
+
var _nb = _mb, { size = 18 } = _nb, props = __objRest(_nb, ["size"]);
|
|
13897
14121
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13898
14122
|
"svg",
|
|
13899
14123
|
__spreadProps(__spreadValues({
|
|
@@ -13986,9 +14210,9 @@ const BookkeepingStatus$1 = ({ status, text, monthNumber, iconOnly }) => {
|
|
|
13986
14210
|
)
|
|
13987
14211
|
] }));
|
|
13988
14212
|
};
|
|
13989
|
-
const BankTransactionProcessingInfo = () => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13990
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13991
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14213
|
+
const BankTransactionProcessingInfo = () => /* @__PURE__ */ jsxRuntime.jsxs(DeprecatedTooltip, { offset: 12, children: [
|
|
14214
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipTrigger, { children: /* @__PURE__ */ jsxRuntime.jsx(BookkeepingStatus$1, { status: BookkeepingPeriodStatus.IN_PROGRESS_AWAITING_BOOKKEEPER, text: "Processing" }) }),
|
|
14215
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", width: "md", children: "Our team will review and categorize this transaction. We'll reach out if we have any questions about it." })
|
|
13992
14216
|
] });
|
|
13993
14217
|
function useDelayedVisibility({
|
|
13994
14218
|
delay,
|
|
@@ -14010,73 +14234,47 @@ function useDelayedVisibility({
|
|
|
14010
14234
|
);
|
|
14011
14235
|
return { isVisible };
|
|
14012
14236
|
}
|
|
14013
|
-
|
|
14014
|
-
return
|
|
14015
|
-
|
|
14016
|
-
|
|
14017
|
-
|
|
14018
|
-
|
|
14019
|
-
|
|
14020
|
-
|
|
14021
|
-
|
|
14022
|
-
|
|
14023
|
-
|
|
14024
|
-
|
|
14025
|
-
|
|
14026
|
-
|
|
14027
|
-
|
|
14028
|
-
|
|
14029
|
-
|
|
14030
|
-
|
|
14031
|
-
|
|
14032
|
-
|
|
14033
|
-
|
|
14034
|
-
|
|
14035
|
-
|
|
14036
|
-
},
|
|
14037
|
-
clearTransactionCategory: (id) => {
|
|
14038
|
-
set((state) => {
|
|
14039
|
-
const newMap = new Map(state.transactionCategories);
|
|
14040
|
-
newMap.delete(id);
|
|
14041
|
-
return { transactionCategories: newMap };
|
|
14042
|
-
});
|
|
14043
|
-
},
|
|
14044
|
-
clearMultipleTransactionCategories: (ids) => {
|
|
14045
|
-
set((state) => {
|
|
14046
|
-
const newMap = new Map(state.transactionCategories);
|
|
14047
|
-
ids.forEach((id) => newMap.delete(id));
|
|
14048
|
-
return { transactionCategories: newMap };
|
|
14049
|
-
});
|
|
14050
|
-
},
|
|
14051
|
-
clearAllTransactionCategories: () => {
|
|
14052
|
-
set({ transactionCategories: /* @__PURE__ */ new Map() });
|
|
14053
|
-
}
|
|
14237
|
+
const buildSplitCategorizationRequest = (selectedCategory) => {
|
|
14238
|
+
return {
|
|
14239
|
+
type: "Split",
|
|
14240
|
+
entries: selectedCategory.original.map((split) => {
|
|
14241
|
+
var _a, _b, _c;
|
|
14242
|
+
return {
|
|
14243
|
+
category: (_a = split.category) == null ? void 0 : _a.classificationEncoded,
|
|
14244
|
+
amount: split.amount,
|
|
14245
|
+
tags: split.tags.map((tag) => makeTagKeyValueFromTag(tag)),
|
|
14246
|
+
customer_id: ((_b = split.customerVendor) == null ? void 0 : _b.customerVendorType) === "CUSTOMER" ? split.customerVendor.id : null,
|
|
14247
|
+
vendor_id: ((_c = split.customerVendor) == null ? void 0 : _c.customerVendorType) === "VENDOR" ? split.customerVendor.id : null
|
|
14248
|
+
};
|
|
14249
|
+
})
|
|
14250
|
+
};
|
|
14251
|
+
};
|
|
14252
|
+
const useSaveBankTransactionRow = () => {
|
|
14253
|
+
const {
|
|
14254
|
+
categorize: categorizeBankTransaction2,
|
|
14255
|
+
match: matchBankTransaction2
|
|
14256
|
+
} = useBankTransactionsContext();
|
|
14257
|
+
const saveBankTransactionRow = react.useCallback((selectedCategory, bankTransaction) => __async(null, null, function* () {
|
|
14258
|
+
if (!selectedCategory || isPlaceholderAsOption(selectedCategory)) {
|
|
14259
|
+
return;
|
|
14054
14260
|
}
|
|
14055
|
-
|
|
14056
|
-
|
|
14057
|
-
|
|
14058
|
-
|
|
14059
|
-
|
|
14060
|
-
|
|
14061
|
-
|
|
14062
|
-
|
|
14063
|
-
|
|
14064
|
-
|
|
14065
|
-
|
|
14066
|
-
|
|
14067
|
-
|
|
14068
|
-
|
|
14069
|
-
|
|
14070
|
-
|
|
14071
|
-
|
|
14072
|
-
return { transactionCategories };
|
|
14073
|
-
}
|
|
14074
|
-
function BankTransactionsCategoryStoreProvider({
|
|
14075
|
-
children
|
|
14076
|
-
}) {
|
|
14077
|
-
const [store] = react.useState(() => buildStore());
|
|
14078
|
-
return /* @__PURE__ */ jsxRuntime.jsx(BankTransactionsCategoryStoreContext.Provider, { value: store, children });
|
|
14079
|
-
}
|
|
14261
|
+
if (isSuggestedMatchAsOption(selectedCategory)) {
|
|
14262
|
+
return matchBankTransaction2(bankTransaction.id, selectedCategory.original.id);
|
|
14263
|
+
}
|
|
14264
|
+
if (isSplitAsOption(selectedCategory)) {
|
|
14265
|
+
const splitCategorizationRequest = buildSplitCategorizationRequest(selectedCategory);
|
|
14266
|
+
return categorizeBankTransaction2(bankTransaction.id, splitCategorizationRequest);
|
|
14267
|
+
}
|
|
14268
|
+
if (!selectedCategory.classificationEncoded) return;
|
|
14269
|
+
return categorizeBankTransaction2(bankTransaction.id, {
|
|
14270
|
+
type: "Category",
|
|
14271
|
+
category: selectedCategory.classificationEncoded
|
|
14272
|
+
});
|
|
14273
|
+
}), [categorizeBankTransaction2, matchBankTransaction2]);
|
|
14274
|
+
return react.useMemo(() => ({
|
|
14275
|
+
saveBankTransactionRow
|
|
14276
|
+
}), [saveBankTransactionRow]);
|
|
14277
|
+
};
|
|
14080
14278
|
const extractDescriptionForSplit = (category) => {
|
|
14081
14279
|
if (!category || !isSplitCategorizationEncoded(category)) {
|
|
14082
14280
|
return "";
|
|
@@ -14102,34 +14300,22 @@ const BankTransactionRow = ({
|
|
|
14102
14300
|
var _a, _b, _c, _d, _e, _f;
|
|
14103
14301
|
const expandedRowRef = react.useRef(null);
|
|
14104
14302
|
const [showRetry, setShowRetry] = react.useState(false);
|
|
14105
|
-
const {
|
|
14106
|
-
categorize: categorizeBankTransaction2,
|
|
14107
|
-
match: matchBankTransaction2,
|
|
14108
|
-
shouldHideAfterCategorize
|
|
14109
|
-
} = useBankTransactionsContext();
|
|
14110
|
-
const [selectedCategory, setSelectedCategory] = react.useState(
|
|
14111
|
-
getDefaultSelectedCategoryForBankTransaction(bankTransaction)
|
|
14112
|
-
);
|
|
14303
|
+
const { shouldHideAfterCategorize } = useBankTransactionsContext();
|
|
14113
14304
|
const [open, setOpen] = react.useState(false);
|
|
14114
14305
|
const toggleOpen = () => {
|
|
14115
14306
|
setShowRetry(false);
|
|
14116
14307
|
setOpen(!open);
|
|
14117
14308
|
};
|
|
14309
|
+
const bookkeepingStatus = useEffectiveBookkeepingStatus();
|
|
14310
|
+
const categorizationEnabled = isCategorizationEnabledForStatus(bookkeepingStatus);
|
|
14311
|
+
const categorized = isCategorized(bankTransaction);
|
|
14312
|
+
const { isVisible } = useDelayedVisibility({ delay: index2 * 20, initialVisibility: Boolean(initialLoad) });
|
|
14118
14313
|
const { select, deselect } = useBulkSelectionActions();
|
|
14119
14314
|
const isSelected = useIdIsSelected();
|
|
14120
14315
|
const isTransactionSelected = isSelected(bankTransaction.id);
|
|
14121
14316
|
const { setTransactionCategory } = useBankTransactionsCategoryActions();
|
|
14122
|
-
const
|
|
14123
|
-
|
|
14124
|
-
clickTimer = Date.now();
|
|
14125
|
-
},
|
|
14126
|
-
onMouseUp: () => {
|
|
14127
|
-
if (Date.now() - clickTimer < 100 && !open) {
|
|
14128
|
-
setShowRetry(false);
|
|
14129
|
-
setOpen(true);
|
|
14130
|
-
}
|
|
14131
|
-
}
|
|
14132
|
-
};
|
|
14317
|
+
const { selectedCategory } = useGetBankTransactionCategory(bankTransaction.id);
|
|
14318
|
+
const { saveBankTransactionRow } = useSaveBankTransactionRow();
|
|
14133
14319
|
react.useEffect(() => {
|
|
14134
14320
|
if (bankTransaction.error) {
|
|
14135
14321
|
setShowRetry(true);
|
|
@@ -14148,30 +14334,21 @@ const BankTransactionRow = ({
|
|
|
14148
14334
|
(_a2 = expandedRowRef == null ? void 0 : expandedRowRef.current) == null ? void 0 : _a2.save();
|
|
14149
14335
|
return;
|
|
14150
14336
|
}
|
|
14151
|
-
|
|
14152
|
-
return;
|
|
14153
|
-
}
|
|
14154
|
-
if (isSuggestedMatchAsOption(selectedCategory)) {
|
|
14155
|
-
yield matchBankTransaction2(bankTransaction.id, selectedCategory.original.id);
|
|
14156
|
-
deselect(bankTransaction.id);
|
|
14157
|
-
setOpen(false);
|
|
14158
|
-
return;
|
|
14159
|
-
}
|
|
14160
|
-
if (isSplitAsOption(selectedCategory)) {
|
|
14161
|
-
return;
|
|
14162
|
-
}
|
|
14163
|
-
if (!selectedCategory.classificationEncoded) return;
|
|
14164
|
-
yield categorizeBankTransaction2(bankTransaction.id, {
|
|
14165
|
-
type: "Category",
|
|
14166
|
-
category: selectedCategory.classificationEncoded
|
|
14167
|
-
});
|
|
14337
|
+
yield saveBankTransactionRow(selectedCategory, bankTransaction);
|
|
14168
14338
|
deselect(bankTransaction.id);
|
|
14169
14339
|
setOpen(false);
|
|
14170
14340
|
});
|
|
14171
|
-
const
|
|
14172
|
-
|
|
14173
|
-
|
|
14174
|
-
|
|
14341
|
+
const openRow = {
|
|
14342
|
+
onMouseDown: () => {
|
|
14343
|
+
clickTimer = Date.now();
|
|
14344
|
+
},
|
|
14345
|
+
onMouseUp: () => {
|
|
14346
|
+
if (Date.now() - clickTimer < 100 && !open) {
|
|
14347
|
+
setShowRetry(false);
|
|
14348
|
+
setOpen(true);
|
|
14349
|
+
}
|
|
14350
|
+
}
|
|
14351
|
+
};
|
|
14175
14352
|
const className = "Layer__bank-transaction-row";
|
|
14176
14353
|
const openClassName = open ? `${className}--expanded` : "";
|
|
14177
14354
|
const rowClassName = classNames(
|
|
@@ -14213,7 +14390,7 @@ const BankTransactionRow = ({
|
|
|
14213
14390
|
__spreadProps(__spreadValues({
|
|
14214
14391
|
className: "Layer__table-cell Layer__bank-transactions__tx-col"
|
|
14215
14392
|
}, openRow), {
|
|
14216
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "Layer__table-cell-content", children: /* @__PURE__ */ jsxRuntime.jsx(Span, { children: (_a = bankTransaction.counterparty_name) != null ? _a : bankTransaction.description }) })
|
|
14393
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "Layer__table-cell-content", children: /* @__PURE__ */ jsxRuntime.jsx(Span, { withTooltip: true, children: (_a = bankTransaction.counterparty_name) != null ? _a : bankTransaction.description }) })
|
|
14217
14394
|
})
|
|
14218
14395
|
),
|
|
14219
14396
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -14267,9 +14444,8 @@ const BankTransactionRow = ({
|
|
|
14267
14444
|
BankTransactionCategoryComboBox,
|
|
14268
14445
|
{
|
|
14269
14446
|
bankTransaction,
|
|
14270
|
-
selectedValue: selectedCategory,
|
|
14447
|
+
selectedValue: selectedCategory != null ? selectedCategory : null,
|
|
14271
14448
|
onSelectedValueChange: (selectedCategory2) => {
|
|
14272
|
-
setSelectedCategory(selectedCategory2);
|
|
14273
14449
|
setTransactionCategory(bankTransaction.id, selectedCategory2);
|
|
14274
14450
|
setShowRetry(false);
|
|
14275
14451
|
},
|
|
@@ -14439,28 +14615,29 @@ const BankTransactionListItem = ({
|
|
|
14439
14615
|
stringOverrides,
|
|
14440
14616
|
showDescriptions,
|
|
14441
14617
|
showReceiptUploads,
|
|
14442
|
-
showTooltips
|
|
14618
|
+
showTooltips,
|
|
14619
|
+
_showBulkSelection = false
|
|
14443
14620
|
}) => {
|
|
14444
14621
|
var _a, _b;
|
|
14445
14622
|
const expandedRowRef = react.useRef(null);
|
|
14446
14623
|
const [showRetry, setShowRetry] = react.useState(false);
|
|
14447
|
-
const {
|
|
14448
|
-
|
|
14449
|
-
|
|
14450
|
-
|
|
14451
|
-
} = useBankTransactionsContext();
|
|
14452
|
-
const [selectedCategory, setSelectedCategory] = react.useState(
|
|
14453
|
-
getDefaultSelectedCategoryForBankTransaction(bankTransaction)
|
|
14454
|
-
);
|
|
14455
|
-
const [open, setOpen] = react.useState(false);
|
|
14456
|
-
const toggleOpen = () => {
|
|
14624
|
+
const { shouldHideAfterCategorize } = useBankTransactionsContext();
|
|
14625
|
+
const { saveBankTransactionRow } = useSaveBankTransactionRow();
|
|
14626
|
+
const [openExpandedRow, setOpenExpandedRow] = react.useState(false);
|
|
14627
|
+
const toggleExpandedRow = () => {
|
|
14457
14628
|
setShowRetry(false);
|
|
14458
|
-
|
|
14629
|
+
setOpenExpandedRow(!openExpandedRow);
|
|
14459
14630
|
};
|
|
14631
|
+
const { isDesktop } = useSizeClass();
|
|
14460
14632
|
const bookkeepingStatus = useEffectiveBookkeepingStatus();
|
|
14461
14633
|
const categorizationEnabled = isCategorizationEnabledForStatus(bookkeepingStatus);
|
|
14462
|
-
const
|
|
14634
|
+
const categorized = isCategorized(bankTransaction);
|
|
14463
14635
|
const { isVisible } = useDelayedVisibility({ delay: index2 * 80 });
|
|
14636
|
+
const { select, deselect } = useBulkSelectionActions();
|
|
14637
|
+
const isSelected = useIdIsSelected();
|
|
14638
|
+
const isTransactionSelected = isSelected(bankTransaction.id);
|
|
14639
|
+
const { setTransactionCategory } = useBankTransactionsCategoryActions();
|
|
14640
|
+
const { selectedCategory } = useGetBankTransactionCategory(bankTransaction.id);
|
|
14464
14641
|
react.useEffect(() => {
|
|
14465
14642
|
if (bankTransaction.error) {
|
|
14466
14643
|
setShowRetry(true);
|
|
@@ -14475,33 +14652,20 @@ const BankTransactionListItem = ({
|
|
|
14475
14652
|
}, [bankTransaction.recently_categorized]);
|
|
14476
14653
|
const save = () => __async(null, null, function* () {
|
|
14477
14654
|
var _a2;
|
|
14478
|
-
if (
|
|
14655
|
+
if (openExpandedRow && (expandedRowRef == null ? void 0 : expandedRowRef.current)) {
|
|
14479
14656
|
(_a2 = expandedRowRef == null ? void 0 : expandedRowRef.current) == null ? void 0 : _a2.save();
|
|
14480
14657
|
return;
|
|
14481
14658
|
}
|
|
14482
|
-
|
|
14483
|
-
|
|
14484
|
-
|
|
14485
|
-
if (isSuggestedMatchAsOption(selectedCategory)) {
|
|
14486
|
-
yield matchBankTransaction2(bankTransaction.id, selectedCategory.original.id);
|
|
14487
|
-
return;
|
|
14488
|
-
}
|
|
14489
|
-
if (isSplitAsOption(selectedCategory)) {
|
|
14490
|
-
return;
|
|
14491
|
-
}
|
|
14492
|
-
if (selectedCategory.classificationEncoded === null) return;
|
|
14493
|
-
yield categorizeBankTransaction2(bankTransaction.id, {
|
|
14494
|
-
type: "Category",
|
|
14495
|
-
category: selectedCategory.classificationEncoded
|
|
14496
|
-
});
|
|
14659
|
+
yield saveBankTransactionRow(selectedCategory, bankTransaction);
|
|
14660
|
+
deselect(bankTransaction.id);
|
|
14661
|
+
setOpenExpandedRow(false);
|
|
14497
14662
|
});
|
|
14498
|
-
const categorized = isCategorized(bankTransaction);
|
|
14499
14663
|
const className = "Layer__bank-transaction-list-item";
|
|
14500
|
-
const openClassName =
|
|
14664
|
+
const openClassName = openExpandedRow ? `${className}--expanded` : "";
|
|
14501
14665
|
const rowClassName = classNames(
|
|
14502
14666
|
className,
|
|
14503
14667
|
bankTransaction.recently_categorized && editable && shouldHideAfterCategorize() ? "Layer__bank-transaction-row--removing" : "",
|
|
14504
|
-
|
|
14668
|
+
openExpandedRow ? openClassName : "",
|
|
14505
14669
|
isVisible ? "show" : ""
|
|
14506
14670
|
);
|
|
14507
14671
|
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: rowClassName, children: [
|
|
@@ -14519,7 +14683,7 @@ const BankTransactionListItem = ({
|
|
|
14519
14683
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14520
14684
|
"div",
|
|
14521
14685
|
{
|
|
14522
|
-
onClick:
|
|
14686
|
+
onClick: toggleExpandedRow,
|
|
14523
14687
|
className: classNames(
|
|
14524
14688
|
"Layer__bank-transaction-row__expand-button",
|
|
14525
14689
|
!isDesktop && "Layer__bank-transaction-row__expand-button--mobile"
|
|
@@ -14527,14 +14691,27 @@ const BankTransactionListItem = ({
|
|
|
14527
14691
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14528
14692
|
ChevronDownFill,
|
|
14529
14693
|
{
|
|
14530
|
-
className: `Layer__chevron ${
|
|
14694
|
+
className: `Layer__chevron ${openExpandedRow ? "Layer__chevron__up" : "Layer__chevron__down"}`
|
|
14531
14695
|
}
|
|
14532
14696
|
)
|
|
14533
14697
|
}
|
|
14534
14698
|
)
|
|
14535
14699
|
] }),
|
|
14536
14700
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: `${className}__body`, children: [
|
|
14537
|
-
/* @__PURE__ */ jsxRuntime.jsx("
|
|
14701
|
+
_showBulkSelection && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${className}__checkbox`, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14702
|
+
Checkbox,
|
|
14703
|
+
{
|
|
14704
|
+
isSelected: isTransactionSelected,
|
|
14705
|
+
onChange: (selected) => {
|
|
14706
|
+
if (selected) {
|
|
14707
|
+
select(bankTransaction.id);
|
|
14708
|
+
} else {
|
|
14709
|
+
deselect(bankTransaction.id);
|
|
14710
|
+
}
|
|
14711
|
+
}
|
|
14712
|
+
}
|
|
14713
|
+
) }),
|
|
14714
|
+
/* @__PURE__ */ jsxRuntime.jsx(HStack, { className: `${className}__body__name`, children: /* @__PURE__ */ jsxRuntime.jsx(Span, { withTooltip: true, children: (_b = bankTransaction.counterparty_name) != null ? _b : bankTransaction.description }) }),
|
|
14538
14715
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14539
14716
|
"span",
|
|
14540
14717
|
{
|
|
@@ -14549,8 +14726,8 @@ const BankTransactionListItem = ({
|
|
|
14549
14726
|
{
|
|
14550
14727
|
ref: expandedRowRef,
|
|
14551
14728
|
bankTransaction,
|
|
14552
|
-
isOpen:
|
|
14553
|
-
close: () =>
|
|
14729
|
+
isOpen: openExpandedRow,
|
|
14730
|
+
close: () => setOpenExpandedRow(false),
|
|
14554
14731
|
categorized,
|
|
14555
14732
|
asListItem: true,
|
|
14556
14733
|
submitBtnText: categorized ? (stringOverrides == null ? void 0 : stringOverrides.updateButtonText) || "Update" : (stringOverrides == null ? void 0 : stringOverrides.approveButtonText) || "Approve",
|
|
@@ -14565,9 +14742,9 @@ const BankTransactionListItem = ({
|
|
|
14565
14742
|
BankTransactionCategoryComboBox,
|
|
14566
14743
|
{
|
|
14567
14744
|
bankTransaction,
|
|
14568
|
-
selectedValue: selectedCategory,
|
|
14745
|
+
selectedValue: selectedCategory != null ? selectedCategory : null,
|
|
14569
14746
|
onSelectedValueChange: (selectedCategory2) => {
|
|
14570
|
-
|
|
14747
|
+
setTransactionCategory(bankTransaction.id, selectedCategory2);
|
|
14571
14748
|
setShowRetry(false);
|
|
14572
14749
|
},
|
|
14573
14750
|
isLoading: bankTransaction.processing
|
|
@@ -14606,6 +14783,51 @@ const BankTransactionListItem = ({
|
|
|
14606
14783
|
bankTransaction.error && showRetry ? /* @__PURE__ */ jsxRuntime.jsx(ErrorText, { children: "Approval failed. Check connection and retry in few seconds." }) : null
|
|
14607
14784
|
] });
|
|
14608
14785
|
};
|
|
14786
|
+
const useBankTransactionsTableCheckboxState = ({ bankTransactions }) => {
|
|
14787
|
+
const { selectedIds } = useSelectedIds();
|
|
14788
|
+
const { selectMultiple, deselectMultiple } = useBulkSelectionActions();
|
|
14789
|
+
const currentPageIds = react.useMemo(
|
|
14790
|
+
() => {
|
|
14791
|
+
var _a;
|
|
14792
|
+
return (_a = bankTransactions == null ? void 0 : bankTransactions.map((tx) => tx.id)) != null ? _a : [];
|
|
14793
|
+
},
|
|
14794
|
+
[bankTransactions]
|
|
14795
|
+
);
|
|
14796
|
+
const selectedCount = react.useMemo(
|
|
14797
|
+
() => currentPageIds.filter((id) => selectedIds.has(id)).length,
|
|
14798
|
+
[currentPageIds, selectedIds]
|
|
14799
|
+
);
|
|
14800
|
+
const isAllSelected = selectedCount > 0 && selectedCount === currentPageIds.length;
|
|
14801
|
+
const isPartiallySelected = selectedCount > 0 && selectedCount < currentPageIds.length;
|
|
14802
|
+
const onHeaderCheckboxChange = react.useCallback((checked) => {
|
|
14803
|
+
if (!checked || isPartiallySelected) {
|
|
14804
|
+
deselectMultiple(currentPageIds);
|
|
14805
|
+
} else {
|
|
14806
|
+
selectMultiple(currentPageIds);
|
|
14807
|
+
}
|
|
14808
|
+
}, [
|
|
14809
|
+
currentPageIds,
|
|
14810
|
+
isPartiallySelected,
|
|
14811
|
+
selectMultiple,
|
|
14812
|
+
deselectMultiple
|
|
14813
|
+
]);
|
|
14814
|
+
return react.useMemo(() => ({
|
|
14815
|
+
isAllSelected,
|
|
14816
|
+
isPartiallySelected,
|
|
14817
|
+
onHeaderCheckboxChange
|
|
14818
|
+
}), [isAllSelected, isPartiallySelected, onHeaderCheckboxChange]);
|
|
14819
|
+
};
|
|
14820
|
+
const useUpsertBankTransactionsDefaultCategories = (bankTransactions) => {
|
|
14821
|
+
const { setOnlyNewTransactionCategories } = useBankTransactionsCategoryActions();
|
|
14822
|
+
react.useEffect(() => {
|
|
14823
|
+
if (!bankTransactions) return;
|
|
14824
|
+
const defaultCategories = bankTransactions.map((transaction) => ({
|
|
14825
|
+
id: transaction.id,
|
|
14826
|
+
category: getDefaultSelectedCategoryForBankTransaction(transaction)
|
|
14827
|
+
}));
|
|
14828
|
+
setOnlyNewTransactionCategories(defaultCategories);
|
|
14829
|
+
}, [bankTransactions, setOnlyNewTransactionCategories]);
|
|
14830
|
+
};
|
|
14609
14831
|
const BankTransactionList = ({
|
|
14610
14832
|
bankTransactions,
|
|
14611
14833
|
editable,
|
|
@@ -14614,29 +14836,56 @@ const BankTransactionList = ({
|
|
|
14614
14836
|
stringOverrides,
|
|
14615
14837
|
showDescriptions,
|
|
14616
14838
|
showReceiptUploads,
|
|
14617
|
-
showTooltips
|
|
14839
|
+
showTooltips,
|
|
14840
|
+
_showBulkSelection = false
|
|
14618
14841
|
}) => {
|
|
14619
|
-
|
|
14620
|
-
|
|
14621
|
-
|
|
14842
|
+
const { isAllSelected, isPartiallySelected, onHeaderCheckboxChange } = useBankTransactionsTableCheckboxState({ bankTransactions });
|
|
14843
|
+
useUpsertBankTransactionsDefaultCategories(bankTransactions);
|
|
14844
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
14845
|
+
_showBulkSelection && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
14846
|
+
HStack,
|
|
14622
14847
|
{
|
|
14623
|
-
|
|
14624
|
-
|
|
14625
|
-
|
|
14626
|
-
|
|
14627
|
-
|
|
14628
|
-
|
|
14629
|
-
|
|
14630
|
-
|
|
14631
|
-
|
|
14632
|
-
|
|
14633
|
-
|
|
14634
|
-
|
|
14635
|
-
|
|
14636
|
-
|
|
14848
|
+
gap: "md",
|
|
14849
|
+
pi: "md",
|
|
14850
|
+
pb: "md",
|
|
14851
|
+
className: "Layer__bank-transactions__list-header",
|
|
14852
|
+
children: [
|
|
14853
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14854
|
+
Checkbox,
|
|
14855
|
+
{
|
|
14856
|
+
isSelected: isAllSelected,
|
|
14857
|
+
isIndeterminate: isPartiallySelected,
|
|
14858
|
+
onChange: onHeaderCheckboxChange,
|
|
14859
|
+
"aria-label": "Select all transactions on this page"
|
|
14860
|
+
}
|
|
14861
|
+
),
|
|
14862
|
+
/* @__PURE__ */ jsxRuntime.jsx(Span, { size: "sm", pbs: "3xs", children: "Select all" })
|
|
14863
|
+
]
|
|
14864
|
+
}
|
|
14865
|
+
),
|
|
14866
|
+
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "Layer__bank-transactions__list", children: bankTransactions == null ? void 0 : bankTransactions.map(
|
|
14867
|
+
(bankTransaction, index2) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
14868
|
+
BankTransactionListItem,
|
|
14869
|
+
{
|
|
14870
|
+
index: index2,
|
|
14871
|
+
dateFormat: DATE_FORMAT$1,
|
|
14872
|
+
bankTransaction,
|
|
14873
|
+
editable,
|
|
14874
|
+
removeTransaction,
|
|
14875
|
+
containerWidth,
|
|
14876
|
+
stringOverrides,
|
|
14877
|
+
showDescriptions,
|
|
14878
|
+
showReceiptUploads,
|
|
14879
|
+
showTooltips,
|
|
14880
|
+
_showBulkSelection
|
|
14881
|
+
},
|
|
14882
|
+
bankTransaction.id
|
|
14883
|
+
)
|
|
14884
|
+
) })
|
|
14885
|
+
] });
|
|
14637
14886
|
};
|
|
14638
|
-
const Paperclip = (
|
|
14639
|
-
var
|
|
14887
|
+
const Paperclip = (_ob) => {
|
|
14888
|
+
var _pb = _ob, { size = 20 } = _pb, props = __objRest(_pb, ["size"]);
|
|
14640
14889
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14641
14890
|
"svg",
|
|
14642
14891
|
__spreadProps(__spreadValues({
|
|
@@ -14744,8 +14993,8 @@ const getAssignedValue$1 = (bankTransaction) => {
|
|
|
14744
14993
|
}
|
|
14745
14994
|
return null;
|
|
14746
14995
|
};
|
|
14747
|
-
const X = (
|
|
14748
|
-
var
|
|
14996
|
+
const X = (_qb) => {
|
|
14997
|
+
var _rb = _qb, { size = 18 } = _rb, props = __objRest(_rb, ["size"]);
|
|
14749
14998
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
14750
14999
|
"svg",
|
|
14751
15000
|
__spreadProps(__spreadValues({
|
|
@@ -14779,11 +15028,11 @@ const X = (_kb) => {
|
|
|
14779
15028
|
);
|
|
14780
15029
|
};
|
|
14781
15030
|
const CLASS_NAME$7 = "Layer__MinimalSearchField";
|
|
14782
|
-
function MinimalSearchField(
|
|
14783
|
-
var
|
|
15031
|
+
function MinimalSearchField(_sb) {
|
|
15032
|
+
var _tb = _sb, {
|
|
14784
15033
|
placeholder,
|
|
14785
15034
|
isDisabled
|
|
14786
|
-
} =
|
|
15035
|
+
} = _tb, restProps = __objRest(_tb, [
|
|
14787
15036
|
"placeholder",
|
|
14788
15037
|
"isDisabled"
|
|
14789
15038
|
]);
|
|
@@ -14800,8 +15049,8 @@ function MinimalSearchField(_mb) {
|
|
|
14800
15049
|
}
|
|
14801
15050
|
const INPUT_GROUP_CLASS_NAME = "Layer__InputGroup";
|
|
14802
15051
|
const InputGroup = react.forwardRef(
|
|
14803
|
-
function InputGroup2(
|
|
14804
|
-
var
|
|
15052
|
+
function InputGroup2(_ub, ref) {
|
|
15053
|
+
var _vb = _ub, { actionCount, className, slots, children } = _vb, restProps = __objRest(_vb, ["actionCount", "className", "slots", "children"]);
|
|
14805
15054
|
const combinedClassName = classNames(INPUT_GROUP_CLASS_NAME, className);
|
|
14806
15055
|
const dataProperties = toDataProperties({
|
|
14807
15056
|
"action-count": actionCount
|
|
@@ -14817,8 +15066,8 @@ const InputGroup = react.forwardRef(
|
|
|
14817
15066
|
}
|
|
14818
15067
|
);
|
|
14819
15068
|
const CLASS_NAME$6 = "Layer__SearchField";
|
|
14820
|
-
function SearchField(
|
|
14821
|
-
var
|
|
15069
|
+
function SearchField(_wb) {
|
|
15070
|
+
var _xb = _wb, { slot = "search", className, label, isDisabled } = _xb, restProps = __objRest(_xb, ["slot", "className", "label", "isDisabled"]);
|
|
14822
15071
|
const combinedClassName = classNames(CLASS_NAME$6, className);
|
|
14823
15072
|
return /* @__PURE__ */ jsxRuntime.jsxs(InputGroup, { slot, className: combinedClassName, children: [
|
|
14824
15073
|
/* @__PURE__ */ jsxRuntime.jsx(VStack, { slot: "icon", align: "center", justify: "center", className: "Layer__SearchField__Icon", "data-disabled": isDisabled || void 0, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { size: 14 }) }),
|
|
@@ -15187,11 +15436,11 @@ const MatchForm = ({
|
|
|
15187
15436
|
showDescriptions,
|
|
15188
15437
|
showCategorization
|
|
15189
15438
|
}) => {
|
|
15190
|
-
var _a
|
|
15439
|
+
var _a;
|
|
15191
15440
|
const receiptsRef = react.useRef(null);
|
|
15192
15441
|
const { match: matchBankTransaction2, isLoading } = useBankTransactionsContext();
|
|
15193
|
-
const [
|
|
15194
|
-
(
|
|
15442
|
+
const [selectedMatch, setSelectedMatch] = react.useState(
|
|
15443
|
+
getBankTransactionMatchAsSuggestedMatch(bankTransaction)
|
|
15195
15444
|
);
|
|
15196
15445
|
const [formError, setFormError] = react.useState();
|
|
15197
15446
|
const showRetry = Boolean(bankTransaction.error);
|
|
@@ -15206,13 +15455,14 @@ const MatchForm = ({
|
|
|
15206
15455
|
yield matchBankTransaction2(bankTransaction.id, foundMatch.id, true);
|
|
15207
15456
|
});
|
|
15208
15457
|
const save = () => __async(null, null, function* () {
|
|
15458
|
+
var _a2;
|
|
15209
15459
|
if (!showCategorization) {
|
|
15210
15460
|
return;
|
|
15211
15461
|
}
|
|
15212
|
-
if (!
|
|
15462
|
+
if (!selectedMatch) {
|
|
15213
15463
|
setFormError("Select an option to match the transaction");
|
|
15214
|
-
} else if (
|
|
15215
|
-
yield onMatchSubmit(
|
|
15464
|
+
} else if (selectedMatch && selectedMatch.id !== ((_a2 = getBankTransactionMatchAsSuggestedMatch(bankTransaction)) == null ? void 0 : _a2.id)) {
|
|
15465
|
+
yield onMatchSubmit(selectedMatch.id);
|
|
15216
15466
|
}
|
|
15217
15467
|
return;
|
|
15218
15468
|
});
|
|
@@ -15224,10 +15474,10 @@ const MatchForm = ({
|
|
|
15224
15474
|
classNamePrefix: "Layer__bank-transaction-mobile-list-item",
|
|
15225
15475
|
readOnly: !showCategorization,
|
|
15226
15476
|
bankTransaction,
|
|
15227
|
-
selectedMatchId,
|
|
15228
|
-
|
|
15477
|
+
selectedMatchId: selectedMatch == null ? void 0 : selectedMatch.id,
|
|
15478
|
+
setSelectedMatch: (suggestedMatch) => {
|
|
15229
15479
|
setFormError(void 0);
|
|
15230
|
-
|
|
15480
|
+
setSelectedMatch(suggestedMatch);
|
|
15231
15481
|
}
|
|
15232
15482
|
}
|
|
15233
15483
|
),
|
|
@@ -15273,7 +15523,7 @@ const MatchForm = ({
|
|
|
15273
15523
|
Button$1,
|
|
15274
15524
|
{
|
|
15275
15525
|
fullWidth: true,
|
|
15276
|
-
disabled: !
|
|
15526
|
+
disabled: !selectedMatch || isLoading || bankTransaction.processing || selectedMatch.id === ((_a = getBankTransactionMatchAsSuggestedMatch(bankTransaction)) == null ? void 0 : _a.id),
|
|
15277
15527
|
onClick: () => {
|
|
15278
15528
|
void save();
|
|
15279
15529
|
},
|
|
@@ -15285,8 +15535,8 @@ const MatchForm = ({
|
|
|
15285
15535
|
showRetry ? /* @__PURE__ */ jsxRuntime.jsx(ErrorText, { children: "Approval failed. Check connection and retry in few seconds." }) : null
|
|
15286
15536
|
] });
|
|
15287
15537
|
};
|
|
15288
|
-
const ChevronDown = (
|
|
15289
|
-
var
|
|
15538
|
+
const ChevronDown = (_yb) => {
|
|
15539
|
+
var _zb = _yb, { size = 18 } = _zb, props = __objRest(_zb, ["size"]);
|
|
15290
15540
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15291
15541
|
"svg",
|
|
15292
15542
|
__spreadProps(__spreadValues({
|
|
@@ -15384,7 +15634,6 @@ const SplitForm = ({
|
|
|
15384
15634
|
const splitCustomerVendor = c.customer ? decodeCustomerVendor(__spreadProps(__spreadValues({}, c.customer), { customerVendorType: "CUSTOMER" })) : c.vendor ? decodeCustomerVendor(__spreadProps(__spreadValues({}, c.vendor), { customerVendorType: "VENDOR" })) : null;
|
|
15385
15635
|
return {
|
|
15386
15636
|
amount: c.amount || 0,
|
|
15387
|
-
inputValue: centsToDollars(c.amount),
|
|
15388
15637
|
category: new ApiCategorizationAsOption(c.category),
|
|
15389
15638
|
tags: splitTags,
|
|
15390
15639
|
customerVendor: splitCustomerVendor
|
|
@@ -15392,14 +15641,12 @@ const SplitForm = ({
|
|
|
15392
15641
|
}) : [
|
|
15393
15642
|
{
|
|
15394
15643
|
amount: bankTransaction.amount,
|
|
15395
|
-
inputValue: centsToDollars(bankTransaction.amount),
|
|
15396
15644
|
category: defaultCategory ? new ApiCategorizationAsOption(defaultCategory) : null,
|
|
15397
15645
|
tags: [],
|
|
15398
15646
|
customerVendor: initialCustomerVendor
|
|
15399
15647
|
},
|
|
15400
15648
|
{
|
|
15401
15649
|
amount: 0,
|
|
15402
|
-
inputValue: "0.00",
|
|
15403
15650
|
category: defaultCategory ? new ApiCategorizationAsOption(defaultCategory) : null,
|
|
15404
15651
|
tags: [],
|
|
15405
15652
|
customerVendor: initialCustomerVendor
|
|
@@ -15423,7 +15670,6 @@ const SplitForm = ({
|
|
|
15423
15670
|
}, 0);
|
|
15424
15671
|
const remaining = bankTransaction.amount - splitTotal;
|
|
15425
15672
|
newSplits[0].amount = remaining;
|
|
15426
|
-
newSplits[0].inputValue = centsToDollars(remaining);
|
|
15427
15673
|
updateRowState(__spreadProps(__spreadValues({}, rowState), {
|
|
15428
15674
|
splits: newSplits
|
|
15429
15675
|
}));
|
|
@@ -15431,23 +15677,18 @@ const SplitForm = ({
|
|
|
15431
15677
|
};
|
|
15432
15678
|
const updateAmounts = (rowNumber) => (event) => {
|
|
15433
15679
|
const newAmount = dollarsToCents(event.target.value) || 0;
|
|
15434
|
-
const newDisplaying = event.target.value;
|
|
15435
15680
|
const splitTotal = rowState.splits.reduce((sum, split, index2) => {
|
|
15436
15681
|
const amount = index2 === 0 ? 0 : index2 === rowNumber ? newAmount : split.amount;
|
|
15437
15682
|
return sum + amount;
|
|
15438
15683
|
}, 0);
|
|
15439
15684
|
const remaining = bankTransaction.amount - splitTotal;
|
|
15440
15685
|
rowState.splits[rowNumber].amount = newAmount;
|
|
15441
|
-
rowState.splits[rowNumber].inputValue = newDisplaying;
|
|
15442
15686
|
rowState.splits[0].amount = remaining;
|
|
15443
|
-
rowState.splits[0].inputValue = centsToDollars(remaining);
|
|
15444
15687
|
updateRowState(__spreadValues({}, rowState));
|
|
15445
15688
|
setFormError(void 0);
|
|
15446
15689
|
};
|
|
15447
15690
|
const onBlur = (event) => {
|
|
15448
15691
|
if (event.target.value === "") {
|
|
15449
|
-
const [_, index2] = event.target.name.split("-");
|
|
15450
|
-
rowState.splits[parseInt(index2)].inputValue = "0.00";
|
|
15451
15692
|
updateRowState(__spreadValues({}, rowState));
|
|
15452
15693
|
setFormError(void 0);
|
|
15453
15694
|
}
|
|
@@ -15463,7 +15704,6 @@ const SplitForm = ({
|
|
|
15463
15704
|
...rowState.splits,
|
|
15464
15705
|
{
|
|
15465
15706
|
amount: 0,
|
|
15466
|
-
inputValue: "0.00",
|
|
15467
15707
|
category: defaultCategory ? new ApiCategorizationAsOption(defaultCategory) : null,
|
|
15468
15708
|
tags: [],
|
|
15469
15709
|
customerVendor: initialCustomerVendor
|
|
@@ -15548,7 +15788,7 @@ const SplitForm = ({
|
|
|
15548
15788
|
),
|
|
15549
15789
|
disabled: index2 === 0,
|
|
15550
15790
|
onChange: updateAmounts(index2),
|
|
15551
|
-
value: split.
|
|
15791
|
+
value: convertFromCents(split.amount),
|
|
15552
15792
|
onBlur,
|
|
15553
15793
|
isInvalid: split.amount < 0,
|
|
15554
15794
|
errorMessage: "Negative values are not allowed",
|
|
@@ -16084,9 +16324,8 @@ const BankTransactionsTable = ({
|
|
|
16084
16324
|
onRefresh
|
|
16085
16325
|
}) => {
|
|
16086
16326
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
16087
|
-
const {
|
|
16088
|
-
|
|
16089
|
-
const { setOnlyNewTransactionCategories } = useBankTransactionsCategoryActions();
|
|
16327
|
+
const { isAllSelected, isPartiallySelected, onHeaderCheckboxChange } = useBankTransactionsTableCheckboxState({ bankTransactions });
|
|
16328
|
+
useUpsertBankTransactionsDefaultCategories(bankTransactions);
|
|
16090
16329
|
const showReceiptColumn = (_a = showReceiptUploads && (bankTransactions == null ? void 0 : bankTransactions.some(
|
|
16091
16330
|
(transaction) => {
|
|
16092
16331
|
var _a2;
|
|
@@ -16097,39 +16336,6 @@ const BankTransactionsTable = ({
|
|
|
16097
16336
|
() => toDataProperties({ "show-receipt-upload-column": showReceiptColumn }),
|
|
16098
16337
|
[showReceiptColumn]
|
|
16099
16338
|
);
|
|
16100
|
-
const currentPageIds = react.useMemo(
|
|
16101
|
-
() => {
|
|
16102
|
-
var _a2;
|
|
16103
|
-
return (_a2 = bankTransactions == null ? void 0 : bankTransactions.map((tx) => tx.id)) != null ? _a2 : [];
|
|
16104
|
-
},
|
|
16105
|
-
[bankTransactions]
|
|
16106
|
-
);
|
|
16107
|
-
const selectedCount = react.useMemo(
|
|
16108
|
-
() => currentPageIds.filter((id) => selectedIds.has(id)).length,
|
|
16109
|
-
[currentPageIds, selectedIds]
|
|
16110
|
-
);
|
|
16111
|
-
const isAllSelected = selectedCount > 0 && selectedCount === currentPageIds.length;
|
|
16112
|
-
const isPartiallySelected = selectedCount > 0 && selectedCount < currentPageIds.length;
|
|
16113
|
-
const handleHeaderCheckboxChange = react.useCallback((checked) => {
|
|
16114
|
-
if (!checked || isPartiallySelected) {
|
|
16115
|
-
deselectMultiple(currentPageIds);
|
|
16116
|
-
} else {
|
|
16117
|
-
selectMultiple(currentPageIds);
|
|
16118
|
-
}
|
|
16119
|
-
}, [
|
|
16120
|
-
currentPageIds,
|
|
16121
|
-
isPartiallySelected,
|
|
16122
|
-
selectMultiple,
|
|
16123
|
-
deselectMultiple
|
|
16124
|
-
]);
|
|
16125
|
-
react.useEffect(() => {
|
|
16126
|
-
if (!bankTransactions) return;
|
|
16127
|
-
const defaultCategories = bankTransactions.map((transaction) => ({
|
|
16128
|
-
id: transaction.id,
|
|
16129
|
-
category: getDefaultSelectedCategoryForBankTransaction(transaction)
|
|
16130
|
-
}));
|
|
16131
|
-
setOnlyNewTransactionCategories(defaultCategories);
|
|
16132
|
-
}, [bankTransactions, setOnlyNewTransactionCategories]);
|
|
16133
16339
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16134
16340
|
"table",
|
|
16135
16341
|
{
|
|
@@ -16142,7 +16348,7 @@ const BankTransactionsTable = ({
|
|
|
16142
16348
|
{
|
|
16143
16349
|
isSelected: isAllSelected,
|
|
16144
16350
|
isIndeterminate: isPartiallySelected,
|
|
16145
|
-
onChange:
|
|
16351
|
+
onChange: onHeaderCheckboxChange,
|
|
16146
16352
|
"aria-label": "Select all transactions on this page"
|
|
16147
16353
|
}
|
|
16148
16354
|
) }) }),
|
|
@@ -16265,8 +16471,8 @@ const usePaginationRange = ({
|
|
|
16265
16471
|
}, [totalCount, pageSize, siblingCount, currentPage]);
|
|
16266
16472
|
return paginationRange;
|
|
16267
16473
|
};
|
|
16268
|
-
const PaginationButton = (
|
|
16269
|
-
var
|
|
16474
|
+
const PaginationButton = (_Ab) => {
|
|
16475
|
+
var _Bb = _Ab, { children, isSelected } = _Bb, buttonProps = __objRest(_Bb, ["children", "isSelected"]);
|
|
16270
16476
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16271
16477
|
Button,
|
|
16272
16478
|
__spreadProps(__spreadValues({
|
|
@@ -16537,7 +16743,6 @@ function Wizard({
|
|
|
16537
16743
|
const contextValue = react.useMemo(() => ({ next, previous, goToStep }), [next, previous, goToStep]);
|
|
16538
16744
|
return /* @__PURE__ */ jsxRuntime.jsx(WizardContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "md", children: [
|
|
16539
16745
|
Header3,
|
|
16540
|
-
/* @__PURE__ */ jsxRuntime.jsx(Separator, {}),
|
|
16541
16746
|
currentStep,
|
|
16542
16747
|
Footer
|
|
16543
16748
|
] }) });
|
|
@@ -16634,8 +16839,8 @@ const CreatableSelect = ({
|
|
|
16634
16839
|
className
|
|
16635
16840
|
);
|
|
16636
16841
|
const DropdownIndicator = react.useCallback((props) => /* @__PURE__ */ jsxRuntime.jsx(Select$1.components.DropdownIndicator, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsxRuntime.jsx(ChevronDownFill, {}) })), []);
|
|
16637
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16638
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16842
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(DeprecatedTooltip, { disabled: !isInvalid || !errorMessage, children: [
|
|
16843
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipTrigger, { className: "Layer__input-tooltip", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16639
16844
|
BaseCreatableSelect,
|
|
16640
16845
|
{
|
|
16641
16846
|
inputId,
|
|
@@ -16660,7 +16865,7 @@ const CreatableSelect = ({
|
|
|
16660
16865
|
createOptionPosition
|
|
16661
16866
|
}
|
|
16662
16867
|
) }),
|
|
16663
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16868
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", children: errorMessage })
|
|
16664
16869
|
] });
|
|
16665
16870
|
};
|
|
16666
16871
|
const notEmpty = (value) => {
|
|
@@ -16686,15 +16891,15 @@ function flattenValidationErrors(errors) {
|
|
|
16686
16891
|
}
|
|
16687
16892
|
const FORM_CLASS_NAME = "Layer__UI__Form";
|
|
16688
16893
|
const Form = react.forwardRef(
|
|
16689
|
-
function Form2(
|
|
16690
|
-
var
|
|
16894
|
+
function Form2(_Cb, ref) {
|
|
16895
|
+
var _Db = _Cb, { children, className } = _Db, restProps = __objRest(_Db, ["children", "className"]);
|
|
16691
16896
|
return /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Form, __spreadProps(__spreadValues({}, restProps), { className: classNames(FORM_CLASS_NAME, className), ref, children }));
|
|
16692
16897
|
}
|
|
16693
16898
|
);
|
|
16694
16899
|
const TEXT_FIELD_CLASS_NAME = "Layer__UI__TextField";
|
|
16695
16900
|
const TextField = react.forwardRef(
|
|
16696
|
-
function TextField2(
|
|
16697
|
-
var
|
|
16901
|
+
function TextField2(_Eb, ref) {
|
|
16902
|
+
var _Fb = _Eb, { children, inline, textarea, className } = _Fb, restProps = __objRest(_Fb, ["children", "inline", "textarea", "className"]);
|
|
16698
16903
|
const dataProperties = toDataProperties({ inline, textarea });
|
|
16699
16904
|
return /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.TextField, __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), { className: classNames(TEXT_FIELD_CLASS_NAME, className), ref, children: withRenderProp(children, (node) => node) }));
|
|
16700
16905
|
}
|
|
@@ -16751,8 +16956,8 @@ function BaseFormTextField({
|
|
|
16751
16956
|
}
|
|
16752
16957
|
const INPUT_CLASS_NAME = "Layer__UI__Input";
|
|
16753
16958
|
const Input = react.forwardRef(
|
|
16754
|
-
function Input2(
|
|
16755
|
-
var
|
|
16959
|
+
function Input2(_Gb, ref) {
|
|
16960
|
+
var _Hb = _Gb, { inset, placement } = _Hb, restProps = __objRest(_Hb, ["inset", "placement"]);
|
|
16756
16961
|
const dataProperties = toDataProperties({ inset, placement });
|
|
16757
16962
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16758
16963
|
reactAriaComponents.Input,
|
|
@@ -16848,15 +17053,15 @@ const withForceUpdate = (value) => {
|
|
|
16848
17053
|
writable: false
|
|
16849
17054
|
});
|
|
16850
17055
|
};
|
|
16851
|
-
function FormBigDecimalField(
|
|
16852
|
-
var
|
|
17056
|
+
function FormBigDecimalField(_Ib) {
|
|
17057
|
+
var _Jb = _Ib, {
|
|
16853
17058
|
mode = "decimal",
|
|
16854
17059
|
allowNegative = false,
|
|
16855
17060
|
maxValue = mode === "percent" ? BIG_DECIMAL_ONE : DEFAULT_MAX_VALUE,
|
|
16856
17061
|
minDecimalPlaces = mode === "currency" ? 2 : DEFAULT_MIN_DECIMAL_PLACES,
|
|
16857
17062
|
maxDecimalPlaces = mode === "currency" ? 2 : DEFAULT_MAX_DECIMAL_PLACES,
|
|
16858
17063
|
slots
|
|
16859
|
-
} =
|
|
17064
|
+
} = _Jb, restProps = __objRest(_Jb, [
|
|
16860
17065
|
"mode",
|
|
16861
17066
|
"allowNegative",
|
|
16862
17067
|
"maxValue",
|
|
@@ -16968,8 +17173,8 @@ function FormCheckboxField({
|
|
|
16968
17173
|
}
|
|
16969
17174
|
const DATE_FIELD_CLASS_NAME = "Layer__UI__DateField";
|
|
16970
17175
|
const DateField = react.forwardRef(
|
|
16971
|
-
function DateField2(
|
|
16972
|
-
var
|
|
17176
|
+
function DateField2(_Kb, ref) {
|
|
17177
|
+
var _Lb = _Kb, { inline, className, isReadOnly } = _Lb, restProps = __objRest(_Lb, ["inline", "className", "isReadOnly"]);
|
|
16973
17178
|
const dataProperties = toDataProperties({ inline, readonly: isReadOnly });
|
|
16974
17179
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16975
17180
|
reactAriaComponents.DateField,
|
|
@@ -16983,8 +17188,8 @@ const DateField = react.forwardRef(
|
|
|
16983
17188
|
);
|
|
16984
17189
|
const DATE_INPUT_CLASS_NAME = "Layer__UI__DateInput";
|
|
16985
17190
|
const DateInput = react.forwardRef(
|
|
16986
|
-
function DateInput2(
|
|
16987
|
-
var
|
|
17191
|
+
function DateInput2(_Mb, ref) {
|
|
17192
|
+
var _Nb = _Mb, { inset } = _Nb, restProps = __objRest(_Nb, ["inset"]);
|
|
16988
17193
|
const dataProperties = toDataProperties({ inset });
|
|
16989
17194
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16990
17195
|
reactAriaComponents.DateInput,
|
|
@@ -16997,8 +17202,8 @@ const DateInput = react.forwardRef(
|
|
|
16997
17202
|
);
|
|
16998
17203
|
const DATE_SEGMENT_CLASS_NAME = "Layer__UI__DateSegment";
|
|
16999
17204
|
const DateSegment = react.forwardRef(
|
|
17000
|
-
function DateSegment2(
|
|
17001
|
-
var
|
|
17205
|
+
function DateSegment2(_Ob, ref) {
|
|
17206
|
+
var _Pb = _Ob, { isReadOnly } = _Pb, restProps = __objRest(_Pb, ["isReadOnly"]);
|
|
17002
17207
|
const dataProperties = toDataProperties({ interactive: !isReadOnly });
|
|
17003
17208
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17004
17209
|
reactAriaComponents.DateSegment,
|
|
@@ -17076,8 +17281,8 @@ function FormDateField({
|
|
|
17076
17281
|
}
|
|
17077
17282
|
const TEXTAREA_CLASS_NAME = "Layer__UI__TextArea";
|
|
17078
17283
|
const TextArea = react.forwardRef(
|
|
17079
|
-
function TextArea2(
|
|
17080
|
-
var
|
|
17284
|
+
function TextArea2(_Qb, ref) {
|
|
17285
|
+
var _Rb = _Qb, { resize = "none" } = _Rb, restProps = __objRest(_Rb, ["resize"]);
|
|
17081
17286
|
const dataProperties = toDataProperties({ resize });
|
|
17082
17287
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17083
17288
|
reactAriaComponents.TextArea,
|
|
@@ -18340,22 +18545,19 @@ const BulkActionsModule = ({ slots }) => {
|
|
|
18340
18545
|
const { count } = useCountSelectedIds();
|
|
18341
18546
|
const { clearSelection } = useBulkSelectionActions();
|
|
18342
18547
|
return /* @__PURE__ */ jsxRuntime.jsxs(HStack, { slot: "toggle", justify: "space-between", align: "center", gap: "xs", children: [
|
|
18343
|
-
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { justify: "space-between", align: "center",
|
|
18344
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18345
|
-
|
|
18346
|
-
" selected ",
|
|
18347
|
-
pluralize("item", count)
|
|
18348
|
-
] }) }),
|
|
18349
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__BulkActionsModule__Divider" }),
|
|
18350
|
-
/* @__PURE__ */ jsxRuntime.jsx(HStack, { align: "center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
18548
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { justify: "space-between", align: "center", pis: "xs", pie: "3xs", gap: "3xs", className: "Layer__BulkActionsModule__SelectedItemsContainer", children: [
|
|
18549
|
+
/* @__PURE__ */ jsxRuntime.jsx(Span, { noWrap: true, children: `${count} selected` }),
|
|
18550
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18351
18551
|
Button,
|
|
18352
18552
|
{
|
|
18353
|
-
variant: "
|
|
18553
|
+
variant: "ghost",
|
|
18554
|
+
icon: true,
|
|
18555
|
+
inset: true,
|
|
18354
18556
|
onClick: clearSelection,
|
|
18355
18557
|
"aria-label": "Clear selected items",
|
|
18356
|
-
children:
|
|
18558
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(X, {})
|
|
18357
18559
|
}
|
|
18358
|
-
)
|
|
18560
|
+
)
|
|
18359
18561
|
] }),
|
|
18360
18562
|
/* @__PURE__ */ jsxRuntime.jsx(slots.BulkActions, {})
|
|
18361
18563
|
] });
|
|
@@ -18379,40 +18581,17 @@ const CategoryUpdateSchema = index.Schema.Union(
|
|
|
18379
18581
|
SingleCategoryUpdateSchema,
|
|
18380
18582
|
SplitCategoryUpdateSchema
|
|
18381
18583
|
);
|
|
18382
|
-
const
|
|
18383
|
-
const MatchTransactionRequestSchema = effect.Schema.Struct({
|
|
18384
|
-
type: effect.Schema.Literal("match"),
|
|
18385
|
-
suggestedMatchId: effect.pipe(
|
|
18386
|
-
effect.Schema.propertySignature(effect.Schema.UUID),
|
|
18387
|
-
effect.Schema.fromKey("suggested_match_id")
|
|
18388
|
-
)
|
|
18389
|
-
});
|
|
18584
|
+
const BULK_CATEGORIZE_BANK_TRANSACTIONS_TAG_KEY = "#bulk-categorize-bank-transactions";
|
|
18390
18585
|
const CategorizeTransactionRequestSchema$1 = effect.Schema.Struct({
|
|
18391
|
-
|
|
18586
|
+
transactionId: effect.Schema.propertySignature(effect.Schema.UUID).pipe(
|
|
18587
|
+
effect.Schema.fromKey("transaction_id")
|
|
18588
|
+
),
|
|
18392
18589
|
categorization: CategoryUpdateSchema
|
|
18393
18590
|
});
|
|
18394
|
-
const
|
|
18395
|
-
|
|
18396
|
-
CategorizeTransactionRequestSchema$1
|
|
18397
|
-
);
|
|
18398
|
-
const BulkMatchOrCategorizeRequestSchema = effect.Schema.Struct({
|
|
18399
|
-
transactions: effect.Schema.Record({
|
|
18400
|
-
key: effect.Schema.UUID,
|
|
18401
|
-
value: MatchOrCategorizeTransactionRequestSchema
|
|
18402
|
-
})
|
|
18403
|
-
});
|
|
18404
|
-
effect.Schema.Struct({
|
|
18405
|
-
businessId: effect.Schema.String
|
|
18591
|
+
const BulkCategorizeRequestSchema = effect.Schema.Struct({
|
|
18592
|
+
transactions: effect.Schema.Array(CategorizeTransactionRequestSchema$1)
|
|
18406
18593
|
});
|
|
18407
|
-
const
|
|
18408
|
-
({ businessId }) => {
|
|
18409
|
-
const parameters = toDefinedSearchParameters({
|
|
18410
|
-
categorization_source: "API_FROM_COMPONENT",
|
|
18411
|
-
match_source: "API_CONFIRM_MATCH_FROM_COMPONENT"
|
|
18412
|
-
});
|
|
18413
|
-
return `/v1/businesses/${businessId}/bank-transactions/bulk-match-or-categorize?${parameters}`;
|
|
18414
|
-
}
|
|
18415
|
-
);
|
|
18594
|
+
const bulkCategorize = post(({ businessId }) => `/v1/businesses/${businessId}/bank-transactions/bulk-categorize`);
|
|
18416
18595
|
function buildKey$C({
|
|
18417
18596
|
access_token: accessToken,
|
|
18418
18597
|
apiUrl,
|
|
@@ -18423,30 +18602,24 @@ function buildKey$C({
|
|
|
18423
18602
|
accessToken,
|
|
18424
18603
|
apiUrl,
|
|
18425
18604
|
businessId,
|
|
18426
|
-
tags: [
|
|
18605
|
+
tags: [BULK_CATEGORIZE_BANK_TRANSACTIONS_TAG_KEY]
|
|
18427
18606
|
};
|
|
18428
18607
|
}
|
|
18429
18608
|
}
|
|
18430
|
-
const
|
|
18609
|
+
const useBulkCategorize = () => {
|
|
18431
18610
|
const { data } = useAuth();
|
|
18432
18611
|
const { businessId } = useLayerContext();
|
|
18433
|
-
const { selectedIds } = useSelectedIds();
|
|
18434
|
-
const { transactionCategories } = useGetAllBankTransactionsCategories();
|
|
18435
18612
|
const { forceReloadBankTransactions } = useBankTransactionsGlobalCacheActions();
|
|
18436
|
-
const buildTransactionsPayload = react.useCallback(() => {
|
|
18437
|
-
const transactions = buildBulkMatchOrCategorizePayload(selectedIds, transactionCategories);
|
|
18438
|
-
return { transactions };
|
|
18439
|
-
}, [selectedIds, transactionCategories]);
|
|
18440
18613
|
const mutationResponse = useSWRMutation(
|
|
18441
18614
|
() => buildKey$C(__spreadProps(__spreadValues({}, data), {
|
|
18442
18615
|
businessId
|
|
18443
18616
|
})),
|
|
18444
|
-
({ accessToken, apiUrl, businessId: businessId2 }, { arg }) =>
|
|
18617
|
+
({ accessToken, apiUrl, businessId: businessId2 }, { arg }) => bulkCategorize(
|
|
18445
18618
|
apiUrl,
|
|
18446
18619
|
accessToken,
|
|
18447
18620
|
{
|
|
18448
18621
|
params: { businessId: businessId2 },
|
|
18449
|
-
body: effect.Schema.encodeSync(
|
|
18622
|
+
body: effect.Schema.encodeSync(BulkCategorizeRequestSchema)(arg)
|
|
18450
18623
|
}
|
|
18451
18624
|
).then(({ data: data2 }) => data2),
|
|
18452
18625
|
{
|
|
@@ -18454,19 +18627,16 @@ const useBulkMatchOrCategorize = () => {
|
|
|
18454
18627
|
throwOnError: true
|
|
18455
18628
|
}
|
|
18456
18629
|
);
|
|
18457
|
-
const
|
|
18630
|
+
const originalTrigger = mutationResponse.trigger;
|
|
18458
18631
|
const stableProxiedTrigger = react.useCallback(
|
|
18459
18632
|
(...triggerParameters) => __async(null, null, function* () {
|
|
18460
18633
|
const triggerResult = yield originalTrigger(...triggerParameters);
|
|
18461
18634
|
void forceReloadBankTransactions();
|
|
18462
18635
|
return triggerResult;
|
|
18463
18636
|
}),
|
|
18464
|
-
[
|
|
18465
|
-
originalTrigger,
|
|
18466
|
-
forceReloadBankTransactions
|
|
18467
|
-
]
|
|
18637
|
+
[originalTrigger, forceReloadBankTransactions]
|
|
18468
18638
|
);
|
|
18469
|
-
|
|
18639
|
+
return new Proxy(mutationResponse, {
|
|
18470
18640
|
get(target, prop) {
|
|
18471
18641
|
if (prop === "trigger") {
|
|
18472
18642
|
return stableProxiedTrigger;
|
|
@@ -18474,59 +18644,109 @@ const useBulkMatchOrCategorize = () => {
|
|
|
18474
18644
|
return Reflect.get(target, prop);
|
|
18475
18645
|
}
|
|
18476
18646
|
});
|
|
18477
|
-
return __spreadProps(__spreadValues({}, proxiedResponse), {
|
|
18478
|
-
buildTransactionsPayload
|
|
18479
|
-
});
|
|
18480
18647
|
};
|
|
18481
|
-
|
|
18648
|
+
var CategorizationMode = /* @__PURE__ */ ((CategorizationMode2) => {
|
|
18649
|
+
CategorizationMode2["Categorize"] = "Categorize";
|
|
18650
|
+
CategorizationMode2["Recategorize"] = "Recategorize";
|
|
18651
|
+
return CategorizationMode2;
|
|
18652
|
+
})(CategorizationMode || {});
|
|
18653
|
+
const BankTransactionsCategorizeAllModal = ({ isOpen, onOpenChange, mode }) => {
|
|
18482
18654
|
const { count } = useCountSelectedIds();
|
|
18655
|
+
const { selectedIds } = useSelectedIds();
|
|
18483
18656
|
const { clearSelection } = useBulkSelectionActions();
|
|
18484
|
-
const [
|
|
18485
|
-
const { trigger
|
|
18486
|
-
const
|
|
18487
|
-
|
|
18488
|
-
|
|
18657
|
+
const [selectedCategory, setSelectedCategory] = react.useState(null);
|
|
18658
|
+
const { trigger } = useBulkCategorize();
|
|
18659
|
+
const handleCategorizeModalClose = react.useCallback((isOpen2) => {
|
|
18660
|
+
onOpenChange(isOpen2);
|
|
18661
|
+
if (!isOpen2) {
|
|
18662
|
+
setSelectedCategory(null);
|
|
18663
|
+
}
|
|
18664
|
+
}, [onOpenChange]);
|
|
18489
18665
|
const handleConfirm = react.useCallback(() => __async(null, null, function* () {
|
|
18490
|
-
|
|
18491
|
-
|
|
18666
|
+
if (!selectedCategory || selectedCategory.classification === null) {
|
|
18667
|
+
return;
|
|
18668
|
+
}
|
|
18669
|
+
if (!isCategoryAsOption(selectedCategory) && !isApiCategorizationAsOption(selectedCategory)) {
|
|
18670
|
+
return;
|
|
18671
|
+
}
|
|
18672
|
+
const transactionIds = Array.from(selectedIds);
|
|
18673
|
+
const categorization = {
|
|
18674
|
+
type: "Category",
|
|
18675
|
+
category: selectedCategory.classification
|
|
18676
|
+
};
|
|
18677
|
+
yield trigger({
|
|
18678
|
+
transactions: transactionIds.map((transactionId) => ({
|
|
18679
|
+
transactionId,
|
|
18680
|
+
categorization
|
|
18681
|
+
}))
|
|
18682
|
+
});
|
|
18492
18683
|
clearSelection();
|
|
18493
|
-
}), [
|
|
18494
|
-
|
|
18495
|
-
|
|
18496
|
-
|
|
18497
|
-
|
|
18498
|
-
|
|
18499
|
-
|
|
18500
|
-
|
|
18501
|
-
|
|
18502
|
-
|
|
18503
|
-
|
|
18504
|
-
|
|
18505
|
-
|
|
18506
|
-
|
|
18507
|
-
|
|
18508
|
-
|
|
18509
|
-
|
|
18510
|
-
|
|
18511
|
-
|
|
18512
|
-
|
|
18513
|
-
|
|
18514
|
-
|
|
18515
|
-
}
|
|
18516
|
-
|
|
18517
|
-
|
|
18684
|
+
}), [selectedIds, selectedCategory, trigger, clearSelection]);
|
|
18685
|
+
const categorySelectId = react.useId();
|
|
18686
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18687
|
+
BaseConfirmationModal,
|
|
18688
|
+
{
|
|
18689
|
+
isOpen,
|
|
18690
|
+
onOpenChange: handleCategorizeModalClose,
|
|
18691
|
+
title: mode === "Categorize" ? "Categorize all selected transactions?" : "Recategorize all selected transactions?",
|
|
18692
|
+
content: /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", children: [
|
|
18693
|
+
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "3xs", children: [
|
|
18694
|
+
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: categorySelectId, children: "Select category" }),
|
|
18695
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18696
|
+
BankTransactionCategoryComboBox,
|
|
18697
|
+
{
|
|
18698
|
+
inputId: categorySelectId,
|
|
18699
|
+
selectedValue: selectedCategory,
|
|
18700
|
+
onSelectedValueChange: setSelectedCategory,
|
|
18701
|
+
includeSuggestedMatches: false
|
|
18702
|
+
}
|
|
18703
|
+
)
|
|
18704
|
+
] }),
|
|
18705
|
+
selectedCategory && isCategoryAsOption(selectedCategory) && /* @__PURE__ */ jsxRuntime.jsx(Span, { children: mode === "Categorize" ? `This will categorize ${count} selected ${pluralize("transaction", count)} as ${selectedCategory.original.displayName}.` : `This will recategorize ${count} selected ${pluralize("transaction", count)} as ${selectedCategory.original.displayName}.` })
|
|
18706
|
+
] }),
|
|
18707
|
+
onConfirm: handleConfirm,
|
|
18708
|
+
confirmLabel: mode === "Categorize" ? "Categorize All" : "Recategorize All",
|
|
18709
|
+
cancelLabel: "Cancel",
|
|
18710
|
+
confirmDisabled: !selectedCategory,
|
|
18711
|
+
errorText: mode === "Categorize" ? "Failed to categorize transactions" : "Failed to recategorize transactions",
|
|
18712
|
+
closeOnConfirm: true
|
|
18713
|
+
}
|
|
18714
|
+
);
|
|
18518
18715
|
};
|
|
18519
|
-
const
|
|
18716
|
+
const BULK_MATCH_OR_CATEGORIZE_TAG = "#bulk-match-or-categorize";
|
|
18717
|
+
const MatchTransactionRequestSchema = effect.Schema.Struct({
|
|
18718
|
+
type: effect.Schema.Literal("match"),
|
|
18719
|
+
suggestedMatchId: effect.pipe(
|
|
18720
|
+
effect.Schema.propertySignature(effect.Schema.UUID),
|
|
18721
|
+
effect.Schema.fromKey("suggested_match_id")
|
|
18722
|
+
)
|
|
18723
|
+
});
|
|
18520
18724
|
const CategorizeTransactionRequestSchema = effect.Schema.Struct({
|
|
18521
|
-
|
|
18522
|
-
effect.Schema.fromKey("transaction_id")
|
|
18523
|
-
),
|
|
18725
|
+
type: effect.Schema.Literal("categorize"),
|
|
18524
18726
|
categorization: CategoryUpdateSchema
|
|
18525
18727
|
});
|
|
18526
|
-
const
|
|
18527
|
-
|
|
18728
|
+
const MatchOrCategorizeTransactionRequestSchema = effect.Schema.Union(
|
|
18729
|
+
MatchTransactionRequestSchema,
|
|
18730
|
+
CategorizeTransactionRequestSchema
|
|
18731
|
+
);
|
|
18732
|
+
const BulkMatchOrCategorizeRequestSchema = effect.Schema.Struct({
|
|
18733
|
+
transactions: effect.Schema.Record({
|
|
18734
|
+
key: effect.Schema.UUID,
|
|
18735
|
+
value: MatchOrCategorizeTransactionRequestSchema
|
|
18736
|
+
})
|
|
18528
18737
|
});
|
|
18529
|
-
|
|
18738
|
+
effect.Schema.Struct({
|
|
18739
|
+
businessId: effect.Schema.String
|
|
18740
|
+
});
|
|
18741
|
+
const bulkMatchOrCategorize = post(
|
|
18742
|
+
({ businessId }) => {
|
|
18743
|
+
const parameters = toDefinedSearchParameters({
|
|
18744
|
+
categorization_source: "API_FROM_COMPONENT",
|
|
18745
|
+
match_source: "API_CONFIRM_MATCH_FROM_COMPONENT"
|
|
18746
|
+
});
|
|
18747
|
+
return `/v1/businesses/${businessId}/bank-transactions/bulk-match-or-categorize?${parameters}`;
|
|
18748
|
+
}
|
|
18749
|
+
);
|
|
18530
18750
|
function buildKey$B({
|
|
18531
18751
|
access_token: accessToken,
|
|
18532
18752
|
apiUrl,
|
|
@@ -18537,24 +18757,30 @@ function buildKey$B({
|
|
|
18537
18757
|
accessToken,
|
|
18538
18758
|
apiUrl,
|
|
18539
18759
|
businessId,
|
|
18540
|
-
tags: [
|
|
18760
|
+
tags: [BULK_MATCH_OR_CATEGORIZE_TAG]
|
|
18541
18761
|
};
|
|
18542
18762
|
}
|
|
18543
18763
|
}
|
|
18544
|
-
const
|
|
18764
|
+
const useBulkMatchOrCategorize = () => {
|
|
18545
18765
|
const { data } = useAuth();
|
|
18546
18766
|
const { businessId } = useLayerContext();
|
|
18767
|
+
const { selectedIds } = useSelectedIds();
|
|
18768
|
+
const { transactionCategories } = useGetAllBankTransactionsCategories();
|
|
18547
18769
|
const { forceReloadBankTransactions } = useBankTransactionsGlobalCacheActions();
|
|
18770
|
+
const buildTransactionsPayload = react.useCallback(() => {
|
|
18771
|
+
const transactions = buildBulkMatchOrCategorizePayload(selectedIds, transactionCategories);
|
|
18772
|
+
return { transactions };
|
|
18773
|
+
}, [selectedIds, transactionCategories]);
|
|
18548
18774
|
const mutationResponse = useSWRMutation(
|
|
18549
18775
|
() => buildKey$B(__spreadProps(__spreadValues({}, data), {
|
|
18550
18776
|
businessId
|
|
18551
18777
|
})),
|
|
18552
|
-
({ accessToken, apiUrl, businessId: businessId2 }, { arg }) =>
|
|
18778
|
+
({ accessToken, apiUrl, businessId: businessId2 }, { arg }) => bulkMatchOrCategorize(
|
|
18553
18779
|
apiUrl,
|
|
18554
18780
|
accessToken,
|
|
18555
18781
|
{
|
|
18556
18782
|
params: { businessId: businessId2 },
|
|
18557
|
-
body: effect.Schema.encodeSync(
|
|
18783
|
+
body: effect.Schema.encodeSync(BulkMatchOrCategorizeRequestSchema)(arg)
|
|
18558
18784
|
}
|
|
18559
18785
|
).then(({ data: data2 }) => data2),
|
|
18560
18786
|
{
|
|
@@ -18562,16 +18788,19 @@ const useBulkCategorize = () => {
|
|
|
18562
18788
|
throwOnError: true
|
|
18563
18789
|
}
|
|
18564
18790
|
);
|
|
18565
|
-
const originalTrigger = mutationResponse
|
|
18791
|
+
const { trigger: originalTrigger } = mutationResponse;
|
|
18566
18792
|
const stableProxiedTrigger = react.useCallback(
|
|
18567
18793
|
(...triggerParameters) => __async(null, null, function* () {
|
|
18568
18794
|
const triggerResult = yield originalTrigger(...triggerParameters);
|
|
18569
18795
|
void forceReloadBankTransactions();
|
|
18570
18796
|
return triggerResult;
|
|
18571
18797
|
}),
|
|
18572
|
-
[
|
|
18798
|
+
[
|
|
18799
|
+
originalTrigger,
|
|
18800
|
+
forceReloadBankTransactions
|
|
18801
|
+
]
|
|
18573
18802
|
);
|
|
18574
|
-
|
|
18803
|
+
const proxiedResponse = new Proxy(mutationResponse, {
|
|
18575
18804
|
get(target, prop) {
|
|
18576
18805
|
if (prop === "trigger") {
|
|
18577
18806
|
return stableProxiedTrigger;
|
|
@@ -18579,137 +18808,33 @@ const useBulkCategorize = () => {
|
|
|
18579
18808
|
return Reflect.get(target, prop);
|
|
18580
18809
|
}
|
|
18581
18810
|
});
|
|
18811
|
+
return __spreadProps(__spreadValues({}, proxiedResponse), {
|
|
18812
|
+
buildTransactionsPayload
|
|
18813
|
+
});
|
|
18582
18814
|
};
|
|
18583
|
-
const
|
|
18815
|
+
const BankTransactionsConfirmAllModal = ({ isOpen, onOpenChange }) => {
|
|
18584
18816
|
const { count } = useCountSelectedIds();
|
|
18585
|
-
const { selectedIds } = useSelectedIds();
|
|
18586
18817
|
const { clearSelection } = useBulkSelectionActions();
|
|
18587
|
-
const
|
|
18588
|
-
const [selectedCategory, setSelectedCategory] = react.useState(null);
|
|
18589
|
-
const { trigger } = useBulkCategorize();
|
|
18590
|
-
const handleCategorizeAllClick = react.useCallback(() => {
|
|
18591
|
-
setIsCategorizeAllModalOpen(true);
|
|
18592
|
-
}, []);
|
|
18593
|
-
const handleCategorizeModalClose = react.useCallback((isOpen) => {
|
|
18594
|
-
setIsCategorizeAllModalOpen(isOpen);
|
|
18595
|
-
if (!isOpen) {
|
|
18596
|
-
setSelectedCategory(null);
|
|
18597
|
-
}
|
|
18598
|
-
}, []);
|
|
18818
|
+
const { trigger, buildTransactionsPayload } = useBulkMatchOrCategorize();
|
|
18599
18819
|
const handleConfirm = react.useCallback(() => __async(null, null, function* () {
|
|
18600
|
-
|
|
18601
|
-
|
|
18602
|
-
}
|
|
18603
|
-
if (!isCategoryAsOption(selectedCategory) && !isApiCategorizationAsOption(selectedCategory)) {
|
|
18604
|
-
return;
|
|
18605
|
-
}
|
|
18606
|
-
const transactionIds = Array.from(selectedIds);
|
|
18607
|
-
const categorization = {
|
|
18608
|
-
type: "Category",
|
|
18609
|
-
category: selectedCategory.classification
|
|
18610
|
-
};
|
|
18611
|
-
yield trigger({
|
|
18612
|
-
transactions: transactionIds.map((transactionId) => ({
|
|
18613
|
-
transactionId,
|
|
18614
|
-
categorization
|
|
18615
|
-
}))
|
|
18616
|
-
});
|
|
18820
|
+
const payload = buildTransactionsPayload();
|
|
18821
|
+
yield trigger(payload);
|
|
18617
18822
|
clearSelection();
|
|
18618
|
-
}), [
|
|
18619
|
-
|
|
18620
|
-
|
|
18621
|
-
|
|
18622
|
-
|
|
18623
|
-
|
|
18624
|
-
|
|
18625
|
-
|
|
18626
|
-
|
|
18627
|
-
|
|
18628
|
-
|
|
18629
|
-
|
|
18630
|
-
|
|
18631
|
-
{
|
|
18632
|
-
isOpen: isCategorizeAllModalOpen,
|
|
18633
|
-
onOpenChange: handleCategorizeModalClose,
|
|
18634
|
-
title: "Categorize all selected transactions?",
|
|
18635
|
-
content: /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", children: [
|
|
18636
|
-
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "3xs", children: [
|
|
18637
|
-
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: categorySelectId, children: "Select category" }),
|
|
18638
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18639
|
-
BankTransactionCategoryComboBox,
|
|
18640
|
-
{
|
|
18641
|
-
inputId: categorySelectId,
|
|
18642
|
-
selectedValue: selectedCategory,
|
|
18643
|
-
onSelectedValueChange: setSelectedCategory,
|
|
18644
|
-
includeSuggestedMatches: false
|
|
18645
|
-
}
|
|
18646
|
-
)
|
|
18647
|
-
] }),
|
|
18648
|
-
selectedCategory && isCategoryAsOption(selectedCategory) && /* @__PURE__ */ jsxRuntime.jsx(Span, { children: `This action will categorize ${count} selected transactions as ${selectedCategory.original.displayName}.` })
|
|
18649
|
-
] }),
|
|
18650
|
-
onConfirm: handleConfirm,
|
|
18651
|
-
confirmLabel: "Categorize All",
|
|
18652
|
-
cancelLabel: "Cancel",
|
|
18653
|
-
confirmDisabled: !selectedCategory,
|
|
18654
|
-
errorText: "Failed to categorize transactions",
|
|
18655
|
-
closeOnConfirm: true
|
|
18656
|
-
}
|
|
18657
|
-
)
|
|
18658
|
-
] });
|
|
18659
|
-
};
|
|
18660
|
-
const BankTransactionsRecategorizeAllButton = () => {
|
|
18661
|
-
const { count } = useCountSelectedIds();
|
|
18662
|
-
const [isRecategorizeAllModalOpen, setIsRecategorizeAllModalOpen] = react.useState(false);
|
|
18663
|
-
const [selectedCategory, setSelectedCategory] = react.useState(null);
|
|
18664
|
-
const handleRecategorizeAllClick = react.useCallback(() => {
|
|
18665
|
-
setIsRecategorizeAllModalOpen(true);
|
|
18666
|
-
}, []);
|
|
18667
|
-
const handleRecategorizeModalClose = react.useCallback((isOpen) => {
|
|
18668
|
-
setIsRecategorizeAllModalOpen(isOpen);
|
|
18669
|
-
if (!isOpen) {
|
|
18670
|
-
setSelectedCategory(null);
|
|
18823
|
+
}), [buildTransactionsPayload, trigger, clearSelection]);
|
|
18824
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18825
|
+
BaseConfirmationModal,
|
|
18826
|
+
{
|
|
18827
|
+
isOpen,
|
|
18828
|
+
onOpenChange,
|
|
18829
|
+
title: "Confirm all suggestions?",
|
|
18830
|
+
content: /* @__PURE__ */ jsxRuntime.jsx(Span, { children: `This will confirm ${count} selected ${pluralize("transaction", count)}.` }),
|
|
18831
|
+
onConfirm: handleConfirm,
|
|
18832
|
+
confirmLabel: "Confirm All",
|
|
18833
|
+
cancelLabel: "Cancel",
|
|
18834
|
+
errorText: "Failed to confirm transactions",
|
|
18835
|
+
closeOnConfirm: true
|
|
18671
18836
|
}
|
|
18672
|
-
|
|
18673
|
-
const categorySelectId = react.useId();
|
|
18674
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
18675
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18676
|
-
Button,
|
|
18677
|
-
{
|
|
18678
|
-
variant: "outlined",
|
|
18679
|
-
onClick: handleRecategorizeAllClick,
|
|
18680
|
-
children: "Re-categorize all"
|
|
18681
|
-
}
|
|
18682
|
-
),
|
|
18683
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18684
|
-
BaseConfirmationModal,
|
|
18685
|
-
{
|
|
18686
|
-
isOpen: isRecategorizeAllModalOpen,
|
|
18687
|
-
onOpenChange: handleRecategorizeModalClose,
|
|
18688
|
-
title: "Recategorize all selected transactions?",
|
|
18689
|
-
content: /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", children: [
|
|
18690
|
-
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "3xs", children: [
|
|
18691
|
-
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: categorySelectId, children: "Select category" }),
|
|
18692
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18693
|
-
BankTransactionCategoryComboBox,
|
|
18694
|
-
{
|
|
18695
|
-
inputId: categorySelectId,
|
|
18696
|
-
selectedValue: selectedCategory,
|
|
18697
|
-
onSelectedValueChange: setSelectedCategory,
|
|
18698
|
-
includeSuggestedMatches: false
|
|
18699
|
-
}
|
|
18700
|
-
)
|
|
18701
|
-
] }),
|
|
18702
|
-
selectedCategory && isCategoryAsOption(selectedCategory) && /* @__PURE__ */ jsxRuntime.jsx(Span, { children: `This action will recategorize ${count} selected transactions as ${selectedCategory.original.displayName}.` })
|
|
18703
|
-
] }),
|
|
18704
|
-
onConfirm: () => {
|
|
18705
|
-
},
|
|
18706
|
-
confirmLabel: "Recategorize All",
|
|
18707
|
-
cancelLabel: "Cancel",
|
|
18708
|
-
confirmDisabled: !selectedCategory,
|
|
18709
|
-
closeOnConfirm: true
|
|
18710
|
-
}
|
|
18711
|
-
)
|
|
18712
|
-
] });
|
|
18837
|
+
);
|
|
18713
18838
|
};
|
|
18714
18839
|
const BULK_UNCATEGORIZE_BANK_TRANSACTIONS_TAG_KEY = "#bulk-uncategorize-bank-transactions";
|
|
18715
18840
|
const BulkUncategorizeRequestSchema = effect.Schema.Struct({
|
|
@@ -18771,53 +18896,94 @@ const useBulkUncategorize = () => {
|
|
|
18771
18896
|
}
|
|
18772
18897
|
});
|
|
18773
18898
|
};
|
|
18774
|
-
const
|
|
18899
|
+
const BankTransactionsUncategorizeAllModal = ({ isOpen, onOpenChange }) => {
|
|
18775
18900
|
const { count } = useCountSelectedIds();
|
|
18776
18901
|
const { selectedIds } = useSelectedIds();
|
|
18777
18902
|
const { clearSelection } = useBulkSelectionActions();
|
|
18778
|
-
const [isUnconfirmAllModalOpen, setIsUnconfirmAllModalOpen] = react.useState(false);
|
|
18779
18903
|
const { trigger } = useBulkUncategorize();
|
|
18780
|
-
const handleUnconfirmAllClick = react.useCallback(() => {
|
|
18781
|
-
setIsUnconfirmAllModalOpen(true);
|
|
18782
|
-
}, []);
|
|
18783
18904
|
const handleConfirm = react.useCallback(() => __async(null, null, function* () {
|
|
18784
18905
|
const transactionIds = Array.from(selectedIds);
|
|
18785
18906
|
yield trigger({ transactionIds });
|
|
18786
18907
|
clearSelection();
|
|
18787
18908
|
}), [selectedIds, trigger, clearSelection]);
|
|
18788
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
18909
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18910
|
+
BaseConfirmationModal,
|
|
18911
|
+
{
|
|
18912
|
+
isOpen,
|
|
18913
|
+
onOpenChange,
|
|
18914
|
+
title: "Uncategorize all selected transactions?",
|
|
18915
|
+
content: /* @__PURE__ */ jsxRuntime.jsx(Span, { children: `This will uncategorize ${count} selected ${pluralize("transaction", count)}.` }),
|
|
18916
|
+
onConfirm: handleConfirm,
|
|
18917
|
+
confirmLabel: "Uncategorize All",
|
|
18918
|
+
cancelLabel: "Cancel",
|
|
18919
|
+
errorText: "Failed to uncategorize transactions"
|
|
18920
|
+
}
|
|
18921
|
+
);
|
|
18922
|
+
};
|
|
18923
|
+
const BankTransactionsBulkActions = () => {
|
|
18924
|
+
const { display } = useBankTransactionsContext();
|
|
18925
|
+
const [categorizeModalOpen, setCategorizeModalOpen] = react.useState(false);
|
|
18926
|
+
const [confirmModalOpen, setConfirmModalOpen] = react.useState(false);
|
|
18927
|
+
const [recategorizeModalOpen, setRecategorizeModalOpen] = react.useState(false);
|
|
18928
|
+
const [uncategorizeModalOpen, setUncategorizeModalOpen] = react.useState(false);
|
|
18929
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(HStack, { align: "center", gap: "xs", children: display === DisplayState.review ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
18789
18930
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18790
18931
|
Button,
|
|
18791
18932
|
{
|
|
18792
|
-
variant: "
|
|
18793
|
-
onClick:
|
|
18794
|
-
children: "
|
|
18933
|
+
variant: "outlined",
|
|
18934
|
+
onClick: () => setCategorizeModalOpen(true),
|
|
18935
|
+
children: "Categorize"
|
|
18795
18936
|
}
|
|
18796
18937
|
),
|
|
18797
18938
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18798
|
-
|
|
18939
|
+
BankTransactionsCategorizeAllModal,
|
|
18940
|
+
{
|
|
18941
|
+
isOpen: categorizeModalOpen,
|
|
18942
|
+
onOpenChange: setCategorizeModalOpen,
|
|
18943
|
+
mode: CategorizationMode.Categorize
|
|
18944
|
+
}
|
|
18945
|
+
),
|
|
18946
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "solid", onClick: () => setConfirmModalOpen(true), children: "Confirm" }),
|
|
18947
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18948
|
+
BankTransactionsConfirmAllModal,
|
|
18799
18949
|
{
|
|
18800
|
-
isOpen:
|
|
18801
|
-
onOpenChange:
|
|
18802
|
-
title: "Uncategorize all selected transactions?",
|
|
18803
|
-
content: /* @__PURE__ */ jsxRuntime.jsx(Span, { children: `This action will uncategorize ${count} selected ${pluralize("transaction", count)}.` }),
|
|
18804
|
-
onConfirm: handleConfirm,
|
|
18805
|
-
confirmLabel: "Uncategorize All",
|
|
18806
|
-
cancelLabel: "Cancel",
|
|
18807
|
-
errorText: "Failed to uncategorize transactions"
|
|
18950
|
+
isOpen: confirmModalOpen,
|
|
18951
|
+
onOpenChange: setConfirmModalOpen
|
|
18808
18952
|
}
|
|
18809
18953
|
)
|
|
18810
|
-
] });
|
|
18811
|
-
};
|
|
18812
|
-
const BankTransactionsBulkActions = () => {
|
|
18813
|
-
const { display } = useBankTransactionsContext();
|
|
18814
|
-
return /* @__PURE__ */ jsxRuntime.jsx(HStack, { pis: "3xl", align: "center", gap: "sm", children: display === DisplayState.review ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
18815
|
-
/* @__PURE__ */ jsxRuntime.jsx(BankTransactionsCategorizeAllButton, {}),
|
|
18816
|
-
/* @__PURE__ */ jsxRuntime.jsx(BankTransactionsConfirmAllButton, {})
|
|
18817
18954
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
18818
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18819
|
-
|
|
18820
|
-
|
|
18955
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18956
|
+
Button,
|
|
18957
|
+
{
|
|
18958
|
+
variant: "outlined",
|
|
18959
|
+
onClick: () => setRecategorizeModalOpen(true),
|
|
18960
|
+
children: "Recategorize"
|
|
18961
|
+
}
|
|
18962
|
+
),
|
|
18963
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18964
|
+
BankTransactionsCategorizeAllModal,
|
|
18965
|
+
{
|
|
18966
|
+
isOpen: recategorizeModalOpen,
|
|
18967
|
+
onOpenChange: setRecategorizeModalOpen,
|
|
18968
|
+
mode: CategorizationMode.Recategorize
|
|
18969
|
+
}
|
|
18970
|
+
),
|
|
18971
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18972
|
+
Button,
|
|
18973
|
+
{
|
|
18974
|
+
variant: "solid",
|
|
18975
|
+
onClick: () => setUncategorizeModalOpen(true),
|
|
18976
|
+
children: "Uncategorize"
|
|
18977
|
+
}
|
|
18978
|
+
),
|
|
18979
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18980
|
+
BankTransactionsUncategorizeAllModal,
|
|
18981
|
+
{
|
|
18982
|
+
isOpen: uncategorizeModalOpen,
|
|
18983
|
+
onOpenChange: setUncategorizeModalOpen
|
|
18984
|
+
}
|
|
18985
|
+
)
|
|
18986
|
+
] }) }) });
|
|
18821
18987
|
};
|
|
18822
18988
|
function TransactionsSearch({ slot, isDisabled }) {
|
|
18823
18989
|
const { filters, setFilters } = useBankTransactionsFiltersContext();
|
|
@@ -18994,8 +19160,8 @@ const BankTransactionsHeader = ({
|
|
|
18994
19160
|
}
|
|
18995
19161
|
);
|
|
18996
19162
|
};
|
|
18997
|
-
const Inbox = (
|
|
18998
|
-
var
|
|
19163
|
+
const Inbox = (_Sb) => {
|
|
19164
|
+
var _Tb = _Sb, { size = 18 } = _Tb, props = __objRest(_Tb, ["size"]);
|
|
18999
19165
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
19000
19166
|
"svg",
|
|
19001
19167
|
__spreadProps(__spreadValues({
|
|
@@ -19542,8 +19708,8 @@ function RuleUpdatesPromptStep({ ruleSuggestion, close: close2 }) {
|
|
|
19542
19708
|
const CSS_PREFIX$1 = "Layer__UI__Table";
|
|
19543
19709
|
const getClassName = (component, additionalClassNames, withHidden) => classNames(`${CSS_PREFIX$1}-${component}`, withHidden && `${CSS_PREFIX$1}-${component}--hidden`, additionalClassNames);
|
|
19544
19710
|
const Table$1 = react.forwardRef(
|
|
19545
|
-
(
|
|
19546
|
-
var
|
|
19711
|
+
(_Ub, ref) => {
|
|
19712
|
+
var _Vb = _Ub, { children, className } = _Vb, restProps = __objRest(_Vb, ["children", "className"]);
|
|
19547
19713
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19548
19714
|
reactAriaComponents.Table,
|
|
19549
19715
|
__spreadProps(__spreadValues({
|
|
@@ -19556,8 +19722,8 @@ const Table$1 = react.forwardRef(
|
|
|
19556
19722
|
}
|
|
19557
19723
|
);
|
|
19558
19724
|
Table$1.displayName = "Table";
|
|
19559
|
-
const TableHeaderInner = (
|
|
19560
|
-
var
|
|
19725
|
+
const TableHeaderInner = (_Wb, ref) => {
|
|
19726
|
+
var _Xb = _Wb, { children, className, hideHeader } = _Xb, restProps = __objRest(_Xb, ["children", "className", "hideHeader"]);
|
|
19561
19727
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19562
19728
|
reactAriaComponents.TableHeader,
|
|
19563
19729
|
__spreadProps(__spreadValues({
|
|
@@ -19570,8 +19736,8 @@ const TableHeaderInner = (_Qb, ref) => {
|
|
|
19570
19736
|
};
|
|
19571
19737
|
const TableHeader = react.forwardRef(TableHeaderInner);
|
|
19572
19738
|
TableHeader.displayName = "TableHeader";
|
|
19573
|
-
const TableBodyInner = (
|
|
19574
|
-
var
|
|
19739
|
+
const TableBodyInner = (_Yb, ref) => {
|
|
19740
|
+
var _Zb = _Yb, { children, className } = _Zb, restProps = __objRest(_Zb, ["children", "className"]);
|
|
19575
19741
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19576
19742
|
reactAriaComponents.TableBody,
|
|
19577
19743
|
__spreadProps(__spreadValues({
|
|
@@ -19584,8 +19750,8 @@ const TableBodyInner = (_Sb, ref) => {
|
|
|
19584
19750
|
};
|
|
19585
19751
|
const TableBody$1 = react.forwardRef(TableBodyInner);
|
|
19586
19752
|
TableBody$1.displayName = "TableBody";
|
|
19587
|
-
const RowInner = (
|
|
19588
|
-
var
|
|
19753
|
+
const RowInner = (__b, ref) => {
|
|
19754
|
+
var _$b = __b, { children, className, depth = 0 } = _$b, restProps = __objRest(_$b, ["children", "className", "depth"]);
|
|
19589
19755
|
const dataProperties = toDataProperties({ depth });
|
|
19590
19756
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19591
19757
|
reactAriaComponents.Row,
|
|
@@ -19600,8 +19766,8 @@ const RowInner = (_Ub, ref) => {
|
|
|
19600
19766
|
const Row = react.forwardRef(RowInner);
|
|
19601
19767
|
Row.displayName = "Row";
|
|
19602
19768
|
const Column = react.forwardRef(
|
|
19603
|
-
(
|
|
19604
|
-
var
|
|
19769
|
+
(_ac, ref) => {
|
|
19770
|
+
var _bc = _ac, { children, className, textAlign = "left" } = _bc, restProps = __objRest(_bc, ["children", "className", "textAlign"]);
|
|
19605
19771
|
const dataProperties = toDataProperties({ "text-align": textAlign });
|
|
19606
19772
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19607
19773
|
reactAriaComponents.Column,
|
|
@@ -19616,8 +19782,8 @@ const Column = react.forwardRef(
|
|
|
19616
19782
|
);
|
|
19617
19783
|
Column.displayName = "Column";
|
|
19618
19784
|
const Cell = react.forwardRef(
|
|
19619
|
-
(
|
|
19620
|
-
var
|
|
19785
|
+
(_cc, ref) => {
|
|
19786
|
+
var _dc = _cc, { children, className } = _dc, restProps = __objRest(_dc, ["children", "className"]);
|
|
19621
19787
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19622
19788
|
reactAriaComponents.Cell,
|
|
19623
19789
|
__spreadProps(__spreadValues({
|
|
@@ -19791,13 +19957,7 @@ const AffectedTransactionsTable = ({
|
|
|
19791
19957
|
]: {
|
|
19792
19958
|
id: "Description",
|
|
19793
19959
|
header: "Description",
|
|
19794
|
-
cell: (row) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
19795
|
-
Span,
|
|
19796
|
-
{
|
|
19797
|
-
ellipsis: true,
|
|
19798
|
-
children: row.counterpartyName || row.description || "-"
|
|
19799
|
-
}
|
|
19800
|
-
),
|
|
19960
|
+
cell: (row) => /* @__PURE__ */ jsxRuntime.jsx(Span, { withTooltip: true, children: row.counterpartyName || row.description || "-" }),
|
|
19801
19961
|
isRowHeader: true
|
|
19802
19962
|
},
|
|
19803
19963
|
[
|
|
@@ -20265,8 +20425,8 @@ const CategorizationRulesDrawer = () => {
|
|
|
20265
20425
|
) });
|
|
20266
20426
|
};
|
|
20267
20427
|
const COMPONENT_NAME$a = "bank-transactions";
|
|
20268
|
-
const BankTransactions = (
|
|
20269
|
-
var
|
|
20428
|
+
const BankTransactions = (_ec) => {
|
|
20429
|
+
var _fc = _ec, {
|
|
20270
20430
|
onError,
|
|
20271
20431
|
showTags = false,
|
|
20272
20432
|
showCustomerVendor = false,
|
|
@@ -20275,7 +20435,7 @@ const BankTransactions = (__b) => {
|
|
|
20275
20435
|
mode,
|
|
20276
20436
|
renderInAppLink,
|
|
20277
20437
|
_showBulkSelection = false
|
|
20278
|
-
} =
|
|
20438
|
+
} = _fc, props = __objRest(_fc, [
|
|
20279
20439
|
"onError",
|
|
20280
20440
|
"showTags",
|
|
20281
20441
|
"showCustomerVendor",
|
|
@@ -20514,7 +20674,8 @@ const BankTransactionsTableView = ({
|
|
|
20514
20674
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.bankTransactionCTAs,
|
|
20515
20675
|
showDescriptions,
|
|
20516
20676
|
showReceiptUploads,
|
|
20517
|
-
showTooltips
|
|
20677
|
+
showTooltips,
|
|
20678
|
+
_showBulkSelection
|
|
20518
20679
|
}
|
|
20519
20680
|
)
|
|
20520
20681
|
] }) : null,
|
|
@@ -20559,8 +20720,8 @@ const BankTransactionsTableView = ({
|
|
|
20559
20720
|
}
|
|
20560
20721
|
);
|
|
20561
20722
|
};
|
|
20562
|
-
const QuickbooksIcon = (
|
|
20563
|
-
var
|
|
20723
|
+
const QuickbooksIcon = (_gc) => {
|
|
20724
|
+
var _hc = _gc, { size = 24 } = _hc, props = __objRest(_hc, ["size"]);
|
|
20564
20725
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
20565
20726
|
"svg",
|
|
20566
20727
|
__spreadProps(__spreadValues({
|
|
@@ -20841,8 +21002,8 @@ function QuickbooksContextProvider({ children }) {
|
|
|
20841
21002
|
const quickbooksContextData = useQuickbooks();
|
|
20842
21003
|
return /* @__PURE__ */ jsxRuntime.jsx(QuickbooksContext.Provider, { value: quickbooksContextData, children });
|
|
20843
21004
|
}
|
|
20844
|
-
const Cog = (
|
|
20845
|
-
var
|
|
21005
|
+
const Cog = (_ic) => {
|
|
21006
|
+
var _jc = _ic, { size = 12 } = _jc, props = __objRest(_jc, ["size"]);
|
|
20846
21007
|
const id = react.useId();
|
|
20847
21008
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
20848
21009
|
"svg",
|
|
@@ -21488,8 +21649,8 @@ const useProfitAndLossLTM = ({ currentDate, tagFilter, reportingBasis } = {
|
|
|
21488
21649
|
refetch
|
|
21489
21650
|
};
|
|
21490
21651
|
};
|
|
21491
|
-
const BarChart2 = (
|
|
21492
|
-
var
|
|
21652
|
+
const BarChart2 = (_kc) => {
|
|
21653
|
+
var _lc = _kc, { size = 12 } = _lc, props = __objRest(_lc, ["size"]);
|
|
21493
21654
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21494
21655
|
"svg",
|
|
21495
21656
|
__spreadProps(__spreadValues({
|
|
@@ -22426,8 +22587,8 @@ const TASKS_CHARTS_COLORS = {
|
|
|
22426
22587
|
done: "#3B9C63",
|
|
22427
22588
|
pending: "#DFA000"
|
|
22428
22589
|
};
|
|
22429
|
-
const SortArrows = (
|
|
22430
|
-
var
|
|
22590
|
+
const SortArrows = (_mc) => {
|
|
22591
|
+
var _nc = _mc, { size = 13 } = _nc, props = __objRest(_nc, ["size"]);
|
|
22431
22592
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
22432
22593
|
"svg",
|
|
22433
22594
|
__spreadProps(__spreadValues({
|
|
@@ -23804,7 +23965,7 @@ const ProfitAndLossDetailReport = ({
|
|
|
23804
23965
|
Text,
|
|
23805
23966
|
{
|
|
23806
23967
|
as: "span",
|
|
23807
|
-
|
|
23968
|
+
withDeprecatedTooltip: TextUseTooltip.whenTruncated,
|
|
23808
23969
|
ellipsis: true,
|
|
23809
23970
|
children: row.account.name || "-"
|
|
23810
23971
|
}
|
|
@@ -23822,7 +23983,7 @@ const ProfitAndLossDetailReport = ({
|
|
|
23822
23983
|
Text,
|
|
23823
23984
|
{
|
|
23824
23985
|
as: "span",
|
|
23825
|
-
|
|
23986
|
+
withDeprecatedTooltip: TextUseTooltip.whenTruncated,
|
|
23826
23987
|
ellipsis: true,
|
|
23827
23988
|
children: ((_a = row.source) == null ? void 0 : _a.displayDescription) || row.account.accountSubtype.displayName || "-"
|
|
23828
23989
|
}
|
|
@@ -25378,10 +25539,10 @@ function Internal_ProfitAndLossSummaries({
|
|
|
25378
25539
|
unstable_AdditionalListItems.map((item, index2) => /* @__PURE__ */ jsxRuntime.jsx(ProfitAndLossSummariesListItem, { children: item }, index2))
|
|
25379
25540
|
] }) });
|
|
25380
25541
|
}
|
|
25381
|
-
function ProfitAndLossSummaries(
|
|
25382
|
-
var
|
|
25542
|
+
function ProfitAndLossSummaries(_oc) {
|
|
25543
|
+
var _pc = _oc, {
|
|
25383
25544
|
onTransactionsToReviewClick
|
|
25384
|
-
} =
|
|
25545
|
+
} = _pc, restProps = __objRest(_pc, [
|
|
25385
25546
|
"onTransactionsToReviewClick"
|
|
25386
25547
|
]);
|
|
25387
25548
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -25417,8 +25578,8 @@ const ProfitAndLossWithoutReportsModeProvider = ({
|
|
|
25417
25578
|
const ProfitAndLossWithReportsModeProvider = (props) => {
|
|
25418
25579
|
return /* @__PURE__ */ jsxRuntime.jsx(ReportsModeStoreProvider, { initialModes: { ProfitAndLoss: "monthPicker" }, children: /* @__PURE__ */ jsxRuntime.jsx(ProfitAndLossWithoutReportsModeProvider, __spreadValues({}, props)) });
|
|
25419
25580
|
};
|
|
25420
|
-
const ProfitAndLoss = (
|
|
25421
|
-
var
|
|
25581
|
+
const ProfitAndLoss = (_qc) => {
|
|
25582
|
+
var _rc = _qc, { withReportsModeProvider = true } = _rc, restProps = __objRest(_rc, ["withReportsModeProvider"]);
|
|
25422
25583
|
if (withReportsModeProvider) return /* @__PURE__ */ jsxRuntime.jsx(ProfitAndLossWithReportsModeProvider, __spreadValues({}, restProps));
|
|
25423
25584
|
return /* @__PURE__ */ jsxRuntime.jsx(ProfitAndLossWithoutReportsModeProvider, __spreadValues({}, restProps));
|
|
25424
25585
|
};
|
|
@@ -27226,8 +27387,8 @@ const useLedgerAccounts = () => {
|
|
|
27226
27387
|
fetchMore
|
|
27227
27388
|
};
|
|
27228
27389
|
};
|
|
27229
|
-
const Plus = (
|
|
27230
|
-
var
|
|
27390
|
+
const Plus = (_sc) => {
|
|
27391
|
+
var _tc = _sc, { size = 14 } = _tc, props = __objRest(_tc, ["size"]);
|
|
27231
27392
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
27232
27393
|
"svg",
|
|
27233
27394
|
__spreadProps(__spreadValues({
|
|
@@ -27526,8 +27687,8 @@ const ChartOfAccountsSidebar = ({
|
|
|
27526
27687
|
}) => {
|
|
27527
27688
|
return /* @__PURE__ */ jsxRuntime.jsx(ChartOfAccountsForm, { stringOverrides });
|
|
27528
27689
|
};
|
|
27529
|
-
const Edit2 = (
|
|
27530
|
-
var
|
|
27690
|
+
const Edit2 = (_uc) => {
|
|
27691
|
+
var _vc = _uc, { size = 18 } = _vc, props = __objRest(_vc, ["size"]);
|
|
27531
27692
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
27532
27693
|
"svg",
|
|
27533
27694
|
__spreadProps(__spreadValues({
|
|
@@ -30257,8 +30418,8 @@ const TasksHeader = ({
|
|
|
30257
30418
|
}) => {
|
|
30258
30419
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__tasks-header", children: /* @__PURE__ */ jsxRuntime.jsx(Text, { size: TextSize.lg, children: tasksHeader }) });
|
|
30259
30420
|
};
|
|
30260
|
-
const SmileIcon = (
|
|
30261
|
-
var
|
|
30421
|
+
const SmileIcon = (_wc) => {
|
|
30422
|
+
var _xc = _wc, { size = 12 } = _xc, props = __objRest(_xc, ["size"]);
|
|
30262
30423
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
30263
30424
|
"svg",
|
|
30264
30425
|
__spreadProps(__spreadValues({
|
|
@@ -31217,8 +31378,8 @@ const useBookkeepingYearsStatus = () => {
|
|
|
31217
31378
|
isLoading
|
|
31218
31379
|
};
|
|
31219
31380
|
};
|
|
31220
|
-
const ArrowRightCircle = (
|
|
31221
|
-
var
|
|
31381
|
+
const ArrowRightCircle = (_yc) => {
|
|
31382
|
+
var _zc = _yc, { size = 18 } = _zc, props = __objRest(_zc, ["size"]);
|
|
31222
31383
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
31223
31384
|
"svg",
|
|
31224
31385
|
__spreadProps(__spreadValues({
|
|
@@ -31347,8 +31508,8 @@ const Tab = ({
|
|
|
31347
31508
|
badge
|
|
31348
31509
|
}) => {
|
|
31349
31510
|
if (disabled) {
|
|
31350
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
31351
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
31511
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(DeprecatedTooltip, { children: [
|
|
31512
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipTrigger, { children: /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "Layer__tabs-option", "data-checked": checked, children: [
|
|
31352
31513
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
31353
31514
|
"input",
|
|
31354
31515
|
{
|
|
@@ -31367,7 +31528,7 @@ const Tab = ({
|
|
|
31367
31528
|
badge
|
|
31368
31529
|
] })
|
|
31369
31530
|
] }) }),
|
|
31370
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
31531
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", children: disabledMessage })
|
|
31371
31532
|
] });
|
|
31372
31533
|
}
|
|
31373
31534
|
return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "Layer__tabs-option", "data-checked": checked, children: [
|
|
@@ -32547,8 +32708,8 @@ const ProgressSteps = ({ steps, currentStep }) => {
|
|
|
32547
32708
|
);
|
|
32548
32709
|
}) });
|
|
32549
32710
|
};
|
|
32550
|
-
const Document = (
|
|
32551
|
-
var
|
|
32711
|
+
const Document = (_Ac) => {
|
|
32712
|
+
var _Bc = _Ac, { size = 20 } = _Bc, props = __objRest(_Bc, ["size"]);
|
|
32552
32713
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
32553
32714
|
"svg",
|
|
32554
32715
|
__spreadProps(__spreadValues({
|
|
@@ -32653,8 +32814,8 @@ const Document = (_uc) => {
|
|
|
32653
32814
|
})
|
|
32654
32815
|
);
|
|
32655
32816
|
};
|
|
32656
|
-
const TrendingUp = (
|
|
32657
|
-
var
|
|
32817
|
+
const TrendingUp = (_Cc) => {
|
|
32818
|
+
var _Dc = _Cc, { size = 20 } = _Dc, props = __objRest(_Dc, ["size"]);
|
|
32658
32819
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
32659
32820
|
"svg",
|
|
32660
32821
|
__spreadProps(__spreadValues({
|
|
@@ -33248,12 +33409,12 @@ const USStateSelect = ({ value, onChange }) => {
|
|
|
33248
33409
|
}
|
|
33249
33410
|
);
|
|
33250
33411
|
};
|
|
33251
|
-
const PhoneInput = (
|
|
33252
|
-
var
|
|
33412
|
+
const PhoneInput = (_Ec) => {
|
|
33413
|
+
var _Fc = _Ec, {
|
|
33253
33414
|
value,
|
|
33254
33415
|
onChange,
|
|
33255
33416
|
placeholder = "Phone number"
|
|
33256
|
-
} =
|
|
33417
|
+
} = _Fc, props = __objRest(_Fc, [
|
|
33257
33418
|
"value",
|
|
33258
33419
|
"onChange",
|
|
33259
33420
|
"placeholder"
|
|
@@ -33850,8 +34011,8 @@ const PlatformOnboarding = ({ onComplete }) => {
|
|
|
33850
34011
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__platform-onboarding-layout__footer", children: renderStepFooter() })
|
|
33851
34012
|
] }) });
|
|
33852
34013
|
};
|
|
33853
|
-
const CoffeeIcon = (
|
|
33854
|
-
var
|
|
34014
|
+
const CoffeeIcon = (_Gc) => {
|
|
34015
|
+
var _Hc = _Gc, { size = 11 } = _Hc, props = __objRest(_Hc, ["size"]);
|
|
33855
34016
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
33856
34017
|
"svg",
|
|
33857
34018
|
__spreadProps(__spreadValues({
|
|
@@ -34133,8 +34294,8 @@ const getTimezoneDisplay = (date2) => {
|
|
|
34133
34294
|
};
|
|
34134
34295
|
const LINK_CLASS_NAME = "Layer__UI__Link";
|
|
34135
34296
|
const Link = react.forwardRef(
|
|
34136
|
-
function Link2(
|
|
34137
|
-
var
|
|
34297
|
+
function Link2(_Ic, ref) {
|
|
34298
|
+
var _Jc = _Ic, {
|
|
34138
34299
|
children,
|
|
34139
34300
|
size = "md",
|
|
34140
34301
|
ellipsis,
|
|
@@ -34143,7 +34304,7 @@ const Link = react.forwardRef(
|
|
|
34143
34304
|
href,
|
|
34144
34305
|
target,
|
|
34145
34306
|
rel
|
|
34146
|
-
} =
|
|
34307
|
+
} = _Jc, restProps = __objRest(_Jc, [
|
|
34147
34308
|
"children",
|
|
34148
34309
|
"size",
|
|
34149
34310
|
"ellipsis",
|
|
@@ -34241,8 +34402,7 @@ const BookkeepingOverview = ({
|
|
|
34241
34402
|
showTitle = true,
|
|
34242
34403
|
onClickReconnectAccounts,
|
|
34243
34404
|
stringOverrides,
|
|
34244
|
-
slotProps
|
|
34245
|
-
_showBookACall
|
|
34405
|
+
slotProps
|
|
34246
34406
|
}) => {
|
|
34247
34407
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
34248
34408
|
const [pnlToggle, setPnlToggle] = react.useState("expenses");
|
|
@@ -34254,7 +34414,7 @@ const BookkeepingOverview = ({
|
|
|
34254
34414
|
};
|
|
34255
34415
|
const { data: callBookings, isError, isLoading, isValidating } = useCallBookings(1);
|
|
34256
34416
|
const callBooking = (_d = (_c = callBookings == null ? void 0 : callBookings[0]) == null ? void 0 : _c.data[0]) != null ? _d : null;
|
|
34257
|
-
const callBookingVisible =
|
|
34417
|
+
const callBookingVisible = callBooking && !isLoading && !isValidating && !isError;
|
|
34258
34418
|
return /* @__PURE__ */ jsxRuntime.jsxs(ProfitAndLoss, { asContainer: false, children: [
|
|
34259
34419
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
34260
34420
|
View,
|
|
@@ -35726,19 +35886,19 @@ const VendorsProvider = ({ children }) => {
|
|
|
35726
35886
|
const vendors = useVendors();
|
|
35727
35887
|
return /* @__PURE__ */ jsxRuntime.jsx(VendorsContext.Provider, { value: vendors, children });
|
|
35728
35888
|
};
|
|
35729
|
-
const SelectVendor = (
|
|
35730
|
-
var
|
|
35889
|
+
const SelectVendor = (_Kc) => {
|
|
35890
|
+
var _Lc = _Kc, { withContext = true } = _Lc, props = __objRest(_Lc, ["withContext"]);
|
|
35731
35891
|
if (withContext) {
|
|
35732
35892
|
return /* @__PURE__ */ jsxRuntime.jsx(VendorsProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectVendorContent, __spreadValues({}, props)) });
|
|
35733
35893
|
}
|
|
35734
35894
|
return /* @__PURE__ */ jsxRuntime.jsx(SelectVendorContent, __spreadValues({}, props));
|
|
35735
35895
|
};
|
|
35736
|
-
const SelectVendorContent = (
|
|
35737
|
-
var
|
|
35896
|
+
const SelectVendorContent = (_Mc) => {
|
|
35897
|
+
var _Nc = _Mc, {
|
|
35738
35898
|
value,
|
|
35739
35899
|
onChange,
|
|
35740
35900
|
placeholder = "Select vendor"
|
|
35741
|
-
} =
|
|
35901
|
+
} = _Nc, props = __objRest(_Nc, [
|
|
35742
35902
|
"value",
|
|
35743
35903
|
"onChange",
|
|
35744
35904
|
"placeholder"
|
|
@@ -36695,8 +36855,8 @@ const BillsTableWithPanel = ({
|
|
|
36695
36855
|
}
|
|
36696
36856
|
);
|
|
36697
36857
|
};
|
|
36698
|
-
const Bills = (
|
|
36699
|
-
var
|
|
36858
|
+
const Bills = (_Oc) => {
|
|
36859
|
+
var _Pc = _Oc, { context = true } = _Pc, props = __objRest(_Pc, ["context"]);
|
|
36700
36860
|
if (context) {
|
|
36701
36861
|
return /* @__PURE__ */ jsxRuntime.jsx(BillsProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(BillsContent, __spreadValues({}, props)) });
|
|
36702
36862
|
}
|
|
@@ -36895,13 +37055,13 @@ const UnifiedReportSchema = effect.Schema.Struct({
|
|
|
36895
37055
|
)
|
|
36896
37056
|
});
|
|
36897
37057
|
const UNIFIED_REPORT_TAG_KEY = "#unified-report";
|
|
36898
|
-
function buildKey$9(
|
|
36899
|
-
var
|
|
37058
|
+
function buildKey$9(_Qc) {
|
|
37059
|
+
var _Rc = _Qc, {
|
|
36900
37060
|
access_token: accessToken,
|
|
36901
37061
|
apiUrl,
|
|
36902
37062
|
businessId,
|
|
36903
37063
|
report
|
|
36904
|
-
} =
|
|
37064
|
+
} = _Rc, dateParams = __objRest(_Rc, [
|
|
36905
37065
|
"access_token",
|
|
36906
37066
|
"apiUrl",
|
|
36907
37067
|
"businessId",
|
|
@@ -36917,8 +37077,8 @@ function buildKey$9(_Kc) {
|
|
|
36917
37077
|
}, dateParams);
|
|
36918
37078
|
}
|
|
36919
37079
|
}
|
|
36920
|
-
const getUnifiedReport = get((
|
|
36921
|
-
var
|
|
37080
|
+
const getUnifiedReport = get((_Sc) => {
|
|
37081
|
+
var _Tc = _Sc, { businessId, report } = _Tc, dateParams = __objRest(_Tc, ["businessId", "report"]);
|
|
36922
37082
|
const parameters = toDefinedSearchParameters(__spreadValues({}, dateParams));
|
|
36923
37083
|
return `/v1/businesses/${businessId}/reports/unified/${report}?${parameters}`;
|
|
36924
37084
|
});
|
|
@@ -36947,8 +37107,8 @@ class UnifiedReportSWRResponse {
|
|
|
36947
37107
|
return this.swrResponse.mutate;
|
|
36948
37108
|
}
|
|
36949
37109
|
}
|
|
36950
|
-
function useUnifiedReport(
|
|
36951
|
-
var
|
|
37110
|
+
function useUnifiedReport(_Uc) {
|
|
37111
|
+
var _Vc = _Uc, { report } = _Vc, dateParams = __objRest(_Vc, ["report"]);
|
|
36952
37112
|
const { data: auth } = useAuth();
|
|
36953
37113
|
const { apiUrl } = useEnvironment();
|
|
36954
37114
|
const { businessId } = useLayerContext();
|
|
@@ -37230,8 +37390,8 @@ const DateSelectionComboBox = () => {
|
|
|
37230
37390
|
};
|
|
37231
37391
|
const CALENDAR_CLASS_NAME = "Layer__UI__Calendar";
|
|
37232
37392
|
const Calendar = react.forwardRef(
|
|
37233
|
-
function Calendar2(
|
|
37234
|
-
var
|
|
37393
|
+
function Calendar2(_Wc, ref) {
|
|
37394
|
+
var _Xc = _Wc, { className, isReadOnly } = _Xc, restProps = __objRest(_Xc, ["className", "isReadOnly"]);
|
|
37235
37395
|
const dataProperties = toDataProperties({ readonly: isReadOnly });
|
|
37236
37396
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
37237
37397
|
reactAriaComponents.Calendar,
|
|
@@ -37245,8 +37405,8 @@ const Calendar = react.forwardRef(
|
|
|
37245
37405
|
);
|
|
37246
37406
|
const CALENDAR_GRID_CLASS_NAME = "Layer__UI__CalendarGrid";
|
|
37247
37407
|
const CalendarGrid = react.forwardRef(
|
|
37248
|
-
function CalendarGrid2(
|
|
37249
|
-
var
|
|
37408
|
+
function CalendarGrid2(_Yc, ref) {
|
|
37409
|
+
var _Zc = _Yc, { className } = _Zc, restProps = __objRest(_Zc, ["className"]);
|
|
37250
37410
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
37251
37411
|
reactAriaComponents.CalendarGrid,
|
|
37252
37412
|
__spreadProps(__spreadValues({}, restProps), {
|
|
@@ -37258,8 +37418,8 @@ const CalendarGrid = react.forwardRef(
|
|
|
37258
37418
|
);
|
|
37259
37419
|
const CALENDAR_GRID_BODY_CLASS_NAME = "Layer__UI__CalendarGridBody";
|
|
37260
37420
|
const CalendarGridBody = react.forwardRef(
|
|
37261
|
-
function CalendarGridBody2(
|
|
37262
|
-
var
|
|
37421
|
+
function CalendarGridBody2(__c, ref) {
|
|
37422
|
+
var _$c = __c, { className } = _$c, restProps = __objRest(_$c, ["className"]);
|
|
37263
37423
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
37264
37424
|
reactAriaComponents.CalendarGridBody,
|
|
37265
37425
|
__spreadProps(__spreadValues({}, restProps), {
|
|
@@ -37271,8 +37431,8 @@ const CalendarGridBody = react.forwardRef(
|
|
|
37271
37431
|
);
|
|
37272
37432
|
const CALENDAR_CELL_CLASS_NAME = "Layer__UI__CalendarCell";
|
|
37273
37433
|
const CalendarCell = react.forwardRef(
|
|
37274
|
-
function CalendarCell2(
|
|
37275
|
-
var
|
|
37434
|
+
function CalendarCell2(_ad, ref) {
|
|
37435
|
+
var _bd = _ad, { className } = _bd, restProps = __objRest(_bd, ["className"]);
|
|
37276
37436
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
37277
37437
|
reactAriaComponents.CalendarCell,
|
|
37278
37438
|
__spreadProps(__spreadValues({}, restProps), {
|
|
@@ -37284,8 +37444,8 @@ const CalendarCell = react.forwardRef(
|
|
|
37284
37444
|
);
|
|
37285
37445
|
const CALENDAR_GRID_HEADER_CLASS_NAME = "Layer__UI__CalendarGridHeader";
|
|
37286
37446
|
const CalendarGridHeader = react.forwardRef(
|
|
37287
|
-
function CalendarGridHeader2(
|
|
37288
|
-
var
|
|
37447
|
+
function CalendarGridHeader2(_cd, ref) {
|
|
37448
|
+
var _dd = _cd, { className } = _dd, restProps = __objRest(_dd, ["className"]);
|
|
37289
37449
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
37290
37450
|
reactAriaComponents.CalendarGridHeader,
|
|
37291
37451
|
__spreadProps(__spreadValues({}, restProps), {
|
|
@@ -37297,8 +37457,8 @@ const CalendarGridHeader = react.forwardRef(
|
|
|
37297
37457
|
);
|
|
37298
37458
|
const CALENDAR_HEADER_CELL_CLASS_NAME = "Layer__UI__CalendarHeaderCell";
|
|
37299
37459
|
const CalendarHeaderCell = react.forwardRef(
|
|
37300
|
-
function CalendarHeaderCell2(
|
|
37301
|
-
var
|
|
37460
|
+
function CalendarHeaderCell2(_ed, ref) {
|
|
37461
|
+
var _fd = _ed, { className } = _fd, restProps = __objRest(_fd, ["className"]);
|
|
37302
37462
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
37303
37463
|
reactAriaComponents.CalendarHeaderCell,
|
|
37304
37464
|
__spreadProps(__spreadValues({}, restProps), {
|
|
@@ -37347,9 +37507,9 @@ const DatePicker = ({
|
|
|
37347
37507
|
onChange
|
|
37348
37508
|
}) => {
|
|
37349
37509
|
const additionalAriaProps = !showLabel && { "aria-label": label };
|
|
37350
|
-
const errorTriangle = react.useMemo(() => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
37351
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
37352
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
37510
|
+
const errorTriangle = react.useMemo(() => /* @__PURE__ */ jsxRuntime.jsxs(DeprecatedTooltip, { offset: 12, children: [
|
|
37511
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipTrigger, { children: /* @__PURE__ */ jsxRuntime.jsx(FieldError, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.TriangleAlert, { size: 18 }) }) }),
|
|
37512
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeprecatedTooltipContent, { className: "Layer__tooltip", width: "md", children: errorText })
|
|
37353
37513
|
] }), [errorText]);
|
|
37354
37514
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
37355
37515
|
DatePicker$1,
|
|
@@ -37778,11 +37938,11 @@ const ProfitAndLossView = (props) => {
|
|
|
37778
37938
|
const containerRef = react.useRef(null);
|
|
37779
37939
|
return /* @__PURE__ */ jsxRuntime.jsx(Container, { name: COMPONENT_NAME$1, ref: containerRef, children: /* @__PURE__ */ jsxRuntime.jsx(ProfitAndLoss, { children: /* @__PURE__ */ jsxRuntime.jsx(ProfitAndLossPanel, __spreadValues({ containerRef }, props)) }) });
|
|
37780
37940
|
};
|
|
37781
|
-
const ProfitAndLossPanel = (
|
|
37782
|
-
var
|
|
37941
|
+
const ProfitAndLossPanel = (_gd) => {
|
|
37942
|
+
var _hd = _gd, {
|
|
37783
37943
|
containerRef,
|
|
37784
37944
|
stringOverrides
|
|
37785
|
-
} =
|
|
37945
|
+
} = _hd, props = __objRest(_hd, [
|
|
37786
37946
|
"containerRef",
|
|
37787
37947
|
"stringOverrides"
|
|
37788
37948
|
]);
|
|
@@ -38394,8 +38554,8 @@ function useInvoicesGlobalCacheActions() {
|
|
|
38394
38554
|
);
|
|
38395
38555
|
return { patchInvoiceByKey, patchInvoiceWithTransformation, forceReloadInvoices };
|
|
38396
38556
|
}
|
|
38397
|
-
const ChevronRightFill = (
|
|
38398
|
-
var
|
|
38557
|
+
const ChevronRightFill = (_id) => {
|
|
38558
|
+
var _jd = _id, { size = 18 } = _jd, props = __objRest(_jd, ["size"]);
|
|
38399
38559
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
38400
38560
|
"svg",
|
|
38401
38561
|
__spreadProps(__spreadValues({
|
|
@@ -41147,8 +41307,8 @@ const getClassnameForSubComponent = (className, suffix) => {
|
|
|
41147
41307
|
};
|
|
41148
41308
|
const METER_CLASS_NAME = "Layer__Meter";
|
|
41149
41309
|
const Meter = react.forwardRef(
|
|
41150
|
-
function Meter2(
|
|
41151
|
-
var
|
|
41310
|
+
function Meter2(_kd, ref) {
|
|
41311
|
+
var _ld = _kd, { className, label, meterOnly } = _ld, restProps = __objRest(_ld, ["className", "label", "meterOnly"]);
|
|
41152
41312
|
return /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Meter, __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, restProps), { className: classNames(METER_CLASS_NAME, className), ref }), meterOnly && { "aria-label": label }), { children: ({ percentage, valueText }) => /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "3xs", fluid: true, children: [
|
|
41153
41313
|
!meterOnly && /* @__PURE__ */ jsxRuntime.jsxs(HStack, { justify: "space-between", children: [
|
|
41154
41314
|
/* @__PURE__ */ jsxRuntime.jsx(Label, { slot: "label", children: label }),
|
|
@@ -41692,14 +41852,14 @@ const BusinessProvider = ({
|
|
|
41692
41852
|
}
|
|
41693
41853
|
);
|
|
41694
41854
|
};
|
|
41695
|
-
const LayerProvider = (
|
|
41696
|
-
var
|
|
41855
|
+
const LayerProvider = (_md) => {
|
|
41856
|
+
var _nd = _md, {
|
|
41697
41857
|
appId,
|
|
41698
41858
|
appSecret,
|
|
41699
41859
|
businessAccessToken,
|
|
41700
41860
|
environment,
|
|
41701
41861
|
usePlaidSandbox
|
|
41702
|
-
} =
|
|
41862
|
+
} = _nd, restProps = __objRest(_nd, [
|
|
41703
41863
|
"appId",
|
|
41704
41864
|
"appSecret",
|
|
41705
41865
|
"businessAccessToken",
|