idmission-web-sdk 2.5.64 → 2.5.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/sdk2.esm.js CHANGED
@@ -23186,6 +23186,19 @@ function reduceSelfieCapture(state, event) {
23186
23186
  error: null
23187
23187
  });
23188
23188
  }
23189
+ // The exit button: abandon the attempt and put the instructions back up.
23190
+ // 'captureStarted' accepts 'loading', so the overlay's continue starts a
23191
+ // fresh attempt from here.
23192
+ case 'exitRequested':
23193
+ {
23194
+ if (state.phase === 'initializing' || state.phase === 'loading') return state;
23195
+ return _extends({}, state, {
23196
+ phase: 'loading'
23197
+ }, clearedSelfieVerdict(), {
23198
+ capturedSelfie: null,
23199
+ error: null
23200
+ });
23201
+ }
23189
23202
  }
23190
23203
  }
23191
23204
  // The ladder's code, except that HOLD_STILL reads HAND_OVER_FACE while the
@@ -25495,6 +25508,37 @@ function createSelfieCaptureController(config) {
25495
25508
  return _doAttach.apply(this, arguments);
25496
25509
  }
25497
25510
  var cameraReacquisition = null;
25511
+ // sdk2's retry and exit both remount FaceLivenessCapture with a new `key`
25512
+ // (FaceLivenessWizard.tsx:394-409), which throws away that component's
25513
+ // whole reducer -- INCLUDING timesLivenessCheckFailed -- so the user gets a
25514
+ // fresh set of liveness attempts. Rebuilding the machine here is that
25515
+ // remount's equivalent; without it a retry from the lockout screen
25516
+ // re-entered capture with the failure budget still spent, and the next
25517
+ // failed check re-locked immediately.
25518
+ function resetLivenessAttempt() {
25519
+ clearTimer('liveness:reset');
25520
+ clearTimer('liveness:kickout');
25521
+ clearTimer('liveness:kickoutGrace');
25522
+ // The challenge runner and its tick are NOT reducer state, so the
25523
+ // setState below cannot reach them -- runLivenessEffects runs only from
25524
+ // dispatchLiveness. Leaving CHALLENGE otherwise left the discarded runner
25525
+ // ticking, still able to fire onChallengeComplete for an attempt the user
25526
+ // had abandoned.
25527
+ clearTimer('challenge:tick');
25528
+ challengeRunner = null;
25529
+ challengeResultConsumed = false;
25530
+ // Orphan any check still in flight: its verdict would otherwise land in
25531
+ // the machine built below (the reducer's livenessChecked case is
25532
+ // unguarded), and its single-flight latch would block the fresh attempt
25533
+ // from checking at all until it settled.
25534
+ livenessGeneration += 1;
25535
+ livenessCheckInFlight = false;
25536
+ internal.setState({
25537
+ liveness: createInitialLivenessMachineState(),
25538
+ challenge: null,
25539
+ livenessTimedOut: false
25540
+ });
25541
+ }
25498
25542
  // retry()'s capture re-entry, run straight away or once a released camera
25499
25543
  // is back.
25500
25544
  function resumeCapture() {
@@ -25828,37 +25872,7 @@ function createSelfieCaptureController(config) {
25828
25872
  },
25829
25873
  retry: function retry() {
25830
25874
  if (!active) return;
25831
- // sdk2's retry remounts FaceLivenessCapture with a new `key`
25832
- // (FaceLivenessWizard.tsx:402-409), which throws away that
25833
- // component's whole reducer -- INCLUDING timesLivenessCheckFailed --
25834
- // so the user gets a fresh set of liveness attempts. Rebuilding the
25835
- // machine here is that remount's equivalent; without it a retry from
25836
- // the lockout screen re-entered capture with the failure budget still
25837
- // spent, and the next failed check re-locked immediately.
25838
- if (config.liveness) {
25839
- clearTimer('liveness:reset');
25840
- clearTimer('liveness:kickout');
25841
- clearTimer('liveness:kickoutGrace');
25842
- // The challenge runner and its tick are NOT reducer state, so the
25843
- // setState below cannot reach them -- runLivenessEffects runs only
25844
- // from dispatchLiveness. Retrying out of CHALLENGE otherwise left
25845
- // the discarded runner ticking, still able to fire
25846
- // onChallengeComplete for an attempt the user had abandoned.
25847
- clearTimer('challenge:tick');
25848
- challengeRunner = null;
25849
- challengeResultConsumed = false;
25850
- // Orphan any check still in flight: its verdict would otherwise land
25851
- // in the machine built below (the reducer's livenessChecked case is
25852
- // unguarded), and its single-flight latch would block the fresh
25853
- // attempt from checking at all until it settled.
25854
- livenessGeneration += 1;
25855
- livenessCheckInFlight = false;
25856
- internal.setState({
25857
- liveness: createInitialLivenessMachineState(),
25858
- challenge: null,
25859
- livenessTimedOut: false
25860
- });
25861
- }
25875
+ if (config.liveness) resetLivenessAttempt();
25862
25876
  progress.retry('capture-error');
25863
25877
  dispatch({
25864
25878
  type: 'retryRequested'
@@ -25875,12 +25889,43 @@ function createSelfieCaptureController(config) {
25875
25889
  if (cameraReacquisition) return;
25876
25890
  var generation = attachGeneration;
25877
25891
  var reacquisition = requestCamera().then(function () {
25878
- if (active && generation === attachGeneration) resumeCapture();
25892
+ // exitCapture() may have sent the user back to the instructions
25893
+ // while the camera was coming back.
25894
+ if (active && generation === attachGeneration && internal.getState().phase === 'capturing') resumeCapture();
25879
25895
  })["catch"](function () {})["finally"](function () {
25880
25896
  // detach() may have dropped this one and a newer one started.
25881
25897
  if (cameraReacquisition === reacquisition) cameraReacquisition = null;
25882
25898
  });
25883
25899
  cameraReacquisition = reacquisition;
25900
+ },
25901
+ exitCapture: function exitCapture() {
25902
+ var _frameLoop9;
25903
+ if (!active) return;
25904
+ var _internal$getState = internal.getState(),
25905
+ phase = _internal$getState.phase;
25906
+ if (phase === 'initializing' || phase === 'loading') return;
25907
+ // Every armed timer belongs to the abandoned attempt.
25908
+ clearAllTimers();
25909
+ (_frameLoop9 = frameLoop) == null || _frameLoop9.stop();
25910
+ frameLoop = null;
25911
+ trackingOnly = false;
25912
+ initialDelayOver = false;
25913
+ busy = false;
25914
+ pendingFire = null;
25915
+ if (config.liveness) resetLivenessAttempt();
25916
+ progress.retry('user-requested');
25917
+ internal.setState({
25918
+ capturedAttempt: null,
25919
+ capturedImageUrl: null,
25920
+ captureRecovery: null
25921
+ });
25922
+ dispatch({
25923
+ type: 'exitRequested'
25924
+ });
25925
+ // The overlay waits on `camera.ready`, so a camera handed back by a
25926
+ // terminal screen has to come back for its continue to enable. A
25927
+ // failure lands in `error` (requestCamera's own write).
25928
+ if (cameraReleased && !cameraReacquisition) void requestCamera()["catch"](function () {});
25884
25929
  }
25885
25930
  }
25886
25931
  }, progressBinding);
@@ -27627,6 +27672,13 @@ function SelfieCaptureSurface(_ref) {
27627
27672
  void controller.actions.start();
27628
27673
  onLoadingOverlayDismissed == null || onLoadingOverlayDismissed();
27629
27674
  }, [controller, onLoadingOverlayDismissed]);
27675
+ // Back to the instructions BEFORE telling the host, as sdk2 did
27676
+ // (FaceLivenessWizard.tsx:394): handing `onExit` to the button raw left the
27677
+ // capture running behind a host that expected the loading screen.
27678
+ var handleExit = useCallback(function () {
27679
+ controller.actions.exitCapture();
27680
+ onExit == null || onExit();
27681
+ }, [controller, onExit]);
27630
27682
  // plan-3 ruling: camera-acquisition errors recover via requestCamera()
27631
27683
  // (retry() explicitly excludes them, controller.ts), everything else via
27632
27684
  // retry(). Applies unconditionally across every loadingOverlayMode.
@@ -27725,7 +27777,7 @@ function SelfieCaptureSurface(_ref) {
27725
27777
  children: [jsx("br", {}), state.handOverFace.lastCheck ? state.handOverFace.lastCheck.handOverFace ? '❌' : '✅' : '➖', ' ', "Hand Off Face (", state.handOverFace.status, state.handOverFace.lastCheck && ", last check " + state.handOverFace.lastCheck.coverage.toFixed(2) + " covered in " + Math.round(state.handOverFace.lastCheck.inferenceMs) + " ms", ")"]
27726
27778
  })]
27727
27779
  }), onExit != null && jsx(ExitCaptureButton, {
27728
- onClick: onExit,
27780
+ onClick: handleExit,
27729
27781
  className: classNames.exitBtn
27730
27782
  }), showLoadingOverlay && jsx(SelfieCaptureLoadingOverlay, {
27731
27783
  state: loadingOverlayState,
@@ -48035,7 +48087,7 @@ function mapCustomerIdAndBiometricsEnrollmentProps(props, ctx) {
48035
48087
  });
48036
48088
  }
48037
48089
 
48038
- var webSdkVersion = '2.5.64';
48090
+ var webSdkVersion = '2.5.65';
48039
48091
 
48040
48092
  var MAPPED = 'mapped';
48041
48093
  var NOOP = 'dropped-noop';