import { Component, Input, ViewEncapsulation } from '@angular/core';
import { GeoFence } from '../../../../forms/page/widgets/geofence';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@agm/core";
import * as i3 from "@angular/material/icon";
function GeoFenceWidgetViewComponent_ng_container_0_div_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 3);
    i0.ɵɵelementStart(1, "agm-map", 4);
    i0.ɵɵelement(2, "agm-marker", 5);
    i0.ɵɵelement(3, "agm-circle", 6);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("latitude", ctx_r3.latitude)("longitude", ctx_r3.longitude)("zoom", ctx_r3.zoom);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("latitude", ctx_r3.latitude)("longitude", ctx_r3.longitude)("markerDraggable", false);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("latitude", ctx_r3.latitude)("longitude", ctx_r3.longitude)("radius", ctx_r3.radius)("fillColor", "red")("circleDraggable", false)("editable", false);
} }
function GeoFenceWidgetViewComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, GeoFenceWidgetViewComponent_ng_container_0_div_1_Template, 4, 12, "div", 2);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r0.widget.value);
} }
function GeoFenceWidgetViewComponent_ng_template_1_span_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 12);
    i0.ɵɵtext(1);
    i0.ɵɵelementStart(2, "span", 13);
    i0.ɵɵtext(3, " :");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r4 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r4.widgetProperties.prompt);
} }
function GeoFenceWidgetViewComponent_ng_template_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 7);
    i0.ɵɵelementStart(1, "div", 8);
    i0.ɵɵelement(2, "mat-icon", 9);
    i0.ɵɵtemplate(3, GeoFenceWidgetViewComponent_ng_template_1_span_3_Template, 4, 1, "span", 10);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(4, "span", 11);
    i0.ɵɵtext(5, "-");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r2 = i0.ɵɵnextContext();
    i0.ɵɵadvance(3);
    i0.ɵɵproperty("ngIf", ctx_r2.section.showPrompt);
} }
export class GeoFenceWidgetViewComponent {
    constructor() {
        // Google map zoom level
        this.zoom = 15;
    }
    ngOnInit() {
        // get gps widget value from to gps class 
        if (this.widget.value !== null && this.widget.value.length) {
            this.latitude = this.widget.value[0].centerLocationValue.latitude;
            this.longitude = this.widget.value[0].centerLocationValue.longitude;
            this.radius = this.widgetProperties.widget.radius;
        }
    }
}
GeoFenceWidgetViewComponent.ɵfac = function GeoFenceWidgetViewComponent_Factory(t) { return new (t || GeoFenceWidgetViewComponent)(); };
GeoFenceWidgetViewComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: GeoFenceWidgetViewComponent, selectors: [["lib-geo-fence-widget-view"]], inputs: { widget: "widget", widgetProperties: "widgetProperties" }, decls: 3, vars: 2, consts: [[4, "ngIf", "ngIfElse"], ["isWidgetValueEmpty", ""], ["class", "gps-fence-container", 4, "ngIf"], [1, "gps-fence-container"], [3, "latitude", "longitude", "zoom"], [3, "latitude", "longitude", "markerDraggable"], [3, "latitude", "longitude", "radius", "fillColor", "circleDraggable", "editable"], [1, "data-detail-infoc", "capture-container"], [1, "data-detail-title", "flex", "text-sm"], ["svgIcon", "axo_geofence", 1, "add-text"], ["class", "pl-2 text-sm", 4, "ngIf"], [1, "flex", "justify-start"], [1, "pl-2", "text-sm"], [1, "colon"]], template: function GeoFenceWidgetViewComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵtemplate(0, GeoFenceWidgetViewComponent_ng_container_0_Template, 2, 1, "ng-container", 0);
        i0.ɵɵtemplate(1, GeoFenceWidgetViewComponent_ng_template_1_Template, 6, 1, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor);
    } if (rf & 2) {
        const _r1 = i0.ɵɵreference(2);
        i0.ɵɵproperty("ngIf", ctx.widget.value)("ngIfElse", _r1);
    } }, directives: [i1.NgIf, i2.AgmMap, i2.AgmMarker, i2.AgmCircle, i3.MatIcon], styles: ["lib-geo-fence-widget-view{margin:7px 0;display:block}lib-geo-fence-widget-view agm-map{height:300px}lib-geo-fence-widget-view .mat-form-field.mat-form-field-appearance-fill{width:100%!important}\n"], encapsulation: 2 });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(GeoFenceWidgetViewComponent, [{
        type: Component,
        args: [{ selector: 'lib-geo-fence-widget-view', encapsulation: ViewEncapsulation.None, template: "<ng-container *ngIf=\"widget.value; else isWidgetValueEmpty\" >\n    <div class=\"gps-fence-container\" *ngIf=\"widget.value\">\n        <agm-map [latitude]=\"latitude\" [longitude]=\"longitude\" [zoom]=\"zoom\">\n            <agm-marker [latitude]=\"latitude\" [longitude]=\"longitude\" [markerDraggable]=\"false\"></agm-marker>\n            <agm-circle [latitude]=\"latitude\" [longitude]=\"longitude\"\n                [radius]=\"radius\"\n                [fillColor]=\"'red'\"\n                [circleDraggable]=\"false\"\n                [editable]=\"false\">\n            </agm-circle>\n        </agm-map>\n    </div>\n</ng-container>\n<ng-template #isWidgetValueEmpty>\n    <div class=\"data-detail-infoc capture-container\">\n        <div class=\"data-detail-title flex text-sm\">\n            <mat-icon class=\"add-text\" svgIcon=\"axo_geofence\"></mat-icon>\n            <span *ngIf=\"section.showPrompt\" class=\"pl-2 text-sm\">{{widgetProperties.prompt}}<span class=\"colon\"> :</span></span>\n        </div>\n        <span class=\"flex justify-start\">-</span>\n      </div>\n</ng-template>\n", styles: ["lib-geo-fence-widget-view{margin:7px 0;display:block}lib-geo-fence-widget-view agm-map{height:300px}lib-geo-fence-widget-view .mat-form-field.mat-form-field-appearance-fill{width:100%!important}\n"] }]
    }], null, { widget: [{
            type: Input
        }], widgetProperties: [{
            type: Input
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 