@everymatrix/player-profile-info 1.0.16 → 1.0.70

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