import { Component, EventEmitter, Input, Output } from '@angular/core';
import { MatDialogRef } from '@angular/material/dialog';
import { MyAppListService } from '../app-list/my-app-list.service';
import { AppListDto } from '../../public-api';
import { CommonLibConfigurationService } from '../../public-api';
import * as i0 from "@angular/core";
import * as i1 from "@angular/material/dialog";
import * as i2 from "../app-list/my-app-list.service";
import * as i3 from "../../public-api";
export class QrdialogComponent {
    constructor(dialogRef, myAppListService, commonLibConfig) {
        this.dialogRef = dialogRef;
        this.myAppListService = myAppListService;
        this.commonLibConfig = commonLibConfig;
        this.close = new EventEmitter();
        this.viewWebAppUrl = this.commonLibConfig.ViewWebApp;
    }
    ngOnInit() {
        if (this.appListDto && this.appListDto.appVersionId) {
            this.fetchAppDetails(this.appListDto.appVersionId);
        }
    }
    downloadAndroidApp() {
        // Logic to download Android app
    }
    downloadIOSApp() {
        // Logic to download iOS app
    }
    CloseDialog() {
        this.dialogRef.close();
    }
    viewSubmissions() {
    }
    fetchAppDetails(appVersionId) {
        this.myAppListService.fetchAppDetails(appVersionId, this.commonLibConfig.axonatorX1Url).subscribe((response) => {
            // Handle the response here
            console.log('App details:', response);
        }, (error) => {
            // Handle error
            console.error('Error fetching app details:', error);
        });
    }
    onViewSubmissionClick() {
        window.open(this.viewWebAppUrl, '_blank');
    }
}
QrdialogComponent.ɵfac = function QrdialogComponent_Factory(t) { return new (t || QrdialogComponent)(i0.ɵɵdirectiveInject(i1.MatDialogRef), i0.ɵɵdirectiveInject(i2.MyAppListService), i0.ɵɵdirectiveInject(i3.CommonLibConfigurationService)); };
QrdialogComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: QrdialogComponent, selectors: [["app-qrdialog"]], inputs: { appListDto: "appListDto" }, outputs: { close: "close" }, decls: 16, vars: 0, consts: [[1, "popup-container", "test"], ["mat-dialog-title", ""], [1, "close-icon", 3, "click"], [1, "flex", "items-center", "justify-evenly", "my-6"], [1, "flex", "flex-col", "justify-between", "items-center"], ["src", "assets/android-link-qr.svg", "alt", "Android QR Code", 1, "custom-img", "qr-code-img", 3, "click"], ["src", "assets/playstore.svg", "alt", "Android Logo", 1, "app-logo", 3, "click"], ["src", "assets/ios-link-qr.svg", "alt", "iOS QR Code", 1, "custom-img", "qr-code-img", 3, "click"], ["src", "assets/appstore.svg", "alt", "iOS Logo", 1, "app-logo", 3, "click"], [1, "w-full", "text-center"], [1, "stroke-btn", 3, "click"]], template: function QrdialogComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵelementStart(0, "div", 0);
        i0.ɵɵelementStart(1, "h1", 1);
        i0.ɵɵtext(2, "Get Mobile App");
        i0.ɵɵelementEnd();
        i0.ɵɵelementStart(3, "button", 2);
        i0.ɵɵlistener("click", function QrdialogComponent_Template_button_click_3_listener() { return ctx.CloseDialog(); });
        i0.ɵɵelementEnd();
        i0.ɵɵelementStart(4, "p");
        i0.ɵɵtext(5, "Download the mobile app to start using on your Android or iOS mobile device");
        i0.ɵɵelementEnd();
        i0.ɵɵelementStart(6, "div", 3);
        i0.ɵɵelementStart(7, "div", 4);
        i0.ɵɵelementStart(8, "img", 5);
        i0.ɵɵlistener("click", function QrdialogComponent_Template_img_click_8_listener() { return ctx.downloadAndroidApp(); });
        i0.ɵɵelementEnd();
        i0.ɵɵelementStart(9, "img", 6);
        i0.ɵɵlistener("click", function QrdialogComponent_Template_img_click_9_listener() { return ctx.downloadAndroidApp(); });
        i0.ɵɵelementEnd();
        i0.ɵɵelementEnd();
        i0.ɵɵelementStart(10, "div", 4);
        i0.ɵɵelementStart(11, "img", 7);
        i0.ɵɵlistener("click", function QrdialogComponent_Template_img_click_11_listener() { return ctx.downloadIOSApp(); });
        i0.ɵɵelementEnd();
        i0.ɵɵelementStart(12, "img", 8);
        i0.ɵɵlistener("click", function QrdialogComponent_Template_img_click_12_listener() { return ctx.downloadIOSApp(); });
        i0.ɵɵelementEnd();
        i0.ɵɵelementEnd();
        i0.ɵɵelementEnd();
        i0.ɵɵelementStart(13, "div", 9);
        i0.ɵɵelementStart(14, "button", 10);
        i0.ɵɵlistener("click", function QrdialogComponent_Template_button_click_14_listener() { return ctx.onViewSubmissionClick(); });
        i0.ɵɵtext(15, "View submission on web");
        i0.ɵɵelementEnd();
        i0.ɵɵelementEnd();
        i0.ɵɵelementEnd();
    } }, directives: [i1.MatDialogTitle], styles: [".custom-img[_ngcontent-%COMP%]{width:200px;max-width:100%}.app-logo[_ngcontent-%COMP%]{width:100px;cursor:pointer;margin-top:10px}"] });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(QrdialogComponent, [{
        type: Component,
        args: [{ selector: 'app-qrdialog', template: "<div class=\"popup-container test\">\n  <h1 mat-dialog-title>Get Mobile App</h1>\n  <button class=\"close-icon\" (click)=\"CloseDialog()\"></button>\n  <p>Download the mobile app to start using on your Android or iOS mobile device</p>\n\n  <div class=\"flex items-center justify-evenly my-6\">\n    <div class=\"flex flex-col justify-between items-center\">\n      <!-- QR code for Android app -->\n      <img src=\"assets/android-link-qr.svg\" alt=\"Android QR Code\" class=\"custom-img qr-code-img\"\n        (click)=\"downloadAndroidApp()\">\n      <img src=\"assets/playstore.svg\" alt=\"Android Logo\" class=\"app-logo\" (click)=\"downloadAndroidApp()\">\n    </div>\n    <div class=\"flex flex-col justify-between items-center\">\n      <!-- QR code for iOS app -->\n      <img src=\"assets/ios-link-qr.svg\" alt=\"iOS QR Code\" class=\"custom-img qr-code-img\" (click)=\"downloadIOSApp()\">\n      <img src=\"assets/appstore.svg\" alt=\"iOS Logo\" class=\"app-logo\" (click)=\"downloadIOSApp()\">\n    </div>\n  </div>\n\n  <div class=\"w-full text-center\">\n    <!-- <a mat-button color=\"primary\" [href]=\"viewWebAppUrl\" target=\"_blank\">View Submissions on Web</a> -->\n     <button class=\"stroke-btn\" (click)=\"onViewSubmissionClick()\">View submission on web</button>\n  </div>\n</div>", styles: [".custom-img{width:200px;max-width:100%}.app-logo{width:100px;cursor:pointer;margin-top:10px}\n"] }]
    }], function () { return [{ type: i1.MatDialogRef }, { type: i2.MyAppListService }, { type: i3.CommonLibConfigurationService }]; }, { appListDto: [{
            type: Input
        }], close: [{
            type: Output
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 