/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
 */
import { Component, Input } from '@angular/core';
import { AppStateService } from '../../../services/AppStateService';
import { ClientSettingsService } from '../../../services/ClientSettingsService';
import { DisplayStateService } from '../../../services/DisplayStateService';
import { WebPlatformApiService } from './../../../services/WebPlatformApiService';
import { LandingPageUtilities } from './landing-page.utilities';
var LandingPageComponent = /** @class */ (function () {
    function LandingPageComponent(WebPlatformApiService, appStateService, displayStateService, clientSettingsService) {
        this.WebPlatformApiService = WebPlatformApiService;
        this.appStateService = appStateService;
        this.displayStateService = displayStateService;
        this.clientSettingsService = clientSettingsService;
    }
    /**
     * @return {?}
     */
    LandingPageComponent.prototype.ngAfterViewInit = /**
     * @return {?}
     */
    function () {
        var _this = this;
        setTimeout(function () {
            // workaround for ExpressionChangedAfterItHasBeenCheckedErrors
            _this.lpUtilities = new LandingPageUtilities(_this.WebPlatformApiService, _this.appStateService, _this.displayStateService, _this.clientSettingsService, _this.Config.config);
            _this.lpUtilities.Refresh();
        });
    };
    /**
     * @param {?} newVal
     * @return {?}
     */
    LandingPageComponent.prototype.onGroupFilterChange = /**
     * @param {?} newVal
     * @return {?}
     */
    function (newVal) {
        this.lpUtilities.applyGroupFilter(newVal);
    };
    /**
     * @param {?} viewName
     * @return {?}
     */
    LandingPageComponent.prototype.onViewChangeHandler = /**
     * @param {?} viewName
     * @return {?}
     */
    function (viewName) {
        this.lpUtilities.applyView(viewName);
    };
    /**
     * @param {?} search
     * @return {?}
     */
    LandingPageComponent.prototype.onSearchChangeHandler = /**
     * @param {?} search
     * @return {?}
     */
    function (search) {
        this.lpUtilities.applySearch(search);
    };
    LandingPageComponent.decorators = [
        { type: Component, args: [{
                    selector: 'app-landing-page',
                    template: "<ng-container *ngIf=\"lpUtilities\">\r\n  <div class=\"landing-page-filter\">\r\n    <div class=\"row no-gutters justify-content-between\">\r\n      <div *ngIf=\"Config.config === undefined || Config.config.ShowFilterByTags\" class=\"col-md-4\">\r\n        <div class=\"form-group px-2\">\r\n          <label for=\"filterByGroup\">\r\n            <h4>Filter by group</h4>\r\n          </label>\r\n          <select class=\"form-control\" id=\"filterByGroup\" [ngModel]=\"lpUtilities.userFilter\" (ngModelChange)=\"onGroupFilterChange($event)\">\r\n            <option value=\"all\">-- Show All --</option>\r\n            <option *ngFor=\"let tag of lpUtilities.layoutResultsAll\" [value]=\"tag.groupLabel\">{{tag.groupLabel}}</option>\r\n          </select>\r\n        </div>\r\n      </div>\r\n      <div *ngIf=\"Config.config && Config.config.ShowViewsSelector\" class=\"col-md-4\">\r\n        <div class=\"form-group px-2\">\r\n          <label for=\"selectView\">\r\n            <h4>Change Landing Page View</h4>\r\n          </label>\r\n          <select *ngIf=\"lpUtilities.selectedView\" id=\"selectView\" class=\"form-control\" [ngModel]=\"lpUtilities.selectedView.name\" (ngModelChange)=\"onViewChangeHandler($event)\">\r\n            <option *ngFor=\"let view of lpUtilities.views\" [value]=\"view.name\">{{view.name}}</option>\r\n          </select>\r\n        </div>\r\n      </div>\r\n      <div *ngIf=\"Config.config && Config.config.ShowQuickSearch\" class=\"col-md-8\">\r\n        <div class=\"form-group px-2\">\r\n          <label for=\"lpSearchInp\">\r\n            <h4>Quick Filter/Search</h4>\r\n          </label>\r\n          <div class=\"input-group stylish-input-group\">\r\n            <input id=\"lpSearchInp\" type=\"text\" class=\"form-control\" [(ngModel)]=\"searchField\" (ngModelChange)=\"onSearchChangeHandler($event)\">\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </div>\r\n  </div>\r\n  <div *ngIf=\"lpUtilities.layoutResults && lpUtilities.selectedView else noWidgets;\" class=\"landing-page-content\">\r\n    <div *ngFor=\"let group of lpUtilities.layoutResults\">\r\n      <div *ngIf=\"lpUtilities.selectedView.layout_style == 'wide'\">\r\n        <div *ngIf=\"(lpUtilities.userFilter === 'all' || lpUtilities.userFilter === 'tag') && group.tiles.length\" class=\"m-1 p-1 alert-info\">\r\n          <h4 class=\"m-1\">{{group.groupLabel.toUpperCase()}}</h4>\r\n          <div class=\"row no-gutters\" *ngIf=\"lpUtilities.userFilter === 'all' || lpUtilities.userFilter === 'tag'\">\r\n            <div [ngClass]=\"lpUtilities.layoutColsClass\" class=\"p-1\" *ngFor=\"let tile of group.tiles\">\r\n              <div class=\"card bg-faded p-1\">\r\n                <a *ngIf=\"tile.context\" class=\"text-dark\" [platformRouterLink]=\"tile.context\">\r\n                  <div>\r\n                    <div *ngIf=\"lpUtilities.selectedView.tile_style == 'card'\">\r\n                      <h5 class=\"card-title\">{{tile.title}}</h5>\r\n                      <p class=\"card-text\">{{tile.desc || 'No description set up for this widget !!'}}</p>\r\n                    </div>\r\n                    <div *ngIf=\"lpUtilities.selectedView.tile_style == 'list'\">\r\n                      <p class=\"card-title font-weight-bold\" container=\"body\" [tooltip]=\"tile.desc || 'No description set up for this widget !!'\">{{tile.title}}</p>\r\n                    </div>\r\n                  </div>\r\n                </a>\r\n                <a *ngIf=\"tile.url\" class=\"text-dark\" [href]=\"tile.url\" target=\"_blank\">\r\n                  <div>\r\n                    <div *ngIf=\"lpUtilities.selectedView.tile_style == 'card'\">\r\n                      <h5 class=\"card-title\">{{tile.title}}\r\n                        <i class=\"fa fa-external-link pull-right\" aria-hidden=\"true\"></i>\r\n                      </h5>\r\n                      <p class=\"card-text\">{{tile.desc || 'No description set up for this widget !!'}}</p>\r\n                    </div>\r\n                    <div *ngIf=\"lpUtilities.selectedView.tile_style == 'list'\">\r\n                      <p class=\"card-title font-weight-bold\" container=\"body\" [tooltip]=\"tile.desc || 'No description set up for this widget !!'\">{{tile.title}}\r\n                        <i class=\"fa fa-external-link pull-right\" aria-hidden=\"true\"></i>\r\n                      </p>\r\n                    </div>\r\n                  </div>\r\n                </a>\r\n              </div>\r\n            </div>\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </div>\r\n    <div *ngIf=\"lpUtilities.selectedView.layout_style == 'tall'\" class=\"card-columns\">\r\n      <div *ngFor=\"let group of lpUtilities.layoutResults\">\r\n        <div *ngIf=\"lpUtilities.userFilter === 'all' || lpUtilities.userFilter === 'tag'\" class=\"p-1 card alert-info\">\r\n          <h4 class=\"m-1\">{{group.groupLabel.toUpperCase()}}</h4>\r\n          <div class=\"row no-gutters\" *ngIf=\"lpUtilities.userFilter === 'all' || lpUtilities.userFilter === 'tag'\">\r\n            <div class=\"p-1\" *ngFor=\"let tile of group.tiles\">\r\n              <div class=\"card bg-faded p-1 px-4\">\r\n                <a *ngIf=\"tile.context && !tile.external\" class=\"text-dark\" [platformRouterLink]=\"tile.context\">\r\n                  <div>\r\n                    <div *ngIf=\"lpUtilities.selectedView.tile_style == 'card'\">\r\n                      <h5 class=\"card-title\">{{tile.title}}</h5>\r\n                      <p class=\"card-text\">{{tile.desc || 'No description set up for this widget !!'}}</p>\r\n                    </div>\r\n                    <div *ngIf=\"lpUtilities.selectedView.tile_style == 'list'\">\r\n                      <p class=\"card-title font-weight-bold\" container=\"body\" [tooltip]=\"tile.desc || 'No description set up for this widget !!'\">{{tile.title}}</p>\r\n                    </div>\r\n                  </div>\r\n                </a>\r\n                <a *ngIf=\"tile.url || tile.external\" class=\"text-dark\" [href]=\"tile.url\" target=\"_blank\">\r\n                  <div>\r\n                    <div *ngIf=\"lpUtilities.selectedView.tile_style == 'card'\">\r\n                      <h5 class=\"card-title\">{{tile.title}}\r\n                        <i class=\"fa fa-external-link pull-right\" aria-hidden=\"true\"></i>\r\n                      </h5>\r\n                      <p class=\"card-text\">{{tile.desc || 'No description set up for this widget !!'}}</p>\r\n                    </div>\r\n                    <div *ngIf=\"lpUtilities.selectedView.tile_style == 'list'\">\r\n                      <p class=\"card-title font-weight-bold\" container=\"body\" [tooltip]=\"tile.desc || 'No description set up for this widget !!'\">{{tile.title}}</p>\r\n                    </div>\r\n                  </div>\r\n                </a>\r\n              </div>\r\n            </div>\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </div>\r\n  </div>\r\n</ng-container>\r\n\r\n<ng-template #noWidgets>\r\n  <h3>\r\n    No widgets available for this {{groupByContext ? \"context/widget\" : \"area/widget\"}}\r\n  </h3>\r\n</ng-template>",
                    styles: [""]
                }] }
    ];
    /** @nocollapse */
    LandingPageComponent.ctorParameters = function () { return [
        { type: WebPlatformApiService },
        { type: AppStateService },
        { type: DisplayStateService },
        { type: ClientSettingsService }
    ]; };
    LandingPageComponent.propDecorators = {
        Config: [{ type: Input }]
    };
    return LandingPageComponent;
}());
export { LandingPageComponent };
if (false) {
    /** @type {?} */
    LandingPageComponent.prototype.Config;
    /** @type {?} */
    LandingPageComponent.prototype.lpUtilities;
    /** @type {?} */
    LandingPageComponent.prototype.searchField;
    /** @type {?} */
    LandingPageComponent.prototype.groupByContext;
    /** @type {?} */
    LandingPageComponent.prototype.WebPlatformApiService;
    /** @type {?} */
    LandingPageComponent.prototype.appStateService;
    /** @type {?} */
    LandingPageComponent.prototype.displayStateService;
    /** @type {?} */
    LandingPageComponent.prototype.clientSettingsService;
}

//# sourceMappingURL=data:application/json;base64, 