@smartsoft001-mobilems/creators-shell-angular 2.123.0 → 2.125.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.
@@ -1 +1 @@
1
- {"version":3,"file":"smartsoft001-mobilems-creators-shell-angular.mjs","sources":["../../../../../../packages/creators/shell/angular/src/lib/tools/creators-index.ts","../../../../../../packages/creators/shell/angular/src/lib/tools/creators-url.ts","../../../../../../packages/creators/shell/angular/src/lib/services/creators.service.ts","../../../../../../packages/creators/shell/angular/src/lib/tools/creator-fields.ts","../../../../../../packages/creators/shell/angular/src/lib/tools/creators-letter-groups.ts","../../../../../../packages/creators/shell/angular/src/lib/tools/creators-filter.ts","../../../../../../packages/creators/shell/angular/src/lib/tools/creators-list-seo.ts","../../../../../../packages/creators/shell/angular/src/lib/catalog/creators-list-context.ts","../../../../../../packages/creators/shell/angular/src/lib/catalog/create-creators-catalog.ts","../../../../../../packages/creators/shell/angular/src/lib/catalog/creators-index-base.component.ts","../../../../../../packages/creators/shell/angular/src/lib/catalog/creators-jump-to-base.component.ts","../../../../../../packages/creators/shell/angular/src/lib/catalog/creators-catalog-base.component.ts","../../../../../../packages/creators/shell/angular/src/lib/catalog/creators-filters-base.component.ts","../../../../../../packages/creators/shell/angular/src/lib/catalog/creator-card-base.component.ts","../../../../../../packages/creators/shell/angular/src/lib/catalog/creators-search-list-base.component.ts","../../../../../../packages/creators/shell/angular/src/lib/catalog/creator-details-base.component.ts","../../../../../../packages/creators/shell/angular/src/smartsoft001-mobilems-creators-shell-angular.ts"],"sourcesContent":["import { Creator } from '@smartsoft001-mobilems/creators-domain';\n\n// prettier-ignore\nexport const CREATORS_ALPHABET = [\n 'A', 'Ą', 'B', 'C', 'Ć', 'D', 'E', 'Ę', 'F', 'G', 'H', 'I', 'J', 'K', 'L',\n 'Ł', 'M', 'N', 'Ń', 'O', 'Ó', 'P', 'Q', 'R', 'S', 'Ś', 'T', 'U', 'V', 'W',\n 'X', 'Y', 'Z', 'Ź', 'Ż', '#',\n] as const;\n\nexport type CreatorsLetter = (typeof CREATORS_ALPHABET)[number];\n\n/**\n * `sw=` prefixes queried for the `#` bucket (the API has no \"not a letter\" filter).\n *\n * `\"` and `„` are deliberately absent: the API treats them as a wildcard and\n * returns every creator (all 8 pages). The foreign initials (`Č`, `Š`, `Ž`) are\n * the ones present in the data today; `sw` is diacritic-sensitive, so a new one\n * only needs to be appended here. Prefixes without matches answer 404 and give `[]`.\n */\n// prettier-ignore\nexport const CREATORS_HASH_PREFIXES: readonly string[] = [\n '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n '[', '(', \"'\", '-',\n 'Č', 'Š', 'Ž',\n];\n\nfunction isCreatorsLetter(value: string): value is CreatorsLetter {\n return (CREATORS_ALPHABET as readonly string[]).includes(value);\n}\n\n/** Index letter of a name; anything outside the polish alphabet lands in `#`. */\nexport function creatorsLetterOf(name: string): CreatorsLetter {\n const [first = ''] = Array.from(name.trim());\n const upper = first.toLocaleUpperCase('pl');\n\n return isCreatorsLetter(upper) ? upper : '#';\n}\n\nconst CREATORS_POLISH_LETTERS = new Set(CREATORS_ALPHABET.slice(0, -1));\n\n/** Polish letters stay as they are; foreign diacritics fold to the base letter (é to e). */\nfunction creatorsFoldForeign(char: string): string {\n return CREATORS_POLISH_LETTERS.has(\n char.toLocaleUpperCase('pl') as CreatorsLetter,\n )\n ? char\n : char.normalize('NFD').replace(/\\p{M}/gu, '');\n}\n\n/**\n * Two-character group prefix (\"Ab\"); a single character when the second one is\n * not a letter. A foreign second letter joins its base group (\"Béraud\" is \"Be\").\n */\nexport function creatorsPrefixOf(name: string): string {\n const [first = '', second = ''] = Array.from(name.trim());\n const head = first.toLocaleUpperCase('pl');\n\n return /^\\p{L}$/u.test(second)\n ? head + creatorsFoldForeign(second).toLocaleLowerCase('pl')\n : head;\n}\n\nexport interface ICreatorsPrefixGroup {\n prefix: string;\n items: Creator[];\n}\n\nconst creatorsCollator = new Intl.Collator('pl', { sensitivity: 'base' });\n\n/** Creators grouped by `creatorsPrefixOf`, groups and items in polish alphabetical order. */\nexport function groupCreatorsByPrefix(\n items: readonly Creator[],\n): ICreatorsPrefixGroup[] {\n const groups = new Map<string, Creator[]>();\n const nameOf = (item: Creator): string => item.name ?? '';\n const sorted = [...items].sort((a, b) =>\n creatorsCollator.compare(nameOf(a), nameOf(b)),\n );\n\n for (const item of sorted) {\n const prefix = creatorsPrefixOf(nameOf(item));\n const group = groups.get(prefix);\n\n if (group) group.push(item);\n else groups.set(prefix, [item]);\n }\n\n return Array.from(groups, ([prefix, groupItems]) => ({\n prefix,\n items: groupItems,\n })).sort((a, b) => creatorsCollator.compare(a.prefix, b.prefix));\n}\n\n/**\n * API prefix (`GET dictionary/Creator/prefixes/{letter}` gives `AB`, `BÉ`, `A.`)\n * in the form the index shows it: `Ab`.\n */\nexport function creatorsDisplayPrefix(raw: string): string {\n const [head = '', ...rest] = Array.from(raw);\n\n return head + rest.join('').toLocaleLowerCase('pl');\n}\n\n/**\n * Index group of a creator, for links back to the index: the first two\n * characters as the API lists them (`Ab`, `Bé`, `A.`), or the local `#` group.\n */\nexport function creatorsIndexPrefixOf(name: string): string {\n const trimmed = name.trim();\n if (creatorsLetterOf(trimmed) === '#') return creatorsPrefixOf(trimmed);\n\n return creatorsDisplayPrefix(\n Array.from(trimmed).slice(0, 2).join('').toLocaleUpperCase('pl'),\n );\n}\n\n/**\n * The prefix of `prefixes` the address names (`?prefiks=`, `#Ab`), case\n * ignored. Diacritics count: the API keeps `Be` and `Bé` apart.\n */\nexport function creatorsFindPrefix(\n raw: string | null,\n prefixes: readonly string[],\n): string | null {\n if (!raw) return null;\n const upper = raw.toLocaleUpperCase('pl');\n\n return (\n prefixes.find((prefix) => prefix.toLocaleUpperCase('pl') === upper) ?? null\n );\n}\n\n/** `?litera=` query param to index letter; invalid or missing falls back to `A`. */\nexport function parseCreatorsLetter(raw: string | null): CreatorsLetter {\n const upper = (raw ?? '').toLocaleUpperCase('pl');\n\n return isCreatorsLetter(upper) ? upper : 'A';\n}\n\n/**\n * DOM id of a prefix group. Hex code points keep `[`, `'` etc. selector-safe.\n * `base` is the museum's own anchor prefix (sztuki uses `artysci`).\n */\nexport function creatorsPrefixAnchor(prefix: string, base = 'tworcy'): string {\n const codePoints = Array.from(prefix, (char) =>\n (char.codePointAt(0) ?? 0).toString(16),\n );\n\n return [base, ...codePoints].join('-');\n}\n\nexport type CreatorsFragmentTarget =\n { anchor: string } | { letter: CreatorsLetter };\n\n/**\n * `#fragment` from the address to where the index should go: a group anchor\n * (as written), a group prefix (`#Ba`), or a letter (`#B`), which switches\n * `?litera=` first and then lands on that letter's first group.\n */\nexport function resolveCreatorsFragment(\n fragment: string,\n letter: CreatorsLetter,\n groups: readonly { prefix: string; anchor: string }[],\n): CreatorsFragmentTarget | null {\n let raw = fragment;\n try {\n raw = decodeURIComponent(fragment);\n } catch {\n // Malformed escape: match the fragment as written.\n }\n\n const byAnchor = groups.find((group) => group.anchor === raw);\n if (byAnchor) return { anchor: byAnchor.anchor };\n\n const exact = creatorsFindPrefix(\n raw,\n groups.map((group) => group.prefix),\n );\n const byPrefix =\n groups.find((group) => group.prefix === exact) ??\n groups.find((group) => creatorsCollator.compare(group.prefix, raw) === 0);\n if (byPrefix) return { anchor: byPrefix.anchor };\n\n const upper = raw.toLocaleUpperCase('pl');\n if (isCreatorsLetter(upper)) {\n if (upper !== letter) return { letter: upper };\n return groups.length ? { anchor: groups[0].anchor } : null;\n }\n\n // A prefix of another letter (`#Cz` on A) or of the `#` bucket (`#1`,\n // `#Ša`): switch letters first, then the prefix resolves.\n const chars = Array.from(raw);\n if (chars.length <= 2 && !/\\s/u.test(raw)) {\n const prefixLetter = creatorsLetterOf(raw);\n if (prefixLetter !== letter) return { letter: prefixLetter };\n }\n\n return null;\n}\n","import { yearRangeValue } from '@smartsoft001-mobilems/angular';\nimport { ICreatorRelated } from '@smartsoft001-mobilems/creators-domain';\nimport { ICreatorsQueryDto } from '@smartsoft001-mobilems/creators-shell-dtos';\n\nconst FULL_DATE = /^\\d{4}-\\d{2}-\\d{2}$/;\n\nfunction creatorsUrlBirth(value: string, bound: 'from' | 'to'): string {\n const trimmed = value.trim();\n\n return FULL_DATE.test(trimmed) ? trimmed : yearRangeValue(trimmed, bound);\n}\n\n/**\n * List/search url of the Creator dictionary. An empty `q=` or `sw=` empties the list (404), so blank\n * values are omitted. The birth range is the only working date filter and needs `YYYY-MM-DD`.\n */\nexport function creatorsListUrl(\n apiUrl: string,\n query: ICreatorsQueryDto,\n): string {\n let url = `${apiUrl}dictionary/Creator/search/page/${query.page ?? 1}?maxPerPage=${query.maxPerPage ?? 24}`;\n\n if (query.extraData !== false) url += '&extraData=true';\n\n const q = query.q?.trim();\n const sw = query.sw?.trim();\n\n if (q) url += `&q=${encodeURIComponent(q)}`;\n const lastNameSw = query.lastNameSw?.trim();\n\n if (sw) url += `&sw=${encodeURIComponent(sw)}`;\n if (lastNameSw) url += `&lastNameSw=${encodeURIComponent(lastNameSw)}`;\n if (query.sort) url += `&sort=${query.sort}`;\n if (query.birthFrom?.trim()) {\n url += `&filter[dateFrom][from]=${creatorsUrlBirth(query.birthFrom, 'from')}`;\n }\n if (query.birthTo?.trim()) {\n url += `&filter[dateFrom][to]=${creatorsUrlBirth(query.birthTo, 'to')}`;\n }\n\n return url;\n}\n\n/** Works (objects) of one creator; `authors[].id` of an object is the Creator id. */\nexport function creatorWorksUrl(\n apiUrl: string,\n id: string | number,\n page = 1,\n limit = 12,\n): string {\n return `${apiUrl}search/Object/page/${page}?maxPerPage=${limit}&filter[creators][]=${encodeURIComponent(String(id))}`;\n}\n\n/** Two-letter groups of an index letter (lower-case, encoded), e.g. `prefixes/b`. */\nexport function creatorsPrefixesUrl(apiUrl: string, letter: string): string {\n return `${apiUrl}dictionary/Creator/prefixes/${encodeURIComponent(letter.toLocaleLowerCase('pl'))}`;\n}\n\n/** The creator profile (MOB-1972). Only some API hosts have it; the others answer 404. */\nexport function creatorProfileUrl(apiUrl: string, id: string | number): string {\n return `${apiUrl}creator/${encodeURIComponent(String(id))}`;\n}\n\n/** The Creator dictionary entry: every API host has it. */\nexport function creatorDictionaryUrl(\n apiUrl: string,\n id: string | number,\n): string {\n return `${apiUrl}dictionary/Creator/${encodeURIComponent(String(id))}`;\n}\n\n/**\n * First page of a related list of `creator/{id}` (`/api/search/Object/page/{page}?filter[…]`) with `maxPerPage`;\n * `null` for a list without a path or results (no request needed).\n */\nexport function creatorRelatedUrl(\n apiUrl: string,\n related: ICreatorRelated | null | undefined,\n limit: number,\n): string | null {\n if (!related?.path || !related.count) return null;\n\n const path = related.path.replace(/^\\/?api\\//, '').replace('{page}', '1');\n const separator = path.includes('?') ? '&' : '?';\n\n return `${apiUrl}${path}${separator}maxPerPage=${limit}`;\n}\n","import { HttpClient, HttpErrorResponse } from '@angular/common/http';\nimport { inject, Injectable } from '@angular/core';\nimport {\n catchError,\n forkJoin,\n map,\n Observable,\n of,\n OperatorFunction,\n shareReplay,\n switchMap,\n throwError,\n} from 'rxjs';\n\nimport { SharedConfig } from '@smartsoft001-mobilems/angular';\nimport {\n Creator,\n ICreatorRelated,\n} from '@smartsoft001-mobilems/creators-domain';\nimport {\n CreatorRawDto,\n ICreatorDetailsResponseDto,\n ICreatorsListResponseDto,\n ICreatorsPrefixesResponseDto,\n ICreatorsQueryDto,\n ICreatorWorksResponseDto,\n} from '@smartsoft001-mobilems/creators-shell-dtos';\nimport { MsObject } from '@smartsoft001-mobilems/objects-domain';\n\nimport {\n CREATORS_HASH_PREFIXES,\n creatorsDisplayPrefix,\n creatorsLetterOf,\n CreatorsLetter,\n creatorsPrefixOf,\n groupCreatorsByPrefix,\n} from '../tools/creators-index';\nimport {\n creatorDictionaryUrl,\n creatorProfileUrl,\n creatorRelatedUrl,\n creatorsListUrl,\n creatorsPrefixesUrl,\n creatorWorksUrl,\n} from '../tools/creators-url';\n\nexport interface ICreatorsPage {\n items: Creator[];\n total: number;\n pages: number;\n}\n\nexport interface ICreatorWorksPage {\n items: MsObject[];\n total: number;\n}\n\nconst CREATORS_ALL_PAGE_SIZE = 500;\n\nconst creatorsServiceCollator = new Intl.Collator('pl', {\n sensitivity: 'base',\n});\n\n@Injectable({ providedIn: 'root' })\nexport class CreatorsService {\n private readonly creatorsServiceHttp = inject(HttpClient);\n private readonly creatorsServiceConfig = inject(SharedConfig);\n /** The `#` bucket, loaded once per `apiUrl` for its prefixes and its groups. */\n private creatorsServiceHashCache: {\n apiUrl: string;\n items$: Observable<Creator[]>;\n } | null = null;\n\n getPage(query: ICreatorsQueryDto): Observable<ICreatorsPage> {\n return this.creatorsServiceGetRaw(query).pipe(\n map(({ data }) => ({\n items: this.creatorsServiceNormalise(data?.items),\n total: data?.paginatorDetails?.totalItemsCount ?? 0,\n pages: data?.paginatorDetails?.totalPagesCount ?? 0,\n })),\n this.creatorsServiceOnNotFound<ICreatorsPage>({\n items: [],\n total: 0,\n pages: 0,\n }),\n );\n }\n\n /** Every page at `maxPerPage=500`, in page order. */\n getAll(\n query: Omit<ICreatorsQueryDto, 'page' | 'maxPerPage'> = {},\n ): Observable<Creator[]> {\n const pageQuery = (page: number): ICreatorsQueryDto => ({\n ...query,\n page,\n maxPerPage: CREATORS_ALL_PAGE_SIZE,\n });\n\n return this.creatorsServiceGetRaw(pageQuery(1)).pipe(\n switchMap(({ data }) => {\n const first = this.creatorsServiceNormalise(data?.items);\n const total = data?.paginatorDetails?.totalPagesCount ?? 1;\n const rest = Array.from({ length: Math.max(total - 1, 0) }, (_, i) =>\n this.creatorsServiceGetRaw(pageQuery(i + 2)),\n );\n\n if (!rest.length) return of(first);\n\n return forkJoin(rest).pipe(\n map((pages) =>\n first.concat(\n ...pages.map((page) =>\n this.creatorsServiceNormalise(page.data?.items),\n ),\n ),\n ),\n );\n }),\n this.creatorsServiceOnNotFound<Creator[]>([]),\n );\n }\n\n /**\n * Creators on one index letter. `#` has no API filter, so it merges the\n * `CREATORS_HASH_PREFIXES` searches (deduped by id). The result is re-checked with\n * `creatorsLetterOf`, because `sw` also matches beyond the letter. `q` and the birth\n * range go to every call.\n */\n getByLetter(\n letter: CreatorsLetter,\n query?: Pick<ICreatorsQueryDto, 'q' | 'birthFrom' | 'birthTo'>,\n ): Observable<Creator[]> {\n const items$ =\n letter === '#'\n ? forkJoin(\n CREATORS_HASH_PREFIXES.map((prefix) =>\n this.getAll({ ...query, sw: prefix }),\n ),\n ).pipe(map((lists) => this.creatorsServiceUniqueById(lists.flat())))\n : this.getAll({ ...query, sw: letter });\n\n return items$.pipe(\n map((items) =>\n items.filter((item) => creatorsLetterOf(item.name ?? '') === letter),\n ),\n );\n }\n\n /**\n * Two-letter groups of an index letter (MOB-1959): the API lists them (`AB`,\n * `BÉ`, `A.`), the index shows them as `Ab`. The `#` bucket has no API prefixes,\n * so its groups come from the loaded entries. The prefixes endpoint and\n * `lastNameSw` exist on the staging API; check the museum's API before use.\n */\n getPrefixes(letter: CreatorsLetter): Observable<string[]> {\n if (letter === '#') {\n return this.creatorsServiceGetHashCreators().pipe(\n map((items) =>\n groupCreatorsByPrefix(items).map((group) => group.prefix),\n ),\n );\n }\n\n return this.creatorsServiceHttp\n .get<ICreatorsPrefixesResponseDto>(\n creatorsPrefixesUrl(this.creatorsServiceConfig.apiUrl, letter),\n )\n .pipe(\n map(({ data }) => [\n ...new Set(\n (data?.items ?? [])\n .map(creatorsDisplayPrefix)\n .filter((prefix) => creatorsLetterOf(prefix) === letter),\n ),\n ]),\n this.creatorsServiceOnNotFound<string[]>([]),\n );\n }\n\n /**\n * Creators of one index group: every page of `lastNameSw`, in polish order.\n * `#` filters its loaded entries.\n */\n getByIndexPrefix(\n letter: CreatorsLetter,\n prefix: string,\n ): Observable<Creator[]> {\n if (letter === '#') {\n return this.creatorsServiceGetHashCreators().pipe(\n map((items) =>\n items.filter((item) => creatorsPrefixOf(item.name ?? '') === prefix),\n ),\n );\n }\n\n return this.getAll({ lastNameSw: prefix, sort: 'default' }).pipe(\n map((items) =>\n items\n .filter((item) => creatorsLetterOf(item.name ?? '') === letter)\n .sort((a, b) =>\n creatorsServiceCollator.compare(a.name ?? '', b.name ?? ''),\n ),\n ),\n );\n }\n\n /**\n * The creator profile `creator/{id}` (MOB-1972: life years, editorial biography, portrait, lead artwork, tags and\n * related lists). An API host without it answers 404, so the dictionary entry `dictionary/Creator/{id}` is read\n * then. `null` when both answer 404.\n */\n getById(id: string | number): Observable<Creator | null> {\n const apiUrl = this.creatorsServiceConfig.apiUrl;\n\n return this.creatorsServiceGetOne(creatorProfileUrl(apiUrl, id)).pipe(\n catchError((error: unknown) =>\n error instanceof HttpErrorResponse && error.status === 404\n ? this.creatorsServiceGetOne(creatorDictionaryUrl(apiUrl, id)).pipe(\n this.creatorsServiceOnNotFound<Creator | null>(null),\n )\n : throwError(() => error),\n ),\n );\n }\n\n /** First works of a creator (`filter[creators][]`), `limit` per page; page 1 by default. */\n getWorks(\n id: string | number,\n limit?: number,\n page?: number,\n ): Observable<ICreatorWorksPage> {\n return this.creatorsServiceGetObjects(\n creatorWorksUrl(this.creatorsServiceConfig.apiUrl, id, page, limit),\n );\n }\n\n /** First page of a related list of `creator/{id}` (MOB-1963); no request for an empty one. */\n getRelated(\n related: ICreatorRelated | null | undefined,\n limit: number,\n ): Observable<ICreatorWorksPage> {\n const url = creatorRelatedUrl(\n this.creatorsServiceConfig.apiUrl,\n related,\n limit,\n );\n\n return url\n ? this.creatorsServiceGetObjects(url)\n : of<ICreatorWorksPage>({ items: [], total: 0 });\n }\n\n /**\n * `getByLetter('#')` shared by the prefixes and the groups. It is kept per `apiUrl`\n * (another API loads it again); a failure is not kept.\n */\n private creatorsServiceGetHashCreators(): Observable<Creator[]> {\n const apiUrl = this.creatorsServiceConfig.apiUrl;\n\n if (this.creatorsServiceHashCache?.apiUrl !== apiUrl) {\n const cache = {\n apiUrl,\n items$: this.getByLetter('#').pipe(\n catchError((error: unknown) => {\n if (this.creatorsServiceHashCache === cache) {\n this.creatorsServiceHashCache = null;\n }\n\n return throwError(() => error);\n }),\n shareReplay({ bufferSize: 1, refCount: false }),\n ),\n };\n this.creatorsServiceHashCache = cache;\n }\n\n return this.creatorsServiceHashCache.items$;\n }\n\n private creatorsServiceGetOne(url: string): Observable<Creator | null> {\n return this.creatorsServiceHttp\n .get<ICreatorDetailsResponseDto>(url)\n .pipe(\n map(({ data }) =>\n data ? this.creatorsServiceNormaliseOne(data) : null,\n ),\n );\n }\n\n private creatorsServiceGetObjects(\n url: string,\n ): Observable<ICreatorWorksPage> {\n return this.creatorsServiceHttp\n .get<ICreatorWorksResponseDto<MsObject>>(url)\n .pipe(\n map(({ data }) => ({\n items: data?.items ?? [],\n total: data?.paginatorDetails?.totalItemsCount ?? 0,\n })),\n this.creatorsServiceOnNotFound<ICreatorWorksPage>({\n items: [],\n total: 0,\n }),\n );\n }\n\n private creatorsServiceGetRaw(\n query: ICreatorsQueryDto,\n ): Observable<ICreatorsListResponseDto> {\n return this.creatorsServiceHttp.get<ICreatorsListResponseDto>(\n creatorsListUrl(this.creatorsServiceConfig.apiUrl, query),\n );\n }\n\n private creatorsServiceNormalise(items?: CreatorRawDto[]): Creator[] {\n return (items ?? []).map((item) => this.creatorsServiceNormaliseOne(item));\n }\n\n /** First occurrence wins: the `#` prefixes can return the same creator twice. */\n private creatorsServiceUniqueById(items: Creator[]): Creator[] {\n const seen = new Set<string>();\n\n return items.filter(({ id }) => !seen.has(id) && !!seen.add(id));\n }\n\n /** The API sends `id` as a JSON number in the list and the detail; the entity keys on a string. */\n private creatorsServiceNormaliseOne(item: CreatorRawDto): Creator {\n return { ...item, id: String(item.id) } as Creator;\n }\n\n /** The API answers 404 (`NO_RESULTS_FOR_GIVEN_QUERY`, `RECORD_NOT_FOUND`) for no data. */\n private creatorsServiceOnNotFound<R>(fallback: R): OperatorFunction<R, R> {\n return catchError((error: unknown) =>\n error instanceof HttpErrorResponse && error.status === 404\n ? of(fallback)\n : throwError(() => error),\n );\n }\n}\n","import { SlugService } from '@smartsoft001/utils';\n\nimport { decodeHtmlEntities, stripHtml } from '@smartsoft001-mobilems/angular';\nimport {\n Creator,\n CreatorDictValue,\n} from '@smartsoft001-mobilems/creators-domain';\n\n/** Label of a dictionary value: an entry gives its name, text and numbers are shown as they are. */\nexport function creatorDictLabel(\n value: CreatorDictValue | null | undefined,\n): string {\n if (value === null || value === undefined) return '';\n\n return typeof value === 'object' ? (value.name ?? '') : String(value);\n}\n\n/**\n * \"Kobro, Katarzyna\" gives \"Katarzyna Kobro\". Only with exactly one comma:\n * other forms (groups, pseudonyms) stay as they are.\n */\nexport function creatorDisplayName(name: string | null | undefined): string {\n const text = name ?? '';\n const parts = text.split(',');\n\n if (parts.length !== 2) return text.trim();\n\n const [surname, first] = parts.map((part) => part.trim());\n\n return [first, surname].filter(Boolean).join(' ');\n}\n\nconst CREATOR_YEAR = /\\d{4}/g;\n\n/**\n * Life years only: \"1898.1.26 - 1951.2.26\" gives \"1898–1951\". Without a period\n * they come from `dateFrom`/`dateTo`. A period given as a dictionary id has no dates.\n */\nexport function creatorLifeYears(\n item: Pick<Creator, 'period' | 'dateFrom' | 'dateTo'>,\n): string | undefined {\n const { period } = item;\n const periodName =\n typeof period === 'string'\n ? period\n : typeof period === 'object' && period !== null\n ? period.name\n : undefined;\n const source =\n periodName?.trim() || `${item.dateFrom ?? ''} ${item.dateTo ?? ''}`;\n\n return source.match(CREATOR_YEAR)?.join('–');\n}\n\n/** A name from the CMS can be HTML with entities: plain text, spaces collapsed. */\nexport function creatorPlainName(name: string | null | undefined): string {\n return decodeHtmlEntities(stripHtml(name ?? ''))\n .replace(/\\s+/g, ' ')\n .trim();\n}\n\n/** Ends of blocks and line breaks: words on both sides must stay apart once the tags go. */\nconst CREATOR_BLOCK_BREAK = /<\\/(?:p|div|li|h[1-6]|blockquote)>|<br\\s*\\/?>/gi;\n/** Comments, MSO conditional blocks (`<!--[if gte mso 9]>...<![endif]-->`) included. */\nconst CREATOR_HTML_COMMENT = /<!--[\\s\\S]*?-->/g;\n\n/** A biography as one line of text. `MuseumSeoService` decodes entities and truncates. */\nexport function creatorPlainText(html: string | null | undefined): string {\n return stripHtml(\n (html ?? '')\n .replace(CREATOR_HTML_COMMENT, '')\n .replace(CREATOR_BLOCK_BREAK, '$& '),\n )\n .replace(/\\s+/g, ' ')\n .trim();\n}\n\n/**\n * Roles to show: `roleName`, else the name of a `role` object or a textual\n * `role` string, then the additional roles. A numeric or id-like `role` (`366`,\n * `'366'`) is never shown.\n * Trimmed, empty ones dropped, deduped case-insensitively.\n */\nexport function creatorRoles(\n creator:\n Pick<Creator, 'role' | 'roleName' | 'additionalRoles'> | null | undefined,\n): string[] {\n if (!creator) return [];\n\n const { role } = creator;\n const roleName =\n typeof role === 'object' && role !== null\n ? role.name\n : typeof role === 'string' && !/^\\d+$/.test(role.trim())\n ? role\n : undefined;\n const names = [\n creator.roleName?.trim() || roleName,\n ...(creator.additionalRoles ?? []).map((entry) => entry?.name),\n ];\n const seen = new Set<string>();\n const result: string[] = [];\n\n for (const name of names) {\n const text = name?.trim();\n const key = text?.toLocaleLowerCase('pl');\n\n if (!text || !key || seen.has(key)) continue;\n\n seen.add(key);\n result.push(text);\n }\n\n return result;\n}\n\n/** URL slug of the creator: the display name without markup. */\nexport function creatorSlug(creator: Pick<Creator, 'name'>): string {\n return SlugService.create(creatorDisplayName(creatorPlainName(creator.name)));\n}\n\n/** Router commands to the details page: `[path, id, slug]`, or `[path, id]` for an empty slug. */\nexport function creatorDetailsCommands(\n path: string,\n creator: Pick<Creator, 'id' | 'name'>,\n): string[] {\n const slug = creatorSlug(creator);\n\n return slug ? [path, creator.id, slug] : [path, creator.id];\n}\n\nconst CREATOR_DATE_YEAR = /^(\\d{4})-\\d{2}-\\d{2}/;\n\n/**\n * Years under the name (museum-artists `artistYears`, MOB-1972): \"1898 – 1951\". The years of the full dates\n * (`birthDate`/`deathDate`) first, then the ready `lifeYears`, then `birthYear`/`deathYear`, then the years in the\n * period; `''` without any.\n */\nexport function creatorYears(\n creator: Pick<\n Creator,\n | 'period'\n | 'lifeYears'\n | 'birthDate'\n | 'deathDate'\n | 'birthYear'\n | 'deathYear'\n >,\n): string {\n const born = CREATOR_DATE_YEAR.exec(creator.birthDate ?? '')?.[1];\n const died = CREATOR_DATE_YEAR.exec(creator.deathDate ?? '')?.[1];\n if (born || died) return [born ?? '?', died ?? ''].join(' – ').trim();\n\n const ready = creator.lifeYears?.trim();\n if (ready) return ready;\n\n const bornYear = creator.birthYear ?? '';\n const diedYear = creator.deathYear ?? '';\n if (bornYear || diedYear) {\n return [bornYear, diedYear].filter(Boolean).join(' – ');\n }\n\n const { period } = creator;\n const text =\n typeof period === 'string'\n ? period\n : typeof period === 'object' && period !== null\n ? (period.name ?? '')\n : '';\n\n return (text.match(CREATOR_YEAR) ?? []).slice(0, 2).join(' – ');\n}\n\n/** HTML whose text, without comments (MSO blocks), tags and entities (`&nbsp;`), is empty. */\nfunction creatorLooksEmpty(html: string): boolean {\n return !decodeHtmlEntities(\n stripHtml(html.replace(CREATOR_HTML_COMMENT, '')),\n ).trim();\n}\n\n/**\n * The biography html to show (museum-artists `artistBiography`): `editorialBiography`, then `biography`, then\n * `description`, trimmed. A field that only looks filled (`<p>&nbsp;</p>`, Word's `<!--[if gte mso 9]>` blocks) is\n * skipped; `''` without any.\n */\nexport function creatorBiography(\n creator:\n | Pick<Creator, 'editorialBiography' | 'biography' | 'description'>\n | null\n | undefined,\n): string {\n if (!creator) return '';\n\n for (const html of [\n creator.editorialBiography,\n creator.biography,\n creator.description,\n ]) {\n const value = html?.trim() ?? '';\n if (value && !creatorLooksEmpty(value)) return value;\n }\n\n return '';\n}\n\n/** About six lines of the content column: a longer biography folds (\"rozwiń tekst\"). */\nconst CREATOR_FOLD_CHARS = 600;\n\nfunction creatorBiographyText(html: string | null | undefined): string {\n return decodeHtmlEntities(creatorPlainText(html)).replace(/\\s+/g, ' ').trim();\n}\n\n/** Whether the biography is longer than the folded view (600 characters of text). */\nexport function creatorIsLongBiography(\n html: string | null | undefined,\n): boolean {\n return creatorBiographyText(html).length > CREATOR_FOLD_CHARS;\n}\n\n/** The start of the biography for the folded view: plain text, cut at a word, with an ellipsis. */\nexport function creatorBiographyExcerpt(\n html: string | null | undefined,\n): string {\n const text = creatorBiographyText(html);\n if (text.length <= CREATOR_FOLD_CHARS) return text;\n\n const cut = text.slice(0, CREATOR_FOLD_CHARS);\n const space = cut.lastIndexOf(' ');\n\n return `${(space > 0 ? cut.slice(0, space) : cut).replace(/[\\s,.;:–-]+$/, '')}…`;\n}\n","import { Creator } from '@smartsoft001-mobilems/creators-domain';\n\n/**\n * Group letter of a name: diacritics folded (NFD), only letters and digits\n * kept, the first one upper-cased. `Ł` has no decomposition, so it stays its\n * own letter. No letter or digit gives `#`.\n */\nexport function creatorNfdLetter(name: string | null | undefined): string {\n const normalized = (name ?? '')\n .normalize('NFD')\n .replace(/\\p{Diacritic}/gu, '')\n .replace(/[^\\p{L}\\p{N}]/gu, '');\n\n return normalized.charAt(0).toUpperCase() || '#';\n}\n\nexport interface ICreatorsLetterGroup {\n letter: string;\n items: Creator[];\n}\n\nconst creatorsCompare = (a: string, b: string): number =>\n a.localeCompare(b, 'pl');\n\n/**\n * Groups A-Z (reversed for `desc`), items A-Z inside a group either way. Both\n * sorts use the Polish locale, so `Ł` follows `L` (Ossolineum's code-point sort\n * puts it after `Z`).\n */\nexport function groupCreatorsByLetter(\n items: readonly Creator[],\n desc = false,\n): ICreatorsLetterGroup[] {\n const groups = new Map<string, Creator[]>();\n\n for (const item of items) {\n const letter = creatorNfdLetter(item.name);\n const group = groups.get(letter);\n\n if (group) group.push(item);\n else groups.set(letter, [item]);\n }\n\n const result = Array.from(groups, ([letter, groupItems]) => ({\n letter,\n items: groupItems.sort((a, b) =>\n creatorsCompare(a.name ?? '', b.name ?? ''),\n ),\n })).sort((a, b) => creatorsCompare(a.letter, b.letter));\n\n return desc ? result.reverse() : result;\n}\n","import {\n ICrudFilter,\n ICrudFilterQueryItem,\n} from '@smartsoft001/crud-shell-angular';\n\nimport {\n serializeCatalogFilter,\n yearRangeLabel,\n yearRangeValue,\n} from '@smartsoft001-mobilems/angular';\n\n/** Value of the creators filter form. Years are kept as typed, `''` is unset. */\nexport interface ICreatorsFilterValue {\n phrase: string;\n birthFrom: string;\n birthTo: string;\n}\n\nexport const EMPTY_CREATORS_FILTER: ICreatorsFilterValue = {\n phrase: '',\n birthFrom: '',\n birthTo: '',\n};\n\nconst CREATORS_BIRTH_KEY = 'dateFrom';\nconst CREATORS_YEAR = /^\\d{1,4}$/;\n\n/** `?filter=` of the creators page: the phrase and the birth range as full dates. */\nexport function creatorsFilterQueryParams(value: ICreatorsFilterValue): {\n filter?: string;\n} {\n const from = value.birthFrom.trim();\n const to = value.birthTo.trim();\n const query: Partial<ICrudFilterQueryItem>[] = [];\n\n if (from) {\n query.push({\n key: CREATORS_BIRTH_KEY,\n type: '>=',\n value: yearRangeValue(from, 'from'),\n });\n }\n if (to) {\n query.push({\n key: CREATORS_BIRTH_KEY,\n type: '<=',\n value: yearRangeValue(to, 'to'),\n });\n }\n\n const filter = serializeCatalogFilter({\n query: query as ICrudFilterQueryItem[],\n searchText: value.phrase,\n });\n\n return filter ? { filter } : {};\n}\n\n/** Reads a parsed `?filter=` back into the form value. */\nexport function creatorsFilterValueOf(\n filter: Pick<ICrudFilter, 'query' | 'searchText'> | null | undefined,\n): ICreatorsFilterValue {\n const birth = (type: ICrudFilterQueryItem['type']): string => {\n const item = filter?.query?.find(\n (entry) => entry.key === CREATORS_BIRTH_KEY && entry.type === type,\n );\n\n return item ? yearRangeLabel(item.value) : '';\n };\n\n return {\n phrase: filter?.searchText?.trim() ?? '',\n birthFrom: birth('>='),\n birthTo: birth('<='),\n };\n}\n\nexport function hasCreatorsFilter(value: ICreatorsFilterValue): boolean {\n return !!(\n value.phrase.trim() ||\n value.birthFrom.trim() ||\n value.birthTo.trim()\n );\n}\n\n/** A birth year as the API takes it: 1-4 digits, from 1 to 9999. */\nexport function isCreatorsBirthYear(year: string): boolean {\n const trimmed = year.trim();\n\n return CREATORS_YEAR.test(trimmed) && Number(trimmed) >= 1;\n}\n\n/** False for a year that is not `isCreatorsBirthYear`, or a range with `from` after `to`. */\nexport function isCreatorsBirthRangeValid(\n value: ICreatorsFilterValue,\n): boolean {\n const from = value.birthFrom.trim();\n const to = value.birthTo.trim();\n\n if (\n (from && !isCreatorsBirthYear(from)) ||\n (to && !isCreatorsBirthYear(to))\n ) {\n return false;\n }\n\n return !(from && to && Number(from) > Number(to));\n}\n","import { capitalize } from '@smartsoft001/utils';\n\nimport { ISeoMetadata } from '@smartsoft001-mobilems/angular';\n\n/** SEO translation keys of a creators list page. */\nexport interface ICreatorsListSeo {\n titleKey: string;\n descriptionKey: string;\n /** Default `'MODEL.mainTitle'`. */\n siteNameKey?: string;\n url?: string;\n}\n\n/**\n * List meta of a creators page, one format for the index and the filtered view of the same page:\n * `capitalize(t(titleKey)) - capitalize(t(siteNameKey))`, `t(descriptionKey)`, `type: 'website'`\n * and `url` only when it is set.\n */\nexport function creatorsListSeoMetadata(\n seo: ICreatorsListSeo,\n t: (key: string) => string,\n): ISeoMetadata {\n const metadata: ISeoMetadata = {\n title: `${capitalize(t(seo.titleKey))} - ${capitalize(t(seo.siteNameKey ?? 'MODEL.mainTitle'))}`,\n description: t(seo.descriptionKey),\n type: 'website',\n };\n if (seo.url) metadata.url = seo.url;\n\n return metadata;\n}\n","import { Injectable, Signal, signal } from '@angular/core';\n\nimport { Creator } from '@smartsoft001-mobilems/creators-domain';\n\n/** A creator as the list context keeps it: the id as a string. */\nexport interface ICreatorRef {\n id: string;\n name?: string | null;\n}\n\nexport interface ICreatorNeighbours {\n prev: ICreatorRef | null;\n next: ICreatorRef | null;\n}\n\n/**\n * The shown order of the last creators list (an index group or a catalog page). The details page\n * reads prev/next from it; a deep link or SSR has no context and gets none.\n */\n@Injectable({ providedIn: 'root' })\nexport class CreatorsListContext {\n private readonly creatorsListContextItems = signal<readonly ICreatorRef[]>(\n [],\n );\n\n readonly items: Signal<readonly ICreatorRef[]> =\n this.creatorsListContextItems.asReadonly();\n\n /** The shown order of a list; ids are stringified (the list API sends numbers). */\n set(items: readonly Pick<Creator, 'id' | 'name'>[]): void {\n this.creatorsListContextItems.set(\n items.map((item) => ({ id: String(item.id), name: item.name ?? null })),\n );\n }\n\n clear(): void {\n this.creatorsListContextItems.set([]);\n }\n\n /** Prev/next of a creator, compared as strings; none for an id outside the list. */\n neighbours(id: string | number | null | undefined): ICreatorNeighbours {\n const items = this.creatorsListContextItems();\n const index =\n id === null || id === undefined\n ? -1\n : items.findIndex((item) => item.id === String(id));\n\n if (index < 0) return { prev: null, next: null };\n\n return {\n prev: items[index - 1] ?? null,\n next: items[index + 1] ?? null,\n };\n }\n}\n","import {\n computed,\n DestroyRef,\n effect,\n inject,\n Signal,\n signal,\n untracked,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n ICrudFilter,\n ICrudFilterQueryItem,\n} from '@smartsoft001/crud-shell-angular';\nimport { catchError, map, of, Subject, switchMap } from 'rxjs';\n\nimport {\n createCatalog,\n ICatalog,\n ICatalogFacade,\n ICatalogOptions,\n offsetToPage,\n yearRangeValue,\n} from '@smartsoft001-mobilems/angular';\nimport { Creator } from '@smartsoft001-mobilems/creators-domain';\nimport { ICreatorsQueryDto } from '@smartsoft001-mobilems/creators-shell-dtos';\n\nimport { CreatorsListContext } from './creators-list-context';\nimport { CreatorsService, ICreatorsPage } from '../services/creators.service';\nimport {\n creatorsFilterValueOf,\n ICreatorsFilterValue,\n isCreatorsBirthYear,\n} from '../tools/creators-filter';\nimport {\n groupCreatorsByLetter,\n ICreatorsLetterGroup,\n} from '../tools/creators-letter-groups';\n\n/** Page size 24, sorted by name A-Z, no letter and no filter. */\nexport const CREATORS_CATALOG_DEFAULTS: ICrudFilter = {\n offset: 0,\n limit: 24,\n sortBy: 'name',\n sortDesc: false,\n query: [],\n};\n\nconst CREATORS_CATALOG_LETTER_KEY = 'sw';\nconst CREATORS_CATALOG_BIRTH_KEY = 'dateFrom';\nconst CREATORS_CATALOG_DATE = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\n\n/** Days of a month, February by the leap-year rule. */\nfunction creatorsCatalogDaysInMonth(year: number, month: number): number {\n if (month === 2) {\n const leap = (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n\n return leap ? 29 : 28;\n }\n\n return [4, 6, 9, 11].indexOf(month) >= 0 ? 30 : 31;\n}\n\n/**\n * A birth bound as the API takes it (`YYYY-MM-DD`): an `isCreatorsBirthYear` year is widened with\n * `yearRangeValue`, a full date must be a real calendar date whose year passes `isCreatorsBirthYear`. Anything else is `null` and is not sent:\n * the API answers 400 `SEARCH_ERROR` to it.\n */\nfunction creatorsCatalogBirthDate(\n value: unknown,\n bound: 'from' | 'to',\n): string | null {\n if (typeof value !== 'string' && typeof value !== 'number') return null;\n\n const trimmed = String(value).trim();\n const date = isCreatorsBirthYear(trimmed)\n ? yearRangeValue(trimmed, bound)\n : trimmed;\n const match = CREATORS_CATALOG_DATE.exec(date);\n\n if (!match) return null;\n\n const year = Number(match[1]);\n const month = Number(match[2]);\n const day = Number(match[3]);\n const valid =\n isCreatorsBirthYear(match[1]) &&\n month >= 1 &&\n month <= 12 &&\n day >= 1 &&\n day <= creatorsCatalogDaysInMonth(year, month);\n\n return valid ? date : null;\n}\n\nfunction creatorsCatalogQueryItem(\n filter: Pick<ICrudFilter, 'query'> | null | undefined,\n key: string,\n type: ICrudFilterQueryItem['type'] = '=',\n): ICrudFilterQueryItem | undefined {\n return filter?.query?.find(\n (item) => item.key === key && (item.type ?? '=') === type,\n );\n}\n\nfunction creatorsCatalogLetter(\n filter: Pick<ICrudFilter, 'query'> | null | undefined,\n): string | null {\n const value = creatorsCatalogQueryItem(\n filter,\n CREATORS_CATALOG_LETTER_KEY,\n )?.value;\n\n return typeof value === 'string' && value.trim() ? value.trim() : null;\n}\n\n/**\n * The catalog filter as a `CreatorsService.getPage` query: page and size, the phrase (`q`), the\n * letter (query key `sw`), the birth range (query key `dateFrom`, `>=`/`<=`) and the name sort.\n * A blank phrase or letter and an invalid birth bound are left out.\n */\nexport function creatorsFilterToQuery(\n filter: ICrudFilter | null | undefined,\n): ICreatorsQueryDto {\n const limit = filter?.limit || CREATORS_CATALOG_DEFAULTS.limit || 24;\n const query: ICreatorsQueryDto = {\n page: offsetToPage(filter?.offset ?? 0, limit),\n maxPerPage: limit,\n sort:\n filter?.sortBy === 'name'\n ? filter.sortDesc\n ? 'name-desc'\n : 'name-asc'\n : null,\n };\n const q = filter?.searchText?.trim();\n const sw = creatorsCatalogLetter(filter);\n const birthFrom = creatorsCatalogBirthDate(\n creatorsCatalogQueryItem(filter, CREATORS_CATALOG_BIRTH_KEY, '>=')?.value,\n 'from',\n );\n const birthTo = creatorsCatalogBirthDate(\n creatorsCatalogQueryItem(filter, CREATORS_CATALOG_BIRTH_KEY, '<=')?.value,\n 'to',\n );\n\n if (q) query.q = q;\n if (sw) query.sw = sw;\n if (birthFrom) query.birthFrom = birthFrom;\n if (birthTo) query.birthTo = birthTo;\n\n return query;\n}\n\nexport interface ICreatorsFacade extends ICatalogFacade {\n readonly list: Signal<Creator[]>;\n /** The filter `list` was loaded with (`filter` is the requested one); `null` before the first load. */\n readonly loadedFilter: Signal<ICrudFilter | null>;\n}\n\n/**\n * A signal facade over `CreatorsService.getPage` for `createCatalog` (not an NgRx CRUD slice).\n * A newer read cancels the older one. Call in an injection context.\n */\nexport function createCreatorsFacade(): ICreatorsFacade {\n const service = inject(CreatorsService);\n const filter = signal<ICrudFilter | null>(null);\n const loading = signal(false);\n const error = signal<unknown>(null);\n const totalCount = signal(0);\n const list = signal<Creator[]>([]);\n const loadedFilter = signal<ICrudFilter | null>(null);\n const reads = new Subject<ICrudFilter>();\n\n reads\n .pipe(\n switchMap((next) =>\n service.getPage(creatorsFilterToQuery(next)).pipe(\n map(\n (\n page,\n ):\n | { page: ICreatorsPage; filter: ICrudFilter }\n | { error: unknown } => ({\n page,\n filter: next,\n }),\n ),\n catchError((failure: unknown) => of({ error: failure })),\n ),\n ),\n takeUntilDestroyed(inject(DestroyRef)),\n )\n .subscribe((result) => {\n if ('page' in result) {\n list.set(result.page.items);\n loadedFilter.set(result.filter);\n totalCount.set(result.page.total);\n error.set(null);\n } else {\n error.set(result.error);\n list.set([]);\n totalCount.set(0);\n }\n loading.set(false);\n });\n\n return {\n filter: filter.asReadonly(),\n loading: loading.asReadonly(),\n error: error.asReadonly(),\n totalCount: totalCount.asReadonly(),\n list: list.asReadonly(),\n loadedFilter: loadedFilter.asReadonly(),\n read: (next) => {\n filter.set(next);\n loading.set(true);\n reads.next(next);\n },\n };\n}\n\nexport interface ICreatorsCatalogOptions extends Omit<\n ICatalogOptions,\n 'facade' | 'readGuard' | 'defaults'\n> {\n /** Default `CREATORS_CATALOG_DEFAULTS`. */\n defaults?: ICrudFilter;\n}\n\nexport interface ICreatorsCatalog extends ICatalog {\n /** The loaded page, as the API sorted it. */\n readonly list: Signal<Creator[]>;\n /** The page grouped by NFD letter; groups reversed when it was loaded with `name-desc`. */\n readonly groups: Signal<ICreatorsLetterGroup[]>;\n /** The requested direction (updates at once; `groups` follows when the page loads). */\n readonly sortDesc: Signal<boolean>;\n /** The letter (query key `sw`), `null` without one. */\n readonly startsWith: Signal<string | null>;\n /** Sets the letter, or drops it for `null`/blank. */\n setStartsWith(letter: string | null): void;\n /** The phrase and birth range of the filter, as the form shows them. */\n readonly filterValue: Signal<ICreatorsFilterValue>;\n /**\n * The current filter with the phrase and the birth range of `value`, first page; other query keys (the letter) are\n * kept, invalid years dropped. `CreatorsCatalogBaseComponent.applyFilter` navigates to it.\n */\n filterFor(value: ICreatorsFilterValue): ICrudFilter;\n /** One read of `filterFor(value)` in place (the url keeps its `?filter=`). */\n applyFilter(value: ICreatorsFilterValue): void;\n}\n\n/**\n * The filtered creators list (`/artysci?filter=…`) on `createCatalog`, with the creators facade and\n * no read guard (a foreign `CrudConfig` in the injector cannot stall it). After each load it writes\n * the shown order into `CreatorsListContext`. Call in an injection context.\n */\nexport function createCreatorsCatalog(\n options: ICreatorsCatalogOptions,\n): ICreatorsCatalog {\n const facade = createCreatorsFacade();\n const listContext = inject(CreatorsListContext);\n const catalog = createCatalog({\n ...options,\n defaults: options.defaults ?? CREATORS_CATALOG_DEFAULTS,\n facade,\n readGuard: false,\n });\n\n const sortDesc = computed(() => !!catalog.filter()?.sortDesc);\n // The shown page keeps the direction it was loaded with until the next one arrives.\n const groups = computed(() =>\n groupCreatorsByLetter(facade.list(), !!facade.loadedFilter()?.sortDesc),\n );\n\n effect(() => {\n const shown = groups();\n\n if (catalog.hasError()) {\n untracked(() => listContext.clear());\n return;\n }\n if (catalog.isLoading() || !catalog.filter()) return;\n\n untracked(() => listContext.set(shown.flatMap((group) => group.items)));\n });\n\n const birthItem = (\n year: string,\n bound: 'from' | 'to',\n ): ICrudFilterQueryItem[] => {\n const value = year.trim()\n ? creatorsCatalogBirthDate(year.trim(), bound)\n : null;\n\n return value\n ? [\n {\n key: CREATORS_CATALOG_BIRTH_KEY,\n value,\n type: bound === 'from' ? '>=' : '<=',\n hidden: true,\n },\n ]\n : [];\n };\n\n const filterFor = (value: ICreatorsFilterValue): ICrudFilter => {\n const current = catalog.filter() ?? CREATORS_CATALOG_DEFAULTS;\n const query = (current.query ?? []).filter(\n (item) =>\n !(\n item.key === CREATORS_CATALOG_BIRTH_KEY &&\n (item.type === '>=' || item.type === '<=')\n ),\n );\n\n return {\n ...current,\n offset: 0,\n searchText: value.phrase.trim(),\n query: [\n ...query,\n ...birthItem(value.birthFrom, 'from'),\n ...birthItem(value.birthTo, 'to'),\n ],\n };\n };\n\n return {\n ...catalog,\n list: facade.list,\n groups,\n sortDesc,\n startsWith: computed(() => creatorsCatalogLetter(catalog.filter())),\n setStartsWith: (letter) => {\n const trimmed = letter?.trim();\n\n if (trimmed) {\n catalog.setQueryItem(CREATORS_CATALOG_LETTER_KEY, trimmed);\n } else {\n catalog.removeQueryKey(CREATORS_CATALOG_LETTER_KEY);\n }\n },\n filterValue: computed(() => creatorsFilterValueOf(catalog.filter())),\n filterFor,\n applyFilter: (value) => {\n const { searchText, query } = filterFor(value);\n\n catalog.update({ searchText, query });\n },\n };\n}\n","import {\n DOCUMENT,\n isPlatformBrowser,\n Location,\n ViewportScroller,\n} from '@angular/common';\nimport {\n afterNextRender,\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n Injector,\n PLATFORM_ID,\n Signal,\n signal,\n untracked,\n viewChild,\n WritableSignal,\n} from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { TranslateService } from '@ngx-translate/core';\nimport {\n catchError,\n combineLatest,\n distinctUntilChanged,\n map,\n Observable,\n of,\n shareReplay,\n startWith,\n Subject,\n switchMap,\n} from 'rxjs';\n\nimport { MuseumSeoService } from '@smartsoft001-mobilems/angular';\nimport { Creator } from '@smartsoft001-mobilems/creators-domain';\n\nimport { CreatorsListContext } from './creators-list-context';\nimport { CreatorsService } from '../services/creators.service';\nimport {\n CREATORS_ALPHABET,\n creatorsFindPrefix,\n CreatorsLetter,\n creatorsPrefixAnchor,\n ICreatorsPrefixGroup,\n parseCreatorsLetter,\n resolveCreatorsFragment,\n} from '../tools/creators-index';\nimport {\n creatorsListSeoMetadata,\n ICreatorsListSeo,\n} from '../tools/creators-list-seo';\n\n/** `?litera=` of the index. A constant: the letter stream is a field-initialized `toSignal`. */\nexport const CREATORS_INDEX_LETTER_PARAM = 'litera';\n\n/** `?prefiks=`: the two-letter group of the letter the index shows (MOB-1959). */\nexport const CREATORS_INDEX_PREFIX_PARAM = 'prefiks';\n\n/** `?filter=` belongs to the catalog results view; the index stays idle while it is there. */\nconst CREATORS_INDEX_FILTER_PARAM = 'filter';\n\n/**\n * The index view (museum-artists MOB-1959): the letter's two-letter groups\n * (`prefixes`), the group shown (`prefix`, `?prefiks=` or the first one) and its creators.\n */\nexport interface ICreatorsIndexState {\n status: 'loading' | 'error' | 'success';\n prefixes: string[];\n prefix: string | null;\n items: Creator[];\n}\n\n/** A group of the letter with its DOM anchor; only the shown group carries items. */\nexport interface ICreatorsIndexGroup extends ICreatorsPrefixGroup {\n anchor: string;\n}\n\ninterface ICreatorsIndexRouteState {\n letter: CreatorsLetter;\n filtered: boolean;\n}\n\ninterface ICreatorsIndexPrefixesState extends ICreatorsIndexRouteState {\n status: ICreatorsIndexState['status'];\n prefixes: string[];\n}\n\nconst CREATORS_INDEX_LOADING: ICreatorsIndexState = {\n status: 'loading',\n prefixes: [],\n prefix: null,\n items: [],\n};\n\nconst CREATORS_INDEX_IDLE: ICreatorsIndexState = {\n status: 'success',\n prefixes: [],\n prefix: null,\n items: [],\n};\n\n/**\n * Logic of the creators letter index (museum-artists' `/artysci` at MOB-1959): `?litera=` picks the\n * letter, `?prefiks=` its group, the address `#fragment` (`#B`, `#Ba`, an anchor) is followed once\n * the group has loaded, and the mobile jump-to panel's choice is scrolled to and focused.\n *\n * The museum writes the HTML: a `#filtersButton` element (the focus goes back to it when the\n * panel closes), a `[id]=\"group.anchor\"` `tabindex=\"-1\"` section for the shown group, and the\n * jump-to panel bound to `changeLetter`, `selectPrefix` and `closeFilters`.\n */\n@Directive()\nexport abstract class CreatorsIndexBaseComponent {\n /** Anchor prefix of the groups (`tworcy-42-61`); sztuki uses `'artysci'`. Read lazily. */\n protected readonly creatorsIndexAnchorBase: string = 'tworcy';\n /** SEO keys (Ossolineum's by default). Read once, after the subclass initialisers. */\n protected readonly creatorsIndexSeo: ICreatorsListSeo = {\n titleKey: 'creatorsPage',\n descriptionKey: 'CREATORS.metaDescription',\n siteNameKey: 'museumName',\n };\n\n private readonly creatorsIndexRoute = inject(ActivatedRoute);\n private readonly creatorsIndexRouter = inject(Router);\n private readonly creatorsIndexInjector = inject(Injector);\n private readonly creatorsIndexLocation = inject(Location);\n private readonly creatorsIndexDocument = inject(DOCUMENT);\n private readonly creatorsIndexScroller = inject(ViewportScroller);\n private readonly creatorsIndexIsBrowser = isPlatformBrowser(\n inject(PLATFORM_ID),\n );\n private readonly creatorsIndexService = inject(CreatorsService);\n private readonly creatorsIndexListContext = inject(CreatorsListContext);\n private readonly creatorsIndexSeoService = inject(MuseumSeoService);\n private readonly creatorsIndexTranslate = inject(TranslateService);\n private readonly creatorsIndexRetry$ = new Subject<void>();\n /** Group picked in the jump-to panel, scrolled to once it has loaded. */\n private readonly creatorsIndexPendingAnchor = signal<string | null>(null);\n /** Last `#fragment` already scrolled to, so data reloads do not jump again. */\n private creatorsIndexHandledFragment: string | null = null;\n\n readonly alphabet = CREATORS_ALPHABET;\n\n private readonly creatorsIndexRouteState$: Observable<ICreatorsIndexRouteState> =\n this.creatorsIndexRoute.queryParamMap.pipe(\n map((params) => ({\n letter: parseCreatorsLetter(params.get(CREATORS_INDEX_LETTER_PARAM)),\n filtered: params.has(CREATORS_INDEX_FILTER_PARAM),\n })),\n distinctUntilChanged(\n (a, b) => a.letter === b.letter && a.filtered === b.filtered,\n ),\n );\n\n readonly letter: Signal<CreatorsLetter> = toSignal(\n this.creatorsIndexRouteState$.pipe(\n map(({ letter }) => letter),\n distinctUntilChanged(),\n ),\n { initialValue: 'A' as CreatorsLetter },\n );\n\n /**\n * `?filter=` is present: the catalog results view owns the page and the index stays idle. The template switches\n * between the index and the results view on it.\n */\n readonly filtered: Signal<boolean> = toSignal(\n this.creatorsIndexRouteState$.pipe(map(({ filtered }) => filtered)),\n { initialValue: false },\n );\n\n private readonly creatorsIndexPrefixParam$ =\n this.creatorsIndexRoute.queryParamMap.pipe(\n map((params) => params.get(CREATORS_INDEX_PREFIX_PARAM)),\n distinctUntilChanged(),\n );\n\n private readonly creatorsIndexPrefixes$: Observable<ICreatorsIndexPrefixesState> =\n combineLatest([\n this.creatorsIndexRouteState$,\n this.creatorsIndexRetry$.pipe(startWith(undefined)),\n ]).pipe(\n switchMap(([route]) =>\n route.filtered\n ? of<ICreatorsIndexPrefixesState>({\n ...route,\n status: 'success',\n prefixes: [],\n })\n : this.creatorsIndexService.getPrefixes(route.letter).pipe(\n map((prefixes) => ({ status: 'success' as const, prefixes })),\n catchError(() =>\n of({ status: 'error' as const, prefixes: [] as string[] }),\n ),\n startWith({\n status: 'loading' as const,\n prefixes: [] as string[],\n }),\n map((state): ICreatorsIndexPrefixesState => ({\n ...route,\n ...state,\n })),\n ),\n ),\n shareReplay({ bufferSize: 1, refCount: true }),\n );\n\n readonly state: Signal<ICreatorsIndexState> = toSignal(\n combineLatest([\n this.creatorsIndexPrefixes$,\n this.creatorsIndexPrefixParam$,\n ]).pipe(\n switchMap(([{ letter, filtered, status, prefixes }, raw]) => {\n if (filtered) return of(CREATORS_INDEX_IDLE);\n\n return status === 'success'\n ? this.creatorsIndexLoad(letter, prefixes, raw)\n : of<ICreatorsIndexState>({ ...CREATORS_INDEX_LOADING, status });\n }),\n ),\n { initialValue: CREATORS_INDEX_LOADING },\n );\n\n readonly groups: Signal<ICreatorsIndexGroup[]> = computed(() => {\n const { prefixes, prefix: shown, items } = this.state();\n const base = this.creatorsIndexAnchorBase;\n\n return prefixes.map((prefix) => ({\n prefix,\n anchor: creatorsPrefixAnchor(prefix, base),\n items: prefix === shown ? items : [],\n }));\n });\n\n readonly prefixes: Signal<string[]> = computed(() => this.state().prefixes);\n\n readonly activePrefix: Signal<string | null> = computed(\n () => this.state().prefix,\n );\n\n readonly activeAnchor: Signal<string | null> = computed(() => {\n const prefix = this.activePrefix();\n\n return prefix\n ? creatorsPrefixAnchor(prefix, this.creatorsIndexAnchorBase)\n : null;\n });\n\n private readonly creatorsIndexFragment = toSignal(\n this.creatorsIndexRoute.fragment,\n { initialValue: null },\n );\n\n readonly filtersOpen: WritableSignal<boolean> = signal(false);\n\n /** The museum's `#filtersButton` (template ref contract). */\n private readonly creatorsIndexFiltersButton =\n viewChild<ElementRef<HTMLElement>>('filtersButton');\n\n constructor() {\n // Once, after the subclass initialisers, so an overridden `creatorsIndexSeo` counts.\n effect(() => untracked(() => this.creatorsIndexApplySeo()));\n\n // As the catalog: a failed load leaves no stale prev/next behind.\n effect(() => {\n const state = this.state();\n if (this.filtered() || state.status === 'loading') return;\n if (state.status === 'error') {\n untracked(() => this.creatorsIndexListContext.clear());\n return;\n }\n\n const shown = this.groups().flatMap((group) => group.items);\n untracked(() => this.creatorsIndexListContext.set(shown));\n });\n\n // The router's anchorScrolling fires on NavigationEnd, before the group's\n // creators arrive, so an address like `/artysci#B` would never scroll.\n effect(() => {\n if (!this.creatorsIndexIsBrowser) return;\n if (this.filtered()) {\n // The filter view owns the page; coming back to the same fragment scrolls again.\n this.creatorsIndexHandledFragment = null;\n return;\n }\n\n const fragment = this.creatorsIndexFragment();\n const state = this.state();\n if (!fragment) {\n // Leaving the fragment (e.g. another letter) re-arms it for Back.\n this.creatorsIndexHandledFragment = null;\n return;\n }\n if (state.status === 'loading' && !state.prefixes.length) return;\n if (fragment === this.creatorsIndexHandledFragment) return;\n\n const groups = this.groups();\n const target = resolveCreatorsFragment(fragment, this.letter(), groups);\n if (!target) return;\n\n // A letter switch does not need this letter's list (it may have failed).\n if ('letter' in target) {\n this.creatorsIndexRouter.navigate([], {\n relativeTo: this.creatorsIndexRoute,\n queryParams: { [CREATORS_INDEX_LETTER_PARAM]: target.letter },\n fragment,\n replaceUrl: true,\n });\n return;\n }\n\n // Another group of this letter is loaded first (`?prefiks=`).\n const group = groups.find((g) => g.anchor === target.anchor);\n if (group && group.prefix !== state.prefix) {\n this.creatorsIndexRouter.navigate([], {\n relativeTo: this.creatorsIndexRoute,\n queryParams: {\n [CREATORS_INDEX_LETTER_PARAM]: this.letter(),\n [CREATORS_INDEX_PREFIX_PARAM]: group.prefix,\n },\n fragment,\n replaceUrl: true,\n });\n return;\n }\n\n if (state.status !== 'success') return;\n this.creatorsIndexHandledFragment = fragment;\n afterNextRender(() => this.jumpTo(target.anchor), {\n injector: this.creatorsIndexInjector,\n });\n });\n\n // The group picked in the jump-to panel is reached once it has loaded; when\n // it fails, the focus goes back to the filters button instead.\n effect(() => {\n const state = this.state();\n const anchor = this.creatorsIndexPendingAnchor();\n if (!anchor || this.filtersOpen() || state.status === 'loading') return;\n if (anchor !== this.activeAnchor()) return;\n\n this.creatorsIndexPendingAnchor.set(null);\n afterNextRender(\n () =>\n state.status === 'success'\n ? this.jumpTo(anchor)\n : this.creatorsIndexFocusFiltersButton(),\n { injector: this.creatorsIndexInjector },\n );\n });\n }\n\n back(): void {\n this.creatorsIndexLocation.back();\n }\n\n /** Scrolls to a group and moves focus to it (the router only scrolls). Browser only. */\n jumpTo(anchor: string): void {\n if (!this.creatorsIndexIsBrowser) return;\n\n this.creatorsIndexScroller.scrollToAnchor(anchor);\n this.creatorsIndexDocument\n .getElementById(anchor)\n ?.focus({ preventScroll: true });\n }\n\n openFilters(): void {\n this.creatorsIndexPendingAnchor.set(null);\n this.filtersOpen.set(true);\n }\n\n changeLetter(letter: CreatorsLetter): void {\n this.creatorsIndexPendingAnchor.set(null);\n this.creatorsIndexRouter.navigate([], {\n relativeTo: this.creatorsIndexRoute,\n queryParams: { [CREATORS_INDEX_LETTER_PARAM]: letter },\n });\n }\n\n /** The panel's group: loaded through `?prefiks=`, then scrolled to. */\n selectPrefix(prefix: string): void {\n const anchor = creatorsPrefixAnchor(prefix, this.creatorsIndexAnchorBase);\n this.creatorsIndexPendingAnchor.set(anchor);\n this.creatorsIndexRouter\n .navigate([], {\n relativeTo: this.creatorsIndexRoute,\n queryParams: {\n [CREATORS_INDEX_LETTER_PARAM]: this.letter(),\n [CREATORS_INDEX_PREFIX_PARAM]: prefix,\n },\n })\n .then((navigated) => {\n // A cancelled navigation never loads the group; the same address\n // (the active group applied again) is reached by the effect.\n if (navigated || this.creatorsIndexPendingAnchor() !== anchor) return;\n if (anchor === this.activeAnchor()) return;\n this.creatorsIndexPendingAnchor.set(null);\n this.creatorsIndexFocusFiltersButton();\n });\n }\n\n /**\n * Focus moves after the next render, once the panel is gone: to the picked group once it has\n * loaded, or back to the filters button (Safari does not focus a button on click).\n */\n closeFilters(): void {\n this.filtersOpen.set(false);\n\n if (this.creatorsIndexPendingAnchor()) return;\n afterNextRender(() => this.creatorsIndexFocusFiltersButton(), {\n injector: this.creatorsIndexInjector,\n });\n }\n\n retry(): void {\n this.creatorsIndexRetry$.next();\n }\n\n private creatorsIndexFocusFiltersButton(): void {\n if (!this.creatorsIndexIsBrowser) return;\n\n this.creatorsIndexFiltersButton()?.nativeElement.focus();\n }\n\n private creatorsIndexApplySeo(): void {\n this.creatorsIndexSeoService.apply(\n creatorsListSeoMetadata(this.creatorsIndexSeo, (key) =>\n String(this.creatorsIndexTranslate.instant(key) ?? ''),\n ),\n );\n }\n\n private creatorsIndexLoad(\n letter: CreatorsLetter,\n prefixes: string[],\n raw: string | null,\n ): Observable<ICreatorsIndexState> {\n const prefix = creatorsFindPrefix(raw, prefixes) ?? prefixes[0] ?? null;\n const base = { prefixes, prefix };\n if (!prefix)\n return of<ICreatorsIndexState>({ ...base, status: 'success', items: [] });\n\n return this.creatorsIndexService.getByIndexPrefix(letter, prefix).pipe(\n map((items): ICreatorsIndexState => ({\n ...base,\n status: 'success',\n items,\n })),\n catchError(() =>\n of<ICreatorsIndexState>({ ...base, status: 'error', items: [] }),\n ),\n startWith<ICreatorsIndexState>({ ...base, status: 'loading', items: [] }),\n );\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n afterNextRender,\n Directive,\n inject,\n input,\n InputSignal,\n linkedSignal,\n output,\n signal,\n} from '@angular/core';\n\nimport { CreatorsLetter } from '../tools/creators-index';\n\n/**\n * Logic of the mobile \"go to\" panel of the creators index (museum-artists'\n * `index-filters-mobile`, MOB-1949/1959). The choice is a draft until `apply()`:\n * another letter emits `letterChange`, a prefix of the current letter emits\n * `prefixSelect`. Every way out (close, backdrop, Escape, apply) emits `closed`;\n * the host removes the panel and moves the focus on.\n *\n * Escape is bound here (`host`), so a subclass must not bind it again.\n */\n@Directive({ host: { '(keydown.escape)': 'close()' } })\nexport abstract class CreatorsJumpToBaseComponent {\n /**\n * The header the card opens under; the first element found wins. Read after the\n * first render, so an override counts.\n */\n protected readonly creatorsJumpToHeaderSelectors: readonly string[] = [\n 'app-header',\n 'app-nav-bar',\n ];\n\n private readonly creatorsJumpToDocument = inject(DOCUMENT);\n\n readonly letters = input.required<readonly CreatorsLetter[]>();\n readonly activeLetter = input.required<CreatorsLetter>();\n /** Prefix groups of the loaded (active) letter. */\n readonly prefixes = input<readonly string[]>([]);\n /** Prefix the index currently shows, pre-selected. */\n readonly activePrefix: InputSignal<string | null> = input<string | null>(\n null,\n );\n\n readonly letterChange = output<CreatorsLetter>();\n readonly prefixSelect = output<string>();\n readonly closed = output<void>();\n\n readonly selectedLetter = linkedSignal(() => this.activeLetter());\n readonly selectedPrefix = linkedSignal(() => this.activePrefix());\n\n /** The card's top edge: the header's bottom edge, measured once the panel is rendered. */\n readonly topOffset = signal(0);\n\n constructor() {\n afterNextRender(() =>\n this.topOffset.set(this.creatorsJumpToMeasureHeader()),\n );\n }\n\n selectLetter(letter: CreatorsLetter): void {\n this.selectedLetter.set(letter);\n this.selectedPrefix.set(null);\n }\n\n apply(): void {\n const letter = this.selectedLetter();\n const prefix = this.selectedPrefix();\n\n if (letter !== this.activeLetter()) this.letterChange.emit(letter);\n else if (prefix) this.prefixSelect.emit(prefix);\n\n this.closed.emit();\n }\n\n close(): void {\n this.closed.emit();\n }\n\n private creatorsJumpToMeasureHeader(): number {\n let header: Element | null = null;\n for (const selector of this.creatorsJumpToHeaderSelectors) {\n header = this.creatorsJumpToDocument.querySelector(selector);\n if (header) break;\n }\n\n return Math.max(0, Math.round(header?.getBoundingClientRect().bottom ?? 0));\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n PLATFORM_ID,\n Signal,\n viewChild,\n} from '@angular/core';\nimport { Router } from '@angular/router';\nimport { TranslateService } from '@ngx-translate/core';\n\nimport {\n catalogListQueryParams,\n MuseumSeoService,\n} from '@smartsoft001-mobilems/angular';\n\nimport {\n createCreatorsCatalog,\n ICreatorsCatalog,\n ICreatorsCatalogOptions,\n} from './create-creators-catalog';\nimport {\n hasCreatorsFilter,\n ICreatorsFilterValue,\n} from '../tools/creators-filter';\nimport {\n creatorsListSeoMetadata,\n ICreatorsListSeo,\n} from '../tools/creators-list-seo';\n\nexport interface ICreatorsCatalogPageOptions extends ICreatorsCatalogOptions {\n /** Applied on creation, skipped in a search tab. */\n seo?: ICreatorsListSeo;\n}\n\n/**\n * Base of the filtered creators list (`/artysci?filter=…`) on `createCreatorsCatalog`: first read,\n * persistence, sort/size/page, the letter, the phrase and the birth range come from `catalog`;\n * the page keeps its template. The url is the source of truth for the filter: `applyFilter` navigates\n * to `?filter=` (the catalog reads it), `clearAllFilters` goes back to the index (`listPath`).\n *\n * ```ts\n * export class ResultsComponent extends CreatorsCatalogBaseComponent {\n * constructor() {\n * super({ persistKey: 'ARTISTS', listPath: '/artysci', seo: { titleKey: 'PAGE_TITLES.artists', descriptionKey: 'ARTISTS.metaDescription' } });\n * }\n * }\n * ```\n *\n * A `#listContainer` element in the template is scrolled to after a page change from the bottom\n * pagination (`bottomPageChange`), in the browser only.\n */\n@Directive()\nexport abstract class CreatorsCatalogBaseComponent {\n protected readonly catalog: ICreatorsCatalog;\n\n private readonly creatorsCatalogPageTranslate = inject(TranslateService);\n private readonly creatorsCatalogPageRouter = inject(Router);\n private readonly creatorsCatalogPageListPath: string;\n private readonly creatorsCatalogPageSeoService = inject(MuseumSeoService);\n private readonly creatorsCatalogPageIsBrowser = isPlatformBrowser(\n inject(PLATFORM_ID),\n );\n private readonly creatorsCatalogPageListContainer =\n viewChild<ElementRef<HTMLElement>>('listContainer');\n private creatorsCatalogPageScrollAfterLoad = false;\n\n /** The phrase or a birth bound is set. */\n readonly hasActiveFilters: Signal<boolean> = computed(() =>\n hasCreatorsFilter(this.catalog.filterValue()),\n );\n\n protected constructor(options: ICreatorsCatalogPageOptions) {\n const { seo, ...catalogOptions } = options;\n this.catalog = createCreatorsCatalog(catalogOptions);\n this.creatorsCatalogPageListPath = options.listPath;\n\n // After a page change from the bottom pagination scroll to the list top\n // once the data has loaded.\n effect(() => {\n const loading = this.catalog.isLoading();\n if (\n loading ||\n !this.creatorsCatalogPageScrollAfterLoad ||\n !this.creatorsCatalogPageIsBrowser\n ) {\n return;\n }\n\n this.creatorsCatalogPageScrollAfterLoad = false;\n setTimeout(() =>\n this.creatorsCatalogPageListContainer()?.nativeElement.scrollIntoView({\n behavior: 'smooth',\n block: 'start',\n }),\n );\n });\n\n if (seo) this.creatorsCatalogPageApplySeo(seo);\n }\n\n pageChange(page: number): void {\n this.catalog.setPage(page);\n }\n\n bottomPageChange(page: number): void {\n this.creatorsCatalogPageScrollAfterLoad = true;\n this.pageChange(page);\n }\n\n onLimitChange(limit: number | string): void {\n this.catalog.setLimit(limit);\n }\n\n sortChange(key: 'name-asc' | 'name-desc'): void {\n this.catalog.setSortKey(key);\n }\n\n onSearch(phrase: string): void {\n this.catalog.search(phrase);\n }\n\n /** The letter (`sw`); `null` or blank drops it. */\n setStartsWith(letter: string | null): void {\n this.catalog.setStartsWith(letter);\n }\n\n /**\n * Navigates to `listPath?filter=…` with the phrase and the birth range (the letter, the sort and the size kept);\n * the catalog reads the new `?filter=`. Without any filter the url has no `?filter=`, so the index shows.\n */\n applyFilter(value: ICreatorsFilterValue): void {\n void this.creatorsCatalogPageRouter.navigate(\n [this.creatorsCatalogPageListPath],\n { queryParams: catalogListQueryParams(this.catalog.filterFor(value)) },\n );\n }\n\n retryLoad(): void {\n this.catalog.retry();\n }\n\n /** Back to the index: `listPath` without parameters. */\n clearAllFilters(): void {\n void this.creatorsCatalogPageRouter.navigate([\n this.creatorsCatalogPageListPath,\n ]);\n }\n\n /**\n * The index's list meta (`creatorsListSeoMetadata`), not in a search tab: the canonical url of\n * the list must not point at a phrase url.\n */\n private creatorsCatalogPageApplySeo(seo: ICreatorsListSeo): void {\n if (this.catalog.searchEnabled()) return;\n\n this.creatorsCatalogPageSeoService.apply(\n creatorsListSeoMetadata(seo, (key) =>\n String(this.creatorsCatalogPageTranslate.instant(key) ?? ''),\n ),\n );\n }\n}\n","import {\n computed,\n Directive,\n input,\n linkedSignal,\n output,\n Signal,\n WritableSignal,\n} from '@angular/core';\n\nimport {\n EMPTY_CREATORS_FILTER,\n ICreatorsFilterValue,\n isCreatorsBirthRangeValid,\n} from '../tools/creators-filter';\n\n/**\n * Logic of the creators filters modal: a draft of the phrase and the birth range, started from\n * `value` (and again on each new `value`), applied with `apply()`. Escape closes it (bound by the\n * base; a subclass must not bind it again). The museum writes the HTML.\n */\n@Directive({ host: { '(keydown.escape)': 'close()' } })\nexport abstract class CreatorsFiltersBaseComponent {\n /** The applied filter (`catalog.filterValue()`). */\n readonly value = input<ICreatorsFilterValue>(EMPTY_CREATORS_FILTER);\n\n readonly phrase: WritableSignal<string> = linkedSignal(\n () => this.value().phrase,\n );\n readonly birthFrom: WritableSignal<string> = linkedSignal(\n () => this.value().birthFrom,\n );\n readonly birthTo: WritableSignal<string> = linkedSignal(\n () => this.value().birthTo,\n );\n\n /** A year that the API does not take, or `from` after `to`. */\n readonly rangeInvalid: Signal<boolean> = computed(\n () => !isCreatorsBirthRangeValid(this.creatorsFiltersDraft()),\n );\n\n readonly applied = output<ICreatorsFilterValue>();\n readonly closed = output<void>();\n\n /** Emits the trimmed draft, then `closed`; nothing while `rangeInvalid`. */\n apply(): void {\n if (this.rangeInvalid()) return;\n\n this.applied.emit(this.creatorsFiltersDraft());\n this.closed.emit();\n }\n\n /** Clears the draft; the applied filter stays until `apply()`. */\n reset(): void {\n this.phrase.set('');\n this.birthFrom.set('');\n this.birthTo.set('');\n }\n\n close(): void {\n this.closed.emit();\n }\n\n private creatorsFiltersDraft(): ICreatorsFilterValue {\n return {\n phrase: this.phrase().trim(),\n birthFrom: this.birthFrom().trim(),\n birthTo: this.birthTo().trim(),\n };\n }\n}\n","import { computed, Directive, inject, input, Signal } from '@angular/core';\n\nimport { FileUrlService } from '@smartsoft001-mobilems/angular';\nimport { Creator } from '@smartsoft001-mobilems/creators-domain';\n\nimport {\n creatorDetailsCommands,\n creatorDisplayName,\n creatorLifeYears,\n creatorPlainName,\n creatorRoles,\n} from '../tools/creator-fields';\n\n/**\n * Logic of a creator list card: display name, life years, roles, image with the placeholder and\n * the details link. The museum writes the HTML.\n */\n@Directive()\nexport abstract class CreatorCardBaseComponent {\n /** Details path (`/tworcy/:id/:slug`); sztuki uses `'/artysci'`. Read lazily. */\n protected readonly creatorCardPath: string = '/tworcy';\n /** Image when the creator has none. Read lazily. */\n protected readonly creatorCardPlaceholder: string = '/gfx/no-image.png';\n\n private readonly creatorCardFileUrl = inject(FileUrlService);\n\n readonly item = input<Creator | undefined>(undefined);\n\n /** \"Kobro, Katarzyna\" gives \"Katarzyna Kobro\" (markup dropped). */\n readonly displayName: Signal<string> = computed(() =>\n creatorDisplayName(creatorPlainName(this.item()?.name)),\n );\n\n /** \"1898–1951\"; `''` without an item or years. */\n readonly lifeYears: Signal<string> = computed(() => {\n const item = this.item();\n\n return (item && creatorLifeYears(item)) || '';\n });\n\n /** Roles, comma separated. */\n readonly roles: Signal<string> = computed(() =>\n creatorRoles(this.item()).join(', '),\n );\n\n /** A string `image` as is, an `MsFile` through `FileUrlService`, else `extraData.image`, else the placeholder. */\n readonly imageSrc: Signal<string> = computed(() => {\n const item = this.item();\n if (!item) return '';\n\n const placeholder = this.creatorCardPlaceholder;\n const { image } = item;\n\n if (typeof image === 'string' && image.trim()) return image;\n if (image && typeof image === 'object') {\n return this.creatorCardFileUrl.get(image, 'cache', placeholder);\n }\n\n return item.extraData?.image?.trim() || placeholder;\n });\n\n /** Router commands to the details page; `[]` without an item. */\n readonly link: Signal<string[]> = computed(() => {\n const item = this.item();\n\n return item ? creatorDetailsCommands(this.creatorCardPath, item) : [];\n });\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n linkedSignal,\n PLATFORM_ID,\n signal,\n viewChild,\n} from '@angular/core';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute, Params } from '@angular/router';\nimport {\n catchError,\n combineLatest,\n distinctUntilChanged,\n map,\n Observable,\n of,\n scan,\n startWith,\n Subject,\n switchMap,\n} from 'rxjs';\n\nimport { Creator } from '@smartsoft001-mobilems/creators-domain';\n\nimport { CreatorsListContext } from './creators-list-context';\nimport { CreatorsService } from '../services/creators.service';\n\n/** Four rows of three, like the works category view. */\nexport const CREATORS_SEARCH_LIMIT = 12;\nexport const CREATORS_SEARCH_PAGE_SIZES: readonly number[] = [12, 24, 48];\n\nexport interface ICreatorsSearchState {\n status: 'loading' | 'error' | 'success';\n items: Creator[];\n total: number;\n}\n\ninterface ICreatorsSearchRequest {\n text: string;\n page: number;\n limit: number;\n}\n\nconst CREATORS_SEARCH_LOADING: ICreatorsSearchState = {\n status: 'loading',\n items: [],\n total: 0,\n};\n\n/**\n * Logic of the \"creators\" category of the site search (`/wyszukaj/:text/artysci`): the phrase of\n * the route, the page and the page size, the loaded page and the list context. The view (layout,\n * toolbar, cards, pagination) stays in the museum.\n *\n * A blank phrase (`/wyszukaj/%20/artysci`) gives an empty result without a request.\n *\n * The request depends on the phrase, the page and the limit only. A `#results` template ref is\n * scrolled to after a page change from the bottom pagination (`changePage(page, true)`), in the\n * browser only.\n */\n@Directive()\nexport abstract class CreatorsSearchListBaseComponent {\n private readonly creatorsSearchListRoute = inject(ActivatedRoute);\n private readonly creatorsSearchListService = inject(CreatorsService);\n private readonly creatorsSearchListContext = inject(CreatorsListContext);\n private readonly creatorsSearchListIsBrowser = isPlatformBrowser(\n inject(PLATFORM_ID),\n );\n private readonly creatorsSearchListResults =\n viewChild<ElementRef<HTMLElement>>('results');\n private readonly creatorsSearchListRetry$ = new Subject<void>();\n private creatorsSearchListScrollAfterLoad = false;\n\n readonly pageSizes: number[] = [...CREATORS_SEARCH_PAGE_SIZES];\n\n /**\n * The phrase from `wyszukaj/:text`. The category route is lazy and has no component, so `:text`\n * is not on `route.parent`: the params of the whole path are merged.\n */\n readonly text = toSignal(\n combineLatest(\n this.creatorsSearchListRoute.pathFromRoot.map((route) => route.params),\n ).pipe(\n map((all) => {\n const params: Params = Object.assign({}, ...all);\n\n return String(params['text'] ?? '');\n }),\n distinctUntilChanged(),\n ),\n { requireSync: true },\n );\n\n readonly limit = signal(CREATORS_SEARCH_LIMIT);\n\n /** 1-based; a new phrase or page size goes back to the first page. */\n readonly page = linkedSignal({\n source: () => ({ text: this.text(), limit: this.limit() }),\n computation: () => 1,\n });\n\n private readonly creatorsSearchListRequest = computed<ICreatorsSearchRequest>(\n () => ({\n text: this.text(),\n page: this.page(),\n limit: this.limit(),\n }),\n );\n\n readonly state = toSignal(\n combineLatest([\n toObservable(this.creatorsSearchListRequest),\n this.creatorsSearchListRetry$.pipe(startWith(undefined)),\n ]).pipe(\n switchMap(([request]) => this.creatorsSearchListLoad(request)),\n // The total stays while the next page loads, so the pagination does not vanish.\n scan(\n (previous, next): ICreatorsSearchState =>\n next.status === 'loading' ? { ...next, total: previous.total } : next,\n CREATORS_SEARCH_LOADING,\n ),\n ),\n { initialValue: CREATORS_SEARCH_LOADING },\n );\n\n readonly totalCount = computed(() => this.state().total);\n\n readonly items = computed(() => this.state().items);\n\n constructor() {\n // The details page reads prev/next from the shown results; a failed load clears them, as the catalog does.\n effect(() => {\n const state = this.state();\n\n if (state.status === 'success') {\n this.creatorsSearchListContext.set(state.items);\n } else if (state.status === 'error') {\n this.creatorsSearchListContext.clear();\n }\n });\n\n // After a page change from the bottom pagination scroll to the list top once it has loaded.\n effect(() => {\n if (\n this.state().status === 'loading' ||\n !this.creatorsSearchListScrollAfterLoad ||\n !this.creatorsSearchListIsBrowser\n ) {\n return;\n }\n\n this.creatorsSearchListScrollAfterLoad = false;\n setTimeout(() =>\n this.creatorsSearchListResults()?.nativeElement.scrollIntoView({\n behavior: 'smooth',\n block: 'start',\n }),\n );\n });\n }\n\n /** `scrollToResults`: the change came from the bottom pagination, below the list. */\n changePage(page: number, scrollToResults = false): void {\n this.creatorsSearchListScrollAfterLoad = scrollToResults;\n this.page.set(page);\n }\n\n changeLimit(limit: number): void {\n this.limit.set(limit);\n }\n\n retry(): void {\n this.creatorsSearchListRetry$.next();\n }\n\n private creatorsSearchListLoad({\n text,\n page,\n limit,\n }: ICreatorsSearchRequest): Observable<ICreatorsSearchState> {\n // `getPage` drops a blank `q`, which would list every creator.\n if (!text.trim()) {\n return of<ICreatorsSearchState>({\n status: 'success',\n items: [],\n total: 0,\n });\n }\n\n return this.creatorsSearchListService\n .getPage({ q: text, page, maxPerPage: limit, extraData: true })\n .pipe(\n map(({ items, total }): ICreatorsSearchState => ({\n status: 'success',\n items,\n total,\n })),\n catchError(() =>\n of<ICreatorsSearchState>({\n ...CREATORS_SEARCH_LOADING,\n status: 'error',\n }),\n ),\n startWith(CREATORS_SEARCH_LOADING),\n );\n }\n}\n","import { DOCUMENT, isPlatformBrowser, ViewportScroller } from '@angular/common';\nimport {\n afterNextRender,\n computed,\n DestroyRef,\n Directive,\n effect,\n inject,\n Injector,\n linkedSignal,\n PLATFORM_ID,\n Signal,\n signal,\n untracked,\n} from '@angular/core';\nimport { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute } from '@angular/router';\nimport { TranslateService } from '@ngx-translate/core';\nimport {\n catchError,\n combineLatest,\n distinctUntilChanged,\n firstValueFrom,\n map,\n Observable,\n of,\n startWith,\n Subject,\n switchMap,\n} from 'rxjs';\n\nimport {\n catalogEntryFilterParams,\n FileUrlService,\n ISeoMetadata,\n MuseumSeoService,\n} from '@smartsoft001-mobilems/angular';\nimport {\n Creator,\n ICreatorImage,\n ICreatorTag,\n} from '@smartsoft001-mobilems/creators-domain';\nimport { MsFile } from '@smartsoft001-mobilems/models';\nimport { MsObject } from '@smartsoft001-mobilems/objects-domain';\n\nimport {\n CREATORS_INDEX_LETTER_PARAM,\n CREATORS_INDEX_PREFIX_PARAM,\n} from './creators-index-base.component';\nimport {\n CreatorsListContext,\n ICreatorNeighbours,\n} from './creators-list-context';\nimport {\n CreatorsService,\n ICreatorWorksPage,\n} from '../services/creators.service';\nimport {\n creatorBiography,\n creatorBiographyExcerpt,\n creatorDetailsCommands,\n creatorDictLabel,\n creatorDisplayName,\n creatorIsLongBiography,\n creatorPlainName,\n creatorPlainText,\n creatorRoles,\n creatorYears,\n} from '../tools/creator-fields';\nimport {\n creatorsIndexPrefixOf,\n creatorsLetterOf,\n} from '../tools/creators-index';\n\nexport interface ICreatorDetailsState {\n status: 'loading' | 'error' | 'not-found' | 'success';\n creator: Creator | null;\n}\n\nexport interface ICreatorDetailRow {\n labelKey: string;\n value: string;\n}\n\nexport interface ICreatorActivityPlace {\n years: string;\n places: string;\n}\n\nexport interface ICreatorAuthorityLink {\n label: string;\n url: string;\n}\n\nexport interface ICreatorGalleryImage {\n src: string;\n alt: string;\n title?: string;\n}\n\n/** Translation keys of the details page: row labels, the SEO title parts and the museum-artists page texts. */\nexport interface ICreatorDetailsKeys {\n period: string;\n birth: string;\n death: string;\n /** The section between the name and the site name in the title; `null` leaves it out. */\n sectionKey: string | null;\n siteNameKey: string;\n notFoundKey: string;\n /** The biography entry of the contents (`toc`). */\n biographyToc: string;\n /** Read out after `share()` copied the link. */\n shareCopied: string;\n}\n\n/** Ossolineum's keys for the rows and the title; museum-artists' for the contents and the share (Ossolineum has neither). */\nexport const CREATOR_DETAILS_KEYS: ICreatorDetailsKeys = {\n period: 'DETAILS_PAGE.activityPeriod',\n birth: 'DETAILS_PAGE.placeDateOfBirth',\n death: 'DETAILS_PAGE.placeDateOfDeath',\n sectionKey: 'creatorsPage',\n siteNameKey: 'museumName',\n notFoundKey: 'NOT_FOUND.title',\n biographyToc: 'ARTISTS.toc.description',\n shareCopied: 'ARTISTS.shareCopied',\n};\n\n/** A related list of the page: the works of the creator, or a related list of `creator/{id}`. */\nexport type CreatorRelatedKey =\n 'works' | 'exhibitions' | 'archives' | 'msBooks';\n\n/** One related strip: its list, `#anchor`, heading key, cards per page and how many to load. */\nexport interface ICreatorRelatedStripConfig {\n key: CreatorRelatedKey;\n anchor: string;\n labelKey: string;\n pageSize: number;\n limit: number;\n}\n\n/** museum-artists' strips (MOB-1963), in the order of the UX board. */\nexport const CREATOR_RELATED_STRIPS: readonly ICreatorRelatedStripConfig[] = [\n {\n key: 'works',\n anchor: 'dziela',\n labelKey: 'ARTISTS.related.works',\n pageSize: 6,\n limit: 18,\n },\n {\n key: 'exhibitions',\n anchor: 'wystawy',\n labelKey: 'ARTISTS.related.exhibitions',\n pageSize: 3,\n limit: 9,\n },\n {\n key: 'archives',\n anchor: 'archiwum',\n labelKey: 'ARTISTS.related.archives',\n pageSize: 3,\n limit: 9,\n },\n {\n key: 'msBooks',\n anchor: 'ksiazki-ms',\n labelKey: 'ARTISTS.related.msBooks',\n pageSize: 3,\n limit: 9,\n },\n];\n\n/** \"Show all\" of a strip: router commands and the query of the full list. */\nexport interface ICreatorRelatedStripLink {\n commands: unknown[];\n queryParams?: Record<string, string>;\n}\n\n/** A strip ready to show: `count` is the API total, `items` the loaded first page. */\nexport interface ICreatorRelatedStrip<TItem = MsObject> {\n key: CreatorRelatedKey;\n anchor: string;\n labelKey: string;\n pageSize: number;\n count: number;\n items: TItem[];\n showAll: ICreatorRelatedStripLink | null;\n}\n\n/** An entry of the page contents: the `#anchor` of a part and its heading key. */\nexport interface ICreatorTocEntry {\n anchor: string;\n labelKey: string;\n}\n\ninterface ICreatorDetailsRelatedState {\n loading: boolean;\n lists: Partial<Record<CreatorRelatedKey, ICreatorWorksPage>>;\n}\n\nconst CREATOR_DETAILS_LOADING: ICreatorDetailsState = {\n status: 'loading',\n creator: null,\n};\nconst CREATOR_DETAILS_NOT_FOUND: ICreatorDetailsState = {\n status: 'not-found',\n creator: null,\n};\nconst CREATOR_DETAILS_NO_RELATED: ICreatorDetailsRelatedState = {\n loading: false,\n lists: {},\n};\nconst CREATOR_DETAILS_NO_OBJECTS: ICreatorWorksPage = { items: [], total: 0 };\nconst CREATOR_DETAILS_HTTP_URL = /^https?:\\/\\//i;\nconst CREATOR_DETAILS_NUMERIC_ID = /^\\d+$/;\n/** How long the address fragment keeps its position while the layout above it changes. */\nconst CREATOR_DETAILS_FRAGMENT_SETTLE_MS = 2000;\nconst CREATOR_DETAILS_USER_SCROLL_EVENTS = [\n 'wheel',\n 'touchstart',\n 'keydown',\n 'mousedown',\n] as const;\n\n/**\n * Logic of a creator details page (museum-artists' `ItemComponent`, MOB-1972/1963, and Ossolineum's sections): the\n * creator of the `:id` param (`creator/{id}`, else the dictionary entry), its detail rows, years, biography (folded\n * when long), portrait, lead artwork, tags, activity places, bibliography, authority links, gallery, the related\n * strips (works, exhibitions, archives, MS books) and the contents, prev/next from `CreatorsListContext`, the way back\n * to the index, share, the scroll to the address fragment and the SEO (also during SSR, via\n * `MuseumSeoService.applyForSsr`). The museum writes the HTML.\n */\n@Directive()\nexport abstract class CreatorDetailsBaseComponent<TRelatedItem = MsObject> {\n /** Details path (`/tworcy/:id/:slug`); sztuki uses `'/artysci'`. Starts with `/`. Read lazily. */\n protected readonly creatorDetailsPath: string = '/tworcy';\n /** Row labels, SEO title keys and the page texts. Read lazily. */\n protected readonly creatorDetailsKeys: ICreatorDetailsKeys =\n CREATOR_DETAILS_KEYS;\n /** The related strips and their limits; the `works` entry also sets `works()`. Read lazily. */\n protected readonly creatorDetailsRelatedStrips: readonly ICreatorRelatedStripConfig[] =\n CREATOR_RELATED_STRIPS;\n /** `#anchor` of the biography in the contents. Read lazily. */\n protected readonly creatorDetailsBiographyAnchor: string = 'opis';\n /** The objects catalog that \"show all\" of the works opens. Read lazily. */\n protected readonly creatorDetailsObjectsPath: string = '/obiekty';\n\n private readonly creatorDetailsRoute = inject(ActivatedRoute);\n private readonly creatorDetailsService = inject(CreatorsService);\n private readonly creatorDetailsContext = inject(CreatorsListContext);\n private readonly creatorDetailsFileUrl = inject(FileUrlService);\n private readonly creatorDetailsSeo = inject(MuseumSeoService);\n private readonly creatorDetailsTranslate = inject(TranslateService);\n private readonly creatorDetailsDocument = inject(DOCUMENT);\n private readonly creatorDetailsScroller = inject(ViewportScroller);\n private readonly creatorDetailsInjector = inject(Injector);\n private readonly creatorDetailsIsBrowser = isPlatformBrowser(\n inject(PLATFORM_ID),\n );\n private readonly creatorDetailsRetry$ = new Subject<void>();\n private readonly creatorDetailsRelatedRequest$ =\n new Subject<Creator | null>();\n private readonly creatorDetailsRelated = signal<ICreatorDetailsRelatedState>(\n CREATOR_DETAILS_NO_RELATED,\n );\n private readonly creatorDetailsFragment = toSignal(\n this.creatorDetailsRoute.fragment,\n { initialValue: null },\n );\n /** `id#fragment` already scrolled to: later data does not jump again. */\n private creatorDetailsHandledFragment: string | null = null;\n private creatorDetailsStopFragmentScroll: () => void = () => undefined;\n\n readonly state: Signal<ICreatorDetailsState> = toSignal(\n combineLatest([\n this.creatorDetailsRoute.paramMap.pipe(\n map((params) => params.get('id') ?? ''),\n distinctUntilChanged(),\n ),\n this.creatorDetailsRetry$.pipe(startWith(undefined)),\n ]).pipe(switchMap(([id]) => this.creatorDetailsLoad(id))),\n { initialValue: CREATOR_DETAILS_LOADING },\n );\n\n readonly creator: Signal<Creator | null> = computed(\n () => this.state().creator,\n );\n\n /** museum-artists' name of `creator`. */\n readonly artist: Signal<Creator | null> = this.creator;\n\n /** The name without markup. */\n readonly plainName: Signal<string> = computed(() =>\n creatorPlainName(this.creator()?.name),\n );\n\n /** \"Kobro, Katarzyna\" gives \"Katarzyna Kobro\", as in the page heading. */\n readonly name: Signal<string> = computed(() =>\n creatorDisplayName(this.plainName()),\n );\n\n /** Years under the name (`creatorYears`), `''` without dates. */\n readonly years: Signal<string> = computed(() => {\n const creator = this.creator();\n\n return creator ? creatorYears(creator) : '';\n });\n\n /** Roles, comma separated; a numeric role id is never shown. */\n readonly roles: Signal<string> = computed(() =>\n creatorRoles(this.creator()).join(', '),\n );\n\n /** Period, birth and death (museum-artists' order), empty values dropped. */\n readonly details: Signal<ICreatorDetailRow[]> = computed(() => {\n const creator = this.creator();\n const keys = this.creatorDetailsKeys;\n const rows: ICreatorDetailRow[] = [\n { labelKey: keys.period, value: creatorDictLabel(creator?.period) },\n { labelKey: keys.birth, value: creator?.placeDateOfBirth ?? '' },\n { labelKey: keys.death, value: creator?.placeDateOfDeath ?? '' },\n ];\n\n return rows.filter((row) => !!row.value);\n });\n\n /**\n * The editorial biography, else the biography, else the description html, trimmed (`creatorBiography`); a field\n * that only looks filled (`<p>&nbsp;</p>`, Word's MSO blocks) is skipped; `''` without any.\n */\n readonly biography: Signal<string> = computed(() =>\n creatorBiography(this.creator()),\n );\n\n /** A biography longer than the folded view (about six lines). */\n readonly foldable: Signal<boolean> = computed(() =>\n creatorIsLongBiography(this.biography()),\n );\n\n /** Plain-text start of the biography for the folded view. */\n readonly excerpt: Signal<string> = computed(() =>\n creatorBiographyExcerpt(this.biography()),\n );\n\n /** The folded biography is unfolded; folded again for another biography. */\n readonly expanded = linkedSignal({\n source: this.biography,\n computation: () => false,\n });\n\n /** Portrait (`photo`): a ready `url`, else a MUZA file; `null` without one. */\n readonly portrait: Signal<ICreatorGalleryImage | null> = computed(() =>\n this.creatorDetailsImageOf(this.creator()?.photo),\n );\n\n /** Lead artwork (`artworkFrame`), as `portrait`. */\n readonly leadImage: Signal<ICreatorGalleryImage | null> = computed(() =>\n this.creatorDetailsImageOf(this.creator()?.artworkFrame),\n );\n\n /** Tags with a name. */\n readonly tags: Signal<ICreatorTag[]> = computed(() =>\n (this.creator()?.tags ?? []).filter((tag) => !!tag?.name?.trim()),\n );\n\n /**\n * Per activity period: `from-to` years and the location names, entries with neither dropped. As in\n * Ossolineum, `[]` when no period has locations; otherwise every period, years-only ones too.\n */\n readonly activityPlaces: Signal<ICreatorActivityPlace[]> = computed(() => {\n const places = (this.creator()?.activityPeriod ?? [])\n .map((period) => ({\n years: [period?.fromYear, period?.toYear]\n // The API may send numbers, as it does for `id` and `role`.\n .map((year) => String(year ?? '').trim())\n .filter(Boolean)\n .join('-'),\n places: (period?.locations ?? [])\n .map((location) => creatorPlainName(location?.name))\n .filter(Boolean)\n .join(', '),\n }))\n .filter((place) => place.years || place.places);\n\n return places.some((place) => place.places) ? places : [];\n });\n\n /** Bibliography entries as plain text (`text`, else `html`), empty ones dropped. */\n readonly bibliography: Signal<string[]> = computed(() =>\n (this.creator()?.bibliographies ?? [])\n .map((entry) => creatorPlainName(entry?.text || entry?.html))\n .filter(Boolean),\n );\n\n /** `identifier [base]` links of the authority files; only `http(s)://` URLs. */\n readonly authorityLinks: Signal<ICreatorAuthorityLink[]> = computed(() =>\n (this.creator()?.baseConnectionObjects ?? []).reduce<\n ICreatorAuthorityLink[]\n >((links, entry) => {\n const url = entry?.bcUrl?.trim() ?? '';\n if (!CREATOR_DETAILS_HTTP_URL.test(url)) return links;\n\n const base = creatorPlainName(entry?.bcBase?.name);\n const label = [\n creatorPlainName(entry?.bcIdentifier),\n base ? `[${base}]` : '',\n ]\n .filter(Boolean)\n .join(' ');\n links.push({ label: label || url, url });\n\n return links;\n }, []),\n );\n\n /** Signature objects, else one image of the creator, else `[]`. */\n readonly gallery: Signal<ICreatorGalleryImage[]> = computed(() =>\n this.creatorDetailsGalleryOf(this.creator()),\n );\n\n /** The first works of the creator (its id only, no list filter), from the `works` strip entry. */\n readonly works: Signal<MsObject[]> = computed(\n () => this.creatorDetailsRelated().lists.works?.items ?? [],\n );\n readonly worksTotal: Signal<number> = computed(\n () => this.creatorDetailsRelated().lists.works?.total ?? 0,\n );\n /** Also `true` while the creator loads: the related lists are requested once it has loaded. */\n readonly worksLoading: Signal<boolean> = computed(\n () =>\n this.state().status === 'loading' || this.creatorDetailsRelated().loading,\n );\n\n /** `?filter=` of the objects list with this creator, for the \"all works\" link. */\n readonly worksListQueryParams: Signal<{ filter: string } | null> = computed(\n () => {\n const creator = this.creator();\n if (!creator) return null;\n\n // Dictionary ids of the objects catalog are numbers; the service keys creators on strings.\n const id = CREATOR_DETAILS_NUMERIC_ID.test(creator.id)\n ? Number(creator.id)\n : creator.id;\n\n return catalogEntryFilterParams('creators', id, this.plainName());\n },\n );\n\n /**\n * The related strips with results, in the configured order (an empty strip is left out, with its contents\n * entry); `[]` while they load. Each item goes through `creatorDetailsRelatedItem`.\n */\n readonly strips: Signal<ICreatorRelatedStrip<TRelatedItem>[]> = computed(\n () => {\n const { lists } = this.creatorDetailsRelated();\n\n return this.creatorDetailsRelatedStrips.reduce<\n ICreatorRelatedStrip<TRelatedItem>[]\n >((strips, { key, anchor, labelKey, pageSize }) => {\n const list = lists[key];\n if (!list?.items.length) return strips;\n\n const query = key === 'works' ? this.worksListQueryParams() : null;\n strips.push({\n key,\n anchor,\n labelKey,\n pageSize,\n count: list.total,\n items: list.items.map((item) =>\n this.creatorDetailsRelatedItem(item, key),\n ),\n showAll: query\n ? { commands: [this.creatorDetailsObjectsPath], queryParams: query }\n : null,\n });\n\n return strips;\n }, []);\n },\n );\n\n /** The contents: the biography and the strips the page has. */\n readonly toc: Signal<ICreatorTocEntry[]> = computed(() => [\n ...(this.biography()\n ? [\n {\n anchor: this.creatorDetailsBiographyAnchor,\n labelKey: this.creatorDetailsKeys.biographyToc,\n },\n ]\n : []),\n ...this.strips().map(({ anchor, labelKey }) => ({ anchor, labelKey })),\n ]);\n\n /** Read out after `share()` copied the link. */\n readonly shareStatus = signal('');\n\n /** Prev/next from the last shown list; none for a deep link, SSR or a creator outside it. */\n readonly neighbours: Signal<ICreatorNeighbours> = computed(() =>\n this.creatorDetailsContext.neighbours(this.creator()?.id),\n );\n\n readonly prevCommands: Signal<string[] | null> = computed(() => {\n const prev = this.neighbours().prev;\n\n return prev ? creatorDetailsCommands(this.creatorDetailsPath, prev) : null;\n });\n\n readonly nextCommands: Signal<string[] | null> = computed(() => {\n const next = this.neighbours().next;\n\n return next ? creatorDetailsCommands(this.creatorDetailsPath, next) : null;\n });\n\n /** `[path, id, slug]` of the loaded creator; `[]` without one. */\n readonly canonicalCommands: Signal<string[]> = computed(() => {\n const creator = this.creator();\n\n return creator\n ? creatorDetailsCommands(this.creatorDetailsPath, creator)\n : [];\n });\n\n /** The index letter of the creator; `''` without one. */\n readonly backLetter: Signal<string> = computed(() => {\n const creator = this.creator();\n\n return creator ? creatorsLetterOf(creator.name ?? '') : '';\n });\n\n /** The two-letter group of the creator in the index (MOB-1959); `''` without one. */\n readonly backPrefix: Signal<string> = computed(() =>\n creatorsIndexPrefixOf(this.creator()?.name ?? ''),\n );\n\n /** The index opens on the creator's letter and two-letter group (MOB-1959). */\n readonly backQueryParams: Signal<Record<string, string>> = computed(() => {\n if (!this.creator()) return {};\n\n const params: Record<string, string> = {\n [CREATORS_INDEX_LETTER_PARAM]: this.backLetter(),\n };\n const prefix = this.backPrefix();\n // Like sztuki (`backPrefix() || null`): no empty `prefiks=`.\n if (prefix) params[CREATORS_INDEX_PREFIX_PARAM] = prefix;\n\n return params;\n });\n\n /** Ossolineum's section accordions; both open at first. */\n readonly biographyOpen = signal(true);\n readonly bibliographyOpen = signal(true);\n\n constructor() {\n this.creatorDetailsSeo.applyForSsr(() => this.creatorDetailsFetchSsrSeo());\n const destroyRef = inject(DestroyRef);\n destroyRef.onDestroy(() => this.creatorDetailsStopFragmentScroll());\n\n this.creatorDetailsRelatedRequest$\n .pipe(\n distinctUntilChanged((a, b) => a?.id === b?.id),\n switchMap((creator) => this.creatorDetailsLoadRelated(creator)),\n takeUntilDestroyed(destroyRef),\n )\n .subscribe((related) => this.creatorDetailsRelated.set(related));\n\n effect(() => {\n const creator = this.creator();\n\n untracked(() => this.creatorDetailsRelatedRequest$.next(creator));\n });\n\n // The router scrolls to the fragment on NavigationEnd, before the biography and the strips load:\n // `/artysci/:id#dziela` (back, an outside link) is scrolled here once its part is in the contents.\n effect(() => {\n const fragment = this.creatorDetailsFragment();\n const id = this.creator()?.id;\n if (!fragment) this.creatorDetailsHandledFragment = null;\n if (!fragment || !id) return;\n\n const key = `${id}#${fragment}`;\n if (key === this.creatorDetailsHandledFragment) return;\n if (!this.toc().some(({ anchor }) => anchor === fragment)) return;\n\n this.creatorDetailsHandledFragment = key;\n afterNextRender(\n { read: () => this.creatorDetailsScrollToFragment(fragment) },\n { injector: this.creatorDetailsInjector },\n );\n });\n\n effect(() => {\n const { status, creator } = this.state();\n\n untracked(() => {\n if (creator) {\n this.creatorDetailsSeo.apply(this.creatorDetailsSeoOf(creator));\n } else if (status === 'not-found') {\n const keys = this.creatorDetailsKeys;\n this.creatorDetailsSeo.apply({\n title: `${this.creatorDetailsT(keys.notFoundKey)} - ${this.creatorDetailsT(keys.siteNameKey)}`,\n });\n }\n });\n });\n }\n\n retry(): void {\n this.creatorDetailsRetry$.next();\n }\n\n /** Unfolds or folds the long biography (museum-artists' \"rozwiń tekst\"). */\n toggleBiography(): void {\n this.expanded.update((value) => !value);\n }\n\n /** Opens or closes Ossolineum's biography accordion. */\n toggleBiographyOpen(): void {\n this.biographyOpen.update((open) => !open);\n }\n\n toggleBibliography(): void {\n this.bibliographyOpen.update((open) => !open);\n }\n\n /** The system share, else the link to the clipboard (announced in `shareStatus`). Browser only. */\n async share(): Promise<void> {\n const view = this.creatorDetailsDocument.defaultView;\n if (!this.creatorDetailsIsBrowser || !view) return;\n\n const url = view.location.href;\n const navigator = view.navigator;\n\n try {\n if (typeof navigator.share === 'function') {\n await navigator.share({ title: this.name(), url });\n return;\n }\n await navigator.clipboard.writeText(url);\n this.shareStatus.set(\n this.creatorDetailsT(this.creatorDetailsKeys.shareCopied),\n );\n } catch {\n // A cancelled share sheet or no clipboard access: no message.\n }\n }\n\n /** A strip item as the museum shows it (sztuki: a result card); the object itself by default. */\n protected creatorDetailsRelatedItem(\n item: MsObject,\n key: CreatorRelatedKey,\n ): TRelatedItem {\n void key;\n\n return item as unknown as TRelatedItem;\n }\n\n /**\n * The `<title>` of a creator: `plainName - t(sectionKey) - t(siteNameKey)` (the section left out for a `null`\n * `sectionKey`). Override to keep another format; sztuki keeps `name() - t('museumName')`. Called lazily, for the\n * page and on the server.\n */\n protected creatorDetailsSeoTitle(creator: Creator): string {\n const keys = this.creatorDetailsKeys;\n\n return [\n creatorPlainName(creator.name),\n keys.sectionKey ? this.creatorDetailsT(keys.sectionKey) : '',\n this.creatorDetailsT(keys.siteNameKey),\n ]\n .filter(Boolean)\n .join(' - ');\n }\n\n private creatorDetailsLoad(id: string): Observable<ICreatorDetailsState> {\n return this.creatorDetailsService.getById(id).pipe(\n map((creator): ICreatorDetailsState =>\n creator ? { status: 'success', creator } : CREATOR_DETAILS_NOT_FOUND,\n ),\n catchError(() =>\n of<ICreatorDetailsState>({ status: 'error', creator: null }),\n ),\n startWith(CREATOR_DETAILS_LOADING),\n );\n }\n\n /**\n * Runs from the effect, after construction, so the strip overrides are in place. A list that fails is empty;\n * the rest of the page stays.\n */\n private creatorDetailsLoadRelated(\n creator: Creator | null,\n ): Observable<ICreatorDetailsRelatedState> {\n const strips = this.creatorDetailsRelatedStrips;\n if (!creator || !strips.length) return of(CREATOR_DETAILS_NO_RELATED);\n\n return combineLatest(\n strips.map(({ key, limit }) =>\n (key === 'works'\n ? this.creatorDetailsService.getWorks(creator.id, limit)\n : this.creatorDetailsService.getRelated(creator[key], limit)\n ).pipe(\n catchError(() => of(CREATOR_DETAILS_NO_OBJECTS)),\n map((list) => [key, list] as const),\n ),\n ),\n ).pipe(\n map((entries): ICreatorDetailsRelatedState => ({\n loading: false,\n lists: entries.reduce<ICreatorDetailsRelatedState['lists']>(\n (lists, [key, list]) => ({ ...lists, [key]: list }),\n {},\n ),\n })),\n startWith<ICreatorDetailsRelatedState>({\n ...CREATOR_DETAILS_NO_RELATED,\n loading: true,\n }),\n );\n }\n\n /**\n * Scrolls to the anchor and holds it there for a moment: the lead artwork and the strips may still change the\n * height above it. The user's own scroll ends the corrections. Runs after render, in the browser only.\n */\n private creatorDetailsScrollToFragment(fragment: string): void {\n this.creatorDetailsStopFragmentScroll();\n this.creatorDetailsScroller.scrollToAnchor(fragment);\n\n const view = this.creatorDetailsDocument.defaultView;\n if (!view || typeof view.ResizeObserver === 'undefined') return;\n\n const observer = new view.ResizeObserver(() =>\n this.creatorDetailsScroller.scrollToAnchor(fragment),\n );\n const stop = () => {\n observer.disconnect();\n view.clearTimeout(timer);\n CREATOR_DETAILS_USER_SCROLL_EVENTS.forEach((name) =>\n view.removeEventListener(name, stop),\n );\n this.creatorDetailsStopFragmentScroll = () => undefined;\n };\n const timer = view.setTimeout(stop, CREATOR_DETAILS_FRAGMENT_SETTLE_MS);\n\n observer.observe(this.creatorDetailsDocument.body);\n CREATOR_DETAILS_USER_SCROLL_EVENTS.forEach((name) =>\n view.addEventListener(name, stop, { passive: true }),\n );\n this.creatorDetailsStopFragmentScroll = stop;\n }\n\n /** `creator/{id}` gives a ready `url`; a MUZA file (`filePath`) goes through `FileUrlService`. */\n private creatorDetailsImageOf(\n file: ICreatorImage | MsFile | null | undefined,\n ): ICreatorGalleryImage | null {\n if (!file) return null;\n\n const url = 'url' in file ? (file.url?.trim() ?? '') : '';\n const src =\n url ||\n ('filePath' in file && file.filePath\n ? this.creatorDetailsFileUrl.get(file as MsFile, 'cache')\n : '');\n\n return src ? { src, alt: file.altText || '' } : null;\n }\n\n private creatorDetailsGalleryOf(\n creator: Creator | null,\n ): ICreatorGalleryImage[] {\n if (!creator) return [];\n\n const name = creatorPlainName(creator.name);\n const signatures = (creator.signatureObjects ?? []).reduce<\n ICreatorGalleryImage[]\n >((images, entry) => {\n const file = entry?.image ?? entry?.file;\n if (!file) return images;\n\n const title = creatorPlainName(entry?.title);\n images.push({\n src: this.creatorDetailsFileUrl.get(file, 'cache'),\n alt: title || name,\n ...(title ? { title } : {}),\n });\n\n return images;\n }, []);\n\n if (signatures.length) return signatures;\n\n const extra = creator.extraData?.image?.trim();\n if (extra) return [{ src: extra, alt: name }];\n\n const { image } = creator;\n if (typeof image === 'string' && image.trim()) {\n return [{ src: image.trim(), alt: name }];\n }\n if (image && typeof image === 'object') {\n return [\n { src: this.creatorDetailsFileUrl.get(image, 'cache'), alt: name },\n ];\n }\n\n return [];\n }\n\n /** `creatorDetailsSeoTitle`, the plain biography (`creatorBiography`), the first image, the canonical. */\n private creatorDetailsSeoOf(creator: Creator): ISeoMetadata {\n const title = this.creatorDetailsSeoTitle(creator);\n const url = creatorDetailsCommands(this.creatorDetailsPath, creator).join(\n '/',\n );\n const metadata: ISeoMetadata = {\n title,\n description: creatorPlainText(creatorBiography(creator)) || undefined,\n // A path override without the leading slash still gives an absolute canonical.\n url: url.startsWith('/') ? url : `/${url}`,\n type: 'article',\n };\n const image = this.creatorDetailsGalleryOf(creator)[0]?.src;\n if (image) metadata.image = image;\n\n return metadata;\n }\n\n private creatorDetailsFetchSsrSeo(): Promise<ISeoMetadata | null> {\n const id = this.creatorDetailsRoute.snapshot.paramMap.get('id') ?? '';\n\n return firstValueFrom(this.creatorDetailsService.getById(id))\n .then((creator) => (creator ? this.creatorDetailsSeoOf(creator) : null))\n .catch(() => null);\n }\n\n private creatorDetailsT(key: string): string {\n return String(this.creatorDetailsTranslate.instant(key) ?? '');\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAEA;AACO,MAAM,iBAAiB,GAAG;IAC/B,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;IACzE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;IACzE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;;AAK9B;;;;;;;AAOG;AACH;AACO,MAAM,sBAAsB,GAAsB;AACvD,IAAA,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,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AE;AAC1C,YAAA,IAAI,EAAE,SAAS;SAChB;AACD,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG;AAC3D,QAAA,IAAI,KAAK;AAAE,YAAA,QAAQ,CAAC,KAAK,GAAG,KAAK;AAEjC,QAAA,OAAO,QAAQ;IACjB;IAEQ,yBAAyB,GAAA;AAC/B,QAAA,MAAM,EAAE,GAAG,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE;QAErE,OAAO,cAAc,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EAAE,CAAC;aACzD,IAAI,CAAC,CAAC,OAAO,MAAM,OAAO,GAAG,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;AACtE,aAAA,KAAK,CAAC,MAAM,IAAI,CAAC;IACtB;AAEQ,IAAA,eAAe,CAAC,GAAW,EAAA;AACjC,QAAA,OAAO,MAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;IAChE;iIA7lBoB,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;qHAA3B,2BAA2B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAA3B,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBADhD;;;ACxOD;;AAEG;;;;"}
1
+ {"version":3,"file":"smartsoft001-mobilems-creators-shell-angular.mjs","sources":["../../../../../../packages/creators/shell/angular/src/lib/tools/creators-index.ts","../../../../../../packages/creators/shell/angular/src/lib/tools/creators-url.ts","../../../../../../packages/creators/shell/angular/src/lib/services/creators.service.ts","../../../../../../packages/creators/shell/angular/src/lib/tools/creator-fields.ts","../../../../../../packages/creators/shell/angular/src/lib/tools/creators-letter-groups.ts","../../../../../../packages/creators/shell/angular/src/lib/tools/creators-filter.ts","../../../../../../packages/creators/shell/angular/src/lib/tools/creators-list-seo.ts","../../../../../../packages/creators/shell/angular/src/lib/catalog/creators-list-context.ts","../../../../../../packages/creators/shell/angular/src/lib/catalog/create-creators-catalog.ts","../../../../../../packages/creators/shell/angular/src/lib/catalog/creators-index-base.component.ts","../../../../../../packages/creators/shell/angular/src/lib/catalog/creators-jump-to-base.component.ts","../../../../../../packages/creators/shell/angular/src/lib/catalog/creators-catalog-base.component.ts","../../../../../../packages/creators/shell/angular/src/lib/catalog/creators-filters-base.component.ts","../../../../../../packages/creators/shell/angular/src/lib/catalog/creator-card-base.component.ts","../../../../../../packages/creators/shell/angular/src/lib/catalog/creators-search-list-base.component.ts","../../../../../../packages/creators/shell/angular/src/lib/catalog/creator-details-base.component.ts","../../../../../../packages/creators/shell/angular/src/smartsoft001-mobilems-creators-shell-angular.ts"],"sourcesContent":["import { Creator } from '@smartsoft001-mobilems/creators-domain';\n\n// prettier-ignore\nexport const CREATORS_ALPHABET = [\n 'A', 'Ą', 'B', 'C', 'Ć', 'D', 'E', 'Ę', 'F', 'G', 'H', 'I', 'J', 'K', 'L',\n 'Ł', 'M', 'N', 'Ń', 'O', 'Ó', 'P', 'Q', 'R', 'S', 'Ś', 'T', 'U', 'V', 'W',\n 'X', 'Y', 'Z', 'Ź', 'Ż', '#',\n] as const;\n\nexport type CreatorsLetter = (typeof CREATORS_ALPHABET)[number];\n\n/**\n * `sw=` prefixes queried for the `#` bucket (the API has no \"not a letter\" filter).\n *\n * `\"` and `„` are deliberately absent: the API treats them as a wildcard and\n * returns every creator (all 8 pages). The foreign initials (`Č`, `Š`, `Ž`) are\n * the ones present in the data today; `sw` is diacritic-sensitive, so a new one\n * only needs to be appended here. Prefixes without matches answer 404 and give `[]`.\n */\n// prettier-ignore\nexport const CREATORS_HASH_PREFIXES: readonly string[] = [\n '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n '[', '(', \"'\", '-',\n 'Č', 'Š', 'Ž',\n];\n\nfunction isCreatorsLetter(value: string): value is CreatorsLetter {\n return (CREATORS_ALPHABET as readonly string[]).includes(value);\n}\n\n/** Index letter of a name; anything outside the polish alphabet lands in `#`. */\nexport function creatorsLetterOf(name: string): CreatorsLetter {\n const [first = ''] = Array.from(name.trim());\n const upper = first.toLocaleUpperCase('pl');\n\n return isCreatorsLetter(upper) ? upper : '#';\n}\n\nconst CREATORS_POLISH_LETTERS = new Set(CREATORS_ALPHABET.slice(0, -1));\n\n/** Polish letters stay as they are; foreign diacritics fold to the base letter (é to e). */\nfunction creatorsFoldForeign(char: string): string {\n return CREATORS_POLISH_LETTERS.has(\n char.toLocaleUpperCase('pl') as CreatorsLetter,\n )\n ? char\n : char.normalize('NFD').replace(/\\p{M}/gu, '');\n}\n\n/**\n * Two-character group prefix (\"Ab\"); a single character when the second one is\n * not a letter. A foreign second letter joins its base group (\"Béraud\" is \"Be\").\n */\nexport function creatorsPrefixOf(name: string): string {\n const [first = '', second = ''] = Array.from(name.trim());\n const head = first.toLocaleUpperCase('pl');\n\n return /^\\p{L}$/u.test(second)\n ? head + creatorsFoldForeign(second).toLocaleLowerCase('pl')\n : head;\n}\n\nexport interface ICreatorsPrefixGroup {\n prefix: string;\n items: Creator[];\n}\n\nconst creatorsCollator = new Intl.Collator('pl', { sensitivity: 'base' });\n\n/** Creators grouped by `creatorsPrefixOf`, groups and items in polish alphabetical order. */\nexport function groupCreatorsByPrefix(\n items: readonly Creator[],\n): ICreatorsPrefixGroup[] {\n const groups = new Map<string, Creator[]>();\n const nameOf = (item: Creator): string => item.name ?? '';\n const sorted = [...items].sort((a, b) =>\n creatorsCollator.compare(nameOf(a), nameOf(b)),\n );\n\n for (const item of sorted) {\n const prefix = creatorsPrefixOf(nameOf(item));\n const group = groups.get(prefix);\n\n if (group) group.push(item);\n else groups.set(prefix, [item]);\n }\n\n return Array.from(groups, ([prefix, groupItems]) => ({\n prefix,\n items: groupItems,\n })).sort((a, b) => creatorsCollator.compare(a.prefix, b.prefix));\n}\n\n/**\n * API prefix (`GET dictionary/Creator/prefixes/{letter}` gives `AB`, `BÉ`, `A.`)\n * in the form the index shows it: `Ab`.\n */\nexport function creatorsDisplayPrefix(raw: string): string {\n const [head = '', ...rest] = Array.from(raw);\n\n return head + rest.join('').toLocaleLowerCase('pl');\n}\n\n/**\n * Index group of a creator, for links back to the index: the first two\n * characters as the API lists them (`Ab`, `Bé`, `A.`), or the local `#` group.\n */\nexport function creatorsIndexPrefixOf(name: string): string {\n const trimmed = name.trim();\n if (creatorsLetterOf(trimmed) === '#') return creatorsPrefixOf(trimmed);\n\n return creatorsDisplayPrefix(\n Array.from(trimmed).slice(0, 2).join('').toLocaleUpperCase('pl'),\n );\n}\n\n/**\n * The prefix of `prefixes` the address names (`?prefiks=`, `#Ab`), case\n * ignored. Diacritics count: the API keeps `Be` and `Bé` apart.\n */\nexport function creatorsFindPrefix(\n raw: string | null,\n prefixes: readonly string[],\n): string | null {\n if (!raw) return null;\n const upper = raw.toLocaleUpperCase('pl');\n\n return (\n prefixes.find((prefix) => prefix.toLocaleUpperCase('pl') === upper) ?? null\n );\n}\n\n/**\n * A whole index letter split into the API groups (`prefixes`, as `getPrefixes`\n * gives them), in their order; empty groups are left out. A creator whose group\n * the API did not list (data drift) still shows, in a group of its own after the\n * listed ones. Items keep their order (`getByIndexPrefix` sorts them).\n */\nexport function groupCreatorsByIndexPrefixes(\n items: readonly Creator[],\n prefixes: readonly string[],\n): ICreatorsPrefixGroup[] {\n const groups = new Map<string, Creator[]>(\n prefixes.map((prefix) => [prefix, []]),\n );\n for (const item of items) {\n const own = creatorsIndexPrefixOf(item.name ?? '');\n const prefix = creatorsFindPrefix(own, prefixes) ?? own;\n const group = groups.get(prefix);\n if (group) group.push(item);\n else groups.set(prefix, [item]);\n }\n\n return Array.from(groups, ([prefix, groupItems]) => ({\n prefix,\n items: groupItems,\n })).filter((group) => group.items.length > 0);\n}\n\n/** `?litera=` query param to index letter; invalid or missing falls back to `A`. */\nexport function parseCreatorsLetter(raw: string | null): CreatorsLetter {\n const upper = (raw ?? '').toLocaleUpperCase('pl');\n\n return isCreatorsLetter(upper) ? upper : 'A';\n}\n\n/**\n * DOM id of a prefix group. Hex code points keep `[`, `'` etc. selector-safe.\n * `base` is the museum's own anchor prefix (sztuki uses `artysci`).\n */\nexport function creatorsPrefixAnchor(prefix: string, base = 'tworcy'): string {\n const codePoints = Array.from(prefix, (char) =>\n (char.codePointAt(0) ?? 0).toString(16),\n );\n\n return [base, ...codePoints].join('-');\n}\n\nexport type CreatorsFragmentTarget =\n { anchor: string } | { letter: CreatorsLetter };\n\n/**\n * `#fragment` from the address to where the index should go: a group anchor\n * (as written), a group prefix (`#Ba`), or a letter (`#B`), which switches\n * `?litera=` first and then lands on that letter's first group.\n */\nexport function resolveCreatorsFragment(\n fragment: string,\n letter: CreatorsLetter,\n groups: readonly { prefix: string; anchor: string }[],\n): CreatorsFragmentTarget | null {\n let raw = fragment;\n try {\n raw = decodeURIComponent(fragment);\n } catch {\n // Malformed escape: match the fragment as written.\n }\n\n const byAnchor = groups.find((group) => group.anchor === raw);\n if (byAnchor) return { anchor: byAnchor.anchor };\n\n const exact = creatorsFindPrefix(\n raw,\n groups.map((group) => group.prefix),\n );\n const byPrefix =\n groups.find((group) => group.prefix === exact) ??\n groups.find((group) => creatorsCollator.compare(group.prefix, raw) === 0);\n if (byPrefix) return { anchor: byPrefix.anchor };\n\n const upper = raw.toLocaleUpperCase('pl');\n if (isCreatorsLetter(upper)) {\n if (upper !== letter) return { letter: upper };\n return groups.length ? { anchor: groups[0].anchor } : null;\n }\n\n // A prefix of another letter (`#Cz` on A) or of the `#` bucket (`#1`,\n // `#Ša`): switch letters first, then the prefix resolves.\n const chars = Array.from(raw);\n if (chars.length <= 2 && !/\\s/u.test(raw)) {\n const prefixLetter = creatorsLetterOf(raw);\n if (prefixLetter !== letter) return { letter: prefixLetter };\n }\n\n return null;\n}\n","import { yearRangeValue } from '@smartsoft001-mobilems/angular';\nimport { ICreatorRelated } from '@smartsoft001-mobilems/creators-domain';\nimport { ICreatorsQueryDto } from '@smartsoft001-mobilems/creators-shell-dtos';\n\nconst FULL_DATE = /^\\d{4}-\\d{2}-\\d{2}$/;\n\nfunction creatorsUrlBirth(value: string, bound: 'from' | 'to'): string {\n const trimmed = value.trim();\n\n return FULL_DATE.test(trimmed) ? trimmed : yearRangeValue(trimmed, bound);\n}\n\n/**\n * List/search url of the Creator dictionary. An empty `q=` or `sw=` empties the list (404), so blank\n * values are omitted. The birth range is the only working date filter and needs `YYYY-MM-DD`.\n */\nexport function creatorsListUrl(\n apiUrl: string,\n query: ICreatorsQueryDto,\n): string {\n let url = `${apiUrl}dictionary/Creator/search/page/${query.page ?? 1}?maxPerPage=${query.maxPerPage ?? 24}`;\n\n if (query.extraData !== false) url += '&extraData=true';\n\n const q = query.q?.trim();\n const sw = query.sw?.trim();\n\n if (q) url += `&q=${encodeURIComponent(q)}`;\n const lastNameSw = query.lastNameSw?.trim();\n\n if (sw) url += `&sw=${encodeURIComponent(sw)}`;\n if (lastNameSw) url += `&lastNameSw=${encodeURIComponent(lastNameSw)}`;\n if (query.sort) url += `&sort=${query.sort}`;\n if (query.birthFrom?.trim()) {\n url += `&filter[dateFrom][from]=${creatorsUrlBirth(query.birthFrom, 'from')}`;\n }\n if (query.birthTo?.trim()) {\n url += `&filter[dateFrom][to]=${creatorsUrlBirth(query.birthTo, 'to')}`;\n }\n\n return url;\n}\n\n/** Works (objects) of one creator; `authors[].id` of an object is the Creator id. */\nexport function creatorWorksUrl(\n apiUrl: string,\n id: string | number,\n page = 1,\n limit = 12,\n): string {\n return `${apiUrl}search/Object/page/${page}?maxPerPage=${limit}&filter[creators][]=${encodeURIComponent(String(id))}`;\n}\n\n/** Two-letter groups of an index letter (lower-case, encoded), e.g. `prefixes/b`. */\nexport function creatorsPrefixesUrl(apiUrl: string, letter: string): string {\n return `${apiUrl}dictionary/Creator/prefixes/${encodeURIComponent(letter.toLocaleLowerCase('pl'))}`;\n}\n\n/** The creator profile (MOB-1972). Only some API hosts have it; the others answer 404. */\nexport function creatorProfileUrl(apiUrl: string, id: string | number): string {\n return `${apiUrl}creator/${encodeURIComponent(String(id))}`;\n}\n\n/** The Creator dictionary entry: every API host has it. */\nexport function creatorDictionaryUrl(\n apiUrl: string,\n id: string | number,\n): string {\n return `${apiUrl}dictionary/Creator/${encodeURIComponent(String(id))}`;\n}\n\n/**\n * First page of a related list of `creator/{id}` (`/api/search/Object/page/{page}?filter[…]`) with `maxPerPage`;\n * `null` for a list without a path or results (no request needed).\n */\nexport function creatorRelatedUrl(\n apiUrl: string,\n related: ICreatorRelated | null | undefined,\n limit: number,\n): string | null {\n if (!related?.path || !related.count) return null;\n\n const path = related.path.replace(/^\\/?api\\//, '').replace('{page}', '1');\n const separator = path.includes('?') ? '&' : '?';\n\n return `${apiUrl}${path}${separator}maxPerPage=${limit}`;\n}\n","import { HttpClient, HttpErrorResponse } from '@angular/common/http';\nimport { inject, Injectable } from '@angular/core';\nimport {\n catchError,\n forkJoin,\n map,\n Observable,\n of,\n OperatorFunction,\n shareReplay,\n switchMap,\n throwError,\n} from 'rxjs';\n\nimport { SharedConfig } from '@smartsoft001-mobilems/angular';\nimport {\n Creator,\n ICreatorRelated,\n} from '@smartsoft001-mobilems/creators-domain';\nimport {\n CreatorRawDto,\n ICreatorDetailsResponseDto,\n ICreatorsListResponseDto,\n ICreatorsPrefixesResponseDto,\n ICreatorsQueryDto,\n ICreatorWorksResponseDto,\n} from '@smartsoft001-mobilems/creators-shell-dtos';\nimport { MsObject } from '@smartsoft001-mobilems/objects-domain';\n\nimport {\n CREATORS_HASH_PREFIXES,\n creatorsDisplayPrefix,\n creatorsLetterOf,\n CreatorsLetter,\n creatorsPrefixOf,\n groupCreatorsByPrefix,\n} from '../tools/creators-index';\nimport {\n creatorDictionaryUrl,\n creatorProfileUrl,\n creatorRelatedUrl,\n creatorsListUrl,\n creatorsPrefixesUrl,\n creatorWorksUrl,\n} from '../tools/creators-url';\n\nexport interface ICreatorsPage {\n items: Creator[];\n total: number;\n pages: number;\n}\n\nexport interface ICreatorWorksPage {\n items: MsObject[];\n total: number;\n}\n\nconst CREATORS_ALL_PAGE_SIZE = 500;\n\nconst creatorsServiceCollator = new Intl.Collator('pl', {\n sensitivity: 'base',\n});\n\n@Injectable({ providedIn: 'root' })\nexport class CreatorsService {\n private readonly creatorsServiceHttp = inject(HttpClient);\n private readonly creatorsServiceConfig = inject(SharedConfig);\n /** The `#` bucket, loaded once per `apiUrl` for its prefixes and its groups. */\n private creatorsServiceHashCache: {\n apiUrl: string;\n items$: Observable<Creator[]>;\n } | null = null;\n\n getPage(query: ICreatorsQueryDto): Observable<ICreatorsPage> {\n return this.creatorsServiceGetRaw(query).pipe(\n map(({ data }) => ({\n items: this.creatorsServiceNormalise(data?.items),\n total: data?.paginatorDetails?.totalItemsCount ?? 0,\n pages: data?.paginatorDetails?.totalPagesCount ?? 0,\n })),\n this.creatorsServiceOnNotFound<ICreatorsPage>({\n items: [],\n total: 0,\n pages: 0,\n }),\n );\n }\n\n /** Every page at `maxPerPage=500`, in page order. */\n getAll(\n query: Omit<ICreatorsQueryDto, 'page' | 'maxPerPage'> = {},\n ): Observable<Creator[]> {\n const pageQuery = (page: number): ICreatorsQueryDto => ({\n ...query,\n page,\n maxPerPage: CREATORS_ALL_PAGE_SIZE,\n });\n\n return this.creatorsServiceGetRaw(pageQuery(1)).pipe(\n switchMap(({ data }) => {\n const first = this.creatorsServiceNormalise(data?.items);\n const total = data?.paginatorDetails?.totalPagesCount ?? 1;\n const rest = Array.from({ length: Math.max(total - 1, 0) }, (_, i) =>\n this.creatorsServiceGetRaw(pageQuery(i + 2)),\n );\n\n if (!rest.length) return of(first);\n\n return forkJoin(rest).pipe(\n map((pages) =>\n first.concat(\n ...pages.map((page) =>\n this.creatorsServiceNormalise(page.data?.items),\n ),\n ),\n ),\n );\n }),\n this.creatorsServiceOnNotFound<Creator[]>([]),\n );\n }\n\n /**\n * Creators on one index letter. `#` has no API filter, so it merges the\n * `CREATORS_HASH_PREFIXES` searches (deduped by id). The result is re-checked with\n * `creatorsLetterOf`, because `sw` also matches beyond the letter. `q` and the birth\n * range go to every call.\n */\n getByLetter(\n letter: CreatorsLetter,\n query?: Pick<ICreatorsQueryDto, 'q' | 'birthFrom' | 'birthTo'>,\n ): Observable<Creator[]> {\n const items$ =\n letter === '#'\n ? forkJoin(\n CREATORS_HASH_PREFIXES.map((prefix) =>\n this.getAll({ ...query, sw: prefix }),\n ),\n ).pipe(map((lists) => this.creatorsServiceUniqueById(lists.flat())))\n : this.getAll({ ...query, sw: letter });\n\n return items$.pipe(\n map((items) =>\n items.filter((item) => creatorsLetterOf(item.name ?? '') === letter),\n ),\n );\n }\n\n /**\n * Two-letter groups of an index letter (MOB-1959): the API lists them (`AB`,\n * `BÉ`, `A.`), the index shows them as `Ab`. The `#` bucket has no API prefixes,\n * so its groups come from the loaded entries. The prefixes endpoint and\n * `lastNameSw` exist on the staging API; check the museum's API before use.\n */\n getPrefixes(letter: CreatorsLetter): Observable<string[]> {\n if (letter === '#') {\n return this.creatorsServiceGetHashCreators().pipe(\n map((items) =>\n groupCreatorsByPrefix(items).map((group) => group.prefix),\n ),\n );\n }\n\n return this.creatorsServiceHttp\n .get<ICreatorsPrefixesResponseDto>(\n creatorsPrefixesUrl(this.creatorsServiceConfig.apiUrl, letter),\n )\n .pipe(\n map(({ data }) => [\n ...new Set(\n (data?.items ?? [])\n .map(creatorsDisplayPrefix)\n .filter((prefix) => creatorsLetterOf(prefix) === letter),\n ),\n ]),\n this.creatorsServiceOnNotFound<string[]>([]),\n );\n }\n\n /**\n * Creators of one index group: every page of `lastNameSw`, in polish order.\n * `#` filters its loaded entries.\n */\n getByIndexPrefix(\n letter: CreatorsLetter,\n prefix: string,\n ): Observable<Creator[]> {\n if (letter === '#') {\n return this.creatorsServiceGetHashCreators().pipe(\n map((items) =>\n items.filter((item) => creatorsPrefixOf(item.name ?? '') === prefix),\n ),\n );\n }\n\n return this.getAll({ lastNameSw: prefix, sort: 'default' }).pipe(\n map((items) =>\n items\n .filter((item) => creatorsLetterOf(item.name ?? '') === letter)\n .sort((a, b) =>\n creatorsServiceCollator.compare(a.name ?? '', b.name ?? ''),\n ),\n ),\n );\n }\n\n /**\n * The creator profile `creator/{id}` (MOB-1972: life years, editorial biography, portrait, lead artwork, tags and\n * related lists). An API host without it answers 404, so the dictionary entry `dictionary/Creator/{id}` is read\n * then. `null` when both answer 404.\n */\n getById(id: string | number): Observable<Creator | null> {\n const apiUrl = this.creatorsServiceConfig.apiUrl;\n\n return this.creatorsServiceGetOne(creatorProfileUrl(apiUrl, id)).pipe(\n catchError((error: unknown) =>\n error instanceof HttpErrorResponse && error.status === 404\n ? this.creatorsServiceGetOne(creatorDictionaryUrl(apiUrl, id)).pipe(\n this.creatorsServiceOnNotFound<Creator | null>(null),\n )\n : throwError(() => error),\n ),\n );\n }\n\n /** First works of a creator (`filter[creators][]`), `limit` per page; page 1 by default. */\n getWorks(\n id: string | number,\n limit?: number,\n page?: number,\n ): Observable<ICreatorWorksPage> {\n return this.creatorsServiceGetObjects(\n creatorWorksUrl(this.creatorsServiceConfig.apiUrl, id, page, limit),\n );\n }\n\n /** First page of a related list of `creator/{id}` (MOB-1963); no request for an empty one. */\n getRelated(\n related: ICreatorRelated | null | undefined,\n limit: number,\n ): Observable<ICreatorWorksPage> {\n const url = creatorRelatedUrl(\n this.creatorsServiceConfig.apiUrl,\n related,\n limit,\n );\n\n return url\n ? this.creatorsServiceGetObjects(url)\n : of<ICreatorWorksPage>({ items: [], total: 0 });\n }\n\n /**\n * `getByLetter('#')` shared by the prefixes and the groups. It is kept per `apiUrl`\n * (another API loads it again); a failure is not kept.\n */\n private creatorsServiceGetHashCreators(): Observable<Creator[]> {\n const apiUrl = this.creatorsServiceConfig.apiUrl;\n\n if (this.creatorsServiceHashCache?.apiUrl !== apiUrl) {\n const cache = {\n apiUrl,\n items$: this.getByLetter('#').pipe(\n catchError((error: unknown) => {\n if (this.creatorsServiceHashCache === cache) {\n this.creatorsServiceHashCache = null;\n }\n\n return throwError(() => error);\n }),\n shareReplay({ bufferSize: 1, refCount: false }),\n ),\n };\n this.creatorsServiceHashCache = cache;\n }\n\n return this.creatorsServiceHashCache.items$;\n }\n\n private creatorsServiceGetOne(url: string): Observable<Creator | null> {\n return this.creatorsServiceHttp\n .get<ICreatorDetailsResponseDto>(url)\n .pipe(\n map(({ data }) =>\n data ? this.creatorsServiceNormaliseOne(data) : null,\n ),\n );\n }\n\n private creatorsServiceGetObjects(\n url: string,\n ): Observable<ICreatorWorksPage> {\n return this.creatorsServiceHttp\n .get<ICreatorWorksResponseDto<MsObject>>(url)\n .pipe(\n map(({ data }) => ({\n items: data?.items ?? [],\n total: data?.paginatorDetails?.totalItemsCount ?? 0,\n })),\n this.creatorsServiceOnNotFound<ICreatorWorksPage>({\n items: [],\n total: 0,\n }),\n );\n }\n\n private creatorsServiceGetRaw(\n query: ICreatorsQueryDto,\n ): Observable<ICreatorsListResponseDto> {\n return this.creatorsServiceHttp.get<ICreatorsListResponseDto>(\n creatorsListUrl(this.creatorsServiceConfig.apiUrl, query),\n );\n }\n\n private creatorsServiceNormalise(items?: CreatorRawDto[]): Creator[] {\n return (items ?? []).map((item) => this.creatorsServiceNormaliseOne(item));\n }\n\n /** First occurrence wins: the `#` prefixes can return the same creator twice. */\n private creatorsServiceUniqueById(items: Creator[]): Creator[] {\n const seen = new Set<string>();\n\n return items.filter(({ id }) => !seen.has(id) && !!seen.add(id));\n }\n\n /** The API sends `id` as a JSON number in the list and the detail; the entity keys on a string. */\n private creatorsServiceNormaliseOne(item: CreatorRawDto): Creator {\n return { ...item, id: String(item.id) } as Creator;\n }\n\n /** The API answers 404 (`NO_RESULTS_FOR_GIVEN_QUERY`, `RECORD_NOT_FOUND`) for no data. */\n private creatorsServiceOnNotFound<R>(fallback: R): OperatorFunction<R, R> {\n return catchError((error: unknown) =>\n error instanceof HttpErrorResponse && error.status === 404\n ? of(fallback)\n : throwError(() => error),\n );\n }\n}\n","import { SlugService } from '@smartsoft001/utils';\n\nimport { decodeHtmlEntities, stripHtml } from '@smartsoft001-mobilems/angular';\nimport {\n Creator,\n CreatorDictValue,\n} from '@smartsoft001-mobilems/creators-domain';\n\n/** Label of a dictionary value: an entry gives its name, text and numbers are shown as they are. */\nexport function creatorDictLabel(\n value: CreatorDictValue | null | undefined,\n): string {\n if (value === null || value === undefined) return '';\n\n return typeof value === 'object' ? (value.name ?? '') : String(value);\n}\n\n/**\n * \"Kobro, Katarzyna\" gives \"Katarzyna Kobro\". Only with exactly one comma:\n * other forms (groups, pseudonyms) stay as they are.\n */\nexport function creatorDisplayName(name: string | null | undefined): string {\n const text = name ?? '';\n const parts = text.split(',');\n\n if (parts.length !== 2) return text.trim();\n\n const [surname, first] = parts.map((part) => part.trim());\n\n return [first, surname].filter(Boolean).join(' ');\n}\n\nconst CREATOR_YEAR = /\\d{4}/g;\n\n/**\n * Life years only: \"1898.1.26 - 1951.2.26\" gives \"1898–1951\". Without a period\n * they come from `dateFrom`/`dateTo`. A period given as a dictionary id has no dates.\n */\nexport function creatorLifeYears(\n item: Pick<Creator, 'period' | 'dateFrom' | 'dateTo'>,\n): string | undefined {\n const { period } = item;\n const periodName =\n typeof period === 'string'\n ? period\n : typeof period === 'object' && period !== null\n ? period.name\n : undefined;\n const source =\n periodName?.trim() || `${item.dateFrom ?? ''} ${item.dateTo ?? ''}`;\n\n return source.match(CREATOR_YEAR)?.join('–');\n}\n\n/** A name from the CMS can be HTML with entities: plain text, spaces collapsed. */\nexport function creatorPlainName(name: string | null | undefined): string {\n return decodeHtmlEntities(stripHtml(name ?? ''))\n .replace(/\\s+/g, ' ')\n .trim();\n}\n\n/** Ends of blocks and line breaks: words on both sides must stay apart once the tags go. */\nconst CREATOR_BLOCK_BREAK = /<\\/(?:p|div|li|h[1-6]|blockquote)>|<br\\s*\\/?>/gi;\n/** Comments, MSO conditional blocks (`<!--[if gte mso 9]>...<![endif]-->`) included. */\nconst CREATOR_HTML_COMMENT = /<!--[\\s\\S]*?-->/g;\n\n/** A biography as one line of text. `MuseumSeoService` decodes entities and truncates. */\nexport function creatorPlainText(html: string | null | undefined): string {\n return stripHtml(\n (html ?? '')\n .replace(CREATOR_HTML_COMMENT, '')\n .replace(CREATOR_BLOCK_BREAK, '$& '),\n )\n .replace(/\\s+/g, ' ')\n .trim();\n}\n\n/**\n * Roles to show: `roleName`, else the name of a `role` object or a textual\n * `role` string, then the additional roles. A numeric or id-like `role` (`366`,\n * `'366'`) is never shown.\n * Trimmed, empty ones dropped, deduped case-insensitively.\n */\nexport function creatorRoles(\n creator:\n Pick<Creator, 'role' | 'roleName' | 'additionalRoles'> | null | undefined,\n): string[] {\n if (!creator) return [];\n\n const { role } = creator;\n const roleName =\n typeof role === 'object' && role !== null\n ? role.name\n : typeof role === 'string' && !/^\\d+$/.test(role.trim())\n ? role\n : undefined;\n const names = [\n creator.roleName?.trim() || roleName,\n ...(creator.additionalRoles ?? []).map((entry) => entry?.name),\n ];\n const seen = new Set<string>();\n const result: string[] = [];\n\n for (const name of names) {\n const text = name?.trim();\n const key = text?.toLocaleLowerCase('pl');\n\n if (!text || !key || seen.has(key)) continue;\n\n seen.add(key);\n result.push(text);\n }\n\n return result;\n}\n\n/** URL slug of the creator: the display name without markup. */\nexport function creatorSlug(creator: Pick<Creator, 'name'>): string {\n return SlugService.create(creatorDisplayName(creatorPlainName(creator.name)));\n}\n\n/** Router commands to the details page: `[path, id, slug]`, or `[path, id]` for an empty slug. */\nexport function creatorDetailsCommands(\n path: string,\n creator: Pick<Creator, 'id' | 'name'>,\n): string[] {\n const slug = creatorSlug(creator);\n\n return slug ? [path, creator.id, slug] : [path, creator.id];\n}\n\nconst CREATOR_DATE_YEAR = /^(\\d{4})-\\d{2}-\\d{2}/;\n\n/**\n * Years under the name (museum-artists `artistYears`, MOB-1972): \"1898 – 1951\". The years of the full dates\n * (`birthDate`/`deathDate`) first, then the ready `lifeYears`, then `birthYear`/`deathYear`, then the years in the\n * period; `''` without any.\n */\nexport function creatorYears(\n creator: Pick<\n Creator,\n | 'period'\n | 'lifeYears'\n | 'birthDate'\n | 'deathDate'\n | 'birthYear'\n | 'deathYear'\n >,\n): string {\n const born = CREATOR_DATE_YEAR.exec(creator.birthDate ?? '')?.[1];\n const died = CREATOR_DATE_YEAR.exec(creator.deathDate ?? '')?.[1];\n if (born || died) return [born ?? '?', died ?? ''].join(' – ').trim();\n\n const ready = creator.lifeYears?.trim();\n if (ready) return ready;\n\n const bornYear = creator.birthYear ?? '';\n const diedYear = creator.deathYear ?? '';\n if (bornYear || diedYear) {\n return [bornYear, diedYear].filter(Boolean).join(' – ');\n }\n\n const { period } = creator;\n const text =\n typeof period === 'string'\n ? period\n : typeof period === 'object' && period !== null\n ? (period.name ?? '')\n : '';\n\n return (text.match(CREATOR_YEAR) ?? []).slice(0, 2).join(' – ');\n}\n\n/** HTML whose text, without comments (MSO blocks), tags and entities (`&nbsp;`), is empty. */\nfunction creatorLooksEmpty(html: string): boolean {\n return !decodeHtmlEntities(\n stripHtml(html.replace(CREATOR_HTML_COMMENT, '')),\n ).trim();\n}\n\n/**\n * The biography html to show (museum-artists `artistBiography`): `editorialBiography`, then `biography`, then\n * `description`, trimmed. A field that only looks filled (`<p>&nbsp;</p>`, Word's `<!--[if gte mso 9]>` blocks) is\n * skipped; `''` without any.\n */\nexport function creatorBiography(\n creator:\n | Pick<Creator, 'editorialBiography' | 'biography' | 'description'>\n | null\n | undefined,\n): string {\n if (!creator) return '';\n\n for (const html of [\n creator.editorialBiography,\n creator.biography,\n creator.description,\n ]) {\n const value = html?.trim() ?? '';\n if (value && !creatorLooksEmpty(value)) return value;\n }\n\n return '';\n}\n\n/** About six lines of the content column: a longer biography folds (\"rozwiń tekst\"). */\nconst CREATOR_FOLD_CHARS = 600;\n\nfunction creatorBiographyText(html: string | null | undefined): string {\n return decodeHtmlEntities(creatorPlainText(html)).replace(/\\s+/g, ' ').trim();\n}\n\n/** Whether the biography is longer than the folded view (600 characters of text). */\nexport function creatorIsLongBiography(\n html: string | null | undefined,\n): boolean {\n return creatorBiographyText(html).length > CREATOR_FOLD_CHARS;\n}\n\n/** The start of the biography for the folded view: plain text, cut at a word, with an ellipsis. */\nexport function creatorBiographyExcerpt(\n html: string | null | undefined,\n): string {\n const text = creatorBiographyText(html);\n if (text.length <= CREATOR_FOLD_CHARS) return text;\n\n const cut = text.slice(0, CREATOR_FOLD_CHARS);\n const space = cut.lastIndexOf(' ');\n\n return `${(space > 0 ? cut.slice(0, space) : cut).replace(/[\\s,.;:–-]+$/, '')}…`;\n}\n","import { Creator } from '@smartsoft001-mobilems/creators-domain';\n\n/**\n * Group letter of a name: diacritics folded (NFD), only letters and digits\n * kept, the first one upper-cased. `Ł` has no decomposition, so it stays its\n * own letter. No letter or digit gives `#`.\n */\nexport function creatorNfdLetter(name: string | null | undefined): string {\n const normalized = (name ?? '')\n .normalize('NFD')\n .replace(/\\p{Diacritic}/gu, '')\n .replace(/[^\\p{L}\\p{N}]/gu, '');\n\n return normalized.charAt(0).toUpperCase() || '#';\n}\n\nexport interface ICreatorsLetterGroup {\n letter: string;\n items: Creator[];\n}\n\nconst creatorsCompare = (a: string, b: string): number =>\n a.localeCompare(b, 'pl');\n\n/**\n * Groups A-Z (reversed for `desc`), items A-Z inside a group either way. Both\n * sorts use the Polish locale, so `Ł` follows `L` (Ossolineum's code-point sort\n * puts it after `Z`).\n */\nexport function groupCreatorsByLetter(\n items: readonly Creator[],\n desc = false,\n): ICreatorsLetterGroup[] {\n const groups = new Map<string, Creator[]>();\n\n for (const item of items) {\n const letter = creatorNfdLetter(item.name);\n const group = groups.get(letter);\n\n if (group) group.push(item);\n else groups.set(letter, [item]);\n }\n\n const result = Array.from(groups, ([letter, groupItems]) => ({\n letter,\n items: groupItems.sort((a, b) =>\n creatorsCompare(a.name ?? '', b.name ?? ''),\n ),\n })).sort((a, b) => creatorsCompare(a.letter, b.letter));\n\n return desc ? result.reverse() : result;\n}\n","import {\n ICrudFilter,\n ICrudFilterQueryItem,\n} from '@smartsoft001/crud-shell-angular';\n\nimport {\n serializeCatalogFilter,\n yearRangeLabel,\n yearRangeValue,\n} from '@smartsoft001-mobilems/angular';\n\n/** Value of the creators filter form. Years are kept as typed, `''` is unset. */\nexport interface ICreatorsFilterValue {\n phrase: string;\n birthFrom: string;\n birthTo: string;\n}\n\nexport const EMPTY_CREATORS_FILTER: ICreatorsFilterValue = {\n phrase: '',\n birthFrom: '',\n birthTo: '',\n};\n\nconst CREATORS_BIRTH_KEY = 'dateFrom';\nconst CREATORS_YEAR = /^\\d{1,4}$/;\n\n/** `?filter=` of the creators page: the phrase and the birth range as full dates. */\nexport function creatorsFilterQueryParams(value: ICreatorsFilterValue): {\n filter?: string;\n} {\n const from = value.birthFrom.trim();\n const to = value.birthTo.trim();\n const query: Partial<ICrudFilterQueryItem>[] = [];\n\n if (from) {\n query.push({\n key: CREATORS_BIRTH_KEY,\n type: '>=',\n value: yearRangeValue(from, 'from'),\n });\n }\n if (to) {\n query.push({\n key: CREATORS_BIRTH_KEY,\n type: '<=',\n value: yearRangeValue(to, 'to'),\n });\n }\n\n const filter = serializeCatalogFilter({\n query: query as ICrudFilterQueryItem[],\n searchText: value.phrase,\n });\n\n return filter ? { filter } : {};\n}\n\n/** Reads a parsed `?filter=` back into the form value. */\nexport function creatorsFilterValueOf(\n filter: Pick<ICrudFilter, 'query' | 'searchText'> | null | undefined,\n): ICreatorsFilterValue {\n const birth = (type: ICrudFilterQueryItem['type']): string => {\n const item = filter?.query?.find(\n (entry) => entry.key === CREATORS_BIRTH_KEY && entry.type === type,\n );\n\n return item ? yearRangeLabel(item.value) : '';\n };\n\n return {\n phrase: filter?.searchText?.trim() ?? '',\n birthFrom: birth('>='),\n birthTo: birth('<='),\n };\n}\n\nexport function hasCreatorsFilter(value: ICreatorsFilterValue): boolean {\n return !!(\n value.phrase.trim() ||\n value.birthFrom.trim() ||\n value.birthTo.trim()\n );\n}\n\n/** A birth year as the API takes it: 1-4 digits, from 1 to 9999. */\nexport function isCreatorsBirthYear(year: string): boolean {\n const trimmed = year.trim();\n\n return CREATORS_YEAR.test(trimmed) && Number(trimmed) >= 1;\n}\n\n/** False for a year that is not `isCreatorsBirthYear`, or a range with `from` after `to`. */\nexport function isCreatorsBirthRangeValid(\n value: ICreatorsFilterValue,\n): boolean {\n const from = value.birthFrom.trim();\n const to = value.birthTo.trim();\n\n if (\n (from && !isCreatorsBirthYear(from)) ||\n (to && !isCreatorsBirthYear(to))\n ) {\n return false;\n }\n\n return !(from && to && Number(from) > Number(to));\n}\n","import { capitalize } from '@smartsoft001/utils';\n\nimport { ISeoMetadata } from '@smartsoft001-mobilems/angular';\n\n/** SEO translation keys of a creators list page. */\nexport interface ICreatorsListSeo {\n titleKey: string;\n descriptionKey: string;\n /** Default `'MODEL.mainTitle'`. */\n siteNameKey?: string;\n url?: string;\n}\n\n/**\n * List meta of a creators page, one format for the index and the filtered view of the same page:\n * `capitalize(t(titleKey)) - capitalize(t(siteNameKey))`, `t(descriptionKey)`, `type: 'website'`\n * and `url` only when it is set.\n */\nexport function creatorsListSeoMetadata(\n seo: ICreatorsListSeo,\n t: (key: string) => string,\n): ISeoMetadata {\n const metadata: ISeoMetadata = {\n title: `${capitalize(t(seo.titleKey))} - ${capitalize(t(seo.siteNameKey ?? 'MODEL.mainTitle'))}`,\n description: t(seo.descriptionKey),\n type: 'website',\n };\n if (seo.url) metadata.url = seo.url;\n\n return metadata;\n}\n","import { Injectable, Signal, signal } from '@angular/core';\n\nimport { Creator } from '@smartsoft001-mobilems/creators-domain';\n\n/** A creator as the list context keeps it: the id as a string. */\nexport interface ICreatorRef {\n id: string;\n name?: string | null;\n}\n\nexport interface ICreatorNeighbours {\n prev: ICreatorRef | null;\n next: ICreatorRef | null;\n}\n\n/**\n * The shown order of the last creators list (an index group or a catalog page). The details page\n * reads prev/next from it; a deep link or SSR has no context and gets none.\n */\n@Injectable({ providedIn: 'root' })\nexport class CreatorsListContext {\n private readonly creatorsListContextItems = signal<readonly ICreatorRef[]>(\n [],\n );\n\n readonly items: Signal<readonly ICreatorRef[]> =\n this.creatorsListContextItems.asReadonly();\n\n /** The shown order of a list; ids are stringified (the list API sends numbers). */\n set(items: readonly Pick<Creator, 'id' | 'name'>[]): void {\n this.creatorsListContextItems.set(\n items.map((item) => ({ id: String(item.id), name: item.name ?? null })),\n );\n }\n\n clear(): void {\n this.creatorsListContextItems.set([]);\n }\n\n /** Prev/next of a creator, compared as strings; none for an id outside the list. */\n neighbours(id: string | number | null | undefined): ICreatorNeighbours {\n const items = this.creatorsListContextItems();\n const index =\n id === null || id === undefined\n ? -1\n : items.findIndex((item) => item.id === String(id));\n\n if (index < 0) return { prev: null, next: null };\n\n return {\n prev: items[index - 1] ?? null,\n next: items[index + 1] ?? null,\n };\n }\n}\n","import {\n computed,\n DestroyRef,\n effect,\n inject,\n Signal,\n signal,\n untracked,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n ICrudFilter,\n ICrudFilterQueryItem,\n} from '@smartsoft001/crud-shell-angular';\nimport { catchError, map, of, Subject, switchMap } from 'rxjs';\n\nimport {\n createCatalog,\n ICatalog,\n ICatalogFacade,\n ICatalogOptions,\n offsetToPage,\n yearRangeValue,\n} from '@smartsoft001-mobilems/angular';\nimport { Creator } from '@smartsoft001-mobilems/creators-domain';\nimport { ICreatorsQueryDto } from '@smartsoft001-mobilems/creators-shell-dtos';\n\nimport { CreatorsListContext } from './creators-list-context';\nimport { CreatorsService, ICreatorsPage } from '../services/creators.service';\nimport {\n creatorsFilterValueOf,\n ICreatorsFilterValue,\n isCreatorsBirthYear,\n} from '../tools/creators-filter';\nimport {\n groupCreatorsByLetter,\n ICreatorsLetterGroup,\n} from '../tools/creators-letter-groups';\n\n/** Page size 24, sorted by name A-Z, no letter and no filter. */\nexport const CREATORS_CATALOG_DEFAULTS: ICrudFilter = {\n offset: 0,\n limit: 24,\n sortBy: 'name',\n sortDesc: false,\n query: [],\n};\n\nconst CREATORS_CATALOG_LETTER_KEY = 'sw';\nconst CREATORS_CATALOG_BIRTH_KEY = 'dateFrom';\nconst CREATORS_CATALOG_DATE = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\n\n/** Days of a month, February by the leap-year rule. */\nfunction creatorsCatalogDaysInMonth(year: number, month: number): number {\n if (month === 2) {\n const leap = (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n\n return leap ? 29 : 28;\n }\n\n return [4, 6, 9, 11].indexOf(month) >= 0 ? 30 : 31;\n}\n\n/**\n * A birth bound as the API takes it (`YYYY-MM-DD`): an `isCreatorsBirthYear` year is widened with\n * `yearRangeValue`, a full date must be a real calendar date whose year passes `isCreatorsBirthYear`. Anything else is `null` and is not sent:\n * the API answers 400 `SEARCH_ERROR` to it.\n */\nfunction creatorsCatalogBirthDate(\n value: unknown,\n bound: 'from' | 'to',\n): string | null {\n if (typeof value !== 'string' && typeof value !== 'number') return null;\n\n const trimmed = String(value).trim();\n const date = isCreatorsBirthYear(trimmed)\n ? yearRangeValue(trimmed, bound)\n : trimmed;\n const match = CREATORS_CATALOG_DATE.exec(date);\n\n if (!match) return null;\n\n const year = Number(match[1]);\n const month = Number(match[2]);\n const day = Number(match[3]);\n const valid =\n isCreatorsBirthYear(match[1]) &&\n month >= 1 &&\n month <= 12 &&\n day >= 1 &&\n day <= creatorsCatalogDaysInMonth(year, month);\n\n return valid ? date : null;\n}\n\nfunction creatorsCatalogQueryItem(\n filter: Pick<ICrudFilter, 'query'> | null | undefined,\n key: string,\n type: ICrudFilterQueryItem['type'] = '=',\n): ICrudFilterQueryItem | undefined {\n return filter?.query?.find(\n (item) => item.key === key && (item.type ?? '=') === type,\n );\n}\n\nfunction creatorsCatalogLetter(\n filter: Pick<ICrudFilter, 'query'> | null | undefined,\n): string | null {\n const value = creatorsCatalogQueryItem(\n filter,\n CREATORS_CATALOG_LETTER_KEY,\n )?.value;\n\n return typeof value === 'string' && value.trim() ? value.trim() : null;\n}\n\n/**\n * The catalog filter as a `CreatorsService.getPage` query: page and size, the phrase (`q`), the\n * letter (query key `sw`), the birth range (query key `dateFrom`, `>=`/`<=`) and the name sort.\n * A blank phrase or letter and an invalid birth bound are left out.\n */\nexport function creatorsFilterToQuery(\n filter: ICrudFilter | null | undefined,\n): ICreatorsQueryDto {\n const limit = filter?.limit || CREATORS_CATALOG_DEFAULTS.limit || 24;\n const query: ICreatorsQueryDto = {\n page: offsetToPage(filter?.offset ?? 0, limit),\n maxPerPage: limit,\n sort:\n filter?.sortBy === 'name'\n ? filter.sortDesc\n ? 'name-desc'\n : 'name-asc'\n : null,\n };\n const q = filter?.searchText?.trim();\n const sw = creatorsCatalogLetter(filter);\n const birthFrom = creatorsCatalogBirthDate(\n creatorsCatalogQueryItem(filter, CREATORS_CATALOG_BIRTH_KEY, '>=')?.value,\n 'from',\n );\n const birthTo = creatorsCatalogBirthDate(\n creatorsCatalogQueryItem(filter, CREATORS_CATALOG_BIRTH_KEY, '<=')?.value,\n 'to',\n );\n\n if (q) query.q = q;\n if (sw) query.sw = sw;\n if (birthFrom) query.birthFrom = birthFrom;\n if (birthTo) query.birthTo = birthTo;\n\n return query;\n}\n\nexport interface ICreatorsFacade extends ICatalogFacade {\n readonly list: Signal<Creator[]>;\n /** The filter `list` was loaded with (`filter` is the requested one); `null` before the first load. */\n readonly loadedFilter: Signal<ICrudFilter | null>;\n}\n\n/**\n * A signal facade over `CreatorsService.getPage` for `createCatalog` (not an NgRx CRUD slice).\n * A newer read cancels the older one. Call in an injection context.\n */\nexport function createCreatorsFacade(): ICreatorsFacade {\n const service = inject(CreatorsService);\n const filter = signal<ICrudFilter | null>(null);\n const loading = signal(false);\n const error = signal<unknown>(null);\n const totalCount = signal(0);\n const list = signal<Creator[]>([]);\n const loadedFilter = signal<ICrudFilter | null>(null);\n const reads = new Subject<ICrudFilter>();\n\n reads\n .pipe(\n switchMap((next) =>\n service.getPage(creatorsFilterToQuery(next)).pipe(\n map(\n (\n page,\n ):\n | { page: ICreatorsPage; filter: ICrudFilter }\n | { error: unknown } => ({\n page,\n filter: next,\n }),\n ),\n catchError((failure: unknown) => of({ error: failure })),\n ),\n ),\n takeUntilDestroyed(inject(DestroyRef)),\n )\n .subscribe((result) => {\n if ('page' in result) {\n list.set(result.page.items);\n loadedFilter.set(result.filter);\n totalCount.set(result.page.total);\n error.set(null);\n } else {\n error.set(result.error);\n list.set([]);\n totalCount.set(0);\n }\n loading.set(false);\n });\n\n return {\n filter: filter.asReadonly(),\n loading: loading.asReadonly(),\n error: error.asReadonly(),\n totalCount: totalCount.asReadonly(),\n list: list.asReadonly(),\n loadedFilter: loadedFilter.asReadonly(),\n read: (next) => {\n filter.set(next);\n loading.set(true);\n reads.next(next);\n },\n };\n}\n\nexport interface ICreatorsCatalogOptions extends Omit<\n ICatalogOptions,\n 'facade' | 'readGuard' | 'defaults'\n> {\n /** Default `CREATORS_CATALOG_DEFAULTS`. */\n defaults?: ICrudFilter;\n}\n\nexport interface ICreatorsCatalog extends ICatalog {\n /** The loaded page, as the API sorted it. */\n readonly list: Signal<Creator[]>;\n /** The page grouped by NFD letter; groups reversed when it was loaded with `name-desc`. */\n readonly groups: Signal<ICreatorsLetterGroup[]>;\n /** The requested direction (updates at once; `groups` follows when the page loads). */\n readonly sortDesc: Signal<boolean>;\n /** The letter (query key `sw`), `null` without one. */\n readonly startsWith: Signal<string | null>;\n /** Sets the letter, or drops it for `null`/blank. */\n setStartsWith(letter: string | null): void;\n /** The phrase and birth range of the filter, as the form shows them. */\n readonly filterValue: Signal<ICreatorsFilterValue>;\n /**\n * The current filter with the phrase and the birth range of `value`, first page; other query keys (the letter) are\n * kept, invalid years dropped. `CreatorsCatalogBaseComponent.applyFilter` navigates to it.\n */\n filterFor(value: ICreatorsFilterValue): ICrudFilter;\n /** One read of `filterFor(value)` in place (the url keeps its `?filter=`). */\n applyFilter(value: ICreatorsFilterValue): void;\n}\n\n/**\n * The filtered creators list (`/artysci?filter=…`) on `createCatalog`, with the creators facade and\n * no read guard (a foreign `CrudConfig` in the injector cannot stall it). After each load it writes\n * the shown order into `CreatorsListContext`. Call in an injection context.\n */\nexport function createCreatorsCatalog(\n options: ICreatorsCatalogOptions,\n): ICreatorsCatalog {\n const facade = createCreatorsFacade();\n const listContext = inject(CreatorsListContext);\n const catalog = createCatalog({\n ...options,\n defaults: options.defaults ?? CREATORS_CATALOG_DEFAULTS,\n facade,\n readGuard: false,\n });\n\n const sortDesc = computed(() => !!catalog.filter()?.sortDesc);\n // The shown page keeps the direction it was loaded with until the next one arrives.\n const groups = computed(() =>\n groupCreatorsByLetter(facade.list(), !!facade.loadedFilter()?.sortDesc),\n );\n\n effect(() => {\n const shown = groups();\n\n if (catalog.hasError()) {\n untracked(() => listContext.clear());\n return;\n }\n if (catalog.isLoading() || !catalog.filter()) return;\n\n untracked(() => listContext.set(shown.flatMap((group) => group.items)));\n });\n\n const birthItem = (\n year: string,\n bound: 'from' | 'to',\n ): ICrudFilterQueryItem[] => {\n const value = year.trim()\n ? creatorsCatalogBirthDate(year.trim(), bound)\n : null;\n\n return value\n ? [\n {\n key: CREATORS_CATALOG_BIRTH_KEY,\n value,\n type: bound === 'from' ? '>=' : '<=',\n hidden: true,\n },\n ]\n : [];\n };\n\n const filterFor = (value: ICreatorsFilterValue): ICrudFilter => {\n const current = catalog.filter() ?? CREATORS_CATALOG_DEFAULTS;\n const query = (current.query ?? []).filter(\n (item) =>\n !(\n item.key === CREATORS_CATALOG_BIRTH_KEY &&\n (item.type === '>=' || item.type === '<=')\n ),\n );\n\n return {\n ...current,\n offset: 0,\n searchText: value.phrase.trim(),\n query: [\n ...query,\n ...birthItem(value.birthFrom, 'from'),\n ...birthItem(value.birthTo, 'to'),\n ],\n };\n };\n\n return {\n ...catalog,\n list: facade.list,\n groups,\n sortDesc,\n startsWith: computed(() => creatorsCatalogLetter(catalog.filter())),\n setStartsWith: (letter) => {\n const trimmed = letter?.trim();\n\n if (trimmed) {\n catalog.setQueryItem(CREATORS_CATALOG_LETTER_KEY, trimmed);\n } else {\n catalog.removeQueryKey(CREATORS_CATALOG_LETTER_KEY);\n }\n },\n filterValue: computed(() => creatorsFilterValueOf(catalog.filter())),\n filterFor,\n applyFilter: (value) => {\n const { searchText, query } = filterFor(value);\n\n catalog.update({ searchText, query });\n },\n };\n}\n","import {\n DOCUMENT,\n isPlatformBrowser,\n Location,\n ViewportScroller,\n} from '@angular/common';\nimport {\n afterNextRender,\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n Injector,\n PLATFORM_ID,\n Signal,\n signal,\n untracked,\n viewChild,\n WritableSignal,\n} from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { TranslateService } from '@ngx-translate/core';\nimport {\n catchError,\n combineLatest,\n distinctUntilChanged,\n forkJoin,\n map,\n Observable,\n of,\n shareReplay,\n startWith,\n Subject,\n switchMap,\n} from 'rxjs';\n\nimport { MuseumSeoService } from '@smartsoft001-mobilems/angular';\nimport { Creator } from '@smartsoft001-mobilems/creators-domain';\n\nimport { CreatorsListContext } from './creators-list-context';\nimport { CreatorsService } from '../services/creators.service';\nimport {\n CREATORS_ALPHABET,\n creatorsDisplayPrefix,\n creatorsFindPrefix,\n CreatorsLetter,\n creatorsLetterOf,\n creatorsPrefixAnchor,\n groupCreatorsByIndexPrefixes,\n ICreatorsPrefixGroup,\n parseCreatorsLetter,\n resolveCreatorsFragment,\n} from '../tools/creators-index';\nimport {\n creatorsListSeoMetadata,\n ICreatorsListSeo,\n} from '../tools/creators-list-seo';\n\n/** `?litera=` of the index. A constant: the letter stream is a field-initialized `toSignal`. */\nexport const CREATORS_INDEX_LETTER_PARAM = 'litera';\n\n/** `?prefiks=`: the two-letter group of the letter the index shows (MOB-1959). */\nexport const CREATORS_INDEX_PREFIX_PARAM = 'prefiks';\n\n/** A `#fragment` as written, decoded when it is a valid escape. */\nfunction creatorsIndexDecode(fragment: string): string {\n try {\n return decodeURIComponent(fragment);\n } catch {\n return fragment;\n }\n}\n\n/** `?filter=` belongs to the catalog results view; the index stays idle while it is there. */\nconst CREATORS_INDEX_FILTER_PARAM = 'filter';\n\n/**\n * The index view (museum-artists MOB-1959): the letter's two-letter groups\n * (`prefixes`), the group shown (`prefix`, `?prefiks=` or the first one) and its creators.\n * With `creatorsIndexWholeLetter()` and no `?prefiks=`, `prefix` is `null` and `items` is the whole letter.\n */\nexport interface ICreatorsIndexState {\n status: 'loading' | 'error' | 'success';\n prefixes: string[];\n prefix: string | null;\n items: Creator[];\n}\n\n/**\n * A group of the letter with its DOM anchor; only the shown group carries items — every group of the\n * whole letter does (`creatorsIndexWholeLetter()`).\n */\nexport interface ICreatorsIndexGroup extends ICreatorsPrefixGroup {\n anchor: string;\n}\n\ninterface ICreatorsIndexRouteState {\n letter: CreatorsLetter;\n filtered: boolean;\n}\n\ninterface ICreatorsIndexPrefixesState extends ICreatorsIndexRouteState {\n status: ICreatorsIndexState['status'];\n prefixes: string[];\n}\n\nconst CREATORS_INDEX_LOADING: ICreatorsIndexState = {\n status: 'loading',\n prefixes: [],\n prefix: null,\n items: [],\n};\n\nconst CREATORS_INDEX_IDLE: ICreatorsIndexState = {\n status: 'success',\n prefixes: [],\n prefix: null,\n items: [],\n};\n\n/**\n * Logic of the creators letter index (museum-artists' `/artysci` at MOB-1959): `?litera=` picks the\n * letter, `?prefiks=` its group, the address `#fragment` (`#B`, `#Ba`, an anchor) is followed once\n * the group has loaded, and the mobile jump-to panel's choice is scrolled to and focused.\n *\n * The museum writes the HTML: a `#filtersButton` element (the focus goes back to it when the\n * panel closes), a `[id]=\"group.anchor\"` `tabindex=\"-1\"` section for the shown group, and the\n * jump-to panel bound to `changeLetter`, `selectPrefix` and `closeFilters`.\n */\n@Directive()\nexport abstract class CreatorsIndexBaseComponent {\n /** Anchor prefix of the groups (`tworcy-42-61`); sztuki uses `'artysci'`. Read lazily. */\n protected readonly creatorsIndexAnchorBase: string = 'tworcy';\n /** SEO keys (Ossolineum's by default). Read once, after the subclass initialisers. */\n protected readonly creatorsIndexSeo: ICreatorsListSeo = {\n titleKey: 'creatorsPage',\n descriptionKey: 'CREATORS.metaDescription',\n siteNameKey: 'museumName',\n };\n\n private readonly creatorsIndexRoute = inject(ActivatedRoute);\n private readonly creatorsIndexRouter = inject(Router);\n private readonly creatorsIndexInjector = inject(Injector);\n private readonly creatorsIndexLocation = inject(Location);\n private readonly creatorsIndexDocument = inject(DOCUMENT);\n private readonly creatorsIndexScroller = inject(ViewportScroller);\n private readonly creatorsIndexIsBrowser = isPlatformBrowser(\n inject(PLATFORM_ID),\n );\n private readonly creatorsIndexService = inject(CreatorsService);\n private readonly creatorsIndexListContext = inject(CreatorsListContext);\n private readonly creatorsIndexSeoService = inject(MuseumSeoService);\n private readonly creatorsIndexTranslate = inject(TranslateService);\n private readonly creatorsIndexRetry$ = new Subject<void>();\n /** Group picked in the jump-to panel, scrolled to once it has loaded. */\n private readonly creatorsIndexPendingAnchor = signal<string | null>(null);\n /** Last `#fragment` already scrolled to, so data reloads do not jump again. */\n private creatorsIndexHandledFragment: string | null = null;\n\n readonly alphabet = CREATORS_ALPHABET;\n\n private readonly creatorsIndexRouteState$: Observable<ICreatorsIndexRouteState> =\n this.creatorsIndexRoute.queryParamMap.pipe(\n map((params) => ({\n letter: parseCreatorsLetter(params.get(CREATORS_INDEX_LETTER_PARAM)),\n filtered: params.has(CREATORS_INDEX_FILTER_PARAM),\n })),\n distinctUntilChanged(\n (a, b) => a.letter === b.letter && a.filtered === b.filtered,\n ),\n );\n\n readonly letter: Signal<CreatorsLetter> = toSignal(\n this.creatorsIndexRouteState$.pipe(\n map(({ letter }) => letter),\n distinctUntilChanged(),\n ),\n { initialValue: 'A' as CreatorsLetter },\n );\n\n /**\n * `?filter=` is present: the catalog results view owns the page and the index stays idle. The template switches\n * between the index and the results view on it.\n */\n readonly filtered: Signal<boolean> = toSignal(\n this.creatorsIndexRouteState$.pipe(map(({ filtered }) => filtered)),\n { initialValue: false },\n );\n\n private readonly creatorsIndexPrefixParam$ =\n this.creatorsIndexRoute.queryParamMap.pipe(\n map((params) => params.get(CREATORS_INDEX_PREFIX_PARAM)),\n distinctUntilChanged(),\n );\n\n private readonly creatorsIndexPrefixes$: Observable<ICreatorsIndexPrefixesState> =\n combineLatest([\n this.creatorsIndexRouteState$,\n this.creatorsIndexRetry$.pipe(startWith(undefined)),\n ]).pipe(\n switchMap(([route]) =>\n route.filtered\n ? of<ICreatorsIndexPrefixesState>({\n ...route,\n status: 'success',\n prefixes: [],\n })\n : this.creatorsIndexService.getPrefixes(route.letter).pipe(\n map((prefixes) => ({ status: 'success' as const, prefixes })),\n catchError(() =>\n of({ status: 'error' as const, prefixes: [] as string[] }),\n ),\n startWith({\n status: 'loading' as const,\n prefixes: [] as string[],\n }),\n map((state): ICreatorsIndexPrefixesState => ({\n ...route,\n ...state,\n })),\n ),\n ),\n shareReplay({ bufferSize: 1, refCount: true }),\n );\n\n readonly state: Signal<ICreatorsIndexState> = toSignal(\n combineLatest([\n this.creatorsIndexPrefixes$,\n this.creatorsIndexPrefixParam$,\n ]).pipe(\n switchMap(([{ letter, filtered, status, prefixes }, raw]) => {\n if (filtered) return of(CREATORS_INDEX_IDLE);\n\n return status === 'success'\n ? this.creatorsIndexLoad(letter, prefixes, raw)\n : of<ICreatorsIndexState>({ ...CREATORS_INDEX_LOADING, status });\n }),\n ),\n { initialValue: CREATORS_INDEX_LOADING },\n );\n\n readonly groups: Signal<ICreatorsIndexGroup[]> = computed(() => {\n const { prefixes, prefix: shown, items } = this.state();\n const base = this.creatorsIndexAnchorBase;\n\n if (this.creatorsIndexWholeLetter() && !shown) {\n // The API groups first (also the empty ones: the jump bar lists them), then a shown group the\n // API did not list.\n const filled = new Map(\n groupCreatorsByIndexPrefixes(items, prefixes).map((group) => [\n group.prefix,\n group.items,\n ]),\n );\n return [\n ...prefixes,\n ...[...filled.keys()].filter((prefix) => !prefixes.includes(prefix)),\n ].map((prefix) => ({\n prefix,\n anchor: creatorsPrefixAnchor(prefix, base),\n items: filled.get(prefix) ?? [],\n }));\n }\n\n const listed =\n this.creatorsIndexWholeLetter() && shown && !prefixes.includes(shown)\n ? [...prefixes, shown]\n : prefixes;\n\n return listed.map((prefix) => ({\n prefix,\n anchor: creatorsPrefixAnchor(prefix, base),\n items: prefix === shown ? items : [],\n }));\n });\n\n readonly prefixes: Signal<string[]> = computed(() => this.state().prefixes);\n\n readonly activePrefix: Signal<string | null> = computed(\n () => this.state().prefix,\n );\n\n readonly activeAnchor: Signal<string | null> = computed(() => {\n const prefix = this.activePrefix();\n\n return prefix\n ? creatorsPrefixAnchor(prefix, this.creatorsIndexAnchorBase)\n : null;\n });\n\n private readonly creatorsIndexFragment = toSignal(\n this.creatorsIndexRoute.fragment,\n { initialValue: null },\n );\n\n readonly filtersOpen: WritableSignal<boolean> = signal(false);\n\n /** The museum's `#filtersButton` (template ref contract). */\n private readonly creatorsIndexFiltersButton =\n viewChild<ElementRef<HTMLElement>>('filtersButton');\n\n constructor() {\n // Once, after the subclass initialisers, so an overridden `creatorsIndexSeo` counts.\n effect(() => untracked(() => this.creatorsIndexApplySeo()));\n\n // As the catalog: a failed load leaves no stale prev/next behind.\n effect(() => {\n const state = this.state();\n if (this.filtered() || state.status === 'loading') return;\n if (state.status === 'error') {\n untracked(() => this.creatorsIndexListContext.clear());\n return;\n }\n\n const shown = this.groups().flatMap((group) => group.items);\n untracked(() => this.creatorsIndexListContext.set(shown));\n });\n\n // The router's anchorScrolling fires on NavigationEnd, before the group's\n // creators arrive, so an address like `/artysci#B` would never scroll.\n effect(() => {\n if (!this.creatorsIndexIsBrowser) return;\n if (this.filtered()) {\n // The filter view owns the page; coming back to the same fragment scrolls again.\n this.creatorsIndexHandledFragment = null;\n return;\n }\n\n const fragment = this.creatorsIndexFragment();\n const state = this.state();\n if (!fragment) {\n // Leaving the fragment (e.g. another letter) re-arms it for Back.\n this.creatorsIndexHandledFragment = null;\n return;\n }\n if (fragment === this.creatorsIndexHandledFragment) return;\n\n const groups = this.groups();\n const target = resolveCreatorsFragment(fragment, this.letter(), groups);\n // A letter switch does not need this letter's list (it may still load, or have failed).\n if (target && 'letter' in target) {\n this.creatorsIndexRouter.navigate([], {\n relativeTo: this.creatorsIndexRoute,\n queryParams: { [CREATORS_INDEX_LETTER_PARAM]: target.letter },\n fragment,\n replaceUrl: true,\n });\n return;\n }\n if (state.status === 'loading' && !state.prefixes.length) return;\n if (!target) {\n // Narrowed, a group the API did not list is only known from the whole letter: load it first.\n if (\n this.creatorsIndexWholeLetter() &&\n state.prefix &&\n this.creatorsIndexUnlistedPrefix(\n this.letter(),\n this.creatorsIndexFragmentPrefix(fragment),\n )\n ) {\n this.creatorsIndexRouter.navigate([], {\n relativeTo: this.creatorsIndexRoute,\n queryParams: { [CREATORS_INDEX_LETTER_PARAM]: this.letter() },\n fragment,\n replaceUrl: true,\n });\n }\n return;\n }\n if ('letter' in target) return; // switched above; narrows the type\n\n const group = groups.find((g) => g.anchor === target.anchor);\n // The whole letter shows every group: another one than the picked group drops `?prefiks=`.\n if (\n this.creatorsIndexWholeLetter() &&\n group &&\n state.prefix &&\n group.prefix !== state.prefix\n ) {\n this.creatorsIndexRouter.navigate([], {\n relativeTo: this.creatorsIndexRoute,\n queryParams: { [CREATORS_INDEX_LETTER_PARAM]: this.letter() },\n fragment,\n replaceUrl: true,\n });\n return;\n }\n // Another group of this letter is loaded first (`?prefiks=`).\n if (\n !this.creatorsIndexWholeLetter() &&\n group &&\n group.prefix !== state.prefix\n ) {\n this.creatorsIndexRouter.navigate([], {\n relativeTo: this.creatorsIndexRoute,\n queryParams: {\n [CREATORS_INDEX_LETTER_PARAM]: this.letter(),\n [CREATORS_INDEX_PREFIX_PARAM]: group.prefix,\n },\n fragment,\n replaceUrl: true,\n });\n return;\n }\n\n if (state.status !== 'success') return;\n this.creatorsIndexHandledFragment = fragment;\n afterNextRender(() => this.jumpTo(target.anchor), {\n injector: this.creatorsIndexInjector,\n });\n });\n\n // The group picked in the jump-to panel is reached once it has loaded; when\n // it fails, the focus goes back to the filters button instead.\n effect(() => {\n const state = this.state();\n const anchor = this.creatorsIndexPendingAnchor();\n if (!anchor || this.filtersOpen() || state.status === 'loading') return;\n if (anchor !== this.activeAnchor()) return;\n\n this.creatorsIndexPendingAnchor.set(null);\n afterNextRender(\n () =>\n state.status === 'success'\n ? this.jumpTo(anchor)\n : this.creatorsIndexFocusFiltersButton(),\n { injector: this.creatorsIndexInjector },\n );\n });\n }\n\n back(): void {\n this.creatorsIndexLocation.back();\n }\n\n /** Scrolls to a group and moves focus to it (the router only scrolls). Browser only. */\n jumpTo(anchor: string): void {\n if (!this.creatorsIndexIsBrowser) return;\n\n this.creatorsIndexScroller.scrollToAnchor(anchor);\n this.creatorsIndexDocument\n .getElementById(anchor)\n ?.focus({ preventScroll: true });\n }\n\n openFilters(): void {\n this.creatorsIndexPendingAnchor.set(null);\n this.filtersOpen.set(true);\n }\n\n changeLetter(letter: CreatorsLetter): void {\n this.creatorsIndexPendingAnchor.set(null);\n this.creatorsIndexRouter.navigate([], {\n relativeTo: this.creatorsIndexRoute,\n queryParams: { [CREATORS_INDEX_LETTER_PARAM]: letter },\n });\n }\n\n /** The panel's group: loaded through `?prefiks=`, then scrolled to. */\n selectPrefix(prefix: string): void {\n const anchor = creatorsPrefixAnchor(prefix, this.creatorsIndexAnchorBase);\n this.creatorsIndexPendingAnchor.set(anchor);\n this.creatorsIndexRouter\n .navigate([], {\n relativeTo: this.creatorsIndexRoute,\n queryParams: {\n [CREATORS_INDEX_LETTER_PARAM]: this.letter(),\n [CREATORS_INDEX_PREFIX_PARAM]: prefix,\n },\n })\n .then((navigated) => {\n // A cancelled navigation never loads the group; the same address\n // (the active group applied again) is reached by the effect.\n if (navigated || this.creatorsIndexPendingAnchor() !== anchor) return;\n if (anchor === this.activeAnchor()) return;\n this.creatorsIndexPendingAnchor.set(null);\n this.creatorsIndexFocusFiltersButton();\n });\n }\n\n /**\n * Focus moves after the next render, once the panel is gone: to the picked group once it has\n * loaded, or back to the filters button (Safari does not focus a button on click).\n */\n closeFilters(): void {\n this.filtersOpen.set(false);\n\n if (this.creatorsIndexPendingAnchor()) return;\n afterNextRender(() => this.creatorsIndexFocusFiltersButton(), {\n injector: this.creatorsIndexInjector,\n });\n }\n\n retry(): void {\n this.creatorsIndexRetry$.next();\n }\n\n private creatorsIndexFocusFiltersButton(): void {\n if (!this.creatorsIndexIsBrowser) return;\n\n this.creatorsIndexFiltersButton()?.nativeElement.focus();\n }\n\n private creatorsIndexApplySeo(): void {\n this.creatorsIndexSeoService.apply(\n creatorsListSeoMetadata(this.creatorsIndexSeo, (key) =>\n String(this.creatorsIndexTranslate.instant(key) ?? ''),\n ),\n );\n }\n\n /**\n * `true`: a letter shows its whole list split into the API groups, and `?prefiks=` only narrows it\n * (MobileMS, Łukasz 22.10: „kliknięcie A powinno całą listę zwrócić”). `false` (the default, kept\n * for the museums built on it) opens the first group. A method, not a field: a cached letter can\n * load while the base initialisers still run, before a subclass field would be set.\n */\n protected creatorsIndexWholeLetter(): boolean {\n return false;\n }\n\n /**\n * A `?prefiks=` of this letter the API did not list (a group shown from the whole letter's data),\n * in the index form (`cv` → `Cv`); `null` for anything else. Not for `#`, whose groups are local.\n * Two characters only: a one-character group is the letter itself (a creator named `X`), and\n * `lastNameSw` on it is the whole letter, so it cannot narrow.\n */\n /** The prefix a `#fragment` names: a group anchor (`tworcy-43-76`) read back, or the fragment itself (`#Cv`). */\n private creatorsIndexFragmentPrefix(fragment: string): string {\n const raw = creatorsIndexDecode(fragment);\n const head = `${this.creatorsIndexAnchorBase}-`;\n if (!raw.startsWith(head)) return raw;\n\n const codePoints = raw\n .slice(head.length)\n .split('-')\n .map((hex) => (/^[\\da-f]{1,6}$/.test(hex) ? parseInt(hex, 16) : NaN));\n return codePoints.every((point) => point <= 0x10ffff)\n ? String.fromCodePoint(...codePoints)\n : raw;\n }\n\n private creatorsIndexUnlistedPrefix(\n letter: CreatorsLetter,\n raw: string | null,\n ): string | null {\n const chars = Array.from(raw?.trim() ?? '');\n if (letter === '#' || chars.length !== 2) return null;\n const prefix = creatorsDisplayPrefix(\n chars.join('').toLocaleUpperCase('pl'),\n );\n\n return creatorsLetterOf(prefix) === letter ? prefix : null;\n }\n\n private creatorsIndexLoad(\n letter: CreatorsLetter,\n prefixes: string[],\n raw: string | null,\n ): Observable<ICreatorsIndexState> {\n const whole = this.creatorsIndexWholeLetter();\n const prefix = whole\n ? (creatorsFindPrefix(raw, prefixes) ??\n this.creatorsIndexUnlistedPrefix(letter, raw))\n : (creatorsFindPrefix(raw, prefixes) ?? prefixes[0] ?? null);\n const base = { prefixes, prefix };\n // The whole letter is still searched when the API lists no group (data drift); `#` has no search.\n const nothing = whole\n ? !prefix && letter === '#' && !prefixes.length\n : !prefix;\n if (nothing)\n return of<ICreatorsIndexState>({ ...base, status: 'success', items: [] });\n\n const items$ = prefix\n ? this.creatorsIndexService.getByIndexPrefix(letter, prefix)\n : this.creatorsIndexLetter(letter, prefixes);\n\n return items$.pipe(\n map((items): ICreatorsIndexState => ({\n ...base,\n status: 'success',\n items,\n })),\n catchError(() =>\n of<ICreatorsIndexState>({ ...base, status: 'error', items: [] }),\n ),\n startWith<ICreatorsIndexState>({ ...base, status: 'loading', items: [] }),\n );\n }\n\n /**\n * Every creator of a letter: one `lastNameSw` search on the letter, or for `#` (no API filter)\n * its groups, read from the service's cached bucket.\n */\n private creatorsIndexLetter(\n letter: CreatorsLetter,\n prefixes: string[],\n ): Observable<Creator[]> {\n if (letter !== '#')\n return this.creatorsIndexService.getByIndexPrefix(letter, letter);\n\n return forkJoin(\n prefixes.map((prefix) =>\n this.creatorsIndexService.getByIndexPrefix(letter, prefix),\n ),\n ).pipe(map((lists) => lists.flat()));\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n afterNextRender,\n Directive,\n inject,\n input,\n InputSignal,\n linkedSignal,\n output,\n signal,\n} from '@angular/core';\n\nimport { CreatorsLetter } from '../tools/creators-index';\n\n/**\n * Logic of the mobile \"go to\" panel of the creators index (museum-artists'\n * `index-filters-mobile`, MOB-1949/1959). The choice is a draft until `apply()`:\n * another letter emits `letterChange`, a prefix of the current letter emits\n * `prefixSelect`, and — with `creatorsJumpToWholeLetter()` — unpressing the shown prefix\n * (`togglePrefix`) emits the current letter, its whole list. Every way out (close, backdrop, Escape, apply) emits `closed`;\n * the host removes the panel and moves the focus on.\n *\n * Escape is bound here (`host`), so a subclass must not bind it again.\n */\n@Directive({ host: { '(keydown.escape)': 'close()' } })\nexport abstract class CreatorsJumpToBaseComponent {\n /**\n * The header the card opens under; the first element found wins. Read after the\n * first render, so an override counts.\n */\n protected readonly creatorsJumpToHeaderSelectors: readonly string[] = [\n 'app-header',\n 'app-nav-bar',\n ];\n\n private readonly creatorsJumpToDocument = inject(DOCUMENT);\n\n readonly letters = input.required<readonly CreatorsLetter[]>();\n readonly activeLetter = input.required<CreatorsLetter>();\n /** Prefix groups of the loaded (active) letter. */\n readonly prefixes = input<readonly string[]>([]);\n /** Prefix the index currently shows, pre-selected. */\n readonly activePrefix: InputSignal<string | null> = input<string | null>(\n null,\n );\n\n readonly letterChange = output<CreatorsLetter>();\n readonly prefixSelect = output<string>();\n readonly closed = output<void>();\n\n readonly selectedLetter = linkedSignal(() => this.activeLetter());\n readonly selectedPrefix = linkedSignal(() => this.activePrefix());\n\n /** The card's top edge: the header's bottom edge, measured once the panel is rendered. */\n readonly topOffset = signal(0);\n\n constructor() {\n afterNextRender(() =>\n this.topOffset.set(this.creatorsJumpToMeasureHeader()),\n );\n }\n\n selectLetter(letter: CreatorsLetter): void {\n this.selectedLetter.set(letter);\n this.selectedPrefix.set(null);\n }\n\n /** Presses a prefix; the pressed one again goes back to no prefix (the whole letter). */\n togglePrefix(prefix: string): void {\n this.selectedPrefix.update((current) =>\n current === prefix ? null : prefix,\n );\n }\n\n apply(): void {\n const letter = this.selectedLetter();\n const prefix = this.selectedPrefix();\n\n if (letter !== this.activeLetter()) this.letterChange.emit(letter);\n else if (prefix) this.prefixSelect.emit(prefix);\n else if (this.creatorsJumpToWholeLetter() && this.activePrefix())\n this.letterChange.emit(letter);\n\n this.closed.emit();\n }\n\n /**\n * `true` beside an index with `creatorsIndexWholeLetter()`: unpressing the shown prefix goes back to\n * the whole letter. `false` (the default) keeps the panel's apply a no-op then.\n */\n protected creatorsJumpToWholeLetter(): boolean {\n return false;\n }\n\n close(): void {\n this.closed.emit();\n }\n\n private creatorsJumpToMeasureHeader(): number {\n let header: Element | null = null;\n for (const selector of this.creatorsJumpToHeaderSelectors) {\n header = this.creatorsJumpToDocument.querySelector(selector);\n if (header) break;\n }\n\n return Math.max(0, Math.round(header?.getBoundingClientRect().bottom ?? 0));\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n PLATFORM_ID,\n Signal,\n viewChild,\n} from '@angular/core';\nimport { Router } from '@angular/router';\nimport { TranslateService } from '@ngx-translate/core';\n\nimport {\n catalogListQueryParams,\n MuseumSeoService,\n} from '@smartsoft001-mobilems/angular';\n\nimport {\n createCreatorsCatalog,\n ICreatorsCatalog,\n ICreatorsCatalogOptions,\n} from './create-creators-catalog';\nimport {\n hasCreatorsFilter,\n ICreatorsFilterValue,\n} from '../tools/creators-filter';\nimport {\n creatorsListSeoMetadata,\n ICreatorsListSeo,\n} from '../tools/creators-list-seo';\n\nexport interface ICreatorsCatalogPageOptions extends ICreatorsCatalogOptions {\n /** Applied on creation, skipped in a search tab. */\n seo?: ICreatorsListSeo;\n}\n\n/**\n * Base of the filtered creators list (`/artysci?filter=…`) on `createCreatorsCatalog`: first read,\n * persistence, sort/size/page, the letter, the phrase and the birth range come from `catalog`;\n * the page keeps its template. The url is the source of truth for the filter: `applyFilter` navigates\n * to `?filter=` (the catalog reads it), `clearAllFilters` goes back to the index (`listPath`).\n *\n * ```ts\n * export class ResultsComponent extends CreatorsCatalogBaseComponent {\n * constructor() {\n * super({ persistKey: 'ARTISTS', listPath: '/artysci', seo: { titleKey: 'PAGE_TITLES.artists', descriptionKey: 'ARTISTS.metaDescription' } });\n * }\n * }\n * ```\n *\n * A `#listContainer` element in the template is scrolled to after a page change from the bottom\n * pagination (`bottomPageChange`), in the browser only.\n */\n@Directive()\nexport abstract class CreatorsCatalogBaseComponent {\n protected readonly catalog: ICreatorsCatalog;\n\n private readonly creatorsCatalogPageTranslate = inject(TranslateService);\n private readonly creatorsCatalogPageRouter = inject(Router);\n private readonly creatorsCatalogPageListPath: string;\n private readonly creatorsCatalogPageSeoService = inject(MuseumSeoService);\n private readonly creatorsCatalogPageIsBrowser = isPlatformBrowser(\n inject(PLATFORM_ID),\n );\n private readonly creatorsCatalogPageListContainer =\n viewChild<ElementRef<HTMLElement>>('listContainer');\n private creatorsCatalogPageScrollAfterLoad = false;\n\n /** The phrase or a birth bound is set. */\n readonly hasActiveFilters: Signal<boolean> = computed(() =>\n hasCreatorsFilter(this.catalog.filterValue()),\n );\n\n protected constructor(options: ICreatorsCatalogPageOptions) {\n const { seo, ...catalogOptions } = options;\n this.catalog = createCreatorsCatalog(catalogOptions);\n this.creatorsCatalogPageListPath = options.listPath;\n\n // After a page change from the bottom pagination scroll to the list top\n // once the data has loaded.\n effect(() => {\n const loading = this.catalog.isLoading();\n if (\n loading ||\n !this.creatorsCatalogPageScrollAfterLoad ||\n !this.creatorsCatalogPageIsBrowser\n ) {\n return;\n }\n\n this.creatorsCatalogPageScrollAfterLoad = false;\n setTimeout(() =>\n this.creatorsCatalogPageListContainer()?.nativeElement.scrollIntoView({\n behavior: 'smooth',\n block: 'start',\n }),\n );\n });\n\n if (seo) this.creatorsCatalogPageApplySeo(seo);\n }\n\n pageChange(page: number): void {\n this.catalog.setPage(page);\n }\n\n bottomPageChange(page: number): void {\n this.creatorsCatalogPageScrollAfterLoad = true;\n this.pageChange(page);\n }\n\n onLimitChange(limit: number | string): void {\n this.catalog.setLimit(limit);\n }\n\n sortChange(key: 'name-asc' | 'name-desc'): void {\n this.catalog.setSortKey(key);\n }\n\n onSearch(phrase: string): void {\n this.catalog.search(phrase);\n }\n\n /** The letter (`sw`); `null` or blank drops it. */\n setStartsWith(letter: string | null): void {\n this.catalog.setStartsWith(letter);\n }\n\n /**\n * Navigates to `listPath?filter=…` with the phrase and the birth range (the letter, the sort and the size kept);\n * the catalog reads the new `?filter=`. Without any filter the url has no `?filter=`, so the index shows.\n */\n applyFilter(value: ICreatorsFilterValue): void {\n void this.creatorsCatalogPageRouter.navigate(\n [this.creatorsCatalogPageListPath],\n { queryParams: catalogListQueryParams(this.catalog.filterFor(value)) },\n );\n }\n\n retryLoad(): void {\n this.catalog.retry();\n }\n\n /** Back to the index: `listPath` without parameters. */\n clearAllFilters(): void {\n void this.creatorsCatalogPageRouter.navigate([\n this.creatorsCatalogPageListPath,\n ]);\n }\n\n /**\n * The index's list meta (`creatorsListSeoMetadata`), not in a search tab: the canonical url of\n * the list must not point at a phrase url.\n */\n private creatorsCatalogPageApplySeo(seo: ICreatorsListSeo): void {\n if (this.catalog.searchEnabled()) return;\n\n this.creatorsCatalogPageSeoService.apply(\n creatorsListSeoMetadata(seo, (key) =>\n String(this.creatorsCatalogPageTranslate.instant(key) ?? ''),\n ),\n );\n }\n}\n","import {\n computed,\n Directive,\n input,\n linkedSignal,\n output,\n Signal,\n WritableSignal,\n} from '@angular/core';\n\nimport {\n EMPTY_CREATORS_FILTER,\n ICreatorsFilterValue,\n isCreatorsBirthRangeValid,\n} from '../tools/creators-filter';\n\n/**\n * Logic of the creators filters modal: a draft of the phrase and the birth range, started from\n * `value` (and again on each new `value`), applied with `apply()`. Escape closes it (bound by the\n * base; a subclass must not bind it again). The museum writes the HTML.\n */\n@Directive({ host: { '(keydown.escape)': 'close()' } })\nexport abstract class CreatorsFiltersBaseComponent {\n /** The applied filter (`catalog.filterValue()`). */\n readonly value = input<ICreatorsFilterValue>(EMPTY_CREATORS_FILTER);\n\n readonly phrase: WritableSignal<string> = linkedSignal(\n () => this.value().phrase,\n );\n readonly birthFrom: WritableSignal<string> = linkedSignal(\n () => this.value().birthFrom,\n );\n readonly birthTo: WritableSignal<string> = linkedSignal(\n () => this.value().birthTo,\n );\n\n /** A year that the API does not take, or `from` after `to`. */\n readonly rangeInvalid: Signal<boolean> = computed(\n () => !isCreatorsBirthRangeValid(this.creatorsFiltersDraft()),\n );\n\n readonly applied = output<ICreatorsFilterValue>();\n readonly closed = output<void>();\n\n /** Emits the trimmed draft, then `closed`; nothing while `rangeInvalid`. */\n apply(): void {\n if (this.rangeInvalid()) return;\n\n this.applied.emit(this.creatorsFiltersDraft());\n this.closed.emit();\n }\n\n /** Clears the draft; the applied filter stays until `apply()`. */\n reset(): void {\n this.phrase.set('');\n this.birthFrom.set('');\n this.birthTo.set('');\n }\n\n close(): void {\n this.closed.emit();\n }\n\n private creatorsFiltersDraft(): ICreatorsFilterValue {\n return {\n phrase: this.phrase().trim(),\n birthFrom: this.birthFrom().trim(),\n birthTo: this.birthTo().trim(),\n };\n }\n}\n","import { computed, Directive, inject, input, Signal } from '@angular/core';\n\nimport { FileUrlService } from '@smartsoft001-mobilems/angular';\nimport { Creator } from '@smartsoft001-mobilems/creators-domain';\n\nimport {\n creatorDetailsCommands,\n creatorDisplayName,\n creatorLifeYears,\n creatorPlainName,\n creatorRoles,\n} from '../tools/creator-fields';\n\n/**\n * Logic of a creator list card: display name, life years, roles, image with the placeholder and\n * the details link. The museum writes the HTML.\n */\n@Directive()\nexport abstract class CreatorCardBaseComponent {\n /** Details path (`/tworcy/:id/:slug`); sztuki uses `'/artysci'`. Read lazily. */\n protected readonly creatorCardPath: string = '/tworcy';\n /** Image when the creator has none. Read lazily. */\n protected readonly creatorCardPlaceholder: string = '/gfx/no-image.png';\n\n private readonly creatorCardFileUrl = inject(FileUrlService);\n\n readonly item = input<Creator | undefined>(undefined);\n\n /** \"Kobro, Katarzyna\" gives \"Katarzyna Kobro\" (markup dropped). */\n readonly displayName: Signal<string> = computed(() =>\n creatorDisplayName(creatorPlainName(this.item()?.name)),\n );\n\n /** \"1898–1951\"; `''` without an item or years. */\n readonly lifeYears: Signal<string> = computed(() => {\n const item = this.item();\n\n return (item && creatorLifeYears(item)) || '';\n });\n\n /** Roles, comma separated. */\n readonly roles: Signal<string> = computed(() =>\n creatorRoles(this.item()).join(', '),\n );\n\n /** A string `image` as is, an `MsFile` through `FileUrlService`, else `extraData.image`, else the placeholder. */\n readonly imageSrc: Signal<string> = computed(() => {\n const item = this.item();\n if (!item) return '';\n\n const placeholder = this.creatorCardPlaceholder;\n const { image } = item;\n\n if (typeof image === 'string' && image.trim()) return image;\n if (image && typeof image === 'object') {\n return this.creatorCardFileUrl.get(image, 'cache', placeholder);\n }\n\n return item.extraData?.image?.trim() || placeholder;\n });\n\n /** Router commands to the details page; `[]` without an item. */\n readonly link: Signal<string[]> = computed(() => {\n const item = this.item();\n\n return item ? creatorDetailsCommands(this.creatorCardPath, item) : [];\n });\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n linkedSignal,\n PLATFORM_ID,\n signal,\n viewChild,\n} from '@angular/core';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute, Params } from '@angular/router';\nimport {\n catchError,\n combineLatest,\n distinctUntilChanged,\n map,\n Observable,\n of,\n scan,\n startWith,\n Subject,\n switchMap,\n} from 'rxjs';\n\nimport { Creator } from '@smartsoft001-mobilems/creators-domain';\n\nimport { CreatorsListContext } from './creators-list-context';\nimport { CreatorsService } from '../services/creators.service';\n\n/** Four rows of three, like the works category view. */\nexport const CREATORS_SEARCH_LIMIT = 12;\nexport const CREATORS_SEARCH_PAGE_SIZES: readonly number[] = [12, 24, 48];\n\nexport interface ICreatorsSearchState {\n status: 'loading' | 'error' | 'success';\n items: Creator[];\n total: number;\n}\n\ninterface ICreatorsSearchRequest {\n text: string;\n page: number;\n limit: number;\n}\n\nconst CREATORS_SEARCH_LOADING: ICreatorsSearchState = {\n status: 'loading',\n items: [],\n total: 0,\n};\n\n/**\n * Logic of the \"creators\" category of the site search (`/wyszukaj/:text/artysci`): the phrase of\n * the route, the page and the page size, the loaded page and the list context. The view (layout,\n * toolbar, cards, pagination) stays in the museum.\n *\n * A blank phrase (`/wyszukaj/%20/artysci`) gives an empty result without a request.\n *\n * The request depends on the phrase, the page and the limit only. A `#results` template ref is\n * scrolled to after a page change from the bottom pagination (`changePage(page, true)`), in the\n * browser only.\n */\n@Directive()\nexport abstract class CreatorsSearchListBaseComponent {\n private readonly creatorsSearchListRoute = inject(ActivatedRoute);\n private readonly creatorsSearchListService = inject(CreatorsService);\n private readonly creatorsSearchListContext = inject(CreatorsListContext);\n private readonly creatorsSearchListIsBrowser = isPlatformBrowser(\n inject(PLATFORM_ID),\n );\n private readonly creatorsSearchListResults =\n viewChild<ElementRef<HTMLElement>>('results');\n private readonly creatorsSearchListRetry$ = new Subject<void>();\n private creatorsSearchListScrollAfterLoad = false;\n\n readonly pageSizes: number[] = [...CREATORS_SEARCH_PAGE_SIZES];\n\n /**\n * The phrase from `wyszukaj/:text`. The category route is lazy and has no component, so `:text`\n * is not on `route.parent`: the params of the whole path are merged.\n */\n readonly text = toSignal(\n combineLatest(\n this.creatorsSearchListRoute.pathFromRoot.map((route) => route.params),\n ).pipe(\n map((all) => {\n const params: Params = Object.assign({}, ...all);\n\n return String(params['text'] ?? '');\n }),\n distinctUntilChanged(),\n ),\n { requireSync: true },\n );\n\n readonly limit = signal(CREATORS_SEARCH_LIMIT);\n\n /** 1-based; a new phrase or page size goes back to the first page. */\n readonly page = linkedSignal({\n source: () => ({ text: this.text(), limit: this.limit() }),\n computation: () => 1,\n });\n\n private readonly creatorsSearchListRequest = computed<ICreatorsSearchRequest>(\n () => ({\n text: this.text(),\n page: this.page(),\n limit: this.limit(),\n }),\n );\n\n readonly state = toSignal(\n combineLatest([\n toObservable(this.creatorsSearchListRequest),\n this.creatorsSearchListRetry$.pipe(startWith(undefined)),\n ]).pipe(\n switchMap(([request]) => this.creatorsSearchListLoad(request)),\n // The total stays while the next page loads, so the pagination does not vanish.\n scan(\n (previous, next): ICreatorsSearchState =>\n next.status === 'loading' ? { ...next, total: previous.total } : next,\n CREATORS_SEARCH_LOADING,\n ),\n ),\n { initialValue: CREATORS_SEARCH_LOADING },\n );\n\n readonly totalCount = computed(() => this.state().total);\n\n readonly items = computed(() => this.state().items);\n\n constructor() {\n // The details page reads prev/next from the shown results; a failed load clears them, as the catalog does.\n effect(() => {\n const state = this.state();\n\n if (state.status === 'success') {\n this.creatorsSearchListContext.set(state.items);\n } else if (state.status === 'error') {\n this.creatorsSearchListContext.clear();\n }\n });\n\n // After a page change from the bottom pagination scroll to the list top once it has loaded.\n effect(() => {\n if (\n this.state().status === 'loading' ||\n !this.creatorsSearchListScrollAfterLoad ||\n !this.creatorsSearchListIsBrowser\n ) {\n return;\n }\n\n this.creatorsSearchListScrollAfterLoad = false;\n setTimeout(() =>\n this.creatorsSearchListResults()?.nativeElement.scrollIntoView({\n behavior: 'smooth',\n block: 'start',\n }),\n );\n });\n }\n\n /** `scrollToResults`: the change came from the bottom pagination, below the list. */\n changePage(page: number, scrollToResults = false): void {\n this.creatorsSearchListScrollAfterLoad = scrollToResults;\n this.page.set(page);\n }\n\n changeLimit(limit: number): void {\n this.limit.set(limit);\n }\n\n retry(): void {\n this.creatorsSearchListRetry$.next();\n }\n\n private creatorsSearchListLoad({\n text,\n page,\n limit,\n }: ICreatorsSearchRequest): Observable<ICreatorsSearchState> {\n // `getPage` drops a blank `q`, which would list every creator.\n if (!text.trim()) {\n return of<ICreatorsSearchState>({\n status: 'success',\n items: [],\n total: 0,\n });\n }\n\n return this.creatorsSearchListService\n .getPage({ q: text, page, maxPerPage: limit, extraData: true })\n .pipe(\n map(({ items, total }): ICreatorsSearchState => ({\n status: 'success',\n items,\n total,\n })),\n catchError(() =>\n of<ICreatorsSearchState>({\n ...CREATORS_SEARCH_LOADING,\n status: 'error',\n }),\n ),\n startWith(CREATORS_SEARCH_LOADING),\n );\n }\n}\n","import { DOCUMENT, isPlatformBrowser, ViewportScroller } from '@angular/common';\nimport {\n afterNextRender,\n computed,\n DestroyRef,\n Directive,\n effect,\n inject,\n Injector,\n linkedSignal,\n PLATFORM_ID,\n Signal,\n signal,\n untracked,\n} from '@angular/core';\nimport { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute } from '@angular/router';\nimport { TranslateService } from '@ngx-translate/core';\nimport {\n catchError,\n combineLatest,\n distinctUntilChanged,\n firstValueFrom,\n map,\n Observable,\n of,\n startWith,\n Subject,\n switchMap,\n} from 'rxjs';\n\nimport {\n catalogEntryFilterParams,\n FileUrlService,\n ISeoMetadata,\n MuseumSeoService,\n} from '@smartsoft001-mobilems/angular';\nimport {\n Creator,\n ICreatorImage,\n ICreatorTag,\n} from '@smartsoft001-mobilems/creators-domain';\nimport { MsFile } from '@smartsoft001-mobilems/models';\nimport { MsObject } from '@smartsoft001-mobilems/objects-domain';\n\nimport {\n CREATORS_INDEX_LETTER_PARAM,\n CREATORS_INDEX_PREFIX_PARAM,\n} from './creators-index-base.component';\nimport {\n CreatorsListContext,\n ICreatorNeighbours,\n} from './creators-list-context';\nimport {\n CreatorsService,\n ICreatorWorksPage,\n} from '../services/creators.service';\nimport {\n creatorBiography,\n creatorBiographyExcerpt,\n creatorDetailsCommands,\n creatorDictLabel,\n creatorDisplayName,\n creatorIsLongBiography,\n creatorPlainName,\n creatorPlainText,\n creatorRoles,\n creatorYears,\n} from '../tools/creator-fields';\nimport {\n creatorsIndexPrefixOf,\n creatorsLetterOf,\n} from '../tools/creators-index';\n\nexport interface ICreatorDetailsState {\n status: 'loading' | 'error' | 'not-found' | 'success';\n creator: Creator | null;\n}\n\nexport interface ICreatorDetailRow {\n labelKey: string;\n value: string;\n}\n\nexport interface ICreatorActivityPlace {\n years: string;\n places: string;\n}\n\nexport interface ICreatorAuthorityLink {\n label: string;\n url: string;\n}\n\nexport interface ICreatorGalleryImage {\n src: string;\n alt: string;\n title?: string;\n}\n\n/** Translation keys of the details page: row labels, the SEO title parts and the museum-artists page texts. */\nexport interface ICreatorDetailsKeys {\n period: string;\n birth: string;\n death: string;\n /** The section between the name and the site name in the title; `null` leaves it out. */\n sectionKey: string | null;\n siteNameKey: string;\n notFoundKey: string;\n /** The biography entry of the contents (`toc`). */\n biographyToc: string;\n /** Read out after `share()` copied the link. */\n shareCopied: string;\n}\n\n/** Ossolineum's keys for the rows and the title; museum-artists' for the contents and the share (Ossolineum has neither). */\nexport const CREATOR_DETAILS_KEYS: ICreatorDetailsKeys = {\n period: 'DETAILS_PAGE.activityPeriod',\n birth: 'DETAILS_PAGE.placeDateOfBirth',\n death: 'DETAILS_PAGE.placeDateOfDeath',\n sectionKey: 'creatorsPage',\n siteNameKey: 'museumName',\n notFoundKey: 'NOT_FOUND.title',\n biographyToc: 'ARTISTS.toc.description',\n shareCopied: 'ARTISTS.shareCopied',\n};\n\n/** A related list of the page: the works of the creator, or a related list of `creator/{id}`. */\nexport type CreatorRelatedKey =\n 'works' | 'exhibitions' | 'archives' | 'msBooks';\n\n/** One related strip: its list, `#anchor`, heading key, cards per page and how many to load. */\nexport interface ICreatorRelatedStripConfig {\n key: CreatorRelatedKey;\n anchor: string;\n labelKey: string;\n pageSize: number;\n limit: number;\n}\n\n/** museum-artists' strips (MOB-1963), in the order of the UX board. */\nexport const CREATOR_RELATED_STRIPS: readonly ICreatorRelatedStripConfig[] = [\n {\n key: 'works',\n anchor: 'dziela',\n labelKey: 'ARTISTS.related.works',\n pageSize: 6,\n limit: 18,\n },\n {\n key: 'exhibitions',\n anchor: 'wystawy',\n labelKey: 'ARTISTS.related.exhibitions',\n pageSize: 3,\n limit: 9,\n },\n {\n key: 'archives',\n anchor: 'archiwum',\n labelKey: 'ARTISTS.related.archives',\n pageSize: 3,\n limit: 9,\n },\n {\n key: 'msBooks',\n anchor: 'ksiazki-ms',\n labelKey: 'ARTISTS.related.msBooks',\n pageSize: 3,\n limit: 9,\n },\n];\n\n/** \"Show all\" of a strip: router commands and the query of the full list. */\nexport interface ICreatorRelatedStripLink {\n commands: unknown[];\n queryParams?: Record<string, string>;\n}\n\n/** A strip ready to show: `count` is the API total, `items` the loaded first page. */\nexport interface ICreatorRelatedStrip<TItem = MsObject> {\n key: CreatorRelatedKey;\n anchor: string;\n labelKey: string;\n pageSize: number;\n count: number;\n items: TItem[];\n showAll: ICreatorRelatedStripLink | null;\n}\n\n/** An entry of the page contents: the `#anchor` of a part and its heading key. */\nexport interface ICreatorTocEntry {\n anchor: string;\n labelKey: string;\n}\n\ninterface ICreatorDetailsRelatedState {\n loading: boolean;\n lists: Partial<Record<CreatorRelatedKey, ICreatorWorksPage>>;\n}\n\nconst CREATOR_DETAILS_LOADING: ICreatorDetailsState = {\n status: 'loading',\n creator: null,\n};\nconst CREATOR_DETAILS_NOT_FOUND: ICreatorDetailsState = {\n status: 'not-found',\n creator: null,\n};\nconst CREATOR_DETAILS_NO_RELATED: ICreatorDetailsRelatedState = {\n loading: false,\n lists: {},\n};\nconst CREATOR_DETAILS_NO_OBJECTS: ICreatorWorksPage = { items: [], total: 0 };\nconst CREATOR_DETAILS_HTTP_URL = /^https?:\\/\\//i;\nconst CREATOR_DETAILS_NUMERIC_ID = /^\\d+$/;\n/** How long the address fragment keeps its position while the layout above it changes. */\nconst CREATOR_DETAILS_FRAGMENT_SETTLE_MS = 2000;\nconst CREATOR_DETAILS_USER_SCROLL_EVENTS = [\n 'wheel',\n 'touchstart',\n 'keydown',\n 'mousedown',\n] as const;\n\n/**\n * Logic of a creator details page (museum-artists' `ItemComponent`, MOB-1972/1963, and Ossolineum's sections): the\n * creator of the `:id` param (`creator/{id}`, else the dictionary entry), its detail rows, years, biography (folded\n * when long), portrait, lead artwork, tags, activity places, bibliography, authority links, gallery, the related\n * strips (works, exhibitions, archives, MS books) and the contents, prev/next from `CreatorsListContext`, the way back\n * to the index, share, the scroll to the address fragment and the SEO (also during SSR, via\n * `MuseumSeoService.applyForSsr`). The museum writes the HTML.\n */\n@Directive()\nexport abstract class CreatorDetailsBaseComponent<TRelatedItem = MsObject> {\n /** Details path (`/tworcy/:id/:slug`); sztuki uses `'/artysci'`. Starts with `/`. Read lazily. */\n protected readonly creatorDetailsPath: string = '/tworcy';\n /** Row labels, SEO title keys and the page texts. Read lazily. */\n protected readonly creatorDetailsKeys: ICreatorDetailsKeys =\n CREATOR_DETAILS_KEYS;\n /** The related strips and their limits; the `works` entry also sets `works()`. Read lazily. */\n protected readonly creatorDetailsRelatedStrips: readonly ICreatorRelatedStripConfig[] =\n CREATOR_RELATED_STRIPS;\n /** `#anchor` of the biography in the contents. Read lazily. */\n protected readonly creatorDetailsBiographyAnchor: string = 'opis';\n /** The objects catalog that \"show all\" of the works opens. Read lazily. */\n protected readonly creatorDetailsObjectsPath: string = '/obiekty';\n\n private readonly creatorDetailsRoute = inject(ActivatedRoute);\n private readonly creatorDetailsService = inject(CreatorsService);\n private readonly creatorDetailsContext = inject(CreatorsListContext);\n private readonly creatorDetailsFileUrl = inject(FileUrlService);\n private readonly creatorDetailsSeo = inject(MuseumSeoService);\n private readonly creatorDetailsTranslate = inject(TranslateService);\n private readonly creatorDetailsDocument = inject(DOCUMENT);\n private readonly creatorDetailsScroller = inject(ViewportScroller);\n private readonly creatorDetailsInjector = inject(Injector);\n private readonly creatorDetailsIsBrowser = isPlatformBrowser(\n inject(PLATFORM_ID),\n );\n private readonly creatorDetailsRetry$ = new Subject<void>();\n private readonly creatorDetailsRelatedRequest$ =\n new Subject<Creator | null>();\n private readonly creatorDetailsRelated = signal<ICreatorDetailsRelatedState>(\n CREATOR_DETAILS_NO_RELATED,\n );\n private readonly creatorDetailsFragment = toSignal(\n this.creatorDetailsRoute.fragment,\n { initialValue: null },\n );\n /** `id#fragment` already scrolled to: later data does not jump again. */\n private creatorDetailsHandledFragment: string | null = null;\n private creatorDetailsStopFragmentScroll: () => void = () => undefined;\n\n readonly state: Signal<ICreatorDetailsState> = toSignal(\n combineLatest([\n this.creatorDetailsRoute.paramMap.pipe(\n map((params) => params.get('id') ?? ''),\n distinctUntilChanged(),\n ),\n this.creatorDetailsRetry$.pipe(startWith(undefined)),\n ]).pipe(switchMap(([id]) => this.creatorDetailsLoad(id))),\n { initialValue: CREATOR_DETAILS_LOADING },\n );\n\n readonly creator: Signal<Creator | null> = computed(\n () => this.state().creator,\n );\n\n /** museum-artists' name of `creator`. */\n readonly artist: Signal<Creator | null> = this.creator;\n\n /** The name without markup. */\n readonly plainName: Signal<string> = computed(() =>\n creatorPlainName(this.creator()?.name),\n );\n\n /** \"Kobro, Katarzyna\" gives \"Katarzyna Kobro\", as in the page heading. */\n readonly name: Signal<string> = computed(() =>\n creatorDisplayName(this.plainName()),\n );\n\n /** Years under the name (`creatorYears`), `''` without dates. */\n readonly years: Signal<string> = computed(() => {\n const creator = this.creator();\n\n return creator ? creatorYears(creator) : '';\n });\n\n /** Roles, comma separated; a numeric role id is never shown. */\n readonly roles: Signal<string> = computed(() =>\n creatorRoles(this.creator()).join(', '),\n );\n\n /** Period, birth and death (museum-artists' order), empty values dropped. */\n readonly details: Signal<ICreatorDetailRow[]> = computed(() => {\n const creator = this.creator();\n const keys = this.creatorDetailsKeys;\n const rows: ICreatorDetailRow[] = [\n { labelKey: keys.period, value: creatorDictLabel(creator?.period) },\n { labelKey: keys.birth, value: creator?.placeDateOfBirth ?? '' },\n { labelKey: keys.death, value: creator?.placeDateOfDeath ?? '' },\n ];\n\n return rows.filter((row) => !!row.value);\n });\n\n /**\n * The editorial biography, else the biography, else the description html, trimmed (`creatorBiography`); a field\n * that only looks filled (`<p>&nbsp;</p>`, Word's MSO blocks) is skipped; `''` without any.\n */\n readonly biography: Signal<string> = computed(() =>\n creatorBiography(this.creator()),\n );\n\n /** A biography longer than the folded view (about six lines). */\n readonly foldable: Signal<boolean> = computed(() =>\n creatorIsLongBiography(this.biography()),\n );\n\n /** Plain-text start of the biography for the folded view. */\n readonly excerpt: Signal<string> = computed(() =>\n creatorBiographyExcerpt(this.biography()),\n );\n\n /** The folded biography is unfolded; folded again for another biography. */\n readonly expanded = linkedSignal({\n source: this.biography,\n computation: () => false,\n });\n\n /** Portrait (`photo`): a ready `url`, else a MUZA file; `null` without one. */\n readonly portrait: Signal<ICreatorGalleryImage | null> = computed(() =>\n this.creatorDetailsImageOf(this.creator()?.photo),\n );\n\n /** Lead artwork (`artworkFrame`), as `portrait`. */\n readonly leadImage: Signal<ICreatorGalleryImage | null> = computed(() =>\n this.creatorDetailsImageOf(this.creator()?.artworkFrame),\n );\n\n /** Tags with a name. */\n readonly tags: Signal<ICreatorTag[]> = computed(() =>\n (this.creator()?.tags ?? []).filter((tag) => !!tag?.name?.trim()),\n );\n\n /**\n * Per activity period: `from-to` years and the location names, entries with neither dropped. As in\n * Ossolineum, `[]` when no period has locations; otherwise every period, years-only ones too.\n */\n readonly activityPlaces: Signal<ICreatorActivityPlace[]> = computed(() => {\n const places = (this.creator()?.activityPeriod ?? [])\n .map((period) => ({\n years: [period?.fromYear, period?.toYear]\n // The API may send numbers, as it does for `id` and `role`.\n .map((year) => String(year ?? '').trim())\n .filter(Boolean)\n .join('-'),\n places: (period?.locations ?? [])\n .map((location) => creatorPlainName(location?.name))\n .filter(Boolean)\n .join(', '),\n }))\n .filter((place) => place.years || place.places);\n\n return places.some((place) => place.places) ? places : [];\n });\n\n /** Bibliography entries as plain text (`text`, else `html`), empty ones dropped. */\n readonly bibliography: Signal<string[]> = computed(() =>\n (this.creator()?.bibliographies ?? [])\n .map((entry) => creatorPlainName(entry?.text || entry?.html))\n .filter(Boolean),\n );\n\n /** `identifier [base]` links of the authority files; only `http(s)://` URLs. */\n readonly authorityLinks: Signal<ICreatorAuthorityLink[]> = computed(() =>\n (this.creator()?.baseConnectionObjects ?? []).reduce<\n ICreatorAuthorityLink[]\n >((links, entry) => {\n const url = entry?.bcUrl?.trim() ?? '';\n if (!CREATOR_DETAILS_HTTP_URL.test(url)) return links;\n\n const base = creatorPlainName(entry?.bcBase?.name);\n const label = [\n creatorPlainName(entry?.bcIdentifier),\n base ? `[${base}]` : '',\n ]\n .filter(Boolean)\n .join(' ');\n links.push({ label: label || url, url });\n\n return links;\n }, []),\n );\n\n /** Signature objects, else one image of the creator, else `[]`. */\n readonly gallery: Signal<ICreatorGalleryImage[]> = computed(() =>\n this.creatorDetailsGalleryOf(this.creator()),\n );\n\n /** The first works of the creator (its id only, no list filter), from the `works` strip entry. */\n readonly works: Signal<MsObject[]> = computed(\n () => this.creatorDetailsRelated().lists.works?.items ?? [],\n );\n readonly worksTotal: Signal<number> = computed(\n () => this.creatorDetailsRelated().lists.works?.total ?? 0,\n );\n /** Also `true` while the creator loads: the related lists are requested once it has loaded. */\n readonly worksLoading: Signal<boolean> = computed(\n () =>\n this.state().status === 'loading' || this.creatorDetailsRelated().loading,\n );\n\n /** `?filter=` of the objects list with this creator, for the \"all works\" link. */\n readonly worksListQueryParams: Signal<{ filter: string } | null> = computed(\n () => {\n const creator = this.creator();\n if (!creator) return null;\n\n // Dictionary ids of the objects catalog are numbers; the service keys creators on strings.\n const id = CREATOR_DETAILS_NUMERIC_ID.test(creator.id)\n ? Number(creator.id)\n : creator.id;\n\n return catalogEntryFilterParams('creators', id, this.plainName());\n },\n );\n\n /**\n * The related strips with results, in the configured order (an empty strip is left out, with its contents\n * entry); `[]` while they load. Each item goes through `creatorDetailsRelatedItem`.\n */\n readonly strips: Signal<ICreatorRelatedStrip<TRelatedItem>[]> = computed(\n () => {\n const { lists } = this.creatorDetailsRelated();\n\n return this.creatorDetailsRelatedStrips.reduce<\n ICreatorRelatedStrip<TRelatedItem>[]\n >((strips, { key, anchor, labelKey, pageSize }) => {\n const list = lists[key];\n if (!list?.items.length) return strips;\n\n const query = key === 'works' ? this.worksListQueryParams() : null;\n strips.push({\n key,\n anchor,\n labelKey,\n pageSize,\n count: list.total,\n items: list.items.map((item) =>\n this.creatorDetailsRelatedItem(item, key),\n ),\n showAll: query\n ? { commands: [this.creatorDetailsObjectsPath], queryParams: query }\n : null,\n });\n\n return strips;\n }, []);\n },\n );\n\n /** The contents: the biography and the strips the page has. */\n readonly toc: Signal<ICreatorTocEntry[]> = computed(() => [\n ...(this.biography()\n ? [\n {\n anchor: this.creatorDetailsBiographyAnchor,\n labelKey: this.creatorDetailsKeys.biographyToc,\n },\n ]\n : []),\n ...this.strips().map(({ anchor, labelKey }) => ({ anchor, labelKey })),\n ]);\n\n /** Read out after `share()` copied the link. */\n readonly shareStatus = signal('');\n\n /** Prev/next from the last shown list; none for a deep link, SSR or a creator outside it. */\n readonly neighbours: Signal<ICreatorNeighbours> = computed(() =>\n this.creatorDetailsContext.neighbours(this.creator()?.id),\n );\n\n readonly prevCommands: Signal<string[] | null> = computed(() => {\n const prev = this.neighbours().prev;\n\n return prev ? creatorDetailsCommands(this.creatorDetailsPath, prev) : null;\n });\n\n readonly nextCommands: Signal<string[] | null> = computed(() => {\n const next = this.neighbours().next;\n\n return next ? creatorDetailsCommands(this.creatorDetailsPath, next) : null;\n });\n\n /** `[path, id, slug]` of the loaded creator; `[]` without one. */\n readonly canonicalCommands: Signal<string[]> = computed(() => {\n const creator = this.creator();\n\n return creator\n ? creatorDetailsCommands(this.creatorDetailsPath, creator)\n : [];\n });\n\n /** The index letter of the creator; `''` without one. */\n readonly backLetter: Signal<string> = computed(() => {\n const creator = this.creator();\n\n return creator ? creatorsLetterOf(creator.name ?? '') : '';\n });\n\n /** The two-letter group of the creator in the index (MOB-1959); `''` without one. */\n readonly backPrefix: Signal<string> = computed(() =>\n creatorsIndexPrefixOf(this.creator()?.name ?? ''),\n );\n\n /** The index opens on the creator's letter and two-letter group (MOB-1959). */\n readonly backQueryParams: Signal<Record<string, string>> = computed(() => {\n if (!this.creator()) return {};\n\n const params: Record<string, string> = {\n [CREATORS_INDEX_LETTER_PARAM]: this.backLetter(),\n };\n const prefix = this.backPrefix();\n // Like sztuki (`backPrefix() || null`): no empty `prefiks=`.\n if (prefix) params[CREATORS_INDEX_PREFIX_PARAM] = prefix;\n\n return params;\n });\n\n /** Ossolineum's section accordions; both open at first. */\n readonly biographyOpen = signal(true);\n readonly bibliographyOpen = signal(true);\n\n constructor() {\n this.creatorDetailsSeo.applyForSsr(() => this.creatorDetailsFetchSsrSeo());\n const destroyRef = inject(DestroyRef);\n destroyRef.onDestroy(() => this.creatorDetailsStopFragmentScroll());\n\n this.creatorDetailsRelatedRequest$\n .pipe(\n distinctUntilChanged((a, b) => a?.id === b?.id),\n switchMap((creator) => this.creatorDetailsLoadRelated(creator)),\n takeUntilDestroyed(destroyRef),\n )\n .subscribe((related) => this.creatorDetailsRelated.set(related));\n\n effect(() => {\n const creator = this.creator();\n\n untracked(() => this.creatorDetailsRelatedRequest$.next(creator));\n });\n\n // The router scrolls to the fragment on NavigationEnd, before the biography and the strips load:\n // `/artysci/:id#dziela` (back, an outside link) is scrolled here once its part is in the contents.\n effect(() => {\n const fragment = this.creatorDetailsFragment();\n const id = this.creator()?.id;\n if (!fragment) this.creatorDetailsHandledFragment = null;\n if (!fragment || !id) return;\n\n const key = `${id}#${fragment}`;\n if (key === this.creatorDetailsHandledFragment) return;\n if (!this.toc().some(({ anchor }) => anchor === fragment)) return;\n\n this.creatorDetailsHandledFragment = key;\n afterNextRender(\n { read: () => this.creatorDetailsScrollToFragment(fragment) },\n { injector: this.creatorDetailsInjector },\n );\n });\n\n effect(() => {\n const { status, creator } = this.state();\n\n untracked(() => {\n if (creator) {\n this.creatorDetailsSeo.apply(this.creatorDetailsSeoMetadata(creator));\n } else if (status === 'not-found') {\n const keys = this.creatorDetailsKeys;\n this.creatorDetailsSeo.apply({\n title: `${this.creatorDetailsT(keys.notFoundKey)} - ${this.creatorDetailsT(keys.siteNameKey)}`,\n });\n }\n });\n });\n }\n\n retry(): void {\n this.creatorDetailsRetry$.next();\n }\n\n /** Unfolds or folds the long biography (museum-artists' \"rozwiń tekst\"). */\n toggleBiography(): void {\n this.expanded.update((value) => !value);\n }\n\n /** Opens or closes Ossolineum's biography accordion. */\n toggleBiographyOpen(): void {\n this.biographyOpen.update((open) => !open);\n }\n\n toggleBibliography(): void {\n this.bibliographyOpen.update((open) => !open);\n }\n\n /** The system share, else the link to the clipboard (announced in `shareStatus`). Browser only. */\n async share(): Promise<void> {\n const view = this.creatorDetailsDocument.defaultView;\n if (!this.creatorDetailsIsBrowser || !view) return;\n\n const url = view.location.href;\n const navigator = view.navigator;\n\n try {\n if (typeof navigator.share === 'function') {\n await navigator.share({ title: this.name(), url });\n return;\n }\n await navigator.clipboard.writeText(url);\n this.shareStatus.set(\n this.creatorDetailsT(this.creatorDetailsKeys.shareCopied),\n );\n } catch {\n // A cancelled share sheet or no clipboard access: no message.\n }\n }\n\n /** A strip item as the museum shows it (sztuki: a result card); the object itself by default. */\n protected creatorDetailsRelatedItem(\n item: MsObject,\n key: CreatorRelatedKey,\n ): TRelatedItem {\n void key;\n\n return item as unknown as TRelatedItem;\n }\n\n /**\n * The `<title>` of a creator: `plainName - t(sectionKey) - t(siteNameKey)` (the section left out for a `null`\n * `sectionKey`). Override to keep another format; sztuki keeps `name() - t('museumName')`. Called lazily, for the\n * page and on the server.\n */\n protected creatorDetailsSeoTitle(creator: Creator): string {\n const keys = this.creatorDetailsKeys;\n\n return [\n creatorPlainName(creator.name),\n keys.sectionKey ? this.creatorDetailsT(keys.sectionKey) : '',\n this.creatorDetailsT(keys.siteNameKey),\n ]\n .filter(Boolean)\n .join(' - ');\n }\n\n private creatorDetailsLoad(id: string): Observable<ICreatorDetailsState> {\n return this.creatorDetailsService.getById(id).pipe(\n map((creator): ICreatorDetailsState =>\n creator ? { status: 'success', creator } : CREATOR_DETAILS_NOT_FOUND,\n ),\n catchError(() =>\n of<ICreatorDetailsState>({ status: 'error', creator: null }),\n ),\n startWith(CREATOR_DETAILS_LOADING),\n );\n }\n\n /**\n * Runs from the effect, after construction, so the strip overrides are in place. A list that fails is empty;\n * the rest of the page stays.\n */\n private creatorDetailsLoadRelated(\n creator: Creator | null,\n ): Observable<ICreatorDetailsRelatedState> {\n const strips = this.creatorDetailsRelatedStrips;\n if (!creator || !strips.length) return of(CREATOR_DETAILS_NO_RELATED);\n\n return combineLatest(\n strips.map(({ key, limit }) =>\n (key === 'works'\n ? this.creatorDetailsService.getWorks(creator.id, limit)\n : this.creatorDetailsService.getRelated(creator[key], limit)\n ).pipe(\n catchError(() => of(CREATOR_DETAILS_NO_OBJECTS)),\n map((list) => [key, list] as const),\n ),\n ),\n ).pipe(\n map((entries): ICreatorDetailsRelatedState => ({\n loading: false,\n lists: entries.reduce<ICreatorDetailsRelatedState['lists']>(\n (lists, [key, list]) => ({ ...lists, [key]: list }),\n {},\n ),\n })),\n startWith<ICreatorDetailsRelatedState>({\n ...CREATOR_DETAILS_NO_RELATED,\n loading: true,\n }),\n );\n }\n\n /**\n * Scrolls to the anchor and holds it there for a moment: the lead artwork and the strips may still change the\n * height above it. The user's own scroll ends the corrections. Runs after render, in the browser only.\n */\n private creatorDetailsScrollToFragment(fragment: string): void {\n this.creatorDetailsStopFragmentScroll();\n this.creatorDetailsScroller.scrollToAnchor(fragment);\n\n const view = this.creatorDetailsDocument.defaultView;\n if (!view || typeof view.ResizeObserver === 'undefined') return;\n\n const observer = new view.ResizeObserver(() =>\n this.creatorDetailsScroller.scrollToAnchor(fragment),\n );\n const stop = () => {\n observer.disconnect();\n view.clearTimeout(timer);\n CREATOR_DETAILS_USER_SCROLL_EVENTS.forEach((name) =>\n view.removeEventListener(name, stop),\n );\n this.creatorDetailsStopFragmentScroll = () => undefined;\n };\n const timer = view.setTimeout(stop, CREATOR_DETAILS_FRAGMENT_SETTLE_MS);\n\n observer.observe(this.creatorDetailsDocument.body);\n CREATOR_DETAILS_USER_SCROLL_EVENTS.forEach((name) =>\n view.addEventListener(name, stop, { passive: true }),\n );\n this.creatorDetailsStopFragmentScroll = stop;\n }\n\n /** `creator/{id}` gives a ready `url`; a MUZA file (`filePath`) goes through `FileUrlService`. */\n private creatorDetailsImageOf(\n file: ICreatorImage | MsFile | null | undefined,\n ): ICreatorGalleryImage | null {\n if (!file) return null;\n\n const url = 'url' in file ? (file.url?.trim() ?? '') : '';\n const src =\n url ||\n ('filePath' in file && file.filePath\n ? this.creatorDetailsFileUrl.get(file as MsFile, 'cache')\n : '');\n\n return src ? { src, alt: file.altText || '' } : null;\n }\n\n private creatorDetailsGalleryOf(\n creator: Creator | null,\n ): ICreatorGalleryImage[] {\n if (!creator) return [];\n\n const name = creatorPlainName(creator.name);\n const signatures = (creator.signatureObjects ?? []).reduce<\n ICreatorGalleryImage[]\n >((images, entry) => {\n const file = entry?.image ?? entry?.file;\n if (!file) return images;\n\n const title = creatorPlainName(entry?.title);\n images.push({\n src: this.creatorDetailsFileUrl.get(file, 'cache'),\n alt: title || name,\n ...(title ? { title } : {}),\n });\n\n return images;\n }, []);\n\n if (signatures.length) return signatures;\n\n const extra = creator.extraData?.image?.trim();\n if (extra) return [{ src: extra, alt: name }];\n\n const { image } = creator;\n if (typeof image === 'string' && image.trim()) {\n return [{ src: image.trim(), alt: name }];\n }\n if (image && typeof image === 'object') {\n return [\n { src: this.creatorDetailsFileUrl.get(image, 'cache'), alt: name },\n ];\n }\n\n return [];\n }\n\n /**\n * `creatorDetailsSeoTitle`, the plain biography (`creatorBiography`), the first image, the canonical\n * with the slug (`resolveRelativeUrl`, so `MuseumSeoService` does not fall back to the request URL).\n * Override to change the metadata; used on the page and on the server.\n */\n protected creatorDetailsSeoMetadata(creator: Creator): ISeoMetadata {\n const title = this.creatorDetailsSeoTitle(creator);\n const url = creatorDetailsCommands(this.creatorDetailsPath, creator).join(\n '/',\n );\n const metadata: ISeoMetadata = {\n title,\n description: creatorPlainText(creatorBiography(creator)) || undefined,\n // A path override without the leading slash still gives an absolute canonical.\n url: url.startsWith('/') ? url : `/${url}`,\n type: 'article',\n resolveRelativeUrl: true,\n };\n const image = this.creatorDetailsGalleryOf(creator)[0]?.src;\n if (image) metadata.image = image;\n\n return metadata;\n }\n\n private creatorDetailsFetchSsrSeo(): Promise<ISeoMetadata | null> {\n const id = this.creatorDetailsRoute.snapshot.paramMap.get('id') ?? '';\n\n return firstValueFrom(this.creatorDetailsService.getById(id))\n .then((creator) =>\n creator ? this.creatorDetailsSeoMetadata(creator) : null,\n )\n .catch(() => null);\n }\n\n private creatorDetailsT(key: string): string {\n return String(this.creatorDetailsTranslate.instant(key) ?? '');\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAEA;AACO,MAAM,iBAAiB,GAAG;IAC/B,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;IACzE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;IACzE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;;AAK9B;;;;;;;AAOG;AACH;AACO,MAAM,sBAAsB,GAAsB;AACvD,IAAA,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;AAChD,IAAA,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;IAClB,GAAG,EAAE,GAAG,EAAE,GAAG;;AAGf,SAAS,gBAAgB,CAAC,KAAa,EAAA;AACrC,IAAA,OAAQ,iBAAuC,CAAC,QAAQ,CAAC,KAAK,CAAC;AACjE;AAEA;AACM,SAAU,gBAAgB,CAAC,IAAY,EAAA;AAC3C,IAAA,MAAM,CAAC,KAAK,GAAG,EAAE,CAAC,GAAG,KAAK,C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