idmission-web-sdk 2.2.60 → 2.2.62
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/id_capture/IdCapture.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureModelsProvider.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureStateProvider.d.ts +0 -2
- package/dist/components/id_capture/IdCaptureStateProvider.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureContext.d.ts.map +1 -1
- package/dist/lib/models/DocumentDetection.d.ts +2 -4
- package/dist/lib/models/DocumentDetection.d.ts.map +1 -1
- package/dist/lib/models/Focus.d.ts +0 -4
- package/dist/lib/models/Focus.d.ts.map +1 -1
- package/dist/lib/models/defaults/DocumentDetector.d.ts +1 -1
- package/dist/sdk2.cjs.development.js +21 -41
- 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 +21 -41
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +21 -41
- 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
|
@@ -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.
|
|
214
|
+
var webSdkVersion = '2.2.62';
|
|
215
215
|
|
|
216
216
|
function getPlatform() {
|
|
217
217
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -8311,7 +8311,7 @@
|
|
|
8311
8311
|
|
|
8312
8312
|
var DEFAULT_CDN_URL = 'https://websdk-cdn-dev.idmission.com/assets';
|
|
8313
8313
|
|
|
8314
|
-
var defaultDocumentDetectorModelPath = "".concat(DEFAULT_CDN_URL, "/models/DocumentDetector/DocumentDetector-
|
|
8314
|
+
var defaultDocumentDetectorModelPath = "".concat(DEFAULT_CDN_URL, "/models/DocumentDetector/DocumentDetector-20241018_093000.tflite");
|
|
8315
8315
|
|
|
8316
8316
|
var defaultFocusModelPath = "".concat(DEFAULT_CDN_URL, "/models/Focus/Focus-20241008_102708.tflite");
|
|
8317
8317
|
|
|
@@ -8330,10 +8330,6 @@
|
|
|
8330
8330
|
passport: {
|
|
8331
8331
|
desktop: 0,
|
|
8332
8332
|
mobile: 0.3
|
|
8333
|
-
},
|
|
8334
|
-
singlePage: {
|
|
8335
|
-
desktop: 0,
|
|
8336
|
-
mobile: 0.3
|
|
8337
8333
|
}
|
|
8338
8334
|
};
|
|
8339
8335
|
var classifier = null;
|
|
@@ -8959,19 +8955,16 @@
|
|
|
8959
8955
|
idCardFront: 0.6,
|
|
8960
8956
|
idCardBack: 0.6,
|
|
8961
8957
|
passport: 0.4,
|
|
8962
|
-
singlePage: 0.4,
|
|
8963
8958
|
stability: {
|
|
8964
8959
|
idCardFront: 0.85,
|
|
8965
8960
|
idCardBack: 0.85,
|
|
8966
|
-
passport: 0.5
|
|
8967
|
-
singlePage: 0.5
|
|
8961
|
+
passport: 0.5
|
|
8968
8962
|
}
|
|
8969
8963
|
};
|
|
8970
8964
|
var documentTypeDisplayNames = {
|
|
8971
8965
|
idCardFront: 'ID card front',
|
|
8972
8966
|
idCardBack: 'ID card back',
|
|
8973
8967
|
passport: 'Passport',
|
|
8974
|
-
singlePage: 'Single page',
|
|
8975
8968
|
none: 'None'
|
|
8976
8969
|
};
|
|
8977
8970
|
var detector = null;
|
|
@@ -9160,7 +9153,7 @@
|
|
|
9160
9153
|
right: 20
|
|
9161
9154
|
};
|
|
9162
9155
|
function processDocumentDetectorPrediction(prediction, thresholds, boundaries) {
|
|
9163
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m
|
|
9156
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
9164
9157
|
if (boundaries === void 0) {
|
|
9165
9158
|
boundaries = defaultDocumentDetectionBoundaries;
|
|
9166
9159
|
}
|
|
@@ -9211,25 +9204,18 @@
|
|
|
9211
9204
|
var bestPassportPage = detectedObjects.find(function (obj) {
|
|
9212
9205
|
return obj.label === 'Passport page';
|
|
9213
9206
|
});
|
|
9214
|
-
var bestSinglePage = detectedObjects.find(function (obj) {
|
|
9215
|
-
return obj.label === 'Single page';
|
|
9216
|
-
});
|
|
9217
9207
|
var idCardFrontDetectionScore = (_e = bestIdCardFront === null || bestIdCardFront === void 0 ? void 0 : bestIdCardFront.score) !== null && _e !== void 0 ? _e : 0;
|
|
9218
9208
|
var idCardBackDetectionScore = (_f = bestIdCardBack === null || bestIdCardBack === void 0 ? void 0 : bestIdCardBack.score) !== null && _f !== void 0 ? _f : 0;
|
|
9219
9209
|
var passportDetectionScore = (_g = bestPassportPage === null || bestPassportPage === void 0 ? void 0 : bestPassportPage.score) !== null && _g !== void 0 ? _g : 0;
|
|
9220
|
-
var
|
|
9221
|
-
var
|
|
9222
|
-
var
|
|
9223
|
-
var
|
|
9224
|
-
var
|
|
9225
|
-
var
|
|
9226
|
-
var detectionThreshold = singlePageDetectionThresholdMet ? thresholds.singlePage : passportDetectionThresholdMet ? thresholds.passport : idCardBackDetectionThresholdMet ? thresholds.idCardBack : thresholds.idCardFront;
|
|
9227
|
-
var detectionScore = (_o = bestDocument === null || bestDocument === void 0 ? void 0 : bestDocument.score) !== null && _o !== void 0 ? _o : 0;
|
|
9210
|
+
var idCardFrontDetectionThresholdMet = idCardFrontDetectionScore >= ((_h = thresholds.idCardFront) !== null && _h !== void 0 ? _h : 0);
|
|
9211
|
+
var idCardBackDetectionThresholdMet = idCardBackDetectionScore >= ((_j = thresholds.idCardBack) !== null && _j !== void 0 ? _j : 0);
|
|
9212
|
+
var passportDetectionThresholdMet = passportDetectionScore >= ((_k = thresholds.passport) !== null && _k !== void 0 ? _k : 0);
|
|
9213
|
+
var bestDocument = passportDetectionThresholdMet ? bestPassportPage : idCardBackDetectionThresholdMet ? bestIdCardBack : bestIdCardFront;
|
|
9214
|
+
var detectionThreshold = passportDetectionThresholdMet ? thresholds.passport : idCardBackDetectionThresholdMet ? thresholds.idCardBack : thresholds.idCardFront;
|
|
9215
|
+
var detectionScore = (_l = bestDocument === null || bestDocument === void 0 ? void 0 : bestDocument.score) !== null && _l !== void 0 ? _l : 0;
|
|
9228
9216
|
var detectionThresholdMet = detectionScore >= (detectionThreshold !== null && detectionThreshold !== void 0 ? detectionThreshold : 0);
|
|
9229
9217
|
var detectedDocumentType = 'none';
|
|
9230
|
-
if (
|
|
9231
|
-
detectedDocumentType = 'singlePage';
|
|
9232
|
-
} else if (passportDetectionThresholdMet) {
|
|
9218
|
+
if (passportDetectionThresholdMet) {
|
|
9233
9219
|
detectedDocumentType = 'passport';
|
|
9234
9220
|
} else if (idCardBackDetectionThresholdMet) {
|
|
9235
9221
|
detectedDocumentType = 'idCardBack';
|
|
@@ -9243,12 +9229,12 @@
|
|
|
9243
9229
|
var documentIsStable = false;
|
|
9244
9230
|
var documentTooClose = false;
|
|
9245
9231
|
if (bestDocument) {
|
|
9246
|
-
var
|
|
9247
|
-
docWidth =
|
|
9248
|
-
docHeight =
|
|
9232
|
+
var _o = [bestDocument.box.width / frameWidth, bestDocument.box.height / frameHeight],
|
|
9233
|
+
docWidth = _o[0],
|
|
9234
|
+
docHeight = _o[1];
|
|
9249
9235
|
documentTooClose = docWidth > 0.85 || docHeight > 0.85;
|
|
9250
9236
|
if (detectionThresholdMet && documentInBounds && !documentTooClose) {
|
|
9251
|
-
var thresholdSet = (
|
|
9237
|
+
var thresholdSet = (_m = thresholds.stability) !== null && _m !== void 0 ? _m : defaultDocumentDetectionThresholds.stability;
|
|
9252
9238
|
var threshold_1 = thresholdSet[detectedDocumentType];
|
|
9253
9239
|
var framesNeeded = Math.ceil(average(framesNeededSamples));
|
|
9254
9240
|
trackBox(bestDocument.box, framesNeeded);
|
|
@@ -10271,8 +10257,7 @@
|
|
|
10271
10257
|
if (!lastPredictionCanvas.current) return [2 /*return*/];
|
|
10272
10258
|
stopDetectionAtStart = stopDetection.current;
|
|
10273
10259
|
focusPredictionTime = 0, focusScore = 0, focusThresholdMet = false;
|
|
10274
|
-
isRequiredDocumentType = requiredDocumentType === 'none' || prediction.detectedDocumentType === requiredDocumentType || ((_a = requiredDocumentType.includes) === null || _a === void 0 ? void 0 : _a.call(requiredDocumentType, prediction.detectedDocumentType))
|
|
10275
|
-
;
|
|
10260
|
+
isRequiredDocumentType = requiredDocumentType === 'none' || prediction.detectedDocumentType === requiredDocumentType || ((_a = requiredDocumentType.includes) === null || _a === void 0 ? void 0 : _a.call(requiredDocumentType, prediction.detectedDocumentType));
|
|
10276
10261
|
if (isRequiredDocumentType && prediction.detectedDocumentType !== 'none' && prediction.detectionThresholdMet && prediction.documentInBounds && !prediction.documentTooClose && prediction.documentIsStable) {
|
|
10277
10262
|
focusPrediction = makeFocusPrediction(lastPredictionCanvas.current, (_b = prediction.bestDocument) === null || _b === void 0 ? void 0 : _b.box);
|
|
10278
10263
|
if (focusPrediction) {
|
|
@@ -10503,8 +10488,6 @@
|
|
|
10503
10488
|
idCardBackDetectionThresholdMet: false,
|
|
10504
10489
|
passportDetectionScore: 0,
|
|
10505
10490
|
passportDetectionThresholdMet: false,
|
|
10506
|
-
singlePageDetectionScore: 0,
|
|
10507
|
-
singlePageDetectionThresholdMet: false,
|
|
10508
10491
|
focusScore: 0,
|
|
10509
10492
|
focusThresholdMet: false,
|
|
10510
10493
|
isGoodFrame: false,
|
|
@@ -14247,7 +14230,7 @@
|
|
|
14247
14230
|
scaling: debugScalingDetails,
|
|
14248
14231
|
flipX: !isRearFacing
|
|
14249
14232
|
});
|
|
14250
|
-
}))), debugMode && ( /*#__PURE__*/React.createElement(DebugStatsPane, null, camera ? ( /*#__PURE__*/React.createElement(React.Fragment, null, "\u2705 Camera: ", camera.label, " (", camera.width, "x", camera.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React.createElement("br", null), state.frameCaptureRate > 0.75 ? '✅' : '👎', " Frame Rate:", ' ', Math.round((state.frameCaptureRate + Number.EPSILON) * 1000) / 1000, ' ', "fps (", detectionTime, "ms doc detect, ", focusPredictionTime, "ms focus)", /*#__PURE__*/React.createElement("br", null), modelsReady ? ( /*#__PURE__*/React.createElement(React.Fragment, null, state.detectionThresholdMet ? '✅' : '❌', " Detected Document Type: ", state.detectedDocumentType, /*#__PURE__*/React.createElement("br", null), state.idCardFrontDetectionThresholdMet ? '✅' : '❌', " ID Card Front Score: ", state.idCardFrontDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.idCardBackDetectionThresholdMet ? '✅' : '❌', " ID Card Back Score: ", state.idCardBackDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.passportDetectionThresholdMet ? '✅' : '❌', " Passport Score: ", state.passportDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.
|
|
14233
|
+
}))), debugMode && ( /*#__PURE__*/React.createElement(DebugStatsPane, null, camera ? ( /*#__PURE__*/React.createElement(React.Fragment, null, "\u2705 Camera: ", camera.label, " (", camera.width, "x", camera.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React.createElement("br", null), state.frameCaptureRate > 0.75 ? '✅' : '👎', " Frame Rate:", ' ', Math.round((state.frameCaptureRate + Number.EPSILON) * 1000) / 1000, ' ', "fps (", detectionTime, "ms doc detect, ", focusPredictionTime, "ms focus)", /*#__PURE__*/React.createElement("br", null), modelsReady ? ( /*#__PURE__*/React.createElement(React.Fragment, null, state.detectionThresholdMet ? '✅' : '❌', " Detected Document Type: ", state.detectedDocumentType, /*#__PURE__*/React.createElement("br", null), state.idCardFrontDetectionThresholdMet ? '✅' : '❌', " ID Card Front Score: ", state.idCardFrontDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.idCardBackDetectionThresholdMet ? '✅' : '❌', " ID Card Back Score: ", state.idCardBackDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.passportDetectionThresholdMet ? '✅' : '❌', " Passport Score: ", state.passportDetectionScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.focusThresholdMet ? '✅' : '❌', " Focus Score:", ' ', state.focusScore.toFixed(3), /*#__PURE__*/React.createElement("br", null), state.documentInBounds ? '✅' : '❌', " Document In Bounds", /*#__PURE__*/React.createElement("br", null), state.documentIsStable ? '✅' : '❌', " Document Is Stable", /*#__PURE__*/React.createElement("br", null), state.goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', state.goodFramesCount, "/", state.goodFramesThreshold)) : ( /*#__PURE__*/React.createElement(React.Fragment, null, "\u274C Models not ready")))));
|
|
14251
14234
|
};
|
|
14252
14235
|
var timeSince = function timeSince(t) {
|
|
14253
14236
|
if (!t) return 0;
|
|
@@ -21109,14 +21092,11 @@
|
|
|
21109
21092
|
}, [isRecording, isRecordingVideo, startRecordingVideo, videoUrl]);
|
|
21110
21093
|
var animationFrame = React.useRef(0);
|
|
21111
21094
|
React.useEffect(function () {
|
|
21112
|
-
var _a;
|
|
21113
21095
|
if (!signaturePad.current || !videoRef.current || !outputCanvas.current || !camera || !isRecording || !isRecordingVideo) return;
|
|
21114
|
-
var
|
|
21115
|
-
w =
|
|
21116
|
-
h =
|
|
21117
|
-
var isPortrait =
|
|
21118
|
-
var cameraIsLandscape = w > h;
|
|
21119
|
-
if (isPortrait && cameraIsLandscape) _a = [h, w], w = _a[0], h = _a[1];
|
|
21096
|
+
var _a = [camera.width, camera.height],
|
|
21097
|
+
w = _a[0],
|
|
21098
|
+
h = _a[1];
|
|
21099
|
+
var isPortrait = w < h;
|
|
21120
21100
|
outputCanvas.current.width = w;
|
|
21121
21101
|
outputCanvas.current.height = h;
|
|
21122
21102
|
var ctx = outputCanvas.current.getContext('2d');
|