@incodetech/web 0.0.0-dev-20260608-c8c427ca → 0.0.0-dev-20260609-11ba3e8a
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/ae-signature/ae-signature.es.js +15 -13
- package/dist/aligndevicelottie-DY_bX_p8.js +12769 -0
- package/dist/antifraud/antifraud.es.js +22 -19
- package/dist/authentication/authentication.es.js +42 -33
- package/dist/autoFocusTitle-DM6PvgcP.js +29 -0
- package/dist/{back-horizontal-hint-DsPhKbR4.js → back-horizontal-hint-BXYix0Wj.js} +26 -26
- package/dist/back-tutorial-vb1MxlrT.js +14597 -0
- package/dist/{back-vertical-hint-BFJbYQrX.js → back-vertical-hint-DNSh6JNH.js} +27 -27
- package/dist/backdevicelottie-HypPqBz7.js +16690 -0
- package/dist/base.css +5 -0
- package/dist/blurdevicelottie-CBXtBFiJ.js +15951 -0
- package/dist/bottomSheet-BuzqNQtG.js +39 -0
- package/dist/browser-ponyfill-CLLvZCVg.js +441 -0
- package/dist/button-B-qlr4iI.js +35 -0
- package/dist/checkbox-CTPETqo5.js +96 -0
- package/dist/consent/consent.es.js +75 -64
- package/dist/countrySelector-CzyuaDIs.js +60 -0
- package/dist/cpf-ocr/cpf-ocr.es.js +2 -2
- package/dist/cpfOcr-DQVs3r8N.js +92 -0
- package/dist/cpfOcr-WNklFuxT.js +2 -0
- package/dist/cross-document-data-match/cross-document-data-match.es.js +20 -17
- package/dist/curp-validation/curp-validation.es.js +246 -211
- package/dist/customFields-B4MqqDI6.js +140 -0
- package/dist/customWatchlist-Dfqw1DQP.js +36 -0
- package/dist/dateInputComposed-BsPQHG5o.js +1 -0
- package/dist/dateInputComposed-DY97tQVK.js +69 -0
- package/dist/defineProperty-mefzVtTv.js +39 -0
- package/dist/document-capture/document-capture.es.js +2 -2
- package/dist/documentCapture-BE78MIlR.js +876 -0
- package/dist/documentCapture-BVfNZL29.js +2 -0
- package/dist/dropdownComposed-BF4L-7mJ.js +380 -0
- package/dist/dropdownComposed-mvHuRFHn.js +1 -0
- package/dist/dynamicForms-BYGGAQoc.js +352 -0
- package/dist/ekyb/ekyb.es.js +2 -2
- package/dist/ekybModule-BUPX0QhW.js +2 -0
- package/dist/ekybModule-CkTXu-4u.js +279 -0
- package/dist/ekyc/ekyc.es.js +2 -2
- package/dist/ekycModule-BWsVX39d.js +257 -0
- package/dist/ekycModule-DNDPqvUc.js +2 -0
- package/dist/electronic-signature/electronic-signature.es.js +2 -2
- package/dist/electronic-signature-BJSyzex9.js +426 -0
- package/dist/email/email.es.js +198 -78
- package/dist/emailInput-BHp4Apt4.js +39 -0
- package/dist/errorIcon-B0rmz3rw.js +26 -0
- package/dist/expiredId-C105HVKv.js +85 -0
- package/dist/extensibility-DJwVxojG.js +3070 -0
- package/dist/extensibility.es.js +26 -26
- package/dist/face-match/face-match.es.js +2 -2
- package/dist/faceMatch-BOFGxzzx.js +343 -0
- package/dist/faceMatch-CDMcFQwR.js +2 -0
- package/dist/field-comparison/field-comparison.es.js +2 -2
- package/dist/fieldComparison-BMDmQ8eA.js +88 -0
- package/dist/fieldComparison-Z1NleSxD.js +2 -0
- package/dist/{flip-animation-CuQ57qTn.js → flip-animation-BGRvygw9.js} +4221 -4221
- package/dist/flow/flow.es.js +597 -493
- package/dist/flow/styles.css +0 -8
- package/dist/{front-horizontal-hint-CKm7PnmS.js → front-horizontal-hint-CLSU0iVo.js} +70 -70
- package/dist/{front-vertical-hint-CLHC2qoH.js → front-vertical-hint-BWq-yWQ8.js} +81 -81
- package/dist/frontdevicelottie-CLqitJhG.js +17314 -0
- package/dist/geolocation/geolocation.es.js +485 -395
- package/dist/glaredevicelottie-BS04U6Fc.js +14478 -0
- package/dist/governmentValidation/governmentValidation.es.js +145 -64
- package/dist/governmentValidation/styles.css +0 -36
- package/dist/homeScreen-BsEYyiDB.js +264 -0
- package/dist/hooks-BtgmGvba.js +149 -0
- package/dist/i18n-gTHArCl9.js +2971 -0
- package/dist/icons-DKY3xDkf.js +360 -0
- package/dist/id/id.es.js +565 -413
- package/dist/id-laser-h-DX8UbVNH.js +467 -0
- package/dist/id-laser-v-DhnHdjlB.js +490 -0
- package/dist/id-tutorial-lj4iKtYT.js +13165 -0
- package/dist/id-verification/id-verification.es.js +21 -18
- package/dist/idOcr-BS77o1VC.js +123 -0
- package/dist/identity-reuse/identity-reuse.es.js +168 -130
- package/dist/incode-logo-57XFniXU.js +4 -0
- package/dist/incodeComponent-CDJxFZvS.js +63 -0
- package/dist/incodeModule-DkA_yd0X.js +13 -0
- package/dist/index.es.js +16 -14
- package/dist/inputComposed-5V2nLTqH.js +99 -0
- package/dist/inputComposed-BPOYwUBl.js +1 -0
- package/dist/loadingIcon-DN62ugKs.js +148 -0
- package/dist/lottie_light-Dp9Bz3mf.js +9031 -0
- package/dist/mandatoryConsent-DP189TUn.js +107 -0
- package/dist/modal-B5QeulDu.js +153 -0
- package/dist/modal.hooks-C7K9k_pY.js +202 -0
- package/dist/numberedStep-DVAyTPv1.js +13 -0
- package/dist/optionAccessibleLabel-Czc2YC8z.js +202 -0
- package/dist/otpInput-2IQ-JCK8.js +195 -0
- package/dist/page-BZ-0eNWq.js +71 -0
- package/dist/{passport-horizontal-hint-C_le0HVU.js → passport-horizontal-hint-DfVsf4Cc.js} +55 -55
- package/dist/{passport-tutorial-BYN4T_TE.js → passport-tutorial-zT1ZoA-D.js} +7096 -7084
- package/dist/{passport-vertical-hint-H-pyICSv.js → passport-vertical-hint-DVxbTyQp.js} +49 -49
- package/dist/pdf-BZA70WbM.js +22398 -0
- package/dist/pdfViewer-Dr63sJ51.js +114 -0
- package/dist/phone/phone.es.js +214 -87
- package/dist/phoneInputComposed-D_IabWKJ.js +12142 -0
- package/dist/processing-B_u8wUB7.js +8 -0
- package/dist/qe-signature/qe-signature.es.js +15 -13
- package/dist/radioGroupComposed-DwYW-Ld-.js +215 -0
- package/dist/redirect-to-mobile/redirect-to-mobile.es.js +2099 -859
- package/dist/registerIncodeElement-BJJGzVdq.js +11 -0
- package/dist/requiredLabelHint-DEadtiwx.js +17 -0
- package/dist/richText-C7GUm0WL.js +3153 -0
- package/dist/rolldown-runtime--E5BIlTp.js +33 -0
- package/dist/selfie/selfie.es.js +54 -42
- package/dist/selfieTutorial-CtruLyO2.js +2689 -0
- package/dist/signature/signature.es.js +765 -406
- package/dist/snackbar-Dz9crm39.js +16 -0
- package/dist/spinner-BfBIZkDQ.js +42 -0
- package/dist/spinner-DEDtE7Pz.js +1 -0
- package/dist/statusPage-CVCoieyd.js +28 -0
- package/dist/successIcon-rmzr-pxu.js +30 -0
- package/dist/tabs--UMd6eEB.js +103 -0
- package/dist/transitionSpinner-CWhGcr7c.js +26 -0
- package/dist/{tutorial-QzQ536BL.js → tutorial-Jv0noW4z.js} +832 -578
- package/dist/types/extensibility.d.ts +3 -1
- package/dist/types/index.d.ts +13 -4
- package/dist/typography-BK4AmfKX.js +45 -0
- package/dist/uiConfig-sgEkFuuA.js +25 -0
- package/dist/useModuleLoader-CuhHtmgr.js +670 -0
- package/dist/vendor-preact-BH7vOa2r.js +957 -0
- package/dist/verificationResult-CJ0JyV6A.js +64 -0
- package/dist/verifiedByIncode-8QBn-kgZ.js +103 -0
- package/dist/watchlist/watchlist.es.js +31 -26
- package/dist/watchlistForBusiness-RZcnjVDb.js +80 -0
- package/dist/workflow/styles.css +0 -8
- package/dist/workflow/workflow.es.js +251 -209
- package/package.json +4 -2
- package/dist/aligndevicelottie-D8KsO77t.js +0 -12757
- package/dist/autoFocusTitle-BpYdaSUM.js +0 -16
- package/dist/back-tutorial-DhSE2FJo.js +0 -14585
- package/dist/backdevicelottie-CJWGVMdw.js +0 -16678
- package/dist/blurdevicelottie-Dxt2deEB.js +0 -15939
- package/dist/bottomSheet-QrpyatOD.js +0 -31
- package/dist/browser-ponyfill-Crda_c5R.js +0 -299
- package/dist/button-DcCUEn2n.js +0 -24
- package/dist/checkbox-DCCzBAuF.js +0 -86
- package/dist/countrySelector-CJ8egQ4C.js +0 -58
- package/dist/cpfOcr-Db06i-Lm.js +0 -2
- package/dist/cpfOcr-FixhUeMQ.js +0 -79
- package/dist/customFields-C1G9xHNX.js +0 -125
- package/dist/customWatchlist-IKEblz7u.js +0 -31
- package/dist/dateInputComposed-Cg8BvYSK.js +0 -1
- package/dist/dateInputComposed-Ddd7HLyM.js +0 -58
- package/dist/defineProperty-xczUyn-m.js +0 -39
- package/dist/documentCapture-D9I7FjGe.js +0 -2
- package/dist/documentCapture-b61wlala.js +0 -765
- package/dist/dropdownComposed-B4U0AIak.js +0 -1
- package/dist/dropdownComposed-CS2pyn-g.js +0 -293
- package/dist/dynamicForms-tYQog0kw.js +0 -298
- package/dist/ekybModule-C33C4JES.js +0 -237
- package/dist/ekybModule-LON6G2Bz.js +0 -2
- package/dist/ekycModule-BJOgtTAh.js +0 -225
- package/dist/ekycModule-BSf_DIG7.js +0 -2
- package/dist/electronic-signature-OdgTyso4.js +0 -406
- package/dist/emailInput-CU7mLB21.js +0 -37
- package/dist/errorIcon-DpHzAoAo.js +0 -24
- package/dist/expiredId-nfVAZgTL.js +0 -70
- package/dist/extensibility-BbNy3mVG.js +0 -2602
- package/dist/faceMatch-BIila4kf.js +0 -2
- package/dist/faceMatch-DJ7Mqujx.js +0 -206
- package/dist/fieldComparison-D2RSFYl-.js +0 -84
- package/dist/fieldComparison-DbUyouFd.js +0 -2
- package/dist/frontdevicelottie-65Vyfpff.js +0 -17302
- package/dist/glaredevicelottie-BEyaqtc6.js +0 -14466
- package/dist/homeScreen-CyPddxWl.js +0 -227
- package/dist/hooks-MxHtZWTS.js +0 -112
- package/dist/i18n-Kzzvkz94.js +0 -2019
- package/dist/icons-9I5g9-_1.js +0 -292
- package/dist/id-laser-h-iCPbFixz.js +0 -467
- package/dist/id-laser-v-CNzwliP2.js +0 -483
- package/dist/id-tutorial-CF4nO4oX.js +0 -13153
- package/dist/idOcr-DlMLMDqa.js +0 -97
- package/dist/incode-logo-DX016usY.js +0 -4
- package/dist/incodeComponent-BoFhgK7G.js +0 -50
- package/dist/incodeModule-BiCoAJ5k.js +0 -13
- package/dist/inputComposed-DAEey9xm.js +0 -94
- package/dist/inputComposed-eS4B0Mkh.js +0 -1
- package/dist/loadingIcon-BN5YRQUb.js +0 -104
- package/dist/lottie_light-DLqSnziX.js +0 -4419
- package/dist/mandatoryConsent-DNz2jZ43.js +0 -98
- package/dist/modal-ZqAhwiRF.js +0 -135
- package/dist/modal.hooks-LdusROLW.js +0 -126
- package/dist/numberedStep-CdLWASwL.js +0 -11
- package/dist/optionAccessibleLabel-DcygPaME.js +0 -140
- package/dist/otpInput-C4pk4BJU.js +0 -157
- package/dist/page-DA3R7q0J.js +0 -69
- package/dist/pdf-51QeiFSx.js +0 -14967
- package/dist/pdfViewer-rKzTHket.js +0 -64
- package/dist/phoneInputComposed-CjAxk2Gj.js +0 -11230
- package/dist/processing-DPktVde2.js +0 -6
- package/dist/radioGroupComposed-DRRxVk9Z.js +0 -178
- package/dist/registerIncodeElement-BHWOwdSS.js +0 -7
- package/dist/requiredLabelHint-B6FN3v88.js +0 -13
- package/dist/richText-6pIbydcz.js +0 -1973
- package/dist/rolldown-runtime-CYMK-g2i.js +0 -20
- package/dist/selfieTutorial-Yo9AlUoT.js +0 -2677
- package/dist/snackbar-CQiiWO4p.js +0 -14
- package/dist/spinner-B4dcie2T.js +0 -1
- package/dist/spinner-CKnjVHxw.js +0 -39
- package/dist/statusPage-B8b3Jg6N.js +0 -28
- package/dist/successIcon-SlKgTSty.js +0 -28
- package/dist/tabs-D7lGst3Q.js +0 -78
- package/dist/transitionSpinner-Di3bOyOu.js +0 -17
- package/dist/typography-CxjaknHN.js +0 -28
- package/dist/uiConfig-CwpQ-IM6.js +0 -20
- package/dist/useModuleLoader-Bqs7fglI.js +0 -517
- package/dist/vendor-preact-D6SntenC.js +0 -958
- package/dist/verificationResult-DhT3hH1b.js +0 -90
- package/dist/verifiedByIncode-DpbxzO0y.js +0 -101
- package/dist/watchlistForBusiness-CRXVbH4l.js +0 -75
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { n as useTranslation } from "./i18n-gTHArCl9.js";
|
|
2
|
+
import { _ as y, d as T, l as A, v as u } from "./vendor-preact-BH7vOa2r.js";
|
|
3
|
+
import { c as useManager, i as useFormScrollable, o as useModuleTerminalCallbacks } from "./hooks-BtgmGvba.js";
|
|
4
|
+
import { t as IncodeComponent } from "./incodeComponent-CDJxFZvS.js";
|
|
5
|
+
import { t as Page } from "./page-BZ-0eNWq.js";
|
|
6
|
+
import { t as Spinner } from "./spinner-BfBIZkDQ.js";
|
|
7
|
+
import { t as Button } from "./button-B-qlr4iI.js";
|
|
8
|
+
import { t as VerificationResult } from "./verificationResult-CJ0JyV6A.js";
|
|
9
|
+
import { i as translateError, r as FormField, t as RadioGroupComposed } from "./radioGroupComposed-DwYW-Ld-.js";
|
|
10
|
+
import { t as PhoneInputComposed } from "./phoneInputComposed-D_IabWKJ.js";
|
|
11
|
+
import { t as DropdownComposed } from "./dropdownComposed-BF4L-7mJ.js";
|
|
12
|
+
import { t as DateInputComposed } from "./dateInputComposed-DY97tQVK.js";
|
|
13
|
+
import { t as registerIncodeModuleElement } from "./incodeModule-DkA_yd0X.js";
|
|
14
|
+
import { n as getRequiredHintMode, t as getFieldHint } from "./requiredLabelHint-DEadtiwx.js";
|
|
15
|
+
import { n as AddressAutocomplete, t as getAccessibleOptionLabel } from "./optionAccessibleLabel-Czc2YC8z.js";
|
|
16
|
+
import { createEkycManager } from "@incodetech/core/ekyc";
|
|
17
|
+
//#region src/modules/ekyc/ekycModule.tsx
|
|
18
|
+
var EkycContent = ({ config, onFinish }) => {
|
|
19
|
+
const { t } = useTranslation();
|
|
20
|
+
const [state, manager] = useManager(() => createEkycManager({ config }));
|
|
21
|
+
useModuleTerminalCallbacks({
|
|
22
|
+
status: state.status === "closed" ? "finished" : state.status,
|
|
23
|
+
onFinish
|
|
24
|
+
});
|
|
25
|
+
if (state.status === "finished" || state.status === "closed") return null;
|
|
26
|
+
if (state.status === "loading") return /* @__PURE__ */ u(VerificationResult, {
|
|
27
|
+
status: "submitting",
|
|
28
|
+
submittingTitle: t("common.loading")
|
|
29
|
+
});
|
|
30
|
+
if (state.status === "submitting") return /* @__PURE__ */ u(Page, {
|
|
31
|
+
className: "IncodeEkycPage",
|
|
32
|
+
children: /* @__PURE__ */ u(Spinner, {
|
|
33
|
+
fullScreen: false,
|
|
34
|
+
title: t("common.processing"),
|
|
35
|
+
className: "IncodeEkycSpinner"
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
if (state.status === "success") return /* @__PURE__ */ u(VerificationResult, { status: "success" });
|
|
39
|
+
if (state.status === "error") return /* @__PURE__ */ u(VerificationResult, {
|
|
40
|
+
status: "failure",
|
|
41
|
+
onRetry: () => manager.retry(),
|
|
42
|
+
onSkip: () => manager.skip()
|
|
43
|
+
});
|
|
44
|
+
if (state.status === "misconfigured") return /* @__PURE__ */ u(VerificationResult, {
|
|
45
|
+
status: "failure",
|
|
46
|
+
failureTitle: t("verification.noFormFields"),
|
|
47
|
+
onSkip: () => manager.close(),
|
|
48
|
+
skipLabel: t("common.close")
|
|
49
|
+
});
|
|
50
|
+
if (state.status === "form") return /* @__PURE__ */ u(EkycForm, {
|
|
51
|
+
state,
|
|
52
|
+
manager
|
|
53
|
+
});
|
|
54
|
+
return null;
|
|
55
|
+
};
|
|
56
|
+
var EkycForm = ({ state, manager }) => {
|
|
57
|
+
const { fields, values, validationErrors, isValid, addressSuggestions, prefilled, hideEmail, fieldsCountry, submitError } = state;
|
|
58
|
+
const { t } = useTranslation();
|
|
59
|
+
const formRef = A(null);
|
|
60
|
+
const postalCodeFieldRef = A(null);
|
|
61
|
+
const previousPostalCodeErrorRef = A(void 0);
|
|
62
|
+
const isScrollable = useFormScrollable(formRef, fields.length);
|
|
63
|
+
const mode = T(() => getRequiredHintMode(fields.filter((f) => !(f.name === "email" && hideEmail)).map((f) => f.readonly || prefilled[f.name] ? false : f.required)), [
|
|
64
|
+
fields,
|
|
65
|
+
hideEmail,
|
|
66
|
+
prefilled
|
|
67
|
+
]);
|
|
68
|
+
const labelHintFor = (effectiveRequired) => {
|
|
69
|
+
const hint = getFieldHint(mode, effectiveRequired);
|
|
70
|
+
return hint ? t(`forms.label.${hint}`) : void 0;
|
|
71
|
+
};
|
|
72
|
+
const postalCodeErrorKey = validationErrors?.postalCode?.key;
|
|
73
|
+
y(() => {
|
|
74
|
+
const previous = previousPostalCodeErrorRef.current;
|
|
75
|
+
previousPostalCodeErrorRef.current = postalCodeErrorKey;
|
|
76
|
+
if (!postalCodeErrorKey || previous === postalCodeErrorKey) return;
|
|
77
|
+
const rafId = requestAnimationFrame(() => {
|
|
78
|
+
const postalField = postalCodeFieldRef.current;
|
|
79
|
+
if (!postalField) return;
|
|
80
|
+
(postalField.querySelector("#postalCode-error") ?? postalField).scrollIntoView({
|
|
81
|
+
behavior: "smooth",
|
|
82
|
+
block: "nearest"
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
return () => cancelAnimationFrame(rafId);
|
|
86
|
+
}, [postalCodeErrorKey]);
|
|
87
|
+
const translateError$1 = (err) => translateError(t, err?.key, err?.params);
|
|
88
|
+
let currentSection;
|
|
89
|
+
return /* @__PURE__ */ u(Page, {
|
|
90
|
+
className: `IncodeEkycPage${isScrollable ? " IncodeEkycPageScrollable" : ""}`,
|
|
91
|
+
title: t("verification.title"),
|
|
92
|
+
children: [/* @__PURE__ */ u("div", {
|
|
93
|
+
ref: formRef,
|
|
94
|
+
className: "IncodeEkycForm",
|
|
95
|
+
children: fields.map((field) => {
|
|
96
|
+
if (field.name === "email" && hideEmail) return null;
|
|
97
|
+
let sectionHeader = null;
|
|
98
|
+
if (field.section && field.section !== currentSection) {
|
|
99
|
+
currentSection = field.section;
|
|
100
|
+
sectionHeader = /* @__PURE__ */ u("h3", {
|
|
101
|
+
className: "IncodeEkycSectionHeader",
|
|
102
|
+
children: t({
|
|
103
|
+
address: "verification.labels.addressDetailsSection",
|
|
104
|
+
driverLicense: "verification.labels.dlDetailsSection"
|
|
105
|
+
}[field.section] ?? field.section)
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
const isReadonly = field.readonly || prefilled[field.name];
|
|
109
|
+
const isFieldRequired = isReadonly ? false : field.required;
|
|
110
|
+
const labelHint = labelHintFor(isFieldRequired);
|
|
111
|
+
const fieldValue = values[field.name] ?? "";
|
|
112
|
+
const fieldError = validationErrors?.[field.name];
|
|
113
|
+
if (field.name === "street" && field.section === "address") return /* @__PURE__ */ u("div", { children: [sectionHeader, /* @__PURE__ */ u(AddressAutocomplete, {
|
|
114
|
+
label: field.label,
|
|
115
|
+
labelHint,
|
|
116
|
+
value: fieldValue,
|
|
117
|
+
error: fieldError?.key,
|
|
118
|
+
errorParams: fieldError?.params,
|
|
119
|
+
suggestions: addressSuggestions,
|
|
120
|
+
readonly: isReadonly,
|
|
121
|
+
required: isFieldRequired,
|
|
122
|
+
onChange: (value) => manager.setField("street", value),
|
|
123
|
+
onSearch: (query) => manager.searchAddress(query),
|
|
124
|
+
onSelect: (suggestion) => manager.selectAddress(suggestion),
|
|
125
|
+
onBlur: () => manager.validateField("street")
|
|
126
|
+
})] }, field.name);
|
|
127
|
+
if (field.type === "dropdown") {
|
|
128
|
+
const dropdownLabel = t(field.label);
|
|
129
|
+
return /* @__PURE__ */ u("div", { children: [sectionHeader, /* @__PURE__ */ u(DropdownComposed, {
|
|
130
|
+
id: `ekyc-${field.name}`,
|
|
131
|
+
label: dropdownLabel,
|
|
132
|
+
labelHint,
|
|
133
|
+
placeholder: field.placeholder ? t(field.placeholder) : void 0,
|
|
134
|
+
value: fieldValue,
|
|
135
|
+
options: (field.options ?? []).map((o) => {
|
|
136
|
+
const translatedOptionLabel = t(o.label);
|
|
137
|
+
return {
|
|
138
|
+
...o,
|
|
139
|
+
label: translatedOptionLabel,
|
|
140
|
+
ariaLabel: getAccessibleOptionLabel(translatedOptionLabel)
|
|
141
|
+
};
|
|
142
|
+
}),
|
|
143
|
+
error: translateError$1(fieldError),
|
|
144
|
+
disabled: isReadonly,
|
|
145
|
+
required: isFieldRequired,
|
|
146
|
+
searchable: true,
|
|
147
|
+
onChange: (value) => manager.setField(field.name, value),
|
|
148
|
+
onBlur: () => manager.validateField(field.name),
|
|
149
|
+
"data-testid": `ekyc-field-${field.name}`
|
|
150
|
+
})] }, field.name);
|
|
151
|
+
}
|
|
152
|
+
if (field.type === "date") {
|
|
153
|
+
const dateLabel = t(field.label);
|
|
154
|
+
return /* @__PURE__ */ u("div", { children: [sectionHeader, /* @__PURE__ */ u(DateInputComposed, {
|
|
155
|
+
id: `ekyc-${field.name}`,
|
|
156
|
+
label: dateLabel,
|
|
157
|
+
labelHint,
|
|
158
|
+
value: fieldValue,
|
|
159
|
+
error: translateError$1(fieldError),
|
|
160
|
+
disabled: isReadonly,
|
|
161
|
+
required: isFieldRequired,
|
|
162
|
+
onInput: (e) => {
|
|
163
|
+
const target = e.target;
|
|
164
|
+
manager.setField(field.name, target.value);
|
|
165
|
+
},
|
|
166
|
+
onBlur: () => manager.validateField(field.name),
|
|
167
|
+
"data-testid": `ekyc-field-${field.name}`
|
|
168
|
+
})] }, field.name);
|
|
169
|
+
}
|
|
170
|
+
if (field.type === "phone") {
|
|
171
|
+
const phoneLabel = t(field.label);
|
|
172
|
+
return /* @__PURE__ */ u("div", { children: [sectionHeader, /* @__PURE__ */ u(PhoneInputComposed, {
|
|
173
|
+
id: `ekyc-${field.name}`,
|
|
174
|
+
label: phoneLabel,
|
|
175
|
+
labelHint,
|
|
176
|
+
countryCode: fieldsCountry,
|
|
177
|
+
value: fieldValue,
|
|
178
|
+
placeholder: field.placeholder,
|
|
179
|
+
error: translateError$1(fieldError),
|
|
180
|
+
disabled: isReadonly,
|
|
181
|
+
disableCountrySelector: field.disableCountrySelector,
|
|
182
|
+
required: isFieldRequired,
|
|
183
|
+
onChange: (fullNumber) => manager.setField(field.name, fullNumber),
|
|
184
|
+
onBlur: () => manager.validateField(field.name),
|
|
185
|
+
"data-testid": `ekyc-field-${field.name}`
|
|
186
|
+
})] }, field.name);
|
|
187
|
+
}
|
|
188
|
+
if (field.type === "radio") return /* @__PURE__ */ u("div", { children: [sectionHeader, /* @__PURE__ */ u(RadioGroupComposed, {
|
|
189
|
+
id: `ekyc-${field.name}`,
|
|
190
|
+
class: "IncodeEkycRadioGroup",
|
|
191
|
+
label: t(field.label),
|
|
192
|
+
labelHint,
|
|
193
|
+
value: fieldValue,
|
|
194
|
+
options: (field.options ?? []).map((option) => ({
|
|
195
|
+
value: option.value,
|
|
196
|
+
label: t(option.label)
|
|
197
|
+
})),
|
|
198
|
+
error: translateError$1(fieldError),
|
|
199
|
+
disabled: isReadonly,
|
|
200
|
+
required: isFieldRequired,
|
|
201
|
+
onChange: (next) => manager.setField(field.name, next),
|
|
202
|
+
onBlur: () => manager.validateField(field.name)
|
|
203
|
+
})] }, field.name);
|
|
204
|
+
return /* @__PURE__ */ u("div", {
|
|
205
|
+
ref: field.name === "postalCode" ? postalCodeFieldRef : void 0,
|
|
206
|
+
children: [sectionHeader, /* @__PURE__ */ u(FormField, {
|
|
207
|
+
name: field.name,
|
|
208
|
+
label: field.label,
|
|
209
|
+
displayLabel: field.displayLabel,
|
|
210
|
+
value: fieldValue,
|
|
211
|
+
error: fieldError?.key,
|
|
212
|
+
errorParams: fieldError?.params,
|
|
213
|
+
type: field.type,
|
|
214
|
+
placeholder: field.placeholder,
|
|
215
|
+
placeholderParams: field.placeholderParams,
|
|
216
|
+
required: isFieldRequired,
|
|
217
|
+
labelHint,
|
|
218
|
+
readonly: isReadonly,
|
|
219
|
+
maxLength: field.maxLength,
|
|
220
|
+
onChange: (name, value) => manager.setField(name, value),
|
|
221
|
+
onBlur: (name) => manager.validateField(name)
|
|
222
|
+
})]
|
|
223
|
+
}, field.name);
|
|
224
|
+
})
|
|
225
|
+
}), /* @__PURE__ */ u("div", {
|
|
226
|
+
className: "IncodeEkycFooter",
|
|
227
|
+
children: [
|
|
228
|
+
submitError && /* @__PURE__ */ u("p", {
|
|
229
|
+
className: "IncodeEkycSubmitError",
|
|
230
|
+
role: "alert",
|
|
231
|
+
children: t(submitError)
|
|
232
|
+
}),
|
|
233
|
+
/* @__PURE__ */ u(Button, {
|
|
234
|
+
onClick: () => manager.submit(),
|
|
235
|
+
disabled: !isValid,
|
|
236
|
+
"data-testid": "ekyc-submit",
|
|
237
|
+
children: t("common.continue")
|
|
238
|
+
}),
|
|
239
|
+
submitError === "verification.errors.countryNotSupported" && /* @__PURE__ */ u(Button, {
|
|
240
|
+
variant: "link",
|
|
241
|
+
onClick: () => manager.skip(),
|
|
242
|
+
"data-testid": "ekyc-skip",
|
|
243
|
+
children: t("verification.labels.skip")
|
|
244
|
+
})
|
|
245
|
+
]
|
|
246
|
+
})]
|
|
247
|
+
});
|
|
248
|
+
};
|
|
249
|
+
var EkycModule = ({ config, onFinish }) => {
|
|
250
|
+
return /* @__PURE__ */ u(IncodeComponent, { children: config ? /* @__PURE__ */ u(EkycContent, {
|
|
251
|
+
config,
|
|
252
|
+
onFinish
|
|
253
|
+
}) : null });
|
|
254
|
+
};
|
|
255
|
+
registerIncodeModuleElement(EkycModule, "incode-ekyc");
|
|
256
|
+
//#endregion
|
|
257
|
+
export { EkycModule as t };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
export {
|
|
1
|
+
import { n as ElectronicSignature, t as AeSignature } from "../electronic-signature-BJSyzex9.js";
|
|
2
|
+
export { AeSignature, ElectronicSignature };
|
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
import { n as useTranslation, t as Trans } from "./i18n-gTHArCl9.js";
|
|
2
|
+
import { _ as y, h as q, l as A, v as u } from "./vendor-preact-BH7vOa2r.js";
|
|
3
|
+
import { c as useManager, o as useModuleTerminalCallbacks } from "./hooks-BtgmGvba.js";
|
|
4
|
+
import { t as IncodeComponent } from "./incodeComponent-CDJxFZvS.js";
|
|
5
|
+
import { t as Page } from "./page-BZ-0eNWq.js";
|
|
6
|
+
import { t as Button } from "./button-B-qlr4iI.js";
|
|
7
|
+
import { c as ChevronLeftIcon, r as LockIcon } from "./icons-DKY3xDkf.js";
|
|
8
|
+
import { t as SuccessIcon } from "./successIcon-rmzr-pxu.js";
|
|
9
|
+
import { t as VerificationResult } from "./verificationResult-CJ0JyV6A.js";
|
|
10
|
+
import { t as Checkbox } from "./checkbox-CTPETqo5.js";
|
|
11
|
+
import { t as PdfViewer } from "./pdfViewer-Dr63sJ51.js";
|
|
12
|
+
import { t as registerIncodeModuleElement } from "./incodeModule-DkA_yd0X.js";
|
|
13
|
+
import { createElectronicSignatureManager } from "@incodetech/core/electronic-signature";
|
|
14
|
+
//#region src/modules/electronic-signature/documentIllustration.tsx
|
|
15
|
+
var DocumentIllustration = () => /* @__PURE__ */ u("svg", {
|
|
16
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
17
|
+
width: "233",
|
|
18
|
+
height: "289",
|
|
19
|
+
viewBox: "0 0 233 289",
|
|
20
|
+
fill: "none",
|
|
21
|
+
"aria-hidden": "true",
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ u("g", {
|
|
24
|
+
filter: "url(#aes-doc-shadow)",
|
|
25
|
+
children: [/* @__PURE__ */ u("path", {
|
|
26
|
+
d: "M24 26C24 23.2386 26.2386 21 29 21H203.757C206.518 21 208.757 23.2386 208.757 26V256.421C208.757 259.182 206.518 261.421 203.757 261.421H29C26.2386 261.421 24 259.182 24 256.421V26Z",
|
|
27
|
+
fill: "white"
|
|
28
|
+
}), /* @__PURE__ */ u("path", {
|
|
29
|
+
d: "M24 26C24 23.2386 26.2386 21 29 21H203.757C206.518 21 208.757 23.2386 208.757 26V256.421C208.757 259.182 206.518 261.421 203.757 261.421H29C26.2386 261.421 24 259.182 24 256.421V26Z",
|
|
30
|
+
fill: "black",
|
|
31
|
+
"fill-opacity": "0.01"
|
|
32
|
+
})]
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ u("g", {
|
|
35
|
+
opacity: "0.5",
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ u("path", {
|
|
38
|
+
"fill-rule": "evenodd",
|
|
39
|
+
"clip-rule": "evenodd",
|
|
40
|
+
d: "M39.7534 55.606C39.7534 55.1047 40.1599 54.6982 40.6613 54.6982H192.611C193.113 54.6982 193.519 55.1047 193.519 55.606V58.4219C193.519 58.9233 193.113 59.3297 192.611 59.3297H40.6613C40.1599 59.3297 39.7534 58.9233 39.7534 58.4219V55.606Z",
|
|
41
|
+
fill: "#C6C8D2"
|
|
42
|
+
}),
|
|
43
|
+
/* @__PURE__ */ u("path", {
|
|
44
|
+
"fill-rule": "evenodd",
|
|
45
|
+
"clip-rule": "evenodd",
|
|
46
|
+
d: "M39.7534 226.972C39.7534 226.47 40.1599 226.064 40.6613 226.064H192.611C193.113 226.064 193.519 226.47 193.519 226.972V229.788C193.519 230.289 193.113 230.695 192.611 230.695H40.6613C40.1599 230.695 39.7534 230.289 39.7534 229.788V226.972Z",
|
|
47
|
+
fill: "#C6C8D2"
|
|
48
|
+
}),
|
|
49
|
+
/* @__PURE__ */ u("path", {
|
|
50
|
+
d: "M39.7534 80.6165C39.7534 80.1152 40.1599 79.7087 40.6613 79.7087H100.908C101.409 79.7087 101.816 80.1152 101.816 80.6165V88.9902C101.816 89.4916 101.409 89.898 100.908 89.898H40.6613C40.1599 89.898 39.7534 89.4916 39.7534 88.9902L39.7534 80.6165Z",
|
|
51
|
+
fill: "#C6C8D2"
|
|
52
|
+
}),
|
|
53
|
+
/* @__PURE__ */ u("path", {
|
|
54
|
+
d: "M39.7534 100.069C39.7534 99.5676 40.1598 99.1612 40.6612 99.1612H100.908C101.409 99.1612 101.815 99.5676 101.815 100.069V108.443C101.815 108.944 101.409 109.35 100.908 109.35H40.6612C40.1598 109.35 39.7534 108.944 39.7534 108.443L39.7534 100.069Z",
|
|
55
|
+
fill: "#C6C8D2"
|
|
56
|
+
}),
|
|
57
|
+
/* @__PURE__ */ u("path", {
|
|
58
|
+
d: "M39.7376 119.521C39.7463 119.019 40.1598 118.62 40.6611 118.629L125.905 120.117C126.406 120.125 126.805 120.539 126.796 121.04L126.65 129.413C126.642 129.914 126.228 130.313 125.727 130.304L40.4833 128.817C39.982 128.808 39.5827 128.394 39.5914 127.893L39.7376 119.521Z",
|
|
59
|
+
fill: "#C6C8D2"
|
|
60
|
+
}),
|
|
61
|
+
/* @__PURE__ */ u("path", {
|
|
62
|
+
d: "M39.7376 138.973C39.7463 138.472 40.1598 138.072 40.6611 138.081L65.7043 138.518C66.2056 138.527 66.6049 138.941 66.5962 139.442L66.4824 145.962C66.4736 146.463 66.0602 146.862 65.5589 146.854L40.5156 146.417C40.0143 146.408 39.615 145.994 39.6238 145.493L39.7376 138.973Z",
|
|
63
|
+
fill: "#C6C8D2"
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ u("path", {
|
|
66
|
+
d: "M39.7534 32.4487C39.7534 31.9473 40.1599 31.5409 40.6613 31.5409H153.707C154.208 31.5409 154.615 31.9473 154.615 32.4487V41.7487C154.615 42.25 154.208 42.6565 153.707 42.6565H40.6613C40.1599 42.6565 39.7534 42.25 39.7534 41.7487V32.4487Z",
|
|
67
|
+
fill: "#C6C8D2"
|
|
68
|
+
}),
|
|
69
|
+
/* @__PURE__ */ u("path", {
|
|
70
|
+
d: "M170.362 31.5221C170.362 31.0208 170.768 30.6143 171.27 30.6143H192.611C193.113 30.6143 193.519 31.0208 193.519 31.5221V40.8221C193.519 41.3235 193.113 41.7299 192.611 41.7299H171.27C170.768 41.7299 170.362 41.3235 170.362 40.8221V31.5221Z",
|
|
71
|
+
fill: "#C6C8D2"
|
|
72
|
+
})
|
|
73
|
+
]
|
|
74
|
+
}),
|
|
75
|
+
/* @__PURE__ */ u("defs", { children: /* @__PURE__ */ u("filter", {
|
|
76
|
+
id: "aes-doc-shadow",
|
|
77
|
+
x: "0",
|
|
78
|
+
y: "0",
|
|
79
|
+
width: "232.757",
|
|
80
|
+
height: "288.421",
|
|
81
|
+
filterUnits: "userSpaceOnUse",
|
|
82
|
+
"color-interpolation-filters": "sRGB",
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ u("feFlood", {
|
|
85
|
+
"flood-opacity": "0",
|
|
86
|
+
result: "BackgroundImageFix"
|
|
87
|
+
}),
|
|
88
|
+
/* @__PURE__ */ u("feColorMatrix", {
|
|
89
|
+
in: "SourceAlpha",
|
|
90
|
+
type: "matrix",
|
|
91
|
+
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
|
|
92
|
+
result: "hardAlpha"
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ u("feOffset", { dy: "3" }),
|
|
95
|
+
/* @__PURE__ */ u("feGaussianBlur", { stdDeviation: "12" }),
|
|
96
|
+
/* @__PURE__ */ u("feComposite", {
|
|
97
|
+
in2: "hardAlpha",
|
|
98
|
+
operator: "out"
|
|
99
|
+
}),
|
|
100
|
+
/* @__PURE__ */ u("feColorMatrix", {
|
|
101
|
+
type: "matrix",
|
|
102
|
+
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0"
|
|
103
|
+
}),
|
|
104
|
+
/* @__PURE__ */ u("feBlend", {
|
|
105
|
+
mode: "normal",
|
|
106
|
+
in2: "BackgroundImageFix",
|
|
107
|
+
result: "effect1_dropShadow"
|
|
108
|
+
}),
|
|
109
|
+
/* @__PURE__ */ u("feBlend", {
|
|
110
|
+
mode: "normal",
|
|
111
|
+
in: "SourceGraphic",
|
|
112
|
+
in2: "effect1_dropShadow",
|
|
113
|
+
result: "shape"
|
|
114
|
+
})
|
|
115
|
+
]
|
|
116
|
+
}) })
|
|
117
|
+
]
|
|
118
|
+
});
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region src/modules/electronic-signature/consentItems.tsx
|
|
121
|
+
function AeTerms1Label() {
|
|
122
|
+
return /* @__PURE__ */ u("span", { children: /* @__PURE__ */ u(Trans, {
|
|
123
|
+
i18nKey: "aes.confirmSignature.terms1.title",
|
|
124
|
+
components: { 2: /* @__PURE__ */ u("a", {
|
|
125
|
+
href: "https://psc.incode.com/repositorio/",
|
|
126
|
+
target: "_blank",
|
|
127
|
+
rel: "noopener noreferrer"
|
|
128
|
+
}) }
|
|
129
|
+
}) });
|
|
130
|
+
}
|
|
131
|
+
function getAeConsentItems(t) {
|
|
132
|
+
return [
|
|
133
|
+
{
|
|
134
|
+
id: "terms",
|
|
135
|
+
label: /* @__PURE__ */ u(AeTerms1Label, {})
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
id: "signElectronically",
|
|
139
|
+
label: t("aes.confirmSignature.terms2.title")
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
id: "signDisplayed",
|
|
143
|
+
label: t("aes.confirmSignature.terms3.title")
|
|
144
|
+
}
|
|
145
|
+
];
|
|
146
|
+
}
|
|
147
|
+
function TermsAgreementLabel() {
|
|
148
|
+
return /* @__PURE__ */ u("span", { children: /* @__PURE__ */ u(Trans, {
|
|
149
|
+
i18nKey: "qes.newTermsCheck",
|
|
150
|
+
components: {
|
|
151
|
+
2: /* @__PURE__ */ u("a", {
|
|
152
|
+
href: "https://policies.incodesmile.com/terms-of-use/",
|
|
153
|
+
target: "_blank",
|
|
154
|
+
rel: "noopener noreferrer"
|
|
155
|
+
}),
|
|
156
|
+
6: /* @__PURE__ */ u("a", {
|
|
157
|
+
href: "https://policies.incodesmile.com/privacy-policy/",
|
|
158
|
+
target: "_blank",
|
|
159
|
+
rel: "noopener noreferrer"
|
|
160
|
+
})
|
|
161
|
+
}
|
|
162
|
+
}) });
|
|
163
|
+
}
|
|
164
|
+
function getQeConsentItems(t) {
|
|
165
|
+
return [
|
|
166
|
+
{
|
|
167
|
+
id: "issuance",
|
|
168
|
+
label: t("qes.issuanceCheck")
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
id: "qesAcknowledgement",
|
|
172
|
+
label: t("qes.qesAcknowledgementCheck")
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
id: "qscdConfirmation",
|
|
176
|
+
label: t("qes.qscdConfirmationCheck")
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
id: "termsAgreement",
|
|
180
|
+
label: /* @__PURE__ */ u(TermsAgreementLabel, {})
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
id: "documentsReviewed",
|
|
184
|
+
label: t("qes.documentsReviewedCheck")
|
|
185
|
+
}
|
|
186
|
+
];
|
|
187
|
+
}
|
|
188
|
+
function getConsentItems(variant, t) {
|
|
189
|
+
return variant === "qe" ? getQeConsentItems(t) : getAeConsentItems(t);
|
|
190
|
+
}
|
|
191
|
+
function getVariantCopy(variant, t) {
|
|
192
|
+
if (variant === "qe") return {
|
|
193
|
+
signingTitle: t("qes.consent.title"),
|
|
194
|
+
signingSubtitle: t("qes.consent.text"),
|
|
195
|
+
signButtonLabel: t("forms.button.continue")
|
|
196
|
+
};
|
|
197
|
+
return {
|
|
198
|
+
signingTitle: t("aes.confirmSignature.title"),
|
|
199
|
+
signingSubtitle: t("aes.confirmSignature.subtitle"),
|
|
200
|
+
signButtonLabel: t("aes.confirmSignature.finishSigning")
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
//#endregion
|
|
204
|
+
//#region src/modules/electronic-signature/electronic-signature.tsx
|
|
205
|
+
var ElectronicSignatureContent = ({ config, onFinish, onError }) => {
|
|
206
|
+
const { t } = useTranslation();
|
|
207
|
+
const [state, manager] = useManager(() => createElectronicSignatureManager({ config }));
|
|
208
|
+
const fileInputRef = A(null);
|
|
209
|
+
y(() => {
|
|
210
|
+
manager.load();
|
|
211
|
+
}, [manager]);
|
|
212
|
+
useModuleTerminalCallbacks({
|
|
213
|
+
status: state.status,
|
|
214
|
+
onFinish,
|
|
215
|
+
onError: state.status === "closed" ? () => onError?.("closed") : onError,
|
|
216
|
+
error: state.status === "failed" ? state.errorMessage : void 0,
|
|
217
|
+
errorStatuses: ["failed"]
|
|
218
|
+
});
|
|
219
|
+
const handleFileChange = q((event) => {
|
|
220
|
+
const file = event.target.files?.[0];
|
|
221
|
+
if (!file) return;
|
|
222
|
+
const reader = new FileReader();
|
|
223
|
+
reader.onload = () => {
|
|
224
|
+
if (reader.result instanceof ArrayBuffer) {
|
|
225
|
+
const fileUrl = URL.createObjectURL(new Blob([reader.result], { type: "application/pdf" }));
|
|
226
|
+
manager.selectFile(file.name, reader.result, fileUrl);
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
reader.readAsArrayBuffer(file);
|
|
230
|
+
}, [manager]);
|
|
231
|
+
const triggerFileInput = q(() => {
|
|
232
|
+
fileInputRef.current?.click();
|
|
233
|
+
}, []);
|
|
234
|
+
if (state.status === "loading") return /* @__PURE__ */ u(VerificationResult, {
|
|
235
|
+
status: "submitting",
|
|
236
|
+
submittingTitle: t("common.processing")
|
|
237
|
+
});
|
|
238
|
+
if (state.status === "uploading") return /* @__PURE__ */ u(Page, {
|
|
239
|
+
className: "IncodeElectronicSignature",
|
|
240
|
+
title: t("aes.confirmSignature.uploadTitle"),
|
|
241
|
+
subtitle: t("aes.confirmSignature.uploadDescription"),
|
|
242
|
+
children: [/* @__PURE__ */ u("div", {
|
|
243
|
+
className: "IncodeElectronicSignatureUploadBody",
|
|
244
|
+
children: [/* @__PURE__ */ u("div", {
|
|
245
|
+
className: "IncodeElectronicSignatureIllustration",
|
|
246
|
+
children: /* @__PURE__ */ u(DocumentIllustration, {})
|
|
247
|
+
}), /* @__PURE__ */ u("input", {
|
|
248
|
+
ref: fileInputRef,
|
|
249
|
+
type: "file",
|
|
250
|
+
accept: "application/pdf",
|
|
251
|
+
className: "IncodeElectronicSignatureFileInput",
|
|
252
|
+
onChange: handleFileChange
|
|
253
|
+
})]
|
|
254
|
+
}), /* @__PURE__ */ u("div", {
|
|
255
|
+
className: "IncodeElectronicSignatureFooter",
|
|
256
|
+
children: /* @__PURE__ */ u(Button, {
|
|
257
|
+
onClick: triggerFileInput,
|
|
258
|
+
children: t("aes.confirmSignature.addDocument")
|
|
259
|
+
})
|
|
260
|
+
})]
|
|
261
|
+
});
|
|
262
|
+
if (state.status === "reviewing") return /* @__PURE__ */ u(ReviewScreen, {
|
|
263
|
+
state,
|
|
264
|
+
manager,
|
|
265
|
+
t
|
|
266
|
+
});
|
|
267
|
+
if (state.status === "processing") return /* @__PURE__ */ u(VerificationResult, {
|
|
268
|
+
status: "submitting",
|
|
269
|
+
submittingTitle: t("common.processing")
|
|
270
|
+
});
|
|
271
|
+
if (state.status === "success") {
|
|
272
|
+
if (state.downloadDocument) return /* @__PURE__ */ u(Page, {
|
|
273
|
+
className: "IncodeElectronicSignature IncodeElectronicSignatureSuccess",
|
|
274
|
+
children: [/* @__PURE__ */ u("div", {
|
|
275
|
+
className: "IncodeElectronicSignatureSuccessCenter",
|
|
276
|
+
children: [/* @__PURE__ */ u(SuccessIcon, { size: 64 }), /* @__PURE__ */ u("p", {
|
|
277
|
+
className: "IncodeElectronicSignatureSuccessTitle",
|
|
278
|
+
children: t("signature.successTitle")
|
|
279
|
+
})]
|
|
280
|
+
}), /* @__PURE__ */ u("div", {
|
|
281
|
+
className: "IncodeElectronicSignatureFooter",
|
|
282
|
+
children: [/* @__PURE__ */ u(Button, {
|
|
283
|
+
onClick: () => manager.finish(),
|
|
284
|
+
children: t("common.continue")
|
|
285
|
+
}), state.signedDocuments.map((doc, i) => /* @__PURE__ */ u("a", {
|
|
286
|
+
href: doc.signedDocumentUrl,
|
|
287
|
+
target: "_blank",
|
|
288
|
+
rel: "noopener noreferrer",
|
|
289
|
+
className: "IncodeElectronicSignatureDownloadLink",
|
|
290
|
+
children: t("aes.confirmSignature.downloadDocument")
|
|
291
|
+
}, i))]
|
|
292
|
+
})]
|
|
293
|
+
});
|
|
294
|
+
return /* @__PURE__ */ u(VerificationResult, {
|
|
295
|
+
status: "success",
|
|
296
|
+
successTitle: t("signature.successTitle")
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
if (state.status === "error") return /* @__PURE__ */ u(VerificationResult, {
|
|
300
|
+
status: "warning",
|
|
301
|
+
warningTitle: t("aes.confirmSignature.fail"),
|
|
302
|
+
onRetry: () => manager.retry()
|
|
303
|
+
});
|
|
304
|
+
if (state.status === "signing") {
|
|
305
|
+
if (state.viewingDocumentUrl) return /* @__PURE__ */ u(Page, {
|
|
306
|
+
className: "IncodeElectronicSignature",
|
|
307
|
+
children: [/* @__PURE__ */ u("div", {
|
|
308
|
+
className: "IncodeElectronicSignatureDocViewHeader",
|
|
309
|
+
children: /* @__PURE__ */ u(Button, {
|
|
310
|
+
size: "M",
|
|
311
|
+
variant: "link",
|
|
312
|
+
class: "IncodeElectronicSignatureBackButton",
|
|
313
|
+
icon: /* @__PURE__ */ u(ChevronLeftIcon, { variant: "m" }),
|
|
314
|
+
onClick: () => manager.closeDocumentView(),
|
|
315
|
+
"aria-label": t("common.back")
|
|
316
|
+
})
|
|
317
|
+
}), /* @__PURE__ */ u(PdfViewer, {
|
|
318
|
+
url: state.viewingDocumentUrl,
|
|
319
|
+
mode: "full",
|
|
320
|
+
className: "IncodeElectronicSignatureDocViewer",
|
|
321
|
+
"aria-label": t("aes.confirmSignature.viewDocument")
|
|
322
|
+
})]
|
|
323
|
+
});
|
|
324
|
+
const variant = state.variant;
|
|
325
|
+
const consentItems = getConsentItems(variant, t);
|
|
326
|
+
const copy = getVariantCopy(variant, t);
|
|
327
|
+
return /* @__PURE__ */ u(Page, {
|
|
328
|
+
className: "IncodeElectronicSignature",
|
|
329
|
+
title: copy.signingTitle,
|
|
330
|
+
subtitle: copy.signingSubtitle,
|
|
331
|
+
children: [/* @__PURE__ */ u("div", {
|
|
332
|
+
className: "IncodeElectronicSignatureSigningTop",
|
|
333
|
+
children: /* @__PURE__ */ u("div", {
|
|
334
|
+
className: "IncodeElectronicSignatureDocContainer",
|
|
335
|
+
children: state.documents.map((doc, i) => /* @__PURE__ */ u("div", {
|
|
336
|
+
className: "IncodeElectronicSignatureDocRow",
|
|
337
|
+
children: [/* @__PURE__ */ u("span", {
|
|
338
|
+
className: "IncodeElectronicSignatureDocRowName",
|
|
339
|
+
children: [
|
|
340
|
+
t("aes.confirmSignature.contract"),
|
|
341
|
+
i === 0 ? "" : `${i + 1}`,
|
|
342
|
+
".pdf"
|
|
343
|
+
]
|
|
344
|
+
}), /* @__PURE__ */ u("button", {
|
|
345
|
+
type: "button",
|
|
346
|
+
className: "IncodeElectronicSignatureDocRowAction",
|
|
347
|
+
onClick: () => manager.viewDocument(doc.documentUrl),
|
|
348
|
+
children: t("aes.confirmSignature.viewDocument")
|
|
349
|
+
})]
|
|
350
|
+
}, doc.documentRef))
|
|
351
|
+
})
|
|
352
|
+
}), /* @__PURE__ */ u("div", {
|
|
353
|
+
className: "IncodeElectronicSignatureSigningBottom",
|
|
354
|
+
children: [/* @__PURE__ */ u("div", {
|
|
355
|
+
className: "IncodeElectronicSignatureConsents",
|
|
356
|
+
children: consentItems.map((item) => /* @__PURE__ */ u(Checkbox, {
|
|
357
|
+
id: `es-${item.id}`,
|
|
358
|
+
label: item.label,
|
|
359
|
+
size: "s",
|
|
360
|
+
checked: !!state.consentChecks[item.id],
|
|
361
|
+
onChange: () => manager.setConsent(item.id, !state.consentChecks[item.id])
|
|
362
|
+
}, item.id))
|
|
363
|
+
}), /* @__PURE__ */ u("div", {
|
|
364
|
+
className: "IncodeElectronicSignatureFooter",
|
|
365
|
+
children: /* @__PURE__ */ u(Button, {
|
|
366
|
+
onClick: () => manager.sign(),
|
|
367
|
+
disabled: !state.allConsented,
|
|
368
|
+
children: copy.signButtonLabel
|
|
369
|
+
})
|
|
370
|
+
})]
|
|
371
|
+
})]
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
return null;
|
|
375
|
+
};
|
|
376
|
+
var ReviewScreen = ({ state, manager, t }) => {
|
|
377
|
+
y(() => () => URL.revokeObjectURL(state.fileUrl), [state.fileUrl]);
|
|
378
|
+
return /* @__PURE__ */ u(Page, {
|
|
379
|
+
className: "IncodeElectronicSignature",
|
|
380
|
+
title: t("aes.reviewDocument.title"),
|
|
381
|
+
subtitle: t("aes.reviewDocument.subtitle"),
|
|
382
|
+
children: [/* @__PURE__ */ u("div", {
|
|
383
|
+
className: "IncodeElectronicSignatureReviewBody",
|
|
384
|
+
children: [/* @__PURE__ */ u("div", {
|
|
385
|
+
className: "IncodeElectronicSignatureReviewCard",
|
|
386
|
+
children: [/* @__PURE__ */ u("div", {
|
|
387
|
+
className: "IncodeElectronicSignatureDocPreview",
|
|
388
|
+
children: /* @__PURE__ */ u(PdfViewer, {
|
|
389
|
+
url: state.fileUrl,
|
|
390
|
+
mode: "thumbnail",
|
|
391
|
+
className: "IncodeElectronicSignatureDocPreviewObject",
|
|
392
|
+
"aria-label": state.fileName
|
|
393
|
+
})
|
|
394
|
+
}), /* @__PURE__ */ u("p", {
|
|
395
|
+
className: "IncodeElectronicSignatureDocName",
|
|
396
|
+
children: state.fileName
|
|
397
|
+
})]
|
|
398
|
+
}), /* @__PURE__ */ u("div", {
|
|
399
|
+
className: "IncodeElectronicSignatureEncrypted",
|
|
400
|
+
children: [/* @__PURE__ */ u(LockIcon, { className: "IncodeElectronicSignatureEncryptedIcon" }), /* @__PURE__ */ u("span", { children: t("encryptionLabel.encryptedPhotos") })]
|
|
401
|
+
})]
|
|
402
|
+
}), /* @__PURE__ */ u("div", {
|
|
403
|
+
className: "IncodeElectronicSignatureFooter",
|
|
404
|
+
children: [/* @__PURE__ */ u(Button, {
|
|
405
|
+
onClick: () => manager.confirmFile(),
|
|
406
|
+
children: t("common.continue")
|
|
407
|
+
}), /* @__PURE__ */ u(Button, {
|
|
408
|
+
variant: "secondary",
|
|
409
|
+
onClick: () => manager.replaceFile(),
|
|
410
|
+
children: t("aes.reviewDocument.replace")
|
|
411
|
+
})]
|
|
412
|
+
})]
|
|
413
|
+
});
|
|
414
|
+
};
|
|
415
|
+
var ElectronicSignature = ({ config, onFinish, onError }) => {
|
|
416
|
+
return /* @__PURE__ */ u(IncodeComponent, { children: config ? /* @__PURE__ */ u(ElectronicSignatureContent, {
|
|
417
|
+
config,
|
|
418
|
+
onFinish,
|
|
419
|
+
onError
|
|
420
|
+
}) : null });
|
|
421
|
+
};
|
|
422
|
+
/** @deprecated Use {@link ElectronicSignature} */
|
|
423
|
+
var AeSignature = ElectronicSignature;
|
|
424
|
+
registerIncodeModuleElement(ElectronicSignature, "incode-electronic-signature");
|
|
425
|
+
//#endregion
|
|
426
|
+
export { ElectronicSignature as n, AeSignature as t };
|