import { Component, EventEmitter, Input, Output } from '@angular/core';
import { OverlayService } from '@aztrix/components/overlay';
import * as i0 from "@angular/core";
import * as i1 from "@aztrix/components/overlay";
import * as i2 from "@aztrix/components/button";
import * as i3 from "ngx-color-picker";
import * as i4 from "@aztrix/helpers";
export class ColorPickerModalComponent {
    constructor(_overlay) {
        this._overlay = _overlay;
        this.valueChange = new EventEmitter();
        this._initialValue = '';
    }
    ngOnChanges(changes) {
        if (changes.value) {
            this._initialValue = this.value;
        }
    }
    save() {
        this._overlay.closeModal();
    }
    cancel() {
        this.valueChange.next(this._initialValue);
        this._overlay.closeModal();
    }
}
ColorPickerModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ColorPickerModalComponent, deps: [{ token: i1.OverlayService }], target: i0.ɵɵFactoryTarget.Component });
ColorPickerModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: ColorPickerModalComponent, selector: "ng-component", inputs: { value: "value" }, outputs: { valueChange: "valueChange" }, usesOnChanges: true, ngImport: i0, template: "<div>\n  <color-picker\n    [cpToggle]=\"true\"\n    cpDialogDisplay=\"inline\"\n    cpAlphaChannel=\"disabled\"\n    [colorPicker]=\"value\"\n    (colorPickerChange)=\"valueChange.next($event)\"\n  ></color-picker>\n</div>\n<div class=\"actions h-button-wrapper\">\n  <button axButton (click)=\"cancel()\">\n    {{ 'label.cancel' | translate }}\n  </button>\n  <button axButton color=\"primary\" filled (click)=\"save()\">\n    {{ 'label.ok' | translate }}\n  </button>\n</div>\n", styles: [":host{display:flex;flex-direction:column;align-items:center;margin:1rem}.actions{width:100%}:host ::ng-deep .color-picker{border:none}\n"], dependencies: [{ kind: "directive", type: i2.ButtonDirective, selector: "[axButton]", inputs: ["color", "labelHideMobile", "smallButton", "bigButton", "fullWidth", "filled", "outline", "icon-button", "hoverLabel", "hover", "lowercase", "disabled"] }, { kind: "directive", type: i3.ColorPickerDirective, selector: "[colorPicker]", inputs: ["cpWidth", "cpHeight", "cpToggle", "cpDisabled", "cpIgnoredElements", "cpFallbackColor", "cpColorMode", "cpCmykEnabled", "cpOutputFormat", "cpAlphaChannel", "cpDisableInput", "cpDialogDisplay", "cpSaveClickOutside", "cpCloseClickOutside", "cpUseRootViewContainer", "cpPosition", "cpPositionOffset", "cpPositionRelativeToArrow", "cpOKButton", "cpOKButtonText", "cpOKButtonClass", "cpCancelButton", "cpCancelButtonText", "cpCancelButtonClass", "cpPresetLabel", "cpPresetColorsClass", "cpMaxPresetColorsLength", "cpPresetEmptyMessage", "cpPresetEmptyMessageClass", "cpAddColorButton", "cpAddColorButtonText", "cpAddColorButtonClass", "cpRemoveColorButtonClass", "colorPicker", "cpPresetColors"], outputs: ["cpInputChange", "cpToggleChange", "cpSliderChange", "cpSliderDragEnd", "cpSliderDragStart", "colorPickerOpen", "colorPickerClose", "colorPickerCancel", "colorPickerSelect", "colorPickerChange", "cpCmykColorChange", "cpPresetColorsChange"], exportAs: ["ngxColorPicker"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ColorPickerModalComponent, decorators: [{
            type: Component,
            args: [{ template: "<div>\n  <color-picker\n    [cpToggle]=\"true\"\n    cpDialogDisplay=\"inline\"\n    cpAlphaChannel=\"disabled\"\n    [colorPicker]=\"value\"\n    (colorPickerChange)=\"valueChange.next($event)\"\n  ></color-picker>\n</div>\n<div class=\"actions h-button-wrapper\">\n  <button axButton (click)=\"cancel()\">\n    {{ 'label.cancel' | translate }}\n  </button>\n  <button axButton color=\"primary\" filled (click)=\"save()\">\n    {{ 'label.ok' | translate }}\n  </button>\n</div>\n", styles: [":host{display:flex;flex-direction:column;align-items:center;margin:1rem}.actions{width:100%}:host ::ng-deep .color-picker{border:none}\n"] }]
        }], ctorParameters: function () { return [{ type: i1.OverlayService }]; }, propDecorators: { value: [{
                type: Input
            }], valueChange: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29sb3ItcGlja2VyLW1vZGFsLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29tcG9uZW50cy9jb2xvci1zZWxlY3QvY29sb3ItcGlja2VyLW1vZGFsL2NvbG9yLXBpY2tlci1tb2RhbC5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvbXBvbmVudHMvY29sb3Itc2VsZWN0L2NvbG9yLXBpY2tlci1tb2RhbC9jb2xvci1waWNrZXItbW9kYWwuY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLFNBQVMsRUFBRSxZQUFZLEVBQUUsS0FBSyxFQUFhLE1BQU0sRUFBZ0IsTUFBTSxlQUFlLENBQUM7QUFDL0YsT0FBTyxFQUFDLGNBQWMsRUFBQyxNQUFNLDRCQUE0QixDQUFDOzs7Ozs7QUFNMUQsTUFBTSxPQUFPLHlCQUF5QjtJQU1wQyxZQUFvQixRQUF3QjtRQUF4QixhQUFRLEdBQVIsUUFBUSxDQUFnQjtRQUpsQyxnQkFBVyxHQUFHLElBQUksWUFBWSxFQUFVLENBQUM7UUFFM0Msa0JBQWEsR0FBRyxFQUFFLENBQUM7SUFFb0IsQ0FBQztJQUVoRCxXQUFXLENBQUMsT0FBc0I7UUFDaEMsSUFBSSxPQUFPLENBQUMsS0FBSyxFQUFFO1lBQ2pCLElBQUksQ0FBQyxhQUFhLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQztTQUNqQztJQUNILENBQUM7SUFFRCxJQUFJO1FBQ0YsSUFBSSxDQUFDLFFBQVEsQ0FBQyxVQUFVLEVBQUUsQ0FBQztJQUM3QixDQUFDO0lBRUQsTUFBTTtRQUNKLElBQUksQ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