"use strict";
var applicationManagerPath = require("./ios-simulator-application-manager");
var fileSystemPath = require("./ios-simulator-file-system");
var constants = require("../../constants");
var IOSSimulator = (function () {
    function IOSSimulator(simulator, $devicePlatformsConstants, $injector, $iOSSimResolver) {
        this.simulator = simulator;
        this.$devicePlatformsConstants = $devicePlatformsConstants;
        this.$injector = $injector;
        this.$iOSSimResolver = $iOSSimResolver;
    }
    Object.defineProperty(IOSSimulator.prototype, "deviceInfo", {
        get: function () {
            return {
                identifier: this.simulator.id,
                displayName: this.simulator.name,
                model: _.last(this.simulator.fullId.split(".")),
                version: this.simulator.runtimeVersion,
                vendor: "Apple",
                platform: this.$devicePlatformsConstants.iOS,
                status: constants.CONNECTED_STATUS,
                errorHelp: null,
                isTablet: this.simulator.fullId.toLowerCase().indexOf("ipad") !== -1,
                type: "Emulator"
            };
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IOSSimulator.prototype, "isEmulator", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IOSSimulator.prototype, "applicationManager", {
        get: function () {
            if (!this._applicationManager) {
                this._applicationManager = this.$injector.resolve(applicationManagerPath.IOSSimulatorApplicationManager, { iosSim: this.$iOSSimResolver.iOSSim, identifier: this.simulator.id });
            }
            return this._applicationManager;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IOSSimulator.prototype, "fileSystem", {
        get: function () {
            if (!this._fileSystem) {
                this._fileSystem = this.$injector.resolve(fileSystemPath.IOSSimulatorFileSystem, { iosSim: this.$iOSSimResolver.iOSSim, identifier: this.simulator.id });
            }
            return this._fileSystem;
        },
        enumerable: true,
        configurable: true
    });
    IOSSimulator.prototype.openDeviceLogStream = function () {
        return this.$iOSSimResolver.iOSSim.printDeviceLog(this.deviceInfo.identifier);
    };
    return IOSSimulator;
})();
exports.IOSSimulator = IOSSimulator;
