"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AndroidPrepareData = exports.IOSPrepareData = exports.PrepareData = void 0;
const controller_data_base_1 = require("./controller-data-base");
const _ = require("lodash");
class PrepareData extends controller_data_base_1.ControllerDataBase {
    constructor(projectDir, platform, data) {
        super(projectDir, platform, data);
        this.projectDir = projectDir;
        this.platform = platform;
        this.watchNative = true;
        const env = {};
        if (Array.isArray(data.env)) {
            data.env.forEach((flag) => {
                if (typeof flag === "string") {
                    env.env = flag;
                    return;
                }
                Object.assign(env, flag);
            });
        }
        else {
            Object.assign(env, data.env);
        }
        this.release = data.release;
        this.hmr = data.hmr || data.useHotModuleReload;
        this.env = Object.assign(Object.assign({}, env), { hmr: data.hmr || data.useHotModuleReload });
        this.watch = data.watch;
        if (_.isBoolean(data.watchNative)) {
            this.watchNative = data.watchNative;
        }
    }
}
exports.PrepareData = PrepareData;
class IOSPrepareData extends PrepareData {
    constructor(projectDir, platform, data) {
        super(projectDir, platform, data);
        this.teamId = data.teamId;
        this.provision = data.provision;
        this.mobileProvisionData = data.mobileProvisionData;
    }
}
exports.IOSPrepareData = IOSPrepareData;
class AndroidPrepareData extends PrepareData {
}
exports.AndroidPrepareData = AndroidPrepareData;
//# sourceMappingURL=prepare-data.js.map