import { Component, HostBinding, Inject, Input } from '@angular/core';
import { BACKEND_URL } from '@aztrix/environment';
import { TranslateService } from '@aztrix/helpers';
import { BehaviorSubject, combineLatest, map } from 'rxjs';
import * as i0 from "@angular/core";
import * as i1 from "@aztrix/helpers";
import * as i2 from "@angular/common";
import * as i3 from "rxjs";
export class LegalFooterComponent {
    constructor(_translate, _backendUrl$) {
        this._translate = _translate;
        this._backendUrl$ = _backendUrl$;
        this.color = 'inherit';
        this.legalText = true;
        this.termsUrl$ = combineLatest([this._backendUrl$, this._translate.lang$]).pipe(map(([backendUrl, lang]) => backendUrl + `/policy?type=terms_conditions&lang=${lang}`));
        this.privacyUrl$ = combineLatest([this._backendUrl$, this._translate.lang$]).pipe(map(([backendUrl, lang]) => backendUrl + `/policy?type=privacy_policy_preface&lang=${lang}`));
    }
    get bugMail() {
        const subject = this._translate.instant('mail.bug.subject');
        return `mailto:${encodeURI('report@aztrix.me')}?subject=${encodeURI(subject)}`;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LegalFooterComponent, deps: [{ token: i1.TranslateService }, { token: BACKEND_URL }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: LegalFooterComponent, selector: "ax-legal-footer", inputs: { color: "color", legalText: "legalText" }, host: { properties: { "class": "this.color" } }, ngImport: i0, template: "<div class=\"text\">\n  <div class=\"legal legal-text\" *ngIf=\"legalText\">\n    {{ 'legal.text' | translate }}\n  </div>\n  <div class=\"legal\">\n    <a\n      [ngClass]=\"{'ax-base-color': color === 'primary'}\"\n      [href]=\"termsUrl$ | async\"\n      target=\"_blank\"\n      >{{ 'label.terms' | translate }}</a\n    >\n    -\n    <a\n      [ngClass]=\"{'ax-base-color': color === 'primary'}\"\n      [href]=\"privacyUrl$ | async\"\n      target=\"_blank\"\n      >{{ 'label.privacy.policy' | translate }}</a\n    >\n    -\n    <a [ngClass]=\"{'ax-base-color': color === 'primary'}\" [href]=\"bugMail\">{{\n      'label.report.abuse' | translate\n    }}</a>\n  </div>\n</div>\n", styles: [":host{display:flex;flex-direction:column;align-items:center}:host span{font-size:.875rem;margin-right:.25rem}:host a{cursor:pointer}:host a:hover{text-decoration:underline}:host.inherit a{color:inherit}.legal.legal-text{margin-top:.5rem}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LegalFooterComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-legal-footer', template: "<div class=\"text\">\n  <div class=\"legal legal-text\" *ngIf=\"legalText\">\n    {{ 'legal.text' | translate }}\n  </div>\n  <div class=\"legal\">\n    <a\n      [ngClass]=\"{'ax-base-color': color === 'primary'}\"\n      [href]=\"termsUrl$ | async\"\n      target=\"_blank\"\n      >{{ 'label.terms' | translate }}</a\n    >\n    -\n    <a\n      [ngClass]=\"{'ax-base-color': color === 'primary'}\"\n      [href]=\"privacyUrl$ | async\"\n      target=\"_blank\"\n      >{{ 'label.privacy.policy' | translate }}</a\n    >\n    -\n    <a [ngClass]=\"{'ax-base-color': color === 'primary'}\" [href]=\"bugMail\">{{\n      'label.report.abuse' | translate\n    }}</a>\n  </div>\n</div>\n", styles: [":host{display:flex;flex-direction:column;align-items:center}:host span{font-size:.875rem;margin-right:.25rem}:host a{cursor:pointer}:host a:hover{text-decoration:underline}:host.inherit a{color:inherit}.legal.legal-text{margin-top:.5rem}\n"] }]
        }], ctorParameters: () => [{ type: i1.TranslateService }, { type: i3.BehaviorSubject, decorators: [{
                    type: Inject,
                    args: [BACKEND_URL]
                }] }], propDecorators: { color: [{
                type: Input
            }, {
                type: HostBinding,
                args: ['class']
            }], legalText: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64, 