@ekyc_qoobiss/qbs-ect-cmp 3.6.63 → 3.6.65

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.
Files changed (27) hide show
  1. package/dist/cjs/{TranslationUtils-fbb2c39c.js → TranslationUtils-eeb71e60.js} +15 -10
  2. package/dist/cjs/agreement-check_17.cjs.entry.js +135 -73
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/qbs-ect-cmp.cjs.js +1 -1
  5. package/dist/cjs/random-actions.cjs.entry.js +1 -1
  6. package/dist/collection/components/common/how-to-info/how-to-info.js +3 -17
  7. package/dist/collection/components/flow/process-id/process-id.js +50 -42
  8. package/dist/collection/components/flow/user-liveness/user-liveness.js +47 -38
  9. package/dist/collection/components/identification-component/identification-component.js +48 -4
  10. package/dist/collection/models/FlowStatus.js +15 -11
  11. package/dist/esm/{TranslationUtils-32c06882.js → TranslationUtils-21a568f6.js} +15 -10
  12. package/dist/esm/agreement-check_17.entry.js +135 -73
  13. package/dist/esm/loader.js +1 -1
  14. package/dist/esm/qbs-ect-cmp.js +1 -1
  15. package/dist/esm/random-actions.entry.js +1 -1
  16. package/dist/qbs-ect-cmp/p-2735b5f4.js +1 -0
  17. package/dist/qbs-ect-cmp/{p-deb65af1.entry.js → p-3695074a.entry.js} +2 -2
  18. package/dist/qbs-ect-cmp/{p-fc771dd3.entry.js → p-4fef4884.entry.js} +1 -1
  19. package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
  20. package/dist/types/components/common/how-to-info/how-to-info.d.ts +1 -2
  21. package/dist/types/components/flow/process-id/process-id.d.ts +3 -1
  22. package/dist/types/components/flow/user-liveness/user-liveness.d.ts +3 -2
  23. package/dist/types/components.d.ts +0 -1
  24. package/dist/types/models/CaptureFlow.d.ts +0 -1
  25. package/dist/types/models/FlowStatus.d.ts +15 -10
  26. package/package.json +1 -1
  27. package/dist/qbs-ect-cmp/p-601c9197.js +0 -1
@@ -3,7 +3,7 @@ import store from '../../../helpers/store';
3
3
  import { Stream } from '../../../helpers/Stream';
4
4
  import { FlowStatus } from '../../../models/FlowStatus';
5
5
  import { FlowSteps } from '../../../models/FlowSteps';
6
- import { getLogMessage } from '../../../utils/utils';
6
+ import { delay, getLogMessage } from '../../../utils/utils';
7
7
  import { BaseComponent } from '../../base-component';
8
8
  import { CaptureUploadTypes } from '../../../models/CaptureFlow';
9
9
  import { ApiCall } from '../../../helpers/ApiCall';
@@ -15,38 +15,28 @@ export class UserLiveness {
15
15
  this.showError = undefined;
16
16
  this.showTimeout = undefined;
17
17
  this.flow = undefined;
18
- this.howToDone = false;
19
18
  }
20
19
  async componentDidLoad() { }
21
20
  componentWillLoad() {
22
21
  if (this.mode == 'selfie') {
23
22
  this.currentStep = FlowSteps.Selfie;
24
23
  this.flow = {
25
- capture: {
26
- fileName: 'selfie.png',
27
- recName: 'selfieVideo.',
28
- photoType: CaptureUploadTypes.Selfie,
29
- recType: CaptureUploadTypes.SelfieVideo,
30
- },
31
- howToDone: false,
24
+ fileName: 'selfie.png',
25
+ recName: 'selfieVideo.',
26
+ photoType: CaptureUploadTypes.Selfie,
27
+ recType: CaptureUploadTypes.SelfieVideo,
32
28
  };
33
29
  }
34
30
  else if (this.mode == 'selfieGesture') {
35
31
  this.currentStep = FlowSteps.SelfieTilt;
36
32
  this.flow = {
37
- capture: {
38
- fileName: '',
39
- recName: 'selfieTiltVideo.',
40
- photoType: CaptureUploadTypes.None,
41
- recType: CaptureUploadTypes.SelfieGestureVideo,
42
- },
43
- howToDone: false,
33
+ fileName: '',
34
+ recName: 'selfieTiltVideo.',
35
+ photoType: CaptureUploadTypes.None,
36
+ recType: CaptureUploadTypes.SelfieGestureVideo,
44
37
  };
45
38
  }
46
39
  }
47
- howToDoneEvent() {
48
- this.howToDone = true;
49
- }
50
40
  timeElapsed() {
51
41
  this.errorReason = 'Timeout';
52
42
  this.showTimeout = true;
@@ -69,8 +59,8 @@ export class UserLiveness {
69
59
  return;
70
60
  }
71
61
  try {
72
- var uploadPhoto = new File([selfiePhoto], this.flow.capture.fileName, { type: 'image/png' });
73
- let photoUploaded = await ApiCall.instance.UploadFileForRequestB64(store.requestId, this.flow.capture.photoType, uploadPhoto);
62
+ var uploadPhoto = new File([selfiePhoto], this.flow.fileName, { type: 'image/png' });
63
+ let photoUploaded = await ApiCall.instance.UploadFileForRequestB64(store.requestId, this.flow.photoType, uploadPhoto);
74
64
  if (photoUploaded.isValid) {
75
65
  store.flowStatus = FlowStatus[photoUploaded.state];
76
66
  }
@@ -96,8 +86,8 @@ export class UserLiveness {
96
86
  }
97
87
  let mimeType = selfieRecording.type == Stream.mp4MimeType.type ? Stream.mp4MimeType : Stream.webmMimeType;
98
88
  try {
99
- let uploadRec = new File([selfieRecording], this.flow.capture.recName + mimeType.extension, { type: mimeType.type });
100
- let uplodDone = await ApiCall.instance.UploadFileForRequestB64(store.requestId, this.flow.capture.recType, uploadRec);
89
+ let uploadRec = new File([selfieRecording], this.flow.recName + mimeType.extension, { type: mimeType.type });
90
+ let uplodDone = await ApiCall.instance.UploadFileForRequestB64(store.requestId, this.flow.recType, uploadRec);
101
91
  if (uplodDone.saved) {
102
92
  store.flowStatus = FlowStatus[uplodDone.state];
103
93
  }
@@ -115,6 +105,32 @@ export class UserLiveness {
115
105
  }
116
106
  }
117
107
  }
108
+ async verificationFinished() {
109
+ if (store.debug)
110
+ console.log('user-liveness | verificationFinished');
111
+ this.verificationReceived = Date.now();
112
+ let initialStatus = store.flowStatus;
113
+ let statusChanged = false;
114
+ while (Date.now() - this.verificationReceived < 25000 && !statusChanged) {
115
+ await delay(2000);
116
+ statusChanged = initialStatus != store.flowStatus;
117
+ }
118
+ if (!statusChanged) {
119
+ let currentStatus = await ApiCall.instance.GetFlowState();
120
+ if (currentStatus != store.flowStatus) {
121
+ store.flowStatus = currentStatus;
122
+ }
123
+ else {
124
+ this.triggerUploadFailedFlow();
125
+ }
126
+ }
127
+ if (store.debug)
128
+ console.log('user-liveness | verificationFinished | waitingFinished ');
129
+ }
130
+ triggerUploadFailedFlow() {
131
+ this.errorReason = 'Upload Failed';
132
+ this.showError = true;
133
+ }
118
134
  async disconnectedCallback() {
119
135
  await BaseComponent.finalize(this.currentStep);
120
136
  }
@@ -123,18 +139,12 @@ export class UserLiveness {
123
139
  this.showError = true;
124
140
  }
125
141
  render() {
126
- let howTo = h("how-to-info", null);
127
142
  let capture = h("selfie-capture", null);
128
143
  let error = h("capture-error", { type: "LIVENESS", reason: this.errorReason });
129
144
  if (this.showError || this.showTimeout) {
130
145
  return error;
131
146
  }
132
- if (this.howToDone) {
133
- return capture;
134
- }
135
- else {
136
- return howTo;
137
- }
147
+ return capture;
138
148
  }
139
149
  static get is() { return "user-liveness"; }
140
150
  static get originalStyleUrls() {
@@ -172,8 +182,7 @@ export class UserLiveness {
172
182
  return {
173
183
  "showError": {},
174
184
  "showTimeout": {},
175
- "flow": {},
176
- "howToDone": {}
185
+ "flow": {}
177
186
  };
178
187
  }
179
188
  static get events() {
@@ -196,12 +205,6 @@ export class UserLiveness {
196
205
  }
197
206
  static get listeners() {
198
207
  return [{
199
- "name": "howToInfoDone",
200
- "method": "howToDoneEvent",
201
- "target": undefined,
202
- "capture": false,
203
- "passive": false
204
- }, {
205
208
  "name": "timeElapsed",
206
209
  "method": "timeElapsed",
207
210
  "target": undefined,
@@ -225,6 +228,12 @@ export class UserLiveness {
225
228
  "target": undefined,
226
229
  "capture": false,
227
230
  "passive": false
231
+ }, {
232
+ "name": "verificationFinished",
233
+ "method": "verificationFinished",
234
+ "target": undefined,
235
+ "capture": false,
236
+ "passive": false
228
237
  }];
229
238
  }
230
239
  }
@@ -189,11 +189,55 @@ export class IdentificationComponent {
189
189
  else if (store.flowStatus == FlowStatus.CODEERROR) {
190
190
  currentBlock = h("sms-code-validation", null);
191
191
  }
192
- else if ([FlowStatus.IDFRONT, FlowStatus.IDBACK, FlowStatus.IDTILT].includes(store.flowStatus)) {
193
- currentBlock = (h("div", null, h("process-id", { id: "processIdFront", mode: "front", hidden: store.flowStatus != FlowStatus.IDFRONT }), h("process-id", { id: "processIdBack", mode: "back", hidden: store.flowStatus != FlowStatus.IDBACK }), h("process-id", { id: "processIdTilt", mode: "tilt", hidden: store.flowStatus != FlowStatus.IDTILT })));
192
+ else if (store.flowStatus == FlowStatus.IDFRONTHOWTO) {
193
+ if (store.debug)
194
+ console.log('identification-component | render | IDFRONTHOWTO');
195
+ currentBlock = h("how-to-info", null);
196
+ }
197
+ else if (store.flowStatus == FlowStatus.IDFRONT) {
198
+ if (store.debug)
199
+ console.log('identification-component | render | IDFRONT');
200
+ currentBlock = h("process-id", { id: "processIdFront", mode: "front" });
201
+ }
202
+ else if (store.flowStatus == FlowStatus.IDBACKHOWTO) {
203
+ if (store.debug)
204
+ console.log('identification-component | render | IDBACKHOWTO');
205
+ currentBlock = h("how-to-info", null);
206
+ }
207
+ else if (store.flowStatus == FlowStatus.IDBACK) {
208
+ if (store.debug)
209
+ console.log('identification-component | render | IDBACK');
210
+ currentBlock = h("process-id", { id: "processIdBack", mode: "back" });
211
+ }
212
+ else if (store.flowStatus == FlowStatus.IDTILTHOWTO) {
213
+ if (store.debug)
214
+ console.log('identification-component | render | IDTILTHOWTO');
215
+ currentBlock = h("how-to-info", null);
194
216
  }
195
- else if ([FlowStatus.LIVENESS, FlowStatus.LIVENESSGESTURE].includes(store.flowStatus)) {
196
- currentBlock = (h("div", null, h("user-liveness", { id: "userLiveness", mode: "selfie", hidden: store.flowStatus != FlowStatus.LIVENESS }), h("user-liveness", { id: "userLivenessGesture", mode: "selfieGesture", hidden: store.flowStatus != FlowStatus.LIVENESSGESTURE })));
217
+ else if (store.flowStatus == FlowStatus.IDTILT) {
218
+ if (store.debug)
219
+ console.log('identification-component | render | TILT');
220
+ currentBlock = h("process-id", { id: "processIdTilt", mode: "tilt" });
221
+ }
222
+ else if (store.flowStatus == FlowStatus.LIVENESSHOWTO) {
223
+ if (store.debug)
224
+ console.log('identification-component | render | LIVENESSHOWTO');
225
+ currentBlock = h("how-to-info", null);
226
+ }
227
+ else if (store.flowStatus == FlowStatus.LIVENESS) {
228
+ if (store.debug)
229
+ console.log('identification-component | render | LIVENESS');
230
+ currentBlock = h("user-liveness", { id: "userLiveness", mode: "selfie" });
231
+ }
232
+ else if (store.flowStatus == FlowStatus.LIVENESSGESTUREHOWTO) {
233
+ if (store.debug)
234
+ console.log('identification-component | render | LIVENESSGESTUREHOWTO');
235
+ currentBlock = h("how-to-info", null);
236
+ }
237
+ else if (store.flowStatus == FlowStatus.LIVENESSGESTURE) {
238
+ if (store.debug)
239
+ console.log('identification-component | render | LIVENESSGESTURE');
240
+ currentBlock = h("user-liveness", { id: "userLivenessGesture", mode: "selfieGesture" });
197
241
  }
198
242
  else if (store.flowStatus == FlowStatus.COMPLETE) {
199
243
  if (store.debug)
@@ -6,15 +6,19 @@ export var FlowStatus;
6
6
  FlowStatus[FlowStatus["PHONE"] = 3] = "PHONE";
7
7
  FlowStatus[FlowStatus["CODE"] = 4] = "CODE";
8
8
  FlowStatus[FlowStatus["CODEERROR"] = 5] = "CODEERROR";
9
- FlowStatus[FlowStatus["IDFRONT"] = 6] = "IDFRONT";
10
- FlowStatus[FlowStatus["IDBACK"] = 7] = "IDBACK";
11
- FlowStatus[FlowStatus["IDTILT"] = 8] = "IDTILT";
12
- FlowStatus[FlowStatus["LIVENESS"] = 9] = "LIVENESS";
13
- FlowStatus[FlowStatus["LIVENESSGESTURE"] = 10] = "LIVENESSGESTURE";
14
- FlowStatus[FlowStatus["COMPLETE"] = 11] = "COMPLETE";
15
- FlowStatus[FlowStatus["ERROREND"] = 12] = "ERROREND";
16
- FlowStatus[FlowStatus["CAMERAERROR"] = 13] = "CAMERAERROR";
17
- FlowStatus[FlowStatus["ABORTED"] = 14] = "ABORTED";
18
- FlowStatus[FlowStatus["NONE"] = 15] = "NONE";
9
+ FlowStatus[FlowStatus["IDFRONTHOWTO"] = 6] = "IDFRONTHOWTO";
10
+ FlowStatus[FlowStatus["IDFRONT"] = 7] = "IDFRONT";
11
+ FlowStatus[FlowStatus["IDBACKHOWTO"] = 8] = "IDBACKHOWTO";
12
+ FlowStatus[FlowStatus["IDBACK"] = 9] = "IDBACK";
13
+ FlowStatus[FlowStatus["IDTILTHOWTO"] = 10] = "IDTILTHOWTO";
14
+ FlowStatus[FlowStatus["IDTILT"] = 11] = "IDTILT";
15
+ FlowStatus[FlowStatus["LIVENESSHOWTO"] = 12] = "LIVENESSHOWTO";
16
+ FlowStatus[FlowStatus["LIVENESS"] = 13] = "LIVENESS";
17
+ FlowStatus[FlowStatus["LIVENESSGESTUREHOWTO"] = 14] = "LIVENESSGESTUREHOWTO";
18
+ FlowStatus[FlowStatus["LIVENESSGESTURE"] = 15] = "LIVENESSGESTURE";
19
+ FlowStatus[FlowStatus["COMPLETE"] = 16] = "COMPLETE";
20
+ FlowStatus[FlowStatus["ERROREND"] = 17] = "ERROREND";
21
+ FlowStatus[FlowStatus["CAMERAERROR"] = 18] = "CAMERAERROR";
22
+ FlowStatus[FlowStatus["ABORTED"] = 19] = "ABORTED";
23
+ FlowStatus[FlowStatus["NONE"] = 20] = "NONE";
19
24
  })(FlowStatus || (FlowStatus = {}));
20
- ;
@@ -208,16 +208,21 @@ var FlowStatus;
208
208
  FlowStatus[FlowStatus["PHONE"] = 3] = "PHONE";
209
209
  FlowStatus[FlowStatus["CODE"] = 4] = "CODE";
210
210
  FlowStatus[FlowStatus["CODEERROR"] = 5] = "CODEERROR";
211
- FlowStatus[FlowStatus["IDFRONT"] = 6] = "IDFRONT";
212
- FlowStatus[FlowStatus["IDBACK"] = 7] = "IDBACK";
213
- FlowStatus[FlowStatus["IDTILT"] = 8] = "IDTILT";
214
- FlowStatus[FlowStatus["LIVENESS"] = 9] = "LIVENESS";
215
- FlowStatus[FlowStatus["LIVENESSGESTURE"] = 10] = "LIVENESSGESTURE";
216
- FlowStatus[FlowStatus["COMPLETE"] = 11] = "COMPLETE";
217
- FlowStatus[FlowStatus["ERROREND"] = 12] = "ERROREND";
218
- FlowStatus[FlowStatus["CAMERAERROR"] = 13] = "CAMERAERROR";
219
- FlowStatus[FlowStatus["ABORTED"] = 14] = "ABORTED";
220
- FlowStatus[FlowStatus["NONE"] = 15] = "NONE";
211
+ FlowStatus[FlowStatus["IDFRONTHOWTO"] = 6] = "IDFRONTHOWTO";
212
+ FlowStatus[FlowStatus["IDFRONT"] = 7] = "IDFRONT";
213
+ FlowStatus[FlowStatus["IDBACKHOWTO"] = 8] = "IDBACKHOWTO";
214
+ FlowStatus[FlowStatus["IDBACK"] = 9] = "IDBACK";
215
+ FlowStatus[FlowStatus["IDTILTHOWTO"] = 10] = "IDTILTHOWTO";
216
+ FlowStatus[FlowStatus["IDTILT"] = 11] = "IDTILT";
217
+ FlowStatus[FlowStatus["LIVENESSHOWTO"] = 12] = "LIVENESSHOWTO";
218
+ FlowStatus[FlowStatus["LIVENESS"] = 13] = "LIVENESS";
219
+ FlowStatus[FlowStatus["LIVENESSGESTUREHOWTO"] = 14] = "LIVENESSGESTUREHOWTO";
220
+ FlowStatus[FlowStatus["LIVENESSGESTURE"] = 15] = "LIVENESSGESTURE";
221
+ FlowStatus[FlowStatus["COMPLETE"] = 16] = "COMPLETE";
222
+ FlowStatus[FlowStatus["ERROREND"] = 17] = "ERROREND";
223
+ FlowStatus[FlowStatus["CAMERAERROR"] = 18] = "CAMERAERROR";
224
+ FlowStatus[FlowStatus["ABORTED"] = 19] = "ABORTED";
225
+ FlowStatus[FlowStatus["NONE"] = 20] = "NONE";
221
226
  })(FlowStatus || (FlowStatus = {}));
222
227
 
223
228
  class IdCaptureValues {
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, g as getElement } from './index-cf54a432.js';
2
- import { A as ApiCall, T as Translations, F as FlowMoments, a as FlowSteps, s as state, S as SessionKeys, b as FlowStatus, I as IdCaptureValues, O as OrderStatuses, c as SelfieCaptureValues } from './TranslationUtils-32c06882.js';
2
+ import { A as ApiCall, T as Translations, F as FlowMoments, a as FlowSteps, s as state, S as SessionKeys, b as FlowStatus, I as IdCaptureValues, O as OrderStatuses, c as SelfieCaptureValues } from './TranslationUtils-21a568f6.js';
3
3
 
4
4
  const agreementCheckCss = "";
5
5
 
@@ -4794,16 +4794,16 @@ ErrorEnd.style = errorEndCss;
4794
4794
  const howToInfoCss = "";
4795
4795
 
4796
4796
  const HowToInfo = class {
4797
- constructor(hostRef) { registerInstance(this, hostRef); this.eventHowToInfoDone = createEvent(this, "howToInfoDone", 7); this.apiErrorEvent = createEvent(this, "apiError", 7); this.topTitle = undefined; this.subTitle = undefined; this.imagePath = undefined; this.buttonText = undefined; this.buttonEnabled = undefined; }
4797
+ constructor(hostRef) { registerInstance(this, hostRef); this.apiErrorEvent = createEvent(this, "apiError", 7); this.topTitle = undefined; this.subTitle = undefined; this.imagePath = undefined; this.buttonText = undefined; this.buttonEnabled = undefined; }
4798
4798
  async componentDidLoad() {
4799
4799
  await BaseComponent.initialize(this.currentStep);
4800
4800
  }
4801
4801
  async disconnectedCallback() {
4802
4802
  await BaseComponent.finalize(this.currentStep);
4803
4803
  }
4804
- buttonClick() {
4804
+ async buttonClick() {
4805
4805
  this.buttonEnabled = false;
4806
- this.eventHowToInfoDone.emit();
4806
+ state.flowStatus = await ApiCall.instance.GetNextFlowState();
4807
4807
  }
4808
4808
  async componentWillLoad() {
4809
4809
  this.translations = await Translations.getValues();
@@ -5204,7 +5204,7 @@ function v4(options, buf, offset) {
5204
5204
  }
5205
5205
 
5206
5206
  const name = "@ekyc_qoobiss/qbs-ect-cmp";
5207
- const version$1 = "3.6.63";
5207
+ const version$1 = "3.6.65";
5208
5208
  const description = "Person Identification Component";
5209
5209
  const main = "./dist/index.cjs.js";
5210
5210
  const module = "./dist/index.js";
@@ -5534,11 +5534,55 @@ const IdentificationComponent = class {
5534
5534
  else if (state.flowStatus == FlowStatus.CODEERROR) {
5535
5535
  currentBlock = h("sms-code-validation", null);
5536
5536
  }
5537
- else if ([FlowStatus.IDFRONT, FlowStatus.IDBACK, FlowStatus.IDTILT].includes(state.flowStatus)) {
5538
- currentBlock = (h("div", null, h("process-id", { id: "processIdFront", mode: "front", hidden: state.flowStatus != FlowStatus.IDFRONT }), h("process-id", { id: "processIdBack", mode: "back", hidden: state.flowStatus != FlowStatus.IDBACK }), h("process-id", { id: "processIdTilt", mode: "tilt", hidden: state.flowStatus != FlowStatus.IDTILT })));
5537
+ else if (state.flowStatus == FlowStatus.IDFRONTHOWTO) {
5538
+ if (state.debug)
5539
+ console.log('identification-component | render | IDFRONTHOWTO');
5540
+ currentBlock = h("how-to-info", null);
5541
+ }
5542
+ else if (state.flowStatus == FlowStatus.IDFRONT) {
5543
+ if (state.debug)
5544
+ console.log('identification-component | render | IDFRONT');
5545
+ currentBlock = h("process-id", { id: "processIdFront", mode: "front" });
5546
+ }
5547
+ else if (state.flowStatus == FlowStatus.IDBACKHOWTO) {
5548
+ if (state.debug)
5549
+ console.log('identification-component | render | IDBACKHOWTO');
5550
+ currentBlock = h("how-to-info", null);
5551
+ }
5552
+ else if (state.flowStatus == FlowStatus.IDBACK) {
5553
+ if (state.debug)
5554
+ console.log('identification-component | render | IDBACK');
5555
+ currentBlock = h("process-id", { id: "processIdBack", mode: "back" });
5556
+ }
5557
+ else if (state.flowStatus == FlowStatus.IDTILTHOWTO) {
5558
+ if (state.debug)
5559
+ console.log('identification-component | render | IDTILTHOWTO');
5560
+ currentBlock = h("how-to-info", null);
5561
+ }
5562
+ else if (state.flowStatus == FlowStatus.IDTILT) {
5563
+ if (state.debug)
5564
+ console.log('identification-component | render | TILT');
5565
+ currentBlock = h("process-id", { id: "processIdTilt", mode: "tilt" });
5566
+ }
5567
+ else if (state.flowStatus == FlowStatus.LIVENESSHOWTO) {
5568
+ if (state.debug)
5569
+ console.log('identification-component | render | LIVENESSHOWTO');
5570
+ currentBlock = h("how-to-info", null);
5571
+ }
5572
+ else if (state.flowStatus == FlowStatus.LIVENESS) {
5573
+ if (state.debug)
5574
+ console.log('identification-component | render | LIVENESS');
5575
+ currentBlock = h("user-liveness", { id: "userLiveness", mode: "selfie" });
5576
+ }
5577
+ else if (state.flowStatus == FlowStatus.LIVENESSGESTUREHOWTO) {
5578
+ if (state.debug)
5579
+ console.log('identification-component | render | LIVENESSGESTUREHOWTO');
5580
+ currentBlock = h("how-to-info", null);
5539
5581
  }
5540
- else if ([FlowStatus.LIVENESS, FlowStatus.LIVENESSGESTURE].includes(state.flowStatus)) {
5541
- currentBlock = (h("div", null, h("user-liveness", { id: "userLiveness", mode: "selfie", hidden: state.flowStatus != FlowStatus.LIVENESS }), h("user-liveness", { id: "userLivenessGesture", mode: "selfieGesture", hidden: state.flowStatus != FlowStatus.LIVENESSGESTURE })));
5582
+ else if (state.flowStatus == FlowStatus.LIVENESSGESTURE) {
5583
+ if (state.debug)
5584
+ console.log('identification-component | render | LIVENESSGESTURE');
5585
+ currentBlock = h("user-liveness", { id: "userLivenessGesture", mode: "selfieGesture" });
5542
5586
  }
5543
5587
  else if (state.flowStatus == FlowStatus.COMPLETE) {
5544
5588
  if (state.debug)
@@ -8623,45 +8667,33 @@ const ProcessId = class {
8623
8667
  if (this.mode == 'front') {
8624
8668
  this.currentStep = FlowSteps.CiFront;
8625
8669
  this.flow = {
8626
- capture: {
8627
- fileName: 'idImage.png',
8628
- recName: 'idVideo.',
8629
- photoType: CaptureUploadTypes.IdFront,
8630
- recType: CaptureUploadTypes.IdFrontVideo,
8631
- },
8632
- howToDone: false,
8670
+ fileName: 'idImage.png',
8671
+ recName: 'idVideo.',
8672
+ photoType: CaptureUploadTypes.IdFront,
8673
+ recType: CaptureUploadTypes.IdFrontVideo,
8633
8674
  };
8634
8675
  }
8635
8676
  else if (this.mode == 'back') {
8636
8677
  this.currentStep = FlowSteps.CiBack;
8637
8678
  this.flow = {
8638
- capture: {
8639
- fileName: 'idBackImage.png',
8640
- recName: 'idBackVideo.',
8641
- photoType: CaptureUploadTypes.IdBack,
8642
- recType: CaptureUploadTypes.IdBackVideo,
8643
- },
8644
- howToDone: false,
8679
+ fileName: 'idBackImage.png',
8680
+ recName: 'idBackVideo.',
8681
+ photoType: CaptureUploadTypes.IdBack,
8682
+ recType: CaptureUploadTypes.IdBackVideo,
8645
8683
  };
8646
8684
  }
8647
8685
  else if (this.mode == 'tilt') {
8648
8686
  this.currentStep = FlowSteps.CiTilt;
8649
8687
  this.flow = {
8650
- capture: {
8651
- fileName: 'idTiltImage.png',
8652
- recName: 'idTiltVideo.',
8653
- photoType: CaptureUploadTypes.None,
8654
- recType: CaptureUploadTypes.TiltVideo,
8655
- },
8656
- howToDone: false,
8688
+ fileName: 'idTiltImage.png',
8689
+ recName: 'idTiltVideo.',
8690
+ photoType: CaptureUploadTypes.None,
8691
+ recType: CaptureUploadTypes.TiltVideo,
8657
8692
  };
8658
8693
  }
8659
8694
  if (state.debug)
8660
8695
  console.log('process-id | initFlow');
8661
8696
  }
8662
- howToDone() {
8663
- this.flow.howToDone = true;
8664
- }
8665
8697
  timeElapsed() {
8666
8698
  this.errorReason = 'Timeout';
8667
8699
  this.showTimeout = true;
@@ -8688,8 +8720,8 @@ const ProcessId = class {
8688
8720
  return;
8689
8721
  }
8690
8722
  try {
8691
- let frontCapture = new File([idPhoto], this.flow.capture.fileName, { type: 'image/png' });
8692
- var uploadResult = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.capture.photoType, frontCapture);
8723
+ let frontCapture = new File([idPhoto], this.flow.fileName, { type: 'image/png' });
8724
+ var uploadResult = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.photoType, frontCapture);
8693
8725
  if (state.debug)
8694
8726
  console.log('process-id | captureIdImage | uploadResult: ' + uploadResult);
8695
8727
  if (uploadResult.isValid) {
@@ -8720,8 +8752,8 @@ const ProcessId = class {
8720
8752
  return;
8721
8753
  }
8722
8754
  let mimeType = idRecording.type == Stream.mp4MimeType.type ? Stream.mp4MimeType : Stream.webmMimeType;
8723
- let captureRec = new File([idRecording], this.flow.capture.recName + mimeType.extension, { type: mimeType.type });
8724
- var uploadResult = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.capture.recType, captureRec);
8755
+ let captureRec = new File([idRecording], this.flow.recName + mimeType.extension, { type: mimeType.type });
8756
+ var uploadResult = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.recType, captureRec);
8725
8757
  if (state.debug)
8726
8758
  console.log('process-id | capturedIdRecording | uploadResult: ' + uploadResult);
8727
8759
  if (uploadResult.saved) {
@@ -8732,6 +8764,32 @@ const ProcessId = class {
8732
8764
  }
8733
8765
  this.recordingResultCount = 0;
8734
8766
  }
8767
+ async verificationFinished() {
8768
+ if (state.debug)
8769
+ console.log('process-id | verificationFinished');
8770
+ this.verificationReceived = Date.now();
8771
+ let initialStatus = state.flowStatus;
8772
+ let statusChanged = false;
8773
+ while (Date.now() - this.verificationReceived < 25000 && !statusChanged) {
8774
+ await delay(2000);
8775
+ statusChanged = initialStatus != state.flowStatus;
8776
+ }
8777
+ if (!statusChanged) {
8778
+ let currentStatus = await ApiCall.instance.GetFlowState();
8779
+ if (currentStatus != state.flowStatus) {
8780
+ state.flowStatus = currentStatus;
8781
+ }
8782
+ else {
8783
+ this.triggerUploadFailedFlow();
8784
+ }
8785
+ }
8786
+ if (state.debug)
8787
+ console.log('process-id | verificationFinished | waitingFinished ');
8788
+ }
8789
+ triggerUploadFailedFlow() {
8790
+ this.errorReason = 'Upload Failed';
8791
+ this.showInvalid = true;
8792
+ }
8735
8793
  async componentDidLoad() {
8736
8794
  if (state.debug)
8737
8795
  console.log('process-id | componentDidLoad');
@@ -8760,16 +8818,10 @@ const ProcessId = class {
8760
8818
  render() {
8761
8819
  let error = h("capture-error", { type: "ID", reason: this.errorReason });
8762
8820
  let capture = h("id-capture", null);
8763
- let howTo = h("how-to-info", null);
8764
8821
  if (this.showInvalid || this.showTimeout) {
8765
8822
  return error;
8766
8823
  }
8767
- if (state.flowStatus != FlowStatus.IDTILT && this.flow.howToDone) {
8768
- return howTo;
8769
- }
8770
- else {
8771
- return capture;
8772
- }
8824
+ return capture;
8773
8825
  }
8774
8826
  };
8775
8827
  ProcessId.style = processIdCss;
@@ -8999,38 +9051,28 @@ const UserLiveness = class {
8999
9051
  this.showError = undefined;
9000
9052
  this.showTimeout = undefined;
9001
9053
  this.flow = undefined;
9002
- this.howToDone = false;
9003
9054
  }
9004
9055
  async componentDidLoad() { }
9005
9056
  componentWillLoad() {
9006
9057
  if (this.mode == 'selfie') {
9007
9058
  this.currentStep = FlowSteps.Selfie;
9008
9059
  this.flow = {
9009
- capture: {
9010
- fileName: 'selfie.png',
9011
- recName: 'selfieVideo.',
9012
- photoType: CaptureUploadTypes.Selfie,
9013
- recType: CaptureUploadTypes.SelfieVideo,
9014
- },
9015
- howToDone: false,
9060
+ fileName: 'selfie.png',
9061
+ recName: 'selfieVideo.',
9062
+ photoType: CaptureUploadTypes.Selfie,
9063
+ recType: CaptureUploadTypes.SelfieVideo,
9016
9064
  };
9017
9065
  }
9018
9066
  else if (this.mode == 'selfieGesture') {
9019
9067
  this.currentStep = FlowSteps.SelfieTilt;
9020
9068
  this.flow = {
9021
- capture: {
9022
- fileName: '',
9023
- recName: 'selfieTiltVideo.',
9024
- photoType: CaptureUploadTypes.None,
9025
- recType: CaptureUploadTypes.SelfieGestureVideo,
9026
- },
9027
- howToDone: false,
9069
+ fileName: '',
9070
+ recName: 'selfieTiltVideo.',
9071
+ photoType: CaptureUploadTypes.None,
9072
+ recType: CaptureUploadTypes.SelfieGestureVideo,
9028
9073
  };
9029
9074
  }
9030
9075
  }
9031
- howToDoneEvent() {
9032
- this.howToDone = true;
9033
- }
9034
9076
  timeElapsed() {
9035
9077
  this.errorReason = 'Timeout';
9036
9078
  this.showTimeout = true;
@@ -9053,8 +9095,8 @@ const UserLiveness = class {
9053
9095
  return;
9054
9096
  }
9055
9097
  try {
9056
- var uploadPhoto = new File([selfiePhoto], this.flow.capture.fileName, { type: 'image/png' });
9057
- let photoUploaded = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.capture.photoType, uploadPhoto);
9098
+ var uploadPhoto = new File([selfiePhoto], this.flow.fileName, { type: 'image/png' });
9099
+ let photoUploaded = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.photoType, uploadPhoto);
9058
9100
  if (photoUploaded.isValid) {
9059
9101
  state.flowStatus = FlowStatus[photoUploaded.state];
9060
9102
  }
@@ -9080,8 +9122,8 @@ const UserLiveness = class {
9080
9122
  }
9081
9123
  let mimeType = selfieRecording.type == Stream.mp4MimeType.type ? Stream.mp4MimeType : Stream.webmMimeType;
9082
9124
  try {
9083
- let uploadRec = new File([selfieRecording], this.flow.capture.recName + mimeType.extension, { type: mimeType.type });
9084
- let uplodDone = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.capture.recType, uploadRec);
9125
+ let uploadRec = new File([selfieRecording], this.flow.recName + mimeType.extension, { type: mimeType.type });
9126
+ let uplodDone = await ApiCall.instance.UploadFileForRequestB64(state.requestId, this.flow.recType, uploadRec);
9085
9127
  if (uplodDone.saved) {
9086
9128
  state.flowStatus = FlowStatus[uplodDone.state];
9087
9129
  }
@@ -9099,6 +9141,32 @@ const UserLiveness = class {
9099
9141
  }
9100
9142
  }
9101
9143
  }
9144
+ async verificationFinished() {
9145
+ if (state.debug)
9146
+ console.log('user-liveness | verificationFinished');
9147
+ this.verificationReceived = Date.now();
9148
+ let initialStatus = state.flowStatus;
9149
+ let statusChanged = false;
9150
+ while (Date.now() - this.verificationReceived < 25000 && !statusChanged) {
9151
+ await delay(2000);
9152
+ statusChanged = initialStatus != state.flowStatus;
9153
+ }
9154
+ if (!statusChanged) {
9155
+ let currentStatus = await ApiCall.instance.GetFlowState();
9156
+ if (currentStatus != state.flowStatus) {
9157
+ state.flowStatus = currentStatus;
9158
+ }
9159
+ else {
9160
+ this.triggerUploadFailedFlow();
9161
+ }
9162
+ }
9163
+ if (state.debug)
9164
+ console.log('user-liveness | verificationFinished | waitingFinished ');
9165
+ }
9166
+ triggerUploadFailedFlow() {
9167
+ this.errorReason = 'Upload Failed';
9168
+ this.showError = true;
9169
+ }
9102
9170
  async disconnectedCallback() {
9103
9171
  await BaseComponent.finalize(this.currentStep);
9104
9172
  }
@@ -9107,18 +9175,12 @@ const UserLiveness = class {
9107
9175
  this.showError = true;
9108
9176
  }
9109
9177
  render() {
9110
- let howTo = h("how-to-info", null);
9111
9178
  let capture = h("selfie-capture", null);
9112
9179
  let error = h("capture-error", { type: "LIVENESS", reason: this.errorReason });
9113
9180
  if (this.showError || this.showTimeout) {
9114
9181
  return error;
9115
9182
  }
9116
- if (this.howToDone) {
9117
- return capture;
9118
- }
9119
- else {
9120
- return howTo;
9121
- }
9183
+ return capture;
9122
9184
  }
9123
9185
  };
9124
9186
  UserLiveness.style = userLivenessCss;
@@ -11,7 +11,7 @@ const patchEsm = () => {
11
11
  const defineCustomElements = (win, options) => {
12
12
  if (typeof window === 'undefined') return Promise.resolve();
13
13
  return patchEsm().then(() => {
14
- return bootstrapLazy([["loader-dots",[[1,"loader-dots"]]],["random-actions",[[0,"random-actions"]]],["agreement-check_17",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"lang_iso":[1537],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"],[9,"scroll","handleScroll"]]],[0,"process-id",{"mode":[1],"showTimeout":[32],"showInvalid":[32],"flow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"recordingIdCapture","capturedIdRecording"]]],[0,"user-liveness",{"mode":[1],"showError":[32],"showTimeout":[32],"flow":[32],"howToDone":[32]},[[0,"howToInfoDone","howToDoneEvent"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoSelfieCapture","captureSelfieImage"],[0,"recordingSelfieCapture","capturedSelfieRecording"]]],[0,"agreement-info",{"agreementsChecked":[32],"termsChecked":[32],"openAgreements":[32],"openTerms":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"]]],[0,"camera-error",{"title":[32],"description":[32],"buttonDisabled":[32],"demoVideo":[32]}],[0,"end-redirect"],[0,"error-end",{"message":[1],"errorTitle":[1,"error-title"]}],[0,"landing-validation",{"warningText":[32],"buttonDisabled":[32]}],[0,"mobile-redirect",{"infoTextTop":[32],"infoTextBottom":[32],"contact":[32],"invalidValue":[32],"waitingMobile":[32],"orderStatus":[32],"redirectLink":[32],"qrCode":[32],"prefilledPhone":[32]}],[0,"sms-code-validation",{"title":[32],"details":[32],"buttonText":[32],"code":[32],"canSend":[32]}],[0,"sms-send",{"buttonText":[32],"title":[32],"details":[32],"phoneNumber":[32],"prefilledPhone":[32],"canSend":[32]}],[0,"id-capture",{"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"selfie-capture",{"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32],"buttonEnabled":[32],"scrollClass":[32]}],[0,"capture-error",{"type":[1],"reason":[1],"buttonEnabled":[32],"buttonText":[32]}],[0,"how-to-info",{"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32],"buttonEnabled":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
14
+ return bootstrapLazy([["loader-dots",[[1,"loader-dots"]]],["random-actions",[[0,"random-actions"]]],["agreement-check_17",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"lang_iso":[1537],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"],[9,"scroll","handleScroll"]]],[0,"process-id",{"mode":[1],"showTimeout":[32],"showInvalid":[32],"flow":[32]},[[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"recordingIdCapture","capturedIdRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"user-liveness",{"mode":[1],"showError":[32],"showTimeout":[32],"flow":[32]},[[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoSelfieCapture","captureSelfieImage"],[0,"recordingSelfieCapture","capturedSelfieRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-info",{"agreementsChecked":[32],"termsChecked":[32],"openAgreements":[32],"openTerms":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"]]],[0,"camera-error",{"title":[32],"description":[32],"buttonDisabled":[32],"demoVideo":[32]}],[0,"end-redirect"],[0,"error-end",{"message":[1],"errorTitle":[1,"error-title"]}],[0,"how-to-info",{"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32],"buttonEnabled":[32]}],[0,"landing-validation",{"warningText":[32],"buttonDisabled":[32]}],[0,"mobile-redirect",{"infoTextTop":[32],"infoTextBottom":[32],"contact":[32],"invalidValue":[32],"waitingMobile":[32],"orderStatus":[32],"redirectLink":[32],"qrCode":[32],"prefilledPhone":[32]}],[0,"sms-code-validation",{"title":[32],"details":[32],"buttonText":[32],"code":[32],"canSend":[32]}],[0,"sms-send",{"buttonText":[32],"title":[32],"details":[32],"phoneNumber":[32],"prefilledPhone":[32],"canSend":[32]}],[0,"id-capture",{"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"selfie-capture",{"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32],"buttonEnabled":[32],"scrollClass":[32]}],[0,"capture-error",{"type":[1],"reason":[1],"buttonEnabled":[32],"buttonText":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
15
15
  });
16
16
  };
17
17