idmission-web-sdk 2.3.121 → 2.3.123
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/components/video_signature_capture/VideoSignatureCapture.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureContext.d.ts +0 -25
- package/dist/components/video_signature_capture/VideoSignatureContext.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureWizard.d.ts.map +1 -1
- package/dist/sdk2.cjs.development.js +108 -226
- package/dist/sdk2.cjs.development.js.map +1 -1
- package/dist/sdk2.cjs.production.js +1 -1
- package/dist/sdk2.cjs.production.js.map +1 -1
- package/dist/sdk2.esm.js +108 -226
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +108 -226
- package/dist/sdk2.umd.development.js.map +1 -1
- package/dist/sdk2.umd.production.js +1 -1
- package/dist/sdk2.umd.production.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoSignatureCapture.d.ts","sourceRoot":"","sources":["../../../src/components/video_signature_capture/VideoSignatureCapture.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,aAAa,EAMd,MAAM,OAAO,CAAA;AAad,OAAO,EAAE,wBAAwB,EAAmB,MAAM,mBAAmB,CAAA;AAC7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAA;AACvF,OAA6B,EAC3B,8BAA8B,EAC9B,4BAA4B,EAC7B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACL,wBAAwB,EAEzB,MAAM,yBAAyB,CAAA;AAQhC,eAAO,MAAM,gCAAgC,KAAK,CAAA;AAClD,eAAO,MAAM,yCAAyC,OAAO,CAAA;AAC7D,eAAO,MAAM,mCAAmC,SAAS,CAAA;AAEzD,MAAM,MAAM,wBAAwB,GAAG;IACrC,iBAAiB,EAAE,MAAM,IAAI,CAAA;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,CAAA;IAC3C,eAAe,CAAC,EAAE,aAAa,CAAC,4BAA4B,CAAC,CAAA;IAC7D,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,8BAA8B,CAAC,EAAE,MAAM,CAAA;IACvC,wBAAwB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1C,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,UAAU,CAAC,EAAE,+BAA+B,CAAA;IAC5C,MAAM,CAAC,EAAE,2BAA2B,CAAA;IACpC,QAAQ,CAAC,EAAE,6BAA6B,CAAA;IACxC,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAqMD,eAAO,MAAM,qBAAqB,6GAGD,CAAA"}
|
|
@@ -1,29 +1,12 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { SignatureData } from '../signature_capture/data';
|
|
3
3
|
import SignatureCanvas from 'react-signature-canvas';
|
|
4
|
-
type VideoChunkRateStats = {
|
|
5
|
-
averageRate: number;
|
|
6
|
-
minRate: number;
|
|
7
|
-
maxRate: number;
|
|
8
|
-
totalChunksReceived: number;
|
|
9
|
-
recordingDurationMs: number;
|
|
10
|
-
};
|
|
11
4
|
export type VideoSignatureMetadata = {
|
|
12
5
|
mimeType?: string;
|
|
13
6
|
browserFeatures?: {
|
|
14
7
|
supportsRequestVideoFrameCallback?: boolean;
|
|
15
8
|
supportsRoundRect?: boolean;
|
|
16
9
|
};
|
|
17
|
-
diagnostics?: {
|
|
18
|
-
nullChunksReceived?: number;
|
|
19
|
-
firstNullChunkReceivedAt?: number;
|
|
20
|
-
lastNullChunkReceivedAt?: number;
|
|
21
|
-
finalChunkReceived?: boolean;
|
|
22
|
-
finalChunkTimedOut?: boolean;
|
|
23
|
-
finalChunkWaitedMs?: number;
|
|
24
|
-
videoChunkRate?: VideoChunkRateStats;
|
|
25
|
-
timesSignatureCleared?: number;
|
|
26
|
-
};
|
|
27
10
|
timingData?: {
|
|
28
11
|
recordingStartRequestedAt?: number;
|
|
29
12
|
recordingStartedAt?: number;
|
|
@@ -31,7 +14,6 @@ export type VideoSignatureMetadata = {
|
|
|
31
14
|
signatureStartedAt?: number;
|
|
32
15
|
signatureEndedAt?: number;
|
|
33
16
|
acceptClickedAt?: number;
|
|
34
|
-
clearClickedAt?: number;
|
|
35
17
|
recordingStopRequestedAt?: number;
|
|
36
18
|
lastChunkReceivedAt?: number;
|
|
37
19
|
recordingStoppedAt?: number;
|
|
@@ -55,14 +37,8 @@ export type VideoSignatureState = {
|
|
|
55
37
|
signatureStartedAt?: number;
|
|
56
38
|
signatureEndedAt?: number;
|
|
57
39
|
acceptClickedAt?: number;
|
|
58
|
-
clearClickedAt?: number;
|
|
59
40
|
supportsRequestVideoFrameCallback?: boolean;
|
|
60
41
|
supportsRoundRect?: boolean;
|
|
61
|
-
nullChunksReceived: number;
|
|
62
|
-
firstNullChunkReceivedAt?: number;
|
|
63
|
-
lastNullChunkReceivedAt?: number;
|
|
64
|
-
timesSignatureCleared: number;
|
|
65
|
-
finalChunkReceived: boolean;
|
|
66
42
|
onSignatureVideoCaptured: OnSignatureVideoCaptured;
|
|
67
43
|
};
|
|
68
44
|
export declare const useVideoSignatureStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<VideoSignatureState>, "setState"> & {
|
|
@@ -82,5 +58,4 @@ export declare const useVideoSignatureStore: import("zustand").UseBoundStore<Omi
|
|
|
82
58
|
export default function VideoSignatureContextProvider({ children, }: {
|
|
83
59
|
children: ReactNode;
|
|
84
60
|
}): React.JSX.Element;
|
|
85
|
-
export {};
|
|
86
61
|
//# sourceMappingURL=VideoSignatureContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoSignatureContext.d.ts","sourceRoot":"","sources":["../../../src/components/video_signature_capture/VideoSignatureContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAkC,MAAM,OAAO,CAAA;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACzD,OAAO,eAAe,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"VideoSignatureContext.d.ts","sourceRoot":"","sources":["../../../src/components/video_signature_capture/VideoSignatureContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAkC,MAAM,OAAO,CAAA;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACzD,OAAO,eAAe,MAAM,wBAAwB,CAAA;AAcpD,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,eAAe,CAAC,EAAE;QAChB,iCAAiC,CAAC,EAAE,OAAO,CAAA;QAC3C,iBAAiB,CAAC,EAAE,OAAO,CAAA;KAC5B,CAAA;IACD,UAAU,CAAC,EAAE;QACX,yBAAyB,CAAC,EAAE,MAAM,CAAA;QAClC,kBAAkB,CAAC,EAAE,MAAM,CAAA;QAC3B,oBAAoB,CAAC,EAAE,MAAM,CAAA;QAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAA;QAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAA;QACzB,eAAe,CAAC,EAAE,MAAM,CAAA;QACxB,wBAAwB,CAAC,EAAE,MAAM,CAAA;QACjC,mBAAmB,CAAC,EAAE,MAAM,CAAA;QAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAA;KAC5B,CAAA;CACF,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,CACrC,SAAS,EAAE,IAAI,EACf,aAAa,EAAE,aAAa,GAAG,IAAI,EACnC,kBAAkB,EAAE,MAAM,GAAG,IAAI,EACjC,QAAQ,EAAE,sBAAsB,KAC7B,IAAI,CAAA;AAET,MAAM,MAAM,mBAAmB,GAAG;IAChC,cAAc,EAAE,CAAC,YAAY,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;IAChD,aAAa,EAAE,CACb,aAAa,CAAC,EAAE,aAAa,EAC7B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,KAC3B,OAAO,CAAC,IAAI,CAAC,CAAA;IAClB,iBAAiB,EAAE,MAAM,IAAI,CAAA;IAE7B,yBAAyB,CAAC,EAAE,MAAM,CAAA;IAClC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAE3B,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC,CAAA;IAC9C,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAA;IAEhD,iBAAiB,EAAE,OAAO,CAAA;IAC1B,cAAc,EAAE,OAAO,CAAA;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,iCAAiC,CAAC,EAAE,OAAO,CAAA;IAC3C,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAE3B,wBAAwB,EAAE,wBAAwB,CAAA;CACnD,CAAA;AAeD,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;EA6IlC,CAAA;AA2CD,MAAM,CAAC,OAAO,UAAU,6BAA6B,CAAC,EACpD,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,SAAS,CAAA;CACpB,qBA8DA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoSignatureWizard.d.ts","sourceRoot":"","sources":["../../../src/components/video_signature_capture/VideoSignatureWizard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,aAAa,EAGb,SAAS,EAKV,MAAM,OAAO,CAAA;AACd,OAAO,EAKL,+BAA+B,EAC/B,2BAA2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,CAAA;IAChD,eAAe,CAAC,EAAE,aAAa,CAAC,4BAA4B,CAAC,CAAA;IAC7D,6BAA6B,CAAC,EAAE,OAAO,CAAA;IACvC,6BAA6B,CAAC,EAAE,MAAM,CAAA;IACtC,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC,2BAA2B,CAAC,EAAE,MAAM,CAAA;IAEpC,MAAM,CAAC,EAAE,oBAAoB,CAAA;IAC7B,UAAU,CAAC,EAAE,wBAAwB,CAAA;IACrC,MAAM,CAAC,EAAE,oBAAoB,CAAA;IAC7B,QAAQ,CAAC,EAAE,sBAAsB,CAAA;IACjC,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAiVD,eAAO,MAAM,oBAAoB,4GAGD,CAAA;
|
|
1
|
+
{"version":3,"file":"VideoSignatureWizard.d.ts","sourceRoot":"","sources":["../../../src/components/video_signature_capture/VideoSignatureWizard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,aAAa,EAGb,SAAS,EAKV,MAAM,OAAO,CAAA;AACd,OAAO,EAKL,+BAA+B,EAC/B,2BAA2B,EAC3B,6BAA6B,EAC9B,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAMvE,OAAO,EAEL,+BAA+B,EAC/B,2BAA2B,EAC3B,6BAA6B,EAC9B,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EAEpB,uBAAuB,EACxB,MAAM,qCAAqC,CAAA;AAG5C,OAAO,EAAE,+BAA+B,EAAE,MAAM,+CAA+C,CAAA;AAM/F,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAA;AACvF,OAA6B,EAE3B,4BAA4B,EAC7B,MAAM,wBAAwB,CAAA;AAC/B,OAAsC,EACpC,wBAAwB,EAGzB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAEL,6B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AM,IAAI;kDAmDM,CAAA"}
|
|
@@ -236,7 +236,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
236
236
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
237
237
|
};
|
|
238
238
|
|
|
239
|
-
var webSdkVersion = '2.3.
|
|
239
|
+
var webSdkVersion = '2.3.123';
|
|
240
240
|
|
|
241
241
|
function getPlatform() {
|
|
242
242
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -14399,9 +14399,6 @@ function inferBlobType(blobPart) {
|
|
|
14399
14399
|
|
|
14400
14400
|
var signatureRecorder = null;
|
|
14401
14401
|
var signatureChunks = [];
|
|
14402
|
-
var ondataavailableInvocations = [];
|
|
14403
|
-
var ondataavailableStartTime;
|
|
14404
|
-
var lastCalculatedVideoChunkRate;
|
|
14405
14402
|
var videoSignatureInitialState = {
|
|
14406
14403
|
startRecording: function startRecording() {
|
|
14407
14404
|
return null;
|
|
@@ -14426,9 +14423,6 @@ var videoSignatureInitialState = {
|
|
|
14426
14423
|
signatureValid: false,
|
|
14427
14424
|
supportsRequestVideoFrameCallback: undefined,
|
|
14428
14425
|
supportsRoundRect: undefined,
|
|
14429
|
-
nullChunksReceived: 0,
|
|
14430
|
-
timesSignatureCleared: 0,
|
|
14431
|
-
finalChunkReceived: false,
|
|
14432
14426
|
onSignatureVideoCaptured: function onSignatureVideoCaptured() {
|
|
14433
14427
|
return null;
|
|
14434
14428
|
}
|
|
@@ -14441,11 +14435,8 @@ var useVideoSignatureStore = zustand.create()(middleware.devtools(function (set,
|
|
|
14441
14435
|
captureAudio = false;
|
|
14442
14436
|
}
|
|
14443
14437
|
if (!camera) throw new Error('Camera not found');
|
|
14444
|
-
// clear whatever we have recorded so far.
|
|
14438
|
+
// set our flag and clear whatever we have recorded so far.
|
|
14445
14439
|
signatureChunks = [];
|
|
14446
|
-
ondataavailableInvocations = [];
|
|
14447
|
-
ondataavailableStartTime = undefined;
|
|
14448
|
-
lastCalculatedVideoChunkRate = undefined;
|
|
14449
14440
|
// start recording from the output canvas to capture the signature
|
|
14450
14441
|
var outputStream = (_a = get().outputCanvas.current) === null || _a === void 0 ? void 0 : _a.captureStream(24);
|
|
14451
14442
|
if (!outputStream) throw new Error('outputStream not found');
|
|
@@ -14463,26 +14454,18 @@ var useVideoSignatureStore = zustand.create()(middleware.devtools(function (set,
|
|
|
14463
14454
|
recordingStartedAt: e.timeStamp
|
|
14464
14455
|
});
|
|
14465
14456
|
};
|
|
14457
|
+
var hasFirstChunk = false;
|
|
14466
14458
|
signatureRecorder.ondataavailable = function (event) {
|
|
14467
|
-
var now = performance.now();
|
|
14468
14459
|
signatureChunks.push(event.data);
|
|
14469
|
-
|
|
14470
|
-
|
|
14471
|
-
set(
|
|
14472
|
-
|
|
14473
|
-
|
|
14474
|
-
firstChunkReceivedAt: (_a = state.firstChunkReceivedAt) !== null && _a !== void 0 ? _a : now,
|
|
14475
|
-
lastChunkReceivedAt: now
|
|
14476
|
-
};
|
|
14460
|
+
if (!hasFirstChunk) {
|
|
14461
|
+
hasFirstChunk = true;
|
|
14462
|
+
set({
|
|
14463
|
+
firstChunkReceivedAt: performance.now(),
|
|
14464
|
+
lastChunkReceivedAt: performance.now()
|
|
14477
14465
|
});
|
|
14478
14466
|
} else {
|
|
14479
|
-
set(
|
|
14480
|
-
|
|
14481
|
-
return {
|
|
14482
|
-
nullChunksReceived: state.nullChunksReceived + 1,
|
|
14483
|
-
firstNullChunkReceivedAt: (_a = state.firstNullChunkReceivedAt) !== null && _a !== void 0 ? _a : now,
|
|
14484
|
-
lastNullChunkReceivedAt: now
|
|
14485
|
-
};
|
|
14467
|
+
set({
|
|
14468
|
+
lastChunkReceivedAt: performance.now()
|
|
14486
14469
|
});
|
|
14487
14470
|
}
|
|
14488
14471
|
};
|
|
@@ -14493,88 +14476,55 @@ var useVideoSignatureStore = zustand.create()(middleware.devtools(function (set,
|
|
|
14493
14476
|
},
|
|
14494
14477
|
stopRecording: function stopRecording(signatureData, imageUrl) {
|
|
14495
14478
|
return __awaiter(this, void 0, void 0, function () {
|
|
14496
|
-
|
|
14497
|
-
|
|
14498
|
-
|
|
14499
|
-
return __generator(this, function (_b) {
|
|
14500
|
-
if (get().recordingStoppedAt) return [2 /*return*/];
|
|
14501
|
-
recordingStoppedAt = performance.now();
|
|
14502
|
-
set({
|
|
14503
|
-
recordingStoppedAt: recordingStoppedAt
|
|
14504
|
-
});
|
|
14505
|
-
mimeType = inferBlobType(signatureChunks[0]) || (signatureRecorder === null || signatureRecorder === void 0 ? void 0 : signatureRecorder.mimeType) || 'video/mp4';
|
|
14506
|
-
blob = new Blob(signatureChunks, {
|
|
14507
|
-
type: mimeType
|
|
14508
|
-
});
|
|
14509
|
-
signatureChunks = [];
|
|
14510
|
-
signatureRecorder = null;
|
|
14511
|
-
_a = get(), onSignatureVideoCaptured = _a.onSignatureVideoCaptured, recordingStartRequestedAt = _a.recordingStartRequestedAt, recordingStartedAt = _a.recordingStartedAt, firstChunkReceivedAt = _a.firstChunkReceivedAt, signatureStartedAt = _a.signatureStartedAt, signatureEndedAt = _a.signatureEndedAt, acceptClickedAt = _a.acceptClickedAt, clearClickedAt = _a.clearClickedAt, recordingStopRequestedAt = _a.recordingStopRequestedAt, lastChunkReceivedAt = _a.lastChunkReceivedAt, supportsRequestVideoFrameCallback = _a.supportsRequestVideoFrameCallback, supportsRoundRect = _a.supportsRoundRect, nullChunksReceived = _a.nullChunksReceived, firstNullChunkReceivedAt = _a.firstNullChunkReceivedAt, lastNullChunkReceivedAt = _a.lastNullChunkReceivedAt, timesSignatureCleared = _a.timesSignatureCleared;
|
|
14512
|
-
metadata = {
|
|
14513
|
-
mimeType: mimeType,
|
|
14514
|
-
browserFeatures: {
|
|
14515
|
-
supportsRoundRect: supportsRoundRect,
|
|
14516
|
-
supportsRequestVideoFrameCallback: supportsRequestVideoFrameCallback
|
|
14517
|
-
},
|
|
14518
|
-
diagnostics: {
|
|
14519
|
-
nullChunksReceived: nullChunksReceived,
|
|
14520
|
-
firstNullChunkReceivedAt: firstNullChunkReceivedAt,
|
|
14521
|
-
lastNullChunkReceivedAt: lastNullChunkReceivedAt,
|
|
14522
|
-
finalChunkReceived: finalChunkReceived,
|
|
14523
|
-
finalChunkTimedOut: timedOut,
|
|
14524
|
-
finalChunkWaitedMs: Math.ceil(waitedMs),
|
|
14525
|
-
videoChunkRate: lastCalculatedVideoChunkRate,
|
|
14526
|
-
timesSignatureCleared: timesSignatureCleared
|
|
14527
|
-
},
|
|
14528
|
-
timingData: {
|
|
14529
|
-
recordingStartRequestedAt: recordingStartRequestedAt ? Math.ceil(recordingStartRequestedAt) : 0,
|
|
14530
|
-
recordingStartedAt: recordingStartedAt ? Math.ceil(recordingStartedAt) : 0,
|
|
14531
|
-
firstChunkReceivedAt: firstChunkReceivedAt ? Math.ceil(firstChunkReceivedAt) : 0,
|
|
14532
|
-
signatureStartedAt: signatureStartedAt ? Math.ceil(signatureStartedAt) : 0,
|
|
14533
|
-
signatureEndedAt: signatureEndedAt ? Math.ceil(signatureEndedAt) : 0,
|
|
14534
|
-
acceptClickedAt: acceptClickedAt ? Math.ceil(acceptClickedAt) : 0,
|
|
14535
|
-
clearClickedAt: clearClickedAt ? Math.ceil(clearClickedAt) : 0,
|
|
14536
|
-
recordingStopRequestedAt: recordingStopRequestedAt ? Math.ceil(recordingStopRequestedAt) : 0,
|
|
14537
|
-
recordingStoppedAt: Math.ceil(recordingStoppedAt),
|
|
14538
|
-
lastChunkReceivedAt: lastChunkReceivedAt ? Math.ceil(lastChunkReceivedAt) : 0
|
|
14539
|
-
}
|
|
14540
|
-
};
|
|
14541
|
-
debug('signature video metadata', metadata);
|
|
14542
|
-
onSignatureVideoCaptured(blob, signatureData !== null && signatureData !== void 0 ? signatureData : null, imageUrl !== null && imageUrl !== void 0 ? imageUrl : null, metadata);
|
|
14543
|
-
return [2 /*return*/];
|
|
14544
|
-
});
|
|
14545
|
-
});
|
|
14546
|
-
}
|
|
14547
|
-
var _a, recordingStartedAt, recordingStopRequestedAt, isRecording, _b, finalChunkReceived, timedOut, waitedMs;
|
|
14548
|
-
return __generator(this, function (_c) {
|
|
14549
|
-
switch (_c.label) {
|
|
14479
|
+
var _this = this;
|
|
14480
|
+
return __generator(this, function (_a) {
|
|
14481
|
+
switch (_a.label) {
|
|
14550
14482
|
case 0:
|
|
14551
|
-
_a = get(), recordingStartedAt = _a.recordingStartedAt, recordingStopRequestedAt = _a.recordingStopRequestedAt;
|
|
14552
|
-
isRecording = !!recordingStartedAt && !recordingStopRequestedAt;
|
|
14553
|
-
if (!isRecording) return [2 /*return*/];
|
|
14554
14483
|
set({
|
|
14555
|
-
recordingStopRequestedAt: performance.now()
|
|
14556
|
-
recordingStoppedAt: undefined
|
|
14484
|
+
recordingStopRequestedAt: performance.now()
|
|
14557
14485
|
});
|
|
14558
|
-
return [
|
|
14559
|
-
|
|
14560
|
-
];
|
|
14486
|
+
if (!signatureRecorder) return [2 /*return*/];
|
|
14487
|
+
return [4 /*yield*/, waitForOneMoreChunk()];
|
|
14561
14488
|
case 1:
|
|
14562
|
-
|
|
14563
|
-
|
|
14564
|
-
|
|
14565
|
-
|
|
14566
|
-
|
|
14567
|
-
|
|
14568
|
-
|
|
14489
|
+
_a.sent();
|
|
14490
|
+
signatureRecorder.onstop = function () {
|
|
14491
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
14492
|
+
var recordingStoppedAt, mimeType, blob, _a, onSignatureVideoCaptured, recordingStartRequestedAt, recordingStartedAt, firstChunkReceivedAt, signatureStartedAt, signatureEndedAt, acceptClickedAt, recordingStopRequestedAt, lastChunkReceivedAt, supportsRequestVideoFrameCallback, supportsRoundRect;
|
|
14493
|
+
return __generator(this, function (_b) {
|
|
14494
|
+
recordingStoppedAt = performance.now();
|
|
14495
|
+
set({
|
|
14496
|
+
recordingStoppedAt: recordingStoppedAt
|
|
14497
|
+
});
|
|
14498
|
+
mimeType = inferBlobType(signatureChunks[0]) || (signatureRecorder === null || signatureRecorder === void 0 ? void 0 : signatureRecorder.mimeType) || 'video/mp4';
|
|
14499
|
+
blob = new Blob(signatureChunks, {
|
|
14500
|
+
type: mimeType
|
|
14501
|
+
});
|
|
14502
|
+
signatureChunks = [];
|
|
14503
|
+
signatureRecorder = null;
|
|
14504
|
+
_a = get(), onSignatureVideoCaptured = _a.onSignatureVideoCaptured, recordingStartRequestedAt = _a.recordingStartRequestedAt, recordingStartedAt = _a.recordingStartedAt, firstChunkReceivedAt = _a.firstChunkReceivedAt, signatureStartedAt = _a.signatureStartedAt, signatureEndedAt = _a.signatureEndedAt, acceptClickedAt = _a.acceptClickedAt, recordingStopRequestedAt = _a.recordingStopRequestedAt, lastChunkReceivedAt = _a.lastChunkReceivedAt, supportsRequestVideoFrameCallback = _a.supportsRequestVideoFrameCallback, supportsRoundRect = _a.supportsRoundRect;
|
|
14505
|
+
onSignatureVideoCaptured(blob, signatureData !== null && signatureData !== void 0 ? signatureData : null, imageUrl !== null && imageUrl !== void 0 ? imageUrl : null, {
|
|
14506
|
+
mimeType: mimeType,
|
|
14507
|
+
browserFeatures: {
|
|
14508
|
+
supportsRoundRect: supportsRoundRect,
|
|
14509
|
+
supportsRequestVideoFrameCallback: supportsRequestVideoFrameCallback
|
|
14510
|
+
},
|
|
14511
|
+
timingData: {
|
|
14512
|
+
recordingStartRequestedAt: recordingStartRequestedAt ? Math.ceil(recordingStartRequestedAt) : 0,
|
|
14513
|
+
recordingStartedAt: recordingStartedAt ? Math.ceil(recordingStartedAt) : 0,
|
|
14514
|
+
firstChunkReceivedAt: firstChunkReceivedAt ? Math.ceil(firstChunkReceivedAt) : 0,
|
|
14515
|
+
signatureStartedAt: signatureStartedAt ? Math.ceil(signatureStartedAt) : 0,
|
|
14516
|
+
signatureEndedAt: signatureEndedAt ? Math.ceil(signatureEndedAt) : 0,
|
|
14517
|
+
acceptClickedAt: acceptClickedAt ? Math.ceil(acceptClickedAt) : 0,
|
|
14518
|
+
recordingStopRequestedAt: recordingStopRequestedAt ? Math.ceil(recordingStopRequestedAt) : 0,
|
|
14519
|
+
recordingStoppedAt: Math.ceil(recordingStoppedAt),
|
|
14520
|
+
lastChunkReceivedAt: lastChunkReceivedAt ? Math.ceil(lastChunkReceivedAt) : 0
|
|
14521
|
+
}
|
|
14522
|
+
});
|
|
14523
|
+
return [2 /*return*/];
|
|
14524
|
+
});
|
|
14525
|
+
});
|
|
14526
|
+
};
|
|
14569
14527
|
signatureRecorder.stop();
|
|
14570
|
-
return [3 /*break*/, 4];
|
|
14571
|
-
case 2:
|
|
14572
|
-
warn('signature recorder not found, processing video immediately');
|
|
14573
|
-
return [4 /*yield*/, processVideo()];
|
|
14574
|
-
case 3:
|
|
14575
|
-
_c.sent();
|
|
14576
|
-
_c.label = 4;
|
|
14577
|
-
case 4:
|
|
14578
14528
|
return [2 /*return*/];
|
|
14579
14529
|
}
|
|
14580
14530
|
});
|
|
@@ -14582,9 +14532,6 @@ var useVideoSignatureStore = zustand.create()(middleware.devtools(function (set,
|
|
|
14582
14532
|
},
|
|
14583
14533
|
clearRecordedData: function clearRecordedData() {
|
|
14584
14534
|
signatureChunks = [];
|
|
14585
|
-
ondataavailableInvocations = [];
|
|
14586
|
-
ondataavailableStartTime = undefined;
|
|
14587
|
-
lastCalculatedVideoChunkRate = undefined;
|
|
14588
14535
|
signatureRecorder === null || signatureRecorder === void 0 ? void 0 : signatureRecorder.stop();
|
|
14589
14536
|
signatureRecorder = null;
|
|
14590
14537
|
set({
|
|
@@ -14599,13 +14546,8 @@ var useVideoSignatureStore = zustand.create()(middleware.devtools(function (set,
|
|
|
14599
14546
|
signatureStartedAt: undefined,
|
|
14600
14547
|
signatureEndedAt: undefined,
|
|
14601
14548
|
acceptClickedAt: undefined,
|
|
14602
|
-
clearClickedAt: undefined,
|
|
14603
14549
|
supportsRequestVideoFrameCallback: undefined,
|
|
14604
|
-
supportsRoundRect: undefined
|
|
14605
|
-
nullChunksReceived: 0,
|
|
14606
|
-
firstNullChunkReceivedAt: undefined,
|
|
14607
|
-
lastNullChunkReceivedAt: undefined,
|
|
14608
|
-
finalChunkReceived: false
|
|
14550
|
+
supportsRoundRect: undefined
|
|
14609
14551
|
});
|
|
14610
14552
|
}
|
|
14611
14553
|
});
|
|
@@ -14615,11 +14557,11 @@ var useVideoSignatureStore = zustand.create()(middleware.devtools(function (set,
|
|
|
14615
14557
|
* @param delayMs - The delay in milliseconds before the first check -- this is used to make sure we get at least one extra second of video.
|
|
14616
14558
|
* @param checkEveryMs - The interval in milliseconds between checks after the initial delay has passed.
|
|
14617
14559
|
* @param timeoutMs - The maximum time in milliseconds to wait for the chunk -- this is used to prevent infinite loops.
|
|
14618
|
-
* @returns A promise that resolves when the delay has passed and at least one chunk has been received received.
|
|
14560
|
+
* @returns A promise that resolves when the delay has passed and at least one chunk has been received received.
|
|
14619
14561
|
*/
|
|
14620
14562
|
function waitForOneMoreChunk(delayMs, checkEveryMs, timeoutMs) {
|
|
14621
14563
|
if (delayMs === void 0) {
|
|
14622
|
-
delayMs =
|
|
14564
|
+
delayMs = 1000;
|
|
14623
14565
|
}
|
|
14624
14566
|
if (checkEveryMs === void 0) {
|
|
14625
14567
|
checkEveryMs = 100;
|
|
@@ -14627,42 +14569,29 @@ function waitForOneMoreChunk(delayMs, checkEveryMs, timeoutMs) {
|
|
|
14627
14569
|
if (timeoutMs === void 0) {
|
|
14628
14570
|
timeoutMs = 3000;
|
|
14629
14571
|
}
|
|
14572
|
+
var start = performance.now();
|
|
14630
14573
|
return new Promise(function (resolve) {
|
|
14631
|
-
var start = performance.now();
|
|
14632
14574
|
var initialLastChunkReceivedAt = useVideoSignatureStore.getState().lastChunkReceivedAt;
|
|
14633
|
-
function
|
|
14575
|
+
function gotAChunk() {
|
|
14634
14576
|
var lastChunkReceivedAt = useVideoSignatureStore.getState().lastChunkReceivedAt;
|
|
14635
|
-
|
|
14636
|
-
var timedOut = waitedMs > timeoutMs;
|
|
14637
|
-
var finalChunkReceived = !!lastChunkReceivedAt && !!initialLastChunkReceivedAt && lastChunkReceivedAt > initialLastChunkReceivedAt;
|
|
14638
|
-
return {
|
|
14639
|
-
waitedMs: waitedMs,
|
|
14640
|
-
finalChunkReceived: finalChunkReceived,
|
|
14641
|
-
timedOut: timedOut
|
|
14642
|
-
};
|
|
14577
|
+
return performance.now() - start > timeoutMs || !lastChunkReceivedAt || !initialLastChunkReceivedAt || lastChunkReceivedAt > initialLastChunkReceivedAt;
|
|
14643
14578
|
}
|
|
14644
14579
|
setTimeout(function () {
|
|
14645
|
-
// check immediately
|
|
14646
|
-
var result = checkForChunk();
|
|
14647
|
-
if (result.finalChunkReceived || result.timedOut) return resolve(result);
|
|
14580
|
+
if (gotAChunk()) return resolve(); // check immediately
|
|
14648
14581
|
// otherwise, check on a configured interval
|
|
14649
14582
|
var interval = setInterval(function () {
|
|
14650
|
-
|
|
14651
|
-
if (result.finalChunkReceived || result.timedOut) {
|
|
14583
|
+
if (gotAChunk()) {
|
|
14652
14584
|
clearInterval(interval);
|
|
14653
|
-
resolve(
|
|
14585
|
+
resolve();
|
|
14654
14586
|
}
|
|
14655
14587
|
}, checkEveryMs);
|
|
14656
14588
|
}, delayMs);
|
|
14657
14589
|
});
|
|
14658
14590
|
}
|
|
14659
14591
|
function VideoSignatureContextProvider(_a) {
|
|
14592
|
+
var _b, _c;
|
|
14660
14593
|
var children = _a.children;
|
|
14661
|
-
var
|
|
14662
|
-
videoRef = _b.videoRef,
|
|
14663
|
-
videoWidth = _b.videoWidth,
|
|
14664
|
-
videoHeight = _b.videoHeight,
|
|
14665
|
-
releaseCameraAccess = _b.releaseCameraAccess;
|
|
14594
|
+
var videoRef = useCameraStore().videoRef;
|
|
14666
14595
|
var outputCanvas = React.useRef(null);
|
|
14667
14596
|
React.useEffect(function () {
|
|
14668
14597
|
return useVideoSignatureStore.setState({
|
|
@@ -14670,13 +14599,18 @@ function VideoSignatureContextProvider(_a) {
|
|
|
14670
14599
|
});
|
|
14671
14600
|
}, []);
|
|
14672
14601
|
var drawOutputFrame = React.useCallback(function () {
|
|
14673
|
-
if (!outputCanvas.current) return;
|
|
14602
|
+
if (!outputCanvas.current || !videoRef.current) return;
|
|
14674
14603
|
var ctx = outputCanvas.current.getContext('2d');
|
|
14675
14604
|
if (!ctx) return;
|
|
14676
|
-
var _a = [
|
|
14605
|
+
var _a = [videoRef.current.videoWidth, videoRef.current.videoHeight],
|
|
14677
14606
|
w = _a[0],
|
|
14678
14607
|
h = _a[1];
|
|
14679
14608
|
var isPortrait = w < h;
|
|
14609
|
+
// Only update canvas dimensions if they changed (setting dimensions clears the canvas!)
|
|
14610
|
+
if (outputCanvas.current.width !== w || outputCanvas.current.height !== h) {
|
|
14611
|
+
outputCanvas.current.width = w;
|
|
14612
|
+
outputCanvas.current.height = h;
|
|
14613
|
+
}
|
|
14680
14614
|
var rect = [w * (isPortrait ? 0.02 : 0.15),
|
|
14681
14615
|
// x
|
|
14682
14616
|
h * (isPortrait ? 0.15 : 0.25),
|
|
@@ -14685,9 +14619,7 @@ function VideoSignatureContextProvider(_a) {
|
|
|
14685
14619
|
// width
|
|
14686
14620
|
h * (isPortrait ? 0.7 : 0.5) // height
|
|
14687
14621
|
];
|
|
14688
|
-
|
|
14689
|
-
ctx.drawImage(videoRef.current, 0, 0, w, h);
|
|
14690
|
-
}
|
|
14622
|
+
ctx.drawImage(videoRef.current, 0, 0, w, h);
|
|
14691
14623
|
ctx.beginPath();
|
|
14692
14624
|
ctx.fillStyle = 'rgba(255,255,255,0.5)';
|
|
14693
14625
|
var supportsRoundRect = typeof ctx.roundRect === 'function';
|
|
@@ -14709,15 +14641,11 @@ function VideoSignatureContextProvider(_a) {
|
|
|
14709
14641
|
ctx.drawImage.apply(ctx, __spreadArray([signatureCanvas], rect, false));
|
|
14710
14642
|
}
|
|
14711
14643
|
}, [videoRef]);
|
|
14712
|
-
|
|
14713
|
-
React.useEffect(function () {
|
|
14714
|
-
if (finalChunkReceived) releaseCameraAccess();
|
|
14715
|
-
}, [finalChunkReceived, releaseCameraAccess]);
|
|
14716
|
-
useVideoFrameLoop(videoRef, drawOutputFrame, !finalChunkReceived);
|
|
14644
|
+
useVideoFrameLoop(videoRef, drawOutputFrame);
|
|
14717
14645
|
return /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, children, /*#__PURE__*/React__namespace.default.createElement(InvisibleCanvas, {
|
|
14718
14646
|
ref: outputCanvas,
|
|
14719
|
-
width: videoWidth,
|
|
14720
|
-
height: videoHeight
|
|
14647
|
+
width: (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.videoWidth,
|
|
14648
|
+
height: (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.videoHeight
|
|
14721
14649
|
}));
|
|
14722
14650
|
}
|
|
14723
14651
|
function requestVideoFrameCallback(video, onFrame) {
|
|
@@ -14737,11 +14665,8 @@ function requestVideoFrameCallback(video, onFrame) {
|
|
|
14737
14665
|
};
|
|
14738
14666
|
}
|
|
14739
14667
|
}
|
|
14740
|
-
function videoFrameLoop(video, onFrame
|
|
14741
|
-
if (
|
|
14742
|
-
running = true;
|
|
14743
|
-
}
|
|
14744
|
-
if (!video || !running) return;
|
|
14668
|
+
function videoFrameLoop(video, onFrame) {
|
|
14669
|
+
if (!video) return;
|
|
14745
14670
|
var cancelFn;
|
|
14746
14671
|
var canceled = false;
|
|
14747
14672
|
function onFrameRecursive() {
|
|
@@ -14762,51 +14687,10 @@ function videoFrameLoop(video, onFrame, running) {
|
|
|
14762
14687
|
if (cancelFn !== undefined) cancelFn();
|
|
14763
14688
|
};
|
|
14764
14689
|
}
|
|
14765
|
-
function useVideoFrameLoop(ref, onFrame
|
|
14766
|
-
if (running === void 0) {
|
|
14767
|
-
running = true;
|
|
14768
|
-
}
|
|
14690
|
+
function useVideoFrameLoop(ref, onFrame) {
|
|
14769
14691
|
React.useEffect(function () {
|
|
14770
|
-
return videoFrameLoop(ref.current, onFrame
|
|
14771
|
-
}, [onFrame, ref
|
|
14772
|
-
}
|
|
14773
|
-
function calculateAndStoreOndataavailableRate() {
|
|
14774
|
-
if (ondataavailableInvocations.length < 2 || !ondataavailableStartTime) {
|
|
14775
|
-
lastCalculatedVideoChunkRate = {
|
|
14776
|
-
averageRate: 0,
|
|
14777
|
-
minRate: 0,
|
|
14778
|
-
maxRate: 0,
|
|
14779
|
-
totalChunksReceived: ondataavailableInvocations.length,
|
|
14780
|
-
recordingDurationMs: 0
|
|
14781
|
-
};
|
|
14782
|
-
return;
|
|
14783
|
-
}
|
|
14784
|
-
var totalDuration = ondataavailableInvocations[ondataavailableInvocations.length - 1] - ondataavailableStartTime;
|
|
14785
|
-
var averageRate = (ondataavailableInvocations.length - 1) / (totalDuration / 1000); // invocations per second
|
|
14786
|
-
// Calculate rates for each interval between invocations
|
|
14787
|
-
var rates = [];
|
|
14788
|
-
for (var i = 1; i < ondataavailableInvocations.length; i++) {
|
|
14789
|
-
var intervalMs = ondataavailableInvocations[i] - ondataavailableInvocations[i - 1];
|
|
14790
|
-
var rate = 1000 / intervalMs; // invocations per second for this interval
|
|
14791
|
-
rates.push(rate);
|
|
14792
|
-
}
|
|
14793
|
-
var minRate = Math.min.apply(Math, rates);
|
|
14794
|
-
var maxRate = Math.max.apply(Math, rates);
|
|
14795
|
-
lastCalculatedVideoChunkRate = {
|
|
14796
|
-
averageRate: Math.round(averageRate * 100) / 100,
|
|
14797
|
-
// Round to 2 decimal places
|
|
14798
|
-
minRate: Math.round(minRate * 100) / 100,
|
|
14799
|
-
maxRate: Math.round(maxRate * 100) / 100,
|
|
14800
|
-
totalChunksReceived: ondataavailableInvocations.length,
|
|
14801
|
-
recordingDurationMs: Math.round(totalDuration)
|
|
14802
|
-
};
|
|
14803
|
-
}
|
|
14804
|
-
function trackVideoChunkRate(now) {
|
|
14805
|
-
// Track ondataavailable invocations for rate calculation
|
|
14806
|
-
ondataavailableStartTime !== null && ondataavailableStartTime !== void 0 ? ondataavailableStartTime : ondataavailableStartTime = now;
|
|
14807
|
-
ondataavailableInvocations.push(now);
|
|
14808
|
-
// Calculate and store the current rate
|
|
14809
|
-
calculateAndStoreOndataavailableRate();
|
|
14692
|
+
return videoFrameLoop(ref.current, onFrame);
|
|
14693
|
+
}, [onFrame, ref]);
|
|
14810
14694
|
}
|
|
14811
14695
|
|
|
14812
14696
|
function VideoSignaturePad(_a) {
|
|
@@ -15058,11 +14942,14 @@ function VideoSignatureCaptureComponent(_a, ref) {
|
|
|
15058
14942
|
onHeadTrackingPredictionMade = _o.onPredictionMade,
|
|
15059
14943
|
startHeadTracking = _o.start,
|
|
15060
14944
|
stopHeadTracking = _o.stop;
|
|
15061
|
-
var
|
|
15062
|
-
|
|
15063
|
-
|
|
15064
|
-
|
|
15065
|
-
|
|
14945
|
+
var _p = useVideoSignatureStore(shallow.useShallow(function (state) {
|
|
14946
|
+
return {
|
|
14947
|
+
firstChunkReceivedAt: state.firstChunkReceivedAt,
|
|
14948
|
+
acceptClickedAt: state.acceptClickedAt
|
|
14949
|
+
};
|
|
14950
|
+
})),
|
|
14951
|
+
firstChunkReceivedAt = _p.firstChunkReceivedAt,
|
|
14952
|
+
acceptClickedAt = _p.acceptClickedAt;
|
|
15066
14953
|
React.useImperativeHandle(ref, function () {
|
|
15067
14954
|
return {
|
|
15068
14955
|
clearRecordedData: function clearRecordedData() {
|
|
@@ -15088,15 +14975,15 @@ function VideoSignatureCaptureComponent(_a, ref) {
|
|
|
15088
14975
|
var verbiage = useTranslations(rawVerbiage, {
|
|
15089
14976
|
guidanceMessageText: 'Please sign the box below'
|
|
15090
14977
|
});
|
|
15091
|
-
var
|
|
15092
|
-
headTrackingSatisfied =
|
|
15093
|
-
setHeadTrackingSatisfied =
|
|
15094
|
-
var
|
|
15095
|
-
lastFace =
|
|
15096
|
-
setLastFace =
|
|
15097
|
-
var
|
|
15098
|
-
numFramesWithoutFaces =
|
|
15099
|
-
setNumFramesWithoutFaces =
|
|
14978
|
+
var _q = React.useState(true),
|
|
14979
|
+
headTrackingSatisfied = _q[0],
|
|
14980
|
+
setHeadTrackingSatisfied = _q[1];
|
|
14981
|
+
var _r = React.useState(null),
|
|
14982
|
+
lastFace = _r[0],
|
|
14983
|
+
setLastFace = _r[1];
|
|
14984
|
+
var _s = React.useState(0),
|
|
14985
|
+
numFramesWithoutFaces = _s[0],
|
|
14986
|
+
setNumFramesWithoutFaces = _s[1];
|
|
15100
14987
|
onHeadTrackingPredictionMade(useDebounce.useThrottledCallback(React.useCallback(function (_a) {
|
|
15101
14988
|
var face = _a.face;
|
|
15102
14989
|
if (headTrackingDisabled) return;
|
|
@@ -15111,12 +14998,12 @@ function VideoSignatureCaptureComponent(_a, ref) {
|
|
|
15111
14998
|
return n + 1;
|
|
15112
14999
|
});
|
|
15113
15000
|
}, [headTrackingBoundaryPercentage, headTrackingBoundaryType, headTrackingDisabled, videoHeight, videoWidth]), 16));
|
|
15114
|
-
var
|
|
15115
|
-
containerRef =
|
|
15116
|
-
|
|
15117
|
-
width =
|
|
15118
|
-
|
|
15119
|
-
height =
|
|
15001
|
+
var _t = useResizeObserver(),
|
|
15002
|
+
containerRef = _t.ref,
|
|
15003
|
+
_u = _t.width,
|
|
15004
|
+
width = _u === void 0 ? 1 : _u,
|
|
15005
|
+
_v = _t.height,
|
|
15006
|
+
height = _v === void 0 ? 1 : _v;
|
|
15120
15007
|
var debugScalingDetails = useDebugScalingDetails({
|
|
15121
15008
|
enabled: debugMode,
|
|
15122
15009
|
pageWidth: width,
|
|
@@ -15159,10 +15046,10 @@ function VideoSignatureCaptureComponent(_a, ref) {
|
|
|
15159
15046
|
face: lastFace,
|
|
15160
15047
|
scaling: debugScalingDetails,
|
|
15161
15048
|
color: headTrackingSatisfied ? 'green' : 'red'
|
|
15162
|
-
}))), /*#__PURE__*/React__namespace.default.createElement(DebugStatsPane, null, "Video: ", videoWidth, "x", videoHeight, /*#__PURE__*/React__namespace.default.createElement("br", null), "Recording: ", firstChunkReceivedAt ? 'true' : 'false'))), /*#__PURE__*/React__namespace.default.createElement(ExitCaptureButton, {
|
|
15049
|
+
}))), /*#__PURE__*/React__namespace.default.createElement(DebugStatsPane, null, "Video: ", videoWidth, "x", videoHeight, /*#__PURE__*/React__namespace.default.createElement("br", null), "Recording: ", firstChunkReceivedAt ? 'true' : 'false'))), !acceptClickedAt && ( /*#__PURE__*/React__namespace.default.createElement(ExitCaptureButton, {
|
|
15163
15050
|
onClick: onExit,
|
|
15164
15051
|
className: classNames.exitCaptureBtn
|
|
15165
|
-
}));
|
|
15052
|
+
})));
|
|
15166
15053
|
}
|
|
15167
15054
|
var VideoSignatureCapture = /*#__PURE__*/React.forwardRef(VideoSignatureCaptureComponent);
|
|
15168
15055
|
var Container$2 = styled__default.default.div(templateObject_1$9 || (templateObject_1$9 = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n"], ["\n width: 100%;\n height: 100%;\n"
|
|
@@ -15741,18 +15628,13 @@ function VideoSignatureWizardGuides(_a) {
|
|
|
15741
15628
|
});
|
|
15742
15629
|
}, []);
|
|
15743
15630
|
var onClearBtnClicked = React.useCallback(function () {
|
|
15744
|
-
var _a;
|
|
15745
|
-
var _b = useVideoSignatureStore.getState(),
|
|
15746
|
-
timesSignatureCleared = _b.timesSignatureCleared,
|
|
15747
|
-
signaturePad = _b.signaturePad;
|
|
15631
|
+
var _a, _b;
|
|
15748
15632
|
useVideoSignatureStore.setState({
|
|
15749
|
-
clearClickedAt: performance.now(),
|
|
15750
|
-
timesSignatureCleared: timesSignatureCleared + 1,
|
|
15751
15633
|
signatureStartedAt: undefined,
|
|
15752
15634
|
signaturePadEmpty: true,
|
|
15753
15635
|
signatureValid: false
|
|
15754
15636
|
});
|
|
15755
|
-
(_a =
|
|
15637
|
+
(_b = (_a = useVideoSignatureStore.getState().signaturePad) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.clear();
|
|
15756
15638
|
if (restartVideoOnSignaturePadCleared) {
|
|
15757
15639
|
setTimeout(function () {
|
|
15758
15640
|
useVideoSignatureStore.getState().clearRecordedData();
|