@incodetech/web 2.1.0-rc.2 → 2.1.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/dist/ae-signature/ae-signature.es.js +2 -2
  2. package/dist/ae-signature/styles.css +59 -45
  3. package/dist/antifraud/antifraud.es.js +4 -4
  4. package/dist/authentication/authentication.es.js +5 -4
  5. package/dist/base.css +87 -59
  6. package/dist/{button-Ch5-QgHB.js → button-Dz6AsbmF.js} +2 -1
  7. package/dist/cameraView-DIEzM5ru.js +47 -0
  8. package/dist/{tutorial-Cap8qKvM.js → capture-CkGvdDNH.js} +18 -568
  9. package/dist/certificate-issuance/certificate-issuance.es.js +7 -7
  10. package/dist/consent/consent.es.js +8 -8
  11. package/dist/{countrySelector-B4WuNUya.js → countrySelector-SvUOyPo0.js} +1 -1
  12. package/dist/cpf-ocr/cpf-ocr.es.js +1 -1
  13. package/dist/cpfOcr-B79245-3.js +2 -0
  14. package/dist/{cpfOcr-liTE9e70.js → cpfOcr-BhxT-lRN.js} +5 -5
  15. package/dist/cross-document-data-match/cross-document-data-match.es.js +4 -4
  16. package/dist/curp-validation/curp-validation.es.js +7 -7
  17. package/dist/{customFields-BQ4scZfL.js → customFields-BDsXR7A-.js} +6 -6
  18. package/dist/{customWatchlist-7s0_wGtE.js → customWatchlist-CYoRNCim.js} +5 -5
  19. package/dist/document-capture/document-capture.es.js +1 -1
  20. package/dist/documentCapture-DXYYyxZl.js +2 -0
  21. package/dist/{documentCapture-CwoSD_Iq.js → documentCapture-DhbO-A-V.js} +11 -9
  22. package/dist/{dynamicForms-DvTU65bW.js → dynamicForms-BifGbC9F.js} +19 -8
  23. package/dist/ekyb/ekyb.es.js +1 -1
  24. package/dist/ekybModule-C6Nttked.js +2 -0
  25. package/dist/{ekybModule-CwZvxios.js → ekybModule-DGnTw5UV.js} +12 -12
  26. package/dist/ekyc/ekyc.es.js +1 -1
  27. package/dist/ekycModule-CDIEjI6V.js +2 -0
  28. package/dist/{ekycModule-jkXByPXe.js → ekycModule-Dxpdd0ns.js} +10 -10
  29. package/dist/electronic-signature/electronic-signature.es.js +1 -1
  30. package/dist/{electronic-signature-h1sAGg7l.js → electronic-signature-Ueoffasr.js} +37 -26
  31. package/dist/email/email.es.js +7 -7
  32. package/dist/{emailInput-BRMJMJV6.js → emailInput-DsLkDtER.js} +5 -5
  33. package/dist/{expiredId-D17oN5K2.js → expiredId-BZXLrLk-.js} +4 -4
  34. package/dist/{extensibility-CTmAsaji.js → extensibility-7sRIN0JC.js} +41 -76
  35. package/dist/extensibility.es.js +13 -11
  36. package/dist/face-match/face-match.es.js +1 -1
  37. package/dist/face-match/styles.css +4 -0
  38. package/dist/faceMatch-B_HvxLm_.js +2 -0
  39. package/dist/{faceMatch-Dez_bq3n.js → faceMatch-DyTBoMDm.js} +8 -8
  40. package/dist/field-comparison/field-comparison.es.js +1 -1
  41. package/dist/fieldComparison-DfNEuEE5.js +2 -0
  42. package/dist/{fieldComparison-BelzSC48.js → fieldComparison-L_knHqgw.js} +7 -7
  43. package/dist/fiscal-qr/fiscal-qr.es.js +8 -7
  44. package/dist/flow/flow.es.js +22 -9
  45. package/dist/flow/styles.css +4151 -3042
  46. package/dist/geolocation/geolocation.es.js +14 -9
  47. package/dist/{governmentValidation/governmentValidation.es.js → government-validation/government-validation.es.js} +10 -14
  48. package/dist/{homeScreen-BIdVm9KA.js → homeScreen-B6T0JVh8.js} +2 -2
  49. package/dist/{hooks-Da_yP_Dr.js → hooks-CNu7o-v8.js} +39 -2
  50. package/dist/{i18n-DoP1NB7u.js → i18n-CU4xq8qC.js} +1 -1
  51. package/dist/id/id.es.js +76 -46
  52. package/dist/id/styles.css +1 -9
  53. package/dist/id-ocr/styles.css +12 -2
  54. package/dist/id-verification/id-verification.es.js +5 -5
  55. package/dist/{idOcr-C4K2XVJr.js → idOcr-WFBvqy3b.js} +31 -13
  56. package/dist/identity-reuse/identity-reuse.es.js +6 -6
  57. package/dist/{incodeComponent-Cmi1rlWs.js → incodeComponent-CfzJGETt.js} +2 -2
  58. package/dist/{incodeModule-M8DszCee.js → incodeModule-B-4_3JrK.js} +1 -1
  59. package/dist/index.es.js +1 -1
  60. package/dist/{mandatoryConsent-DOQ0DKgM.js → mandatoryConsent-D0GTKu-H.js} +7 -7
  61. package/dist/{optionAccessibleLabel-_nvVCTSL.js → optionAccessibleLabel-gfF-58Mv.js} +3 -3
  62. package/dist/{otpInput-Q_kzSZeD.js → otpInput-CnDc6pQm.js} +12 -11
  63. package/dist/{pdf-BMUXKJuC.js → pdf-BqtJTlor.js} +1 -1
  64. package/dist/{pdfViewer-BewML6eg.js → pdfViewer-B97DmT9m.js} +57 -20
  65. package/dist/phone/phone.es.js +6 -6
  66. package/dist/{processing-Boki1Z8j.js → processing-BeUMfdJJ.js} +1 -1
  67. package/dist/qe-signature/qe-signature.es.js +2 -2
  68. package/dist/{radioGroupComposed-TuAWUAFK.js → radioGroupComposed-DuQxslB2.js} +1 -1
  69. package/dist/redirect-to-mobile/redirect-to-mobile.es.js +17 -18
  70. package/dist/redirect-to-mobile/styles.css +2 -2
  71. package/dist/{richText-DsTP4H3j.js → richText-CB1fmegc.js} +1 -1
  72. package/dist/selfie/selfie.es.js +8 -7
  73. package/dist/selfie/styles.css +133 -63
  74. package/dist/signature/signature.es.js +8 -8
  75. package/dist/spinner-BCDCoi9C.js +1 -0
  76. package/dist/{spinner-BRNNKqPN.js → spinner-BMeIEK1d.js} +12 -6
  77. package/dist/themes/dark.css +16 -0
  78. package/dist/themes/light.css +16 -0
  79. package/dist/{transitionSpinner-4rPkt-KM.js → transitionSpinner-CuNCqHNi.js} +9 -8
  80. package/dist/tutorial-CCfPuVKX.js +706 -0
  81. package/dist/types/ae-signature.d.ts +23 -1
  82. package/dist/types/antifraud.d.ts +23 -1
  83. package/dist/types/authentication.d.ts +23 -1
  84. package/dist/types/certificate-issuance.d.ts +23 -1
  85. package/dist/types/consent.d.ts +23 -1
  86. package/dist/types/cross-document-data-match.d.ts +23 -1
  87. package/dist/types/curp-validation.d.ts +23 -1
  88. package/dist/types/document-capture.d.ts +23 -1
  89. package/dist/types/ekyb.d.ts +23 -1
  90. package/dist/types/ekyc.d.ts +23 -1
  91. package/dist/types/electronic-signature.d.ts +23 -1
  92. package/dist/types/email.d.ts +23 -1
  93. package/dist/types/extensibility.d.ts +39 -2
  94. package/dist/types/face-match.d.ts +23 -1
  95. package/dist/types/field-comparison.d.ts +23 -1
  96. package/dist/types/fiscal-qr.d.ts +23 -1
  97. package/dist/types/flow.d.ts +23 -1
  98. package/dist/types/geolocation.d.ts +27 -2
  99. package/dist/types/{governmentValidation.d.ts → government-validation.d.ts} +23 -1
  100. package/dist/types/id-verification.d.ts +23 -1
  101. package/dist/types/id.d.ts +23 -1
  102. package/dist/types/identity-reuse.d.ts +23 -1
  103. package/dist/types/phone.d.ts +23 -1
  104. package/dist/types/qe-signature.d.ts +23 -1
  105. package/dist/types/selfie.d.ts +23 -1
  106. package/dist/types/signature.d.ts +23 -1
  107. package/dist/types/video-selfie.d.ts +72 -0
  108. package/dist/types/watchlist.d.ts +23 -1
  109. package/dist/types/workflow.d.ts +23 -1
  110. package/dist/{useModuleLoader-Kt78XfNR.js → useModuleLoader-Gvo9qscB.js} +38 -23
  111. package/dist/{verificationResult-B6PBXbp9.js → verificationResult-BWWkmeiA.js} +3 -3
  112. package/dist/video-selfie/styles.css +1644 -0
  113. package/dist/video-selfie/video-selfie.es.js +854 -0
  114. package/dist/watchlist/watchlist.es.js +5 -5
  115. package/dist/{watchlistForBusiness-DCKlKG81.js → watchlistForBusiness-D2Uo_TwF.js} +7 -7
  116. package/dist/workflow/styles.css +148 -76
  117. package/dist/workflow/workflow.es.js +23 -27
  118. package/package.json +29 -2
  119. package/dist/cpfOcr-BJOYoITy.js +0 -2
  120. package/dist/documentCapture-3RHCHepT.js +0 -2
  121. package/dist/ekybModule-BkVQBQvW.js +0 -2
  122. package/dist/ekycModule-BIbj7hr1.js +0 -2
  123. package/dist/faceMatch-C0-RPzrc.js +0 -2
  124. package/dist/fieldComparison-7FUznk_9.js +0 -2
  125. package/dist/spinner-zRaUjXtH.js +0 -1
  126. /package/dist/{aligndevicelottie-DMXPhIDs.js → aligndevicelottie-DFscByAI.js} +0 -0
  127. /package/dist/{back-horizontal-hint-DNIIDrEW.js → back-horizontal-hint-xTnSQbzn.js} +0 -0
  128. /package/dist/{back-tutorial-B8JJSJBB.js → back-tutorial-cI_4VHmE.js} +0 -0
  129. /package/dist/{back-vertical-hint-CW6ZS7bP.js → back-vertical-hint-BWWlHfX2.js} +0 -0
  130. /package/dist/{backdevicelottie-By75Bznp.js → backdevicelottie-COyhTrxM.js} +0 -0
  131. /package/dist/{blurdevicelottie-C_9VAHkM.js → blurdevicelottie-BLVeJHEG.js} +0 -0
  132. /package/dist/{browser-ponyfill-C_DpU0lQ.js → browser-ponyfill-Df13Th-G.js} +0 -0
  133. /package/dist/{defineProperty-CTu-cLWm.js → defineProperty-Qjefk7Uf.js} +0 -0
  134. /package/dist/{flip-animation-st9bra1p.js → flip-animation-CZYSUtMm.js} +0 -0
  135. /package/dist/{front-horizontal-hint-DvME-aVk.js → front-horizontal-hint-B84GgTO1.js} +0 -0
  136. /package/dist/{front-vertical-hint-BUG1VMsP.js → front-vertical-hint-Bs_avngq.js} +0 -0
  137. /package/dist/{frontdevicelottie-uObOEs8p.js → frontdevicelottie-B4tE2PYQ.js} +0 -0
  138. /package/dist/{glaredevicelottie-CsfIgqIc.js → glaredevicelottie-D1pR73sx.js} +0 -0
  139. /package/dist/{governmentValidation → government-validation}/styles.css +0 -0
  140. /package/dist/{id-laser-h-BvVSaLyU.js → id-laser-h-CzPegPMn.js} +0 -0
  141. /package/dist/{id-laser-v-Dj_RN_s9.js → id-laser-v-BiUXkM4x.js} +0 -0
  142. /package/dist/{id-tutorial-BOOsXlAJ.js → id-tutorial-DwO90SAm.js} +0 -0
  143. /package/dist/{lottie_light-BG-RL2Iu.js → lottie_light-C6B2ec41.js} +0 -0
  144. /package/dist/{numberedStep-Dc0BUU-j.js → numberedStep-CEb-lFJm.js} +0 -0
  145. /package/dist/{passport-horizontal-hint-BhpVt73n.js → passport-horizontal-hint-Bj0ZJY0g.js} +0 -0
  146. /package/dist/{passport-tutorial-CeSup6m9.js → passport-tutorial-D9JNsMsM.js} +0 -0
  147. /package/dist/{passport-vertical-hint-CVRBnZXS.js → passport-vertical-hint-Dfk77xUJ.js} +0 -0
  148. /package/dist/{registerIncodeElement-CdlNRRv5.js → registerIncodeElement-DaNjbAwZ.js} +0 -0
  149. /package/dist/{requiredLabelHint-DX3oVNtu.js → requiredLabelHint-D0RhuMed.js} +0 -0
  150. /package/dist/{selfieTutorial-CYa8bq6B.js → selfieTutorial-pB-N-fj5.js} +0 -0
  151. /package/dist/{snackbar-CGL6gp9u.js → snackbar-DS7Mv62v.js} +0 -0
  152. /package/dist/{statusPage-BUm5gtQY.js → statusPage-Bk8nJwXV.js} +0 -0
  153. /package/dist/{tabs-DUkWjBGk.js → tabs-C__chW-u.js} +0 -0
@@ -0,0 +1,854 @@
1
+ import { n as useTranslation } from "../i18n-CU4xq8qC.js";
2
+ import { _ as y, d as T, h as q, l as A, p as d, v as u, x as k } from "../vendor-preact-DThS2ZQ_.js";
3
+ import { c as useModuleTerminalCallbacks, n as useTimeoutHandle, t as useTimeout, u as useManager } from "../hooks-CNu7o-v8.js";
4
+ import { t as IncodeComponent } from "../incodeComponent-CfzJGETt.js";
5
+ import { n as cn, t as LoadingIcon } from "../loadingIcon-B0ysgiNq.js";
6
+ import { t as Page } from "../page-DidH_RkX.js";
7
+ import { t as Title } from "../typography-BZIpjo97.js";
8
+ import { t as TransitionSpinner } from "../transitionSpinner-CuNCqHNi.js";
9
+ import { t as Button } from "../button-Dz6AsbmF.js";
10
+ import { n as CameraFrame, t as CameraView } from "../cameraView-DIEzM5ru.js";
11
+ import { i as Permissions } from "../capture-CkGvdDNH.js";
12
+ import { t as registerIncodeModuleElement } from "../incodeModule-B-4_3JrK.js";
13
+ import { eventModuleNames, eventScreenNames, screenEvent, videoSelfieEvents } from "@incodetech/core/events";
14
+ import { checkCameraPermission, requestCameraPermission } from "@incodetech/core/camera";
15
+ import { createConsentRecorder, createVideoSelfieCameraWarmer, createVideoSelfieRecordingManager, facingModeForStep, getVideoSelfieQuestions, getVoiceConsentPhrase, resolveVideoSelfieSteps, warmupVideoSelfieWasm } from "@incodetech/core/video-selfie";
16
+ //#region src/modules/video-selfie/useVideoSelfiePermissions.ts
17
+ /**
18
+ * Drives the shared camera `<Permissions>` screen for Video Selfie. Mirrors the
19
+ * selfie/ID permission substates, but runs as a UI-level gate (the recording
20
+ * machine has no permission states of its own). The grant request includes
21
+ * audio (`requestAudio: true`) because Video Selfie records the microphone; the
22
+ * initial check only queries the camera, so an already-granted camera skips
23
+ * straight to capture and the recording machine surfaces the mic prompt.
24
+ */
25
+ function useVideoSelfiePermissions({ enabled, onGranted, onClose }) {
26
+ const [permissionStatus, setPermissionStatus] = d("idle");
27
+ const onGrantedRef = A(onGranted);
28
+ onGrantedRef.current = onGranted;
29
+ const onCloseRef = A(onClose);
30
+ onCloseRef.current = onClose;
31
+ const resolve = q((result) => {
32
+ if (result === "granted") {
33
+ onGrantedRef.current();
34
+ return;
35
+ }
36
+ setPermissionStatus(result === "denied" ? "denied" : "idle");
37
+ }, []);
38
+ y(() => {
39
+ if (!enabled) return;
40
+ let cancelled = false;
41
+ checkCameraPermission().then((result) => {
42
+ if (!cancelled) resolve(result);
43
+ });
44
+ return () => {
45
+ cancelled = true;
46
+ };
47
+ }, [enabled, resolve]);
48
+ return {
49
+ permissionStatus,
50
+ manager: {
51
+ requestPermission: q(() => {
52
+ setPermissionStatus("requesting");
53
+ requestCameraPermission({ requestAudio: true }).then(resolve);
54
+ }, [resolve]),
55
+ goToLearnMore: q(() => {
56
+ setPermissionStatus("learnMore");
57
+ }, []),
58
+ close: q(() => {
59
+ onCloseRef.current();
60
+ }, [])
61
+ }
62
+ };
63
+ }
64
+ //#endregion
65
+ //#region src/modules/video-selfie/assets/tutorial/permission.svg?raw
66
+ var permission_default = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M19.957 10.7852C19.956 10.3712 19.621 10.0372 19.207 10.0372H19.205C18.791 10.0382 18.456 10.3742 18.457 10.7892C18.465 14.3572 15.569 17.2672 12.005 17.2782C12.003 17.2782 12.002 17.2772 12 17.2772H11.997C10.269 17.2712 8.64699 16.5952 7.42799 15.3702C6.20799 14.1452 5.53899 12.5172 5.54299 10.7892C5.54399 10.3752 5.20899 10.0382 4.79499 10.0372H4.79299C4.37999 10.0372 4.04399 10.3712 4.04299 10.7852C4.03799 12.9142 4.86199 14.9192 6.36499 16.4292C7.68999 17.7602 9.40199 18.5632 11.25 18.7392V20.8752C11.25 21.2892 11.586 21.6252 12 21.6252C12.415 21.6252 12.75 21.2892 12.75 20.8752V18.7382C16.796 18.3492 19.967 14.9292 19.957 10.7852Z\" fill=\"currentColor\"/>\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M11.9981 14.9321H12.0031C14.2991 14.9261 16.1641 13.0531 16.1591 10.7571V6.53406C16.1591 4.24106 14.2931 2.37506 11.9991 2.37506C9.70609 2.37506 7.84009 4.24106 7.84009 6.53406V10.7561C7.83809 11.8691 8.26909 12.9161 9.05409 13.7051C9.83909 14.4941 10.8851 14.9301 11.9981 14.9321Z\" fill=\"currentColor\"/>\n</svg>\n";
67
+ //#endregion
68
+ //#region src/modules/video-selfie/tutorial.tsx
69
+ /**
70
+ * Per-step tutorial row metadata — icon + localized label. Mirrors V1's
71
+ * `RecorderTutorial`: each enabled step gets a row describing what the user will
72
+ * be asked to do. Icons are reused from the progress header for consistency.
73
+ */
74
+ var STEP_ROWS = {
75
+ frontId: {
76
+ icon: "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M17.7484 11.2717H14.2414C13.7874 11.2717 13.4184 10.9037 13.4184 10.4497C13.4184 9.99472 13.7874 9.62672 14.2414 9.62672H17.7484C18.2024 9.62672 18.5704 9.99472 18.5704 10.4497C18.5704 10.9037 18.2024 11.2717 17.7484 11.2717ZM17.7484 14.9807H15.5654C15.1114 14.9807 14.7434 14.6127 14.7434 14.1587C14.7434 13.7037 15.1114 13.3357 15.5654 13.3357H17.7484C18.2024 13.3357 18.5704 13.7037 18.5704 14.1587C18.5704 14.6127 18.2024 14.9807 17.7484 14.9807ZM12.4744 16.4147L6.07536 16.4237C5.97636 16.4237 5.88136 16.3847 5.81136 16.3157C5.74236 16.2457 5.70336 16.1507 5.70336 16.0527C5.70336 14.6997 6.80736 13.3357 9.27436 13.3357C11.7414 13.3357 12.8464 14.6957 12.8464 16.0437C12.8464 16.2487 12.6804 16.4147 12.4744 16.4147ZM9.27436 7.55272C10.5524 7.55272 11.5914 8.59172 11.5914 9.86972C11.5914 11.1477 10.5524 12.1877 9.27436 12.1877C7.99636 12.1877 6.95736 11.1477 6.95736 9.86972C6.95736 8.59172 7.99636 7.55272 9.27436 7.55272ZM17.0504 3.80072H7.25036C4.55036 3.80072 2.65036 5.80072 2.65036 8.60072V15.4007C2.65036 18.2007 4.55036 20.2007 7.25036 20.2007H17.0504C19.7504 20.2007 21.6504 18.2007 21.6504 15.4007V8.60072C21.6504 5.80072 19.7504 3.80072 17.0504 3.80072Z\" fill=\"currentColor\"/>\n</svg>\n",
77
+ key: "videoSelfie.tutorial.scanFrontId",
78
+ defaultValue: "Scan the front of ID"
79
+ },
80
+ backId: {
81
+ icon: "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M12.21 15.9195H10.782C10.368 15.9195 10.032 15.5835 10.032 15.1695C10.032 14.7555 10.368 14.4195 10.782 14.4195H12.21C12.624 14.4195 12.96 14.7555 12.96 15.1695C12.96 15.5835 12.624 15.9195 12.21 15.9195ZM8.32595 15.9195H6.89795C6.48395 15.9195 6.14795 15.5835 6.14795 15.1695C6.14795 14.7555 6.48395 14.4195 6.89795 14.4195H8.32595C8.73995 14.4195 9.07595 14.7555 9.07595 15.1695C9.07595 15.5835 8.73995 15.9195 8.32595 15.9195ZM2.80095 10.5895C2.63526 10.5895 2.50095 10.7238 2.50095 10.8895V15.2895C2.50095 18.0825 4.29495 19.9595 6.96395 19.9595H17.034C19.705 19.9595 21.499 18.0825 21.499 15.2895V10.8895C21.499 10.7238 21.3647 10.5895 21.199 10.5895H2.80095Z\" fill=\"currentColor\"/>\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M21.1991 9.08912C21.3648 9.08912 21.4991 8.95481 21.4991 8.78912V8.70912C21.4991 5.91612 19.7051 4.03912 17.0351 4.03912H6.96407C4.29507 4.03912 2.50107 5.91612 2.50107 8.70912V8.78912C2.50107 8.95481 2.63538 9.08912 2.80107 9.08912H21.1991Z\" fill=\"currentColor\"/>\n</svg>\n",
82
+ key: "videoSelfie.tutorial.scanBackId",
83
+ defaultValue: "Scan the back of ID"
84
+ },
85
+ poa: {
86
+ icon: "<svg width=\"24\" height=\"24\" viewBox=\"9 8 26 26\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M22.5548 9.16795C22.2189 8.94402 21.7813 8.94402 21.4454 9.16795L9.46156 17.1571C9.38484 17.2061 9.31392 17.2662 9.25135 17.3371C9.20878 17.3852 9.17107 17.4371 9.13865 17.4921C9.0432 17.6535 8.9981 17.8329 9.00006 18.0103V31C9.00006 31.5304 9.21077 32.0391 9.58585 32.4142C9.96092 32.7893 10.4696 33 11.0001 33H33.0001C33.5305 33 34.0392 32.7893 34.4143 32.4142C34.7894 32.0391 35.0001 31.5304 35.0001 31V18.0131C35.0026 17.826 34.9529 17.6366 34.847 17.4683C34.8226 17.4294 34.7955 17.3922 34.7658 17.3568C34.699 17.2771 34.6219 17.2102 34.5378 17.1566L22.5548 9.16795ZM32.2388 18.0277L22.0001 11.2019L11.7613 18.0277L20.1382 24.0001H23.862L32.2388 18.0277ZM11.0001 19.9412V30.0048L18.0905 24.9964L11.0001 19.9412ZM20.1361 26.0001L13.0577 31H30.9426L23.8642 26.0001H20.1361ZM25.9097 24.9964L33.0001 30.0047V19.9412L25.9097 24.9964Z\" fill=\"currentColor\"/>\n</svg>\n",
87
+ key: "videoSelfie.tutorial.poa",
88
+ defaultValue: "Scan your proof of address"
89
+ },
90
+ selfie: {
91
+ icon: "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M12.2004 2.30072C6.80042 2.30072 2.40042 6.70072 2.40042 12.1007C2.40042 13.9007 2.80042 15.4007 3.50042 16.7007C3.70042 17.1007 4.20042 17.2007 4.50042 17.0007C4.90042 16.8007 5.00042 16.3007 4.80042 16.0007C4.20042 15.0007 3.90042 13.7007 3.90042 12.2007C3.90042 7.70072 7.60042 4.00072 12.1004 4.00072C16.6004 4.00072 20.3004 7.70072 20.3004 12.2007C20.3004 13.5007 20.0004 14.7007 19.4004 16.1007C19.2004 16.5007 19.4004 16.9007 19.8004 17.1007C19.9004 17.1007 20.0004 17.2007 20.1004 17.2007C20.4004 17.2007 20.7004 17.0007 20.8004 16.8007C21.5004 15.2007 21.9004 13.8007 21.9004 12.3007C21.9004 6.70072 17.6004 2.30072 12.2004 2.30072Z\" fill=\"currentColor\"/>\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M15.8993 10.5011C15.8993 8.40111 14.1993 6.70111 12.0993 6.70111C9.99935 6.70111 8.29935 8.40111 8.29935 10.5011C8.29935 12.6011 9.99935 14.3011 12.0993 14.3011C14.1993 14.3011 15.8993 12.6011 15.8993 10.5011Z\" fill=\"currentColor\"/>\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M12.2003 15.8013C8.40037 15.8013 6.80037 17.7013 6.60037 19.5013C6.60037 19.7013 6.70037 19.9013 6.80037 20.0013C8.30037 21.1013 10.2003 21.7013 12.2003 21.7013C14.1003 21.7013 15.9003 21.1013 17.6003 20.0013C17.8003 19.9013 17.8003 19.7013 17.8003 19.5013C17.7003 18.6013 17.0003 15.7013 12.2003 15.8013Z\" fill=\"currentColor\"/>\n</svg>\n",
92
+ key: "videoSelfie.tutorial.takeSelfie",
93
+ defaultValue: "Look at your front camera"
94
+ },
95
+ questions: {
96
+ icon: "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M9 16C9 14.346 7.654 13 6 13C4.346 13 3 14.346 3 16C3 16.553 3.447 17 4 17C4.553 17 5 16.553 5 16C5 15.448 5.448 15 6 15C6.552 15 7 15.448 7 16C7 16.096 6.97 16.601 6.382 17.136C5.693 17.754 3.74 19.177 3.72 19.191C3.37 19.446 3.224 19.897 3.357 20.31C3.491 20.722 3.876 21 4.309 21H8C8.553 21 9 20.553 9 20C9 19.447 8.553 19 8 19H7.273C7.445 18.86 7.6 18.73 7.723 18.619C8.876 17.57 9 16.438 9 16Z\" fill=\"currentColor\"/>\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M4.78032 6.26849L5.00032 6.09049V9.99949C5.00032 10.5525 5.44732 10.9995 6.00032 10.9995C6.55232 10.9995 7.00032 10.5525 7.00032 9.99949V3.99949C7.00032 3.61549 6.77932 3.26349 6.43132 3.09749C6.08332 2.93149 5.67232 2.98049 5.37232 3.22149L3.52432 4.71149C3.09432 5.05849 3.02732 5.68849 3.37432 6.11849C3.71932 6.54649 4.34932 6.61749 4.78032 6.26849Z\" fill=\"currentColor\"/>\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M11.334 7H20C20.553 7 21 6.553 21 6C21 5.447 20.553 5 20 5H11.334C10.781 5 10.334 5.447 10.334 6C10.334 6.553 10.781 7 11.334 7Z\" fill=\"currentColor\"/>\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M20 11H11.334C10.781 11 10.334 11.447 10.334 12C10.334 12.553 10.781 13 11.334 13H20C20.553 13 21 12.553 21 12C21 11.447 20.553 11 20 11Z\" fill=\"currentColor\"/>\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M20 17H11.334C10.781 17 10.334 17.447 10.334 18C10.334 18.553 10.781 19 11.334 19H20C20.553 19 21 18.553 21 18C21 17.447 20.553 17 20 17Z\" fill=\"currentColor\"/>\n</svg>\n",
97
+ key: "videoSelfie.tutorial.questions",
98
+ defaultValue: "Answer some questions out loud"
99
+ },
100
+ speech: {
101
+ icon: "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n<path d=\"M12.02 2.00006C17.7 2.00006 22 6.65705 22 11.985C22 18.1643 16.96 22.0001 12 22.0001C10.36 22.0001 8.54002 21.5594 7.08002 20.6981C6.57002 20.3876 6.14002 20.1573 5.59002 20.3376L3.57002 20.9385C3.06002 21.0987 2.60002 20.6981 2.75002 20.1573L3.42002 17.9139C3.53002 17.6035 3.51002 17.273 3.35002 17.0126C2.49002 15.4302 2.00002 13.6976 2.00002 12.0151C2.00002 6.74718 6.21002 2.00006 12.02 2.00006ZM16.59 10.7432C15.88 10.7432 15.31 11.314 15.31 12.0251C15.31 12.7262 15.88 13.307 16.59 13.307C17.3 13.307 17.87 12.7262 17.87 12.0251C17.87 11.314 17.3 10.7432 16.59 10.7432ZM11.98 10.7432C11.28 10.7332 10.7 11.314 10.7 12.0151C10.7 12.7261 11.27 13.297 11.98 13.307C12.69 13.307 13.26 12.7262 13.26 12.0251C13.26 11.314 12.69 10.7432 11.98 10.7432ZM7.37002 10.7432C6.66002 10.7432 6.09002 11.314 6.09002 12.0251C6.09002 12.7262 6.67002 13.307 7.37002 13.307C8.08002 13.297 8.65002 12.7262 8.65002 12.0251C8.65002 11.314 8.08002 10.7432 7.37002 10.7432Z\" fill=\"currentColor\"/>\n</svg>\n",
102
+ key: "videoSelfie.tutorial.recordVoiceMessage",
103
+ defaultValue: "Speak the words displayed on the screen"
104
+ }
105
+ };
106
+ /**
107
+ * Pre-capture tutorial for the Video Selfie flow — a port of V1's
108
+ * `RecorderTutorial`. Shows the list of steps the user will go through
109
+ * (permissions first, then the enabled capture steps) and a "Start" button.
110
+ *
111
+ * While this screen is up, the host component warms the WASM pipelines in the
112
+ * background (see `warmupVideoSelfieWasm`), so detection is ready the moment the
113
+ * user taps "Start". Gated by the `showTutorials` config flag.
114
+ */
115
+ var VideoSelfieTutorial = ({ config, onStart, isLoading }) => {
116
+ const { t } = useTranslation();
117
+ const rows = [{
118
+ key: "permissions",
119
+ icon: permission_default,
120
+ label: t("videoSelfie.tutorial.permissions", { defaultValue: "Give recording permissions" })
121
+ }, ...resolveVideoSelfieSteps(config).map((step) => {
122
+ const meta = STEP_ROWS[step];
123
+ return {
124
+ key: step,
125
+ icon: meta.icon,
126
+ label: t(meta.key, { defaultValue: meta.defaultValue })
127
+ };
128
+ })];
129
+ return /* @__PURE__ */ u(Page, {
130
+ className: "IncodeVideoSelfieTutorialPage",
131
+ title: t("videoSelfie.tutorial.videoCheck", { defaultValue: "Video selfie" }),
132
+ titleId: "video-selfie-tutorial-heading",
133
+ subtitle: t("videoSelfie.tutorial.legalReason", { defaultValue: "For legal reasons, we must recheck your documents. You'll be requested to:" }),
134
+ children: [/* @__PURE__ */ u("div", {
135
+ class: "IncodeVideoSelfieTutorialBody",
136
+ children: /* @__PURE__ */ u("ul", {
137
+ class: "IncodeVideoSelfieTutorialSteps",
138
+ children: rows.map((row) => /* @__PURE__ */ u("li", {
139
+ class: "IncodeVideoSelfieTutorialStep",
140
+ children: [/* @__PURE__ */ u("span", {
141
+ class: "IncodeVideoSelfieTutorialStepIcon",
142
+ "aria-hidden": "true",
143
+ dangerouslySetInnerHTML: { __html: row.icon }
144
+ }), /* @__PURE__ */ u("span", {
145
+ class: "IncodeVideoSelfieTutorialStepLabel",
146
+ children: row.label
147
+ })]
148
+ }, row.key))
149
+ })
150
+ }), /* @__PURE__ */ u("div", {
151
+ class: "IncodeVideoSelfieTutorialActions",
152
+ children: /* @__PURE__ */ u(Button, {
153
+ class: "m-auto max-w-[420px]",
154
+ onClick: onStart,
155
+ isLoading,
156
+ children: t("videoSelfie.tutorial.startVideoSelfie", { defaultValue: "Start video selfie" })
157
+ })
158
+ })]
159
+ });
160
+ };
161
+ //#endregion
162
+ //#region src/modules/video-selfie/assets/face-frame.svg
163
+ var face_frame_default = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='336'%20height='518'%20viewBox='0%200%20336%20518'%3e%3cpath%20fill='none'%20fill-rule='evenodd'%20stroke='%23FFF'%20stroke-dasharray='7.139999675750732,19.03999967575073'%20stroke-width='9.044'%20d='M168%20513.392c76.83%200%20162.893-113.92%20162.893-254.447S280.236%204.498%20168%204.498%205.107%20118.418%205.107%20258.945%2091.17%20513.392%20168%20513.392z'/%3e%3c/svg%3e";
164
+ //#endregion
165
+ //#region src/modules/video-selfie/assets/failVideoselfieSolid.svg
166
+ var failVideoselfieSolid_default = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3csvg%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%20fill='none'%20version='1.1'%20id='svg2'%20sodipodi:docname='fail_videoselfie_solid.svg'%20inkscape:version='1.3%20(0e150ed,%202023-07-21)'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:svg='http://www.w3.org/2000/svg'%3e%3cdefs%20id='defs2'%20/%3e%3csodipodi:namedview%20id='namedview2'%20pagecolor='%23ffffff'%20bordercolor='%23000000'%20borderopacity='0.25'%20inkscape:showpageshadow='2'%20inkscape:pageopacity='0.0'%20inkscape:pagecheckerboard='0'%20inkscape:deskcolor='%23d1d1d1'%20inkscape:zoom='3.6875'%20inkscape:cx='31.864407'%20inkscape:cy='32'%20inkscape:window-width='3840'%20inkscape:window-height='2107'%20inkscape:window-x='0'%20inkscape:window-y='25'%20inkscape:window-maximized='1'%20inkscape:current-layer='svg2'%20/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M45%208.5C44.1716%208.5%2043.5%209.17157%2043.5%2010C43.5%2010.8284%2044.1716%2011.5%2045%2011.5H52C52.1326%2011.5%2052.2598%2011.5527%2052.3536%2011.6464C52.4473%2011.7402%2052.5%2011.8674%2052.5%2012V19C52.5%2019.8284%2053.1716%2020.5%2054%2020.5C54.8284%2020.5%2055.5%2019.8284%2055.5%2019V12C55.5%2011.0717%2055.1313%2010.1815%2054.4749%209.52513C53.8185%208.86875%2052.9283%208.5%2052%208.5H45ZM55.5%2045C55.5%2044.1716%2054.8284%2043.5%2054%2043.5C53.1716%2043.5%2052.5%2044.1716%2052.5%2045V52C52.5%2052.1326%2052.4473%2052.2598%2052.3536%2052.3536C52.2598%2052.4473%2052.1326%2052.5%2052%2052.5H45C44.1716%2052.5%2043.5%2053.1716%2043.5%2054C43.5%2054.8284%2044.1716%2055.5%2045%2055.5H52C52.9283%2055.5%2053.8185%2055.1313%2054.4749%2054.4749C55.1313%2053.8185%2055.5%2052.9283%2055.5%2052V45ZM10%2043.5C10.8284%2043.5%2011.5%2044.1716%2011.5%2045V52C11.5%2052.1326%2011.5527%2052.2598%2011.6464%2052.3536C11.7402%2052.4473%2011.8674%2052.5%2012%2052.5H19C19.8284%2052.5%2020.5%2053.1716%2020.5%2054C20.5%2054.8284%2019.8284%2055.5%2019%2055.5H12C11.0717%2055.5%2010.1815%2055.1313%209.52513%2054.4749C8.86875%2053.8185%208.5%2052.9283%208.5%2052V45C8.5%2044.1716%209.17157%2043.5%2010%2043.5ZM12%208.5C11.0717%208.5%2010.1815%208.86875%209.52513%209.52513C8.86875%2010.1815%208.5%2011.0717%208.5%2012V19C8.5%2019.8284%209.17157%2020.5%2010%2020.5C10.8284%2020.5%2011.5%2019.8284%2011.5%2019V12C11.5%2011.8674%2011.5527%2011.7402%2011.6464%2011.6464C11.7402%2011.5527%2011.8674%2011.5%2012%2011.5H19C19.8284%2011.5%2020.5%2010.8284%2020.5%2010C20.5%209.17157%2019.8284%208.5%2019%208.5H12Z'%20fill='%23FF5C6F'%20id='path1'%20style='fill:%23ff5c6f;fill-opacity:1'%20/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M41.4142%2025.4142C42.1953%2024.6332%2042.1953%2023.3668%2041.4142%2022.5858C40.6332%2021.8047%2039.3668%2021.8047%2038.5858%2022.5858L32%2029.1716L25.4142%2022.5858C24.6332%2021.8047%2023.3668%2021.8047%2022.5858%2022.5858C21.8047%2023.3668%2021.8047%2024.6332%2022.5858%2025.4142L29.1716%2032L22.5858%2038.5858C21.8047%2039.3668%2021.8047%2040.6332%2022.5858%2041.4142C23.3668%2042.1953%2024.6332%2042.1953%2025.4142%2041.4142L32%2034.8284L38.5858%2041.4142C39.3668%2042.1953%2040.6332%2042.1953%2041.4142%2041.4142C42.1953%2040.6332%2042.1953%2039.3668%2041.4142%2038.5858L34.8284%2032L41.4142%2025.4142Z'%20fill='white'%20id='path2'%20style='fill:%23ff5c6f;fill-opacity:1'%20/%3e%3c/svg%3e";
167
+ //#endregion
168
+ //#region src/modules/video-selfie/assets/success-selfie.svg
169
+ var success_selfie_default = "data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M44.2413%2012.0554L40.5562%208.27767C40.0509%207.75929%2039.4364%207.5%2038.714%207.5C37.991%207.5%2037.3765%207.75929%2036.8712%208.27767L19.0955%2026.5278L11.129%2018.3332C10.6231%2017.8146%2010.009%2017.5556%209.28662%2017.5556C8.5638%2017.5556%207.94965%2017.8146%207.44379%2018.3332L3.7587%2022.111C3.25284%2022.6295%203%2023.2593%203%2024.0002C3%2024.7405%203.25284%2025.3709%203.7587%2025.8893L13.5676%2035.9445L17.2529%2039.7222C17.7585%2040.241%2018.3728%2040.5%2019.0955%2040.5C19.8178%2040.5%2020.4322%2040.2403%2020.938%2039.7222L24.6233%2035.9445L44.2413%2015.8334C44.7467%2015.3149%2045%2014.6852%2045%2013.9443C45.0004%2013.2038%2044.7467%2012.574%2044.2413%2012.0554Z'%20fill='%230CD5A2'/%3e%3c/svg%3e";
170
+ //#endregion
171
+ //#region src/modules/video-selfie/selfieMask.tsx
172
+ /**
173
+ * Port of V1's `SelfieMask`: a fullscreen circular cut-out (dark vignette via
174
+ * box-shadow) with the face-frame guide inside and a status line below. Border
175
+ * + text color track {@link BorderState} (idle → white, loading → blue,
176
+ * success → green, error → red).
177
+ */
178
+ var SelfieMask = ({ borderState = "idle", message }) => {
179
+ const isError = borderState === "error";
180
+ const isSuccess = borderState === "success";
181
+ return /* @__PURE__ */ u(k, { children: [/* @__PURE__ */ u("div", {
182
+ class: cn("IncodeVsSelfieMask", {
183
+ IncodeVsSelfieMaskLoading: borderState === "loading",
184
+ IncodeVsSelfieMaskCapturing: isSuccess,
185
+ IncodeVsSelfieMaskError: isError
186
+ }),
187
+ "aria-hidden": "true",
188
+ children: /* @__PURE__ */ u("img", {
189
+ src: face_frame_default,
190
+ alt: "",
191
+ class: "IncodeVsSelfieMaskFrame"
192
+ })
193
+ }), /* @__PURE__ */ u("p", {
194
+ class: cn("IncodeVsSelfieMaskText", { IncodeVsSelfieMaskTextCapturing: isSuccess }),
195
+ role: "region",
196
+ "aria-live": "polite",
197
+ children: [
198
+ isError ? /* @__PURE__ */ u("img", {
199
+ src: failVideoselfieSolid_default,
200
+ alt: ""
201
+ }) : null,
202
+ isSuccess ? /* @__PURE__ */ u("img", {
203
+ src: success_selfie_default,
204
+ alt: ""
205
+ }) : null,
206
+ message
207
+ ]
208
+ })] });
209
+ };
210
+ //#endregion
211
+ //#region src/modules/video-selfie/assets/video-selfie-id-front.svg
212
+ var video_selfie_id_front_default = "data:image/svg+xml,%3csvg%20width='34'%20height='50'%20viewBox='0%200%2034%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M32%20-0.00097665C33.1046%20-0.000976602%2034%200.894454%2034%201.99902L34%2047.999C34%2049.1036%2033.1046%2049.999%2032%2049.999L1.99999%2049.999C0.895425%2049.999%20-6.19955e-06%2049.1036%20-6.15126e-06%2047.999L-4.14054e-06%201.99902C-4.09226e-06%200.894453%200.895428%20-0.00097801%202%20-0.000977961L32%20-0.00097665ZM31%2047.999C31.5523%2047.999%2032%2047.5513%2032%2046.999L32%202.99902C32%202.44674%2031.5523%201.99902%2031%201.99902L3%201.99902C2.44771%201.99902%202%202.44674%202%202.99902L1.99999%2046.999C1.99999%2047.5513%202.44771%2047.999%202.99999%2047.999L31%2047.999ZM27%2025.0184C27%2024.4554%2026.5523%2023.999%2026%2023.999C25.4477%2023.999%2025%2024.4554%2025%2025.0184L25%2042.9796C25%2043.5426%2025.4477%2043.999%2026%2043.999C26.5523%2043.999%2027%2043.5426%2027%2042.9796L27%2025.0184ZM23%2025.043C23%2024.4771%2022.5523%2024.0183%2022%2024.0183C21.4477%2024.0183%2021%2024.4771%2021%2025.043L21%2038.9936C21%2039.5595%2021.4477%2040.0183%2022%2040.0183C22.5523%2040.0183%2023%2039.5595%2023%2038.9936L23%2025.043ZM18%2024.0183C18.5523%2024.0183%2019%2024.4771%2019%2025.043L19%2034.9936C19%2035.5595%2018.5523%2036.0183%2018%2036.0183C17.4477%2036.0183%2017%2035.5595%2017%2034.9936L17%2025.043C17%2024.4771%2017.4477%2024.0183%2018%2024.0183ZM15%2025.043C15%2024.4771%2014.5523%2024.0183%2014%2024.0183C13.4477%2024.0183%2013%2024.4771%2013%2025.043L13%2034.9936C13%2035.5595%2013.4477%2036.0183%2014%2036.0183C14.5523%2036.0183%2015%2035.5595%2015%2034.9936L15%2025.043ZM7%206.99902C7.55228%206.99902%208%207.4578%208%208.02372L8%2017.9743C8%2018.5402%207.55228%2018.999%207%2018.999C6.44771%2018.999%206%2018.5402%206%2017.9743L6%208.02372C6%207.4578%206.44771%206.99902%207%206.99902ZM23%2012.999C23%2011.8945%2022.1046%2010.999%2021%2010.999C19.8954%2010.999%2019%2011.8945%2019%2012.999C19%2014.1036%2019.8954%2014.999%2021%2014.999C22.1046%2014.999%2023%2014.1036%2023%2012.999ZM21%208.99902C23.2091%208.99902%2025%2010.7899%2025%2012.999C25%2015.2082%2023.2091%2016.999%2021%2016.999C19.5805%2016.999%2018.3336%2016.2596%2017.6237%2015.1448C17.4135%2015.7246%2017.118%2016.2725%2016.7438%2016.7682C15.9295%2017.8472%2014.7888%2018.618%2013.5009%2018.9595C13.3318%2019.0044%2013.1618%2019.0099%2013%2018.9817L13%2018.999L27%2018.999L27%206.99902L13.1998%206.99902C13.2991%206.99906%2013.4%207.01182%2013.5005%207.03849C14.7884%207.37998%2015.9291%208.1507%2016.7436%209.22957C17.1178%209.72537%2017.4134%2010.2733%2017.6237%2010.8532C18.3336%209.73849%2019.5804%208.99902%2021%208.99902ZM13.199%206.99902L13%206.99902L13%207.01627C13.0652%207.00492%2013.1317%206.99905%2013.199%206.99902ZM13%2016.5479C13.7319%2016.3306%2014.3787%2015.8804%2014.8462%2015.261C15.3349%2014.6135%2015.6001%2013.8178%2015.6001%2012.9989C15.6001%2012.1801%2015.3348%2011.3844%2014.8461%2010.737C14.3785%2010.1176%2013.7318%209.6675%2013%209.45022L13%2016.5479ZM28%204.99902C28.5523%204.99902%2029%205.44674%2029%205.99902L29%2019.999C29%2020.5513%2028.5523%2020.999%2028%2020.999L12%2020.999C11.4477%2020.999%2011%2020.5513%2011%2019.999L11%205.99902C11%205.44674%2011.4477%204.99902%2012%204.99902L28%204.99902Z'%20fill='white'/%3e%3c/svg%3e";
213
+ //#endregion
214
+ //#region src/modules/video-selfie/assets/video-selfie-id-back.svg
215
+ var video_selfie_id_back_default = "data:image/svg+xml,%3csvg%20width='34'%20height='50'%20viewBox='0%200%2034%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M34%202C34%200.89543%2033.1046%20-3.91396e-08%2032%20-8.74219e-08L2%20-1.39876e-06C0.895432%20-1.44705e-06%20-3.91405e-08%200.895429%20-8.74228e-08%202L-2.09815e-06%2048C-2.14643e-06%2049.1046%200.895429%2050%202%2050L32%2050C33.1046%2050%2034%2049.1046%2034%2048L34%202ZM32%2047C32%2047.5523%2031.5523%2048%2031%2048L3%2048C2.44771%2048%202%2047.5523%202%2047L2%203C2%202.44771%202.44772%202%203%202L31%202C31.5523%202%2032%202.44772%2032%203L32%2047ZM29%205L29%209L23%209L23%205L29%205ZM29%2011L29%2013L23%2013L23%2011L29%2011ZM29%2015L29%2019L23%2019L23%2015L29%2015ZM29%2039L29%2035L23%2035L23%2039L29%2039ZM29%2034L29%2022L23%2022L23%2034L29%2034ZM29%2040L29%2045L23%2045L23%2040L29%2040ZM29%2021L29%2020L23%2020L23%2021L29%2021ZM6%205C6.55228%205%207%205.44772%207%206L7%2023.5C7%2024.0523%206.55228%2024.5%206%2024.5C5.44771%2024.5%205%2024.0523%205%2023.5L5%206C5%205.44771%205.44771%205%206%205Z'%20fill='white'/%3e%3c/svg%3e";
216
+ //#endregion
217
+ //#region src/modules/video-selfie/assets/allGood.svg
218
+ var allGood_default = "data:image/svg+xml,%3csvg%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42.6026%2026.3467L40.6723%2024.4006C40.4076%2024.1336%2040.0857%2024%2039.7074%2024C39.3286%2024%2039.0067%2024.1336%2038.7421%2024.4006L29.431%2033.8022L25.258%2029.5807C24.9931%2029.3136%2024.6714%2029.1802%2024.293%2029.1802C23.9144%2029.1802%2023.5927%2029.3136%2023.3277%2029.5807L21.3974%2031.5269C21.1324%2031.794%2021%2032.1184%2021%2032.5001C21%2032.8815%2021.1324%2033.2062%2021.3974%2033.4733L26.5354%2038.6532L28.4658%2040.5993C28.7306%2040.8666%2029.0524%2041%2029.431%2041C29.8093%2041%2030.1311%2040.8662%2030.3961%2040.5993L32.3265%2038.6532L42.6026%2028.293C42.8673%2028.0258%2043%2027.7014%2043%2027.3198C43.0002%2026.9383%2042.8673%2026.6139%2042.6026%2026.3467Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M44.5%209C43.6716%209%2043%209.67157%2043%2010.5C43%2011.3284%2043.6716%2012%2044.5%2012H51.5C51.6326%2012%2051.7598%2012.0527%2051.8536%2012.1464C51.9473%2012.2402%2052%2012.3674%2052%2012.5V19.5C52%2020.3284%2052.6716%2021%2053.5%2021C54.3284%2021%2055%2020.3284%2055%2019.5V12.5C55%2011.5717%2054.6313%2010.6815%2053.9749%2010.0251C53.3185%209.36875%2052.4283%209%2051.5%209H44.5ZM55%2045.5C55%2044.6716%2054.3284%2044%2053.5%2044C52.6716%2044%2052%2044.6716%2052%2045.5V52.5C52%2052.6326%2051.9473%2052.7598%2051.8536%2052.8536C51.7598%2052.9473%2051.6326%2053%2051.5%2053H44.5C43.6716%2053%2043%2053.6716%2043%2054.5C43%2055.3284%2043.6716%2056%2044.5%2056H51.5C52.4283%2056%2053.3185%2055.6313%2053.9749%2054.9749C54.6313%2054.3185%2055%2053.4283%2055%2052.5V45.5ZM9.5%2044C10.3284%2044%2011%2044.6716%2011%2045.5V52.5C11%2052.6326%2011.0527%2052.7598%2011.1464%2052.8536C11.2402%2052.9473%2011.3674%2053%2011.5%2053H18.5C19.3284%2053%2020%2053.6716%2020%2054.5C20%2055.3284%2019.3284%2056%2018.5%2056H11.5C10.5717%2056%209.68151%2055.6313%209.02513%2054.9749C8.36875%2054.3185%208%2053.4283%208%2052.5V45.5C8%2044.6716%208.67157%2044%209.5%2044ZM11.5%209C10.5717%209%209.6815%209.36875%209.02513%2010.0251C8.36875%2010.6815%208%2011.5717%208%2012.5V19.5C8%2020.3284%208.67157%2021%209.5%2021C10.3284%2021%2011%2020.3284%2011%2019.5V12.5C11%2012.3674%2011.0527%2012.2402%2011.1464%2012.1464C11.2402%2012.0527%2011.3674%2012%2011.5%2012H18.5C19.3284%2012%2020%2011.3284%2020%2010.5C20%209.67157%2019.3284%209%2018.5%209H11.5Z'%20fill='%230CD5A2'/%3e%3c/svg%3e";
219
+ //#endregion
220
+ //#region src/modules/video-selfie/assets/failVideoselfie.svg
221
+ var failVideoselfie_default = "data:image/svg+xml,%3csvg%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M45%208.5C44.1716%208.5%2043.5%209.17157%2043.5%2010C43.5%2010.8284%2044.1716%2011.5%2045%2011.5H52C52.1326%2011.5%2052.2598%2011.5527%2052.3536%2011.6464C52.4473%2011.7402%2052.5%2011.8674%2052.5%2012V19C52.5%2019.8284%2053.1716%2020.5%2054%2020.5C54.8284%2020.5%2055.5%2019.8284%2055.5%2019V12C55.5%2011.0717%2055.1313%2010.1815%2054.4749%209.52513C53.8185%208.86875%2052.9283%208.5%2052%208.5H45ZM55.5%2045C55.5%2044.1716%2054.8284%2043.5%2054%2043.5C53.1716%2043.5%2052.5%2044.1716%2052.5%2045V52C52.5%2052.1326%2052.4473%2052.2598%2052.3536%2052.3536C52.2598%2052.4473%2052.1326%2052.5%2052%2052.5H45C44.1716%2052.5%2043.5%2053.1716%2043.5%2054C43.5%2054.8284%2044.1716%2055.5%2045%2055.5H52C52.9283%2055.5%2053.8185%2055.1313%2054.4749%2054.4749C55.1313%2053.8185%2055.5%2052.9283%2055.5%2052V45ZM10%2043.5C10.8284%2043.5%2011.5%2044.1716%2011.5%2045V52C11.5%2052.1326%2011.5527%2052.2598%2011.6464%2052.3536C11.7402%2052.4473%2011.8674%2052.5%2012%2052.5H19C19.8284%2052.5%2020.5%2053.1716%2020.5%2054C20.5%2054.8284%2019.8284%2055.5%2019%2055.5H12C11.0717%2055.5%2010.1815%2055.1313%209.52513%2054.4749C8.86875%2053.8185%208.5%2052.9283%208.5%2052V45C8.5%2044.1716%209.17157%2043.5%2010%2043.5ZM12%208.5C11.0717%208.5%2010.1815%208.86875%209.52513%209.52513C8.86875%2010.1815%208.5%2011.0717%208.5%2012V19C8.5%2019.8284%209.17157%2020.5%2010%2020.5C10.8284%2020.5%2011.5%2019.8284%2011.5%2019V12C11.5%2011.8674%2011.5527%2011.7402%2011.6464%2011.6464C11.7402%2011.5527%2011.8674%2011.5%2012%2011.5H19C19.8284%2011.5%2020.5%2010.8284%2020.5%2010C20.5%209.17157%2019.8284%208.5%2019%208.5H12Z'%20fill='%23FF5C6F'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M41.4142%2025.4142C42.1953%2024.6332%2042.1953%2023.3668%2041.4142%2022.5858C40.6332%2021.8047%2039.3668%2021.8047%2038.5858%2022.5858L32%2029.1716L25.4142%2022.5858C24.6332%2021.8047%2023.3668%2021.8047%2022.5858%2022.5858C21.8047%2023.3668%2021.8047%2024.6332%2022.5858%2025.4142L29.1716%2032L22.5858%2038.5858C21.8047%2039.3668%2021.8047%2040.6332%2022.5858%2041.4142C23.3668%2042.1953%2024.6332%2042.1953%2025.4142%2041.4142L32%2034.8284L38.5858%2041.4142C39.3668%2042.1953%2040.6332%2042.1953%2041.4142%2041.4142C42.1953%2040.6332%2042.1953%2039.3668%2041.4142%2038.5858L34.8284%2032L41.4142%2025.4142Z'%20fill='white'/%3e%3c/svg%3e";
222
+ //#endregion
223
+ //#region src/modules/video-selfie/assets/spinner.svg
224
+ var spinner_default = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!--%20Created%20with%20Inkscape%20(http://www.inkscape.org/)%20--%3e%3csvg%20width='48'%20height='48'%20viewBox='0%200%2012.7%2012.7'%20version='1.1'%20id='svg1'%20inkscape:version='1.3%20(0e150ed,%202023-07-21)'%20sodipodi:docname='spinner.svg'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:svg='http://www.w3.org/2000/svg'%3e%3csodipodi:namedview%20id='namedview1'%20pagecolor='%23ffffff'%20bordercolor='%23000000'%20borderopacity='0.25'%20inkscape:showpageshadow='2'%20inkscape:pageopacity='0.0'%20inkscape:pagecheckerboard='0'%20inkscape:deskcolor='%23d1d1d1'%20inkscape:document-units='mm'%20inkscape:zoom='12.310189'%20inkscape:cx='25.629176'%20inkscape:cy='22.095518'%20inkscape:window-width='1568'%20inkscape:window-height='1091'%20inkscape:window-x='1084'%20inkscape:window-y='318'%20inkscape:window-maximized='0'%20inkscape:current-layer='layer1'%20/%3e%3cdefs%20id='defs1'%20/%3e%3cg%20inkscape:label='Layer%201'%20inkscape:groupmode='layer'%20id='layer1'%3e%3cg%20id='g4'%20transform='matrix(2.0610545,0,0,2.0621418,-1290.7384,-517.766)'%3e%3cg%20style='fill:none'%20id='g2'%20transform='matrix(0.12786788,0,0,0.12786788,626.26875,251.04547)'%3e%3cpath%20opacity='0.3'%20d='m%2048,24.4541%20c%200,13.2548%20-10.7452,24%20-24,24%20-13.2548,0%20-24,-10.7452%20-24,-24%20C%200,11.1993%2010.7452,0.454102%2024,0.454102%20c%2013.2548,0%2024,10.745198%2024,23.999998%20z%20m%20-40.51639,0%20c%200,9.1218%207.39459,16.5164%2016.51639,16.5164%209.1218,0%2016.5164,-7.3946%2016.5164,-16.5164%20C%2040.5164,15.3323%2033.1218,7.93771%2024,7.93771%2014.8782,7.93771%207.48361,15.3323%207.48361,24.4541%20Z'%20fill='%23ffffff'%20id='path1-8'%20/%3e%3c/g%3e%3cg%20style='fill:none'%20id='g3'%20transform='matrix(0.12786788,0,0,0.12786788,629.34991,250.99928)'%3e%3cpath%20d='m%2020.2582,24.4541%20c%202.0665,0%203.7716,-1.6852%203.4507,-3.7267%20C%2023.4151,18.8582%2022.9006,17.0259%2022.1731,15.2697%2020.967,12.3579%2019.1992,9.71214%2016.9706,7.48354%2014.742,5.25493%2012.0962,3.48711%209.1844,2.28099%207.42818,1.55354%205.59591,1.03902%203.72669,0.745204%201.68521,0.424313%20-1.90735e-6,2.12936%200,4.1959%20c%200,2.06655%201.69616,3.69967%203.7099,4.16386%200.88977,0.2051%201.76308,0.48411%202.61065,0.83518%202.00386,0.83006%203.82465,2.04666%205.35835,3.58026%201.5336,1.5337%202.7502,3.3545%203.5803,5.3584%200.351,0.8475%200.63,1.7208%200.8351,2.6106%200.4642,2.0137%202.0974,3.7099%204.1639,3.7099%20z'%20fill='%23ffffff'%20id='path1-83'%20/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e";
225
+ //#endregion
226
+ //#region src/modules/video-selfie/idMask.tsx
227
+ var FRAME_STATE = {
228
+ idle: "idle",
229
+ loading: "focus",
230
+ capturing: "capturing",
231
+ success: "success",
232
+ error: "error"
233
+ };
234
+ /**
235
+ * ID-card frame for the Video Selfie flow. Reuses the shared `CameraFrame`
236
+ * (locked, vertical) — the exact frame the standalone ID-capture module draws —
237
+ * laid over the camera with its own dark vignette, with a guidance label
238
+ * (front/back illustration, or spinner while processing / success / error icon
239
+ * on result) plus the localized message floating in the centre.
240
+ */
241
+ var IdMask = ({ borderState = "idle", mode, capturing = false, message }) => {
242
+ return /* @__PURE__ */ u("div", {
243
+ class: "IncodeVsIdMask",
244
+ children: [/* @__PURE__ */ u("div", {
245
+ class: "IncodeVsIdMaskLabel",
246
+ children: [capturing ? /* @__PURE__ */ u("img", {
247
+ src: spinner_default,
248
+ alt: "",
249
+ class: "IncodeVsIdMaskSpinner"
250
+ }) : /* @__PURE__ */ u("img", {
251
+ src: borderState === "error" ? failVideoselfie_default : borderState === "success" ? allGood_default : mode === "back" ? video_selfie_id_back_default : video_selfie_id_front_default,
252
+ alt: ""
253
+ }), /* @__PURE__ */ u("p", {
254
+ class: "IncodeVsIdMaskText",
255
+ role: "region",
256
+ "aria-live": "polite",
257
+ children: message
258
+ })]
259
+ }), /* @__PURE__ */ u(CameraFrame, {
260
+ variant: "locked",
261
+ orientation: "vertical",
262
+ frameState: FRAME_STATE[borderState]
263
+ })]
264
+ });
265
+ };
266
+ //#endregion
267
+ //#region src/modules/video-selfie/poaMask.tsx
268
+ /**
269
+ * Port of V1's `ProofOfAddressMask`: a pass-through overlay for the
270
+ * proof-of-address step. A banner instructs the user to hold their address
271
+ * document up to the (rear) camera; the document is captured passively by the
272
+ * ongoing video recording. Tapping Continue simply advances the step — there is
273
+ * no client-side capture, upload, or validation, and no analytics event (the
274
+ * curated flow-event stream records the module milestone when the step ends).
275
+ *
276
+ * The instruction reuses V1's three `videoSelfie.showPoa*` keys (the middle
277
+ * fragment is emphasized) so the existing backend translations resolve.
278
+ */
279
+ var PoaMask = ({ onContinue }) => {
280
+ const { t } = useTranslation();
281
+ const partOne = t("videoSelfie.showPoaOne");
282
+ const partTwo = t("videoSelfie.showPoaTwo");
283
+ const partThree = t("videoSelfie.showPoaThree");
284
+ return /* @__PURE__ */ u("div", {
285
+ class: "IncodeVsPoaMask",
286
+ children: [/* @__PURE__ */ u("div", {
287
+ class: "IncodeVsPoaBanner",
288
+ children: /* @__PURE__ */ u("h2", {
289
+ class: "IncodeVsPoaBannerText",
290
+ "aria-label": `${partOne} ${partTwo} ${partThree}`,
291
+ children: [
292
+ partOne,
293
+ " ",
294
+ /* @__PURE__ */ u("span", {
295
+ class: "IncodeVsPoaBannerEmphasis",
296
+ children: partTwo
297
+ }),
298
+ /* @__PURE__ */ u("br", {}),
299
+ partThree
300
+ ]
301
+ })
302
+ }), /* @__PURE__ */ u("div", {
303
+ class: "IncodeVsPoaActions",
304
+ children: /* @__PURE__ */ u(Button, {
305
+ class: "IncodeVsPoaButton",
306
+ onClick: onContinue,
307
+ children: t("common.continue")
308
+ })
309
+ })]
310
+ });
311
+ };
312
+ //#endregion
313
+ //#region src/modules/video-selfie/voiceRecordingConstants.ts
314
+ /**
315
+ * Minimum elapsed recording time before the user can submit (so there's
316
+ * meaningful audio). Gates the "done" button in the questions and speech steps.
317
+ */
318
+ var MIN_VOICE_RECORDING_FLOOR_MS = 1250;
319
+ /**
320
+ * How long the user can speak the consent phrase before the UI surfaces the
321
+ * "did you finish?" confirmation. Mirrors V1's 10s window.
322
+ */
323
+ var VOICE_CONSENT_WINDOW_MS = 1e4;
324
+ //#endregion
325
+ //#region src/modules/video-selfie/questionsMask.tsx
326
+ /**
327
+ * Port of V1's `QuestionsMask`: a bottom sheet that walks the user through N
328
+ * randomly-fetched challenge questions answered out loud. The spoken answers
329
+ * are captured by the main video recording — this component only paces the
330
+ * interaction (tap to answer → speak → tap when done) and advances the step.
331
+ */
332
+ var QuestionsMask = ({ count, onDone }) => {
333
+ const { t } = useTranslation();
334
+ const [questions, setQuestions] = d([]);
335
+ const [started, setStarted] = d(false);
336
+ const [current, setCurrent] = d(0);
337
+ const [recording, setRecording] = d(false);
338
+ const [canFinish, setCanFinish] = d(false);
339
+ const floorTimer = useTimeoutHandle();
340
+ y(() => {
341
+ let active = true;
342
+ getVideoSelfieQuestions(count).then((result) => {
343
+ if (active) setQuestions(result);
344
+ });
345
+ return () => {
346
+ active = false;
347
+ floorTimer.clear();
348
+ };
349
+ }, [count, floorTimer]);
350
+ const startAnswer = () => {
351
+ setRecording(true);
352
+ setCanFinish(false);
353
+ screenEvent({
354
+ module: eventModuleNames.videoSelfie,
355
+ screen: eventScreenNames.videoSelfieVoiceQuestion,
356
+ code: videoSelfieEvents.audioStreamOpened,
357
+ payload: { question: questions[current] }
358
+ });
359
+ floorTimer.schedule(() => {
360
+ setCanFinish(true);
361
+ }, MIN_VOICE_RECORDING_FLOOR_MS);
362
+ };
363
+ const finishAnswer = () => {
364
+ floorTimer.clear();
365
+ screenEvent({
366
+ module: eventModuleNames.videoSelfie,
367
+ screen: eventScreenNames.videoSelfieVoiceQuestion,
368
+ code: videoSelfieEvents.videoSelfieQuestionAnswered,
369
+ payload: {
370
+ index: current + 1,
371
+ question: questions[current]
372
+ }
373
+ });
374
+ screenEvent({
375
+ module: eventModuleNames.videoSelfie,
376
+ screen: eventScreenNames.videoSelfieVoiceQuestion,
377
+ code: videoSelfieEvents.audioStreamClosed,
378
+ payload: { question: questions[current] }
379
+ });
380
+ const next = current + 1;
381
+ if (next >= questions.length) {
382
+ onDone();
383
+ return;
384
+ }
385
+ setCurrent(next);
386
+ setRecording(false);
387
+ setCanFinish(false);
388
+ };
389
+ const plural = questions.length > 1;
390
+ if (!started) return /* @__PURE__ */ u("div", {
391
+ class: "IncodeVsVoicePanel",
392
+ role: "dialog",
393
+ children: [
394
+ /* @__PURE__ */ u("h2", {
395
+ class: "IncodeVsVoicePanelLabel",
396
+ children: t("videoSelfie.answerOutLoud", { defaultValue: "Answer out loud" })
397
+ }),
398
+ /* @__PURE__ */ u("p", {
399
+ class: "IncodeVsVoicePanelTitle",
400
+ "aria-live": "assertive",
401
+ children: plural ? t("videoSelfie.weNeedVerbalAnswersPlural", { defaultValue: "We need your verbal answers" }) : t("videoSelfie.weNeedVerbalAnswer", { defaultValue: "We need your verbal answer" })
402
+ }),
403
+ /* @__PURE__ */ u(Button, {
404
+ class: "IncodeVsVoicePanelButton",
405
+ onClick: () => setStarted(true),
406
+ disabled: questions.length === 0,
407
+ children: t("videoSelfie.readyAnswer", { defaultValue: "Ready to answer" })
408
+ })
409
+ ]
410
+ });
411
+ return /* @__PURE__ */ u("div", {
412
+ class: cn("IncodeVsVoicePanel", recording && "IncodeVsVoicePanelActive"),
413
+ role: "dialog",
414
+ children: [
415
+ /* @__PURE__ */ u("ol", {
416
+ class: "IncodeVsVoiceStepper",
417
+ "aria-hidden": "true",
418
+ children: questions.map((question, index) => /* @__PURE__ */ u("li", { class: cn("IncodeVsVoiceStep", current >= index && "IncodeVsVoiceStepActive") }, question.id))
419
+ }),
420
+ /* @__PURE__ */ u("h2", {
421
+ class: "IncodeVsVoicePanelLabel",
422
+ children: t("videoSelfie.answerOutLoud", { defaultValue: "Answer out loud" })
423
+ }),
424
+ /* @__PURE__ */ u("p", {
425
+ class: "IncodeVsVoicePanelTitle",
426
+ "aria-live": "assertive",
427
+ children: questions[current]?.question
428
+ }),
429
+ recording ? /* @__PURE__ */ u(k, { children: [/* @__PURE__ */ u("span", {
430
+ class: "IncodeVsVoiceMic",
431
+ "aria-hidden": "true"
432
+ }), /* @__PURE__ */ u(Button, {
433
+ class: "IncodeVsVoicePanelButton",
434
+ onClick: finishAnswer,
435
+ disabled: !canFinish,
436
+ "aria-live": "polite",
437
+ children: t("common.tapWhenDone", { defaultValue: "Tap when done" })
438
+ })] }) : /* @__PURE__ */ u(Button, {
439
+ variant: "secondary",
440
+ class: "IncodeVsVoicePanelButton",
441
+ onClick: startAnswer,
442
+ children: t("common.tapToAnswer", { defaultValue: "Tap to answer" })
443
+ })
444
+ ]
445
+ });
446
+ };
447
+ //#endregion
448
+ //#region src/modules/video-selfie/speechMask.tsx
449
+ /**
450
+ * Port of V1's `SpeechMask`: the user reads a backend-provided consent phrase
451
+ * out loud. The phrase is captured as a standalone MP3 (via the core consent
452
+ * recorder) and uploaded for speech-to-text validation, separate from the main
453
+ * video. On success the step advances; failures retry up to `numberOfTries`.
454
+ */
455
+ var SpeechMask = ({ composite, speechToTextCheck, numberOfTries, onDone }) => {
456
+ const { t } = useTranslation();
457
+ const [phrase, setPhrase] = d("");
458
+ const [phase, setPhase] = d("instructions");
459
+ const [canFinish, setCanFinish] = d(false);
460
+ const [recorder] = d(() => createConsentRecorder());
461
+ const triesRef = A(0);
462
+ const floorTimer = useTimeoutHandle();
463
+ const windowTimer = useTimeoutHandle();
464
+ const successTimer = useTimeoutHandle();
465
+ const finishStep = q(() => onDone(), [onDone]);
466
+ const clearTimers = q(() => {
467
+ floorTimer.clear();
468
+ windowTimer.clear();
469
+ successTimer.clear();
470
+ }, [
471
+ floorTimer,
472
+ successTimer,
473
+ windowTimer
474
+ ]);
475
+ y(() => {
476
+ let active = true;
477
+ getVoiceConsentPhrase().then((result) => {
478
+ if (active) setPhrase(result);
479
+ });
480
+ return () => {
481
+ active = false;
482
+ clearTimers();
483
+ recorder.cancel();
484
+ };
485
+ }, [recorder, clearTimers]);
486
+ const startSpeaking = () => {
487
+ if (composite) recorder.start(composite);
488
+ screenEvent({
489
+ module: eventModuleNames.videoSelfie,
490
+ screen: eventScreenNames.videoSelfieVoiceFinalQuestion,
491
+ code: videoSelfieEvents.audioStreamOpened
492
+ });
493
+ setPhase("recording");
494
+ setCanFinish(false);
495
+ floorTimer.schedule(() => {
496
+ setCanFinish(true);
497
+ }, MIN_VOICE_RECORDING_FLOOR_MS);
498
+ windowTimer.schedule(() => {
499
+ setPhase("confirm");
500
+ }, VOICE_CONSENT_WINDOW_MS);
501
+ };
502
+ const submit = () => {
503
+ clearTimers();
504
+ screenEvent({
505
+ module: eventModuleNames.videoSelfie,
506
+ screen: eventScreenNames.videoSelfieVoiceFinalQuestion,
507
+ code: videoSelfieEvents.audioStreamClosed
508
+ });
509
+ if (!speechToTextCheck) {
510
+ recorder.cancel();
511
+ finishStep();
512
+ return;
513
+ }
514
+ setPhase("submitting");
515
+ recorder.submit().then(({ success }) => {
516
+ if (success) {
517
+ screenEvent({
518
+ module: eventModuleNames.videoSelfie,
519
+ code: videoSelfieEvents.videoSelfieTosAccepted
520
+ });
521
+ setPhase("success");
522
+ successTimer.schedule(finishStep, 1500);
523
+ return;
524
+ }
525
+ triesRef.current += 1;
526
+ if (numberOfTries !== -1 && triesRef.current >= numberOfTries) {
527
+ screenEvent({
528
+ module: eventModuleNames.videoSelfie,
529
+ code: videoSelfieEvents.videoSelfieTosNotAccepted
530
+ });
531
+ finishStep();
532
+ return;
533
+ }
534
+ setPhase("error");
535
+ });
536
+ };
537
+ const tryAgain = () => {
538
+ recorder.cancel();
539
+ setPhase("instructions");
540
+ setCanFinish(false);
541
+ };
542
+ if (phase === "submitting" || phase === "success") return /* @__PURE__ */ u("div", {
543
+ class: "IncodeVsVoicePanel IncodeVsVoicePanelProcessing",
544
+ role: "status",
545
+ children: phase === "submitting" ? /* @__PURE__ */ u(LoadingIcon, { size: 48 }) : /* @__PURE__ */ u("p", {
546
+ class: "IncodeVsVoiceSuccess",
547
+ children: t("videoSelfie.allGood", { defaultValue: "All good" })
548
+ })
549
+ });
550
+ if (phase === "error") return /* @__PURE__ */ u("div", {
551
+ class: "IncodeVsVoicePanel",
552
+ role: "alertdialog",
553
+ children: [/* @__PURE__ */ u("p", {
554
+ class: "IncodeVsVoicePanelTitle",
555
+ children: t("common.tryAgain", { defaultValue: "Try again" })
556
+ }), /* @__PURE__ */ u(Button, {
557
+ class: "IncodeVsVoicePanelButton",
558
+ onClick: tryAgain,
559
+ children: t("videoSelfie.tryAgain", { defaultValue: "Try again" })
560
+ })]
561
+ });
562
+ if (phase === "confirm") return /* @__PURE__ */ u("div", {
563
+ class: "IncodeVsVoicePanel",
564
+ role: "alertdialog",
565
+ children: [
566
+ /* @__PURE__ */ u("h2", {
567
+ class: "IncodeVsVoicePanelLabel",
568
+ children: t("videoSelfie.finishedSpeaking", { defaultValue: "Finished speaking?" })
569
+ }),
570
+ /* @__PURE__ */ u("p", {
571
+ class: "IncodeVsVoicePanelTitle",
572
+ children: [
573
+ t("videoSelfie.didYouSay", { defaultValue: "Did you say" }),
574
+ " “",
575
+ phrase,
576
+ "”?"
577
+ ]
578
+ }),
579
+ /* @__PURE__ */ u(Button, {
580
+ class: "IncodeVsVoicePanelButton",
581
+ onClick: submit,
582
+ children: t("videoSelfie.imDone", { defaultValue: "I'm done" })
583
+ }),
584
+ /* @__PURE__ */ u(Button, {
585
+ variant: "link",
586
+ class: "IncodeVsVoicePanelButton",
587
+ onClick: tryAgain,
588
+ children: t("videoSelfie.tryAgain", { defaultValue: "Try again" })
589
+ })
590
+ ]
591
+ });
592
+ const isRecording = phase === "recording";
593
+ return /* @__PURE__ */ u("div", {
594
+ class: cn("IncodeVsVoicePanel", isRecording && "IncodeVsVoicePanelActive"),
595
+ role: "dialog",
596
+ children: [
597
+ /* @__PURE__ */ u("h2", {
598
+ class: "IncodeVsVoicePanelLabel",
599
+ children: t("videoSelfie.sayOutLoud", { defaultValue: "Say out loud" })
600
+ }),
601
+ /* @__PURE__ */ u("p", {
602
+ class: "IncodeVsVoicePanelTitle",
603
+ "aria-live": "assertive",
604
+ children: phrase
605
+ }),
606
+ isRecording ? /* @__PURE__ */ u(k, { children: [/* @__PURE__ */ u("span", {
607
+ class: "IncodeVsVoiceMic",
608
+ "aria-hidden": "true"
609
+ }), /* @__PURE__ */ u(Button, {
610
+ class: "IncodeVsVoicePanelButton",
611
+ onClick: submit,
612
+ disabled: !canFinish,
613
+ "aria-live": "polite",
614
+ children: t("common.tapWhenDone", { defaultValue: "Tap when done" })
615
+ })] }) : /* @__PURE__ */ u(Button, {
616
+ variant: "secondary",
617
+ class: "IncodeVsVoicePanelButton",
618
+ onClick: startSpeaking,
619
+ disabled: !phrase,
620
+ children: t("common.tapToSpeak", { defaultValue: "Tap to speak" })
621
+ })
622
+ ]
623
+ });
624
+ };
625
+ //#endregion
626
+ //#region src/modules/video-selfie/assets/steps/selfie.svg
627
+ var selfie_default = "data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M22.5%204C21.9477%204%2021.5%204.44772%2021.5%205C21.5%205.55228%2021.9477%206%2022.5%206L26%206V9.49995C26%2010.0522%2026.4477%2010.5%2027%2010.5C27.5523%2010.5%2028%2010.0522%2028%209.49995V6C28%205.46957%2027.7893%204.96086%2027.4142%204.58579C27.0391%204.21071%2026.5304%204%2026%204H22.5ZM28%2022.5C28%2021.9477%2027.5523%2021.5%2027%2021.5C26.4477%2021.5%2026%2021.9477%2026%2022.5V26H22.5C21.9477%2026%2021.5%2026.4478%2021.5%2027C21.5%2027.5523%2021.9477%2028%2022.5%2028H26C26.5304%2028%2027.0391%2027.7893%2027.4142%2027.4143C27.7893%2027.0392%2028%2026.5305%2028%2026V22.5ZM5%2021.5C5.55228%2021.5%206%2021.9477%206%2022.5V26H9.5C10.0523%2026%2010.5%2026.4478%2010.5%2027C10.5%2027.5523%2010.0523%2028%209.5%2028H6C5.46957%2028%204.96086%2027.7893%204.58579%2027.4143C4.21071%2027.0392%204%2026.5305%204%2026V22.5C4%2021.9477%204.44772%2021.5%205%2021.5ZM6%204C5.46957%204%204.96086%204.21071%204.58579%204.58579C4.21071%204.96086%204%205.46957%204%206V9.49995C4%2010.0522%204.44772%2010.5%205%2010.5C5.55228%2010.5%206%2010.0522%206%209.49995L6%206L9.5%206C10.0523%206%2010.5%205.55228%2010.5%205C10.5%204.44772%2010.0523%204%209.5%204H6ZM16%2011C14.3431%2011%2013%2012.3431%2013%2014C13%2015.6569%2014.3431%2017%2016%2017C17.6569%2017%2019%2015.6569%2019%2014C19%2012.3431%2017.6569%2011%2016%2011ZM19.2688%2017.7836C20.3291%2016.8668%2021%2015.5117%2021%2014C21%2011.2386%2018.7614%209%2016%209C13.2386%209%2011%2011.2386%2011%2014C11%2015.5117%2011.6709%2016.8668%2012.7312%2017.7836C12.4728%2017.9138%2012.2204%2018.0597%2011.9752%2018.2209C10.7604%2019.0197%209.76848%2020.1648%209.10624%2021.533C8.86984%2022.0213%209.04119%2022.6263%209.48896%2022.8841C9.93673%2023.142%2010.4914%2022.9551%2010.7278%2022.4667C11.2342%2021.4203%2011.9928%2020.5445%2012.9219%2019.9337C13.8461%2019.326%2014.904%2019.0033%2015.9829%2019C15.9886%2019%2015.9943%2019%2016%2019C16.0057%2019%2016.0114%2019%2016.0171%2019C17.096%2019.0033%2018.1539%2019.326%2019.0781%2019.9337C20.0072%2020.5446%2020.7658%2021.4203%2021.2722%2022.4667C21.5086%2022.9551%2022.0633%2023.142%2022.511%2022.8841C22.9588%2022.6263%2023.1302%2022.0214%2022.8938%2021.533C22.2315%2020.1648%2021.2396%2019.0197%2020.0248%2018.2209C19.7796%2018.0597%2019.5272%2017.9138%2019.2688%2017.7836Z'%20fill='white'/%3e%3c/svg%3e";
628
+ //#endregion
629
+ //#region src/modules/video-selfie/assets/steps/idFront.svg
630
+ var idFront_default = "data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5%205C3.89543%205%203%205.89543%203%207V25C3%2026.1046%203.89543%2027%205%2027H27C28.1046%2027%2029%2026.1046%2029%2025V7C29%205.89543%2028.1046%205%2027%205H5ZM5%207H27V25H5V7ZM9.5127%2015C9.5127%2013.8954%2010.4081%2013%2011.5127%2013C12.6173%2013%2013.5127%2013.8954%2013.5127%2015C13.5127%2016.1046%2012.6173%2017%2011.5127%2017H11.5125C10.408%2016.9999%209.5127%2016.1045%209.5127%2015ZM14.3123%2017.857C15.0531%2017.131%2015.5127%2016.1192%2015.5127%2015C15.5127%2012.7909%2013.7218%2011%2011.5127%2011C9.30356%2011%207.5127%2012.7909%207.5127%2015C7.5127%2016.1192%207.97231%2017.131%208.71309%2017.857C8.62373%2017.9173%208.53613%2017.9807%208.45044%2018.0471C7.57401%2018.7258%206.9479%2019.6765%206.67049%2020.7497C6.53228%2021.2844%206.8537%2021.8299%207.38841%2021.9681C7.92312%2022.1063%208.46864%2021.7849%208.60685%2021.2502C8.77332%2020.6061%209.14905%2020.0357%209.675%2019.6284C10.201%2019.221%2010.8473%2019%2011.5125%2019H11.5127C12.1779%2019%2012.8242%2019.221%2013.3501%2019.6282C13.8761%2020.0355%2014.2519%2020.606%2014.4184%2021.25C14.5566%2021.7847%2015.1022%2022.1061%2015.6369%2021.9678C16.1716%2021.8296%2016.4929%2021.2841%2016.3547%2020.7493C16.0772%2019.6761%2015.451%2018.7255%2014.5746%2018.0469C14.489%2017.9806%2014.4015%2017.9173%2014.3123%2017.857ZM19%2013C18.4477%2013%2018%2013.4477%2018%2014C18%2014.5523%2018.4477%2015%2019%2015H24C24.5523%2015%2025%2014.5523%2025%2014C25%2013.4477%2024.5523%2013%2024%2013H19ZM19%2017C18.4477%2017%2018%2017.4477%2018%2018C18%2018.5523%2018.4477%2019%2019%2019H24C24.5523%2019%2025%2018.5523%2025%2018C25%2017.4477%2024.5523%2017%2024%2017H19Z'%20fill='white'/%3e%3c/svg%3e";
631
+ //#endregion
632
+ //#region src/modules/video-selfie/assets/steps/idBack.svg
633
+ var idBack_default = "data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5%205C3.89543%205%203%205.89543%203%207V25C3%2026.1046%203.89543%2027%205%2027H27C28.1046%2027%2029%2026.1046%2029%2025V7C29%205.89543%2028.1046%205%2027%205H5ZM5%207H27V25H5V7ZM7%2010H9V13H7V10ZM11%2010H15V13H11V10ZM25%2010H18V13H25V10ZM9.5%2010H10.5V13H9.5V10ZM17%2010H16V13H17V10ZM7%2021C7%2020.4477%207.44772%2020%208%2020H13C13.5523%2020%2014%2020.4477%2014%2021C14%2021.5523%2013.5523%2022%2013%2022H8C7.44772%2022%207%2021.5523%207%2021Z'%20fill='white'/%3e%3c/svg%3e";
634
+ //#endregion
635
+ //#region src/modules/video-selfie/assets/steps/document.svg
636
+ var document_default = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!--%20Created%20with%20Inkscape%20(http://www.inkscape.org/)%20--%3e%3csvg%20width='31.999998'%20height='31.999998'%20viewBox='0%200%208.4666652%208.4666652'%20version='1.1'%20id='svg1'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:svg='http://www.w3.org/2000/svg'%3e%3csodipodi:namedview%20id='namedview1'%20pagecolor='%23ffffff'%20bordercolor='%23000000'%20borderopacity='0.25'%20inkscape:showpageshadow='2'%20inkscape:pageopacity='0.0'%20inkscape:pagecheckerboard='0'%20inkscape:deskcolor='%23d1d1d1'%20inkscape:document-units='mm'%20inkscape:zoom='0.2102413'%20inkscape:cx='397.16269'%20inkscape:cy='561.25984'%20inkscape:window-width='3840'%20inkscape:window-height='2107'%20inkscape:window-x='0'%20inkscape:window-y='25'%20inkscape:window-maximized='1'%20inkscape:current-layer='layer1'%20/%3e%3cdefs%20id='defs1'%20/%3e%3cg%20inkscape:label='Layer%201'%20inkscape:groupmode='layer'%20id='layer1'%3e%3cpath%20style='fill:%23ffffff;fill-opacity:1;stroke-width:0.0503003'%20d='M%202.1371681,7.7074283%20C%201.9146058,7.6474895%201.7424188,7.4694912%201.6961309,7.2515073%201.6749942,7.1519719%201.6747939,1.4912877%201.6959298,1.3903826%201.7427446,1.1668083%201.9330318,0.97660662%202.1575996,0.92892102%20c%200.049768,-0.010567%200.4940888,-0.0149762%201.5096506,-0.0149762%201.406191,0%201.4403639,5.906e-4%201.4932344,0.026299%200.076817,0.037335%201.6624558,1.62568108%201.6905239,1.69340948%200.018191,0.043897%200.020505,0.3032023%200.020505,2.2984042%200,1.6155244%20-0.00422,2.2687877%20-0.014976,2.3194495%20-0.047686,0.2245679%20-0.2378872,0.414855%20-0.4614616,0.4616698%20-0.050013,0.010472%20-0.6693229,0.014514%20-2.129375,0.013893%20-1.7278226,-7.447e-4%20-2.0700522,-0.00389%20-2.128526,-0.01964%20z%20M%206.3661312,7.3018906%20c%200.033808,-0.017249%200.062074,-0.045514%200.079321,-0.079321%200.026526,-0.051994%200.026796,-0.074043%200.026796,-2.1824299%20V%202.9102343%20H%205.9427011%20c%20-0.5730301,0%20-0.6110751,-0.00377%20-0.7505148,-0.074433%20C%205.050964,2.764239%204.9246581,2.5961044%204.8901936,2.433797%204.8805433,2.3883481%204.8752173,2.1765201%204.8752173,1.8380492%20V%201.3128264%20l%20-1.3341865,0.00352%20-1.3341866,0.00352%20-0.041612,0.029682%20c%20-0.092355,0.065869%20-0.085371,-0.1898289%20-0.081583,2.9869071%20l%200.00341,2.8658%200.029521,0.041386%20c%200.064842,0.090902%20-0.1004627,0.084408%202.1569454,0.084742%202.0186586,3.082e-4%202.0406237,2.24e-5%202.0925975,-0.026493%20z%20M%202.9910365,6.5032965%20C%202.9285541,6.4723678%202.8789284,6.3958966%202.8789284,6.3305425%20c%200,-0.061244%200.048052,-0.1385801%200.1065228,-0.1714428%200.049611,-0.027883%200.059196,-0.028186%200.8916217,-0.028186%200.8404552,0%200.8415345,3.51e-5%200.8931899,0.029068%200.054483,0.030621%200.1049548,0.1126427%200.1049548,0.1705615%200,0.06345%20-0.051658,0.1432569%20-0.1114707,0.1722117%20-0.055334,0.026786%20-0.075744,0.027417%20-0.8875486,0.027407%20-0.8065441,-1e-5%20-0.8325034,-7.961e-4%20-0.8851618,-0.026864%20z%20m%200,-0.7985154%20C%202.9285541,5.6738526%202.8789284,5.5973809%202.8789284,5.5320268%20c%200,-0.061244%200.048052,-0.1385801%200.1065228,-0.1714426%200.050084,-0.028149%200.051789,-0.028186%201.2908795,-0.028186%20h%201.2407295%20l%200.051718,0.029067%20c%200.054483,0.030621%200.1049548,0.1126432%200.1049548,0.1705615%200,0.06345%20-0.051658,0.1432571%20-0.1114707,0.1722119%20-0.055935,0.027078%20-0.071861,0.027417%20-1.2868065,0.027407%20C%203.0684819,5.7316354%203.0442629,5.731132%202.9910365,5.7047811%20Z%20m%200,-0.7985155%20C%202.9285541,4.8753369%202.8789284,4.7988654%202.8789284,4.7335114%20c%200,-0.061244%200.048052,-0.1385802%200.1065228,-0.1714429%200.050084,-0.028149%200.051789,-0.028186%201.2908795,-0.028186%20h%201.2407295%20l%200.051718,0.029067%20c%200.054483,0.030621%200.1049548,0.1126432%200.1049548,0.1705618%200,0.06345%20-0.051658,0.1432571%20-0.1114707,0.1722116%20-0.055935,0.027078%20-0.071861,0.027417%20-1.2868065,0.027407%20-1.2069739,-10e-6%20-1.2311929,-5.136e-4%20-1.2844193,-0.026864%20z%20m%200,-0.7985157%20C%202.9285541,4.0768214%202.8789284,4.0003497%202.8789284,3.9349957%20c%200,-0.061244%200.048052,-0.1385802%200.1065228,-0.1714429%200.050084,-0.028149%200.051789,-0.028186%201.2908795,-0.028186%20h%201.2407295%20l%200.051718,0.029067%20c%200.054483,0.030621%200.1049548,0.1126432%200.1049548,0.1705616%200,0.06345%20-0.051658,0.1432571%20-0.1114707,0.1722119%20-0.055935,0.027078%20-0.071861,0.027417%20-1.2868065,0.027407%20C%203.0684822,4.1346039%203.0442632,4.1341006%202.9910365,4.1077499%20Z%20M%205.7335483,2.0583358%205.2811298,1.6056951%20l%20-0.00398,0.10329%20c%20-0.00218,0.05681%20-0.00218,0.2320508%200,0.3894249%200.00377,0.2708478%200.00556,0.2883457%200.033505,0.3275204%200.057864,0.081121%200.07711,0.084408%200.4960949,0.084743%20l%200.3792217,3.082e-4%20z'%20id='path39'%20/%3e%3c/g%3e%3c/svg%3e";
637
+ //#endregion
638
+ //#region src/modules/video-selfie/assets/steps/questions.svg
639
+ var questions_default = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20version='1.1'%20id='svg3'%20sodipodi:docname='questions.svg'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:svg='http://www.w3.org/2000/svg'%3e%3csodipodi:namedview%20id='namedview3'%20pagecolor='%23ffffff'%20bordercolor='%23000000'%20borderopacity='0.25'%20inkscape:showpageshadow='2'%20inkscape:pageopacity='0.0'%20inkscape:pagecheckerboard='0'%20inkscape:deskcolor='%23d1d1d1'%20/%3e%3cg%20clip-path='url(%23clip0_5487_3779)'%20id='g2'%3e%3cg%20clip-path='url(%23clip1_5487_3779)'%20id='g1'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M%207.52551,4.14935%20C%207.82033,4.33156%207.99978,4.65342%207.99978,5%20v%208%20c%200,0.5523%20-0.44771,1%20-1,1%20-0.55228,0%20-1,-0.4477%20-1,-1%20V%206.61804%20L%205.447,6.89443%20C%204.95302,7.14142%204.35235,6.94119%204.10536,6.44721%203.85837,5.95324%204.05859,5.35256%204.55257,5.10557%20l%202,-1%20C%206.86256,3.95058%207.2307,3.96714%207.52551,4.14935%20Z%20M%2011.9998,8%20c%200,-0.55228%200.4477,-1%201,-1%20h%2014%20c%200.5523,0%201,0.44772%201,1%200,0.55229%20-0.4477,1%20-1,1%20h%20-14%20c%20-0.5523,0%20-1,-0.44771%20-1,-1%20z%20m%200,8%20c%200,-0.5523%200.4477,-1%201,-1%20h%2014%20c%200.5523,0%201,0.4477%201,1%200,0.5523%20-0.4477,1%20-1,1%20h%20-14%20c%20-0.5523,0%20-1,-0.4477%20-1,-1%20z%20m%201,7%20c%20-0.5523,0%20-1,0.4477%20-1,1%200,0.5523%200.4477,1%201,1%20h%2014%20c%200.5523,0%201,-0.4477%201,-1%200,-0.5523%20-0.4477,-1%20-1,-1%20z%20M%209.56817,18.4581%20C%209.36149,18.1184%209.08854,17.8239%208.76561,17.592%208.11924,17.1216%207.31599,16.9193%206.52383,17.0275%205.73012,17.136%205.00928,17.5477%204.51265,18.1762%20h%20-2e-5%20l%20-0.00461,0.0059%20c%20-0.19037,0.2447%20-0.3414,0.5176%20-0.44766,0.8088%20-0.1893,0.5188%200.07784,1.0929%200.59667,1.2822%200.51883,0.1893%201.09288,-0.0778%201.28218,-0.5967%200.03455,-0.0947%200.08348,-0.1835%200.14507,-0.2633%200.17589,-0.221%200.43027,-0.3657%200.71024,-0.404%200.28122,-0.0384%200.56639,0.0336%200.79564,0.201%20h%20-2e-5%20l%200.00768,0.0055%20c%200.10538,0.0754%200.19442,0.1714%200.26177,0.2821%200.06736,0.1107%200.11164,0.2339%200.13018,0.3621%200.01854,0.1282%200.01096,0.2589%20-0.02228,0.3842%20-0.03325,0.1252%20-0.09147,0.2424%20-0.17117,0.3446%20l%20-0.01251,0.0164%20-3.585,4.7962%20c%20-0.2266,0.3032%20-0.26263,0.7083%20-0.09309,1.0467%200.16954,0.3383%200.51559,0.552%200.89406,0.552%20h%204%20c%200.55229,0%201,-0.4477%201,-1%200,-0.5523%20-0.44771,-1%20-1,-1%20H%206.99572%20l%202.3845,-3.1901%20C%209.62217,21.4972%209.79911,21.1392%209.90055,20.7571%2010.003,20.3712%2010.0263,19.9687%209.96919,19.5736%209.91207,19.1785%209.77566,18.7991%209.56817,18.4581%20Z'%20fill='%2320263D'%20id='path1'%20style='fill:%23ffffff;fill-opacity:1'%20/%3e%3c/g%3e%3c/g%3e%3cdefs%20id='defs3'%3e%3cclipPath%20id='clip0_5487_3779'%3e%3crect%20width='32'%20height='32'%20fill='%23ffffff'%20id='rect2'%20x='0'%20y='0'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_5487_3779'%3e%3crect%20width='32'%20height='32'%20fill='%23ffffff'%20id='rect3'%20x='0'%20y='0'%20/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
640
+ //#endregion
641
+ //#region src/modules/video-selfie/assets/steps/consent.svg
642
+ var consent_default = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20version='1.1'%20id='svg6'%20sodipodi:docname='consent.svg'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:svg='http://www.w3.org/2000/svg'%3e%3csodipodi:namedview%20id='namedview6'%20pagecolor='%23ffffff'%20bordercolor='%23000000'%20borderopacity='0.25'%20inkscape:showpageshadow='2'%20inkscape:pageopacity='0.0'%20inkscape:pagecheckerboard='0'%20inkscape:deskcolor='%23d1d1d1'%20/%3e%3cg%20clip-path='url(%23clip0_5487_4295)'%20id='g5'%3e%3cg%20clip-path='url(%23clip1_5487_4295)'%20id='g4'%3e%3cpath%20d='m%2016,17.5%20c%200.8284,0%201.5,-0.6716%201.5,-1.5%200,-0.8284%20-0.6716,-1.5%20-1.5,-1.5%20-0.8284,0%20-1.5,0.6716%20-1.5,1.5%200,0.8284%200.6716,1.5%201.5,1.5%20z'%20fill='%2320263D'%20id='path1'%20style='fill:%23ffffff;fill-opacity:1;stroke:%23ffffff;stroke-opacity:1'%20/%3e%3cpath%20d='M%2010.5,17.5%20C%2011.3284,17.5%2012,16.8284%2012,16%2012,15.1716%2011.3284,14.5%2010.5,14.5%209.67157,14.5%209,15.1716%209,16%20c%200,0.8284%200.67157,1.5%201.5,1.5%20z'%20fill='%2320263D'%20id='path2'%20style='fill:%23ffffff;fill-opacity:1;stroke:%23ffffff;stroke-opacity:1'%20/%3e%3cpath%20d='m%2021.5,17.5%20c%200.8284,0%201.5,-0.6716%201.5,-1.5%200,-0.8284%20-0.6716,-1.5%20-1.5,-1.5%20-0.8284,0%20-1.5,0.6716%20-1.5,1.5%200,0.8284%200.6716,1.5%201.5,1.5%20z'%20fill='%2320263D'%20id='path3'%20style='fill:%23ffffff;fill-opacity:1;stroke:%23ffffff;stroke-opacity:1'%20/%3e%3cpath%20d='m%209.99125,26.3889%20c%202.52065,1.4589%205.48585,1.9512%208.34275,1.3853%202.8569,-0.5659%205.4104,-2.1515%207.1846,-4.4611%201.7742,-2.3096%202.6478,-5.1856%202.4581,-8.0918%20C%2027.787,12.3151%2026.5469,9.57703%2024.4875,7.51766%2022.4281,5.45829%2019.6901,4.21814%2016.7839,4.02843%2013.8777,3.83872%2011.0017,4.71239%208.69205,6.48656%206.38244,8.26073%204.79686,10.8143%204.23094,13.6712%203.66502,16.5281%204.15739,19.4932%205.61625,22.0139%20L%204.0525,26.6827%20c%20-0.05876,0.1762%20-0.06729,0.3652%20-0.02463,0.546%200.04266,0.1808%200.13483,0.3461%200.26616,0.4774%200.13134,0.1314%200.29665,0.2235%200.47742,0.2662%200.18077,0.0426%200.36985,0.0341%200.54605,-0.0246%20z'%20stroke='%2320263D'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%20id='path4'%20style='stroke:%23ffffff;stroke-opacity:1'%20/%3e%3c/g%3e%3c/g%3e%3cdefs%20id='defs6'%3e%3cclipPath%20id='clip0_5487_4295'%3e%3crect%20width='32'%20height='32'%20fill='%23ffffff'%20id='rect5'%20x='0'%20y='0'%20/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_5487_4295'%3e%3crect%20width='32'%20height='32'%20fill='%23ffffff'%20id='rect6'%20x='0'%20y='0'%20/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
643
+ //#endregion
644
+ //#region src/modules/video-selfie/assets/steps/check.svg
645
+ var check_default = "data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.3337%2013.333L14.0003%2019.9997L10.667%2016.6663'%20stroke='white'%20stroke-width='2'%20stroke-linecap='square'/%3e%3c/svg%3e";
646
+ //#endregion
647
+ //#region src/modules/video-selfie/assets/steps/green-check.svg
648
+ var green_check_default = "data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.3334%2013.333L14.0001%2019.9997L10.6667%2016.6663'%20stroke='%230CD5A2'%20stroke-width='2'%20stroke-linecap='square'/%3e%3c/svg%3e";
649
+ //#endregion
650
+ //#region src/modules/video-selfie/stepsHeader.tsx
651
+ /** Maps each capture step to its header icon. */
652
+ var STEP_ICONS = {
653
+ selfie: selfie_default,
654
+ frontId: idFront_default,
655
+ backId: idBack_default,
656
+ poa: document_default,
657
+ questions: questions_default,
658
+ speech: consent_default
659
+ };
660
+ /**
661
+ * Port of V1's `StepsHeader`: a full-width segmented progress bar fixed to the
662
+ * top of the capture screen, overlaid transparently on the live camera. Each
663
+ * step is a segment with a thin white progress line and an icon — the current
664
+ * step shows its module icon, completed steps show a check. When every step is
665
+ * done the lines turn green.
666
+ */
667
+ var StepsHeader = ({ steps, currentIndex }) => {
668
+ const { t } = useTranslation();
669
+ const isFinished = currentIndex >= steps.length;
670
+ return /* @__PURE__ */ u("ol", {
671
+ class: cn("IncodeVsStepsHeader", isFinished && "IncodeVsStepsHeaderFinished"),
672
+ "aria-label": t("videoSelfie.progressSteps", { defaultValue: "Progress steps" }),
673
+ children: steps.map((step, index) => {
674
+ const isCurrent = index === currentIndex && !isFinished;
675
+ const isActive = index <= currentIndex && !isFinished;
676
+ const isCompleted = index < currentIndex && !isFinished;
677
+ const label = t(`videoSelfie.step.${step}`);
678
+ return /* @__PURE__ */ u("li", {
679
+ class: cn("IncodeVsStepsHeaderStep", isActive && "IncodeVsStepsHeaderStepActive", isCurrent && "IncodeVsStepsHeaderStepCurrent"),
680
+ "aria-current": isCurrent ? "step" : void 0,
681
+ children: isFinished ? /* @__PURE__ */ u("img", {
682
+ src: green_check_default,
683
+ alt: label
684
+ }) : isCompleted ? /* @__PURE__ */ u("img", {
685
+ src: check_default,
686
+ alt: label
687
+ }) : isCurrent ? /* @__PURE__ */ u("img", {
688
+ src: STEP_ICONS[step],
689
+ alt: label
690
+ }) : null
691
+ }, step);
692
+ })
693
+ });
694
+ };
695
+ //#endregion
696
+ //#region src/modules/video-selfie/video-selfie.tsx
697
+ /**
698
+ * How long the "show the front / back" ID instruction stays pinned on screen
699
+ * when an ID step begins, before live detection feedback (blur / move closer)
700
+ * is allowed to replace it. Gives users time to actually read the guidance.
701
+ */
702
+ var ID_INSTRUCTION_DWELL_MS = 3e3;
703
+ /** Maps the recording status + live detection feedback to a border state. */
704
+ var getBorderState = (state) => {
705
+ if (state.status === "starting" || state.status === "switchingCamera") return "loading";
706
+ switch (state.detectionStatus) {
707
+ case "success": return "success";
708
+ case "error": return "error";
709
+ case "getReady":
710
+ case "detecting":
711
+ case "capturing": return "loading";
712
+ default: return "idle";
713
+ }
714
+ };
715
+ var VideoSelfieContent = ({ config, onFinish, onError }) => {
716
+ const { t } = useTranslation();
717
+ const cameraWarmer = T(() => config ? createVideoSelfieCameraWarmer(config) : null, [config]);
718
+ const [state, manager] = useManager(() => createVideoSelfieRecordingManager({
719
+ config,
720
+ dependencies: cameraWarmer ? { acquireCamera: cameraWarmer.acquireCamera } : void 0
721
+ }), { autoLoad: false });
722
+ const [phase, setPhase] = d(config?.showTutorials ? "tutorial" : "permissions");
723
+ const { permissionStatus, manager: permissionsManager } = useVideoSelfiePermissions({
724
+ enabled: phase === "permissions",
725
+ onGranted: () => setPhase("capture"),
726
+ onClose: () => onError?.(void 0)
727
+ });
728
+ y(() => {
729
+ if ((phase === "tutorial" || phase === "permissions") && config) {
730
+ warmupVideoSelfieWasm(config);
731
+ cameraWarmer?.warm();
732
+ }
733
+ }, [
734
+ phase,
735
+ config,
736
+ cameraWarmer
737
+ ]);
738
+ y(() => () => cameraWarmer?.dispose(), [cameraWarmer]);
739
+ y(() => {
740
+ if (phase !== "capture") return;
741
+ manager.start();
742
+ }, [manager, phase]);
743
+ useModuleTerminalCallbacks({
744
+ status: state.status,
745
+ onFinish,
746
+ onError,
747
+ error: state.status === "error" ? state.error : void 0,
748
+ errorStatuses: ["error"]
749
+ });
750
+ const steps = T(() => config ? resolveVideoSelfieSteps(config) : [], [config]);
751
+ const step = state.step ?? "selfie";
752
+ const isIdStep = step === "frontId" || step === "backId";
753
+ const [idInstructionPinned, setIdInstructionPinned] = d(false);
754
+ y(() => {
755
+ if (!isIdStep) {
756
+ setIdInstructionPinned(false);
757
+ return;
758
+ }
759
+ setIdInstructionPinned(true);
760
+ }, [step, isIdStep]);
761
+ useTimeout(q(() => setIdInstructionPinned(false), []), isIdStep ? ID_INSTRUCTION_DWELL_MS : null);
762
+ if (phase === "tutorial" && config) return /* @__PURE__ */ u(VideoSelfieTutorial, {
763
+ config,
764
+ onStart: () => setPhase("permissions")
765
+ });
766
+ if (phase === "permissions") return /* @__PURE__ */ u(Permissions, {
767
+ manager: permissionsManager,
768
+ permissionStatus
769
+ });
770
+ if (state.status === "finished" || state.status === "error" || state.status === "aborted") return null;
771
+ if (state.status === "finalizing") return /* @__PURE__ */ u(TransitionSpinner, {});
772
+ const isFrontCamera = facingModeForStep(step) === "user";
773
+ const borderState = getBorderState(state);
774
+ const detectionStatus = state.detectionStatus;
775
+ const idMode = step === "backId" ? "back" : "front";
776
+ const stepLabel = t(`videoSelfie.step.${step}`);
777
+ const maskMessage = () => {
778
+ if (detectionStatus === "success") return t("videoSelfie.allGood");
779
+ if (detectionStatus === "capturing") return t("common.processing");
780
+ if (detectionStatus === "error") return t("common.tryAgain");
781
+ if (isFrontCamera) switch (detectionStatus) {
782
+ case "tooFar": return t("notifications.moveCloser");
783
+ case "tooClose": return t("notifications.moveAway");
784
+ case "blur": return t("notifications.onBlur");
785
+ case "faceMask": return t("notifications.mask");
786
+ case "lenses": return t("notifications.removeLenses");
787
+ case "eyesClosed": return t("notifications.eyesClosed");
788
+ case "headWear": return t("notifications.removeHeadwear");
789
+ default: return t("videoSelfie.lookCamera");
790
+ }
791
+ if (idInstructionPinned) return idMode === "back" ? t("videoSelfie.showBack") : t("videoSelfie.showFront");
792
+ switch (detectionStatus) {
793
+ case "blur": return t("notifications.onBlur");
794
+ case "tooFar": return t("notifications.moveCloser");
795
+ default: return idMode === "back" ? t("videoSelfie.showBack") : t("videoSelfie.showFront");
796
+ }
797
+ };
798
+ const renderStepUi = () => {
799
+ if (step === "poa") return /* @__PURE__ */ u(PoaMask, { onContinue: () => manager.nextStep() });
800
+ if (step === "questions") return /* @__PURE__ */ u(QuestionsMask, {
801
+ count: config?.voiceConsentQuestions ?? 0,
802
+ onDone: () => manager.nextStep()
803
+ });
804
+ if (step === "speech") return /* @__PURE__ */ u(SpeechMask, {
805
+ composite: state.composite,
806
+ speechToTextCheck: config?.speechToTextCheck ?? true,
807
+ numberOfTries: config?.numberOfTries ?? 3,
808
+ onDone: () => manager.nextStep()
809
+ });
810
+ return isFrontCamera ? /* @__PURE__ */ u(SelfieMask, {
811
+ borderState,
812
+ message: maskMessage()
813
+ }) : /* @__PURE__ */ u(IdMask, {
814
+ borderState,
815
+ mode: idMode,
816
+ message: maskMessage(),
817
+ capturing: detectionStatus === "capturing"
818
+ });
819
+ };
820
+ return /* @__PURE__ */ u(Page, {
821
+ hideHeader: true,
822
+ hideFooterBranding: true,
823
+ className: "IncodeVideoSelfieCapturePage",
824
+ children: [/* @__PURE__ */ u(Title, {
825
+ className: "IncodeCaptureVisuallyHidden",
826
+ children: stepLabel
827
+ }), /* @__PURE__ */ u(CameraView, {
828
+ stream: state.composite ?? state.stream,
829
+ children: /* @__PURE__ */ u("div", {
830
+ class: "IncodeVideoSelfieOverlay",
831
+ children: [/* @__PURE__ */ u(StepsHeader, {
832
+ steps,
833
+ currentIndex: state.stepIndex
834
+ }), renderStepUi()]
835
+ })
836
+ })]
837
+ });
838
+ };
839
+ /**
840
+ * Video Selfie UI component. Records + streams a multi-step, camera-switching
841
+ * session and renders a live preview with per-step auto-capture guidance.
842
+ *
843
+ * @see {@link createVideoSelfieRecordingManager} for headless usage.
844
+ */
845
+ var VideoSelfie = ({ config, onFinish, onError }) => {
846
+ return /* @__PURE__ */ u(IncodeComponent, { children: /* @__PURE__ */ u(VideoSelfieContent, {
847
+ config,
848
+ onFinish,
849
+ onError
850
+ }) });
851
+ };
852
+ registerIncodeModuleElement(VideoSelfie, "incode-video-selfie");
853
+ //#endregion
854
+ export { VideoSelfie };