idmission-web-sdk 2.2.170 → 2.2.171

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.
@@ -211,7 +211,7 @@
211
211
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
212
212
  };
213
213
 
214
- var webSdkVersion = '2.2.170';
214
+ var webSdkVersion = '2.2.171';
215
215
 
216
216
  function getPlatform() {
217
217
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -23443,20 +23443,22 @@
23443
23443
  faceGuideBorderWidth = _a.faceGuideBorderWidth,
23444
23444
  faceGuideBorderColor = _a.faceGuideBorderColor,
23445
23445
  onClearSignaturePadClicked = _a.onClearSignaturePadClicked,
23446
- _d = _a.classNames,
23447
- classNames = _d === void 0 ? {} : _d,
23448
- _e = _a.verbiage,
23449
- rawVerbiage = _e === void 0 ? {} : _e;
23450
- var _f = useResizeObserver(),
23451
- ref = _f.ref,
23452
- width = _f.width,
23453
- height = _f.height;
23454
- var _g = useVideoSignatureContext(),
23455
- signaturePad = _g.signaturePad,
23456
- onAcceptClicked = _g.onAcceptClicked;
23457
- var _h = React.useState(true),
23458
- isSignaturePadEmpty = _h[0],
23459
- setIsSignaturePadEmpty = _h[1];
23446
+ _d = _a.minSignaturePadPoints,
23447
+ minSignaturePadPoints = _d === void 0 ? DEFAULT_MIN_SIGNATURE_PAD_POINTS : _d,
23448
+ _e = _a.classNames,
23449
+ classNames = _e === void 0 ? {} : _e,
23450
+ _f = _a.verbiage,
23451
+ rawVerbiage = _f === void 0 ? {} : _f;
23452
+ var _g = useResizeObserver(),
23453
+ ref = _g.ref,
23454
+ width = _g.width,
23455
+ height = _g.height;
23456
+ var _h = useVideoSignatureContext(),
23457
+ signaturePad = _h.signaturePad,
23458
+ onAcceptClicked = _h.onAcceptClicked;
23459
+ var _j = React.useState(true),
23460
+ isSignaturePadEmpty = _j[0],
23461
+ setIsSignaturePadEmpty = _j[1];
23460
23462
  var verbiage = useTranslations(rawVerbiage, {
23461
23463
  clearSignatureBtnText: 'Clear',
23462
23464
  acceptSignatureBtnText: 'Accept'
@@ -23492,8 +23494,13 @@
23492
23494
  }, /*#__PURE__*/React.createElement(SignatureCanvas, {
23493
23495
  ref: signaturePad,
23494
23496
  canvasProps: canvasProps,
23495
- onBegin: function onBegin() {
23496
- return setIsSignaturePadEmpty(false);
23497
+ onEnd: function onEnd() {
23498
+ var _a, _b;
23499
+ var strokes = (_b = (_a = signaturePad === null || signaturePad === void 0 ? void 0 : signaturePad.current) === null || _a === void 0 ? void 0 : _a.toData()) !== null && _b !== void 0 ? _b : [];
23500
+ var points = strokes.flatMap(function (point) {
23501
+ return point;
23502
+ });
23503
+ setIsSignaturePadEmpty(points.length >= minSignaturePadPoints);
23497
23504
  }
23498
23505
  })), /*#__PURE__*/React.createElement(SignatureButtonsContainer, {
23499
23506
  className: classNames.signatureButtonsRow
@@ -23530,6 +23537,7 @@
23530
23537
  var AcceptBtn = styled(LoaderButton)(templateObject_7$1 || (templateObject_7$1 = __makeTemplateObject(["\n margin-left: auto;\n"], ["\n margin-left: auto;\n"])));
23531
23538
  var templateObject_1$9, templateObject_2$8, templateObject_3$8, templateObject_4$3, templateObject_5$2, templateObject_6$2, templateObject_7$1;
23532
23539
 
23540
+ var DEFAULT_MIN_SIGNATURE_PAD_POINTS = 5;
23533
23541
  var VideoSignatureCapture = function VideoSignatureCapture(_a) {
23534
23542
  var _b;
23535
23543
  var onVideoCaptured = _a.onVideoCaptured,
@@ -23538,26 +23546,28 @@
23538
23546
  _c = _a.restartVideoOnSignaturePadCleared,
23539
23547
  restartVideoOnSignaturePadCleared = _c === void 0 ? true : _c,
23540
23548
  guidesComponent = _a.guidesComponent,
23541
- _d = _a.classNames,
23542
- classNames = _d === void 0 ? {} : _d,
23543
- _e = _a.colors,
23544
- colors = _e === void 0 ? {} : _e,
23545
- _f = _a.verbiage,
23546
- rawVerbiage = _f === void 0 ? {} : _f,
23547
- _g = _a.debugMode,
23548
- debugMode = _g === void 0 ? false : _g;
23549
+ _d = _a.minSignaturePadPoints,
23550
+ minSignaturePadPoints = _d === void 0 ? DEFAULT_MIN_SIGNATURE_PAD_POINTS : _d,
23551
+ _e = _a.classNames,
23552
+ classNames = _e === void 0 ? {} : _e,
23553
+ _f = _a.colors,
23554
+ colors = _f === void 0 ? {} : _f,
23555
+ _g = _a.verbiage,
23556
+ rawVerbiage = _g === void 0 ? {} : _g,
23557
+ _h = _a.debugMode,
23558
+ debugMode = _h === void 0 ? false : _h;
23549
23559
  var camera = useCameraStore(function (state) {
23550
23560
  return state.camera;
23551
23561
  });
23552
23562
  var onPredictionMade = React.useContext(SelfieGuidanceModelsContext).onPredictionMade;
23553
- var _h = useVideoSignatureContext(),
23554
- signatureData = _h.signatureData,
23555
- signatureDataUrl = _h.signatureDataUrl,
23556
- signatureVideoData = _h.signatureVideoData,
23557
- startRecording = _h.startRecording,
23558
- stopRecording = _h.stopRecording,
23559
- clearRecordedData = _h.clearRecordedData,
23560
- isRecording = _h.isRecording;
23563
+ var _j = useVideoSignatureContext(),
23564
+ signatureData = _j.signatureData,
23565
+ signatureDataUrl = _j.signatureDataUrl,
23566
+ signatureVideoData = _j.signatureVideoData,
23567
+ startRecording = _j.startRecording,
23568
+ stopRecording = _j.stopRecording,
23569
+ clearRecordedData = _j.clearRecordedData,
23570
+ isRecording = _j.isRecording;
23561
23571
  React.useEffect(function () {
23562
23572
  startRecording();
23563
23573
  return stopRecording;
@@ -23572,9 +23582,9 @@
23572
23582
  onVideoCaptured === null || onVideoCaptured === void 0 ? void 0 : onVideoCaptured(signatureVideoData, signatureData, signatureDataUrl);
23573
23583
  }
23574
23584
  }, [onVideoCaptured, signatureData, signatureDataUrl, signatureVideoData]);
23575
- var _j = React.useState(0),
23576
- numFramesWithoutFaces = _j[0],
23577
- setNumFramesWithoutFaces = _j[1];
23585
+ var _k = React.useState(0),
23586
+ numFramesWithoutFaces = _k[0],
23587
+ setNumFramesWithoutFaces = _k[1];
23578
23588
  React.useEffect(function () {
23579
23589
  onPredictionMade(function (_a) {
23580
23590
  var face = _a.face;
@@ -23601,6 +23611,7 @@
23601
23611
  }, verbiage.guidanceMessageText))), /*#__PURE__*/React.createElement(GuidesComponent, {
23602
23612
  status: "success",
23603
23613
  classNames: classNames.videoSignatureGuidesClassNames,
23614
+ minSignaturePadPoints: minSignaturePadPoints,
23604
23615
  onClearSignaturePadClicked: restartVideoOnSignaturePadCleared ? function () {
23605
23616
  return setTimeout(clearRecordedData, 100);
23606
23617
  } : undefined
@@ -23681,41 +23692,43 @@
23681
23692
  skipSuccessScreen = _d === void 0 ? false : _d,
23682
23693
  _e = _a.captureAudio,
23683
23694
  captureAudio = _e === void 0 ? false : _e,
23684
- _f = _a.allowSignatureAfterLivenessCheckFailure,
23685
- allowSignatureAfterLivenessCheckFailure = _f === void 0 ? false : _f,
23686
- _g = _a.restartVideoOnSignaturePadCleared,
23687
- restartVideoOnSignaturePadCleared = _g === void 0 ? true : _g,
23695
+ _f = _a.minSignaturePadPoints,
23696
+ minSignaturePadPoints = _f === void 0 ? DEFAULT_MIN_SIGNATURE_PAD_POINTS : _f,
23697
+ _g = _a.allowSignatureAfterLivenessCheckFailure,
23698
+ allowSignatureAfterLivenessCheckFailure = _g === void 0 ? false : _g,
23699
+ _h = _a.restartVideoOnSignaturePadCleared,
23700
+ restartVideoOnSignaturePadCleared = _h === void 0 ? true : _h,
23688
23701
  faceLivenessProps = _a.faceLivenessProps,
23689
- _h = _a.assets,
23690
- assets = _h === void 0 ? {} : _h,
23691
- _j = _a.classNames,
23692
- classNames = _j === void 0 ? {} : _j,
23693
- _k = _a.colors,
23694
- colors = _k === void 0 ? {} : _k,
23695
- _l = _a.verbiage,
23696
- verbiage = _l === void 0 ? {} : _l,
23697
- _m = _a.debugMode,
23698
- debugMode = _m === void 0 ? false : _m;
23699
- var _o = React.useContext(SubmissionContext),
23700
- selfieImage = _o.selfieImage,
23701
- setSelfieImage = _o.setSelfieImage,
23702
- setSignatureData = _o.setSignatureData,
23703
- setSignatureVideoUrl = _o.setSignatureVideoUrl,
23704
- logSelfieCaptureAttempt = _o.logSelfieCaptureAttempt;
23702
+ _j = _a.assets,
23703
+ assets = _j === void 0 ? {} : _j,
23704
+ _k = _a.classNames,
23705
+ classNames = _k === void 0 ? {} : _k,
23706
+ _l = _a.colors,
23707
+ colors = _l === void 0 ? {} : _l,
23708
+ _m = _a.verbiage,
23709
+ verbiage = _m === void 0 ? {} : _m,
23710
+ _o = _a.debugMode,
23711
+ debugMode = _o === void 0 ? false : _o;
23712
+ var _p = React.useContext(SubmissionContext),
23713
+ selfieImage = _p.selfieImage,
23714
+ setSelfieImage = _p.setSelfieImage,
23715
+ setSignatureData = _p.setSignatureData,
23716
+ setSignatureVideoUrl = _p.setSignatureVideoUrl,
23717
+ logSelfieCaptureAttempt = _p.logSelfieCaptureAttempt;
23705
23718
  var cameraAccessDenied = useCameraStore(useShallow(function (state) {
23706
23719
  return {
23707
23720
  cameraAccessDenied: state.cameraAccessDenied
23708
23721
  };
23709
23722
  })).cameraAccessDenied;
23710
- var _p = React.useState('CHECKING_LIVENESS'),
23711
- captureState = _p[0],
23712
- setCaptureState = _p[1];
23723
+ var _q = React.useState('CHECKING_LIVENESS'),
23724
+ captureState = _q[0],
23725
+ setCaptureState = _q[1];
23713
23726
  var operationStartedAt = React.useRef();
23714
23727
  var captureStartedAt = React.useRef();
23715
23728
  var captureEndedAt = React.useRef();
23716
- var _q = React.useContext(SelfieGuidanceModelsContext),
23717
- start = _q.start,
23718
- stop = _q.stop;
23729
+ var _r = React.useContext(SelfieGuidanceModelsContext),
23730
+ start = _r.start,
23731
+ stop = _r.stop;
23719
23732
  React.useEffect(function () {
23720
23733
  operationStartedAt.current = new Date();
23721
23734
  }, []);
@@ -23751,9 +23764,9 @@
23751
23764
  setSelfieImage(selfieFromRequest);
23752
23765
  }
23753
23766
  }, [logCaptureMetadata, onFaceLivenessSuccessProp, selfieImage, setSelfieImage]);
23754
- var _r = React.useState(null),
23755
- signatureImageUrl = _r[0],
23756
- setSignatureImageUrl = _r[1];
23767
+ var _s = React.useState(null),
23768
+ signatureImageUrl = _s[0],
23769
+ setSignatureImageUrl = _s[1];
23757
23770
  var onSignatureCaptureCompleted = React.useCallback(function (videoData, signatureData, signatureImageData) {
23758
23771
  setSignatureData(signatureData);
23759
23772
  setSignatureVideoUrl(URL.createObjectURL(videoData));
@@ -23764,9 +23777,9 @@
23764
23777
  var onSignatureCaptureFacesNotDetected = React.useCallback(function () {
23765
23778
  setCaptureState('CHECKING_LIVENESS');
23766
23779
  }, []);
23767
- var _s = React.useState(0),
23768
- attempt = _s[0],
23769
- setAttempt = _s[1];
23780
+ var _t = React.useState(0),
23781
+ attempt = _t[0],
23782
+ setAttempt = _t[1];
23770
23783
  var onRetry = React.useCallback(function () {
23771
23784
  onRetryClicked === null || onRetryClicked === void 0 ? void 0 : onRetryClicked();
23772
23785
  setAttempt(function (n) {
@@ -23833,6 +23846,7 @@
23833
23846
  onVideoCaptured: onSignatureCaptureCompleted,
23834
23847
  onFaceNotDetected: onSignatureCaptureFacesNotDetected,
23835
23848
  onExit: onExitCapture,
23849
+ minSignaturePadPoints: minSignaturePadPoints,
23836
23850
  restartVideoOnSignaturePadCleared: restartVideoOnSignaturePadCleared,
23837
23851
  guidesComponent: guidesComponent,
23838
23852
  classNames: classNames,
@@ -27524,22 +27538,24 @@
27524
27538
  _e = _a.captureAudio,
27525
27539
  captureAudio = _e === void 0 ? false : _e,
27526
27540
  idCardForFaceMatch = _a.idCardForFaceMatch,
27527
- _f = _a.modelLoadTimeoutMs,
27528
- modelLoadTimeoutMs = _f === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _f,
27529
- _g = _a.allowSignatureAfterLivenessCheckFailure,
27530
- allowSignatureAfterLivenessCheckFailure = _g === void 0 ? false : _g,
27531
- _h = _a.restartVideoOnSignaturePadCleared,
27532
- restartVideoOnSignaturePadCleared = _h === void 0 ? true : _h,
27541
+ _f = _a.minSignaturePadPoints,
27542
+ minSignaturePadPoints = _f === void 0 ? DEFAULT_MIN_SIGNATURE_PAD_POINTS : _f,
27543
+ _g = _a.modelLoadTimeoutMs,
27544
+ modelLoadTimeoutMs = _g === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _g,
27545
+ _h = _a.allowSignatureAfterLivenessCheckFailure,
27546
+ allowSignatureAfterLivenessCheckFailure = _h === void 0 ? false : _h,
27547
+ _j = _a.restartVideoOnSignaturePadCleared,
27548
+ restartVideoOnSignaturePadCleared = _j === void 0 ? true : _j,
27533
27549
  faceLivenessProps = _a.faceLivenessProps,
27534
- _j = _a.theme,
27535
- theme = _j === void 0 ? 'default' : _j,
27550
+ _k = _a.theme,
27551
+ theme = _k === void 0 ? 'default' : _k,
27536
27552
  classNames = _a.classNames,
27537
27553
  colors = _a.colors,
27538
27554
  verbiage = _a.verbiage,
27539
27555
  geolocationEnabled = _a.geolocationEnabled,
27540
27556
  geolocationRequired = _a.geolocationRequired,
27541
- _k = _a.debugMode,
27542
- debugMode = _k === void 0 ? false : _k;
27557
+ _l = _a.debugMode,
27558
+ debugMode = _l === void 0 ? false : _l;
27543
27559
  useLanguage(lang);
27544
27560
  useDebugLogging(debugMode);
27545
27561
  return /*#__PURE__*/React.createElement(AuthProvider, {
@@ -27581,6 +27597,7 @@
27581
27597
  loadingOverlayMode: loadingOverlayMode,
27582
27598
  skipSuccessScreen: skipSuccessScreen,
27583
27599
  captureAudio: captureAudio,
27600
+ minSignaturePadPoints: minSignaturePadPoints,
27584
27601
  modelLoadTimeoutMs: modelLoadTimeoutMs,
27585
27602
  faceLivenessProps: faceLivenessProps,
27586
27603
  allowSignatureAfterLivenessCheckFailure: allowSignatureAfterLivenessCheckFailure,
@@ -27592,7 +27609,7 @@
27592
27609
  onModelError: onModelError,
27593
27610
  onUserCancel: onUserCancel
27594
27611
  };
27595
- }, [customOverlayContent, onLoadingOverlayDismissed, loadingOverlayMode, skipSuccessScreen, captureAudio, modelLoadTimeoutMs, faceLivenessProps, allowSignatureAfterLivenessCheckFailure, restartVideoOnSignaturePadCleared, classNames, colors, debugMode, verbiage, onModelError, onUserCancel])
27612
+ }, [customOverlayContent, onLoadingOverlayDismissed, loadingOverlayMode, skipSuccessScreen, captureAudio, minSignaturePadPoints, modelLoadTimeoutMs, faceLivenessProps, allowSignatureAfterLivenessCheckFailure, restartVideoOnSignaturePadCleared, classNames, colors, debugMode, verbiage, onModelError, onUserCancel])
27596
27613
  }))));
27597
27614
  };
27598
27615