@tesouro/embedded-components-react 0.5.152 → 0.5.153

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.
Files changed (62) hide show
  1. package/dist/lib/monite-sdk.d.ts +2 -44
  2. package/dist/lib/monite-sdk.js +9 -12
  3. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index.js +10 -13
  4. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index21.js +0 -7
  5. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index22.js +1 -1
  6. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index353.js +1 -2
  7. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index373.js +8 -12
  8. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index379.js +1 -5
  9. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index413.js +1 -1
  10. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index552.js +21 -13
  11. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index553.js +72 -22
  12. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index554.js +19 -1
  13. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index555.js +20 -21
  14. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index556.js +5 -51
  15. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index557.js +10 -64
  16. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index558.js +11 -167
  17. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index559.js +133 -1
  18. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index560.js +5 -184
  19. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index561.js +8 -1
  20. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index562.js +3 -41
  21. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index563.js +221 -4
  22. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index564.js +11 -21
  23. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index565.js +33 -74
  24. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index566.js +180 -15
  25. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index567.js +201 -17
  26. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index568.js +98 -4
  27. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index569.js +63 -9
  28. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index570.js +55 -11
  29. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index571.js +89 -128
  30. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index572.js +40 -5
  31. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index573.js +75 -4
  32. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index574.js +87 -5
  33. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index575.js +12 -220
  34. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index576.js +23 -11
  35. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index577.js +17 -36
  36. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index578.js +5 -184
  37. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index579.js +20 -202
  38. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index580.js +1 -102
  39. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index581.js +60 -66
  40. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index582.js +28 -53
  41. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index583.js +2 -92
  42. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index584.js +33 -40
  43. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index585.js +14 -75
  44. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index586.js +28 -82
  45. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index587.js +28 -11
  46. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index588.js +2 -26
  47. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index589.js +97 -17
  48. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  49. package/dist/libs/tesouro-embedded-components-react/shared/monite-wrapper/feature/dist/lib/MoniteWrapper.js +1 -1
  50. package/package.json +1 -1
  51. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index590.js +0 -5
  52. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index591.js +0 -24
  53. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index592.js +0 -1
  54. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index593.js +0 -64
  55. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index594.js +0 -32
  56. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index595.js +0 -4
  57. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index596.js +0 -36
  58. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index597.js +0 -18
  59. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index598.js +0 -33
  60. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index599.js +0 -31
  61. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index600.js +0 -2
  62. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index601.js +0 -97
@@ -1,77 +1,36 @@
1
- import { jsx as e, jsxs as t } from "@emotion/react/jsx-runtime";
2
- import { Box as n, Link as r, Typography as i } from "@mui/material";
3
- import { useLingui as a } from "@lingui/react";
1
+ import { BACKGROUND_FINANCE_STATUS_MUI_MAP as e, FINANCE_INVOICE_STATUS_TO_MUI_ICON_MAP as t, ROW_TO_TAG_FINANCE_STATUS_MUI_MAP as n } from "./index19.js";
2
+ import { getCommonStatusLabel as r } from "./index564.js";
3
+ import { jsx as i } from "@emotion/react/jsx-runtime";
4
+ import { Chip as a } from "@mui/material";
5
+ import { useLingui as o } from "@lingui/react";
6
+ import s from "@mui/icons-material/Circle";
7
+ import { styled as c, useThemeProps as l } from "@mui/material/styles";
4
8
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index565.js
5
- var o = [
6
- {
7
- id: 1,
8
- question: "Does enrolling in the program affect my credit score?",
9
- answer: "Nope! During the onboarding process we will only conduct a soft pull on your credit report, which will not affect your personal credit score."
10
- },
11
- {
12
- id: 2,
13
- question: "Why do I need to provide my bank connection details?",
14
- answer: "Securely connecting your business bank account allows us to review your cashflow and determine your best loan offers."
15
- },
16
- {
17
- id: 3,
18
- question: "When should I expect to receive a loan offer?",
19
- answer: "Once you are enrolled into the program, we will be actively analyzing your financials and creating pre-approved offers that work best for your business needs. We do this to help you avoid debt trap. Loan offers are usually provided within less than 48 hours."
20
- },
21
- {
22
- id: 4,
23
- question: "How do I repay the loan?",
24
- answer: "At the moment we support monthly loan repayment once you agree to the loan payment schedule. A fixed amount will be automatically deducted from the bank you linked during the onboarding.In the near future, you can also choose to pay back the loan as a fixed percentage of your daily sales until the loan is fully repaid."
25
- }
26
- ], s = () => {
27
- let { i18n: s } = a();
28
- return /* @__PURE__ */ t(n, {
29
- p: 4,
30
- children: [
31
- /* @__PURE__ */ t(n, { children: [/* @__PURE__ */ e(i, {
32
- variant: "h3",
33
- children: s._("Simplified, fast funding for your growing business")
34
- }), /* @__PURE__ */ e(i, {
35
- variant: "subtitle2",
36
- mt: 2,
37
- children: s._("Get your business moving and accelerate growth with quick and easy access to funding. Multiple options available.")
38
- })] }),
39
- /* @__PURE__ */ t(n, {
40
- mt: 5,
41
- children: [/* @__PURE__ */ e(i, {
42
- mb: 1,
43
- variant: "h3",
44
- children: s._("FAQ")
45
- }), o.map((r) => /* @__PURE__ */ t(n, {
46
- mt: 3,
47
- children: [/* @__PURE__ */ e(i, {
48
- variant: "subtitle2",
49
- children: s._("{faqQuestion}", { faqQuestion: r.question })
50
- }), /* @__PURE__ */ e(i, {
51
- variant: "body1",
52
- mt: 1,
53
- children: s._("{faqAnswer}", { faqAnswer: r.answer })
54
- })]
55
- }, r.id))]
56
- }),
57
- /* @__PURE__ */ e(n, {
58
- mt: 5,
59
- children: /* @__PURE__ */ t(i, {
60
- variant: "body2",
61
- children: [
62
- s._("All loans are subject to credit approval. Your terms may vary. Flourish Capital loans are issued by Kanmon. California Loans are made pursuant to a Department of Financial Protection and Innovation California Lenders Law License. Read more about Kanmon"),
63
- " ",
64
- /* @__PURE__ */ e(r, {
65
- target: "_blank",
66
- rel: "noopener noreferrer",
67
- href: "https://kanmon.com",
68
- children: s._("here.")
69
- })
70
- ]
71
- })
72
- })
73
- ]
9
+ var u = ({ ref: a, ...c }) => {
10
+ let { status: u, variant: f, icon: p, size: m } = l({
11
+ props: c,
12
+ name: "MoniteFinancedInvoiceStatusChip"
13
+ }), { i18n: h } = o(), g = t[u];
14
+ return /* @__PURE__ */ i(d, {
15
+ ref: a,
16
+ sx: {
17
+ width: "auto",
18
+ color: n[u],
19
+ bgcolor: e[u]
20
+ },
21
+ icon: p && g ? /* @__PURE__ */ i(g, { sx: {
22
+ fontSize: 16,
23
+ fill: n[u]
24
+ } }) : /* @__PURE__ */ i(s, { sx: { fontSize: "10px !important" } }),
25
+ label: r(h, u),
26
+ size: m,
27
+ status: u,
28
+ variant: f ?? "filled"
74
29
  });
75
- };
30
+ }, d = c(a, {
31
+ name: "MoniteFinancedInvoiceStatusChip",
32
+ slot: "root",
33
+ shouldForwardProp: () => !0
34
+ })({});
76
35
  //#endregion
77
- export { s as FinanceFaqDetails };
36
+ export { u as FinancedInvoiceStatusChip };
@@ -1,19 +1,184 @@
1
- import { Dialog as e } from "./index234.js";
2
- import "./index235.js";
3
- import { FinanceFaqDetails as t } from "./index565.js";
4
- import { useState as n } from "react";
5
- import { Fragment as r, jsx as i, jsxs as a } from "@emotion/react/jsx-runtime";
1
+ import { useMoniteContext as e } from "./index46.js";
2
+ import { useCurrencies as t } from "./index62.js";
3
+ import "./index222.js";
4
+ import { InvoiceStatusChip as n } from "./index242.js";
5
+ import { useKanmonContext as r } from "./index558.js";
6
+ import { FinancedInvoiceStatusChip as i } from "./index565.js";
7
+ import { Fragment as a, jsx as o, jsxs as s } from "@emotion/react/jsx-runtime";
8
+ import { Box as c, Button as l, Divider as u, Typography as d, darken as f, useTheme as p } from "@mui/material";
9
+ import { useLingui as m } from "@lingui/react";
6
10
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index566.js
7
- var o = ({ children: o }) => {
8
- let [s, c] = n(!1);
9
- return /* @__PURE__ */ a(r, { children: [o({ openModal: () => {
10
- c(!0);
11
- } }), /* @__PURE__ */ i(e, {
12
- open: s,
13
- onClose: () => c(!1),
14
- alignDialog: "right",
15
- children: /* @__PURE__ */ i(t, {})
11
+ var h = ({ invoice: h, offers: g, financedInvoice: _, enableNavigate: v = !1, handleNavigate: y }) => {
12
+ let { i18n: b } = m(), { locale: x } = e(), { startFinanceSession: S } = r(), { formatCurrencyToDisplay: C } = t(), w = p(), T = x.dateFormat, E = _ ? b.date(_.issue_date, T) : "—", D = _ ? C(_.total_amount, _.currency) : "-", O = g?.[0]?.pricing_plans?.reduce((e, t, n) => (t?.fee_percentage === _?.fee_percentage && t?.advance_rate_percentage === _?.advance_rate_percentage && (e = {
13
+ pricingPlanIndex: n,
14
+ data: t
15
+ }), e), null), k = _?.repayment_schedule?.repayment_date ? b.date(_.repayment_schedule.repayment_date, T) : "—", A = _?.advance_amount ? C(_.advance_amount, _.currency) : "-", j = _?.fee_amount ? C(_.fee_amount, _.currency) : "-", M = _?.repayment_amount ? C(_.repayment_amount, _.currency) : "-", N = _?.status === "REJECTED" || _?.status === "NEW", P = _?.status === "FUNDED" || _?.status === "LATE";
16
+ return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ s(c, {
17
+ sx: {
18
+ p: 4,
19
+ display: "flex",
20
+ flexDirection: "column",
21
+ gap: 4
22
+ },
23
+ children: [
24
+ /* @__PURE__ */ o(d, {
25
+ variant: "h3",
26
+ children: b._("Funding details")
27
+ }),
28
+ /* @__PURE__ */ s(c, { children: [/* @__PURE__ */ o(d, {
29
+ variant: "h2",
30
+ fontWeight: 600,
31
+ fontSize: 32,
32
+ children: D
33
+ }), /* @__PURE__ */ o(d, {
34
+ fontWeight: 500,
35
+ variant: "body1",
36
+ children: b._("{issueDate}", { issueDate: E })
37
+ })] }),
38
+ /* @__PURE__ */ s(c, {
39
+ sx: {
40
+ display: "flex",
41
+ gap: 3
42
+ },
43
+ children: [
44
+ /* @__PURE__ */ s(c, {
45
+ width: "100%",
46
+ children: [/* @__PURE__ */ o(d, {
47
+ variant: "body1",
48
+ color: f(w.palette.grey[50], .4),
49
+ mb: .5,
50
+ fontWeight: 400,
51
+ children: b._("Financing plan {value}", { value: (O?.pricingPlanIndex ?? 0) + 1 })
52
+ }), /* @__PURE__ */ o(d, {
53
+ variant: "body1",
54
+ fontWeight: 400,
55
+ children: b._("{value}% advance rate, Pay in {pricingPlan} days, {value1}% fee", {
56
+ value: (O?.data?.advance_rate_percentage ?? 0) / 100,
57
+ pricingPlan: O?.data?.repayment_duration_days,
58
+ value1: (O?.data?.fee_percentage ?? 0) / 100
59
+ })
60
+ })]
61
+ }),
62
+ /* @__PURE__ */ s(c, {
63
+ width: "100%",
64
+ children: [/* @__PURE__ */ o(d, {
65
+ variant: "body1",
66
+ color: f(w.palette.grey[50], .4),
67
+ mb: .5,
68
+ fontWeight: 400,
69
+ children: b._("Repayment on")
70
+ }), /* @__PURE__ */ o(d, {
71
+ variant: "body1",
72
+ fontWeight: 400,
73
+ children: b._("{repaymentDate}", { repaymentDate: k })
74
+ })]
75
+ }),
76
+ /* @__PURE__ */ s(c, {
77
+ width: "100%",
78
+ children: [/* @__PURE__ */ o(d, {
79
+ variant: "body1",
80
+ color: f(w.palette.grey[50], .4),
81
+ mb: .5,
82
+ fontWeight: 400,
83
+ children: b._("Status")
84
+ }), /* @__PURE__ */ o(i, {
85
+ icon: !0,
86
+ status: _?.status ?? "DEFAULTED"
87
+ })]
88
+ })
89
+ ]
90
+ }),
91
+ /* @__PURE__ */ o(u, {}),
92
+ /* @__PURE__ */ s(c, {
93
+ sx: {
94
+ display: "grid",
95
+ gridTemplateColumns: "minmax(140px, auto) 1fr",
96
+ flexDirection: "column",
97
+ rowGap: 1,
98
+ columnGap: 2
99
+ },
100
+ children: [
101
+ /* @__PURE__ */ o(d, {
102
+ variant: "body1",
103
+ color: f(w.palette.grey[50], .4),
104
+ children: b._("{isRequestedSum}", { isRequestedSum: N ? "Requested sum" : "Received sum" })
105
+ }),
106
+ /* @__PURE__ */ o(d, {
107
+ variant: "body1",
108
+ children: A
109
+ }),
110
+ /* @__PURE__ */ o(d, {
111
+ variant: "body1",
112
+ color: f(w.palette.grey[50], .4),
113
+ children: b._("Service Fee")
114
+ }),
115
+ /* @__PURE__ */ o(d, {
116
+ variant: "body1",
117
+ children: j
118
+ }),
119
+ /* @__PURE__ */ o(d, {
120
+ variant: "body1",
121
+ color: f(w.palette.grey[50], .4),
122
+ children: b._("Repayment sum")
123
+ }),
124
+ /* @__PURE__ */ o(d, {
125
+ variant: "body1",
126
+ children: M
127
+ })
128
+ ]
129
+ }),
130
+ /* @__PURE__ */ o(u, {}),
131
+ /* @__PURE__ */ s(c, {
132
+ sx: {
133
+ borderRadius: "16px",
134
+ px: 3,
135
+ py: 2.5,
136
+ border: `1px solid ${w.palette.divider}`,
137
+ display: "flex",
138
+ gap: 2,
139
+ justifyContent: "space-between",
140
+ alignItems: "center",
141
+ cursor: v ? "pointer" : "default"
142
+ },
143
+ ...v && y && { onClick: () => y(h.id) },
144
+ children: [/* @__PURE__ */ s(c, { children: [/* @__PURE__ */ o(d, {
145
+ variant: "body1",
146
+ fontWeight: 500,
147
+ children: b._("Invoice {invoiceDocument_id}", { invoiceDocument_id: h.document_id || b._("Pending") })
148
+ }), /* @__PURE__ */ o(d, {
149
+ color: w.palette.text.secondary,
150
+ variant: "body2",
151
+ children: b._("For {invoiceAmount} | Issued {issueDate}", {
152
+ invoiceAmount: D,
153
+ issueDate: E
154
+ })
155
+ })] }), /* @__PURE__ */ o(c, { children: /* @__PURE__ */ o(n, { status: h.status }) })]
156
+ })
157
+ ]
158
+ }), P && /* @__PURE__ */ o(c, {
159
+ sx: {
160
+ mt: "auto",
161
+ borderTop: `1px solid ${w.palette.divider}`,
162
+ px: 4,
163
+ py: 2,
164
+ display: "flex",
165
+ alignItems: "center",
166
+ justifyContent: "flex-end"
167
+ },
168
+ children: /* @__PURE__ */ o(l, {
169
+ variant: "contained",
170
+ color: "primary",
171
+ onClick: () => S({ component: "PAY_NOW" }),
172
+ sx: {
173
+ py: 1.25,
174
+ px: 1.5,
175
+ height: 32,
176
+ fontSize: 14,
177
+ ml: "auto"
178
+ },
179
+ children: b._("Repay now")
180
+ })
16
181
  })] });
17
182
  };
18
183
  //#endregion
19
- export { o as FinanceFaqWrapper };
184
+ export { h as FinanceDetails };
@@ -1,22 +1,206 @@
1
- import { jsx as e } from "@emotion/react/jsx-runtime";
2
- import { Box as t, useTheme as n } from "@mui/material";
1
+ import { ScopedCssBaselineContainerClassName as e } from "./index30.js";
2
+ import { useMoniteContext as t } from "./index46.js";
3
+ import { useCurrencies as n } from "./index62.js";
4
+ import { useGetReceivableById as r } from "./index143.js";
5
+ import { useAutosizeGridColumns as i } from "./index215.js";
6
+ import { Dialog as a } from "./index234.js";
7
+ import "./index235.js";
8
+ import { MoniteScopedProviders as o } from "./index241.js";
9
+ import { GetNoRowsOverlay as s } from "./index250.js";
10
+ import { TablePagination as c } from "./index335.js";
11
+ import { classNames as l } from "./index337.js";
12
+ import { ReceivableCursorFields as u } from "./index444.js";
13
+ import { useKanmonContext as d } from "./index558.js";
14
+ import { useGetFinancedInvoices as f } from "./index561.js";
15
+ import "./index562.js";
16
+ import { FinancedInvoiceStatusChip as p } from "./index565.js";
17
+ import { FinanceDetails as m } from "./index566.js";
18
+ import { useMemo as h, useState as g } from "react";
19
+ import { jsx as _, jsxs as v } from "@emotion/react/jsx-runtime";
20
+ import { Box as y, Button as b, Typography as x } from "@mui/material";
21
+ import { useLingui as S } from "@lingui/react";
22
+ import { DataGrid as C } from "@mui/x-data-grid";
3
23
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index567.js
4
- var r = ({ progress: r }) => {
5
- let i = n();
6
- return /* @__PURE__ */ e(t, {
24
+ var w = (e) => /* @__PURE__ */ _(o, { children: /* @__PURE__ */ _(T, { ...e }) }), T = ({ onRowClick: o, query: w, offers: T }) => {
25
+ let { i18n: E } = S(), { locale: D, componentSettings: O } = t(), { startFinanceSession: k } = d(), [A, j] = g(!1), [M, N] = g(null), { data: P } = r(M?.invoice_id ?? "", !!M?.invoice_id), [F, I] = g(void 0), [L, R] = g(O.receivables.pageSizeOptions?.[0] ?? 10), [z, B] = g({
26
+ field: w?.sort ?? "created_at",
27
+ sort: w?.order ?? "desc"
28
+ }), { formatCurrencyToDisplay: V } = n(), { data: H, isLoading: U, isError: W, refetch: G } = f({
29
+ order: z?.sort,
30
+ limit: L,
31
+ pagination_token: F
32
+ }), K = H?.data, q = (e) => {
33
+ B(e[0]), I(void 0);
34
+ }, J = D.dateFormat, Y = h(() => [
35
+ {
36
+ field: "document_id",
37
+ headerName: E._("Number"),
38
+ sortable: !1,
39
+ width: 140,
40
+ renderCell: ({ value: e }) => e ? /* @__PURE__ */ _("span", {
41
+ className: "Monite-TextOverflowContainer",
42
+ children: e
43
+ }) : /* @__PURE__ */ _("span", {
44
+ className: "Monite-TextOverflowContainer",
45
+ children: /* @__PURE__ */ _(x, {
46
+ color: "text.secondary",
47
+ component: "span",
48
+ fontSize: "inherit",
49
+ children: E._("Pending")
50
+ })
51
+ })
52
+ },
53
+ {
54
+ field: "payer_type",
55
+ headerName: E._("Customer"),
56
+ display: "flex",
57
+ width: 250,
58
+ renderCell: (e) => /* @__PURE__ */ _(x, { children: e.row.payer_type == "BUSINESS" ? e.row.payer_business_name : `${e.row.payer_first_name} ${e.row.payer_last_name}` })
59
+ },
60
+ {
61
+ field: "status",
62
+ headerName: E._("Status"),
63
+ sortable: u.includes("status"),
64
+ width: 160,
65
+ renderCell: ({ value: e }) => /* @__PURE__ */ _(p, {
66
+ icon: !0,
67
+ status: e
68
+ })
69
+ },
70
+ {
71
+ field: "total_amount",
72
+ headerName: E._("Amount due"),
73
+ headerAlign: "right",
74
+ align: "right",
75
+ width: 120,
76
+ valueGetter: (e, t) => {
77
+ let n = t.repayment_schedule?.repayment_amount;
78
+ return n ? V(n, t.currency) : "-";
79
+ }
80
+ },
81
+ {
82
+ field: "repayment_schedule",
83
+ headerName: E._("Loan sum"),
84
+ headerAlign: "right",
85
+ align: "right",
86
+ width: 120,
87
+ valueGetter: (e, t) => {
88
+ let n = t.repayment_schedule?.repayment_principal_amount;
89
+ return n ? V(n, t.currency) : "-";
90
+ }
91
+ },
92
+ {
93
+ field: "issue_date",
94
+ headerName: E._("Financing date"),
95
+ sortable: !1,
96
+ width: 140,
97
+ valueFormatter: (e) => e ? E.date(e, J) : "—"
98
+ },
99
+ {
100
+ field: "repayment_date",
101
+ headerName: E._("Repayment date"),
102
+ sortable: !1,
103
+ width: 120,
104
+ valueGetter: (e, t) => {
105
+ let n = t.repayment_schedule?.repayment_date;
106
+ return n ? E.date(n, J) : "-";
107
+ }
108
+ },
109
+ {
110
+ field: "",
111
+ headerName: E._("Payment"),
112
+ sortable: !1,
113
+ width: 120,
114
+ renderCell: (e) => e.row.status === "FUNDED" || e.row.status === "LATE" ? /* @__PURE__ */ _(b, {
115
+ variant: "contained",
116
+ color: "primary",
117
+ onClick: (e) => {
118
+ e.stopPropagation(), k({ component: "PAY_NOW" });
119
+ },
120
+ sx: {
121
+ py: 1.25,
122
+ px: 1.5,
123
+ height: 32,
124
+ fontSize: 14
125
+ },
126
+ children: E._("Repay now")
127
+ }) : null
128
+ }
129
+ ], [
130
+ V,
131
+ E,
132
+ J,
133
+ k
134
+ ]), X = i(K, Y, !1, "FinancedInvoicesTable");
135
+ return /* @__PURE__ */ v(y, {
136
+ className: l(e, "Monite-FinancedInvoicesTable"),
7
137
  sx: {
8
- backgroundColor: i.palette.divider,
9
- width: "100%",
10
- height: "6px",
11
- borderRadius: .5
12
- },
13
- children: /* @__PURE__ */ e(t, { sx: {
14
- backgroundColor: i.palette.primary.main,
15
- width: `${r}%`,
16
- height: "6px",
17
- borderRadius: .5
18
- } })
138
+ display: "flex",
139
+ flexDirection: "column",
140
+ overflow: "hidden",
141
+ height: "inherit",
142
+ minHeight: "500px"
143
+ },
144
+ children: [
145
+ /* @__PURE__ */ _(x, {
146
+ mb: 2,
147
+ variant: "subtitle1",
148
+ children: E._("Financed invoices")
149
+ }),
150
+ /* @__PURE__ */ _(C, {
151
+ apiRef: X,
152
+ rowSelection: !1,
153
+ disableColumnFilter: !0,
154
+ loading: U,
155
+ onSortModelChange: q,
156
+ onRowClick: (e) => {
157
+ j(!0), N?.(e.row);
158
+ },
159
+ slots: {
160
+ pagination: () => /* @__PURE__ */ _(c, {
161
+ pageSizeOptions: O.receivables.pageSizeOptions,
162
+ nextPage: H?.next_pagination_token,
163
+ prevPage: H?.prev_pagination_token,
164
+ paginationModel: {
165
+ pageSize: L,
166
+ page: F
167
+ },
168
+ onPaginationModelChange: ({ page: e, pageSize: t }) => {
169
+ R(t), I(e ?? void 0);
170
+ }
171
+ }),
172
+ noRowsOverlay: () => /* @__PURE__ */ _(s, {
173
+ isLoading: U,
174
+ dataLength: K?.length || 0,
175
+ isFiltering: !1,
176
+ isSearching: !1,
177
+ isError: W,
178
+ refetch: G,
179
+ entityName: E._("Financed Invoices"),
180
+ actionOptions: [E._("Invoice")],
181
+ type: "no-data"
182
+ })
183
+ },
184
+ columns: Y,
185
+ getRowId: (e) => e.document_id,
186
+ rows: K ?? []
187
+ }),
188
+ P && M && /* @__PURE__ */ _(a, {
189
+ open: A,
190
+ onClose: () => {
191
+ j(!1), N(null);
192
+ },
193
+ alignDialog: "right",
194
+ children: /* @__PURE__ */ _(m, {
195
+ invoice: P,
196
+ offers: T ?? [],
197
+ financedInvoice: M,
198
+ enableNavigate: !0,
199
+ handleNavigate: o
200
+ })
201
+ })
202
+ ]
19
203
  });
20
204
  };
21
205
  //#endregion
22
- export { r as FinanceProgressBar };
206
+ export { w as FinancedInvoicesTable };
@@ -1,8 +1,102 @@
1
1
  import { useMoniteContext as e } from "./index46.js";
2
+ import { jsx as t, jsxs as n } from "@emotion/react/jsx-runtime";
3
+ import { Box as r, List as i, ListItem as a, Typography as o } from "@mui/material";
4
+ import { useLingui as s } from "@lingui/react";
2
5
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index568.js
3
- var t = () => {
4
- let { api: t } = e();
5
- return t.finops.getFinancingOffers.useQuery();
6
+ var c = () => {
7
+ let { i18n: c } = s(), { componentSettings: l } = e(), u = [
8
+ {
9
+ id: 1,
10
+ title: c._("Create an invoice:"),
11
+ description: c._("If you applied for accounts receivable financing, issue an invoice and deliver it to your customer via email or any other channel."),
12
+ description2: c._("Or if you applied for accounts payable financing, upload/select the uploaded invoice you've received from your vendor."),
13
+ list: {
14
+ listTitle: c._("Invoices cannot be financed if:"),
15
+ listItems: [
16
+ {
17
+ id: "listItem-1",
18
+ text: c._("- they are due within 7 days.")
19
+ },
20
+ {
21
+ id: "listItem-2",
22
+ text: c._("- they are already overdue.")
23
+ },
24
+ {
25
+ id: "listItem-3",
26
+ text: c._("- the loan sum exceeds your remaining limit.")
27
+ }
28
+ ]
29
+ }
30
+ },
31
+ {
32
+ id: 2,
33
+ title: c._("Select 'Get Paid Now':"),
34
+ description: c._("Access funding through the invoice list, within the invoice details, or the 'My Financing' tab. If approved, you will receive the invoice amount instantly, minus the fee associated with the payment offer chosen.")
35
+ },
36
+ {
37
+ id: 3,
38
+ title: c._("Pay out the financed sum:"),
39
+ description: c._("The full sum will be withdrawn from your bank account automatically on the date specified in the selected offer. You can also pay out the sum earlier via the 'Pay out' button.")
40
+ }
41
+ ], d = l?.financing?.financeSteps ?? u;
42
+ return /* @__PURE__ */ n(r, {
43
+ px: 4,
44
+ py: 5,
45
+ children: [/* @__PURE__ */ t(r, { children: /* @__PURE__ */ t(o, {
46
+ variant: "h3",
47
+ children: c._("How does invoice financing work?")
48
+ }) }), /* @__PURE__ */ t(i, {
49
+ sx: {
50
+ mt: 4,
51
+ display: "flex",
52
+ flexDirection: "column",
53
+ gap: 3,
54
+ p: 0,
55
+ pl: 2
56
+ },
57
+ component: "ul",
58
+ children: d.map((e) => /* @__PURE__ */ n(a, {
59
+ component: "li",
60
+ sx: {
61
+ p: 0,
62
+ display: "list-item",
63
+ listStyleType: "disc",
64
+ maxWidth: 472,
65
+ mx: "auto"
66
+ },
67
+ children: [
68
+ /* @__PURE__ */ n(o, {
69
+ variant: "body1",
70
+ fontWeight: 400,
71
+ mb: e.list || e.description2 ? 3 : 0,
72
+ children: [/* @__PURE__ */ n(o, {
73
+ component: "span",
74
+ variant: "body1",
75
+ fontWeight: 600,
76
+ children: [e.title, " "]
77
+ }), e.description]
78
+ }),
79
+ e.description2 && /* @__PURE__ */ t(o, {
80
+ variant: "body1",
81
+ fontWeight: 400,
82
+ mb: e.list ? 3 : 0,
83
+ children: e.description2
84
+ }),
85
+ e.list && /* @__PURE__ */ n(o, {
86
+ variant: "body1",
87
+ fontWeight: 600,
88
+ children: [e.list.listTitle, e.list.listItems.map((e) => /* @__PURE__ */ t(o, {
89
+ variant: "body1",
90
+ component: "span",
91
+ display: "block",
92
+ fontWeight: 400,
93
+ children: e.text
94
+ }, e.id))]
95
+ })
96
+ ]
97
+ }, e.id))
98
+ })]
99
+ });
6
100
  };
7
101
  //#endregion
8
- export { t as useGetFinanceOffers };
102
+ export { c as FinanceHowItWorks };