valtech-components 4.0.495 → 4.0.497

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.
@@ -2,5 +2,5 @@
2
2
  * Current version of valtech-components.
3
3
  * This is automatically updated during the publish process.
4
4
  */
5
- export const VERSION = '4.0.495';
6
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9saWIvdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7O0dBR0c7QUFDSCxNQUFNLENBQUMsTUFBTSxPQUFPLEdBQUcsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDdXJyZW50IHZlcnNpb24gb2YgdmFsdGVjaC1jb21wb25lbnRzLlxuICogVGhpcyBpcyBhdXRvbWF0aWNhbGx5IHVwZGF0ZWQgZHVyaW5nIHRoZSBwdWJsaXNoIHByb2Nlc3MuXG4gKi9cbmV4cG9ydCBjb25zdCBWRVJTSU9OID0gJzQuMC40OTUnO1xuIl19
5
+ export const VERSION = '4.0.497';
6
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9saWIvdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7O0dBR0c7QUFDSCxNQUFNLENBQUMsTUFBTSxPQUFPLEdBQUcsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDdXJyZW50IHZlcnNpb24gb2YgdmFsdGVjaC1jb21wb25lbnRzLlxuICogVGhpcyBpcyBhdXRvbWF0aWNhbGx5IHVwZGF0ZWQgZHVyaW5nIHRoZSBwdWJsaXNoIHByb2Nlc3MuXG4gKi9cbmV4cG9ydCBjb25zdCBWRVJTSU9OID0gJzQuMC40OTcnO1xuIl19
@@ -59,7 +59,7 @@ import fixWebmDuration from 'fix-webm-duration';
59
59
  * Current version of valtech-components.
60
60
  * This is automatically updated during the publish process.
61
61
  */
62
- const VERSION = '4.0.495';
62
+ const VERSION = '4.0.497';
63
63
 
64
64
  // Control de estado de refresco (singleton a nivel de módulo)
65
65
  let isRefreshing = false;
@@ -66150,6 +66150,7 @@ class ChessimalsGameComponent {
66150
66150
  finishedAt: completed || failed ? finishedAt : undefined,
66151
66151
  };
66152
66152
  this.challengeRun.set(nextRun);
66153
+ this.activeStoredChallengeRun.set(nextRun.status === 'active' ? nextRun : undefined);
66153
66154
  this.challengeLastWon.set(won);
66154
66155
  this.challengeLastBot.set(bot);
66155
66156
  this.challengeLastRoundStats.set(roundStats);
@@ -66356,6 +66357,27 @@ class ChessimalsGameComponent {
66356
66357
  this.movingPiece.set(undefined);
66357
66358
  this.clearReview();
66358
66359
  }
66360
+ returnChallengeToMenu() {
66361
+ const run = this.challengeRun();
66362
+ if (this.isResumableChallengeRun(run)) {
66363
+ this.activeStoredChallengeRun.set(run);
66364
+ }
66365
+ this.dismissChallengeIntro();
66366
+ this.resetFinishedLocalGameForNextVisit();
66367
+ this.onlineSubscription?.unsubscribe();
66368
+ this.onlineSubscription = undefined;
66369
+ this.openedOnlineGameId = undefined;
66370
+ this.openingOnlineGameId = undefined;
66371
+ this.resumeSplashVisible.set(false);
66372
+ this.clearBotTurn();
66373
+ this.onlineConnectionState.set('idle');
66374
+ this.screen.set('home');
66375
+ this.startChessimalsMenuMusicSoon();
66376
+ this.selectedPieceId.set(undefined);
66377
+ this.selectedAnimal.set(undefined);
66378
+ this.movingPiece.set(undefined);
66379
+ this.clearReview();
66380
+ }
66359
66381
  resetToGamesMenu() {
66360
66382
  this.confirmAction.set(undefined);
66361
66383
  this.resetToModeSetup();
@@ -66419,6 +66441,10 @@ class ChessimalsGameComponent {
66419
66441
  return;
66420
66442
  }
66421
66443
  if (action === 'mode') {
66444
+ if (this.isChallengeActive()) {
66445
+ this.returnChallengeToMenu();
66446
+ return;
66447
+ }
66422
66448
  this.resetToModeSetup();
66423
66449
  return;
66424
66450
  }
@@ -67553,7 +67579,7 @@ class ChessimalsGameComponent {
67553
67579
  return this.challengeLadder[0];
67554
67580
  }
67555
67581
  challengeMenuBot() {
67556
- const activeRun = this.resumableChallengeRun();
67582
+ const activeRun = this.challengeMenuRun();
67557
67583
  if (activeRun) {
67558
67584
  return this.challengeLadder[Math.max(0, activeRun.currentRound - 1)] ?? this.challengeLadder[0];
67559
67585
  }
@@ -67564,12 +67590,21 @@ class ChessimalsGameComponent {
67564
67590
  challengeMenuRoundLabel() {
67565
67591
  return `${this.challengeMenuBot().round}/${this.challengeLadder.length}`;
67566
67592
  }
67593
+ challengeMenuLivesLabel() {
67594
+ return String(this.challengeMenuRun()?.livesRemaining ?? 3);
67595
+ }
67567
67596
  challengeMenuClearedRound() {
67568
- const activeRun = this.resumableChallengeRun();
67597
+ const activeRun = this.challengeMenuRun();
67569
67598
  if (activeRun)
67570
67599
  return Math.max(0, activeRun.currentRound - 1);
67571
67600
  return this.challengeStats().bestRoundReached;
67572
67601
  }
67602
+ challengeMenuRun() {
67603
+ const currentRun = this.challengeRun();
67604
+ if (this.isResumableChallengeRun(currentRun))
67605
+ return currentRun;
67606
+ return this.resumableChallengeRun();
67607
+ }
67573
67608
  challengeBotName(bot) {
67574
67609
  const profile = this.challengeBotProfile(bot);
67575
67610
  return profile ? this.botProfileLabel(profile) : this.t('chessimalsBotName');
@@ -68223,7 +68258,7 @@ class ChessimalsGameComponent {
68223
68258
  <div class="chessimals-challenge-cta__meta">
68224
68259
  <span>
68225
68260
  <small>{{ t('chessimalsChallengeLives') }}</small>
68226
- <strong>3</strong>
68261
+ <strong>{{ challengeMenuLivesLabel() }}</strong>
68227
68262
  </span>
68228
68263
  <span>
68229
68264
  <small>{{ t('chessimalsChallengeRound') }}</small>
@@ -69613,7 +69648,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
69613
69648
  <div class="chessimals-challenge-cta__meta">
69614
69649
  <span>
69615
69650
  <small>{{ t('chessimalsChallengeLives') }}</small>
69616
- <strong>3</strong>
69651
+ <strong>{{ challengeMenuLivesLabel() }}</strong>
69617
69652
  </span>
69618
69653
  <span>
69619
69654
  <small>{{ t('chessimalsChallengeRound') }}</small>