{ "version": 3, "sources": ["src/app/shared/scoreboard/main-scoreboard/main-scoreboard.component.ts", "src/app/shared/scoreboard/main-scoreboard/main-scoreboard.component.html"], "sourcesContent": ["import { Component, Input, OnDestroy, OnInit } from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport { Store, select } from '@ngrx/store';\nimport { MainScoreboardItemModel, TeamSettings } from 'models';\nimport { Subject } from 'rxjs';\nimport { medals } from 'shared/medal-img/medals';\nimport {\n ScoreboardHistoryModalComponent,\n ScoreboardHistoryModalCotext,\n} from 'shared/scoreboard-history-modal/scoreboard-history-modal.component';\nimport { AppState, playersSelectors } from 'store';\nimport { NgIf, NgFor, DecimalPipe } from '@angular/common';\nimport { MatTooltip } from '@angular/material/tooltip';\nimport { MatIcon } from '@angular/material/icon';\nimport { MedalImgComponent } from '../../medal-img/medal-img.component';\nimport { TranslateModule } from '@ngx-translate/core';\n\n@Component({\n selector: 'app-main-scoreboard',\n templateUrl: './main-scoreboard.component.html',\n styleUrls: ['../scoreboard.component.scss'],\n imports: [NgIf, MatTooltip, MatIcon, NgFor, MedalImgComponent, DecimalPipe, TranslateModule],\n})\nexport class MainScoreboardComponent implements OnInit, OnDestroy {\n #unsubscribe = new Subject();\n #items: Array = [];\n notQualified: Array = [];\n\n public get items() {\n return this.#items;\n }\n\n @Input() set items(value: Array) {\n if (!value?.length) {\n this.#items = [];\n this.notQualified = [];\n return;\n }\n this.#items = value.filter((x) => x.qualifies);\n this.notQualified = value.filter((x) => !x.qualifies);\n }\n @Input() height: number;\n settings: TeamSettings;\n\n constructor(\n private readonly store: Store,\n private readonly dialog: MatDialog,\n ) {}\n\n ngOnInit(): void {\n this.store.pipe(select(playersSelectors.selectSettings)).subscribe((settings) => (this.settings = settings));\n }\n\n ngOnDestroy(): void {\n this.#unsubscribe.next();\n this.#unsubscribe.complete();\n }\n\n public getMedal(position: number, settings: TeamSettings) {\n switch (position) {\n case 1:\n return medals.find((x) => x.code === 'gold');\n case 2:\n return medals.find((x) => x.code === 'silver');\n case 3:\n return medals.find((x) => x.code === 'bronze');\n case 4:\n return medals.find((x) => x.code === 'potato');\n default:\n if (settings.showAditionalPositionImages && settings.additionalMedalsSettings) {\n if (position > 4 && position === this.items?.length) {\n return medals.find((x) => x.code === 'champion');\n }\n const medalCode = settings.additionalMedalsSettings[position - 5];\n if (medalCode) {\n return medals.find((x) => x.code === medalCode) || null;\n }\n }\n break;\n }\n\n return null;\n }\n\n public openHistory() {\n this.dialog.open(ScoreboardHistoryModalComponent, {\n data: { type: 'main', notQualified: this.notQualified.map((x) => x.id) },\n panelClass: 'dialog-xl',\n height: '90vh',\n });\n }\n}\n", "\n
\n

{{ 'DASHBOARD.EMPTY_MAIN_SCOREBOARD' | translate }}

\n
\n
\n\n
\n
\n \n {{ 'DASHBOARD.TOP_PLAYERS' | translate }} analytics\n
\n {{ 'DASHBOARD.TOP_PLAYERS' | translate }}\n
\n {{ 'DASHBOARD.MATCHES' | translate }}\n
\n
\n {{ 'DASHBOARD.WINS_PERCENT' | translate }}\n
\n
{{ 'DASHBOARD.POINTS' | translate }}
\n
\n\n
\n \n
\n \n
\n
\n {{ ix + 1 }}. {{ p.displayName }} (Lvl {{ p.level }})\n
\n
{{ p.winCount }} / {{ p.matchCount }}
\n\n
\n {{ (p.winCount / (p.matchCount || 1)) * 100 | number: '.0-0' }}\n
\n \n {{ p.avaragePoints | number: '1.0-2' }}\n
\n \n\n \n
\n
\n {{ p.displayName }} (Lvl {{ p.level }})\n
\n
{{ p.winCount }} / {{ p.matchCount }}
\n\n
\n {{ (p.winCount / (p.matchCount || 1)) * 100 | number: '.0-0' }}\n
\n \n {{ p.avaragePoints | number: '1.0-2' }}\n \n \n \n\n"], "mappings": "6dCCIA,EAAA,EAAA,MAAA,CAAA,EAAqI,EAAA,IAAA,EAC7HC,EAAA,CAAA,mBAAmDC,EAAA,EAAK,SAAxDC,EAAA,CAAA,EAAAC,EAAAC,EAAA,EAAA,EAAA,iCAAA,CAAA,2BADRC,EAAA,E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A,EAAA,CAAA,0BAAA,MAAA,EAAA,eAAA,kBAAA,aAAA,EAAA,YAAA,EAAA,CAAA,qBAAA,QAAA,EAAA,eAAA,uBAAA,EAAA,YAAA,CAAA,EAAAC,SAAA,SAAAC,EAAAC,EAAA,IAAAD,EAAA,ICvBpChF,EAAA,EAAAkF,EAAA,EAAA,EAAA,cAAA,KAAA,EAAAC,CAAA,EAMAzF,EAAA,EAAA,MAAA,CAAA,EACIM,EAAA,EAAAoF,EAAA,GAAA,GAAA,MAAA,CAAA,EAA4D,EAAAC,GAAA,EAAA,EAAA,MAAA,CAAA,EAuEhEzF,EAAA,mBAvEmDC,EAAA,CAAA,EAAAK,EAAA,OAAA+E,EAAA7E,KAAA,EAkBrBP,EAAA,EAAAK,EAAA,OAAA+E,EAAA7E,OAAA,KAAA,KAAA6E,EAAA7E,MAAAC,MAAA,EAAqB,WAAAiF,CAAA,kBDJrCC,EAAMC,EAAYC,EAASC,EAAOC,EAAmBC,EAAaC,EAAeC,CAAA,EAAAC,OAAA,CAAA;8DAAA,CAAA,CAAA,CAAA,SAElF1D,CAAuB,GAAA", "names": ["\u0275\u0275elementStart", "\u0275\u0275text", "\u0275\u0275elementEnd", "\u0275\u0275advance", "\u0275\u0275textInterpolate", "\u0275\u0275pipeBind1", "\u0275\u0275template", "MainScoreboardComponent_ng_template_0_div_0_Template", "\u0275\u0275property", "ctx_r0", "items", "length", "\u0275\u0275listener", "\u0275\u0275restoreView", "_r2", "\u0275\u0275nextContext", "\u0275\u0275resetView", "openHistory", "\u0275\u0275textInterpolate1", "\u0275\u0275element", "\u0275\u0275classProp", "ix_r4", "getMedal", "settings", "\u0275\u0275textInterpolate3", "p_r3", "displayName", "level", "\u0275\u0275textInterpolate2", "winCount", "matchCount", "\u0275\u0275pipeBind2", "\u0275\u0275pipeBind3", "avaragePoints", "\u0275\u0275pureFunction1", "_c0", "p_r5", "remainsForQualification", "MainScoreboardComponent_div_4_div_1_Template", "MainScoreboardComponent_div_4_div_2_Template", "\u0275\u0275styleProp", "height", "notQualified", "MainScoreboardComponent", "#unsubscribe", "#items", "value", "filter", "x", "qualifies", "constructor", "store", "dialog", "Subject", "ngOnInit", "pipe", "select", "playersSelectors", "selectSettings", "subscribe", "ngOnDestroy", "next", "complete", "position", "medals", "find", "code", "showAditionalPositionImages", "additionalMedalsSettings", "medalCode", "open", "ScoreboardHistoryModalComponent", "data", "type", "map", "id", "panelClass", "\u0275\u0275directiveInject", "Store", "MatDialog", "selectors", "inputs", "decls", "vars", "consts", "template", "rf", "ctx", "MainScoreboardComponent_ng_template_0_Template", "\u0275\u0275templateRefExtractor", "MainScoreboardComponent_div_3_Template", "MainScoreboardComponent_div_4_Template", "emptyMainScoreboard_r6", "NgIf", "MatTooltip", "MatIcon", "NgFor", "MedalImgComponent", "DecimalPipe", "TranslateModule", "TranslatePipe", "styles"] }