import { __decorate } from "tslib";
import { Component, Input, Output, EventEmitter } from '@angular/core';
var TestIndexComponent = /** @class */ (function () {
    function TestIndexComponent() {
        this.indexChanged = new EventEmitter();
    }
    TestIndexComponent.prototype.ngOnChanges = function (changes) { };
    TestIndexComponent.prototype.ngOnInit = function () { };
    TestIndexComponent.prototype.questionChanged = function (index) {
        this.currentIndex = this.indexOfItems[index].sequence;
        this.indexChanged.emit(this.indexOfItems[index]);
    };
    TestIndexComponent.prototype.updateBookMarkStatus = function (bookmarkDetails) {
        if (!bookmarkDetails ||
            (this.indexOfItems && this.indexOfItems.length === 0)) {
            return false;
        }
        this.indexOfItems.map(function (object) {
            if (object.itemId === bookmarkDetails.itemId) {
                object.itemBookmark = bookmarkDetails.bookmarkstatus;
            }
        });
    };
    __decorate([
        Input()
    ], TestIndexComponent.prototype, "indexOfItems", void 0);
    __decorate([
        Input()
    ], TestIndexComponent.prototype, "selectedTheme", void 0);
    __decorate([
        Input()
    ], TestIndexComponent.prototype, "currentIndex", void 0);
    __decorate([
        Output()
    ], TestIndexComponent.prototype, "indexChanged", void 0);
    TestIndexComponent = __decorate([
        Component({
            selector: 'lib-test-index',
            template: "<ng-container *ngIf=\"indexOfItems && indexOfItems.length > 0\">\n  <ul class=\"list-item\">\n    <ng-container *ngFor=\"let item of indexOfItems; let i = index\">\n      <li\n        (click)=\"questionChanged(i)\"\n        [attr.data-index]=\"i\"\n        [class.list-item-selected]=\"item.sequence == currentIndex\"\n      >\n        {{ i + 1 }}\n        <ng-container *ngIf=\"item.itemBookmark == true\">\n          <img\n            class=\"examTaker-marked-icon\"\n            src=\"assets/engine-icons/mark-icon.png\"\n          />\n        </ng-container>\n      </li>\n    </ng-container>\n  </ul>\n</ng-container>\n",
            styles: [".list-item{margin:0;padding:0}.list-item li{list-style:none;margin:0;padding:3px 5px 3px 18px;width:100%;text-align:left;font-size:13px;position:relative;color:var(--text-color)}.list-item li:before{content:'';font-size:40px;color:var(--text-color);position:absolute;left:8px;top:10px;line-height:normal;width:5px;height:5px;background-color:var(--secondary-color);border-radius:50%}.list-item li:hover:before{color:#fff;background-color:#fff}.list-item li:nth-child(2n-2){background-color:var(--secondary-color)}.list-item-selected{background-color:var(--primary-color)!important;pointer-events:none;color:#fff}.list-item li:hover{background-color:var(--primary-color)!important;cursor:pointer;color:#fff}.list-item-selected:before{color:#fff;background-color:#fff!important}.examTaker-marked-icon{width:8px}"]
        })
    ], TestIndexComponent);
    return TestIndexComponent;
}());
export { TestIndexComponent };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC1pbmRleC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9leGFtLWVuZ2luZS1saWJyYXJpZXMvIiwic291cmNlcyI6WyJsaWIvc2hhcmVkL2NvbXBvbmVudHMvY29tbW9uL3Rlc3QtaW5kZXgvdGVzdC1pbmRleC5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFDTCxTQUFTLEVBRVQsS0FBSyxFQUNMLE1BQU0sRUFDTixZQUFZLEVBR2IsTUFBTSxlQUFlLENBQUM7QUFRdkI7SUFLRTtRQURVLGlCQUFZLEdBQUcsSUFBSSxZQUFZLEVBQU8sQ0FBQztJQUNqQyxDQUFDO0lBQ2pCLHdDQUFXLEdBQVgsVUFBWSxPQUFzQixJQUFJLENBQUM7SUFDdkMscUNBQVEsR0FBUixjQUFhLENBQUM7SUFFZCw0Q0FBZSxHQUFmLFVBQWdCLEtBQUs7UUFDbkIsSUFBSSxDQUFDLFlBQVksR0FBRyxJQUFJLENBQUMsWUFBWSxDQUFDLEtBQUssQ0FBQyxDQUFDLFFBQVEsQ0FBQztRQUN0RCxJQUFJLENBQUMsWUFBWSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsWUFBWSxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUM7SUFDbkQsQ0FBQztJQUNELGlEQUFvQixHQUFwQ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