@incodetech/core 2.4.1-agentic → 2.4.1-agentic.10

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 (239) hide show
  1. package/dist/{BaseWasmProvider-Bq3OHo7P.d.ts → BaseWasmProvider-bBNquvYn.d.ts} +2 -2
  2. package/dist/BrowserNetworkStatusProvider-BrDXBEDd.esm.js +21 -0
  3. package/dist/{multipartRecordingService-DMBxHKS2.esm.js → CameraCompositor-DN7NkJzV.esm.js} +7 -734
  4. package/dist/DateFormattingProvider-DPq9zco-.esm.js +25 -0
  5. package/dist/{FaceDetectionProvider-B83VmClw.esm.js → FaceDetectionProvider-BSLpXAGx.esm.js} +11 -12
  6. package/dist/{IIdCaptureCapability-CGcEt2Cw.d.ts → IIdCaptureCapability-C-5M8pP1.d.ts} +2 -2
  7. package/dist/{IWasmUtilCapability-Cqiaxydi.d.ts → IWasmUtilCapability-BRn0wz8v.d.ts} +2 -2
  8. package/dist/MultipartRecordingProvider-BfQPSgSO.esm.js +151 -0
  9. package/dist/{StreamCanvasCapture-C3xNfOsv.d.ts → StreamCanvasCapture-ixfy84ys.d.ts} +2 -2
  10. package/dist/StreamCanvasProcessingSession-CBnbTnOr.esm.js +42 -0
  11. package/dist/{WasmUtilProvider-GTkoJyFY.esm.js → WasmUtilProvider-C_puwvVn.esm.js} +2 -2
  12. package/dist/WorkerEncoderRecordingProvider-CyCrQnZR.esm.js +80 -0
  13. package/dist/addressSearch-B_4JYKa-.esm.js +72 -0
  14. package/dist/ae-signature.esm.js +1 -1
  15. package/dist/antifraud.esm.js +2 -2
  16. package/dist/{antifraudManager-CQ08atTC.esm.js → antifraudManager-BWCVkSu2.esm.js} +2 -2
  17. package/dist/{antifraudStateMachine-BcsUTTIr.esm.js → antifraudStateMachine-CX9I2f3s.esm.js} +1 -1
  18. package/dist/{api-BO8JA7Pf.esm.js → api-BSnbg4HO.esm.js} +4 -0
  19. package/dist/{apiError-CfuIvnUy.esm.js → apiError-Bmwy1Fa7.esm.js} +1 -1
  20. package/dist/{attemptCarry-BjTJ6bMQ.esm.js → attemptCarry-zQH85Elh.esm.js} +2 -2
  21. package/dist/authentication.d.ts +3 -3
  22. package/dist/authentication.esm.js +2 -2
  23. package/dist/{authenticationManager-DvmklBTE.esm.js → authenticationManager-BoiOaB0m.esm.js} +5 -5
  24. package/dist/{authenticationManager-C-cOki0Y.d.ts → authenticationManager-CISxaY6N.d.ts} +1 -1
  25. package/dist/{authenticationStateMachine-BL2ptOA0.esm.js → authenticationStateMachine-BMD1JLwr.esm.js} +3 -3
  26. package/dist/avatar.d.ts +1 -1
  27. package/dist/backCameraLabel-yda5ugE4.esm.js +67 -0
  28. package/dist/{backCameraStream-C5_NNfUN.esm.js → backCameraStream-DS1oDiUq.esm.js} +10 -65
  29. package/dist/{browser-pQZA35G2-DtkAf6sn.esm.js → browser-pQZA35G2-PIj2uGBm.esm.js} +1 -1
  30. package/dist/camera.d.ts +2 -2
  31. package/dist/camera.esm.js +1 -1
  32. package/dist/certificate-issuance.esm.js +2 -2
  33. package/dist/{certificateIssuanceManager-CM0fuqDC.esm.js → certificateIssuanceManager-DzDuQTsK.esm.js} +2 -2
  34. package/dist/{certificateIssuanceStateMachine-kksIUOPD.esm.js → certificateIssuanceStateMachine-BAOYLACb.esm.js} +2 -2
  35. package/dist/{connectivity-HSl0diCx.esm.js → connectivity-BCuEoQ-n.esm.js} +2 -21
  36. package/dist/consent.d.ts +1 -1
  37. package/dist/consent.esm.js +2 -2
  38. package/dist/{consentManager-_q9yJUku.d.ts → consentManager-7aHaehwF.d.ts} +5 -5
  39. package/dist/{consentManager-CBwFozhv.esm.js → consentManager-DFSKQTcR.esm.js} +2 -2
  40. package/dist/{consentStateMachine-CpmRAcr2.esm.js → consentStateMachine-4nZIH2O8.esm.js} +1 -1
  41. package/dist/{cpf-uAZTPUBy.esm.js → cpf-BIADjddF.esm.js} +1 -25
  42. package/dist/{createFaceAvatar-lYX0VTYs.d.ts → createFaceAvatar-BimBTONm.d.ts} +1 -1
  43. package/dist/cross-document-data-match.esm.js +1 -1
  44. package/dist/{crossDocumentDataMatchManager-64O8t10a.esm.js → crossDocumentDataMatchManager-D7ka2qOC.esm.js} +2 -2
  45. package/dist/curp-validation.d.ts +1 -1
  46. package/dist/curp-validation.esm.js +2 -2
  47. package/dist/{curpValidationManager-CLgJQcx0.esm.js → curpValidationManager-BVTt7IgC.esm.js} +2 -2
  48. package/dist/{curpValidationManager-CXpFE-Mv.d.ts → curpValidationManager-DEqTUWdu.d.ts} +1 -1
  49. package/dist/{curpValidationStateMachine-Bx9YhVkJ.esm.js → curpValidationStateMachine-FB_MRbZQ.esm.js} +2 -2
  50. package/dist/custom-fields.esm.js +1 -1
  51. package/dist/custom-watchlist.esm.js +2 -2
  52. package/dist/{customFieldsManager-DWt_0YtJ.esm.js → customFieldsManager-gbsq53p6.esm.js} +2 -2
  53. package/dist/{customWatchlistManager-D8o-2Nej.esm.js → customWatchlistManager-50APwk4Z.esm.js} +2 -2
  54. package/dist/{customWatchlistStateMachine-Sbi6DIcK.esm.js → customWatchlistStateMachine-CpEVPzuT.esm.js} +1 -1
  55. package/dist/{deepsightService-twg3bXqY.esm.js → deepsightLoader-BKCT8UT1.esm.js} +34 -29
  56. package/dist/definitionSource-BHNxbuiv.esm.js +184 -0
  57. package/dist/{desktopCameraElection-kHY2IDJi.esm.js → desktopCameraElection-Dvvw7PRY.esm.js} +5 -5
  58. package/dist/document-capture.d.ts +3 -3
  59. package/dist/document-capture.esm.js +2 -2
  60. package/dist/{documentCaptureManager-CMSC_Mhd.esm.js → documentCaptureManager-BG5TuqJz.esm.js} +3 -2
  61. package/dist/{documentCaptureManager-6tnnDkMX.d.ts → documentCaptureManager-DDfviFg0.d.ts} +25 -4
  62. package/dist/{documentCaptureStateMachine-BCwD5Rto.esm.js → documentCaptureStateMachine-C7PW_Ah9.esm.js} +67 -26
  63. package/dist/dynamic-forms.esm.js +2 -2
  64. package/dist/{dynamicFormsManager-DU6W1e20.esm.js → dynamicFormsManager-B0bpHhhJ.esm.js} +2 -2
  65. package/dist/{dynamicFormsStateMachine-C8Z7k3vo.esm.js → dynamicFormsStateMachine-2ZHyejBc.esm.js} +2 -2
  66. package/dist/ekyb.d.ts +4 -4
  67. package/dist/ekyb.esm.js +3 -3
  68. package/dist/{ekybManager-TB6ZG5lX.d.ts → ekybManager-BLOkwmWO.d.ts} +2 -2
  69. package/dist/{ekybManager-TGfqyjuu.esm.js → ekybManager-P9mC7W9J.esm.js} +2 -2
  70. package/dist/{ekybStateMachine-DBgFuEPK.esm.js → ekybStateMachine-C7HKaeVr.esm.js} +7 -3
  71. package/dist/ekybUtils-Cw8Ta9Qi.esm.js +140 -0
  72. package/dist/ekyc-prefill.d.ts +17 -0
  73. package/dist/ekyc-prefill.esm.js +3 -0
  74. package/dist/ekyc.d.ts +3 -2
  75. package/dist/ekyc.esm.js +3 -3
  76. package/dist/{ekycManager-C2cgG2Pl.esm.js → ekycManager-CeeJoRFY.esm.js} +2 -2
  77. package/dist/{ekycManager-BSQteIfC.d.ts → ekycManager-q1fos6IY.d.ts} +2 -1
  78. package/dist/ekycPrefillManager-C6BFFKxc.esm.js +102 -0
  79. package/dist/ekycPrefillManager-PPGVZbWk.d.ts +565 -0
  80. package/dist/ekycPrefillStateMachine-Dku90kZL.esm.js +686 -0
  81. package/dist/ekycRules-BLX7Elcb.esm.js +319 -0
  82. package/dist/{ekycStateMachine-CuNF7z4O.esm.js → ekycStateMachine-DBTczgGE.esm.js} +719 -596
  83. package/dist/{ekycUtils-BFncpC4F.esm.js → ekycUtils-Dcff8BOD.esm.js} +103 -14
  84. package/dist/electronic-signature.esm.js +1 -1
  85. package/dist/{electronicSignatureManager-C7pqXsRm.esm.js → electronicSignatureManager-BKQuhJm_.esm.js} +4 -4
  86. package/dist/email.esm.js +2 -2
  87. package/dist/{emailManager-FH_CP0cT.esm.js → emailManager-CGmKbsBL.esm.js} +2 -2
  88. package/dist/{emailStateMachine-Cx-uTaBV.esm.js → emailStateMachine-CGY1UGs2.esm.js} +2 -2
  89. package/dist/{events-CQteqXfy.esm.js → events-C7h7oaTE.esm.js} +1 -1
  90. package/dist/events.esm.js +1 -1
  91. package/dist/extensibility.d.ts +20 -18
  92. package/dist/extensibility.esm.js +37 -35
  93. package/dist/{externalFetch-CQY41QT1.esm.js → externalFetch-cUjJYyXj.esm.js} +1 -1
  94. package/dist/face-match.d.ts +1 -1
  95. package/dist/face-match.esm.js +2 -2
  96. package/dist/{faceCaptureManagerFactory-C-xKdj-d.d.ts → faceCaptureManagerFactory-BVwVGa3z.d.ts} +7 -7
  97. package/dist/{faceCaptureManagerFactory-CBm05KnT.esm.js → faceCaptureManagerFactory-ClFsByZc.esm.js} +4 -4
  98. package/dist/{faceCaptureSetup-BQjCbL51.esm.js → faceCaptureSetup-9hv5GC_H.esm.js} +12 -403
  99. package/dist/{faceMatchManager-Z4UDLwAv.d.ts → faceMatchManager-BZtEw6bB.d.ts} +9 -3
  100. package/dist/{faceMatchManager-B2zp7yP4.esm.js → faceMatchManager-CRe7Nvm6.esm.js} +2 -2
  101. package/dist/{faceMatchStateMachine-ByTMQCUC.esm.js → faceMatchStateMachine-EX9QhxFE.esm.js} +28 -14
  102. package/dist/{feature-management-DjAG5lsJ.esm.js → feature-management-CmKTG_T5.esm.js} +35 -21
  103. package/dist/feature-management.esm.js +1 -1
  104. package/dist/field-comparison.esm.js +1 -1
  105. package/dist/{fieldComparisonManager-CC0vKmpf.esm.js → fieldComparisonManager-DuosZJso.esm.js} +2 -2
  106. package/dist/fiscal-qr.esm.js +1 -1
  107. package/dist/{fiscalQrManager-Be-r4oZj.esm.js → fiscalQrManager-ji0qDaTW.esm.js} +3 -3
  108. package/dist/flow-events.d.ts +1 -1
  109. package/dist/flow.d.ts +33 -18
  110. package/dist/flow.esm.js +82 -17
  111. package/dist/{flowCompletionService-ChMU2v79.esm.js → flowCompletionService-DvcH16XO.esm.js} +24 -3
  112. package/dist/{flowServices-g2tVWsJl.esm.js → flowServices-Ca2vKNt2.esm.js} +84 -139
  113. package/dist/geolocation.esm.js +2 -2
  114. package/dist/{geolocationManager-DLbvZwUB.esm.js → geolocationManager-CiG32lIm.esm.js} +2 -2
  115. package/dist/{geolocationStateMachine-CAJVongM.esm.js → geolocationStateMachine-5rnTEOuw.esm.js} +3 -3
  116. package/dist/government-validation.esm.js +2 -2
  117. package/dist/{governmentValidationManager-CkX9TEkh.esm.js → governmentValidationManager-BivVZNVe.esm.js} +2 -2
  118. package/dist/{governmentValidationStateMachine-PTPCP26N.esm.js → governmentValidationStateMachine-CeSDNgha.esm.js} +1 -1
  119. package/dist/home.d.ts +1 -1
  120. package/dist/home.esm.js +1 -1
  121. package/dist/http.esm.js +1 -1
  122. package/dist/id-ocr.d.ts +2 -2
  123. package/dist/id-ocr.esm.js +3 -19
  124. package/dist/id-selfie-flow.d.ts +3 -3
  125. package/dist/id-selfie-flow.esm.js +10 -9
  126. package/dist/id-verification.esm.js +2 -2
  127. package/dist/id.d.ts +4 -4
  128. package/dist/id.esm.js +4 -4
  129. package/dist/{idCaptureDefaults-MSQoqScU.esm.js → idCaptureDefaults-DBnOC28H.esm.js} +3 -3
  130. package/dist/{idCaptureManager-zZdTcpG1.esm.js → idCaptureManager-B5xqok0L.esm.js} +9 -8
  131. package/dist/{idCaptureManager-DzTfQ1Am.d.ts → idCaptureManager-CG8zbAp0.d.ts} +10 -8
  132. package/dist/{idCaptureServices-8OHinO0N.esm.js → idCaptureServices-BIF_7rub.esm.js} +27 -196
  133. package/dist/{idCaptureStateMachine-B3G6XoDG.esm.js → idCaptureStateMachine-B5cfgKvn.esm.js} +50 -22
  134. package/dist/idOcrCpfUtils-Nfln1Psb.esm.js +18 -0
  135. package/dist/{idOcrManager-DT3kPIB3.d.ts → idOcrManager-B5xeI2lg.d.ts} +3 -3
  136. package/dist/{idOcrManager-B64-fjWg.esm.js → idOcrManager-DNbVTMIu.esm.js} +2 -2
  137. package/dist/{idOcrStateMachine-B1aZnobs.esm.js → idOcrStateMachine-MAGnpWkb.esm.js} +8 -7
  138. package/dist/{idVerificationManager-_Kebv-Ue.esm.js → idVerificationManager-BEAkamNm.esm.js} +2 -2
  139. package/dist/{idVerificationStateMachine-DQn6c84z.esm.js → idVerificationStateMachine-D5mBN2Ye.esm.js} +1 -1
  140. package/dist/identity-reuse.esm.js +2 -2
  141. package/dist/{identityReuseManager-DDXkNVZi.esm.js → identityReuseManager-M8-BTjar.esm.js} +2 -2
  142. package/dist/{identityReuseStateMachine-Bcnkbjf8.esm.js → identityReuseStateMachine-D5bXgw9h.esm.js} +1 -1
  143. package/dist/{index-DEfwds5y.d.ts → index-Btj1EhiM.d.ts} +43 -19
  144. package/dist/{index-DMDAk85K.d.ts → index-CSPOoqah.d.ts} +1 -1
  145. package/dist/index.d.ts +1 -1
  146. package/dist/index.esm.js +1 -1
  147. package/dist/{invokeOnCaptureCallback-CXIBwBeE.esm.js → invokeOnCaptureCallback-C1-j4fsq.esm.js} +1 -1
  148. package/dist/kyb-checks.d.ts +3 -0
  149. package/dist/kyb-checks.esm.js +3 -0
  150. package/dist/kybChecksManager-CblEL97E.d.ts +95 -0
  151. package/dist/kybChecksManager-CnqwgKoV.esm.js +89 -0
  152. package/dist/kybChecksStateMachine-Be41K_NS.esm.js +719 -0
  153. package/dist/mandatory-consent.d.ts +2 -2
  154. package/dist/mandatory-consent.esm.js +2 -2
  155. package/dist/{mandatoryConsentManager-xx3mY-xw.d.ts → mandatoryConsentManager-CYOJd_IZ.d.ts} +20 -11
  156. package/dist/{mandatoryConsentManager-43W5d_8G.esm.js → mandatoryConsentManager-LFhUlLvO.esm.js} +2 -2
  157. package/dist/{mandatoryConsentStateMachine-CVlgdlnt.esm.js → mandatoryConsentStateMachine-DTSyDqQs.esm.js} +11 -5
  158. package/dist/mediaRecorderOptions-B9-IEVtV.esm.js +70 -0
  159. package/dist/multipartRecordingService-CCiRpByl.esm.js +407 -0
  160. package/dist/{permissionGuards-B3OPL8Si.esm.js → permissionGuards-DjQUR1du.esm.js} +1 -1
  161. package/dist/{permissionServices-DnBAN_hW.esm.js → permissionServices-CZpORUWY.esm.js} +8 -6
  162. package/dist/phone.esm.js +2 -2
  163. package/dist/phoneFormat-DEpESpz2.esm.js +87 -0
  164. package/dist/{phoneManager-C6jut_pz.esm.js → phoneManager-C-qD3p3N.esm.js} +3 -3
  165. package/dist/phoneServices-BdR1nmSO.esm.js +77 -0
  166. package/dist/{phoneStateMachine-T1-drWfG.esm.js → phoneStateMachine-2FMTdjtJ.esm.js} +20 -60
  167. package/dist/{processFaceMatch-BWme3kVV.esm.js → processFaceMatch-B1YnoBer.esm.js} +1 -1
  168. package/dist/qe-signature.esm.js +1 -1
  169. package/dist/recordingService-BVSCo0ac.esm.js +397 -0
  170. package/dist/redirect-to-mobile.esm.js +2 -2
  171. package/dist/{redirectToMobileManager-BJXC6Kx9.esm.js → redirectToMobileManager-CqyDfDxs.esm.js} +3 -3
  172. package/dist/{redirectToMobileStateMachine-BBMAc2Gb.esm.js → redirectToMobileStateMachine-CXqfo2Gd.esm.js} +40 -22
  173. package/dist/resolveForm-f9PhUo9j.esm.js +143 -0
  174. package/dist/{runChildModule-DPHTqSdF.esm.js → runChildModule-BmteMhR7.esm.js} +2 -2
  175. package/dist/{sdkVersion-C3_P-Qbq.esm.js → sdkVersion-KZROt6l3.esm.js} +1 -1
  176. package/dist/selfie.d.ts +4 -4
  177. package/dist/selfie.esm.js +10 -10
  178. package/dist/{selfieErrorUtils-BL0BLMnp.esm.js → selfieErrorUtils-fqxp645p.esm.js} +1 -1
  179. package/dist/{selfieManager-Cbliomv7.esm.js → selfieManager-A-n3k9Tu.esm.js} +5 -5
  180. package/dist/{selfieManager-BMmpUii2.d.ts → selfieManager-DREuBhXZ.d.ts} +1 -1
  181. package/dist/{selfieStateMachine-B5m_Kn0O.esm.js → selfieStateMachine-48PKdKrw.esm.js} +3 -3
  182. package/dist/{session-DAaAewMX.esm.js → session-D0DWDKp9.esm.js} +4 -4
  183. package/dist/session.d.ts +2 -2
  184. package/dist/session.esm.js +6 -6
  185. package/dist/{sessionInitializer-CWFT4dfw.esm.js → sessionInitializer-I92b2dmL.esm.js} +94 -24
  186. package/dist/{setup-CDAKwTr7.esm.js → setup-BpjzWqR1.esm.js} +25 -27
  187. package/dist/{setup-D9qt8YVU.d.ts → setup-CG6oLkAa.d.ts} +2 -2
  188. package/dist/signature.esm.js +2 -2
  189. package/dist/{signatureManager-BeEVCcsC.esm.js → signatureManager-M9vQBj19.esm.js} +2 -2
  190. package/dist/{signatureStateMachine-_1c1vSid.esm.js → signatureStateMachine-0_frzAN5.esm.js} +1 -1
  191. package/dist/{stats-BpMz-hTP.esm.js → stats-C2sigf9p.esm.js} +1 -1
  192. package/dist/stats.esm.js +1 -1
  193. package/dist/step-up.d.ts +378 -0
  194. package/dist/step-up.esm.js +639 -0
  195. package/dist/textRules-D4NRinKY.d.ts +41 -0
  196. package/dist/{tri-BajQnjbf.esm.js → tri-DaUNvo-o.esm.js} +29 -34
  197. package/dist/tri.d.ts +2 -2
  198. package/dist/tri.esm-Df5eKLsY.esm.js +2165 -0
  199. package/dist/tri.esm.js +2 -2
  200. package/dist/{trueSightService-BujtUIW6.esm.js → trueSightService-DHYTBCIn.esm.js} +4 -4
  201. package/dist/trust-graph.esm.js +1 -1
  202. package/dist/types-B-PIc0en.d.ts +115 -0
  203. package/dist/{types-C397LhmN.d.ts → types-BgRHw-dR.d.ts} +1 -1
  204. package/dist/{types-CJ7Yl9K-.d.ts → types-Bpo97EOh.d.ts} +4 -2
  205. package/dist/{types-xEEWCx1j.d.ts → types-BqlZSoZ-.d.ts} +5 -5
  206. package/dist/types-CTaL0XJz.d.ts +80 -0
  207. package/dist/{types-e8fCsvvk.d.ts → types-Cbm9J2yF.d.ts} +1 -1
  208. package/dist/{types--3HDl2SF.d.ts → types-CgihAhT_.d.ts} +3 -3
  209. package/dist/{types-ZTZelfbM.d.ts → types-CyNndVAT.d.ts} +14 -6
  210. package/dist/{types-B2FK_wYb.d.ts → types-DEa3taWc.d.ts} +9 -41
  211. package/dist/{types-PTZHRhGX.d.ts → types-P9LzsfRo.d.ts} +3 -2
  212. package/dist/{types-DuD8TRJU.d.ts → types-TisHEbBg.d.ts} +12 -4
  213. package/dist/types-kLsU6Jkt.d.ts +6 -0
  214. package/dist/{urlUtils-eYiyWjh0.esm.js → urlUtils-B2wagB5v.esm.js} +14 -1
  215. package/dist/usStates-CwOQ2kAx.esm.js +209 -0
  216. package/dist/video-selfie.d.ts +5 -4
  217. package/dist/video-selfie.esm.js +9 -7
  218. package/dist/{videoSelfieCameraWarmer-DjkPpoj_.esm.js → videoSelfieCameraWarmer-CTOpqhov.esm.js} +16 -14
  219. package/dist/{videoSelfieStepDetector-RfSmlFFW.d.ts → videoSelfieStepDetector-4XE2QI5q.d.ts} +4 -4
  220. package/dist/virtualCameraCheck-eFOm2C9q.esm.js +27 -0
  221. package/dist/{warmup-BkfxQZsC.esm.js → warmup-9iKKNNuW.esm.js} +69 -20
  222. package/dist/{warmup-BO57syF6.d.ts → warmup-BNhIuURi.d.ts} +18 -2
  223. package/dist/wasm.d.ts +9 -3
  224. package/dist/wasm.esm.js +3 -3
  225. package/dist/{wasmDsFlagSync-BhU5H2oR.esm.js → wasmDsFlagSync-lRIgn5Ic.esm.js} +1 -1
  226. package/dist/{wasmWebClient-DTj9auyA.esm.js → wasmWebClient-C3v3s_4H.esm.js} +34 -19
  227. package/dist/watchlist-for-business.esm.js +2 -2
  228. package/dist/watchlist.esm.js +2 -2
  229. package/dist/{watchlistForBusinessManager-CVay6-9A.esm.js → watchlistForBusinessManager-C1S5y5yj.esm.js} +2 -2
  230. package/dist/{watchlistForBusinessStateMachine-DA6K5na4.esm.js → watchlistForBusinessStateMachine-Bj_hnoK5.esm.js} +1 -1
  231. package/dist/{watchlistManager-B8gQ_rw3.esm.js → watchlistManager-BpegtZbc.esm.js} +2 -2
  232. package/dist/{watchlistStateMachine-CSi_ZhtT.esm.js → watchlistStateMachine-Bgkh1gra.esm.js} +1 -1
  233. package/dist/workflow.d.ts +226 -41
  234. package/dist/workflow.esm.js +163 -67
  235. package/package.json +21 -5
  236. package/dist/addressSearch-41sMcnJk.esm.js +0 -604
  237. package/dist/deepsightLoader-DMxtowCm.esm.js +0 -33
  238. package/dist/tri.esm-CzTNi5Q_.esm.js +0 -3826
  239. package/dist/types-D9r3zRfY.d.ts +0 -6
@@ -0,0 +1,639 @@
1
+ import { i as assign, s as createActor, t as setup, u as createManager } from "./xstate.esm-DSajW7CJ.esm.js";
2
+ import { n as getHttpUrlOrigin } from "./urlUtils-B2wagB5v.esm.js";
3
+ //#region src/modules/step-up/stepUpStateMachine.ts
4
+ /** The SDK draws the permissions, before the face check. */
5
+ function permissionsFirst(context) {
6
+ return context.permissionsUi === "sdk" && context.permissionsOrder === "beforeFaceCheck";
7
+ }
8
+ function allScopeNames(permissions) {
9
+ return permissions.scopes.map((scope) => scope.name);
10
+ }
11
+ /** The scopes that start ticked (`autoSelect` or `auto-select`), in class order. */
12
+ function preselectedScopes(permissions) {
13
+ return permissions.scopes.filter((scope) => scope.autoSelect === true || scope.selectionMode === "auto-select").map((scope) => scope.name);
14
+ }
15
+ /** The agent class's scopes that `approvedScopes` names, in the class order. */
16
+ function knownScopes(permissions, approvedScopes) {
17
+ return allScopeNames(permissions).filter((name) => approvedScopes.includes(name));
18
+ }
19
+ /**
20
+ * Step-up flow: verify the person (workflow or hosted page, driven by the UI)
21
+ * and let them approve the agent class's scopes, in the order
22
+ * `permissionsOrder` sets: `afterFaceCheck` (verifying → permissions →
23
+ * finished) or `beforeFaceCheck` (permissions → verifying → finished, so Deny
24
+ * ends the step-up before any face check).
25
+ *
26
+ * - `verifying` — the workflow or iframe is on screen. In hosted mode the
27
+ * hosted page draws the permissions itself and reports the result
28
+ * (`HOSTED_FINISHED` / `HOSTED_DENIED`).
29
+ * - `permissions` — the scope checkboxes; the ones Incode marked `autoSelect`
30
+ * start checked (from the agent class's scope selection modes), the rest
31
+ * unchecked. The person may untick any of them, and Approve needs at least
32
+ * one.
33
+ * - `savingPermissions` — only when the host saves the choice: waits for it,
34
+ * then runs the face check (`beforeFaceCheck`) or finishes. A failed save
35
+ * is `error` (`VERIFICATION_ERROR`, `detail.code` `PERMISSIONS_NOT_SAVED`).
36
+ * - `finished` (final) — approved; `selectedScopes` is the result.
37
+ * - `closed` (final) — the user pressed Deny.
38
+ * - `error` — verification failed, is still pending, or could not finish
39
+ * (`errorCode`; not final, per the module convention).
40
+ *
41
+ * With `permissionsUi: 'none'` the machine skips `permissions` and finishes
42
+ * with no scopes (contract v0.2 §6.3): the bank draws its own screen and its
43
+ * server sends its own choice to `/scopes`.
44
+ */
45
+ const stepUpMachine = setup({
46
+ types: {
47
+ context: {},
48
+ events: {},
49
+ input: {}
50
+ },
51
+ guards: {
52
+ bankDrawsPermissions: ({ context }) => context.permissionsUi === "none",
53
+ permissionsFirst: ({ context }) => permissionsFirst(context),
54
+ hasSelection: ({ context }) => context.selectedScopes.length > 0,
55
+ approvedForHostSave: ({ context }) => context.hostSavesPermissions && context.selectedScopes.length > 0,
56
+ approvedBeforeFaceCheck: ({ context }) => permissionsFirst(context) && context.selectedScopes.length > 0,
57
+ hostedApprovalUsable: ({ context, event }) => {
58
+ const { approvedScopes } = event;
59
+ return knownScopes(context.permissions, approvedScopes).length > 0;
60
+ }
61
+ },
62
+ actions: {
63
+ toggleScope: assign(({ context, event }) => {
64
+ const { name } = event;
65
+ const known = allScopeNames(context.permissions);
66
+ if (!context.permissions.scopes.find((candidate) => candidate.name === name)) return {};
67
+ const selected = new Set(context.selectedScopes);
68
+ if (selected.has(name)) selected.delete(name);
69
+ else selected.add(name);
70
+ return { selectedScopes: known.filter((scope) => selected.has(scope)) };
71
+ }),
72
+ setHostedSelection: assign(({ context, event }) => {
73
+ const { approvedScopes } = event;
74
+ return { selectedScopes: knownScopes(context.permissions, approvedScopes) };
75
+ }),
76
+ clearSelection: assign({ selectedScopes: () => [] }),
77
+ setError: assign(({ event }) => {
78
+ const failed = event;
79
+ return {
80
+ error: failed.error,
81
+ errorCode: failed.code,
82
+ errorDetail: failed.detail
83
+ };
84
+ }),
85
+ setSaveError: assign(({ event }) => {
86
+ const { error } = event;
87
+ return {
88
+ error: "The approved permissions could not be saved",
89
+ errorCode: "VERIFICATION_ERROR",
90
+ errorDetail: {
91
+ code: "PERMISSIONS_NOT_SAVED",
92
+ message: error
93
+ }
94
+ };
95
+ }),
96
+ setNoKnownScopesError: assign(({ event }) => {
97
+ const { approvedScopes } = event;
98
+ return {
99
+ error: "The hosted page approved none of the agent class's scopes",
100
+ errorCode: "VERIFICATION_ERROR",
101
+ errorDetail: {
102
+ code: "NO_KNOWN_SCOPES",
103
+ message: `approvedScopes: ${JSON.stringify(approvedScopes)}`
104
+ }
105
+ };
106
+ })
107
+ }
108
+ }).createMachine({
109
+ id: "stepUp",
110
+ initial: "starting",
111
+ context: ({ input }) => ({
112
+ stepUpId: input.stepUpId,
113
+ permissions: input.permissions,
114
+ permissionsUi: input.permissionsUi,
115
+ permissionsOrder: input.permissionsOrder,
116
+ hostSavesPermissions: input.hostSavesPermissions,
117
+ selectedScopes: preselectedScopes(input.permissions),
118
+ error: void 0,
119
+ errorCode: void 0,
120
+ errorDetail: void 0
121
+ }),
122
+ states: {
123
+ starting: { always: [{
124
+ guard: "permissionsFirst",
125
+ target: "permissions"
126
+ }, { target: "verifying" }] },
127
+ verifying: { on: {
128
+ VERIFICATION_FINISHED: [
129
+ {
130
+ guard: "bankDrawsPermissions",
131
+ target: "finished",
132
+ actions: "clearSelection"
133
+ },
134
+ {
135
+ guard: "permissionsFirst",
136
+ target: "finished"
137
+ },
138
+ { target: "permissions" }
139
+ ],
140
+ VERIFICATION_FAILED: {
141
+ target: "error",
142
+ actions: "setError"
143
+ },
144
+ HOSTED_FINISHED: [
145
+ {
146
+ guard: "bankDrawsPermissions",
147
+ target: "finished",
148
+ actions: "clearSelection"
149
+ },
150
+ {
151
+ guard: "hostedApprovalUsable",
152
+ target: "finished",
153
+ actions: "setHostedSelection"
154
+ },
155
+ {
156
+ target: "error",
157
+ actions: "setNoKnownScopesError"
158
+ }
159
+ ],
160
+ HOSTED_DENIED: { target: "closed" }
161
+ } },
162
+ permissions: { on: {
163
+ TOGGLE_SCOPE: { actions: "toggleScope" },
164
+ APPROVE: [
165
+ {
166
+ guard: "approvedForHostSave",
167
+ target: "savingPermissions"
168
+ },
169
+ {
170
+ guard: "approvedBeforeFaceCheck",
171
+ target: "verifying"
172
+ },
173
+ {
174
+ guard: "hasSelection",
175
+ target: "finished"
176
+ }
177
+ ],
178
+ DENY: { target: "closed" }
179
+ } },
180
+ savingPermissions: { on: {
181
+ PERMISSIONS_SAVED: [{
182
+ guard: "permissionsFirst",
183
+ target: "verifying"
184
+ }, { target: "finished" }],
185
+ PERMISSIONS_SAVE_FAILED: {
186
+ target: "error",
187
+ actions: "setSaveError"
188
+ }
189
+ } },
190
+ finished: { type: "final" },
191
+ closed: { type: "final" },
192
+ error: {}
193
+ }
194
+ });
195
+ //#endregion
196
+ //#region src/modules/step-up/stepUpActor.ts
197
+ function createStepUpActor(options) {
198
+ return createActor(stepUpMachine, { input: options }).start();
199
+ }
200
+ //#endregion
201
+ //#region src/modules/step-up/stepUpError.ts
202
+ /**
203
+ * Error passed to the step-up `onError` callback (and thrown for invalid
204
+ * options). `code` is stable; `message` is for developers, not end users.
205
+ * `detail` is what the workflow or hosted page reported underneath (set for
206
+ * `VERIFICATION_ERROR`, and for `FACE_CHECK_FAILED` from the workflow).
207
+ */
208
+ var StepUpError = class extends Error {
209
+ constructor(code, message, stepUpId, detail) {
210
+ super(message);
211
+ this.name = "StepUpError";
212
+ this.code = code;
213
+ this.stepUpId = stepUpId;
214
+ if (detail) this.detail = detail;
215
+ }
216
+ };
217
+ function isStepUpError(error) {
218
+ return error instanceof StepUpError;
219
+ }
220
+ //#endregion
221
+ //#region src/modules/step-up/stepUpOptions.ts
222
+ const MODES = ["embedded", "hosted"];
223
+ const PERMISSIONS_UIS = ["sdk", "none"];
224
+ const PERMISSIONS_ORDERS = ["afterFaceCheck", "beforeFaceCheck"];
225
+ /** Largest delay setTimeout honours; above it browsers fire after ~1 ms. */
226
+ const MAX_TIMER_DELAY_MS = 2147483647;
227
+ function isRecord$1(value) {
228
+ return typeof value === "object" && value !== null && !Array.isArray(value);
229
+ }
230
+ function isNonEmptyString(value) {
231
+ return typeof value === "string" && value.trim().length > 0;
232
+ }
233
+ function optionalString(value) {
234
+ return isNonEmptyString(value) ? value : void 0;
235
+ }
236
+ /** The query part of a URL (between `?` and `#`), or `''`. */
237
+ function queryOf(url) {
238
+ const withoutFragment = url.split("#", 1)[0];
239
+ const index = withoutFragment.indexOf("?");
240
+ return index === -1 ? "" : withoutFragment.slice(index + 1);
241
+ }
242
+ function invalid(message, stepUpId) {
243
+ throw new StepUpError("INVALID_OPTIONS", message, stepUpId);
244
+ }
245
+ function normalizeScope(raw, index) {
246
+ if (!isRecord$1(raw) || !isNonEmptyString(raw.name)) invalid(`consent.scopes[${index}].name must be a non-empty string`);
247
+ const displayName = optionalString(raw.displayName);
248
+ const description = optionalString(raw.description);
249
+ const autoSelect = typeof raw.autoSelect === "boolean" ? raw.autoSelect : void 0;
250
+ const selectionMode = raw.selectionMode === "auto-select" || raw.selectionMode === "dynamic-select" ? raw.selectionMode : void 0;
251
+ return {
252
+ name: raw.name,
253
+ displayName: displayName ?? raw.name,
254
+ ...description ? { description } : {},
255
+ ...autoSelect !== void 0 ? { autoSelect } : {},
256
+ ...selectionMode ? { selectionMode } : {}
257
+ };
258
+ }
259
+ function nonNegativeNumber(value) {
260
+ return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : void 0;
261
+ }
262
+ function normalizeLimit(raw) {
263
+ if (!isRecord$1(raw)) return void 0;
264
+ const budgetLimit = nonNegativeNumber(raw.budgetLimit);
265
+ const usageLimit = nonNegativeNumber(raw.usageLimit);
266
+ const usageLimitLabel = optionalString(raw.usageLimitLabel);
267
+ if (budgetLimit === void 0 && usageLimit === void 0) return void 0;
268
+ return {
269
+ ...budgetLimit !== void 0 ? { budgetLimit } : {},
270
+ ...usageLimit !== void 0 ? { usageLimit } : {},
271
+ ...usageLimit !== void 0 && usageLimitLabel ? { usageLimitLabel } : {}
272
+ };
273
+ }
274
+ /** Display only: a malformed limit is dropped rather than failing the call. */
275
+ function normalizeLimits(raw, scopeNames) {
276
+ if (!isRecord$1(raw)) return void 0;
277
+ const limits = {};
278
+ for (const [name, value] of Object.entries(raw)) {
279
+ const limit = scopeNames.has(name) ? normalizeLimit(value) : void 0;
280
+ if (limit) limits[name] = limit;
281
+ }
282
+ return Object.keys(limits).length > 0 ? limits : void 0;
283
+ }
284
+ /**
285
+ * Checks the consent block from the start response and fills in
286
+ * `displayName` (falls back to the scope name). Keeps each scope's boolean
287
+ * `autoSelect` and known `selectionMode`, and the valid limits of known
288
+ * scopes. Throws `INVALID_OPTIONS` when a required field is missing, or
289
+ * `durationSeconds` is not a positive number.
290
+ */
291
+ function normalizeStepUpPermissions(raw) {
292
+ if (!isRecord$1(raw)) invalid("consent is required");
293
+ const scopesRaw = raw.scopes;
294
+ if (!Array.isArray(scopesRaw) || scopesRaw.length === 0) invalid("consent.scopes must list at least one scope");
295
+ const scopes = scopesRaw.map(normalizeScope);
296
+ const names = new Set(scopes.map((scope) => scope.name));
297
+ if (names.size !== scopes.length) invalid("consent.scopes must not repeat a scope name");
298
+ const { durationSeconds } = raw;
299
+ if (typeof durationSeconds !== "number" || !Number.isFinite(durationSeconds) || durationSeconds <= 0) invalid("consent.durationSeconds must be a positive number");
300
+ const agentClassId = optionalString(raw.agentClassId);
301
+ const purpose = optionalString(raw.purpose);
302
+ const limits = normalizeLimits(raw.limits, names);
303
+ return {
304
+ ...agentClassId ? { agentClassId } : {},
305
+ ...purpose ? { purpose } : {},
306
+ scopes,
307
+ ...limits ? { limits } : {},
308
+ durationSeconds
309
+ };
310
+ }
311
+ /**
312
+ * Exact origin (`scheme://host[:port]`) of an absolute http(s) URL, or
313
+ * `undefined` when the URL is not one.
314
+ */
315
+ function getUrlOrigin(url) {
316
+ return getHttpUrlOrigin(url);
317
+ }
318
+ /**
319
+ * Validates the `renderStepUp` options (everything except the DOM container,
320
+ * which the UI layer checks) and fills in defaults:
321
+ * `mode: 'embedded'`, `permissionsUi: 'sdk'`,
322
+ * `permissionsOrder: 'beforeFaceCheck'` (`'afterFaceCheck'` in hosted mode),
323
+ * `readyTimeoutMs: DEFAULT_STEP_UP_READY_TIMEOUT_MS` (15 s),
324
+ * `disableDashboardTheme: false`.
325
+ *
326
+ * Throws {@link StepUpError} with code `INVALID_OPTIONS`.
327
+ */
328
+ function validateStepUpOptions(raw) {
329
+ if (!isRecord$1(raw)) invalid("options are required");
330
+ const { stepUpId } = raw;
331
+ if (!isNonEmptyString(stepUpId)) invalid("stepUpId must be a non-empty string");
332
+ if (typeof raw.onFinish !== "function") invalid("onFinish must be a function", stepUpId);
333
+ if (raw.onError !== void 0 && typeof raw.onError !== "function") invalid("onError must be a function when given", stepUpId);
334
+ if (raw.onPermissionsApproved !== void 0 && typeof raw.onPermissionsApproved !== "function") invalid("onPermissionsApproved must be a function when given", stepUpId);
335
+ const mode = raw.mode ?? "embedded";
336
+ if (!MODES.includes(mode)) invalid(`mode must be one of ${MODES.join(", ")}`, stepUpId);
337
+ const permissionsUi = raw.permissionsUi ?? "sdk";
338
+ if (!PERMISSIONS_UIS.includes(permissionsUi)) invalid(`permissionsUi must be one of ${PERMISSIONS_UIS.join(", ")}`, stepUpId);
339
+ const permissionsOrder = raw.permissionsOrder ?? (mode === "hosted" ? "afterFaceCheck" : "beforeFaceCheck");
340
+ if (!PERMISSIONS_ORDERS.includes(permissionsOrder)) invalid(`permissionsOrder must be one of ${PERMISSIONS_ORDERS.join(", ")}`, stepUpId);
341
+ if (mode === "hosted" && permissionsOrder === "beforeFaceCheck") invalid("permissionsOrder 'beforeFaceCheck' needs embedded mode", stepUpId);
342
+ const sessionToken = optionalString(raw.sessionToken);
343
+ if (mode === "embedded" && !sessionToken) invalid("sessionToken is required in embedded mode", stepUpId);
344
+ if (raw.interviewId !== void 0 && !isNonEmptyString(raw.interviewId)) invalid("interviewId must be a non-empty string when given", stepUpId);
345
+ let onboardingUrl;
346
+ let onboardingOrigin;
347
+ if (mode === "hosted") {
348
+ if (!isNonEmptyString(raw.onboardingUrl)) invalid("onboardingUrl is required in hosted mode", stepUpId);
349
+ onboardingOrigin = getUrlOrigin(raw.onboardingUrl);
350
+ if (!onboardingOrigin) invalid("onboardingUrl must be an absolute http(s) URL", stepUpId);
351
+ if (sessionToken && queryOf(raw.onboardingUrl).includes(sessionToken)) invalid("onboardingUrl must carry the session token in the fragment, not the query", stepUpId);
352
+ onboardingUrl = raw.onboardingUrl;
353
+ }
354
+ const readyTimeoutMs = raw.readyTimeoutMs ?? 15e3;
355
+ if (typeof readyTimeoutMs !== "number" || !Number.isFinite(readyTimeoutMs) || readyTimeoutMs <= 0 || readyTimeoutMs > MAX_TIMER_DELAY_MS) invalid(`readyTimeoutMs must be a positive number up to ${MAX_TIMER_DELAY_MS} when given`, stepUpId);
356
+ if (raw.lang !== void 0 && !isNonEmptyString(raw.lang)) invalid("lang must be a non-empty string when given", stepUpId);
357
+ if (raw.disableDashboardTheme !== void 0 && typeof raw.disableDashboardTheme !== "boolean") invalid("disableDashboardTheme must be a boolean when given", stepUpId);
358
+ let permissions;
359
+ try {
360
+ permissions = normalizeStepUpPermissions(raw.consent);
361
+ } catch (error) {
362
+ invalid(error instanceof Error ? error.message : String(error), stepUpId);
363
+ }
364
+ return {
365
+ stepUpId,
366
+ sessionToken: sessionToken ?? "",
367
+ ...isNonEmptyString(raw.interviewId) ? { interviewId: raw.interviewId } : {},
368
+ permissions,
369
+ mode,
370
+ ...onboardingUrl ? {
371
+ onboardingUrl,
372
+ onboardingOrigin
373
+ } : {},
374
+ permissionsUi,
375
+ permissionsOrder,
376
+ readyTimeoutMs,
377
+ ...isNonEmptyString(raw.lang) ? { lang: raw.lang } : {},
378
+ disableDashboardTheme: raw.disableDashboardTheme === true,
379
+ ...raw.onPermissionsApproved ? { onPermissionsApproved: raw.onPermissionsApproved } : {},
380
+ onFinish: raw.onFinish,
381
+ ...raw.onError ? { onError: raw.onError } : {}
382
+ };
383
+ }
384
+ const UNITS = [
385
+ {
386
+ unit: "days",
387
+ seconds: 86400
388
+ },
389
+ {
390
+ unit: "hours",
391
+ seconds: 3600
392
+ },
393
+ {
394
+ unit: "minutes",
395
+ seconds: 60
396
+ }
397
+ ];
398
+ /**
399
+ * Picks the largest unit that divides the duration exactly, so
400
+ * 36000 s → 10 hours, 5400 s → 90 minutes. A duration that is not a whole
401
+ * number of minutes is rounded up to minutes (never shown shorter than it is),
402
+ * and anything under a minute stays in seconds.
403
+ */
404
+ function describeStepUpDuration(durationSeconds) {
405
+ const seconds = Math.ceil(durationSeconds);
406
+ for (const { unit, seconds: size } of UNITS) if (seconds >= size && seconds % size === 0) return {
407
+ unit,
408
+ count: seconds / size
409
+ };
410
+ if (seconds >= 60) return {
411
+ unit: "minutes",
412
+ count: Math.ceil(seconds / 60)
413
+ };
414
+ return {
415
+ unit: "seconds",
416
+ count: seconds
417
+ };
418
+ }
419
+ //#endregion
420
+ //#region src/modules/step-up/stepUpManager.ts
421
+ /**
422
+ * What the workflow's `onFinish` result means for the step-up:
423
+ * - `failed` — `action: 'rejected'`, or score `FAIL` / `MANUAL_FAIL`.
424
+ * - `pending` — no result (the workflow went to async resolution).
425
+ * - `passed` — anything else, `WARN` and `UNKNOWN` included. That is only a
426
+ * UI hint: Incode passes the face check only on `OK` / `MANUAL_OK`, so
427
+ * `onFinish` is never an approval.
428
+ */
429
+ function readWorkflowResult(result) {
430
+ if (!result) return "pending";
431
+ if (result.action === "rejected" || result.scoreStatus === "FAIL" || result.scoreStatus === "MANUAL_FAIL") return "failed";
432
+ return "passed";
433
+ }
434
+ function toPermissionsState(context, saving) {
435
+ const { permissions, selectedScopes } = context;
436
+ return {
437
+ status: "permissions",
438
+ ...permissions.purpose ? { purpose: permissions.purpose } : {},
439
+ scopes: permissions.scopes.map((scope) => {
440
+ const limit = permissions.limits?.[scope.name];
441
+ return {
442
+ ...scope,
443
+ checked: selectedScopes.includes(scope.name),
444
+ ...limit ? { limit } : {}
445
+ };
446
+ }),
447
+ duration: describeStepUpDuration(permissions.durationSeconds),
448
+ canApprove: selectedScopes.length > 0,
449
+ saving
450
+ };
451
+ }
452
+ function mapState(snapshot) {
453
+ const typed = snapshot;
454
+ const { context } = typed;
455
+ if (typed.matches("permissions")) return toPermissionsState(context, false);
456
+ if (typed.matches("savingPermissions")) return toPermissionsState(context, true);
457
+ if (typed.matches("finished")) return {
458
+ status: "finished",
459
+ result: {
460
+ stepUpId: context.stepUpId,
461
+ approvedScopes: [...context.selectedScopes]
462
+ }
463
+ };
464
+ if (typed.matches("closed")) return { status: "closed" };
465
+ if (typed.matches("error")) return {
466
+ status: "error",
467
+ code: context.errorCode ?? "VERIFICATION_ERROR",
468
+ error: context.error ?? "Verification failed",
469
+ ...context.errorDetail ? { detail: context.errorDetail } : {}
470
+ };
471
+ return { status: "verifying" };
472
+ }
473
+ function createApi({ actor }) {
474
+ return {
475
+ /** Verification passed: show the permissions (or finish, `'none'`). */
476
+ verificationFinished() {
477
+ actor.send({ type: "VERIFICATION_FINISHED" });
478
+ },
479
+ /**
480
+ * The workflow's `onFinish`, with its result. A failed face check goes to
481
+ * `error` (`FACE_CHECK_FAILED`) and no result to `error`
482
+ * (`VERIFICATION_PENDING`); neither shows the permissions.
483
+ */
484
+ workflowFinished(result) {
485
+ const outcome = readWorkflowResult(result);
486
+ if (outcome === "passed") actor.send({ type: "VERIFICATION_FINISHED" });
487
+ else if (outcome === "failed" && result) actor.send({
488
+ type: "VERIFICATION_FAILED",
489
+ code: "FACE_CHECK_FAILED",
490
+ error: `The face check failed (action ${result.action}, score ${result.scoreStatus})`,
491
+ detail: { code: result.scoreStatus }
492
+ });
493
+ else actor.send({
494
+ type: "VERIFICATION_FAILED",
495
+ code: "VERIFICATION_PENDING",
496
+ error: "The verification has no result yet"
497
+ });
498
+ },
499
+ /**
500
+ * The workflow or hosted page ended without a passed check. `code`
501
+ * defaults to `VERIFICATION_ERROR` (could not finish); pass
502
+ * `FACE_CHECK_FAILED` only for a check that ran and failed.
503
+ */
504
+ verificationFailed(error, code = "VERIFICATION_ERROR", detail) {
505
+ actor.send({
506
+ type: "VERIFICATION_FAILED",
507
+ code,
508
+ error,
509
+ ...detail ? { detail } : {}
510
+ });
511
+ },
512
+ /** Hosted mode: the hosted page finished, with the scopes it approved. */
513
+ hostedFinished(approvedScopes) {
514
+ actor.send({
515
+ type: "HOSTED_FINISHED",
516
+ approvedScopes
517
+ });
518
+ },
519
+ /** Hosted mode: the user denied on the hosted page. */
520
+ hostedDenied() {
521
+ actor.send({ type: "HOSTED_DENIED" });
522
+ },
523
+ toggleScope(name) {
524
+ actor.send({
525
+ type: "TOGGLE_SCOPE",
526
+ name
527
+ });
528
+ },
529
+ /** Ignored while no scope is checked. */
530
+ approve() {
531
+ actor.send({ type: "APPROVE" });
532
+ },
533
+ deny() {
534
+ actor.send({ type: "DENY" });
535
+ },
536
+ /** The host saved the approved scopes: go on to the face check or finish. */
537
+ permissionsSaved() {
538
+ actor.send({ type: "PERMISSIONS_SAVED" });
539
+ },
540
+ /** The host could not save them: the step-up ends in error. */
541
+ permissionsSaveFailed(error) {
542
+ actor.send({
543
+ type: "PERMISSIONS_SAVE_FAILED",
544
+ error
545
+ });
546
+ }
547
+ };
548
+ }
549
+ /**
550
+ * Creates the step-up manager. Pass permissions already normalized by
551
+ * `validateStepUpOptions` / `normalizeStepUpPermissions`.
552
+ */
553
+ function createStepUpManager(options) {
554
+ return createManager({
555
+ actor: createStepUpActor({
556
+ stepUpId: options.stepUpId,
557
+ permissions: options.permissions,
558
+ permissionsUi: options.permissionsUi ?? "sdk",
559
+ permissionsOrder: options.permissionsOrder ?? "beforeFaceCheck",
560
+ hostSavesPermissions: options.hostSavesPermissions ?? false
561
+ }),
562
+ mapState,
563
+ createApi
564
+ });
565
+ }
566
+ //#endregion
567
+ //#region src/modules/step-up/stepUpHostedMessage.ts
568
+ /**
569
+ * Tag on every step-up `postMessage`, both directions. Matches the local
570
+ * step-up mock's hosted page (contract P4.7 §6.6 reference implementation).
571
+ */
572
+ const STEP_UP_MESSAGE_SOURCE = "incode-step-up";
573
+ /**
574
+ * True only when the message came from exactly `expectedOrigin`
575
+ * (scheme, host and port). No suffix or prefix matching:
576
+ * `https://onboarding.incode.com.evil.com` does not match
577
+ * `https://onboarding.incode.com`.
578
+ */
579
+ function isTrustedHostedOrigin(origin, expectedOrigin) {
580
+ return typeof origin === "string" && origin.length > 0 && origin !== "null" && origin === expectedOrigin;
581
+ }
582
+ function isRecord(value) {
583
+ return typeof value === "object" && value !== null && !Array.isArray(value);
584
+ }
585
+ /**
586
+ * Reads a `postMessage` from the hosted step-up page.
587
+ *
588
+ * Pass only messages whose `source` is the step-up iframe's own window. The
589
+ * page tags messages `{ source: 'incode-step-up', type, ... }`:
590
+ * - `ready` — loaded; the parent answers with {@link createStepUpInitMessage}.
591
+ * - `finish` — `{ stepUpId, approvedScopes }`; the hosted page ran the face
592
+ * check and its own permissions screen. Read only when `stepUpId` is
593
+ * exactly `expectedStepUpId`; otherwise (missing or another step-up's)
594
+ * it is ignored, not relayed.
595
+ * - `error` — `{ code, message? }`, e.g. `USER_DENIED` or
596
+ * `FACE_CHECK_FAILED`. Ignored when it names another `stepUpId`.
597
+ *
598
+ * A tagged message from another origin returns `originMismatch` (the frame
599
+ * left the onboarding origin, for example after a redirect). Untagged
600
+ * messages are ignored.
601
+ */
602
+ function readHostedPageMessage(event, expectedOrigin, expectedStepUpId) {
603
+ const { data } = event;
604
+ if (!isRecord(data) || data.source !== "incode-step-up") return { kind: "ignored" };
605
+ if (!isTrustedHostedOrigin(event.origin, expectedOrigin)) return { kind: "originMismatch" };
606
+ if (data.type === "ready") return { kind: "ready" };
607
+ if (data.type === "finish") {
608
+ if (data.stepUpId !== expectedStepUpId) return { kind: "ignored" };
609
+ return {
610
+ kind: "finished",
611
+ approvedScopes: Array.isArray(data.approvedScopes) ? data.approvedScopes.filter((scope) => typeof scope === "string") : []
612
+ };
613
+ }
614
+ if (data.type === "error") {
615
+ if (data.stepUpId !== void 0 && data.stepUpId !== expectedStepUpId) return { kind: "ignored" };
616
+ return {
617
+ kind: "error",
618
+ code: typeof data.code === "string" && data.code ? data.code : "UNKNOWN",
619
+ ...typeof data.message === "string" && data.message ? { message: data.message } : {}
620
+ };
621
+ }
622
+ return { kind: "ignored" };
623
+ }
624
+ /**
625
+ * Builds the `init` message that hands the hosted page the permissions and
626
+ * the parent's origin (contract v0.2 §6.6; the page checks `parentOrigin`
627
+ * against its `returnOrigin`). The caller posts it with `targetOrigin` set to
628
+ * the exact onboarding origin, never `'*'`.
629
+ */
630
+ function createStepUpInitMessage(permissions, parentOrigin) {
631
+ return {
632
+ source: STEP_UP_MESSAGE_SOURCE,
633
+ type: "init",
634
+ permissions,
635
+ parentOrigin
636
+ };
637
+ }
638
+ //#endregion
639
+ export { STEP_UP_MESSAGE_SOURCE, StepUpError, createStepUpInitMessage, createStepUpManager, describeStepUpDuration, getUrlOrigin, isStepUpError, isTrustedHostedOrigin, normalizeStepUpPermissions, readHostedPageMessage, readWorkflowResult, validateStepUpOptions };
@@ -0,0 +1,41 @@
1
+ //#region src/shared/types.d.ts
2
+ /** A single form field definition for dynamic rendering. */
3
+ type FieldDef = {
4
+ name: string;
5
+ type: 'text' | 'tel' | 'date' | 'dropdown' | 'phone' | 'radio';
6
+ label: string;
7
+ displayLabel?: string;
8
+ placeholder?: string;
9
+ placeholderParams?: Record<string, string>;
10
+ required: boolean;
11
+ optional?: boolean;
12
+ maxLength?: number;
13
+ options?: {
14
+ value: string;
15
+ label: string;
16
+ }[];
17
+ readonly?: boolean;
18
+ section?: string;
19
+ disableCountrySelector?: boolean;
20
+ };
21
+ /** An address suggestion returned by the address autocomplete API. */
22
+ type AddressSuggestion = {
23
+ id: string | number;
24
+ label: string;
25
+ street?: string;
26
+ city?: string;
27
+ stateCode?: string;
28
+ postalCode?: string;
29
+ houseNumber?: string;
30
+ countryCode?: string;
31
+ };
32
+ //#endregion
33
+ //#region src/shared/validators/textRules.d.ts
34
+ /**
35
+ * The general-purpose form-definition rules from `vocabulary.json`, as pure
36
+ * checks on a non-empty value. Callers skip empty values: requiredness is its
37
+ * own rule.
38
+ */
39
+ type CharacterClass = 'letter' | 'digit' | 'space';
40
+ //#endregion
41
+ export { AddressSuggestion as n, FieldDef as r, CharacterClass as t };