@everymatrix/pam-player-contacts 0.11.2
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-ed59decb.js +1227 -0
- package/dist/cjs/index.cjs.js +10 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/cjs/pam-player-contacts-4a593000.js +469 -0
- package/dist/cjs/pam-player-contacts.cjs.js +25 -0
- package/dist/cjs/pam-player-contacts_2.cjs.entry.js +203 -0
- package/dist/collection/collection-manifest.json +19 -0
- package/dist/collection/components/pam-player-contacts/index.js +1 -0
- package/dist/collection/components/pam-player-contacts/pam-player-contacts.css +318 -0
- package/dist/collection/components/pam-player-contacts/pam-player-contacts.js +492 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/locale.utils.js +139 -0
- package/dist/collection/utils/utils.js +12 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/index-f7c756b2.js +1200 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/pam-player-contacts-08c08e29.js +467 -0
- package/dist/esm/pam-player-contacts.js +20 -0
- package/dist/esm/pam-player-contacts_2.entry.js +198 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/pam-player-contacts/app-globals-0f993ce5.js +1 -0
- package/dist/pam-player-contacts/index-f7c756b2.js +2 -0
- package/dist/pam-player-contacts/index.esm.js +1 -0
- package/dist/pam-player-contacts/pam-player-contacts-08c08e29.js +1 -0
- package/dist/pam-player-contacts/pam-player-contacts.esm.js +1 -0
- package/dist/pam-player-contacts/pam-player-contacts_2.entry.js +1 -0
- package/dist/stencil.config.dev.js +17 -0
- package/dist/stencil.config.js +19 -0
- package/dist/storybook/main.js +47 -0
- package/dist/storybook/preview.js +9 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-player-contacts/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-player-contacts/.stencil/packages/stencil/pam-player-contacts/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-player-contacts/.stencil/packages/stencil/pam-player-contacts/stencil.config.dev.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-player-contacts/.stencil/packages/stencil/pam-player-contacts/storybook/main.d.ts +3 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-player-contacts/.stencil/packages/stencil/pam-player-contacts/storybook/preview.d.ts +70 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-player-contacts/.stencil/tools/plugins/index.d.ts +3 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-player-contacts/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-player-contacts/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-player-contacts/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
- package/dist/types/components/pam-player-contacts/index.d.ts +1 -0
- package/dist/types/components/pam-player-contacts/pam-player-contacts.d.ts +56 -0
- package/dist/types/components.d.ts +59 -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 +23 -0
- package/dist/types/utils/utils.d.ts +7 -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,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const pamPlayerContacts = require('./pam-player-contacts-4a593000.js');
|
|
6
|
+
require('./index-ed59decb.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.PamPlayerContacts = pamPlayerContacts.PamPlayerContacts;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-ed59decb.js');
|
|
6
|
+
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
|
+
|
|
8
|
+
const defineCustomElements = async (win, options) => {
|
|
9
|
+
if (typeof window === 'undefined') return undefined;
|
|
10
|
+
await appGlobals.globalScripts();
|
|
11
|
+
return index.bootstrapLazy([["pam-player-contacts_2.cjs",[[1,"pam-player-contacts",{"userId":[513,"user-id"],"session":[513],"endpoint":[513],"lang":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"isVerificationStatusDisplayed":[513,"is-verification-status-displayed"],"isPhoneNumberEditable":[513,"is-phone-number-editable"],"isStandAlone":[513,"is-stand-alone"],"limitStylingAppends":[32],"isSkeletonLoading":[32],"isSubmitButtonAvailable":[32],"invalidFields":[32],"isMobile":[32],"isError":[32],"errorMessage":[32],"errorCode":[32]},null,{"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1],"color":[1],"primaryColor":[1,"primary-color"],"secondaryColor":[1,"secondary-color"]},null,{"structure":["handleStructureChange"]}]]]], options);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
exports.setNonce = index.setNonce;
|
|
15
|
+
exports.defineCustomElements = defineCustomElements;
|
|
@@ -0,0 +1,469 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index-ed59decb.js');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @name setClientStyling
|
|
7
|
+
* @description Method used to create and append to the passed element of the widget a style element with the content received
|
|
8
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
9
|
+
* @param {string} clientStyling The style content
|
|
10
|
+
*/
|
|
11
|
+
function setClientStyling(stylingContainer, clientStyling) {
|
|
12
|
+
if (stylingContainer) {
|
|
13
|
+
const sheet = document.createElement('style');
|
|
14
|
+
sheet.innerHTML = clientStyling;
|
|
15
|
+
stylingContainer.appendChild(sheet);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @name setClientStylingURL
|
|
21
|
+
* @description Method used to create and append to the passed element of the widget a style element with the content fetched from a given URL
|
|
22
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
23
|
+
* @param {string} clientStylingUrl The URL of the style content
|
|
24
|
+
*/
|
|
25
|
+
function setClientStylingURL(stylingContainer, clientStylingUrl) {
|
|
26
|
+
const url = new URL(clientStylingUrl);
|
|
27
|
+
|
|
28
|
+
fetch(url.href)
|
|
29
|
+
.then((res) => res.text())
|
|
30
|
+
.then((data) => {
|
|
31
|
+
const cssFile = document.createElement('style');
|
|
32
|
+
cssFile.innerHTML = data;
|
|
33
|
+
if (stylingContainer) {
|
|
34
|
+
stylingContainer.appendChild(cssFile);
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
.catch((err) => {
|
|
38
|
+
console.error('There was an error while trying to load client styling from URL', err);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @name setStreamLibrary
|
|
44
|
+
* @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
|
|
45
|
+
* @param {HTMLElement} stylingContainer The highest element of the widget
|
|
46
|
+
* @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
|
|
47
|
+
* @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
|
|
48
|
+
*/
|
|
49
|
+
function setStreamStyling(stylingContainer, domain, subscription) {
|
|
50
|
+
if (window.emMessageBus) {
|
|
51
|
+
const sheet = document.createElement('style');
|
|
52
|
+
|
|
53
|
+
window.emMessageBus.subscribe(domain, (data) => {
|
|
54
|
+
sheet.innerHTML = data;
|
|
55
|
+
if (stylingContainer) {
|
|
56
|
+
stylingContainer.appendChild(sheet);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
63
|
+
const TRANSLATIONS = {
|
|
64
|
+
"en": {
|
|
65
|
+
"title": "Contacts",
|
|
66
|
+
"email": "Email",
|
|
67
|
+
"phoneNumber": "Phone Number",
|
|
68
|
+
"phoneNumberError": "The phone number must be at least 5 digits and at most 15 digits",
|
|
69
|
+
"verifyContactButton": "Verify",
|
|
70
|
+
"saveButton": "Save Changes",
|
|
71
|
+
"successMessage": "Your changes have been saved!",
|
|
72
|
+
"errorMessageUpdate": "An error has occured when attempting to update the contacts information",
|
|
73
|
+
"errorMessageFetch": "An error has occured when attempting to fetch the contacts information"
|
|
74
|
+
},
|
|
75
|
+
"zh-hk": {
|
|
76
|
+
"title": "聯絡人",
|
|
77
|
+
"email": "電子郵件",
|
|
78
|
+
"phoneNumber": "電話號碼",
|
|
79
|
+
"phoneNumberError": "電話號碼必須至少5位數字,最多15位數字",
|
|
80
|
+
"verifyContactButton": "驗證",
|
|
81
|
+
"saveButton": "保存更改",
|
|
82
|
+
"successMessage": "您的更改已保存!",
|
|
83
|
+
"errorMessageUpdate": "嘗試更新聯絡人信息時發生錯誤",
|
|
84
|
+
"errorMessageFetch": "在嘗試獲取聯絡人信息時發生錯誤"
|
|
85
|
+
},
|
|
86
|
+
"fr": {
|
|
87
|
+
"title": "Contacts",
|
|
88
|
+
"email": "Email",
|
|
89
|
+
"phoneNumber": "Numéro de téléphone",
|
|
90
|
+
"phoneNumberError": "Le numéro de téléphone doit comporter au moins 5 chiffres et au maximum 15 chiffres",
|
|
91
|
+
"verifyContactButton": "Vérifier",
|
|
92
|
+
"saveButton": "Enregistrer les modifications",
|
|
93
|
+
"successMessage": "Vos modifications ont été enregistrées !",
|
|
94
|
+
"errorMessageUpdate": "Une erreur s'est produite lors de la tentative de mise à jour des informations de contact",
|
|
95
|
+
"errorMessageFetch": "Une erreur est survenue lors de la tentative de récupération des informations de contact"
|
|
96
|
+
},
|
|
97
|
+
"ro": {
|
|
98
|
+
"title": "Contacte",
|
|
99
|
+
"email": "Email",
|
|
100
|
+
"phoneNumber": "Număr de telefon",
|
|
101
|
+
"phoneNumberError": "Numărul de telefon trebuie să aibă cel puțin 5 cifre și maximum 15 cifre",
|
|
102
|
+
"verifyContactButton": "Verifică",
|
|
103
|
+
"saveButton": "Salvează modificările",
|
|
104
|
+
"successMessage": "Modificările dvs. au fost salvate!",
|
|
105
|
+
"errorMessageUpdate": "A apărut o eroare la încercarea de a actualiza informațiile de contact",
|
|
106
|
+
"errorMessageFetch": "A apărut o eroare la încercarea de a obține informațiile de contact"
|
|
107
|
+
},
|
|
108
|
+
"tr": {
|
|
109
|
+
"title": "Kişiler",
|
|
110
|
+
"email": "E-posta",
|
|
111
|
+
"phoneNumber": "Telefon Numarası",
|
|
112
|
+
"phoneNumberError": "Telefon numarası en az 5 haneli ve en fazla 15 haneli olmalıdır",
|
|
113
|
+
"verifyContactButton": "Doğrula",
|
|
114
|
+
"saveButton": "Değişiklikleri Kaydet",
|
|
115
|
+
"successMessage": "Değişiklikleriniz kaydedildi!",
|
|
116
|
+
"errorMessageUpdate": "Kişi bilgilerini güncellemeye çalışırken bir hata oluştu",
|
|
117
|
+
"errorMessageFetch": "İletişim bilgilerini almak için yapılan işlemde bir hata oluştu"
|
|
118
|
+
},
|
|
119
|
+
"es": {
|
|
120
|
+
"title": "Contactos",
|
|
121
|
+
"email": "Correo electrónico",
|
|
122
|
+
"phoneNumber": "Número de teléfono",
|
|
123
|
+
"phoneNumberError": "El número de teléfono debe tener al menos 5 dígitos y un máximo de 15 dígitos",
|
|
124
|
+
"verifyContactButton": "Verificar",
|
|
125
|
+
"saveButton": "Guardar cambios",
|
|
126
|
+
"successMessage": "¡Tus cambios han sido guardados!",
|
|
127
|
+
"errorMessageUpdate": "Se ha producido un error al intentar actualizar la información de contactos",
|
|
128
|
+
"errorMessageFetch": "Se ha producido un error al intentar obtener la información de los contactos"
|
|
129
|
+
},
|
|
130
|
+
"pt": {
|
|
131
|
+
"title": "Contatos",
|
|
132
|
+
"email": "Email",
|
|
133
|
+
"phoneNumber": "Número de telefone",
|
|
134
|
+
"phoneNumberError": "O número de telefone deve ter pelo menos 5 dígitos e no máximo 15 dígitos",
|
|
135
|
+
"verifyContactButton": "Verificar",
|
|
136
|
+
"saveButton": "Salvar alterações",
|
|
137
|
+
"successMessage": "Suas alterações foram salvas!",
|
|
138
|
+
"errorMessageUpdate": "Ocorreu um erro ao tentar atualizar as informações de contato",
|
|
139
|
+
"errorMessageFetch": "Ocorreu um erro ao tentar buscar as informações de contato"
|
|
140
|
+
},
|
|
141
|
+
"hr": {
|
|
142
|
+
"title": "Kontakti",
|
|
143
|
+
"email": "Email",
|
|
144
|
+
"phoneNumber": "Broj telefona",
|
|
145
|
+
"phoneNumberError": "Broj telefona mora imati najmanje 5 znamenki i najviše 15 znamenki",
|
|
146
|
+
"verifyContactButton": "Provjeri",
|
|
147
|
+
"saveButton": "Spremi promjene",
|
|
148
|
+
"successMessage": "Vaše promjene su spremljene!",
|
|
149
|
+
"errorMessageUpdate": "Došlo je do pogreške prilikom pokušaja ažuriranja informacija o kontaktima",
|
|
150
|
+
"errorMessageFetch": "Došlo je do greške prilikom pokušaja dobijanja informacija o kontaktima"
|
|
151
|
+
},
|
|
152
|
+
"pt-br": {
|
|
153
|
+
"title": "Contatos",
|
|
154
|
+
"email": "Email",
|
|
155
|
+
"phoneNumber": "Número de telefone",
|
|
156
|
+
"phoneNumberError": "O número de telefone deve ter pelo menos 5 dígitos e no máximo 15 dígitos",
|
|
157
|
+
"verifyContactButton": "Verificar",
|
|
158
|
+
"saveButton": "Salvar alterações",
|
|
159
|
+
"successMessage": "Suas alterações foram salvas!",
|
|
160
|
+
"errorMessageUpdate": "Ocorreu um erro ao tentar atualizar as informações de contato",
|
|
161
|
+
"errorMessageFetch": "Ocorreu um erro ao tentar buscar as informações de contato"
|
|
162
|
+
},
|
|
163
|
+
"es-mx": {
|
|
164
|
+
"title": "Contactos",
|
|
165
|
+
"email": "Correo electrónico",
|
|
166
|
+
"phoneNumber": "Número de teléfono",
|
|
167
|
+
"phoneNumberError": "El número de teléfono debe tener al menos 5 dígitos y un máximo de 15 dígitos",
|
|
168
|
+
"verifyContactButton": "Verificar",
|
|
169
|
+
"saveButton": "Guardar cambios",
|
|
170
|
+
"successMessage": "¡Tus cambios han sido guardados!",
|
|
171
|
+
"errorMessageUpdate": "Se ha producido un error al intentar actualizar la información de contactos",
|
|
172
|
+
"errorMessageFetch": "Se ha producido un error al intentar obtener la información de los contactos"
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
const translate = (key, customLang, values) => {
|
|
176
|
+
let lang = TRANSLATIONS[customLang] ? customLang : DEFAULT_LANGUAGE;
|
|
177
|
+
let translation = TRANSLATIONS[lang][key];
|
|
178
|
+
if (values !== undefined) {
|
|
179
|
+
for (const [key, value] of Object.entries(values.values)) {
|
|
180
|
+
const regex = new RegExp(`{${key}}`, 'g');
|
|
181
|
+
translation = translation.replace(regex, value);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return translation;
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* @name isMobile
|
|
189
|
+
* @description A method that returns if the browser used to access the app is from a mobile device or not
|
|
190
|
+
* @param {String} userAgent window.navigator.userAgent
|
|
191
|
+
* @returns {Boolean} true or false
|
|
192
|
+
*/
|
|
193
|
+
const isMobile = (userAgent) => {
|
|
194
|
+
return !!(userAgent.toLowerCase().match(/android/i) ||
|
|
195
|
+
userAgent.toLowerCase().match(/blackberry|bb/i) ||
|
|
196
|
+
userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
|
|
197
|
+
userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
const pamPlayerContactsCss = ":host {\n display: block;\n}\n\nbutton {\n font-family: var(--emw--button-typography);\n}\n\ninput, select, option {\n font-family: inherit;\n}\n\n.errorContainer {\n font-family: \"Roboto\";\n font-style: normal;\n font-family: sans-serif;\n display: flex;\n flex-direction: column;\n gap: 24px;\n width: 100%;\n height: 100%;\n}\n.errorContainer .errorMessage {\n color: var(--emw--color-error, var(--emw--color-red, #ed0909));\n font-size: var(--emw-font-size-small, 13px);\n display: block;\n justify-content: center;\n text-align: center;\n}\n\n.PlayerContactsWrapper {\n color: var(--emw--pam-typography, var(--emw-color-contrast, #07072A));\n background: var(--emw-color-pale, var(--emw--color-gray-50, #F1F1F1));\n padding: 50px;\n height: 100%;\n border-radius: var(--emw--border-radius-large, 10px);\n container-type: inline-size;\n opacity: 1;\n animation-name: fadeIn;\n animation-iteration-count: 1;\n animation-timing-function: ease-in;\n animation-duration: 0.3s;\n}\n.PlayerContactsWrapper .ReturnButton {\n display: none;\n}\n.PlayerContactsWrapper .HeaderText {\n font-size: var(--emw--font-size-x-large, 24px);\n color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n text-transform: capitalize;\n font-weight: var(--emw--font-weight-semibold, 500);\n}\n.PlayerContactsWrapper .Section {\n background: var(--emw-color-pale, var(--emw--color-gray-100, #E6E6E6));\n border-radius: var(--emw--border-radius-large, 10px);\n padding: 10px;\n margin-bottom: 10px;\n}\n.PlayerContactsWrapper .Section .SectionTitle {\n font-size: var(--emw--font-size-large, 20px);\n color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n text-transform: capitalize;\n font-weight: var(--emw--font-weight-semibold, 500);\n padding: 0;\n border: 0;\n margin-top: 10px;\n margin-bottom: 10px;\n background: transparent;\n cursor: pointer;\n}\n.PlayerContactsWrapper .Section .SectionContent {\n display: grid;\n column-gap: 50px;\n row-gap: 25px;\n grid-template-rows: auto;\n grid-template-columns: 1fr 1fr;\n padding-bottom: 30px;\n margin-top: 10px;\n}\n.PlayerContactsWrapper .Section .SectionContent .Field {\n width: 100%;\n display: flex;\n flex-direction: column;\n /* Chrome, Safari, Edge, Opera */\n /* Firefox */\n}\n.PlayerContactsWrapper .Section .SectionContent .Field label {\n font-size: var(--emw--size-small, 14px);\n font-weight: var(--emw--font-weight-semibold, 500);\n margin-bottom: 5px;\n}\n.PlayerContactsWrapper .Section .SectionContent .Field input {\n font-size: var(--emw--size-small, 14px);\n font-weight: var(--emw--font-weight-light, 300);\n color: var(--emw--pam-contrast, var(--emw-color-contrast, #07072A));\n padding: 10px;\n line-height: 16px;\n background: var(--emw-color-white, #FFFFFF);\n outline: none;\n transition-duration: var(--emw--transition-medium, 250ms);\n border: 1px solid var(--emw--color-gray-100, #353535);\n border-radius: var(--emw--border-radius-medium, 10px);\n width: 100%;\n box-sizing: border-box;\n}\n.PlayerContactsWrapper .Section .SectionContent .Field input:focus, .PlayerContactsWrapper .Section .SectionContent .Field input :focus-within, .PlayerContactsWrapper .Section .SectionContent .Field input :focus-visible, .PlayerContactsWrapper .Section .SectionContent .Field input :visited {\n border: 1px solid var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n box-shadow: 0 0 0 1pt var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n}\n.PlayerContactsWrapper .Section .SectionContent .Field input::-webkit-outer-spin-button,\n.PlayerContactsWrapper .Section .SectionContent .Field input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n.PlayerContactsWrapper .Section .SectionContent .Field input[type=number] {\n -moz-appearance: textfield;\n appearance: textfield;\n}\n.PlayerContactsWrapper .Section .SectionContent .Field div {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 16px;\n}\n.PlayerContactsWrapper .Section .SectionContent .Field div input {\n min-width: fit-content;\n width: 100%;\n}\n.PlayerContactsWrapper .Section .SectionContent .Field div button {\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n cursor: pointer;\n background-image: linear-gradient(to bottom, color-mix(in srgb, var(--emw--color-primary, #22B04E) 80%, black 20%), var(--emw--color-primary, #22B04E), color-mix(in srgb, var(--emw--color-primary, #22B04E) 80%, white 30%));\n border: 2px solid var(--emw--button-border-color, #0E5924);\n color: var(--emw--button-text-color, #FFFFFF);\n border-radius: var(--emw--button-border-radius, 10px);\n font-size: var(--emw--font-size-x-small, 12px);\n font-weight: var(--emw--font-weight-semibold, 500);\n text-transform: uppercase;\n transition-duration: var(--emw--transition-medium, 250ms);\n max-width: 100px;\n min-width: 30px;\n width: 100%;\n height: 100%;\n}\n.PlayerContactsWrapper .Section .SectionContent .Field div button:active {\n background: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n}\n.PlayerContactsWrapper .Section .SectionContent .Field.Invalid input {\n border: 1px solid var(--emw-color-error, var(--emw-color-red, #FD2839));\n background: var(--emw-color-pale, #FBECF4);\n color: var(--emw-color-error, var(--emw-color-red, #FD2839));\n}\n.PlayerContactsWrapper .Section .SectionContent .Field .Error {\n color: var(--emw-color-error, var(--emw-color-red, #FD2839));\n font-size: var(--emw--font-size-x-small, 12px);\n line-height: 10px;\n}\n.PlayerContactsWrapper .Section .SectionContent .Field.Disabled input {\n opacity: 0.5;\n}\n.PlayerContactsWrapper .Section .SectionContent .CompoundField {\n width: 100%;\n display: flex;\n gap: 10px;\n flex-direction: row;\n}\n.PlayerContactsWrapper .Section .VerifiedCheckmark {\n fill: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n stroke: #27a305;\n stroke-width: 5;\n}\n.PlayerContactsWrapper .ButtonsArea {\n grid-column-gap: 10px;\n grid-template-rows: auto;\n grid-template-columns: 1fr;\n margin-top: 20px;\n width: 50%;\n}\n.PlayerContactsWrapper .ButtonsArea .SaveButton {\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n cursor: pointer;\n background-image: linear-gradient(to bottom, color-mix(in srgb, var(--emw--color-primary, #22B04E) 80%, black 20%), var(--emw--color-primary, #22B04E), color-mix(in srgb, var(--emw--color-primary, #22B04E) 80%, white 30%));\n border: 2px solid var(--emw--button-border-color, #0E5924);\n color: var(--emw--button-text-color, #FFFFFF);\n border-radius: var(--emw--button-border-radius, 10px);\n font-size: var(--emw--size-standard, 16px);\n text-transform: uppercase;\n transition-duration: var(--emw--transition-medium, 250ms);\n max-width: 400px;\n min-width: 200px;\n padding: 13px 0;\n width: 100%;\n}\n.PlayerContactsWrapper .ButtonsArea .SaveButton:active {\n background: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n}\n.PlayerContactsWrapper .ButtonsArea .SaveButton.Disabled {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.PlayerContactsWrapper.skeleton .ReturnButton {\n display: block;\n width: 200px;\n margin-top: 15px;\n margin-bottom: 20px;\n}\n.PlayerContactsWrapper.skeleton .Section .SectionContent {\n max-height: 100%;\n overflow: hidden;\n}\n.PlayerContactsWrapper.skeleton .Section .SectionContent .Field {\n height: 60px;\n overflow: hidden;\n}\n.PlayerContactsWrapper.skeleton .ButtonsArea .SaveButton {\n width: 500px;\n border-radius: 30px;\n overflow: hidden;\n display: block;\n background-image: none;\n border: none;\n}\n@container (max-width: 425px) {\n .PlayerContactsWrapper {\n padding: 20px 15px;\n background: var(--emw-color-gray-50, #F9F8F8);\n max-width: unset;\n border-radius: var(--emw--border-radius-small, 5px);\n }\n .PlayerContactsWrapper .ReturnButton {\n color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n display: inline-flex;\n align-items: center;\n column-gap: 10px;\n margin-bottom: 10px;\n }\n .PlayerContactsWrapper .ReturnButton svg {\n fill: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n }\n .PlayerContactsWrapper .HeaderText {\n display: none;\n }\n .PlayerContactsWrapper h2 {\n color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n font-size: var(--emw--font-size-large, 20px);\n font-weight: var(--emw--font-weight-semibold, 500);\n }\n .PlayerContactsWrapper .Section .SectionContent {\n row-gap: 15px;\n grid-template-columns: 1fr;\n }\n .PlayerContactsWrapper .Section .SectionTitle {\n margin-top: 5px;\n margin-bottom: 5px;\n font-size: var(--emw--font-size-medium, 16px);\n }\n .PlayerContactsWrapper .Section .Field label {\n color: var(--emw-color-gray-300, #58586B);\n font-size: var(--emw--size-x-small, 12px);\n font-weight: var(-emw--font-weight-normal, 400);\n }\n .PlayerContactsWrapper .Section .Field input {\n color: var(--emw-color-gray-300, #58586B);\n font-size: var(--emw--size-x-small, 12px);\n font-weight: var(--emw--font-weight-light, 300);\n }\n .PlayerContactsWrapper .Section .CompoundField {\n width: 100%;\n display: flex;\n gap: 10px;\n flex-direction: row;\n }\n .PlayerContactsWrapper .ButtonsArea {\n grid-column-gap: 10px;\n width: 100%;\n grid-template-columns: 1fr 1fr;\n }\n .PlayerContactsWrapper .ButtonsArea .SaveButton {\n font-size: var(--emw--size-x-small, 12px);\n height: 40px;\n color: var(--emw-button-typography, var(--emw-color-white, #FFFFFF));\n }\n .PlayerContactsWrapper .ButtonsArea .SaveButton.Disabled {\n color: var(--emw-color-gray-300, #58586B);\n }\n .PlayerContactsWrapper.skeleton .Section .SectionContent {\n display: block;\n }\n .PlayerContactsWrapper.skeleton .Section .SectionContent .Field {\n margin-bottom: 15px;\n }\n .PlayerContactsWrapper.skeleton .ButtonsArea .SaveButton {\n width: 100%;\n height: 100%;\n border-radius: 20px;\n }\n}\n\n@keyframes fadeIn {\n 0% {\n opacity: 0.01;\n }\n 1% {\n opacity: 0;\n }\n 50% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}";
|
|
201
|
+
const PamPlayerContactsStyle0 = pamPlayerContactsCss;
|
|
202
|
+
|
|
203
|
+
const PamPlayerContacts = class {
|
|
204
|
+
constructor(hostRef) {
|
|
205
|
+
index.registerInstance(this, hostRef);
|
|
206
|
+
this.dataRef = {};
|
|
207
|
+
this.fieldsState = {};
|
|
208
|
+
this.sendLoadedMessage = () => {
|
|
209
|
+
window.postMessage({ type: 'CONTACTS_LOADED' });
|
|
210
|
+
};
|
|
211
|
+
this.sendValidMessage = () => {
|
|
212
|
+
window.postMessage({ type: 'CONTACTS_VALIDITY', data: this.isSubmitButtonAvailable });
|
|
213
|
+
};
|
|
214
|
+
this.sendContactVerificationRequest = (contactType) => (e) => {
|
|
215
|
+
e.preventDefault();
|
|
216
|
+
window.postMessage({ type: 'ContactVerification', contactType });
|
|
217
|
+
};
|
|
218
|
+
this.sendSuccessNotification = () => {
|
|
219
|
+
window.postMessage({ type: 'WidgetNotification', data: { type: 'success', message: translate('successMessage', this.lang) } }, window.location.href);
|
|
220
|
+
};
|
|
221
|
+
this.sendErrorNotification = (errorKey) => {
|
|
222
|
+
window.postMessage({ type: 'WidgetNotification', data: { type: 'error', message: translate(errorKey, this.lang) } }, window.location.href);
|
|
223
|
+
};
|
|
224
|
+
this.sendData = () => {
|
|
225
|
+
window.postMessage({ type: 'CONTACTS_UPDATE_DATA', data: this.data }, window.location.href);
|
|
226
|
+
};
|
|
227
|
+
this.messageHandler = (message) => {
|
|
228
|
+
var _a;
|
|
229
|
+
switch ((_a = message.data) === null || _a === void 0 ? void 0 : _a.type) {
|
|
230
|
+
case 'CONTACTS_DATA':
|
|
231
|
+
this.data = message.data.data;
|
|
232
|
+
this.resetState();
|
|
233
|
+
this.isSkeletonLoading = false;
|
|
234
|
+
break;
|
|
235
|
+
case 'CONTACTS_SEND_DATA':
|
|
236
|
+
this.sendData();
|
|
237
|
+
break;
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
/**
|
|
241
|
+
* Promise for fetching the response and returning the response or the erorr message
|
|
242
|
+
* @param res - response from the API
|
|
243
|
+
*/
|
|
244
|
+
this.handleFetchResponse = async (res) => {
|
|
245
|
+
var _a;
|
|
246
|
+
if (res.status >= 300) {
|
|
247
|
+
this.isError = true;
|
|
248
|
+
let response = await res.json();
|
|
249
|
+
this.errorCode = (_a = response.thirdPartyResponse) === null || _a === void 0 ? void 0 : _a.errorCode;
|
|
250
|
+
this.errorMessage = this.errorCode ? translate(this.errorCode, this.lang) : translate('errorMessageFetch', this.lang);
|
|
251
|
+
window.postMessage({
|
|
252
|
+
type: 'WidgetNotification',
|
|
253
|
+
data: {
|
|
254
|
+
type: 'error',
|
|
255
|
+
message: this.errorMessage
|
|
256
|
+
}
|
|
257
|
+
}, window.location.href);
|
|
258
|
+
return Promise.reject(this.errorMessage);
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
this.isError = false;
|
|
262
|
+
if (res.headers.get('content-type')) {
|
|
263
|
+
let response = await res.json();
|
|
264
|
+
return Promise.resolve(response);
|
|
265
|
+
}
|
|
266
|
+
return Promise.resolve();
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
this.getData = () => {
|
|
270
|
+
const url = new URL(`/api/v1/players/${this.userId}/player-identifiable-information/contacts/`, this.endpoint);
|
|
271
|
+
const headers = new Headers();
|
|
272
|
+
headers.append('X-SessionID', this.session);
|
|
273
|
+
const options = {
|
|
274
|
+
method: 'GET',
|
|
275
|
+
headers: headers
|
|
276
|
+
};
|
|
277
|
+
return new Promise((resolve, reject) => {
|
|
278
|
+
fetch(url.href, options)
|
|
279
|
+
.then((res) => this.handleFetchResponse(res))
|
|
280
|
+
.then(res => {
|
|
281
|
+
this.data = res;
|
|
282
|
+
resolve();
|
|
283
|
+
})
|
|
284
|
+
.catch((error) => {
|
|
285
|
+
console.log(error);
|
|
286
|
+
reject();
|
|
287
|
+
});
|
|
288
|
+
});
|
|
289
|
+
};
|
|
290
|
+
this.buildFieldState = (isValid, initialValue, rule) => Object.assign({ 'isValid': isValid, 'initialValue': initialValue, 'rule': rule });
|
|
291
|
+
this.resetState = () => {
|
|
292
|
+
this.initData();
|
|
293
|
+
this.initEditableFieldsState();
|
|
294
|
+
this.invalidFields = 0;
|
|
295
|
+
this.isSubmitButtonAvailable = false;
|
|
296
|
+
};
|
|
297
|
+
this.updateState = (fieldKey) => (e) => {
|
|
298
|
+
this.dataRef[fieldKey].contactValue = e.target.value;
|
|
299
|
+
const fieldState = this.fieldsState[fieldKey]['data'].contactValue;
|
|
300
|
+
const value = e.target.value;
|
|
301
|
+
const passedRuleCheck = fieldState.rule(value);
|
|
302
|
+
if (passedRuleCheck && !fieldState.isValid) {
|
|
303
|
+
fieldState.isValid = true;
|
|
304
|
+
this.invalidFields -= 1;
|
|
305
|
+
}
|
|
306
|
+
else if (!passedRuleCheck && fieldState.isValid) {
|
|
307
|
+
fieldState.isValid = false;
|
|
308
|
+
this.invalidFields += 1;
|
|
309
|
+
}
|
|
310
|
+
this.fieldsState[fieldKey]['hasChanged'] = value !== fieldState.initialValue;
|
|
311
|
+
const previous = this.isSubmitButtonAvailable;
|
|
312
|
+
this.updateSubmitButtonStatus();
|
|
313
|
+
if (this.isStandAlone !== 'true' && this.isSubmitButtonAvailable !== previous) {
|
|
314
|
+
this.sendValidMessage();
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
this.updateData = (e) => {
|
|
318
|
+
if (e)
|
|
319
|
+
e.preventDefault();
|
|
320
|
+
const promises = [];
|
|
321
|
+
for (const contactType of Object.keys(this.fieldsState)) {
|
|
322
|
+
if (!this.fieldsState[contactType]['hasChanged'])
|
|
323
|
+
continue;
|
|
324
|
+
const contact = this.dataRef[contactType];
|
|
325
|
+
const url = new URL(`/api/v1/players/${this.userId}/player-identifiable-information/contacts/${contact['contactId']}/`, this.endpoint);
|
|
326
|
+
const headers = new Headers();
|
|
327
|
+
headers.append('X-SessionId', this.session);
|
|
328
|
+
headers.append('Content-Type', 'application/json-patch+json');
|
|
329
|
+
const reqParams = {
|
|
330
|
+
method: 'PUT',
|
|
331
|
+
headers,
|
|
332
|
+
body: JSON.stringify(contact)
|
|
333
|
+
};
|
|
334
|
+
promises.push(fetch(url, reqParams));
|
|
335
|
+
}
|
|
336
|
+
Promise.all(promises)
|
|
337
|
+
.then(resArr => {
|
|
338
|
+
if (resArr.some(res => !res.ok)) {
|
|
339
|
+
return this.sendErrorNotification('errorMessageUpdate');
|
|
340
|
+
}
|
|
341
|
+
this.sendSuccessNotification();
|
|
342
|
+
this.getData().then(() => this.resetState());
|
|
343
|
+
});
|
|
344
|
+
};
|
|
345
|
+
this.updateSubmitButtonStatus = () => {
|
|
346
|
+
this.isSubmitButtonAvailable = this.invalidFields === 0 && Object.values(this.fieldsState).some(v => v.hasChanged);
|
|
347
|
+
};
|
|
348
|
+
this.editableField = (fieldKey, labelTranslationKey, errorTranslationKey) => {
|
|
349
|
+
const fieldState = this.fieldsState[fieldKey]['data'].contactValue;
|
|
350
|
+
const value = this.dataRef[fieldKey];
|
|
351
|
+
if (fieldState) {
|
|
352
|
+
return (index.h("div", { class: `Field ${fieldState.isValid ? '' : 'Invalid'}` }, index.h("label", null, translate(labelTranslationKey, this.lang)), this.isVerificationStatusDisplayed === 'true'
|
|
353
|
+
? index.h("div", null, index.h("input", { type: "text", value: value.contactValue, onKeyUp: this.updateState(fieldKey) }), value.isVerified
|
|
354
|
+
? index.h("svg", { class: "VerifiedCheckmark", xmlns: "http://www.w3.org/2000/svg", version: "1.1", id: "Capa_1", width: "40px", height: "40px", viewBox: "-53.65 -53.65 643.84 643.84", transform: "matrix(1, 0, 0, 1, 0, 0)rotate(0)" }, index.h("g", { id: "SVGRepo_bgCarrier", "stroke-width": "0" }), index.h("g", { id: "SVGRepo_tracerCarrier", "stroke-linecap": "round", "stroke-linejoin": "round", stroke: "#CCCCCC", "stroke-width": "1.073082" }), index.h("g", { id: "SVGRepo_iconCarrier" }, " ", index.h("g", null, " ", index.h("g", null, " ", index.h("path", { d: "M496.785,152.779c-3.305-25.085-16.549-51.934-38.826-74.205c-22.264-22.265-49.107-35.508-74.186-38.813 c-11.348-1.499-26.5-7.766-35.582-14.737C328.111,9.626,299.764,0,268.27,0s-59.841,9.626-79.921,25.024 c-9.082,6.965-24.235,13.238-35.582,14.737c-25.08,3.305-51.922,16.549-74.187,38.813c-22.277,22.271-35.521,49.119-38.825,74.205 c-1.493,11.347-7.766,26.494-14.731,35.57C9.621,208.422,0,236.776,0,268.27s9.621,59.847,25.024,79.921 c6.971,9.082,13.238,24.223,14.731,35.568c3.305,25.086,16.548,51.936,38.825,74.205c22.265,22.266,49.107,35.51,74.187,38.814 c11.347,1.498,26.5,7.771,35.582,14.736c20.073,15.398,48.421,25.025,79.921,25.025s59.841-9.627,79.921-25.025 c9.082-6.965,24.234-13.238,35.582-14.736c25.078-3.305,51.922-16.549,74.186-38.814c22.277-22.27,35.521-49.119,38.826-74.205 c1.492-11.346,7.766-26.492,14.73-35.568c15.404-20.074,25.025-48.422,25.025-79.921c0-31.494-9.621-59.848-25.025-79.921 C504.545,179.273,498.277,164.126,496.785,152.779z M439.256,180.43L246.477,373.209l-30.845,30.846 c-8.519,8.52-22.326,8.52-30.845,0l-30.845-30.846l-56.665-56.658c-8.519-8.52-8.519-22.326,0-30.846l30.845-30.844 c8.519-8.519,22.326-8.519,30.845,0l41.237,41.236L377.561,118.74c8.52-8.519,22.326-8.519,30.846,0l30.844,30.845 C447.775,158.104,447.775,171.917,439.256,180.43z" }), " "), " "), " "))
|
|
355
|
+
: index.h("button", { onClick: this.sendContactVerificationRequest(fieldKey) }, translate('verifyContactButton')))
|
|
356
|
+
: index.h("input", { type: "text", value: value.contactValue, onKeyUp: this.updateState(fieldKey) }), !fieldState.isValid &&
|
|
357
|
+
index.h("p", { class: "Error" }, translate(errorTranslationKey, this.lang))));
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
return null;
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
this.staticField = (fieldKey, labelTranslationKey) => {
|
|
364
|
+
const value = this.dataRef[fieldKey];
|
|
365
|
+
if (value && value.contactValue) {
|
|
366
|
+
return (index.h("div", { class: "Field Disabled" }, index.h("label", null, translate(labelTranslationKey, this.lang)), this.isVerificationStatusDisplayed === 'true'
|
|
367
|
+
? index.h("div", null, index.h("input", { type: "text", value: value.contactValue, readonly: true }), value.isVerified
|
|
368
|
+
? index.h("svg", { class: "VerifiedCheckmark", xmlns: "http://www.w3.org/2000/svg", version: "1.1", id: "Capa_1", width: "40px", height: "40px", viewBox: "-53.65 -53.65 643.84 643.84", transform: "matrix(1, 0, 0, 1, 0, 0)rotate(0)" }, index.h("g", { id: "SVGRepo_bgCarrier", "stroke-width": "0" }), index.h("g", { id: "SVGRepo_tracerCarrier", "stroke-linecap": "round", "stroke-linejoin": "round", stroke: "#CCCCCC", "stroke-width": "1.073082" }), index.h("g", { id: "SVGRepo_iconCarrier" }, " ", index.h("g", null, " ", index.h("g", null, " ", index.h("path", { d: "M496.785,152.779c-3.305-25.085-16.549-51.934-38.826-74.205c-22.264-22.265-49.107-35.508-74.186-38.813 c-11.348-1.499-26.5-7.766-35.582-14.737C328.111,9.626,299.764,0,268.27,0s-59.841,9.626-79.921,25.024 c-9.082,6.965-24.235,13.238-35.582,14.737c-25.08,3.305-51.922,16.549-74.187,38.813c-22.277,22.271-35.521,49.119-38.825,74.205 c-1.493,11.347-7.766,26.494-14.731,35.57C9.621,208.422,0,236.776,0,268.27s9.621,59.847,25.024,79.921 c6.971,9.082,13.238,24.223,14.731,35.568c3.305,25.086,16.548,51.936,38.825,74.205c22.265,22.266,49.107,35.51,74.187,38.814 c11.347,1.498,26.5,7.771,35.582,14.736c20.073,15.398,48.421,25.025,79.921,25.025s59.841-9.627,79.921-25.025 c9.082-6.965,24.234-13.238,35.582-14.736c25.078-3.305,51.922-16.549,74.186-38.814c22.277-22.27,35.521-49.119,38.826-74.205 c1.492-11.346,7.766-26.492,14.73-35.568c15.404-20.074,25.025-48.422,25.025-79.921c0-31.494-9.621-59.848-25.025-79.921 C504.545,179.273,498.277,164.126,496.785,152.779z M439.256,180.43L246.477,373.209l-30.845,30.846 c-8.519,8.52-22.326,8.52-30.845,0l-30.845-30.846l-56.665-56.658c-8.519-8.52-8.519-22.326,0-30.846l30.845-30.844 c8.519-8.519,22.326-8.519,30.845,0l41.237,41.236L377.561,118.74c8.52-8.519,22.326-8.519,30.846,0l30.844,30.845 C447.775,158.104,447.775,171.917,439.256,180.43z" }), " "), " "), " "))
|
|
369
|
+
: index.h("button", { onClick: this.sendContactVerificationRequest(fieldKey) }, translate('verifyContactButton')))
|
|
370
|
+
: index.h("input", { type: "text", value: value.contactValue, readonly: true })));
|
|
371
|
+
}
|
|
372
|
+
else {
|
|
373
|
+
return null;
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
this.toggleScreen = () => {
|
|
377
|
+
window.postMessage({ type: 'PlayerAccountMenuActive', isMobile: this.isMobile }, window.location.href);
|
|
378
|
+
};
|
|
379
|
+
this.userId = undefined;
|
|
380
|
+
this.session = undefined;
|
|
381
|
+
this.endpoint = undefined;
|
|
382
|
+
this.lang = 'en';
|
|
383
|
+
this.mbSource = undefined;
|
|
384
|
+
this.clientStyling = undefined;
|
|
385
|
+
this.clientStylingUrl = undefined;
|
|
386
|
+
this.translationUrl = undefined;
|
|
387
|
+
this.isVerificationStatusDisplayed = 'false';
|
|
388
|
+
this.isPhoneNumberEditable = 'true';
|
|
389
|
+
this.isStandAlone = 'true';
|
|
390
|
+
this.limitStylingAppends = false;
|
|
391
|
+
this.isSkeletonLoading = true;
|
|
392
|
+
this.isSubmitButtonAvailable = false;
|
|
393
|
+
this.invalidFields = 0;
|
|
394
|
+
this.isMobile = isMobile(window.navigator.userAgent);
|
|
395
|
+
this.isError = false;
|
|
396
|
+
this.errorMessage = '';
|
|
397
|
+
this.errorCode = '';
|
|
398
|
+
}
|
|
399
|
+
handleStylingChange(newValue, oldValue) {
|
|
400
|
+
if (newValue !== oldValue)
|
|
401
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
402
|
+
}
|
|
403
|
+
handleStylingUrlChange(newValue, oldValue) {
|
|
404
|
+
if (newValue !== oldValue)
|
|
405
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
406
|
+
}
|
|
407
|
+
async componentWillLoad() {
|
|
408
|
+
if (this.isStandAlone !== 'true') {
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
await this.getData()
|
|
412
|
+
.then(() => {
|
|
413
|
+
this.initData();
|
|
414
|
+
this.initEditableFieldsState();
|
|
415
|
+
})
|
|
416
|
+
.finally(() => this.isSkeletonLoading = false);
|
|
417
|
+
}
|
|
418
|
+
componentDidLoad() {
|
|
419
|
+
if (this.stylingContainer) {
|
|
420
|
+
if (window.emMessageBuss != undefined) {
|
|
421
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
422
|
+
}
|
|
423
|
+
else {
|
|
424
|
+
if (this.clientStyling)
|
|
425
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
426
|
+
if (this.clientStylingUrl)
|
|
427
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
if (this.isStandAlone !== 'true') {
|
|
431
|
+
window.addEventListener('message', this.messageHandler, false);
|
|
432
|
+
this.sendLoadedMessage();
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
disconnectedCallback() {
|
|
436
|
+
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
437
|
+
if (this.isStandAlone !== 'true')
|
|
438
|
+
window.removeEventListener('message', this.messageHandler, false);
|
|
439
|
+
}
|
|
440
|
+
initData() {
|
|
441
|
+
for (const contact of this.data.contacts) {
|
|
442
|
+
this.dataRef[contact.contactType] = contact;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
initEditableFieldsState() {
|
|
446
|
+
if (this.dataRef['PhoneNumber'] && this.isPhoneNumberEditable === 'true') {
|
|
447
|
+
this.fieldsState['PhoneNumber'] = {};
|
|
448
|
+
this.fieldsState['PhoneNumber']['hasChanged'] = false;
|
|
449
|
+
this.fieldsState['PhoneNumber']['data'] = {};
|
|
450
|
+
this.fieldsState['PhoneNumber']['data']['contactValue'] = this.buildFieldState(true, this.dataRef['PhoneNumber'].contactValue, (val) => val && val.length >= 5 && val.length <= 15 && !Number.isNaN(Number(val)));
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
render() {
|
|
454
|
+
if (!this.isSkeletonLoading && this.isError) {
|
|
455
|
+
return (index.h("div", { class: "errorContainer" }, index.h("p", { class: "errorMessage", innerHTML: this.errorMessage })));
|
|
456
|
+
}
|
|
457
|
+
return (index.h("div", { ref: el => this.stylingContainer = el }, this.isSkeletonLoading
|
|
458
|
+
? index.h("form", { class: "PlayerContactsWrapper skeleton" }, index.h("div", { class: "ReturnButton" }, index.h("ui-skeleton", { structure: "title", width: "auto", height: "30px" })), index.h("div", { class: "Section" }, index.h("section", { class: "SectionContent" }, index.h("div", { class: "Field" }, index.h("ui-skeleton", { structure: "text", width: "auto", "margin-bottom": "10px", height: "10px" }), index.h("ui-skeleton", { structure: "title", width: "100%", height: "40px" })), index.h("div", { class: "Field" }, index.h("ui-skeleton", { structure: "text", width: "auto", "margin-bottom": "10px", height: "10px" }), index.h("ui-skeleton", { structure: "title", width: "100%", height: "40px" })))), index.h("section", { class: "ButtonsArea" }, index.h("div", { class: "SaveButton" }, index.h("ui-skeleton", { structure: "rectangle", width: "auto", height: "40px" }))))
|
|
459
|
+
: index.h("form", { class: "PlayerContactsWrapper" }, index.h("div", { class: "ReturnButton", onClick: this.toggleScreen }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15" }, index.h("g", { transform: "translate(-20 -158)" }, index.h("g", { transform: "translate(20 158)" }, index.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)" })))), index.h("h2", null, translate('title', this.lang))), index.h("h2", { class: "HeaderText" }, translate('title', this.lang)), index.h("div", { class: "Section" }, index.h("section", { class: "SectionContent" }, this.editableField('PhoneNumber', 'phoneNumber', 'phoneNumberError'), this.staticField('Email', 'email'))), this.isStandAlone === 'true' &&
|
|
460
|
+
index.h("section", { class: "ButtonsArea" }, index.h("button", { class: `SaveButton ${this.isSubmitButtonAvailable ? '' : 'Disabled'}`, onClick: this.updateData }, translate('saveButton'))))));
|
|
461
|
+
}
|
|
462
|
+
static get watchers() { return {
|
|
463
|
+
"clientStyling": ["handleStylingChange"],
|
|
464
|
+
"clientStylingUrl": ["handleStylingUrlChange"]
|
|
465
|
+
}; }
|
|
466
|
+
};
|
|
467
|
+
PamPlayerContacts.style = PamPlayerContactsStyle0;
|
|
468
|
+
|
|
469
|
+
exports.PamPlayerContacts = PamPlayerContacts;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-ed59decb.js');
|
|
6
|
+
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
Stencil Client Patch Browser v4.19.2 | MIT Licensed | https://stenciljs.com
|
|
10
|
+
*/
|
|
11
|
+
var patchBrowser = () => {
|
|
12
|
+
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('pam-player-contacts.cjs.js', document.baseURI).href));
|
|
13
|
+
const opts = {};
|
|
14
|
+
if (importMeta !== "") {
|
|
15
|
+
opts.resourcesUrl = new URL(".", importMeta).href;
|
|
16
|
+
}
|
|
17
|
+
return index.promiseResolve(opts);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
patchBrowser().then(async (options) => {
|
|
21
|
+
await appGlobals.globalScripts();
|
|
22
|
+
return index.bootstrapLazy([["pam-player-contacts_2.cjs",[[1,"pam-player-contacts",{"userId":[513,"user-id"],"session":[513],"endpoint":[513],"lang":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"isVerificationStatusDisplayed":[513,"is-verification-status-displayed"],"isPhoneNumberEditable":[513,"is-phone-number-editable"],"isStandAlone":[513,"is-stand-alone"],"limitStylingAppends":[32],"isSkeletonLoading":[32],"isSubmitButtonAvailable":[32],"invalidFields":[32],"isMobile":[32],"isError":[32],"errorMessage":[32],"errorCode":[32]},null,{"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1],"color":[1],"primaryColor":[1,"primary-color"],"secondaryColor":[1,"secondary-color"]},null,{"structure":["handleStructureChange"]}]]]], options);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
exports.setNonce = index.setNonce;
|