"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAgentLocationMatchExpression = exports.getLocationsFromMatchExpressions = void 0;
const common_1 = require("../common");
const getLocationsFromMatchExpressions = (expressions = []) => { var _a; return ((_a = expressions.find((expr) => expr.key === common_1.AGENT_LOCATION_LABEL_KEY)) === null || _a === void 0 ? void 0 : _a.values) || []; };
exports.getLocationsFromMatchExpressions = getLocationsFromMatchExpressions;
const getAgentLocationMatchExpression = (locations) => {
    return (locations === null || locations === void 0 ? void 0 : locations.length)
        ? [
            {
                key: common_1.AGENT_LOCATION_LABEL_KEY,
                operator: 'In',
                values: locations,
            },
        ]
        : undefined;
};
exports.getAgentLocationMatchExpression = getAgentLocationMatchExpression;
//# sourceMappingURL=labels.js.map