@incodetech/core 2.0.1-rc.0 → 2.1.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/{BrowserStorageProvider-CuOW1Er2.esm.js → BrowserStorageProvider-BpJM-gIl.esm.js} +8 -1
- package/dist/{IpifyProvider-D7jx52AL.esm.js → IpifyProvider-D4LWD15E.esm.js} +28 -0
- package/dist/{MotionSensorProvider-4v7xkqAp.esm.js → MotionSensorProvider-Bx7Mpzt0.esm.js} +63 -13
- package/dist/{OpenViduRecordingProvider-CMu6XVdc.esm.js → OpenViduRecordingProvider-O4GjBseO.esm.js} +1 -1
- package/dist/StateMachine-BC_nGvrc.d.ts +2 -0
- package/dist/StreamCanvasCapture-ImiDQdVA.esm.js +118 -0
- package/dist/StreamCanvasCapture-yyl20qd9.d.ts +152 -0
- package/dist/{BaseWasmProvider-C_DLEI40.esm.js → WasmUtilProvider-CiEN7Gjn.esm.js} +183 -11
- package/dist/{addressSearch-BpTbTWCa.esm.js → addressSearch-DvmWXKZg.esm.js} +63 -57
- package/dist/{ae-signature-DDDZmWXj.esm.js → ae-signature-BFZta3TZ.esm.js} +1 -1
- package/dist/ae-signature.d.ts +3 -3
- package/dist/ae-signature.esm.js +6 -5
- package/dist/antifraud.d.ts +5 -46
- package/dist/antifraud.esm.js +6 -43
- package/dist/antifraudManager-CkV4u-LE.esm.js +55 -0
- package/dist/antifraudManager-CznnhyvD.d.ts +63 -0
- package/dist/{antifraudStateMachine-O0TMf6yc.esm.js → antifraudStateMachine-Ccrb-Jxc.esm.js} +2 -2
- package/dist/apiError-B-j-gyDx.esm.js +51 -0
- package/dist/authentication.d.ts +13 -11
- package/dist/authentication.esm.js +26 -22
- package/dist/{authenticationManager-C83GNIhl.d.ts → authenticationManager-CIVY80H9.d.ts} +4 -4
- package/dist/{authenticationManager-5M-fKzXx.esm.js → authenticationManager-ZNotsWnC.esm.js} +6 -6
- package/dist/{authenticationStateMachine-BMZqatiF.esm.js → authenticationStateMachine-DksVbF_H.esm.js} +21 -9
- package/dist/{backCameraStream-DMdMeGk2.esm.js → backCameraStream-D7Wo4Nbx.esm.js} +95 -7
- package/dist/{session-CGtQJJzB.esm.js → browserSimulation-B1dWiXp7.esm.js} +61 -476
- package/dist/camera.d.ts +4 -3
- package/dist/camera.esm.js +4 -3
- package/dist/canvas-SKcRBxsk.esm.js +230 -0
- package/dist/consent.d.ts +4 -398
- package/dist/consent.esm.js +6 -77
- package/dist/consentManager-BLd51QiW.d.ts +419 -0
- package/dist/consentManager-BYo9Nu1r.esm.js +90 -0
- package/dist/{consentStateMachine-CCT-B60O.esm.js → consentStateMachine-BG3yL8aC.esm.js} +9 -6
- package/dist/cpf-ocr.d.ts +4 -199
- package/dist/cpf-ocr.esm.js +8 -177
- package/dist/cpfOcrManager-BnieFXuG.d.ts +216 -0
- package/dist/cpfOcrManager-sSKegxox.esm.js +190 -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 +8 -158
- package/dist/curp-validation.esm.js +6 -108
- package/dist/curpValidationManager-CFem6zP9.esm.js +122 -0
- package/dist/curpValidationManager-RttixpIc.d.ts +184 -0
- package/dist/{curpValidationStateMachine-CitWLr2c.esm.js → curpValidationStateMachine-B7V_qp66.esm.js} +20 -13
- package/dist/custom-fields.d.ts +2 -2
- package/dist/custom-fields.esm.js +4 -4
- package/dist/custom-watchlist.d.ts +1 -1
- package/dist/custom-watchlist.esm.js +4 -41
- package/dist/customWatchlistStateMachine-HmFybXLX.esm.js +50 -0
- package/dist/{deepsightLoader-Cm4JIT_z.esm.js → deepsightLoader-65k1Appi.esm.js} +19 -10
- package/dist/{deepsightService-CEVxzehb.d.ts → deepsightService-B7ShOkWL.d.ts} +8 -160
- package/dist/deepsightService-CrHmvx8X.esm.js +276 -0
- package/dist/device.esm.js +4 -3
- package/dist/document-capture.d.ts +992 -83
- package/dist/document-capture.esm.js +34 -8
- package/dist/document-upload.d.ts +47 -47
- package/dist/document-upload.esm.js +7 -7
- package/dist/{documentCaptureStateMachine-BqzTDy9k.esm.js → documentCaptureStateMachine-WYV1r9le.esm.js} +90 -6
- package/dist/dynamic-forms.d.ts +20 -5
- package/dist/dynamic-forms.esm.js +150 -61
- package/dist/ekyb.d.ts +32 -13
- package/dist/ekyb.esm.js +25 -15
- package/dist/{ekybStateMachine-BR2let5f.esm.js → ekybStateMachine-aYixw2sL.esm.js} +319 -207
- package/dist/ekyc.d.ts +10 -78
- package/dist/ekyc.esm.js +17 -12
- package/dist/{ekycStateMachine-oeO0Iekd.esm.js → ekycStateMachine-CXbpaJJn.esm.js} +201 -113
- package/dist/electronic-signature.d.ts +3 -3
- package/dist/electronic-signature.esm.js +5 -4
- package/dist/{electronicSignatureManager-D9OHzTpG.esm.js → electronicSignatureManager-BaECdJ1u.esm.js} +91 -23
- package/dist/email.d.ts +4 -3
- package/dist/email.esm.js +6 -5
- package/dist/{emailManager-wAV0LE-H.esm.js → emailManager--D5G3ChB.esm.js} +30 -7
- package/dist/{emailManager-DIfnS5g1.d.ts → emailManager-lAzDoQOs.d.ts} +66 -8
- package/dist/{emailStateMachine-DOf4j58N.esm.js → emailStateMachine-CxTOMAjC.esm.js} +46 -11
- package/dist/{endpoints-CnN3SyDa.esm.js → endpoints-BeTK0Mlt.esm.js} +6 -3
- package/dist/{events-D6-e4vok.esm.js → events-Dvvriq9l.esm.js} +3 -1
- package/dist/events.d.ts +2 -0
- package/dist/events.esm.js +1 -1
- package/dist/extensibility.d.ts +32 -16
- package/dist/extensibility.esm.js +55 -33
- package/dist/face-match.d.ts +32 -2
- package/dist/face-match.esm.js +5 -5
- package/dist/{faceCaptureManagerFactory-yqtpxjnN.d.ts → faceCaptureManagerFactory-C_hRHx8a.d.ts} +35 -11
- package/dist/{faceCaptureManagerFactory-Dh2PdGlF.esm.js → faceCaptureManagerFactory-kqbUqtrr.esm.js} +21 -5
- package/dist/{faceCaptureSetup-B3faSpYA.esm.js → faceCaptureSetup-CtvHWd3x.esm.js} +68 -183
- package/dist/{faceMatchStateMachine-DNFrxTFS.esm.js → faceMatchStateMachine-DdGXUBnx.esm.js} +60 -6
- package/dist/field-comparison.d.ts +4 -0
- package/dist/field-comparison.esm.js +7 -0
- package/dist/fieldComparisonManager-Bu5TaSr3.d.ts +76 -0
- package/dist/fieldComparisonManager-COGI2ARD.esm.js +162 -0
- package/dist/fiscal-qr.d.ts +59 -0
- package/dist/fiscal-qr.esm.js +323 -0
- package/dist/flow-events.d.ts +6 -5
- package/dist/flow.d.ts +23 -15
- package/dist/flow.esm.js +63 -17
- package/dist/flowCompletionService-BdR2cGgB.d.ts +19 -0
- package/dist/flowCompletionService-DdGojV9K.esm.js +20 -0
- package/dist/{flowServices-DG3IdWw6.esm.js → flowServices-BTuHLHVr.esm.js} +10 -5
- package/dist/geolocation.d.ts +4 -4
- package/dist/geolocation.esm.js +6 -6
- package/dist/{geolocationStateMachine-asasuHY2.esm.js → geolocationStateMachine-Dvh7X0wF.esm.js} +5 -5
- package/dist/getBrowser-C8DP7oTB.esm.js +8 -0
- package/dist/{getBrowser-BSXUTWXw.esm.js → getDeviceClass-C0olyNFS.esm.js} +1 -8
- package/dist/{getDeviceClass-BSntT9_j.esm.js → getDeviceClass-C8Do2qYu.esm.js} +1 -1
- package/dist/government-validation.d.ts +28 -8
- package/dist/government-validation.esm.js +19 -8
- package/dist/{governmentValidationStateMachine-BDDYrJTo.esm.js → governmentValidationStateMachine-DcJ-BfsC.esm.js} +35 -77
- package/dist/home.d.ts +15 -14
- package/dist/home.esm.js +2 -2
- package/dist/http-Cai3IoLS.esm.js +0 -0
- package/dist/http.esm.js +1 -0
- package/dist/id-ocr.d.ts +54 -54
- package/dist/id-ocr.esm.js +5 -5
- package/dist/id-verification.d.ts +27 -27
- package/dist/id-verification.esm.js +4 -4
- package/dist/id.d.ts +12 -10
- package/dist/id.esm.js +36 -26
- package/dist/{idCaptureManager-Fyd0eam-.d.ts → idCaptureManager-D-QYESvF.d.ts} +28 -14
- package/dist/{idCaptureManager-ZPkD7Gjk.esm.js → idCaptureManager-DGVv5l1_.esm.js} +22 -7
- package/dist/{idCaptureStateMachine-BK0bPHoc.esm.js → idCaptureStateMachine-DHi7HydI.esm.js} +172 -123
- package/dist/{idOcrStateMachine-YbjjC_Gg.esm.js → idOcrStateMachine-CDQ5d_VM.esm.js} +4 -4
- package/dist/{idVerificationStateMachine-xbw9HP1Z.esm.js → idVerificationStateMachine-kRxwImzO.esm.js} +2 -2
- package/dist/identity-reuse.d.ts +4 -530
- package/dist/identity-reuse.esm.js +8 -274
- package/dist/identityReuseManager-C6n_97dw.esm.js +95 -0
- package/dist/identityReuseManager-DwLtVzUn.d.ts +428 -0
- package/dist/identityReuseStateMachine-BfE5YiEr.esm.js +148 -0
- package/dist/{index-BcRG8rtJ.d.ts → index-B5hPA0Bg.d.ts} +2 -2
- package/dist/{index-DZoqeAo9.d.ts → index-B9NysVDB.d.ts} +469 -195
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +10 -8
- package/dist/{invokeOnCaptureCallback-rc6kBHo5.esm.js → invokeOnCaptureCallback-ygByVdnn.esm.js} +1 -1
- package/dist/{lib-BB0B_qQX.esm.js → lib-BY67lgbq.esm.js} +1 -1
- package/dist/mandatory-consent.d.ts +8 -412
- package/dist/mandatory-consent.esm.js +6 -76
- package/dist/mandatoryConsentManager-H6D18cZB.esm.js +89 -0
- package/dist/mandatoryConsentManager-KfIlURRY.d.ts +429 -0
- package/dist/{mandatoryConsentStateMachine-Cnco1jvn.esm.js → mandatoryConsentStateMachine-DtQNW1ji.esm.js} +6 -6
- package/dist/openviduLazy-B8L--0oe.esm.js +3 -0
- package/dist/{openviduLazy-Cok70ZSg.esm.js → openviduLazy-Dh14JNJc.esm.js} +2 -2
- package/dist/otp-CGMdUzBC.esm.js +33 -0
- package/dist/otp-DF5A0sFx.d.ts +8 -0
- package/dist/permissionGuards-C1ispV96.esm.js +23 -0
- package/dist/permissionServices-CG3bMSfG.esm.js +130 -0
- package/dist/phone.d.ts +4 -3
- package/dist/phone.esm.js +6 -5
- package/dist/{phoneManager-DAJbGhlY.esm.js → phoneManager-BmF-0Ez4.esm.js} +30 -7
- package/dist/{phoneManager-B6M30hKE.d.ts → phoneManager-fPmIBYQK.d.ts} +65 -7
- package/dist/{phoneStateMachine-CuPARRaT.esm.js → phoneStateMachine-BiV0yoEx.esm.js} +46 -11
- package/dist/{qe-signature-DFo_Cc-I.esm.js → qe-signature-CUYPcHVo.esm.js} +1 -1
- package/dist/qe-signature.d.ts +3 -3
- package/dist/qe-signature.esm.js +6 -5
- package/dist/{recordingService-Ig2UgbLv.esm.js → recordingService-Bn9EdCmz.esm.js} +197 -179
- package/dist/redirect-to-mobile.d.ts +6 -104
- package/dist/redirect-to-mobile.esm.js +6 -99
- package/dist/redirectToMobileManager-BNe3IzC_.d.ts +178 -0
- package/dist/redirectToMobileManager-Dy3t7o0C.esm.js +159 -0
- package/dist/{redirectToMobileStateMachine-BOEqe46A.esm.js → redirectToMobileStateMachine-DyAdRxfP.esm.js} +28 -19
- package/dist/{runChildModule-CqqwqAkW.esm.js → runChildModule-CuoHZ1cx.esm.js} +35 -3
- package/dist/selfie.d.ts +13 -11
- package/dist/selfie.esm.js +27 -23
- package/dist/{selfieManager-Duisl7qN.esm.js → selfieManager-BjCoKRy0.esm.js} +6 -6
- package/dist/{selfieManager-D0lSgd-J.d.ts → selfieManager-dUbKRzOh.d.ts} +4 -4
- package/dist/{selfieStateMachine-D76whWEf.esm.js → selfieStateMachine-b4F2q9zw.esm.js} +5 -3
- package/dist/session-DoVb-OcB.esm.js +152 -0
- package/dist/session.d.ts +37 -5
- package/dist/session.esm.js +12 -7
- package/dist/sessionInitializer-B8H5MsXM.esm.js +366 -0
- package/dist/{setup-C5AITV8m.d.ts → setup-BbkprdVv.d.ts} +57 -6
- package/dist/{setup-DsM8IG7k.esm.js → setup-BqEfrdja.esm.js} +162 -24
- package/dist/signature.d.ts +2 -2
- package/dist/signature.esm.js +4 -4
- package/dist/{signatureStateMachine-B5-QVUve.esm.js → signatureStateMachine-C5qqYLRz.esm.js} +3 -3
- package/dist/stats-BMNUG1AU.esm.js +41 -0
- package/dist/stats.d.ts +13 -2
- package/dist/stats.esm.js +3 -2
- package/dist/trust-graph.d.ts +33 -4
- package/dist/trust-graph.esm.js +21 -15
- package/dist/{types-CFV9G_7j.d.ts → types-Bj9hdFjU.d.ts} +1 -1
- package/dist/{types-BP1m8VRw.d.ts → types-DOUhndhT.d.ts} +14 -2
- package/dist/types-DsnEVMhr.esm.js +34 -0
- package/dist/types-DvGZI7BF.d.ts +131 -0
- package/dist/{types-B06Ypu2F.d.ts → types-NuT8ftBV.d.ts} +1 -1
- package/dist/types-ya0LN_MX.d.ts +5 -0
- package/dist/{warmup-CEcppFiS.d.ts → warmup-Dg8Lh-50.d.ts} +8 -0
- package/dist/wasm.d.ts +6 -4
- package/dist/wasm.esm.js +11 -9
- package/dist/watchlist-for-business.d.ts +1 -1
- package/dist/watchlist-for-business.esm.js +5 -73
- package/dist/watchlist.d.ts +1 -1
- package/dist/watchlist.esm.js +4 -41
- package/dist/watchlistForBusinessStateMachine-DMl8j2Ov.esm.js +74 -0
- package/dist/watchlistStateMachine-DmQlqI6L.esm.js +50 -0
- package/dist/workflow.d.ts +153 -100
- package/dist/workflow.esm.js +156 -80
- package/package.json +19 -1
- package/dist/StateMachine-BCQrZJhf.d.ts +0 -2
- package/dist/WasmUtilProvider-j98OJf-S.esm.js +0 -114
- package/dist/browserSimulation-gxD8cSpM.esm.js +0 -20
- package/dist/deepsightService-O74l4Y__.esm.js +0 -489
- package/dist/displayErrors-DqJ_IbsG.d.ts +0 -39
- package/dist/flowCompletionService-DhkT4SRY.d.ts +0 -10
- package/dist/flowCompletionService-P54yzGvA.esm.js +0 -13
- package/dist/openviduLazy-Cm0XFh_v.esm.js +0 -3
- package/dist/permissionServices-D_i6nzEw.esm.js +0 -50
- package/dist/stats-CIfiPzb1.esm.js +0 -16
- package/dist/types-CAD4va6a.d.ts +0 -5
- package/dist/watchlistServices-DMbUhkBX.esm.js +0 -12
- /package/dist/{Actor-CI32dTbG.d.ts → Actor-Y0_Fj-KL.d.ts} +0 -0
- /package/dist/{ITimerCapability-C67ZRskg.esm.js → ITimerCapability-CB0I1Uf2.esm.js} +0 -0
- /package/dist/{Manager-C8PrhBOx.d.ts → Manager-BHn8wH8K.d.ts} +0 -0
- /package/dist/{camera-PA2Ljri3.esm.js → camera-DJWm3V4g.esm.js} +0 -0
- /package/dist/{camera-DBSxa6ML.d.ts → camera-SRBpPq2X.d.ts} +0 -0
- /package/dist/{chunk-CRF6K_H_.esm.js → chunk-CMUKZ2uL.esm.js} +0 -0
- /package/dist/{cpf-PPz2Njto.esm.js → cpf-BRzggV8G.esm.js} +0 -0
- /package/dist/{dateUtils-UoN5xswP.esm.js → dateUtils-AksLQmgV.esm.js} +0 -0
- /package/dist/{platform-CfrjKhmi.esm.js → platform-SKvEfCBh.esm.js} +0 -0
- /package/dist/{xstate.esm-B70JrNqo.esm.js → xstate.esm-C9wncMQa.esm.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./warmup-
|
|
2
|
-
import { a as reset, i as isConfigured, s as setup, t as SetupOptions } from "./setup-
|
|
1
|
+
import "./warmup-Dg8Lh-50.js";
|
|
2
|
+
import { a as reset, i as isConfigured, s as setup, t as SetupOptions } from "./setup-BbkprdVv.js";
|
|
3
3
|
export { type SetupOptions, isConfigured, reset, setup };
|
package/dist/index.esm.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "./
|
|
3
|
-
import "./WasmUtilProvider-j98OJf-S.esm.js";
|
|
1
|
+
import "./WasmUtilProvider-CiEN7Gjn.esm.js";
|
|
2
|
+
import { a as setup, n as isConfigured, r as reset } from "./setup-BqEfrdja.esm.js";
|
|
4
3
|
import "./BrowserTimerProvider-DhNc_x02.esm.js";
|
|
5
4
|
import "./api-CESGtpbH.esm.js";
|
|
6
|
-
import "./events-
|
|
7
|
-
import "./endpoints-
|
|
8
|
-
import "./
|
|
9
|
-
import "./IpifyProvider-
|
|
10
|
-
import "./browserSimulation-
|
|
5
|
+
import "./events-Dvvriq9l.esm.js";
|
|
6
|
+
import "./endpoints-BeTK0Mlt.esm.js";
|
|
7
|
+
import "./stats-BMNUG1AU.esm.js";
|
|
8
|
+
import "./IpifyProvider-D4LWD15E.esm.js";
|
|
9
|
+
import "./browserSimulation-B1dWiXp7.esm.js";
|
|
10
|
+
import "./sessionInitializer-B8H5MsXM.esm.js";
|
|
11
|
+
import "./platform-SKvEfCBh.esm.js";
|
|
12
|
+
import "./getBrowser-C8DP7oTB.esm.js";
|
|
11
13
|
|
|
12
14
|
export { isConfigured, reset, setup };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as __toCommonJS, n as __esm, r as __export, t as __commonJS } from "./chunk-
|
|
1
|
+
import { i as __toCommonJS, n as __esm, r as __export, t as __commonJS } from "./chunk-CMUKZ2uL.esm.js";
|
|
2
2
|
|
|
3
3
|
//#region ../../node_modules/.pnpm/jsnlog@2.30.0/node_modules/jsnlog/jsnlog.js
|
|
4
4
|
var require_jsnlog = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/jsnlog@2.30.0/node_modules/jsnlog/jsnlog.js": ((exports) => {
|
|
@@ -1,412 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "./Actor-
|
|
3
|
-
import "./camera-
|
|
4
|
-
import "./types-
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
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: xstate381.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]: xstate381.ActorRefFromLogic<xstate381.PromiseActorLogic<FetchMandatoryConsentResponse, {
|
|
47
|
-
config: MandatoryConsentConfig;
|
|
48
|
-
}, xstate381.EventObject>> | xstate381.ActorRefFromLogic<xstate381.PromiseActorLogic<void, {
|
|
49
|
-
consentId: string;
|
|
50
|
-
isSigned: boolean;
|
|
51
|
-
}, xstate381.EventObject>> | undefined;
|
|
52
|
-
}, xstate381.Values<{
|
|
53
|
-
fetchConsent: {
|
|
54
|
-
src: "fetchConsent";
|
|
55
|
-
logic: xstate381.PromiseActorLogic<FetchMandatoryConsentResponse, {
|
|
56
|
-
config: MandatoryConsentConfig;
|
|
57
|
-
}, xstate381.EventObject>;
|
|
58
|
-
id: string | undefined;
|
|
59
|
-
};
|
|
60
|
-
submitConsent: {
|
|
61
|
-
src: "submitConsent";
|
|
62
|
-
logic: xstate381.PromiseActorLogic<void, {
|
|
63
|
-
consentId: string;
|
|
64
|
-
isSigned: boolean;
|
|
65
|
-
}, xstate381.EventObject>;
|
|
66
|
-
id: string | undefined;
|
|
67
|
-
};
|
|
68
|
-
}>, xstate381.Values<{
|
|
69
|
-
setConsent: {
|
|
70
|
-
type: "setConsent";
|
|
71
|
-
params: xstate381.NonReducibleUnknown;
|
|
72
|
-
};
|
|
73
|
-
setError: {
|
|
74
|
-
type: "setError";
|
|
75
|
-
params: xstate381.NonReducibleUnknown;
|
|
76
|
-
};
|
|
77
|
-
clearError: {
|
|
78
|
-
type: "clearError";
|
|
79
|
-
params: xstate381.NonReducibleUnknown;
|
|
80
|
-
};
|
|
81
|
-
resetContext: {
|
|
82
|
-
type: "resetContext";
|
|
83
|
-
params: xstate381.NonReducibleUnknown;
|
|
84
|
-
};
|
|
85
|
-
toggleSigned: {
|
|
86
|
-
type: "toggleSigned";
|
|
87
|
-
params: xstate381.NonReducibleUnknown;
|
|
88
|
-
};
|
|
89
|
-
}>, {
|
|
90
|
-
type: "canSubmit";
|
|
91
|
-
params: unknown;
|
|
92
|
-
}, never, "error" | "idle" | "closed" | "finished" | "loading" | "display" | "submitting", string, MandatoryConsentInput, xstate381.NonReducibleUnknown, xstate381.EventObject, xstate381.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: xstate381.PromiseActorLogic<FetchMandatoryConsentResponse, {
|
|
102
|
-
config: MandatoryConsentConfig;
|
|
103
|
-
}, xstate381.EventObject>;
|
|
104
|
-
id: string | undefined;
|
|
105
|
-
} extends infer T ? T extends {
|
|
106
|
-
src: "fetchConsent";
|
|
107
|
-
logic: xstate381.PromiseActorLogic<FetchMandatoryConsentResponse, {
|
|
108
|
-
config: MandatoryConsentConfig;
|
|
109
|
-
}, xstate381.EventObject>;
|
|
110
|
-
id: string | undefined;
|
|
111
|
-
} ? T extends {
|
|
112
|
-
src: TSrc;
|
|
113
|
-
} ? xstate381.ConditionalRequired<[options?: ({
|
|
114
|
-
id?: T["id"] | undefined;
|
|
115
|
-
systemId?: string;
|
|
116
|
-
input?: xstate381.InputFrom<T["logic"]> | undefined;
|
|
117
|
-
syncSnapshot?: boolean;
|
|
118
|
-
} & { [K in xstate381.RequiredActorOptions<T>]: unknown }) | undefined], xstate381.IsNotNever<xstate381.RequiredActorOptions<T>>> : never : never : never) | ({
|
|
119
|
-
src: "submitConsent";
|
|
120
|
-
logic: xstate381.PromiseActorLogic<void, {
|
|
121
|
-
consentId: string;
|
|
122
|
-
isSigned: boolean;
|
|
123
|
-
}, xstate381.EventObject>;
|
|
124
|
-
id: string | undefined;
|
|
125
|
-
} extends infer T_1 ? T_1 extends {
|
|
126
|
-
src: "submitConsent";
|
|
127
|
-
logic: xstate381.PromiseActorLogic<void, {
|
|
128
|
-
consentId: string;
|
|
129
|
-
isSigned: boolean;
|
|
130
|
-
}, xstate381.EventObject>;
|
|
131
|
-
id: string | undefined;
|
|
132
|
-
} ? T_1 extends {
|
|
133
|
-
src: TSrc;
|
|
134
|
-
} ? xstate381.ConditionalRequired<[options?: ({
|
|
135
|
-
id?: T_1["id"] | undefined;
|
|
136
|
-
systemId?: string;
|
|
137
|
-
input?: xstate381.InputFrom<T_1["logic"]> | undefined;
|
|
138
|
-
syncSnapshot?: boolean;
|
|
139
|
-
} & { [K_1 in xstate381.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate381.IsNotNever<xstate381.RequiredActorOptions<T_1>>> : never : never : never)): xstate381.ActorRefFromLogic<xstate381.GetConcreteByKey<xstate381.Values<{
|
|
140
|
-
fetchConsent: {
|
|
141
|
-
src: "fetchConsent";
|
|
142
|
-
logic: xstate381.PromiseActorLogic<FetchMandatoryConsentResponse, {
|
|
143
|
-
config: MandatoryConsentConfig;
|
|
144
|
-
}, xstate381.EventObject>;
|
|
145
|
-
id: string | undefined;
|
|
146
|
-
};
|
|
147
|
-
submitConsent: {
|
|
148
|
-
src: "submitConsent";
|
|
149
|
-
logic: xstate381.PromiseActorLogic<void, {
|
|
150
|
-
consentId: string;
|
|
151
|
-
isSigned: boolean;
|
|
152
|
-
}, xstate381.EventObject>;
|
|
153
|
-
id: string | undefined;
|
|
154
|
-
};
|
|
155
|
-
}>, "src", TSrc>["logic"]>;
|
|
156
|
-
<TLogic extends xstate381.AnyActorLogic>(src: TLogic, ...[options]: xstate381.ConditionalRequired<[options?: ({
|
|
157
|
-
id?: never;
|
|
158
|
-
systemId?: string;
|
|
159
|
-
input?: xstate381.InputFrom<TLogic> | undefined;
|
|
160
|
-
syncSnapshot?: boolean;
|
|
161
|
-
} & { [K in xstate381.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate381.IsNotNever<xstate381.RequiredLogicInput<TLogic>>>): xstate381.ActorRefFromLogic<TLogic>;
|
|
162
|
-
};
|
|
163
|
-
input: MandatoryConsentInput;
|
|
164
|
-
self: xstate381.ActorRef<xstate381.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, xstate381.AnyActorRef | undefined>, xstate381.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
|
-
}, xstate381.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: xstate381.ActorRef<xstate381.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, xstate381.AnyActorRef>, xstate381.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
|
-
}, xstate381.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: xstate381.ActorRef<xstate381.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, xstate381.AnyActorRef>, xstate381.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
|
-
}, xstate381.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 };
|
|
1
|
+
import "./Manager-BHn8wH8K.js";
|
|
2
|
+
import "./Actor-Y0_Fj-KL.js";
|
|
3
|
+
import "./camera-SRBpPq2X.js";
|
|
4
|
+
import "./types-Bj9hdFjU.js";
|
|
5
|
+
import "./types-DvGZI7BF.js";
|
|
6
|
+
import "./types-DOUhndhT.js";
|
|
7
|
+
import { a as MandatoryConsentActor, i as createMandatoryConsentManagerFromActor, n as MandatoryConsentState, o as mandatoryConsentMachine, r as createMandatoryConsentManager, s as MandatoryConsentConfig, t as MandatoryConsentManager } from "./mandatoryConsentManager-KfIlURRY.js";
|
|
8
|
+
export { type MandatoryConsentActor, type MandatoryConsentConfig, type MandatoryConsentManager, type MandatoryConsentState, createMandatoryConsentManager, createMandatoryConsentManagerFromActor, mandatoryConsentMachine };
|
|
@@ -1,78 +1,8 @@
|
|
|
1
1
|
import "./api-CESGtpbH.esm.js";
|
|
2
|
-
import
|
|
3
|
-
import "./endpoints-
|
|
4
|
-
import
|
|
5
|
-
import { t as mandatoryConsentMachine } from "./mandatoryConsentStateMachine-
|
|
2
|
+
import "./events-Dvvriq9l.esm.js";
|
|
3
|
+
import "./endpoints-BeTK0Mlt.esm.js";
|
|
4
|
+
import "./xstate.esm-C9wncMQa.esm.js";
|
|
5
|
+
import { t as mandatoryConsentMachine } from "./mandatoryConsentStateMachine-DtQNW1ji.esm.js";
|
|
6
|
+
import { n as createMandatoryConsentManagerFromActor, t as createMandatoryConsentManager } from "./mandatoryConsentManager-H6D18cZB.esm.js";
|
|
6
7
|
|
|
7
|
-
|
|
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 };
|
|
8
|
+
export { createMandatoryConsentManager, createMandatoryConsentManagerFromActor, mandatoryConsentMachine };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-Dvvriq9l.esm.js";
|
|
2
|
+
import { c as createManager, s as createActor } from "./xstate.esm-C9wncMQa.esm.js";
|
|
3
|
+
import { t as mandatoryConsentMachine } from "./mandatoryConsentStateMachine-DtQNW1ji.esm.js";
|
|
4
|
+
|
|
5
|
+
//#region src/modules/mandatory-consent/mandatoryConsentActor.ts
|
|
6
|
+
function createMandatoryConsentActor(options) {
|
|
7
|
+
return createActor(mandatoryConsentMachine, { input: { config: options.config } }).start();
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/modules/mandatory-consent/mandatoryConsentManager.ts
|
|
12
|
+
function mapState(snapshot) {
|
|
13
|
+
const typedSnapshot = snapshot;
|
|
14
|
+
const { context } = typedSnapshot;
|
|
15
|
+
const canSubmit = Boolean(context.isSigned && context.consent?.id);
|
|
16
|
+
if (typedSnapshot.matches("idle")) return { status: "idle" };
|
|
17
|
+
if (typedSnapshot.matches("loading")) return { status: "loading" };
|
|
18
|
+
if (typedSnapshot.matches("display")) return {
|
|
19
|
+
status: "display",
|
|
20
|
+
title: context.consent?.title ?? "",
|
|
21
|
+
text: context.consent?.text ?? "",
|
|
22
|
+
isSigned: context.isSigned,
|
|
23
|
+
canSubmit,
|
|
24
|
+
error: context.error
|
|
25
|
+
};
|
|
26
|
+
if (typedSnapshot.matches("submitting")) return {
|
|
27
|
+
status: "submitting",
|
|
28
|
+
title: context.consent?.title ?? "",
|
|
29
|
+
text: context.consent?.text ?? "",
|
|
30
|
+
isSigned: context.isSigned,
|
|
31
|
+
canSubmit: false
|
|
32
|
+
};
|
|
33
|
+
if (typedSnapshot.matches("finished")) return { status: "finished" };
|
|
34
|
+
if (typedSnapshot.matches("closed")) return { status: "closed" };
|
|
35
|
+
if (typedSnapshot.matches("error")) return {
|
|
36
|
+
status: "error",
|
|
37
|
+
error: context.error ?? "Unknown error"
|
|
38
|
+
};
|
|
39
|
+
return { status: "idle" };
|
|
40
|
+
}
|
|
41
|
+
function createApi({ actor, trackElementClicked }) {
|
|
42
|
+
return {
|
|
43
|
+
load() {
|
|
44
|
+
actor.send({ type: "LOAD" });
|
|
45
|
+
},
|
|
46
|
+
toggle() {
|
|
47
|
+
actor.send({ type: "TOGGLE" });
|
|
48
|
+
},
|
|
49
|
+
submit() {
|
|
50
|
+
trackElementClicked?.("submit");
|
|
51
|
+
actor.send({ type: "SUBMIT" });
|
|
52
|
+
},
|
|
53
|
+
cancel() {
|
|
54
|
+
trackElementClicked?.("cancel");
|
|
55
|
+
actor.send({ type: "CANCEL" });
|
|
56
|
+
},
|
|
57
|
+
retry() {
|
|
58
|
+
trackElementClicked?.("retry");
|
|
59
|
+
actor.send({ type: "RETRY" });
|
|
60
|
+
},
|
|
61
|
+
reset() {
|
|
62
|
+
actor.send({ type: "RESET" });
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function createMandatoryConsentManager(options) {
|
|
67
|
+
return createManager({
|
|
68
|
+
actor: createMandatoryConsentActor(options),
|
|
69
|
+
mapState,
|
|
70
|
+
createApi,
|
|
71
|
+
instrumentation: createManagerInstrumentation(eventModuleNames.mlConsent)
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Creates a mandatory-consent manager from a pre-built actor.
|
|
76
|
+
* Use this when overriding the machine via `.provide()` for custom backends
|
|
77
|
+
* or for story-isolation testing.
|
|
78
|
+
*/
|
|
79
|
+
function createMandatoryConsentManagerFromActor(actor) {
|
|
80
|
+
return createManager({
|
|
81
|
+
actor,
|
|
82
|
+
mapState,
|
|
83
|
+
createApi,
|
|
84
|
+
instrumentation: createManagerInstrumentation(eventModuleNames.mlConsent)
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
//#endregion
|
|
89
|
+
export { createMandatoryConsentManagerFromActor as n, createMandatoryConsentManager as t };
|