@everymatrix/player-profile-info 0.0.365 → 0.0.367

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.
@@ -1,964 +1,965 @@
1
- <svelte:options tag={null} />
2
-
3
- <script lang="ts">
4
- import { onMount } from 'svelte';
5
- import { getDevice } from 'rvhelper';
6
- import { _, addNewMessages, setLocale } from './i18n';
7
- import { PlayerProfileTranslations } from './translations';
8
-
9
- // Native bridge
10
- import { isNative, call as callNative, registerEventListener as registerNativeEventListener } from 'js-native-bridge';
11
-
12
-
13
- export let endpoint:string = '';
14
- export let lang:string = 'en';
15
- export let countrycode:string = 'IR';
16
-
17
- let isLoading:boolean = true;
18
- let userAgent:string = window.navigator.userAgent;
19
- let isMobile:boolean = (getDevice(userAgent) === 'PC') ? false : true;
20
- let noPlayerData:boolean = true;
21
-
22
- let playerPostalCode:HTMLElement, playerAddress:HTMLElement, playerCity:HTMLElement;
23
- let giveConsentSMS:boolean = false;
24
- let giveConsentEmail:boolean = false;
25
- let biometricsSelection:boolean = false;
26
- let playerQuestion:string = '';
27
- let playerAnswer:string = '';
28
- let playerPrefix:string = '';
29
- let playerMobileNumber:string = '';
30
- let differencesExist:boolean = false;
31
- let selectedCountry:Object = { Name: 'I.e Ireland'};
32
- let prefixesArray:Array<Object> = [];
33
- let countriesArray:Array<Object> = []
34
-
35
- let profileConsent:Array<Object> = [];
36
- let showEmail:boolean = false;
37
- let showSMS:boolean = false;
38
- let consentArray:any = { items: [] };
39
-
40
- let isValid:boolean = false;
41
-
42
- let invalidCity:string = '';
43
- let invalidPostalCode:string = '';
44
- let invalidAddress:string = '';
45
- let invalidSecurityQuestion:boolean = false;
46
- let invalidSecurityAnswer:boolean = false;
47
- let invalidMobile:boolean;
48
-
49
- let showConfirmSave:boolean = false;
50
-
51
- // Native bridge
52
- let isOnNative:boolean = false;
53
-
54
- Object.keys(PlayerProfileTranslations).forEach((item:any) => {
55
- addNewMessages(item, PlayerProfileTranslations[item]);
56
- });
57
-
58
- const mediaQuery = window.matchMedia('(min-width: 768px)');
59
-
60
- // needed to keep track of data changes
61
- let provisionalArray:any = {
62
- address1: '',
63
- address2: '',
64
- city: '',
65
- acceptNewsEmail: false,
66
- acceptSMSOffers : false,
67
- country: '',
68
- mobile: {prefix: '', number: ''},
69
- postalCode: '',
70
- securityAnswer: '',
71
- securityQuestion: '',
72
- }
73
-
74
- // needed to keep track of data changes
75
- let initialValuesArray:any = {
76
- acceptNewsEmail: false,
77
- acceptSMSOffers : false,
78
- address: '',
79
- city: '',
80
- mobileNumber: '',
81
- mobilePrefix: '',
82
- postalCode: '',
83
- securityAnswer: '',
84
- securityQuestion: ''
85
- }
86
-
87
- // placeholder field values
88
- let profileDetails:any = {
89
- address1: "i.e.: Glanmire Rd.",
90
- birth: '01/01/1990',
91
- city: "i.e.: Cork",
92
- country: "i.e.: Ireland",
93
- currency: "EUR",
94
- email: "email@here.com",
95
- firstname: "Joe",
96
- userTitles: "M",
97
- lastname: "Johnson",
98
- mobile: {prefix: "+00", number: "00000000"},
99
- postalCode: "i.e.: 465531",
100
- securityAnswer: "i.e.: Jerry",
101
- securityQuestion: "i.e.: Pet name?",
102
- title: "",
103
- username: "Username"
104
- };
105
-
106
- let {address1, birth, city, country, currency, mobile, email, firstname, userTitles, language, lastname, postalCode, securityAnswer, securityQuestion, username, consents} = profileDetails;
107
-
108
- const messageHandler = (e:any):void => {
109
- if (e.data) {
110
- switch(e.data.type) {
111
- case 'ProfileDetailsData':
112
- noPlayerData = false;
113
- profileDetails = e.data.profileDetails;
114
-
115
- // readonly field values
116
- username = profileDetails.username;
117
- mobile = profileDetails.mobile;
118
- email = profileDetails.email;
119
- firstname = profileDetails.firstname;
120
- lastname = profileDetails.lastname;
121
- language = profileDetails.language;
122
- birth = profileDetails.birth?.day + '/' + profileDetails.birth?.month + '/' + profileDetails.birth?.year;
123
- currency = profileDetails.currency;
124
- userTitles = profileDetails.title;
125
-
126
- // editable field values used for bindings
127
- playerQuestion = profileDetails.securityQuestion;
128
- playerAnswer = profileDetails.securityAnswer;
129
- playerPrefix = profileDetails.mobile?.prefix;
130
- playerMobileNumber = profileDetails.mobile?.number;
131
-
132
- // set values for the initial editable values object
133
- initialValuesArray = {
134
- address: profileDetails.address1,
135
- city: profileDetails.city,
136
- mobilePrefix: mobile?.prefix,
137
- mobileNumber: mobile?.number,
138
- postalCode: profileDetails.postalCode,
139
- securityAnswer: profileDetails.securityAnswer,
140
- securityQuestion: profileDetails.securityQuestion,
141
- }
142
- break;
143
-
144
- case 'ProfileConsentData':
145
- profileConsent = e.data.consent.items;
146
- if (Array.isArray(profileConsent)) {
147
- profileConsent.forEach((item) => {
148
- if (item.tagCode == 'emailmarketing') {
149
- showEmail = true;
150
- giveConsentEmail = item.status == 'Accepted';
151
- initialValuesArray.acceptNewsEmail = giveConsentEmail;
152
- } else if (item.tagCode == 'sms') {
153
- showSMS = true;
154
- giveConsentSMS = item.status == 'Accepted';
155
- initialValuesArray.acceptSMSOffers = giveConsentSMS;
156
- }
157
- });
158
- }
159
- break;
160
-
161
- case 'ConfirmProfileInfoSave':
162
- if (isOnNative) {
163
- registerNativeEventListener(
164
- 'BIOMETRICS_ENABLED',
165
- (biometricsEnabled) => {
166
- if (biometricsEnabled !== biometricsSelection) {
167
- biometricsSelection = biometricsEnabled;
168
- }
169
- },
170
- );
171
-
172
- const methodFound = callNative(
173
- biometricsSelection ? 'ENABLE_BIOMETRICS' : 'DISABLE_BIOMETRICS',
174
- );
175
-
176
- if (!methodFound) {
177
- // Nothing to do here yet
178
- }
179
- }
180
-
181
- differencesExist = false;
182
-
183
- showConfirmMessage();
184
- break;
185
- }
186
- }
187
- }
188
-
189
- const getCountriesList = ():void => {
190
- fetch(`${endpoint}/player/countries`)
191
- .then((res:any) => {
192
- if (res.status >= 300) {
193
- return new Error('Error while fetching the countries');
194
- }
195
-
196
- return res.json();
197
- })
198
- .then((countryList:any) => {
199
- fetch(`${endpoint}/player/operatorSupportedCountries`).then((res:any) => {
200
- if (res.status >= 300) {
201
- return new Error('Error while fetching the supported countries');
202
- }
203
-
204
- return res.json();
205
- })
206
- .then((supportedCountries:any) => {
207
- countriesArray = countryList.countries.filter((item:any) => {
208
- return supportedCountries.countries.indexOf(item.Alpha2Code) >= 0;
209
- });
210
-
211
- selectedCountry = countriesArray.find((country:any) => country.Alpha2Code === countrycode) || { Name: 'I.E. Ireland'};
212
- isLoading = false;
213
- });
214
- });
215
- }
216
-
217
- const getPhoneCodes = ():void => {
218
- fetch(`${endpoint}/player/phonecodes`)
219
- .then((res:any) => res.json())
220
- .then(data => {
221
- prefixesArray = data.phoneCodes;
222
- });
223
- }
224
-
225
- const showConfirmMessage = ():void => {
226
- showConfirmSave = true;
227
- setTimeout(() => {showConfirmSave = false;}, 3000);
228
- }
229
-
230
-
231
- const checkIsValid = ():void => {
232
- if (invalidSecurityQuestion || invalidSecurityAnswer || invalidCity || invalidAddress || invalidPostalCode || invalidMobile) {
233
- isValid = false;
234
- }
235
- else {
236
- isValid = true;
237
- }
238
- }
239
-
240
- const checkMobile = ():boolean => {
241
- if(playerMobileNumber && playerMobileNumber.length >= 5 && playerMobileNumber.length <= 30) {
242
- return true;
243
- }
244
-
245
- return false;
246
- }
247
-
248
- const validateMobile = ():void => {
249
- invalidMobile = !checkMobile();
250
- checkIsValid();
251
- }
252
-
253
- const checkSecurityQuestion = ():boolean => {
254
- if (playerQuestion && playerQuestion.length <= 120) {
255
- return true;
256
- }
257
-
258
- return false;
259
- }
260
-
261
- const validateSecurityQuestion = ():void => {
262
- invalidSecurityQuestion = !checkSecurityQuestion();
263
- checkIsValid();
264
- }
265
-
266
- const checkSecurityAnswer = ():boolean => {
267
- if (playerAnswer && playerAnswer.length <= 120) {
268
- return true;
269
- }
270
-
271
- return false;
272
- }
273
-
274
- const validateSecurityAnswer = ():void => {
275
- invalidSecurityAnswer = !checkSecurityAnswer();
276
- checkIsValid();
277
- }
278
-
279
- const checkCity = ():boolean => {
280
- if (playerCity.value && playerCity.value.length <= 50) {
281
- return true;
282
- }
283
-
284
- return false;
285
- }
286
-
287
- const validateCity = ():void => {
288
- invalidCity = !checkCity();
289
- checkIsValid();
290
- }
291
-
292
- const checkPostalCode = ():boolean => {
293
- if (playerPostalCode.value && playerPostalCode.value.length <= 20) {
294
- return true;
295
- }
296
-
297
- return false;
298
- }
299
-
300
- const validatePostalCode = ():void => {
301
- invalidPostalCode = !checkPostalCode();
302
- checkIsValid();
303
- }
304
-
305
- const checkAddress = ():boolean => {
306
- if(playerAddress.value && playerAddress.value.length <= 100) {
307
- return true;
308
- }
309
-
310
- return false;
311
- }
312
-
313
- const validateAddress = ():void => {
314
- invalidAddress = !checkAddress();
315
- checkIsValid();
316
- }
317
-
318
- const updatePlayerInfo = ():void => {
319
- if (differencesExist == true && isValid == true) {
320
- window.postMessage({ type: 'UpdatePlayerInfo', provisionalArray }, window.location.href);
321
- window.postMessage({ type: 'UpdatePlayerConsent', consentArray }, window.location.href);
322
- }
323
- }
324
-
325
- const toggleScreen = ():void => {
326
- window.postMessage({type: 'PlayerAccountMenuActive', isMobile}, window.location.href);
327
- }
328
-
329
- const checkForChanges = ():void => {
330
- provisionalArray = {
331
- acceptNewsEmail: giveConsentEmail,
332
- acceptSMSOffers: giveConsentSMS,
333
- address: playerAddress.value,
334
- city: playerCity.value,
335
- mobileNumber: playerMobileNumber,
336
- mobilePrefix: playerPrefix,
337
- postalCode: playerPostalCode.value,
338
- securityAnswer: playerAnswer,
339
- securityQuestion: playerQuestion,
340
- }
341
-
342
- checkEquality(provisionalArray, initialValuesArray);
343
- consentData();
344
- checkIsValid();
345
- }
346
-
347
- const consentData = ():void => {
348
- consentArray = { items: [] };
349
- if (showSMS) {
350
- consentArray.items.push({'tagCode': 'sms', 'status': giveConsentSMS ? 'Accepted' : 'Denied'})
351
- }
352
-
353
- if (showEmail) {
354
- consentArray.items.push({'tagCode': 'emailmarketing', 'status': giveConsentEmail ? 'Accepted' : 'Denied'})
355
- }
356
- }
357
-
358
- const resetPlayerInfo = ():void => {
359
- playerAddress.value = initialValuesArray.address;
360
- playerCity.value = initialValuesArray.city;
361
- giveConsentEmail = initialValuesArray.acceptNewsEmail;
362
- giveConsentSMS = initialValuesArray.acceptSMSOffers;
363
- playerPrefix = initialValuesArray.mobilePrefix;
364
- playerMobileNumber = initialValuesArray.mobileNumber;
365
- playerPostalCode.value = initialValuesArray.postalCode;
366
- playerAnswer = initialValuesArray.securityAnswer;
367
- playerQuestion = initialValuesArray.securityQuestion;
368
-
369
- toggleScreen();
370
- }
371
-
372
- const checkEquality = (a, b):void => {
373
- if(JSON.stringify(a) === JSON.stringify(b)) {
374
- differencesExist = false;
375
- } else {
376
- differencesExist = true;
377
- }
378
- }
379
-
380
- const setActiveLanguage = ():void => {
381
- setLocale(lang);
382
- }
383
-
384
- onMount(() => {
385
- window.addEventListener('message', messageHandler, false);
386
-
387
- isOnNative = !!isNative(userAgent);
388
-
389
- if (isOnNative) {
390
- registerNativeEventListener(
391
- 'BIOMETRICS_ENABLED',
392
- (biometricsEnabled) => {
393
- biometricsSelection = !!biometricsEnabled
394
- },
395
- );
396
-
397
- callNative('BIOMETRICS_ENABLED');
398
- }
399
-
400
- return () => {
401
- window.removeEventListener('message', messageHandler);
402
- }
403
- });
404
-
405
- $: lang && setActiveLanguage();
406
- $: endpoint && countrycode && getCountriesList();
407
- $: endpoint && getPhoneCodes();
408
- </script>
409
-
410
- {#if isLoading}
411
- <div class="ModalLoader" part="ModalLoader"></div>
412
- {:else}
413
- <form class="PlayerInfoWrapper {isMobile ? 'PlayerInfoWrapperMobile' : ''} {mediaQuery.matches && isMobile ? 'PlayerInfoWrapperTablet' : ''}" part="PlayerInfoWrapper {isMobile ? 'PlayerInfoWrapperMobile' : ''} {mediaQuery.matches && isMobile ? 'PlayerInfoWrapperTablet' : ''}">
414
-
415
- {#if isMobile}
416
- <div class="MenuReturnButton" part="MenuReturnButton" on:click={() => toggleScreen()}>
417
- <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15"><defs><style>.aaa{fill:var(--emfe-w-color-primary, #D0046C);}</style></defs><g transform="translate(-20 -158)">
418
- <g transform="translate(20 158)">
419
- <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)"/>
420
- </g></g>
421
- </svg>
422
- <h2 class="MyAccountCategoryTitleMobile" part="MyAccountCategoryTitleMobile">{$_('playerProfile.title')}</h2>
423
- </div>
424
- {/if}
425
-
426
- <h2 class="MyAccountCategoryTitle {isMobile ? 'MyAccountCategoryTitleNone' : ''}" part="MyAccountCategoryTitle {isMobile ? 'MyAccountCategoryTitleNone' : ''}">{$_('playerProfile.title')}</h2>
427
-
428
- <div class="PlayerNotificationsHeader" part="PlayerNotificationsHeader">
429
- <h3>{$_('playerProfile.personalDetails')}</h3>
430
- </div>
431
- <section class="PlayerDetailsContent" part="PlayerDetailsContent">
432
- <div class="PlayerInfoBox" part="PlayerInfoBox">
433
- <label>{$_('playerProfile.userName')}</label>
434
- <input type="text" class="FieldDisabled" part="FieldDisabled" value={username} readonly />
435
- </div>
436
- <div class="PlayerInfoBox {invalidMobile ? 'InvalidField' : ''}" part="PlayerInfoBox {invalidMobile ? 'InvalidField' : ''}">
437
- <label>{$_('playerProfile.userPhone')}</label>
438
- <div class="PlayerPhoneNumber" part="PlayerPhoneNumber">
439
- <select bind:value={playerPrefix} on:change={() => checkForChanges()}>
440
- {#each prefixesArray as pref}
441
- {#if pref.Prefix === initialValuesArray.mobiePrefix}
442
- <option selected>{pref.Prefix}</option>
443
- {:else}
444
- <option>{pref.Prefix}</option>
445
- {/if}
446
- {/each}
447
- </select>
448
- <input bind:value={playerMobileNumber} on:keyup={validateMobile} type="text" oninput="this.value = this.value.replace(/[^0-9.]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');" placeholder={noPlayerData ? mobile.number : ''} on:keyup={() => checkForChanges()}/>
449
- </div>
450
- {#if invalidMobile}
451
- <p class="InvalidInput" part="InvalidInput">{$_('playerProfile.userPhoneError')}</p>
452
- {/if}
453
- </div>
454
- <div class="PlayerInfoBox {invalidSecurityQuestion ? 'InvalidField' : ''}" part="PlayerInfoBox {invalidSecurityQuestion ? 'InvalidField' : ''}">
455
- <label>{$_('playerProfile.securityQuestion')}</label>
456
- <input type="text" bind:value={playerQuestion} on:keyup={() => checkForChanges()} on:blur={validateSecurityQuestion} placeholder={noPlayerData ? securityQuestion : ''} />
457
- {#if invalidSecurityQuestion}
458
- <p class="InvalidInput" part="InvalidInput">{$_('playerProfile.securityQuestionError')}</p>
459
- {/if}
460
- </div>
461
- <div class="PlayerInfoBox {invalidSecurityAnswer ? 'InvalidField' : ''}" part="PlayerInfoBox {invalidSecurityAnswer ? 'InvalidField' : ''}">
462
- <label>{$_('playerProfile.securityAnswer')}</label>
463
- <input type="text" bind:value={playerAnswer} on:keyup={() => checkForChanges()} on:blur={validateSecurityAnswer} placeholder={noPlayerData ? securityAnswer : ''} />
464
- {#if invalidSecurityAnswer}
465
- <p class="InvalidInput" part="InvalidInput">{$_('playerProfile.securityAnswerError')}</p>
466
- {/if}
467
- </div>
468
- <div class="PlayerInfoBox" part="PlayerInfoBox">
469
- <label>{$_('playerProfile.userEmail')}</label>
470
- <input type="email" class="FieldDisabled" part="FieldDisabled" value={email} readonly />
471
- </div>
472
- <div class="PlayerInfoBox" part="PlayerInfoBox">
473
- <label>{$_('playerProfile.dateOfBirth')}</label>
474
- <input type="text" class="FieldDisabled" part="FieldDisabled" value={birth} readonly />
475
- </div>
476
- <div class="PlayerInfoBox" part="PlayerInfoBox">
477
- <label>{$_('playerProfile.firstName')}</label>
478
- <input type="text" class="FieldDisabled" part="FieldDisabled" value={firstname} readonly />
479
- </div>
480
- <div class="PlayerInfoBox" part="PlayerInfoBox">
481
- <label>{$_('playerProfile.lastName')}</label>
482
- <input type="text" class="FieldDisabled" part="FieldDisabled" value={lastname} readonly />
483
- </div>
484
- <div class="PlayerInfoBox" part="PlayerInfoBox">
485
- <label>{$_('playerProfile.userTitle')}</label>
486
- <input type="text" class="FieldDisabled" part="FieldDisabled" value={userTitles} readonly />
487
- </div>
488
- <div class="PlayerInfoBox" part="PlayerInfoBox">
489
- <label>{$_('playerProfile.currency')}</label>
490
- <input type="text" class="FieldDisabled" part="FieldDisabled" value={currency} readonly />
491
- </div>
492
- </section>
493
-
494
- <div class="PlayerLocationHeader" part="PlayerLocationHeader">
495
- <h3>{$_('playerProfile.locationDetails')}</h3>
496
- </div>
497
- <section class="PlayerLocationContent" part="PlayerLocationContent">
498
- <div class="PlayerInfoBox" part="PlayerInfoBox">
499
- <label>{$_('playerProfile.userCountry')}</label>
500
- <input type="text" class="PlayerCountry FieldDisabled" part="PlayerCountry FieldDisabled" placeholder={countrycode} value={selectedCountry.Name} readonly />
501
- </div>
502
- <div class="PlayerInfoBox {invalidCity ? 'InvalidField' : ''}" part="PlayerInfoBox {invalidCity ? 'InvalidField' : ''}">
503
- <label>{$_('playerProfile.userCity')}</label>
504
- <input bind:this={playerCity} type="text" on:blur={validateCity} on:keyup={() => checkForChanges()} placeholder={noPlayerData ? city : ''} value={noPlayerData ? '' : initialValuesArray.city} />
505
- {#if invalidCity}
506
- <p class="InvalidInput" part="InvalidInput">{$_('playerProfile.userCityError')}</p>
507
- {/if}
508
- </div>
509
- <div class="PlayerInfoBox {invalidAddress ? 'InvalidField' : ''}" part="PlayerInfoBox {invalidAddress ? 'InvalidField' : ''}">
510
- <label>{$_('playerProfile.userAddress')}</label>
511
- <input bind:this={playerAddress} placeholder={address1} type="text" on:blur={validateAddress} on:keyup={() => checkForChanges()} value={noPlayerData ? '' : initialValuesArray.address} />
512
- {#if invalidAddress}
513
- <p class="InvalidInput" part="InvalidInput">{$_('playerProfile.userAddressError')}</p>
514
- {/if}
515
- </div>
516
- <div class="PlayerInfoBox {invalidPostalCode ? 'InvalidField' : ''}" part="PlayerInfoBox {invalidPostalCode ? 'InvalidField' : ''}">
517
- <label>{$_('playerProfile.userPostalCode')}</label>
518
- <input bind:this={playerPostalCode} type="text" on:blur={validatePostalCode} on:keyup={() => checkForChanges()} placeholder={noPlayerData ? postalCode : ''} value={noPlayerData ? '' : initialValuesArray.postalCode} />
519
- {#if invalidPostalCode}
520
- <p class="InvalidInput" part="InvalidInput">{$_('playerProfile.userPostalCodeError')}</p>
521
- {/if}
522
- </div>
523
- </section>
524
-
525
- {#if showEmail || showSMS}
526
- <div class="PlayerNotificationsHeader" part="PlayerNotificationsHeader">
527
- <h3>{$_('playerProfile.userNotifications')}</h3>
528
- </div>
529
- <section class="PlayerNotificationsCheckboxArea" part="PlayerNotificationsCheckboxArea">
530
- {#if showSMS}
531
- <div class="PlayerNotificationBox" part="PlayerNotificationBox">
532
- <label for="SMSNotification">
533
- <input bind:checked={giveConsentSMS} on:change={checkForChanges} type="checkbox" id="SMSNotification" name="Enable SMS notifications" />
534
- <span class="Checkmark" part="Checkmark"></span>
535
- <span>{$_('playerProfile.userSMSNotification')}</span>
536
- </label>
537
- </div>
538
- {/if}
539
- {#if showEmail}
540
- <div class="PlayerNotificationBox" part="PlayerNotificationBox">
541
- <label for="EmailNotification">
542
- <input bind:checked={giveConsentEmail} on:change={checkForChanges} type="checkbox" id="EmailNotification" name="Enable Emails" />
543
- <span class="Checkmark" part="Checkmark"></span>
544
- <span>{$_('playerProfile.userEmailNotification')}</span>
545
- </label>
546
- </div>
547
- {/if}
548
- </section>
549
- {/if}
550
- {#if isOnNative}
551
- <div class="PlayerNotificationsHeader" part="PlayerNotificationsHeader">
552
- <h3>{$_('playerProfile.userAppSettings')}</h3>
553
- </div>
554
- <section class="PlayerNotificationsCheckboxArea" part="PlayerNotificationsCheckboxArea">
555
- <div class="PlayerNotificationBox" part="PlayerNotificationBox">
556
- <label for="Biometrics">
557
- <input bind:checked={biometricsSelection} on:change={checkForChanges} type="checkbox" id="BiometricsEnabled" name="Biometric Enabled" />
558
- <span class="Checkmark" part="Checkmark"></span>
559
- <span>{$_('playerProfile.userBiometrics')}</span>
560
- </label>
561
- </div>
562
- </section>
563
- {/if}
564
- <section class="PlayerDetailsButtonsArea {isMobile ? 'PlayerDetailsButtonsAreaMobile' : ''}" part="PlayerDetailsButtonsArea {isMobile ? 'PlayerDetailsButtonsAreaMobile' : ''}">
565
- <div class="PlayerDetailsSaveButton {differencesExist && isValid ? '' : 'PlayerButtonDisabled'}" part="PlayerDetailsSaveButton {differencesExist && isValid ? '' : 'PlayerButtonDisabled'}" on:click={() => updatePlayerInfo()}>{$_('playerProfile.userProfileSaveChanges')}</div>
566
- </section>
567
- {#if showConfirmSave}
568
- <section class="PlayerDetailsConfirmSave" part="PlayerDetailsConfirmSave">
569
- <p class="PlayerDetailsConfirmSaveText" part="PlayerDetailsConfirmSaveText">{$_('playerProfile.userProfileConfirmationMessage')}</p>
570
- </section>
571
- {/if}
572
- </form>
573
- {/if}
574
-
575
- <style lang="scss">
576
-
577
- :host {
578
- font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
579
- }
580
-
581
- .MyAccountCategoryTitle {
582
- font-size: 26px;
583
- color: var(--emfe-w-color-primary, #D0046C);
584
- font-weight: 400;
585
- }
586
-
587
- .MyAccountCategoryTitleMobile {
588
- font-size: 16px;
589
- color: var(--emfe-w-color-primary, #D0046C);
590
- }
591
-
592
- .MyAccountCategoryTitleNone {
593
- display: none;
594
- }
595
-
596
- .PlayerInfoWrapper {
597
- color: var(--emfe-w-color-contrast, #07072A);
598
- background: var(--emfe-w-color-gray-50, #F9F8F8);
599
- padding: 50px;
600
- max-width: 760px;
601
- }
602
-
603
- .PlayerNotificationsHeader, .PlayerDetailsHeader, .PlayerLocationHeader {
604
- h3 {
605
- font-size: 16px;
606
- color: var(--emfe-w-color-primary, #D0046C);
607
- text-transform: capitalize;
608
- font-weight: 400;
609
- }
610
- }
611
-
612
- .PlayerDetailsContent {
613
- display: grid;
614
- grid-column-gap: 50px;
615
- grid-row-gap: 24px;
616
- grid-template-rows: auto;
617
- grid-template-columns: 1fr 1fr;
618
- padding-bottom: 30px;
619
- }
620
-
621
- .MenuReturnButton{
622
- color: var(--emfe-w-color-gray-300, #58586B);
623
- display: inline-flex;
624
- align-items: center;
625
- column-gap: 10px;
626
- margin-bottom: 10px;
627
- }
628
-
629
- .PlayerInfoBox {
630
- display: flex;
631
- flex-direction: column;
632
- label {
633
- font-size: 14px;
634
- font-weight: 300;
635
- margin-bottom: 10px;
636
- }
637
- input {
638
- font-size: 14px;
639
- font-weight: 300;
640
- color: var(--emfe-w-color-contrast, #07072A);
641
- padding: 10px;
642
- line-height: 16px;
643
- background: var(--emfe-w-color-white, #FFFFFF);
644
- border: 1px solid var(--emfe-w-color-gray-100, #E6E6E6);
645
- border-radius: 5px;
646
- outline: none;
647
- transition-duration: 0.3s;
648
- &:focus, :focus-within, :focus-visible, :visited {
649
- border: 1px solid var(--emfe-w-color-primary, #D0046C);
650
- box-shadow: 0 0 0 1pt var(--emfe-w-color-primary, #D0046C);
651
- }
652
- }
653
-
654
- &.InvalidField {
655
- input {
656
- border: 1px solid var(--emfe-w-color-error, #FD2839);
657
- background: var(--emfe-w-color-primary-50, #FBECF4);
658
- color: var(--emfe-w-color-error, #FD2839);
659
- }
660
- }
661
-
662
- .InvalidInput {
663
- color: var(--emfe-w-color-error, #FD2839);
664
- font-size: 10px;
665
- line-height: 10px;
666
- }
667
-
668
-
669
- .FieldDisabled {
670
- opacity: 0.5;
671
- }
672
- .PlayerPhoneNumber {
673
- display: grid;
674
- grid-template-columns: 2fr 4fr;
675
- column-gap: 10px;
676
- position: relative;
677
- }
678
- select {
679
- font-size: 14px;
680
- font-weight: 300;
681
- padding: 10px;
682
- color: var(--emfe-w-color-contrast, #07072A);
683
- border: 1px solid var(--emfe-w-color-gray-100, #E6E6E6);
684
- border-radius: 5px;
685
- outline: none;
686
- transition-duration: 0.3s;
687
- -webkit-appearance: none;
688
- -moz-appearance: none;
689
- appearance: none;
690
- background: url("data:image/svg+xml,<svg height='10px' width='10px' viewBox='0 0 16 16' fill='%23000000' xmlns='http://www.w3.org/2000/svg'><path d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/></svg>") no-repeat var(--emfe-w-color-white, #FFFFFF);
691
- background-position: calc(100% - 0.75rem) center;
692
- &:focus, :focus-within, :focus-visible, :visited {
693
- border: 1px solid var(--emfe-w-color-primary, #D0046C);
694
- box-shadow: 0 0 0 1pt var(--emfe-w-color-primary, #D0046C);
695
- }
696
- }
697
- /* Chrome, Safari, Edge, Opera */
698
- input::-webkit-outer-spin-button,
699
- input::-webkit-inner-spin-button {
700
- -webkit-appearance: none;
701
- margin: 0;
702
- }
703
-
704
- /* Firefox */
705
- input[type=number] {
706
- -moz-appearance: textfield;
707
- }
708
- }
709
-
710
- .PlayerLocationContent {
711
- display: grid;
712
- grid-column-gap: 50px;
713
- grid-row-gap: 24px;
714
- grid-template-rows: auto;
715
- grid-template-columns: 1fr 1fr;
716
- padding-bottom: 30px;
717
- }
718
-
719
- .PlayerNotificationBox {
720
- &:first-child {
721
- margin-bottom: 10px;
722
- }
723
- label {
724
- display: inline-flex;
725
- position: relative;
726
- align-items: center;
727
- span {
728
- font-size: 14px;
729
- font-weight: 300;
730
- }
731
- input {
732
- height: 20px;
733
- width: 20px;
734
- -webkit-appearance: none;
735
- -moz-appearance: none;
736
- -o-appearance: none;
737
- appearance: none;
738
- border-radius: 50px;
739
- outline: none;
740
- transition-duration: 0.3s;
741
- background-color: var(--emfe-w-color-gray-100, #E6E6E6);
742
- cursor: pointer;
743
- margin-right: 10px;
744
- }
745
- input:checked {
746
- background-color: var(--emfe-w-color-primary, #D0046C);
747
- }
748
- .Checkmark {
749
- left: 10px;
750
- top: 7px;
751
- width: 4px;
752
- height: 8px;
753
- border: solid white;
754
- border-width: 0 2px 2px 0;
755
- -webkit-transform: rotate(45deg);
756
- -ms-transform: rotate(45deg);
757
- transform: rotate(45deg);
758
- position: absolute;
759
- }
760
- }
761
- }
762
-
763
- .PlayerDetailsButtonsArea {
764
- grid-column-gap: 10px;
765
- grid-template-rows: auto;
766
- grid-template-columns: 1fr;
767
- margin-top: 20px;
768
- width: 50%;
769
-
770
- .PlayerDetailsSaveButton, .PlayerDetailsCancelButton {
771
- cursor: pointer;
772
- border-radius: 5px;
773
- width: 100%;
774
- height: 50px;
775
- display: flex;
776
- align-items: center;
777
- justify-content: center;
778
- font-size: 16px;
779
- color: var(--emfe-w-color-contrast, #07072A);
780
- text-transform: uppercase;
781
- transition-duration: 0.3s;
782
- box-sizing: border-box;
783
- }
784
- .PlayerDetailsSaveButton {
785
- background: var(--emfe-w-color-primary, #D0046C);
786
- border: 1px solid var(--emfe-w-color-primary, #D0046C);
787
- color: var(--emfe-w-color-white, #FFFFFF);
788
- &:active {
789
- background: var(--emfe-w-color-primary-600, #99034F);
790
- }
791
- &.PlayerButtonDisabled {
792
- opacity: 0.3;
793
- cursor: not-allowed;
794
- }
795
- }
796
-
797
- .PlayerDetailsCancelButton {
798
- background: transparent;
799
- border: 1px solid var(--emfe-w-color-gray-300, #58586B);
800
- &:active {
801
- background: var(--emfe-w-color-primary-600, #99034F);
802
- }
803
- &.PlayerButtonDisabled {
804
- background: transparent;
805
- border: 1px solid var(--emfe-w-color-gray-300, #58586B);
806
- cursor: not-allowed;
807
- opacity: 0.6;
808
- }
809
- }
810
- &.PlayerDetailsButtonsAreaMobile {
811
- width: 100%;
812
- grid-template-columns: 1fr 1fr;
813
- .PlayerDetailsSaveButton, .PlayerDetailsCancelButton {
814
- height: 40px;
815
- font-size: 12px;
816
- }
817
- }
818
- }
819
-
820
- .PlayerNotificationsCheckboxArea {
821
- padding-bottom: 30px;
822
- }
823
-
824
- .PlayerInfoWrapperMobile {
825
- padding: 20px 15px;
826
- background: var(--emfe-w-color-gray-50, #F9F8F8);
827
- max-width: unset;
828
- .PlayerDetailsContent {
829
- grid-template-columns: 1fr;
830
- }
831
- .PlayerNotificationsHeader, .PlayerDetailsHeader, .PlayerLocationHeader {
832
- h3 {
833
- color: var(--emfe-w-color-primary, #D0046C);
834
- font-size: 14px;
835
- font-weight: 400;
836
- }
837
- }
838
- .PlayerInfoBox {
839
- label {
840
- color: var(--emfe-w-color-gray-300, #58586B);
841
- font-size: 12px;
842
- font-weight: 400;
843
- }
844
- input {
845
- color: var(--emfe-w-color-gray-300, #58586B);
846
- font-size: 12px;
847
- font-weight: 300;
848
- }
849
- select {
850
- color: var(--emfe-w-color-gray-300, #58586B);
851
- }
852
- }
853
- .PlayerLocationContent {
854
- grid-template-columns: 1fr;
855
- }
856
- .PlayerNotificationsCheckboxArea {
857
- .PlayerNotificationBox {
858
- label {
859
- color: var(--emfe-w-color-contrast, #07072A);
860
- font-size: 12px;
861
- font-weight: 300;
862
- }
863
- }
864
- }
865
- .PlayerDetailsButtonsArea {
866
- grid-column-gap: 10px;
867
- }
868
- .PlayerDetailsSaveButton, .PlayerDetailsCancelButton {
869
- font-size: 12px;
870
- height: 40px;
871
- color: var(--emfe-w-color-white, #FFFFFF);
872
- &.PlayerButtonDisabled {
873
- color: var(--emfe-w-color-gray-300, #58586B);
874
- }
875
- }
876
- .PlayerDetailsCancelButton {
877
- color: var(--emfe-w-color-gray-300, #58586B);
878
- }
879
- }
880
-
881
- .PlayerInfoWrapperTablet {
882
- padding: 40px 25% 40px 25%;
883
- .PlayerDetailsContent {
884
- grid-row-gap: 20px;
885
- }
886
- .MenuReturnButton {
887
- margin-bottom: 30px;
888
- span {
889
- font-size: 20px;
890
- }
891
- }
892
- .PlayerDetailsHeader, .PlayerLocationHeader, .PlayerNotificationsHeader {
893
- h3 {
894
- font-size: 24px;
895
- }
896
- }
897
- .PlayerInfoBox {
898
- label {
899
- font-size: 20px;
900
- }
901
- input {
902
- height: 30px;
903
- font-size: 20px;
904
- line-height: 30px;
905
- }
906
- select {
907
- font-size: 20px;
908
- }
909
- .TogglePasswordVisibility {
910
- width: 30px;
911
- top: 26px;
912
- }
913
- .InvalidInput {
914
- font-size: 16px;
915
- bottom: - 50px;
916
- }
917
- &:last-child {
918
- .InvalidInput {
919
- font-size: 16px;
920
- bottom: -50px;
921
- }
922
- }
923
- }
924
- .PlayerDetailsButtonsArea {
925
- grid-column-gap: 40px;
926
- .PlayerDetailsSaveButton, .PlayerDetailsCancelButton {
927
- font-size: 20px;
928
- height: 56px;
929
- }
930
- .PlayerDetailsSaveButton {
931
- color: var(--emfe-w-color-white, #FFFFFF);
932
- &.PlayerButtonDisabled {
933
- color: var(--emfe-w-color-gray-300, #58586B);
934
- }
935
- }
936
- }
937
- .PlayerNotificationBox {
938
- label {
939
- span {
940
- font-size: 20px;
941
- }
942
- input {
943
- height: 26px;
944
- width: 26px;
945
- }
946
- .Checkmark {
947
- left: 50px;
948
- top: 9px;
949
- }
950
- }
951
- }
952
- }
953
- .PlayerDetailsConfirmSave {
954
- background: var(--emfe-w-color-green, #48952a);
955
- color: var(--emfe-w-color-white, #FFFFFF);
956
- padding: 16px;
957
- border-radius: 5px;
958
- margin-top: 16px;
959
- .PlayerDetailsConfirmSaveText {
960
- padding: 0;
961
- margin: 0;
962
- }
963
- }
964
- </style>
1
+ <svelte:options tag={null} />
2
+
3
+ <script lang="ts">
4
+ import { onMount } from 'svelte';
5
+ import { getDevice } from 'rvhelper';
6
+ import { _, addNewMessages, setLocale } from './i18n';
7
+ import { PlayerProfileTranslations } from './translations';
8
+
9
+ // Native bridge
10
+ import { isNative, call as callNative, registerEventListener as registerNativeEventListener } from 'js-native-bridge';
11
+
12
+
13
+ export let endpoint:string = '';
14
+ export let lang:string = 'en';
15
+ export let countrycode:string = 'IR';
16
+
17
+ let isLoading:boolean = true;
18
+ let userAgent:string = window.navigator.userAgent;
19
+ let isMobile:boolean = (getDevice(userAgent) === 'PC') ? false : true;
20
+ let noPlayerData:boolean = true;
21
+
22
+ let playerPostalCode:HTMLElement, playerAddress:HTMLElement, playerCity:HTMLElement;
23
+ let giveConsentSMS:boolean = false;
24
+ let giveConsentEmail:boolean = false;
25
+ let biometricsSelection:boolean = false;
26
+ let playerQuestion:string = '';
27
+ let playerAnswer:string = '';
28
+ let playerPrefix:string = '';
29
+ let playerMobileNumber:string = '';
30
+ let differencesExist:boolean = false;
31
+ let selectedCountry:Object = { Name: 'I.e Ireland'};
32
+ let prefixesArray:Array<Object> = [];
33
+ let countriesArray:Array<Object> = []
34
+
35
+ let profileConsent:Array<Object> = [];
36
+ let showEmail:boolean = false;
37
+ let showSMS:boolean = false;
38
+ let consentArray:any = { items: [] };
39
+
40
+ let isValid:boolean = false;
41
+
42
+ let invalidCity:string = '';
43
+ let invalidPostalCode:string = '';
44
+ let invalidAddress:string = '';
45
+ let invalidSecurityQuestion:boolean = false;
46
+ let invalidSecurityAnswer:boolean = false;
47
+ let invalidMobile:boolean;
48
+
49
+ let showConfirmSave:boolean = false;
50
+
51
+ // Native bridge
52
+ let isOnNative:boolean = false;
53
+
54
+ Object.keys(PlayerProfileTranslations).forEach((item:any) => {
55
+ addNewMessages(item, PlayerProfileTranslations[item]);
56
+ });
57
+
58
+ const mediaQuery = window.matchMedia('(min-width: 768px)');
59
+
60
+ // needed to keep track of data changes
61
+ let provisionalArray:any = {
62
+ address1: '',
63
+ address2: '',
64
+ city: '',
65
+ acceptNewsEmail: false,
66
+ acceptSMSOffers : false,
67
+ country: '',
68
+ mobile: {prefix: '', number: ''},
69
+ postalCode: '',
70
+ securityAnswer: '',
71
+ securityQuestion: '',
72
+ }
73
+
74
+ // needed to keep track of data changes
75
+ let initialValuesArray:any = {
76
+ acceptNewsEmail: false,
77
+ acceptSMSOffers : false,
78
+ address: '',
79
+ city: '',
80
+ mobileNumber: '',
81
+ mobilePrefix: '',
82
+ postalCode: '',
83
+ securityAnswer: '',
84
+ securityQuestion: ''
85
+ }
86
+
87
+ // placeholder field values
88
+ let profileDetails:any = {
89
+ address1: "i.e.: Glanmire Rd.",
90
+ birth: '01/01/1990',
91
+ city: "i.e.: Cork",
92
+ country: "i.e.: Ireland",
93
+ currency: "EUR",
94
+ email: "email@here.com",
95
+ firstname: "Joe",
96
+ userTitles: "M",
97
+ lastname: "Johnson",
98
+ mobile: {prefix: "+00", number: "00000000"},
99
+ postalCode: "i.e.: 465531",
100
+ securityAnswer: "i.e.: Jerry",
101
+ securityQuestion: "i.e.: Pet name?",
102
+ title: "",
103
+ username: "Username"
104
+ };
105
+
106
+ let {address1, birth, city, country, currency, mobile, email, firstname, userTitles, language, lastname, postalCode, securityAnswer, securityQuestion, username, consents} = profileDetails;
107
+
108
+ const messageHandler = (e:any):void => {
109
+ if (e.data) {
110
+ switch(e.data.type) {
111
+ case 'ProfileDetailsData':
112
+ noPlayerData = false;
113
+ profileDetails = e.data.profileDetails;
114
+
115
+ // readonly field values
116
+ username = profileDetails.username;
117
+ mobile = profileDetails.mobile;
118
+ email = profileDetails.email;
119
+ firstname = profileDetails.firstname;
120
+ lastname = profileDetails.lastname;
121
+ language = profileDetails.language;
122
+ birth = profileDetails.birth?.day + '/' + profileDetails.birth?.month + '/' + profileDetails.birth?.year;
123
+ currency = profileDetails.currency;
124
+ userTitles = profileDetails.title;
125
+
126
+ // editable field values used for bindings
127
+ playerQuestion = profileDetails.securityQuestion;
128
+ playerAnswer = profileDetails.securityAnswer;
129
+ playerPrefix = profileDetails.mobile?.prefix;
130
+ playerMobileNumber = profileDetails.mobile?.number;
131
+
132
+ // set values for the initial editable values object
133
+ initialValuesArray = {
134
+ address: profileDetails.address1,
135
+ city: profileDetails.city,
136
+ mobilePrefix: mobile?.prefix,
137
+ mobileNumber: mobile?.number,
138
+ postalCode: profileDetails.postalCode,
139
+ securityAnswer: profileDetails.securityAnswer,
140
+ securityQuestion: profileDetails.securityQuestion,
141
+ }
142
+ break;
143
+
144
+ case 'ProfileConsentData':
145
+ profileConsent = e.data.consent.items;
146
+ if (Array.isArray(profileConsent)) {
147
+ profileConsent.forEach((item) => {
148
+ if (item.tagCode == 'emailmarketing') {
149
+ showEmail = true;
150
+ giveConsentEmail = item.status == 'Accepted';
151
+ initialValuesArray.acceptNewsEmail = giveConsentEmail;
152
+ } else if (item.tagCode == 'sms') {
153
+ showSMS = true;
154
+ giveConsentSMS = item.status == 'Accepted';
155
+ initialValuesArray.acceptSMSOffers = giveConsentSMS;
156
+ }
157
+ });
158
+ }
159
+ break;
160
+
161
+ case 'ConfirmProfileInfoSave':
162
+ if (isOnNative) {
163
+ registerNativeEventListener(
164
+ 'BIOMETRICS_ENABLED',
165
+ (biometricsEnabled) => {
166
+ if (biometricsEnabled !== biometricsSelection) {
167
+ biometricsSelection = biometricsEnabled;
168
+ }
169
+ },
170
+ );
171
+
172
+ const methodFound = callNative(
173
+ biometricsSelection ? 'ENABLE_BIOMETRICS' : 'DISABLE_BIOMETRICS',
174
+ );
175
+
176
+ if (!methodFound) {
177
+ // Nothing to do here yet
178
+ }
179
+ }
180
+
181
+ differencesExist = false;
182
+
183
+ showConfirmMessage();
184
+ break;
185
+ }
186
+ }
187
+ }
188
+
189
+ const getCountriesList = ():void => {
190
+ fetch(`${endpoint}/player/countries`)
191
+ .then((res:any) => {
192
+ if (res.status >= 300) {
193
+ return new Error('Error while fetching the countries');
194
+ }
195
+
196
+ return res.json();
197
+ })
198
+ .then((countryList:any) => {
199
+ fetch(`${endpoint}/player/operatorSupportedCountries`).then((res:any) => {
200
+ if (res.status >= 300) {
201
+ return new Error('Error while fetching the supported countries');
202
+ }
203
+
204
+ return res.json();
205
+ })
206
+ .then((supportedCountries:any) => {
207
+ countriesArray = countryList.countries.filter((item:any) => {
208
+ return supportedCountries.countries.indexOf(item.Alpha2Code) >= 0;
209
+ });
210
+
211
+ selectedCountry = countriesArray.find((country:any) => country.Alpha2Code === countrycode) || { Name: 'I.E. Ireland'};
212
+ isLoading = false;
213
+ });
214
+ });
215
+ }
216
+
217
+ const getPhoneCodes = ():void => {
218
+ fetch(`${endpoint}/player/phonecodes`)
219
+ .then((res:any) => res.json())
220
+ .then(data => {
221
+ prefixesArray = data.phoneCodes;
222
+ });
223
+ }
224
+
225
+ const showConfirmMessage = ():void => {
226
+ showConfirmSave = true;
227
+ setTimeout(() => {showConfirmSave = false;}, 3000);
228
+ }
229
+
230
+
231
+ const checkIsValid = ():void => {
232
+ if (invalidSecurityQuestion || invalidSecurityAnswer || invalidCity || invalidAddress || invalidPostalCode || invalidMobile) {
233
+ isValid = false;
234
+ }
235
+ else {
236
+ isValid = true;
237
+ }
238
+ }
239
+
240
+ const checkMobile = ():boolean => {
241
+ if(playerMobileNumber && playerMobileNumber.length >= 5 && playerMobileNumber.length <= 30) {
242
+ return true;
243
+ }
244
+
245
+ return false;
246
+ }
247
+
248
+ const validateMobile = ():void => {
249
+ invalidMobile = !checkMobile();
250
+ checkIsValid();
251
+ }
252
+
253
+ const checkSecurityQuestion = ():boolean => {
254
+ if (playerQuestion && playerQuestion.length <= 120) {
255
+ return true;
256
+ }
257
+
258
+ return false;
259
+ }
260
+
261
+ const validateSecurityQuestion = ():void => {
262
+ invalidSecurityQuestion = !checkSecurityQuestion();
263
+ checkIsValid();
264
+ }
265
+
266
+ const checkSecurityAnswer = ():boolean => {
267
+ if (playerAnswer && playerAnswer.length <= 120) {
268
+ return true;
269
+ }
270
+
271
+ return false;
272
+ }
273
+
274
+ const validateSecurityAnswer = ():void => {
275
+ invalidSecurityAnswer = !checkSecurityAnswer();
276
+ checkIsValid();
277
+ }
278
+
279
+ const checkCity = ():boolean => {
280
+ if (playerCity.value && playerCity.value.length <= 50) {
281
+ return true;
282
+ }
283
+
284
+ return false;
285
+ }
286
+
287
+ const validateCity = ():void => {
288
+ invalidCity = !checkCity();
289
+ checkIsValid();
290
+ }
291
+
292
+ const checkPostalCode = ():boolean => {
293
+ if (playerPostalCode.value && playerPostalCode.value.length <= 20) {
294
+ return true;
295
+ }
296
+
297
+ return false;
298
+ }
299
+
300
+ const validatePostalCode = ():void => {
301
+ invalidPostalCode = !checkPostalCode();
302
+ checkIsValid();
303
+ }
304
+
305
+ const checkAddress = ():boolean => {
306
+ if(playerAddress.value && playerAddress.value.length <= 100) {
307
+ return true;
308
+ }
309
+
310
+ return false;
311
+ }
312
+
313
+ const validateAddress = ():void => {
314
+ invalidAddress = !checkAddress();
315
+ checkIsValid();
316
+ }
317
+
318
+ const updatePlayerInfo = (e):void => {
319
+ e.preventDefault();
320
+ if (differencesExist == true && isValid == true) {
321
+ window.postMessage({ type: 'UpdatePlayerInfo', provisionalArray }, window.location.href);
322
+ window.postMessage({ type: 'UpdatePlayerConsent', consentArray }, window.location.href);
323
+ }
324
+ }
325
+
326
+ const toggleScreen = ():void => {
327
+ window.postMessage({type: 'PlayerAccountMenuActive', isMobile}, window.location.href);
328
+ }
329
+
330
+ const checkForChanges = ():void => {
331
+ provisionalArray = {
332
+ acceptNewsEmail: giveConsentEmail,
333
+ acceptSMSOffers: giveConsentSMS,
334
+ address: playerAddress.value,
335
+ city: playerCity.value,
336
+ mobileNumber: playerMobileNumber,
337
+ mobilePrefix: playerPrefix,
338
+ postalCode: playerPostalCode.value,
339
+ securityAnswer: playerAnswer,
340
+ securityQuestion: playerQuestion,
341
+ }
342
+
343
+ checkEquality(provisionalArray, initialValuesArray);
344
+ consentData();
345
+ checkIsValid();
346
+ }
347
+
348
+ const consentData = ():void => {
349
+ consentArray = { items: [] };
350
+ if (showSMS) {
351
+ consentArray.items.push({'tagCode': 'sms', 'status': giveConsentSMS ? 'Accepted' : 'Denied'})
352
+ }
353
+
354
+ if (showEmail) {
355
+ consentArray.items.push({'tagCode': 'emailmarketing', 'status': giveConsentEmail ? 'Accepted' : 'Denied'})
356
+ }
357
+ }
358
+
359
+ const resetPlayerInfo = ():void => {
360
+ playerAddress.value = initialValuesArray.address;
361
+ playerCity.value = initialValuesArray.city;
362
+ giveConsentEmail = initialValuesArray.acceptNewsEmail;
363
+ giveConsentSMS = initialValuesArray.acceptSMSOffers;
364
+ playerPrefix = initialValuesArray.mobilePrefix;
365
+ playerMobileNumber = initialValuesArray.mobileNumber;
366
+ playerPostalCode.value = initialValuesArray.postalCode;
367
+ playerAnswer = initialValuesArray.securityAnswer;
368
+ playerQuestion = initialValuesArray.securityQuestion;
369
+
370
+ toggleScreen();
371
+ }
372
+
373
+ const checkEquality = (a, b):void => {
374
+ if(JSON.stringify(a) === JSON.stringify(b)) {
375
+ differencesExist = false;
376
+ } else {
377
+ differencesExist = true;
378
+ }
379
+ }
380
+
381
+ const setActiveLanguage = ():void => {
382
+ setLocale(lang);
383
+ }
384
+
385
+ onMount(() => {
386
+ window.addEventListener('message', messageHandler, false);
387
+
388
+ isOnNative = !!isNative(userAgent);
389
+
390
+ if (isOnNative) {
391
+ registerNativeEventListener(
392
+ 'BIOMETRICS_ENABLED',
393
+ (biometricsEnabled) => {
394
+ biometricsSelection = !!biometricsEnabled
395
+ },
396
+ );
397
+
398
+ callNative('BIOMETRICS_ENABLED');
399
+ }
400
+
401
+ return () => {
402
+ window.removeEventListener('message', messageHandler);
403
+ }
404
+ });
405
+
406
+ $: lang && setActiveLanguage();
407
+ $: endpoint && countrycode && getCountriesList();
408
+ $: endpoint && getPhoneCodes();
409
+ </script>
410
+
411
+ {#if isLoading}
412
+ <div class="ModalLoader" part="ModalLoader"></div>
413
+ {:else}
414
+ <form class="PlayerInfoWrapper {isMobile ? 'PlayerInfoWrapperMobile' : ''} {mediaQuery.matches && isMobile ? 'PlayerInfoWrapperTablet' : ''}" part="PlayerInfoWrapper {isMobile ? 'PlayerInfoWrapperMobile' : ''} {mediaQuery.matches && isMobile ? 'PlayerInfoWrapperTablet' : ''}">
415
+
416
+ {#if isMobile}
417
+ <div class="MenuReturnButton" part="MenuReturnButton" on:click={() => toggleScreen()}>
418
+ <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15"><defs><style>.aaa{fill:var(--emfe-w-color-primary, #D0046C);}</style></defs><g transform="translate(-20 -158)">
419
+ <g transform="translate(20 158)">
420
+ <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)"/>
421
+ </g></g>
422
+ </svg>
423
+ <h2 class="MyAccountCategoryTitleMobile" part="MyAccountCategoryTitleMobile">{$_('playerProfile.title')}</h2>
424
+ </div>
425
+ {/if}
426
+
427
+ <h2 class="MyAccountCategoryTitle {isMobile ? 'MyAccountCategoryTitleNone' : ''}" part="MyAccountCategoryTitle {isMobile ? 'MyAccountCategoryTitleNone' : ''}">{$_('playerProfile.title')}</h2>
428
+
429
+ <div class="PlayerNotificationsHeader" part="PlayerNotificationsHeader">
430
+ <h3>{$_('playerProfile.personalDetails')}</h3>
431
+ </div>
432
+ <section class="PlayerDetailsContent" part="PlayerDetailsContent">
433
+ <div class="PlayerInfoBox" part="PlayerInfoBox">
434
+ <label>{$_('playerProfile.userName')}</label>
435
+ <input type="text" class="FieldDisabled" part="FieldDisabled" value={username} readonly />
436
+ </div>
437
+ <div class="PlayerInfoBox {invalidMobile ? 'InvalidField' : ''}" part="PlayerInfoBox {invalidMobile ? 'InvalidField' : ''}">
438
+ <label>{$_('playerProfile.userPhone')}</label>
439
+ <div class="PlayerPhoneNumber" part="PlayerPhoneNumber">
440
+ <select bind:value={playerPrefix} on:change={() => checkForChanges()}>
441
+ {#each prefixesArray as pref}
442
+ {#if pref.Prefix === initialValuesArray.mobiePrefix}
443
+ <option selected>{pref.Prefix}</option>
444
+ {:else}
445
+ <option>{pref.Prefix}</option>
446
+ {/if}
447
+ {/each}
448
+ </select>
449
+ <input bind:value={playerMobileNumber} on:keyup={validateMobile} type="text" oninput="this.value = this.value.replace(/[^0-9.]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');" placeholder={noPlayerData ? mobile.number : ''} on:keyup={() => checkForChanges()}/>
450
+ </div>
451
+ {#if invalidMobile}
452
+ <p class="InvalidInput" part="InvalidInput">{$_('playerProfile.userPhoneError')}</p>
453
+ {/if}
454
+ </div>
455
+ <div class="PlayerInfoBox {invalidSecurityQuestion ? 'InvalidField' : ''}" part="PlayerInfoBox {invalidSecurityQuestion ? 'InvalidField' : ''}">
456
+ <label>{$_('playerProfile.securityQuestion')}</label>
457
+ <input type="text" bind:value={playerQuestion} on:keyup={() => checkForChanges()} on:blur={validateSecurityQuestion} placeholder={noPlayerData ? securityQuestion : ''} />
458
+ {#if invalidSecurityQuestion}
459
+ <p class="InvalidInput" part="InvalidInput">{$_('playerProfile.securityQuestionError')}</p>
460
+ {/if}
461
+ </div>
462
+ <div class="PlayerInfoBox {invalidSecurityAnswer ? 'InvalidField' : ''}" part="PlayerInfoBox {invalidSecurityAnswer ? 'InvalidField' : ''}">
463
+ <label>{$_('playerProfile.securityAnswer')}</label>
464
+ <input type="text" bind:value={playerAnswer} on:keyup={() => checkForChanges()} on:blur={validateSecurityAnswer} placeholder={noPlayerData ? securityAnswer : ''} />
465
+ {#if invalidSecurityAnswer}
466
+ <p class="InvalidInput" part="InvalidInput">{$_('playerProfile.securityAnswerError')}</p>
467
+ {/if}
468
+ </div>
469
+ <div class="PlayerInfoBox" part="PlayerInfoBox">
470
+ <label>{$_('playerProfile.userEmail')}</label>
471
+ <input type="email" class="FieldDisabled" part="FieldDisabled" value={email} readonly />
472
+ </div>
473
+ <div class="PlayerInfoBox" part="PlayerInfoBox">
474
+ <label>{$_('playerProfile.dateOfBirth')}</label>
475
+ <input type="text" class="FieldDisabled" part="FieldDisabled" value={birth} readonly />
476
+ </div>
477
+ <div class="PlayerInfoBox" part="PlayerInfoBox">
478
+ <label>{$_('playerProfile.firstName')}</label>
479
+ <input type="text" class="FieldDisabled" part="FieldDisabled" value={firstname} readonly />
480
+ </div>
481
+ <div class="PlayerInfoBox" part="PlayerInfoBox">
482
+ <label>{$_('playerProfile.lastName')}</label>
483
+ <input type="text" class="FieldDisabled" part="FieldDisabled" value={lastname} readonly />
484
+ </div>
485
+ <div class="PlayerInfoBox" part="PlayerInfoBox">
486
+ <label>{$_('playerProfile.userTitle')}</label>
487
+ <input type="text" class="FieldDisabled" part="FieldDisabled" value={userTitles} readonly />
488
+ </div>
489
+ <div class="PlayerInfoBox" part="PlayerInfoBox">
490
+ <label>{$_('playerProfile.currency')}</label>
491
+ <input type="text" class="FieldDisabled" part="FieldDisabled" value={currency} readonly />
492
+ </div>
493
+ </section>
494
+
495
+ <div class="PlayerLocationHeader" part="PlayerLocationHeader">
496
+ <h3>{$_('playerProfile.locationDetails')}</h3>
497
+ </div>
498
+ <section class="PlayerLocationContent" part="PlayerLocationContent">
499
+ <div class="PlayerInfoBox" part="PlayerInfoBox">
500
+ <label>{$_('playerProfile.userCountry')}</label>
501
+ <input type="text" class="PlayerCountry FieldDisabled" part="PlayerCountry FieldDisabled" placeholder={countrycode} value={selectedCountry.Name} readonly />
502
+ </div>
503
+ <div class="PlayerInfoBox {invalidCity ? 'InvalidField' : ''}" part="PlayerInfoBox {invalidCity ? 'InvalidField' : ''}">
504
+ <label>{$_('playerProfile.userCity')}</label>
505
+ <input bind:this={playerCity} type="text" on:blur={validateCity} on:keyup={() => checkForChanges()} placeholder={noPlayerData ? city : ''} value={noPlayerData ? '' : initialValuesArray.city} />
506
+ {#if invalidCity}
507
+ <p class="InvalidInput" part="InvalidInput">{$_('playerProfile.userCityError')}</p>
508
+ {/if}
509
+ </div>
510
+ <div class="PlayerInfoBox {invalidAddress ? 'InvalidField' : ''}" part="PlayerInfoBox {invalidAddress ? 'InvalidField' : ''}">
511
+ <label>{$_('playerProfile.userAddress')}</label>
512
+ <input bind:this={playerAddress} placeholder={address1} type="text" on:blur={validateAddress} on:keyup={() => checkForChanges()} value={noPlayerData ? '' : initialValuesArray.address} />
513
+ {#if invalidAddress}
514
+ <p class="InvalidInput" part="InvalidInput">{$_('playerProfile.userAddressError')}</p>
515
+ {/if}
516
+ </div>
517
+ <div class="PlayerInfoBox {invalidPostalCode ? 'InvalidField' : ''}" part="PlayerInfoBox {invalidPostalCode ? 'InvalidField' : ''}">
518
+ <label>{$_('playerProfile.userPostalCode')}</label>
519
+ <input bind:this={playerPostalCode} type="text" on:blur={validatePostalCode} on:keyup={() => checkForChanges()} placeholder={noPlayerData ? postalCode : ''} value={noPlayerData ? '' : initialValuesArray.postalCode} />
520
+ {#if invalidPostalCode}
521
+ <p class="InvalidInput" part="InvalidInput">{$_('playerProfile.userPostalCodeError')}</p>
522
+ {/if}
523
+ </div>
524
+ </section>
525
+
526
+ {#if showEmail || showSMS}
527
+ <div class="PlayerNotificationsHeader" part="PlayerNotificationsHeader">
528
+ <h3>{$_('playerProfile.userNotifications')}</h3>
529
+ </div>
530
+ <section class="PlayerNotificationsCheckboxArea" part="PlayerNotificationsCheckboxArea">
531
+ {#if showSMS}
532
+ <div class="PlayerNotificationBox" part="PlayerNotificationBox">
533
+ <label for="SMSNotification">
534
+ <input bind:checked={giveConsentSMS} on:change={checkForChanges} type="checkbox" id="SMSNotification" name="Enable SMS notifications" />
535
+ <span class="Checkmark" part="Checkmark"></span>
536
+ <span>{$_('playerProfile.userSMSNotification')}</span>
537
+ </label>
538
+ </div>
539
+ {/if}
540
+ {#if showEmail}
541
+ <div class="PlayerNotificationBox" part="PlayerNotificationBox">
542
+ <label for="EmailNotification">
543
+ <input bind:checked={giveConsentEmail} on:change={checkForChanges} type="checkbox" id="EmailNotification" name="Enable Emails" />
544
+ <span class="Checkmark" part="Checkmark"></span>
545
+ <span>{$_('playerProfile.userEmailNotification')}</span>
546
+ </label>
547
+ </div>
548
+ {/if}
549
+ </section>
550
+ {/if}
551
+ {#if isOnNative}
552
+ <div class="PlayerNotificationsHeader" part="PlayerNotificationsHeader">
553
+ <h3>{$_('playerProfile.userAppSettings')}</h3>
554
+ </div>
555
+ <section class="PlayerNotificationsCheckboxArea" part="PlayerNotificationsCheckboxArea">
556
+ <div class="PlayerNotificationBox" part="PlayerNotificationBox">
557
+ <label for="Biometrics">
558
+ <input bind:checked={biometricsSelection} on:change={checkForChanges} type="checkbox" id="BiometricsEnabled" name="Biometric Enabled" />
559
+ <span class="Checkmark" part="Checkmark"></span>
560
+ <span>{$_('playerProfile.userBiometrics')}</span>
561
+ </label>
562
+ </div>
563
+ </section>
564
+ {/if}
565
+ <section class="PlayerDetailsButtonsArea {isMobile ? 'PlayerDetailsButtonsAreaMobile' : ''}" part="PlayerDetailsButtonsArea {isMobile ? 'PlayerDetailsButtonsAreaMobile' : ''}">
566
+ <button class="PlayerDetailsSaveButton {differencesExist && isValid ? '' : 'PlayerButtonDisabled'}" part="PlayerDetailsSaveButton {differencesExist && isValid ? '' : 'PlayerButtonDisabled'}" on:click={(e) => updatePlayerInfo(e)}>{$_('playerProfile.userProfileSaveChanges')}</button>
567
+ </section>
568
+ {#if showConfirmSave}
569
+ <section class="PlayerDetailsConfirmSave" part="PlayerDetailsConfirmSave">
570
+ <p class="PlayerDetailsConfirmSaveText" part="PlayerDetailsConfirmSaveText">{$_('playerProfile.userProfileConfirmationMessage')}</p>
571
+ </section>
572
+ {/if}
573
+ </form>
574
+ {/if}
575
+
576
+ <style lang="scss">
577
+
578
+ :host {
579
+ font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
580
+ }
581
+
582
+ .MyAccountCategoryTitle {
583
+ font-size: 26px;
584
+ color: var(--emfe-w-color-primary, #D0046C);
585
+ font-weight: 400;
586
+ }
587
+
588
+ .MyAccountCategoryTitleMobile {
589
+ font-size: 16px;
590
+ color: var(--emfe-w-color-primary, #D0046C);
591
+ }
592
+
593
+ .MyAccountCategoryTitleNone {
594
+ display: none;
595
+ }
596
+
597
+ .PlayerInfoWrapper {
598
+ color: var(--emfe-w-color-contrast, #07072A);
599
+ background: var(--emfe-w-color-gray-50, #F9F8F8);
600
+ padding: 50px;
601
+ max-width: 760px;
602
+ }
603
+
604
+ .PlayerNotificationsHeader, .PlayerDetailsHeader, .PlayerLocationHeader {
605
+ h3 {
606
+ font-size: 16px;
607
+ color: var(--emfe-w-color-primary, #D0046C);
608
+ text-transform: capitalize;
609
+ font-weight: 400;
610
+ }
611
+ }
612
+
613
+ .PlayerDetailsContent {
614
+ display: grid;
615
+ grid-column-gap: 50px;
616
+ grid-row-gap: 24px;
617
+ grid-template-rows: auto;
618
+ grid-template-columns: 1fr 1fr;
619
+ padding-bottom: 30px;
620
+ }
621
+
622
+ .MenuReturnButton{
623
+ color: var(--emfe-w-color-gray-300, #58586B);
624
+ display: inline-flex;
625
+ align-items: center;
626
+ column-gap: 10px;
627
+ margin-bottom: 10px;
628
+ }
629
+
630
+ .PlayerInfoBox {
631
+ display: flex;
632
+ flex-direction: column;
633
+ label {
634
+ font-size: 14px;
635
+ font-weight: 300;
636
+ margin-bottom: 10px;
637
+ }
638
+ input {
639
+ font-size: 14px;
640
+ font-weight: 300;
641
+ color: var(--emfe-w-color-contrast, #07072A);
642
+ padding: 10px;
643
+ line-height: 16px;
644
+ background: var(--emfe-w-color-white, #FFFFFF);
645
+ border: 1px solid var(--emfe-w-color-gray-100, #E6E6E6);
646
+ border-radius: 5px;
647
+ outline: none;
648
+ transition-duration: 0.3s;
649
+ &:focus, :focus-within, :focus-visible, :visited {
650
+ border: 1px solid var(--emfe-w-color-primary, #D0046C);
651
+ box-shadow: 0 0 0 1pt var(--emfe-w-color-primary, #D0046C);
652
+ }
653
+ }
654
+
655
+ &.InvalidField {
656
+ input {
657
+ border: 1px solid var(--emfe-w-color-error, #FD2839);
658
+ background: var(--emfe-w-color-primary-50, #FBECF4);
659
+ color: var(--emfe-w-color-error, #FD2839);
660
+ }
661
+ }
662
+
663
+ .InvalidInput {
664
+ color: var(--emfe-w-color-error, #FD2839);
665
+ font-size: 10px;
666
+ line-height: 10px;
667
+ }
668
+
669
+
670
+ .FieldDisabled {
671
+ opacity: 0.5;
672
+ }
673
+ .PlayerPhoneNumber {
674
+ display: grid;
675
+ grid-template-columns: 2fr 4fr;
676
+ column-gap: 10px;
677
+ position: relative;
678
+ }
679
+ select {
680
+ font-size: 14px;
681
+ font-weight: 300;
682
+ padding: 10px;
683
+ color: var(--emfe-w-color-contrast, #07072A);
684
+ border: 1px solid var(--emfe-w-color-gray-100, #E6E6E6);
685
+ border-radius: 5px;
686
+ outline: none;
687
+ transition-duration: 0.3s;
688
+ -webkit-appearance: none;
689
+ -moz-appearance: none;
690
+ appearance: none;
691
+ background: url("data:image/svg+xml,<svg height='10px' width='10px' viewBox='0 0 16 16' fill='%23000000' xmlns='http://www.w3.org/2000/svg'><path d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/></svg>") no-repeat var(--emfe-w-color-white, #FFFFFF);
692
+ background-position: calc(100% - 0.75rem) center;
693
+ &:focus, :focus-within, :focus-visible, :visited {
694
+ border: 1px solid var(--emfe-w-color-primary, #D0046C);
695
+ box-shadow: 0 0 0 1pt var(--emfe-w-color-primary, #D0046C);
696
+ }
697
+ }
698
+ /* Chrome, Safari, Edge, Opera */
699
+ input::-webkit-outer-spin-button,
700
+ input::-webkit-inner-spin-button {
701
+ -webkit-appearance: none;
702
+ margin: 0;
703
+ }
704
+
705
+ /* Firefox */
706
+ input[type=number] {
707
+ -moz-appearance: textfield;
708
+ }
709
+ }
710
+
711
+ .PlayerLocationContent {
712
+ display: grid;
713
+ grid-column-gap: 50px;
714
+ grid-row-gap: 24px;
715
+ grid-template-rows: auto;
716
+ grid-template-columns: 1fr 1fr;
717
+ padding-bottom: 30px;
718
+ }
719
+
720
+ .PlayerNotificationBox {
721
+ &:first-child {
722
+ margin-bottom: 10px;
723
+ }
724
+ label {
725
+ display: inline-flex;
726
+ position: relative;
727
+ align-items: center;
728
+ span {
729
+ font-size: 14px;
730
+ font-weight: 300;
731
+ }
732
+ input {
733
+ height: 20px;
734
+ width: 20px;
735
+ -webkit-appearance: none;
736
+ -moz-appearance: none;
737
+ -o-appearance: none;
738
+ appearance: none;
739
+ border-radius: 50px;
740
+ outline: none;
741
+ transition-duration: 0.3s;
742
+ background-color: var(--emfe-w-color-gray-100, #E6E6E6);
743
+ cursor: pointer;
744
+ margin-right: 10px;
745
+ }
746
+ input:checked {
747
+ background-color: var(--emfe-w-color-primary, #D0046C);
748
+ }
749
+ .Checkmark {
750
+ left: 10px;
751
+ top: 7px;
752
+ width: 4px;
753
+ height: 8px;
754
+ border: solid white;
755
+ border-width: 0 2px 2px 0;
756
+ -webkit-transform: rotate(45deg);
757
+ -ms-transform: rotate(45deg);
758
+ transform: rotate(45deg);
759
+ position: absolute;
760
+ }
761
+ }
762
+ }
763
+
764
+ .PlayerDetailsButtonsArea {
765
+ grid-column-gap: 10px;
766
+ grid-template-rows: auto;
767
+ grid-template-columns: 1fr;
768
+ margin-top: 20px;
769
+ width: 50%;
770
+
771
+ .PlayerDetailsSaveButton, .PlayerDetailsCancelButton {
772
+ cursor: pointer;
773
+ border-radius: 5px;
774
+ width: 100%;
775
+ height: 50px;
776
+ display: flex;
777
+ align-items: center;
778
+ justify-content: center;
779
+ font-size: 16px;
780
+ color: var(--emfe-w-color-contrast, #07072A);
781
+ text-transform: uppercase;
782
+ transition-duration: 0.3s;
783
+ box-sizing: border-box;
784
+ }
785
+ .PlayerDetailsSaveButton {
786
+ background: var(--emfe-w-color-primary, #D0046C);
787
+ border: 1px solid var(--emfe-w-color-primary, #D0046C);
788
+ color: var(--emfe-w-color-white, #FFFFFF);
789
+ &:active {
790
+ background: var(--emfe-w-color-primary-600, #99034F);
791
+ }
792
+ &.PlayerButtonDisabled {
793
+ opacity: 0.3;
794
+ cursor: not-allowed;
795
+ }
796
+ }
797
+
798
+ .PlayerDetailsCancelButton {
799
+ background: transparent;
800
+ border: 1px solid var(--emfe-w-color-gray-300, #58586B);
801
+ &:active {
802
+ background: var(--emfe-w-color-primary-600, #99034F);
803
+ }
804
+ &.PlayerButtonDisabled {
805
+ background: transparent;
806
+ border: 1px solid var(--emfe-w-color-gray-300, #58586B);
807
+ cursor: not-allowed;
808
+ opacity: 0.6;
809
+ }
810
+ }
811
+ &.PlayerDetailsButtonsAreaMobile {
812
+ width: 100%;
813
+ grid-template-columns: 1fr 1fr;
814
+ .PlayerDetailsSaveButton, .PlayerDetailsCancelButton {
815
+ height: 40px;
816
+ font-size: 12px;
817
+ }
818
+ }
819
+ }
820
+
821
+ .PlayerNotificationsCheckboxArea {
822
+ padding-bottom: 30px;
823
+ }
824
+
825
+ .PlayerInfoWrapperMobile {
826
+ padding: 20px 15px;
827
+ background: var(--emfe-w-color-gray-50, #F9F8F8);
828
+ max-width: unset;
829
+ .PlayerDetailsContent {
830
+ grid-template-columns: 1fr;
831
+ }
832
+ .PlayerNotificationsHeader, .PlayerDetailsHeader, .PlayerLocationHeader {
833
+ h3 {
834
+ color: var(--emfe-w-color-primary, #D0046C);
835
+ font-size: 14px;
836
+ font-weight: 400;
837
+ }
838
+ }
839
+ .PlayerInfoBox {
840
+ label {
841
+ color: var(--emfe-w-color-gray-300, #58586B);
842
+ font-size: 12px;
843
+ font-weight: 400;
844
+ }
845
+ input {
846
+ color: var(--emfe-w-color-gray-300, #58586B);
847
+ font-size: 12px;
848
+ font-weight: 300;
849
+ }
850
+ select {
851
+ color: var(--emfe-w-color-gray-300, #58586B);
852
+ }
853
+ }
854
+ .PlayerLocationContent {
855
+ grid-template-columns: 1fr;
856
+ }
857
+ .PlayerNotificationsCheckboxArea {
858
+ .PlayerNotificationBox {
859
+ label {
860
+ color: var(--emfe-w-color-contrast, #07072A);
861
+ font-size: 12px;
862
+ font-weight: 300;
863
+ }
864
+ }
865
+ }
866
+ .PlayerDetailsButtonsArea {
867
+ grid-column-gap: 10px;
868
+ }
869
+ .PlayerDetailsSaveButton, .PlayerDetailsCancelButton {
870
+ font-size: 12px;
871
+ height: 40px;
872
+ color: var(--emfe-w-color-white, #FFFFFF);
873
+ &.PlayerButtonDisabled {
874
+ color: var(--emfe-w-color-gray-300, #58586B);
875
+ }
876
+ }
877
+ .PlayerDetailsCancelButton {
878
+ color: var(--emfe-w-color-gray-300, #58586B);
879
+ }
880
+ }
881
+
882
+ .PlayerInfoWrapperTablet {
883
+ padding: 40px 25% 40px 25%;
884
+ .PlayerDetailsContent {
885
+ grid-row-gap: 20px;
886
+ }
887
+ .MenuReturnButton {
888
+ margin-bottom: 30px;
889
+ span {
890
+ font-size: 20px;
891
+ }
892
+ }
893
+ .PlayerDetailsHeader, .PlayerLocationHeader, .PlayerNotificationsHeader {
894
+ h3 {
895
+ font-size: 24px;
896
+ }
897
+ }
898
+ .PlayerInfoBox {
899
+ label {
900
+ font-size: 20px;
901
+ }
902
+ input {
903
+ height: 30px;
904
+ font-size: 20px;
905
+ line-height: 30px;
906
+ }
907
+ select {
908
+ font-size: 20px;
909
+ }
910
+ .TogglePasswordVisibility {
911
+ width: 30px;
912
+ top: 26px;
913
+ }
914
+ .InvalidInput {
915
+ font-size: 16px;
916
+ bottom: - 50px;
917
+ }
918
+ &:last-child {
919
+ .InvalidInput {
920
+ font-size: 16px;
921
+ bottom: -50px;
922
+ }
923
+ }
924
+ }
925
+ .PlayerDetailsButtonsArea {
926
+ grid-column-gap: 40px;
927
+ .PlayerDetailsSaveButton, .PlayerDetailsCancelButton {
928
+ font-size: 20px;
929
+ height: 56px;
930
+ }
931
+ .PlayerDetailsSaveButton {
932
+ color: var(--emfe-w-color-white, #FFFFFF);
933
+ &.PlayerButtonDisabled {
934
+ color: var(--emfe-w-color-gray-300, #58586B);
935
+ }
936
+ }
937
+ }
938
+ .PlayerNotificationBox {
939
+ label {
940
+ span {
941
+ font-size: 20px;
942
+ }
943
+ input {
944
+ height: 26px;
945
+ width: 26px;
946
+ }
947
+ .Checkmark {
948
+ left: 50px;
949
+ top: 9px;
950
+ }
951
+ }
952
+ }
953
+ }
954
+ .PlayerDetailsConfirmSave {
955
+ background: var(--emfe-w-color-green, #48952a);
956
+ color: var(--emfe-w-color-white, #FFFFFF);
957
+ padding: 16px;
958
+ border-radius: 5px;
959
+ margin-top: 16px;
960
+ .PlayerDetailsConfirmSaveText {
961
+ padding: 0;
962
+ margin: 0;
963
+ }
964
+ }
965
+ </style>