import * as i0 from '@angular/core';
import { Component, ChangeDetectionStrategy, Input, Directive, HostBinding, NgModule } from '@angular/core';
import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i2 from '@aztrix/helpers';
import { HelperPipesModule } from '@aztrix/helpers';
import * as i1$1 from '@aztrix/components/image-source';
import { ImageSourceModule } from '@aztrix/components/image-source';
import * as i2$1 from '@aztrix/icons';
import { IconsModule } from '@aztrix/icons';
import * as i1$2 from '@angular/platform-browser';

class ValueViewLabelComponent {
}
ValueViewLabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ValueViewLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
ValueViewLabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: ValueViewLabelComponent, selector: "ax-value-view-label", inputs: { label: "label" }, ngImport: i0, template: `<span class="label" *ngIf="label">{{ label | translate }} </span>
    <ng-content></ng-content>`, isInline: true, styles: [":host{display:grid;grid-template-rows:auto auto;align-items:center;font-weight:400;max-width:100%;width:100%}.label{color:#7a8692;font-size:.75rem;margin:0;line-height:1.6;text-transform:uppercase}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ValueViewLabelComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-value-view-label', template: `<span class="label" *ngIf="label">{{ label | translate }} </span>
    <ng-content></ng-content>`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:grid;grid-template-rows:auto auto;align-items:center;font-weight:400;max-width:100%;width:100%}.label{color:#7a8692;font-size:.75rem;margin:0;line-height:1.6;text-transform:uppercase}\n"] }]
        }], propDecorators: { label: [{
                type: Input
            }] } });

class ValueView {
}
ValueView.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ValueView, deps: [], target: i0.ɵɵFactoryTarget.Directive });
ValueView.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.5", type: ValueView, inputs: { label: "label", value: "value" }, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ValueView, decorators: [{
            type: Directive
        }], propDecorators: { label: [{
                type: Input
            }], value: [{
                type: Input
            }] } });

class BooleanValueViewComponent extends ValueView {
}
BooleanValueViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: BooleanValueViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
BooleanValueViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: BooleanValueViewComponent, selector: "ax-boolean-value-view", usesInheritance: true, ngImport: i0, template: "<ax-value-view-label [label]=\"label\">\n  <span>{{ (value === 'true' ? 'label.on' : 'label.off') | translate }}</span>\n</ax-value-view-label>\n", dependencies: [{ kind: "component", type: ValueViewLabelComponent, selector: "ax-value-view-label", inputs: ["label"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: BooleanValueViewComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-boolean-value-view', template: "<ax-value-view-label [label]=\"label\">\n  <span>{{ (value === 'true' ? 'label.on' : 'label.off') | translate }}</span>\n</ax-value-view-label>\n" }]
        }] });

class TextValueViewComponent extends ValueView {
}
TextValueViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: TextValueViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
TextValueViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: TextValueViewComponent, selector: "ax-text-value-view", usesInheritance: true, ngImport: i0, template: "<ax-value-view-label [label]=\"label\">\n  <span>{{ value }}</span>\n</ax-value-view-label>\n", dependencies: [{ kind: "component", type: ValueViewLabelComponent, selector: "ax-value-view-label", inputs: ["label"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: TextValueViewComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-text-value-view', template: "<ax-value-view-label [label]=\"label\">\n  <span>{{ value }}</span>\n</ax-value-view-label>\n" }]
        }] });

class ImageValueViewComponent extends ValueView {
    get id() {
        try {
            return JSON.parse(this.value).id;
        }
        catch (_a) {
            return '';
        }
    }
}
ImageValueViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ImageValueViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
ImageValueViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: ImageValueViewComponent, selector: "ax-image-value-view", usesInheritance: true, ngImport: i0, template: "<ax-value-view-label [label]=\"label\">\n  <ax-image-source class=\"image\" [source]=\"'/staticFiles/pageFiles/' + id\">\n    <ax-icon class=\"icon\" name=\"image\"></ax-icon>\n  </ax-image-source>\n</ax-value-view-label>\n", styles: [".image{max-width:100px}\n", ":host{display:grid;grid-template-rows:auto auto;align-items:center;font-weight:400;max-width:100%;width:100%;margin-bottom:.25rem}\n"], dependencies: [{ kind: "component", type: i1$1.ImageSourceComponent, selector: "ax-image-source", inputs: ["source", "fallbackSource", "actualSize", "alt", "round", "rounded", "border"] }, { kind: "component", type: i2$1.IconComponent, selector: "ax-icon", inputs: ["name", "inline"] }, { kind: "component", type: ValueViewLabelComponent, selector: "ax-value-view-label", inputs: ["label"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ImageValueViewComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-image-value-view', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ax-value-view-label [label]=\"label\">\n  <ax-image-source class=\"image\" [source]=\"'/staticFiles/pageFiles/' + id\">\n    <ax-icon class=\"icon\" name=\"image\"></ax-icon>\n  </ax-image-source>\n</ax-value-view-label>\n", styles: [".image{max-width:100px}\n", ":host{display:grid;grid-template-rows:auto auto;align-items:center;font-weight:400;max-width:100%;width:100%;margin-bottom:.25rem}\n"] }]
        }] });

class FileValueViewComponent extends ValueView {
    get name() {
        try {
            return JSON.parse(this.value).name;
        }
        catch (_a) {
            return '';
        }
    }
}
FileValueViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: FileValueViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
FileValueViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: FileValueViewComponent, selector: "ax-file-value-view", usesInheritance: true, ngImport: i0, template: "<ax-value-view-label [label]=\"label\">\n  <span>{{ name }}</span>\n</ax-value-view-label>\n", styles: [":host{line-break:anywhere}\n", ":host{display:grid;grid-template-rows:auto auto;align-items:center;font-weight:400;max-width:100%;width:100%;margin-bottom:.25rem}\n"], dependencies: [{ kind: "component", type: ValueViewLabelComponent, selector: "ax-value-view-label", inputs: ["label"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: FileValueViewComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-file-value-view', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ax-value-view-label [label]=\"label\">\n  <span>{{ name }}</span>\n</ax-value-view-label>\n", styles: [":host{line-break:anywhere}\n", ":host{display:grid;grid-template-rows:auto auto;align-items:center;font-weight:400;max-width:100%;width:100%;margin-bottom:.25rem}\n"] }]
        }] });

class RichTextValueViewComponent extends ValueView {
    constructor(_domSanitizer, _changeDetector) {
        super();
        this._domSanitizer = _domSanitizer;
        this._changeDetector = _changeDetector;
        this.snow = true;
    }
    ngOnChanges(changes) {
        if (changes.value) {
            this.safeHtml = this._domSanitizer.bypassSecurityTrustHtml(this.value || '');
            this._changeDetector.markForCheck();
        }
    }
}
RichTextValueViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: RichTextValueViewComponent, deps: [{ token: i1$2.DomSanitizer }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
RichTextValueViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: RichTextValueViewComponent, selector: "ax-rich-text-value-view", host: { properties: { "class.ql-snow": "this.snow" } }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ax-value-view-label [label]=\"label\">\n  <span class=\"ql-editor\" [innerHTML]=\"safeHtml\"></span>\n</ax-value-view-label>\n", styles: [":host ::ng-deep .ql-editor .ax-quill-template-variable{display:inline;background-color:transparent;border:1px solid #bdc3c9;border-radius:5px;padding:1px 6px;cursor:pointer}:host ::ng-deep .ql-editor .ax-quill-template-variable:disabled{cursor:default}:host ::ng-deep .ql-editor .ax-quill-template-variable:hover{background-color:#efefef}:host ::ng-deep .ql-editor .ax-quill-template-variable.invalid{color:var(--warn-color-300);border:1px solid var(--warn-color-300)}.ql-editor{text-align:left;padding:0;-webkit-hyphens:auto;hyphens:auto}@page{margin:1in}\n", ":host{display:grid;grid-template-rows:auto auto;align-items:center;font-weight:400;max-width:100%;width:100%;margin-bottom:.25rem}\n"], dependencies: [{ kind: "component", type: ValueViewLabelComponent, selector: "ax-value-view-label", inputs: ["label"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: RichTextValueViewComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-rich-text-value-view', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ax-value-view-label [label]=\"label\">\n  <span class=\"ql-editor\" [innerHTML]=\"safeHtml\"></span>\n</ax-value-view-label>\n", styles: [":host ::ng-deep .ql-editor .ax-quill-template-variable{display:inline;background-color:transparent;border:1px solid #bdc3c9;border-radius:5px;padding:1px 6px;cursor:pointer}:host ::ng-deep .ql-editor .ax-quill-template-variable:disabled{cursor:default}:host ::ng-deep .ql-editor .ax-quill-template-variable:hover{background-color:#efefef}:host ::ng-deep .ql-editor .ax-quill-template-variable.invalid{color:var(--warn-color-300);border:1px solid var(--warn-color-300)}.ql-editor{text-align:left;padding:0;-webkit-hyphens:auto;hyphens:auto}@page{margin:1in}\n", ":host{display:grid;grid-template-rows:auto auto;align-items:center;font-weight:400;max-width:100%;width:100%;margin-bottom:.25rem}\n"] }]
        }], ctorParameters: function () { return [{ type: i1$2.DomSanitizer }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { snow: [{
                type: HostBinding,
                args: ['class.ql-snow']
            }] } });

class DateValueViewComponent extends ValueView {
}
DateValueViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: DateValueViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
DateValueViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: DateValueViewComponent, selector: "ax-date-value-view", usesInheritance: true, ngImport: i0, template: "<ax-value-view-label [label]=\"label\">\n  <span>{{ value | formatDate }}</span>\n</ax-value-view-label>\n", dependencies: [{ kind: "component", type: ValueViewLabelComponent, selector: "ax-value-view-label", inputs: ["label"] }, { kind: "pipe", type: i2.FormatDatePipe, name: "formatDate" }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: DateValueViewComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-date-value-view', template: "<ax-value-view-label [label]=\"label\">\n  <span>{{ value | formatDate }}</span>\n</ax-value-view-label>\n" }]
        }] });

class ValueViewComponent {
}
ValueViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ValueViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
ValueViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: ValueViewComponent, selector: "ax-value-view", inputs: { type: "type", label: "label", value: "value" }, ngImport: i0, template: "<ax-value-view-label *ngIf=\"label\" [label]=\"label\"></ax-value-view-label>\n\n<ng-template #valueView let-v>\n  <ng-container [ngSwitch]=\"type\">\n    <ax-boolean-value-view *ngSwitchCase=\"'BOOLEAN'\" [value]=\"v\"></ax-boolean-value-view>\n    <ax-image-value-view *ngSwitchCase=\"'IMAGE'\" [value]=\"v\"></ax-image-value-view>\n    <ax-file-value-view *ngSwitchCase=\"'FILE'\" [value]=\"v\"></ax-file-value-view>\n    <ax-rich-text-value-view *ngSwitchCase=\"'RICH_TEXT'\" [value]=\"v\"></ax-rich-text-value-view>\n    <ax-date-value-view *ngSwitchCase=\"'DATE'\" [value]=\"v\"></ax-date-value-view>\n    <ax-text-value-view *ngSwitchDefault [value]=\"v\"></ax-text-value-view>\n  </ng-container>\n</ng-template>\n\n<ng-template #string>\n  <ng-container *ngTemplateOutlet=\"valueView; context: {$implicit: value}\"></ng-container>\n</ng-template>\n<ng-container *ngIf=\"value | isArray; else string\">\n  <ul class=\"values\">\n    <li *ngFor=\"let v of value\">\n      <ng-container *ngTemplateOutlet=\"valueView; context: {$implicit: v}\"></ng-container>\n    </li>\n  </ul>\n</ng-container>\n", styles: [":host{display:block;padding:.5rem 0}:host:first-child{padding-top:0}:host:last-child{padding-bottom:0}.values{margin:0}.values{list-style-type:none;padding-left:0;margin:0}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: ValueViewLabelComponent, selector: "ax-value-view-label", inputs: ["label"] }, { kind: "component", type: BooleanValueViewComponent, selector: "ax-boolean-value-view" }, { kind: "component", type: TextValueViewComponent, selector: "ax-text-value-view" }, { kind: "component", type: ImageValueViewComponent, selector: "ax-image-value-view" }, { kind: "component", type: FileValueViewComponent, selector: "ax-file-value-view" }, { kind: "component", type: RichTextValueViewComponent, selector: "ax-rich-text-value-view" }, { kind: "component", type: DateValueViewComponent, selector: "ax-date-value-view" }, { kind: "pipe", type: i2.IsArrayPipe, name: "isArray" }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ValueViewComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-value-view', template: "<ax-value-view-label *ngIf=\"label\" [label]=\"label\"></ax-value-view-label>\n\n<ng-template #valueView let-v>\n  <ng-container [ngSwitch]=\"type\">\n    <ax-boolean-value-view *ngSwitchCase=\"'BOOLEAN'\" [value]=\"v\"></ax-boolean-value-view>\n    <ax-image-value-view *ngSwitchCase=\"'IMAGE'\" [value]=\"v\"></ax-image-value-view>\n    <ax-file-value-view *ngSwitchCase=\"'FILE'\" [value]=\"v\"></ax-file-value-view>\n    <ax-rich-text-value-view *ngSwitchCase=\"'RICH_TEXT'\" [value]=\"v\"></ax-rich-text-value-view>\n    <ax-date-value-view *ngSwitchCase=\"'DATE'\" [value]=\"v\"></ax-date-value-view>\n    <ax-text-value-view *ngSwitchDefault [value]=\"v\"></ax-text-value-view>\n  </ng-container>\n</ng-template>\n\n<ng-template #string>\n  <ng-container *ngTemplateOutlet=\"valueView; context: {$implicit: value}\"></ng-container>\n</ng-template>\n<ng-container *ngIf=\"value | isArray; else string\">\n  <ul class=\"values\">\n    <li *ngFor=\"let v of value\">\n      <ng-container *ngTemplateOutlet=\"valueView; context: {$implicit: v}\"></ng-container>\n    </li>\n  </ul>\n</ng-container>\n", styles: [":host{display:block;padding:.5rem 0}:host:first-child{padding-top:0}:host:last-child{padding-bottom:0}.values{margin:0}.values{list-style-type:none;padding-left:0;margin:0}\n"] }]
        }], propDecorators: { type: [{
                type: Input
            }], label: [{
                type: Input
            }], value: [{
                type: Input
            }] } });

class ValueViewModule {
}
ValueViewModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ValueViewModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
ValueViewModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: ValueViewModule, declarations: [ValueViewComponent,
        ValueViewLabelComponent,
        BooleanValueViewComponent,
        TextValueViewComponent,
        ImageValueViewComponent,
        FileValueViewComponent,
        RichTextValueViewComponent,
        DateValueViewComponent], imports: [CommonModule, HelperPipesModule, ImageSourceModule, IconsModule], exports: [ValueViewComponent, ValueViewLabelComponent] });
ValueViewModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ValueViewModule, imports: [CommonModule, HelperPipesModule, ImageSourceModule, IconsModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ValueViewModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [
                        ValueViewComponent,
                        ValueViewLabelComponent,
                        BooleanValueViewComponent,
                        TextValueViewComponent,
                        ImageValueViewComponent,
                        FileValueViewComponent,
                        RichTextValueViewComponent,
                        DateValueViewComponent,
                    ],
                    imports: [CommonModule, HelperPipesModule, ImageSourceModule, IconsModule],
                    exports: [ValueViewComponent, ValueViewLabelComponent],
                }]
        }] });

/**
 * Generated bundle index. Do not edit.
 */

export { ValueViewComponent, ValueViewLabelComponent, ValueViewModule };
//# sourceMappingURL=aztrix-components-value-view.mjs.map
//# sourceMappingURL=aztrix-components-value-view.mjs.map
