@incodetech/core 2.4.1 → 2.5.0-agentic

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 (338) hide show
  1. package/dist/Actor-DqjOqDfU.d.ts +1 -0
  2. package/dist/{BaseWasmProvider-Bq3OHo7P.d.ts → BaseWasmProvider-CPdofn7R.d.ts} +3 -5
  3. package/dist/BrowserNetworkStatusProvider-BrDXBEDd.esm.js +21 -0
  4. package/dist/{multipartRecordingService-CLwrF5wD.esm.js → CameraCompositor-C7N1N61V.esm.js} +61 -744
  5. package/dist/DateFormattingProvider-DPq9zco-.esm.js +25 -0
  6. package/dist/{FaceDetectionProvider-J_-1Cwck.esm.js → FaceDetectionProvider-Dv9iXub0.esm.js} +38 -66
  7. package/dist/IBrowserEnvironmentCapability-D7JG7ML3.esm.js +16 -0
  8. package/dist/IGeolocationCapability-r49Qo7rR.d.ts +10 -0
  9. package/dist/{IIdCaptureCapability-CGcEt2Cw.d.ts → IIdCaptureCapability-CAxToGns.d.ts} +3 -3
  10. package/dist/{IWasmUtilCapability-GF2n7sfm.d.ts → IWasmUtilCapability-CLWIYHB4.d.ts} +35 -7
  11. package/dist/Manager-BvXAwDv9.esm.js +125 -0
  12. package/dist/{Manager-C9T5amUN.d.ts → Manager-DufwKlav.d.ts} +1 -7
  13. package/dist/{MotionSensorProvider-DYxh8TjR.esm.js → MotionSensorProvider-X4_2eBGd.esm.js} +15 -0
  14. package/dist/MultipartRecordingProvider-BtMQZEbg.esm.js +151 -0
  15. package/dist/{PhoneValidationProvider-SZiOS0jB.esm.js → PhoneValidationProvider-Co4zk2en.esm.js} +7 -0
  16. package/dist/{StreamCanvasCapture-7JRf-2ck.d.ts → StreamCanvasCapture-BqaHTJF0.d.ts} +36 -5
  17. package/dist/{StreamCanvasCapture-C9jtgBdT.esm.js → StreamCanvasCapture-CXd87trH.esm.js} +18 -3
  18. package/dist/StreamCanvasProcessingSession-CBnbTnOr.esm.js +42 -0
  19. package/dist/{WasmUtilProvider-DtJuBdt-.esm.js → WasmUtilProvider-DVFDFlIL.esm.js} +135 -25
  20. package/dist/WorkerEncoderRecordingProvider-BO7urYwT.esm.js +80 -0
  21. package/dist/addressSearch-BKlynuBr.esm.js +71 -0
  22. package/dist/{advanceableErrors-q_pfU3Cn.esm.js → advanceableErrors-CxZyPRyh.esm.js} +4 -2
  23. package/dist/ae-signature.d.ts +2 -2
  24. package/dist/ae-signature.esm.js +1 -1
  25. package/dist/antifraud.d.ts +1 -1
  26. package/dist/antifraud.esm.js +2 -2
  27. package/dist/{antifraudManager-CaweCYnY.esm.js → antifraudManager-BI2zr7YX.esm.js} +5 -3
  28. package/dist/{antifraudManager-DbGCvlJs.d.ts → antifraudManager-BxfCsyA7.d.ts} +3 -3
  29. package/dist/{antifraudStateMachine-DRl0UVyA.esm.js → antifraudStateMachine-TWUu8wLN.esm.js} +4 -6
  30. package/dist/{api-Cz90EHyu.esm.js → api-BNxrW8xK.esm.js} +13 -6
  31. package/dist/{apiError-9Yi8xMeB.esm.js → apiError-BAfdBGxH.esm.js} +1 -1
  32. package/dist/attemptCarry-DWM8lV9V.esm.js +45 -0
  33. package/dist/authentication.d.ts +3 -3
  34. package/dist/authentication.esm.js +2 -2
  35. package/dist/{authenticationManager-BIZC55Bi.d.ts → authenticationManager-BJElkTsj.d.ts} +2 -2
  36. package/dist/{authenticationManager-pKQS4fHT.esm.js → authenticationManager-DFzByAYo.esm.js} +7 -6
  37. package/dist/{authenticationStateMachine-D_DygKtQ.esm.js → authenticationStateMachine-CKTOhwwc.esm.js} +50 -18
  38. package/dist/avatar.d.ts +1 -1
  39. package/dist/backCameraLabel-yda5ugE4.esm.js +67 -0
  40. package/dist/{backCameraStream-CMvXj4X4.esm.js → backCameraStream-6qVHvj76.esm.js} +12 -107
  41. package/dist/{browser-DlFgHpoC-DnyrCR8r.esm.js → browser-pQZA35G2-CG3C-xGt.esm.js} +161 -150
  42. package/dist/calendarDate-DcqGuEht.esm.js +35 -0
  43. package/dist/{callback-645_omgz.d.ts → callback-BmjJ1G-5.d.ts} +1 -1
  44. package/dist/camera-9yYDUOsO.d.ts +5 -0
  45. package/dist/{camera-sIa9ceW2.esm.js → camera-CJKApt0x.esm.js} +19 -20
  46. package/dist/camera.d.ts +9 -5
  47. package/dist/camera.esm.js +1 -1
  48. package/dist/certificate-issuance.d.ts +1 -1
  49. package/dist/certificate-issuance.esm.js +2 -2
  50. package/dist/{certificateIssuanceManager-Dr8A4Lgr.d.ts → certificateIssuanceManager-BcYhxO63.d.ts} +4 -3
  51. package/dist/{certificateIssuanceManager-BfeMv2PU.esm.js → certificateIssuanceManager-P44yBRop.esm.js} +5 -3
  52. package/dist/{certificateIssuanceStateMachine-Frgjbjw8.esm.js → certificateIssuanceStateMachine-BPBrILt6.esm.js} +4 -4
  53. package/dist/cnpj-Bl_olpdX.esm.js +79 -0
  54. package/dist/connectivity-BCuEoQ-n.esm.js +114 -0
  55. package/dist/consent.d.ts +1 -1
  56. package/dist/consent.esm.js +2 -2
  57. package/dist/{consentManager-CvEu8h_W.esm.js → consentManager-D43w2ms-.esm.js} +7 -4
  58. package/dist/{consentManager-Ca8FHlC4.d.ts → consentManager-Duzd8paN.d.ts} +17 -9
  59. package/dist/{consentStateMachine-DJTgN_-1.esm.js → consentStateMachine-CLK8PfM4.esm.js} +25 -15
  60. package/dist/cpf-DDXMTLYr.esm.js +37 -0
  61. package/dist/{createFaceAvatar-lYX0VTYs.d.ts → createFaceAvatar-Ct9QrQ66.d.ts} +1 -1
  62. package/dist/cross-document-data-match.d.ts +1 -1
  63. package/dist/cross-document-data-match.esm.js +1 -1
  64. package/dist/{crossDocumentDataMatchManager-Cu141CE8.esm.js → crossDocumentDataMatchManager-Cag_bcyW.esm.js} +6 -5
  65. package/dist/{crossDocumentDataMatchManager-yCWCOzcU.d.ts → crossDocumentDataMatchManager-crZcIUSY.d.ts} +3 -3
  66. package/dist/curp-DZGvefg3.esm.js +14 -0
  67. package/dist/curp-validation.d.ts +1 -1
  68. package/dist/curp-validation.esm.js +2 -2
  69. package/dist/{curpValidationManager-B-z9q5V3.esm.js → curpValidationManager-C6WmQToS.esm.js} +6 -3
  70. package/dist/{curpValidationManager-C9sqoh9n.d.ts → curpValidationManager-CmL52FU8.d.ts} +4 -4
  71. package/dist/{curpValidationStateMachine-vDEFLMPw.esm.js → curpValidationStateMachine-BbJ4YAzE.esm.js} +41 -34
  72. package/dist/custom-fields.d.ts +1 -1
  73. package/dist/custom-fields.esm.js +1 -1
  74. package/dist/custom-watchlist.d.ts +1 -1
  75. package/dist/custom-watchlist.esm.js +2 -2
  76. package/dist/{customFieldsManager-D1ex2cFM.esm.js → customFieldsManager-BBy6X9nh.esm.js} +15 -17
  77. package/dist/{customFieldsManager-CF-cO8ap.d.ts → customFieldsManager-CdWTbsew.d.ts} +3 -3
  78. package/dist/{customWatchlistManager-CTI-SGk0.esm.js → customWatchlistManager-CtBMy2EF.esm.js} +5 -3
  79. package/dist/{customWatchlistManager-DolUswyR.d.ts → customWatchlistManager-lJrveDS4.d.ts} +3 -3
  80. package/dist/{customWatchlistStateMachine-hmRd0f2I.esm.js → customWatchlistStateMachine-SS2ssNCg.esm.js} +4 -6
  81. package/dist/deepsightCaptureConfig-Nm_K8twx.esm.js +70 -0
  82. package/dist/{deepsightService-C3DVBOZd.esm.js → deepsightLoader-BInnND1H.esm.js} +41 -74
  83. package/dist/definitionSource-B-Z2EgJJ.esm.js +234 -0
  84. package/dist/{createCameraCycleOwnership-Dj_LHUvN.esm.js → desktopCameraElection-JNBOXqvK.esm.js} +278 -44
  85. package/dist/device.d.ts +3 -3
  86. package/dist/device.esm.js +16 -16
  87. package/dist/document-capture.d.ts +3 -3
  88. package/dist/document-capture.esm.js +2 -2
  89. package/dist/document-signature.d.ts +123 -0
  90. package/dist/document-signature.esm.js +149 -0
  91. package/dist/{documentCaptureManager-DUJwpKC5.esm.js → documentCaptureManager-CGDtkfWj.esm.js} +30 -20
  92. package/dist/{documentCaptureManager-DkyDtm3Y.d.ts → documentCaptureManager-sJWgqtUy.d.ts} +42 -8
  93. package/dist/{documentCaptureStateMachine-B8i7GnLh.esm.js → documentCaptureStateMachine-flAt9D4q.esm.js} +110 -63
  94. package/dist/documentSignatureStateMachine-DrRyICFT.esm.js +219 -0
  95. package/dist/dynamic-forms.d.ts +2 -2
  96. package/dist/dynamic-forms.esm.js +2 -2
  97. package/dist/{dynamicFormsManager-C0dHs1ty.d.ts → dynamicFormsManager-C45pTncO.d.ts} +4 -4
  98. package/dist/{dynamicFormsManager-DK_oc5Oy.esm.js → dynamicFormsManager-CxLq2KzT.esm.js} +5 -3
  99. package/dist/{dynamicFormsStateMachine-CGlIAWZ6.esm.js → dynamicFormsStateMachine-By-maT_4.esm.js} +12 -13
  100. package/dist/ekyb.d.ts +5 -5
  101. package/dist/ekyb.esm.js +3 -3
  102. package/dist/{ekybManager-BaZ_7CEu.d.ts → ekybManager-BflWuTe4.d.ts} +5 -5
  103. package/dist/{ekybManager-BLgkiWXw.esm.js → ekybManager-CE19Pcdb.esm.js} +5 -3
  104. package/dist/{ekybStateMachine-BfgOUZMK.esm.js → ekybStateMachine-q7JQ-x9l.esm.js} +1233 -124
  105. package/dist/ekybUtils-Z9MhFAer.esm.js +150 -0
  106. package/dist/ekyc-prefill.d.ts +17 -0
  107. package/dist/ekyc-prefill.esm.js +3 -0
  108. package/dist/ekyc.d.ts +4 -3
  109. package/dist/ekyc.esm.js +3 -3
  110. package/dist/{ekycManager-DW-ynodd.d.ts → ekycManager-BKVQazAb.d.ts} +49 -7
  111. package/dist/{ekycManager-BO-Lui3t.esm.js → ekycManager-p3uenUEi.esm.js} +39 -16
  112. package/dist/ekycPrefillManager-BcLhkpp8.d.ts +566 -0
  113. package/dist/ekycPrefillManager-gPX3XE7u.esm.js +103 -0
  114. package/dist/ekycPrefillStateMachine-SBnBKPGA.esm.js +685 -0
  115. package/dist/ekycRules-BH_Ll_0A.esm.js +482 -0
  116. package/dist/ekycStateMachine-D0NAHzS7.esm.js +8514 -0
  117. package/dist/ekycUtils-DEvtEyBI.esm.js +1501 -0
  118. package/dist/electronic-signature.d.ts +1 -1
  119. package/dist/electronic-signature.esm.js +1 -1
  120. package/dist/{electronicSignatureManager-DTSLOvKR.d.ts → electronicSignatureManager-5tYz-a4o.d.ts} +4 -3
  121. package/dist/{electronicSignatureManager-CjKvJ6E-.esm.js → electronicSignatureManager-C1M-Yxf2.esm.js} +12 -18
  122. package/dist/email.d.ts +1 -1
  123. package/dist/email.esm.js +2 -2
  124. package/dist/{emailManager-ButFktRm.esm.js → emailManager-DWnhEsUf.esm.js} +5 -3
  125. package/dist/{emailManager-Dy6omJVp.d.ts → emailManager-pM7ZPuMa.d.ts} +3 -3
  126. package/dist/{emailStateMachine-BXtlC0NV.esm.js → emailStateMachine--T9PHflK.esm.js} +35 -25
  127. package/dist/events-ChMS-UzR.esm.js +299 -0
  128. package/dist/events.d.ts +4 -1
  129. package/dist/events.esm.js +2 -1
  130. package/dist/extensibility.d.ts +57 -41
  131. package/dist/extensibility.esm.js +39 -37
  132. package/dist/{externalFetch-DrR9xshk.esm.js → externalFetch-cUjJYyXj.esm.js} +4 -1
  133. package/dist/face-match.d.ts +1 -1
  134. package/dist/face-match.esm.js +2 -2
  135. package/dist/{faceCaptureManagerFactory-BDGhg24q.esm.js → faceCaptureManagerFactory-18QW0lmV.esm.js} +29 -12
  136. package/dist/{faceCaptureManagerFactory-1hzeS_rB.d.ts → faceCaptureManagerFactory-CHqmyOjM.d.ts} +101 -77
  137. package/dist/{faceCaptureSetup-CvGYG4GZ.esm.js → faceCaptureSetup-CFToXwHy.esm.js} +181 -513
  138. package/dist/{faceMatchManager-DIgG-UFS.d.ts → faceMatchManager-C5b5WtcY.d.ts} +23 -7
  139. package/dist/{faceMatchManager-DWFUQjMQ.esm.js → faceMatchManager-DIStK4qi.esm.js} +5 -3
  140. package/dist/{faceMatchStateMachine-CUCvlydD.esm.js → faceMatchStateMachine-DagrRdo2.esm.js} +70 -42
  141. package/dist/{feature-management-D4ne_hXW.esm.js → feature-management-BlscKbeV.esm.js} +37 -22
  142. package/dist/feature-management.esm.js +1 -1
  143. package/dist/field-comparison.d.ts +1 -1
  144. package/dist/field-comparison.esm.js +1 -1
  145. package/dist/{fieldComparisonManager-v3knTYV_.esm.js → fieldComparisonManager-BnWBtMN7.esm.js} +7 -7
  146. package/dist/{fieldComparisonManager-CUX4gza2.d.ts → fieldComparisonManager-mFOHRhVd.d.ts} +3 -3
  147. package/dist/fiscal-qr.d.ts +1 -1
  148. package/dist/fiscal-qr.esm.js +1 -1
  149. package/dist/{fiscalQrManager-Dt9fHG7h.esm.js → fiscalQrManager-BxXaLhin.esm.js} +9 -8
  150. package/dist/{fiscalQrManager-D0Iy7EKR.d.ts → fiscalQrManager-DFnFVpP9.d.ts} +3 -3
  151. package/dist/flow-events.d.ts +1 -1
  152. package/dist/flow.d.ts +73 -24
  153. package/dist/flow.esm.js +261 -66
  154. package/dist/{flowCompletionService-Cemwaa5b.esm.js → flowCompletionService-DNLssMAg.esm.js} +2 -2
  155. package/dist/flowServices-Bzq3piUR.esm.js +951 -0
  156. package/dist/geolocation.d.ts +1 -1
  157. package/dist/geolocation.esm.js +2 -2
  158. package/dist/{geolocationManager-Dn24g1fl.d.ts → geolocationManager-CENrvxpK.d.ts} +19 -20
  159. package/dist/{geolocationManager-B0dc5rW9.esm.js → geolocationManager-DoLbpx5e.esm.js} +9 -9
  160. package/dist/{geolocationStateMachine-B3rcoODF.esm.js → geolocationStateMachine-d5_E7gAm.esm.js} +16 -14
  161. package/dist/{getDeviceClass-bsWdEDxP.esm.js → getDeviceClass-Dcy9erbl.esm.js} +1 -1
  162. package/dist/government-validation.d.ts +1 -1
  163. package/dist/government-validation.esm.js +2 -2
  164. package/dist/{governmentValidationManager-BtXWHICu.esm.js → governmentValidationManager-CaZxyEOO.esm.js} +5 -3
  165. package/dist/{governmentValidationManager-B82zOut8.d.ts → governmentValidationManager-De_vU7bm.d.ts} +4 -4
  166. package/dist/{governmentValidationStateMachine-COL-Vs48.esm.js → governmentValidationStateMachine-DeHHhlcf.esm.js} +4 -6
  167. package/dist/home.d.ts +4 -3
  168. package/dist/home.esm.js +4 -2
  169. package/dist/http.esm.js +1 -1
  170. package/dist/id-ocr.d.ts +2 -2
  171. package/dist/id-ocr.esm.js +3 -19
  172. package/dist/id-selfie-flow.d.ts +7 -6
  173. package/dist/id-selfie-flow.esm.js +14 -12
  174. package/dist/id-verification.d.ts +1 -1
  175. package/dist/id-verification.esm.js +2 -2
  176. package/dist/id.d.ts +6 -19
  177. package/dist/id.esm.js +4 -4
  178. package/dist/{idCaptureDefaults-BGsG2OAs.esm.js → idCaptureDefaults-R3rHuTOE.esm.js} +4 -4
  179. package/dist/{idCaptureManager-0M02hSuC.d.ts → idCaptureManager-CgkQW3Xc.d.ts} +88 -14
  180. package/dist/{idCaptureManager-IouAnrFm.esm.js → idCaptureManager-D_YGMeCW.esm.js} +81 -26
  181. package/dist/{idCaptureServices-VTKIPSpT.esm.js → idCaptureServices-CP6AxsFW.esm.js} +36 -213
  182. package/dist/{idCaptureStateMachine-_Pn2Xkpb.esm.js → idCaptureStateMachine-BdBtGQZP.esm.js} +2922 -2498
  183. package/dist/idOcrCpfUtils-D5Gwskxu.esm.js +18 -0
  184. package/dist/{idOcrManager-DT3kPIB3.d.ts → idOcrManager-C0C7lFGd.d.ts} +7 -6
  185. package/dist/{idOcrManager-D3-HNMXP.esm.js → idOcrManager-XTbpfHoF.esm.js} +5 -3
  186. package/dist/{idOcrStateMachine-DyENX6Ki.esm.js → idOcrStateMachine-B-00PgPh.esm.js} +20 -16
  187. package/dist/{idVerificationManager-iWz7Avkr.esm.js → idVerificationManager-B4NYLlUl.esm.js} +5 -3
  188. package/dist/{idVerificationManager-BJapZfpy.d.ts → idVerificationManager-B6R8xNZq.d.ts} +4 -3
  189. package/dist/{idVerificationStateMachine-CL1kUdBe.esm.js → idVerificationStateMachine-B48Ikl-7.esm.js} +4 -6
  190. package/dist/identity-reuse.d.ts +2 -2
  191. package/dist/identity-reuse.esm.js +2 -2
  192. package/dist/identity-search.d.ts +97 -0
  193. package/dist/identity-search.esm.js +96 -0
  194. package/dist/{identityReuseManager-ooAbp6Kc.d.ts → identityReuseManager-CZ-qJ_Aa.d.ts} +82 -15
  195. package/dist/{identityReuseManager-CD1ucp1d.esm.js → identityReuseManager-tFeYm_So.esm.js} +9 -4
  196. package/dist/{identityReuseStateMachine-DfV81wQC.esm.js → identityReuseStateMachine-Ckf39qFu.esm.js} +24 -31
  197. package/dist/{index-BKOWUhxG.d.ts → index-CNck5TLp.d.ts} +93 -22
  198. package/dist/{index-CKQ9QBZP.d.ts → index-CoePktWH.d.ts} +2 -2
  199. package/dist/index-DHuAkTe0.d.ts +1 -0
  200. package/dist/index.d.ts +1 -1
  201. package/dist/index.esm.js +1 -1
  202. package/dist/{invokeOnCaptureCallback-DYrkOXO6.esm.js → invokeOnCaptureCallback-DNQX9k5e.esm.js} +1 -1
  203. package/dist/kyb-checks.d.ts +3 -0
  204. package/dist/kyb-checks.esm.js +3 -0
  205. package/dist/kybChecksManager-B7Di9auB.d.ts +95 -0
  206. package/dist/kybChecksManager-DP76y-Qz.esm.js +90 -0
  207. package/dist/kybChecksStateMachine-OKLT8Zoc.esm.js +716 -0
  208. package/dist/mandatory-consent.d.ts +2 -2
  209. package/dist/mandatory-consent.esm.js +2 -2
  210. package/dist/{mandatoryConsentManager-Cwqx1nK7.esm.js → mandatoryConsentManager-NX1lz6nk.esm.js} +7 -4
  211. package/dist/{mandatoryConsentManager-qYojnZYg.d.ts → mandatoryConsentManager-kzr5kdc_.d.ts} +28 -11
  212. package/dist/{mandatoryConsentStateMachine-pXWqAHo_.esm.js → mandatoryConsentStateMachine-D1J2NQSI.esm.js} +35 -19
  213. package/dist/mediaRecorderOptions-Di_V9TnZ.esm.js +87 -0
  214. package/dist/multipartRecordingService-Cz-cWrpV.esm.js +407 -0
  215. package/dist/{permissionGuards-gcy3U0SL.esm.js → permissionGuards-Cyh71hOt.esm.js} +1 -1
  216. package/dist/{permissionServices-Ca-tSNhT.esm.js → permissionServices-BrtDMB0Z.esm.js} +31 -15
  217. package/dist/phone-number.d.ts +7 -1
  218. package/dist/phone-number.esm.js +15 -2
  219. package/dist/phone.d.ts +1 -1
  220. package/dist/phone.esm.js +2 -2
  221. package/dist/phoneFormat-C3q0Ukh4.esm.js +27 -0
  222. package/dist/{phoneManager-KKUq-Vgo.esm.js → phoneManager-D1QPNbu0.esm.js} +6 -4
  223. package/dist/{phoneManager-BO-LTih5.d.ts → phoneManager-VO1HEoUZ.d.ts} +8 -3
  224. package/dist/phoneServices-DC7AuUed.esm.js +73 -0
  225. package/dist/{phoneStateMachine-D2QWS2cu.esm.js → phoneStateMachine-CxCPxTIy.esm.js} +56 -84
  226. package/dist/{phoneValidation-DnBcNUNh.esm.js → phoneValidation-OggtfjRt.esm.js} +1 -2
  227. package/dist/{platform-DkcRc9JV.esm.js → platform-GIg4uPWe.esm.js} +15 -4
  228. package/dist/processFaceMatch-BQoiqLVh.esm.js +21 -0
  229. package/dist/qe-signature.d.ts +2 -2
  230. package/dist/qe-signature.esm.js +1 -1
  231. package/dist/recordingService-CSCvD2tB.esm.js +404 -0
  232. package/dist/redirect-to-mobile.d.ts +2 -2
  233. package/dist/redirect-to-mobile.esm.js +2 -2
  234. package/dist/{redirectToMobileManager-CVsvpVbQ.d.ts → redirectToMobileManager-Db99n9Yu.d.ts} +7 -4
  235. package/dist/{redirectToMobileManager-uHW3dyuQ.esm.js → redirectToMobileManager-Dcpg5GfP.esm.js} +10 -6
  236. package/dist/{redirectToMobileStateMachine-b-H-ipGM.esm.js → redirectToMobileStateMachine-BMehrtVP.esm.js} +82 -46
  237. package/dist/resolveForm-DaaQSVWp.esm.js +146 -0
  238. package/dist/{runChildModule-DSpP41Hl.esm.js → runChildModule-DNEmc7of.esm.js} +9 -7
  239. package/dist/{sdkVersion-DKHwWEyH.esm.js → sdkVersion-etdZfyCR.esm.js} +1 -1
  240. package/dist/selfie.d.ts +6 -6
  241. package/dist/selfie.esm.js +15 -13
  242. package/dist/{selfieErrorUtils-DoN1KFSQ.esm.js → selfieErrorUtils-DT-uhK20.esm.js} +1 -1
  243. package/dist/{selfieManager-DtQegA6T.esm.js → selfieManager-CdS6a7Q8.esm.js} +7 -6
  244. package/dist/{selfieManager-BJdNu_nd.d.ts → selfieManager-DrBYj5kA.d.ts} +2 -2
  245. package/dist/{selfieStateMachine-CnCwJZuC.esm.js → selfieStateMachine-ChCl3nyf.esm.js} +5 -5
  246. package/dist/{session-CNUfjlRc.esm.js → session-VXYuRYzb.esm.js} +78 -9
  247. package/dist/session.d.ts +85 -9
  248. package/dist/session.esm.js +7 -6
  249. package/dist/{sessionInitializer-JM_glXR2.esm.js → sessionInitializer-BT_CmYcX.esm.js} +442 -208
  250. package/dist/{setup-C5tfWt6W.esm.js → setup-BXrgDdfx.esm.js} +42 -29
  251. package/dist/{setup-YPKTUCY5.d.ts → setup-rcXgYUcY.d.ts} +7 -6
  252. package/dist/signature.d.ts +1 -1
  253. package/dist/signature.esm.js +2 -2
  254. package/dist/{signatureManager-f_dPAGXn.esm.js → signatureManager-B737Gkvk.esm.js} +5 -3
  255. package/dist/{signatureManager-BpVt_Jv7.d.ts → signatureManager-daT_8fj_.d.ts} +3 -3
  256. package/dist/{signatureStateMachine-C-nUq_oq.esm.js → signatureStateMachine-B-QG7fk0.esm.js} +5 -7
  257. package/dist/{spawn-D9jgw9pW.d.ts → spawn-COZKetCS.d.ts} +1 -1
  258. package/dist/{stats-BEvexnKC.esm.js → stats-CrqhpKkP.esm.js} +1 -1
  259. package/dist/stats.esm.js +1 -1
  260. package/dist/step-up.d.ts +379 -0
  261. package/dist/step-up.esm.js +640 -0
  262. package/dist/textRules-D4NRinKY.d.ts +41 -0
  263. package/dist/{tri-xzRLIIMN.esm.js → tri-BD9z6z0w.esm.js} +137 -8
  264. package/dist/tri.d.ts +2 -2
  265. package/dist/tri.esm-DYdFtcDH.esm.js +3105 -0
  266. package/dist/tri.esm.js +2 -2
  267. package/dist/trueSight-BymJD5cW.esm.js +1 -0
  268. package/dist/{trueSightService-fLmL_cyg.esm.js → trueSightService-BwyLhIAo.esm.js} +25 -14
  269. package/dist/trust-graph.d.ts +87 -27
  270. package/dist/trust-graph.esm.js +6 -25
  271. package/dist/trustGraphStateMachine-BxvReuo1.esm.js +58 -0
  272. package/dist/{types-B6HsSzpk.d.ts → types-4Re9FSOw.d.ts} +77 -8
  273. package/dist/types-B-PIc0en.d.ts +115 -0
  274. package/dist/types-B9C8W01q.d.ts +34 -0
  275. package/dist/types-BNkzXOXE.d.ts +45 -0
  276. package/dist/{types-0L-eFDmr.d.ts → types-BgRHw-dR.d.ts} +1 -1
  277. package/dist/{types-CJ7Yl9K-.d.ts → types-Bpo97EOh.d.ts} +4 -2
  278. package/dist/types-BtrJ5fkm.d.ts +6 -0
  279. package/dist/{types-Ckir_BEs.d.ts → types-C1056-J1.d.ts} +3 -2
  280. package/dist/{types-BQA7lRDV.d.ts → types-C3rfDzgE.d.ts} +4 -2
  281. package/dist/{events-Du2A4-Qr.esm.js → types-CBQN04Rh.esm.js} +6 -300
  282. package/dist/{types-yPH8lAH-.d.ts → types-CEGG70FK.d.ts} +16 -3
  283. package/dist/types-CTaL0XJz.d.ts +80 -0
  284. package/dist/types-CXTDuzUJ.d.ts +16 -0
  285. package/dist/{types-BEwVKkLJ.d.ts → types-CeEcakO7.d.ts} +7 -1
  286. package/dist/{types-DUnFZ08M.d.ts → types-Cy6Lx3L6.d.ts} +18 -10
  287. package/dist/types-DEa3taWc.d.ts +217 -0
  288. package/dist/{types-CK8Jbjkp.d.ts → types-DHpz4Y37.d.ts} +1 -1
  289. package/dist/{types-DPIDuhut.d.ts → types-DNVzoRvi.d.ts} +2 -1
  290. package/dist/{types-BAxn7MpY.d.ts → types-b0l9b83G.d.ts} +134 -52
  291. package/dist/urlUtils-B2wagB5v.esm.js +39 -0
  292. package/dist/usStates-CwOQ2kAx.esm.js +209 -0
  293. package/dist/video-selfie.d.ts +17 -15
  294. package/dist/video-selfie.esm.js +100 -24
  295. package/dist/{videoSelfieCameraWarmer-BBNKiau1.esm.js → videoSelfieCameraWarmer-DgRlU_8q.esm.js} +27 -28
  296. package/dist/{videoSelfieFlowModuleMachine-BCFVHBQ1.esm.js → videoSelfieFlowModuleMachine-IWdxw1TW.esm.js} +1 -1
  297. package/dist/{videoSelfieStepDetector-CGsTltqB.d.ts → videoSelfieStepDetector-DC_Qh7qI.d.ts} +24 -9
  298. package/dist/virtualCameraCheck-eFOm2C9q.esm.js +27 -0
  299. package/dist/{warmup-BElYWRh7.esm.js → warmup-BN8dG2KX.esm.js} +378 -57
  300. package/dist/{warmup-BO57syF6.d.ts → warmup-SWu5L7cW.d.ts} +19 -2
  301. package/dist/wasm.d.ts +9 -3
  302. package/dist/wasm.esm.js +3 -3
  303. package/dist/wasmDeepsightConfigSync-DukEcrU8.esm.js +77 -0
  304. package/dist/{wasmDsFlagSync-CYj5LL9z.esm.js → wasmDsFlagSync-DwBfTlgB.esm.js} +1 -1
  305. package/dist/{wasmWebClient-BjZw_7OB.esm.js → wasmWebClient-B2P6Vlvv.esm.js} +77 -29
  306. package/dist/watchlist-for-business.d.ts +2 -1
  307. package/dist/watchlist-for-business.esm.js +2 -2
  308. package/dist/watchlist.d.ts +1 -1
  309. package/dist/watchlist.esm.js +2 -2
  310. package/dist/{watchlistForBusinessManager-CZZOFkGl.esm.js → watchlistForBusinessManager-DxeSH80T.esm.js} +40 -8
  311. package/dist/{watchlistForBusinessManager-B3GDPZrr.d.ts → watchlistForBusinessManager-l7ZERQcV.d.ts} +57 -21
  312. package/dist/watchlistForBusinessStateMachine-BC9UWLuZ.esm.js +169 -0
  313. package/dist/{watchlistManager-DXtX94SN.esm.js → watchlistManager-BHzmC9OC.esm.js} +5 -3
  314. package/dist/{watchlistManager-DJQOd8Pw.d.ts → watchlistManager-DQq4GxBO.d.ts} +3 -3
  315. package/dist/{watchlistStateMachine-McALifag.esm.js → watchlistStateMachine-Bxzn16iJ.esm.js} +4 -6
  316. package/dist/workflow.d.ts +10 -6
  317. package/dist/workflow.esm.js +95 -60
  318. package/dist/{xstate-actors.esm-8Gzepa_A.esm.js → xstate-actors.esm-BCcwgosu.esm.js} +1 -1
  319. package/dist/xstate.cjs-D6Ur0X1F.d.ts +7 -0
  320. package/dist/{xstate.esm-DSajW7CJ.esm.js → xstate.esm-CIqUf_i6.esm.js} +1 -125
  321. package/package.json +35 -8
  322. package/dist/Actor-DpTj5PFb.d.ts +0 -1
  323. package/dist/IBrowserEnvironmentCapability-DEaRRk-R.esm.js +0 -9
  324. package/dist/addressSearch-DPjIKJrX.esm.js +0 -563
  325. package/dist/camera-9wWD-pwg.d.ts +0 -4
  326. package/dist/cpf-uAZTPUBy.esm.js +0 -61
  327. package/dist/deepsightLoader-sH7920zw.esm.js +0 -55
  328. package/dist/ekycStateMachine-CDnI_NRq.esm.js +0 -1443
  329. package/dist/ekycUtils-zY8CdKJL.esm.js +0 -300
  330. package/dist/flowServices-X6Rwf_7E.esm.js +0 -688
  331. package/dist/index-DpTj5PFb.d.ts +0 -1
  332. package/dist/thumbmark.esm-CRc0cYvz.esm.js +0 -1242
  333. package/dist/tri.esm-BIjHhBJ2.esm.js +0 -2620
  334. package/dist/types-BvLo3U4u.d.ts +0 -134
  335. package/dist/types-zOgZqMni.d.ts +0 -6
  336. package/dist/urlUtils-6jsE6rKp.esm.js +0 -23
  337. package/dist/watchlistForBusinessStateMachine-B66E7jud.esm.js +0 -78
  338. /package/dist/{types-BSBzhHRH2.d.ts → types-BSBzhHRH.d.ts} +0 -0
@@ -0,0 +1,951 @@
1
+ import { r as getWasmStatus } from "./warmup-BN8dG2KX.esm.js";
2
+ import { n as eventModuleNames } from "./types-CBQN04Rh.esm.js";
3
+ import { r as getToken, t as api, u as endpoints } from "./api-BNxrW8xK.esm.js";
4
+ import { d as whenSessionFingerprintSettled, f as getStandaloneFlowPolicy, i as initializeSession, r as getSessionFingerprintResult } from "./sessionInitializer-BT_CmYcX.esm.js";
5
+ import { E as updateFeatureManagementUser } from "./feature-management-BlscKbeV.esm.js";
6
+ import { i as toIncodeApiError } from "./apiError-BAfdBGxH.esm.js";
7
+ import "./session-VXYuRYzb.esm.js";
8
+ import { n as loadPhoneValidation } from "./phoneValidation-OggtfjRt.esm.js";
9
+ import { a as prefetchStartInfo } from "./phoneServices-DC7AuUed.esm.js";
10
+ //#region src/modules/flow/dashboardConfig.ts
11
+ function isPlainObject(value) {
12
+ if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
13
+ const prototype = Object.getPrototypeOf(value);
14
+ return prototype === Object.prototype || prototype === null;
15
+ }
16
+ function mergeDashboardConfig(dashboardConfig, localConfig) {
17
+ if (!isPlainObject(dashboardConfig) || !isPlainObject(localConfig)) return localConfig === void 0 ? dashboardConfig : localConfig;
18
+ const result = { ...dashboardConfig };
19
+ for (const [key, localValue] of Object.entries(localConfig)) {
20
+ if (localValue === void 0) continue;
21
+ const dashboardValue = result[key];
22
+ result[key] = isPlainObject(dashboardValue) && isPlainObject(localValue) ? mergeDashboardConfig(dashboardValue, localValue) : localValue;
23
+ }
24
+ return result;
25
+ }
26
+ const SDK_ONLY_FIELDS = { AUTHENTICATION: ["identityReuseOutcomes"] };
27
+ function withoutSdkOnlyFields(key, override) {
28
+ const fields = key in SDK_ONLY_FIELDS ? SDK_ONLY_FIELDS[key] : void 0;
29
+ if (!fields || !isPlainObject(override)) return override;
30
+ return Object.fromEntries(Object.entries(override).filter(([field]) => !fields.includes(field)));
31
+ }
32
+ /**
33
+ * Merges `modulesConfig` over the dashboard config of each matching module.
34
+ * Runs on the normalized flow, so the keys are the step keys (`TUTORIAL_ID`
35
+ * is already `ID`).
36
+ */
37
+ function applyModulesConfig(flow, modulesConfig) {
38
+ if (!modulesConfig) return flow;
39
+ return {
40
+ ...flow,
41
+ flowModules: flow.flowModules.map((module) => {
42
+ const override = module.key === "TUTORIAL_ID" ? void 0 : withoutSdkOnlyFields(module.key, modulesConfig[module.key]);
43
+ if (!override) return module;
44
+ return {
45
+ ...module,
46
+ configuration: mergeDashboardConfig(module.configuration, override)
47
+ };
48
+ })
49
+ };
50
+ }
51
+ //#endregion
52
+ //#region src/modules/video-selfie/videoSelfieSteps.ts
53
+ /** Steps that use the rear (environment) camera; everything else uses the front (user) camera. */
54
+ const REAR_CAMERA_STEPS = [
55
+ "frontId",
56
+ "backId",
57
+ "poa"
58
+ ];
59
+ /**
60
+ * The camera facing mode a given step should use. ID and proof-of-address steps
61
+ * use the rear camera; selfie / questions / speech use the front camera.
62
+ */
63
+ function facingModeForStep(step) {
64
+ return REAR_CAMERA_STEPS.includes(step) ? "environment" : "user";
65
+ }
66
+ /**
67
+ * Resolves the ordered list of active capture steps from the module config.
68
+ * The order mirrors V1 `getVideoSelfieModules`: the rear-camera document steps
69
+ * (`frontId` → `backId` → `poa`) run first, then the front-camera steps
70
+ * (`selfie` → `questions` → `speech`). This keeps the user from flipping the
71
+ * device between front and rear cameras mid-session. `selfie` is always present;
72
+ * the document and voice-consent steps are gated by their config flags.
73
+ *
74
+ * Both ID sides are captured whenever `checkIdScan` is on (a normal two-sided ID
75
+ * scan) — mirroring V1, which gated `back` on `checkIdScan`, not on the compare
76
+ * flags. `compareBackIdEnabled`/`compareBackOcrEnabled` only decide whether the
77
+ * captured back is *validated* against the backend (see `validateIdFrame` in
78
+ * `videoSelfieStepDetector`); with both off the back is captured passively on
79
+ * the first well-framed frame.
80
+ */
81
+ function resolveVideoSelfieSteps(config) {
82
+ if (config.steps && config.steps.length > 0) return [...config.steps];
83
+ const steps = [];
84
+ if (config.checkIdScan) {
85
+ steps.push("frontId");
86
+ steps.push("backId");
87
+ }
88
+ if (config.checkDocumentScan) steps.push("poa");
89
+ steps.push("selfie");
90
+ if (config.checkVoiceConsent) {
91
+ if ((config.voiceConsentQuestions ?? 0) > 0) steps.push("questions");
92
+ steps.push("speech");
93
+ }
94
+ return steps;
95
+ }
96
+ function videoSelfieWasmPipelines(config, steps = resolveVideoSelfieSteps(config)) {
97
+ const pipelines = [];
98
+ if (steps.includes("selfie")) pipelines.push("videoSelfie");
99
+ if (steps.some((step) => step === "frontId" || step === "backId")) pipelines.push("videoSelfieId");
100
+ return pipelines;
101
+ }
102
+ //#endregion
103
+ //#region src/modules/flow/presets/identityReusePreset.ts
104
+ const SHARED = "identityShared";
105
+ const HINT_PROVIDED = "identitySearchHintProvided";
106
+ const OUTCOMES = "identityReuseOutcomes";
107
+ /** The modules that switch the preset on. Normalization reads them too. */
108
+ const IDENTITY_REUSE_TRIGGERS = ["IDENTITY_SEARCH", "IDENTITY_REUSE"];
109
+ /** The members in run order (design doc §2). Each path skips some of them. */
110
+ const MEMBERS = [
111
+ "AUTHENTICATION",
112
+ "IDENTITY_SEARCH",
113
+ "IDENTITY_REUSE",
114
+ "ID",
115
+ "SECOND_ID",
116
+ "ID_VALIDATION",
117
+ "FACE_MATCH"
118
+ ];
119
+ /** Every member but SECOND_ID, which is optional and goes with ID. */
120
+ const REQUIRED = [
121
+ "AUTHENTICATION",
122
+ "IDENTITY_SEARCH",
123
+ "IDENTITY_REUSE",
124
+ "ID",
125
+ "ID_VALIDATION",
126
+ "FACE_MATCH"
127
+ ];
128
+ /**
129
+ * Modules the preset can't run with. ID_OCR and NFC_SCAN need the ID capture,
130
+ * which P1 and P2 skip; they wait until their owners confirm how they behave
131
+ * (owner decision 15). SELFIE would be a second face capture: the 1:1
132
+ * authentication capture is the session's selfie.
133
+ */
134
+ const UNSUPPORTED = [
135
+ "ID_OCR",
136
+ "NFC_SCAN",
137
+ "SELFIE"
138
+ ];
139
+ const CONTACTS = ["EMAIL", "PHONE"];
140
+ /**
141
+ * Face authentication that runs on the device can't decide the path: the
142
+ * backend's verdict never reaches the module, so it always completes, and the
143
+ * preset would treat every person as a customer here (P1) and never fail a
144
+ * spoof.
145
+ */
146
+ const ON_DEVICE_AUTHENTICATION = "AUTHENTICATION with on-device face results";
147
+ function isOnDeviceAuthentication(module) {
148
+ return module.key === "AUTHENTICATION" && module.configuration.onDeviceFaceResultsSubmissionEnabled === true;
149
+ }
150
+ const CONTACT_BEFORE_GROUP = "EMAIL or PHONE, before the group";
151
+ /** How the load error names a missing ID_VALIDATION, a step the SDK derives. */
152
+ const ID_VALIDATION_LABEL = "ID_VALIDATION (ID Validation after TUTORIAL_ID)";
153
+ /** Authentication's endings that mean the person is new to this organization. */
154
+ const NEW_HERE = ["NONEXISTENT_CUSTOMER", "HINT_NOT_PROVIDED"];
155
+ /**
156
+ * The outcomes of each decision (design doc §6.3), by the name analytics
157
+ * reports, with what still runs on each. `decide` returns one of the names.
158
+ */
159
+ const AFTER_AUTHENTICATION = {
160
+ existingCustomer: [],
161
+ newCustomer: [
162
+ "IDENTITY_SEARCH",
163
+ "IDENTITY_REUSE",
164
+ "ID",
165
+ "ID_VALIDATION",
166
+ "FACE_MATCH"
167
+ ]
168
+ };
169
+ const AFTER_REUSE = {
170
+ documentShared: ["ID_VALIDATION", "FACE_MATCH"],
171
+ fullOnboarding: ["ID", "FACE_MATCH"]
172
+ };
173
+ function isRecord(value) {
174
+ return typeof value === "object" && value !== null;
175
+ }
176
+ function isMember(key) {
177
+ return MEMBERS.includes(key);
178
+ }
179
+ /**
180
+ * `IDENTITY_REUSE@1`: the identity reuse path in a Flow (design doc §2). The
181
+ * 1:1 face authentication decides first: a person who already has an identity
182
+ * in this organization leaves the group (P1), and a new one goes on to the
183
+ * search and the reuse picker. The reuse step then decides between validating
184
+ * the shared document (P2) and the ID capture (P3); the face match runs after
185
+ * either. An ending
186
+ * the table doesn't name takes the "otherwise" row: P1 after authentication,
187
+ * P3 after reuse. The backend's final rule judges the session either way.
188
+ */
189
+ const identityReusePreset = {
190
+ name: "IDENTITY_REUSE@1",
191
+ triggers: IDENTITY_REUSE_TRIGGERS,
192
+ members: MEMBERS,
193
+ companions: { SECOND_ID: "ID" },
194
+ misconfiguredErrorCode: "IDENTITY_REUSE_FLOW_MISCONFIGURED",
195
+ title: "Identity reuse",
196
+ analyticsModule: eventModuleNames.identityReusePath,
197
+ prepare(modules, flow) {
198
+ const groupStart = modules.findIndex((module) => isMember(module.key));
199
+ const dropsContacts = flow[HINT_PROVIDED] === true;
200
+ return modules.flatMap((module, index) => {
201
+ if (dropsContacts && index < groupStart && CONTACTS.includes(module.key)) return [];
202
+ if (module.key === "AUTHENTICATION") return [{
203
+ ...module,
204
+ configuration: {
205
+ ...module.configuration,
206
+ [OUTCOMES]: true
207
+ }
208
+ }];
209
+ return [module];
210
+ });
211
+ },
212
+ check(modules, flow) {
213
+ const keys = modules.map((module) => module.key);
214
+ const missing = REQUIRED.filter((key) => !keys.includes(key)).map((key) => key === "ID_VALIDATION" ? ID_VALIDATION_LABEL : key);
215
+ if (flow[HINT_PROVIDED] !== true) {
216
+ const groupStart = keys.findIndex(isMember);
217
+ if (!(groupStart === -1 ? [] : keys.slice(0, groupStart)).some((key) => CONTACTS.includes(key))) missing.push(CONTACT_BEFORE_GROUP);
218
+ }
219
+ const unsupported = UNSUPPORTED.filter((key) => keys.includes(key));
220
+ if (modules.some(isOnDeviceAuthentication)) unsupported.push(ON_DEVICE_AUTHENTICATION);
221
+ return {
222
+ missing,
223
+ unsupported
224
+ };
225
+ },
226
+ decide(step, { output, moduleErrorCode }) {
227
+ if (step === "AUTHENTICATION") return moduleErrorCode !== void 0 && NEW_HERE.includes(moduleErrorCode) ? "newCustomer" : "existingCustomer";
228
+ if (step === "IDENTITY_REUSE") return isRecord(output) && output[SHARED] === true ? "documentShared" : "fullOnboarding";
229
+ },
230
+ outcomes: {
231
+ AUTHENTICATION: AFTER_AUTHENTICATION,
232
+ IDENTITY_REUSE: AFTER_REUSE
233
+ }
234
+ };
235
+ //#endregion
236
+ //#region src/modules/flow/flowUtils.ts
237
+ function enrichFlowModuleConfig(module, flow) {
238
+ const config = {
239
+ ...module.configuration,
240
+ ds: flow.ds
241
+ };
242
+ if (module.key === "ID" || module.key === "TUTORIAL_ID" || module.key === "SECOND_ID" || module.key === "SELFIE") return {
243
+ ...config,
244
+ ageAssurance: config.ageAssurance ?? flow.ageAssurance,
245
+ mergeSessionRecordings: config.mergeSessionRecordings ?? flow.mergeSessionRecordings
246
+ };
247
+ return config;
248
+ }
249
+ let configConverters;
250
+ /**
251
+ * Loads the eKYC/eKYB config converters (the form-definitions catalog index)
252
+ * for a flow that has those steps, so other flows do not download them. The
253
+ * flow machine awaits it with the flow, before it reads any step config.
254
+ */
255
+ async function loadFlowConfigConverters(flow) {
256
+ const needed = flow.flowModules.some((module) => module.key === "EXTERNAL_VERIFICATION" || module.key === "EKYB");
257
+ if (configConverters || !needed) return;
258
+ const [ekyc, ekyb] = await Promise.all([import("./ekycUtils-DEvtEyBI.esm.js").then((n) => n.n), import("./ekybUtils-Z9MhFAer.esm.js").then((n) => n.t)]);
259
+ configConverters = {
260
+ toEkycConfig: ekyc.toEkycConfig,
261
+ toEkybConfig: ekyb.toEkybConfig
262
+ };
263
+ }
264
+ function resolveFlowModuleConfig(module, flow) {
265
+ const config = enrichFlowModuleConfig(module, flow);
266
+ if (module.key === "EXTERNAL_VERIFICATION") return { ...configConverters?.toEkycConfig(module.configuration) ?? module.configuration };
267
+ if (module.key === "EKYB") return { ...configConverters?.toEkybConfig(module.configuration) ?? module.configuration };
268
+ if (module.key === "FACE_MATCH" && (config.matchingType === void 0 || config.matchingType === "selfieVsId") && flow.flowModules.some((candidate) => candidate.key === "SECOND_ID")) return {
269
+ ...config,
270
+ matchingType: "secondId"
271
+ };
272
+ if (module.key === "ID_OCR") return {
273
+ ...config,
274
+ secondId: config.ocrDocument === void 0 && (config.secondId ?? flow.flowModules.some((candidate) => candidate.key === "SECOND_ID")),
275
+ flowId: flow.flowId
276
+ };
277
+ if (module.key === "SECOND_ID") return {
278
+ ...config,
279
+ isSecondId: true
280
+ };
281
+ if (module.key === "ADDRESS") return {
282
+ ...config,
283
+ processingType: "addressStatement"
284
+ };
285
+ if (module.key === "MANDATORY_CONSENT" || module.key === "ML_CONSENT") return {
286
+ ...config,
287
+ type: module.key === "ML_CONSENT" ? "ML" : "MANDATORY"
288
+ };
289
+ if (module.key === "AE_SIGNATURE" || module.key === "QE_SIGNATURE") return {
290
+ uploadDocument: module.configuration.uploadDocument,
291
+ downloadDocument: module.configuration.downloadDocument,
292
+ ...module.key === "QE_SIGNATURE" ? { providerCode: module.configuration.providerCode } : {}
293
+ };
294
+ if (module.key === "DYNAMIC_FORMS") return { screens: module.configuration.screens.map((formScreen) => ({
295
+ title: formScreen.title,
296
+ hideTitle: formScreen.hideTitle,
297
+ questions: formScreen.questions.map((question) => ({
298
+ questionId: question.questionId,
299
+ question: question.question,
300
+ inputType: question.inputType,
301
+ isOptional: question.isOptional,
302
+ overrides: question.overrides ?? void 0,
303
+ isPredefined: question.isPredefined,
304
+ options: question.options,
305
+ prefillSource: question.prefillSource,
306
+ editable: question.editable
307
+ }))
308
+ })) };
309
+ return config;
310
+ }
311
+ const WASM_MODULE_PIPELINES = {
312
+ SELFIE: "selfie",
313
+ AUTHENTICATION: "selfie",
314
+ FACE_MATCH: "selfie",
315
+ ID: "idCapture",
316
+ TUTORIAL_ID: "idCapture",
317
+ SECOND_ID: "idCapture"
318
+ };
319
+ const FACE_MODULES_WITH_ON_DEVICE_VARIANT = /* @__PURE__ */ new Set(["SELFIE", "AUTHENTICATION"]);
320
+ function isOnDeviceFaceModule(module) {
321
+ if (!FACE_MODULES_WITH_ON_DEVICE_VARIANT.has(module.key)) return false;
322
+ return module.configuration?.onDeviceFaceResultsSubmissionEnabled === true;
323
+ }
324
+ function isVideoOnboardingModule(module) {
325
+ return module.key === "VIDEO_ONBOARDING";
326
+ }
327
+ /**
328
+ * Analyzes a flow configuration and returns the WASM pipelines needed.
329
+ * Use this to conditionally warmup WASM only when required by the flow.
330
+ *
331
+ * Modules with `onDeviceFaceResultsSubmissionEnabled: true` (currently SELFIE
332
+ * and AUTHENTICATION) select the 6-model `'onDeviceSelfie'` bundle instead of
333
+ * the default 4-model `'selfie'` bundle.
334
+ *
335
+ * @param flow - The flow configuration from /omni/onboarding/flow
336
+ * @returns Array of WASM pipelines needed (e.g., ['selfie', 'idCapture'])
337
+ *
338
+ * @example
339
+ * ```typescript
340
+ * const pipelines = getRequiredWasmPipelines(flow);
341
+ * if (pipelines.length > 0) {
342
+ * warmupWasm({ ...wasmConfig, pipelines });
343
+ * }
344
+ * ```
345
+ */
346
+ function getRequiredWasmPipelines(flow) {
347
+ const pipelines = /* @__PURE__ */ new Set();
348
+ for (const module of flow.flowModules) {
349
+ if (isOnDeviceFaceModule(module)) {
350
+ pipelines.add("onDeviceSelfie");
351
+ continue;
352
+ }
353
+ if (isVideoOnboardingModule(module)) {
354
+ for (const p of videoSelfieWasmPipelines(module.configuration)) pipelines.add(p);
355
+ continue;
356
+ }
357
+ const pipeline = WASM_MODULE_PIPELINES[module.key];
358
+ if (pipeline) pipelines.add(pipeline);
359
+ }
360
+ return [...pipelines];
361
+ }
362
+ /**
363
+ * The current capture requirement, then one capture ahead once it is ready.
364
+ * Home never looks past its first capture, and redirects stop lookahead.
365
+ * @internal Used by the shared flow shell after rendering.
366
+ */
367
+ function getNextRequiredWasmPipelines(state, loadedPipelines = getWasmStatus().loadedPipelines) {
368
+ const { flow, currentStepIndex, homeScreen } = state;
369
+ if (currentStepIndex < 0) return [];
370
+ const mayBeSkipped = stepsTheCurrentDecisionMaySkip({
371
+ armedPresets: triggeredFlowPresets(flow.flowModules),
372
+ steps: flow.flowModules.map((module) => module.key),
373
+ currentStepIndex
374
+ });
375
+ let currentPipelines = [];
376
+ for (let index = currentStepIndex; index < flow.flowModules.length; index++) {
377
+ const module = flow.flowModules[index];
378
+ if (module.key === "REDIRECT_TO_MOBILE") return [];
379
+ if (mayBeSkipped.has(index)) return [];
380
+ const required = getRequiredWasmPipelines({
381
+ ...flow,
382
+ flowModules: [module]
383
+ });
384
+ if (index === currentStepIndex && !homeScreen.visible) currentPipelines = required;
385
+ if (required.length === 0) continue;
386
+ const missing = required.filter((pipeline) => !loadedPipelines.includes(pipeline));
387
+ if (missing.length > 0) return missing;
388
+ if (homeScreen.visible || required.some((pipeline) => !currentPipelines.includes(pipeline))) return [];
389
+ }
390
+ return [];
391
+ }
392
+ /**
393
+ * Normalizes flow modules by expanding TUTORIAL_ID into ID + SECOND_ID
394
+ * based on configuration flags. Matches legacy flowService behavior.
395
+ *
396
+ * - TUTORIAL_ID becomes ID (with same config)
397
+ * - If secondId: true, adds SECOND_ID module with isSecondId: true
398
+ * - thirdId is deprecated and ignored; the flow continues to the next step
399
+ * - Bare ID following TUTORIAL_ID is dropped (already merged), except in a
400
+ * flow with identity reuse, where it becomes an ID_VALIDATION step
401
+ */
402
+ function normalizeFlowModules(flow, options = {}) {
403
+ let modules = normalizeIdModules(flow.flowModules);
404
+ modules = normalizeCpfModules(modules, options);
405
+ modules = dropWatchlistBusinessIfEkyb(modules);
406
+ modules = dropSelfieIfVideoSelfieUsesAsSelfie(modules);
407
+ if (shouldInjectRedirect(flow, modules, options)) modules = addRedirect(flow, modules, options);
408
+ return modules;
409
+ }
410
+ /**
411
+ * Drops WATCHLIST_BUSINESS when EKYB is present in the same flow.
412
+ * The EKYB module performs a superset of the watchlist-for-business check,
413
+ * so running both would be redundant.
414
+ */
415
+ function dropWatchlistBusinessIfEkyb(modules) {
416
+ if (!hasModule(modules, "EKYB")) return modules;
417
+ return modules.filter((m) => m.key !== "WATCHLIST_BUSINESS");
418
+ }
419
+ /**
420
+ * Drops standalone SELFIE modules when a VIDEO_ONBOARDING module has
421
+ * `useAsSelfie: true`. The video-selfie sequence captures the onboarding selfie
422
+ * itself (its own `selfie` step), so a separate SELFIE step would be redundant.
423
+ * Only SELFIE is removed (not AUTHENTICATION / FACE_MATCH). Mirrors legacy
424
+ * flowService `removeSelfie`.
425
+ */
426
+ function dropSelfieIfVideoSelfieUsesAsSelfie(modules) {
427
+ if (!modules.some((m) => m.key === "VIDEO_ONBOARDING" && m.configuration.useAsSelfie === true)) return modules;
428
+ return modules.filter((m) => m.key !== "SELFIE");
429
+ }
430
+ /**
431
+ * @internal Expands TUTORIAL_ID and handles the bare ID after it (see
432
+ * {@link normalizeFlowModules}). A flow it already ran on comes back
433
+ * unchanged.
434
+ */
435
+ function normalizeIdModules(modules) {
436
+ const keepsIdValidation = modules.some((module) => IDENTITY_REUSE_TRIGGERS.includes(module.key));
437
+ return modules.flatMap((module, idx, arr) => {
438
+ if (module.key === "TUTORIAL_ID") {
439
+ const idConfig = module.configuration;
440
+ const result = [{
441
+ key: "ID",
442
+ configuration: idConfig
443
+ }];
444
+ if (idConfig.secondId) result.push({
445
+ key: "SECOND_ID",
446
+ configuration: {
447
+ ...idConfig,
448
+ isSecondId: true
449
+ }
450
+ });
451
+ return result;
452
+ }
453
+ const prev = arr[idx - 1];
454
+ if (module.key === "ID" && prev?.key === "TUTORIAL_ID") {
455
+ if (!keepsIdValidation) return [];
456
+ return [{
457
+ key: "ID_VALIDATION",
458
+ configuration: module.configuration
459
+ }];
460
+ }
461
+ return [module];
462
+ });
463
+ }
464
+ function normalizeCpfModules(modules, options) {
465
+ if (options.useCPF !== true) return modules;
466
+ return modules.map((module) => {
467
+ if (module.key !== "ID_OCR") return module;
468
+ return {
469
+ key: "ID_OCR",
470
+ configuration: {
471
+ ...module.configuration,
472
+ cpfOnly: true
473
+ }
474
+ };
475
+ });
476
+ }
477
+ function shouldInjectRedirect(flow, modules, options) {
478
+ return options.isDesktop === true && flow.redirectDesktopToMobile === true && !hasModule(modules, "REDIRECT_TO_MOBILE");
479
+ }
480
+ function addRedirect(flow, modules, options) {
481
+ return [{
482
+ key: "REDIRECT_TO_MOBILE",
483
+ configuration: {
484
+ flowId: flow.flowId,
485
+ disableSmsOption: flow.disableSmsOption ?? false,
486
+ addContinueToDesktop: flow.addContinueToDesktop ?? false,
487
+ qrPhishingResistance: flow.qrPhishingResistance ?? false,
488
+ authHint: options.authHint,
489
+ lang: options.lang
490
+ }
491
+ }, ...modules];
492
+ }
493
+ function hasModule(modules, key) {
494
+ return modules.some((module) => module.key === key);
495
+ }
496
+ //#endregion
497
+ //#region src/modules/flow/presets/flowPresets.ts
498
+ /** Every preset, in the order they arm and decide. The one registry. */
499
+ const FLOW_PRESETS = [identityReusePreset];
500
+ function isTriggered(modules, preset) {
501
+ return modules.some((module) => preset.triggers.includes(module.key));
502
+ }
503
+ /** Runs the preset's `prepare`, then lays its group out. */
504
+ function prepareAndLayOut(modules, flow, preset) {
505
+ return layOut(preset.prepare?.(modules, flow) ?? modules, preset);
506
+ }
507
+ /**
508
+ * Takes the preset's members out of the list and puts them back in run order,
509
+ * at the position of the earliest one. Every other module keeps its served
510
+ * order, so modules that sat between two members now run after the group.
511
+ */
512
+ function layOut(modules, preset) {
513
+ const rank = (module) => preset.members.indexOf(module.key);
514
+ const start = modules.findIndex((module) => rank(module) !== -1);
515
+ if (start === -1) return modules;
516
+ const rest = modules.slice(start);
517
+ const group = rest.filter((module) => rank(module) !== -1).sort((a, b) => rank(a) - rank(b));
518
+ const others = rest.filter((module) => rank(module) === -1);
519
+ return [
520
+ ...modules.slice(0, start),
521
+ ...group,
522
+ ...others
523
+ ];
524
+ }
525
+ function describeMisconfiguredPreset(preset, problems) {
526
+ const parts = [
527
+ problems.missing.length > 0 && `missing: ${problems.missing.join(", ")}`,
528
+ problems.unsupported.length > 0 && `not supported: ${problems.unsupported.join(", ")}`,
529
+ problems.unregistered.length > 0 && `no registered module for: ${problems.unregistered.join(", ")}`
530
+ ].filter((part) => typeof part === "string");
531
+ return `${preset.title} flow is misconfigured — ${parts.join("; ")}`;
532
+ }
533
+ /**
534
+ * Arms the presets the served flow switches on, once, at load. For each one it
535
+ * runs the preset's `prepare`, lays the group out in run order, then checks
536
+ * the laid-out list: the modules the preset needs, the ones it doesn't
537
+ * support, and a registered machine for every member present. A flow that
538
+ * fails the check can't run.
539
+ *
540
+ * A flow that switches no preset on comes back as it was: the same array, and
541
+ * no armed preset.
542
+ *
543
+ * @param canResolve - Whether a machine is registered for a module key. It is
544
+ * read when arming runs, after `getFlow`, because `<incode-flow>` fills its
545
+ * lazy registry inside `getFlow`.
546
+ */
547
+ function armFlowPresets(flow, canResolve) {
548
+ let laidOut = flow.flowModules ?? [];
549
+ const armedPresets = [];
550
+ for (const preset of FLOW_PRESETS) {
551
+ if (!isTriggered(laidOut, preset)) continue;
552
+ laidOut = prepareAndLayOut(laidOut, flow, preset);
553
+ const { missing, unsupported } = preset.check(laidOut, flow);
554
+ const unregistered = [...new Set(laidOut.map((module) => module.key).filter((key) => preset.members.includes(key) && !canResolve(key)))];
555
+ if (missing.length + unsupported.length + unregistered.length > 0) {
556
+ const problems = {
557
+ missing,
558
+ unsupported,
559
+ unregistered
560
+ };
561
+ return {
562
+ status: "misconfigured",
563
+ preset: preset.name,
564
+ moduleErrorCode: preset.misconfiguredErrorCode,
565
+ message: describeMisconfiguredPreset(preset, problems),
566
+ ...problems
567
+ };
568
+ }
569
+ armedPresets.push(preset.name);
570
+ }
571
+ return {
572
+ status: "armed",
573
+ modules: laidOut,
574
+ armedPresets
575
+ };
576
+ }
577
+ /**
578
+ * The indexes after `currentStepIndex` of the preset's members that are not in
579
+ * `stillRuns`. The safety rule lives here: only indexes after the current one,
580
+ * and only the preset's own members.
581
+ */
582
+ function skippedMembers(preset, steps, currentStepIndex, stillRuns) {
583
+ const skipped = [];
584
+ for (let index = currentStepIndex + 1; index < steps.length; index++) {
585
+ const key = steps[index];
586
+ if (!preset.members.includes(key)) continue;
587
+ if (!stillRuns.includes(preset.companions[key] ?? key)) skipped.push(index);
588
+ }
589
+ return skipped;
590
+ }
591
+ /** The analytics module of a preset, by name. */
592
+ function flowPresetAnalyticsModule(name) {
593
+ return FLOW_PRESETS.find((candidate) => candidate.name === name)?.analyticsModule ?? name;
594
+ }
595
+ /**
596
+ * The decision of each armed preset whose decision step this is: the outcome
597
+ * it took, given how the step ended, and the members that outcome skips.
598
+ * Empty when no preset decides at this step.
599
+ */
600
+ function decideFlowPresets({ armedPresets, steps, currentStepIndex, ending }) {
601
+ const step = steps[currentStepIndex];
602
+ if (step === void 0) return [];
603
+ const decisions = [];
604
+ for (const preset of FLOW_PRESETS) {
605
+ if (!armedPresets.includes(preset.name)) continue;
606
+ const outcome = preset.decide(step, ending);
607
+ if (outcome === void 0) continue;
608
+ const stillRuns = preset.outcomes[step]?.[outcome];
609
+ if (!stillRuns) continue;
610
+ decisions.push({
611
+ preset: preset.name,
612
+ analyticsModule: preset.analyticsModule,
613
+ outcome,
614
+ skipped: skippedMembers(preset, steps, currentStepIndex, stillRuns)
615
+ });
616
+ }
617
+ return decisions;
618
+ }
619
+ /**
620
+ * The indexes of the steps to remove after the step at `currentStepIndex`
621
+ * ended as `ending` says. Each armed preset whose decision step this is says
622
+ * which of its members still run; the others go.
623
+ *
624
+ * A preset never inserts, reorders, touches another module or finishes the
625
+ * flow, and nothing is removed when no preset armed or the step decides
626
+ * nothing.
627
+ */
628
+ function applyFlowPresets(position) {
629
+ return [...new Set(decideFlowPresets(position).flatMap(({ skipped }) => skipped))];
630
+ }
631
+ /**
632
+ * The steps that can run right after the step at `currentStepIndex`, in list
633
+ * order, so they can load while it runs. That is the next step, unless an
634
+ * armed preset decides at this step: then it is the step that runs next on
635
+ * each of the preset's paths. While face authentication runs, for example,
636
+ * that is IDENTITY_SEARCH and the first module after the group.
637
+ */
638
+ function stepsThatMayRunNext({ armedPresets, steps, currentStepIndex }) {
639
+ const step = steps[currentStepIndex];
640
+ if (step === void 0) return [];
641
+ const next = /* @__PURE__ */ new Set();
642
+ let decides = false;
643
+ for (const preset of FLOW_PRESETS) {
644
+ if (!armedPresets.includes(preset.name)) continue;
645
+ const outcomes = preset.outcomes[step];
646
+ if (!outcomes) continue;
647
+ decides = true;
648
+ for (const stillRuns of Object.values(outcomes)) {
649
+ const skipped = new Set(skippedMembers(preset, steps, currentStepIndex, stillRuns));
650
+ for (let index = currentStepIndex + 1; index < steps.length; index++) if (!skipped.has(index)) {
651
+ next.add(index);
652
+ break;
653
+ }
654
+ }
655
+ }
656
+ if (!decides && currentStepIndex + 1 < steps.length) next.add(currentStepIndex + 1);
657
+ return [...next].sort((a, b) => a - b).map((index) => steps[index]);
658
+ }
659
+ /**
660
+ * The presets a flow switches on. In a loaded flow these are the armed ones,
661
+ * because a flow that fails a preset's check never leaves loading.
662
+ */
663
+ function triggeredFlowPresets(modules) {
664
+ return FLOW_PRESETS.filter((preset) => isTriggered(modules, preset)).map((preset) => preset.name);
665
+ }
666
+ /**
667
+ * The indexes after `currentStepIndex` that an armed preset deciding at the
668
+ * current step skips on at least one of its paths. Empty when the current
669
+ * step decides nothing. While face authentication runs, for example, that is
670
+ * every other member of the identity group, because a recognized person
671
+ * leaves the group.
672
+ */
673
+ function stepsTheCurrentDecisionMaySkip({ armedPresets, steps, currentStepIndex }) {
674
+ const skipped = /* @__PURE__ */ new Set();
675
+ const step = steps[currentStepIndex];
676
+ if (step === void 0) return skipped;
677
+ for (const preset of FLOW_PRESETS) {
678
+ if (!armedPresets.includes(preset.name)) continue;
679
+ for (const stillRuns of Object.values(preset.outcomes[step] ?? {})) for (const index of skippedMembers(preset, steps, currentStepIndex, stillRuns)) skipped.add(index);
680
+ }
681
+ return skipped;
682
+ }
683
+ /**
684
+ * The key of the first module a flow runs once the presets it switches on
685
+ * have prepared it and laid it out, for preloading before the flow loads. It
686
+ * doesn't run the presets' checks, so it also answers for a raw dashboard
687
+ * flow or one that will fail to load. With the identity search hint from
688
+ * session start, for example, that is the module after the dropped contact
689
+ * steps.
690
+ */
691
+ function getFirstFlowModuleKey(flow) {
692
+ const served = flow.flowModules ?? [];
693
+ if (!FLOW_PRESETS.some((preset) => isTriggered(served, preset))) return served[0]?.key;
694
+ let modules = normalizeIdModules(served);
695
+ for (const preset of FLOW_PRESETS) if (isTriggered(modules, preset)) modules = prepareAndLayOut(modules, flow, preset);
696
+ return modules[0]?.key;
697
+ }
698
+ //#endregion
699
+ //#region src/modules/flow/flowServices.ts
700
+ let dashboardFlowCache;
701
+ var FlowSessionFinishedError = class extends Error {
702
+ constructor() {
703
+ super("This verification session has already been completed and can no longer be reopened.");
704
+ this.moduleErrorCode = "SESSION_FINISHED";
705
+ this.name = "FlowSessionFinishedError";
706
+ }
707
+ };
708
+ const REGULATION_TYPES = [
709
+ "US",
710
+ "Worldwide",
711
+ "Other",
712
+ "US_Illinois",
713
+ "US_Texas",
714
+ "US_California",
715
+ "US_Washington"
716
+ ];
717
+ const REGULATION_TYPE_ALIASES = {
718
+ us: "US",
719
+ worldwide: "Worldwide",
720
+ worldwide_consent: "Worldwide",
721
+ other: "Other",
722
+ us_illinois: "US_Illinois",
723
+ usillinois: "US_Illinois",
724
+ us_texas: "US_Texas",
725
+ ustexas: "US_Texas",
726
+ us_california: "US_California",
727
+ uscalifornia: "US_California",
728
+ us_washington: "US_Washington",
729
+ uswashington: "US_Washington"
730
+ };
731
+ function toRegulationType(value) {
732
+ if (!value) return "Other";
733
+ if (REGULATION_TYPES.includes(value)) return value;
734
+ const normalized = value.trim().toLowerCase().replace(/[\s-]+/g, "_");
735
+ return REGULATION_TYPE_ALIASES[normalized] ?? "Other";
736
+ }
737
+ /**
738
+ * The consent decision rides on the device-fingerprint response. A flow that
739
+ * never checks for consent doesn't read that response, so its first module
740
+ * doesn't wait for the post, and the post keeps waiting for the device hash in
741
+ * the background. A flow that checks waits for the post, and so for the device
742
+ * hash: the hash must never be dropped to show the first screen sooner.
743
+ */
744
+ function readsFingerprintResult(flow) {
745
+ return flow.mandatoryConsentCheck !== false;
746
+ }
747
+ function prependMandatoryConsent(flow) {
748
+ if (!readsFingerprintResult(flow)) return flow;
749
+ const fingerprintResult = getSessionFingerprintResult();
750
+ if (!fingerprintResult?.showMandatoryConsent) return flow;
751
+ if (flow.flowModules.find((module) => module.key === "MANDATORY_CONSENT")) return flow;
752
+ const mandatoryConsentModule = {
753
+ key: "MANDATORY_CONSENT",
754
+ configuration: { consentType: toRegulationType(fingerprintResult.regulationType) }
755
+ };
756
+ return {
757
+ ...flow,
758
+ flowModules: [mandatoryConsentModule, ...flow.flowModules]
759
+ };
760
+ }
761
+ /**
762
+ * Deferred counterpart of the activation steps `getFlow` performs when
763
+ * `deferActivation` is off: waits for session activation, sends the flow id to
764
+ * feature management, waits for the device fingerprint, then inserts
765
+ * MANDATORY_CONSENT where `getFlow` would have put it — first, or right after an
766
+ * injected REDIRECT_TO_MOBILE (normalization adds that one in front of
767
+ * everything). Returns the same object when nothing is injected.
768
+ */
769
+ async function completeDeferredActivation(flow, signal) {
770
+ const awaitFingerprint = readsFingerprintResult(flow);
771
+ await initializeSession({
772
+ signal,
773
+ awaitFingerprint
774
+ }).catch(() => void 0);
775
+ throwIfAborted(signal);
776
+ await updateFeatureManagementUser({ customIDs: { flow_id: flow.flowId } });
777
+ throwIfAborted(signal);
778
+ if (awaitFingerprint) {
779
+ await whenSessionFingerprintSettled();
780
+ throwIfAborted(signal);
781
+ }
782
+ const withConsent = prependMandatoryConsent(flow);
783
+ if (withConsent === flow) return flow;
784
+ const [consent, ...rest] = withConsent.flowModules;
785
+ if (rest[0]?.key !== "REDIRECT_TO_MOBILE") return withConsent;
786
+ return {
787
+ ...flow,
788
+ flowModules: [
789
+ rest[0],
790
+ consent,
791
+ ...rest.slice(1)
792
+ ]
793
+ };
794
+ }
795
+ function requireActiveToken() {
796
+ const token = getToken();
797
+ if (!token) throw new Error("Standalone module configuration requires an active Flow session");
798
+ return token;
799
+ }
800
+ function fetchOnboardingStatus(signal) {
801
+ return api.get(endpoints.onboardingStatus, { signal }).then((res) => res.data);
802
+ }
803
+ /**
804
+ * `statusPromise` is started alongside the flow fetch so the check does not
805
+ * add a round trip after it; the flow only decides whether the answer matters
806
+ * (`enableMultipleOnboardings`), so its failure is reported only when it does.
807
+ */
808
+ async function assertSessionCanStart(flow, statusPromise) {
809
+ if (flow.enableMultipleOnboardings) return;
810
+ let data;
811
+ try {
812
+ data = await statusPromise;
813
+ } catch (error) {
814
+ toIncodeApiError(endpoints.onboardingStatus, error);
815
+ }
816
+ if (data.onboardingStatus === "ONBOARDING_FINISHED") throw new FlowSessionFinishedError();
817
+ }
818
+ function validateRawFlow(data) {
819
+ if (!data || typeof data.flowId !== "string" || data.flowId.length === 0) throw new Error("No Flow is configured for the active session");
820
+ if (!Array.isArray(data.flowModules)) throw new Error("No Flow is configured for the active session");
821
+ return data;
822
+ }
823
+ async function fetchRawDashboardFlow() {
824
+ try {
825
+ return validateRawFlow((await api.get(endpoints.flow)).data);
826
+ } catch (error) {
827
+ toIncodeApiError(endpoints.flow, error);
828
+ }
829
+ }
830
+ function createAbortError() {
831
+ const error = /* @__PURE__ */ new Error("The operation was aborted");
832
+ error.name = "AbortError";
833
+ return error;
834
+ }
835
+ function throwIfAborted(signal) {
836
+ if (signal?.aborted) throw createAbortError();
837
+ }
838
+ function waitForSharedPromise(promise, signal) {
839
+ if (!signal) return promise;
840
+ if (signal.aborted) return Promise.reject(createAbortError());
841
+ return new Promise((resolve, reject) => {
842
+ const onAbort = () => reject(createAbortError());
843
+ signal.addEventListener("abort", onAbort, { once: true });
844
+ promise.then((value) => {
845
+ signal.removeEventListener("abort", onAbort);
846
+ resolve(value);
847
+ }, (error) => {
848
+ signal.removeEventListener("abort", onAbort);
849
+ reject(error);
850
+ });
851
+ });
852
+ }
853
+ function preloadDashboardFlow(signal) {
854
+ const token = requireActiveToken();
855
+ if (dashboardFlowCache?.token === token) return waitForSharedPromise(dashboardFlowCache.promise, signal);
856
+ const request = fetchRawDashboardFlow();
857
+ request.then(warmFirstModule, () => void 0);
858
+ const cache = {
859
+ token,
860
+ promise: request
861
+ };
862
+ const promise = request.catch((error) => {
863
+ if (dashboardFlowCache === cache) dashboardFlowCache = void 0;
864
+ throw error;
865
+ });
866
+ cache.promise = promise;
867
+ dashboardFlowCache = cache;
868
+ return waitForSharedPromise(promise, signal);
869
+ }
870
+ function resetDashboardFlowCache() {
871
+ dashboardFlowCache = void 0;
872
+ }
873
+ async function normalizeDashboardFlow(rawFlow, options, signal) {
874
+ throwIfAborted(signal);
875
+ let flow = rawFlow;
876
+ if (options.deferActivation !== true) {
877
+ const awaitFingerprint = readsFingerprintResult(rawFlow);
878
+ await initializeSession({
879
+ signal,
880
+ awaitFingerprint
881
+ }).catch(() => void 0);
882
+ throwIfAborted(signal);
883
+ await updateFeatureManagementUser({ customIDs: { flow_id: rawFlow.flowId } });
884
+ throwIfAborted(signal);
885
+ if (awaitFingerprint) {
886
+ await whenSessionFingerprintSettled();
887
+ throwIfAborted(signal);
888
+ }
889
+ flow = prependMandatoryConsent(rawFlow);
890
+ }
891
+ const normalizedModules = normalizeFlowModules(flow, options);
892
+ throwIfAborted(signal);
893
+ return {
894
+ ...flow,
895
+ flowModules: normalizedModules
896
+ };
897
+ }
898
+ /**
899
+ * Starts what the first module requests before its first screen, while
900
+ * activation still runs, so that screen skips a second round trip.
901
+ */
902
+ function warmFirstModule(flow) {
903
+ if (getFirstFlowModuleKey(flow) === "PHONE") {
904
+ loadPhoneValidation();
905
+ prefetchStartInfo();
906
+ }
907
+ }
908
+ const getFlow = async (signal, options = {}) => {
909
+ throwIfAborted(signal);
910
+ const rawFlowPromise = preloadDashboardFlow(signal);
911
+ const statusPromise = fetchOnboardingStatus(signal);
912
+ statusPromise.catch(() => void 0);
913
+ const rawFlow = await rawFlowPromise;
914
+ throwIfAborted(signal);
915
+ await assertSessionCanStart(rawFlow, statusPromise);
916
+ throwIfAborted(signal);
917
+ return normalizeDashboardFlow(rawFlow, options, signal);
918
+ };
919
+ function getResolverModuleKeys(moduleKey) {
920
+ if (moduleKey === "TUTORIAL_ID") return ["ID"];
921
+ if (moduleKey === "GOVT_VALIDATION_PROVISIONING") return ["GOVT_VALIDATION_PROVISIONING", "INE_VALIDATION"];
922
+ if (moduleKey === "DOCUMENT_CAPTURE") return ["DOCUMENT_CAPTURE", "ADDRESS"];
923
+ if (moduleKey === "MANDATORY_CONSENT") return ["MANDATORY_CONSENT", "ML_CONSENT"];
924
+ return [moduleKey];
925
+ }
926
+ async function resolveDashboardModuleConfig(options) {
927
+ const flowPolicy = getStandaloneFlowPolicy();
928
+ if (options.config !== void 0 && !flowPolicy.mergeConfig) return options.config;
929
+ if (!flowPolicy.enabled) throw new Error("Flow-backed module configuration is disabled; provide config or manager");
930
+ let flow;
931
+ try {
932
+ throwIfAborted(options.signal);
933
+ const rawFlow = await preloadDashboardFlow(options.signal);
934
+ throwIfAborted(options.signal);
935
+ flow = await normalizeDashboardFlow(rawFlow, { isDesktop: options.moduleKey === "REDIRECT_TO_MOBILE" }, options.signal);
936
+ throwIfAborted(options.signal);
937
+ } catch (error) {
938
+ if (error instanceof Error && error.name === "AbortError") throw error;
939
+ throw new Error("Standalone module configuration requires an active Flow session");
940
+ }
941
+ const moduleKeys = getResolverModuleKeys(options.moduleKey);
942
+ const occurrence = options.occurrence ?? 0;
943
+ const module = flow.flowModules.filter((module) => moduleKeys.includes(module.key))[occurrence];
944
+ if (!module) throw new Error(`Module "${options.moduleKey}" is not enabled in the active Flow`);
945
+ await loadFlowConfigConverters(flow);
946
+ const flowConfig = resolveFlowModuleConfig(module, flow);
947
+ if (flowPolicy.mergeConfig) return mergeDashboardConfig(flowConfig, options.config);
948
+ return flowConfig;
949
+ }
950
+ //#endregion
951
+ export { mergeDashboardConfig as S, resolveFlowModuleConfig as _, resolveDashboardModuleConfig as a, videoSelfieWasmPipelines as b, decideFlowPresets as c, stepsThatMayRunNext as d, enrichFlowModuleConfig as f, normalizeFlowModules as g, loadFlowConfigConverters as h, resetDashboardFlowCache as i, flowPresetAnalyticsModule as l, getRequiredWasmPipelines as m, getFlow as n, applyFlowPresets as o, getNextRequiredWasmPipelines as p, preloadDashboardFlow as r, armFlowPresets as s, completeDeferredActivation as t, getFirstFlowModuleKey as u, facingModeForStep as v, applyModulesConfig as x, resolveVideoSelfieSteps as y };