@nexterajs/report-viewer 0.0.1 → 0.1.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":"nexterajs-report-viewer.mjs","sources":["../../../projects/nextera-report-viewer/src/lib/protocol/nxr-protocol.const.ts","../../../projects/nextera-report-viewer/src/lib/page/nxr-page-html.util.ts","../../../projects/nextera-report-viewer/src/lib/page/nxr-report-page.component.ts","../../../projects/nextera-report-viewer/src/lib/strings/nxr-viewer-strings.const.ts","../../../projects/nextera-report-viewer/src/lib/protocol/nxr-protocol-reader.util.ts","../../../projects/nextera-report-viewer/src/lib/protocol/nxr-viewer-client.service.ts","../../../projects/nextera-report-viewer/src/lib/session/nxr-viewer-session.service.ts","../../../projects/nextera-report-viewer/src/lib/toolbar/nxr-viewer-toolbar.component.ts","../../../projects/nextera-report-viewer/src/lib/viewer/nxr-report-viewer.component.ts","../../../projects/nextera-report-viewer/src/public-api.ts","../../../projects/nextera-report-viewer/src/nexterajs-report-viewer.ts"],"sourcesContent":["/**\n * The version of the viewer protocol this package speaks: the `protocol` member of every\n * `AngularViewerData` answer from `Nextera.Report.AspNetCore`.\n */\nexport const NXR_VIEWER_PROTOCOL = 1;\n","/**\n * Page HTML from the server, made safe to place in the application's document.\n *\n * The report repository's HTML renderer escapes every attribute value and writes links only with\n * http, https, mailto, tel or no scheme, and its chart renderer strips event handlers from chart SVG.\n * This is the second layer: whatever reaches the viewer, a page can neither run script nor load active\n * content, and it cannot style the viewer around it.\n */\n\n/**\n * Elements that run script, load documents, plugins or media, submit, animate other attributes, or\n * carry CSS of their own. The renderer writes none of them into a page.\n */\nconst REMOVED_ELEMENTS = [\n 'script',\n 'noscript',\n 'template',\n 'style',\n 'link',\n 'meta',\n 'base',\n 'iframe',\n 'frame',\n 'frameset',\n 'object',\n 'embed',\n 'applet',\n 'portal',\n 'audio',\n 'video',\n 'source',\n 'track',\n 'picture',\n 'form',\n 'set',\n 'animate',\n].join(',');\n\n/** Attributes holding a URL that a click or a load would follow. */\nconst URL_ATTRIBUTES = new Set([\n 'href',\n 'xlink:href',\n 'src',\n 'action',\n 'formaction',\n 'poster',\n 'background',\n]);\n\n/** Attributes that make requests of their own and have no use in a page. */\nconst REMOVED_ATTRIBUTES = new Set(['srcset', 'ping']);\n\nconst LINK_SCHEMES = new Set(['http', 'https', 'mailto', 'tel']);\n\n/**\n * Whether a URL attribute's value can stay: no scheme (a relative or fragment URL), a link scheme, or,\n * for `src`, an image as a data URL. Browsers ignore spaces and control characters around and inside a\n * scheme, so the check drops them before reading it.\n */\nexport function isSafeUrl(attribute: string, value: string): boolean {\n let compact = '';\n for (const character of value) {\n if (character.charCodeAt(0) > 0x20) compact += character;\n }\n const scheme = /^([a-z][a-z0-9+.-]*):/i.exec(compact)?.[1]?.toLowerCase();\n if (scheme === undefined || LINK_SCHEMES.has(scheme)) return true;\n return attribute === 'src' && scheme === 'data' && /^data:image\\//i.test(compact);\n}\n\n/**\n * Parses page HTML and returns it without anything active. A template's content is inert while it is\n * examined: its scripts do not run, its images do not load and its handlers do not fire.\n */\nexport function scrubPageHtml(html: string, document: Document): DocumentFragment {\n const template = document.createElement('template');\n template.innerHTML = html;\n const content = template.content;\n for (const element of Array.from(content.querySelectorAll(REMOVED_ELEMENTS))) {\n element.remove();\n }\n for (const element of Array.from(content.querySelectorAll('*'))) {\n for (const attribute of Array.from(element.attributes)) {\n const name = attribute.name.toLowerCase();\n const unsafe =\n name.startsWith('on') ||\n REMOVED_ATTRIBUTES.has(name) ||\n (URL_ATTRIBUTES.has(name) && !isSafeUrl(name, attribute.value));\n if (unsafe) element.removeAttribute(attribute.name);\n }\n }\n return content;\n}\n\n/** A stylesheet, or a rule that holds rules: anything whose rules can be listed and deleted by index. */\ninterface RuleContainer {\n readonly cssRules: CSSRuleList;\n deleteRule(index: number): void;\n}\n\n/**\n * Deletes every style rule whose selector names `:host` or `:host-context()`, also inside grouping rules\n * such as `@media` and inside nested rules. In a shadow root those rules style the shadow host, the\n * viewer's own page element, so a page's CSS could otherwise move or hide it.\n */\nfunction deleteHostRules(container: RuleContainer): void {\n for (let index = container.cssRules.length - 1; index >= 0; index--) {\n const rule = container.cssRules[index];\n if (rule instanceof CSSStyleRule && /:host/i.test(rule.selectorText)) {\n container.deleteRule(index);\n } else if ('cssRules' in rule && !(rule instanceof CSSKeyframesRule)) {\n deleteHostRules(rule as unknown as RuleContainer);\n }\n }\n}\n\nconst sheets = new Map<string, CSSStyleSheet>();\n\n/**\n * One constructed stylesheet per distinct CSS text, shared by every shadow root that adopts it. A\n * report's page CSS is the same for every page, so a long report parses it once. The sheet keeps no rule\n * that could style the shadow host. CSS that a constructed stylesheet refuses gives an empty sheet, so the\n * page shows unstyled instead of not at all.\n */\nexport function adoptedSheet(cssText: string): CSSStyleSheet {\n let sheet = sheets.get(cssText);\n if (!sheet) {\n sheet = new CSSStyleSheet();\n try {\n sheet.replaceSync(cssText);\n deleteHostRules(sheet);\n } catch {\n sheet = new CSSStyleSheet();\n }\n sheets.set(cssText, sheet);\n }\n return sheet;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n DOCUMENT,\n ElementRef,\n inject,\n input,\n OnChanges,\n SimpleChanges,\n} from '@angular/core';\nimport type { NxrPageSize } from '../protocol/nxr-protocol.model';\nimport { adoptedSheet, scrubPageHtml } from './nxr-page-html.util';\n\n/** The viewer draws each page's frame and the space between pages, so the page CSS's own are cancelled. */\nconst PAGE_FRAME_CSS = '.nextera-page{margin:0;box-shadow:none;}';\n\n/**\n * One report page, in its own shadow root.\n *\n * The page's size comes from the report's page list, so the page holds its place before its HTML\n * arrives. The HTML is scrubbed by `scrubPageHtml` and placed beside the adopted page stylesheet, so the\n * report's styles and the application's never meet. `contain: paint` keeps even a fixed-position\n * element inside the page's box.\n */\n@Component({\n selector: 'nxr-report-page',\n standalone: true,\n template: '',\n styles: `\n :host {\n display: block;\n position: relative;\n box-sizing: content-box;\n contain: paint;\n background: #fff;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'nxr-report-page',\n '[attr.data-page]': 'page().pageNumber',\n '[style.width.pt]': 'page().widthPoints',\n '[style.height.pt]': 'page().heightPoints',\n },\n})\nexport class NxrReportPageComponent implements OnChanges {\n /** The page's number and size. */\n readonly page = input.required<NxrPageSize>();\n /** The page's HTML from the server, or null while it has not arrived. */\n readonly html = input<string | null>(null);\n /** The stylesheet every page of the report needs. */\n readonly css = input.required<string>();\n\n private readonly document = inject(DOCUMENT);\n private readonly root = (inject(ElementRef).nativeElement as HTMLElement).attachShadow({\n mode: 'open',\n });\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['css']) {\n this.root.adoptedStyleSheets = [adoptedSheet(this.css()), adoptedSheet(PAGE_FRAME_CSS)];\n }\n if (changes['html']) {\n const html = this.html();\n if (html === null) {\n this.root.replaceChildren();\n } else {\n this.root.replaceChildren(scrubPageHtml(html, this.document));\n }\n }\n }\n}\n","/**\n * Every caption and message the viewer shows, in its built-in English. A key in PascalCase is the name\n * Stimulsoft's viewer gives the same text, such as `PageOf`; a key in camelCase names a message only this\n * viewer has. The English is this package's own. A later plan lets a host's translation file replace any\n * of them, so code reads them from an `NxrViewerStrings` value wherever one is at hand.\n */\nexport const NXR_ENGLISH = {\n /** The label before the page-number box. */\n Page: 'Page',\n /** The label between the page-number box and the page count. */\n PageOf: 'of',\n FirstPage: 'First page',\n PrevPage: 'Previous page',\n NextPage: 'Next page',\n LastPage: 'Last page',\n errorUnreachable: 'The report server could not be reached.',\n errorStatus: 'The report server answered with HTTP status {0}.',\n errorTimeout: 'The report server did not answer within {0} seconds.',\n errorMalformed: \"The report server's answer to {0} is not one this viewer can read.\",\n errorProtocol:\n 'The report server speaks viewer protocol {0}, and this viewer speaks protocol {1}.',\n};\n\nexport type NxrViewerStrings = Readonly<Record<keyof typeof NXR_ENGLISH, string>>;\n\n/** Puts each value in place of its numbered placeholder: `{0}` is the first value. */\nexport function formatString(template: string, ...values: (string | number)[]): string {\n return template.replace(/\\{(\\d+)\\}/g, (placeholder, index: string) =>\n Number(index) < values.length ? String(values[Number(index)]) : placeholder,\n );\n}\n","import { HttpErrorResponse } from '@angular/common/http';\nimport { formatString, NXR_ENGLISH, NxrViewerStrings } from '../strings/nxr-viewer-strings.const';\nimport { NXR_VIEWER_PROTOCOL } from './nxr-protocol.const';\nimport type {\n NxrFindAnswer,\n NxrPagesAnswer,\n NxrReportAnswer,\n NxrUpdateCacheAnswer,\n NxrViewerAction,\n NxrViewerDataAnswer,\n NxrViewerFailure,\n} from './nxr-protocol.model';\n\n/**\n * A success answer that is not what the protocol says its action answers: the wrong shape, or an\n * AngularViewerData answer from another version of the protocol.\n */\nexport class NxrMalformedAnswerError extends Error {\n constructor(\n readonly action: NxrViewerAction,\n /** The version an AngularViewerData answer declared, when it declared another one. */\n readonly protocol: number = NXR_VIEWER_PROTOCOL,\n ) {\n super(`The ${action} answer is not what viewer protocol ${NXR_VIEWER_PROTOCOL} answers.`);\n this.name = 'NxrMalformedAnswerError';\n }\n}\n\n/** A request that got no answer within the server options' `requestTimeout`. */\nexport class NxrTimeoutError extends Error {\n constructor(readonly seconds: number) {\n super(`No answer within ${seconds} seconds.`);\n this.name = 'NxrTimeoutError';\n }\n}\n\ntype JsonObject = Record<string, unknown>;\n\nconst OPTION_GROUPS = ['actions', 'appearance', 'toolbar', 'exports', 'server'];\n\nfunction isObject(value: unknown): value is JsonObject {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction isIndex(value: unknown): value is number {\n return typeof value === 'number' && Number.isInteger(value) && value >= 0;\n}\n\nfunction isNumber(value: unknown): value is number {\n return typeof value === 'number' && Number.isFinite(value);\n}\n\nfunction isBounds(value: unknown): boolean {\n return (\n isObject(value) &&\n isNumber(value['x']) &&\n isNumber(value['y']) &&\n isNumber(value['width']) &&\n isNumber(value['height'])\n );\n}\n\nfunction isPages(value: unknown): value is NxrPagesAnswer {\n if (!isObject(value)) return false;\n const pages = value['pages'];\n return (\n isIndex(value['startIndex']) &&\n Array.isArray(pages) &&\n pages.every((page) => typeof page === 'string')\n );\n}\n\nfunction isPageSize(value: unknown): boolean {\n return (\n isObject(value) &&\n isIndex(value['pageNumber']) &&\n isNumber(value['widthPoints']) &&\n isNumber(value['heightPoints'])\n );\n}\n\nfunction isLocated(value: unknown, textKey: 'title' | 'text'): boolean {\n return (\n isObject(value) &&\n typeof value[textKey] === 'string' &&\n isIndex(value['pageIndex']) &&\n isBounds(value['bounds'])\n );\n}\n\n/** Reads the answer to AngularViewerData: the token, the viewer options and the host's translation. */\nexport function readViewerData(body: unknown): NxrViewerDataAnswer {\n if (!isObject(body)) throw new NxrMalformedAnswerError('AngularViewerData');\n const { protocol, token, options, localization } = body;\n if (isNumber(protocol) && protocol !== NXR_VIEWER_PROTOCOL) {\n throw new NxrMalformedAnswerError('AngularViewerData', protocol);\n }\n const valid =\n protocol === NXR_VIEWER_PROTOCOL &&\n typeof token === 'string' &&\n token !== '' &&\n isObject(options) &&\n OPTION_GROUPS.every((group) => isObject(options[group])) &&\n (localization === null || isObject(localization));\n if (!valid) throw new NxrMalformedAnswerError('AngularViewerData');\n return body as unknown as NxrViewerDataAnswer;\n}\n\n/** Reads the answer to GetReport: the report's name, page count, page sizes, bookmarks and page stylesheet. */\nexport function readReport(body: unknown): NxrReportAnswer {\n if (!isObject(body)) throw new NxrMalformedAnswerError('GetReport');\n const { reportName, pageCount, pages, bookmarks, pageCss, pagesHtml } = body;\n const valid =\n typeof reportName === 'string' &&\n isIndex(pageCount) &&\n Array.isArray(pages) &&\n pages.length === pageCount &&\n pages.every(isPageSize) &&\n Array.isArray(bookmarks) &&\n bookmarks.every((bookmark) => isLocated(bookmark, 'title')) &&\n typeof pageCss === 'string' &&\n (pagesHtml === undefined || isPages(pagesHtml));\n if (!valid) throw new NxrMalformedAnswerError('GetReport');\n return {\n ...(body as unknown as NxrReportAnswer),\n pagesHtml: (pagesHtml as NxrPagesAnswer | undefined) ?? null,\n };\n}\n\n/** Reads the answer to GetPages. */\nexport function readPages(body: unknown): NxrPagesAnswer {\n if (!isPages(body)) throw new NxrMalformedAnswerError('GetPages');\n return body;\n}\n\n/** Reads the answer to Find. */\nexport function readFind(body: unknown): NxrFindAnswer {\n const hits = isObject(body) ? body['hits'] : undefined;\n if (!Array.isArray(hits) || !hits.every((hit) => isLocated(hit, 'text')))\n throw new NxrMalformedAnswerError('Find');\n return body as unknown as NxrFindAnswer;\n}\n\n/** Reads the answer to UpdateCache. */\nexport function readUpdateCache(body: unknown): NxrUpdateCacheAnswer {\n if (!isObject(body) || typeof body['updated'] !== 'boolean')\n throw new NxrMalformedAnswerError('UpdateCache');\n return body as unknown as NxrUpdateCacheAnswer;\n}\n\nfunction described(status: number, message: string): NxrViewerFailure {\n return { status, type: 'Error', message, retryable: false, traceId: null };\n}\n\n/**\n * What went wrong with a request, from whatever it failed with:\n * - the server's own error answer, kept as it is;\n * - an HTTP error answer without the protocol's shape (a host's, a framework's or a proxy's);\n * - no answer at all;\n * - a timeout;\n * - a success answer the viewer cannot read.\n */\nexport function readFailure(\n failure: unknown,\n action: NxrViewerAction,\n strings: NxrViewerStrings = NXR_ENGLISH,\n): NxrViewerFailure {\n if (failure instanceof HttpErrorResponse) {\n const body: unknown = failure.error;\n if (\n isObject(body) &&\n body['status'] === 'error' &&\n typeof body['type'] === 'string' &&\n typeof body['message'] === 'string' &&\n typeof body['retryable'] === 'boolean'\n ) {\n const traceId = typeof body['traceId'] === 'string' ? body['traceId'] : null;\n return {\n status: failure.status,\n type: body['type'],\n message: body['message'],\n retryable: body['retryable'],\n traceId,\n };\n }\n if (failure.status === 0) return described(0, strings.errorUnreachable);\n if (failure.status >= 200 && failure.status < 300)\n return described(0, formatString(strings.errorMalformed, action));\n return described(failure.status, formatString(strings.errorStatus, failure.status));\n }\n if (failure instanceof NxrTimeoutError) {\n return described(0, formatString(strings.errorTimeout, failure.seconds));\n }\n if (failure instanceof NxrMalformedAnswerError) {\n return failure.protocol !== NXR_VIEWER_PROTOCOL\n ? described(0, formatString(strings.errorProtocol, failure.protocol, NXR_VIEWER_PROTOCOL))\n : described(0, formatString(strings.errorMalformed, failure.action));\n }\n return described(0, failure instanceof Error ? failure.message : String(failure));\n}\n","import { HttpClient, HttpErrorResponse } from '@angular/common/http';\nimport { inject, Injectable } from '@angular/core';\nimport { catchError, defer, from, map, Observable, switchMap, throwError, timeout } from 'rxjs';\nimport type { NxrViewerStrings } from '../strings/nxr-viewer-strings.const';\nimport type {\n NxrExportAnswer,\n NxrFindAnswer,\n NxrPagesAnswer,\n NxrReportAnswer,\n NxrUpdateCacheAnswer,\n NxrViewerAction,\n NxrViewerDataAnswer,\n} from './nxr-protocol.model';\nimport {\n NxrTimeoutError,\n readFailure,\n readFind,\n readPages,\n readReport,\n readUpdateCache,\n readViewerData,\n} from './nxr-protocol-reader.util';\nimport type { NxrViewerOptions } from './nxr-viewer-options.model';\n\n/** What the component's `postParametersFunction` is called with: the request's action and its parameters. */\nexport interface NxrPostParametersData {\n action: NxrViewerAction;\n [parameter: string]: unknown;\n}\n\n/**\n * The component's `postParametersFunction` input. It runs for every request, the first one included.\n * Each key of an object it returns becomes a form field of the request, replacing a field of the same\n * name; anything else it returns adds nothing.\n */\nexport type NxrPostParametersFunction = (data: NxrPostParametersData) => unknown;\n\n/** What every request is built from. */\nexport interface NxrRequestContext {\n /** The component's `requestUrl`: each request's host action takes the place of `{action}`. */\n requestUrl: string;\n /** The component's `properties`, sent as JSON when truthy. */\n properties: unknown;\n /** The component's `postParametersFunction`. */\n postParametersFunction: NxrPostParametersFunction | null | undefined;\n /** The strings failures are described with. */\n strings: NxrViewerStrings;\n}\n\n/** The server's side of an open viewer: the token it issued and the options it sent. */\nexport interface NxrServerSession {\n token: string;\n options: NxrViewerOptions;\n}\n\n/** Consecutive pages, from a 0-based index. */\nexport interface NxrPageRange {\n startIndex: number;\n count: number;\n}\n\nexport interface NxrFindParameters {\n text: string;\n matchCase?: boolean;\n wholeWord?: boolean;\n}\n\n/**\n * The seconds a request may take when no positive `requestTimeout` applies. That includes the first\n * request, which is sent before the server's options are known. Stimulsoft's viewer uses the same value.\n */\nexport const NXR_UNSET_REQUEST_TIMEOUT_SECONDS = 1000;\n\n/**\n * The URL of a host action. The action's path takes the place of `{action}` in `requestUrl`, and a query\n * string on the action is appended to the URL's own.\n */\nexport function actionUrl(requestUrl: string, action: string): string {\n const queryAt = action.indexOf('?');\n const path = queryAt < 0 ? action : action.slice(0, queryAt);\n const url = requestUrl.replace('{action}', () => path);\n if (queryAt < 0) return url;\n return `${url}${url.includes('?') ? '&' : '?'}${action.slice(queryAt + 1)}`;\n}\n\n/**\n * The host action that answers a viewer action. GetReport goes to `getReport` (or `viewerEvent` when that\n * is empty). The other actions go to `viewerEvent`, or to `getReport` when the server keeps nothing.\n * ExportReport goes to `exportReport` when that is set.\n */\nexport function hostActionFor(options: NxrViewerOptions, action: NxrViewerAction): string {\n const { getReport, viewerEvent, exportReport } = options.actions;\n const reportAction = getReport || viewerEvent;\n const eventAction = options.server.cacheMode === 'None' ? reportAction : viewerEvent;\n if (action === 'GetReport') return reportAction;\n if (action === 'ExportReport') return exportReport || eventAction;\n return eventAction;\n}\n\n/** The file name in a Content-Disposition header, preferring its UTF-8 form. */\nexport function fileNameOf(disposition: string | null): string | null {\n if (!disposition) return null;\n const encoded = /filename\\*\\s*=\\s*UTF-8''([^;]+)/i.exec(disposition);\n if (encoded) {\n try {\n return decodeURIComponent(encoded[1].trim());\n } catch {\n // A malformed escape: the plain file name follows.\n }\n }\n const plain = /filename\\s*=\\s*(?:\"([^\"]*)\"|([^;]+))/i.exec(disposition);\n return plain ? (plain[1] ?? plain[2]).trim() : null;\n}\n\nfunction timeoutOf(session: NxrServerSession | null): number {\n const seconds = session?.options.server.requestTimeout ?? 0;\n return seconds > 0 ? seconds : NXR_UNSET_REQUEST_TIMEOUT_SECONDS;\n}\n\nfunction formOf(\n context: NxrRequestContext,\n action: NxrViewerAction,\n session: NxrServerSession | null,\n parameters: object | null,\n): FormData {\n const form = new FormData();\n form.set('nextera_action', action);\n if (session) {\n const { cacheMode, cacheTimeout, cacheItemPriority } = session.options.server;\n form.set('nextera_token', session.token);\n form.set(\n 'nextera_cache',\n JSON.stringify({ mode: cacheMode, timeout: cacheTimeout, priority: cacheItemPriority }),\n );\n }\n if (parameters) form.set('nextera_parameters', JSON.stringify(parameters));\n if (context.properties) form.set('properties', JSON.stringify(context.properties));\n const added = context.postParametersFunction?.({ ...parameters, action });\n if (typeof added === 'object' && added !== null) {\n for (const [name, value] of Object.entries(added)) {\n form.set(name, value instanceof Blob ? value : String(value));\n }\n }\n return form;\n}\n\n/** An error answer to a blob request carries its body as a blob. Read it, as JSON when it is JSON, so it can be classified. */\nasync function readableFailure(failure: unknown): Promise<unknown> {\n if (!(failure instanceof HttpErrorResponse) || !(failure.error instanceof Blob)) return failure;\n const text = await failure.error.text();\n let body: unknown = text;\n try {\n body = JSON.parse(text);\n } catch {\n // Not JSON: the failure is described by its status.\n }\n return new HttpErrorResponse({\n error: body,\n headers: failure.headers,\n status: failure.status,\n statusText: failure.statusText,\n url: failure.url ?? undefined,\n });\n}\n\n/**\n * Sends one viewer's protocol requests through the application's `HttpClient`, so the application's\n * interceptors apply, and reads each answer. Every observable fails with an `NxrViewerFailure`. A request's\n * form is built when the observable is subscribed.\n */\n@Injectable()\nexport class NxrViewerClientService {\n private readonly http = inject(HttpClient);\n\n /** AngularViewerData, sent to the component's `action`: the token and the options. */\n openViewer(context: NxrRequestContext, action: string): Observable<NxrViewerDataAnswer> {\n return this.post(context, 'AngularViewerData', action, null, null, readViewerData);\n }\n\n /** GetReport: renders the report, with the HTML of the pages in `range` when one is given. */\n getReport(\n context: NxrRequestContext,\n session: NxrServerSession,\n range?: NxrPageRange,\n ): Observable<NxrReportAnswer> {\n const hostAction = hostActionFor(session.options, 'GetReport');\n return this.post(context, 'GetReport', hostAction, session, range ?? null, readReport);\n }\n\n /** GetPages: the HTML of the pages in `range`. */\n getPages(\n context: NxrRequestContext,\n session: NxrServerSession,\n range: NxrPageRange,\n ): Observable<NxrPagesAnswer> {\n return this.post(\n context,\n 'GetPages',\n hostActionFor(session.options, 'GetPages'),\n session,\n range,\n readPages,\n );\n }\n\n /** Find: the text components that match. */\n find(\n context: NxrRequestContext,\n session: NxrServerSession,\n parameters: NxrFindParameters,\n ): Observable<NxrFindAnswer> {\n return this.post(\n context,\n 'Find',\n hostActionFor(session.options, 'Find'),\n session,\n parameters,\n readFind,\n );\n }\n\n /** UpdateCache: keeps the server's copy of the report. */\n updateCache(\n context: NxrRequestContext,\n session: NxrServerSession,\n ): Observable<NxrUpdateCacheAnswer> {\n const hostAction = hostActionFor(session.options, 'UpdateCache');\n return this.post(context, 'UpdateCache', hostAction, session, null, readUpdateCache);\n }\n\n /** ExportReport: the report as a file, in a format such as `Pdf` or `Html`. It never times out. */\n exportReport(\n context: NxrRequestContext,\n session: NxrServerSession,\n format: string,\n ): Observable<NxrExportAnswer> {\n const url = actionUrl(context.requestUrl, hostActionFor(session.options, 'ExportReport'));\n return defer(() =>\n this.http.post(url, formOf(context, 'ExportReport', session, { format }), {\n observe: 'response',\n responseType: 'blob',\n }),\n ).pipe(\n map((response) => ({\n blob: response.body ?? new Blob([]),\n fileName: fileNameOf(response.headers.get('Content-Disposition')) ?? '',\n contentType: response.headers.get('Content-Type') ?? '',\n })),\n catchError((failure: unknown) =>\n from(readableFailure(failure)).pipe(\n switchMap((readable) =>\n throwError(() => readFailure(readable, 'ExportReport', context.strings)),\n ),\n ),\n ),\n );\n }\n\n private post<T>(\n context: NxrRequestContext,\n action: NxrViewerAction,\n hostAction: string,\n session: NxrServerSession | null,\n parameters: object | null,\n read: (body: unknown) => T,\n ): Observable<T> {\n const seconds = timeoutOf(session);\n return defer(() =>\n this.http.post(\n actionUrl(context.requestUrl, hostAction),\n formOf(context, action, session, parameters),\n ),\n ).pipe(\n timeout({\n first: seconds * 1000,\n with: () => throwError(() => new NxrTimeoutError(seconds)),\n }),\n map((body) => read(body)),\n catchError((failure: unknown) =>\n throwError(() => readFailure(failure, action, context.strings)),\n ),\n );\n }\n}\n","import { computed, DestroyRef, inject, Injectable, signal } from '@angular/core';\nimport {\n catchError,\n EMPTY,\n exhaustMap,\n finalize,\n interval,\n Observable,\n Subject,\n Subscription,\n} from 'rxjs';\nimport type {\n NxrPagesAnswer,\n NxrPageSize,\n NxrReportAnswer,\n NxrViewerFailure,\n} from '../protocol/nxr-protocol.model';\nimport {\n NxrRequestContext,\n NxrServerSession,\n NxrViewerClientService,\n} from '../protocol/nxr-viewer-client.service';\nimport type { NxrViewerOptions } from '../protocol/nxr-viewer-options.model';\n\n/** How often an open viewer asks the server to keep its report: every 3 minutes, as Stimulsoft's viewer does. */\nexport const NXR_KEEP_ALIVE_MS = 180_000;\n\n/** The page on screen. */\nexport interface NxrShownPage {\n /** 0-based. */\n index: number;\n size: NxrPageSize;\n /** The page's HTML, or null while it has not arrived: while it is on its way, or after its request failed. */\n html: string | null;\n}\n\nfunction withPages(pages: Map<number, string>, answer: NxrPagesAnswer | null): Map<number, string> {\n answer?.pages.forEach((html, offset) => pages.set(answer.startIndex + offset, html));\n return pages;\n}\n\n/**\n * One viewer's conversation with the report server, and the state the viewer shows.\n *\n * Every signal changes only in this service's methods and in the answers they handle; nothing reacts to\n * a signal changing. Each viewer provides its own session, so viewers on one page never share state.\n */\n@Injectable()\nexport class NxrViewerSessionService {\n private readonly client = inject(NxrViewerClientService);\n\n private readonly optionsState = signal<NxrViewerOptions | null>(null);\n private readonly reportState = signal<NxrReportAnswer | null>(null);\n private readonly htmlState = signal<ReadonlyMap<number, string>>(new Map());\n private readonly pageIndexState = signal(0);\n private readonly pendingState = signal(0);\n private readonly failureState = signal<NxrViewerFailure | null>(null);\n\n /** The options from the last AngularViewerData answer. */\n readonly options = this.optionsState.asReadonly();\n /** The report from the last GetReport answer, or null before one. */\n readonly report = this.reportState.asReadonly();\n /** The 0-based index of the page on screen. */\n readonly pageIndex = this.pageIndexState.asReadonly();\n /** The failure on show, until it is dismissed. */\n readonly failure = this.failureState.asReadonly();\n /** How many pages the report has; 0 before one is loaded. */\n readonly pageCount = computed(() => this.reportState()?.pageCount ?? 0);\n /** Whether a request the user waits for is on its way. Keep-alive requests do not count. */\n readonly busy = computed(() => this.pendingState() > 0);\n /** The page on screen, or null before a report. */\n readonly shownPage = computed<NxrShownPage | null>(() => {\n const report = this.reportState();\n const index = this.pageIndexState();\n if (!report || index >= report.pageCount) return null;\n return { index, size: report.pages[index], html: this.htmlState().get(index) ?? null };\n });\n\n /** Emits after each successful GetReport answer. */\n readonly reportLoaded = new Subject<void>();\n /** Emits each failure put on show. */\n readonly failed = new Subject<NxrViewerFailure>();\n\n private context: NxrRequestContext | null = null;\n private session: NxrServerSession | null = null;\n /** Every request the user waits for. */\n private requests = new Subscription();\n /** The page requests among them, which a new rendering of the report makes obsolete. */\n private pageRequests = new Subscription();\n private keepAlive = Subscription.EMPTY;\n private readonly pagesOnTheWay = new Set<number>();\n /** True from the moment an expired report is sent to be rendered again until that rendering settles. */\n private recovering = false;\n private destroyed = false;\n\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n this.destroyed = true;\n this.close();\n this.reportLoaded.complete();\n this.failed.complete();\n });\n }\n\n /** Opens the report the host action names, in place of whatever this viewer showed. */\n open(context: NxrRequestContext, action: string): void {\n if (this.destroyed) return;\n this.close();\n this.context = context;\n this.reportState.set(null);\n this.htmlState.set(new Map());\n this.pageIndexState.set(0);\n this.failureState.set(null);\n if (!context.requestUrl) return;\n this.track(this.client.openViewer(context, action), false, (answer) => {\n const session = { token: answer.token, options: answer.options };\n this.session = session;\n this.optionsState.set(answer.options);\n this.startKeepAlive(context, session);\n this.render();\n });\n }\n\n /**\n * Shows the page at a 0-based index; an index outside the report is ignored. Asking for the page already\n * on screen fetches it again when its HTML is missing, as it is after its request failed.\n */\n goToPage(index: number): void {\n const inReport = Number.isInteger(index) && index >= 0 && index < this.pageCount();\n if (this.destroyed || !inReport) return;\n this.pageIndexState.set(index);\n this.loadPage(index);\n }\n\n /** Takes the failure off show. */\n dismissFailure(): void {\n this.failureState.set(null);\n }\n\n /**\n * GetReport, asking for the page on screen, which stays on screen when it is still in the report. The new\n * rendering makes every page request still on its way obsolete. Its settling ends a recovery.\n */\n private render(): void {\n const { context, session } = this.connection();\n const range = { startIndex: this.pageIndexState(), count: 1 };\n const rendering = this.client\n .getReport(context, session, range)\n .pipe(finalize(() => (this.recovering = false)));\n this.track(rendering, false, (report) => {\n this.pageRequests.unsubscribe();\n this.pageRequests = new Subscription();\n this.htmlState.set(withPages(new Map(), report.pagesHtml));\n this.reportState.set(report);\n this.pageIndexState.update((index) => Math.max(0, Math.min(index, report.pageCount - 1)));\n this.reportLoaded.next();\n this.loadPage(this.pageIndexState());\n });\n }\n\n /** GetPages for one page, unless the page is already here or on its way. */\n private loadPage(index: number): void {\n if (index >= this.pageCount() || this.htmlState().has(index) || this.pagesOnTheWay.has(index))\n return;\n const { context, session } = this.connection();\n this.pagesOnTheWay.add(index);\n const request = this.client\n .getPages(context, session, { startIndex: index, count: 1 })\n .pipe(finalize(() => this.pagesOnTheWay.delete(index)));\n this.pageRequests.add(\n this.track(request, true, (answer) =>\n this.htmlState.set(withPages(new Map(this.htmlState()), answer)),\n ),\n );\n }\n\n /**\n * Sends a request the user waits for, and returns its subscription. A `recoverable` request that finds the\n * report gone renders it again; every other failure goes on show.\n */\n private track<T>(\n request: Observable<T>,\n recoverable: boolean,\n next: (value: T) => void,\n ): Subscription {\n this.pendingState.update((count) => count + 1);\n const subscription = request\n .pipe(finalize(() => this.pendingState.update((count) => count - 1)))\n .subscribe({\n next,\n error: (failure: NxrViewerFailure) => this.fail(failure, recoverable),\n });\n this.requests.add(subscription);\n return subscription;\n }\n\n /**\n * An expired report found by a recoverable request is rendered again, unless a rendering is already on its\n * way; every other failure goes on show. Only that rendering settling ends the recovery, so failures in the\n * meantime cannot start a second one.\n */\n private fail(failure: NxrViewerFailure, recoverable: boolean): void {\n if (failure.type === 'CacheExpired' && recoverable) {\n if (!this.recovering) {\n this.recovering = true;\n this.render();\n }\n return;\n }\n this.failureState.set(failure);\n this.failed.next(failure);\n }\n\n /** UpdateCache every three minutes while the server keeps the report. Its failures are not shown. */\n private startKeepAlive(context: NxrRequestContext, session: NxrServerSession): void {\n const { allowAutoUpdateCache, cacheMode } = session.options.server;\n if (!allowAutoUpdateCache || cacheMode === 'None') return;\n this.keepAlive = interval(NXR_KEEP_ALIVE_MS)\n .pipe(\n exhaustMap(() => this.client.updateCache(context, session).pipe(catchError(() => EMPTY))),\n )\n .subscribe();\n }\n\n /** Stops every request and the keep-alive. */\n private close(): void {\n this.requests.unsubscribe();\n this.requests = new Subscription();\n this.pageRequests = new Subscription();\n this.keepAlive.unsubscribe();\n this.session = null;\n this.pagesOnTheWay.clear();\n this.recovering = false;\n }\n\n private connection(): { context: NxrRequestContext; session: NxrServerSession } {\n if (!this.context || !this.session) throw new Error('The viewer has no report open.');\n return { context: this.context, session: this.session };\n }\n}\n","import { ChangeDetectionStrategy, Component, computed, input, output } from '@angular/core';\nimport type { NxrViewerOptions } from '../protocol/nxr-viewer-options.model';\nimport { NXR_ENGLISH, type NxrViewerStrings } from '../strings/nxr-viewer-strings.const';\n\n/** The width of the page-number box, as Stimulsoft's page control sizes it. */\nconst PAGE_BOX_WIDTH_PX = 45;\n\n/**\n * The toolbar's page navigation.\n *\n * Stimulsoft's toolbar is a long list of groups; this is the navigation group of it, which is what\n * a report viewer cannot do without: first, previous, the page control, next, last. Each button\n * appears only when its `toolbar.show…Button` option is on, and the group is laid out where\n * `toolbar.alignment` says. The other groups — save, print, find, bookmarks, zoom, view mode —\n * arrive with the tasks that implement them.\n *\n * Navigation is disabled the way Stimulsoft disables it: in `MultiplePages`, and in `Continuous`\n * unless the report panel or the whole viewer scrolls. A button is disabled at the end of the\n * report it would move past, and everything is disabled while a request the user waits for is on\n * its way.\n */\n@Component({\n selector: 'nxr-viewer-toolbar',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'nxr-viewer-toolbar',\n role: 'toolbar',\n '[style.background-color]': 'backgroundColor()',\n '[style.border]': 'border()',\n '[style.color]': 'fontColor()',\n '[style.font-family]': 'fontFamily()',\n '[style.justify-content]': 'justifyContent()',\n '[class.nxr-busy]': 'busy()',\n },\n template: `\n @if (showFirstPage()) {\n <button\n type=\"button\"\n class=\"nxr-toolbar-button\"\n [disabled]=\"atStart()\"\n [attr.aria-label]=\"strings().FirstPage\"\n (click)=\"goTo(0)\"\n >\n <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <path d=\"M12.5 3v10L6 8zM4.5 3h1.2v10H4.5z\" />\n </svg>\n </button>\n }\n @if (showPreviousPage()) {\n <button\n type=\"button\"\n class=\"nxr-toolbar-button\"\n [disabled]=\"atStart()\"\n [attr.aria-label]=\"strings().PrevPage\"\n (click)=\"goTo(pageIndex() - 1)\"\n >\n <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><path d=\"M11 3v10L4.5 8z\" /></svg>\n </button>\n }\n @if (showCurrentPage()) {\n <span class=\"nxr-page-control\">\n <span class=\"nxr-page-label\">{{ strings().Page }}</span>\n <input\n type=\"text\"\n inputmode=\"numeric\"\n class=\"nxr-page-box\"\n [style.width.px]=\"pageBoxWidth\"\n [disabled]=\"pageControlDisabled()\"\n [value]=\"pageIndex() + 1\"\n [attr.aria-label]=\"strings().Page\"\n (keydown.enter)=\"enterPage($event)\"\n />\n <span class=\"nxr-page-label\">{{ strings().PageOf }} {{ pageCount() }}</span>\n </span>\n }\n @if (showNextPage()) {\n <button\n type=\"button\"\n class=\"nxr-toolbar-button\"\n [disabled]=\"atEnd()\"\n [attr.aria-label]=\"strings().NextPage\"\n (click)=\"goTo(pageIndex() + 1)\"\n >\n <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><path d=\"M5 3v10l6.5-5z\" /></svg>\n </button>\n }\n @if (showLastPage()) {\n <button\n type=\"button\"\n class=\"nxr-toolbar-button\"\n [disabled]=\"atEnd()\"\n [attr.aria-label]=\"strings().LastPage\"\n (click)=\"goTo(pageCount() - 1)\"\n >\n <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <path d=\"M3.5 3v10L10 8zM10.3 3h1.2v10h-1.2z\" />\n </svg>\n </button>\n }\n `,\n styles: `\n :host {\n display: flex;\n align-items: center;\n gap: 2px;\n box-sizing: border-box;\n padding: 3px 6px;\n min-height: 30px;\n position: relative;\n user-select: none;\n }\n\n /* Stimulsoft covers the toolbar with a disabled panel while a request is in flight. */\n :host(.nxr-busy)::after {\n content: '';\n position: absolute;\n inset: 0;\n cursor: default;\n }\n\n .nxr-toolbar-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 26px;\n height: 26px;\n padding: 0;\n border: 0;\n border-radius: 2px;\n background: transparent;\n color: inherit;\n font: inherit;\n cursor: pointer;\n }\n\n .nxr-toolbar-button:hover:not(:disabled) {\n background: rgb(0 0 0 / 8%);\n }\n\n .nxr-toolbar-button:disabled {\n opacity: 0.5;\n cursor: default;\n }\n\n .nxr-toolbar-button svg {\n width: 16px;\n height: 16px;\n fill: currentColor;\n }\n\n .nxr-page-control {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 0 4px;\n white-space: nowrap;\n }\n\n .nxr-page-box {\n height: 21px;\n box-sizing: border-box;\n text-align: center;\n font: inherit;\n color: inherit;\n }\n\n .nxr-page-box:disabled {\n color: transparent;\n }\n `,\n})\nexport class NxrViewerToolbarComponent {\n /** The options from the server, or null before the first answer, when the toolbar shows nothing. */\n readonly options = input<NxrViewerOptions | null>(null);\n /** The 0-based index of the page on screen. */\n readonly pageIndex = input(0);\n /** How many pages the report has. */\n readonly pageCount = input(0);\n /** Whether a request the user waits for is on its way. */\n readonly busy = input(false);\n /** The captions to show. */\n readonly strings = input<NxrViewerStrings>(NXR_ENGLISH);\n\n /** The 0-based page the user asked for. */\n readonly goToPage = output<number>();\n\n protected readonly pageBoxWidth = PAGE_BOX_WIDTH_PX;\n\n private readonly toolbar = computed(() => this.options()?.toolbar ?? null);\n private readonly appearance = computed(() => this.options()?.appearance ?? null);\n\n /**\n * Stimulsoft's rule: navigation is off in `MultiplePages`, and in `Continuous` unless the report\n * panel scrolls or the viewer is full screen — in those cases the page is reached by scrolling.\n */\n private readonly navigationDisabled = computed(() => {\n const toolbar = this.toolbar();\n const appearance = this.appearance();\n if (!toolbar || !appearance) return true;\n if (toolbar.viewMode === 'MultiplePages') return true;\n return (\n toolbar.viewMode === 'Continuous' &&\n !appearance.scrollbarsMode &&\n !appearance.fullScreenMode\n );\n });\n\n protected readonly showFirstPage = computed(() => this.toolbar()?.showFirstPageButton === true);\n protected readonly showPreviousPage = computed(\n () => this.toolbar()?.showPreviousPageButton === true,\n );\n protected readonly showCurrentPage = computed(\n () => this.toolbar()?.showCurrentPageControl === true,\n );\n protected readonly showNextPage = computed(() => this.toolbar()?.showNextPageButton === true);\n protected readonly showLastPage = computed(() => this.toolbar()?.showLastPageButton === true);\n\n protected readonly atStart = computed(\n () => this.busy() || this.navigationDisabled() || this.pageIndex() <= 0,\n );\n protected readonly atEnd = computed(\n () => this.busy() || this.navigationDisabled() || this.pageIndex() >= this.pageCount() - 1,\n );\n protected readonly pageControlDisabled = computed(\n () => this.busy() || this.navigationDisabled() || this.pageCount() <= 1,\n );\n\n protected readonly backgroundColor = computed(() => this.toolbar()?.backgroundColor || null);\n protected readonly fontColor = computed(() => this.toolbar()?.fontColor || null);\n protected readonly fontFamily = computed(() => this.toolbar()?.fontFamily || null);\n\n /** A border only in `Simple`; `Separated` has none, as Stimulsoft's toolbar does. */\n protected readonly border = computed(() => {\n const toolbar = this.toolbar();\n if (!toolbar || toolbar.displayMode === 'Separated' || !toolbar.borderColor) return null;\n return `1px solid ${toolbar.borderColor}`;\n });\n\n protected readonly justifyContent = computed(() => {\n switch (this.toolbar()?.alignment) {\n case 'Center':\n return 'center';\n case 'Right':\n return 'flex-end';\n default:\n return 'flex-start';\n }\n });\n\n /**\n * Enter in the page box goes to the page typed, reading anything that is not a number as page 1\n * and clamping to the report, as Stimulsoft's page control does. Leaving the box does nothing.\n */\n protected enterPage(event: Event): void {\n const box = event.target as HTMLInputElement;\n const typed = Number.parseInt(box.value, 10);\n const page = Math.min(Math.max(Number.isNaN(typed) ? 1 : typed, 1), this.pageCount());\n box.value = String(page);\n this.goTo(page - 1);\n }\n\n protected goTo(index: number): void {\n if (this.busy() || index === this.pageIndex() || index < 0 || index >= this.pageCount()) return;\n this.goToPage.emit(index);\n }\n}\n","import { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n OnChanges,\n output,\n} from '@angular/core';\nimport { NxrReportPageComponent } from '../page/nxr-report-page.component';\nimport type { NxrViewerFailure } from '../protocol/nxr-protocol.model';\nimport {\n NxrViewerClientService,\n type NxrPostParametersFunction,\n type NxrRequestContext,\n} from '../protocol/nxr-viewer-client.service';\nimport { NxrViewerSessionService } from '../session/nxr-viewer-session.service';\nimport { NXR_ENGLISH } from '../strings/nxr-viewer-strings.const';\nimport { NxrViewerToolbarComponent } from '../toolbar/nxr-viewer-toolbar.component';\n\n/**\n * What a host reaches through the component's `api`, with Stimulsoft's names and meanings. The\n * members for zoom, view mode, export, print, email and find arrive with the tasks that implement\n * those; a host that only pages through a report needs these three.\n */\nexport interface NxrViewerApi {\n /** The 0-based page on screen. Setting it shows a page inside the report and ignores anything else. */\n currentPage: number;\n /** How many pages the report has; 0 before one is loaded. */\n readonly pagesCount: number;\n /** Always `Report`, as Stimulsoft's Angular viewer answers when it is not showing a dashboard. */\n readonly reportType: string;\n}\n\n/**\n * A report served by `Nextera.Reports.Angular.NetCore`, shown page by page.\n *\n * The inputs, outputs and `api` are Stimulsoft's `stimulsoft-viewer-angular`, so a host swaps the\n * component and keeps its bindings. As there, a change to any input reloads the report: the\n * component asks for the viewer's options again and opens the report the action names.\n *\n * Each viewer provides its own session, so several on a page never share a report or a token.\n */\n@Component({\n selector: 'nxr-report-viewer',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NxrReportPageComponent, NxrViewerToolbarComponent],\n providers: [NxrViewerClientService, NxrViewerSessionService],\n template: `\n <div\n class=\"nxr-viewer-root\"\n [style]=\"style()\"\n [style.background-color]=\"rootBackgroundColor()\"\n [style.width]=\"rootWidth()\"\n [style.height]=\"rootHeight()\"\n >\n @if (toolbarVisible()) {\n <nxr-viewer-toolbar\n [options]=\"session.options()\"\n [pageIndex]=\"session.pageIndex()\"\n [pageCount]=\"session.pageCount()\"\n [busy]=\"session.busy()\"\n (goToPage)=\"session.goToPage($event)\"\n />\n }\n\n <div\n class=\"nxr-viewer-pages\"\n [style.text-align]=\"pageAlignment()\"\n [style.overflow]=\"pagesOverflow()\"\n >\n @if (session.shownPage(); as page) {\n <nxr-report-page\n class=\"nxr-viewer-page\"\n [class.nxr-viewer-page-shadow]=\"showPageShadow()\"\n [style.border]=\"pageBorder()\"\n [page]=\"page.size\"\n [html]=\"page.html\"\n [css]=\"pageCss()\"\n />\n }\n </div>\n\n @if (session.failure(); as failure) {\n <div class=\"nxr-viewer-failure\" role=\"alert\">\n <span class=\"nxr-viewer-failure-text\">{{ failure.message }}</span>\n <button type=\"button\" class=\"nxr-viewer-failure-close\" (click)=\"session.dismissFailure()\">\n &times;\n </button>\n </div>\n }\n </div>\n `,\n styles: `\n :host {\n display: inline-block;\n position: relative;\n }\n\n .nxr-viewer-root {\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n position: relative;\n }\n\n .nxr-viewer-pages {\n flex: 1 1 auto;\n min-height: 0;\n padding: 10px;\n box-sizing: border-box;\n }\n\n .nxr-viewer-page {\n display: inline-block;\n vertical-align: top;\n }\n\n .nxr-viewer-page-shadow {\n box-shadow: 2px 2px 6px rgb(0 0 0 / 30%);\n }\n\n .nxr-viewer-failure {\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 12px;\n background: #fdecea;\n color: #611a15;\n font-size: 13px;\n }\n\n .nxr-viewer-failure-text {\n flex: 1 1 auto;\n }\n\n .nxr-viewer-failure-close {\n border: 0;\n background: transparent;\n color: inherit;\n font-size: 18px;\n line-height: 1;\n cursor: pointer;\n }\n `,\n})\nexport class NxrReportViewerComponent implements OnChanges {\n /** Each request's URL, with `{action}` in place of the host action it goes to. */\n readonly requestUrl = input('');\n /** The host action that answers the first request, and so names the report to open. */\n readonly action = input('');\n /** Sent to the host with every request, as JSON, when it is truthy. */\n readonly properties = input<unknown>(null);\n /** The viewer's width; `100%` when it is not given. */\n readonly width = input<string | null>(null);\n /** The viewer's height; 650px when the report panel scrolls, otherwise `100%`. */\n readonly height = input<string | null>(null);\n /** The viewer's background; `White` when it is not given. */\n readonly backgroundColor = input<string | null>('White');\n /** Styles for the viewer's root element. Width, height and background take precedence over it. */\n readonly style = input<string | null>(null);\n /** Called for every request; each key of an object it returns becomes a form field. */\n readonly postParametersFunction = input<NxrPostParametersFunction | null>(null);\n\n /** Emits after each report is loaded. */\n readonly loaded = output<void>();\n /** Emits every failure the viewer puts on show. */\n readonly error = output<NxrViewerFailure>();\n\n protected readonly session = inject(NxrViewerSessionService);\n\n /** Stimulsoft's `api` object: what a host calls to drive the viewer from outside. */\n readonly api: NxrViewerApi = this.buildApi();\n\n private readonly appearance = computed(() => this.session.options()?.appearance ?? null);\n\n protected readonly toolbarVisible = computed(\n () => this.session.options()?.toolbar.visible !== false,\n );\n protected readonly pageCss = computed(() => this.session.report()?.pageCss ?? '');\n protected readonly showPageShadow = computed(() => this.appearance()?.showPageShadow === true);\n protected readonly pageBorder = computed(() => {\n const color = this.appearance()?.pageBorderColor;\n return color ? `1px solid ${color}` : null;\n });\n\n /** Stimulsoft aligns the pages with the report panel's text alignment; `Default` means centred. */\n protected readonly pageAlignment = computed(() => {\n switch (this.appearance()?.pageAlignment) {\n case 'Left':\n return 'left';\n case 'Right':\n return 'right';\n default:\n return 'center';\n }\n });\n\n /** The report panel scrolls inside the viewer only when the server asks for scrollbars. */\n protected readonly pagesOverflow = computed(() =>\n this.appearance()?.scrollbarsMode ? 'auto' : 'hidden',\n );\n\n protected readonly rootWidth = computed(() => this.width() ?? '100%');\n protected readonly rootBackgroundColor = computed(() => this.backgroundColor() ?? 'White');\n protected readonly rootHeight = computed(() => {\n const given = this.height();\n if (given !== null) return given;\n return this.appearance()?.scrollbarsMode ? '650px' : '100%';\n });\n\n constructor() {\n this.session.reportLoaded\n .pipe(takeUntilDestroyed())\n .subscribe(() => this.loaded.emit());\n this.session.failed\n .pipe(takeUntilDestroyed())\n .subscribe((failure) => this.error.emit(failure));\n }\n\n /**\n * A change to any input reloads, as Stimulsoft's viewer does: its `ngOnChanges` never looks at\n * which input changed, so even a width change asks the server for the options and the report\n * again. Matching that keeps a host's reload behaviour the same across the swap.\n */\n ngOnChanges(): void {\n this.session.open(this.context(), this.action());\n }\n\n /**\n * The getters read the session's signals, so a host that asks between renders gets what is on\n * screen now. Built from a captured session rather than `this`, because `this` inside an object\n * literal's accessor is the literal.\n */\n private buildApi(): NxrViewerApi {\n const session = this.session;\n return {\n get currentPage(): number {\n return session.pageIndex();\n },\n set currentPage(value: number) {\n session.goToPage(value);\n },\n get pagesCount(): number {\n return session.pageCount();\n },\n get reportType(): string {\n return 'Report';\n },\n };\n }\n\n private context(): NxrRequestContext {\n return {\n requestUrl: this.requestUrl(),\n properties: this.properties(),\n postParametersFunction: this.postParametersFunction(),\n strings: NXR_ENGLISH,\n };\n }\n}\n","/*\n * Public API Surface of @nexterajs/report-viewer\n */\n\nexport { NXR_VIEWER_PROTOCOL } from './lib/protocol/nxr-protocol.const';\nexport {\n NxrReportViewerComponent,\n type NxrViewerApi,\n} from './lib/viewer/nxr-report-viewer.component';\nexport type { NxrViewerFailure } from './lib/protocol/nxr-protocol.model';\nexport type {\n NxrPostParametersData,\n NxrPostParametersFunction,\n} from './lib/protocol/nxr-viewer-client.service';\n","/**\n * Generated bundle index. Do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/lib/protocol/nxe-protocol.const.ts","../../../projects/nextera-report-viewer/src/lib/page/nxe-page-html.util.ts","../../../projects/nextera-report-viewer/src/lib/page/nxe-report-page.component.ts","../../../projects/nextera-report-viewer/src/lib/strings/nxe-viewer-strings.const.ts","../../../projects/nextera-report-viewer/src/lib/protocol/nxe-protocol-reader.util.ts","../../../projects/nextera-report-viewer/src/lib/protocol/nxe-viewer-client.service.ts","../../../projects/nextera-report-viewer/src/lib/session/nxe-viewer-session.service.ts","../../../projects/nextera-report-viewer/src/lib/toolbar/nxe-viewer-toolbar.component.ts","../../../projects/nextera-report-viewer/src/lib/viewer/nxe-report-viewer.component.ts","../../../projects/nextera-report-viewer/src/public-api.ts","../../../projects/nextera-report-viewer/src/nexterajs-report-viewer.ts"],"sourcesContent":["/**\n * The version of the viewer protocol this package speaks: the `protocol` member of every\n * `AngularViewerData` answer from `Nextera.Report.AspNetCore`.\n */\nexport const NXE_VIEWER_PROTOCOL = 1;\n","/**\n * Page HTML from the server, made safe to place in the application's document.\n *\n * The report repository's HTML renderer escapes every attribute value and writes links only with\n * http, https, mailto, tel or no scheme, and its chart renderer strips event handlers from chart SVG.\n * This is the second layer: whatever reaches the viewer, a page can neither run script nor load active\n * content, and it cannot style the viewer around it.\n */\n\n/**\n * Elements that run script, load documents, plugins or media, submit, animate other attributes, or\n * carry CSS of their own. The renderer writes none of them into a page.\n */\nconst REMOVED_ELEMENTS = [\n 'script',\n 'noscript',\n 'template',\n 'style',\n 'link',\n 'meta',\n 'base',\n 'iframe',\n 'frame',\n 'frameset',\n 'object',\n 'embed',\n 'applet',\n 'portal',\n 'audio',\n 'video',\n 'source',\n 'track',\n 'picture',\n 'form',\n 'set',\n 'animate',\n].join(',');\n\n/** Attributes holding a URL that a click or a load would follow. */\nconst URL_ATTRIBUTES = new Set([\n 'href',\n 'xlink:href',\n 'src',\n 'action',\n 'formaction',\n 'poster',\n 'background',\n]);\n\n/** Attributes that make requests of their own and have no use in a page. */\nconst REMOVED_ATTRIBUTES = new Set(['srcset', 'ping']);\n\nconst LINK_SCHEMES = new Set(['http', 'https', 'mailto', 'tel']);\n\n/**\n * Whether a URL attribute's value can stay: no scheme (a relative or fragment URL), a link scheme, or,\n * for `src`, an image as a data URL. Browsers ignore spaces and control characters around and inside a\n * scheme, so the check drops them before reading it.\n */\nexport function isSafeUrl(attribute: string, value: string): boolean {\n let compact = '';\n for (const character of value) {\n if (character.charCodeAt(0) > 0x20) compact += character;\n }\n const scheme = /^([a-z][a-z0-9+.-]*):/i.exec(compact)?.[1]?.toLowerCase();\n if (scheme === undefined || LINK_SCHEMES.has(scheme)) return true;\n return attribute === 'src' && scheme === 'data' && /^data:image\\//i.test(compact);\n}\n\n/**\n * Parses page HTML and returns it without anything active. A template's content is inert while it is\n * examined: its scripts do not run, its images do not load and its handlers do not fire.\n */\nexport function scrubPageHtml(html: string, document: Document): DocumentFragment {\n const template = document.createElement('template');\n template.innerHTML = html;\n const content = template.content;\n for (const element of Array.from(content.querySelectorAll(REMOVED_ELEMENTS))) {\n element.remove();\n }\n for (const element of Array.from(content.querySelectorAll('*'))) {\n for (const attribute of Array.from(element.attributes)) {\n const name = attribute.name.toLowerCase();\n const unsafe =\n name.startsWith('on') ||\n REMOVED_ATTRIBUTES.has(name) ||\n (URL_ATTRIBUTES.has(name) && !isSafeUrl(name, attribute.value));\n if (unsafe) element.removeAttribute(attribute.name);\n }\n }\n return content;\n}\n\n/** A stylesheet, or a rule that holds rules: anything whose rules can be listed and deleted by index. */\ninterface RuleContainer {\n readonly cssRules: CSSRuleList;\n deleteRule(index: number): void;\n}\n\n/**\n * Deletes every style rule whose selector names `:host` or `:host-context()`, also inside grouping rules\n * such as `@media` and inside nested rules. In a shadow root those rules style the shadow host, the\n * viewer's own page element, so a page's CSS could otherwise move or hide it.\n */\nfunction deleteHostRules(container: RuleContainer): void {\n for (let index = container.cssRules.length - 1; index >= 0; index--) {\n const rule = container.cssRules[index];\n if (rule instanceof CSSStyleRule && /:host/i.test(rule.selectorText)) {\n container.deleteRule(index);\n } else if ('cssRules' in rule && !(rule instanceof CSSKeyframesRule)) {\n deleteHostRules(rule as unknown as RuleContainer);\n }\n }\n}\n\nconst sheets = new Map<string, CSSStyleSheet>();\n\n/**\n * One constructed stylesheet per distinct CSS text, shared by every shadow root that adopts it. A\n * report's page CSS is the same for every page, so a long report parses it once. The sheet keeps no rule\n * that could style the shadow host. CSS that a constructed stylesheet refuses gives an empty sheet, so the\n * page shows unstyled instead of not at all.\n */\nexport function adoptedSheet(cssText: string): CSSStyleSheet {\n let sheet = sheets.get(cssText);\n if (!sheet) {\n sheet = new CSSStyleSheet();\n try {\n sheet.replaceSync(cssText);\n deleteHostRules(sheet);\n } catch {\n sheet = new CSSStyleSheet();\n }\n sheets.set(cssText, sheet);\n }\n return sheet;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n DOCUMENT,\n ElementRef,\n inject,\n input,\n OnChanges,\n SimpleChanges,\n} from '@angular/core';\nimport type { NxePageSize } from '../protocol/nxe-protocol.model';\nimport { adoptedSheet, scrubPageHtml } from './nxe-page-html.util';\n\n/**\n * The viewer draws each page's frame and the space between pages, so the page CSS's own are cancelled.\n *\n * Zoom scales the page's own box from its top left corner. Stimulsoft re-renders the page on the server\n * at the asked-for zoom and never scales on the client; this engine's page HTML is absolutely positioned\n * in points, so scaling it here puts the same marks in the same places without a round trip, and the text\n * is re-rasterised at the new size rather than resampled. The host element is sized to the scaled box so\n * the pages around it lay out against what is on screen.\n */\nfunction pageFrameCss(zoom: number): string {\n const transform = zoom === 1 ? '' : `transform:scale(${zoom});transform-origin:top left;`;\n return `.nextera-page{margin:0;box-shadow:none;${transform}}`;\n}\n\n/**\n * One report page, in its own shadow root.\n *\n * The page's size comes from the report's page list, so the page holds its place before its HTML\n * arrives. The HTML is scrubbed by `scrubPageHtml` and placed beside the adopted page stylesheet, so the\n * report's styles and the application's never meet. `contain: paint` keeps even a fixed-position\n * element inside the page's box.\n */\n@Component({\n selector: 'nxe-report-page',\n standalone: true,\n template: '',\n styles: `\n :host {\n display: block;\n position: relative;\n box-sizing: content-box;\n contain: paint;\n background: #fff;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'nxe-report-page',\n '[attr.data-page]': 'page().pageNumber',\n '[style.width.pt]': 'scaledWidth()',\n '[style.height.pt]': 'scaledHeight()',\n },\n})\nexport class NxeReportPageComponent implements OnChanges {\n /** The page's number and size. */\n readonly page = input.required<NxePageSize>();\n /** The page's HTML from the server, or null while it has not arrived. */\n readonly html = input<string | null>(null);\n /** The stylesheet every page of the report needs. */\n readonly css = input.required<string>();\n /** The zoom to draw the page at, as a factor: 1 is 100 %. */\n readonly zoom = input(1);\n\n protected readonly scaledWidth = computed(() => this.page().widthPoints * this.zoom());\n protected readonly scaledHeight = computed(() => this.page().heightPoints * this.zoom());\n\n private readonly document = inject(DOCUMENT);\n private readonly root = (inject(ElementRef).nativeElement as HTMLElement).attachShadow({\n mode: 'open',\n });\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['css'] || changes['zoom']) {\n this.root.adoptedStyleSheets = [adoptedSheet(this.css()), adoptedSheet(pageFrameCss(this.zoom()))];\n }\n if (changes['html']) {\n const html = this.html();\n if (html === null) {\n this.root.replaceChildren();\n } else {\n this.root.replaceChildren(scrubPageHtml(html, this.document));\n }\n }\n }\n}\n","/**\n * Every caption and message the viewer shows, in its built-in English. A key in PascalCase is the name\n * Stimulsoft's viewer gives the same text, such as `PageOf`; a key in camelCase names a message only this\n * viewer has. The English is this package's own. A later plan lets a host's translation file replace any\n * of them, so code reads them from an `NxeViewerStrings` value wherever one is at hand.\n */\nexport const NXE_ENGLISH = {\n /** The label before the page-number box. */\n Page: 'Page',\n /** The label between the page-number box and the page count. */\n PageOf: 'of',\n FirstPage: 'First page',\n PrevPage: 'Previous page',\n NextPage: 'Next page',\n LastPage: 'Last page',\n /** The save button's caption and tooltip; its menu items are captioned by the format they write. */\n Save: 'Save',\n SaveToolTip: 'Save',\n /** The view-mode button's tooltip, and its menu items, whose captions are the mode names. */\n ViewModeToolTip: 'View mode',\n SinglePage: 'Single Page',\n Continuous: 'Continuous',\n MultiplePages: 'Multiple Pages',\n /** The zoom button's tooltip; its caption is the current percentage, so it has no key. */\n ZoomToolTip: 'Zoom',\n ZoomOnePage: 'One Page',\n ZoomPageWidth: 'Page Width',\n errorUnreachable: 'The report server could not be reached.',\n errorStatus: 'The report server answered with HTTP status {0}.',\n errorTimeout: 'The report server did not answer within {0} seconds.',\n errorMalformed: \"The report server's answer to {0} is not one this viewer can read.\",\n errorProtocol:\n 'The report server speaks viewer protocol {0}, and this viewer speaks protocol {1}.',\n};\n\nexport type NxeViewerStrings = Readonly<Record<keyof typeof NXE_ENGLISH, string>>;\n\n/** Puts each value in place of its numbered placeholder: `{0}` is the first value. */\nexport function formatString(template: string, ...values: (string | number)[]): string {\n return template.replace(/\\{(\\d+)\\}/g, (placeholder, index: string) =>\n Number(index) < values.length ? String(values[Number(index)]) : placeholder,\n );\n}\n","import { HttpErrorResponse } from '@angular/common/http';\nimport { formatString, NXE_ENGLISH, NxeViewerStrings } from '../strings/nxe-viewer-strings.const';\nimport { NXE_VIEWER_PROTOCOL } from './nxe-protocol.const';\nimport type {\n NxeFindAnswer,\n NxePagesAnswer,\n NxeReportAnswer,\n NxeUpdateCacheAnswer,\n NxeViewerAction,\n NxeViewerDataAnswer,\n NxeViewerFailure,\n} from './nxe-protocol.model';\n\n/**\n * A success answer that is not what the protocol says its action answers: the wrong shape, or an\n * AngularViewerData answer from another version of the protocol.\n */\nexport class NxeMalformedAnswerError extends Error {\n constructor(\n readonly action: NxeViewerAction,\n /** The version an AngularViewerData answer declared, when it declared another one. */\n readonly protocol: number = NXE_VIEWER_PROTOCOL,\n ) {\n super(`The ${action} answer is not what viewer protocol ${NXE_VIEWER_PROTOCOL} answers.`);\n this.name = 'NxeMalformedAnswerError';\n }\n}\n\n/** A request that got no answer within the server options' `requestTimeout`. */\nexport class NxeTimeoutError extends Error {\n constructor(readonly seconds: number) {\n super(`No answer within ${seconds} seconds.`);\n this.name = 'NxeTimeoutError';\n }\n}\n\ntype JsonObject = Record<string, unknown>;\n\nconst OPTION_GROUPS = ['actions', 'appearance', 'toolbar', 'exports', 'server'];\n\nfunction isObject(value: unknown): value is JsonObject {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction isIndex(value: unknown): value is number {\n return typeof value === 'number' && Number.isInteger(value) && value >= 0;\n}\n\nfunction isNumber(value: unknown): value is number {\n return typeof value === 'number' && Number.isFinite(value);\n}\n\nfunction isBounds(value: unknown): boolean {\n return (\n isObject(value) &&\n isNumber(value['x']) &&\n isNumber(value['y']) &&\n isNumber(value['width']) &&\n isNumber(value['height'])\n );\n}\n\nfunction isPages(value: unknown): value is NxePagesAnswer {\n if (!isObject(value)) return false;\n const pages = value['pages'];\n return (\n isIndex(value['startIndex']) &&\n Array.isArray(pages) &&\n pages.every((page) => typeof page === 'string')\n );\n}\n\nfunction isPageSize(value: unknown): boolean {\n return (\n isObject(value) &&\n isIndex(value['pageNumber']) &&\n isNumber(value['widthPoints']) &&\n isNumber(value['heightPoints'])\n );\n}\n\nfunction isLocated(value: unknown, textKey: 'title' | 'text'): boolean {\n return (\n isObject(value) &&\n typeof value[textKey] === 'string' &&\n isIndex(value['pageIndex']) &&\n isBounds(value['bounds'])\n );\n}\n\n/** Reads the answer to AngularViewerData: the token, the viewer options and the host's translation. */\nexport function readViewerData(body: unknown): NxeViewerDataAnswer {\n if (!isObject(body)) throw new NxeMalformedAnswerError('AngularViewerData');\n const { protocol, token, options, localization } = body;\n if (isNumber(protocol) && protocol !== NXE_VIEWER_PROTOCOL) {\n throw new NxeMalformedAnswerError('AngularViewerData', protocol);\n }\n const valid =\n protocol === NXE_VIEWER_PROTOCOL &&\n typeof token === 'string' &&\n token !== '' &&\n isObject(options) &&\n OPTION_GROUPS.every((group) => isObject(options[group])) &&\n (localization === null || isObject(localization));\n if (!valid) throw new NxeMalformedAnswerError('AngularViewerData');\n return body as unknown as NxeViewerDataAnswer;\n}\n\n/** Reads the answer to GetReport: the report's name, page count, page sizes, bookmarks and page stylesheet. */\nexport function readReport(body: unknown): NxeReportAnswer {\n if (!isObject(body)) throw new NxeMalformedAnswerError('GetReport');\n const { reportName, pageCount, pages, bookmarks, pageCss, pagesHtml } = body;\n const valid =\n typeof reportName === 'string' &&\n isIndex(pageCount) &&\n Array.isArray(pages) &&\n pages.length === pageCount &&\n pages.every(isPageSize) &&\n Array.isArray(bookmarks) &&\n bookmarks.every((bookmark) => isLocated(bookmark, 'title')) &&\n typeof pageCss === 'string' &&\n (pagesHtml === undefined || isPages(pagesHtml));\n if (!valid) throw new NxeMalformedAnswerError('GetReport');\n return {\n ...(body as unknown as NxeReportAnswer),\n pagesHtml: (pagesHtml as NxePagesAnswer | undefined) ?? null,\n };\n}\n\n/** Reads the answer to GetPages. */\nexport function readPages(body: unknown): NxePagesAnswer {\n if (!isPages(body)) throw new NxeMalformedAnswerError('GetPages');\n return body;\n}\n\n/** Reads the answer to Find. */\nexport function readFind(body: unknown): NxeFindAnswer {\n const hits = isObject(body) ? body['hits'] : undefined;\n if (!Array.isArray(hits) || !hits.every((hit) => isLocated(hit, 'text')))\n throw new NxeMalformedAnswerError('Find');\n return body as unknown as NxeFindAnswer;\n}\n\n/** Reads the answer to UpdateCache. */\nexport function readUpdateCache(body: unknown): NxeUpdateCacheAnswer {\n if (!isObject(body) || typeof body['updated'] !== 'boolean')\n throw new NxeMalformedAnswerError('UpdateCache');\n return body as unknown as NxeUpdateCacheAnswer;\n}\n\nfunction described(status: number, message: string): NxeViewerFailure {\n return { status, type: 'Error', message, retryable: false, traceId: null };\n}\n\n/**\n * What went wrong with a request, from whatever it failed with:\n * - the server's own error answer, kept as it is;\n * - an HTTP error answer without the protocol's shape (a host's, a framework's or a proxy's);\n * - no answer at all;\n * - a timeout;\n * - a success answer the viewer cannot read.\n */\nexport function readFailure(\n failure: unknown,\n action: NxeViewerAction,\n strings: NxeViewerStrings = NXE_ENGLISH,\n): NxeViewerFailure {\n if (failure instanceof HttpErrorResponse) {\n const body: unknown = failure.error;\n // status and message are all that is asked for. The rest of the protocol's error answer is taken when the server\n // sent it and defaulted when it did not, because a host that writes its own error -- bright answers a failed\n // GetReport with {status, message} from its controller's catch -- says the one thing the reader cannot work out\n // for itself, and demanding type and retryable alongside it threw that sentence away and left the viewer showing\n // the status code on its own.\n if (isObject(body) && body['status'] === 'error' && typeof body['message'] === 'string') {\n return {\n status: failure.status,\n type: typeof body['type'] === 'string' ? body['type'] : 'Error',\n message: body['message'],\n retryable: typeof body['retryable'] === 'boolean' ? body['retryable'] : false,\n traceId: typeof body['traceId'] === 'string' ? body['traceId'] : null,\n };\n }\n if (failure.status === 0) return described(0, strings.errorUnreachable);\n if (failure.status >= 200 && failure.status < 300)\n return described(0, formatString(strings.errorMalformed, action));\n return described(failure.status, formatString(strings.errorStatus, failure.status));\n }\n if (failure instanceof NxeTimeoutError) {\n return described(0, formatString(strings.errorTimeout, failure.seconds));\n }\n if (failure instanceof NxeMalformedAnswerError) {\n return failure.protocol !== NXE_VIEWER_PROTOCOL\n ? described(0, formatString(strings.errorProtocol, failure.protocol, NXE_VIEWER_PROTOCOL))\n : described(0, formatString(strings.errorMalformed, failure.action));\n }\n return described(0, failure instanceof Error ? failure.message : String(failure));\n}\n","import { HttpClient, HttpErrorResponse } from '@angular/common/http';\nimport { inject, Injectable } from '@angular/core';\nimport { catchError, defer, from, map, Observable, switchMap, throwError, timeout } from 'rxjs';\nimport type { NxeViewerStrings } from '../strings/nxe-viewer-strings.const';\nimport type {\n NxeExportAnswer,\n NxeFindAnswer,\n NxePagesAnswer,\n NxeReportAnswer,\n NxeUpdateCacheAnswer,\n NxeViewerAction,\n NxeViewerDataAnswer,\n} from './nxe-protocol.model';\nimport {\n NxeTimeoutError,\n readFailure,\n readFind,\n readPages,\n readReport,\n readUpdateCache,\n readViewerData,\n} from './nxe-protocol-reader.util';\nimport type { NxeViewerOptions } from './nxe-viewer-options.model';\n\n/** What the component's `postParametersFunction` is called with: the request's action and its parameters. */\nexport interface NxePostParametersData {\n action: NxeViewerAction;\n [parameter: string]: unknown;\n}\n\n/**\n * The component's `postParametersFunction` input. It runs for every request, the first one included.\n * Each key of an object it returns becomes a form field of the request, replacing a field of the same\n * name; anything else it returns adds nothing.\n */\nexport type NxePostParametersFunction = (data: NxePostParametersData) => unknown;\n\n/** What every request is built from. */\nexport interface NxeRequestContext {\n /** The component's `requestUrl`: each request's host action takes the place of `{action}`. */\n requestUrl: string;\n /** The component's `properties`, sent as JSON when truthy. */\n properties: unknown;\n /** The component's `postParametersFunction`. */\n postParametersFunction: NxePostParametersFunction | null | undefined;\n /** The strings failures are described with. */\n strings: NxeViewerStrings;\n}\n\n/** The server's side of an open viewer: the token it issued and the options it sent. */\nexport interface NxeServerSession {\n token: string;\n options: NxeViewerOptions;\n}\n\n/** Consecutive pages, from a 0-based index. */\nexport interface NxePageRange {\n startIndex: number;\n count: number;\n}\n\nexport interface NxeFindParameters {\n text: string;\n matchCase?: boolean;\n wholeWord?: boolean;\n}\n\n/**\n * The seconds a request may take when no positive `requestTimeout` applies. That includes the first\n * request, which is sent before the server's options are known. Stimulsoft's viewer uses the same value.\n */\nexport const NXE_UNSET_REQUEST_TIMEOUT_SECONDS = 1000;\n\n/**\n * The URL of a host action. The action's path takes the place of `{action}` in `requestUrl`, and a query\n * string on the action is appended to the URL's own.\n */\nexport function actionUrl(requestUrl: string, action: string): string {\n const queryAt = action.indexOf('?');\n const path = queryAt < 0 ? action : action.slice(0, queryAt);\n const url = requestUrl.replace('{action}', () => path);\n if (queryAt < 0) return url;\n return `${url}${url.includes('?') ? '&' : '?'}${action.slice(queryAt + 1)}`;\n}\n\n/**\n * The host action that answers a viewer action. GetReport goes to `getReport` (or `viewerEvent` when that\n * is empty). The other actions go to `viewerEvent`, or to `getReport` when the server keeps nothing.\n * ExportReport goes to `exportReport` when that is set.\n */\nexport function hostActionFor(options: NxeViewerOptions, action: NxeViewerAction): string {\n const { getReport, viewerEvent, exportReport } = options.actions;\n const reportAction = getReport || viewerEvent;\n const eventAction = options.server.cacheMode === 'None' ? reportAction : viewerEvent;\n if (action === 'GetReport') return reportAction;\n if (action === 'ExportReport') return exportReport || eventAction;\n return eventAction;\n}\n\n/** The file name in a Content-Disposition header, preferring its UTF-8 form. */\nexport function fileNameOf(disposition: string | null): string | null {\n if (!disposition) return null;\n const encoded = /filename\\*\\s*=\\s*UTF-8''([^;]+)/i.exec(disposition);\n if (encoded) {\n try {\n return decodeURIComponent(encoded[1].trim());\n } catch {\n // A malformed escape: the plain file name follows.\n }\n }\n const plain = /filename\\s*=\\s*(?:\"([^\"]*)\"|([^;]+))/i.exec(disposition);\n return plain ? (plain[1] ?? plain[2]).trim() : null;\n}\n\nfunction timeoutOf(session: NxeServerSession | null): number {\n const seconds = session?.options.server.requestTimeout ?? 0;\n return seconds > 0 ? seconds : NXE_UNSET_REQUEST_TIMEOUT_SECONDS;\n}\n\nfunction formOf(\n context: NxeRequestContext,\n action: NxeViewerAction,\n session: NxeServerSession | null,\n parameters: object | null,\n): FormData {\n const form = new FormData();\n form.set('nextera_action', action);\n if (session) {\n const { cacheMode, cacheTimeout, cacheItemPriority } = session.options.server;\n form.set('nextera_token', session.token);\n form.set(\n 'nextera_cache',\n JSON.stringify({ mode: cacheMode, timeout: cacheTimeout, priority: cacheItemPriority }),\n );\n }\n if (parameters) form.set('nextera_parameters', JSON.stringify(parameters));\n if (context.properties) form.set('properties', JSON.stringify(context.properties));\n const added = context.postParametersFunction?.({ ...parameters, action });\n if (typeof added === 'object' && added !== null) {\n for (const [name, value] of Object.entries(added)) {\n form.set(name, value instanceof Blob ? value : String(value));\n }\n }\n return form;\n}\n\n/** An error answer to a blob request carries its body as a blob. Read it, as JSON when it is JSON, so it can be classified. */\nasync function readableFailure(failure: unknown): Promise<unknown> {\n if (!(failure instanceof HttpErrorResponse) || !(failure.error instanceof Blob)) return failure;\n const text = await failure.error.text();\n let body: unknown = text;\n try {\n body = JSON.parse(text);\n } catch {\n // Not JSON: the failure is described by its status.\n }\n return new HttpErrorResponse({\n error: body,\n headers: failure.headers,\n status: failure.status,\n statusText: failure.statusText,\n url: failure.url ?? undefined,\n });\n}\n\n/**\n * Sends one viewer's protocol requests through the application's `HttpClient`, so the application's\n * interceptors apply, and reads each answer. Every observable fails with an `NxeViewerFailure`. A request's\n * form is built when the observable is subscribed.\n */\n@Injectable()\nexport class NxeViewerClientService {\n private readonly http = inject(HttpClient);\n\n /** AngularViewerData, sent to the component's `action`: the token and the options. */\n openViewer(context: NxeRequestContext, action: string): Observable<NxeViewerDataAnswer> {\n return this.post(context, 'AngularViewerData', action, null, null, readViewerData);\n }\n\n /** GetReport: renders the report, with the HTML of the pages in `range` when one is given. */\n getReport(\n context: NxeRequestContext,\n session: NxeServerSession,\n range?: NxePageRange,\n ): Observable<NxeReportAnswer> {\n const hostAction = hostActionFor(session.options, 'GetReport');\n return this.post(context, 'GetReport', hostAction, session, range ?? null, readReport);\n }\n\n /** GetPages: the HTML of the pages in `range`. */\n getPages(\n context: NxeRequestContext,\n session: NxeServerSession,\n range: NxePageRange,\n ): Observable<NxePagesAnswer> {\n return this.post(\n context,\n 'GetPages',\n hostActionFor(session.options, 'GetPages'),\n session,\n range,\n readPages,\n );\n }\n\n /** Find: the text components that match. */\n find(\n context: NxeRequestContext,\n session: NxeServerSession,\n parameters: NxeFindParameters,\n ): Observable<NxeFindAnswer> {\n return this.post(\n context,\n 'Find',\n hostActionFor(session.options, 'Find'),\n session,\n parameters,\n readFind,\n );\n }\n\n /** UpdateCache: keeps the server's copy of the report. */\n updateCache(\n context: NxeRequestContext,\n session: NxeServerSession,\n ): Observable<NxeUpdateCacheAnswer> {\n const hostAction = hostActionFor(session.options, 'UpdateCache');\n return this.post(context, 'UpdateCache', hostAction, session, null, readUpdateCache);\n }\n\n /** ExportReport: the report as a file, in a format such as `Pdf` or `Html`. It never times out. */\n exportReport(\n context: NxeRequestContext,\n session: NxeServerSession,\n format: string,\n ): Observable<NxeExportAnswer> {\n const url = actionUrl(context.requestUrl, hostActionFor(session.options, 'ExportReport'));\n return defer(() =>\n this.http.post(url, formOf(context, 'ExportReport', session, { format }), {\n observe: 'response',\n responseType: 'blob',\n }),\n ).pipe(\n map((response) => ({\n blob: response.body ?? new Blob([]),\n fileName: fileNameOf(response.headers.get('Content-Disposition')) ?? '',\n contentType: response.headers.get('Content-Type') ?? '',\n })),\n catchError((failure: unknown) =>\n from(readableFailure(failure)).pipe(\n switchMap((readable) =>\n throwError(() => readFailure(readable, 'ExportReport', context.strings)),\n ),\n ),\n ),\n );\n }\n\n private post<T>(\n context: NxeRequestContext,\n action: NxeViewerAction,\n hostAction: string,\n session: NxeServerSession | null,\n parameters: object | null,\n read: (body: unknown) => T,\n ): Observable<T> {\n const seconds = timeoutOf(session);\n return defer(() =>\n this.http.post(\n actionUrl(context.requestUrl, hostAction),\n formOf(context, action, session, parameters),\n ),\n ).pipe(\n timeout({\n first: seconds * 1000,\n with: () => throwError(() => new NxeTimeoutError(seconds)),\n }),\n map((body) => read(body)),\n catchError((failure: unknown) =>\n throwError(() => readFailure(failure, action, context.strings)),\n ),\n );\n }\n}\n","import { computed, DestroyRef, inject, Injectable, signal } from '@angular/core';\nimport {\n catchError,\n EMPTY,\n exhaustMap,\n finalize,\n interval,\n Observable,\n Subject,\n Subscription,\n} from 'rxjs';\nimport type {\n NxePagesAnswer,\n NxePageSize,\n NxeReportAnswer,\n NxeViewerFailure,\n} from '../protocol/nxe-protocol.model';\nimport {\n NxeRequestContext,\n NxeServerSession,\n NxeViewerClientService,\n} from '../protocol/nxe-viewer-client.service';\nimport type { NxeViewerOptions } from '../protocol/nxe-viewer-options.model';\n\n/** How often an open viewer asks the server to keep its report: every 3 minutes, as Stimulsoft's viewer does. */\nexport const NXE_KEEP_ALIVE_MS = 180_000;\n\n/** The page on screen. */\nexport interface NxeShownPage {\n /** 0-based. */\n index: number;\n size: NxePageSize;\n /** The page's HTML, or null while it has not arrived: while it is on its way, or after its request failed. */\n html: string | null;\n}\n\nfunction withPages(pages: Map<number, string>, answer: NxePagesAnswer | null): Map<number, string> {\n answer?.pages.forEach((html, offset) => pages.set(answer.startIndex + offset, html));\n return pages;\n}\n\n/**\n * Hands a file to the browser to save, under the name the server gave it. A blob URL is used rather\n * than a data one because an exported report is far larger than a URL may be, and it is revoked on\n * the next turn of the event loop, once the click has been taken.\n */\nfunction saveBlob(blob: Blob, fileName: string): void {\n const url = URL.createObjectURL(blob);\n const link = document.createElement('a');\n link.href = url;\n link.download = fileName;\n link.style.display = 'none';\n document.body.append(link);\n link.click();\n link.remove();\n setTimeout(() => URL.revokeObjectURL(url), 0);\n}\n\n/**\n * One viewer's conversation with the report server, and the state the viewer shows.\n *\n * Every signal changes only in this service's methods and in the answers they handle; nothing reacts to\n * a signal changing. Each viewer provides its own session, so viewers on one page never share state.\n */\n@Injectable()\nexport class NxeViewerSessionService {\n private readonly client = inject(NxeViewerClientService);\n\n private readonly optionsState = signal<NxeViewerOptions | null>(null);\n private readonly reportState = signal<NxeReportAnswer | null>(null);\n private readonly htmlState = signal<ReadonlyMap<number, string>>(new Map());\n private readonly pageIndexState = signal(0);\n private readonly pendingState = signal(0);\n private readonly failureState = signal<NxeViewerFailure | null>(null);\n\n /** The options from the last AngularViewerData answer. */\n readonly options = this.optionsState.asReadonly();\n /** The report from the last GetReport answer, or null before one. */\n readonly report = this.reportState.asReadonly();\n /** The 0-based index of the page on screen. */\n readonly pageIndex = this.pageIndexState.asReadonly();\n /** The failure on show, until it is dismissed. */\n readonly failure = this.failureState.asReadonly();\n /** How many pages the report has; 0 before one is loaded. */\n readonly pageCount = computed(() => this.reportState()?.pageCount ?? 0);\n /** Whether a request the user waits for is on its way. Keep-alive requests do not count. */\n readonly busy = computed(() => this.pendingState() > 0);\n /** The page on screen, or null before a report. */\n readonly shownPage = computed<NxeShownPage | null>(() => {\n const report = this.reportState();\n const index = this.pageIndexState();\n if (!report || index >= report.pageCount) return null;\n return { index, size: report.pages[index], html: this.htmlState().get(index) ?? null };\n });\n\n /**\n * Every page of the report, in order, each with its HTML when it has arrived. The page modes that show\n * more than one page at a time lay these out and ask for the ones that come into view; a page holds its\n * size, and so its place, before its HTML is here.\n */\n readonly allPages = computed<readonly NxeShownPage[]>(() => {\n const report = this.reportState();\n if (!report) return [];\n const html = this.htmlState();\n return report.pages.map((size, index) => ({ index, size, html: html.get(index) ?? null }));\n });\n\n /** Emits after each successful GetReport answer. */\n readonly reportLoaded = new Subject<void>();\n /** Emits each failure put on show. */\n readonly failed = new Subject<NxeViewerFailure>();\n\n private context: NxeRequestContext | null = null;\n private session: NxeServerSession | null = null;\n /** Every request the user waits for. */\n private requests = new Subscription();\n /** The page requests among them, which a new rendering of the report makes obsolete. */\n private pageRequests = new Subscription();\n private keepAlive = Subscription.EMPTY;\n private readonly pagesOnTheWay = new Set<number>();\n /** True from the moment an expired report is sent to be rendered again until that rendering settles. */\n private recovering = false;\n private destroyed = false;\n\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n this.destroyed = true;\n this.close();\n this.reportLoaded.complete();\n this.failed.complete();\n });\n }\n\n /** Opens the report the host action names, in place of whatever this viewer showed. */\n open(context: NxeRequestContext, action: string): void {\n if (this.destroyed) return;\n this.close();\n this.context = context;\n this.reportState.set(null);\n this.htmlState.set(new Map());\n this.pageIndexState.set(0);\n this.failureState.set(null);\n if (!context.requestUrl) return;\n this.track(this.client.openViewer(context, action), false, (answer) => {\n const session = { token: answer.token, options: answer.options };\n this.session = session;\n this.optionsState.set(answer.options);\n this.startKeepAlive(context, session);\n this.render();\n });\n }\n\n /**\n * Shows the page at a 0-based index; an index outside the report is ignored. Asking for the page already\n * on screen fetches it again when its HTML is missing, as it is after its request failed.\n */\n goToPage(index: number): void {\n const inReport = Number.isInteger(index) && index >= 0 && index < this.pageCount();\n if (this.destroyed || !inReport) return;\n this.pageIndexState.set(index);\n this.loadPage(index);\n }\n\n /**\n * Asks for a page's HTML without moving the page on screen, for the modes that show several pages at\n * once and fetch the ones that come into view. A page already here, or already on its way, is left alone.\n */\n requestPage(index: number): void {\n if (this.destroyed || !Number.isInteger(index) || index < 0) return;\n this.loadPage(index);\n }\n\n /** Moves the page on screen without asking for it, for scroll tracking, which follows what is drawn. */\n markCurrentPage(index: number): void {\n if (this.destroyed || !Number.isInteger(index) || index < 0 || index >= this.pageCount()) return;\n this.pageIndexState.set(index);\n }\n\n /**\n * ExportReport: the report as a file, handed to the browser to save. The export never times out, so\n * it is tracked as a request the user waits for and the toolbar stays disabled until the file is here.\n */\n exportTo(format: string): void {\n if (this.destroyed || this.session === null || this.context === null) return;\n const { context, session } = this.connection();\n this.track(this.client.exportReport(context, session, format), false, (answer) => {\n const name = answer.fileName || `${this.reportState()?.reportName ?? 'report'}.${format.toLowerCase()}`;\n saveBlob(answer.blob, name);\n });\n }\n\n /** Takes the failure off show. */\n dismissFailure(): void {\n this.failureState.set(null);\n }\n\n /**\n * GetReport, asking for the page on screen, which stays on screen when it is still in the report. The new\n * rendering makes every page request still on its way obsolete. Its settling ends a recovery.\n */\n private render(): void {\n const { context, session } = this.connection();\n const range = { startIndex: this.pageIndexState(), count: 1 };\n const rendering = this.client\n .getReport(context, session, range)\n .pipe(finalize(() => (this.recovering = false)));\n this.track(rendering, false, (report) => {\n this.pageRequests.unsubscribe();\n this.pageRequests = new Subscription();\n this.htmlState.set(withPages(new Map(), report.pagesHtml));\n this.reportState.set(report);\n this.pageIndexState.update((index) => Math.max(0, Math.min(index, report.pageCount - 1)));\n this.reportLoaded.next();\n this.loadPage(this.pageIndexState());\n });\n }\n\n /** GetPages for one page, unless the page is already here or on its way. */\n private loadPage(index: number): void {\n if (index >= this.pageCount() || this.htmlState().has(index) || this.pagesOnTheWay.has(index))\n return;\n const { context, session } = this.connection();\n this.pagesOnTheWay.add(index);\n const request = this.client\n .getPages(context, session, { startIndex: index, count: 1 })\n .pipe(finalize(() => this.pagesOnTheWay.delete(index)));\n this.pageRequests.add(\n this.track(request, true, (answer) =>\n this.htmlState.set(withPages(new Map(this.htmlState()), answer)),\n ),\n );\n }\n\n /**\n * Sends a request the user waits for, and returns its subscription. A `recoverable` request that finds the\n * report gone renders it again; every other failure goes on show.\n */\n private track<T>(\n request: Observable<T>,\n recoverable: boolean,\n next: (value: T) => void,\n ): Subscription {\n this.pendingState.update((count) => count + 1);\n const subscription = request\n .pipe(finalize(() => this.pendingState.update((count) => count - 1)))\n .subscribe({\n next,\n error: (failure: NxeViewerFailure) => this.fail(failure, recoverable),\n });\n this.requests.add(subscription);\n return subscription;\n }\n\n /**\n * An expired report found by a recoverable request is rendered again, unless a rendering is already on its\n * way; every other failure goes on show. Only that rendering settling ends the recovery, so failures in the\n * meantime cannot start a second one.\n */\n private fail(failure: NxeViewerFailure, recoverable: boolean): void {\n if (failure.type === 'CacheExpired' && recoverable) {\n if (!this.recovering) {\n this.recovering = true;\n this.render();\n }\n return;\n }\n this.failureState.set(failure);\n this.failed.next(failure);\n }\n\n /** UpdateCache every three minutes while the server keeps the report. Its failures are not shown. */\n private startKeepAlive(context: NxeRequestContext, session: NxeServerSession): void {\n const { allowAutoUpdateCache, cacheMode } = session.options.server;\n if (!allowAutoUpdateCache || cacheMode === 'None') return;\n this.keepAlive = interval(NXE_KEEP_ALIVE_MS)\n .pipe(\n exhaustMap(() => this.client.updateCache(context, session).pipe(catchError(() => EMPTY))),\n )\n .subscribe();\n }\n\n /** Stops every request and the keep-alive. */\n private close(): void {\n this.requests.unsubscribe();\n this.requests = new Subscription();\n this.pageRequests = new Subscription();\n this.keepAlive.unsubscribe();\n this.session = null;\n this.pagesOnTheWay.clear();\n this.recovering = false;\n }\n\n private connection(): { context: NxeRequestContext; session: NxeServerSession } {\n if (!this.context || !this.session) throw new Error('The viewer has no report open.');\n return { context: this.context, session: this.session };\n }\n}\n","import { ChangeDetectionStrategy, Component, computed, input, output, signal } from '@angular/core';\nimport type { NxeViewerOptions, NxeViewMode } from '../protocol/nxe-viewer-options.model';\nimport { NXE_ENGLISH, type NxeViewerStrings } from '../strings/nxe-viewer-strings.const';\n\n/** The width of the page-number box, as Stimulsoft's page control sizes it. */\nconst PAGE_BOX_WIDTH_PX = 45;\n\n/** The zoom menu's fixed percentages, in Stimulsoft's order, above the two fit items. */\nconst ZOOM_PRESETS = [25, 50, 75, 100, 150, 200] as const;\n\n/** The view-mode menu's items, in Stimulsoft's order. */\nconst VIEW_MODES = ['SinglePage', 'Continuous', 'MultiplePages'] as const satisfies readonly NxeViewMode[];\n\n/**\n * The toolbar's page navigation.\n *\n * Stimulsoft's toolbar is a long list of groups; this is the navigation group of it, which is what\n * a report viewer cannot do without: first, previous, the page control, next, last. Each button\n * appears only when its `toolbar.show…Button` option is on, and the group is laid out where\n * `toolbar.alignment` says. The other groups — save, print, find, bookmarks, zoom, view mode —\n * arrive with the tasks that implement them.\n *\n * Navigation is disabled the way Stimulsoft disables it: in `MultiplePages`, and in `Continuous`\n * unless the report panel or the whole viewer scrolls. A button is disabled at the end of the\n * report it would move past, and everything is disabled while a request the user waits for is on\n * its way.\n */\n@Component({\n selector: 'nxe-viewer-toolbar',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'nxe-viewer-toolbar',\n role: 'toolbar',\n '[style.background-color]': 'backgroundColor()',\n '[style.border]': 'border()',\n '[style.color]': 'fontColor()',\n '[style.font-family]': 'fontFamily()',\n '[style.justify-content]': 'justifyContent()',\n '[class.nxe-busy]': 'busy()',\n },\n template: `\n @if (showSave()) {\n <div class=\"nxe-toolbar-menu\">\n <button\n type=\"button\"\n class=\"nxe-toolbar-button nxe-toolbar-captioned\"\n [attr.aria-label]=\"strings().SaveToolTip\"\n [attr.aria-expanded]=\"openMenu() === 'save'\"\n (click)=\"toggleMenu('save')\"\n >\n <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <path\n d=\"M2 2h9.5L14 4.5V14H2zm2.5 0v4.5h6V2zm-1 7.5h9V14h-9zM8.5 3h1.5v2.5H8.5z\"\n />\n </svg>\n <span class=\"nxe-toolbar-caption\">{{ strings().Save }}</span>\n <svg class=\"nxe-toolbar-arrow\" viewBox=\"0 0 8 8\" aria-hidden=\"true\">\n <path d=\"M1 3h6L4 6.2z\" />\n </svg>\n </button>\n @if (openMenu() === 'save') {\n <div class=\"nxe-toolbar-popup\" role=\"menu\">\n @for (format of saveFormats(); track format) {\n <button\n type=\"button\"\n class=\"nxe-toolbar-item\"\n role=\"menuitem\"\n (click)=\"save(format)\"\n >\n <span class=\"nxe-toolbar-item-icon\">\n <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <path d=\"M3 1h7l3 3v11H3zm6.6 1.2v2.2h2.2z\" />\n </svg>\n </span>\n {{ format }}\n </button>\n }\n </div>\n }\n </div>\n <span class=\"nxe-toolbar-separator\"></span>\n }\n @if (showFirstPage()) {\n <button\n type=\"button\"\n class=\"nxe-toolbar-button\"\n [disabled]=\"atStart()\"\n [attr.aria-label]=\"strings().FirstPage\"\n (click)=\"goTo(0)\"\n >\n <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <path d=\"M12.5 3v10L6 8zM4.5 3h1.2v10H4.5z\" />\n </svg>\n </button>\n }\n @if (showPreviousPage()) {\n <button\n type=\"button\"\n class=\"nxe-toolbar-button\"\n [disabled]=\"atStart()\"\n [attr.aria-label]=\"strings().PrevPage\"\n (click)=\"goTo(pageIndex() - 1)\"\n >\n <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><path d=\"M11 3v10L4.5 8z\" /></svg>\n </button>\n }\n @if (showCurrentPage()) {\n <span class=\"nxe-page-control\">\n <span class=\"nxe-page-label\">{{ strings().Page }}</span>\n <input\n type=\"text\"\n inputmode=\"numeric\"\n class=\"nxe-page-box\"\n [style.width.px]=\"pageBoxWidth\"\n [disabled]=\"pageControlDisabled()\"\n [value]=\"pageIndex() + 1\"\n [attr.aria-label]=\"strings().Page\"\n (keydown.enter)=\"enterPage($event)\"\n />\n <span class=\"nxe-page-label\">{{ strings().PageOf }} {{ pageCount() }}</span>\n </span>\n }\n @if (showNextPage()) {\n <button\n type=\"button\"\n class=\"nxe-toolbar-button\"\n [disabled]=\"atEnd()\"\n [attr.aria-label]=\"strings().NextPage\"\n (click)=\"goTo(pageIndex() + 1)\"\n >\n <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><path d=\"M5 3v10l6.5-5z\" /></svg>\n </button>\n }\n @if (showLastPage()) {\n <button\n type=\"button\"\n class=\"nxe-toolbar-button\"\n [disabled]=\"atEnd()\"\n [attr.aria-label]=\"strings().LastPage\"\n (click)=\"goTo(pageCount() - 1)\"\n >\n <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <path d=\"M3.5 3v10L10 8zM10.3 3h1.2v10h-1.2z\" />\n </svg>\n </button>\n }\n @if (showZoom() || showViewMode()) {\n <span class=\"nxe-toolbar-separator\"></span>\n }\n @if (showZoom()) {\n <div class=\"nxe-toolbar-menu\">\n <button\n type=\"button\"\n class=\"nxe-toolbar-button nxe-toolbar-captioned\"\n [attr.aria-label]=\"strings().ZoomToolTip\"\n [attr.aria-expanded]=\"openMenu() === 'zoom'\"\n (click)=\"toggleMenu('zoom')\"\n >\n <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <path\n d=\"M3 2h7l3 3v9H3zm6.6 1.2v2.2h2.2zM5 8h6v1.1H5zm0 2.4h6v1.1H5z\"\n />\n </svg>\n <span class=\"nxe-toolbar-caption\">{{ zoomCaption() }}</span>\n <svg class=\"nxe-toolbar-arrow\" viewBox=\"0 0 8 8\" aria-hidden=\"true\">\n <path d=\"M1 3h6L4 6.2z\" />\n </svg>\n </button>\n @if (openMenu() === 'zoom') {\n <div class=\"nxe-toolbar-popup\" role=\"menu\">\n @for (percent of zoomPresets; track percent) {\n <button\n type=\"button\"\n class=\"nxe-toolbar-item\"\n role=\"menuitem\"\n [class.nxe-toolbar-item-on]=\"isZoom(percent)\"\n (click)=\"chooseZoom(percent)\"\n >\n <span class=\"nxe-toolbar-item-icon\"></span>{{ percent }}%\n </button>\n }\n <span class=\"nxe-toolbar-item-separator\"></span>\n <button type=\"button\" class=\"nxe-toolbar-item\" role=\"menuitem\" (click)=\"fit('page')\">\n <span class=\"nxe-toolbar-item-icon\">\n <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><path d=\"M3 2h10v12H3zm1.2 1.2v9.6h7.6V3.2z\" /></svg>\n </span>\n {{ strings().ZoomOnePage }}\n </button>\n <button type=\"button\" class=\"nxe-toolbar-item\" role=\"menuitem\" (click)=\"fit('width')\">\n <span class=\"nxe-toolbar-item-icon\">\n <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><path d=\"M1 6h14v4H1zm1.2 1.2v1.6h11.6V7.2z\" /></svg>\n </span>\n {{ strings().ZoomPageWidth }}\n </button>\n </div>\n }\n </div>\n }\n @if (showViewMode()) {\n <div class=\"nxe-toolbar-menu\">\n <button\n type=\"button\"\n class=\"nxe-toolbar-button nxe-toolbar-captioned\"\n [attr.aria-label]=\"strings().ViewModeToolTip\"\n [attr.aria-expanded]=\"openMenu() === 'viewMode'\"\n (click)=\"toggleMenu('viewMode')\"\n >\n <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><path d=\"M3 2h10v12H3zm1.2 1.2v9.6h7.6V3.2z\" /></svg>\n <span class=\"nxe-toolbar-caption\">{{ strings()[viewMode()] }}</span>\n <svg class=\"nxe-toolbar-arrow\" viewBox=\"0 0 8 8\" aria-hidden=\"true\">\n <path d=\"M1 3h6L4 6.2z\" />\n </svg>\n </button>\n @if (openMenu() === 'viewMode') {\n <div class=\"nxe-toolbar-popup\" role=\"menu\">\n @for (mode of viewModes; track mode) {\n <button\n type=\"button\"\n class=\"nxe-toolbar-item\"\n role=\"menuitem\"\n [class.nxe-toolbar-item-on]=\"viewMode() === mode\"\n (click)=\"chooseViewMode(mode)\"\n >\n <span class=\"nxe-toolbar-item-icon\">\n @switch (mode) {\n @case ('SinglePage') {\n <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><path d=\"M3 2h10v12H3zm1.2 1.2v9.6h7.6V3.2z\" /></svg>\n }\n @case ('Continuous') {\n <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <path d=\"M3 1h10v6H3zm1.2 1.2v3.6h7.6V2.2zM3 9h10v6H3zm1.2 1.2v3.6h7.6v-3.6z\" />\n </svg>\n }\n @case ('MultiplePages') {\n <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <path d=\"M2 2h5v5H2zm7 0h5v5H9zM2 9h5v5H2zm7 0h5v5H9z\" />\n </svg>\n }\n }\n </span>\n {{ strings()[mode] }}\n </button>\n }\n </div>\n }\n </div>\n }\n `,\n styles: `\n :host {\n display: flex;\n align-items: center;\n gap: 2px;\n box-sizing: border-box;\n padding: 3px 6px;\n min-height: 30px;\n position: relative;\n user-select: none;\n }\n\n /* Stimulsoft covers the toolbar with a disabled panel while a request is in flight. */\n :host(.nxe-busy)::after {\n content: '';\n position: absolute;\n inset: 0;\n cursor: default;\n }\n\n .nxe-toolbar-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 26px;\n height: 26px;\n padding: 0;\n border: 0;\n border-radius: 2px;\n background: transparent;\n color: inherit;\n font: inherit;\n cursor: pointer;\n }\n\n .nxe-toolbar-button:hover:not(:disabled) {\n background: rgb(0 0 0 / 8%);\n }\n\n .nxe-toolbar-button:disabled {\n opacity: 0.5;\n cursor: default;\n }\n\n .nxe-toolbar-button svg {\n width: 16px;\n height: 16px;\n fill: currentColor;\n }\n\n .nxe-page-control {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 0 4px;\n white-space: nowrap;\n }\n\n .nxe-page-box {\n height: 21px;\n box-sizing: border-box;\n text-align: center;\n font: inherit;\n color: inherit;\n }\n\n /*\n * The number stays readable while the box is disabled. Stimulsoft's \"disabled: transparent\" is set on the page\n * control's host element, not on the input inside it, which keeps toolbar.fontColor -- measured against\n * Stimulsoft 2025.1.4 on a one-page report, where the box reads \"1\" in rgb(32, 32, 32). Painting the input itself\n * transparent left the viewer showing \"Page [nothing] of 1\", which is what it looked like when it went wrong.\n * This answers the open question in angular-viewer-toolbar-view.md.\n */\n .nxe-page-box:disabled {\n color: inherit;\n -webkit-text-fill-color: currentColor;\n opacity: 1;\n }\n\n /* A rule of vertical space between groups, as Stimulsoft's separator items draw. */\n .nxe-toolbar-separator {\n width: 1px;\n height: 18px;\n margin: 0 4px;\n background: currentColor;\n opacity: 0.25;\n }\n\n .nxe-toolbar-menu {\n position: relative;\n display: flex;\n align-items: center;\n }\n\n /* A button that shows a caption carries its icon, the caption and the menu's down arrow. */\n .nxe-toolbar-captioned {\n width: auto;\n gap: 4px;\n padding: 0 6px;\n }\n\n .nxe-toolbar-caption {\n font-size: 12px;\n white-space: nowrap;\n }\n\n .nxe-toolbar-arrow {\n width: 8px;\n height: 8px;\n fill: currentColor;\n flex: none;\n }\n\n .nxe-toolbar-popup {\n position: absolute;\n top: 100%;\n left: 0;\n z-index: 10;\n min-width: 150px;\n margin-top: 2px;\n padding: 3px 0;\n background: #fff;\n color: #000;\n border: 1px solid #c8c8c8;\n box-shadow: 0 2px 8px rgb(0 0 0 / 25%);\n display: flex;\n flex-direction: column;\n }\n\n .nxe-toolbar-item {\n display: flex;\n align-items: center;\n gap: 8px;\n border: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 12px;\n text-align: left;\n white-space: nowrap;\n padding: 5px 14px 5px 6px;\n cursor: pointer;\n }\n\n .nxe-toolbar-item:hover {\n background: rgb(0 0 0 / 7%);\n }\n\n .nxe-toolbar-item-on {\n background: rgb(0 0 0 / 11%);\n }\n\n /* Every item lines its caption up past an icon cell, whether or not it has an icon. */\n .nxe-toolbar-item-icon {\n width: 16px;\n height: 16px;\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n }\n\n .nxe-toolbar-item-icon svg {\n width: 16px;\n height: 16px;\n fill: currentColor;\n }\n\n .nxe-toolbar-item-separator {\n height: 1px;\n margin: 3px 0;\n background: #c8c8c8;\n }\n `,\n})\nexport class NxeViewerToolbarComponent {\n /** The options from the server, or null before the first answer, when the toolbar shows nothing. */\n readonly options = input<NxeViewerOptions | null>(null);\n /** The 0-based index of the page on screen. */\n readonly pageIndex = input(0);\n /** How many pages the report has. */\n readonly pageCount = input(0);\n /** Whether a request the user waits for is on its way. */\n readonly busy = input(false);\n /** The captions to show. */\n readonly strings = input<NxeViewerStrings>(NXE_ENGLISH);\n /** The mode the pages are shown in. */\n readonly viewMode = input<NxeViewMode>('SinglePage');\n /** The zoom the pages are drawn at, as a factor: 1 is 100 %. */\n readonly zoom = input(1);\n\n /** The 0-based page the user asked for. */\n readonly goToPage = output<number>();\n /** The mode the user chose. */\n readonly viewModeChange = output<NxeViewMode>();\n /** The zoom the user chose, as a factor. */\n readonly zoomChange = output<number>();\n /** The user asked to fit a whole page, or the page's width, in the panel. */\n readonly fitRequest = output<'page' | 'width'>();\n /** The format the user asked the report to be saved as. */\n readonly saveRequest = output<string>();\n\n protected readonly pageBoxWidth = PAGE_BOX_WIDTH_PX;\n protected readonly zoomPresets = ZOOM_PRESETS;\n protected readonly viewModes = VIEW_MODES;\n\n /** Which menu is open, or null. Stimulsoft opens one at a time and closes it on the next click. */\n private readonly openMenuState = signal<'save' | 'zoom' | 'viewMode' | null>(null);\n protected readonly openMenu = this.openMenuState.asReadonly();\n\n /**\n * The save menu's formats, in the order Stimulsoft lists them, and only those the server turned on.\n * The button itself is left out when no format is on, as Stimulsoft forces it off then.\n */\n protected readonly saveFormats = computed(() => {\n const exports = this.options()?.exports;\n if (!exports) return [];\n const formats: string[] = [];\n if (exports.showExportToPdf) formats.push('Pdf');\n if (exports.showExportToHtml) formats.push('Html');\n return formats;\n });\n\n protected readonly showSave = computed(\n () => this.toolbar()?.showSaveButton === true && this.saveFormats().length > 0,\n );\n\n protected save(format: string): void {\n this.openMenuState.set(null);\n this.saveRequest.emit(format);\n }\n\n /**\n * The zoom as a rounded percentage, as Stimulsoft captions the button, and empty when the zoom is\n * unknown or zero.\n */\n protected readonly zoomCaption = computed(() => {\n const zoom = this.zoom();\n return Number.isFinite(zoom) && zoom > 0 ? `${Math.round(zoom * 100)}%` : '';\n });\n\n private readonly toolbar = computed(() => this.options()?.toolbar ?? null);\n private readonly appearance = computed(() => this.options()?.appearance ?? null);\n\n /**\n * Stimulsoft's rule: navigation is off in `MultiplePages`, and in `Continuous` unless the report\n * panel scrolls or the viewer is full screen — in those cases the page is reached by scrolling.\n */\n private readonly navigationDisabled = computed(() => {\n const toolbar = this.toolbar();\n const appearance = this.appearance();\n if (!toolbar || !appearance) return true;\n if (toolbar.viewMode === 'MultiplePages') return true;\n return (\n toolbar.viewMode === 'Continuous' &&\n !appearance.scrollbarsMode &&\n !appearance.fullScreenMode\n );\n });\n\n protected readonly showFirstPage = computed(() => this.toolbar()?.showFirstPageButton === true);\n protected readonly showPreviousPage = computed(\n () => this.toolbar()?.showPreviousPageButton === true,\n );\n protected readonly showCurrentPage = computed(\n () => this.toolbar()?.showCurrentPageControl === true,\n );\n protected readonly showNextPage = computed(() => this.toolbar()?.showNextPageButton === true);\n protected readonly showLastPage = computed(() => this.toolbar()?.showLastPageButton === true);\n protected readonly showZoom = computed(() => this.toolbar()?.showZoomButton === true);\n protected readonly showViewMode = computed(() => this.toolbar()?.showViewModeButton === true);\n\n /** Whether a preset is the zoom on show, so its menu item reads as chosen. */\n protected isZoom(percent: number): boolean {\n return Math.round(this.zoom() * 100) === percent;\n }\n\n /** Opens a menu, or closes it when it is the one already open. */\n protected toggleMenu(menu: 'save' | 'zoom' | 'viewMode'): void {\n this.openMenuState.update((open) => (open === menu ? null : menu));\n }\n\n protected chooseZoom(percent: number): void {\n this.openMenuState.set(null);\n this.zoomChange.emit(percent / 100);\n }\n\n protected fit(what: 'page' | 'width'): void {\n this.openMenuState.set(null);\n this.fitRequest.emit(what);\n }\n\n protected chooseViewMode(mode: NxeViewMode): void {\n this.openMenuState.set(null);\n this.viewModeChange.emit(mode);\n }\n\n protected readonly atStart = computed(\n () => this.busy() || this.navigationDisabled() || this.pageIndex() <= 0,\n );\n protected readonly atEnd = computed(\n () => this.busy() || this.navigationDisabled() || this.pageIndex() >= this.pageCount() - 1,\n );\n protected readonly pageControlDisabled = computed(\n () => this.busy() || this.navigationDisabled() || this.pageCount() <= 1,\n );\n\n protected readonly backgroundColor = computed(() => this.toolbar()?.backgroundColor || null);\n protected readonly fontColor = computed(() => this.toolbar()?.fontColor || null);\n protected readonly fontFamily = computed(() => this.toolbar()?.fontFamily || null);\n\n /** A border only in `Simple`; `Separated` has none, as Stimulsoft's toolbar does. */\n protected readonly border = computed(() => {\n const toolbar = this.toolbar();\n if (!toolbar || toolbar.displayMode === 'Separated' || !toolbar.borderColor) return null;\n return `1px solid ${toolbar.borderColor}`;\n });\n\n protected readonly justifyContent = computed(() => {\n switch (this.toolbar()?.alignment) {\n case 'Center':\n return 'center';\n case 'Right':\n return 'flex-end';\n default:\n return 'flex-start';\n }\n });\n\n /**\n * Enter in the page box goes to the page typed, reading anything that is not a number as page 1\n * and clamping to the report, as Stimulsoft's page control does. Leaving the box does nothing.\n */\n protected enterPage(event: Event): void {\n const box = event.target as HTMLInputElement;\n const typed = Number.parseInt(box.value, 10);\n const page = Math.min(Math.max(Number.isNaN(typed) ? 1 : typed, 1), this.pageCount());\n box.value = String(page);\n this.goTo(page - 1);\n }\n\n protected goTo(index: number): void {\n if (this.busy() || index === this.pageIndex() || index < 0 || index >= this.pageCount()) return;\n this.goToPage.emit(index);\n }\n}\n","import { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n input,\n linkedSignal,\n OnChanges,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport { NxeReportPageComponent } from '../page/nxe-report-page.component';\nimport type { NxeViewerFailure } from '../protocol/nxe-protocol.model';\nimport type { NxeViewMode } from '../protocol/nxe-viewer-options.model';\n\n/** Stimulsoft's scroll tracker waits this long after scrolling stops before it moves the page. */\nconst SCROLL_SETTLE_MS = 300;\n/** And animates a navigation scroll over this long, in steps of about this many milliseconds. */\nconst SCROLL_ANIMATION_MS = 350;\nconst SCROLL_STEP_MS = 30;\n/** The viewer never measures itself smaller than this, nor closer than this to the window's bottom. */\nconst MIN_PANEL_HEIGHT = 200;\nconst VIEWER_BOTTOM_GAP = 16;\nimport {\n NxeViewerClientService,\n type NxePostParametersFunction,\n type NxeRequestContext,\n} from '../protocol/nxe-viewer-client.service';\nimport { NxeViewerSessionService } from '../session/nxe-viewer-session.service';\nimport { NXE_ENGLISH } from '../strings/nxe-viewer-strings.const';\nimport { NxeViewerToolbarComponent } from '../toolbar/nxe-viewer-toolbar.component';\n\n/**\n * What a host reaches through the component's `api`, with Stimulsoft's names and meanings. The\n * members for zoom, view mode, export, print, email and find arrive with the tasks that implement\n * those; a host that only pages through a report needs these three.\n */\nexport interface NxeViewerApi {\n /** The 0-based page on screen. Setting it shows a page inside the report and ignores anything else. */\n currentPage: number;\n /** How many pages the report has; 0 before one is loaded. */\n readonly pagesCount: number;\n /** Always `Report`, as Stimulsoft's Angular viewer answers when it is not showing a dashboard. */\n readonly reportType: string;\n}\n\n/**\n * A report served by `Nextera.Reports.Angular.NetCore`, shown page by page.\n *\n * The inputs, outputs and `api` are Stimulsoft's `stimulsoft-viewer-angular`, so a host swaps the\n * component and keeps its bindings. As there, a change to any input reloads the report: the\n * component asks for the viewer's options again and opens the report the action names.\n *\n * Each viewer provides its own session, so several on a page never share a report or a token.\n */\n@Component({\n selector: 'nxe-report-viewer',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NxeReportPageComponent, NxeViewerToolbarComponent],\n providers: [NxeViewerClientService, NxeViewerSessionService],\n host: { '(window:resize)': 'onWindowResize()' },\n template: `\n <div\n #rootBox\n class=\"nxe-viewer-root\"\n [style]=\"style()\"\n [style.background-color]=\"rootBackgroundColor()\"\n [style.width]=\"rootWidth()\"\n [style.height]=\"rootHeight()\"\n >\n @if (toolbarVisible()) {\n <nxe-viewer-toolbar\n [options]=\"session.options()\"\n [pageIndex]=\"session.pageIndex()\"\n [pageCount]=\"session.pageCount()\"\n [busy]=\"session.busy()\"\n [viewMode]=\"viewMode()\"\n [zoom]=\"zoom()\"\n (goToPage)=\"navigateTo($event)\"\n (viewModeChange)=\"setViewMode($event)\"\n (zoomChange)=\"setZoom($event)\"\n (fitRequest)=\"fitTo($event)\"\n (saveRequest)=\"session.exportTo($event)\"\n />\n }\n\n <div\n #pagesBox\n class=\"nxe-viewer-pages\"\n [class.nxe-viewer-continuous]=\"viewMode() === 'Continuous'\"\n [style.text-align]=\"pageAlignment()\"\n [style.overflow]=\"pagesOverflow()\"\n (scroll)=\"onScroll()\"\n >\n @for (page of shownPages(); track page.index) {\n <nxe-report-page\n class=\"nxe-viewer-page\"\n [class.nxe-viewer-page-shadow]=\"showPageShadow()\"\n [style.border]=\"pageBorder()\"\n [page]=\"page.size\"\n [html]=\"page.html\"\n [css]=\"pageCss()\"\n [zoom]=\"zoom()\"\n />\n }\n </div>\n\n @if (session.failure(); as failure) {\n <div class=\"nxe-viewer-failure\" role=\"alert\">\n <span class=\"nxe-viewer-failure-text\">{{ failure.message }}</span>\n <button type=\"button\" class=\"nxe-viewer-failure-close\" (click)=\"session.dismissFailure()\">\n &times;\n </button>\n </div>\n }\n </div>\n `,\n styles: `\n :host {\n display: inline-block;\n position: relative;\n }\n\n .nxe-viewer-root {\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n position: relative;\n }\n\n .nxe-viewer-pages {\n flex: 1 1 auto;\n min-height: 0;\n box-sizing: border-box;\n }\n\n /*\n * A page carries its own 10 px margin, as Stimulsoft's page element does, so the panel needs no\n * padding: the space around the outermost pages is that margin. In SinglePage and MultiplePages\n * the pages are inline-block, flow left to right and wrap into rows, and neighbouring margins do\n * not collapse, so the gap between two pages is 20 px; the rows sit where pageAlignment puts them.\n */\n .nxe-viewer-page {\n display: inline-block;\n vertical-align: top;\n margin: 10px;\n }\n\n /*\n * In Continuous the page is block-level with automatic side margins, so there is one page a row,\n * centred whatever the alignment says, and the 10 px vertical margins of two neighbours collapse\n * to a 10 px gap.\n */\n .nxe-viewer-continuous .nxe-viewer-page {\n display: block;\n margin: 10px auto;\n }\n\n .nxe-viewer-page-shadow {\n box-shadow: 2px 2px 6px rgb(0 0 0 / 30%);\n }\n\n .nxe-viewer-failure {\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 12px;\n background: #fdecea;\n color: #611a15;\n font-size: 13px;\n }\n\n .nxe-viewer-failure-text {\n flex: 1 1 auto;\n }\n\n .nxe-viewer-failure-close {\n border: 0;\n background: transparent;\n color: inherit;\n font-size: 18px;\n line-height: 1;\n cursor: pointer;\n }\n `,\n})\nexport class NxeReportViewerComponent implements OnChanges {\n /** Each request's URL, with `{action}` in place of the host action it goes to. */\n readonly requestUrl = input('');\n /** The host action that answers the first request, and so names the report to open. */\n readonly action = input('');\n /** Sent to the host with every request, as JSON, when it is truthy. */\n readonly properties = input<unknown>(null);\n /** The viewer's width; `100%` when it is not given. */\n readonly width = input<string | null>(null);\n /** The viewer's height; 650px when the report panel scrolls, otherwise `100%`. */\n readonly height = input<string | null>(null);\n /** The viewer's background; `White` when it is not given. */\n readonly backgroundColor = input<string | null>('White');\n /** Styles for the viewer's root element. Width, height and background take precedence over it. */\n readonly style = input<string | null>(null);\n /** Called for every request; each key of an object it returns becomes a form field. */\n readonly postParametersFunction = input<NxePostParametersFunction | null>(null);\n\n /** Emits after each report is loaded. */\n readonly loaded = output<void>();\n /** Emits every failure the viewer puts on show. */\n readonly error = output<NxeViewerFailure>();\n\n protected readonly session = inject(NxeViewerSessionService);\n\n /** Stimulsoft's `api` object: what a host calls to drive the viewer from outside. */\n readonly api: NxeViewerApi = this.buildApi();\n\n private readonly appearance = computed(() => this.session.options()?.appearance ?? null);\n\n private readonly pagesBox = viewChild<ElementRef<HTMLElement>>('pagesBox');\n private readonly rootBox = viewChild<ElementRef<HTMLElement>>('rootBox');\n\n /**\n * The mode the pages are shown in, and the zoom they are drawn at. Both start from the server's\n * options and are then the user's, until a new report's options arrive and reset them — which is\n * what `linkedSignal` says and an effect would only imply.\n */\n protected readonly viewMode = linkedSignal<NxeViewMode>(\n () => this.session.options()?.toolbar.viewMode ?? 'SinglePage',\n );\n protected readonly zoom = linkedSignal<number>(() => {\n const percent = this.session.options()?.toolbar.zoom ?? 100;\n return percent > 0 ? percent / 100 : 1;\n });\n\n /**\n * The pages on screen: one in `SinglePage`, the whole report in the modes that scroll through it.\n * A page carries its size before its HTML arrives, so the list holds its shape while the pages that\n * come into view are fetched.\n */\n protected readonly shownPages = computed(() => {\n if (this.viewMode() === 'SinglePage') {\n const page = this.session.shownPage();\n return page ? [page] : [];\n }\n return this.session.allPages();\n });\n\n /** Set while a page-navigation scroll is running, so scroll tracking does not fight it. */\n private scrollingToPage = false;\n private scrollSettled: ReturnType<typeof setTimeout> | null = null;\n\n protected readonly toolbarVisible = computed(\n () => this.session.options()?.toolbar.visible !== false,\n );\n protected readonly pageCss = computed(() => this.session.report()?.pageCss ?? '');\n protected readonly showPageShadow = computed(() => this.appearance()?.showPageShadow === true);\n protected readonly pageBorder = computed(() => {\n const color = this.appearance()?.pageBorderColor;\n return color ? `1px solid ${color}` : null;\n });\n\n /** Stimulsoft aligns the pages with the report panel's text alignment; `Default` means centred. */\n protected readonly pageAlignment = computed(() => {\n switch (this.appearance()?.pageAlignment) {\n case 'Left':\n return 'left';\n case 'Right':\n return 'right';\n default:\n return 'center';\n }\n });\n\n /** The report panel scrolls inside the viewer only when the server asks for scrollbars. */\n protected readonly pagesOverflow = computed(() =>\n this.appearance()?.scrollbarsMode ? 'auto' : 'hidden',\n );\n\n protected readonly rootWidth = computed(() => this.width() ?? '100%');\n protected readonly rootBackgroundColor = computed(() => this.backgroundColor() ?? 'White');\n\n /**\n * The height the viewer was measured to fill, once it is known.\n *\n * The report panel is what scrolls, as Stimulsoft's does — its panel measures 836 px against a\n * 16 513 px report while the document itself does not scroll at all. That needs the viewer to have a\n * definite height, and a host that asks for `100%` inside a container whose own height is automatic\n * does not give it one: the viewer would then grow to the whole report, 29 pages of it, and the\n * page would scroll instead of the panel. So when the height the host asked for cannot resolve, the\n * viewer measures the room between its top and the bottom of the window and takes that.\n */\n private readonly measuredHeight = signal<string | null>(null);\n\n protected readonly rootHeight = computed(() => {\n const measured = this.measuredHeight();\n if (measured !== null) return measured;\n const given = this.height();\n if (given !== null) return given;\n return this.appearance()?.scrollbarsMode ? '650px' : '100%';\n });\n\n constructor() {\n this.session.reportLoaded.pipe(takeUntilDestroyed()).subscribe(() => {\n // The modes that show the whole report start with every page laid out at its size and none of\n // them fetched, so the first screenful has to be asked for here; scrolling asks for the rest.\n this.afterPagesSettle();\n this.loaded.emit();\n });\n this.session.failed\n .pipe(takeUntilDestroyed())\n .subscribe((failure) => this.error.emit(failure));\n }\n\n /**\n * A change to any input reloads, as Stimulsoft's viewer does: its `ngOnChanges` never looks at\n * which input changed, so even a width change asks the server for the options and the report\n * again. Matching that keeps a host's reload behaviour the same across the swap.\n */\n ngOnChanges(): void {\n this.session.open(this.context(), this.action());\n }\n\n /**\n * Page navigation. In a mode that scrolls through the whole report the page is reached by scrolling\n * to it, over 350 ms, which is what Stimulsoft's navigation actions do; in `SinglePage` the page is\n * simply the one shown.\n */\n protected navigateTo(index: number): void {\n this.session.goToPage(index);\n if (this.viewMode() === 'SinglePage') return;\n this.scrollToPage(index);\n }\n\n /** The page number is kept and nothing scrolls, as Stimulsoft's view-mode actions leave it. */\n protected setViewMode(mode: NxeViewMode): void {\n this.viewMode.set(mode);\n this.afterPagesSettle();\n }\n\n /** Nothing preserves the scroll offset across a zoom change, so the visible region shifts. */\n protected setZoom(zoom: number): void {\n this.zoom.set(zoom);\n this.afterPagesSettle();\n }\n\n /**\n * Fit a whole page, or a page's width, in the panel. Stimulsoft computes this once from what is on\n * screen and stores the number as the zoom; no fit mode is remembered, so a later resize does not\n * re-fit. The 40 px it subtracts is the panel's padding and the page's margins.\n */\n protected fitTo(what: 'page' | 'width'): void {\n const box = this.pagesBox()?.nativeElement;\n const page = box?.querySelector('nxe-report-page');\n if (!box || !(page instanceof HTMLElement)) return;\n const available = what === 'width' ? box.clientWidth - 40 : box.clientHeight - 40;\n const drawn = what === 'width' ? page.offsetWidth : page.offsetHeight;\n if (drawn <= 0 || available <= 0) return;\n this.zoom.set((available * this.zoom()) / drawn);\n this.afterPagesSettle();\n }\n\n /**\n * Scrolling asks for the pages that have come into view, and, once it has stopped for 300 ms, moves\n * the page the toolbar reports to the first one still on screen — Stimulsoft's scroll tracking.\n */\n protected onScroll(): void {\n this.requestVisiblePages();\n if (this.scrollSettled !== null) clearTimeout(this.scrollSettled);\n this.scrollSettled = setTimeout(() => {\n this.scrollSettled = null;\n if (!this.scrollingToPage) this.trackCurrentPage();\n }, SCROLL_SETTLE_MS);\n }\n\n /** The room on screen changed, so the viewer measures itself against it again. */\n protected onWindowResize(): void {\n this.fitToAvailableRoom();\n }\n\n /** Lets the new layout reach the DOM, then fits the viewer to it and asks for what is on screen. */\n private afterPagesSettle(): void {\n requestAnimationFrame(() => {\n this.fitToAvailableRoom();\n this.requestVisiblePages();\n });\n }\n\n /**\n * Takes the room between the viewer's top and the bottom of the window when the height the host\n * asked for did not resolve, so the panel inside scrolls rather than the page. Measured before the\n * height is applied, and again only when the window changes, so it never chases its own answer.\n */\n private fitToAvailableRoom(): void {\n const root = this.rootBox()?.nativeElement;\n if (!root || !this.appearance()?.scrollbarsMode) return;\n const rect = root.getBoundingClientRect();\n const room = Math.max(MIN_PANEL_HEIGHT, Math.round(window.innerHeight - rect.top - VIEWER_BOTTOM_GAP));\n // A height that resolved is left alone; one that grew past the room on screen is taken over.\n if (this.measuredHeight() === null && rect.height <= room + 1) return;\n this.measuredHeight.set(`${room}px`);\n }\n\n /** Every page whose box meets the panel, plus one either side, so scrolling stays ahead of the eye. */\n private requestVisiblePages(): void {\n if (this.viewMode() === 'SinglePage') return;\n const box = this.pagesBox()?.nativeElement;\n if (!box) return;\n const pages = box.querySelectorAll('nxe-report-page');\n const top = box.scrollTop - box.clientHeight;\n const bottom = box.scrollTop + box.clientHeight * 2;\n pages.forEach((element, index) => {\n if (!(element instanceof HTMLElement)) return;\n const pageTop = element.offsetTop - box.offsetTop;\n if (pageTop + element.offsetHeight >= top && pageTop <= bottom) this.session.requestPage(index);\n });\n }\n\n /** The first page whose bottom is still below the panel's scroll offset. */\n private trackCurrentPage(): void {\n const box = this.pagesBox()?.nativeElement;\n if (!box) return;\n const pages = box.querySelectorAll('nxe-report-page');\n for (let index = 0; index < pages.length; index++) {\n const element = pages[index];\n if (!(element instanceof HTMLElement)) continue;\n const pageTop = element.offsetTop - box.offsetTop;\n if (pageTop + element.offsetHeight > box.scrollTop) {\n this.session.markCurrentPage(index);\n return;\n }\n }\n }\n\n /** Stimulsoft animates the panel to the page's top over 350 ms, in steps of about 30 ms. */\n private scrollToPage(index: number): void {\n const box = this.pagesBox()?.nativeElement;\n const element = box?.querySelectorAll('nxe-report-page')[index];\n if (!box || !(element instanceof HTMLElement)) return;\n const from = box.scrollTop;\n const to = element.offsetTop - box.offsetTop;\n const started = performance.now();\n this.scrollingToPage = true;\n const step = (): void => {\n const done = Math.min(1, (performance.now() - started) / SCROLL_ANIMATION_MS);\n box.scrollTop = from + (to - from) * done;\n if (done < 1) {\n setTimeout(step, SCROLL_STEP_MS);\n return;\n }\n this.scrollingToPage = false;\n this.requestVisiblePages();\n };\n step();\n }\n\n /**\n * The getters read the session's signals, so a host that asks between renders gets what is on\n * screen now. Built from a captured session rather than `this`, because `this` inside an object\n * literal's accessor is the literal.\n */\n private buildApi(): NxeViewerApi {\n const session = this.session;\n return {\n get currentPage(): number {\n return session.pageIndex();\n },\n set currentPage(value: number) {\n session.goToPage(value);\n },\n get pagesCount(): number {\n return session.pageCount();\n },\n get reportType(): string {\n return 'Report';\n },\n };\n }\n\n private context(): NxeRequestContext {\n return {\n requestUrl: this.requestUrl(),\n properties: this.properties(),\n postParametersFunction: this.postParametersFunction(),\n strings: NXE_ENGLISH,\n };\n }\n}\n","/*\n * Public API Surface of @nexterajs/report-viewer\n */\n\nexport { NXE_VIEWER_PROTOCOL } from './lib/protocol/nxe-protocol.const';\nexport {\n NxeReportViewerComponent,\n type NxeViewerApi,\n} from './lib/viewer/nxe-report-viewer.component';\nexport type { NxeViewerFailure } from './lib/protocol/nxe-protocol.model';\nexport type {\n NxePostParametersData,\n NxePostParametersFunction,\n} from './lib/protocol/nxe-viewer-client.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAAA;;;AAGG;AACI,MAAM,mBAAmB,GAAG;;ACJnC;;;;;;;AAOG;AAEH;;;AAGG;AACH,MAAM,gBAAgB,GAAG;IACvB,QAAQ;IACR,UAAU;IACV,UAAU;IACV,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,QAAQ;IACR,OAAO;IACP,UAAU;IACV,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,OAAO;IACP,QAAQ;IACR,OAAO;IACP,SAAS;IACT,MAAM;IACN,KAAK;IACL,SAAS;AACV,CAAA,CAAC,IAAI,CAAC,GAAG,CAAC;AAEX;AACA,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAC7B,MAAM;IACN,YAAY;IACZ,KAAK;IACL,QAAQ;IACR,YAAY;IACZ,QAAQ;IACR,YAAY;AACb,CAAA,CAAC;AAEF;AACA,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAEtD,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AAEhE;;;;AAIG;AACG,SAAU,SAAS,CAAC,SAAiB,EAAE,KAAa,EAAA;IACxD,IAAI,OAAO,GAAG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