ngwr 16.1.0 → 16.2.0
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/date-picker/styles/_index.scss +89 -1
- package/dropdown/styles/_index.scss +37 -1
- package/fesm2022/ngwr-date-picker-testing.mjs +18 -0
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +152 -8
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-date-stamp-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-stamp.mjs +73 -9
- package/fesm2022/ngwr-date-stamp.mjs.map +1 -1
- package/fesm2022/ngwr-date.mjs +86 -5
- package/fesm2022/ngwr-date.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown-testing.mjs +38 -3
- package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +358 -24
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ar.mjs +7 -2
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +7 -2
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +7 -2
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +7 -2
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +7 -2
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +7 -2
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +7 -2
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +7 -2
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +7 -2
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +7 -2
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +7 -2
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +7 -2
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +7 -2
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +7 -2
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +7 -2
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +7 -2
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +7 -2
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +7 -2
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +7 -2
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +7 -2
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +7 -2
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +7 -2
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox-testing.mjs +26 -0
- package/fesm2022/ngwr-lightbox-testing.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +246 -10
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +28 -6
- package/fesm2022/ngwr-pipes.mjs.map +1 -1
- package/fesm2022/ngwr-schema-form.mjs +3 -0
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-slider-testing.mjs +17 -0
- package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
- package/fesm2022/ngwr-slider.mjs +87 -11
- package/fesm2022/ngwr-slider.mjs.map +1 -1
- package/fesm2022/ngwr-sortable-list-testing.mjs +103 -0
- package/fesm2022/ngwr-sortable-list-testing.mjs.map +1 -0
- package/fesm2022/ngwr-sortable-list.mjs +257 -53
- package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/i18n/ar.json +7 -2
- package/i18n/cs.json +7 -2
- package/i18n/de.json +7 -2
- package/i18n/en.json +7 -2
- package/i18n/es.json +7 -2
- package/i18n/fr.json +7 -2
- package/i18n/he.json +7 -2
- package/i18n/hi.json +7 -2
- package/i18n/id.json +7 -2
- package/i18n/it.json +7 -2
- package/i18n/ja.json +7 -2
- package/i18n/ko.json +7 -2
- package/i18n/nl.json +7 -2
- package/i18n/pl.json +7 -2
- package/i18n/pt.json +7 -2
- package/i18n/ru.json +7 -2
- package/i18n/sv.json +7 -2
- package/i18n/tr.json +7 -2
- package/i18n/uk.json +7 -2
- package/i18n/vi.json +7 -2
- package/i18n/zh-TW.json +7 -2
- package/i18n/zh.json +7 -2
- package/lightbox/styles/_rules.scss +96 -0
- package/llms-full.txt +12 -8
- package/llms.txt +12 -0
- package/package.json +5 -1
- package/schematics/use/symbol-map.json +1 -0
- package/skills/ngwr/SKILL.md +1 -1
- package/skills/ngwr/references/catalog.md +2 -1
- package/slider/styles/_index.scss +106 -0
- package/sortable-list/styles/_rules.scss +23 -1
- package/types/ngwr-date-picker-testing.d.ts +17 -0
- package/types/ngwr-date-picker.d.ts +79 -2
- package/types/ngwr-date-stamp-testing.d.ts +1 -1
- package/types/ngwr-date-stamp.d.ts +53 -7
- package/types/ngwr-date.d.ts +118 -15
- package/types/ngwr-dropdown-testing.d.ts +53 -5
- package/types/ngwr-dropdown.d.ts +100 -0
- package/types/ngwr-lightbox-testing.d.ts +27 -0
- package/types/ngwr-lightbox.d.ts +71 -6
- package/types/ngwr-pipes.d.ts +33 -13
- package/types/ngwr-slider-testing.d.ts +8 -1
- package/types/ngwr-slider.d.ts +89 -3
- package/types/ngwr-sortable-list-testing.d.ts +79 -0
- package/types/ngwr-sortable-list.d.ts +113 -10
- package/types/ngwr-version.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-date.mjs","names":[],"sources":["../../../projects/lib/date/tokens/wr-date-locale.token.ts","../../../projects/lib/date/tokens/wr-date-time-zone.token.ts","../../../projects/lib/date/tokens/wr-date-locale-pinned.token.ts","../../../projects/lib/date/date-locale.ts","../../../projects/lib/date/time-zone.ts","../../../projects/lib/date/wr-date-adapter.ts","../../../projects/lib/date/local-date.ts","../../../projects/lib/date/parse-date.ts","../../../projects/lib/date/with-dates.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken, LOCALE_ID, inject } from '@angular/core';\n\n/**\n * The BCP 47 locale tag `withDates({ locale })` pinned, and Angular's\n * `LOCALE_ID` when nothing was. An adapter reads {@link wrDateLocale} instead,\n * which puts the interface language of `provideWrI18n()` between the two.\n *\n * **It used to default to `navigator.language`, and that was wrong in the\n * documented case.** The provider's own first example was the no-argument call,\n * so the path a reader copied was the broken one: an app that set\n * `LOCALE_ID: 'ru-RU'` and translated every string still rendered `March 2026`,\n * `SUN MON TUE …` and a week starting on Sunday, because the calendar was\n * asking the browser rather than the application. `navigator.language` is the\n * user's browser preference; `LOCALE_ID` is what the app says it is, and only\n * the app can be right about that. Reading the browser also made a prerendered\n * page and its hydrated self disagree — the server has no `navigator.language`\n * to match. An app that genuinely wants the browser's tag can still say so:\n * `provideWr(withDates({ locale: navigator.language }))`.\n *\n * The token is a plain string, resolved once: the *pinned* date locale, not a\n * live one. `WrI18n.use()` cannot move it, and moves dates only when nothing\n * was pinned. Provide it through `withDates({ locale })`: a bare provider of\n * this token is read as the fallback, not as a pin.\n *\n * **How far it reaches is up to the adapter.** The native one threads it through\n * everything. A subclass over a library that resolves its patterns against a\n * locale OBJECT rather than a tag (date-fns is the common case) has to map the\n * tag onto that object itself — otherwise the month and weekday names, which go\n * through `Intl`, localize and the field's own text does not.\n */\nexport const WR_DATE_LOCALE = new InjectionToken<string>('WR_DATE_LOCALE', {\n providedIn: 'root',\n factory: () => inject(LOCALE_ID),\n});\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\n/**\n * The display time zone the {@link WrDateAdapter} implementations read, as a\n * function: an IANA name (`'Asia/Almaty'`) or an offset (`'+05:00'`), and\n * `null` or `undefined` for the browser's own zone. `null` when\n * `withDates({ timeZone })` was not called, which is the browser's zone too.\n *\n * A function rather than a string because the zone often arrives after\n * bootstrap, from a runtime config. The native adapter calls it on every read,\n * so what it formats follows the signals the function reads.\n *\n * Set it with the `timeZone` option of `provideWr(withDates(...))`. An adapter\n * of your own injects it to honour the same option.\n */\nexport const WR_DATE_TIME_ZONE = new InjectionToken<(() => string | null | undefined) | null>('WR_DATE_TIME_ZONE', {\n providedIn: 'root',\n factory: () => null,\n});\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\n/**\n * Whether `withDates({ locale })` pinned the date locale. `WR_DATE_LOCALE`\n * cannot say: it holds `LOCALE_ID` when nothing was pinned.\n *\n * @internal\n */\nexport const WR_DATE_LOCALE_PINNED = new InjectionToken<boolean>('WR_DATE_LOCALE_PINNED', {\n providedIn: 'root',\n factory: () => false,\n});\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type Signal, computed, inject } from '@angular/core';\n\nimport { WR_LIVE_LOCALE } from 'ngwr/utils';\n\nimport { WR_DATE_LOCALE } from './tokens';\nimport { WR_DATE_LOCALE_PINNED } from './tokens/wr-date-locale-pinned.token';\n\nfunction isLocaleTag(tag: string): boolean {\n try {\n return Intl.getCanonicalLocales(tag).length > 0;\n } catch {\n return false;\n }\n}\n\n/**\n * The locale dates are written in, as a signal. Highest first:\n *\n * 1. `withDates({ locale })`: a pin, which a language switch does not move.\n * 2. `WrI18n.locale()`, when the app calls `provideWrI18n()`: the interface\n * language, which `WrI18n.use()` changes at runtime.\n * 3. `LOCALE_ID`.\n *\n * A catalog name that is not a BCP 47 tag (`en_US`) cannot format a date, so\n * the signal holds `LOCALE_ID` while the interface language is one.\n *\n * Must be called in an injection context. The native adapter formats in it; an\n * adapter of your own reads it to follow the same rule.\n *\n * @example\n * ```ts\n * private readonly locale = wrDateLocale();\n * protected readonly weekday = computed(() =>\n * new Intl.DateTimeFormat(this.locale(), { weekday: 'long' }).format(this.date()),\n * );\n * ```\n */\nexport function wrDateLocale(): Signal<string> {\n const fixed = inject(WR_DATE_LOCALE);\n const live = inject(WR_DATE_LOCALE_PINNED) ? null : inject(WR_LIVE_LOCALE, { optional: true });\n if (!live) return computed(() => fixed);\n return computed(() => {\n const tag = live();\n return isLocaleTag(tag) ? tag : fixed;\n });\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { isDevMode } from '@angular/core';\n\n/**\n * A display time zone, resolved: a fixed offset in minutes east of UTC, or an\n * IANA name with the formatter that reads its wall clock.\n *\n * @internal\n */\ntype WrResolvedZone =\n | { readonly kind: 'offset'; readonly id: string; readonly minutes: number }\n | { readonly kind: 'iana'; readonly id: string; readonly fields: Intl.DateTimeFormat };\n\n/** `+05:00`, `+0530`, `-03`. */\nconst OFFSET = /^([+-])(\\d{2})(?::?(\\d{2}))?$/;\n\nconst MINUTE = 60_000;\n\nconst resolved = new Map<string, WrResolvedZone | null>();\n\n/**\n * `Date.UTC` with the year taken literally: it reads one under 100 as 1900 + year.\n *\n * @internal\n */\nfunction wrUtcTime(year: number, month: number, day: number, hours = 0, minutes = 0, seconds = 0, millis = 0): number {\n const date = new Date(0);\n date.setUTCFullYear(year, month, day);\n date.setUTCHours(hours, minutes, seconds, millis);\n return date.getTime();\n}\n\n/**\n * What `withDates({ timeZone })` resolved to, or `null` for the browser's zone:\n * nothing set, or a value no engine knows, which warns once per value in dev mode.\n *\n * @internal\n */\nfunction wrResolveZone(value: string | null | undefined): WrResolvedZone | null {\n const id = value?.trim();\n if (!id) return null;\n const known = resolved.get(id);\n if (known !== undefined) return known;\n\n let zone: WrResolvedZone | null = null;\n const offset = OFFSET.exec(id);\n if (offset) {\n const hours = Number(offset[2]);\n const minutes = Number(offset[3] ?? 0);\n if (hours <= 23 && minutes <= 59) {\n zone = { kind: 'offset', id, minutes: (offset[1] === '-' ? -1 : 1) * (hours * 60 + minutes) };\n }\n } else {\n try {\n zone = {\n kind: 'iana',\n id,\n fields: new Intl.DateTimeFormat('en-US', {\n timeZone: id,\n calendar: 'gregory',\n numberingSystem: 'latn',\n hourCycle: 'h23',\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n }),\n };\n } catch {\n // `RangeError`: not a zone this engine knows.\n }\n }\n\n if (!zone && isDevMode()) {\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n `[NGWR] withDates({ timeZone }) got '${id}', which is neither an IANA time zone this browser knows ` +\n `nor an offset such as '+05:00'. Dates are shown in the browser's own time zone.`\n );\n }\n resolved.set(id, zone);\n return zone;\n}\n\n/**\n * The zone's wall clock at an instant, as the epoch time of a `Date` whose UTC\n * fields read it. UTC has no daylight saving, so every wall clock of every zone\n * has exactly one such time, which a `Date` read with local getters cannot say.\n *\n * @internal\n */\nfunction wrZoneWallTime(time: number, zone: WrResolvedZone | null): number {\n if (!zone) return time - new Date(time).getTimezoneOffset() * MINUTE;\n if (zone.kind === 'offset') return time + zone.minutes * MINUTE;\n\n const read: Record<string, number> = {};\n for (const part of zone.fields.formatToParts(time)) read[part.type] = Number(part.value);\n const millis = ((time % 1000) + 1000) % 1000;\n return wrUtcTime(read['year'], read['month'] - 1, read['day'], read['hour'], read['minute'], read['second'], millis);\n}\n\n/**\n * The instant a wall clock (see {@link wrZoneWallTime}) names in the zone. A\n * wall clock a daylight-saving change skips lands after the change, as\n * `new Date(y, m, d, h)` does for the browser's own zone.\n *\n * @internal\n */\nfunction wrZoneInstant(wall: number, zone: WrResolvedZone | null): number {\n if (!zone) {\n const w = new Date(wall);\n const local = new Date(0);\n local.setFullYear(w.getUTCFullYear(), w.getUTCMonth(), w.getUTCDate());\n local.setHours(w.getUTCHours(), w.getUTCMinutes(), w.getUTCSeconds(), w.getUTCMilliseconds());\n return local.getTime();\n }\n if (zone.kind === 'offset') return wall - zone.minutes * MINUTE;\n\n // The offset is known only for an instant, so guess with the offset the wall\n // clock would have as an instant and correct once: two passes settle\n // everything but a skipped hour, which has no answer to settle on.\n const first = wall - (wrZoneWallTime(wall, zone) - wall);\n const second = wall - (wrZoneWallTime(first, zone) - first);\n return second;\n}\n\nexport { wrResolveZone, wrUtcTime, wrZoneInstant, wrZoneWallTime };\nexport type { WrResolvedZone };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Injectable, Injector, Service, forwardRef, inject, runInInjectionContext } from '@angular/core';\n\nimport { wrDateLocale } from './date-locale';\nimport { type WrResolvedZone, wrResolveZone, wrUtcTime, wrZoneInstant, wrZoneWallTime } from './time-zone';\nimport { WR_DATE_TIME_ZONE } from './tokens';\nimport type { WrDateFormat } from './types';\n\n/**\n * Bidi control marks ICU embeds in a right-to-left date pattern — ar-SA writes its\n * separator as U+200F followed by a slash. No keyboard produces one, so both the\n * pattern and the typed string drop them before they are compared.\n */\nconst BIDI_RE = /[\\u200e\\u200f\\u061c\\u2066-\\u2069]/g;\n\nconst REGEX_META_RE = /[.*+?^${}()|[\\]\\\\]/g;\n\nfunction stripBidi(value: string): string {\n return value.replace(BIDI_RE, '');\n}\n\nfunction escapeRegex(value: string): string {\n return value.replace(REGEX_META_RE, '\\\\$&');\n}\n\n/**\n * One literal run of an `Intl` pattern, as a regex fragment.\n *\n * Whitespace inside a literal is advisory, not exact: ICU separates `02:30` from `PM`\n * with a NARROW NO-BREAK SPACE (U+202F) and no keyboard emits one, so every whitespace\n * run matches `\\s*`. A literal that is nothing BUT whitespace keeps `\\s+` — relaxing it\n * there would let `15 2026` also read as `152026`, which is how a lenient parser invents\n * a date nobody typed.\n */\nfunction literalToRegex(literal: string): string {\n const text = stripBidi(literal);\n if (!text) return '';\n if (!text.trim()) return '\\\\s+';\n return text.split(/\\s+/).map(escapeRegex).join('\\\\s*');\n}\n\n/**\n * Longest first, so `March` is never consumed as `Mar` with `ch` left over.\n *\n * Whitespace inside a name is loosened the way {@link literalToRegex} loosens it in a\n * literal: es and ca write the day period as `p. m.`, and V8 puts U+0020 there in\n * `format()` while `formatToParts()` — which this alternation is built from — keeps\n * U+202F, so an exact name could not read the string the same formatter printed.\n */\nfunction alternation(names: readonly string[]): string {\n return [...new Set(names)]\n .sort((a, b) => b.length - a.length)\n .map(name => stripBidi(name).split(/\\s+/u).map(escapeRegex).join('\\\\s*'))\n .join('|');\n}\n\n/**\n * The comparison key for a captured name: case, bidi marks and whitespace dropped, so\n * `p.m.`, `p. m.` and `p.` U+202F `m.` are one day period — the same leniency the regex\n * from {@link alternation} granted when it matched.\n */\nfunction nameKey(name: string): string {\n return stripBidi(name).replace(/\\s+/gu, '').toLowerCase();\n}\n\n/**\n * The ten digits a locale's numbering system writes, index 0 to 9 — `null` when the\n * system is algorithmic (roman, hebrew) and there is no digit-by-digit reading to do.\n */\nfunction numeralsFor(locale: string, numberingSystem: string): readonly string[] | null {\n let formatter: Intl.NumberFormat;\n try {\n formatter = new Intl.NumberFormat(locale, { numberingSystem, useGrouping: false });\n } catch {\n return null;\n }\n const digits: string[] = [];\n for (let i = 0; i < 10; i++) {\n const digit = formatter.format(i);\n if ([...digit].length !== 1 || digits.includes(digit)) return null;\n digits.push(digit);\n }\n return digits;\n}\n\n/** A character class accepting the locale's own digits AND ASCII ones. */\nfunction digitClass(numerals: readonly string[]): string {\n const extra = numerals\n .filter(digit => digit < '0' || digit > '9')\n .map(digit => `\\\\u${digit.codePointAt(0)!.toString(16).padStart(4, '0')}`)\n .join('');\n return `[0-9${extra}]`;\n}\n\n/** `١٥` to `15`, and ASCII through unchanged. `NaN` for anything else. */\nfunction digitsToNumber(text: string, numerals: readonly string[]): number {\n let out = '';\n for (const ch of text) {\n if (ch >= '0' && ch <= '9') {\n out += ch;\n continue;\n }\n const index = numerals.indexOf(ch);\n if (index < 0) return Number.NaN;\n out += String(index);\n }\n return out ? Number(out) : Number.NaN;\n}\n\nfunction isAllDigits(text: string, numerals: readonly string[]): boolean {\n return text.length > 0 && !Number.isNaN(digitsToNumber(text, numerals));\n}\n\n/** What one capture group of a named-format parser holds. */\ninterface NamedField {\n readonly kind: 'year' | 'month' | 'monthName' | 'day' | 'hour' | 'minute' | 'second' | 'dayPeriod';\n /** Month names (12) or day-period names (`[am, pm]`), matched case-insensitively. */\n readonly names?: readonly string[];\n}\n\ninterface NamedParser {\n readonly regex: RegExp;\n readonly fields: readonly NamedField[];\n readonly numerals: readonly string[];\n readonly hourCycle: string | undefined;\n}\n\n/** Everything the native adapter keeps for one locale. */\ninterface LocaleCache {\n readonly locale: string;\n readonly formatters: Map<string, Intl.DateTimeFormat>;\n readonly monthNames: Map<string, readonly string[]>;\n readonly namedParsers: Map<WrDateFormat, NamedParser | null>;\n numerals: readonly string[] | null;\n dayPeriods: readonly [string, string] | null;\n}\n\n/** The parts assembled into a `Date`, whatever route read them. */\ninterface DateParts {\n year?: number;\n month?: number;\n day?: number;\n hours?: number;\n minutes?: number;\n seconds?: number;\n hour12?: number;\n isPm?: boolean;\n}\n\nconst SHORT_DATE: Intl.DateTimeFormatOptions = { year: 'numeric', month: 'numeric', day: 'numeric' };\nconst CLOCK: Intl.DateTimeFormatOptions = { hour: '2-digit', minute: '2-digit' };\nconst SECONDS: Intl.DateTimeFormatOptions = { second: '2-digit' };\n/**\n * `hourCycle` rather than `hour12`. `hour12: false` leaves the engine to choose\n * between `h23` and `h24`, and some resolved it to `h24`, writing midnight as\n * `24:00`; `hour12` also overrides `hourCycle` when both are set. So the pinned\n * variants name exactly the cycle they mean.\n */\nconst H12: Intl.DateTimeFormatOptions = { hourCycle: 'h12' };\nconst H23: Intl.DateTimeFormatOptions = { hourCycle: 'h23' };\n\nconst INTL_OPTIONS: Readonly<Record<WrDateFormat, Intl.DateTimeFormatOptions>> = {\n shortDate: SHORT_DATE,\n mediumDate: { year: 'numeric', month: 'short', day: 'numeric' },\n longDate: { year: 'numeric', month: 'long', day: 'numeric' },\n time: CLOCK,\n time12h: { ...CLOCK, ...H12 },\n time24h: { ...CLOCK, ...H23 },\n timeSeconds: { ...CLOCK, ...SECONDS },\n time12hSeconds: { ...CLOCK, ...SECONDS, ...H12 },\n time24hSeconds: { ...CLOCK, ...SECONDS, ...H23 },\n shortDateTime: { ...SHORT_DATE, ...CLOCK },\n shortDateTime12h: { ...SHORT_DATE, ...CLOCK, ...H12 },\n shortDateTime24h: { ...SHORT_DATE, ...CLOCK, ...H23 },\n shortDateTimeSeconds: { ...SHORT_DATE, ...CLOCK, ...SECONDS },\n shortDateTime12hSeconds: { ...SHORT_DATE, ...CLOCK, ...SECONDS, ...H12 },\n shortDateTime24hSeconds: { ...SHORT_DATE, ...CLOCK, ...SECONDS, ...H23 },\n mediumDateTime: { year: 'numeric', month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' },\n};\n\n/** Every named key, read off the table so the two cannot disagree. */\nconst NAMED_KEYS: ReadonlySet<string> = new Set(Object.keys(INTL_OPTIONS));\n\n/** Recognised tokens, longest first so `MMMM` matches before `MMM`. */\n/**\n * Every token, with single-quoted runs taken FIRST so they win.\n *\n * Without that, the one-letter tokens match letters inside literal text: `'yyyy [year]'`\n * came out as `2025 [yeamr]`, because the `a` in \"year\" was read as the meridiem token.\n * Quote literals the way `DatePipe` and LDML do — `'at'` — and `''` for a real quote,\n * inside a run as well as outside one: `h 'o''clock'` is `6 o'clock`.\n */\nconst PART_RE = /'((?:[^']|'')*)'|yyyy|yy|MMMM|MMM|MM|M|dd|d|HH|H|hh|h|mm|ss|a/g;\n\n/** The text a quoted run stands for: `''` alone is one quote, and so is `''` inside a run. */\nfunction unquote(quoted: string): string {\n return quoted === '' ? \"'\" : quoted.replaceAll(\"''\", \"'\");\n}\n\nfunction pad(n: number, width = 2): string {\n return String(Math.abs(n)).padStart(width, '0');\n}\n\n/** Whether `value` is one of the shared named format keys. */\nfunction wrIsNamedFormat(value: string): value is WrDateFormat {\n return NAMED_KEYS.has(value);\n}\n\n/**\n * `digits` is a character class rather than `\\d`, and it always accepts ASCII as well as\n * the locale's own numerals. The token formatter WRITES ASCII, so the round trip never\n * needed more — but a reader on an Arabic keyboard types `١٥` into the same field, and\n * `\\d` made that silently unparseable with no feedback anywhere.\n */\nfunction tokenToRegex(token: string, digits: string): string {\n switch (token) {\n case 'yyyy':\n return `(${digits}{4})`;\n case 'yy':\n return `(${digits}{2})`;\n case 'MM':\n case 'dd':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n return `(${digits}{2})`;\n case 'M':\n case 'd':\n case 'H':\n case 'h':\n return `(${digits}{1,2})`;\n case 'a':\n return '(am|pm|AM|PM)';\n default:\n return '(.+)';\n }\n}\n\n/**\n * Abstraction over a date object so the calendar, date picker and time picker\n * can work with `Date` or any other library a consumer prefers — without\n * changing component code.\n *\n * Injected with nothing provided it is {@link WrNativeDateAdapter} (native\n * `Date`, `Intl.DateTimeFormat`, the locale from {@link wrDateLocale}), so the\n * date components need no provider. For another library, subclass this,\n * decorate the subclass with `@Service()` and register it via\n * `provideWr(withDates({ adapter: MyAdapter }))`. An undecorated subclass still\n * resolves, but Angular warns in dev mode that it inherits this class's\n * injectable definition.\n *\n * Used as both the type and the DI token — `inject(WrDateAdapter)` works\n * directly thanks to Angular's class-as-token resolution.\n *\n * Every \"mutating\" method (`addX`, `setTime`) returns a **new** value;\n * adapters never mutate in place so consumers can pass dates around safely.\n */\n@Injectable({\n providedIn: 'root',\n // The native subclass is declared further down this module, so it is reached\n // through a `forwardRef` — the shape Angular's own `DomSanitizer` has. Both\n // classes share the module because a base importing the file that extends it\n // is a cycle that fails at evaluation. `@Injectable` rather than\n // `@Service({ factory })`: a `@Service` factory ignores the type it is asked\n // to build, so an undecorated subclass passed to `withDates()` would\n // quietly come back as the native adapter instead of itself.\n // eslint-disable-next-line @angular-eslint/no-forward-ref\n useExisting: forwardRef(() => WrNativeDateAdapter),\n})\nexport abstract class WrDateAdapter<TDate = Date> {\n // Construction & identity\n\n /** Current moment. */\n abstract today(): TDate;\n\n /** Defensive clone — must return an independent value, never the same reference. */\n abstract clone(date: TDate): TDate;\n\n /** Build a date from year / month (0-based) / day. */\n abstract createDate(year: number, month: number, day: number): TDate;\n\n /** `false` for `NaN` / invalid input. */\n abstract isValid(date: TDate): boolean;\n\n // Accessors\n\n abstract getYear(date: TDate): number;\n /** `0` (January) – `11` (December). */\n abstract getMonth(date: TDate): number;\n /** Day of the month, `1`-`31`. */\n abstract getDate(date: TDate): number;\n /** `0` (Sunday) – `6` (Saturday). */\n abstract getDayOfWeek(date: TDate): number;\n abstract getDaysInMonth(date: TDate): number;\n abstract getHours(date: TDate): number;\n abstract getMinutes(date: TDate): number;\n abstract getSeconds(date: TDate): number;\n\n // Immutable math\n\n abstract addYears(date: TDate, amount: number): TDate;\n abstract addMonths(date: TDate, amount: number): TDate;\n abstract addDays(date: TDate, amount: number): TDate;\n /** Returns a new date with the time portion replaced. */\n abstract setTime(date: TDate, hours: number, minutes: number, seconds: number): TDate;\n\n // Comparison\n\n abstract isSameDay(a: TDate, b: TDate): boolean;\n abstract isSameMonth(a: TDate, b: TDate): boolean;\n /** Negative if `a < b`, positive if `a > b`, zero if equal (compared at day precision). */\n abstract compareDate(a: TDate, b: TDate): number;\n\n /**\n * Convenience used by the calendar's range UI. Inclusive on both ends.\n * Implementation can stay on the base class because it delegates to\n * `compareDate`.\n */\n isWithinRange(date: TDate, start: TDate, end: TDate): boolean {\n return this.compareDate(date, start) >= 0 && this.compareDate(date, end) <= 0;\n }\n\n // Formatting / parsing\n\n /**\n * Format a date. Accepts either a named {@link WrDateFormat} key (which the\n * adapter resolves locale-aware) or a raw format string (`'dd.MM.yyyy'`).\n *\n * **Every named key is part of the contract**, the time variants included:\n * `time12h` / `time24h` pin the hour cycle, `timeSeconds` adds seconds, and the\n * same suffixes apply to `shortDateTime` (see {@link WrDateFormat}). The date\n * picker asks for them from its `timeFormat` and `showSeconds` inputs, so an\n * adapter that treats one as a raw pattern prints its letters into the field.\n * v15 added them; an adapter written for v14 has to handle them.\n *\n * Supported tokens for raw strings: `yyyy`, `yy`, `MMMM`, `MMM`, `MM`, `M`,\n * `dd`, `d`, `HH`, `H`, `hh`, `h`, `mm`, `ss`, `a` (the locale's day-period\n * marker — `PM`, `م`, `午後`).\n *\n * `MMMM` / `MMM` take the form the language uses in the position the pattern\n * puts them: beside a day token a case language declines the month (ru writes\n * `15 марта`, not `15 март`), and on their own they stay nominative, which is\n * what a calendar heading wants.\n */\n abstract format(date: TDate, formatKeyOrString: WrDateFormat | (string & {})): string;\n\n /**\n * Parse a string into a date. Returns `null` when parsing fails. Accepts\n * the same `formatKeyOrString` set as {@link format}.\n *\n * **The round trip is a contract, not an aspiration**: whatever {@link format}\n * writes for a given key, `parse` reads back to the same date. A caller relies\n * on it every keystroke — the picker re-parses what it printed — and returning\n * `null` is how an adapter refuses, which leaves the caller's committed value\n * exactly as it was.\n */\n abstract parse(value: string, formatKeyOrString: WrDateFormat | (string & {})): TDate | null;\n\n /**\n * This adapter for instants: every accessor, `createDate`, the math, `format`\n * and `parse` read a date on the wall clock of the display time zone\n * (`withDates({ timeZone })`) instead of the browser's. The adapter itself\n * keeps reading the browser's zone, because a calendar day has no zone: the\n * 12th picked in a date-only field is the 12th wherever it is shown.\n *\n * `wrDate`, `wr-date-stamp` and the pickers' modes with a time ask for it.\n * The base class returns itself, so an adapter that does not override this\n * shows every date in the browser's zone.\n */\n zoned(): WrDateAdapter<TDate> {\n return this;\n }\n\n /**\n * What `format` writes in besides its arguments, as one string: the locale,\n * and the time zone on the {@link zoned} adapter. Equal keys mean equal\n * output, so a caller that keeps a formatted string compares keys instead of\n * formatting again. The native adapter reads its signals here: called in a\n * template, a `computed` or an `effect`, it re-runs them when either moves.\n */\n displayKey(): string {\n return '';\n }\n\n // Locale info\n\n /** `0` Sunday, `1` Monday — locale-dependent. */\n abstract getFirstDayOfWeek(): number;\n\n /** Names ordered from `getFirstDayOfWeek()` onwards. Length 7. */\n abstract getDayOfWeekNames(style: 'narrow' | 'short' | 'long'): readonly string[];\n\n /** Names from January (index `0`) to December (`11`). Length 12. */\n abstract getMonthNames(style: 'narrow' | 'short' | 'long'): readonly string[];\n}\n\n/**\n * Reference {@link WrDateAdapter} implementation backed by the native `Date`\n * object and `Intl.DateTimeFormat`. Zero external dependencies, the only\n * adapter ngwr ships, and what `inject(WrDateAdapter)` returns when nothing is\n * provided. An app that needs timezone-aware math or richer parsing subclasses\n * {@link WrDateAdapter} over its own date library instead.\n */\n@Service()\nexport class WrNativeDateAdapter extends WrDateAdapter<Date> {\n private readonly localeSource = wrDateLocale();\n private cache: LocaleCache | null = null;\n\n /**\n * What is kept for the current locale, and the locale with it. A signal read,\n * so what formats in a reactive context follows a language switch; the switch\n * drops everything kept for the locale before it.\n */\n private caches(): LocaleCache {\n const locale = this.localeSource();\n if (this.cache?.locale !== locale) {\n this.cache = {\n locale,\n formatters: new Map(),\n monthNames: new Map(),\n namedParsers: new Map(),\n numerals: null,\n dayPeriods: null,\n };\n }\n return this.cache;\n }\n\n private get locale(): string {\n return this.caches().locale;\n }\n\n private readonly zoneSource = inject(WR_DATE_TIME_ZONE);\n private readonly injector = inject(Injector);\n\n /** Whether this instance is the one {@link zoned} hands out. */\n private zonal = false;\n private zonedSelf: WrNativeDateAdapter | null = null;\n\n /**\n * A second instance of the same class, so an app's subclass keeps its\n * overrides. With no `timeZone` option at all it is this instance.\n */\n override zoned(): WrDateAdapter<Date> {\n if (this.zonal || !this.zoneSource) return this;\n this.zonedSelf ??= runInInjectionContext(this.injector, () => {\n const zoned = new (this.constructor as new () => WrNativeDateAdapter)();\n zoned.zonal = true;\n return zoned;\n });\n return this.zonedSelf;\n }\n\n override displayKey(): string {\n return `${this.locale}|${this.zonal ? (this.zone()?.id ?? '') : ''}`;\n }\n\n private zone(): WrResolvedZone | null {\n return wrResolveZone(this.zoneSource?.());\n }\n\n private wallZone: WrResolvedZone | null = null;\n private readonly walls = new Map<number, number>();\n\n /**\n * The date on the display zone's wall clock, as a `Date` read with the UTC\n * getters, or `null` on the adapter that reads the browser's zone. Reading a\n * named zone costs an `Intl` call and a month grid asks for the same day many\n * times over, so those are kept.\n */\n private wall(date: Date): Date | null {\n if (!this.zonal) return null;\n const zone = this.zone();\n const time = date.getTime();\n if (zone?.kind !== 'iana' || Number.isNaN(time)) return new Date(wrZoneWallTime(time, zone));\n if (this.wallZone !== zone || this.walls.size > 512) {\n this.walls.clear();\n this.wallZone = zone;\n }\n let wall = this.walls.get(time);\n if (wall === undefined) {\n wall = wrZoneWallTime(time, zone);\n this.walls.set(time, wall);\n }\n return new Date(wall);\n }\n\n /** The instant a wall clock from {@link wall} names. */\n private instant(wall: Date): Date {\n return new Date(wrZoneInstant(wall.getTime(), this.zone()));\n }\n\n // Construction & identity\n\n today(): Date {\n return new Date();\n }\n\n clone(date: Date): Date {\n return new Date(date.getTime());\n }\n\n createDate(year: number, month: number, day: number): Date {\n if (this.zonal) return this.instant(new Date(wrUtcTime(year, month, day)));\n // Native Date constructor with year < 100 maps to 1900 + year unless we explicitly setFullYear.\n const d = new Date(year, month, day);\n if (year >= 0 && year < 100) d.setFullYear(year);\n return d;\n }\n\n isValid(date: Date): boolean {\n return date instanceof Date && !Number.isNaN(date.getTime());\n }\n\n // Accessors\n\n getYear(date: Date): number {\n return this.wall(date)?.getUTCFullYear() ?? date.getFullYear();\n }\n\n getMonth(date: Date): number {\n return this.wall(date)?.getUTCMonth() ?? date.getMonth();\n }\n\n getDate(date: Date): number {\n return this.wall(date)?.getUTCDate() ?? date.getDate();\n }\n\n getDayOfWeek(date: Date): number {\n return this.wall(date)?.getUTCDay() ?? date.getDay();\n }\n\n getDaysInMonth(date: Date): number {\n return new Date(this.getYear(date), this.getMonth(date) + 1, 0).getDate();\n }\n\n getHours(date: Date): number {\n return this.wall(date)?.getUTCHours() ?? date.getHours();\n }\n\n getMinutes(date: Date): number {\n return this.wall(date)?.getUTCMinutes() ?? date.getMinutes();\n }\n\n getSeconds(date: Date): number {\n return this.wall(date)?.getUTCSeconds() ?? date.getSeconds();\n }\n\n // Immutable math\n\n addYears(date: Date, amount: number): Date {\n const wall = this.wall(date);\n if (wall) {\n wall.setUTCFullYear(wall.getUTCFullYear() + amount);\n return this.instant(wall);\n }\n const d = this.clone(date);\n d.setFullYear(d.getFullYear() + amount);\n return d;\n }\n\n addMonths(date: Date, amount: number): Date {\n const wall = this.wall(date);\n if (wall) {\n const day = wall.getUTCDate();\n wall.setUTCDate(1);\n wall.setUTCMonth(wall.getUTCMonth() + amount);\n wall.setUTCDate(Math.min(day, new Date(wall.getUTCFullYear(), wall.getUTCMonth() + 1, 0).getDate()));\n return this.instant(wall);\n }\n const d = this.clone(date);\n const desiredDay = d.getDate();\n d.setDate(1);\n d.setMonth(d.getMonth() + amount);\n // Clamp day to the new month's length (Jan 31 + 1 month → Feb 28/29).\n d.setDate(Math.min(desiredDay, this.getDaysInMonth(d)));\n return d;\n }\n\n addDays(date: Date, amount: number): Date {\n // A calendar day, not 86 400 000 ms. Where daylight saving applies a day can be 23 or\n // 25 hours long, so millisecond arithmetic drifts the wall clock and — across an\n // autumn change — lands back on the same calendar date, which makes a month grid\n // repeat a day and lose one. Not observable in a fixed-offset timezone, which is why\n // the reason lives here rather than only in a test.\n const wall = this.wall(date);\n if (wall) {\n wall.setUTCDate(wall.getUTCDate() + amount);\n return this.instant(wall);\n }\n const d = this.clone(date);\n d.setDate(d.getDate() + amount);\n return d;\n }\n\n setTime(date: Date, hours: number, minutes: number, seconds: number): Date {\n const wall = this.wall(date);\n if (wall) {\n wall.setUTCHours(hours, minutes, seconds, 0);\n return this.instant(wall);\n }\n const d = this.clone(date);\n d.setHours(hours, minutes, seconds, 0);\n return d;\n }\n\n // Comparison\n\n isSameDay(a: Date, b: Date): boolean {\n return this.compareDate(a, b) === 0;\n }\n\n isSameMonth(a: Date, b: Date): boolean {\n return this.getYear(a) === this.getYear(b) && this.getMonth(a) === this.getMonth(b);\n }\n\n compareDate(a: Date, b: Date): number {\n const ay = this.getYear(a);\n const by = this.getYear(b);\n if (ay !== by) return ay - by;\n const am = this.getMonth(a);\n const bm = this.getMonth(b);\n if (am !== bm) return am - bm;\n return this.getDate(a) - this.getDate(b);\n }\n\n // Formatting / parsing\n\n // `(string & {})` keeps autocomplete for the WrDateFormat literals\n // while still accepting any other string as a raw token pattern.\n format(date: Date, formatKeyOrString: WrDateFormat | (string & {})): string {\n if (wrIsNamedFormat(formatKeyOrString)) {\n const wall = this.wall(date);\n return wall ? this.intl(formatKeyOrString, true).format(wall) : this.intl(formatKeyOrString).format(date);\n }\n return this.formatWithTokens(date, formatKeyOrString);\n }\n\n /**\n * Read back what {@link format} wrote.\n *\n * A named format used to delegate to `new Date(raw)`, which understands only\n * Anglo-American forms — so the field could not read its own output anywhere else.\n * `new Date('15.3.2026')` and `new Date('14:30')` are both `Invalid Date`, while\n * `new Date('1')` is 1 January 2001: retyping a de-DE date committed the year 2001 on\n * the first keystroke and then refused every one after it, and `mode=\"time\"` collapsed\n * to midnight in EVERY locale, en-US included. The named branch now builds its parser\n * from the SAME `Intl.DateTimeFormat` that printed the string, so the round trip holds\n * by construction rather than by luck.\n *\n * Returns `null` rather than a guess whenever the string does not match — the caller's\n * committed value is then left exactly as it was, which is the contract\n * `wr-input-number` follows for unparseable text.\n */\n parse(value: string, formatKeyOrString: WrDateFormat | (string & {})): Date | null {\n const raw = value?.trim();\n if (!raw) return null;\n\n if (wrIsNamedFormat(formatKeyOrString)) {\n return this.parseNamed(raw, formatKeyOrString);\n }\n\n return this.parseWithTokens(raw, formatKeyOrString);\n }\n\n // Locale info\n\n getFirstDayOfWeek(): number {\n // `Intl.Locale.prototype.getWeekInfo` is Stage 3 — not in TS lib types yet,\n // so we probe at runtime through an unknown cast.\n try {\n const locale = new Intl.Locale(this.locale) as unknown as { getWeekInfo?: () => { firstDay: number } };\n const info = locale.getWeekInfo?.();\n if (info && typeof info.firstDay === 'number') {\n // Intl uses 1 (Mon) – 7 (Sun); we use 0 (Sun) – 6 (Sat).\n return info.firstDay % 7;\n }\n } catch {\n // Browser doesn't support Intl.Locale or getWeekInfo — fall through.\n }\n return this.locale.toLowerCase().startsWith('en-us') ? 0 : 1;\n }\n\n /**\n * One `Intl.DateTimeFormat` per named format, built once.\n *\n * Constructing one is the expensive part of `format()`, and this adapter is\n * called per CELL: `wr-event-calendar` builds an `aria-label` for every time\n * slot on every day, so a week view asked for hundreds of identical\n * formatters. They are kept per locale, in {@link caches}.\n */\n\n /**\n * Every `Intl` call this adapter makes pins `calendar: 'gregory'`, and that is a\n * correctness fix rather than a preference.\n *\n * The value type is a JS `Date`, every accessor on this class (`getYear`,\n * `getMonth`, `getDate`) is Gregorian, `createDate` builds a Gregorian date and the\n * calendar grid draws Gregorian months. A locale whose DEFAULT calendar is something\n * else — `fa-IR` resolves to `persian`, `th-TH` to `buddhist`, `ar-SA` to\n * `islamic-umalqura` in several engines — printed a field the grid beside it could\n * never agree with (`۱۴۰۴/۱۲/۲۴` over a grid headed 2026), and no parser can turn\n * that back into the `Date` it came from. Pinning the calendar makes format and parse\n * describe the same one.\n */\n private intlOptions(options: Intl.DateTimeFormatOptions): Intl.DateTimeFormatOptions {\n return { ...options, calendar: 'gregory' };\n }\n\n /** `utc` is the formatter a wall clock from {@link wall} is printed with. */\n private intl(key: WrDateFormat, utc = false): Intl.DateTimeFormat {\n const { locale, formatters } = this.caches();\n const cacheKey = utc ? `utc:${key}` : key;\n let found = formatters.get(cacheKey);\n if (!found) {\n const options = this.intlOptions(INTL_OPTIONS[key]);\n found = new Intl.DateTimeFormat(locale, utc ? { ...options, timeZone: 'UTC' } : options);\n formatters.set(cacheKey, found);\n }\n return found;\n }\n\n getDayOfWeekNames(style: 'narrow' | 'short' | 'long'): readonly string[] {\n const formatter = new Intl.DateTimeFormat(this.locale, this.intlOptions({ weekday: style }));\n const first = this.getFirstDayOfWeek();\n // Pick a reference Sunday and walk seven days.\n const base = new Date(2024, 0, 7); // Sunday 7 Jan 2024\n const out: string[] = [];\n for (let i = 0; i < 7; i++) {\n const d = new Date(base);\n d.setDate(base.getDate() + ((first + i) % 7));\n out.push(formatter.format(d));\n }\n return out;\n }\n\n /**\n * Month names in the STANDALONE (nominative) form — what a calendar heading wants.\n * Inside a date the same name often declines; {@link monthNames} serves that form to\n * the token formatter, and this method deliberately keeps the heading one.\n */\n getMonthNames(style: 'narrow' | 'short' | 'long'): readonly string[] {\n return this.monthNames(style, 'standalone');\n }\n\n /** The locale's own ten digits, cached — empty when its system is algorithmic. */\n private localeNumerals(): readonly string[] {\n const cache = this.caches();\n cache.numerals ??=\n numeralsFor(cache.locale, new Intl.NumberFormat(cache.locale).resolvedOptions().numberingSystem) ?? [];\n return cache.numerals;\n }\n\n /**\n * `[am, pm]` as the LOCALE writes them — `PM`, `م`, `午後`.\n *\n * The `a` token used to return a hard-coded lowercase `pm`, byte for byte identical in\n * every locale, which made it the one token in the pattern language that could not be\n * localised at all. `Intl` is the source rather than the i18n catalog because\n * `ngwr/date` deliberately depends on nothing: the panel next to it reads\n * `datePicker.am` / `datePicker.pm`, so an app that wants its own wording overrides it\n * there and passes a 24-hour pattern here.\n */\n private dayPeriods(): readonly [string, string] {\n const cache = this.caches();\n if (cache.dayPeriods) return cache.dayPeriods;\n let periods: [string, string] = ['AM', 'PM'];\n try {\n const formatter = new Intl.DateTimeFormat(cache.locale, this.intlOptions({ hour: 'numeric', hour12: true }));\n const read = (hour: number): string =>\n formatter.formatToParts(new Date(2024, 0, 15, hour)).find(p => p.type === 'dayPeriod')?.value ?? '';\n const [am, pm] = [read(9), read(21)];\n if (am && pm && am !== pm) periods = [am, pm];\n } catch {\n // No `Intl` day period for this locale — the English pair stays.\n }\n cache.dayPeriods = periods;\n return periods;\n }\n\n /**\n * `context: 'format'` asks `Intl` for the month name as it appears BESIDE A DAY, which\n * is where a case language stops using the nominative: ru writes `15 марта`, not\n * `15 март`, and fi writes `maaliskuuta`, not `maaliskuu`. The name comes out of a\n * `{ day, month }` formatter's parts, because a `{ month }` formatter alone can only\n * ever answer with the standalone form.\n *\n * Some locales write the month NUMERICALLY in that position — fi abbreviates `15.3.`,\n * ja writes `3` with `月` as a separate literal — and there the standalone name is the\n * only name there is, so a purely numeric answer falls back to it. Without that guard\n * `dd MMMM yyyy` would render `15 3 2026` in Japanese.\n */\n private monthNames(style: 'narrow' | 'short' | 'long', context: 'standalone' | 'format'): readonly string[] {\n const { locale, monthNames } = this.caches();\n const cacheKey = `${style}:${context}`;\n const cached = monthNames.get(cacheKey);\n if (cached) return cached;\n\n const standaloneFormatter = new Intl.DateTimeFormat(locale, this.intlOptions({ month: style }));\n const standalone: string[] = [];\n for (let i = 0; i < 12; i++) standalone.push(standaloneFormatter.format(new Date(2024, i, 15)));\n\n let out: readonly string[] = standalone;\n if (context === 'format') {\n const numerals = numeralsFor(locale, standaloneFormatter.resolvedOptions().numberingSystem) ?? [];\n const inDate = new Intl.DateTimeFormat(locale, this.intlOptions({ day: 'numeric', month: style }));\n out = standalone.map((name, i) => {\n const part = inDate.formatToParts(new Date(2024, i, 15)).find(p => p.type === 'month')?.value;\n if (!part || isAllDigits(part, numerals)) return name;\n return part;\n });\n }\n\n monthNames.set(cacheKey, out);\n return out;\n }\n\n // Internals: token-based format / parse\n\n /** Whether a token pattern also writes the day, which decides the month's form. */\n private hasDayToken(pattern: string): boolean {\n let found = false;\n pattern.replace(PART_RE, (part: string, quoted?: string) => {\n if (quoted === undefined && (part === 'd' || part === 'dd')) found = true;\n return part;\n });\n return found;\n }\n\n private formatWithTokens(date: Date, pattern: string): string {\n const wall = this.wall(date);\n const year = wall ? wall.getUTCFullYear() : date.getFullYear();\n const month = wall ? wall.getUTCMonth() : date.getMonth();\n const day = wall ? wall.getUTCDate() : date.getDate();\n const hours24 = wall ? wall.getUTCHours() : date.getHours();\n const hours12 = hours24 % 12 === 0 ? 12 : hours24 % 12;\n const minutes = wall ? wall.getUTCMinutes() : date.getMinutes();\n const seconds = wall ? wall.getUTCSeconds() : date.getSeconds();\n // A pattern that writes the day wants the month declined for that position — `MMMM`\n // used to hand `15 март 2026` to a Russian field, which reads as machine output.\n const context = this.hasDayToken(pattern) ? 'format' : 'standalone';\n const monthNames = this.monthNames('long', context);\n const monthShort = this.monthNames('short', context);\n\n return pattern.replace(PART_RE, (part, quoted?: string) => {\n // A quoted run is emitted as-is; `''` is how a single quote is written.\n if (quoted !== undefined) return unquote(quoted);\n const token = part;\n switch (token) {\n case 'yyyy':\n return pad(year, 4);\n case 'yy':\n return pad(year % 100, 2);\n case 'MMMM':\n return monthNames[month] ?? '';\n case 'MMM':\n return monthShort[month] ?? '';\n case 'MM':\n return pad(month + 1);\n case 'M':\n return String(month + 1);\n case 'dd':\n return pad(day);\n case 'd':\n return String(day);\n case 'HH':\n return pad(hours24);\n case 'H':\n return String(hours24);\n case 'hh':\n return pad(hours12);\n case 'h':\n return String(hours12);\n case 'mm':\n return pad(minutes);\n case 'ss':\n return pad(seconds);\n case 'a':\n return this.dayPeriods()[hours24 < 12 ? 0 : 1];\n }\n return token;\n });\n }\n\n private parseWithTokens(value: string, pattern: string): Date | null {\n const tokens: string[] = [];\n // Both forms are accepted on the way IN: the formatter writes the declined one beside\n // a day (`15 марта`), and a heading or an older stored string carries the nominative.\n const monthLong = [this.monthNames('long', 'format'), this.monthNames('long', 'standalone')];\n const monthShort = [this.monthNames('short', 'format'), this.monthNames('short', 'standalone')];\n const numerals = this.localeNumerals();\n const digits = digitClass(numerals);\n const escaped = pattern.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n const regex = escaped.replace(PART_RE, (part, quoted?: string) => {\n if (quoted !== undefined) {\n // Literal text matches itself and captures nothing, so the token indices stay\n // aligned with the groups below.\n return unquote(quoted);\n }\n tokens.push(part);\n // `a` is the one token whose text is locale-dependent, so its alternation is built\n // here rather than in the pure `tokenToRegex`: the marker this adapter now PRINTS\n // has to be one the same adapter can read.\n if (part === 'a') return `(${alternation([...this.dayPeriods(), 'am', 'pm'])})`;\n return tokenToRegex(part, digits);\n });\n\n const match = new RegExp(`^${regex}$`, 'i').exec(value);\n if (!match) return null;\n\n const parts: DateParts = {};\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n const raw = match[i + 1];\n const n = digitsToNumber(raw, numerals);\n switch (token) {\n case 'yyyy':\n parts.year = n;\n break;\n case 'yy':\n parts.year = 2000 + n;\n break;\n case 'MM':\n case 'M':\n parts.month = n - 1;\n break;\n case 'MMM':\n case 'MMMM': {\n const sets = token === 'MMM' ? monthShort : monthLong;\n const wanted = nameKey(raw);\n const found = sets.map(names => names.findIndex(name => nameKey(name) === wanted)).find(index => index >= 0);\n if (found === undefined) return null;\n parts.month = found;\n break;\n }\n case 'dd':\n case 'd':\n parts.day = n;\n break;\n case 'HH':\n case 'H':\n parts.hours = n;\n break;\n case 'hh':\n case 'h':\n parts.hour12 = n;\n break;\n case 'mm':\n parts.minutes = n;\n break;\n case 'ss':\n parts.seconds = n;\n break;\n case 'a': {\n const marker = nameKey(raw);\n parts.isPm = marker === 'pm' || marker === nameKey(this.dayPeriods()[1]);\n break;\n }\n }\n }\n\n return this.compose(parts);\n }\n\n /**\n * Build the parser for one named format out of the very formatter that prints it.\n *\n * `formatToParts` is the only honest source for a locale's field ORDER and its\n * literals — ru writes `dd.MM.y` with a two-digit month while its own\n * `{ month: 'numeric' }` request says one digit, ja puts the year first, and ar-SA\n * separates fields with U+200F. Names (a month, AM/PM) become an alternation of the\n * real strings; numbers accept the locale's digits AND ASCII, because a physical\n * keyboard produces the latter whatever the display shows.\n *\n * Returns `null` — meaning \"this format cannot be read back\" — rather than guessing,\n * for a field type nothing here asks for (an era, a weekday) or a numbering system\n * with no digit-by-digit reading (roman numerals). `parse` then refuses, which leaves\n * the caller's committed value untouched.\n */\n private buildNamedParser(key: WrDateFormat): NamedParser | null {\n const formatter = this.intl(key);\n const resolved = formatter.resolvedOptions();\n const numerals = numeralsFor(this.locale, resolved.numberingSystem);\n if (!numerals) return null;\n const digits = digitClass(numerals);\n\n // Distinct values in every field, so nothing below can read one field's reference\n // value out of another's position.\n const reference = new Date(2024, 0, 15, 13, 45, 56);\n const fields: NamedField[] = [];\n const fragments: { readonly source: string; readonly literal: boolean }[] = [];\n\n for (const part of formatter.formatToParts(reference)) {\n switch (part.type) {\n case 'literal':\n fragments.push({ source: literalToRegex(part.value), literal: true });\n break;\n case 'year':\n fields.push({ kind: 'year' });\n // Exactly two digits or exactly four — the shapes a year is actually written\n // in. `{1,4}` would let the third keystroke of `15.3.2026` read as the year 2\n // and commit it, which is a smaller version of the defect this replaces.\n fragments.push({ source: `(${digits}{2}|${digits}{4})`, literal: false });\n break;\n case 'month': {\n const names = this.namedMonthNames(formatter);\n if (names.every(name => isAllDigits(name, numerals))) {\n fields.push({ kind: 'month' });\n fragments.push({ source: `(${digits}{1,2})`, literal: false });\n } else {\n fields.push({ kind: 'monthName', names });\n fragments.push({ source: `(${alternation(names)})`, literal: false });\n }\n break;\n }\n case 'day':\n fields.push({ kind: 'day' });\n fragments.push({ source: `(${digits}{1,2})`, literal: false });\n break;\n case 'hour':\n fields.push({ kind: 'hour' });\n fragments.push({ source: `(${digits}{1,2})`, literal: false });\n break;\n case 'minute':\n fields.push({ kind: 'minute' });\n fragments.push({ source: `(${digits}{1,2})`, literal: false });\n break;\n case 'second':\n fields.push({ kind: 'second' });\n fragments.push({ source: `(${digits}{1,2})`, literal: false });\n break;\n case 'dayPeriod': {\n const names = this.dayPeriodNames(formatter);\n fields.push({ kind: 'dayPeriod', names });\n fragments.push({ source: `(${alternation(names)})`, literal: false });\n break;\n }\n default:\n return null;\n }\n }\n\n if (!fields.length) return null;\n\n // A trailing literal is optional. ru's medium date ends ` г.` and fi's short date\n // ends with a bare `.`; someone retyping the field types the fields and stops, and\n // refusing that would reintroduce the very \"cannot read its own output\" defect for\n // the one part of the string that carries no information.\n const source = fragments\n .map((fragment, i) =>\n i === fragments.length - 1 && fragment.literal && fragment.source ? `(?:${fragment.source})?` : fragment.source\n )\n .join('');\n\n return { regex: new RegExp(`^${source}$`, 'iu'), fields, numerals, hourCycle: resolved.hourCycle };\n }\n\n /** The twelve month strings THIS formatter writes, in its own style and context. */\n private namedMonthNames(formatter: Intl.DateTimeFormat): readonly string[] {\n const out: string[] = [];\n for (let i = 0; i < 12; i++) {\n out.push(formatter.formatToParts(new Date(2024, i, 15)).find(p => p.type === 'month')?.value ?? '');\n }\n return out;\n }\n\n /** `[am, pm]` as THIS formatter writes them — `ص` / `م` in Arabic, not AM / PM. */\n private dayPeriodNames(formatter: Intl.DateTimeFormat): readonly string[] {\n const read = (hour: number): string =>\n formatter.formatToParts(new Date(2024, 0, 15, hour, 30)).find(p => p.type === 'dayPeriod')?.value ?? '';\n return [read(9), read(21)];\n }\n\n private parseNamed(raw: string, key: WrDateFormat): Date | null {\n const { namedParsers } = this.caches();\n let parser = namedParsers.get(key);\n if (parser === undefined) {\n parser = this.buildNamedParser(key);\n namedParsers.set(key, parser);\n }\n if (!parser) return null;\n\n const match = parser.regex.exec(stripBidi(raw));\n if (!match) return null;\n\n const parts: DateParts = {};\n const twelveHour = parser.fields.some(field => field.kind === 'dayPeriod');\n\n for (let i = 0; i < parser.fields.length; i++) {\n const field = parser.fields[i];\n const captured = match[i + 1] ?? '';\n if (field.kind === 'monthName' || field.kind === 'dayPeriod') {\n const wanted = nameKey(captured);\n const index = (field.names ?? []).findIndex(name => nameKey(name) === wanted);\n if (index < 0) return null;\n if (field.kind === 'monthName') parts.month = index;\n else parts.isPm = index === 1;\n continue;\n }\n\n const n = digitsToNumber(captured, parser.numerals);\n if (Number.isNaN(n)) return null;\n switch (field.kind) {\n case 'year':\n // Two digits mean this century, the same reading the `yy` token gives — the\n // picker's own doc promises `1/5/25` cleans up to 2025.\n parts.year = captured.length <= 2 ? 2000 + n : n;\n break;\n case 'month':\n parts.month = n - 1;\n break;\n case 'day':\n parts.day = n;\n break;\n case 'hour':\n if (twelveHour) parts.hour12 = n;\n // `hourCycle: 'h24'` numbers midnight 24 rather than 0.\n else parts.hours = n === 24 && parser.hourCycle === 'h24' ? 0 : n;\n break;\n case 'minute':\n parts.minutes = n;\n break;\n case 'second':\n parts.seconds = n;\n break;\n }\n }\n\n return this.compose(parts);\n }\n\n /**\n * Assemble whatever was read into a `Date`, or refuse.\n *\n * `new Date(2025, 12, 45)` does not fail — it rolls forward into the next year — and\n * `isValid` is happy with the result, so a text field used to turn nonsense into a\n * confident wrong answer. The clock parts are range-checked directly; the month and the\n * day are checked by comparing what came back, which catches every rollover including a\n * month of 12 or -1.\n */\n private compose(parts: DateParts): Date | null {\n const now = new Date();\n const year = parts.year ?? this.getYear(now);\n const month = parts.month ?? this.getMonth(now);\n\n let hours = parts.hours ?? 0;\n if (parts.hour12 !== undefined) hours = (parts.hour12 % 12) + (parts.isPm ? 12 : 0);\n const minutes = parts.minutes ?? 0;\n const seconds = parts.seconds ?? 0;\n if (hours < 0 || hours > 23 || minutes < 0 || minutes > 59 || seconds < 0 || seconds > 59) return null;\n\n // A time-only format carries no date, and the date it should imply is TODAY — the\n // previous default was 1 January, so a picker in `mode=\"time\"` moved the model back\n // to New Year's Day as a side effect of reading a clock. The default is clamped to\n // the month it lands in, because an unclamped 31st would roll a February string\n // forward and the rollover check below would then refuse a well-formed string.\n const monthLength = new Date(year, month + 1, 0).getDate();\n const day = parts.day ?? Math.min(this.getDate(now), monthLength);\n\n if (this.zonal) {\n const wall = new Date(wrUtcTime(year, month, day, hours, minutes, seconds));\n if (wall.getUTCMonth() !== month || wall.getUTCDate() !== day) return null;\n return this.instant(wall);\n }\n\n const out = new Date(year, month, day, hours, minutes, seconds);\n // Same trap `createDate` documents: a year under 100 maps onto 1900 + year unless it\n // is written back explicitly, so `0025-08-11` used to parse as 1925.\n if (year >= 0 && year < 100) out.setFullYear(year);\n if (!this.isValid(out)) return null;\n if (out.getMonth() !== month || out.getDate() !== day) return null;\n return out;\n }\n}\n\nexport { wrIsNamedFormat };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\n/** `2026`, `2026-01` and `2026-01-01`: the forms `new Date()` reads as UTC rather than local. */\nconst ISO_DATE_ONLY = /^\\d{4}(?:-\\d{2}(?:-\\d{2})?)?$/;\n\n/**\n * Whether a value names a calendar day (`2026-01-01`, `2026-01`, `2026`) rather\n * than an instant. Such a day is the same day in every time zone, so `wrDate`\n * does not move it to the display zone.\n *\n * @internal\n */\nexport function wrIsDateOnly(value: unknown): boolean {\n return typeof value === 'string' && ISO_DATE_ONLY.test(value.trim());\n}\n\n/**\n * A string or a timestamp as a `Date`, with one exception to `new Date()`: a\n * date-only ISO string names a calendar day, so it is read as that day's LOCAL\n * midnight — the instant a date picker emits for it.\n *\n * `new Date('2026-01-01')` is UTC midnight, which west of Greenwich is the evening\n * before and east of it is later than the picked day's midnight. So a due date from\n * an API printed a day early for every American reader of `wrDate`, and\n * `WrValidators.minDate('2026-01-01')` refused 1 January in Almaty while\n * `maxDate('2026-12-31')` refused 31 December in New York. Angular's `DatePipe`\n * makes the same exception. The engine still decides what is a valid date — an\n * invalid string comes back as an invalid `Date` — and only the zone moves.\n *\n * Shared by `ngwr/pipes` and `ngwr/validators` so the two read the same string as\n * the same day; not part of the public API.\n *\n * @internal\n */\nexport function wrToLocalDate(value: string | number): Date {\n const parsed = new Date(value);\n if (typeof value !== 'string' || !ISO_DATE_ONLY.test(value) || Number.isNaN(parsed.getTime())) return parsed;\n const local = new Date(0);\n local.setFullYear(parsed.getUTCFullYear(), parsed.getUTCMonth(), parsed.getUTCDate());\n local.setHours(0, 0, 0, 0);\n return local;\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { wrToLocalDate } from './local-date';\n\n/**\n * `2026-03-01 14:30`, with optional seconds, a fraction and a zone (`Z`, `+05`,\n * `+0500`, `+05:00`): the SQL form of a date-time, a space where ISO 8601 has a `T`.\n */\nconst SPACE_SEPARATED =\n /^(\\d{4}-\\d{2}-\\d{2}) (\\d{2}:\\d{2})(?::(\\d{2})(?:\\.(\\d+))?)?(?:(Z)|([+-]\\d{2})(?::?(\\d{2}))?)?$/i;\n\nfunction fromString(value: string): Date | null {\n const text = String(value).trim();\n if (text === '') return null;\n const match = SPACE_SEPARATED.exec(text);\n if (match === null) return wrToLocalDate(text);\n const [, day, time, seconds = '00', fraction, utc, hours, minutes = '00'] = match;\n const millis = fraction === undefined ? '' : `.${fraction.slice(0, 3).padEnd(3, '0')}`;\n const zone = utc !== undefined ? 'Z' : hours === undefined ? '' : `${hours}:${minutes}`;\n return new Date(`${day}T${time}:${seconds}${millis}${zone}`);\n}\n\n/**\n * What a backend sends for a date, as a `Date`, or `null` when it holds none.\n * Never an Invalid Date, so the result needs one check rather than two.\n *\n * - A `Date` comes back as it is, the same object; an Invalid Date gives `null`.\n * - A number is epoch milliseconds; `NaN`, an infinity and a number outside the\n * range of `Date` give `null`.\n * - `2026-03-01 14:30:00`, a space where ISO 8601 has a `T`, is rewritten to the\n * ISO form first. Chrome reads the space form and Safari gives an Invalid Date\n * for it. Seconds, a fraction and a zone are optional; the fraction is cut to\n * milliseconds and a zone of hours alone (`+05`, as PostgreSQL prints it) is\n * completed. Without a zone it is local time, as the `T` form is.\n * - A date-only string (`2026-03-01`, `2026-03`, `2026`) is that day's LOCAL\n * midnight, as `wrDate` and `WrValidators.minDate` read it. `new Date()` would\n * make it UTC midnight, the evening before for a reader west of Greenwich.\n * - Any other string is left to `new Date()`, so an ISO string with `Z` or an\n * offset is the instant it names.\n * - `null`, `undefined`, an empty or blank string and a string the engine\n * refuses give `null`.\n *\n * Surrounding whitespace is ignored. A plain function: no adapter and no\n * injection context, so it runs in a mapper, a resolver or a store.\n *\n * @example\n * ```ts\n * wrParseDate('2026-03-01 14:30:00'); // 1 March 2026, 14:30 local\n * wrParseDate('2026-03-01'); // 1 March 2026, 00:00 local\n * wrParseDate('2026-03-01T09:30:00+05:00'); // that instant\n * wrParseDate(1772343000000); // epoch milliseconds\n * wrParseDate('n/a'); // null\n * ```\n *\n * @see https://ngwr.dev/reference/pipes/wr-date\n */\nexport function wrParseDate(value: Date | string | number | null | undefined): Date | null {\n if (value === null || value === undefined) return null;\n const date = value instanceof Date ? value : typeof value === 'number' ? new Date(value) : fromString(value);\n return date === null || Number.isNaN(date.getTime()) ? null : date;\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Injector, type Provider, inject, runInInjectionContext } from '@angular/core';\n\nimport { type WrFeature, wrFeature } from 'ngwr/utils';\n\nimport { WR_DATE_LOCALE, WR_DATE_TIME_ZONE } from './tokens';\nimport { WR_DATE_LOCALE_PINNED } from './tokens/wr-date-locale-pinned.token';\nimport type { WrDatesOptions } from './types';\nimport { WrDateAdapter, WrNativeDateAdapter } from './wr-date-adapter';\n\n/**\n * Replace the date adapter the calendar / date picker / time picker use, pin\n * the locale it formats in, or set the time zone dates are shown in, as a\n * feature of `provideWr()`. Optional: with no call at all they run on\n * {@link WrNativeDateAdapter} in Angular's `LOCALE_ID` and the browser's zone.\n *\n * Omit `locale` and dates follow the interface language of `provideWrI18n()`,\n * `WrI18n.use()` included, and Angular's `LOCALE_ID` in an app without it.\n * Pass one only to pin dates to something else, see {@link wrDateLocale}.\n *\n * The one feature that works in a route's `providers` as well: that subtree\n * gets an adapter of its own.\n *\n * @example\n * ```ts\n * import { provideWr } from 'ngwr';\n * import { withDates } from 'ngwr/date';\n *\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideWr(withDates({ locale: 'ru-RU' })), // pin the dates\n * // provideWr(withDates({ adapter: MyDateAdapter, locale: 'fr' })), // your own subclass\n * // provideWr(withDates({ timeZone: () => inject(AppConfig).timeZone() })), // a runtime config\n * ],\n * });\n * ```\n */\nexport function withDates(options: WrDatesOptions = {}): WrFeature<'dates'> {\n // The native class is registered here even when only `locale` is passed: the\n // root default lives in the root injector and reads the root's locale, so a\n // call in a route's providers has to build an adapter of its own.\n const providers: Provider[] = [{ provide: WrDateAdapter, useClass: options.adapter ?? WrNativeDateAdapter }];\n\n if (options.locale) {\n providers.push(\n { provide: WR_DATE_LOCALE, useValue: options.locale },\n { provide: WR_DATE_LOCALE_PINNED, useValue: true }\n );\n }\n\n const { timeZone } = options;\n if (timeZone) {\n providers.push({\n provide: WR_DATE_TIME_ZONE,\n useFactory: (): (() => string | null | undefined) => {\n if (typeof timeZone !== 'function') return () => timeZone;\n const injector = inject(Injector);\n return () => runInInjectionContext(injector, timeZone);\n },\n });\n }\n\n return wrFeature('dates', providers);\n}\n"],"mappings":";;;;;;;;;AAqCA,MAAa,iBAAiB,IAAI,eAAuB,kBAAkB;CACzE,YAAY;C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
|
1
|
+
{"version":3,"file":"ngwr-date.mjs","names":[],"sources":["../../../projects/lib/date/tokens/wr-date-locale.token.ts","../../../projects/lib/date/tokens/wr-date-time-zone.token.ts","../../../projects/lib/date/tokens/wr-date-input.token.ts","../../../projects/lib/date/tokens/wr-date-stamp-defaults.token.ts","../../../projects/lib/date/tokens/wr-date-locale-pinned.token.ts","../../../projects/lib/date/date-locale.ts","../../../projects/lib/date/time-zone.ts","../../../projects/lib/date/wr-date-adapter.ts","../../../projects/lib/date/local-date.ts","../../../projects/lib/date/parse-date.ts","../../../projects/lib/date/with-dates.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken, LOCALE_ID, inject } from '@angular/core';\n\n/**\n * The BCP 47 locale tag `withDates({ locale })` pinned, and Angular's\n * `LOCALE_ID` when nothing was. An adapter reads {@link wrDateLocale} instead,\n * which puts the interface language of `provideWrI18n()` between the two.\n *\n * **It used to default to `navigator.language`, and that was wrong in the\n * documented case.** The provider's own first example was the no-argument call,\n * so the path a reader copied was the broken one: an app that set\n * `LOCALE_ID: 'ru-RU'` and translated every string still rendered `March 2026`,\n * `SUN MON TUE …` and a week starting on Sunday, because the calendar was\n * asking the browser rather than the application. `navigator.language` is the\n * user's browser preference; `LOCALE_ID` is what the app says it is, and only\n * the app can be right about that. Reading the browser also made a prerendered\n * page and its hydrated self disagree — the server has no `navigator.language`\n * to match. An app that genuinely wants the browser's tag can still say so:\n * `provideWr(withDates({ locale: navigator.language }))`.\n *\n * The token is a plain string, resolved once: the *pinned* date locale, not a\n * live one. `WrI18n.use()` cannot move it, and moves dates only when nothing\n * was pinned. Provide it through `withDates({ locale })`: a bare provider of\n * this token is read as the fallback, not as a pin.\n *\n * **How far it reaches is up to the adapter.** The native one threads it through\n * everything. A subclass over a library that resolves its patterns against a\n * locale OBJECT rather than a tag (date-fns is the common case) has to map the\n * tag onto that object itself — otherwise the month and weekday names, which go\n * through `Intl`, localize and the field's own text does not.\n */\nexport const WR_DATE_LOCALE = new InjectionToken<string>('WR_DATE_LOCALE', {\n providedIn: 'root',\n factory: () => inject(LOCALE_ID),\n});\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\n/**\n * The display time zone the {@link WrDateAdapter} implementations read, as a\n * function: an IANA name (`'Asia/Almaty'`) or an offset (`'+05:00'`), and\n * `null` or `undefined` for the browser's own zone. `null` when\n * `withDates({ timeZone })` was not called, which is the browser's zone too.\n *\n * A function rather than a string because the zone often arrives after\n * bootstrap, from a runtime config. The native adapter calls it on every read,\n * so what it formats follows the signals the function reads.\n *\n * Set it with the `timeZone` option of `provideWr(withDates(...))`. An adapter\n * of your own injects it to honour the same option.\n */\nexport const WR_DATE_TIME_ZONE = new InjectionToken<(() => string | null | undefined) | null>('WR_DATE_TIME_ZONE', {\n providedIn: 'root',\n factory: () => null,\n});\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\nimport type { WrEpochUnit, WrZonelessIn } from '../types';\n\n/**\n * How the native adapter reads a backend value before it formats it: the\n * `epochUnit` and `zonelessIn` options of `withDates()`. An adapter of your own\n * injects it and returns it from `parseOptions()` to honour the same options.\n */\nexport const WR_DATE_INPUT = new InjectionToken<{ readonly epochUnit: WrEpochUnit; readonly zonelessIn: WrZonelessIn }>(\n 'WR_DATE_INPUT',\n { providedIn: 'root', factory: () => ({ epochUnit: 'ms', zonelessIn: 'browser' }) }\n);\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\nimport type { WrDateStampDefaults } from '../types';\n\n/**\n * The app-wide defaults of `wr-date-stamp`: the `stamp` option of\n * `withDates()`. It lives here rather than in `ngwr/date-stamp` so that\n * `withDates()` does not import a component.\n */\nexport const WR_DATE_STAMP_DEFAULTS = new InjectionToken<WrDateStampDefaults>('WR_DATE_STAMP_DEFAULTS', {\n providedIn: 'root',\n factory: () => ({}),\n});\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\n/**\n * Whether `withDates({ locale })` pinned the date locale. `WR_DATE_LOCALE`\n * cannot say: it holds `LOCALE_ID` when nothing was pinned.\n *\n * @internal\n */\nexport const WR_DATE_LOCALE_PINNED = new InjectionToken<boolean>('WR_DATE_LOCALE_PINNED', {\n providedIn: 'root',\n factory: () => false,\n});\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type Signal, computed, inject } from '@angular/core';\n\nimport { WR_LIVE_LOCALE } from 'ngwr/utils';\n\nimport { WR_DATE_LOCALE } from './tokens';\nimport { WR_DATE_LOCALE_PINNED } from './tokens/wr-date-locale-pinned.token';\n\nfunction isLocaleTag(tag: string): boolean {\n try {\n return Intl.getCanonicalLocales(tag).length > 0;\n } catch {\n return false;\n }\n}\n\n/**\n * The locale dates are written in, as a signal. Highest first:\n *\n * 1. `withDates({ locale })`: a pin, which a language switch does not move.\n * 2. `WrI18n.locale()`, when the app calls `provideWrI18n()`: the interface\n * language, which `WrI18n.use()` changes at runtime.\n * 3. `LOCALE_ID`.\n *\n * A catalog name that is not a BCP 47 tag (`en_US`) cannot format a date, so\n * the signal holds `LOCALE_ID` while the interface language is one.\n *\n * Must be called in an injection context. The native adapter formats in it; an\n * adapter of your own reads it to follow the same rule.\n *\n * @example\n * ```ts\n * private readonly locale = wrDateLocale();\n * protected readonly weekday = computed(() =>\n * new Intl.DateTimeFormat(this.locale(), { weekday: 'long' }).format(this.date()),\n * );\n * ```\n */\nexport function wrDateLocale(): Signal<string> {\n const fixed = inject(WR_DATE_LOCALE);\n const live = inject(WR_DATE_LOCALE_PINNED) ? null : inject(WR_LIVE_LOCALE, { optional: true });\n if (!live) return computed(() => fixed);\n return computed(() => {\n const tag = live();\n return isLocaleTag(tag) ? tag : fixed;\n });\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { isDevMode } from '@angular/core';\n\n/**\n * A display time zone, resolved: a fixed offset in minutes east of UTC, or an\n * IANA name with the formatter that reads its wall clock.\n *\n * @internal\n */\ntype WrResolvedZone =\n | { readonly kind: 'offset'; readonly id: string; readonly minutes: number }\n | { readonly kind: 'iana'; readonly id: string; readonly fields: Intl.DateTimeFormat };\n\n/** `+05:00`, `+0530`, `-03`. */\nconst OFFSET = /^([+-])(\\d{2})(?::?(\\d{2}))?$/;\n\nconst MINUTE = 60_000;\n\nconst resolved = new Map<string, WrResolvedZone | null>();\n\n/**\n * `Date.UTC` with the year taken literally: it reads one under 100 as 1900 + year.\n *\n * @internal\n */\nfunction wrUtcTime(year: number, month: number, day: number, hours = 0, minutes = 0, seconds = 0, millis = 0): number {\n const date = new Date(0);\n date.setUTCFullYear(year, month, day);\n date.setUTCHours(hours, minutes, seconds, millis);\n return date.getTime();\n}\n\n/**\n * What `withDates({ timeZone })` resolved to, or `null` for the browser's zone:\n * nothing set, or a value no engine knows, which warns once per value in dev mode.\n *\n * @internal\n */\nfunction wrResolveZone(value: string | null | undefined): WrResolvedZone | null {\n const id = value?.trim();\n if (!id) return null;\n const known = resolved.get(id);\n if (known !== undefined) return known;\n\n let zone: WrResolvedZone | null = null;\n const offset = OFFSET.exec(id);\n if (offset) {\n const hours = Number(offset[2]);\n const minutes = Number(offset[3] ?? 0);\n if (hours <= 23 && minutes <= 59) {\n zone = { kind: 'offset', id, minutes: (offset[1] === '-' ? -1 : 1) * (hours * 60 + minutes) };\n }\n } else {\n try {\n zone = {\n kind: 'iana',\n id,\n fields: new Intl.DateTimeFormat('en-US', {\n timeZone: id,\n calendar: 'gregory',\n numberingSystem: 'latn',\n hourCycle: 'h23',\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n }),\n };\n } catch {\n // `RangeError`: not a zone this engine knows.\n }\n }\n\n if (!zone && isDevMode()) {\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n `[NGWR] withDates({ timeZone }) got '${id}', which is neither an IANA time zone this browser knows ` +\n `nor an offset such as '+05:00'. Dates are shown in the browser's own time zone.`\n );\n }\n resolved.set(id, zone);\n return zone;\n}\n\n/**\n * The zone's wall clock at an instant, as the epoch time of a `Date` whose UTC\n * fields read it. UTC has no daylight saving, so every wall clock of every zone\n * has exactly one such time, which a `Date` read with local getters cannot say.\n *\n * @internal\n */\nfunction wrZoneWallTime(time: number, zone: WrResolvedZone | null): number {\n if (!zone) return time - new Date(time).getTimezoneOffset() * MINUTE;\n if (zone.kind === 'offset') return time + zone.minutes * MINUTE;\n\n const read: Record<string, number> = {};\n for (const part of zone.fields.formatToParts(time)) read[part.type] = Number(part.value);\n const millis = ((time % 1000) + 1000) % 1000;\n return wrUtcTime(read['year'], read['month'] - 1, read['day'], read['hour'], read['minute'], read['second'], millis);\n}\n\n/**\n * The instant a wall clock (see {@link wrZoneWallTime}) names in the zone. A\n * wall clock a daylight-saving change skips lands after the change, as\n * `new Date(y, m, d, h)` does for the browser's own zone.\n *\n * @internal\n */\nfunction wrZoneInstant(wall: number, zone: WrResolvedZone | null): number {\n if (!zone) {\n const w = new Date(wall);\n const local = new Date(0);\n local.setFullYear(w.getUTCFullYear(), w.getUTCMonth(), w.getUTCDate());\n local.setHours(w.getUTCHours(), w.getUTCMinutes(), w.getUTCSeconds(), w.getUTCMilliseconds());\n return local.getTime();\n }\n if (zone.kind === 'offset') return wall - zone.minutes * MINUTE;\n\n // The offset is known only for an instant, so guess with the offset the wall\n // clock would have as an instant and correct once: two passes settle\n // everything but a skipped hour, which has no answer to settle on.\n const first = wall - (wrZoneWallTime(wall, zone) - wall);\n const second = wall - (wrZoneWallTime(first, zone) - first);\n return second;\n}\n\nexport { wrResolveZone, wrUtcTime, wrZoneInstant, wrZoneWallTime };\nexport type { WrResolvedZone };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Injectable, Injector, Service, forwardRef, inject, runInInjectionContext } from '@angular/core';\n\nimport { wrDateLocale } from './date-locale';\nimport { type WrResolvedZone, wrResolveZone, wrUtcTime, wrZoneInstant, wrZoneWallTime } from './time-zone';\nimport { WR_DATE_INPUT, WR_DATE_TIME_ZONE } from './tokens';\nimport type { WrDateFormat, WrParseDateOptions } from './types';\n\n/**\n * Bidi control marks ICU embeds in a right-to-left date pattern — ar-SA writes its\n * separator as U+200F followed by a slash. No keyboard produces one, so both the\n * pattern and the typed string drop them before they are compared.\n */\nconst BIDI_RE = /[\\u200e\\u200f\\u061c\\u2066-\\u2069]/g;\n\nconst REGEX_META_RE = /[.*+?^${}()|[\\]\\\\]/g;\n\nfunction stripBidi(value: string): string {\n return value.replace(BIDI_RE, '');\n}\n\nfunction escapeRegex(value: string): string {\n return value.replace(REGEX_META_RE, '\\\\$&');\n}\n\n/**\n * One literal run of an `Intl` pattern, as a regex fragment.\n *\n * Whitespace inside a literal is advisory, not exact: ICU separates `02:30` from `PM`\n * with a NARROW NO-BREAK SPACE (U+202F) and no keyboard emits one, so every whitespace\n * run matches `\\s*`. A literal that is nothing BUT whitespace keeps `\\s+` — relaxing it\n * there would let `15 2026` also read as `152026`, which is how a lenient parser invents\n * a date nobody typed.\n */\nfunction literalToRegex(literal: string): string {\n const text = stripBidi(literal);\n if (!text) return '';\n if (!text.trim()) return '\\\\s+';\n return text.split(/\\s+/).map(escapeRegex).join('\\\\s*');\n}\n\n/**\n * Longest first, so `March` is never consumed as `Mar` with `ch` left over.\n *\n * Whitespace inside a name is loosened the way {@link literalToRegex} loosens it in a\n * literal: es and ca write the day period as `p. m.`, and V8 puts U+0020 there in\n * `format()` while `formatToParts()` — which this alternation is built from — keeps\n * U+202F, so an exact name could not read the string the same formatter printed.\n */\nfunction alternation(names: readonly string[]): string {\n return [...new Set(names)]\n .sort((a, b) => b.length - a.length)\n .map(name => stripBidi(name).split(/\\s+/u).map(escapeRegex).join('\\\\s*'))\n .join('|');\n}\n\n/**\n * The comparison key for a captured name: case, bidi marks and whitespace dropped, so\n * `p.m.`, `p. m.` and `p.` U+202F `m.` are one day period — the same leniency the regex\n * from {@link alternation} granted when it matched.\n */\nfunction nameKey(name: string): string {\n return stripBidi(name).replace(/\\s+/gu, '').toLowerCase();\n}\n\n/**\n * The ten digits a locale's numbering system writes, index 0 to 9 — `null` when the\n * system is algorithmic (roman, hebrew) and there is no digit-by-digit reading to do.\n */\nfunction numeralsFor(locale: string, numberingSystem: string): readonly string[] | null {\n let formatter: Intl.NumberFormat;\n try {\n formatter = new Intl.NumberFormat(locale, { numberingSystem, useGrouping: false });\n } catch {\n return null;\n }\n const digits: string[] = [];\n for (let i = 0; i < 10; i++) {\n const digit = formatter.format(i);\n if ([...digit].length !== 1 || digits.includes(digit)) return null;\n digits.push(digit);\n }\n return digits;\n}\n\n/** A character class accepting the locale's own digits AND ASCII ones. */\nfunction digitClass(numerals: readonly string[]): string {\n const extra = numerals\n .filter(digit => digit < '0' || digit > '9')\n .map(digit => `\\\\u${digit.codePointAt(0)!.toString(16).padStart(4, '0')}`)\n .join('');\n return `[0-9${extra}]`;\n}\n\n/** `١٥` to `15`, and ASCII through unchanged. `NaN` for anything else. */\nfunction digitsToNumber(text: string, numerals: readonly string[]): number {\n let out = '';\n for (const ch of text) {\n if (ch >= '0' && ch <= '9') {\n out += ch;\n continue;\n }\n const index = numerals.indexOf(ch);\n if (index < 0) return Number.NaN;\n out += String(index);\n }\n return out ? Number(out) : Number.NaN;\n}\n\nfunction isAllDigits(text: string, numerals: readonly string[]): boolean {\n return text.length > 0 && !Number.isNaN(digitsToNumber(text, numerals));\n}\n\n/** What one capture group of a named-format parser holds. */\ninterface NamedField {\n readonly kind: 'year' | 'month' | 'monthName' | 'day' | 'hour' | 'minute' | 'second' | 'dayPeriod';\n /** Month names (12) or day-period names (`[am, pm]`), matched case-insensitively. */\n readonly names?: readonly string[];\n}\n\ninterface NamedParser {\n readonly regex: RegExp;\n readonly fields: readonly NamedField[];\n readonly numerals: readonly string[];\n readonly hourCycle: string | undefined;\n}\n\n/** Everything the native adapter keeps for one locale. */\ninterface LocaleCache {\n readonly locale: string;\n readonly formatters: Map<string, Intl.DateTimeFormat>;\n readonly monthNames: Map<string, readonly string[]>;\n readonly namedParsers: Map<WrDateFormat, NamedParser | null>;\n numerals: readonly string[] | null;\n dayPeriods: readonly [string, string] | null;\n}\n\n/** The parts assembled into a `Date`, whatever route read them. */\ninterface DateParts {\n year?: number;\n month?: number;\n day?: number;\n hours?: number;\n minutes?: number;\n seconds?: number;\n hour12?: number;\n isPm?: boolean;\n}\n\nconst SHORT_DATE: Intl.DateTimeFormatOptions = { year: 'numeric', month: 'numeric', day: 'numeric' };\nconst CLOCK: Intl.DateTimeFormatOptions = { hour: '2-digit', minute: '2-digit' };\nconst SECONDS: Intl.DateTimeFormatOptions = { second: '2-digit' };\n/**\n * `hourCycle` rather than `hour12`. `hour12: false` leaves the engine to choose\n * between `h23` and `h24`, and some resolved it to `h24`, writing midnight as\n * `24:00`; `hour12` also overrides `hourCycle` when both are set. So the pinned\n * variants name exactly the cycle they mean.\n */\nconst H12: Intl.DateTimeFormatOptions = { hourCycle: 'h12' };\nconst H23: Intl.DateTimeFormatOptions = { hourCycle: 'h23' };\n\nconst INTL_OPTIONS: Readonly<Record<WrDateFormat, Intl.DateTimeFormatOptions>> = {\n shortDate: SHORT_DATE,\n mediumDate: { year: 'numeric', month: 'short', day: 'numeric' },\n longDate: { year: 'numeric', month: 'long', day: 'numeric' },\n time: CLOCK,\n time12h: { ...CLOCK, ...H12 },\n time24h: { ...CLOCK, ...H23 },\n timeSeconds: { ...CLOCK, ...SECONDS },\n time12hSeconds: { ...CLOCK, ...SECONDS, ...H12 },\n time24hSeconds: { ...CLOCK, ...SECONDS, ...H23 },\n shortDateTime: { ...SHORT_DATE, ...CLOCK },\n shortDateTime12h: { ...SHORT_DATE, ...CLOCK, ...H12 },\n shortDateTime24h: { ...SHORT_DATE, ...CLOCK, ...H23 },\n shortDateTimeSeconds: { ...SHORT_DATE, ...CLOCK, ...SECONDS },\n shortDateTime12hSeconds: { ...SHORT_DATE, ...CLOCK, ...SECONDS, ...H12 },\n shortDateTime24hSeconds: { ...SHORT_DATE, ...CLOCK, ...SECONDS, ...H23 },\n mediumDateTime: { year: 'numeric', month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' },\n};\n\n/** Every named key, read off the table so the two cannot disagree. */\nconst NAMED_KEYS: ReadonlySet<string> = new Set(Object.keys(INTL_OPTIONS));\n\n/** Recognised tokens, longest first so `MMMM` matches before `MMM`. */\n/**\n * Every token, with single-quoted runs taken FIRST so they win.\n *\n * Without that, the one-letter tokens match letters inside literal text: `'yyyy [year]'`\n * came out as `2025 [yeamr]`, because the `a` in \"year\" was read as the meridiem token.\n * Quote literals the way `DatePipe` and LDML do — `'at'` — and `''` for a real quote,\n * inside a run as well as outside one: `h 'o''clock'` is `6 o'clock`.\n */\nconst PART_RE = /'((?:[^']|'')*)'|yyyy|yy|y|MMMM|MMM|MM|M|dd|d|HH|H|hh|h|mm|ss|a/g;\n\n/** The text a quoted run stands for: `''` alone is one quote, and so is `''` inside a run. */\nfunction unquote(quoted: string): string {\n return quoted === '' ? \"'\" : quoted.replaceAll(\"''\", \"'\");\n}\n\nfunction pad(n: number, width = 2): string {\n return String(Math.abs(n)).padStart(width, '0');\n}\n\n/** Whether `value` is one of the shared named format keys. */\nfunction wrIsNamedFormat(value: string): value is WrDateFormat {\n return NAMED_KEYS.has(value);\n}\n\n/**\n * `digits` is a character class rather than `\\d`, and it always accepts ASCII as well as\n * the locale's own numerals. The token formatter WRITES ASCII, so the round trip never\n * needed more — but a reader on an Arabic keyboard types `١٥` into the same field, and\n * `\\d` made that silently unparseable with no feedback anywhere.\n */\nfunction tokenToRegex(token: string, digits: string): string {\n switch (token) {\n case 'yyyy':\n return `(${digits}{4})`;\n case 'yy':\n return `(${digits}{2})`;\n case 'y':\n return `(${digits}{1,6})`;\n case 'MM':\n case 'dd':\n case 'HH':\n case 'hh':\n case 'mm':\n case 'ss':\n return `(${digits}{2})`;\n case 'M':\n case 'd':\n case 'H':\n case 'h':\n return `(${digits}{1,2})`;\n case 'a':\n return '(am|pm|AM|PM)';\n default:\n return '(.+)';\n }\n}\n\n/**\n * Abstraction over a date object so the calendar, date picker and time picker\n * can work with `Date` or any other library a consumer prefers — without\n * changing component code.\n *\n * Injected with nothing provided it is {@link WrNativeDateAdapter} (native\n * `Date`, `Intl.DateTimeFormat`, the locale from {@link wrDateLocale}), so the\n * date components need no provider. For another library, subclass this,\n * decorate the subclass with `@Service()` and register it via\n * `provideWr(withDates({ adapter: MyAdapter }))`. An undecorated subclass still\n * resolves, but Angular warns in dev mode that it inherits this class's\n * injectable definition.\n *\n * Used as both the type and the DI token — `inject(WrDateAdapter)` works\n * directly thanks to Angular's class-as-token resolution.\n *\n * Every \"mutating\" method (`addX`, `setTime`) returns a **new** value;\n * adapters never mutate in place so consumers can pass dates around safely.\n */\n@Injectable({\n providedIn: 'root',\n // The native subclass is declared further down this module, so it is reached\n // through a `forwardRef` — the shape Angular's own `DomSanitizer` has. Both\n // classes share the module because a base importing the file that extends it\n // is a cycle that fails at evaluation. `@Injectable` rather than\n // `@Service({ factory })`: a `@Service` factory ignores the type it is asked\n // to build, so an undecorated subclass passed to `withDates()` would\n // quietly come back as the native adapter instead of itself.\n // eslint-disable-next-line @angular-eslint/no-forward-ref\n useExisting: forwardRef(() => WrNativeDateAdapter),\n})\nexport abstract class WrDateAdapter<TDate = Date> {\n // Construction & identity\n\n /** Current moment. */\n abstract today(): TDate;\n\n /** Defensive clone — must return an independent value, never the same reference. */\n abstract clone(date: TDate): TDate;\n\n /** Build a date from year / month (0-based) / day. */\n abstract createDate(year: number, month: number, day: number): TDate;\n\n /** `false` for `NaN` / invalid input. */\n abstract isValid(date: TDate): boolean;\n\n // Accessors\n\n abstract getYear(date: TDate): number;\n /** `0` (January) – `11` (December). */\n abstract getMonth(date: TDate): number;\n /** Day of the month, `1`-`31`. */\n abstract getDate(date: TDate): number;\n /** `0` (Sunday) – `6` (Saturday). */\n abstract getDayOfWeek(date: TDate): number;\n abstract getDaysInMonth(date: TDate): number;\n abstract getHours(date: TDate): number;\n abstract getMinutes(date: TDate): number;\n abstract getSeconds(date: TDate): number;\n\n // Immutable math\n\n abstract addYears(date: TDate, amount: number): TDate;\n abstract addMonths(date: TDate, amount: number): TDate;\n abstract addDays(date: TDate, amount: number): TDate;\n /** Returns a new date with the time portion replaced. */\n abstract setTime(date: TDate, hours: number, minutes: number, seconds: number): TDate;\n\n // Comparison\n\n abstract isSameDay(a: TDate, b: TDate): boolean;\n abstract isSameMonth(a: TDate, b: TDate): boolean;\n /** Negative if `a < b`, positive if `a > b`, zero if equal (compared at day precision). */\n abstract compareDate(a: TDate, b: TDate): number;\n\n /**\n * Convenience used by the calendar's range UI. Inclusive on both ends.\n * Implementation can stay on the base class because it delegates to\n * `compareDate`.\n */\n isWithinRange(date: TDate, start: TDate, end: TDate): boolean {\n return this.compareDate(date, start) >= 0 && this.compareDate(date, end) <= 0;\n }\n\n // Formatting / parsing\n\n /**\n * Format a date. Accepts either a named {@link WrDateFormat} key (which the\n * adapter resolves locale-aware) or a raw format string (`'dd.MM.yyyy'`).\n *\n * **Every named key is part of the contract**, the time variants included:\n * `time12h` / `time24h` pin the hour cycle, `timeSeconds` adds seconds, and the\n * same suffixes apply to `shortDateTime` (see {@link WrDateFormat}). The date\n * picker asks for them from its `timeFormat` and `showSeconds` inputs, so an\n * adapter that treats one as a raw pattern prints its letters into the field.\n * v15 added them; an adapter written for v14 has to handle them.\n *\n * Supported tokens for raw strings: `yyyy`, `yy`, `y` (the full year, as\n * `DatePipe` reads it: `d MMM y`), `MMMM`, `MMM`, `MM`, `M`,\n * `dd`, `d`, `HH`, `H`, `hh`, `h`, `mm`, `ss`, `a` (the locale's day-period\n * marker — `PM`, `م`, `午後`).\n *\n * `MMMM` / `MMM` take the form the language uses in the position the pattern\n * puts them: beside a day token a case language declines the month (ru writes\n * `15 марта`, not `15 март`), and on their own they stay nominative, which is\n * what a calendar heading wants.\n */\n abstract format(date: TDate, formatKeyOrString: WrDateFormat | (string & {})): string;\n\n /**\n * Parse a string into a date. Returns `null` when parsing fails. Accepts\n * the same `formatKeyOrString` set as {@link format}.\n *\n * **The round trip is a contract, not an aspiration**: whatever {@link format}\n * writes for a given key, `parse` reads back to the same date. A caller relies\n * on it every keystroke — the picker re-parses what it printed — and returning\n * `null` is how an adapter refuses, which leaves the caller's committed value\n * exactly as it was.\n */\n abstract parse(value: string, formatKeyOrString: WrDateFormat | (string & {})): TDate | null;\n\n /**\n * This adapter for instants: every accessor, `createDate`, the math, `format`\n * and `parse` read a date on the wall clock of the display time zone\n * (`withDates({ timeZone })`) instead of the browser's. The adapter itself\n * keeps reading the browser's zone, because a calendar day has no zone: the\n * 12th picked in a date-only field is the 12th wherever it is shown.\n *\n * `wrDate`, `wr-date-stamp` and the pickers' modes with a time ask for it.\n * The base class returns itself, so an adapter that does not override this\n * shows every date in the browser's zone.\n */\n zoned(): WrDateAdapter<TDate> {\n return this;\n }\n\n /**\n * What `format` writes in besides its arguments, as one string: the locale,\n * and the time zone on the {@link zoned} adapter. Equal keys mean equal\n * output, so a caller that keeps a formatted string compares keys instead of\n * formatting again. The native adapter reads its signals here: called in a\n * template, a `computed` or an `effect`, it re-runs them when either moves.\n */\n displayKey(): string {\n return '';\n }\n\n /**\n * How `wrDate`, `wrFormatDate` and `wr-date-stamp` read a backend value\n * before this adapter formats it: the `epochUnit` and `zonelessIn` of\n * `withDates()`, and the display zone. The base class returns nothing, which\n * is epoch milliseconds and the browser's zone; an adapter of your own\n * returns `inject(WR_DATE_INPUT)` and its zone to honour the options.\n */\n parseOptions(): WrParseDateOptions {\n return {};\n }\n\n // Locale info\n\n /** `0` Sunday, `1` Monday — locale-dependent. */\n abstract getFirstDayOfWeek(): number;\n\n /** Names ordered from `getFirstDayOfWeek()` onwards. Length 7. */\n abstract getDayOfWeekNames(style: 'narrow' | 'short' | 'long'): readonly string[];\n\n /** Names from January (index `0`) to December (`11`). Length 12. */\n abstract getMonthNames(style: 'narrow' | 'short' | 'long'): readonly string[];\n}\n\n/**\n * Reference {@link WrDateAdapter} implementation backed by the native `Date`\n * object and `Intl.DateTimeFormat`. Zero external dependencies, the only\n * adapter ngwr ships, and what `inject(WrDateAdapter)` returns when nothing is\n * provided. An app that needs timezone-aware math or richer parsing subclasses\n * {@link WrDateAdapter} over its own date library instead.\n */\n@Service()\nexport class WrNativeDateAdapter extends WrDateAdapter<Date> {\n private readonly localeSource = wrDateLocale();\n private cache: LocaleCache | null = null;\n\n /**\n * What is kept for the current locale, and the locale with it. A signal read,\n * so what formats in a reactive context follows a language switch; the switch\n * drops everything kept for the locale before it.\n */\n private caches(): LocaleCache {\n const locale = this.localeSource();\n if (this.cache?.locale !== locale) {\n this.cache = {\n locale,\n formatters: new Map(),\n monthNames: new Map(),\n namedParsers: new Map(),\n numerals: null,\n dayPeriods: null,\n };\n }\n return this.cache;\n }\n\n private get locale(): string {\n return this.caches().locale;\n }\n\n private readonly zoneSource = inject(WR_DATE_TIME_ZONE);\n private readonly injector = inject(Injector);\n\n /** Whether this instance is the one {@link zoned} hands out. */\n private zonal = false;\n private zonedSelf: WrNativeDateAdapter | null = null;\n\n /**\n * A second instance of the same class, so an app's subclass keeps its\n * overrides. With no `timeZone` option at all it is this instance.\n */\n override zoned(): WrDateAdapter<Date> {\n if (this.zonal || !this.zoneSource) return this;\n this.zonedSelf ??= runInInjectionContext(this.injector, () => {\n const zoned = new (this.constructor as new () => WrNativeDateAdapter)();\n zoned.zonal = true;\n return zoned;\n });\n return this.zonedSelf;\n }\n\n override displayKey(): string {\n return `${this.locale}|${this.zonal ? (this.zone()?.id ?? '') : ''}`;\n }\n\n private readonly input = inject(WR_DATE_INPUT);\n\n override parseOptions(): WrParseDateOptions {\n return { ...this.input, timeZone: this.zoneSource?.() ?? null };\n }\n\n private zone(): WrResolvedZone | null {\n return wrResolveZone(this.zoneSource?.());\n }\n\n private wallZone: WrResolvedZone | null = null;\n private readonly walls = new Map<number, number>();\n\n /**\n * The date on the display zone's wall clock, as a `Date` read with the UTC\n * getters, or `null` on the adapter that reads the browser's zone. Reading a\n * named zone costs an `Intl` call and a month grid asks for the same day many\n * times over, so those are kept.\n */\n private wall(date: Date): Date | null {\n if (!this.zonal) return null;\n const zone = this.zone();\n const time = date.getTime();\n if (zone?.kind !== 'iana' || Number.isNaN(time)) return new Date(wrZoneWallTime(time, zone));\n if (this.wallZone !== zone || this.walls.size > 512) {\n this.walls.clear();\n this.wallZone = zone;\n }\n let wall = this.walls.get(time);\n if (wall === undefined) {\n wall = wrZoneWallTime(time, zone);\n this.walls.set(time, wall);\n }\n return new Date(wall);\n }\n\n /** The instant a wall clock from {@link wall} names. */\n private instant(wall: Date): Date {\n return new Date(wrZoneInstant(wall.getTime(), this.zone()));\n }\n\n // Construction & identity\n\n today(): Date {\n return new Date();\n }\n\n clone(date: Date): Date {\n return new Date(date.getTime());\n }\n\n createDate(year: number, month: number, day: number): Date {\n if (this.zonal) return this.instant(new Date(wrUtcTime(year, month, day)));\n // Native Date constructor with year < 100 maps to 1900 + year unless we explicitly setFullYear.\n const d = new Date(year, month, day);\n if (year >= 0 && year < 100) d.setFullYear(year);\n return d;\n }\n\n isValid(date: Date): boolean {\n return date instanceof Date && !Number.isNaN(date.getTime());\n }\n\n // Accessors\n\n getYear(date: Date): number {\n return this.wall(date)?.getUTCFullYear() ?? date.getFullYear();\n }\n\n getMonth(date: Date): number {\n return this.wall(date)?.getUTCMonth() ?? date.getMonth();\n }\n\n getDate(date: Date): number {\n return this.wall(date)?.getUTCDate() ?? date.getDate();\n }\n\n getDayOfWeek(date: Date): number {\n return this.wall(date)?.getUTCDay() ?? date.getDay();\n }\n\n getDaysInMonth(date: Date): number {\n return new Date(this.getYear(date), this.getMonth(date) + 1, 0).getDate();\n }\n\n getHours(date: Date): number {\n return this.wall(date)?.getUTCHours() ?? date.getHours();\n }\n\n getMinutes(date: Date): number {\n return this.wall(date)?.getUTCMinutes() ?? date.getMinutes();\n }\n\n getSeconds(date: Date): number {\n return this.wall(date)?.getUTCSeconds() ?? date.getSeconds();\n }\n\n // Immutable math\n\n addYears(date: Date, amount: number): Date {\n const wall = this.wall(date);\n if (wall) {\n wall.setUTCFullYear(wall.getUTCFullYear() + amount);\n return this.instant(wall);\n }\n const d = this.clone(date);\n d.setFullYear(d.getFullYear() + amount);\n return d;\n }\n\n addMonths(date: Date, amount: number): Date {\n const wall = this.wall(date);\n if (wall) {\n const day = wall.getUTCDate();\n wall.setUTCDate(1);\n wall.setUTCMonth(wall.getUTCMonth() + amount);\n wall.setUTCDate(Math.min(day, new Date(wall.getUTCFullYear(), wall.getUTCMonth() + 1, 0).getDate()));\n return this.instant(wall);\n }\n const d = this.clone(date);\n const desiredDay = d.getDate();\n d.setDate(1);\n d.setMonth(d.getMonth() + amount);\n // Clamp day to the new month's length (Jan 31 + 1 month → Feb 28/29).\n d.setDate(Math.min(desiredDay, this.getDaysInMonth(d)));\n return d;\n }\n\n addDays(date: Date, amount: number): Date {\n // A calendar day, not 86 400 000 ms. Where daylight saving applies a day can be 23 or\n // 25 hours long, so millisecond arithmetic drifts the wall clock and — across an\n // autumn change — lands back on the same calendar date, which makes a month grid\n // repeat a day and lose one. Not observable in a fixed-offset timezone, which is why\n // the reason lives here rather than only in a test.\n const wall = this.wall(date);\n if (wall) {\n wall.setUTCDate(wall.getUTCDate() + amount);\n return this.instant(wall);\n }\n const d = this.clone(date);\n d.setDate(d.getDate() + amount);\n return d;\n }\n\n setTime(date: Date, hours: number, minutes: number, seconds: number): Date {\n const wall = this.wall(date);\n if (wall) {\n wall.setUTCHours(hours, minutes, seconds, 0);\n return this.instant(wall);\n }\n const d = this.clone(date);\n d.setHours(hours, minutes, seconds, 0);\n return d;\n }\n\n // Comparison\n\n isSameDay(a: Date, b: Date): boolean {\n return this.compareDate(a, b) === 0;\n }\n\n isSameMonth(a: Date, b: Date): boolean {\n return this.getYear(a) === this.getYear(b) && this.getMonth(a) === this.getMonth(b);\n }\n\n compareDate(a: Date, b: Date): number {\n const ay = this.getYear(a);\n const by = this.getYear(b);\n if (ay !== by) return ay - by;\n const am = this.getMonth(a);\n const bm = this.getMonth(b);\n if (am !== bm) return am - bm;\n return this.getDate(a) - this.getDate(b);\n }\n\n // Formatting / parsing\n\n // `(string & {})` keeps autocomplete for the WrDateFormat literals\n // while still accepting any other string as a raw token pattern.\n format(date: Date, formatKeyOrString: WrDateFormat | (string & {})): string {\n if (wrIsNamedFormat(formatKeyOrString)) {\n const wall = this.wall(date);\n return wall ? this.intl(formatKeyOrString, true).format(wall) : this.intl(formatKeyOrString).format(date);\n }\n return this.formatWithTokens(date, formatKeyOrString);\n }\n\n /**\n * Read back what {@link format} wrote.\n *\n * A named format used to delegate to `new Date(raw)`, which understands only\n * Anglo-American forms — so the field could not read its own output anywhere else.\n * `new Date('15.3.2026')` and `new Date('14:30')` are both `Invalid Date`, while\n * `new Date('1')` is 1 January 2001: retyping a de-DE date committed the year 2001 on\n * the first keystroke and then refused every one after it, and `mode=\"time\"` collapsed\n * to midnight in EVERY locale, en-US included. The named branch now builds its parser\n * from the SAME `Intl.DateTimeFormat` that printed the string, so the round trip holds\n * by construction rather than by luck.\n *\n * Returns `null` rather than a guess whenever the string does not match — the caller's\n * committed value is then left exactly as it was, which is the contract\n * `wr-input-number` follows for unparseable text.\n */\n parse(value: string, formatKeyOrString: WrDateFormat | (string & {})): Date | null {\n const raw = value?.trim();\n if (!raw) return null;\n\n if (wrIsNamedFormat(formatKeyOrString)) {\n return this.parseNamed(raw, formatKeyOrString);\n }\n\n return this.parseWithTokens(raw, formatKeyOrString);\n }\n\n // Locale info\n\n getFirstDayOfWeek(): number {\n // `Intl.Locale.prototype.getWeekInfo` is Stage 3 — not in TS lib types yet,\n // so we probe at runtime through an unknown cast.\n try {\n const locale = new Intl.Locale(this.locale) as unknown as { getWeekInfo?: () => { firstDay: number } };\n const info = locale.getWeekInfo?.();\n if (info && typeof info.firstDay === 'number') {\n // Intl uses 1 (Mon) – 7 (Sun); we use 0 (Sun) – 6 (Sat).\n return info.firstDay % 7;\n }\n } catch {\n // Browser doesn't support Intl.Locale or getWeekInfo — fall through.\n }\n return this.locale.toLowerCase().startsWith('en-us') ? 0 : 1;\n }\n\n /**\n * One `Intl.DateTimeFormat` per named format, built once.\n *\n * Constructing one is the expensive part of `format()`, and this adapter is\n * called per CELL: `wr-event-calendar` builds an `aria-label` for every time\n * slot on every day, so a week view asked for hundreds of identical\n * formatters. They are kept per locale, in {@link caches}.\n */\n\n /**\n * Every `Intl` call this adapter makes pins `calendar: 'gregory'`, and that is a\n * correctness fix rather than a preference.\n *\n * The value type is a JS `Date`, every accessor on this class (`getYear`,\n * `getMonth`, `getDate`) is Gregorian, `createDate` builds a Gregorian date and the\n * calendar grid draws Gregorian months. A locale whose DEFAULT calendar is something\n * else — `fa-IR` resolves to `persian`, `th-TH` to `buddhist`, `ar-SA` to\n * `islamic-umalqura` in several engines — printed a field the grid beside it could\n * never agree with (`۱۴۰۴/۱۲/۲۴` over a grid headed 2026), and no parser can turn\n * that back into the `Date` it came from. Pinning the calendar makes format and parse\n * describe the same one.\n */\n private intlOptions(options: Intl.DateTimeFormatOptions): Intl.DateTimeFormatOptions {\n return { ...options, calendar: 'gregory' };\n }\n\n /** `utc` is the formatter a wall clock from {@link wall} is printed with. */\n private intl(key: WrDateFormat, utc = false): Intl.DateTimeFormat {\n const { locale, formatters } = this.caches();\n const cacheKey = utc ? `utc:${key}` : key;\n let found = formatters.get(cacheKey);\n if (!found) {\n const options = this.intlOptions(INTL_OPTIONS[key]);\n found = new Intl.DateTimeFormat(locale, utc ? { ...options, timeZone: 'UTC' } : options);\n formatters.set(cacheKey, found);\n }\n return found;\n }\n\n getDayOfWeekNames(style: 'narrow' | 'short' | 'long'): readonly string[] {\n const formatter = new Intl.DateTimeFormat(this.locale, this.intlOptions({ weekday: style }));\n const first = this.getFirstDayOfWeek();\n // Pick a reference Sunday and walk seven days.\n const base = new Date(2024, 0, 7); // Sunday 7 Jan 2024\n const out: string[] = [];\n for (let i = 0; i < 7; i++) {\n const d = new Date(base);\n d.setDate(base.getDate() + ((first + i) % 7));\n out.push(formatter.format(d));\n }\n return out;\n }\n\n /**\n * Month names in the STANDALONE (nominative) form — what a calendar heading wants.\n * Inside a date the same name often declines; {@link monthNames} serves that form to\n * the token formatter, and this method deliberately keeps the heading one.\n */\n getMonthNames(style: 'narrow' | 'short' | 'long'): readonly string[] {\n return this.monthNames(style, 'standalone');\n }\n\n /** The locale's own ten digits, cached — empty when its system is algorithmic. */\n private localeNumerals(): readonly string[] {\n const cache = this.caches();\n cache.numerals ??=\n numeralsFor(cache.locale, new Intl.NumberFormat(cache.locale).resolvedOptions().numberingSystem) ?? [];\n return cache.numerals;\n }\n\n /**\n * `[am, pm]` as the LOCALE writes them — `PM`, `م`, `午後`.\n *\n * The `a` token used to return a hard-coded lowercase `pm`, byte for byte identical in\n * every locale, which made it the one token in the pattern language that could not be\n * localised at all. `Intl` is the source rather than the i18n catalog because\n * `ngwr/date` deliberately depends on nothing: the panel next to it reads\n * `datePicker.am` / `datePicker.pm`, so an app that wants its own wording overrides it\n * there and passes a 24-hour pattern here.\n */\n private dayPeriods(): readonly [string, string] {\n const cache = this.caches();\n if (cache.dayPeriods) return cache.dayPeriods;\n let periods: [string, string] = ['AM', 'PM'];\n try {\n const formatter = new Intl.DateTimeFormat(cache.locale, this.intlOptions({ hour: 'numeric', hour12: true }));\n const read = (hour: number): string =>\n formatter.formatToParts(new Date(2024, 0, 15, hour)).find(p => p.type === 'dayPeriod')?.value ?? '';\n const [am, pm] = [read(9), read(21)];\n if (am && pm && am !== pm) periods = [am, pm];\n } catch {\n // No `Intl` day period for this locale — the English pair stays.\n }\n cache.dayPeriods = periods;\n return periods;\n }\n\n /**\n * `context: 'format'` asks `Intl` for the month name as it appears BESIDE A DAY, which\n * is where a case language stops using the nominative: ru writes `15 марта`, not\n * `15 март`, and fi writes `maaliskuuta`, not `maaliskuu`. The name comes out of a\n * `{ day, month }` formatter's parts, because a `{ month }` formatter alone can only\n * ever answer with the standalone form.\n *\n * Some locales write the month NUMERICALLY in that position — fi abbreviates `15.3.`,\n * ja writes `3` with `月` as a separate literal — and there the standalone name is the\n * only name there is, so a purely numeric answer falls back to it. Without that guard\n * `dd MMMM yyyy` would render `15 3 2026` in Japanese.\n */\n private monthNames(style: 'narrow' | 'short' | 'long', context: 'standalone' | 'format'): readonly string[] {\n const { locale, monthNames } = this.caches();\n const cacheKey = `${style}:${context}`;\n const cached = monthNames.get(cacheKey);\n if (cached) return cached;\n\n const standaloneFormatter = new Intl.DateTimeFormat(locale, this.intlOptions({ month: style }));\n const standalone: string[] = [];\n for (let i = 0; i < 12; i++) standalone.push(standaloneFormatter.format(new Date(2024, i, 15)));\n\n let out: readonly string[] = standalone;\n if (context === 'format') {\n const numerals = numeralsFor(locale, standaloneFormatter.resolvedOptions().numberingSystem) ?? [];\n const inDate = new Intl.DateTimeFormat(locale, this.intlOptions({ day: 'numeric', month: style }));\n out = standalone.map((name, i) => {\n const part = inDate.formatToParts(new Date(2024, i, 15)).find(p => p.type === 'month')?.value;\n if (!part || isAllDigits(part, numerals)) return name;\n return part;\n });\n }\n\n monthNames.set(cacheKey, out);\n return out;\n }\n\n // Internals: token-based format / parse\n\n /** Whether a token pattern also writes the day, which decides the month's form. */\n private hasDayToken(pattern: string): boolean {\n let found = false;\n pattern.replace(PART_RE, (part: string, quoted?: string) => {\n if (quoted === undefined && (part === 'd' || part === 'dd')) found = true;\n return part;\n });\n return found;\n }\n\n private formatWithTokens(date: Date, pattern: string): string {\n const wall = this.wall(date);\n const year = wall ? wall.getUTCFullYear() : date.getFullYear();\n const month = wall ? wall.getUTCMonth() : date.getMonth();\n const day = wall ? wall.getUTCDate() : date.getDate();\n const hours24 = wall ? wall.getUTCHours() : date.getHours();\n const hours12 = hours24 % 12 === 0 ? 12 : hours24 % 12;\n const minutes = wall ? wall.getUTCMinutes() : date.getMinutes();\n const seconds = wall ? wall.getUTCSeconds() : date.getSeconds();\n // A pattern that writes the day wants the month declined for that position — `MMMM`\n // used to hand `15 март 2026` to a Russian field, which reads as machine output.\n const context = this.hasDayToken(pattern) ? 'format' : 'standalone';\n const monthNames = this.monthNames('long', context);\n const monthShort = this.monthNames('short', context);\n\n return pattern.replace(PART_RE, (part, quoted?: string) => {\n // A quoted run is emitted as-is; `''` is how a single quote is written.\n if (quoted !== undefined) return unquote(quoted);\n const token = part;\n switch (token) {\n case 'yyyy':\n return pad(year, 4);\n case 'yy':\n return pad(year % 100, 2);\n case 'y':\n return String(year);\n case 'MMMM':\n return monthNames[month] ?? '';\n case 'MMM':\n return monthShort[month] ?? '';\n case 'MM':\n return pad(month + 1);\n case 'M':\n return String(month + 1);\n case 'dd':\n return pad(day);\n case 'd':\n return String(day);\n case 'HH':\n return pad(hours24);\n case 'H':\n return String(hours24);\n case 'hh':\n return pad(hours12);\n case 'h':\n return String(hours12);\n case 'mm':\n return pad(minutes);\n case 'ss':\n return pad(seconds);\n case 'a':\n return this.dayPeriods()[hours24 < 12 ? 0 : 1];\n }\n return token;\n });\n }\n\n private parseWithTokens(value: string, pattern: string): Date | null {\n const tokens: string[] = [];\n // Both forms are accepted on the way IN: the formatter writes the declined one beside\n // a day (`15 марта`), and a heading or an older stored string carries the nominative.\n const monthLong = [this.monthNames('long', 'format'), this.monthNames('long', 'standalone')];\n const monthShort = [this.monthNames('short', 'format'), this.monthNames('short', 'standalone')];\n const numerals = this.localeNumerals();\n const digits = digitClass(numerals);\n const escaped = pattern.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n const regex = escaped.replace(PART_RE, (part, quoted?: string) => {\n if (quoted !== undefined) {\n // Literal text matches itself and captures nothing, so the token indices stay\n // aligned with the groups below.\n return unquote(quoted);\n }\n tokens.push(part);\n // `a` is the one token whose text is locale-dependent, so its alternation is built\n // here rather than in the pure `tokenToRegex`: the marker this adapter now PRINTS\n // has to be one the same adapter can read.\n if (part === 'a') return `(${alternation([...this.dayPeriods(), 'am', 'pm'])})`;\n return tokenToRegex(part, digits);\n });\n\n const match = new RegExp(`^${regex}$`, 'i').exec(value);\n if (!match) return null;\n\n const parts: DateParts = {};\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n const raw = match[i + 1];\n const n = digitsToNumber(raw, numerals);\n switch (token) {\n case 'yyyy':\n case 'y':\n parts.year = n;\n break;\n case 'yy':\n parts.year = 2000 + n;\n break;\n case 'MM':\n case 'M':\n parts.month = n - 1;\n break;\n case 'MMM':\n case 'MMMM': {\n const sets = token === 'MMM' ? monthShort : monthLong;\n const wanted = nameKey(raw);\n const found = sets.map(names => names.findIndex(name => nameKey(name) === wanted)).find(index => index >= 0);\n if (found === undefined) return null;\n parts.month = found;\n break;\n }\n case 'dd':\n case 'd':\n parts.day = n;\n break;\n case 'HH':\n case 'H':\n parts.hours = n;\n break;\n case 'hh':\n case 'h':\n parts.hour12 = n;\n break;\n case 'mm':\n parts.minutes = n;\n break;\n case 'ss':\n parts.seconds = n;\n break;\n case 'a': {\n const marker = nameKey(raw);\n parts.isPm = marker === 'pm' || marker === nameKey(this.dayPeriods()[1]);\n break;\n }\n }\n }\n\n return this.compose(parts);\n }\n\n /**\n * Build the parser for one named format out of the very formatter that prints it.\n *\n * `formatToParts` is the only honest source for a locale's field ORDER and its\n * literals — ru writes `dd.MM.y` with a two-digit month while its own\n * `{ month: 'numeric' }` request says one digit, ja puts the year first, and ar-SA\n * separates fields with U+200F. Names (a month, AM/PM) become an alternation of the\n * real strings; numbers accept the locale's digits AND ASCII, because a physical\n * keyboard produces the latter whatever the display shows.\n *\n * Returns `null` — meaning \"this format cannot be read back\" — rather than guessing,\n * for a field type nothing here asks for (an era, a weekday) or a numbering system\n * with no digit-by-digit reading (roman numerals). `parse` then refuses, which leaves\n * the caller's committed value untouched.\n */\n private buildNamedParser(key: WrDateFormat): NamedParser | null {\n const formatter = this.intl(key);\n const resolved = formatter.resolvedOptions();\n const numerals = numeralsFor(this.locale, resolved.numberingSystem);\n if (!numerals) return null;\n const digits = digitClass(numerals);\n\n // Distinct values in every field, so nothing below can read one field's reference\n // value out of another's position.\n const reference = new Date(2024, 0, 15, 13, 45, 56);\n const fields: NamedField[] = [];\n const fragments: { readonly source: string; readonly literal: boolean }[] = [];\n\n for (const part of formatter.formatToParts(reference)) {\n switch (part.type) {\n case 'literal':\n fragments.push({ source: literalToRegex(part.value), literal: true });\n break;\n case 'year':\n fields.push({ kind: 'year' });\n // Exactly two digits or exactly four — the shapes a year is actually written\n // in. `{1,4}` would let the third keystroke of `15.3.2026` read as the year 2\n // and commit it, which is a smaller version of the defect this replaces.\n fragments.push({ source: `(${digits}{2}|${digits}{4})`, literal: false });\n break;\n case 'month': {\n const names = this.namedMonthNames(formatter);\n if (names.every(name => isAllDigits(name, numerals))) {\n fields.push({ kind: 'month' });\n fragments.push({ source: `(${digits}{1,2})`, literal: false });\n } else {\n fields.push({ kind: 'monthName', names });\n fragments.push({ source: `(${alternation(names)})`, literal: false });\n }\n break;\n }\n case 'day':\n fields.push({ kind: 'day' });\n fragments.push({ source: `(${digits}{1,2})`, literal: false });\n break;\n case 'hour':\n fields.push({ kind: 'hour' });\n fragments.push({ source: `(${digits}{1,2})`, literal: false });\n break;\n case 'minute':\n fields.push({ kind: 'minute' });\n fragments.push({ source: `(${digits}{1,2})`, literal: false });\n break;\n case 'second':\n fields.push({ kind: 'second' });\n fragments.push({ source: `(${digits}{1,2})`, literal: false });\n break;\n case 'dayPeriod': {\n const names = this.dayPeriodNames(formatter);\n fields.push({ kind: 'dayPeriod', names });\n fragments.push({ source: `(${alternation(names)})`, literal: false });\n break;\n }\n default:\n return null;\n }\n }\n\n if (!fields.length) return null;\n\n // A trailing literal is optional. ru's medium date ends ` г.` and fi's short date\n // ends with a bare `.`; someone retyping the field types the fields and stops, and\n // refusing that would reintroduce the very \"cannot read its own output\" defect for\n // the one part of the string that carries no information.\n const source = fragments\n .map((fragment, i) =>\n i === fragments.length - 1 && fragment.literal && fragment.source ? `(?:${fragment.source})?` : fragment.source\n )\n .join('');\n\n return { regex: new RegExp(`^${source}$`, 'iu'), fields, numerals, hourCycle: resolved.hourCycle };\n }\n\n /** The twelve month strings THIS formatter writes, in its own style and context. */\n private namedMonthNames(formatter: Intl.DateTimeFormat): readonly string[] {\n const out: string[] = [];\n for (let i = 0; i < 12; i++) {\n out.push(formatter.formatToParts(new Date(2024, i, 15)).find(p => p.type === 'month')?.value ?? '');\n }\n return out;\n }\n\n /** `[am, pm]` as THIS formatter writes them — `ص` / `م` in Arabic, not AM / PM. */\n private dayPeriodNames(formatter: Intl.DateTimeFormat): readonly string[] {\n const read = (hour: number): string =>\n formatter.formatToParts(new Date(2024, 0, 15, hour, 30)).find(p => p.type === 'dayPeriod')?.value ?? '';\n return [read(9), read(21)];\n }\n\n private parseNamed(raw: string, key: WrDateFormat): Date | null {\n const { namedParsers } = this.caches();\n let parser = namedParsers.get(key);\n if (parser === undefined) {\n parser = this.buildNamedParser(key);\n namedParsers.set(key, parser);\n }\n if (!parser) return null;\n\n const match = parser.regex.exec(stripBidi(raw));\n if (!match) return null;\n\n const parts: DateParts = {};\n const twelveHour = parser.fields.some(field => field.kind === 'dayPeriod');\n\n for (let i = 0; i < parser.fields.length; i++) {\n const field = parser.fields[i];\n const captured = match[i + 1] ?? '';\n if (field.kind === 'monthName' || field.kind === 'dayPeriod') {\n const wanted = nameKey(captured);\n const index = (field.names ?? []).findIndex(name => nameKey(name) === wanted);\n if (index < 0) return null;\n if (field.kind === 'monthName') parts.month = index;\n else parts.isPm = index === 1;\n continue;\n }\n\n const n = digitsToNumber(captured, parser.numerals);\n if (Number.isNaN(n)) return null;\n switch (field.kind) {\n case 'year':\n // Two digits mean this century, the same reading the `yy` token gives — the\n // picker's own doc promises `1/5/25` cleans up to 2025.\n parts.year = captured.length <= 2 ? 2000 + n : n;\n break;\n case 'month':\n parts.month = n - 1;\n break;\n case 'day':\n parts.day = n;\n break;\n case 'hour':\n if (twelveHour) parts.hour12 = n;\n // `hourCycle: 'h24'` numbers midnight 24 rather than 0.\n else parts.hours = n === 24 && parser.hourCycle === 'h24' ? 0 : n;\n break;\n case 'minute':\n parts.minutes = n;\n break;\n case 'second':\n parts.seconds = n;\n break;\n }\n }\n\n return this.compose(parts);\n }\n\n /**\n * Assemble whatever was read into a `Date`, or refuse.\n *\n * `new Date(2025, 12, 45)` does not fail — it rolls forward into the next year — and\n * `isValid` is happy with the result, so a text field used to turn nonsense into a\n * confident wrong answer. The clock parts are range-checked directly; the month and the\n * day are checked by comparing what came back, which catches every rollover including a\n * month of 12 or -1.\n */\n private compose(parts: DateParts): Date | null {\n const now = new Date();\n const year = parts.year ?? this.getYear(now);\n const month = parts.month ?? this.getMonth(now);\n\n let hours = parts.hours ?? 0;\n if (parts.hour12 !== undefined) hours = (parts.hour12 % 12) + (parts.isPm ? 12 : 0);\n const minutes = parts.minutes ?? 0;\n const seconds = parts.seconds ?? 0;\n if (hours < 0 || hours > 23 || minutes < 0 || minutes > 59 || seconds < 0 || seconds > 59) return null;\n\n // A time-only format carries no date, and the date it should imply is TODAY — the\n // previous default was 1 January, so a picker in `mode=\"time\"` moved the model back\n // to New Year's Day as a side effect of reading a clock. The default is clamped to\n // the month it lands in, because an unclamped 31st would roll a February string\n // forward and the rollover check below would then refuse a well-formed string.\n const monthLength = new Date(year, month + 1, 0).getDate();\n const day = parts.day ?? Math.min(this.getDate(now), monthLength);\n\n if (this.zonal) {\n const wall = new Date(wrUtcTime(year, month, day, hours, minutes, seconds));\n if (wall.getUTCMonth() !== month || wall.getUTCDate() !== day) return null;\n return this.instant(wall);\n }\n\n const out = new Date(year, month, day, hours, minutes, seconds);\n // Same trap `createDate` documents: a year under 100 maps onto 1900 + year unless it\n // is written back explicitly, so `0025-08-11` used to parse as 1925.\n if (year >= 0 && year < 100) out.setFullYear(year);\n if (!this.isValid(out)) return null;\n if (out.getMonth() !== month || out.getDate() !== day) return null;\n return out;\n }\n}\n\nexport { wrIsNamedFormat };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\n/** `2026`, `2026-01` and `2026-01-01`: the forms `new Date()` reads as UTC rather than local. */\nconst ISO_DATE_ONLY = /^\\d{4}(?:-\\d{2}(?:-\\d{2})?)?$/;\n\n/**\n * Whether a value names a calendar day (`2026-01-01`, `2026-01`, `2026`) rather\n * than an instant. Such a day is the same day in every time zone, so `wrDate`\n * does not move it to the display zone.\n *\n * @internal\n */\nexport function wrIsDateOnly(value: unknown): boolean {\n return typeof value === 'string' && ISO_DATE_ONLY.test(value.trim());\n}\n\n/**\n * A string or a timestamp as a `Date`, with one exception to `new Date()`: a\n * date-only ISO string names a calendar day, so it is read as that day's LOCAL\n * midnight — the instant a date picker emits for it.\n *\n * `new Date('2026-01-01')` is UTC midnight, which west of Greenwich is the evening\n * before and east of it is later than the picked day's midnight. So a due date from\n * an API printed a day early for every American reader of `wrDate`, and\n * `WrValidators.minDate('2026-01-01')` refused 1 January in Almaty while\n * `maxDate('2026-12-31')` refused 31 December in New York. Angular's `DatePipe`\n * makes the same exception. The engine still decides what is a valid date — an\n * invalid string comes back as an invalid `Date` — and only the zone moves.\n *\n * Shared by `ngwr/pipes` and `ngwr/validators` so the two read the same string as\n * the same day; not part of the public API.\n *\n * @internal\n */\nexport function wrToLocalDate(value: string | number): Date {\n const parsed = new Date(value);\n if (typeof value !== 'string' || !ISO_DATE_ONLY.test(value) || Number.isNaN(parsed.getTime())) return parsed;\n const local = new Date(0);\n local.setFullYear(parsed.getUTCFullYear(), parsed.getUTCMonth(), parsed.getUTCDate());\n local.setHours(0, 0, 0, 0);\n return local;\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { wrToLocalDate } from './local-date';\nimport { wrResolveZone, wrUtcTime, wrZoneInstant } from './time-zone';\nimport type { WrEpochUnit, WrParseDateOptions } from './types';\n\n/** A date and a time with no zone, split by a `T` or a space. */\nconst ZONELESS = /^(\\d{4})-(\\d{2})-(\\d{2})[T ](\\d{2}):(\\d{2})(?::(\\d{2})(?:\\.(\\d+))?)?$/i;\n\n// 1e10 s and 1e13 ms are both 20 November 2286; 1e10 ms and 1e13 us are both 26 April 1970.\nconst SECONDS_BELOW = 1e10;\nconst MILLISECONDS_BELOW = 1e13;\n\nfunction fromNumber(value: number, unit: WrEpochUnit): Date {\n const size = Math.abs(value);\n const resolved = unit !== 'auto' ? unit : size < SECONDS_BELOW ? 's' : size < MILLISECONDS_BELOW ? 'ms' : 'us';\n return new Date(resolved === 's' ? value * 1000 : resolved === 'us' ? value / 1000 : value);\n}\n\n/** A zoneless date-time as a wall clock of UTC or of the display zone; `null` for a time no calendar has. */\nfunction fromWallClock(match: RegExpExecArray, options: WrParseDateOptions): Date | null {\n const [year, month, day, hours, minutes, seconds] = match.slice(1, 7).map(part => Number(part ?? 0));\n const millis = Number((match[7] ?? '').slice(0, 3).padEnd(3, '0'));\n const wall = wrUtcTime(year, month - 1, day, hours, minutes, seconds, millis);\n const read = new Date(wall);\n // `Date` carries the 31st of a short month and hour 25 over; a string that says them is refused.\n if (read.getUTCMonth() !== month - 1 || read.getUTCDate() !== day || read.getUTCHours() !== hours) return null;\n if (read.getUTCMinutes() !== minutes || read.getUTCSeconds() !== seconds) return null;\n return new Date(options.zonelessIn === 'utc' ? wall : wrZoneInstant(wall, wrResolveZone(options.timeZone)));\n}\n\n/**\n * `2026-03-01 14:30`, with optional seconds, a fraction and a zone (`Z`, `+05`,\n * `+0500`, `+05:00`): the SQL form of a date-time, a space where ISO 8601 has a `T`.\n */\nconst SPACE_SEPARATED =\n /^(\\d{4}-\\d{2}-\\d{2}) (\\d{2}:\\d{2})(?::(\\d{2})(?:\\.(\\d+))?)?(?:(Z)|([+-]\\d{2})(?::?(\\d{2}))?)?$/i;\n\nfunction fromString(value: string, options: WrParseDateOptions): Date | null {\n const text = String(value).trim();\n if (text === '') return null;\n if (options.zonelessIn === 'display' || options.zonelessIn === 'utc') {\n const zoneless = ZONELESS.exec(text);\n if (zoneless !== null) return fromWallClock(zoneless, options);\n }\n const match = SPACE_SEPARATED.exec(text);\n if (match === null) return wrToLocalDate(text);\n const [, day, time, seconds = '00', fraction, utc, hours, minutes = '00'] = match;\n const millis = fraction === undefined ? '' : `.${fraction.slice(0, 3).padEnd(3, '0')}`;\n const zone = utc !== undefined ? 'Z' : hours === undefined ? '' : `${hours}:${minutes}`;\n return new Date(`${day}T${time}:${seconds}${millis}${zone}`);\n}\n\n/**\n * What a backend sends for a date, as a `Date`, or `null` when it holds none.\n * Never an Invalid Date, so the result needs one check rather than two.\n *\n * - A `Date` comes back as it is, the same object; an Invalid Date gives `null`.\n * - A number is epoch milliseconds, or what `epochUnit` says: `'s'`, `'us'`\n * (microseconds), or `'auto'`, which reads a number under `1e10` as seconds,\n * under `1e13` as milliseconds and anything larger as microseconds, right\n * for a date from 26 April 1970 to 20 November 2286. `NaN`, an infinity and\n * a number outside the range of `Date` give `null`.\n * - `2026-03-01 14:30:00`, a space where ISO 8601 has a `T`, is rewritten to the\n * ISO form first. Chrome reads the space form and Safari gives an Invalid Date\n * for it. Seconds, a fraction and a zone are optional; the fraction is cut to\n * milliseconds and a zone of hours alone (`+05`, as PostgreSQL prints it) is\n * completed. Without a zone it is local time, as the `T` form is, unless\n * `zonelessIn` says otherwise: `'utc'` reads both forms as UTC, and\n * `'display'` as a wall clock of the `timeZone` option, the browser's zone\n * when there is none.\n * - A date-only string (`2026-03-01`, `2026-03`, `2026`) is that day's LOCAL\n * midnight, as `wrDate` and `WrValidators.minDate` read it. `new Date()` would\n * make it UTC midnight, the evening before for a reader west of Greenwich.\n * - Any other string is left to `new Date()`, so an ISO string with `Z` or an\n * offset is the instant it names.\n * - `null`, `undefined`, an empty or blank string and a string the engine\n * refuses give `null`.\n *\n * Surrounding whitespace is ignored. A plain function: no adapter and no\n * injection context, so it runs in a mapper, a resolver or a store. For the\n * same reason it does not see `withDates()`: pass the options, or\n * `inject(WrDateAdapter).parseOptions()` for the app's.\n *\n * @example\n * ```ts\n * wrParseDate('2026-03-01 14:30:00'); // 1 March 2026, 14:30 local\n * wrParseDate('2026-03-01'); // 1 March 2026, 00:00 local\n * wrParseDate('2026-03-01T09:30:00+05:00'); // that instant\n * wrParseDate(1772343000000); // epoch milliseconds\n * wrParseDate(1772343000000123, { epochUnit: 'auto' }); // microseconds, by magnitude\n * wrParseDate('2026-03-01 14:30:00', { zonelessIn: 'display', timeZone: '+0500' }); // 09:30 UTC\n * wrParseDate('n/a'); // null\n * ```\n *\n * @see https://ngwr.dev/reference/pipes/wr-date\n */\nexport function wrParseDate(\n value: Date | string | number | null | undefined,\n options: WrParseDateOptions = {}\n): Date | null {\n if (value === null || value === undefined) return null;\n const date =\n value instanceof Date\n ? value\n : typeof value === 'number'\n ? fromNumber(value, options.epochUnit ?? 'ms')\n : fromString(value, options);\n return date === null || Number.isNaN(date.getTime()) ? null : date;\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Injector, type Provider, inject, runInInjectionContext } from '@angular/core';\n\nimport { type WrFeature, wrFeature } from 'ngwr/utils';\n\nimport { WR_DATE_INPUT, WR_DATE_LOCALE, WR_DATE_STAMP_DEFAULTS, WR_DATE_TIME_ZONE } from './tokens';\nimport { WR_DATE_LOCALE_PINNED } from './tokens/wr-date-locale-pinned.token';\nimport type { WrDatesOptions } from './types';\nimport { WrDateAdapter, WrNativeDateAdapter } from './wr-date-adapter';\n\n/**\n * Replace the date adapter the calendar / date picker / time picker use, pin\n * the locale it formats in, set the time zone dates are shown in, say how a\n * backend's numbers and zoneless strings are read (`epochUnit`, `zonelessIn`),\n * or set the defaults of `wr-date-stamp`, as a feature of `provideWr()`. Optional: with no call at all they run on\n * {@link WrNativeDateAdapter} in Angular's `LOCALE_ID` and the browser's zone.\n *\n * Omit `locale` and dates follow the interface language of `provideWrI18n()`,\n * `WrI18n.use()` included, and Angular's `LOCALE_ID` in an app without it.\n * Pass one only to pin dates to something else, see {@link wrDateLocale}.\n *\n * The one feature that works in a route's `providers` as well: that subtree\n * gets an adapter of its own.\n *\n * @example\n * ```ts\n * import { provideWr } from 'ngwr';\n * import { withDates } from 'ngwr/date';\n *\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideWr(withDates({ locale: 'ru-RU' })), // pin the dates\n * // provideWr(withDates({ adapter: MyDateAdapter, locale: 'fr' })), // your own subclass\n * // provideWr(withDates({ timeZone: () => inject(AppConfig).timeZone() })), // a runtime config\n * ],\n * });\n * ```\n */\nexport function withDates(options: WrDatesOptions = {}): WrFeature<'dates'> {\n // The native class is registered here even when only `locale` is passed: the\n // root default lives in the root injector and reads the root's locale, so a\n // call in a route's providers has to build an adapter of its own.\n const providers: Provider[] = [{ provide: WrDateAdapter, useClass: options.adapter ?? WrNativeDateAdapter }];\n\n if (options.locale) {\n providers.push(\n { provide: WR_DATE_LOCALE, useValue: options.locale },\n { provide: WR_DATE_LOCALE_PINNED, useValue: true }\n );\n }\n\n const { timeZone } = options;\n if (timeZone) {\n providers.push({\n provide: WR_DATE_TIME_ZONE,\n useFactory: (): (() => string | null | undefined) => {\n if (typeof timeZone !== 'function') return () => timeZone;\n const injector = inject(Injector);\n return () => runInInjectionContext(injector, timeZone);\n },\n });\n }\n\n // Each of the two merges over what an injector above set, so a route's call\n // that names one key keeps the app's other ones.\n const { epochUnit, zonelessIn, stamp } = options;\n if (epochUnit || zonelessIn) {\n providers.push({\n provide: WR_DATE_INPUT,\n useFactory: () => {\n const above = inject(WR_DATE_INPUT, { skipSelf: true, optional: true });\n return {\n epochUnit: epochUnit ?? above?.epochUnit ?? 'ms',\n zonelessIn: zonelessIn ?? above?.zonelessIn ?? 'browser',\n };\n },\n });\n }\n if (stamp) {\n providers.push({\n provide: WR_DATE_STAMP_DEFAULTS,\n useFactory: () => ({ ...inject(WR_DATE_STAMP_DEFAULTS, { skipSelf: true, optional: true }), ...stamp }),\n });\n }\n\n return wrFeature('dates', providers);\n}\n"],"mappings":";;;;;;;;;AAqCA,MAAa,iBAAiB,IAAI,eAAuB,kBAAkB;CACzE,YAAY;CACZ,eAAe,OAAO,SAAS;AAChC,CAAA;;;;;;;AClBD,MAAa,oBAAoB,IAAI,eAAyD,qBAAqB;CACjH,YAAY;CACZ,eAAe;AAChB,CAAA;;;;;;;ACTD,MAAa,gBAAgB,IAAI,eAC/B,iBACA;CAAE,YAAY;CAAQ,gBAAgB;EAAE,WAAW;EAAM,YAAY;CAAS;AAAG,CAAE;;;;;;;ACFrF,MAAa,yBAAyB,IAAI,eAAoC,0BAA0B;CACtG,YAAY;CACZ,gBAAgB,CAAA;AACjB,CAAA;;;;;;;ACJD,MAAa,wBAAwB,IAAI,eAAwB,yBAAyB;CACxF,YAAY;CACZ,eAAe;AAChB,CAAA;;;;;;;ACJD,SAAS,YAAY,KAAW;CAC9B,IAAI;EACF,OAAO,KAAK,oBAAoB,GAAG,CAAC,CAAC,SAAS;CAChD,QAAQ;EACN,OAAO;CACT;AACF;AAwBA,SAAgB,eAAY;CAC1B,MAAM,QAAQ,OAAO,cAAc;CACnC,MAAM,OAAO,OAAO,qBAAqB,IAAI,OAAO,OAAO,gBAA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;GAAG,GAAG;EAAK;CACrG,CAAA;CAGH,OAAO,UAAU,SAAS,SAAS;AACrC"}
|
|
@@ -19,6 +19,9 @@ var WrDropdownItemHarness = class WrDropdownItemHarness extends ComponentHarness
|
|
|
19
19
|
async isDisabled() {
|
|
20
20
|
return await (await this.host()).getAttribute("aria-disabled") === "true";
|
|
21
21
|
}
|
|
22
|
+
async hasSubmenu() {
|
|
23
|
+
return await (await this.host()).getAttribute("aria-haspopup") === "menu";
|
|
24
|
+
}
|
|
22
25
|
async hasIcon() {
|
|
23
26
|
return await this.locatorForOptional(".wr-dropdown-item__icon")() !== null;
|
|
24
27
|
}
|
|
@@ -40,10 +43,10 @@ var WrDropdownItemHarness = class WrDropdownItemHarness extends ComponentHarness
|
|
|
40
43
|
* Use of this source code is governed by an MIT-style license that can be
|
|
41
44
|
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
42
45
|
*/
|
|
43
|
-
var WrDropdownHarness = class
|
|
46
|
+
var WrDropdownHarness = class extends ContentContainerComponentHarness {
|
|
44
47
|
static hostSelector = ".wr-dropdown-trigger";
|
|
45
48
|
static with(options = {}) {
|
|
46
|
-
return new HarnessPredicate(
|
|
49
|
+
return new HarnessPredicate(this, options).addOption("text", options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getTriggerText(), text)).addOption("open", options.open, async (harness, open) => await harness.isOpen() === open);
|
|
47
50
|
}
|
|
48
51
|
async getTriggerText() {
|
|
49
52
|
return (await this.host()).text();
|
|
@@ -107,6 +110,17 @@ var WrDropdownHarness = class WrDropdownHarness extends ContentContainerComponen
|
|
|
107
110
|
}
|
|
108
111
|
await item.click();
|
|
109
112
|
}
|
|
113
|
+
async openSubmenu(text) {
|
|
114
|
+
await this.open();
|
|
115
|
+
const submenu = await this.getHarnessOrNull(WrDropdownSubmenuHarness.with({ text }));
|
|
116
|
+
if (!submenu) {
|
|
117
|
+
const offered = await this.getAllHarnesses(WrDropdownSubmenuHarness);
|
|
118
|
+
const labels = await Promise.all(offered.map((item) => item.getTriggerText()));
|
|
119
|
+
throw new Error(`WrDropdownHarness.openSubmenu(): no item labelled ${String(text)} opens a submenu. Items with a submenu here: ${labels.join(", ") || "none"}.`);
|
|
120
|
+
}
|
|
121
|
+
await submenu.open();
|
|
122
|
+
return submenu;
|
|
123
|
+
}
|
|
110
124
|
async getFocusedItemText() {
|
|
111
125
|
for (const item of await this.getItems()) if (await item.isFocused()) return item.getText();
|
|
112
126
|
return null;
|
|
@@ -123,6 +137,27 @@ var WrDropdownHarness = class WrDropdownHarness extends ContentContainerComponen
|
|
|
123
137
|
return id;
|
|
124
138
|
}
|
|
125
139
|
};
|
|
126
|
-
|
|
140
|
+
var WrDropdownSubmenuHarness = class extends WrDropdownHarness {
|
|
141
|
+
static hostSelector = ".wr-dropdown-submenu-trigger";
|
|
142
|
+
async open() {
|
|
143
|
+
if (await this.isOpen()) return;
|
|
144
|
+
await (await this.host()).click();
|
|
145
|
+
if (await this.isOpen()) return;
|
|
146
|
+
throw new Error("WrDropdownSubmenuHarness.open(): clicking the item did not open its submenu. A disabled item opens nothing, and neither does one whose own menu has closed; check isOpen() on the level above.");
|
|
147
|
+
}
|
|
148
|
+
async openByKeyboard() {
|
|
149
|
+
if (await this.isOpen()) return;
|
|
150
|
+
await (await this.host()).sendKeys(TestKey.ENTER);
|
|
151
|
+
if (await this.isOpen()) return;
|
|
152
|
+
throw new Error("WrDropdownSubmenuHarness.openByKeyboard(): Enter on the item did not open its submenu. Enter reaches it through `<wr-dropdown-item>`, so check that the directive sits on one and that it is enabled.");
|
|
153
|
+
}
|
|
154
|
+
async close() {
|
|
155
|
+
if (!await this.isOpen()) return;
|
|
156
|
+
await (await this.menu()).sendKeys(TestKey.ESCAPE);
|
|
157
|
+
if (!await this.isOpen()) return;
|
|
158
|
+
throw new Error("WrDropdownSubmenuHarness.close(): the submenu is still open after Escape was typed in it.");
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
export { WrDropdownHarness, WrDropdownItemHarness, WrDropdownSubmenuHarness };
|
|
127
162
|
|
|
128
163
|
//# sourceMappingURL=ngwr-dropdown-testing.mjs.map
|