Rocky_Mountain_Vending/.pnpm-store/v10/files/b0/4fef32886bf0fb6d53e967331626b9f733f7419acb85882cad8f8a62f5474e59f95c7afa618f293f6fcc3c6618086da9c80b125be5623f5243ce5810ff8f9c
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

34 lines
1.2 KiB
Text

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BestFitMatcher = BestFitMatcher;
var utils_1 = require("./utils");
/**
* https://tc39.es/ecma402/#sec-bestfitmatcher
* @param availableLocales
* @param requestedLocales
* @param getDefaultLocale
*/
function BestFitMatcher(availableLocales, requestedLocales, getDefaultLocale) {
var foundLocale;
var extension;
var noExtensionLocales = [];
var noExtensionLocaleMap = requestedLocales.reduce(function (all, l) {
var noExtensionLocale = l.replace(utils_1.UNICODE_EXTENSION_SEQUENCE_REGEX, '');
noExtensionLocales.push(noExtensionLocale);
all[noExtensionLocale] = l;
return all;
}, {});
var result = (0, utils_1.findBestMatch)(noExtensionLocales, availableLocales);
if (result.matchedSupportedLocale && result.matchedDesiredLocale) {
foundLocale = result.matchedSupportedLocale;
extension =
noExtensionLocaleMap[result.matchedDesiredLocale].slice(result.matchedDesiredLocale.length) || undefined;
}
if (!foundLocale) {
return { locale: getDefaultLocale() };
}
return {
locale: foundLocale,
extension: extension,
};
}