@tsocial/tvweb-sdk.msb 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.cjs.min.js +232 -230
- package/build/tvweb-sdk.esm.min.js +232 -230
- package/build/tvweb-sdk.msb.standalone.js +817 -94
- package/build/tvweb-sdk.msb.standalone.min.js +231 -229
- 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
|
});
|
|
@@ -90589,7 +90608,7 @@
|
|
|
90589
90608
|
}
|
|
90590
90609
|
};
|
|
90591
90610
|
|
|
90592
|
-
const videoSettings$
|
|
90611
|
+
const videoSettings$7 = libExports.isMobile ? {
|
|
90593
90612
|
// aspectRatio: 16 / 9,
|
|
90594
90613
|
width: {
|
|
90595
90614
|
ideal: 640
|
|
@@ -91368,7 +91387,7 @@
|
|
|
91368
91387
|
flipHorizontal: frontCamera,
|
|
91369
91388
|
ref: videoRef,
|
|
91370
91389
|
onError: onErrorCallback,
|
|
91371
|
-
videoSettings: videoSettings$
|
|
91390
|
+
videoSettings: videoSettings$7,
|
|
91372
91391
|
closeButton: /*#__PURE__*/ jsxRuntimeExports.jsx(CloseIcon, {}),
|
|
91373
91392
|
children: /*#__PURE__*/ jsxRuntimeExports.jsxs(WarmUpOverlay, {
|
|
91374
91393
|
overlay: !warmupDone || !isPlaying,
|
|
@@ -91930,11 +91949,11 @@
|
|
|
91930
91949
|
extraConfig: null
|
|
91931
91950
|
};
|
|
91932
91951
|
|
|
91933
|
-
const DirectionalIcon = dt$1.img`
|
|
91952
|
+
const DirectionalIcon$1 = dt$1.img`
|
|
91934
91953
|
width: ${({ width })=>width};
|
|
91935
91954
|
`;
|
|
91936
91955
|
// eslint-disable-next-line react/require-default-props
|
|
91937
|
-
function DirectionIcon$
|
|
91956
|
+
function DirectionIcon$2({ type }) {
|
|
91938
91957
|
const theme = nt$2();
|
|
91939
91958
|
// default icons and widths based on version
|
|
91940
91959
|
const iconDirection = useThemeIcon(`Selfie.Active.directionIcon.${type}`, `${type}_arrow.gif`);
|
|
@@ -91951,7 +91970,7 @@
|
|
|
91951
91970
|
if (type === ra$1.FaceDirection.FRONTAL) {
|
|
91952
91971
|
// For frontal direction, use the SVG icon if available
|
|
91953
91972
|
if (frontalIcon) {
|
|
91954
|
-
return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon, {
|
|
91973
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon$1, {
|
|
91955
91974
|
src: frontalIcon,
|
|
91956
91975
|
width: iconWidth,
|
|
91957
91976
|
alt: ""
|
|
@@ -91959,20 +91978,20 @@
|
|
|
91959
91978
|
}
|
|
91960
91979
|
}
|
|
91961
91980
|
if (directionIconSrc && directionIconSrc !== null) {
|
|
91962
|
-
return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon, {
|
|
91981
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon$1, {
|
|
91963
91982
|
src: get(theme, `Selfie.Active.directionIcon.${type}`),
|
|
91964
91983
|
width: iconWidth,
|
|
91965
91984
|
alt: ""
|
|
91966
91985
|
});
|
|
91967
91986
|
}
|
|
91968
91987
|
// fallback to default icons and width
|
|
91969
|
-
return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon, {
|
|
91988
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon$1, {
|
|
91970
91989
|
src: iconDirection,
|
|
91971
91990
|
alt: "",
|
|
91972
91991
|
width: iconWidth
|
|
91973
91992
|
});
|
|
91974
91993
|
}
|
|
91975
|
-
DirectionIcon$
|
|
91994
|
+
DirectionIcon$2.propTypes = {
|
|
91976
91995
|
type: PropTypes.oneOf([
|
|
91977
91996
|
ra$1.FaceDirection.LEFT,
|
|
91978
91997
|
ra$1.FaceDirection.RIGHT,
|
|
@@ -91980,12 +91999,12 @@
|
|
|
91980
91999
|
ra$1.FaceDirection.FRONTAL
|
|
91981
92000
|
])
|
|
91982
92001
|
};
|
|
91983
|
-
DirectionIcon$
|
|
92002
|
+
DirectionIcon$2.defaultProps = {
|
|
91984
92003
|
type: ra$1.FaceDirection.LEFT
|
|
91985
92004
|
};
|
|
91986
92005
|
|
|
91987
92006
|
// To reduce the calculation for blazeface
|
|
91988
|
-
const videoSettings$
|
|
92007
|
+
const videoSettings$6 = libExports.isMobile ? {
|
|
91989
92008
|
width: {
|
|
91990
92009
|
ideal: 640
|
|
91991
92010
|
}
|
|
@@ -92110,7 +92129,7 @@
|
|
|
92110
92129
|
onClose: onCloseCallback,
|
|
92111
92130
|
flipHorizontal: flipVideoHorizontal ?? frontCamera,
|
|
92112
92131
|
ref: refVideo,
|
|
92113
|
-
videoSettings: videoSettings$
|
|
92132
|
+
videoSettings: videoSettings$6,
|
|
92114
92133
|
onError: onErrorCallback,
|
|
92115
92134
|
scale: cameraScale,
|
|
92116
92135
|
defaultCameraId: defaultCameraId,
|
|
@@ -92221,16 +92240,16 @@
|
|
|
92221
92240
|
isLoading: false,
|
|
92222
92241
|
flipVideoHorizontal: null,
|
|
92223
92242
|
customDirectionIcon: {
|
|
92224
|
-
[ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$
|
|
92243
|
+
[ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$2, {
|
|
92225
92244
|
type: ra$1.FaceDirection.LEFT
|
|
92226
92245
|
}),
|
|
92227
|
-
[ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$
|
|
92246
|
+
[ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$2, {
|
|
92228
92247
|
type: ra$1.FaceDirection.RIGHT
|
|
92229
92248
|
}),
|
|
92230
|
-
[ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$
|
|
92249
|
+
[ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$2, {
|
|
92231
92250
|
type: ra$1.FaceDirection.UP
|
|
92232
92251
|
}),
|
|
92233
|
-
[ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$
|
|
92252
|
+
[ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$2, {
|
|
92234
92253
|
type: ra$1.FaceDirection.FRONTAL
|
|
92235
92254
|
})
|
|
92236
92255
|
},
|
|
@@ -92608,7 +92627,7 @@
|
|
|
92608
92627
|
});
|
|
92609
92628
|
}
|
|
92610
92629
|
|
|
92611
|
-
const videoSettings$
|
|
92630
|
+
const videoSettings$5 = libExports.isMobile ? {
|
|
92612
92631
|
// aspectRatio: 16 / 9,
|
|
92613
92632
|
width: {
|
|
92614
92633
|
ideal: 640
|
|
@@ -93141,7 +93160,7 @@
|
|
|
93141
93160
|
flipHorizontal: frontCamera,
|
|
93142
93161
|
ref: videoRef,
|
|
93143
93162
|
onError: onErrorCallback,
|
|
93144
|
-
videoSettings: videoSettings$
|
|
93163
|
+
videoSettings: videoSettings$5,
|
|
93145
93164
|
closeButton: /*#__PURE__*/ jsxRuntimeExports.jsx(CloseIcon, {}),
|
|
93146
93165
|
children: /*#__PURE__*/ jsxRuntimeExports.jsxs(WarmUpOverlay, {
|
|
93147
93166
|
overlay: !warmupDone || !isPlaying,
|
|
@@ -93483,13 +93502,13 @@
|
|
|
93483
93502
|
};
|
|
93484
93503
|
|
|
93485
93504
|
// To reduce the calculation for blazeface
|
|
93486
|
-
const videoSettings$
|
|
93505
|
+
const videoSettings$4 = libExports.isMobile ? {
|
|
93487
93506
|
width: {
|
|
93488
93507
|
ideal: 640
|
|
93489
93508
|
}
|
|
93490
93509
|
} : null;
|
|
93491
93510
|
// eslint-disable-next-line react/prop-types, consistent-return
|
|
93492
|
-
const SelfieStepImageHolder = ({ stepNumber, type, theme })=>{
|
|
93511
|
+
const SelfieStepImageHolder$1 = ({ stepNumber, type, theme })=>{
|
|
93493
93512
|
const imageHolderIcon = useDefaultThemeIcon(`instruction_${type}.svg`);
|
|
93494
93513
|
// prioritize custom theme icons
|
|
93495
93514
|
const customHolderSrc = get(theme, `Selfie.Active.imageHolder.${type}`);
|
|
@@ -93514,7 +93533,7 @@
|
|
|
93514
93533
|
alt: ""
|
|
93515
93534
|
});
|
|
93516
93535
|
};
|
|
93517
|
-
function renderDirectionIcon(directionIcon, directionIconAnimation) {
|
|
93536
|
+
function renderDirectionIcon$1(directionIcon, directionIconAnimation) {
|
|
93518
93537
|
if (!directionIcon) return null;
|
|
93519
93538
|
if (typeof directionIcon === 'string') {
|
|
93520
93539
|
return /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
|
|
@@ -93659,7 +93678,7 @@
|
|
|
93659
93678
|
onClose: onCloseCallback,
|
|
93660
93679
|
flipHorizontal: flipVideoHorizontal ?? frontCamera,
|
|
93661
93680
|
ref: refVideo,
|
|
93662
|
-
videoSettings: videoSettings$
|
|
93681
|
+
videoSettings: videoSettings$4,
|
|
93663
93682
|
onError: onErrorCallback,
|
|
93664
93683
|
scale: cameraScale,
|
|
93665
93684
|
defaultCameraId: defaultCameraId,
|
|
@@ -93684,7 +93703,7 @@
|
|
|
93684
93703
|
showErrorRing: !!faceDetectionError
|
|
93685
93704
|
}),
|
|
93686
93705
|
/*#__PURE__*/ jsxRuntimeExports.jsx(InstructionsOverlay$2, {
|
|
93687
|
-
children: renderDirectionIcon(directionIcon, directionIconAnimation)
|
|
93706
|
+
children: renderDirectionIcon$1(directionIcon, directionIconAnimation)
|
|
93688
93707
|
}),
|
|
93689
93708
|
activeCapturing && /*#__PURE__*/ jsxRuntimeExports.jsx(CapturingOverlay$1, {})
|
|
93690
93709
|
]
|
|
@@ -93707,7 +93726,7 @@
|
|
|
93707
93726
|
className: "image_preview",
|
|
93708
93727
|
src: objUrl,
|
|
93709
93728
|
alt: ""
|
|
93710
|
-
}) : /*#__PURE__*/ jsxRuntimeExports.jsx(SelfieStepImageHolder, {
|
|
93729
|
+
}) : /*#__PURE__*/ jsxRuntimeExports.jsx(SelfieStepImageHolder$1, {
|
|
93711
93730
|
stepNumber: index + 1,
|
|
93712
93731
|
type: name,
|
|
93713
93732
|
theme: theme
|
|
@@ -93798,16 +93817,16 @@
|
|
|
93798
93817
|
frontCamera: true,
|
|
93799
93818
|
isLoading: false,
|
|
93800
93819
|
customDirectionIcon: {
|
|
93801
|
-
[ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$
|
|
93820
|
+
[ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$2, {
|
|
93802
93821
|
type: ra$1.FaceDirection.LEFT
|
|
93803
93822
|
}),
|
|
93804
|
-
[ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$
|
|
93823
|
+
[ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$2, {
|
|
93805
93824
|
type: ra$1.FaceDirection.RIGHT
|
|
93806
93825
|
}),
|
|
93807
|
-
[ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$
|
|
93826
|
+
[ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$2, {
|
|
93808
93827
|
type: ra$1.FaceDirection.UP
|
|
93809
93828
|
}),
|
|
93810
|
-
[ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$
|
|
93829
|
+
[ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$2, {
|
|
93811
93830
|
type: ra$1.FaceDirection.FRONTAL
|
|
93812
93831
|
})
|
|
93813
93832
|
},
|
|
@@ -93935,6 +93954,706 @@
|
|
|
93935
93954
|
};
|
|
93936
93955
|
const useWrapIndicator = ()=>reactExports.useContext(WrapIndicatorContext);
|
|
93937
93956
|
|
|
93957
|
+
const DirectionalIcon = dt$1.img`
|
|
93958
|
+
width: ${({ width })=>width};
|
|
93959
|
+
`;
|
|
93960
|
+
// eslint-disable-next-line react/require-default-props
|
|
93961
|
+
function DirectionIcon$1({ type }) {
|
|
93962
|
+
const theme = nt$2();
|
|
93963
|
+
// default icons and widths based on version
|
|
93964
|
+
const iconDirection = useThemeIcon(`Selfie.Active.directionIcon.${type}`, `${type}_arrow.gif`);
|
|
93965
|
+
const iconWidth = getTheme(`Selfie.Active.directionIcon.${type}Width`)({
|
|
93966
|
+
theme
|
|
93967
|
+
});
|
|
93968
|
+
// prioritize custom theme icons
|
|
93969
|
+
const directionIconSrc = get(theme, `Selfie.Active.directionIcon.${type}`);
|
|
93970
|
+
if (directionIconSrc === null) {
|
|
93971
|
+
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
93972
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
|
|
93973
|
+
}
|
|
93974
|
+
if (directionIconSrc && directionIconSrc !== null) {
|
|
93975
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon, {
|
|
93976
|
+
src: get(theme, `Selfie.Active.directionIcon.${type}`),
|
|
93977
|
+
width: iconWidth,
|
|
93978
|
+
alt: ""
|
|
93979
|
+
});
|
|
93980
|
+
}
|
|
93981
|
+
// fallback to default icons and width
|
|
93982
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon, {
|
|
93983
|
+
src: iconDirection,
|
|
93984
|
+
alt: "",
|
|
93985
|
+
width: iconWidth
|
|
93986
|
+
});
|
|
93987
|
+
}
|
|
93988
|
+
DirectionIcon$1.propTypes = {
|
|
93989
|
+
type: PropTypes.oneOf([
|
|
93990
|
+
ra$1.FaceDirection.LEFT,
|
|
93991
|
+
ra$1.FaceDirection.RIGHT,
|
|
93992
|
+
ra$1.FaceDirection.UP,
|
|
93993
|
+
ra$1.FaceDirection.FRONTAL
|
|
93994
|
+
])
|
|
93995
|
+
};
|
|
93996
|
+
DirectionIcon$1.defaultProps = {
|
|
93997
|
+
type: ra$1.FaceDirection.LEFT
|
|
93998
|
+
};
|
|
93999
|
+
|
|
94000
|
+
// To reduce the calculation for blazeface
|
|
94001
|
+
const videoSettings$3 = libExports.isMobile ? {
|
|
94002
|
+
width: {
|
|
94003
|
+
ideal: 640
|
|
94004
|
+
}
|
|
94005
|
+
} : null;
|
|
94006
|
+
// eslint-disable-next-line react/prop-types, consistent-return
|
|
94007
|
+
const SelfieStepImageHolder = ({ stepNumber, type, theme })=>{
|
|
94008
|
+
const imageHolderIcon = useDefaultThemeIcon(`instruction_${type}.svg`);
|
|
94009
|
+
// prioritize custom theme icons
|
|
94010
|
+
const customHolderSrc = get(theme, `Selfie.Active.imageHolder.${type}`);
|
|
94011
|
+
if (customHolderSrc === null) {
|
|
94012
|
+
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
94013
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
|
|
94014
|
+
}
|
|
94015
|
+
if (typeof customHolderSrc === 'string' && customHolderSrc !== '') {
|
|
94016
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
|
|
94017
|
+
src: customHolderSrc,
|
|
94018
|
+
alt: ""
|
|
94019
|
+
});
|
|
94020
|
+
}
|
|
94021
|
+
// v1: use step number
|
|
94022
|
+
if (get(theme, 'themeVersion') === 'v1') {
|
|
94023
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx("span", {
|
|
94024
|
+
children: stepNumber
|
|
94025
|
+
});
|
|
94026
|
+
}
|
|
94027
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
|
|
94028
|
+
src: imageHolderIcon,
|
|
94029
|
+
alt: ""
|
|
94030
|
+
});
|
|
94031
|
+
};
|
|
94032
|
+
function renderDirectionIcon(directionIcon, directionIconAnimation) {
|
|
94033
|
+
if (!directionIcon) return null;
|
|
94034
|
+
if (typeof directionIcon === 'string') {
|
|
94035
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
|
|
94036
|
+
className: directionIconAnimation,
|
|
94037
|
+
src: directionIcon,
|
|
94038
|
+
alt: "",
|
|
94039
|
+
style: {
|
|
94040
|
+
maxWidth: '98px',
|
|
94041
|
+
maxHeight: '98px',
|
|
94042
|
+
marginBottom: '25px'
|
|
94043
|
+
}
|
|
94044
|
+
});
|
|
94045
|
+
}
|
|
94046
|
+
return directionIcon;
|
|
94047
|
+
}
|
|
94048
|
+
// eslint-disable-next-line react/require-default-props
|
|
94049
|
+
function ActiveLivenessV1(props) {
|
|
94050
|
+
const { apiCheck, onLivenessDetectionDone, captureFrameSettings, onFramesCaptured, frontCamera, flipVideoHorizontal, customDirectionIcon, customStepTimeConstraints, onProcessing, customErrors, apiCredentials, outputEncryptionSettings, cameraScale, defaultCameraId, offsetFaceY, styledComponent, isLoading, serviceSettings, onReset } = props;
|
|
94051
|
+
const theme = nt$2();
|
|
94052
|
+
const { onErrorCallback, onCloseCallback } = useSDKCallback();
|
|
94053
|
+
const bgCameraMask = iH.useAsset('bg_camera_mask.png');
|
|
94054
|
+
const bgCameraMaskRed = iH.useAsset('bg_camera_mask_red.png');
|
|
94055
|
+
const icLoading = useThemeIcon('IDCapturing.loadingIcon.src', 'ic_loading.gif');
|
|
94056
|
+
const [uiSpacing, setUISpacing] = reactExports.useState({});
|
|
94057
|
+
const { yFaceVerificationStepsWrapper, yFaceDetectionError } = uiSpacing;
|
|
94058
|
+
const [remainingTime, setRemainingTime] = reactExports.useState('');
|
|
94059
|
+
const [currentOrientation, setCurrentOrientation] = reactExports.useState();
|
|
94060
|
+
const surroundStyle = reactExports.useMemo(()=>({
|
|
94061
|
+
backgroundColor: getTheme('Selfie.backgroundColor')({
|
|
94062
|
+
theme
|
|
94063
|
+
})
|
|
94064
|
+
}), [
|
|
94065
|
+
theme
|
|
94066
|
+
]);
|
|
94067
|
+
// preload icons
|
|
94068
|
+
usePreloadThemeAsset(get(theme, 'themeVersion'), 'up_arrow.gif');
|
|
94069
|
+
usePreloadThemeAsset(get(theme, 'themeVersion'), 'left_arrow.gif');
|
|
94070
|
+
usePreloadThemeAsset(get(theme, 'themeVersion'), 'right_arrow.gif');
|
|
94071
|
+
usePreloadThemeAsset(get(theme, 'themeVersion'), 'frontal_arrow.gif');
|
|
94072
|
+
usePreloadThemeAsset(get(theme, 'themeVersion'), 'instruction_up.svg');
|
|
94073
|
+
usePreloadThemeAsset(get(theme, 'themeVersion'), 'instruction_left.svg');
|
|
94074
|
+
usePreloadThemeAsset(get(theme, 'themeVersion'), 'instruction_right.svg');
|
|
94075
|
+
usePreloadThemeAsset(get(theme, 'themeVersion'), 'instruction_frontal.svg');
|
|
94076
|
+
const cropAreaDimension = reactExports.useCallback(({ clientHeight, videoAreaWidth, videoAreaHeight, lostX, lostY })=>{
|
|
94077
|
+
let width;
|
|
94078
|
+
let height;
|
|
94079
|
+
if (libExports.isMobile) {
|
|
94080
|
+
width = videoAreaWidth;
|
|
94081
|
+
height = width;
|
|
94082
|
+
} else {
|
|
94083
|
+
height = videoAreaHeight - 200;
|
|
94084
|
+
width = height;
|
|
94085
|
+
}
|
|
94086
|
+
const x = Math.floor((videoAreaWidth - width) / 2) + lostX;
|
|
94087
|
+
let y = 5 + lostY;
|
|
94088
|
+
const yFaceDetectionErrorNew = lostY + 25;
|
|
94089
|
+
const yCropAreaNew = yFaceDetectionErrorNew + 30;
|
|
94090
|
+
const yFaceVerificationStepsWrapperNew = yCropAreaNew + height + 20;
|
|
94091
|
+
setUISpacing({
|
|
94092
|
+
yFaceDetectionError: yFaceDetectionErrorNew,
|
|
94093
|
+
yFaceVerificationStepsWrapper: yFaceVerificationStepsWrapperNew
|
|
94094
|
+
});
|
|
94095
|
+
const topLimit = Math.floor(lostY);
|
|
94096
|
+
const botLimit = Math.floor(clientHeight - lostY);
|
|
94097
|
+
y = Math.floor(yCropAreaNew); // floor the y value to avoid blur line on ios safari
|
|
94098
|
+
if (offsetFaceY !== 0 && (y + offsetFaceY < topLimit || y + offsetFaceY + height > botLimit)) {
|
|
94099
|
+
onErrorCallback({
|
|
94100
|
+
code: `offsetFaceY must be in [-${y - topLimit}, ${botLimit - height - y}]`
|
|
94101
|
+
});
|
|
94102
|
+
} else {
|
|
94103
|
+
y += offsetFaceY;
|
|
94104
|
+
}
|
|
94105
|
+
return {
|
|
94106
|
+
x,
|
|
94107
|
+
y,
|
|
94108
|
+
width,
|
|
94109
|
+
height
|
|
94110
|
+
};
|
|
94111
|
+
}, [
|
|
94112
|
+
offsetFaceY,
|
|
94113
|
+
onErrorCallback
|
|
94114
|
+
]);
|
|
94115
|
+
const { shouldResetFlowOnOrientationChange, cropArea, curStepIndex, directionIcon, directionIconAnimation, faceDetectionError, resetFlow, handleVideoPlayed, instructions, refVideo, refIsReseting, steps, videoPlayed, activeCapturing, warmupDone, showLoading } = useActiveLiveness$1({
|
|
94116
|
+
currentOrientation,
|
|
94117
|
+
apiCheck,
|
|
94118
|
+
bgCameraMask,
|
|
94119
|
+
bgCameraMaskRed,
|
|
94120
|
+
surroundStyle,
|
|
94121
|
+
onLivenessDetectionDone,
|
|
94122
|
+
onError: onErrorCallback,
|
|
94123
|
+
cropAreaDimension,
|
|
94124
|
+
customDirectionIcon,
|
|
94125
|
+
captureFrameSettings,
|
|
94126
|
+
onFramesCaptured,
|
|
94127
|
+
setRemainingTime,
|
|
94128
|
+
customStepTimeConstraints,
|
|
94129
|
+
onProcessing,
|
|
94130
|
+
customErrors,
|
|
94131
|
+
apiCredentials,
|
|
94132
|
+
outputEncryptionSettings,
|
|
94133
|
+
cameraScale,
|
|
94134
|
+
serviceSettings,
|
|
94135
|
+
onReset
|
|
94136
|
+
});
|
|
94137
|
+
reactExports.useEffect(()=>{
|
|
94138
|
+
if (typeof steps[0]?.directionIcon === 'string') {
|
|
94139
|
+
Promise.all(steps.map((step)=>preloadImage(step.directionIcon)));
|
|
94140
|
+
}
|
|
94141
|
+
}, [
|
|
94142
|
+
steps
|
|
94143
|
+
]);
|
|
94144
|
+
const { CloseCameraButton } = styledComponent;
|
|
94145
|
+
const progressCircleProps = getProgressCircleProps(props, theme);
|
|
94146
|
+
const currentProgress = !refIsReseting.current ? curStepIndex / steps.length * 100 : 0;
|
|
94147
|
+
// for error text
|
|
94148
|
+
const { lang } = no$1.useSDKSettings();
|
|
94149
|
+
const timer = reactExports.useRef(0);
|
|
94150
|
+
const lastError = reactExports.useRef({});
|
|
94151
|
+
const duration = reactExports.useRef(ra$1.ErrorDuration.SHORT);
|
|
94152
|
+
const lastErrorMsg = reactExports.useMemo(()=>{
|
|
94153
|
+
const { msg, duration: errorDuration = ra$1.ErrorDuration.SHORT } = faceDetectionError || {};
|
|
94154
|
+
const errorMsg = msg?.[lang];
|
|
94155
|
+
if (Date.now() - timer.current >= duration.current) {
|
|
94156
|
+
timer.current = Date.now();
|
|
94157
|
+
duration.current = errorDuration;
|
|
94158
|
+
lastError.current = errorMsg;
|
|
94159
|
+
}
|
|
94160
|
+
return lastError.current;
|
|
94161
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
94162
|
+
}, [
|
|
94163
|
+
faceDetectionError,
|
|
94164
|
+
curStepIndex
|
|
94165
|
+
]); // curStepIndex is used to get the latest error when reset flow
|
|
94166
|
+
const onOrientationChange = reactExports.useCallback((curOrientation)=>{
|
|
94167
|
+
setCurrentOrientation(curOrientation);
|
|
94168
|
+
if (!shouldResetFlowOnOrientationChange) {
|
|
94169
|
+
if (curOrientation === MODE.LANDSCAPE) {
|
|
94170
|
+
refVideo.current?.pause();
|
|
94171
|
+
} else {
|
|
94172
|
+
refVideo.current?.play();
|
|
94173
|
+
}
|
|
94174
|
+
} else {
|
|
94175
|
+
resetFlow();
|
|
94176
|
+
}
|
|
94177
|
+
}, [
|
|
94178
|
+
refVideo,
|
|
94179
|
+
resetFlow,
|
|
94180
|
+
shouldResetFlowOnOrientationChange
|
|
94181
|
+
]);
|
|
94182
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(OrientationDetection, {
|
|
94183
|
+
onOrientationChange: onOrientationChange,
|
|
94184
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsxs(Camera$1, {
|
|
94185
|
+
frontCamera: frontCamera,
|
|
94186
|
+
onVideoPlayed: handleVideoPlayed,
|
|
94187
|
+
onClose: onCloseCallback,
|
|
94188
|
+
flipHorizontal: flipVideoHorizontal ?? frontCamera,
|
|
94189
|
+
ref: refVideo,
|
|
94190
|
+
videoSettings: videoSettings$3,
|
|
94191
|
+
onError: onErrorCallback,
|
|
94192
|
+
scale: cameraScale,
|
|
94193
|
+
defaultCameraId: defaultCameraId,
|
|
94194
|
+
closeButton: CloseCameraButton || null,
|
|
94195
|
+
children: [
|
|
94196
|
+
!warmupDone && /*#__PURE__*/ jsxRuntimeExports.jsx(WarmupPopup, {}),
|
|
94197
|
+
videoPlayed ? /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
94198
|
+
children: [
|
|
94199
|
+
cropArea.current ? /*#__PURE__*/ jsxRuntimeExports.jsxs(CropAreaOverlayWrapper, {
|
|
94200
|
+
x: `${cropArea.current.x}px`,
|
|
94201
|
+
y: `${cropArea.current.y}px`,
|
|
94202
|
+
width: `${cropArea.current.width}px`,
|
|
94203
|
+
height: `${cropArea.current.height}px`,
|
|
94204
|
+
surroundStyle: cropArea.current.surroundStyle,
|
|
94205
|
+
children: [
|
|
94206
|
+
/*#__PURE__*/ jsxRuntimeExports.jsx(StyledCameraMark$2, {}),
|
|
94207
|
+
/*#__PURE__*/ jsxRuntimeExports.jsx(OverlayProgressCircle$2, {
|
|
94208
|
+
...progressCircleProps,
|
|
94209
|
+
progress: currentProgress,
|
|
94210
|
+
showErrorRing: !!faceDetectionError && getTheme('Selfie.progressCircle.showErrorRing')({
|
|
94211
|
+
theme
|
|
94212
|
+
})
|
|
94213
|
+
}),
|
|
94214
|
+
/*#__PURE__*/ jsxRuntimeExports.jsx(InstructionsOverlay$2, {
|
|
94215
|
+
children: renderDirectionIcon(directionIcon, directionIconAnimation)
|
|
94216
|
+
}),
|
|
94217
|
+
activeCapturing && /*#__PURE__*/ jsxRuntimeExports.jsx(CapturingOverlay$1, {})
|
|
94218
|
+
]
|
|
94219
|
+
}) : null,
|
|
94220
|
+
instructions ? /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
94221
|
+
children: [
|
|
94222
|
+
/*#__PURE__*/ jsxRuntimeExports.jsx(FaceVerificationInstructions$1, {
|
|
94223
|
+
top: yFaceVerificationStepsWrapper + 5,
|
|
94224
|
+
className: "instructions",
|
|
94225
|
+
children: instructions
|
|
94226
|
+
}),
|
|
94227
|
+
/*#__PURE__*/ jsxRuntimeExports.jsx(FaceVerificationStepsWrapper$2, {
|
|
94228
|
+
top: yFaceVerificationStepsWrapper + 35,
|
|
94229
|
+
children: steps.map((step, index)=>{
|
|
94230
|
+
const { name, image: { objUrl } } = step;
|
|
94231
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(StepItem$2, {
|
|
94232
|
+
active: curStepIndex >= index,
|
|
94233
|
+
className: "step-item",
|
|
94234
|
+
children: objUrl ? /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
|
|
94235
|
+
className: "image_preview",
|
|
94236
|
+
src: objUrl,
|
|
94237
|
+
alt: ""
|
|
94238
|
+
}) : /*#__PURE__*/ jsxRuntimeExports.jsx(SelfieStepImageHolder, {
|
|
94239
|
+
stepNumber: index + 1,
|
|
94240
|
+
type: name,
|
|
94241
|
+
theme: theme
|
|
94242
|
+
})
|
|
94243
|
+
}, name);
|
|
94244
|
+
})
|
|
94245
|
+
})
|
|
94246
|
+
]
|
|
94247
|
+
}) : null
|
|
94248
|
+
]
|
|
94249
|
+
}) : null,
|
|
94250
|
+
(showLoading || isLoading) && /*#__PURE__*/ jsxRuntimeExports.jsx(LoadingIcon$2, {
|
|
94251
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
|
|
94252
|
+
src: icLoading,
|
|
94253
|
+
alt: "",
|
|
94254
|
+
className: "spin"
|
|
94255
|
+
})
|
|
94256
|
+
}),
|
|
94257
|
+
remainingTime && /*#__PURE__*/ jsxRuntimeExports.jsx(CountdownTime$1, {
|
|
94258
|
+
top: yFaceVerificationStepsWrapper - 30,
|
|
94259
|
+
children: remainingTime
|
|
94260
|
+
}),
|
|
94261
|
+
typeof lastErrorMsg === 'string' ? /*#__PURE__*/ jsxRuntimeExports.jsx(SimpleFaceDetectionError, {
|
|
94262
|
+
top: yFaceDetectionError - 15,
|
|
94263
|
+
className: "face-detection-error",
|
|
94264
|
+
children: lastErrorMsg
|
|
94265
|
+
}) : null
|
|
94266
|
+
]
|
|
94267
|
+
})
|
|
94268
|
+
});
|
|
94269
|
+
}
|
|
94270
|
+
ActiveLivenessV1.propTypes = {
|
|
94271
|
+
apiCheck: PropTypes.bool,
|
|
94272
|
+
onLivenessDetectionDone: PropTypes.func,
|
|
94273
|
+
onClose: PropTypes.func,
|
|
94274
|
+
onError: PropTypes.func,
|
|
94275
|
+
onReset: PropTypes.func,
|
|
94276
|
+
captureFrameSettings: PropTypes.shape({}),
|
|
94277
|
+
onFramesCaptured: PropTypes.func,
|
|
94278
|
+
flipVideoHorizontal: PropTypes.bool,
|
|
94279
|
+
frontCamera: PropTypes.bool,
|
|
94280
|
+
isLoading: PropTypes.bool,
|
|
94281
|
+
customDirectionIcon: PropTypes.shape({}),
|
|
94282
|
+
customStepTimeConstraints: PropTypes.shape({}),
|
|
94283
|
+
onProcessing: PropTypes.func,
|
|
94284
|
+
customErrors: PropTypes.shape({}),
|
|
94285
|
+
apiCredentials: PropTypes.shape({
|
|
94286
|
+
accessKey: PropTypes.string,
|
|
94287
|
+
secretKey: PropTypes.string,
|
|
94288
|
+
apiUrl: PropTypes.string
|
|
94289
|
+
}),
|
|
94290
|
+
outputEncryptionSettings: PropTypes.shape({}),
|
|
94291
|
+
cameraScale: PropTypes.number,
|
|
94292
|
+
defaultCameraId: PropTypes.string,
|
|
94293
|
+
offsetFaceY: PropTypes.number,
|
|
94294
|
+
styledComponent: PropTypes.shape({
|
|
94295
|
+
CloseCameraButton: PropTypes.node
|
|
94296
|
+
}),
|
|
94297
|
+
serviceSettings: PropTypes.shape({})
|
|
94298
|
+
};
|
|
94299
|
+
ActiveLivenessV1.defaultProps = {
|
|
94300
|
+
apiCheck: false,
|
|
94301
|
+
onLivenessDetectionDone: null,
|
|
94302
|
+
onClose: null,
|
|
94303
|
+
onError: ()=>{},
|
|
94304
|
+
onReset: ()=>{},
|
|
94305
|
+
captureFrameSettings: {
|
|
94306
|
+
enable: false,
|
|
94307
|
+
framesIntervalTime: 180,
|
|
94308
|
+
framesBatchLength: 0
|
|
94309
|
+
},
|
|
94310
|
+
onFramesCaptured: ()=>{},
|
|
94311
|
+
flipVideoHorizontal: null,
|
|
94312
|
+
frontCamera: true,
|
|
94313
|
+
isLoading: false,
|
|
94314
|
+
customDirectionIcon: {
|
|
94315
|
+
[ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
94316
|
+
type: ra$1.FaceDirection.LEFT
|
|
94317
|
+
}),
|
|
94318
|
+
[ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
94319
|
+
type: ra$1.FaceDirection.RIGHT
|
|
94320
|
+
}),
|
|
94321
|
+
[ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
94322
|
+
type: ra$1.FaceDirection.UP
|
|
94323
|
+
}),
|
|
94324
|
+
[ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
|
|
94325
|
+
type: ra$1.FaceDirection.FRONTAL
|
|
94326
|
+
})
|
|
94327
|
+
},
|
|
94328
|
+
customStepTimeConstraints: {
|
|
94329
|
+
[ra$1.FaceDirection.UP]: {
|
|
94330
|
+
delayTime: 0
|
|
94331
|
+
},
|
|
94332
|
+
[ra$1.FaceDirection.LEFT]: {
|
|
94333
|
+
delayTime: 0
|
|
94334
|
+
},
|
|
94335
|
+
[ra$1.FaceDirection.RIGHT]: {
|
|
94336
|
+
delayTime: 0
|
|
94337
|
+
},
|
|
94338
|
+
[ra$1.FaceDirection.FRONTAL]: {
|
|
94339
|
+
delayTime: 2000
|
|
94340
|
+
}
|
|
94341
|
+
},
|
|
94342
|
+
onProcessing: ()=>{},
|
|
94343
|
+
customErrors: null,
|
|
94344
|
+
apiCredentials: {
|
|
94345
|
+
accessKey: '',
|
|
94346
|
+
secretKey: '',
|
|
94347
|
+
apiUrl: ''
|
|
94348
|
+
},
|
|
94349
|
+
outputEncryptionSettings: null,
|
|
94350
|
+
cameraScale: 1,
|
|
94351
|
+
defaultCameraId: undefined,
|
|
94352
|
+
offsetFaceY: 0,
|
|
94353
|
+
styledComponent: {
|
|
94354
|
+
CloseCameraButton: null
|
|
94355
|
+
},
|
|
94356
|
+
serviceSettings: {
|
|
94357
|
+
enableUploadFrames: true,
|
|
94358
|
+
enableUploadImages: true,
|
|
94359
|
+
enableVerifySanityPortrait: true,
|
|
94360
|
+
enableVerifySanityIDCard: true,
|
|
94361
|
+
enableVerifyFaceLiveness: true,
|
|
94362
|
+
enableDetectIDCardTampering: true,
|
|
94363
|
+
enableReadIDCardInfo: true
|
|
94364
|
+
}
|
|
94365
|
+
};
|
|
94366
|
+
|
|
94367
|
+
// To reduce the calculation for blazeface
|
|
94368
|
+
const videoSettings$2 = libExports.isMobile ? {
|
|
94369
|
+
width: {
|
|
94370
|
+
ideal: 640
|
|
94371
|
+
}
|
|
94372
|
+
} : null;
|
|
94373
|
+
// eslint-disable-next-line react/require-default-props
|
|
94374
|
+
function PassiveLivenessOldV1(props) {
|
|
94375
|
+
const { apiCheck, onLivenessDetectionDone, captureFrameSettings, onFramesCaptured, frontCamera, flipVideoHorizontal, customDirectionIcon, customStepTimeConstraints, onProcessing, customErrors, apiCredentials, outputEncryptionSettings, cameraScale, defaultCameraId, passiveModeAuto, offsetFaceY, styledComponent, serviceSettings, onReset, isLoading } = props;
|
|
94376
|
+
const theme = nt$2();
|
|
94377
|
+
const { onErrorCallback, onCloseCallback } = useSDKCallback();
|
|
94378
|
+
const bgCameraMask = iH.useAsset('bg_camera_mask.png');
|
|
94379
|
+
const bgCameraMaskRed = iH.useAsset('bg_camera_mask_red.png');
|
|
94380
|
+
const icLoading = useThemeIcon('IDCapturing.loadingIcon.src', 'ic_loading.gif');
|
|
94381
|
+
const [uiSpacing, setUISpacing] = reactExports.useState({});
|
|
94382
|
+
const { yFaceDetectionError, yFaceVerificationStepsWrapper } = uiSpacing;
|
|
94383
|
+
const [remainingTime, setRemainingTime] = reactExports.useState('');
|
|
94384
|
+
const [currentOrientation, setCurrentOrientation] = reactExports.useState();
|
|
94385
|
+
const surroundStyle = reactExports.useMemo(()=>({
|
|
94386
|
+
backgroundColor: getTheme('Selfie.backgroundColor')({
|
|
94387
|
+
theme
|
|
94388
|
+
})
|
|
94389
|
+
}), [
|
|
94390
|
+
theme
|
|
94391
|
+
]);
|
|
94392
|
+
const cropAreaDimension = reactExports.useCallback(({ lostY, height, clientHeight })=>{
|
|
94393
|
+
const yFaceDetectionErrorNew = lostY + 25;
|
|
94394
|
+
const yCropAreaNew = yFaceDetectionErrorNew + 30;
|
|
94395
|
+
const yFaceVerificationStepsWrapperNew = yCropAreaNew + height + 20;
|
|
94396
|
+
setUISpacing({
|
|
94397
|
+
yFaceDetectionError: yFaceDetectionErrorNew,
|
|
94398
|
+
yFaceVerificationStepsWrapper: yFaceVerificationStepsWrapperNew
|
|
94399
|
+
});
|
|
94400
|
+
const topLimit = Math.floor(lostY);
|
|
94401
|
+
const botLimit = Math.floor(clientHeight - lostY);
|
|
94402
|
+
let y = Math.floor(yCropAreaNew); // floor the y value to avoid blur line on ios safari
|
|
94403
|
+
if (offsetFaceY !== 0 && (y + offsetFaceY < topLimit || y + offsetFaceY + height > botLimit)) {
|
|
94404
|
+
onErrorCallback({
|
|
94405
|
+
code: `offsetFaceY must be in [-${y - topLimit}, ${botLimit - height - y}]`
|
|
94406
|
+
});
|
|
94407
|
+
} else {
|
|
94408
|
+
y += offsetFaceY;
|
|
94409
|
+
}
|
|
94410
|
+
return {
|
|
94411
|
+
y
|
|
94412
|
+
};
|
|
94413
|
+
}, [
|
|
94414
|
+
offsetFaceY,
|
|
94415
|
+
onErrorCallback
|
|
94416
|
+
]);
|
|
94417
|
+
const { shouldResetFlowOnOrientationChange, countdownToTakePicture, cropArea, curStepIndex, faceDetectionError, resetFlow, handleTriggerPassiveMode, handleVideoPlayed, refVideo, showCountdown, steps, refIsReseting, videoPlayed, warmupDone, showCaptureButton, shouldShowCountdown, showLoading } = usePassiveLiveness$1({
|
|
94418
|
+
currentOrientation,
|
|
94419
|
+
apiCheck,
|
|
94420
|
+
bgCameraMask,
|
|
94421
|
+
bgCameraMaskRed,
|
|
94422
|
+
surroundStyle,
|
|
94423
|
+
onLivenessDetectionDone,
|
|
94424
|
+
onError: onErrorCallback,
|
|
94425
|
+
cropAreaDimension,
|
|
94426
|
+
customDirectionIcon,
|
|
94427
|
+
captureFrameSettings,
|
|
94428
|
+
onFramesCaptured,
|
|
94429
|
+
setRemainingTime,
|
|
94430
|
+
customStepTimeConstraints,
|
|
94431
|
+
onProcessing,
|
|
94432
|
+
customErrors,
|
|
94433
|
+
apiCredentials,
|
|
94434
|
+
outputEncryptionSettings,
|
|
94435
|
+
cameraScale,
|
|
94436
|
+
passiveModeAuto,
|
|
94437
|
+
serviceSettings,
|
|
94438
|
+
onReset
|
|
94439
|
+
});
|
|
94440
|
+
reactExports.useEffect(()=>{
|
|
94441
|
+
if (typeof steps[0]?.directionIcon === 'string') {
|
|
94442
|
+
Promise.all(steps.map((step)=>preloadImage(step.directionIcon)));
|
|
94443
|
+
}
|
|
94444
|
+
}, [
|
|
94445
|
+
steps
|
|
94446
|
+
]);
|
|
94447
|
+
const { CloseCameraButton } = styledComponent;
|
|
94448
|
+
const progressCircleProps = getProgressCircleProps(props, theme);
|
|
94449
|
+
const currentProgress = !refIsReseting.current ? curStepIndex / steps.length * 100 : 0;
|
|
94450
|
+
// for error text
|
|
94451
|
+
const { lang } = no$1.useSDKSettings();
|
|
94452
|
+
const timer = reactExports.useRef(0);
|
|
94453
|
+
const lastError = reactExports.useRef({});
|
|
94454
|
+
const duration = reactExports.useRef(ra$1.ErrorDuration.SHORT);
|
|
94455
|
+
const lastErrorMsg = reactExports.useMemo(()=>{
|
|
94456
|
+
const { msg, duration: errorDuration = ra$1.ErrorDuration.SHORT } = faceDetectionError || {};
|
|
94457
|
+
const errorMsg = msg?.[lang];
|
|
94458
|
+
if (Date.now() - timer.current >= duration.current) {
|
|
94459
|
+
timer.current = Date.now();
|
|
94460
|
+
duration.current = errorDuration;
|
|
94461
|
+
lastError.current = errorMsg;
|
|
94462
|
+
}
|
|
94463
|
+
return lastError.current;
|
|
94464
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
94465
|
+
}, [
|
|
94466
|
+
faceDetectionError,
|
|
94467
|
+
curStepIndex
|
|
94468
|
+
]); // curStepIndex is used to get the latest error when reset flow
|
|
94469
|
+
const onOrientationChange = reactExports.useCallback((curOrientation)=>{
|
|
94470
|
+
setCurrentOrientation(curOrientation);
|
|
94471
|
+
if (!shouldResetFlowOnOrientationChange) {
|
|
94472
|
+
if (curOrientation === MODE.LANDSCAPE) {
|
|
94473
|
+
refVideo.current?.pause();
|
|
94474
|
+
} else {
|
|
94475
|
+
refVideo.current?.play();
|
|
94476
|
+
}
|
|
94477
|
+
} else {
|
|
94478
|
+
resetFlow();
|
|
94479
|
+
}
|
|
94480
|
+
}, [
|
|
94481
|
+
refVideo,
|
|
94482
|
+
resetFlow,
|
|
94483
|
+
shouldResetFlowOnOrientationChange
|
|
94484
|
+
]);
|
|
94485
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(OrientationDetection, {
|
|
94486
|
+
onOrientationChange: onOrientationChange,
|
|
94487
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsxs(Camera$1, {
|
|
94488
|
+
frontCamera: frontCamera,
|
|
94489
|
+
onVideoPlayed: handleVideoPlayed,
|
|
94490
|
+
onClose: onCloseCallback,
|
|
94491
|
+
flipHorizontal: flipVideoHorizontal ?? frontCamera,
|
|
94492
|
+
ref: refVideo,
|
|
94493
|
+
videoSettings: videoSettings$2,
|
|
94494
|
+
onError: onErrorCallback,
|
|
94495
|
+
scale: cameraScale,
|
|
94496
|
+
defaultCameraId: defaultCameraId,
|
|
94497
|
+
closeButton: CloseCameraButton || null,
|
|
94498
|
+
children: [
|
|
94499
|
+
!warmupDone && /*#__PURE__*/ jsxRuntimeExports.jsx(WarmupPopup, {}),
|
|
94500
|
+
videoPlayed ? /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
94501
|
+
children: [
|
|
94502
|
+
typeof lastErrorMsg === 'string' ? /*#__PURE__*/ jsxRuntimeExports.jsx(SimpleFaceDetectionError, {
|
|
94503
|
+
top: yFaceDetectionError - 15,
|
|
94504
|
+
className: "face-detection-error",
|
|
94505
|
+
children: lastErrorMsg
|
|
94506
|
+
}) : null,
|
|
94507
|
+
cropArea.current ? /*#__PURE__*/ jsxRuntimeExports.jsxs(CropAreaOverlayWrapper, {
|
|
94508
|
+
x: `${cropArea.current.x}px`,
|
|
94509
|
+
y: `${cropArea.current.y}px`,
|
|
94510
|
+
width: `${cropArea.current.width}px`,
|
|
94511
|
+
height: `${cropArea.current.height}px`,
|
|
94512
|
+
surroundStyle: cropArea.current.surroundStyle,
|
|
94513
|
+
children: [
|
|
94514
|
+
/*#__PURE__*/ jsxRuntimeExports.jsx(StyledCameraMark$2, {}),
|
|
94515
|
+
/*#__PURE__*/ jsxRuntimeExports.jsx(OverlayProgressCircle$2, {
|
|
94516
|
+
...progressCircleProps,
|
|
94517
|
+
progress: currentProgress,
|
|
94518
|
+
showErrorRing: !!faceDetectionError && getTheme('Selfie.progressCircle.showErrorRing')({
|
|
94519
|
+
theme
|
|
94520
|
+
})
|
|
94521
|
+
}),
|
|
94522
|
+
shouldShowCountdown ? /*#__PURE__*/ jsxRuntimeExports.jsx(CountDownOverlay$3, {
|
|
94523
|
+
children: countdownToTakePicture
|
|
94524
|
+
}) : null,
|
|
94525
|
+
faceDetectionError && /*#__PURE__*/ jsxRuntimeExports.jsx(ErrorOverlay$3, {})
|
|
94526
|
+
]
|
|
94527
|
+
}) : null,
|
|
94528
|
+
remainingTime && /*#__PURE__*/ jsxRuntimeExports.jsx(CountdownTime$1, {
|
|
94529
|
+
top: yFaceVerificationStepsWrapper - 30,
|
|
94530
|
+
children: remainingTime
|
|
94531
|
+
}),
|
|
94532
|
+
showCaptureButton ? /*#__PURE__*/ jsxRuntimeExports.jsx(BottomButtonsOverlay$2, {
|
|
94533
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsx(Button$6, {
|
|
94534
|
+
onClick: handleTriggerPassiveMode,
|
|
94535
|
+
disabled: showCountdown,
|
|
94536
|
+
children: get(theme, 'Selfie.captureIcon.src') ? /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
|
|
94537
|
+
src: get(theme, 'Selfie.captureIcon.src'),
|
|
94538
|
+
alt: ""
|
|
94539
|
+
}) : /*#__PURE__*/ jsxRuntimeExports.jsx(CameraIcon$1, {
|
|
94540
|
+
fillColor: "rgba(193, 197, 204, 1)"
|
|
94541
|
+
})
|
|
94542
|
+
})
|
|
94543
|
+
}) : null
|
|
94544
|
+
]
|
|
94545
|
+
}) : null,
|
|
94546
|
+
(showLoading || isLoading) && /*#__PURE__*/ jsxRuntimeExports.jsx(LoadingIcon$2, {
|
|
94547
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
|
|
94548
|
+
src: icLoading,
|
|
94549
|
+
alt: ""
|
|
94550
|
+
})
|
|
94551
|
+
})
|
|
94552
|
+
]
|
|
94553
|
+
})
|
|
94554
|
+
});
|
|
94555
|
+
}
|
|
94556
|
+
PassiveLivenessOldV1.propTypes = {
|
|
94557
|
+
apiCheck: PropTypes.bool,
|
|
94558
|
+
mode: PropTypes.string,
|
|
94559
|
+
onLivenessDetectionDone: PropTypes.func,
|
|
94560
|
+
onClose: PropTypes.func,
|
|
94561
|
+
onError: PropTypes.func,
|
|
94562
|
+
onReset: PropTypes.func,
|
|
94563
|
+
captureFrameSettings: PropTypes.shape({}),
|
|
94564
|
+
onFramesCaptured: PropTypes.func,
|
|
94565
|
+
frontCamera: PropTypes.bool,
|
|
94566
|
+
isLoading: PropTypes.bool,
|
|
94567
|
+
flipVideoHorizontal: PropTypes.bool,
|
|
94568
|
+
customDirectionIcon: PropTypes.shape({}),
|
|
94569
|
+
customStepTimeConstraints: PropTypes.shape({}),
|
|
94570
|
+
onProcessing: PropTypes.func,
|
|
94571
|
+
customErrors: PropTypes.shape({}),
|
|
94572
|
+
apiCredentials: PropTypes.shape({
|
|
94573
|
+
accessKey: PropTypes.string,
|
|
94574
|
+
secretKey: PropTypes.string,
|
|
94575
|
+
apiUrl: PropTypes.string
|
|
94576
|
+
}),
|
|
94577
|
+
outputEncryptionSettings: PropTypes.shape({}),
|
|
94578
|
+
cameraScale: PropTypes.number,
|
|
94579
|
+
defaultCameraId: PropTypes.string,
|
|
94580
|
+
passiveModeAuto: PropTypes.bool,
|
|
94581
|
+
offsetFaceY: PropTypes.number,
|
|
94582
|
+
styledComponent: PropTypes.shape({
|
|
94583
|
+
CloseCameraButton: PropTypes.node
|
|
94584
|
+
}),
|
|
94585
|
+
serviceSettings: PropTypes.shape({})
|
|
94586
|
+
};
|
|
94587
|
+
PassiveLivenessOldV1.defaultProps = {
|
|
94588
|
+
apiCheck: false,
|
|
94589
|
+
mode: null,
|
|
94590
|
+
onLivenessDetectionDone: null,
|
|
94591
|
+
onClose: null,
|
|
94592
|
+
onError: ()=>{},
|
|
94593
|
+
onReset: ()=>{},
|
|
94594
|
+
captureFrameSettings: {
|
|
94595
|
+
enable: false,
|
|
94596
|
+
framesIntervalTime: 180,
|
|
94597
|
+
framesBatchLength: 0
|
|
94598
|
+
},
|
|
94599
|
+
onFramesCaptured: ()=>{},
|
|
94600
|
+
frontCamera: true,
|
|
94601
|
+
isLoading: false,
|
|
94602
|
+
flipVideoHorizontal: null,
|
|
94603
|
+
customDirectionIcon: {
|
|
94604
|
+
[ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$2, {
|
|
94605
|
+
type: ra$1.FaceDirection.LEFT
|
|
94606
|
+
}),
|
|
94607
|
+
[ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$2, {
|
|
94608
|
+
type: ra$1.FaceDirection.RIGHT
|
|
94609
|
+
}),
|
|
94610
|
+
[ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$2, {
|
|
94611
|
+
type: ra$1.FaceDirection.UP
|
|
94612
|
+
}),
|
|
94613
|
+
[ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$2, {
|
|
94614
|
+
type: ra$1.FaceDirection.FRONTAL
|
|
94615
|
+
})
|
|
94616
|
+
},
|
|
94617
|
+
customStepTimeConstraints: {
|
|
94618
|
+
[ra$1.FaceDirection.UP]: {
|
|
94619
|
+
delayTime: 0
|
|
94620
|
+
},
|
|
94621
|
+
[ra$1.FaceDirection.LEFT]: {
|
|
94622
|
+
delayTime: 0
|
|
94623
|
+
},
|
|
94624
|
+
[ra$1.FaceDirection.RIGHT]: {
|
|
94625
|
+
delayTime: 0
|
|
94626
|
+
},
|
|
94627
|
+
[ra$1.FaceDirection.FRONTAL]: {
|
|
94628
|
+
delayTime: 2000
|
|
94629
|
+
}
|
|
94630
|
+
},
|
|
94631
|
+
onProcessing: ()=>{},
|
|
94632
|
+
customErrors: null,
|
|
94633
|
+
apiCredentials: {
|
|
94634
|
+
accessKey: '',
|
|
94635
|
+
secretKey: '',
|
|
94636
|
+
apiUrl: ''
|
|
94637
|
+
},
|
|
94638
|
+
outputEncryptionSettings: null,
|
|
94639
|
+
cameraScale: 1,
|
|
94640
|
+
defaultCameraId: undefined,
|
|
94641
|
+
passiveModeAuto: false,
|
|
94642
|
+
offsetFaceY: 0,
|
|
94643
|
+
styledComponent: {
|
|
94644
|
+
CloseCameraButton: null
|
|
94645
|
+
},
|
|
94646
|
+
serviceSettings: {
|
|
94647
|
+
enableUploadFrames: true,
|
|
94648
|
+
enableUploadImages: true,
|
|
94649
|
+
enableVerifySanityPortrait: true,
|
|
94650
|
+
enableVerifySanityIDCard: true,
|
|
94651
|
+
enableVerifyFaceLiveness: true,
|
|
94652
|
+
enableDetectIDCardTampering: true,
|
|
94653
|
+
enableReadIDCardInfo: true
|
|
94654
|
+
}
|
|
94655
|
+
};
|
|
94656
|
+
|
|
93938
94657
|
const withClientSettings$1 = (Component)=>{
|
|
93939
94658
|
return function WrappedComponent(props) {
|
|
93940
94659
|
const { apiCheck, apiCredentials, serviceSettings, flowId, clientSettings } = props;
|
|
@@ -93950,16 +94669,20 @@
|
|
|
93950
94669
|
});
|
|
93951
94670
|
};
|
|
93952
94671
|
};
|
|
93953
|
-
const getLivenessModeComponent = (mode, CustomLivenessDetection)=>{
|
|
94672
|
+
const getLivenessModeComponent = (mode, CustomLivenessDetection, themeVersion)=>{
|
|
93954
94673
|
let LivenessDetectionComponent = ActiveLiveness;
|
|
93955
94674
|
if (mode === ra$1.Mode.ACTIVE) {
|
|
93956
|
-
|
|
94675
|
+
const DefaultActiveLiveness = themeVersion === 'v1' ? ActiveLivenessV1 : ActiveLiveness;
|
|
94676
|
+
LivenessDetectionComponent = CustomLivenessDetection?.ActiveLiveness ?? DefaultActiveLiveness;
|
|
93957
94677
|
}
|
|
93958
94678
|
if (mode === ra$1.Mode.PASSIVE_V2) {
|
|
93959
94679
|
LivenessDetectionComponent = CustomLivenessDetection?.PassiveLivenessV2 ?? PassiveLiveness$1;
|
|
93960
94680
|
}
|
|
93961
94681
|
if (mode === ra$1.Mode.PASSIVE) {
|
|
93962
|
-
|
|
94682
|
+
// PassiveLivenessOldV1 to not be confused with PassiveLivenessV2 (which is totally new mode)
|
|
94683
|
+
// PassiveLivenessOldV1 refers to PassiveLiveness with themeVersion = "v1"
|
|
94684
|
+
const DefaultPassiveLiveness = themeVersion === 'v1' ? PassiveLivenessOldV1 : PassiveLiveness$2;
|
|
94685
|
+
LivenessDetectionComponent = CustomLivenessDetection?.PassiveLiveness ?? DefaultPassiveLiveness;
|
|
93963
94686
|
}
|
|
93964
94687
|
if (typeof mode === 'string' && mode.startsWith('flash')) {
|
|
93965
94688
|
LivenessDetectionComponent = CustomLivenessDetection?.FlashLiveness ?? FlashLiveness;
|
|
@@ -93972,7 +94695,7 @@
|
|
|
93972
94695
|
}, livenessComponent: CustomLivenessDetection, customTheme = {}, customTexts, ...props } = livenessProps;
|
|
93973
94696
|
const { mode, flowId, onError: onErrorFromProp, onClose: onCloseFromProp, debug, onLivenessDetectionDone } = props;
|
|
93974
94697
|
const clientSettings = useClientSettings();
|
|
93975
|
-
const { billingSettings: clientBillingSettings, enableBilling } = no$1.useSDKSettings();
|
|
94698
|
+
const { billingSettings: clientBillingSettings, enableBilling, themeVersion } = no$1.useSDKSettings();
|
|
93976
94699
|
const billingSettingsFromSdkSettings = dD.getWebSetting(clientSettings, 'data.settings.sdk_settings.billing_settings.billing_config');
|
|
93977
94700
|
const billingUrl = dD.getWebSetting(clientSettings, 'data.settings.sdk_settings.billing_settings.url');
|
|
93978
94701
|
const { submitBilling } = gR({
|
|
@@ -94058,7 +94781,7 @@
|
|
|
94058
94781
|
billingInput,
|
|
94059
94782
|
onCloseFromProp
|
|
94060
94783
|
]);
|
|
94061
|
-
const LivenessDetectionComponent = getLivenessModeComponent(mode, CustomLivenessDetection);
|
|
94784
|
+
const LivenessDetectionComponent = getLivenessModeComponent(mode, CustomLivenessDetection, themeVersion);
|
|
94062
94785
|
return /*#__PURE__*/ jsxRuntimeExports.jsx(DebugProvider, {
|
|
94063
94786
|
debug: debug,
|
|
94064
94787
|
children: /*#__PURE__*/ jsxRuntimeExports.jsx(SDKCallbackProvider, {
|
|
@@ -113636,7 +114359,7 @@
|
|
|
113636
114359
|
});
|
|
113637
114360
|
}
|
|
113638
114361
|
|
|
113639
|
-
const defaultAssetRoot = "https://vision-cdn.trustingsocial.com/tvweb-sdk.msb/0.0.0-beta.20251215-
|
|
114362
|
+
const defaultAssetRoot = "https://vision-cdn.trustingsocial.com/tvweb-sdk.msb/0.0.0-beta.20251215-170414/assets";
|
|
113640
114363
|
class TVWebSDK extends gU {
|
|
113641
114364
|
constructor(props){
|
|
113642
114365
|
super({
|