@incodetech/core 2.3.0-rc.1 → 2.3.0-rc.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 (90) hide show
  1. package/dist/{BrowserDiagnosticsCryptoProvider-CU6kBvqv.esm.js → BrowserDiagnosticsCryptoProvider-BuzqvbhN.esm.js} +6 -24
  2. package/dist/{FaceDetectionProvider-BfhWkK90.esm.js → FaceDetectionProvider-BZYHujqz.esm.js} +8 -8
  3. package/dist/{MotionSensorProvider-BgTYwg9L.esm.js → MotionSensorProvider-DyhbM4Si.esm.js} +1 -1
  4. package/dist/ae-signature.esm.js +1 -1
  5. package/dist/{apiError-Budb6m6w.esm.js → apiError-iTFZ5fiI.esm.js} +1 -1
  6. package/dist/authentication.d.ts +2 -2
  7. package/dist/authentication.esm.js +2 -2
  8. package/dist/{authenticationManager-CjXBjC-c.d.ts → authenticationManager-B23V74p7.d.ts} +1 -1
  9. package/dist/{authenticationManager-cMXhG70r.esm.js → authenticationManager-D22ju23T.esm.js} +4 -4
  10. package/dist/{authenticationStateMachine-MOYz4HCf.esm.js → authenticationStateMachine-TyFaCegB.esm.js} +3 -3
  11. package/dist/{backCameraStream-BOtyQowf.esm.js → backCameraStream-B0-YgP_y.esm.js} +1 -0
  12. package/dist/camera.esm.js +1 -1
  13. package/dist/consent.d.ts +1 -1
  14. package/dist/{consentManager-BhYFeKiG.d.ts → consentManager-uhDPdU6i.d.ts} +8 -8
  15. package/dist/{createCameraCycleOwnership-CX3hJGKc.esm.js → createCameraCycleOwnership-DnwTl1ad.esm.js} +6 -1
  16. package/dist/{deepsightLoader-DDv3vhXU.esm.js → deepsightLoader-DamOBrBJ.esm.js} +6 -6
  17. package/dist/document-capture.d.ts +1 -1
  18. package/dist/document-capture.esm.js +2 -2
  19. package/dist/{documentCaptureManager-CwAiM9WY.esm.js → documentCaptureManager-BRPxqYD2.esm.js} +1 -1
  20. package/dist/{documentCaptureManager-DensIj5F.d.ts → documentCaptureManager-lEtCM320.d.ts} +14 -0
  21. package/dist/{documentCaptureStateMachine-DfGOBapD.esm.js → documentCaptureStateMachine-D312sSIu.esm.js} +13 -8
  22. package/dist/dynamic-forms.esm.js +2 -2
  23. package/dist/{dynamicFormsManager-BbS-XMFc.esm.js → dynamicFormsManager-DKgiusbF.esm.js} +1 -1
  24. package/dist/{dynamicFormsStateMachine-D8zHBCh4.esm.js → dynamicFormsStateMachine-BV8yR5iN.esm.js} +1 -1
  25. package/dist/ekyb.esm.js +3 -3
  26. package/dist/{ekybManager-5aiac8wL.esm.js → ekybManager-8VUBu8VW.esm.js} +1 -1
  27. package/dist/{ekybStateMachine-Bn2IE9rx.esm.js → ekybStateMachine-Bnsefu9M.esm.js} +1 -1
  28. package/dist/electronic-signature.esm.js +1 -1
  29. package/dist/{electronicSignatureManager-BJJH0Tvi.esm.js → electronicSignatureManager--YFXVldr.esm.js} +1 -1
  30. package/dist/extensibility.d.ts +7 -7
  31. package/dist/extensibility.esm.js +13 -13
  32. package/dist/{faceCaptureManagerFactory-B7Ms6pSs.esm.js → faceCaptureManagerFactory-Bk6pVs6E.esm.js} +3 -3
  33. package/dist/{faceCaptureManagerFactory-BeUl8fl1.d.ts → faceCaptureManagerFactory-DMLstvui.d.ts} +80 -40
  34. package/dist/{faceCaptureSetup-bkAlr5d8.esm.js → faceCaptureSetup-CGQDK97m.esm.js} +267 -45
  35. package/dist/{feature-management-E0mq0pMs.esm.js → feature-management-C8OAO_CZ.esm.js} +1 -1
  36. package/dist/feature-management.esm.js +1 -1
  37. package/dist/fiscal-qr.esm.js +1 -1
  38. package/dist/{fiscalQrManager-BunLVFbd.esm.js → fiscalQrManager-DbCVMIBx.esm.js} +1 -1
  39. package/dist/flow.esm.js +3 -3
  40. package/dist/{flowCompletionService-DJp1odGN.esm.js → flowCompletionService-C0zcPnqK.esm.js} +1 -1
  41. package/dist/{flowServices-DjPFGs_D.esm.js → flowServices-G1FDrkLd.esm.js} +5 -5
  42. package/dist/geolocation.esm.js +2 -2
  43. package/dist/{geolocationManager-D5906YXx.esm.js → geolocationManager-DNixQOgf.esm.js} +1 -1
  44. package/dist/{geolocationStateMachine-BVOduc3y.esm.js → geolocationStateMachine-D1aZJ6eR.esm.js} +1 -1
  45. package/dist/id-selfie-flow.esm.js +9 -9
  46. package/dist/id.d.ts +2 -2
  47. package/dist/id.esm.js +4 -4
  48. package/dist/idCaptureDefaults-sJahGQgV.esm.js +282 -0
  49. package/dist/{idCaptureManager-rfV9dIXy.esm.js → idCaptureManager-B8lo-ksK.esm.js} +5 -5
  50. package/dist/{idCaptureManager-DKESug0R.d.ts → idCaptureManager-BaHEyQyr.d.ts} +23 -5
  51. package/dist/{idCaptureServices-i1KxugN7.esm.js → idCaptureServices-DLqls7Xv.esm.js} +60 -13
  52. package/dist/{idCaptureStateMachine-Ne_PXth_.esm.js → idCaptureStateMachine-CCPGFPRF.esm.js} +221 -76
  53. package/dist/index.d.ts +1 -1
  54. package/dist/index.esm.js +1 -1
  55. package/dist/mandatory-consent.d.ts +1 -1
  56. package/dist/{mandatoryConsentManager-vhv1co_n.d.ts → mandatoryConsentManager-CJSyhTpi.d.ts} +4 -4
  57. package/dist/{multipartRecordingService-OEgIRvqC.esm.js → multipartRecordingService-YKu0Bd7S.esm.js} +490 -8
  58. package/dist/{permissionGuards-uYZYFu4J.esm.js → permissionGuards-D6TfVop2.esm.js} +1 -1
  59. package/dist/{permissionServices-Bj_fyWtv.esm.js → permissionServices-EY3_Vx6c.esm.js} +2 -2
  60. package/dist/qe-signature.esm.js +1 -1
  61. package/dist/{runChildModule-CI1gGWN1.esm.js → runChildModule-B3Z4iJnG.esm.js} +1 -1
  62. package/dist/{safeStorage-B-trhxg6.esm.js → safeStorage-BdU9_m2E.esm.js} +1 -1
  63. package/dist/{sdkVersion-BZh6dj53.esm.js → sdkVersion-CD9fJC2Y.esm.js} +1 -1
  64. package/dist/selfie.d.ts +2 -2
  65. package/dist/selfie.esm.js +7 -7
  66. package/dist/{selfieManager-4RRLi21P.d.ts → selfieManager-CDCTOrcg.d.ts} +1 -1
  67. package/dist/{selfieManager-B-2c1n_x.esm.js → selfieManager-DzOPNipB.esm.js} +4 -4
  68. package/dist/{selfieStateMachine-Bzx41R8d.esm.js → selfieStateMachine-CidiobBW.esm.js} +3 -3
  69. package/dist/{session-3LmvAU4S.esm.js → session-BABCfUhC.esm.js} +3 -3
  70. package/dist/session.esm.js +4 -4
  71. package/dist/{sessionInitializer-BFk33E67.esm.js → sessionInitializer-BK5NjMe0.esm.js} +4 -4
  72. package/dist/{setup-Cv-JM9QC.d.ts → setup-Cyko6cAn.d.ts} +6 -18
  73. package/dist/{setup-BWG-hivt.esm.js → setup-D4YCSH31.esm.js} +12 -200
  74. package/dist/{tri-4RsGrIt6.esm.js → tri-xzRLIIMN.esm.js} +0 -10
  75. package/dist/tri.esm.js +1 -1
  76. package/dist/{trueSightService-BN-Hzw82.esm.js → trueSightService-D8yZwF3G.esm.js} +189 -570
  77. package/dist/video-selfie.esm.js +5 -6
  78. package/dist/{videoSelfieCameraWarmer-B8PcYqmz.esm.js → videoSelfieCameraWarmer-C80ZPDZ8.esm.js} +6 -6
  79. package/dist/{warmup-CUUnwYxe.esm.js → warmup-ChDwHSel.esm.js} +5 -0
  80. package/dist/wasm.d.ts +1 -1
  81. package/dist/wasm.esm.js +3 -2
  82. package/dist/{wasmDsFlagSync-B2e8p268.esm.js → wasmDsFlagSync-DYrLUEII.esm.js} +1 -1
  83. package/dist/workflow.esm.js +15 -15
  84. package/package.json +1 -6
  85. package/dist/FaceDetectionProvider-LdZ47bWy.d.ts +0 -36
  86. package/dist/StreamCanvasProcessingSession-CBnbTnOr.esm.js +0 -42
  87. package/dist/idCaptureDefaults-CbPA-Auz.esm.js +0 -727
  88. package/dist/personhood.d.ts +0 -538
  89. package/dist/personhood.esm.js +0 -1574
  90. package/dist/types-BT_Oalip.d.ts +0 -1
package/dist/flow.esm.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { v as addEvent } from "./events-ijlbX_Wx.esm.js";
2
- import { a as resolveDashboardModuleConfig, c as getRequiredWasmPipelines, j as mergeDashboardConfig, l as normalizeFlowModules, n as getFlow, o as enrichFlowModuleConfig, r as preloadDashboardFlow, s as getNextRequiredWasmPipelines, t as completeDeferredActivation, u as resolveFlowModuleConfig } from "./flowServices-DjPFGs_D.esm.js";
2
+ import { a as resolveDashboardModuleConfig, c as getRequiredWasmPipelines, j as mergeDashboardConfig, l as normalizeFlowModules, n as getFlow, o as enrichFlowModuleConfig, r as preloadDashboardFlow, s as getNextRequiredWasmPipelines, t as completeDeferredActivation, u as resolveFlowModuleConfig } from "./flowServices-G1FDrkLd.esm.js";
3
3
  import { i as assign, s as createActor, t as setup, u as createManager } from "./xstate.esm-BuFLFuzz.esm.js";
4
4
  import { n as fromPromise } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
5
- import { n as getFinishStatus, r as getTotalScoreStatus, t as classifyScoreStatus } from "./flowCompletionService-DJp1odGN.esm.js";
6
- import { n as attachFlowEventEmitter, t as runChildModule } from "./runChildModule-CI1gGWN1.esm.js";
5
+ import { n as getFinishStatus, r as getTotalScoreStatus, t as classifyScoreStatus } from "./flowCompletionService-C0zcPnqK.esm.js";
6
+ import { n as attachFlowEventEmitter, t as runChildModule } from "./runChildModule-B3Z4iJnG.esm.js";
7
7
  import { n as isAdvanceableError } from "./advanceableErrors-CpF2cBy6.esm.js";
8
8
  //#region src/modules/flow/noOpFlowModuleMachine.ts
9
9
  const noOpFlowModuleMachine = setup({}).createMachine({
@@ -1,6 +1,6 @@
1
1
  import { t as api } from "./api-Bx3gKW_y.esm.js";
2
2
  import { t as endpoints } from "./endpoints-B-3Q-LUw.esm.js";
3
- import { i as toIncodeApiError } from "./apiError-Budb6m6w.esm.js";
3
+ import { i as toIncodeApiError } from "./apiError-iTFZ5fiI.esm.js";
4
4
  //#region src/modules/flow/flowCompletionService.ts
5
5
  const getFinishStatus = async (flowId, signal) => {
6
6
  const url = `${endpoints.finishStatus}${flowId ? `?flowId=${flowId}` : ""}`;
@@ -1,10 +1,10 @@
1
- import { n as getWasmStatus } from "./warmup-CUUnwYxe.esm.js";
2
- import { E as updateFeatureManagementUser } from "./feature-management-E0mq0pMs.esm.js";
1
+ import { n as getWasmStatus } from "./warmup-ChDwHSel.esm.js";
2
+ import { E as updateFeatureManagementUser } from "./feature-management-C8OAO_CZ.esm.js";
3
3
  import { r as getToken, t as api } from "./api-Bx3gKW_y.esm.js";
4
- import { i as initializeSession, l as whenSessionFingerprintSettled, r as getSessionFingerprintResult, u as getStandaloneFlowPolicy } from "./sessionInitializer-BFk33E67.esm.js";
4
+ import { i as initializeSession, l as whenSessionFingerprintSettled, r as getSessionFingerprintResult, u as getStandaloneFlowPolicy } from "./sessionInitializer-BK5NjMe0.esm.js";
5
5
  import { t as endpoints } from "./endpoints-B-3Q-LUw.esm.js";
6
- import { i as toIncodeApiError } from "./apiError-Budb6m6w.esm.js";
7
- import "./session-3LmvAU4S.esm.js";
6
+ import { i as toIncodeApiError } from "./apiError-iTFZ5fiI.esm.js";
7
+ import "./session-BABCfUhC.esm.js";
8
8
  import { i as toEkycConfig } from "./ekycUtils-Dew1rBG0.esm.js";
9
9
  //#region src/modules/flow/dashboardConfig.ts
10
10
  function isPlainObject(value) {
@@ -1,3 +1,3 @@
1
- import { t as createGeolocationManager } from "./geolocationManager-D5906YXx.esm.js";
2
- import { t as geolocationMachine } from "./geolocationStateMachine-BVOduc3y.esm.js";
1
+ import { t as createGeolocationManager } from "./geolocationManager-DNixQOgf.esm.js";
2
+ import { t as geolocationMachine } from "./geolocationStateMachine-D1aZJ6eR.esm.js";
3
3
  export { createGeolocationManager, geolocationMachine };
@@ -1,6 +1,6 @@
1
1
  import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-ijlbX_Wx.esm.js";
2
2
  import { s as createActor, u as createManager } from "./xstate.esm-BuFLFuzz.esm.js";
3
- import { t as geolocationMachine } from "./geolocationStateMachine-BVOduc3y.esm.js";
3
+ import { t as geolocationMachine } from "./geolocationStateMachine-D1aZJ6eR.esm.js";
4
4
  //#region ../infra/src/providers/browser/BrowserGeolocationProvider.ts
5
5
  var BrowserGeolocationProvider = class {
6
6
  getCurrentPosition() {
@@ -1,7 +1,7 @@
1
1
  import { t as api } from "./api-Bx3gKW_y.esm.js";
2
2
  import { t as endpoints } from "./endpoints-B-3Q-LUw.esm.js";
3
3
  import { a as isIOS, t as isAndroid } from "./platform-DkcRc9JV.esm.js";
4
- import { n as isConnectivityError } from "./apiError-Budb6m6w.esm.js";
4
+ import { n as isConnectivityError } from "./apiError-iTFZ5fiI.esm.js";
5
5
  import { i as assign, t as setup } from "./xstate.esm-BuFLFuzz.esm.js";
6
6
  import { n as fromPromise } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
7
7
  //#region src/modules/geolocation/geolocationServices.ts
@@ -1,18 +1,18 @@
1
- import { t as ensureWasmPipelines } from "./setup-BWG-hivt.esm.js";
2
- import { r as WasmUtilProvider } from "./safeStorage-B-trhxg6.esm.js";
1
+ import { r as WasmUtilProvider } from "./safeStorage-BdU9_m2E.esm.js";
2
+ import { t as ensureWasmPipelines } from "./setup-D4YCSH31.esm.js";
3
3
  import { t as BrowserTimerProvider } from "./BrowserTimerProvider-BXhgNxLt.esm.js";
4
- import { a as resolveDashboardModuleConfig, d as facingModeForStep } from "./flowServices-DjPFGs_D.esm.js";
4
+ import { a as resolveDashboardModuleConfig, d as facingModeForStep } from "./flowServices-G1FDrkLd.esm.js";
5
5
  import { i as assign, r as sendTo, s as createActor, t as setup, u as createManager } from "./xstate.esm-BuFLFuzz.esm.js";
6
6
  import { n as fromPromise, t as fromCallback } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
7
- import { n as encryptSelfieImage, o as startDetection, t as FaceDetectionProvider } from "./FaceDetectionProvider-BfhWkK90.esm.js";
8
- import { t as StreamCanvasProcessingSession } from "./StreamCanvasProcessingSession-CBnbTnOr.esm.js";
7
+ import { n as encryptSelfieImage, o as startDetection, t as FaceDetectionProvider } from "./FaceDetectionProvider-BZYHujqz.esm.js";
8
+ import { i as StreamCanvasProcessingSession, n as CameraCompositor } from "./multipartRecordingService-YKu0Bd7S.esm.js";
9
9
  import { n as getWindowDimensions } from "./getDeviceClass-CeBiEayS.esm.js";
10
10
  import { a as uploadSelfie, r as processFace } from "./selfieErrorUtils-UiQ46EBa.esm.js";
11
- import { i as CameraCompositor, n as DEFAULT_ID_CAPTURE_THRESHOLDS, r as IdCaptureProvider, t as DEFAULT_ID_CAPTURE_GEOMETRY } from "./idCaptureDefaults-CbPA-Auz.esm.js";
12
- import { g as ID_ERROR_CODES, h as validateUploadResponse, l as processId, p as uploadIdImage } from "./idCaptureServices-i1KxugN7.esm.js";
11
+ import { n as DEFAULT_ID_CAPTURE_THRESHOLDS, r as IdCaptureProvider, t as DEFAULT_ID_CAPTURE_GEOMETRY } from "./idCaptureDefaults-sJahGQgV.esm.js";
12
+ import { _ as validateUploadResponse, h as uploadIdImage, u as processId, v as ID_ERROR_CODES } from "./idCaptureServices-DLqls7Xv.esm.js";
13
13
  import { t as StreamCanvasCapture } from "./StreamCanvasCapture-C9jtgBdT.esm.js";
14
- import { n as getFinishStatus } from "./flowCompletionService-DJp1odGN.esm.js";
15
- import { i as delay, n as defaultAcquireCamera, o as isSelfieValidationError, s as isWrongVideoSelfieIdSide } from "./videoSelfieCameraWarmer-B8PcYqmz.esm.js";
14
+ import { n as getFinishStatus } from "./flowCompletionService-C0zcPnqK.esm.js";
15
+ import { i as delay, n as defaultAcquireCamera, o as isSelfieValidationError, s as isWrongVideoSelfieIdSide } from "./videoSelfieCameraWarmer-C80ZPDZ8.esm.js";
16
16
  //#region src/modules/id-selfie-flow/idSelfieFlowStepDetector.ts
17
17
  /** Default autocapture window for the selfie step. */
18
18
  const SELFIE_AUTOCAPTURE_MS = 1e4;
package/dist/id.d.ts CHANGED
@@ -3,7 +3,7 @@ import { n as PermissionStatus, t as PermissionResult } from "./types-BEwVKkLJ.j
3
3
  import { t as CameraStream } from "./camera-9wWD-pwg.js";
4
4
  import { r as IdCaptureSettings, t as DetectionOrientation } from "./IIdCaptureCapability-RNiFhvXR.js";
5
5
  import { A as MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, B as DeviceWalletProvider, C as IdDocumentType, D as UploadIdResponse, E as IdFlowStep, F as DeviceWalletDecision, G as DigitalIdPlatformSupport, H as DIGITAL_ID_REGISTRY, I as DeviceWalletDecryptResponse, J as resolveDigitalIdImplementation, K as ResolvedDigitalIdRoute, L as DeviceWalletFailReason, M as ManualUploadContext, N as ManualUploadSide, P as ManualUploadTab, R as DeviceWalletOutput, S as IdCapturedImageData, T as IdErrorCode, U as DigitalIdDocumentType, V as DIGITAL_ID_DOCUMENT_TYPES, W as DigitalIdFunnelEntry, Y as DigitalIdProviderId, Z as RedirectReturnParams, _ as IdCaptureInput, a as CaptureOnlyResponse, b as IdCaptureOutput, c as DetectionStatus, d as IdCaptureContext, f as IdCaptureDependencies, g as IdCaptureGeometry, h as IdCaptureEvent, i as CaptureIdResponse, j as MANUAL_UPLOAD_MAX_RETRIES, k as MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, l as ID_ERROR_CODES, m as IdCaptureDigitalIdMethod, n as AcceptedDocumentType, o as CapturedImage, p as IdCaptureDigitalIdFlowType, q as isRedirectFlowType, r as AddBarcodeV3Response, s as DetectionArea, t as AcceptedDocument, u as IdCaptureConfig, v as IdCaptureMode, w as IdError, x as IdCaptureThresholds, y as IdCaptureOnlyConfig, z as DeviceWalletPlatform } from "./types-byBHOzCG2.js";
6
- import { A as prepareRecordingForCameraRetry, C as addBarcode, D as getRealQualityValue, E as finalizeRecordingSession, F as uploadIdImage, I as uploadManualIdFile, L as validateUploadResponse, M as startRecordingSession, N as stopRecording, O as initializeIdCapture, P as stopStream, S as ValidationError, T as disposeRecordingSession, _ as IdCaptureInitResult, a as CreateIdCaptureOnlyActorOptions, b as UploadIdImageParams, c as IdCaptureOnlyMachine, d as IdCaptureActor, f as createIdCaptureActor, g as FinalizedIdRecording, h as AddBarcodeParams, j as processId, k as pauseRecordingForAttempt, l as idCaptureOnlyMachine, m as idCaptureMachine, n as IdCaptureManager, o as IdCaptureOnlyActor, p as IdCaptureMachine, r as IdCaptureState, s as createIdCaptureOnlyActor, t as createIdCaptureManager, u as CreateIdCaptureActorOptions, v as InitializeIdCaptureParams, w as barcodeToBase64, x as UploadManualIdFileParams, y as StartRecordingParams } from "./idCaptureManager-DKESug0R.js";
6
+ import { A as pauseRecordingForAttempt, C as addBarcode, D as getRealQualityValue, E as finalizeRecordingSession, F as stopRecording, I as stopStream, L as uploadIdImage, M as processId, N as resumeRecordingAfterPause, O as initializeIdCapture, P as startRecordingSession, R as uploadManualIdFile, S as ValidationError, T as disposeRecordingSession, _ as IdCaptureInitResult, a as CreateIdCaptureOnlyActorOptions, b as UploadIdImageParams, c as IdCaptureOnlyMachine, d as IdCaptureActor, f as createIdCaptureActor, g as FinalizedIdRecording, h as AddBarcodeParams, j as prepareRecordingForCameraRetry, k as isSuspendableRecordingSession, l as idCaptureOnlyMachine, m as idCaptureMachine, n as IdCaptureManager, o as IdCaptureOnlyActor, p as IdCaptureMachine, r as IdCaptureState, s as createIdCaptureOnlyActor, t as createIdCaptureManager, u as CreateIdCaptureActorOptions, v as InitializeIdCaptureParams, w as barcodeToBase64, x as UploadManualIdFileParams, y as StartRecordingParams, z as validateUploadResponse } from "./idCaptureManager-BaHEyQyr.js";
7
7
  //#region src/modules/id/deviceWallet/deviceWalletErrors.d.ts
8
8
  /**
9
9
  * Fail reason → i18n key for the device-wallet error screen (same shape as
@@ -47,4 +47,4 @@ declare function createIdCaptureOnlyManagerFromActor(actor: IdCaptureOnlyActor,
47
47
  */
48
48
  declare function createIdCaptureOnlyManager(options: CreateIdCaptureOnlyActorOptions): IdCaptureOnlyManager;
49
49
  //#endregion
50
- export { AcceptedDocument, AcceptedDocumentType, AddBarcodeParams, AddBarcodeV3Response, type CameraStream, CaptureIdResponse, CaptureOnlyResponse, CapturedImage, type CreateIdCaptureActorOptions, type CreateIdCaptureOnlyActorOptions, DEVICE_WALLET_ERROR_KEYS, DIGITAL_ID_DOCUMENT_TYPES, DIGITAL_ID_REGISTRY, DetectionArea, type DetectionOrientation, DetectionStatus, type DeviceWalletDecision, type DeviceWalletDecryptResponse, type DeviceWalletFailReason, type DeviceWalletOutput, type DeviceWalletPlatform, type DeviceWalletProvider, type DigitalIdDocumentType, type DigitalIdFunnelEntry, type DigitalIdPlatformSupport, type DigitalIdProviderId, FinalizedIdRecording, ID_ERROR_CODES, type IdCaptureActor, IdCaptureConfig, IdCaptureContext, IdCaptureDependencies, IdCaptureDigitalIdFlowType, IdCaptureDigitalIdMethod, IdCaptureEvent, IdCaptureGeometry, IdCaptureInitResult, IdCaptureInput, type IdCaptureMachine, type IdCaptureManager, IdCaptureMode, type IdCaptureOnlyActor, IdCaptureOnlyConfig, type IdCaptureOnlyMachine, type IdCaptureOnlyManager, IdCaptureOutput, type IdCaptureSettings, type IdCaptureState, IdCaptureThresholds, IdCapturedImageData, IdDocumentType, IdError, IdErrorCode, IdFlowStep, InitializeIdCaptureParams, MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, MANUAL_UPLOAD_MAX_RETRIES, type ManualUploadContext, type ManualUploadSide, type ManualUploadTab, type PermissionResult, type PermissionStatus, type RedirectReturnParams, type ResolvedDigitalIdRoute, StartRecordingParams, UploadIdImageParams, UploadIdResponse, UploadManualIdFileParams, ValidationError, addBarcode, barcodeToBase64, createIdCaptureActor, createIdCaptureManager, createIdCaptureOnlyActor, createIdCaptureOnlyManager, createIdCaptureOnlyManagerFromActor, disposeRecordingSession, finalizeRecordingSession, getRealQualityValue, idCaptureMachine, idCaptureOnlyMachine, initializeIdCapture, isRedirectFlowType, pauseRecordingForAttempt, prepareRecordingForCameraRetry, processId, resolveDigitalIdImplementation, resolveWalletPlatform, startRecordingSession, stopRecording, stopStream, uploadIdImage, uploadManualIdFile, validateUploadResponse };
50
+ export { AcceptedDocument, AcceptedDocumentType, AddBarcodeParams, AddBarcodeV3Response, type CameraStream, CaptureIdResponse, CaptureOnlyResponse, CapturedImage, type CreateIdCaptureActorOptions, type CreateIdCaptureOnlyActorOptions, DEVICE_WALLET_ERROR_KEYS, DIGITAL_ID_DOCUMENT_TYPES, DIGITAL_ID_REGISTRY, DetectionArea, type DetectionOrientation, DetectionStatus, type DeviceWalletDecision, type DeviceWalletDecryptResponse, type DeviceWalletFailReason, type DeviceWalletOutput, type DeviceWalletPlatform, type DeviceWalletProvider, type DigitalIdDocumentType, type DigitalIdFunnelEntry, type DigitalIdPlatformSupport, type DigitalIdProviderId, FinalizedIdRecording, ID_ERROR_CODES, type IdCaptureActor, IdCaptureConfig, IdCaptureContext, IdCaptureDependencies, IdCaptureDigitalIdFlowType, IdCaptureDigitalIdMethod, IdCaptureEvent, IdCaptureGeometry, IdCaptureInitResult, IdCaptureInput, type IdCaptureMachine, type IdCaptureManager, IdCaptureMode, type IdCaptureOnlyActor, IdCaptureOnlyConfig, type IdCaptureOnlyMachine, type IdCaptureOnlyManager, IdCaptureOutput, type IdCaptureSettings, type IdCaptureState, IdCaptureThresholds, IdCapturedImageData, IdDocumentType, IdError, IdErrorCode, IdFlowStep, InitializeIdCaptureParams, MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, MANUAL_UPLOAD_MAX_RETRIES, type ManualUploadContext, type ManualUploadSide, type ManualUploadTab, type PermissionResult, type PermissionStatus, type RedirectReturnParams, type ResolvedDigitalIdRoute, StartRecordingParams, UploadIdImageParams, UploadIdResponse, UploadManualIdFileParams, ValidationError, addBarcode, barcodeToBase64, createIdCaptureActor, createIdCaptureManager, createIdCaptureOnlyActor, createIdCaptureOnlyManager, createIdCaptureOnlyManagerFromActor, disposeRecordingSession, finalizeRecordingSession, getRealQualityValue, idCaptureMachine, idCaptureOnlyMachine, initializeIdCapture, isRedirectFlowType, isSuspendableRecordingSession, pauseRecordingForAttempt, prepareRecordingForCameraRetry, processId, resolveDigitalIdImplementation, resolveWalletPlatform, resumeRecordingAfterPause, startRecordingSession, stopRecording, stopStream, uploadIdImage, uploadManualIdFile, validateUploadResponse };
package/dist/id.esm.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { n as eventModuleNames } from "./events-ijlbX_Wx.esm.js";
2
2
  import { i as assign, s as createActor } from "./xstate.esm-BuFLFuzz.esm.js";
3
3
  import { n as fromPromise } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
4
- import { a as createIdProtectedCaptureController, c as DIGITAL_ID_DOCUMENT_TYPES, d as resolveDigitalIdImplementation, f as MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, h as resolveWalletPlatform, i as createIdCaptureOnlyDeliveryActor, l as DIGITAL_ID_REGISTRY, m as MANUAL_UPLOAD_MAX_RETRIES, n as provideIdProtectedCaptureController, p as MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, r as attachIdProtectedCaptureController, t as idCaptureMachine, u as isRedirectFlowType } from "./idCaptureStateMachine-Ne_PXth_.esm.js";
5
- import { n as createIdCaptureActor, r as createIdCaptureManagerFromActor, t as createIdCaptureManager } from "./idCaptureManager-rfV9dIXy.esm.js";
6
- import { a as getRealQualityValue, c as prepareRecordingForCameraRetry, d as stopRecording, f as stopStream, g as ID_ERROR_CODES, h as validateUploadResponse, i as finalizeRecordingSession, l as processId, m as uploadManualIdFile, n as barcodeToBase64, o as initializeIdCapture, p as uploadIdImage, r as disposeRecordingSession, s as pauseRecordingForAttempt, t as addBarcode, u as startRecordingSession, v as resolveIdCaptureThresholds } from "./idCaptureServices-i1KxugN7.esm.js";
4
+ import { a as createIdProtectedCaptureController, c as DIGITAL_ID_DOCUMENT_TYPES, d as resolveDigitalIdImplementation, f as MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, h as resolveWalletPlatform, i as createIdCaptureOnlyDeliveryActor, l as DIGITAL_ID_REGISTRY, m as MANUAL_UPLOAD_MAX_RETRIES, n as provideIdProtectedCaptureController, p as MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, r as attachIdProtectedCaptureController, t as idCaptureMachine, u as isRedirectFlowType } from "./idCaptureStateMachine-CCPGFPRF.esm.js";
5
+ import { n as createIdCaptureActor, r as createIdCaptureManagerFromActor, t as createIdCaptureManager } from "./idCaptureManager-B8lo-ksK.esm.js";
6
+ import { _ as validateUploadResponse, a as getRealQualityValue, b as resolveIdCaptureThresholds, c as pauseRecordingForAttempt, d as resumeRecordingAfterPause, f as startRecordingSession, g as uploadManualIdFile, h as uploadIdImage, i as finalizeRecordingSession, l as prepareRecordingForCameraRetry, m as stopStream, n as barcodeToBase64, o as initializeIdCapture, p as stopRecording, r as disposeRecordingSession, s as isSuspendableRecordingSession, t as addBarcode, u as processId, v as ID_ERROR_CODES } from "./idCaptureServices-DLqls7Xv.esm.js";
7
7
  import { t as invokeOnCaptureCallback } from "./invokeOnCaptureCallback-BjzPjJ_p.esm.js";
8
8
  //#region src/modules/id/deviceWallet/deviceWalletErrors.ts
9
9
  /**
@@ -213,4 +213,4 @@ function createIdCaptureOnlyManager(options) {
213
213
  return createIdCaptureOnlyManagerFromActor(createIdCaptureOnlyActor(options), options.config);
214
214
  }
215
215
  //#endregion
216
- export { DEVICE_WALLET_ERROR_KEYS, DIGITAL_ID_DOCUMENT_TYPES, DIGITAL_ID_REGISTRY, ID_ERROR_CODES, MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, MANUAL_UPLOAD_MAX_RETRIES, addBarcode, barcodeToBase64, createIdCaptureActor, createIdCaptureManager, createIdCaptureOnlyActor, createIdCaptureOnlyManager, createIdCaptureOnlyManagerFromActor, disposeRecordingSession, finalizeRecordingSession, getRealQualityValue, idCaptureMachine, idCaptureOnlyMachine, initializeIdCapture, isRedirectFlowType, pauseRecordingForAttempt, prepareRecordingForCameraRetry, processId, resolveDigitalIdImplementation, resolveWalletPlatform, startRecordingSession, stopRecording, stopStream, uploadIdImage, uploadManualIdFile, validateUploadResponse };
216
+ export { DEVICE_WALLET_ERROR_KEYS, DIGITAL_ID_DOCUMENT_TYPES, DIGITAL_ID_REGISTRY, ID_ERROR_CODES, MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, MANUAL_UPLOAD_MAX_RETRIES, addBarcode, barcodeToBase64, createIdCaptureActor, createIdCaptureManager, createIdCaptureOnlyActor, createIdCaptureOnlyManager, createIdCaptureOnlyManagerFromActor, disposeRecordingSession, finalizeRecordingSession, getRealQualityValue, idCaptureMachine, idCaptureOnlyMachine, initializeIdCapture, isRedirectFlowType, isSuspendableRecordingSession, pauseRecordingForAttempt, prepareRecordingForCameraRetry, processId, resolveDigitalIdImplementation, resolveWalletPlatform, resumeRecordingAfterPause, startRecordingSession, stopRecording, stopStream, uploadIdImage, uploadManualIdFile, validateUploadResponse };
@@ -0,0 +1,282 @@
1
+ import { b as resolveWasmSource, p as WASM_MODEL_FILES } from "./wasmWebClient-B7baE-Wf.esm.js";
2
+ import { E as getBarcodeEnhanceModelUrl } from "./trueSightService-D8yZwF3G.esm.js";
3
+ import { s as wasmRuntime, t as getResolvedModelSource } from "./warmup-ChDwHSel.esm.js";
4
+ import { i as BaseWasmProvider } from "./safeStorage-BdU9_m2E.esm.js";
5
+ import { t as IncodeCanvas } from "./canvas-BxFzWTt-.esm.js";
6
+ //#region ../infra/src/wasm/idCaptureWasmApi.ts
7
+ var IdCaptureWasmApi = class {
8
+ constructor(runtime = wasmRuntime) {
9
+ this.runtime = runtime;
10
+ }
11
+ async setIdCaptureThresholds(type, blurThreshold, blurChangeThreshold, glareThreshold, clsThreshold, sideThreshold, iouThreshold, idDetectedTimeout, autocaptureTimeout, framesAggregationInterval) {
12
+ this.runtime.requireIdCaptureApi("Unable to set thresholds, cpp API hasn't been initialized").setIdCaptureThresholds(this.runtime.pipelineTypeToWasmEnum(type), blurThreshold, blurChangeThreshold, glareThreshold, clsThreshold, sideThreshold, iouThreshold, idDetectedTimeout, autocaptureTimeout, framesAggregationInterval);
13
+ }
14
+ async setIdCaptureCallbacks(type, onFarAway, onDetectionStarted, onMaskChange, onBlur, onGlare, onCapturing, onCapture, onBestFrame, onIDNotDetected, onSwitchToManualCapture, onIDTypeChange, onIDSideChange, onCapturingCounterValueChange) {
15
+ this.runtime.requireIdCaptureApi("Unable to set callbacks, cpp API hasn't been initialized").setIdCaptureCallbacks(this.runtime.pipelineTypeToWasmEnum(type), onFarAway, onDetectionStarted, onMaskChange, onBlur, onGlare, onCapturing, onCapture, onBestFrame, onIDNotDetected, onSwitchToManualCapture, onIDTypeChange, onIDSideChange, onCapturingCounterValueChange);
16
+ }
17
+ async setIdCaptureGeometryParams(type, areaDown, areaUp, areaIOSPassportUp, areaIOSPassportDown, widthIOSUp, widthIOSDown, widthDown, widthUp, windowOuterWidth, windowOuterHeight, windowInnerWidth, windowInnerHeight) {
18
+ this.runtime.requireIdCaptureApi("Unable to set geometry params, cpp API hasn't been initialized").setIdCaptureGeometryParams(this.runtime.pipelineTypeToWasmEnum(type), areaDown, areaUp, areaIOSPassportUp, areaIOSPassportDown, widthIOSUp, widthIOSDown, widthDown, widthUp, windowOuterWidth, windowOuterHeight, windowInnerWidth, windowInnerHeight);
19
+ }
20
+ async setIdCaptureConfigParams(type, isFixedMask, isIPhone14OrHigher, idType, isBlurCheckEnabled, isGlareCheckEnabled, _isIdFaceQualityCheckEnabled, isIouCheckEnabled, _isFPSLimitEnabled) {
21
+ this.runtime.requireIdCaptureApi("Unable to set config params, cpp API hasn't been initialized").setIdCaptureConfigParams(this.runtime.pipelineTypeToWasmEnum(type), isFixedMask, isIPhone14OrHigher, idType, isBlurCheckEnabled, isGlareCheckEnabled, isIouCheckEnabled);
22
+ }
23
+ setIdCaptureModelType(pipelineType, modelType) {
24
+ this.runtime.requireIdCaptureApi("Unable to set model type, cpp API hasn't been initialized").setIdCaptureModelType(this.runtime.pipelineTypeToWasmEnum(pipelineType), this.runtime.IdCaptureModelTypeToWasmEnum(modelType));
25
+ }
26
+ setIdBarcodeCaptureEnabled(pipelineType, enabled) {
27
+ this.runtime.requireIdCaptureApi("Unable to set barcode capture enabled, cpp API hasn't been initialized").setIdBarcodeCaptureEnabled(this.runtime.pipelineTypeToWasmEnum(pipelineType), enabled);
28
+ }
29
+ setIdBarcodeAutoCaptureOnDecode(pipelineType, enabled) {
30
+ this.runtime.requireIdCaptureApi("Unable to set barcode auto-capture-on-decode, cpp API hasn't been initialized").setIdBarcodeAutoCaptureOnDecode(this.runtime.pipelineTypeToWasmEnum(pipelineType), enabled);
31
+ }
32
+ setIdBarcodeDecodedCallback(pipelineType, onBarcodeDecoded) {
33
+ this.runtime.requireIdCaptureApi("Unable to set barcode decoded callback, cpp API hasn't been initialized").setIdBarcodeDecodedCallback(this.runtime.pipelineTypeToWasmEnum(pipelineType), onBarcodeDecoded);
34
+ }
35
+ async setIdBarcodeEnhancementModel(pipelineType, modelPath) {
36
+ const message = "Unable to set barcode enhancement model, cpp API hasn't been initialized";
37
+ this.runtime.requireIdCaptureApi(message);
38
+ const buffer = await resolveWasmSource(modelPath, "barcode model");
39
+ return this.runtime.requireIdCaptureApi(message).setBarcodeEnhancementModel(this.runtime.pipelineTypeToWasmEnum(pipelineType), buffer);
40
+ }
41
+ IdPerspectiveTransform(image, frameRect) {
42
+ return this.runtime.requireIdCaptureApi("Unable to perform perspective transform, cpp API hasn't been initialized").IdPerspectiveTransform(image, frameRect);
43
+ }
44
+ /**
45
+ * Kept-dead: mirrors upstream `wasmApi.runIdCapture`. Nothing in the SDK calls
46
+ * it; it exists so the mirror stays 1:1 with upstream at the pinned tag.
47
+ */
48
+ async runIdCapture(image) {
49
+ const idCaptureWasmApi = this.runtime.requireIdCaptureApi("Unable to run Id Capture, cpp API hasn't been initialized");
50
+ if (image) {
51
+ await this.runtime.allocateImageBuffers(image.width, image.height);
52
+ this.runtime.writeFrame(image);
53
+ }
54
+ return idCaptureWasmApi.runIdCapture();
55
+ }
56
+ };
57
+ const idCaptureWasmApi = new IdCaptureWasmApi();
58
+ //#endregion
59
+ //#region ../infra/src/providers/wasm/IdCaptureProvider.ts
60
+ var IdCaptureProvider = class extends BaseWasmProvider {
61
+ constructor(protectedWorkflow) {
62
+ super(protectedWorkflow ?? 0);
63
+ this.lastProcessResult = null;
64
+ this.capturedCanvas = null;
65
+ this.originalCapturedCanvas = null;
66
+ this.lastDecodedBarcode = null;
67
+ this.barcodeEnhancementModelLoaded = false;
68
+ }
69
+ async initialize(config) {
70
+ if (config.videoSelfie === true) {
71
+ if (this.pipelineType !== 0) throw new Error("[Incode SDK] Protected ID workflows are unavailable for video selfie.");
72
+ this.pipelineType = 2;
73
+ await this.initializeBase(config, "videoSelfieId");
74
+ } else await this.initializeBase(config, "idCapture");
75
+ }
76
+ setCallbacks(callbacks) {
77
+ this.ensureInitialized();
78
+ const onCaptureWrapper = (canvas) => {
79
+ callbacks.onCapture?.(canvas);
80
+ };
81
+ idCaptureWasmApi.setIdCaptureCallbacks(this.getPipelineType(), callbacks.onFarAway ?? (() => {}), callbacks.onDetectionStarted ?? (() => {}), callbacks.onMaskChange ? (show, mask, top, orientation) => callbacks.onMaskChange?.(show, mask, top, orientation) : () => {}, callbacks.onBlur ?? (() => {}), callbacks.onGlare ?? (() => {}), callbacks.onCapturing ?? (() => {}), callbacks.onCapture ? onCaptureWrapper : () => {}, callbacks.onBestFrame ? (blur, glare, orientation) => callbacks.onBestFrame?.(blur, glare, orientation) : () => {}, callbacks.onIdNotDetected ?? (() => {}), callbacks.onSwitchToManualCapture ?? (() => {}), callbacks.onIdTypeChange ? (idType) => callbacks.onIdTypeChange?.(idType) : () => {}, callbacks.onIdSideChange ? (side) => callbacks.onIdSideChange?.(side) : () => {}, callbacks.onCapturingCounterValueChange ? (value) => callbacks.onCapturingCounterValueChange?.(value) : () => {});
82
+ if (callbacks.onBarcodeDecoded) {
83
+ const onBarcodeDecoded = callbacks.onBarcodeDecoded;
84
+ idCaptureWasmApi.setIdBarcodeDecodedCallback(this.getPipelineType(), (decoded) => {
85
+ this.lastDecodedBarcode = decoded;
86
+ onBarcodeDecoded(decoded);
87
+ });
88
+ } else idCaptureWasmApi.setIdBarcodeDecodedCallback(this.getPipelineType(), () => {});
89
+ }
90
+ setThresholds(thresholds) {
91
+ this.ensureInitialized();
92
+ idCaptureWasmApi.setIdCaptureThresholds(this.getPipelineType(), thresholds.blurThreshold, thresholds.blurChangeThreshold, thresholds.glareThreshold, thresholds.clsThreshold, thresholds.sideThreshold, thresholds.iouThreshold, thresholds.idDetectedTimeout, thresholds.autocaptureTimeout, thresholds.framesAggregationInterval);
93
+ }
94
+ setGeometry(geometry) {
95
+ this.ensureInitialized();
96
+ idCaptureWasmApi.setIdCaptureGeometryParams(this.getPipelineType(), geometry.areaDown, geometry.areaUp, geometry.areaIOSPassportUp, geometry.areaIOSPassportDown, geometry.widthIOSUp, geometry.widthIOSDown, geometry.widthDown, geometry.widthUp, geometry.windowOuterWidth, geometry.windowOuterHeight, geometry.windowInnerWidth, geometry.windowInnerHeight);
97
+ }
98
+ setSettings(settings) {
99
+ this.ensureInitialized();
100
+ idCaptureWasmApi.setIdCaptureConfigParams(this.getPipelineType(), settings.isFixedMask, settings.isIPhone14OrHigher, settings.idType, settings.blurCheckEnabled, settings.glareCheckEnabled, settings.faceQualityCheckEnabled, settings.iouCheckEnabled, settings.fpsLimitEnabled);
101
+ }
102
+ setModelType(modelType) {
103
+ this.ensureInitialized();
104
+ let wasmModelType;
105
+ switch (modelType) {
106
+ case "v1":
107
+ wasmModelType = 0;
108
+ break;
109
+ case "v2":
110
+ wasmModelType = 1;
111
+ break;
112
+ case "v3":
113
+ wasmModelType = 2;
114
+ break;
115
+ default: throw new Error(`Unknown model type: ${modelType}`);
116
+ }
117
+ idCaptureWasmApi.setIdCaptureModelType(this.getPipelineType(), wasmModelType);
118
+ }
119
+ setBarcodeCaptureEnabled(enabled) {
120
+ this.ensureInitialized();
121
+ idCaptureWasmApi.setIdBarcodeCaptureEnabled(this.getPipelineType(), enabled);
122
+ }
123
+ setBarcodeAutoCaptureOnDecode(enabled) {
124
+ this.ensureInitialized();
125
+ idCaptureWasmApi.setIdBarcodeAutoCaptureOnDecode(this.getPipelineType(), enabled);
126
+ }
127
+ async setBarcodeEnhancementModel() {
128
+ this.ensureInitialized();
129
+ if (this.barcodeEnhancementModelLoaded) return true;
130
+ const modelUrl = getResolvedModelSource(WASM_MODEL_FILES.barcode, "idCapture") ?? getBarcodeEnhanceModelUrl();
131
+ const applied = await idCaptureWasmApi.setIdBarcodeEnhancementModel(this.getPipelineType(), modelUrl);
132
+ this.barcodeEnhancementModelLoaded = applied;
133
+ return applied;
134
+ }
135
+ getLastDecodedBarcode() {
136
+ return this.lastDecodedBarcode;
137
+ }
138
+ /**
139
+ * Processes a frame through the WASM pipeline and stores the result.
140
+ */
141
+ async processFrame(image) {
142
+ const result = await this.processFrameWasm(image);
143
+ const pipelineType = this.getPipelineType();
144
+ if (result && (pipelineType === 0 || pipelineType === 2)) this.lastProcessResult = result;
145
+ else this.lastProcessResult = null;
146
+ }
147
+ /**
148
+ * Gets the last process result from the most recent frame processing.
149
+ * @returns The last process result with quad coordinates, or null if not available
150
+ */
151
+ getLastProcessResult() {
152
+ return this.lastProcessResult;
153
+ }
154
+ transformPerspective(canvas, frameRect) {
155
+ this.ensureInitialized();
156
+ const originalWidth = canvas.width();
157
+ const originalHeight = canvas.height();
158
+ try {
159
+ const imageData = canvas.getImageData();
160
+ if (!imageData) return canvas;
161
+ const transformedCanvas = idCaptureWasmApi.IdPerspectiveTransform(imageData, frameRect);
162
+ if (transformedCanvas) {
163
+ const wrappedCanvas = new IncodeCanvas(transformedCanvas);
164
+ const wrappedWidth = wrappedCanvas.width();
165
+ const wrappedHeight = wrappedCanvas.height();
166
+ if (wrappedWidth === originalWidth && wrappedHeight === originalHeight) {
167
+ const croppedCanvas = this.cropCanvasToRect(wrappedCanvas, {
168
+ x: Math.round(frameRect.x),
169
+ y: Math.round(frameRect.y),
170
+ w: Math.round(frameRect.w),
171
+ h: Math.round(frameRect.h)
172
+ });
173
+ if (croppedCanvas) return croppedCanvas;
174
+ }
175
+ return wrappedCanvas;
176
+ }
177
+ return canvas;
178
+ } catch (_error) {
179
+ return canvas;
180
+ }
181
+ }
182
+ /**
183
+ * Crops a canvas to the specified rectangle region.
184
+ * @param canvas - The canvas to crop
185
+ * @param rect - The rectangle to crop to (x, y, w, h)
186
+ * @returns A new IncodeCanvas with the cropped region, or null if cropping fails
187
+ */
188
+ cropCanvasToRect(canvas, rect) {
189
+ const canvasWidth = canvas.width();
190
+ const canvasHeight = canvas.height();
191
+ if (!canvasWidth || !canvasHeight) return null;
192
+ const x = Math.max(0, Math.min(rect.x, canvasWidth));
193
+ const y = Math.max(0, Math.min(rect.y, canvasHeight));
194
+ const w = Math.max(1, Math.min(rect.w, canvasWidth - x));
195
+ const h = Math.max(1, Math.min(rect.h, canvasHeight - y));
196
+ const croppedCanvasElement = document.createElement("canvas");
197
+ croppedCanvasElement.width = w;
198
+ croppedCanvasElement.height = h;
199
+ const ctx = croppedCanvasElement.getContext("2d");
200
+ if (!ctx) return null;
201
+ ctx.drawImage(canvas.canvas, x, y, w, h, 0, 0, w, h);
202
+ return new IncodeCanvas(croppedCanvasElement);
203
+ }
204
+ /**
205
+ * Gets the captured canvas (transformed for preview).
206
+ * @returns The captured canvas, or null if not available
207
+ */
208
+ getCapturedCanvas() {
209
+ return this.capturedCanvas;
210
+ }
211
+ /**
212
+ * Gets the original captured canvas (full frame for upload).
213
+ * @returns The original captured canvas, or null if not available
214
+ */
215
+ getOriginalCapturedCanvas() {
216
+ return this.originalCapturedCanvas;
217
+ }
218
+ /**
219
+ * Sets the captured canvases (original and transformed).
220
+ * @param original - The original full-frame canvas (for upload)
221
+ * @param transformed - The transformed canvas (for preview)
222
+ */
223
+ setCapturedCanvases(original, transformed) {
224
+ this.originalCapturedCanvas = original;
225
+ this.capturedCanvas = transformed;
226
+ }
227
+ /**
228
+ * Re-arms WASM detection without discarding the captured result.
229
+ *
230
+ * Detection-session teardown runs immediately after a successful capture.
231
+ * The captured canvases must remain available for the subsequent upload and
232
+ * are only replaced by `setCapturedCanvases()` or cleared by a full reset.
233
+ */
234
+ resetDetectionState() {
235
+ super.reset();
236
+ this.lastProcessResult = null;
237
+ this.lastDecodedBarcode = null;
238
+ }
239
+ reset() {
240
+ this.resetDetectionState();
241
+ this.capturedCanvas = null;
242
+ this.originalCapturedCanvas = null;
243
+ }
244
+ async dispose() {
245
+ await super.dispose();
246
+ this.barcodeEnhancementModelLoaded = false;
247
+ }
248
+ };
249
+ //#endregion
250
+ //#region ../infra/src/wasm/idCaptureDefaults.ts
251
+ /**
252
+ * Default WASM thresholds for ID capture quality checks.
253
+ * Matches SDK 1's `wasmWorkflowsConfig.ts` production ID profile. Explicit
254
+ * consumer and experiment overrides still take precedence in Core.
255
+ */
256
+ const DEFAULT_ID_CAPTURE_THRESHOLDS = {
257
+ blurThreshold: .2,
258
+ blurChangeThreshold: .2,
259
+ glareThreshold: .3,
260
+ clsThreshold: .98,
261
+ sideThreshold: .8,
262
+ iouThreshold: .8,
263
+ idDetectedTimeout: 1e4,
264
+ autocaptureTimeout: 5e3,
265
+ framesAggregationInterval: 1700
266
+ };
267
+ /**
268
+ * Default geometry parameters for ID detection.
269
+ * Window dimensions must be provided at runtime.
270
+ */
271
+ const DEFAULT_ID_CAPTURE_GEOMETRY = {
272
+ areaDown: 25e3,
273
+ areaUp: 55e3,
274
+ areaIOSPassportUp: 3e4,
275
+ areaIOSPassportDown: 2e4,
276
+ widthIOSUp: 160,
277
+ widthIOSDown: 85,
278
+ widthDown: 110,
279
+ widthUp: 205
280
+ };
281
+ //#endregion
282
+ export { DEFAULT_ID_CAPTURE_THRESHOLDS as n, IdCaptureProvider as r, DEFAULT_ID_CAPTURE_GEOMETRY as t };
@@ -1,12 +1,12 @@
1
- import { l as BrowserStorageProvider } from "./setup-BWG-hivt.esm.js";
1
+ import { l as BrowserStorageProvider } from "./setup-D4YCSH31.esm.js";
2
2
  import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-ijlbX_Wx.esm.js";
3
3
  import { t as topLevelStateName } from "./topLevelStateName-B5i2avbh.esm.js";
4
4
  import { s as createActor, u as createManager } from "./xstate.esm-BuFLFuzz.esm.js";
5
- import { t as setWasmDsFlagSync } from "./wasmDsFlagSync-B2e8p268.esm.js";
5
+ import { t as setWasmDsFlagSync } from "./wasmDsFlagSync-DYrLUEII.esm.js";
6
6
  import { t as BrowserVisibilityObserverProvider } from "./BrowserVisibilityObserverProvider-BrJN1B8A.esm.js";
7
- import { o as resetWasmMotionPrimedForModule, r as primeMotionFromUserGestureIfNeeded } from "./permissionServices-Bj_fyWtv.esm.js";
8
- import { a as createIdProtectedCaptureController, n as provideIdProtectedCaptureController, o as findIdProtectedCaptureController, s as getManualUploadTabs, t as idCaptureMachine } from "./idCaptureStateMachine-Ne_PXth_.esm.js";
9
- import { _ as resolveCaptureOptimizingTreatment, v as resolveIdCaptureThresholds } from "./idCaptureServices-i1KxugN7.esm.js";
7
+ import { o as resetWasmMotionPrimedForModule, r as primeMotionFromUserGestureIfNeeded } from "./permissionServices-EY3_Vx6c.esm.js";
8
+ import { a as createIdProtectedCaptureController, n as provideIdProtectedCaptureController, o as findIdProtectedCaptureController, s as getManualUploadTabs, t as idCaptureMachine } from "./idCaptureStateMachine-CCPGFPRF.esm.js";
9
+ import { b as resolveIdCaptureThresholds, y as resolveCaptureOptimizingTreatment } from "./idCaptureServices-DLqls7Xv.esm.js";
10
10
  //#region src/modules/id/digitalUpload/instrumentation.ts
11
11
  const TERMINAL_REASONS = /* @__PURE__ */ new Set(["DIGITAL_ID_REQUESTED_BUT_OTHER_PROVIDED", "ID_TYPE_UNACCEPTABLE"]);
12
12
  function isHoldingState(value) {
@@ -9,7 +9,6 @@ import { a as RegulationTypes } from "./types-Do5rEXij.js";
9
9
  import { n as VirtualCameraCheckOutput, r as WasmUtilConfig, t as IWasmUtilCapability } from "./IWasmUtilCapability-CNWRl7jr.js";
10
10
  import { n as PermissionStatus } from "./types-BEwVKkLJ.js";
11
11
  import { t as BaseWasmProvider } from "./BaseWasmProvider-Dyi6dKp1.js";
12
- import "./types-BT_Oalip.js";
13
12
  import { n as DeepsightService } from "./StreamCanvasCapture-_8gdW5Lk.js";
14
13
  import { t as CameraStream } from "./camera-9wWD-pwg.js";
15
14
  import { i as Pdf417DecodeResult, n as IIdCaptureCapability, t as DetectionOrientation } from "./IIdCaptureCapability-RNiFhvXR.js";
@@ -126,15 +125,34 @@ type StartRecordingParams = {
126
125
  declare function startRecordingSession(params: StartRecordingParams): Promise<object | undefined>;
127
126
  declare function pauseRecordingForAttempt(session: object): void;
128
127
  declare function prepareRecordingForCameraRetry(session: object): void;
128
+ /**
129
+ * Resumes a recording paused with `pauseRecordingForAttempt` while its camera
130
+ * clone is still attached (no source replacement pending). Returns whether the
131
+ * recorder is recording again.
132
+ */
133
+ declare function resumeRecordingAfterPause(session: object): boolean;
134
+ /**
135
+ * True only for a live SDK-managed multipart session. A session that has
136
+ * already been finalized or disposed is no longer in the registry, so callers
137
+ * use this to avoid resuming or re-pausing a torn-down recording.
138
+ */
139
+ declare function isSuspendableRecordingSession(session: object): boolean;
129
140
  type FinalizedIdRecording = Readonly<{
130
141
  recordingId?: string | null;
131
142
  }>;
132
143
  /**
133
- * Fully drains an ID recording before the protected camera cycle runs POC.
134
- * Every recorder clone is stopped before this promise settles.
144
+ * Completes an ID recording: drains the multipart upload and releases the
145
+ * compositor. The camera clone ends synchronously, before this function
146
+ * returns its promise, so a step that ends mid-attempt never pins the camera
147
+ * while the upload finishes (ENG-56648). The composite canvas stays alive until
148
+ * the recorder has emitted its final chunk.
135
149
  */
136
150
  declare function finalizeRecordingSession(session: object): Promise<FinalizedIdRecording>;
137
- /** Synchronous teardown used when an attempt is cancelled before finalization. */
151
+ /**
152
+ * Teardown for an attempt released before finalization. The camera clone ends
153
+ * synchronously, before this function returns; the upload completes in the
154
+ * background with whatever was recorded.
155
+ */
138
156
  declare function disposeRecordingSession(session: object): void;
139
157
  declare function stopRecording(session: object): void;
140
158
  declare function processId(isSecondId?: boolean, queueName?: string, signal?: AbortSignal): Promise<{
@@ -623,4 +641,4 @@ declare function createIdCaptureManager(options: CreateIdCaptureActorOptions): M
623
641
  deviceWalletUseAnotherMethod(): void;
624
642
  };
625
643
  //#endregion
626
- export { prepareRecordingForCameraRetry as A, addBarcode as C, getRealQualityValue as D, finalizeRecordingSession as E, uploadIdImage as F, uploadManualIdFile as I, validateUploadResponse as L, startRecordingSession as M, stopRecording as N, initializeIdCapture as O, stopStream as P, WasmUtilProvider as R, ValidationError as S, disposeRecordingSession as T, IdCaptureInitResult as _, CreateIdCaptureOnlyActorOptions as a, UploadIdImageParams as b, IdCaptureOnlyMachine as c, IdCaptureActor as d, createIdCaptureActor as f, FinalizedIdRecording as g, AddBarcodeParams as h, createIdCaptureManagerFromActor as i, processId as j, pauseRecordingForAttempt as k, idCaptureOnlyMachine as l, idCaptureMachine as m, IdCaptureManager as n, IdCaptureOnlyActor as o, IdCaptureMachine as p, IdCaptureState as r, createIdCaptureOnlyActor as s, createIdCaptureManager as t, CreateIdCaptureActorOptions as u, InitializeIdCaptureParams as v, barcodeToBase64 as w, UploadManualIdFileParams as x, StartRecordingParams as y };
644
+ export { pauseRecordingForAttempt as A, WasmUtilProvider as B, addBarcode as C, getRealQualityValue as D, finalizeRecordingSession as E, stopRecording as F, stopStream as I, uploadIdImage as L, processId as M, resumeRecordingAfterPause as N, initializeIdCapture as O, startRecordingSession as P, uploadManualIdFile as R, ValidationError as S, disposeRecordingSession as T, IdCaptureInitResult as _, CreateIdCaptureOnlyActorOptions as a, UploadIdImageParams as b, IdCaptureOnlyMachine as c, IdCaptureActor as d, createIdCaptureActor as f, FinalizedIdRecording as g, AddBarcodeParams as h, createIdCaptureManagerFromActor as i, prepareRecordingForCameraRetry as j, isSuspendableRecordingSession as k, idCaptureOnlyMachine as l, idCaptureMachine as m, IdCaptureManager as n, IdCaptureOnlyActor as o, IdCaptureMachine as p, IdCaptureState as r, createIdCaptureOnlyActor as s, createIdCaptureManager as t, CreateIdCaptureActorOptions as u, InitializeIdCaptureParams as v, barcodeToBase64 as w, UploadManualIdFileParams as x, StartRecordingParams as y, validateUploadResponse as z };