@ekyc_qoobiss/qbs-ect-cmp 3.6.42 → 3.6.44
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/{TranslationUtils-dd73945b.js → TranslationUtils-2d932eab.js} +1 -1
- package/dist/cjs/agreement-check_17.cjs.entry.js +8 -7
- package/dist/cjs/random-actions.cjs.entry.js +1 -1
- package/dist/collection/components/common/how-to-info/how-to-info.js +4 -3
- package/dist/collection/components/flow/sms-code-validation/sms-code-validation.js +1 -1
- package/dist/collection/components/flow/sms-send/sms-send.js +1 -1
- package/dist/collection/helpers/ApiCall.js +1 -1
- package/dist/esm/{TranslationUtils-741a728a.js → TranslationUtils-0039c82d.js} +1 -1
- package/dist/esm/agreement-check_17.entry.js +8 -7
- package/dist/esm/random-actions.entry.js +1 -1
- package/dist/qbs-ect-cmp/{p-a130edd5.entry.js → p-0c1eead0.entry.js} +1 -1
- package/dist/qbs-ect-cmp/{p-87c689d6.js → p-b969ca3e.js} +1 -1
- package/dist/qbs-ect-cmp/{p-f62c1796.entry.js → p-fca9e256.entry.js} +2 -2
- package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
- package/dist/types/components/common/how-to-info/how-to-info.d.ts +1 -0
- package/dist/types/models/IAddRequest.d.ts +1 -1
- package/dist/types/models/IOtpCheck.d.ts +1 -1
- package/dist/types/models/IOtpSend.d.ts +1 -1
- package/package.json +1 -1
|
@@ -484,7 +484,7 @@ class ApiCall {
|
|
|
484
484
|
state.requestId = jsonResp.requestId;
|
|
485
485
|
}
|
|
486
486
|
state.phoneNumber = jsonResp.phoneNumber;
|
|
487
|
-
state.flowStatus = exports.FlowStatus[jsonResp.
|
|
487
|
+
state.flowStatus = exports.FlowStatus[jsonResp.state];
|
|
488
488
|
return true;
|
|
489
489
|
}
|
|
490
490
|
async UploadFileForRequestB64(requestId, type, file) {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-41696e0e.js');
|
|
6
|
-
const TranslationUtils = require('./TranslationUtils-
|
|
6
|
+
const TranslationUtils = require('./TranslationUtils-2d932eab.js');
|
|
7
7
|
|
|
8
8
|
var MobileOS;
|
|
9
9
|
(function (MobileOS) {
|
|
@@ -4918,20 +4918,21 @@ const HowToInfo = class {
|
|
|
4918
4918
|
this.imagePath = 'https://ekyc.blob.core.windows.net/$web/howto_id.png';
|
|
4919
4919
|
this.buttonText = this.translations.HowToValues.IdButton;
|
|
4920
4920
|
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.IDFRONT) {
|
|
4921
|
-
this.
|
|
4921
|
+
this.currentStep = TranslationUtils.FlowSteps.CiFrontHowTo;
|
|
4922
4922
|
this.subTitle = this.translations.HowToValues.IdSubTitileFace;
|
|
4923
4923
|
}
|
|
4924
4924
|
else if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.IDBACK) {
|
|
4925
|
-
this.
|
|
4925
|
+
this.currentStep = TranslationUtils.FlowSteps.CiBackHowTo;
|
|
4926
4926
|
this.subTitle = this.translations.HowToValues.IdSubTitileBack;
|
|
4927
4927
|
}
|
|
4928
4928
|
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.LIVENESS) {
|
|
4929
|
-
this.
|
|
4929
|
+
this.currentStep = TranslationUtils.FlowSteps.SelfieHowTo;
|
|
4930
4930
|
this.topTitle = this.translations.HowToValues.SelfieTitile;
|
|
4931
4931
|
this.subTitle = this.translations.HowToValues.SelfieSubTitile;
|
|
4932
4932
|
this.imagePath = 'https://ekyc.blob.core.windows.net/$web/howto_selfie.png';
|
|
4933
4933
|
this.buttonText = this.translations.HowToValues.SelfieButton;
|
|
4934
4934
|
}
|
|
4935
|
+
this.baseComponent = new BaseComponent(this.currentStep);
|
|
4935
4936
|
this.baseComponent.setEventEmitter(this.apiErrorEvent);
|
|
4936
4937
|
}
|
|
4937
4938
|
render() {
|
|
@@ -5286,7 +5287,7 @@ function v4(options, buf, offset) {
|
|
|
5286
5287
|
}
|
|
5287
5288
|
|
|
5288
5289
|
const name = "@ekyc_qoobiss/qbs-ect-cmp";
|
|
5289
|
-
const version$1 = "3.6.
|
|
5290
|
+
const version$1 = "3.6.44";
|
|
5290
5291
|
const description = "Person Identification Component";
|
|
5291
5292
|
const main = "./dist/index.cjs.js";
|
|
5292
5293
|
const module$1 = "./dist/index.js";
|
|
@@ -8930,7 +8931,7 @@ const SmsCodeValidation = class {
|
|
|
8930
8931
|
try {
|
|
8931
8932
|
this.canSend = false;
|
|
8932
8933
|
var codeChecked = await this.baseComponent.apiCall.CheckOTPCode(TranslationUtils.state.requestId, this.code);
|
|
8933
|
-
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus[codeChecked.
|
|
8934
|
+
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus[codeChecked.state];
|
|
8934
8935
|
}
|
|
8935
8936
|
catch (e) {
|
|
8936
8937
|
this.apiErrorEvent.emit(e);
|
|
@@ -8984,7 +8985,7 @@ const SmsSend = class {
|
|
|
8984
8985
|
this.canSend = false;
|
|
8985
8986
|
var codeSent = await this.baseComponent.apiCall.SendOTPCode(TranslationUtils.state.requestId, this.phoneNumber);
|
|
8986
8987
|
if (codeSent.sent === true) {
|
|
8987
|
-
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus[codeSent.
|
|
8988
|
+
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus[codeSent.state];
|
|
8988
8989
|
}
|
|
8989
8990
|
}
|
|
8990
8991
|
catch (e) {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-41696e0e.js');
|
|
6
|
-
const TranslationUtils = require('./TranslationUtils-
|
|
6
|
+
const TranslationUtils = require('./TranslationUtils-2d932eab.js');
|
|
7
7
|
|
|
8
8
|
const randomActionsCss = "";
|
|
9
9
|
|
|
@@ -24,20 +24,21 @@ export class HowToInfo {
|
|
|
24
24
|
this.imagePath = 'https://ekyc.blob.core.windows.net/$web/howto_id.png';
|
|
25
25
|
this.buttonText = this.translations.HowToValues.IdButton;
|
|
26
26
|
if (store.flowStatus == FlowStatus.IDFRONT) {
|
|
27
|
-
this.
|
|
27
|
+
this.currentStep = FlowSteps.CiFrontHowTo;
|
|
28
28
|
this.subTitle = this.translations.HowToValues.IdSubTitileFace;
|
|
29
29
|
}
|
|
30
30
|
else if (store.flowStatus == FlowStatus.IDBACK) {
|
|
31
|
-
this.
|
|
31
|
+
this.currentStep = FlowSteps.CiBackHowTo;
|
|
32
32
|
this.subTitle = this.translations.HowToValues.IdSubTitileBack;
|
|
33
33
|
}
|
|
34
34
|
if (store.flowStatus == FlowStatus.LIVENESS) {
|
|
35
|
-
this.
|
|
35
|
+
this.currentStep = FlowSteps.SelfieHowTo;
|
|
36
36
|
this.topTitle = this.translations.HowToValues.SelfieTitile;
|
|
37
37
|
this.subTitle = this.translations.HowToValues.SelfieSubTitile;
|
|
38
38
|
this.imagePath = 'https://ekyc.blob.core.windows.net/$web/howto_selfie.png';
|
|
39
39
|
this.buttonText = this.translations.HowToValues.SelfieButton;
|
|
40
40
|
}
|
|
41
|
+
this.baseComponent = new BaseComponent(this.currentStep);
|
|
41
42
|
this.baseComponent.setEventEmitter(this.apiErrorEvent);
|
|
42
43
|
}
|
|
43
44
|
render() {
|
|
@@ -18,7 +18,7 @@ export class SmsCodeValidation {
|
|
|
18
18
|
try {
|
|
19
19
|
this.canSend = false;
|
|
20
20
|
var codeChecked = await this.baseComponent.apiCall.CheckOTPCode(store.requestId, this.code);
|
|
21
|
-
store.flowStatus = FlowStatus[codeChecked.
|
|
21
|
+
store.flowStatus = FlowStatus[codeChecked.state];
|
|
22
22
|
}
|
|
23
23
|
catch (e) {
|
|
24
24
|
this.apiErrorEvent.emit(e);
|
|
@@ -18,7 +18,7 @@ export class SmsSend {
|
|
|
18
18
|
this.canSend = false;
|
|
19
19
|
var codeSent = await this.baseComponent.apiCall.SendOTPCode(store.requestId, this.phoneNumber);
|
|
20
20
|
if (codeSent.sent === true) {
|
|
21
|
-
store.flowStatus = FlowStatus[codeSent.
|
|
21
|
+
store.flowStatus = FlowStatus[codeSent.state];
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
catch (e) {
|
|
@@ -156,7 +156,7 @@ export class ApiCall {
|
|
|
156
156
|
store.requestId = jsonResp.requestId;
|
|
157
157
|
}
|
|
158
158
|
store.phoneNumber = jsonResp.phoneNumber;
|
|
159
|
-
store.flowStatus = FlowStatus[jsonResp.
|
|
159
|
+
store.flowStatus = FlowStatus[jsonResp.state];
|
|
160
160
|
return true;
|
|
161
161
|
}
|
|
162
162
|
async UploadFileForRequestB64(requestId, type, file) {
|
|
@@ -482,7 +482,7 @@ class ApiCall {
|
|
|
482
482
|
state.requestId = jsonResp.requestId;
|
|
483
483
|
}
|
|
484
484
|
state.phoneNumber = jsonResp.phoneNumber;
|
|
485
|
-
state.flowStatus = FlowStatus[jsonResp.
|
|
485
|
+
state.flowStatus = FlowStatus[jsonResp.state];
|
|
486
486
|
return true;
|
|
487
487
|
}
|
|
488
488
|
async UploadFileForRequestB64(requestId, type, file) {
|
|
@@ -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, s as state, F as FlowMoments, a as FlowSteps, T as Translations, S as SessionKeys, b as FlowStatus, I as IdCaptureValues, O as OrderStatuses, c as SelfieCaptureValues } from './TranslationUtils-
|
|
2
|
+
import { A as ApiCall, s as state, F as FlowMoments, a as FlowSteps, T as Translations, S as SessionKeys, b as FlowStatus, I as IdCaptureValues, O as OrderStatuses, c as SelfieCaptureValues } from './TranslationUtils-0039c82d.js';
|
|
3
3
|
|
|
4
4
|
var MobileOS;
|
|
5
5
|
(function (MobileOS) {
|
|
@@ -4914,20 +4914,21 @@ const HowToInfo = class {
|
|
|
4914
4914
|
this.imagePath = 'https://ekyc.blob.core.windows.net/$web/howto_id.png';
|
|
4915
4915
|
this.buttonText = this.translations.HowToValues.IdButton;
|
|
4916
4916
|
if (state.flowStatus == FlowStatus.IDFRONT) {
|
|
4917
|
-
this.
|
|
4917
|
+
this.currentStep = FlowSteps.CiFrontHowTo;
|
|
4918
4918
|
this.subTitle = this.translations.HowToValues.IdSubTitileFace;
|
|
4919
4919
|
}
|
|
4920
4920
|
else if (state.flowStatus == FlowStatus.IDBACK) {
|
|
4921
|
-
this.
|
|
4921
|
+
this.currentStep = FlowSteps.CiBackHowTo;
|
|
4922
4922
|
this.subTitle = this.translations.HowToValues.IdSubTitileBack;
|
|
4923
4923
|
}
|
|
4924
4924
|
if (state.flowStatus == FlowStatus.LIVENESS) {
|
|
4925
|
-
this.
|
|
4925
|
+
this.currentStep = FlowSteps.SelfieHowTo;
|
|
4926
4926
|
this.topTitle = this.translations.HowToValues.SelfieTitile;
|
|
4927
4927
|
this.subTitle = this.translations.HowToValues.SelfieSubTitile;
|
|
4928
4928
|
this.imagePath = 'https://ekyc.blob.core.windows.net/$web/howto_selfie.png';
|
|
4929
4929
|
this.buttonText = this.translations.HowToValues.SelfieButton;
|
|
4930
4930
|
}
|
|
4931
|
+
this.baseComponent = new BaseComponent(this.currentStep);
|
|
4931
4932
|
this.baseComponent.setEventEmitter(this.apiErrorEvent);
|
|
4932
4933
|
}
|
|
4933
4934
|
render() {
|
|
@@ -5282,7 +5283,7 @@ function v4(options, buf, offset) {
|
|
|
5282
5283
|
}
|
|
5283
5284
|
|
|
5284
5285
|
const name = "@ekyc_qoobiss/qbs-ect-cmp";
|
|
5285
|
-
const version$1 = "3.6.
|
|
5286
|
+
const version$1 = "3.6.44";
|
|
5286
5287
|
const description = "Person Identification Component";
|
|
5287
5288
|
const main = "./dist/index.cjs.js";
|
|
5288
5289
|
const module = "./dist/index.js";
|
|
@@ -8926,7 +8927,7 @@ const SmsCodeValidation = class {
|
|
|
8926
8927
|
try {
|
|
8927
8928
|
this.canSend = false;
|
|
8928
8929
|
var codeChecked = await this.baseComponent.apiCall.CheckOTPCode(state.requestId, this.code);
|
|
8929
|
-
state.flowStatus = FlowStatus[codeChecked.
|
|
8930
|
+
state.flowStatus = FlowStatus[codeChecked.state];
|
|
8930
8931
|
}
|
|
8931
8932
|
catch (e) {
|
|
8932
8933
|
this.apiErrorEvent.emit(e);
|
|
@@ -8980,7 +8981,7 @@ const SmsSend = class {
|
|
|
8980
8981
|
this.canSend = false;
|
|
8981
8982
|
var codeSent = await this.baseComponent.apiCall.SendOTPCode(state.requestId, this.phoneNumber);
|
|
8982
8983
|
if (codeSent.sent === true) {
|
|
8983
|
-
state.flowStatus = FlowStatus[codeSent.
|
|
8984
|
+
state.flowStatus = FlowStatus[codeSent.state];
|
|
8984
8985
|
}
|
|
8985
8986
|
}
|
|
8986
8987
|
catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as s}from"./p-8942656c.js";import{T as i}from"./p-
|
|
1
|
+
import{r as t,h as s}from"./p-8942656c.js";import{T as i}from"./p-b969ca3e.js";const o=class{constructor(s){t(this,s)}async componentWillLoad(){this.translations=await i.getValues()}buttonClick(){}render(){return s("div",{class:"container"},s("div",{class:"row"},s("div",{class:"text-center"},s("h1",null,this.topTitle)),s("div",{class:"pos-relative show-bottom"},s("div",{class:"btn-buletin"},s("button",{class:"main-button",onClick:()=>this.buttonClick()},this.buttonText),s("p",{class:"main-text font-size-18 text-right mb-0"},this.translations.GlobalValues.FooterText)))))}};o.style="";export{o as random_actions}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t,f as e}from"./p-8942656c.js";var i;!function(t){t[t.Capturing=0]="Capturing",t[t.FinishedCapturing=1]="FinishedCapturing",t[t.Waiting=2]="Waiting",t[t.NotFound=3]="NotFound",t[t.Aborted=4]="Aborted"}(i||(i={}));const s=t=>!("isConnected"in t)||t.isConnected,n=(()=>{let t;return(...e)=>{t&&clearTimeout(t),t=setTimeout((()=>{t=0,(t=>{for(let e of t.keys())t.set(e,t.get(e).filter(s))})(...e)}),2e3)}})(),a=t=>"function"==typeof t?t():t;var o;!function(t){t[t.LANDING=0]="LANDING",t[t.MOBILE=1]="MOBILE",t[t.AGREEMENT=2]="AGREEMENT",t[t.PHONE=3]="PHONE",t[t.CODE=4]="CODE",t[t.CODEERROR=5]="CODEERROR",t[t.IDFRONT=6]="IDFRONT",t[t.IDBACK=7]="IDBACK",t[t.IDTILT=8]="IDTILT",t[t.LIVENESS=9]="LIVENESS",t[t.LIVENESSGESTURE=10]="LIVENESSGESTURE",t[t.COMPLETE=11]="COMPLETE",t[t.ERROREND=12]="ERROREND",t[t.CAMERAERROR=13]="CAMERAERROR",t[t.ABORTED=14]="ABORTED",t[t.NONE=15]="NONE"}(o||(o={}));class r{}r.IDPoseDemoMapping={0:"https://ekyc.blob.core.windows.net/$web/animations/id/id_front.mp4",1:"https://ekyc.blob.core.windows.net/$web/animations/id/id_front_tilt.mp4",2:"https://ekyc.blob.core.windows.net/$web/animations/id/id_rotate.mp4",3:"https://ekyc.blob.core.windows.net/$web/animations/id/id_back.mp4",4:"https://ekyc.blob.core.windows.net/$web/animations/id/id_back_tilt.mp4"};class c{}c.FacePoseDemoMapping={0:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_rotate_left.mp4",1:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_rotate_right.mp4",2:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_tilt_back.mp4",3:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_tilt_front.mp4",4:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_main.mp4"};class h{}h.FlowStatusKey="qbs-ect-flowstatus",h.RequestIdKey="qbs-ect-requestid",h.TokenKey="qbs-ect-token",h.InitialisedKey="qbs-ect-initialised",h.HasIdBackKey="qbs-ect-has-id-back",h.AgreementValidationKey="qbs-ect-agreement-validation",h.PhoneValidationKey="qbs-ect-phone-validation",h.RefreshDoneKey="qbs-ect-refresh-done";class d{constructor(){this.uriEnv="/",this.uriEnv="QA"==l.environment?"/dev_":"/",this.OtpSend=this.uriEnv+"validation/otp/send",this.OtpCheck=this.uriEnv+"validation/otp/check",this.IdentityInsert=this.uriEnv+"validation/identity/insert",this.UploadCapture=this.uriEnv+"validation/upload/capture",this.GetAgreement=this.uriEnv+"validation/agreement/content",this.GenerateAgreement=this.uriEnv+"validation/agreement/generate",this.SendLink=this.uriEnv+"validation/otp/sendlink",this.GetStatus=this.uriEnv+"validation/identity/status",this.AddLog=this.uriEnv+"validation/logs/add",this.AddStep=this.uriEnv+"validation/logs/step",this.AbortRequest=this.uriEnv+"validation/identity/abort",this.Translations=this.uriEnv+"validation/translations/get",this.StartFlow=this.uriEnv+"flowstate/startflow",this.NextFlowState=this.uriEnv+"flowstate/getnextstate"}}const{state:l,onChange:u}=(()=>{const i=((t,e=((t,e)=>t!==e))=>{const i=a(t);let s=new Map(Object.entries(null!=i?i:{}));const n={dispose:[],get:[],set:[],reset:[]},o=()=>{var e;s=new Map(Object.entries(null!==(e=a(t))&&void 0!==e?e:{})),n.reset.forEach((t=>t()))},r=t=>(n.get.forEach((e=>e(t))),s.get(t)),c=(t,i)=>{const a=s.get(t);e(i,a,t)&&(s.set(t,i),n.set.forEach((e=>e(t,i,a))))},h="undefined"==typeof Proxy?{}:new Proxy(i,{get:(t,e)=>r(e),ownKeys:()=>Array.from(s.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(t,e)=>s.has(e),set:(t,e,i)=>(c(e,i),!0)}),d=(t,e)=>(n[t].push(e),()=>{((t,e)=>{const i=t.indexOf(e);i>=0&&(t[i]=t[t.length-1],t.length--)})(n[t],e)});return{state:h,get:r,set:c,on:d,onChange:(e,i)=>{const s=d("set",((t,s)=>{t===e&&i(s)})),n=d("reset",(()=>i(a(t)[e])));return()=>{s(),n()}},use:(...t)=>{const e=t.reduce(((t,e)=>(e.set&&t.push(d("set",e.set)),e.get&&t.push(d("get",e.get)),e.reset&&t.push(d("reset",e.reset)),e.dispose&&t.push(d("dispose",e.dispose)),t)),[]);return()=>e.forEach((t=>t()))},dispose:()=>{n.dispose.forEach((t=>t())),o()},reset:o,forceUpdate:t=>{const e=s.get(t);n.set.forEach((i=>i(t,e,e)))}}})({flowStatus:o.NONE,environment:"PROD",debug:!1,requestId:"",redirectId:"",token:"",cameraIds:[],cameraId:"",phoneNumber:"",apiBaseUrl:"https://apiro.id-kyc.com",device:null,langIso:"ro"},void 0);return i.use((()=>{if("function"!=typeof t)return{};const i=new Map;return{dispose:()=>i.clear(),get:e=>{const s=t();s&&((t,e,i)=>{const s=t.get(e);s?s.includes(i)||s.push(i):t.set(e,[i])})(i,e,s)},set:t=>{const s=i.get(t);s&&i.set(t,s.filter(e)),n(i)},reset:()=>{i.forEach((t=>t.forEach(e))),n(i)}}})()),i})();var p,w;u("environment",(t=>{l.debug="QA"==t})),u("flowStatus",(t=>{sessionStorage.setItem(h.FlowStatusKey,o[t])})),u("token",(t=>{sessionStorage.setItem(h.TokenKey,t)})),u("requestId",(t=>{sessionStorage.setItem(h.RequestIdKey,t)})),function(t){t[t.ComponentLoaded="component-loaded"]="ComponentLoaded",t[t.MobileRedirect="mobile-redirect"]="MobileRedirect",t[t.Landing="landing"]="Landing",t[t.Agreements="agreements"]="Agreements",t[t.OtpSend="otp-send"]="OtpSend",t[t.OtpCheck="otp-check"]="OtpCheck",t[t.CiFront="ci-front"]="CiFront",t[t.CiFrontHowTo="ci-front-how-to"]="CiFrontHowTo",t[t.CiFrontCapture="ci-front-capture"]="CiFrontCapture",t[t.CiBack="ci-back"]="CiBack",t[t.CiBackHowTo="ci-back-how-to"]="CiBackHowTo",t[t.CiBackCapture="ci-back-capture"]="CiBackCapture",t[t.CiTilt="ci-tilt"]="CiTilt",t[t.CiError="ci-error"]="CiError",t[t.SelfieHowTo="selfie-how-to"]="SelfieHowTo",t[t.SelfieTilt="selfie-tilt"]="SelfieTilt",t[t.SelfieCapture="selfie-capture"]="SelfieCapture",t[t.Selfie="selfie"]="Selfie",t[t.SelfieError="selfie-error"]="SelfieError",t[t.End="end"]="End",t[t.CameraError="camera-error"]="CameraError"}(p||(p={})),function(t){t[t.Initialized="initialized"]="Initialized",t[t.Finalized="finalized"]="Finalized",t[t.None="none"]="None"}(w||(w={}));class b{constructor(){this.serviceErrors=["Service Unavailable","Unauthorized"],this.toBase64=t=>new Promise(((e,i)=>{const s=new FileReader;s.readAsDataURL(t),s.onload=()=>e(s.result),s.onerror=t=>i(t)})),this.urls=new d}async http(t){const e=await fetch(t);if(!e.ok)throw new Error(e.statusText);try{return await e.json()}catch(t){throw new Error("No json found in response "+t)}}async post(t,e,i=!0){var s=new Request(l.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});try{return await this.http(s)}catch(s){if(!i||this.serviceErrors.includes(s.message))throw s;this.AddLog("Error in post ",s);try{var n=new Request(l.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});return await this.http(n)}catch(i){this.AddLog("Error in post ",i);var a=new Request(l.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});return await this.http(a)}}}async get(t,e=!0){var i=new Request(l.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});try{return await this.http(i)}catch(i){if(!e||this.serviceErrors.includes(i.message))throw i;this.AddLog("Error in get ",i);try{var s=new Request(l.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});return await this.http(s)}catch(e){this.AddLog("Error in get ",e);var n=new Request(l.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});return await this.http(n)}}}async SendOTPCode(t,e){let i={requestId:t,phone:e};return await this.post(this.urls.OtpSend,JSON.stringify(i))}async CheckOTPCode(t,e){let i={requestId:t,otp:e};return await this.post(this.urls.OtpCheck,JSON.stringify(i))}async AddIdentificationRequest(t,e){l.debug&&console.log("Calling identity request with store:"+JSON.stringify(l));let i={requestId:l.requestId,clientDeviceInfo:JSON.stringify(t),redirectId:l.redirectId,phoneNumber:l.phoneNumber,version:e},s=await this.post(this.urls.IdentityInsert,JSON.stringify(i));return""==l.requestId&&(l.requestId=s.requestId),l.phoneNumber=s.phoneNumber,l.flowStatus=o[s.status],!0}async UploadFileForRequestB64(t,e,i){let s={requestId:t,type:e,data:await this.toBase64(i)},n=await this.post(this.urls.UploadCapture,JSON.stringify(s));return l.flowStatus=o[n.state],!(e in["IdFront","IdBack","Selfie"])||n.isValid}async GetAgreement(t){return(await this.get(this.urls.GetAgreement+"?type="+t+"&requestId="+l.requestId)).htmlText}async GenerateAgreement(t){let e={requestId:l.requestId,documentType:t};return(await this.post(this.urls.GenerateAgreement,JSON.stringify(e))).generation}async GetStatus(t){let e=await this.get(this.urls.GetStatus+"?orderId="+t);return i[e.status]}async SendLink(t,e){let i={requestId:l.requestId,link:t,phoneNumber:e};return(await this.post(this.urls.SendLink,JSON.stringify(i))).sent}async AddLog(t,e){try{let i={requestId:l.requestId,action:o[l.flowStatus],message:JSON.stringify({error:t,context:e})};return(await this.post(this.urls.AddLog,JSON.stringify(i),!1)).saved}catch(t){}}async AddStep(t,e){let i={requestId:l.requestId,redirectId:l.redirectId,step:p[t],moment:w[e],timestamp:(new Date).toISOString()};return(await this.post(this.urls.AddStep,JSON.stringify(i))).saved}async AbortRequest(){return await this.post(this.urls.AbortRequest,JSON.stringify({requestId:l.requestId}))}async GetTranslations(t){return await this.get(this.urls.Translations+"?langIso="+t)}async LandingValidationStartFlow(t){let e=await this.post(this.urls.StartFlow,JSON.stringify({requesId:l.requestId,cameraIsAccessible:t}));return o[e.state]}async GetNextFlowState(){let t=await this.get(this.urls.StartFlow+"?requesId="+l.requestId);return o[t.state]}}const f=new class{async getValues(){return this.values||(this.values=await this.fetchTranslations()),this.values}getLocale(t=document.body){if(l.langIso&&""!=l.langIso)return l.langIso;{const e=t.closest("[lang]");return e?e.lang:"ro"}}async fetchTranslations(){const t=this.getLocale();try{const e=(new b).GetTranslations(t);if(e)return e}catch(e){return console.error(`Error loading locale: ${t}`,e),null}}};export{b as A,w as F,r as I,i as O,h as S,f as T,p as a,o as b,c,l as s}
|
|
1
|
+
import{a as t,f as e}from"./p-8942656c.js";var i;!function(t){t[t.Capturing=0]="Capturing",t[t.FinishedCapturing=1]="FinishedCapturing",t[t.Waiting=2]="Waiting",t[t.NotFound=3]="NotFound",t[t.Aborted=4]="Aborted"}(i||(i={}));const s=t=>!("isConnected"in t)||t.isConnected,n=(()=>{let t;return(...e)=>{t&&clearTimeout(t),t=setTimeout((()=>{t=0,(t=>{for(let e of t.keys())t.set(e,t.get(e).filter(s))})(...e)}),2e3)}})(),a=t=>"function"==typeof t?t():t;var o;!function(t){t[t.LANDING=0]="LANDING",t[t.MOBILE=1]="MOBILE",t[t.AGREEMENT=2]="AGREEMENT",t[t.PHONE=3]="PHONE",t[t.CODE=4]="CODE",t[t.CODEERROR=5]="CODEERROR",t[t.IDFRONT=6]="IDFRONT",t[t.IDBACK=7]="IDBACK",t[t.IDTILT=8]="IDTILT",t[t.LIVENESS=9]="LIVENESS",t[t.LIVENESSGESTURE=10]="LIVENESSGESTURE",t[t.COMPLETE=11]="COMPLETE",t[t.ERROREND=12]="ERROREND",t[t.CAMERAERROR=13]="CAMERAERROR",t[t.ABORTED=14]="ABORTED",t[t.NONE=15]="NONE"}(o||(o={}));class r{}r.IDPoseDemoMapping={0:"https://ekyc.blob.core.windows.net/$web/animations/id/id_front.mp4",1:"https://ekyc.blob.core.windows.net/$web/animations/id/id_front_tilt.mp4",2:"https://ekyc.blob.core.windows.net/$web/animations/id/id_rotate.mp4",3:"https://ekyc.blob.core.windows.net/$web/animations/id/id_back.mp4",4:"https://ekyc.blob.core.windows.net/$web/animations/id/id_back_tilt.mp4"};class c{}c.FacePoseDemoMapping={0:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_rotate_left.mp4",1:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_rotate_right.mp4",2:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_tilt_back.mp4",3:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_tilt_front.mp4",4:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_main.mp4"};class h{}h.FlowStatusKey="qbs-ect-flowstatus",h.RequestIdKey="qbs-ect-requestid",h.TokenKey="qbs-ect-token",h.InitialisedKey="qbs-ect-initialised",h.HasIdBackKey="qbs-ect-has-id-back",h.AgreementValidationKey="qbs-ect-agreement-validation",h.PhoneValidationKey="qbs-ect-phone-validation",h.RefreshDoneKey="qbs-ect-refresh-done";class d{constructor(){this.uriEnv="/",this.uriEnv="QA"==l.environment?"/dev_":"/",this.OtpSend=this.uriEnv+"validation/otp/send",this.OtpCheck=this.uriEnv+"validation/otp/check",this.IdentityInsert=this.uriEnv+"validation/identity/insert",this.UploadCapture=this.uriEnv+"validation/upload/capture",this.GetAgreement=this.uriEnv+"validation/agreement/content",this.GenerateAgreement=this.uriEnv+"validation/agreement/generate",this.SendLink=this.uriEnv+"validation/otp/sendlink",this.GetStatus=this.uriEnv+"validation/identity/status",this.AddLog=this.uriEnv+"validation/logs/add",this.AddStep=this.uriEnv+"validation/logs/step",this.AbortRequest=this.uriEnv+"validation/identity/abort",this.Translations=this.uriEnv+"validation/translations/get",this.StartFlow=this.uriEnv+"flowstate/startflow",this.NextFlowState=this.uriEnv+"flowstate/getnextstate"}}const{state:l,onChange:u}=(()=>{const i=((t,e=((t,e)=>t!==e))=>{const i=a(t);let s=new Map(Object.entries(null!=i?i:{}));const n={dispose:[],get:[],set:[],reset:[]},o=()=>{var e;s=new Map(Object.entries(null!==(e=a(t))&&void 0!==e?e:{})),n.reset.forEach((t=>t()))},r=t=>(n.get.forEach((e=>e(t))),s.get(t)),c=(t,i)=>{const a=s.get(t);e(i,a,t)&&(s.set(t,i),n.set.forEach((e=>e(t,i,a))))},h="undefined"==typeof Proxy?{}:new Proxy(i,{get:(t,e)=>r(e),ownKeys:()=>Array.from(s.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(t,e)=>s.has(e),set:(t,e,i)=>(c(e,i),!0)}),d=(t,e)=>(n[t].push(e),()=>{((t,e)=>{const i=t.indexOf(e);i>=0&&(t[i]=t[t.length-1],t.length--)})(n[t],e)});return{state:h,get:r,set:c,on:d,onChange:(e,i)=>{const s=d("set",((t,s)=>{t===e&&i(s)})),n=d("reset",(()=>i(a(t)[e])));return()=>{s(),n()}},use:(...t)=>{const e=t.reduce(((t,e)=>(e.set&&t.push(d("set",e.set)),e.get&&t.push(d("get",e.get)),e.reset&&t.push(d("reset",e.reset)),e.dispose&&t.push(d("dispose",e.dispose)),t)),[]);return()=>e.forEach((t=>t()))},dispose:()=>{n.dispose.forEach((t=>t())),o()},reset:o,forceUpdate:t=>{const e=s.get(t);n.set.forEach((i=>i(t,e,e)))}}})({flowStatus:o.NONE,environment:"PROD",debug:!1,requestId:"",redirectId:"",token:"",cameraIds:[],cameraId:"",phoneNumber:"",apiBaseUrl:"https://apiro.id-kyc.com",device:null,langIso:"ro"},void 0);return i.use((()=>{if("function"!=typeof t)return{};const i=new Map;return{dispose:()=>i.clear(),get:e=>{const s=t();s&&((t,e,i)=>{const s=t.get(e);s?s.includes(i)||s.push(i):t.set(e,[i])})(i,e,s)},set:t=>{const s=i.get(t);s&&i.set(t,s.filter(e)),n(i)},reset:()=>{i.forEach((t=>t.forEach(e))),n(i)}}})()),i})();var p,w;u("environment",(t=>{l.debug="QA"==t})),u("flowStatus",(t=>{sessionStorage.setItem(h.FlowStatusKey,o[t])})),u("token",(t=>{sessionStorage.setItem(h.TokenKey,t)})),u("requestId",(t=>{sessionStorage.setItem(h.RequestIdKey,t)})),function(t){t[t.ComponentLoaded="component-loaded"]="ComponentLoaded",t[t.MobileRedirect="mobile-redirect"]="MobileRedirect",t[t.Landing="landing"]="Landing",t[t.Agreements="agreements"]="Agreements",t[t.OtpSend="otp-send"]="OtpSend",t[t.OtpCheck="otp-check"]="OtpCheck",t[t.CiFront="ci-front"]="CiFront",t[t.CiFrontHowTo="ci-front-how-to"]="CiFrontHowTo",t[t.CiFrontCapture="ci-front-capture"]="CiFrontCapture",t[t.CiBack="ci-back"]="CiBack",t[t.CiBackHowTo="ci-back-how-to"]="CiBackHowTo",t[t.CiBackCapture="ci-back-capture"]="CiBackCapture",t[t.CiTilt="ci-tilt"]="CiTilt",t[t.CiError="ci-error"]="CiError",t[t.SelfieHowTo="selfie-how-to"]="SelfieHowTo",t[t.SelfieTilt="selfie-tilt"]="SelfieTilt",t[t.SelfieCapture="selfie-capture"]="SelfieCapture",t[t.Selfie="selfie"]="Selfie",t[t.SelfieError="selfie-error"]="SelfieError",t[t.End="end"]="End",t[t.CameraError="camera-error"]="CameraError"}(p||(p={})),function(t){t[t.Initialized="initialized"]="Initialized",t[t.Finalized="finalized"]="Finalized",t[t.None="none"]="None"}(w||(w={}));class b{constructor(){this.serviceErrors=["Service Unavailable","Unauthorized"],this.toBase64=t=>new Promise(((e,i)=>{const s=new FileReader;s.readAsDataURL(t),s.onload=()=>e(s.result),s.onerror=t=>i(t)})),this.urls=new d}async http(t){const e=await fetch(t);if(!e.ok)throw new Error(e.statusText);try{return await e.json()}catch(t){throw new Error("No json found in response "+t)}}async post(t,e,i=!0){var s=new Request(l.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});try{return await this.http(s)}catch(s){if(!i||this.serviceErrors.includes(s.message))throw s;this.AddLog("Error in post ",s);try{var n=new Request(l.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});return await this.http(n)}catch(i){this.AddLog("Error in post ",i);var a=new Request(l.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});return await this.http(a)}}}async get(t,e=!0){var i=new Request(l.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});try{return await this.http(i)}catch(i){if(!e||this.serviceErrors.includes(i.message))throw i;this.AddLog("Error in get ",i);try{var s=new Request(l.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});return await this.http(s)}catch(e){this.AddLog("Error in get ",e);var n=new Request(l.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});return await this.http(n)}}}async SendOTPCode(t,e){let i={requestId:t,phone:e};return await this.post(this.urls.OtpSend,JSON.stringify(i))}async CheckOTPCode(t,e){let i={requestId:t,otp:e};return await this.post(this.urls.OtpCheck,JSON.stringify(i))}async AddIdentificationRequest(t,e){l.debug&&console.log("Calling identity request with store:"+JSON.stringify(l));let i={requestId:l.requestId,clientDeviceInfo:JSON.stringify(t),redirectId:l.redirectId,phoneNumber:l.phoneNumber,version:e},s=await this.post(this.urls.IdentityInsert,JSON.stringify(i));return""==l.requestId&&(l.requestId=s.requestId),l.phoneNumber=s.phoneNumber,l.flowStatus=o[s.state],!0}async UploadFileForRequestB64(t,e,i){let s={requestId:t,type:e,data:await this.toBase64(i)},n=await this.post(this.urls.UploadCapture,JSON.stringify(s));return l.flowStatus=o[n.state],!(e in["IdFront","IdBack","Selfie"])||n.isValid}async GetAgreement(t){return(await this.get(this.urls.GetAgreement+"?type="+t+"&requestId="+l.requestId)).htmlText}async GenerateAgreement(t){let e={requestId:l.requestId,documentType:t};return(await this.post(this.urls.GenerateAgreement,JSON.stringify(e))).generation}async GetStatus(t){let e=await this.get(this.urls.GetStatus+"?orderId="+t);return i[e.status]}async SendLink(t,e){let i={requestId:l.requestId,link:t,phoneNumber:e};return(await this.post(this.urls.SendLink,JSON.stringify(i))).sent}async AddLog(t,e){try{let i={requestId:l.requestId,action:o[l.flowStatus],message:JSON.stringify({error:t,context:e})};return(await this.post(this.urls.AddLog,JSON.stringify(i),!1)).saved}catch(t){}}async AddStep(t,e){let i={requestId:l.requestId,redirectId:l.redirectId,step:p[t],moment:w[e],timestamp:(new Date).toISOString()};return(await this.post(this.urls.AddStep,JSON.stringify(i))).saved}async AbortRequest(){return await this.post(this.urls.AbortRequest,JSON.stringify({requestId:l.requestId}))}async GetTranslations(t){return await this.get(this.urls.Translations+"?langIso="+t)}async LandingValidationStartFlow(t){let e=await this.post(this.urls.StartFlow,JSON.stringify({requesId:l.requestId,cameraIsAccessible:t}));return o[e.state]}async GetNextFlowState(){let t=await this.get(this.urls.StartFlow+"?requesId="+l.requestId);return o[t.state]}}const f=new class{async getValues(){return this.values||(this.values=await this.fetchTranslations()),this.values}getLocale(t=document.body){if(l.langIso&&""!=l.langIso)return l.langIso;{const e=t.closest("[lang]");return e?e.lang:"ro"}}async fetchTranslations(){const t=this.getLocale();try{const e=(new b).GetTranslations(t);if(e)return e}catch(e){return console.error(`Error loading locale: ${t}`,e),null}}};export{b as A,w as F,r as I,i as O,h as S,f as T,p as a,o as b,c,l as s}
|