@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,412 @@
|
|
|
1
|
+
import { t as Manager } from "./Manager-C8PrhBOx.js";
|
|
2
|
+
import "./Actor-CI32dTbG.js";
|
|
3
|
+
import "./camera-DBSxa6ML.js";
|
|
4
|
+
import "./types-CFV9G_7j.js";
|
|
5
|
+
import { a as RegulationTypes } from "./types-BP1m8VRw.js";
|
|
6
|
+
import * as xstate16 from "xstate";
|
|
7
|
+
|
|
8
|
+
//#region src/modules/mandatory-consent/types.d.ts
|
|
9
|
+
type MandatoryConsentConfig = {
|
|
10
|
+
consentType: RegulationTypes;
|
|
11
|
+
};
|
|
12
|
+
type MandatoryConsent = {
|
|
13
|
+
id: string;
|
|
14
|
+
title: string;
|
|
15
|
+
text: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
consentType: string;
|
|
18
|
+
};
|
|
19
|
+
type FetchMandatoryConsentResponse = {
|
|
20
|
+
consents: MandatoryConsent[];
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/modules/mandatory-consent/mandatoryConsentStateMachine.d.ts
|
|
24
|
+
type MandatoryConsentContext = {
|
|
25
|
+
config: MandatoryConsentConfig;
|
|
26
|
+
consent: MandatoryConsent | undefined;
|
|
27
|
+
isSigned: boolean;
|
|
28
|
+
error: string | undefined;
|
|
29
|
+
};
|
|
30
|
+
type MandatoryConsentInput = {
|
|
31
|
+
config: MandatoryConsentConfig;
|
|
32
|
+
};
|
|
33
|
+
declare const mandatoryConsentMachine: xstate16.StateMachine<MandatoryConsentContext, {
|
|
34
|
+
type: "LOAD";
|
|
35
|
+
} | {
|
|
36
|
+
type: "TOGGLE";
|
|
37
|
+
} | {
|
|
38
|
+
type: "SUBMIT";
|
|
39
|
+
} | {
|
|
40
|
+
type: "CANCEL";
|
|
41
|
+
} | {
|
|
42
|
+
type: "RETRY";
|
|
43
|
+
} | {
|
|
44
|
+
type: "RESET";
|
|
45
|
+
}, {
|
|
46
|
+
[x: string]: xstate16.ActorRefFromLogic<xstate16.PromiseActorLogic<FetchMandatoryConsentResponse, {
|
|
47
|
+
config: MandatoryConsentConfig;
|
|
48
|
+
}, xstate16.EventObject>> | xstate16.ActorRefFromLogic<xstate16.PromiseActorLogic<void, {
|
|
49
|
+
consentId: string;
|
|
50
|
+
isSigned: boolean;
|
|
51
|
+
}, xstate16.EventObject>> | undefined;
|
|
52
|
+
}, xstate16.Values<{
|
|
53
|
+
fetchConsent: {
|
|
54
|
+
src: "fetchConsent";
|
|
55
|
+
logic: xstate16.PromiseActorLogic<FetchMandatoryConsentResponse, {
|
|
56
|
+
config: MandatoryConsentConfig;
|
|
57
|
+
}, xstate16.EventObject>;
|
|
58
|
+
id: string | undefined;
|
|
59
|
+
};
|
|
60
|
+
submitConsent: {
|
|
61
|
+
src: "submitConsent";
|
|
62
|
+
logic: xstate16.PromiseActorLogic<void, {
|
|
63
|
+
consentId: string;
|
|
64
|
+
isSigned: boolean;
|
|
65
|
+
}, xstate16.EventObject>;
|
|
66
|
+
id: string | undefined;
|
|
67
|
+
};
|
|
68
|
+
}>, xstate16.Values<{
|
|
69
|
+
setConsent: {
|
|
70
|
+
type: "setConsent";
|
|
71
|
+
params: xstate16.NonReducibleUnknown;
|
|
72
|
+
};
|
|
73
|
+
toggleSigned: {
|
|
74
|
+
type: "toggleSigned";
|
|
75
|
+
params: xstate16.NonReducibleUnknown;
|
|
76
|
+
};
|
|
77
|
+
setError: {
|
|
78
|
+
type: "setError";
|
|
79
|
+
params: xstate16.NonReducibleUnknown;
|
|
80
|
+
};
|
|
81
|
+
clearError: {
|
|
82
|
+
type: "clearError";
|
|
83
|
+
params: xstate16.NonReducibleUnknown;
|
|
84
|
+
};
|
|
85
|
+
resetContext: {
|
|
86
|
+
type: "resetContext";
|
|
87
|
+
params: xstate16.NonReducibleUnknown;
|
|
88
|
+
};
|
|
89
|
+
}>, {
|
|
90
|
+
type: "canSubmit";
|
|
91
|
+
params: unknown;
|
|
92
|
+
}, never, "error" | "idle" | "closed" | "finished" | "loading" | "display" | "submitting", string, MandatoryConsentInput, xstate16.NonReducibleUnknown, xstate16.EventObject, xstate16.MetaObject, {
|
|
93
|
+
readonly id: "mandatoryConsent";
|
|
94
|
+
readonly initial: "idle";
|
|
95
|
+
readonly context: ({
|
|
96
|
+
input
|
|
97
|
+
}: {
|
|
98
|
+
spawn: {
|
|
99
|
+
<TSrc extends "fetchConsent" | "submitConsent">(logic: TSrc, ...[options]: ({
|
|
100
|
+
src: "fetchConsent";
|
|
101
|
+
logic: xstate16.PromiseActorLogic<FetchMandatoryConsentResponse, {
|
|
102
|
+
config: MandatoryConsentConfig;
|
|
103
|
+
}, xstate16.EventObject>;
|
|
104
|
+
id: string | undefined;
|
|
105
|
+
} extends infer T ? T extends {
|
|
106
|
+
src: "fetchConsent";
|
|
107
|
+
logic: xstate16.PromiseActorLogic<FetchMandatoryConsentResponse, {
|
|
108
|
+
config: MandatoryConsentConfig;
|
|
109
|
+
}, xstate16.EventObject>;
|
|
110
|
+
id: string | undefined;
|
|
111
|
+
} ? T extends {
|
|
112
|
+
src: TSrc;
|
|
113
|
+
} ? xstate16.ConditionalRequired<[options?: ({
|
|
114
|
+
id?: T["id"] | undefined;
|
|
115
|
+
systemId?: string;
|
|
116
|
+
input?: xstate16.InputFrom<T["logic"]> | undefined;
|
|
117
|
+
syncSnapshot?: boolean;
|
|
118
|
+
} & { [K in xstate16.RequiredActorOptions<T>]: unknown }) | undefined], xstate16.IsNotNever<xstate16.RequiredActorOptions<T>>> : never : never : never) | ({
|
|
119
|
+
src: "submitConsent";
|
|
120
|
+
logic: xstate16.PromiseActorLogic<void, {
|
|
121
|
+
consentId: string;
|
|
122
|
+
isSigned: boolean;
|
|
123
|
+
}, xstate16.EventObject>;
|
|
124
|
+
id: string | undefined;
|
|
125
|
+
} extends infer T_1 ? T_1 extends {
|
|
126
|
+
src: "submitConsent";
|
|
127
|
+
logic: xstate16.PromiseActorLogic<void, {
|
|
128
|
+
consentId: string;
|
|
129
|
+
isSigned: boolean;
|
|
130
|
+
}, xstate16.EventObject>;
|
|
131
|
+
id: string | undefined;
|
|
132
|
+
} ? T_1 extends {
|
|
133
|
+
src: TSrc;
|
|
134
|
+
} ? xstate16.ConditionalRequired<[options?: ({
|
|
135
|
+
id?: T_1["id"] | undefined;
|
|
136
|
+
systemId?: string;
|
|
137
|
+
input?: xstate16.InputFrom<T_1["logic"]> | undefined;
|
|
138
|
+
syncSnapshot?: boolean;
|
|
139
|
+
} & { [K_1 in xstate16.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate16.IsNotNever<xstate16.RequiredActorOptions<T_1>>> : never : never : never)): xstate16.ActorRefFromLogic<xstate16.GetConcreteByKey<xstate16.Values<{
|
|
140
|
+
fetchConsent: {
|
|
141
|
+
src: "fetchConsent";
|
|
142
|
+
logic: xstate16.PromiseActorLogic<FetchMandatoryConsentResponse, {
|
|
143
|
+
config: MandatoryConsentConfig;
|
|
144
|
+
}, xstate16.EventObject>;
|
|
145
|
+
id: string | undefined;
|
|
146
|
+
};
|
|
147
|
+
submitConsent: {
|
|
148
|
+
src: "submitConsent";
|
|
149
|
+
logic: xstate16.PromiseActorLogic<void, {
|
|
150
|
+
consentId: string;
|
|
151
|
+
isSigned: boolean;
|
|
152
|
+
}, xstate16.EventObject>;
|
|
153
|
+
id: string | undefined;
|
|
154
|
+
};
|
|
155
|
+
}>, "src", TSrc>["logic"]>;
|
|
156
|
+
<TLogic extends xstate16.AnyActorLogic>(src: TLogic, ...[options]: xstate16.ConditionalRequired<[options?: ({
|
|
157
|
+
id?: never;
|
|
158
|
+
systemId?: string;
|
|
159
|
+
input?: xstate16.InputFrom<TLogic> | undefined;
|
|
160
|
+
syncSnapshot?: boolean;
|
|
161
|
+
} & { [K in xstate16.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate16.IsNotNever<xstate16.RequiredLogicInput<TLogic>>>): xstate16.ActorRefFromLogic<TLogic>;
|
|
162
|
+
};
|
|
163
|
+
input: MandatoryConsentInput;
|
|
164
|
+
self: xstate16.ActorRef<xstate16.MachineSnapshot<MandatoryConsentContext, {
|
|
165
|
+
type: "LOAD";
|
|
166
|
+
} | {
|
|
167
|
+
type: "TOGGLE";
|
|
168
|
+
} | {
|
|
169
|
+
type: "SUBMIT";
|
|
170
|
+
} | {
|
|
171
|
+
type: "CANCEL";
|
|
172
|
+
} | {
|
|
173
|
+
type: "RETRY";
|
|
174
|
+
} | {
|
|
175
|
+
type: "RESET";
|
|
176
|
+
}, Record<string, xstate16.AnyActorRef | undefined>, xstate16.StateValue, string, unknown, any, any>, {
|
|
177
|
+
type: "LOAD";
|
|
178
|
+
} | {
|
|
179
|
+
type: "TOGGLE";
|
|
180
|
+
} | {
|
|
181
|
+
type: "SUBMIT";
|
|
182
|
+
} | {
|
|
183
|
+
type: "CANCEL";
|
|
184
|
+
} | {
|
|
185
|
+
type: "RETRY";
|
|
186
|
+
} | {
|
|
187
|
+
type: "RESET";
|
|
188
|
+
}, xstate16.AnyEventObject>;
|
|
189
|
+
}) => {
|
|
190
|
+
config: MandatoryConsentConfig;
|
|
191
|
+
consent: undefined;
|
|
192
|
+
isSigned: false;
|
|
193
|
+
error: undefined;
|
|
194
|
+
};
|
|
195
|
+
readonly states: {
|
|
196
|
+
readonly idle: {
|
|
197
|
+
readonly on: {
|
|
198
|
+
readonly LOAD: {
|
|
199
|
+
readonly target: "loading";
|
|
200
|
+
readonly actions: "clearError";
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
readonly loading: {
|
|
205
|
+
readonly invoke: {
|
|
206
|
+
readonly id: "fetchConsent";
|
|
207
|
+
readonly src: "fetchConsent";
|
|
208
|
+
readonly input: ({
|
|
209
|
+
context
|
|
210
|
+
}: {
|
|
211
|
+
context: MandatoryConsentContext;
|
|
212
|
+
event: {
|
|
213
|
+
type: "LOAD";
|
|
214
|
+
} | {
|
|
215
|
+
type: "TOGGLE";
|
|
216
|
+
} | {
|
|
217
|
+
type: "SUBMIT";
|
|
218
|
+
} | {
|
|
219
|
+
type: "CANCEL";
|
|
220
|
+
} | {
|
|
221
|
+
type: "RETRY";
|
|
222
|
+
} | {
|
|
223
|
+
type: "RESET";
|
|
224
|
+
};
|
|
225
|
+
self: xstate16.ActorRef<xstate16.MachineSnapshot<MandatoryConsentContext, {
|
|
226
|
+
type: "LOAD";
|
|
227
|
+
} | {
|
|
228
|
+
type: "TOGGLE";
|
|
229
|
+
} | {
|
|
230
|
+
type: "SUBMIT";
|
|
231
|
+
} | {
|
|
232
|
+
type: "CANCEL";
|
|
233
|
+
} | {
|
|
234
|
+
type: "RETRY";
|
|
235
|
+
} | {
|
|
236
|
+
type: "RESET";
|
|
237
|
+
}, Record<string, xstate16.AnyActorRef>, xstate16.StateValue, string, unknown, any, any>, {
|
|
238
|
+
type: "LOAD";
|
|
239
|
+
} | {
|
|
240
|
+
type: "TOGGLE";
|
|
241
|
+
} | {
|
|
242
|
+
type: "SUBMIT";
|
|
243
|
+
} | {
|
|
244
|
+
type: "CANCEL";
|
|
245
|
+
} | {
|
|
246
|
+
type: "RETRY";
|
|
247
|
+
} | {
|
|
248
|
+
type: "RESET";
|
|
249
|
+
}, xstate16.AnyEventObject>;
|
|
250
|
+
}) => {
|
|
251
|
+
config: MandatoryConsentConfig;
|
|
252
|
+
};
|
|
253
|
+
readonly onDone: {
|
|
254
|
+
readonly target: "display";
|
|
255
|
+
readonly actions: "setConsent";
|
|
256
|
+
};
|
|
257
|
+
readonly onError: {
|
|
258
|
+
readonly target: "error";
|
|
259
|
+
readonly actions: "setError";
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
};
|
|
263
|
+
readonly display: {
|
|
264
|
+
readonly on: {
|
|
265
|
+
readonly TOGGLE: {
|
|
266
|
+
readonly actions: "toggleSigned";
|
|
267
|
+
};
|
|
268
|
+
readonly SUBMIT: {
|
|
269
|
+
readonly target: "submitting";
|
|
270
|
+
readonly guard: "canSubmit";
|
|
271
|
+
};
|
|
272
|
+
readonly CANCEL: {
|
|
273
|
+
readonly target: "closed";
|
|
274
|
+
};
|
|
275
|
+
readonly RETRY: {
|
|
276
|
+
readonly target: "loading";
|
|
277
|
+
readonly actions: "clearError";
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
readonly submitting: {
|
|
282
|
+
readonly invoke: {
|
|
283
|
+
readonly id: "submitConsent";
|
|
284
|
+
readonly src: "submitConsent";
|
|
285
|
+
readonly input: ({
|
|
286
|
+
context
|
|
287
|
+
}: {
|
|
288
|
+
context: MandatoryConsentContext;
|
|
289
|
+
event: {
|
|
290
|
+
type: "LOAD";
|
|
291
|
+
} | {
|
|
292
|
+
type: "TOGGLE";
|
|
293
|
+
} | {
|
|
294
|
+
type: "SUBMIT";
|
|
295
|
+
} | {
|
|
296
|
+
type: "CANCEL";
|
|
297
|
+
} | {
|
|
298
|
+
type: "RETRY";
|
|
299
|
+
} | {
|
|
300
|
+
type: "RESET";
|
|
301
|
+
};
|
|
302
|
+
self: xstate16.ActorRef<xstate16.MachineSnapshot<MandatoryConsentContext, {
|
|
303
|
+
type: "LOAD";
|
|
304
|
+
} | {
|
|
305
|
+
type: "TOGGLE";
|
|
306
|
+
} | {
|
|
307
|
+
type: "SUBMIT";
|
|
308
|
+
} | {
|
|
309
|
+
type: "CANCEL";
|
|
310
|
+
} | {
|
|
311
|
+
type: "RETRY";
|
|
312
|
+
} | {
|
|
313
|
+
type: "RESET";
|
|
314
|
+
}, Record<string, xstate16.AnyActorRef>, xstate16.StateValue, string, unknown, any, any>, {
|
|
315
|
+
type: "LOAD";
|
|
316
|
+
} | {
|
|
317
|
+
type: "TOGGLE";
|
|
318
|
+
} | {
|
|
319
|
+
type: "SUBMIT";
|
|
320
|
+
} | {
|
|
321
|
+
type: "CANCEL";
|
|
322
|
+
} | {
|
|
323
|
+
type: "RETRY";
|
|
324
|
+
} | {
|
|
325
|
+
type: "RESET";
|
|
326
|
+
}, xstate16.AnyEventObject>;
|
|
327
|
+
}) => {
|
|
328
|
+
consentId: string;
|
|
329
|
+
isSigned: boolean;
|
|
330
|
+
};
|
|
331
|
+
readonly onDone: {
|
|
332
|
+
readonly target: "finished";
|
|
333
|
+
};
|
|
334
|
+
readonly onError: {
|
|
335
|
+
readonly target: "display";
|
|
336
|
+
readonly actions: "setError";
|
|
337
|
+
};
|
|
338
|
+
};
|
|
339
|
+
};
|
|
340
|
+
readonly error: {
|
|
341
|
+
readonly on: {
|
|
342
|
+
readonly RETRY: {
|
|
343
|
+
readonly target: "loading";
|
|
344
|
+
readonly actions: "clearError";
|
|
345
|
+
};
|
|
346
|
+
readonly CANCEL: {
|
|
347
|
+
readonly target: "closed";
|
|
348
|
+
};
|
|
349
|
+
readonly RESET: {
|
|
350
|
+
readonly target: "idle";
|
|
351
|
+
readonly actions: "resetContext";
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
};
|
|
355
|
+
readonly finished: {
|
|
356
|
+
readonly type: "final";
|
|
357
|
+
};
|
|
358
|
+
readonly closed: {
|
|
359
|
+
readonly type: "final";
|
|
360
|
+
};
|
|
361
|
+
};
|
|
362
|
+
}>;
|
|
363
|
+
//#endregion
|
|
364
|
+
//#region src/modules/mandatory-consent/mandatoryConsentActor.d.ts
|
|
365
|
+
type CreateMandatoryConsentActorOptions = {
|
|
366
|
+
config: MandatoryConsentConfig;
|
|
367
|
+
};
|
|
368
|
+
//#endregion
|
|
369
|
+
//#region src/modules/mandatory-consent/mandatoryConsentManager.d.ts
|
|
370
|
+
type MandatoryConsentIdleState = {
|
|
371
|
+
status: 'idle';
|
|
372
|
+
};
|
|
373
|
+
type MandatoryConsentLoadingState = {
|
|
374
|
+
status: 'loading';
|
|
375
|
+
};
|
|
376
|
+
type MandatoryConsentDisplayState = {
|
|
377
|
+
status: 'display';
|
|
378
|
+
title: string;
|
|
379
|
+
text: string;
|
|
380
|
+
isSigned: boolean;
|
|
381
|
+
canSubmit: boolean;
|
|
382
|
+
error?: string;
|
|
383
|
+
};
|
|
384
|
+
type MandatoryConsentSubmittingState = {
|
|
385
|
+
status: 'submitting';
|
|
386
|
+
title: string;
|
|
387
|
+
text: string;
|
|
388
|
+
isSigned: boolean;
|
|
389
|
+
canSubmit: false;
|
|
390
|
+
};
|
|
391
|
+
type MandatoryConsentFinishedState = {
|
|
392
|
+
status: 'finished';
|
|
393
|
+
};
|
|
394
|
+
type MandatoryConsentClosedState = {
|
|
395
|
+
status: 'closed';
|
|
396
|
+
};
|
|
397
|
+
type MandatoryConsentErrorState = {
|
|
398
|
+
status: 'error';
|
|
399
|
+
error: string;
|
|
400
|
+
};
|
|
401
|
+
type MandatoryConsentState = MandatoryConsentIdleState | MandatoryConsentLoadingState | MandatoryConsentDisplayState | MandatoryConsentSubmittingState | MandatoryConsentFinishedState | MandatoryConsentClosedState | MandatoryConsentErrorState;
|
|
402
|
+
declare function createMandatoryConsentManager(options: CreateMandatoryConsentActorOptions): Manager<MandatoryConsentState> & {
|
|
403
|
+
load(): void;
|
|
404
|
+
toggle(): void;
|
|
405
|
+
submit(): void;
|
|
406
|
+
cancel(): void;
|
|
407
|
+
retry(): void;
|
|
408
|
+
reset(): void;
|
|
409
|
+
};
|
|
410
|
+
type MandatoryConsentManager = ReturnType<typeof createMandatoryConsentManager>;
|
|
411
|
+
//#endregion
|
|
412
|
+
export { type MandatoryConsentConfig, type MandatoryConsentManager, type MandatoryConsentState, createMandatoryConsentManager, mandatoryConsentMachine };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import "./api-CESGtpbH.esm.js";
|
|
2
|
+
import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-D6-e4vok.esm.js";
|
|
3
|
+
import "./endpoints-CnN3SyDa.esm.js";
|
|
4
|
+
import { c as createManager, s as createActor } from "./xstate.esm-B70JrNqo.esm.js";
|
|
5
|
+
import { t as mandatoryConsentMachine } from "./mandatoryConsentStateMachine-Cnco1jvn.esm.js";
|
|
6
|
+
|
|
7
|
+
//#region src/modules/mandatory-consent/mandatoryConsentActor.ts
|
|
8
|
+
function createMandatoryConsentActor(options) {
|
|
9
|
+
return createActor(mandatoryConsentMachine, { input: { config: options.config } }).start();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/modules/mandatory-consent/mandatoryConsentManager.ts
|
|
14
|
+
function mapState(snapshot) {
|
|
15
|
+
const typedSnapshot = snapshot;
|
|
16
|
+
const { context } = typedSnapshot;
|
|
17
|
+
const canSubmit = Boolean(context.isSigned && context.consent?.id);
|
|
18
|
+
if (typedSnapshot.matches("idle")) return { status: "idle" };
|
|
19
|
+
if (typedSnapshot.matches("loading")) return { status: "loading" };
|
|
20
|
+
if (typedSnapshot.matches("display")) return {
|
|
21
|
+
status: "display",
|
|
22
|
+
title: context.consent?.title ?? "",
|
|
23
|
+
text: context.consent?.text ?? "",
|
|
24
|
+
isSigned: context.isSigned,
|
|
25
|
+
canSubmit,
|
|
26
|
+
error: context.error
|
|
27
|
+
};
|
|
28
|
+
if (typedSnapshot.matches("submitting")) return {
|
|
29
|
+
status: "submitting",
|
|
30
|
+
title: context.consent?.title ?? "",
|
|
31
|
+
text: context.consent?.text ?? "",
|
|
32
|
+
isSigned: context.isSigned,
|
|
33
|
+
canSubmit: false
|
|
34
|
+
};
|
|
35
|
+
if (typedSnapshot.matches("finished")) return { status: "finished" };
|
|
36
|
+
if (typedSnapshot.matches("closed")) return { status: "closed" };
|
|
37
|
+
if (typedSnapshot.matches("error")) return {
|
|
38
|
+
status: "error",
|
|
39
|
+
error: context.error ?? "Unknown error"
|
|
40
|
+
};
|
|
41
|
+
return { status: "idle" };
|
|
42
|
+
}
|
|
43
|
+
function createApi({ actor, trackElementClicked }) {
|
|
44
|
+
return {
|
|
45
|
+
load() {
|
|
46
|
+
actor.send({ type: "LOAD" });
|
|
47
|
+
},
|
|
48
|
+
toggle() {
|
|
49
|
+
actor.send({ type: "TOGGLE" });
|
|
50
|
+
},
|
|
51
|
+
submit() {
|
|
52
|
+
trackElementClicked?.("submit");
|
|
53
|
+
actor.send({ type: "SUBMIT" });
|
|
54
|
+
},
|
|
55
|
+
cancel() {
|
|
56
|
+
trackElementClicked?.("cancel");
|
|
57
|
+
actor.send({ type: "CANCEL" });
|
|
58
|
+
},
|
|
59
|
+
retry() {
|
|
60
|
+
trackElementClicked?.("retry");
|
|
61
|
+
actor.send({ type: "RETRY" });
|
|
62
|
+
},
|
|
63
|
+
reset() {
|
|
64
|
+
actor.send({ type: "RESET" });
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function createMandatoryConsentManager(options) {
|
|
69
|
+
return createManager({
|
|
70
|
+
actor: createMandatoryConsentActor(options),
|
|
71
|
+
mapState,
|
|
72
|
+
createApi,
|
|
73
|
+
instrumentation: createManagerInstrumentation(eventModuleNames.mlConsent)
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
//#endregion
|
|
78
|
+
export { createMandatoryConsentManager, mandatoryConsentMachine };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { t as api } from "./api-CESGtpbH.esm.js";
|
|
2
|
+
import { t as endpoints } from "./endpoints-CnN3SyDa.esm.js";
|
|
3
|
+
import { a as fromPromise, r as assign, t as setup } from "./xstate.esm-B70JrNqo.esm.js";
|
|
4
|
+
|
|
5
|
+
//#region src/modules/mandatory-consent/mandatoryConsentServices.ts
|
|
6
|
+
async function fetchMandatoryConsent(regulationType, signal) {
|
|
7
|
+
const res = await api.get(endpoints.getConsents, {
|
|
8
|
+
signal,
|
|
9
|
+
query: {
|
|
10
|
+
type: "MANDATORY",
|
|
11
|
+
language: "en",
|
|
12
|
+
regulationType
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
if (!res.ok) throw new Error(`GET ${endpoints.getConsents} failed: ${res.status} ${res.statusText}`);
|
|
16
|
+
return res.data;
|
|
17
|
+
}
|
|
18
|
+
async function submitMandatoryConsent(params, signal) {
|
|
19
|
+
const res = await api.post(endpoints.submitMlConsent, params, { signal });
|
|
20
|
+
if (!res.ok) throw new Error(`POST ${endpoints.submitMlConsent} failed: ${res.status} ${res.statusText}`);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/modules/mandatory-consent/mandatoryConsentStateMachine.ts
|
|
25
|
+
const mandatoryConsentMachine = setup({
|
|
26
|
+
types: {
|
|
27
|
+
context: {},
|
|
28
|
+
events: {},
|
|
29
|
+
input: {}
|
|
30
|
+
},
|
|
31
|
+
actors: {
|
|
32
|
+
fetchConsent: fromPromise(async ({ input, signal }) => fetchMandatoryConsent(input.config.consentType, signal)),
|
|
33
|
+
submitConsent: fromPromise(async ({ input, signal }) => submitMandatoryConsent({ consents: [{
|
|
34
|
+
id: input.consentId,
|
|
35
|
+
isSigned: input.isSigned
|
|
36
|
+
}] }, signal))
|
|
37
|
+
},
|
|
38
|
+
actions: {
|
|
39
|
+
setConsent: assign(({ event }) => {
|
|
40
|
+
return {
|
|
41
|
+
consent: event.output.consents[0],
|
|
42
|
+
isSigned: false,
|
|
43
|
+
error: void 0
|
|
44
|
+
};
|
|
45
|
+
}),
|
|
46
|
+
toggleSigned: assign(({ context }) => ({ isSigned: !context.isSigned })),
|
|
47
|
+
setError: assign(({ event }) => ({ error: String(event.error) })),
|
|
48
|
+
clearError: assign({ error: () => void 0 }),
|
|
49
|
+
resetContext: assign(({ context }) => ({
|
|
50
|
+
config: context.config,
|
|
51
|
+
consent: void 0,
|
|
52
|
+
isSigned: false,
|
|
53
|
+
error: void 0
|
|
54
|
+
}))
|
|
55
|
+
},
|
|
56
|
+
guards: { canSubmit: ({ context }) => Boolean(context.consent?.id) && context.isSigned }
|
|
57
|
+
}).createMachine({
|
|
58
|
+
id: "mandatoryConsent",
|
|
59
|
+
initial: "idle",
|
|
60
|
+
context: ({ input }) => ({
|
|
61
|
+
config: input.config,
|
|
62
|
+
consent: void 0,
|
|
63
|
+
isSigned: false,
|
|
64
|
+
error: void 0
|
|
65
|
+
}),
|
|
66
|
+
states: {
|
|
67
|
+
idle: { on: { LOAD: {
|
|
68
|
+
target: "loading",
|
|
69
|
+
actions: "clearError"
|
|
70
|
+
} } },
|
|
71
|
+
loading: { invoke: {
|
|
72
|
+
id: "fetchConsent",
|
|
73
|
+
src: "fetchConsent",
|
|
74
|
+
input: ({ context }) => ({ config: context.config }),
|
|
75
|
+
onDone: {
|
|
76
|
+
target: "display",
|
|
77
|
+
actions: "setConsent"
|
|
78
|
+
},
|
|
79
|
+
onError: {
|
|
80
|
+
target: "error",
|
|
81
|
+
actions: "setError"
|
|
82
|
+
}
|
|
83
|
+
} },
|
|
84
|
+
display: { on: {
|
|
85
|
+
TOGGLE: { actions: "toggleSigned" },
|
|
86
|
+
SUBMIT: {
|
|
87
|
+
target: "submitting",
|
|
88
|
+
guard: "canSubmit"
|
|
89
|
+
},
|
|
90
|
+
CANCEL: { target: "closed" },
|
|
91
|
+
RETRY: {
|
|
92
|
+
target: "loading",
|
|
93
|
+
actions: "clearError"
|
|
94
|
+
}
|
|
95
|
+
} },
|
|
96
|
+
submitting: { invoke: {
|
|
97
|
+
id: "submitConsent",
|
|
98
|
+
src: "submitConsent",
|
|
99
|
+
input: ({ context }) => ({
|
|
100
|
+
consentId: context.consent?.id ?? "",
|
|
101
|
+
isSigned: context.isSigned
|
|
102
|
+
}),
|
|
103
|
+
onDone: { target: "finished" },
|
|
104
|
+
onError: {
|
|
105
|
+
target: "display",
|
|
106
|
+
actions: "setError"
|
|
107
|
+
}
|
|
108
|
+
} },
|
|
109
|
+
error: { on: {
|
|
110
|
+
RETRY: {
|
|
111
|
+
target: "loading",
|
|
112
|
+
actions: "clearError"
|
|
113
|
+
},
|
|
114
|
+
CANCEL: { target: "closed" },
|
|
115
|
+
RESET: {
|
|
116
|
+
target: "idle",
|
|
117
|
+
actions: "resetContext"
|
|
118
|
+
}
|
|
119
|
+
} },
|
|
120
|
+
finished: { type: "final" },
|
|
121
|
+
closed: { type: "final" }
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
//#endregion
|
|
126
|
+
export { mandatoryConsentMachine as t };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { a as __toDynamicImportESM } from "./chunk-CRF6K_H_.esm.js";
|
|
2
|
+
|
|
3
|
+
//#region ../infra/src/providers/browser/openviduLazy.ts
|
|
4
|
+
let openViduImport;
|
|
5
|
+
async function loadOpenVidu() {
|
|
6
|
+
if (openViduImport) return openViduImport;
|
|
7
|
+
openViduImport = import("./lib-BB0B_qQX.esm.js").then(__toDynamicImportESM(1));
|
|
8
|
+
return openViduImport;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { loadOpenVidu as t };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { i as stopCameraStream, r as requestCameraAccess } from "./camera-PA2Ljri3.esm.js";
|
|
2
|
+
import { t as MotionSensorProvider } from "./MotionSensorProvider-4v7xkqAp.esm.js";
|
|
3
|
+
|
|
4
|
+
//#region ../infra/src/media/permissions.ts
|
|
5
|
+
async function queryPermission(name) {
|
|
6
|
+
try {
|
|
7
|
+
if (typeof navigator === "undefined" || !navigator.permissions) return "prompt";
|
|
8
|
+
return (await navigator.permissions.query({ name })).state;
|
|
9
|
+
} catch {
|
|
10
|
+
return "prompt";
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
async function queryCameraPermission() {
|
|
14
|
+
return queryPermission("camera");
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/internal/permissions/permissionServices.ts
|
|
19
|
+
async function checkPermission() {
|
|
20
|
+
const queryResult = await queryCameraPermission();
|
|
21
|
+
if (queryResult === "granted") return "granted";
|
|
22
|
+
if (queryResult === "denied") return "denied";
|
|
23
|
+
return "prompt";
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Requests motion sensor permission. Must be called during a user gesture on iOS.
|
|
27
|
+
* Returns the permission result.
|
|
28
|
+
*/
|
|
29
|
+
async function requestMotionPermission() {
|
|
30
|
+
return new MotionSensorProvider().requestPermission();
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Requests camera permission by attempting to access the camera, then immediately
|
|
34
|
+
* stops the obtained stream. Also requests motion sensor permission (required on iOS
|
|
35
|
+
* to be called during a user gesture). This function does not keep or return the stream.
|
|
36
|
+
*/
|
|
37
|
+
async function requestPermission(options = {}) {
|
|
38
|
+
try {
|
|
39
|
+
if (options.requestMotion) await requestMotionPermission();
|
|
40
|
+
stopCameraStream(await requestCameraAccess({ video: true }));
|
|
41
|
+
return "granted";
|
|
42
|
+
} catch (error) {
|
|
43
|
+
const name = error instanceof Error ? error.name : void 0;
|
|
44
|
+
if (name === "NotAllowedError" || name === "PermissionDeniedError") return "denied";
|
|
45
|
+
return "prompt";
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
export { requestPermission as n, checkPermission as t };
|