@unblind/units 0.1.0-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +209 -0
- package/README.md +3 -0
- package/dist/index.d.mts +151 -0
- package/dist/index.d.ts +151 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/datetime/formats.ts","../src/datetime/formatter.ts","../src/utils/featureToggles.ts","../src/datetime/common.ts","../src/datetime/moment_wrapper.ts","../src/types/time.ts","../src/i18n/dates.ts","../src/valueFormats/valueFormats.ts","../src/i18n/index.ts","../src/valueFormats/arithmeticFormatters.ts","../src/valueFormats/dateTimeFormatters.ts","../src/valueFormats/symbolFormatters.ts","../src/valueFormats/categories.ts"],"sourcesContent":["export interface SystemDateFormatSettings {\n fullDate: string;\n interval: {\n millisecond: string;\n second: string;\n minute: string;\n hour: string;\n day: string;\n month: string;\n year: string;\n };\n useBrowserLocale: boolean;\n}\n\nconst DEFAULT_SYSTEM_DATE_FORMAT = 'YYYY-MM-DD HH:mm:ss';\nconst DEFAULT_SYSTEM_DATE_MS_FORMAT = 'YYYY-MM-DD HH:mm:ss.SSS';\n\nexport class SystemDateFormatsState {\n fullDate = DEFAULT_SYSTEM_DATE_FORMAT;\n fullDateMS = DEFAULT_SYSTEM_DATE_MS_FORMAT;\n interval = {\n millisecond: 'HH:mm:ss.SSS',\n second: 'HH:mm:ss',\n minute: 'HH:mm',\n hour: 'MM/DD HH:mm',\n day: 'MM/DD',\n month: 'YYYY-MM',\n year: 'YYYY',\n };\n\n update(settings: SystemDateFormatSettings) {\n this.fullDate = settings.fullDate;\n this.interval = settings.interval;\n\n if (settings.useBrowserLocale) {\n this.useBrowserLocale();\n }\n }\n\n useBrowserLocale() {\n this.fullDate = localTimeFormat({\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n });\n\n // ES5 doesn't support `DateTimeFormatOptions.fractionalSecondDigits` so we have to use\n // a hack with string replacement.\n this.fullDateMS = this.fullDate.replace('ss', 'ss.SSS');\n\n this.interval.millisecond = localTimeFormat(\n { hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false },\n null,\n this.interval.second\n ).replace('ss', 'ss.SSS');\n this.interval.second = localTimeFormat(\n { hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false },\n null,\n this.interval.second\n );\n this.interval.minute = localTimeFormat(\n { hour: '2-digit', minute: '2-digit', hour12: false },\n null,\n this.interval.minute\n );\n this.interval.hour = localTimeFormat(\n { month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', hour12: false },\n null,\n this.interval.hour\n );\n this.interval.day = localTimeFormat({ month: '2-digit', day: '2-digit', hour12: false }, null, this.interval.day);\n this.interval.month = localTimeFormat(\n { year: 'numeric', month: '2-digit', hour12: false },\n null,\n this.interval.month\n );\n }\n\n getTimeFieldUnit(useMsResolution?: boolean) {\n return `time:${useMsResolution ? this.fullDateMS : this.fullDate}`;\n }\n}\n\n/**\n * localTimeFormat helps to generate date formats for momentjs based on browser's locale\n *\n * @param locale browser locale, or default\n * @param options DateTimeFormatOptions to format date\n * @param fallback default format if Intl API is not present\n */\nexport function localTimeFormat(\n options: Intl.DateTimeFormatOptions,\n locale?: string | string[] | null,\n fallback?: string\n): string {\n if (missingIntlDateTimeFormatSupport()) {\n return fallback ?? DEFAULT_SYSTEM_DATE_FORMAT;\n }\n\n if (!locale && navigator) {\n locale = [...navigator.languages];\n }\n\n // https://momentjs.com/docs/#/displaying/format/\n let dateTimeFormat: Intl.DateTimeFormat;\n\n try {\n dateTimeFormat = new Intl.DateTimeFormat(locale || undefined, options);\n } catch {\n dateTimeFormat = new Intl.DateTimeFormat('en-US', options);\n }\n const parts = dateTimeFormat.formatToParts(new Date());\n const hour12 = dateTimeFormat.resolvedOptions().hour12;\n\n const mapping: { [key: string]: string } = {\n year: 'YYYY',\n month: 'MM',\n day: 'DD',\n hour: hour12 ? 'hh' : 'HH',\n minute: 'mm',\n second: 'ss',\n weekday: 'ddd',\n era: 'N',\n dayPeriod: 'A',\n timeZoneName: 'Z',\n };\n\n return parts.map((part) => mapping[part.type] || part.value).join('');\n}\n\nexport const systemDateFormats = new SystemDateFormatsState();\n\nconst missingIntlDateTimeFormatSupport = (): boolean => {\n return !('DateTimeFormat' in Intl) || !('formatToParts' in Intl.DateTimeFormat.prototype);\n};\n","/* eslint-disable id-blacklist, no-restricted-imports */\nimport moment, { Moment } from \"moment-timezone\";\n\nimport { TimeZone } from \"../types/time\";\nimport { getFeatureToggle } from \"../utils/featureToggles\";\n\nimport { DateTimeOptions, getTimeZone } from \"./common\";\nimport { systemDateFormats } from \"./formats\";\nimport { DateTimeInput, toUtc, dateTimeAsMoment } from \"./moment_wrapper\";\nimport { formatDate } from \"../i18n/dates\";\n\n/**\n * Converts a Grafana DateTimeInput to a plain Javascript Date object.\n */\nfunction toDate(dateInUtc: DateTimeInput): Date {\n if (dateInUtc instanceof Date) {\n return dateInUtc;\n }\n\n if (typeof dateInUtc === \"string\" || typeof dateInUtc === \"number\") {\n return new Date(dateInUtc);\n }\n\n return dateTimeAsMoment(dateInUtc).toDate();\n}\n\n/**\n * Converts a Grafana timezone string to an IANA timezone string.\n */\nexport function toIANATimezone(grafanaTimezone: string) {\n // Intl APIs will use the browser's timezone by default (if tz is undefined)\n if (grafanaTimezone === \"browser\") {\n return undefined;\n }\n\n const zone = moment.tz.zone(grafanaTimezone);\n if (!zone) {\n // If the timezone is invalid, we default to the browser's timezone\n return undefined;\n }\n\n return grafanaTimezone;\n}\n\nfunction getIntlOptions(\n date: Date,\n options?: DateTimeOptionsWithFormat,\n): Intl.DateTimeFormatOptions & { timeZone?: string } {\n const timeZone = getTimeZone(options);\n\n const intlOptions: Intl.DateTimeFormatOptions = {\n year: \"numeric\", // ↔ dateStyle: 'short'\n month: \"numeric\",\n day: \"numeric\",\n hour: \"numeric\", // ↔ timeStyle: 'short'\n minute: \"numeric\",\n timeZone: toIANATimezone(timeZone),\n };\n\n // If the time has seconds, ensure they're included in the format\n const hasSeconds = date.getSeconds() !== 0;\n if (hasSeconds) {\n intlOptions.second = \"numeric\";\n }\n\n if (options?.defaultWithMS) {\n intlOptions.second = \"numeric\";\n intlOptions.fractionalSecondDigits = 3; // Include milliseconds\n }\n\n return intlOptions;\n}\n\n/**\n * The type describing the options that can be passed to the {@link dateTimeFormat}\n * helper function to control how the date and time value passed to the function is\n * formatted.\n *\n * @public\n */\nexport interface DateTimeOptionsWithFormat extends DateTimeOptions {\n /**\n * Set this value to `true` if you want to include milliseconds when formatting date and time\n */\n defaultWithMS?: boolean;\n}\n\ntype DateTimeFormatter<T extends DateTimeOptions = DateTimeOptions> = (\n dateInUtc: DateTimeInput,\n options?: T,\n) => string;\n\n// NOTE:\n// These date formatting functions now just wrap the @grafana/i18n formatting functions\n// (which themselves wrap the browserIntl APIs). In the future we may deprecate these\n// in favor of using @grafana/i18n directly.\n\n/**\n * Helper function to format date and time according to the specified options.\n * If no options are supplied, then the date is formatting according to the user's locale preference.\n *\n * @param dateInUtc - date in UTC format, e.g. string formatted with UTC offset, UNIX epoch in seconds etc.\n * @param options\n *\n * @public\n */\nexport const dateTimeFormat: DateTimeFormatter<DateTimeOptionsWithFormat> = (\n dateInUtc,\n options?,\n) => {\n // If a custom format is provided (or the toggle isn't enabled), use the previous implementation\n if (!getFeatureToggle(\"localeFormatPreference\") || options?.format) {\n return toTz(dateInUtc, getTimeZone(options)).format(getFormat(options));\n }\n\n const dateAsDate = toDate(dateInUtc);\n const intlOptions = getIntlOptions(dateAsDate, options); // TODO - if invalid timezone, use browser timezone\n return formatDate(dateAsDate, intlOptions);\n};\n\n/**\n * Helper function to format date and time according to the standard ISO format e.g. 2013-02-04T22:44:30.652Z.\n * If no options are supplied, then default values are used. For more details, see {@link DateTimeOptionsWithFormat}.\n *\n * @param dateInUtc - date in UTC format, e.g. string formatted with UTC offset, UNIX epoch in seconds etc.\n * @param options\n *\n * @public\n */\nexport const dateTimeFormatISO: DateTimeFormatter = (dateInUtc, options?) =>\n toTz(dateInUtc, getTimeZone(options)).format();\n\n/**\n * Helper function to return elapsed time since passed date. The returned value will be formatted\n * in a human readable format e.g. 4 years ago. If no options are supplied, then default values are used.\n * For more details, see {@link DateTimeOptions}.\n *\n * @param dateInUtc - date in UTC format, e.g. string formatted with UTC offset, UNIX epoch in seconds etc.\n * @param options\n *\n * @public\n */\nexport const dateTimeFormatTimeAgo: DateTimeFormatter = (dateInUtc, options?) =>\n toTz(dateInUtc, getTimeZone(options)).fromNow();\n\n/**\n * Helper function to format date and time according to the Grafana default formatting, but it\n * also appends the time zone abbreviation at the end e.g. 2020-05-20 13:37:00 CET. If no options\n * are supplied, then default values are used. For more details please see {@link DateTimeOptions}.\n *\n * @param dateInUtc - date in UTC format, e.g. string formatted with UTC offset, UNIX epoch in seconds etc.\n * @param options\n *\n * @public\n */\nexport const dateTimeFormatWithAbbrevation: DateTimeFormatter = (\n dateInUtc,\n options?,\n) => {\n // If a custom format is provided (or the toggle isn't enabled), use the previous implementation\n if (!getFeatureToggle(\"localeFormatPreference\") || options?.format) {\n return toTz(dateInUtc, getTimeZone(options)).format(\n `${systemDateFormats.fullDate} z`,\n );\n }\n\n const dateAsDate = toDate(dateInUtc);\n const intlOptions = getIntlOptions(dateAsDate, options);\n intlOptions.timeZoneName = \"short\";\n\n return formatDate(dateAsDate, intlOptions);\n};\n\n/**\n * Helper function to return only the time zone abbreviation for a given date and time value. If no options\n * are supplied, then default values are used. For more details please see {@link DateTimeOptions}.\n *\n * @param dateInUtc - date in UTC format, e.g. string formatted with UTC offset, UNIX epoch in seconds etc.\n * @param options\n *\n * @public\n */\nexport const timeZoneAbbrevation: DateTimeFormatter = (dateInUtc, options?) =>\n toTz(dateInUtc, getTimeZone(options)).format(\"z\");\n\nconst getFormat = <T extends DateTimeOptionsWithFormat>(\n options?: T,\n): string => {\n if (options?.defaultWithMS) {\n return options?.format ?? systemDateFormats.fullDateMS;\n }\n return options?.format ?? systemDateFormats.fullDate;\n};\n\nconst toTz = (dateInUtc: DateTimeInput, timeZone: TimeZone): Moment => {\n const date = dateInUtc;\n const zone = moment.tz.zone(timeZone);\n\n if (zone && zone.name) {\n return dateTimeAsMoment(toUtc(date)).tz(zone.name);\n }\n\n switch (timeZone) {\n case \"utc\":\n return dateTimeAsMoment(toUtc(date));\n default:\n return dateTimeAsMoment(toUtc(date)).local();\n }\n};\n","type FeatureToggleName = any;\n\n/**\n * Check a featureToggle\n * @param featureName featureToggle name\n * @param def default value if featureToggles aren't defined, false if not provided\n * @returns featureToggle value or def.\n */\nexport function getFeatureToggle(featureName: FeatureToggleName, def = false) {\n return (\n (window as any).grafanaBootData?.settings.featureToggles[featureName] ?? def\n );\n}\n","import { isEmpty } from \"lodash\";\n\nimport { TimeZone, DefaultTimeZone } from \"../types/time\";\n\n/**\n * Used for helper functions handling time zones.\n *\n * @public\n */\nexport interface TimeZoneOptions {\n /**\n * Specify this if you want to override the timeZone used when parsing or formatting\n * a date and time value. If no timeZone is set, the default timeZone for the current\n * user is used.\n */\n timeZone?: TimeZone;\n}\n\n/**\n * The type describing date and time options. Used for all the helper functions\n * available to parse or format date and time values.\n *\n * @public\n */\nexport interface DateTimeOptions extends TimeZoneOptions {\n /**\n * Specify a {@link https://momentjs.com/docs/#/displaying/format | momentjs} format to\n * use a custom formatting pattern or parsing pattern. If no format is set,\n * then system configured default format is used.\n */\n format?: string;\n}\n\n/**\n * The type to describe the time zone resolver function that will be used to access\n * the default time zone of a user.\n *\n * @public\n */\nexport type TimeZoneResolver = () => TimeZone | undefined;\n\nlet defaultTimeZoneResolver: TimeZoneResolver = () => DefaultTimeZone;\n\n/**\n * Used by Grafana internals to set the {@link TimeZoneResolver} to access the current\n * user timeZone.\n *\n * @internal\n */\nexport const setTimeZoneResolver = (resolver: TimeZoneResolver) => {\n defaultTimeZoneResolver = resolver ?? defaultTimeZoneResolver;\n};\n\n/**\n * Used to get the current selected time zone. If a valid time zone is passed in the\n * options it will be returned. If no valid time zone is passed either the time zone\n * configured for the user account will be returned or the default for Grafana.\n *\n * @public\n */\nexport const getTimeZone = <T extends TimeZoneOptions>(\n options?: T,\n): TimeZone => {\n if (options?.timeZone && !isEmpty(options.timeZone)) {\n return options.timeZone;\n }\n return defaultTimeZoneResolver() ?? DefaultTimeZone;\n};\n","import moment, {\n Moment,\n MomentInput,\n DurationInputArg1,\n DurationInputArg2,\n} from \"moment\";\nimport { tz } from \"moment-timezone\";\n\nimport { TimeZone } from \"../types/time\";\n/* eslint-disable id-blacklist, no-restricted-imports */\nexport interface DateTimeBuiltinFormat {\n __momentBuiltinFormatBrand: any;\n}\nexport const ISO_8601: DateTimeBuiltinFormat = moment.ISO_8601;\nexport type DateTimeInput =\n | Date\n | string\n | number\n | Array<string | number>\n | DateTime\n | null; // | undefined;\nexport type FormatInput = string | DateTimeBuiltinFormat | undefined;\nexport type DurationInput = string | number | DateTimeDuration;\nexport type DurationUnit =\n | \"year\"\n | \"years\"\n | \"y\"\n | \"month\"\n | \"months\"\n | \"M\"\n | \"week\"\n | \"weeks\"\n | \"isoWeek\"\n | \"w\"\n | \"day\"\n | \"days\"\n | \"d\"\n | \"hour\"\n | \"hours\"\n | \"h\"\n | \"minute\"\n | \"minutes\"\n | \"m\"\n | \"second\"\n | \"seconds\"\n | \"s\"\n | \"millisecond\"\n | \"milliseconds\"\n | \"ms\"\n | \"quarter\"\n | \"quarters\"\n | \"Q\";\n\nexport interface DateTimeLocale {\n firstDayOfWeek: () => number;\n}\n\nexport interface DateTimeDuration {\n asHours: () => number;\n hours: () => number;\n minutes: () => number;\n seconds: () => number;\n asSeconds: () => number;\n}\n\nexport interface DateTime extends Object {\n add: (amount?: DateTimeInput, unit?: DurationUnit) => DateTime;\n set: (unit: DurationUnit | \"date\", amount: DateTimeInput) => void;\n diff: (\n amount: DateTimeInput,\n unit?: DurationUnit,\n truncate?: boolean,\n ) => number;\n endOf: (unitOfTime: DurationUnit) => DateTime;\n format: (formatInput?: FormatInput) => string;\n fromNow: (withoutSuffix?: boolean) => string;\n from: (formaInput: DateTimeInput) => string;\n isSame: (input?: DateTimeInput, granularity?: DurationUnit) => boolean;\n isBefore: (input?: DateTimeInput) => boolean;\n isValid: () => boolean;\n local: () => DateTime;\n locale: (locale: string) => DateTime;\n startOf: (unitOfTime: DurationUnit) => DateTime;\n subtract: (amount?: DateTimeInput, unit?: DurationUnit) => DateTime;\n toDate: () => Date;\n toISOString: (keepOffset?: boolean) => string;\n isoWeekday: (day?: number | string) => number | string;\n valueOf: () => number;\n unix: () => number;\n utc: () => DateTime;\n utcOffset: () => number;\n hour?: () => number;\n minute?: () => number;\n}\n\nexport const setLocale = (language: string) => {\n moment.locale(language);\n};\n\nexport const getLocale = () => {\n return moment.locale();\n};\n\nexport const getLocaleData = (): DateTimeLocale => {\n return moment.localeData();\n};\n\nexport const isDateTimeInput = (value: unknown): value is DateTimeInput => {\n return (\n value === null ||\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n value instanceof Date ||\n (Array.isArray(value) &&\n value.every((v) => typeof v === \"string\" || typeof v === \"number\")) ||\n isDateTime(value)\n );\n};\n\nexport const isDateTime = (value: unknown): value is DateTime => {\n return moment.isMoment(value);\n};\n\nexport const toUtc = (\n input?: DateTimeInput,\n formatInput?: FormatInput,\n): DateTime => {\n return moment.utc(input as MomentInput, formatInput) as DateTime;\n};\n\nexport const toDuration = (\n input?: DurationInput,\n unit?: DurationUnit,\n): DateTimeDuration => {\n // moment built-in types are a bit flaky, for example `isoWeek` is not in the type definition but it's present in the js source.\n return moment.duration(\n input as DurationInputArg1,\n unit as DurationInputArg2,\n ) as DateTimeDuration;\n};\n\nexport const dateTime = (\n input?: DateTimeInput,\n formatInput?: FormatInput,\n): DateTime => {\n return moment(input as MomentInput, formatInput) as DateTime;\n};\n\nexport const dateTimeAsMoment = (input?: DateTimeInput) => {\n return dateTime(input) as Moment;\n};\n\nexport const dateTimeForTimeZone = (\n timezone?: TimeZone,\n input?: DateTimeInput,\n formatInput?: FormatInput,\n): DateTime => {\n if (timezone && timezone !== \"browser\") {\n let result: moment.Moment;\n\n if (typeof input === \"string\" && formatInput) {\n result = tz(input, formatInput, timezone);\n } else {\n result = tz(input as any, timezone);\n }\n\n if (isDateTime(result)) {\n return result;\n }\n }\n\n return dateTime(input, formatInput);\n};\n\nexport const getWeekdayIndex = (day: string) => {\n return moment\n .weekdays()\n .findIndex((wd) => wd.toLowerCase() === day.toLowerCase());\n};\n\nexport const getWeekdayIndexByEnglishName = (day: string) =>\n [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ].findIndex((wd) => wd.toLowerCase() === day.toLowerCase());\n\nexport const setWeekStart = (weekStart?: string) => {\n const suffix = \"-weekStart\";\n const language = getLocale().replace(suffix, \"\");\n const dow = weekStart ? getWeekdayIndexByEnglishName(weekStart) : -1;\n if (dow !== -1) {\n moment.updateLocale(language + suffix, {\n parentLocale: language,\n week: {\n dow,\n },\n });\n } else {\n setLocale(language);\n }\n};\n","import { dateTime, DateTime } from \"../datetime/moment_wrapper\";\n\n/**\n * Use UTC/GMT timezone\n */\nexport type TimeZoneUtc = \"utc\";\n\n/**\n * Use the timezone defined by end user web browser\n */\nexport type TimeZoneBrowser = \"browser\";\n\n/**\n * A specific timezone from https://en.wikipedia.org/wiki/Tz_database\n */\nexport type TimeZone = TimeZoneUtc | TimeZoneBrowser | string;\n\nexport const defaultTimeZone: TimeZone = \"browser\";\nexport const DefaultTimeZone = defaultTimeZone;\n\nexport interface RawTimeRange {\n from: DateTime | string;\n to: DateTime | string;\n}\n\nexport interface TimeRange {\n from: DateTime;\n to: DateTime;\n raw: RawTimeRange;\n}\n\n/**\n * Type to describe relative time to now in seconds.\n * @internal\n */\nexport interface RelativeTimeRange {\n from: number;\n to: number;\n}\n\nexport interface AbsoluteTimeRange {\n from: number;\n to: number;\n}\n\nexport interface IntervalValues {\n interval: string; // 10s,5m\n intervalMs: number;\n}\n\nexport interface TimeOption {\n from: string;\n to: string;\n display: string;\n invalid?: boolean;\n section?: number;\n}\n\nexport interface TimeOptions {\n [key: string]: TimeOption[];\n}\n\nexport type TimeFragment = string | DateTime;\n\nexport const TIME_FORMAT = \"YYYY-MM-DD HH:mm:ss\";\n\nexport function getDefaultTimeRange(): TimeRange {\n const now = dateTime();\n\n return {\n from: dateTime(now).subtract(6, \"hour\"),\n to: now,\n raw: { from: \"now-6h\", to: \"now\" },\n };\n}\n\n/**\n * Returns the default relative time range.\n *\n * @public\n */\nexport function getDefaultRelativeTimeRange(): RelativeTimeRange {\n return {\n from: 600,\n to: 0,\n };\n}\n\n/**\n * Simple helper to quickly create a TimeRange object either from string representations of a dateTime or directly\n * DateTime objects.\n */\nexport function makeTimeRange(\n from: DateTime | string,\n to: DateTime | string,\n): TimeRange {\n const fromDateTime = typeof from === \"string\" ? dateTime(from) : from;\n const toDateTime = typeof to === \"string\" ? dateTime(to) : to;\n return {\n from: fromDateTime,\n to: toDateTime,\n raw: {\n from: fromDateTime,\n to: toDateTime,\n },\n };\n}\n","import deepEqual from \"fast-deep-equal\";\nimport memoize, { AnyFn, Memoized } from \"micro-memoize\";\n\nconst deepMemoize: typeof memoize = (fn) => memoize(fn, { isEqual: deepEqual });\n\nfunction clearMemoizedCache(fn: Memoized<AnyFn>) {\n fn.cache.keys.length = 0;\n fn.cache.values.length = 0;\n}\n\nlet regionalFormat: string | undefined;\n\nconst createDateTimeFormatter = deepMemoize(\n (locale: string | undefined, options: Intl.DateTimeFormatOptions) => {\n try {\n return new Intl.DateTimeFormat(locale, options);\n } catch {\n return new Intl.DateTimeFormat(\"en-US\", options);\n }\n },\n);\n\nconst createDurationFormatter = deepMemoize(\n (locale: string | undefined, options: Intl.DurationFormatOptions) => {\n return new Intl.DurationFormat(locale, options);\n },\n);\n\nexport const formatDate = deepMemoize(\n (\n _value: number | Date | string,\n format: Intl.DateTimeFormatOptions = {},\n ): string => {\n const value = typeof _value === \"string\" ? new Date(_value) : _value;\n const dateFormatter = createDateTimeFormatter(regionalFormat, format);\n return dateFormatter.format(value);\n },\n);\n\nexport const formatDuration = deepMemoize(\n (\n duration: Intl.DurationInput,\n options: Intl.DurationFormatOptions = {},\n ): string => {\n const dateFormatter = createDurationFormatter(regionalFormat, options);\n return dateFormatter.format(duration);\n },\n);\n\nexport const formatDateRange = (\n _from: number | Date | string,\n _to: number | Date | string,\n format: Intl.DateTimeFormatOptions = {},\n): string => {\n const from = typeof _from === \"string\" ? new Date(_from) : _from;\n const to = typeof _to === \"string\" ? new Date(_to) : _to;\n\n const dateFormatter = createDateTimeFormatter(regionalFormat, format);\n return dateFormatter.formatRange(from, to);\n};\n\nexport const initRegionalFormat = (regionalFormatArg: string) => {\n // We don't expect this to be called with a different locale during the lifetime of the app,\n // so this is mostly here so we can change it during tests and clear out previously memoized values.\n clearMemoizedCache(formatDate);\n clearMemoizedCache(formatDuration);\n\n regionalFormat = regionalFormatArg;\n};\n","import { clamp } from \"lodash\";\n\nimport { DecimalCount } from \"../types/displayValue\";\nimport { TimeZone } from \"../types/time\";\n\nimport { getCategories } from \"./categories\";\nimport { toDateTimeValueFormatter } from \"./dateTimeFormatters\";\nimport {\n getOffsetFromSIPrefix,\n SIPrefix,\n currency,\n fullCurrency,\n} from \"./symbolFormatters\";\n\nexport interface FormattedValue {\n text: string;\n prefix?: string;\n suffix?: string;\n}\n\nexport function formattedValueToString(val: FormattedValue): string {\n return `${val.prefix ?? \"\"}${val.text}${val.suffix ?? \"\"}`;\n}\n\nexport type ValueFormatter = (\n value: number,\n decimals?: DecimalCount,\n scaledDecimals?: DecimalCount,\n timeZone?: TimeZone,\n showMs?: boolean,\n) => FormattedValue;\n\nexport interface ValueFormat {\n name: string;\n id: string;\n fn: ValueFormatter;\n}\n\nexport interface ValueFormatCategory {\n name: string;\n formats: ValueFormat[];\n}\n\nexport interface ValueFormatterIndex {\n [id: string]: ValueFormatter;\n}\n\n// Globals & formats cache\nlet categories: ValueFormatCategory[] = [];\nconst index: ValueFormatterIndex = {};\nlet hasBuiltIndex = false;\n\nexport function toFixed(value: number, decimals?: DecimalCount): string {\n if (value === null) {\n return \"\";\n }\n\n if (\n value === Number.NEGATIVE_INFINITY ||\n value === Number.POSITIVE_INFINITY\n ) {\n return value.toLocaleString();\n }\n\n if (decimals === null || decimals === undefined) {\n decimals = getDecimalsForValue(value);\n }\n\n if (value === 0) {\n return value.toFixed(decimals);\n }\n\n const factor = decimals ? Math.pow(10, Math.max(0, decimals)) : 1;\n const formatted = String(Math.round(value * factor) / factor);\n\n // if exponent return directly\n if (formatted.indexOf(\"e\") !== -1 || value === 0) {\n return formatted;\n }\n\n const decimalPos = formatted.indexOf(\".\");\n const precision = decimalPos === -1 ? 0 : formatted.length - decimalPos - 1;\n if (precision < decimals) {\n return (\n (precision ? formatted : formatted + \".\") +\n String(factor).slice(1, decimals - precision + 1)\n );\n }\n\n return formatted;\n}\n\nfunction getDecimalsForValue(value: number): number {\n const absValue = Math.abs(value);\n const log10 = Math.floor(Math.log(absValue) / Math.LN10);\n let dec = -log10 + 1;\n const magn = Math.pow(10, -dec);\n const norm = absValue / magn; // norm is between 1.0 and 10.0\n\n // special case for 2.5, requires an extra decimal\n if (norm > 2.25) {\n ++dec;\n }\n\n if (value % 1 === 0) {\n dec = 0;\n }\n\n const decimals = Math.max(0, dec);\n return decimals;\n}\n\nexport function toFixedScaled(\n value: number,\n decimals: DecimalCount,\n ext?: string,\n): FormattedValue {\n return {\n text: toFixed(value, decimals),\n suffix: appendPluralIf(ext, Math.abs(value) > 1),\n };\n}\n\nfunction appendPluralIf(\n ext: string | undefined,\n condition: boolean,\n): string | undefined {\n if (!condition) {\n return ext;\n }\n\n switch (ext) {\n case \" min\":\n case \" hour\":\n case \" day\":\n case \" week\":\n case \" year\":\n return `${ext}s`;\n default:\n return ext;\n }\n}\n\nexport function toFixedUnit(unit: string, asPrefix?: boolean): ValueFormatter {\n return (size: number, decimals?: DecimalCount) => {\n if (size === null) {\n return { text: \"\" };\n }\n const text = toFixed(size, decimals);\n if (unit) {\n if (asPrefix) {\n return { text, prefix: unit };\n }\n return { text, suffix: \" \" + unit };\n }\n return { text };\n };\n}\n\nexport function isBooleanUnit(unit?: string) {\n return unit && unit.startsWith(\"bool\");\n}\n\nexport function booleanValueFormatter(t: string, f: string): ValueFormatter {\n return (value) => {\n return { text: value ? t : f };\n };\n}\n\nconst logb = (b: number, x: number) => Math.log10(x) / Math.log10(b);\n\nexport function scaledUnits(\n factor: number,\n extArray: string[],\n offset = 0,\n): ValueFormatter {\n return (size: number, decimals?: DecimalCount) => {\n if (size === null || size === undefined) {\n return { text: \"\" };\n }\n\n if (\n size === Number.NEGATIVE_INFINITY ||\n size === Number.POSITIVE_INFINITY ||\n isNaN(size)\n ) {\n return { text: size.toLocaleString() };\n }\n\n const siIndex = size === 0 ? 0 : Math.floor(logb(factor, Math.abs(size)));\n const suffix = extArray[clamp(offset + siIndex, 0, extArray.length - 1)];\n\n return {\n text: toFixed(\n size / factor ** clamp(siIndex, -offset, extArray.length - offset - 1),\n decimals,\n ),\n suffix,\n };\n };\n}\n\nexport function locale(value: number, decimals: DecimalCount): FormattedValue {\n if (value == null) {\n return { text: \"\" };\n }\n return {\n text: value.toLocaleString(undefined, {\n maximumFractionDigits: decimals ?? undefined,\n }),\n };\n}\n\nexport function simpleCountUnit(symbol: string): ValueFormatter {\n const units = [\"\", \"K\", \"M\", \"B\", \"T\"];\n const scaler = scaledUnits(1000, units);\n return (\n size: number,\n decimals?: DecimalCount,\n scaledDecimals?: DecimalCount,\n ) => {\n if (size === null) {\n return { text: \"\" };\n }\n const v = scaler(size, decimals, scaledDecimals);\n v.suffix += \" \" + symbol;\n return v;\n };\n}\n\nexport function stringFormater(value: number): FormattedValue {\n return { text: `${value}` };\n}\n\nfunction buildFormats() {\n categories = getCategories();\n\n for (const cat of categories) {\n for (const format of cat.formats) {\n index[format.id] = format.fn;\n }\n }\n\n // Resolve units pointing to old IDs\n [{ from: \"farenheit\", to: \"fahrenheit\" }].forEach((alias) => {\n const f = index[alias.to];\n if (f) {\n index[alias.from] = f;\n }\n });\n\n hasBuiltIndex = true;\n}\n\nexport function getValueFormat(id?: string | null): ValueFormatter {\n if (!id) {\n return toFixedUnit(\"\");\n }\n\n if (!hasBuiltIndex) {\n buildFormats();\n }\n\n const fmt = index[id];\n\n if (!fmt && id) {\n let idx = id.indexOf(\":\");\n\n if (idx > 0) {\n const key = id.substring(0, idx);\n const sub = id.substring(idx + 1);\n\n if (key === \"prefix\") {\n return toFixedUnit(sub, true);\n }\n\n if (key === \"suffix\") {\n return toFixedUnit(sub, false);\n }\n\n if (key === \"time\") {\n return toDateTimeValueFormatter(sub);\n }\n\n if (key === \"si\") {\n const offset = getOffsetFromSIPrefix(sub.charAt(0));\n const unit = offset === 0 ? sub : sub.substring(1);\n return SIPrefix(unit, offset);\n }\n\n if (key === \"count\") {\n return simpleCountUnit(sub);\n }\n\n // Supported formats:\n // currency:$ -> scaled currency ($1.2K)\n // currency:financial:$ -> full currency ($1,234)\n // currency:financial:€:suffix -> full currency with suffix (1,234€)\n if (key === \"currency\") {\n const keySplit = sub.split(\":\");\n\n if (keySplit[0] === \"financial\" && keySplit.length >= 2) {\n const symbol = keySplit[1];\n if (!symbol) {\n return toFixedUnit(\"\"); // fallback for empty symbol\n }\n const asSuffix = keySplit[2] === \"suffix\";\n return fullCurrency(symbol, asSuffix);\n } else {\n return currency(sub);\n }\n }\n\n if (key === \"bool\") {\n idx = sub.indexOf(\"/\");\n if (idx >= 0) {\n const t = sub.substring(0, idx);\n const f = sub.substring(idx + 1);\n return booleanValueFormatter(t, f);\n }\n return booleanValueFormatter(sub, \"-\");\n }\n }\n\n return toFixedUnit(id);\n }\n\n return fmt as ValueFormatter;\n}\n\nexport function getValueFormatterIndex(): ValueFormatterIndex {\n if (!hasBuiltIndex) {\n buildFormats();\n }\n\n return index;\n}\n\nexport function getValueFormats() {\n if (!hasBuiltIndex) {\n buildFormats();\n }\n\n return categories.map((cat) => {\n return {\n text: cat.name,\n submenu: cat.formats.map((format) => {\n return {\n text: format.name,\n value: format.id,\n };\n }),\n };\n });\n}\n","import i18n from \"i18next\";\n\nlet initialized = false;\n\nfunction initI18nOnce() {\n if (initialized) return;\n\n i18n.init({\n lng: \"en\",\n fallbackLng: \"en\",\n\n // No translations at all\n resources: {},\n\n returnEmptyString: false,\n returnNull: false,\n\n interpolation: {\n escapeValue: false,\n },\n });\n\n initialized = true;\n}\n\nexport const t = (\n key: string,\n defaultMessage: string,\n values?: Record<string, unknown>,\n) => {\n initI18nOnce();\n return i18n.t(key, defaultMessage, values);\n};\n","import { DecimalCount } from \"../types/displayValue\";\n\nimport { toFixed, FormattedValue } from \"./valueFormats\";\n\nexport function toPercent(\n size: number | null,\n decimals: DecimalCount,\n): FormattedValue {\n if (size === null) {\n return { text: \"\" };\n }\n return { text: toFixed(size, decimals), suffix: \"%\" };\n}\n\nexport function toPercentUnit(\n size: number | null,\n decimals: DecimalCount,\n): FormattedValue {\n if (size === null) {\n return { text: \"\" };\n }\n return { text: toFixed(100 * size, decimals), suffix: \"%\" };\n}\n\nexport function toHex0x(\n value: number | null,\n decimals: DecimalCount,\n): FormattedValue {\n if (value == null) {\n return { text: \"\" };\n }\n const asHex = toHex(value, decimals);\n if (asHex.text.substring(0, 1) === \"-\") {\n asHex.text = \"-0x\" + asHex.text.substring(1);\n } else {\n asHex.text = \"0x\" + asHex.text;\n }\n return asHex;\n}\n\nexport function toHex(\n value: number | null,\n decimals: DecimalCount,\n): FormattedValue {\n if (value == null) {\n return { text: \"\" };\n }\n return {\n text: parseFloat(toFixed(value, decimals)).toString(16).toUpperCase(),\n };\n}\n\nexport function sci(\n value: number | null,\n decimals: DecimalCount,\n): FormattedValue {\n if (value == null) {\n return { text: \"\" };\n }\n return { text: value.toExponential(decimals ?? undefined) };\n}\n","import { localTimeFormat, systemDateFormats } from \"../datetime/formats\";\nimport { dateTimeFormat, dateTimeFormatTimeAgo } from \"../datetime/formatter\";\nimport {\n toDuration as duration,\n toUtc,\n dateTime,\n} from \"../datetime/moment_wrapper\";\nimport { DecimalCount } from \"../types/displayValue\";\nimport { TimeZone } from \"../types/time\";\n\nimport {\n toFixed,\n toFixedScaled,\n FormattedValue,\n ValueFormatter,\n} from \"./valueFormats\";\n\ninterface IntervalsInSeconds {\n [interval: string]: number;\n}\n\nexport enum Interval {\n Year = \"year\",\n Month = \"month\",\n Week = \"week\",\n Day = \"day\",\n Hour = \"hour\",\n Minute = \"minute\",\n Second = \"second\",\n Millisecond = \"millisecond\",\n}\n\nconst UNITS = [\n Interval.Year,\n Interval.Month,\n Interval.Week,\n Interval.Day,\n Interval.Hour,\n Interval.Minute,\n Interval.Second,\n Interval.Millisecond,\n];\n\nconst INTERVALS_IN_SECONDS: IntervalsInSeconds = {\n [Interval.Year]: 31536000,\n [Interval.Month]: 2592000,\n [Interval.Week]: 604800,\n [Interval.Day]: 86400,\n [Interval.Hour]: 3600,\n [Interval.Minute]: 60,\n [Interval.Second]: 1,\n [Interval.Millisecond]: 0.001,\n};\n\nexport function toNanoSeconds(\n size: number,\n decimals?: DecimalCount,\n): FormattedValue {\n if (size === null) {\n return { text: \"\" };\n }\n\n if (Math.abs(size) < 1000) {\n return { text: toFixed(size, decimals), suffix: \" ns\" };\n } else if (Math.abs(size) < 1000000) {\n return toFixedScaled(size / 1000, decimals, \" µs\");\n } else if (Math.abs(size) < 1000000000) {\n return toFixedScaled(size / 1000000, decimals, \" ms\");\n } else if (Math.abs(size) < 60000000000) {\n return toFixedScaled(size / 1000000000, decimals, \" s\");\n } else if (Math.abs(size) < 3600000000000) {\n return toFixedScaled(size / 60000000000, decimals, \" min\");\n } else if (Math.abs(size) < 86400000000000) {\n return toFixedScaled(size / 3600000000000, decimals, \" hour\");\n } else {\n return toFixedScaled(size / 86400000000000, decimals, \" day\");\n }\n}\n\nexport function toMicroSeconds(\n size: number,\n decimals?: DecimalCount,\n): FormattedValue {\n if (size === null) {\n return { text: \"\" };\n }\n\n if (Math.abs(size) < 1000) {\n return { text: toFixed(size, decimals), suffix: \" µs\" };\n } else if (Math.abs(size) < 1000000) {\n return toFixedScaled(size / 1000, decimals, \" ms\");\n } else {\n return toFixedScaled(size / 1000000, decimals, \" s\");\n }\n}\n\nexport function toMilliSeconds(\n size: number,\n decimals?: DecimalCount,\n scaledDecimals?: DecimalCount,\n): FormattedValue {\n if (size === null) {\n return { text: \"\" };\n }\n\n if (Math.abs(size) < 1000) {\n return { text: toFixed(size, decimals), suffix: \" ms\" };\n } else if (Math.abs(size) < 60000) {\n // Less than 1 min\n return toFixedScaled(size / 1000, decimals, \" s\");\n } else if (Math.abs(size) < 3600000) {\n // Less than 1 hour, divide in minutes\n return toFixedScaled(size / 60000, decimals, \" min\");\n } else if (Math.abs(size) < 86400000) {\n // Less than one day, divide in hours\n return toFixedScaled(size / 3600000, decimals, \" hour\");\n } else if (Math.abs(size) < 31536000000) {\n // Less than one year, divide in days\n return toFixedScaled(size / 86400000, decimals, \" day\");\n }\n\n return toFixedScaled(size / 31536000000, decimals, \" year\");\n}\n\nexport function toSeconds(\n size: number,\n decimals?: DecimalCount,\n): FormattedValue {\n if (size === null) {\n return { text: \"\" };\n }\n\n // If 0, use s unit instead of ns\n if (size === 0) {\n return { text: \"0\", suffix: \" s\" };\n }\n\n // Less than 1 µs, divide in ns\n if (Math.abs(size) < 0.000001) {\n return toFixedScaled(size * 1e9, decimals, \" ns\");\n }\n // Less than 1 ms, divide in µs\n if (Math.abs(size) < 0.001) {\n return toFixedScaled(size * 1e6, decimals, \" µs\");\n }\n // Less than 1 second, divide in ms\n if (Math.abs(size) < 1) {\n return toFixedScaled(size * 1e3, decimals, \" ms\");\n }\n\n if (Math.abs(size) < 60) {\n return { text: toFixed(size, decimals), suffix: \" s\" };\n } else if (Math.abs(size) < 3600) {\n // Less than 1 hour, divide in minutes\n return toFixedScaled(size / 60, decimals, \" min\");\n } else if (Math.abs(size) < 86400) {\n // Less than one day, divide in hours\n return toFixedScaled(size / 3600, decimals, \" hour\");\n } else if (Math.abs(size) < 604800) {\n // Less than one week, divide in days\n return toFixedScaled(size / 86400, decimals, \" day\");\n } else if (Math.abs(size) < 31536000) {\n // Less than one year, divide in week\n return toFixedScaled(size / 604800, decimals, \" week\");\n }\n\n return toFixedScaled(size / 3.15569e7, decimals, \" year\");\n}\n\nexport function toMinutes(\n size: number,\n decimals?: DecimalCount,\n): FormattedValue {\n if (size === null) {\n return { text: \"\" };\n }\n\n if (Math.abs(size) < 60) {\n return { text: toFixed(size, decimals), suffix: \" min\" };\n } else if (Math.abs(size) < 1440) {\n return toFixedScaled(size / 60, decimals, \" hour\");\n } else if (Math.abs(size) < 10080) {\n return toFixedScaled(size / 1440, decimals, \" day\");\n } else if (Math.abs(size) < 604800) {\n return toFixedScaled(size / 10080, decimals, \" week\");\n } else {\n return toFixedScaled(size / 5.25948e5, decimals, \" year\");\n }\n}\n\nexport function toHours(size: number, decimals?: DecimalCount): FormattedValue {\n if (size === null) {\n return { text: \"\" };\n }\n\n if (Math.abs(size) < 24) {\n return { text: toFixed(size, decimals), suffix: \" hour\" };\n } else if (Math.abs(size) < 168) {\n return toFixedScaled(size / 24, decimals, \" day\");\n } else if (Math.abs(size) < 8760) {\n return toFixedScaled(size / 168, decimals, \" week\");\n } else {\n return toFixedScaled(size / 8760, decimals, \" year\");\n }\n}\n\nexport function toDays(size: number, decimals?: DecimalCount): FormattedValue {\n if (size === null) {\n return { text: \"\" };\n }\n\n if (Math.abs(size) < 7) {\n return toFixedScaled(size, decimals, \" day\");\n } else if (Math.abs(size) < 365) {\n return toFixedScaled(size / 7, decimals, \" week\");\n } else {\n return toFixedScaled(size / 365, decimals, \" year\");\n }\n}\n\nexport function toDuration(\n size: number,\n decimals: DecimalCount,\n timeScale: Interval,\n): FormattedValue {\n if (size === null) {\n return { text: \"\" };\n }\n\n if (size === 0) {\n return { text: \"0\", suffix: \" \" + timeScale + \"s\" };\n }\n\n if (size < 0) {\n const v = toDuration(-size, decimals, timeScale);\n if (!v.suffix) {\n v.suffix = \"\";\n }\n v.suffix += \" ago\";\n return v;\n }\n\n // convert $size to milliseconds\n // intervals_in_seconds uses seconds (duh), convert them to milliseconds here to minimize floating point errors\n size *= (INTERVALS_IN_SECONDS[timeScale] as unknown as number) * 1000;\n\n const strings = [];\n\n // after first value >= 1 print only $decimals more\n let decrementDecimals = false;\n let decimalsCount = 0;\n\n if (decimals !== null && decimals !== undefined) {\n decimalsCount = decimals;\n }\n\n for (let i = 0; i < UNITS.length && decimalsCount >= 0; i++) {\n const interval =\n (INTERVALS_IN_SECONDS[UNITS[i] as unknown as string] as number) * 1000;\n const value = size / interval;\n if (value >= 1 || decrementDecimals) {\n decrementDecimals = true;\n const floor = Math.floor(value);\n const unit = UNITS[i] + (floor !== 1 ? \"s\" : \"\");\n strings.push(floor + \" \" + unit);\n size = size % interval;\n decimalsCount--;\n }\n }\n\n return { text: strings.join(\", \") };\n}\n\nexport function toClock(size: number, decimals?: DecimalCount): FormattedValue {\n if (size === null) {\n return { text: \"\" };\n }\n\n // < 1 second\n if (size < 1000) {\n return {\n text: toUtc(size).format(\"SSS\\\\m\\\\s\"),\n };\n }\n\n // < 1 minute\n if (size < 60000) {\n let format = \"ss\\\\s:SSS\\\\m\\\\s\";\n if (decimals === 0) {\n format = \"ss\\\\s\";\n }\n return { text: toUtc(size).format(format) };\n }\n\n // < 1 hour\n if (size < 3600000) {\n let format = \"mm\\\\m:ss\\\\s:SSS\\\\m\\\\s\";\n if (decimals === 0) {\n format = \"mm\\\\m\";\n } else if (decimals === 1) {\n format = \"mm\\\\m:ss\\\\s\";\n }\n return { text: toUtc(size).format(format) };\n }\n\n let format = \"mm\\\\m:ss\\\\s:SSS\\\\m\\\\s\";\n\n const hours = `${Math.floor(duration(size, \"milliseconds\").asHours())}h`;\n\n if (decimals === 0) {\n format = \"\";\n } else if (decimals === 1) {\n format = \"mm\\\\m\";\n } else if (decimals === 2) {\n format = \"mm\\\\m:ss\\\\s\";\n }\n\n const text = format ? `${hours}:${toUtc(size).format(format)}` : hours;\n return { text };\n}\n\nexport function toDurationInMilliseconds(\n size: number,\n decimals: DecimalCount,\n): FormattedValue {\n return toDuration(size, decimals, Interval.Millisecond);\n}\n\nexport function toDurationInSeconds(\n size: number,\n decimals: DecimalCount,\n): FormattedValue {\n return toDuration(size, decimals, Interval.Second);\n}\n\nexport function toDurationInHoursMinutesSeconds(size: number): FormattedValue {\n if (size < 0) {\n const v = toDurationInHoursMinutesSeconds(-size);\n if (!v.suffix) {\n v.suffix = \"\";\n }\n v.suffix += \" ago\";\n return v;\n }\n const strings = [];\n const numHours = Math.floor(size / 3600);\n const numMinutes = Math.floor((size % 3600) / 60);\n const numSeconds = Math.floor((size % 3600) % 60);\n numHours > 9 ? strings.push(\"\" + numHours) : strings.push(\"0\" + numHours);\n numMinutes > 9\n ? strings.push(\"\" + numMinutes)\n : strings.push(\"0\" + numMinutes);\n numSeconds > 9\n ? strings.push(\"\" + numSeconds)\n : strings.push(\"0\" + numSeconds);\n return { text: strings.join(\":\") };\n}\n\nexport function toDurationInDaysHoursMinutesSeconds(\n size: number,\n): FormattedValue {\n if (size < 0) {\n const v = toDurationInDaysHoursMinutesSeconds(-size);\n if (!v.suffix) {\n v.suffix = \"\";\n }\n v.suffix += \" ago\";\n return v;\n }\n let dayString = \"\";\n const numDays = Math.floor(size / (24 * 3600));\n if (numDays > 0) {\n dayString = numDays + \" d \";\n }\n const hmsString = toDurationInHoursMinutesSeconds(size - numDays * 24 * 3600);\n return { text: dayString + hmsString.text };\n}\n\nexport function toTimeTicks(\n size: number,\n decimals: DecimalCount,\n): FormattedValue {\n return toSeconds(size / 100, decimals);\n}\n\nexport function toClockMilliseconds(\n size: number,\n decimals: DecimalCount,\n): FormattedValue {\n return toClock(size, decimals);\n}\n\nexport function toClockSeconds(\n size: number,\n decimals: DecimalCount,\n): FormattedValue {\n return toClock(size * 1000, decimals);\n}\n\nexport function toDateTimeValueFormatter(\n pattern: string,\n todayPattern?: string,\n): ValueFormatter {\n return (\n value: number,\n decimals: DecimalCount,\n scaledDecimals: DecimalCount,\n timeZone?: TimeZone,\n ): FormattedValue => {\n if (todayPattern) {\n if (dateTime().isSame(value, \"day\")) {\n return {\n text: dateTimeFormat(value, { format: todayPattern, timeZone }),\n };\n }\n }\n return { text: dateTimeFormat(value, { format: pattern, timeZone }) };\n };\n}\n\nexport const dateTimeAsIso = toDateTimeValueFormatter(\"YYYY-MM-DD HH:mm:ss\");\nexport const dateTimeAsIsoNoDateIfToday = toDateTimeValueFormatter(\n \"YYYY-MM-DD HH:mm:ss\",\n \"HH:mm:ss\",\n);\nexport const dateTimeAsUS = toDateTimeValueFormatter(\"MM/DD/YYYY h:mm:ss a\");\nexport const dateTimeAsUSNoDateIfToday = toDateTimeValueFormatter(\n \"MM/DD/YYYY h:mm:ss a\",\n \"h:mm:ss a\",\n);\n\nexport function getDateTimeAsLocalFormat() {\n return toDateTimeValueFormatter(\n localTimeFormat({\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n }),\n );\n}\n\nexport function getDateTimeAsLocalFormatNoDateIfToday() {\n return toDateTimeValueFormatter(\n localTimeFormat({\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n }),\n localTimeFormat({\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n }),\n );\n}\n\nexport function dateTimeSystemFormatter(\n value: number,\n decimals: DecimalCount,\n scaledDecimals: DecimalCount,\n timeZone?: TimeZone,\n showMs?: boolean,\n): FormattedValue {\n return {\n text: dateTimeFormat(value, {\n format: showMs\n ? systemDateFormats.fullDateMS\n : systemDateFormats.fullDate,\n timeZone,\n }),\n };\n}\n\nexport function dateTimeFromNow(\n value: number,\n decimals: DecimalCount,\n scaledDecimals: DecimalCount,\n timeZone?: TimeZone,\n): FormattedValue {\n return { text: dateTimeFormatTimeAgo(value, { timeZone }) };\n}\n","import { DecimalCount } from \"../types/displayValue\";\n\nimport { scaledUnits, ValueFormatter } from \"./valueFormats\";\n\nexport function currency(symbol: string, asSuffix?: boolean): ValueFormatter {\n const units = [\"\", \"K\", \"M\", \"B\", \"T\"];\n const scaler = scaledUnits(1000, units);\n return (\n value: number,\n decimals?: DecimalCount,\n scaledDecimals?: DecimalCount,\n ) => {\n if (value == null) {\n return { text: \"\" };\n }\n const isNegative = value < 0;\n if (isNegative) {\n value = Math.abs(value);\n }\n const scaled = scaler(value, decimals, scaledDecimals);\n if (asSuffix) {\n scaled.suffix =\n scaled.suffix !== undefined ? `${scaled.suffix}${symbol}` : undefined;\n } else {\n scaled.prefix = symbol;\n }\n if (isNegative) {\n scaled.prefix = `-${scaled.prefix?.length ? scaled.prefix : \"\"}`;\n }\n return scaled;\n };\n}\n\n/**\n * Formats currency values without scaling abbreviations(K: Thousands, M: Millions, B: Billions), displaying full numeric values.\n * Uses cached Intl.NumberFormat objects for performance.\n *\n * @param symbol - Currency symbol (e.g., '$', '€', '£')\n * @param asSuffix - If true, places symbol after number\n *\n * @example\n * fullCurrency('$')(1234.56, 2) // { prefix: '$', text: '1,234.56' } - forces 2 decimals\n * fullCurrency('€', true)(42.5) // { suffix: '€', text: '42.5' }\n */\nexport function fullCurrency(\n symbol: string,\n asSuffix?: boolean,\n): ValueFormatter {\n const locale = Intl.NumberFormat().resolvedOptions().locale;\n const defaultFormatter = new Intl.NumberFormat(locale, {\n minimumFractionDigits: 0,\n maximumFractionDigits: 1,\n });\n const formattersCache = new Map<number, Intl.NumberFormat>();\n\n return (value: number | null, decimals?: DecimalCount) => {\n if (value === null) {\n return { text: \"\" };\n }\n\n const numericValue: number = value;\n\n let text: string;\n if (decimals !== undefined && decimals !== null) {\n let formatter = formattersCache.get(decimals);\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, {\n minimumFractionDigits: decimals,\n maximumFractionDigits: decimals,\n });\n formattersCache.set(decimals, formatter);\n }\n text = formatter.format(numericValue);\n } else {\n text = defaultFormatter.format(numericValue);\n }\n\n return {\n prefix: asSuffix ? \"\" : symbol,\n suffix: asSuffix ? symbol : \"\",\n text,\n };\n };\n}\n\nconst SI_PREFIXES = [\n \"f\",\n \"p\",\n \"n\",\n \"µ\",\n \"m\",\n \"\",\n \"k\",\n \"M\",\n \"G\",\n \"T\",\n \"P\",\n \"E\",\n \"Z\",\n \"Y\",\n];\nconst SI_BASE_INDEX = SI_PREFIXES.indexOf(\"\");\n\nexport function getOffsetFromSIPrefix(c: string): number {\n const charIndex = SI_PREFIXES.findIndex(\n (prefix) => prefix.normalize(\"NFKD\") === c.normalize(\"NFKD\"),\n );\n return charIndex < 0 ? 0 : charIndex - SI_BASE_INDEX;\n}\n\nconst BIN_PREFIXES = [\"\", \"Ki\", \"Mi\", \"Gi\", \"Ti\", \"Pi\", \"Ei\", \"Zi\", \"Yi\"];\n\nexport function binaryPrefix(unit: string, offset = 0): ValueFormatter {\n const units = BIN_PREFIXES.map((p) => \" \" + p + unit);\n return scaledUnits(1024, units, offset);\n}\n\nexport function SIPrefix(unit: string, offset = 0): ValueFormatter {\n const units = SI_PREFIXES.map((p) => \" \" + p + unit);\n return scaledUnits(1000, units, SI_BASE_INDEX + offset);\n}\n","import { t } from \"../i18n\";\nimport {\n toHex,\n sci,\n toHex0x,\n toPercent,\n toPercentUnit,\n} from \"./arithmeticFormatters\";\nimport {\n dateTimeAsIso,\n dateTimeAsIsoNoDateIfToday,\n dateTimeAsUS,\n dateTimeAsUSNoDateIfToday,\n getDateTimeAsLocalFormat,\n getDateTimeAsLocalFormatNoDateIfToday,\n dateTimeFromNow,\n toClockMilliseconds,\n toClockSeconds,\n toDays,\n toDurationInDaysHoursMinutesSeconds,\n toDurationInHoursMinutesSeconds,\n toDurationInMilliseconds,\n toDurationInSeconds,\n toHours,\n toMicroSeconds,\n toMilliSeconds,\n toMinutes,\n toNanoSeconds,\n toSeconds,\n toTimeTicks,\n dateTimeSystemFormatter,\n} from \"./dateTimeFormatters\";\nimport { binaryPrefix, currency, SIPrefix } from \"./symbolFormatters\";\nimport {\n locale,\n scaledUnits,\n simpleCountUnit,\n toFixedUnit,\n ValueFormatCategory,\n stringFormater,\n booleanValueFormatter,\n} from \"./valueFormats\";\n\nexport const getCategories = (): ValueFormatCategory[] => [\n {\n name: t(\"grafana-data.valueFormats.categories.misc.name\", \"Misc\"),\n formats: [\n {\n name: t(\n \"grafana-data.valueFormats.categories.misc.formats.name-number\",\n \"Number\",\n ),\n id: \"none\",\n fn: toFixedUnit(\"\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.misc.formats.name-string\",\n \"String\",\n ),\n id: \"string\",\n fn: stringFormater,\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.misc.formats.name-short\",\n \"short\",\n ),\n id: \"short\",\n fn: scaledUnits(1000, [\n \"\",\n \" K\",\n \" Mil\",\n \" Bil\",\n \" Tri\",\n \" Quadr\",\n \" Quint\",\n \" Sext\",\n \" Sept\",\n ]),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.misc.formats.name-si-short\",\n \"SI short\",\n ),\n id: \"sishort\",\n fn: SIPrefix(\"\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.misc.formats.name-percent-100\",\n \"Percent (0-100)\",\n ),\n id: \"percent\",\n fn: toPercent,\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.misc.formats.name-percent-1\",\n \"Percent (0.0-1.0)\",\n ),\n id: \"percentunit\",\n fn: toPercentUnit,\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.misc.formats.name-humidity\",\n \"Humidity (%H)\",\n ),\n id: \"humidity\",\n fn: toFixedUnit(\"%H\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.misc.formats.name-decibel\",\n \"Decibel\",\n ),\n id: \"dB\",\n fn: toFixedUnit(\"dB\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.misc.formats.name-candala\",\n \"Candela (cd)\",\n ),\n id: \"candela\",\n fn: SIPrefix(\"cd\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.misc.formats.name-hexadecimal-0x\",\n \"Hexadecimal (0x)\",\n ),\n id: \"hex0x\",\n fn: toHex0x,\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.misc.formats.name-hexadecimal\",\n \"Hexadecimal\",\n ),\n id: \"hex\",\n fn: toHex,\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.misc.formats.name-scientific\",\n \"Scientific notation\",\n ),\n id: \"sci\",\n fn: sci,\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.misc.formats.name-locale\",\n \"Locale format\",\n ),\n id: \"locale\",\n fn: locale,\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.misc.formats.name-pixels\",\n \"Pixels\",\n ),\n id: \"pixel\",\n fn: toFixedUnit(\"px\"),\n },\n ],\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.acceleration.name\",\n \"Acceleration\",\n ),\n formats: [\n {\n name: t(\n \"grafana-data.valueFormats.categories.acceleration.formats.name-meters-sec\",\n \"Meters/sec²\",\n ),\n id: \"accMS2\",\n fn: toFixedUnit(\"m/sec²\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.acceleration.formats.name-feet-sec\",\n \"Feet/sec²\",\n ),\n id: \"accFS2\",\n fn: toFixedUnit(\"f/sec²\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.acceleration.formats.name-g-unit\",\n \"G unit\",\n ),\n id: \"accG\",\n fn: toFixedUnit(\"g\"),\n },\n ],\n },\n {\n name: t(\"grafana-data.valueFormats.categories.angle.name\", \"Angle\"),\n formats: [\n {\n name: t(\n \"grafana-data.valueFormats.categories.angle.formats.name-degrees\",\n \"Degrees (°)\",\n ),\n id: \"degree\",\n fn: toFixedUnit(\"°\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.angle.formats.name-radians\",\n \"Radians\",\n ),\n id: \"radian\",\n fn: toFixedUnit(\"rad\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.angle.formats.name-gradian\",\n \"Gradian\",\n ),\n id: \"grad\",\n fn: toFixedUnit(\"grad\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.angle.formats.name-arc-minutes\",\n \"Arc Minutes\",\n ),\n id: \"arcmin\",\n fn: toFixedUnit(\"arcmin\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.angle.formats.name-arc-seconds\",\n \"Arc Seconds\",\n ),\n id: \"arcsec\",\n fn: toFixedUnit(\"arcsec\"),\n },\n ],\n },\n {\n name: t(\"grafana-data.valueFormats.categories.area.name\", \"Area\"),\n formats: [\n {\n name: t(\n \"grafana-data.valueFormats.categories.area.formats.name-square-meters\",\n \"Square Meters (m²)\",\n ),\n id: \"areaM2\",\n fn: toFixedUnit(\"m²\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.area.formats.name-square-feet\",\n \"Square Feet (ft²)\",\n ),\n id: \"areaF2\",\n fn: toFixedUnit(\"ft²\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.area.formats.name-square-miles\",\n \"Square Miles (mi²)\",\n ),\n id: \"areaMI2\",\n fn: toFixedUnit(\"mi²\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.area.formats.name-acres\",\n \"Acres (ac)\",\n ),\n id: \"acres\",\n fn: toFixedUnit(\"ac\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.area.formats.name-hectares\",\n \"Hectares (ha)\",\n ),\n id: \"hectares\",\n fn: toFixedUnit(\"ha\"),\n },\n ],\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.computation.name\",\n \"Computation\",\n ),\n formats: [\n {\n name: t(\n \"grafana-data.valueFormats.categories.computation.formats.name-flops\",\n \"FLOP/s\",\n ),\n id: \"flops\",\n fn: SIPrefix(\"FLOPS\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.computation.formats.name-mflops\",\n \"MFLOP/s\",\n ),\n id: \"mflops\",\n fn: SIPrefix(\"FLOPS\", 2),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.computation.formats.name-gflops\",\n \"GFLOP/s\",\n ),\n id: \"gflops\",\n fn: SIPrefix(\"FLOPS\", 3),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.computation.formats.name-tflops\",\n \"TFLOP/s\",\n ),\n id: \"tflops\",\n fn: SIPrefix(\"FLOPS\", 4),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.computation.formats.name-pflops\",\n \"PFLOP/s\",\n ),\n id: \"pflops\",\n fn: SIPrefix(\"FLOPS\", 5),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.computation.formats.name-eflops\",\n \"EFLOP/s\",\n ),\n id: \"eflops\",\n fn: SIPrefix(\"FLOPS\", 6),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.computation.formats.name-zflops\",\n \"ZFLOP/s\",\n ),\n id: \"zflops\",\n fn: SIPrefix(\"FLOPS\", 7),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.computation.formats.name-yflops\",\n \"YFLOP/s\",\n ),\n id: \"yflops\",\n fn: SIPrefix(\"FLOPS\", 8),\n },\n ],\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.concentration.name\",\n \"Concentration\",\n ),\n formats: [\n {\n name: t(\n \"grafana-data.valueFormats.categories.concentration.formats.name-ppm\",\n \"parts-per-million (ppm)\",\n ),\n id: \"ppm\",\n fn: toFixedUnit(\"ppm\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.concentration.formats.name-ppb\",\n \"parts-per-billion (ppb)\",\n ),\n id: \"conppb\",\n fn: toFixedUnit(\"ppb\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.concentration.formats.name-ng-m3\",\n \"nanogram per cubic meter (ng/m³)\",\n ),\n id: \"conngm3\",\n fn: toFixedUnit(\"ng/m³\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.concentration.formats.name-ng-nm3\",\n \"nanogram per normal cubic meter (ng/Nm³)\",\n ),\n id: \"conngNm3\",\n fn: toFixedUnit(\"ng/Nm³\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.concentration.formats.name-ug-m3\",\n \"microgram per cubic meter (μg/m³)\",\n ),\n id: \"conμgm3\",\n fn: toFixedUnit(\"μg/m³\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.concentration.formats.name-ug-nm3\",\n \"microgram per normal cubic meter (μg/Nm³)\",\n ),\n id: \"conμgNm3\",\n fn: toFixedUnit(\"μg/Nm³\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.concentration.formats.name-mg-m3\",\n \"milligram per cubic meter (mg/m³)\",\n ),\n id: \"conmgm3\",\n fn: toFixedUnit(\"mg/m³\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.concentration.formats.name-mg-nm3\",\n \"milligram per normal cubic meter (mg/Nm³)\",\n ),\n id: \"conmgNm3\",\n fn: toFixedUnit(\"mg/Nm³\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.concentration.formats.name-g-m3\",\n \"gram per cubic meter (g/m³)\",\n ),\n id: \"congm3\",\n fn: toFixedUnit(\"g/m³\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.concentration.formats.name-g-nm3\",\n \"gram per normal cubic meter (g/Nm³)\",\n ),\n id: \"congNm3\",\n fn: toFixedUnit(\"g/Nm³\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.concentration.formats.name-mg-dl\",\n \"milligrams per decilitre (mg/dL)\",\n ),\n id: \"conmgdL\",\n fn: toFixedUnit(\"mg/dL\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.concentration.formats.name-mmol-l\",\n \"millimoles per litre (mmol/L)\",\n ),\n id: \"conmmolL\",\n fn: toFixedUnit(\"mmol/L\"),\n },\n ],\n },\n {\n name: t(\"grafana-data.valueFormats.categories.currency.name\", \"Currency\"),\n formats: [\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-usd\",\n \"Dollars ($)\",\n ),\n id: \"currencyUSD\",\n fn: currency(\"$\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-gbp\",\n \"Pounds (£)\",\n ),\n id: \"currencyGBP\",\n fn: currency(\"£\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-eur\",\n \"Euro (€)\",\n ),\n id: \"currencyEUR\",\n fn: currency(\"€\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-jpy\",\n \"Yen (¥)\",\n ),\n id: \"currencyJPY\",\n fn: currency(\"¥\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-rub\",\n \"Rubles (₽)\",\n ),\n id: \"currencyRUB\",\n fn: currency(\"₽\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-uah\",\n \"Hryvnias (₴)\",\n ),\n id: \"currencyUAH\",\n fn: currency(\"₴\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-brl\",\n \"Real (R$)\",\n ),\n id: \"currencyBRL\",\n fn: currency(\"R$\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-dkk\",\n \"Danish Krone (kr)\",\n ),\n id: \"currencyDKK\",\n fn: currency(\"kr\", true),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-isk\",\n \"Icelandic Króna (kr)\",\n ),\n id: \"currencyISK\",\n fn: currency(\"kr\", true),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-nok\",\n \"Norwegian Krone (kr)\",\n ),\n id: \"currencyNOK\",\n fn: currency(\"kr\", true),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-sek\",\n \"Swedish Krona (kr)\",\n ),\n id: \"currencySEK\",\n fn: currency(\"kr\", true),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-czk\",\n \"Czech koruna (czk)\",\n ),\n id: \"currencyCZK\",\n fn: currency(\"czk\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-chf\",\n \"Swiss franc (CHF)\",\n ),\n id: \"currencyCHF\",\n fn: currency(\"CHF\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-pln\",\n \"Polish Złoty (PLN)\",\n ),\n id: \"currencyPLN\",\n fn: currency(\"PLN\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-btc\",\n \"Bitcoin (฿)\",\n ),\n id: \"currencyBTC\",\n fn: currency(\"฿\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-mbtc\",\n \"Milli Bitcoin (฿)\",\n ),\n id: \"currencymBTC\",\n fn: currency(\"mBTC\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-ubtc\",\n \"Micro Bitcoin (฿)\",\n ),\n id: \"currencyμBTC\",\n fn: currency(\"μBTC\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-zar\",\n \"South African Rand (R)\",\n ),\n id: \"currencyZAR\",\n fn: currency(\"R\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-inr\",\n \"Indian Rupee (₹)\",\n ),\n id: \"currencyINR\",\n fn: currency(\"₹\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-krw\",\n \"South Korean Won (₩)\",\n ),\n id: \"currencyKRW\",\n fn: currency(\"₩\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-idr\",\n \"Indonesian Rupiah (Rp)\",\n ),\n id: \"currencyIDR\",\n fn: currency(\"Rp\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-php\",\n \"Philippine Peso (PHP)\",\n ),\n id: \"currencyPHP\",\n fn: currency(\"PHP\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-vnd\",\n \"Vietnamese Dong (VND)\",\n ),\n id: \"currencyVND\",\n fn: currency(\"đ\", true),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-try\",\n \"Turkish Lira (₺)\",\n ),\n id: \"currencyTRY\",\n fn: currency(\"₺\", true),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-myr\",\n \"Malaysian Ringgit (RM)\",\n ),\n id: \"currencyMYR\",\n fn: currency(\"RM\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-xpf\",\n \"CFP franc (XPF)\",\n ),\n id: \"currencyXPF\",\n fn: currency(\"XPF\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-bgn\",\n \"Bulgarian Lev (BGN)\",\n ),\n id: \"currencyBGN\",\n fn: currency(\"BGN\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-pyg\",\n \"Guaraní (₲)\",\n ),\n id: \"currencyPYG\",\n fn: currency(\"₲\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-uyu\",\n \"Uruguay Peso (UYU)\",\n ),\n id: \"currencyUYU\",\n fn: currency(\"UYU\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.currency.formats.name-ils\",\n \"Israeli New Shekels (₪)\",\n ),\n id: \"currencyILS\",\n fn: currency(\"₪\"),\n },\n ],\n },\n {\n name: t(\"grafana-data.valueFormats.categories.data.name\", \"Data\"),\n formats: [\n {\n name: t(\n \"grafana-data.valueFormats.categories.data.formats.name-bytes-iec\",\n \"bytes(IEC)\",\n ),\n id: \"bytes\",\n fn: binaryPrefix(\"B\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data.formats.name-bytes-si\",\n \"bytes(SI)\",\n ),\n id: \"decbytes\",\n fn: SIPrefix(\"B\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data.formats.name-bits-iec\",\n \"bits(IEC)\",\n ),\n id: \"bits\",\n fn: binaryPrefix(\"b\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data.formats.name-bits-si\",\n \"bits(SI)\",\n ),\n id: \"decbits\",\n fn: SIPrefix(\"b\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data.formats.name-kibibytes\",\n \"kibibytes\",\n ),\n id: \"kbytes\",\n fn: binaryPrefix(\"B\", 1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data.formats.name-kilobytes\",\n \"kilobytes\",\n ),\n id: \"deckbytes\",\n fn: SIPrefix(\"B\", 1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data.formats.name-mebibytes\",\n \"mebibytes\",\n ),\n id: \"mbytes\",\n fn: binaryPrefix(\"B\", 2),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data.formats.name-megabytes\",\n \"megabytes\",\n ),\n id: \"decmbytes\",\n fn: SIPrefix(\"B\", 2),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data.formats.name-gibibytes\",\n \"gibibytes\",\n ),\n id: \"gbytes\",\n fn: binaryPrefix(\"B\", 3),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data.formats.name-gigabytes\",\n \"gigabytes\",\n ),\n id: \"decgbytes\",\n fn: SIPrefix(\"B\", 3),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data.formats.name-tebibytes\",\n \"tebibytes\",\n ),\n id: \"tbytes\",\n fn: binaryPrefix(\"B\", 4),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data.formats.name-terabytes\",\n \"terabytes\",\n ),\n id: \"dectbytes\",\n fn: SIPrefix(\"B\", 4),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data.formats.name-pebibytes\",\n \"pebibytes\",\n ),\n id: \"pbytes\",\n fn: binaryPrefix(\"B\", 5),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data.formats.name-petabytes\",\n \"petabytes\",\n ),\n id: \"decpbytes\",\n fn: SIPrefix(\"B\", 5),\n },\n ],\n },\n {\n name: t(\"grafana-data.valueFormats.categories.data-rate.name\", \"Data rate\"),\n formats: [\n {\n name: t(\n \"grafana-data.valueFormats.categories.data-rate.formats.name-packets-sec\",\n \"packets/sec\",\n ),\n id: \"pps\",\n fn: SIPrefix(\"p/s\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data-rate.formats.name-bytes-sec-iec\",\n \"bytes/sec(IEC)\",\n ),\n id: \"binBps\",\n fn: binaryPrefix(\"B/s\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data-rate.formats.name-bytes-sec-si\",\n \"bytes/sec(SI)\",\n ),\n id: \"Bps\",\n fn: SIPrefix(\"B/s\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data-rate.formats.name-bits-sec-iec\",\n \"bits/sec(IEC)\",\n ),\n id: \"binbps\",\n fn: binaryPrefix(\"b/s\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data-rate.formats.name-bits-sec-si\",\n \"bits/sec(SI)\",\n ),\n id: \"bps\",\n fn: SIPrefix(\"b/s\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data-rate.formats.name-kibibytes-sec\",\n \"kibibytes/sec\",\n ),\n id: \"KiBs\",\n fn: binaryPrefix(\"B/s\", 1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data-rate.formats.name-kibibits-sec\",\n \"kibibits/sec\",\n ),\n id: \"Kibits\",\n fn: binaryPrefix(\"b/s\", 1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data-rate.formats.name-kilobytes-sec\",\n \"kilobytes/sec\",\n ),\n id: \"KBs\",\n fn: SIPrefix(\"B/s\", 1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data-rate.formats.name-kilobits-sec\",\n \"kilobits/sec\",\n ),\n id: \"Kbits\",\n fn: SIPrefix(\"b/s\", 1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data-rate.formats.name-mebibytes-sec\",\n \"mebibytes/sec\",\n ),\n id: \"MiBs\",\n fn: binaryPrefix(\"B/s\", 2),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data-rate.formats.name-mebibits-sec\",\n \"mebibits/sec\",\n ),\n id: \"Mibits\",\n fn: binaryPrefix(\"b/s\", 2),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data-rate.formats.name-megabytes-sec\",\n \"megabytes/sec\",\n ),\n id: \"MBs\",\n fn: SIPrefix(\"B/s\", 2),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data-rate.formats.name-megabits-sec\",\n \"megabits/sec\",\n ),\n id: \"Mbits\",\n fn: SIPrefix(\"b/s\", 2),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data-rate.formats.name-gibibytes-sec\",\n \"gibibytes/sec\",\n ),\n id: \"GiBs\",\n fn: binaryPrefix(\"B/s\", 3),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data-rate.formats.name-gibibits-sec\",\n \"gibibits/sec\",\n ),\n id: \"Gibits\",\n fn: binaryPrefix(\"b/s\", 3),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data-rate.formats.name-gigabytes-sec\",\n \"gigabytes/sec\",\n ),\n id: \"GBs\",\n fn: SIPrefix(\"B/s\", 3),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data-rate.formats.name-gigabits-sec\",\n \"gigabits/sec\",\n ),\n id: \"Gbits\",\n fn: SIPrefix(\"b/s\", 3),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data-rate.formats.name-tebibytes-sec\",\n \"tebibytes/sec\",\n ),\n id: \"TiBs\",\n fn: binaryPrefix(\"B/s\", 4),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data-rate.formats.name-tebibits-sec\",\n \"tebibits/sec\",\n ),\n id: \"Tibits\",\n fn: binaryPrefix(\"b/s\", 4),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data-rate.formats.name-terabytes-sec\",\n \"terabytes/sec\",\n ),\n id: \"TBs\",\n fn: SIPrefix(\"B/s\", 4),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data-rate.formats.name-terabits-sec\",\n \"terabits/sec\",\n ),\n id: \"Tbits\",\n fn: SIPrefix(\"b/s\", 4),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data-rate.formats.name-pebibytes-sec\",\n \"pebibytes/sec\",\n ),\n id: \"PiBs\",\n fn: binaryPrefix(\"B/s\", 5),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data-rate.formats.name-pebibits-sec\",\n \"pebibits/sec\",\n ),\n id: \"Pibits\",\n fn: binaryPrefix(\"b/s\", 5),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data-rate.formats.name-petabytes-sec\",\n \"petabytes/sec\",\n ),\n id: \"PBs\",\n fn: SIPrefix(\"B/s\", 5),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.data-rate.formats.name-petabits-sec\",\n \"petabits/sec\",\n ),\n id: \"Pbits\",\n fn: SIPrefix(\"b/s\", 5),\n },\n ],\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.date-time.name\",\n \"Date & time\",\n ),\n formats: [\n {\n name: t(\n \"grafana-data.valueFormats.categories.date-time.formats.name-datetime-iso\",\n \"Datetime ISO\",\n ),\n id: \"dateTimeAsIso\",\n fn: dateTimeAsIso,\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.date-time.formats.name-datetime-iso-no-date\",\n \"Datetime ISO (No date if today)\",\n ),\n id: \"dateTimeAsIsoNoDateIfToday\",\n fn: dateTimeAsIsoNoDateIfToday,\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.date-time.formats.name-datetime-us\",\n \"Datetime US\",\n ),\n id: \"dateTimeAsUS\",\n fn: dateTimeAsUS,\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.date-time.formats.name-datetime-us-no-date\",\n \"Datetime US (No date if today)\",\n ),\n id: \"dateTimeAsUSNoDateIfToday\",\n fn: dateTimeAsUSNoDateIfToday,\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.date-time.formats.name-datetime-local\",\n \"Datetime local\",\n ),\n id: \"dateTimeAsLocal\",\n fn: getDateTimeAsLocalFormat(),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.date-time.formats.name-datetime-local-no-date\",\n \"Datetime local (No date if today)\",\n ),\n id: \"dateTimeAsLocalNoDateIfToday\",\n fn: getDateTimeAsLocalFormatNoDateIfToday(),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.date-time.formats.name-datetime-default\",\n \"Datetime default\",\n ),\n id: \"dateTimeAsSystem\",\n fn: dateTimeSystemFormatter,\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.date-time.formats.name-from-now\",\n \"From Now\",\n ),\n id: \"dateTimeFromNow\",\n fn: dateTimeFromNow,\n },\n ],\n },\n {\n name: t(\"grafana-data.valueFormats.categories.energy.name\", \"Energy\"),\n formats: [\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-watt\",\n \"Watt (W)\",\n ),\n id: \"watt\",\n fn: SIPrefix(\"W\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-kilowatt\",\n \"Kilowatt (kW)\",\n ),\n id: \"kwatt\",\n fn: SIPrefix(\"W\", 1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-megawatt\",\n \"Megawatt (MW)\",\n ),\n id: \"megwatt\",\n fn: SIPrefix(\"W\", 2),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-gigawatt\",\n \"Gigawatt (GW)\",\n ),\n id: \"gwatt\",\n fn: SIPrefix(\"W\", 3),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-milliwatt\",\n \"Milliwatt (mW)\",\n ),\n id: \"mwatt\",\n fn: SIPrefix(\"W\", -1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-watt-square-meter\",\n \"Watt per square meter (W/m²)\",\n ),\n id: \"Wm2\",\n fn: SIPrefix(\"W/m²\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-volt-ampere\",\n \"Volt-Ampere (VA)\",\n ),\n id: \"voltamp\",\n fn: SIPrefix(\"VA\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-kilovolt-ampere\",\n \"Kilovolt-Ampere (kVA)\",\n ),\n id: \"kvoltamp\",\n fn: SIPrefix(\"VA\", 1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-volt-ampere-reactive\",\n \"Volt-Ampere reactive (VAr)\",\n ),\n id: \"voltampreact\",\n fn: SIPrefix(\"VAr\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-kilovolt-ampere-reactive\",\n \"Kilovolt-Ampere reactive (kVAr)\",\n ),\n id: \"kvoltampreact\",\n fn: SIPrefix(\"VAr\", 1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-watt-hour\",\n \"Watt-hour (Wh)\",\n ),\n id: \"watth\",\n fn: SIPrefix(\"Wh\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-watt-hour-per-kg\",\n \"Watt-hour per Kilogram (Wh/kg)\",\n ),\n id: \"watthperkg\",\n fn: SIPrefix(\"Wh/kg\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-kilowatt-hour\",\n \"Kilowatt-hour (kWh)\",\n ),\n id: \"kwatth\",\n fn: SIPrefix(\"Wh\", 1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-kilowatt-min\",\n \"Kilowatt-min (kWm)\",\n ),\n id: \"kwattm\",\n fn: SIPrefix(\"W-Min\", 1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-megawatt-hour\",\n \"Megawatt-hour (MWh)\",\n ),\n id: \"mwatth\",\n fn: SIPrefix(\"Wh\", 2),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-ampere-hour\",\n \"Ampere-hour (Ah)\",\n ),\n id: \"amph\",\n fn: SIPrefix(\"Ah\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-kiloampere-hour\",\n \"Kiloampere-hour (kAh)\",\n ),\n id: \"kamph\",\n fn: SIPrefix(\"Ah\", 1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-milliampere-hour\",\n \"Milliampere-hour (mAh)\",\n ),\n id: \"mamph\",\n fn: SIPrefix(\"Ah\", -1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-joule\",\n \"Joule (J)\",\n ),\n id: \"joule\",\n fn: SIPrefix(\"J\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-electron-volt\",\n \"Electron volt (eV)\",\n ),\n id: \"ev\",\n fn: SIPrefix(\"eV\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-ampere\",\n \"Ampere (A)\",\n ),\n id: \"amp\",\n fn: SIPrefix(\"A\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-kiloampere\",\n \"Kiloampere (kA)\",\n ),\n id: \"kamp\",\n fn: SIPrefix(\"A\", 1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-milliampere\",\n \"Milliampere (mA)\",\n ),\n id: \"mamp\",\n fn: SIPrefix(\"A\", -1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-volt\",\n \"Volt (V)\",\n ),\n id: \"volt\",\n fn: SIPrefix(\"V\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-kilovolt\",\n \"Kilovolt (kV)\",\n ),\n id: \"kvolt\",\n fn: SIPrefix(\"V\", 1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-millivolt\",\n \"Millivolt (mV)\",\n ),\n id: \"mvolt\",\n fn: SIPrefix(\"V\", -1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-decibel-milliwatt\",\n \"Decibel-milliwatt (dBm)\",\n ),\n id: \"dBm\",\n fn: SIPrefix(\"dBm\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-milliohm\",\n \"Milliohm (mΩ)\",\n ),\n id: \"mohm\",\n fn: SIPrefix(\"Ω\", -1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-ohm\",\n \"Ohm (Ω)\",\n ),\n id: \"ohm\",\n fn: SIPrefix(\"Ω\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-kiloohm\",\n \"Kiloohm (kΩ)\",\n ),\n id: \"kohm\",\n fn: SIPrefix(\"Ω\", 1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-megaohm\",\n \"Megaohm (MΩ)\",\n ),\n id: \"Mohm\",\n fn: SIPrefix(\"Ω\", 2),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-farad\",\n \"Farad (F)\",\n ),\n id: \"farad\",\n fn: SIPrefix(\"F\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-microfarad\",\n \"Microfarad (µF)\",\n ),\n id: \"µfarad\",\n fn: SIPrefix(\"F\", -2),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-nanofarad\",\n \"Nanofarad (nF)\",\n ),\n id: \"nfarad\",\n fn: SIPrefix(\"F\", -3),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-picofarad\",\n \"Picofarad (pF)\",\n ),\n id: \"pfarad\",\n fn: SIPrefix(\"F\", -4),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-femtofarad\",\n \"Femtofarad (fF)\",\n ),\n id: \"ffarad\",\n fn: SIPrefix(\"F\", -5),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-henry\",\n \"Henry (H)\",\n ),\n id: \"henry\",\n fn: SIPrefix(\"H\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-millihenry\",\n \"Millihenry (mH)\",\n ),\n id: \"mhenry\",\n fn: SIPrefix(\"H\", -1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-microhenry\",\n \"Microhenry (µH)\",\n ),\n id: \"µhenry\",\n fn: SIPrefix(\"H\", -2),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.energy.formats.name-lumens\",\n \"Lumens (Lm)\",\n ),\n id: \"lumens\",\n fn: SIPrefix(\"Lm\"),\n },\n ],\n },\n {\n name: t(\"grafana-data.valueFormats.categories.flow.name\", \"Flow\"),\n formats: [\n {\n name: t(\n \"grafana-data.valueFormats.categories.flow.formats.name-gallons-min\",\n \"Gallons/min (gpm)\",\n ),\n id: \"flowgpm\",\n fn: toFixedUnit(\"gpm\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.flow.formats.name-cubic-meters-sec\",\n \"Cubic meters/sec (cms)\",\n ),\n id: \"flowcms\",\n fn: toFixedUnit(\"cms\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.flow.formats.name-cubic-feet-sec\",\n \"Cubic feet/sec (cfs)\",\n ),\n id: \"flowcfs\",\n fn: toFixedUnit(\"cfs\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.flow.formats.name-cubic-feet-min\",\n \"Cubic feet/min (cfm)\",\n ),\n id: \"flowcfm\",\n fn: toFixedUnit(\"cfm\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.flow.formats.name-litre-hour\",\n \"Litre/hour\",\n ),\n id: \"litreh\",\n fn: toFixedUnit(\"L/h\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.flow.formats.name-litre-min\",\n \"Litre/min (L/min)\",\n ),\n id: \"flowlpm\",\n fn: toFixedUnit(\"L/min\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.flow.formats.name-millilitre-min\",\n \"milliLitre/min (mL/min)\",\n ),\n id: \"flowmlpm\",\n fn: toFixedUnit(\"mL/min\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.flow.formats.name-lux\",\n \"Lux (lx)\",\n ),\n id: \"lux\",\n fn: toFixedUnit(\"lux\"),\n },\n ],\n },\n {\n name: t(\"grafana-data.valueFormats.categories.force.name\", \"Force\"),\n formats: [\n {\n name: t(\n \"grafana-data.valueFormats.categories.force.formats.name-newton-meters\",\n \"Newton-meters (Nm)\",\n ),\n id: \"forceNm\",\n fn: SIPrefix(\"Nm\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.force.formats.name-kilonewton-meters\",\n \"Kilonewton-meters (kNm)\",\n ),\n id: \"forcekNm\",\n fn: SIPrefix(\"Nm\", 1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.force.formats.name-newtons\",\n \"Newtons (N)\",\n ),\n id: \"forceN\",\n fn: SIPrefix(\"N\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.force.formats.name-kilonewtons\",\n \"Kilonewtons (kN)\",\n ),\n id: \"forcekN\",\n fn: SIPrefix(\"N\", 1),\n },\n ],\n },\n {\n name: t(\"grafana-data.valueFormats.categories.hash-rate.name\", \"Hash rate\"),\n formats: [\n {\n name: t(\n \"grafana-data.valueFormats.categories.hash-rate.formats.name-hashes-sec\",\n \"hashes/sec\",\n ),\n id: \"Hs\",\n fn: SIPrefix(\"H/s\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.hash-rate.formats.name-kilohashes-sec\",\n \"kilohashes/sec\",\n ),\n id: \"KHs\",\n fn: SIPrefix(\"H/s\", 1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.hash-rate.formats.name-megahashes-sec\",\n \"megahashes/sec\",\n ),\n id: \"MHs\",\n fn: SIPrefix(\"H/s\", 2),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.hash-rate.formats.name-gigahashes-sec\",\n \"gigahashes/sec\",\n ),\n id: \"GHs\",\n fn: SIPrefix(\"H/s\", 3),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.hash-rate.formats.name-terahashes-sec\",\n \"terahashes/sec\",\n ),\n id: \"THs\",\n fn: SIPrefix(\"H/s\", 4),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.hash-rate.formats.name-petahashes-sec\",\n \"petahashes/sec\",\n ),\n id: \"PHs\",\n fn: SIPrefix(\"H/s\", 5),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.hash-rate.formats.name-exahashes-sec\",\n \"exahashes/sec\",\n ),\n id: \"EHs\",\n fn: SIPrefix(\"H/s\", 6),\n },\n ],\n },\n {\n name: t(\"grafana-data.valueFormats.categories.mass.name\", \"Mass\"),\n formats: [\n {\n name: t(\n \"grafana-data.valueFormats.categories.mass.formats.name-milligram\",\n \"milligram (mg)\",\n ),\n id: \"massmg\",\n fn: SIPrefix(\"g\", -1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.mass.formats.name-gram\",\n \"gram (g)\",\n ),\n id: \"massg\",\n fn: SIPrefix(\"g\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.mass.formats.name-pound\",\n \"pound (lb)\",\n ),\n id: \"masslb\",\n fn: toFixedUnit(\"lb\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.mass.formats.name-kilogram\",\n \"kilogram (kg)\",\n ),\n id: \"masskg\",\n fn: SIPrefix(\"g\", 1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.mass.formats.name-metric-ton\",\n \"metric ton (t)\",\n ),\n id: \"masst\",\n fn: toFixedUnit(\"t\"),\n },\n ],\n },\n {\n name: t(\"grafana-data.valueFormats.categories.length.name\", \"Length\"),\n formats: [\n {\n name: t(\n \"grafana-data.valueFormats.categories.length.formats.name-millimeter\",\n \"millimeter (mm)\",\n ),\n id: \"lengthmm\",\n fn: SIPrefix(\"m\", -1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.length.formats.name-inch\",\n \"inch (in)\",\n ),\n id: \"lengthin\",\n fn: toFixedUnit(\"in\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.length.formats.name-feet\",\n \"feet (ft)\",\n ),\n id: \"lengthft\",\n fn: toFixedUnit(\"ft\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.length.formats.name-meter\",\n \"meter (m)\",\n ),\n id: \"lengthm\",\n fn: SIPrefix(\"m\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.length.formats.name-kilometer\",\n \"kilometer (km)\",\n ),\n id: \"lengthkm\",\n fn: SIPrefix(\"m\", 1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.length.formats.name-mile\",\n \"mile (mi)\",\n ),\n id: \"lengthmi\",\n fn: toFixedUnit(\"mi\"),\n },\n ],\n },\n {\n name: t(\"grafana-data.valueFormats.categories.pressure.name\", \"Pressure\"),\n formats: [\n {\n name: t(\n \"grafana-data.valueFormats.categories.pressure.formats.name-millibars\",\n \"Millibars\",\n ),\n id: \"pressurembar\",\n fn: SIPrefix(\"bar\", -1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.pressure.formats.name-bars\",\n \"Bars\",\n ),\n id: \"pressurebar\",\n fn: SIPrefix(\"bar\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.pressure.formats.name-kilobars\",\n \"Kilobars\",\n ),\n id: \"pressurekbar\",\n fn: SIPrefix(\"bar\", 1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.pressure.formats.name-pascals\",\n \"Pascals\",\n ),\n id: \"pressurepa\",\n fn: SIPrefix(\"Pa\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.pressure.formats.name-hectopascals\",\n \"Hectopascals\",\n ),\n id: \"pressurehpa\",\n fn: toFixedUnit(\"hPa\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.pressure.formats.name-kilopascals\",\n \"Kilopascals\",\n ),\n id: \"pressurekpa\",\n fn: toFixedUnit(\"kPa\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.pressure.formats.name-inches-mercury\",\n \"Inches of mercury\",\n ),\n id: \"pressurehg\",\n fn: toFixedUnit('\"Hg'),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.pressure.formats.name-psi\",\n \"PSI\",\n ),\n id: \"pressurepsi\",\n fn: scaledUnits(1000, [\"psi\", \"ksi\", \"Mpsi\"]),\n },\n ],\n },\n {\n name: t(\"grafana-data.valueFormats.categories.radiation.name\", \"Radiation\"),\n formats: [\n {\n name: t(\n \"grafana-data.valueFormats.categories.radiation.formats.name-becquerel\",\n \"Becquerel (Bq)\",\n ),\n id: \"radbq\",\n fn: SIPrefix(\"Bq\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.radiation.formats.name-curie\",\n \"curie (Ci)\",\n ),\n id: \"radci\",\n fn: SIPrefix(\"Ci\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.radiation.formats.name-gray\",\n \"Gray (Gy)\",\n ),\n id: \"radgy\",\n fn: SIPrefix(\"Gy\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.radiation.formats.name-rad\",\n \"rad\",\n ),\n id: \"radrad\",\n fn: SIPrefix(\"rad\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.radiation.formats.name-sievert\",\n \"Sievert (Sv)\",\n ),\n id: \"radsv\",\n fn: SIPrefix(\"Sv\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.radiation.formats.name-millisievert\",\n \"milliSievert (mSv)\",\n ),\n id: \"radmsv\",\n fn: SIPrefix(\"Sv\", -1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.radiation.formats.name-microsievert\",\n \"microSievert (µSv)\",\n ),\n id: \"radusv\",\n fn: SIPrefix(\"Sv\", -2),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.radiation.formats.name-rem\",\n \"rem\",\n ),\n id: \"radrem\",\n fn: SIPrefix(\"rem\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.radiation.formats.name-exposure\",\n \"Exposure (C/kg)\",\n ),\n id: \"radexpckg\",\n fn: SIPrefix(\"C/kg\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.radiation.formats.name-roentgen\",\n \"roentgen (R)\",\n ),\n id: \"radr\",\n fn: SIPrefix(\"R\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.radiation.formats.name-sievert-hour\",\n \"Sievert/hour (Sv/h)\",\n ),\n id: \"radsvh\",\n fn: SIPrefix(\"Sv/h\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.radiation.formats.name-millisievert-hour\",\n \"milliSievert/hour (mSv/h)\",\n ),\n id: \"radmsvh\",\n fn: SIPrefix(\"Sv/h\", -1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.radiation.formats.name-microsievert-hour\",\n \"microSievert/hour (µSv/h)\",\n ),\n id: \"radusvh\",\n fn: SIPrefix(\"Sv/h\", -2),\n },\n ],\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.rotational-speed.name\",\n \"Rotational Speed\",\n ),\n formats: [\n {\n name: t(\n \"grafana-data.valueFormats.categories.rotational-speed.formats.name-rpm\",\n \"Revolutions per minute (rpm)\",\n ),\n id: \"rotrpm\",\n fn: toFixedUnit(\"rpm\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.rotational-speed.formats.name-hertz\",\n \"Hertz (Hz)\",\n ),\n id: \"rothz\",\n fn: SIPrefix(\"Hz\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.rotational-speed.formats.name-kilohertz\",\n \"Kilohertz (kHz)\",\n ),\n id: \"rotkhz\",\n fn: SIPrefix(\"Hz\", 1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.rotational-speed.formats.name-megahertz\",\n \"Megahertz (MHz)\",\n ),\n id: \"rotmhz\",\n fn: SIPrefix(\"Hz\", 2),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.rotational-speed.formats.name-gigahertz\",\n \"Gigahertz (GHz)\",\n ),\n id: \"rotghz\",\n fn: SIPrefix(\"Hz\", 3),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.rotational-speed.formats.name-radians-sec\",\n \"Radians per second (rad/s)\",\n ),\n id: \"rotrads\",\n fn: toFixedUnit(\"rad/s\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.rotational-speed.formats.name-degrees-sec\",\n \"Degrees per second (°/s)\",\n ),\n id: \"rotdegs\",\n fn: toFixedUnit(\"°/s\"),\n },\n ],\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.temperature.name\",\n \"Temperature\",\n ),\n formats: [\n {\n name: t(\n \"grafana-data.valueFormats.categories.temperature.formats.name-celsius\",\n \"Celsius (°C)\",\n ),\n id: \"celsius\",\n fn: toFixedUnit(\"°C\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.temperature.formats.name-fahrenheit\",\n \"Fahrenheit (°F)\",\n ),\n id: \"fahrenheit\",\n fn: toFixedUnit(\"°F\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.temperature.formats.name-kelvin\",\n \"Kelvin (K)\",\n ),\n id: \"kelvin\",\n fn: toFixedUnit(\"K\"),\n },\n ],\n },\n {\n name: t(\"grafana-data.valueFormats.categories.time.name\", \"Time\"),\n formats: [\n {\n name: t(\n \"grafana-data.valueFormats.categories.time.formats.name-hertz\",\n \"Hertz (1/s)\",\n ),\n id: \"hertz\",\n fn: SIPrefix(\"Hz\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.time.formats.name-nanoseconds\",\n \"nanoseconds (ns)\",\n ),\n id: \"ns\",\n fn: toNanoSeconds,\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.time.formats.name-microseconds\",\n \"microseconds (µs)\",\n ),\n id: \"µs\",\n fn: toMicroSeconds,\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.time.formats.name-milliseconds\",\n \"milliseconds (ms)\",\n ),\n id: \"ms\",\n fn: toMilliSeconds,\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.time.formats.name-seconds\",\n \"seconds (s)\",\n ),\n id: \"s\",\n fn: toSeconds,\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.time.formats.name-minutes\",\n \"minutes (m)\",\n ),\n id: \"m\",\n fn: toMinutes,\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.time.formats.name-hours\",\n \"hours (h)\",\n ),\n id: \"h\",\n fn: toHours,\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.time.formats.name-days\",\n \"days (d)\",\n ),\n id: \"d\",\n fn: toDays,\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.time.formats.name-duration-ms\",\n \"duration (ms)\",\n ),\n id: \"dtdurationms\",\n fn: toDurationInMilliseconds,\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.time.formats.name-duration-s\",\n \"duration (s)\",\n ),\n id: \"dtdurations\",\n fn: toDurationInSeconds,\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.time.formats.name-duration-hms\",\n \"duration (hh:mm:ss)\",\n ),\n id: \"dthms\",\n fn: toDurationInHoursMinutesSeconds,\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.time.formats.name-duration-dhms\",\n \"duration (d hh:mm:ss)\",\n ),\n id: \"dtdhms\",\n fn: toDurationInDaysHoursMinutesSeconds,\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.time.formats.name-timeticks\",\n \"Timeticks (s/100)\",\n ),\n id: \"timeticks\",\n fn: toTimeTicks,\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.time.formats.name-clock-ms\",\n \"clock (ms)\",\n ),\n id: \"clockms\",\n fn: toClockMilliseconds,\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.time.formats.name-clock-s\",\n \"clock (s)\",\n ),\n id: \"clocks\",\n fn: toClockSeconds,\n },\n ],\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.throughput.name\",\n \"Throughput\",\n ),\n formats: [\n {\n name: t(\n \"grafana-data.valueFormats.categories.throughput.formats.name-counts-sec\",\n \"counts/sec (cps)\",\n ),\n id: \"cps\",\n fn: simpleCountUnit(\"c/s\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.throughput.formats.name-ops-sec\",\n \"ops/sec (ops)\",\n ),\n id: \"ops\",\n fn: simpleCountUnit(\"ops/s\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.throughput.formats.name-requests-sec\",\n \"requests/sec (rps)\",\n ),\n id: \"reqps\",\n fn: simpleCountUnit(\"req/s\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.throughput.formats.name-reads-sec\",\n \"reads/sec (rps)\",\n ),\n id: \"rps\",\n fn: simpleCountUnit(\"rd/s\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.throughput.formats.name-writes-sec\",\n \"writes/sec (wps)\",\n ),\n id: \"wps\",\n fn: simpleCountUnit(\"wr/s\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.throughput.formats.name-io-ops-sec\",\n \"I/O ops/sec (iops)\",\n ),\n id: \"iops\",\n fn: simpleCountUnit(\"io/s\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.throughput.formats.name-events-sec\",\n \"events/sec (eps)\",\n ),\n id: \"eps\",\n fn: simpleCountUnit(\"evt/s\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.throughput.formats.name-messages-sec\",\n \"messages/sec (mps)\",\n ),\n id: \"mps\",\n fn: simpleCountUnit(\"msg/s\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.throughput.formats.name-records-sec\",\n \"records/sec (rps)\",\n ),\n id: \"recps\",\n fn: simpleCountUnit(\"rec/s\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.throughput.formats.name-rows-sec\",\n \"rows/sec (rps)\",\n ),\n id: \"rowsps\",\n fn: simpleCountUnit(\"rows/s\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.throughput.formats.name-counts-min\",\n \"counts/min (cpm)\",\n ),\n id: \"cpm\",\n fn: simpleCountUnit(\"c/m\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.throughput.formats.name-ops-min\",\n \"ops/min (opm)\",\n ),\n id: \"opm\",\n fn: simpleCountUnit(\"ops/m\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.throughput.formats.name-requests-min\",\n \"requests/min (rpm)\",\n ),\n id: \"reqpm\",\n fn: simpleCountUnit(\"req/m\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.throughput.formats.name-reads-min\",\n \"reads/min (rpm)\",\n ),\n id: \"rpm\",\n fn: simpleCountUnit(\"rd/m\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.throughput.formats.name-writes-min\",\n \"writes/min (wpm)\",\n ),\n id: \"wpm\",\n fn: simpleCountUnit(\"wr/m\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.throughput.formats.name-events-min\",\n \"events/min (epm)\",\n ),\n id: \"epm\",\n fn: simpleCountUnit(\"evts/m\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.throughput.formats.name-messages-min\",\n \"messages/min (mpm)\",\n ),\n id: \"mpm\",\n fn: simpleCountUnit(\"msgs/m\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.throughput.formats.name-records-min\",\n \"records/min (rpm)\",\n ),\n id: \"recpm\",\n fn: simpleCountUnit(\"rec/m\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.throughput.formats.name-rows-min\",\n \"rows/min (rpm)\",\n ),\n id: \"rowspm\",\n fn: simpleCountUnit(\"rows/m\"),\n },\n ],\n },\n {\n name: t(\"grafana-data.valueFormats.categories.velocity.name\", \"Velocity\"),\n formats: [\n {\n name: t(\n \"grafana-data.valueFormats.categories.velocity.formats.name-meters-second\",\n \"meters/second (m/s)\",\n ),\n id: \"velocityms\",\n fn: toFixedUnit(\"m/s\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.velocity.formats.name-kilometers-hour\",\n \"kilometers/hour (km/h)\",\n ),\n id: \"velocitykmh\",\n fn: toFixedUnit(\"km/h\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.velocity.formats.name-miles-hour\",\n \"miles/hour (mph)\",\n ),\n id: \"velocitymph\",\n fn: toFixedUnit(\"mph\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.velocity.formats.name-knot\",\n \"knot (kn)\",\n ),\n id: \"velocityknot\",\n fn: toFixedUnit(\"kn\"),\n },\n ],\n },\n {\n name: t(\"grafana-data.valueFormats.categories.volume.name\", \"Volume\"),\n formats: [\n {\n name: t(\n \"grafana-data.valueFormats.categories.volume.formats.name-millilitre\",\n \"millilitre (mL)\",\n ),\n id: \"mlitre\",\n fn: SIPrefix(\"L\", -1),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.volume.formats.name-litre\",\n \"litre (L)\",\n ),\n id: \"litre\",\n fn: SIPrefix(\"L\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.volume.formats.name-cubic-meter\",\n \"cubic meter\",\n ),\n id: \"m3\",\n fn: toFixedUnit(\"m³\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.volume.formats.name-normal-cubic-meter\",\n \"Normal cubic meter\",\n ),\n id: \"Nm3\",\n fn: toFixedUnit(\"Nm³\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.volume.formats.name-cubic-decimeter\",\n \"cubic decimeter\",\n ),\n id: \"dm3\",\n fn: toFixedUnit(\"dm³\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.volume.formats.name-gallons\",\n \"gallons\",\n ),\n id: \"gallons\",\n fn: toFixedUnit(\"gal\"),\n },\n ],\n },\n {\n name: t(\"grafana-data.valueFormats.categories.boolean.name\", \"Boolean\"),\n formats: [\n {\n name: t(\n \"grafana-data.valueFormats.categories.boolean.formats.name-true-false\",\n \"True / False\",\n ),\n id: \"bool\",\n fn: booleanValueFormatter(\"True\", \"False\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.boolean.formats.name-yes-no\",\n \"Yes / No\",\n ),\n id: \"bool_yes_no\",\n fn: booleanValueFormatter(\"Yes\", \"No\"),\n },\n {\n name: t(\n \"grafana-data.valueFormats.categories.boolean.formats.name-on-off\",\n \"On / Off\",\n ),\n id: \"bool_on_off\",\n fn: booleanValueFormatter(\"On\", \"Off\"),\n },\n ],\n },\n];\n"],"mappings":"AAcA,IAAMA,EAA6B,sBAC7BC,GAAgC,0BAEzBC,EAAN,KAA6B,CAClC,SAAWF,EACX,WAAaC,GACb,SAAW,CACT,YAAa,eACb,OAAQ,WACR,OAAQ,QACR,KAAM,cACN,IAAK,QACL,MAAO,UACP,KAAM,MACR,EAEA,OAAOE,EAAoC,CACzC,KAAK,SAAWA,EAAS,SACzB,KAAK,SAAWA,EAAS,SAErBA,EAAS,kBACX,KAAK,iBAAiB,CAE1B,CAEA,kBAAmB,CACjB,KAAK,SAAWC,EAAgB,CAC9B,KAAM,UACN,MAAO,UACP,IAAK,UACL,KAAM,UACN,OAAQ,UACR,OAAQ,SACV,CAAC,EAID,KAAK,WAAa,KAAK,SAAS,QAAQ,KAAM,QAAQ,EAEtD,KAAK,SAAS,YAAcA,EAC1B,CAAE,KAAM,UAAW,OAAQ,UAAW,OAAQ,UAAW,OAAQ,EAAM,EACvE,KACA,KAAK,SAAS,MAChB,EAAE,QAAQ,KAAM,QAAQ,EACxB,KAAK,SAAS,OAASA,EACrB,CAAE,KAAM,UAAW,OAAQ,UAAW,OAAQ,UAAW,OAAQ,EAAM,EACvE,KACA,KAAK,SAAS,MAChB,EACA,KAAK,SAAS,OAASA,EACrB,CAAE,KAAM,UA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ACJ,qEACA,kBACF,EACA,GAAI,KACJ,GAAIqB,EACN,EACA,CACE,KAAMrB,EACJ,sEACA,sBACF,EACA,GAAI,QACJ,GAAIsB,EACN,EACA,CACE,KAAMtB,EACJ,sEACA,mBACF,EACA,GAAI,KACJ,GAAIuB,EACN,EACA,CACE,KAAMvB,EACJ,iEACA,aACF,EACA,GAAI,IACJ,GAAIwB,CACN,EACA,CACE,KAAMxB,EACJ,iEACA,aACF,EACA,GAAI,IACJ,GAAIyB,EACN,EACA,CACE,KAAMzB,EACJ,+DACA,WACF,EACA,GAAI,IACJ,GAAI0B,EACN,EACA,CACE,KAAM1B,EACJ,8DACA,UACF,EACA,GAAI,IACJ,GAAI2B,EACN,EACA,CACE,KAAM3B,EACJ,qEACA,eACF,EACA,GAAI,eACJ,GAAI4B,EACN,EACA,CACE,KAAM5B,EACJ,oEACA,cACF,EACA,GAAI,cACJ,GAAI6B,EACN,EACA,CACE,KAAM7B,EACJ,sEACA,qBACF,EACA,GAAI,QACJ,GAAI8B,CACN,EACA,CACE,KAAM9B,EACJ,uEACA,uBACF,EACA,GAAI,SACJ,GAAI+B,CACN,EACA,CACE,KAAM/B,EACJ,mEACA,mBACF,EACA,GAAI,YACJ,GAAIgC,EACN,EACA,CACE,KAAMhC,EACJ,kEACA,YACF,EACA,GAAI,UACJ,GAAIiC,EACN,EACA,CACE,KAAMjC,EACJ,iEACA,WACF,EACA,GAAI,SACJ,GAAIkC,EACN,CACF,CACF,EACA,CACE,KAAMlC,EACJ,uDACA,YACF,EACA,QAAS,CACP,CACE,KAAMA,EACJ,0EACA,kBACF,EACA,GAAI,MACJ,GAAImC,EAAgB,KAAK,CAC3B,EACA,CACE,KAAMnC,EACJ,uEACA,eACF,EACA,GAAI,MACJ,GAAImC,EAAgB,OAAO,CAC7B,EACA,CACE,KAAMnC,EACJ,4EACA,oBACF,EACA,GAAI,QACJ,GAAImC,EAAgB,OAAO,CAC7B,EACA,CACE,KAAMnC,EACJ,yEACA,iBACF,EACA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AM3B,EAAS8B,GAAsBF,EAAI,OAAO,CAAC,CAAC,EAC5CG,EAAO/B,IAAW,EAAI4B,EAAMA,EAAI,UAAU,CAAC,EACjD,OAAOI,EAASD,EAAM/B,CAAM,CAC9B,CAEA,GAAI2B,IAAQ,QACV,OAAOnB,EAAgBoB,CAAG,EAO5B,GAAID,IAAQ,WAAY,CACtB,IAAMM,EAAWL,EAAI,MAAM,GAAG,EAE9B,GAAIK,EAAS,CAAC,IAAM,aAAeA,EAAS,QAAU,EAAG,CACvD,IAAMxB,EAASwB,EAAS,CAAC,EACzB,GAAI,CAACxB,EACH,OAAOe,EAAY,EAAE,EAEvB,IAAMU,EAAWD,EAAS,CAAC,IAAM,SACjC,OAAOE,GAAa1B,EAAQyB,CAAQ,CACtC,KACE,QAAOE,EAASR,CAAG,CAEvB,CAEA,GAAID,IAAQ,OAAQ,CAElB,GADAD,EAAME,EAAI,QAAQ,GAAG,EACjBF,GAAO,EAAG,CACZ,IAAMnC,EAAIqC,EAAI,UAAU,EAAGF,CAAG,EACxB,EAAIE,EAAI,UAAUF,EAAM,CAAC,EAC/B,OAAOpC,EAAsBC,EAAG,CAAC,CACnC,CACA,OAAOD,EAAsBsC,EAAK,GAAG,CACvC,CACF,CAEA,OAAOJ,EAAYD,CAAE,CACvB,CAEA,OAAOE,CACT","names":["DEFAULT_SYSTEM_DATE_FORMAT","DEFAULT_SYSTEM_DATE_MS_FORMAT","SystemDateFormatsState","settings","localTimeFormat","useMsResolution","options","locale","fallback","missingIntlDateTimeFormatSupport","dateTimeFormat","parts","mapping","part","systemDateFormats","moment","getFeatureToggle","featureName","def","isEmpty","moment","tz","ISO_8601","toUtc","input","formatInput","moment","toDuration","unit","dateTime","dateTimeAsMoment","defaultTimeZone","DefaultTimeZone","defaultTimeZoneResolver","DefaultTimeZone","getTimeZone","options","isEmpty","defaultTimeZoneResolver","DefaultTimeZone","deepEqual","memoize","deepMemoize","fn","regionalFormat","createDateTimeFormatter","deepMemoize","locale","options","createDurationFormatter","formatDate","_value","format","value","formatDuration","duration","toDate","dateInUtc","dateTimeAsMoment","toIANATimezone","grafanaTimezone","moment","getIntlOptions","date","options","timeZone","getTimeZone","intlOptions","dateTimeFormat","getFeatureToggle","toTz","getFormat","dateAsDate","formatDate","dateTimeFormatTimeAgo","dateInUtc","options","toTz","getTimeZone","getFormat","options","systemDateFormats","toTz","dateInUtc","timeZone","date","zone","moment","dateTimeAsMoment","toUtc","clamp","i18n","initialized","initI18nOnce","t","key","defaultMessage","values","toPercent","size","decimals","toFixed","toPercentUnit","toHex0x","value","asHex","toHex","sci","UNITS","INTERVALS_IN_SECONDS","toNanoSeconds","size","decimals","toFixed","toFixedScaled","toMicroSeconds","toMilliSeconds","scaledDecimals","toSeconds","toMinutes","toHours","toDays","toDuration","timeScale","v","strings","decrementDecimals","decimalsCount","i","interval","value","floor","unit","toClock","toUtc","format","hours","toDurationInMilliseconds","toDurationInSeconds","toDurationInHoursMinutesSeconds","numHours","numMinutes","numSeconds","toDurationInDaysHoursMinutesSeconds","dayString","numDays","hmsString","toTimeTicks","toClockMilliseconds","toClockSeconds","toDateTimeValueFormatter","pattern","todayPattern","timeZone","dateTime","dateTimeFormat","dateTimeAsIso","dateTimeAsIsoNoDateIfToday","dateTimeAsUS","dateTimeAsUSNoDateIfToday","getDateTimeAsLocalFormat","localTimeFormat","getDateTimeAsLocalFormatNoDateIfToday","dateTimeSystemFormatter","showMs","systemDateFormats","dateTimeFromNow","dateTimeFormatTimeAgo","currency","symbol","asSuffix","scaler","scaledUnits","value","decimals","scaledDecimals","isNegative","scaled","fullCurrency","locale","defaultFormatter","formattersCache","numericValue","text","formatter","SI_PREFIXES","SI_BASE_INDEX","getOffsetFromSIPrefix","c","charIndex","prefix","BIN_PREFIXES","binaryPrefix","unit","offset","units","p","SIPrefix","getCategories","t","toFixedUnit","stringFormater","scaledUnits","SIPrefix","toPercent","toPercentUnit","toHex0x","toHex","sci","locale","currency","binaryPrefix","dateTimeAsIso","dateTimeAsIsoNoDateIfToday","dateTimeAsUS","dateTimeAsUSNoDateIfToday","getDateTimeAsLocalFormat","getDateTimeAsLocalFormatNoDateIfToday","dateTimeSystemFormatter","dateTimeFromNow","toNanoSeconds","toMicroSeconds","toMilliSeconds","toSeconds","toMinutes","toHours","toDays","toDurationInMilliseconds","toDurationInSeconds","toDurationInHoursMinutesSeconds","toDurationInDaysHoursMinutesSeconds","toTimeTicks","toClockMilliseconds","toClockSeconds","simpleCountUnit","booleanValueFormatter","categories","index","hasBuiltIndex","toFixed","value","decimals","getDecimalsForValue","factor","formatted","decimalPos","precision","absValue","dec","magn","toFixedScaled","ext","appendPluralIf","condition","toFixedUnit","unit","asPrefix","size","text","booleanValueFormatter","t","f","value","logb","b","x","scaledUnits","factor","extArray","offset","size","decimals","siIndex","suffix","clamp","toFixed","locale","simpleCountUnit","symbol","scaler","scaledDecimals","v","stringFormater","buildFormats","categories","getCategories","cat","format","index","alias","hasBuiltIndex","getValueFormat","id","toFixedUnit","fmt","idx","key","sub","toDateTimeValueFormatter","getOffsetFromSIPrefix","unit","SIPrefix","keySplit","asSuffix","fullCurrency","currency"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@unblind/units",
|
|
3
|
+
"version": "0.1.0-alpha",
|
|
4
|
+
"description": "Unblind Units library",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"unblind",
|
|
10
|
+
"react",
|
|
11
|
+
"monitoring",
|
|
12
|
+
"timeseries",
|
|
13
|
+
"charts"
|
|
14
|
+
],
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.mjs",
|
|
19
|
+
"require": "./dist/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@types/jest": "^30.0.0",
|
|
27
|
+
"@types/mocha": "^10.0.10",
|
|
28
|
+
"jest": "30.2.0",
|
|
29
|
+
"jest-environment-jsdom": "^30.2.0",
|
|
30
|
+
"mocha": "11.7.5",
|
|
31
|
+
"ts-jest": "^29.4.6",
|
|
32
|
+
"tsup": "^8.3.5",
|
|
33
|
+
"typescript": "5.8.2"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=18"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@types/lodash": "^4.17.23",
|
|
40
|
+
"date-fns": "^4.1.0",
|
|
41
|
+
"fast-deep-equal": "^3.1.3",
|
|
42
|
+
"i18next": "^25.8.2",
|
|
43
|
+
"lodash": "^4.17.23",
|
|
44
|
+
"micro-memoize": "^4.1.2",
|
|
45
|
+
"moment": "^2.30.1",
|
|
46
|
+
"moment-timezone": "^0.6.0"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"react": "^18.0.0 || ~19.0.3 || ~19.1.4 || ~19.2.3 || ~19.3.0-0",
|
|
50
|
+
"react-dom": "^18.0.0 || ~19.0.3 || ~19.1.4 || ~19.2.3 || ~19.3.0-0"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "tsup",
|
|
54
|
+
"dev": "tsup --watch",
|
|
55
|
+
"lint": "eslint src/",
|
|
56
|
+
"check-types": "tsc --noEmit",
|
|
57
|
+
"test": "TZ=Pacific/Easter jest"
|
|
58
|
+
}
|
|
59
|
+
}
|