@ekyc_qoobiss/qbs-ect-cmp 3.6.75 → 3.6.76

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.
@@ -1528,12 +1528,6 @@ const getLogMessage = (param_req_id = '', param_redirect_id = '', param_token =
1528
1528
  };
1529
1529
  };
1530
1530
 
1531
- var VerificationMode;
1532
- (function (VerificationMode) {
1533
- VerificationMode[VerificationMode["Full"] = 0] = "Full";
1534
- VerificationMode[VerificationMode["Tilt"] = 1] = "Tilt";
1535
- })(VerificationMode || (VerificationMode = {}));
1536
-
1537
1531
  class IDML5Detector {
1538
1532
  static getInstance(stream, isMobile) {
1539
1533
  if (!IDML5Detector.instance) {
@@ -1554,13 +1548,9 @@ class IDML5Detector {
1554
1548
  this.canvasElement = canvasElement;
1555
1549
  // this.component = component;
1556
1550
  }
1557
- initDetector(mode) {
1551
+ initDetector() {
1558
1552
  this.initTime = Date.now();
1559
1553
  this.continue = true;
1560
- if (mode == VerificationMode.Full)
1561
- this.targetedLabel = 'full';
1562
- else
1563
- this.targetedLabel = 'tilted';
1564
1554
  // this.width = this.videoElement.videoWidth;
1565
1555
  // this.height = this.videoElement.videoHeight;
1566
1556
  this.drawFrame('white');
@@ -1588,14 +1578,14 @@ class IDML5Detector {
1588
1578
  this.stream.timeElapsed();
1589
1579
  return;
1590
1580
  }
1591
- if (results[0].label == this.targetedLabel && results[0].confidence > 0.9 && !this.checked) {
1581
+ if (results[0].label == 'full' && results[0].confidence > 0.9 && !this.checked) {
1592
1582
  this.checked = true;
1593
1583
  if (TranslationUtils.state.debug)
1594
1584
  console.log('idml5detector | gotResults | autoCapturing');
1595
1585
  this.stream.autoCapturing();
1596
1586
  await this.drawFrame('green');
1597
1587
  }
1598
- if (results[0].label == this.targetedLabel && results[0].confidence > 0.8 && !this.checked) {
1588
+ if (results[0].label == 'tilted' && results[0].confidence > 0.8 && !this.checked) {
1599
1589
  this.checked = true;
1600
1590
  await this.drawFrame('green');
1601
1591
  }
@@ -1719,6 +1709,12 @@ const faceWhiteSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUwIiBoZWlnaHQ9
1719
1709
 
1720
1710
  const faceGreenSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUwIiBoZWlnaHQ9IjIyNC45OTk5OTk5OTk5OTk5NyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIHZlcnNpb249IjEuMSIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQogPGc+DQogIDx0aXRsZT5MYXllciAxPC90aXRsZT4NCiAgPGcgc3Ryb2tlPSJudWxsIiBpZD0iTGF5ZXIgMSI+DQogICA8cGF0aCBzdHJva2U9IiM0Y2E1ODUiIGlkPSJzdmdfMSIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZmlsbD0ibm9uZSIgZD0ibTc0LjI3NzY1LDYuOTI3NjFjLTExLjM3NTk3LC0wLjAxNzEzIC0zMy41NjU1MSw1LjEwNDMzIC00Ni44MTMxNiwxOS40OTQ4MWMtNi43NDE0Myw3LjMyMjkyIC0xOC4xMjI2OSwyMy4wNjk2NyAtMTkuMjY3NTgsNTkuNjEzNjljLTAuNTE5MDYsMTYuNTY5MjEgNS4wNDUyNCw2MC42MjUzMyAxMC4yNDAwNiw3Ni40Njc3NWMzLjYzMTMsMTEuMDc0NjggMjcuNDgyMTUsNDMuOTMzNDkgNDQuNDkwNiw1My42ODI1MWM0LjgwNzkxLDIuNzU1NDYgMTEuMjk2NjgsMi42ODI1MSAxMi40MjI1NSwyLjY4MjUxYzEuMTg4NzYsLTAuMDg0NTcgNy4zMzAyNiwwLjA3Mjk0IDEyLjEzNzY1LC0yLjY4MjUxYzE3LjAwODQ2LC05Ljc0OTAyIDQwLjQwMjA4LC00Mi43Njg1MSA0NC40OTA2LC01My42ODI1MWM0LjQwMDM4LC0xMS43NDQ5MSAxMC43NTk2NSwtNTkuODk4NTQgMTAuMjQwMDYsLTc2LjQ2Nzc1Yy0xLjE0NDg5LC0zNi41NDQwMiAtMTIuNTI2MTUsLTUyLjI5MDc3IC0xOS4yNjc1OCwtNTkuNjEzNjljLTEzLjI0NzY1LC0xNC4zOTA0OCAtMzUuMzA2NjMsLTE5LjUyOTMzIC00Ni43NzgyNywtMTkuNDk0ODFjLTAuNzQ2ODgsMC4wMDIyMiAtMS44OTQ5NCwwIC0xLjg5NDk0LDB6IiBzdHJva2Utd2lkdGg9IjciLz4NCiAgPC9nPg0KIDwvZz4NCjwvc3ZnPg0K';
1721
1711
 
1712
+ var VerificationMode;
1713
+ (function (VerificationMode) {
1714
+ VerificationMode[VerificationMode["Full"] = 0] = "Full";
1715
+ VerificationMode[VerificationMode["Tilt"] = 1] = "Tilt";
1716
+ })(VerificationMode || (VerificationMode = {}));
1717
+
1722
1718
  class FaceML5Detector {
1723
1719
  static getInstance(stream, isMobile) {
1724
1720
  if (!FaceML5Detector.instance) {
@@ -4388,71 +4384,6 @@ var Browser;
4388
4384
  Browser["Unknown"] = "unknown";
4389
4385
  })(Browser || (Browser = {}));
4390
4386
 
4391
- // Unique ID creation requires a high quality random # generator. In the browser we therefore
4392
- // require the crypto API and do not support built-in fallback to lower quality random number
4393
- // generators (like Math.random()).
4394
- let getRandomValues;
4395
- const rnds8 = new Uint8Array(16);
4396
- function rng() {
4397
- // lazy load so that environments that need to polyfill have a chance to do so
4398
- if (!getRandomValues) {
4399
- // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
4400
- getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
4401
-
4402
- if (!getRandomValues) {
4403
- throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
4404
- }
4405
- }
4406
-
4407
- return getRandomValues(rnds8);
4408
- }
4409
-
4410
- /**
4411
- * Convert array of 16 byte values to UUID string format of the form:
4412
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
4413
- */
4414
-
4415
- const byteToHex = [];
4416
-
4417
- for (let i = 0; i < 256; ++i) {
4418
- byteToHex.push((i + 0x100).toString(16).slice(1));
4419
- }
4420
-
4421
- function unsafeStringify(arr, offset = 0) {
4422
- // Note: Be careful editing this code! It's been tuned for performance
4423
- // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
4424
- return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
4425
- }
4426
-
4427
- const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
4428
- const native = {
4429
- randomUUID
4430
- };
4431
-
4432
- function v4(options, buf, offset) {
4433
- if (native.randomUUID && !buf && !options) {
4434
- return native.randomUUID();
4435
- }
4436
-
4437
- options = options || {};
4438
- const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
4439
-
4440
- rnds[6] = rnds[6] & 0x0f | 0x40;
4441
- rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
4442
-
4443
- if (buf) {
4444
- offset = offset || 0;
4445
-
4446
- for (let i = 0; i < 16; ++i) {
4447
- buf[offset + i] = rnds[i];
4448
- }
4449
-
4450
- return buf;
4451
- }
4452
-
4453
- return unsafeStringify(rnds);
4454
- }
4455
-
4456
4387
  var ImageFormat;
4457
4388
  (function (ImageFormat) {
4458
4389
  ImageFormat["JPEG"] = "image/jpeg";
@@ -4484,11 +4415,10 @@ class Stream {
4484
4415
  }
4485
4416
  constructor(mode) {
4486
4417
  this.streamPaused = false;
4487
- this.guid = v4();
4488
4418
  this.recordedChunks = [];
4489
4419
  this.videoSize = { width: 0, height: 0 };
4490
4420
  if (TranslationUtils.state.debug)
4491
- console.log(`stream ${this.guid} | constructor`);
4421
+ console.log(`stream | constructor`);
4492
4422
  this.initFacePose();
4493
4423
  this.idML5Detector = IDML5Detector.getInstance(this, TranslationUtils.state.device.isMobile);
4494
4424
  this.faceML5Detector = FaceML5Detector.getInstance(this, TranslationUtils.state.device.isMobile);
@@ -4500,23 +4430,23 @@ class Stream {
4500
4430
  if (!Stream.instance) {
4501
4431
  Stream.instance = new Stream(mode);
4502
4432
  if (TranslationUtils.state.debug)
4503
- console.log(`stream ${Stream.instance.guid} | getNewInstance | new instance`);
4433
+ console.log(`stream | getNewInstance | new instance`);
4504
4434
  }
4505
4435
  return Stream.instance;
4506
4436
  }
4507
4437
  autoCapturing() {
4508
4438
  if (TranslationUtils.state.debug)
4509
- console.log(`stream ${this.guid} | autoCapturing`);
4439
+ console.log(`stream | autoCapturing`);
4510
4440
  this.callbackAutoCapturing();
4511
4441
  }
4512
4442
  timeElapsed() {
4513
4443
  if (TranslationUtils.state.debug)
4514
- console.log(`stream ${this.guid} | timeElapsed`);
4444
+ console.log(`stream | timeElapsed`);
4515
4445
  this.callbackTimeElapsed();
4516
4446
  }
4517
4447
  verificationReady() {
4518
4448
  if (TranslationUtils.state.debug)
4519
- console.log(`stream ${this.guid} | verificationReady`);
4449
+ console.log(`stream | verificationReady`);
4520
4450
  this.verificationFinished();
4521
4451
  }
4522
4452
  updateHtmlElements(videoElement, canvasElement, component) {
@@ -4527,7 +4457,7 @@ class Stream {
4527
4457
  }
4528
4458
  startStream(stream) {
4529
4459
  if (TranslationUtils.state.debug)
4530
- console.log(`stream ${this.guid} | startStream`);
4460
+ console.log(`stream | startStream`);
4531
4461
  if (this.stream)
4532
4462
  this.stream.getTracks().forEach((track) => track.stop());
4533
4463
  this.stream = stream;
@@ -4560,7 +4490,7 @@ class Stream {
4560
4490
  }
4561
4491
  recordStream() {
4562
4492
  if (TranslationUtils.state.debug)
4563
- console.log(`stream ${this.guid} | recordStream`);
4493
+ console.log(`stream | recordStream`);
4564
4494
  if (this.mediaRecorder && this.mediaRecorder.state == 'recording')
4565
4495
  return;
4566
4496
  var options = { mimeType: Stream.webmMimeType.mime, videoBitsPerSecond: 1500000 };
@@ -4572,12 +4502,12 @@ class Stream {
4572
4502
  this.mediaRecorder = new MediaRecorder(this.stream, options);
4573
4503
  this.mediaRecorder.ondataavailable = event => {
4574
4504
  if (TranslationUtils.state.debug)
4575
- console.log(`stream ${this.guid} | recordStream | ondataavailable`);
4505
+ console.log(`stream | recordStream | ondataavailable`);
4576
4506
  this.recordedChunks.push(event.data);
4577
4507
  };
4578
4508
  this.mediaRecorder.onstop = _e => {
4579
4509
  if (TranslationUtils.state.debug)
4580
- console.log(`stream ${this.guid} | recordStream | onstop`);
4510
+ console.log(`stream | recordStream | onstop`);
4581
4511
  var rec = new Blob(this.recordedChunks, {
4582
4512
  type: options.mimeType.split(';')[0],
4583
4513
  });
@@ -4609,7 +4539,7 @@ class Stream {
4609
4539
  }
4610
4540
  async takePhoto() {
4611
4541
  if (TranslationUtils.state.debug)
4612
- console.log(`stream ${this.guid} | takePhoto`);
4542
+ console.log(`stream | takePhoto`);
4613
4543
  const canvas = document.createElement('canvas');
4614
4544
  canvas.style.visibility = 'hidden';
4615
4545
  canvas.width = this.videoElement.videoWidth;
@@ -4618,7 +4548,7 @@ class Stream {
4618
4548
  }
4619
4549
  getFrame(canvas) {
4620
4550
  if (TranslationUtils.state.debug)
4621
- console.log(`stream ${this.guid} | getFrame`);
4551
+ console.log(`stream | getFrame`);
4622
4552
  return new Promise(resolve => {
4623
4553
  const context = canvas.getContext('2d');
4624
4554
  context.drawImage(this.videoElement, 0, 0, canvas.width, canvas.height);
@@ -4626,7 +4556,7 @@ class Stream {
4626
4556
  if (frame.type === ImageFormat.JPEG && !TranslationUtils.state.device.isAppleDevice) {
4627
4557
  try {
4628
4558
  if (TranslationUtils.state.debug)
4629
- console.log(`stream ${this.guid} | getFrame | addExifInImg`);
4559
+ console.log(`stream | getFrame | addExifInImg`);
4630
4560
  addExifInImg(frame, this.stream.getTracks()[0], this.videoSize).then(updatedFrame => resolve(updatedFrame));
4631
4561
  }
4632
4562
  catch (e) {
@@ -4636,7 +4566,7 @@ class Stream {
4636
4566
  }
4637
4567
  else {
4638
4568
  if (TranslationUtils.state.debug)
4639
- console.log(`stream ${this.guid} | getFrame | resolve`);
4569
+ console.log(`stream | getFrame | resolve`);
4640
4570
  resolve(frame);
4641
4571
  }
4642
4572
  }, ImageFormat.PNG, 1);
@@ -4645,7 +4575,7 @@ class Stream {
4645
4575
  async startIdDetection() {
4646
4576
  if (this.streamPaused)
4647
4577
  return;
4648
- this.idML5Detector.initDetector(this.verificationMode);
4578
+ this.idML5Detector.initDetector();
4649
4579
  }
4650
4580
  async startFaceDetection() {
4651
4581
  if (this.streamPaused)
@@ -5109,7 +5039,6 @@ const IdCapture = class {
5109
5039
  this.eventPhotoCapture = index.createEvent(this, "photoIdCapture", 7);
5110
5040
  this.apiErrorEvent = index.createEvent(this, "apiError", 7);
5111
5041
  this.eventTimeElapsed = index.createEvent(this, "timeElapsed", 7);
5112
- this.guid = v4();
5113
5042
  this.videoStarted = undefined;
5114
5043
  this.cameraSize = undefined;
5115
5044
  this.captureTaken = undefined;
@@ -5127,7 +5056,7 @@ const IdCapture = class {
5127
5056
  }
5128
5057
  async componentWillLoad() {
5129
5058
  if (TranslationUtils.state.debug)
5130
- console.log(`id-capture ${this.guid} | componentWillLoad`);
5059
+ console.log(`id-capture | componentWillLoad`);
5131
5060
  this.translations = await TranslationUtils.Translations.getValues();
5132
5061
  if (!navigator.mediaDevices) {
5133
5062
  this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
@@ -5135,29 +5064,26 @@ const IdCapture = class {
5135
5064
  }
5136
5065
  initVariables() {
5137
5066
  if (TranslationUtils.state.debug)
5138
- console.log(`id-capture ${this.guid} | initVariables`);
5067
+ console.log(`id-capture | initVariables`);
5139
5068
  if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.IDFRONT) {
5140
5069
  this.pose = IDPose.Straight;
5141
5070
  this.flowStep = TranslationUtils.FlowSteps.CiFrontCapture;
5142
5071
  this.titleMesage = this.translations.IdCaptureValues.Title;
5143
- this.verificationMode = VerificationMode.Full;
5144
5072
  }
5145
5073
  else if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.IDBACK) {
5146
5074
  this.pose = IDPose.BackStraight;
5147
5075
  this.flowStep = TranslationUtils.FlowSteps.CiBackCapture;
5148
5076
  this.titleMesage = this.translations.IdCaptureValues.TtileRotate;
5149
- this.verificationMode = VerificationMode.Full;
5150
5077
  }
5151
5078
  else if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.IDTILT) {
5152
5079
  this.titleMesage = this.translations.IdCaptureValues.IDPoseMapping;
5153
5080
  this.pose = IDPose.Tilted;
5154
5081
  this.flowStep = TranslationUtils.FlowSteps.CiTilt;
5155
- this.verificationMode = VerificationMode.Tilt;
5156
5082
  }
5157
5083
  }
5158
5084
  async componentDidLoad() {
5159
5085
  if (TranslationUtils.state.debug)
5160
- console.log(`id-capture ${this.guid} | componentDidLoad`);
5086
+ console.log(`id-capture | componentDidLoad`);
5161
5087
  this.initVariables();
5162
5088
  await BaseComponent.logStep(this.flowStep, TranslationUtils.FlowMoments.Initialized);
5163
5089
  this.demoVideo.src = TranslationUtils.IdCaptureValues.IDPoseDemoMapping[this.pose];
@@ -5168,7 +5094,7 @@ const IdCapture = class {
5168
5094
  }
5169
5095
  async openCamera() {
5170
5096
  if (TranslationUtils.state.debug)
5171
- console.log(`id-capture ${this.guid} | openCamera`);
5097
+ console.log(`id-capture | openCamera`);
5172
5098
  if (!TranslationUtils.state.cameraId) {
5173
5099
  await Cameras.InitCameras(TranslationUtils.state.device);
5174
5100
  }
@@ -5178,8 +5104,8 @@ const IdCapture = class {
5178
5104
  .getUserMedia(constraints)
5179
5105
  .then(stream => {
5180
5106
  if (TranslationUtils.state.debug)
5181
- console.log(`id-capture ${this.guid} | openCamera | streamObtained`);
5182
- const superStream = Stream.getNewInstance(this.verificationMode);
5107
+ console.log(`id-capture | openCamera | streamObtained`);
5108
+ const superStream = Stream.getNewInstance(null);
5183
5109
  superStream.initStream(stream);
5184
5110
  })
5185
5111
  .catch(e => {
@@ -5190,7 +5116,7 @@ const IdCapture = class {
5190
5116
  }
5191
5117
  closeCamera() {
5192
5118
  if (TranslationUtils.state.debug)
5193
- console.log(`id-capture ${this.guid} | closeCamera`);
5119
+ console.log(`id-capture | closeCamera`);
5194
5120
  if (Stream.instance) {
5195
5121
  Stream.instance.dropStream();
5196
5122
  }
@@ -5201,23 +5127,23 @@ const IdCapture = class {
5201
5127
  IDML5Detector.instance = null;
5202
5128
  FaceML5Detector.instance = null;
5203
5129
  if (TranslationUtils.state.debug)
5204
- console.log(`id-capture ${this.guid} | disconnectedCallback`);
5130
+ console.log(`id-capture | disconnectedCallback`);
5205
5131
  }
5206
5132
  async takePhoto() {
5207
5133
  if (TranslationUtils.state.debug)
5208
- console.log(`id-capture ${this.guid} | takePhoto`);
5134
+ console.log(`id-capture | takePhoto`);
5209
5135
  if (this.captureTaken)
5210
5136
  return;
5211
5137
  this.captureTaken = true;
5212
5138
  if (TranslationUtils.state.debug)
5213
- console.log(`id-capture ${this.guid} | takePhoto | sendingPhoto`);
5139
+ console.log(`id-capture | takePhoto | sendingPhoto`);
5214
5140
  let res = await Stream.instance.takePhoto();
5215
5141
  this.eventPhotoCapture.emit(res);
5216
5142
  await BaseComponent.logStep(this.flowStep, TranslationUtils.FlowMoments.Finalized);
5217
5143
  }
5218
5144
  async verificationFinished() {
5219
5145
  if (TranslationUtils.state.debug)
5220
- console.log(`id-capture ${this.guid} | verificationFinished`);
5146
+ console.log(`id-capture | verificationFinished`);
5221
5147
  if (this.verified)
5222
5148
  return;
5223
5149
  this.verified = true;
@@ -5248,8 +5174,73 @@ const IdCapture = class {
5248
5174
  };
5249
5175
  IdCapture.style = idCaptureCss;
5250
5176
 
5177
+ // Unique ID creation requires a high quality random # generator. In the browser we therefore
5178
+ // require the crypto API and do not support built-in fallback to lower quality random number
5179
+ // generators (like Math.random()).
5180
+ let getRandomValues;
5181
+ const rnds8 = new Uint8Array(16);
5182
+ function rng() {
5183
+ // lazy load so that environments that need to polyfill have a chance to do so
5184
+ if (!getRandomValues) {
5185
+ // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
5186
+ getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
5187
+
5188
+ if (!getRandomValues) {
5189
+ throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
5190
+ }
5191
+ }
5192
+
5193
+ return getRandomValues(rnds8);
5194
+ }
5195
+
5196
+ /**
5197
+ * Convert array of 16 byte values to UUID string format of the form:
5198
+ * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
5199
+ */
5200
+
5201
+ const byteToHex = [];
5202
+
5203
+ for (let i = 0; i < 256; ++i) {
5204
+ byteToHex.push((i + 0x100).toString(16).slice(1));
5205
+ }
5206
+
5207
+ function unsafeStringify(arr, offset = 0) {
5208
+ // Note: Be careful editing this code! It's been tuned for performance
5209
+ // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
5210
+ return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
5211
+ }
5212
+
5213
+ const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
5214
+ const native = {
5215
+ randomUUID
5216
+ };
5217
+
5218
+ function v4(options, buf, offset) {
5219
+ if (native.randomUUID && !buf && !options) {
5220
+ return native.randomUUID();
5221
+ }
5222
+
5223
+ options = options || {};
5224
+ const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
5225
+
5226
+ rnds[6] = rnds[6] & 0x0f | 0x40;
5227
+ rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
5228
+
5229
+ if (buf) {
5230
+ offset = offset || 0;
5231
+
5232
+ for (let i = 0; i < 16; ++i) {
5233
+ buf[offset + i] = rnds[i];
5234
+ }
5235
+
5236
+ return buf;
5237
+ }
5238
+
5239
+ return unsafeStringify(rnds);
5240
+ }
5241
+
5251
5242
  const name = "@ekyc_qoobiss/qbs-ect-cmp";
5252
- const version$1 = "3.6.75";
5243
+ const version$1 = "3.6.76";
5253
5244
  const description = "Person Identification Component";
5254
5245
  const main = "./dist/index.cjs.js";
5255
5246
  const module$1 = "./dist/index.js";
@@ -9,14 +9,11 @@ import { delay } from '../../../utils/utils';
9
9
  import store from '../../../helpers/store';
10
10
  import { BaseComponent } from '../../base-component';
11
11
  import { FlowMoments, FlowSteps } from '../../../models/FlowSteps';
12
- import { VerificationMode } from '../../../models/IVerificationMode';
13
12
  import { Translations } from '../../../helpers/TranslationUtils';
14
13
  import { FlowStatus } from '../../../models/FlowStatus';
15
- import * as uuid from 'uuid';
16
14
  // import { IDPose } from '../../libs/IDML5Detector/IDPose';
17
15
  export class IdCapture {
18
16
  constructor() {
19
- this.guid = uuid.v4();
20
17
  this.videoStarted = undefined;
21
18
  this.cameraSize = undefined;
22
19
  this.captureTaken = undefined;
@@ -34,7 +31,7 @@ export class IdCapture {
34
31
  }
35
32
  async componentWillLoad() {
36
33
  if (store.debug)
37
- console.log(`id-capture ${this.guid} | componentWillLoad`);
34
+ console.log(`id-capture | componentWillLoad`);
38
35
  this.translations = await Translations.getValues();
39
36
  if (!navigator.mediaDevices) {
40
37
  this.apiErrorEvent.emit({ message: 'This browser does not support webRTC' });
@@ -42,29 +39,26 @@ export class IdCapture {
42
39
  }
43
40
  initVariables() {
44
41
  if (store.debug)
45
- console.log(`id-capture ${this.guid} | initVariables`);
42
+ console.log(`id-capture | initVariables`);
46
43
  if (store.flowStatus == FlowStatus.IDFRONT) {
47
44
  this.pose = IDPose.Straight;
48
45
  this.flowStep = FlowSteps.CiFrontCapture;
49
46
  this.titleMesage = this.translations.IdCaptureValues.Title;
50
- this.verificationMode = VerificationMode.Full;
51
47
  }
52
48
  else if (store.flowStatus == FlowStatus.IDBACK) {
53
49
  this.pose = IDPose.BackStraight;
54
50
  this.flowStep = FlowSteps.CiBackCapture;
55
51
  this.titleMesage = this.translations.IdCaptureValues.TtileRotate;
56
- this.verificationMode = VerificationMode.Full;
57
52
  }
58
53
  else if (store.flowStatus == FlowStatus.IDTILT) {
59
54
  this.titleMesage = this.translations.IdCaptureValues.IDPoseMapping;
60
55
  this.pose = IDPose.Tilted;
61
56
  this.flowStep = FlowSteps.CiTilt;
62
- this.verificationMode = VerificationMode.Tilt;
63
57
  }
64
58
  }
65
59
  async componentDidLoad() {
66
60
  if (store.debug)
67
- console.log(`id-capture ${this.guid} | componentDidLoad`);
61
+ console.log(`id-capture | componentDidLoad`);
68
62
  this.initVariables();
69
63
  await BaseComponent.logStep(this.flowStep, FlowMoments.Initialized);
70
64
  this.demoVideo.src = IdCaptureValues.IDPoseDemoMapping[this.pose];
@@ -75,7 +69,7 @@ export class IdCapture {
75
69
  }
76
70
  async openCamera() {
77
71
  if (store.debug)
78
- console.log(`id-capture ${this.guid} | openCamera`);
72
+ console.log(`id-capture | openCamera`);
79
73
  if (!store.cameraId) {
80
74
  await Cameras.InitCameras(store.device);
81
75
  }
@@ -85,8 +79,8 @@ export class IdCapture {
85
79
  .getUserMedia(constraints)
86
80
  .then(stream => {
87
81
  if (store.debug)
88
- console.log(`id-capture ${this.guid} | openCamera | streamObtained`);
89
- const superStream = Stream.getNewInstance(this.verificationMode);
82
+ console.log(`id-capture | openCamera | streamObtained`);
83
+ const superStream = Stream.getNewInstance(null);
90
84
  superStream.initStream(stream);
91
85
  })
92
86
  .catch(e => {
@@ -97,7 +91,7 @@ export class IdCapture {
97
91
  }
98
92
  closeCamera() {
99
93
  if (store.debug)
100
- console.log(`id-capture ${this.guid} | closeCamera`);
94
+ console.log(`id-capture | closeCamera`);
101
95
  if (Stream.instance) {
102
96
  Stream.instance.dropStream();
103
97
  }
@@ -108,23 +102,23 @@ export class IdCapture {
108
102
  IDML5Detector.instance = null;
109
103
  FaceML5Detector.instance = null;
110
104
  if (store.debug)
111
- console.log(`id-capture ${this.guid} | disconnectedCallback`);
105
+ console.log(`id-capture | disconnectedCallback`);
112
106
  }
113
107
  async takePhoto() {
114
108
  if (store.debug)
115
- console.log(`id-capture ${this.guid} | takePhoto`);
109
+ console.log(`id-capture | takePhoto`);
116
110
  if (this.captureTaken)
117
111
  return;
118
112
  this.captureTaken = true;
119
113
  if (store.debug)
120
- console.log(`id-capture ${this.guid} | takePhoto | sendingPhoto`);
114
+ console.log(`id-capture | takePhoto | sendingPhoto`);
121
115
  let res = await Stream.instance.takePhoto();
122
116
  this.eventPhotoCapture.emit(res);
123
117
  await BaseComponent.logStep(this.flowStep, FlowMoments.Finalized);
124
118
  }
125
119
  async verificationFinished() {
126
120
  if (store.debug)
127
- console.log(`id-capture ${this.guid} | verificationFinished`);
121
+ console.log(`id-capture | verificationFinished`);
128
122
  if (this.verified)
129
123
  return;
130
124
  this.verified = true;
@@ -5,7 +5,6 @@ import { FacePosePick } from '../libs/FaceML5Detector/FacePose';
5
5
  import { addExifInImg } from './security';
6
6
  import store from './store';
7
7
  import { Browser, MobileOS } from '../models/IDevice';
8
- import * as uuid from 'uuid';
9
8
  var ImageFormat;
10
9
  (function (ImageFormat) {
11
10
  ImageFormat["JPEG"] = "image/jpeg";
@@ -37,11 +36,10 @@ export class Stream {
37
36
  }
38
37
  constructor(mode) {
39
38
  this.streamPaused = false;
40
- this.guid = uuid.v4();
41
39
  this.recordedChunks = [];
42
40
  this.videoSize = { width: 0, height: 0 };
43
41
  if (store.debug)
44
- console.log(`stream ${this.guid} | constructor`);
42
+ console.log(`stream | constructor`);
45
43
  this.initFacePose();
46
44
  this.idML5Detector = IDML5Detector.getInstance(this, store.device.isMobile);
47
45
  this.faceML5Detector = FaceML5Detector.getInstance(this, store.device.isMobile);
@@ -53,23 +51,23 @@ export class Stream {
53
51
  if (!Stream.instance) {
54
52
  Stream.instance = new Stream(mode);
55
53
  if (store.debug)
56
- console.log(`stream ${Stream.instance.guid} | getNewInstance | new instance`);
54
+ console.log(`stream | getNewInstance | new instance`);
57
55
  }
58
56
  return Stream.instance;
59
57
  }
60
58
  autoCapturing() {
61
59
  if (store.debug)
62
- console.log(`stream ${this.guid} | autoCapturing`);
60
+ console.log(`stream | autoCapturing`);
63
61
  this.callbackAutoCapturing();
64
62
  }
65
63
  timeElapsed() {
66
64
  if (store.debug)
67
- console.log(`stream ${this.guid} | timeElapsed`);
65
+ console.log(`stream | timeElapsed`);
68
66
  this.callbackTimeElapsed();
69
67
  }
70
68
  verificationReady() {
71
69
  if (store.debug)
72
- console.log(`stream ${this.guid} | verificationReady`);
70
+ console.log(`stream | verificationReady`);
73
71
  this.verificationFinished();
74
72
  }
75
73
  updateHtmlElements(videoElement, canvasElement, component) {
@@ -80,7 +78,7 @@ export class Stream {
80
78
  }
81
79
  startStream(stream) {
82
80
  if (store.debug)
83
- console.log(`stream ${this.guid} | startStream`);
81
+ console.log(`stream | startStream`);
84
82
  if (this.stream)
85
83
  this.stream.getTracks().forEach((track) => track.stop());
86
84
  this.stream = stream;
@@ -113,7 +111,7 @@ export class Stream {
113
111
  }
114
112
  recordStream() {
115
113
  if (store.debug)
116
- console.log(`stream ${this.guid} | recordStream`);
114
+ console.log(`stream | recordStream`);
117
115
  if (this.mediaRecorder && this.mediaRecorder.state == 'recording')
118
116
  return;
119
117
  var options = { mimeType: Stream.webmMimeType.mime, videoBitsPerSecond: 1500000 };
@@ -125,12 +123,12 @@ export class Stream {
125
123
  this.mediaRecorder = new MediaRecorder(this.stream, options);
126
124
  this.mediaRecorder.ondataavailable = event => {
127
125
  if (store.debug)
128
- console.log(`stream ${this.guid} | recordStream | ondataavailable`);
126
+ console.log(`stream | recordStream | ondataavailable`);
129
127
  this.recordedChunks.push(event.data);
130
128
  };
131
129
  this.mediaRecorder.onstop = _e => {
132
130
  if (store.debug)
133
- console.log(`stream ${this.guid} | recordStream | onstop`);
131
+ console.log(`stream | recordStream | onstop`);
134
132
  var rec = new Blob(this.recordedChunks, {
135
133
  type: options.mimeType.split(';')[0],
136
134
  });
@@ -162,7 +160,7 @@ export class Stream {
162
160
  }
163
161
  async takePhoto() {
164
162
  if (store.debug)
165
- console.log(`stream ${this.guid} | takePhoto`);
163
+ console.log(`stream | takePhoto`);
166
164
  const canvas = document.createElement('canvas');
167
165
  canvas.style.visibility = 'hidden';
168
166
  canvas.width = this.videoElement.videoWidth;
@@ -171,7 +169,7 @@ export class Stream {
171
169
  }
172
170
  getFrame(canvas) {
173
171
  if (store.debug)
174
- console.log(`stream ${this.guid} | getFrame`);
172
+ console.log(`stream | getFrame`);
175
173
  return new Promise(resolve => {
176
174
  const context = canvas.getContext('2d');
177
175
  context.drawImage(this.videoElement, 0, 0, canvas.width, canvas.height);
@@ -179,7 +177,7 @@ export class Stream {
179
177
  if (frame.type === ImageFormat.JPEG && !store.device.isAppleDevice) {
180
178
  try {
181
179
  if (store.debug)
182
- console.log(`stream ${this.guid} | getFrame | addExifInImg`);
180
+ console.log(`stream | getFrame | addExifInImg`);
183
181
  addExifInImg(frame, this.stream.getTracks()[0], this.videoSize).then(updatedFrame => resolve(updatedFrame));
184
182
  }
185
183
  catch (e) {
@@ -189,7 +187,7 @@ export class Stream {
189
187
  }
190
188
  else {
191
189
  if (store.debug)
192
- console.log(`stream ${this.guid} | getFrame | resolve`);
190
+ console.log(`stream | getFrame | resolve`);
193
191
  resolve(frame);
194
192
  }
195
193
  }, ImageFormat.PNG, 1);
@@ -198,7 +196,7 @@ export class Stream {
198
196
  async startIdDetection() {
199
197
  if (this.streamPaused)
200
198
  return;
201
- this.idML5Detector.initDetector(this.verificationMode);
199
+ this.idML5Detector.initDetector();
202
200
  }
203
201
  async startFaceDetection() {
204
202
  if (this.streamPaused)