var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { Injectable } from '@angular/core';
import { Router, CanActivate } from '@angular/router';
import { CheckoutService } from '../services/checkout/checkout.service';
import * as i0 from "@angular/core";
import * as i1 from "../../public-api";
import * as i2 from "@angular/router";
var CheckoutReadyGuard = /** @class */ (function () {
    function CheckoutReadyGuard(router, checkoutService) {
        this.router = router;
        this.checkoutService = checkoutService;
    }
    CheckoutReadyGuard.prototype.canActivate = function () {
        if (!this.checkoutService.isCheckoutReady()) {
            this.router.navigate(['/']);
        }
        return this.checkoutService.isCheckoutReady();
    };
    CheckoutReadyGuard.ctorParameters = function () { return [
        { type: Router },
        { type: CheckoutService }
    ]; };
    CheckoutReadyGuard.ɵprov = i0.ɵɵdefineInjectable({ factory: function CheckoutReadyGuard_Factory() { return new i1.CheckoutReadyGuard(i0.ɵɵinject(i2.Router), i0.ɵɵinject(i1.CheckoutService)); }, token: i1.CheckoutReadyGuard, providedIn: "root" });
    CheckoutReadyGuard = __decorate([
        Injectable({
            providedIn: 'root'
        })
    ], CheckoutReadyGuard);
    return CheckoutReadyGuard;
}());
export { CheckoutReadyGuard };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hlY2tvdXQtcmVhZHkuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25nLWVhc3ljb21tZXJjZS8iLCJzb3VyY2VzIjpbImxpYi9ndWFyZHMvY2hlY2tvdXQtcmVhZHkuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzI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