@tesouro/embedded-components-react 0.5.141 → 0.5.142
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +9 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +21 -37
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +21 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +41 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +16 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +8 -98
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +4 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +98 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +78 -135
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +4 -45
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +139 -109
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +44 -186
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +108 -72
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +188 -29
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +71 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +27 -406
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +88 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +403 -77
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +13 -80
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +77 -221
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +78 -41
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +212 -234
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +44 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +234 -557
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +23 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +581 -40
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +4 -251
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +45 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +261 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +3 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +4 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +44 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +1 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +6 -127
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +13 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +126 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +3 -127
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +3 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +124 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +8 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +8 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +51 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +20 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +19 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +28 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +76 -252
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +48 -33
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +249 -142
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +27 -206
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +160 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +217 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +3 -112
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index89.js +7 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index90.js +104 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index91.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index92.js +27 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +48 -48
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index100.js +12 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index101.js +102 -27
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index102.js +2 -128
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index103.js +31 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index104.js +125 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index105.js +2 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index106.js +29 -177
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index107.js +10 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index108.js +178 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index109.js +2 -108
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index110.js +14 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index111.js +106 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index112.js +2 -52
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index113.js +10 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index114.js +52 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index115.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +26 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +14 -19
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +16 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +19 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +14 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +16 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +2 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +4 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +26 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +28 -31
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +1 -19
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +27 -117
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index29.js +19 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +123 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +2 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index32.js +4 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index33.js +14 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +2 -22
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index35.js +4 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +20 -99
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +2 -79
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index38.js +97 -273
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index39.js +79 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index40.js +273 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index41.js +2 -56
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index42.js +21 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index43.js +52 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +2 -50
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index45.js +18 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +47 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index47.js +2 -374
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +35 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index49.js +369 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +2 -96
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index51.js +23 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +93 -29
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +1 -51
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index54.js +31 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +49 -53
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +2 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +53 -194
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index58.js +13 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +195 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +2 -41
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +4 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +37 -15
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +2 -88
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +19 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +78 -308
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +2 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +311 -27
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index68.js +9 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index69.js +33 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index70.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index71.js +2 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index72.js +1 -39
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +8 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +37 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index75.js +2 -36
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +4 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index77.js +34 -37
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index78.js +2 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index79.js +37 -199
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index80.js +12 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index81.js +199 -15
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +2 -402
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +13 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +413 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js +8 -91
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js +9 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index87.js +93 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index89.js +2 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +118 -87
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index91.js +28 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index92.js +92 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index93.js +2 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index94.js +7 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index95.js +28 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index96.js +2 -34
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index97.js +7 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index98.js +32 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index99.js +1 -105
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/relativeCalendarDay.js +12 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +0 -125
|
@@ -1,88 +1,414 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { hasAnyScope as t } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
7
|
+
import { Scope as n } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
8
|
+
import "../../../shared/data-access/dist/index.js";
|
|
9
|
+
import "../../../shared/ui/dist/index.js";
|
|
10
|
+
import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
11
|
+
import "../../../shared/feature/dist/index.js";
|
|
12
|
+
import { useCounterpartsQuery as i } from "../../../shared/counterpart-management/data-access/dist/index3.js";
|
|
13
|
+
import { useCreateCounterpartBankAccountMutation as a, useUpdateCounterpartBankAccountMutation as o } from "../../../shared/counterpart-management/data-access/dist/index5.js";
|
|
14
|
+
import { usePayableSuggestionsQuery as s } from "../../data-access/dist/index18.js";
|
|
2
15
|
import "../../data-access/dist/index.js";
|
|
16
|
+
import { COUNTERPART_MESSAGE_LABELS_EN as ee } from "../../../shared/counterpart-management/feature/dist/lib/labels.js";
|
|
17
|
+
import { counterpartFormBankAccountToCreatePayload as te, counterpartFormBankAccountToUpdatePayload as ne, getAchInstructions as re, getCounterpartEmail as c, getCounterpartName as l, getPayableAchInstructions as ie, isAchCompatibleBankAccount as u, resolveCounterpartBankAccountWrite as ae, validateAchFormValues as oe } from "../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
18
|
+
import { useCounterpartDetails as se } from "../../../shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js";
|
|
19
|
+
import { useCounterpartForm as ce } from "../../../shared/counterpart-management/feature/dist/lib/useCounterpartForm.js";
|
|
20
|
+
import "../../../shared/counterpart-management/feature/dist/index.js";
|
|
21
|
+
import { VENDOR_SECTION_PROPS_LABELS_EN as le } from "./index50.js";
|
|
22
|
+
import { buildVendorPrefill as ue } from "./index52.js";
|
|
23
|
+
import { VendorInlineForm as de } from "./index53.js";
|
|
24
|
+
import { useCallback as d, useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
25
|
+
import { jsx as fe } from "react/jsx-runtime";
|
|
3
26
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return !!(e.description.trim() || e.glCode.trim() || n(e.price) !== null || n(e.amount) !== null);
|
|
16
|
-
}
|
|
17
|
-
function a(e) {
|
|
18
|
-
return n(e) ?? 0;
|
|
19
|
-
}
|
|
20
|
-
function o(e) {
|
|
21
|
-
let t = Number.parseFloat(e);
|
|
22
|
-
return Number.isFinite(t) ? t : 0;
|
|
27
|
+
var pe = 10, me = 300, g = {
|
|
28
|
+
accountHolderName: "",
|
|
29
|
+
routingNumber: "",
|
|
30
|
+
accountNumber: ""
|
|
31
|
+
};
|
|
32
|
+
function he(e) {
|
|
33
|
+
return {
|
|
34
|
+
accountHolderName: e.account_holder_name ?? "",
|
|
35
|
+
routingNumber: e.routing_number ?? "",
|
|
36
|
+
accountNumber: e.account_number ?? ""
|
|
37
|
+
};
|
|
23
38
|
}
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
return t === null ? e : c(t);
|
|
39
|
+
function _(e, t) {
|
|
40
|
+
return e.accountHolderName.trim() === t.accountHolderName.trim() && e.routingNumber.trim() === t.routingNumber.trim() && e.accountNumber.trim() === t.accountNumber.trim();
|
|
27
41
|
}
|
|
28
|
-
function
|
|
29
|
-
return (e
|
|
42
|
+
function ge(e, t) {
|
|
43
|
+
return e?.find((e) => e.id === t && u(e)) ?? re(e);
|
|
30
44
|
}
|
|
31
|
-
function
|
|
32
|
-
let
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
45
|
+
function v({ payableId: re, counterpartId: u, payableCounterpartId: v, payableCounterpartBankAccountId: _e, isVendorKnown: ve = !0, onCounterpartChange: ye, requiredError: be, extractedVendor: y, readOnly: b = !1, canEditVendor: xe = !0, canEditPaymentInstructions: Se = !0, canAddPaymentInstructions: x = !0, confirmDiscard: S = (e) => e(), labels: Ce }) {
|
|
46
|
+
let C = {
|
|
47
|
+
...le,
|
|
48
|
+
...Ce
|
|
49
|
+
}, { initResponse: we } = r(), Te = t(we?.scopes, [n.CounterpartReadOrg]), [w, Ee] = h(""), [T, De] = h(""), Oe = m(T), [E, ke] = h(), [Ae, je] = h("none"), [Me, Ne] = h(), [Pe, D] = h(!1), [O, k] = h(!1), [A, j] = h(g), Fe = m(A);
|
|
50
|
+
Fe.current = A;
|
|
51
|
+
let M = m(g), [Ie, N] = h(), [Le, Re] = h(), P = Le?.bankAccountId, F = m(void 0), ze = m(u), [Be, Ve] = h(!1), [He, Ue] = h(!1), I = m(void 0), We = (O || E === "create") && !_(A, M.current), L = d(() => {
|
|
52
|
+
k(!1), j(g), M.current = g, N(void 0);
|
|
53
|
+
}, []), R = d((e) => {
|
|
54
|
+
Ve(!0), ye(e);
|
|
55
|
+
}, [ye]), Ge = s(re, { enabled: !b && !!re && !u && !v }).data?.suggested_counterpart?.id, Ke = y?.name;
|
|
56
|
+
f(() => {
|
|
57
|
+
!b && !Be && !u && !v && Ge && R(Ge);
|
|
58
|
+
}, [
|
|
59
|
+
u,
|
|
60
|
+
v,
|
|
61
|
+
b,
|
|
62
|
+
Be,
|
|
63
|
+
Ge,
|
|
64
|
+
R
|
|
65
|
+
]), f(() => {
|
|
66
|
+
ze.current !== u && (ze.current = u, L(), Re((e) => e?.counterpartId === u ? e : void 0));
|
|
67
|
+
}, [u, L]), f(() => {
|
|
68
|
+
let e = setTimeout(() => {
|
|
69
|
+
De(w.trim());
|
|
70
|
+
}, me);
|
|
71
|
+
return () => clearTimeout(e);
|
|
72
|
+
}, [w]);
|
|
73
|
+
let z = i({
|
|
74
|
+
sort: "counterpart_name",
|
|
75
|
+
order: "asc",
|
|
76
|
+
limit: pe,
|
|
77
|
+
counterpart_name__icontains: T || void 0,
|
|
78
|
+
is_vendor: !0,
|
|
79
|
+
enabled: !b && (E === "edit" || !E && !u) && ve && Te
|
|
80
|
+
});
|
|
81
|
+
f(() => {
|
|
82
|
+
z.isPlaceholderData || (Oe.current = T);
|
|
83
|
+
}, [T, z.isPlaceholderData]);
|
|
84
|
+
let qe = z.isPlaceholderData && Oe.current !== T, B = se({
|
|
85
|
+
selectedId: u,
|
|
86
|
+
enabled: Te
|
|
87
|
+
}), Je = a(), Ye = o(), V = ce({
|
|
88
|
+
view: Ae,
|
|
89
|
+
setView: je,
|
|
90
|
+
selectedId: Me,
|
|
91
|
+
setSelectedId: Ne,
|
|
92
|
+
messages: ee,
|
|
93
|
+
counterpartType: "vendor",
|
|
94
|
+
counterpart: B.counterpart,
|
|
95
|
+
primaryAddress: B.primaryAddress,
|
|
96
|
+
includeBankAccount: !1
|
|
97
|
+
}), { openCreate: Xe, openEdit: Ze, close: Qe, setValues: H, submit: $e } = V, U = p(() => ue(y), [y]), W = U?.bankAccount, G = p(() => {
|
|
98
|
+
let e = B.counterpart;
|
|
99
|
+
if (!e) return;
|
|
100
|
+
if (B.isBankAccountsLoading) return {
|
|
101
|
+
name: l(e),
|
|
102
|
+
email: c(e),
|
|
103
|
+
methodLabel: C.paymentMethodLoading,
|
|
104
|
+
hasPaymentInstructions: !1
|
|
105
|
+
};
|
|
106
|
+
if (B.isBankAccountsError) return {
|
|
107
|
+
name: l(e),
|
|
108
|
+
email: c(e),
|
|
109
|
+
methodLabel: C.paymentMethodUnavailable,
|
|
110
|
+
hasPaymentInstructions: !1
|
|
111
|
+
};
|
|
112
|
+
let t = ie(B.bankAccounts);
|
|
113
|
+
return {
|
|
114
|
+
name: l(e),
|
|
115
|
+
email: c(e),
|
|
116
|
+
methodLabel: t ? C.paymentInstructionsValue(t.account_number?.slice(-4) ?? "") : C.noMethod,
|
|
117
|
+
hasPaymentInstructions: !!t
|
|
118
|
+
};
|
|
119
|
+
}, [
|
|
120
|
+
B.bankAccounts,
|
|
121
|
+
B.counterpart,
|
|
122
|
+
B.isBankAccountsError,
|
|
123
|
+
B.isBankAccountsLoading,
|
|
124
|
+
C
|
|
125
|
+
]), et = p(() => {
|
|
126
|
+
let e = Ke?.trim();
|
|
127
|
+
if (!e || u || E) return;
|
|
128
|
+
let t = W?.accountNumber;
|
|
129
|
+
return {
|
|
130
|
+
name: e,
|
|
131
|
+
email: y?.email ?? "",
|
|
132
|
+
description: C.pendingVendorDescription,
|
|
133
|
+
methodLabel: t ? C.paymentInstructionsValue(t.slice(-4)) : "",
|
|
134
|
+
hasPaymentInstructions: !!t
|
|
135
|
+
};
|
|
136
|
+
}, [
|
|
137
|
+
u,
|
|
138
|
+
W?.accountNumber,
|
|
139
|
+
y?.email,
|
|
140
|
+
Ke,
|
|
141
|
+
E,
|
|
142
|
+
C.paymentInstructionsValue,
|
|
143
|
+
C.pendingVendorDescription
|
|
144
|
+
]), K = u === v ? _e : void 0, q = p(() => ge(B.bankAccounts, K), [B.bankAccounts, K]), tt = p(() => ie(B.bankAccounts)?.id, [B.bankAccounts]), J = !B.counterpart || B.isLoading || B.isFetching || B.isError || B.isAddressesLoading || B.isAddressesFetching || B.isAddressesError || B.isBankAccountsLoading || B.isBankAccountsFetching || B.isBankAccountsError, Y = d(() => {
|
|
145
|
+
Qe(), ke(void 0), D(!1), F.current = void 0;
|
|
146
|
+
}, [Qe]), nt = d((e) => {
|
|
147
|
+
if (D(!1), F.current = void 0, e === "edit") Ne(u), Ze();
|
|
148
|
+
else {
|
|
149
|
+
Xe();
|
|
150
|
+
let e = w.trim();
|
|
151
|
+
H((t) => ({
|
|
152
|
+
...t,
|
|
153
|
+
entityType: "organization",
|
|
154
|
+
legalName: e || U?.legalName || t.legalName,
|
|
155
|
+
email: U?.email || t.email,
|
|
156
|
+
phone: U?.phone || t.phone,
|
|
157
|
+
address: U?.address ?? t.address
|
|
158
|
+
})), j(W ?? g), N(void 0), M.current = g;
|
|
159
|
+
}
|
|
160
|
+
ke(e);
|
|
161
|
+
}, [
|
|
162
|
+
u,
|
|
163
|
+
W,
|
|
164
|
+
Xe,
|
|
165
|
+
Ze,
|
|
166
|
+
w,
|
|
167
|
+
H,
|
|
168
|
+
U
|
|
169
|
+
]), rt = d(() => {
|
|
170
|
+
let e = q ? he(q) : g;
|
|
171
|
+
M.current = e, j(e), N(void 0), k(!0);
|
|
172
|
+
}, [q]), it = d((e) => {
|
|
173
|
+
j((t) => ({
|
|
174
|
+
...t,
|
|
175
|
+
...e
|
|
176
|
+
})), N(void 0);
|
|
177
|
+
}, []), at = d(() => {
|
|
178
|
+
We ? S(L) : L();
|
|
179
|
+
}, [
|
|
180
|
+
L,
|
|
181
|
+
S,
|
|
182
|
+
We
|
|
183
|
+
]), X = d(() => {
|
|
184
|
+
Y(), L();
|
|
185
|
+
}, [L, Y]), Z = Pe || We, Q = d((e) => {
|
|
186
|
+
let t = () => {
|
|
187
|
+
X(), e();
|
|
188
|
+
};
|
|
189
|
+
Z ? S(t) : t();
|
|
190
|
+
}, [
|
|
191
|
+
S,
|
|
192
|
+
X,
|
|
193
|
+
Z
|
|
194
|
+
]), ot = d(() => {
|
|
195
|
+
Z ? S(X) : X();
|
|
196
|
+
}, [
|
|
197
|
+
S,
|
|
198
|
+
X,
|
|
199
|
+
Z
|
|
200
|
+
]), st = d(async (t) => {
|
|
201
|
+
let n = u, r = !1, i = Fe.current;
|
|
202
|
+
if (!_(i, M.current)) {
|
|
203
|
+
let e = oe(i);
|
|
204
|
+
if (Object.keys(e).length > 0) return N(e), E !== "create" && k(!0), { ok: !1 };
|
|
205
|
+
}
|
|
206
|
+
if (E === "edit" && J) return { ok: !1 };
|
|
207
|
+
if (E) {
|
|
208
|
+
if (E === "create" && F.current) n = F.current;
|
|
209
|
+
else {
|
|
210
|
+
let e = await $e();
|
|
211
|
+
if (!e.ok) return { ok: !1 };
|
|
212
|
+
E === "create" ? (n = e.counterpartId, F.current = n) : n = e.counterpartId ?? n;
|
|
213
|
+
}
|
|
214
|
+
E === "create" && (r = !0);
|
|
215
|
+
}
|
|
216
|
+
if (!n) return { ok: !0 };
|
|
217
|
+
let a = B.isBankAccountsLoading || B.isBankAccountsFetching || B.isBankAccountsError;
|
|
218
|
+
if (_(i, M.current)) {
|
|
219
|
+
let e = P ?? K;
|
|
220
|
+
return e ? (t && (k(!1), E && Y()), r && R(n), {
|
|
221
|
+
ok: !0,
|
|
222
|
+
counterpartId: n,
|
|
223
|
+
counterpartBankAccountId: e
|
|
224
|
+
}) : r ? (t && Y(), R(n), {
|
|
225
|
+
ok: !0,
|
|
226
|
+
counterpartId: n
|
|
227
|
+
}) : a ? { ok: !1 } : (t && (k(!1), E && Y()), {
|
|
228
|
+
ok: !0,
|
|
229
|
+
counterpartId: n,
|
|
230
|
+
counterpartBankAccountId: tt
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
if (a) return { ok: !1 };
|
|
234
|
+
N(void 0);
|
|
235
|
+
let o = ae(B.bankAccounts, P ?? q?.id), s;
|
|
236
|
+
try {
|
|
237
|
+
o.kind === "update" ? (await Ye.mutateAsync({
|
|
238
|
+
path: {
|
|
239
|
+
counterpart_id: n,
|
|
240
|
+
bank_account_id: o.bankAccountId
|
|
241
|
+
},
|
|
242
|
+
body: ne(i, { includeAchDefaults: o.includeAchDefaults })
|
|
243
|
+
}), s = o.bankAccountId) : s = (await Je.mutateAsync({
|
|
244
|
+
path: { counterpart_id: n },
|
|
245
|
+
body: te(i, { isDefaultForCurrency: o.isDefaultForCurrency })
|
|
246
|
+
}))?.id;
|
|
247
|
+
} catch {
|
|
248
|
+
return e.error(C.bankAccountSaveFailed), {
|
|
249
|
+
ok: !1,
|
|
250
|
+
counterpartId: n
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
return M.current = i, Re(s ? {
|
|
254
|
+
counterpartId: n,
|
|
255
|
+
bankAccountId: s
|
|
256
|
+
} : void 0), t && (k(!1), E && Y()), r && R(n), {
|
|
257
|
+
ok: !0,
|
|
258
|
+
counterpartId: n,
|
|
259
|
+
counterpartBankAccountId: s
|
|
260
|
+
};
|
|
261
|
+
}, [
|
|
262
|
+
Y,
|
|
263
|
+
u,
|
|
264
|
+
Je,
|
|
265
|
+
B.bankAccounts,
|
|
266
|
+
B.isBankAccountsError,
|
|
267
|
+
B.isBankAccountsFetching,
|
|
268
|
+
B.isBankAccountsLoading,
|
|
269
|
+
E,
|
|
270
|
+
J,
|
|
271
|
+
K,
|
|
272
|
+
tt,
|
|
273
|
+
R,
|
|
274
|
+
q,
|
|
275
|
+
$e,
|
|
276
|
+
Ye,
|
|
277
|
+
P
|
|
278
|
+
]), ct = d((e) => {
|
|
279
|
+
if (I.current) return I.current;
|
|
280
|
+
let t = e?.closeOnSuccess ?? !0, n = (async () => {
|
|
281
|
+
Ue(!0);
|
|
282
|
+
try {
|
|
283
|
+
return await st(t);
|
|
284
|
+
} finally {
|
|
285
|
+
I.current = void 0, Ue(!1);
|
|
286
|
+
}
|
|
287
|
+
})();
|
|
288
|
+
return I.current = n, n;
|
|
289
|
+
}, [st]), lt = d(() => {
|
|
290
|
+
k(!1), E && Y();
|
|
291
|
+
}, [E, Y]), ut = p(() => (z.data?.data ?? []).map((e) => ({
|
|
292
|
+
name: l(e),
|
|
293
|
+
email: c(e),
|
|
294
|
+
onSelect: () => {
|
|
295
|
+
Q(() => R(e.id));
|
|
296
|
+
}
|
|
297
|
+
})), [
|
|
298
|
+
z.data,
|
|
299
|
+
Q,
|
|
300
|
+
R
|
|
301
|
+
]), dt = d((e) => {
|
|
302
|
+
D(!0), H((t) => e.entityType === "individual" && t.entityType !== "individual" ? {
|
|
303
|
+
...t,
|
|
304
|
+
...e,
|
|
305
|
+
firstName: t.firstName || t.legalName,
|
|
306
|
+
legalName: t.legalName
|
|
307
|
+
} : e.entityType === "organization" && t.entityType !== "organization" ? {
|
|
308
|
+
...t,
|
|
309
|
+
...e,
|
|
310
|
+
legalName: t.legalName || [t.firstName, t.lastName].filter(Boolean).join(" ")
|
|
311
|
+
} : {
|
|
312
|
+
...t,
|
|
313
|
+
...e
|
|
42
314
|
});
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
315
|
+
}, [H]), ft = d((e) => {
|
|
316
|
+
D(!0), H((t) => ({
|
|
317
|
+
...t,
|
|
318
|
+
address: {
|
|
319
|
+
...t.address,
|
|
320
|
+
...e
|
|
321
|
+
}
|
|
322
|
+
}));
|
|
323
|
+
}, [H]), pt = {
|
|
324
|
+
query: w,
|
|
325
|
+
onQueryChange: Ee,
|
|
326
|
+
isLoading: !ve || !we || !!u && B.isLoading || z.isLoading || z.isFetching && qe,
|
|
327
|
+
onAddVendor: () => {
|
|
328
|
+
Q(() => nt("create"));
|
|
329
|
+
},
|
|
330
|
+
results: ut
|
|
331
|
+
}, mt = x && (E === "create" || !J) ? {
|
|
332
|
+
isOpen: O,
|
|
333
|
+
values: A,
|
|
334
|
+
errors: Ie,
|
|
335
|
+
onOpen: rt,
|
|
336
|
+
onCancel: at,
|
|
337
|
+
onChange: it
|
|
338
|
+
} : void 0, ht = E !== "create" && mt ? {
|
|
339
|
+
...mt,
|
|
340
|
+
onOpen: E === "edit" ? () => Q(rt) : mt.onOpen,
|
|
341
|
+
canEditExisting: Se
|
|
342
|
+
} : void 0, gt = V.isSubmitting || Je.isPending || Ye.isPending, $ = {
|
|
343
|
+
prepareVendorForSave: ct,
|
|
344
|
+
isVendorSavePending: He || gt,
|
|
345
|
+
hasUnsavedVendorChanges: Z,
|
|
346
|
+
isPendingVendor: !!et,
|
|
347
|
+
isEditingPayTo: !!E || O,
|
|
348
|
+
activePayToOperation: E ? "vendor" : O ? G?.hasPaymentInstructions ? "existingInstructions" : "missingInstructions" : void 0,
|
|
349
|
+
discardPayToEdits: X,
|
|
350
|
+
finalizePayToSave: lt,
|
|
351
|
+
openPaymentInstructions: rt,
|
|
352
|
+
paymentInstructions: ht
|
|
353
|
+
}, _t = E === "create" && x ? {
|
|
354
|
+
values: A,
|
|
355
|
+
errors: Ie,
|
|
356
|
+
onChange: it,
|
|
357
|
+
isExtracted: !!(W && _(A, W))
|
|
358
|
+
} : void 0;
|
|
359
|
+
if (E) return {
|
|
360
|
+
mode: "creating",
|
|
361
|
+
summary: G,
|
|
362
|
+
newVendorForm: /* @__PURE__ */ fe(de, {
|
|
363
|
+
mode: E,
|
|
364
|
+
values: V.values,
|
|
365
|
+
errors: V.errors,
|
|
366
|
+
onChange: dt,
|
|
367
|
+
onAddressChange: ft,
|
|
368
|
+
sectionsToExpand: V.sectionsToExpand,
|
|
369
|
+
onAddressExpand: V.expandAddress,
|
|
370
|
+
onCancel: ot,
|
|
371
|
+
onSave: ct,
|
|
372
|
+
isSaving: gt,
|
|
373
|
+
search: E === "edit" && !b ? pt : void 0,
|
|
374
|
+
paymentInstructions: _t
|
|
375
|
+
}),
|
|
376
|
+
...$
|
|
63
377
|
};
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
378
|
+
if (G) return {
|
|
379
|
+
mode: "resolved",
|
|
380
|
+
summary: G,
|
|
381
|
+
onEdit: xe && !J ? () => Q(() => nt("edit")) : void 0,
|
|
382
|
+
...$
|
|
383
|
+
};
|
|
384
|
+
if (et) {
|
|
385
|
+
let e = () => Q(() => {
|
|
386
|
+
Ve(!0), nt("create");
|
|
387
|
+
});
|
|
69
388
|
return {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
389
|
+
mode: "resolved",
|
|
390
|
+
summary: et,
|
|
391
|
+
onEdit: xe ? e : void 0,
|
|
392
|
+
error: be,
|
|
393
|
+
...$,
|
|
394
|
+
showPaymentInstructions: !0,
|
|
395
|
+
paymentInstructions: xe && x ? {
|
|
396
|
+
isOpen: !1,
|
|
397
|
+
values: A,
|
|
398
|
+
errors: Ie,
|
|
399
|
+
onOpen: e,
|
|
400
|
+
onChange: it,
|
|
401
|
+
onCancel: at,
|
|
402
|
+
canEditExisting: !0
|
|
403
|
+
} : void 0
|
|
78
404
|
};
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
405
|
+
}
|
|
406
|
+
return {
|
|
407
|
+
mode: "selecting",
|
|
408
|
+
error: z.isError ? C.searchFailed : B.isError ? C.vendorDetailsFailed : be,
|
|
409
|
+
search: pt,
|
|
410
|
+
...$
|
|
411
|
+
};
|
|
86
412
|
}
|
|
87
413
|
//#endregion
|
|
88
|
-
export {
|
|
414
|
+
export { v as useVendorSectionProps };
|
|
@@ -1,83 +1,16 @@
|
|
|
1
|
-
import { BILL_CREATE_MESSAGE_LABELS_EN as e } from "./index48.js";
|
|
2
|
-
import { isPersistableLineItem as t, parseMoneyToMinorUnits as n, parseQuantity as r } from "./index54.js";
|
|
3
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
let n = new Date(u() + c * l);
|
|
17
|
-
return t < d() || t > n;
|
|
18
|
-
}
|
|
19
|
-
function p(e) {
|
|
20
|
-
let t = new Date(e);
|
|
21
|
-
if (Number.isNaN(t.getTime())) return !1;
|
|
22
|
-
let n = new Date(u());
|
|
23
|
-
return n.setUTCFullYear(n.getUTCFullYear() + s), t < d() || t > n;
|
|
24
|
-
}
|
|
25
|
-
function m(t, n = e) {
|
|
26
|
-
let r = {};
|
|
27
|
-
return t.poNumber.length > a && (r.poNumber = n.poNumberTooLong), Object.keys(r).length ? r : void 0;
|
|
28
|
-
}
|
|
29
|
-
function h(e) {
|
|
30
|
-
let t = e.trim();
|
|
31
|
-
return !t || n(t) !== null ? !0 : i.test(t) ? Number(t.replaceAll(",", "")) === 0 : !1;
|
|
32
|
-
}
|
|
33
|
-
function g(t, i = e) {
|
|
34
|
-
let a = {};
|
|
35
|
-
for (let e of t) {
|
|
36
|
-
let t = n(e.price), o = n(e.amount), s = {};
|
|
37
|
-
e.price.trim() && t === null && (s.price = i.unreadableMoney), e.amount.trim() && o === null && (s.amount = i.unreadableMoney), r(e.quantity) === null && (e.quantity.trim() || t !== null || o !== null) && (s.quantity = i.unusableQuantity), Object.keys(s).length && (a[e.id] = s);
|
|
38
|
-
}
|
|
39
|
-
return Object.keys(a).length ? a : void 0;
|
|
40
|
-
}
|
|
41
|
-
function _(i, a, o, s = e) {
|
|
42
|
-
let c = {};
|
|
43
|
-
a || (c.vendor = s.requiredField), i.invoiceNumber.trim() || (c.invoiceNumber = s.requiredField);
|
|
44
|
-
let l = i.invoiceDate.trim(), u = i.dueDate.trim();
|
|
45
|
-
l ? f(l) && (c.invoiceDate = s.implausibleInvoiceDate) : c.invoiceDate = s.requiredField, u ? p(u) ? c.dueDate = s.implausibleDueDate : l && u < l && (c.dueDate = s.dueBeforeInvoiceDate) : c.dueDate = s.requiredField;
|
|
46
|
-
let d = {};
|
|
47
|
-
return o.forEach((e, i) => {
|
|
48
|
-
if (i > 0 && !t(e)) return;
|
|
49
|
-
let a = {};
|
|
50
|
-
e.description.trim() || (a.description = s.requiredField), r(e.quantity) === null && (a.quantity = s.requiredField), n(e.price) === null && n(e.amount) === null && (a.price = s.requiredField, a.amount = s.requiredField), Object.keys(a).length && (d[e.id] = a);
|
|
51
|
-
}), {
|
|
52
|
-
formErrors: Object.keys(c).length ? c : void 0,
|
|
53
|
-
lineItemErrors: Object.keys(d).length ? d : void 0
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
function v(e) {
|
|
57
|
-
let t = e.trim();
|
|
58
|
-
if (!t) return !0;
|
|
59
|
-
let n = t.startsWith("-") ? t.slice(1) : t;
|
|
60
|
-
return i.test(n) ? Number(t.replaceAll(",", "")) <= 0 : !1;
|
|
61
|
-
}
|
|
62
|
-
function y(e, t) {
|
|
63
|
-
if (n(e) === null) return v(e) ? t.totalNotGreaterThanZero : t.unreadableTotal;
|
|
64
|
-
}
|
|
65
|
-
function b(t, n = e) {
|
|
66
|
-
let r = y(t, n);
|
|
67
|
-
return r ? { total: r } : void 0;
|
|
68
|
-
}
|
|
69
|
-
function x(t, r = e) {
|
|
70
|
-
if (t === void 0) return;
|
|
71
|
-
let i = n(t);
|
|
72
|
-
if (i !== null) return i > 0 ? void 0 : { total: r.totalNotGreaterThanZero };
|
|
73
|
-
}
|
|
74
|
-
function S(t, n, r, i = e) {
|
|
75
|
-
let a = {};
|
|
76
|
-
if (h(t) || (a.discount = i.unreadableDiscount), h(n) || (a.tax = i.unreadableTax), r !== void 0) {
|
|
77
|
-
let e = y(r, i);
|
|
78
|
-
e && (a.total = e);
|
|
79
|
-
}
|
|
80
|
-
return Object.keys(a).length ? a : void 0;
|
|
2
|
+
function e(e) {
|
|
3
|
+
return new Promise((t, n) => {
|
|
4
|
+
let r = new FileReader();
|
|
5
|
+
r.onerror = () => n(r.error ?? /* @__PURE__ */ Error("Failed to read file")), r.onload = () => {
|
|
6
|
+
let e = r.result;
|
|
7
|
+
if (typeof e != "string") {
|
|
8
|
+
n(/* @__PURE__ */ Error("Failed to read file as a data URL"));
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
t(e.slice(e.indexOf(",") + 1));
|
|
12
|
+
}, r.readAsDataURL(e);
|
|
13
|
+
});
|
|
81
14
|
}
|
|
82
15
|
//#endregion
|
|
83
|
-
export {
|
|
16
|
+
export { e as encodeFileToBase64 };
|