@incodetech/core 0.0.0-dev-20260423-427a341 → 0.0.0-dev-20260423-672ea74
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/{OpenViduRecordingProvider-3SvbmWdi.esm.js → OpenViduRecordingProvider-7PqRexCU.esm.js} +1 -1
- package/dist/{WasmUtilProvider-DmbBSMl1.esm.js → WasmUtilProvider-3sS7TzsG.esm.js} +1 -1
- package/dist/{addressSearch-BvpzLWr4.esm.js → addressSearch-CMO_-Isa.esm.js} +4 -4
- package/dist/{ae-signature-21vUGDha.esm.js → ae-signature-C07fpdHw.esm.js} +1 -1
- package/dist/ae-signature.d.ts +3 -3
- package/dist/ae-signature.esm.js +5 -5
- package/dist/antifraud.d.ts +1 -1
- package/dist/antifraud.esm.js +4 -4
- package/dist/{antifraudStateMachine-CIa-IPvP.esm.js → antifraudStateMachine-BOUj16Hj.esm.js} +3 -3
- package/dist/authentication.d.ts +11 -11
- package/dist/authentication.esm.js +22 -22
- package/dist/{authenticationManager-Bv9qL5fe.d.ts → authenticationManager-CGn-1c-V.d.ts} +2 -2
- package/dist/{authenticationManager-WLXkr-r0.esm.js → authenticationManager-URLydvU9.esm.js} +6 -6
- package/dist/{authenticationStateMachine-BifJqMei.esm.js → authenticationStateMachine-D8N6ERZa.esm.js} +6 -6
- package/dist/{backCameraStream-DSwtYHuO.esm.js → backCameraStream-CrljCJ-Q.esm.js} +3 -3
- package/dist/camera.d.ts +1 -1
- package/dist/camera.esm.js +3 -3
- package/dist/consent.d.ts +55 -55
- package/dist/consent.esm.js +4 -4
- package/dist/{consentStateMachine-DqiR30gw.esm.js → consentStateMachine-Fa4KYzzn.esm.js} +3 -3
- package/dist/cpf-DEcHUluo.esm.js +38 -0
- package/dist/cross-document-data-match.d.ts +1 -1
- package/dist/cross-document-data-match.esm.js +4 -4
- package/dist/curp-validation.d.ts +5 -5
- package/dist/curp-validation.esm.js +4 -4
- package/dist/{curpValidationStateMachine-Bp-V13CB.esm.js → curpValidationStateMachine-oXdccErv.esm.js} +3 -3
- package/dist/custom-fields.d.ts +2 -2
- package/dist/custom-fields.esm.js +3 -3
- package/dist/custom-watchlist.d.ts +1 -1
- package/dist/custom-watchlist.esm.js +4 -4
- package/dist/{deepsightLoader-BTrehKGp.esm.js → deepsightLoader-QMFaZ2jE.esm.js} +10 -10
- package/dist/{deepsightService-BknZgccc.d.ts → deepsightService-BAbwxVdZ.d.ts} +2 -2
- package/dist/{deepsightService-B0Z-9gmQ.esm.js → deepsightService-BFLmC3ua.esm.js} +5 -5
- package/dist/device.esm.js +3 -3
- package/dist/document-capture.d.ts +70 -70
- package/dist/document-capture.esm.js +8 -8
- package/dist/document-upload.d.ts +44 -44
- package/dist/document-upload.esm.js +7 -7
- package/dist/{documentCaptureStateMachine-CtMhD27q.esm.js → documentCaptureStateMachine-B8bi2Kh4.esm.js} +5 -5
- package/dist/ekyb.d.ts +3 -3
- package/dist/ekyb.esm.js +10 -10
- package/dist/{ekybStateMachine-Bn-pLTcp.esm.js → ekybStateMachine-DruS8yRg.esm.js} +5 -5
- package/dist/ekyc.d.ts +3 -3
- package/dist/ekyc.esm.js +7 -6
- package/dist/{ekycStateMachine-Nmn0Alq9.esm.js → ekycStateMachine-U3ivS4-5.esm.js} +5 -38
- package/dist/electronic-signature.d.ts +3 -3
- package/dist/electronic-signature.esm.js +4 -4
- package/dist/{electronicSignatureManager-DAkg8MF6.esm.js → electronicSignatureManager-CWJyes3f.esm.js} +3 -3
- package/dist/email.d.ts +3 -3
- package/dist/email.esm.js +6 -6
- package/dist/{emailManager-q2qVoNbM.d.ts → emailManager-CCrXrAU3.d.ts} +2 -2
- package/dist/{emailManager-o6B6AYuE.esm.js → emailManager-y8HVFngo.esm.js} +3 -3
- package/dist/{emailStateMachine-B5M_HlVm.esm.js → emailStateMachine-bLpj4LRr.esm.js} +4 -4
- package/dist/{events-Deg_qfet.esm.js → events-BYuumPiB.esm.js} +6 -2
- package/dist/events.d.ts +1 -0
- package/dist/events.esm.js +2 -2
- package/dist/extensibility.d.ts +15 -15
- package/dist/extensibility.esm.js +33 -33
- package/dist/face-match.d.ts +1 -1
- package/dist/face-match.esm.js +4 -4
- package/dist/{faceCaptureManagerFactory-Bq_skXK4.esm.js → faceCaptureManagerFactory-0bTuXnNo.esm.js} +2 -2
- package/dist/{faceCaptureManagerFactory-DAQqd0EL.d.ts → faceCaptureManagerFactory-B9SCeUbN.d.ts} +8 -8
- package/dist/{faceCaptureSetup-C9RqcwR9.esm.js → faceCaptureSetup-BLsm9VU9.esm.js} +4 -4
- package/dist/{faceMatchStateMachine-DCh79GWp.esm.js → faceMatchStateMachine-CB5JYxiV.esm.js} +3 -3
- package/dist/flow.d.ts +8 -8
- package/dist/flow.esm.js +9 -9
- package/dist/{flowCompletionService-BnZC_DV0.esm.js → flowCompletionService-B0ua9_Oo.esm.js} +2 -2
- package/dist/{flowServices-s0CiH0WO.esm.js → flowServices-ngHx2Tal.esm.js} +3 -3
- package/dist/geolocation.d.ts +2 -2
- package/dist/geolocation.esm.js +5 -5
- package/dist/{geolocationStateMachine-CxQCX2NJ.esm.js → geolocationStateMachine-Cc2eFVZU.esm.js} +4 -4
- package/dist/{getDeviceClass-DStKSj3Q.esm.js → getDeviceClass-B_Y-Y-zj.esm.js} +1 -1
- package/dist/government-validation.d.ts +2 -2
- package/dist/government-validation.esm.js +5 -5
- package/dist/{governmentValidationStateMachine-L7nwlJPw.esm.js → governmentValidationStateMachine-wvZ5ysEM.esm.js} +4 -4
- package/dist/home.d.ts +14 -14
- package/dist/home.esm.js +3 -3
- package/dist/http.esm.js +1 -1
- package/dist/id-ocr.d.ts +627 -0
- package/dist/id-ocr.esm.js +459 -0
- package/dist/id.d.ts +10 -10
- package/dist/id.esm.js +22 -22
- package/dist/{idCaptureManager-C2L4R8rT.d.ts → idCaptureManager-B_dajBGr.d.ts} +7 -7
- package/dist/{idCaptureManager-Cuq1R8jW.esm.js → idCaptureManager-DvJEDPBW.esm.js} +4 -4
- package/dist/{idCaptureStateMachine-B1eBofuq.esm.js → idCaptureStateMachine-CgddydGJ.esm.js} +16 -16
- package/dist/identity-reuse.d.ts +49 -49
- package/dist/identity-reuse.esm.js +3 -3
- package/dist/{index-DMN6Upfk.d.ts → index-BbYUSiBn.d.ts} +120 -120
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +8 -8
- package/dist/{lib-DP0jsq7O.esm.js → lib-Db1XxJuS.esm.js} +1 -1
- package/dist/mandatory-consent.d.ts +52 -52
- package/dist/mandatory-consent.esm.js +4 -4
- package/dist/{mandatoryConsentStateMachine-Bjqy6QyQ.esm.js → mandatoryConsentStateMachine-0bZm4vNr.esm.js} +3 -3
- package/dist/openviduLazy-ClEZ-Z5M.esm.js +3 -0
- package/dist/{openviduLazy-CYviBULf.esm.js → openviduLazy-sruV5sxi.esm.js} +2 -2
- package/dist/{permissionServices-BJJE4sgW.esm.js → permissionServices-BdE8_Evq.esm.js} +2 -2
- package/dist/phone.d.ts +3 -3
- package/dist/phone.esm.js +6 -6
- package/dist/{phoneManager-C4QrFxRg.esm.js → phoneManager-CfoEpjeM.esm.js} +3 -3
- package/dist/{phoneManager-DBwE-qB0.d.ts → phoneManager-Da8QkPv7.d.ts} +2 -2
- package/dist/{phoneStateMachine-CMbJx57_.esm.js → phoneStateMachine-u-A2hOxu.esm.js} +4 -4
- package/dist/{qe-signature-D7Ou3WtG.esm.js → qe-signature-DhBKlGUH.esm.js} +1 -1
- package/dist/qe-signature.d.ts +3 -3
- package/dist/qe-signature.esm.js +5 -5
- package/dist/{recordingService-CtcIvA3E.esm.js → recordingService-CpbeUNqo.esm.js} +13 -13
- package/dist/redirect-to-mobile.d.ts +2 -2
- package/dist/redirect-to-mobile.esm.js +5 -5
- package/dist/{redirectToMobileStateMachine-CtWjarUj.esm.js → redirectToMobileStateMachine-BMXJRSAC.esm.js} +4 -4
- package/dist/{runChildModule-DM84wxzE.esm.js → runChildModule-DHxT1RV0.esm.js} +1 -1
- package/dist/selfie.d.ts +11 -11
- package/dist/selfie.esm.js +22 -22
- package/dist/{selfieManager-CoyIn3Zl.esm.js → selfieManager-CkmC58-2.esm.js} +6 -6
- package/dist/{selfieManager-Cfp4MKMu.d.ts → selfieManager-dLehZvQm.d.ts} +2 -2
- package/dist/{selfieStateMachine-CsI9YnHz.esm.js → selfieStateMachine-BusOHMBN.esm.js} +3 -3
- package/dist/{session-CrOl1xma.esm.js → session-CEsW15cJ.esm.js} +4 -4
- package/dist/session.d.ts +1 -1
- package/dist/session.esm.js +6 -6
- package/dist/{setup-BFXhW7cP.esm.js → setup-BvlIJVhZ.esm.js} +5 -5
- package/dist/{setup-VJbRmBIU.d.ts → setup-v-TAsAN2.d.ts} +1 -1
- package/dist/signature.d.ts +2 -2
- package/dist/signature.esm.js +4 -4
- package/dist/{signatureStateMachine-yaoE2OEY.esm.js → signatureStateMachine-D6E5ZdHV.esm.js} +3 -3
- package/dist/{stats-BEwRvZG4.esm.js → stats-DE05K1o9.esm.js} +1 -1
- package/dist/stats.esm.js +2 -2
- package/dist/{types-CgZVig-j.d.ts → types-BelKmTqU.d.ts} +5 -1
- package/dist/{types-BINKuP3l.d.ts → types-BxjVn8Ry.d.ts} +1 -1
- package/dist/{types-BmHAVvm0.d.ts → types-DZ7Qw6Yc.d.ts} +1 -1
- package/dist/wasm.d.ts +2 -2
- package/dist/wasm.esm.js +8 -8
- package/dist/watchlist-for-business.d.ts +1 -1
- package/dist/watchlist-for-business.esm.js +3 -3
- package/dist/watchlist.d.ts +1 -1
- package/dist/watchlist.esm.js +4 -4
- package/dist/{watchlistServices-D2I0AZb-.esm.js → watchlistServices-BW1w845W.esm.js} +2 -2
- package/dist/workflow.d.ts +116 -116
- package/dist/workflow.esm.js +45 -44
- package/package.json +5 -1
- package/dist/openviduLazy-7pgMhjPB.esm.js +0 -3
- /package/dist/{Actor-B-9T-DlO.d.ts → Actor-gwS4PQSi.d.ts} +0 -0
- /package/dist/{BaseWasmProvider-Cf3MNlAN.esm.js → BaseWasmProvider-DsxKeFBt.esm.js} +0 -0
- /package/dist/{BrowserStorageProvider-Drw72wvG.esm.js → BrowserStorageProvider-D99-O_Kf.esm.js} +0 -0
- /package/dist/{BrowserTimerProvider-Dav3_fFy.esm.js → BrowserTimerProvider-Dl6dq0R8.esm.js} +0 -0
- /package/dist/{ITimerCapability-BriAkEyj.esm.js → ITimerCapability-DUFfKzTs.esm.js} +0 -0
- /package/dist/{IpifyProvider-j8lI27Fq.esm.js → IpifyProvider-BRMpdf22.esm.js} +0 -0
- /package/dist/{Manager-BCd4NBhe.d.ts → Manager-BmmucBrC.d.ts} +0 -0
- /package/dist/{MotionSensorProvider-DYYBm_bL.esm.js → MotionSensorProvider-Qfs1LN2o.esm.js} +0 -0
- /package/dist/{StateMachine-BNiyEj7J.d.ts → StateMachine-B1c7OspS.d.ts} +0 -0
- /package/dist/{api-CzVamIBG.esm.js → api-Bv7xXuMw.esm.js} +0 -0
- /package/dist/{browserSimulation-C4a2KVIY.esm.js → browserSimulation-CB1iKoSy.esm.js} +0 -0
- /package/dist/{camera-DaD3X_7m.esm.js → camera-BEKg9OFz.esm.js} +0 -0
- /package/dist/{camera-BZfRhPh2.d.ts → camera-CXfeCsaz.d.ts} +0 -0
- /package/dist/{chunk-DZf7laLq.esm.js → chunk-BPmmK_1R.esm.js} +0 -0
- /package/dist/{displayErrors-YTUUYe7G.d.ts → displayErrors-DT-jBLuo.d.ts} +0 -0
- /package/dist/{flowCompletionService-MFzwlktR.d.ts → flowCompletionService-BxOJeebo.d.ts} +0 -0
- /package/dist/{getBrowser-DxB_n8-W.esm.js → getBrowser-COVIk8a4.esm.js} +0 -0
- /package/dist/{platform-CTBj7PrA.esm.js → platform-bAk6j4kV.esm.js} +0 -0
- /package/dist/{types-CZwSG43_.d.ts → types-nURQ3pMv.d.ts} +0 -0
- /package/dist/{warmup-BR9x_9iz.d.ts → warmup-SnxLgQsT.d.ts} +0 -0
- /package/dist/{xstate.esm-BXNheqIe.esm.js → xstate.esm-DGcAhoQP.esm.js} +0 -0
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
import { t as api } from "./api-Bv7xXuMw.esm.js";
|
|
2
|
+
import { _ as endpoints, n as eventModuleNames, o as createManagerInstrumentation, v as getTimestamp } from "./events-BYuumPiB.esm.js";
|
|
3
|
+
import { a as createActor, i as fromPromise, n as assign, o as createManager, t as setup } from "./xstate.esm-DGcAhoQP.esm.js";
|
|
4
|
+
import { t as validateCPF } from "./cpf-DEcHUluo.esm.js";
|
|
5
|
+
|
|
6
|
+
//#region ../infra/src/providers/browser/DateFormattingProvider.ts
|
|
7
|
+
var DateFormattingProvider = class {
|
|
8
|
+
utcToIsoDateString(value) {
|
|
9
|
+
if (value === void 0 || value === null || value === "") return "";
|
|
10
|
+
const date = new Date(value);
|
|
11
|
+
if (Number.isNaN(date.getTime())) return "";
|
|
12
|
+
return `${date.getUTCFullYear()}-${String(date.getUTCMonth() + 1).padStart(2, "0")}-${String(date.getUTCDate()).padStart(2, "0")}`;
|
|
13
|
+
}
|
|
14
|
+
parseIsoDateStringToEpochMs(value) {
|
|
15
|
+
return Date.parse(value);
|
|
16
|
+
}
|
|
17
|
+
getAgeInYears(birthDate, referenceEpochMs) {
|
|
18
|
+
const now = new Date(referenceEpochMs);
|
|
19
|
+
const birth = new Date(birthDate);
|
|
20
|
+
let age = now.getFullYear() - birth.getFullYear();
|
|
21
|
+
const monthDiff = now.getMonth() - birth.getMonth();
|
|
22
|
+
if (monthDiff < 0 || monthDiff === 0 && now.getDate() < birth.getDate()) age--;
|
|
23
|
+
return age;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/modules/id-ocr/idOcrUtils.ts
|
|
29
|
+
const dateFormattingInstance$1 = new DateFormattingProvider();
|
|
30
|
+
const resolveFullName = (data) => {
|
|
31
|
+
if (data.name?.fullName) return data.name.fullName;
|
|
32
|
+
const joined = [
|
|
33
|
+
data.name?.givenName ?? data.givenName ?? data.firstName,
|
|
34
|
+
data.name?.paternalLastName ?? data.fathersSurname,
|
|
35
|
+
data.name?.maternalLastName ?? data.mothersSurname
|
|
36
|
+
].filter(Boolean).join(" ").trim();
|
|
37
|
+
if (joined) return joined;
|
|
38
|
+
return data.fullNameMrz ?? "";
|
|
39
|
+
};
|
|
40
|
+
const mapOcrResponseToFormData = (data) => ({
|
|
41
|
+
name: resolveFullName(data),
|
|
42
|
+
firstName: data.firstName ?? data.givenName ?? data.name?.givenName ?? "",
|
|
43
|
+
lastName: data.fathersSurname ?? data.name?.paternalLastName ?? "",
|
|
44
|
+
paternalLastName: data.fathersSurname ?? data.name?.paternalLastName ?? "",
|
|
45
|
+
maternalLastName: data.mothersSurname ?? data.name?.maternalLastName ?? "",
|
|
46
|
+
birthDate: dateFormattingInstance$1.utcToIsoDateString(data.birthDate),
|
|
47
|
+
gender: data.gender ?? "",
|
|
48
|
+
address: data.address ?? "",
|
|
49
|
+
documentNumber: data.documentNumber ?? "",
|
|
50
|
+
personalNumber: data.personalNumber ?? "",
|
|
51
|
+
curp: data.curp ?? "",
|
|
52
|
+
issuingCountry: data.issuingCountry ?? "",
|
|
53
|
+
expireAt: data.expireAt,
|
|
54
|
+
email: ""
|
|
55
|
+
});
|
|
56
|
+
const mapUpdateOcrDataForApi = (params) => {
|
|
57
|
+
const working = { ...params };
|
|
58
|
+
const nameTrimmed = working.name?.trim();
|
|
59
|
+
if (nameTrimmed) working.name = nameTrimmed;
|
|
60
|
+
if (nameTrimmed && !working.firstName?.trim() && !working.paternalLastName?.trim() && !working.maternalLastName?.trim()) {
|
|
61
|
+
const tokens = nameTrimmed.split(/\s+/).filter(Boolean);
|
|
62
|
+
if (tokens.length === 3) {
|
|
63
|
+
working.firstName = tokens[0];
|
|
64
|
+
working.paternalLastName = tokens[1];
|
|
65
|
+
working.maternalLastName = tokens[2];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
const body = {};
|
|
69
|
+
for (const key of Object.keys(working)) {
|
|
70
|
+
const raw = working[key];
|
|
71
|
+
if (raw === void 0) continue;
|
|
72
|
+
if (key === "birthDate") {
|
|
73
|
+
body[key] = dateFormattingInstance$1.parseIsoDateStringToEpochMs(raw);
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
body[key] = typeof raw === "string" ? raw.trim() : raw;
|
|
77
|
+
}
|
|
78
|
+
return body;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/modules/id-ocr/idOcrServices.ts
|
|
83
|
+
/** Fetch ID OCR data. Throws on failure. */
|
|
84
|
+
async function getOcrData(signal, isSecondId) {
|
|
85
|
+
const url = isSecondId ? endpoints.ocrDataSecondId : endpoints.ocrData;
|
|
86
|
+
const res = await api.get(url, { signal });
|
|
87
|
+
if (!res.ok) throw new Error(`GET ${url} failed: ${res.status} ${res.statusText}`);
|
|
88
|
+
return res.data;
|
|
89
|
+
}
|
|
90
|
+
/** Updates ID OCR data if OCR data is editable. Throws on failure. */
|
|
91
|
+
async function updateOcrData(params, signal, isSecondId) {
|
|
92
|
+
const url = isSecondId ? endpoints.updateEditableOcrDataSecondId : endpoints.updateEditableOcrData;
|
|
93
|
+
const res = await api.put(url, mapUpdateOcrDataForApi(params), { signal });
|
|
94
|
+
if (!res.ok) throw new Error(`PUT failed: ${url} failed: ${res.status} ${res.statusText}`);
|
|
95
|
+
return res.data;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/modules/id-ocr/idOcrConsts.ts
|
|
100
|
+
const MIN_AGE = 18;
|
|
101
|
+
const CPFFlowIds = [
|
|
102
|
+
"65985b7ec335fa20effa547b",
|
|
103
|
+
"657b823ddb312196b5dd30f8",
|
|
104
|
+
"659843c207413e34c407fc1d",
|
|
105
|
+
"657c8b7a188817b6ec04b26c",
|
|
106
|
+
"6793bba8845d50f53f5fb910",
|
|
107
|
+
"679826a35ec9927c65407873",
|
|
108
|
+
"6838c03fae866c13e63fbaf4",
|
|
109
|
+
"681a14fb37a49f2319cbf359",
|
|
110
|
+
"68e5318406c77c2b6993ed8f",
|
|
111
|
+
"68e531531a6892418eecd21f",
|
|
112
|
+
"68e5314706c77c2b6993eb99"
|
|
113
|
+
];
|
|
114
|
+
|
|
115
|
+
//#endregion
|
|
116
|
+
//#region src/modules/id-ocr/idOcrFields.ts
|
|
117
|
+
const CPF_ONLY_OCR_FIELDS = [{
|
|
118
|
+
key: "documentNumber",
|
|
119
|
+
labelKey: "userData.cpf",
|
|
120
|
+
type: "text",
|
|
121
|
+
validation: [{ type: "required" }, { type: "cpf" }],
|
|
122
|
+
required: true
|
|
123
|
+
}];
|
|
124
|
+
const OCR_FIELDS = [
|
|
125
|
+
{
|
|
126
|
+
key: "name",
|
|
127
|
+
labelKey: "userData.fullName",
|
|
128
|
+
type: "text",
|
|
129
|
+
validation: [{ type: "required" }],
|
|
130
|
+
required: true
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
key: "birthDate",
|
|
134
|
+
labelKey: "userData.dateOfBirth",
|
|
135
|
+
type: "date",
|
|
136
|
+
validation: [{ type: "required" }, {
|
|
137
|
+
type: "minAge",
|
|
138
|
+
years: MIN_AGE
|
|
139
|
+
}],
|
|
140
|
+
required: true
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
key: "gender",
|
|
144
|
+
labelKey: "userData.sex",
|
|
145
|
+
type: "radio",
|
|
146
|
+
options: [{
|
|
147
|
+
label: "common.male",
|
|
148
|
+
value: "M"
|
|
149
|
+
}, {
|
|
150
|
+
label: "common.female",
|
|
151
|
+
value: "F"
|
|
152
|
+
}],
|
|
153
|
+
required: false
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
key: "address",
|
|
157
|
+
labelKey: "userData.address",
|
|
158
|
+
type: "text",
|
|
159
|
+
validation: [{ type: "required" }],
|
|
160
|
+
required: true
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
key: "issuingCountry",
|
|
164
|
+
labelKey: "userData.issuingCountry",
|
|
165
|
+
type: "text",
|
|
166
|
+
validation: [{ type: "required" }],
|
|
167
|
+
required: true
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
key: "documentNumber",
|
|
171
|
+
labelKey: "userData.documentNumber",
|
|
172
|
+
type: "text",
|
|
173
|
+
required: true
|
|
174
|
+
}
|
|
175
|
+
];
|
|
176
|
+
const getOcrFields = (config) => {
|
|
177
|
+
const { flowId } = config;
|
|
178
|
+
if (flowId && CPFFlowIds.includes(flowId)) return CPF_ONLY_OCR_FIELDS;
|
|
179
|
+
return OCR_FIELDS;
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region src/modules/id-ocr/idOcrValidators.ts
|
|
184
|
+
const dateFormattingInstance = new DateFormattingProvider();
|
|
185
|
+
const createValidators = () => {
|
|
186
|
+
return {
|
|
187
|
+
required: (value, _) => !value.trim() ? "modifiableOCR.cantBeEmpty" : void 0,
|
|
188
|
+
minAge: (value, rule) => {
|
|
189
|
+
if (!value.trim() || rule.type !== "minAge") return void 0;
|
|
190
|
+
return dateFormattingInstance.getAgeInYears(value, getTimestamp()) < rule.years ? "modifiableOCR.ageRange" : void 0;
|
|
191
|
+
},
|
|
192
|
+
cpf: (value, rule) => {
|
|
193
|
+
if (rule.type !== "cpf" || !value.trim()) return void 0;
|
|
194
|
+
return validateCPF(value) ? void 0 : "verification.errors.invalidTaxId";
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
const normalizeFieldValue = (value) => typeof value === "string" ? value.trim() : String(value ?? "");
|
|
199
|
+
const validateFieldValue = (value, field, validators) => {
|
|
200
|
+
if (!field.validation) return void 0;
|
|
201
|
+
for (const rule of field.validation) {
|
|
202
|
+
const error = validators[rule.type](value, rule);
|
|
203
|
+
if (error) return error;
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
const validateOcrForm = (data, fields) => {
|
|
207
|
+
const validators = createValidators();
|
|
208
|
+
return fields.reduce((errors, field) => {
|
|
209
|
+
const error = validateFieldValue(normalizeFieldValue(data[field.key]), field, validators);
|
|
210
|
+
if (error) errors[field.key] = error;
|
|
211
|
+
return errors;
|
|
212
|
+
}, {});
|
|
213
|
+
};
|
|
214
|
+
const validateOcrField = (data, fieldKey, fields) => {
|
|
215
|
+
const field = fields.find((field$1) => field$1.key === fieldKey);
|
|
216
|
+
if (!field) return void 0;
|
|
217
|
+
const validators = createValidators();
|
|
218
|
+
return validateFieldValue(normalizeFieldValue(data[field.key]), field, validators);
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
//#endregion
|
|
222
|
+
//#region src/modules/id-ocr/idOcrStateMachine.ts
|
|
223
|
+
const emptyOcrData = () => ({});
|
|
224
|
+
const idOcrStateMachine = setup({
|
|
225
|
+
types: {
|
|
226
|
+
context: {},
|
|
227
|
+
events: {},
|
|
228
|
+
input: {}
|
|
229
|
+
},
|
|
230
|
+
actors: {
|
|
231
|
+
getOcrData: fromPromise(async ({ input, signal }) => getOcrData(signal, input.isSecondId)),
|
|
232
|
+
updateOcrData: fromPromise(async ({ input, signal }) => updateOcrData(input.params, signal, input.isSecondId))
|
|
233
|
+
},
|
|
234
|
+
actions: {
|
|
235
|
+
setInitialData: assign(({ event }) => {
|
|
236
|
+
const raw = event.output;
|
|
237
|
+
return {
|
|
238
|
+
formData: mapOcrResponseToFormData(raw),
|
|
239
|
+
editedFields: {},
|
|
240
|
+
validationErrors: void 0,
|
|
241
|
+
error: void 0
|
|
242
|
+
};
|
|
243
|
+
}),
|
|
244
|
+
updateField: assign(({ context, event }) => {
|
|
245
|
+
const { field, value } = event;
|
|
246
|
+
return {
|
|
247
|
+
formData: {
|
|
248
|
+
...context.formData,
|
|
249
|
+
[field]: value
|
|
250
|
+
},
|
|
251
|
+
editedFields: {
|
|
252
|
+
...context.editedFields,
|
|
253
|
+
[field]: value
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
}),
|
|
257
|
+
clearFieldValidationError: assign(({ context, event }) => {
|
|
258
|
+
if (event.type !== "DATA_CHANGED") return {};
|
|
259
|
+
const { field } = event;
|
|
260
|
+
const errs = context.validationErrors;
|
|
261
|
+
if (!errs?.[field]) return {};
|
|
262
|
+
const next = { ...errs };
|
|
263
|
+
delete next[field];
|
|
264
|
+
return { validationErrors: Object.keys(next).length > 0 ? next : void 0 };
|
|
265
|
+
}),
|
|
266
|
+
setOcrValidationErrors: assign(({ context }) => ({ validationErrors: validateOcrForm(context.formData, getOcrFields(context.config)) })),
|
|
267
|
+
validateFormField: assign(({ context, event }) => {
|
|
268
|
+
if (event.type !== "VALIDATE_FIELD") return {};
|
|
269
|
+
const { field } = event;
|
|
270
|
+
const message = validateOcrField(context.formData, field, getOcrFields(context.config));
|
|
271
|
+
const next = { ...context.validationErrors ?? {} };
|
|
272
|
+
if (message) next[field] = message;
|
|
273
|
+
else delete next[field];
|
|
274
|
+
return { validationErrors: Object.keys(next).length > 0 ? next : void 0 };
|
|
275
|
+
}),
|
|
276
|
+
setError: assign(({ event }) => ({ error: String(event.error) })),
|
|
277
|
+
beginSecondIdOcrPhase: assign(() => ({
|
|
278
|
+
activeOcrDocument: "second",
|
|
279
|
+
editedFields: {},
|
|
280
|
+
validationErrors: void 0
|
|
281
|
+
})),
|
|
282
|
+
resetForRetry: assign(() => ({
|
|
283
|
+
activeOcrDocument: "first",
|
|
284
|
+
formData: emptyOcrData(),
|
|
285
|
+
editedFields: {},
|
|
286
|
+
error: void 0,
|
|
287
|
+
validationErrors: void 0
|
|
288
|
+
})),
|
|
289
|
+
computeValidationResult: assign(({ context }) => ({ validationErrors: validateOcrForm(context.formData, getOcrFields(context.config)) }))
|
|
290
|
+
},
|
|
291
|
+
guards: {
|
|
292
|
+
isOcrEditable: ({ context }) => context.config.editableOcr === true,
|
|
293
|
+
shouldLoadSecondOcrAfterFirst: ({ context }) => context.config.secondId === true && context.activeOcrDocument === "first",
|
|
294
|
+
isOcrFormValid: ({ context }) => Object.keys(context.validationErrors ?? {}).length === 0,
|
|
295
|
+
shouldSubmit: ({ context }) => Object.keys(context.validationErrors ?? {}).length === 0 && Object.keys(context.editedFields).length > 0,
|
|
296
|
+
shouldProceedWithoutSubmitToSecondId: ({ context }) => Object.keys(context.validationErrors ?? {}).length === 0 && Object.keys(context.editedFields).length === 0 && context.config.secondId === true && context.activeOcrDocument === "first"
|
|
297
|
+
}
|
|
298
|
+
}).createMachine({
|
|
299
|
+
id: "idOcr",
|
|
300
|
+
initial: "idle",
|
|
301
|
+
context: ({ input }) => {
|
|
302
|
+
const data = emptyOcrData();
|
|
303
|
+
return {
|
|
304
|
+
config: input.config,
|
|
305
|
+
formData: data,
|
|
306
|
+
editedFields: {},
|
|
307
|
+
activeOcrDocument: "first"
|
|
308
|
+
};
|
|
309
|
+
},
|
|
310
|
+
states: {
|
|
311
|
+
idle: { on: { LOAD: [{ target: "loading" }] } },
|
|
312
|
+
loading: { invoke: {
|
|
313
|
+
src: "getOcrData",
|
|
314
|
+
input: ({ context }) => ({ isSecondId: context.activeOcrDocument === "second" }),
|
|
315
|
+
onDone: [{
|
|
316
|
+
target: "inputting",
|
|
317
|
+
guard: "isOcrEditable",
|
|
318
|
+
actions: "setInitialData"
|
|
319
|
+
}, {
|
|
320
|
+
target: "readonly",
|
|
321
|
+
actions: "setInitialData"
|
|
322
|
+
}],
|
|
323
|
+
onError: {
|
|
324
|
+
target: "error",
|
|
325
|
+
actions: "setError"
|
|
326
|
+
}
|
|
327
|
+
} },
|
|
328
|
+
readonly: { on: { CONTINUE: [{
|
|
329
|
+
target: "loading",
|
|
330
|
+
guard: "shouldLoadSecondOcrAfterFirst",
|
|
331
|
+
actions: "beginSecondIdOcrPhase"
|
|
332
|
+
}, { target: "finished" }] } },
|
|
333
|
+
inputting: { on: {
|
|
334
|
+
DATA_CHANGED: { actions: ["updateField", "clearFieldValidationError"] },
|
|
335
|
+
VALIDATE_FIELD: { actions: "validateFormField" },
|
|
336
|
+
CONTINUE: { target: "validatingContinue" }
|
|
337
|
+
} },
|
|
338
|
+
validatingContinue: {
|
|
339
|
+
entry: "computeValidationResult",
|
|
340
|
+
always: [
|
|
341
|
+
{
|
|
342
|
+
guard: "shouldSubmit",
|
|
343
|
+
target: "submitting"
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
guard: "shouldProceedWithoutSubmitToSecondId",
|
|
347
|
+
target: "loading",
|
|
348
|
+
actions: "beginSecondIdOcrPhase"
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
guard: "isOcrFormValid",
|
|
352
|
+
target: "finished"
|
|
353
|
+
},
|
|
354
|
+
{ target: "inputting" }
|
|
355
|
+
]
|
|
356
|
+
},
|
|
357
|
+
submitting: { invoke: {
|
|
358
|
+
src: "updateOcrData",
|
|
359
|
+
input: ({ context }) => ({
|
|
360
|
+
params: context.editedFields,
|
|
361
|
+
isSecondId: context.activeOcrDocument === "second"
|
|
362
|
+
}),
|
|
363
|
+
onDone: [{
|
|
364
|
+
target: "loading",
|
|
365
|
+
guard: "shouldLoadSecondOcrAfterFirst",
|
|
366
|
+
actions: "beginSecondIdOcrPhase"
|
|
367
|
+
}, { target: "finished" }],
|
|
368
|
+
onError: {
|
|
369
|
+
target: "error",
|
|
370
|
+
actions: "setError"
|
|
371
|
+
}
|
|
372
|
+
} },
|
|
373
|
+
finished: { type: "final" },
|
|
374
|
+
error: { on: { RESET: {
|
|
375
|
+
target: "idle",
|
|
376
|
+
actions: "resetForRetry"
|
|
377
|
+
} } }
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
//#endregion
|
|
382
|
+
//#region src/modules/id-ocr/idOcrActor.ts
|
|
383
|
+
function createIdOcrActor(options) {
|
|
384
|
+
return createActor(idOcrStateMachine, { input: { config: options.config } }).start();
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
//#endregion
|
|
388
|
+
//#region src/modules/id-ocr/idOcrManager.ts
|
|
389
|
+
function mapState(snapshot) {
|
|
390
|
+
const { context } = snapshot;
|
|
391
|
+
const editableOcr = context.config.editableOcr === true;
|
|
392
|
+
if (snapshot.matches("idle")) return { status: "idle" };
|
|
393
|
+
if (snapshot.matches("loading")) return {
|
|
394
|
+
status: "loading",
|
|
395
|
+
ocrDocument: context.activeOcrDocument
|
|
396
|
+
};
|
|
397
|
+
if (snapshot.matches("readonly")) return {
|
|
398
|
+
status: "readonly",
|
|
399
|
+
formData: context.formData,
|
|
400
|
+
editableOcr,
|
|
401
|
+
ocrDocument: context.activeOcrDocument
|
|
402
|
+
};
|
|
403
|
+
if (snapshot.matches("inputting")) return {
|
|
404
|
+
status: "inputting",
|
|
405
|
+
formData: context.formData,
|
|
406
|
+
diff: context.editedFields,
|
|
407
|
+
editableOcr,
|
|
408
|
+
ocrDocument: context.activeOcrDocument,
|
|
409
|
+
validationErrors: context.validationErrors
|
|
410
|
+
};
|
|
411
|
+
if (snapshot.matches("submitting")) return {
|
|
412
|
+
status: "submitting",
|
|
413
|
+
ocrDocument: context.activeOcrDocument
|
|
414
|
+
};
|
|
415
|
+
if (snapshot.matches("finished")) return { status: "finished" };
|
|
416
|
+
if (snapshot.matches("error")) return {
|
|
417
|
+
status: "error",
|
|
418
|
+
error: context.error ?? "Unknown error"
|
|
419
|
+
};
|
|
420
|
+
return { status: "idle" };
|
|
421
|
+
}
|
|
422
|
+
function createApi({ actor, trackElementClicked }) {
|
|
423
|
+
return {
|
|
424
|
+
load() {
|
|
425
|
+
actor.send({ type: "LOAD" });
|
|
426
|
+
},
|
|
427
|
+
setField(field, value) {
|
|
428
|
+
actor.send({
|
|
429
|
+
type: "DATA_CHANGED",
|
|
430
|
+
field,
|
|
431
|
+
value
|
|
432
|
+
});
|
|
433
|
+
},
|
|
434
|
+
validateField(field) {
|
|
435
|
+
actor.send({
|
|
436
|
+
type: "VALIDATE_FIELD",
|
|
437
|
+
field
|
|
438
|
+
});
|
|
439
|
+
},
|
|
440
|
+
continue() {
|
|
441
|
+
actor.send({ type: "CONTINUE" });
|
|
442
|
+
trackElementClicked?.("continue");
|
|
443
|
+
},
|
|
444
|
+
reset() {
|
|
445
|
+
actor.send({ type: "RESET" });
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
function createIdOcrManager(options) {
|
|
450
|
+
return createManager({
|
|
451
|
+
actor: createIdOcrActor(options),
|
|
452
|
+
mapState,
|
|
453
|
+
createApi,
|
|
454
|
+
instrumentation: createManagerInstrumentation(eventModuleNames.idOcr)
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
//#endregion
|
|
459
|
+
export { CPFFlowIds, MIN_AGE, OCR_FIELDS, createIdOcrManager, getOcrFields, idOcrStateMachine };
|
package/dist/id.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import "./warmup-
|
|
2
|
-
import "./Manager-
|
|
3
|
-
import "./Actor-
|
|
4
|
-
import "./StateMachine-
|
|
5
|
-
import { t as CameraStream } from "./camera-
|
|
6
|
-
import "./types-
|
|
7
|
-
import "./types-
|
|
8
|
-
import "./deepsightService-
|
|
9
|
-
import { n as PermissionStatus, t as PermissionResult } from "./types-
|
|
10
|
-
import { A as IdCaptureConfig, B as IdErrorCode, C as IdCaptureMachine, D as DetectionArea, E as CapturedImage, F as IdCaptureInput, G as ManualUploadContext, H as MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, I as IdCaptureMode, J as RecordingSession, K as ManualUploadSide, L as IdCaptureThresholds, M as IdCaptureDependencies, N as IdCaptureEvent, O as DetectionStatus, P as IdCaptureGeometry, R as IdDocumentType, S as createIdCaptureActor, T as CaptureIdResponse, U as MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, V as IdFlowStep, W as MANUAL_UPLOAD_MAX_RETRIES, X as DetectionOrientation, Y as UploadIdResponse, Z as IdCaptureSettings, _ as uploadIdImage, a as IdCaptureInitResult, b as CreateIdCaptureActorOptions, c as UploadIdImageParams, d as initializeIdCapture, f as preloadIdRecordingProvider, g as stopStream, h as stopRecording, j as IdCaptureContext, k as ID_ERROR_CODES, l as UploadManualIdFileParams, m as startRecordingSession, n as IdCaptureState, o as InitializeIdCaptureParams, p as processId, q as ManualUploadTab, r as createIdCaptureManager, s as StartRecordingParams, t as IdCaptureManager, u as ValidationError, v as uploadManualIdFile, w as idCaptureMachine, x as IdCaptureActor, y as validateUploadResponse, z as IdError } from "./idCaptureManager-
|
|
1
|
+
import "./warmup-SnxLgQsT.js";
|
|
2
|
+
import "./Manager-BmmucBrC.js";
|
|
3
|
+
import "./Actor-gwS4PQSi.js";
|
|
4
|
+
import "./StateMachine-B1c7OspS.js";
|
|
5
|
+
import { t as CameraStream } from "./camera-CXfeCsaz.js";
|
|
6
|
+
import "./types-BxjVn8Ry.js";
|
|
7
|
+
import "./types-BelKmTqU.js";
|
|
8
|
+
import "./deepsightService-BAbwxVdZ.js";
|
|
9
|
+
import { n as PermissionStatus, t as PermissionResult } from "./types-nURQ3pMv.js";
|
|
10
|
+
import { A as IdCaptureConfig, B as IdErrorCode, C as IdCaptureMachine, D as DetectionArea, E as CapturedImage, F as IdCaptureInput, G as ManualUploadContext, H as MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, I as IdCaptureMode, J as RecordingSession, K as ManualUploadSide, L as IdCaptureThresholds, M as IdCaptureDependencies, N as IdCaptureEvent, O as DetectionStatus, P as IdCaptureGeometry, R as IdDocumentType, S as createIdCaptureActor, T as CaptureIdResponse, U as MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, V as IdFlowStep, W as MANUAL_UPLOAD_MAX_RETRIES, X as DetectionOrientation, Y as UploadIdResponse, Z as IdCaptureSettings, _ as uploadIdImage, a as IdCaptureInitResult, b as CreateIdCaptureActorOptions, c as UploadIdImageParams, d as initializeIdCapture, f as preloadIdRecordingProvider, g as stopStream, h as stopRecording, j as IdCaptureContext, k as ID_ERROR_CODES, l as UploadManualIdFileParams, m as startRecordingSession, n as IdCaptureState, o as InitializeIdCaptureParams, p as processId, q as ManualUploadTab, r as createIdCaptureManager, s as StartRecordingParams, t as IdCaptureManager, u as ValidationError, v as uploadManualIdFile, w as idCaptureMachine, x as IdCaptureActor, y as validateUploadResponse, z as IdError } from "./idCaptureManager-B_dajBGr.js";
|
|
11
11
|
export { CameraStream, CaptureIdResponse, CapturedImage, type CreateIdCaptureActorOptions, DetectionArea, DetectionOrientation, DetectionStatus, ID_ERROR_CODES, type IdCaptureActor, IdCaptureConfig, type IdCaptureContext, IdCaptureDependencies, type IdCaptureEvent, IdCaptureGeometry, IdCaptureInitResult, type IdCaptureInput, type IdCaptureMachine, type IdCaptureManager, IdCaptureMode, IdCaptureSettings, type IdCaptureState, IdCaptureThresholds, IdDocumentType, IdError, IdErrorCode, IdFlowStep, InitializeIdCaptureParams, MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, MANUAL_UPLOAD_MAX_RETRIES, ManualUploadContext, ManualUploadSide, ManualUploadTab, PermissionResult, PermissionStatus, RecordingSession, StartRecordingParams, UploadIdImageParams, UploadIdResponse, UploadManualIdFileParams, ValidationError, createIdCaptureActor, createIdCaptureManager, idCaptureMachine, initializeIdCapture, preloadIdRecordingProvider, processId, startRecordingSession, stopRecording, stopStream, uploadIdImage, uploadManualIdFile, validateUploadResponse };
|
package/dist/id.esm.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import "./BaseWasmProvider-
|
|
2
|
-
import "./api-
|
|
3
|
-
import "./events-
|
|
4
|
-
import "./session-
|
|
5
|
-
import "./IpifyProvider-
|
|
6
|
-
import "./browserSimulation-
|
|
7
|
-
import "./xstate.esm-
|
|
8
|
-
import "./BrowserStorageProvider-
|
|
9
|
-
import "./recordingService-
|
|
10
|
-
import "./deepsightService-
|
|
11
|
-
import "./permissionServices-
|
|
12
|
-
import "./camera-
|
|
13
|
-
import "./getBrowser-
|
|
14
|
-
import "./stats-
|
|
15
|
-
import "./MotionSensorProvider-
|
|
16
|
-
import "./platform-
|
|
17
|
-
import "./ITimerCapability-
|
|
18
|
-
import "./backCameraStream-
|
|
19
|
-
import "./getDeviceClass-
|
|
20
|
-
import "./BrowserTimerProvider-
|
|
21
|
-
import { a as startRecordingSession, c as uploadIdImage, d as ID_ERROR_CODES, f as MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, i as processId, l as uploadManualIdFile, m as MANUAL_UPLOAD_MAX_RETRIES, n as initializeIdCapture, o as stopRecording, p as MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, r as preloadIdRecordingProvider, s as stopStream, t as idCaptureMachine, u as validateUploadResponse } from "./idCaptureStateMachine-
|
|
22
|
-
import { r as createIdCaptureActor, t as createIdCaptureManager } from "./idCaptureManager-
|
|
1
|
+
import "./BaseWasmProvider-DsxKeFBt.esm.js";
|
|
2
|
+
import "./api-Bv7xXuMw.esm.js";
|
|
3
|
+
import "./events-BYuumPiB.esm.js";
|
|
4
|
+
import "./session-CEsW15cJ.esm.js";
|
|
5
|
+
import "./IpifyProvider-BRMpdf22.esm.js";
|
|
6
|
+
import "./browserSimulation-CB1iKoSy.esm.js";
|
|
7
|
+
import "./xstate.esm-DGcAhoQP.esm.js";
|
|
8
|
+
import "./BrowserStorageProvider-D99-O_Kf.esm.js";
|
|
9
|
+
import "./recordingService-CpbeUNqo.esm.js";
|
|
10
|
+
import "./deepsightService-BFLmC3ua.esm.js";
|
|
11
|
+
import "./permissionServices-BdE8_Evq.esm.js";
|
|
12
|
+
import "./camera-BEKg9OFz.esm.js";
|
|
13
|
+
import "./getBrowser-COVIk8a4.esm.js";
|
|
14
|
+
import "./stats-DE05K1o9.esm.js";
|
|
15
|
+
import "./MotionSensorProvider-Qfs1LN2o.esm.js";
|
|
16
|
+
import "./platform-bAk6j4kV.esm.js";
|
|
17
|
+
import "./ITimerCapability-DUFfKzTs.esm.js";
|
|
18
|
+
import "./backCameraStream-CrljCJ-Q.esm.js";
|
|
19
|
+
import "./getDeviceClass-B_Y-Y-zj.esm.js";
|
|
20
|
+
import "./BrowserTimerProvider-Dl6dq0R8.esm.js";
|
|
21
|
+
import { a as startRecordingSession, c as uploadIdImage, d as ID_ERROR_CODES, f as MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, i as processId, l as uploadManualIdFile, m as MANUAL_UPLOAD_MAX_RETRIES, n as initializeIdCapture, o as stopRecording, p as MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, r as preloadIdRecordingProvider, s as stopStream, t as idCaptureMachine, u as validateUploadResponse } from "./idCaptureStateMachine-CgddydGJ.esm.js";
|
|
22
|
+
import { r as createIdCaptureActor, t as createIdCaptureManager } from "./idCaptureManager-DvJEDPBW.esm.js";
|
|
23
23
|
|
|
24
24
|
export { ID_ERROR_CODES, MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, MANUAL_UPLOAD_MAX_RETRIES, createIdCaptureActor, createIdCaptureManager, idCaptureMachine, initializeIdCapture, preloadIdRecordingProvider, processId, startRecordingSession, stopRecording, stopStream, uploadIdImage, uploadManualIdFile, validateUploadResponse };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as Manager } from "./Manager-
|
|
2
|
-
import { t as ActorRefFrom } from "./Actor-
|
|
3
|
-
import { n as StateMachine, t as AnyStateMachine } from "./StateMachine-
|
|
4
|
-
import { t as CameraStream } from "./camera-
|
|
5
|
-
import { a as RegulationTypes, n as Flow, o as TutorialIdConfig } from "./types-
|
|
6
|
-
import { c as IMLProviderCapability, d as IRecordingCapability, f as RecordingConnection, i as IncodeCanvas, l as MLProviderConfig, n as IMotionSensorCapability, r as StreamCanvasCapture, t as DeepsightService, u as IStorageCapability } from "./deepsightService-
|
|
7
|
-
import { n as PermissionStatus, t as PermissionResult } from "./types-
|
|
1
|
+
import { t as Manager } from "./Manager-BmmucBrC.js";
|
|
2
|
+
import { t as ActorRefFrom } from "./Actor-gwS4PQSi.js";
|
|
3
|
+
import { n as StateMachine, t as AnyStateMachine } from "./StateMachine-B1c7OspS.js";
|
|
4
|
+
import { t as CameraStream } from "./camera-CXfeCsaz.js";
|
|
5
|
+
import { a as RegulationTypes, n as Flow, o as TutorialIdConfig } from "./types-BelKmTqU.js";
|
|
6
|
+
import { c as IMLProviderCapability, d as IRecordingCapability, f as RecordingConnection, i as IncodeCanvas, l as MLProviderConfig, n as IMotionSensorCapability, r as StreamCanvasCapture, t as DeepsightService, u as IStorageCapability } from "./deepsightService-BAbwxVdZ.js";
|
|
7
|
+
import { n as PermissionStatus, t as PermissionResult } from "./types-nURQ3pMv.js";
|
|
8
8
|
|
|
9
9
|
//#region ../infra/src/capabilities/IIdCaptureCapability.d.ts
|
|
10
10
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as eventModuleNames, o as createManagerInstrumentation, r as eventScreenNames } from "./events-
|
|
2
|
-
import { a as createActor, o as createManager } from "./xstate.esm-
|
|
3
|
-
import { t as BrowserStorageProvider } from "./BrowserStorageProvider-
|
|
4
|
-
import { t as idCaptureMachine } from "./idCaptureStateMachine-
|
|
1
|
+
import { n as eventModuleNames, o as createManagerInstrumentation, r as eventScreenNames } from "./events-BYuumPiB.esm.js";
|
|
2
|
+
import { a as createActor, o as createManager } from "./xstate.esm-DGcAhoQP.esm.js";
|
|
3
|
+
import { t as BrowserStorageProvider } from "./BrowserStorageProvider-D99-O_Kf.esm.js";
|
|
4
|
+
import { t as idCaptureMachine } from "./idCaptureStateMachine-CgddydGJ.esm.js";
|
|
5
5
|
|
|
6
6
|
//#region src/modules/id/idCaptureActor.ts
|
|
7
7
|
function createIdCaptureActor(options) {
|
package/dist/{idCaptureStateMachine-B1eBofuq.esm.js → idCaptureStateMachine-CgddydGJ.esm.js}
RENAMED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { a as IdCaptureModelType, i as WasmPipelineType, r as mlWasmJSApi_default, t as BaseWasmProvider } from "./BaseWasmProvider-
|
|
2
|
-
import { r as getToken, t as api } from "./api-
|
|
3
|
-
import { _ as endpoints,
|
|
4
|
-
import { t as getDisableIpify } from "./session-
|
|
5
|
-
import { i as fromPromise, n as assign, r as fromCallback, t as setup } from "./xstate.esm-
|
|
6
|
-
import { _ as StreamCanvasCapture, d as createRecordingSession, f as startRecording, g as flagIdManualReview, m as StreamCanvasProcessingSession, n as preloadOpenViduProvider, p as stopRecording$1 } from "./recordingService-
|
|
7
|
-
import { n as IncodeCanvas } from "./deepsightService-
|
|
8
|
-
import { n as requestPermission, r as clearCameraPermissionCache, t as checkPermission } from "./permissionServices-
|
|
9
|
-
import { r as getWindowDimensions } from "./getBrowser-
|
|
10
|
-
import { t as addDeviceStats } from "./stats-
|
|
11
|
-
import { n as isDesktop } from "./platform-
|
|
12
|
-
import { t as getBackCameraStream } from "./backCameraStream-
|
|
13
|
-
import { t as getDeviceClass } from "./getDeviceClass-
|
|
14
|
-
import { t as BrowserTimerProvider } from "./BrowserTimerProvider-
|
|
1
|
+
import { a as IdCaptureModelType, i as WasmPipelineType, r as mlWasmJSApi_default, t as BaseWasmProvider } from "./BaseWasmProvider-DsxKeFBt.esm.js";
|
|
2
|
+
import { r as getToken, t as api } from "./api-Bv7xXuMw.esm.js";
|
|
3
|
+
import { _ as endpoints, y as revokeObjectURL } from "./events-BYuumPiB.esm.js";
|
|
4
|
+
import { t as getDisableIpify } from "./session-CEsW15cJ.esm.js";
|
|
5
|
+
import { i as fromPromise, n as assign, r as fromCallback, t as setup } from "./xstate.esm-DGcAhoQP.esm.js";
|
|
6
|
+
import { _ as StreamCanvasCapture, d as createRecordingSession, f as startRecording, g as flagIdManualReview, m as StreamCanvasProcessingSession, n as preloadOpenViduProvider, p as stopRecording$1 } from "./recordingService-CpbeUNqo.esm.js";
|
|
7
|
+
import { n as IncodeCanvas } from "./deepsightService-BFLmC3ua.esm.js";
|
|
8
|
+
import { n as requestPermission, r as clearCameraPermissionCache, t as checkPermission } from "./permissionServices-BdE8_Evq.esm.js";
|
|
9
|
+
import { r as getWindowDimensions } from "./getBrowser-COVIk8a4.esm.js";
|
|
10
|
+
import { t as addDeviceStats } from "./stats-DE05K1o9.esm.js";
|
|
11
|
+
import { n as isDesktop } from "./platform-bAk6j4kV.esm.js";
|
|
12
|
+
import { t as getBackCameraStream } from "./backCameraStream-CrljCJ-Q.esm.js";
|
|
13
|
+
import { t as getDeviceClass } from "./getDeviceClass-B_Y-Y-zj.esm.js";
|
|
14
|
+
import { t as BrowserTimerProvider } from "./BrowserTimerProvider-Dl6dq0R8.esm.js";
|
|
15
15
|
|
|
16
16
|
//#region src/modules/id/idCaptureHelpers.ts
|
|
17
17
|
/**
|
|
@@ -429,7 +429,7 @@ function preloadIdRecordingProvider(config) {
|
|
|
429
429
|
preloadOpenViduProvider();
|
|
430
430
|
}
|
|
431
431
|
async function createOpenViduRecordingProvider() {
|
|
432
|
-
const { OpenViduRecordingProvider } = await import("./OpenViduRecordingProvider-
|
|
432
|
+
const { OpenViduRecordingProvider } = await import("./OpenViduRecordingProvider-7PqRexCU.esm.js");
|
|
433
433
|
return new OpenViduRecordingProvider();
|
|
434
434
|
}
|
|
435
435
|
async function startRecordingSession(params) {
|
|
@@ -841,7 +841,7 @@ const checkMotionSensorActor = fromCallback(({ input, sendBack }) => {
|
|
|
841
841
|
});
|
|
842
842
|
const initializeDeepsightSessionActor = fromPromise(async ({ input }) => {
|
|
843
843
|
if (!input.dependencies) return;
|
|
844
|
-
const { loadDeepsightSession } = await import("./deepsightLoader-
|
|
844
|
+
const { loadDeepsightSession } = await import("./deepsightLoader-QMFaZ2jE.esm.js");
|
|
845
845
|
return loadDeepsightSession({
|
|
846
846
|
ds: input.ds,
|
|
847
847
|
storage: input.dependencies.storage,
|