import { __decorate } from "tslib";
import { Component, OnInit, Renderer2, Input, ViewChild, ElementRef, Output, EventEmitter } from '@angular/core';
import { EwMaDesignService } from '../../../ew-ma-design.service';
let ShowHideElementComponent = class ShowHideElementComponent {
    constructor(designService, renderer, el) {
        this.designService = designService;
        this.renderer = renderer;
        this.el = el;
        /**
        * Current Preview Layout
        */
        this.currentPreviewLayout = "desktop";
        this.callSideBar = new EventEmitter();
    }
    /**
     * NgOnint hook
     */
    ngOnInit() {
        //console.log('inside show hide', this.model);
    }
    /*
    toggleDesktopVisibility() :void {
      this.callSideBar.emit(this.model);
    }
  
    toggleMobileVisibility() :void {
      this.callSideBar.emit(this.model);
    }
    */
    /**
      * ngDoCheck Hook
      */
    ngDoCheck() {
        this.currentPreviewLayout = localStorage.getItem('currentPreviewLayout');
    }
};
ShowHideElementComponent.ctorParameters = () => [
    { type: EwMaDesignService },
    { type: Renderer2 },
    { type: ElementRef }
];
__decorate([
    ViewChild('wrapElement')
], ShowHideElementComponent.prototype, "wrapEleRef", void 0);
__decorate([
    Output()
], ShowHideElementComponent.prototype, "callSideBar", void 0);
__decorate([
    Input()
], ShowHideElementComponent.prototype, "model", void 0);
ShowHideElementComponent = __decorate([
    Component({
        selector: 'ew-element-show-hide',
        template: "<div class=\"advance-title-sec-box\" >\r\n    <span class=\"title-advance-box\">{{ 'BUILDER.ELEMENTS.VISIBILITY_HEADING_LABEL' | translate }}</span></div>\r\n<div class=\"builder-elements-outer\">\r\n    <div class=\"element-builder-row\" *ngIf=\"(this.currentPreviewLayout=='desktop' && this.model.meta_data.hide_mobile)\">\r\n        <span class=\"builder-elements-name\">{{ 'BUILDER.ELEMENTS.DESKTOP_ELEMENT_VISIBILITY' | translate }}</span>\r\n        <div class=\"ew-toggle-button\">\r\n            <div class=\"toggle-button-cover\">\r\n                <div class=\"button-cover\">\r\n                    <div class=\"button b2 toggle-button-switch\">\r\n                        <!--<input type=\"checkbox\" class=\"checkbox\" [(ngModel)]=\"model.meta_data.hide_desktop\" (change)=\"toggleDesktopVisibility()\">-->\r\n                        <input type=\"checkbox\" class=\"checkbox\" [(ngModel)]=\"model.meta_data.hide_desktop\">\r\n                        <div class=\"knobs\">\r\n                            <span></span>\r\n                        </div>\r\n                        <div class=\"layer\"></div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class=\"element-builder-row \" *ngIf=\"(this.currentPreviewLayout=='mobile' && this.model.meta_data.hide_desktop)\"> <!--padding-elements-30-top-->\r\n        <span class=\"builder-elements-name\">{{ 'BUILDER.ELEMENTS.MOBILE_ELEMENT_VISIBILITY' | translate }}</span>\r\n        <div class=\"ew-toggle-button\">\r\n            <div class=\"toggle-button-cover\">\r\n                <div class=\"button-cover\">\r\n                    <div class=\"button b2 toggle-button-switch\">\r\n                        <!--<input type=\"checkbox\" class=\"checkbox\" [(ngModel)]=\"model.meta_data.hide_mobile\" (change)=\"toggleMobileVisibility()\">-->\r\n                        <input type=\"checkbox\" class=\"checkbox\" [(ngModel)]=\"model.meta_data.hide_mobile\">\r\n                        <div class=\"knobs\">\r\n                            <span></span>\r\n                        </div>\r\n                        <div class=\"layer\"></div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>",
        styles: [""]
    })
], ShowHideElementComponent);
export { ShowHideElementComponent };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hvdy1oaWRlLWVsZW1lbnQuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vZXctbWEtZGVzaWduLyIsInNvdXJjZXMiOlsibGliL2NvbXBvbmVudHMvZWxlbWVudHMvc2hvdy1oaWRlLWVsZW1lbnQvc2hvdy1oaWRlLWVsZW1lbnQuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sRUFBRSxTQUFTLEVBQUMsS0FBSyxFQUFFL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