import { h } from "@stencil/core";
import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
import { getTranslations, translate } from "../../utils/locale.utils";
import "../../../../../casino-tournaments-ingame-state/dist/types/index";
import "../../../../../casino-tournaments-ingame-table/dist/types/index";
import "../../../../../casino-tournaments-ingame-rule/dist/types/index";
import "../../../../../casino-tournaments-ingame-games/dist/types/index";
import RewardSvg from "../../assets/reward.svg";
import ChevronDownSvg from "../../assets/chevron-down.svg";
import ChevronUpSvg from "../../assets/chevron-up.svg";
import CalendarSvg from "../../assets/calendar.svg";
import UnqualifiedSvg from "../../assets/unqualified.svg";
import SuccessSvg from "../../assets/success.svg";
import ErrorSvg from "../../assets/error.svg";
import TriangleSvg from "../../assets/triangle.svg";
import { format, parseISO } from "date-fns";
import * as dateFnsLocales from "date-fns/locale";
import { getDevice, getRandomAvatars } from "../../utils/utils";
export class CasinoTournamentsIngameDetailPage {
    constructor() {
        this.joinResult = null;
        this.maxPrizeCount = 2;
        this.device = getDevice();
        this.abortController = null;
        this.minVerMove = 10;
        this.joinTournament = () => {
            if (this.isClaiming) {
                return;
            }
            this.isClaiming = true;
            let joinUrl = new URL(`${this.endpoint}/v1/bonus/claim?language=${this.language}`);
            let reqHeaders = new Headers();
            let body = {};
            joinUrl.searchParams.append('platform', this.device);
            reqHeaders.append('Content-Type', 'application/json');
            reqHeaders.append('X-SessionID', this.session);
            const { wallets } = this.tournament;
            if ((wallets === null || wallets === void 0 ? void 0 : wallets.length) >= 1) {
                body = {
                    language: this.language,
                    bonusCode: wallets[0].code,
                    currency: this.currency,
                    type: 'tournament'
                };
            }
            let requestOptions = {
                method: 'PUT',
                headers: reqHeaders,
                body: JSON.stringify(body)
            };
            fetch(joinUrl, requestOptions).then(res => res.json()).then(data => {
                this.joinResult = data;
            }, err => {
                console.error(err);
                this.joinResult = {
                    errorCode: 0,
                    errorMessage: 'Error from API',
                    extraData: err,
                    success: false
                };
            }).finally(async () => {
                this.isClaiming = false;
                this.showToasting = true;
                this.joinedSuccess = this.joinResult.success;
                this.tournament = Object.assign(Object.assign({}, this.tournament), { playerEnrolled: this.joinedSuccess, overview: Object.assign(Object.assign({}, this.tournament.overview), { participants: this.tournament.overview.participants + 1 }) });
                this.updatePageInfoByTournament();
                setTimeout(() => {
                    this.showToasting = false;
                }, 2000);
            });
        };
        this.handleTabClick = (event) => {
            const target = event.currentTarget;
            const tabName = target.dataset.tab;
            this.tourPageTabSwitchedEvent.emit({ tabName });
            this.toggleTab(tabName);
        };
        this.handleTouchStart = (e) => {
            this.touchStartY = e.touches[0].clientY;
        };
        this.handleTouchEnd = (e) => {
            const moveDistance = e.changedTouches[0].clientY - this.touchStartY;
            if (Math.abs(moveDistance) < this.minVerMove) {
                return;
            }
            this.isFullHeight = moveDistance < 0;
            e.stopPropagation();
            e.preventDefault();
        };
        this.mbSource = undefined;
        this.clientStyling = undefined;
        this.clientStylingUrl = undefined;
        this.translationUrl = '';
        this.tournamentId = undefined;
        this.endpoint = undefined;
        this.session = undefined;
        this.cmsEndpoint = undefined;
        this.language = 'en';
        this.limit = 20;
        this.currency = 'EUR';
        this.currentGameId = undefined;
        this.isContainerFixHeight = true;
        this.tournament = undefined;
        this.isFullHeight = false;
        this.tournamentPageInfo = undefined;
        this.activeTab = 'leaderboard';
        this.isTournamentLoading = true;
        this.isClaiming = false;
        this.avatars = [];
        this.showToasting = false;
        this.joinedSuccess = true;
        this.playerRankInfo = null;
        this.isRankUpdating = false;
        this.isRankUp = false;
        this.leaderboardTotal = undefined;
    }
    leaderboardLoadedHandler(event) {
        var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
        clearTimeout(this.rankUpdateTimer);
        this.leaderboardTotal = (_a = event.detail) === null || _a === void 0 ? void 0 : _a.totalRank;
        if (!((_b = event.detail) === null || _b === void 0 ? void 0 : _b.isRanked)) {
            return;
        }
        this.isRankUpdating = this.playerRankInfo && ((_c = this.playerRankInfo) === null || _c === void 0 ? void 0 : _c.rank) != ((_e = (_d = event.detail) === null || _d === void 0 ? void 0 : _d.item) === null || _e === void 0 ? void 0 : _e.rank);
        this.isRankUp = ((_f = this.playerRankInfo) === null || _f === void 0 ? void 0 : _f.rank) > ((_h = (_g = event.detail) === null || _g === void 0 ? void 0 : _g.item) === null || _h === void 0 ? void 0 : _h.rank);
        this.rankUpdateTimer = setTimeout(() => {
            this.isRankUpdating = false;
        }, 3000);
        this.playerRankInfo = (_j = event.detail) === null || _j === void 0 ? void 0 : _j.item;
        this.leaderboardOffset = (_k = event.detail) === null || _k === void 0 ? void 0 : _k.leaderboardOffset;
    }
    tournamentUpdatedHandler(event) {
        this.tournament = Object.assign(Object.assign({}, this.tournament), event.detail);
        this.updatePageInfoByTournament();
    }
    dateFnsLocale(lang) {
        return lang in dateFnsLocales ? dateFnsLocales[lang] : dateFnsLocales.enUS;
    }
    ;
    updatePageInfoByTournament() {
        if (!this.tournament) {
            return;
        }
        if (!this.tournament.playerEnrolled || this.tournament.state === 'Unstarted') {
            this.avatars = getRandomAvatars(this.tournament.overview.participants > 4 ? 4 : this.tournament.overview.participants);
        }
        this.tournamentPageInfo = {
            startTime: format(parseISO(this.tournament.startTime), 'MMM dd, HH:mm', { locale: this.dateFnsLocale(this.language) }),
            endTime: format(parseISO(this.tournament.endTime), 'MMM dd, HH:mm', { locale: this.dateFnsLocale(this.language) })
        };
        const { casino: casinoWallet, sports: sportsWallet } = this.tournament.wallet || {};
        this.isSportsEnabled = !!sportsWallet;
        this.isCasinoEnabled = !!casinoWallet;
    }
    async loadTournamentById() {
        if (this.abortController) {
            this.abortController.abort();
        }
        this.abortController = new AbortController();
        let url = new URL(`${this.endpoint}/v1/tournaments/${this.tournamentId}?language=${this.language}&platform=${this.device}`);
        let options = {
            headers: {
                'Content-Type': 'application/json',
                'x-SessionId': this.session
            },
            method: 'GET',
            signal: this.abortController.signal
        };
        this.isTournamentLoading = true;
        await fetch(url, options).then(res => res.json()).then(data => {
            const { item: tournament } = data;
            this.tournament = tournament;
            this.updatePageInfoByTournament();
            this.activeTab = this.tournament.state === 'Running' ? 'leaderboard' : 'rules';
            this.resetLeaderboardPartion();
            this.tournamentDetailEvent.emit({ type: 'tournamentUpdate', tournament });
        }, err => {
            console.error(err);
        }).finally(() => {
            this.isTournamentLoading = false;
        });
    }
    resetLeaderboardPartion(extraDelay = 0) {
        setTimeout(() => {
            const tournamentInfoEle = this.stylingContainer.querySelector('.TournamentInfo');
            const tabsContent = this.stylingContainer.querySelector('.TabsContent');
            if (!tabsContent) {
                return;
            }
            const tabContentEle = tabsContent.querySelector(`.${this.activeTab}`);
            const heightProperty = 'height';
            const boundingClientRect = tournamentInfoEle.getBoundingClientRect();
            let tabContentHeight = this.tabInitHeight;
            if (this.isContainerFixHeight) {
                if (!this.tabInitHeight) {
                    tabContentHeight = this.stylingContainer.clientHeight - boundingClientRect.height;
                    this.tabInitHeight = tabContentHeight;
                }
            }
            else {
                tabContentHeight = Math.min(window.innerHeight, this.stylingContainer.offsetParent.clientHeight) - boundingClientRect.bottom;
            }
            tabContentEle.style[this.activeTab === 'leaderboard' ? 'height' : heightProperty] = `${tabContentHeight}px`;
        }, 200 + extraDelay);
    }
    onTournamentIdChanged() {
        if (this.abortController) {
            this.abortController.abort('Id changed');
        }
        if (!this.endpoint || !this.session || this.session.length < 10 || !this.tournamentId) {
            return;
        }
        this.resetDetailPage();
        this.loadTournamentById();
    }
    resetDetailPage() {
        this.playerRankInfo = null;
        this.tournament = null;
        this.isTournamentLoading = true;
        this.tournamentPageInfo = null;
        this.activeTab = 'leaderboard';
        this.leaderboardOffset = 0;
        this.leaderboardTotal = 0;
    }
    onFullHeightChanged() {
        this.tournamentDetailEvent.emit({ type: 'pageDetailExpand', isExpanded: this.isFullHeight });
        this.tabInitHeight = undefined;
        this.resetLeaderboardPartion(800);
    }
    toggleTab(tab) {
        this.activeTab = tab;
        this.resetLeaderboardPartion();
    }
    async componentWillLoad() {
        this.loadTournamentById();
        if (this.translationUrl.length > 2) {
            try {
                await getTranslations(this.translationUrl);
            }
            catch (error) {
                console.error(error);
            }
        }
    }
    render() {
        var _a, _b, _c, _d, _e;
        return h("div", { key: 'e5b670a332d92b571211eae20f4f7fbf293a78cf', class: `TournamentDetailWrapper TournamentBg ${(_a = this.tournament) === null || _a === void 0 ? void 0 : _a.state}  ${this.device != 'PC' ? 'Mobile' : 'Desktop'}`, ref: (el) => (this.stylingContainer = el) }, h("div", { key: '03ee86877e990233c1e391aa3696941d3a240f04', class: "TopBar", onClick: () => this.isFullHeight = !this.isFullHeight }, h("div", { key: '61bad04f978a184041c6e0a9de5ac6122c130dba', innerHTML: this.isFullHeight ? ChevronDownSvg : ChevronUpSvg })), (this.isTournamentLoading || !this.tournament) ?
            h("div", { class: 'Loading' }, " ", translate('loading', this.language), " ") :
            h("div", { class: 'TournamentDetailPage' }, h("div", { class: 'TournamentInfo', onTouchStart: this.handleTouchStart, onTouchEnd: this.handleTouchEnd }, h("div", { class: "StateIndicator Row" }, this.isFullHeight && h("casino-tournaments-ingame-state", { state: this.tournament.state, language: this.language, "is-timer-active": true, "is-status-enabled": true, "mb-source": this.mbSource, "translation-url": this.translationUrl, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "start-time": this.tournament.startTime, "end-time": this.tournament.endTime })), h("div", { class: "TournamentDetailHeader" }, h("div", { class: "TournamentName" }, this.tournament.nameOrTitle, " "), !this.tournament.playerEnrolled &&
                h("button", { class: `JoinButton`, disabled: this.isClaiming, onClick: this.joinTournament }, h("label", null, translate('join', this.language), " "))), h("div", { class: "TournamentDetailContent" }, h("div", { class: 'StartEnd' }, h("div", { innerHTML: CalendarSvg }), h("div", { class: 'Data' }, this.tournamentPageInfo.startTime, " - ", this.tournamentPageInfo.endTime)), h("div", { class: 'Rewards' }, h("div", { innerHTML: RewardSvg }), h("div", { class: 'RewardsTitle' }, " ", h("span", { class: 'Name' }, translate('topRewards', this.language), " "), this.tournament.prizes &&
                this.tournament.prizes.map((p, idx) => {
                    return idx <= this.maxPrizeCount &&
                        h("span", { class: 'RewardsItems Prize' }, p.name, idx < Math.min((this.tournament.prizes.length - 1), this.maxPrizeCount) ? ', ' : '', " ");
                }))), this.tournament.playerEnrolled && this.tournament.state !== 'Unstarted' &&
                h("div", { class: 'RankInfo' }, h("div", { class: 'Icon', innerHTML: UnqualifiedSvg }), h("div", { class: 'Details' }, h("span", { class: 'Rank' }, ((_b = this.playerRankInfo) === null || _b === void 0 ? void 0 : _b.rank) || '-'), " /", h("span", { class: 'Total' }, " ", this.leaderboardTotal || '-', " "), h("div", { class: `RankUpdate ${this.isRankUpdating ? 'Updating' : 'Hidden'}
                             ${this.isRankUp ? 'RankUp' : 'RankDown'}`, innerHTML: TriangleSvg })), (!this.playerRankInfo || this.playerRankInfo.unqualified) && h("div", { class: 'NotQualified' }, h("div", { class: 'Title' }, translate('notQualified', this.language)), h("div", { class: 'Reason' }, translate('reasonToQualify', this.language, {
                    values: {
                        bet1: this.tournament.minBetCount - (((_c = this.playerRankInfo) === null || _c === void 0 ? void 0 : _c.betCount) || 0)
                    }
                }), "  "))), (!this.tournament.playerEnrolled || this.tournament.state === 'Unstarted') &&
                h("div", { class: `Participants` }, h("div", { class: `ParticipantsAvatars  ${(this.avatars.length > 4 ? 'Wid4' : `Wid${this.avatars.length}`)}
                ${this.avatars.length == 0 ? 'Hidden' : ''}` }, this.avatars.map((avatar, idx) => {
                    return h("div", { class: 'Avatar', innerHTML: avatar, style: { left: `${idx * 8}px` } });
                })), this.tournament.overview.participants > 4
                    ? h("div", { class: 'ParticipantsCount' }, " + ", this.tournament.overview.participants - 4, " ", translate('joined', this.language))
                    :
                        h("div", { class: 'ParticipantsCount' }, this.tournament.overview.participants === 0
                            ? translate('noParticipant', this.language)
                            : `${this.tournament.overview.participants} ${translate('joined', this.language)}`)), h("div", { class: 'TabMenu' }, h("div", { class: 'Tabs' }, h("div", { class: `Tab Rule ${this.activeTab === 'rules' ? 'Active' : ''}`, "data-tab": "rules", onClick: this.handleTabClick }, "  ", translate('rules', this.language), " "), h("div", { class: `Tab Leaderboard ${this.activeTab === 'leaderboard' ? 'Active' : ''}`, "data-tab": "leaderboard", onClick: this.handleTabClick }, "  ", translate('leaderboard', this.language), " "), h("div", { class: `Tab Games ${this.activeTab === 'games' ? 'Active' : ''}`, "data-tab": "games", onClick: this.handleTabClick }, "  ", translate(this.isSportsEnabled && this.isCasinoEnabled ? 'activities' : (this.isSportsEnabled ? 'events' : 'games'), this.language), " "))))), h("div", { class: 'TabsContent' }, this.activeTab === 'rules' &&
                h("casino-tournaments-ingame-rule", { class: `RuleTab rules`, language: this.language, "translation-url": this.translationUrl, "cms-endpoint": this.cmsEndpoint, currency: this.currency, tournament: this.tournament, langulage: this.language }), h("casino-tournaments-ingame-table", { class: `LeaderboardTab leaderboard ${this.activeTab === 'leaderboard' ? '' : 'Hidden'}`, state: this.tournament.state, language: this.language, session: this.session, "mb-source": this.mbSource, "translation-url": this.translationUrl, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, endpoint: this.endpoint, "tournament-id": this.tournamentId, limit: "40", offset: this.leaderboardOffset }), this.activeTab === 'games' &&
                h("casino-tournaments-ingame-games", { class: `GamesTab games`, language: this.language, rules: (_e = (_d = this.tournament.metadata) === null || _d === void 0 ? void 0 : _d.sports) === null || _e === void 0 ? void 0 : _e.rules, "is-casino-enabled": this.isCasinoEnabled, "is-sports-enabled": this.isSportsEnabled, "current-game-id": this.currentGameId, "translation-url": this.translationUrl, session: this.session, endpoint: this.endpoint, "tournament-id": this.tournamentId }))), h("div", { key: '685782b244c187671f1201d9bd62bec8324ddf0f', class: `ToastWrapper ${this.showToasting ? 'Shown' : 'Hidden'} ${this.joinedSuccess ? 'Success' : 'Failed'}` }, h("div", { key: '7e4ea9863a7ee46a447229bf4163e3da41a94810', class: 'Icon', innerHTML: this.joinedSuccess ? SuccessSvg : ErrorSvg }), this.joinedSuccess
            ? h("div", { class: 'Info' }, " ", translate('joinedSuccess', this.language), " ")
            : [
                h("div", { class: 'Info' }, "[", this.joinResult.errorCode, "] ", this.joinResult.errorMessage, translate('joinedFailed', this.language))
            ]));
    }
    handleClientStylingChange(newValue, oldValue) {
        if (newValue != oldValue) {
            setClientStyling(this.stylingContainer, this.clientStyling);
        }
    }
    handleClientStylingUrlChange(newValue, oldValue) {
        if (newValue != oldValue) {
            setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
        }
    }
    handleNewTranslations() {
        getTranslations(this.translationUrl);
    }
    handleMbSourceChange(newValue, oldValue) {
        if (newValue != oldValue) {
            setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
        }
    }
    componentDidRender() {
        var _a, _b;
        if (this.tournamentId != ((_a = this.tournament) === null || _a === void 0 ? void 0 : _a.id)) { //incase player switch tourament too fast
            this.isTournamentLoading = true;
            this.tournamentId = ((_b = this.tournament) === null || _b === void 0 ? void 0 : _b.id) || this.tournamentId;
            this.resetDetailPage();
        }
    }
    componentDidLoad() {
        if (this.stylingContainer) {
            if (this.mbSource)
                setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
            if (this.clientStyling)
                setClientStyling(this.stylingContainer, this.clientStyling);
            if (this.clientStylingUrl)
                setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
        }
    }
    disconnectedCallback() {
        if (this.abortController) {
            this.abortController.abort();
        }
        this.stylingSubscription && this.stylingSubscription.unsubscribe();
    }
    static get is() { return "casino-tournaments-ingame-detail-page"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["casino-tournaments-ingame-detail-page.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["casino-tournaments-ingame-detail-page.css"]
        };
    }
    static get properties() {
        return {
            "mbSource": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "mb-source",
                "reflect": true
            },
            "clientStyling": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "client-styling",
                "reflect": true
            },
            "clientStylingUrl": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "client-styling-url",
                "reflect": true
            },
            "translationUrl": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Translation url"
                },
                "attribute": "translation-url",
                "reflect": true,
                "defaultValue": "''"
            },
            "tournamentId": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": true,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "tournament-id",
                "reflect": true
            },
            "endpoint": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": true,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "endpoint",
                "reflect": true
            },
            "session": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": true,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "session",
                "reflect": true
            },
            "cmsEndpoint": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "cms-endpoint",
                "reflect": true
            },
            "language": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "language",
                "reflect": true,
                "defaultValue": "'en'"
            },
            "limit": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "limit",
                "reflect": true,
                "defaultValue": "20"
            },
            "currency": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "currency",
                "reflect": true,
                "defaultValue": "'EUR'"
            },
            "currentGameId": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "current-game-id",
                "reflect": true
            },
            "isContainerFixHeight": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "is-container-fix-height",
                "reflect": true,
                "defaultValue": "true"
            }
        };
    }
    static get states() {
        return {
            "tournament": {},
            "isFullHeight": {},
            "tournamentPageInfo": {},
            "activeTab": {},
            "isTournamentLoading": {},
            "isClaiming": {},
            "avatars": {},
            "showToasting": {},
            "joinedSuccess": {},
            "playerRankInfo": {},
            "isRankUpdating": {},
            "isRankUp": {},
            "leaderboardTotal": {}
        };
    }
    static get events() {
        return [{
                "method": "tournamentDetailEvent",
                "name": "pageDetailExpand",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "complexType": {
                    "original": "Object",
                    "resolved": "Object",
                    "references": {
                        "Object": {
                            "location": "global",
                            "id": "global::Object"
                        }
                    }
                }
            }, {
                "method": "tourPageTabSwitchedEvent",
                "name": "tourPageTabSwitched",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "complexType": {
                    "original": "Object",
                    "resolved": "Object",
                    "references": {
                        "Object": {
                            "location": "global",
                            "id": "global::Object"
                        }
                    }
                }
            }];
    }
    static get elementRef() { return "hostElement"; }
    static get watchers() {
        return [{
                "propName": "tournamentId",
                "methodName": "onTournamentIdChanged"
            }, {
                "propName": "endpoint",
                "methodName": "onTournamentIdChanged"
            }, {
                "propName": "session",
                "methodName": "onTournamentIdChanged"
            }, {
                "propName": "language",
                "methodName": "onTournamentIdChanged"
            }, {
                "propName": "isFullHeight",
                "methodName": "onFullHeightChanged"
            }, {
                "propName": "clientStyling",
                "methodName": "handleClientStylingChange"
            }, {
                "propName": "clientStylingUrl",
                "methodName": "handleClientStylingUrlChange"
            }, {
                "propName": "translationUrl",
                "methodName": "handleNewTranslations"
            }, {
                "propName": "mbSource",
                "methodName": "handleMbSourceChange"
            }];
    }
    static get listeners() {
        return [{
                "name": "leaderboardLoaded",
                "method": "leaderboardLoadedHandler",
                "target": "body",
                "capture": false,
                "passive": false
            }, {
                "name": "tournamentUpdated",
                "method": "tournamentUpdatedHandler",
                "target": "document",
                "capture": false,
                "passive": false
            }];
    }
}
