@everymatrix/player-kyc-verification 1.0.69
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/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/index-ff559e5a.js +1249 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/cjs/player-kyc-verification.cjs.entry.js +564 -0
- package/dist/cjs/player-kyc-verification.cjs.js +25 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/player-kyc-verification/index.js +1 -0
- package/dist/collection/components/player-kyc-verification/player-kyc-verification.css +173 -0
- package/dist/collection/components/player-kyc-verification/player-kyc-verification.js +508 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/locale.utils.js +242 -0
- package/dist/collection/utils/utils.js +30 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/index-065b5928.js +1222 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/player-kyc-verification.entry.js +560 -0
- package/dist/esm/player-kyc-verification.js +20 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/player-kyc-verification/index.esm.js +0 -0
- package/dist/player-kyc-verification/p-0635ee37.entry.js +1 -0
- package/dist/player-kyc-verification/p-72182c55.js +2 -0
- package/dist/player-kyc-verification/p-e1255160.js +1 -0
- package/dist/player-kyc-verification/player-kyc-verification.esm.js +1 -0
- package/dist/stencil.config.dev.js +17 -0
- package/dist/stencil.config.js +17 -0
- package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/player-kyc-verification/.stencil/packages/stencil/player-kyc-verification/stencil.config.d.ts +2 -0
- package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/player-kyc-verification/.stencil/packages/stencil/player-kyc-verification/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/player-kyc-verification/index.d.ts +1 -0
- package/dist/types/components/player-kyc-verification/player-kyc-verification.d.ts +75 -0
- package/dist/types/components.d.ts +117 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1674 -0
- package/dist/types/utils/locale.utils.d.ts +2 -0
- package/dist/types/utils/utils.d.ts +14 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/loader/package.json +11 -0
- package/package.json +26 -0
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
import { h, Fragment } from "@stencil/core";
|
|
2
|
+
import { getTranslations, translate } from "../../utils/locale.utils";
|
|
3
|
+
import { isMobile } from "../../utils/utils";
|
|
4
|
+
export class PlayerKycVerificationWidget {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.scriptInjected = false;
|
|
7
|
+
this.MAX_UPLOAD_SIZE = 50000000;
|
|
8
|
+
this.userAgent = window.navigator.userAgent;
|
|
9
|
+
this.isMobile = isMobile(this.userAgent);
|
|
10
|
+
this.setClientStyling = () => {
|
|
11
|
+
let sheet = document.createElement('style');
|
|
12
|
+
sheet.innerHTML = this.clientStyling;
|
|
13
|
+
this.stylingContainer.prepend(sheet);
|
|
14
|
+
};
|
|
15
|
+
this.setClientStylingURL = () => {
|
|
16
|
+
let url = new URL(this.clientStylingUrl);
|
|
17
|
+
let cssFile = document.createElement('style');
|
|
18
|
+
fetch(url.href)
|
|
19
|
+
.then((res) => res.text())
|
|
20
|
+
.then((data) => {
|
|
21
|
+
cssFile.innerHTML = data;
|
|
22
|
+
setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
|
|
23
|
+
})
|
|
24
|
+
.catch((err) => {
|
|
25
|
+
console.log('error ', err);
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
this.handleToggleScreen = () => {
|
|
29
|
+
this.toggleScreen(this.isMobile);
|
|
30
|
+
};
|
|
31
|
+
this.userId = '';
|
|
32
|
+
this.session = '';
|
|
33
|
+
this.language = undefined;
|
|
34
|
+
this.endpoint = '';
|
|
35
|
+
this.translationUrl = '';
|
|
36
|
+
this.clientStyling = '';
|
|
37
|
+
this.verifiedIcon = '';
|
|
38
|
+
this.failedIcon = '';
|
|
39
|
+
this.defaultIcon = '';
|
|
40
|
+
this.clientStylingUrl = '';
|
|
41
|
+
this.verificationType = [];
|
|
42
|
+
this.isLoading = false;
|
|
43
|
+
this.stylingAppends = false;
|
|
44
|
+
this.selectedFile = null;
|
|
45
|
+
this.uploadingStatus = undefined;
|
|
46
|
+
this.uploadSizeExceeded = false;
|
|
47
|
+
this.selectedOption = undefined;
|
|
48
|
+
this.expandedOnDesktop = false;
|
|
49
|
+
}
|
|
50
|
+
handleNewTranslations() {
|
|
51
|
+
this.isLoading = true;
|
|
52
|
+
getTranslations(this.translationUrl).then(() => {
|
|
53
|
+
this.isLoading = false;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
async componentWillLoad() {
|
|
57
|
+
if (this.translationUrl.length > 2) {
|
|
58
|
+
await getTranslations(this.translationUrl);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
componentDidRender() {
|
|
62
|
+
// start custom styling area
|
|
63
|
+
if (!this.stylingAppends && this.stylingContainer) {
|
|
64
|
+
if (this.clientStyling)
|
|
65
|
+
this.setClientStyling();
|
|
66
|
+
if (this.clientStylingUrl)
|
|
67
|
+
this.setClientStylingURL();
|
|
68
|
+
this.stylingAppends = true;
|
|
69
|
+
}
|
|
70
|
+
// end custom styling area
|
|
71
|
+
}
|
|
72
|
+
async componentDidLoad() {
|
|
73
|
+
if (window.innerWidth > 700) {
|
|
74
|
+
this.expandedOnDesktop = true;
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
let url = new URL(`${this.endpoint}/v2/player/${this.userId}/verification/GetKYCCustomerStatus`);
|
|
78
|
+
const options = {
|
|
79
|
+
method: 'POST',
|
|
80
|
+
headers: {
|
|
81
|
+
'X-SessionId': this.session,
|
|
82
|
+
'Content-Type': 'application/json',
|
|
83
|
+
},
|
|
84
|
+
body: JSON.stringify({})
|
|
85
|
+
};
|
|
86
|
+
fetch(url.href, options)
|
|
87
|
+
.then((res) => {
|
|
88
|
+
if (res.status === 200) {
|
|
89
|
+
return res.json();
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
throw new Error("HTTP status " + res.status);
|
|
93
|
+
}
|
|
94
|
+
})
|
|
95
|
+
.then((data) => {
|
|
96
|
+
this.verificationType = data.verifications;
|
|
97
|
+
})
|
|
98
|
+
.catch((err) => {
|
|
99
|
+
// Handle any errors
|
|
100
|
+
console.error(err);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
console.error('Error fetching verification types:', error);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
handleOptionChange(event, verificationTypeId) {
|
|
108
|
+
const target = event.target;
|
|
109
|
+
this.selectedOption = target.value;
|
|
110
|
+
this.verificationType = this.verificationType.map((type) => {
|
|
111
|
+
if (type.type === verificationTypeId) {
|
|
112
|
+
type.optionChosen = target.value;
|
|
113
|
+
}
|
|
114
|
+
return type;
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
handleDocumentsStatus(verificationTypeId, documentsStatus, documentCode) {
|
|
118
|
+
this.verificationType = this.verificationType.map((vType) => {
|
|
119
|
+
if (vType.type === verificationTypeId) {
|
|
120
|
+
const document = vType.documents.find((doc) => doc.code === documentCode);
|
|
121
|
+
if (document) {
|
|
122
|
+
document.statusUploaded = documentsStatus;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return vType;
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
downloadPDF(pdfUrl) {
|
|
129
|
+
const link = document.createElement('a');
|
|
130
|
+
link.href = pdfUrl;
|
|
131
|
+
link.download = 'file.pdf';
|
|
132
|
+
link.target = '_blank';
|
|
133
|
+
link.dispatchEvent(new MouseEvent('click'));
|
|
134
|
+
}
|
|
135
|
+
toggleVerificationType(verificationTypeId, verificationTypeFlowInfoType) {
|
|
136
|
+
this.expandedOnDesktop = false;
|
|
137
|
+
this.verificationType = this.verificationType.map((type) => {
|
|
138
|
+
var _a;
|
|
139
|
+
if (type.type === verificationTypeId && ((_a = type.flowInfo) === null || _a === void 0 ? void 0 : _a.type) == verificationTypeFlowInfoType) {
|
|
140
|
+
type.expanded = !type.expanded;
|
|
141
|
+
}
|
|
142
|
+
return type;
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
toggleScreen(isMobile) {
|
|
146
|
+
window.postMessage({ type: 'PlayerAccountMenuActive', isMobile }, window.location.href);
|
|
147
|
+
}
|
|
148
|
+
checkFileSize(file) {
|
|
149
|
+
let size = 0;
|
|
150
|
+
Object.keys(file).forEach(element => {
|
|
151
|
+
size += file[element].size;
|
|
152
|
+
});
|
|
153
|
+
return size <= this.MAX_UPLOAD_SIZE;
|
|
154
|
+
}
|
|
155
|
+
handleFileSelection(file, documentType, verificationTypeId) {
|
|
156
|
+
if (file && file.length > 0) {
|
|
157
|
+
this.selectedFile = file;
|
|
158
|
+
if (!this.checkFileSize(this.selectedFile)) {
|
|
159
|
+
console.error(translate('fileSizeExceeded', this.language));
|
|
160
|
+
this.uploadingStatus = translate('fileSizeExceeded', this.language);
|
|
161
|
+
this.handleDocumentsStatus(verificationTypeId, this.uploadingStatus, documentType);
|
|
162
|
+
this.uploadSizeExceeded = true;
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
const uploadOptions = {
|
|
166
|
+
method: 'POST',
|
|
167
|
+
headers: {
|
|
168
|
+
'Content-Type': 'application/json',
|
|
169
|
+
'X-SessionId': this.session,
|
|
170
|
+
},
|
|
171
|
+
body: JSON.stringify({ DocumentCode: documentType }),
|
|
172
|
+
};
|
|
173
|
+
fetch(`${this.endpoint}/v1/player/${this.userId}/verification/GetKYCVerificationDocumentUploadUrl`, uploadOptions)
|
|
174
|
+
.then(response => {
|
|
175
|
+
if (response.ok) {
|
|
176
|
+
this.uploadingStatus = translate('uploading', this.language);
|
|
177
|
+
this.handleDocumentsStatus(verificationTypeId, this.uploadingStatus, documentType);
|
|
178
|
+
return response.json();
|
|
179
|
+
}
|
|
180
|
+
}).then((data) => {
|
|
181
|
+
const formData = new FormData();
|
|
182
|
+
formData.append(documentType, this.selectedFile[0]);
|
|
183
|
+
fetch(data.Url, { method: "POST", body: formData })
|
|
184
|
+
.then(res => {
|
|
185
|
+
if (res.ok) {
|
|
186
|
+
if (this.selectedFile.length > 1) {
|
|
187
|
+
this.uploadingStatus = translate('successUploadMultipleFiles', this.language);
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
this.uploadingStatus = translate('successUpload', this.language);
|
|
191
|
+
}
|
|
192
|
+
this.handleDocumentsStatus(verificationTypeId, this.uploadingStatus, documentType);
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
this.uploadingStatus = translate('failedUpload', this.language);
|
|
196
|
+
this.handleDocumentsStatus(verificationTypeId, this.uploadingStatus, documentType);
|
|
197
|
+
console.error('File upload error:', res.status);
|
|
198
|
+
}
|
|
199
|
+
})
|
|
200
|
+
.catch(error => {
|
|
201
|
+
console.error('File upload error:', error);
|
|
202
|
+
});
|
|
203
|
+
})
|
|
204
|
+
.catch(error => {
|
|
205
|
+
console.error('File upload error:', error);
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
importScript(url) {
|
|
211
|
+
return new Promise((resolve, reject) => {
|
|
212
|
+
fetch(url)
|
|
213
|
+
.then((res) => res.text())
|
|
214
|
+
.then((res) => {
|
|
215
|
+
const scriptFunction = new Function(res);
|
|
216
|
+
scriptFunction();
|
|
217
|
+
if (this.scriptInjected) {
|
|
218
|
+
resolve(true);
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
const scriptElement = document.createElement('script');
|
|
222
|
+
scriptElement.src = 'https://test.insic.de/frontend3/static/js/avs-loader.min.js';
|
|
223
|
+
document.head.appendChild(scriptElement);
|
|
224
|
+
this.scriptInjected = true;
|
|
225
|
+
resolve(true);
|
|
226
|
+
}
|
|
227
|
+
})
|
|
228
|
+
.catch(error => {
|
|
229
|
+
reject(error);
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
isStatusUploaded(document) {
|
|
234
|
+
if (document && document.status === 'Uploaded')
|
|
235
|
+
return true;
|
|
236
|
+
return false;
|
|
237
|
+
}
|
|
238
|
+
renderVerificationTypeBox(verificationType) {
|
|
239
|
+
if (this.expandedOnDesktop) {
|
|
240
|
+
verificationType.expanded = true;
|
|
241
|
+
}
|
|
242
|
+
let expanded = verificationType.expanded;
|
|
243
|
+
let name = verificationType.type.trim();
|
|
244
|
+
let optionChosen = verificationType.optionChosen;
|
|
245
|
+
let status = verificationType.status;
|
|
246
|
+
let documents = verificationType.documents;
|
|
247
|
+
let flowInfo = verificationType.flowInfo;
|
|
248
|
+
const isVerified = status === 'Verified';
|
|
249
|
+
const isFailedOrExpired = status === 'Failed' || status === 'Expired';
|
|
250
|
+
return (h("div", { class: `verification-box ${expanded ? 'expanded' : ''} ${isFailedOrExpired ? 'failed' : ''} ${isVerified ? 'success' : ''}` }, h("div", { class: `box box-header ${expanded ? 'expanded' : ''}`, onClick: () => { var _a; return this.toggleVerificationType(verificationType.type, (_a = verificationType.flowInfo) === null || _a === void 0 ? void 0 : _a.type); } }, h("div", { class: "box-icon" }, isVerified ? (h("div", null, this.verifiedIcon ? (h("img", { class: "CustomVerifiedIcon", src: this.verifiedIcon, alt: "" })) : (h("svg", { width: "100", height: "100", viewBox: "0 0 100 100", xmlns: "http://www.w3.org/2000/svg" }, h("circle", { cx: "50", cy: "50", r: "40", fill: "#388D79" }), h("circle", { cx: "50", cy: "50", r: "34", fill: "none", stroke: "#fff", "stroke-width": "12px" }), h("polyline", { points: "30,50 45,63 70,35", fill: "none", stroke: "#fff", "stroke-width": "8px" }))))) : (isFailedOrExpired ? (h("div", null, this.failedIcon ? (h("img", { class: "CustomFailedIcon", src: this.failedIcon, alt: "" })) : (h("svg", { width: "100", height: "100", viewBox: "0 0 100 100", xmlns: "http://www.w3.org/2000/svg" }, h("circle", { cx: "50", cy: "50", r: "40", fill: "red" }), h("line", { x1: "30", y1: "30", x2: "70", y2: "70", stroke: "#fff", "stroke-width": "10px" }), h("line", { x1: "30", y1: "70", x2: "70", y2: "30", stroke: "#fff", "stroke-width": "10px" }))))) : (h("div", null, this.defaultIcon ? (h("img", { class: "CustomDefaultIcon", src: this.defaultIcon, alt: "" })) : (h("svg", { width: "800px", height: "800px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M4 4V20C4 21.1046 4.89543 22 6 22L18 22C19.1046 22 20 21.1046 20 20V8.34162C20 7.8034 19.7831 7.28789 19.3982 6.91161L14.9579 2.56999C14.5842 2.20459 14.0824 2 13.5597 2L6 2C4.89543 2 4 2.89543 4 4Z", stroke: "#000000", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M9 13H15", stroke: "#000000", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M9 17H12", stroke: "#000000", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M14 2V6C14 7.10457 14.8954 8 16 8H20", stroke: "#000000", "stroke-width": "2", "stroke-linejoin": "round" }))))))), h("div", { class: "box-title" }, translate(name, this.language)), h("div", { class: "chevron-icon" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: expanded ? 'M6 15l6-6 6 6' : 'M6 9l6 6 6-6' })))), expanded ? (this.renderExpandedContent(verificationType, optionChosen, status, documents, flowInfo, isVerified, isFailedOrExpired)) :
|
|
251
|
+
(h("div", { class: "box box-content" }, h("div", { id: "__avs-wrapper" })))));
|
|
252
|
+
}
|
|
253
|
+
renderDocumentsActions(selectedDocument, optionChosen, verificationType) {
|
|
254
|
+
return (h("div", null, this.isStatusUploaded(selectedDocument) ? (h("div", { class: "upload-status" }, translate('uploaded', this.language))) :
|
|
255
|
+
(selectedDocument === null || selectedDocument === void 0 ? void 0 : selectedDocument.statusUploaded) ? (h("div", { class: "upload-status" }, selectedDocument === null || selectedDocument === void 0 ? void 0 : selectedDocument.statusUploaded)) : (h("div", { class: "documents-action" }, h("div", { class: "sample-file" }, (selectedDocument === null || selectedDocument === void 0 ? void 0 : selectedDocument.sampleType) === "FileDownload" ? (h("button", { class: "download-button", onClick: () => this.downloadPDF(selectedDocument === null || selectedDocument === void 0 ? void 0 : selectedDocument.sampleUrl) }, h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M12 0C5.372 0 0 5.372 0 12C0 18.628 5.372 24 12 24C18.628 24 24 18.628 24 12C24 5.372 18.628 0 12 0ZM12 22C6.485 22 2 17.515 2 12C2 6.485 6.485 2 12 2C17.515 2 22 6.485 22 12C22 17.515 17.515 22 12 22Z", fill: "var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #D0046C))" }), h("path", { d: "M17 11H14V6H10V11H7L12 16L17 11ZM7 17V19H17V17H7Z", fill: "var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #D0046C))" })), h("span", null, translate('download', this.language)))) : null), h("div", { class: "upload-button" }, optionChosen ? (h("label", null, h("input", { type: "file", accept: "*", onChange: ($event) => this.handleFileSelection($event.target.files, this.selectedOption, verificationType.type), style: { display: 'none' } }), h("svg", { width: "100", height: "100", xmlns: "http://www.w3.org/2000/svg" }, h("circle", { cx: "50", cy: "50", r: "40", fill: "var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #D0046C))" }), h("line", { x1: "30", y1: "50", x2: "70", y2: "50", stroke: "white", "stroke-width": "6" }), h("line", { x1: "50", y1: "30", x2: "50", y2: "70", stroke: "white", "stroke-width": "6" })))) : null)))));
|
|
256
|
+
}
|
|
257
|
+
;
|
|
258
|
+
renderExpandedContent(verificationType, optionChosen, status, documents, flowInfo, isVerified, isFailedOrExpired) {
|
|
259
|
+
if ((flowInfo === null || flowInfo === void 0 ? void 0 : flowInfo.type) === 'Widget') {
|
|
260
|
+
return (h("div", null, h("hr", { style: { margin: '5px' } }), h("iframe", { src: flowInfo.url, frameborder: "0", height: "400px", width: "100%", allowfullScreen: true, allow: "camera *;microphone *" })));
|
|
261
|
+
// comment the functionality under because it might have a different type of script that we might have to handle
|
|
262
|
+
// this.importScript(flowInfo.url)
|
|
263
|
+
// .then(() => {
|
|
264
|
+
// // Script imported successfully
|
|
265
|
+
// console.log('Script imported correctly');
|
|
266
|
+
// // Open/show the widget
|
|
267
|
+
// // You'll need to check the widget documentation for how to open/show it
|
|
268
|
+
// })
|
|
269
|
+
// .catch(error => {
|
|
270
|
+
// // Handle script import error
|
|
271
|
+
// console.error('Error importing script:', error);
|
|
272
|
+
// });
|
|
273
|
+
}
|
|
274
|
+
else if ((flowInfo === null || flowInfo === void 0 ? void 0 : flowInfo.type) === 'Redirect' && verificationType.vendorName !== "Manual" && status !== "Verified") {
|
|
275
|
+
return (h("div", null, h("hr", { style: { margin: '5px' } }), h("iframe", { src: flowInfo.url, frameborder: "0", height: "400px", width: "100%", allowfullScreen: true, allow: "camera *;microphone *" })));
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
return (h("div", { class: "box box-content" }, h(Fragment, null, isVerified ? (h("div", { class: "verification-status" }, translate('verificationComplete', this.language))) : isFailedOrExpired ? (h("div", { class: "verification-status" }, status === 'Failed' ? translate('verificationFailed', this.language) : translate('verificationExpired', this.language))) : documents.length > 0 ? (h("div", { class: "documents-dropdown" }, h("select", { class: "nice-select", onChange: (event) => this.handleOptionChange(event, verificationType.type) }, h("option", { value: "", selected: true, disabled: true, hidden: true }, translate('chooseDocument', this.language)), documents.map((doc) => (h("option", { selected: optionChosen == doc.code ? true : false, value: doc.code }, translate(doc.type, this.language))))), this.renderDocumentsActions(documents.find((e) => e.code === optionChosen), optionChosen, verificationType))) : null)));
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
render() {
|
|
282
|
+
if (this.isLoading) {
|
|
283
|
+
return (h("div", null, h("p", null, translate('loading', this.language))));
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
return (h("div", { class: "ModalContainer", ref: el => this.stylingContainer = el }, h("div", { class: "player-kyc-verification-widget" }, (this.isMobile ?
|
|
287
|
+
h("div", { class: "MenuReturnButton", onClick: this.handleToggleScreen }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15" }, h("defs", null), h("g", { transform: "translate(-20 -158)" }, h("g", { transform: "translate(20 158)" }, h("path", { class: "aaa", d: "M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z", transform: "translate(15 15) rotate(180)" })))), h("h2", null, translate('kycTitle', this.language)))
|
|
288
|
+
:
|
|
289
|
+
h("h2", null, translate('kycTitle', this.language))), this.verificationType.length === 0 ?
|
|
290
|
+
h("div", { class: "no-verification-description", style: { padding: '24px', fontSize: '18px' } }, translate('noVerificationRequired', this.language))
|
|
291
|
+
:
|
|
292
|
+
h(Fragment, null, h("div", { class: "widget-description" }, translate('kycDescription', this.language)), h("div", { class: "verification-types" }, this.verificationType.map((verificationType) => verificationType ? this.renderVerificationTypeBox(verificationType) : null))))));
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
static get is() { return "player-kyc-verification"; }
|
|
296
|
+
static get encapsulation() { return "shadow"; }
|
|
297
|
+
static get originalStyleUrls() {
|
|
298
|
+
return {
|
|
299
|
+
"$": ["player-kyc-verification.scss"]
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
static get styleUrls() {
|
|
303
|
+
return {
|
|
304
|
+
"$": ["player-kyc-verification.css"]
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
static get properties() {
|
|
308
|
+
return {
|
|
309
|
+
"userId": {
|
|
310
|
+
"type": "string",
|
|
311
|
+
"mutable": false,
|
|
312
|
+
"complexType": {
|
|
313
|
+
"original": "string",
|
|
314
|
+
"resolved": "string",
|
|
315
|
+
"references": {}
|
|
316
|
+
},
|
|
317
|
+
"required": false,
|
|
318
|
+
"optional": false,
|
|
319
|
+
"docs": {
|
|
320
|
+
"tags": [],
|
|
321
|
+
"text": "The userId"
|
|
322
|
+
},
|
|
323
|
+
"attribute": "user-id",
|
|
324
|
+
"reflect": false,
|
|
325
|
+
"defaultValue": "''"
|
|
326
|
+
},
|
|
327
|
+
"session": {
|
|
328
|
+
"type": "string",
|
|
329
|
+
"mutable": false,
|
|
330
|
+
"complexType": {
|
|
331
|
+
"original": "string",
|
|
332
|
+
"resolved": "string",
|
|
333
|
+
"references": {}
|
|
334
|
+
},
|
|
335
|
+
"required": false,
|
|
336
|
+
"optional": false,
|
|
337
|
+
"docs": {
|
|
338
|
+
"tags": [],
|
|
339
|
+
"text": "The session"
|
|
340
|
+
},
|
|
341
|
+
"attribute": "session",
|
|
342
|
+
"reflect": false,
|
|
343
|
+
"defaultValue": "''"
|
|
344
|
+
},
|
|
345
|
+
"language": {
|
|
346
|
+
"type": "string",
|
|
347
|
+
"mutable": false,
|
|
348
|
+
"complexType": {
|
|
349
|
+
"original": "string",
|
|
350
|
+
"resolved": "string",
|
|
351
|
+
"references": {}
|
|
352
|
+
},
|
|
353
|
+
"required": false,
|
|
354
|
+
"optional": false,
|
|
355
|
+
"docs": {
|
|
356
|
+
"tags": [],
|
|
357
|
+
"text": "The language"
|
|
358
|
+
},
|
|
359
|
+
"attribute": "language",
|
|
360
|
+
"reflect": false
|
|
361
|
+
},
|
|
362
|
+
"endpoint": {
|
|
363
|
+
"type": "string",
|
|
364
|
+
"mutable": false,
|
|
365
|
+
"complexType": {
|
|
366
|
+
"original": "string",
|
|
367
|
+
"resolved": "string",
|
|
368
|
+
"references": {}
|
|
369
|
+
},
|
|
370
|
+
"required": false,
|
|
371
|
+
"optional": false,
|
|
372
|
+
"docs": {
|
|
373
|
+
"tags": [],
|
|
374
|
+
"text": "The NorWAy endpoint"
|
|
375
|
+
},
|
|
376
|
+
"attribute": "endpoint",
|
|
377
|
+
"reflect": false,
|
|
378
|
+
"defaultValue": "''"
|
|
379
|
+
},
|
|
380
|
+
"translationUrl": {
|
|
381
|
+
"type": "string",
|
|
382
|
+
"mutable": false,
|
|
383
|
+
"complexType": {
|
|
384
|
+
"original": "string",
|
|
385
|
+
"resolved": "string",
|
|
386
|
+
"references": {}
|
|
387
|
+
},
|
|
388
|
+
"required": false,
|
|
389
|
+
"optional": false,
|
|
390
|
+
"docs": {
|
|
391
|
+
"tags": [],
|
|
392
|
+
"text": "The translationurl"
|
|
393
|
+
},
|
|
394
|
+
"attribute": "translation-url",
|
|
395
|
+
"reflect": false,
|
|
396
|
+
"defaultValue": "''"
|
|
397
|
+
},
|
|
398
|
+
"clientStyling": {
|
|
399
|
+
"type": "string",
|
|
400
|
+
"mutable": false,
|
|
401
|
+
"complexType": {
|
|
402
|
+
"original": "string",
|
|
403
|
+
"resolved": "string",
|
|
404
|
+
"references": {}
|
|
405
|
+
},
|
|
406
|
+
"required": false,
|
|
407
|
+
"optional": false,
|
|
408
|
+
"docs": {
|
|
409
|
+
"tags": [],
|
|
410
|
+
"text": "Client custom styling via string"
|
|
411
|
+
},
|
|
412
|
+
"attribute": "client-styling",
|
|
413
|
+
"reflect": false,
|
|
414
|
+
"defaultValue": "''"
|
|
415
|
+
},
|
|
416
|
+
"verifiedIcon": {
|
|
417
|
+
"type": "string",
|
|
418
|
+
"mutable": false,
|
|
419
|
+
"complexType": {
|
|
420
|
+
"original": "string",
|
|
421
|
+
"resolved": "string",
|
|
422
|
+
"references": {}
|
|
423
|
+
},
|
|
424
|
+
"required": false,
|
|
425
|
+
"optional": false,
|
|
426
|
+
"docs": {
|
|
427
|
+
"tags": [],
|
|
428
|
+
"text": "For verified status this icon will be displayed"
|
|
429
|
+
},
|
|
430
|
+
"attribute": "verified-icon",
|
|
431
|
+
"reflect": false,
|
|
432
|
+
"defaultValue": "''"
|
|
433
|
+
},
|
|
434
|
+
"failedIcon": {
|
|
435
|
+
"type": "string",
|
|
436
|
+
"mutable": false,
|
|
437
|
+
"complexType": {
|
|
438
|
+
"original": "string",
|
|
439
|
+
"resolved": "string",
|
|
440
|
+
"references": {}
|
|
441
|
+
},
|
|
442
|
+
"required": false,
|
|
443
|
+
"optional": false,
|
|
444
|
+
"docs": {
|
|
445
|
+
"tags": [],
|
|
446
|
+
"text": "For failed status this icon will be displayed"
|
|
447
|
+
},
|
|
448
|
+
"attribute": "failed-icon",
|
|
449
|
+
"reflect": false,
|
|
450
|
+
"defaultValue": "''"
|
|
451
|
+
},
|
|
452
|
+
"defaultIcon": {
|
|
453
|
+
"type": "string",
|
|
454
|
+
"mutable": false,
|
|
455
|
+
"complexType": {
|
|
456
|
+
"original": "string",
|
|
457
|
+
"resolved": "string",
|
|
458
|
+
"references": {}
|
|
459
|
+
},
|
|
460
|
+
"required": false,
|
|
461
|
+
"optional": false,
|
|
462
|
+
"docs": {
|
|
463
|
+
"tags": [],
|
|
464
|
+
"text": "For the default status this icon will be displayed"
|
|
465
|
+
},
|
|
466
|
+
"attribute": "default-icon",
|
|
467
|
+
"reflect": false,
|
|
468
|
+
"defaultValue": "''"
|
|
469
|
+
},
|
|
470
|
+
"clientStylingUrl": {
|
|
471
|
+
"type": "string",
|
|
472
|
+
"mutable": false,
|
|
473
|
+
"complexType": {
|
|
474
|
+
"original": "string",
|
|
475
|
+
"resolved": "string",
|
|
476
|
+
"references": {}
|
|
477
|
+
},
|
|
478
|
+
"required": false,
|
|
479
|
+
"optional": false,
|
|
480
|
+
"docs": {
|
|
481
|
+
"tags": [],
|
|
482
|
+
"text": "Client custom styling via url content"
|
|
483
|
+
},
|
|
484
|
+
"attribute": "client-styling-url",
|
|
485
|
+
"reflect": false,
|
|
486
|
+
"defaultValue": "''"
|
|
487
|
+
}
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
static get states() {
|
|
491
|
+
return {
|
|
492
|
+
"verificationType": {},
|
|
493
|
+
"isLoading": {},
|
|
494
|
+
"stylingAppends": {},
|
|
495
|
+
"selectedFile": {},
|
|
496
|
+
"uploadingStatus": {},
|
|
497
|
+
"uploadSizeExceeded": {},
|
|
498
|
+
"selectedOption": {},
|
|
499
|
+
"expandedOnDesktop": {}
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
static get watchers() {
|
|
503
|
+
return [{
|
|
504
|
+
"propName": "translationUrl",
|
|
505
|
+
"methodName": "handleNewTranslations"
|
|
506
|
+
}];
|
|
507
|
+
}
|
|
508
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|