@tsocial/tvweb-sdk.nbcci 0.0.0-beta.20251215-093759 → 0.0.0-beta.20251215-165409

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-165409";
33774
33787
  }
33775
33788
  function nI$1() {
33776
33789
  return {
@@ -41246,49 +41259,56 @@
41246
41259
  }, uz;
41247
41260
  }(), uG);
41248
41261
  }();
41249
- function dm() {
41262
+ let dm = d_, dg = d_, dy = db();
41263
+ for(;;)try {
41264
+ if (parseInt(dg(378)) / 1 + -parseInt(dg(391)) / 2 * (-parseInt(dg(386)) / 3) + parseInt(dg(380)) / 4 * (parseInt(dg(384)) / 5) + -parseInt(dg(381)) / 6 + -parseInt(dg(383)) / 7 * (-parseInt(dg(377)) / 8) + -parseInt(dg(379)) / 9 + -parseInt(dg(367)) / 10 * (-parseInt(dg(372)) / 11) === 229615) break;
41265
+ dy.push(dy.shift());
41266
+ } catch (e) {
41267
+ dy.push(dy.shift());
41268
+ }
41269
+ function db() {
41250
41270
  let e = [
41251
- "391796qAHBQP",
41252
- "2a8648ce3d",
41253
- "ZIzj0CAQYI",
41271
+ "25310HBUOBg",
41272
+ "DepBO8t60S",
41273
+ "MFkwEwYHKo",
41274
+ "3059301306",
41275
+ "+faHkP3QC3",
41276
+ "407Ilvdnt",
41277
+ "44P0rKKsZK",
41278
+ "3d02010608",
41254
41279
  "ytJdcsPxrD",
41255
- "44160GNFAeO",
41256
- "758970ENfGty",
41280
+ "D9EKOWS+U4",
41281
+ "14552FNqEza",
41282
+ "101165gbwSGf",
41283
+ "3599838cBdphG",
41284
+ "96444qpbkcR",
41285
+ "671448TAUmcs",
41286
+ "072a8648ce",
41287
+ "532kymtpA",
41288
+ "45uWuFYC",
41257
41289
  "MfPrcYTM70",
41258
- "44P0rKKsZK",
41259
- "MFkwEwYHKo",
41290
+ "6ocbIJZ",
41260
41291
  "000",
41261
- "120612DuHKxu",
41262
- "DepBO8t60S",
41263
- "3059301306",
41264
- "ssRdXLZEX8",
41292
+ "0301070342",
41293
+ "KoZIzj0DAQ",
41294
+ "ZIzj0CAQYI",
41295
+ "191450lvsUWR",
41296
+ "2a8648ce3d",
41265
41297
  "cDQgAE9h6Z",
41266
- "2919fSUnYj",
41267
- "9720kJycIQ",
41268
- "+faHkP3QC3",
41269
- "212094GlWFgW",
41270
- "KA==",
41271
- "315786GasSwN"
41298
+ "KA=="
41272
41299
  ];
41273
- return (dm = function() {
41300
+ return (db = function() {
41274
41301
  return e;
41275
41302
  })();
41276
41303
  }
41277
- let dg = d_, dy = d_, db = dm();
41278
- 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());
41281
- } catch (e) {
41282
- db.push(db.shift());
41283
- }
41284
- let dv = dg(307) + "072a8648ce3d02010608" + dg(296) + "0301070342" + dg(304);
41304
+ let dv = dm(370) + dm(382) + dm(374) + dm(392) + dm(388) + dm(387);
41285
41305
  function d_(e, t) {
41286
- let r = dm();
41306
+ let r = db();
41287
41307
  return (d_ = function(e, t) {
41288
- return r[e -= 288];
41308
+ return r[e -= 366];
41289
41309
  })(e, t);
41290
41310
  }
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);
41311
+ let dx = dm(369) + dm(390) + dm(389) + dm(393) + dm(368) + dm(375) + dm(371) + dm(373) + "Mjci1ul8mm" + dm(376) + dm(385) + "ssRdXLZEX8" + dm(366);
41292
41312
  async function dC(e) {
41293
41313
  let t = new TextEncoder().encode(e);
41294
41314
  return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256", t))).map((e)=>e.toString(16).padStart(2, "0")).join("");
@@ -43355,7 +43375,8 @@
43355
43375
  "x-request-id": e,
43356
43376
  ...r
43357
43377
  },
43358
- fallbackUrls: c
43378
+ fallbackUrls: c,
43379
+ requestTimeoutMs: 6e4
43359
43380
  }), {
43360
43381
  onDone: n
43361
43382
  });
@@ -43384,7 +43405,8 @@
43384
43405
  "x-request-id": l,
43385
43406
  ...r
43386
43407
  },
43387
- fallbackUrls: s
43408
+ fallbackUrls: s,
43409
+ requestTimeoutMs: 6e4
43388
43410
  }), {
43389
43411
  onDone: ()=>{}
43390
43412
  });
@@ -90516,7 +90538,7 @@
90516
90538
  }
90517
90539
  };
90518
90540
 
90519
- const videoSettings$3 = libExports.isMobile ? {
90541
+ const videoSettings$5 = libExports.isMobile ? {
90520
90542
  // aspectRatio: 16 / 9,
90521
90543
  width: {
90522
90544
  ideal: 640
@@ -91295,7 +91317,7 @@
91295
91317
  flipHorizontal: frontCamera,
91296
91318
  ref: videoRef,
91297
91319
  onError: onErrorCallback,
91298
- videoSettings: videoSettings$3,
91320
+ videoSettings: videoSettings$5,
91299
91321
  closeButton: /*#__PURE__*/ jsxRuntimeExports.jsx(CloseIcon, {}),
91300
91322
  children: /*#__PURE__*/ jsxRuntimeExports.jsxs(WarmUpOverlay, {
91301
91323
  overlay: !warmupDone || !isPlaying,
@@ -91857,11 +91879,11 @@
91857
91879
  extraConfig: null
91858
91880
  };
91859
91881
 
91860
- const DirectionalIcon = dt$1.img`
91882
+ const DirectionalIcon$1 = dt$1.img`
91861
91883
  width: ${({ width })=>width};
91862
91884
  `;
91863
91885
  // eslint-disable-next-line react/require-default-props
91864
- function DirectionIcon({ type }) {
91886
+ function DirectionIcon$1({ type }) {
91865
91887
  const theme = nt$2();
91866
91888
  // default icons and widths based on version
91867
91889
  const iconDirection = useThemeIcon(`Selfie.Active.directionIcon.${type}`, `${type}_arrow.gif`);
@@ -91878,7 +91900,7 @@
91878
91900
  if (type === ra$1.FaceDirection.FRONTAL) {
91879
91901
  // For frontal direction, use the SVG icon if available
91880
91902
  if (frontalIcon) {
91881
- return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon, {
91903
+ return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon$1, {
91882
91904
  src: frontalIcon,
91883
91905
  width: iconWidth,
91884
91906
  alt: ""
@@ -91886,20 +91908,20 @@
91886
91908
  }
91887
91909
  }
91888
91910
  if (directionIconSrc && directionIconSrc !== null) {
91889
- return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon, {
91911
+ return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon$1, {
91890
91912
  src: get(theme, `Selfie.Active.directionIcon.${type}`),
91891
91913
  width: iconWidth,
91892
91914
  alt: ""
91893
91915
  });
91894
91916
  }
91895
91917
  // fallback to default icons and width
91896
- return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon, {
91918
+ return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon$1, {
91897
91919
  src: iconDirection,
91898
91920
  alt: "",
91899
91921
  width: iconWidth
91900
91922
  });
91901
91923
  }
91902
- DirectionIcon.propTypes = {
91924
+ DirectionIcon$1.propTypes = {
91903
91925
  type: PropTypes.oneOf([
91904
91926
  ra$1.FaceDirection.LEFT,
91905
91927
  ra$1.FaceDirection.RIGHT,
@@ -91907,12 +91929,12 @@
91907
91929
  ra$1.FaceDirection.FRONTAL
91908
91930
  ])
91909
91931
  };
91910
- DirectionIcon.defaultProps = {
91932
+ DirectionIcon$1.defaultProps = {
91911
91933
  type: ra$1.FaceDirection.LEFT
91912
91934
  };
91913
91935
 
91914
91936
  // To reduce the calculation for blazeface
91915
- const videoSettings$2 = libExports.isMobile ? {
91937
+ const videoSettings$4 = libExports.isMobile ? {
91916
91938
  width: {
91917
91939
  ideal: 640
91918
91940
  }
@@ -92037,7 +92059,7 @@
92037
92059
  onClose: onCloseCallback,
92038
92060
  flipHorizontal: flipVideoHorizontal ?? frontCamera,
92039
92061
  ref: refVideo,
92040
- videoSettings: videoSettings$2,
92062
+ videoSettings: videoSettings$4,
92041
92063
  onError: onErrorCallback,
92042
92064
  scale: cameraScale,
92043
92065
  defaultCameraId: defaultCameraId,
@@ -92148,16 +92170,16 @@
92148
92170
  isLoading: false,
92149
92171
  flipVideoHorizontal: null,
92150
92172
  customDirectionIcon: {
92151
- [ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
92173
+ [ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
92152
92174
  type: ra$1.FaceDirection.LEFT
92153
92175
  }),
92154
- [ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
92176
+ [ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
92155
92177
  type: ra$1.FaceDirection.RIGHT
92156
92178
  }),
92157
- [ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
92179
+ [ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
92158
92180
  type: ra$1.FaceDirection.UP
92159
92181
  }),
92160
- [ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
92182
+ [ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
92161
92183
  type: ra$1.FaceDirection.FRONTAL
92162
92184
  })
92163
92185
  },
@@ -92535,7 +92557,7 @@
92535
92557
  });
92536
92558
  }
92537
92559
 
92538
- const videoSettings$1 = libExports.isMobile ? {
92560
+ const videoSettings$3 = libExports.isMobile ? {
92539
92561
  // aspectRatio: 16 / 9,
92540
92562
  width: {
92541
92563
  ideal: 640
@@ -93068,7 +93090,7 @@
93068
93090
  flipHorizontal: frontCamera,
93069
93091
  ref: videoRef,
93070
93092
  onError: onErrorCallback,
93071
- videoSettings: videoSettings$1,
93093
+ videoSettings: videoSettings$3,
93072
93094
  closeButton: /*#__PURE__*/ jsxRuntimeExports.jsx(CloseIcon, {}),
93073
93095
  children: /*#__PURE__*/ jsxRuntimeExports.jsxs(WarmUpOverlay, {
93074
93096
  overlay: !warmupDone || !isPlaying,
@@ -93410,13 +93432,13 @@
93410
93432
  };
93411
93433
 
93412
93434
  // To reduce the calculation for blazeface
93413
- const videoSettings = libExports.isMobile ? {
93435
+ const videoSettings$2 = libExports.isMobile ? {
93414
93436
  width: {
93415
93437
  ideal: 640
93416
93438
  }
93417
93439
  } : null;
93418
93440
  // eslint-disable-next-line react/prop-types, consistent-return
93419
- const SelfieStepImageHolder = ({ stepNumber, type, theme })=>{
93441
+ const SelfieStepImageHolder$1 = ({ stepNumber, type, theme })=>{
93420
93442
  const imageHolderIcon = useDefaultThemeIcon(`instruction_${type}.svg`);
93421
93443
  // prioritize custom theme icons
93422
93444
  const customHolderSrc = get(theme, `Selfie.Active.imageHolder.${type}`);
@@ -93441,7 +93463,7 @@
93441
93463
  alt: ""
93442
93464
  });
93443
93465
  };
93444
- function renderDirectionIcon(directionIcon, directionIconAnimation) {
93466
+ function renderDirectionIcon$1(directionIcon, directionIconAnimation) {
93445
93467
  if (!directionIcon) return null;
93446
93468
  if (typeof directionIcon === 'string') {
93447
93469
  return /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
@@ -93586,7 +93608,7 @@
93586
93608
  onClose: onCloseCallback,
93587
93609
  flipHorizontal: flipVideoHorizontal ?? frontCamera,
93588
93610
  ref: refVideo,
93589
- videoSettings: videoSettings,
93611
+ videoSettings: videoSettings$2,
93590
93612
  onError: onErrorCallback,
93591
93613
  scale: cameraScale,
93592
93614
  defaultCameraId: defaultCameraId,
@@ -93611,7 +93633,7 @@
93611
93633
  showErrorRing: !!faceDetectionError
93612
93634
  }),
93613
93635
  /*#__PURE__*/ jsxRuntimeExports.jsx(InstructionsOverlay, {
93614
- children: renderDirectionIcon(directionIcon, directionIconAnimation)
93636
+ children: renderDirectionIcon$1(directionIcon, directionIconAnimation)
93615
93637
  }),
93616
93638
  activeCapturing && /*#__PURE__*/ jsxRuntimeExports.jsx(CapturingOverlay, {})
93617
93639
  ]
@@ -93634,7 +93656,7 @@
93634
93656
  className: "image_preview",
93635
93657
  src: objUrl,
93636
93658
  alt: ""
93637
- }) : /*#__PURE__*/ jsxRuntimeExports.jsx(SelfieStepImageHolder, {
93659
+ }) : /*#__PURE__*/ jsxRuntimeExports.jsx(SelfieStepImageHolder$1, {
93638
93660
  stepNumber: index + 1,
93639
93661
  type: name,
93640
93662
  theme: theme
@@ -93725,16 +93747,16 @@
93725
93747
  frontCamera: true,
93726
93748
  isLoading: false,
93727
93749
  customDirectionIcon: {
93728
- [ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
93750
+ [ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
93729
93751
  type: ra$1.FaceDirection.LEFT
93730
93752
  }),
93731
- [ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
93753
+ [ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
93732
93754
  type: ra$1.FaceDirection.RIGHT
93733
93755
  }),
93734
- [ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
93756
+ [ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
93735
93757
  type: ra$1.FaceDirection.UP
93736
93758
  }),
93737
- [ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
93759
+ [ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
93738
93760
  type: ra$1.FaceDirection.FRONTAL
93739
93761
  })
93740
93762
  },
@@ -93862,6 +93884,706 @@
93862
93884
  };
93863
93885
  const useWrapIndicator = ()=>reactExports.useContext(WrapIndicatorContext);
93864
93886
 
93887
+ const DirectionalIcon = dt$1.img`
93888
+ width: ${({ width })=>width};
93889
+ `;
93890
+ // eslint-disable-next-line react/require-default-props
93891
+ function DirectionIcon({ type }) {
93892
+ const theme = nt$2();
93893
+ // default icons and widths based on version
93894
+ const iconDirection = useThemeIcon(`Selfie.Active.directionIcon.${type}`, `${type}_arrow.gif`);
93895
+ const iconWidth = getTheme(`Selfie.Active.directionIcon.${type}Width`)({
93896
+ theme
93897
+ });
93898
+ // prioritize custom theme icons
93899
+ const directionIconSrc = get(theme, `Selfie.Active.directionIcon.${type}`);
93900
+ if (directionIconSrc === null) {
93901
+ // eslint-disable-next-line react/jsx-no-useless-fragment
93902
+ return /*#__PURE__*/ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
93903
+ }
93904
+ if (directionIconSrc && directionIconSrc !== null) {
93905
+ return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon, {
93906
+ src: get(theme, `Selfie.Active.directionIcon.${type}`),
93907
+ width: iconWidth,
93908
+ alt: ""
93909
+ });
93910
+ }
93911
+ // fallback to default icons and width
93912
+ return /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionalIcon, {
93913
+ src: iconDirection,
93914
+ alt: "",
93915
+ width: iconWidth
93916
+ });
93917
+ }
93918
+ DirectionIcon.propTypes = {
93919
+ type: PropTypes.oneOf([
93920
+ ra$1.FaceDirection.LEFT,
93921
+ ra$1.FaceDirection.RIGHT,
93922
+ ra$1.FaceDirection.UP,
93923
+ ra$1.FaceDirection.FRONTAL
93924
+ ])
93925
+ };
93926
+ DirectionIcon.defaultProps = {
93927
+ type: ra$1.FaceDirection.LEFT
93928
+ };
93929
+
93930
+ // To reduce the calculation for blazeface
93931
+ const videoSettings$1 = libExports.isMobile ? {
93932
+ width: {
93933
+ ideal: 640
93934
+ }
93935
+ } : null;
93936
+ // eslint-disable-next-line react/prop-types, consistent-return
93937
+ const SelfieStepImageHolder = ({ stepNumber, type, theme })=>{
93938
+ const imageHolderIcon = useDefaultThemeIcon(`instruction_${type}.svg`);
93939
+ // prioritize custom theme icons
93940
+ const customHolderSrc = get(theme, `Selfie.Active.imageHolder.${type}`);
93941
+ if (customHolderSrc === null) {
93942
+ // eslint-disable-next-line react/jsx-no-useless-fragment
93943
+ return /*#__PURE__*/ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
93944
+ }
93945
+ if (typeof customHolderSrc === 'string' && customHolderSrc !== '') {
93946
+ return /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
93947
+ src: customHolderSrc,
93948
+ alt: ""
93949
+ });
93950
+ }
93951
+ // v1: use step number
93952
+ if (get(theme, 'themeVersion') === 'v1') {
93953
+ return /*#__PURE__*/ jsxRuntimeExports.jsx("span", {
93954
+ children: stepNumber
93955
+ });
93956
+ }
93957
+ return /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
93958
+ src: imageHolderIcon,
93959
+ alt: ""
93960
+ });
93961
+ };
93962
+ function renderDirectionIcon(directionIcon, directionIconAnimation) {
93963
+ if (!directionIcon) return null;
93964
+ if (typeof directionIcon === 'string') {
93965
+ return /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
93966
+ className: directionIconAnimation,
93967
+ src: directionIcon,
93968
+ alt: "",
93969
+ style: {
93970
+ maxWidth: '98px',
93971
+ maxHeight: '98px',
93972
+ marginBottom: '25px'
93973
+ }
93974
+ });
93975
+ }
93976
+ return directionIcon;
93977
+ }
93978
+ // eslint-disable-next-line react/require-default-props
93979
+ function ActiveLivenessV1(props) {
93980
+ const { apiCheck, onLivenessDetectionDone, captureFrameSettings, onFramesCaptured, frontCamera, flipVideoHorizontal, customDirectionIcon, customStepTimeConstraints, onProcessing, customErrors, apiCredentials, outputEncryptionSettings, cameraScale, defaultCameraId, offsetFaceY, styledComponent, isLoading, serviceSettings, onReset } = props;
93981
+ const theme = nt$2();
93982
+ const { onErrorCallback, onCloseCallback } = useSDKCallback();
93983
+ const bgCameraMask = iH.useAsset('bg_camera_mask.png');
93984
+ const bgCameraMaskRed = iH.useAsset('bg_camera_mask_red.png');
93985
+ const icLoading = useThemeIcon('IDCapturing.loadingIcon.src', 'ic_loading.gif');
93986
+ const [uiSpacing, setUISpacing] = reactExports.useState({});
93987
+ const { yFaceVerificationStepsWrapper, yFaceDetectionError } = uiSpacing;
93988
+ const [remainingTime, setRemainingTime] = reactExports.useState('');
93989
+ const [currentOrientation, setCurrentOrientation] = reactExports.useState();
93990
+ const surroundStyle = reactExports.useMemo(()=>({
93991
+ backgroundColor: getTheme('Selfie.backgroundColor')({
93992
+ theme
93993
+ })
93994
+ }), [
93995
+ theme
93996
+ ]);
93997
+ // preload icons
93998
+ usePreloadThemeAsset(get(theme, 'themeVersion'), 'up_arrow.gif');
93999
+ usePreloadThemeAsset(get(theme, 'themeVersion'), 'left_arrow.gif');
94000
+ usePreloadThemeAsset(get(theme, 'themeVersion'), 'right_arrow.gif');
94001
+ usePreloadThemeAsset(get(theme, 'themeVersion'), 'frontal_arrow.gif');
94002
+ usePreloadThemeAsset(get(theme, 'themeVersion'), 'instruction_up.svg');
94003
+ usePreloadThemeAsset(get(theme, 'themeVersion'), 'instruction_left.svg');
94004
+ usePreloadThemeAsset(get(theme, 'themeVersion'), 'instruction_right.svg');
94005
+ usePreloadThemeAsset(get(theme, 'themeVersion'), 'instruction_frontal.svg');
94006
+ const cropAreaDimension = reactExports.useCallback(({ clientHeight, videoAreaWidth, videoAreaHeight, lostX, lostY })=>{
94007
+ let width;
94008
+ let height;
94009
+ if (libExports.isMobile) {
94010
+ width = videoAreaWidth;
94011
+ height = width;
94012
+ } else {
94013
+ height = videoAreaHeight - 200;
94014
+ width = height;
94015
+ }
94016
+ const x = Math.floor((videoAreaWidth - width) / 2) + lostX;
94017
+ let y = 5 + lostY;
94018
+ const yFaceDetectionErrorNew = lostY + 25;
94019
+ const yCropAreaNew = yFaceDetectionErrorNew + 30;
94020
+ const yFaceVerificationStepsWrapperNew = yCropAreaNew + height + 20;
94021
+ setUISpacing({
94022
+ yFaceDetectionError: yFaceDetectionErrorNew,
94023
+ yFaceVerificationStepsWrapper: yFaceVerificationStepsWrapperNew
94024
+ });
94025
+ const topLimit = Math.floor(lostY);
94026
+ const botLimit = Math.floor(clientHeight - lostY);
94027
+ y = Math.floor(yCropAreaNew); // floor the y value to avoid blur line on ios safari
94028
+ if (offsetFaceY !== 0 && (y + offsetFaceY < topLimit || y + offsetFaceY + height > botLimit)) {
94029
+ onErrorCallback({
94030
+ code: `offsetFaceY must be in [-${y - topLimit}, ${botLimit - height - y}]`
94031
+ });
94032
+ } else {
94033
+ y += offsetFaceY;
94034
+ }
94035
+ return {
94036
+ x,
94037
+ y,
94038
+ width,
94039
+ height
94040
+ };
94041
+ }, [
94042
+ offsetFaceY,
94043
+ onErrorCallback
94044
+ ]);
94045
+ const { shouldResetFlowOnOrientationChange, cropArea, curStepIndex, directionIcon, directionIconAnimation, faceDetectionError, resetFlow, handleVideoPlayed, instructions, refVideo, refIsReseting, steps, videoPlayed, activeCapturing, warmupDone, showLoading } = useActiveLiveness({
94046
+ currentOrientation,
94047
+ apiCheck,
94048
+ bgCameraMask,
94049
+ bgCameraMaskRed,
94050
+ surroundStyle,
94051
+ onLivenessDetectionDone,
94052
+ onError: onErrorCallback,
94053
+ cropAreaDimension,
94054
+ customDirectionIcon,
94055
+ captureFrameSettings,
94056
+ onFramesCaptured,
94057
+ setRemainingTime,
94058
+ customStepTimeConstraints,
94059
+ onProcessing,
94060
+ customErrors,
94061
+ apiCredentials,
94062
+ outputEncryptionSettings,
94063
+ cameraScale,
94064
+ serviceSettings,
94065
+ onReset
94066
+ });
94067
+ reactExports.useEffect(()=>{
94068
+ if (typeof steps[0]?.directionIcon === 'string') {
94069
+ Promise.all(steps.map((step)=>preloadImage(step.directionIcon)));
94070
+ }
94071
+ }, [
94072
+ steps
94073
+ ]);
94074
+ const { CloseCameraButton } = styledComponent;
94075
+ const progressCircleProps = getProgressCircleProps(props, theme);
94076
+ const currentProgress = !refIsReseting.current ? curStepIndex / steps.length * 100 : 0;
94077
+ // for error text
94078
+ const { lang } = no$1.useSDKSettings();
94079
+ const timer = reactExports.useRef(0);
94080
+ const lastError = reactExports.useRef({});
94081
+ const duration = reactExports.useRef(ra$1.ErrorDuration.SHORT);
94082
+ const lastErrorMsg = reactExports.useMemo(()=>{
94083
+ const { msg, duration: errorDuration = ra$1.ErrorDuration.SHORT } = faceDetectionError || {};
94084
+ const errorMsg = msg?.[lang];
94085
+ if (Date.now() - timer.current >= duration.current) {
94086
+ timer.current = Date.now();
94087
+ duration.current = errorDuration;
94088
+ lastError.current = errorMsg;
94089
+ }
94090
+ return lastError.current;
94091
+ // eslint-disable-next-line react-hooks/exhaustive-deps
94092
+ }, [
94093
+ faceDetectionError,
94094
+ curStepIndex
94095
+ ]); // curStepIndex is used to get the latest error when reset flow
94096
+ const onOrientationChange = reactExports.useCallback((curOrientation)=>{
94097
+ setCurrentOrientation(curOrientation);
94098
+ if (!shouldResetFlowOnOrientationChange) {
94099
+ if (curOrientation === MODE.LANDSCAPE) {
94100
+ refVideo.current?.pause();
94101
+ } else {
94102
+ refVideo.current?.play();
94103
+ }
94104
+ } else {
94105
+ resetFlow();
94106
+ }
94107
+ }, [
94108
+ refVideo,
94109
+ resetFlow,
94110
+ shouldResetFlowOnOrientationChange
94111
+ ]);
94112
+ return /*#__PURE__*/ jsxRuntimeExports.jsx(OrientationDetection, {
94113
+ onOrientationChange: onOrientationChange,
94114
+ children: /*#__PURE__*/ jsxRuntimeExports.jsxs(Camera$1, {
94115
+ frontCamera: frontCamera,
94116
+ onVideoPlayed: handleVideoPlayed,
94117
+ onClose: onCloseCallback,
94118
+ flipHorizontal: flipVideoHorizontal ?? frontCamera,
94119
+ ref: refVideo,
94120
+ videoSettings: videoSettings$1,
94121
+ onError: onErrorCallback,
94122
+ scale: cameraScale,
94123
+ defaultCameraId: defaultCameraId,
94124
+ closeButton: CloseCameraButton || null,
94125
+ children: [
94126
+ !warmupDone && /*#__PURE__*/ jsxRuntimeExports.jsx(WarmupPopup, {}),
94127
+ videoPlayed ? /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
94128
+ children: [
94129
+ cropArea.current ? /*#__PURE__*/ jsxRuntimeExports.jsxs(CropAreaOverlayWrapper, {
94130
+ x: `${cropArea.current.x}px`,
94131
+ y: `${cropArea.current.y}px`,
94132
+ width: `${cropArea.current.width}px`,
94133
+ height: `${cropArea.current.height}px`,
94134
+ surroundStyle: cropArea.current.surroundStyle,
94135
+ children: [
94136
+ /*#__PURE__*/ jsxRuntimeExports.jsx(StyledCameraMark, {}),
94137
+ /*#__PURE__*/ jsxRuntimeExports.jsx(OverlayProgressCircle, {
94138
+ ...progressCircleProps,
94139
+ progress: currentProgress,
94140
+ showErrorRing: !!faceDetectionError && getTheme('Selfie.progressCircle.showErrorRing')({
94141
+ theme
94142
+ })
94143
+ }),
94144
+ /*#__PURE__*/ jsxRuntimeExports.jsx(InstructionsOverlay, {
94145
+ children: renderDirectionIcon(directionIcon, directionIconAnimation)
94146
+ }),
94147
+ activeCapturing && /*#__PURE__*/ jsxRuntimeExports.jsx(CapturingOverlay, {})
94148
+ ]
94149
+ }) : null,
94150
+ instructions ? /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
94151
+ children: [
94152
+ /*#__PURE__*/ jsxRuntimeExports.jsx(FaceVerificationInstructions, {
94153
+ top: yFaceVerificationStepsWrapper + 5,
94154
+ className: "instructions",
94155
+ children: instructions
94156
+ }),
94157
+ /*#__PURE__*/ jsxRuntimeExports.jsx(FaceVerificationStepsWrapper, {
94158
+ top: yFaceVerificationStepsWrapper + 35,
94159
+ children: steps.map((step, index)=>{
94160
+ const { name, image: { objUrl } } = step;
94161
+ return /*#__PURE__*/ jsxRuntimeExports.jsx(StepItem, {
94162
+ active: curStepIndex >= index,
94163
+ className: "step-item",
94164
+ children: objUrl ? /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
94165
+ className: "image_preview",
94166
+ src: objUrl,
94167
+ alt: ""
94168
+ }) : /*#__PURE__*/ jsxRuntimeExports.jsx(SelfieStepImageHolder, {
94169
+ stepNumber: index + 1,
94170
+ type: name,
94171
+ theme: theme
94172
+ })
94173
+ }, name);
94174
+ })
94175
+ })
94176
+ ]
94177
+ }) : null
94178
+ ]
94179
+ }) : null,
94180
+ (showLoading || isLoading) && /*#__PURE__*/ jsxRuntimeExports.jsx(LoadingIcon$2, {
94181
+ children: /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
94182
+ src: icLoading,
94183
+ alt: "",
94184
+ className: "spin"
94185
+ })
94186
+ }),
94187
+ remainingTime && /*#__PURE__*/ jsxRuntimeExports.jsx(CountdownTime, {
94188
+ top: yFaceVerificationStepsWrapper - 30,
94189
+ children: remainingTime
94190
+ }),
94191
+ typeof lastErrorMsg === 'string' ? /*#__PURE__*/ jsxRuntimeExports.jsx(SimpleFaceDetectionError, {
94192
+ top: yFaceDetectionError - 15,
94193
+ className: "face-detection-error",
94194
+ children: lastErrorMsg
94195
+ }) : null
94196
+ ]
94197
+ })
94198
+ });
94199
+ }
94200
+ ActiveLivenessV1.propTypes = {
94201
+ apiCheck: PropTypes.bool,
94202
+ onLivenessDetectionDone: PropTypes.func,
94203
+ onClose: PropTypes.func,
94204
+ onError: PropTypes.func,
94205
+ onReset: PropTypes.func,
94206
+ captureFrameSettings: PropTypes.shape({}),
94207
+ onFramesCaptured: PropTypes.func,
94208
+ flipVideoHorizontal: PropTypes.bool,
94209
+ frontCamera: PropTypes.bool,
94210
+ isLoading: PropTypes.bool,
94211
+ customDirectionIcon: PropTypes.shape({}),
94212
+ customStepTimeConstraints: PropTypes.shape({}),
94213
+ onProcessing: PropTypes.func,
94214
+ customErrors: PropTypes.shape({}),
94215
+ apiCredentials: PropTypes.shape({
94216
+ accessKey: PropTypes.string,
94217
+ secretKey: PropTypes.string,
94218
+ apiUrl: PropTypes.string
94219
+ }),
94220
+ outputEncryptionSettings: PropTypes.shape({}),
94221
+ cameraScale: PropTypes.number,
94222
+ defaultCameraId: PropTypes.string,
94223
+ offsetFaceY: PropTypes.number,
94224
+ styledComponent: PropTypes.shape({
94225
+ CloseCameraButton: PropTypes.node
94226
+ }),
94227
+ serviceSettings: PropTypes.shape({})
94228
+ };
94229
+ ActiveLivenessV1.defaultProps = {
94230
+ apiCheck: false,
94231
+ onLivenessDetectionDone: null,
94232
+ onClose: null,
94233
+ onError: ()=>{},
94234
+ onReset: ()=>{},
94235
+ captureFrameSettings: {
94236
+ enable: false,
94237
+ framesIntervalTime: 180,
94238
+ framesBatchLength: 0
94239
+ },
94240
+ onFramesCaptured: ()=>{},
94241
+ flipVideoHorizontal: null,
94242
+ frontCamera: true,
94243
+ isLoading: false,
94244
+ customDirectionIcon: {
94245
+ [ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
94246
+ type: ra$1.FaceDirection.LEFT
94247
+ }),
94248
+ [ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
94249
+ type: ra$1.FaceDirection.RIGHT
94250
+ }),
94251
+ [ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
94252
+ type: ra$1.FaceDirection.UP
94253
+ }),
94254
+ [ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon, {
94255
+ type: ra$1.FaceDirection.FRONTAL
94256
+ })
94257
+ },
94258
+ customStepTimeConstraints: {
94259
+ [ra$1.FaceDirection.UP]: {
94260
+ delayTime: 0
94261
+ },
94262
+ [ra$1.FaceDirection.LEFT]: {
94263
+ delayTime: 0
94264
+ },
94265
+ [ra$1.FaceDirection.RIGHT]: {
94266
+ delayTime: 0
94267
+ },
94268
+ [ra$1.FaceDirection.FRONTAL]: {
94269
+ delayTime: 2000
94270
+ }
94271
+ },
94272
+ onProcessing: ()=>{},
94273
+ customErrors: null,
94274
+ apiCredentials: {
94275
+ accessKey: '',
94276
+ secretKey: '',
94277
+ apiUrl: ''
94278
+ },
94279
+ outputEncryptionSettings: null,
94280
+ cameraScale: 1,
94281
+ defaultCameraId: undefined,
94282
+ offsetFaceY: 0,
94283
+ styledComponent: {
94284
+ CloseCameraButton: null
94285
+ },
94286
+ serviceSettings: {
94287
+ enableUploadFrames: true,
94288
+ enableUploadImages: true,
94289
+ enableVerifySanityPortrait: true,
94290
+ enableVerifySanityIDCard: true,
94291
+ enableVerifyFaceLiveness: true,
94292
+ enableDetectIDCardTampering: true,
94293
+ enableReadIDCardInfo: true
94294
+ }
94295
+ };
94296
+
94297
+ // To reduce the calculation for blazeface
94298
+ const videoSettings = libExports.isMobile ? {
94299
+ width: {
94300
+ ideal: 640
94301
+ }
94302
+ } : null;
94303
+ // eslint-disable-next-line react/require-default-props
94304
+ function PassiveLivenessOldV1(props) {
94305
+ const { apiCheck, onLivenessDetectionDone, captureFrameSettings, onFramesCaptured, frontCamera, flipVideoHorizontal, customDirectionIcon, customStepTimeConstraints, onProcessing, customErrors, apiCredentials, outputEncryptionSettings, cameraScale, defaultCameraId, passiveModeAuto, offsetFaceY, styledComponent, serviceSettings, onReset, isLoading } = props;
94306
+ const theme = nt$2();
94307
+ const { onErrorCallback, onCloseCallback } = useSDKCallback();
94308
+ const bgCameraMask = iH.useAsset('bg_camera_mask.png');
94309
+ const bgCameraMaskRed = iH.useAsset('bg_camera_mask_red.png');
94310
+ const icLoading = useThemeIcon('IDCapturing.loadingIcon.src', 'ic_loading.gif');
94311
+ const [uiSpacing, setUISpacing] = reactExports.useState({});
94312
+ const { yFaceDetectionError, yFaceVerificationStepsWrapper } = uiSpacing;
94313
+ const [remainingTime, setRemainingTime] = reactExports.useState('');
94314
+ const [currentOrientation, setCurrentOrientation] = reactExports.useState();
94315
+ const surroundStyle = reactExports.useMemo(()=>({
94316
+ backgroundColor: getTheme('Selfie.backgroundColor')({
94317
+ theme
94318
+ })
94319
+ }), [
94320
+ theme
94321
+ ]);
94322
+ const cropAreaDimension = reactExports.useCallback(({ lostY, height, clientHeight })=>{
94323
+ const yFaceDetectionErrorNew = lostY + 25;
94324
+ const yCropAreaNew = yFaceDetectionErrorNew + 30;
94325
+ const yFaceVerificationStepsWrapperNew = yCropAreaNew + height + 20;
94326
+ setUISpacing({
94327
+ yFaceDetectionError: yFaceDetectionErrorNew,
94328
+ yFaceVerificationStepsWrapper: yFaceVerificationStepsWrapperNew
94329
+ });
94330
+ const topLimit = Math.floor(lostY);
94331
+ const botLimit = Math.floor(clientHeight - lostY);
94332
+ let y = Math.floor(yCropAreaNew); // floor the y value to avoid blur line on ios safari
94333
+ if (offsetFaceY !== 0 && (y + offsetFaceY < topLimit || y + offsetFaceY + height > botLimit)) {
94334
+ onErrorCallback({
94335
+ code: `offsetFaceY must be in [-${y - topLimit}, ${botLimit - height - y}]`
94336
+ });
94337
+ } else {
94338
+ y += offsetFaceY;
94339
+ }
94340
+ return {
94341
+ y
94342
+ };
94343
+ }, [
94344
+ offsetFaceY,
94345
+ onErrorCallback
94346
+ ]);
94347
+ const { shouldResetFlowOnOrientationChange, countdownToTakePicture, cropArea, curStepIndex, faceDetectionError, resetFlow, handleTriggerPassiveMode, handleVideoPlayed, refVideo, showCountdown, steps, refIsReseting, videoPlayed, warmupDone, showCaptureButton, shouldShowCountdown, showLoading } = usePassiveLiveness({
94348
+ currentOrientation,
94349
+ apiCheck,
94350
+ bgCameraMask,
94351
+ bgCameraMaskRed,
94352
+ surroundStyle,
94353
+ onLivenessDetectionDone,
94354
+ onError: onErrorCallback,
94355
+ cropAreaDimension,
94356
+ customDirectionIcon,
94357
+ captureFrameSettings,
94358
+ onFramesCaptured,
94359
+ setRemainingTime,
94360
+ customStepTimeConstraints,
94361
+ onProcessing,
94362
+ customErrors,
94363
+ apiCredentials,
94364
+ outputEncryptionSettings,
94365
+ cameraScale,
94366
+ passiveModeAuto,
94367
+ serviceSettings,
94368
+ onReset
94369
+ });
94370
+ reactExports.useEffect(()=>{
94371
+ if (typeof steps[0]?.directionIcon === 'string') {
94372
+ Promise.all(steps.map((step)=>preloadImage(step.directionIcon)));
94373
+ }
94374
+ }, [
94375
+ steps
94376
+ ]);
94377
+ const { CloseCameraButton } = styledComponent;
94378
+ const progressCircleProps = getProgressCircleProps(props, theme);
94379
+ const currentProgress = !refIsReseting.current ? curStepIndex / steps.length * 100 : 0;
94380
+ // for error text
94381
+ const { lang } = no$1.useSDKSettings();
94382
+ const timer = reactExports.useRef(0);
94383
+ const lastError = reactExports.useRef({});
94384
+ const duration = reactExports.useRef(ra$1.ErrorDuration.SHORT);
94385
+ const lastErrorMsg = reactExports.useMemo(()=>{
94386
+ const { msg, duration: errorDuration = ra$1.ErrorDuration.SHORT } = faceDetectionError || {};
94387
+ const errorMsg = msg?.[lang];
94388
+ if (Date.now() - timer.current >= duration.current) {
94389
+ timer.current = Date.now();
94390
+ duration.current = errorDuration;
94391
+ lastError.current = errorMsg;
94392
+ }
94393
+ return lastError.current;
94394
+ // eslint-disable-next-line react-hooks/exhaustive-deps
94395
+ }, [
94396
+ faceDetectionError,
94397
+ curStepIndex
94398
+ ]); // curStepIndex is used to get the latest error when reset flow
94399
+ const onOrientationChange = reactExports.useCallback((curOrientation)=>{
94400
+ setCurrentOrientation(curOrientation);
94401
+ if (!shouldResetFlowOnOrientationChange) {
94402
+ if (curOrientation === MODE.LANDSCAPE) {
94403
+ refVideo.current?.pause();
94404
+ } else {
94405
+ refVideo.current?.play();
94406
+ }
94407
+ } else {
94408
+ resetFlow();
94409
+ }
94410
+ }, [
94411
+ refVideo,
94412
+ resetFlow,
94413
+ shouldResetFlowOnOrientationChange
94414
+ ]);
94415
+ return /*#__PURE__*/ jsxRuntimeExports.jsx(OrientationDetection, {
94416
+ onOrientationChange: onOrientationChange,
94417
+ children: /*#__PURE__*/ jsxRuntimeExports.jsxs(Camera$1, {
94418
+ frontCamera: frontCamera,
94419
+ onVideoPlayed: handleVideoPlayed,
94420
+ onClose: onCloseCallback,
94421
+ flipHorizontal: flipVideoHorizontal ?? frontCamera,
94422
+ ref: refVideo,
94423
+ videoSettings: videoSettings,
94424
+ onError: onErrorCallback,
94425
+ scale: cameraScale,
94426
+ defaultCameraId: defaultCameraId,
94427
+ closeButton: CloseCameraButton || null,
94428
+ children: [
94429
+ !warmupDone && /*#__PURE__*/ jsxRuntimeExports.jsx(WarmupPopup, {}),
94430
+ videoPlayed ? /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
94431
+ children: [
94432
+ typeof lastErrorMsg === 'string' ? /*#__PURE__*/ jsxRuntimeExports.jsx(SimpleFaceDetectionError, {
94433
+ top: yFaceDetectionError - 15,
94434
+ className: "face-detection-error",
94435
+ children: lastErrorMsg
94436
+ }) : null,
94437
+ cropArea.current ? /*#__PURE__*/ jsxRuntimeExports.jsxs(CropAreaOverlayWrapper, {
94438
+ x: `${cropArea.current.x}px`,
94439
+ y: `${cropArea.current.y}px`,
94440
+ width: `${cropArea.current.width}px`,
94441
+ height: `${cropArea.current.height}px`,
94442
+ surroundStyle: cropArea.current.surroundStyle,
94443
+ children: [
94444
+ /*#__PURE__*/ jsxRuntimeExports.jsx(StyledCameraMark, {}),
94445
+ /*#__PURE__*/ jsxRuntimeExports.jsx(OverlayProgressCircle, {
94446
+ ...progressCircleProps,
94447
+ progress: currentProgress,
94448
+ showErrorRing: !!faceDetectionError && getTheme('Selfie.progressCircle.showErrorRing')({
94449
+ theme
94450
+ })
94451
+ }),
94452
+ shouldShowCountdown ? /*#__PURE__*/ jsxRuntimeExports.jsx(CountDownOverlay, {
94453
+ children: countdownToTakePicture
94454
+ }) : null,
94455
+ faceDetectionError && /*#__PURE__*/ jsxRuntimeExports.jsx(ErrorOverlay$1, {})
94456
+ ]
94457
+ }) : null,
94458
+ remainingTime && /*#__PURE__*/ jsxRuntimeExports.jsx(CountdownTime, {
94459
+ top: yFaceVerificationStepsWrapper - 30,
94460
+ children: remainingTime
94461
+ }),
94462
+ showCaptureButton ? /*#__PURE__*/ jsxRuntimeExports.jsx(BottomButtonsOverlay, {
94463
+ children: /*#__PURE__*/ jsxRuntimeExports.jsx(Button$4, {
94464
+ onClick: handleTriggerPassiveMode,
94465
+ disabled: showCountdown,
94466
+ children: get(theme, 'Selfie.captureIcon.src') ? /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
94467
+ src: get(theme, 'Selfie.captureIcon.src'),
94468
+ alt: ""
94469
+ }) : /*#__PURE__*/ jsxRuntimeExports.jsx(CameraIcon, {
94470
+ fillColor: "rgba(193, 197, 204, 1)"
94471
+ })
94472
+ })
94473
+ }) : null
94474
+ ]
94475
+ }) : null,
94476
+ (showLoading || isLoading) && /*#__PURE__*/ jsxRuntimeExports.jsx(LoadingIcon$2, {
94477
+ children: /*#__PURE__*/ jsxRuntimeExports.jsx("img", {
94478
+ src: icLoading,
94479
+ alt: ""
94480
+ })
94481
+ })
94482
+ ]
94483
+ })
94484
+ });
94485
+ }
94486
+ PassiveLivenessOldV1.propTypes = {
94487
+ apiCheck: PropTypes.bool,
94488
+ mode: PropTypes.string,
94489
+ onLivenessDetectionDone: PropTypes.func,
94490
+ onClose: PropTypes.func,
94491
+ onError: PropTypes.func,
94492
+ onReset: PropTypes.func,
94493
+ captureFrameSettings: PropTypes.shape({}),
94494
+ onFramesCaptured: PropTypes.func,
94495
+ frontCamera: PropTypes.bool,
94496
+ isLoading: PropTypes.bool,
94497
+ flipVideoHorizontal: PropTypes.bool,
94498
+ customDirectionIcon: PropTypes.shape({}),
94499
+ customStepTimeConstraints: PropTypes.shape({}),
94500
+ onProcessing: PropTypes.func,
94501
+ customErrors: PropTypes.shape({}),
94502
+ apiCredentials: PropTypes.shape({
94503
+ accessKey: PropTypes.string,
94504
+ secretKey: PropTypes.string,
94505
+ apiUrl: PropTypes.string
94506
+ }),
94507
+ outputEncryptionSettings: PropTypes.shape({}),
94508
+ cameraScale: PropTypes.number,
94509
+ defaultCameraId: PropTypes.string,
94510
+ passiveModeAuto: PropTypes.bool,
94511
+ offsetFaceY: PropTypes.number,
94512
+ styledComponent: PropTypes.shape({
94513
+ CloseCameraButton: PropTypes.node
94514
+ }),
94515
+ serviceSettings: PropTypes.shape({})
94516
+ };
94517
+ PassiveLivenessOldV1.defaultProps = {
94518
+ apiCheck: false,
94519
+ mode: null,
94520
+ onLivenessDetectionDone: null,
94521
+ onClose: null,
94522
+ onError: ()=>{},
94523
+ onReset: ()=>{},
94524
+ captureFrameSettings: {
94525
+ enable: false,
94526
+ framesIntervalTime: 180,
94527
+ framesBatchLength: 0
94528
+ },
94529
+ onFramesCaptured: ()=>{},
94530
+ frontCamera: true,
94531
+ isLoading: false,
94532
+ flipVideoHorizontal: null,
94533
+ customDirectionIcon: {
94534
+ [ra$1.FaceDirection.LEFT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
94535
+ type: ra$1.FaceDirection.LEFT
94536
+ }),
94537
+ [ra$1.FaceDirection.RIGHT]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
94538
+ type: ra$1.FaceDirection.RIGHT
94539
+ }),
94540
+ [ra$1.FaceDirection.UP]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
94541
+ type: ra$1.FaceDirection.UP
94542
+ }),
94543
+ [ra$1.FaceDirection.FRONTAL]: /*#__PURE__*/ jsxRuntimeExports.jsx(DirectionIcon$1, {
94544
+ type: ra$1.FaceDirection.FRONTAL
94545
+ })
94546
+ },
94547
+ customStepTimeConstraints: {
94548
+ [ra$1.FaceDirection.UP]: {
94549
+ delayTime: 0
94550
+ },
94551
+ [ra$1.FaceDirection.LEFT]: {
94552
+ delayTime: 0
94553
+ },
94554
+ [ra$1.FaceDirection.RIGHT]: {
94555
+ delayTime: 0
94556
+ },
94557
+ [ra$1.FaceDirection.FRONTAL]: {
94558
+ delayTime: 2000
94559
+ }
94560
+ },
94561
+ onProcessing: ()=>{},
94562
+ customErrors: null,
94563
+ apiCredentials: {
94564
+ accessKey: '',
94565
+ secretKey: '',
94566
+ apiUrl: ''
94567
+ },
94568
+ outputEncryptionSettings: null,
94569
+ cameraScale: 1,
94570
+ defaultCameraId: undefined,
94571
+ passiveModeAuto: false,
94572
+ offsetFaceY: 0,
94573
+ styledComponent: {
94574
+ CloseCameraButton: null
94575
+ },
94576
+ serviceSettings: {
94577
+ enableUploadFrames: true,
94578
+ enableUploadImages: true,
94579
+ enableVerifySanityPortrait: true,
94580
+ enableVerifySanityIDCard: true,
94581
+ enableVerifyFaceLiveness: true,
94582
+ enableDetectIDCardTampering: true,
94583
+ enableReadIDCardInfo: true
94584
+ }
94585
+ };
94586
+
93865
94587
  const withClientSettings$1 = (Component)=>{
93866
94588
  return function WrappedComponent(props) {
93867
94589
  const { apiCheck, apiCredentials, serviceSettings, flowId, clientSettings } = props;
@@ -93877,16 +94599,20 @@
93877
94599
  });
93878
94600
  };
93879
94601
  };
93880
- const getLivenessModeComponent = (mode, CustomLivenessDetection)=>{
94602
+ const getLivenessModeComponent = (mode, CustomLivenessDetection, themeVersion)=>{
93881
94603
  let LivenessDetectionComponent = ActiveLiveness;
93882
94604
  if (mode === ra$1.Mode.ACTIVE) {
93883
- LivenessDetectionComponent = CustomLivenessDetection?.ActiveLiveness ?? ActiveLiveness;
94605
+ const DefaultActiveLiveness = themeVersion === 'v1' ? ActiveLivenessV1 : ActiveLiveness;
94606
+ LivenessDetectionComponent = CustomLivenessDetection?.ActiveLiveness ?? DefaultActiveLiveness;
93884
94607
  }
93885
94608
  if (mode === ra$1.Mode.PASSIVE_V2) {
93886
94609
  LivenessDetectionComponent = CustomLivenessDetection?.PassiveLivenessV2 ?? PassiveLiveness;
93887
94610
  }
93888
94611
  if (mode === ra$1.Mode.PASSIVE) {
93889
- LivenessDetectionComponent = CustomLivenessDetection?.PassiveLiveness ?? PassiveLiveness$1;
94612
+ // PassiveLivenessOldV1 to not be confused with PassiveLivenessV2 (which is totally new mode)
94613
+ // PassiveLivenessOldV1 refers to PassiveLiveness with themeVersion = "v1"
94614
+ const DefaultPassiveLiveness = themeVersion === 'v1' ? PassiveLivenessOldV1 : PassiveLiveness$1;
94615
+ LivenessDetectionComponent = CustomLivenessDetection?.PassiveLiveness ?? DefaultPassiveLiveness;
93890
94616
  }
93891
94617
  if (typeof mode === 'string' && mode.startsWith('flash')) {
93892
94618
  LivenessDetectionComponent = CustomLivenessDetection?.FlashLiveness ?? FlashLiveness;
@@ -93899,7 +94625,7 @@
93899
94625
  }, livenessComponent: CustomLivenessDetection, customTheme = {}, customTexts, ...props } = livenessProps;
93900
94626
  const { mode, flowId, onError: onErrorFromProp, onClose: onCloseFromProp, debug, onLivenessDetectionDone } = props;
93901
94627
  const clientSettings = useClientSettings();
93902
- const { billingSettings: clientBillingSettings, enableBilling } = no$1.useSDKSettings();
94628
+ const { billingSettings: clientBillingSettings, enableBilling, themeVersion } = no$1.useSDKSettings();
93903
94629
  const billingSettingsFromSdkSettings = dD.getWebSetting(clientSettings, 'data.settings.sdk_settings.billing_settings.billing_config');
93904
94630
  const billingUrl = dD.getWebSetting(clientSettings, 'data.settings.sdk_settings.billing_settings.url');
93905
94631
  const { submitBilling } = gR({
@@ -93985,7 +94711,7 @@
93985
94711
  billingInput,
93986
94712
  onCloseFromProp
93987
94713
  ]);
93988
- const LivenessDetectionComponent = getLivenessModeComponent(mode, CustomLivenessDetection);
94714
+ const LivenessDetectionComponent = getLivenessModeComponent(mode, CustomLivenessDetection, themeVersion);
93989
94715
  return /*#__PURE__*/ jsxRuntimeExports.jsx(DebugProvider, {
93990
94716
  debug: debug,
93991
94717
  children: /*#__PURE__*/ jsxRuntimeExports.jsx(SDKCallbackProvider, {
@@ -112749,7 +113475,7 @@
112749
113475
  };
112750
113476
  };
112751
113477
 
112752
- const defaultAssetRoot = "https://vision-cdn.trustingsocial.com/tvweb-sdk.nbcci/0.0.0-beta.20251215-093759/assets";
113478
+ const defaultAssetRoot = "https://vision-cdn.trustingsocial.com/tvweb-sdk.nbcci/0.0.0-beta.20251215-165409/assets";
112753
113479
  class TVWebSDK extends gU {
112754
113480
  constructor(props){
112755
113481
  super({