2026-07-20 16:05:17 +00:00
|
|
|
// Module ID: 1251
|
2026-07-25 08:10:48 +00:00
|
|
|
// Function ID: 14087
|
2026-07-20 16:05:17 +00:00
|
|
|
// Name: makeDataFormatters
|
2026-07-23 10:11:24 +00:00
|
|
|
// Dependencies: [1252, 1253]
|
2026-07-20 16:05:17 +00:00
|
|
|
|
|
|
|
|
// Module 1251 (makeDataFormatters)
|
2026-07-23 10:11:24 +00:00
|
|
|
const require = arg1;
|
|
|
|
|
const dependencyMap = arg6;
|
2026-07-20 16:05:17 +00:00
|
|
|
arg5.makeDataFormatters = function makeDataFormatters(items, formatConfig, _forceLookupMatcher) {
|
2026-07-23 10:11:24 +00:00
|
|
|
let closure_0 = items;
|
|
|
|
|
let closure_1 = formatConfig;
|
2026-07-20 16:05:17 +00:00
|
|
|
function optionsWithLocaleMatcher(formatConfigOptions) {
|
|
|
|
|
let merged = formatConfigOptions;
|
|
|
|
|
if (closure_2) {
|
|
|
|
|
const _Object = Object;
|
|
|
|
|
const _Object2 = Object;
|
|
|
|
|
const obj = { localeMatcher: "lookup" };
|
|
|
|
|
merged = Object.assign(Object.assign({}, formatConfigOptions), obj);
|
|
|
|
|
}
|
|
|
|
|
return merged;
|
|
|
|
|
}
|
|
|
|
|
let closure_2 = arguments.length > 2 && undefined !== arguments[2] && arguments[2];
|
|
|
|
|
return {
|
|
|
|
|
formatDate(arg0, format) {
|
2026-07-23 10:11:24 +00:00
|
|
|
const formatConfigOptions = items(closure_1[0]).resolveFormatConfigOptions(closure_1.date, format);
|
|
|
|
|
const dataFormatterCache = items(closure_1[1]).dataFormatterCache;
|
|
|
|
|
const dateTimeFormatter = dataFormatterCache.getDateTimeFormatter(items, optionsWithLocaleMatcher(formatConfigOptions));
|
2026-07-20 16:05:17 +00:00
|
|
|
return dateTimeFormatter.format(arg0);
|
|
|
|
|
},
|
|
|
|
|
formatDuration(arg0, format) {
|
2026-07-23 10:11:24 +00:00
|
|
|
const formatConfigOptions = items(closure_1[0]).resolveFormatConfigOptions(closure_1.time, format);
|
|
|
|
|
const dataFormatterCache = items(closure_1[1]).dataFormatterCache;
|
|
|
|
|
const durationFormatter = dataFormatterCache.getDurationFormatter(items, optionsWithLocaleMatcher(formatConfigOptions));
|
2026-07-20 16:05:17 +00:00
|
|
|
return durationFormatter.format(arg0);
|
|
|
|
|
},
|
|
|
|
|
formatNumber(arg0, format) {
|
2026-07-23 10:11:24 +00:00
|
|
|
const formatConfigOptions = items(closure_1[0]).resolveFormatConfigOptions(closure_1.number, format);
|
|
|
|
|
const dataFormatterCache = items(closure_1[1]).dataFormatterCache;
|
|
|
|
|
const numberFormatter = dataFormatterCache.getNumberFormatter(items, optionsWithLocaleMatcher(formatConfigOptions));
|
2026-07-20 16:05:17 +00:00
|
|
|
return numberFormatter.format(arg0);
|
|
|
|
|
},
|
|
|
|
|
formatList(arg0, format) {
|
2026-07-23 10:11:24 +00:00
|
|
|
const formatConfigOptions = items(closure_1[0]).resolveFormatConfigOptions(closure_1.list, format);
|
|
|
|
|
const dataFormatterCache = items(closure_1[1]).dataFormatterCache;
|
|
|
|
|
const listFormatter = dataFormatterCache.getListFormatter(items, optionsWithLocaleMatcher(formatConfigOptions));
|
2026-07-20 16:05:17 +00:00
|
|
|
return listFormatter.format(arg0);
|
|
|
|
|
},
|
|
|
|
|
formatListToParts(obj, format) {
|
|
|
|
|
obj = {};
|
2026-07-23 10:11:24 +00:00
|
|
|
const formatConfigOptions = items(closure_1[0]).resolveFormatConfigOptions(closure_1.list, format);
|
2026-07-20 16:05:17 +00:00
|
|
|
for (const key10016 in arg0) {
|
|
|
|
|
let tmp2 = key10016;
|
|
|
|
|
obj["$+/-$placeholder." + key10016] = arg0[key10016];
|
2026-07-23 10:11:24 +00:00
|
|
|
continue;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-07-23 10:11:24 +00:00
|
|
|
const dataFormatterCache = items(closure_1[1]).dataFormatterCache;
|
2026-07-20 16:05:17 +00:00
|
|
|
const listFormatter = dataFormatterCache.getListFormatter(obj, optionsWithLocaleMatcher(formatConfigOptions));
|
|
|
|
|
return listFormatter.formatToParts(Object.keys(obj)).map((value) => {
|
|
|
|
|
value = obj[value.value];
|
|
|
|
|
if (null === value) {
|
|
|
|
|
value = value.value;
|
|
|
|
|
}
|
|
|
|
|
value.value = value;
|
|
|
|
|
return value;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
formatRelativeTime(arg0, day, format) {
|
2026-07-23 10:11:24 +00:00
|
|
|
const formatConfigOptions = items(closure_1[0]).resolveFormatConfigOptions(closure_1.relativeTime, format);
|
|
|
|
|
const dataFormatterCache = items(closure_1[1]).dataFormatterCache;
|
|
|
|
|
const relativeTimeFormatter = dataFormatterCache.getRelativeTimeFormatter(items, optionsWithLocaleMatcher(formatConfigOptions));
|
2026-07-20 16:05:17 +00:00
|
|
|
return relativeTimeFormatter.format(arg0, day);
|
|
|
|
|
},
|
|
|
|
|
formatTime(arg0, format) {
|
2026-07-23 10:11:24 +00:00
|
|
|
const formatConfigOptions = items(closure_1[0]).resolveFormatConfigOptions(closure_1.time, format);
|
|
|
|
|
const dataFormatterCache = items(closure_1[1]).dataFormatterCache;
|
|
|
|
|
const dateTimeFormatter = dataFormatterCache.getDateTimeFormatter(items, optionsWithLocaleMatcher(formatConfigOptions));
|
2026-07-20 16:05:17 +00:00
|
|
|
return dateTimeFormatter.format(arg0);
|
|
|
|
|
},
|
|
|
|
|
getPluralRules(formatConfigOptions) {
|
2026-07-23 10:11:24 +00:00
|
|
|
const dataFormatterCache = items(closure_1[1]).dataFormatterCache;
|
|
|
|
|
return dataFormatterCache.getPluralRules(items, optionsWithLocaleMatcher(formatConfigOptions));
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
};
|