@tesouro/embedded-components-react 0.4.26 → 0.4.28
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/experimental/RemoteCheckCapture.d.ts +741 -0
- package/dist/experimental/RemoteCheckCapture.js +3 -0
- package/dist/experimental/index.d.ts +740 -1
- package/dist/experimental/index.js +3 -0
- package/dist/index.css +3 -0
- package/dist/index.d.ts +75 -1
- package/dist/index.js +38 -38
- package/dist/lib/WidgetProvider.d.ts +22 -1
- package/dist/lib/WidgetProvider.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +3 -1
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index2.js +28 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index3.js +53 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index4.js +55 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/data-access/dist/index5.js +60 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/index.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/RemoteCheckCaptureWidget/RemoteCheckCaptureWidget.js +81 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/RemoteCheckCaptureWidget/permissions.js +15 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/RemoteCheckCaptureWidget/testIds.js +32 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/RemoteCheckCaptureWidget/useRemoteCheckCaptureWidget.js +270 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/analytics/events.js +7 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index.js +9 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index10.js +70 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index2.js +20 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index3.js +31 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index4.js +244 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index5.js +11 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index6.js +156 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index7.js +22 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index8.js +159 -0
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index9.js +11 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +25 -25
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +190 -183
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +156 -144
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/transportInterceptors.js +16 -3
- 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/formatMoneyExact.js +6 -6
- package/package.json +1 -1
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { Button as e, Input as t, Label as n, Select as r, SelectContent as i, SelectItem as a, SelectTrigger as o, SelectValue as s, cn as c } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { DEFAULT_CHECK_AMOUNT_AND_DETAIL_SCREEN_LABELS as l } from "./index3.js";
|
|
7
|
+
import { countKeptCharsBefore as u, cursorAfterKeptChars as ee, formatGroupedAmountInput as d } from "./index2.js";
|
|
8
|
+
import { useId as f, useLayoutEffect as p, useRef as m } from "react";
|
|
9
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
10
|
+
import { ChevronLeft as _, X as v } from "lucide-react";
|
|
11
|
+
//#region ../../libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index4.js
|
|
12
|
+
var y = "__none__", b = "__none__", x = "ttw:h-14 ttw:w-full ttw:data-[size=default]:h-14";
|
|
13
|
+
function S(e) {
|
|
14
|
+
return String(e);
|
|
15
|
+
}
|
|
16
|
+
function C({ labels: C, testIds: w, customerOptions: T, selectedCustomerIndex: E, onCustomerSelect: D, onCustomerClear: O, customerLoadError: k = !1, invoiceOptions: A, selectedInvoiceIndex: j, onInvoiceSelect: M, onInvoiceClear: N, invoiceSelectDisabled: P = !1, invoiceLoadError: te = !1, accountOptions: ne, selectedAccountIndex: F, onAccountSelect: I, accountSelectDisabled: L = !1, accountLoadError: R = !1, amount: z, onAmountChange: B, amountSourceHint: V, limitsHint: H, onBack: U, onContinue: W, continueDisabled: G = !1 }) {
|
|
17
|
+
let K = {
|
|
18
|
+
...l,
|
|
19
|
+
...C
|
|
20
|
+
}, q = f(), J = `${q}-customer`, Y = `${q}-invoice`, X = `${q}-account`, Z = `${q}-amount`, re = (e) => {
|
|
21
|
+
e.preventDefault(), !G && W();
|
|
22
|
+
}, Q = m(null), $ = m(null);
|
|
23
|
+
return p(() => {
|
|
24
|
+
$.current === null || !Q.current || (Q.current.setSelectionRange($.current, $.current), $.current = null);
|
|
25
|
+
}, [z]), /* @__PURE__ */ g("section", {
|
|
26
|
+
className: "ttw:flex ttw:h-full ttw:w-full ttw:flex-col ttw:bg-background ttw:p-6",
|
|
27
|
+
children: [/* @__PURE__ */ g("header", {
|
|
28
|
+
className: "ttw:flex ttw:shrink-0 ttw:items-center ttw:gap-2",
|
|
29
|
+
children: [/* @__PURE__ */ h(e, {
|
|
30
|
+
type: "button",
|
|
31
|
+
variant: "ghost",
|
|
32
|
+
size: "icon",
|
|
33
|
+
"aria-label": K.backButton,
|
|
34
|
+
onClick: U,
|
|
35
|
+
"data-testid": w?.backButton,
|
|
36
|
+
children: /* @__PURE__ */ h(_, { className: "ttw:size-5" })
|
|
37
|
+
}), /* @__PURE__ */ h("h2", {
|
|
38
|
+
className: "ttw:text-xl ttw:font-semibold ttw:text-foreground",
|
|
39
|
+
children: K.title
|
|
40
|
+
})]
|
|
41
|
+
}), /* @__PURE__ */ g("form", {
|
|
42
|
+
onSubmit: re,
|
|
43
|
+
className: "ttw:flex ttw:min-h-0 ttw:flex-1 ttw:flex-col",
|
|
44
|
+
children: [/* @__PURE__ */ g("div", {
|
|
45
|
+
className: "ttw:flex ttw:flex-1 ttw:flex-col ttw:gap-6 ttw:pt-6",
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ g("div", {
|
|
48
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ h(n, {
|
|
51
|
+
htmlFor: J,
|
|
52
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
53
|
+
children: K.customerLabel
|
|
54
|
+
}),
|
|
55
|
+
/* @__PURE__ */ g("div", {
|
|
56
|
+
className: "ttw:relative ttw:w-full",
|
|
57
|
+
children: [/* @__PURE__ */ g(r, {
|
|
58
|
+
value: E === null ? "" : S(E),
|
|
59
|
+
onValueChange: (e) => {
|
|
60
|
+
if (e === y) {
|
|
61
|
+
O();
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
D(Number(e));
|
|
65
|
+
},
|
|
66
|
+
children: [/* @__PURE__ */ h(o, {
|
|
67
|
+
id: J,
|
|
68
|
+
className: c(x, "ttw:text-sm!", E !== null && "ttw:pr-16"),
|
|
69
|
+
"data-testid": w?.customerSelect,
|
|
70
|
+
children: /* @__PURE__ */ h(s, { placeholder: K.customerPlaceholder })
|
|
71
|
+
}), /* @__PURE__ */ g(i, { children: [/* @__PURE__ */ h(a, {
|
|
72
|
+
value: y,
|
|
73
|
+
children: K.customerNoneOption
|
|
74
|
+
}), T.map((e, t) => /* @__PURE__ */ h(a, {
|
|
75
|
+
value: S(t),
|
|
76
|
+
children: e
|
|
77
|
+
}, S(t)))] })]
|
|
78
|
+
}), E === null ? null : /* @__PURE__ */ h(e, {
|
|
79
|
+
type: "button",
|
|
80
|
+
variant: "ghost",
|
|
81
|
+
size: "icon-sm",
|
|
82
|
+
"aria-label": K.clearCustomer,
|
|
83
|
+
className: "ttw:absolute ttw:top-1/2 ttw:right-9 ttw:z-10 ttw:-translate-y-1/2",
|
|
84
|
+
onPointerDown: (e) => {
|
|
85
|
+
e.preventDefault(), e.stopPropagation();
|
|
86
|
+
},
|
|
87
|
+
onClick: (e) => {
|
|
88
|
+
e.preventDefault(), e.stopPropagation(), O();
|
|
89
|
+
},
|
|
90
|
+
"data-testid": w?.clearCustomerButton,
|
|
91
|
+
children: /* @__PURE__ */ h(v, {
|
|
92
|
+
className: "ttw:size-4",
|
|
93
|
+
"aria-hidden": !0
|
|
94
|
+
})
|
|
95
|
+
})]
|
|
96
|
+
}),
|
|
97
|
+
k ? /* @__PURE__ */ h("p", {
|
|
98
|
+
className: "ttw:text-sm ttw:text-destructive",
|
|
99
|
+
"data-testid": w?.customerLoadError,
|
|
100
|
+
children: K.customerLoadErrorMessage
|
|
101
|
+
}) : null
|
|
102
|
+
]
|
|
103
|
+
}),
|
|
104
|
+
/* @__PURE__ */ g("div", {
|
|
105
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ h(n, {
|
|
108
|
+
htmlFor: Y,
|
|
109
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
110
|
+
children: K.invoiceLabel
|
|
111
|
+
}),
|
|
112
|
+
/* @__PURE__ */ g("div", {
|
|
113
|
+
className: "ttw:relative ttw:w-full",
|
|
114
|
+
children: [/* @__PURE__ */ g(r, {
|
|
115
|
+
value: j === null ? "" : S(j),
|
|
116
|
+
disabled: P,
|
|
117
|
+
onValueChange: (e) => {
|
|
118
|
+
if (e === b) {
|
|
119
|
+
N();
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
M(Number(e));
|
|
123
|
+
},
|
|
124
|
+
children: [/* @__PURE__ */ h(o, {
|
|
125
|
+
id: Y,
|
|
126
|
+
className: c(x, "ttw:text-sm!", j !== null && "ttw:pr-16"),
|
|
127
|
+
"data-testid": w?.invoiceSelect,
|
|
128
|
+
children: /* @__PURE__ */ h(s, { placeholder: K.invoicePlaceholder })
|
|
129
|
+
}), /* @__PURE__ */ g(i, { children: [/* @__PURE__ */ h(a, {
|
|
130
|
+
value: b,
|
|
131
|
+
children: K.invoiceNoneOption
|
|
132
|
+
}), A.map((e, t) => /* @__PURE__ */ h(a, {
|
|
133
|
+
value: S(t),
|
|
134
|
+
children: e
|
|
135
|
+
}, S(t)))] })]
|
|
136
|
+
}), j === null ? null : /* @__PURE__ */ h(e, {
|
|
137
|
+
type: "button",
|
|
138
|
+
variant: "ghost",
|
|
139
|
+
size: "icon-sm",
|
|
140
|
+
"aria-label": K.clearInvoice,
|
|
141
|
+
className: "ttw:absolute ttw:top-1/2 ttw:right-9 ttw:z-10 ttw:-translate-y-1/2",
|
|
142
|
+
onPointerDown: (e) => {
|
|
143
|
+
e.preventDefault(), e.stopPropagation();
|
|
144
|
+
},
|
|
145
|
+
onClick: (e) => {
|
|
146
|
+
e.preventDefault(), e.stopPropagation(), N();
|
|
147
|
+
},
|
|
148
|
+
"data-testid": w?.clearInvoiceButton,
|
|
149
|
+
children: /* @__PURE__ */ h(v, {
|
|
150
|
+
className: "ttw:size-4",
|
|
151
|
+
"aria-hidden": !0
|
|
152
|
+
})
|
|
153
|
+
})]
|
|
154
|
+
}),
|
|
155
|
+
te ? /* @__PURE__ */ h("p", {
|
|
156
|
+
className: "ttw:text-sm ttw:text-destructive",
|
|
157
|
+
"data-testid": w?.invoiceLoadError,
|
|
158
|
+
children: K.invoiceLoadErrorMessage
|
|
159
|
+
}) : null
|
|
160
|
+
]
|
|
161
|
+
}),
|
|
162
|
+
/* @__PURE__ */ g("div", {
|
|
163
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
164
|
+
children: [
|
|
165
|
+
/* @__PURE__ */ h(n, {
|
|
166
|
+
htmlFor: X,
|
|
167
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
168
|
+
children: K.accountLabel
|
|
169
|
+
}),
|
|
170
|
+
/* @__PURE__ */ g(r, {
|
|
171
|
+
value: F === null ? "" : S(F),
|
|
172
|
+
disabled: L,
|
|
173
|
+
onValueChange: (e) => I(Number(e)),
|
|
174
|
+
children: [/* @__PURE__ */ h(o, {
|
|
175
|
+
id: X,
|
|
176
|
+
className: c(x, "ttw:text-sm!"),
|
|
177
|
+
"data-testid": w?.accountSelect,
|
|
178
|
+
children: /* @__PURE__ */ h(s, { placeholder: L ? K.accountDeterminedByInvoicePlaceholder : K.accountPlaceholder })
|
|
179
|
+
}), /* @__PURE__ */ h(i, { children: ne.map((e, t) => /* @__PURE__ */ h(a, {
|
|
180
|
+
value: S(t),
|
|
181
|
+
children: e
|
|
182
|
+
}, S(t))) })]
|
|
183
|
+
}),
|
|
184
|
+
R ? /* @__PURE__ */ h("p", {
|
|
185
|
+
className: "ttw:text-sm ttw:text-destructive",
|
|
186
|
+
"data-testid": w?.accountLoadError,
|
|
187
|
+
children: K.accountLoadErrorMessage
|
|
188
|
+
}) : null
|
|
189
|
+
]
|
|
190
|
+
}),
|
|
191
|
+
/* @__PURE__ */ g("div", {
|
|
192
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
193
|
+
children: [
|
|
194
|
+
/* @__PURE__ */ h(n, {
|
|
195
|
+
htmlFor: Z,
|
|
196
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
197
|
+
children: K.checkAmountLabel
|
|
198
|
+
}),
|
|
199
|
+
/* @__PURE__ */ g("div", {
|
|
200
|
+
className: "ttw:flex ttw:h-14 ttw:w-full ttw:items-center ttw:gap-3 ttw:rounded-md ttw:border ttw:border-input ttw:bg-transparent ttw:px-3 ttw:focus-within:border-ring ttw:focus-within:ring-[3px] ttw:focus-within:ring-ring/50",
|
|
201
|
+
children: [
|
|
202
|
+
/* @__PURE__ */ h("span", {
|
|
203
|
+
className: "ttw:text-lg ttw:font-bold ttw:text-muted-foreground",
|
|
204
|
+
"aria-hidden": !0,
|
|
205
|
+
children: K.currencyPrefix
|
|
206
|
+
}),
|
|
207
|
+
/* @__PURE__ */ h(t, {
|
|
208
|
+
ref: Q,
|
|
209
|
+
id: Z,
|
|
210
|
+
type: "text",
|
|
211
|
+
inputMode: "decimal",
|
|
212
|
+
value: z,
|
|
213
|
+
onChange: (e) => {
|
|
214
|
+
let t = e.target.value, n = e.target.selectionStart ?? t.length, r = u(t, n), i = d(t);
|
|
215
|
+
$.current = ee(i, r), B(i);
|
|
216
|
+
},
|
|
217
|
+
"data-testid": w?.amountInput,
|
|
218
|
+
className: "ttw:h-auto ttw:min-w-0 ttw:flex-1 ttw:border-0 ttw:bg-transparent ttw:p-0 ttw:px-0! ttw:py-0! ttw:text-lg! ttw:font-bold! ttw:shadow-none ttw:focus-visible:border-0 ttw:focus-visible:ring-0 ttw:md:text-lg!"
|
|
219
|
+
}),
|
|
220
|
+
V ? /* @__PURE__ */ h("span", {
|
|
221
|
+
className: "ttw:shrink-0 ttw:text-sm ttw:text-muted-foreground",
|
|
222
|
+
children: V
|
|
223
|
+
}) : null
|
|
224
|
+
]
|
|
225
|
+
}),
|
|
226
|
+
/* @__PURE__ */ h("p", {
|
|
227
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
228
|
+
children: H
|
|
229
|
+
})
|
|
230
|
+
]
|
|
231
|
+
})
|
|
232
|
+
]
|
|
233
|
+
}), /* @__PURE__ */ h(e, {
|
|
234
|
+
type: "submit",
|
|
235
|
+
disabled: G,
|
|
236
|
+
"data-testid": w?.continueButton,
|
|
237
|
+
className: "ttw:mt-6 ttw:h-14 ttw:w-full ttw:shrink-0 ttw:rounded-xl ttw:text-base ttw:font-semibold",
|
|
238
|
+
children: K.continueButton
|
|
239
|
+
})]
|
|
240
|
+
})]
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
//#endregion
|
|
244
|
+
export { C as CheckAmountAndDetailScreen };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index5.js
|
|
2
|
+
var e = {
|
|
3
|
+
alignFront: "ALIGN FRONT OF CHECK",
|
|
4
|
+
alignBack: "ALIGN BACK OF CHECK",
|
|
5
|
+
captureButton: "Capture check",
|
|
6
|
+
rotateDevice: "Turn your phone sideways to capture",
|
|
7
|
+
cameraError: "Camera access is required to deposit a check",
|
|
8
|
+
retryCamera: "Try again"
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { e as DEFAULT_CHECK_CAPTURE_SCREEN_LABELS };
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { Button as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { DEFAULT_CHECK_CAPTURE_SCREEN_LABELS as t } from "./index5.js";
|
|
7
|
+
import { useCallback as n, useEffect as r, useRef as i, useState as a } from "react";
|
|
8
|
+
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
9
|
+
import l from "react-webcam";
|
|
10
|
+
//#region ../../libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index6.js
|
|
11
|
+
var u = {
|
|
12
|
+
Front: "front",
|
|
13
|
+
Back: "back"
|
|
14
|
+
}, d = {
|
|
15
|
+
facingMode: { ideal: "environment" },
|
|
16
|
+
aspectRatio: 16 / 9,
|
|
17
|
+
width: { ideal: 1920 },
|
|
18
|
+
height: { ideal: 1080 }
|
|
19
|
+
}, f = "ttw:pointer-events-none ttw:absolute ttw:h-10 ttw:w-10 ttw:border-white";
|
|
20
|
+
function p() {
|
|
21
|
+
let e = screen.orientation?.type;
|
|
22
|
+
return typeof e == "string" ? e.startsWith("portrait") : typeof window.matchMedia == "function" ? window.matchMedia("(orientation: portrait)").matches : window.innerHeight > window.innerWidth;
|
|
23
|
+
}
|
|
24
|
+
function m(e) {
|
|
25
|
+
return !!(e && e.videoWidth > 0 && e.videoHeight > 0);
|
|
26
|
+
}
|
|
27
|
+
function h({ labels: h, testIds: g, side: _, onCapture: v }) {
|
|
28
|
+
let y = {
|
|
29
|
+
...t,
|
|
30
|
+
...h
|
|
31
|
+
}, b = i(null), [x, S] = a(p), [C, w] = a(null), [T, E] = a(0), [D, O] = a(!1), [k, A] = a(0);
|
|
32
|
+
r(() => {
|
|
33
|
+
let e = () => {
|
|
34
|
+
S(p());
|
|
35
|
+
};
|
|
36
|
+
e();
|
|
37
|
+
let t = screen.orientation;
|
|
38
|
+
t?.addEventListener?.("change", e);
|
|
39
|
+
let n = typeof window.matchMedia == "function" ? window.matchMedia("(orientation: portrait)") : null;
|
|
40
|
+
return n?.addEventListener("change", e), () => {
|
|
41
|
+
t?.removeEventListener?.("change", e), n?.removeEventListener("change", e);
|
|
42
|
+
};
|
|
43
|
+
}, []), r(() => {
|
|
44
|
+
let e = screen.orientation;
|
|
45
|
+
if (typeof e?.lock != "function") return;
|
|
46
|
+
let t = !1, n = !1, r = () => {
|
|
47
|
+
try {
|
|
48
|
+
e.unlock();
|
|
49
|
+
} catch {}
|
|
50
|
+
};
|
|
51
|
+
return e.lock("landscape").then(() => {
|
|
52
|
+
t = !0, n && r();
|
|
53
|
+
}, () => void 0), () => {
|
|
54
|
+
n = !0, t && r();
|
|
55
|
+
};
|
|
56
|
+
}, []), r(() => {
|
|
57
|
+
if (C || k === 0) return;
|
|
58
|
+
let e = b.current?.video;
|
|
59
|
+
if (!e) return;
|
|
60
|
+
let t = () => {
|
|
61
|
+
m(e) && O(!0);
|
|
62
|
+
};
|
|
63
|
+
return t(), e.addEventListener("loadeddata", t), e.addEventListener("canplay", t), () => {
|
|
64
|
+
e.removeEventListener("loadeddata", t), e.removeEventListener("canplay", t);
|
|
65
|
+
};
|
|
66
|
+
}, [
|
|
67
|
+
C,
|
|
68
|
+
T,
|
|
69
|
+
k
|
|
70
|
+
]);
|
|
71
|
+
let j = n(() => {
|
|
72
|
+
A((e) => e + 1);
|
|
73
|
+
}, []), M = n(() => {
|
|
74
|
+
let e = b.current?.getScreenshot();
|
|
75
|
+
e && v(e);
|
|
76
|
+
}, [v]), N = () => {
|
|
77
|
+
w(null), O(!1), A(0), E((e) => e + 1);
|
|
78
|
+
}, P = _ === u.Back ? y.alignBack : y.alignFront, F = D && !x && !C;
|
|
79
|
+
return /* @__PURE__ */ c("div", {
|
|
80
|
+
className: "ttw:relative ttw:h-full ttw:w-full ttw:overflow-hidden ttw:bg-black",
|
|
81
|
+
children: [
|
|
82
|
+
C ? /* @__PURE__ */ c("div", {
|
|
83
|
+
className: "ttw:flex ttw:h-full ttw:w-full ttw:flex-col ttw:items-center ttw:justify-center ttw:gap-4 ttw:px-8 ttw:text-center",
|
|
84
|
+
children: [/* @__PURE__ */ s("p", {
|
|
85
|
+
className: "ttw:text-base ttw:text-white",
|
|
86
|
+
children: y.cameraError
|
|
87
|
+
}), /* @__PURE__ */ s(e, {
|
|
88
|
+
type: "button",
|
|
89
|
+
variant: "secondary",
|
|
90
|
+
onClick: N,
|
|
91
|
+
"data-testid": g?.retryButton,
|
|
92
|
+
children: y.retryCamera
|
|
93
|
+
})]
|
|
94
|
+
}) : /* @__PURE__ */ s(l, {
|
|
95
|
+
ref: b,
|
|
96
|
+
audio: !1,
|
|
97
|
+
screenshotFormat: "image/jpeg",
|
|
98
|
+
screenshotQuality: .92,
|
|
99
|
+
forceScreenshotSourceSize: !0,
|
|
100
|
+
videoConstraints: d,
|
|
101
|
+
onUserMedia: j,
|
|
102
|
+
onUserMediaError: () => {
|
|
103
|
+
O(!1), w(y.cameraError);
|
|
104
|
+
},
|
|
105
|
+
className: "ttw:absolute ttw:inset-0 ttw:h-full ttw:w-full ttw:object-cover",
|
|
106
|
+
style: {
|
|
107
|
+
width: "100%",
|
|
108
|
+
height: "100%",
|
|
109
|
+
objectFit: "cover"
|
|
110
|
+
}
|
|
111
|
+
}, T),
|
|
112
|
+
x ? /* @__PURE__ */ s("div", {
|
|
113
|
+
className: "ttw:absolute ttw:inset-0 ttw:z-20 ttw:flex ttw:items-center ttw:justify-center ttw:bg-black ttw:px-8 ttw:text-center",
|
|
114
|
+
children: /* @__PURE__ */ s("p", {
|
|
115
|
+
className: "ttw:text-base ttw:font-medium ttw:text-white",
|
|
116
|
+
children: y.rotateDevice
|
|
117
|
+
})
|
|
118
|
+
}) : null,
|
|
119
|
+
F ? /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ c("div", {
|
|
120
|
+
className: "ttw:pointer-events-none ttw:absolute ttw:inset-0 ttw:z-10 ttw:flex ttw:flex-col ttw:items-center ttw:justify-center ttw:pr-24 ttw:pl-8",
|
|
121
|
+
children: [/* @__PURE__ */ s("h2", {
|
|
122
|
+
className: "ttw:mb-6 ttw:text-center ttw:text-sm ttw:font-medium ttw:tracking-[0.2em] ttw:text-white",
|
|
123
|
+
children: P
|
|
124
|
+
}), /* @__PURE__ */ c("div", {
|
|
125
|
+
className: "ttw:relative ttw:aspect-[2.4/1] ttw:w-[82%] ttw:max-w-3xl",
|
|
126
|
+
children: [
|
|
127
|
+
/* @__PURE__ */ s("span", {
|
|
128
|
+
className: `${f} ttw:top-0 ttw:left-0 ttw:border-t-2 ttw:border-l-2`,
|
|
129
|
+
"aria-hidden": !0
|
|
130
|
+
}),
|
|
131
|
+
/* @__PURE__ */ s("span", {
|
|
132
|
+
className: `${f} ttw:top-0 ttw:right-0 ttw:border-t-2 ttw:border-r-2`,
|
|
133
|
+
"aria-hidden": !0
|
|
134
|
+
}),
|
|
135
|
+
/* @__PURE__ */ s("span", {
|
|
136
|
+
className: `${f} ttw:bottom-0 ttw:left-0 ttw:border-b-2 ttw:border-l-2`,
|
|
137
|
+
"aria-hidden": !0
|
|
138
|
+
}),
|
|
139
|
+
/* @__PURE__ */ s("span", {
|
|
140
|
+
className: `${f} ttw:right-0 ttw:bottom-0 ttw:border-r-2 ttw:border-b-2`,
|
|
141
|
+
"aria-hidden": !0
|
|
142
|
+
})
|
|
143
|
+
]
|
|
144
|
+
})]
|
|
145
|
+
}), /* @__PURE__ */ s("button", {
|
|
146
|
+
type: "button",
|
|
147
|
+
"aria-label": y.captureButton,
|
|
148
|
+
onClick: M,
|
|
149
|
+
"data-testid": g?.captureButton,
|
|
150
|
+
className: "ttw:absolute ttw:top-1/2 ttw:right-6 ttw:z-10 ttw:size-16 ttw:-translate-y-1/2 ttw:rounded-full ttw:border-4 ttw:border-white ttw:bg-white/90 ttw:shadow-md ttw:outline-none ttw:focus-visible:ring-[3px] ttw:focus-visible:ring-white"
|
|
151
|
+
})] }) : null
|
|
152
|
+
]
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
//#endregion
|
|
156
|
+
export { h as CheckCaptureScreen, u as CheckCaptureSide };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index7.js
|
|
2
|
+
var e = {
|
|
3
|
+
title: "Review deposit",
|
|
4
|
+
backButton: "Back",
|
|
5
|
+
frontLabel: "Front",
|
|
6
|
+
backLabel: "Back",
|
|
7
|
+
frontImageAlt: "Front of check",
|
|
8
|
+
backImageAlt: "Back of check",
|
|
9
|
+
retake: "Retake",
|
|
10
|
+
retakeFront: "Retake front of check",
|
|
11
|
+
retakeBack: "Retake back of check",
|
|
12
|
+
amountLabel: "Amount",
|
|
13
|
+
depositToLabel: "Deposit to",
|
|
14
|
+
customerLabel: "Customer",
|
|
15
|
+
invoiceLabel: "Invoice",
|
|
16
|
+
availableLabel: "Available",
|
|
17
|
+
completeDepositButton: "Complete deposit",
|
|
18
|
+
retentionNotice: "Keep the check for 14 days after it clears, then destroy it.",
|
|
19
|
+
availabilityEstimateSuffix: "(est.)"
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { e as DEFAULT_REVIEW_DEPOSIT_SCREEN_LABELS };
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { Button as e, cn as t } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { DEFAULT_REVIEW_DEPOSIT_SCREEN_LABELS as n } from "./index7.js";
|
|
7
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
8
|
+
import { Check as a, ChevronLeft as o, Loader2 as s } from "lucide-react";
|
|
9
|
+
//#region ../../libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index8.js
|
|
10
|
+
function c({ src: t, alt: n, sideLabel: o, retakeLabel: s, retakeAriaLabel: c, imageTestId: l, retakeTestId: u, disabled: d, onRetake: f }) {
|
|
11
|
+
return /* @__PURE__ */ i("figure", {
|
|
12
|
+
className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:flex-col ttw:gap-2",
|
|
13
|
+
children: [/* @__PURE__ */ r("div", {
|
|
14
|
+
className: "ttw:flex ttw:aspect-[4/3] ttw:items-center ttw:justify-center ttw:rounded-xl ttw:bg-zinc-900 ttw:px-3",
|
|
15
|
+
children: /* @__PURE__ */ i("div", {
|
|
16
|
+
className: "ttw:relative ttw:w-full",
|
|
17
|
+
children: [/* @__PURE__ */ r("img", {
|
|
18
|
+
src: t,
|
|
19
|
+
alt: n,
|
|
20
|
+
"data-testid": l,
|
|
21
|
+
className: "ttw:block ttw:w-full ttw:rounded-sm ttw:bg-stone-200 ttw:object-contain"
|
|
22
|
+
}), /* @__PURE__ */ r(a, {
|
|
23
|
+
"aria-hidden": !0,
|
|
24
|
+
className: "ttw:absolute ttw:top-1 ttw:right-1 ttw:size-4 ttw:text-green-500"
|
|
25
|
+
})]
|
|
26
|
+
})
|
|
27
|
+
}), /* @__PURE__ */ i("figcaption", {
|
|
28
|
+
className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-2",
|
|
29
|
+
children: [/* @__PURE__ */ r("span", {
|
|
30
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
31
|
+
children: o
|
|
32
|
+
}), /* @__PURE__ */ r(e, {
|
|
33
|
+
type: "button",
|
|
34
|
+
variant: "link",
|
|
35
|
+
"aria-label": c,
|
|
36
|
+
onClick: f,
|
|
37
|
+
disabled: d,
|
|
38
|
+
"data-testid": u,
|
|
39
|
+
className: "ttw:h-auto ttw:px-0 ttw:py-0 ttw:text-sm ttw:font-medium",
|
|
40
|
+
children: s
|
|
41
|
+
})]
|
|
42
|
+
})]
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function l({ label: e, value: n, isLast: a }) {
|
|
46
|
+
return /* @__PURE__ */ i("div", {
|
|
47
|
+
className: t("ttw:flex ttw:items-center ttw:justify-between ttw:gap-4 ttw:py-3", !a && "ttw:border-b ttw:border-border"),
|
|
48
|
+
children: [/* @__PURE__ */ r("span", {
|
|
49
|
+
className: "ttw:shrink-0 ttw:text-sm ttw:text-muted-foreground",
|
|
50
|
+
children: e
|
|
51
|
+
}), /* @__PURE__ */ r("span", {
|
|
52
|
+
title: n,
|
|
53
|
+
className: "ttw:min-w-0 ttw:truncate ttw:text-sm ttw:font-semibold ttw:text-foreground",
|
|
54
|
+
children: n
|
|
55
|
+
})]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function u({ labels: a, testIds: u, frontImage: d, backImage: f, amount: p, depositTo: m, customer: h, invoice: g, availableDate: _, onBack: v, onRetakeFront: y, onRetakeBack: b, onCompleteDeposit: x, isSubmitting: S = !1 }) {
|
|
59
|
+
let C = {
|
|
60
|
+
...n,
|
|
61
|
+
...a
|
|
62
|
+
}, w = [
|
|
63
|
+
{
|
|
64
|
+
label: C.amountLabel,
|
|
65
|
+
value: p
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
label: C.depositToLabel,
|
|
69
|
+
value: m
|
|
70
|
+
},
|
|
71
|
+
...h ? [{
|
|
72
|
+
label: C.customerLabel,
|
|
73
|
+
value: h
|
|
74
|
+
}] : [],
|
|
75
|
+
...g ? [{
|
|
76
|
+
label: C.invoiceLabel,
|
|
77
|
+
value: g
|
|
78
|
+
}] : [],
|
|
79
|
+
{
|
|
80
|
+
label: C.availableLabel,
|
|
81
|
+
value: _
|
|
82
|
+
}
|
|
83
|
+
];
|
|
84
|
+
return /* @__PURE__ */ i("div", {
|
|
85
|
+
className: "ttw:flex ttw:h-full ttw:w-full ttw:flex-col ttw:overflow-auto ttw:bg-background ttw:p-6",
|
|
86
|
+
children: [/* @__PURE__ */ i("header", {
|
|
87
|
+
className: "ttw:flex ttw:shrink-0 ttw:items-center ttw:gap-2",
|
|
88
|
+
children: [/* @__PURE__ */ r(e, {
|
|
89
|
+
type: "button",
|
|
90
|
+
variant: "ghost",
|
|
91
|
+
size: "icon",
|
|
92
|
+
"aria-label": C.backButton,
|
|
93
|
+
onClick: v,
|
|
94
|
+
disabled: S,
|
|
95
|
+
"data-testid": u?.backButton,
|
|
96
|
+
children: /* @__PURE__ */ r(o, { className: "ttw:size-5" })
|
|
97
|
+
}), /* @__PURE__ */ r("h2", {
|
|
98
|
+
className: "ttw:text-xl ttw:font-semibold ttw:text-foreground",
|
|
99
|
+
children: C.title
|
|
100
|
+
})]
|
|
101
|
+
}), /* @__PURE__ */ i("div", {
|
|
102
|
+
className: "ttw:flex ttw:min-h-0 ttw:flex-1 ttw:flex-col ttw:pt-6",
|
|
103
|
+
children: [
|
|
104
|
+
/* @__PURE__ */ i("div", {
|
|
105
|
+
className: "ttw:flex ttw:flex-1 ttw:flex-col ttw:gap-6",
|
|
106
|
+
children: [/* @__PURE__ */ i("div", {
|
|
107
|
+
className: "ttw:flex ttw:gap-4",
|
|
108
|
+
children: [/* @__PURE__ */ r(c, {
|
|
109
|
+
src: d,
|
|
110
|
+
alt: C.frontImageAlt,
|
|
111
|
+
sideLabel: C.frontLabel,
|
|
112
|
+
retakeLabel: C.retake,
|
|
113
|
+
retakeAriaLabel: C.retakeFront,
|
|
114
|
+
imageTestId: u?.frontImage,
|
|
115
|
+
retakeTestId: u?.retakeFrontButton,
|
|
116
|
+
disabled: S,
|
|
117
|
+
onRetake: y
|
|
118
|
+
}), /* @__PURE__ */ r(c, {
|
|
119
|
+
src: f,
|
|
120
|
+
alt: C.backImageAlt,
|
|
121
|
+
sideLabel: C.backLabel,
|
|
122
|
+
retakeLabel: C.retake,
|
|
123
|
+
retakeAriaLabel: C.retakeBack,
|
|
124
|
+
imageTestId: u?.backImage,
|
|
125
|
+
retakeTestId: u?.retakeBackButton,
|
|
126
|
+
disabled: S,
|
|
127
|
+
onRetake: b
|
|
128
|
+
})]
|
|
129
|
+
}), /* @__PURE__ */ r("div", {
|
|
130
|
+
className: "ttw:rounded-lg ttw:border ttw:border-border ttw:bg-muted/30 ttw:px-4",
|
|
131
|
+
children: w.map((e, t) => /* @__PURE__ */ r(l, {
|
|
132
|
+
label: e.label,
|
|
133
|
+
value: e.value,
|
|
134
|
+
isLast: t === w.length - 1
|
|
135
|
+
}, e.label))
|
|
136
|
+
})]
|
|
137
|
+
}),
|
|
138
|
+
/* @__PURE__ */ i(e, {
|
|
139
|
+
type: "button",
|
|
140
|
+
onClick: x,
|
|
141
|
+
disabled: S,
|
|
142
|
+
"aria-busy": S,
|
|
143
|
+
"data-testid": u?.completeDepositButton,
|
|
144
|
+
className: "ttw:relative ttw:mt-6 ttw:flex ttw:h-14 ttw:w-full ttw:shrink-0 ttw:items-center ttw:justify-center ttw:rounded-xl ttw:text-base ttw:font-semibold",
|
|
145
|
+
children: [/* @__PURE__ */ r(s, {
|
|
146
|
+
"aria-hidden": !0,
|
|
147
|
+
className: t("ttw:absolute ttw:left-5 ttw:size-5 ttw:animate-spin", !S && "ttw:opacity-0")
|
|
148
|
+
}), C.completeDepositButton]
|
|
149
|
+
}),
|
|
150
|
+
/* @__PURE__ */ r("p", {
|
|
151
|
+
className: "ttw:mt-3 ttw:shrink-0 ttw:text-center ttw:text-sm ttw:text-muted-foreground",
|
|
152
|
+
children: C.retentionNotice
|
|
153
|
+
})
|
|
154
|
+
]
|
|
155
|
+
})]
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
//#endregion
|
|
159
|
+
export { u as ReviewDepositScreen };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index9.js
|
|
2
|
+
var e = {
|
|
3
|
+
title: "Deposit complete",
|
|
4
|
+
errorTitle: "Deposit failed",
|
|
5
|
+
errorMessage: "We couldn't complete this deposit. Please try again.",
|
|
6
|
+
depositAnotherCheckButton: "Deposit another check",
|
|
7
|
+
tryAgainButton: "Try again",
|
|
8
|
+
doneButton: "Done"
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { e as DEFAULT_DEPOSIT_COMPLETE_SCREEN_LABELS };
|
|
@@ -62,7 +62,7 @@ function f(e) {
|
|
|
62
62
|
}
|
|
63
63
|
function p(e) {
|
|
64
64
|
let t = /* @__PURE__ */ new Map();
|
|
65
|
-
for (let n of e ?? []) n.dimension_value && t.set(n.dimension_value, n.metric_value);
|
|
65
|
+
for (let n of e ?? []) n.dimension_value && t.set(n.dimension_value, Math.round(n.metric_value));
|
|
66
66
|
return t;
|
|
67
67
|
}
|
|
68
68
|
function m({ counterparts: e, addresses: t, billedAmounts: n, dueOrOwedAmounts: r, isBilledAmountLoading: i = !1, isDueOrOwedAmountLoading: a = !1 }) {
|