import { Component, HostListener, Input } from '@angular/core';
import { CommonModule, NgFor, NgIf } from '@angular/common';
import { SpacingAroundDirective } from '../../directive/spacing-around.directive';
import { BackgroundDirective } from '../../directive/background-directive';
import { HoverDirective } from '../../directive/hover-element-directive';
import { SpacingHorizontalDirective } from '../../directive/spacing-horizontal.directive';
import { CornerDirective } from '../../directive/corner-directive';
import { SimpoHoverBorderDirective } from '../../directive/hoverborder.directive';
import { SimpoElementsModule } from '../../elements/index';
import { SimpoComponentModule } from '../../components/index';
import { BorderDirective } from '../../directive/border-directive';
import { ContainerFitDirective } from '../../directive/container-fir.directive';
import { simpoConetenAlignmentDirective } from '../../directive/content-alignment-directive';
import { ContentFitDirective } from '../../directive/content-fit-directive';
import { AnimationDirective } from '../../directive/animation-directive';
import { SimpoContainerAligment } from '../../directive/container-alignment.directive';
import { TextBackgroundDirectiveDirective } from '../../directive/text-background-directive.directive';
import { OverlayDirective } from '../../directive/overlay-directive';
import { TextEditorComponent } from '../../elements/text-editor/text-editor.component';
import { ImageEditorDirective } from '../../directive/image-editor.directive';
import BaseSection from '../BaseSection';
import * as i0 from "@angular/core";
import * as i1 from "../../services/events.service";
import * as i2 from "@angular/common";
import * as i3 from "../../elements/svg-divider/svg-divider.component";
import * as i4 from "../../components/hover-elements/hover-elements.component";
import * as i5 from "../../components/delete-hover-element/delete-hover-element.component";
export class TestimonialMasonryComponent extends BaseSection {
    constructor(_eventService) {
        super();
        this._eventService = _eventService;
        this.screenWidth = 0;
    }
    ngOnInit() {
        this.content = this.data?.content;
        this.styles = this.data?.styles;
        this.getScreenSize();
    }
    get stylesLayout() {
        return { ...this.styles?.layout };
    }
    get activeItems() {
        return this.content?.listItem?.data?.filter((item) => item.status !== false) ?? [];
    }
    getQuote(item) {
        return item?.inputText?.[0]?.value ?? '';
    }
    getAuthor(item) {
        return item?.inputText?.[1]?.value ?? '';
    }
    getRole(item) {
        return item?.inputText?.[2]?.value ?? '';
    }
    getAvatarUrl(item) {
        return item?.image?.url ?? '';
    }
    editSection() {
        this._eventService.toggleEditorEvent.emit(false);
        setTimeout(() => {
            this._eventService.editSection.emit({ data: this.data });
        }, 100);
    }
    getScreenSize() {
        this.screenWidth = window.innerWidth;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TestimonialMasonryComponent, deps: [{ token: i1.EventsService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: TestimonialMasonryComponent, isStandalone: true, selector: "simpo-testimonial-masonry", inputs: { data: "data", edit: "edit", delete: "delete", customClass: "customClass", nextComponentColor: "nextComponentColor", index: "index" }, host: { listeners: { "window:resize": "getScreenSize($event)" } }, usesInheritance: true, ngImport: i0, template: "<section class=\"main-container hover-effect\" simpoHover (hovering)=\"showEditTabs($event)\">\r\n  <div class=\"spacing-around\" [spacingAround]=\"stylesLayout\" [simpoBorder]=\"styles?.border\" [id]=\"data?.id\">\r\n    <div class=\"parent-div\" [id]=\"data?.id\" [simpoCorner]=\"styles?.corners\" [simpoBackground]=\"styles?.background\">\r\n      <div [simpoOverlay]=\"styles?.background\" [simpoLayout]=\"styles?.layout\" [id]=\"data?.id\"\r\n        [spacingHorizontal]=\"stylesLayout\" class=\"flex-column\">\r\n\r\n        <!-- Heading Block -->\r\n        <div class=\"header-block mb-3\" [simpoAnimation]=\"styles?.animation\">\r\n          <ng-container *ngFor=\"let text of content?.inputText; let i = index\">\r\n            <simpo-text-editor [(value)]=\"text.value\" [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"i\" [isRTE]=\"text.isRTE\"></simpo-text-editor>\r\n          </ng-container>\r\n        </div>\r\n\r\n        <!-- Masonry Grid -->\r\n        <div class=\"masonry-grid\" [simpoAnimation]=\"styles?.animation\">\r\n          <div class=\"masonry-card\" *ngFor=\"let item of activeItems; let i = index\">\r\n            <!-- Quote Icon -->\r\n            <div class=\"quote-icon\">\r\n              <svg width=\"28\" height=\"22\" viewBox=\"0 0 36 31\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n                <path\r\n                  d=\"M35.3998 3.29993C35.5998 3.09993 35.7998 2.69993 35.5998 2.29993C35.3998 2.09993 34.9998 1.69993 34.5998 0.899925C33.9998 0.699925 33.5998 0.699926 32.9998 1.09993C25.3998 5.89993 21.1998 11.4999 20.3998 17.8999C18.9998 27.8999 27.9998 32.6999 32.5998 28.2999C37.1998 23.8999 34.3998 18.2999 31.1998 16.6999C27.9998 15.0999 25.9998 15.6999 26.1998 13.6999C26.5998 11.6999 31.1998 6.09993 35.3998 3.29993ZM14.7998 1.09993C14.1998 0.699926 13.5998 0.699926 13.1998 1.09993C5.59983 5.89993 1.39983 11.4999 0.599832 18.0999C-0.800168 28.0999 8.19983 32.8999 12.7998 28.4999C17.3998 24.0999 14.5998 18.4999 11.3998 16.8999C7.99983 15.4999 5.99983 16.0999 6.39983 13.8999C6.79983 11.8999 11.3998 6.29993 15.5998 3.49993C15.7998 3.29993 15.9998 2.89993 15.7998 2.49993C15.5998 2.29993 15.1998 1.89993 14.7998 1.09993Z\"\r\n                  [attr.fill]=\"styles?.background?.accentColor || '#6C8EBF'\" />\r\n              </svg>\r\n            </div>\r\n\r\n            <!-- Quote Text -->\r\n            <div class=\"quote-text\">\r\n              <simpo-text-editor [(value)]=\"item.inputText[0].value\" [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"0\" [itemIndex]=\"i\" [isRTE]=\"item.inputText[0]?.isRTE\"></simpo-text-editor>\r\n            </div>\r\n\r\n            <!-- Author Row -->\r\n            <div class=\"author-row\">\r\n              <img *ngIf=\"getAvatarUrl(item)\" [src]=\"getAvatarUrl(item)\" class=\"avatar\" [alt]=\"getAuthor(item)\"\r\n                [appImageEditor]=\"edit || false\" [imageData]=\"item.image\" [sectionId]=\"data?.id\" [itemIndex]=\"i\" loading=\"lazy\" />\r\n              <div class=\"author-info\">\r\n                <simpo-text-editor [(value)]=\"item.inputText[1].value\" [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"1\" [itemIndex]=\"i\" [isRTE]=\"item.inputText[1]?.isRTE\"></simpo-text-editor>\r\n                <simpo-text-editor *ngIf=\"item.inputText[2]\" [(value)]=\"item.inputText[2].value\"\r\n                  [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"2\" [itemIndex]=\"i\" [isRTE]=\"item.inputText[2]?.isRTE\"></simpo-text-editor>\r\n              </div>\r\n            </div>\r\n          </div>\r\n        </div>\r\n\r\n      </div>\r\n    </div>\r\n  </div>\r\n\r\n  <!-- Divider -->\r\n  <ng-container *ngIf=\"styles?.devider?.display\">\r\n    <simpo-svg-divider [dividerType]=\"styles?.devider?.deviderType\"\r\n      [color]=\"nextComponentColor?.color\"></simpo-svg-divider>\r\n  </ng-container>\r\n\r\n  <!-- Hover / Edit Controls -->\r\n  <div [ngClass]=\"{'hover_effect': edit}\" *ngIf=\"showEditors\">\r\n    <simpo-hover-elements [data]=\"data\" [index]=\"index\" [editOptions]=\"edit\"></simpo-hover-elements>\r\n  </div>\r\n  <div *ngIf=\"showDelete\" [ngClass]=\"{'hover_effect': delete}\">\r\n    <simpo-delete-hover-element [data]=\"data\" [index]=\"index\"></simpo-delete-hover-element>\r\n  </div>\r\n</section>", styles: [".masonry-grid{display:grid;grid-auto-flow:column;grid-template-rows:repeat(2,1fr);grid-auto-columns:364px;gap:24px;overflow-x:auto;scroll-snap-type:x mandatory;scroll-behavior:smooth;width:95%;-webkit-mask-image:linear-gradient(to right,transparent 0%,black 8%,black 92%,transparent 100%);mask-image:linear-gradient(to right,transparent 0%,black 8%,black 92%,transparent 100%);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}.masonry-grid .masonry-card:nth-child(odd){transform:translate(0)}.masonry-grid .masonry-card:nth-child(2n){transform:translate(40%)}.hover_effect{position:unset;width:100%;top:0;left:0;height:100%}@media (max-width: 575px){.masonry-grid{column-count:1}}.masonry-card{break-inside:avoid;display:flex;flex-direction:column;gap:14px;background:#fff;border:1px solid #E8EDF5;border-radius:12px;padding:24px;margin-bottom:20px;box-shadow:0 2px 12px #0000000a;transition:box-shadow .25s ease,transform .25s ease}.quote-icon svg{display:block}.author-row{display:flex;align-items:center;gap:12px;margin-top:4px}.avatar{width:44px;height:44px;border-radius:50%;object-fit:cover;flex-shrink:0;border:2px solid #E8EDF5}.author-info{display:flex;flex-direction:column}.header-block{text-align:center;padding-bottom:8px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: SpacingAroundDirective, selector: "[spacingAround]", inputs: ["spacingAround", "backgroundInfo"] }, { kind: "directive", type: BackgroundDirective, selector: "[simpoBackground]", inputs: ["simpoBackground", "scrollValue"] }, { kind: "directive", type: HoverDirective, selector: "[simpoHover]", outputs: ["hovering"] }, { kind: "directive", type: SpacingHorizontalDirective, selector: "[spacingHorizontal]", inputs: ["spacingHorizontal", "isHeader"] }, { kind: "directive", type: CornerDirective, selector: "[simpoCorner]", inputs: ["simpoCorner"] }, { kind: "ngmodule", type: SimpoElementsModule }, { kind: "component", type: i3.SvgDividerComponent, selector: "simpo-svg-divider", inputs: ["dividerType", "color"] }, { kind: "ngmodule", type: SimpoComponentModule }, { kind: "component", type: i4.HoverElementsComponent, selector: "simpo-hover-elements", inputs: ["data", "index", "editOptions", "isMerged", "isEcommerce"], outputs: ["edit"] }, { kind: "component", type: i5.DeleteHoverElementComponent, selector: "simpo-delete-hover-element", inputs: ["index", "data"], outputs: ["edit"] }, { kind: "directive", type: BorderDirective, selector: "[simpoBorder]", inputs: ["simpoBorder"] }, { kind: "directive", type: AnimationDirective, selector: "[simpoAnimation]", inputs: ["simpoAnimation"] }, { kind: "directive", type: ContentFitDirective, selector: "[simpoLayout]", inputs: ["simpoLayout"] }, { kind: "directive", type: OverlayDirective, selector: "[simpoOverlay]", inputs: ["simpoOverlay"] }, { kind: "component", type: TextEditorComponent, selector: "simpo-text-editor", inputs: ["value", "editable", "isRTE", "sectionId", "label", "type", "inputTextIndex", "itemIndex"], outputs: ["valueChange"] }, { kind: "directive", type: ImageEditorDirective, selector: "[appImageEditor]", inputs: ["appImageEditor", "imageData", "sectionId", "showIcon", "iconData", "itemIndex"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TestimonialMasonryComponent, decorators: [{
            type: Component,
            args: [{ selector: 'simpo-testimonial-masonry', standalone: true, imports: [
                        CommonModule,
                        NgFor,
                        NgIf,
                        SpacingAroundDirective,
                        BackgroundDirective,
                        HoverDirective,
                        SpacingHorizontalDirective,
                        CornerDirective,
                        SimpoHoverBorderDirective,
                        SimpoElementsModule,
                        SimpoComponentModule,
                        BorderDirective,
                        ContainerFitDirective,
                        simpoConetenAlignmentDirective,
                        AnimationDirective,
                        SimpoContainerAligment,
                        ContentFitDirective,
                        TextBackgroundDirectiveDirective,
                        OverlayDirective,
                        TextEditorComponent,
                        ImageEditorDirective,
                    ], template: "<section class=\"main-container hover-effect\" simpoHover (hovering)=\"showEditTabs($event)\">\r\n  <div class=\"spacing-around\" [spacingAround]=\"stylesLayout\" [simpoBorder]=\"styles?.border\" [id]=\"data?.id\">\r\n    <div class=\"parent-div\" [id]=\"data?.id\" [simpoCorner]=\"styles?.corners\" [simpoBackground]=\"styles?.background\">\r\n      <div [simpoOverlay]=\"styles?.background\" [simpoLayout]=\"styles?.layout\" [id]=\"data?.id\"\r\n        [spacingHorizontal]=\"stylesLayout\" class=\"flex-column\">\r\n\r\n        <!-- Heading Block -->\r\n        <div class=\"header-block mb-3\" [simpoAnimation]=\"styles?.animation\">\r\n          <ng-container *ngFor=\"let text of content?.inputText; let i = index\">\r\n            <simpo-text-editor [(value)]=\"text.value\" [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"i\" [isRTE]=\"text.isRTE\"></simpo-text-editor>\r\n          </ng-container>\r\n        </div>\r\n\r\n        <!-- Masonry Grid -->\r\n        <div class=\"masonry-grid\" [simpoAnimation]=\"styles?.animation\">\r\n          <div class=\"masonry-card\" *ngFor=\"let item of activeItems; let i = index\">\r\n            <!-- Quote Icon -->\r\n            <div class=\"quote-icon\">\r\n              <svg width=\"28\" height=\"22\" viewBox=\"0 0 36 31\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n                <path\r\n                  d=\"M35.3998 3.29993C35.5998 3.09993 35.7998 2.69993 35.5998 2.29993C35.3998 2.09993 34.9998 1.69993 34.5998 0.899925C33.9998 0.699925 33.5998 0.699926 32.9998 1.09993C25.3998 5.89993 21.1998 11.4999 20.3998 17.8999C18.9998 27.8999 27.9998 32.6999 32.5998 28.2999C37.1998 23.8999 34.3998 18.2999 31.1998 16.6999C27.9998 15.0999 25.9998 15.6999 26.1998 13.6999C26.5998 11.6999 31.1998 6.09993 35.3998 3.29993ZM14.7998 1.09993C14.1998 0.699926 13.5998 0.699926 13.1998 1.09993C5.59983 5.89993 1.39983 11.4999 0.599832 18.0999C-0.800168 28.0999 8.19983 32.8999 12.7998 28.4999C17.3998 24.0999 14.5998 18.4999 11.3998 16.8999C7.99983 15.4999 5.99983 16.0999 6.39983 13.8999C6.79983 11.8999 11.3998 6.29993 15.5998 3.49993C15.7998 3.29993 15.9998 2.89993 15.7998 2.49993C15.5998 2.29993 15.1998 1.89993 14.7998 1.09993Z\"\r\n                  [attr.fill]=\"styles?.background?.accentColor || '#6C8EBF'\" />\r\n              </svg>\r\n            </div>\r\n\r\n            <!-- Quote Text -->\r\n            <div class=\"quote-text\">\r\n              <simpo-text-editor [(value)]=\"item.inputText[0].value\" [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"0\" [itemIndex]=\"i\" [isRTE]=\"item.inputText[0]?.isRTE\"></simpo-text-editor>\r\n            </div>\r\n\r\n            <!-- Author Row -->\r\n            <div class=\"author-row\">\r\n              <img *ngIf=\"getAvatarUrl(item)\" [src]=\"getAvatarUrl(item)\" class=\"avatar\" [alt]=\"getAuthor(item)\"\r\n                [appImageEditor]=\"edit || false\" [imageData]=\"item.image\" [sectionId]=\"data?.id\" [itemIndex]=\"i\" loading=\"lazy\" />\r\n              <div class=\"author-info\">\r\n                <simpo-text-editor [(value)]=\"item.inputText[1].value\" [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"1\" [itemIndex]=\"i\" [isRTE]=\"item.inputText[1]?.isRTE\"></simpo-text-editor>\r\n                <simpo-text-editor *ngIf=\"item.inputText[2]\" [(value)]=\"item.inputText[2].value\"\r\n                  [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"2\" [itemIndex]=\"i\" [isRTE]=\"item.inputText[2]?.isRTE\"></simpo-text-editor>\r\n              </div>\r\n            </div>\r\n          </div>\r\n        </div>\r\n\r\n      </div>\r\n    </div>\r\n  </div>\r\n\r\n  <!-- Divider -->\r\n  <ng-container *ngIf=\"styles?.devider?.display\">\r\n    <simpo-svg-divider [dividerType]=\"styles?.devider?.deviderType\"\r\n      [color]=\"nextComponentColor?.color\"></simpo-svg-divider>\r\n  </ng-container>\r\n\r\n  <!-- Hover / Edit Controls -->\r\n  <div [ngClass]=\"{'hover_effect': edit}\" *ngIf=\"showEditors\">\r\n    <simpo-hover-elements [data]=\"data\" [index]=\"index\" [editOptions]=\"edit\"></simpo-hover-elements>\r\n  </div>\r\n  <div *ngIf=\"showDelete\" [ngClass]=\"{'hover_effect': delete}\">\r\n    <simpo-delete-hover-element [data]=\"data\" [index]=\"index\"></simpo-delete-hover-element>\r\n  </div>\r\n</section>", styles: [".masonry-grid{display:grid;grid-auto-flow:column;grid-template-rows:repeat(2,1fr);grid-auto-columns:364px;gap:24px;overflow-x:auto;scroll-snap-type:x mandatory;scroll-behavior:smooth;width:95%;-webkit-mask-image:linear-gradient(to right,transparent 0%,black 8%,black 92%,transparent 100%);mask-image:linear-gradient(to right,transparent 0%,black 8%,black 92%,transparent 100%);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}.masonry-grid .masonry-card:nth-child(odd){transform:translate(0)}.masonry-grid .masonry-card:nth-child(2n){transform:translate(40%)}.hover_effect{position:unset;width:100%;top:0;left:0;height:100%}@media (max-width: 575px){.masonry-grid{column-count:1}}.masonry-card{break-inside:avoid;display:flex;flex-direction:column;gap:14px;background:#fff;border:1px solid #E8EDF5;border-radius:12px;padding:24px;margin-bottom:20px;box-shadow:0 2px 12px #0000000a;transition:box-shadow .25s ease,transform .25s ease}.quote-icon svg{display:block}.author-row{display:flex;align-items:center;gap:12px;margin-top:4px}.avatar{width:44px;height:44px;border-radius:50%;object-fit:cover;flex-shrink:0;border:2px solid #E8EDF5}.author-info{display:flex;flex-direction:column}.header-block{text-align:center;padding-bottom:8px}\n"] }]
        }], ctorParameters: () => [{ type: i1.EventsService }], propDecorators: { data: [{
                type: Input
            }], edit: [{
                type: Input
            }], delete: [{
                type: Input
            }], customClass: [{
                type: Input
            }], nextComponentColor: [{
                type: Input
            }], index: [{
                type: Input
            }], getScreenSize: [{
                type: HostListener,
                args: ['window:resize', ['$event']]
            }] } });
//# sourceMappingURL=data:application/json;base64, 