idmission-web-sdk 2.1.76 → 2.1.77

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.
@@ -215,7 +215,7 @@
215
215
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
216
216
  };
217
217
 
218
- var webSdkVersion = '2.1.76';
218
+ var webSdkVersion = '2.1.77';
219
219
 
220
220
  function getPlatform() {
221
221
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -17269,38 +17269,23 @@
17269
17269
  _b = _a.borderOpacity,
17270
17270
  borderOpacity = _b === void 0 ? 1 : _b,
17271
17271
  _c = _a.progress,
17272
- progress = _c === void 0 ? 1 : _c,
17272
+ progress = _c === void 0 ? 0 : _c,
17273
17273
  _d = _a.progressPaused,
17274
17274
  progressPaused = _d === void 0 ? false : _d,
17275
17275
  _e = _a.isProgressBar,
17276
17276
  isProgressBar = _e === void 0 ? false : _e,
17277
17277
  props = __rest(_a, ["borderRadius", "borderColor", "borderWidth", "borderOpacity", "progress", "progressPaused", "isProgressBar"]);
17278
- var rectRef = React.useRef(null);
17279
17278
  var _f = React.useState(0),
17280
17279
  totalLength = _f[0],
17281
17280
  setTotalLength = _f[1];
17282
17281
  var resolvedProgress = progress * totalLength;
17283
- React.useLayoutEffect(function () {
17284
- if (totalLength > 0) return;
17285
- var interval;
17286
- var measuredLength = 0;
17287
- function measureTotalLength() {
17288
- var _a, _b;
17289
- try {
17290
- measuredLength = (_b = (_a = rectRef.current) === null || _a === void 0 ? void 0 : _a.getTotalLength()) !== null && _b !== void 0 ? _b : 0;
17291
- if (measuredLength === 0) return;
17292
- setTotalLength(measuredLength);
17293
- if (interval) clearInterval(interval);
17294
- } catch (e) {
17295
- warn('failed to measure SVG length', e);
17296
- }
17282
+ var rectRef = function rectRef(r) {
17283
+ try {
17284
+ if (isProgressBar && r) setTotalLength(r.getTotalLength());
17285
+ } catch (e) {
17286
+ debug('failed to measure SVG length', e);
17297
17287
  }
17298
- measureTotalLength();
17299
- if (measuredLength === 0) interval = setInterval(measureTotalLength, 250);
17300
- return function () {
17301
- if (interval) clearInterval(interval);
17302
- };
17303
- }, [totalLength]);
17288
+ };
17304
17289
  return /*#__PURE__*/React.createElement(SvgOverlay, _assign({
17305
17290
  height: "100%",
17306
17291
  fill: "none",
@@ -17333,7 +17318,7 @@
17333
17318
  }
17334
17319
  var IdCardBorderContainer = styled.div(templateObject_3$j || (templateObject_3$j = __makeTemplateObject(["\n & > .pulse {\n position: absolute;\n animation: glow-grow 2s ease-out infinite;\n\n &:nth-child(2) {\n animation-delay: 0.66s;\n }\n\n &:nth-child(3) {\n animation-delay: 1.33s;\n }\n }\n\n @keyframes glow-grow {\n 0% {\n opacity: 0;\n transform: scale(1);\n }\n 50% {\n opacity: 1;\n }\n 100% {\n transform: scale(2);\n opacity: 0;\n }\n }\n"], ["\n & > .pulse {\n position: absolute;\n animation: glow-grow 2s ease-out infinite;\n\n &:nth-child(2) {\n animation-delay: 0.66s;\n }\n\n &:nth-child(3) {\n animation-delay: 1.33s;\n }\n }\n\n @keyframes glow-grow {\n 0% {\n opacity: 0;\n transform: scale(1);\n }\n 50% {\n opacity: 1;\n }\n 100% {\n transform: scale(2);\n opacity: 0;\n }\n }\n"])));
17335
17320
  var SvgOverlay = styled.svg(templateObject_4$d || (templateObject_4$d = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n"])));
17336
- var IdCardBorderRect = styled.rect(templateObject_5$8 || (templateObject_5$8 = __makeTemplateObject(["\n &.progress {\n width: 100%;\n height: 100%;\n animation: dash ", "\n ", ";\n }\n\n &.paused {\n animation-play-state: paused;\n }\n\n @keyframes dash {\n to {\n stroke-dashoffset: 0;\n }\n }\n"], ["\n &.progress {\n width: 100%;\n height: 100%;\n animation: dash ", "\n ", ";\n }\n\n &.paused {\n animation-play-state: paused;\n }\n\n @keyframes dash {\n to {\n stroke-dashoffset: 0;\n }\n }\n"])), function (props) {
17321
+ var IdCardBorderRect = styled.rect(templateObject_5$8 || (templateObject_5$8 = __makeTemplateObject(["\n &.progress {\n animation: dash ", "\n ", ";\n }\n\n &.paused {\n animation-play-state: paused;\n }\n\n @keyframes dash {\n to {\n stroke-dashoffset: 0;\n }\n }\n"], ["\n &.progress {\n animation: dash ", "\n ", ";\n }\n\n &.paused {\n animation-play-state: paused;\n }\n\n @keyframes dash {\n to {\n stroke-dashoffset: 0;\n }\n }\n"])), function (props) {
17337
17322
  var _a;
17338
17323
  return (_a = props.$speed) !== null && _a !== void 0 ? _a : '3s';
17339
17324
  }, function (props) {
@@ -23328,14 +23313,13 @@
23328
23313
  idCardGuideStatus = _1 === void 0 ? 'ready' : _1,
23329
23314
  idCardGuideBorderWidth = _a.idCardGuideBorderWidth,
23330
23315
  idCardGuideBorderColor = _a.idCardGuideBorderColor,
23331
- _2 = _a.idCardCaptureProgress,
23332
- idCardCaptureProgress = _2 === void 0 ? 0 : _2,
23333
- _3 = _a.idCardCaptureGuideImages,
23334
- userSuppliedImages = _3 === void 0 ? defaultIdCaptureGuideImages : _3,
23335
- _4 = _a.classNames,
23336
- classNames = _4 === void 0 ? {} : _4,
23337
- _5 = _a.verbiage,
23338
- rawVerbiage = _5 === void 0 ? {} : _5;
23316
+ idCardCaptureProgress = _a.idCardCaptureProgress,
23317
+ _2 = _a.idCardCaptureGuideImages,
23318
+ userSuppliedImages = _2 === void 0 ? defaultIdCaptureGuideImages : _2,
23319
+ _3 = _a.classNames,
23320
+ classNames = _3 === void 0 ? {} : _3,
23321
+ _4 = _a.verbiage,
23322
+ rawVerbiage = _4 === void 0 ? {} : _4;
23339
23323
  var cameraRef = React.useContext(CameraStateContext).cameraRef;
23340
23324
  var verbiage = useTranslations(rawVerbiage, {
23341
23325
  idFrontInstructionText: 'Display the front of your ID card...',
@@ -23349,17 +23333,17 @@
23349
23333
  if (faceGuideBorderColor === undefined) faceGuideBorderColor = (_j = satisfied ? (_f = (_e = theme.idVideoCapture) === null || _e === void 0 ? void 0 : _e.faceGuides) === null || _f === void 0 ? void 0 : _f.satisfiedColor : (_h = (_g = theme.idVideoCapture) === null || _g === void 0 ? void 0 : _g.faceGuides) === null || _h === void 0 ? void 0 : _h.unsatisfiedColor) !== null && _j !== void 0 ? _j : '#D6DCE7';
23350
23334
  if (idCardGuideBorderWidth === undefined) idCardGuideBorderWidth = (_m = (_l = (_k = theme.idVideoCapture) === null || _k === void 0 ? void 0 : _k.idCardGuides) === null || _l === void 0 ? void 0 : _l.borderWidth) !== null && _m !== void 0 ? _m : 20;
23351
23335
  if (idCardGuideBorderColor === undefined) idCardGuideBorderColor = (_s = satisfied ? (_p = (_o = theme.idVideoCapture) === null || _o === void 0 ? void 0 : _o.idCardGuides) === null || _p === void 0 ? void 0 : _p.satisfiedColor : (_r = (_q = theme.idVideoCapture) === null || _q === void 0 ? void 0 : _q.idCardGuides) === null || _r === void 0 ? void 0 : _r.unsatisfiedColor) !== null && _s !== void 0 ? _s : '#D6DCE7';
23352
- var _6 = useResizeObserver(),
23353
- idCardGuideRef = _6.ref,
23354
- _7 = _6.width,
23355
- idCardGuideWidth = _7 === void 0 ? 0 : _7,
23356
- _8 = _6.height,
23357
- idCardGuideHeight = _8 === void 0 ? 0 : _8;
23336
+ var _5 = useResizeObserver(),
23337
+ idCardGuideRef = _5.ref,
23338
+ _6 = _5.width,
23339
+ idCardGuideWidth = _6 === void 0 ? 0 : _6,
23340
+ _7 = _5.height,
23341
+ idCardGuideHeight = _7 === void 0 ? 0 : _7;
23358
23342
  var idCaptureGuideImages = useGuideImages(userSuppliedImages);
23359
23343
  var idCaptureGuideImagesByUrl = useGuideImagesByUrl(idCaptureGuideImages);
23360
- var _9 = React.useState(undefined),
23361
- aspectRatio = _9[0],
23362
- setAspectRatio = _9[1];
23344
+ var _8 = React.useState(undefined),
23345
+ aspectRatio = _8[0],
23346
+ setAspectRatio = _8[1];
23363
23347
  var onImageLoaded = React.useCallback(function (e) {
23364
23348
  var _a, _b, _c, _d;
23365
23349
  var img = e.currentTarget;
@@ -23401,7 +23385,7 @@
23401
23385
  borderColor: idCardGuideBorderColor,
23402
23386
  aspectRatio: aspectRatio,
23403
23387
  "$isVisible": requestedAction !== 'FLIP_ID',
23404
- progress: requestedAction === 'VERIFY_LIVENESS' ? 0 : idCardCaptureProgress
23388
+ progress: requestedAction === 'VERIFY_LIVENESS' ? undefined : idCardCaptureProgress
23405
23389
  }, /*#__PURE__*/React.createElement(IdCardGuideImage, {
23406
23390
  alt: "",
23407
23391
  className: classNames.idCardGuideImage,
@@ -23928,7 +23912,7 @@
23928
23912
  requestedAction: requestedAction,
23929
23913
  satisfied: satisfied,
23930
23914
  idCardGuideStatus: countdownStartedAt ? 'capturing' : 'ready',
23931
- idCardCaptureProgress: countdownStartedAt ? 1 : 0,
23915
+ idCardCaptureProgress: !!countdownStartedAt ? 1 : 0,
23932
23916
  idCardCaptureGuideImages: idCardCaptureGuideImages,
23933
23917
  faceGuideBorderColor: satisfied ? colors.guidesSatisfiedColor : colors.guidesUnsatisfiedColor,
23934
23918
  idCardGuideBorderColor: satisfied ? colors.guidesSatisfiedColor : colors.guidesUnsatisfiedColor