"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LiveSyncServiceResolver = void 0;
const yok_1 = require("../common/yok");
class LiveSyncServiceResolver {
    constructor($errors, $injector, $mobileHelper) {
        this.$errors = $errors;
        this.$injector = $injector;
        this.$mobileHelper = $mobileHelper;
    }
    resolveLiveSyncService(platform) {
        if (this.$mobileHelper.isApplePlatfrom(platform)) {
            return this.$injector.resolve("iOSLiveSyncService");
        }
        else if (this.$mobileHelper.isAndroidPlatform(platform)) {
            return this.$injector.resolve("androidLiveSyncService");
        }
        this.$errors.fail(`Invalid platform ${platform}. Supported platforms are: ${this.$mobileHelper.platformNames.join(", ")}`);
    }
}
exports.LiveSyncServiceResolver = LiveSyncServiceResolver;
yok_1.injector.register("liveSyncServiceResolver", LiveSyncServiceResolver);
