@tesouro/embedded-components-react 0.8.1 → 0.8.4
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.css +0 -61
- package/dist/index.d.ts +1 -3
- package/dist/lib/ProductsWidget.d.ts +1 -3
- package/dist/lib/ReceivablesWidget.d.ts +1 -3
- package/dist/lib/monite-sdk.d.ts +6 -59
- package/dist/lib/monite-sdk.js +9 -13
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index.js +10 -14
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index112.js +2 -12
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index113.js +19 -26
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index151.js +4 -78
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index17.js +4 -23
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index187.js +24 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index188.js +73 -35
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index189.js +19 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index190.js +19 -16
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index191.js +5 -17
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index192.js +8 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index193.js +11 -16
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index194.js +129 -20
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index195.js +5 -21
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index196.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index197.js +5 -8
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index198.js +218 -13
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index199.js +31 -17
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index200.js +14 -9
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index201.js +33 -24
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index202.js +19 -12
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index203.js +73 -8
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index204.js +180 -23
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index205.js +13 -13
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index206.js +203 -80
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index207.js +100 -14
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index208.js +61 -97
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index209.js +53 -42
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index210.js +89 -25
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index211.js +43 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index212.js +75 -102
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index213.js +82 -34
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index214.js +12 -171
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index215.js +24 -12
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index216.js +17 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index217.js +4 -69
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index218.js +20 -23
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index219.js +1 -212
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index220.js +17 -92
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index221.js +30 -20
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index222.js +4 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index223.js +21 -17
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index224.js +15 -157
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index225.js +28 -99
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index226.js +28 -43
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index227.js +2 -4
- 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/product-catalog/ui/dist/index2.js +1 -2
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index6.js +1 -1
- package/package.json +1 -3
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index228.js +0 -24
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index229.js +0 -77
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index230.js +0 -19
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index231.js +0 -22
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index232.js +0 -8
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index233.js +0 -12
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index234.js +0 -13
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index235.js +0 -133
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index236.js +0 -8
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index237.js +0 -8
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index238.js +0 -5
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index239.js +0 -222
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index240.js +0 -34
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index241.js +0 -14
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index242.js +0 -36
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index243.js +0 -22
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index244.js +0 -76
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index245.js +0 -184
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index246.js +0 -16
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index247.js +0 -206
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index248.js +0 -102
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index249.js +0 -66
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index250.js +0 -57
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index251.js +0 -94
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index252.js +0 -43
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index253.js +0 -79
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index254.js +0 -87
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index255.js +0 -14
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index256.js +0 -26
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index257.js +0 -17
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index258.js +0 -5
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index259.js +0 -24
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index260.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index261.js +0 -22
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index262.js +0 -32
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index263.js +0 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index264.js +0 -23
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index265.js +0 -18
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index266.js +0 -33
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index267.js +0 -31
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index268.js +0 -2
|
@@ -1,102 +1,66 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { Check as s, X as c } from "lucide-react";
|
|
8
|
-
import { jsx as l, jsxs as u } from "@emotion/react/jsx-runtime";
|
|
1
|
+
import { FinanceFaqWrapper as e } from "./index189.js";
|
|
2
|
+
import { useKanmonContext as t } from "./index193.js";
|
|
3
|
+
import { useFinancing as n } from "./index194.js";
|
|
4
|
+
import "./index197.js";
|
|
5
|
+
import { jsx as r, jsxs as i } from "@emotion/react/jsx-runtime";
|
|
6
|
+
import { Box as a, Button as o, Stack as s, Typography as c, lighten as l, useTheme as u } from "@mui/material";
|
|
9
7
|
import { useLingui as d } from "@lingui/react";
|
|
10
|
-
import
|
|
11
|
-
import { zodResolver as m } from "@hookform/resolvers/zod";
|
|
8
|
+
import f from "@mui/icons-material/Money";
|
|
12
9
|
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index208.js
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
children: /* @__PURE__ */ l(t, {
|
|
65
|
-
...e,
|
|
66
|
-
id: e.name,
|
|
67
|
-
disabled: j,
|
|
68
|
-
"aria-invalid": !!n || void 0,
|
|
69
|
-
className: "ttw:h-8"
|
|
70
|
-
})
|
|
71
|
-
})
|
|
72
|
-
}),
|
|
73
|
-
_ ? /* @__PURE__ */ u("div", {
|
|
74
|
-
className: "ttw:flex ttw:justify-center ttw:gap-1",
|
|
75
|
-
children: [/* @__PURE__ */ l(e, {
|
|
76
|
-
variant: "outline",
|
|
77
|
-
size: "icon",
|
|
78
|
-
className: "ttw:size-8 ttw:bg-primary-foreground ttw:text-primary ttw:hover:text-primary ttw:hover:bg-primary-foreground/80 ttw:border-0",
|
|
79
|
-
disabled: O.isPending,
|
|
80
|
-
onClick: C(k),
|
|
81
|
-
children: /* @__PURE__ */ l(s, { className: "ttw:size-4" })
|
|
82
|
-
}), /* @__PURE__ */ l(e, {
|
|
83
|
-
variant: "outline",
|
|
84
|
-
size: "icon",
|
|
85
|
-
className: "ttw:size-8 ttw:bg-primary-foreground ttw:text-primary ttw:hover:text-primary ttw:hover:bg-primary-foreground/80 ttw:border-0",
|
|
86
|
-
onClick: y,
|
|
87
|
-
children: /* @__PURE__ */ l(c, { className: "ttw:size-4" })
|
|
88
|
-
})]
|
|
89
|
-
}) : /* @__PURE__ */ l(e, {
|
|
90
|
-
variant: "outline",
|
|
91
|
-
size: "sm",
|
|
92
|
-
className: "ttw:h-8 ttw:bg-primary-foreground ttw:text-primary ttw:hover:text-primary ttw:hover:bg-primary-foreground/80 ttw:border-0",
|
|
93
|
-
onClick: C(A),
|
|
94
|
-
children: x._("Add")
|
|
95
|
-
})
|
|
96
|
-
]
|
|
10
|
+
var p = () => {
|
|
11
|
+
let { i18n: p } = d(), { startFinanceSession: m } = t(), h = u(), { isLoading: g, isEnabled: _ } = n();
|
|
12
|
+
return _ ? /* @__PURE__ */ i(s, {
|
|
13
|
+
gap: 4,
|
|
14
|
+
sx: { border: `1px solid ${h.palette.divider}` },
|
|
15
|
+
borderRadius: "16px",
|
|
16
|
+
p: 3,
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ r(a, { children: /* @__PURE__ */ r(a, {
|
|
19
|
+
sx: {
|
|
20
|
+
backgroundColor: l(h.palette.primary.main, .9),
|
|
21
|
+
borderRadius: "100%",
|
|
22
|
+
width: "40px",
|
|
23
|
+
height: "40px",
|
|
24
|
+
display: "flex",
|
|
25
|
+
justifyContent: "center",
|
|
26
|
+
alignItems: "center",
|
|
27
|
+
p: 2
|
|
28
|
+
},
|
|
29
|
+
children: /* @__PURE__ */ r(f, { sx: {
|
|
30
|
+
color: h.palette.primary.main,
|
|
31
|
+
width: 20,
|
|
32
|
+
height: 20
|
|
33
|
+
} })
|
|
34
|
+
}) }),
|
|
35
|
+
/* @__PURE__ */ i(s, {
|
|
36
|
+
gap: 1,
|
|
37
|
+
children: [/* @__PURE__ */ r(c, {
|
|
38
|
+
variant: "subtitle1",
|
|
39
|
+
children: p._("Invoice financing")
|
|
40
|
+
}), /* @__PURE__ */ r(c, {
|
|
41
|
+
variant: "body1",
|
|
42
|
+
fontWeight: 400,
|
|
43
|
+
children: p._("Apply for a monthly plan loans to manage your business more efficiently")
|
|
44
|
+
})]
|
|
45
|
+
}),
|
|
46
|
+
/* @__PURE__ */ i(s, {
|
|
47
|
+
direction: "row",
|
|
48
|
+
gap: 1,
|
|
49
|
+
alignItems: "center",
|
|
50
|
+
children: [/* @__PURE__ */ r(o, {
|
|
51
|
+
disabled: g,
|
|
52
|
+
onClick: () => m(),
|
|
53
|
+
variant: "outlined",
|
|
54
|
+
sx: { px: 2 },
|
|
55
|
+
children: p._("Apply for loans")
|
|
56
|
+
}), /* @__PURE__ */ r(e, { children: ({ openModal: e }) => /* @__PURE__ */ r(o, {
|
|
57
|
+
onClick: e,
|
|
58
|
+
variant: "text",
|
|
59
|
+
children: p._("Read more")
|
|
60
|
+
}) })]
|
|
97
61
|
})
|
|
98
|
-
|
|
99
|
-
});
|
|
62
|
+
]
|
|
63
|
+
}) : null;
|
|
100
64
|
};
|
|
101
65
|
//#endregion
|
|
102
|
-
export {
|
|
66
|
+
export { p as FinanceIntegrationCard };
|
|
@@ -1,46 +1,57 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useMoniteContext as e } from "./index36.js";
|
|
2
|
+
import { useCurrencies as t } from "./index62.js";
|
|
2
3
|
import "./index73.js";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import "./
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
4
|
+
import { Dialog as n } from "./index117.js";
|
|
5
|
+
import "./index118.js";
|
|
6
|
+
import { useGetFinancedInvoices as r } from "./index196.js";
|
|
7
|
+
import "./index197.js";
|
|
8
|
+
import { FinancedInvoiceStatusChip as i } from "./index201.js";
|
|
9
|
+
import { FinanceDetails as a } from "./index204.js";
|
|
10
|
+
import { useState as o } from "react";
|
|
11
|
+
import { Fragment as s, jsx as c, jsxs as l } from "@emotion/react/jsx-runtime";
|
|
12
|
+
import { Box as u, Skeleton as d, Typography as f, useTheme as p } from "@mui/material";
|
|
13
|
+
import { useLingui as m } from "@lingui/react";
|
|
11
14
|
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index209.js
|
|
12
|
-
var
|
|
13
|
-
let { i18n:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
15
|
+
var h = ({ invoice: h, offers: g }) => {
|
|
16
|
+
let { i18n: _ } = m(), v = p(), { locale: y } = e(), [b, x] = o(!1), { formatCurrencyToDisplay: S } = t(), { isLoading: C, data: w } = r({
|
|
17
|
+
invoice_id: h.id,
|
|
18
|
+
type: "receivable"
|
|
19
|
+
}), T = w?.data?.[0] ?? null, E = y.dateFormat, D = T ? S(T.repayment_schedule?.repayment_amount ?? 0, h.currency) : "—", O = T?.repayment_schedule?.repayment_date ? _.date(T?.repayment_schedule?.repayment_date, E) : "—", k = T?.status;
|
|
20
|
+
return C ? /* @__PURE__ */ c(d, {
|
|
21
|
+
variant: "rounded",
|
|
22
|
+
height: 80
|
|
23
|
+
}) : /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ l(u, {
|
|
24
|
+
onClick: () => x(!0),
|
|
25
|
+
sx: {
|
|
26
|
+
borderRadius: "16px",
|
|
27
|
+
px: 3,
|
|
28
|
+
py: 2.5,
|
|
29
|
+
display: "flex",
|
|
30
|
+
alignItems: "center",
|
|
31
|
+
justifyContent: "space-between",
|
|
32
|
+
border: `1px solid ${v.palette.divider}`,
|
|
33
|
+
cursor: "pointer"
|
|
34
|
+
},
|
|
35
|
+
children: [/* @__PURE__ */ l(u, { children: [/* @__PURE__ */ c(f, {
|
|
36
|
+
variant: "subtitle2",
|
|
37
|
+
children: _._("Funding for {repaymentAmount}", { repaymentAmount: D })
|
|
38
|
+
}), /* @__PURE__ */ c(f, {
|
|
39
|
+
variant: "body1",
|
|
40
|
+
children: _._("Repayment on {repaymentDate}", { repaymentDate: O })
|
|
41
|
+
})] }), /* @__PURE__ */ c(u, { children: /* @__PURE__ */ c(i, {
|
|
42
|
+
icon: !0,
|
|
43
|
+
status: k ?? "DEFAULTED"
|
|
44
|
+
}) })]
|
|
45
|
+
}), /* @__PURE__ */ c(n, {
|
|
46
|
+
open: b,
|
|
47
|
+
onClose: () => x(!1),
|
|
48
|
+
alignDialog: "right",
|
|
49
|
+
children: /* @__PURE__ */ c(a, {
|
|
50
|
+
invoice: h,
|
|
51
|
+
offers: g?.offers,
|
|
52
|
+
financedInvoice: T
|
|
53
|
+
})
|
|
54
|
+
})] });
|
|
44
55
|
};
|
|
45
56
|
//#endregion
|
|
46
|
-
export {
|
|
57
|
+
export { h as FinanceOverviewCard };
|
|
@@ -1,30 +1,94 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { FinanceBannerWrapper as e } from "./index187.js";
|
|
2
|
+
import { useKanmonContext as t } from "./index193.js";
|
|
3
|
+
import { useGetFinanceOffers as n } from "./index191.js";
|
|
4
|
+
import { useFinancing as r } from "./index194.js";
|
|
5
|
+
import { useFinanceAnInvoice as i } from "./index195.js";
|
|
6
|
+
import { useGetFinancedInvoices as a } from "./index196.js";
|
|
7
|
+
import "./index197.js";
|
|
8
|
+
import { FinanceOverviewCard as o } from "./index209.js";
|
|
9
|
+
import { useState as s } from "react";
|
|
4
10
|
import { jsx as c, jsxs as l } from "@emotion/react/jsx-runtime";
|
|
5
|
-
import {
|
|
11
|
+
import { Box as u, Button as d, Tooltip as f, Typography as p } from "@mui/material";
|
|
12
|
+
import { useLingui as m } from "@lingui/react";
|
|
6
13
|
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index210.js
|
|
7
|
-
var
|
|
8
|
-
let { i18n: m } =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
14
|
+
var h = 5184e5, g = ({ invoice: g }) => {
|
|
15
|
+
let { i18n: _ } = m(), { startFinanceSession: v } = t(), [y, b] = s(!1), x = i(), { isLoading: S, data: C } = a({
|
|
16
|
+
invoice_id: g.id,
|
|
17
|
+
type: "receivable"
|
|
18
|
+
}), { isLoading: w, isEnabled: T, isServicing: E } = r(), { isLoading: D, data: O } = n(), k = !!C?.data?.find((e) => e?.invoice_id === g.id), A = w || S || D, j = ["issued", "partially_paid"].includes(g.status), M = g.due_date ? new Date(g.due_date).getTime() - ((/* @__PURE__ */ new Date()).getTime() + h) > 0 : !1;
|
|
19
|
+
return !T || !E ? null : k ? /* @__PURE__ */ c(u, { children: /* @__PURE__ */ c(o, {
|
|
20
|
+
invoice: g,
|
|
21
|
+
offers: O ?? null
|
|
22
|
+
}) }) : j && M ? /* @__PURE__ */ c(e, { children: /* @__PURE__ */ l(u, {
|
|
23
|
+
sx: {
|
|
24
|
+
display: "flex",
|
|
25
|
+
alignItems: "center",
|
|
26
|
+
gap: 2,
|
|
27
|
+
justifyContent: "space-between"
|
|
28
|
+
},
|
|
29
|
+
children: [/* @__PURE__ */ l(u, {
|
|
30
|
+
sx: { flex: "1 1 0%" },
|
|
31
|
+
children: [/* @__PURE__ */ c(p, {
|
|
32
|
+
variant: "subtitle2",
|
|
33
|
+
children: _._("Don't wait for your client to pay")
|
|
34
|
+
}), /* @__PURE__ */ l(p, {
|
|
35
|
+
variant: "body1",
|
|
36
|
+
children: [
|
|
37
|
+
_._("This invoice can be financed"),
|
|
38
|
+
".",
|
|
39
|
+
" ",
|
|
40
|
+
/* @__PURE__ */ c(f, {
|
|
41
|
+
arrow: !0,
|
|
42
|
+
title: _._("Invoices that are due within 7 days cannot be financed. Overdue invoices cannot be financed. The loan sum must be within your remaining limit."),
|
|
43
|
+
children: /* @__PURE__ */ c(p, {
|
|
44
|
+
variant: "body1",
|
|
45
|
+
sx: { textDecoration: "underline" },
|
|
46
|
+
component: "span",
|
|
47
|
+
children: _._("Why?")
|
|
48
|
+
})
|
|
49
|
+
})
|
|
50
|
+
]
|
|
51
|
+
})]
|
|
52
|
+
}), /* @__PURE__ */ c(d, {
|
|
53
|
+
onClick: async () => {
|
|
54
|
+
try {
|
|
55
|
+
b(!0), x.mutate({ invoices: [{
|
|
56
|
+
id: g.id,
|
|
57
|
+
type: "receivable"
|
|
58
|
+
}] }, {
|
|
59
|
+
onError: () => {
|
|
60
|
+
b(!1);
|
|
61
|
+
},
|
|
62
|
+
onSuccess: ({ session_token: e }) => {
|
|
63
|
+
v({
|
|
64
|
+
sessionToken: e,
|
|
65
|
+
component: "SESSION_INVOICE_FLOW_WITH_INVOICE_FILE"
|
|
66
|
+
}), b(!1);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
} catch {
|
|
70
|
+
b(!1);
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
disabled: y || A,
|
|
74
|
+
color: "primary",
|
|
75
|
+
variant: "contained",
|
|
76
|
+
sx: {
|
|
77
|
+
px: 2.5,
|
|
78
|
+
py: 1.5
|
|
79
|
+
},
|
|
80
|
+
children: y ? _._("Loading...") : _._("Get paid now")
|
|
26
81
|
})]
|
|
27
|
-
})
|
|
82
|
+
}) }) : /* @__PURE__ */ c(e, { children: /* @__PURE__ */ l(u, {
|
|
83
|
+
sx: { flex: "1 1 0%" },
|
|
84
|
+
children: [/* @__PURE__ */ c(p, {
|
|
85
|
+
variant: "subtitle2",
|
|
86
|
+
children: _._("This invoice can't be financed")
|
|
87
|
+
}), /* @__PURE__ */ c(p, {
|
|
88
|
+
variant: "body1",
|
|
89
|
+
children: _._("It must be in the “Issued” or “Partially paid” statuses and have more than 7 days till overdue.")
|
|
90
|
+
})]
|
|
91
|
+
}) });
|
|
28
92
|
};
|
|
29
93
|
//#endregion
|
|
30
|
-
export {
|
|
94
|
+
export { g as FinanceInvoice };
|
|
@@ -1 +1,43 @@
|
|
|
1
|
-
import "./
|
|
1
|
+
import { Dialog as e } from "./index117.js";
|
|
2
|
+
import "./index118.js";
|
|
3
|
+
import { useKanmonContext as t } from "./index193.js";
|
|
4
|
+
import { FinanceHowItWorks as n } from "./index207.js";
|
|
5
|
+
import { useState as r } from "react";
|
|
6
|
+
import { jsx as i, jsxs as a } from "@emotion/react/jsx-runtime";
|
|
7
|
+
import { Button as o, Stack as s } from "@mui/material";
|
|
8
|
+
import { useLingui as c } from "@lingui/react";
|
|
9
|
+
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index211.js
|
|
10
|
+
var l = () => {
|
|
11
|
+
let { i18n: l } = c(), { startFinanceSession: u } = t(), [d, f] = r(!1);
|
|
12
|
+
return /* @__PURE__ */ a(s, {
|
|
13
|
+
direction: "row",
|
|
14
|
+
gap: 1,
|
|
15
|
+
alignItems: "center",
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ i(o, {
|
|
18
|
+
variant: "text",
|
|
19
|
+
onClick: () => f(!0),
|
|
20
|
+
children: l._("How does invoice financing work?")
|
|
21
|
+
}),
|
|
22
|
+
/* @__PURE__ */ i(o, {
|
|
23
|
+
onClick: () => u(),
|
|
24
|
+
variant: "contained",
|
|
25
|
+
color: "primary",
|
|
26
|
+
sx: {
|
|
27
|
+
px: 2.5,
|
|
28
|
+
py: 1.5,
|
|
29
|
+
height: 40
|
|
30
|
+
},
|
|
31
|
+
children: l._("Financing menu")
|
|
32
|
+
}),
|
|
33
|
+
/* @__PURE__ */ i(e, {
|
|
34
|
+
open: d,
|
|
35
|
+
onClose: () => f(!1),
|
|
36
|
+
alignDialog: "right",
|
|
37
|
+
children: /* @__PURE__ */ i(n, {})
|
|
38
|
+
})
|
|
39
|
+
]
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
export { l as FinanceMenuButtons };
|
|
@@ -1,106 +1,79 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import "./
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import "./index211.js";
|
|
11
|
-
import { useCallback as h, useState as g } from "react";
|
|
12
|
-
import { Loader2 as _, Search as v } from "lucide-react";
|
|
13
|
-
import { Fragment as y, jsx as b, jsxs as x } from "@emotion/react/jsx-runtime";
|
|
14
|
-
import { useLingui as S } from "@lingui/react";
|
|
1
|
+
import { useMoniteContext as e } from "./index36.js";
|
|
2
|
+
import { useCurrencies as t } from "./index62.js";
|
|
3
|
+
import "./index73.js";
|
|
4
|
+
import { FinanceBannerWrapper as n } from "./index187.js";
|
|
5
|
+
import { FinanceProgressBar as r } from "./index190.js";
|
|
6
|
+
import { FinanceMenuButtons as i } from "./index211.js";
|
|
7
|
+
import { Fragment as a, jsx as o, jsxs as s } from "@emotion/react/jsx-runtime";
|
|
8
|
+
import { Box as c, Typography as l, useTheme as u } from "@mui/material";
|
|
9
|
+
import { useLingui as d } from "@lingui/react";
|
|
15
10
|
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index212.js
|
|
16
|
-
var
|
|
17
|
-
let {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
/* @__PURE__ */ b(o, {
|
|
82
|
-
className: "ttw:w-[10%]",
|
|
83
|
-
children: /* @__PURE__ */ b(m, {
|
|
84
|
-
permissions: {
|
|
85
|
-
isUpdateAllowed: !0,
|
|
86
|
-
isDeleteAllowed: !0
|
|
87
|
-
},
|
|
88
|
-
onEdit: () => T(e),
|
|
89
|
-
onDelete: () => I(e)
|
|
90
|
-
})
|
|
91
|
-
})
|
|
92
|
-
]
|
|
93
|
-
}, e.id))] })]
|
|
94
|
-
})
|
|
95
|
-
] }), /* @__PURE__ */ b(p, {
|
|
96
|
-
open: O,
|
|
97
|
-
id: E?.id,
|
|
98
|
-
name: E?.name || "",
|
|
99
|
-
isLoading: z,
|
|
100
|
-
onClose: L,
|
|
101
|
-
onDelete: R
|
|
102
|
-
})]
|
|
11
|
+
var f = ({ offers: f = [] }) => {
|
|
12
|
+
let { componentSettings: p } = e(), { i18n: m } = d(), h = u(), { formatCurrencyToDisplay: g } = t(), _ = f?.[0]?.total_amount ?? 0, v = (f?.[0]?.status === "LATE" ? 0 : f?.[0]?.available_amount) ?? 0, y = v / _ * 100, b = f?.[0]?.status !== "CLOSED" && f?.[0]?.status !== "DEFAULTED";
|
|
13
|
+
return !f || f.length === 0 ? null : /* @__PURE__ */ s(c, {
|
|
14
|
+
maxWidth: "440px",
|
|
15
|
+
width: "100%",
|
|
16
|
+
children: [/* @__PURE__ */ o(l, {
|
|
17
|
+
variant: "subtitle1",
|
|
18
|
+
sx: {
|
|
19
|
+
mb: 3,
|
|
20
|
+
display: "inline-block"
|
|
21
|
+
},
|
|
22
|
+
children: m._("My financing")
|
|
23
|
+
}), /* @__PURE__ */ o(n, { children: /* @__PURE__ */ s(c, {
|
|
24
|
+
sx: {
|
|
25
|
+
display: "flex",
|
|
26
|
+
flexDirection: "column",
|
|
27
|
+
gap: 1.25
|
|
28
|
+
},
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ o(c, { children: b ? /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(l, {
|
|
31
|
+
variant: "body1",
|
|
32
|
+
children: m._("Remaining limit")
|
|
33
|
+
}), /* @__PURE__ */ s(c, {
|
|
34
|
+
display: "flex",
|
|
35
|
+
alignItems: "center",
|
|
36
|
+
gap: 1,
|
|
37
|
+
children: [/* @__PURE__ */ o(l, {
|
|
38
|
+
variant: "h2",
|
|
39
|
+
fontSize: 24,
|
|
40
|
+
lineHeight: "32px",
|
|
41
|
+
children: g(v, "USD")
|
|
42
|
+
}), /* @__PURE__ */ s(l, {
|
|
43
|
+
component: "span",
|
|
44
|
+
variant: "subtitle1",
|
|
45
|
+
fontSize: 18,
|
|
46
|
+
color: h.palette.grey[400],
|
|
47
|
+
children: ["/ ", g(_, "USD")]
|
|
48
|
+
})]
|
|
49
|
+
})] }) : /* @__PURE__ */ o(l, {
|
|
50
|
+
variant: "h2",
|
|
51
|
+
fontSize: 24,
|
|
52
|
+
children: m._("Not available")
|
|
53
|
+
}) }),
|
|
54
|
+
/* @__PURE__ */ s(c, {
|
|
55
|
+
display: "flex",
|
|
56
|
+
flexDirection: "column",
|
|
57
|
+
gap: 1.5,
|
|
58
|
+
children: [b && /* @__PURE__ */ o(r, { progress: y }), /* @__PURE__ */ o(l, {
|
|
59
|
+
variant: "body1",
|
|
60
|
+
fontSize: 14,
|
|
61
|
+
lineHeight: "22px",
|
|
62
|
+
fontWeight: 400,
|
|
63
|
+
children: (() => {
|
|
64
|
+
switch (f?.[0]?.status) {
|
|
65
|
+
case "DEFAULTED": return m._("Financing is blocked due to a violation of the agreed-upon terms. Please, contact the provider for further details.");
|
|
66
|
+
case "CLOSED": return m._("Financing is not available for your business anymore. Please, contact the provider for further details.");
|
|
67
|
+
case "LATE": return m._("Due to late payment your financing is currently on hold. Please, contact the provider for further details.");
|
|
68
|
+
default: return m._("Your amount available for financing additional invoices.");
|
|
69
|
+
}
|
|
70
|
+
})()
|
|
71
|
+
})]
|
|
72
|
+
}),
|
|
73
|
+
p?.financing?.enableFinanceWidgetButton && /* @__PURE__ */ o(i, {})
|
|
74
|
+
]
|
|
75
|
+
}) })]
|
|
103
76
|
});
|
|
104
77
|
};
|
|
105
78
|
//#endregion
|
|
106
|
-
export {
|
|
79
|
+
export { f as FinanceLimits };
|