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ourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@rubengg/ngx-pagination-plus@1.0.1/dist/ngx-pagination.umd.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common')) :\n\ttypeof define === 'function' && define.amd ? define(['exports', '@angular/core', '@angular/common'], factory) :\n\t(factory((global.ngxPagination = {}),global.core,global.common));\n}(this, (function (exports,core,common) { 'use strict';\n\nvar PaginationService = /** @class */ (function () {\r\n    function PaginationService() {\r\n        this.change = new core.EventEmitter();\r\n        this.instances = {};\r\n        this.DEFAULT_ID = 'DEFAULT_PAGINATION_ID';\r\n    }\r\n    PaginationService.prototype.defaultId = function () { return this.DEFAULT_ID; };\r\n    /**\r\n     * Register a PaginationInstance with this service. Returns a\r\n     * boolean value signifying whether the instance is new or\r\n     * updated (true = new or updated, false = unchanged).\r\n     */\r\n    PaginationService.prototype.register = function (instance) {\r\n        if (instance.id == null) {\r\n            instance.id = this.DEFAULT_ID;\r\n        }\r\n        if (!this.instances[instance.id]) {\r\n            this.instances[instance.id] = instance;\r\n            return true;\r\n        }\r\n        else {\r\n            return this.updateInstance(instance);\r\n        }\r\n    };\r\n    /**\r\n     * Check each property of the instance and update any that have changed. Return\r\n     * true if any changes were made, else return false.\r\n     */\r\n    PaginationService.prototype.updateInstance = function (instance) {\r\n        var changed = false;\r\n        for (var prop in this.instances[instance.id]) {\r\n            if (instance[prop] !== this.instances[instance.id][prop]) {\r\n                this.instances[instance.id][prop] = instance[prop];\r\n                changed = true;\r\n            }\r\n        }\r\n        return changed;\r\n    };\r\n    /**\r\n     * Returns the current page number.\r\n     */\r\n    PaginationService.prototype.getCurrentPage = function (id) {\r\n        if (this.instances[id]) {\r\n            return this.instances[id].currentPage;\r\n        }\r\n    };\r\n    /**\r\n     * Sets the current page number.\r\n     */\r\n    PaginationService.prototype.setCurrentPage = function (id, page) {\r\n        if (this.instances[id]) {\r\n            var instance = this.instances[id];\r\n            var maxPage = Math.ceil(instance.totalItems / instance.itemsPerPage);\r\n            if (page <= maxPage && 1 <= page) {\r\n                this.instances[id].currentPage = page;\r\n                this.change.emit(id);\r\n            }\r\n        }\r\n    };\r\n    /**\r\n     * Sets the value of instance.totalItems\r\n     */\r\n    PaginationService.prototype.setTotalItems = function (id, totalItems) {\r\n        if (this.instances[id] && 0 <= totalItems) {\r\n            this.instances[id].totalItems = totalItems;\r\n            this.change.emit(id);\r\n        }\r\n    };\r\n    /**\r\n     * Sets the value of instance.itemsPerPage.\r\n     */\r\n    PaginationService.prototype.setItemsPerPage = function (id, itemsPerPage) {\r\n        if (this.instances[id]) {\r\n            this.instances[id].itemsPerPage = itemsPerPage;\r\n            this.change.emit(id);\r\n        }\r\n    };\r\n    /**\r\n     * Returns a clone of the pagination instance object matching the id. If no\r\n     * id specified, returns the instance corresponding to the default id.\r\n     */\r\n    PaginationService.prototype.getInstance = function (id) {\r\n        if (id === void 0) { id = this.DEFAULT_ID; }\r\n        if (this.instances[id]) {\r\n            return this.clone(this.instances[id]);\r\n        }\r\n        return {};\r\n    };\r\n    /**\r\n     * Perform a shallow clone of an object.\r\n     */\r\n    PaginationService.prototype.clone = function (obj) {\r\n        var target = {};\r\n        for (var i in obj) {\r\n            if (obj.hasOwnProperty(i)) {\r\n                target[i] = obj[i];\r\n            }\r\n        }\r\n        return target;\r\n    };\r\n    return PaginationService;\r\n}());\n\nvar __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\r\n    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n    if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n    return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\r\n    if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\r\n};\r\nvar LARGE_NUMBER = Number.MAX_SAFE_INTEGER;\r\nvar PaginatePipe = /** @class */ (function () {\r\n    function PaginatePipe(service) {\r\n        this.service = service;\r\n        // store the values from the last time the pipe was invoked\r\n        this.state = {};\r\n    }\r\n    PaginatePipe.prototype.transform = function (collection, args) {\r\n        // When an observable is passed through the AsyncPipe, it will output\r\n        // `null` until the subscription resolves. In this case, we want to\r\n        // use the cached data from the `state` object to prevent the NgFor\r\n        // from flashing empty until the real values arrive.\r\n        if (!(collection instanceof Array)) {\r\n            var _id = args.id || this.service.defaultId();\r\n            if (this.state[_id]) {\r\n                return this.state[_id].slice;\r\n            }\r\n            else {\r\n                return collection;\r\n            }\r\n        }\r\n        var serverSideMode = args.totalItems && args.totalItems !== collection.length;\r\n        var instance = this.createInstance(collection, args);\r\n        var id = instance.id;\r\n        var start, end;\r\n        var perPage = instance.itemsPerPage;\r\n        var emitChange = this.service.register(instance);\r\n        if (!serverSideMode && collection instanceof Array) {\r\n            perPage = +perPage || LARGE_NUMBER;\r\n            start = (instance.currentPage - 1) * perPage;\r\n            end = start + perPage;\r\n            var isIdentical = this.stateIsIdentical(id, collection, start, end);\r\n            if (isIdentical) {\r\n                return this.state[id].slice;\r\n            }\r\n            else {\r\n                var slice = collection.slice(start, end);\r\n                this.saveState(id, collection, slice, start, end);\r\n                this.service.change.emit(id);\r\n                return slice;\r\n            }\r\n        }\r\n        else {\r\n            if (emitChange) {\r\n                this.service.change.emit(id);\r\n            }\r\n            // save the state for server-side collection to avoid null\r\n            // flash as new data loads.\r\n            this.saveState(id, collection, collection, start, end);\r\n            return collection;\r\n        }\r\n    };\r\n    /**\r\n     * Create an PaginationInstance object, using defaults for any optional properties not supplied.\r\n     */\r\n    PaginatePipe.prototype.createInstance = function (collection, config) {\r\n        this.checkConfig(config);\r\n        return {\r\n            id: config.id != null ? config.id : this.service.defaultId(),\r\n            itemsPerPage: +config.itemsPerPage || 0,\r\n            currentPage: +config.currentPage || 1,\r\n            totalItems: +config.totalItems || collection.length\r\n        };\r\n    };\r\n    /**\r\n     * Ensure the argument passed to the filter contains the required properties.\r\n     */\r\n    PaginatePipe.prototype.checkConfig = function (config) {\r\n        var required = ['itemsPerPage', 'currentPage'];\r\n        var missing = required.filter(function (prop) { return !(prop in config); });\r\n        if (0 < missing.length) {\r\n            throw new Error(\"PaginatePipe: Argument is missing the following required properties: \" + missing.join(', '));\r\n        }\r\n    };\r\n    /**\r\n     * To avoid returning a brand new array each time the pipe is run, we store the state of the sliced\r\n     * array for a given id. This means that the next time the pipe is run on this collection & id, we just\r\n     * need to check that the collection, start and end points are all identical, and if so, return the\r\n     * last sliced array.\r\n     */\r\n    PaginatePipe.prototype.saveState = function (id, collection, slice, start, end) {\r\n        this.state[id] = {\r\n            collection: collection,\r\n            size: collection.length,\r\n            slice: slice,\r\n            start: start,\r\n            end: end\r\n        };\r\n    };\r\n    /**\r\n     * For a given id, returns true if the collection, size, start and end values are identical.\r\n     */\r\n    PaginatePipe.prototype.stateIsIdentical = function (id, collection, start, end) {\r\n        var state = this.state[id];\r\n        if (!state) {\r\n            return false;\r\n        }\r\n        var isMetaDataIdentical = state.size === collection.length &&\r\n            state.start === start &&\r\n            state.end === end;\r\n        if (!isMetaDataIdentical) {\r\n            return false;\r\n        }\r\n        return state.slice.every(function (element, index) { return element === collection[start + index]; });\r\n    };\r\n    PaginatePipe = __decorate$1([\r\n        core.Pipe({\r\n            name: 'paginate',\r\n            pure: false\r\n        }),\r\n        __metadata(\"design:paramtypes\", [PaginationService])\r\n    ], PaginatePipe);\r\n    return PaginatePipe;\r\n}());\n\n/**\r\n * The default template and styles for the pagination links are borrowed directly\r\n * from Zurb Foundation 6: http://foundation.zurb.com/sites/docs/pagination.html\r\n */\r\nvar DEFAULT_TEMPLATE = \"\\n    <pagination-template  #p=\\\"paginationApi\\\"\\n                         [id]=\\\"id\\\"\\n                         [maxSize]=\\\"maxSize\\\"\\n                         (pageChange)=\\\"pageChange.emit($event)\\\"\\n                         (pageBoundsCorrection)=\\\"pageBoundsCorrection.emit($event)\\\">\\n    <ul class=\\\"ngx-pagination\\\" \\n        role=\\\"navigation\\\" \\n        [attr.aria-label]=\\\"screenReaderPaginationLabel\\\" \\n        [class.responsive]=\\\"responsive\\\"\\n        *ngIf=\\\"!(autoHide && p.pages.length <= 1)\\\">\\n        <li class=\\\"pagination-previous\\\" [class.disabled]=\\\"p.isFirstPage()\\\" *ngIf=\\\"directionLinks\\\"> \\n            <a tabindex=\\\"0\\\" *ngIf=\\\"1 < p.getCurrent()\\\" (keyup.enter)=\\\"p.setCurrent(1)\\\" (click)=\\\"p.setCurrent(1)\\\" [attr.aria-label]=\\\"firstLabel + ' ' + screenReaderPageLabel\\\">\\n            {{ firstLabel }} <span class=\\\"show-for-sr\\\">{{ screenReaderPageLabel }}</span>\\n            </a>\\n            <span *ngIf=\\\"p.isFirstPage()\\\">\\n                {{ firstLabel }} <span class=\\\"show-for-sr\\\">{{ screenReaderPageLabel }}</span>\\n            </span>\\n        </li>\\n        <li class=\\\"pagination-previous\\\" [class.disabled]=\\\"p.isFirstPage()\\\" *ngIf=\\\"directionLinks\\\"> \\n            <a tabindex=\\\"0\\\" *ngIf=\\\"1 < p.getCurrent()\\\" (keyup.enter)=\\\"p.previous()\\\" (click)=\\\"p.previous()\\\" [attr.aria-label]=\\\"previousLabel + ' ' + screenReaderPageLabel\\\">\\n                {{ previousLabel }} <span class=\\\"show-for-sr\\\">{{ screenReaderPageLabel }}</span>\\n            </a>\\n            <span *ngIf=\\\"p.isFirstPage()\\\">\\n                {{ previousLabel }} <span class=\\\"show-for-sr\\\">{{ screenReaderPageLabel }}</span>\\n            </span>\\n        </li> \\n\\n        <li class=\\\"small-screen\\\">\\n            {{ p.getCurrent() }} / {{ p.getLastPage() }}\\n        </li>\\n\\n        <li [class.current]=\\\"p.getCurrent() === page.value\\\" \\n            [class.ellipsis]=\\\"page.label === '...'\\\"\\n            *ngFor=\\\"let page of p.pages\\\">\\n            <a tabindex=\\\"0\\\" (keyup.enter)=\\\"p.setCurrent(page.value)\\\" (click)=\\\"p.setCurrent(page.value)\\\" *ngIf=\\\"p.getCurrent() !== page.value\\\">\\n                <span class=\\\"show-for-sr\\\">{{ screenReaderPageLabel }} </span>\\n                <span>{{ (page.label === '...') ? page.label : (page.label | number:'') }}</span>\\n            </a>\\n            <ng-container *ngIf=\\\"p.getCurrent() === page.value\\\">\\n                <span class=\\\"show-for-sr\\\">{{ screenReaderCurrentLabel }} </span>\\n                <span>{{ (page.label === '...') ? page.label : (page.label | number:'') }}</span> \\n            </ng-container>\\n        </li>\\n\\n        <li class=\\\"pagination-next\\\" [class.disabled]=\\\"p.isLastPage()\\\" *ngIf=\\\"directionLinks\\\">\\n            <a tabindex=\\\"0\\\" *ngIf=\\\"!p.isLastPage()\\\" (keyup.enter)=\\\"p.next()\\\" (click)=\\\"p.next()\\\" [attr.aria-label]=\\\"nextLabel + ' ' + screenReaderPageLabel\\\">\\n                 {{ nextLabel }} <span class=\\\"show-for-sr\\\">{{ screenReaderPageLabel }}</span>\\n            </a>\\n            <span *ngIf=\\\"p.isLastPage()\\\">\\n                 {{ nextLabel }} <span class=\\\"show-for-sr\\\">{{ screenReaderPageLabel }}</span>\\n            </span>\\n        </li>\\n\\n        <li class=\\\"pagination-next\\\" [class.disabled]=\\\"p.isLastPage()\\\" *ngIf=\\\"directionLinks\\\">\\n        <a tabindex=\\\"0\\\" *ngIf=\\\"!p.isLastPage()\\\" (keyup.enter)=\\\"p.getLastPage()\\\" (click)=\\\"p.getLastPage()\\\" [attr.aria-label]=\\\"lastLabel + ' ' + screenReaderPageLabel\\\">\\n             {{ lastLabel }} <span class=\\\"show-for-sr\\\">{{ screenReaderPageLabel }}</span>\\n        </a>\\n        <span *ngIf=\\\"p.isLastPage()\\\">\\n             {{ lastLabel }} <span class=\\\"show-for-sr\\\">{{ screenReaderPageLabel }}</span>\\n        </span>\\n    </li>\\n\\n    </ul>\\n    </pagination-template>\\n    \";\r\nvar DEFAULT_STYLES = \"\\n.ngx-pagination {\\n  margin-left: 0;\\n  margin-bottom: 1rem; }\\n  .ngx-pagination::before, .ngx-pagination::after {\\n    content: ' ';\\n    display: table; }\\n  .ngx-pagination::after {\\n    clear: both; }\\n  .ngx-pagination li {\\n    -moz-user-select: none;\\n    -webkit-user-select: none;\\n    -ms-user-select: none;\\n    margin-right: 0.0625rem;\\n    border-radius: 0; }\\n  .ngx-pagination li {\\n    display: inline-block; }\\n  .ngx-pagination a,\\n  .ngx-pagination button {\\n    color: #0a0a0a; \\n    display: block;\\n    padding: 0.1875rem 0.625rem;\\n    border-radius: 0; }\\n    .ngx-pagination a:hover,\\n    .ngx-pagination button:hover {\\n      background: #e6e6e6; }\\n  .ngx-pagination .current {\\n    padding: 0.1875rem 0.625rem;\\n    background: #2199e8;\\n    color: #fefefe;\\n    cursor: default; }\\n  .ngx-pagination .disabled {\\n    padding: 0.1875rem 0.625rem;\\n    color: #cacaca;\\n    cursor: default; } \\n    .ngx-pagination .disabled:hover {\\n      background: transparent; }\\n  .ngx-pagination a, .ngx-pagination button {\\n    cursor: pointer; }\\n\\n.ngx-pagination .pagination-previous a::before,\\n.ngx-pagination .pagination-previous.disabled::before { \\n  content: '\\u00AB';\\n  display: inline-block;\\n  margin-right: 0rem; }\\n\\n.ngx-pagination .pagination-next a::after,\\n.ngx-pagination .pagination-next.disabled::after {\\n  content: '\\u00BB';\\n  display: inline-block;\\n  margin-left: 0rem; }\\n\\n.ngx-pagination .show-for-sr {\\n  position: absolute !important;\\n  width: 1px;\\n  height: 1px;\\n  overflow: hidden;\\n  clip: rect(0, 0, 0, 0); }\\n.ngx-pagination .small-screen {\\n  display: none; }\\n@media screen and (max-width: 601px) {\\n  .ngx-pagination.responsive .small-screen {\\n    display: inline-block; } \\n  .ngx-pagination.responsive li:not(.small-screen):not(.pagination-previous):not(.pagination-next) {\\n    display: none; }\\n}\\n  \";\n\nvar __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\r\n    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n    if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n    return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\nvar __metadata$1 = (undefined && undefined.__metadata) || function (k, v) {\r\n    if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\r\n};\r\nfunction coerceToBoolean(input) {\r\n    return !!input && input !== 'false';\r\n}\r\n/**\r\n * The default pagination controls component. Actually just a default implementation of a custom template.\r\n */\r\nvar PaginationControlsComponent = /** @class */ (function () {\r\n    function PaginationControlsComponent() {\r\n        this.maxSize = 7;\r\n        this.previousLabel = 'Previous';\r\n        this.firstLabel = 'First';\r\n        this.nextLabel = 'Next';\r\n        this.lastLabel = 'Last';\r\n        this.screenReaderPaginationLabel = 'Pagination';\r\n        this.screenReaderPageLabel = 'page';\r\n        this.screenReaderCurrentLabel = \"You're on page\";\r\n        this.pageChange = new core.EventEmitter();\r\n        this.pageBoundsCorrection = new core.EventEmitter();\r\n        this._directionLinks = true;\r\n        this._autoHide = false;\r\n        this._responsive = false;\r\n    }\r\n    Object.defineProperty(PaginationControlsComponent.prototype, \"directionLinks\", {\r\n        get: function () {\r\n            return this._directionLinks;\r\n        },\r\n        set: function (value) {\r\n            this._directionLinks = coerceToBoolean(value);\r\n        },\r\n        enumerable: true,\r\n        configurable: true\r\n    });\r\n    Object.defineProperty(PaginationControlsComponent.prototype, \"autoHide\", {\r\n        get: function () {\r\n            return this._autoHide;\r\n        },\r\n        set: function (value) {\r\n            this._autoHide = coerceToBoolean(value);\r\n        },\r\n        enumerable: true,\r\n        configurable: true\r\n    });\r\n    Object.defineProperty(PaginationControlsComponent.prototype, \"responsive\", {\r\n        get: function () {\r\n            return this._responsive;\r\n        },\r\n        set: function (value) {\r\n            this._responsive = coerceToBoolean(value);\r\n        },\r\n        enumerable: true,\r\n        configurable: true\r\n    });\r\n    __decorate$2([\r\n        core.Input(),\r\n        __metadata$1(\"design:type\", String)\r\n    ], PaginationControlsComponent.prototype, \"id\", void 0);\r\n    __decorate$2([\r\n        core.Input(),\r\n        __metadata$1(\"design:type\", Number)\r\n    ], PaginationControlsComponent.prototype, \"maxSize\", void 0);\r\n    __decorate$2([\r\n        core.Input(),\r\n        __metadata$1(\"design:type\", Boolean),\r\n        __metadata$1(\"design:paramtypes\", [Boolean])\r\n    ], PaginationControlsComponent.prototype, \"directionLinks\", null);\r\n    __decorate$2([\r\n        core.Input(),\r\n        __metadata$1(\"design:type\", Boolean),\r\n        __metadata$1(\"design:paramtypes\", [Boolean])\r\n    ], PaginationControlsComponent.prototype, \"autoHide\", null);\r\n    __decorate$2([\r\n        core.Input(),\r\n        __metadata$1(\"design:type\", Boolean),\r\n        __metadata$1(\"design:paramtypes\", [Boolean])\r\n    ], PaginationControlsComponent.prototype, \"responsive\", null);\r\n    __decorate$2([\r\n        core.Input(),\r\n        __metadata$1(\"design:type\", String)\r\n    ], PaginationControlsComponent.prototype, \"previousLabel\", void 0);\r\n    __decorate$2([\r\n        core.Input(),\r\n        __metadata$1(\"design:type\", String)\r\n    ], PaginationControlsComponent.prototype, \"firstLabel\", void 0);\r\n    __decorate$2([\r\n        core.Input(),\r\n        __metadata$1(\"design:type\", String)\r\n    ], PaginationControlsComponent.prototype, \"nextLabel\", void 0);\r\n    __decorate$2([\r\n        core.Input(),\r\n        __metadata$1(\"design:type\", String)\r\n    ], PaginationControlsComponent.prototype, \"lastLabel\", void 0);\r\n    __decorate$2([\r\n        core.Input(),\r\n        __metadata$1(\"design:type\", String)\r\n    ], PaginationControlsComponent.prototype, \"screenReaderPaginationLabel\", void 0);\r\n    __decorate$2([\r\n        core.Input(),\r\n        __metadata$1(\"design:type\", String)\r\n    ], PaginationControlsComponent.prototype, \"screenReaderPageLabel\", void 0);\r\n    __decorate$2([\r\n        core.Input(),\r\n        __metadata$1(\"design:type\", String)\r\n    ], PaginationControlsComponent.prototype, \"screenReaderCurrentLabel\", void 0);\r\n    __decorate$2([\r\n        core.Output(),\r\n        __metadata$1(\"design:type\", core.EventEmitter)\r\n    ], PaginationControlsComponent.prototype, \"pageChange\", void 0);\r\n    __decorate$2([\r\n        core.Output(),\r\n        __metadata$1(\"design:type\", core.EventEmitter)\r\n    ], PaginationControlsComponent.prototype, \"pageBoundsCorrection\", void 0);\r\n    PaginationControlsComponent = __decorate$2([\r\n        core.Component({\r\n            selector: 'pagination-controls',\r\n            template: DEFAULT_TEMPLATE,\r\n            styles: [DEFAULT_STYLES],\r\n            changeDetection: core.ChangeDetectionStrategy.OnPush,\r\n            encapsulation: core.ViewEncapsulation.None\r\n        })\r\n    ], PaginationControlsComponent);\r\n    return PaginationControlsComponent;\r\n}());\n\nvar __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\r\n    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n    if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n    return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\nvar __metadata$2 = (undefined && undefined.__metadata) || function (k, v) {\r\n    if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\r\n};\r\n/**\r\n * This directive is what powers all pagination controls components, including the default one.\r\n * It exposes an API which is hooked up to the PaginationService to keep the PaginatePipe in sync\r\n * with the pagination controls.\r\n */\r\nvar PaginationControlsDirective = /** @class */ (function () {\r\n    function PaginationControlsDirective(service, changeDetectorRef) {\r\n        var _this = this;\r\n        this.service = service;\r\n        this.changeDetectorRef = changeDetectorRef;\r\n        this.maxSize = 7;\r\n        this.pageChange = new core.EventEmitter();\r\n        this.pageBoundsCorrection = new core.EventEmitter();\r\n        this.pages = [];\r\n        this.changeSub = this.service.change\r\n            .subscribe(function (id) {\r\n            if (_this.id === id) {\r\n                _this.updatePageLinks();\r\n                _this.changeDetectorRef.markForCheck();\r\n                _this.changeDetectorRef.detectChanges();\r\n            }\r\n        });\r\n    }\r\n    PaginationControlsDirective.prototype.ngOnInit = function () {\r\n        if (this.id === undefined) {\r\n            this.id = this.service.defaultId();\r\n        }\r\n        this.updatePageLinks();\r\n    };\r\n    PaginationControlsDirective.prototype.ngOnChanges = function (changes) {\r\n        this.updatePageLinks();\r\n    };\r\n    PaginationControlsDirective.prototype.ngOnDestroy = function () {\r\n        this.changeSub.unsubscribe();\r\n    };\r\n    /**\r\n     * Go to the previous page\r\n     */\r\n    PaginationControlsDirective.prototype.previous = function () {\r\n        this.checkValidId();\r\n        this.setCurrent(this.getCurrent() - 1);\r\n    };\r\n    /**\r\n     * Go to the next page\r\n     */\r\n    PaginationControlsDirective.prototype.next = function () {\r\n        this.checkValidId();\r\n        this.setCurrent(this.getCurrent() + 1);\r\n    };\r\n    /**\r\n     * Returns true if current page is first page\r\n     */\r\n    PaginationControlsDirective.prototype.isFirstPage = function () {\r\n        return this.getCurrent() === 1;\r\n    };\r\n    /**\r\n     * Returns true if current page is last page\r\n     */\r\n    PaginationControlsDirective.prototype.isLastPage = function () {\r\n        return this.getLastPage() === this.getCurrent();\r\n    };\r\n    /**\r\n     * Set the current page number.\r\n     */\r\n    PaginationControlsDirective.prototype.setCurrent = function (page) {\r\n        this.pageChange.emit(page);\r\n    };\r\n    /**\r\n     * Get the current page number.\r\n     */\r\n    PaginationControlsDirective.prototype.getCurrent = function () {\r\n        return this.service.getCurrentPage(this.id);\r\n    };\r\n    /**\r\n     * Returns the last page number\r\n     */\r\n    PaginationControlsDirective.prototype.getLastPage = function () {\r\n        var inst = this.service.getInstance(this.id);\r\n        if (inst.totalItems < 1) {\r\n            // when there are 0 or fewer (an error case) items, there are no \"pages\" as such,\r\n            // but it makes sense to consider a single, empty page as the last page.\r\n            return 1;\r\n        }\r\n        return Math.ceil(inst.totalItems / inst.itemsPerPage);\r\n    };\r\n    PaginationControlsDirective.prototype.getTotalItems = function () {\r\n        return this.service.getInstance(this.id).totalItems;\r\n    };\r\n    PaginationControlsDirective.prototype.checkValidId = function () {\r\n        if (this.service.getInstance(this.id).id == null) {\r\n            console.warn(\"PaginationControlsDirective: the specified id \\\"\" + this.id + \"\\\" does not match any registered PaginationInstance\");\r\n        }\r\n    };\r\n    /**\r\n     * Updates the page links and checks that the current page is valid. Should run whenever the\r\n     * PaginationService.change stream emits a value matching the current ID, or when any of the\r\n     * input values changes.\r\n     */\r\n    PaginationControlsDirective.prototype.updatePageLinks = function () {\r\n        var _this = this;\r\n        var inst = this.service.getInstance(this.id);\r\n        var correctedCurrentPage = this.outOfBoundCorrection(inst);\r\n        if (correctedCurrentPage !== inst.currentPage) {\r\n            setTimeout(function () {\r\n                _this.pageBoundsCorrection.emit(correctedCurrentPage);\r\n                _this.pages = _this.createPageArray(inst.currentPage, inst.itemsPerPage, inst.totalItems, _this.maxSize);\r\n            });\r\n        }\r\n        else {\r\n            this.pages = this.createPageArray(inst.currentPage, inst.itemsPerPage, inst.totalItems, this.maxSize);\r\n        }\r\n    };\r\n    /**\r\n     * Checks that the instance.currentPage property is within bounds for the current page range.\r\n     * If not, return a correct value for currentPage, or the current value if OK.\r\n     */\r\n    PaginationControlsDirective.prototype.outOfBoundCorrection = function (instance) {\r\n        var totalPages = Math.ceil(instance.totalItems / instance.itemsPerPage);\r\n        if (totalPages < instance.currentPage && 0 < totalPages) {\r\n            return totalPages;\r\n        }\r\n        else if (instance.currentPage < 1) {\r\n            return 1;\r\n        }\r\n        return instance.currentPage;\r\n    };\r\n    /**\r\n     * Returns an array of Page objects to use in the pagination controls.\r\n     */\r\n    PaginationControlsDirective.prototype.createPageArray = function (currentPage, itemsPerPage, totalItems, paginationRange) {\r\n        // paginationRange could be a string if passed from attribute, so cast to number.\r\n        paginationRange = +paginationRange;\r\n        var pages = [];\r\n        var totalPages = Math.ceil(totalItems / itemsPerPage);\r\n        var halfWay = Math.ceil(paginationRange / 2);\r\n        var isStart = currentPage <= halfWay;\r\n        var isEnd = totalPages - halfWay < currentPage;\r\n        var isMiddle = !isStart && !isEnd;\r\n        var ellipsesNeeded = paginationRange < totalPages;\r\n        var i = 1;\r\n        while (i <= totalPages && i <= paginationRange) {\r\n            var label = void 0;\r\n            var pageNumber = this.calculatePageNumber(i, currentPage, paginationRange, totalPages);\r\n            var openingEllipsesNeeded = (i === 2 && (isMiddle || isEnd));\r\n            var closingEllipsesNeeded = (i === paginationRange - 1 && (isMiddle || isStart));\r\n            if (ellipsesNeeded && (openingEllipsesNeeded || closingEllipsesNeeded)) {\r\n                label = '...';\r\n            }\r\n            else {\r\n                label = pageNumber;\r\n            }\r\n            pages.push({\r\n                label: label,\r\n                value: pageNumber\r\n            });\r\n            i++;\r\n        }\r\n        return pages;\r\n    };\r\n    /**\r\n     * Given the position in the sequence of pagination links [i],\r\n     * figure out what page number corresponds to that position.\r\n     */\r\n    PaginationControlsDirective.prototype.calculatePageNumber = function (i, currentPage, paginationRange, totalPages) {\r\n        var halfWay = Math.ceil(paginationRange / 2);\r\n        if (i === paginationRange) {\r\n            return totalPages;\r\n        }\r\n        else if (i === 1) {\r\n            return i;\r\n        }\r\n        else if (paginationRange < totalPages) {\r\n            if (totalPages - halfWay < currentPage) {\r\n                return totalPages - paginationRange + i;\r\n            }\r\n            else if (halfWay < currentPage) {\r\n                return currentPage - halfWay + i;\r\n            }\r\n            else {\r\n                return i;\r\n            }\r\n        }\r\n        else {\r\n            return i;\r\n        }\r\n    };\r\n    __decorate$3([\r\n        core.Input(),\r\n        __metadata$2(\"design:type\", String)\r\n    ], PaginationControlsDirective.prototype, \"id\", void 0);\r\n    __decorate$3([\r\n        core.Input(),\r\n        __metadata$2(\"design:type\", Number)\r\n    ], PaginationControlsDirective.prototype, \"maxSize\", void 0);\r\n    __decorate$3([\r\n        core.Output(),\r\n        __metadata$2(\"design:type\", core.EventEmitter)\r\n    ], PaginationControlsDirective.prototype, \"pageChange\", void 0);\r\n    __decorate$3([\r\n        core.Output(),\r\n        __metadata$2(\"design:type\", core.EventEmitter)\r\n    ], PaginationControlsDirective.prototype, \"pageBoundsCorrection\", void 0);\r\n    PaginationControlsDirective = __decorate$3([\r\n        core.Directive({\r\n            selector: 'pagination-template,[pagination-template]',\r\n            exportAs: 'paginationApi'\r\n        }),\r\n        __metadata$2(\"design:paramtypes\", [PaginationService,\r\n            core.ChangeDetectorRef])\r\n    ], PaginationControlsDirective);\r\n    return PaginationControlsDirective;\r\n}());\n\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\r\n    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n    if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n    return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n};\r\nvar NgxPaginationModule = /** @class */ (function () {\r\n    function NgxPaginationModule() {\r\n    }\r\n    NgxPaginationModule = __decorate([\r\n        core.NgModule({\r\n            imports: [common.CommonModule],\r\n            declarations: [\r\n                PaginatePipe,\r\n                PaginationControlsComponent,\r\n                PaginationControlsDirective\r\n            ],\r\n            providers: [PaginationService],\r\n            exports: [PaginatePipe, PaginationControlsComponent, PaginationControlsDirective]\r\n        })\r\n    ], NgxPaginationModule);\r\n    return NgxPaginationModule;\r\n}());\n\n/**\r\n * Generated bundle index. Do not edit.\r\n */\n\nexports.ɵb = DEFAULT_STYLES;\nexports.ɵa = DEFAULT_TEMPLATE;\nexports.NgxPaginationModule = NgxPaginationModule;\nexports.PaginationService = PaginationService;\nexports.PaginationControlsComponent = PaginationControlsComponent;\nexports.PaginationControlsDirective = PaginationControlsDirective;\nexports.PaginatePipe = PaginatePipe;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n"]}