idmission-web-sdk 2.3.122 → 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 -26
- 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 +110 -236
- 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 +110 -236
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +110 -236
- 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,15 +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
|
-
requestDataInterval?: NodeJS.Timeout;
|
|
67
42
|
onSignatureVideoCaptured: OnSignatureVideoCaptured;
|
|
68
43
|
};
|
|
69
44
|
export declare const useVideoSignatureStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<VideoSignatureState>, "setState"> & {
|
|
@@ -83,5 +58,4 @@ export declare const useVideoSignatureStore: import("zustand").UseBoundStore<Omi
|
|
|
83
58
|
export default function VideoSignatureContextProvider({ children, }: {
|
|
84
59
|
children: ReactNode;
|
|
85
60
|
}): React.JSX.Element;
|
|
86
|
-
export {};
|
|
87
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;A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CAAA;IAChC,sCAAsC,CAAC,EAAE,OAAO,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,MAA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AAM,IAAI;gCACL,MAAM,IAAI;+BACX,MAAM,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,10 +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
|
-
requestDataInterval: undefined,
|
|
14433
14426
|
onSignatureVideoCaptured: function onSignatureVideoCaptured() {
|
|
14434
14427
|
return null;
|
|
14435
14428
|
}
|
|
@@ -14442,11 +14435,8 @@ var useVideoSignatureStore = zustand.create()(middleware.devtools(function (set,
|
|
|
14442
14435
|
captureAudio = false;
|
|
14443
14436
|
}
|
|
14444
14437
|
if (!camera) throw new Error('Camera not found');
|
|
14445
|
-
// clear whatever we have recorded so far.
|
|
14438
|
+
// set our flag and clear whatever we have recorded so far.
|
|
14446
14439
|
signatureChunks = [];
|
|
14447
|
-
ondataavailableInvocations = [];
|
|
14448
|
-
ondataavailableStartTime = undefined;
|
|
14449
|
-
lastCalculatedVideoChunkRate = undefined;
|
|
14450
14440
|
// start recording from the output canvas to capture the signature
|
|
14451
14441
|
var outputStream = (_a = get().outputCanvas.current) === null || _a === void 0 ? void 0 : _a.captureStream(24);
|
|
14452
14442
|
if (!outputStream) throw new Error('outputStream not found');
|
|
@@ -14464,123 +14454,77 @@ var useVideoSignatureStore = zustand.create()(middleware.devtools(function (set,
|
|
|
14464
14454
|
recordingStartedAt: e.timeStamp
|
|
14465
14455
|
});
|
|
14466
14456
|
};
|
|
14457
|
+
var hasFirstChunk = false;
|
|
14467
14458
|
signatureRecorder.ondataavailable = function (event) {
|
|
14468
|
-
var now = performance.now();
|
|
14469
14459
|
signatureChunks.push(event.data);
|
|
14470
|
-
|
|
14471
|
-
|
|
14472
|
-
set(
|
|
14473
|
-
|
|
14474
|
-
|
|
14475
|
-
firstChunkReceivedAt: (_a = state.firstChunkReceivedAt) !== null && _a !== void 0 ? _a : now,
|
|
14476
|
-
lastChunkReceivedAt: now
|
|
14477
|
-
};
|
|
14460
|
+
if (!hasFirstChunk) {
|
|
14461
|
+
hasFirstChunk = true;
|
|
14462
|
+
set({
|
|
14463
|
+
firstChunkReceivedAt: performance.now(),
|
|
14464
|
+
lastChunkReceivedAt: performance.now()
|
|
14478
14465
|
});
|
|
14479
14466
|
} else {
|
|
14480
|
-
set(
|
|
14481
|
-
|
|
14482
|
-
return {
|
|
14483
|
-
nullChunksReceived: state.nullChunksReceived + 1,
|
|
14484
|
-
firstNullChunkReceivedAt: (_a = state.firstNullChunkReceivedAt) !== null && _a !== void 0 ? _a : now,
|
|
14485
|
-
lastNullChunkReceivedAt: now
|
|
14486
|
-
};
|
|
14467
|
+
set({
|
|
14468
|
+
lastChunkReceivedAt: performance.now()
|
|
14487
14469
|
});
|
|
14488
14470
|
}
|
|
14489
14471
|
};
|
|
14490
|
-
signatureRecorder.start();
|
|
14491
|
-
var interval = setInterval(function () {
|
|
14492
|
-
return signatureRecorder === null || signatureRecorder === void 0 ? void 0 : signatureRecorder.requestData();
|
|
14493
|
-
}, 250);
|
|
14472
|
+
signatureRecorder.start(250);
|
|
14494
14473
|
set({
|
|
14495
|
-
requestDataInterval: interval,
|
|
14496
14474
|
recordingStartRequestedAt: performance.now()
|
|
14497
14475
|
});
|
|
14498
14476
|
},
|
|
14499
14477
|
stopRecording: function stopRecording(signatureData, imageUrl) {
|
|
14500
14478
|
return __awaiter(this, void 0, void 0, function () {
|
|
14501
|
-
|
|
14502
|
-
|
|
14503
|
-
|
|
14504
|
-
return __generator(this, function (_b) {
|
|
14505
|
-
if (get().recordingStoppedAt) return [2 /*return*/];
|
|
14506
|
-
recordingStoppedAt = performance.now();
|
|
14507
|
-
set({
|
|
14508
|
-
recordingStoppedAt: recordingStoppedAt
|
|
14509
|
-
});
|
|
14510
|
-
mimeType = inferBlobType(signatureChunks[0]) || (signatureRecorder === null || signatureRecorder === void 0 ? void 0 : signatureRecorder.mimeType) || 'video/mp4';
|
|
14511
|
-
blob = new Blob(signatureChunks, {
|
|
14512
|
-
type: mimeType
|
|
14513
|
-
});
|
|
14514
|
-
signatureChunks = [];
|
|
14515
|
-
signatureRecorder = null;
|
|
14516
|
-
_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;
|
|
14517
|
-
metadata = {
|
|
14518
|
-
mimeType: mimeType,
|
|
14519
|
-
browserFeatures: {
|
|
14520
|
-
supportsRoundRect: supportsRoundRect,
|
|
14521
|
-
supportsRequestVideoFrameCallback: supportsRequestVideoFrameCallback
|
|
14522
|
-
},
|
|
14523
|
-
diagnostics: {
|
|
14524
|
-
nullChunksReceived: nullChunksReceived,
|
|
14525
|
-
firstNullChunkReceivedAt: firstNullChunkReceivedAt ? Math.ceil(firstNullChunkReceivedAt) : 0,
|
|
14526
|
-
lastNullChunkReceivedAt: lastNullChunkReceivedAt ? Math.ceil(lastNullChunkReceivedAt) : 0,
|
|
14527
|
-
finalChunkReceived: finalChunkReceived,
|
|
14528
|
-
finalChunkTimedOut: timedOut,
|
|
14529
|
-
finalChunkWaitedMs: Math.ceil(waitedMs),
|
|
14530
|
-
videoChunkRate: lastCalculatedVideoChunkRate,
|
|
14531
|
-
timesSignatureCleared: timesSignatureCleared
|
|
14532
|
-
},
|
|
14533
|
-
timingData: {
|
|
14534
|
-
recordingStartRequestedAt: recordingStartRequestedAt ? Math.ceil(recordingStartRequestedAt) : 0,
|
|
14535
|
-
recordingStartedAt: recordingStartedAt ? Math.ceil(recordingStartedAt) : 0,
|
|
14536
|
-
firstChunkReceivedAt: firstChunkReceivedAt ? Math.ceil(firstChunkReceivedAt) : 0,
|
|
14537
|
-
signatureStartedAt: signatureStartedAt ? Math.ceil(signatureStartedAt) : 0,
|
|
14538
|
-
signatureEndedAt: signatureEndedAt ? Math.ceil(signatureEndedAt) : 0,
|
|
14539
|
-
acceptClickedAt: acceptClickedAt ? Math.ceil(acceptClickedAt) : 0,
|
|
14540
|
-
clearClickedAt: clearClickedAt ? Math.ceil(clearClickedAt) : 0,
|
|
14541
|
-
recordingStopRequestedAt: recordingStopRequestedAt ? Math.ceil(recordingStopRequestedAt) : 0,
|
|
14542
|
-
recordingStoppedAt: Math.ceil(recordingStoppedAt),
|
|
14543
|
-
lastChunkReceivedAt: lastChunkReceivedAt ? Math.ceil(lastChunkReceivedAt) : 0
|
|
14544
|
-
}
|
|
14545
|
-
};
|
|
14546
|
-
debug('signature video metadata', metadata);
|
|
14547
|
-
onSignatureVideoCaptured(blob, signatureData !== null && signatureData !== void 0 ? signatureData : null, imageUrl !== null && imageUrl !== void 0 ? imageUrl : null, metadata);
|
|
14548
|
-
return [2 /*return*/];
|
|
14549
|
-
});
|
|
14550
|
-
});
|
|
14551
|
-
}
|
|
14552
|
-
var _a, recordingStartedAt, recordingStopRequestedAt, isRecording, _b, finalChunkReceived, timedOut, waitedMs;
|
|
14553
|
-
return __generator(this, function (_c) {
|
|
14554
|
-
switch (_c.label) {
|
|
14479
|
+
var _this = this;
|
|
14480
|
+
return __generator(this, function (_a) {
|
|
14481
|
+
switch (_a.label) {
|
|
14555
14482
|
case 0:
|
|
14556
|
-
_a = get(), recordingStartedAt = _a.recordingStartedAt, recordingStopRequestedAt = _a.recordingStopRequestedAt;
|
|
14557
|
-
isRecording = !!recordingStartedAt && !recordingStopRequestedAt;
|
|
14558
|
-
if (!isRecording) return [2 /*return*/];
|
|
14559
14483
|
set({
|
|
14560
|
-
recordingStopRequestedAt: performance.now()
|
|
14561
|
-
recordingStoppedAt: undefined
|
|
14484
|
+
recordingStopRequestedAt: performance.now()
|
|
14562
14485
|
});
|
|
14563
|
-
|
|
14564
|
-
return [4 /*yield*/, waitForOneMoreChunk()
|
|
14565
|
-
// this represents the time that it is safe to release the camera access
|
|
14566
|
-
];
|
|
14486
|
+
if (!signatureRecorder) return [2 /*return*/];
|
|
14487
|
+
return [4 /*yield*/, waitForOneMoreChunk()];
|
|
14567
14488
|
case 1:
|
|
14568
|
-
|
|
14569
|
-
|
|
14570
|
-
|
|
14571
|
-
|
|
14572
|
-
|
|
14573
|
-
|
|
14574
|
-
|
|
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
|
+
};
|
|
14575
14527
|
signatureRecorder.stop();
|
|
14576
|
-
return [3 /*break*/, 4];
|
|
14577
|
-
case 2:
|
|
14578
|
-
warn('signature recorder not found, processing video immediately');
|
|
14579
|
-
return [4 /*yield*/, processVideo()];
|
|
14580
|
-
case 3:
|
|
14581
|
-
_c.sent();
|
|
14582
|
-
_c.label = 4;
|
|
14583
|
-
case 4:
|
|
14584
14528
|
return [2 /*return*/];
|
|
14585
14529
|
}
|
|
14586
14530
|
});
|
|
@@ -14588,9 +14532,6 @@ var useVideoSignatureStore = zustand.create()(middleware.devtools(function (set,
|
|
|
14588
14532
|
},
|
|
14589
14533
|
clearRecordedData: function clearRecordedData() {
|
|
14590
14534
|
signatureChunks = [];
|
|
14591
|
-
ondataavailableInvocations = [];
|
|
14592
|
-
ondataavailableStartTime = undefined;
|
|
14593
|
-
lastCalculatedVideoChunkRate = undefined;
|
|
14594
14535
|
signatureRecorder === null || signatureRecorder === void 0 ? void 0 : signatureRecorder.stop();
|
|
14595
14536
|
signatureRecorder = null;
|
|
14596
14537
|
set({
|
|
@@ -14605,13 +14546,8 @@ var useVideoSignatureStore = zustand.create()(middleware.devtools(function (set,
|
|
|
14605
14546
|
signatureStartedAt: undefined,
|
|
14606
14547
|
signatureEndedAt: undefined,
|
|
14607
14548
|
acceptClickedAt: undefined,
|
|
14608
|
-
// Note: clearClickedAt is intentionally preserved for telemetry metadata
|
|
14609
14549
|
supportsRequestVideoFrameCallback: undefined,
|
|
14610
|
-
supportsRoundRect: undefined
|
|
14611
|
-
nullChunksReceived: 0,
|
|
14612
|
-
firstNullChunkReceivedAt: undefined,
|
|
14613
|
-
lastNullChunkReceivedAt: undefined,
|
|
14614
|
-
finalChunkReceived: false
|
|
14550
|
+
supportsRoundRect: undefined
|
|
14615
14551
|
});
|
|
14616
14552
|
}
|
|
14617
14553
|
});
|
|
@@ -14621,11 +14557,11 @@ var useVideoSignatureStore = zustand.create()(middleware.devtools(function (set,
|
|
|
14621
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.
|
|
14622
14558
|
* @param checkEveryMs - The interval in milliseconds between checks after the initial delay has passed.
|
|
14623
14559
|
* @param timeoutMs - The maximum time in milliseconds to wait for the chunk -- this is used to prevent infinite loops.
|
|
14624
|
-
* @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.
|
|
14625
14561
|
*/
|
|
14626
14562
|
function waitForOneMoreChunk(delayMs, checkEveryMs, timeoutMs) {
|
|
14627
14563
|
if (delayMs === void 0) {
|
|
14628
|
-
delayMs =
|
|
14564
|
+
delayMs = 1000;
|
|
14629
14565
|
}
|
|
14630
14566
|
if (checkEveryMs === void 0) {
|
|
14631
14567
|
checkEveryMs = 100;
|
|
@@ -14633,44 +14569,29 @@ function waitForOneMoreChunk(delayMs, checkEveryMs, timeoutMs) {
|
|
|
14633
14569
|
if (timeoutMs === void 0) {
|
|
14634
14570
|
timeoutMs = 3000;
|
|
14635
14571
|
}
|
|
14572
|
+
var start = performance.now();
|
|
14636
14573
|
return new Promise(function (resolve) {
|
|
14637
|
-
var
|
|
14638
|
-
|
|
14639
|
-
var initialLastChunkReceivedAt = (_a = useVideoSignatureStore.getState().lastChunkReceivedAt) !== null && _a !== void 0 ? _a : start;
|
|
14640
|
-
signatureRecorder === null || signatureRecorder === void 0 ? void 0 : signatureRecorder.requestData();
|
|
14641
|
-
function checkForChunk() {
|
|
14574
|
+
var initialLastChunkReceivedAt = useVideoSignatureStore.getState().lastChunkReceivedAt;
|
|
14575
|
+
function gotAChunk() {
|
|
14642
14576
|
var lastChunkReceivedAt = useVideoSignatureStore.getState().lastChunkReceivedAt;
|
|
14643
|
-
|
|
14644
|
-
var timedOut = waitedMs > timeoutMs;
|
|
14645
|
-
var finalChunkReceived = !!lastChunkReceivedAt && !!initialLastChunkReceivedAt && lastChunkReceivedAt > initialLastChunkReceivedAt;
|
|
14646
|
-
return {
|
|
14647
|
-
waitedMs: waitedMs,
|
|
14648
|
-
finalChunkReceived: finalChunkReceived,
|
|
14649
|
-
timedOut: timedOut
|
|
14650
|
-
};
|
|
14577
|
+
return performance.now() - start > timeoutMs || !lastChunkReceivedAt || !initialLastChunkReceivedAt || lastChunkReceivedAt > initialLastChunkReceivedAt;
|
|
14651
14578
|
}
|
|
14652
14579
|
setTimeout(function () {
|
|
14653
|
-
// check immediately
|
|
14654
|
-
var result = checkForChunk();
|
|
14655
|
-
if (result.finalChunkReceived || result.timedOut) return resolve(result);
|
|
14580
|
+
if (gotAChunk()) return resolve(); // check immediately
|
|
14656
14581
|
// otherwise, check on a configured interval
|
|
14657
14582
|
var interval = setInterval(function () {
|
|
14658
|
-
|
|
14659
|
-
if (result.finalChunkReceived || result.timedOut) {
|
|
14583
|
+
if (gotAChunk()) {
|
|
14660
14584
|
clearInterval(interval);
|
|
14661
|
-
resolve(
|
|
14585
|
+
resolve();
|
|
14662
14586
|
}
|
|
14663
14587
|
}, checkEveryMs);
|
|
14664
14588
|
}, delayMs);
|
|
14665
14589
|
});
|
|
14666
14590
|
}
|
|
14667
14591
|
function VideoSignatureContextProvider(_a) {
|
|
14592
|
+
var _b, _c;
|
|
14668
14593
|
var children = _a.children;
|
|
14669
|
-
var
|
|
14670
|
-
videoRef = _b.videoRef,
|
|
14671
|
-
videoWidth = _b.videoWidth,
|
|
14672
|
-
videoHeight = _b.videoHeight,
|
|
14673
|
-
releaseCameraAccess = _b.releaseCameraAccess;
|
|
14594
|
+
var videoRef = useCameraStore().videoRef;
|
|
14674
14595
|
var outputCanvas = React.useRef(null);
|
|
14675
14596
|
React.useEffect(function () {
|
|
14676
14597
|
return useVideoSignatureStore.setState({
|
|
@@ -14678,13 +14599,18 @@ function VideoSignatureContextProvider(_a) {
|
|
|
14678
14599
|
});
|
|
14679
14600
|
}, []);
|
|
14680
14601
|
var drawOutputFrame = React.useCallback(function () {
|
|
14681
|
-
if (!outputCanvas.current) return;
|
|
14602
|
+
if (!outputCanvas.current || !videoRef.current) return;
|
|
14682
14603
|
var ctx = outputCanvas.current.getContext('2d');
|
|
14683
14604
|
if (!ctx) return;
|
|
14684
|
-
var _a = [
|
|
14605
|
+
var _a = [videoRef.current.videoWidth, videoRef.current.videoHeight],
|
|
14685
14606
|
w = _a[0],
|
|
14686
14607
|
h = _a[1];
|
|
14687
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
|
+
}
|
|
14688
14614
|
var rect = [w * (isPortrait ? 0.02 : 0.15),
|
|
14689
14615
|
// x
|
|
14690
14616
|
h * (isPortrait ? 0.15 : 0.25),
|
|
@@ -14693,9 +14619,7 @@ function VideoSignatureContextProvider(_a) {
|
|
|
14693
14619
|
// width
|
|
14694
14620
|
h * (isPortrait ? 0.7 : 0.5) // height
|
|
14695
14621
|
];
|
|
14696
|
-
|
|
14697
|
-
ctx.drawImage(videoRef.current, 0, 0, w, h);
|
|
14698
|
-
}
|
|
14622
|
+
ctx.drawImage(videoRef.current, 0, 0, w, h);
|
|
14699
14623
|
ctx.beginPath();
|
|
14700
14624
|
ctx.fillStyle = 'rgba(255,255,255,0.5)';
|
|
14701
14625
|
var supportsRoundRect = typeof ctx.roundRect === 'function';
|
|
@@ -14717,15 +14641,11 @@ function VideoSignatureContextProvider(_a) {
|
|
|
14717
14641
|
ctx.drawImage.apply(ctx, __spreadArray([signatureCanvas], rect, false));
|
|
14718
14642
|
}
|
|
14719
14643
|
}, [videoRef]);
|
|
14720
|
-
|
|
14721
|
-
React.useEffect(function () {
|
|
14722
|
-
if (finalChunkReceived) releaseCameraAccess();
|
|
14723
|
-
}, [finalChunkReceived, releaseCameraAccess]);
|
|
14724
|
-
useVideoFrameLoop(videoRef, drawOutputFrame, !finalChunkReceived);
|
|
14644
|
+
useVideoFrameLoop(videoRef, drawOutputFrame);
|
|
14725
14645
|
return /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, children, /*#__PURE__*/React__namespace.default.createElement(InvisibleCanvas, {
|
|
14726
14646
|
ref: outputCanvas,
|
|
14727
|
-
width: videoWidth,
|
|
14728
|
-
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
|
|
14729
14649
|
}));
|
|
14730
14650
|
}
|
|
14731
14651
|
function requestVideoFrameCallback(video, onFrame) {
|
|
@@ -14745,11 +14665,8 @@ function requestVideoFrameCallback(video, onFrame) {
|
|
|
14745
14665
|
};
|
|
14746
14666
|
}
|
|
14747
14667
|
}
|
|
14748
|
-
function videoFrameLoop(video, onFrame
|
|
14749
|
-
if (
|
|
14750
|
-
running = true;
|
|
14751
|
-
}
|
|
14752
|
-
if (!video || !running) return;
|
|
14668
|
+
function videoFrameLoop(video, onFrame) {
|
|
14669
|
+
if (!video) return;
|
|
14753
14670
|
var cancelFn;
|
|
14754
14671
|
var canceled = false;
|
|
14755
14672
|
function onFrameRecursive() {
|
|
@@ -14770,51 +14687,10 @@ function videoFrameLoop(video, onFrame, running) {
|
|
|
14770
14687
|
if (cancelFn !== undefined) cancelFn();
|
|
14771
14688
|
};
|
|
14772
14689
|
}
|
|
14773
|
-
function useVideoFrameLoop(ref, onFrame
|
|
14774
|
-
if (running === void 0) {
|
|
14775
|
-
running = true;
|
|
14776
|
-
}
|
|
14690
|
+
function useVideoFrameLoop(ref, onFrame) {
|
|
14777
14691
|
React.useEffect(function () {
|
|
14778
|
-
return videoFrameLoop(ref.current, onFrame
|
|
14779
|
-
}, [onFrame, ref
|
|
14780
|
-
}
|
|
14781
|
-
function calculateAndStoreOndataavailableRate() {
|
|
14782
|
-
if (ondataavailableInvocations.length < 2 || !ondataavailableStartTime) {
|
|
14783
|
-
lastCalculatedVideoChunkRate = {
|
|
14784
|
-
averageRate: 0,
|
|
14785
|
-
minRate: 0,
|
|
14786
|
-
maxRate: 0,
|
|
14787
|
-
totalChunksReceived: ondataavailableInvocations.length,
|
|
14788
|
-
recordingDurationMs: 0
|
|
14789
|
-
};
|
|
14790
|
-
return;
|
|
14791
|
-
}
|
|
14792
|
-
var totalDuration = ondataavailableInvocations[ondataavailableInvocations.length - 1] - ondataavailableStartTime;
|
|
14793
|
-
var averageRate = (ondataavailableInvocations.length - 1) / (totalDuration / 1000); // invocations per second
|
|
14794
|
-
// Calculate rates for each interval between invocations
|
|
14795
|
-
var rates = [];
|
|
14796
|
-
for (var i = 1; i < ondataavailableInvocations.length; i++) {
|
|
14797
|
-
var intervalMs = ondataavailableInvocations[i] - ondataavailableInvocations[i - 1];
|
|
14798
|
-
var rate = 1000 / intervalMs; // invocations per second for this interval
|
|
14799
|
-
rates.push(rate);
|
|
14800
|
-
}
|
|
14801
|
-
var minRate = Math.min.apply(Math, rates);
|
|
14802
|
-
var maxRate = Math.max.apply(Math, rates);
|
|
14803
|
-
lastCalculatedVideoChunkRate = {
|
|
14804
|
-
averageRate: Math.round(averageRate * 100) / 100,
|
|
14805
|
-
// Round to 2 decimal places
|
|
14806
|
-
minRate: Math.round(minRate * 100) / 100,
|
|
14807
|
-
maxRate: Math.round(maxRate * 100) / 100,
|
|
14808
|
-
totalChunksReceived: ondataavailableInvocations.length,
|
|
14809
|
-
recordingDurationMs: Math.round(totalDuration)
|
|
14810
|
-
};
|
|
14811
|
-
}
|
|
14812
|
-
function trackVideoChunkRate(now) {
|
|
14813
|
-
// Track ondataavailable invocations for rate calculation
|
|
14814
|
-
ondataavailableStartTime !== null && ondataavailableStartTime !== void 0 ? ondataavailableStartTime : ondataavailableStartTime = now;
|
|
14815
|
-
ondataavailableInvocations.push(now);
|
|
14816
|
-
// Calculate and store the current rate
|
|
14817
|
-
calculateAndStoreOndataavailableRate();
|
|
14692
|
+
return videoFrameLoop(ref.current, onFrame);
|
|
14693
|
+
}, [onFrame, ref]);
|
|
14818
14694
|
}
|
|
14819
14695
|
|
|
14820
14696
|
function VideoSignaturePad(_a) {
|
|
@@ -15066,11 +14942,14 @@ function VideoSignatureCaptureComponent(_a, ref) {
|
|
|
15066
14942
|
onHeadTrackingPredictionMade = _o.onPredictionMade,
|
|
15067
14943
|
startHeadTracking = _o.start,
|
|
15068
14944
|
stopHeadTracking = _o.stop;
|
|
15069
|
-
var
|
|
15070
|
-
|
|
15071
|
-
|
|
15072
|
-
|
|
15073
|
-
|
|
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;
|
|
15074
14953
|
React.useImperativeHandle(ref, function () {
|
|
15075
14954
|
return {
|
|
15076
14955
|
clearRecordedData: function clearRecordedData() {
|
|
@@ -15096,15 +14975,15 @@ function VideoSignatureCaptureComponent(_a, ref) {
|
|
|
15096
14975
|
var verbiage = useTranslations(rawVerbiage, {
|
|
15097
14976
|
guidanceMessageText: 'Please sign the box below'
|
|
15098
14977
|
});
|
|
15099
|
-
var
|
|
15100
|
-
headTrackingSatisfied =
|
|
15101
|
-
setHeadTrackingSatisfied =
|
|
15102
|
-
var
|
|
15103
|
-
lastFace =
|
|
15104
|
-
setLastFace =
|
|
15105
|
-
var
|
|
15106
|
-
numFramesWithoutFaces =
|
|
15107
|
-
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];
|
|
15108
14987
|
onHeadTrackingPredictionMade(useDebounce.useThrottledCallback(React.useCallback(function (_a) {
|
|
15109
14988
|
var face = _a.face;
|
|
15110
14989
|
if (headTrackingDisabled) return;
|
|
@@ -15119,12 +14998,12 @@ function VideoSignatureCaptureComponent(_a, ref) {
|
|
|
15119
14998
|
return n + 1;
|
|
15120
14999
|
});
|
|
15121
15000
|
}, [headTrackingBoundaryPercentage, headTrackingBoundaryType, headTrackingDisabled, videoHeight, videoWidth]), 16));
|
|
15122
|
-
var
|
|
15123
|
-
containerRef =
|
|
15124
|
-
|
|
15125
|
-
width =
|
|
15126
|
-
|
|
15127
|
-
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;
|
|
15128
15007
|
var debugScalingDetails = useDebugScalingDetails({
|
|
15129
15008
|
enabled: debugMode,
|
|
15130
15009
|
pageWidth: width,
|
|
@@ -15167,10 +15046,10 @@ function VideoSignatureCaptureComponent(_a, ref) {
|
|
|
15167
15046
|
face: lastFace,
|
|
15168
15047
|
scaling: debugScalingDetails,
|
|
15169
15048
|
color: headTrackingSatisfied ? 'green' : 'red'
|
|
15170
|
-
}))), /*#__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, {
|
|
15171
15050
|
onClick: onExit,
|
|
15172
15051
|
className: classNames.exitCaptureBtn
|
|
15173
|
-
}));
|
|
15052
|
+
})));
|
|
15174
15053
|
}
|
|
15175
15054
|
var VideoSignatureCapture = /*#__PURE__*/React.forwardRef(VideoSignatureCaptureComponent);
|
|
15176
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"
|
|
@@ -15749,18 +15628,13 @@ function VideoSignatureWizardGuides(_a) {
|
|
|
15749
15628
|
});
|
|
15750
15629
|
}, []);
|
|
15751
15630
|
var onClearBtnClicked = React.useCallback(function () {
|
|
15752
|
-
var _a;
|
|
15753
|
-
var _b = useVideoSignatureStore.getState(),
|
|
15754
|
-
timesSignatureCleared = _b.timesSignatureCleared,
|
|
15755
|
-
signaturePad = _b.signaturePad;
|
|
15631
|
+
var _a, _b;
|
|
15756
15632
|
useVideoSignatureStore.setState({
|
|
15757
|
-
clearClickedAt: performance.now(),
|
|
15758
|
-
timesSignatureCleared: timesSignatureCleared + 1,
|
|
15759
15633
|
signatureStartedAt: undefined,
|
|
15760
15634
|
signaturePadEmpty: true,
|
|
15761
15635
|
signatureValid: false
|
|
15762
15636
|
});
|
|
15763
|
-
(_a =
|
|
15637
|
+
(_b = (_a = useVideoSignatureStore.getState().signaturePad) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.clear();
|
|
15764
15638
|
if (restartVideoOnSignaturePadCleared) {
|
|
15765
15639
|
setTimeout(function () {
|
|
15766
15640
|
useVideoSignatureStore.getState().clearRecordedData();
|