@incodetech/core 2.0.0-alpha.8 → 2.0.0-rc.0
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/Actor-CI32dTbG.d.ts +2 -0
- package/dist/BaseWasmProvider-C_DLEI40.esm.js +1118 -0
- package/dist/BrowserStorageProvider-CuOW1Er2.esm.js +55 -0
- package/dist/BrowserTimerProvider-DhNc_x02.esm.js +22 -0
- package/dist/ITimerCapability-C67ZRskg.esm.js +7 -0
- package/dist/IpifyProvider-D7jx52AL.esm.js +139 -0
- package/dist/MotionSensorProvider-4v7xkqAp.esm.js +254 -0
- package/dist/OpenViduRecordingProvider-CMu6XVdc.esm.js +87 -0
- package/dist/StateMachine-BCQrZJhf.d.ts +2 -0
- package/dist/WasmUtilProvider-j98OJf-S.esm.js +114 -0
- package/dist/addressSearch-BpTbTWCa.esm.js +430 -0
- package/dist/ae-signature-DDDZmWXj.esm.js +12 -0
- package/dist/ae-signature.d.ts +25 -0
- package/dist/ae-signature.esm.js +8 -0
- package/dist/antifraud.d.ts +57 -0
- package/dist/antifraud.esm.js +45 -0
- package/dist/antifraudStateMachine-O0TMf6yc.esm.js +39 -0
- package/dist/api-CESGtpbH.esm.js +53 -0
- package/dist/authentication.d.ts +12 -0
- package/dist/authentication.esm.js +25 -0
- package/dist/authenticationManager-5M-fKzXx.esm.js +67 -0
- package/dist/authenticationManager-C83GNIhl.d.ts +66 -0
- package/dist/authenticationStateMachine-BMZqatiF.esm.js +139 -0
- package/dist/backCameraStream-DMdMeGk2.esm.js +346 -0
- package/dist/browserSimulation-gxD8cSpM.esm.js +20 -0
- package/dist/camera-DBSxa6ML.d.ts +4 -0
- package/dist/camera-PA2Ljri3.esm.js +22 -0
- package/dist/camera.d.ts +15 -0
- package/dist/camera.esm.js +5 -0
- package/dist/consent.d.ts +398 -0
- package/dist/consent.esm.js +79 -0
- package/dist/consentStateMachine-CCT-B60O.esm.js +151 -0
- package/dist/cpf-PPz2Njto.esm.js +38 -0
- package/dist/cpf-ocr.d.ts +204 -0
- package/dist/cpf-ocr.esm.js +177 -0
- package/dist/cross-document-data-match.d.ts +34 -0
- package/dist/cross-document-data-match.esm.js +71 -0
- package/dist/curp-validation.d.ts +188 -0
- package/dist/curp-validation.esm.js +110 -0
- package/dist/curpValidationStateMachine-CitWLr2c.esm.js +595 -0
- package/dist/custom-fields.d.ts +115 -0
- package/dist/custom-fields.esm.js +177 -0
- package/dist/custom-watchlist.d.ts +66 -0
- package/dist/custom-watchlist.esm.js +86 -0
- package/dist/dateUtils-UoN5xswP.esm.js +23 -0
- package/dist/deepsightLoader-Cm4JIT_z.esm.js +52 -0
- package/dist/deepsightService-CEVxzehb.d.ts +412 -0
- package/dist/deepsightService-O74l4Y__.esm.js +489 -0
- package/dist/device.d.ts +46 -0
- package/dist/device.esm.js +106 -0
- package/dist/displayErrors-DqJ_IbsG.d.ts +39 -0
- package/dist/document-capture.d.ts +906 -0
- package/dist/document-capture.esm.js +156 -0
- package/dist/document-upload.d.ts +331 -0
- package/dist/document-upload.esm.js +203 -0
- package/dist/documentCaptureStateMachine-BqzTDy9k.esm.js +394 -0
- package/dist/dynamic-forms.d.ts +178 -0
- package/dist/dynamic-forms.esm.js +323 -0
- package/dist/ekyb.d.ts +148 -0
- package/dist/ekyb.esm.js +127 -0
- package/dist/ekybStateMachine-B59rQjgj.esm.js +674 -0
- package/dist/ekyc.d.ts +164 -0
- package/dist/ekyc.esm.js +104 -0
- package/dist/ekycStateMachine-oeO0Iekd.esm.js +10626 -0
- package/dist/electronic-signature.d.ts +4 -0
- package/dist/electronic-signature.esm.js +7 -0
- package/dist/electronicSignatureManager-D9OHzTpG.esm.js +428 -0
- package/dist/email.d.ts +3 -263
- package/dist/email.esm.js +7 -477
- package/dist/emailManager-DIfnS5g1.d.ts +352 -0
- package/dist/emailManager-wAV0LE-H.esm.js +238 -0
- package/dist/emailStateMachine-DOf4j58N.esm.js +292 -0
- package/dist/endpoints-CnN3SyDa.esm.js +87 -0
- package/dist/events-D6-e4vok.esm.js +596 -0
- package/dist/events.d.ts +265 -0
- package/dist/events.esm.js +4 -0
- package/dist/extensibility.d.ts +122 -0
- package/dist/extensibility.esm.js +43 -0
- package/dist/face-match.d.ts +228 -0
- package/dist/face-match.esm.js +173 -0
- package/dist/faceCaptureManagerFactory-Dh2PdGlF.esm.js +290 -0
- package/dist/faceCaptureManagerFactory-yqtpxjnN.d.ts +690 -0
- package/dist/faceCaptureSetup-B3faSpYA.esm.js +873 -0
- package/dist/faceMatchStateMachine-DNFrxTFS.esm.js +127 -0
- package/dist/flow-events.d.ts +6 -0
- package/dist/flow-events.esm.js +0 -0
- package/dist/flow.d.ts +101 -321
- package/dist/flow.esm.js +370 -173
- package/dist/flowCompletionService-DhkT4SRY.d.ts +10 -0
- package/dist/flowCompletionService-P54yzGvA.esm.js +13 -0
- package/dist/flowServices-DTsm-Vf1.esm.js +188 -0
- package/dist/geolocation.d.ts +127 -0
- package/dist/geolocation.esm.js +89 -0
- package/dist/geolocationStateMachine-asasuHY2.esm.js +105 -0
- package/dist/getBrowser-BSXUTWXw.esm.js +41 -0
- package/dist/getDeviceClass-BSntT9_j.esm.js +14 -0
- package/dist/government-validation.d.ts +67 -0
- package/dist/government-validation.esm.js +81 -0
- package/dist/governmentValidationStateMachine-BDDYrJTo.esm.js +271 -0
- package/dist/home.d.ts +99 -0
- package/dist/home.esm.js +61 -0
- package/dist/http.d.ts +68 -0
- package/dist/http.esm.js +3 -0
- package/dist/id-ocr.d.ts +635 -0
- package/dist/id-ocr.esm.js +86 -0
- package/dist/id-verification.d.ts +190 -0
- package/dist/id-verification.esm.js +43 -0
- package/dist/id.d.ts +24 -0
- package/dist/id.esm.js +164 -0
- package/dist/idCaptureManager-B9TGA5dq.d.ts +956 -0
- package/dist/idCaptureManager-DMK0GIt3.esm.js +581 -0
- package/dist/idCaptureStateMachine-Bq0fVZXl.esm.js +2954 -0
- package/dist/idOcrStateMachine-YbjjC_Gg.esm.js +388 -0
- package/dist/idVerificationStateMachine-xbw9HP1Z.esm.js +71 -0
- package/dist/identity-reuse.d.ts +530 -0
- package/dist/identity-reuse.esm.js +274 -0
- package/dist/index-BLKtMA0g.d.ts +1177 -0
- package/dist/index-BcRG8rtJ.d.ts +97 -0
- package/dist/index.d.ts +3 -226
- package/dist/index.esm.js +11 -154
- package/dist/invokeOnCaptureCallback-rc6kBHo5.esm.js +30 -0
- package/dist/{lib-Bu9XGMBW.esm.js → lib-BB0B_qQX.esm.js} +801 -2
- package/dist/mandatory-consent.d.ts +412 -0
- package/dist/mandatory-consent.esm.js +78 -0
- package/dist/mandatoryConsentStateMachine-Cnco1jvn.esm.js +126 -0
- package/dist/openviduLazy-Cm0XFh_v.esm.js +3 -0
- package/dist/openviduLazy-Cok70ZSg.esm.js +12 -0
- package/dist/permissionServices-D_i6nzEw.esm.js +50 -0
- package/dist/phone.d.ts +3 -291
- package/dist/phone.esm.js +7 -548
- package/dist/phoneManager-B6M30hKE.d.ts +397 -0
- package/dist/phoneManager-DAJbGhlY.esm.js +256 -0
- package/dist/phoneStateMachine-CuPARRaT.esm.js +351 -0
- package/dist/platform-CfrjKhmi.esm.js +83 -0
- package/dist/qe-signature-DFo_Cc-I.esm.js +12 -0
- package/dist/qe-signature.d.ts +25 -0
- package/dist/qe-signature.esm.js +8 -0
- package/dist/recordingService-Ig2UgbLv.esm.js +1003 -0
- package/dist/redirect-to-mobile.d.ts +107 -0
- package/dist/redirect-to-mobile.esm.js +102 -0
- package/dist/redirectToMobileStateMachine-BOEqe46A.esm.js +249 -0
- package/dist/runChildModule-CqqwqAkW.esm.js +219 -0
- package/dist/selfie.d.ts +21 -754
- package/dist/selfie.esm.js +113 -962
- package/dist/selfieManager-D0lSgd-J.d.ts +68 -0
- package/dist/selfieManager-Duisl7qN.esm.js +60 -0
- package/dist/selfieStateMachine-D76whWEf.esm.js +68 -0
- package/dist/session-BS-d_vuE.esm.js +3206 -0
- package/dist/session.d.ts +217 -0
- package/dist/session.esm.js +9 -0
- package/dist/setup-Buy-hyj4.esm.js +887 -0
- package/dist/setup-C5AITV8m.d.ts +254 -0
- package/dist/signature.d.ts +94 -0
- package/dist/signature.esm.js +66 -0
- package/dist/signatureStateMachine-B5-QVUve.esm.js +132 -0
- package/dist/stats-CIfiPzb1.esm.js +16 -0
- package/dist/stats.d.ts +16 -0
- package/dist/stats.esm.js +4 -0
- package/dist/trust-graph.d.ts +54 -0
- package/dist/trust-graph.esm.js +56 -0
- package/dist/types-B06Ypu2F.d.ts +49 -0
- package/dist/types-BP1m8VRw.d.ts +340 -0
- package/dist/types-CFV9G_7j.d.ts +24 -0
- package/dist/{warmup-CEJTfxQr.d.ts → warmup-CEcppFiS.d.ts} +11 -3
- package/dist/wasm.d.ts +15 -0
- package/dist/wasm.esm.js +12 -0
- package/dist/watchlist-for-business.d.ts +79 -0
- package/dist/watchlist-for-business.esm.js +148 -0
- package/dist/watchlist.d.ts +62 -0
- package/dist/watchlist.esm.js +86 -0
- package/dist/watchlistServices-DMbUhkBX.esm.js +12 -0
- package/dist/workflow.d.ts +907 -0
- package/dist/workflow.esm.js +702 -0
- package/dist/{xstate.esm-B_rda9yU.esm.js → xstate.esm-B70JrNqo.esm.js} +144 -1
- package/package.json +203 -6
- package/dist/OpenViduLogger-BdPfiZO6.esm.js +0 -3
- package/dist/OpenViduLogger-CQyDxBvM.esm.js +0 -803
- package/dist/StateMachine-DRE1oH2B.d.ts +0 -2
- package/dist/addEvent-W0ORK0jT.esm.js +0 -16
- package/dist/endpoints-BSTFaHYo.esm.js +0 -1706
- package/dist/permissionServices-I6vX6DBy.esm.js +0 -72
- /package/dist/{Manager-BGfxEmyv.d.ts → Manager-C8PrhBOx.d.ts} +0 -0
- /package/dist/{chunk-C_Yo44FK.esm.js → chunk-CRF6K_H_.esm.js} +0 -0
- /package/dist/{types-iZi2rawo.d.ts → types-CAD4va6a.d.ts} +0 -0
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
import { t as BrowserTimerProvider } from "./BrowserTimerProvider-DhNc_x02.esm.js";
|
|
2
|
+
import { t as api } from "./api-CESGtpbH.esm.js";
|
|
3
|
+
import { t as endpoints } from "./endpoints-CnN3SyDa.esm.js";
|
|
4
|
+
import { a as fromPromise, i as fromCallback, r as assign, t as setup } from "./xstate.esm-B70JrNqo.esm.js";
|
|
5
|
+
|
|
6
|
+
//#region src/modules/phone/phoneServices.ts
|
|
7
|
+
function getPhoneServerFailureReason(error, invalidStatus) {
|
|
8
|
+
if (error.status === invalidStatus) return "invalidPhone";
|
|
9
|
+
return "serverError";
|
|
10
|
+
}
|
|
11
|
+
async function fetchPhone(signal) {
|
|
12
|
+
const res = await api.get(endpoints.getPhone, { signal });
|
|
13
|
+
if (!res.ok) throw new Error(`GET ${endpoints.getPhone} failed: ${res.status} ${res.statusText}`);
|
|
14
|
+
return res.data;
|
|
15
|
+
}
|
|
16
|
+
async function fetchStartInfo(signal) {
|
|
17
|
+
const res = await api.get(endpoints.startInfo, { signal });
|
|
18
|
+
if (!res.ok) throw new Error(`GET ${endpoints.startInfo} failed: ${res.status} ${res.statusText}`);
|
|
19
|
+
return res.data;
|
|
20
|
+
}
|
|
21
|
+
async function addPhone(params, signal) {
|
|
22
|
+
try {
|
|
23
|
+
return (await api.post(endpoints.phone, {
|
|
24
|
+
phone: params.phone,
|
|
25
|
+
optInGranted: params.optInGranted
|
|
26
|
+
}, { signal })).data;
|
|
27
|
+
} catch (error) {
|
|
28
|
+
throw new Error(getPhoneServerFailureReason(error, 400));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
async function addPhoneInstantVerify(params, signal) {
|
|
32
|
+
try {
|
|
33
|
+
return (await api.post(endpoints.phoneInstant, {
|
|
34
|
+
phone: params.phone,
|
|
35
|
+
optInGranted: params.optInGranted
|
|
36
|
+
}, { signal })).data;
|
|
37
|
+
} catch (error) {
|
|
38
|
+
throw new Error(getPhoneServerFailureReason(error, 400));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
async function sendOtp(signal) {
|
|
42
|
+
try {
|
|
43
|
+
await api.get(`${endpoints.sendSmsOtp}?communicationchannel=SMS`, { signal });
|
|
44
|
+
} catch (error) {
|
|
45
|
+
throw new Error(getPhoneServerFailureReason(error));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async function verifyOtp(code, signal) {
|
|
49
|
+
try {
|
|
50
|
+
return (await api.get(`${endpoints.compareOtp}?code=${code}&channel=SMS`, { signal })).data;
|
|
51
|
+
} catch (error) {
|
|
52
|
+
throw new Error(getPhoneServerFailureReason(error));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/modules/phone/phoneStateMachine.ts
|
|
58
|
+
const RESEND_TIMER_SECONDS = 30;
|
|
59
|
+
function getErrorMessage(error) {
|
|
60
|
+
if (error instanceof Error) return error.message;
|
|
61
|
+
return String(error);
|
|
62
|
+
}
|
|
63
|
+
const phoneMachine = setup({
|
|
64
|
+
types: {
|
|
65
|
+
context: {},
|
|
66
|
+
events: {},
|
|
67
|
+
input: {}
|
|
68
|
+
},
|
|
69
|
+
actors: {
|
|
70
|
+
fetchPhone: fromPromise(async ({ signal }) => {
|
|
71
|
+
return fetchPhone(signal);
|
|
72
|
+
}),
|
|
73
|
+
fetchStartInfo: fromPromise(async ({ signal }) => {
|
|
74
|
+
return fetchStartInfo(signal);
|
|
75
|
+
}),
|
|
76
|
+
submitPhone: fromPromise(async ({ input, signal }) => {
|
|
77
|
+
if (input.isInstantVerify) return addPhoneInstantVerify({
|
|
78
|
+
phone: input.phone,
|
|
79
|
+
optInGranted: input.optInGranted
|
|
80
|
+
}, signal);
|
|
81
|
+
return addPhone({
|
|
82
|
+
phone: input.phone,
|
|
83
|
+
optInGranted: input.optInGranted
|
|
84
|
+
}, signal);
|
|
85
|
+
}),
|
|
86
|
+
sendOtp: fromPromise(async ({ signal }) => {
|
|
87
|
+
return sendOtp(signal);
|
|
88
|
+
}),
|
|
89
|
+
verifyOtp: fromPromise(async ({ input, signal }) => {
|
|
90
|
+
return verifyOtp(input.code, signal);
|
|
91
|
+
}),
|
|
92
|
+
resendTimer: fromCallback(({ input, sendBack }) => {
|
|
93
|
+
const timer = BrowserTimerProvider.getInstance();
|
|
94
|
+
let remaining = input.seconds;
|
|
95
|
+
if (remaining <= 0) return () => {};
|
|
96
|
+
const interval = timer.setInterval(() => {
|
|
97
|
+
sendBack({ type: "TICK" });
|
|
98
|
+
remaining -= 1;
|
|
99
|
+
if (remaining <= 0) timer.clearInterval(interval);
|
|
100
|
+
}, 1e3);
|
|
101
|
+
return () => timer.clearInterval(interval);
|
|
102
|
+
})
|
|
103
|
+
},
|
|
104
|
+
actions: {
|
|
105
|
+
setStartInfo: assign(({ event }) => {
|
|
106
|
+
const info = event.output;
|
|
107
|
+
return {
|
|
108
|
+
startInfo: info,
|
|
109
|
+
countryCode: info.ipIsoCode,
|
|
110
|
+
phonePrefix: info.phonePrefix
|
|
111
|
+
};
|
|
112
|
+
}),
|
|
113
|
+
setPrefilledPhone: assign(({ event }) => {
|
|
114
|
+
const phone = event.output.phone;
|
|
115
|
+
return {
|
|
116
|
+
prefilledPhone: phone,
|
|
117
|
+
phone
|
|
118
|
+
};
|
|
119
|
+
}),
|
|
120
|
+
setPhone: assign(({ event }) => {
|
|
121
|
+
const e = event;
|
|
122
|
+
return {
|
|
123
|
+
phone: e.phone,
|
|
124
|
+
isValid: e.isValid,
|
|
125
|
+
phoneError: void 0
|
|
126
|
+
};
|
|
127
|
+
}),
|
|
128
|
+
setPhoneError: assign(({ event }) => ({ phoneError: getErrorMessage(event.error) })),
|
|
129
|
+
setOptInGranted: assign(({ event }) => ({ optInGranted: event.granted })),
|
|
130
|
+
setError: assign(({ event }) => ({ error: getErrorMessage(event.error) })),
|
|
131
|
+
clearError: assign({ error: () => void 0 }),
|
|
132
|
+
clearPhoneError: assign({ phoneError: () => void 0 }),
|
|
133
|
+
setOtpCode: assign(({ event }) => ({
|
|
134
|
+
otpCode: event.code,
|
|
135
|
+
otpError: void 0
|
|
136
|
+
})),
|
|
137
|
+
setOtpError: assign(({ context, event }) => ({
|
|
138
|
+
otpError: getErrorMessage(event.error),
|
|
139
|
+
attemptsRemaining: context.attemptsRemaining - 1
|
|
140
|
+
})),
|
|
141
|
+
setOtpRequestError: assign(({ event }) => ({ otpError: getErrorMessage(event.error) })),
|
|
142
|
+
clearOtpError: assign({
|
|
143
|
+
otpError: () => void 0,
|
|
144
|
+
otpCode: () => ""
|
|
145
|
+
}),
|
|
146
|
+
startResendTimer: assign({
|
|
147
|
+
resendTimer: () => RESEND_TIMER_SECONDS,
|
|
148
|
+
resendTimerActive: () => true
|
|
149
|
+
}),
|
|
150
|
+
tickResendTimer: assign(({ context }) => {
|
|
151
|
+
const newTimer = Math.max(0, context.resendTimer - 1);
|
|
152
|
+
return {
|
|
153
|
+
resendTimer: newTimer,
|
|
154
|
+
resendTimerActive: newTimer > 0
|
|
155
|
+
};
|
|
156
|
+
}),
|
|
157
|
+
resetContext: assign(({ context }) => ({
|
|
158
|
+
config: context.config,
|
|
159
|
+
phone: "",
|
|
160
|
+
isValid: false,
|
|
161
|
+
phoneError: void 0,
|
|
162
|
+
countryCode: "",
|
|
163
|
+
phonePrefix: "",
|
|
164
|
+
prefilledPhone: void 0,
|
|
165
|
+
optInGranted: false,
|
|
166
|
+
startInfo: void 0,
|
|
167
|
+
error: void 0,
|
|
168
|
+
otpCode: "",
|
|
169
|
+
otpError: void 0,
|
|
170
|
+
attemptsRemaining: context.config.maxOtpAttempts ?? 3,
|
|
171
|
+
resendTimer: 0,
|
|
172
|
+
resendTimerActive: false
|
|
173
|
+
}))
|
|
174
|
+
},
|
|
175
|
+
guards: {
|
|
176
|
+
hasPrefill: ({ context }) => context.config.prefill,
|
|
177
|
+
hasOtpVerification: ({ context }) => context.config.otpVerification,
|
|
178
|
+
isValidPhone: ({ context }) => context.isValid,
|
|
179
|
+
hasAttemptsRemaining: ({ context }) => context.attemptsRemaining > 1,
|
|
180
|
+
canResend: ({ context }) => !context.resendTimerActive
|
|
181
|
+
}
|
|
182
|
+
}).createMachine({
|
|
183
|
+
id: "phone",
|
|
184
|
+
initial: "idle",
|
|
185
|
+
context: ({ input }) => ({
|
|
186
|
+
config: input.config,
|
|
187
|
+
phone: "",
|
|
188
|
+
isValid: false,
|
|
189
|
+
phoneError: void 0,
|
|
190
|
+
countryCode: "",
|
|
191
|
+
phonePrefix: "",
|
|
192
|
+
prefilledPhone: void 0,
|
|
193
|
+
optInGranted: false,
|
|
194
|
+
startInfo: void 0,
|
|
195
|
+
error: void 0,
|
|
196
|
+
otpCode: "",
|
|
197
|
+
otpError: void 0,
|
|
198
|
+
attemptsRemaining: input.config.maxOtpAttempts ?? 3,
|
|
199
|
+
resendTimer: 0,
|
|
200
|
+
resendTimerActive: false
|
|
201
|
+
}),
|
|
202
|
+
states: {
|
|
203
|
+
idle: { on: { LOAD: [{
|
|
204
|
+
target: "loadingPrefill",
|
|
205
|
+
guard: "hasPrefill"
|
|
206
|
+
}, { target: "loadingStartInfo" }] } },
|
|
207
|
+
loadingPrefill: { invoke: {
|
|
208
|
+
id: "fetchPhone",
|
|
209
|
+
src: "fetchPhone",
|
|
210
|
+
onDone: {
|
|
211
|
+
target: "loadingStartInfo",
|
|
212
|
+
actions: "setPrefilledPhone"
|
|
213
|
+
},
|
|
214
|
+
onError: { target: "loadingStartInfo" }
|
|
215
|
+
} },
|
|
216
|
+
loadingStartInfo: { invoke: {
|
|
217
|
+
id: "fetchStartInfo",
|
|
218
|
+
src: "fetchStartInfo",
|
|
219
|
+
onDone: {
|
|
220
|
+
target: "inputting",
|
|
221
|
+
actions: "setStartInfo"
|
|
222
|
+
},
|
|
223
|
+
onError: { target: "inputting" }
|
|
224
|
+
} },
|
|
225
|
+
inputting: { on: {
|
|
226
|
+
PHONE_CHANGED: { actions: "setPhone" },
|
|
227
|
+
OPT_IN_CHANGED: { actions: "setOptInGranted" },
|
|
228
|
+
SUBMIT: {
|
|
229
|
+
target: "submitting",
|
|
230
|
+
guard: "isValidPhone",
|
|
231
|
+
actions: "clearPhoneError"
|
|
232
|
+
}
|
|
233
|
+
} },
|
|
234
|
+
submitting: { invoke: {
|
|
235
|
+
id: "submitPhone",
|
|
236
|
+
src: "submitPhone",
|
|
237
|
+
input: ({ context }) => ({
|
|
238
|
+
phone: context.phone,
|
|
239
|
+
optInGranted: context.config.optinEnabled ? context.optInGranted : void 0,
|
|
240
|
+
isInstantVerify: context.config.isInstantVerify ?? false
|
|
241
|
+
}),
|
|
242
|
+
onDone: [{
|
|
243
|
+
target: "sendingInitialOtp",
|
|
244
|
+
guard: "hasOtpVerification"
|
|
245
|
+
}, { target: "finished" }],
|
|
246
|
+
onError: {
|
|
247
|
+
target: "inputting",
|
|
248
|
+
actions: "setPhoneError"
|
|
249
|
+
}
|
|
250
|
+
} },
|
|
251
|
+
sendingInitialOtp: { invoke: {
|
|
252
|
+
id: "sendOtp",
|
|
253
|
+
src: "sendOtp",
|
|
254
|
+
onDone: {
|
|
255
|
+
target: "awaitingOtp",
|
|
256
|
+
actions: "startResendTimer"
|
|
257
|
+
},
|
|
258
|
+
onError: {
|
|
259
|
+
target: "otpError",
|
|
260
|
+
actions: ["setOtpRequestError", "startResendTimer"]
|
|
261
|
+
}
|
|
262
|
+
} },
|
|
263
|
+
resendingOtp: { invoke: {
|
|
264
|
+
id: "sendOtp",
|
|
265
|
+
src: "sendOtp",
|
|
266
|
+
onDone: {
|
|
267
|
+
target: "awaitingOtp",
|
|
268
|
+
actions: "startResendTimer"
|
|
269
|
+
},
|
|
270
|
+
onError: {
|
|
271
|
+
target: "otpError",
|
|
272
|
+
actions: ["setOtpRequestError", "startResendTimer"]
|
|
273
|
+
}
|
|
274
|
+
} },
|
|
275
|
+
awaitingOtp: {
|
|
276
|
+
invoke: {
|
|
277
|
+
id: "resendTimer",
|
|
278
|
+
src: "resendTimer",
|
|
279
|
+
input: ({ context }) => ({ seconds: context.resendTimer })
|
|
280
|
+
},
|
|
281
|
+
on: {
|
|
282
|
+
TICK: { actions: "tickResendTimer" },
|
|
283
|
+
OTP_CHANGED: { actions: "setOtpCode" },
|
|
284
|
+
VERIFY_OTP: { target: "verifyingOtp" },
|
|
285
|
+
RESEND_OTP: {
|
|
286
|
+
target: "resendingOtp",
|
|
287
|
+
guard: "canResend"
|
|
288
|
+
},
|
|
289
|
+
BACK: { target: "inputting" }
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
verifyingOtp: { invoke: {
|
|
293
|
+
id: "verifyOtp",
|
|
294
|
+
src: "verifyOtp",
|
|
295
|
+
input: ({ context }) => ({ code: context.otpCode }),
|
|
296
|
+
onDone: [
|
|
297
|
+
{
|
|
298
|
+
target: "finished",
|
|
299
|
+
guard: ({ event }) => event.output.success === true
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
target: "otpError",
|
|
303
|
+
guard: "hasAttemptsRemaining",
|
|
304
|
+
actions: assign(({ context }) => ({
|
|
305
|
+
otpError: "otp.errorv2",
|
|
306
|
+
attemptsRemaining: context.attemptsRemaining - 1
|
|
307
|
+
}))
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
target: "error",
|
|
311
|
+
actions: assign({ error: () => "Maximum OTP attempts exceeded" })
|
|
312
|
+
}
|
|
313
|
+
],
|
|
314
|
+
onError: [{
|
|
315
|
+
target: "otpError",
|
|
316
|
+
guard: "hasAttemptsRemaining",
|
|
317
|
+
actions: "setOtpError"
|
|
318
|
+
}, {
|
|
319
|
+
target: "error",
|
|
320
|
+
actions: "setError"
|
|
321
|
+
}]
|
|
322
|
+
} },
|
|
323
|
+
otpError: {
|
|
324
|
+
invoke: {
|
|
325
|
+
id: "resendTimer",
|
|
326
|
+
src: "resendTimer",
|
|
327
|
+
input: ({ context }) => ({ seconds: context.resendTimer })
|
|
328
|
+
},
|
|
329
|
+
on: {
|
|
330
|
+
TICK: { actions: "tickResendTimer" },
|
|
331
|
+
OTP_CHANGED: {
|
|
332
|
+
target: "awaitingOtp",
|
|
333
|
+
actions: "setOtpCode"
|
|
334
|
+
},
|
|
335
|
+
RESEND_OTP: {
|
|
336
|
+
target: "resendingOtp",
|
|
337
|
+
guard: "canResend"
|
|
338
|
+
},
|
|
339
|
+
BACK: { target: "inputting" }
|
|
340
|
+
}
|
|
341
|
+
},
|
|
342
|
+
finished: { type: "final" },
|
|
343
|
+
error: { on: { RESET: {
|
|
344
|
+
target: "idle",
|
|
345
|
+
actions: "resetContext"
|
|
346
|
+
} } }
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
|
|
350
|
+
//#endregion
|
|
351
|
+
export { phoneMachine as t };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
//#region ../infra/src/capabilities/platform.ts
|
|
2
|
+
/**
|
|
3
|
+
* Platform detection utilities for camera operations.
|
|
4
|
+
* These are pure functions with no external dependencies and can be used by all layers.
|
|
5
|
+
*/
|
|
6
|
+
let uxType = null;
|
|
7
|
+
function isTouchDevice() {
|
|
8
|
+
return (typeof navigator !== "undefined" ? navigator.maxTouchPoints > 0 : false) || "ontouchstart" in (typeof document !== "undefined" ? document.documentElement : {});
|
|
9
|
+
}
|
|
10
|
+
function isTabletWithoutAndroid(userAgent) {
|
|
11
|
+
const isLinux = /Linux/i.test(userAgent);
|
|
12
|
+
const isChrome = /Chrome/i.test(userAgent) && !/Edge/i.test(userAgent);
|
|
13
|
+
return !/Mobile|Android/i.test(userAgent) && isLinux && isChrome && isTouchDevice();
|
|
14
|
+
}
|
|
15
|
+
function isIOS(userAgent) {
|
|
16
|
+
const ua = userAgent || (typeof navigator !== "undefined" ? navigator.userAgent : "");
|
|
17
|
+
const hasTouchPoints = typeof navigator !== "undefined" ? navigator.maxTouchPoints > 0 : false;
|
|
18
|
+
return /iPad|iPhone|iPod/.test(ua) || /Mac OS/.test(ua) && hasTouchPoints || /iPadOS/.test(ua);
|
|
19
|
+
}
|
|
20
|
+
function isAndroid(userAgent) {
|
|
21
|
+
const ua = userAgent || (typeof navigator !== "undefined" ? navigator.userAgent : "");
|
|
22
|
+
return /Android/i.test(ua);
|
|
23
|
+
}
|
|
24
|
+
function isIPad(userAgent) {
|
|
25
|
+
const ua = userAgent || (typeof navigator !== "undefined" ? navigator.userAgent : "");
|
|
26
|
+
const hasTouchPoints = typeof navigator !== "undefined" ? navigator.maxTouchPoints > 0 : false;
|
|
27
|
+
return /iPad/.test(ua) || /Mac OS/.test(ua) && hasTouchPoints && !/iPhone|iPod/.test(ua);
|
|
28
|
+
}
|
|
29
|
+
function isDesktop(userAgent) {
|
|
30
|
+
if (uxType) return uxType === "desktop";
|
|
31
|
+
const ua = userAgent || (typeof navigator !== "undefined" ? navigator.userAgent : "");
|
|
32
|
+
return !(/Mobile|Android/i.test(ua) || isTabletWithoutAndroid(ua) || isIOS(ua));
|
|
33
|
+
}
|
|
34
|
+
function isSafari(userAgent) {
|
|
35
|
+
const ua = userAgent || (typeof navigator !== "undefined" ? navigator.userAgent : "");
|
|
36
|
+
return /Safari/i.test(ua) && !/Chrome|Chromium|Edge/i.test(ua);
|
|
37
|
+
}
|
|
38
|
+
const IPHONE_14_PLUS_DIMENSIONS = [
|
|
39
|
+
{
|
|
40
|
+
outerHeight: 852,
|
|
41
|
+
outerWidth: 393
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
outerHeight: 932,
|
|
45
|
+
outerWidth: 430
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
innerHeight: 631,
|
|
49
|
+
innerWidth: 375
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
innerHeight: 920,
|
|
53
|
+
innerWidth: 402
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
outerHeight: 874,
|
|
57
|
+
outerWidth: 402
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
innerHeight: 874,
|
|
61
|
+
innerWidth: 402
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
outerHeight: 912,
|
|
65
|
+
outerWidth: 420
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
outerHeight: 873,
|
|
69
|
+
outerWidth: 402
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
outerHeight: 956,
|
|
73
|
+
outerWidth: 440
|
|
74
|
+
}
|
|
75
|
+
];
|
|
76
|
+
function isIPhone14OrHigher() {
|
|
77
|
+
if (typeof window === "undefined") return false;
|
|
78
|
+
const { outerHeight, outerWidth, innerHeight, innerWidth } = window;
|
|
79
|
+
return IPHONE_14_PLUS_DIMENSIONS.some((dims) => dims.outerHeight === outerHeight && dims.outerWidth === outerWidth || dims.innerHeight === innerHeight && dims.innerWidth === innerWidth);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
//#endregion
|
|
83
|
+
export { isIPhone14OrHigher as a, isIPad as i, isDesktop as n, isSafari as o, isIOS as r, isAndroid as t };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { t as createElectronicSignatureManager } from "./electronicSignatureManager-D9OHzTpG.esm.js";
|
|
2
|
+
|
|
3
|
+
//#region src/modules/qe-signature/index.ts
|
|
4
|
+
function createQeSignatureManager(options) {
|
|
5
|
+
return createElectronicSignatureManager({ config: {
|
|
6
|
+
...options.config,
|
|
7
|
+
variant: "qe"
|
|
8
|
+
} });
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { createQeSignatureManager as t };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { t as Manager } from "./Manager-C8PrhBOx.js";
|
|
2
|
+
import "./Actor-CI32dTbG.js";
|
|
3
|
+
import { c as ConsentKey, f as QE_CONSENT_KEYS, g as getDefaultConsentChecks, i as electronicSignatureMachine, l as ElectronicSignatureConfig, m as areAllConsented, n as ElectronicSignatureState, s as ConsentChecks, u as ElectronicSignatureDocument } from "./index-BLKtMA0g.js";
|
|
4
|
+
|
|
5
|
+
//#region src/modules/qe-signature/index.d.ts
|
|
6
|
+
|
|
7
|
+
type QeSignatureConfig = Omit<ElectronicSignatureConfig, 'variant'>;
|
|
8
|
+
declare function createQeSignatureManager(options: {
|
|
9
|
+
config: QeSignatureConfig;
|
|
10
|
+
}): Manager<ElectronicSignatureState> & {
|
|
11
|
+
load(): void;
|
|
12
|
+
setConsent(name: ConsentKey, checked: boolean): void;
|
|
13
|
+
selectFile(fileName: string, fileData: ArrayBuffer, fileUrl: string): void;
|
|
14
|
+
replaceFile(): void;
|
|
15
|
+
confirmFile(): void;
|
|
16
|
+
viewDocument(url: string): void;
|
|
17
|
+
closeDocumentView(): void;
|
|
18
|
+
sign(): void;
|
|
19
|
+
finish(): void;
|
|
20
|
+
retry(): void;
|
|
21
|
+
close(): void;
|
|
22
|
+
};
|
|
23
|
+
type QeSignatureManager = ReturnType<typeof createQeSignatureManager>;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { type ConsentChecks, QE_CONSENT_KEYS, QeSignatureConfig, type ElectronicSignatureDocument as QeSignatureDocument, QeSignatureManager, type ElectronicSignatureState as QeSignatureState, areAllConsented, createQeSignatureManager, getDefaultConsentChecks, electronicSignatureMachine as qeSignatureMachine };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./api-CESGtpbH.esm.js";
|
|
2
|
+
import "./events-D6-e4vok.esm.js";
|
|
3
|
+
import "./endpoints-CnN3SyDa.esm.js";
|
|
4
|
+
import "./xstate.esm-B70JrNqo.esm.js";
|
|
5
|
+
import { a as areAllConsented, i as QE_CONSENT_KEYS, n as electronicSignatureMachine, s as getDefaultConsentChecks } from "./electronicSignatureManager-D9OHzTpG.esm.js";
|
|
6
|
+
import { t as createQeSignatureManager } from "./qe-signature-DFo_Cc-I.esm.js";
|
|
7
|
+
|
|
8
|
+
export { QE_CONSENT_KEYS, areAllConsented, createQeSignatureManager, getDefaultConsentChecks, electronicSignatureMachine as qeSignatureMachine };
|