@everymatrix/casino-tournaments-page-controller 0.0.115 → 0.0.116

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.
@@ -4611,10 +4611,25 @@
4611
4611
  });
4612
4612
  }
4613
4613
 
4614
+ function setupI18n({ withLocale: _locale, translations }) {
4615
+ T.subscribe((data) => {
4616
+ if (data == null) {
4617
+ s.set(translations);
4618
+ T.set(_locale);
4619
+ }
4620
+ }); // maybe we will need this to make sure that the i18n is set up only once
4621
+ /*dictionary.set(translations);
4622
+ locale.set(_locale);*/
4623
+ }
4624
+
4614
4625
  function addNewMessages$5(lang, dict) {
4615
4626
  m(lang, dict);
4616
4627
  }
4617
4628
 
4629
+ function setLocale$1(_locale) {
4630
+ T.set(_locale);
4631
+ }
4632
+
4618
4633
  const TournamentsPageTranslations = {
4619
4634
  en: {
4620
4635
  tournamentsPage: {
@@ -11654,7 +11669,7 @@
11654
11669
  return child_ctx;
11655
11670
  }
11656
11671
 
11657
- // (162:0) {:else}
11672
+ // (164:0) {:else}
11658
11673
  function create_else_block(ctx) {
11659
11674
  let div5;
11660
11675
  let div1;
@@ -11702,35 +11717,35 @@
11702
11717
  attr_dev(path, "stroke-linejoin", "round");
11703
11718
  attr_dev(path, "stroke-width", "2");
11704
11719
  attr_dev(path, "d", "M15 19l-7-7 7-7");
11705
- add_location(path, file, 167, 10, 5669);
11720
+ add_location(path, file, 169, 10, 5771);
11706
11721
  attr_dev(svg, "fill", "none");
11707
11722
  attr_dev(svg, "stroke", "currentColor");
11708
11723
  attr_dev(svg, "width", "24");
11709
11724
  attr_dev(svg, "height", "24");
11710
11725
  attr_dev(svg, "viewBox", "0 0 24 24");
11711
11726
  attr_dev(svg, "xmlns", "http://www.w3.org/2000/svg");
11712
- add_location(svg, file, 166, 8, 5541);
11713
- add_location(p, file, 169, 8, 5790);
11727
+ add_location(svg, file, 168, 8, 5643);
11728
+ add_location(p, file, 171, 8, 5892);
11714
11729
  attr_dev(div0, "class", "BackButton");
11715
- add_location(div0, file, 165, 6, 5482);
11730
+ add_location(div0, file, 167, 6, 5584);
11716
11731
  attr_dev(div1, "class", "TopButtons");
11717
- add_location(div1, file, 164, 4, 5451);
11732
+ add_location(div1, file, 166, 4, 5553);
11718
11733
 
11719
11734
  attr_dev(div2, "class", div2_class_value = "" + ((isMobile(/*userAgent*/ ctx[10]) ? "MobileClass" : "") + (/*showleaderboard*/ ctx[0] == "true"
11720
11735
  ? "TournamentCardDetails"
11721
11736
  : "FullSize")));
11722
11737
 
11723
- add_location(div2, file, 188, 6, 6670);
11738
+ add_location(div2, file, 190, 6, 6772);
11724
11739
 
11725
11740
  attr_dev(div3, "class", div3_class_value = /*showleaderboard*/ ctx[0] == "true"
11726
11741
  ? "TournamentTableDetails "
11727
11742
  : "DisplayNone");
11728
11743
 
11729
- add_location(div3, file, 210, 6, 7516);
11744
+ add_location(div3, file, 212, 6, 7618);
11730
11745
  attr_dev(div4, "class", "TournamentContentDetails " + (isMobile(/*userAgent*/ ctx[10]) ? "MobileClass" : ""));
11731
- add_location(div4, file, 187, 4, 6582);
11746
+ add_location(div4, file, 189, 4, 6684);
11732
11747
  attr_dev(div5, "class", "TournamentsPage");
11733
- add_location(div5, file, 162, 2, 5416);
11748
+ add_location(div5, file, 164, 2, 5518);
11734
11749
  },
11735
11750
  m: function mount(target, anchor) {
11736
11751
  insert_dev(target, div5, anchor);
@@ -11824,14 +11839,14 @@
11824
11839
  block,
11825
11840
  id: create_else_block.name,
11826
11841
  type: "else",
11827
- source: "(162:0) {:else}",
11842
+ source: "(164:0) {:else}",
11828
11843
  ctx
11829
11844
  });
11830
11845
 
11831
11846
  return block;
11832
11847
  }
11833
11848
 
11834
- // (160:0) {#if isLoading}
11849
+ // (162:0) {#if isLoading}
11835
11850
  function create_if_block(ctx) {
11836
11851
  let p;
11837
11852
  let t_value = /*$_*/ ctx[9]("tournamentsPage.loading") + "";
@@ -11841,7 +11856,7 @@
11841
11856
  c: function create() {
11842
11857
  p = element("p");
11843
11858
  t = text(t_value);
11844
- add_location(p, file, 160, 2, 5367);
11859
+ add_location(p, file, 162, 2, 5469);
11845
11860
  },
11846
11861
  m: function mount(target, anchor) {
11847
11862
  insert_dev(target, p, anchor);
@@ -11859,14 +11874,14 @@
11859
11874
  block,
11860
11875
  id: create_if_block.name,
11861
11876
  type: "if",
11862
- source: "(160:0) {#if isLoading}",
11877
+ source: "(162:0) {#if isLoading}",
11863
11878
  ctx
11864
11879
  });
11865
11880
 
11866
11881
  return block;
11867
11882
  }
11868
11883
 
11869
- // (190:8) {#if tournamentDetails}
11884
+ // (192:8) {#if tournamentDetails}
11870
11885
  function create_if_block_4(ctx) {
11871
11886
  let casino_tournaments_thumbnail_controller;
11872
11887
  let casino_tournaments_thumbnail_controller_tournamenturl_value;
@@ -11884,7 +11899,7 @@
11884
11899
  set_custom_element_data(casino_tournaments_thumbnail_controller, "showenrolled", "true");
11885
11900
  set_custom_element_data(casino_tournaments_thumbnail_controller, "fullsize", casino_tournaments_thumbnail_controller_fullsize_value = !!/*showleaderboard*/ ctx[0]);
11886
11901
  set_custom_element_data(casino_tournaments_thumbnail_controller, "currency", /*currency*/ ctx[4]);
11887
- add_location(casino_tournaments_thumbnail_controller, file, 190, 10, 6835);
11902
+ add_location(casino_tournaments_thumbnail_controller, file, 192, 10, 6937);
11888
11903
  },
11889
11904
  m: function mount(target, anchor) {
11890
11905
  insert_dev(target, casino_tournaments_thumbnail_controller, anchor);
@@ -11923,14 +11938,14 @@
11923
11938
  block,
11924
11939
  id: create_if_block_4.name,
11925
11940
  type: "if",
11926
- source: "(190:8) {#if tournamentDetails}",
11941
+ source: "(192:8) {#if tournamentDetails}",
11927
11942
  ctx
11928
11943
  });
11929
11944
 
11930
11945
  return block;
11931
11946
  }
11932
11947
 
11933
- // (203:8) {#if tournamentDescription.length > 0}
11948
+ // (205:8) {#if tournamentDescription.length > 0}
11934
11949
  function create_if_block_3(ctx) {
11935
11950
  let each_1_anchor;
11936
11951
  let each_value = /*tournamentDescription*/ ctx[6];
@@ -11991,14 +12006,14 @@
11991
12006
  block,
11992
12007
  id: create_if_block_3.name,
11993
12008
  type: "if",
11994
- source: "(203:8) {#if tournamentDescription.length > 0}",
12009
+ source: "(205:8) {#if tournamentDescription.length > 0}",
11995
12010
  ctx
11996
12011
  });
11997
12012
 
11998
12013
  return block;
11999
12014
  }
12000
12015
 
12001
- // (204:10) {#each tournamentDescription as desc}
12016
+ // (206:10) {#each tournamentDescription as desc}
12002
12017
  function create_each_block(ctx) {
12003
12018
  let casino_tournaments_details;
12004
12019
  let casino_tournaments_details_title_value;
@@ -12009,7 +12024,7 @@
12009
12024
  casino_tournaments_details = element("casino-tournaments-details");
12010
12025
  set_custom_element_data(casino_tournaments_details, "title", casino_tournaments_details_title_value = /*desc*/ ctx[32].title);
12011
12026
  set_custom_element_data(casino_tournaments_details, "text", casino_tournaments_details_text_value = /*desc*/ ctx[32].description);
12012
- add_location(casino_tournaments_details, file, 204, 12, 7350);
12027
+ add_location(casino_tournaments_details, file, 206, 12, 7452);
12013
12028
  },
12014
12029
  m: function mount(target, anchor) {
12015
12030
  insert_dev(target, casino_tournaments_details, anchor);
@@ -12032,14 +12047,14 @@
12032
12047
  block,
12033
12048
  id: create_each_block.name,
12034
12049
  type: "each",
12035
- source: "(204:10) {#each tournamentDescription as desc}",
12050
+ source: "(206:10) {#each tournamentDescription as desc}",
12036
12051
  ctx
12037
12052
  });
12038
12053
 
12039
12054
  return block;
12040
12055
  }
12041
12056
 
12042
- // (212:8) {#if showleaderboard == "true"}
12057
+ // (214:8) {#if showleaderboard == "true"}
12043
12058
  function create_if_block_1(ctx) {
12044
12059
  let if_block_anchor;
12045
12060
  let if_block = /*showTable*/ ctx[8] == true && create_if_block_2(ctx);
@@ -12075,14 +12090,14 @@
12075
12090
  block,
12076
12091
  id: create_if_block_1.name,
12077
12092
  type: "if",
12078
- source: "(212:8) {#if showleaderboard == \\\"true\\\"}",
12093
+ source: "(214:8) {#if showleaderboard == \\\"true\\\"}",
12079
12094
  ctx
12080
12095
  });
12081
12096
 
12082
12097
  return block;
12083
12098
  }
12084
12099
 
12085
- // (213:10) {#if showTable == true}
12100
+ // (215:10) {#if showTable == true}
12086
12101
  function create_if_block_2(ctx) {
12087
12102
  let casino_tournaments_table;
12088
12103
 
@@ -12091,7 +12106,7 @@
12091
12106
  casino_tournaments_table = element("casino-tournaments-table");
12092
12107
  set_custom_element_data(casino_tournaments_table, "firstrow", "true");
12093
12108
  set_custom_element_data(casino_tournaments_table, "sortable", "false");
12094
- add_location(casino_tournaments_table, file, 213, 12, 7688);
12109
+ add_location(casino_tournaments_table, file, 215, 12, 7790);
12095
12110
  },
12096
12111
  m: function mount(target, anchor) {
12097
12112
  insert_dev(target, casino_tournaments_table, anchor);
@@ -12105,7 +12120,7 @@
12105
12120
  block,
12106
12121
  id: create_if_block_2.name,
12107
12122
  type: "if",
12108
- source: "(213:10) {#if showTable == true}",
12123
+ source: "(215:10) {#if showTable == true}",
12109
12124
  ctx
12110
12125
  });
12111
12126
 
@@ -12198,6 +12213,7 @@
12198
12213
  let showTable = false;
12199
12214
  let firstRowData = {};
12200
12215
  let firstRowAvailable = false;
12216
+ setupI18n({ withLocale: "en", translations: {} });
12201
12217
 
12202
12218
  Object.keys(TournamentsPageTranslations).forEach(item => {
12203
12219
  addNewMessages$5(item, TournamentsPageTranslations[item]);
@@ -12321,6 +12337,7 @@
12321
12337
  };
12322
12338
 
12323
12339
  const initialLoad = () => {
12340
+ setLocale$1(lang);
12324
12341
  getData(endpoint, tourid);
12325
12342
  getTableData(endpoint, tourid);
12326
12343
  };
@@ -12378,6 +12395,8 @@
12378
12395
  checkSession,
12379
12396
  _: X,
12380
12397
  addNewMessages: addNewMessages$5,
12398
+ setLocale: setLocale$1,
12399
+ setupI18n,
12381
12400
  TournamentsPageTranslations,
12382
12401
  session,
12383
12402
  userid,
@@ -12445,8 +12464,8 @@
12445
12464
  session && userid && setSession();
12446
12465
  }
12447
12466
 
12448
- if ($$self.$$.dirty[0] & /*tourid, endpoint, session*/ 4106) {
12449
- tourid && endpoint && session && initialLoad();
12467
+ if ($$self.$$.dirty[0] & /*tourid, endpoint, session, lang*/ 20490) {
12468
+ tourid && endpoint && session && lang && initialLoad();
12450
12469
  }
12451
12470
 
12452
12471
  if ($$self.$$.dirty[0] & /*tourid, cmsendpoint*/ 12288) {