"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MpvStopParser = void 0;
class MpvStopParser {
    static parsePlatformCode(cisStop) {
        const platformCode = cisStop.$.stan;
        if (!platformCode) {
            return null;
        }
        const matches = platformCode.match(MpvStopParser.shortPlatformRegex);
        const candidate = (matches ?? [platformCode])[0];
        return candidate.split(/\s+/)[0].trim();
    }
}
exports.MpvStopParser = MpvStopParser;
/**
 * Parse and sanitize current platform code
 *   1/3 -> 1
 *   -/3 -> 3
 *   1/- -> 1
 *   -/BUS -> BUS
 *   2/100V -> 2
 *   -/5 C-F -> 5
 *   2/5 A -> 2
 *   5A/- A C -> 5A
 */
MpvStopParser.shortPlatformRegex = /[^/-]+/;
//# sourceMappingURL=MpvStopParser.js.map