@tsocial/tvweb-sdk.platform 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.
@@ -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 o = c.sent(), [
19187
+ return u = c.sent(), this.cleanupTimeout(l), [
19177
19188
  4,
19178
- "blob" === r ? o.blob() : o.json()
19189
+ "blob" === r ? u.blob() : u.json()
19179
19190
  ];
19180
19191
  case 3:
19181
- if ((s = c.sent()).errors && this.onError) throw this.onError(s.errors), s;
19192
+ if ((d = c.sent()).errors && this.onError) throw this.onError(d.errors), d;
19182
19193
  return [
19183
19194
  2,
19184
- s
19195
+ d
19185
19196
  ];
19186
19197
  case 4:
19187
- if (l = c.sent(), this.shouldRetryWithFallback(l) && Array.isArray(this.fallbackUrls) && this.fallbackUrls.length > 0) return u = "GET" === t.method ? new URL(e).searchParams : null, [
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, u, r)
19200
+ this.retryWithFallback(t.requestPath, t, h, r)
19190
19201
  ];
19191
- throw l;
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 i, a, o, s, l, u;
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
- i = null, a = 0, c.label = 1;
19223
+ a = null, o = 0, c.label = 1;
19213
19224
  case 1:
19214
- if (!(a < this.fallbackUrls.length)) return [
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
- ]), o = new URL(this.resolveFallbackUrl(e, this.fallbackUrls[a])), r && "GET" === t.method && (o.search = r.toString()), [
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(o.toString(), t)
19238
+ fetch(d.toString(), f)
19228
19239
  ];
19229
19240
  case 3:
19230
- return s = c.sent(), [
19241
+ return h = c.sent(), this.cleanupTimeout(u), [
19231
19242
  4,
19232
- "blob" === n ? s.blob() : s.json()
19243
+ "blob" === n ? h.blob() : h.json()
19233
19244
  ];
19234
19245
  case 4:
19235
- if ((l = c.sent()).errors && this.onError) throw this.onError(l.errors), l;
19246
+ if ((p = c.sent()).errors && this.onError) throw this.onError(p.errors), p;
19236
19247
  return [
19237
19248
  2,
19238
- l
19249
+ p
19239
19250
  ];
19240
19251
  case 5:
19241
- return i = u = c.sent(), this.shouldRetryWithFallback(u) ? [
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 a++, [
19260
+ return o++, [
19250
19261
  3,
19251
19262
  1
19252
19263
  ];
19253
19264
  case 7:
19254
- throw i;
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-093759";
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
- "391796qAHBQP",
41252
- "2a8648ce3d",
41253
- "ZIzj0CAQYI",
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
- "000",
41261
- "120612DuHKxu",
41262
- "DepBO8t60S",
41263
- "3059301306",
41264
- "ssRdXLZEX8",
41285
+ "8915nLIOAa",
41286
+ "44P0rKKsZK",
41265
41287
  "cDQgAE9h6Z",
41266
- "2919fSUnYj",
41267
- "9720kJycIQ",
41268
- "+faHkP3QC3",
41269
- "212094GlWFgW",
41270
- "KA==",
41271
- "315786GasSwN"
41288
+ "4218291nxdvtB",
41289
+ "2729172royNkn",
41290
+ "653601YIYffL",
41291
+ "2315541rITdMg",
41292
+ "2a8648ce3d",
41293
+ "1619078DMdLEK",
41294
+ "Mjci1ul8mm",
41295
+ "3059301306"
41272
41296
  ];
41273
- return (dm = function() {
41297
+ return (dy = function() {
41274
41298
  return e;
41275
41299
  })();
41276
41300
  }
41277
- let dg = d_, dy = d_, db = dm();
41301
+ let db = dm, dv = dy();
41278
41302
  for(;;)try {
41279
- if (parseInt(dy(292)) / 1 + parseInt(dy(295)) / 2 + -parseInt(dy(299)) / 3 + parseInt(dy(305)) / 4 + parseInt(dy(300)) / 5 + parseInt(dy(294)) / 6 + parseInt(dy(289)) / 7 * (-parseInt(dy(290)) / 8) === 121195) break;
41280
- db.push(db.shift());
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
- db.push(db.shift());
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 dx = dg(303) + dg(297) + "KoZIzj0DAQ" + dg(288) + dg(306) + dg(298) + dg(291) + dg(302) + "Mjci1ul8mmD9EKOWS+U4" + dg(301) + dg(308) + dg(293);
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(dv, ""), i = new dp.ec("p256").keyFromPublic(n, "hex"), {
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
  });
@@ -90527,7 +90546,7 @@
90527
90546
  }
90528
90547
  };
90529
90548
 
90530
- const videoSettings$3 = libExports.isMobile ? {
90549
+ const videoSettings$5 = libExports.isMobile ? {
90531
90550
  // aspectRatio: 16 / 9,
90532
90551
  width: {
90533
90552
  ideal: 640
@@ -91306,7 +91325,7 @@
91306
91325
  flipHorizontal: frontCamera,
91307
91326
  ref: videoRef,
91308
91327
  onError: onErrorCallback,
91309
- videoSettings: videoSettings$3,
91328
+ videoSettings: videoSettings$5,
91310
91329
  closeButton: /*#__PURE__*/ jsxRuntimeExports.jsx(CloseIcon, {}),
91311
91330
  children: /*#__PURE__*/ jsxRuntimeExports.jsxs(WarmUpOverlay, {
91312
91331
  overlay: !warmupDone || !isPlaying,
@@ -91868,11 +91887,11 @@
91868
91887
  extraConfig: null
91869
91888
  };
91870
91889
 
91871
- const DirectionalIcon = dt$1.img`
91890
+ const DirectionalIcon$1 = dt$1.img`
91872
91891
  width: ${({ width })=>width};
91873
91892
  `;
91874
91893
  // eslint-disable-next-line react/require-default-props
91875
- function DirectionIcon({ type }) {
91894
+ function DirectionIcon$1({ type }) {
91876
91895
  const theme = nt$2();
91877
91896
  // default icons and widths based on version
91878
91897
  const iconDirection = useThemeIcon(`Selfie.Active.directionIcon.${type}`, `${type}_arrow.gif`);
@@ -91889,7 +91908,7 @@
91889
91908
  if (type === ra$1.FaceDirection.FRONTAL) {
91890
91909
  // For frontal direction, use the SVG icon if available
91891
91910
  if (frontalIcon) {
91892
- return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon, {
91911
+ return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon$1, {
91893
91912
  src: frontalIcon,
91894
91913
  width: iconWidth,
91895
91914
  alt: ""
@@ -91897,20 +91916,20 @@
91897
91916
  }
91898
91917
  }
91899
91918
  if (directionIconSrc && directionIconSrc !== null) {
91900
- return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon, {
91919
+ return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon$1, {
91901
91920
  src: get(theme, `Selfie.Active.directionIcon.${type}`),
91902
91921
  width: iconWidth,
91903
91922
  alt: ""
91904
91923
  });
91905
91924
  }
91906
91925
  // fallback to default icons and width
91907
- return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon, {
91926
+ return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon$1, {
91908
91927
  src: iconDirection,
91909
91928
  alt: "",
91910
91929
  width: iconWidth
91911
91930
  });
91912
91931
  }
91913
- DirectionIcon.propTypes = {
91932
+ DirectionIcon$1.propTypes = {
91914
91933
  type: PropTypes.oneOf([
91915
91934
  ra$1.FaceDirection.LEFT,
91916
91935
  ra$1.FaceDirection.RIGHT,
@@ -91918,12 +91937,12 @@
91918
91937
  ra$1.FaceDirection.FRONTAL
91919
91938
  ])
91920
91939
  };
91921
- DirectionIcon.defaultProps = {
91940
+ DirectionIcon$1.defaultProps = {
91922
91941
  type: ra$1.FaceDirection.LEFT
91923
91942
  };
91924
91943
 
91925
91944
  // To reduce the calculation for blazeface
91926
- const videoSettings$2 = libExports.isMobile ? {
91945
+ const videoSettings$4 = libExports.isMobile ? {
91927
91946
  width: {
91928
91947
  ideal: 640
91929
91948
  }
@@ -92048,7 +92067,7 @@
92048
92067
  onClose: onCloseCallback,
92049
92068
  flipHorizontal: flipVideoHorizontal ?? frontCamera,
92050
92069
  ref: refVideo,
92051
- videoSettings: videoSettings$2,
92070
+ videoSettings: videoSettings$4,
92052
92071
  onError: onErrorCallback,
92053
92072
  scale: cameraScale,
92054
92073
  defaultCameraId: defaultCameraId,
@@ -92159,16 +92178,16 @@
92159
92178
  isLoading: false,
92160
92179
  flipVideoHorizontal: null,
92161
92180
  customDirectionIcon: {
92162
- [ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
92181
+ [ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
92163
92182
  type: ra$1.FaceDirection.LEFT
92164
92183
  }),
92165
- [ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
92184
+ [ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
92166
92185
  type: ra$1.FaceDirection.RIGHT
92167
92186
  }),
92168
- [ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
92187
+ [ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
92169
92188
  type: ra$1.FaceDirection.UP
92170
92189
  }),
92171
- [ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
92190
+ [ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
92172
92191
  type: ra$1.FaceDirection.FRONTAL
92173
92192
  })
92174
92193
  },
@@ -92546,7 +92565,7 @@
92546
92565
  });
92547
92566
  }
92548
92567
 
92549
- const videoSettings$1 = libExports.isMobile ? {
92568
+ const videoSettings$3 = libExports.isMobile ? {
92550
92569
  // aspectRatio: 16 / 9,
92551
92570
  width: {
92552
92571
  ideal: 640
@@ -93079,7 +93098,7 @@
93079
93098
  flipHorizontal: frontCamera,
93080
93099
  ref: videoRef,
93081
93100
  onError: onErrorCallback,
93082
- videoSettings: videoSettings$1,
93101
+ videoSettings: videoSettings$3,
93083
93102
  closeButton: /*#__PURE__*/ jsxRuntimeExports.jsx(CloseIcon, {}),
93084
93103
  children: /*#__PURE__*/ jsxRuntimeExports.jsxs(WarmUpOverlay, {
93085
93104
  overlay: !warmupDone || !isPlaying,
@@ -93421,13 +93440,13 @@
93421
93440
  };
93422
93441
 
93423
93442
  // To reduce the calculation for blazeface
93424
- const videoSettings = libExports.isMobile ? {
93443
+ const videoSettings$2 = libExports.isMobile ? {
93425
93444
  width: {
93426
93445
  ideal: 640
93427
93446
  }
93428
93447
  } : null;
93429
93448
  // eslint-disable-next-line react/prop-types, consistent-return
93430
- const SelfieStepImageHolder = ({ stepNumber, type, theme })=>{
93449
+ const SelfieStepImageHolder$1 = ({ stepNumber, type, theme })=>{
93431
93450
  const imageHolderIcon = useDefaultThemeIcon(`instruction_${type}.svg`);
93432
93451
  // prioritize custom theme icons
93433
93452
  const customHolderSrc = get(theme, `Selfie.Active.imageHolder.${type}`);
@@ -93452,7 +93471,7 @@
93452
93471
  alt: ""
93453
93472
  });
93454
93473
  };
93455
- function renderDirectionIcon(directionIcon, directionIconAnimation) {
93474
+ function renderDirectionIcon$1(directionIcon, directionIconAnimation) {
93456
93475
  if (!directionIcon) return null;
93457
93476
  if (typeof directionIcon === 'string') {
93458
93477
  return /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
@@ -93597,7 +93616,7 @@
93597
93616
  onClose: onCloseCallback,
93598
93617
  flipHorizontal: flipVideoHorizontal ?? frontCamera,
93599
93618
  ref: refVideo,
93600
- videoSettings: videoSettings,
93619
+ videoSettings: videoSettings$2,
93601
93620
  onError: onErrorCallback,
93602
93621
  scale: cameraScale,
93603
93622
  defaultCameraId: defaultCameraId,
@@ -93622,7 +93641,7 @@
93622
93641
  showErrorRing: !!faceDetectionError
93623
93642
  }),
93624
93643
  /*#__PURE__*/ jsxRuntimeExports.jsx(InstructionsOverlay, {
93625
- children: renderDirectionIcon(directionIcon, directionIconAnimation)
93644
+ children: renderDirectionIcon$1(directionIcon, directionIconAnimation)
93626
93645
  }),
93627
93646
  activeCapturing && /*#__PURE__*/ jsxRuntimeExports.jsx(CapturingOverlay, {})
93628
93647
  ]
@@ -93645,7 +93664,7 @@
93645
93664
  className: "image_preview",
93646
93665
  src: objUrl,
93647
93666
  alt: ""
93648
- }) : /*#__PURE__*/ jsxRuntimeExports.jsx(SelfieStepImageHolder, {
93667
+ }) : /*#__PURE__*/ jsxRuntimeExports.jsx(SelfieStepImageHolder$1, {
93649
93668
  stepNumber: index + 1,
93650
93669
  type: name,
93651
93670
  theme: theme
@@ -93736,16 +93755,16 @@
93736
93755
  frontCamera: true,
93737
93756
  isLoading: false,
93738
93757
  customDirectionIcon: {
93739
- [ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
93758
+ [ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
93740
93759
  type: ra$1.FaceDirection.LEFT
93741
93760
  }),
93742
- [ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
93761
+ [ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
93743
93762
  type: ra$1.FaceDirection.RIGHT
93744
93763
  }),
93745
- [ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
93764
+ [ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
93746
93765
  type: ra$1.FaceDirection.UP
93747
93766
  }),
93748
- [ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
93767
+ [ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
93749
93768
  type: ra$1.FaceDirection.FRONTAL
93750
93769
  })
93751
93770
  },
@@ -93873,6 +93892,706 @@
93873
93892
  };
93874
93893
  const useWrapIndicator = ()=>reactExports.useContext(WrapIndicatorContext);
93875
93894
 
93895
+ const DirectionalIcon = dt$1.img`
93896
+ width: ${({ width })=>width};
93897
+ `;
93898
+ // eslint-disable-next-line react/require-default-props
93899
+ function DirectionIcon({ type }) {
93900
+ const theme = nt$2();
93901
+ // default icons and widths based on version
93902
+ const iconDirection = useThemeIcon(`Selfie.Active.directionIcon.${type}`, `${type}_arrow.gif`);
93903
+ const iconWidth = getTheme(`Selfie.Active.directionIcon.${type}Width`)({
93904
+ theme
93905
+ });
93906
+ // prioritize custom theme icons
93907
+ const directionIconSrc = get(theme, `Selfie.Active.directionIcon.${type}`);
93908
+ if (directionIconSrc === null) {
93909
+ // eslint-disable-next-line react/jsx-no-useless-fragment
93910
+ return /*#__PURE__*/ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
93911
+ }
93912
+ if (directionIconSrc && directionIconSrc !== null) {
93913
+ return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon, {
93914
+ src: get(theme, `Selfie.Active.directionIcon.${type}`),
93915
+ width: iconWidth,
93916
+ alt: ""
93917
+ });
93918
+ }
93919
+ // fallback to default icons and width
93920
+ return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon, {
93921
+ src: iconDirection,
93922
+ alt: "",
93923
+ width: iconWidth
93924
+ });
93925
+ }
93926
+ DirectionIcon.propTypes = {
93927
+ type: PropTypes.oneOf([
93928
+ ra$1.FaceDirection.LEFT,
93929
+ ra$1.FaceDirection.RIGHT,
93930
+ ra$1.FaceDirection.UP,
93931
+ ra$1.FaceDirection.FRONTAL
93932
+ ])
93933
+ };
93934
+ DirectionIcon.defaultProps = {
93935
+ type: ra$1.FaceDirection.LEFT
93936
+ };
93937
+
93938
+ // To reduce the calculation for blazeface
93939
+ const videoSettings$1 = libExports.isMobile ? {
93940
+ width: {
93941
+ ideal: 640
93942
+ }
93943
+ } : null;
93944
+ // eslint-disable-next-line react/prop-types, consistent-return
93945
+ const SelfieStepImageHolder = ({ stepNumber, type, theme })=>{
93946
+ const imageHolderIcon = useDefaultThemeIcon(`instruction_${type}.svg`);
93947
+ // prioritize custom theme icons
93948
+ const customHolderSrc = get(theme, `Selfie.Active.imageHolder.${type}`);
93949
+ if (customHolderSrc === null) {
93950
+ // eslint-disable-next-line react/jsx-no-useless-fragment
93951
+ return /*#__PURE__*/ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
93952
+ }
93953
+ if (typeof customHolderSrc === 'string' && customHolderSrc !== '') {
93954
+ return /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
93955
+ src: customHolderSrc,
93956
+ alt: ""
93957
+ });
93958
+ }
93959
+ // v1: use step number
93960
+ if (get(theme, 'themeVersion') === 'v1') {
93961
+ return /*#__PURE__*/ jsxRuntimeExports.jsx("span", {
93962
+ children: stepNumber
93963
+ });
93964
+ }
93965
+ return /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
93966
+ src: imageHolderIcon,
93967
+ alt: ""
93968
+ });
93969
+ };
93970
+ function renderDirectionIcon(directionIcon, directionIconAnimation) {
93971
+ if (!directionIcon) return null;
93972
+ if (typeof directionIcon === 'string') {
93973
+ return /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
93974
+ className: directionIconAnimation,
93975
+ src: directionIcon,
93976
+ alt: "",
93977
+ style: {
93978
+ maxWidth: '98px',
93979
+ maxHeight: '98px',
93980
+ marginBottom: '25px'
93981
+ }
93982
+ });
93983
+ }
93984
+ return directionIcon;
93985
+ }
93986
+ // eslint-disable-next-line react/require-default-props
93987
+ function ActiveLivenessV1(props) {
93988
+ const { apiCheck, onLivenessDetectionDone, captureFrameSettings, onFramesCaptured, frontCamera, flipVideoHorizontal, customDirectionIcon, customStepTimeConstraints, onProcessing, customErrors, apiCredentials, outputEncryptionSettings, cameraScale, defaultCameraId, offsetFaceY, styledComponent, isLoading, serviceSettings, onReset } = props;
93989
+ const theme = nt$2();
93990
+ const { onErrorCallback, onCloseCallback } = useSDKCallback();
93991
+ const bgCameraMask = iH.useAsset('bg_camera_mask.png');
93992
+ const bgCameraMaskRed = iH.useAsset('bg_camera_mask_red.png');
93993
+ const icLoading = useThemeIcon('IDCapturing.loadingIcon.src', 'ic_loading.gif');
93994
+ const [uiSpacing, setUISpacing] = reactExports.useState({});
93995
+ const { yFaceVerificationStepsWrapper, yFaceDetectionError } = uiSpacing;
93996
+ const [remainingTime, setRemainingTime] = reactExports.useState('');
93997
+ const [currentOrientation, setCurrentOrientation] = reactExports.useState();
93998
+ const surroundStyle = reactExports.useMemo(()=>({
93999
+ backgroundColor: getTheme('Selfie.backgroundColor')({
94000
+ theme
94001
+ })
94002
+ }), [
94003
+ theme
94004
+ ]);
94005
+ // preload icons
94006
+ usePreloadThemeAsset(get(theme, 'themeVersion'), 'up_arrow.gif');
94007
+ usePreloadThemeAsset(get(theme, 'themeVersion'), 'left_arrow.gif');
94008
+ usePreloadThemeAsset(get(theme, 'themeVersion'), 'right_arrow.gif');
94009
+ usePreloadThemeAsset(get(theme, 'themeVersion'), 'frontal_arrow.gif');
94010
+ usePreloadThemeAsset(get(theme, 'themeVersion'), 'instruction_up.svg');
94011
+ usePreloadThemeAsset(get(theme, 'themeVersion'), 'instruction_left.svg');
94012
+ usePreloadThemeAsset(get(theme, 'themeVersion'), 'instruction_right.svg');
94013
+ usePreloadThemeAsset(get(theme, 'themeVersion'), 'instruction_frontal.svg');
94014
+ const cropAreaDimension = reactExports.useCallback(({ clientHeight, videoAreaWidth, videoAreaHeight, lostX, lostY })=>{
94015
+ let width;
94016
+ let height;
94017
+ if (libExports.isMobile) {
94018
+ width = videoAreaWidth;
94019
+ height = width;
94020
+ } else {
94021
+ height = videoAreaHeight - 200;
94022
+ width = height;
94023
+ }
94024
+ const x = Math.floor((videoAreaWidth - width) / 2) + lostX;
94025
+ let y = 5 + lostY;
94026
+ const yFaceDetectionErrorNew = lostY + 25;
94027
+ const yCropAreaNew = yFaceDetectionErrorNew + 30;
94028
+ const yFaceVerificationStepsWrapperNew = yCropAreaNew + height + 20;
94029
+ setUISpacing({
94030
+ yFaceDetectionError: yFaceDetectionErrorNew,
94031
+ yFaceVerificationStepsWrapper: yFaceVerificationStepsWrapperNew
94032
+ });
94033
+ const topLimit = Math.floor(lostY);
94034
+ const botLimit = Math.floor(clientHeight - lostY);
94035
+ y = Math.floor(yCropAreaNew); // floor the y value to avoid blur line on ios safari
94036
+ if (offsetFaceY !== 0 && (y + offsetFaceY < topLimit || y + offsetFaceY + height > botLimit)) {
94037
+ onErrorCallback({
94038
+ code: `offsetFaceY must be in [-${y - topLimit}, ${botLimit - height - y}]`
94039
+ });
94040
+ } else {
94041
+ y += offsetFaceY;
94042
+ }
94043
+ return {
94044
+ x,
94045
+ y,
94046
+ width,
94047
+ height
94048
+ };
94049
+ }, [
94050
+ offsetFaceY,
94051
+ onErrorCallback
94052
+ ]);
94053
+ const { shouldResetFlowOnOrientationChange, cropArea, curStepIndex, directionIcon, directionIconAnimation, faceDetectionError, resetFlow, handleVideoPlayed, instructions, refVideo, refIsReseting, steps, videoPlayed, activeCapturing, warmupDone, showLoading } = useActiveLiveness({
94054
+ currentOrientation,
94055
+ apiCheck,
94056
+ bgCameraMask,
94057
+ bgCameraMaskRed,
94058
+ surroundStyle,
94059
+ onLivenessDetectionDone,
94060
+ onError: onErrorCallback,
94061
+ cropAreaDimension,
94062
+ customDirectionIcon,
94063
+ captureFrameSettings,
94064
+ onFramesCaptured,
94065
+ setRemainingTime,
94066
+ customStepTimeConstraints,
94067
+ onProcessing,
94068
+ customErrors,
94069
+ apiCredentials,
94070
+ outputEncryptionSettings,
94071
+ cameraScale,
94072
+ serviceSettings,
94073
+ onReset
94074
+ });
94075
+ reactExports.useEffect(()=>{
94076
+ if (typeof steps[0]?.directionIcon === 'string') {
94077
+ Promise.all(steps.map((step)=>preloadImage(step.directionIcon)));
94078
+ }
94079
+ }, [
94080
+ steps
94081
+ ]);
94082
+ const { CloseCameraButton } = styledComponent;
94083
+ const progressCircleProps = getProgressCircleProps(props, theme);
94084
+ const currentProgress = !refIsReseting.current ? curStepIndex / steps.length * 100 : 0;
94085
+ // for error text
94086
+ const { lang } = no$1.useSDKSettings();
94087
+ const timer = reactExports.useRef(0);
94088
+ const lastError = reactExports.useRef({});
94089
+ const duration = reactExports.useRef(ra$1.ErrorDuration.SHORT);
94090
+ const lastErrorMsg = reactExports.useMemo(()=>{
94091
+ const { msg, duration: errorDuration = ra$1.ErrorDuration.SHORT } = faceDetectionError || {};
94092
+ const errorMsg = msg?.[lang];
94093
+ if (Date.now() - timer.current >= duration.current) {
94094
+ timer.current = Date.now();
94095
+ duration.current = errorDuration;
94096
+ lastError.current = errorMsg;
94097
+ }
94098
+ return lastError.current;
94099
+ // eslint-disable-next-line react-hooks/exhaustive-deps
94100
+ }, [
94101
+ faceDetectionError,
94102
+ curStepIndex
94103
+ ]); // curStepIndex is used to get the latest error when reset flow
94104
+ const onOrientationChange = reactExports.useCallback((curOrientation)=>{
94105
+ setCurrentOrientation(curOrientation);
94106
+ if (!shouldResetFlowOnOrientationChange) {
94107
+ if (curOrientation === MODE.LANDSCAPE) {
94108
+ refVideo.current?.pause();
94109
+ } else {
94110
+ refVideo.current?.play();
94111
+ }
94112
+ } else {
94113
+ resetFlow();
94114
+ }
94115
+ }, [
94116
+ refVideo,
94117
+ resetFlow,
94118
+ shouldResetFlowOnOrientationChange
94119
+ ]);
94120
+ return /*#__PURE__*/ jsxRuntimeExports.jsx(OrientationDetection, {
94121
+ onOrientationChange: onOrientationChange,
94122
+ children: /*#__PURE__*/ jsxRuntimeExports.jsxs(Camera$1, {
94123
+ frontCamera: frontCamera,
94124
+ onVideoPlayed: handleVideoPlayed,
94125
+ onClose: onCloseCallback,
94126
+ flipHorizontal: flipVideoHorizontal ?? frontCamera,
94127
+ ref: refVideo,
94128
+ videoSettings: videoSettings$1,
94129
+ onError: onErrorCallback,
94130
+ scale: cameraScale,
94131
+ defaultCameraId: defaultCameraId,
94132
+ closeButton: CloseCameraButton || null,
94133
+ children: [
94134
+ !warmupDone && /*#__PURE__*/ jsxRuntimeExports.jsx(WarmupPopup, {}),
94135
+ videoPlayed ? /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
94136
+ children: [
94137
+ cropArea.current ? /*#__PURE__*/ jsxRuntimeExports.jsxs(CropAreaOverlayWrapper, {
94138
+ x: `${cropArea.current.x}px`,
94139
+ y: `${cropArea.current.y}px`,
94140
+ width: `${cropArea.current.width}px`,
94141
+ height: `${cropArea.current.height}px`,
94142
+ surroundStyle: cropArea.current.surroundStyle,
94143
+ children: [
94144
+ /*#__PURE__*/ jsxRuntimeExports.jsx(StyledCameraMark, {}),
94145
+ /*#__PURE__*/ jsxRuntimeExports.jsx(OverlayProgressCircle, {
94146
+ ...progressCircleProps,
94147
+ progress: currentProgress,
94148
+ showErrorRing: !!faceDetectionError && getTheme('Selfie.progressCircle.showErrorRing')({
94149
+ theme
94150
+ })
94151
+ }),
94152
+ /*#__PURE__*/ jsxRuntimeExports.jsx(InstructionsOverlay, {
94153
+ children: renderDirectionIcon(directionIcon, directionIconAnimation)
94154
+ }),
94155
+ activeCapturing && /*#__PURE__*/ jsxRuntimeExports.jsx(CapturingOverlay, {})
94156
+ ]
94157
+ }) : null,
94158
+ instructions ? /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
94159
+ children: [
94160
+ /*#__PURE__*/ jsxRuntimeExports.jsx(FaceVerificationInstructions, {
94161
+ top: yFaceVerificationStepsWrapper + 5,
94162
+ className: "instructions",
94163
+ children: instructions
94164
+ }),
94165
+ /*#__PURE__*/ jsxRuntimeExports.jsx(FaceVerificationStepsWrapper, {
94166
+ top: yFaceVerificationStepsWrapper + 35,
94167
+ children: steps.map((step, index)=>{
94168
+ const { name, image: { objUrl } } = step;
94169
+ return /*#__PURE__*/ jsxRuntimeExports.jsx(StepItem, {
94170
+ active: curStepIndex >= index,
94171
+ className: "step-item",
94172
+ children: objUrl ? /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
94173
+ className: "image_preview",
94174
+ src: objUrl,
94175
+ alt: ""
94176
+ }) : /*#__PURE__*/ jsxRuntimeExports.jsx(SelfieStepImageHolder, {
94177
+ stepNumber: index + 1,
94178
+ type: name,
94179
+ theme: theme
94180
+ })
94181
+ }, name);
94182
+ })
94183
+ })
94184
+ ]
94185
+ }) : null
94186
+ ]
94187
+ }) : null,
94188
+ (showLoading || isLoading) && /*#__PURE__*/ jsxRuntimeExports.jsx(LoadingIcon$2, {
94189
+ children: /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
94190
+ src: icLoading,
94191
+ alt: "",
94192
+ className: "spin"
94193
+ })
94194
+ }),
94195
+ remainingTime && /*#__PURE__*/ jsxRuntimeExports.jsx(CountdownTime, {
94196
+ top: yFaceVerificationStepsWrapper - 30,
94197
+ children: remainingTime
94198
+ }),
94199
+ typeof lastErrorMsg === 'string' ? /*#__PURE__*/ jsxRuntimeExports.jsx(SimpleFaceDetectionError, {
94200
+ top: yFaceDetectionError - 15,
94201
+ className: "face-detection-error",
94202
+ children: lastErrorMsg
94203
+ }) : null
94204
+ ]
94205
+ })
94206
+ });
94207
+ }
94208
+ ActiveLivenessV1.propTypes = {
94209
+ apiCheck: PropTypes.bool,
94210
+ onLivenessDetectionDone: PropTypes.func,
94211
+ onClose: PropTypes.func,
94212
+ onError: PropTypes.func,
94213
+ onReset: PropTypes.func,
94214
+ captureFrameSettings: PropTypes.shape({}),
94215
+ onFramesCaptured: PropTypes.func,
94216
+ flipVideoHorizontal: PropTypes.bool,
94217
+ frontCamera: PropTypes.bool,
94218
+ isLoading: PropTypes.bool,
94219
+ customDirectionIcon: PropTypes.shape({}),
94220
+ customStepTimeConstraints: PropTypes.shape({}),
94221
+ onProcessing: PropTypes.func,
94222
+ customErrors: PropTypes.shape({}),
94223
+ apiCredentials: PropTypes.shape({
94224
+ accessKey: PropTypes.string,
94225
+ secretKey: PropTypes.string,
94226
+ apiUrl: PropTypes.string
94227
+ }),
94228
+ outputEncryptionSettings: PropTypes.shape({}),
94229
+ cameraScale: PropTypes.number,
94230
+ defaultCameraId: PropTypes.string,
94231
+ offsetFaceY: PropTypes.number,
94232
+ styledComponent: PropTypes.shape({
94233
+ CloseCameraButton: PropTypes.node
94234
+ }),
94235
+ serviceSettings: PropTypes.shape({})
94236
+ };
94237
+ ActiveLivenessV1.defaultProps = {
94238
+ apiCheck: false,
94239
+ onLivenessDetectionDone: null,
94240
+ onClose: null,
94241
+ onError: ()=>{},
94242
+ onReset: ()=>{},
94243
+ captureFrameSettings: {
94244
+ enable: false,
94245
+ framesIntervalTime: 180,
94246
+ framesBatchLength: 0
94247
+ },
94248
+ onFramesCaptured: ()=>{},
94249
+ flipVideoHorizontal: null,
94250
+ frontCamera: true,
94251
+ isLoading: false,
94252
+ customDirectionIcon: {
94253
+ [ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
94254
+ type: ra$1.FaceDirection.LEFT
94255
+ }),
94256
+ [ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
94257
+ type: ra$1.FaceDirection.RIGHT
94258
+ }),
94259
+ [ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
94260
+ type: ra$1.FaceDirection.UP
94261
+ }),
94262
+ [ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
94263
+ type: ra$1.FaceDirection.FRONTAL
94264
+ })
94265
+ },
94266
+ customStepTimeConstraints: {
94267
+ [ra$1.FaceDirection.UP]: {
94268
+ delayTime: 0
94269
+ },
94270
+ [ra$1.FaceDirection.LEFT]: {
94271
+ delayTime: 0
94272
+ },
94273
+ [ra$1.FaceDirection.RIGHT]: {
94274
+ delayTime: 0
94275
+ },
94276
+ [ra$1.FaceDirection.FRONTAL]: {
94277
+ delayTime: 2000
94278
+ }
94279
+ },
94280
+ onProcessing: ()=>{},
94281
+ customErrors: null,
94282
+ apiCredentials: {
94283
+ accessKey: '',
94284
+ secretKey: '',
94285
+ apiUrl: ''
94286
+ },
94287
+ outputEncryptionSettings: null,
94288
+ cameraScale: 1,
94289
+ defaultCameraId: undefined,
94290
+ offsetFaceY: 0,
94291
+ styledComponent: {
94292
+ CloseCameraButton: null
94293
+ },
94294
+ serviceSettings: {
94295
+ enableUploadFrames: true,
94296
+ enableUploadImages: true,
94297
+ enableVerifySanityPortrait: true,
94298
+ enableVerifySanityIDCard: true,
94299
+ enableVerifyFaceLiveness: true,
94300
+ enableDetectIDCardTampering: true,
94301
+ enableReadIDCardInfo: true
94302
+ }
94303
+ };
94304
+
94305
+ // To reduce the calculation for blazeface
94306
+ const videoSettings = libExports.isMobile ? {
94307
+ width: {
94308
+ ideal: 640
94309
+ }
94310
+ } : null;
94311
+ // eslint-disable-next-line react/require-default-props
94312
+ function PassiveLivenessOldV1(props) {
94313
+ const { apiCheck, onLivenessDetectionDone, captureFrameSettings, onFramesCaptured, frontCamera, flipVideoHorizontal, customDirectionIcon, customStepTimeConstraints, onProcessing, customErrors, apiCredentials, outputEncryptionSettings, cameraScale, defaultCameraId, passiveModeAuto, offsetFaceY, styledComponent, serviceSettings, onReset, isLoading } = props;
94314
+ const theme = nt$2();
94315
+ const { onErrorCallback, onCloseCallback } = useSDKCallback();
94316
+ const bgCameraMask = iH.useAsset('bg_camera_mask.png');
94317
+ const bgCameraMaskRed = iH.useAsset('bg_camera_mask_red.png');
94318
+ const icLoading = useThemeIcon('IDCapturing.loadingIcon.src', 'ic_loading.gif');
94319
+ const [uiSpacing, setUISpacing] = reactExports.useState({});
94320
+ const { yFaceDetectionError, yFaceVerificationStepsWrapper } = uiSpacing;
94321
+ const [remainingTime, setRemainingTime] = reactExports.useState('');
94322
+ const [currentOrientation, setCurrentOrientation] = reactExports.useState();
94323
+ const surroundStyle = reactExports.useMemo(()=>({
94324
+ backgroundColor: getTheme('Selfie.backgroundColor')({
94325
+ theme
94326
+ })
94327
+ }), [
94328
+ theme
94329
+ ]);
94330
+ const cropAreaDimension = reactExports.useCallback(({ lostY, height, clientHeight })=>{
94331
+ const yFaceDetectionErrorNew = lostY + 25;
94332
+ const yCropAreaNew = yFaceDetectionErrorNew + 30;
94333
+ const yFaceVerificationStepsWrapperNew = yCropAreaNew + height + 20;
94334
+ setUISpacing({
94335
+ yFaceDetectionError: yFaceDetectionErrorNew,
94336
+ yFaceVerificationStepsWrapper: yFaceVerificationStepsWrapperNew
94337
+ });
94338
+ const topLimit = Math.floor(lostY);
94339
+ const botLimit = Math.floor(clientHeight - lostY);
94340
+ let y = Math.floor(yCropAreaNew); // floor the y value to avoid blur line on ios safari
94341
+ if (offsetFaceY !== 0 && (y + offsetFaceY < topLimit || y + offsetFaceY + height > botLimit)) {
94342
+ onErrorCallback({
94343
+ code: `offsetFaceY must be in [-${y - topLimit}, ${botLimit - height - y}]`
94344
+ });
94345
+ } else {
94346
+ y += offsetFaceY;
94347
+ }
94348
+ return {
94349
+ y
94350
+ };
94351
+ }, [
94352
+ offsetFaceY,
94353
+ onErrorCallback
94354
+ ]);
94355
+ const { shouldResetFlowOnOrientationChange, countdownToTakePicture, cropArea, curStepIndex, faceDetectionError, resetFlow, handleTriggerPassiveMode, handleVideoPlayed, refVideo, showCountdown, steps, refIsReseting, videoPlayed, warmupDone, showCaptureButton, shouldShowCountdown, showLoading } = usePassiveLiveness({
94356
+ currentOrientation,
94357
+ apiCheck,
94358
+ bgCameraMask,
94359
+ bgCameraMaskRed,
94360
+ surroundStyle,
94361
+ onLivenessDetectionDone,
94362
+ onError: onErrorCallback,
94363
+ cropAreaDimension,
94364
+ customDirectionIcon,
94365
+ captureFrameSettings,
94366
+ onFramesCaptured,
94367
+ setRemainingTime,
94368
+ customStepTimeConstraints,
94369
+ onProcessing,
94370
+ customErrors,
94371
+ apiCredentials,
94372
+ outputEncryptionSettings,
94373
+ cameraScale,
94374
+ passiveModeAuto,
94375
+ serviceSettings,
94376
+ onReset
94377
+ });
94378
+ reactExports.useEffect(()=>{
94379
+ if (typeof steps[0]?.directionIcon === 'string') {
94380
+ Promise.all(steps.map((step)=>preloadImage(step.directionIcon)));
94381
+ }
94382
+ }, [
94383
+ steps
94384
+ ]);
94385
+ const { CloseCameraButton } = styledComponent;
94386
+ const progressCircleProps = getProgressCircleProps(props, theme);
94387
+ const currentProgress = !refIsReseting.current ? curStepIndex / steps.length * 100 : 0;
94388
+ // for error text
94389
+ const { lang } = no$1.useSDKSettings();
94390
+ const timer = reactExports.useRef(0);
94391
+ const lastError = reactExports.useRef({});
94392
+ const duration = reactExports.useRef(ra$1.ErrorDuration.SHORT);
94393
+ const lastErrorMsg = reactExports.useMemo(()=>{
94394
+ const { msg, duration: errorDuration = ra$1.ErrorDuration.SHORT } = faceDetectionError || {};
94395
+ const errorMsg = msg?.[lang];
94396
+ if (Date.now() - timer.current >= duration.current) {
94397
+ timer.current = Date.now();
94398
+ duration.current = errorDuration;
94399
+ lastError.current = errorMsg;
94400
+ }
94401
+ return lastError.current;
94402
+ // eslint-disable-next-line react-hooks/exhaustive-deps
94403
+ }, [
94404
+ faceDetectionError,
94405
+ curStepIndex
94406
+ ]); // curStepIndex is used to get the latest error when reset flow
94407
+ const onOrientationChange = reactExports.useCallback((curOrientation)=>{
94408
+ setCurrentOrientation(curOrientation);
94409
+ if (!shouldResetFlowOnOrientationChange) {
94410
+ if (curOrientation === MODE.LANDSCAPE) {
94411
+ refVideo.current?.pause();
94412
+ } else {
94413
+ refVideo.current?.play();
94414
+ }
94415
+ } else {
94416
+ resetFlow();
94417
+ }
94418
+ }, [
94419
+ refVideo,
94420
+ resetFlow,
94421
+ shouldResetFlowOnOrientationChange
94422
+ ]);
94423
+ return /*#__PURE__*/ jsxRuntimeExports.jsx(OrientationDetection, {
94424
+ onOrientationChange: onOrientationChange,
94425
+ children: /*#__PURE__*/ jsxRuntimeExports.jsxs(Camera$1, {
94426
+ frontCamera: frontCamera,
94427
+ onVideoPlayed: handleVideoPlayed,
94428
+ onClose: onCloseCallback,
94429
+ flipHorizontal: flipVideoHorizontal ?? frontCamera,
94430
+ ref: refVideo,
94431
+ videoSettings: videoSettings,
94432
+ onError: onErrorCallback,
94433
+ scale: cameraScale,
94434
+ defaultCameraId: defaultCameraId,
94435
+ closeButton: CloseCameraButton || null,
94436
+ children: [
94437
+ !warmupDone && /*#__PURE__*/ jsxRuntimeExports.jsx(WarmupPopup, {}),
94438
+ videoPlayed ? /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
94439
+ children: [
94440
+ typeof lastErrorMsg === 'string' ? /*#__PURE__*/ jsxRuntimeExports.jsx(SimpleFaceDetectionError, {
94441
+ top: yFaceDetectionError - 15,
94442
+ className: "face-detection-error",
94443
+ children: lastErrorMsg
94444
+ }) : null,
94445
+ cropArea.current ? /*#__PURE__*/ jsxRuntimeExports.jsxs(CropAreaOverlayWrapper, {
94446
+ x: `${cropArea.current.x}px`,
94447
+ y: `${cropArea.current.y}px`,
94448
+ width: `${cropArea.current.width}px`,
94449
+ height: `${cropArea.current.height}px`,
94450
+ surroundStyle: cropArea.current.surroundStyle,
94451
+ children: [
94452
+ /*#__PURE__*/ jsxRuntimeExports.jsx(StyledCameraMark, {}),
94453
+ /*#__PURE__*/ jsxRuntimeExports.jsx(OverlayProgressCircle, {
94454
+ ...progressCircleProps,
94455
+ progress: currentProgress,
94456
+ showErrorRing: !!faceDetectionError && getTheme('Selfie.progressCircle.showErrorRing')({
94457
+ theme
94458
+ })
94459
+ }),
94460
+ shouldShowCountdown ? /*#__PURE__*/ jsxRuntimeExports.jsx(CountDownOverlay, {
94461
+ children: countdownToTakePicture
94462
+ }) : null,
94463
+ faceDetectionError && /*#__PURE__*/ jsxRuntimeExports.jsx(ErrorOverlay$1, {})
94464
+ ]
94465
+ }) : null,
94466
+ remainingTime && /*#__PURE__*/ jsxRuntimeExports.jsx(CountdownTime, {
94467
+ top: yFaceVerificationStepsWrapper - 30,
94468
+ children: remainingTime
94469
+ }),
94470
+ showCaptureButton ? /*#__PURE__*/ jsxRuntimeExports.jsx(BottomButtonsOverlay, {
94471
+ children: /*#__PURE__*/ jsxRuntimeExports.jsx(Button$4, {
94472
+ onClick: handleTriggerPassiveMode,
94473
+ disabled: showCountdown,
94474
+ children: get(theme, 'Selfie.captureIcon.src') ? /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
94475
+ src: get(theme, 'Selfie.captureIcon.src'),
94476
+ alt: ""
94477
+ }) : /*#__PURE__*/ jsxRuntimeExports.jsx(CameraIcon, {
94478
+ fillColor: "rgba(193, 197, 204, 1)"
94479
+ })
94480
+ })
94481
+ }) : null
94482
+ ]
94483
+ }) : null,
94484
+ (showLoading || isLoading) && /*#__PURE__*/ jsxRuntimeExports.jsx(LoadingIcon$2, {
94485
+ children: /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
94486
+ src: icLoading,
94487
+ alt: ""
94488
+ })
94489
+ })
94490
+ ]
94491
+ })
94492
+ });
94493
+ }
94494
+ PassiveLivenessOldV1.propTypes = {
94495
+ apiCheck: PropTypes.bool,
94496
+ mode: PropTypes.string,
94497
+ onLivenessDetectionDone: PropTypes.func,
94498
+ onClose: PropTypes.func,
94499
+ onError: PropTypes.func,
94500
+ onReset: PropTypes.func,
94501
+ captureFrameSettings: PropTypes.shape({}),
94502
+ onFramesCaptured: PropTypes.func,
94503
+ frontCamera: PropTypes.bool,
94504
+ isLoading: PropTypes.bool,
94505
+ flipVideoHorizontal: PropTypes.bool,
94506
+ customDirectionIcon: PropTypes.shape({}),
94507
+ customStepTimeConstraints: PropTypes.shape({}),
94508
+ onProcessing: PropTypes.func,
94509
+ customErrors: PropTypes.shape({}),
94510
+ apiCredentials: PropTypes.shape({
94511
+ accessKey: PropTypes.string,
94512
+ secretKey: PropTypes.string,
94513
+ apiUrl: PropTypes.string
94514
+ }),
94515
+ outputEncryptionSettings: PropTypes.shape({}),
94516
+ cameraScale: PropTypes.number,
94517
+ defaultCameraId: PropTypes.string,
94518
+ passiveModeAuto: PropTypes.bool,
94519
+ offsetFaceY: PropTypes.number,
94520
+ styledComponent: PropTypes.shape({
94521
+ CloseCameraButton: PropTypes.node
94522
+ }),
94523
+ serviceSettings: PropTypes.shape({})
94524
+ };
94525
+ PassiveLivenessOldV1.defaultProps = {
94526
+ apiCheck: false,
94527
+ mode: null,
94528
+ onLivenessDetectionDone: null,
94529
+ onClose: null,
94530
+ onError: ()=>{},
94531
+ onReset: ()=>{},
94532
+ captureFrameSettings: {
94533
+ enable: false,
94534
+ framesIntervalTime: 180,
94535
+ framesBatchLength: 0
94536
+ },
94537
+ onFramesCaptured: ()=>{},
94538
+ frontCamera: true,
94539
+ isLoading: false,
94540
+ flipVideoHorizontal: null,
94541
+ customDirectionIcon: {
94542
+ [ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
94543
+ type: ra$1.FaceDirection.LEFT
94544
+ }),
94545
+ [ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
94546
+ type: ra$1.FaceDirection.RIGHT
94547
+ }),
94548
+ [ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
94549
+ type: ra$1.FaceDirection.UP
94550
+ }),
94551
+ [ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
94552
+ type: ra$1.FaceDirection.FRONTAL
94553
+ })
94554
+ },
94555
+ customStepTimeConstraints: {
94556
+ [ra$1.FaceDirection.UP]: {
94557
+ delayTime: 0
94558
+ },
94559
+ [ra$1.FaceDirection.LEFT]: {
94560
+ delayTime: 0
94561
+ },
94562
+ [ra$1.FaceDirection.RIGHT]: {
94563
+ delayTime: 0
94564
+ },
94565
+ [ra$1.FaceDirection.FRONTAL]: {
94566
+ delayTime: 2000
94567
+ }
94568
+ },
94569
+ onProcessing: ()=>{},
94570
+ customErrors: null,
94571
+ apiCredentials: {
94572
+ accessKey: '',
94573
+ secretKey: '',
94574
+ apiUrl: ''
94575
+ },
94576
+ outputEncryptionSettings: null,
94577
+ cameraScale: 1,
94578
+ defaultCameraId: undefined,
94579
+ passiveModeAuto: false,
94580
+ offsetFaceY: 0,
94581
+ styledComponent: {
94582
+ CloseCameraButton: null
94583
+ },
94584
+ serviceSettings: {
94585
+ enableUploadFrames: true,
94586
+ enableUploadImages: true,
94587
+ enableVerifySanityPortrait: true,
94588
+ enableVerifySanityIDCard: true,
94589
+ enableVerifyFaceLiveness: true,
94590
+ enableDetectIDCardTampering: true,
94591
+ enableReadIDCardInfo: true
94592
+ }
94593
+ };
94594
+
93876
94595
  const withClientSettings$1 = (Component)=>{
93877
94596
  return function WrappedComponent(props) {
93878
94597
  const { apiCheck, apiCredentials, serviceSettings, flowId, clientSettings } = props;
@@ -93888,16 +94607,20 @@
93888
94607
  });
93889
94608
  };
93890
94609
  };
93891
- const getLivenessModeComponent = (mode, CustomLivenessDetection)=>{
94610
+ const getLivenessModeComponent = (mode, CustomLivenessDetection, themeVersion)=>{
93892
94611
  let LivenessDetectionComponent = ActiveLiveness;
93893
94612
  if (mode === ra$1.Mode.ACTIVE) {
93894
- LivenessDetectionComponent = CustomLivenessDetection?.ActiveLiveness ?? ActiveLiveness;
94613
+ const DefaultActiveLiveness = themeVersion === 'v1' ? ActiveLivenessV1 : ActiveLiveness;
94614
+ LivenessDetectionComponent = CustomLivenessDetection?.ActiveLiveness ?? DefaultActiveLiveness;
93895
94615
  }
93896
94616
  if (mode === ra$1.Mode.PASSIVE_V2) {
93897
94617
  LivenessDetectionComponent = CustomLivenessDetection?.PassiveLivenessV2 ?? PassiveLiveness;
93898
94618
  }
93899
94619
  if (mode === ra$1.Mode.PASSIVE) {
93900
- LivenessDetectionComponent = CustomLivenessDetection?.PassiveLiveness ?? PassiveLiveness$1;
94620
+ // PassiveLivenessOldV1 to not be confused with PassiveLivenessV2 (which is totally new mode)
94621
+ // PassiveLivenessOldV1 refers to PassiveLiveness with themeVersion = "v1"
94622
+ const DefaultPassiveLiveness = themeVersion === 'v1' ? PassiveLivenessOldV1 : PassiveLiveness$1;
94623
+ LivenessDetectionComponent = CustomLivenessDetection?.PassiveLiveness ?? DefaultPassiveLiveness;
93901
94624
  }
93902
94625
  if (typeof mode === 'string' && mode.startsWith('flash')) {
93903
94626
  LivenessDetectionComponent = CustomLivenessDetection?.FlashLiveness ?? FlashLiveness;
@@ -93910,7 +94633,7 @@
93910
94633
  }, livenessComponent: CustomLivenessDetection, customTheme = {}, customTexts, ...props } = livenessProps;
93911
94634
  const { mode, flowId, onError: onErrorFromProp, onClose: onCloseFromProp, debug, onLivenessDetectionDone } = props;
93912
94635
  const clientSettings = useClientSettings();
93913
- const { billingSettings: clientBillingSettings, enableBilling } = no$1.useSDKSettings();
94636
+ const { billingSettings: clientBillingSettings, enableBilling, themeVersion } = no$1.useSDKSettings();
93914
94637
  const billingSettingsFromSdkSettings = dD.getWebSetting(clientSettings, 'data.settings.sdk_settings.billing_settings.billing_config');
93915
94638
  const billingUrl = dD.getWebSetting(clientSettings, 'data.settings.sdk_settings.billing_settings.url');
93916
94639
  const { submitBilling } = gR({
@@ -93996,7 +94719,7 @@
93996
94719
  billingInput,
93997
94720
  onCloseFromProp
93998
94721
  ]);
93999
- const LivenessDetectionComponent = getLivenessModeComponent(mode, CustomLivenessDetection);
94722
+ const LivenessDetectionComponent = getLivenessModeComponent(mode, CustomLivenessDetection, themeVersion);
94000
94723
  return /*#__PURE__*/ jsxRuntimeExports.jsx(DebugProvider, {
94001
94724
  debug: debug,
94002
94725
  children: /*#__PURE__*/ jsxRuntimeExports.jsx(SDKCallbackProvider, {
@@ -112760,7 +113483,7 @@
112760
113483
  };
112761
113484
  };
112762
113485
 
112763
- const defaultAssetRoot = "https://vision-cdn.trustingsocial.com/tvweb-sdk.platform/0.0.0-beta.20251215-093759/assets";
113486
+ const defaultAssetRoot = "https://vision-cdn.trustingsocial.com/tvweb-sdk.platform/0.0.0-beta.20251215-170414/assets";
112764
113487
  class TVWebSDK extends gU {
112765
113488
  constructor(props){
112766
113489
  super({