import { ChangeDetectionStrategy, ChangeDetectorRef, Component, HostBinding, Input, } from '@angular/core';
import { AvatarType } from '@aztrix/components/avatar';
import { AbstractPropertyEdit } from '../abstract-property-edit';
import * as i0 from "@angular/core";
import * as i1 from "@angular/material/form-field";
import * as i2 from "@aztrix/components/avatar";
export class AvatarPropertyEditComponent extends AbstractPropertyEdit {
    constructor(_changeDetector) {
        super();
        this._changeDetector = _changeDetector;
        this.propertyEditClass = true;
        this.isIndividual = false;
        this.AvatarType = AvatarType;
        this.updateAvatar = (image) => {
            this.form.get('value').setValue(image || null);
            this.markAsDirty();
            this._changeDetector.markForCheck();
        };
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AvatarPropertyEditComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: AvatarPropertyEditComponent, selector: "ax-avatar-property-edit", inputs: { isIndividual: "isIndividual" }, host: { properties: { "class.c-property-edit": "this.propertyEditClass" } }, usesInheritance: true, ngImport: i0, template: "<ax-avatar-edit\n  [name]=\"getName()\"\n  [avatarURL]=\"form?.value?.value\"\n  [update]=\"updateAvatar\"\n  [canDelete]=\"form?.value.value\"\n  [delete]=\"updateAvatar\"\n  [type]=\"isIndividual ? AvatarType.INDIVIDUAL : AvatarType.INDIVIDUAL\"\n  [readonly]=\"readonly\"\n></ax-avatar-edit>\n<mat-hint class=\"hint\" align=\"end\">\n  {{ hint }}\n</mat-hint>\n", styles: [":host{display:block;padding-bottom:1rem}.hint{text-align:center}\n"], dependencies: [{ kind: "directive", type: i1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "component", type: i2.AvatarEditComponent, selector: "ax-avatar-edit", inputs: ["name", "avatarURL", "canDelete", "delete", "type", "update", "readonly"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AvatarPropertyEditComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-avatar-property-edit', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ax-avatar-edit\n  [name]=\"getName()\"\n  [avatarURL]=\"form?.value?.value\"\n  [update]=\"updateAvatar\"\n  [canDelete]=\"form?.value.value\"\n  [delete]=\"updateAvatar\"\n  [type]=\"isIndividual ? AvatarType.INDIVIDUAL : AvatarType.INDIVIDUAL\"\n  [readonly]=\"readonly\"\n></ax-avatar-edit>\n<mat-hint class=\"hint\" align=\"end\">\n  {{ hint }}\n</mat-hint>\n", styles: [":host{display:block;padding-bottom:1rem}.hint{text-align:center}\n"] }]
        }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { propertyEditClass: [{
                type: HostBinding,
                args: ['class.c-property-edit']
            }], isIndividual: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXZhdGFyLXByb3BlcnR5LWVkaXQuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21wb25lbnRzL3Byb3BlcnR5LWVkaXQvYXZhdGFyLXByb3BlcnR5LWVkaXQvYXZhdGFyLXByb3BlcnR5LWVkaXQuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21wb25lbnRzL3Byb3BlcnR5LWVkaXQvYXZhdGFyLXByb3BlcnR5LWVkaXQvYXZhdGFyLXByb3BlcnR5LWVkaXQuY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUNMLHVCQUF1QixFQUN2QixpQkFBaUIsRUFDakIsU0FBUyxFQUNULFdBQVcsRUFDWCxLQUFLLEdBQ04sTUFBTSxlQUFlLENBQUM7QUFD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