import { Component, EventEmitter, Output } from '@angular/core';
import { MatomoService } from '@aztrix/helpers';
import { SettingsService } from '@aztrix/sdk';
import { first } from 'rxjs';
import * as i0 from "@angular/core";
import * as i1 from "@aztrix/sdk";
import * as i2 from "@aztrix/helpers";
import * as i3 from "./country-setting-button/country-setting-button.component";
import * as i4 from "./delete-account-setting-button/delete-account-setting-button.component";
import * as i5 from "./language-setting-button/language-setting-button.component";
import * as i6 from "./login-value-setting-button/login-value-setting-button.component";
import * as i7 from "./newsletter-setting-button/newsletter-setting-button.component";
import * as i8 from "./password-setting-button/password-setting-button.component";
import * as i9 from "./analytics-setting-button/analytics-setting-button.component";
import * as i10 from "../account-navigation/account-navigation.component";
import * as i11 from "@aztrix/translate";
export class AccountSettingsComponent {
    constructor(_settings, _matomoService) {
        this._settings = _settings;
        this._matomoService = _matomoService;
        this.logout = new EventEmitter();
        this._settings
            .getAccountSettings()
            .pipe(first())
            .subscribe((settings) => {
            this.settings = settings;
            if (settings.collectAnalytics) {
                this._matomoService.setConsentGiven();
            }
            else {
                this._matomoService.removeConsentGiven();
            }
        });
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountSettingsComponent, deps: [{ token: i1.SettingsService }, { token: i2.MatomoService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: AccountSettingsComponent, selector: "ax-account-settings", outputs: { logout: "logout" }, ngImport: i0, template: "<ax-account-navigation [title]=\"'label.settings' | translate\"></ax-account-navigation>\n\n<p>{{ 'label.language' | translate }}</p>\n<ax-language-setting-button [(settings)]=\"settings\"></ax-language-setting-button>\n<p>{{ 'settings.account.locale.country.title' | translate }}</p>\n<ax-country-setting-button [(settings)]=\"settings\"></ax-country-setting-button>\n<p>{{ 'settings.account.credentials.title' | translate }}</p>\n<div class=\"group\">\n  <ax-login-value-setting-button [(settings)]=\"settings\"></ax-login-value-setting-button>\n  <ax-password-setting-button></ax-password-setting-button>\n</div>\n\n<p>{{ 'settings.account.newsletter' | translate }}</p>\n<ax-newsletter-setting-button [settings]=\"settings\"></ax-newsletter-setting-button>\n\n<ng-content></ng-content>\n\n<p>{{ 'settings.privacy.analytics' | translate }}</p>\n<ax-analytics-setting-button [settings]=\"settings\"></ax-analytics-setting-button>\n\n<p>{{ 'me.account.profile.title' | translate }}</p>\n<ax-delete-account-setting-button (logout)=\"logout.emit()\"></ax-delete-account-setting-button>\n", styles: [":host{display:block;max-width:var(--container-max-width);width:100%;margin:0 auto;padding:1rem}.group{display:flex;flex-direction:column;justify-content:center;gap:1rem}\n"], dependencies: [{ kind: "component", type: i3.CountrySettingButtonComponent, selector: "ax-country-setting-button", inputs: ["settings"], outputs: ["settingsChange"] }, { kind: "component", type: i4.DeleteAccountSettingButtonComponent, selector: "ax-delete-account-setting-button", outputs: ["logout"] }, { kind: "component", type: i5.LanguageSettingButtonComponent, selector: "ax-language-setting-button", inputs: ["settings"], outputs: ["settingsChange"] }, { kind: "component", type: i6.LoginValueSettingButtonComponent, selector: "ax-login-value-setting-button", inputs: ["settings"], outputs: ["settingsChange"] }, { kind: "component", type: i7.NewsletterSettingButtonComponent, selector: "ax-newsletter-setting-button", inputs: ["settings"] }, { kind: "component", type: i8.PasswordSettingButtonComponent, selector: "ax-password-setting-button" }, { kind: "component", type: i9.AnalyticsSettingButtonComponent, selector: "ax-analytics-setting-button", inputs: ["settings"] }, { kind: "component", type: i10.AccountNavigationComponent, selector: "ax-account-navigation", inputs: ["title"] }, { kind: "pipe", type: i11.TranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AccountSettingsComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-account-settings', template: "<ax-account-navigation [title]=\"'label.settings' | translate\"></ax-account-navigation>\n\n<p>{{ 'label.language' | translate }}</p>\n<ax-language-setting-button [(settings)]=\"settings\"></ax-language-setting-button>\n<p>{{ 'settings.account.locale.country.title' | translate }}</p>\n<ax-country-setting-button [(settings)]=\"settings\"></ax-country-setting-button>\n<p>{{ 'settings.account.credentials.title' | translate }}</p>\n<div class=\"group\">\n  <ax-login-value-setting-button [(settings)]=\"settings\"></ax-login-value-setting-button>\n  <ax-password-setting-button></ax-password-setting-button>\n</div>\n\n<p>{{ 'settings.account.newsletter' | translate }}</p>\n<ax-newsletter-setting-button [settings]=\"settings\"></ax-newsletter-setting-button>\n\n<ng-content></ng-content>\n\n<p>{{ 'settings.privacy.analytics' | translate }}</p>\n<ax-analytics-setting-button [settings]=\"settings\"></ax-analytics-setting-button>\n\n<p>{{ 'me.account.profile.title' | translate }}</p>\n<ax-delete-account-setting-button (logout)=\"logout.emit()\"></ax-delete-account-setting-button>\n", styles: [":host{display:block;max-width:var(--container-max-width);width:100%;margin:0 auto;padding:1rem}.group{display:flex;flex-direction:column;justify-content:center;gap:1rem}\n"] }]
        }], ctorParameters: () => [{ type: i1.SettingsService }, { type: i2.MatomoService }], propDecorators: { logout: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64, 