@ekyc_qoobiss/qbs-ect-cmp 2.1.9 → 2.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{agreement-check_17.cjs.entry.js → agreement-check_18.cjs.entry.js} +185 -107
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/qbs-ect-cmp.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/common/camera-error/camera-error.css +0 -0
- package/dist/collection/components/common/camera-error/camera-error.js +113 -0
- package/dist/collection/components/common/id-back-capture/id-back-capture.js +2 -3
- package/dist/collection/components/common/id-capture/id-capture.js +2 -3
- package/dist/collection/components/flow/landing-validation/landing-validation.js +5 -0
- package/dist/collection/components/identification-component/identification-component.js +3 -0
- package/dist/collection/helpers/Cameras.js +17 -0
- package/dist/collection/helpers/textValues.js +6 -0
- package/dist/collection/models/FlowStatus.js +1 -0
- package/dist/collection/models/FlowSteps.js +1 -0
- package/dist/esm/{agreement-check_17.entry.js → agreement-check_18.entry.js} +185 -108
- package/dist/esm/loader.js +1 -1
- package/dist/esm/qbs-ect-cmp.js +1 -1
- package/dist/qbs-ect-cmp/{p-91913ea5.entry.js → p-89403315.entry.js} +2 -2
- package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
- package/dist/types/components/common/camera-error/camera-error.d.ts +17 -0
- package/dist/types/components.d.ts +20 -0
- package/dist/types/helpers/Cameras.d.ts +1 -0
- package/dist/types/helpers/textValues.d.ts +6 -0
- package/dist/types/models/FlowStatus.d.ts +2 -1
- package/dist/types/models/FlowSteps.d.ts +2 -1
- package/package.json +1 -1
|
@@ -215,6 +215,7 @@ var FlowStatus;
|
|
|
215
215
|
FlowStatus[FlowStatus["LIVENESS"] = 6] = "LIVENESS";
|
|
216
216
|
FlowStatus[FlowStatus["COMPLETE"] = 7] = "COMPLETE";
|
|
217
217
|
FlowStatus[FlowStatus["ERROREND"] = 8] = "ERROREND";
|
|
218
|
+
FlowStatus[FlowStatus["CAMERAERROR"] = 9] = "CAMERAERROR";
|
|
218
219
|
})(FlowStatus || (FlowStatus = {}));
|
|
219
220
|
|
|
220
221
|
class GlobalValues {
|
|
@@ -353,7 +354,13 @@ MobileRedirectValues.InfoTop = 'Pentru a continua scanați codul de mai jos cu u
|
|
|
353
354
|
MobileRedirectValues.InfoBottom = 'Sau introduceți un număr de telefon pentru a primi link-ul pe smartphone.';
|
|
354
355
|
MobileRedirectValues.Validation = 'Număr de telefon invalid!';
|
|
355
356
|
MobileRedirectValues.InfoWaiting = 'Așteptăm finalizarea procesului pe smartphone.';
|
|
356
|
-
MobileRedirectValues.InfoAborted = 'Procesului de pe smartphone a fost amanat.';
|
|
357
|
+
MobileRedirectValues.InfoAborted = 'Procesului de pe smartphone a fost amanat.';
|
|
358
|
+
class CameraErrorValues extends GlobalValues {
|
|
359
|
+
}
|
|
360
|
+
CameraErrorValues.Title = 'Procesul de indetificare nu poate continua.';
|
|
361
|
+
CameraErrorValues.Description = 'Nu am putut detecta nicio camera. Cel mai probabil nu ai acordat drept de acces acestui site, Te rugam sa dai acces si sa apesi butonul de mai jos dupa aceea.';
|
|
362
|
+
CameraErrorValues.Button = 'Reincep procesul';
|
|
363
|
+
CameraErrorValues.HowToLink = 'https://ekyc.blob.core.windows.net/$web/animations/enable_permissions_sm.mp4';
|
|
357
364
|
|
|
358
365
|
const { state, onChange } = createStore({
|
|
359
366
|
flowStatus: FlowStatus.LANDING,
|
|
@@ -410,6 +417,7 @@ var FlowSteps;
|
|
|
410
417
|
FlowSteps[FlowSteps["SelfieHowTo"] = 9] = "SelfieHowTo";
|
|
411
418
|
FlowSteps[FlowSteps["Selfie"] = 10] = "Selfie";
|
|
412
419
|
FlowSteps[FlowSteps["End"] = 11] = "End";
|
|
420
|
+
FlowSteps[FlowSteps["CameraError"] = 12] = "CameraError";
|
|
413
421
|
})(FlowSteps || (FlowSteps = {}));
|
|
414
422
|
|
|
415
423
|
class ApiCall {
|
|
@@ -5163,6 +5171,171 @@ const Camera = class {
|
|
|
5163
5171
|
};
|
|
5164
5172
|
Camera.style = cameraCss;
|
|
5165
5173
|
|
|
5174
|
+
class Cameras {
|
|
5175
|
+
async GetCameras(deviceInfo) {
|
|
5176
|
+
var allDevices = [];
|
|
5177
|
+
const devices = await navigator.mediaDevices.enumerateDevices();
|
|
5178
|
+
const videoDevices = devices.filter(device => device.kind === 'videoinput');
|
|
5179
|
+
for (const device of videoDevices) {
|
|
5180
|
+
const updatedConstraints = this.GetConstraints(device.deviceId, deviceInfo);
|
|
5181
|
+
const stream = await navigator.mediaDevices.getUserMedia(updatedConstraints);
|
|
5182
|
+
stream.getVideoTracks().forEach(track => {
|
|
5183
|
+
if (deviceInfo.isFirefox) {
|
|
5184
|
+
const settings = track.getSettings();
|
|
5185
|
+
let facingMode = settings.facingMode && settings.facingMode.length > 0 ? settings.facingMode[0] : '';
|
|
5186
|
+
facingMode = facingMode === 'e' ? 'environment' : facingMode;
|
|
5187
|
+
allDevices.push({
|
|
5188
|
+
deviceId: device.deviceId,
|
|
5189
|
+
name: device.label,
|
|
5190
|
+
height: settings.height,
|
|
5191
|
+
width: settings.width,
|
|
5192
|
+
frameRate: Number(settings.frameRate.max),
|
|
5193
|
+
torch: false,
|
|
5194
|
+
recommended: false,
|
|
5195
|
+
facingMode: facingMode,
|
|
5196
|
+
});
|
|
5197
|
+
}
|
|
5198
|
+
else {
|
|
5199
|
+
const capabilities = track.getCapabilities();
|
|
5200
|
+
let facingMode = capabilities.facingMode && capabilities.facingMode.length > 0 ? capabilities.facingMode[0] : '';
|
|
5201
|
+
facingMode = facingMode === 'e' ? 'environment' : facingMode;
|
|
5202
|
+
allDevices.push({
|
|
5203
|
+
deviceId: device.deviceId,
|
|
5204
|
+
name: device.label,
|
|
5205
|
+
height: capabilities.height.max,
|
|
5206
|
+
width: capabilities.width.max,
|
|
5207
|
+
frameRate: Number(capabilities.frameRate.max),
|
|
5208
|
+
torch: capabilities.torch,
|
|
5209
|
+
recommended: false,
|
|
5210
|
+
facingMode: facingMode,
|
|
5211
|
+
});
|
|
5212
|
+
}
|
|
5213
|
+
});
|
|
5214
|
+
stream.getTracks().forEach(track => {
|
|
5215
|
+
track.stop();
|
|
5216
|
+
});
|
|
5217
|
+
}
|
|
5218
|
+
if (allDevices.length > 0) {
|
|
5219
|
+
allDevices = allDevices.sort((a, b) => b.frameRate - a.frameRate);
|
|
5220
|
+
var firstOption = allDevices.find(i => i.name.indexOf('0,') != -1 && i.facingMode === 'environment');
|
|
5221
|
+
if (firstOption) {
|
|
5222
|
+
allDevices[allDevices.indexOf(firstOption)].recommended = true;
|
|
5223
|
+
}
|
|
5224
|
+
else {
|
|
5225
|
+
var firstEnv = allDevices.find(i => i.facingMode === 'environment');
|
|
5226
|
+
if (firstEnv) {
|
|
5227
|
+
allDevices[allDevices.indexOf(firstEnv)].recommended = true;
|
|
5228
|
+
}
|
|
5229
|
+
}
|
|
5230
|
+
}
|
|
5231
|
+
return allDevices;
|
|
5232
|
+
}
|
|
5233
|
+
GetConstraints(selectedDeviceId, device, portrait = false) {
|
|
5234
|
+
let constraints = {
|
|
5235
|
+
audio: false,
|
|
5236
|
+
video: {
|
|
5237
|
+
frameRate: 30,
|
|
5238
|
+
},
|
|
5239
|
+
};
|
|
5240
|
+
if (selectedDeviceId) {
|
|
5241
|
+
constraints.video.deviceId = {
|
|
5242
|
+
exact: selectedDeviceId,
|
|
5243
|
+
};
|
|
5244
|
+
}
|
|
5245
|
+
if (device.isWin) {
|
|
5246
|
+
constraints.video.width = { ideal: 1280 };
|
|
5247
|
+
}
|
|
5248
|
+
else {
|
|
5249
|
+
if (portrait) {
|
|
5250
|
+
constraints.video.facingMode = 'user';
|
|
5251
|
+
constraints.video.width = { ideal: 1280 };
|
|
5252
|
+
constraints.video.height = { ideal: 720 };
|
|
5253
|
+
}
|
|
5254
|
+
else {
|
|
5255
|
+
constraints.video.facingMode = 'environment';
|
|
5256
|
+
constraints.video.width = { ideal: 1280 };
|
|
5257
|
+
constraints.video.aspectRatio = 1;
|
|
5258
|
+
}
|
|
5259
|
+
}
|
|
5260
|
+
return constraints;
|
|
5261
|
+
}
|
|
5262
|
+
GetRecommendedCamera(cameras) {
|
|
5263
|
+
if (cameras && cameras.length > 0) {
|
|
5264
|
+
var recommDevice = cameras.find(c => c.recommended);
|
|
5265
|
+
if (recommDevice) {
|
|
5266
|
+
return recommDevice;
|
|
5267
|
+
}
|
|
5268
|
+
}
|
|
5269
|
+
return null;
|
|
5270
|
+
}
|
|
5271
|
+
static async InitCameras(device) {
|
|
5272
|
+
try {
|
|
5273
|
+
let cam = new Cameras();
|
|
5274
|
+
let cameras = await cam.GetCameras(device);
|
|
5275
|
+
var recommCamera = cam.GetRecommendedCamera(cameras);
|
|
5276
|
+
state.cameraIds = cameras.map(camera => camera.deviceId);
|
|
5277
|
+
state.cameraId = recommCamera;
|
|
5278
|
+
return true;
|
|
5279
|
+
}
|
|
5280
|
+
catch (e) {
|
|
5281
|
+
console.log(e);
|
|
5282
|
+
if (e.message.includes('Permission denied') || e.name.includes('NotAllowedError')) ;
|
|
5283
|
+
}
|
|
5284
|
+
return false;
|
|
5285
|
+
}
|
|
5286
|
+
}
|
|
5287
|
+
|
|
5288
|
+
const cameraErrorCss = "";
|
|
5289
|
+
|
|
5290
|
+
const CameraError = class {
|
|
5291
|
+
constructor(hostRef) {
|
|
5292
|
+
index.registerInstance(this, hostRef);
|
|
5293
|
+
this.apiErrorEvent = index.createEvent(this, "apiError", 7);
|
|
5294
|
+
this.device = undefined;
|
|
5295
|
+
this.title = undefined;
|
|
5296
|
+
this.description = undefined;
|
|
5297
|
+
this.buttonDisabled = undefined;
|
|
5298
|
+
this.demoVideo = undefined;
|
|
5299
|
+
this.apiCall = new ApiCall();
|
|
5300
|
+
}
|
|
5301
|
+
async componentWillLoad() {
|
|
5302
|
+
this.buttonDisabled = false;
|
|
5303
|
+
this.title = CameraErrorValues.Title;
|
|
5304
|
+
this.description = CameraErrorValues.Description;
|
|
5305
|
+
this.buttonText = CameraErrorValues.Button;
|
|
5306
|
+
}
|
|
5307
|
+
async componentDidLoad() {
|
|
5308
|
+
try {
|
|
5309
|
+
await this.apiCall.AddStep(FlowSteps.CameraError);
|
|
5310
|
+
}
|
|
5311
|
+
catch (e) {
|
|
5312
|
+
this.apiErrorEvent.emit(e);
|
|
5313
|
+
}
|
|
5314
|
+
this.demoVideo.src = CameraErrorValues.HowToLink;
|
|
5315
|
+
this.demoVideo.play();
|
|
5316
|
+
}
|
|
5317
|
+
async buttonClick() {
|
|
5318
|
+
this.buttonDisabled = true;
|
|
5319
|
+
if (!(await Cameras.InitCameras(this.device))) {
|
|
5320
|
+
this.buttonDisabled = false;
|
|
5321
|
+
return;
|
|
5322
|
+
}
|
|
5323
|
+
if (state.agreementsValidation) {
|
|
5324
|
+
state.flowStatus = FlowStatus.AGREEMENT;
|
|
5325
|
+
}
|
|
5326
|
+
else if (state.phoneValidation) {
|
|
5327
|
+
state.flowStatus = FlowStatus.PHONE;
|
|
5328
|
+
}
|
|
5329
|
+
else {
|
|
5330
|
+
state.flowStatus = FlowStatus.ID;
|
|
5331
|
+
}
|
|
5332
|
+
}
|
|
5333
|
+
render() {
|
|
5334
|
+
return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("h1", { class: "color-red" }, this.title), index.h("div", null, index.h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.description)), index.h("video", { id: "howtoPermissions", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, index.h("source", { type: "video/mp4" })), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", type: "button", disabled: this.buttonDisabled, onClick: () => this.buttonClick() }, this.buttonText), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, CameraErrorValues.FooterText))))));
|
|
5335
|
+
}
|
|
5336
|
+
};
|
|
5337
|
+
CameraError.style = cameraErrorCss;
|
|
5338
|
+
|
|
5166
5339
|
const captureErrorCss = "";
|
|
5167
5340
|
|
|
5168
5341
|
const CaptureError = class {
|
|
@@ -5345,105 +5518,6 @@ const HowToInfo = class {
|
|
|
5345
5518
|
};
|
|
5346
5519
|
HowToInfo.style = howToInfoCss;
|
|
5347
5520
|
|
|
5348
|
-
class Cameras {
|
|
5349
|
-
async GetCameras(deviceInfo) {
|
|
5350
|
-
var allDevices = [];
|
|
5351
|
-
const devices = await navigator.mediaDevices.enumerateDevices();
|
|
5352
|
-
const videoDevices = devices.filter(device => device.kind === 'videoinput');
|
|
5353
|
-
for (const device of videoDevices) {
|
|
5354
|
-
const updatedConstraints = this.GetConstraints(device.deviceId, deviceInfo);
|
|
5355
|
-
const stream = await navigator.mediaDevices.getUserMedia(updatedConstraints);
|
|
5356
|
-
stream.getVideoTracks().forEach(track => {
|
|
5357
|
-
if (deviceInfo.isFirefox) {
|
|
5358
|
-
const settings = track.getSettings();
|
|
5359
|
-
let facingMode = settings.facingMode && settings.facingMode.length > 0 ? settings.facingMode[0] : '';
|
|
5360
|
-
facingMode = facingMode === 'e' ? 'environment' : facingMode;
|
|
5361
|
-
allDevices.push({
|
|
5362
|
-
deviceId: device.deviceId,
|
|
5363
|
-
name: device.label,
|
|
5364
|
-
height: settings.height,
|
|
5365
|
-
width: settings.width,
|
|
5366
|
-
frameRate: Number(settings.frameRate.max),
|
|
5367
|
-
torch: false,
|
|
5368
|
-
recommended: false,
|
|
5369
|
-
facingMode: facingMode,
|
|
5370
|
-
});
|
|
5371
|
-
}
|
|
5372
|
-
else {
|
|
5373
|
-
const capabilities = track.getCapabilities();
|
|
5374
|
-
let facingMode = capabilities.facingMode && capabilities.facingMode.length > 0 ? capabilities.facingMode[0] : '';
|
|
5375
|
-
facingMode = facingMode === 'e' ? 'environment' : facingMode;
|
|
5376
|
-
allDevices.push({
|
|
5377
|
-
deviceId: device.deviceId,
|
|
5378
|
-
name: device.label,
|
|
5379
|
-
height: capabilities.height.max,
|
|
5380
|
-
width: capabilities.width.max,
|
|
5381
|
-
frameRate: Number(capabilities.frameRate.max),
|
|
5382
|
-
torch: capabilities.torch,
|
|
5383
|
-
recommended: false,
|
|
5384
|
-
facingMode: facingMode,
|
|
5385
|
-
});
|
|
5386
|
-
}
|
|
5387
|
-
});
|
|
5388
|
-
stream.getTracks().forEach(track => {
|
|
5389
|
-
track.stop();
|
|
5390
|
-
});
|
|
5391
|
-
}
|
|
5392
|
-
if (allDevices.length > 0) {
|
|
5393
|
-
allDevices = allDevices.sort((a, b) => b.frameRate - a.frameRate);
|
|
5394
|
-
var firstOption = allDevices.find(i => i.name.indexOf('0,') != -1 && i.facingMode === 'environment');
|
|
5395
|
-
if (firstOption) {
|
|
5396
|
-
allDevices[allDevices.indexOf(firstOption)].recommended = true;
|
|
5397
|
-
}
|
|
5398
|
-
else {
|
|
5399
|
-
var firstEnv = allDevices.find(i => i.facingMode === 'environment');
|
|
5400
|
-
if (firstEnv) {
|
|
5401
|
-
allDevices[allDevices.indexOf(firstEnv)].recommended = true;
|
|
5402
|
-
}
|
|
5403
|
-
}
|
|
5404
|
-
}
|
|
5405
|
-
return allDevices;
|
|
5406
|
-
}
|
|
5407
|
-
GetConstraints(selectedDeviceId, device, portrait = false) {
|
|
5408
|
-
let constraints = {
|
|
5409
|
-
audio: false,
|
|
5410
|
-
video: {
|
|
5411
|
-
frameRate: 30,
|
|
5412
|
-
},
|
|
5413
|
-
};
|
|
5414
|
-
if (selectedDeviceId) {
|
|
5415
|
-
constraints.video.deviceId = {
|
|
5416
|
-
exact: selectedDeviceId,
|
|
5417
|
-
};
|
|
5418
|
-
}
|
|
5419
|
-
if (device.isWin) {
|
|
5420
|
-
constraints.video.width = { ideal: 1280 };
|
|
5421
|
-
}
|
|
5422
|
-
else {
|
|
5423
|
-
if (portrait) {
|
|
5424
|
-
constraints.video.facingMode = 'user';
|
|
5425
|
-
constraints.video.width = { ideal: 1280 };
|
|
5426
|
-
constraints.video.height = { ideal: 720 };
|
|
5427
|
-
}
|
|
5428
|
-
else {
|
|
5429
|
-
constraints.video.facingMode = 'environment';
|
|
5430
|
-
constraints.video.width = { ideal: 1280 };
|
|
5431
|
-
constraints.video.aspectRatio = 1;
|
|
5432
|
-
}
|
|
5433
|
-
}
|
|
5434
|
-
return constraints;
|
|
5435
|
-
}
|
|
5436
|
-
GetRecommendedCamera(cameras) {
|
|
5437
|
-
if (cameras && cameras.length > 0) {
|
|
5438
|
-
var recommDevice = cameras.find(c => c.recommended);
|
|
5439
|
-
if (recommDevice) {
|
|
5440
|
-
return recommDevice;
|
|
5441
|
-
}
|
|
5442
|
-
}
|
|
5443
|
-
return null;
|
|
5444
|
-
}
|
|
5445
|
-
}
|
|
5446
|
-
|
|
5447
5521
|
const idBackCaptureCss = ".logo{max-height:450px;max-width:450px}.canvas-on-video{max-width:100%;max-height:100%;position:absolute;z-index:2;transform:scale(-1, 1)}";
|
|
5448
5522
|
|
|
5449
5523
|
const IdBackCapture = class {
|
|
@@ -5500,9 +5574,7 @@ const IdBackCapture = class {
|
|
|
5500
5574
|
this.openCamera();
|
|
5501
5575
|
}
|
|
5502
5576
|
async openCamera() {
|
|
5503
|
-
|
|
5504
|
-
var recommCamera = this.cameras.GetRecommendedCamera(_cameras);
|
|
5505
|
-
var constraints = this.cameras.GetConstraints(recommCamera === null || recommCamera === void 0 ? void 0 : recommCamera.deviceId, this.device);
|
|
5577
|
+
var constraints = this.cameras.GetConstraints(state.cameraId, this.device);
|
|
5506
5578
|
setTimeout(() => {
|
|
5507
5579
|
navigator.mediaDevices
|
|
5508
5580
|
.getUserMedia(constraints)
|
|
@@ -5613,9 +5685,7 @@ const IdCapture = class {
|
|
|
5613
5685
|
this.openCamera();
|
|
5614
5686
|
}
|
|
5615
5687
|
async openCamera() {
|
|
5616
|
-
|
|
5617
|
-
var recommCamera = this.cameras.GetRecommendedCamera(_cameras);
|
|
5618
|
-
var constraints = this.cameras.GetConstraints(recommCamera === null || recommCamera === void 0 ? void 0 : recommCamera.deviceId, this.device);
|
|
5688
|
+
var constraints = this.cameras.GetConstraints(state.cameraId, this.device);
|
|
5619
5689
|
setTimeout(() => {
|
|
5620
5690
|
navigator.mediaDevices
|
|
5621
5691
|
.getUserMedia(constraints)
|
|
@@ -6098,7 +6168,7 @@ function v4(options, buf, offset) {
|
|
|
6098
6168
|
}
|
|
6099
6169
|
|
|
6100
6170
|
const name = "@ekyc_qoobiss/qbs-ect-cmp";
|
|
6101
|
-
const version$1 = "2.1.
|
|
6171
|
+
const version$1 = "2.1.11";
|
|
6102
6172
|
const description = "Person Identification Component";
|
|
6103
6173
|
const main = "./dist/index.cjs.js";
|
|
6104
6174
|
const module$1 = "./dist/index.js";
|
|
@@ -6415,6 +6485,9 @@ const IdentificationComponent = class {
|
|
|
6415
6485
|
if (state.flowStatus == FlowStatus.ERROREND) {
|
|
6416
6486
|
currentBlock = index.h("error-end", { errorTitle: this.errorTitle, message: this.errorMessage });
|
|
6417
6487
|
}
|
|
6488
|
+
if (state.flowStatus == FlowStatus.CAMERAERROR) {
|
|
6489
|
+
currentBlock = index.h("camera-error", { device: this.device });
|
|
6490
|
+
}
|
|
6418
6491
|
return index.h("div", null, currentBlock);
|
|
6419
6492
|
}
|
|
6420
6493
|
static get watchers() { return {
|
|
@@ -6469,6 +6542,10 @@ const LandingValidation = class {
|
|
|
6469
6542
|
}
|
|
6470
6543
|
async startFlow() {
|
|
6471
6544
|
if (state.initialised) {
|
|
6545
|
+
if (!(await Cameras.InitCameras(this.device))) {
|
|
6546
|
+
state.flowStatus = FlowStatus.CAMERAERROR;
|
|
6547
|
+
return;
|
|
6548
|
+
}
|
|
6472
6549
|
if (state.agreementsValidation) {
|
|
6473
6550
|
state.flowStatus = FlowStatus.AGREEMENT;
|
|
6474
6551
|
}
|
|
@@ -9824,6 +9901,7 @@ UserLiveness.style = userLivenessCss;
|
|
|
9824
9901
|
exports.agreement_check = AgreementCheck;
|
|
9825
9902
|
exports.agreement_info = AgreementInfo;
|
|
9826
9903
|
exports.camera_comp = Camera;
|
|
9904
|
+
exports.camera_error = CameraError;
|
|
9827
9905
|
exports.capture_error = CaptureError;
|
|
9828
9906
|
exports.end_redirect = EndRedirect;
|
|
9829
9907
|
exports.error_end = ErrorEnd;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["loader-dots.cjs",[[1,"loader-dots"]]],["agreement-
|
|
17
|
+
return index.bootstrapLazy([["loader-dots.cjs",[[1,"loader-dots"]]],["agreement-check_18.cjs",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"idSide":[32],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"]]],[0,"id-double-side",{"device":[16],"showTimeout":[32],"showInvalid":[32],"showHowTo":[32],"front":[32],"flow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"photoIdBackCapture","captureIdBackImage"],[0,"recordingIdCapture","capturedIdRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"id-single-side",{"device":[16],"showTimeout":[32],"showHowTo":[32],"idFlow":[32]},[[0,"captureErrorDone","captureErrorDone"],[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"photoIdCapture","captureIdImage"],[0,"verificationFinished","verificationFinished"],[0,"recordingIdCapture","capturedIdRecording"]]],[0,"user-liveness",{"device":[16],"showError":[32],"showHowTo":[32],"selfieFlow":[32]},[[0,"howToInfoDone","howToDone"],[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",{"device":[16],"title":[32],"description":[32],"buttonDisabled":[32],"demoVideo":[32]}],[0,"end-redirect"],[0,"error-end",{"message":[1],"errorTitle":[1,"error-title"]}],[0,"landing-validation",{"device":[16],"warningText":[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],"phoneNumber":[32],"code":[32],"prefilledPhone":[32],"canSend":[32]}],[0,"id-back-capture",{"device":[16],"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"verificationFinished","verificationFinished"],[0,"takePhoto","takePhoto"]]],[0,"selfie-capture",{"device":[16],"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"uploadingLink":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32],"buttonEnabled":[32]}],[0,"id-capture",{"device":[16],"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"capture-error",{"type":[1],"buttonEnabled":[32],"buttonText":[32]}],[0,"how-to-info",{"idSide":[1,"id-side"],"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32],"buttonEnabled":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"device":[16],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -17,7 +17,7 @@ const patchBrowser = () => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(options => {
|
|
20
|
-
return index.bootstrapLazy([["loader-dots.cjs",[[1,"loader-dots"]]],["agreement-
|
|
20
|
+
return index.bootstrapLazy([["loader-dots.cjs",[[1,"loader-dots"]]],["agreement-check_18.cjs",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"idSide":[32],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"]]],[0,"id-double-side",{"device":[16],"showTimeout":[32],"showInvalid":[32],"showHowTo":[32],"front":[32],"flow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"photoIdBackCapture","captureIdBackImage"],[0,"recordingIdCapture","capturedIdRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"id-single-side",{"device":[16],"showTimeout":[32],"showHowTo":[32],"idFlow":[32]},[[0,"captureErrorDone","captureErrorDone"],[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"photoIdCapture","captureIdImage"],[0,"verificationFinished","verificationFinished"],[0,"recordingIdCapture","capturedIdRecording"]]],[0,"user-liveness",{"device":[16],"showError":[32],"showHowTo":[32],"selfieFlow":[32]},[[0,"howToInfoDone","howToDone"],[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",{"device":[16],"title":[32],"description":[32],"buttonDisabled":[32],"demoVideo":[32]}],[0,"end-redirect"],[0,"error-end",{"message":[1],"errorTitle":[1,"error-title"]}],[0,"landing-validation",{"device":[16],"warningText":[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],"phoneNumber":[32],"code":[32],"prefilledPhone":[32],"canSend":[32]}],[0,"id-back-capture",{"device":[16],"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"verificationFinished","verificationFinished"],[0,"takePhoto","takePhoto"]]],[0,"selfie-capture",{"device":[16],"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"uploadingLink":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32],"buttonEnabled":[32]}],[0,"id-capture",{"device":[16],"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"capture-error",{"type":[1],"buttonEnabled":[32],"buttonText":[32]}],[0,"how-to-info",{"idSide":[1,"id-side"],"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32],"buttonEnabled":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"device":[16],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
exports.setNonce = index.setNonce;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
3
|
"./components/common/agreement-check/agreement-check.js",
|
|
4
|
+
"./components/common/camera-error/camera-error.js",
|
|
4
5
|
"./components/common/capture-error/capture-error.js",
|
|
5
6
|
"./components/common/how-to-info/how-to-info.js",
|
|
6
7
|
"./components/common/id-back-capture/id-back-capture.js",
|
|
File without changes
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import { CameraErrorValues } from '../../../helpers/textValues';
|
|
3
|
+
import store from '../../../helpers/store';
|
|
4
|
+
import { FlowStatus } from '../../../models/FlowStatus';
|
|
5
|
+
import { Cameras } from '../../../helpers/Cameras';
|
|
6
|
+
import { ApiCall } from '../../../helpers/ApiCall';
|
|
7
|
+
import { FlowSteps } from '../../../models/FlowSteps';
|
|
8
|
+
export class CameraError {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.device = undefined;
|
|
11
|
+
this.title = undefined;
|
|
12
|
+
this.description = undefined;
|
|
13
|
+
this.buttonDisabled = undefined;
|
|
14
|
+
this.demoVideo = undefined;
|
|
15
|
+
this.apiCall = new ApiCall();
|
|
16
|
+
}
|
|
17
|
+
async componentWillLoad() {
|
|
18
|
+
this.buttonDisabled = false;
|
|
19
|
+
this.title = CameraErrorValues.Title;
|
|
20
|
+
this.description = CameraErrorValues.Description;
|
|
21
|
+
this.buttonText = CameraErrorValues.Button;
|
|
22
|
+
}
|
|
23
|
+
async componentDidLoad() {
|
|
24
|
+
try {
|
|
25
|
+
await this.apiCall.AddStep(FlowSteps.CameraError);
|
|
26
|
+
}
|
|
27
|
+
catch (e) {
|
|
28
|
+
this.apiErrorEvent.emit(e);
|
|
29
|
+
}
|
|
30
|
+
this.demoVideo.src = CameraErrorValues.HowToLink;
|
|
31
|
+
this.demoVideo.play();
|
|
32
|
+
}
|
|
33
|
+
async buttonClick() {
|
|
34
|
+
this.buttonDisabled = true;
|
|
35
|
+
if (!(await Cameras.InitCameras(this.device))) {
|
|
36
|
+
this.buttonDisabled = false;
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (store.agreementsValidation) {
|
|
40
|
+
store.flowStatus = FlowStatus.AGREEMENT;
|
|
41
|
+
}
|
|
42
|
+
else if (store.phoneValidation) {
|
|
43
|
+
store.flowStatus = FlowStatus.PHONE;
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
store.flowStatus = FlowStatus.ID;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
render() {
|
|
50
|
+
return (h("div", { class: "container" }, h("div", { class: "row" }, h("h1", { class: "color-red" }, this.title), h("div", null, h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.description)), h("video", { id: "howtoPermissions", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" })), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", type: "button", disabled: this.buttonDisabled, onClick: () => this.buttonClick() }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, CameraErrorValues.FooterText))))));
|
|
51
|
+
}
|
|
52
|
+
static get is() { return "camera-error"; }
|
|
53
|
+
static get originalStyleUrls() {
|
|
54
|
+
return {
|
|
55
|
+
"$": ["camera-error.css"]
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
static get styleUrls() {
|
|
59
|
+
return {
|
|
60
|
+
"$": ["camera-error.css"]
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
static get properties() {
|
|
64
|
+
return {
|
|
65
|
+
"device": {
|
|
66
|
+
"type": "unknown",
|
|
67
|
+
"mutable": false,
|
|
68
|
+
"complexType": {
|
|
69
|
+
"original": "Device",
|
|
70
|
+
"resolved": "Device",
|
|
71
|
+
"references": {
|
|
72
|
+
"Device": {
|
|
73
|
+
"location": "import",
|
|
74
|
+
"path": "../../../models/IDevice"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"required": false,
|
|
79
|
+
"optional": false,
|
|
80
|
+
"docs": {
|
|
81
|
+
"tags": [],
|
|
82
|
+
"text": ""
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
static get states() {
|
|
88
|
+
return {
|
|
89
|
+
"title": {},
|
|
90
|
+
"description": {},
|
|
91
|
+
"buttonDisabled": {},
|
|
92
|
+
"demoVideo": {}
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
static get events() {
|
|
96
|
+
return [{
|
|
97
|
+
"method": "apiErrorEvent",
|
|
98
|
+
"name": "apiError",
|
|
99
|
+
"bubbles": true,
|
|
100
|
+
"cancelable": true,
|
|
101
|
+
"composed": true,
|
|
102
|
+
"docs": {
|
|
103
|
+
"tags": [],
|
|
104
|
+
"text": ""
|
|
105
|
+
},
|
|
106
|
+
"complexType": {
|
|
107
|
+
"original": "any",
|
|
108
|
+
"resolved": "any",
|
|
109
|
+
"references": {}
|
|
110
|
+
}
|
|
111
|
+
}];
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -7,6 +7,7 @@ import { IDML5Detector } from '../../../libs/IDML5Detector/IDML5Detector';
|
|
|
7
7
|
import { FaceML5Detector } from '../../../libs/FaceML5Detector/FaceML5Detector';
|
|
8
8
|
import { IDPose } from '../../../libs/IDML5Detector/IDPose';
|
|
9
9
|
import { delay } from '../../../utils/utils';
|
|
10
|
+
import store from '../../../helpers/store';
|
|
10
11
|
// import { IDPose } from '../../libs/IDML5Detector/IDPose';
|
|
11
12
|
export class IdBackCapture {
|
|
12
13
|
// @State() private animationPath: string;
|
|
@@ -60,9 +61,7 @@ export class IdBackCapture {
|
|
|
60
61
|
this.openCamera();
|
|
61
62
|
}
|
|
62
63
|
async openCamera() {
|
|
63
|
-
|
|
64
|
-
var recommCamera = this.cameras.GetRecommendedCamera(_cameras);
|
|
65
|
-
var constraints = this.cameras.GetConstraints(recommCamera === null || recommCamera === void 0 ? void 0 : recommCamera.deviceId, this.device);
|
|
64
|
+
var constraints = this.cameras.GetConstraints(store.cameraId, this.device);
|
|
66
65
|
setTimeout(() => {
|
|
67
66
|
navigator.mediaDevices
|
|
68
67
|
.getUserMedia(constraints)
|
|
@@ -7,6 +7,7 @@ import { IDML5Detector } from '../../../libs/IDML5Detector/IDML5Detector';
|
|
|
7
7
|
import { FaceML5Detector } from '../../../libs/FaceML5Detector/FaceML5Detector';
|
|
8
8
|
import { IDPose } from '../../../libs/IDML5Detector/IDPose';
|
|
9
9
|
import { delay } from '../../../utils/utils';
|
|
10
|
+
import store from '../../../helpers/store';
|
|
10
11
|
// import { IDPose } from '../../libs/IDML5Detector/IDPose';
|
|
11
12
|
export class IdCapture {
|
|
12
13
|
// @State() private animationPath: string;
|
|
@@ -56,9 +57,7 @@ export class IdCapture {
|
|
|
56
57
|
this.openCamera();
|
|
57
58
|
}
|
|
58
59
|
async openCamera() {
|
|
59
|
-
|
|
60
|
-
var recommCamera = this.cameras.GetRecommendedCamera(_cameras);
|
|
61
|
-
var constraints = this.cameras.GetConstraints(recommCamera === null || recommCamera === void 0 ? void 0 : recommCamera.deviceId, this.device);
|
|
60
|
+
var constraints = this.cameras.GetConstraints(store.cameraId, this.device);
|
|
62
61
|
setTimeout(() => {
|
|
63
62
|
navigator.mediaDevices
|
|
64
63
|
.getUserMedia(constraints)
|
|
@@ -10,6 +10,7 @@ import Events from '../../../helpers/Events';
|
|
|
10
10
|
import { FlowStatus } from '../../../models/FlowStatus';
|
|
11
11
|
import { ApiCall } from '../../../helpers/ApiCall';
|
|
12
12
|
import { FlowSteps } from '../../../models/FlowSteps';
|
|
13
|
+
import { Cameras } from '../../../helpers/Cameras';
|
|
13
14
|
export class LandingValidation {
|
|
14
15
|
constructor() {
|
|
15
16
|
this.device = undefined;
|
|
@@ -39,6 +40,10 @@ export class LandingValidation {
|
|
|
39
40
|
}
|
|
40
41
|
async startFlow() {
|
|
41
42
|
if (store.initialised) {
|
|
43
|
+
if (!(await Cameras.InitCameras(this.device))) {
|
|
44
|
+
store.flowStatus = FlowStatus.CAMERAERROR;
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
42
47
|
if (store.agreementsValidation) {
|
|
43
48
|
store.flowStatus = FlowStatus.AGREEMENT;
|
|
44
49
|
}
|
|
@@ -254,6 +254,9 @@ export class IdentificationComponent {
|
|
|
254
254
|
if (store.flowStatus == FlowStatus.ERROREND) {
|
|
255
255
|
currentBlock = h("error-end", { errorTitle: this.errorTitle, message: this.errorMessage });
|
|
256
256
|
}
|
|
257
|
+
if (store.flowStatus == FlowStatus.CAMERAERROR) {
|
|
258
|
+
currentBlock = h("camera-error", { device: this.device });
|
|
259
|
+
}
|
|
257
260
|
return h("div", null, currentBlock);
|
|
258
261
|
}
|
|
259
262
|
static get is() { return "identification-component"; }
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import store from './store';
|
|
1
2
|
export class Cameras {
|
|
2
3
|
async GetCameras(deviceInfo) {
|
|
3
4
|
var allDevices = [];
|
|
@@ -95,4 +96,20 @@ export class Cameras {
|
|
|
95
96
|
}
|
|
96
97
|
return null;
|
|
97
98
|
}
|
|
99
|
+
static async InitCameras(device) {
|
|
100
|
+
try {
|
|
101
|
+
let cam = new Cameras();
|
|
102
|
+
let cameras = await cam.GetCameras(device);
|
|
103
|
+
var recommCamera = cam.GetRecommendedCamera(cameras);
|
|
104
|
+
store.cameraIds = cameras.map(camera => camera.deviceId);
|
|
105
|
+
store.cameraId = recommCamera;
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
catch (e) {
|
|
109
|
+
console.log(e);
|
|
110
|
+
if (e.message.includes('Permission denied') || e.name.includes('NotAllowedError')) {
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
98
115
|
}
|
|
@@ -136,3 +136,9 @@ MobileRedirectValues.InfoBottom = 'Sau introduceți un număr de telefon pentru
|
|
|
136
136
|
MobileRedirectValues.Validation = 'Număr de telefon invalid!';
|
|
137
137
|
MobileRedirectValues.InfoWaiting = 'Așteptăm finalizarea procesului pe smartphone.';
|
|
138
138
|
MobileRedirectValues.InfoAborted = 'Procesului de pe smartphone a fost amanat.';
|
|
139
|
+
export class CameraErrorValues extends GlobalValues {
|
|
140
|
+
}
|
|
141
|
+
CameraErrorValues.Title = 'Procesul de indetificare nu poate continua.';
|
|
142
|
+
CameraErrorValues.Description = 'Nu am putut detecta nicio camera. Cel mai probabil nu ai acordat drept de acces acestui site, Te rugam sa dai acces si sa apesi butonul de mai jos dupa aceea.';
|
|
143
|
+
CameraErrorValues.Button = 'Reincep procesul';
|
|
144
|
+
CameraErrorValues.HowToLink = 'https://ekyc.blob.core.windows.net/$web/animations/enable_permissions_sm.mp4';
|
|
@@ -9,4 +9,5 @@ export var FlowStatus;
|
|
|
9
9
|
FlowStatus[FlowStatus["LIVENESS"] = 6] = "LIVENESS";
|
|
10
10
|
FlowStatus[FlowStatus["COMPLETE"] = 7] = "COMPLETE";
|
|
11
11
|
FlowStatus[FlowStatus["ERROREND"] = 8] = "ERROREND";
|
|
12
|
+
FlowStatus[FlowStatus["CAMERAERROR"] = 9] = "CAMERAERROR";
|
|
12
13
|
})(FlowStatus || (FlowStatus = {}));
|