idmission-web-sdk 2.3.82 → 2.3.84

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
@@ -205,7 +205,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
205
205
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
206
206
  };
207
207
 
208
- var webSdkVersion = '2.3.82';
208
+ var webSdkVersion = '2.3.84';
209
209
 
210
210
  function getPlatform() {
211
211
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -13661,6 +13661,13 @@ var Container$4 = styled.div(templateObject_1$c || (templateObject_1$c = __makeT
13661
13661
  var AcceptBtn$1 = styled(LoaderButton)(templateObject_2$b || (templateObject_2$b = __makeTemplateObject(["\n margin-left: auto;\n"], ["\n margin-left: auto;\n"])));
13662
13662
  var templateObject_1$c, templateObject_2$b;
13663
13663
 
13664
+ function isBlob(blobPart) {
13665
+ return typeof blobPart === 'object' && 'type' in blobPart;
13666
+ }
13667
+ function inferBlobType(blobPart) {
13668
+ return isBlob(blobPart) ? blobPart.type : undefined;
13669
+ }
13670
+
13664
13671
  var videoRecorder = null;
13665
13672
  var audioRecorder = null;
13666
13673
  var videoChunks = [];
@@ -13794,8 +13801,10 @@ var useVideoRecorder = function useVideoRecorder(mergeAVStreams) {
13794
13801
  useVideoRecorderStore.getState().clearRecordedData();
13795
13802
  }, []);
13796
13803
  var processVideo = useCallback(function () {
13804
+ var _a;
13805
+ var inferredType = (_a = inferBlobType(videoChunks[0])) !== null && _a !== void 0 ? _a : 'video/mp4';
13797
13806
  var videoBlob = new Blob(videoChunks, {
13798
- type: 'video/mp4'
13807
+ type: inferredType
13799
13808
  });
13800
13809
  useVideoRecorderStore.setState({
13801
13810
  videoUrl: URL.createObjectURL(videoBlob),
@@ -13920,18 +13929,20 @@ var useVideoSignatureStore = create()(devtools(function (set, get) {
13920
13929
  if (!signatureRecorder) return;
13921
13930
  signatureRecorder.stop();
13922
13931
  signatureRecorder.onstop = function () {
13932
+ var _a;
13933
+ var inferredType = (_a = inferBlobType(signatureChunks[0])) !== null && _a !== void 0 ? _a : 'video/mp4';
13923
13934
  var blob = new Blob(signatureChunks, {
13924
- type: 'video/mp4'
13935
+ type: inferredType
13925
13936
  });
13926
13937
  signatureChunks = [];
13927
13938
  signatureRecorder = null;
13928
13939
  if (!signatureData) return;
13929
- var _a = get(),
13930
- onSignatureVideoCaptured = _a.onSignatureVideoCaptured,
13931
- recordingStartedAt = _a.recordingStartedAt,
13932
- signatureStartedAt = _a.signatureStartedAt,
13933
- signatureEndedAt = _a.signatureEndedAt,
13934
- lastChunkReceivedAt = _a.lastChunkReceivedAt;
13940
+ var _b = get(),
13941
+ onSignatureVideoCaptured = _b.onSignatureVideoCaptured,
13942
+ recordingStartedAt = _b.recordingStartedAt,
13943
+ signatureStartedAt = _b.signatureStartedAt,
13944
+ signatureEndedAt = _b.signatureEndedAt,
13945
+ lastChunkReceivedAt = _b.lastChunkReceivedAt;
13935
13946
  var endMs = Math.min(signatureEndedAt !== null && signatureEndedAt !== void 0 ? signatureEndedAt : Infinity, lastChunkReceivedAt !== null && lastChunkReceivedAt !== void 0 ? lastChunkReceivedAt : Infinity);
13936
13947
  var signatureStartTimestamp = signatureStartedAt && recordingStartedAt ? formatTimestamp(Math.max(0, signatureStartedAt - recordingStartedAt - 500)) : undefined;
13937
13948
  var signatureEndTimestamp = endMs !== Infinity && recordingStartedAt ? formatTimestamp(Math.min(endMs - recordingStartedAt + 500, lastChunkReceivedAt !== null && lastChunkReceivedAt !== void 0 ? lastChunkReceivedAt : Infinity)) : undefined;
@@ -14284,14 +14295,11 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
14284
14295
  onHeadTrackingPredictionMade = _o.onPredictionMade,
14285
14296
  startHeadTracking = _o.start,
14286
14297
  stopHeadTracking = _o.stop;
14287
- var _p = useVideoSignatureStore(useShallow(function (state) {
14288
- return {
14289
- clearRecordedData: state.clearRecordedData,
14290
- firstChunkReceivedAt: state.firstChunkReceivedAt
14291
- };
14292
- })),
14293
- clearRecordedData = _p.clearRecordedData,
14294
- firstChunkReceivedAt = _p.firstChunkReceivedAt;
14298
+ var firstChunkReceivedAt = useVideoSignatureStore(useShallow(function (state) {
14299
+ return {
14300
+ firstChunkReceivedAt: state.firstChunkReceivedAt
14301
+ };
14302
+ })).firstChunkReceivedAt;
14295
14303
  useEffect(function () {
14296
14304
  useVideoSignatureStore.setState({
14297
14305
  onSignatureVideoCaptured: onSignatureVideoCaptured
@@ -14310,15 +14318,15 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
14310
14318
  var verbiage = useTranslations(rawVerbiage, {
14311
14319
  guidanceMessageText: 'Please sign the box below'
14312
14320
  });
14313
- var _q = useState(true),
14314
- headTrackingSatisfied = _q[0],
14315
- setHeadTrackingSatisfied = _q[1];
14316
- var _r = useState(null),
14317
- lastFace = _r[0],
14318
- setLastFace = _r[1];
14319
- var _s = useState(0),
14320
- numFramesWithoutFaces = _s[0],
14321
- setNumFramesWithoutFaces = _s[1];
14321
+ var _p = useState(true),
14322
+ headTrackingSatisfied = _p[0],
14323
+ setHeadTrackingSatisfied = _p[1];
14324
+ var _q = useState(null),
14325
+ lastFace = _q[0],
14326
+ setLastFace = _q[1];
14327
+ var _r = useState(0),
14328
+ numFramesWithoutFaces = _r[0],
14329
+ setNumFramesWithoutFaces = _r[1];
14322
14330
  onHeadTrackingPredictionMade(useThrottledCallback(useCallback(function (_a) {
14323
14331
  var face = _a.face;
14324
14332
  if (headTrackingDisabled) return;
@@ -14333,12 +14341,12 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
14333
14341
  return n + 1;
14334
14342
  });
14335
14343
  }, [headTrackingBoundaryPercentage, headTrackingBoundaryType, headTrackingDisabled, videoHeight, videoWidth]), 16));
14336
- var _t = useResizeObserver(),
14337
- ref = _t.ref,
14338
- _u = _t.width,
14339
- width = _u === void 0 ? 1 : _u,
14340
- _v = _t.height,
14341
- height = _v === void 0 ? 1 : _v;
14344
+ var _s = useResizeObserver(),
14345
+ ref = _s.ref,
14346
+ _t = _s.width,
14347
+ width = _t === void 0 ? 1 : _t,
14348
+ _u = _s.height,
14349
+ height = _u === void 0 ? 1 : _u;
14342
14350
  var debugScalingDetails = useDebugScalingDetails({
14343
14351
  enabled: debugMode,
14344
14352
  pageWidth: width,
@@ -14369,8 +14377,14 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
14369
14377
  classNames: classNames.guides,
14370
14378
  verbiage: rawVerbiage.guides,
14371
14379
  onClearBtnClicked: restartVideoOnSignaturePadCleared ? function () {
14372
- return setTimeout(clearRecordedData, 100);
14373
- } : undefined
14380
+ return setTimeout(function () {
14381
+ return useVideoSignatureStore.getState().clearRecordedData();
14382
+ }, 100);
14383
+ } : function () {
14384
+ return useVideoSignatureStore.setState({
14385
+ signatureStartedAt: undefined
14386
+ });
14387
+ }
14374
14388
  }), debugMode && ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ObjectDetectionDebugOverlayDiv, null, lastFace && ( /*#__PURE__*/React__default.createElement(SelfieCaptureFaceDebugBox, {
14375
14389
  face: lastFace,
14376
14390
  scaling: debugScalingDetails,