import { ChangeDetectionStrategy, Component, HostBinding, Input, ViewEncapsulation, } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
function TextEllipsisComponent_span_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 2);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const text_r2 = ctx.ngIf;
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(text_r2);
} }
function TextEllipsisComponent_span_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 3);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const text_r3 = ctx.ngIf;
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(text_r3);
} }
export class TextEllipsisComponent {
    constructor() {
        this.tailLength = 0;
    }
    get head() {
        return this.text.slice(0, this.text.length - this.tailLength);
    }
    get tail() {
        return this.text.slice(this.text.length - this.tailLength);
    }
}
TextEllipsisComponent.ɵfac = function TextEllipsisComponent_Factory(t) { return new (t || TextEllipsisComponent)(); };
TextEllipsisComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TextEllipsisComponent, selectors: [["acl-text-ellipsis"]], hostVars: 1, hostBindings: function TextEllipsisComponent_HostBindings(rf, ctx) { if (rf & 2) {
        i0.ɵɵhostProperty("title", ctx.text);
    } }, inputs: { text: "text", tailLength: "tailLength" }, decls: 2, vars: 2, consts: [["class", "head", 4, "ngIf"], ["class", "tail", 4, "ngIf"], [1, "head"], [1, "tail"]], template: function TextEllipsisComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵtemplate(0, TextEllipsisComponent_span_0_Template, 2, 1, "span", 0);
        i0.ɵɵtemplate(1, TextEllipsisComponent_span_1_Template, 2, 1, "span", 1);
    } if (rf & 2) {
        i0.ɵɵproperty("ngIf", ctx.head);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", ctx.tail);
    } }, dependencies: [i1.NgIf], styles: ["acl-text-ellipsis{display:inline-flex;max-width:100%;overflow:hidden}acl-text-ellipsis span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}acl-text-ellipsis .tail{flex-shrink:0}\n"], encapsulation: 2, changeDetection: 0 });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TextEllipsisComponent, [{
        type: Component,
        args: [{ selector: 'acl-text-ellipsis', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<span\n  *ngIf=\"head as text\"\n  class=\"head\"\n  >{{ text }}</span\n><span\n  *ngIf=\"tail as text\"\n  class=\"tail\"\n  >{{ text }}</span\n>\n", styles: ["acl-text-ellipsis{display:inline-flex;max-width:100%;overflow:hidden}acl-text-ellipsis span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}acl-text-ellipsis .tail{flex-shrink:0}\n"] }]
    }], null, { text: [{
            type: HostBinding,
            args: ['title']
        }, {
            type: Input
        }], tailLength: [{
            type: Input
        }] }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21tb24vc3JjL3NjbS90ZXh0LWVsbGlwc2lzL2NvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29tbW9uL3NyYy9zY20vdGV4dC1lbGxpcHNpcy9jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0wsdUJBQXVCLEVBQ3ZCLFNBQVMsRUFDVCxXQUFXLEVBQ1gsS0FBSyxFQUNMLGlCQUFpQixHQUNsQixNQUFNLGVBQWUsQ0FBQzs7OztJQ052QiwrQkFHRztJQUFBLFlBQVU7SUFBQSxpQkFDWjs7O0lBREUsZUFBVTtJQUFWLDZCQUFV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