@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
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
import { t as Manager } from "./Manager-BHn8wH8K.js";
|
|
2
|
+
import { t as ActorRefFrom } from "./Actor-Y0_Fj-KL.js";
|
|
3
|
+
import { a as RegulationTypes } from "./types-DOUhndhT.js";
|
|
4
|
+
import * as xstate591 from "xstate";
|
|
5
|
+
|
|
6
|
+
//#region src/modules/mandatory-consent/types.d.ts
|
|
7
|
+
type RegulatoryConsentType = 'MANDATORY' | 'ML';
|
|
8
|
+
type MandatoryConsentConfig = {
|
|
9
|
+
consentType: RegulationTypes;
|
|
10
|
+
language?: string;
|
|
11
|
+
/** 'MANDATORY' (default) for MANDATORY_CONSENT, 'ML' for ML_CONSENT. */
|
|
12
|
+
type?: RegulatoryConsentType;
|
|
13
|
+
};
|
|
14
|
+
type MandatoryConsent = {
|
|
15
|
+
id: string;
|
|
16
|
+
title: string;
|
|
17
|
+
text: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
consentType: string;
|
|
20
|
+
};
|
|
21
|
+
type FetchMandatoryConsentResponse = {
|
|
22
|
+
consents: MandatoryConsent[];
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/modules/mandatory-consent/mandatoryConsentStateMachine.d.ts
|
|
26
|
+
type MandatoryConsentContext = {
|
|
27
|
+
config: MandatoryConsentConfig;
|
|
28
|
+
consent: MandatoryConsent | undefined;
|
|
29
|
+
isSigned: boolean;
|
|
30
|
+
error: string | undefined;
|
|
31
|
+
};
|
|
32
|
+
type MandatoryConsentInput = {
|
|
33
|
+
config: MandatoryConsentConfig;
|
|
34
|
+
};
|
|
35
|
+
declare const mandatoryConsentMachine: xstate591.StateMachine<MandatoryConsentContext, {
|
|
36
|
+
type: "LOAD";
|
|
37
|
+
} | {
|
|
38
|
+
type: "TOGGLE";
|
|
39
|
+
} | {
|
|
40
|
+
type: "SUBMIT";
|
|
41
|
+
} | {
|
|
42
|
+
type: "CANCEL";
|
|
43
|
+
} | {
|
|
44
|
+
type: "RETRY";
|
|
45
|
+
} | {
|
|
46
|
+
type: "RESET";
|
|
47
|
+
}, {
|
|
48
|
+
[x: string]: xstate591.ActorRefFromLogic<xstate591.PromiseActorLogic<FetchMandatoryConsentResponse, {
|
|
49
|
+
config: MandatoryConsentConfig;
|
|
50
|
+
}, xstate591.EventObject>> | xstate591.ActorRefFromLogic<xstate591.PromiseActorLogic<void, {
|
|
51
|
+
consentId: string;
|
|
52
|
+
isSigned: boolean;
|
|
53
|
+
}, xstate591.EventObject>> | undefined;
|
|
54
|
+
}, xstate591.Values<{
|
|
55
|
+
fetchConsent: {
|
|
56
|
+
src: "fetchConsent";
|
|
57
|
+
logic: xstate591.PromiseActorLogic<FetchMandatoryConsentResponse, {
|
|
58
|
+
config: MandatoryConsentConfig;
|
|
59
|
+
}, xstate591.EventObject>;
|
|
60
|
+
id: string | undefined;
|
|
61
|
+
};
|
|
62
|
+
submitConsent: {
|
|
63
|
+
src: "submitConsent";
|
|
64
|
+
logic: xstate591.PromiseActorLogic<void, {
|
|
65
|
+
consentId: string;
|
|
66
|
+
isSigned: boolean;
|
|
67
|
+
}, xstate591.EventObject>;
|
|
68
|
+
id: string | undefined;
|
|
69
|
+
};
|
|
70
|
+
}>, xstate591.Values<{
|
|
71
|
+
setConsent: {
|
|
72
|
+
type: "setConsent";
|
|
73
|
+
params: xstate591.NonReducibleUnknown;
|
|
74
|
+
};
|
|
75
|
+
setError: {
|
|
76
|
+
type: "setError";
|
|
77
|
+
params: xstate591.NonReducibleUnknown;
|
|
78
|
+
};
|
|
79
|
+
clearError: {
|
|
80
|
+
type: "clearError";
|
|
81
|
+
params: xstate591.NonReducibleUnknown;
|
|
82
|
+
};
|
|
83
|
+
toggleSigned: {
|
|
84
|
+
type: "toggleSigned";
|
|
85
|
+
params: xstate591.NonReducibleUnknown;
|
|
86
|
+
};
|
|
87
|
+
resetContext: {
|
|
88
|
+
type: "resetContext";
|
|
89
|
+
params: xstate591.NonReducibleUnknown;
|
|
90
|
+
};
|
|
91
|
+
}>, {
|
|
92
|
+
type: "canSubmit";
|
|
93
|
+
params: unknown;
|
|
94
|
+
}, never, "error" | "idle" | "closed" | "finished" | "loading" | "submitting" | "display", string, MandatoryConsentInput, xstate591.NonReducibleUnknown, xstate591.EventObject, xstate591.MetaObject, {
|
|
95
|
+
readonly id: "mandatoryConsent";
|
|
96
|
+
readonly initial: "idle";
|
|
97
|
+
readonly context: ({
|
|
98
|
+
input
|
|
99
|
+
}: {
|
|
100
|
+
spawn: {
|
|
101
|
+
<TSrc extends "fetchConsent" | "submitConsent">(logic: TSrc, ...[options]: ({
|
|
102
|
+
src: "fetchConsent";
|
|
103
|
+
logic: xstate591.PromiseActorLogic<FetchMandatoryConsentResponse, {
|
|
104
|
+
config: MandatoryConsentConfig;
|
|
105
|
+
}, xstate591.EventObject>;
|
|
106
|
+
id: string | undefined;
|
|
107
|
+
} extends infer T ? T extends {
|
|
108
|
+
src: "fetchConsent";
|
|
109
|
+
logic: xstate591.PromiseActorLogic<FetchMandatoryConsentResponse, {
|
|
110
|
+
config: MandatoryConsentConfig;
|
|
111
|
+
}, xstate591.EventObject>;
|
|
112
|
+
id: string | undefined;
|
|
113
|
+
} ? T extends {
|
|
114
|
+
src: TSrc;
|
|
115
|
+
} ? xstate591.ConditionalRequired<[options?: ({
|
|
116
|
+
id?: T["id"] | undefined;
|
|
117
|
+
systemId?: string;
|
|
118
|
+
input?: xstate591.InputFrom<T["logic"]> | undefined;
|
|
119
|
+
syncSnapshot?: boolean;
|
|
120
|
+
} & { [K in xstate591.RequiredActorOptions<T>]: unknown }) | undefined], xstate591.IsNotNever<xstate591.RequiredActorOptions<T>>> : never : never : never) | ({
|
|
121
|
+
src: "submitConsent";
|
|
122
|
+
logic: xstate591.PromiseActorLogic<void, {
|
|
123
|
+
consentId: string;
|
|
124
|
+
isSigned: boolean;
|
|
125
|
+
}, xstate591.EventObject>;
|
|
126
|
+
id: string | undefined;
|
|
127
|
+
} extends infer T_1 ? T_1 extends {
|
|
128
|
+
src: "submitConsent";
|
|
129
|
+
logic: xstate591.PromiseActorLogic<void, {
|
|
130
|
+
consentId: string;
|
|
131
|
+
isSigned: boolean;
|
|
132
|
+
}, xstate591.EventObject>;
|
|
133
|
+
id: string | undefined;
|
|
134
|
+
} ? T_1 extends {
|
|
135
|
+
src: TSrc;
|
|
136
|
+
} ? xstate591.ConditionalRequired<[options?: ({
|
|
137
|
+
id?: T_1["id"] | undefined;
|
|
138
|
+
systemId?: string;
|
|
139
|
+
input?: xstate591.InputFrom<T_1["logic"]> | undefined;
|
|
140
|
+
syncSnapshot?: boolean;
|
|
141
|
+
} & { [K_1 in xstate591.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate591.IsNotNever<xstate591.RequiredActorOptions<T_1>>> : never : never : never)): xstate591.ActorRefFromLogic<xstate591.GetConcreteByKey<xstate591.Values<{
|
|
142
|
+
fetchConsent: {
|
|
143
|
+
src: "fetchConsent";
|
|
144
|
+
logic: xstate591.PromiseActorLogic<FetchMandatoryConsentResponse, {
|
|
145
|
+
config: MandatoryConsentConfig;
|
|
146
|
+
}, xstate591.EventObject>;
|
|
147
|
+
id: string | undefined;
|
|
148
|
+
};
|
|
149
|
+
submitConsent: {
|
|
150
|
+
src: "submitConsent";
|
|
151
|
+
logic: xstate591.PromiseActorLogic<void, {
|
|
152
|
+
consentId: string;
|
|
153
|
+
isSigned: boolean;
|
|
154
|
+
}, xstate591.EventObject>;
|
|
155
|
+
id: string | undefined;
|
|
156
|
+
};
|
|
157
|
+
}>, "src", TSrc>["logic"]>;
|
|
158
|
+
<TLogic extends xstate591.AnyActorLogic>(src: TLogic, ...[options]: xstate591.ConditionalRequired<[options?: ({
|
|
159
|
+
id?: never;
|
|
160
|
+
systemId?: string;
|
|
161
|
+
input?: xstate591.InputFrom<TLogic> | undefined;
|
|
162
|
+
syncSnapshot?: boolean;
|
|
163
|
+
} & { [K in xstate591.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate591.IsNotNever<xstate591.RequiredLogicInput<TLogic>>>): xstate591.ActorRefFromLogic<TLogic>;
|
|
164
|
+
};
|
|
165
|
+
input: MandatoryConsentInput;
|
|
166
|
+
self: xstate591.ActorRef<xstate591.MachineSnapshot<MandatoryConsentContext, {
|
|
167
|
+
type: "LOAD";
|
|
168
|
+
} | {
|
|
169
|
+
type: "TOGGLE";
|
|
170
|
+
} | {
|
|
171
|
+
type: "SUBMIT";
|
|
172
|
+
} | {
|
|
173
|
+
type: "CANCEL";
|
|
174
|
+
} | {
|
|
175
|
+
type: "RETRY";
|
|
176
|
+
} | {
|
|
177
|
+
type: "RESET";
|
|
178
|
+
}, Record<string, xstate591.AnyActorRef | undefined>, xstate591.StateValue, string, unknown, any, any>, {
|
|
179
|
+
type: "LOAD";
|
|
180
|
+
} | {
|
|
181
|
+
type: "TOGGLE";
|
|
182
|
+
} | {
|
|
183
|
+
type: "SUBMIT";
|
|
184
|
+
} | {
|
|
185
|
+
type: "CANCEL";
|
|
186
|
+
} | {
|
|
187
|
+
type: "RETRY";
|
|
188
|
+
} | {
|
|
189
|
+
type: "RESET";
|
|
190
|
+
}, xstate591.AnyEventObject>;
|
|
191
|
+
}) => {
|
|
192
|
+
config: MandatoryConsentConfig;
|
|
193
|
+
consent: undefined;
|
|
194
|
+
isSigned: false;
|
|
195
|
+
error: undefined;
|
|
196
|
+
};
|
|
197
|
+
readonly states: {
|
|
198
|
+
readonly idle: {
|
|
199
|
+
readonly on: {
|
|
200
|
+
readonly LOAD: {
|
|
201
|
+
readonly target: "loading";
|
|
202
|
+
readonly actions: "clearError";
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
readonly loading: {
|
|
207
|
+
readonly invoke: {
|
|
208
|
+
readonly id: "fetchConsent";
|
|
209
|
+
readonly src: "fetchConsent";
|
|
210
|
+
readonly input: ({
|
|
211
|
+
context
|
|
212
|
+
}: {
|
|
213
|
+
context: MandatoryConsentContext;
|
|
214
|
+
event: {
|
|
215
|
+
type: "LOAD";
|
|
216
|
+
} | {
|
|
217
|
+
type: "TOGGLE";
|
|
218
|
+
} | {
|
|
219
|
+
type: "SUBMIT";
|
|
220
|
+
} | {
|
|
221
|
+
type: "CANCEL";
|
|
222
|
+
} | {
|
|
223
|
+
type: "RETRY";
|
|
224
|
+
} | {
|
|
225
|
+
type: "RESET";
|
|
226
|
+
};
|
|
227
|
+
self: xstate591.ActorRef<xstate591.MachineSnapshot<MandatoryConsentContext, {
|
|
228
|
+
type: "LOAD";
|
|
229
|
+
} | {
|
|
230
|
+
type: "TOGGLE";
|
|
231
|
+
} | {
|
|
232
|
+
type: "SUBMIT";
|
|
233
|
+
} | {
|
|
234
|
+
type: "CANCEL";
|
|
235
|
+
} | {
|
|
236
|
+
type: "RETRY";
|
|
237
|
+
} | {
|
|
238
|
+
type: "RESET";
|
|
239
|
+
}, Record<string, xstate591.AnyActorRef>, xstate591.StateValue, string, unknown, any, any>, {
|
|
240
|
+
type: "LOAD";
|
|
241
|
+
} | {
|
|
242
|
+
type: "TOGGLE";
|
|
243
|
+
} | {
|
|
244
|
+
type: "SUBMIT";
|
|
245
|
+
} | {
|
|
246
|
+
type: "CANCEL";
|
|
247
|
+
} | {
|
|
248
|
+
type: "RETRY";
|
|
249
|
+
} | {
|
|
250
|
+
type: "RESET";
|
|
251
|
+
}, xstate591.AnyEventObject>;
|
|
252
|
+
}) => {
|
|
253
|
+
config: MandatoryConsentConfig;
|
|
254
|
+
};
|
|
255
|
+
readonly onDone: {
|
|
256
|
+
readonly target: "display";
|
|
257
|
+
readonly actions: "setConsent";
|
|
258
|
+
};
|
|
259
|
+
readonly onError: {
|
|
260
|
+
readonly target: "error";
|
|
261
|
+
readonly actions: "setError";
|
|
262
|
+
};
|
|
263
|
+
};
|
|
264
|
+
};
|
|
265
|
+
readonly display: {
|
|
266
|
+
readonly on: {
|
|
267
|
+
readonly TOGGLE: {
|
|
268
|
+
readonly actions: "toggleSigned";
|
|
269
|
+
};
|
|
270
|
+
readonly SUBMIT: {
|
|
271
|
+
readonly target: "submitting";
|
|
272
|
+
readonly guard: "canSubmit";
|
|
273
|
+
};
|
|
274
|
+
readonly CANCEL: {
|
|
275
|
+
readonly target: "closed";
|
|
276
|
+
};
|
|
277
|
+
readonly RETRY: {
|
|
278
|
+
readonly target: "loading";
|
|
279
|
+
readonly actions: "clearError";
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
};
|
|
283
|
+
readonly submitting: {
|
|
284
|
+
readonly invoke: {
|
|
285
|
+
readonly id: "submitConsent";
|
|
286
|
+
readonly src: "submitConsent";
|
|
287
|
+
readonly input: ({
|
|
288
|
+
context
|
|
289
|
+
}: {
|
|
290
|
+
context: MandatoryConsentContext;
|
|
291
|
+
event: {
|
|
292
|
+
type: "LOAD";
|
|
293
|
+
} | {
|
|
294
|
+
type: "TOGGLE";
|
|
295
|
+
} | {
|
|
296
|
+
type: "SUBMIT";
|
|
297
|
+
} | {
|
|
298
|
+
type: "CANCEL";
|
|
299
|
+
} | {
|
|
300
|
+
type: "RETRY";
|
|
301
|
+
} | {
|
|
302
|
+
type: "RESET";
|
|
303
|
+
};
|
|
304
|
+
self: xstate591.ActorRef<xstate591.MachineSnapshot<MandatoryConsentContext, {
|
|
305
|
+
type: "LOAD";
|
|
306
|
+
} | {
|
|
307
|
+
type: "TOGGLE";
|
|
308
|
+
} | {
|
|
309
|
+
type: "SUBMIT";
|
|
310
|
+
} | {
|
|
311
|
+
type: "CANCEL";
|
|
312
|
+
} | {
|
|
313
|
+
type: "RETRY";
|
|
314
|
+
} | {
|
|
315
|
+
type: "RESET";
|
|
316
|
+
}, Record<string, xstate591.AnyActorRef>, xstate591.StateValue, string, unknown, any, any>, {
|
|
317
|
+
type: "LOAD";
|
|
318
|
+
} | {
|
|
319
|
+
type: "TOGGLE";
|
|
320
|
+
} | {
|
|
321
|
+
type: "SUBMIT";
|
|
322
|
+
} | {
|
|
323
|
+
type: "CANCEL";
|
|
324
|
+
} | {
|
|
325
|
+
type: "RETRY";
|
|
326
|
+
} | {
|
|
327
|
+
type: "RESET";
|
|
328
|
+
}, xstate591.AnyEventObject>;
|
|
329
|
+
}) => {
|
|
330
|
+
consentId: string;
|
|
331
|
+
isSigned: boolean;
|
|
332
|
+
};
|
|
333
|
+
readonly onDone: {
|
|
334
|
+
readonly target: "finished";
|
|
335
|
+
};
|
|
336
|
+
readonly onError: {
|
|
337
|
+
readonly target: "display";
|
|
338
|
+
readonly actions: "setError";
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
};
|
|
342
|
+
readonly error: {
|
|
343
|
+
readonly on: {
|
|
344
|
+
readonly RETRY: {
|
|
345
|
+
readonly target: "loading";
|
|
346
|
+
readonly actions: "clearError";
|
|
347
|
+
};
|
|
348
|
+
readonly CANCEL: {
|
|
349
|
+
readonly target: "closed";
|
|
350
|
+
};
|
|
351
|
+
readonly RESET: {
|
|
352
|
+
readonly target: "idle";
|
|
353
|
+
readonly actions: "resetContext";
|
|
354
|
+
};
|
|
355
|
+
};
|
|
356
|
+
};
|
|
357
|
+
readonly finished: {
|
|
358
|
+
readonly type: "final";
|
|
359
|
+
};
|
|
360
|
+
readonly closed: {
|
|
361
|
+
readonly type: "final";
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
}>;
|
|
365
|
+
type MandatoryConsentMachine = typeof mandatoryConsentMachine;
|
|
366
|
+
//#endregion
|
|
367
|
+
//#region src/modules/mandatory-consent/mandatoryConsentActor.d.ts
|
|
368
|
+
type CreateMandatoryConsentActorOptions = {
|
|
369
|
+
config: MandatoryConsentConfig;
|
|
370
|
+
};
|
|
371
|
+
type MandatoryConsentActor = ActorRefFrom<MandatoryConsentMachine>;
|
|
372
|
+
//#endregion
|
|
373
|
+
//#region src/modules/mandatory-consent/mandatoryConsentManager.d.ts
|
|
374
|
+
type MandatoryConsentIdleState = {
|
|
375
|
+
status: 'idle';
|
|
376
|
+
};
|
|
377
|
+
type MandatoryConsentLoadingState = {
|
|
378
|
+
status: 'loading';
|
|
379
|
+
};
|
|
380
|
+
type MandatoryConsentDisplayState = {
|
|
381
|
+
status: 'display';
|
|
382
|
+
title: string;
|
|
383
|
+
text: string;
|
|
384
|
+
isSigned: boolean;
|
|
385
|
+
canSubmit: boolean;
|
|
386
|
+
error?: string;
|
|
387
|
+
};
|
|
388
|
+
type MandatoryConsentSubmittingState = {
|
|
389
|
+
status: 'submitting';
|
|
390
|
+
title: string;
|
|
391
|
+
text: string;
|
|
392
|
+
isSigned: boolean;
|
|
393
|
+
canSubmit: false;
|
|
394
|
+
};
|
|
395
|
+
type MandatoryConsentFinishedState = {
|
|
396
|
+
status: 'finished';
|
|
397
|
+
};
|
|
398
|
+
type MandatoryConsentClosedState = {
|
|
399
|
+
status: 'closed';
|
|
400
|
+
};
|
|
401
|
+
type MandatoryConsentErrorState = {
|
|
402
|
+
status: 'error';
|
|
403
|
+
error: string;
|
|
404
|
+
};
|
|
405
|
+
type MandatoryConsentState = MandatoryConsentIdleState | MandatoryConsentLoadingState | MandatoryConsentDisplayState | MandatoryConsentSubmittingState | MandatoryConsentFinishedState | MandatoryConsentClosedState | MandatoryConsentErrorState;
|
|
406
|
+
declare function createMandatoryConsentManager(options: CreateMandatoryConsentActorOptions): Manager<MandatoryConsentState> & {
|
|
407
|
+
load(): void;
|
|
408
|
+
toggle(): void;
|
|
409
|
+
submit(): void;
|
|
410
|
+
cancel(): void;
|
|
411
|
+
retry(): void;
|
|
412
|
+
reset(): void;
|
|
413
|
+
};
|
|
414
|
+
/**
|
|
415
|
+
* Creates a mandatory-consent manager from a pre-built actor.
|
|
416
|
+
* Use this when overriding the machine via `.provide()` for custom backends
|
|
417
|
+
* or for story-isolation testing.
|
|
418
|
+
*/
|
|
419
|
+
declare function createMandatoryConsentManagerFromActor(actor: MandatoryConsentActor): Manager<MandatoryConsentState> & {
|
|
420
|
+
load(): void;
|
|
421
|
+
toggle(): void;
|
|
422
|
+
submit(): void;
|
|
423
|
+
cancel(): void;
|
|
424
|
+
retry(): void;
|
|
425
|
+
reset(): void;
|
|
426
|
+
};
|
|
427
|
+
type MandatoryConsentManager = ReturnType<typeof createMandatoryConsentManager>;
|
|
428
|
+
//#endregion
|
|
429
|
+
export { MandatoryConsentActor as a, createMandatoryConsentManagerFromActor as i, MandatoryConsentState as n, mandatoryConsentMachine as o, createMandatoryConsentManager as r, MandatoryConsentConfig as s, MandatoryConsentManager as t };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { t as api } from "./api-CESGtpbH.esm.js";
|
|
2
|
-
import { t as endpoints } from "./endpoints-
|
|
3
|
-
import { a as fromPromise, r as assign, t as setup } from "./xstate.esm-
|
|
2
|
+
import { t as endpoints } from "./endpoints-BeTK0Mlt.esm.js";
|
|
3
|
+
import { a as fromPromise, r as assign, t as setup } from "./xstate.esm-C9wncMQa.esm.js";
|
|
4
4
|
|
|
5
5
|
//#region src/modules/mandatory-consent/mandatoryConsentServices.ts
|
|
6
|
-
async function fetchMandatoryConsent(regulationType, signal) {
|
|
6
|
+
async function fetchMandatoryConsent(regulationType, language, type, signal) {
|
|
7
7
|
const res = await api.get(endpoints.getConsents, {
|
|
8
8
|
signal,
|
|
9
9
|
query: {
|
|
10
|
-
type
|
|
11
|
-
language: "en",
|
|
10
|
+
type,
|
|
11
|
+
language: language ?? "en",
|
|
12
12
|
regulationType
|
|
13
13
|
}
|
|
14
14
|
});
|
|
@@ -29,7 +29,7 @@ const mandatoryConsentMachine = setup({
|
|
|
29
29
|
input: {}
|
|
30
30
|
},
|
|
31
31
|
actors: {
|
|
32
|
-
fetchConsent: fromPromise(async ({ input, signal }) => fetchMandatoryConsent(input.config.consentType, signal)),
|
|
32
|
+
fetchConsent: fromPromise(async ({ input, signal }) => fetchMandatoryConsent(input.config.consentType, input.config.language, input.config.type ?? "MANDATORY", signal)),
|
|
33
33
|
submitConsent: fromPromise(async ({ input, signal }) => submitMandatoryConsent({ consents: [{
|
|
34
34
|
id: input.consentId,
|
|
35
35
|
isSigned: input.isSigned
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { a as __toDynamicImportESM } from "./chunk-
|
|
1
|
+
import { a as __toDynamicImportESM } from "./chunk-CMUKZ2uL.esm.js";
|
|
2
2
|
|
|
3
3
|
//#region ../infra/src/providers/browser/openviduLazy.ts
|
|
4
4
|
let openViduImport;
|
|
5
5
|
async function loadOpenVidu() {
|
|
6
6
|
if (openViduImport) return openViduImport;
|
|
7
|
-
openViduImport = import("./lib-
|
|
7
|
+
openViduImport = import("./lib-BY67lgbq.esm.js").then(__toDynamicImportESM(1));
|
|
8
8
|
return openViduImport;
|
|
9
9
|
}
|
|
10
10
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region src/shared/otp.ts
|
|
2
|
+
/**
|
|
3
|
+
* Expected length of an OTP verification code.
|
|
4
|
+
*
|
|
5
|
+
* Owned by Core so the phone, email, and government-validation modules — and
|
|
6
|
+
* the UI (via each manager's exposed `otpLength`) — agree on a single value.
|
|
7
|
+
* This is a pure leaf utility: modules import it independently, so it never
|
|
8
|
+
* introduces a dependency between them.
|
|
9
|
+
*/
|
|
10
|
+
const OTP_CODE_LENGTH = 6;
|
|
11
|
+
/** Validation-error code for an OTP code that is not yet complete. */
|
|
12
|
+
const OTP_INCOMPLETE_ERROR = "incompleteOtp";
|
|
13
|
+
/**
|
|
14
|
+
* Returns true when the code has exactly the expected number of characters.
|
|
15
|
+
* Normalization (casing, stripping separators) is the caller's responsibility.
|
|
16
|
+
*/
|
|
17
|
+
function isOtpComplete(code, length = OTP_CODE_LENGTH) {
|
|
18
|
+
return code.length === length;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Computes client-side OTP validation errors for the given code.
|
|
22
|
+
*
|
|
23
|
+
* Returns `{ otp: OTP_INCOMPLETE_ERROR }` when the code is incomplete (including
|
|
24
|
+
* empty), or an empty object when complete. Mirrors the phone/email
|
|
25
|
+
* `computeValidationErrors` shape so state machines can treat it identically.
|
|
26
|
+
*/
|
|
27
|
+
function computeOtpValidationErrors(code, length = OTP_CODE_LENGTH) {
|
|
28
|
+
if (!isOtpComplete(code, length)) return { otp: OTP_INCOMPLETE_ERROR };
|
|
29
|
+
return {};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { computeOtpValidationErrors as n, isOtpComplete as r, OTP_CODE_LENGTH as t };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { a as isWasmMotionPrimedForModule } from "./permissionServices-CG3bMSfG.esm.js";
|
|
2
|
+
|
|
3
|
+
//#region src/internal/permissions/permissionGuards.ts
|
|
4
|
+
function resolveStoredPermissionResult(fromEvent, fromContext) {
|
|
5
|
+
if (fromEvent === "granted" || fromEvent === "denied" || fromEvent === "prompt" || fromEvent === "refresh") return fromEvent;
|
|
6
|
+
return fromContext;
|
|
7
|
+
}
|
|
8
|
+
function isMotionPermissionSatisfiedForDeepsight(ds) {
|
|
9
|
+
if (ds !== true) return true;
|
|
10
|
+
return isWasmMotionPrimedForModule();
|
|
11
|
+
}
|
|
12
|
+
function isReadyForCaptureFromPermission(permissionResult, ds) {
|
|
13
|
+
if (permissionResult !== "granted") return false;
|
|
14
|
+
return isMotionPermissionSatisfiedForDeepsight(ds);
|
|
15
|
+
}
|
|
16
|
+
function needsMotionPrimeOnlyFromPermission(permissionResult, ds) {
|
|
17
|
+
if (permissionResult !== "granted") return false;
|
|
18
|
+
if (ds !== true) return false;
|
|
19
|
+
return !isWasmMotionPrimedForModule();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { needsMotionPrimeOnlyFromPermission as n, resolveStoredPermissionResult as r, isReadyForCaptureFromPermission as t };
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { t as WasmUtilProvider } from "./WasmUtilProvider-CiEN7Gjn.esm.js";
|
|
2
|
+
import { t as MotionSensorProvider } from "./MotionSensorProvider-Bx7Mpzt0.esm.js";
|
|
3
|
+
import { i as stopCameraStream, r as requestCameraAccess } from "./camera-DJWm3V4g.esm.js";
|
|
4
|
+
|
|
5
|
+
//#region ../infra/src/media/cameraPermissionSession.ts
|
|
6
|
+
const CAMERA_PERMISSIONS_GRANTED_KEY = "cameraPermissionsGranted";
|
|
7
|
+
function isCameraGrantedInSession() {
|
|
8
|
+
if (typeof sessionStorage === "undefined") return false;
|
|
9
|
+
return sessionStorage.getItem(CAMERA_PERMISSIONS_GRANTED_KEY) === "true";
|
|
10
|
+
}
|
|
11
|
+
function markCameraPermissionsGrantedInSession() {
|
|
12
|
+
if (typeof sessionStorage === "undefined") return;
|
|
13
|
+
sessionStorage.setItem(CAMERA_PERMISSIONS_GRANTED_KEY, String(true));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region ../infra/src/media/permissions.ts
|
|
18
|
+
async function queryPermission(name) {
|
|
19
|
+
try {
|
|
20
|
+
if (typeof navigator === "undefined" || !navigator.permissions) return "prompt";
|
|
21
|
+
return (await navigator.permissions.query({ name })).state;
|
|
22
|
+
} catch {
|
|
23
|
+
return "prompt";
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
async function queryCameraPermission() {
|
|
27
|
+
return queryPermission("camera");
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/internal/permissions/wasmMotionPrimeState.ts
|
|
32
|
+
let wasmMotionPrimedForModule = false;
|
|
33
|
+
function resetWasmMotionPrimedForModule() {
|
|
34
|
+
wasmMotionPrimedForModule = false;
|
|
35
|
+
}
|
|
36
|
+
function markWasmMotionPrimedForModule() {
|
|
37
|
+
wasmMotionPrimedForModule = true;
|
|
38
|
+
}
|
|
39
|
+
function isWasmMotionPrimedForModule() {
|
|
40
|
+
return wasmMotionPrimedForModule;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/internal/permissions/permissionServices.ts
|
|
45
|
+
function isCameraGrantedForMotionPrime(options) {
|
|
46
|
+
return options.cameraGranted === true || isCameraGrantedInSession();
|
|
47
|
+
}
|
|
48
|
+
async function resolveMotionOsPermission(motionSensor) {
|
|
49
|
+
if (motionSensor.hasBeenRequestedThisSession()) return "granted";
|
|
50
|
+
if (motionSensor.hasMotionPermissionDeniedThisSession()) return "denied";
|
|
51
|
+
return requestMotionOsPermission(motionSensor);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* On mobile, motion permission (iOS OS dialog when required) and WASM sensor
|
|
55
|
+
* priming (rsp/ssl) must run during a user gesture. When camera is already
|
|
56
|
+
* granted (cached permission), V1 requests motion on tutorial Continue before
|
|
57
|
+
* any async permission actors run.
|
|
58
|
+
*/
|
|
59
|
+
async function primeMotionFromUserGestureIfNeeded(options) {
|
|
60
|
+
if (options.ds !== true) return;
|
|
61
|
+
if (isWasmMotionPrimedForModule()) return;
|
|
62
|
+
if (!isCameraGrantedForMotionPrime(options)) return;
|
|
63
|
+
const motionSensor = new MotionSensorProvider();
|
|
64
|
+
const motionResult = await resolveMotionOsPermission(motionSensor);
|
|
65
|
+
if (motionResult === "denied") return;
|
|
66
|
+
if (motionResult !== "granted" && motionResult !== "not-required") return;
|
|
67
|
+
await primeWasmMotionSensor(motionSensor);
|
|
68
|
+
}
|
|
69
|
+
async function checkPermission() {
|
|
70
|
+
const queryResult = await queryCameraPermission();
|
|
71
|
+
if (queryResult === "granted") {
|
|
72
|
+
markCameraPermissionsGrantedInSession();
|
|
73
|
+
return "granted";
|
|
74
|
+
}
|
|
75
|
+
if (queryResult === "denied") return "denied";
|
|
76
|
+
return "prompt";
|
|
77
|
+
}
|
|
78
|
+
async function requestMotionOsPermission(motionSensor = new MotionSensorProvider()) {
|
|
79
|
+
return motionSensor.requestPermission();
|
|
80
|
+
}
|
|
81
|
+
async function primeWasmMotionSensor(motionSensor = new MotionSensorProvider()) {
|
|
82
|
+
if (motionSensor.hasMotionPermissionDeniedThisSession() || !motionSensor.hasPermission) return false;
|
|
83
|
+
try {
|
|
84
|
+
await motionSensor.start();
|
|
85
|
+
const wasmUtil = await WasmUtilProvider.getInstance();
|
|
86
|
+
await wasmUtil.rsp();
|
|
87
|
+
wasmUtil.ssl();
|
|
88
|
+
markWasmMotionPrimedForModule();
|
|
89
|
+
return true;
|
|
90
|
+
} catch {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Requests camera permission by attempting to access the camera, then immediately
|
|
96
|
+
* stops the obtained stream. When `requestMotion` is true (deepsight), requests
|
|
97
|
+
* motion OS permission, primes WASM sensors, then camera — all in one user gesture
|
|
98
|
+
* chain, matching SDK v1.
|
|
99
|
+
*/
|
|
100
|
+
async function requestPermission(options = {}) {
|
|
101
|
+
try {
|
|
102
|
+
if (options.requestMotion) {
|
|
103
|
+
const motionSensor = new MotionSensorProvider();
|
|
104
|
+
if (await resolveMotionOsPermission(motionSensor) === "denied") return "denied";
|
|
105
|
+
if (!isWasmMotionPrimedForModule()) await primeWasmMotionSensor(motionSensor);
|
|
106
|
+
}
|
|
107
|
+
stopCameraStream(await requestCameraAccess({ video: true }));
|
|
108
|
+
markCameraPermissionsGrantedInSession();
|
|
109
|
+
return "granted";
|
|
110
|
+
} catch (error) {
|
|
111
|
+
const name = error instanceof Error ? error.name : void 0;
|
|
112
|
+
if (name === "NotAllowedError" || name === "PermissionDeniedError") return "denied";
|
|
113
|
+
return "prompt";
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
async function invokeRequestPermissionActor(input) {
|
|
117
|
+
if (!input.requestMotionPermission) return requestPermission();
|
|
118
|
+
if (input.permissionResult === "granted") {
|
|
119
|
+
if (!isWasmMotionPrimedForModule()) {
|
|
120
|
+
const motionSensor = new MotionSensorProvider();
|
|
121
|
+
if (await resolveMotionOsPermission(motionSensor) === "denied") return "denied";
|
|
122
|
+
if (!await primeWasmMotionSensor(motionSensor)) return "denied";
|
|
123
|
+
}
|
|
124
|
+
return "granted";
|
|
125
|
+
}
|
|
126
|
+
return requestPermission({ requestMotion: true });
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
//#endregion
|
|
130
|
+
export { isWasmMotionPrimedForModule as a, requestPermission as i, invokeRequestPermissionActor as n, resetWasmMotionPrimedForModule as o, primeMotionFromUserGestureIfNeeded as r, checkPermission as t };
|
package/dist/phone.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import "./Manager-
|
|
2
|
-
import "./Actor-
|
|
3
|
-
import
|
|
1
|
+
import "./Manager-BHn8wH8K.js";
|
|
2
|
+
import "./Actor-Y0_Fj-KL.js";
|
|
3
|
+
import "./otp-DF5A0sFx.js";
|
|
4
|
+
import { n as PhoneState, o as phoneMachine, r as createPhoneManager, s as PhoneConfig, t as PhoneManager } from "./phoneManager-fPmIBYQK.js";
|
|
4
5
|
export { type PhoneConfig, type PhoneManager, type PhoneState, createPhoneManager, phoneMachine };
|