@everymatrix/casino-page 1.3.4 → 1.4.1

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.
@@ -20,6 +20,8 @@
20
20
  import '@everymatrix/casino-favorites-section';
21
21
  import '@everymatrix/casino-last-played-section';
22
22
  import '@everymatrix/casino-most-played-section';
23
+ import '@everymatrix/casino-my-games';
24
+ import '@everymatrix/casino-search';
23
25
 
24
26
  export let endpoint:string = '';
25
27
  export let datasource:string = '';
@@ -79,6 +81,8 @@
79
81
  export let positioncollections:string = '';
80
82
  export let type:string = '';
81
83
  export let titletype:string = '';
84
+ export let casinomygames:string = 'false';
85
+ export let collectionprovidersgamenames:string = '';
82
86
 
83
87
  // Button icon for random game widget
84
88
  export let randombuttonicon:string = '';
@@ -107,24 +111,18 @@
107
111
  let timerInterval:any;
108
112
 
109
113
  // CasinoPage state
110
- let favoritesScreen:boolean = false;
114
+ let myGamesSection:boolean = false;
111
115
  let recentSearches:boolean = false;
112
- let initialLoaded:boolean = true;
113
116
  let searched:boolean = false;
114
- let gameFocus:boolean = false;
115
- let lobbyViewAux:boolean = false;
116
- let closeSearch:boolean = false;
117
117
  let searchFocus:boolean = false;
118
118
  let lobbyScreen:boolean = true;
119
119
  let mostPlayedScreen:boolean = false;
120
120
  let lastPlayedScreen:boolean = false;
121
121
  let adjustingScroll:boolean = false;
122
- let searchBarCleared:boolean = true;
122
+ let searchIsOn:boolean = false;
123
123
 
124
124
  // Needs to be checked if there are relevant
125
- let gamesArray = [];
126
125
  let searchArray:Array<CasinoItems>;
127
- let categories:Array<CategoriesItems> = [];
128
126
  let shownCategories:Array<CategoriesItems> = [];
129
127
  let activeCategory:string;
130
128
  let allCategoriesIds:string[] = [];
@@ -148,17 +146,12 @@
148
146
  let searchElement:HTMLElement;
149
147
  let mobileSearchViewActive:boolean = false;
150
148
  let searchedValues:any = [];
151
- let mostPlayedValues:any = [];
152
- let lastPlayedValues:any = [];
153
- let filterVendorsArray:Array<Object> = [];
154
149
  let numberOfFilters:number = 0;
155
- let filteredGamesArray:Array<Object> = [];
156
150
  let currentCategoryId:string = '';
157
- let activeCategoryAux:any = undefined;
158
151
  let customStylingContainer:HTMLElement;
159
- let urlCasino:any;
160
152
  let firstLoad:boolean = false;
161
153
 
154
+
162
155
  setupI18n({ withLocale: 'en', translations: {}});
163
156
 
164
157
  const setTranslationUrl = ():void => {
@@ -182,6 +175,7 @@
182
175
  searched = false;
183
176
  searchValue = '';
184
177
  scrollTop = true;
178
+ casinomygames = 'false';
185
179
  // needs to be executed after the page has been populated
186
180
  setTimeout(() => {
187
181
  window.postMessage({ type: 'WidgetTopReference', scrollTop }, window.location.href);
@@ -189,15 +183,24 @@
189
183
  switch(categoryEvent.data.itemId) {
190
184
  case 'LOBBY':
191
185
  lobbyScreen = true;
192
- favoritesScreen = false;
186
+ myGamesSection = false;
193
187
  activeCategory = '';
194
188
  mostPlayedScreen = false;
195
189
  lastPlayedScreen = false;
196
190
  break;
197
191
 
192
+ case 'MYGAMES':
193
+ casinomygames = 'true';
194
+ lobbyScreen = false;
195
+ myGamesSection = true;
196
+ mostPlayedScreen = false;
197
+ lastPlayedScreen = false;
198
+ activeCategory = '';
199
+ break;
200
+
198
201
  case 'FAVORITES':
199
202
  lobbyScreen = false;
200
- favoritesScreen = true;
203
+ myGamesSection = true;
201
204
  mostPlayedScreen = false;
202
205
  lastPlayedScreen = false;
203
206
  activeCategory = '';
@@ -207,7 +210,7 @@
207
210
  if (mostplayed == 'true') {
208
211
  activeCategory = '';
209
212
  lobbyScreen = false;
210
- favoritesScreen = false;
213
+ myGamesSection = true;
211
214
  mostPlayedScreen = true;
212
215
  }
213
216
  break;
@@ -217,14 +220,14 @@
217
220
  activeCategory = '';
218
221
  lobbyScreen = false;
219
222
  lastPlayedScreen = true;
220
- favoritesScreen = false;
223
+ myGamesSection = true;
221
224
  mostPlayedScreen = false;
222
225
  }
223
226
  break;
224
227
 
225
228
  default:
226
229
  lobbyScreen = false;
227
- favoritesScreen = false;
230
+ myGamesSection = false;
228
231
  mostPlayedScreen = false;
229
232
  lastPlayedScreen = false;
230
233
  activeCategory = categoryEvent.data.itemId;
@@ -242,9 +245,9 @@
242
245
  if (e.data) {
243
246
  switch(e.data.type) {
244
247
  // @TODO: removed and tested, but kept in case unforeseen issues occur - reason: multiple calls on category change
245
- // case 'CategoryChange':
246
- // CategoryChangeHandler(e);
247
- // break;
248
+ case 'CategoryChange':
249
+ CategoryChangeHandler(e);
250
+ break;
248
251
 
249
252
  case 'UserSessionID':
250
253
  sessionID = e.data.session;
@@ -269,10 +272,6 @@
269
272
  }
270
273
  break;
271
274
 
272
- case 'SearchedItemClicked':
273
- addSearchedItem(e.data.gameId);
274
- break;
275
-
276
275
  case 'UpdateFilters':
277
276
  updateFilters(e.data.vendorsArray);
278
277
  setFilterNumberValue();
@@ -293,42 +292,24 @@
293
292
  setFilterNumberValue();
294
293
  break;
295
294
 
296
- case 'GameHoveredPc':
297
- gameFocus = true;
298
- break;
299
-
300
- case 'GameBlurPc':
301
- if(activeRecentSearches){
302
- searchElement.focus();
303
- gameFocus = false;
304
- } else {
305
- gameFocus = false;
306
- }
307
- break;
308
-
309
- case 'GameHoveredMobile':
310
- gameFocus = true;
311
- break;
295
+ case "searchCancelled":
296
+ searchIsOn = false;
297
+ break;
312
298
 
313
- case 'GameBlurMobile':
314
- if(activeRecentSearches){
315
- onBlur();
316
- } else {
317
- gameFocus = false;
318
- }
319
- break;
299
+ case "searchActive":
300
+ searchIsOn = true;
301
+ break;
320
302
 
321
303
  case 'ModalClosed':
322
304
  if(activeRecentSearches){
323
305
  activeRecentSearches = false;
324
- gameFocus = false;
325
306
  }
326
307
  break;
327
308
 
328
309
  case 'SubgroupsIds':
329
310
  //Add subgroups ids fetched in the slider to the list of categories ids
330
311
  if(!allCategoriesIds.some(categoryId => e.data.subGroupsIds.includes(categoryId))) {
331
- allCategoriesIds.push(...e.data.subGroupsIds);
312
+ allCategoriesIds.push(...e.data.subGroupsIds);
332
313
  }
333
314
  break;
334
315
 
@@ -363,9 +344,6 @@
363
344
  }
364
345
  return receivedFavoriteResults;
365
346
  }).then((favResults) => {
366
- if (favoritesScreen) {
367
- showFavoriteGames();
368
- }
369
347
  return favResults;
370
348
  }).catch((err:any) => {
371
349
  console.error(err);
@@ -387,10 +365,6 @@
387
365
  .then((updatedArray:Object) => {
388
366
  receivedFavoriteResults = updatedArray;
389
367
 
390
- if (favoritesScreen) {
391
- showFavoriteGames();
392
- }
393
-
394
368
  if (receivedFavoriteResults) {
395
369
  window.postMessage({ type: "UpdateCategoryFavoriteGames", receivedFavoriteResults}, window.location.href);
396
370
  }
@@ -472,7 +446,7 @@
472
446
  const showFavoriteGames = () => {
473
447
  window.postMessage({ type: "ShowFavoriteSection", receivedFavoriteResults}, window.location.href);
474
448
  }
475
- //
449
+
476
450
  // --- END of Favorites section
477
451
  //
478
452
 
@@ -555,130 +529,6 @@
555
529
  }
556
530
  }
557
531
 
558
- const onFocus = () => {
559
- activeRecentSearches = true;
560
- if (endpoint && datasource && lang) {
561
- searchFocus = true;
562
-
563
- if (searchValue.length < 2) {
564
- let recentSearchedGames = getCookieValue(`searchedGamesWds_${lobbyid}`);
565
- let recentSearchedGamesArray:Array<any> = [];
566
-
567
- if (recentSearchedGames) {
568
- recentSearchedGamesArray = recentSearchedGames.split(',');
569
- }
570
-
571
- if (lobbyScreen == true && !initialLoaded) {
572
- lobbyViewAux = lobbyScreen;
573
- lobbyScreen = false;
574
- }
575
-
576
- let promises:Array<any> = [];
577
- let index = 0;
578
- let length = recentSearchedGamesArray.length;
579
-
580
- if (length > 0) {
581
- for (index = 0; index < length; index++) {
582
- let url:any = new URL(`${endpoint}/casino/games/${recentSearchedGamesArray[index]}`);
583
-
584
- url.searchParams.append('language', lang);
585
- url.searchParams.append('datasource', datasource);
586
- url.searchParams.append('platform', getDevice(userAgent));
587
-
588
- promises.push(getGame(url, recentSearchedGamesArray[index]));
589
- }
590
-
591
- Promise.all(promises).then((res:any) => {
592
- searchArray = res;
593
-
594
- sendRecentSearchData({}, searchArray)
595
- });
596
- } else {
597
- sendRecentSearchData({}, {})
598
- }
599
- }
600
- }
601
- //Analytics event
602
- if(typeof gtag == 'function'){
603
- gtag('event', 'SearchInitialized', {
604
- 'context': 'CasinoPage'
605
- });
606
- }
607
- }
608
-
609
- const onBlur = () => {
610
- searchFocus = false;
611
-
612
- if (searchValue.length < 2 && !gameFocus) {
613
- searched = false;
614
- searchArray = [];
615
- recentSearches = false;
616
- lobbyScreen = lobbyViewAux;
617
- lobbyViewAux = false;
618
- if (lobbyScreen === false) {
619
- window.postMessage({ type: 'CategoryUpdate', itemId: activeCategory }, window.location.href);
620
- }
621
-
622
- activeRecentSearches = false;
623
- window.postMessage({ type: 'OutOfRecentSearches' }, window.location.href);
624
- }
625
- }
626
-
627
- const addSearchedItem = (gameID:any) => {
628
- searchedValues = getCookieValue(`searchedGamesWds_${lobbyid}`);
629
-
630
- if (searchedValues) {
631
- searchedValues = searchedValues.split(',');
632
- } else {
633
- searchedValues = [];
634
- }
635
- if (searchedValues.indexOf(gameID) === -1) {
636
- let value;
637
-
638
- searchedValues.push(gameID);
639
- value = searchedValues.join(',');
640
- document.cookie = `searchedGamesWds_${lobbyid}=` + value;
641
- }
642
- }
643
-
644
- // @TODO let's do some small changes around here in order to have this search functionality pretty written, 'cuz right now is kinda shitty
645
- const searchValueChanged = () => {
646
- if (searchValue.length >= 2) {
647
- searchBarCleared = true;
648
- } else {
649
- searchBarCleared = false;
650
- }
651
- }
652
-
653
- $: searchValue && searchValueChanged();
654
-
655
- $: if (searchValue.length >= 2) {
656
- searched = true;
657
-
658
- let searchUrl:any = new URL(`${endpoint}/casino/games`);
659
-
660
- searchUrl.searchParams.append("datasource", datasource);
661
- searchUrl.searchParams.append("expand", "vendor");
662
- searchUrl.searchParams.append("platform", getDevice(userAgent));
663
- searchUrl.searchParams.append("language", lang);
664
- searchUrl.searchParams.append("pagination", "offset=0,limit=30");
665
- searchUrl.searchParams.append("filter", `name=${searchValue}`);
666
-
667
- getGames(searchUrl).then((searchData:any) => {
668
- searchArray = searchData;
669
-
670
- sendSearchData({}, searchData);
671
- });
672
- } else {
673
- if (!searchBarCleared) {
674
- onFocus();
675
- }
676
-
677
- if (initialLoaded) {
678
- initialLoaded = false;
679
- }
680
- }
681
-
682
532
  const setFilterNumberValue = () => {
683
533
  let vendors = JSON.parse(sessionStorage.getItem('vendorFiltersByCategory'));
684
534
 
@@ -693,19 +543,6 @@
693
543
  }
694
544
  }
695
545
 
696
- const searchActivated = () => {
697
- window.postMessage({ type: "scroll" }, window.location.href);
698
- }
699
-
700
- const clearSearchbar = () => {
701
- searchBarCleared = true;
702
- searchValue = '';
703
- searchArray = [];
704
- recentSearches = false;
705
-
706
- onBlur();
707
- }
708
-
709
546
  //
710
547
  // --- START of communication with other widgets
711
548
  //
@@ -717,18 +554,6 @@
717
554
  window.postMessage({ type: "UpdateSelectedVendorFilters", venArray}, window.location.href);
718
555
  }
719
556
 
720
- const sendRecentSearchData = (node:any, searchData:any) => {
721
- window.postMessage({ type: "RecentSearchData", searchData }, window.location.href);
722
- }
723
-
724
- const openFiltersModal = () => {
725
- window.postMessage({ type: "ShowFilterModal" }, window.location.href);
726
- }
727
-
728
- const clearVendorFilter = () => {
729
- window.postMessage({ type: "ClearVendorFilters" }, window.location.href);
730
- }
731
-
732
557
  const sendCategoryData = (node:any, categoryId:string) => {
733
558
  currentCategoryId = categoryId;
734
559
  window.postMessage({ type: `CategoryData_${categoryId}`, categoryId, visiblegames, receivedFavoriteResults }, window.location.href);
@@ -833,16 +658,6 @@
833
658
  }
834
659
  });
835
660
 
836
- if (getDevice(userAgent) !== 'PC') {
837
- searchElement.addEventListener('focusin', (event) => {
838
- mobileSearchViewActive = true;
839
- });
840
-
841
- searchElement.addEventListener('focusout', (event) => {
842
- mobileSearchViewActive = false;
843
- });
844
- }
845
-
846
661
  setFilterNumberValue();
847
662
 
848
663
  searchElementWrapper = searchWrapper;
@@ -859,7 +674,7 @@
859
674
  }
860
675
 
861
676
  const checkExistentCategory = ():void => {
862
- //Check if the active category is found in the list of available categories. IF not send event to the state manager.
677
+ //Check if the active category is found in the list of available categories. IF not send event to the state manager.
863
678
  if (allCategoriesIds && !allCategoriesIds.includes(decodeURI(activeCategory)) && activeCategory != '') {
864
679
  window.postMessage({type: 'NonExistentCategory'}, window.location.href);
865
680
  }
@@ -869,7 +684,7 @@
869
684
  isLoggedIn = true;
870
685
  sessionID = session;
871
686
  playerID = userid;
872
- if (playerID && playerID.length && sessionID && sessionID.length > 0) {
687
+ if (playerID && playerID.length && sessionID && sessionID.length > 0 && casinomygames != 'true') {
873
688
  getFavoredGames(endpoint, sessionID, playerID);
874
689
  }
875
690
  }
@@ -960,140 +775,22 @@
960
775
  <p class="SearchLoading" part="SearchLoading">{$_('casinoPage.500')}</p>
961
776
  {:else}
962
777
  <section class="CategoriesLobby" part="CategoriesLobby" style="max-width: {containermaxwidth}px;">
963
- {#if (getDevice(userAgent) !== 'PC') && (alternativesearch === 'false') && mobileSearchViewActive}
778
+ {#if (getDevice(userAgent) !== 'PC') && (alternativesearch === 'false')}
964
779
  <div class="SearchBarPlaceholder" part="SearchBarPlaceholder"></div>
965
780
  {/if}
966
781
 
967
- {#if alternativesearch === 'false'}
968
- <!-- main search layout -->
969
- <div bind:this={searchWrapper} class="CategoriesHeaderSection {(getDevice(userAgent) !== 'PC') ? 'CategoriesHeaderMobileSection' : ''} {mobileSearchViewActive ? 'SearchMobileActive' : ''} {mobileSearchViewActive || (searched && !(getDevice(userAgent) === 'PC') && !closeSearch) ? 'CategoriesHeaderSearchActive' : ''} {(adjustingScroll && mobileSearchViewActive) ? 'SearchStickTop' : ''}"
970
- style="top: {adjustingScroll && mobileSearchViewActive ? scrollOffset + 'px' : ''}"
971
- part="CategoriesHeaderSection {(getDevice(userAgent) !== 'PC') ? 'CategoriesHeaderMobileSection' : ''} {mobileSearchViewActive ? 'SearchMobileActive' : ''} {mobileSearchViewActive || (searched && !(getDevice(userAgent) === 'PC') && !closeSearch) ? 'CategoriesHeaderSearchActive' : ''} {(adjustingScroll && mobileSearchViewActive) ? 'SearchStickTop' : ''}">
972
- <div class="SearchContainer { (!lobbyScreen && !favoritesScreen && !mostPlayedScreen && !lastPlayedScreen && !lobbyViewAux) ? 'SearchTruncated' : ''}" part="SearchContainer { (!lobbyScreen && !favoritesScreen && !mostPlayedScreen && !lastPlayedScreen && !lobbyViewAux) ? 'SearchTruncated' : ''}">
973
- <label for="search" class="SrOnly" part="SrOnly">{$_('casinoPage.searchGames')}</label>
974
- <div class="SearchWrapper" part="SearchWrapper">
975
- {#if !mobileSearchViewActive}
976
- <div class="SearchIcon" part="SearchIcon">
977
- <svg role="presentation" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" aria-hidden="true">
978
- <path fill-rule="evenodd" d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z" clip-rule="evenodd" />
979
- </svg>
980
- </div>
981
- {/if}
982
- <input id="SearchField" class="SearchInput" part="SearchInput" on:focus={onFocus} on:blur={onBlur} bind:this={searchElement} bind:value={searchValue} placeholder="{(getDevice(userAgent) === 'PC') ? $_('casinoPage.search') : $_('casinoPage.searchMobile')}" type="search" on:focus={searchActivated} />
983
- {#if ((getDevice(userAgent) === 'PC') && searchValue.length) || (getDevice(userAgent) !== 'PC') }
984
- <span class="{(getDevice(userAgent) === 'PC') ? 'ClearSearchButton' : 'ClearSearchButtonMobile'}" part="{(getDevice(userAgent) === 'PC') ? 'ClearSearchButton' : 'ClearSearchButtonMobile'}" on:click="{() => clearSearchbar()}">
985
- <div class="CloseIconContainer" part="CloseIconContainer">
986
- <div class="CloseIconWrapper" part="CloseIconWrapper">
987
- <div class="CloseIcon" part="CloseIcon"></div>
988
- </div>
989
- </div>
990
- </span>
991
- {/if}
992
- </div>
993
- </div>
994
- {#if !favoritesScreen && !lobbyScreen && !mobileSearchViewActive && !mostPlayedScreen && !lastPlayedScreen && !recentSearches && !searched && !searchFocus && !lobbyViewAux}
995
- <div class="FiltersButtonsContainer" part="FiltersButtonsContainer">
996
- {#if numberOfFilters}
997
- <div class="ClearFilterButtonWrapper" part="ClearFilterButtonWrapper" on:click="{() => clearVendorFilter()}">
998
- <div class="ClearButton" part="ClearButton">{$_('casinoPage.clear')}
999
- <span class="ClearIcon" part="ClearIcon">
1000
- <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
1001
- viewBox="0 0 378.303 378.303" style="enable-background:new 0 0 378.303 378.303;" xml:space="preserve">
1002
- <polygon style="fill:var(--emfe-w-color-secondary, #FD2839);" points="378.303,28.285 350.018,0 189.151,160.867 28.285,0 0,28.285 160.867,189.151 0,350.018
1003
- 28.285,378.302 189.151,217.436 350.018,378.302 378.303,350.018 217.436,189.151 "/>
1004
- </svg>
1005
- </span>
1006
- </div>
1007
- </div>
1008
- {/if}
1009
- {#if !searched || !recentSearches}
1010
- {#if !mostPlayedScreen || !lastPlayedScreen}
1011
- <div class="FilterButtonWrapper" part="FilterButtonWrapper" on:click='{() => {openFiltersModal()}}'>
1012
- <div class="FilterButton" part="FilterButton">{$_('casinoPage.filters')}</div>
1013
- <div class="FilterIconContainer" part="FilterIconContainer">
1014
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 26 26"><defs><style>.a{fill:var(--emfe-w-color-white, #FFFFFF);}</style></defs><path class="a" d="M16.7,32.2a1.654,1.654,0,0,1-.636-.148,1.526,1.526,0,0,1-.867-1.393V20.578L5.433,10.588A1.543,1.543,0,0,1,5,9.491V7.742A1.512,1.512,0,0,1,6.5,6.2h23A1.512,1.512,0,0,1,31,7.742V9.491a1.543,1.543,0,0,1-.433,1.1L20.8,20.578v7.738a1.594,1.594,0,0,1-.52,1.156l-2.6,2.312A1.461,1.461,0,0,1,16.7,32.2ZM6.618,9.431l9.764,10.02a1.543,1.543,0,0,1,.433,1.1v9.813l2.34-2.075V20.519a1.543,1.543,0,0,1,.433-1.1L29.353,9.4V7.831H6.618Z" transform="translate(-5 -6.2)"/></svg>
1015
- <div class="NumberOfFiltersContainer" part="NumberOfFiltersContainer">
1016
- <span class="NumberOfFilters" part="NumberOfFilters">{numberOfFilters}</span>
1017
- </div>
1018
- </div>
1019
- </div>
1020
- {/if}
1021
- {/if}
1022
- </div>
1023
- {/if}
1024
- </div>
1025
- {:else}
1026
- <!-- start alternative search layout-->
1027
- <div bind:this={searchWrapper} class="CategoriesHeaderSection CategoriesHeaderSectionAltDesign {(getDevice(userAgent) !== 'PC') ? 'CategoriesHeaderMobileSection' : ''} {mobileSearchViewActive ? 'SearchMobileActive' : ''} {mobileSearchViewActive || (searched && !(getDevice(userAgent) === 'PC') && !closeSearch) ? 'CategoriesHeaderSearchActive' : ''}{(adjustingScroll && mobileSearchViewActive) ? 'SearchStickTop' : ''}"
1028
- part="CategoriesHeaderSection CategoriesHeaderSectionAltDesign {(getDevice(userAgent) !== 'PC') ? 'CategoriesHeaderMobileSection' : ''} {mobileSearchViewActive ? 'SearchMobileActive' : ''} {mobileSearchViewActive || (searched && !(getDevice(userAgent) === 'PC') && !closeSearch) ? 'CategoriesHeaderSearchActive' : ''}{(adjustingScroll && mobileSearchViewActive) ? 'SearchStickTop' : ''}"
1029
- style="top: {adjustingScroll && mobileSearchViewActive ? scrollOffset + 'px' : ''}">
1030
- <div class="SearchContainer { (!lobbyScreen && !favoritesScreen && !mostPlayedScreen && !lastPlayedScreen && !lobbyViewAux) ? 'SearchTruncated' : ''}" part="SearchContainer { (!lobbyScreen && !favoritesScreen && !mostPlayedScreen && !lastPlayedScreen && !lobbyViewAux) ? 'SearchTruncated' : ''}">
1031
- <label for="search" class="SrOnly" part="SrOnly">{$_('casinoPage.searchGames')}</label>
1032
- <div class="SearchWrapper" part="SearchWrapper">
1033
- {#if !mobileSearchViewActive}
1034
- <div class="SearchIcon" part="SearchWrapper">
1035
- <svg role="presentation" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" aria-hidden="true">
1036
- <path fill-rule="evenodd" d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z" clip-rule="evenodd" />
1037
- </svg>
1038
- </div>
1039
- {/if}
1040
-
1041
- <input id="SearchField" class="SearchInput" part="SearchInput" on:focus={onFocus} on:blur={onBlur} bind:this={searchElement} bind:value={searchValue} placeholder="{(getDevice(userAgent) === 'PC') ? $_('casinoPage.search') : $_('casinoPage.searchMobile')}" type="search" on:focus={searchActivated} />
1042
- {#if ((getDevice(userAgent) === 'PC') && searchValue.length) || (getDevice(userAgent) !== 'PC')}
1043
- <span class="{(getDevice(userAgent) === 'PC') ? 'ClearSearchButton' : 'ClearSearchButtonMobile'}" part="{(getDevice(userAgent) === 'PC') ? 'ClearSearchButton' : 'ClearSearchButtonMobile'}" on:click="{() => clearSearchbar()}">
1044
- <div class="CloseIconContainer" part="CloseIconContainer">
1045
- <div class="CloseIconWrapper" part="CloseIconWrapper">
1046
- <div class="CloseIcon" part="CloseIcon"></div>
1047
- </div>
1048
- </div>
1049
- </span>
1050
- {/if}
1051
- </div>
1052
- </div>
1053
- {#if !favoritesScreen && !lobbyScreen && !mobileSearchViewActive && !mostPlayedScreen && !lastPlayedScreen && !recentSearches && !searchFocus && !searched && !lobbyViewAux}
1054
- <div class="FiltersButtonsContainer" part="FiltersButtonsContainer">
1055
- {#if numberOfFilters}
1056
- <div class="ClearFilterButtonWrapper {numberOfFilters ? 'FiltersActive' : ''}" part="ClearFilterButtonWrapper {numberOfFilters ? 'FiltersActive' : ''}" on:click="{() => clearVendorFilter()}">
1057
- <div class="ClearButton" part="ClearButton">{$_('casinoPage.clear')}
1058
- <span class="ClearIcon" part="ClearIcon">
1059
- <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
1060
- viewBox="0 0 378.303 378.303" style="enable-background:new 0 0 378.303 378.303;" xml:space="preserve">
1061
- <polygon style="fill:var(--emfe-w-color-secondary, #FD2839);" points="378.303,28.285 350.018,0 189.151,160.867 28.285,0 0,28.285 160.867,189.151 0,350.018
1062
- 28.285,378.302 189.151,217.436 350.018,378.302 378.303,350.018 217.436,189.151 "/>
1063
- </svg>
1064
- </span>
1065
- </div>
1066
- </div>
1067
- {/if}
1068
- {#if !searched || !recentSearches}
1069
- {#if !mostPlayedScreen}
1070
- <div class="FilterButtonWrapper" part="FilterButtonWrapper" on:click='{() => {openFiltersModal()}}'>
1071
- <div class="FilterButton" part="FilterButton">{$_('casinoPage.filters')}</div>
1072
- <div class="FilterIconContainer" part="FilterIconContainer">
1073
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 26 26"><defs><style>.a{fill:var(--emfe-w-color-white, #FFFFFF);}</style></defs><path class="a" d="M16.7,32.2a1.654,1.654,0,0,1-.636-.148,1.526,1.526,0,0,1-.867-1.393V20.578L5.433,10.588A1.543,1.543,0,0,1,5,9.491V7.742A1.512,1.512,0,0,1,6.5,6.2h23A1.512,1.512,0,0,1,31,7.742V9.491a1.543,1.543,0,0,1-.433,1.1L20.8,20.578v7.738a1.594,1.594,0,0,1-.52,1.156l-2.6,2.312A1.461,1.461,0,0,1,16.7,32.2ZM6.618,9.431l9.764,10.02a1.543,1.543,0,0,1,.433,1.1v9.813l2.34-2.075V20.519a1.543,1.543,0,0,1,.433-1.1L29.353,9.4V7.831H6.618Z" transform="translate(-5 -6.2)"/></svg>
1074
- {#if numberOfFilters > 0}
1075
- <div class="NumberOfFiltersContainer" part="NumberOfFiltersContainer">
1076
- <span class="NumberOfFilters" part="NumberOfFilters">{numberOfFilters}</span>
1077
- </div>
1078
- {/if}
1079
- </div>
1080
- </div>
1081
- {/if}
1082
- {/if}
1083
- </div>
1084
- {/if}
1085
- </div>
1086
- <!-- end alternative search layout-->
1087
- {/if}
782
+ <casino-search
783
+ {endpoint} {datasource} {lang} {clientstyling} {clientstylingurl} {integratedgameframedesktop} {integratedgameframemobile} {translationurl} showfavorites = {favorites}
784
+ ></casino-search>
1088
785
 
1089
- {#if playrandomgame == 'true' && searchFocus == false}
786
+ {#if playrandomgame == 'true' && searchFocus == false && !searchIsOn}
1090
787
  <casino-random-game {datasource} {filteredrandomgamecategories} {endpoint} {lang} {gameevent} {randombuttonicon} {clientstyling} {clientstylingurl}>
1091
788
  </casino-random-game>
1092
789
  {/if}
1093
790
 
1094
791
  {#if isLoading}
1095
792
  <p class="SearchLoading" part="SearchLoading">{$_('casinoPage.loading')}</p>
1096
- {:else}
793
+ {:else if !searchIsOn}
1097
794
  {#if lobbyScreen}
1098
795
  {#each shownCategories as category, index}
1099
796
  {#if positionwinnerswidget && index == +positionwinnerswidget}
@@ -1166,6 +863,7 @@
1166
863
  {datasource}
1167
864
  {lang}
1168
865
  {type}
866
+ {collectionprovidersgamenames}
1169
867
  {titletype}
1170
868
  {clientstyling}
1171
869
  {clientstylingurl}>
@@ -1177,6 +875,7 @@
1177
875
  {lang}
1178
876
  type='vendor'
1179
877
  titletype="logo"
878
+ {collectionprovidersgamenames}
1180
879
  {clientstyling}
1181
880
  {clientstylingurl}>
1182
881
  </casino-collections-providers>
@@ -1202,20 +901,18 @@
1202
901
  {gamepagemodalurl}
1203
902
  {integratedgameframedesktop}
1204
903
  {integratedgameframemobile}
904
+ {casinomygames}
1205
905
  />
1206
906
  {/each}
1207
- {:else if favoritesScreen}
1208
- <casino-favorites-section
1209
- session={session}
907
+ {:else if myGamesSection}
908
+ <casino-my-games
1210
909
  userid={userid}
910
+ session={session}
1211
911
  endpoint={endpoint}
1212
912
  datasource={datasource}
1213
913
  lang={lang}
1214
914
  currency={currency}
1215
915
  favorites={favorites}
1216
- use:getFavoredGames={`${endpoint}/player/${playerID}/favorites/`, sessionID, playerID}
1217
- categoryid={"FAVORITES"}
1218
- class="CategoryContainer"
1219
916
  {clientstyling}
1220
917
  {clientstylingurl}
1221
918
  {livecasino}
@@ -1223,27 +920,14 @@
1223
920
  {gamepagemodalurl}
1224
921
  {integratedgameframedesktop}
1225
922
  {integratedgameframemobile}
1226
- />
1227
- {:else if mostPlayedScreen}
1228
- <casino-most-played-section
1229
- endpoint={endpoint}
1230
- datasource={datasource}
1231
- lang={lang}
1232
- currency={currency}
1233
- session={session}
1234
- userid={userid}
1235
- use:sendSearchData={searchArray}
1236
- categoryid="Search"
1237
- favorites={favorites}
1238
- categoryindex="0"
1239
- class="CategoryContainer"
1240
- {clientstyling}
1241
- {clientstylingurl}
1242
- {livecasino}
1243
- {visiblegames}
1244
- {gamepagemodalurl}
1245
- {integratedgameframedesktop}
1246
- {integratedgameframemobile}
923
+ translationurl=""
924
+ {mostplayed}
925
+ {lastplayed}
926
+ {filteredcategories}
927
+ {activecategory}
928
+ categoryindex="0"
929
+ categoryid="MYGAMES"
930
+ {casinomygames}
1247
931
  />
1248
932
  {:else}
1249
933
  {#if lobbyScreen}
@@ -1352,56 +1036,18 @@
1352
1036
  {gamepagemodalurl}
1353
1037
  {integratedgameframedesktop}
1354
1038
  {integratedgameframemobile}
1039
+ {casinomygames}
1355
1040
  />
1356
1041
  {/each}
1357
- {:else if favoritesScreen}
1358
- <casino-games-category-section
1359
- session={session}
1360
- userid={userid}
1361
- endpoint={endpoint}
1362
- datasource={datasource}
1363
- lang={lang}
1364
- currency={currency}
1365
- favorites={favorites}
1366
- use:getFavoredGames={`${endpoint}/player/${playerID}/favorites/`, sessionID, playerID}
1367
- categoryid={"FAVORITES"}
1368
- class="CategoryContainer"
1369
- {clientstyling}
1370
- {clientstylingurl}
1371
- {livecasino}
1372
- {visiblegames}
1373
- {gamepagemodalurl}
1374
- {integratedgameframedesktop}
1375
- {integratedgameframemobile}
1376
- />
1377
- {:else if mostPlayedScreen}
1378
- <casino-most-played-section
1042
+ {:else if myGamesSection}
1043
+ <casino-my-games
1379
1044
  userid={userid}
1380
- endpoint={endpoint}
1381
- datasource={datasource}
1382
- favorites={favorites}
1383
- lang={lang}
1384
- currency={currency}
1385
1045
  session={session}
1386
- class="CategoryContainer"
1387
- {clientstyling}
1388
- {clientstylingurl}
1389
- {livecasino}
1390
- {visiblegames}
1391
- {gamepagemodalurl}
1392
- {integratedgameframedesktop}
1393
- {integratedgameframemobile}
1394
- ></casino-most-played-section>
1395
- {:else if lastPlayedScreen}
1396
- <casino-last-played-section
1397
- userid={userid}
1398
1046
  endpoint={endpoint}
1399
1047
  datasource={datasource}
1400
- favorites={favorites}
1401
1048
  lang={lang}
1402
1049
  currency={currency}
1403
- session={session}
1404
- class="CategoryContainer"
1050
+ favorites={favorites}
1405
1051
  {clientstyling}
1406
1052
  {clientstylingurl}
1407
1053
  {livecasino}
@@ -1409,7 +1055,14 @@
1409
1055
  {gamepagemodalurl}
1410
1056
  {integratedgameframedesktop}
1411
1057
  {integratedgameframemobile}
1412
- ></casino-last-played-section>
1058
+ {translationurl}
1059
+ {mostplayed}
1060
+ {lastplayed}
1061
+ {filteredcategories}
1062
+ {activecategory}
1063
+ categoryindex="0"
1064
+ categoryid="MYGAMES"
1065
+ />
1413
1066
  {:else}
1414
1067
  <casino-games-category-section
1415
1068
  userid={userid}
@@ -1429,6 +1082,7 @@
1429
1082
  {gamepagemodalurl}
1430
1083
  {integratedgameframedesktop}
1431
1084
  {integratedgameframemobile}
1085
+ {casinomygames}
1432
1086
  />
1433
1087
  {/if}
1434
1088
  {/if}
@@ -1455,6 +1109,7 @@
1455
1109
 
1456
1110
  .CategoriesLobby {
1457
1111
  margin: 0 auto;
1112
+ position: relative;
1458
1113
  }
1459
1114
 
1460
1115
  .CasinoWinners {