"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isSystemApp = isSystemApp;
exports.parsePlatformName = parsePlatformName;
exports.getMobileAutomation = getMobileAutomation;
const mablApi_1 = require("@mablhq-internal/runtime/mablApi");
const types_1 = require("../../../mobile/types");
function isSystemApp(appId) {
    return !!(appId?.startsWith('com.apple.') ||
        appId?.startsWith('com.google.android.') ||
        appId?.startsWith('com.android.'));
}
function parsePlatformName(platformName) {
    switch (platformName.toLowerCase()) {
        case 'android':
            return mablApi_1.MobilePlatformEnum.Android;
        case 'ios':
            return mablApi_1.MobilePlatformEnum.Ios;
        default:
            throw new Error(`Could not parse unknown mobile platform: ${platformName}`);
    }
}
function getMobileAutomation(platform) {
    switch (platform.toString().toLowerCase()) {
        case 'android':
            return types_1.MobileAutomationName.UiAutomator2;
        case 'ios':
            return types_1.MobileAutomationName.XCUITest;
        default:
            throw new Error(`Unable to determine automation platform for platform name [${platform}]`);
    }
}
