@tsocial/tvweb-sdk.nbcci 0.0.0-beta.20251215-093759 → 0.0.0-beta.20251215-170414
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/build/tvweb-sdk.nbcci.cjs.min.js +193 -191
- package/build/tvweb-sdk.nbcci.esm.min.js +193 -191
- package/build/tvweb-sdk.nbcci.standalone.js +817 -94
- package/build/tvweb-sdk.nbcci.standalone.min.js +195 -193
- package/build/types/index.d.ts +33 -4
- package/package.json +5 -6
|
@@ -19095,7 +19095,7 @@
|
|
|
19095
19095
|
t.decode = t.parse = w, t.encode = t.stringify = k;
|
|
19096
19096
|
}), A = (E.decode, E.parse, E.encode, E.stringify), B = function() {
|
|
19097
19097
|
function e(e) {
|
|
19098
|
-
this.authorizer = e.authorizer, this.domain = e.domain, this.onError = e.onError, this.configHeaders = e.headers, this.fallbackUrls = e.fallbackUrls;
|
|
19098
|
+
this.authorizer = e.authorizer, this.domain = e.domain, this.onError = e.onError, this.configHeaders = e.headers, this.fallbackUrls = e.fallbackUrls, this.requestTimeoutMs = e.requestTimeoutMs;
|
|
19099
19099
|
}
|
|
19100
19100
|
return e.prototype.get = function(e, t, r) {
|
|
19101
19101
|
var n = new URL(this.resolveUrl(e));
|
|
@@ -19155,13 +19155,24 @@
|
|
|
19155
19155
|
requestPath: e,
|
|
19156
19156
|
method: "GET"
|
|
19157
19157
|
}, "blob");
|
|
19158
|
+
}, e.prototype.setupTimeout = function() {
|
|
19159
|
+
if (!this.requestTimeoutMs || this.requestTimeoutMs <= 0) return {};
|
|
19160
|
+
var e = new AbortController, t = setTimeout(function() {
|
|
19161
|
+
e.abort();
|
|
19162
|
+
}, this.requestTimeoutMs);
|
|
19163
|
+
return {
|
|
19164
|
+
abortController: e,
|
|
19165
|
+
timeoutId: t
|
|
19166
|
+
};
|
|
19167
|
+
}, e.prototype.cleanupTimeout = function(e) {
|
|
19168
|
+
e && clearTimeout(e);
|
|
19158
19169
|
}, e.prototype.request = function(e, t, r) {
|
|
19159
19170
|
return void 0 === r && (r = "json"), s(this, void 0, void 0, function() {
|
|
19160
|
-
var n, a, o, s, l, u;
|
|
19171
|
+
var n, a, o, s, l, u, d, f, h;
|
|
19161
19172
|
return c(this, function(c) {
|
|
19162
19173
|
switch(c.label){
|
|
19163
19174
|
case 0:
|
|
19164
|
-
n = {}, a = {}, this.authorizer && (n = this.authorizer.getHeaders(t)), this.configHeaders && (a = this.configHeaders), t.headers = i(i(i({}, t.headers), n), a), c.label = 1;
|
|
19175
|
+
n = {}, a = {}, this.authorizer && (n = this.authorizer.getHeaders(t)), this.configHeaders && (a = this.configHeaders), t.headers = i(i(i({}, t.headers), n), a), s = (o = this.setupTimeout()).abortController, l = o.timeoutId, s && (t.signal = s.signal), c.label = 1;
|
|
19165
19176
|
case 1:
|
|
19166
19177
|
return c.trys.push([
|
|
19167
19178
|
1,
|
|
@@ -19173,22 +19184,22 @@
|
|
|
19173
19184
|
fetch(e, t)
|
|
19174
19185
|
];
|
|
19175
19186
|
case 2:
|
|
19176
|
-
return
|
|
19187
|
+
return u = c.sent(), this.cleanupTimeout(l), [
|
|
19177
19188
|
4,
|
|
19178
|
-
"blob" === r ?
|
|
19189
|
+
"blob" === r ? u.blob() : u.json()
|
|
19179
19190
|
];
|
|
19180
19191
|
case 3:
|
|
19181
|
-
if ((
|
|
19192
|
+
if ((d = c.sent()).errors && this.onError) throw this.onError(d.errors), d;
|
|
19182
19193
|
return [
|
|
19183
19194
|
2,
|
|
19184
|
-
|
|
19195
|
+
d
|
|
19185
19196
|
];
|
|
19186
19197
|
case 4:
|
|
19187
|
-
if (
|
|
19198
|
+
if (f = c.sent(), this.cleanupTimeout(l), this.shouldRetryWithFallback(f) && Array.isArray(this.fallbackUrls) && this.fallbackUrls.length > 0) return h = "GET" === t.method ? new URL(e).searchParams : null, [
|
|
19188
19199
|
2,
|
|
19189
|
-
this.retryWithFallback(t.requestPath, t,
|
|
19200
|
+
this.retryWithFallback(t.requestPath, t, h, r)
|
|
19190
19201
|
];
|
|
19191
|
-
throw
|
|
19202
|
+
throw f;
|
|
19192
19203
|
case 5:
|
|
19193
19204
|
return [
|
|
19194
19205
|
2
|
|
@@ -19204,41 +19215,41 @@
|
|
|
19204
19215
|
return "AbortError" === e.name ? (console.error("Request timed out"), !0) : e instanceof TypeError && (console.error("Network error occurred:", e.message), !0);
|
|
19205
19216
|
}, e.prototype.retryWithFallback = function(e, t, r, n) {
|
|
19206
19217
|
return void 0 === r && (r = null), void 0 === n && (n = "json"), s(this, void 0, void 0, function() {
|
|
19207
|
-
var
|
|
19218
|
+
var a, o, s, l, u, d, f, h, p, m;
|
|
19208
19219
|
return c(this, function(c) {
|
|
19209
19220
|
switch(c.label){
|
|
19210
19221
|
case 0:
|
|
19211
19222
|
if (!Array.isArray(this.fallbackUrls) || 0 === this.fallbackUrls.length) throw Error("No fallback URLs available");
|
|
19212
|
-
|
|
19223
|
+
a = null, o = 0, c.label = 1;
|
|
19213
19224
|
case 1:
|
|
19214
|
-
if (!(
|
|
19225
|
+
if (!(o < this.fallbackUrls.length)) return [
|
|
19215
19226
|
3,
|
|
19216
19227
|
7
|
|
19217
19228
|
];
|
|
19218
|
-
c.label = 2;
|
|
19229
|
+
l = (s = this.setupTimeout()).abortController, u = s.timeoutId, c.label = 2;
|
|
19219
19230
|
case 2:
|
|
19220
19231
|
return c.trys.push([
|
|
19221
19232
|
2,
|
|
19222
19233
|
5,
|
|
19223
19234
|
,
|
|
19224
19235
|
6
|
|
19225
|
-
]),
|
|
19236
|
+
]), d = new URL(this.resolveFallbackUrl(e, this.fallbackUrls[o])), r && "GET" === t.method && (d.search = r.toString()), f = i({}, t), l && (f.signal = l.signal), [
|
|
19226
19237
|
4,
|
|
19227
|
-
fetch(
|
|
19238
|
+
fetch(d.toString(), f)
|
|
19228
19239
|
];
|
|
19229
19240
|
case 3:
|
|
19230
|
-
return
|
|
19241
|
+
return h = c.sent(), this.cleanupTimeout(u), [
|
|
19231
19242
|
4,
|
|
19232
|
-
"blob" === n ?
|
|
19243
|
+
"blob" === n ? h.blob() : h.json()
|
|
19233
19244
|
];
|
|
19234
19245
|
case 4:
|
|
19235
|
-
if ((
|
|
19246
|
+
if ((p = c.sent()).errors && this.onError) throw this.onError(p.errors), p;
|
|
19236
19247
|
return [
|
|
19237
19248
|
2,
|
|
19238
|
-
|
|
19249
|
+
p
|
|
19239
19250
|
];
|
|
19240
19251
|
case 5:
|
|
19241
|
-
return
|
|
19252
|
+
return m = c.sent(), this.cleanupTimeout(u), a = m, this.shouldRetryWithFallback(m) ? [
|
|
19242
19253
|
3,
|
|
19243
19254
|
6
|
|
19244
19255
|
] : [
|
|
@@ -19246,12 +19257,12 @@
|
|
|
19246
19257
|
7
|
|
19247
19258
|
];
|
|
19248
19259
|
case 6:
|
|
19249
|
-
return
|
|
19260
|
+
return o++, [
|
|
19250
19261
|
3,
|
|
19251
19262
|
1
|
|
19252
19263
|
];
|
|
19253
19264
|
case 7:
|
|
19254
|
-
throw
|
|
19265
|
+
throw a;
|
|
19255
19266
|
}
|
|
19256
19267
|
});
|
|
19257
19268
|
});
|
|
@@ -19570,12 +19581,13 @@
|
|
|
19570
19581
|
}
|
|
19571
19582
|
function L(e, t, r, n) {
|
|
19572
19583
|
void 0 === r && (r = "production");
|
|
19573
|
-
var i = void 0 === n ? {} : n, a = i.headers, o = i.fallbackUrls;
|
|
19584
|
+
var i = void 0 === n ? {} : n, a = i.headers, o = i.fallbackUrls, s = i.requestTimeoutMs;
|
|
19574
19585
|
return new B({
|
|
19575
19586
|
authorizer: new M(e, t),
|
|
19576
19587
|
domain: N(r),
|
|
19577
19588
|
headers: a,
|
|
19578
|
-
fallbackUrls: o
|
|
19589
|
+
fallbackUrls: o,
|
|
19590
|
+
requestTimeoutMs: s
|
|
19579
19591
|
});
|
|
19580
19592
|
}
|
|
19581
19593
|
var D = function() {
|
|
@@ -30444,7 +30456,8 @@
|
|
|
30444
30456
|
}), this.transactionEnabled = i.supportTransaction || !1, this.encryptionEnabled = i.enableEncryption || !1;
|
|
30445
30457
|
var a = L(e, t, r, {
|
|
30446
30458
|
headers: i.httpHeaders,
|
|
30447
|
-
fallbackUrls: i.fallbackUrls
|
|
30459
|
+
fallbackUrls: i.fallbackUrls,
|
|
30460
|
+
requestTimeoutMs: i.requestTimeoutMs
|
|
30448
30461
|
});
|
|
30449
30462
|
this.transactionManager = new j(a), this.encryptionService = new rq(t), this.compareFaceService = new d(a), this.clientSettingsService = new f(a), this.convertPDFService = new b(a), this.ekycPDFService = new v(a), this.readIDCardService = new n(a), this.requestVerifyIDCardService = new p(a), this.requestVerifyPortraitSerivce = new m(a), this.imagesService = new l(a), this.fileService = new u(a), this.verifyFaceLivenessService = new h(a), this.searchFaceService = new y(a), this.detectIDTamperingService = new g(a), this.httpClient = a;
|
|
30450
30463
|
}
|
|
@@ -33770,7 +33783,7 @@
|
|
|
33770
33783
|
}, nS$1;
|
|
33771
33784
|
}();
|
|
33772
33785
|
function nB$1() {
|
|
33773
|
-
return "0.0.0-beta.20251215-
|
|
33786
|
+
return "0.0.0-beta.20251215-170414";
|
|
33774
33787
|
}
|
|
33775
33788
|
function nI$1() {
|
|
33776
33789
|
return {
|
|
@@ -41246,49 +41259,53 @@
|
|
|
41246
41259
|
}, uz;
|
|
41247
41260
|
}(), uG);
|
|
41248
41261
|
}();
|
|
41249
|
-
function dm() {
|
|
41262
|
+
function dm(e, t) {
|
|
41263
|
+
let r = dy();
|
|
41264
|
+
return (dm = function(e, t) {
|
|
41265
|
+
return r[e -= 334];
|
|
41266
|
+
})(e, t);
|
|
41267
|
+
}
|
|
41268
|
+
let dg = dm;
|
|
41269
|
+
function dy() {
|
|
41250
41270
|
let e = [
|
|
41251
|
-
"
|
|
41252
|
-
"
|
|
41253
|
-
"
|
|
41271
|
+
"0301070342",
|
|
41272
|
+
"072a8648ce",
|
|
41273
|
+
"DepBO8t60S",
|
|
41274
|
+
"+faHkP3QC3",
|
|
41275
|
+
"D9EKOWS+U4",
|
|
41276
|
+
"KA==",
|
|
41277
|
+
"000",
|
|
41278
|
+
"KoZIzj0DAQ",
|
|
41279
|
+
"ssRdXLZEX8",
|
|
41280
|
+
"78pJsmjA",
|
|
41281
|
+
"23755112qixOGK",
|
|
41254
41282
|
"ytJdcsPxrD",
|
|
41255
|
-
"44160GNFAeO",
|
|
41256
|
-
"758970ENfGty",
|
|
41257
41283
|
"MfPrcYTM70",
|
|
41258
|
-
"44P0rKKsZK",
|
|
41259
41284
|
"MFkwEwYHKo",
|
|
41260
|
-
"
|
|
41261
|
-
"
|
|
41262
|
-
"DepBO8t60S",
|
|
41263
|
-
"3059301306",
|
|
41264
|
-
"ssRdXLZEX8",
|
|
41285
|
+
"8915nLIOAa",
|
|
41286
|
+
"44P0rKKsZK",
|
|
41265
41287
|
"cDQgAE9h6Z",
|
|
41266
|
-
"
|
|
41267
|
-
"
|
|
41268
|
-
"
|
|
41269
|
-
"
|
|
41270
|
-
"
|
|
41271
|
-
"
|
|
41288
|
+
"4218291nxdvtB",
|
|
41289
|
+
"2729172royNkn",
|
|
41290
|
+
"653601YIYffL",
|
|
41291
|
+
"2315541rITdMg",
|
|
41292
|
+
"2a8648ce3d",
|
|
41293
|
+
"1619078DMdLEK",
|
|
41294
|
+
"Mjci1ul8mm",
|
|
41295
|
+
"3059301306"
|
|
41272
41296
|
];
|
|
41273
|
-
return (
|
|
41297
|
+
return (dy = function() {
|
|
41274
41298
|
return e;
|
|
41275
41299
|
})();
|
|
41276
41300
|
}
|
|
41277
|
-
let
|
|
41301
|
+
let db = dm, dv = dy();
|
|
41278
41302
|
for(;;)try {
|
|
41279
|
-
if (parseInt(
|
|
41280
|
-
|
|
41303
|
+
if (parseInt(db(350)) / 1 + parseInt(db(353)) / 2 + parseInt(db(351)) / 3 + parseInt(db(349)) / 4 + parseInt(db(345)) / 5 * (parseInt(db(340)) / 6) + parseInt(db(348)) / 7 + -parseInt(db(341)) / 8 === 573683) break;
|
|
41304
|
+
dv.push(dv.shift());
|
|
41281
41305
|
} catch (e) {
|
|
41282
|
-
|
|
41283
|
-
}
|
|
41284
|
-
let dv = dg(307) + "072a8648ce3d02010608" + dg(296) + "0301070342" + dg(304);
|
|
41285
|
-
function d_(e, t) {
|
|
41286
|
-
let r = dm();
|
|
41287
|
-
return (d_ = function(e, t) {
|
|
41288
|
-
return r[e -= 288];
|
|
41289
|
-
})(e, t);
|
|
41306
|
+
dv.push(dv.shift());
|
|
41290
41307
|
}
|
|
41291
|
-
let
|
|
41308
|
+
let d_ = dg(355) + dg(357) + "3d02010608" + dg(352) + dg(356) + dg(337), dx = dg(344) + "ZIzj0CAQYI" + dg(338) + dg(347) + dg(358) + dg(342) + dg(334) + dg(346) + dg(354) + dg(335) + dg(343) + dg(339) + dg(336);
|
|
41292
41309
|
async function dC(e) {
|
|
41293
41310
|
let t = new TextEncoder().encode(e);
|
|
41294
41311
|
return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256", t))).map((e)=>e.toString(16).padStart(2, "0")).join("");
|
|
@@ -41393,7 +41410,7 @@
|
|
|
41393
41410
|
isValid: !1,
|
|
41394
41411
|
error: i0$1.invalid_license
|
|
41395
41412
|
};
|
|
41396
|
-
let { mode: a, license: o, signature: s } = dS(e), c = dw(i4$1(o)), l = (r = t || dx, n = i4$1(r).replace(
|
|
41413
|
+
let { mode: a, license: o, signature: s } = dS(e), c = dw(i4$1(o)), l = (r = t || dx, n = i4$1(r).replace(d_, ""), i = new dp.ec("p256").keyFromPublic(n, "hex"), {
|
|
41397
41414
|
verifySignature: async (e, t)=>{
|
|
41398
41415
|
try {
|
|
41399
41416
|
let r = await dC(e), n = i4$1(t);
|
|
@@ -43355,7 +43372,8 @@
|
|
|
43355
43372
|
"x-request-id": e,
|
|
43356
43373
|
...r
|
|
43357
43374
|
},
|
|
43358
|
-
fallbackUrls: c
|
|
43375
|
+
fallbackUrls: c,
|
|
43376
|
+
requestTimeoutMs: 6e4
|
|
43359
43377
|
}), {
|
|
43360
43378
|
onDone: n
|
|
43361
43379
|
});
|
|
@@ -43384,7 +43402,8 @@
|
|
|
43384
43402
|
"x-request-id": l,
|
|
43385
43403
|
...r
|
|
43386
43404
|
},
|
|
43387
|
-
fallbackUrls: s
|
|
43405
|
+
fallbackUrls: s,
|
|
43406
|
+
requestTimeoutMs: 6e4
|
|
43388
43407
|
}), {
|
|
43389
43408
|
onDone: ()=>{}
|
|
43390
43409
|
});
|
|
@@ -90516,7 +90535,7 @@
|
|
|
90516
90535
|
}
|
|
90517
90536
|
};
|
|
90518
90537
|
|
|
90519
|
-
const videoSettings$
|
|
90538
|
+
const videoSettings$5 = libExports.isMobile ? {
|
|
90520
90539
|
// aspectRatio: 16 / 9,
|
|
90521
90540
|
width: {
|
|
90522
90541
|
ideal: 640
|
|
@@ -91295,7 +91314,7 @@
|
|
|
91295
91314
|
flipHorizontal: frontCamera,
|
|
91296
91315
|
ref: videoRef,
|
|
91297
91316
|
onError: onErrorCallback,
|
|
91298
|
-
videoSettings: videoSettings$
|
|
91317
|
+
videoSettings: videoSettings$5,
|
|
91299
91318
|
closeButton: /*#__PURE__*/ jsxRuntimeExports.jsx(CloseIcon, {}),
|
|
91300
91319
|
children: /*#__PURE__*/ jsxRuntimeExports.jsxs(WarmUpOverlay, {
|
|
91301
91320
|
overlay: !warmupDone || !isPlaying,
|
|
@@ -91857,11 +91876,11 @@
|
|
|
91857
91876
|
extraConfig: null
|
|
91858
91877
|
};
|
|
91859
91878
|
|
|
91860
|
-
const DirectionalIcon = dt$1.img`
|
|
91879
|
+
const DirectionalIcon$1 = dt$1.img`
|
|
91861
91880
|
width: ${({ width })=>width};
|
|
91862
91881
|
`;
|
|
91863
91882
|
// eslint-disable-next-line react/require-default-props
|
|
91864
|
-
function DirectionIcon({ type }) {
|
|
91883
|
+
function DirectionIcon$1({ type }) {
|
|
91865
91884
|
const theme = nt$2();
|
|
91866
91885
|
// default icons and widths based on version
|
|
91867
91886
|
const iconDirection = useThemeIcon(`Selfie.Active.directionIcon.${type}`, `${type}_arrow.gif`);
|
|
@@ -91878,7 +91897,7 @@
|
|
|
91878
91897
|
if (type === ra$1.FaceDirection.FRONTAL) {
|
|
91879
91898
|
// For frontal direction, use the SVG icon if available
|
|
91880
91899
|
if (frontalIcon) {
|
|
91881
|
-
return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon, {
|
|
91900
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon$1, {
|
|
91882
91901
|
src: frontalIcon,
|
|
91883
91902
|
width: iconWidth,
|
|
91884
91903
|
alt: ""
|
|
@@ -91886,20 +91905,20 @@
|
|
|
91886
91905
|
}
|
|
91887
91906
|
}
|
|
91888
91907
|
if (directionIconSrc && directionIconSrc !== null) {
|
|
91889
|
-
return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon, {
|
|
91908
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon$1, {
|
|
91890
91909
|
src: get(theme, `Selfie.Active.directionIcon.${type}`),
|
|
91891
91910
|
width: iconWidth,
|
|
91892
91911
|
alt: ""
|
|
91893
91912
|
});
|
|
91894
91913
|
}
|
|
91895
91914
|
// fallback to default icons and width
|
|
91896
|
-
return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon, {
|
|
91915
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon$1, {
|
|
91897
91916
|
src: iconDirection,
|
|
91898
91917
|
alt: "",
|
|
91899
91918
|
width: iconWidth
|
|
91900
91919
|
});
|
|
91901
91920
|
}
|
|
91902
|
-
DirectionIcon.propTypes = {
|
|
91921
|
+
DirectionIcon$1.propTypes = {
|
|
91903
91922
|
type: PropTypes.oneOf([
|
|
91904
91923
|
ra$1.FaceDirection.LEFT,
|
|
91905
91924
|
ra$1.FaceDirection.RIGHT,
|
|
@@ -91907,12 +91926,12 @@
|
|
|
91907
91926
|
ra$1.FaceDirection.FRONTAL
|
|
91908
91927
|
])
|
|
91909
91928
|
};
|
|
91910
|
-
DirectionIcon.defaultProps = {
|
|
91929
|
+
DirectionIcon$1.defaultProps = {
|
|
91911
91930
|
type: ra$1.FaceDirection.LEFT
|
|
91912
91931
|
};
|
|
91913
91932
|
|
|
91914
91933
|
// To reduce the calculation for blazeface
|
|
91915
|
-
const videoSettings$
|
|
91934
|
+
const videoSettings$4 = libExports.isMobile ? {
|
|
91916
91935
|
width: {
|
|
91917
91936
|
ideal: 640
|
|
91918
91937
|
}
|
|
@@ -92037,7 +92056,7 @@
|
|
|
92037
92056
|
onClose: onCloseCallback,
|
|
92038
92057
|
flipHorizontal: flipVideoHorizontal ?? frontCamera,
|
|
92039
92058
|
ref: refVideo,
|
|
92040
|
-
videoSettings: videoSettings$
|
|
92059
|
+
videoSettings: videoSettings$4,
|
|
92041
92060
|
onError: onErrorCallback,
|
|
92042
92061
|
scale: cameraScale,
|
|
92043
92062
|
defaultCameraId: defaultCameraId,
|
|
@@ -92148,16 +92167,16 @@
|
|
|
92148
92167
|
isLoading: false,
|
|
92149
92168
|
flipVideoHorizontal: null,
|
|
92150
92169
|
customDirectionIcon: {
|
|
92151
|
-
[ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
|
|
92170
|
+
[ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
92152
92171
|
type: ra$1.FaceDirection.LEFT
|
|
92153
92172
|
}),
|
|
92154
|
-
[ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
|
|
92173
|
+
[ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
92155
92174
|
type: ra$1.FaceDirection.RIGHT
|
|
92156
92175
|
}),
|
|
92157
|
-
[ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
|
|
92176
|
+
[ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
92158
92177
|
type: ra$1.FaceDirection.UP
|
|
92159
92178
|
}),
|
|
92160
|
-
[ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
|
|
92179
|
+
[ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
92161
92180
|
type: ra$1.FaceDirection.FRONTAL
|
|
92162
92181
|
})
|
|
92163
92182
|
},
|
|
@@ -92535,7 +92554,7 @@
|
|
|
92535
92554
|
});
|
|
92536
92555
|
}
|
|
92537
92556
|
|
|
92538
|
-
const videoSettings$
|
|
92557
|
+
const videoSettings$3 = libExports.isMobile ? {
|
|
92539
92558
|
// aspectRatio: 16 / 9,
|
|
92540
92559
|
width: {
|
|
92541
92560
|
ideal: 640
|
|
@@ -93068,7 +93087,7 @@
|
|
|
93068
93087
|
flipHorizontal: frontCamera,
|
|
93069
93088
|
ref: videoRef,
|
|
93070
93089
|
onError: onErrorCallback,
|
|
93071
|
-
videoSettings: videoSettings$
|
|
93090
|
+
videoSettings: videoSettings$3,
|
|
93072
93091
|
closeButton: /*#__PURE__*/ jsxRuntimeExports.jsx(CloseIcon, {}),
|
|
93073
93092
|
children: /*#__PURE__*/ jsxRuntimeExports.jsxs(WarmUpOverlay, {
|
|
93074
93093
|
overlay: !warmupDone || !isPlaying,
|
|
@@ -93410,13 +93429,13 @@
|
|
|
93410
93429
|
};
|
|
93411
93430
|
|
|
93412
93431
|
// To reduce the calculation for blazeface
|
|
93413
|
-
const videoSettings = libExports.isMobile ? {
|
|
93432
|
+
const videoSettings$2 = libExports.isMobile ? {
|
|
93414
93433
|
width: {
|
|
93415
93434
|
ideal: 640
|
|
93416
93435
|
}
|
|
93417
93436
|
} : null;
|
|
93418
93437
|
// eslint-disable-next-line react/prop-types, consistent-return
|
|
93419
|
-
const SelfieStepImageHolder = ({ stepNumber, type, theme })=>{
|
|
93438
|
+
const SelfieStepImageHolder$1 = ({ stepNumber, type, theme })=>{
|
|
93420
93439
|
const imageHolderIcon = useDefaultThemeIcon(`instruction_${type}.svg`);
|
|
93421
93440
|
// prioritize custom theme icons
|
|
93422
93441
|
const customHolderSrc = get(theme, `Selfie.Active.imageHolder.${type}`);
|
|
@@ -93441,7 +93460,7 @@
|
|
|
93441
93460
|
alt: ""
|
|
93442
93461
|
});
|
|
93443
93462
|
};
|
|
93444
|
-
function renderDirectionIcon(directionIcon, directionIconAnimation) {
|
|
93463
|
+
function renderDirectionIcon$1(directionIcon, directionIconAnimation) {
|
|
93445
93464
|
if (!directionIcon) return null;
|
|
93446
93465
|
if (typeof directionIcon === 'string') {
|
|
93447
93466
|
return /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
|
|
@@ -93586,7 +93605,7 @@
|
|
|
93586
93605
|
onClose: onCloseCallback,
|
|
93587
93606
|
flipHorizontal: flipVideoHorizontal ?? frontCamera,
|
|
93588
93607
|
ref: refVideo,
|
|
93589
|
-
videoSettings: videoSettings,
|
|
93608
|
+
videoSettings: videoSettings$2,
|
|
93590
93609
|
onError: onErrorCallback,
|
|
93591
93610
|
scale: cameraScale,
|
|
93592
93611
|
defaultCameraId: defaultCameraId,
|
|
@@ -93611,7 +93630,7 @@
|
|
|
93611
93630
|
showErrorRing: !!faceDetectionError
|
|
93612
93631
|
}),
|
|
93613
93632
|
/*#__PURE__*/ jsxRuntimeExports.jsx(InstructionsOverlay, {
|
|
93614
|
-
children: renderDirectionIcon(directionIcon, directionIconAnimation)
|
|
93633
|
+
children: renderDirectionIcon$1(directionIcon, directionIconAnimation)
|
|
93615
93634
|
}),
|
|
93616
93635
|
activeCapturing && /*#__PURE__*/ jsxRuntimeExports.jsx(CapturingOverlay, {})
|
|
93617
93636
|
]
|
|
@@ -93634,7 +93653,7 @@
|
|
|
93634
93653
|
className: "image_preview",
|
|
93635
93654
|
src: objUrl,
|
|
93636
93655
|
alt: ""
|
|
93637
|
-
}) : /*#__PURE__*/ jsxRuntimeExports.jsx(SelfieStepImageHolder, {
|
|
93656
|
+
}) : /*#__PURE__*/ jsxRuntimeExports.jsx(SelfieStepImageHolder$1, {
|
|
93638
93657
|
stepNumber: index + 1,
|
|
93639
93658
|
type: name,
|
|
93640
93659
|
theme: theme
|
|
@@ -93725,16 +93744,16 @@
|
|
|
93725
93744
|
frontCamera: true,
|
|
93726
93745
|
isLoading: false,
|
|
93727
93746
|
customDirectionIcon: {
|
|
93728
|
-
[ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
|
|
93747
|
+
[ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
93729
93748
|
type: ra$1.FaceDirection.LEFT
|
|
93730
93749
|
}),
|
|
93731
|
-
[ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
|
|
93750
|
+
[ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
93732
93751
|
type: ra$1.FaceDirection.RIGHT
|
|
93733
93752
|
}),
|
|
93734
|
-
[ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
|
|
93753
|
+
[ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
93735
93754
|
type: ra$1.FaceDirection.UP
|
|
93736
93755
|
}),
|
|
93737
|
-
[ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
|
|
93756
|
+
[ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
93738
93757
|
type: ra$1.FaceDirection.FRONTAL
|
|
93739
93758
|
})
|
|
93740
93759
|
},
|
|
@@ -93862,6 +93881,706 @@
|
|
|
93862
93881
|
};
|
|
93863
93882
|
const useWrapIndicator = ()=>reactExports.useContext(WrapIndicatorContext);
|
|
93864
93883
|
|
|
93884
|
+
const DirectionalIcon = dt$1.img`
|
|
93885
|
+
width: ${({ width })=>width};
|
|
93886
|
+
`;
|
|
93887
|
+
// eslint-disable-next-line react/require-default-props
|
|
93888
|
+
function DirectionIcon({ type }) {
|
|
93889
|
+
const theme = nt$2();
|
|
93890
|
+
// default icons and widths based on version
|
|
93891
|
+
const iconDirection = useThemeIcon(`Selfie.Active.directionIcon.${type}`, `${type}_arrow.gif`);
|
|
93892
|
+
const iconWidth = getTheme(`Selfie.Active.directionIcon.${type}Width`)({
|
|
93893
|
+
theme
|
|
93894
|
+
});
|
|
93895
|
+
// prioritize custom theme icons
|
|
93896
|
+
const directionIconSrc = get(theme, `Selfie.Active.directionIcon.${type}`);
|
|
93897
|
+
if (directionIconSrc === null) {
|
|
93898
|
+
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
93899
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
|
|
93900
|
+
}
|
|
93901
|
+
if (directionIconSrc && directionIconSrc !== null) {
|
|
93902
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon, {
|
|
93903
|
+
src: get(theme, `Selfie.Active.directionIcon.${type}`),
|
|
93904
|
+
width: iconWidth,
|
|
93905
|
+
alt: ""
|
|
93906
|
+
});
|
|
93907
|
+
}
|
|
93908
|
+
// fallback to default icons and width
|
|
93909
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon, {
|
|
93910
|
+
src: iconDirection,
|
|
93911
|
+
alt: "",
|
|
93912
|
+
width: iconWidth
|
|
93913
|
+
});
|
|
93914
|
+
}
|
|
93915
|
+
DirectionIcon.propTypes = {
|
|
93916
|
+
type: PropTypes.oneOf([
|
|
93917
|
+
ra$1.FaceDirection.LEFT,
|
|
93918
|
+
ra$1.FaceDirection.RIGHT,
|
|
93919
|
+
ra$1.FaceDirection.UP,
|
|
93920
|
+
ra$1.FaceDirection.FRONTAL
|
|
93921
|
+
])
|
|
93922
|
+
};
|
|
93923
|
+
DirectionIcon.defaultProps = {
|
|
93924
|
+
type: ra$1.FaceDirection.LEFT
|
|
93925
|
+
};
|
|
93926
|
+
|
|
93927
|
+
// To reduce the calculation for blazeface
|
|
93928
|
+
const videoSettings$1 = libExports.isMobile ? {
|
|
93929
|
+
width: {
|
|
93930
|
+
ideal: 640
|
|
93931
|
+
}
|
|
93932
|
+
} : null;
|
|
93933
|
+
// eslint-disable-next-line react/prop-types, consistent-return
|
|
93934
|
+
const SelfieStepImageHolder = ({ stepNumber, type, theme })=>{
|
|
93935
|
+
const imageHolderIcon = useDefaultThemeIcon(`instruction_${type}.svg`);
|
|
93936
|
+
// prioritize custom theme icons
|
|
93937
|
+
const customHolderSrc = get(theme, `Selfie.Active.imageHolder.${type}`);
|
|
93938
|
+
if (customHolderSrc === null) {
|
|
93939
|
+
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
93940
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
|
|
93941
|
+
}
|
|
93942
|
+
if (typeof customHolderSrc === 'string' && customHolderSrc !== '') {
|
|
93943
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
|
|
93944
|
+
src: customHolderSrc,
|
|
93945
|
+
alt: ""
|
|
93946
|
+
});
|
|
93947
|
+
}
|
|
93948
|
+
// v1: use step number
|
|
93949
|
+
if (get(theme, 'themeVersion') === 'v1') {
|
|
93950
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx("span", {
|
|
93951
|
+
children: stepNumber
|
|
93952
|
+
});
|
|
93953
|
+
}
|
|
93954
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
|
|
93955
|
+
src: imageHolderIcon,
|
|
93956
|
+
alt: ""
|
|
93957
|
+
});
|
|
93958
|
+
};
|
|
93959
|
+
function renderDirectionIcon(directionIcon, directionIconAnimation) {
|
|
93960
|
+
if (!directionIcon) return null;
|
|
93961
|
+
if (typeof directionIcon === 'string') {
|
|
93962
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
|
|
93963
|
+
className: directionIconAnimation,
|
|
93964
|
+
src: directionIcon,
|
|
93965
|
+
alt: "",
|
|
93966
|
+
style: {
|
|
93967
|
+
maxWidth: '98px',
|
|
93968
|
+
maxHeight: '98px',
|
|
93969
|
+
marginBottom: '25px'
|
|
93970
|
+
}
|
|
93971
|
+
});
|
|
93972
|
+
}
|
|
93973
|
+
return directionIcon;
|
|
93974
|
+
}
|
|
93975
|
+
// eslint-disable-next-line react/require-default-props
|
|
93976
|
+
function ActiveLivenessV1(props) {
|
|
93977
|
+
const { apiCheck, onLivenessDetectionDone, captureFrameSettings, onFramesCaptured, frontCamera, flipVideoHorizontal, customDirectionIcon, customStepTimeConstraints, onProcessing, customErrors, apiCredentials, outputEncryptionSettings, cameraScale, defaultCameraId, offsetFaceY, styledComponent, isLoading, serviceSettings, onReset } = props;
|
|
93978
|
+
const theme = nt$2();
|
|
93979
|
+
const { onErrorCallback, onCloseCallback } = useSDKCallback();
|
|
93980
|
+
const bgCameraMask = iH.useAsset('bg_camera_mask.png');
|
|
93981
|
+
const bgCameraMaskRed = iH.useAsset('bg_camera_mask_red.png');
|
|
93982
|
+
const icLoading = useThemeIcon('IDCapturing.loadingIcon.src', 'ic_loading.gif');
|
|
93983
|
+
const [uiSpacing, setUISpacing] = reactExports.useState({});
|
|
93984
|
+
const { yFaceVerificationStepsWrapper, yFaceDetectionError } = uiSpacing;
|
|
93985
|
+
const [remainingTime, setRemainingTime] = reactExports.useState('');
|
|
93986
|
+
const [currentOrientation, setCurrentOrientation] = reactExports.useState();
|
|
93987
|
+
const surroundStyle = reactExports.useMemo(()=>({
|
|
93988
|
+
backgroundColor: getTheme('Selfie.backgroundColor')({
|
|
93989
|
+
theme
|
|
93990
|
+
})
|
|
93991
|
+
}), [
|
|
93992
|
+
theme
|
|
93993
|
+
]);
|
|
93994
|
+
// preload icons
|
|
93995
|
+
usePreloadThemeAsset(get(theme, 'themeVersion'), 'up_arrow.gif');
|
|
93996
|
+
usePreloadThemeAsset(get(theme, 'themeVersion'), 'left_arrow.gif');
|
|
93997
|
+
usePreloadThemeAsset(get(theme, 'themeVersion'), 'right_arrow.gif');
|
|
93998
|
+
usePreloadThemeAsset(get(theme, 'themeVersion'), 'frontal_arrow.gif');
|
|
93999
|
+
usePreloadThemeAsset(get(theme, 'themeVersion'), 'instruction_up.svg');
|
|
94000
|
+
usePreloadThemeAsset(get(theme, 'themeVersion'), 'instruction_left.svg');
|
|
94001
|
+
usePreloadThemeAsset(get(theme, 'themeVersion'), 'instruction_right.svg');
|
|
94002
|
+
usePreloadThemeAsset(get(theme, 'themeVersion'), 'instruction_frontal.svg');
|
|
94003
|
+
const cropAreaDimension = reactExports.useCallback(({ clientHeight, videoAreaWidth, videoAreaHeight, lostX, lostY })=>{
|
|
94004
|
+
let width;
|
|
94005
|
+
let height;
|
|
94006
|
+
if (libExports.isMobile) {
|
|
94007
|
+
width = videoAreaWidth;
|
|
94008
|
+
height = width;
|
|
94009
|
+
} else {
|
|
94010
|
+
height = videoAreaHeight - 200;
|
|
94011
|
+
width = height;
|
|
94012
|
+
}
|
|
94013
|
+
const x = Math.floor((videoAreaWidth - width) / 2) + lostX;
|
|
94014
|
+
let y = 5 + lostY;
|
|
94015
|
+
const yFaceDetectionErrorNew = lostY + 25;
|
|
94016
|
+
const yCropAreaNew = yFaceDetectionErrorNew + 30;
|
|
94017
|
+
const yFaceVerificationStepsWrapperNew = yCropAreaNew + height + 20;
|
|
94018
|
+
setUISpacing({
|
|
94019
|
+
yFaceDetectionError: yFaceDetectionErrorNew,
|
|
94020
|
+
yFaceVerificationStepsWrapper: yFaceVerificationStepsWrapperNew
|
|
94021
|
+
});
|
|
94022
|
+
const topLimit = Math.floor(lostY);
|
|
94023
|
+
const botLimit = Math.floor(clientHeight - lostY);
|
|
94024
|
+
y = Math.floor(yCropAreaNew); // floor the y value to avoid blur line on ios safari
|
|
94025
|
+
if (offsetFaceY !== 0 && (y + offsetFaceY < topLimit || y + offsetFaceY + height > botLimit)) {
|
|
94026
|
+
onErrorCallback({
|
|
94027
|
+
code: `offsetFaceY must be in [-${y - topLimit}, ${botLimit - height - y}]`
|
|
94028
|
+
});
|
|
94029
|
+
} else {
|
|
94030
|
+
y += offsetFaceY;
|
|
94031
|
+
}
|
|
94032
|
+
return {
|
|
94033
|
+
x,
|
|
94034
|
+
y,
|
|
94035
|
+
width,
|
|
94036
|
+
height
|
|
94037
|
+
};
|
|
94038
|
+
}, [
|
|
94039
|
+
offsetFaceY,
|
|
94040
|
+
onErrorCallback
|
|
94041
|
+
]);
|
|
94042
|
+
const { shouldResetFlowOnOrientationChange, cropArea, curStepIndex, directionIcon, directionIconAnimation, faceDetectionError, resetFlow, handleVideoPlayed, instructions, refVideo, refIsReseting, steps, videoPlayed, activeCapturing, warmupDone, showLoading } = useActiveLiveness({
|
|
94043
|
+
currentOrientation,
|
|
94044
|
+
apiCheck,
|
|
94045
|
+
bgCameraMask,
|
|
94046
|
+
bgCameraMaskRed,
|
|
94047
|
+
surroundStyle,
|
|
94048
|
+
onLivenessDetectionDone,
|
|
94049
|
+
onError: onErrorCallback,
|
|
94050
|
+
cropAreaDimension,
|
|
94051
|
+
customDirectionIcon,
|
|
94052
|
+
captureFrameSettings,
|
|
94053
|
+
onFramesCaptured,
|
|
94054
|
+
setRemainingTime,
|
|
94055
|
+
customStepTimeConstraints,
|
|
94056
|
+
onProcessing,
|
|
94057
|
+
customErrors,
|
|
94058
|
+
apiCredentials,
|
|
94059
|
+
outputEncryptionSettings,
|
|
94060
|
+
cameraScale,
|
|
94061
|
+
serviceSettings,
|
|
94062
|
+
onReset
|
|
94063
|
+
});
|
|
94064
|
+
reactExports.useEffect(()=>{
|
|
94065
|
+
if (typeof steps[0]?.directionIcon === 'string') {
|
|
94066
|
+
Promise.all(steps.map((step)=>preloadImage(step.directionIcon)));
|
|
94067
|
+
}
|
|
94068
|
+
}, [
|
|
94069
|
+
steps
|
|
94070
|
+
]);
|
|
94071
|
+
const { CloseCameraButton } = styledComponent;
|
|
94072
|
+
const progressCircleProps = getProgressCircleProps(props, theme);
|
|
94073
|
+
const currentProgress = !refIsReseting.current ? curStepIndex / steps.length * 100 : 0;
|
|
94074
|
+
// for error text
|
|
94075
|
+
const { lang } = no$1.useSDKSettings();
|
|
94076
|
+
const timer = reactExports.useRef(0);
|
|
94077
|
+
const lastError = reactExports.useRef({});
|
|
94078
|
+
const duration = reactExports.useRef(ra$1.ErrorDuration.SHORT);
|
|
94079
|
+
const lastErrorMsg = reactExports.useMemo(()=>{
|
|
94080
|
+
const { msg, duration: errorDuration = ra$1.ErrorDuration.SHORT } = faceDetectionError || {};
|
|
94081
|
+
const errorMsg = msg?.[lang];
|
|
94082
|
+
if (Date.now() - timer.current >= duration.current) {
|
|
94083
|
+
timer.current = Date.now();
|
|
94084
|
+
duration.current = errorDuration;
|
|
94085
|
+
lastError.current = errorMsg;
|
|
94086
|
+
}
|
|
94087
|
+
return lastError.current;
|
|
94088
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
94089
|
+
}, [
|
|
94090
|
+
faceDetectionError,
|
|
94091
|
+
curStepIndex
|
|
94092
|
+
]); // curStepIndex is used to get the latest error when reset flow
|
|
94093
|
+
const onOrientationChange = reactExports.useCallback((curOrientation)=>{
|
|
94094
|
+
setCurrentOrientation(curOrientation);
|
|
94095
|
+
if (!shouldResetFlowOnOrientationChange) {
|
|
94096
|
+
if (curOrientation === MODE.LANDSCAPE) {
|
|
94097
|
+
refVideo.current?.pause();
|
|
94098
|
+
} else {
|
|
94099
|
+
refVideo.current?.play();
|
|
94100
|
+
}
|
|
94101
|
+
} else {
|
|
94102
|
+
resetFlow();
|
|
94103
|
+
}
|
|
94104
|
+
}, [
|
|
94105
|
+
refVideo,
|
|
94106
|
+
resetFlow,
|
|
94107
|
+
shouldResetFlowOnOrientationChange
|
|
94108
|
+
]);
|
|
94109
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(OrientationDetection, {
|
|
94110
|
+
onOrientationChange: onOrientationChange,
|
|
94111
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsxs(Camera$1, {
|
|
94112
|
+
frontCamera: frontCamera,
|
|
94113
|
+
onVideoPlayed: handleVideoPlayed,
|
|
94114
|
+
onClose: onCloseCallback,
|
|
94115
|
+
flipHorizontal: flipVideoHorizontal ?? frontCamera,
|
|
94116
|
+
ref: refVideo,
|
|
94117
|
+
videoSettings: videoSettings$1,
|
|
94118
|
+
onError: onErrorCallback,
|
|
94119
|
+
scale: cameraScale,
|
|
94120
|
+
defaultCameraId: defaultCameraId,
|
|
94121
|
+
closeButton: CloseCameraButton || null,
|
|
94122
|
+
children: [
|
|
94123
|
+
!warmupDone && /*#__PURE__*/ jsxRuntimeExports.jsx(WarmupPopup, {}),
|
|
94124
|
+
videoPlayed ? /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
94125
|
+
children: [
|
|
94126
|
+
cropArea.current ? /*#__PURE__*/ jsxRuntimeExports.jsxs(CropAreaOverlayWrapper, {
|
|
94127
|
+
x: `${cropArea.current.x}px`,
|
|
94128
|
+
y: `${cropArea.current.y}px`,
|
|
94129
|
+
width: `${cropArea.current.width}px`,
|
|
94130
|
+
height: `${cropArea.current.height}px`,
|
|
94131
|
+
surroundStyle: cropArea.current.surroundStyle,
|
|
94132
|
+
children: [
|
|
94133
|
+
/*#__PURE__*/ jsxRuntimeExports.jsx(StyledCameraMark, {}),
|
|
94134
|
+
/*#__PURE__*/ jsxRuntimeExports.jsx(OverlayProgressCircle, {
|
|
94135
|
+
...progressCircleProps,
|
|
94136
|
+
progress: currentProgress,
|
|
94137
|
+
showErrorRing: !!faceDetectionError && getTheme('Selfie.progressCircle.showErrorRing')({
|
|
94138
|
+
theme
|
|
94139
|
+
})
|
|
94140
|
+
}),
|
|
94141
|
+
/*#__PURE__*/ jsxRuntimeExports.jsx(InstructionsOverlay, {
|
|
94142
|
+
children: renderDirectionIcon(directionIcon, directionIconAnimation)
|
|
94143
|
+
}),
|
|
94144
|
+
activeCapturing && /*#__PURE__*/ jsxRuntimeExports.jsx(CapturingOverlay, {})
|
|
94145
|
+
]
|
|
94146
|
+
}) : null,
|
|
94147
|
+
instructions ? /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
94148
|
+
children: [
|
|
94149
|
+
/*#__PURE__*/ jsxRuntimeExports.jsx(FaceVerificationInstructions, {
|
|
94150
|
+
top: yFaceVerificationStepsWrapper + 5,
|
|
94151
|
+
className: "instructions",
|
|
94152
|
+
children: instructions
|
|
94153
|
+
}),
|
|
94154
|
+
/*#__PURE__*/ jsxRuntimeExports.jsx(FaceVerificationStepsWrapper, {
|
|
94155
|
+
top: yFaceVerificationStepsWrapper + 35,
|
|
94156
|
+
children: steps.map((step, index)=>{
|
|
94157
|
+
const { name, image: { objUrl } } = step;
|
|
94158
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(StepItem, {
|
|
94159
|
+
active: curStepIndex >= index,
|
|
94160
|
+
className: "step-item",
|
|
94161
|
+
children: objUrl ? /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
|
|
94162
|
+
className: "image_preview",
|
|
94163
|
+
src: objUrl,
|
|
94164
|
+
alt: ""
|
|
94165
|
+
}) : /*#__PURE__*/ jsxRuntimeExports.jsx(SelfieStepImageHolder, {
|
|
94166
|
+
stepNumber: index + 1,
|
|
94167
|
+
type: name,
|
|
94168
|
+
theme: theme
|
|
94169
|
+
})
|
|
94170
|
+
}, name);
|
|
94171
|
+
})
|
|
94172
|
+
})
|
|
94173
|
+
]
|
|
94174
|
+
}) : null
|
|
94175
|
+
]
|
|
94176
|
+
}) : null,
|
|
94177
|
+
(showLoading || isLoading) && /*#__PURE__*/ jsxRuntimeExports.jsx(LoadingIcon$2, {
|
|
94178
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
|
|
94179
|
+
src: icLoading,
|
|
94180
|
+
alt: "",
|
|
94181
|
+
className: "spin"
|
|
94182
|
+
})
|
|
94183
|
+
}),
|
|
94184
|
+
remainingTime && /*#__PURE__*/ jsxRuntimeExports.jsx(CountdownTime, {
|
|
94185
|
+
top: yFaceVerificationStepsWrapper - 30,
|
|
94186
|
+
children: remainingTime
|
|
94187
|
+
}),
|
|
94188
|
+
typeof lastErrorMsg === 'string' ? /*#__PURE__*/ jsxRuntimeExports.jsx(SimpleFaceDetectionError, {
|
|
94189
|
+
top: yFaceDetectionError - 15,
|
|
94190
|
+
className: "face-detection-error",
|
|
94191
|
+
children: lastErrorMsg
|
|
94192
|
+
}) : null
|
|
94193
|
+
]
|
|
94194
|
+
})
|
|
94195
|
+
});
|
|
94196
|
+
}
|
|
94197
|
+
ActiveLivenessV1.propTypes = {
|
|
94198
|
+
apiCheck: PropTypes.bool,
|
|
94199
|
+
onLivenessDetectionDone: PropTypes.func,
|
|
94200
|
+
onClose: PropTypes.func,
|
|
94201
|
+
onError: PropTypes.func,
|
|
94202
|
+
onReset: PropTypes.func,
|
|
94203
|
+
captureFrameSettings: PropTypes.shape({}),
|
|
94204
|
+
onFramesCaptured: PropTypes.func,
|
|
94205
|
+
flipVideoHorizontal: PropTypes.bool,
|
|
94206
|
+
frontCamera: PropTypes.bool,
|
|
94207
|
+
isLoading: PropTypes.bool,
|
|
94208
|
+
customDirectionIcon: PropTypes.shape({}),
|
|
94209
|
+
customStepTimeConstraints: PropTypes.shape({}),
|
|
94210
|
+
onProcessing: PropTypes.func,
|
|
94211
|
+
customErrors: PropTypes.shape({}),
|
|
94212
|
+
apiCredentials: PropTypes.shape({
|
|
94213
|
+
accessKey: PropTypes.string,
|
|
94214
|
+
secretKey: PropTypes.string,
|
|
94215
|
+
apiUrl: PropTypes.string
|
|
94216
|
+
}),
|
|
94217
|
+
outputEncryptionSettings: PropTypes.shape({}),
|
|
94218
|
+
cameraScale: PropTypes.number,
|
|
94219
|
+
defaultCameraId: PropTypes.string,
|
|
94220
|
+
offsetFaceY: PropTypes.number,
|
|
94221
|
+
styledComponent: PropTypes.shape({
|
|
94222
|
+
CloseCameraButton: PropTypes.node
|
|
94223
|
+
}),
|
|
94224
|
+
serviceSettings: PropTypes.shape({})
|
|
94225
|
+
};
|
|
94226
|
+
ActiveLivenessV1.defaultProps = {
|
|
94227
|
+
apiCheck: false,
|
|
94228
|
+
onLivenessDetectionDone: null,
|
|
94229
|
+
onClose: null,
|
|
94230
|
+
onError: ()=>{},
|
|
94231
|
+
onReset: ()=>{},
|
|
94232
|
+
captureFrameSettings: {
|
|
94233
|
+
enable: false,
|
|
94234
|
+
framesIntervalTime: 180,
|
|
94235
|
+
framesBatchLength: 0
|
|
94236
|
+
},
|
|
94237
|
+
onFramesCaptured: ()=>{},
|
|
94238
|
+
flipVideoHorizontal: null,
|
|
94239
|
+
frontCamera: true,
|
|
94240
|
+
isLoading: false,
|
|
94241
|
+
customDirectionIcon: {
|
|
94242
|
+
[ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
|
|
94243
|
+
type: ra$1.FaceDirection.LEFT
|
|
94244
|
+
}),
|
|
94245
|
+
[ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
|
|
94246
|
+
type: ra$1.FaceDirection.RIGHT
|
|
94247
|
+
}),
|
|
94248
|
+
[ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
|
|
94249
|
+
type: ra$1.FaceDirection.UP
|
|
94250
|
+
}),
|
|
94251
|
+
[ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
|
|
94252
|
+
type: ra$1.FaceDirection.FRONTAL
|
|
94253
|
+
})
|
|
94254
|
+
},
|
|
94255
|
+
customStepTimeConstraints: {
|
|
94256
|
+
[ra$1.FaceDirection.UP]: {
|
|
94257
|
+
delayTime: 0
|
|
94258
|
+
},
|
|
94259
|
+
[ra$1.FaceDirection.LEFT]: {
|
|
94260
|
+
delayTime: 0
|
|
94261
|
+
},
|
|
94262
|
+
[ra$1.FaceDirection.RIGHT]: {
|
|
94263
|
+
delayTime: 0
|
|
94264
|
+
},
|
|
94265
|
+
[ra$1.FaceDirection.FRONTAL]: {
|
|
94266
|
+
delayTime: 2000
|
|
94267
|
+
}
|
|
94268
|
+
},
|
|
94269
|
+
onProcessing: ()=>{},
|
|
94270
|
+
customErrors: null,
|
|
94271
|
+
apiCredentials: {
|
|
94272
|
+
accessKey: '',
|
|
94273
|
+
secretKey: '',
|
|
94274
|
+
apiUrl: ''
|
|
94275
|
+
},
|
|
94276
|
+
outputEncryptionSettings: null,
|
|
94277
|
+
cameraScale: 1,
|
|
94278
|
+
defaultCameraId: undefined,
|
|
94279
|
+
offsetFaceY: 0,
|
|
94280
|
+
styledComponent: {
|
|
94281
|
+
CloseCameraButton: null
|
|
94282
|
+
},
|
|
94283
|
+
serviceSettings: {
|
|
94284
|
+
enableUploadFrames: true,
|
|
94285
|
+
enableUploadImages: true,
|
|
94286
|
+
enableVerifySanityPortrait: true,
|
|
94287
|
+
enableVerifySanityIDCard: true,
|
|
94288
|
+
enableVerifyFaceLiveness: true,
|
|
94289
|
+
enableDetectIDCardTampering: true,
|
|
94290
|
+
enableReadIDCardInfo: true
|
|
94291
|
+
}
|
|
94292
|
+
};
|
|
94293
|
+
|
|
94294
|
+
// To reduce the calculation for blazeface
|
|
94295
|
+
const videoSettings = libExports.isMobile ? {
|
|
94296
|
+
width: {
|
|
94297
|
+
ideal: 640
|
|
94298
|
+
}
|
|
94299
|
+
} : null;
|
|
94300
|
+
// eslint-disable-next-line react/require-default-props
|
|
94301
|
+
function PassiveLivenessOldV1(props) {
|
|
94302
|
+
const { apiCheck, onLivenessDetectionDone, captureFrameSettings, onFramesCaptured, frontCamera, flipVideoHorizontal, customDirectionIcon, customStepTimeConstraints, onProcessing, customErrors, apiCredentials, outputEncryptionSettings, cameraScale, defaultCameraId, passiveModeAuto, offsetFaceY, styledComponent, serviceSettings, onReset, isLoading } = props;
|
|
94303
|
+
const theme = nt$2();
|
|
94304
|
+
const { onErrorCallback, onCloseCallback } = useSDKCallback();
|
|
94305
|
+
const bgCameraMask = iH.useAsset('bg_camera_mask.png');
|
|
94306
|
+
const bgCameraMaskRed = iH.useAsset('bg_camera_mask_red.png');
|
|
94307
|
+
const icLoading = useThemeIcon('IDCapturing.loadingIcon.src', 'ic_loading.gif');
|
|
94308
|
+
const [uiSpacing, setUISpacing] = reactExports.useState({});
|
|
94309
|
+
const { yFaceDetectionError, yFaceVerificationStepsWrapper } = uiSpacing;
|
|
94310
|
+
const [remainingTime, setRemainingTime] = reactExports.useState('');
|
|
94311
|
+
const [currentOrientation, setCurrentOrientation] = reactExports.useState();
|
|
94312
|
+
const surroundStyle = reactExports.useMemo(()=>({
|
|
94313
|
+
backgroundColor: getTheme('Selfie.backgroundColor')({
|
|
94314
|
+
theme
|
|
94315
|
+
})
|
|
94316
|
+
}), [
|
|
94317
|
+
theme
|
|
94318
|
+
]);
|
|
94319
|
+
const cropAreaDimension = reactExports.useCallback(({ lostY, height, clientHeight })=>{
|
|
94320
|
+
const yFaceDetectionErrorNew = lostY + 25;
|
|
94321
|
+
const yCropAreaNew = yFaceDetectionErrorNew + 30;
|
|
94322
|
+
const yFaceVerificationStepsWrapperNew = yCropAreaNew + height + 20;
|
|
94323
|
+
setUISpacing({
|
|
94324
|
+
yFaceDetectionError: yFaceDetectionErrorNew,
|
|
94325
|
+
yFaceVerificationStepsWrapper: yFaceVerificationStepsWrapperNew
|
|
94326
|
+
});
|
|
94327
|
+
const topLimit = Math.floor(lostY);
|
|
94328
|
+
const botLimit = Math.floor(clientHeight - lostY);
|
|
94329
|
+
let y = Math.floor(yCropAreaNew); // floor the y value to avoid blur line on ios safari
|
|
94330
|
+
if (offsetFaceY !== 0 && (y + offsetFaceY < topLimit || y + offsetFaceY + height > botLimit)) {
|
|
94331
|
+
onErrorCallback({
|
|
94332
|
+
code: `offsetFaceY must be in [-${y - topLimit}, ${botLimit - height - y}]`
|
|
94333
|
+
});
|
|
94334
|
+
} else {
|
|
94335
|
+
y += offsetFaceY;
|
|
94336
|
+
}
|
|
94337
|
+
return {
|
|
94338
|
+
y
|
|
94339
|
+
};
|
|
94340
|
+
}, [
|
|
94341
|
+
offsetFaceY,
|
|
94342
|
+
onErrorCallback
|
|
94343
|
+
]);
|
|
94344
|
+
const { shouldResetFlowOnOrientationChange, countdownToTakePicture, cropArea, curStepIndex, faceDetectionError, resetFlow, handleTriggerPassiveMode, handleVideoPlayed, refVideo, showCountdown, steps, refIsReseting, videoPlayed, warmupDone, showCaptureButton, shouldShowCountdown, showLoading } = usePassiveLiveness({
|
|
94345
|
+
currentOrientation,
|
|
94346
|
+
apiCheck,
|
|
94347
|
+
bgCameraMask,
|
|
94348
|
+
bgCameraMaskRed,
|
|
94349
|
+
surroundStyle,
|
|
94350
|
+
onLivenessDetectionDone,
|
|
94351
|
+
onError: onErrorCallback,
|
|
94352
|
+
cropAreaDimension,
|
|
94353
|
+
customDirectionIcon,
|
|
94354
|
+
captureFrameSettings,
|
|
94355
|
+
onFramesCaptured,
|
|
94356
|
+
setRemainingTime,
|
|
94357
|
+
customStepTimeConstraints,
|
|
94358
|
+
onProcessing,
|
|
94359
|
+
customErrors,
|
|
94360
|
+
apiCredentials,
|
|
94361
|
+
outputEncryptionSettings,
|
|
94362
|
+
cameraScale,
|
|
94363
|
+
passiveModeAuto,
|
|
94364
|
+
serviceSettings,
|
|
94365
|
+
onReset
|
|
94366
|
+
});
|
|
94367
|
+
reactExports.useEffect(()=>{
|
|
94368
|
+
if (typeof steps[0]?.directionIcon === 'string') {
|
|
94369
|
+
Promise.all(steps.map((step)=>preloadImage(step.directionIcon)));
|
|
94370
|
+
}
|
|
94371
|
+
}, [
|
|
94372
|
+
steps
|
|
94373
|
+
]);
|
|
94374
|
+
const { CloseCameraButton } = styledComponent;
|
|
94375
|
+
const progressCircleProps = getProgressCircleProps(props, theme);
|
|
94376
|
+
const currentProgress = !refIsReseting.current ? curStepIndex / steps.length * 100 : 0;
|
|
94377
|
+
// for error text
|
|
94378
|
+
const { lang } = no$1.useSDKSettings();
|
|
94379
|
+
const timer = reactExports.useRef(0);
|
|
94380
|
+
const lastError = reactExports.useRef({});
|
|
94381
|
+
const duration = reactExports.useRef(ra$1.ErrorDuration.SHORT);
|
|
94382
|
+
const lastErrorMsg = reactExports.useMemo(()=>{
|
|
94383
|
+
const { msg, duration: errorDuration = ra$1.ErrorDuration.SHORT } = faceDetectionError || {};
|
|
94384
|
+
const errorMsg = msg?.[lang];
|
|
94385
|
+
if (Date.now() - timer.current >= duration.current) {
|
|
94386
|
+
timer.current = Date.now();
|
|
94387
|
+
duration.current = errorDuration;
|
|
94388
|
+
lastError.current = errorMsg;
|
|
94389
|
+
}
|
|
94390
|
+
return lastError.current;
|
|
94391
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
94392
|
+
}, [
|
|
94393
|
+
faceDetectionError,
|
|
94394
|
+
curStepIndex
|
|
94395
|
+
]); // curStepIndex is used to get the latest error when reset flow
|
|
94396
|
+
const onOrientationChange = reactExports.useCallback((curOrientation)=>{
|
|
94397
|
+
setCurrentOrientation(curOrientation);
|
|
94398
|
+
if (!shouldResetFlowOnOrientationChange) {
|
|
94399
|
+
if (curOrientation === MODE.LANDSCAPE) {
|
|
94400
|
+
refVideo.current?.pause();
|
|
94401
|
+
} else {
|
|
94402
|
+
refVideo.current?.play();
|
|
94403
|
+
}
|
|
94404
|
+
} else {
|
|
94405
|
+
resetFlow();
|
|
94406
|
+
}
|
|
94407
|
+
}, [
|
|
94408
|
+
refVideo,
|
|
94409
|
+
resetFlow,
|
|
94410
|
+
shouldResetFlowOnOrientationChange
|
|
94411
|
+
]);
|
|
94412
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(OrientationDetection, {
|
|
94413
|
+
onOrientationChange: onOrientationChange,
|
|
94414
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsxs(Camera$1, {
|
|
94415
|
+
frontCamera: frontCamera,
|
|
94416
|
+
onVideoPlayed: handleVideoPlayed,
|
|
94417
|
+
onClose: onCloseCallback,
|
|
94418
|
+
flipHorizontal: flipVideoHorizontal ?? frontCamera,
|
|
94419
|
+
ref: refVideo,
|
|
94420
|
+
videoSettings: videoSettings,
|
|
94421
|
+
onError: onErrorCallback,
|
|
94422
|
+
scale: cameraScale,
|
|
94423
|
+
defaultCameraId: defaultCameraId,
|
|
94424
|
+
closeButton: CloseCameraButton || null,
|
|
94425
|
+
children: [
|
|
94426
|
+
!warmupDone && /*#__PURE__*/ jsxRuntimeExports.jsx(WarmupPopup, {}),
|
|
94427
|
+
videoPlayed ? /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
94428
|
+
children: [
|
|
94429
|
+
typeof lastErrorMsg === 'string' ? /*#__PURE__*/ jsxRuntimeExports.jsx(SimpleFaceDetectionError, {
|
|
94430
|
+
top: yFaceDetectionError - 15,
|
|
94431
|
+
className: "face-detection-error",
|
|
94432
|
+
children: lastErrorMsg
|
|
94433
|
+
}) : null,
|
|
94434
|
+
cropArea.current ? /*#__PURE__*/ jsxRuntimeExports.jsxs(CropAreaOverlayWrapper, {
|
|
94435
|
+
x: `${cropArea.current.x}px`,
|
|
94436
|
+
y: `${cropArea.current.y}px`,
|
|
94437
|
+
width: `${cropArea.current.width}px`,
|
|
94438
|
+
height: `${cropArea.current.height}px`,
|
|
94439
|
+
surroundStyle: cropArea.current.surroundStyle,
|
|
94440
|
+
children: [
|
|
94441
|
+
/*#__PURE__*/ jsxRuntimeExports.jsx(StyledCameraMark, {}),
|
|
94442
|
+
/*#__PURE__*/ jsxRuntimeExports.jsx(OverlayProgressCircle, {
|
|
94443
|
+
...progressCircleProps,
|
|
94444
|
+
progress: currentProgress,
|
|
94445
|
+
showErrorRing: !!faceDetectionError && getTheme('Selfie.progressCircle.showErrorRing')({
|
|
94446
|
+
theme
|
|
94447
|
+
})
|
|
94448
|
+
}),
|
|
94449
|
+
shouldShowCountdown ? /*#__PURE__*/ jsxRuntimeExports.jsx(CountDownOverlay, {
|
|
94450
|
+
children: countdownToTakePicture
|
|
94451
|
+
}) : null,
|
|
94452
|
+
faceDetectionError && /*#__PURE__*/ jsxRuntimeExports.jsx(ErrorOverlay$1, {})
|
|
94453
|
+
]
|
|
94454
|
+
}) : null,
|
|
94455
|
+
remainingTime && /*#__PURE__*/ jsxRuntimeExports.jsx(CountdownTime, {
|
|
94456
|
+
top: yFaceVerificationStepsWrapper - 30,
|
|
94457
|
+
children: remainingTime
|
|
94458
|
+
}),
|
|
94459
|
+
showCaptureButton ? /*#__PURE__*/ jsxRuntimeExports.jsx(BottomButtonsOverlay, {
|
|
94460
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsx(Button$4, {
|
|
94461
|
+
onClick: handleTriggerPassiveMode,
|
|
94462
|
+
disabled: showCountdown,
|
|
94463
|
+
children: get(theme, 'Selfie.captureIcon.src') ? /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
|
|
94464
|
+
src: get(theme, 'Selfie.captureIcon.src'),
|
|
94465
|
+
alt: ""
|
|
94466
|
+
}) : /*#__PURE__*/ jsxRuntimeExports.jsx(CameraIcon, {
|
|
94467
|
+
fillColor: "rgba(193, 197, 204, 1)"
|
|
94468
|
+
})
|
|
94469
|
+
})
|
|
94470
|
+
}) : null
|
|
94471
|
+
]
|
|
94472
|
+
}) : null,
|
|
94473
|
+
(showLoading || isLoading) && /*#__PURE__*/ jsxRuntimeExports.jsx(LoadingIcon$2, {
|
|
94474
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
|
|
94475
|
+
src: icLoading,
|
|
94476
|
+
alt: ""
|
|
94477
|
+
})
|
|
94478
|
+
})
|
|
94479
|
+
]
|
|
94480
|
+
})
|
|
94481
|
+
});
|
|
94482
|
+
}
|
|
94483
|
+
PassiveLivenessOldV1.propTypes = {
|
|
94484
|
+
apiCheck: PropTypes.bool,
|
|
94485
|
+
mode: PropTypes.string,
|
|
94486
|
+
onLivenessDetectionDone: PropTypes.func,
|
|
94487
|
+
onClose: PropTypes.func,
|
|
94488
|
+
onError: PropTypes.func,
|
|
94489
|
+
onReset: PropTypes.func,
|
|
94490
|
+
captureFrameSettings: PropTypes.shape({}),
|
|
94491
|
+
onFramesCaptured: PropTypes.func,
|
|
94492
|
+
frontCamera: PropTypes.bool,
|
|
94493
|
+
isLoading: PropTypes.bool,
|
|
94494
|
+
flipVideoHorizontal: PropTypes.bool,
|
|
94495
|
+
customDirectionIcon: PropTypes.shape({}),
|
|
94496
|
+
customStepTimeConstraints: PropTypes.shape({}),
|
|
94497
|
+
onProcessing: PropTypes.func,
|
|
94498
|
+
customErrors: PropTypes.shape({}),
|
|
94499
|
+
apiCredentials: PropTypes.shape({
|
|
94500
|
+
accessKey: PropTypes.string,
|
|
94501
|
+
secretKey: PropTypes.string,
|
|
94502
|
+
apiUrl: PropTypes.string
|
|
94503
|
+
}),
|
|
94504
|
+
outputEncryptionSettings: PropTypes.shape({}),
|
|
94505
|
+
cameraScale: PropTypes.number,
|
|
94506
|
+
defaultCameraId: PropTypes.string,
|
|
94507
|
+
passiveModeAuto: PropTypes.bool,
|
|
94508
|
+
offsetFaceY: PropTypes.number,
|
|
94509
|
+
styledComponent: PropTypes.shape({
|
|
94510
|
+
CloseCameraButton: PropTypes.node
|
|
94511
|
+
}),
|
|
94512
|
+
serviceSettings: PropTypes.shape({})
|
|
94513
|
+
};
|
|
94514
|
+
PassiveLivenessOldV1.defaultProps = {
|
|
94515
|
+
apiCheck: false,
|
|
94516
|
+
mode: null,
|
|
94517
|
+
onLivenessDetectionDone: null,
|
|
94518
|
+
onClose: null,
|
|
94519
|
+
onError: ()=>{},
|
|
94520
|
+
onReset: ()=>{},
|
|
94521
|
+
captureFrameSettings: {
|
|
94522
|
+
enable: false,
|
|
94523
|
+
framesIntervalTime: 180,
|
|
94524
|
+
framesBatchLength: 0
|
|
94525
|
+
},
|
|
94526
|
+
onFramesCaptured: ()=>{},
|
|
94527
|
+
frontCamera: true,
|
|
94528
|
+
isLoading: false,
|
|
94529
|
+
flipVideoHorizontal: null,
|
|
94530
|
+
customDirectionIcon: {
|
|
94531
|
+
[ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
94532
|
+
type: ra$1.FaceDirection.LEFT
|
|
94533
|
+
}),
|
|
94534
|
+
[ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
94535
|
+
type: ra$1.FaceDirection.RIGHT
|
|
94536
|
+
}),
|
|
94537
|
+
[ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
94538
|
+
type: ra$1.FaceDirection.UP
|
|
94539
|
+
}),
|
|
94540
|
+
[ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
94541
|
+
type: ra$1.FaceDirection.FRONTAL
|
|
94542
|
+
})
|
|
94543
|
+
},
|
|
94544
|
+
customStepTimeConstraints: {
|
|
94545
|
+
[ra$1.FaceDirection.UP]: {
|
|
94546
|
+
delayTime: 0
|
|
94547
|
+
},
|
|
94548
|
+
[ra$1.FaceDirection.LEFT]: {
|
|
94549
|
+
delayTime: 0
|
|
94550
|
+
},
|
|
94551
|
+
[ra$1.FaceDirection.RIGHT]: {
|
|
94552
|
+
delayTime: 0
|
|
94553
|
+
},
|
|
94554
|
+
[ra$1.FaceDirection.FRONTAL]: {
|
|
94555
|
+
delayTime: 2000
|
|
94556
|
+
}
|
|
94557
|
+
},
|
|
94558
|
+
onProcessing: ()=>{},
|
|
94559
|
+
customErrors: null,
|
|
94560
|
+
apiCredentials: {
|
|
94561
|
+
accessKey: '',
|
|
94562
|
+
secretKey: '',
|
|
94563
|
+
apiUrl: ''
|
|
94564
|
+
},
|
|
94565
|
+
outputEncryptionSettings: null,
|
|
94566
|
+
cameraScale: 1,
|
|
94567
|
+
defaultCameraId: undefined,
|
|
94568
|
+
passiveModeAuto: false,
|
|
94569
|
+
offsetFaceY: 0,
|
|
94570
|
+
styledComponent: {
|
|
94571
|
+
CloseCameraButton: null
|
|
94572
|
+
},
|
|
94573
|
+
serviceSettings: {
|
|
94574
|
+
enableUploadFrames: true,
|
|
94575
|
+
enableUploadImages: true,
|
|
94576
|
+
enableVerifySanityPortrait: true,
|
|
94577
|
+
enableVerifySanityIDCard: true,
|
|
94578
|
+
enableVerifyFaceLiveness: true,
|
|
94579
|
+
enableDetectIDCardTampering: true,
|
|
94580
|
+
enableReadIDCardInfo: true
|
|
94581
|
+
}
|
|
94582
|
+
};
|
|
94583
|
+
|
|
93865
94584
|
const withClientSettings$1 = (Component)=>{
|
|
93866
94585
|
return function WrappedComponent(props) {
|
|
93867
94586
|
const { apiCheck, apiCredentials, serviceSettings, flowId, clientSettings } = props;
|
|
@@ -93877,16 +94596,20 @@
|
|
|
93877
94596
|
});
|
|
93878
94597
|
};
|
|
93879
94598
|
};
|
|
93880
|
-
const getLivenessModeComponent = (mode, CustomLivenessDetection)=>{
|
|
94599
|
+
const getLivenessModeComponent = (mode, CustomLivenessDetection, themeVersion)=>{
|
|
93881
94600
|
let LivenessDetectionComponent = ActiveLiveness;
|
|
93882
94601
|
if (mode === ra$1.Mode.ACTIVE) {
|
|
93883
|
-
|
|
94602
|
+
const DefaultActiveLiveness = themeVersion === 'v1' ? ActiveLivenessV1 : ActiveLiveness;
|
|
94603
|
+
LivenessDetectionComponent = CustomLivenessDetection?.ActiveLiveness ?? DefaultActiveLiveness;
|
|
93884
94604
|
}
|
|
93885
94605
|
if (mode === ra$1.Mode.PASSIVE_V2) {
|
|
93886
94606
|
LivenessDetectionComponent = CustomLivenessDetection?.PassiveLivenessV2 ?? PassiveLiveness;
|
|
93887
94607
|
}
|
|
93888
94608
|
if (mode === ra$1.Mode.PASSIVE) {
|
|
93889
|
-
|
|
94609
|
+
// PassiveLivenessOldV1 to not be confused with PassiveLivenessV2 (which is totally new mode)
|
|
94610
|
+
// PassiveLivenessOldV1 refers to PassiveLiveness with themeVersion = "v1"
|
|
94611
|
+
const DefaultPassiveLiveness = themeVersion === 'v1' ? PassiveLivenessOldV1 : PassiveLiveness$1;
|
|
94612
|
+
LivenessDetectionComponent = CustomLivenessDetection?.PassiveLiveness ?? DefaultPassiveLiveness;
|
|
93890
94613
|
}
|
|
93891
94614
|
if (typeof mode === 'string' && mode.startsWith('flash')) {
|
|
93892
94615
|
LivenessDetectionComponent = CustomLivenessDetection?.FlashLiveness ?? FlashLiveness;
|
|
@@ -93899,7 +94622,7 @@
|
|
|
93899
94622
|
}, livenessComponent: CustomLivenessDetection, customTheme = {}, customTexts, ...props } = livenessProps;
|
|
93900
94623
|
const { mode, flowId, onError: onErrorFromProp, onClose: onCloseFromProp, debug, onLivenessDetectionDone } = props;
|
|
93901
94624
|
const clientSettings = useClientSettings();
|
|
93902
|
-
const { billingSettings: clientBillingSettings, enableBilling } = no$1.useSDKSettings();
|
|
94625
|
+
const { billingSettings: clientBillingSettings, enableBilling, themeVersion } = no$1.useSDKSettings();
|
|
93903
94626
|
const billingSettingsFromSdkSettings = dD.getWebSetting(clientSettings, 'data.settings.sdk_settings.billing_settings.billing_config');
|
|
93904
94627
|
const billingUrl = dD.getWebSetting(clientSettings, 'data.settings.sdk_settings.billing_settings.url');
|
|
93905
94628
|
const { submitBilling } = gR({
|
|
@@ -93985,7 +94708,7 @@
|
|
|
93985
94708
|
billingInput,
|
|
93986
94709
|
onCloseFromProp
|
|
93987
94710
|
]);
|
|
93988
|
-
const LivenessDetectionComponent = getLivenessModeComponent(mode, CustomLivenessDetection);
|
|
94711
|
+
const LivenessDetectionComponent = getLivenessModeComponent(mode, CustomLivenessDetection, themeVersion);
|
|
93989
94712
|
return /*#__PURE__*/ jsxRuntimeExports.jsx(DebugProvider, {
|
|
93990
94713
|
debug: debug,
|
|
93991
94714
|
children: /*#__PURE__*/ jsxRuntimeExports.jsx(SDKCallbackProvider, {
|
|
@@ -112749,7 +113472,7 @@
|
|
|
112749
113472
|
};
|
|
112750
113473
|
};
|
|
112751
113474
|
|
|
112752
|
-
const defaultAssetRoot = "https://vision-cdn.trustingsocial.com/tvweb-sdk.nbcci/0.0.0-beta.20251215-
|
|
113475
|
+
const defaultAssetRoot = "https://vision-cdn.trustingsocial.com/tvweb-sdk.nbcci/0.0.0-beta.20251215-170414/assets";
|
|
112753
113476
|
class TVWebSDK extends gU {
|
|
112754
113477
|
constructor(props){
|
|
112755
113478
|
super({
|