@incodetech/core 2.0.0-rc.0 → 2.0.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.
Files changed (178) hide show
  1. package/package.json +3 -3
  2. package/dist/Actor-CI32dTbG.d.ts +0 -2
  3. package/dist/BaseWasmProvider-C_DLEI40.esm.js +0 -1118
  4. package/dist/BrowserStorageProvider-CuOW1Er2.esm.js +0 -55
  5. package/dist/BrowserTimerProvider-DhNc_x02.esm.js +0 -22
  6. package/dist/ITimerCapability-C67ZRskg.esm.js +0 -7
  7. package/dist/IpifyProvider-D7jx52AL.esm.js +0 -139
  8. package/dist/Manager-C8PrhBOx.d.ts +0 -19
  9. package/dist/MotionSensorProvider-4v7xkqAp.esm.js +0 -254
  10. package/dist/OpenViduRecordingProvider-CMu6XVdc.esm.js +0 -87
  11. package/dist/StateMachine-BCQrZJhf.d.ts +0 -2
  12. package/dist/WasmUtilProvider-j98OJf-S.esm.js +0 -114
  13. package/dist/addressSearch-BpTbTWCa.esm.js +0 -430
  14. package/dist/ae-signature-DDDZmWXj.esm.js +0 -12
  15. package/dist/ae-signature.d.ts +0 -25
  16. package/dist/ae-signature.esm.js +0 -8
  17. package/dist/antifraud.d.ts +0 -57
  18. package/dist/antifraud.esm.js +0 -45
  19. package/dist/antifraudStateMachine-O0TMf6yc.esm.js +0 -39
  20. package/dist/api-CESGtpbH.esm.js +0 -53
  21. package/dist/authentication.d.ts +0 -12
  22. package/dist/authentication.esm.js +0 -25
  23. package/dist/authenticationManager-5M-fKzXx.esm.js +0 -67
  24. package/dist/authenticationManager-C83GNIhl.d.ts +0 -66
  25. package/dist/authenticationStateMachine-BMZqatiF.esm.js +0 -139
  26. package/dist/backCameraStream-DMdMeGk2.esm.js +0 -346
  27. package/dist/browserSimulation-gxD8cSpM.esm.js +0 -20
  28. package/dist/camera-DBSxa6ML.d.ts +0 -4
  29. package/dist/camera-PA2Ljri3.esm.js +0 -22
  30. package/dist/camera.d.ts +0 -15
  31. package/dist/camera.esm.js +0 -5
  32. package/dist/chunk-CRF6K_H_.esm.js +0 -49
  33. package/dist/consent.d.ts +0 -398
  34. package/dist/consent.esm.js +0 -79
  35. package/dist/consentStateMachine-CCT-B60O.esm.js +0 -151
  36. package/dist/cpf-PPz2Njto.esm.js +0 -38
  37. package/dist/cpf-ocr.d.ts +0 -204
  38. package/dist/cpf-ocr.esm.js +0 -177
  39. package/dist/cross-document-data-match.d.ts +0 -34
  40. package/dist/cross-document-data-match.esm.js +0 -71
  41. package/dist/curp-validation.d.ts +0 -188
  42. package/dist/curp-validation.esm.js +0 -110
  43. package/dist/curpValidationStateMachine-CitWLr2c.esm.js +0 -595
  44. package/dist/custom-fields.d.ts +0 -115
  45. package/dist/custom-fields.esm.js +0 -177
  46. package/dist/custom-watchlist.d.ts +0 -66
  47. package/dist/custom-watchlist.esm.js +0 -86
  48. package/dist/dateUtils-UoN5xswP.esm.js +0 -23
  49. package/dist/deepsightLoader-Cm4JIT_z.esm.js +0 -52
  50. package/dist/deepsightService-CEVxzehb.d.ts +0 -412
  51. package/dist/deepsightService-O74l4Y__.esm.js +0 -489
  52. package/dist/device.d.ts +0 -46
  53. package/dist/device.esm.js +0 -106
  54. package/dist/displayErrors-DqJ_IbsG.d.ts +0 -39
  55. package/dist/document-capture.d.ts +0 -906
  56. package/dist/document-capture.esm.js +0 -156
  57. package/dist/document-upload.d.ts +0 -331
  58. package/dist/document-upload.esm.js +0 -203
  59. package/dist/documentCaptureStateMachine-BqzTDy9k.esm.js +0 -394
  60. package/dist/dynamic-forms.d.ts +0 -178
  61. package/dist/dynamic-forms.esm.js +0 -323
  62. package/dist/ekyb.d.ts +0 -148
  63. package/dist/ekyb.esm.js +0 -127
  64. package/dist/ekybStateMachine-B59rQjgj.esm.js +0 -674
  65. package/dist/ekyc.d.ts +0 -164
  66. package/dist/ekyc.esm.js +0 -104
  67. package/dist/ekycStateMachine-oeO0Iekd.esm.js +0 -10626
  68. package/dist/electronic-signature.d.ts +0 -4
  69. package/dist/electronic-signature.esm.js +0 -7
  70. package/dist/electronicSignatureManager-D9OHzTpG.esm.js +0 -428
  71. package/dist/email.d.ts +0 -4
  72. package/dist/email.esm.js +0 -9
  73. package/dist/emailManager-DIfnS5g1.d.ts +0 -352
  74. package/dist/emailManager-wAV0LE-H.esm.js +0 -238
  75. package/dist/emailStateMachine-DOf4j58N.esm.js +0 -292
  76. package/dist/endpoints-CnN3SyDa.esm.js +0 -87
  77. package/dist/events-D6-e4vok.esm.js +0 -596
  78. package/dist/events.d.ts +0 -265
  79. package/dist/events.esm.js +0 -4
  80. package/dist/extensibility.d.ts +0 -122
  81. package/dist/extensibility.esm.js +0 -43
  82. package/dist/face-match.d.ts +0 -228
  83. package/dist/face-match.esm.js +0 -173
  84. package/dist/faceCaptureManagerFactory-Dh2PdGlF.esm.js +0 -290
  85. package/dist/faceCaptureManagerFactory-yqtpxjnN.d.ts +0 -690
  86. package/dist/faceCaptureSetup-B3faSpYA.esm.js +0 -873
  87. package/dist/faceMatchStateMachine-DNFrxTFS.esm.js +0 -127
  88. package/dist/flow-events.d.ts +0 -6
  89. package/dist/flow-events.esm.js +0 -0
  90. package/dist/flow.d.ts +0 -358
  91. package/dist/flow.esm.js +0 -825
  92. package/dist/flowCompletionService-DhkT4SRY.d.ts +0 -10
  93. package/dist/flowCompletionService-P54yzGvA.esm.js +0 -13
  94. package/dist/flowServices-DTsm-Vf1.esm.js +0 -188
  95. package/dist/geolocation.d.ts +0 -127
  96. package/dist/geolocation.esm.js +0 -89
  97. package/dist/geolocationStateMachine-asasuHY2.esm.js +0 -105
  98. package/dist/getBrowser-BSXUTWXw.esm.js +0 -41
  99. package/dist/getDeviceClass-BSntT9_j.esm.js +0 -14
  100. package/dist/government-validation.d.ts +0 -67
  101. package/dist/government-validation.esm.js +0 -81
  102. package/dist/governmentValidationStateMachine-BDDYrJTo.esm.js +0 -271
  103. package/dist/home.d.ts +0 -99
  104. package/dist/home.esm.js +0 -61
  105. package/dist/http.d.ts +0 -68
  106. package/dist/http.esm.js +0 -3
  107. package/dist/id-ocr.d.ts +0 -635
  108. package/dist/id-ocr.esm.js +0 -86
  109. package/dist/id-verification.d.ts +0 -190
  110. package/dist/id-verification.esm.js +0 -43
  111. package/dist/id.d.ts +0 -24
  112. package/dist/id.esm.js +0 -164
  113. package/dist/idCaptureManager-B9TGA5dq.d.ts +0 -956
  114. package/dist/idCaptureManager-DMK0GIt3.esm.js +0 -581
  115. package/dist/idCaptureStateMachine-Bq0fVZXl.esm.js +0 -2954
  116. package/dist/idOcrStateMachine-YbjjC_Gg.esm.js +0 -388
  117. package/dist/idVerificationStateMachine-xbw9HP1Z.esm.js +0 -71
  118. package/dist/identity-reuse.d.ts +0 -530
  119. package/dist/identity-reuse.esm.js +0 -274
  120. package/dist/index-BLKtMA0g.d.ts +0 -1177
  121. package/dist/index-BcRG8rtJ.d.ts +0 -97
  122. package/dist/index.d.ts +0 -3
  123. package/dist/index.esm.js +0 -12
  124. package/dist/invokeOnCaptureCallback-rc6kBHo5.esm.js +0 -30
  125. package/dist/lib-BB0B_qQX.esm.js +0 -12499
  126. package/dist/mandatory-consent.d.ts +0 -412
  127. package/dist/mandatory-consent.esm.js +0 -78
  128. package/dist/mandatoryConsentStateMachine-Cnco1jvn.esm.js +0 -126
  129. package/dist/openviduLazy-Cm0XFh_v.esm.js +0 -3
  130. package/dist/openviduLazy-Cok70ZSg.esm.js +0 -12
  131. package/dist/permissionServices-D_i6nzEw.esm.js +0 -50
  132. package/dist/phone.d.ts +0 -4
  133. package/dist/phone.esm.js +0 -9
  134. package/dist/phoneManager-B6M30hKE.d.ts +0 -397
  135. package/dist/phoneManager-DAJbGhlY.esm.js +0 -256
  136. package/dist/phoneStateMachine-CuPARRaT.esm.js +0 -351
  137. package/dist/platform-CfrjKhmi.esm.js +0 -83
  138. package/dist/qe-signature-DFo_Cc-I.esm.js +0 -12
  139. package/dist/qe-signature.d.ts +0 -25
  140. package/dist/qe-signature.esm.js +0 -8
  141. package/dist/recordingService-Ig2UgbLv.esm.js +0 -1003
  142. package/dist/redirect-to-mobile.d.ts +0 -107
  143. package/dist/redirect-to-mobile.esm.js +0 -102
  144. package/dist/redirectToMobileStateMachine-BOEqe46A.esm.js +0 -249
  145. package/dist/runChildModule-CqqwqAkW.esm.js +0 -219
  146. package/dist/selfie.d.ts +0 -26
  147. package/dist/selfie.esm.js +0 -146
  148. package/dist/selfieManager-D0lSgd-J.d.ts +0 -68
  149. package/dist/selfieManager-Duisl7qN.esm.js +0 -60
  150. package/dist/selfieStateMachine-D76whWEf.esm.js +0 -68
  151. package/dist/session-BS-d_vuE.esm.js +0 -3206
  152. package/dist/session.d.ts +0 -217
  153. package/dist/session.esm.js +0 -9
  154. package/dist/setup-Buy-hyj4.esm.js +0 -887
  155. package/dist/setup-C5AITV8m.d.ts +0 -254
  156. package/dist/signature.d.ts +0 -94
  157. package/dist/signature.esm.js +0 -66
  158. package/dist/signatureStateMachine-B5-QVUve.esm.js +0 -132
  159. package/dist/stats-CIfiPzb1.esm.js +0 -16
  160. package/dist/stats.d.ts +0 -16
  161. package/dist/stats.esm.js +0 -4
  162. package/dist/trust-graph.d.ts +0 -54
  163. package/dist/trust-graph.esm.js +0 -56
  164. package/dist/types-B06Ypu2F.d.ts +0 -49
  165. package/dist/types-BP1m8VRw.d.ts +0 -340
  166. package/dist/types-CAD4va6a.d.ts +0 -5
  167. package/dist/types-CFV9G_7j.d.ts +0 -24
  168. package/dist/warmup-CEcppFiS.d.ts +0 -63
  169. package/dist/wasm.d.ts +0 -15
  170. package/dist/wasm.esm.js +0 -12
  171. package/dist/watchlist-for-business.d.ts +0 -79
  172. package/dist/watchlist-for-business.esm.js +0 -148
  173. package/dist/watchlist.d.ts +0 -62
  174. package/dist/watchlist.esm.js +0 -86
  175. package/dist/watchlistServices-DMbUhkBX.esm.js +0 -12
  176. package/dist/workflow.d.ts +0 -907
  177. package/dist/workflow.esm.js +0 -702
  178. package/dist/xstate.esm-B70JrNqo.esm.js +0 -3404
@@ -1,351 +0,0 @@
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 };
@@ -1,83 +0,0 @@
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 };
@@ -1,12 +0,0 @@
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 };
@@ -1,25 +0,0 @@
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 };
@@ -1,8 +0,0 @@
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 };